Revision: 201003 PDK_3.0.g
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 02 Feb 2010 07:56:43 +0200
changeset 0 15bf7259bb7c
child 3 d8a3531bc6b8
child 4 80692712d2d6
child 13 8f67d927ea57
Revision: 201003
exampleapps/alfexanalogdialer/data/Thumbs.db
exampleapps/alfexanalogdialer/data/background.png
exampleapps/alfexanalogdialer/data/numbers.png
exampleapps/alfexanalogdialer/data/plate.png
exampleapps/alfexanalogdialer/data/stopper.png
exampleapps/alfexanalogdialer/group/alfexanalogdialer.loc
exampleapps/alfexanalogdialer/group/alfexanalogdialer.mmp
exampleapps/alfexanalogdialer/group/alfexanalogdialer.rss
exampleapps/alfexanalogdialer/group/alfexanalogdialer_UID_.cpp
exampleapps/alfexanalogdialer/group/alfexanalogdialer_reg.rss
exampleapps/alfexanalogdialer/group/bld.inf
exampleapps/alfexanalogdialer/inc/alfexanalogdialer.hrh
exampleapps/alfexanalogdialer/inc/alfexanalogdialer.pan
exampleapps/alfexanalogdialer/inc/alfexanalogdialerapplication.h
exampleapps/alfexanalogdialer/inc/alfexanalogdialerappui.h
exampleapps/alfexanalogdialer/inc/alfexanalogdialercontrol.h
exampleapps/alfexanalogdialer/inc/alfexanalogdialerdocument.h
exampleapps/alfexanalogdialer/inc/alfexanalogdialerfeedback.h
exampleapps/alfexanalogdialer/rom/alfexanalogdialer.iby
exampleapps/alfexanalogdialer/sis/alfexanalogdialer.pkg
exampleapps/alfexanalogdialer/sis/alfexanalogdialer.sis
exampleapps/alfexanalogdialer/sis/alfexanalogdialer.sisx
exampleapps/alfexanalogdialer/sis/createsisx.bat
exampleapps/alfexanalogdialer/src/alfexanalogdialer.cpp
exampleapps/alfexanalogdialer/src/alfexanalogdialerapplication.cpp
exampleapps/alfexanalogdialer/src/alfexanalogdialerappui.cpp
exampleapps/alfexanalogdialer/src/alfexanalogdialercontrol.cpp
exampleapps/alfexanalogdialer/src/alfexanalogdialercontrol2.cpp
exampleapps/alfexanalogdialer/src/alfexanalogdialerdocument.cpp
exampleapps/alfexanalogdialer/src/alfexanalogdialerfeedback.cpp
exampleapps/alfexcalendar/gfx/background.svg
exampleapps/alfexcalendar/gfx/calendar.jpg
exampleapps/alfexcalendar/gfx/controlpane.svg
exampleapps/alfexcalendar/gfx/eventsdaybutton.svg
exampleapps/alfexcalendar/gfx/normaldaybutton.svg
exampleapps/alfexcalendar/gfx/selectedday.svg
exampleapps/alfexcalendar/gfx/title.svg
exampleapps/alfexcalendar/group/alfexcalendar.mmp
exampleapps/alfexcalendar/group/alfexcalendar.rss
exampleapps/alfexcalendar/group/alfexcalendar_loc.rls
exampleapps/alfexcalendar/group/alfexcalendar_loc.rss
exampleapps/alfexcalendar/group/alfexcalendar_reg.rss
exampleapps/alfexcalendar/group/bld.inf
exampleapps/alfexcalendar/inc/alfexcalendar.hrh
exampleapps/alfexcalendar/inc/alfexcalendar.loc
exampleapps/alfexcalendar/inc/alfexcalendar.pan
exampleapps/alfexcalendar/inc/alfexcalendarapplication.h
exampleapps/alfexcalendar/inc/alfexcalendarappui.h
exampleapps/alfexcalendar/inc/alfexcalendardeckcontrol.h
exampleapps/alfexcalendar/inc/alfexcalendardocument.h
exampleapps/alfexcalendar/inc/alfexcalendarengine.h
exampleapps/alfexcalendar/inc/alfexcalendarengineeventtimer.h
exampleapps/alfexcalendar/inc/alfexcalendarmonth.h
exampleapps/alfexcalendar/sis/alfexcalendar.pkg
exampleapps/alfexcalendar/sis/alfexcalendar.sis
exampleapps/alfexcalendar/sis/alfexcalendar.sisx
exampleapps/alfexcalendar/sis/createsisx.bat
exampleapps/alfexcalendar/sis/rd-key.pem
exampleapps/alfexcalendar/sis/rd.cer
exampleapps/alfexcalendar/src/alfexcalendar.cpp
exampleapps/alfexcalendar/src/alfexcalendarapplication.cpp
exampleapps/alfexcalendar/src/alfexcalendarappui.cpp
exampleapps/alfexcalendar/src/alfexcalendardeckcontrol.cpp
exampleapps/alfexcalendar/src/alfexcalendardocument.cpp
exampleapps/alfexcalendar/src/alfexcalendarengine.cpp
exampleapps/alfexcalendar/src/alfexcalendarengineeventtimer.cpp
exampleapps/alfexcalendar/src/alfexcalendarmonth.cpp
exampleapps/alfexstickers/Readme.txt
exampleapps/alfexstickers/gfx/photo/application_bg.svg
exampleapps/alfexstickers/gfx/photo/sticker_blue.svg
exampleapps/alfexstickers/gfx/photo/sticker_green.svg
exampleapps/alfexstickers/gfx/photo/sticker_pink.svg
exampleapps/alfexstickers/gfx/photo/sticker_yellow.svg
exampleapps/alfexstickers/group/AlfExStickers.loc
exampleapps/alfexstickers/group/AlfExStickers.mmp
exampleapps/alfexstickers/group/AlfExStickers.rss
exampleapps/alfexstickers/group/AlfExStickers_loc.rls
exampleapps/alfexstickers/group/AlfExStickers_loc.rss
exampleapps/alfexstickers/group/AlfExStickers_reg.rss
exampleapps/alfexstickers/group/bld.inf
exampleapps/alfexstickers/inc/AlfExStickers.pan
exampleapps/alfexstickers/inc/AlfExStickersControl.h
exampleapps/alfexstickers/inc/alfexstickerlayout.h
exampleapps/alfexstickers/inc/alfexstickers.hrh
exampleapps/alfexstickers/inc/alfexstickersapplication.h
exampleapps/alfexstickers/inc/alfexstickersappui.h
exampleapps/alfexstickers/inc/alfexstickersdocument.h
exampleapps/alfexstickers/sis/alfexstickers.pkg
exampleapps/alfexstickers/sis/sisTool.pl
exampleapps/alfexstickers/src/AlfExStickersControl.cpp
exampleapps/alfexstickers/src/Series_60_APP_ReadMe.txt
exampleapps/alfexstickers/src/alfexstickerlayout.cpp
exampleapps/alfexstickers/src/alfexstickers.cpp
exampleapps/alfexstickers/src/alfexstickersapplication.cpp
exampleapps/alfexstickers/src/alfexstickersappui.cpp
exampleapps/alfexstickers/src/alfexstickersdocument.cpp
group/bld.inf
group/stdinc.mmh
inc/group/Doxyfile.txt
inc/group/Doxyfile_osn.txt
inc/group/bld.inf
layers.sysdef.xml
package_definition.xml
rom/alfcollect.iby
rom/alfeditors.iby
rom/alfred.iby
rom/alftranseffectplugin.iby
sysdef_1_4_0.dtd
systemDefinition.xml
systemDefinitionLayer.xml
uiaccelerator_plat/alf_client_server_api/alf_client_server_api.metaxml
uiaccelerator_plat/alf_client_server_api/group/bld.inf
uiaccelerator_plat/alf_client_server_api/inc/alf/alfappserver.h
uiaccelerator_plat/alf_client_server_api/inc/alf/alfappsrvsessionbase.h
uiaccelerator_plat/alf_client_server_api/inc/alf/alfappui.h
uiaccelerator_plat/alf_client_server_api/inc/alf/alfclientbase.h
uiaccelerator_plat/alf_client_server_api/inc/alf/alfdirectclient.h
uiaccelerator_plat/alf_core_toolkit_api/alf_core_toolkit_api.metaxml
uiaccelerator_plat/alf_core_toolkit_api/group/bld.inf
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiAnchorLayout.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiAnimatedTexture.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiBitmapProvider.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiBorderBrush.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiBrush.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiBrushArray.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiBrushes.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCanvasCmdBufferReader.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCanvasVisual.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCommand.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiControl.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiControlGroup.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCurvePath.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCurvePathLayout.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiDeckLayout.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiDisplay.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiDisplayCoeControl.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiDrawing.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiDropShadowBrush.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiEnv.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiEvent.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiFlowLayout.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiFont.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiGc.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiGradientBrush.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiGridLayout.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiImage.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiImageBrush.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiImageLoaderUtil.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiImageVisual.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiInteractionInterval.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiLayout.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiLayouts.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiLineVisual.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiMappingFunctions.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiMaterial.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiMesh.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiMeshVisual.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiObserverArray.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiOwnedPointer.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiPanic.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiPlatform.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiRealPoint.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiRealRect.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiRealSize.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiRenderer.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiRoster.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiS60Skin.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiScheduler.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiSegmentedTexture.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiSessionObject.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiShadowBorderBrush.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiShadowedTexture.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiSkin.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiSoftKeyControl.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiStatic.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTextMesh.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTextStyle.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTextStyleManager.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTextVisual.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTexture.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTextureHandle.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTextureIf.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTextureManager.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTextureProcessor.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiThemeManager.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTimeObserver.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTimedPoint.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTimedValue.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTransformation.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiUtil.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiVisual.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiVisuals.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/hitchcock.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huidisplaybackgrounditem.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huidropshadow.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huieventhandler.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huifixmath.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huifontmanager.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huifontspecification.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huiframebrush.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huigifanimationtexture.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huilowmemoryobserver.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huim3gmesh.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huimetric.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huiproceduralmesh.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huiskinanimationtexture.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huitextureautosizeparams.h
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huitk.hrh
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huitk.rh
uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huiviewportlayout.h
uiaccelerator_plat/alf_extended_visual_api/alf_extended_visual_api.metaxml
uiaccelerator_plat/alf_extended_visual_api/group/bld.inf
uiaccelerator_plat/alf_extended_visual_api/inc/alf/AlfTransEffectPlugin.h
uiaccelerator_plat/alf_extended_visual_api/inc/alf/AlfTransEffectPlugin.hrh
uiaccelerator_plat/alf_extended_visual_api/inc/alf/alflctanchorlayout.h
uiaccelerator_plat/alf_extended_visual_api/inc/alf/alflctgridlayout.h
uiaccelerator_plat/alf_extended_visual_api/inc/alf/alflcttextvisual.h
uiaccelerator_plat/alf_extended_visual_api/inc/alf/alfsrveffectenv.h
uiaccelerator_plat/alf_extension_api/alf_extension_api.metaxml
uiaccelerator_plat/alf_extension_api/group/bld.inf
uiaccelerator_plat/alf_extension_api/inc/alf/alfbrushhandlers.h
uiaccelerator_plat/alf_extension_api/inc/alf/alfconstants.h
uiaccelerator_plat/alf_extension_api/inc/alf/alfextensionfactory.h
uiaccelerator_plat/alf_extension_api/inc/alf/alfhintplugin.h
uiaccelerator_plat/alf_extension_api/inc/alf/alflayouthandlers.h
uiaccelerator_plat/alf_extension_api/inc/alf/alfred.hrh
uiaccelerator_plat/alf_extension_api/inc/alf/alfserverutils.h
uiaccelerator_plat/alf_extension_api/inc/alf/alfvisualhandlers.h
uiaccelerator_plat/alf_extension_api/inc/alf/ftokenclient.h
uiaccelerator_plat/alf_tracing_api/alf_tracing_api.metaxml
uiaccelerator_plat/alf_tracing_api/group/bld.inf
uiaccelerator_plat/alf_tracing_api/inc/alf/alflayoutmetrics.h
uiaccelerator_plat/alf_tracing_api/inc/alf/alfmetricsinterface.h
uiaccelerator_plat/alf_tracing_api/inc/alf/alftraceextclient.h
uiaccelerator_plat/alf_tracing_api/inc/alf/alftraceinterface.h
uiaccelerator_plat/alf_tracing_api/inc/uiacceltk/HuiProbe.h
uiaccelerator_plat/alf_visual_api/alf_visual_api.metaxml
uiaccelerator_plat/alf_visual_api/group/bld.inf
uiaccelerator_plat/alf_visual_api/inc/alf/alfanchorlayout.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfbatchbuffer.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfbitmapprovider.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfborderbrush.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfbrush.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfbrusharray.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfcanvasvisual.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfclientwindow.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfcommand.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionclient.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionutility.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfcontrol.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfcontrolgroup.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfcurvepath.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfcurvepathlayout.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfdecklayout.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfdisplay.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfdisplaybackgrounditem.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfdropshadow.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfdropshadowbrush.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfenv.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfenvobject.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfevent.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfeventhandler.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfflowlayout.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfframebrush.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfgc.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfgencomponent.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfgradientbrush.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfgridlayout.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfimage.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfimagebrush.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfimageloaderutil.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfimagevisual.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfinputcapabilitiessupplier.h
uiaccelerator_plat/alf_visual_api/inc/alf/alflayout.h
uiaccelerator_plat/alf_visual_api/inc/alf/alflinevisual.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfm3gmesh.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfmappingfunctions.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfmaterial.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfmesh.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfmeshvisual.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfmetric.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfownership.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfplaintexteditorcontrol.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfproceduralmesh.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfproperty.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfpropertyowner.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfrealline.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfroster.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfscreenbuffer.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfscrollerevent.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfshadowborderbrush.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfstatic.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfsymbiansbdrawer.h
uiaccelerator_plat/alf_visual_api/inc/alf/alftextstyle.h
uiaccelerator_plat/alf_visual_api/inc/alf/alftextstylemanager.h
uiaccelerator_plat/alf_visual_api/inc/alf/alftexture.h
uiaccelerator_plat/alf_visual_api/inc/alf/alftextureautosizeparams.h
uiaccelerator_plat/alf_visual_api/inc/alf/alftexturegroup.h
uiaccelerator_plat/alf_visual_api/inc/alf/alftexturemanager.h
uiaccelerator_plat/alf_visual_api/inc/alf/alftextureprocessor.h
uiaccelerator_plat/alf_visual_api/inc/alf/alftextvisual.h
uiaccelerator_plat/alf_visual_api/inc/alf/alftimedvalue.h
uiaccelerator_plat/alf_visual_api/inc/alf/alftransformation.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfutil.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfversion.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfviewportlayout.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfvisual.h
uiaccelerator_plat/alf_visual_api/inc/alf/alfvisualfactory.h
uiaccelerator_plat/alf_visual_api/inc/goommonitor/goommonitor.h
uiaccelerator_plat/alf_visual_api/inc/goommonitor/goommonitorplugin.h
uiaccelerator_plat/alf_visual_api/inc/goommonitor/goommonitorplugin.hrh
uiaccelerator_plat/alf_visual_api/inc/goommonitor/goommonitorsession.h
uiaccelerator_plat/alf_visual_api/tsrc/data/alfbatchextplugin.rss
uiaccelerator_plat/alf_visual_api/tsrc/group/alfbatchextplugin.mmp
uiaccelerator_plat/alf_visual_api/tsrc/group/bld.inf
uiaccelerator_plat/alf_visual_api/tsrc/group/testplatalfvisual.mmp
uiaccelerator_plat/alf_visual_api/tsrc/group/testplatalfvisual.pkg
uiaccelerator_plat/alf_visual_api/tsrc/inc/alfbatchextplugin.h
uiaccelerator_plat/alf_visual_api/tsrc/inc/alfbatchextpluginconstants.h
uiaccelerator_plat/alf_visual_api/tsrc/inc/testplatalfvisual.h
uiaccelerator_plat/alf_visual_api/tsrc/init/testplatalfvisual.ini
uiaccelerator_plat/alf_visual_api/tsrc/src/alfbatchextplugin.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisual.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocks.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksanchorlayout.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksbatchbuffer.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksborderbrush.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksbrush.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksbrusharray.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockscommand.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockscontrol.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockscontrolgroup.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockscurvepath.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockscurvepathlayout.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksdecklayout.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksdisplay.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksdisplaybackgrounditem.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksdropshadow.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksdropshadowbrush.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksenv.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksevent.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksflowlayout.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksframebrush.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksgencomponent.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksgradientbrush.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksgridlayout.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksimage.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksimagebrush.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksimageloaderutil.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksimagevisual.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockslayout.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockslinevisual.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksm3gmesh.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksmappingfunctions.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksmaterial.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksmesh.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksmeshvisual.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksmetric.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksproceduralmesh.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockspropertyowner.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksroster.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksscreenbuffer.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksscrollerevent.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksshadowborderbrush.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksstatic.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockssymbiansbdrawer.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstextstyle.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstextstylemanager.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstexture.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstextureautosizeparams.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstexturegroup.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstexturemanager.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstextureprocessor.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstextvisual.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstimedvalue.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstransformation.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksutil.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksviewportlayout.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksvisual.cpp
uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksvisualfactory.cpp
uiaccelerator_plat/apidoc_images/CAlfCurvePath_ArcDefinition.png
uiaccelerator_plat/group/Doxyfile.txt
uiaccelerator_plat/group/Doxyfile_coretoolkit.txt
uiaccelerator_plat/group/bld.inf
uiacceltk/group/bld.inf
uiacceltk/hitchcock/AlfCommandDebug/bwins/alfcommanddebugu.def
uiacceltk/hitchcock/AlfCommandDebug/eabi/alfcommanddebugu.def
uiacceltk/hitchcock/AlfCommandDebug/group/alfcommanddebug.mmp
uiacceltk/hitchcock/AlfCommandDebug/group/alfcommanddescriptions.rss
uiacceltk/hitchcock/AlfCommandDebug/src/alfcommanddebug.cpp
uiacceltk/hitchcock/AlfDecoderServerClient/bwins/alfdecoderserverclientu.def
uiacceltk/hitchcock/AlfDecoderServerClient/eabi/alfdecoderserverclientu.def
uiacceltk/hitchcock/AlfDecoderServerClient/src/alfcompositionclient.cpp
uiacceltk/hitchcock/AlfDecoderServerClient/src/alfdecoderserverclient.cpp
uiacceltk/hitchcock/AlfDecoderServerClient/src/alfdecoderserverclient.mmp
uiacceltk/hitchcock/AlfHintPlugin/bwins/alfhintpluginu.def
uiacceltk/hitchcock/AlfHintPlugin/eabi/alfhintpluginu.def
uiacceltk/hitchcock/AlfHintPlugin/group/AlfHintPlugin.mmp
uiacceltk/hitchcock/AlfHintPlugin/group/AlfHintPluginDrawer.mmp
uiacceltk/hitchcock/AlfHintPlugin/group/alfhintplugindrawer.rss
uiacceltk/hitchcock/AlfHintPlugin/group/bld.inf
uiacceltk/hitchcock/AlfHintPlugin/inc/alfhintplugindrawer.h
uiacceltk/hitchcock/AlfHintPlugin/src/alfcrpplugintest.cpp
uiacceltk/hitchcock/AlfHintPlugin/src/alfhintplugin.cpp
uiacceltk/hitchcock/AlfHintPlugin/src/alfhintplugindrawer.cpp
uiacceltk/hitchcock/AlfHintPlugin/winscw/alfhintpluginu.def
uiacceltk/hitchcock/AlfRenderStage/group/alfnonsupportedwscommands.rss
uiacceltk/hitchcock/AlfRenderStage/group/alfrenderstage.rss
uiacceltk/hitchcock/AlfRenderStage/group/alfrenderstageplugin.mmp
uiacceltk/hitchcock/AlfRenderStage/group/bld.inf
uiacceltk/hitchcock/AlfRenderStage/inc/alfasynchgoomsession.h
uiacceltk/hitchcock/AlfRenderStage/inc/alfrenderstage.h
uiacceltk/hitchcock/AlfRenderStage/inc/alfrenderstagefactory.h
uiacceltk/hitchcock/AlfRenderStage/inc/alfrsgc.h
uiacceltk/hitchcock/AlfRenderStage/inc/alfrssendbuffer.h
uiacceltk/hitchcock/AlfRenderStage/src/alfasynchgoomsession.cpp
uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstage.cpp
uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstagefactory.cpp
uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstageplugin.cpp
uiacceltk/hitchcock/AlfRenderStage/src/alfrsgc.cpp
uiacceltk/hitchcock/AlfRenderStage/src/alfrssendbuffer.cpp
uiacceltk/hitchcock/Client/BWINS/alfclientu.DEF
uiacceltk/hitchcock/Client/eabi/alfclientu.DEF
uiacceltk/hitchcock/Client/inc/alfclient.h
uiacceltk/hitchcock/Client/inc/alfcommandscheduler.h
uiacceltk/hitchcock/Client/inc/alfcontrolgroupsubsession.h
uiacceltk/hitchcock/Client/inc/alfdisplaysubsession.h
uiacceltk/hitchcock/Client/inc/alfpanic.h
uiacceltk/hitchcock/Client/inc/alfskinnableimage.h
uiacceltk/hitchcock/Client/inc/alftransformationsubsession.h
uiacceltk/hitchcock/Client/sis/Client.pkg
uiacceltk/hitchcock/Client/src/alfanchorlayout.cpp
uiacceltk/hitchcock/Client/src/alfbatchbuffer.cpp
uiacceltk/hitchcock/Client/src/alfborderbrush.cpp
uiacceltk/hitchcock/Client/src/alfbrush.cpp
uiacceltk/hitchcock/Client/src/alfbrusharray.cpp
uiacceltk/hitchcock/Client/src/alfcanvasvisual.cpp
uiacceltk/hitchcock/Client/src/alfclient.cpp
uiacceltk/hitchcock/Client/src/alfclient.mmp
uiacceltk/hitchcock/Client/src/alfclientBase.cpp
uiacceltk/hitchcock/Client/src/alfclientwindow.cpp
uiacceltk/hitchcock/Client/src/alfcommand.cpp
uiacceltk/hitchcock/Client/src/alfcommandscheduler.cpp
uiacceltk/hitchcock/Client/src/alfcontrol.cpp
uiacceltk/hitchcock/Client/src/alfcontrolgroup.cpp
uiacceltk/hitchcock/Client/src/alfcontrolgroupsubsession.cpp
uiacceltk/hitchcock/Client/src/alfcurvepath.cpp
uiacceltk/hitchcock/Client/src/alfcurvepathlayout.cpp
uiacceltk/hitchcock/Client/src/alfdecklayout.cpp
uiacceltk/hitchcock/Client/src/alfdirectclient.cpp
uiacceltk/hitchcock/Client/src/alfdisplay.cpp
uiacceltk/hitchcock/Client/src/alfdisplaybackgrounditem.cpp
uiacceltk/hitchcock/Client/src/alfdisplaysubsession.cpp
uiacceltk/hitchcock/Client/src/alfdropshadow.cpp
uiacceltk/hitchcock/Client/src/alfdropshadowbrush.cpp
uiacceltk/hitchcock/Client/src/alfenv.cpp
uiacceltk/hitchcock/Client/src/alfevent.cpp
uiacceltk/hitchcock/Client/src/alfflowlayout.cpp
uiacceltk/hitchcock/Client/src/alfframebrush.cpp
uiacceltk/hitchcock/Client/src/alfgc.cpp
uiacceltk/hitchcock/Client/src/alfgencomponent.cpp
uiacceltk/hitchcock/Client/src/alfgradientbrush.cpp
uiacceltk/hitchcock/Client/src/alfgridlayout.cpp
uiacceltk/hitchcock/Client/src/alfimage.cpp
uiacceltk/hitchcock/Client/src/alfimagebrush.cpp
uiacceltk/hitchcock/Client/src/alfimageloaderutil.cpp
uiacceltk/hitchcock/Client/src/alfimagevisual.cpp
uiacceltk/hitchcock/Client/src/alflayout.cpp
uiacceltk/hitchcock/Client/src/alflayoutmetrics.cpp
uiacceltk/hitchcock/Client/src/alflctanchorlayout.cpp
uiacceltk/hitchcock/Client/src/alflctgridlayout.cpp
uiacceltk/hitchcock/Client/src/alflcttextvisual.cpp
uiacceltk/hitchcock/Client/src/alflinevisual.cpp
uiacceltk/hitchcock/Client/src/alfm3gmesh.cpp
uiacceltk/hitchcock/Client/src/alfmappingfunctions.cpp
uiacceltk/hitchcock/Client/src/alfmesh.cpp
uiacceltk/hitchcock/Client/src/alfmeshvisual.cpp
uiacceltk/hitchcock/Client/src/alfmetric.cpp
uiacceltk/hitchcock/Client/src/alfpanic.cpp
uiacceltk/hitchcock/Client/src/alfproceduralmesh.cpp
uiacceltk/hitchcock/Client/src/alfproperty.cpp
uiacceltk/hitchcock/Client/src/alfpropertyowner.cpp
uiacceltk/hitchcock/Client/src/alfroster.cpp
uiacceltk/hitchcock/Client/src/alfscreenbuffer.cpp
uiacceltk/hitchcock/Client/src/alfscrollerevent.cpp
uiacceltk/hitchcock/Client/src/alfshadowborderbrush.cpp
uiacceltk/hitchcock/Client/src/alfskinnableimage.cpp
uiacceltk/hitchcock/Client/src/alfstatic.cpp
uiacceltk/hitchcock/Client/src/alfsymbiansbdrawer.cpp
uiacceltk/hitchcock/Client/src/alftextstyle.cpp
uiacceltk/hitchcock/Client/src/alftextstylemanager.cpp
uiacceltk/hitchcock/Client/src/alftexture.cpp
uiacceltk/hitchcock/Client/src/alftextureautosizeparams.cpp
uiacceltk/hitchcock/Client/src/alftexturegroup.cpp
uiacceltk/hitchcock/Client/src/alftexturemanager.cpp
uiacceltk/hitchcock/Client/src/alftextureprocessor.cpp
uiacceltk/hitchcock/Client/src/alftextvisual.cpp
uiacceltk/hitchcock/Client/src/alftimedvalue.cpp
uiacceltk/hitchcock/Client/src/alftransformation.cpp
uiacceltk/hitchcock/Client/src/alftransformationsubsession.cpp
uiacceltk/hitchcock/Client/src/alfutil.cpp
uiacceltk/hitchcock/Client/src/alfviewportlayout.cpp
uiacceltk/hitchcock/Client/src/alfvisual.cpp
uiacceltk/hitchcock/Client/src/alfvisualfactory.cpp
uiacceltk/hitchcock/CommonInc/alfappfwproxyops.h
uiacceltk/hitchcock/CommonInc/alfbridgecommands.h
uiacceltk/hitchcock/CommonInc/alfclientserver.h
uiacceltk/hitchcock/CommonInc/alfclientserver.inl
uiacceltk/hitchcock/CommonInc/alfcommanddebug.h
uiacceltk/hitchcock/CommonInc/alfdecoderserverclient.h
uiacceltk/hitchcock/CommonInc/alfhintapi.h
uiacceltk/hitchcock/CommonInc/alfhintpluginuids.h
uiacceltk/hitchcock/CommonInc/alflogger.h
uiacceltk/hitchcock/CommonInc/alfloggingconfiguration.h
uiacceltk/hitchcock/CommonInc/alfpanicreasons.h
uiacceltk/hitchcock/CommonInc/alfrenderstageutils.h
uiacceltk/hitchcock/CommonInc/alfuids.h
uiacceltk/hitchcock/CommonInc/alfwindowstructs.h
uiacceltk/hitchcock/CommonInc/coretkoptions.mmh
uiacceltk/hitchcock/CommonInc/eglext.h
uiacceltk/hitchcock/CommonInc/huicompileroptions.mmh
uiacceltk/hitchcock/CommonInc/huiwscanvascommands.h
uiacceltk/hitchcock/CommonInc/mwsgraphicscontexttobitgdimappings.h
uiacceltk/hitchcock/CommonInc/uiacceltkdomaincrkeys.h
uiacceltk/hitchcock/ServerCore/BWINS/alfappservercoreu.DEF
uiacceltk/hitchcock/ServerCore/Inc/alfappsrvsession.h
uiacceltk/hitchcock/ServerCore/Inc/alfbridge.h
uiacceltk/hitchcock/ServerCore/Inc/alfframestamp.h
uiacceltk/hitchcock/ServerCore/Inc/alfhierarchymodel.h
uiacceltk/hitchcock/ServerCore/Inc/alfmappingfunctionhandlers.h
uiacceltk/hitchcock/ServerCore/Inc/alfnodes.h
uiacceltk/hitchcock/ServerCore/Inc/alfscreen.h
uiacceltk/hitchcock/ServerCore/Inc/alfshareddisplaycoecontrol.h
uiacceltk/hitchcock/ServerCore/Inc/alfsrvcontrolgroupsubsession.h
uiacceltk/hitchcock/ServerCore/Inc/alfsrvdisplaysubsession.h
uiacceltk/hitchcock/ServerCore/Inc/alfsrvdropshadowhandler.h
uiacceltk/hitchcock/ServerCore/Inc/alfsrvresourcemanager.h
uiacceltk/hitchcock/ServerCore/Inc/alfsrvscreenbuffermanager.h
uiacceltk/hitchcock/ServerCore/Inc/alfsrvsettingshandler.h
uiacceltk/hitchcock/ServerCore/Inc/alfsrvsubsessionbase.h
uiacceltk/hitchcock/ServerCore/Inc/alfsrvtexturemanager.h
uiacceltk/hitchcock/ServerCore/Inc/alfsrvtranseffect.h
uiacceltk/hitchcock/ServerCore/Inc/alfsrvtransformationsubsession.h
uiacceltk/hitchcock/ServerCore/Inc/alfsrvvisualowner.h
uiacceltk/hitchcock/ServerCore/Inc/alfstaticfactory.h
uiacceltk/hitchcock/ServerCore/Inc/alfstreamerbridge.h
uiacceltk/hitchcock/ServerCore/Inc/alfstreamerconsts.h
uiacceltk/hitchcock/ServerCore/Inc/alfstreamerserver.h
uiacceltk/hitchcock/ServerCore/Inc/alfstreameruids.h
uiacceltk/hitchcock/ServerCore/Inc/alftextstylehandlers.h
uiacceltk/hitchcock/ServerCore/Inc/alfwindow.h
uiacceltk/hitchcock/ServerCore/Inc/alfwindowbuffer.h
uiacceltk/hitchcock/ServerCore/Inc/alfwindowdata.h
uiacceltk/hitchcock/ServerCore/Inc/alfwindowfxplugin.h
uiacceltk/hitchcock/ServerCore/Inc/alfwindowmanager.h
uiacceltk/hitchcock/ServerCore/Inc/malfsrvtexturemanagerclient.h
uiacceltk/hitchcock/ServerCore/Inc/themerepositorylistener.h
uiacceltk/hitchcock/ServerCore/Src/alfappserver.cpp
uiacceltk/hitchcock/ServerCore/Src/alfappservercore.mmp
uiacceltk/hitchcock/ServerCore/Src/alfappsrvsession.cpp
uiacceltk/hitchcock/ServerCore/Src/alfappsrvsessionBase.cpp
uiacceltk/hitchcock/ServerCore/Src/alfappui.cpp
uiacceltk/hitchcock/ServerCore/Src/alfbridge.cpp
uiacceltk/hitchcock/ServerCore/Src/alfbrushhandlers.cpp
uiacceltk/hitchcock/ServerCore/Src/alfhierarchymodel.cpp
uiacceltk/hitchcock/ServerCore/Src/alflayouthandlers.cpp
uiacceltk/hitchcock/ServerCore/Src/alfmappingfunctionhandlers.cpp
uiacceltk/hitchcock/ServerCore/Src/alfnodes.cpp
uiacceltk/hitchcock/ServerCore/Src/alfscreen.cpp
uiacceltk/hitchcock/ServerCore/Src/alfserverutils.cpp
uiacceltk/hitchcock/ServerCore/Src/alfshareddisplaycoecontrol.cpp
uiacceltk/hitchcock/ServerCore/Src/alfsrvcontrolgroupsubsession.cpp
uiacceltk/hitchcock/ServerCore/Src/alfsrvdisplaysubsession.cpp
uiacceltk/hitchcock/ServerCore/Src/alfsrvdropshadowhandler.cpp
uiacceltk/hitchcock/ServerCore/Src/alfsrveffectenv.cpp
uiacceltk/hitchcock/ServerCore/Src/alfsrvresourcemanager.cpp
uiacceltk/hitchcock/ServerCore/Src/alfsrvscreenbuffermanager.cpp
uiacceltk/hitchcock/ServerCore/Src/alfsrvsettingshandler.cpp
uiacceltk/hitchcock/ServerCore/Src/alfsrvsubsessionbase.cpp
uiacceltk/hitchcock/ServerCore/Src/alfsrvtexturemanager.cpp
uiacceltk/hitchcock/ServerCore/Src/alfsrvtranseffect.cpp
uiacceltk/hitchcock/ServerCore/Src/alfsrvtransformationsubsession.cpp
uiacceltk/hitchcock/ServerCore/Src/alfsrvvisualowner.cpp
uiacceltk/hitchcock/ServerCore/Src/alfstaticfactory.cpp
uiacceltk/hitchcock/ServerCore/Src/alfstreamerbridge.cpp
uiacceltk/hitchcock/ServerCore/Src/alfstreamerserver.cpp
uiacceltk/hitchcock/ServerCore/Src/alftextstylehandlers.cpp
uiacceltk/hitchcock/ServerCore/Src/alfvisualhandlers.cpp
uiacceltk/hitchcock/ServerCore/Src/alfwindow.cpp
uiacceltk/hitchcock/ServerCore/Src/alfwindowbuffer.cpp
uiacceltk/hitchcock/ServerCore/Src/alfwindowfxplugin.cpp
uiacceltk/hitchcock/ServerCore/Src/alfwindowmanager.cpp
uiacceltk/hitchcock/ServerCore/Src/themerepositorylistener.cpp
uiacceltk/hitchcock/ServerCore/eabi/alfappservercoreu.DEF
uiacceltk/hitchcock/ServerCore/sis/ServerCore.pkg
uiacceltk/hitchcock/ServerInterface/inc/alfapplication.h
uiacceltk/hitchcock/ServerInterface/inc/alfdocument.h
uiacceltk/hitchcock/ServerInterface/sis/serverinterface.pkg
uiacceltk/hitchcock/ServerInterface/src/alfapplication.cpp
uiacceltk/hitchcock/ServerInterface/src/alfdocument.cpp
uiacceltk/hitchcock/ServerInterface/src/alfredserver.mmp
uiacceltk/hitchcock/ServerInterface/src/alfredserver.rss
uiacceltk/hitchcock/ServerInterface/src/alfredserver_reg.rss
uiacceltk/hitchcock/ServerStub/Proxy_src/AlfAppFwProxy.cpp
uiacceltk/hitchcock/ServerStub/Proxy_src/alfappfwproxy.mmp
uiacceltk/hitchcock/ServerStub/Proxy_src/alfappfwproxy.rss
uiacceltk/hitchcock/ServerStub/Proxy_src/alfappfwproxy_defs.h
uiacceltk/hitchcock/ServerStub/src/alfserver.cpp
uiacceltk/hitchcock/ServerStub/src/alfserver.mmp
uiacceltk/hitchcock/TokenServer/ClientSrc/ftokenclient.cpp
uiacceltk/hitchcock/TokenServer/ClientSrc/ftokenclient.mmp
uiacceltk/hitchcock/TokenServer/Inc/ftokeconsts.h
uiacceltk/hitchcock/TokenServer/Inc/ftokenconsts.h
uiacceltk/hitchcock/TokenServer/Inc/ftokenserver.h
uiacceltk/hitchcock/TokenServer/Inc/ftokenuids.h
uiacceltk/hitchcock/TokenServer/SrvSrc/ftokenserver.cpp
uiacceltk/hitchcock/TokenServer/SrvSrc/ftokenserver.mmp
uiacceltk/hitchcock/TokenServer/bwins/ftokenclientu.def
uiacceltk/hitchcock/TokenServer/eabi/ftokenclientu.def
uiacceltk/hitchcock/backgroundanim/group/bganimhost.mmp
uiacceltk/hitchcock/backgroundanim/group/bld.inf
uiacceltk/hitchcock/backgroundanim/inc/bganimhost.h
uiacceltk/hitchcock/backgroundanim/inc/highrestimer.h
uiacceltk/hitchcock/backgroundanim/inc/plugininterface.h
uiacceltk/hitchcock/backgroundanim/inc/screensaverpropertylistener.h
uiacceltk/hitchcock/backgroundanim/inc/sensor.h
uiacceltk/hitchcock/backgroundanim/inc/themerepositorylistener.h
uiacceltk/hitchcock/backgroundanim/install/bganim.pkg
uiacceltk/hitchcock/backgroundanim/refplugin/bwins/bga_reference_pluginu.def
uiacceltk/hitchcock/backgroundanim/refplugin/data/reffragmentshader.fsh
uiacceltk/hitchcock/backgroundanim/refplugin/data/refvertexshader.vsh
uiacceltk/hitchcock/backgroundanim/refplugin/eabi/bga_reference_pluginu.def
uiacceltk/hitchcock/backgroundanim/refplugin/group/refplugin.mmp
uiacceltk/hitchcock/backgroundanim/refplugin/inc/shader.h
uiacceltk/hitchcock/backgroundanim/refplugin/src/plugin.c
uiacceltk/hitchcock/backgroundanim/refplugin/src/shader.c
uiacceltk/hitchcock/backgroundanim/rom/bganimhost.iby
uiacceltk/hitchcock/backgroundanim/src/bganimhost.cpp
uiacceltk/hitchcock/backgroundanim/src/highrestimer.cpp
uiacceltk/hitchcock/backgroundanim/src/main.cpp
uiacceltk/hitchcock/backgroundanim/src/screensaverpropertylistener.cpp
uiacceltk/hitchcock/backgroundanim/src/sensor.cpp
uiacceltk/hitchcock/backgroundanim/src/themerepositorylistener.cpp
uiacceltk/hitchcock/cenrep/keys_s60uiacceltk.xls
uiacceltk/hitchcock/conf/s60uiacceltk.confml
uiacceltk/hitchcock/conf/s60uiacceltk_10283344.crml
uiacceltk/hitchcock/coretoolkit/BWINS/hitchcocku.DEF
uiacceltk/hitchcock/coretoolkit/eabi/hitchcocku.DEF
uiacceltk/hitchcock/coretoolkit/group/Doxyfile.txt
uiacceltk/hitchcock/coretoolkit/group/Doxyfile_internal.txt
uiacceltk/hitchcock/coretoolkit/group/bld.inf
uiacceltk/hitchcock/coretoolkit/group/bld_publicsdk.inf
uiacceltk/hitchcock/coretoolkit/group/coretoolkit.mmp
uiacceltk/hitchcock/coretoolkit/group/huitk_base.mmp
uiacceltk/hitchcock/coretoolkit/group/huitk_publicsdk.mmp
uiacceltk/hitchcock/coretoolkit/inc/HuiCmdBufferBrush.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxColorParameter.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxConstants.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffect.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffectCache.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffectParser.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxEngine.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxFilter.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxFilterLayer.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxGroupLayer.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxLayer.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxParameter.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxParameter.inl
uiacceltk/hitchcock/coretoolkit/inc/HuiFxParameterCollection.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxParameterManager.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxRenderbuffer.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxScalarParameter.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxTimeLine.h
uiacceltk/hitchcock/coretoolkit/inc/HuiFxTimeLine.inl
uiacceltk/hitchcock/coretoolkit/inc/HuiFxVisualLayer.h
uiacceltk/hitchcock/coretoolkit/inc/HuiMatrixStack.h
uiacceltk/hitchcock/coretoolkit/inc/HuiRasterizedTextMesh.h
uiacceltk/hitchcock/coretoolkit/inc/HuiRenderPlugin.h
uiacceltk/hitchcock/coretoolkit/inc/HuiRenderPluginBase.h
uiacceltk/hitchcock/coretoolkit/inc/HuiRenderPluginBase.inl
uiacceltk/hitchcock/coretoolkit/inc/HuiRenderSurface.h
uiacceltk/hitchcock/coretoolkit/inc/HuiRosterEntry.h
uiacceltk/hitchcock/coretoolkit/inc/HuiRosterImpl.h
uiacceltk/hitchcock/coretoolkit/inc/HuiS60TextStyle.h
uiacceltk/hitchcock/coretoolkit/inc/HuiTargetBitmap.h
uiacceltk/hitchcock/coretoolkit/inc/HuiVisualFactory.h
uiacceltk/hitchcock/coretoolkit/inc/Matrix.h
uiacceltk/hitchcock/coretoolkit/inc/MatrixStack.h
uiacceltk/hitchcock/coretoolkit/inc/Util.h
uiacceltk/hitchcock/coretoolkit/inc/Variable.h
uiacceltk/hitchcock/coretoolkit/inc/huicanvasalfpainter.h
uiacceltk/hitchcock/coretoolkit/inc/huicanvasbackground.h
uiacceltk/hitchcock/coretoolkit/inc/huicanvasdebugwsgc.h
uiacceltk/hitchcock/coretoolkit/inc/huicanvasgc.h
uiacceltk/hitchcock/coretoolkit/inc/huicanvaspainter.h
uiacceltk/hitchcock/coretoolkit/inc/huicanvasrenderbuffer.h
uiacceltk/hitchcock/coretoolkit/inc/huicanvastexturecache.h
uiacceltk/hitchcock/coretoolkit/inc/huicanvaswsbitgc.h
uiacceltk/hitchcock/coretoolkit/inc/huicanvaswsgc.h
uiacceltk/hitchcock/coretoolkit/inc/huicanvaswshwgc.h
uiacceltk/hitchcock/coretoolkit/inc/huicanvaswspainter.h
uiacceltk/hitchcock/coretoolkit/inc/huicanvaswsswgc.h
uiacceltk/hitchcock/coretoolkit/inc/huicurvepathprivdata.h
uiacceltk/hitchcock/coretoolkit/inc/huieffectable.h
uiacceltk/hitchcock/coretoolkit/inc/huilayoutdata.h
uiacceltk/hitchcock/coretoolkit/inc/huilongtapdetector.h
uiacceltk/hitchcock/coretoolkit/inc/huiskinbackroundlayout.h
uiacceltk/hitchcock/coretoolkit/inc/huistatictlsdata.h
uiacceltk/hitchcock/coretoolkit/inc/huitextureanimationstate.h
uiacceltk/hitchcock/coretoolkit/inc/hwatranseffect.h
uiacceltk/hitchcock/coretoolkit/inc/hwatranseffectuids.h
uiacceltk/hitchcock/coretoolkit/rendervg10/group/huirendervg10.mmp
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10BevelFilter.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10BlurFilter.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10BrightnessContrastFilter.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10ColorMatrixFilterBase.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10ColorizeFilter.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10Engine.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10FilterBase.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10HSLFilter.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10OffscreenRenderbuffer.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10OnscreenRenderbuffer.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10OutlineFilter.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10RenderbufferBase.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10TransformFilter.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10CurvePath.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10Gc.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10PBufferSurface.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10RenderPlugin.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10RenderSurface.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10Texture.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10TextureManager.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10TextureProcessor.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10VgImageBinder.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/huivg10canvasgc.h
uiacceltk/hitchcock/coretoolkit/rendervg10/inc/huivg10canvasrenderbuffer.h
uiacceltk/hitchcock/coretoolkit/rendervg10/src/200184B7.rss
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10BevelFilter.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10BlurFilter.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10BrightnessContrastFilter.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10ColorMatrixFilterBase.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10ColorizeFilter.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10Engine.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10FilterBase.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10HSLFilter.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10OffscreenRenderbuffer.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10OnscreenRenderbuffer.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10OutlineFilter.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10RenderbufferBase.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10TransformFilter.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10CurvePath.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Gc.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10PBufferSurface.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10RenderPlugin.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10RenderSurface.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Texture.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10TextureManager.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10TextureProcessor.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10VGImageBinder.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/huivg10canvasgc.cpp
uiacceltk/hitchcock/coretoolkit/rendervg10/src/huivg10canvasrenderbuffer.cpp
uiacceltk/hitchcock/coretoolkit/sis/createsisx.bat
uiacceltk/hitchcock/coretoolkit/sis/huitk.pkg
uiacceltk/hitchcock/coretoolkit/sis/huitk_debug.pkg
uiacceltk/hitchcock/coretoolkit/sis/huitk_stub.pkg
uiacceltk/hitchcock/coretoolkit/sis/huitk_update.pkg
uiacceltk/hitchcock/coretoolkit/sis/huitk_update_debug.pkg
uiacceltk/hitchcock/coretoolkit/src/HuiAnchorLayout.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiAnimatedTexture.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiBorderBrush.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiBrush.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiBrushArray.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiCanvasCmdBufferReader.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiCanvasTextureCache.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiCanvasVisual.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiCmdBufferBrush.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiCommand.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiControl.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiControlGroup.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiCurvePath.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiCurvePathLayout.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiDeckLayout.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiDisplay.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiDisplayCoeControl.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiDropShadowBrush.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiEnv.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiEnv_stubs.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiEvent.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiFlowLayout.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiFont.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiFxColorParameter.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiFxEffect.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiFxEffectCache.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiFxEffectParser.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiFxEngine.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiFxFilter.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiFxFilterLayer.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiFxGroupLayer.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiFxLayer.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiFxParameter.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiFxParameterManager.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiFxRenderbuffer.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiFxScalarParameter.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiFxVisualLayer.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiGc.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiGradientBrush.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiGridLayout.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiImage.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiImageBrush.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiImageLoaderUtil.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiImageVisual.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiInteractionInterval.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiLayout.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiLineVisual.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiMappingFunctions.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiMaterial.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiMatrixStack.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiMesh.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiMeshVisual.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiPanic.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiRasterizedTextMesh.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiRenderPlugin.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiRenderSurface.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiRoster.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiRosterEntry.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiRosterImpl.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiS60Skin.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiS60TextStyle.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiScheduler.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiSegmentedTexture.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiShadowBorderBrush.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiSkin.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiSoftKeyControl.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiStatic.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiStatic_stubs.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiTextMesh.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiTextStyle.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiTextStyleManager.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiTextVisual.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiTexture.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiTextureHandle.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiTextureManager.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiTextureProcessor.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiThemeManager.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiTimedPoint.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiTimedValue.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiTransformation.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiUtil.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiVisual.cpp
uiacceltk/hitchcock/coretoolkit/src/HuiVisualFactory.cpp
uiacceltk/hitchcock/coretoolkit/src/huicanvasalfpainter.cpp
uiacceltk/hitchcock/coretoolkit/src/huicanvasbackground.cpp
uiacceltk/hitchcock/coretoolkit/src/huicanvasdebugwsgc.cpp
uiacceltk/hitchcock/coretoolkit/src/huicanvasgc.cpp
uiacceltk/hitchcock/coretoolkit/src/huicanvaspainter.cpp
uiacceltk/hitchcock/coretoolkit/src/huicanvasrenderbuffer.cpp
uiacceltk/hitchcock/coretoolkit/src/huicanvaswsbitgc.cpp
uiacceltk/hitchcock/coretoolkit/src/huicanvaswshwgc.cpp
uiacceltk/hitchcock/coretoolkit/src/huicanvaswspainter.cpp
uiacceltk/hitchcock/coretoolkit/src/huicanvaswsswgc.cpp
uiacceltk/hitchcock/coretoolkit/src/huidisplaybackgrounditem.cpp
uiacceltk/hitchcock/coretoolkit/src/huidropshadow.cpp
uiacceltk/hitchcock/coretoolkit/src/huieventhandler.cpp
uiacceltk/hitchcock/coretoolkit/src/huifixmath.cpp
uiacceltk/hitchcock/coretoolkit/src/huifontmanager.cpp
uiacceltk/hitchcock/coretoolkit/src/huifontspecification.cpp
uiacceltk/hitchcock/coretoolkit/src/huiframebrush.cpp
uiacceltk/hitchcock/coretoolkit/src/huigifanimationtexture.cpp
uiacceltk/hitchcock/coretoolkit/src/huilongtapdetector.cpp
uiacceltk/hitchcock/coretoolkit/src/huim3gmesh.cpp
uiacceltk/hitchcock/coretoolkit/src/huimetric.cpp
uiacceltk/hitchcock/coretoolkit/src/huiproceduralmesh.cpp
uiacceltk/hitchcock/coretoolkit/src/huiskinanimationtexture.cpp
uiacceltk/hitchcock/coretoolkit/src/huiskinbackgroundlayout.cpp
uiacceltk/hitchcock/coretoolkit/src/huitextureanimationstate.cpp
uiacceltk/hitchcock/coretoolkit/src/huitextureautosizeparams.cpp
uiacceltk/hitchcock/coretoolkit/src/huiviewportlayout.cpp
uiacceltk/hitchcock/goommonitor/bwins/goommonitoru.DEF
uiacceltk/hitchcock/goommonitor/data/goomconfig.xml
uiacceltk/hitchcock/goommonitor/eabi/goommonitoru.DEF
uiacceltk/hitchcock/goommonitor/group/bld.inf
uiacceltk/hitchcock/goommonitor/group/goommonitor.mmp
uiacceltk/hitchcock/goommonitor/inc/goomaction.h
uiacceltk/hitchcock/goommonitor/inc/goomactionconfig.h
uiacceltk/hitchcock/goommonitor/inc/goomactionconfig.inl
uiacceltk/hitchcock/goommonitor/inc/goomactionlist.h
uiacceltk/hitchcock/goommonitor/inc/goomactionlist.inl
uiacceltk/hitchcock/goommonitor/inc/goomactionref.h
uiacceltk/hitchcock/goommonitor/inc/goomappclosetimer.h
uiacceltk/hitchcock/goommonitor/inc/goomappclosewatcher.h
uiacceltk/hitchcock/goommonitor/inc/goomapplicationconfig.h
uiacceltk/hitchcock/goommonitor/inc/goomapplicationconfig.inl
uiacceltk/hitchcock/goommonitor/inc/goomcloseapp.h
uiacceltk/hitchcock/goommonitor/inc/goomcloseapp.inl
uiacceltk/hitchcock/goommonitor/inc/goomcloseappconfig.h
uiacceltk/hitchcock/goommonitor/inc/goomcloseappconfig.inl
uiacceltk/hitchcock/goommonitor/inc/goomconfig.h
uiacceltk/hitchcock/goommonitor/inc/goomconfig.inl
uiacceltk/hitchcock/goommonitor/inc/goomconfigparser.h
uiacceltk/hitchcock/goommonitor/inc/goomconstants.hrh
uiacceltk/hitchcock/goommonitor/inc/goomforegroundrule.h
uiacceltk/hitchcock/goommonitor/inc/goomforegroundrule.inl
uiacceltk/hitchcock/goommonitor/inc/goomglobalconfig.h
uiacceltk/hitchcock/goommonitor/inc/goomglobalconfig.inl
uiacceltk/hitchcock/goommonitor/inc/goomidletimerule.h
uiacceltk/hitchcock/goommonitor/inc/goomidletimerule.inl
uiacceltk/hitchcock/goommonitor/inc/goomlog.h
uiacceltk/hitchcock/goommonitor/inc/goommemorymonitor.h
uiacceltk/hitchcock/goommonitor/inc/goommemorymonitorserver.h
uiacceltk/hitchcock/goommonitor/inc/goommemorymonitorsession.h
uiacceltk/hitchcock/goommonitor/inc/goommonitorclientserver.h
uiacceltk/hitchcock/goommonitor/inc/goompanic.h
uiacceltk/hitchcock/goommonitor/inc/goompluginwaiter.h
uiacceltk/hitchcock/goommonitor/inc/goomruleconfig.h
uiacceltk/hitchcock/goommonitor/inc/goomrunplugin.h
uiacceltk/hitchcock/goommonitor/inc/goomrunplugin.inl
uiacceltk/hitchcock/goommonitor/inc/goomrunpluginconfig.h
uiacceltk/hitchcock/goommonitor/inc/goomrunpluginconfig.inl
uiacceltk/hitchcock/goommonitor/inc/goomtraces.h
uiacceltk/hitchcock/goommonitor/inc/goomwindowgrouplist.h
uiacceltk/hitchcock/goommonitor/inc/goomwindowgrouplist.inl
uiacceltk/hitchcock/goommonitor/inc/goomwserveventreceiver.h
uiacceltk/hitchcock/goommonitor/inc/traceconfiguration.hrh
uiacceltk/hitchcock/goommonitor/inc/tracedefs.h
uiacceltk/hitchcock/goommonitor/rom/goommonitor.iby
uiacceltk/hitchcock/goommonitor/src/goomIdletimerule.cpp
uiacceltk/hitchcock/goommonitor/src/goomaction.cpp
uiacceltk/hitchcock/goommonitor/src/goomactionconfig.cpp
uiacceltk/hitchcock/goommonitor/src/goomactionlist.cpp
uiacceltk/hitchcock/goommonitor/src/goomactionref.cpp
uiacceltk/hitchcock/goommonitor/src/goomappclosetimer.cpp
uiacceltk/hitchcock/goommonitor/src/goomappclosewatcher.cpp
uiacceltk/hitchcock/goommonitor/src/goomapplicationconfig.cpp
uiacceltk/hitchcock/goommonitor/src/goomcloseapp.cpp
uiacceltk/hitchcock/goommonitor/src/goomcloseappconfig.cpp
uiacceltk/hitchcock/goommonitor/src/goomconfig.cpp
uiacceltk/hitchcock/goommonitor/src/goomconfigparser.cpp
uiacceltk/hitchcock/goommonitor/src/goomforegroundrule.cpp
uiacceltk/hitchcock/goommonitor/src/goomglobalconfig.cpp
uiacceltk/hitchcock/goommonitor/src/goomlog.cpp
uiacceltk/hitchcock/goommonitor/src/goommemorymonitor.cpp
uiacceltk/hitchcock/goommonitor/src/goommemorymonitorserver.cpp
uiacceltk/hitchcock/goommonitor/src/goommemorymonitorsession.cpp
uiacceltk/hitchcock/goommonitor/src/goommonitor.cpp
uiacceltk/hitchcock/goommonitor/src/goommonitorplugin.cpp
uiacceltk/hitchcock/goommonitor/src/goommonitorsession.cpp
uiacceltk/hitchcock/goommonitor/src/goompanic.cpp
uiacceltk/hitchcock/goommonitor/src/goompluginwaiter.cpp
uiacceltk/hitchcock/goommonitor/src/goomrunplugin.cpp
uiacceltk/hitchcock/goommonitor/src/goomrunpluginconfig.cpp
uiacceltk/hitchcock/goommonitor/src/goomthresholdcrossedao.inl
uiacceltk/hitchcock/goommonitor/src/goomwindowgrouplist.cpp
uiacceltk/hitchcock/goommonitor/src/goomwserveventreceiver.cpp
uiacceltk/hitchcock/group/alf_exports.inc
uiacceltk/hitchcock/group/bld.inf
uiacceltk/hitchcock/group/core_exports.inc
uiacceltk/hitchcock/plugins/alfoogmplugin/group/alfoogmplugin.mmp
uiacceltk/hitchcock/plugins/alfoogmplugin/group/bld.inf
uiacceltk/hitchcock/plugins/alfoogmplugin/src/alfoogmplugin.cpp
uiacceltk/hitchcock/plugins/alfoogmplugin/src/alfoogmplugin.rss
uiacceltk/hitchcock/plugins/alftranseffect/alfgfxtransadapter/bwins/GFXTRANSADAPTERU.DEF
uiacceltk/hitchcock/plugins/alftranseffect/alfgfxtransadapter/eabi/GfxTransAdapterU.def
uiacceltk/hitchcock/plugins/alftranseffect/alfgfxtransadapter/group/gfxtransenginetfx.mmp
uiacceltk/hitchcock/plugins/alftranseffect/alfgfxtransadapter/inc/debug.h
uiacceltk/hitchcock/plugins/alftranseffect/alfgfxtransadapter/inc/gfxtransenginetfx.h
uiacceltk/hitchcock/plugins/alftranseffect/alfgfxtransadapter/src/gfxtransenginetfx.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/group/AlfTfxSrvPlugin.mmp
uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/inc/alfpsobserver.h
uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/inc/alftfxserverdef.h
uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/inc/alftfxsrvplugin.h
uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/inc/alftransitionserver.h
uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/inc/alftransitionservercontroller.h
uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/src/10282DBA.rss
uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/src/alfpsobserver.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/src/alftfxsrvplugin.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/src/alftransitionserver.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/src/alftransitionservercontroller.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/group/alftranseffectplugin.mmp
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/group/bld.inf
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfdrawerengine.h
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfgfxeffects.h
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfpolicy.h
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfpolicy.inl
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfpolicyhandler.h
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfpolicyrequesthandler.h
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfserverdrawer.h
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfsystemeffects.h
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alftfxplugincommon.hrh
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alftfxserverobserver.h
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/debug.h
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/debuglogger.h
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/repositoryhandler.h
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/statehandler.h
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/states.h
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/uidblock.h
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/uidexception.h
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/wsserverdrawercontroller.h
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/sis/alftranseffectplugin.pkg
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/sis/createsisx.bat
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/10282CAF.rss
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfgfxeffects.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfpolicy.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfpolicyhandler.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfpolicyrequesthandler.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfserverdrawer.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfsystemeffects.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alftfxplugincommon.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/debuglogger.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/repositoryhandler.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/statehandler.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/states.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/tfxalfplugin.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/uidblock.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/uidexception.cpp
uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/wsserverdrawercontroller.cpp
uiacceltk/hitchcock/plugins/openwfcrs/group/alfopenwfrs.iby
uiacceltk/hitchcock/plugins/openwfcrs/group/alfopenwfrs.mmp
uiacceltk/hitchcock/plugins/openwfcrs/group/bld.inf
uiacceltk/hitchcock/plugins/openwfcrs/inc/debugbardrawer.h
uiacceltk/hitchcock/plugins/openwfcrs/inc/directgdigcwrapper.h
uiacceltk/hitchcock/plugins/openwfcrs/inc/displaypolicy.h
uiacceltk/hitchcock/plugins/openwfcrs/inc/displayrenderstage.h
uiacceltk/hitchcock/plugins/openwfcrs/inc/displayrenderstagefactory.h
uiacceltk/hitchcock/plugins/openwfcrs/inc/elementwrapper.h
uiacceltk/hitchcock/plugins/openwfcrs/inc/mwsgraphicscontexttodirectgdimappings.h
uiacceltk/hitchcock/plugins/openwfcrs/inc/openwfcjob.h
uiacceltk/hitchcock/plugins/openwfcrs/inc/openwfcjobmanager.h
uiacceltk/hitchcock/plugins/openwfcrs/inc/openwfcpanics.h
uiacceltk/hitchcock/plugins/openwfcrs/inc/openwfcthreadmanager.h
uiacceltk/hitchcock/plugins/openwfcrs/inc/openwfcwrapper.h
uiacceltk/hitchcock/plugins/openwfcrs/inc/panic.h
uiacceltk/hitchcock/plugins/openwfcrs/inc/rendertarget.h
uiacceltk/hitchcock/plugins/openwfcrs/inc/rsdisplaychangeao.h
uiacceltk/hitchcock/plugins/openwfcrs/inc/screencaptureutil.h
uiacceltk/hitchcock/plugins/openwfcrs/inc/utils.h
uiacceltk/hitchcock/plugins/openwfcrs/src/alfopenwfrs.rss
uiacceltk/hitchcock/plugins/openwfcrs/src/displaypolicy.cpp
uiacceltk/hitchcock/plugins/openwfcrs/src/displayrenderstage.cpp
uiacceltk/hitchcock/plugins/openwfcrs/src/displayrenderstagefactory.cpp
uiacceltk/hitchcock/plugins/openwfcrs/src/elementwrapper.cpp
uiacceltk/hitchcock/plugins/openwfcrs/src/openwfcjob.cpp
uiacceltk/hitchcock/plugins/openwfcrs/src/openwfcjobmanager.cpp
uiacceltk/hitchcock/plugins/openwfcrs/src/openwfcthreadmanager.cpp
uiacceltk/hitchcock/plugins/openwfcrs/src/openwfcwrapper.cpp
uiacceltk/hitchcock/plugins/openwfcrs/src/rsdisplaychangeao.cpp
uiacceltk/hitchcock/plugins/openwfcrs/src/screencaptureutil.cpp
uiacceltk/hitchcock/plugins/openwfcrs/src/stdplugin.cpp
uiacceltk/hitchcock/plugins/openwfcrs/src/utils.cpp
uiacceltk/hitchcock/sis/createsisx.bat
uiacceltk/hitchcock/sis/createstubsis.bat
uiacceltk/hitchcock/sis/createupdatesis.bat
uiacceltk/hitchcock/sis/hitchcock.pkg
uiacceltk/hitchcock/sis/uiaccelerator.pkg
uiacceltk/hitchcock/sis/uiaccelerator_base.pkg
uiacceltk/hitchcock/sis/uiaccelerator_stub.pkg
uiacceltk/hitchcock/sis/uiaccelerator_stub.sis
uiacceltk/hitchcock/sis/uiaccelerator_update.pkg
uiacceltk/hitchcock/tsrc/alfdebugextension/bwins/alfdebugu.def
uiacceltk/hitchcock/tsrc/alfdebugextension/data/alfdebugserver.rss
uiacceltk/hitchcock/tsrc/alfdebugextension/eabi/alfdebugu.def
uiacceltk/hitchcock/tsrc/alfdebugextension/group/alfdebug.mmp
uiacceltk/hitchcock/tsrc/alfdebugextension/group/alfdebugserver.mmp
uiacceltk/hitchcock/tsrc/alfdebugextension/group/bld.inf
uiacceltk/hitchcock/tsrc/alfdebugextension/group/exports.inc
uiacceltk/hitchcock/tsrc/alfdebugextension/inc/alfdebug.h
uiacceltk/hitchcock/tsrc/alfdebugextension/inc/alfdebugextensionconstants.h
uiacceltk/hitchcock/tsrc/alfdebugextension/inc/alfdebugimpl.h
uiacceltk/hitchcock/tsrc/alfdebugextension/inc/alfdebugserver.h
uiacceltk/hitchcock/tsrc/alfdebugextension/inc/alfdebuguid.h
uiacceltk/hitchcock/tsrc/alfdebugextension/rom/alfdebugextension.iby
uiacceltk/hitchcock/tsrc/alfdebugextension/sis/alfdebugextension.pkg
uiacceltk/hitchcock/tsrc/alfdebugextension/sis/alfdebugextensionplugin.pkg
uiacceltk/hitchcock/tsrc/alfdebugextension/sis/createsisx.bat
uiacceltk/hitchcock/tsrc/alfdebugextension/src/alfdebug.cpp
uiacceltk/hitchcock/tsrc/alfdebugextension/src/alfdebugserver.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/data/alfperfapp.rss
uiacceltk/hitchcock/tsrc/alfperfapp/data/alfperfapp_reg.rss
uiacceltk/hitchcock/tsrc/alfperfapp/data/alfperfappdaemon.rss
uiacceltk/hitchcock/tsrc/alfperfapp/data/alfperfappdaemon_reg.rss
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/3musk.mif
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/Discoveryhd.png
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/Thumbs.db
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfperfapp_imagetest.gif
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfperfapp_imagetest.png
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfperfapp_imagetest.svg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfperfapp_imagetest_NVGCS.mif
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfperfapp_test1.mbm
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos1.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos2.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos3.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos4.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos5.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos6.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos7.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos8.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos9.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_2mpx.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_5mpx.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small1.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small2.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small3.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small4.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small5.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small6.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small7.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small8.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small9.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_vga.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/icons_mif_new2.mif
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/jim.PNG
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/jpg_sun.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/jpg_sun_small.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/mtv3.png
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/mtv3_scifi.png
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/nationalgeographic.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/nelonen.PNG
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/people.jpg
uiacceltk/hitchcock/tsrc/alfperfapp/gfx/people.png
uiacceltk/hitchcock/tsrc/alfperfapp/group/alfperfapp.mmp
uiacceltk/hitchcock/tsrc/alfperfapp/group/alfperfapp_icons_dc.mk
uiacceltk/hitchcock/tsrc/alfperfapp/group/alfperfappdaemon.mmp
uiacceltk/hitchcock/tsrc/alfperfapp/group/bld.inf
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfapp.hrh
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfapp.rh
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappapplication.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappappui.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappavkontestcase.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappbasetestcasecontrol.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappconfigconstants.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappconstants.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappcovertestcase.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappdaemon.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappdocument.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappframeworktestcase.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappgallerytestcase.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappimagetestcase.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfapplayouttestcase.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappmodel.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappsuiteepgcontrol.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappsuiteflags.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappsuitehelper.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappsuitepeoplecontrol.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappsuitetestcase.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappsuitetestcasecontrol.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappsuitetestcasescroll.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfapptestcase.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfapptestcaseexecutionview.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfapptestcasefactory.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfapptestcaseselectionview.h
uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfapptexttestcase.h
uiacceltk/hitchcock/tsrc/alfperfapp/rom/alfperfapp.iby
uiacceltk/hitchcock/tsrc/alfperfapp/sis/alfperfapp.pkg
uiacceltk/hitchcock/tsrc/alfperfapp/sis/createsisx.bat
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappapplication.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappappui.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappavkontestcase.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappbasetestcasecontrol.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappcovertestcase.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappdaemon.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappdocument.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappframeworktestcase.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappgallerytestcase.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappimagetestcase.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfapplayouttestcase.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappmodel.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappsuiteepgcontrol.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappsuitehelper.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappsuitepeoplecontrol.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappsuitetestcase.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappsuitetestcasecontrol.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappsuitetestcasescroll.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfapptestcaseexecutionview.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfapptestcasefactory.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfapptestcaseselectionview.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfapptexttestcase.cpp
uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperftestcase.cpp
Binary file exampleapps/alfexanalogdialer/data/Thumbs.db has changed
Binary file exampleapps/alfexanalogdialer/data/background.png has changed
Binary file exampleapps/alfexanalogdialer/data/numbers.png has changed
Binary file exampleapps/alfexanalogdialer/data/plate.png has changed
Binary file exampleapps/alfexanalogdialer/data/stopper.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/group/alfexanalogdialer.loc	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Localization strings for project Analog Dialer
+*
+*/
+
+
+
+// d:Command in options list in short term memories.
+// d:Opens the call list view that is focused.
+// l:list_single_popup_menu_pane_1
+// r:5.0
+//
+//#define qtn_ad_title "AnalogDialer"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/group/alfexanalogdialer.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project Analog Dialer
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+CAPABILITY None
+
+#ifdef __UI_FRAMEWORKS_V2__
+TARGETPATH	/sys/bin
+#if defined(EKA2) || !defined(WINS)
+TARGET          alfexanalogdialer.exe
+TARGETTYPE exe
+#else // EKA1 WINS
+TARGET          alfexanalogdialer.app
+TARGETTYPE exedll
+deffile /epoc32/release/wins/alfexanalogdialer.def
+#endif
+#else // __UI_FRAMEWORKS_V2__
+TARGET          alfexanalogdialer.app
+TARGETPATH      /system/apps/alfexanalogdialer
+TARGETTYPE app
+#endif
+
+UID             0x100039CE 0x2001247F 
+
+LANG            SC
+
+SOURCEPATH      ../src
+SOURCE          alfexanalogdialer.cpp
+SOURCE          alfexanalogdialerapplication.cpp 
+SOURCE          alfexanalogdialerappUi.cpp
+SOURCE          alfexanalogdialerdocument.cpp 
+SOURCE          alfexanalogdialercontrol.cpp 
+SOURCE          alfexanalogdialerfeedback.cpp 
+
+SOURCEPATH      ../group
+
+USERINCLUDE       ../inc 
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY         euser.lib
+LIBRARY         apparc.lib
+LIBRARY         cone.lib 
+LIBRARY         eikcore.lib  
+LIBRARY         avkon.lib  
+LIBRARY         gdi.lib  
+LIBRARY         efsrv.lib       // RFs
+
+LIBRARY         alfclient.lib
+
+LIBRARY         touchfeedback.lib
+
+#ifdef __UI_FRAMEWORKS_V2__
+START RESOURCE 	alfexanalogdialer.rss
+HEADER
+TARGETPATH      /resource/apps
+LANG		    SC 
+END
+#else
+RESOURCE        alfexanalogdialer.rss
+#endif
+
+#ifdef __UI_FRAMEWORKS_V2__
+START RESOURCE	alfexanalogdialer_reg.rss
+// Do not change the UID 10003a3f below.
+TARGETPATH      /private/10003a3f/apps
+END
+   
+SOURCEPATH      ../group
+DOCUMENT        alfexanalogdialer.loc
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/group/alfexanalogdialer.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Resource definitions for project Analog Dialer
+*
+*/
+
+
+
+NAME ANAD
+
+#include <avkon.rsg>
+#include <eikon.rh>
+#include <eikon.rsg>
+#include <avkon.rh>
+
+#include "alfexanalogdialer.hrh"
+#include "alfexanalogdialer.loc"
+
+
+// ---------------------------------------------------------
+// Define the resource file signature 
+// This resource should be empty.
+// ---------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE { }
+//RESOURCE TBUF { buf=""; }
+
+// ---------------------------------------------------------
+// r_default_document_name
+//
+// ---------------------------------------------------------
+//	
+RESOURCE TBUF r_default_document_name { buf=""; }
+
+// ---------------------------------------------------------
+// EIK_APP_INFO
+// Define default status pane layout, menu and CBA keys.
+// ---------------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    menubar = r_analogdialer_menubar;
+    //cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
+    status_pane = r_status_pane;
+    }
+    
+// ---------------------------------------------------------
+// r_status_pane 
+// Default status layout: empty
+// ---------------------------------------------------------
+//
+RESOURCE STATUS_PANE_APP_MODEL r_status_pane
+    {
+    layout = R_AVKON_STATUS_PANE_LAYOUT_EMPTY;
+    }
+
+
+// ---------------------------------------------------------
+// r_analogialer_menubar
+// Menubar
+// ---------------------------------------------------------
+//
+RESOURCE MENU_BAR r_analogdialer_menubar
+    {
+    titles =
+        {
+        MENU_TITLE {menu_pane = r_analogdialer_menu;}
+        };
+    }
+
+// ---------------------------------------------------------
+// r_analogdialer_menu
+// Options menu pane
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_analogdialer_menu
+    {
+    items = 
+        {
+        MENU_ITEM {command = EAknSoftkeyExit;   txt = "Exit";}
+        };
+    }
+
+	
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/group/alfexanalogdialer_UID_.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,22 @@
+/*
+* 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: 
+*
+*/
+
+// Makmake-generated uid source file
+#include <e32cmn.h>
+#pragma data_seg(".SYMBIAN")
+__EMULATOR_IMAGE_HEADER2(0x1000007a,0x100039ce,0x2001247f,EPriorityForeground,0x00000000u,0x00000000u,0x2001247f,0,0x00010000,0)
+#pragma data_seg()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/group/alfexanalogdialer_reg.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Application registration resource file for Analog Dialer
+*
+*/
+
+
+
+//AnalogDialer application's registration resource file 
+
+#include <appinfo.rh>
+
+// UIDs for Analog Dialer
+UID2 KUidAppRegistrationResourceFile
+UID3 0x2001247F
+
+// ---------------------------------------------------------------------------
+// APP_REGISTRATION_INFO
+// ---------------------------------------------------------------------------
+//
+RESOURCE APP_REGISTRATION_INFO 
+	{
+	app_file="alfexanalogdialer";
+
+	localisable_resource_file= APP_RESOURCE_DIR"\\alfexanalogdialer";
+    //localisable_resource_id = R_ANALOGDIALER_LOCALISABLE_APP_INFO;
+
+	//
+	group_name = "UI Acceler";
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Build information file for project for Analog Dialer
+*
+*/
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../data/background.png /epoc32/winscw/c/Data/Images/Pictures/background.png
+../data/numbers.png /epoc32/winscw/c/Data/Images/Pictures/numbers.png
+../data/plate.png /epoc32/winscw/c/Data/Images/Pictures/plate.png
+../data/stopper.png /epoc32/winscw/c/Data/Images/Pictures/stopper.png
+
+PRJ_MMPFILES
+alfexanalogdialer.mmp
+
+PRJ_TESTMMPFILES
+
+PRJ_TESTEXPORTS
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/inc/alfexanalogdialer.hrh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Resource headers for Analog Dialer
+*
+*/
+
+
+
+#ifndef ANALOGDIALER_APPLICATION_HRH
+#define ANALOGDIALER_APPLICATION_HRH
+
+/** AlfExAnalogDialer command codes */
+enum TAlfExAnalogDialerIds
+    {
+    EAlfExAnalogDialerCommand1 = 1,  // start value must not be 0
+    EAlfExAnalogDialerCommand2 = 2
+    };
+
+
+#endif // ANALOGDIALER_APPLICATION_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/inc/alfexanalogdialer.pan	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Panic codes of Analog Dialer
+*
+*/
+
+
+
+#ifndef ANALOGDIALER_APPLICATION_PAN
+#define ANALOGDIALER_APPLICATION_PAN
+
+/** AlfExAnalogDialer application panic codes */
+enum TAlfExAnalogDialerPanics 
+    {
+    EAlfExAnalogDialerBasicUi = 1
+    // add further panics here
+    };
+
+/**
+ * Panics the current thread with the "AlfExAnalogDialer" panic category 
+ * and the panic number specified by TAlfExAnalogDialerPanics
+ *
+ * @since S60 5.0
+ * @param aReason  The panic number.
+ */
+
+inline void Panic(TAlfExAnalogDialerPanics aReason)
+    {
+	_LIT(applicationName,"AlfExAnalogDialer");
+    User::Panic(applicationName, aReason);
+    }
+
+#endif // ANALOGDIALER_APPLICATION_PAN
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/inc/alfexanalogdialerapplication.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Application class for Analog Dialer example application, which
+*                implements rotating dial pad.
+*
+*/
+
+
+
+#ifndef ANALOGDIALER_APPLICATION_H
+#define ANALOGDIALER_APPLICATION_H
+
+#include <aknapp.h>
+
+/**
+ *  Application class for Analog Dialer
+ *
+ *  @since S60 5.0
+ */
+class CAlfExAnalogDialerApplication : public CAknApplication
+    {
+
+public:
+
+
+    /* Methods. */
+
+// from base class CAknApplication
+
+    /**
+     * From CAknApplication
+     * Returns the application UID
+     *
+     * @result the UID of this Application/Dll
+     */
+    TUid AppDllUid() const;
+
+// from base class ?base_class2
+
+
+
+protected:
+
+
+// from base class CAknApplication
+
+    /**
+     * From CAknApplication
+     * Create a CApaDocument object and return a pointer to it
+     *
+     * @result a pointer to the created document
+     */
+    CApaDocument* CreateDocumentL();
+
+    };
+
+#endif // ANALOGDIALER_APPLICATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/inc/alfexanalogdialerappui.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Application UI class for Analog Dialer example application, which
+*                implements rotating dial pad.
+*
+*/
+
+
+
+#ifndef ANALOGDIALER_APPLICATION_H
+#define ANALOGDIALER_APPLICATION_H
+
+#include <aknappui.h>
+#include <alf/alfenv.h>
+#include <alf/alfdisplay.h>
+
+// Forward reference
+//class CAlfExAnalogDialerControl
+
+class CAlfDeckLayout;
+/**
+ *  Application UI class for Analog Dialer
+ *
+ *  @since S60 5.0
+ */
+class CAlfExAnalogDialerAppUi : public CAknAppUi
+    {
+public:
+
+    
+    /* Constructors and destructor. */
+
+    /**
+     * Constructor of CAlfExAnalogDialerAppUi
+     * This needs to be public due to the way the framework constructs the AppUi 
+     *
+     * @since S60 5.0
+     */
+    CAlfExAnalogDialerAppUi();
+
+    /**
+     * Second phase constructor of CAlfExAnalogDialerAppUi
+     * This needs to be public due to the way the framework constructs the AppUi 
+     *
+     * @since S60 5.0
+     */
+    void ConstructL();
+
+
+    /**
+     * Destructor of CAlfExAnalogDialerAppUi
+     * Destroy the object and release all memory objects
+     *
+     * @since S60 5.0
+     */
+    virtual ~CAlfExAnalogDialerAppUi();
+
+
+    /* Methods. */
+
+// from base class CAknAppUi
+
+    /**
+     * From CAknAppUi
+     * Receives command from framework
+     *
+     * @param aId system or application command Id 
+     */
+    void HandleCommandL(TInt aCommand);
+
+    /**
+     * From CAknAppUi
+     * Handles a change to switch in display orientation.
+     * This function calls CAknAppUi::HandleResourceChangeL().
+     *
+     * @param aType The type of resources that have changed.
+     */
+    void HandleResourceChangeL(TInt aType);
+    
+    /** 
+     * From CAknAppUi
+     * Handle system events. Release resources during FG->BG
+     * transition, and restore resource during BG->FG transitions.
+     * This is not mandatory, but reduces memory consumption of the 
+     * application when it is in the background.
+     * @param aEvent event from framework
+     * @param aDestination a Symbian OS CCoeControl, for which event occurre
+     */		
+    void HandleWsEventL(const TWsEvent& aEvent,
+	                    CCoeControl*    aDestination);
+
+
+private:
+
+    /**
+     * Pointer to ALF Environment
+     * Own.  
+     */
+    CAlfEnv* iEnv;
+    
+    };
+
+
+#endif // ANALOGDIALER_APPUI_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/inc/alfexanalogdialercontrol.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,503 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ALF control class for Analog Dialer example application, which
+*                implements rotating dial pad.
+*
+*/
+
+
+
+#ifndef ANALOGDIALER_CONTROL_H
+#define ANALOGDIALER_CONTROL_H
+
+#include <alf/alfcontrol.h>         // derivation from this class
+#include <alf/alftexturemanager.h>  // derivation from this class
+
+// Forward reference
+class CAlfGridLayout;
+class CAlfDeckLayout;
+
+// Feedback launcher
+class CAlfExAnalogDialerFeedback;
+
+// Id of this CAlfExAnalogDialerControl
+const TInt KAlfExAnalogDialerControlId = 1;
+
+// Length of number display buffer
+const TInt KNumberDisplayBufferLength = 64;
+
+/**
+ *  Control class for Analog Dialer
+ *
+ *  @since S60 5.0
+ */
+class CAlfExAnalogDialerControl :   public CAlfControl
+                                    
+
+    {
+public:
+
+    
+    /* Constructors and destructor. */
+
+    /**
+     * First phase constructor of CAlfExAnalogDialerControl.
+     *
+     * @param aEnv ALF environment
+     * @since S60 5.0
+     */
+    static CAlfExAnalogDialerControl* NewL(CAlfEnv& aEnv);
+
+    /**
+     * First phase constructor of CAlfExAnalogDialerControl.
+     *
+     * @param aEnv ALF environment
+     * @since S60 5.0
+     */
+    static CAlfExAnalogDialerControl* NewLC(CAlfEnv& aEnv);
+
+    /**
+     * Destructor of CAlfExAnalogDialerAppUi
+     *
+     * @since S60 5.0
+     */
+    virtual ~CAlfExAnalogDialerControl();
+
+    /**
+     * Prepares for layout switch
+     */
+    void PrepareForLayoutSwitchL();
+
+
+    /**
+     * Makes layout switch. The layout switch with same directionality as previous one
+     * but with different resolution is supported, too.
+     *
+     * @param aRect new layout for the screen area
+     */
+    void SwitchLayoutL();
+  
+private:
+
+
+    /* Constructors */
+
+    /**
+     * Constructor of CAlfExAnalogDialerAppUi.
+     * Private as this object must be constructed via NewL() or NewLC()
+     *
+     * @since S60 5.0
+     */
+    CAlfExAnalogDialerControl();
+
+    /**
+     * Second phase constructor of CAlfExAnalogDialerAppUi.
+     *
+     * @since S60 5.0
+     */
+    void ConstructL(CAlfEnv& aEnv);
+    
+ 
+    /* Methods. */
+   
+    /**
+     * Creates portrait layout for application
+     *
+     */
+    void SetupPortraitModeL();
+
+    /**
+     * Creates landspace layout for application
+     *
+     */
+    void SetupLandscapeModeL();
+
+// from base class CAlfControl
+    /**
+     * From CAlfControl.
+     * Called when an input event is being offered to the control.
+     *
+     * @param aEvent  Event to be handled.
+     *
+     * @return  ETrue, if the event was handled.
+     *          EFalse, otherwise
+     */
+    TBool OfferEventL(const TAlfEvent& aEvent);
+
+// own methods
+
+    /**
+     * Creates root layout for application
+     */
+    void AddGridLayoutL();
+
+    /**
+     * Create display pane to display dialed number(s)
+     */
+    void AddDisplayPaneL();
+
+    /**
+     * Create dialer pane for the application
+     */
+    void AddDialerL();
+                              
+    // 
+    enum TLayoutMode
+        {
+        ELayoutAnalogDialerPortrait=0,
+        ELayoutAnalogDialerLandscape,
+        };
+                                
+    /**
+     * Resolves current layout data. Layout rectangular is retrieved from Alf environment
+     *
+     * @param aShorterSide smaller extent of application rectangular
+     * @param aLongerSide bigger extent of application rectangular
+     * 
+     * @return  TLayoutMode
+     * @since S60 5.0
+     */
+    TLayoutMode ResolveLayout(  TInt& aShorterSide,
+                                TInt& aLongerSide) const;
+
+    /**
+     * Adds dialed number into number display 
+     * @param aNumber number start from 0. Function adds internal +1 to the number
+     */
+    void AddNumberToDisplayPaneL(TInt aNumber);
+
+    /**
+     * Handles pointer down event
+     * @param   aEvent event from ALF framework
+     *
+     * @since S60 5.0
+     */
+    TBool HandlePointerDownEventL(const TAlfEvent& aEvent);
+    
+    /**
+     * Handles dragging events
+     * @param   aEvent event from ALF framework
+     *
+     * @since S60 5.0
+     */
+    TBool HandleDraggingEventL(const TAlfEvent& aEvent);
+
+    /**
+     * Handles long tap event
+     * @param   aEvent event from ALF framework
+     *
+     * @since S60 5.0
+     */
+    TBool HandlePointerLongTapEventL(const TAlfEvent& aEvent);
+
+    /**
+     * Handles pointer up event
+     * @param   aEvent event from ALF framework
+     *
+     * @since S60 5.0
+     */
+    TBool HandlePointerUpEventL(const TAlfEvent& aEvent);
+
+    /**
+     * Toggles value of iDraggingData.iIsClockWiseOverZeroReached, if zero angle of X-axis 
+     * crossed has been crossed.
+     * @param aAngle of pointer event
+     */
+    void ResolveXAxisCrossing(TInt aAngle);
+    
+    /**
+     * Calculate angle of triangle, when adjacent and opposite sides are known
+     * @param aAdjacent length of adjacent side (x-coordinate)
+     * @param aOpposite length of opposite side (y-coordinate)
+     * @return angle of position in degrees
+     */
+    static TInt Angle(TReal32 aAdjacent, TReal32 aOpposite);
+    
+    /**
+     * Calculate hypotenuse of triangle, when adjacent and opposite sides are known
+     * @param aPosition position of pointer event
+     * @return hypotenuse i.e. distance of pointer event from centre of the plate
+     */
+    static TInt Hypotenuse(const TPoint& aPosition);
+
+    /**
+     * Sets weights of grid for a new grid layout, or grid layout after orientation or resolution
+     * change. ResolveLayout() can be used to get basic input parameters
+     * 
+     * aLayout      layout of application rectangular
+     * aSquareSide  length of side of dialer pane, which must be square in form.
+     *              Value of this must be same as shorter side of application rectangular.
+     * aLongerSide  length of longer side of application rectangular
+     * aPlateTop    offset of Y-coordinate of the plate
+     */
+    static void SetWeightsOfGridL(  CAlfGridLayout& aGridLayout,
+                                    TLayoutMode     aLayout,
+                                    TInt            aSquareSide,
+                                    TInt            aLongerSide,
+                                    TInt&           aPlateTop);
+    
+    /**
+     * Converts position of TAlfEvent to plate centric position, in which centre of the 
+     * plate represents position (0, 0). 
+     * X coordinates to the left of the centre position are negative.
+     * Y coordinates above the centre position are negative.
+     *
+     * @param aEvent pointer event from Alf
+     * @param aPlateTopOffset difference between Y coordinate of top left corner of plate pane and
+     *        top left corner of screen. Value is in pixels.
+     * @param aSquareSide length of a side of plate pane square
+     * @param aPlateCentricPoint returned position
+     */
+    static void ConvertEventToPlateCentricPosition(
+                                        const TAlfEvent&    aEvent,
+	                                    TInt                aPlateTopOffset,
+	                                    TInt                aSquareSide,
+	                                    TPoint&             aPlateCentricPoint);
+
+    /**
+     * Checks whether pointer event occurs between outer and inner radius
+     * 
+     * @param aPlateCentric position of event returned by ConvertEventToPlateCentricPosition
+     * @param aOuterRadius radius of outer arc. In pixels
+     * @param aInnerRadius radius of inner arc. In pixels.
+     * @return ETrue if radius of event is <= aOuterRadius or >= aInnerRadius  
+     *         EFalse otherwise
+     */
+    static TBool IsPointerEventOnArcPath(   TPoint& aPlateCentricPoint,
+	                                        TInt    aOuterRadius,
+	                                        TInt    aInnerRadius);
+
+    /**
+     * Checks whether pointer event follows path which is between Clear area and edges of plate
+     * @param aEvent pointer event from Alf
+     * @return TBool
+     */
+    TBool IsPointerEventFollowingNumbersArcPath(const TAlfEvent& aEvent) const;
+
+    /**
+     * Checks whether pointer event occurs on Clear area
+     * @param aEvent pointer event from Alf
+     * @return TBool
+     */
+    TBool IsPointerEventOnClearKey(const TAlfEvent& aEvent) const;
+
+    /** 
+     *  Perfoms actions needed when dragging (rotating plate) has finished.
+     *  Actions are e.g. putting selected number into display, and rotating plate into idle position
+     */
+    void FinishDragging();
+	                         
+	/** 
+	 * After rotating plate ends, resets data involved in calculations of turn angle of plate image.
+	 */
+    void ResetDraggingData();
+
+	/** 
+	 * After clear key event ends, resets data involved in Clear key event.
+	 * The event started from pointer down event on Clear key area
+	 */
+    void ResetClearKeyData();
+
+    /**
+     * Rotates plate back to idle position 
+     */
+    static void RotatePlateToIdlePosition(CAlfImageVisual& aImage);
+
+    /**
+     * Rotates image to a given angle. As the angle may jump from 0->359,
+     * calculation of rotation angle becomes more complicated than subtracting initial angle from 
+     * current angle.
+     *
+     * @param aImage imagevisual to rotate
+     * @param aInitialAngle initial angle of image visual
+     * @param aTargetAngle current angle of image visual 
+     * @param aIsClockWiseOverZeroReached whether angle has jumped from 0->359
+     */
+    static void RotatePlate(CAlfImageVisual&    aImage,
+                            TInt                aInitialAngle,
+                            TInt                aTargetAngle,
+                            TBool               aIsClockWiseOverZeroReached);
+
+    /**
+     * Returns dialed number when initial angle and current angle is given.
+     * @param aInitialAngle angle value between 0-360
+     * @param aCurrentAngle angle value between 0-360
+     * @return KErrNotFound, if plate has not rotated enough to select any value
+     *         otherwise 0-9
+     */
+    TInt DialedNumber(  TInt aInitialAngle,
+                        TInt aCurrentAngle) const;
+
+    /**
+     * Puts dialed number into number display.
+     * @param aInitialAngle angle value between 0-360
+     * @param aCurrentAngle angle value between 0-360
+     */
+    void DialedNumberToDisplay( TInt aInitialAngle,
+                                TInt aCurrentAngle );
+
+    /**
+     * Clears number display; either wholly or last number.
+     * @param aClearWholeDisplay clears number display wholly
+     */
+    void ClearNumberDisplay(TBool aClearWholeDisplay);
+
+    /**
+     * Debugs dragging data + given angle into RDebug
+     */
+    void DebugDraggingData(TInt aDegrees);
+	                                    
+private:
+
+    // Image Ids for CAlfTextureManager
+    enum TAnalogDialerImageIds
+        {
+        EImageIdAnalogDialerBgPt = 1,
+        EImageIdAnalogDialerPlatePt,
+        EImageIdAnalogDialerStopperPt,
+        EImageIdAnalogDialerLast
+        };
+
+    // Tag enumeration definition. It is used in the .cpp file to index tags in tables 
+    // defined .cpp file:
+    // KTagArrayTheRest, which is tags for visuals, which are layout independent
+    // Indexing of both arrays start from 0.
+    enum TTagAnalogDialerVisual
+        {
+        ETagAnalogDialerRootLayout = 0,
+        ETagAnalogDialerDisplayDeck,
+        ETagAnalogDialerDisplayVisual,
+        ETagAnalogDialerPlateDeck,
+        ETagAnalogDialerNumbersVisual,
+        ETagAnalogDialerPlateVisual,
+        ETagAnalogDialerStopperVisual
+        };
+        
+
+     // indices for KRowsAndColumnsOfGrid and KWeightsGrid arrays defined in .cpp file
+    enum TRowsAndColumnsOfGrid
+        {
+        EColumn = 0, 
+        ERow
+        };
+
+    // indices for grid elements 
+    enum TIndicesGrid
+        {
+        EFirstGridElement = 0, 
+        ESecondGridElement
+        };
+
+    /**
+     * Data needed in calculating rotating angle of plate is grouped together.
+     */
+    struct TDraggingData
+        {
+        /** Initial pointer angle. It is used to calculate selected number.
+         *  It is especially important, if stopper was not reached. 
+         */
+        TInt    iInitialAngle;
+
+        /** Previous pointer angle. This is just used to optimise plate redrawing. 
+         *  Plate is not redrawn after every dragging event
+         */
+        TInt    iPreviousAngle;
+
+        /** 
+         *  When plate is rotated clockwise, angle of pointer position changes from 0 to 359. 
+         *  When this happens, this flag is set. When change from 359 to 0 happens,
+         *  this flag is reset.
+         */
+        TBool   iIsClockWiseOverZeroReached;
+        
+        /** ETrue, if user has turned all the way to the stopper */
+        TBool   iStopperReached;
+        };
+
+    /** Miscellaneous flags to memorise state of the control */
+    enum TAnalogDialerControlFlags
+        {
+        /** Observer for long tap pointer event has been registered */
+        EAnalogDialerControlFlagLongTapRegistered = 0x1,
+        
+        /** Long tap has been pressed */
+        EAnalogDialerControlFlagLongTapPressed = 0x2,
+        
+        /** Set, if dragging is ongoing */
+        EAnalogDialerControlDragging = 0x4,
+        
+        /** Set, if clear key area pressed */
+        EAnalogDialerControlClearKeyEvent = 0x8,
+        };
+
+    /** Flags of this control */
+    TInt                        iFlags;
+
+    /**
+     * Rotating plate image
+     * Not own.
+     */
+    CAlfGridLayout*             iRootLayout;
+
+    /**
+     * Number display
+     * Not own.
+     */
+    CAlfTextVisual*             iDisplayPane;
+    
+    /** Number current visible in the number display */
+    TBuf<KNumberDisplayBufferLength> iDisplayNumber;
+    
+    /**
+     * ELayoutAnalogDialerPt: application is running in portrait mode
+     * ELayoutAnalogDialerLd: application is running in landscape mode
+     */
+    TLayoutMode                 iLayoutMode;
+    
+    /**
+     * Feedback launcher
+     * Own.
+     */
+    CAlfExAnalogDialerFeedback* iFeedback;
+    
+    /**
+     * Rotating plate image
+     * Not own.
+     */
+    CAlfImageVisual*            iPlate;
+
+    /**
+     * Stopper image
+     * Not own.
+     */
+    CAlfImageVisual*            iStopper;
+    
+    /** ETrue, if dragging is ongoing */
+    TBool                       iDragging;
+    
+    /** Length of the shorter edge of the plate */
+    TInt                        iSquareSide; 
+
+    /** Length of the longer edge of the application */
+    TInt                        iLongerSide; 
+
+    /** Y -coordinate of the plate */
+    TInt                        iPlateTopOffset;                
+
+    /** Data needed in calculating rotating angle of plate is grouped together.*/
+    TDraggingData               iDraggingData;    
+    };
+
+
+#endif // ANALOGDIALER_CONTROL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/inc/alfexanalogdialerdocument.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Application document class for Analog Dialer example application, which
+*                implements rotating dial pad.
+*
+*/
+
+
+
+#ifndef ANALOGDIALER_DOCUMENT_H
+#define ANALOGDIALER_DOCUMENT_H
+
+#include <akndoc.h>
+
+// Forward references
+class CAlfExAnalogDialerAppUi;
+class CEikApplication;
+
+/**
+ *  Document class for Analog Dialer
+ *
+ *  @since S60 5.0
+ */
+class CAlfExAnalogDialerDocument : public CAknDocument
+    {
+public:
+
+    
+    /* Constructors and destructor. */
+
+    /**
+     * First phase constructor of CAlfExAnalogDialerDocument.
+     * Construct a CAlfExAnalogDialerDocument for the AVKON application aApp 
+     * using two phase construction, and return a pointer to the created object
+     *
+     * @since S60 5.0
+     * @param aApp application creating this document
+     * @result a pointer to the created instance of CAlfExAnalogDialerDocument
+     */
+    static CAlfExAnalogDialerDocument* NewL(CEikApplication& aApp);
+
+    /**
+     * First phase constructor of CAlfExAnalogDialerDocument.
+     * Construct a CAlfExAnalogDialerDocument for the AVKON application aApp 
+     * using two phase construction, and return a pointer to the created object
+     *
+     * @since S60 5.0
+     * @param aApp application creating this document
+     * @result a pointer to the created instance of CAlfExAnalogDialerDocument
+     */
+    static CAlfExAnalogDialerDocument* NewLC(CEikApplication& aApp);
+
+    /**
+     * Destructor of CAlfExAnalogDialerDocument
+     *
+     * @since S60 5.0
+     */
+    ~CAlfExAnalogDialerDocument();
+
+
+    /* Methods */
+
+// from base class CAknDocument
+
+    /**
+     * From CAknDocument
+     * Create a CAlfExAnalogDialerAppUi object and return a pointer to it
+     *
+     * @since S60 5.0
+     * @result a pointer to the created instance of the AppUi created
+     */
+    CEikAppUi* CreateAppUiL();
+
+private:
+
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructor of CAlfExAnalogDialerDocument.
+     * Private as this object must be constructed via NewL() or NewLC()
+     *
+     * @since S60 5.0
+     */
+    CAlfExAnalogDialerDocument(CEikApplication& aApp);
+
+    /**
+     * Second phase constructor of CAlfExAnalogDialerDocument.
+     * Private as this object must be constructed via NewL() or NewLC()
+     *
+     * @since S60 5.0
+     */
+    void ConstructL();
+
+private:
+    /**
+     * Not yet member data
+     */
+
+    };
+
+
+#endif // ANALOGDIALER_DOCUMENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/inc/alfexanalogdialerfeedback.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class for Analog Dialer example application, which
+*                implements long lasting tactile feed back event
+*
+*/
+
+
+
+#ifndef ANALOGDIALER_FEEDBACK_H
+#define ANALOGDIALER_FEEDBACK_H
+
+#include <e32std.h> 
+
+// Forward reference
+class MTouchFeedback;
+class CPeriodic;
+
+// default time values for playing tactile feedback
+const TInt KFeedbackDefault = 0;
+
+/**
+ *  Class for giving physical feedback about events in the analog dialer
+ *
+ *  @since S60 5.0
+ */
+class CAlfExAnalogDialerFeedback : public CBase
+    {
+public:
+
+    
+    /* Constructors and destructor. */
+
+    /**
+     * First phase construction of CAlfExAnalogDialerFeedback.
+     *
+     * @since S60 5.0
+     */
+    static CAlfExAnalogDialerFeedback* NewL();
+
+    /**
+     * Destructor of CAlfExAnalogDialerFeedback
+     * Destroy the object and release all memory objects
+     *
+     * @since S60 5.0
+     */
+    virtual ~CAlfExAnalogDialerFeedback();
+    
+
+    /* Methods. */
+
+    /**
+     * Starts tactile feedback which lasts for given time
+     *
+     * @param aDuration total duration of tactile feedback.
+     *                  KFeedbackDefaultInterval: feedback is given once only
+     * @param aInterval interval, when feed back is restarted
+     *                  KFeedbackDefaultInterval: continuos feedback is given.
+     *                  if aDuration == KFeedbackDefaultInterval, this parameter
+     *                  is ignored.
+     *        
+     * @since S60 5.0
+     */
+    void Start( TInt    aDurationMilliSeconds = KFeedbackDefault,
+                TInt    aIntervalMilliSeconds = KFeedbackDefault);
+    
+    /**
+     * Stops tactile feedback immediately
+     *
+     * @since S60 5.0
+     */
+    void Stop();
+
+private:
+
+
+    /* Constructors */
+
+    /**
+     * Constructor of CAlfExAnalogDialerFeedback
+     * @since S60 5.0
+     */
+    CAlfExAnalogDialerFeedback();
+    
+    /**
+     * Second phase construction of CAlfExAnalogDialerFeedback.
+     * Private as this object must be constructed via NewL() or NewLC()
+     *
+     * @since S60 5.0
+     */
+    void ConstructL();
+
+
+    /* Methods. */
+
+    /**
+     * Handles elapsed interval of feedback clock
+     *
+     * @since S60 5.0
+     */
+    void DoHandleInterval();
+
+    /**
+     * TCallBack function. Handles elapsed interval of feedback clock. 
+     * Required by CPeriodic.
+     * 
+     * @return Returns value forced by TCallBack
+     * @since S60 5.0
+     */
+    static TInt HandleInterval(TAny* aThis);
+
+private:
+
+    /* Member data. */
+
+    /**
+     * Tactile feedback object
+     * Not own.
+     */
+    MTouchFeedback*     iFeedback;
+    
+    /**
+     * Class for implementing continuous feedback effect
+     * Own.
+     */
+    CPeriodic*          iClock;
+    
+    /**
+     * time for duration of current feedback
+     */     
+    TInt                iDuration;
+
+    /**
+     * interval of current feedback
+     */
+    TInt                iInterval;
+
+    /**
+     * Clock time when feedback stops
+     */
+    TTime               iDurationStop;
+    
+    };
+
+
+#endif // ANALOGDIALER_FEEDBACK_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/rom/alfexanalogdialer.iby	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   (ROM) Image description file for Hello World Example
+*
+*/
+
+
+
+#ifndef ANALOGDIALER_IBY
+#define ANALOGDIALER_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+file=\epoc32\release\armv5\urel\analogdialer.exe sys\bin\alfexanalogdialer.exe
+data=\epoc32\data\z\private\10003a3f\apps\analogdialer_reg.rsc private\10003a3f\apps\alfexanalogdialer_reg.rsc
+data=\epoc32\data\z\resource\apps\analogdialer_loc.rsc resource\apps\alfexanalogdialer_loc.rsc
+data=\epoc32\data\z\resource\apps\analogdialer.rsc resource\apps\alfexanalogdialer.rsc
+
+#endif // T_ALFANCHOR_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/sis/alfexanalogdialer.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,49 @@
+; 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: 
+;
+; -------- general --------
+
+
+;Language - standard language definitions
+&EN
+
+; standard SIS file header
+#{"AlfExAnalogDialer"},(0x2001247F),1,0,0
+
+;Supports Series 60 v 5.0 -- todo how to indicate 5.0??
+(0x101F796), 0, 0, 0, {"Series60ProductID"}
+
+;Localized Vendor Name
+%{"Nokia EN"}
+
+;Unique Vendor name
+:"Nokia"
+
+; -------- files --------
+
+;; ui files
+
+"\epoc32\release\armv5\urel\alfexanalogdialer.exe"-"!:\sys\bin\alfexanalogdialer.exe"
+"\epoc32\data\z\private\10003a3f\apps\alfexanalogdialer_reg.rsc"-"!:\private\10003a3f\import\apps\alfexanalogdialer_reg.rsc"
+
+;; language-dependent resource files
+
+"\epoc32\data\z\resource\apps\alfexanalogdialer.rsc"-"!:\resource\apps\alfexanalogdialer.rsc"
+
+;; data
+"..\data\background.png"-"c:\Data\Images\Pictures\background.png"
+"..\data\numbers.png"-"c:\Data\Images\Pictures\numbers.png"
+"..\data\plate.png"-"c:\Data\Images\Pictures\plate.png"
+"..\data\stopper.png"-"c:\Data\Images\Pictures\stopper.png"
+
Binary file exampleapps/alfexanalogdialer/sis/alfexanalogdialer.sis has changed
Binary file exampleapps/alfexanalogdialer/sis/alfexanalogdialer.sisx has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/sis/createsisx.bat	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,18 @@
+rem
+rem Copyright (c) 2009 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 Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description: 
+rem
+
+makesis alfexanalogdialer.pkg
+signsis alfexanalogdialer.sis alfexanalogdialer.sisx \s60\mw\systemswservices\appinstaller\AppinstUi\internal\RD_RootCA\rd.cer \s60\mw\systemswservices\appinstaller\AppinstUi\internal\RD_RootCA\rd-key.pem
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/src/alfexanalogdialer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of the entry point for the Analog Dialer.*
+*/
+
+
+
+#include <eikstart.h>
+
+#include "alfexanalogdialerapplication.h"
+
+#ifdef __UI_FRAMEWORKS_V2__
+
+// ---------------------------------------------------------------------------
+// NewApplication
+// Creates the application class object and returns pointer to it
+// ---------------------------------------------------------------------------
+//
+CApaApplication* NewApplication()
+	{
+	return new CAlfExAnalogDialerApplication;
+	}
+
+// ---------------------------------------------------------------------------
+// E32Main
+// Entry point for this application (executable) file. Function pointer
+// to function creating the CAlfExAnalogDialerApplication objects is given
+// ---------------------------------------------------------------------------
+//
+TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	
+	}
+
+#else // __UI_FRAMEWORKS_V2__
+
+// Create an application, and return a pointer to it
+EXPORT_C CApaApplication* NewApplication()
+  {
+  return new CAlfExAnalogDialerApplication;
+  }
+
+// DLL entry point, return that everything is ok
+GLDEF_C TInt E32Dll(TDllReason)
+  {
+  return KErrNone;
+  }
+
+#endif // __UI_FRAMEWORKS_V2__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/src/alfexanalogdialerapplication.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of member functions of CAlfExAnalogDialerApplication.
+*
+*/
+
+
+
+#include "alfexanalogdialerapplication.h"
+#include "alfexanalogdialerdocument.h"
+
+// UID of the application. It must be same as in MMP file 
+static const TUid KUidAlfExAnalogDialerApp = {0x2001247F};
+
+// ---------------------------------------------------------------------------
+// AppDllUid
+// Return the UID of the Analog Dialer application
+// ---------------------------------------------------------------------------
+//
+TUid CAlfExAnalogDialerApplication::AppDllUid() const
+    {
+    return KUidAlfExAnalogDialerApp;
+    }
+
+// ---------------------------------------------------------------------------
+// CreateDocumentL
+// Creates document class of Analog Dialer and returns pointer to it. 
+// ---------------------------------------------------------------------------
+//
+CApaDocument* CAlfExAnalogDialerApplication::CreateDocumentL()
+    {  
+    CApaDocument* document = CAlfExAnalogDialerDocument::NewL(*this);
+    return document;
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/src/alfexanalogdialerappui.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of member functions of CAlfExAnalogDialerAppUi.
+*
+*/
+
+
+
+#include <avkon.hrh>
+#include <aknnotewrappers.h>
+#include <aknutils.h>
+#include <akndef.h>                 // KAknFullOrPartialForegroundGained/Lost
+
+#include <alf/alfcontrolgroup.h>
+#include <alf/alfdisplay.h>
+#include <uiacceltk/huidisplay.h>
+#include <uiacceltk/huiutil.h>
+#include <alf/alfcontrol.h>
+#include <alf/alfanchorlayout.h>
+#include <alf/alftextvisual.h>
+#include <alf/alfroster.h>
+#include <alf/alfevent.h>
+#include <alf/alfclientbase.h>
+#include <alf/alftransformation.h>
+
+#include "alfexanalogdialer.pan"
+#include "alfexanalogdialerappui.h"
+#include "alfexanalogdialer.hrh"
+
+#include "alfexanalogdialercontrol.h"
+
+// Identifier for the primary control group.
+const TInt KExAnalogControlPrimaryGroup = 1;
+
+// Location of image files of analog dialer
+_LIT(KAnalogDialerImagePath, "c:\\Data\\Images\\Pictures\\");
+
+// ---------------------------------------------------------------------------
+// CAlfExAnalogDialerAppUi
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerAppUi::CAlfExAnalogDialerAppUi()
+    {
+	// no implementation required
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ConstructL is called by the application framework
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerAppUi::ConstructL()
+    {
+    // Enable Avkon skins.
+    BaseConstructL(EAknEnableSkin);
+
+    // create ALF environment
+    iEnv = CAlfEnv::NewL();    
+
+    // set location of images
+    iEnv->TextureManager().SetImagePathL(KAnalogDialerImagePath);
+
+    // get the application screen area. Neither status pane nor softkeys exist
+    TRect rect;
+    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EApplicationWindow, rect);
+    
+    // create display
+    CAlfDisplay& disp = iEnv->NewDisplayL(rect, CAlfEnv::ENewDisplayAsCoeControl);
+    disp.SetClearBackgroundL(CAlfDisplay::EClearWithSkinBackground);
+
+    // Create a control group.
+    CAlfControlGroup& group = iEnv->NewControlGroupL(KExAnalogControlPrimaryGroup);
+
+    // Create control for analog dialer and add it into control group
+    CAlfExAnalogDialerControl* control = CAlfExAnalogDialerControl::NewLC(*iEnv);
+    group.AppendL(control);
+    CleanupStack::Pop(control);
+    
+    // Show the control group on the display.
+    disp.Roster().ShowL( group );
+    }
+
+// ---------------------------------------------------------------------------
+// ~CAlfExAnalogDialerAppUi()
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerAppUi::~CAlfExAnalogDialerAppUi()
+    {
+    delete iEnv;
+    }
+
+// ---------------------------------------------------------------------------
+// HandleCommandL
+// Handle commands from framework
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerAppUi::HandleCommandL(TInt aCommand)
+    {
+    switch(aCommand)
+        {
+        case EEikCmdExit:
+        case EAknSoftkeyExit:
+            Exit();
+            break;
+        default:
+            CAknAppUi::HandleCommandL(aCommand);
+            break;
+        }
+    }
+
+// ----------------------------------------------------------
+// HandleResourceChangeL
+// Handle Resource Change Events: Display orientation switch
+// ----------------------------------------------------------
+//
+void CAlfExAnalogDialerAppUi::HandleResourceChangeL(TInt aType)
+    {
+    CAknAppUi::HandleResourceChangeL(aType);
+
+    if(aType == KEikDynamicLayoutVariantSwitch)
+        {
+        CAlfControlGroup& group = iEnv->ControlGroup(KExAnalogControlPrimaryGroup);
+        CAlfExAnalogDialerControl* control = static_cast<CAlfExAnalogDialerControl*> 
+                                    ( group.FindControl(KAlfExAnalogDialerControlId));
+        if (control)
+            {
+            // TODO: experimental code
+            control->PrepareForLayoutSwitchL();
+            }
+
+        TRect rect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EApplicationWindow, rect);
+        iEnv->PrimaryDisplay().SetVisibleArea(rect);    
+        if (control)
+            {
+            control->SwitchLayoutL();
+            }
+        }
+    }
+
+// ----------------------------------------------------------
+// HandleWsEventL
+// Handle Resource Change Events: Display orientation switch
+// ----------------------------------------------------------
+//
+void CAlfExAnalogDialerAppUi::HandleWsEventL(   const TWsEvent& aEvent,
+	                                            CCoeControl*    aDestination)
+    { 
+    // When the application is put to the background, release resources.
+    // This is not mandatory.
+	switch(aEvent.Type()) 
+    	{ 
+    	case KAknFullOrPartialForegroundLost:
+        	//iEnv->Release();
+        	break;
+
+    	case KAknFullOrPartialForegroundGained:
+        	//iEnv->RestoreL();
+        	break;
+    
+      	default:
+        	break;
+    	}
+
+    CAknAppUi::HandleWsEventL(aEvent, aDestination);
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/src/alfexanalogdialercontrol.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1081 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of member functions of 
+*                AlfExAnalogDialerControl.
+*
+*/
+
+
+
+#include <coemain.h>
+
+// Visuals
+#include <alf/alfgridlayout.h>
+#include <alf/alftextvisual.h>
+#include <alf/alfimagevisual.h>
+#include <alf/alflinevisual.h>
+
+// Layouts
+#include <alf/alfdecklayout.h>
+#include <alf/alfcurvepath.h>
+#include <alf/alfcurvepathlayout.h>
+
+// Brushes
+#include <alf/alfborderbrush.h>
+#include <alf/alfbrusharray.h>
+#include <alf/alfimagebrush.h>
+#include <alf/alfimage.h>
+#include <alf/alfshadowborderbrush.h>
+#include <alf/alfgradientbrush.h>
+
+// Unsorted
+#include <aknutils.h>
+#include <alf/alftransformation.h>
+#include <alf/alfevent.h>
+#include <alf/alfdisplay.h>
+#include <alf/alfenv.h>
+#include <alf/alfmappingfunctions.h>
+#include <alf/alfroster.h>
+
+#include <e32math.h>
+
+#include "alfexanalogdialercontrol.h"
+#include "alfexanalogdialerfeedback.h"
+
+// Image names
+_LIT(KImageAnalogDialerBackground, "background.png");
+_LIT(KImageAnalogDialerNumbers, "numbers.png");
+_LIT(KImageAnalogDialerPlate, "plate.png");
+_LIT(KImageAnalogDialerStopper, "stopper.png");
+
+#define RADTODEG(Rad) ((180.0 * Rad) / KPi)
+
+// font color 
+const TRgb KFontColor = TRgb(192,192,192);
+
+// dimension of grid
+const TInt KDimensionsOfGrid = 2;
+
+// Tags for visuals which have always same appearance. 
+// TTagAnalogDialerVisual is used for indexing
+const char* KTagArray[] =
+    {
+    "root-layout",
+    "display-deck",
+    "display-visual",
+    "plate-deck",
+    "numbers-visual",
+    "plate-visaul",
+    "stopper-visual"
+    };     
+
+// Dimensions of grid. iLayoutMode is used for indexing
+const TInt KRowsAndColumnsOfGrid[][KDimensionsOfGrid] =
+    {
+    { 1, 2 },   // columns, rows
+    { 2, 1 }  
+    };
+     
+// Template for displaying number
+_LIT(KNumberDisplayTemplate, "%d");
+
+// Radius of Clear area of plate. Per cents from radius of plate.
+const TInt KPlateClearRadius = 25;
+
+// Unit speed of returning plate to idle position. Degrees per second. 
+const TInt KPlateReturnSpeed = 65;
+
+// As dragging events occur very often, redrawing plate is optimised that
+// it is not drawn after every dragging event. 
+// Plate is redrawn when angle of the plate has changed KPlateDraggingDelta clockwise.
+const TInt KPlateDraggingDelta = 2;
+
+// position of stopper in degrees. Angle is 43 clockwise down from the X-axis
+const TInt KStopperAngle = 360-43;
+
+// angle of arch on which numbers (or holes) are distributed
+const TInt KPlateNumbersDistributionAngle = 290;
+
+// minimum rotation of plate that a number becomes selected. If plate has been dialed
+// less than or equal to KPlateMinimumRotateAngle degrees, number is not selected.
+const TInt KPlateMinimumRotateAngle=43;
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerControl* CAlfExAnalogDialerControl::NewL(CAlfEnv& aEnv)
+    {
+    CAlfExAnalogDialerControl* self = CAlfExAnalogDialerControl::NewLC(aEnv);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerControl* CAlfExAnalogDialerControl::NewLC(CAlfEnv& aEnv)
+    {
+    CAlfExAnalogDialerControl* self = new (ELeave) CAlfExAnalogDialerControl();
+    CleanupStack::PushL(self);
+    self->ConstructL(aEnv);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// ~CAlfExAnalogDialerControl
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerControl::~CAlfExAnalogDialerControl()
+    {
+    // Remove observer is still there
+    if (iFlags & EAnalogDialerControlFlagLongTapRegistered)
+        {
+        Display()->Roster().RemovePointerEventObserver(EAlfPointerEventReportLongTap, *this);
+        }
+    Env().CancelCommands(this);
+    delete iFeedback;
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfExAnalogDialerControl
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerControl::CAlfExAnalogDialerControl()
+        : CAlfControl()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::ConstructL(CAlfEnv& aEnv)
+    {
+    CAlfControl::ConstructL(aEnv);
+    // Id cannot be be set in constructor. Id is needed in appui to retrieve control from control group
+	SetId(KAlfExAnalogDialerControlId);
+
+    // resolve layout: portrait or landscape
+    iLayoutMode = ResolveLayout(iSquareSide, iLongerSide);
+    
+    // setup visuals accroding to layout
+    (iLayoutMode == ELayoutAnalogDialerPortrait) ? SetupPortraitModeL() : SetupLandscapeModeL();
+
+    // set up vibra system
+    iFeedback = CAlfExAnalogDialerFeedback::NewL();
+    }   
+    
+    
+    
+// ---------------------------------------------------------------------------
+// Creates layouts and visual for portrait layout
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::SetupPortraitModeL()
+    {
+    // Setup grid (root layout)
+    AddGridLayoutL();
+
+    // from top to bottom 1) display pane 2) dialer
+    AddDisplayPaneL();
+    AddDialerL();
+
+    //AddEffectLayout();
+    }
+
+// ---------------------------------------------------------------------------
+// Creates layouts and visual for portrait layout
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::SetupLandscapeModeL()
+    {
+    // Setup grid (root layout)
+    AddGridLayoutL();
+
+    // from left to right 1) dialer 2) display pane
+    AddDialerL();
+    AddDisplayPaneL();
+
+    //AddEffectLayout();
+    }
+
+
+// ---------------------------------------------------------------------------
+// Creates grid layout or modify existing one after layout change
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::AddGridLayoutL()
+    {
+    if (!iRootLayout)
+        {
+        // Fresh start of the application. Create a grid layout to act as the root layout visual.
+        iRootLayout = CAlfGridLayout::AddNewL(*this, 
+                                            KRowsAndColumnsOfGrid[iLayoutMode][EAlfGridColumn], 
+                                            KRowsAndColumnsOfGrid[iLayoutMode][EAlfGridRow]);
+        // Tag is not really needed, because root layout assigned to member variable
+        iRootLayout->SetTagL(_L8(KTagArray[ETagAnalogDialerRootLayout]));   
+
+        // Brushed must enabled before they can be used
+        iRootLayout->EnableBrushesL();      
+
+        // Background image is implemented using image brush
+        CAlfTexture& backgroundTexture = Env().TextureManager().LoadTextureL( 
+                                            KImageAnalogDialerBackground,
+                                            EAlfTextureFlagDefault, 
+                                            KAlfAutoGeneratedTextureId);        
+        // Default scale mode CAlfImageVisual::EScaleFit is OK
+        CAlfImageBrush* brush = CAlfImageBrush::NewLC(Env(), TAlfImage(backgroundTexture));
+
+        // sets background image behind the visual
+        brush->SetLayer(EAlfBrushLayerBackground);
+        
+        // Append brush to the layout and transfer its ownership to the visual.    
+        iRootLayout->Brushes()->AppendL(brush, EAlfHasOwnership);
+        CleanupStack::Pop(brush);
+        }
+    else
+        {
+        // Layout change has taken place. Modify dimensions and weights
+        // Reset current dimension
+        for(TInt i=0; i<KDimensionsOfGrid; i++)
+            {
+            // resetting non existing weights causes Leave
+            TRAP_IGNORE(iRootLayout->RemoveWeightL(EAlfGridColumn, i));
+            TRAP_IGNORE(iRootLayout->RemoveWeightL(EAlfGridRow, i));
+            }
+        // now set up new dimension
+        iRootLayout->SetColumnsL(KRowsAndColumnsOfGrid[iLayoutMode][EAlfGridColumn]);
+        iRootLayout->SetRowsL(KRowsAndColumnsOfGrid[iLayoutMode][EAlfGridRow]);
+        }
+
+    // Sets weights of grid
+    SetWeightsOfGridL(*iRootLayout,
+                      iLayoutMode,
+                      iSquareSide,
+                      iLongerSide,
+                      iPlateTopOffset);
+                             
+    // Set the padding of the root layout
+    
+    // TODO: Padding disabled for now. This seems to mess the angle calculations as we the calculations do not consider
+    // the effect of padding.
+
+    /*
+    TRect displayRect = Env().PrimaryDisplay().VisibleArea();
+    TInt pad = displayRect.Height();
+    if ( iLayoutMode == ELayoutAnalogDialerLandscape )
+        {
+        pad = displayRect.Width();
+        }   
+    layout->SetInnerPadding(TPoint( 
+    		pad * KPaddingExtents[iLayoutMode][EAlfGridColumn],
+    		pad * KPaddingExtents[iLayoutMode][EAlfGridRow]));
+    layout->SetPadding(pad * KPaddingPercentage);*/
+    }
+
+
+// ---------------------------------------------------------------------------
+// Adds content into display pane of the application
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::AddDisplayPaneL()
+    {
+    CAlfDeckLayout* displayDeck = CAlfDeckLayout::AddNewL(*this, iRootLayout);
+    displayDeck->SetTagL(_L8( KTagArray[ETagAnalogDialerDisplayDeck]));
+
+    // Add TextVisual number display
+    iDisplayPane = CAlfTextVisual::AddNewL(*this, displayDeck );
+    // Tag is not really needed
+    iDisplayPane->SetTagL(_L8( KTagArray[ETagAnalogDialerDisplayVisual]));
+    iDisplayPane->SetAlign(EAlfAlignHRight, EAlfAlignVCenter);      
+
+    /*iDisplayPane->SetFlag(EAlfVisualFlagManualLayout);
+    
+    // Decoration
+    if (iLayoutMode == ELayoutAnalogDialerPortrait)
+    	{
+    	iDisplayPane->SetCenteredPosAndSize(TPoint(180,100),TSize(300,50));
+    	}
+    else 
+    	{
+    	iDisplayPane->SetCenteredPosAndSize(TPoint(150,180),TSize(200,300));
+    	}*/
+    iDisplayPane->SetStyle(EAlfTextStyleTitle);
+    iDisplayPane->SetColor(KFontColor);    
+
+
+    // Enable brushed for borders etc
+    iDisplayPane->EnableBrushesL();      
+
+    // Display rectangular 
+    CAlfShadowBorderBrush* brush = CAlfShadowBorderBrush::NewLC(Env(),6);
+    brush->SetOpacity(.25f);
+    
+    // Append brush to the visual and transfer its ownership to the visual.    
+    iDisplayPane->Brushes()->AppendL(brush, EAlfHasOwnership);
+    CleanupStack::Pop(brush);    
+    }
+
+// ---------------------------------------------------------------------------
+// Adds content into dialer pane of the application
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::AddDialerL()
+    {
+    // Dialer consists of three images on top of each other. Deck is needed to manage them
+    // Parent layout is grid
+    CAlfDeckLayout* dialerDeck = CAlfDeckLayout::AddNewL(*this, iRootLayout);
+    dialerDeck->SetTagL(_L8(KTagArray[ETagAnalogDialerPlateDeck]));
+        
+	// Load images:    
+    // 1) Image with the numbers
+    CAlfTexture& numbersTexture = Env().TextureManager().LoadTextureL( KImageAnalogDialerNumbers, 
+                                                                        EAlfTextureFlagDefault, 
+                                                                        KAlfAutoGeneratedTextureId);
+
+    // Parent layout is deck
+	CAlfImageVisual* numbers  = CAlfImageVisual::AddNewL(*this,dialerDeck); 
+    // Default scale mode CAlfImageVisual::EScaleFit is OK
+	// attach texture to image visual
+	numbers->SetImage(TAlfImage(numbersTexture));
+	
+	// 2) plate with holes
+	CAlfTexture& plateTexture = Env().TextureManager().LoadTextureL(  KImageAnalogDialerPlate, 
+	                                                            EAlfTextureFlagDefault, 
+	                                                            KAlfAutoGeneratedTextureId);
+    // Parent layout is deck
+	iPlate = CAlfImageVisual::AddNewL(*this,dialerDeck); 
+    // Default scale mode CAlfImageVisual::EScaleFit is OK
+	iPlate->SetImage(TAlfImage(plateTexture));
+
+	// 2) stopper
+	CAlfTexture& stopper = Env().TextureManager().LoadTextureL( KImageAnalogDialerStopper, 
+	                                                            EAlfTextureFlagDefault, 
+	                                                            KAlfAutoGeneratedTextureId);
+    // Parent layout is deck
+	iStopper  = CAlfImageVisual::AddNewL(*this,dialerDeck); 
+    // Default scale mode CAlfImageVisual::EScaleFit is OK
+	iStopper->SetImage(TAlfImage(stopper));
+    
+    }
+
+// ---------------------------------------------------------------------------
+// Events from framework
+// ---------------------------------------------------------------------------
+//
+TBool CAlfExAnalogDialerControl::OfferEventL(const TAlfEvent& aEvent)
+    {
+    // Ignore other events except pointer events
+    if (aEvent.IsPointerEvent() && aEvent.PointerDown())
+	    {
+	    return HandlePointerDownEventL(aEvent);    
+	    }
+	 
+	else if(aEvent.IsPointerEvent() && aEvent.PointerEvent().iType == TPointerEvent::EDrag )
+	    {
+	    return HandleDraggingEventL(aEvent);
+	    }
+	
+	else if(aEvent.IsPointerEvent() && aEvent.PointerUp())
+	    {
+	    return HandlePointerUpEventL(aEvent);
+	    }
+
+	else if(aEvent.IsPointerEvent() && aEvent.PointerLongTap())
+	    {
+	    return HandlePointerLongTapEventL(aEvent);
+	    }
+	    
+	return EFalse;
+	}
+
+// ---------------------------------------------------------------------------
+// Handles pointer down events
+// ---------------------------------------------------------------------------
+//
+TBool CAlfExAnalogDialerControl::HandlePointerDownEventL(const TAlfEvent& aEvent)
+	{
+	// Topmost image i.e. stopper image visual gets the pointer event
+	CAlfVisual* onVisual = aEvent.Visual();
+	if (onVisual == iStopper)
+	    {      
+	    // Is plate rotating starting?
+        if (IsPointerEventFollowingNumbersArcPath(aEvent))
+            {
+    		ResetDraggingData();
+
+            // Plate rotation is starting
+    	    // Register to receive dragging events
+    	    Display()->Roster().AddPointerEventObserver(EAlfPointerEventReportDrag, *this);   
+
+            // Dragging has started
+    	    iFlags |= EAnalogDialerControlDragging;
+            }
+        // Is clear key pressed?
+        else if (IsPointerEventOnClearKey(aEvent))
+            {
+    		ResetClearKeyData();
+    	        
+            if (!(iFlags & EAnalogDialerControlFlagLongTapRegistered))
+                {
+                // Clear key handling needs long tap events
+    	        // Register for long tap events
+                Display()->Roster().AddPointerEventObserver(EAlfPointerEventReportLongTap, *this);   
+                iFlags |= EAnalogDialerControlFlagLongTapRegistered;
+                }
+            // Clear key event has started
+    	    iFlags |= EAnalogDialerControlClearKeyEvent;
+            }
+	    }
+	return ETrue;
+	}
+
+// ---------------------------------------------------------------------------
+// Handles dragging events
+// ---------------------------------------------------------------------------
+//
+TBool CAlfExAnalogDialerControl::HandleDraggingEventL(const TAlfEvent& aEvent)
+	{
+    if (iFlags & EAnalogDialerControlDragging)
+        {
+    	TPoint plateCentricPoint;
+    	ConvertEventToPlateCentricPosition(aEvent,
+    	                                   iPlateTopOffset,
+    	                                   iSquareSide,
+    	                                   plateCentricPoint);
+    	TInt plateRadius = iSquareSide / 2;
+    	if (!IsPointerEventOnArcPath(plateCentricPoint,
+    	                             plateRadius,
+    	                             plateRadius * KPlateClearRadius / 100))
+    		{
+    		FinishDragging();
+    		}
+        else
+            {
+            // Pointer event is following path
+            // Get angle of pointer event and do further calculation based on it
+            TInt degrees = Angle(plateCentricPoint.iX, plateCentricPoint.iY);
+
+            // Save the angle of first dragging pointer event.
+            // It is used to resolve selected number.
+        	if (iDraggingData.iInitialAngle == 0)
+        	    {
+        	    iDraggingData.iInitialAngle = degrees; 
+        	    iDraggingData.iPreviousAngle = degrees;
+        	    }
+        	        
+            // As dragging events occur very often, redrawing plate is optimised that
+            // it is not drawn after every dragging event. Change of KPlateDraggingDelta degrees
+            // is needed until plate is redrawn.
+            if (    degrees >= iDraggingData.iPreviousAngle + KPlateDraggingDelta 
+                ||  degrees <= iDraggingData.iPreviousAngle - KPlateDraggingDelta)
+                {
+                ResolveXAxisCrossing(degrees);                     
+                iDraggingData.iPreviousAngle = degrees;
+                            
+                if (    iDraggingData.iIsClockWiseOverZeroReached
+                    &&  degrees < KStopperAngle)
+                    {
+                    if (iDraggingData.iStopperReached)
+                        {
+                        // do not redraw as plate cannot rotate more
+                        return ETrue;
+                        }
+                    // stopper has been reached
+                    iDraggingData.iStopperReached = ETrue;
+                    }
+                else if (   !iDraggingData.iIsClockWiseOverZeroReached
+                        &&  degrees > iDraggingData.iInitialAngle)
+                    {
+                    // Rotation counter clockwise to the left of idle position is asked
+                    // Plate does not rotate counterclockwise to the left of idle position
+                    return ETrue;
+                    }
+                else if (iDraggingData.iStopperReached)
+                    {                        
+                    // user has dragged 360 degrees and is dragging now between idle and stopper position
+                    return ETrue;
+                    }
+                 else
+                    {
+                    // rotating when angle is between idle and stopper position
+                    iDraggingData.iStopperReached = EFalse;
+                    }
+                //DebugDraggingData(degrees);
+                RotatePlate(    *iPlate,
+                                iDraggingData.iInitialAngle,
+                                degrees,
+                                iDraggingData.iIsClockWiseOverZeroReached);
+                }
+            // else - delta of rotation has not reached KPlateDraggingDelta
+            }
+        }
+    // else - it is permitted that clear key event is dragged outside clear key area. What matters is where
+    // the pointer event up takes place
+    return ETrue;
+	}
+
+// ---------------------------------------------------------------------------
+// Handle pointer up event
+// ---------------------------------------------------------------------------
+//
+TBool CAlfExAnalogDialerControl::HandlePointerUpEventL(const TAlfEvent& aEvent)
+	{
+	if (iFlags & EAnalogDialerControlDragging)
+		{
+		// Plate rotating has ended. Process result.
+		FinishDragging();
+		}
+    else if (iFlags & EAnalogDialerControlClearKeyEvent)
+        {
+		// clear key event has ended
+        if (IsPointerEventOnClearKey(aEvent))
+            {
+            ClearNumberDisplay(iFlags&EAnalogDialerControlFlagLongTapPressed);
+            }
+        // else - lifting pointer outside Clear key area cancels clearing number
+        ResetClearKeyData();
+        }
+    return ETrue;
+	}
+
+// ---------------------------------------------------------------------------
+// Handle long tap event
+// ---------------------------------------------------------------------------
+//
+TBool CAlfExAnalogDialerControl::HandlePointerLongTapEventL(const TAlfEvent& /*aEvent*/)
+    {
+    if (iFlags & EAnalogDialerControlClearKeyEvent)
+        {
+        iFlags |= EAnalogDialerControlFlagLongTapPressed;
+        }
+    return ETrue;  
+    }
+
+// ---------------------------------------------------------------------------
+// AddNumberToDisplayPaneL
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::AddNumberToDisplayPaneL(TInt aNumber)
+	{	
+	if ( aNumber > 9 )
+	    {
+	    return;
+	    }
+    TBuf<8> number;        
+    
+    // aNumber is 0...9
+    // Second parameter: number 10 must be changed to 0
+    number.Format(KNumberDisplayTemplate, (aNumber+1)%10);
+    if (iDisplayNumber.Length() + number.Length() <= KNumberDisplayBufferLength)
+    	{
+    	iDisplayNumber.Append(number);    
+    	iDisplayPane->SetTextL(iDisplayNumber);
+    	}
+	}
+	
+
+// ---------------------------------------------------------------------------
+// SwitchLayoutL
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::SwitchLayoutL()
+    {
+    // Get access to first leafs (visuals) of grid layout
+    CAlfVisual* displayDeck = FindTag(_L8( KTagArray[ETagAnalogDialerDisplayDeck]));
+    CAlfVisual* dialerDeck = FindTag(_L8( KTagArray[ETagAnalogDialerPlateDeck]));
+    
+    if (displayDeck && dialerDeck)
+        {
+        // remove visuals from grid layout
+        iRootLayout->Remove(displayDeck);
+        iRootLayout->Remove(dialerDeck);
+ 
+        // resolve new layout
+        iLayoutMode = ResolveLayout(iSquareSide,
+                                    iLongerSide);
+        
+        // modify grid layout
+        AddGridLayoutL();
+        
+        // put visuals back to layout
+        if (iLayoutMode == ELayoutAnalogDialerPortrait)
+            {
+            User::LeaveIfError(iRootLayout->Append(displayDeck));
+            User::LeaveIfError(iRootLayout->Append(dialerDeck));
+            }
+        else
+            {
+            User::LeaveIfError(iRootLayout->Append(dialerDeck));
+            User::LeaveIfError(iRootLayout->Append(displayDeck));
+            }
+            
+        // Notify Alf about layout change
+        Env().NotifyLayoutChangedL();
+        }
+    // else - better not to do anything
+
+    iFeedback->Start();
+
+    // expose new root layout
+    /*TAlfTimedValue opacity(0.0f);
+    opacity.SetTarget(255, 500);
+    iRootLayout->SetOpacity(opacity);   */
+
+    }
+
+// ---------------------------------------------------------------------------
+// Hides the visual
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::PrepareForLayoutSwitchL()
+    {
+    /*CAlfVisual* layout = FindTag(_L8(KTagArray[ETagAnalogDialerRootLayout]));
+    if ( layout )
+        {
+        TAlfTimedValue opacity(1.0f);
+        opacity.SetTarget( 0.0f, 500);
+        layout->SetOpacity(opacity);   
+        }
+    iFeedback->Start();
+    User::After(500000);*/
+    }
+
+
+// ---------------------------------------------------------------------------
+// Resolves current layout.
+// ---------------------------------------------------------------------------
+// 
+CAlfExAnalogDialerControl::TLayoutMode CAlfExAnalogDialerControl::ResolveLayout(
+                                            TInt& aShorterSide,
+                                            TInt& aLongerSide) const
+    {
+    // Resolve whether application is now running in portrait or landscape mode
+    // Function must also return the shorter extent of the application 
+    // to be used as side length of the square of dialer plate.
+    // Longer side is returned also to be used in grid weights.
+    TLayoutMode layoutMode = ELayoutAnalogDialerPortrait;
+    TRect displayRect = Env().PrimaryDisplay().VisibleArea();
+    TInt height = displayRect.Height();
+    TInt width = displayRect.Width();
+    if (width > height)
+        {
+        layoutMode = ELayoutAnalogDialerLandscape;
+        aShorterSide = height;
+        aLongerSide = width;
+        }
+    else
+        {
+        // default mode is OK
+        aShorterSide = width;
+        aLongerSide = height;
+        }
+    return layoutMode;
+    }
+ 
+// ---------------------------------------------------------------------------
+// ResolveXAxisCrossing
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::ResolveXAxisCrossing(TInt aAngle)
+    {   
+    // Delta of angle change, which indicates X-axis crossing
+    const TInt KXAxisCrossingAngleDelta = 300;
+
+    TInt degreesDelta = aAngle - iDraggingData.iPreviousAngle;
+    // switch from 0 to 359?
+    if (degreesDelta > KXAxisCrossingAngleDelta)
+        {
+        iDraggingData.iIsClockWiseOverZeroReached = ETrue;
+        }
+    // switch from 359 to 0?
+    else if (   iDraggingData.iIsClockWiseOverZeroReached
+            &&  degreesDelta < (-KXAxisCrossingAngleDelta))
+        {
+        iDraggingData.iIsClockWiseOverZeroReached = EFalse;
+        }    
+    }
+
+
+// ---------------------------------------------------------------------------
+// Calculate angle of triangle, when adjacent and opposite sides are known
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfExAnalogDialerControl::Angle(TReal32 aAdjacent, TReal32 aOpposite)
+	{
+	if (aAdjacent == 0)
+	    {
+	    aAdjacent = 0.01;
+	    }
+	
+	if (aOpposite == 0)
+		{
+		aOpposite = 0.01;
+		}
+
+	TReal angle;
+	Math::ATan(angle, Abs(aOpposite / aAdjacent));
+	
+	if (aAdjacent < 0 && aOpposite > 0)
+		{
+		angle =  KPi - angle;
+		}
+	else if (aAdjacent < 0 && aOpposite < 0)
+		{
+		angle = KPi + angle; 
+		}
+    else if (aAdjacent > 0 && aOpposite < 0)
+		{
+		angle = 2* KPi -  angle;
+		}
+    return RADTODEG(angle);			
+	}
+
+// ---------------------------------------------------------------------------
+// Calculate hypotenuse of triangle when length of adjacent and opposite sides are known
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfExAnalogDialerControl::Hypotenuse(const TPoint& aPosition)
+	{
+	TInt sideLength = aPosition.iX * aPosition.iX;
+	TInt oppositeLength = aPosition.iY * aPosition.iY;
+	
+	TReal hypotenuse;
+	Math::Sqrt(hypotenuse, sideLength + oppositeLength);
+	return hypotenuse;
+	}
+	
+
+// ---------------------------------------------------------------------------
+// Order of function calls fix the layout of grid in portrait and landscape modes.
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::SetWeightsOfGridL(  CAlfGridLayout& aGridLayout,
+                                                    TLayoutMode     aLayout,
+                                                    TInt            aSquareSide,
+                                                    TInt            aLongerSide,
+                                                    TInt&           aPlateTop)
+    {
+    // Set up a variable for default value.
+    RArray<TInt> weightsDefault;
+    User::LeaveIfError(weightsDefault.Append(1));   
+
+    // sets weights of grid. Use pizels of application window size to get exact adjustment of pane sizes
+    RArray<TInt> weights;
+    if (aLayout == ELayoutAnalogDialerPortrait)
+        {
+        // top: display; take rest what dialer plate leaves for number display
+        User::LeaveIfError(weights.Append(aLongerSide-aSquareSide));
+
+        // bottom: dialer, which must be square
+        User::LeaveIfError(weights.Append(aSquareSide));
+        aGridLayout.SetRowsL(weights);
+        
+        // default weight for dimension, which is 1. Needed, because weights are reset
+        aGridLayout.SetColumnsL(weightsDefault);
+        
+        // Offset to the plate in Y-dimension is height of number display
+        aPlateTop = aLongerSide-aSquareSide;
+        }
+    else
+        {
+        // left: dialer, which must be square
+        User::LeaveIfError(weights.Append(aSquareSide));
+        // right: display; take rest what dialer plate leaves for number display
+        User::LeaveIfError(weights.Append(aLongerSide-aSquareSide));
+
+        // default weight for dimension, which is 1. Needed, because weights are reset
+        aGridLayout.SetRowsL(weightsDefault);
+        aGridLayout.SetColumnsL(weights);
+        
+        aPlateTop = 0;
+        }         
+    weights.Close(); 
+    weightsDefault.Close(); 
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// ConvertEventToPlateCentricPosition
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::ConvertEventToPlateCentricPosition(
+                                        const TAlfEvent&    aEvent,
+	                                    TInt                aPlateTopOffset,
+	                                    TInt                aSquareSide,
+	                                    TPoint&             aPlateCentricPoint)
+    {
+    // event position is converted in a such way that centre position of the plate is (0,0)
+    // iY: value is negative, if position is below the centre position
+    // iY: value is position, if position is above the centre position
+    // iX: value is negative, if position is to the left the centre position
+    // iX: value is position, if position is to the right of the centre position
+
+    // aSquare side is length of whole square side
+	const TInt plateCentreY = aPlateTopOffset + aSquareSide / 2;
+	aPlateCentricPoint.iX = aEvent.PointerEvent().iParentPosition.iX - aSquareSide / 2;
+	aPlateCentricPoint.iY = plateCentreY - aEvent.PointerEvent().iParentPosition.iY ;
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// Checks whether pointer event occurred between outer and inner radius
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfExAnalogDialerControl::IsPointerEventOnArcPath(   TPoint& aPlateCentricPoint,
+	                                                        TInt    aOuterRadius,
+	                                                        TInt    aInnerRadius)
+    {  
+    // Checks whether position is along a path, which is between radii.
+    // Event may be exactly on distance of radii
+    TBool ret = ETrue;   
+	TInt distanceFromPlateCentre = Hypotenuse(aPlateCentricPoint); 	
+	if (distanceFromPlateCentre > aOuterRadius || distanceFromPlateCentre < aInnerRadius)
+	    {
+	    ret = EFalse;
+	    }
+	return ret;
+    }
+    
+// ---------------------------------------------------------------------------
+// Dragging has finished. Resets dragging data
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::ResetDraggingData()
+    {
+	iFlags &= (~EAnalogDialerControlDragging);
+	iDraggingData.iInitialAngle = 0;
+	iDraggingData.iPreviousAngle = 0;
+	iDraggingData.iIsClockWiseOverZeroReached = EFalse;
+	iDraggingData.iStopperReached=EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// Clear key event has finished. Resets dragging data
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::ResetClearKeyData()
+    {
+	iFlags &= (~EAnalogDialerControlClearKeyEvent);
+    iFlags &= (~EAnalogDialerControlFlagLongTapPressed);
+    }
+
+
+// ---------------------------------------------------------------------------
+// Turns plate back to idle position i.e. counter clokcwise
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::RotatePlateToIdlePosition(CAlfImageVisual&    aImage)
+    {
+	// Rotate the image. This has immediate effect.
+	TAlfTimedValue tValue;
+	tValue.SetTargetWithSpeed(0,  // position zero 
+	                          KPlateReturnSpeed);
+	aImage.SetTurnAngle(tValue);
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// Rotates image clockwise
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::RotatePlate(
+                                    CAlfImageVisual&    aImage,
+                                    TInt                aInitialAngle,
+                                    TInt                aTargetAngle,
+                                    TBool               aIsClockWiseOverZeroReached)
+    {
+    // When rotates clockwise, rotation angle is negative
+    TInt rotateDelta = aTargetAngle-aInitialAngle;
+    if (aIsClockWiseOverZeroReached)
+        {
+        // Angle is big value (near to 360), which cannot be used as such
+        // Convert it to negative value
+        rotateDelta = (aTargetAngle-360)-aInitialAngle;
+        }
+    //RDebug::Printf("***AnalogDialer rotateDelta : %d",rotateDelta);
+    TAlfTimedValue tValue(rotateDelta);
+    aImage.SetTurnAngle(tValue);
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns selected number based on rotated angle of plate 
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfExAnalogDialerControl::DialedNumber(   TInt aInitialAngle,
+                                                TInt aCurrentAngle) const
+    {
+    // Default value when dragging event has not crossed zero-angle X-axis
+    TInt deltaAngle = aCurrentAngle-aInitialAngle;
+    
+    // aCurrentAngle must be an angle derived directly from ConvertEventToPlateCentricPosition
+    // aCurrentAngle is really current pointer position. KStopper value must be used instead
+    if (iDraggingData.iIsClockWiseOverZeroReached)
+        {
+        deltaAngle = aInitialAngle+(360-KStopperAngle);
+        }
+    
+    // Subtract required minimun angle. 
+    deltaAngle = Abs(deltaAngle)-KPlateMinimumRotateAngle;
+    if (deltaAngle<0)
+        {
+        // plate has not been rotated enough to select any number
+        return KErrNotFound;
+        }
+        
+    // TODO. These values could be made constant to use plate with other number systems as decimal
+    // e.g. binary, or hexadecimal
+    // Finally calculate dialed number based on rotated angle
+    TInt angleOfANumber(KPlateNumbersDistributionAngle/10);
+    TInt dialedNumber = deltaAngle/angleOfANumber;
+    if (dialedNumber > 9)
+        {
+        dialedNumber = 9;
+        }
+    return dialedNumber;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Checks whether pointer is on path allowed for plate rotation
+// The path is between edges of plate and clear key area
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfExAnalogDialerControl::IsPointerEventFollowingNumbersArcPath( const TAlfEvent& aEvent ) const
+    {
+	TPoint plateCentricPoint;
+	ConvertEventToPlateCentricPosition(aEvent,
+	                                    iPlateTopOffset,
+	                                    iSquareSide,
+	                                    plateCentricPoint);
+	// Third parameter: Radius of clear area belongs to clear area. Eliminate it.
+	TInt plateRadius = iSquareSide / 2;
+	if ( IsPointerEventOnArcPath( plateCentricPoint,
+	                              plateRadius,
+	                              (plateRadius*KPlateClearRadius/100)+1))
+	    {
+	    return ETrue;
+	    }
+    return EFalse;
+    }
+    
+// ---------------------------------------------------------------------------
+// Checks whether pointer is on area of clear key
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfExAnalogDialerControl::IsPointerEventOnClearKey( const TAlfEvent& aEvent ) const
+    {
+	TPoint plateCentricPoint;
+	ConvertEventToPlateCentricPosition(aEvent,
+	                                    iPlateTopOffset,
+	                                    iSquareSide,
+	                                    plateCentricPoint);
+	TInt plateRadius = iSquareSide / 2;
+	// Third parameter: The 'bull eye' of the plate
+	if ( IsPointerEventOnArcPath( plateCentricPoint,
+	                              plateRadius*KPlateClearRadius/100,
+	                              0))
+	    {
+	    return ETrue;
+	    }
+    return EFalse;
+    }
+    
+
+// ---------------------------------------------------------------------------
+// Performs actions needed when dragging is finished
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::FinishDragging()
+    {
+	// Dragging has finished
+	// Remove pointer dragging observer, which will gain us performance
+    Display()->Roster().RemovePointerEventObserver( EAlfPointerEventReportDrag,*this );
+    DialedNumberToDisplay(  iDraggingData.iInitialAngle,
+                            iDraggingData.iPreviousAngle);
+    RotatePlateToIdlePosition(*iPlate); 
+    ResetDraggingData();
+    }
+    
+// ---------------------------------------------------------------------------
+// Puts dialed number into number display
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::DialedNumberToDisplay(  TInt aInitialAngle,
+                                                        TInt aCurrentAngle )
+    {
+    TInt dialedNumber = DialedNumber(aInitialAngle, aCurrentAngle);
+    // Filter KErrNotFound out
+    if (dialedNumber>=0)
+        {
+        TRAP_IGNORE(AddNumberToDisplayPaneL( dialedNumber ));
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Clear number display either wholly or last number
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::ClearNumberDisplay(TBool aClearWholeDisplay)
+    {
+    TInt lengthNumber = iDisplayNumber.Length();
+    if (lengthNumber == 0)
+        {
+        // nothing to clear
+        return;
+        }
+
+    if (aClearWholeDisplay)
+        {
+        // clear whole buf
+        iDisplayNumber.Zero();
+        }
+    else
+        {
+        // delete one number
+        iDisplayNumber.Delete(lengthNumber-1,1);
+        }
+    // changed number to the screen
+    TRAP_IGNORE(iDisplayPane->SetTextL(iDisplayNumber));
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+/*void CAlfExAnalogDialerControl::AddEffectLayout()
+	{
+	
+	}*/
+
+
+// ---------------------------------------------------------------------------
+// Debugs dragging data + given angle 
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::DebugDraggingData(TInt aAngle)
+    {
+    RDebug::Printf("\n***AnalogDialer:");
+    RDebug::Printf("***AnalogDialer iFlags & EAnalogDialerControlDragging: %d",iFlags & EAnalogDialerControlDragging);
+    RDebug::Printf("***AnalogDialer iDraggingData.iInitialAngle: %d",iDraggingData.iInitialAngle);
+    RDebug::Printf("***AnalogDialer iDraggingData.iPreviousAngle: %d",iDraggingData.iPreviousAngle);
+    RDebug::Printf("***AnalogDialer iDraggingData.iIsClockWiseOverZeroReached: %d",iDraggingData.iIsClockWiseOverZeroReached);
+    RDebug::Printf("***AnalogDialer iDraggingData.iStopperReached: %d",iDraggingData.iStopperReached);
+    RDebug::Printf("***AnalogDialer aAngle: %d",aAngle);
+    RDebug::Printf("\n");
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/src/alfexanalogdialercontrol2.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1030 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of member functions of 
+*                AlfExAnalogDialerControl.
+*
+*/
+
+
+
+#include <coemain.h>
+
+// Visuals
+#include <alf/alfgridlayout.h>
+#include <alf/alftextvisual.h>
+#include <alf/alfimagevisual.h>
+#include <alf/alflinevisual.h>
+
+// Layouts
+#include <alf/alfdecklayout.h>
+#include <alf/alfcurvepath.h>
+#include <alf/alfcurvepathlayout.h>
+
+// Brushes
+#include <alf/alfborderbrush.h>
+#include <alf/alfbrusharray.h>
+#include <alf/alfimagebrush.h>
+#include <alf/alfimage.h>
+#include <alf/alfshadowborderbrush.h>
+#include <alf/alfgradientbrush.h>
+
+// Unsorted
+#include <aknutils.h>
+#include <alf/alftransformation.h>
+#include <alf/alfevent.h>
+#include <alf/alfdisplay.h>
+#include <alf/alfenv.h>
+#include <alf/alfmappingfunctions.h>
+#include <alf/alfroster.h>
+
+#include <e32math.h>
+
+#include "alfexanalogdialercontrol.h"
+#include "alfexanalogdialerfeedback.h"
+
+// Image names
+_LIT(KImageAnalogDialerBackground, "background.png");
+_LIT(KImageAnalogDialerNumbers, "numbers.png");
+_LIT(KImageAnalogDialerPlate, "plate.png");
+_LIT(KImageAnalogDialerStopper, "stopper.png");
+
+#define RADTODEG(Rad) ((180.0 * Rad) / KPi)
+
+// dimension of grid
+const TInt KDimensionsOfGrid = 2;
+
+// Tags for visuals which have always same appearance. 
+// TTagAnalogDialerVisual is used for indexing
+const char* KTagArrayTheRest[] =
+    {
+    "main",
+    "display",
+    "phone",
+    "plate-deck",
+    "plate-image",
+    "stopper"
+    };     
+
+// Dimensions of grid. iLayoutMode is used for indexing
+const TInt KRowsAndColumnsOfGrid[][KDimensionsOfGrid] =
+    {
+    { 1, 2 },   // columns, rows
+    { 2, 1 }  
+    };
+     
+// Templates for displaying number
+_LIT(KNumberDisplayTemplate, "%d");
+
+// Radius of Clear area of plate. Per cents from radius of plate.
+const TInt KPlateClearRadius = 25;
+
+// Unit speed of returning plate to idle position
+const TInt KPlateReturnSpeed = 65;
+
+// As dragging events occur very often, redrawing plate is optimised that
+// it is not drawn after every dragging event. Change of KPlateDraggingDelta 
+// degrees is needed.
+const TInt KPlateDraggingDelta = 2;
+
+// position of stopper in degrees. Angle is 43
+const TInt KStopperAngle = 360-43;
+
+// Angle of first number
+// Numbers are on angle between KPlateNumbersStartAngle and (KPlateNumbersStartAngle + KPlateNumbersDistributionAngle)
+const TInt KPlateNumbersStartAngle = 3;
+
+// angle of arch on which numbers (or holes of plate) are distributed
+// Numbers are on angle between KPlateNumbersStartAngle and (KPlateNumbersStartAngle + KPlateNumbersDistributionAngle)
+const TInt KPlateNumbersDistributionAngle = 290;
+
+// minimum rotation of plate that number becomes selected
+const TInt KPlateMinimumRotateAngle=43;
+
+// font color 
+const TRgb KFontColor = TRgb(192,192,192);
+// Size of padding of the root grid layout
+//const TReal32 KPaddingPercentage = .05;
+
+ 
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerControl* CAlfExAnalogDialerControl::NewL(CAlfEnv& aEnv)
+    {
+    CAlfExAnalogDialerControl* self = CAlfExAnalogDialerControl::NewLC(aEnv);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerControl* CAlfExAnalogDialerControl::NewLC(CAlfEnv& aEnv)
+    {
+    CAlfExAnalogDialerControl* self = new (ELeave) CAlfExAnalogDialerControl();
+    CleanupStack::PushL(self);
+    self->ConstructL(aEnv);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// ~CAlfExAnalogDialerControl
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerControl::~CAlfExAnalogDialerControl()
+    {
+    if (iFlags & EAnalogDialerControlFlagLongTapRegistered)
+        {
+        Display()->Roster().RemovePointerEventObserver(EAlfPointerEventReportLongTap, *this);
+        }
+    Env().CancelCommands(this);
+    delete iFeedback;
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfExAnalogDialerControl
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerControl::CAlfExAnalogDialerControl()
+        : CAlfControl()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::ConstructL(CAlfEnv& aEnv)
+    {
+    CAlfControl::ConstructL(aEnv);
+    // Id cannot be be set in constructor
+	SetId(KAlfExAnalogDialerControlId);
+
+    // resolve layout: portrait or landscape
+    iLayoutMode = ResolveLayout(iSquareSide,
+                            iLongerSide);
+    (iLayoutMode == ELayoutAnalogDialerPortrait) ? SetupPortraitModeL() : SetupLandscapeModeL();
+
+    // set up vibra system
+    iFeedback = CAlfExAnalogDialerFeedback::NewL();
+    }   
+    
+    
+    
+// ---------------------------------------------------------------------------
+// Creates layouts and visual for portrait layout
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::SetupPortraitModeL()
+    {
+    // resolve layout: portrait or landscape
+    AddGridLayoutL();
+
+    // from top to bottom 1) display pane 2) dialer
+    AddDisplayPaneL();
+    AddDialerL();
+    
+    //AddEffectLayout();
+    }
+
+// ---------------------------------------------------------------------------
+// Creates layouts and visual for portrait layout
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::SetupLandscapeModeL()
+    {
+    // resolve layout: portrait or landscape
+    AddGridLayoutL();
+
+    // from left to right 1) dialer 2) display pane
+    AddDialerL();
+    AddDisplayPaneL();
+    
+    //AddEffectLayout();
+    }
+
+
+// ---------------------------------------------------------------------------
+// Creates grid layout and returns it
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::AddGridLayoutL()
+    {
+      // Create a grid layout to act as the root layout visual. Not owned
+    if (!iRootLayout)
+        {
+        iRootLayout = CAlfGridLayout::AddNewL(*this, 
+                                            KRowsAndColumnsOfGrid[iLayoutMode][EColumn], 
+                                            KRowsAndColumnsOfGrid[iLayoutMode][ERow]);
+        iRootLayout->SetTagL(_L8(KTagArrayTheRest[ETagAnalogDialerMain]));   
+        // Brushed must enabled before they can be used
+        iRootLayout->EnableBrushesL();      
+
+        // Background image is implemented using image brush
+        CAlfTexture& backgroundTexture = Env().TextureManager().LoadTextureL( 
+                                            KImageAnalogDialerBackground,
+                                            EAlfTextureFlagDefault, 
+                                            KAlfAutoGeneratedTextureId);        
+        // Default scale mode CAlfImageVisual::EScaleFit is OK
+        CAlfImageBrush* brush = CAlfImageBrush::NewLC(Env(), TAlfImage(backgroundTexture));
+        // sets background image behind the visual
+        brush->SetLayer(EAlfBrushLayerBackground);
+        iRootLayout->Brushes()->AppendL(brush, EAlfHasOwnership);
+        CleanupStack::Pop(brush);
+        }
+    else
+        {
+        // Reset current dimensions
+        // There is only one dimension
+        for(TInt i=0; i<KDimensionsOfGrid; i++)
+            {
+            // resetting non existing weights causes Leave
+            TRAP_IGNORE(iRootLayout->RemoveWeightL(EAlfGridColumn, i));
+            TRAP_IGNORE(iRootLayout->RemoveWeightL(EAlfGridRow, i));
+            }
+        // now set new dimension
+        iRootLayout->SetColumnsL(KRowsAndColumnsOfGrid[iLayoutMode][EColumn]);
+        iRootLayout->SetRowsL(KRowsAndColumnsOfGrid[iLayoutMode][ERow]);
+        }
+
+    // Sets weights of grid
+    SetWeightsOfGridL(*iRootLayout,
+                      iLayoutMode,
+                      iSquareSide,
+                      iLongerSide,
+                      iPlateTopOffset);
+                             
+    // Set the padding of the root layout
+    
+    // TODO: Padding disabled for now. This seems to mess the angle calculations as we the calculations do not consider
+    // the effect of padding.
+
+    /*
+    TRect displayRect = Env().PrimaryDisplay().VisibleArea();
+    TInt pad = displayRect.Height();
+    if ( iLayoutMode == ELayoutAnalogDialerLandscape )
+        {
+        pad = displayRect.Width();
+        }   
+    layout->SetInnerPadding(TPoint( 
+    		pad * KPaddingExtents[iLayoutMode][EColumn],
+    		pad * KPaddingExtents[iLayoutMode][ERow]));
+    layout->SetPadding(pad * KPaddingPercentage);*/
+    }
+
+
+// ---------------------------------------------------------------------------
+// Handles pointer down events
+// ---------------------------------------------------------------------------
+//
+TBool CAlfExAnalogDialerControl::HandlePointerDownEventL(const TAlfEvent& aEvent)
+	{
+	CAlfVisual* onVisual = aEvent.Visual();
+	// Dragging may start only on top of image
+	if (onVisual == iStopper)
+	    {      
+	    // Is plate rotating starting?
+        if (IsPointerEventFollowingNumbersArcPath(aEvent))
+            {
+            // Plate rotation is starting
+    	    // Register to receive dragging events
+    	    Display()->Roster().AddPointerEventObserver(EAlfPointerEventReportDrag, *this);   
+    		ResetDraggingData();
+
+            // Start dragging
+    	    iFlags |= EAnalogDialerControlDragging;
+            }
+        // Is clear key pressed?
+        else if (IsPointerEventOnClearKey(aEvent))
+            {
+    		ResetClearKeyData();
+    	        
+    	    // Register for long tap events
+            if (!(iFlags & EAnalogDialerControlFlagLongTapRegistered))
+                {
+                // Clear key handling needs long tap events
+                Display()->Roster().AddPointerEventObserver(EAlfPointerEventReportLongTap, *this);   
+                iFlags |= EAnalogDialerControlFlagLongTapRegistered;
+                }
+            // Start clear key event
+    	    iFlags |= EAnalogDialerControlClearKeyEvent;
+            }
+	    }
+	return ETrue;
+	}
+
+// ---------------------------------------------------------------------------
+// Handles events while dragging
+// ---------------------------------------------------------------------------
+//
+TBool CAlfExAnalogDialerControl::HandleDraggingEventL(const TAlfEvent& aEvent)
+	{
+    if (iFlags & EAnalogDialerControlDragging)
+        {
+    	TPoint plateCentricPoint;
+    	ConvertEventToPlateCentricPosition(aEvent,
+    	                                   iPlateTopOffset,
+    	                                   iSquareSide,
+    	                                   plateCentricPoint);
+    	TInt plateRadius = iSquareSide / 2;
+    	if (!IsPointerEventOnArcPath(plateCentricPoint,
+    	                             plateRadius,
+    	                             plateRadius * KPlateClearRadius / 100))
+    		{
+    		FinishDragging();
+    		}
+        else
+            {
+            // Pointer event is following path
+            // Get angle of pointer event and do further calculation based on it
+            TInt degrees = Angle(plateCentricPoint.iX, plateCentricPoint.iY);
+
+            // Save the angle of first dragging pointer event.
+            // It is used to resolve selected number.
+        	if (iDraggingData.iInitialAngle == 0)
+        	    {
+        	    iDraggingData.iInitialAngle = degrees; 
+        	    iDraggingData.iPreviousAngle = degrees;
+        	    }
+        	        
+            // As dragging events occur very often, redrawing plate is optimised that
+            // it is not drawn after every dragging event. Change of KPlateDraggingDelta degrees
+            // is needed until plate is redrawn.
+            if (    degrees >= iDraggingData.iPreviousAngle + KPlateDraggingDelta 
+                ||  degrees <= iDraggingData.iPreviousAngle - KPlateDraggingDelta)
+                {
+                ResolveXAxisCrossing(degrees);                     
+                iDraggingData.iPreviousAngle = degrees;
+                            
+                if (    iDraggingData.iIsClockWiseOverZeroReached
+                    &&  degrees < KStopperAngle)
+                    {
+                    if (iDraggingData.iStopperReached)
+                        {
+                        // do not redraw as plate cannot rotate more
+                        return ETrue;
+                        }
+                    // stopper has been reached
+                    iDraggingData.iStopperReached = ETrue;
+                    }
+                else if (   !iDraggingData.iIsClockWiseOverZeroReached
+                        &&  degrees > iDraggingData.iInitialAngle)
+                    {
+                    // Rotation counter clockwise to the left of idle position is asked
+                    // Plate does not rotate counterclockwise to the left of idle position
+                    return ETrue;
+                    }
+                else if (iDraggingData.iStopperReached)
+                    {                        
+                    // user has dragged 360 degrees and and is dragging now between idle and stopper position
+                    return ETrue;
+                    }
+                 else
+                    {
+                    // rotating when angle is between idle and stopper position
+                    iDraggingData.iStopperReached = EFalse;
+                    }
+                //DebugDraggingData(degrees);
+                RotatePlate(    *iImage,
+                                iDraggingData.iInitialAngle,
+                                degrees,
+                                iDraggingData.iIsClockWiseOverZeroReached);
+                }
+            // else - delta of rotation has not reached KPlateDraggingDelta
+            }
+        }
+    return ETrue;
+	}
+
+// ---------------------------------------------------------------------------
+// Handle pointer up event
+// ---------------------------------------------------------------------------
+//
+TBool CAlfExAnalogDialerControl::HandlePointerUpEventL(const TAlfEvent& aEvent)
+	{
+	if (iFlags & EAnalogDialerControlDragging)
+		{
+		FinishDragging();
+		}
+    else if (iFlags & EAnalogDialerControlClearKeyEvent)
+        {
+        if (IsPointerEventOnClearKey(aEvent))
+            {
+            ClearNumberDisplay(iFlags&EAnalogDialerControlFlagLongTapPressed);
+            }
+        // else - lifting pointer outside Clear key area cancels clearing number
+        ResetClearKeyData();
+        }
+    return ETrue;
+	}
+
+// ---------------------------------------------------------------------------
+// Handle long tap event
+// ---------------------------------------------------------------------------
+//
+TBool CAlfExAnalogDialerControl::HandlePointerLongTapEventL(const TAlfEvent& /*aEvent*/)
+    {
+    if (iFlags & EAnalogDialerControlClearKeyEvent)
+        {
+        iFlags |= EAnalogDialerControlFlagLongTapPressed;
+        }
+    return ETrue;  
+    }
+
+// ---------------------------------------------------------------------------
+// Events from framework
+// ---------------------------------------------------------------------------
+//
+TBool CAlfExAnalogDialerControl::OfferEventL(const TAlfEvent& aEvent)
+    {
+    if (aEvent.IsPointerEvent() && aEvent.PointerDown())
+	    {
+	    return HandlePointerDownEventL(aEvent);    
+	    }
+	 
+	else if(aEvent.IsPointerEvent() && aEvent.PointerEvent().iType == TPointerEvent::EDrag )
+	    {
+	    return HandleDraggingEventL(aEvent);
+	    }
+	
+	else if(aEvent.IsPointerEvent() && aEvent.PointerUp())
+	    {
+	    return HandlePointerUpEventL(aEvent);
+	    }
+
+	else if(aEvent.IsPointerEvent() && aEvent.PointerLongTap())
+	    {
+	    return HandlePointerLongTapEventL(aEvent);
+	    }
+	    
+	return EFalse;
+	}
+
+// ---------------------------------------------------------------------------
+// AddNumberToDisplayPaneL
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::AddNumberToDisplayPaneL(TInt aNumber)
+	{	
+    TBuf<8> number;        
+    // Second parameter: number cannot be 10
+    number.Format(KNumberDisplayTemplate, (aNumber+1)%10);
+    if (iDisplayNumber.Length() + number.Length() <= KNumberDisplayBufferLength)
+    	{
+    	iDisplayNumber.Append(number);    
+    	iDisplayPane->SetTextL(iDisplayNumber);
+    	}
+	}
+	
+// ---------------------------------------------------------------------------
+// Adds content into display pane of the application
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::AddDisplayPaneL()
+    {
+    CAlfDeckLayout* displayDeck = CAlfDeckLayout::AddNewL(*this, iRootLayout);
+    // Add TextVisual for displaying text
+    iDisplayPane = CAlfTextVisual::AddNewL(*this, displayDeck);
+    iDisplayPane->SetTagL(_L8( KTagArrayTheRest[ETagAnalogDialerDisplay]));
+    iDisplayPane->EnableBrushesL();      
+    iDisplayPane->SetAlign(EAlfAlignHRight, EAlfAlignVCenter);      
+    iDisplayPane->SetFlag(EAlfVisualFlagManualLayout);
+    
+    // Decoration
+    if (iLayoutMode == ELayoutAnalogDialerPortrait)
+    	{
+    	iDisplayPane->SetCenteredPosAndSize(TPoint(180,100),TSize(300,50));
+    	}
+    else 
+    	{
+    	iDisplayPane->SetCenteredPosAndSize(TPoint(150,180),TSize(200,300));
+    	}
+    iDisplayPane->SetStyle(EAlfTextStyleTitle);
+    iDisplayPane->SetColor(KFontColor);    
+    
+    // Display rectangular 
+    CAlfShadowBorderBrush* brush = CAlfShadowBorderBrush::NewLC(Env(),6);
+    brush->SetOpacity(.25f);
+    // Attach brush and transfer its ownership to the visual.    
+    iDisplayPane->Brushes()->AppendL(brush, EAlfHasOwnership);    
+    CleanupStack::Pop(brush);    
+    }
+
+// ---------------------------------------------------------------------------
+// Adds content into dialer pane of the application
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::AddDialerL()
+    {
+    // Deck
+    CAlfDeckLayout* dialerDeck = CAlfDeckLayout::AddNewL(*this, iRootLayout);
+    
+    dialerDeck->SetTagL(_L8(KTagArrayTheRest[ETagAnalogDialerDialer]));
+    // TODO: for testing
+    dialerDeck->EnableTransformationL();
+    dialerDeck->EnableBrushesL();
+    
+	// load textures 
+	// the dialer consists of 3 pictures which are put on top of each other.
+    
+    // Bottom most is the image with the numbers
+    CAlfTexture& dialerBgTexture = Env().TextureManager().LoadTextureL( KImageAnalogDialerNumbers, 
+                                                                        EAlfTextureFlagDefault, 
+                                                                        KAlfAutoGeneratedTextureId);
+    // Default scale mode CAlfImageVisual::EScaleFit is OK
+	CAlfImageVisual* image2  = CAlfImageVisual::AddNewL(*this,dialerDeck); 
+	// attach texture to image visual
+	image2->SetImage(TAlfImage(dialerBgTexture));
+	
+	// on top of the numbers is the plate picture, which will be rotated
+	CAlfTexture& circle = Env().TextureManager().LoadTextureL(  KImageAnalogDialerPlate, 
+	                                                            EAlfTextureFlagDefault, 
+	                                                            KAlfAutoGeneratedTextureId);
+    // Default scale mode CAlfImageVisual::EScaleFit is OK
+	iImage  = CAlfImageVisual::AddNewL(*this,dialerDeck); 
+	iImage->SetImage(TAlfImage(circle));
+
+	// on top the rotating plate is image with the stopper and shadows
+	CAlfTexture& stopper = Env().TextureManager().LoadTextureL( KImageAnalogDialerStopper, 
+	                                                            EAlfTextureFlagDefault, 
+	                                                            KAlfAutoGeneratedTextureId);
+    // Default scale mode CAlfImageVisual::EScaleFit is OK
+	iStopper  = CAlfImageVisual::AddNewL(*this,dialerDeck); 
+	iStopper->SetImage(TAlfImage(stopper));
+    
+    }
+
+// ---------------------------------------------------------------------------
+// SwitchLayoutL
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::SwitchLayoutL()
+    {
+    iLayoutMode = ResolveLayout(iSquareSide,
+                            iLongerSide);
+    iLayoutMode == ELayoutAnalogDialerPortrait ? SetupPortraitModeL() : SetupLandscapeModeL();
+    if (iLayoutMode == ELayoutAnalogDialerPortrait)
+        {
+        MoveVisualToFirst(_L8(KTagArrayTheRest[ETagAnalogDialerDisplay]));
+        }
+    else
+        {
+        MoveVisualToFirst(_L8(KTagArrayTheRest[ETagAnalogDialerDialer]));
+        }
+
+    iFeedback->Start();
+
+    // expose new root layout
+    TAlfTimedValue opacity(0.0f);
+    opacity.SetTarget(255, 500);
+    iRootLayout->SetOpacity(opacity);   
+
+    }
+    
+// ---------------------------------------------------------------------------
+// Moves visual with given tag to first visual in the layout
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::MoveVisualToFirst(const TDesC8& aTag)
+    {
+    CAlfVisual* layout = FindTag(aTag);
+    if (layout)
+        {
+        // layout to move, index in the layout, transition time
+        iRootLayout->Reorder(*layout, 0, 0);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Hides the visual
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::PrepareForLayoutSwitchL()
+    {
+    CAlfVisual* layout = FindTag(_L8(KTagArrayTheRest[ETagAnalogDialerMain]));
+    if ( layout )
+        {
+        TAlfTimedValue opacity(1.0f);
+        opacity.SetTarget( 0.0f, 500);
+        layout->SetOpacity(opacity);   
+        }
+    iFeedback->Start();
+    User::After(500000);
+    }
+
+
+// ---------------------------------------------------------------------------
+// Resolves current layout.
+// ---------------------------------------------------------------------------
+// 
+CAlfExAnalogDialerControl::TLayoutMode CAlfExAnalogDialerControl::ResolveLayout(
+                                            TInt& aShorterSide,
+                                            TInt& aLongerSide) const
+    {
+    TLayoutMode layoutMode = ELayoutAnalogDialerPortrait;
+    TRect displayRect = Env().PrimaryDisplay().VisibleArea();
+    TInt height = displayRect.Height();
+    TInt width = displayRect.Width();
+    if (width > height)
+        {
+        layoutMode = ELayoutAnalogDialerLandscape;
+        aShorterSide = height;
+        aLongerSide = width;
+        }
+    else
+        {
+        // default mode OK
+        aShorterSide = width;
+        aLongerSide = height;
+        }
+    return layoutMode;
+    }
+ 
+// ---------------------------------------------------------------------------
+// ResolveXAxisCrossing
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerControl::ResolveXAxisCrossing(TInt aAngle)
+    {   
+    // Delta of angle change, which indicates X-axis crossing
+    const TInt KXAxisCrossingAngleDelta = 300;
+
+    TInt degreesDelta = aAngle - iDraggingData.iPreviousAngle;
+    // switch from 0 to 359?
+    if (degreesDelta > KXAxisCrossingAngleDelta)
+        {
+        iDraggingData.iIsClockWiseOverZeroReached = ETrue;
+        }
+    // switch from 359 to 0?
+    else if (   iDraggingData.iIsClockWiseOverZeroReached
+            &&  degreesDelta < (-KXAxisCrossingAngleDelta))
+        {
+        iDraggingData.iIsClockWiseOverZeroReached = EFalse;
+        }    
+    }
+
+
+// ---------------------------------------------------------------------------
+// Calculate angle of triangle, when adjacent and opposite sides are known
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfExAnalogDialerControl::Angle(TReal32 aAdjacent, TReal32 aOpposite)
+	{
+	if (aAdjacent == 0)
+	    {
+	    aAdjacent = 0.01;
+	    }
+	
+	if (aOpposite == 0)
+		{
+		aOpposite = 0.01;
+		}
+
+	TReal angle;
+	Math::ATan(angle, Abs(aOpposite / aAdjacent));
+	
+	if (aAdjacent < 0 && aOpposite > 0)
+		{
+		angle =  KPi - angle;
+		}
+	else if (aAdjacent < 0 && aOpposite < 0)
+		{
+		angle = KPi + angle; 
+		}
+    else if (aAdjacent > 0 && aOpposite < 0)
+		{
+		angle = 2* KPi -  angle;
+		}
+    return RADTODEG(angle);			
+	}
+
+// ---------------------------------------------------------------------------
+// Calculate hypotenuse of triangle when length of adjacent and opposite sides are known
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfExAnalogDialerControl::Hypotenuse(TInt aA, TInt aB)
+	{
+	aA *= aA;
+	aB *= aB;
+		
+	TReal hypotenuse;
+	Math::Sqrt(hypotenuse, aA + aB);
+	return hypotenuse;
+	}
+	
+
+// ---------------------------------------------------------------------------
+// Layout of portrait and landscape modes are hardwired into implementation. 
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::SetWeightsOfGridL(  CAlfGridLayout& aGridLayout,
+                                                    TLayoutMode     aLayout,
+                                                    TInt            aSquareSide,
+                                                    TInt            aLongerSide,
+                                                    TInt&           aPlateTop)
+    {
+    // Set up a variable for default value.
+    RArray<TInt> weightsDefault;
+    User::LeaveIfError(weightsDefault.Append(1));   
+
+    // sets weights of grid. Use pixels to get exact adjustment of pane sizes
+    RArray<TInt> weights;
+    if (aLayout == ELayoutAnalogDialerPortrait)
+        {
+        // top: display
+        User::LeaveIfError(weights.Append(aLongerSide-aSquareSide));
+        // bottom: dialer
+        User::LeaveIfError(weights.Append(aSquareSide));
+        aGridLayout.SetRowsL(weights);
+        aGridLayout.SetColumnsL(weightsDefault);
+        
+        aPlateTop = aLongerSide-aSquareSide;
+        }
+    else
+        {
+        // left: dialer
+        User::LeaveIfError(weights.Append(aSquareSide));
+        // right: display
+        User::LeaveIfError(weights.Append(aLongerSide-aSquareSide));
+        aGridLayout.SetRowsL(weightsDefault);
+        aGridLayout.SetColumnsL(weights);
+        
+        aPlateTop = 0;
+        }         
+    weights.Close(); 
+    weightsDefault.Close(); 
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// ConvertEventToPlateCentricPosition
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::ConvertEventToPlateCentricPosition(
+                                        const TAlfEvent&    aEvent,
+	                                    TInt                aPlateTopOffset,
+	                                    TInt                aSquareSide,
+	                                    TPoint&             aPlateCentricPoint)
+    {
+    // event position is converted in a such way that centre position of the plate is (0,0)
+    // iY: value is negative, if position is above the centre position
+    // iY: value is position, if position is under the centre position
+    // iX: value is negative, if position is to the left the centre position
+    // iX: value is position, if position is to the right of the centre position
+	const TInt plateCentreY = aPlateTopOffset + aSquareSide / 2;
+	aPlateCentricPoint.iX = aEvent.PointerEvent().iParentPosition.iX - aSquareSide / 2;
+	aPlateCentricPoint.iY = plateCentreY - aEvent.PointerEvent().iParentPosition.iY ;
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// Checks whether pointer event occurred between outer and inner radius
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfExAnalogDialerControl::IsPointerEventOnArcPath(   TPoint& aPlateCentricPoint,
+	                                                        TInt    aOuterRadius,
+	                                                        TInt    aInnerRadius)
+    {  
+    // Checks whether position is along a path, which is between two imaginary circles.
+    // Radius of circles are given. 
+    TBool ret = ETrue;   
+	TInt distanceFromPlateCentre = Hypotenuse(aPlateCentricPoint.iX, aPlateCentricPoint.iY); 	
+	if (distanceFromPlateCentre > aOuterRadius || distanceFromPlateCentre < aInnerRadius)
+	    {
+	    ret = EFalse;
+	    }
+	return ret;
+    }
+    
+// ---------------------------------------------------------------------------
+// Dragging has been stopped. Resets dragging data
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::ResetDraggingData()
+    {
+	iFlags &= (~EAnalogDialerControlDragging);
+	iDraggingData.iInitialAngle = 0;
+	iDraggingData.iPreviousAngle = 0;
+	iDraggingData.iIsClockWiseOverZeroReached = EFalse;
+	iDraggingData.iStopperReached=EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// Dragging has been stopped. Resets dragging data
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::ResetClearKeyData()
+    {
+	iFlags &= (~EAnalogDialerControlClearKeyEvent);
+    iFlags &= (~EAnalogDialerControlFlagLongTapPressed);
+    }
+
+
+// ---------------------------------------------------------------------------
+// Turns plate image back to idle position
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::RotatePlateToIdlePosition(CAlfImageVisual&    aImage)
+    {
+	// Rotate the image. This has immediate effect.
+	TAlfTimedValue tValue;
+	tValue.SetTargetWithSpeed(0,  // position zero 
+	                          KPlateReturnSpeed);
+	aImage.SetTurnAngle(tValue);
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// Rotates image
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::RotatePlate(
+                                    CAlfImageVisual&    aImage,
+                                    TInt                aInitialAngle,
+                                    TInt                aTargetAngle,
+                                    TBool               aIsClockWiseOverZeroReached)
+    {
+    // When rotates clockwise, rotation angle is negative
+    TInt rotateDelta = aTargetAngle-aInitialAngle;
+    if (aIsClockWiseOverZeroReached)
+        {
+        // Angle is big value (near to 360), which cannot be used as such
+        // Convert it to negative value
+        rotateDelta = (aTargetAngle-360)-aInitialAngle;
+        }
+    //RDebug::Printf("***AnalogDialer rotateDelta : %d",rotateDelta);
+    TAlfTimedValue tValue(rotateDelta);
+    aImage.SetTurnAngle(tValue);
+    }
+    
+// ---------------------------------------------------------------------------
+// Debugs dragging data + given angle 
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::DebugDraggingData(TInt aAngle)
+    {
+    RDebug::Printf("\n***AnalogDialer:");
+    RDebug::Printf("***AnalogDialer iFlags & EAnalogDialerControlDragging: %d",iFlags & EAnalogDialerControlDragging);
+    RDebug::Printf("***AnalogDialer iDraggingData.iInitialAngle: %d",iDraggingData.iInitialAngle);
+    RDebug::Printf("***AnalogDialer iDraggingData.iPreviousAngle: %d",iDraggingData.iPreviousAngle);
+    RDebug::Printf("***AnalogDialer iDraggingData.iIsClockWiseOverZeroReached: %d",iDraggingData.iIsClockWiseOverZeroReached);
+    RDebug::Printf("***AnalogDialer iDraggingData.iStopperReached: %d",iDraggingData.iStopperReached);
+    RDebug::Printf("***AnalogDialer aAngle: %d",aAngle);
+    RDebug::Printf("\n");
+    }
+
+
+// ---------------------------------------------------------------------------
+// Returns selected number based on rotated angle of plate 
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfExAnalogDialerControl::DialedNumber(   TInt aInitialAngle,
+                                                TInt aCurrentAngle) const
+    {
+    // Default value when dragging event has not crossed zero-angle X-axis
+    TInt deltaAngle = aCurrentAngle-aInitialAngle;
+    
+    // aCurrentAngle must be an angle derived directly from ConvertEventToPlateCentricPosition
+    if (iDraggingData.iIsClockWiseOverZeroReached)
+        {
+        deltaAngle = aInitialAngle+(360-KStopperAngle);
+        }
+    
+    // subtract required minimun angle
+    deltaAngle = Abs(deltaAngle)-KPlateMinimumRotateAngle;
+    if (deltaAngle<0)
+        {
+        return KErrNotFound;
+        }
+    // TODO. These values could be made constant to use plate with other number systems as decimal
+    // e.g. binary, or hexadecimal
+    // Finally calculate dialed number based on rotated angle
+    TInt angleOfANumber(KPlateNumbersDistributionAngle/10);
+    TInt dialedNumber = deltaAngle/angleOfANumber;
+    if (dialedNumber > 9)
+        {
+        dialedNumber = 9;
+        }
+    return dialedNumber;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Checks whether pointer is on path allowed for plate rotation
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfExAnalogDialerControl::IsPointerEventFollowingNumbersArcPath( const TAlfEvent& aEvent ) const
+    {
+	TPoint plateCentricPoint;
+	ConvertEventToPlateCentricPosition(aEvent,
+	                                    iPlateTopOffset,
+	                                    iSquareSide,
+	                                    plateCentricPoint);
+    TInt degrees = Angle( plateCentricPoint.iX, plateCentricPoint.iY);
+	// Third parameter: Radius of clear area belongs to clear area
+	TInt plateRadius = iSquareSide / 2;
+	if ( IsPointerEventOnArcPath( plateCentricPoint,
+	                              plateRadius,
+	                              (plateRadius*KPlateClearRadius/100)+1))
+	    {
+	    return ETrue;
+	    }
+    return EFalse;
+    }
+    
+// ---------------------------------------------------------------------------
+// Checks whether pointer is on area of clear key
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfExAnalogDialerControl::IsPointerEventOnClearKey( const TAlfEvent& aEvent ) const
+    {
+	TPoint plateCentricPoint;
+	ConvertEventToPlateCentricPosition(aEvent,
+	                                    iPlateTopOffset,
+	                                    iSquareSide,
+	                                    plateCentricPoint);
+	TInt plateRadius = iSquareSide / 2;
+	if ( IsPointerEventOnArcPath( plateCentricPoint,
+	                              plateRadius*KPlateClearRadius/100,
+	                              0))
+	    {
+	    return ETrue;
+	    }
+    return EFalse;
+    }
+    
+
+// ---------------------------------------------------------------------------
+// Performs actions needed when dragging is finished
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::FinishDragging()
+    {
+	// Dragging has finished
+	// Remove pointer dragging observer, which will gain us performance
+    Display()->Roster().RemovePointerEventObserver( EAlfPointerEventReportDrag,*this );
+    DialedNumberToDisplay(iDraggingData.iInitialAngle,
+                            iDraggingData.iPreviousAngle);
+    RotatePlateToIdlePosition(*iImage); 
+    ResetDraggingData();
+    }
+    
+// ---------------------------------------------------------------------------
+// Puts dialed number into number display
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::DialedNumberToDisplay(  TInt aInitialAngle,
+                                                        TInt aCurrentAngle )
+    {
+    TInt dialedNumber = DialedNumber(   aInitialAngle,
+                                        aCurrentAngle );
+    // Filter KErrNotFound out
+    if (dialedNumber>=0)
+        {
+        TRAP_IGNORE( AddNumberToDisplayPaneL( dialedNumber ) );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Clear number display either wholly or last number
+// ---------------------------------------------------------------------------
+// 
+void CAlfExAnalogDialerControl::ClearNumberDisplay(TBool aClearWholeDisplay)
+    {
+    TInt lengthNumber = iDisplayNumber.Length();
+    if (lengthNumber == 0)
+        {
+        return;
+        }
+
+    if (aClearWholeDisplay)
+        {
+        TBuf<1> clearBuf;        
+        iDisplayNumber.Copy(clearBuf);
+        }
+    else
+        {
+        // delete one number
+        iDisplayNumber.Delete(lengthNumber-1,1);
+        }
+    TRAP_IGNORE( iDisplayPane->SetTextL(iDisplayNumber) );
+    }
+
+void CAlfExAnalogDialerControl::AddEffectLayout()
+	{
+	
+	}
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/src/alfexanalogdialerdocument.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of member functions of 
+*                CAlfExAnalogDialerDocument.
+*
+*/
+
+
+
+#include "alfexanalogdialerdocument.h"
+#include "alfexanalogdialerappui.h"
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerDocument* CAlfExAnalogDialerDocument::NewL(CEikApplication& aApp)
+    {
+    CAlfExAnalogDialerDocument* self = NewLC(aApp);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerDocument* CAlfExAnalogDialerDocument::NewLC(CEikApplication& aApp)
+    {
+    CAlfExAnalogDialerDocument* self = new (ELeave) CAlfExAnalogDialerDocument(aApp);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// ~CAlfExAnalogDialerDocument
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerDocument::~CAlfExAnalogDialerDocument()
+    {
+	// no implementation required
+    }
+    
+// ---------------------------------------------------------------------------
+// CreateAppUiL
+//     // Create the application user interface, and return a pointer to it,
+    // the framework takes ownership of this object
+
+// ---------------------------------------------------------------------------
+//
+CEikAppUi* CAlfExAnalogDialerDocument::CreateAppUiL()
+    {
+    CEikAppUi* appUi = new (ELeave) CAlfExAnalogDialerAppUi;
+    return appUi;
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfExAnalogDialerDocument
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerDocument::CAlfExAnalogDialerDocument(CEikApplication& aApp) : CAknDocument(aApp) 
+    {
+	// no implementation required
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerDocument::ConstructL()
+    {
+	// no implementation required
+    }    
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexanalogdialer/src/alfexanalogdialerfeedback.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,148 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class for Analog Dialer example application, which
+*                implements long lasting tactile feed back event
+*
+*/
+
+
+
+#include <touchfeedback.h>
+
+#include "alfexanalogdialerfeedback.h"
+
+// constants
+
+// minimum values for clock in milliseconds
+const TInt KFeedbackMinimumDuration = 100;
+const TInt KFeedbackMinimumInterval = 100;
+
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerFeedback* CAlfExAnalogDialerFeedback::NewL()
+    {
+    CAlfExAnalogDialerFeedback* self = new (ELeave) CAlfExAnalogDialerFeedback();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerFeedback::CAlfExAnalogDialerFeedback()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CAlfExAnalogDialerFeedback::~CAlfExAnalogDialerFeedback()
+    {
+    if ( iClock )
+        {
+        iClock->Cancel();
+        delete iClock;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerFeedback::ConstructL()
+    {
+    iFeedback = MTouchFeedback::Instance();
+    // Remote control server command repeat timer.
+    iClock = CPeriodic::NewL( EPriorityNormal );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerFeedback::Start( TInt    aDurationMilliSeconds,
+                                        TInt    aIntervalMilliSeconds)
+    {
+    iDuration = KFeedbackDefault;
+    iInterval = KFeedbackMinimumInterval;
+
+    // 1000: convert millis to micros
+    if (iFeedback)
+        {
+        iFeedback->InstantFeedback(ETouchFeedbackBasic);
+        }
+    if ( aIntervalMilliSeconds > KFeedbackMinimumInterval )
+        {
+        iInterval = 1000*aIntervalMilliSeconds;   
+        }
+    if (aDurationMilliSeconds >= KFeedbackMinimumDuration)
+        {    
+        iDuration = 1000*aDurationMilliSeconds;   
+        iDurationStop.HomeTime();
+        iDurationStop +=  TTimeIntervalMicroSeconds(TInt64(iDuration));
+        iClock->Cancel();
+        iClock->Start(  iInterval,
+                        iInterval, 
+                        TCallBack( HandleInterval, this ));
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerFeedback::Stop()
+    {
+    iClock->Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CAlfExAnalogDialerFeedback::DoHandleInterval()
+    {
+    TTime timeNow;
+    timeNow.HomeTime();
+    if (timeNow > iDurationStop)
+        {
+        iClock->Cancel();
+        }
+    else
+        {
+        if (iFeedback)
+            {
+            iFeedback->InstantFeedback(ETouchFeedbackBasic);
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CAlfExAnalogDialerFeedback::HandleInterval(TAny* aThis)
+    {
+    // cast, and call non-static function
+    static_cast<CAlfExAnalogDialerFeedback*>(aThis)->DoHandleInterval();
+    return KErrNone;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/gfx/background.svg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="240" height="320" viewBox="0 0 240 320">
+<rect fill="none" height="320" width="240"/>
+<rect height="319.997" width="239.959" x="0.041"/>
+<linearGradient id="pohja_x5F_valkoinen_1" gradientUnits="userSpaceOnUse" x1="119.99" y1="320" x2="119.99" y2="0">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#F6F6F6" offset="0.01"/>
+<stop stop-color="#C8C8C8" offset="0.05"/>
+<stop stop-color="#9D9D9D" offset="0.09"/>
+<stop stop-color="#777777" offset="0.14"/>
+<stop stop-color="#575757" offset="0.2"/>
+<stop stop-color="#3B3B3B" offset="0.25"/>
+<stop stop-color="#252525" offset="0.32"/>
+<stop stop-color="#141414" offset="0.4"/>
+<stop stop-color="#090909" offset="0.49"/>
+<stop stop-color="#020202" offset="0.63"/>
+<stop stop-color="#000000" offset="1"/>
+</linearGradient>
+<rect fill="url(#pohja_x5F_valkoinen_1)" fill-opacity="0.31" height="319.997" width="239.959" x="0.012" y="0.004"/>
+<linearGradient id="SVGID_1" gradientUnits="userSpaceOnUse" x1="120" y1="0" x2="120" y2="41.65">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#333333" offset="1"/>
+</linearGradient>
+<path d="M0.041,0H240v30.75c0,0-85.544,24.527-240,0L0.041,0z" fill="url(#SVGID_1)" fill-opacity="0.37" />
+</svg>
\ No newline at end of file
Binary file exampleapps/alfexcalendar/gfx/calendar.jpg has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/gfx/controlpane.svg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="20" viewBox="0 0 200 20">
+<rect fill="none" height="20" width="200"/>
+<rect fill="#231F20" height="20" width="200"/>
+<linearGradient id="SVGID_1" gradientUnits="userSpaceOnUse" x1="100" y1="0" x2="100" y2="20">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#F2F2F2" offset="0.03"/>
+<stop stop-color="#B3B3B3" offset="0.19"/>
+<stop stop-color="#7C7C7C" offset="0.34"/>
+<stop stop-color="#505050" offset="0.5"/>
+<stop stop-color="#2D2D2D" offset="0.64"/>
+<stop stop-color="#141414" offset="0.78"/>
+<stop stop-color="#050505" offset="0.9"/>
+<stop stop-color="#000000" offset="1"/>
+</linearGradient>
+<rect fill="url(#SVGID_1)" fill-opacity="0.17" height="20" width="200"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/gfx/eventsdaybutton.svg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="25" height="25" viewBox="0 0 25 25">
+<rect fill="none" height="25" width="25"/>
+<linearGradient id="SVGID_1" gradientUnits="userSpaceOnUse" x1="12.5" y1="25" x2="12.5" y2="0">
+<stop stop-color="#6D111A" offset="0"/>
+<stop stop-color="#7E141E" offset="0.07"/>
+<stop stop-color="#8F1722" offset="0.18"/>
+<stop stop-color="#9A1925" offset="0.31"/>
+<stop stop-color="#A11A27" offset="0.49"/>
+<stop stop-color="#A31A27" offset="1"/>
+</linearGradient>
+<circle cx="12.5" cy="12.501" fill="url(#SVGID_1)" fill-opacity="0.6" r="12.5" />
+<linearGradient id="SVGID_2" gradientUnits="userSpaceOnUse" x1="12.47" y1="24.3" x2="12.47" y2="0.14">
+<stop stop-color="#6D111A" offset="0"/>
+<stop stop-color="#7E141E" offset="0.07"/>
+<stop stop-color="#8F1722" offset="0.18"/>
+<stop stop-color="#9A1925" offset="0.31"/>
+<stop stop-color="#A11A27" offset="0.49"/>
+<stop stop-color="#A31A27" offset="1"/>
+</linearGradient>
+<circle cx="12.467" cy="12.218" fill="url(#SVGID_2)" r="12.079"/>
+<path d="M24.303,12.354C9.778,10.769,0.372,12.323,0.372,12.323 c0-6.673,5.405-12.078,12.077-12.078c6.637,0,12.024,5.352,12.079,11.973c0,0.031,0,0.07,0,0.105L24.303,12.354z" fill="#FFFFFF" fill-opacity="0.23" />
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/gfx/normaldaybutton.svg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24.74" height="24.74" viewBox="0 0 24.74 24.74">
+<rect fill="none" height="24.74" width="24.74"/>
+<linearGradient id="SVGID_1" gradientUnits="userSpaceOnUse" x1="12.37" y1="24.73" x2="12.37" y2="0.01">
+<stop stop-color="#929699" offset="0"/>
+<stop stop-color="#989C9F" offset="0.08"/>
+<stop stop-color="#C3C7CC" offset="0.69"/>
+<stop stop-color="#D3D8DD" offset="1"/>
+</linearGradient>
+<ellipse cx="12.37" cy="12.371" fill="url(#SVGID_1)" fill-opacity="0.6" rx="12.348" ry="12.357" />
+<linearGradient id="SVGID_2" gradientUnits="userSpaceOnUse" x1="12.34" y1="24.03" x2="12.34" y2="0.15">
+<stop stop-color="#999999" offset="0"/>
+<stop stop-color="#9D9D9D" offset="0.03"/>
+<stop stop-color="#C7C7C7" offset="0.33"/>
+<stop stop-color="#E6E6E6" offset="0.6"/>
+<stop stop-color="#F8F8F8" offset="0.84"/>
+<stop stop-color="#FFFFFF" offset="1"/>
+</linearGradient>
+<ellipse cx="12.337" cy="12.091" fill="url(#SVGID_2)" rx="11.932" ry="11.94"/>
+<path d="M24.253,12.195c0-0.035,0-0.072,0-0.104C24.197,5.544,18.878,0.254,12.322,0.254 c-6.592,0-11.932,5.345-11.932,11.941c0,0,9.291-1.537,23.642,0.03" fill="#FFFFFF" fill-opacity="0.52" />
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/gfx/selectedday.svg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="27" height="27" viewBox="0 0 27 27">
+<rect fill="none" height="27" width="27"/>
+<ellipse cx="13.486" cy="13.525" fill="none" rx="12.23" ry="12.239" stroke="#F1C624" stroke-width="1.9317"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/gfx/title.svg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="70" height="70.008" viewBox="0 0 70 70.008">
+<rect fill="none" height="70.008" width="70"/>
+<linearGradient id="SVGID_1" gradientUnits="userSpaceOnUse" x1="35" y1="70.01" x2="35" y2="6.1">
+<stop stop-color="#4D4D4D" offset="0.14"/>
+<stop stop-color="#4D4D4D" offset="0.16"/>
+<stop stop-color="#808080" offset="0.28"/>
+<stop stop-color="#B3B3B3" offset="0.47"/>
+<stop stop-color="#B3B3B3" offset="0.72"/>
+<stop stop-color="#B3B3B3" offset="0.76"/>
+<stop stop-color="#A1A1A1" offset="0.77"/>
+<stop stop-color="#8B8B8B" offset="0.79"/>
+<stop stop-color="#7A7A7A" offset="0.81"/>
+<stop stop-color="#6F6F6F" offset="0.84"/>
+<stop stop-color="#686868" offset="0.88"/>
+<stop stop-color="#666666" offset="1"/>
+</linearGradient>
+<path d="M66.926,67.643c0,1.308-1.059,2.365-2.363,2.365H5.436c-1.305,0-2.363-1.058-2.363-2.365V8.468 c0-1.306,1.059-2.364,2.363-2.364h59.127c1.305,0,2.363,1.058,2.363,2.364V67.643z" fill="url(#SVGID_1)"/>
+<path d="M64.333,65.136c0,1.199-0.973,2.174-2.172,2.174H7.865 c-1.199,0-2.17-0.975-2.17-2.174V10.794c0-1.199,0.971-2.173,2.17-2.173h54.295c1.199,0,2.172,0.974,2.172,2.173V65.136z" fill="#333333" stroke="#F2F2F2" stroke-width="0.7238"/>
+<linearGradient id="SVGID_2" gradientUnits="userSpaceOnUse" x1="34.79" y1="9.78" x2="34.79" y2="65.29">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#000000" offset="1"/>
+</linearGradient>
+<path d="M62.518,63.237c0,1.134-0.92,2.055-2.051,2.055H9.107 c-1.135,0-2.055-0.921-2.055-2.055V11.838c0-1.134,0.92-2.055,2.055-2.055h51.36c1.131,0,2.051,0.921,2.051,2.055V63.237z" fill="url(#SVGID_2)" fill-opacity="0.21"/>
+<linearGradient id="SVGID_3" gradientUnits="userSpaceOnUse" x1="35.34" y1="0.01" x2="35.34" y2="6.2">
+<stop stop-color="#4D4D4D" offset="0"/>
+<stop stop-color="#525252" offset="0.07"/>
+<stop stop-color="#626262" offset="0.16"/>
+<stop stop-color="#7C7C7C" offset="0.26"/>
+<stop stop-color="#868686" offset="0.29"/>
+<stop stop-color="#B3B3B3" offset="0.52"/>
+<stop stop-color="#848484" offset="0.82"/>
+<stop stop-color="#666666" offset="1"/>
+</linearGradient>
+<rect fill="url(#SVGID_3)" height="6.188" width="33.874" x="18.406" y="0.008"/>
+<line fill="none" stroke="#FFFFFF" stroke-opacity="0.18" stroke-width="1.4991" x1="18.303" x2="52.348" y1="3.005" y2="3.005"/>
+</svg>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/group/alfexcalendar.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <platform_paths.hrh> 
+
+CAPABILITY None
+
+#ifdef __UI_FRAMEWORKS_V2__
+TARGETPATH	/sys/bin
+#if defined(EKA2) || !defined(WINS)
+TARGET          alfexcalendar.exe
+TARGETTYPE exe
+#else // EKA1 WINS
+TARGET          alfexcalendar.app
+TARGETTYPE exedll
+deffile /epoc32/release/wins/alfexcalendar.def
+#endif
+#else // __UI_FRAMEWORKS_V2__
+TARGET          alfexcalendar.app
+TARGETPATH      /system/apps/alfexcalendar
+TARGETTYPE app
+#endif
+
+UID               0x100039CE 0x0FCD4AC7
+
+LANG              SC
+
+SOURCEPATH        ../src
+SOURCE            alfexcalendar.cpp
+SOURCE            alfexcalendarapplication.cpp 
+SOURCE            alfexcalendarappui.cpp
+SOURCE            alfexcalendardocument.cpp 
+SOURCE            alfexcalendarmonth.cpp
+SOURCE            alfexcalendarengine.cpp
+SOURCE            alfexcalendarengineeventtimer.cpp
+SOURCE            alfexcalendardeckcontrol.cpp
+
+SOURCEPATH        ../group
+
+USERINCLUDE       ../inc 
+USERINCLUDE       ../sis 
+
+APP_LAYER_SYSTEMINCLUDE
+
+LIBRARY           euser.lib
+LIBRARY           apparc.lib
+LIBRARY           cone.lib 
+LIBRARY           eikcore.lib eikcoctl.lib
+LIBRARY           avkon.lib  
+LIBRARY           gdi.lib  
+
+LIBRARY           alfclient.lib
+LIBRARY           bafl.lib
+
+
+#ifdef __UI_FRAMEWORKS_V2__
+START RESOURCE	alfexcalendar.rss
+HEADER
+targetpath	/resource/apps
+lang		sc
+end
+#else
+RESOURCE        alfexcalendar.rss
+#endif
+
+#ifdef __UI_FRAMEWORKS_V2__
+sourcepath		.
+START RESOURCE	alfexcalendar_reg.rss
+#ifdef WINSCW
+TARGETPATH	/private/10003a3f/apps
+#else
+TARGETPATH	/private/10003a3f/import/apps
+#endif
+END
+   
+start resource alfexcalendar_loc.rss
+targetpath /resource/apps
+lang sc
+end
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/group/alfexcalendar.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,131 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Resource headers for project ?myapp
+*
+*/
+
+
+
+NAME ALFC // 4 letter ID
+
+#include <eikon.rh>
+#include <eikon.rsg>
+#include <avkon.rh>
+#include <avkon.rsg>
+
+#include "alfexcalendar.hrh"
+#include "alfexcalendar.loc"
+
+// ---------------------------------------------------------
+//   
+//    Define the resource file signature 
+//    This resource should be empty.
+//
+// ---------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE { }
+
+// ---------------------------------------------------------
+//   
+//    Default Document Name
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_default_document_name { buf=""; }
+
+// ---------------------------------------------------------
+//   
+//    Define default menu and CBA key.
+//
+// ---------------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    menubar = r_alfexcalendar_menubar;
+    cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
+    }
+
+// ---------------------------------------------------------
+//   
+//   r_alfexcalendar_menubar
+//   Menubar for alfexcalendar
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_BAR r_alfexcalendar_menubar
+    {
+    titles =
+        {
+        MENU_TITLE {menu_pane = r_alfexcalendar_menu;}
+        };
+    }
+
+// ---------------------------------------------------------
+//   
+//   r_alfexcalendar_menu
+//   Menu for "Options"
+//
+// ---------------------------------------------------------
+//
+RESOURCE MENU_PANE r_alfexcalendar_menu
+    {
+    items = 
+        {
+        MENU_ITEM { command = EAlfExCalendarCmdHelp;  txt = qtn_alf_cal_help; },
+        MENU_ITEM { command = EAknSoftkeyExit;   txt = qtn_alf_cal_exit; }
+        };
+    }
+
+// ---------------------------------------------------------
+//   
+//   r_alfexcalendar_calendar_events_array
+//   Calendar events
+//
+// ---------------------------------------------------------
+//
+RESOURCE ARRAY r_alfexcalendar_calendar_events_array
+    {
+    items=
+        {
+        LBUF 
+            {
+            txt = qtn_alf_cal_event1; 
+            },
+        LBUF 
+            {
+            txt = qtn_alf_cal_event2; 
+            },
+        LBUF 
+            {
+            txt = qtn_alf_cal_event3; 
+            },
+        LBUF 
+            {
+            txt = qtn_alf_cal_event4; 
+            },
+        LBUF 
+            {
+            txt = qtn_alf_cal_event5; 
+            },
+        LBUF 
+            {
+            txt = qtn_alf_cal_event6; 
+            },
+        LBUF 
+            {
+            txt = qtn_alf_cal_event7;
+            }
+        };
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/group/alfexcalendar_loc.rls	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,22 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+*
+*/
+
+
+//rls_string STRING_r_alfexcalendar_icon_path "z:\\resource\\apps\\alfexcalendaricon.mbm"
+rls_string STRING_short_caption "Alf Calendar"
+rls_string STRING_r_alfexcalendar_caption "Alf Calendar"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/group/alfexcalendar_loc.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <appinfo.rh>
+#include "alfexcalendar_loc.rls"
+
+RESOURCE LOCALISABLE_APP_INFO
+	{
+	short_caption = STRING_short_caption;
+	caption_and_icon =
+		{
+		CAPTION_AND_ICON_INFO 
+			{
+			caption=STRING_r_alfexcalendar_caption;
+			//number_of_icons=3;
+			//icon_file=STRING_r_alfexcalendar_icon_path;
+			}
+		};
+	}
+
+ 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/group/alfexcalendar_reg.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+*
+*/
+
+
+//alfexcalendar application's registration resource file 
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x0FCD4AC7
+
+RESOURCE APP_REGISTRATION_INFO 
+	{
+	app_file="alfexcalendar";
+	//
+	localisable_resource_file="\\resource\\apps\\alfexcalendar_loc";
+	//
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* 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: 
+*
+*/
+
+
+PRJ_MMPFILES
+
+alfexcalendar.mmp
+
+PRJ_EXPORTS
+
+../gfx/background.svg         /epoc32/winscw/c/data/images/background.svg
+../gfx/normaldaybutton.svg    /epoc32/winscw/c/data/images/normaldaybutton.svg
+../gfx/eventsdaybutton.svg    /epoc32/winscw/c/data/images/eventsdaybutton.svg
+../gfx/title.svg              /epoc32/winscw/c/data/images/title.svg
+../gfx/selectedday.svg        /epoc32/winscw/c/data/images/selectedday.svg
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/inc/alfexcalendar.hrh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Resource headers for project ?myapp
+*
+*/
+
+
+
+#ifndef __ALFEXCALENDAR_HRH__
+#define __ALFEXCALENDAR_HRH__
+
+/** alfexcalendar enumerated command codes */
+enum TAlfExCalendarIds
+    {
+    EAlfExCalendarCmdHelp = 1,
+    EAlfExCalendarCmdEnd
+    };
+
+
+#endif // __ALFEXCALENDAR_HRH__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/inc/alfexcalendar.loc	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Resource headers for project ?myapp
+*
+*/
+
+
+
+
+// OPTIONS MENU COMMANDS
+//
+// d: Options menu item
+// l:  
+// r:3.2
+//
+#define qtn_alf_cal_help "Help"
+
+// d: Options menu item
+// l:  
+// r:3.2
+//
+#define qtn_alf_cal_exit "Exit"
+
+
+// Hardcoded Calendar events
+//
+// d: Calendar events
+// l:  
+// r:3.2
+//
+#define qtn_alf_cal_event1 " 10:00 - 11:00 Meeting with the boss"
+#define qtn_alf_cal_event2 " 21:45 - 23:30 Football match on tv"
+#define qtn_alf_cal_event3 " 11:00 working luch"
+#define qtn_alf_cal_event4 " Whole day brainstorm"
+#define qtn_alf_cal_event5 " 06:45 flight to Bangalore"
+#define qtn_alf_cal_event6 " Remember this and that"
+#define qtn_alf_cal_event7 " 10:00 - 10:15 Scrum meeting"
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/inc/alfexcalendar.pan	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Resource headers for project ?myapp
+*
+*/
+
+
+
+#ifndef __ALFEXCALENDAR_PAN__
+#define __ALFEXCALENDAR_PAN__
+
+/** alfexcalendar application panic codes */
+enum TAlfExCalendarPanics 
+    {
+    EAlfExCalendarBasicUi = 1
+    // add further panics here
+    };
+
+inline void Panic( TAlfExCalendarPanics aReason )
+    {
+	_LIT( applicationName,"AlfExCalendar" );
+    User::Panic( applicationName, aReason );
+    }
+
+#endif // __ALFEXCALENDAR_PAN__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/inc/alfexcalendarapplication.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __ALFEXCALENDAR_APPLICATION_H__
+#define __ALFEXCALENDAR_APPLICATION_H__
+
+#include <aknapp.h>
+
+
+/*! 
+  @class CAlfExCalendarApplication
+  
+  @discussion An instance of CAlfExCalendarApplication is the application part of the AVKON
+  application framework for the alfexcalendar application
+  */
+class CAlfExCalendarApplication : public CAknApplication
+    {
+public:  // from CAknApplication
+
+/*! 
+  @function AppDllUid
+  
+  @discussion Returns the application DLL UID value
+  @result the UID of this Application/Dll
+  */
+    TUid AppDllUid() const;
+
+protected: // from CAknApplication
+/*! 
+  @function CreateDocumentL
+  
+  @discussion Create a CApaDocument object and return a pointer to it
+  @result a pointer to the created document
+  */
+    CApaDocument* CreateDocumentL();
+    };
+
+#endif // __ALFEXCALENDAR_APPLICATION_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/inc/alfexcalendarappui.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,115 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __ALFEXCALENDAR_APPUI_H__
+#define __ALFEXCALENDAR_APPUI_H__
+
+#include <aknappui.h>
+
+
+// Forward reference
+class CAlfEnv;
+class CAlfExCalendarEngine;
+
+/*! 
+  @class CAlfExCalendarAppUi
+  
+  @discussion An instance of class CAlfExCalendarAppUi is the UserInterface
+  part of the AVKON application framework for the alfexcalendar application
+  */
+class CAlfExCalendarAppUi : public CAknAppUi
+    {
+public:
+/*!
+  @function ConstructL
+  
+  @discussion Perform the second phase construction of a CAlfExCalendarAppUi object
+  this needs to be public due to the way the framework constructs the AppUi 
+  */
+    void ConstructL();
+
+/*!
+  @function CAlfExCalendarAppUi
+  
+  @discussion Perform the first phase of two phase construction.
+  This needs to be public due to the way the framework constructs the AppUi 
+  */
+    CAlfExCalendarAppUi();
+
+
+/*!
+  @function ~CAlfExCalendarAppUi
+  
+  @discussion Destroy the object and release all memory objects
+  */
+    ~CAlfExCalendarAppUi();
+
+
+public: // from CAknAppUi
+    /*!
+      @function HandleCommandL
+      
+      @discussion Handle user menu selections
+      @param aCommand the enumerated code for the option selected
+      */
+    void HandleCommandL(TInt aCommand);
+
+    /*!
+      @function DynInitMenuPaneL
+      
+      @discussion dynamically initializes the options menu
+      @param aResourceId resource id of menu
+      @param aMenuPane MenuPane which contains list of options
+      */
+    void DynInitMenuPaneL( 
+            TInt aResourceId,
+            CEikMenuPane* aMenuPane );
+
+    /*!
+      @function HandleResourceChangeL
+      
+      @discussion handles resolution and orientation changes properly
+      @param aType typs of resource change
+      */
+    virtual void HandleResourceChangeL( TInt aType );
+
+    /*
+     * Handles window server events to the application. Performs resource 
+     * loading/unloading when application goes changes to foreground/background.
+     * All events are forwarded to base class implementation.
+     * 
+     * @param aEvent Event ID. Handles KAknFullOrPartialForegroundLost 
+     * and KAknFullOrPartialForegroundGained events. 
+     * 
+     * @param aDestination Not used in this function
+     */
+    void HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination);
+    
+private:
+
+    // Hitchcock toolkit environment
+    CAlfEnv* iEnv;
+
+    // Dummy calendar engine
+    CAlfExCalendarEngine* iCalendarEngine;
+    
+    };
+
+
+#endif // __ALFEXCALENDAR_APPUI_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/inc/alfexcalendardeckcontrol.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,243 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef ALFEXCALENDARDECKCONTROL_H
+#define ALFEXCALENDARDECKCONTROL_H
+
+#include <alf/alfcontrol.h>
+
+const TInt KMonthsVisible = 2; // DONT CHANGE
+
+// Animation styles
+enum TMonthAnimationStyle
+{
+    EAnimationStyle1 = 1,
+    EAnimationStyle2,
+    EAnimationStyle3,
+    EAnimationStyleInvalid
+};
+
+// 
+enum TMonthTransitionState
+{
+   ETransitionStateMovingToNext = 1,
+   ETransitionStateMovingToPrev,
+   ETransitionStateStopped
+};
+
+// Forward declarations
+class CAlfGridLayout;
+class CAlfDeckLayout;
+class CAlfFlowLayout;
+class CAlfCurvePath;
+class CAlfCurvePathLayout;
+class CAlfImageVisual;
+class CAlfExCalendarMonth;
+class CAlfExCalendarEngine;
+
+// CAlfExCalendarDeckControl declaration
+
+class CAlfExCalendarDeckControl : public CAlfControl
+    {
+public: // methods
+
+    /**
+     * 2 phase construction
+     */
+    static CAlfExCalendarDeckControl* NewLC( CAlfEnv& aEnv, CAlfExCalendarEngine& aCalendarEngine );
+
+    /**
+     * destructor
+     */    
+    ~CAlfExCalendarDeckControl();
+    
+    /**
+     * Handles application events
+     *
+     * @param aEvent contains event data
+     * @return true if event is handled successfully
+     */    
+    TBool OfferEventL( const TAlfEvent& aEvent );
+
+    /**
+     * Sets month view value
+     *
+     * @param aVal value to be set to iMonthView
+     */
+    void SetMonthView( TBool aVal );
+
+    /**
+     * returns CAlfExCalendarEngine object
+     * @return CAlfExCalendarEngine object
+     */    
+    CAlfExCalendarEngine& CalendarEngine() const;
+    
+private: // Methods
+    
+    /**
+     * constructor
+     */
+	CAlfExCalendarDeckControl( CAlfExCalendarEngine& aCalendarEngine, CAlfEnv& aEnv  );
+    
+    /**
+     * 2nd phase constructor
+     */
+    void ConstructL( CAlfEnv& aEnv );
+
+    /**
+     * Creates texture from aImageFileName and set it to aImageVisual
+     *
+     * @param aImageVisual created texture is added to this visual
+     * @param aImageFileName file from which texture is created
+     */
+    void SetImageTexture(
+            CAlfImageVisual* aImageVisual,
+            const TDesC& aImageFileName );
+
+
+    /**
+     * updates the does transition to next month according to animation style
+     */
+    void UpdateNextMonthL();
+
+    /**
+     * does transition to next month according to animation style
+     */
+    void UpdatePrevMonthL();
+
+    /**
+     * does transition to next month according to animation style
+     */
+    void MoveToNextMonthL();
+
+    /**
+     * does transition to previous month according to animation style
+     */
+    void MoveToPrevMonthL();
+
+    /**
+     * Implements transition to next month with animation style 1
+     * Gets the month from right of display with rotation
+     */
+    void MoveToNextMonthAnimation1L();
+
+    /**
+     * Implements transition to next month with animation style 2
+     * Gets the month from bottom of the display
+     */
+    void MoveToNextMonthAnimation2L();
+    
+    /**
+     * Implements transition to previous month with animation style 1
+     * Moves curently visible month to right of display with rotation
+     * so that below month is visible (which is previous month)
+     */
+    void MoveToPrevMonthAnimation1L();
+
+    /**
+     * Implements transition to previous month with animation style 2
+     * Moves curently visible month to bottom of display, so that
+     * below month is visible (which is previous month)
+     */
+    void MoveToPrevMonthAnimation2L();
+
+    
+    /**
+     * performs scaling transformation according to given scaling factors
+     *
+     * @param aVisual
+     * @param aXSf
+     * @param aYSf
+     * @param aTime
+     */
+    void ScaleVisualL(
+            CAlfVisual& aVisual,
+            TReal aXSf,
+            TReal aYSf,
+            TInt aTime );
+
+    /**
+     * performs rotation transformation according to given timed values.
+     *
+     * @param aVisual
+     * @param aInitAngle
+     * @param aTargetAngle
+     * @param aTime
+     */
+    void RotateVisualL(
+            CAlfVisual& aVisual,
+            TReal aInitAngle,
+            TReal aTargetAngle,
+            TInt aTime );
+
+    /**
+     * Sets opacity of given visual according to timed values.
+     *
+     * @param aVisual
+     * @param aInitValue
+     * @param aTargetValue
+     * @param aTime
+     */
+    void SetOpacity(
+            CAlfVisual& aVisual,
+            TReal aInitValue,
+            TReal aTargetValue,
+            TInt aTime );
+    
+private: // Data
+	
+    // toolkit environment
+    CAlfEnv& iEnv;
+    
+    // deck layout
+	CAlfDeckLayout* iDeck;
+    
+    // index into iMonthControls
+    TInt iCurrentMonthControlIndex;
+    
+    // currently focused month
+	TInt iFocusedMonth;
+    
+    // display rectangle
+	TRect iDisplayRect;
+	
+    // current time/month
+	TTime iSelectedTime;
+
+    // month control array
+	CAlfExCalendarMonth* iMonthControls[KMonthsVisible];
+
+    // month view status
+    TBool iMonthView;
+
+    // dummy calendar engine
+    CAlfExCalendarEngine& iCalendarEngine;
+    
+    // animation style
+    TMonthAnimationStyle iMonthAnimationStyle;
+    
+    // month transition state
+    TMonthTransitionState iMonthTransitionState;
+
+    // CAlfImageVisual* iBackground; // Currently not used
+
+    };
+
+#endif // ALFEXCALENDARDECKCONTROL_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/inc/alfexcalendardocument.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,97 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __ALFEXCALENDAR_DOCUMENT_H__
+#define __ALFEXCALENDAR_DOCUMENT_H__
+
+
+#include <akndoc.h>
+
+// Forward references
+class CAlfExCalendarAppUi;
+class CEikApplication;
+
+
+/*! 
+  @class CAlfExCalendarDocument
+  
+  @discussion An instance of class CAlfExCalendarDocument is the Document part of the AVKON
+  application framework for the alfexcalendar application
+  */
+class CAlfExCalendarDocument : public CAknDocument
+    {
+public:
+
+/*!
+  @function NewL
+  
+  @discussion Construct a CAlfExCalendarDocument for the AVKON application aApp 
+  using two phase construction, and return a pointer to the created object
+  @param aApp application creating this document
+  @result a pointer to the created instance of CAlfExCalendarDocument
+  */
+    static CAlfExCalendarDocument* NewL(CEikApplication& aApp);
+
+/*!
+  @function NewLC
+  
+  @discussion Construct a CAlfExCalendarDocument for the AVKON application aApp 
+  using two phase construction, and return a pointer to the created object
+  @param aApp application creating this document
+  @result a pointer to the created instance of CAlfExCalendarDocument
+  */
+    static CAlfExCalendarDocument* NewLC(CEikApplication& aApp);
+
+/*!
+  @function ~CAlfExCalendarDocument
+  
+  @discussion Destroy the object and release all memory objects
+  */
+    ~CAlfExCalendarDocument();
+
+public: // from CAknDocument
+/*!
+  @function CreateAppUiL 
+  
+  @discussion Create a CAlfExCalendarAppUi object and return a pointer to it
+  @result a pointer to the created instance of the AppUi created
+  */
+    CEikAppUi* CreateAppUiL();
+
+private:
+
+/*!
+  @function ConstructL
+  
+  @discussion Perform the second phase construction of a CAlfExCalendarDocument object
+  */
+    void ConstructL();
+
+/*!
+  @function CAlfExCalendarDocument
+  
+  @discussion Perform the first phase of two phase construction 
+  @param aApp application creating this document
+  */
+    CAlfExCalendarDocument(CEikApplication& aApp);
+
+    };
+
+
+#endif // __ALFEXCALENDAR_DOCUMENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/inc/alfexcalendarengine.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __ALFEXCALENDARENGINE_H__
+#define __ALFEXCALENDARENGINE_H__
+
+#include <e32base.h>
+
+/* Forward declarations. */
+
+
+//
+const TInt KAlfExCalendarEngineTextBufferLength = 50;
+
+/**
+* CAlfExCalendarEngine is a class that gives data to be displayed in 
+* alfexcalendar example application.
+*/
+class CAlfExCalendarEngine : public CBase
+    {
+public:
+    /* Constructors and destructor. */
+
+    /**
+     * Constructor
+     */	
+    static CAlfExCalendarEngine* NewL();
+    
+    /**
+     * Constructor
+     */
+    static CAlfExCalendarEngine* NewLC();
+    
+    /**
+     * Destructor.
+     */
+	virtual ~CAlfExCalendarEngine();
+	
+public:
+	
+	
+    /* Methods. */
+
+    /** @beginAPI */
+
+    /**
+     * Loads calendar events for current month.
+     *
+     * @param aDate: day information
+     */
+    void LoadCalendarEventsL( const TTime& aDate );
+
+    /**
+     * Returns true if calendar event is available for requested day. 
+     *
+     * @param aDate: day information
+     * @return true or false
+     */
+    TBool EventsAvailable( const TTime& aDate );
+    
+    /**
+     * Returns number of calendar events in requested day. 
+     *
+     * @param aDate: day information
+     * @return number of events in requested day.
+     *
+     * @todo: or should we just return array of texts ?
+     */
+    TInt NumberOfEvents( const TTime& aDate );
+    
+    /**
+     * Returns number of calendar events in requested day. 
+     *
+     * @param aDate: day information
+     * @param aIndex: index of the event between 0...x-1, where x=NumberOfEvents().
+     * @param aTextBuffer: text buffer where event information text is copied. 
+     *        Must be at least XX characters long.
+     *
+     * @todo: should this return HBufC* instead of aTextBuffer parameter?
+     */
+    void GetEventInformation( const TTime& aDate, TInt aIndex, TDes& aTextBuffer );
+
+    /** @endAPI */
+
+private:
+    /* Constructors. */
+
+    /**
+     * C++ constructor
+     */
+	CAlfExCalendarEngine();
+	
+    /**
+     * Second-phase constructor. 
+     */
+	void ConstructL();
+	
+private:
+    /**
+    * Class to embed event text and event time. 
+    * In this implementation only date is significant
+    */
+    class TAlfExCalendarEngineListItem
+        {
+        public:
+            /**
+            *  Date of the event
+            */
+            TTime   iItemDay;
+            
+            /**
+            * Event text visible for the user
+            */
+            TBuf<KAlfExCalendarEngineTextBufferLength> iItemText;
+        };
+
+    /**
+    * Array definition for the calendar events
+    */
+    typedef RArray<TAlfExCalendarEngineListItem> RAlfExCalendarEngineListItemArray;
+    
+private:
+    /** Array of events */
+    RAlfExCalendarEngineListItemArray iCalendarEventArray;
+};
+
+#endif // __ALFEXCALENDARENGINE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/inc/alfexcalendarengineeventtimer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __ALFEXCALENDARENGINEEVENTTIMER_H__
+#define __ALFEXCALENDARENGINEEVENTTIMER_H__
+
+#include <e32base.h>
+#include <e32std.h>
+
+
+
+/**
+* MAlfExCalendarEngineEventTimer is a pure virtual class that 
+* defines callback function which is called when timer event
+* occurs.
+*/
+class MAlfExCalendarEngineEventTimerObserver
+    {
+public:
+    /**
+     * Called when timer event triggered in 
+     * CAlfExCalendarEngineEventTimer
+     */	
+    virtual void HandleTimerEventL() = 0;
+    };
+
+
+
+
+/**
+* CAlfExCalendarEngine is a class that gives data to be displayed in 
+* alfexcalendar example application.
+*/
+class CAlfExCalendarEngineEventTimer : public CActive
+	{
+public:
+    /* Constructors and destructor. */
+
+    /**
+     * Constructor
+     */	
+    static CAlfExCalendarEngineEventTimer* NewL(MAlfExCalendarEngineEventTimerObserver& aObserver);
+    
+    /**
+     * Constructor
+     */
+    static CAlfExCalendarEngineEventTimer* NewLC(MAlfExCalendarEngineEventTimerObserver& aObserver);
+    
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfExCalendarEngineEventTimer();
+
+public:
+	
+	
+    /* Methods. */
+
+    /** @beginAPI */
+    /**
+     * Starts timer. 
+     * Cancels previous timer if still active. 
+     *
+     * @param aDelay: delay.
+     */
+    void StartTimer( TTimeIntervalMicroSeconds32 aDelay);
+
+    /** @endAPI */
+
+private:
+    /* Constructors. */
+
+    /**
+     * C++ constructor
+     */
+    CAlfExCalendarEngineEventTimer(MAlfExCalendarEngineEventTimerObserver& aObserver);
+	
+    /**
+     * Second-phase constructor. 
+     */
+    void ConstructL();
+
+
+protected:
+    /**
+     * From CActive
+     */
+    virtual void DoCancel();
+
+    /**
+     * From CActive
+     */
+    virtual void RunL();
+	
+    /**
+     * From CActive.
+     * This is called if RunL function leaves. 
+     * Here we can just ignore all the errors and return KErrNone
+     */
+    virtual TInt RunError(TInt aError);
+private:
+    /** 
+     * timer object.
+     */
+    RTimer		iTimer;
+    
+    /**
+     * Observer object
+     */
+    MAlfExCalendarEngineEventTimerObserver& iObserver;
+	};
+
+#endif // __ALFEXCALENDARENGINEEVENTTIMER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/inc/alfexcalendarmonth.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,226 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef CALFEXMONTH_H_
+#define CALFEXMONTH_H_
+
+#include <alf/alfcontrol.h>
+
+#include "alfexcalendarengineeventtimer.h"
+
+// forward declarations
+class CAlfGridLayout;
+class CAlfTextVisual;
+class CAlfExCalendarDeckControl;
+class CAlfBorderBrush;
+class CAlfShadowBorderBrush;
+class CAlfGradientBrush;
+class CAlfImageBrush;
+class MAlfBitmapProvider;
+
+// Constants declarations
+const TRgb KWeekDayColor = TRgb( 0xff8844 ); // BGR value
+const TRgb KWeekendDayColor = TRgb( 0x7f7fff );
+const TRgb KFocusedDayColor = TRgb( 0x0000ff );
+const TRgb KWeekNumberColor = TRgb( 0x88ffff ); //
+
+
+// CAlfExCalendarMonth class declaration
+class CAlfExCalendarMonth : 
+    public CAlfControl,
+    public MAlfExCalendarEngineEventTimerObserver
+{
+
+public: // methods
+
+    /**
+     * 2 phase constructor. A static factory method.
+     * @param aParentLayout
+     * @param aDateTime
+     * @param aEnv
+     * @param aCalendarControl
+     * @return 
+     */
+    static CAlfExCalendarMonth* NewLC(
+            CAlfLayout* aParentLayout,
+            TDateTime aDateTime,
+            CAlfEnv& aEnv,
+            CAlfExCalendarDeckControl& aCalendarControl );
+    
+	virtual ~CAlfExCalendarMonth();
+
+    TBool OfferEventL( const TAlfEvent& aEvent );
+    
+	void UpdateMonthL( TDateTime aDateTime );
+    
+    void MonthFocusedL();
+
+    
+private: // methods
+
+    CAlfExCalendarMonth(
+            CAlfExCalendarDeckControl& aCalendarControl,
+            CAlfEnv& aEnv,
+            TDateTime aDateTime );
+
+	void ConstructL( CAlfLayout* aParentLayout );
+	
+	void SetWeekDayNameL(
+            const TDesC& aDayName,
+            CAlfGridLayout* aGrid,
+            TInt aDayIndex,
+            TRgb aColor = KWeekDayColor );
+	
+	void AddDateVisualsL( CAlfGridLayout* aGrid );
+	
+	TInt SetDatesL( CAlfGridLayout* aGrid, TTime aTime );
+
+    void SetDateNumberL(
+            CAlfGridLayout* aGrid,
+            TInt aVisualIndex,
+            TInt aDayNumber,
+            TInt aDateTextStyle,
+            TRgb aColor = KWeekDayColor );
+
+    void SetWeekNumberL(
+            CAlfGridLayout* aGrid,
+            TInt aVisualIndex,
+            TInt aDayNumber,
+            TInt aWeekTextStyle );
+
+    void ClearDayVisualL(
+            CAlfGridLayout* aGrid,
+            TInt aVisualIndex );
+    
+    void UpdateDaysWithCalEventsL();
+	
+    void RemoveAllDayBrushesL();
+    
+	void MoveDayFocusL( TInt aChange );
+
+    void SetMonthBackgroundL( CAlfVisual* aVisual,  TRgb aColor = KRgbGray );
+
+    void SetMonthTitleTextL();
+    
+    void SetBgImgL( CAlfVisual* aVisual );
+
+    void SetSVGImageTextureL(
+            CAlfVisual* aVisual,
+            const TDesC& aSvgFileName );
+
+    void GetSVGImageTextureL(
+            const TDesC& aSvgFileName,
+            CAlfTexture& aTexture );
+    
+    void SetDateGridWeightsL(
+        CAlfGridLayout* aDatesGrid,
+        TInt aRowIndex = -1, 
+        TInt aWeight = 1 );
+    
+    void UnFocusDayL( CAlfTextVisual& aTextVisual );
+    
+    void FocusDayL( CAlfTextVisual& aTextVisual );
+    
+    void OpenDayViewL();
+    
+    void CloseDayViewL();
+
+    void ShowCalendarEventsL();
+    
+    void ScaleVisualL(
+            CAlfVisual& aVisual,
+            TReal aXSf,
+            TReal aYSf,
+            TInt aTime );
+    
+    void RotateVisualL(
+            CAlfVisual& aVisual,
+            TReal aInitAngle,
+            TReal aTargetAngle,
+            TInt aTime );
+
+    void SetTextStylesL(
+        CAlfTextVisual& aTextVisual,
+        const TDesC &aText,
+        TRgb aColor = KRgbYellow,
+        CAlfTextVisual::TLineWrap aLineWrap = CAlfTextVisual::ELineWrapBreak,
+        TAlfAlignHorizontal aAlignH = EAlfAlignHCenter, 
+        TAlfAlignVertical aAlignV = EAlfAlignVCenter,
+        TPoint aPoint = TPoint(0,0) );
+
+    TInt DateTextStyleL();
+
+    /**
+     * From MAlfExCalendarEngineEventTimerObserver
+     */
+    void HandleTimerEventL();
+
+    
+private: // Data
+
+    // TODO - comment all members, remove/optimize unnecessary , refactor
+	
+    CAlfImageLoaderUtil* iImageLoaderUtil;
+    
+	CAlfEnv& iEnv;
+
+    CAlfExCalendarDeckControl& iCalendarControl;
+
+    CAlfExCalendarEngineEventTimer* iEventTimer;
+
+
+    TDateTime iDateTime;   
+    
+    TTime iTime; // TODO - cleanup/remove these variables. just iDateTime can be sufficient
+    
+    TInt iMonthNumber;
+
+    TInt iDaysInMonth;
+    
+    TInt iDayNoInWeek;
+
+	
+    CAlfGridLayout* iBottomGrid;
+    
+	CAlfGridLayout*	iDatesGrid;
+
+    CAlfTextVisual* iMonthText;
+
+    TInt iFocusedDay;
+
+    TInt iDayVisualIndex;
+    
+    TBool iDayView;
+    
+    TBool iIsDayFocused;
+
+    
+    CAlfImageBrush* iNormalDayBrush;
+
+    CAlfImageBrush* iEventsDayBrush;
+    
+    CAlfImageBrush* iFocusedDayBrush;
+	
+    TAlfTimedPoint iOriginalDayPos;
+
+    TBuf<128> iCalendarEventTextBuffer;
+    
+};
+
+#endif /*CALFEXMONTH_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/sis/alfexcalendar.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,42 @@
+;
+; 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: 
+;
+&EN
+
+; standard SIS file header
+#{"alfexcalendar"},(0x0FCD4AC7),1,0,0
+
+;Supports Series 60 v 3.0
+(0x101F7961), 0, 0, 0, {"Series60ProductID"}
+
+;Localized Vendor Name
+%{"My Test EN"}
+
+;Unique Vendor name
+:"Vendor"
+
+; Files to copy
+
+"..\gfx\background.svg"-"c:\data\Images\background.svg"
+"..\gfx\normaldaybutton.svg"-"c:\data\Images\normaldaybutton.svg"
+"..\gfx\eventsdaybutton.svg"-"c:\data\Images\eventsdaybutton.svg"
+"..\gfx\title.svg"-"c:\data\Images\title.svg"
+"..\gfx\selectedday.svg"-"c:\data\Images\selectedday.svg"
+
+
+"\epoc32\release\armv5\urel\alfexcalendar.exe"-"!:\sys\bin\alfexcalendar.exe"
+"\epoc32\data\z\private\10003a3f\apps\alfexcalendar_reg.rsc"-"!:\private\10003a3f\import\apps\alfexcalendar_reg.rsc"
+"\epoc32\data\z\resource\apps\alfexcalendar_loc.rsc"-"!:\resource\apps\alfexcalendar_loc.rsc"
+"\epoc32\data\z\resource\apps\alfexcalendar.rsc"-"!:\resource\apps\alfexcalendar.rsc"
Binary file exampleapps/alfexcalendar/sis/alfexcalendar.sis has changed
Binary file exampleapps/alfexcalendar/sis/alfexcalendar.sisx has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/sis/createsisx.bat	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,24 @@
+rem
+rem Copyright (c) 2009 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 Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description: 
+rem
+
+cd ..\group
+call bldmake bldfiles
+call abld build armv5
+
+cd ..\sis
+
+makesis alfexcalendar.pkg
+signsis alfexcalendar.sis alfexcalendar.sisx rd.cer rd-key.pem
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/sis/rd-key.pem	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +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-----
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/sis/rd.cer	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +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-----
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/src/alfexcalendar.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "alfexcalendarapplication.h"
+#include <eikstart.h>
+
+#ifdef __UI_FRAMEWORKS_V2__
+
+// Create an application, and return a pointer to it
+CApaApplication* NewApplication()
+	{
+	return new CAlfExCalendarApplication;
+	}
+
+
+TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	
+	}
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// The following is required for wins on EKA1 (using the exedll target)
+//
+#if defined(__WINS__) && !defined(EKA2)
+EXPORT_C TInt WinsMain(TDesC* aCmdLine)
+	{
+	return EikStart::RunApplication(NewApplication, aCmdLine);
+	}
+
+TInt E32Dll(TDllReason)
+	{
+	return KErrNone;
+	}
+#endif
+
+#else // __UI_FRAMEWORKS_V2__
+
+// Create an application, and return a pointer to it
+EXPORT_C CApaApplication* NewApplication()
+  {
+  return new CAlfExCalendarApplication;
+  }
+
+// DLL entry point, return that everything is ok
+GLDEF_C TInt E32Dll(TDllReason)
+  {
+  return KErrNone;
+  }
+
+#endif // __UI_FRAMEWORKS_V2__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/src/alfexcalendarapplication.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,38 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "alfexcalendardocument.h"
+#include "alfexcalendarapplication.h"
+
+// UID for the application, this should correspond to the uid defined in the mmp file
+static const TUid KUidAlfExCalendarApp = {0x0FCD4AC7};
+
+CApaDocument* CAlfExCalendarApplication::CreateDocumentL()
+    {  
+    // Create an AlfExCalendar document, and return a pointer to it
+    CApaDocument* document = CAlfExCalendarDocument::NewL(*this);
+    return document;
+    }
+
+TUid CAlfExCalendarApplication::AppDllUid() const
+    {
+    // Return the UID for the AlfExCalendar application
+    return KUidAlfExCalendarApp;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/src/alfexcalendarappui.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,204 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include <avkon.hrh>
+#include <aknnotewrappers.h> 
+#include <aknutils.h>
+#include <eikmenup.h>
+
+#include <alf/alfenv.h> 
+#include <alf/alfdisplay.h> 
+#include <alf/alfcontrolgroup.h> 
+#include <alf/alfroster.h> 
+#include <alf/alftransformation.h>
+
+#include "alfexcalendar.pan"
+#include "alfexcalendarappui.h"
+#include "alfexcalendar.hrh"
+#include "alfexcalendardeckcontrol.h"
+#include "alfexcalendarengine.h"
+#include "alfexcalendar.rsg"
+
+// Control group ID
+const TInt KAlfExCalendarControlGroupDeckId = 1;
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarAppUi::ConstructL
+// --------------------------------------------------------------------------
+// 
+void CAlfExCalendarAppUi::ConstructL()
+    {
+    BaseConstructL( EAknEnableSkin );
+
+    // Create Toolkit Environment
+    iEnv = CAlfEnv::NewL();
+    
+    TRect rect;
+    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect );
+
+    // Create Display
+    CAlfDisplay& display = 
+        iEnv->NewDisplayL( rect, CAlfEnv::ENewDisplayAsCoeControl );
+    display.SetClearBackgroundL( CAlfDisplay::EClearWithSkinBackground );
+
+    // instantiate CalendarEngine
+    // This is dummy engine which generates and give hardcoded calendar events
+    iCalendarEngine = CAlfExCalendarEngine::NewL();
+    
+    // Create Control Group for Deck Layout
+    CAlfControlGroup& deckGroup =
+        iEnv->NewControlGroupL( KAlfExCalendarControlGroupDeckId );
+
+    // Create Control and Append to Control Group2
+    CAlfExCalendarDeckControl* deckControl =
+        CAlfExCalendarDeckControl::NewLC( *iEnv, *iCalendarEngine );
+    deckGroup.AppendL( deckControl );
+    CleanupStack::Pop( deckControl );
+
+    // Activate/Show the Control group on the Display
+    display.Roster().ShowL( deckGroup );
+    
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarAppUi::CAlfExCalendarAppUi
+// --------------------------------------------------------------------------
+// 
+CAlfExCalendarAppUi::CAlfExCalendarAppUi()
+    {
+	// no implementation required
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarAppUi::~CAlfExCalendarAppUi
+// --------------------------------------------------------------------------
+// 
+CAlfExCalendarAppUi::~CAlfExCalendarAppUi()
+    {
+    // delete Toolkit Environment
+    delete iEnv;
+    
+    delete iCalendarEngine;
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarAppUi::DynInitMenuPaneL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarAppUi::DynInitMenuPaneL( 
+        TInt aResourceId,
+        CEikMenuPane* aMenuPane )
+    {
+    // Not used currently. May be used if necessary in future
+    switch ( aResourceId )
+        {
+        case R_ALFEXCALENDAR_MENU:
+            {
+
+            }
+            break;
+        }
+    
+    CAknAppUi::DynInitMenuPaneL( aResourceId, aMenuPane );
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarAppUi::HandleCommandL
+// --------------------------------------------------------------------------
+// 
+void CAlfExCalendarAppUi::HandleCommandL( TInt aCommand )
+    {
+    switch( aCommand )
+        {
+        case EEikCmdExit:
+        case EAknSoftkeyExit:
+            Exit();
+            break;
+
+        case EAlfExCalendarCmdHelp:
+            {
+            _LIT(message,"Alf Calendar");
+            CAknInformationNote* informationNote =
+                new (ELeave) CAknInformationNote;
+            informationNote->ExecuteLD(message);
+            }
+            break;
+            
+        default:
+            Panic( EAlfExCalendarBasicUi );
+            break;
+        }
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarAppUi::HandleResourceChangeL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarAppUi::HandleResourceChangeL( TInt aType )
+    {
+    // In order to handle resolution and orientation changes properly,
+    // the HandleResourceChangeL method needs to be implemented
+
+    CAknAppUi::HandleResourceChangeL( aType );
+
+    if ( iEnv && aType == KEikDynamicLayoutVariantSwitch )
+        {
+        iEnv->NotifyLayoutChangedL();
+        }
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarAppUi::HandleWsEventL
+// Calls HUI environment to release the resources when KAknFullOrPartialForegroundLost
+// is received and to restore the resources when KAknFullOrPartialForegroundGained.
+// Resources that are released/restored are memory loaded bitmaps.
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarAppUi::HandleWsEventL(
+        const TWsEvent& aEvent,
+        CCoeControl* aDestination )
+    {
+    switch( aEvent.Type() )
+        {
+        // When the application is moved out of the foreground,
+        // release all resources in the environment with CAlfEnv::Release()
+        case KAknFullOrPartialForegroundLost:
+            {
+            iEnv->Release();
+            break;
+            }
+
+        // When the application is brought to foreground,
+        // restore all resources in the environment with CAlfEnv::RestoreL()        
+        case KAknFullOrPartialForegroundGained:
+            {
+            iEnv->RestoreL();
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+
+    CAknAppUi::HandleWsEventL( aEvent, aDestination );
+    }
+
+// END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/src/alfexcalendardeckcontrol.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,515 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include <alf/alftextvisual.h>
+#include <alf/alfgridlayout.h>
+#include <alf/alfdecklayout.h>
+#include <alf/alfflowlayout.h>
+#include <alf/alfcurvepathlayout.h>
+#include <alf/alfcurvepath.h>
+#include <alf/alfevent.h>
+#include <alf/alfenv.h>
+#include <alf/alfdisplay.h>
+#include <alf/alflinevisual.h>
+#include <alf/alfimagevisual.h>
+#include <alf/alftransformation.h>
+#include <alf/alfcommand.h>
+
+#include "alfexcalendardeckcontrol.h"
+#include "alfexcalendarmonth.h"
+#include "alfexcalendarengine.h"
+
+_LIT( KImagePath, "c:\\data\\Images\\Pictures\\" );
+_LIT( KCalendar, "calendar.jpg" );
+
+const TInt KMonthViewTransitTime = 1500;
+const TInt KMonthViewRotationTime = 1500;
+const TInt KMonthViewScalingTime = 2500;
+const TInt KMonthViewOpacityTime = 2500;
+
+const TReal KUnitSize = 1.0f;
+const TReal KMonthXSf = 0.2f;
+const TReal KMonthYSf = 0.2f;
+
+// Custome events
+enum TCustomEvent
+{
+    EMoveMonthToBack = 1,
+    EMonthMovedToFront,
+
+    ECustomEventInvalid
+};
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::NewLC
+// --------------------------------------------------------------------------
+//
+CAlfExCalendarDeckControl* CAlfExCalendarDeckControl::NewLC(
+    CAlfEnv& aEnv,
+    CAlfExCalendarEngine& aCalendarEngine )
+    {
+    CAlfExCalendarDeckControl* self =
+        new (ELeave) CAlfExCalendarDeckControl( aCalendarEngine, aEnv );
+    CleanupStack::PushL( self );
+    self->ConstructL( aEnv );
+    return self;
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::CAlfExCalendarDeckControl
+// --------------------------------------------------------------------------
+//
+CAlfExCalendarDeckControl::CAlfExCalendarDeckControl(
+        CAlfExCalendarEngine& aCalendarEngine,
+        CAlfEnv& aEnv )
+    : iFocusedMonth( (KMonthsVisible-1) ), iMonthView( EFalse ),
+      iCalendarEngine( aCalendarEngine ), iEnv( aEnv ),
+      iMonthAnimationStyle( EAnimationStyle1 ),
+      iMonthTransitionState( ETransitionStateStopped )
+    {
+    }
+
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::ConstructL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarDeckControl::ConstructL( CAlfEnv& aEnv )
+    {
+    CAlfControl::ConstructL( aEnv );
+    
+    /* // not using currently
+    // Background image.
+    iBackground = CAlfImageVisual::AddNewL(*this);
+    Env().TextureManager().SetImagePathL( KImagePath );
+    SetImageTexture( iBackground, KCalendar );
+    */
+
+    // Get display rectangle
+    iDisplayRect = aEnv.PrimaryDisplay().VisibleArea();
+
+    // create Deck Layout and add to CAlfExCalendarDeckControl
+    // CAlfExCalendarDeckControl takes ownership of created layout
+    iDeck = CAlfDeckLayout::AddNewL( *this );
+
+    
+    // Calendar logic here
+    // we create only KMonthsVisible number (atleast 2 :))of CAlfExCalendarMonth instances
+    // and only use those many, to show un-limited calendar months.
+    // take the responsibility of updating CAlfExCalendarMonth instances 
+    // when moving between the months.
+    iSelectedTime.HomeTime();
+    iCurrentMonthControlIndex = (KMonthsVisible - 1);
+    
+    TTime tmpTime = iSelectedTime - (TTimeIntervalMonths)( KMonthsVisible - 1 );
+    for( TInt i = 0; i < KMonthsVisible; i++ )
+        {
+        iMonthControls[i] = CAlfExCalendarMonth::NewLC( iDeck, tmpTime.DateTime(), aEnv, *this );
+        tmpTime += (TTimeIntervalMonths)1;
+        CleanupStack::Pop();
+        };
+
+    // move Focus to current month
+    iMonthControls[iCurrentMonthControlIndex]->MonthFocusedL();
+    iMonthView = ETrue;
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::~CAlfExCalendarDeckControl
+// --------------------------------------------------------------------------
+//
+CAlfExCalendarDeckControl::~CAlfExCalendarDeckControl()
+    {
+    // delete all iMonthControls
+    for (TInt i = 0; i < KMonthsVisible ; i++ )
+        {
+        delete iMonthControls[i];
+        }
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::SetImageTexture
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarDeckControl::SetImageTexture(
+    CAlfImageVisual* aImageVisual,
+    const TDesC& aImageFileName )
+    {
+    
+    TRAP_IGNORE(
+            // creates texture from given aImageFileName
+            CAlfTexture& texture =
+                Env().TextureManager().LoadTextureL(
+                        aImageFileName,
+                        EAlfTextureFlagDefault,
+                        KAlfAutoGeneratedTextureId );
+
+            aImageVisual->SetScaleMode( CAlfImageVisual::EScaleCover );
+            
+            // sets created texture to given aImageVisual
+            aImageVisual->SetImage( TAlfImage( texture ) );
+                        );
+    
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::SetMonthView
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarDeckControl::SetMonthView( TBool aVal )
+    {
+    iMonthView = aVal;
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::CalendarEngine
+// --------------------------------------------------------------------------
+//
+CAlfExCalendarEngine& CAlfExCalendarDeckControl::CalendarEngine() const
+    {
+    return iCalendarEngine;
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::OfferEventL
+// --------------------------------------------------------------------------
+//
+TBool CAlfExCalendarDeckControl::OfferEventL(const TAlfEvent& aEvent )
+	{
+    // DO NOT change the order of below aEvent checking
+    
+    // Pointer events are irrelevant for 3.2,
+    // but caught here for 5.0 compatibility.
+    if( aEvent.IsPointerEvent() )
+        {
+        return ETrue;
+        }
+
+    if( aEvent.IsCustomEvent() /* && iMonthTransitionState != ETransitionStateStopped */ )
+        {
+        switch( aEvent.CustomParameter() )
+            {
+            // month transition (animation)is completed. Handle custome events
+            case EMoveMonthToBack:
+                iDeck->MoveVisualToBack( iDeck->Visual( iFocusedMonth ) );
+                iMonthTransitionState = ETransitionStateStopped;
+                iMonthControls[iCurrentMonthControlIndex]->MonthFocusedL();
+                iMonthView = ETrue;
+                return ETrue;
+
+            case EMonthMovedToFront:
+                iMonthTransitionState = ETransitionStateStopped;
+                iMonthControls[iCurrentMonthControlIndex]->MonthFocusedL();
+                iMonthView = ETrue;
+                return ETrue;
+            
+            default:
+                break;                
+            }
+        }
+
+    // Don't handle events while month transition
+    if( iMonthTransitionState != ETransitionStateStopped )
+        {
+        return ETrue;
+        }
+    
+    // If month view
+    if( iMonthView )
+        {
+        TBool ret = iMonthControls[iCurrentMonthControlIndex]->OfferEventL( aEvent );
+        
+        // iMonthControls can change the iMonthView value. 
+        // month might have been closed
+        if( iMonthView )
+            {
+            return ret;
+            }
+        else
+            {
+            // dont return, continue event processing here
+            }
+        }
+
+    if ( aEvent.Code() == EEventKey )
+        {
+        iMonthAnimationStyle = EAnimationStyle1;
+        TInt code = aEvent.KeyEvent().iCode;
+        switch( code )
+            {
+            case EKeyUpArrow:
+                iMonthAnimationStyle = EAnimationStyle2;
+                MoveToPrevMonthL();
+                return ETrue;
+
+            case EKeyDownArrow:
+                iMonthAnimationStyle = EAnimationStyle2;
+                MoveToNextMonthL();
+                return ETrue;
+            
+            case EKeyLeftArrow:
+                MoveToPrevMonthL();
+                return ETrue;
+
+            case EKeyRightArrow:
+                MoveToNextMonthL();
+                return ETrue;
+
+            default:
+                break;
+            }
+        }
+    return EFalse;
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::MoveToNextMonthL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarDeckControl::MoveToNextMonthL()
+    {
+    // calls appropriate function according to animation style
+    switch( iMonthAnimationStyle )
+        {
+        case EAnimationStyle1:
+            MoveToNextMonthAnimation1L();
+            break;
+        case EAnimationStyle2:
+            MoveToNextMonthAnimation2L();
+            break;
+        default:
+            break;
+        }
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::MoveToPrevMonthL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarDeckControl::MoveToPrevMonthL()
+    {
+    // calls appropriate function according to animation style
+    switch( iMonthAnimationStyle )
+        {
+        case EAnimationStyle1:
+            MoveToPrevMonthAnimation1L();
+            break;
+        case EAnimationStyle2:
+            MoveToPrevMonthAnimation2L();
+            break;
+        default:
+            break;
+        }
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::UpdateNextMonthL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarDeckControl::UpdateNextMonthL()
+    {
+    // change time to next month
+    iSelectedTime += (TTimeIntervalMonths)1;
+    
+    // set iCurrentMonthControlIndex value properly.
+    // some logic here based on how many no of month layout we have
+    iCurrentMonthControlIndex++;
+    if( iCurrentMonthControlIndex == KMonthsVisible )
+        {
+        iCurrentMonthControlIndex = 0;
+        }
+    
+    // now update the month layout according to iSelectedTime
+    iMonthControls[iCurrentMonthControlIndex]->UpdateMonthL( iSelectedTime.DateTime() );    
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::UpdatePrevMonthL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarDeckControl::UpdatePrevMonthL()
+    {
+    // change time to previous month
+    iSelectedTime -= (TTimeIntervalMonths)1;
+    
+    // set iCurrentMonthControlIndex value properly.
+    iCurrentMonthControlIndex--;
+    if( iCurrentMonthControlIndex == -1 )
+        {
+        iCurrentMonthControlIndex = (KMonthsVisible-1);
+        }
+
+    // update the month layout according to iSelectedTime
+    iMonthControls[iCurrentMonthControlIndex]->UpdateMonthL( iSelectedTime.DateTime() );    
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::MoveToNextMonthAnimation1L
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarDeckControl::MoveToNextMonthAnimation1L()
+    {
+    // updates the month layout which is at bottom of deck layout
+    UpdateNextMonthL();
+
+    // get the bottom most month to front of DECK layout
+    iDeck->MoveVisualToFront( iDeck->Visual( 0 ) );
+    
+    // move this month to extreme right of display
+    iDeck->Visual( iFocusedMonth ).SetPos( TPoint( iDisplayRect.Width(), 0 ), 0 );
+    
+    // now move this month to 0,0 position in KMonthViewTransitTime time
+    iDeck->Visual( iFocusedMonth ).SetPos( TPoint( 0, 0 ), KMonthViewTransitTime );
+    
+    // with rotation transformation
+    RotateVisualL( iDeck->Visual( iFocusedMonth ), 360, 0, KMonthViewRotationTime );
+
+    // send custome event, handle EMonthMovedToFront in OfferEventL() after KMonthViewTransitTime
+    Env().Send( TAlfCustomEventCommand( EMonthMovedToFront, this ), KMonthViewTransitTime );
+    
+    // change iMonthTransitionState state
+    iMonthTransitionState = ETransitionStateMovingToNext;
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::MoveToPrevMonthAnimation1L
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarDeckControl::MoveToPrevMonthAnimation1L()
+    {
+    // updates the month layout which is just below the top of deck layout
+    UpdatePrevMonthL();
+
+    // move currently focused month to out of screen horizontally
+    iDeck->Visual( iFocusedMonth ).SetPos( TPoint( iDisplayRect.Width(), 0 ), KMonthViewTransitTime );
+    
+    // with rotation transformation
+    RotateVisualL( iDeck->Visual( iFocusedMonth ), 0, 360, KMonthViewRotationTime );
+
+    // move month to back of DECK after KMonthViewTransitTime duration by sending custom event
+    // custom event EMoveMonthToBack should be handled in OfferEventL()
+    Env().Send( TAlfCustomEventCommand( EMoveMonthToBack, this ), KMonthViewTransitTime );
+    
+    // change iMonthTransitionState state
+    iMonthTransitionState = ETransitionStateMovingToPrev;
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::MoveToNextMonthAnimation2L
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarDeckControl::MoveToNextMonthAnimation2L()
+    {
+    // updates the month layout which is at bottom of deck layout
+    UpdateNextMonthL();
+
+    // get the bottom most month to front of DECK
+    iDeck->MoveVisualToFront( iDeck->Visual( 0 ) );
+
+    // position it at bottom of display
+    iDeck->Visual( iFocusedMonth ).SetPos( TPoint( 0, iDisplayRect.Height() ), 0 );
+
+    // ans move it to 0,0 position (top left of display)
+    iDeck->Visual( iFocusedMonth ).SetPos( TPoint( 0, 0 ), KMonthViewTransitTime );
+
+    // send custom event and handle it in OfferEventL()
+    Env().Send( TAlfCustomEventCommand( EMonthMovedToFront, this ), KMonthViewTransitTime );
+
+    // change iMonthTransitionState state
+    iMonthTransitionState = ETransitionStateMovingToNext;
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::MoveToPrevMonthAnimation2L
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarDeckControl::MoveToPrevMonthAnimation2L()
+    {
+    // updates the month layout which is just below (2nd one)
+    // from the top of deck layout
+    UpdatePrevMonthL();
+
+    // move currently visible month (which is on top of layout)
+    // to bottom of didplay
+    iDeck->Visual( iFocusedMonth ).SetPos(
+            TPoint( 0, iDisplayRect.Height() ), KMonthViewTransitTime );
+
+    // then move month to back of DECK after KMonthViewTransitTime duration
+    Env().Send(
+            TAlfCustomEventCommand( EMoveMonthToBack, this ),
+            KMonthViewTransitTime );
+    
+    // change iMonthTransitionState state
+    iMonthTransitionState = ETransitionStateMovingToPrev;
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::ScaleVisualL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarDeckControl::ScaleVisualL(
+        CAlfVisual& aVisual,
+        TReal aXSf,
+        TReal aYSf,
+        TInt aTime )
+    {
+    aVisual.EnableTransformationL();
+    TAlfTimedValue xSc( KUnitSize );
+    xSc.SetTarget( aXSf, aTime );
+    TAlfTimedValue ySc( KUnitSize );
+    ySc.SetTarget( aYSf, aTime );
+    aVisual.Transformation().Scale( xSc, ySc );
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::RotateVisualL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarDeckControl::RotateVisualL(
+        CAlfVisual& aVisual,
+        TReal aInitAngle,
+        TReal aTargetAngle,
+        TInt aTime )
+    {
+    aVisual.EnableTransformationL();
+    TAlfTimedValue angle( aInitAngle );
+    angle.SetTarget( aTargetAngle, aTime );
+    aVisual.Transformation().Rotate( angle , 0.0, 0.0, 1.0 );
+    }
+
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarDeckControl::SetOpacity
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarDeckControl::SetOpacity(
+    CAlfVisual& aVisual,
+    TReal aInitValue,
+    TReal aTargetValue,
+    TInt aTime )
+    {
+    TAlfTimedValue opacity;
+    opacity.SetValueNow( aInitValue );
+    opacity.SetTarget( aTargetValue, aTime ); // in milliseconds
+    aVisual.SetOpacity( opacity );
+    }
+
+
+// end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/src/alfexcalendardocument.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "alfexcalendarappui.h"
+#include "alfexcalendardocument.h"
+
+// Standard Symbian OS construction sequence
+CAlfExCalendarDocument* CAlfExCalendarDocument::NewL(CEikApplication& aApp)
+    {
+    CAlfExCalendarDocument* self = NewLC(aApp);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CAlfExCalendarDocument* CAlfExCalendarDocument::NewLC(CEikApplication& aApp)
+    {
+    CAlfExCalendarDocument* self = new (ELeave) CAlfExCalendarDocument(aApp);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+void CAlfExCalendarDocument::ConstructL()
+    {
+	// no implementation required
+    }    
+
+CAlfExCalendarDocument::CAlfExCalendarDocument(CEikApplication& aApp) : CAknDocument(aApp) 
+    {
+	// no implementation required
+    }
+
+CAlfExCalendarDocument::~CAlfExCalendarDocument()
+    {
+	// no implementation required
+    }
+
+CEikAppUi* CAlfExCalendarDocument::CreateAppUiL()
+    {
+    // Create the application user interface, and return a pointer to it,
+    // the framework takes ownership of this object
+    CEikAppUi* appUi = new (ELeave) CAlfExCalendarAppUi;
+    return appUi;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/src/alfexcalendarengine.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,262 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 FILES
+#include <EikEnv.h>
+#include <barsread.h>
+#include <e32math.h>
+
+#include <alfexcalendar.rsg>
+#include "alfexcalendarengine.h"
+
+// CONSTANTS
+const TReal KAlfExCalendarEngineChangeDay = 0.7;
+const TReal KAlfExCalendarEngineDayRandomizeLoopCount = 4;
+const TReal KAlfExCalendarEngineDayRandomize = 10;
+const TReal KAlfExCalendarEngineDayTenDays = 10;
+const TReal KAlfExCalendarEngineArrayGranularity = 4;
+
+// LOCAL CONSTANTS AND MACROS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ----------------------------------------------------
+// CAlfExCalendarEngine::NewL
+// ----------------------------------------------------
+CAlfExCalendarEngine* CAlfExCalendarEngine::NewL()
+    {
+    CAlfExCalendarEngine* self = CAlfExCalendarEngine::NewLC();
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+    
+// ----------------------------------------------------
+// CAlfExCalendarEngine::NewLC
+// ----------------------------------------------------
+CAlfExCalendarEngine* CAlfExCalendarEngine::NewLC()
+    {
+    CAlfExCalendarEngine* self = new (ELeave) CAlfExCalendarEngine();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+    
+    
+// ----------------------------------------------------
+// CAlfExCalendarEngine::CAlfExCalendarEngine
+// ----------------------------------------------------
+CAlfExCalendarEngine::CAlfExCalendarEngine()
+    {
+    iCalendarEventArray.Reset();
+    }
+
+    
+// ----------------------------------------------------
+// CAlfExCalendarEngine::ConstructL
+// ----------------------------------------------------
+void CAlfExCalendarEngine::ConstructL()
+    {
+    TReal   randomNumber;
+    TInt    randomNumberInt;
+    TInt64  seed=0;
+    
+    CDesCArrayFlat* array = new(ELeave) CDesCArrayFlat(KAlfExCalendarEngineArrayGranularity);
+    CleanupStack::PushL( array );
+    
+    CEikonEnv* coeEnv = CEikonEnv::Static();
+    TResourceReader reader;
+    coeEnv->CreateResourceReaderLC(reader, R_ALFEXCALENDAR_CALENDAR_EVENTS_ARRAY);
+    
+    const TInt count = reader.ReadInt16();
+    for(TInt loop = 0; loop < count; loop++)
+        {
+        HBufC* txt = reader.ReadHBufCL();
+        CleanupStack::PushL(txt);
+        array->AppendL(*txt);
+        CleanupStack::PopAndDestroy(txt);
+        }
+    CleanupStack::PopAndDestroy(); //reader2
+
+    TAlfExCalendarEngineListItem event;
+    event.iItemDay.HomeTime();
+    seed = event.iItemDay.Int64();
+    randomNumber = count * Math::FRand(seed);
+    randomNumberInt = (TInt) randomNumber;
+    
+    TTimeIntervalDays days(KAlfExCalendarEngineDayTenDays);
+    event.iItemDay -= days; // lets start 10 days before present
+    
+    for(TInt i=0; i<KAlfExCalendarEngineDayRandomizeLoopCount; i++)
+        {
+        for(TInt loop = 0; loop < count; loop++)
+            {
+            randomNumber = Math::FRand(seed);
+            if(randomNumber < KAlfExCalendarEngineChangeDay)
+                {
+                randomNumber *= KAlfExCalendarEngineDayRandomize;
+                randomNumberInt = (TInt) randomNumber;
+                days = TTimeIntervalDays(randomNumberInt);
+                event.iItemDay += days;
+                }
+            event.iItemText.Copy((*array)[loop]);
+            iCalendarEventArray.AppendL(event);
+            }
+        }
+    CleanupStack::PopAndDestroy(array);
+    }
+
+    
+// ----------------------------------------------------
+// CAlfExCalendarEngine::~CAlfExCalendarEngine
+// ----------------------------------------------------
+CAlfExCalendarEngine::~CAlfExCalendarEngine()
+    {
+    iCalendarEventArray.Close();
+    }
+
+// ----------------------------------------------------
+// CAlfExCalendarEngine::LoadCalendarEventsL
+// ----------------------------------------------------
+void CAlfExCalendarEngine::LoadCalendarEventsL( const TTime& aDate )
+    {
+    TReal   randomNumber;
+    TInt    randomNumberInt;
+    TInt64  seed=0;
+    
+    CDesCArrayFlat* array = new(ELeave) CDesCArrayFlat(KAlfExCalendarEngineArrayGranularity);
+    CleanupStack::PushL( array );
+    
+    CEikonEnv* coeEnv = CEikonEnv::Static();
+    TResourceReader reader;
+    coeEnv->CreateResourceReaderLC(reader, R_ALFEXCALENDAR_CALENDAR_EVENTS_ARRAY);
+    
+    const TInt count = reader.ReadInt16();
+    for(TInt loop = 0; loop < count; loop++)
+        {
+        HBufC* txt = reader.ReadHBufCL();
+        CleanupStack::PushL(txt);
+        array->AppendL(*txt);
+        CleanupStack::PopAndDestroy(txt);
+        }
+    CleanupStack::PopAndDestroy(); //reader2
+
+    TAlfExCalendarEngineListItem event;
+    event.iItemDay = aDate; //.HomeTime();
+    seed = event.iItemDay.Int64();
+    randomNumber = count * Math::FRand(seed);
+    randomNumberInt = (TInt) randomNumber;
+    
+    TTimeIntervalDays days(KAlfExCalendarEngineDayTenDays);
+    event.iItemDay -= days; // lets start 10 days before present
+    
+    for(TInt i=0; i<KAlfExCalendarEngineDayRandomizeLoopCount; i++)
+        {
+        for(TInt loop = 0; loop < count; loop++)
+            {
+            randomNumber = Math::FRand(seed);
+            if(randomNumber < KAlfExCalendarEngineChangeDay)
+                {
+                randomNumber *= KAlfExCalendarEngineDayRandomize;
+                randomNumberInt = (TInt) randomNumber;
+                days = TTimeIntervalDays(randomNumberInt);
+                event.iItemDay += days;
+                }
+            event.iItemText.Copy((*array)[loop]);
+            iCalendarEventArray.AppendL(event);
+            }
+        }
+    CleanupStack::PopAndDestroy(array);
+    }
+
+// ----------------------------------------------------
+// CAlfExCalendarEngine::EventsAvailable
+// ----------------------------------------------------
+TBool CAlfExCalendarEngine::EventsAvailable(const TTime& aDate)
+    {
+    TBool ret( EFalse );
+    TDateTime requestedDate = aDate.DateTime();
+    const TInt arrayCount = iCalendarEventArray.Count();
+    for(TInt loop = 0; loop < arrayCount; loop++)
+        {
+        TDateTime eventDate = iCalendarEventArray[loop].iItemDay.DateTime();
+        if(eventDate.Day() == requestedDate.Day() && 
+           eventDate.Month() == requestedDate.Month() &&
+           eventDate.Year() == requestedDate.Year())
+            {
+            ret = ETrue;
+            break;
+            }
+        }
+    return ret;
+    }
+
+// ----------------------------------------------------
+// CAlfExCalendarEngine::NumberOfEvents
+// ----------------------------------------------------
+TInt CAlfExCalendarEngine::NumberOfEvents(const TTime& aDate)
+    {
+    TInt count = 0;
+    TDateTime requestedDate = aDate.DateTime();
+    const TInt arrayCount = iCalendarEventArray.Count();
+    for(TInt loop = 0; loop < arrayCount; loop++)
+        {
+        TDateTime eventDate = iCalendarEventArray[loop].iItemDay.DateTime();
+        if(eventDate.Day() == requestedDate.Day() && 
+           eventDate.Month() == requestedDate.Month() &&
+           eventDate.Year() == requestedDate.Year())
+            {
+            count++;
+            }
+        }
+    return count;
+    }
+
+    
+// ----------------------------------------------------
+// CAlfExCalendarEngine::NumberOfEvents
+// ----------------------------------------------------
+void CAlfExCalendarEngine::GetEventInformation( 
+    const TTime& aDate, 
+    TInt aIndex, 
+    TDes& aTextBuffer)
+    {
+    aTextBuffer.Zero();
+    TInt count = KErrNotFound;
+    TDateTime requestedDate = aDate.DateTime();
+    const TInt arrayCount = iCalendarEventArray.Count();
+    for(TInt loop = 0; loop < arrayCount; loop++ )
+        {
+        TDateTime eventDate = iCalendarEventArray[loop].iItemDay.DateTime();
+        if(eventDate.Day() == requestedDate.Day() && 
+           eventDate.Month() == requestedDate.Month() &&
+           eventDate.Year() == requestedDate.Year())
+            {
+            count++;
+            }
+        if(aIndex == count)
+            {
+            aTextBuffer.Copy(iCalendarEventArray[loop].iItemText);
+            loop = arrayCount;
+            }
+        }
+    }
+    
+    
+// end of file    
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/src/alfexcalendarengineeventtimer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 FILES
+#include "alfexcalendarengineeventtimer.h"
+
+// CONSTANTS
+const TReal KAlfExCalendarEngineArrayGranularity = 4;
+
+// LOCAL CONSTANTS AND MACROS
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ----------------------------------------------------
+// CAlfExCalendarEngineEventTimer::NewL
+// ----------------------------------------------------
+CAlfExCalendarEngineEventTimer* CAlfExCalendarEngineEventTimer::NewL(
+    MAlfExCalendarEngineEventTimerObserver& aObserver)
+    {
+    CAlfExCalendarEngineEventTimer* self = 
+        CAlfExCalendarEngineEventTimer::NewLC(aObserver);
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+    
+// ----------------------------------------------------
+// CAlfExCalendarEngineEventTimer::NewLC
+// ----------------------------------------------------
+CAlfExCalendarEngineEventTimer* CAlfExCalendarEngineEventTimer::NewLC(
+    MAlfExCalendarEngineEventTimerObserver& aObserver)
+    {
+    CAlfExCalendarEngineEventTimer* self = new (ELeave) CAlfExCalendarEngineEventTimer(aObserver);
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+    
+    
+// ----------------------------------------------------
+// CAlfExCalendarEngineEventTimer::CAlfExCalendarEngineEventTimer
+// ----------------------------------------------------
+CAlfExCalendarEngineEventTimer::CAlfExCalendarEngineEventTimer(
+    MAlfExCalendarEngineEventTimerObserver& aObserver)
+    :
+    CActive(EPriorityLow),
+    iObserver(aObserver)
+    {
+	CActiveScheduler::Add(this);
+    }
+
+    
+// ----------------------------------------------------
+// CAlfExCalendarEngineEventTimer::ConstructL
+// ----------------------------------------------------
+void CAlfExCalendarEngineEventTimer::ConstructL()
+    {
+	User::LeaveIfError(iTimer.CreateLocal());
+    }
+
+    
+// ----------------------------------------------------
+// CAlfExCalendarEngineEventTimer::~CAlfExCalendarEngineEventTimer
+// ----------------------------------------------------
+CAlfExCalendarEngineEventTimer::~CAlfExCalendarEngineEventTimer()
+    {
+	Cancel();
+    iTimer.Close();
+    }
+
+
+// ----------------------------------------------------
+// CAlfExCalendarEngineEventTimer::StartTimer
+// ----------------------------------------------------
+void CAlfExCalendarEngineEventTimer::StartTimer(TTimeIntervalMicroSeconds32 aDelay)
+	{
+	Cancel();
+	iTimer.After( iStatus, aDelay );
+	SetActive();
+	}
+
+// ----------------------------------------------------
+// CAlfExCalendarEngineEventTimer::DoCancel
+// ----------------------------------------------------
+void CAlfExCalendarEngineEventTimer::DoCancel()
+	{
+	iTimer.Cancel();
+	}
+
+
+// ----------------------------------------------------
+// CAlfExCalendarEngineEventTimer::RunL
+// ----------------------------------------------------
+void CAlfExCalendarEngineEventTimer::RunL()
+	{
+	if ( iStatus == KErrNone )
+	    {
+        iObserver.HandleTimerEventL();
+	    }
+	}
+
+    
+// ----------------------------------------------------
+// CAlfExCalendarEngineEventTimer::RunError
+// ----------------------------------------------------
+TInt CAlfExCalendarEngineEventTimer::RunError(TInt /*aError*/)
+	{
+	return KErrNone;
+	}
+	
+	
+// end of file    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexcalendar/src/alfexcalendarmonth.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1068 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include <avkon.hrh>
+
+#include <alf/alftextvisual.h>
+#include <alf/alfimagevisual.h>
+#include <alf/alfgridlayout.h>
+#include <alf/alfdecklayout.h>
+#include <alf/alfflowlayout.h>
+#include <alf/alfcurvepathlayout.h>
+#include <alf/alfcurvepath.h>
+#include <alf/alfevent.h>
+#include <alf/alfenv.h>
+#include <alf/alfdisplay.h>
+#include <alf/alfborderbrush.h>
+#include <alf/alfimagebrush.h>
+#include <alf/alfbrusharray.h>
+#include <alf/alfgradientbrush.h>
+#include <alf/alfshadowborderBrush.h>
+#include <alf/alftransformation.h>
+#include <alf/alftextstylemanager.h>
+#include <alf/alftextstyle.h>
+#include <alf/alfimageloaderutil.h>
+
+#include "alfexcalendarmonth.h"
+#include "alfexcalendardeckcontrol.h"
+#include "alfexcalendarengine.h"
+
+_LIT( KWkNo, "Wk" );
+_LIT( KMonday, "Mo" );
+_LIT( KTuesday, "Tu" );
+_LIT( KWednesday, "We" );
+_LIT( KThursday, "Th" );
+_LIT( KFriday, "Fr" );
+_LIT( KSaturday, "Sa" );
+_LIT( KSunday, "Su" );
+
+_LIT( KMonth1, "January" );
+_LIT( KMonth2, "February" );
+_LIT( KMonth3, "March" );
+_LIT( KMonth4, "April" );
+_LIT( KMonth5, "May" );
+_LIT( KMonth6, "June" );
+_LIT( KMonth7, "July" );
+_LIT( KMonth8, "August" );
+_LIT( KMonth9, "September" );
+_LIT( KMonth10, "October" );
+_LIT( KMonth11, "November" );
+_LIT( KMonth12, "December" );
+
+// svg files need full path in 3.2
+_LIT( KMonthSVGBg, "c:\\data\\Images\\background.svg" );
+_LIT( KNormalDayBg, "c:\\data\\Images\\normaldaybutton.svg" );
+_LIT( KEventsDayBg, "c:\\data\\Images\\eventsdaybutton.svg" );
+_LIT( KTitleBg, "c:\\data\\Images\\title.svg" );
+_LIT( KSelectedDayBg, "c:\\data\\Images\\selectedday.svg" );
+
+_LIT( KImagePath, "c:\\data\\Images\\" );
+
+// Custom events
+enum
+{
+    EShowCaledarEvents = 1,
+    
+};
+
+// Constant declarations
+// Month names
+const TDesC* KMonths[12] = { &KMonth1, &KMonth2, &KMonth3, &KMonth4,
+                             &KMonth5, &KMonth6, &KMonth7, &KMonth8,
+                             &KMonth9, &KMonth10, &KMonth11, &KMonth12 };
+
+const TInt KXPaddingLen = 3; // padding between visuals in layout
+const TInt KYPaddingLen = 3;
+const TInt KNoOfRows = 7;
+const TInt KNoOfCols = 8; // including week numbers
+
+const TReal KDayViewSizeXChange = 60.0;
+const TReal KDayViewSizeYChange = 60.0;
+const TInt KDayViewTransitionTime = 800;
+const TInt KDayFocusTime = 1000;
+
+const TReal KUnitSize = 1.0f;
+const TReal KXSf = 1.32f;
+const TReal KYSf = 1.50f;
+const TReal KDayViewXSf = 15.0f;
+const TReal KDayViewYSf = 15.0f;
+
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::CAlfExCalendarMonth
+// --------------------------------------------------------------------------
+//
+CAlfExCalendarMonth::CAlfExCalendarMonth(
+    CAlfExCalendarDeckControl& aCalendarControl,
+    CAlfEnv& aEnv,
+    TDateTime aDateTime )
+    :iMonthNumber(0), iDayNoInWeek(0), iFocusedDay(0), iDayView( EFalse ),
+    iCalendarControl( aCalendarControl ), iEnv( aEnv ),
+    iIsDayFocused( EFalse ), iDateTime( aDateTime )
+    {
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::~CAlfExCalendarMonth
+// --------------------------------------------------------------------------
+//
+CAlfExCalendarMonth::~CAlfExCalendarMonth()
+    {
+    delete iEventTimer;
+    delete iFocusedDayBrush;
+    delete iNormalDayBrush;
+    delete iEventsDayBrush;
+    delete iImageLoaderUtil;
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::NewLC
+// --------------------------------------------------------------------------
+//
+CAlfExCalendarMonth* CAlfExCalendarMonth::NewLC( CAlfLayout* aParentLayout, 
+		TDateTime aDateTime,
+		CAlfEnv& aEnv,
+        CAlfExCalendarDeckControl& aCalendarControl )
+    {
+    CAlfExCalendarMonth* self =
+        new (ELeave) CAlfExCalendarMonth( aCalendarControl, aEnv, aDateTime );
+    CleanupStack::PushL( self );
+    
+    self->ConstructL( aParentLayout );
+    return self;
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::ConstructL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::ConstructL( CAlfLayout* aParentLayout )
+	{
+    CAlfControl::ConstructL( iEnv );
+
+    iMonthNumber = iDateTime.Month();
+    iDateTime.SetDay(0);
+    iTime = TTime( iDateTime );
+    iDayNoInWeek = iTime.DayNoInWeek();
+    iDaysInMonth = iTime.DaysInMonth();
+    
+    iBottomGrid = CAlfGridLayout::AddNewL( *this, 1, 2, aParentLayout );
+    iBottomGrid->SetOpacity( TAlfTimedValue(1.0f) );
+    
+	RArray<TInt> weights;
+    weights.Append( 3 );
+    weights.Append( 12 );
+    iBottomGrid->SetRowsL( weights );
+    weights.Reset();
+    
+    Env().TextureManager().SetImagePathL( KImagePath );
+    
+    TRect displayRect = iEnv.PrimaryDisplay().VisibleArea();
+    
+    iImageLoaderUtil = new(ELeave)CAlfImageLoaderUtil();
+    //iImageLoaderUtil->SetSize( TSize( displayRect.Width(), displayRect.Height() ) );
+    iImageLoaderUtil->SetSize( TSize(240, 320) ); // This is very important
+    
+    // set background to month view
+    SetMonthBackgroundL( iBottomGrid );
+    
+    // Add text visual for "month name and year"
+	iMonthText = CAlfTextVisual::AddNewL( *this, iBottomGrid );
+
+    // sets title text for month ("Date Month name Year")
+    SetMonthTitleTextL();
+    
+    iMonthText->SetColor( KRgbYellow );
+    iMonthText->SetAlign( EAlfAlignHCenter, EAlfAlignVCenter );
+    
+    // create font style and set to iMonthText
+    TInt fontStyleId = KErrNotFound;
+    fontStyleId = iEnv.TextStyleManager().CreatePlatformTextStyleL(
+            EAknLogicalFontPrimarySmallFont,
+            EAlfTextStyleSmall );
+    CAlfTextStyle* style = iEnv.TextStyleManager().TextStyle( fontStyleId );
+    style->SetTextSizeInPixels( 25, ETrue );
+    iMonthText->SetTextStyle( style->Id() );
+
+    // set svg graphics as Image brush to iMonthText visual
+    SetSVGImageTextureL( iMonthText, KTitleBg );
+    
+    // create dates grid and add dates
+    iDatesGrid = CAlfGridLayout::AddNewL(
+            *this,
+            KNoOfCols,
+            KNoOfRows,
+            iBottomGrid );
+    AddDateVisualsL( iDatesGrid );
+
+    // set week names in iDatesGrid
+    SetWeekDayNameL( KWkNo(), iDatesGrid, 0, KWeekNumberColor );
+    SetWeekDayNameL( KMonday(), iDatesGrid, 1 );
+    SetWeekDayNameL( KTuesday(), iDatesGrid, 2 );
+    SetWeekDayNameL( KWednesday(), iDatesGrid, 3 );
+    SetWeekDayNameL( KThursday(), iDatesGrid, 4 );
+    SetWeekDayNameL( KFriday(), iDatesGrid, 5 );
+    SetWeekDayNameL( KSaturday(), iDatesGrid, 6, KWeekendDayColor );
+    SetWeekDayNameL( KSunday(), iDatesGrid, 7, KWeekendDayColor );
+
+    // create CalendarEngine EventTimer
+    iEventTimer = CAlfExCalendarEngineEventTimer::NewL( *this );
+	
+    // Create all brushes here
+    MAlfBitmapProvider* provider = iImageLoaderUtil->CreateSVGImageLoaderL( KNormalDayBg );
+    CAlfTexture& texture1 = Env().TextureManager().CreateTextureL(
+            KAlfAutoGeneratedTextureId, 
+            provider,
+            EAlfTextureFlagRetainResolution );
+    iNormalDayBrush = CAlfImageBrush::NewL( Env(), TAlfImage( texture1 ) );
+    iNormalDayBrush->SetLayer( EAlfBrushLayerBackground );
+
+    provider = iImageLoaderUtil->CreateSVGImageLoaderL( KEventsDayBg );
+    CAlfTexture& texture2 = Env().TextureManager().CreateTextureL(
+            KAlfAutoGeneratedTextureId, 
+            provider,
+            EAlfTextureFlagRetainResolution );
+    iEventsDayBrush = CAlfImageBrush::NewL( Env(), TAlfImage( texture2 ) );
+    iEventsDayBrush->SetLayer( EAlfBrushLayerBackground );
+
+    provider = iImageLoaderUtil->CreateSVGImageLoaderL( KSelectedDayBg );
+    CAlfTexture& texture3 = Env().TextureManager().CreateTextureL(
+            KAlfAutoGeneratedTextureId, 
+            provider,
+            EAlfTextureFlagRetainResolution );
+    iFocusedDayBrush = CAlfImageBrush::NewL( Env(), TAlfImage( texture3 ) );
+    iFocusedDayBrush->SetLayer( EAlfBrushLayerForeground );
+    
+    // end of brushes creation
+    
+    // set the dates in iDatesGrid according to the iTime
+    SetDatesL( iDatesGrid, iTime ); // TODO - refactor - API can be changed
+
+    iDatesGrid->SetInnerPadding( TPoint( KXPaddingLen, KYPaddingLen ) );
+	}
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::SetMonthTitleTextL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::SetMonthTitleTextL()
+    {
+    // this fuction sets month title as "date month year"
+    TBuf<4> yearBuf;
+    yearBuf.Num( iDateTime.Year() );
+    TBuf<2> dayBuf;
+    dayBuf.Num( iFocusedDay+1 ); // iFocusedDay starts from 0
+
+    TBuf<16> buf;
+    buf.Append( dayBuf );
+    buf.Append( _L(" "));    
+    buf.Append( *(KMonths[iDateTime.Month()]) );
+    buf.Append( _L(" "));
+    buf.Append( yearBuf );
+    iMonthText->SetTextL( buf );
+    }
+
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::SetMonthBackgroundL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::SetMonthBackgroundL( CAlfVisual* aVisual, TRgb /* aColor */ )
+    {
+    // IMPORTANT: first enable the brushes for the visual
+    aVisual->EnableBrushesL();
+    
+    // now set brush
+    SetSVGImageTextureL( aVisual, KMonthSVGBg );
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::SetBgImgL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::SetBgImgL( CAlfVisual* /* aVisual */ )
+    {
+    // This method is not used currently
+    /*
+    // Set background image
+    TRAP_IGNORE(
+    CAlfTexture& texture =
+        Env().TextureManager().LoadTextureL(
+                *(KMonthBackgrounds[iMonthNumber]),
+                EAlfTextureFlagDefault, //EAlfTextureFlagDoNotRetainResolution,
+                KAlfAutoGeneratedTextureId );
+
+    CAlfImageBrush* imgBrush = CAlfImageBrush::NewLC( Env(), TAlfImage( texture ) );
+    imgBrush->SetLayer( EAlfBrushLayerBackground );
+    aVisual->Brushes()->AppendL( imgBrush, EAlfHasOwnership );
+    CleanupStack::Pop( imgBrush );
+    );
+    */
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::SetSVGImageTextureL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::SetSVGImageTextureL(
+    CAlfVisual* aVisual,
+    const TDesC& aSvgFileName )
+    {
+    // IMPORTANT: first enable the brushes for the visual
+    aVisual->EnableBrushesL(); // incase, it has not been enabled
+    
+    // SVG graphics loading
+    MAlfBitmapProvider* provider = iImageLoaderUtil->CreateSVGImageLoaderL( aSvgFileName );
+    CAlfTexture& texture = Env().TextureManager().CreateTextureL(
+            KAlfAutoGeneratedTextureId, 
+            provider,
+            EAlfTextureFlagRetainResolution );
+
+    // create Image brush
+    CAlfImageBrush* imgBrush = CAlfImageBrush::NewLC( Env(), TAlfImage( texture ) );
+    imgBrush->SetLayer( EAlfBrushLayerBackground );
+    aVisual->Brushes()->AppendL( imgBrush, EAlfHasOwnership );
+    CleanupStack::Pop( imgBrush );
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::SetWeekDayNameL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::SetWeekDayNameL(
+    const TDesC& aDayName,
+    CAlfGridLayout* aGrid,
+    TInt aDayIndex,
+    TRgb aColor )
+	{
+    CAlfVisual& cell = aGrid->Visual( aDayIndex );
+    CAlfTextVisual& textVisual = static_cast<CAlfTextVisual&>( cell );
+    
+    textVisual.SetTextL( aDayName );
+    textVisual.SetColor( aColor );
+
+    TInt fontStyleId = KErrNotFound;
+    fontStyleId = iEnv.TextStyleManager().CreatePlatformTextStyleL(
+            EAknLogicalFontPrimarySmallFont,
+            EAlfTextStyleSmall );
+    
+    CAlfTextStyle* style = iEnv.TextStyleManager().TextStyle( fontStyleId );
+    style->SetTextSizeInPixels( 20, ETrue );
+    style->SetBold( ETrue );
+    textVisual.SetTextStyle( style->Id() );
+	}
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::AddDateVisualsL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::AddDateVisualsL( CAlfGridLayout* aGrid )
+	{
+    // adds text visuals i Grid
+	for (TInt i = 0 ; i < KNoOfRows * KNoOfCols ; i ++ )
+		{
+		CAlfTextVisual* text = CAlfTextVisual::AddNewL( *this, aGrid );
+        text->EnableBrushesL( ETrue );
+		}
+	}
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::SetDatesL
+// --------------------------------------------------------------------------
+//
+TInt CAlfExCalendarMonth::SetDatesL(
+    CAlfGridLayout* aGrid,
+    TTime aTime )
+    {
+    // logic to arrange dates and week numbers in correct positions
+    // TODO - there is problem of showing weeke numbers in some months. 
+    // look into TTime API/implementation and fix.
+    
+    iDaysInMonth = aTime.DaysInMonth();
+    TInt emptyDays = aTime.DayNoInWeek();
+    TInt dateTextStyle = DateTextStyleL();
+    TInt weekTextStyle = dateTextStyle;
+    
+    // 1st row of dates
+    // set week number at 1st column
+    TInt dayIdx = 1;
+    TInt visualIdx = 8;
+    SetWeekNumberL( aGrid, visualIdx, dayIdx, weekTextStyle );
+
+    // move to 1st day in month
+    visualIdx++;
+    // clear text visuals in the grid for first empty days
+    for( TInt idx = 1; idx <= emptyDays; idx++, visualIdx++ )
+        {
+        ClearDayVisualL( aGrid, visualIdx );
+        }
+    
+    // set date numbers from correct week (after the empty days)
+    for( TInt colIdx = emptyDays+1; colIdx < KNoOfCols; colIdx++, visualIdx++, dayIdx++ )
+        {
+        if( colIdx > KNoOfCols-3 ) // weekend days
+            {
+            SetDateNumberL( aGrid, visualIdx, dayIdx, dateTextStyle, KWeekendDayColor );
+            }
+        else
+            {
+            SetDateNumberL( aGrid, visualIdx, dayIdx, dateTextStyle );            
+            }
+        }
+    
+    // fill week and date numbers from 2nd row
+    for( TInt rowIdx = 2; rowIdx < KNoOfRows && dayIdx <= iDaysInMonth; rowIdx++ )
+        {
+        // set week number at 1st column
+        SetWeekNumberL( aGrid, visualIdx, dayIdx, weekTextStyle );
+        visualIdx++;
+
+        // set dates in next columns
+        for( TInt colIdx = 1;
+             colIdx < KNoOfCols && dayIdx <= iDaysInMonth; /* only week days */
+             colIdx++, visualIdx++, dayIdx++ )
+            {
+            if( colIdx > KNoOfCols-3 ) // weekend days
+                {
+                SetDateNumberL( aGrid, visualIdx, dayIdx, dateTextStyle, KWeekendDayColor );
+                }
+            else // week days
+                {
+                SetDateNumberL( aGrid, visualIdx, dayIdx, dateTextStyle );            
+                }            
+           }
+        }
+
+    // clear remaining text visuals in the grid
+    for( ; visualIdx < KNoOfRows * KNoOfCols; visualIdx++ )
+        {
+        ClearDayVisualL( aGrid, visualIdx );
+        }
+    
+    return 1;
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::SetDateNumberL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::SetDateNumberL(
+        CAlfGridLayout* aGrid,
+        TInt aVisualIndex,
+        TInt aDayNumber,
+        TInt aDateTextStyle,
+        TRgb aColor )
+    {
+    // get text visual from grid
+    CAlfVisual& cell = aGrid->Visual( aVisualIndex );
+    CAlfTextVisual& textVisual = static_cast<CAlfTextVisual&>( cell );
+    textVisual.SetTextStyle( aDateTextStyle );
+    textVisual.SetColor( aColor );
+    textVisual.SetAlign( EAlfAlignHCenter, EAlfAlignVCenter );
+
+    // set the text
+    TBuf<3> buf;
+    buf.Num( aDayNumber );
+    textVisual.SetTextL( buf );
+
+    // append brush
+    textVisual.Brushes()->AppendL( iNormalDayBrush, EAlfDoesNotHaveOwnership );
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::SetWeekNumberL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::SetWeekNumberL(
+        CAlfGridLayout* aGrid,
+        TInt aVisualIndex,
+        TInt aDayNumber,
+        TInt aWeekTextStyle )
+    {
+    // get text visual from grid
+    CAlfVisual& cell = aGrid->Visual( aVisualIndex );
+    CAlfTextVisual& textVisual = static_cast<CAlfTextVisual&>( cell );
+    textVisual.SetColor( KWeekNumberColor );
+    textVisual.SetAlign( EAlfAlignHCenter, EAlfAlignVCenter );
+    textVisual.SetTextStyle( aWeekTextStyle );
+
+    // use aDayNumber to get the correct week number
+    TDateTime tempDateTime = iDateTime;
+    tempDateTime.SetDay( aDayNumber );
+    TTime tempTime = TTime( tempDateTime );
+
+    TBuf<3> buf;
+    buf.Num( tempTime.WeekNoInYear() );
+    textVisual.SetTextL( buf ); 
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::ClearDayVisualL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::ClearDayVisualL(
+        CAlfGridLayout* aGrid,
+        TInt aVisualIndex )
+    {
+    CAlfVisual& cell = aGrid->Visual( aVisualIndex );
+    CAlfTextVisual& textVisual = static_cast<CAlfTextVisual&>( cell );
+    
+    TBuf<3> buf;
+    textVisual.SetTextL( buf ); // set empty string
+    
+    // remove all brushes
+    if( textVisual.Brushes() )
+        {
+        TInt count = textVisual.Brushes()->Count();
+        for( TInt i = 0;  i < count; ++i )
+            {
+            textVisual.Brushes()->Remove( 0 );
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::DateTextStyleL
+// --------------------------------------------------------------------------
+//
+TInt CAlfExCalendarMonth::DateTextStyleL()
+    {
+    // creates font style id and returns
+    TInt fontStyleId = KErrNotFound;
+    fontStyleId = iEnv.TextStyleManager().CreatePlatformTextStyleL(
+            EAknLogicalFontPrimarySmallFont,
+            EAlfTextStyleSmall );
+    CAlfTextStyle* style = iEnv.TextStyleManager().TextStyle( fontStyleId );
+    style->SetTextSizeInPixels( 20, ETrue );
+    return style->Id();
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::UpdateMonthL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::UpdateMonthL( TDateTime aDateTime )
+	{
+    // updates month acording to received aDateTime
+    
+    iDateTime = aDateTime;
+    iDateTime.SetDay(0);
+    
+	iTime = TTime( iDateTime );
+    iDaysInMonth = iTime.DaysInMonth();
+	iDayNoInWeek = iTime.DayNoInWeek();
+	iMonthNumber = iDateTime.Month();
+    
+	SetDatesL( iDatesGrid, iTime );
+
+    TBuf<4> yearBuf;
+    yearBuf.Num( iDateTime.Year() );
+    TBuf<16> buf;
+    buf.Append( *(KMonths[iMonthNumber]) );
+    buf.Append( _L(" "));
+    buf.Append( yearBuf );
+
+    iMonthText->SetTextL( buf );
+	}
+	
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::MonthFocusedL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::MonthFocusedL()
+    {
+    // update(some kind of selection) all the days which have calendar events
+    UpdateDaysWithCalEventsL();
+    
+    // focus the 1st day
+    iFocusedDay = 0;
+    iDayVisualIndex = (9 + iDayNoInWeek + iFocusedDay);
+    CAlfVisual& startDay = iDatesGrid->Visual( iDayVisualIndex );
+    FocusDayL( static_cast<CAlfTextVisual&>( startDay ) );
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::UpdateDaysWithCalEventsL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::UpdateDaysWithCalEventsL()
+    {
+    iDaysInMonth = iTime.DaysInMonth();
+    iDayNoInWeek = iTime.DayNoInWeek();
+    
+    CAlfExCalendarEngine& calendarEngine = iCalendarControl.CalendarEngine();
+    calendarEngine.LoadCalendarEventsL( iTime );
+
+    TInt dayVisualIndex = (9 + iDayNoInWeek); // 1st day visual in the month
+    for( TInt i = 0; i < iDaysInMonth; i++, dayVisualIndex++ )
+        {
+        if( dayVisualIndex%8 == 0 ) // Visual index is at week number column (i.e., at column 0)
+            {
+            dayVisualIndex++;
+            }
+        if( calendarEngine.EventsAvailable( iTime + (TTimeIntervalDays)i ) )
+            {
+            CAlfVisual& cell = iDatesGrid->Visual( dayVisualIndex );
+
+            // add shadow border brush to the day visual
+            cell.Brushes()->AppendL( iEventsDayBrush, EAlfDoesNotHaveOwnership );
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::RemoveAllDayBrushesL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::RemoveAllDayBrushesL()
+    {
+    // remove all brushes of day visuals in grid
+    for( TInt i = 0 ; i < KNoOfRows * KNoOfCols ; i++ )
+        {
+        CAlfVisual& day = iDatesGrid->Visual( i );
+        
+        if( day.Brushes() )
+            {
+            TInt count = day.Brushes()->Count();
+            for( TInt i = 0;  i < count; ++i )
+                {
+                day.Brushes()->Remove( 0 );
+                }
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::MoveDayFocusL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::MoveDayFocusL( TInt aChange )
+	{
+	CAlfVisual& day1 = iDatesGrid->Visual( iDayVisualIndex );
+    UnFocusDayL( static_cast<CAlfTextVisual&>( day1 ) );
+    
+    iFocusedDay += aChange;
+	if ( iFocusedDay < 0 )
+		{
+        RemoveAllDayBrushesL();
+        iCalendarControl.SetMonthView( EFalse );
+        return;
+		}
+	if (iFocusedDay > iDaysInMonth -1 )
+		{
+        RemoveAllDayBrushesL();
+        iCalendarControl.SetMonthView( EFalse );
+        return;
+		}
+
+    if( aChange == 7 )
+        {
+        iDayVisualIndex += 8;
+        }
+    else if( aChange == -7 )
+        {
+        iDayVisualIndex -= 8;
+        }
+    else
+        {
+        iDayVisualIndex += aChange;
+        if( iDayVisualIndex%8 == 0 ) // Visual index is at week number column (column 0)
+            {
+            if( aChange > 0 )  // change is +1. move to next visual position
+                {
+                iDayVisualIndex++;
+                }
+            else // change is -1. Move to previous visual position
+                {
+                iDayVisualIndex--;
+                }
+            }
+        }
+    
+	CAlfVisual& day2 = iDatesGrid->Visual( iDayVisualIndex );
+    FocusDayL( static_cast<CAlfTextVisual&>( day2 ) );
+	}
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::UnFocusDayL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::UnFocusDayL( CAlfTextVisual& aTextVisual )
+    {
+    if( !iIsDayFocused ) // if day is not focued, dont do unfocus
+        {
+        return;
+        }
+    iIsDayFocused = EFalse;
+    
+    iEventTimer->Cancel();
+    
+    // IMPORTANT: Remove brushes applied ONLY in FocusDayL()
+    if( aTextVisual.Brushes() )
+        {
+        aTextVisual.Brushes()->Remove( aTextVisual.Brushes()->Count()-1 ); // 1st Brush
+        }
+    
+    // must scale back to original size
+    ScaleVisualL( aTextVisual, (KUnitSize/KXSf), (KUnitSize/KYSf), KDayFocusTime );
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::FocusDayL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::FocusDayL( CAlfTextVisual& aTextVisual )
+    {
+    if( iIsDayFocused ) // if day is already focused
+        {
+        return;
+        }
+    SetMonthTitleTextL();
+
+    iIsDayFocused = ETrue;
+    
+    // Append brush 1
+    aTextVisual.Brushes()->AppendL( iFocusedDayBrush, EAlfDoesNotHaveOwnership );
+
+    ScaleVisualL( aTextVisual, KXSf, KYSf, KDayFocusTime );
+    
+    TTimeIntervalMicroSeconds32 dayOpenTime( 6000000 ); // EVENT TIMER
+    iEventTimer->StartTimer( dayOpenTime );
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::OpenDayViewL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::OpenDayViewL()
+    {
+    // check if calendar events available for the day
+    CAlfExCalendarEngine& calendarEngine = iCalendarControl.CalendarEngine();
+    if( !calendarEngine.EventsAvailable( iTime + (TTimeIntervalDays)iFocusedDay ) )
+        {
+        return; // return if no calendar events for the day
+        }
+    // get calendar events
+    calendarEngine.GetEventInformation( 
+                iTime + (TTimeIntervalDays)iFocusedDay, 
+                0, 
+                iCalendarEventTextBuffer );
+
+    TAlfTimedValue opacity;
+    opacity.SetValueNow( 1 );
+    opacity.SetTarget( 0, KDayViewTransitionTime ); // in milliseconds
+    // Set opacity of all visuals to 0
+    for (TInt i = 0 ; i < KNoOfRows * KNoOfCols ; i ++ )
+        {
+        CAlfTextVisual& day = static_cast<CAlfTextVisual&>( iDatesGrid->Visual( i ) );
+        day.SetOpacity( opacity );
+        }
+
+    // store the original day visual position to be used in UnFocusL()
+    // to move it back to original position
+    iOriginalDayPos = iDatesGrid->Visual(iDayVisualIndex).Pos();
+
+    // now move the day visual to center on display
+    TRect displayRect = iEnv.PrimaryDisplay().VisibleArea();
+    TAlfRealPoint pos = TAlfRealPoint(displayRect.Width()/2, displayRect.Height()/3 );
+
+    CAlfTextVisual& day = static_cast<CAlfTextVisual&>( iDatesGrid->Visual( iDayVisualIndex ) );
+    day.SetPos( pos, KDayViewTransitionTime );
+
+    // Scale the day to fit entire display 
+    ScaleVisualL( day, KDayViewXSf, KDayViewYSf, KDayViewTransitionTime );
+
+    // send custom event to show calendar events after KDayViewTransitionTime
+    iEnv.Send( TAlfCustomEventCommand( EShowCaledarEvents, this ), KDayViewTransitionTime );
+    
+    iDayView = ETrue;
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::CloseDayViewL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::CloseDayViewL()
+    {
+    // cancel event timer
+    iEventTimer->Cancel();
+    
+    CAlfTextVisual& dayEventsVisual =
+        static_cast<CAlfTextVisual&>( iDatesGrid->Visual( (KNoOfRows*KNoOfCols)-1 ) );
+    // no need to put dayEventsVisual visual back to original size/position.
+    // this can be used dedicatedly to show calendar events
+
+    // just empty the text and hide it using opacity setting
+    TBuf<1> empty;
+    dayEventsVisual.SetTextL( empty );
+    dayEventsVisual.SetOpacity(0);
+    
+    // scale the opened day in OpenDayViewL() back to oroginal size
+    CAlfTextVisual& day = static_cast<CAlfTextVisual&>( iDatesGrid->Visual( iDayVisualIndex ) );
+    ScaleVisualL( day, (KUnitSize/KDayViewXSf), (KUnitSize/KDayViewYSf), KDayViewTransitionTime );
+    
+    // set position of opened day in OpenDayViewL() back to oroginal position
+    day.SetPos( iOriginalDayPos.ValueNow(), KDayViewTransitionTime );
+
+    //set all visuals opacity to 1
+    TAlfTimedValue opacity;
+    opacity.SetValueNow( 0.0 );
+    opacity.SetTarget( 1.0, KDayViewTransitionTime ); // in milliseconds
+    for (TInt i = 0 ; i < KNoOfRows * KNoOfCols ; i ++ )
+        {
+        CAlfTextVisual& day = static_cast<CAlfTextVisual&>( iDatesGrid->Visual( i ) );
+        day.SetOpacity( opacity );
+        }
+    dayEventsVisual.SetOpacity(0); // hide the dedicated dayEventsVisual
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::ScaleVisualL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::ScaleVisualL(
+        CAlfVisual& aVisual,
+        TReal aXSf,
+        TReal aYSf,
+        TInt aTime )
+    {
+    aVisual.EnableTransformationL();
+    
+    TAlfTimedValue xSc( KUnitSize );
+    xSc.SetTarget( aXSf, aTime );
+    TAlfTimedValue ySc( KUnitSize );
+    ySc.SetTarget( aYSf, aTime );
+    aVisual.Transformation().Scale( xSc, ySc );
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::RotateVisualL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::RotateVisualL(
+        CAlfVisual& aVisual,
+        TReal aInitAngle,
+        TReal aTargetAngle,
+        TInt aTime )
+    {
+    aVisual.EnableTransformationL();
+    
+    TAlfTimedValue angle( aInitAngle );
+    angle.SetTarget( aTargetAngle, aTime );
+    aVisual.Transformation().Rotate( angle , 1.0, 0.0, 0.0 );
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::SetTextStylesL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::SetTextStylesL(
+        CAlfTextVisual& aTextVisual,
+        const TDesC &aText,
+        TRgb aColor,
+        CAlfTextVisual::TLineWrap aLineWrap,
+        TAlfAlignHorizontal /*aAlignH*/,
+        TAlfAlignVertical /*aAlignV*/,
+        TPoint /*aPoint*/ )
+    {
+    aTextVisual.SetTextL( aText );
+    aTextVisual.SetColor( aColor );
+    aTextVisual.SetWrapping( aLineWrap );
+    aTextVisual.SetAlign( EAlfAlignHLeft, EAlfAlignVTop );
+    aTextVisual.SetPadding( TPoint(5,5) );
+
+    // S60 Font IDs:
+    // EAknLogicalFontPrimaryFont, EAknLogicalFontSecondaryFont, EAknLogicalFontTitleFont, 
+    // EAknLogicalFontDigitalFont, EAknHighestLogicalFont, EAknLogicalFontPrimarySmallFont
+    TInt fontStyleId = KErrNotFound;
+    fontStyleId = iEnv.TextStyleManager().CreatePlatformTextStyleL(
+            EAknLogicalFontPrimarySmallFont,
+            EAlfTextStyleSmall );
+    
+    CAlfTextStyle* style = iEnv.TextStyleManager().TextStyle( fontStyleId );
+    TInt sizeInPixels = style->TextSizeInPixels();
+    style->SetTextSizeInPixels( 20, ETrue );
+    style->SetBold( EFalse );
+    style->SetItalic( EFalse );
+    style->SetUnderline( ETrue );
+    style->SetStrikeThrough( EFalse );
+    aTextVisual.SetTextStyle( style->Id() );
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::ShowCalendarEventsL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::ShowCalendarEventsL()
+    {
+    // use last text visual in the grid to show the calendar events
+    CAlfTextVisual& dayEventsVisual =
+        static_cast<CAlfTextVisual&>( iDatesGrid->Visual( (KNoOfRows*KNoOfCols)-1 ) );
+
+    // set dayEventsVisual position at 1st text visual of grid.
+    // to align the day events from below the month name
+    dayEventsVisual.SetPos( iDatesGrid->Visual(0).Pos() );
+    
+    // set the size to fit to bottom right corner of display.
+    TAlfRealRect visualArea = dayEventsVisual.DisplayRectTarget();
+    TAlfRealPoint sizeChange( 200, 200 ); // width, height
+    TAlfRealPoint newSize = TAlfRealPoint( visualArea.Size().iWidth, visualArea.Size().iHeight)  + sizeChange;
+    dayEventsVisual.SetSize( newSize, 0 );
+    
+    // now set the calendar events text
+    SetTextStylesL( dayEventsVisual, iCalendarEventTextBuffer );
+
+    // set opacity to 1 to make it visible
+    TAlfTimedValue opacity;
+    opacity.SetValueNow( 0 );
+    opacity.SetTarget( 1, 500 ); // in milliseconds
+    dayEventsVisual.SetOpacity( opacity );    
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::OfferEventL
+// --------------------------------------------------------------------------
+//
+TBool CAlfExCalendarMonth::OfferEventL(const TAlfEvent& aEvent )
+	{
+    // handle custome vents if any
+    if( aEvent.IsCustomEvent() )
+        {
+        if( iDayView )
+            {
+                switch( aEvent.CustomParameter() )
+                {
+                case EShowCaledarEvents:
+                    ShowCalendarEventsL();
+                    return ETrue;
+    
+                default:
+                    break;
+                }
+            }
+        else
+            return ETrue;
+        }
+    
+    // handle key events
+	if ( aEvent.Code() == EEventKey )
+		{
+		TInt code = aEvent.KeyEvent().iCode;
+		switch( code )
+			{
+            case EKeyBackspace: // TODO - use "Back" softkey
+                if( iDayView )
+                    {
+                    // close day view and return to month view
+                    iDayView = EFalse;
+                    CloseDayViewL();
+                    }
+                return ETrue;
+
+			case 63557: // TODO - replace with key code
+                if( !iDayView )
+                    {
+                    OpenDayViewL();
+                    }
+                return ETrue;
+                
+			case EKeyLeftArrow:
+                if( iDayView )
+                    {
+                    iDayView = EFalse;
+                    CloseDayViewL();
+                    }
+				MoveDayFocusL( -1 );
+				return ETrue;
+				
+			case EKeyRightArrow:
+                if( iDayView )
+                    {
+                    iDayView = EFalse;
+                    CloseDayViewL();
+                    }
+				MoveDayFocusL( 1 );
+				return ETrue;
+
+			case EKeyUpArrow:
+                if( iDayView )
+                    {
+                    iDayView = EFalse;
+                    CloseDayViewL();
+                    }
+				MoveDayFocusL( -7 );
+				return ETrue;
+				
+			case EKeyDownArrow:
+                if( iDayView )
+                    {
+                    iDayView = EFalse;
+                    CloseDayViewL();
+                    }
+                MoveDayFocusL( +7 );
+                return ETrue;
+
+			default:;break;
+			}		
+	
+		}
+	return EFalse;
+	}
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::SetDateGridWeightsL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::SetDateGridWeightsL(
+    CAlfGridLayout* aDatesGrid,
+    TInt aRowIndex, 
+    TInt aWeight )
+    {
+    RArray<TInt> weights;
+    CleanupClosePushL( weights );
+
+    for( TInt i = 1; i <= KNoOfRows; ++i )
+        {
+        User::LeaveIfError( weights.Append( 1 ) );
+        }
+    if( aRowIndex != -1 )
+        {
+        weights.Insert( aRowIndex, aWeight );
+        }
+    
+    aDatesGrid->SetRowsL( weights );
+    CleanupStack::PopAndDestroy( &weights );
+    }
+
+// --------------------------------------------------------------------------
+// CAlfExCalendarMonth::HandleTimerEventL
+// --------------------------------------------------------------------------
+//
+void CAlfExCalendarMonth::HandleTimerEventL()
+    {
+    CAlfExCalendarEngine& calendarEngine = iCalendarControl.CalendarEngine();
+    if( calendarEngine.EventsAvailable( iTime + (TTimeIntervalDays)iFocusedDay ) &&
+            !iDayView ) // AND if day has not been opend already
+        {
+        OpenDayViewL();
+        }
+    }
+
+// end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/Readme.txt	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,5 @@
+In group folder do:
+bldmake bldfiles
+ABLD.bat export
+
+Then compile and run in emulator.
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/gfx/photo/application_bg.svg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="400px" version="1.1" width="720px">
+<rect height="500" width="720" x="0.061"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="pohja_x5F_valkoinen_5_" x1="180.0283" x2="180.0283" y1="439.0322" y2="9.765625e-004">
+<stop offset="0" style="stop-color:#FFFFFF"/>
+<stop offset="0.0074" style="stop-color:#F6F6F6"/>
+<stop offset="0.0477" style="stop-color:#C8C8C8"/>
+<stop offset="0.0931" style="stop-color:#9D9D9D"/>
+<stop offset="0.1419" style="stop-color:#777777"/>
+<stop offset="0.195" style="stop-color:#575757"/>
+<stop offset="0.2537" style="stop-color:#3B3B3B"/>
+<stop offset="0.32" style="stop-color:#252525"/>
+<stop offset="0.3974" style="stop-color:#141414"/>
+<stop offset="0.4931" style="stop-color:#090909"/>
+<stop offset="0.6274" style="stop-color:#020202"/>
+<stop offset="1" style="stop-color:#000000"/>
+</linearGradient>
+<rect fill="url(#pohja_x5F_valkoinen_5_)" fill-opacity="0.31" height="500" width="720" x="0.057"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="180" x2="180" y1="100" y2="62.3555">
+<stop offset="0" style="stop-color:#FFFFFF"/>
+<stop offset="1" style="stop-color:#333333"/>
+</linearGradient>
+<path d="M0.061,0H360v46.035c0,0-128.316,36.721-360,0L0.061,0z" fill="url(#SVGID_1_)" fill-opacity="0.37" stroke-opacity="0.37"/>
+<rect fill="#231F20" height="35.839" width="720" x="0.057" y="604.162"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="180.0293" x2="180.0293" y1="604.1621" y2="640.001">
+<stop offset="0" style="stop-color:#FFFFFF"/>
+<stop offset="0.0306" style="stop-color:#F2F2F2"/>
+<stop offset="0.1887" style="stop-color:#B3B3B3"/>
+<stop offset="0.345" style="stop-color:#7C7C7C"/>
+<stop offset="0.4957" style="stop-color:#505050"/>
+<stop offset="0.6396" style="stop-color:#2D2D2D"/>
+<stop offset="0.7751" style="stop-color:#141414"/>
+<stop offset="0.8989" style="stop-color:#050505"/>
+<stop offset="1" style="stop-color:#000000"/>
+</linearGradient>
+<rect fill="url(#SVGID_2_)" fill-opacity="0.17" height="35.839" stroke-opacity="0.17" width="359.943" x="0.057" y="604.162"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/gfx/photo/sticker_blue.svg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="99px" version="1.1" viewBox="-0.578 -0.106 100 99" width="100px" x="0px" y="0px">
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="-3.0488" x2="94.8593" y1="3.6475" y2="88.7577">
+<stop offset="0" style="stop-color:#C0E4F2"/>
+<stop offset="0.1634" style="stop-color:#B7E0F0"/>
+<stop offset="0.431" style="stop-color:#9ED5EB"/>
+<stop offset="0.7676" style="stop-color:#77C4E3"/>
+<stop offset="1" style="stop-color:#57B6DD"/>
+</linearGradient>
+<polygon fill="url(#SVGID_1_)" points="0,0.141 0,98.425 84.327,98.425 98.735,84.298 98.735,0 "/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="81.0381" x2="92.1221" y1="82.2402" y2="91.8755">
+<stop offset="0" style="stop-color:#C0E4F2"/>
+<stop offset="0.1634" style="stop-color:#B7E0F0"/>
+<stop offset="0.431" style="stop-color:#9ED5EB"/>
+<stop offset="0.7676" style="stop-color:#77C4E3"/>
+<stop offset="1" style="stop-color:#57B6DD"/>
+</linearGradient>
+<path d="M84.327,98.458c0,0,0.663-11.489-2.215-17.454c0,0,4.45,4.147,16.623,3.263L84.327,98.458z" fill="url(#SVGID_2_)"/>
+<path d="M91.359,10.637l2.457-3.829l-2.349-3.582h1.2l1.852,2.977l1.825-2.977h1.072l-2.368,3.626l2.471,3.785  h-1.207L94.359,7.47l-1.94,3.167H91.359z" fill="#991313"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/gfx/photo/sticker_green.svg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="100px" version="1.1" viewBox="-0.116 -0.791 99 100" width="99px" x="0px" y="0px">
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="-3.0488" x2="94.8593" y1="3.6479" y2="88.7582">
+<stop offset="0" style="stop-color:#C4D76B"/>
+<stop offset="0.2566" style="stop-color:#BDD062"/>
+<stop offset="0.6755" style="stop-color:#AABE49"/>
+<stop offset="1" style="stop-color:#97AC32"/>
+</linearGradient>
+<polygon fill="url(#SVGID_1_)" points="0,0.14 0,98.426 84.327,98.426 98.735,84.299 98.735,0 "/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="81.0381" x2="92.1214" y1="82.2725" y2="91.907">
+<stop offset="0" style="stop-color:#C4D76B"/>
+<stop offset="0.2566" style="stop-color:#BDD062"/>
+<stop offset="0.6755" style="stop-color:#AABE49"/>
+<stop offset="1" style="stop-color:#97AC32"/>
+</linearGradient>
+<path d="M84.327,98.49c0,0,0.664-11.49-2.215-17.454c0,0,4.449,4.146,16.623,3.263L84.327,98.49z" fill="url(#SVGID_2_)"/>
+<path d="M91.358,10.637l2.458-3.83l-2.349-3.581h1.199l1.852,2.976l1.826-2.976h1.072l-2.369,3.626l2.471,3.785  h-1.206L94.358,7.47l-1.939,3.167H91.358z" fill="#991313"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/gfx/photo/sticker_pink.svg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="99px" version="1.1" viewBox="-0.811 -0.148 100 99" width="100px" x="0px" y="0px">
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="-3.083" x2="94.8236" y1="3.5474" y2="88.6563">
+<stop offset="0" style="stop-color:#F990B1"/>
+<stop offset="0.6009" style="stop-color:#F987AB"/>
+<stop offset="1" style="stop-color:#F97EA5"/>
+</linearGradient>
+<polygon fill="url(#SVGID_1_)" points="0,0 0,98.284 84.327,98.284 98.735,84.156 98.735,0 "/>
+<path d="M91.359,10.595l2.457-3.829l-2.349-3.582h1.2L94.52,6.16l1.825-2.977h1.072L95.049,6.81l2.471,3.785h-1.207  l-1.953-3.167l-1.94,3.167H91.359z" fill="#991313"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="81.1279" x2="92.1626" y1="82.1699" y2="91.7622">
+<stop offset="0" style="stop-color:#F9ADB1"/>
+<stop offset="0.2382" style="stop-color:#F9A4AF"/>
+<stop offset="0.6272" style="stop-color:#F98BAB"/>
+<stop offset="1" style="stop-color:#F96EA5"/>
+</linearGradient>
+<path d="M84.357,98.296c0,0,0.654-11.317-2.225-17.282c0,0,4.45,4.049,16.623,3.163L84.357,98.296z" fill="url(#SVGID_2_)"/>
+<path d="M84.357,98.296c0,0,0.654-11.317-2.224-17.282c0,0,4.45,4.049,16.623,3.163L84.357,98.296z" fill="#FFFFFF" fill-opacity="0.1" stroke-opacity="0.1"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/gfx/photo/sticker_yellow.svg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="99px" version="1.1" viewBox="-0.245 -0.106 99 99" width="99px" x="0px" y="0px">
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="-3.0479" x2="94.8595" y1="3.6479" y2="88.7575">
+<stop offset="0" style="stop-color:#FFE35F"/>
+<stop offset="0.3603" style="stop-color:#F6DB5B"/>
+<stop offset="0.949" style="stop-color:#DDC552"/>
+<stop offset="1" style="stop-color:#DBC351"/>
+</linearGradient>
+<polygon fill="url(#SVGID_1_)" points="0,0.141 0,98.425 84.328,98.425 98.736,84.298 98.736,0 "/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="81.0386" x2="92.1219" y1="82.2715" y2="91.9061">
+<stop offset="0" style="stop-color:#FFE35F"/>
+<stop offset="0.3603" style="stop-color:#F6DB5B"/>
+<stop offset="0.949" style="stop-color:#DDC552"/>
+<stop offset="1" style="stop-color:#DBC351"/>
+</linearGradient>
+<path d="M84.328,98.489c0,0,0.663-11.489-2.215-17.454c0,0,4.449,4.147,16.623,3.263L84.328,98.489z" fill="url(#SVGID_2_)"/>
+<path d="M91.359,10.637l2.458-3.829l-2.349-3.582h1.199l1.852,2.977l1.826-2.977h1.072l-2.369,3.626l2.471,3.785  h-1.206L94.359,7.47l-1.939,3.167H91.359z" fill="#991313"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/group/AlfExStickers.loc	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 contains the localised strings for the AlfExStickers
+*
+*/
+
+
+
+//  LOCALISATION STRINGS
+
+/////////////////////////////////////////////////
+// Option-menu commands
+
+//d:Command in options-menu
+//d:Launches Sms Editor for replying the original message
+//l:list_single_pane_t1_cp2/opt3
+//
+#define alfexstickers_board_texture                   "application_bg.svg"
+#define alfexstickers_default_text 					  "Demoing: SVG used for the sticker and application backgrounds."
+#define alfexstickers_sticker_texture_blue            "sticker_blue.svg"
+#define alfexstickers_sticker_texture_green           "sticker_green.svg"
+#define alfexstickers_sticker_texture_pink            "sticker_pink.svg"
+#define alfexstickers_sticker_texture_yellow          "sticker_yellow.svg"
+
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/group/AlfExStickers.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 None
+#include <platform_paths.hrh> 
+#ifdef __UI_FRAMEWORKS_V2__
+TARGETPATH	/sys/bin
+#if defined(EKA2) || !defined(WINS)
+TARGET          alfexstickers.exe
+TARGETTYPE exe
+#else // EKA1 WINS
+TARGET          alfexstickers.app
+TARGETTYPE exedll
+deffile /epoc32/release/wins/alfexstickers.def
+#endif
+#else // __UI_FRAMEWORKS_V2__
+TARGET          alfexstickers.app
+TARGETPATH      /system/apps/alfexstickers
+TARGETTYPE app
+#endif
+
+UID               0x100039CE 0x20012480
+
+LANG              SC
+
+SOURCEPATH        ../src
+DOCUMENT		  Series_60_APP_ReadMe.txt
+SOURCE            alfexstickers.cpp
+SOURCE            alfexstickersapplication.cpp 
+SOURCE            alfexstickersappui.cpp
+SOURCE            alfexstickersdocument.cpp 
+SOURCE            alfexstickerscontrol.cpp
+SOURCE            alfexstickerlayout.cpp
+
+SOURCEPATH        ../group
+
+
+USERINCLUDE       ../inc 
+USERINCLUDE       ../sis 
+
+APP_LAYER_SYSTEMINCLUDE
+LIBRARY           euser.lib
+LIBRARY           apparc.lib
+LIBRARY           cone.lib 
+LIBRARY           eikcore.lib  
+LIBRARY           avkon.lib  
+LIBRARY           gdi.lib  
+LIBRARY           alfclient.lib
+LIBRARY           efsrv.lib  
+
+
+
+
+LIBRARY         CommonEngine.lib                // Symbian OS engine
+
+
+
+
+#ifdef __UI_FRAMEWORKS_V2__
+START RESOURCE	alfexstickers.RSS
+HEADER
+targetpath	/resource/apps
+lang		sc
+end
+#else
+RESOURCE        alfexstickers.RSS 
+#endif
+
+#ifdef __UI_FRAMEWORKS_V2__
+sourcepath		.
+START RESOURCE	alfexstickers_reg.rss
+#ifdef WINSCW
+TARGETPATH	/private/10003a3f/apps
+#else
+TARGETPATH	/private/10003a3f/import/apps
+#endif
+END
+   
+start resource alfexstickers_loc.RSS
+targetpath /resource/apps
+lang sc
+end
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/group/AlfExStickers.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HELL
+
+#include <eikon.rh>
+#include <eikon.rsg>
+#include <avkon.rh>
+#include <avkon.rsg>
+
+#include "alfexstickers.hrh"
+#include "alfexstickers.loc"
+
+// ---------------------------------------------------------
+//   
+//    Define the resource file signature 
+//    This resource should be empty.
+//
+// ---------------------------------------------------------
+//
+RESOURCE RSS_SIGNATURE { }
+
+// ---------------------------------------------------------
+//   
+//    Default Document Name
+//
+// ---------------------------------------------------------
+//
+RESOURCE TBUF r_default_document_name { buf=""; }
+
+// ---------------------------------------------------------
+//   
+//    Define default menu and CBA key.
+//
+// ---------------------------------------------------------
+//
+RESOURCE EIK_APP_INFO
+    {
+    //menubar = r_AlfExStickers_menubar;
+    //cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
+    }
+
+
+// ---------------------------------------------------------
+//   
+//   r_AlfExStickers_menubar
+//   Menubar for AlfExStickers example
+//
+// ---------------------------------------------------------
+//
+/*
+RESOURCE MENU_BAR r_AlfExStickers_menubar
+    {
+     titles =
+        {
+        MENU_TITLE {menu_pane = r_AlfExStickers_menu;}
+        };
+    }
+
+*/
+
+// ---------------------------------------------------------
+//   
+//   r_AlfExStickers_menu
+//   Menu for "Options"
+//
+// ---------------------------------------------------------
+//
+/*
+RESOURCE MENU_PANE r_AlfExStickers_menu
+    {
+   
+      items = 
+        {
+        MENU_ITEM {command = EAlfExStickersCommand1;  txt = "Say Hey!";},
+        MENU_ITEM {command = EAknSoftkeyExit;   txt = "Exit";}
+        };
+        
+    }
+*/
+
+RESOURCE TBUF       r_alfexstickers_board_texture              { buf = alfexstickers_board_texture; }
+RESOURCE TBUF       r_alfexstickers_default_text               { buf = alfexstickers_default_text; }
+
+// Sticker bitmap names must be kept last. Extra sticker bitmaps should added below this line.
+RESOURCE TBUF       r_alfexstickers_sticker_texture_blue               { buf = alfexstickers_sticker_texture_blue; }
+RESOURCE TBUF       r_alfexstickers_sticker_texture_green              { buf = alfexstickers_sticker_texture_green; }
+RESOURCE TBUF       r_alfexstickers_sticker_texture_pink               { buf = alfexstickers_sticker_texture_pink; }
+RESOURCE TBUF       r_alfexstickers_sticker_texture_yellow             { buf = alfexstickers_sticker_texture_yellow; }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/group/AlfExStickers_loc.rls	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,22 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+*
+*/
+
+
+//rls_string STRING_r_AlfExStickers_icon_path "z:\\resource\\apps\\AlfExStickersicon.mbm"
+rls_string STRING_short_caption "AlfExStickers"
+rls_string STRING_r_AlfExStickers_caption "AlfExStickers"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/group/AlfExStickers_loc.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <appinfo.rh>
+#include "AlfExStickers_loc.rls"
+
+RESOURCE LOCALISABLE_APP_INFO
+	{
+	short_caption = STRING_short_caption;
+	caption_and_icon =
+		{
+		CAPTION_AND_ICON_INFO 
+			{
+			caption=STRING_r_AlfExStickers_caption;
+			//number_of_icons=3;
+			//icon_file=STRING_r_AlfExStickers_icon_path;
+			}
+		};
+	}
+
+ 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/group/AlfExStickers_reg.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+*
+*/
+
+
+//AlfExStickers application's registration resource file 
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x20012480
+
+RESOURCE APP_REGISTRATION_INFO 
+	{
+	app_file="AlfExStickers";
+	//
+	localisable_resource_file="\\resource\\apps\\AlfExStickers_loc";
+	//
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* 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: 
+*
+*/
+
+
+PRJ_MMPFILES
+
+AlfExStickers.mmp
+
+
+PRJ_EXPORTS
+
+../gfx/photo/application_bg.svg         /epoc32/winscw/c/private/20012480/application_bg.svg
+../gfx/photo/sticker_blue.svg  /epoc32/winscw/c/private/20012480/sticker_blue.svg
+../gfx/photo/sticker_green.svg  /epoc32/winscw/c/private/20012480/sticker_green.svg
+../gfx/photo/sticker_pink.svg  /epoc32/winscw/c/private/20012480/sticker_pink.svg
+../gfx/photo/sticker_yellow.svg  /epoc32/winscw/c/private/20012480/sticker_yellow.svg
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/inc/AlfExStickers.pan	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __ALFEXSTICKERS_PAN__
+#define __ALFEXSTICKERS_PAN__
+
+/** AlfExStickers application panic codes */
+enum TAlfExStickersPanics 
+    {
+    EAlfExStickersBasicUi = 1
+    // add further panics here
+    };
+
+inline void Panic(TAlfExStickersPanics aReason)
+    {
+	_LIT(applicationName,"AlfExStickers");
+    User::Panic(applicationName, aReason);
+    }
+
+#endif // __ALFEXSTICKERS_PAN__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/inc/AlfExStickersControl.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,216 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 C_ALFEXSTICKERSCONTROL_H
+#define C_ALFEXSTICKERSCONTROL_H
+
+
+/* Includes */
+
+#include <alf/alfcontrol.h>
+
+//TEMP
+#include <alf/alfdecklayout.h>
+
+
+/* Forward declarations. */
+
+class CAlfViewportLayout;
+class CAlfExStickerLayout;
+class CAlfImageLoaderUtil;
+
+
+/* Constants */
+
+//Number of example stickers
+const TInt KStickerCount = 2;
+
+/** 
+ * @class CAlfExStickersControl
+ * @discussion Control class for the AlfExSticker application. Handles creation of application elements
+ * like viewport and sticker text visuals. Also handles user interaction with application elements.
+ */
+class CAlfExStickersControl : public CAlfControl
+    {
+public:
+
+	/* Constructors and destructor. */
+	
+	/**
+	 * @function NewL
+	 * @discussion Constructs a new CAlfExStickersControl class instance. A static factory method.
+	 * @param aEnv	UI Accelerator Toolkit environment object.
+	 * @param aFs	A handle to a file server session.
+	 * @result Control for the AlfExStickers application
+	 */
+	static CAlfExStickersControl* NewL(CAlfEnv& aEnv, RFs* aFs);
+	
+	/**
+	 * @function NewLC
+	 * @discussion Constructs a new CAlfExStickersControl class instance. A static factory method.
+	 * @param aEnv	UI Accelerator Toolkit environment object.
+	 * @param aFs	A handle to a file server session.
+	 * @result Control for the AlfExStickers application
+	 */
+    static CAlfExStickersControl* NewLC(CAlfEnv& aEnv, RFs* aFs);
+    
+    /**
+     * @function ~CAlfExStickersControl
+     * @discussion 	Destructor
+     */
+    virtual ~CAlfExStickersControl();
+    
+
+    /* Methods. */
+    
+    /**
+     * @function OfferEventL
+     * @discussion Handles events from the framework
+     * @param aEvent Catched event
+     * @result Success or failure
+     */    
+    virtual TBool OfferEventL(const TAlfEvent& aEvent);
+    
+    /**
+     * @function GetControl
+     * @discussion Provides Control to stickers
+     * @result CAlfControl to child visuals
+     */    
+    CAlfControl* GetControl();
+    
+    //Control for the visuals
+    CAlfControl* iControl;
+    
+    
+private:
+	
+	/* Constructors*/
+
+	/**
+	 * Constructs an instance of CAlfExStickersControl.
+	 * @note Protected because this constructor only needs to be called by 
+	 * derived classes. Use the provided static factory methods instead.
+	 * @see NewL()
+	 * @see NewLC()
+	 */
+    CAlfExStickersControl();
+    
+    /**
+     * @function ConstructL
+     * @discussion Second phase constructor
+	 * @param aEnv	UI Accelerator Toolkit environment object.
+	 * @param aFs	A handle to a file server session.
+     */
+    void ConstructL(CAlfEnv& aEnv, RFs* aFs);
+    
+    
+    /* Methods. */
+    
+    /**
+     * @function CreateViewportL
+     * @discussion Creates Viewport layout to the application to act as the root layout.
+     * Also function is used to set the size for the viewport and to enable scrolling, ie.
+     * dragging interaction with the background
+     */
+    void CreateViewportL();
+    
+    /**
+     * @function SetTextureManagerL
+     * @discussion The function is used to find out path to applications graphical
+     * resources and giving the path to Texture Manager. 
+     */
+    void SetTextureManagerL();
+    
+    /**
+     * @function LoadBackgroundImageL
+     * @discussion Function uses Texture Manager to load board (application background)
+     * texture from a png-file. Then creates new image visual to cover application background and
+     * adds the loaded board texture in the visual.
+     */
+    void LoadBackgroundImageL();
+    
+    /**
+     * @function CreateSVGTextureL
+     * @discussion Function used to create SVG texture from SVG file
+     * @param aFileName SVG file filename.
+     * @param aSize Texture size
+     * @param aImageLoaderUtil Image loader utility.
+     * @result Reference to created texture. This texture is owned by texture manager.
+     */
+    CAlfTexture& CreateSVGTextureL(const TFileName& aFileName, TSize& aSize, CAlfImageLoaderUtil* aImageLoaderUtil);
+    
+    /**
+     * @function CreateStickersL
+     * @discussion Function used to create several stickers and applying the needed
+     * changes into the visuals.
+     * 
+     * Easiest way to create text visual would be to use:
+     * CAlfTextVisual* visual = CAlfTextVisual::AddNewL(*this, iPlainLayout);
+     * We have however created new class for the text visual (alfexsticker).
+     */
+    void CreateStickersL();
+
+    /**
+     * @function LoadStickerImageL
+     * @discussion Function used to load sticker background image from SVG file.
+     * @param aIndex An index number of sticker where background is loaded.
+     */
+    void LoadStickerImageL(TInt aIndex);
+    
+    /* Member variables */
+    
+    //UI Accelerator Toolkit environment object
+    CAlfEnv* iEnv;
+    
+    //Handle to file server session
+    RFs* iFs;
+
+    //Texture path
+    TFileName iPrivateFolderPath;
+    
+    //Layouts && Co
+    CAlfViewportLayout* iViewPort;
+    CAlfLayout* iPlainLayout;
+    
+    //Application view and viewport sizes
+    TSize iVirtualSize;
+    TSize iLayoutsize;
+    
+    //Sticker array
+    CAlfExStickerLayout* iStickerArray[KStickerCount];
+    
+    //Default timed values
+    TAlfTimedValue x;
+    TAlfTimedValue y;
+    
+    //Member data needed to handle interaction, like drag and drop
+    CAlfVisual* iOnVisual;
+    CAlfExStickerLayout* iSelectedDeck;
+    TBool iDraggingVisual;
+    TPoint iStartVisualPos;    // Original position of dragged visual.
+    TPoint iStartDisplayPoint; // Point of display for Pointer Down.
+    TAlfRealPoint iDraggedPosition;
+    TAlfRealPoint iViewPos;
+    TBool iHasBeenDragged;
+    
+    //Image loader array.
+    RArray<CAlfImageLoaderUtil*> iImageLoaderUtilArray;
+    };
+
+#endif // C_ALFEXSTICKERSCONTROL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/inc/alfexstickerlayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 C_ALFEXSTICKER_H
+#define C_ALFEXSTICKER_H
+
+
+/* Includes */
+
+#include <alf/alfcontrol.h>
+#include "alfexstickerscontrol.h"
+
+
+/* Forward declarations. */
+
+
+/* Constants */
+const TInt KStickerHeight = 300;
+const TInt KStickerWidth = 300;
+
+
+/** 
+ * @class CAlfExStickerLayout
+ * @discussion Wrapper class for the deck layout, text visuals and some brushes. 
+ * Is used to create Stickers from the combination of those.
+ * Handles placement, content and outlook of the sticker text visuals. 
+ * Should probable rename the class for clarity
+ */
+class CAlfExStickerLayout : public CAlfDeckLayout
+    {
+public:
+
+	/* Constructors and destructor. */
+	
+	/**
+	 * @function NewL
+	 * @discussion Constructs a new CAlfExStickerLayout class instance. A static factory method.
+	 * @param aControl Control class for the AlfExSticker application.
+	 * @param aEnv	UI Accelerator Toolkit environment object.
+	 * @result Instance of AlfExSticker
+	 */
+	static CAlfExStickerLayout* NewL(CAlfExStickersControl& aControl, CAlfEnv& aEnv);
+    
+    /**
+     * @function ~CAlfExStickerLayout
+     * @discussion 	Destructor
+  	*/
+    virtual ~CAlfExStickerLayout();
+    
+    
+    /* Methods. */
+    
+	/**
+     * @function SetStickerPlace
+     * @discussion Used to place sticker on the layout.
+     * @todo Maybe make the placement more dynamic
+    */ 
+    void SetStickerPlaceL(CAlfExStickersControl* aControl);
+    
+    /**
+     * @function SetStickerTextContentL
+     * @discussion Used to set textual content of the sticker, 
+     * or more specific content of the included text visual.
+     * Also configures font, color and placement of the textual content
+     * @todo Maybe make the content input more dynamic
+    */ 
+    void SetStickerTextContentL();
+    
+    /**
+     * @function SetStickerDropShadowBrushL
+     * @discussion Enables brushes for sticker and then add drop shadow brush for the sticker.
+     * @todo Add drop shadow also in to other sides in lesser quanity, that way stickers are more
+     * easile recognizable.
+    */ 
+    void SetStickerDropShadowBrushL();
+    
+    /**
+     * @function SetStickerImageBrushL
+     * @discussion Add sticker background image by using an image brush.
+     * @note EnableBrushes() must be called before using any brushes, we did this already in
+     * SetStickerDropShadowBrushL().
+     * @todo Sticker needs to implement changing backgrounds in the future.
+     * @param aTexture Texture that is placed for image brush.
+    */ 
+    void SetStickerImageBrushL(CAlfTexture& aTexture);
+    
+    /**
+     * @function GetVisual
+     * @discussion Returns the text visual used in sticker.
+     * @result Returns text visual
+    */ 
+    CAlfVisual* GetVisual();
+    
+    /**
+     * @function ChangeStickerSize
+     * @discussion Scales text visual and resizes the deck layout
+     * Is called when user taps on a sticker to zoom in or out.
+    */ 
+    void ChangeStickerSizeL();
+
+    
+private:
+
+	/* Constructors and destructor. */
+
+	/**
+	 * Constructs an instance of CAlfExStickerLayout.
+	 * @note Protected because this constructor only needs to be called by 
+	 * derived classes. Use the provided static factory methods instead.
+	 * @see NewL()
+	 * @see NewLC()
+	 */
+    CAlfExStickerLayout();
+    
+    /**
+     * @function ConstructL
+     * @discussion Second phase constructor
+ 	 * @param aControl Control class for the AlfExSticker application.
+	 * @param aEnv	UI Accelerator Toolkit environment object.
+     */
+    void ConstructL(CAlfExStickersControl& aControl, CAlfEnv& aEnv);
+    
+    
+    /* Member variables */
+    
+    //UI Accelerator Toolkit environment object
+    CAlfEnv* iEnv;
+    
+    //AlfExSticker Control
+    CAlfExStickersControl* iControl;
+    
+    //Text visual
+    CAlfTextVisual* iTextVisual;
+    
+    //Helps to determine current size/scale
+    TBool iStickerIsLarge;
+
+    };
+
+#endif // C_ALFEXSTICKER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/inc/alfexstickers.hrh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __AlfExStickers_HRH__
+#define __AlfExStickers_HRH__
+
+/* AlfExStickers enumerate command codes */
+/*
+enum TAlfExStickersIds
+    {
+    EAlfExStickersCommand1 = 1  // start value must not be 0
+    };
+*/
+
+#endif // __AlfExStickers_HRH__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/inc/alfexstickersapplication.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __ALFEXSTICKERS_APPLICATION_H__
+#define __ALFEXSTICKERS_APPLICATION_H__
+
+#include <aknapp.h>
+
+/* Forward declarations. */
+
+
+/** 
+ * @class CAlfExStickersApplication
+ * 
+ * @discussion An instance of CAlfExStickersApplication is the application part of the AVKON
+ * application framework for the AlfExStickers example application
+ */
+class CAlfExStickersApplication : public CAknApplication
+    {
+public:  // from CAknApplication
+
+	/* 
+	 * @function AppDllUid
+	 * 
+	 * @discussion Returns the application DLL UID value
+	 * @result the UID of this Application/Dll
+	 */
+    TUid AppDllUid() const;
+
+protected: // from CAknApplication
+
+	/** 
+	 * @function CreateDocumentL
+	 * 
+	 * @discussion Create a CApaDocument object and return a pointer to it
+	 * @result a pointer to the created document
+	 */
+    CApaDocument* CreateDocumentL();
+    };
+
+#endif // __ALFEXSTICKERS_APPLICATION_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/inc/alfexstickersappui.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __ALFEXSTICKERS_APPUI_H__
+#define __ALFEXSTICKERS_APPUI_H__
+
+#include <aknappui.h>
+
+/* Forward declarations. */
+class CAlfEnv;
+
+/** 
+ * @class CAlfExStickersAppUi
+ * 
+ * @discussion An instance of class CAlfExStickersAppUi is the UserInterface part of the AVKON
+ * application framework for the AlfExStickers example application
+ */
+class CAlfExStickersAppUi : public CAknAppUi
+    {
+public:
+	/**
+	 * @function ConstructL
+	 * 
+	 * @discussion Perform the second phase construction of a CAlfExStickersAppUi object
+	 * this needs to be public due to the way the framework constructs the AppUi 
+	 */
+    void ConstructL();
+
+
+    /**
+     * @function CAlfExStickersAppUi
+     * 
+     * @discussion Perform the first phase of two phase construction.
+     * This needs to be public due to the way the framework constructs the AppUi 
+     */
+    CAlfExStickersAppUi();
+
+    /**
+     * @function ~CAlfExStickersAppUi
+     * 
+     * @discussion Destroy the object and release all memory objects
+     */
+    ~CAlfExStickersAppUi();
+
+
+public: // from CAknAppUi
+	/**
+	 * @function HandleCommandL
+	 * 
+	 * @discussion Handle user menu selections.
+	 * @param aCommand the enumerated code for the option selected
+	 */
+    void HandleCommandL(TInt aCommand);
+    
+    /*
+     * @function HandleResourceChangeL
+     * 
+     * @discussion Handles layout changes.
+     */
+    virtual void HandleResourceChangeL( TInt aType );
+    
+    /*
+     * @function HandleWsEventL
+     * 
+     * @discussion Handle releasing/restoring of bitmaps, textures etc.
+     */
+    void HandleWsEventL(const TWsEvent &aEvent, CCoeControl* aDestination);
+
+private:
+    CAlfEnv* iEnv;
+    // file server session handle
+    };
+
+
+#endif // __ALFEXSTICKERS_APPUI_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/inc/alfexstickersdocument.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __ALFEXSTICKERS_DOCUMENT_H__
+#define __ALFEXSTICKERS_DOCUMENT_H__
+
+
+#include <akndoc.h>
+
+/* Forward declarations. */
+class CAlfExStickersAppUi;
+class CEikApplication;
+
+
+/** 
+ * @class CAlfExStickersDocument
+  
+ * @discussion An instance of class CAlfExStickersDocument is the Document part of the AVKON
+ * application framework for the AlfExStickers example application
+ */
+class CAlfExStickersDocument : public CAknDocument
+    {
+public:
+
+	/**
+	 * @function NewL 
+	 * @discussion Construct a CAlfExStickersDocument for the AVKON application aApp 
+	 * using two phase construction, and return a pointer to the created object
+	 * @param aApp application creating this document
+	 * @result a pointer to the created instance of CAlfExStickersDocument
+	 */
+    static CAlfExStickersDocument* NewL(CEikApplication& aApp);
+    
+    /**
+     * @function NewLC 
+     * @discussion Construct a CAlfExStickersDocument for the AVKON application aApp 
+     * using two phase construction, and return a pointer to the created object
+     * @param aApp application creating this document
+     * @result a pointer to the created instance of CAlfExStickersDocument
+     */
+    static CAlfExStickersDocument* NewLC(CEikApplication& aApp);
+
+    /**
+     * @function ~CAlfExStickersDocument 
+     * @discussion Destroy the object and release all memory objects
+     */
+    ~CAlfExStickersDocument();
+
+public: // from CAknDocument
+	/**
+	 * @function CreateAppUiL 
+	 * @discussion Create a CAlfExStickersAppUi object and return a pointer to it
+	 * @result a pointer to the created instance of the AppUi created
+	 */
+    CEikAppUi* CreateAppUiL();
+
+private:
+
+	/**
+	 * @function ConstructL 
+	 * @discussion Perform the second phase construction of a CAlfExStickersDocument object
+	 */
+    void ConstructL();
+    
+    /**
+     * @function CAlfExStickersDocument
+     * @discussion Perform the first phase of two phase construction 
+     * @param aApp application creating this document
+     */
+    CAlfExStickersDocument(CEikApplication& aApp);
+
+    };
+
+
+#endif // __ALFEXSTICKERS_DOCUMENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/sis/alfexstickers.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,40 @@
+;
+; 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: 
+;
+&EN
+
+; standard SIS file header
+#{"AlfExStickers"},(0x20012480),1,0,0
+
+;Supports Series 60 v 3.0
+(0x101F7961), 0, 0, 0, {"Series60ProductID"}
+
+;Localized Vendor Name
+%{"My Test EN"}
+
+;Unique Vendor name
+:"Vendor"
+
+; Files to copy
+"\epoc32\release\armv5\udeb\AlfExStickers.exe"-"!:\sys\bin\AlfExStickers.exe"
+"\epoc32\data\z\private\10003a3f\apps\AlfExStickers_reg.rsc"-"!:\private\10003a3f\import\apps\AlfExStickers_reg.rsc"
+"\epoc32\data\z\resource\apps\AlfExStickers_loc.Rsc"-"!:\resource\apps\AlfExStickers_loc.Rsc"
+"\epoc32\data\z\resource\apps\AlfExStickers.Rsc"-"!:\resource\apps\AlfExStickers.Rsc"
+"..\gfx\photo\application_bg.svg"-"c:\Private\20012480\application_bg.svg"
+"..\gfx\photo\sticker_blue.svg"-"c:\Private\20012480\sticker_blue.svg"
+"..\gfx\photo\sticker_green.svg"-"c:\Private\20012480\sticker_green.svg"
+"..\gfx\photo\sticker_pink.svg"-"c:\Private\20012480\sticker_pink.svg"
+"..\gfx\photo\sticker_yellow.svg"-"c:\Private\20012480\sticker_yellow.svg"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/sis/sisTool.pl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,159 @@
+#
+# 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: 
+#
+
+sub updateVersion ;
+sub signSis ;
+
+my @args = @ARGV;
+# signing related variables
+my $certPath = "\\s60_RnD\\RD_RootCA";
+my $certificate = "rd.cer";
+my $key = "rd-key.pem";
+my $version = "10.1";
+my $packageFile = undef;
+my $sisFile = undef;
+
+# path to copy signed sis (if optional -c argument used)
+my $copyPath = undef;
+
+# 
+my $updateDllVersion = 0;
+    
+# print help if needed
+if ( scalar(@args) == 0 || 
+     $args[0] =~ /-[h,\?]/i )
+    {
+print <<HELP;
+
+-------------------------------------------------------------------------
+======= Script for making and signing an installation (.sis) file =======
+
+Usage: sisTool <package-file-w/o-ext> [-d<version>] [-c<destination-path>] 
+               [-s<stub-package-file-w/o-ext>]
+
+ -d changes minor DLL version number - needed when eclipsing DLLs in ROM.
+ -c copies target file to specific destination
+ -s also creates stub SIS. File name is not needed if it same as base file
+    name followed by "_stub" (e.g. pkg files for eclipsing SIS and stub SIS
+    are component.pkg and component_stub.pkg respectively).
+
+Examples:
+=========
+sisTool myPackage -d2
+
+  Creates and signs(* 'myPackage.sis' from 'myPackage.pkg'.
+  Before creating sis file myPackage.pkg is searched for DLLs
+  and their version numbers are changed to 10.2 (i.e. minor
+  version is changed - default major version number is 10).
+
+sisTool myPackage -d -s
+  
+  Same as first example but uses default minor version number (=1)
+  for DLLs, and creates stub sis with name myPackage_stub.sis.
+
+                                                     
+(* Uses R&D certificate 'rd.cer' from \\S60\\s60_RnD\\RD_RootCA
+HELP
+    exit;
+    }
+$packageFile = shift;
+
+foreach ( @args ) {
+    # check if dll version number should be updated
+    if ( /-d(\d+)?\b/ ) {
+        $version = $1 ;
+        $version = 1 if ( not defined $version );            
+        $updateDllVersion = 1;
+        }
+    # check if stub SIS should be created
+    elsif ( /-s((\w|\.|\\|_|:|-)+)?/ )
+        {
+        my $stubPkgFile = "${packageFile}_stub.pkg";
+        if ( defined $1 ) {
+            # user defined stub
+            $stubPkgFile = $1; 
+            $stubPkgFile = $stubPkgFile . ".pkg" if $stubPkgFile !~ /\.pkg$/; 
+            }        
+        my $cmd = "makesis -s $stubPkgFile";
+        print "\n";
+        system "$cmd";
+        print "\n";
+        }
+    $copyPath = $1 if /-c(\S+)/;
+    }
+
+if ( defined($packageFile) ) {
+    ( -e "$packageFile.pkg" ) or die "package file '$packageFile' not found.\n";
+    
+    # Update version number of DLLs listed in pkg-file.
+    updateVersion if $updateDllVersion;
+
+    my $cmd = "makesis $packageFile\.pkg\n";
+   
+    if ( !defined( $sisFile ) ) {
+        $sisFile = "$packageFile.sis";
+        }
+    #################
+    # Do create sis #
+    #################
+    
+    my $err = system "$cmd";
+    die "\nFailed making sis file $!" if $err;
+    signSis;
+    if ( defined( $copyPath ) )
+        {
+        system "xcopy $sisFile $copyPath 2>&1";
+        }
+    }
+
+sub signSis {
+    # sign a sis file
+    my $signedFile = "${sisFile}S\.sis";
+    ( -e "$certPath\\$certificate" ) or die <<NOCERT;
+    
+    
+Certificate could not be found from $certPath\\$certificate
+Check and modifiy the path in line ~17 in the script if needed.
+NOCERT
+
+    my $cmd = "signsis -s $packageFile.sis $signedFile $certPath\\$certificate $certPath\\$key";        
+    if ( system ( "$cmd" ) == 0 )
+        {        
+        # delete original unsigned sis file
+        system "del $sisFile";
+        system "ren $signedFile $sisFile";
+        print "\nSigned with R&D certificate\n";
+        if ( defined ( $copyPath ) ) {
+            # copy signed sis to specified directory
+            system "xcopy $sisFile $copyPath";
+            }
+        }        
+    }
+    
+
+sub updateVersion {
+    open PACKAGE, "<$packageFile.pkg";    
+    foreach ( <PACKAGE> )
+        {
+        if ( /\"(.*?\.dll)\"/i ) 
+            {                        
+            system "elftran -version 10\.$version $1";
+            system "elftran -compressionmethod bytepair $1";
+            print STDOUT "\nUpdated version number of\n$1 to 10.$version\n";
+            }
+        }
+    close PACKAGE;  
+    }    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/src/AlfExStickersControl.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,368 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   
+*
+*/
+
+
+
+/* Includes */
+#include <eikenv.h>
+#include <e32cmn.h>
+
+//Unsorted
+#include <alf/alfenv.h> 
+#include <alf/alftexture.h>
+#include <alf/alfdisplay.h>
+#include <alf/alfevent.h>
+#include <alf/alfimageloaderutil.h>
+#include <aknnotewrappers.h> 
+#include <aknutils.h>
+#include <StringLoader.h>
+
+//Layouts
+#include <alf/alfgridlayout.h>
+#include <alf/alfviewportlayout.h>
+
+//Visuals
+#include <alf/alftextvisual.h>
+#include <alf/alfimagevisual.h>
+#include <alf/alfvisual.h>
+
+//Brushes
+#include <alf/alfborderbrush.h>
+#include <alf/alfimagebrush.h>
+#include <alf/alfdropshadowbrush.h>
+#include <alf/alfbrush.h>
+#include <alf/alfbrusharray.h>
+	
+//Own
+#include "alfexstickerscontrol.h"
+#include "alfexstickerlayout.h"
+#include <alfexstickers.rsg>
+
+//TEMP
+#include <alf/alfroster.h>
+#include <alf/alftransformation.h>
+#include <alf/alfdecklayout.h>
+
+//Literals
+
+//Constants
+const TInt KStickerBitmapCount = 4;
+
+CAlfExStickersControl* CAlfExStickersControl::NewL(CAlfEnv& aEnv, RFs* aFs)
+	{
+	CAlfExStickersControl* self = new (ELeave) CAlfExStickersControl;
+	CleanupStack::PushL(self);
+	self->ConstructL(aEnv, aFs);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+
+CAlfExStickersControl* CAlfExStickersControl::NewLC(CAlfEnv& aEnv, RFs* aFs)
+    {
+    CAlfExStickersControl* self = new (ELeave) CAlfExStickersControl;
+    CleanupStack::PushL(self);
+    self->ConstructL(aEnv, aFs);
+    return self;
+    }
+
+
+CAlfExStickersControl::CAlfExStickersControl(): iDraggingVisual(EFalse)
+    {
+    }
+
+
+void CAlfExStickersControl::ConstructL(CAlfEnv& aEnv, RFs* aFs)
+    {
+    //Set UI Accelerator Toolkit environment object into iEnv class variable
+    iEnv = &aEnv;
+    //Set handle to file server session
+    iFs=aFs;
+        
+    //Create new control for visuals
+    CAlfControl::ConstructL(*iEnv);
+    
+    //Get the size of the main pane, save it to iLayoutsize
+    AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, iLayoutsize);    
+
+    //Assign size for the applicaton, Screen height by Screen width*2
+    iVirtualSize.iWidth  = iLayoutsize.iWidth*2;
+    iVirtualSize.iHeight = iLayoutsize.iHeight;
+
+    //Create a viewPort layout to act as the root layout visual.
+    CreateViewportL();
+    
+    //Initialize the texture manager
+    SetTextureManagerL();
+    
+    //Set image for the application background
+    LoadBackgroundImageL();
+    
+    //Create iPlainLayout and add it to the iViewPort
+    iPlainLayout = CAlfLayout::AddNewL(*this,iViewPort);
+ 
+    //Create the example stickers
+    CreateStickersL();
+    
+}
+    
+
+CAlfExStickersControl::~CAlfExStickersControl()
+    {
+    for(TInt current=0;current < iImageLoaderUtilArray.Count();current++)
+        {
+        delete iImageLoaderUtilArray[current];
+        }
+    iImageLoaderUtilArray.Close();
+    }
+    
+
+TBool CAlfExStickersControl::OfferEventL(const TAlfEvent& aEvent)
+    {
+    //petjarve:This needs to be cleaned up
+    TBool visual = EFalse;
+    
+    //Different user input cases
+    //If the event was pointer down event
+    if (aEvent.IsPointerEvent() && aEvent.PointerDown())
+        {
+        iHasBeenDragged = EFalse;
+        CAlfVisual* onVisual = aEvent.Visual();
+        
+        //Find out if sticker (text visual) was interacted
+        for (int j = 0; j < KStickerCount; ++j) 
+        	{
+        	if (aEvent.Visual() == iStickerArray[j]->GetVisual())
+        		{
+        		iSelectedDeck = iStickerArray[j];
+        		visual = ETrue;
+        		}
+        	}
+        
+        //Interaction was on a visual
+        if (visual)
+            {
+            iOnVisual = onVisual;
+            iPlainLayout->MoveVisualToFront(*iSelectedDeck);
+
+            iDraggingVisual = ETrue;
+            }
+        
+        //Interaction was on background -> move it
+        else
+            {
+            ;
+            }   
+            
+        iStartDisplayPoint = aEvent.PointerEvent().iPosition;
+        iStartVisualPos = onVisual->Pos().ValueNow();
+            
+        Display()->Roster().AddPointerEventObserver(EAlfPointerEventReportDrag, *this);
+                
+        return ETrue;    
+        }
+    
+    //If the event was a "drag" event
+    else if(aEvent.IsPointerEvent() && aEvent.PointerEvent().iType == TPointerEvent::EDrag)
+        {
+        iHasBeenDragged = ETrue;
+        //If we are dragging sticker
+        if (iDraggingVisual && iSelectedDeck)
+            {
+            iDraggedPosition = 
+                aEvent.PointerEvent().iPosition
+                - iStartDisplayPoint+iViewPos;
+            
+            iSelectedDeck->SetPos(iDraggedPosition, 50);
+            }
+
+        //Else we are dragging the background
+        else
+            {
+            TAlfRealPoint temp = (iStartDisplayPoint-(aEvent.PointerEvent().iPosition));
+
+            if(temp.iX <0) temp.iX=0;
+            if(temp.iY <0) temp.iY=0;
+            
+            if (temp.iY  > iVirtualSize.iHeight - iLayoutsize.iHeight)
+	            {
+	            temp.iY =iVirtualSize.iHeight- iLayoutsize.iHeight ;
+	            }
+	            
+	        if (temp.iX  > iVirtualSize.iWidth - iLayoutsize.iWidth)
+	            {
+	            temp.iX=iVirtualSize.iWidth- iLayoutsize.iWidth ;
+	            }    
+            
+            iViewPos=temp;
+            iViewPort->SetViewportPos(iViewPos, 0);   
+            }    
+        
+        return ETrue;
+        }
+
+    //If the event was simple tap event, ie. not a drag
+    else if (aEvent.PointerUp() && iHasBeenDragged == EFalse)
+    	{
+    	//petjarve: Possibly unneeded check
+    	if (iStartDisplayPoint == aEvent.PointerEvent().iPosition && iSelectedDeck)
+    		{
+    		iSelectedDeck->ChangeStickerSizeL();
+    		
+	    	return ETrue;
+    		}
+    	return ETrue;
+    	}
+    
+    else if( aEvent.PointerUp() )
+        {
+        Display()->Roster().RemovePointerEventObserver(EAlfPointerEventReportDrag, *this);
+        iDraggingVisual = EFalse;
+        return ETrue;
+        }
+        
+    return EFalse;
+    }
+
+
+void CAlfExStickersControl::CreateViewportL()
+	{
+	//Create a viewPort layout to act as the root layout visual.
+    iViewPort = CAlfViewportLayout::AddNewL(*this); 
+
+    //Set inital viewport position value to top left corner
+    iViewPos = TAlfRealPoint(0, 0);
+    
+    //Set Viewport sizes, both virtual and non virtual and position (top left corner)
+    iViewPort->SetVirtualSize(TAlfRealSize(iVirtualSize), 0);
+    iViewPort->SetViewportSize(TAlfRealSize(iLayoutsize), 0);
+    iViewPort->SetViewportPos(iViewPos, 0);
+    
+    //Enable scrolling of the Viewport
+    iViewPort->EnableScrollingL();
+
+	}
+
+
+void CAlfExStickersControl::SetTextureManagerL()
+	{
+	//First create path to our textures
+    User::LeaveIfError( iFs->CreatePrivatePath(EDriveC));
+	TChar driveChar;
+    iFs->DriveToChar( EDriveC,driveChar);
+    TDriveName driveName;
+    driveName.Append(driveChar);
+    driveName.Append(KDriveDelimiter);
+       
+    iFs->PrivatePath(iPrivateFolderPath);
+    iPrivateFolderPath.Insert(0,driveName);
+
+    //Set texture manager path
+    Env().TextureManager().SetImagePathL(iPrivateFolderPath);
+	}
+
+
+void CAlfExStickersControl::LoadBackgroundImageL()
+	{
+    //Experimental background image for the viewport
+	//Load the board texture
+	TFileName filename;
+	filename.Append(iPrivateFolderPath);
+	filename.Append(*StringLoader::LoadLC(R_ALFEXSTICKERS_BOARD_TEXTURE));
+	CleanupStack::PopAndDestroy(1);
+	
+	//Create image loader util. This object must exist through life time of texture. 
+	CAlfImageLoaderUtil* imageLoaderUtil = new(ELeave) CAlfImageLoaderUtil;
+	iImageLoaderUtilArray.AppendL(imageLoaderUtil); 
+	
+	//Create board texture from SVG file.
+	CAlfTexture& board = CreateSVGTextureL(filename, iVirtualSize, imageLoaderUtil);
+	
+    //Create new Image Visual and add it to the iViewPort
+    CAlfImageVisual* image = CAlfImageVisual::AddNewL(*this, iViewPort); 
+    
+    //Set scaling to cover the whole visual/layout
+    image->SetScaleMode(CAlfImageVisual::EScaleFitHeight);
+    
+    //Set board texture into image visual
+    image->SetImage(TAlfImage(board));
+	}
+
+
+CAlfTexture& CAlfExStickersControl::CreateSVGTextureL(const TFileName& aFileName, 
+        TSize& aSize, CAlfImageLoaderUtil* aImageLoaderUtil)
+    {
+    //Set size of the SVG image. Must be called before creating image loader.
+    aImageLoaderUtil->SetSize(aSize, EAspectRatioNotPreserved);
+    
+    //Use image loader util to create SVG image loader. 
+    MAlfBitmapProvider* provider = aImageLoaderUtil->CreateSVGImageLoaderL(aFileName);
+            
+    //Use texture manager to create the texture with given bitmap provider.
+    return Env().TextureManager().CreateTextureL(KAlfAutoGeneratedTextureId, 
+            provider, EAlfTextureFlagDefault);
+
+    }
+
+
+void CAlfExStickersControl::CreateStickersL()
+	{
+	//Create example stickers for the application
+	for (int i = 0; i < KStickerCount; ++i) 
+    	{
+    	iStickerArray[i] = static_cast<CAlfExStickerLayout*>(CAlfExStickerLayout::AddNewL(*this, iPlainLayout));
+    	iStickerArray[i]->SetStickerPlaceL(this);
+    	iStickerArray[i]->SetStickerTextContentL();
+    	iStickerArray[i]->SetStickerDropShadowBrushL();
+    	LoadStickerImageL(i);
+    	
+    	if (i==0)
+    		iStickerArray[i]->ChangeStickerSizeL();
+    	}
+	}
+
+
+void CAlfExStickersControl::LoadStickerImageL(TInt aIndex)
+    {
+    //This makes bitmap selection to proceed sequently within cycles.
+    TInt bitmapID = aIndex % KStickerBitmapCount;
+            
+    TFileName filename;
+    filename.Append(iPrivateFolderPath);
+    filename.Append(*StringLoader::LoadLC(R_ALFEXSTICKERS_STICKER_TEXTURE_BLUE + bitmapID));
+    CleanupStack::PopAndDestroy(1);
+    
+    //Create image loader util. This object must exist through life time of texture. 
+    CAlfImageLoaderUtil* imageLoaderUtil = new(ELeave) CAlfImageLoaderUtil;
+    iImageLoaderUtilArray.AppendL(imageLoaderUtil);
+    
+    TSize stickerSize(KStickerWidth, KStickerHeight);
+    
+    //Create sticker texture
+    CAlfTexture& stickerTexture = CreateSVGTextureL(filename, stickerSize, imageLoaderUtil);
+    
+    //Assign texture to image brush
+    iStickerArray[aIndex]->SetStickerImageBrushL(stickerTexture);
+    }
+
+
+CAlfControl* CAlfExStickersControl::GetControl()
+	{
+	//Returns control to child visuals who need it
+	return this;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/src/Series_60_APP_ReadMe.txt	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,59 @@
+//________________________________________________________________________
+//             Series 60 APP Stationery Specific Information
+//________________________________________________________________________ 
+
+**Note - The Series 60 SDK only supports the following targets: WINSCW, 
+Thumb UREL, ARMI UREL. If you import an ARM4 target, it will generate 
+errors due to the missing directories.**
+
+** Note - For Platform Security Apps (OS 9.x) you can use GCCE targets as well.
+The package (.pkg) file generation defaults for a GCCE application for the source location
+of the resources. If you are building with ARMV5 you will want to change this location
+for successful sis file creation.
+
+//------------------------------------------------------------------------
+//	General Overview
+//------------------------------------------------------------------------
+
+This project stationery is designed to get you up and running quickly with 
+CodeWarrior for Symbian OS. The project includes all of the necessary files
+needed for building and debugging a generic Series 60 APP within the 
+WINSCW emulator and target environments.
+
+The project can support multiple targets that are dependant on your target 
+environment, examples are:  WINSCW UDEB, WINSCW UREL, ARM4 UDEB, ARM4 UREL, 
+ARMI UDEB, ARMI UREL, Thumb UDEB, Thumb UREL, and Build All.
+The Debug & Release targets are almost identical, but are 
+set to build at different compiler optimizations, Minimum(0) & Most(1) 
+respectively.  The Build All target has been included for 
+your convenience and simply builds all of the other targets.
+
+//------------------------------------------------------------------------
+//	Getting Started
+//------------------------------------------------------------------------
+
+Most of the target settings are already configured for you, but you
+may need to configure the debugger settings if you are debugging on a device 
+other than the emulator. Once you have a project created from this stationery,
+open the Edit pull-down menu and select Debug Settings... (Alt+F7).
+Select the Remote Debugging pref panel from the left column. 
+If want to debug via the Symbian MetroTRK, select the Connection that's set up 
+in the IDE Preferences for Remote Debugging via the Symbian MetroTRK.
+Otherwise, select the Connection that you've set up for an alternate device.
+We recommend that you make sure the project is working properly before you
+begin adding your own code.  Select Make and then Debug from the Project 
+pull-down menu.  If everything is working properly, the debugger window 
+should come up and be stopped at either E32main() or the designated breakpoint.
+If there is a problem, please consult the Targeting_Manual_Symbian_OS.pdf
+for more information on debugging via the MetroTRK, or other devices.
+
+**Note - Series 60 does not currently support on-device debugging via Metro-TRK on OS versions less than 9.x.
+
+//------------------------------------------------------------------------
+//	Adding your own code
+//------------------------------------------------------------------------
+
+Once everything is working as expected, you can begin adding your own code
+to the project.  Keep in mind that we provide this as an example of how to
+get up and running quickly with CodeWarrior.  Feel free to modify any of 
+the source provided. 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/src/alfexstickerlayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,226 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <alf/alfenv.h> 
+#include <alf/alftexture.h>
+#include <StringLoader.h>
+#include <alf/alfroster.h>
+#include <alf/alftransformation.h>
+
+
+//Events
+#include <alf/alfevent.h>
+
+//Layouts
+#include <alf/alfdecklayout.h>
+
+//Visuals
+#include <alf/alftextvisual.h>
+
+//Brushes
+#include <alf/alfborderbrush.h>
+#include <alf/alfimagebrush.h>
+#include <alf/alfdropshadowbrush.h>
+#include <alf/alfbrush.h>
+#include <alf/alfbrusharray.h>
+	
+//Own
+#include "alfexstickerlayout.h"
+#include "alfexstickerscontrol.h"
+#include <alfexstickers.rsg>
+
+//TEMP
+#include <alf/alfcontrol.h>
+
+//Literals
+
+
+//Constants
+const TInt KXCoordinate = 30;
+const TInt KYCoordinate = 30;
+
+
+//Factory functions are not currently used
+CAlfExStickerLayout* CAlfExStickerLayout::NewL(CAlfExStickersControl& aControl, CAlfEnv& aEnv)
+    {
+    CAlfExStickerLayout* self = new (ELeave) CAlfExStickerLayout;
+    CleanupStack::PushL(self);
+    self->ConstructL(aControl, aEnv);
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+CAlfExStickerLayout::CAlfExStickerLayout()
+    {
+    }
+
+
+void CAlfExStickerLayout::ConstructL(CAlfExStickersControl& aControl, CAlfEnv& aEnv)
+    {
+    iControl = &aControl;
+    iEnv = &aEnv;
+    }
+    
+
+CAlfExStickerLayout::~CAlfExStickerLayout()
+    {
+    }
+    
+
+void CAlfExStickerLayout::SetStickerPlaceL(CAlfExStickersControl* aControl)
+	{
+	// Create TAlfRealRect which contains TextVisual placement (KXCoordinate, KYCoordinate)
+	// and TextVisual size (KStickerWidth, KStickerHeight).
+    TAlfRealRect rect(TRect(TPoint(KXCoordinate, KYCoordinate), TSize(KStickerWidth, KStickerHeight)));
+    
+    //Use SetRect function to set the afore mentioned placement and size
+    SetRect(rect);
+    
+    //Get parent control
+    CAlfControl* control = aControl->GetControl();
+    
+    //Add new text visual into the deck layout
+    iTextVisual = CAlfTextVisual::AddNewL(*control, this);
+    
+    //Set the text visual to fill the same space as the deck layout
+    iTextVisual->SetRect(TAlfRealRect(TRect(TPoint(0, 0), TSize(KStickerWidth, KStickerHeight))));
+    
+    //Set sticker size to small
+    iStickerIsLarge = ETrue;
+	}
+
+
+void CAlfExStickerLayout::SetStickerTextContentL()
+	{
+	//Function is used to set text inside the text visual and to format it
+	//Set example text to sticker
+	iTextVisual->SetTextL(*StringLoader::LoadLC(R_ALFEXSTICKERS_DEFAULT_TEXT));
+    CleanupStack::PopAndDestroy(1);
+    
+	//Set text to wrap so that the lines are broken to the visual's content area.
+	iTextVisual->SetWrapping(CAlfTextVisual::ELineWrapBreak);
+	
+	//Set text color to black
+	iTextVisual->SetColor(KRgbBlack);
+	
+	//Set line spacing
+	iTextVisual->EnableShadow(EFalse);
+	
+	//Set predefined style for the text
+	iTextVisual->SetTextStyle( EAlfTextStyleSmall );
+	
+	//Align the text content to visuals center, in both axis
+	iTextVisual->SetAlign(EAlfAlignHCenter, EAlfAlignVCenter);
+	
+	//Add padding between text and visual border, 10 pixels to every side
+	iTextVisual->SetPadding(TAlfBoxMetric(10, 10, 10, 10));
+	}
+
+
+void CAlfExStickerLayout::SetStickerDropShadowBrushL()
+	{
+	//First we must enable brushes
+	//NOTE: Before adding brushes to visual, EnableBrushesL() needs to be invoked or the application crashes
+	EnableBrushesL();	
+	
+	//Create Drop Shadow Brush, second parameter is the shadow size in pixels
+	CAlfDropShadowBrush* dropBrush = CAlfDropShadowBrush::NewLC(Env(), 5);
+    
+    //Append the brush to the visual
+	Brushes()->AppendL(dropBrush, EAlfHasOwnership);
+    
+    CleanupStack::Pop(1, dropBrush); 
+	}
+
+
+void CAlfExStickerLayout::SetStickerImageBrushL(CAlfTexture& aTexture)
+	{
+	//NOTE: Before adding brushes to visual, EnableBrushesL() needs to be invoked or the application crashes
+	
+	//Create image brush using the texture from loaded above
+	CAlfImageBrush* imageBrush = CAlfImageBrush::NewLC(Env(), TAlfImage(aTexture));
+	
+    //Set the image brush to background layer
+	imageBrush->SetLayer(EAlfBrushLayerBackground);
+	
+	//Append the brush to the visual
+	Brushes()->AppendL(imageBrush, EAlfHasOwnership);
+	
+	CleanupStack::Pop(1, imageBrush);
+	}
+
+
+CAlfVisual* CAlfExStickerLayout::GetVisual() {
+	{
+	//Function return the text visual for the control, needed in event handling
+	return iTextVisual;
+	}
+}
+
+
+void CAlfExStickerLayout::ChangeStickerSizeL()
+	{
+	//Transformations need to be enabled or else the application crashes on scaling
+	iTextVisual->EnableTransformationL();
+	
+	if (iStickerIsLarge)
+		{
+	    //Timed values for scaling
+	    TAlfTimedValue x;
+		TAlfTimedValue y;
+		
+		//Set starting state scale
+		x.SetValueNow(1.0);
+		y.SetValueNow(1.0);
+		
+		//Set scale target, halve the size and do it in 1000ms
+		x.SetTarget(0.5, 1000);
+		y.SetTarget(0.5, 1000);
+		
+		//Resize the deck
+		SetSize(TAlfRealSize(150, 150), 1000);
+		
+		//Scale the text visual
+		iTextVisual->Transformation().Scale(x, y);
+				
+		iStickerIsLarge = EFalse;
+		}
+	else if (!iStickerIsLarge)
+		{
+	    //Timed values for scaling
+		TAlfTimedValue x;
+		TAlfTimedValue y;
+		
+		//Set starting state scale
+		x.SetValueNow(1.0);
+		y.SetValueNow(1.0);
+		
+		//Set scale target, double the size and do it in 1000ms
+		x.SetTarget(2.0, 1000);
+		y.SetTarget(2.0, 1000);
+		
+		//Scale the text visual
+		iTextVisual->Transformation().Scale(x, y);
+		
+		//Resize the deck
+		SetSize(TAlfRealSize(300, 300), 1000);
+
+		iStickerIsLarge = ETrue;
+		}
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/src/alfexstickers.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "AlfExStickersApplication.h"
+#include <eikstart.h>
+
+#ifdef __UI_FRAMEWORKS_V2__
+
+// Create an application, and return a pointer to it
+CApaApplication* NewApplication()
+	{
+	return new CAlfExStickersApplication;
+	}
+
+
+TInt E32Main()
+	{
+	return EikStart::RunApplication(NewApplication);
+	
+	}
+
+// The following is required for wins on EKA1 (using the exedll target)
+
+#if defined(__WINS__) && !defined(EKA2)
+EXPORT_C TInt WinsMain(TDesC* aCmdLine)
+	{
+	return EikStart::RunApplication(NewApplication, aCmdLine);
+	}
+
+TInt E32Dll(TDllReason)
+	{
+	return KErrNone;
+	}
+#endif
+
+#else // __UI_FRAMEWORKS_V2__
+
+// Create an application, and return a pointer to it
+EXPORT_C CApaApplication* NewApplication()
+  {
+  return new CAlfExStickersApplication;
+  }
+
+// DLL entry point, return that everything is ok
+GLDEF_C TInt E32Dll(TDllReason)
+  {
+  return KErrNone;
+  }
+
+#endif // __UI_FRAMEWORKS_V2__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/src/alfexstickersapplication.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "AlfExStickersDocument.h"
+#include "AlfExStickersApplication.h"
+
+// UID for the application, this should correspond to the uid defined in the mmp file
+static const TUid KUidAlfExStickersApp = {0x20012480};
+
+
+CApaDocument* CAlfExStickersApplication::CreateDocumentL()
+    {  
+    // Create an AlfExStickers document, and return a pointer to it
+    CApaDocument* document = CAlfExStickersDocument::NewL(*this);
+    return document;
+    }
+
+
+TUid CAlfExStickersApplication::AppDllUid() const
+    {
+    // Return the UID for the AlfExStickers application
+    return KUidAlfExStickersApp;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/src/alfexstickersappui.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <avkon.hrh>
+#include <aknnotewrappers.h> 
+
+#include <alf/alfdisplay.h> 
+#include <alf/alfenv.h> 
+#include <alf/alfcontrolgroup.h>
+#include <alf/alfroster.h>
+
+
+#include "AlfExStickers.pan"
+#include "AlfExStickersAppUi.h"
+#include "AlfExStickers.hrh"
+#include "AlfExStickersControl.h"
+
+const TInt KAlfExStickersControlGroupId = 1;
+
+// ConstructL is called by the application framework
+void CAlfExStickersAppUi::ConstructL()
+    {
+    BaseConstructL(EAknEnableSkin);
+    iEnv = CAlfEnv::NewL();
+    TRect rect;
+    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, rect);
+    CAlfDisplay& display = 
+        iEnv->NewDisplayL(rect, CAlfEnv::ENewDisplayAsCoeControl);
+
+    display.SetClearBackgroundL(CAlfDisplay::EClearWithSkinBackground);
+    
+    CAlfControlGroup& group = 
+        iEnv->NewControlGroupL(KAlfExStickersControlGroupId);
+
+    CAlfExStickersControl* control = CAlfExStickersControl::NewLC(*iEnv, &iCoeEnv->FsSession());
+    group.AppendL(control);
+    CleanupStack::Pop(control);
+    
+    iCoeEnv->FsSession();
+    
+    
+    display.Roster().ShowL(group);
+    
+    }
+
+
+CAlfExStickersAppUi::CAlfExStickersAppUi()                              
+    {
+	// no implementation required
+    }
+
+
+CAlfExStickersAppUi::~CAlfExStickersAppUi()
+    {
+    delete iEnv;
+    }
+
+
+// handle any menu commands
+void CAlfExStickersAppUi::HandleCommandL(TInt aCommand)
+    {
+    switch(aCommand)
+        {
+        case EEikCmdExit:
+        case EAknSoftkeyExit:
+            Exit();
+            break;
+          
+        /*
+        case EAlfExStickersCommand1:
+            {
+            _LIT(message,"Hello!");
+            CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
+            informationNote->ExecuteLD(message);
+            }
+            break;
+		*/
+        default:
+            Panic(EAlfExStickersBasicUi);
+            break;
+        }
+    }
+
+void CAlfExStickersAppUi::HandleResourceChangeL( TInt aType )
+    {
+    CAknAppUi::HandleResourceChangeL( aType );
+
+    if ( iEnv && aType == KEikDynamicLayoutVariantSwitch )
+        {
+        iEnv->NotifyLayoutChangedL();
+        }
+    }
+    
+void CAlfExStickersAppUi::HandleWsEventL(const TWsEvent &aEvent, CCoeControl* aDestination)
+    {
+    switch(aEvent.Type())
+        {
+        case KAknFullOrPartialForegroundLost:
+            iEnv->Release();
+            break;
+        case KAknFullOrPartialForegroundGained:
+            iEnv->RestoreL();
+            break;
+        default:
+            break;
+        }
+    CAknAppUi::HandleWsEventL(aEvent, aDestination);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/exampleapps/alfexstickers/src/alfexstickersdocument.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "AlfExStickersAppUi.h"
+#include "AlfExStickersDocument.h"
+
+// Standard Symbian OS construction sequence
+CAlfExStickersDocument* CAlfExStickersDocument::NewL(CEikApplication& aApp)
+    {
+    CAlfExStickersDocument* self = NewLC(aApp);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+CAlfExStickersDocument* CAlfExStickersDocument::NewLC(CEikApplication& aApp)
+    {
+    CAlfExStickersDocument* self = new (ELeave) CAlfExStickersDocument(aApp);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+
+CAlfExStickersDocument::CAlfExStickersDocument(CEikApplication& aApp) : CAknDocument(aApp) 
+    {
+	// no implementation required
+    }
+
+
+void CAlfExStickersDocument::ConstructL()
+    {
+	// no implementation required
+    }    
+
+
+CAlfExStickersDocument::~CAlfExStickersDocument()
+    {
+	// no implementation required
+    }
+
+
+CEikAppUi* CAlfExStickersDocument::CreateAppUiL()
+    {
+    // Create the application user interface, and return a pointer to it,
+    // the framework takes ownership of this object
+    CEikAppUi* appUi = new (ELeave) CAlfExStickersAppUi;
+    return appUi;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Build information file for UI Accelerator Architetecture Domain 
+*
+*/
+
+// local
+//#define ALF_USE_OPENWF_COMPOSITION
+
+
+#include "../uiaccelerator_plat/group/bld.inf"
+
+#include "../uiacceltk/group/bld.inf"
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/group/stdinc.mmh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   For including std libs
+*
+*/
+
+#ifndef __ALF_STD_INC__
+#define __ALF_STD_INC__
+
+
+// Turn this flag on if you need to compile ecosystem on top of W02 or pre W02 release
+//#define CONFIGURE_FOR_OPENC_STD
+#undef CONFIGURE_FOR_OPENC_STD
+
+#ifndef CONFIGURE_FOR_OPENC_STD
+OS_LAYER_LIBC_SYSTEMINCLUDE
+#else
+OS_LAYER_LIBC_SYSTEMINCLUDE 
+#endif
+
+#ifndef ALF_NO_LIBC_INCLUDES
+OS_LAYER_LIBC_SYSTEMINCLUDE
+#endif
+
+#ifdef CONFIGURE_FOR_OPENC_STD
+OS_LAYER_LIBC_SYSTEMINCLUDE 
+#endif
+
+OS_LAYER_STDCPP_SYSTEMINCLUDE
+OS_LAYER_GLIB_SYSTEMINCLUDE
+
+#ifndef ALF_NO_WCHAR_MACRO
+  OPTION CW -wchar_t on
+  MACRO _WCHAR_T_DECLARED
+#endif
+
+#ifdef ALF_LINK_STDCPP_DLL
+  #ifdef EPOC32
+    LIBRARY libstdcpp.lib 
+  #else
+// if you want to use codewarrior for compiling, use
+// FIRSTLIB libstdcpp.lib
+// instead 
+    FIRSTLIB ../udeb/libstdcpp.lib 
+    STATICLIBRARY edll.lib
+  #endif 
+#endif
+
+#ifdef ALF_LINK_STDCPP_EXE
+  #ifdef EPOC32
+    LIBRARY libstdcpp.lib
+  #else
+// if you want to use codewarrior for compiling, use
+// FIRSTLIB libstdcpp.lib
+// instead 
+    FIRSTLIB ../udeb/libstdcpp.lib 
+    STATICLIBRARY eexe.lib
+  #endif
+#endif
+
+#endif // __ALF_STD_INC__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/group/Doxyfile.txt	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1308 @@
+# Doxyfile 1.5.2
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file that 
+# follow. The default is UTF-8 which is also the encoding used for all text before 
+# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into 
+# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of 
+# possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = "UI Accelerator Toolkit Widgets"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = ../widgets_apidoc
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of 
+# source files, where putting all generated files in the same directory would 
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
+# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, 
+# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, 
+# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, 
+# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is 
+# used as the annotated text. Otherwise, the brief description is used as-is. 
+# If left blank, the following values are used ("$name" is automatically 
+# replaced with the name of the entity): "The $name class" "The $name widget" 
+# "The $name file" "is" "provides" "specifies" "contains" 
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
+# inherited members of a class in the documentation of that class as if those 
+# members were ordinary class members. Constructors, destructors and assignment 
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like the Qt-style comments (thus requiring an 
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF      = YES
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member 
+# documentation.
+
+DETAILS_AT_TOP         = YES
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
+# a new page for each member. If set to NO, the documentation of a member will 
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 4
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = panic=@exception \
+                         leave=@exception \
+                         "internalTechnology=@par Internal technology" \
+                         "internalComponent=@par Internal component" \
+                         "internalAll=@par Internal all" \
+                         "publishedPartner=@par Published-partner" \
+                         "publishedAll=@par Published-all" \
+                         "prototype=@par Prototype" \
+                         "interim=@par Interim" \
+                         "released=@par Released" \
+                         "removed=@par Removed" \
+                         "test=@par Test" \
+                         "realtime=@par Realtime" \
+                         "status=@par Status:\n"\
+                         "attributes=@par Attributes: \n"\
+                         "interfaces=@par Interfaces: \n"\
+                         "lib=@par Library: \n"\
+                         "events=@par Events: \n"\
+                         "beginAPI=@name Exported API\n @{" \
+                         endAPI=@}
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
+# sources only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
+# sources only. Doxygen will then generate output that is more tailored for Java. 
+# For instance, namespaces will be presented as packages, qualified scopes 
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to 
+# include (a tag file for) the STL sources as input, then you should 
+# set this tag to YES in order to let doxygen match functions declarations and 
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
+# func(std::string) {}). This also make the inheritance and collaboration 
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = YES
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
+# doxygen should invoke to get the current version for each file (typically from the 
+# version control system). Doxygen will invoke the program by executing (via 
+# popen()) the command <command> <input-file>, where <command> is the value of 
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
+# provided by doxygen. Whatever the program writes to standard output 
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for 
+# functions that are documented, but have no documentation for their parameters 
+# or return value. If set to NO (the default) doxygen will only warn about 
+# wrong or incomplete parameter documentation, but not about the absence of 
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text. Optionally the format may contain 
+# $version, which will be replaced by the version of the file (if it could 
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  = ../alf_gridwidget_api/inc/alf \
+                         ../alf_listwidget_api/inc/alf \
+                         ../alf_scrollbarwidget_api/inc/alf \
+                         ../alf_widgetfactory_api/inc/alf \
+                         ../alf_widgetmodel_api/inc/alf \
+                         ../alf_widgetutils_api/inc/alf \
+                         ../dui_engine_api/inc/dui \
+                         ../tm_themeitemmapper_api/inc/tm 
+
+# This tag can be used to specify the character encoding of the source files that 
+# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default 
+# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. 
+# See http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
+
+FILE_PATTERNS          = *.c \
+                         *.cc \
+                         *.cpp \
+                         *.h \
+                         *.inl \
+                         *.hh \
+                         *.hrh \
+                         *.dox
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = 
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
+# directories that are symbolic links (a Unix filesystem feature) are excluded 
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories. Note that the wildcards are matched 
+# against the file with absolute path, so to exclude all test directories 
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = 
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
+# (namespaces, classes, functions, etc.) that should be excluded from the output. 
+# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, 
+# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.  Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code 
+# will point to the HTML generated by the htags(1) tool instead of doxygen 
+# built-in source browser. The htags tool is part of GNU's global source 
+# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 3
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = TAlf \
+                         SAlf \
+                         CAlf \
+                         RAlf \
+                         MAlf \
+                         IAlf \
+                         Alf
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = 
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = "NONSHARABLE_CLASS(name)=class name" \
+                         "OSN_NONSHARABLE_CLASS(name)=class name" \
+                         "_LIT(name,string)=const static TLitC<sizeof(L##string)/2> name={sizeof(L##string)/2-1,L##string}"
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse 
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
+# or super classes. Setting the tag to NO turns the diagrams off. Note that 
+# this option is superseded by the HAVE_DOT option below. This is only a 
+# fallback. It is recommended to install and use dot, since it yields more 
+# powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc 
+# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to 
+# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to 
+# specify the directory where the mscgen tool resides. If left empty the tool is assumed to 
+# be found in the default search path.
+
+MSCGEN_PATH            = 
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = YES
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a call dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable call graphs for selected 
+# functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a caller dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable caller graphs for selected 
+# functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
+# then doxygen will show the dependencies a directory has on other directories 
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
+# nodes that will be shown in the graph. If the number of nodes in a graph 
+# becomes larger than this value, doxygen will truncate the graph, which is 
+# visualized by representing a node as a red box. Note that doxygen will always 
+# show the root nodes and its direct children regardless of this setting.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
+# background. This is disabled by default, which results in a white background. 
+# Warning: Depending on the platform used, enabling this option may lead to 
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to 
+# read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
+# files in one run (i.e. multiple -o and -T options on the command line). This 
+# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/group/Doxyfile_osn.txt	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1298 @@
+# Doxyfile 1.5.2
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file that 
+# follow. The default is UTF-8 which is also the encoding used for all text before 
+# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into 
+# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of 
+# possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = "UI Accelerator Toolkit Operating System Neutrality Layer"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = ../osn_apidoc
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of 
+# source files, where putting all generated files in the same directory would 
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
+# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, 
+# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, 
+# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, 
+# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is 
+# used as the annotated text. Otherwise, the brief description is used as-is. 
+# If left blank, the following values are used ("$name" is automatically 
+# replaced with the name of the entity): "The $name class" "The $name widget" 
+# "The $name file" "is" "provides" "specifies" "contains" 
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
+# inherited members of a class in the documentation of that class as if those 
+# members were ordinary class members. Constructors, destructors and assignment 
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like the Qt-style comments (thus requiring an 
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF      = YES
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member 
+# documentation.
+
+DETAILS_AT_TOP         = YES
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
+# a new page for each member. If set to NO, the documentation of a member will 
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 4
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = panic=@exception \
+                         leave=@exception \
+                         "internalTechnology=@par Internal technology" \
+                         "internalComponent=@par Internal component" \
+                         "internalAll=@par Internal all" \
+                         "publishedPartner=@par Published-partner" \
+                         "publishedAll=@par Published-all" \
+                         "prototype=@par Prototype" \
+                         "interim=@par Interim" \
+                         "released=@par Released" \
+                         "removed=@par Removed" \
+                         "test=@par Test" \
+                         "realtime=@par Realtime" \
+                         "beginAPI=@name Exported API\n @{" \
+                         endAPI=@}
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
+# sources only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
+# sources only. Doxygen will then generate output that is more tailored for Java. 
+# For instance, namespaces will be presented as packages, qualified scopes 
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to 
+# include (a tag file for) the STL sources as input, then you should 
+# set this tag to YES in order to let doxygen match functions declarations and 
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
+# func(std::string) {}). This also make the inheritance and collaboration 
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = YES
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
+# doxygen should invoke to get the current version for each file (typically from the 
+# version control system). Doxygen will invoke the program by executing (via 
+# popen()) the command <command> <input-file>, where <command> is the value of 
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
+# provided by doxygen. Whatever the program writes to standard output 
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for 
+# functions that are documented, but have no documentation for their parameters 
+# or return value. If set to NO (the default) doxygen will only warn about 
+# wrong or incomplete parameter documentation, but not about the absence of 
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text. Optionally the format may contain 
+# $version, which will be replaced by the version of the file (if it could 
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  = ../osn_container_api/inc/osn \
+                         ../osn_exception_api/inc/osn \
+                         ../osn_global_api/inc/osn \
+                         ../osn_smartpointer_api/inc/osn \
+                         ../osn_string_api/inc/osn
+
+# This tag can be used to specify the character encoding of the source files that 
+# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default 
+# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. 
+# See http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
+
+FILE_PATTERNS          = *.c \
+                         *.cc \
+                         *.cpp \
+                         *.h \
+                         *.inl \
+                         *.hh \
+                         *.hrh \
+                         *.dox
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = 
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
+# directories that are symbolic links (a Unix filesystem feature) are excluded 
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories. Note that the wildcards are matched 
+# against the file with absolute path, so to exclude all test directories 
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = 
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
+# (namespaces, classes, functions, etc.) that should be excluded from the output. 
+# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, 
+# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.  Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code 
+# will point to the HTML generated by the htags(1) tool instead of doxygen 
+# built-in source browser. The htags tool is part of GNU's global source 
+# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 3
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = TAlf \
+                         SAlf \
+                         CAlf \
+                         RAlf \
+                         MAlf \
+                         Alf
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = 
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = "NONSHARABLE_CLASS(name)=class name" \
+                         "_LIT(name,string)=const static TLitC<sizeof(L##string)/2> name={sizeof(L##string)/2-1,L##string}"
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse 
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
+# or super classes. Setting the tag to NO turns the diagrams off. Note that 
+# this option is superseded by the HAVE_DOT option below. This is only a 
+# fallback. It is recommended to install and use dot, since it yields more 
+# powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc 
+# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to 
+# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to 
+# specify the directory where the mscgen tool resides. If left empty the tool is assumed to 
+# be found in the default search path.
+
+MSCGEN_PATH            = 
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = YES
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a call dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable call graphs for selected 
+# functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a caller dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable caller graphs for selected 
+# functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
+# then doxygen will show the dependencies a directory has on other directories 
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
+# nodes that will be shown in the graph. If the number of nodes in a graph 
+# becomes larger than this value, doxygen will truncate the graph, which is 
+# visualized by representing a node as a red box. Note that doxygen will always 
+# show the root nodes and its direct children regardless of this setting.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
+# background. This is disabled by default, which results in a white background. 
+# Warning: Depending on the platform used, enabling this option may lead to 
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to 
+# read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
+# files in one run (i.e. multiple -o and -T options on the command line). This 
+# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,21 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Build information file for UI Accelerator Architetecture Domain 
+*
+*/
+
+
+#include "../../uiacceltk/hitchcock/CommonInc/alfuids.h"
+
+// NOTE: ALL STUFF UNDER ALF_USE_COMPONENT_MODEL HAS BEEN REMOVED!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/layers.sysdef.xml	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
+  <!ENTITY layer_real_source_path "sf/mw/uiaccelerator" >
+]>
+
+<SystemDefinition name="uiaccelerator" schema="1.4.0">
+  <systemModel>
+    <layer name="mw_layer">
+      <module name="uiaccelerator">
+        <unit unitID="abs.uiaccelerator" mrp="" bldFile="&layer_real_source_path;/group" name="uiaccelerator" />
+      </module>
+    </layer>
+  </systemModel>
+</SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/package_definition.xml	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SystemDefinition schema="3.0.0">
+  <package id="uiaccelerator" name="UI Accelerator" levels="plugin framework server ex if">
+    <collection id="uiacceltk" name="UI Accelerator Toolkit" level="framework">
+      <component id="hitchcock" filter="s60" name="Hitchcock">
+        <unit bldFile="uiacceltk/hitchcock/group"/>
+		<!-- are the following needed? if so, 'include from above -->
+        <!-- <unit bldFile="uiacceltk/hitchcock/coretoolkit/group"/> -->
+        <!-- <unit bldFile="uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/group"/> -->
+        <!-- <unit bldFile="uiacceltk/hitchcock/tracer/group"/> -->
+        <!-- <unit bldFile="uiacceltk/hitchcock/tracer/traceextclient/group"/> -->
+        <!-- <unit bldFile="uiacceltk/hitchcock/tracer/traceextplugin/group"/> -->
+      </component>
+      <component id="widgeteditors" filter="s60" name="Widget Editors">
+        <unit bldFile="uiacceltk/widgeteditors/group"/>
+      </component>
+      <component id="uiacceltk_build" filter="s60" name="UI Accelerator Toolkit Build">
+		<!-- consider distributing into other components -->
+        <unit bldFile="uiacceltk/group"/>
+      </component>
+    </collection>
+    <collection id="uiaccelexampleapps" name="UI Accelerator Example Apps" level="ex">
+		<!-- are these unbuilt components? -->
+      <component id="alfexanalogdialer" filter="s60" name="Accelerated LAF Example Analog Dialer" purpose="development">
+        <!-- <unit bldFile="uiaccelexampleapps/alfexanalogdialer/group"/> -->
+      </component>
+      <component id="alfexstickers" filter="s60" name="Accelerated LAF Example Stickers" purpose="development">
+        <!-- <unit bldFile="uiaccelexampleapps/alfexstickers/group"/> -->
+      </component>
+    </collection>
+    <collection id="uiaccelerator_info" name="UI Accelerator Info" level="if">
+      <component id="uiaccelerator_inc" filter="s60">
+		<!-- is this needed? -->
+        <!-- <unit bldFile="inc/group"/> -->
+      </component>
+      <component id="uiaccelerator_plat" filter="s60" name="UI Accelerator Platform Interfaces" class="api">
+        <unit bldFile="uiaccelerator_plat/group"/>
+		<!-- Can only have one bld.inf: include the test bld.infs from the above one if needed -->
+        <unit bldFile="uiaccelerator_plat/alf_client_server_api/tsrc/group"/>
+        <unit bldFile="uiaccelerator_plat/alf_core_toolkit_api/tsrc/group"/>
+        <unit bldFile="uiaccelerator_plat/alf_editors_api/tsrc/group"/>
+        <unit bldFile="uiaccelerator_plat/alf_extended_visual_api/tsrc/group"/>
+        <unit bldFile="uiaccelerator_plat/alf_extension_api/tsrc/group"/>
+        <unit bldFile="uiaccelerator_plat/alf_tracing_api/tsrc/group"/>
+        <unit bldFile="uiaccelerator_plat/alf_visual_api/tsrc/group"/>
+      </component>
+    </collection>
+  </package>
+</SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/alfcollect.iby	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef __ALFCOLLECT_IBY__
+#define __ALFCOLLECT_IBY__
+
+#include <bldvariant.hrh>
+
+#include <alfred.iby>
+#include <alfeditors.iby>
+
+#endif // __ALFCOLLECT_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/alfeditors.iby	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef __ALFEDITORS_IBY__
+#define __ALFEDITORS_IBY__
+
+#include <bldvariant.hrh>
+
+#ifdef FF_ROM_INCLUDE_ALF 
+#ifndef __SERIES60_30__
+file=ABI_DIR\BUILD_DIR\alfeditors.dll          SHARED_LIB_DIR\alfeditors.dll
+file=ABI_DIR\BUILD_DIR\alfeditortools.dll        SHARED_LIB_DIR\alfeditortools.dll
+#endif // #ifndef __SERIES60_30__
+
+#endif // #ifdef FF_ROM_INCLUDE_ALF
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/alfred.iby	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,158 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef __ALFRED_IBY__
+#define __ALFRED_IBY__
+
+#include <bldvariant.hrh>
+
+REM ALFRED
+
+// HUIToolkit
+file=ABI_DIR\BUILD_DIR\hitchcock.dll                            SHARED_LIB_DIR\hitchcock.dll
+// client
+file=ABI_DIR\BUILD_DIR\alfclient.dll                            SHARED_LIB_DIR\alfclient.dll
+// Server core
+file=ABI_DIR\BUILD_DIR\alfappservercore.dll                     SHARED_LIB_DIR\alfappservercore.dll
+
+// RENDERER PLUGINS
+// OpenGL 1.0 & 1.1
+#ifndef SYMBIAN_BUILD_GCE
+//ECOM_PLUGIN(huirenderplugingles.dll, 200113D5.rsc)
+//ECOM_PLUGIN(huirenderpluginbitgdi.dll, 200113D8.rsc)
+// App Server exe
+file=ABI_DIR\BUILD_DIR\alfredserver.exe                         PROGRAMS_DIR\alfredserver.exe
+data=DATAZ_\APP_RESOURCE_DIR\alfredserver.RSC                   APP_RESOURCE_DIR\alfredserver.rsc
+data=ZSYSTEM\..\PRIVATE\10003A3F\APPS\alfredserver_REG.RSC      Private\10003a3f\apps\alfredserver_reg.rsc
+#else
+// Open VG
+ECOM_PLUGIN(huirenderpluginvg.dll, 200184B7.rsc)
+//ECOM_PLUGIN(huirenderplugingles20.dll, 20018425.rsc)
+
+file=ABI_DIR\BUILD_DIR\alfdecoderserverclient.dll               SHARED_LIB_DIR\alfdecoderserverclient.dll
+// Alf render stage
+ECOM_PLUGIN(alfrenderstage.dll, alfrenderstage.RSC)
+// Alf CRP Hint Plugin
+ECOM_PLUGIN(alfhintplugindrawer.dll, alfhintplugindrawer.RSC)
+file=ABI_DIR\BUILD_DIR\alfhintplugin.dll               	SHARED_LIB_DIR\alfhintplugin.dll
+
+ECOM_PLUGIN(alfoogmplugin.dll, alfoogmplugin.RSC)
+
+data=DATAZ_\ECOM_RESOURCE_DIR\alfnonsupportedwscommands.rsc     ECOM_RESOURCE_DIR\alfnonsupportedwscommands.rsc
+
+// Enable the 2 following lines, if _ALF_PRINT_WS_COMMANDS_ or HUI_DEBUG_TRACK_DRAWING is enabled in some component
+// You might need to add alfcommanddebug.dll to \epoc32\rombuild\my_romfiles.txt also, depends on build configuration.
+// file=ABI_DIR\BUILD_DIR\alfcommanddebug.dll               	SHARED_LIB_DIR\alfcommanddebug.dll
+// data=DATAZ_\ECOM_RESOURCE_DIR\alfcommanddescriptions.rsc        ECOM_RESOURCE_DIR\alfcommanddescriptions.rsc
+
+// proxy for running inside wserv
+ECOM_PLUGIN(alfappfwproxy.dll, alfappfwproxy.RSC)
+#endif // #ifdef SYMBIAN_BUILD_GCE
+
+// File token server
+file=ABI_DIR\BUILD_DIR\ftokenclient.dll                         SHARED_LIB_DIR\ftokenclient.dll
+file=ABI_DIR\BUILD_DIR\!ftokenserver.exe                        PROGRAMS_DIR\!ftokenserver.exe
+
+// Stub sis file
+data=ABI_DIR\BUILD_DIR\uiaccelerator_stub.sis system\install\uiaccelerator_stub.sis
+
+//#ifdef HUI_FX
+// For testing purposes we put our manifest file into the rom.
+// 101f84b9.sel file should be put to rom by aknskins even if we override the file during build.
+// After aknskins has taken over 101f84b9.sel and manifest.mf, we should no longe export them
+// or put them onto the rom.
+
+data=DATAZ_/RESOURCE_FILES_DIR/effects/manifest.mf RESOURCE_FILES_DIR/effects/manifest.mf
+
+// Effect fxmls. Keep the list in alphabetical order. When updating the list below, REMEMBER TO ALSO UPDATE core_exports.inc!
+data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_add_page.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_add_page.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_close_editmode.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_close_editmode.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_close_widgetmanager.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_close_widgetmanager.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_left.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_left.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_open_editmode.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_open_editmode.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_open_widgetmanager.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_open_widgetmanager.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_remove_page.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_remove_page.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/activeidle_viewswitch_right.fxml RESOURCE_FILES_DIR/effects/activeidle_viewswitch_right.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/app_activate.fxml RESOURCE_FILES_DIR/effects/app_activate.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/app_exit.fxml RESOURCE_FILES_DIR/effects/app_exit.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/app_start.fxml RESOURCE_FILES_DIR/effects/app_start.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/app_start_rect.fxml RESOURCE_FILES_DIR/effects/app_start_rect.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/app_start_switch.fxml RESOURCE_FILES_DIR/effects/app_start_switch.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/app_start_switch_rect.fxml RESOURCE_FILES_DIR/effects/app_start_switch_rect.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/appshell_exit.fxml RESOURCE_FILES_DIR/effects/appshell_exit.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/confirmationnote_appear.fxml RESOURCE_FILES_DIR/effects/confirmationnote_appear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/confirmationnote_disappear.fxml RESOURCE_FILES_DIR/effects/confirmationnote_disappear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/dialer_close.fxml RESOURCE_FILES_DIR/effects/dialer_close.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/dialer_open.fxml RESOURCE_FILES_DIR/effects/dialer_open.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/discreet_popup_appear.fxml RESOURCE_FILES_DIR/effects/discreet_popup_appear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/discreet_popup_disappear.fxml RESOURCE_FILES_DIR/effects/discreet_popup_disappear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/editingmenu_appear.fxml RESOURCE_FILES_DIR/effects/editingmenu_appear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/editingmenu_disappear.fxml RESOURCE_FILES_DIR/effects/editingmenu_disappear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/errornote_appear.fxml RESOURCE_FILES_DIR/effects/errornote_appear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/errornote_disappear.fxml RESOURCE_FILES_DIR/effects/errornote_disappear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/fade_effect.fxml RESOURCE_FILES_DIR/effects/fade_effect.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/folder_close.fxml RESOURCE_FILES_DIR/effects/folder_close.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/folder_open.fxml RESOURCE_FILES_DIR/effects/folder_open.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/informationnote_appear.fxml RESOURCE_FILES_DIR/effects/informationnote_appear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/informationnote_disappear.fxml RESOURCE_FILES_DIR/effects/informationnote_disappear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/layoutswitch_appear.fxml RESOURCE_FILES_DIR/effects/layoutswitch_appear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/layoutswitch_disappear.fxml RESOURCE_FILES_DIR/effects/layoutswitch_disappear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/musicplayer_popup_appear.fxml RESOURCE_FILES_DIR/effects/musicplayer_popup_appear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/musicplayer_popup_disappear.fxml RESOURCE_FILES_DIR/effects/musicplayer_popup_disappear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/musicplayer_viewswitch_in.fxml RESOURCE_FILES_DIR/effects/musicplayer_viewswitch_in.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/musicplayer_viewswitch_out.fxml RESOURCE_FILES_DIR/effects/musicplayer_viewswitch_out.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/optionsmenu_appear.fxml RESOURCE_FILES_DIR/effects/optionsmenu_appear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/optionsmenu_cascade_appear.fxml RESOURCE_FILES_DIR/effects/optionsmenu_cascade_appear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/optionsmenu_cascade_disappear.fxml RESOURCE_FILES_DIR/effects/optionsmenu_cascade_disappear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/optionsmenu_disappear.fxml RESOURCE_FILES_DIR/effects/optionsmenu_disappear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/popup_appear.fxml RESOURCE_FILES_DIR/effects/popup_appear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/popup_disappear.fxml RESOURCE_FILES_DIR/effects/popup_disappear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/popup_disappear_screenshot.fxml RESOURCE_FILES_DIR/effects/popup_disappear_screenshot.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/preview_popup_appear.fxml RESOURCE_FILES_DIR/effects/preview_popup_appear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/preview_popup_disappear.fxml RESOURCE_FILES_DIR/effects/preview_popup_disappear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/screensaver_activate.fxml RESOURCE_FILES_DIR/effects/screensaver_activate.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/screensaver_deactivate.fxml RESOURCE_FILES_DIR/effects/screensaver_deactivate.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/systemnotify_appear.fxml RESOURCE_FILES_DIR/effects/systemnotify_appear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/systemnotify_disappear.fxml RESOURCE_FILES_DIR/effects/systemnotify_disappear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/tab_effect.fxml RESOURCE_FILES_DIR/effects/tab_effect.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/taskswapper_app_start_disappear.fxml RESOURCE_FILES_DIR/effects/taskswapper_app_start_disappear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/taskswapper_app_start_rect.fxml RESOURCE_FILES_DIR/effects/taskswapper_app_start_rect.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/taskswapper_appear.fxml RESOURCE_FILES_DIR/effects/taskswapper_appear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/taskswapper_disappear.fxml RESOURCE_FILES_DIR/effects/taskswapper_disappear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/touchinput_close.fxml RESOURCE_FILES_DIR/effects/touchinput_close.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/touchinput_open.fxml RESOURCE_FILES_DIR/effects/touchinput_open.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/waitnote_appear.fxml RESOURCE_FILES_DIR/effects/waitnote_appear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/waitnote_disappear.fxml RESOURCE_FILES_DIR/effects/waitnote_disappear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/warningnote_appear.fxml RESOURCE_FILES_DIR/effects/warningnote_appear.fxml
+data=DATAZ_/RESOURCE_FILES_DIR/effects/warningnote_disappear.fxml RESOURCE_FILES_DIR/effects/warningnote_disappear.fxml
+
+
+// No actual effect files are included into the rom by default.
+// For testing the effect files can be put onto a memory card into
+// /resource/effectst/ directory.
+// As long as the testing override is in effect, this directory is used for the effects.
+// Only if an effect file is not found on the memory card will the one in rom be used.
+// see the filenames used in the manifest.mf file or change the manifest.mf before ROM imgage is built
+
+//#endif
+
+file=ABI_DIR\BUILD_DIR\backgroundanimhost.exe PROGRAMS_DIR\backgroundanimhost.exe
+file=ABI_DIR\BUILD_DIR\bga_reference_plugin.dll SHARED_LIB_DIR\bga_reference_plugin.dll
+data=DATAZ_\private\200286D3\refvertexshader.vsh private\200286D3\refvertexshader.vsh
+data=DATAZ_\private\200286D3\reffragmentshader.fsh private\200286D3\reffragmentshader.fsh
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/alftranseffectplugin.iby	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef ALFTRANSEFFECTPLUGIN_IBY
+#define ALFTRANSEFFECTPLUGIN_IBY
+
+ECOM_PLUGIN(AlfTransEffectPlugin.dll, AlfTransEffectPlugin.rsc)
+
+// This should be already included in GfxTransEffect.iby
+// The default file is the stub, but when our gfxtransadapter.dll has been compiled,
+// it will be included in ROM instead of the stub.
+// file=ABI_DIR\BUILD_DIR\GFXTRANSADAPTER.DLL		SHARED_LIB_DIR\GFXTRANSADAPTER.DLL
+
+ECOM_PLUGIN(TfxSrvPlugin.dll, TfxSrvPlugin.rsc)
+
+#endif // ALFTRANSEFFECTPLUGIN_IBY
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_4_0.dtd	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,86 @@
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset name CDATA #REQUIRED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/systemDefinition.xml	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition SYSTEM "systemDefinition.dtd"[
+
+ 	<!ENTITY layer_real_source_path "\sf\mw\uiaccelerator">
+ 	<!ENTITY layer_name "uiaccelerator">
+
+ 	<!ENTITY layer_file SYSTEM "systemDefinitionLayer.xml">
+ 	<!ENTITY targetDefinition_file SYSTEM "/epoc32/tools/systemDefinition/targetDefinition.xml">
+ 	<!ENTITY defaultbuild_file SYSTEM "/epoc32/tools/systemDefinition/default_build.xml">
+ 	<!ENTITY defaultclean_file SYSTEM "/epoc32/tools/systemDefinition/default_clean.xml">
+]>
+
+<SystemDefinition name="SystemDefinition" schema="1.4.0">
+  <systemModel>
+&layer_file;
+  </systemModel>
+  <build>
+&targetDefinition_file;
+
+		<configuration name="build" description="build layer" filter="">
+    	<layerRef layerName="&layer_name;"/>
+
+&defaultbuild_file;
+    </configuration>
+
+		<configuration name="clean" description="clean layer" filter="">
+    	<layerRef layerName="&layer_name;"/>
+
+&defaultclean_file;
+    </configuration>
+
+  </build>
+</SystemDefinition>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/systemDefinitionLayer.xml	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,68 @@
+<layer name="uiaccelerator">
+  
+  <module name="uiaccelerator">
+    <component name="uiaccelerator">
+      <unit unitID="uiaccelerator" mrp="" filter="not_build" bldFile="&layer_real_source_path;\group" name="uiaccelerator" />
+    </component>
+  </module>
+  
+  <module name="uiaccelerator_dom">
+    <component name="uiaccelerator_dom">
+      <unit unitID="uiaccelerator_dom" mrp="" bldFile="&layer_real_source_path;\uiaccelerator_dom\group" name="uiaccelerator_dom" />
+    </component>
+  </module>
+  <module name="uiaccel_inc">
+    <component name="uiaccel_inc">
+      <unit unitID="uiaccel_inc" mrp="" filter="S60_5_0" bldFile="&layer_real_source_path;\inc\group" name="uiaccel_inc" />
+    </component>
+  </module>
+
+ <module name="osncore">
+    <component name="osncore">
+      <unit unitID="osncore" mrp="" filter="S60_5_0" bldFile="&layer_real_source_path;\osncore\group" name="osncore" />
+    </component>
+  </module>
+
+ <module name="uimodel">
+    <component name="uimodel">
+      <unit unitID="uimodel" mrp="" filter="S60_5_0" bldFile="&layer_real_source_path;\uimodel\group" name="uimodel" />
+    </component>
+  </module>
+  
+  <module name="lctmanagement">
+    <component name="lctmanagement">
+      <unit unitID="lctmanagement" mrp="" filter="S60_5_0" bldFile="&layer_real_source_path;\lctmanagement\group" name="lctmanagement" />
+    </component>
+  </module>
+
+ <module name="uiacceltk">
+    <component name="uiacceltk">
+      <unit unitID="uiacceltk" mrp="" bldFile="&layer_real_source_path;\uiacceltk\group" name="uiacceltk" />
+    </component>
+  </module>
+
+ <module name="alfwidgets">
+    <component name="alfwidgets">
+      <unit unitID="alfwidgets" mrp="" filter="S60_5_0" bldFile="&layer_real_source_path;\alfwidgets\group" name="alfwidgets" />
+    </component>
+  </module>
+
+ <module name="thememanagement">
+    <component name="thememanagement">
+      <unit unitID="thememanagement" mrp="" filter="S60_5_0" bldFile="&layer_real_source_path;\thememanagement\group" name="thememanagement" />
+    </component>
+  </module>
+
+ <module name="declarativeui">
+    <component name="declarativeui">
+      <unit unitID="declarativeui" mrp="" filter="S60_5_0" bldFile="&layer_real_source_path;\declarativeui\group" name="declarativeui" />
+    </component>
+  </module>
+  
+  <module name="configchanges">
+    <component name="configchanges">
+      <unit unitID="configchanges" mrp="" bldFile="&layer_real_source_path;\internal\configchanges\group" name="configchanges" />
+    </component>
+  </module>
+  
+</layer>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_client_server_api/alf_client_server_api.metaxml	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,19 @@
+<?xml version="1.0" ?>
+<api id="06a8f7af63062d0aff730ccacb27dd5f" dataversion="1.0">
+  <name>ALF Client Server API</name>
+  <description>Client Server headers. Application developers shoud not need this</description>
+  <type>c++</type>
+  <subsystem>uiacceltk</subsystem>
+  <libs>
+    <lib name="alfappservercore.lib" />
+    <lib name="alfclient.lib" />
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_client_server_api/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 that exports the files belonging to 
+:                ALF Client Server API
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/alf/alfappserver.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfappserver.h)
+../inc/alf/alfappsrvsessionbase.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfappsrvsessionbase.h)
+../inc/alf/alfclientbase.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfclientbase.h)
+../inc/alf/alfappui.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfappui.h)
+../inc/alf/alfdirectclient.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfdirectclient.h)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_client_server_api/inc/alf/alfappserver.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,420 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Application server
+*
+*/
+
+
+
+#ifndef C_ALFAPPSERVER_H
+#define C_ALFAPPSERVER_H
+
+#include <AknServerApp.h>
+#include <w32std.h>
+#include <alf/alfmetricsinterface.h>    
+#include <alf/alfappui.h>
+#include <alf/alfextensionfactory.h>   
+#include <alf/alfconstants.h> 
+#include <uiacceltk/HuiCommand.h>
+#include <uiacceltk/HuiEnv.h> 
+#include <uiacceltk/HuiDisplay.h> 
+
+class CApaAppServiceBase;
+class CAlfAppSrvSessionBase;
+class CAlfEcomUtil; 
+class MWindowVisibilityObserver;
+class CAlfSrvSubSessionBase;
+class CAlfSrvTransEffect;
+class CAlfAppSrvSession;
+class CAlfSrvTextureManager;
+class MTransitionServer2;
+class CAlfSrvScreenBufferManager;
+
+/**
+ *  Application server class.
+ *
+ *  The server class is responsible of managing the sessions/services.
+ *
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS(CAlfAppServer) : public CAknAppServer
+    {   
+    
+public:
+
+    // Window group position compared to the client wg (=parent)
+    enum TAlfWGPostion
+        {
+        EBehindOfParent,
+        EOnTopOfParent,
+        EAbsoluteBackground,
+        EAlfWindowSize
+        };
+
+
+    /**
+     * Static constructor.
+     */
+    IMPORT_C static CAlfAppServer* NewAppServerL();
+
+    /**
+     * Destructor.
+     */
+    ~CAlfAppServer();
+    
+    /**
+     * Client is about to exit, free all resources for the specific client
+     *
+     * @param aClientId Unique identifier of client, usually address of client's 
+     *                  instance pointer
+     */ //Todo: as this is called from base class inside library, no need to export ?
+    IMPORT_C void HandleClientExit(TInt aClientId);
+    
+    /**
+     * Moves the server window group relative to the clinet (parent) wg.
+     *
+     * @param aWindowGroup Server window group
+     * @param aParentIdentifier Client side window group
+     * @param aPosition Server's wg position compared to the client's wg.
+     */
+    IMPORT_C void AdjustWindowGroupPositionL(
+        RWindowGroup& aWindowGroup, 
+        TInt aParentIdentifier, 
+        TAlfWGPostion aPosition );
+        
+    /**
+     * Get server's window server session.
+     *
+     * @return Window server session reference.
+     */
+    IMPORT_C RWsSession& WsSession() const;
+
+    /**
+     * Get metrics interface
+     *
+     * @return Metrics API. NULL if not set. Ownership not transferred.
+     */
+    IMPORT_C MAlfMetricsInterface* MetricsInterface();
+    IMPORT_C const MAlfMetricsInterface* MetricsInterface() const;
+
+    /**
+     * Set metrics interface
+     *
+     * @param aMetricsInterface Metrics API. Ownership not transferred.
+     */
+    IMPORT_C void SetMetricsInterface(MAlfMetricsInterface* aMetricsInterface);
+
+    /**
+     * Sets AppUi pointer.
+     *
+     * @param aAppUi AppUi pointer. Ownership not transferred.
+     */
+    void SetAppUi(CAlfAppUi* aAppUi);
+    
+    /**
+     * Get AppUi pointer
+     *
+     * @return AppUi pointer. NULL if not set. Ownership not transferred.
+     */
+    IMPORT_C CAlfAppUi* AppUi();
+        
+    /**
+     * Called when the focused window group is changed
+     *
+     * @param aSession Pointer to focused session
+     * @param aWgId Window group identifier of new session, needed only when embedded apps transition takes place
+     */
+    void FocusedWindowGroupChangedL( CAlfAppSrvSessionBase* aSession, TInt aWgId = KErrNotFound );
+    
+    /**
+     * Called when window visibility changes.
+     *
+     * @param aVisibilityFlags Visibility flags - see TWsVisibilityChangedEvent
+     * @param aDestination Associated window-owning control.
+     */
+    void WindowVisiblityChangedL( TUint aVisibilityFlags, CCoeControl* aDestination );
+
+    /**
+     * Checks ECom plug-ins.
+     */
+    void CheckForEcomPluginInstallUninstallL();
+
+    /**
+     * For setting observers which will receive notify when window visibility changes.
+     *
+     * @param aObserver observer implementing MWindowVisibilityObserver interface
+     * @param aClientId Identifier of a session so observer can be removed on queue when the session is terminated
+     */
+    IMPORT_C void SetWindowChangeObserverL(MWindowVisibilityObserver* aObserver, TInt aClientId); 
+
+    /**
+     * Returns a new container for sub sessions.
+     *
+     * @return Container. Ownership not transferred.
+     */
+    CObjectCon* NewContainerL();
+    
+// from base class CAknAppServer
+
+    /**
+     * From CAknAppServer
+     * Creates session/service based on the given service type.
+     * This is called by the framework when a client opens session with the 
+     * server.
+     *
+     * @param aServiceType Service type, which identifies the service.
+     * @return New service/session instance. Ownership transferred.
+     */
+    CApaAppServiceBase* CreateServiceL( TUid aServiceType ) const;
+    
+    /**
+     * From CAknAppServer
+     * Called when all client have exited.
+     */
+    void HandleAllClientsClosed();
+        
+public: // internals
+
+    /**
+     * Used by callback for asynchronous ecom implementation removal
+     */   
+    void DoSynchEcomImplementations();
+
+    MAlfExtension* CreateExtensionL(TInt aImplementationUid, TInt aImplementationId, const RMessage2 & aMessage );
+    
+    void DestroyedObject(TInt aFactoryUid);
+
+    void CreateTransitionEffectsL();
+    
+    CAlfSrvTransEffect* TransitionEffects();
+    
+	TInt CreateTfxServerPlugin();
+ 
+ 	MTransitionServer2* TfxServer();
+    
+    /**
+     * Sends an event to all clients. This method can be used for general purpose server to client
+     * notifications e.g. when server receives resource changed event or ws-events or
+     * something else as long as the clientside knows how to handle the event.  
+     */
+    void TriggerSystemEvent(TInt aEvent);
+    
+    void StartBackgroundTimerL(TInt aClientWg);
+    
+    void CancelBackgroundTimer();
+    
+    /**
+     * Returns maximum length of common command batch buffer.
+     * @return maximum length of common command batch buffer.
+     */
+    TInt CommonCommandBatchBufferMaxLength() const;
+
+    /**
+     * Gets common command batch buffer (unless it is already in use).
+     * Client must call ReleaseCommonCommandBatchBuffer to release buffer for 
+     * global use.
+     * @param aBuffer pointer descriptor which will point to common buffer.
+     * @return ETrue if common command batch buffer was given to client, EFalse otherwise.
+     */
+    TBool AcquireCommonCommandBatchBuffer( TPtr8& aBuffer );
+
+    /**
+     * Releases common command batch buffer for global use.
+     */
+    void ReleaseCommonCommandBatchBuffer();
+   
+    /**
+     * Returns reference to texture manager.
+     * @return reference to texture manager.
+     */
+    CAlfSrvTextureManager& TextureManager();
+    
+    /**
+     * Returns reference to screen buffer manager.
+     * @return reference to screen buffer manager.
+     */
+    CAlfSrvScreenBufferManager& ScreenBufferManager();
+
+    /**
+     * Goes through all the sessions and checks if one of them has the keyboard focus
+     */
+    TBool AlfClientHasFocus();
+    
+    /**
+     * This is typically called by the session when it receives EAlfNotifyAppVisibility event that
+     * it's windowgroup is getting hidden.
+     * 
+     * The session can query if there is some other alf application's window group above it 
+     * and set that other session as a new activesession  
+     */
+    CAlfAppSrvSessionBase* UpMostClientAboveWg( TInt aWgId );
+
+public:
+    
+    CAlfAppSrvSessionBase* iOldSession;
+
+    /**
+     * Second phase constructor. Called by framework.
+     * @param aFixedServerName server name.
+     */
+    void ConstructL( const TDesC& aFixedServerName );
+    
+private:
+
+    // private default constructor
+    CAlfAppServer();    
+
+    /**
+     * Checks if implementation exists.
+     */
+    TBool ImplementationExists(TUid aServiceType) const;
+    
+    /**
+     * Loads extension.
+     */
+    CAlfAppSrvSessionBase* LoadServiceExtensionL(TUid aServiceType);
+    
+    /**
+     * Creates new session implementation.
+     */
+    CAlfAppSrvSessionBase* NewImplementationL(TUid aServiceType);
+        
+    /**
+     * Initiate callback for asynchronous ecom implementation removal
+     */
+    void SyncEcomImplementations(TInt aClientId); 
+    
+    /**
+     * Rnd: logs the window groups
+     */
+    void LogWindowGroupsL() const;
+    
+    /**
+    * Ecom factory has been removed, command sessions to close assosiated objects
+    */
+    void NotifySessionsAboutDestroyedImplementation(TInt aFactoryUid);
+
+private:
+
+    // just to allow accessing Cone's session without CCoeStatic
+    RWsSession* iWs; 
+    
+    // backdrop window group identifier, cahcing this value allows us find status pane window group much faster
+    // should be initialized in leaving constructor once that is implemented 
+    TInt iBackDropWgIdentifier; 
+
+    // Metrics API. Not owned.
+    MAlfMetricsInterface* iMetricsInterface;
+    
+    // AppUi pointer. Not owned.
+    CAlfAppUi* iAppUi;
+    
+    // Window group id of the client
+    // This is updated when the client becomes focused.
+    TInt iLastActiveClientWg;
+    
+    // ECom observer.
+    CAlfEcomUtil* iEcomWatcher;
+    
+    struct TWindowChangeObserver
+        {
+        TWindowChangeObserver(MWindowVisibilityObserver* aObserver, TInt aClientId):iId(aClientId), iPtr(aObserver){}
+        TInt iId;
+        MWindowVisibilityObserver* iPtr;
+        };
+    
+    // list of sessions which are interested about window visibility changes
+    RArray<TWindowChangeObserver> iWindowChangeObservers;
+    
+    struct TServiceExtension
+        {
+        TServiceExtension():iImpl(0){}
+        operator==(const TInt aId)
+            {
+            return TInt(iImpl)==aId;
+            }
+        TUid iDestructorUid;
+        TUid iServiceUid;
+        CAlfAppSrvSessionBase* iImpl;
+        };
+    
+    // list of ecom based sessions 
+    RArray<TServiceExtension> iCustomSessions;
+    
+    // list of ecom based sessions that have been already destructed, 
+    // but the ECom Fw has not been notified yet
+    RArray<TInt> iRemovedArray;
+    
+    // Async callback for ecom callbacks
+    CAsyncCallBack* iAsynchOneShot;
+    
+    // For sub session objects. Own.
+    CObjectConIx* iObjectConIx;
+
+    
+    struct TAlfElementFactory
+        {
+        TAlfElementFactory():iImpl(0), iAccessCount(0){}
+        operator==(const TInt aId)
+            {
+            return iUid.iUid==aId;
+            }
+
+        TUid iDestructorUid;
+        TUid iUid;
+        MAlfExtensionFactory* iImpl;
+        TInt iAccessCount;
+        };
+    
+    RArray<TAlfElementFactory> iFactories;
+        
+    TInt iTransitionEffect;
+
+    // Transition effects framework
+    CAlfSrvTransEffect* iTransitionEffects;
+
+	// Tfx Server API (ECom plugin)
+    MTransitionServer2* iTfxServer;
+
+	// Tfx Server API destructor uid
+    TUid iTfxServerEComDestructorUID;
+
+    CPeriodic* iBackgroundTimer;
+    
+    /**
+     * Command batch buffer. This buffer is shared between all sessions.
+     * Owned.
+     */
+    HBufC8* iCommonCommandBatchBuffer;
+
+    /**
+     * Boolean variable indicating if common command batch buffer is in use.
+     */
+    TBool iCommonCommandBatchBufferInUse;
+    
+    /**
+     * Server side texture manager.
+     * Owned.
+     */
+    CAlfSrvTextureManager* iTextureManager;
+    
+    /**
+     * Server side screen buffer manager.
+     * Owned.
+     */
+    CAlfSrvScreenBufferManager* iScreenBufferManager;
+    
+    };
+
+#endif // C_ALFAPPSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_client_server_api/inc/alf/alfappsrvsessionbase.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,325 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Server session base class
+*
+*/
+
+
+
+#ifndef C_ALFAPPSRVSESSIONBASE_H
+#define C_ALFAPPSRVSESSIONBASE_H
+
+#include <AknServerApp.h>
+#include <alf/alfappserver.h>
+#include <alf/alfred.hrh>
+#include <alf/alfextensionfactory.h>
+#include <alf/alfconstants.h>
+
+#include <uiacceltk/HuiEnv.h>
+
+class CAlfAppServer;
+class CAlfAppUi;
+class CCoeControl;
+class CAlfSrvSubSessionBase;
+class CHuiControlGroup;
+
+// For window server visibility notifications 
+class MWindowVisibilityObserver
+    {
+public:
+    virtual void WindowFullyVisible() = 0;
+    virtual void WindowPartiallyVisible() = 0;
+    virtual void WindowNotVisible() = 0;
+    virtual CCoeControl* CoeControl() = 0; 
+    };
+
+NONSHARABLE_CLASS(CAlfClientMessage):public CBase
+    {
+public:    
+    static CAlfClientMessage* NewLC(TInt aSubsessionIdentifier, const RMessage2& aMessage)
+        {
+        CAlfClientMessage* me = new (ELeave) CAlfClientMessage();
+        me->iSubSession = aSubsessionIdentifier;
+        me->iMessage = aMessage;        
+        CleanupStack::PushL(me);
+        return me;
+        }
+
+    ~CAlfClientMessage()
+        {
+        if (!iMessage.IsNull())
+            {
+            iMessage.Complete(KErrCancel);
+            }
+        delete iInBuf;
+        delete iOutBuf;
+        delete iReplyPtr;
+        }
+ 
+    void CompleteMessageD(TInt aError)
+        {
+        if (aError == KErrNone)
+            {
+            aError = iMessage.Write(2,*iOutBuf);
+            }
+        iMessage.Complete(aError);
+        delete this;
+        }
+
+    void SetClientParams(const TInt2& aParams)
+        {
+        iDecodedOp = aParams.iInt1;
+        iClientId = aParams.iInt2;
+        }
+
+    static TBool Compare(const TInt* aValue, const CAlfClientMessage& aStruct)
+        {
+        return (*aValue == aStruct.iClientId);
+        }
+
+    TPtr8& ReplyBufAsTDes8()
+        {
+        __ASSERT_ALWAYS(iOutBuf, User::Invariant());
+        
+        if (!iReplyPtr)
+            {
+            iReplyPtr = new (ELeave) TPtr8(iOutBuf->Des());
+            }
+        return *iReplyPtr;
+        }
+
+public:
+    HBufC8* iInBuf;
+    HBufC8* iOutBuf;
+    TInt iSubSession;
+    TBool iIsAsync;
+    TInt iClientId;
+    TInt iDecodedOp;
+    RMessagePtr2 iMessage;
+    TPtr8* iReplyPtr;
+    };
+
+/**
+ *  Session/service class in the server side.
+ *
+ *  @since S60 v3.2
+ */
+class CAlfAppSrvSessionBase : public CAknAppServiceBase, public MAlfInterfaceProvider
+    {
+public:
+    /**
+    * Default constructor, stores pointer to server instance
+    * 
+    * @param aServer Server which the client has connected.
+    */
+    IMPORT_C CAlfAppSrvSessionBase(const CAlfAppServer* aServer);
+
+    /**
+    * Default constructor, fetches and stores pointer to server instance using ccoestatic
+    */    
+    IMPORT_C CAlfAppSrvSessionBase();
+    
+    /**
+    * Destructor, singals server to free resources specific for this client
+    */
+    IMPORT_C ~CAlfAppSrvSessionBase();
+        
+// new methods    
+
+    /**
+     * From CAlfAppSrvSessionBase
+     * Called when a message is received from the client.
+     * 
+     * @param aMessage Message parameters.
+     */
+    virtual void DoHandleCommandL(const RMessage2& aMessage) = 0;
+        
+    /**
+     * Gets the drawing area of the session
+     * 
+     * @return TRect of the drawing area
+     */
+    IMPORT_C virtual TRect ClientDrawingArea() const;
+    
+    /**
+     * From CAlfAppSrvSessionBase
+     * Client's window group received focus.
+     * 
+     * @param aDoTransitionEffect Do fade in transision (RnD)
+     */
+    IMPORT_C virtual void FocusGainedL( TBool aDoTransitionEffect );
+    
+    /**
+     * From CAlfAppSrvSessionBase
+     * Client's window group lost focus.
+     * 
+     * @param aDoTransitionEffect Do fade out transision (RnD)
+     * @return Did transition? (RnD)
+     */
+    IMPORT_C virtual TBool FocusLostL( TBool aDoTransitionEffect );
+    
+    // have to create new extension mechanism as CApaAppServiceBase breaks the chain
+    // by defining CBase's ExtensionInterface() as private 
+    IMPORT_C virtual void ExtensionInterfaceL(TUid aInterfaceId, TAny*& aImplementation);
+
+    /**
+    * Ecom implementation for specific factory has been removed
+    * Close all subsessions referring to that
+    */
+    IMPORT_C virtual void FactoryDestroyed(TInt aFactoryUid);
+    
+     /**
+     * Returns the preferred window group position of the session.
+     *
+     * @return Preferred position.
+     */
+    IMPORT_C virtual CAlfAppServer::TAlfWGPostion PreferredWindowGroupPosition() const;
+    
+    /**
+     * Returns the preferred refresh mode of the session.
+     *
+     * @return Preferred refresh mode.
+     */
+    IMPORT_C virtual THuiRefreshMode PreferredRefreshMode() const;
+
+    // for convenience, to avoid CCoeStatic    
+    IMPORT_C CAlfAppServer* AlfServer();
+    IMPORT_C CAlfAppUi* AlfAppUi();
+
+    
+public: // from MAlfInterfaceProvider
+    IMPORT_C TAny* GetInterfaceL(const THuiInterfaceSupport& aType, TInt aHandle);
+    IMPORT_C TInt GetHandleFromInterface(const THuiInterfaceSupport& aType, TAny* aInterface);
+    IMPORT_C CAlfLayoutManager* LayoutManager() const;
+    IMPORT_C CHuiEnv* SharedHuiEnv() const;
+    IMPORT_C TInt HandleCurrentCommanndAsynch();
+    IMPORT_C void CompleteCmd(TInt aCommadIdentifier, TInt aResult);
+    IMPORT_C void AlfInterfaceProviderExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+
+public: // utilities
+
+   /**
+     * From CAlfAppSrvSessionBase
+     * Returns the client's window group id.
+     * 
+     * @return Wg ID. KErrNotFound if not set.
+     */
+    TInt ClientWindowGroup() const;
+    
+    /**
+     * Sets the window group ID.
+     * Server uses this information to calculate its screen position in Symbian window tree
+     *
+     * @param aId Wg ID
+     */
+    IMPORT_C void SetClientWindowGroupId(TInt aId);
+
+    /**
+     * Finds all the subsession which implement the interface.
+     *
+     * @param aArray Array which the function fills of subsession on return.
+     * @param aType Type of the interface that we are looking for.
+     */
+    void GetSubsessionsByTypeL( RPointerArray<CAlfSrvSubSessionBase>& aArray, const THuiInterfaceSupport& aType );
+
+    // Closes the subsession
+    void CloseSubSession( const RMessage2& aMessage );
+    
+    /**
+     * Returns ETrue if this session owns specified subsession handle.
+     * @param aHandle subsession handle to be checked.
+     * @return ETrue if subsession exists, EFalse otherwise.
+     */
+    TBool HasSession( TInt aSubSessionHandle ) const;
+     
+    // Returns subsession basd on the handle
+    CAlfSrvSubSessionBase& SubSession( TInt aSubSessionHandle );
+
+    CAlfClientMessage* CreateNewMessageHolderL(const RMessage2& aMessage);
+    
+    void HandleEventL(TAny* aCtrlPtr, TAny* aVisualPtr, const THuiEvent& aEvent);
+    
+    void StartPointerHandling();
+    void FlushPointerHandling();
+    void TriggerPointerEvent(const RMessage2* aMessage);
+    void CancelPointerEvents();
+    
+    // Methods for sending general system events to clients
+    void GetSystemEvents(const RMessage2* aMessage);
+    void TriggerSystemEvent(TInt aEvent);
+    void CancelSystemEvents();
+
+    // embedded apps support
+    void SetParentWindowGroupId(TInt aParentId);
+    TInt ParentWindowGroupId();
+    void ResetRootlayerTransformationsL();    
+
+    /**
+     * Sets session's max fps limiter to half, used if client's window does not have keyboard focus
+     * @param aOnBackground use lowered max fps (ETrue/EFalse)
+     */
+    virtual void SetBackgroundMaxFps( TBool /*aOnBackground*/ ) {}; //empty implementation for base class.
+
+
+    //RnD
+    void ActivateContainerLayoutL(TBool aActivate);    
+        
+protected: // new methods
+
+    // must be called from derived class to complete the construction 
+    IMPORT_C void BaseConstructL();
+
+protected: // internal utilities
+
+    // Checks if the function is meant for subsession creation
+    TBool IsSubSessionCreationFunction(const RMessage2& aMessage) const;
+    
+    // creates subsession
+    CAlfSrvSubSessionBase* CreateSubSessionLC(const RMessage2& aMessage);
+
+protected: // from baseclasses
+
+    IMPORT_C void ServiceError(const RMessage2& aMessage,TInt aError);
+    IMPORT_C TInt CountResources();
+    IMPORT_C void Disconnect(const RMessage2& aMessage);
+	/** ! CSession2 */
+	IMPORT_C TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
+
+    
+
+private:
+
+    /**
+     * From CAknAppServiceBase.
+     * Called by the framework when a client requests a sevice.
+     *
+     * @param aMessage Client's message. 
+     */
+    IMPORT_C void ServiceL(const RMessage2& aMessage);
+    
+    TBool DoSubSessionCmdL(const RMessage2& aMessage);
+
+    void CloseSubSession(TInt aHandle);
+
+private: // data
+
+    CAlfAppServer* iHost; // stores pointer to server instance 
+                          // (we could utilise CSession2::Server() for this functionality, but just for sake of simplicity)
+ 
+    class TPrivateData;                          
+    TPrivateData* iData;
+    };
+
+#endif // C_ALFAPPSRVSESSIONBASE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_client_server_api/inc/alf/alfappui.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,210 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Application UI definition
+*
+*/
+
+
+
+#ifndef C_ALFAPPUI_H
+#define C_ALFAPPUI_H
+
+#include <aknappui.h>
+#include <alf/alfconstants.h>
+
+class CHuiEnv;
+class CHuiRoster;
+class CHuiControlGroup;
+class CHuiVisual;
+class CAlfAppServer;
+class CAlfSharedDisplayCoeControl;
+class CHuiDisplay;
+class CAlfAppSrvSessionBase;
+class CAlfSrvResourceManager;
+class CAlfSrvSettingsHandler;
+
+enum TAlfSrvSetting
+    {
+    EAlfSrvSettingDefaultFramerate,
+    EAlfSrvSettingMaxCpuUsage,
+    EAlfSrvSettingMaxResourceCacheSize,
+    EAlfSrvSettingEffectsComplexityFactor // includes the RnD flag changes.
+    };
+
+class MAlfSrvSettingsObserver
+    {
+public:  
+    virtual void MAlfSrvUintSettingChangedL( TAlfSrvSetting aSetting, TUint aNewValue ) = 0;
+    };
+
+
+/**
+ *  Application UI class.
+ *
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS(CAlfAppUi) : public CAknAppUi, public MAlfSrvSettingsObserver
+    {
+
+public: // new methods 
+    
+    /**
+     * Constructor
+     */
+    IMPORT_C CAlfAppUi();
+
+    /**
+     * Destructor
+     */
+    IMPORT_C ~CAlfAppUi();
+    
+    /**
+     * Retuns a reference to CHuiEnv object.
+     * @return HuiEnv. Ownership not transferred.
+     */
+    CHuiEnv& HuiEnv();
+    
+    /**
+     * Called when all clients have existed.
+     */
+    void AllClientsClosed();
+    
+    /**
+     * Called when client is about to exit.
+     * @param aClientId Client to be removed.
+     */
+    void FreeResourcesForClient( TInt aClientId );
+    
+    /**
+     * Returns a common window-owning control
+     * @param Control. NULL if not used. Ownership not transferred.
+     */
+    IMPORT_C CCoeControl* Container();
+    
+    /**
+     * Adds display into the common container.
+     * @param aDisplay to be added.
+     */
+    IMPORT_C void AppendDisplayOnSharedWindowL( CHuiDisplay& aDisplay );
+
+    void AppendTvDisplayOnSharedWindowL( CHuiDisplay& aDisplay );
+
+    void RemoveTvDisplayOnSharedWindow( CHuiDisplay& aDisplay );
+    
+    CHuiDisplay* CAlfAppUi::FindTvDisplayOnSharedWindow();
+    
+    CAlfSrvSettingsHandler& SettingsHandler();
+    
+    /**
+     * Sets window server fading to common window-owning control.
+     * @param aFading ETrue if it needs to be faded, EFalse otherwise.
+     */
+    void SetContainerNonFading( TBool aFading );
+    
+public: // from base classes    
+
+// from base class CAknAppUi
+
+    /**
+     * From CAknAppUi.
+     * 2nd phase constructor. Called by the framework after 
+     * the 1st phase construction.
+     */
+    IMPORT_C void ConstructL();
+    
+    /**
+     * From CAknAppUi.
+     * Called by the frawework when a system event is received.
+     *
+     * @param aEvent Occurred event.
+     */
+    IMPORT_C void HandleSystemEventL(const TWsEvent& aEvent);
+
+    /**
+     * From CAknAppUi.
+     * Called by the frawework when a system event is received.
+     *
+     * @param aEvent Occurred event.
+     */    
+    IMPORT_C void HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination);
+    
+    /**
+     * From CAknAppUi.
+     * Called when framework calls rendezvous.
+     *
+     * @return ETrue. Meaning the framework will synchronize the application to the starter
+     */
+    IMPORT_C TBool FrameworkCallsRendezvous() const;
+    
+    /**
+     * From CAknAppUi.
+     * Called when system resources changes.
+     *
+     * @param aType Changed resource. 
+     */
+    IMPORT_C void HandleResourceChangeL( TInt aType );
+   
+   /**
+     * From CAknAppUi.
+     * Called by the frawework when a command is received.
+     *
+     * @param aCommand The command
+     */
+    IMPORT_C void HandleCommandL(TInt aCommand);
+    
+    void MAlfSrvUintSettingChangedL( TAlfSrvSetting aSetting, TUint aNewValue );
+    
+    /**
+     * Posts QTcommand  buffer from clientwindow  to CanvasVisual
+     *
+     * @param  aParams Commandbuffer parameters containg window information
+     *                 and QT commandbuffer
+     */        
+    void PostQTCommandBufferL( TAlfQtCommandBufferParams aParams );
+public: // internal utilities
+    void StartPointerEventHandling();
+    void EndPointerEventHandling();
+    void UpdateActiveSession(CAlfAppSrvSessionBase* aSession);
+    
+    TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
+
+    TInt FirstAlfControlGroupIndex( TInt aScreenNumber = 0);    
+    TInt LastAlfControlGroupIndex( TInt aScreenNumber = 0);    
+    void ShowControlGroupL(CHuiRoster& aRoster, CHuiControlGroup& aGroup, TInt aWhere, TInt aScreenNumber );
+	void SetClientWindowForDrawingL(TInt aWindowGroupId, TInt aClientWindowHandle, CHuiVisual* aVisual);
+    /**
+     * Moves the server window group relative to the clinet (parent) wg.
+     *
+     * @param aWindowGroup Server window group
+     * @param aParentIdentifier Client side window group
+     * @param aPosition Server's wg position compared to the client's wg.
+     */
+    void AdjustWindowGroupPositionL(
+        TInt aParentIdentifier, 
+        TInt aPosition );
+    void SetAlfWindowGroupId(TInt aWgId);
+    void NotifyLowMemory(TInt aAmountOfFreeMemRequested);
+    TInt ForceSwRendering(TBool aEnabled);
+    
+private:
+
+    void CreateHuiEnvL();
+    
+private:
+
+    class CAlfAppUiData;
+    CAlfAppUiData* iData;
+    };
+
+#endif // C_ALFAPPUI_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_client_server_api/inc/alf/alfclientbase.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 class for the alfredserver.exe
+*
+*/
+
+
+
+#ifndef R_ALFCLIENTBASE_H
+#define R_ALFCLIENTBASE_H
+
+#include <AknServerApp.h>
+#include <f32file.h>
+
+class CAlfEnv;
+class RApaLsSession;
+class CApaCommandLine;
+/**
+ *  Alfred client base.
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+class RAlfClientBase : public RAknAppServiceBase
+    {
+    
+public:
+
+    /**
+     * Constructor
+     */
+    IMPORT_C RAlfClientBase(TInt aServiceUid);
+     
+     /**
+     * Opens connection to the server.
+     * Must be called before any other activity!
+     */
+    IMPORT_C void OpenL();
+    
+    /**
+	* Grants server access to given private file
+	* This access is valid as long as the session remains alive 
+	*
+	* @param aFileName          Full filename of file to be shared
+    * @param aObjectIdentfier   To which object the generated token will be passed
+    * @param aCommandId         Command indetifier that allows server implementation to distinguish this particular file
+    *
+	* @return                   Any system wide error code, KErrNone on success
+	*/
+    IMPORT_C TInt GrantAccessToPrivateFile( const TDesC& aFileName, 
+                                            TInt aObjectIdentfier, 
+                                            TInt aCommandId );
+    /**
+	* Grants server access to given private file
+	* This access is valid as long as the session remains alive 
+	*
+	* @param aOpenFile          Open filehandle, can reside other process gage as well
+    * @param aObjectIdentfier   To which object the generated token will be passed
+    * @param aCommandId         Command indetifier that allows server implementation to distinguish this particular file
+    *
+	* @return                   Any system wide error code, KErrNone on success
+	*/
+    IMPORT_C TInt GrantAccessToPrivateFile( const RFile& aFile, 
+                                            TInt aObjectIdentfier, 
+                                            TInt aCommandId );
+
+    /**
+    *! internal
+    */
+    void SetAlfEnv(CAlfEnv& aAlf);
+    
+        
+// from base class RAknAppServiceBase
+
+    /**
+     * From RAknAppServiceBase.
+     * Returns the service UID which the server implements.
+     *
+     * @return Service UID supported.
+     */
+    IMPORT_C TUid ServiceUid() const;
+
+    void StartAsyncL(TRequestStatus* aStatus);
+    void CompleteAsynchConstructionL();
+
+protected:
+
+    /**
+     * Construct the server name.
+     */
+    IMPORT_C static void ConstructServerName( 
+        TName& aServerName, 
+        TUid aAppServerUid, 
+        TUint aServerDifferentiator );
+        
+    /**
+     * Starts the server.
+     */
+    IMPORT_C TUint StartServerL( TUid aAppUid );
+    
+    /**
+     * Launches the application.
+     */
+    IMPORT_C void LaunchAppL( 
+        TUid aAppUid, 
+        TUint aServerDifferentiator, 
+        TThreadId& aThreadId );                                  
+
+private:
+    TInt iServiceUid;
+    CAlfEnv* iEnv;
+    CApaCommandLine* iCmdLine;
+   	RApaLsSession* iApa;
+    };
+
+NONSHARABLE_CLASS(CAlfAsynchStartup): public CActive 
+    {
+public:
+        
+    /**
+     * Starts the server. Does not return client for caller, so to be utilized only by FW to trigger server creation
+     */
+    IMPORT_C static void StartL();
+
+private:
+    CAlfAsynchStartup();
+    void RunL();
+    void DoCancel();
+    RAlfClientBase iClient;
+    };
+
+
+#endif // R_ALFCLIENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_client_server_api/inc/alf/alfdirectclient.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* 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:   This direct client to alf server, that does not require Alf 
+*                environment.
+*                
+*/
+
+
+#ifndef _ALFDIRECTCLIENT_H_
+#define _ALFDIRECTCLIENT_H_
+
+#include <alf/alfclientbase.h>
+#include <alf/alfconstants.h>
+
+NONSHARABLE_CLASS( RAlfDirectClient ): public RAlfClientBase
+    {
+    public:
+    /**
+     * Constructor
+     */
+    IMPORT_C RAlfDirectClient();
+    
+    /**
+     * Disconnect from the server. Must be called before destruction
+     */ 
+    IMPORT_C void Disconnect();
+    
+    
+    /** 
+     * MeasureFPS
+     * 
+     * Several FPS counters can be ongoing simultaniously. If a measurement is 
+     * started for already ongoing measurement identifier, then the first 
+     * measurement is disgarded.
+     * 
+     * @param   aId Unique identifier for the measurement.
+     * @param   aStart  ETrue, if starting measurement. EFalse, if stopping 
+     *          and logging measurement result.
+     */
+    IMPORT_C void MeasureFPS( TInt32 aId, TBool aStart );
+    
+    /**
+     * EnableLowMemoryState
+     *
+     * Enables low memory state in ALF
+     * 
+     * @param aMode ETrue to enable low memory, EFalse to disable  
+     */
+    IMPORT_C void EnableLowMemoryState( TBool aMode );
+
+    /**
+     * Forces SW rendering to be used. 
+     * This method is intended to be only used for testing
+     * of SW rendering.
+     * @param aEnabled ETrue - SW rendering enabled, 
+     *                 EFalse - SW rendering disabled.
+     * @return error code.
+     */
+    IMPORT_C TInt ForceSwRendering( TBool aEnabled );
+    
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/alf_core_toolkit_api.metaxml	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="dbd475fa276adcc2365cee618694e5c2" dataversion="1.0">
+  <name>ALF Core Toolkit API</name>
+  <description>Core toolkit library interface. Only applications running as ALF extensions are allowed to link into this interface directly.</description>
+  <type>c++</type>
+  <subsystem>uiacceltk</subsystem>
+  <libs>
+    <lib name="hitchcock.lib" />
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 that exports the files belonging to 
+:                ALF Core Toolkit API
+*
+*/
+
+
+
+// The new Symbian Build System (SBS, Raptor) gives warnings from ##
+// concatenation. Use __GNUC__ >= 3 to check the SBS version!
+#ifndef __SERIES60_30__
+#include <platform_paths.hrh>
+#if __GNUC__ >= 3
+#define CORETOOLKIT_EXPORT_FOLDER(P) ../P
+#else
+#define CORETOOLKIT_EXPORT_FOLDER(P) ../##P
+#endif
+#else
+#if __GNUC__ >= 3
+#define MW_LAYER_PLATFORM_EXPORT_PATH(S) /epoc32/include/oem/S
+#define CORETOOLKIT_EXPORT_FOLDER(P) ../alf_core_toolkit_api/P
+#else
+#define MW_LAYER_PLATFORM_EXPORT_PATH(S) /epoc32/include/oem/##S
+#define CORETOOLKIT_EXPORT_FOLDER(P) ../alf_core_toolkit_api/##P
+#endif
+#endif
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiTextureIf.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiTextureIf.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiAnimatedTexture.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiAnimatedTexture.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiMappingFunctions.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiMappingFunctions.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiTimedPoint.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiTimedPoint.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiBorderBrush.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiBorderBrush.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiTextureProcessor.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiTextureProcessor.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiImageBrush.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiImageBrush.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiMaterial.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiMaterial.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiDisplay.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiDisplay.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiTexture.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiTexture.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiImage.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiImage.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiGc.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiGc.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiPanic.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiPanic.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiBrushArray.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiBrushArray.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huitk.hrh)     MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huitk.hrh)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiMesh.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiMesh.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huiframebrush.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huiframebrush.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huiproceduralmesh.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huiproceduralmesh.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiAnchorLayout.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiAnchorLayout.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiImageLoaderUtil.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiImageLoaderUtil.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huieventhandler.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huieventhandler.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huigifanimationtexture.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huigifanimationtexture.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huiskinanimationtexture.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huiskinanimationtexture.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiEnv.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiEnv.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiDropShadowBrush.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiDropShadowBrush.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiDisplayCoeControl.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiDisplayCoeControl.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiVisuals.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiVisuals.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiUtil.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiUtil.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huifixmath.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huifixmath.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiTextVisual.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiTextVisual.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiTextStyleManager.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huitextstylemanager.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiControl.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiControl.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiLayout.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiLayout.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/hitchcock.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/hitchcock.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiFont.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiFont.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiBrushes.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiBrushes.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiTextStyle.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huitextstyle.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huiviewportlayout.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huiviewportlayout.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huimetric.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huimetric.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiTextureHandle.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiTextureHandle.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiDeckLayout.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiDeckLayout.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiGradientBrush.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiGradientBrush.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiStatic.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiStatic.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiCurvePath.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiCurvePath.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiMeshVisual.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiMeshVisual.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiGridLayout.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiGridLayout.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiSegmentedTexture.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiSegmentedTexture.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiDrawing.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiDrawing.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiRealSize.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiRealSize.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiTextureManager.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiTextureManager.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiRealPoint.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiRealPoint.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiShadowedTexture.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiShadowedTexture.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huim3gmesh.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huim3gmesh.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiRoster.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiRoster.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huifontspecification.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huifontspecification.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiShadowBorderBrush.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiShadowBorderBrush.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiInteractionInterval.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiInteractionInterval.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiImageVisual.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiImageVisual.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiTextMesh.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiTextMesh.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiVisual.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiVisual.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiSessionObject.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiSessionObject.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiTransformation.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiTransformation.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiTimedValue.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiTimedValue.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiTimeObserver.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiTimeObserver.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiBrush.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiBrush.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiOwnedPointer.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiOwnedPointer.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiLayouts.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiLayouts.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiRealRect.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiRealRect.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiScheduler.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiScheduler.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiEvent.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiEvent.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiControlGroup.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiControlGroup.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiObserverArray.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiObserverArray.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiRenderer.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiRenderer.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiS60Skin.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiS60Skin.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiPlatform.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiPlatform.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huifontmanager.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huifontmanager.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huitk.rh)     MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huitk.rh)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiSkin.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiSkin.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiFlowLayout.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiFlowLayout.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiSoftKeyControl.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiSoftKeyControl.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiCurvePathLayout.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiCurvePathLayout.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiCommand.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiCommand.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiLineVisual.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiLineVisual.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiBitmapProvider.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiBitmapProvider.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiThemeManager.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiThemeManager.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huidisplaybackgrounditem.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huidisplaybackgrounditem.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huitextureautosizeparams.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huitextureautosizeparams.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huidropshadow.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huidropshadow.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiCanvasVisual.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiCanvasVisual.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/HuiCanvasCmdBufferReader.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiCanvasCmdBufferReader.h)
+CORETOOLKIT_EXPORT_FOLDER(inc/uiacceltk/huilowmemoryobserver.h)    MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/huilowmemoryobserver.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiAnchorLayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,786 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition for CHuiAnchorLayout. Anchor layouts allow specifying the 
+*                placement of child visuals using anchors, that can be relative or absolute
+*                coordinates and attached to a specific edge of the layout.
+*
+*/
+
+
+
+#ifndef __HUIANCHORLAYOUT_H__
+#define __HUIANCHORLAYOUT_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiLayout.h>
+#include <uiacceltk/HuiTimedPoint.h>
+
+
+/* Forward declarations */
+class CHuiEnv;
+class CHuiLayout;
+class CHuiControl;
+
+
+/** for internal use only */
+enum THuiAnchorBitmask
+    { 
+    EHuiAnchorBitmaskHorizontal = 0x000F,
+    EHuiAnchorBitmaskVertical = 0x00F0
+    };
+
+/** for internal use only */
+enum THuiAnchorBitmaskShift
+   {
+    EHuiAnchorBitmaskShiftHorizontal = 0,
+    EHuiAnchorBitmaskShiftVertical = 4
+    };
+
+/** for internal use only */
+enum THuiAnchorAxis
+    {
+    EHuiAnchorAxisHorizontal = 0,
+    EHuiAnchorAxisVertical = 1
+    };
+
+/** for internal use only */
+enum THuiAnchorProximity
+    {
+    EHuiAnchorProximityNone = 0,    
+    EHuiAnchorProximitySize,
+    EHuiAnchorProximityNear,
+    EHuiAnchorProximityCenter,
+    EHuiAnchorProximityFar
+    };
+
+/** 
+ * Anchor type. Used to determine which edge or corner of a child visual is 
+ * defined by an anchor.
+ *
+ * @note that if width or height are used as one anchor, they must be combined 
+ * with an appropriate anchor in order to unambiguously determine the size and 
+ * position of the child.
+ */
+enum THuiAnchorType
+    {
+    EHuiAnchorTypeNone = EHuiAnchorProximityNone,
+    
+    EHuiAnchorTypeWidth = EHuiAnchorProximitySize << EHuiAnchorBitmaskShiftHorizontal,
+    EHuiAnchorTypeLeft = EHuiAnchorProximityNear << EHuiAnchorBitmaskShiftHorizontal,
+    EHuiAnchorTypeHCenter = EHuiAnchorProximityCenter << EHuiAnchorBitmaskShiftHorizontal,
+    EHuiAnchorTypeRight = EHuiAnchorProximityFar << EHuiAnchorBitmaskShiftHorizontal,
+    
+    EHuiAnchorTypeHeight = EHuiAnchorProximitySize << EHuiAnchorBitmaskShiftVertical,
+    EHuiAnchorTypeTop = EHuiAnchorProximityNear << EHuiAnchorBitmaskShiftVertical,
+    EHuiAnchorTypeVCenter = EHuiAnchorProximityCenter << EHuiAnchorBitmaskShiftVertical,
+    EHuiAnchorTypeBottom = EHuiAnchorProximityFar << EHuiAnchorBitmaskShiftVertical,
+    
+    
+    EHuiAnchorTypeSize = EHuiAnchorTypeHeight | EHuiAnchorTypeWidth,
+
+    EHuiAnchorTypeTopLeft = EHuiAnchorTypeTop | EHuiAnchorTypeLeft,
+    EHuiAnchorTypeTopCenter = EHuiAnchorTypeTop | EHuiAnchorTypeHCenter,
+    EHuiAnchorTypeTopRight = EHuiAnchorTypeTop | EHuiAnchorTypeRight,
+
+    EHuiAnchorTypeCenterLeft = EHuiAnchorTypeVCenter | EHuiAnchorTypeLeft,
+    EHuiAnchorTypeCenter = EHuiAnchorTypeVCenter | EHuiAnchorTypeHCenter,
+    EHuiAnchorTypeCenterRight = EHuiAnchorTypeVCenter | EHuiAnchorTypeRight,
+    
+    EHuiAnchorTypeBottomLeft = EHuiAnchorTypeBottom | EHuiAnchorTypeLeft,
+    EHuiAnchorTypeBottomCenter = EHuiAnchorTypeBottom | EHuiAnchorTypeHCenter,
+    EHuiAnchorTypeBottomRight = EHuiAnchorTypeBottom | EHuiAnchorTypeRight
+    };
+
+/** 
+ * Anchor origin, relative to a particular edge or corner. Direction is 
+ * measured along positive x and y axes, as modified by the metric used.
+ */
+enum THuiAnchorAttachmentOrigin
+    {
+    EHuiAnchorAttachmentOriginNone = EHuiAnchorTypeNone,
+    
+    EHuiAnchorAttachmentOriginLeft = EHuiAnchorTypeLeft,
+    EHuiAnchorAttachmentOriginHCenter = EHuiAnchorTypeHCenter,
+    EHuiAnchorAttachmentOriginRight = EHuiAnchorTypeRight,
+    
+    EHuiAnchorAttachmentOriginTop = EHuiAnchorTypeTop,
+    EHuiAnchorAttachmentOriginVCenter = EHuiAnchorTypeVCenter,
+    EHuiAnchorAttachmentOriginBottom = EHuiAnchorTypeBottom,
+    
+    EHuiAnchorAttachmentOriginTopLeft = EHuiAnchorTypeTopLeft, 
+    EHuiAnchorAttachmentOriginTopCenter = EHuiAnchorTypeTopCenter, 
+    EHuiAnchorAttachmentOriginTopRight = EHuiAnchorTypeTopRight, 
+
+    EHuiAnchorAttachmentOriginCenterLeft = EHuiAnchorTypeCenterLeft,
+    EHuiAnchorAttachmentOriginCenter = EHuiAnchorTypeCenter, 
+    EHuiAnchorAttachmentOriginCenterRight = EHuiAnchorTypeCenterRight, 
+    
+    EHuiAnchorAttachmentOriginBottomLeft = EHuiAnchorTypeBottomLeft, 
+    EHuiAnchorAttachmentOriginBottomCenter = EHuiAnchorTypeBottomCenter, 
+    EHuiAnchorAttachmentOriginBottomRight = EHuiAnchorTypeBottomRight
+    };
+    
+/** 
+ * Type of attachment point used when attaching an anchor to another
+ * anchor in the same layout.
+ */
+enum THuiAnchorAttachmentType
+    {
+    EHuiAnchorAttachToParent = -1
+    };
+    
+    
+/** 
+ * Determines which corner of a child visual is positioned by the anchor
+ * @deprecated, only retained for use with deprecated SetAnchor routines, use
+ *                        THuiAnchorAttachmentOrigin instead with new APIs
+ */
+enum THuiAnchor
+    {
+    /** Anchor that defines the top left corner of a visual. */
+    EHuiAnchorTopLeft,
+
+    /** Anchor that defines the bottom right corner of a visual. */
+    EHuiAnchorBottomRight
+    };
+
+
+/** 
+ * Anchor origins.
+ * @deprecated, only retained for use with deprecated SetAnchor routines, use
+ *                        THuiAnchorAttachmentOrigin instead with new APIs
+ */
+enum THuiAnchorOrigin
+    {
+    EHuiAnchorOriginLeft,
+    EHuiAnchorOriginHCenter,
+    EHuiAnchorOriginRight,
+    EHuiAnchorOriginTop,
+    EHuiAnchorOriginVCenter,
+    EHuiAnchorOriginBottom
+    };
+
+
+/** 
+ *Anchor metric types, for offsets and sizes.
+ * @deprecated, only retained for use with deprecated SetAnchor routines, use
+ *                        THuiMetric instead with new APIs
+ */
+enum THuiAnchorMetric
+    {
+    /** Use absolute pixel coordinates to specify the values. */        
+    EHuiAnchorMetricAbsolute,
+    /** 
+     * Use the size of the visual 
+     * either normalized between 0.0 (at origin) and 1.0 (farthest away edge)
+     * or -0.5 (min) and +0.5 (0.0 being always at the origin). For example if you 
+     * use EHuiAnchorOriginLeft with EHuiAnchorMetricRelativeToSize, the 
+     * left edge is at 0.0, and the right edge at 1.0. But if you use any of 
+     * the center origins (EHuiAnchorOriginHCenter or EHuiAnchorOriginVCenter),
+     * then the left/top edge is at -0.5 and right/top edge is at +0.5.
+     */
+    EHuiAnchorMetricRelativeToSize
+    };
+
+
+/**
+ * CHuiAnchorLayout is a layout that allows visuals to be positioned with 
+ * flexible relative anchor points. 
+ *
+ * To use this class, an anchor layout is created, and then a number of anchor
+ * points are added to it using calls to the SetAnchor() method. The visuals
+ * inside the layout will be stretched between these anchor points.
+ *
+ * By default, each child is set to cover the entire anchor layout area.
+ * @todo This seems to be incorrect. Default behaviour seems to be that
+ * a child is invisible until its anchor points have been set.
+ * 
+ * @see CHuiAnchorLayout::SetAnchor() for more information about anchors.
+ */
+NONSHARABLE_CLASS(CHuiAnchorLayout) : public CHuiLayout
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Construct a new anchor layout and give its ownership to a control.
+     *
+     * @param aOwnerControl  Owner control.
+     * @param aParentLayout  Parent layout for the new anchor layout.
+     */
+    IMPORT_C static CHuiAnchorLayout* AddNewL(CHuiControl& aOwnerControl,
+                                              CHuiLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     */
+    CHuiAnchorLayout(MHuiVisualOwner& aOwner);
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CHuiAnchorLayout();
+
+
+    /* Methods. */
+
+    /**
+     * Resets all the anchors.
+     */
+    IMPORT_C void Reset();
+
+    /**
+     * Anchors a child visual's corner to specific position within this layout.
+     *
+     * @deprecated, use new @c Attach APIs with THuiMetric support.
+     * See the relevant API documentation for an example of how to migrate your code
+     *
+     * Each child can have two anchors: the top left and bottom right corners 
+     * of the child visual. These anchors can be fastened to any point within 
+     * this layout, as specified by the other parameters.
+     *
+     * In a typical case you set two anchors (both EHuiAnchorTopLeft and 
+     * EHuiAnchorBottomRight), which specifies both size and position for the 
+     * child. However it is also possible to set only the EHuiAnchorTopLeft 
+     * anchor, which only positions the child without affecting it's size.
+     * 
+     * @see RemoveAnchor() to remove an achor definition.
+     * 
+     * @note  After updating anchors, you should call 
+     *        CHuiLayout::UpdateChildrenLayout(), to cause the anchors to be 
+     *        applied to child positions and/or sizes.
+     * 
+     * For example the following code will anchor child visual number 0 in 
+     * the middle of the layout, with a 25% border around the outside:
+     *
+     * \code
+     *      // set top left corner position of 1st child ..
+     *	    iLayout->SetAnchor(EHuiAnchorTopLeft, 0,
+     *	        EHuiAnchorOriginLeft, 
+     *          EHuiAnchorOriginTop,
+     *          EHuiAnchorMetricRelativeToSize, // With EHuiAnchorOriginLeft means that 0.0 goes to left edge, and 1.0 to the right
+     *          EHuiAnchorMetricRelativeToSize, // With EHuiAnchorOriginTop means that 0.0 goes to top edge, and 1.0 to the bottom
+     *          THuiTimedPoint(0.25, 0.25));
+     *      // .. and set the bottom right corner also to fix the size
+     * 	    iLayout->SetAnchor(EHuiAnchorBottomRight, 0,
+     *	        EHuiAnchorOriginRight, 
+     *          EHuiAnchorOriginBottom,
+     *   	EHuiAnchorMetricRelativeToSize, 
+     *          EHuiAnchorMetricRelativeToSize,
+     *          THuiTimedPoint(-0.25, -0.25)); 
+     * \endcode
+     *
+     * @todo  Specifying a transition in the timed point may be useless:
+     *        layouts are evaluated pretty seldom.
+     *
+     * @param aAnchor       Type of the anchor (either EHuiAnchorTopLeft for the 
+     *                      top left corner or EHuiAnchorBottomRight for bottom right
+     *                      corner).
+     * @param aOrdinal      Ordinal of the child visual that this anchor applies to.
+     * @param aHorizOrigin  Horizontal origin for the anchor position (aPosition). 
+     *                      Defines the point inside the layout on which the 
+     *                      evaluation of the child's placement is based. May be 
+     *                      EHuiAnchorOriginLeft (left edge), 
+     *                      EHuiAnchorOriginHCenter (center) or
+     *                      EHuiAnchorOriginRight (right edge).
+     * @param aVertOrigin   Vertical origin for the anchor position (aPosition). 
+     *                      Defines the point inside the layout on which the 
+     *                      evaluation of the child's placement is based. Possible options 
+     *                      are EHuiAnchorOriginTop (top), EHuiAnchorOriginVCenter 
+     *                      (center) and EHuiAnchorOriginBottom (bottom).
+     * @param aHorizMetric  Specifies the metric to use to define the
+     *                      horizontal position: EHuiAnchorMetricAbsolute to use 
+     *                      absolute pixels or EHuiAnchorMetricRelativeToSize to 
+     *                      use normalized values relative to layout size.
+     * @param aVertMetric   Specifies the metric used in the vertical position:
+     *                      EHuiAnchorMetricAbsolute to use absolute pixels or 
+     *                      EHuiAnchorMetricRelativeToSize to use normalized 
+     *                      values relative to layout size.     
+     * @param aPosition     The achor position as an offset from the origin point, 
+     *                      applied using the metric specified with aHorizMetric 
+     *                      and aVertMetric.
+     * @return                   Error code
+     *
+     */
+    IMPORT_C TInt SetAnchor(THuiAnchor aAnchor, TInt aOrdinal,
+                            THuiAnchorOrigin aHorizOrigin,
+                            THuiAnchorOrigin aVertOrigin,
+                            THuiAnchorMetric aHorizMetric,
+                            THuiAnchorMetric aVertMetric,
+                            const THuiTimedPoint& aPosition);
+    /**
+     * Convenience method for setting top left and bottom right anchors in a single call.
+     *
+     * This method sets size-relative anchors for a single child visual.
+     *
+     * @param aOrdinal           Ordinal of child visual to set anchors for.
+     * @param aTlHorizOrigin     Horizontal origin for the top left anchor position (aPosition). 
+     *                           Defines the point inside the layout on which the 
+     *                           evaluation of the child's placement is based. May be 
+     *                           EHuiAnchorOriginLeft (left edge), 
+     *                           EHuiAnchorOriginHCenter (center) or
+     *                           EHuiAnchorOriginRight (right edge).
+     * @param aTlVertOrigin      Vertical origin for the top left anchor position (aPosition). 
+     *                           Defines the point inside the layout on which the 
+     *                           evaluation of the child's placement is based. Possible options 
+     *                           are EHuiAnchorOriginTop (top), EHuiAnchorOriginVCenter 
+     *                           (center) and EHuiAnchorOriginBottom (bottom).
+     * @param aTopLeftOffset     The achor position as an offset from the origin point, 
+     * @param aBrHorizOrigin     Horizontal origin for the bottom right anchor position (aPosition). 
+     *                           Defines the point inside the layout on which the 
+     *                           evaluation of the child's placement is based. May be 
+     *                           EHuiAnchorOriginLeft (left edge), 
+     *                           EHuiAnchorOriginHCenter (center) or
+     *                           EHuiAnchorOriginRight (right edge).
+     * @param aBrVertOrigin      Vertical origin for the bottom right anchor position (aPosition). 
+     *                           Defines the point inside the layout on which the 
+     *                           evaluation of the child's placement is based. Possible options 
+     *                       	 are EHuiAnchorOriginTop (top), EHuiAnchorOriginVCenter 
+     *                           (center) and EHuiAnchorOriginBottom (bottom).     
+     * @param aBottomRightOffset The achor position as an offset from the origin point,      
+     * @return                   Error code
+     *
+     * @see CHuiAnchorLayout::SetAnchor() for more information about anchors.
+     */
+    IMPORT_C TInt SetRelativeAnchorRect(TInt aOrdinal,
+                                        THuiAnchorOrigin aTlHorizOrigin,
+                                        THuiAnchorOrigin aTlVertOrigin,
+                                        const THuiRealPoint& aTopLeftOffset,
+                                        THuiAnchorOrigin aBrHorizOrigin,
+                                        THuiAnchorOrigin aBrVertOrigin,
+                                        const THuiRealPoint& aBottomRightOffset);
+                                  
+    /**
+     * Undefines an anchor.
+     * @see SetAnchor()
+     * @deprecated instead use @c Detach and see relevant API documentation for
+     *      example code
+     */
+    IMPORT_C void RemoveAnchor(THuiAnchor aAnchor, TInt aOrdinal);
+
+                                  
+    /**
+     * Anchors one or more edges of a child visual to a specific position 
+     * within this layout. When combined together, a correctly specified group 
+     * of anchors provide sufficient information for the anchor layout to 
+     * determine the size and position of the child visual.
+     *
+     * Each child can have up to four anchors, each of which correspond to an 
+     * edge. A corner anchor is equivalent to supplying two similar orthogonal 
+     * edge anchors, so typically it is easier to use corners. Therefore, each 
+     * child can have up to two corner anchors, or a mixture of corners and 
+     * edges. Alternatively, four similar edges can be specified in one call by 
+     * supplying a box metric.
+     *
+     * In a typical case you set two different corner anchors (for example both 
+     * EHuiAnchorTypeTopLeft and EHuiAnchorTypeBottomRight), taking care
+     * to ensure that they are sufficiently orthogonal in order to define all needed
+     * coordinates. However it is also possible to set only one corner anchor, 
+     * which only positions the child without affecting it's size. Alternatively,
+     * one anchor can be specified as a corner, and then the other can be 
+     * specified as EHuiAnchorTypeSize; similarly the coordinates along
+     * one axis can be specified by an appropriate combination of edge and 
+     * width or height anchors.
+     *
+     * The position of each anchor relative to this layout is determined
+     * by the choice of origin (i.e. which point of the layout the 
+     * child's is attached to), and the offset position, which is specified
+     * using a THuiMetric or related type. All available features of 
+     * THuiMetric may be used to affect the resulting position, providing the 
+     * benefit that different metrics can be used for each child. Also note 
+     * that the metric used will override the base unit that has been set in 
+     * this layout.
+     * 
+     * @note if called again to specify the same anchor types
+     *      that have been previous set, those definitions will be updated. 
+     *      However, in order to change type, it is necessary to detach a 
+     *      previously defined anchor first, as there can only be a maximum 
+     *      of two anchors along each axis (for a given child).
+     * @note that size anchor type and attachment origins are not 
+     *      currenly supported. 
+     * @note that center anchor type is not currently supported.
+     * @note if an anchor of similar type has already been defined it will be 
+     *      replaced, however in general it is easier to manage anchors by 
+     *      removing them all and starting again.
+     * @note  After updating anchors, you should call 
+     *      @c CHuiLayout::UpdateChildrenLayout(), to cause the anchors to be 
+     *      applied to child positions and/or sizes.
+     * 
+     * @see @c Detach() to remove achor definitions for a given ordinal
+     *
+     * For example the following code will anchor three child visuals 0, 1, 2  in 
+     * the middle of the layout, with a 25% border around the outside, such that 
+     * they all occupy the same position:
+     *
+     * \code
+     *      // using edges...
+     *	    iLayout->Attach(0, 
+     *          EHuiAnchorTypeLeft,
+     *          THuiXYMetric(0.25, EHuiMetricNormalized),
+     *          EHuiAnchorAttachmentOriginLeft);
+     *	    iLayout->Attach(0, 
+     *          EHuiAnchorTypeRight,
+     *          THuiXYMetric(-0.25, EHuiMetricNormalized),
+     *          EHuiAnchorAttachmentOriginRight);
+     *	    iLayout->Attach(0, 
+     *          EHuiAnchorTypeTop,
+     *          THuiXYMetric(0.25, EHuiMetricNormalized),
+     *          EHuiAnchorAttachmentOriginTop);
+     *	    iLayout->Attach(0, 
+     *          EHuiAnchorTypeBottom,
+     *          THuiXYMetric(-0.25, EHuiMetricNormalized),
+     *          EHuiAnchorAttachmentOriginBottom);
+     *
+     *      // using corners...
+     *	    iLayout->Attach(1, 
+     *          EHuiAnchorTypeTopLeft,
+     *          THuiXYMetric(0.25, EHuiMetricNormalized),
+     *          EHuiAnchorAttachmentOriginTopLeft);
+     * 	    iLayout->Attach(1, 
+     *	        EHuiAnchorTypeBottomRight, 
+     *         THuiXYMetric(-0.25, EHuiMetricNormalized),
+     *	        EHuiAnchorAttachmentOriginBottomRight);
+     * 
+     *      // .. and using a box
+     * 	    iLayout->Attach(2, THuiBoxMetric(
+     *          THuiMetric(0.25, EHuiMetricNormalized),
+     *          THuiMetric(-0.25, EHuiMetricNormalized),
+     *          THuiMetric(0.25, EHuiMetricNormalized),
+     *          THuiMetric(-0.25, EHuiMetricNormalized)));
+     * \endcode
+     *
+     * @param aOrdinal      Ordinal of the child visual that this anchor applies to
+     * @param aType       Type of the anchor, which determines how and where the anchor attaches to this layout
+     * @param aOffset     The anchor position as an offset from the origin point,
+     *      specifying both the magnitude and units of the offset for the relevant axes.
+     * @param aAttachmentOrigin  Origin for the anchor offset.
+     *      Defines the point inside the layout from which the 
+     *      evaluation of the child's placement is based. 
+     * @param aAttachmentOrdinal    the ordinal of the anchor to which this anchor is attached, 
+     *      use the default value of EHuiAnchorAttachToParent in order to attach to parent
+     * @return Error code
+     *
+     */
+    IMPORT_C TInt Attach(
+        TInt aOrdinal,
+        THuiAnchorType aType, 
+        const THuiMetric& aOffset,
+        THuiAnchorAttachmentOrigin aAttachmentOrigin,
+        TInt aAttachmentOrdinal = EHuiAnchorAttachToParent);
+
+    /** 
+     * Attach a corner of a child visual  to a specific position 
+     * within this layout. 
+     *
+     * @see Attach() for all API documentation
+     */
+    IMPORT_C TInt Attach(
+        TInt aOrdinal,
+        THuiAnchorType aType, 
+        const THuiXYMetric& aOffset,
+        THuiAnchorAttachmentOrigin aAttachmentOrigin = EHuiAnchorAttachmentOriginTopLeft,
+        TInt aAttachmentOrdinal = EHuiAnchorAttachToParent);
+
+    /** 
+     * Attach all four edges of a child visual  to a specific position 
+     * within this layout.
+     *
+     * @note, will detach all existing edges first. In case of error, all
+     * edges that were successfull added before the error occurred will be 
+     * detached.
+     *
+     * @see Attach() for all API documentation
+     * @param aAttachmentOrigin if set to EHuiAnchorAttachmentOriginNone, each edge will 
+     *        be attached to the corresponding edge
+     */
+    IMPORT_C TInt Attach(
+        TInt aOrdinal,
+        const THuiBoxMetric& aOffset,
+        THuiAnchorAttachmentOrigin aAttachmentOrigin = EHuiAnchorAttachmentOriginNone,
+        TInt aAttachmentOrdinal = EHuiAnchorAttachToParent);
+
+
+    /**
+     * Undefines all anchors for a specified ordinal. Has no effect if the specified ordinal
+     * cannot be found.
+     *
+     * @see Attach()
+     * 
+     * @param aOrdinal the ordinal of the anchor to remove
+     */
+    IMPORT_C void Detach(TInt aOrdinal);
+    
+    /**
+     * Undefines an anchor. Has no effect if the specified anchor type 
+     * cannot be found. For example to detach a corner anchor with ordinal
+     * equal to zero:
+     *
+     * \code
+     *      iLayout->Detach(0, EAlfAnchorTypeTopLeft);
+     * \endcode
+     *
+     * @see Attach()
+     * @note can be used to separately remove the edges 
+     * that were attached using different combinations of types, 
+     * but try to be consistent in using either edges or corners to avoid 
+     * confusion.
+     * 
+     * @param aOrdinal the ordinal of the anchor to remove
+     * @param aType the edge relating to the anchor to remove
+     */    
+    IMPORT_C void Detach(TInt aOrdinal, THuiAnchorType aType);
+    
+    /**
+     * Overridden version of size changing updates the layout of child visuals.
+     *
+     * @param aSize  New size for the layout.
+     * @param aTransitionTime  Time for the transition to new size to take
+     *               place.
+     */
+    IMPORT_C void SetSize(const THuiRealSize& aSize, TInt aTransitionTime=0);
+
+    /**
+     * Determines the size of a child visual according to the layout.
+     *
+     * @note if an anchor is defined at the specified ordinal position, the
+     *      metric belonging to the anchor will override the metric specified
+     *      in this layout's base unit. 
+     *
+     * @param aOrdinal  Layout ordinal of the child visual.
+     * @param aSize     New target size for the child.
+     *
+     * @return  <code>ETrue</code>, if a new size was determined. Otherwise,
+     *          <code>EFalse</code> is returned and no size changes are
+     *          needed.
+     */
+    IMPORT_C virtual TBool ChildSize(TInt aOrdinal, TSize& aSize);
+
+    /**
+     * Determines the position of a child visual according to the layout. 
+     *
+     * @note if an anchor is defined at the specified ordinal position, the
+     *      metric belonging to the anchor will override the metric specified
+     *      in this layout's base unit. 
+     *
+     * @param aOrdinal  Layout ordinal of the child visual.
+     * @param aPos      New position for the child.
+     *
+     * @return  <code>ETrue</code>, if a new position was determined.
+     *          Otherwise, <code>EFalse</code> is returned and no position
+     *          changes are needed.
+     */
+    IMPORT_C virtual TBool ChildPos(TInt aOrdinal, TPoint& aPos);
+
+    /**
+     * Determines the position and size of a child visual according to the layout.
+     * The child position is determined using the base units of the layout. If a 
+     * valid anchor has been defined then the size and or position of the 
+     * corresponding child will be determined.
+     *
+     * @see CHuiLayout::ChildRect for full documentation
+     */
+    IMPORT_C virtual TInt ChildRect(TInt aOrdinal, THuiRealRect& aRect);
+    
+    /**
+     * Returns the name of the class.
+     *
+     * @param aName  Name of the layout class.
+     */
+    void GetClassName(TDes& aName) const
+        {
+        aName = _L("CHuiAnchorLayout");
+        }
+
+
+private: // internal data types
+    struct TCornerAnchor;
+    struct TAnchor_deprecated;
+    struct TEdgeAnchor;
+    struct TAnchor;
+    struct TAxis;
+
+private: // methods
+
+    /** 
+     * Find the anchor at the given index in this layout's anchor list.
+     *
+     * @param aOrdinal Index into the anchor list.
+     * @return Anchor at the requested ordinal. NULL if ordinal is out of range.
+     *
+     */
+    const TAnchor* Anchor(TInt aOrdinal) const;
+
+    /**
+     * the axis structure specified
+     * @param aAxis the index of the axis required
+     * @return the axis specified
+     */
+    inline TAxis& Axis(THuiAnchorAxis aAxis) const;
+
+    /**
+     * Evaluate anchor along an axis
+     *
+     * @param aAxisId the axis id required
+     * @param aAxis the axis
+     * @param aNear outputs the near side value along the specified axis
+     * @param aFar outputs the far side value along the specified axis
+     * @return a value selected from CHuiLayout::EHuiLayoutChildRect, depending on which sides were updated
+     */
+    TInt EvaluateAxis(THuiAnchorAxis aAxisId, const TAxis& aAxis, TReal32& aNear, TReal32& aFar) const;
+
+    /*
+     * Get the metric reference for an anchor's offset along a specified axis
+     *
+     * @param aAxisID the axis needed
+     * @param aEdge the edge
+     * @return the metric reference value in pixels
+     */
+    TReal32 EdgeOffsetInPixels(THuiAnchorAxis aAxisId, const TEdgeAnchor& aEdge) const;
+    
+    /**
+     * Calculate the actual pixel value for the supplied edge's position and size
+     * relative to this layout.
+     *
+     * @param aAxisID the axis needed
+     * @param aEdge the edge to be evaluated
+     * @param aInnerPaddingPx the inner padding for this axis in pixels
+     * @param aOffset the offset in pixels
+     * @param aNearPx near coordinate of the inner rect
+     * @param aNearCalculatedPx returns the near coordinate which will be modified if the edge was relevant
+     * @param aFarPx far coordinate of the inner rect
+     * @param aFarCalculatedPx returns the far coordinate which will be modified if the edge was relevant
+     * @return a value selected from CHuiLayout::EHuiLayoutChildRect, depending on which sides were updated
+     */
+    TInt EvaluateEdgeAnchorInPixels(
+        THuiAnchorAxis aAxisId,
+        const TEdgeAnchor& aEdge,
+        TReal32 aInnerPaddingPx,
+        TReal32 aOffsetPx,
+        TReal32 aNearPx, TReal32& aNearCalculatedPx, 
+        TReal32 aFarPx, TReal32& aFarCalculatedPx) const;
+
+    /**
+     * Calculate the actual pixel value for the attached edge's position and size
+     * relative to this layout.
+     *
+     * @param aAxisID the axis needed
+     * @param aEdge the edge to be evaluated
+     * @param aInnerPaddingPx the inner padding for this axis in pixels
+     * @param aNearPx near coordinate of the inner rect
+     * @param aNearCalculatedPx returns the near coordinate which will be modified if the edge was relevant
+     * @param aFarPx far coordinate of the inner rect
+     * @param aFarCalculatedPx returns the far coordinate which will be modified if the edge was relevant
+     * @return a value selected from CHuiLayout::EHuiLayoutChildRect, depending on which sides were updated
+     */
+    TInt EvaluateEdgeAttachmentInPixels(
+        THuiAnchorAxis aAxisId,
+        const TEdgeAnchor& aEdge,
+        TReal32 aInnerPaddingPx,
+        TReal32 aNearPx, TReal32& aNearCalculatedPx, 
+        TReal32 aFarPx, TReal32& aFarCalculatedPx) const;
+
+    /**  
+     * Detach edge
+     *
+     * @param aOrdinal the anchor to detach
+     * @param aType the type of the edge to detach, must correspond to an edge
+     *      type only (i.e. must not be a corner type).
+     */
+    void DetachEdge(TInt aOrdinal, THuiAnchorType aType);
+
+    /*
+     * Look for a cycle in the graph, starting with a specified edge
+     *
+     * @param aStartAxisId the axis of the specified starting edge
+     * @param aStartAnchorProximity the proximity of the specified starting edge
+     * @param aStartOrdinal the ordinal of the specified starting edge
+     * @param aEdge the edge under consideration
+     * @return ETrue if a cycle was found
+     */
+    TBool CheckForCycles(
+        THuiAnchorAxis aStartAxisId,
+        THuiAnchorProximity aStartAnchorProximity,
+        TInt aStartOrdinal, 
+        const TEdgeAnchor* aEdge) const;
+
+private: // helper methods for dealing with internal structures
+
+    /** 
+     * convert an edge into a proximity. 
+     *
+     * @note if the edge is of type EHuiAnchorEdgeNone, then 
+     * EHuiAnchorProximityNone will be returned, and aAxis will not be modified.
+     *
+     * @param aType the type
+     * @param aAxis output parameter specifying along which axis the edge was defined
+     * @return the proximity
+     */    
+    THuiAnchorProximity ConvertTypeToProximity(THuiAnchorType aType, THuiAnchorAxis& aAxis) const;
+
+    /** 
+     * convert an attachment origin into a proximity. 
+     *
+     * @note if the edge is of type EHuiAnchorAttachmentOriginNone, then 
+     * EHuiAnchorProximityNone will be returned, and aAxis will not be modified.
+     *
+     * @param aAttachmentOrigin the origin
+     * @param aAxis output parameter specifying along which axis the edge was defined
+     * @return the proximity
+     */    
+    THuiAnchorProximity ConvertAttachmentOriginToProximity(THuiAnchorAttachmentOrigin aAttachmentOrigin, THuiAnchorAxis& aAxis) const;
+
+    /** 
+     * split a corner up into its respective edges
+     *
+     * @param aCorner the corner to convert
+     * @param aEdgeH the horizontal edge
+     * @param aEdgeV the vertical edge
+     */
+    void ConvertCornerToEdges(THuiAnchorType aCorner, THuiAnchorType& aEdgeH, THuiAnchorType& aEdgeV) const;
+    
+    /** 
+     * split a corner attachment origin up into its respective edge origins
+     *
+     * @param aCornerOrigin the corner origin to convert
+     * @param aEdgeH the horizontal origin
+     * @param aEdgeV the vertical origin
+     */
+    void ConvertCornerAttachmentOriginToEdgeAttachmentOrigins(THuiAnchorAttachmentOrigin aCornerOrigin, THuiAnchorAttachmentOrigin& aEdgeOriginH, THuiAnchorAttachmentOrigin& aEdgeOriginV) const;
+    
+private: // helper methods for compatibility with deprecated APIs
+
+    THuiAnchorType ConvertDeprecatedAnchorTypeToType(THuiAnchor aAnchor) const;
+    
+    THuiAnchorAttachmentOrigin ConvertDeprecatedOrginToAttachmentOrigin(THuiAnchorOrigin aOrigin) const;
+    THuiAnchorAttachmentOrigin ConvertDeprecatedOriginsToAttachmentOrigin(THuiAnchorOrigin aHorizOrigin, THuiAnchorOrigin aVertOrigin) const;
+    
+    THuiMetric ConvertDeprecatedAnchorMetricAndTargetToHuiMetric(THuiAnchorMetric aMetric, TReal32 aTarget) const;  
+    THuiXYMetric ConvertDeprecatedAnchorMetricsAndOffsetToHuiMetric(THuiAnchorMetric aHorizMetric, THuiAnchorMetric aVertMetric, const THuiTimedPoint& aOffset) const;
+
+private: // data
+
+    struct THuiAnchorLayoutPrivateData;
+    THuiAnchorLayoutPrivateData* iHuiAnchorLayoutPrivateData; // owned
+    };
+
+#endif  // __HUIANCHORLAYOUT_H__
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiAnimatedTexture.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines CHuiAnimatedTexture base class, which can be used as 
+*                a base class for application-specific animated textures.
+*
+*/
+
+
+
+#ifndef __HUIANIMATEDTEXTURE_H__
+#define __HUIANIMATEDTEXTURE_H__
+
+
+#include <uiacceltk/HuiTexture.h>
+#include <uiacceltk/HuiTimeObserver.h>
+
+
+/* Forward declarations. */
+class CHuiTextureManager;
+
+
+/**
+ * Animated textures are informed of the progress of time. Before a display
+ * refresh occurs, the texture manager will tell all animated textures to
+ * update themselves.
+ *
+ * CHuiAnimatedTexture can be used as a base class for application-specific
+ * animated texture classes.
+ */
+class CHuiAnimatedTexture : public CBase,
+                            public MHuiTexture,
+                            public MHuiSegmentedTexture,
+                            public MHuiTimeObserver
+    {
+public:
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C ~CHuiAnimatedTexture();
+
+
+public: // new methods
+
+    /**
+     * Returns the texture object associated with this animated texture.
+     */
+    IMPORT_C CHuiTexture& Texture();
+
+    /**
+     * Called to update the texture when time progresses.
+     */
+    virtual void AdvanceTime(TReal32 aElapsedTime) __SOFTFP = 0;
+
+
+public: // from MHuiTexture
+
+    IMPORT_C MHuiSegmentedTexture* SegmentedTexture();
+
+    IMPORT_C const MHuiSegmentedTexture* SegmentedTexture() const;
+    
+    IMPORT_C MHuiShadowedTexture* ShadowedTexture();
+    
+    IMPORT_C const MHuiShadowedTexture* ShadowedTexture() const;
+
+    IMPORT_C TBool HasContent() const;
+
+
+public: //  MHuiSegmentedTexture
+
+    IMPORT_C TSize Size() const;
+    
+    IMPORT_C TInt SegmentCount() const;
+    
+    IMPORT_C TUint SegmentName(TInt aSegment) const;
+    
+    IMPORT_C TSize SegmentSize(TInt aSegment) const;
+    
+    IMPORT_C TSize SegmentTextureSize(TInt aSegment) const;
+    
+    IMPORT_C TPoint SegmentOffset(TInt aSegment) const;
+    
+	IMPORT_C TBool TextureChanged() const;
+
+	IMPORT_C void TextureClearChanged() const;    
+
+protected:
+
+    /**
+     * Default constructor.
+     */
+    IMPORT_C CHuiAnimatedTexture(CHuiTextureManager& aManager);
+
+    /**
+     * Second-phase constructor.
+     */
+    IMPORT_C void BaseConstructL();
+    
+protected: // from MHuiTexture
+    
+    IMPORT_C void TextureExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+protected:
+
+    /** Texture manager who owns this texture. */
+    CHuiTextureManager& iManager;
+
+    /** Contents of the animated texture. */
+    CHuiTexture* iTexture;
+private:
+    TAny* iSpare;
+    };
+
+
+#endif // __HUIANIMATEDTEXTURE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiBitmapProvider.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of MHuiBitmapProvider, an interface that provides 
+*                a bitmap and its alpha mask when requested. 
+*
+*/
+
+
+
+#ifndef __HUIBITMAPPROVIDER_H__
+#define __HUIBITMAPPROVIDER_H__
+
+class CFbsBitmap;
+
+/** 
+ * MHuiBitmapProvider is an interface that provides a bitmap and its alpha 
+ * mask when requested.
+ * 
+ * By storing MHuiBitmapProviders in the CHuiTextureManager we can delete and 
+ * regenerate the textures used by the toolkit as needed - enabling improved 
+ * use of memory resource, such as when the application goes to background.
+ * In this case, when we want to restore all the textures, we may just recall 
+ * the providers to reload the textures. 
+ *
+ * Typically, control classes would implement the ProvideBitmapL method of this
+ * class, which would handle all the loading or generation needed to produce the
+ * bitmaps stored by the TextureManager.
+ * 
+ * A provider should exist as long as the associated texture is stored within
+ * the texture manager.
+ */
+class MHuiBitmapProvider 
+    {
+public:
+
+    IMPORT_C virtual ~MHuiBitmapProvider();
+            
+    /**
+     * Provide a bitmap and mask from the given UID.
+     * This method should create a bitmap and its mask, usually by loading it from disk.
+     *
+     * @param aId      TextureManager id of this bitmap, may be used for extracting
+     *                 an icon resource.
+     * @param aBitmap  Output parameter for the provider: On return, has to store 
+     *                 a pointer to the generated bitmap. Ownership transferred to caller.
+	 *                 The support for input CFbsBitmap formats varies between 
+	 *                 different renderers. See \ref cfbsbitmapsupport 
+	 *                 Table describing renderer bitmap support.      
+	 * @param aMaskBitmap  
+	 *                 Output parameter for the provider: On return, has to store 
+     *                 a pointer to the generated alpha mask or <code>NULL</code> 
+     * 				   if there is no mask. Ownership of the bitmap is transferred 
+     *                 to the caller.
+     * 
+     * @see CHuiTextureManager::CreateTextureL()
+     */
+     virtual void ProvideBitmapL(TInt aId, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap) = 0;
+    
+    };
+
+
+#endif // __HUIBITMAPPROVIDER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiBorderBrush.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,212 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines a CHuiBorderBrush class - a brush that draws a border 
+*                at the edges of visuals.
+*
+*/
+
+
+
+#ifndef __HUIBORDERBRUSH_H__
+#define __HUIBORDERBRUSH_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiBrush.h>
+#include <uiacceltk/HuiSkin.h>
+#include <uiacceltk/HuiGc.h>
+#include <uiacceltk/HuiImage.h>
+#include <uiacceltk/HuiTimedPoint.h>
+#include <uiacceltk/huimetric.h>
+
+
+/**
+ * CHuiBorderBrush draws a border at a configurable distance. It can be inside
+ * or outside the visual edges. The horizontal and vertical edges can be
+ * configured separately. The border can either be a solid color or
+ * texture-mapped. A texture offset is supported for animated texture mapping.
+ *
+ * @todo  Should affect the visual's dirty region by growing it?
+ */
+NONSHARABLE_CLASS(CHuiBorderBrush): public CHuiBrush
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructor.
+     * @param aThickness Border width in specified metric units.
+     * @param aEdgeOffset Border edge offset in specified metric units.
+     */
+    IMPORT_C static CHuiBorderBrush* NewL(const THuiXYMetric& aThickness,
+                                          const THuiXYMetric& aEdgeOffset);
+
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     * @param aThickness Border width in specified metric units.
+     * @param aEdgeOffset Border edge offset in specified metric units.
+     */
+    IMPORT_C static CHuiBorderBrush* NewLC(const THuiXYMetric& aThickness,
+                                           const THuiXYMetric& aEdgeOffset);
+    /**
+     * Constructor.
+     * @deprecated
+     * @param aThicknessWidth Border width in pixels.
+     * @param aThicknessHeight Border height in pixels.
+     * @param aEdgeOffsetX Edge offset X coordinate in pixels    
+     * @param aEdgeOffsetY Edge offset Y coordinate in pixels    
+     *     
+     */
+    IMPORT_C static CHuiBorderBrush* NewL(TInt aThicknessWidth, TInt aThicknessHeight,
+                                          TInt aEdgeOffsetX, TInt aEdgeOffsetY);
+
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     * @deprecated
+     * @param aThicknessWidth Border width in pixels.
+     * @param aThicknessHeight Border height in pixels.
+     * @param aEdgeOffsetX Edge offset X coordinate in pixels    
+     * @param aEdgeOffsetY Edge offset Y coordinate in pixels    
+     */
+    IMPORT_C static CHuiBorderBrush* NewLC(TInt aThicknessWidth, TInt aThicknessHeight,
+                                           TInt aEdgeOffsetX, TInt aEdgeOffsetY);
+
+
+    /**
+     * Destructor.
+     */
+    ~CHuiBorderBrush();
+
+
+    /* Methods. */
+
+    /**
+     * Sets an image for the borders.
+     *
+     * @param aImage  Texture image for the borders.
+     */
+    IMPORT_C void SetImage(const THuiImage& aImage);
+
+    /**
+     * Sets a color for the borders.
+     *
+     * @param aColor  Border color.
+     */
+    IMPORT_C void SetColor(const TRgb& aColor);
+        
+    /**
+     * Sets a thickness for the borders.
+     *
+     * @param aThickness  Border width.
+     */
+    IMPORT_C void SetThickness(const THuiXYMetric& aThickness);
+
+    /**
+     * Sets a edge offset for the borders.
+     * Zero means the border edge is at the visual edge and
+     * extends inwards. Positive values move the border outwards.
+     *
+     * @param aEdgeOffset  Edge offset.
+     */
+    IMPORT_C void SetEdgeOffset(const THuiXYMetric& aEdgeOffset);
+
+    /**
+     * Sets a image offset for the borders.
+     *
+     * @param aImageOffset  Image offset
+     */
+    IMPORT_C void SetImageOffset(const THuiXYMetric& aImageOffset);
+    
+    /**
+     * From CHuiBrush.
+     * @see CHuiBrush::Changed()
+     */
+    TBool Changed() const;
+    
+    /**
+     * From CHuiBrush.
+     * @see CHuiBrush::ClearChanged()
+     */
+    void ClearChanged();
+
+    virtual void ExpandVisualRect(TRect& aRect) const;
+
+    virtual void Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const;
+
+
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor.
+     */
+    CHuiBorderBrush(TInt aThicknessWidth, TInt aThicknessHeight,
+                    TInt aEdgeOffsetX, TInt aEdgeOffsetY);
+
+    /**
+     * Constructor.
+     */
+    CHuiBorderBrush(const THuiXYMetric& aThickness,
+                    const THuiXYMetric& aEdgeOffset);
+
+private:
+
+    THuiRealPoint ThicknessInPixels(const CHuiVisual* aVisual) const;
+    THuiRealPoint EdgeOffsetInPixels(const CHuiVisual* aVisual) const;
+    THuiRealPoint ImageOffsetInPixels(const CHuiVisual* aVisual) const;
+    THuiRealPoint PointInPixels(const CHuiVisual* aVisual, const THuiTimedPoint& aPoint, const THuiXYMetric& aMetric) const;
+
+private:
+
+    /* Private methods. */
+
+    /** Color for the borders. */
+    TRgb iColor;
+
+    /** Image for the borders. */
+    THuiImage iImage;
+
+
+public:
+
+    /* Public properties. */
+
+    /** Border thickness. */
+    THuiTimedPoint iThickness;
+
+    /**
+     * Border offset. Zero means the border edge is at the visual edge and
+     * extends inwards. Positive values move the border outwards.
+     */
+    THuiTimedPoint iEdgeOffset;
+
+    /** Texture offset. */
+    THuiTimedPoint iImageOffset;
+
+private:
+
+    /** Border thickness metric. */
+    THuiXYMetric iThicknessMetric;
+
+    /** Edge offset metric. */
+    THuiXYMetric iEdgeOffsetMetric;
+
+    /** Image offset metric. */
+    THuiXYMetric iImageOffsetMetric;
+
+    };
+
+#endif  // __HUIBORDERBRUSH_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiBrush.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,232 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiBrush. Brushes augment visuals with graphical effects.
+*
+*/
+
+
+
+#ifndef __HUIBRUSH_H__
+#define __HUIBRUSH_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiTimedValue.h>
+#include <uiacceltk/HuiRealRect.h>
+#include <uiacceltk/HuiSessionObject.h>
+
+
+/* Forward declarations. */
+class CHuiGc;
+class CHuiSkin;
+class CHuiVisual;
+
+
+/** Brush layers. */
+enum THuiBrushLayer
+    {
+    EHuiBrushLayerBackground,
+    EHuiBrushLayerForeground
+    };
+
+/**
+ * MHuiBrushGuide is an interface that brushes use to get information about
+ * the shape on which they are being applied.
+ */
+class MHuiBrushGuide 
+    {
+public:
+
+    /**
+     * Determines the general opacity of the brush.
+     *
+     * @return  Opacity (0..1).
+     */ 
+    virtual TReal32 BrushOpacity() const __SOFTFP = 0;
+
+    /**
+     * Determines the rectangle into which the brush is being drawn.
+     * Uses display coordinates, with (0, 0) being in the upper left
+     * corner of the display.
+     *
+     * @return  Rectangle for the brush in display coordinates.
+     */
+    virtual THuiRealRect BrushRect() const  __SOFTFP = 0;
+    
+    /**
+     * Returns the skin that the brush should use for getting resources.
+     *
+     * @return  Skin instance.
+     */    
+    virtual CHuiSkin& BrushSkin() const = 0;
+    
+    };
+
+/**
+ * A brush implements a series of graphics drawing operations. Brushes are 
+ * attached to visuals and drawn whenever the visual is drawn. Brushes can 
+ * be used for augmenting the normal appearance of visuals with graphical 
+ * features such as background pictures, gradients, overlay icons, and 
+ * selection highlights. Technically, a brush is a simple class whose most 
+ * important method is Draw() that draws the brush into the specified area 
+ * of the display.
+ *
+ * @see CHuiVisual::EnableBrushesL()
+ * @see CHuiBrushArray
+ */
+class CHuiBrush : public CBase, public MHuiSessionObject
+	{
+public:
+
+	/**
+	 * Destructor.
+	 */
+	IMPORT_C ~CHuiBrush();
+
+
+public: // new methods
+
+    /**
+     * Expands the dirty region of a visual. Called when a visual's dirty 
+     * region is being determined. The brush is allowed to expand the 
+     * rectangle to cover any additional drawing the brush is doing.
+     * This is not called when the brush is clipped to the visual
+     * rectangle, because in that case no drawing can occur outside the 
+     * visual's area.
+     *
+     * @param aRect  Rectangle to expand. Visual's dirty region.
+     */
+    IMPORT_C virtual void ExpandVisualRect(TRect& aRect) const;
+
+	/**
+	 * Mark the brush as changed or unchanged.
+	 */
+	IMPORT_C void SetChanged();
+
+    /**
+     * Determines whether the brush has been changed and needs to be 
+     * redrawn.
+     */    
+    IMPORT_C virtual TBool Changed() const;
+    
+    /**
+     * Clears the changed status of the brush. This is called automatically
+     * by the refresh loop after a frame has been drawn.
+     */
+    IMPORT_C virtual void ClearChanged();
+    
+    /**
+     * Defines whether the brush can draw outside brush guide (i.e. visual's) rect 
+     */
+    IMPORT_C void SetClipToVisual(TBool aClipToVisual);
+    
+    IMPORT_C TBool ClipToVisual() const;
+    
+    /**
+     * Defines the layer where brush is drawn (on top of / below visual)
+     * @see THuiBrushLayer
+     */
+    IMPORT_C void SetLayer(THuiBrushLayer aLayer);
+    
+    IMPORT_C THuiBrushLayer Layer() const;
+       
+    /**
+     * The brush is about to get drawn, usually gc parameters are set here
+     */
+    IMPORT_C virtual void BeginDraw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const;
+
+    /**
+     * Draw the brush using the current drawing parameters.
+     */
+    IMPORT_C virtual void Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const;
+                               
+    /**
+     * The brush has been drawn, usually parameters changed in BeginDraw are reset here
+     */
+    IMPORT_C virtual void EndDraw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const;
+              
+    /**
+     * Notifies change in the brush guide
+     */
+    void ActivateBrushGuide(const CHuiVisual* aNewGuide) const;
+
+    /**
+     * Returns active brush guide as a visual if it exist.
+     * @return Visual acting as a brush guide.
+     */
+    CHuiVisual* BrushGuide() const;
+                                                         
+public: // From MHuiSessionObject
+    
+    /**
+     * Gets the object type.
+     */
+    IMPORT_C TType Type() const;
+
+    /**
+     * Gets the session id for object.
+     */
+    IMPORT_C TInt SessionId() const;
+
+    /**
+     * Sets the session id for object.
+     */
+    IMPORT_C void SetSessionId(TInt aSessionId);
+public:
+    enum TType2
+        { // this type is used for browsing BrushArray -- to detect who should control the brush in question
+        ENotKnown,
+        EImageBrush,
+        ECmdBufferBrush
+        };
+    // returns TType2
+    virtual TInt Type2() const { return ENotKnown; }
+    
+protected:
+
+	/**
+	 * Constructor.
+	 */
+	IMPORT_C CHuiBrush();
+    
+    IMPORT_C virtual void BrushExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+public:
+
+    /* Public properties. */
+
+    /** Opacity of the shadow. */    
+    THuiTimedValue iOpacity;
+    
+private:
+
+    /** <code>ETrue</code> if the brush will be drawn. */
+    TBool iEnabled;
+
+    /** <code>ETrue</code> if the brush needs to be redrawn. */
+    mutable TBool iChanged;    
+
+    /** Layer determines drawing order. */
+    THuiBrushLayer iLayer;
+
+    /** Clip brush to the visual. */
+    TBool iClipToVisual;
+
+    /** Session id */
+    TInt iSessionId;
+
+    mutable CHuiVisual* iGuideVisual;//TAny* iSpare;
+	};
+
+#endif  // __HUIBRUSH_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiBrushArray.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIBRUSHARRAY_H__
+#define __HUIBRUSHARRAY_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiOwnedPointer.h>
+#include <uiacceltk/HuiBrush.h>
+
+
+/* Forward declarations. */
+class CHuiVisual;
+
+
+/**
+ * Array of brushes.
+ */
+NONSHARABLE_CLASS(CHuiBrushArray) : public CBase
+    {
+public:
+
+    IMPORT_C static CHuiBrushArray* NewL();
+    
+    IMPORT_C static CHuiBrushArray* NewLC();
+    
+    IMPORT_C virtual ~CHuiBrushArray();
+    
+    
+    /* Methods. */
+
+    /**
+     *
+     */
+    IMPORT_C void Reset();
+    
+    /**
+     * Appends a new brush to the array.
+     *
+     * @param aBrush      Brush instance.
+     * @param aOwnership  Ownership of the brush.
+     */
+    IMPORT_C void AppendL(CHuiBrush* aBrush, THuiOwnership aOwnership);
+
+    /**
+     * Inserts a brush to the array.
+     *
+     * @param aPos        Index for the new brush instance.
+     * @param aBrush      Brush instance.
+     * @param aOwnership  Ownership of the brush.
+     */
+    IMPORT_C void InsertL(TInt aPos, CHuiBrush* aBrush, THuiOwnership aOwnership);
+    
+    /**
+     * Removes a brush from the array. If the array has ownership of the 
+     * brush, it will be deleted.
+     *
+     * @param aPos  Index of the brush instance to remove.
+     */
+    IMPORT_C void Remove(TInt aPos);
+
+    /** 
+     * Count the number of brushes in the array.
+     *
+     * @return  Number of brushes.
+     */
+    IMPORT_C TInt Count() const;    
+    
+    /**
+     * Returns a reference to a brush in the array.
+     *
+     * @param aPos  Index.
+     */
+    IMPORT_C CHuiBrush& operator [] (TInt aPos);
+
+    /**
+     * Returns a reference to a brush in the array.
+     *
+     * @param aPos  Index.
+     */
+    IMPORT_C CHuiBrush& At(TInt aPos);
+
+    /**
+     * Count the number of brushes on a certain layer.
+     *
+     * @param aLayer  Layer to count.
+     */
+    IMPORT_C TInt LayerBrushCount(THuiBrushLayer aLayer) const;
+
+    /**
+     * Draws all the brushes in the array.
+     *
+     * @param aLayer        Which layer to draw.
+     * @param aGc           Graphics context.
+     * @param aDisplayRect  Area affected by the brush.
+     */    
+    IMPORT_C void Draw(THuiBrushLayer aLayer, CHuiGc& aGc, const MHuiBrushGuide& aGuide) const;
+
+    /**
+     * Determines if a change flag is raised in the array.
+     *
+     * @return  <code>ETrue</code>, if there is something to refresh.
+     *          <code>EFalse</code>, if no changes.
+     */
+    TBool Changed() const;
+    
+    /**
+     * Clears the change flags of the brushes.
+     */
+    void ClearChanged();
+    
+    /**
+     * Expands the dirty region of a visual. Called when a visual's dirty 
+     * region is being determined. 
+     *
+     * @param aRect  Rectangle to expand. Visual's dirty region.
+     */
+    void ExpandVisualRect(TRect& aRect) const;
+    
+    /**
+     * Notifies change in the brush guide
+     */    
+    void ActivateBrushGuide(const CHuiVisual* aNewGuide) const;
+    /**
+     * aBrushType is CHuiBrush::TType2 enum
+     */
+    IMPORT_C TInt BrushWithTypeCount(TInt aBrushType) const;  
+    IMPORT_C CHuiBrush *BrushWithTypeAt(TInt aBrushType, TInt aIndex);
+protected:
+
+    CHuiBrushArray();
+    
+private:    
+    
+
+
+private:
+
+    typedef RHuiOwnedPointer<CHuiBrush> RArrayElement;
+
+    RPointerArray<RArrayElement> iElements;    
+    
+    };
+
+
+#endif // __HUIBRUSHARRAY_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiBrushes.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Convenience header for including all of the HUITK brushes.
+*
+*/
+
+
+
+
+#include <uiacceltk/HuiBrush.h>
+#include <uiacceltk/HuiGradientBrush.h>
+#include <uiacceltk/HuiBorderBrush.h>
+#include <uiacceltk/HuiShadowBorderBrush.h>
+#include <uiacceltk/HuiDropShadowBrush.h>
+#include <uiacceltk/HuiImageBrush.h>
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCanvasCmdBufferReader.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,226 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __HUICANVASCMDBUFFERREADER_H__
+#define __HUICANVASCMDBUFFERREADER_H__
+
+
+#include <e32base.h>
+#include <s32mem.h>
+#include <bitstd.h>
+#include <fbs.h>
+#include <gdi.h>
+
+	class THuiCanvasTextParameters
+		{
+	public:
+		THuiCanvasTextParameters():
+			iStart(0),
+			iEnd(KMaxTInt),
+			iFlags(0)
+				{
+				}
+		TInt iStart;
+		TInt iEnd;
+		TUint16 iFlags;
+		/* Reserved for future use */
+		TAny* iReserved1;
+		TAny* iReserved2;
+		TAny* iReserved3;
+		TAny* iReserved4;
+		};
+
+class CHuiCanvasCmdBufferReader : public CBase
+    {
+public:
+
+	/**
+	 * Constructor.
+	 */
+	CHuiCanvasCmdBufferReader();
+
+	/**
+	 * Constructor.
+	 */
+	CHuiCanvasCmdBufferReader(RMemReadStream aStream);
+
+	/**
+	 * Destructor.
+	 */ 
+	~CHuiCanvasCmdBufferReader();
+
+    /**
+     * Initialization, opens a stream for reading commandbuffer.
+     *
+     * @since S60 ?S60_version
+     * @param 
+     * @param 
+     */
+    void Init( TPtr8& aDes,TInt aLength);
+
+    /**
+     * ReadInt32L
+     * Convinience function for reading a TInt32 from stream. 
+     *
+     * @since S60 ?S60_version
+     * @param aPoint  
+     */
+    void ReadInt32L( TInt& aValue );
+        
+    /**
+     * ReadPointL
+     * Convinience function for reading a TPoint from stream
+     *
+     * @since S60 ?S60_version
+     * @param aPoint  
+     */
+    void ReadPointL( TPoint& aPoint );
+    
+    /**
+     * ReadRectL
+     * Convinience function for reading a TRect from stream
+     *
+     * @since S60 ?S60_version
+     * @param TRect  
+     */
+    void ReadRectL(TRect& aRect );
+    
+    /**
+     * ReadBitmapL
+     * Convinience function for reading a bitmap from stream. It duplicates the bitmap from a bitmap handle.
+     *
+     * @since S60 ?S60_version
+     * @param Bitmap
+     */
+    void ReadBitmapLC( CFbsBitmap*& aBitmap  );
+
+    /**
+     * ReadBitmapHandleL
+     * Convinience function for reading a bitmap from stream. It duplicates the bitmap from a bitmap handle.
+     *
+     * @since S60 ?S60_version
+     * @param Bitmap
+     */
+    void ReadBitmapHandleL( TInt& aBitmapHandle  );
+    
+    /**
+     * ReadTextL
+     * Returns TPtr to a text in the command buffer stream. Note, that this 
+     * function does not make a copy of the text.
+     *
+     * @since S60 ?S60_version
+     * @param aPoint  
+	 * @return EFalse, if TTextParameters are not legal. Otherwise ETrue.
+     */
+    TBool ReadTextL( TPtr& aText, THuiCanvasTextParameters& aTextParameters );
+    
+    /**
+     * ReadPointArrayL
+     * Convinience function for reading a pointer array from stream
+     *
+     * @since S60 ?S60_version
+     * @param Pointer array
+     */
+    void ReadPointArrayL(CArrayFix<TPoint>*& aPointArray );
+    
+    /**
+     * ReadPointArrayL
+     * Convinience function for reading a pointer array from stream
+     *
+     * @since S60 ?S60_version
+     * @param Pointer array
+     */
+    void ReadPointArrayL( TPoint*& aPointArray, TInt& aNumPoints );
+    
+    /**
+     * ReadRegionL
+     * Convinience function for reading a RRegion from stream
+     *
+     * @since S60 ?S60_version
+     * @param Region  
+     */
+    void ReadRegionL( RRegion& aRegion );
+    
+    /**
+     * DeletePointArrayL
+     * Convinience function deleting the point array
+     *
+     * @since S60 ?S60_version
+     * @param aPointArray
+     * @param aNumPoints    Number of points
+     */
+    void DeletePointArrayL( TPoint*& aPointArray, TInt& aNumPoints );
+        
+    /**
+     * ReadColorL
+     * Convinience function for reading a TRgb from stream
+     *
+     * @since S60 ?S60_version
+     * @param TRgb  
+     */
+    void ReadColorL( TRgb& aColor );
+    
+    /**
+     * ReadIntsL
+     * Convinience function for reading maximum of 5 TInts from the stream
+     *
+     * @since S60 ?S60_version
+     * @param TInt array  
+     */
+    void ReadIntsL( TInt aCount, TInt aValues[5] );
+
+    
+    /**
+     * ReadInt8L
+     * Convinience function for reading Int8 from stream
+     *
+     * @since S60 ?S60_version
+     */    
+    inline TUint8 ReadInt8L( ){ return iStream.ReadInt8L();}
+
+    inline void ReadL( TUint8* aTargetPtr, TInt aLength )
+        {
+        iStream.ReadL( aTargetPtr, aLength );
+        }
+    /**
+     * Convinience function for getting a reference to stream.
+     *
+     * @since S60 ?S60_version
+     */
+    RMemReadStream& Stream();
+
+private:
+
+    /*
+     * Readstream for the command buffer.
+     */
+    RMemReadStream iStream;
+
+    TInt iBufferIndex;    
+
+    TInt iBufferLength; 
+    
+    TPtr8* iBasePtr;
+
+    TPtr16* iCachedText;
+    
+    };
+
+#endif        
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCanvasVisual.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,422 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiCanvasVisual.
+*
+*/
+
+
+
+#ifndef __HUICANVASVISUAL_H__
+#define __HUICANVASVISUAL_H__
+
+
+#include <gdi.h>
+#include <bitdraw.h>
+#include <e32base.h>
+#include <uiacceltk/HuiOwnedPointer.h>
+#include <uiacceltk/HuiLayout.h>    
+#include <uiacceltk/HuiDisplay.h>    
+
+
+/* Forward declarations. */
+class CHuiControl;
+class THuiCanvasDrawImageParams;
+class THuiCanvasTextParameters;
+class CHuiCanvasGc;
+class MHuiCanvasPainter;
+
+ 
+/** Public initial values for ws painter */	
+#define KHuiWsDefaultUserClipRect TRect(0,0,0,0)
+#define KHuiWsDefaultLastPrintPosition TPoint(0,0)
+#define KHuiWsDefaultPenColor KRgbBlack  
+#define KHuiWsDefaultPenStyle CGraphicsContext::ESolidPen  
+#define KHuiWsDefaultPenSize TSize(1,1)  
+#define KHuiWsDefaultDrawMode CGraphicsContext::EDrawModePEN  
+#define KHuiWsDefaultLinePosition TPoint(0,0)  
+#define KHuiWsDefaultOrigin TPoint(0,0)  
+#define KHuiWsDefaultBrushUsed EFalse  
+#define KHuiWsDefaultBrushColor KRgbWhite  
+#define KHuiWsDefaultBrushOrigin TPoint(0,0)  
+#define KHuiWsDefaultBrushStyle CGraphicsContext::ENullBrush  
+#define KHuiWsDefaultCharJustExcess 0  
+#define KHuiWsDefaultCharJustNum 0  
+#define KHuiWsDefaultWordJustExcess 0  
+#define KHuiWsDefaultWordJustNum 0  
+#define KHuiWsDefaultDitherOrigin TPoint(0,0)  
+#define KHuiWsDefaultDotLength 0  
+#define KHuiWsDefaultDotMask 0  
+#define KHuiWsDefaultDotParam 0  
+#define KHuiWsDefaultDotDirection 1  
+#define KHuiWsDefaultShadowMode CFbsDrawDevice::ENoShadow  
+#define KHuiWsDefaultStrikethrough EStrikethroughOff  
+#define KHuiWsDefaultUnderline EUnderlineOff  
+#define KHuiWsDefaultUserDisplayMode ENone  
+#define KHuiWsDefaultShadowColor KRgbGray
+#define KHuiWsDefaultFadeColor 0x80FFFFFF
+
+enum THuiCanvasPaintType
+    {
+    /** Transparent or semitransparent */
+    EHuiCanvasPaintTypeTransparent,
+    
+    /** Fully opaque */
+    EHuiCanvasPaintTypeOpaque            
+    };
+
+NONSHARABLE_STRUCT (THuiCanvasPaintedArea)
+    {
+    /** Painted area in the canvas */
+    THuiRealRect iPaintedRect;    
+    
+    /** Paint type of the area */
+    TInt iPaintType;
+    
+    /** Reserved for future */
+    TInt iFlags;
+    };
+
+enum THuiCanvasFlags
+    {
+    /** Disables canvas from drawing the canvas content */
+    EHuiCanvasFlagDisableCanvasContent    = 0x1,
+    /** Disables canvas from drawing the canvas background (if set) */
+    EHuiCanvasFlagDisableCanvasBackground = 0x2,
+    /** Canvas is drawn with external fade effect */
+    EHuiCanvasFlagExternalFade = 0x4,
+    /** Canvas drawing is clipped to own and parent canvas intersection */
+    EHuiCanvasFlagEnableCanvasClipping = 0x8,           
+    /** External fade effect (if enabled) is extended to children */
+    EHuiCanvasFlagExternalFadeToChildren = 0x10,    
+    /** External fade effect (if enabled) is set to a parent (or grandparent) */
+    EHuiCanvasFlagExternalFadeByParent = 0x40,    
+    /** Effect is excluded from parent (or grandparent) effect (if it has effect which is applied to children) */
+    EHuiCanvasFlagExcludeFromParentEffect = 0x80,
+    /** Hint flag which is used for optimizations. Tells if fade effect(s) exist in visual tree */
+    EHuiCanvasFlagExternalFadeExistsInsideVisualTree = 0x100 
+    };
+
+/**
+ * This class is used internally by the toolkit and thus should
+ * not be used by the applications directly.
+ */
+class CHuiCanvasVisual : public CHuiLayout
+    {
+public:
+
+    enum
+        {
+        /** @deprecated */
+        ECommandBufferHui,
+        /** @deprecated */
+        ECommandBufferSgc    
+        };
+	
+	enum
+	    {
+	    ECommandBufferAlf,
+	    ECommandBufferWs    
+	    };
+	    
+    /* Constructors and destructor. */
+
+    /**
+     * Constructs and appends a new Canvas visual to the owner control.
+     *
+     * @param aOwnerControl  Control that will own the new visual.    
+     * 
+     * @param aCanvasType The enumerator describing the type of concrete Canvas
+     * to be created.     
+     *
+     * @return  The new visual.
+     */
+    IMPORT_C static CHuiCanvasVisual* AddNewL(CHuiControl& aOwnerControl,
+                                            CHuiLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     */
+    CHuiCanvasVisual(MHuiVisualOwner& aOwner);
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+    /**
+     * Destructor.
+     */
+    ~CHuiCanvasVisual();
+
+    /**
+     * Sets buffer that contains canvas drawing commands. This
+     * method clears previous buffer(s).
+     *
+     * @param aCommands Commanbuffer
+     */
+    IMPORT_C void SetCommandSetL( const TDesC8& aCommands );
+
+    /**
+     * Sets the type of commands in the buffer.
+     *
+     * @param aCommandType Type of the command buffer, either
+     * ECommandBufferHui or ECommandBufferSgc. In the future
+     * more command set types may be supported.
+     *
+     */
+    IMPORT_C void SetCommandType( TInt aCommandType );
+
+    /**
+     * Clears buffer(s) that contains canvas drawing commands. 
+     */
+    IMPORT_C void ClearCommandSet();
+    
+    IMPORT_C void SetTrackCommandSet( TFileName& aFileName, TBool aTrack );
+        
+    /**
+     * Adds buffer that contains more canvas drawing commands,
+     * those will be executed after the buffers that has been
+     * added previously.
+     * @param aMoreCommands Commanbuffer
+     */
+    IMPORT_C void AddCommandSetL( const TDesC8& aMoreCommands );
+
+    /**
+     * Adds partial buffer that contains more canvas drawing commands. These
+     * commands are appended to the commands set previously with this method
+     * until param aLastPart has value ETrue. After that whole command set
+     * will be added among possibly already existing command sets and
+     * it will be drawable.
+     * 
+     * @param aMoreCommands Commanbuffer
+     * @param aLastPart EFalse if there are more commands to be added into this
+     * command set before it is wanted to be available for drawing. ETrue if
+     * command set is ready and no more parts are expected.
+     */
+    IMPORT_C void AddPartialCommandSetL( const TDesC8& aMoreCommands, TBool aLastPart );
+
+    /**
+     * Clears internal cached texts and images.
+     */
+    IMPORT_C void ClearCache();
+
+    /**
+     * Prepares internal cached texts and images.
+     */
+    IMPORT_C void PrepareCache();
+    
+    /**
+     * Sets the flag that tells the canvas to clear the background before
+     * doing a refresh. 
+     *
+     * Note1: EClearWithSkinBackground is not (yet) supported.
+     * Note2: EClearWithColor does not do alphablending, it just clears the area 
+     * and writes alpha values to the rendering surface. 
+     *
+     * @param aClearBackground  Background clearing mode. 
+     * @see SetBackgroundColor()
+     */
+    IMPORT_C void SetClearBackground(CHuiDisplay::TClearMode aClearBackground);
+
+    /**
+     * Sets the background color, if background clearing has
+     * been enabled.
+     *
+     * @param aBackgroundColor  The color to set the background to.
+     * @see SetClearBackgroundL()
+     */
+    IMPORT_C void SetBackgroundColor(const TRgb& aBackgroundColor);
+    
+    /**
+     * Sets the items that specify how to clear display before display refresh.
+     * Items may have overlapping rectangles, drawing order is same as item order
+     * in the parameter array. But having lots of overlapping drawing 
+     * causes negative performance impact.
+     * 
+     * This method is alternative to SetClearBackgroundL and SetBackgroundColor
+     * methods.
+     * 
+     * @see SetBackgroundColor()
+     * @see SetClearBackgroundL()
+     * @param aItems Array of items that specify how to clear the background.
+     */
+    IMPORT_C void SetBackgroundItems(const RArray<THuiDisplayBackgroundItem>& aItems);
+    
+    /**
+     * Returns the number of rectangular areas which contain something that is
+     * drawn by the visual.
+     *
+     * @return number of painted areas.
+     * @see PaintedArea()
+     */
+    IMPORT_C TInt PaintedAreaCount() const;
+    
+    /**
+     * Returns information of the painted area at given index. 
+     *
+     * @param aIndex Index of the painted area.
+     * @return Painted area info.
+     * @see PaintedAreaCount()()
+     */
+    IMPORT_C THuiCanvasPaintedArea PaintedArea(TInt aIndex);
+    
+    /**
+     * Draws content of the window in pixel format to the given bitmap. 
+     * This method may not be supported in all commanbuffertype/renderer combinations.
+     *
+     * @param aTargetBuffer where content of the window is to be drawn. NULL if the drawing
+     * is to be stopped.
+     *
+     * @return KErrNotSupported if the current renderer/painter does not support the
+     * feature. Leave happens in other unexpected error situtations. 
+     *         
+     */
+    IMPORT_C TInt SetCapturingBufferL(CFbsBitmap* aTargetBuffer);
+    
+    /**
+     * Sets canvas flags
+     * @param aCanvasFlags flags to be set
+     *
+     */
+    IMPORT_C void SetCanvasFlags(TInt aCanvasFlags);
+
+    /**
+     * Clears canvas flags
+     * @param aCanvasFlags flags to be cleared.
+     *
+     */
+    IMPORT_C void ClearCanvasFlags(TInt aCanvasFlags);
+
+    /**
+     * Gets canvas flags
+     * @return flags
+     *
+     */
+    IMPORT_C TInt CanvasFlags();
+
+    /**
+     * Set external content visual to be drawn to the canvas visual.
+     * Giving a NULL pointer as a parameter removes the external content.
+     * @param aVisual the visual that is used as external content
+     *
+     */
+	IMPORT_C void SetExternalContentL(CHuiVisual* aVisual);
+
+    /**
+     * Return external content visual of the canvas visual.
+     * NULL return value means there is no external content.
+     * @return NULL or the visual that is used as external content
+     */
+    IMPORT_C CHuiVisual* ExternalContent();
+
+    /**
+     * Set parent canvas visual. Parent is used for determining clipping 
+     * region incase canvasflag EHuiCanvasFlagEnableCanvasClipping is set.
+     *
+     * @param aParent Canvas visual which is used to determine effective 
+     * clipregion.
+     */
+    IMPORT_C void SetParentCanvas(CHuiCanvasVisual* aParent);
+    
+    /**
+     * Gets reference to canvas gc
+     */
+    CHuiCanvasGc& CanvasGc() const;
+
+    IMPORT_C TBool IsBackgroundDrawingEnabled() const;
+
+    const TRegion& ClipRegion() const;
+    
+    void AddChildCanvas(CHuiCanvasVisual* aChild);
+
+    void RemoveChildCanvas(CHuiCanvasVisual* aChild);
+        
+    IMPORT_C TBool HasCommandBuffers(TBool aAskFromChildren = ETrue) const;
+    
+    // to handle background surface that may be set to the Window
+public:    
+    
+    IMPORT_C TBool LayerUsesAlphaFlag();
+    IMPORT_C void SetLayerUsesAlphaFlag(TBool aEnabled);
+    IMPORT_C TRect& LayerExtent(); 
+    IMPORT_C void SetLayerExtent(TRect& aExtent); 
+
+public:
+    
+    void SetSize(const THuiRealSize& aSize, TInt aTransitionTime=0);    
+    TBool ChildSize(TInt aOrdinal, TSize& aSize);    
+    TBool ChildPos(TInt aOrdinal, TPoint& aPos);
+    TInt ChildRect(TInt aOrdinal, THuiRealRect& aRect);        
+
+    
+private:
+    
+    void HandleBuffer(TRect& aDisplayRect, TInt aAction, CHuiGc* aGc) const;        
+
+    void SetCommandTypeL(TInt aCommandType);         
+ 
+    TBool IsContentDrawingLayered() const;
+    
+    TBool IsContentDrawingEnabled() const;
+
+    TBool IsExternalContentDrawingEnabled(TBool aIncludeChildren = EFalse) const;
+    
+    TBool IsCanvasClippingEnabled() const;
+    
+    TBool EffectActive() const;
+    
+public: // From CHuiVisual
+
+	TBool PrepareDrawL();
+	
+	void Draw(CHuiGc& aGc) const;
+
+ 	/**
+     * Draw the visual.
+     */
+    void DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect) const;
+
+    TBool Changed() const;
+
+    IMPORT_C void SetChanged();
+    
+    IMPORT_C void ClearChanged();
+
+    void ExpandRectWithContent(TRect& aRect) const;
+    THuiRealPoint ConvertPoint(const THuiRealPoint& aPointInUnits) const;
+    void ExpandRect(TRect& aRectToExpand, const TRect& aNewRect) const;
+
+public:    
+    IMPORT_C void StoreRenderBufferL();
+    void DrawStoredVisualRenderBuffer() const;
+    void DrawStoredFullScreenRenderBuffer(CHuiGc& aGc) const;
+    IMPORT_C void FreeRenderBuffer();
+        
+private:
+       
+    THuiCanvasPaintedArea CanvasPaintedArea(TInt aIndex) const;
+    
+    void DrawChildren(CHuiGc& aGc) const;
+    void DrawCanvasChildren(CHuiGc& aGc, TInt aIncludeCanvasFlags, TInt aExcludeCanvasFlags) const;
+    TBool ChildTreeChanged(TInt aExcludeCanvasFlags) const;
+    
+private: 
+
+    struct THuiCanvasVisualData;
+    THuiCanvasVisualData* iCanvasVisualData;
+
+
+    };
+
+#endif  // __HUICANVASVISUAL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCommand.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1033 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of THuiCommand and derived command classes. 
+*
+*/
+
+
+
+#ifndef __HUICOMMAND_H__
+#define __HUICOMMAND_H__
+
+
+#include <e32base.h>
+
+#include <uiacceltk/HuiImage.h>
+#include <uiacceltk/HuiTimedValue.h>
+#include <uiacceltk/HuiTimedPoint.h>
+
+
+/* Forward declarations. */
+class CHuiEnv;
+class CHuiControlGroup;
+class CHuiControl;
+class CHuiDisplay;
+class CHuiVisual;
+class CHuiImageVisual;
+class CHuiTextVisual;
+class CHuiTransformation;
+class THuiObjectCommand;
+class THuiEvent;
+class MHuiEventHandler;
+
+
+/**
+ * Command types.
+ * All the commands that can be executed by the toolkit are enumerated here.
+ */
+enum THuiCommandType
+    {
+  
+    /** None corresponds the base class (THuiCommand). */
+    EHuiCommandTypeNone = 0,
+    
+    EHuiCommandTypeObject,
+    
+    EHuiCommandTypeAction,
+    
+    EHuiCommandTypeGroup,
+    
+    EHuiCommandTypeControl,
+    
+    EHuiCommandTypeVisual,
+    
+    EHuiCommandTypeImage,
+    
+    EHuiCommandTypeText,
+    
+    EHuiCommandTypeValue,
+    
+    EHuiCommandTypePoint,
+    
+    EHuiCommandTypeTransformation,
+    
+    EHuiCommandTypeCustomEvent,
+
+    /** Marker command type. Types up from here will be used for markers only. */    
+    EHuiCommandTypeMarkerFirst = 10000,
+    EHuiCommandTypeMarker0 = EHuiCommandTypeMarkerFirst,
+    EHuiCommandTypeMarker1,
+    EHuiCommandTypeMarker2,
+    EHuiCommandTypeMarker3,
+    EHuiCommandTypeMarker4,
+    EHuiCommandTypeMarker5,
+    EHuiCommandTypeMarker6,
+    EHuiCommandTypeMarker7,
+    EHuiCommandTypeMarker8,
+    EHuiCommandTypeMarker9,
+    EHuiCommandTypeMarker10
+    };
+
+
+/** 
+ * Command operations. 
+ */
+enum THuiOp
+    {
+    EHuiOpNone = 0,
+    
+    /* Control Group operations. */
+    EHuiOpHide = 1000,
+    EHuiOpShow,
+    EHuiOpEnableInput,
+    EHuiOpDisableInput,
+    
+    /* Control operations. */
+    /* (start from 2000) */  // None defined yet.
+    
+    /* Visual operations. */
+    EHuiOpRemoveAndDestroyAll = 3000,
+    EHuiOpModifyFlags,
+    EHuiOpSetPrimaryImage,
+    EHuiOpSetSecondaryImage,
+    EHuiOpSetText,
+    EHuiOpEnableTransformation,
+    EHuiOpDisableTransformation,
+    
+    /* Timed value operations. */
+    EHuiOpSet = 4000,
+    EHuiOpSetWithSpeed,
+    
+    /* Timed value style operations. The actual is:
+       THuiInterpolationStyle(iOperation - EHuiOpSetStyle) */
+    EHuiOpSetStyle = 5000,
+    
+    /* Transformation operations. */
+    EHuiOpLoadIdentity = 6000,
+    EHuiOpTranslate,
+    EHuiOpScale,
+    EHuiOpRotate
+    };
+
+
+/**
+ * Object types.
+ * These are the different types of objects which can issue and receive commands.
+ */
+enum THuiCommandObjectType
+    {
+    EHuiCommandObjectTypeNone,
+
+    /** This object is a visual. */
+    EHuiCommandObjectTypeVisual,
+
+    /** This object is a control. */
+    EHuiCommandObjectTypeControl,
+
+    /** This object is a control group. */
+    EHuiCommandObjectTypeControlGroup
+    };
+
+
+
+/**
+ * THuiCommand is the base class of all commands. A command is an
+ * instruction to some class that can be set to occur some time in the future.
+ * Each command stores information about an operation. Each command is also responsible for
+ * the execution of the command.
+ * Commands are processed by the class's OfferEventL() method.
+ */
+class THuiCommand
+    {
+public:
+
+    /* Destructor. */
+
+    IMPORT_C virtual ~THuiCommand();
+    
+
+    /* Methods. */
+
+    /**
+     * Returns a pointer to the command casted to THuiObjectCommand.
+     * If this is not possible (the command is not derived from 
+     * THuiObjectCommand), returns NULL instead.
+     */
+    IMPORT_C virtual const THuiObjectCommand* ObjectCommand() const;
+
+    /**
+     * Executes the command.
+     *
+     * @param aEnv  The environment in which the command is being executed.
+     */
+    virtual void ExecuteL(CHuiEnv& aEnv) const = 0;
+    
+    /**
+     * Returns the size of the command.
+     */
+    virtual TInt Size() const = 0;
+    
+    /**
+     * Sets the sender object of the command.
+     * The sender must not be deleted while the command is pending execution in a scheduler.
+     *
+     * @param aType    Sender type.
+     * @param aSender  Pointer to sender.     
+     */
+    IMPORT_C void SetSender(THuiCommandObjectType aType, TAny* aSender);
+       
+    /**
+     * Determines the type of the command.
+     *
+     * @return  Command type.
+     */
+    IMPORT_C THuiCommandType Type() const;
+    
+    /**
+     * Determines the type of the object that sent the command.
+     *
+     * @return  Sender object type.
+     */
+    IMPORT_C THuiCommandObjectType SenderType() const;
+    
+    /**
+     * Returns the sender object. This is the object which issued
+     * the command originally.
+     *
+     * @return the object which sent the command.
+     */
+    IMPORT_C TAny* Sender() const;
+    
+    /**
+     * Returns the sender visual. Returns NULL if the sender is not a visual.
+     *
+     * @return  Visual, or NULL.
+     * @see Sender()
+     */     
+    IMPORT_C CHuiVisual* SenderVisual() const;
+    
+    /**
+     * Returns the sender control. Returns NULL if the sender is not a control.
+     *
+     * @return  Control, or NULL.
+     * @see Sender()
+     */     
+    IMPORT_C CHuiControl* SenderControl() const;
+    
+    /**
+     * Returns the sender control group. Returns NULL if the sender is not a control group.
+     *
+     * @return  Control group, or NULL.
+     * @see Sender()
+     */     
+    IMPORT_C CHuiControlGroup* SenderControlGroup() const;
+    
+
+protected:
+
+    /* Constructor. */
+
+    /**
+     * Protected constructor.
+     *
+     * @param aType  Type of the command.
+     */
+    IMPORT_C THuiCommand(THuiCommandType aType);
+    
+    IMPORT_C virtual void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+
+private:
+
+    /* These member variables are shared by all commands. */
+    
+    /** Type of the command. Depends on the command class. */
+    THuiCommandType iType;
+    
+    /** Type of the object that sent the command. */
+    THuiCommandObjectType iSenderType;
+    
+    /** Object that sent this command. Must exist. */
+    TAny* iSender;
+    
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    
+    };
+
+
+/**
+ * THuiActionCommand is a simple action that triggers an action notification.
+ */
+class THuiActionCommand : public THuiCommand
+    {
+public:
+    
+    /* Constructor. */
+
+    /**
+     * Constructs a new action command.
+     *
+     * @param aId  Identifier of the action.
+     */
+    IMPORT_C THuiActionCommand(TInt aId);    
+
+
+    /* Methods. */
+
+    /* Implementation of THuiCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CHuiEnv& aEnv) const;
+    
+    /* Implementation of THuiCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+    /**
+     * Determines the action identifier of the command.
+     *
+     * @param  Action identifier.
+     */     
+    IMPORT_C TInt Id() const;
+
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+
+    /** Action identifier. */
+    TInt iId;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+/** 
+ * THuiObjectCommand is the base class for commands that modify data owned by 
+ * an object. If the object gets deleted and the scheduler is notified of this, 
+ * the command will be automatically canceled.
+ */
+class THuiObjectCommand : public THuiCommand
+    {
+public:
+
+    /* Methods. */
+
+    IMPORT_C const THuiObjectCommand* ObjectCommand() const;
+    
+    IMPORT_C void ExecuteL(CHuiEnv& aEnv) const;
+
+    IMPORT_C TInt Size() const;
+
+    /**
+     * Returns the data owner object of the command.
+     */
+    IMPORT_C TAny* Object() const;
+    
+    /**
+     * Returns the operation of the command.
+     */
+    IMPORT_C THuiOp Operation() const;
+     
+     
+protected:     
+
+    /* Constructor. */
+
+    /**
+     * Protected constructor.
+     *
+     * @param aType             Type of the command.
+     * @param aDataOwnerObject  Object that owns the data this command handles.
+     * @param aOperation        Operation being done on the object.
+     */
+    IMPORT_C THuiObjectCommand(THuiCommandType aType, TAny* aDataOwnerObject, THuiOp aOperation);
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+    
+private:
+
+    /** Object that owns the data this command handles. */
+    TAny* iObject;
+
+    /** Operation being done on the object. */
+    THuiOp iOperation;
+        
+    };
+    
+    
+/**
+ * THuiGroupCommand is an object command that operates on a control group.
+ */    
+class THuiGroupCommand : public THuiObjectCommand
+    {
+public:
+
+    /* Constructor. */
+
+    /**
+     * Constructs a new control group command.
+     *
+     * @param aGroup      Control group.
+     * @param aDisplay    Display associated with the command.
+     * @param aOperation  Operation to do on the group.
+     */
+    IMPORT_C THuiGroupCommand(CHuiControlGroup& aGroup, THuiOp aOperation, 
+                              CHuiDisplay* aDisplay = NULL);    
+
+    /* Implementation of THuiCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CHuiEnv& aEnv) const;
+    
+    /* Implementation of THuiCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+
+    /* Methods. */
+    
+    /**
+     * Returns the control group that the command operates on.
+     */
+    IMPORT_C CHuiControlGroup& ControlGroup() const;
+    
+    /**
+     * Returns the display associated with the command.
+     */
+    IMPORT_C CHuiDisplay* Display() const;
+
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+
+    /** Display associated with the command. */
+    CHuiDisplay* iDisplay;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+/**
+ * THuiControlCommand is an object command that operates on a control.
+ */    
+class THuiControlCommand : public THuiObjectCommand
+    {
+public:
+
+    /* Constructor. */
+
+    /**
+     * Constructs a new control command.
+     *
+     * @param aControl    Control.
+     * @param aOperation  Operation to do on the control.
+     */
+    IMPORT_C THuiControlCommand(CHuiControl& aControl, THuiOp aOperation);    
+
+    /* Implementation of THuiCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CHuiEnv& aEnv) const;
+
+    /* Implementation of THuiCommand::Size(). */
+    IMPORT_C TInt Size() const;   
+
+
+    /* Methods. */
+    
+    /**
+     * Returns the control that the command operates on.
+     */
+    IMPORT_C CHuiControl& Control() const;
+    
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+/**
+ * THuiVisualCommand is an object command that operates on a visual.
+ */    
+class THuiVisualCommand : public THuiObjectCommand
+    {
+public:
+
+    /* Constructor. */
+
+    /**
+     * Constructs a new visual command.
+     *
+     * @param aVisual     Visual.
+     * @param aOperation  Operation to do on the visual.
+     */
+    IMPORT_C THuiVisualCommand(CHuiVisual& aVisual, THuiOp aOperation,
+                               TInt aSetFlags = 0, TInt aClearFlags = 0);    
+
+    /* Implementation of THuiCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CHuiEnv& aEnv) const;
+    
+    /* Implementation of THuiCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+
+    /* Methods. */
+    
+    /**
+     * Returns the visual that the command operates on.
+     */
+    IMPORT_C CHuiVisual& Visual() const;
+    
+    /**
+     * Returns the flags that will be set by the command.
+     */
+    IMPORT_C TInt FlagsToSet() const;
+    
+    /**
+     * Returns the flags that will be cleared by the command.
+     */
+    IMPORT_C TInt FlagsToClear() const;
+
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+
+    /** Flags to set. */
+    TInt iSetFlags;
+    
+    /** Flags to clear. */
+    TInt iClearFlags;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+    
+    
+/**
+ * THuiImageCommand is a command that operaters on an image visual.
+ */    
+class THuiImageCommand : public THuiObjectCommand
+    {
+public:    
+
+    /* Constructor. */
+
+    /**
+     * Constructs a new image command.
+     *
+     * @param aImageVisual  Image visual.
+     * @param aImage        Image.
+     * @param aOperation    Operation to do on the visual.
+     */
+    IMPORT_C THuiImageCommand(CHuiImageVisual& aImageVisual, const THuiImage& aImage, 
+                              THuiOp aOperation = EHuiOpSetPrimaryImage);
+
+    /* Implementation of THuiCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CHuiEnv& aEnv) const;
+    
+    /* Implementation of THuiCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+
+    /* Methods. */
+    
+    /**
+     * Returns the visual that the command operates on.
+     */
+    IMPORT_C CHuiImageVisual& ImageVisual() const;
+    
+    /**
+     * Returns a reference to the image of the visual.
+     */
+    IMPORT_C const THuiImage& Image() const;
+    
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+    
+private:
+
+    /** Image of the command. */
+    THuiImage iImage;    
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+/**
+ * THuiTextCommand is a command that operaters on a text visual.
+ */    
+class THuiTextCommand : public THuiObjectCommand
+    {
+public:    
+
+    /* Constructor. */
+
+    /**
+     * Constructs a new text command.
+     *
+     * @param aTextVisual  Text visual.
+     * @param aText        Text.
+     * @param aOperation   Operation to perform.
+     */
+    IMPORT_C THuiTextCommand(CHuiTextVisual& aTextVisual, const TDesC& aText, 
+                             THuiOp aOperation = EHuiOpSetText);
+
+    /* Implementation of THuiCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CHuiEnv& aEnv) const;
+    
+    /* Implementation of THuiCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+
+    /* Methods. */
+    
+    /**
+     * Returns the visual that the command operates on.
+     */
+    IMPORT_C CHuiTextVisual& TextVisual() const;
+    
+    /**
+     * Returns a reference to the image of the visual.
+     */
+    IMPORT_C const TDesC& Text() const;
+    
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+    
+private:
+
+    /** Text of the command. */
+    const TDesC& iText;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+    
+    
+/**
+ * THuiValueCommand is a command that operates on a single timed value.
+ */    
+class THuiValueCommand : public THuiObjectCommand 
+    {
+public:
+
+    /* Constructor. */
+
+    /**
+     * Constructs a new value command.
+     *
+     * @param aOwner           Owner of the timed value. Allowed to be NULL.
+     * @param aValue           Timed value to modify (owned by aOwner).
+     * @param aTarget          Target value
+     * @param aTransitionTime  Time (in milliseconds) for the transition to occur.
+     */
+    IMPORT_C THuiValueCommand(TAny* aOwner, THuiTimedValue& aValue, 
+                              TReal32 aTarget, TInt aTransitionTime = 0) __SOFTFP; 
+    
+    /**
+     * Constructs a new value command. This constructor takes an operation 
+     * parameter in addition to the target and timing values.
+     *
+     * @param aOwner      Owner of the timed value. Allowed to be NULL.
+     * @param aValue      Timed value to modify (owned by aOwner).
+     * @param aOperation  Operation to perform.
+     * @param aTarget     Target value
+     * @param aTiming     Time (in milliseconds) for the transition to occur.
+     */
+    IMPORT_C THuiValueCommand(TAny* aOwner, THuiTimedValue& aValue, 
+                              THuiOp aOperation = EHuiOpSet,
+                              TReal32 aTarget = 0.0, TReal32 aTiming = 0.0) __SOFTFP;
+                             
+    /* Implementation of THuiCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CHuiEnv& aEnv) const;
+    
+    /* Implementation of THuiCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+
+    /* Methods. */
+    
+    /**
+     * Returns the visual that the command operates on.
+     */
+    IMPORT_C THuiTimedValue& TimedValue() const;
+    
+    /**
+     * Returns the target value.
+     */
+    IMPORT_C TReal32 Target() const __SOFTFP;
+    
+    /**
+     * Returns the transition time.
+     */
+    IMPORT_C TInt TransitionTime() const;
+    
+    /**
+     * Returns the transition speed. Zero, if not set.
+     */
+    IMPORT_C TReal32 Speed() const __SOFTFP;
+       
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+    
+private:
+
+    /** Timed value being operated on. */
+    THuiTimedValue& iTimedValue;
+
+    /** Target value. */
+    TReal32 iTarget;
+    
+    /** Transition time in milliseconds. */
+    TInt iTransitionTime;
+    
+    /** Optionally, transition speed in units/second. */
+    TReal32 iSpeed; 
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+/**
+ * THuiPointCommand is a command that operates on a timed point.
+ */    
+class THuiPointCommand : public THuiObjectCommand 
+    {
+public:
+
+    /* Constructor. */
+
+    /**
+     * Constructs a new timed point command.
+     *
+     * @param aOwner      Owner of the timed point. Allowed to be NULL.
+     * @param aValue      Timed point to modify.
+     * @param aPoint      Point to execute the command on.
+     * @param aOperation  Operation to perform.
+     */
+    IMPORT_C THuiPointCommand(TAny* aOwner, THuiTimedPoint& aPoint, 
+                              THuiOp aOperation);
+
+    /**
+     * Constructs a new timed point command.
+     *
+     * @param aOwner           Owner of the timed value. Allowed to be NULL.
+     * @param aPoint           Point to execute the command on.
+     * @param aValue           Timed value to modify (owned by aOwner).
+     * @param aTarget          Target value
+     * @param aTransitionTime  Time (in milliseconds) for the transition to occur.
+     */
+    IMPORT_C THuiPointCommand(TAny* aOwner, THuiTimedPoint& aPoint, 
+                              THuiRealPoint aTarget, TInt aTransitionTime = 0) __SOFTFP; 
+    
+    /**
+     * Constructs a new timed point command. This constructor takes an operation 
+     * parameter in addition to the target and timing values.
+     *
+     * @param aOwner      Owner of the timed value. Allowed to be NULL.
+     * @param aPoint      Point to execute the command on.
+     * @param aValue      Timed value to modify (owned by aOwner).
+     * @param aOperation  Operation to perform.
+     * @param aTarget     Target value.
+     * @param aTiming     Time (in milliseconds) for the transition to occur.
+     */
+    IMPORT_C THuiPointCommand(TAny* aOwner, THuiTimedPoint& aPoint, 
+                              THuiOp aOperation,
+                              THuiRealPoint aTarget, TReal32 aTiming = 0.0) __SOFTFP;
+                             
+    /* Implementation of THuiCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CHuiEnv& aEnv) const;
+    
+    /* Implementation of THuiCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+
+    /* Methods. */
+    
+    /**
+     * Returns the timed point that the command operates on.
+     * @return The point that the command operates on.
+     */
+    IMPORT_C THuiTimedPoint& TimedPoint() const;
+    
+    /**
+     * Returns the target value.
+     * @return The real point that the command operates on.
+     */
+    IMPORT_C THuiRealPoint Target() const __SOFTFP;
+    
+    /**
+     * Returns the transition time of this point command.
+     * @return The transition time in milliseconds.
+     */
+    IMPORT_C TInt TransitionTime() const;
+    
+    /**
+     * Returns the transition speed of this point command.
+     * @return the transition speed. Zero, if not set.
+     */
+    IMPORT_C TReal32 Speed() const __SOFTFP;
+
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+    
+private:
+
+    /** Timed value being operated on. */
+    THuiTimedPoint& iTimedPoint;
+
+    /** Target value. */
+    THuiRealPoint iTarget;
+    
+    /** Transition time in milliseconds. */
+    TInt iTransitionTime;
+    
+    /** Optionally, transition speed in units/second. */
+    TReal32 iSpeed;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+
+/**
+ * THuiTransformationCommand is a command that operaters on a transformation.
+ */    
+class THuiTransformationCommand : public THuiObjectCommand
+    {
+public:    
+
+    enum 
+        {
+        /** Used in the aStep parameter to specify that no step index is 
+            specified. */
+        EStepNone = -1
+        };
+
+
+    /* Constructor. */
+
+    /**
+     * Constructs a new transformation command.
+     *
+     * @param aOwner      Owner of the transformation. Allowed be NULL.
+     * @param aTransformation  Transformation to operate on.
+     * @param aOperation  Operation to perform.
+     * @param aStep       Step index in the transformation.
+     */
+    IMPORT_C THuiTransformationCommand(TAny* aOwner, CHuiTransformation& aTransformation,
+                                       THuiOp aOperation = EHuiOpLoadIdentity,
+                                       TInt aStep = EStepNone);
+
+    /* Implementation of THuiCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CHuiEnv& aEnv) const;
+    
+    /* Implementation of THuiCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+    /* Methods. */
+    
+    /**
+     * Returns the transformation that the command operates on.
+     */
+    IMPORT_C CHuiTransformation& Transformation() const;
+    
+    /**
+     * Returns the transformation step index.
+     */
+    IMPORT_C TInt Step() const;
+    
+    /**
+     * Sets the X component.
+     *
+     * @param aValue  Value.
+     */
+    IMPORT_C void SetX(const THuiTimedValue& aValue);
+
+    /**
+     * Returns a reference to the Y component.
+     */
+    IMPORT_C void SetY(const THuiTimedValue& aValue);
+
+    /**
+     * Returns a reference to the Z component.
+     */
+    IMPORT_C void SetZ(const THuiTimedValue& aValue);
+    
+    /**
+     * Returns a reference to the angle component.
+     */
+    IMPORT_C void SetAngle(const THuiTimedValue& aValue);
+
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);   
+    
+private:
+
+    /** Image of the command. */
+    CHuiTransformation& iTransformation;
+
+    /** Step index. */    
+    TInt iStep;
+
+    /** X component. Suspended. */
+    THuiTimedValue iX;
+    
+    /** Y component. Suspended. */
+    THuiTimedValue iY;
+    
+    /** Z component. Suspended. */
+    THuiTimedValue iZ;
+    
+    /** Angle component. Suspended. */
+    THuiTimedValue iAngle;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+/**
+ * THuiMarkerCommand is a special marker command that has no functionality, 
+ * but can be entered into the scheduler to mark a specific point in time.
+ */
+class THuiMarkerCommand : public THuiCommand
+    {
+public:
+    
+    /* Constructor. */
+
+    /**
+     * Constructs a new marker command.
+     *
+     * @param aId  Identifier of the marker.
+     */
+    IMPORT_C THuiMarkerCommand(TInt aId);    
+
+
+    /* Methods. */
+
+    /* Implementation of THuiCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CHuiEnv& aEnv) const;
+    
+    /* Implementation of THuiCommand::Size(). */
+    IMPORT_C TInt Size() const;
+    
+    /**
+     * Determines the identifier of the marker.
+     *
+     * @param  Marker identifier.
+     */     
+    IMPORT_C TInt Id() const;
+    
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+/**
+ * THuiCustomEventCommand is a command that sends a custom event. The command
+ * can be sent to any individual MHuiEventHandler derived object or broadcasted to 
+ * all CHuiControl derived objects.
+ */
+class THuiCustomEventCommand : public THuiObjectCommand
+    {
+public:
+    
+    /* Constructor. */
+
+    /**
+     * Constructs a new custom event command.
+     *
+     * @param aEventParam  Parameter of the custom event.
+     * @param aRecipient   Optional recipient of the event. If NULL then event is broadcasted.
+     *
+     * @todo  It would be good to be able to specify more information to 
+     *        be sent with the custom event, e.g., a pointer. Also check
+     *        out THuiEvent.
+     */
+    IMPORT_C THuiCustomEventCommand(TInt aEventParam, MHuiEventHandler* aRecipient = NULL);    
+
+
+    /* Methods. */
+
+    /* Implementation of THuiCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CHuiEnv& aEnv) const;
+    
+    /* Implementation of THuiCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+    /**
+     * Returns the recipient of the event, or NULL if none defined.
+     */
+    IMPORT_C MHuiEventHandler* Recipient() const;
+
+    /**
+     * Determines the custom event parameter of the command.
+     *
+     * @return  Parameter.
+     */     
+    IMPORT_C TInt Param() const;
+
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+
+    /** Custom event parameter. Application cau use re_interpret_cast to send pointer as param */
+    TInt iEventParam;
+
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+#endif  // __HUICOMMAND_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiControl.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,664 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   CHuiControl provides a base class for a generic logical control 
+*                element in the HUITK UI.
+*
+*/
+
+
+
+#ifndef __HUICONTROL_H__
+#define __HUICONTROL_H__
+
+
+#include <e32base.h>
+#include <barsread.h>
+#include <uiacceltk/HuiVisual.h>
+#include <uiacceltk/HuiLayout.h>
+#include <uiacceltk/HuiSessionObject.h>
+#include <uiacceltk/huieventhandler.h>
+
+/* Forward declarations. */
+class CHuiEnv;
+class CHuiTextureManager;
+class CHuiDisplay;
+class THuiEvent;
+class CHuiControlGroup;
+
+
+/**
+ * CHuiControl provides a base class for gathering logical functionality in
+ * the UI.
+ *
+ * For example a list control could gather (and _control_) all visuals that form
+ * a listbox UI element. A thumbnail view control could be used to control visuals
+ * that form a thumbnail view in an image gallery application.
+ *
+ * Their main use is to handle interaction with the user - Controls handle input
+ * events by overriding OfferEventL().
+ *
+ * Controls are not visible by themselves, but controls create and manipulate
+ * visuals (@see CHuiVisual) - set target values for visual properties and/or
+ * schedule animation commands.
+ *
+ * Controls are collected in groups (e.g., one group per view), but do not have a
+ * hierarchical organization. However controls can be connected to each other
+ * for collaboration between multiple controls. @see AddConnectionL()
+ */
+class CHuiControl : public CBase, 
+                    public MHuiVisualOwner, 
+                    public MHuiEventHandler,
+                    public MHuiSessionObject
+	{
+public:
+
+	/** @beginAPI */
+	
+	/* Constructors and destructor. */
+
+	/**
+	 * Constructs this control. An unique ID for this control is
+	 * generated for this control using CHuiStatic::GenerateId();
+	 * @see Id()
+	 * 
+	 * @todo This constructor is public, explain rationale.
+	 */
+	IMPORT_C CHuiControl(CHuiEnv& aEnv);
+
+	/**
+	 * Destructs this control. Cancels all scheduled commands for this control.
+     * Removes the host and any other connections (if any) and destroys
+     * the visuals owned by this control.
+	 */
+	IMPORT_C ~CHuiControl();
+
+    void ConstructL()
+        {
+        BaseConstructL();
+        }
+
+	/* Methods. */
+
+	/**
+	 * Set an id value for this control.
+	 */
+	IMPORT_C void SetId(TInt aId);
+
+	/**
+	 * Returns the id of this control. Zero (0) id the control has no id.
+	 */
+	IMPORT_C TInt Id() const;
+
+	/**
+	 * From MHuiVisualOwner. Returns the environment of the visual.
+	 */
+	IMPORT_C CHuiEnv& Env() const;
+
+	/**
+	 * From MHuiVisualOwner. Returns the control group of the visual's owner control.
+	 *
+	 * @return  Control group, or <code>NULL</code> if there isn't one.
+	 */
+	IMPORT_C CHuiControlGroup* ControlGroup() const;
+
+    /**
+     * Returns the texture manager of the environment of the visual.
+     */
+    IMPORT_C CHuiTextureManager& TextureManager() const;
+
+    /**
+     * Returns the display this control is bound to, or <code>NULL</code>.
+     */
+    IMPORT_C CHuiDisplay* Display() const;
+
+    /**
+     * Binds the control to a display. Called automatically by 
+     * CHuiControl::ShowL().
+     */
+    IMPORT_C void BindDisplay(CHuiDisplay& aDisplay);
+
+	/**
+	 * From MHuiVisualOwner. Appends a visual to the control. The control also receives ownership
+	 * of the visual. This method is specifically intended to be used when
+	 * adding previously created visuals to the control.
+	 *
+	 * @param aVisual  Visual to add. Control gets ownership.
+	 */
+    IMPORT_C void AppendL(CHuiVisual* aVisual);
+
+	/**
+	 * Appends a new visual to the list of visuals owned by the control.
+	 * This method is specifically intended to be used during construction
+	 * of visual trees.
+	 *
+	 * @param aVisual  Visual to append.
+	 */
+	IMPORT_C void AppendL(CHuiVisual* aVisual, CHuiLayout* aParentLayout);
+
+	/**
+	 * From MHuiVisualOwner. Removes a visual from the control. The caller also receives ownership
+	 * of the visual.
+	 *
+	 * @param aVisual  Visual to remove. Caller gets ownership.
+	 */
+	IMPORT_C void Remove(CHuiVisual* aVisual);
+
+	/**
+	 * Creates a new visual using the visual factory and appends it.
+	 *
+	 * @param aVisualType  Type of the visual to create.
+	 *
+	 * @return  Pointer to the created visual.
+	 */
+    IMPORT_C CHuiVisual* AppendVisualL(THuiVisualType aVisualType,
+                                       CHuiLayout* aParentLayout=NULL);
+
+    /**
+     * Creates a new layout using the visual factory and appends it.
+     *
+     * @param aLayoutType  Type of the layout to create.
+     *
+     * @return  Pointer to the created layout.
+     */
+    IMPORT_C CHuiLayout* AppendLayoutL(THuiLayoutType aLayoutType,
+                                       CHuiLayout* aParentLayout=NULL);
+
+    /**
+     * Returns one of the visuals owned by the control.
+     *
+     * @param aIndex  Index number of the visual to return.
+     *
+     * @return  Visual.
+     */
+    IMPORT_C CHuiVisual& Visual(TInt aIndex) const;
+
+    /**
+     * Determines the number of visuals owned by the control. 
+     *
+     * Note that in visual hierarchies, child visuals are not owned by 
+     * their parent visuals, but a control. This means that a control 
+     * that owns a tree of visuals will return the total number of visuals 
+     * in the tree, and not just the number of root visuals.
+     *
+     * @return  Number of visuals owned by the control.
+     */
+    IMPORT_C TInt VisualCount() const;
+
+    /**
+     * Finds the visual that matches a tag. Only the visuals owned by 
+     * this control are searched.
+     *
+     * @param aTag  Tag descriptor to match against.
+     *
+     * @return  The first visual that matches the tag, or <code>NULL</code>
+     *          if no visual matched the tag.
+     */
+    IMPORT_C CHuiVisual* FindTag(const TDesC8& aTag) const;
+      
+	/**
+	 * Returns the visual host control.
+	 *
+	 * @return  Host control. NULL if not connected.
+	 */
+	IMPORT_C CHuiControl* Host() const;
+
+	/**
+	 * New virtual method. Establishes a connection between this control and another control.
+	 * Instead of supporting a treelike parent-child control hierarchy, Hitchcock
+	 * allows defining a set of links between any controls. These links are called
+	 * connections. Connections can be used to construct a parent-child
+     * based hierarchy of controls, if that is considered necessary from the point
+     * of view of input event handling or some other data passing scenario. They
+     * can be utilized for observation purposes or keeping track of associated controls.
+	 *
+	 * @param aConnectedControl  Control to connect.
+	 * @param aRole              Role of the control. Interpretation depends on
+	 *                           the host.
+	 * @see HUITK Programmer's Guide for examples of how to connect controls.
+	 */
+	IMPORT_C virtual void AddConnectionL(CHuiControl* aConnectedControl, TInt aRole=0);
+
+	/**
+	 * Removes a client.
+	 *
+	 * @param aConnectedControl  Connected control to remove.
+	 */
+	IMPORT_C void RemoveConnection(CHuiControl* aConnectedControl);
+
+    /**
+     * Find a client's index number.
+     *
+     * @param aConnected  Connected control to find.
+     *
+     * @return  Index number.
+     */
+    IMPORT_C TInt FindConnection(const CHuiControl* aConnected) const;
+
+	/**
+	 * Returns the number of clients.
+	 *
+	 * @return  Number of client controls.
+	 */
+    IMPORT_C TInt ConnectionCount() const;
+
+	/**
+	 * Returns a client control.
+	 *
+	 * @param aIndex  Index of the client.
+	 *
+	 * @return  Reference to the client control.
+	 */
+    IMPORT_C CHuiControl& Connection(TInt aIndex) const;
+
+    /**
+     * @deprecated
+     *
+     * Returns a client control.
+     *
+     * @param aOrdinal  Role or index.
+     */
+    IMPORT_C CHuiControl& ConnectionByOrdinal(TInt aOrdinal) const;
+
+	/**
+	 * Returns the role of a client control.
+	 *
+	 * Roles are defined by the application developer - a user interface framework
+	 * built on top of Hitchcock can define a suitable set of roles for the controls
+	 * implemented in the framework.
+	 *
+	 * @param aIndex  Index of the client.
+	 *
+	 * @return  Role of the client control.
+	 * @see AddConnectionL()
+	 */
+    IMPORT_C TInt ConnectionRole(TInt aIndex) const;
+
+    /**
+     * @deprecated
+     *
+     * Ordinal is the effective index. Role overrides index.
+     * @see AddConnectionL()
+     */
+    IMPORT_C TInt ConnectionOrdinal(TInt aIndex) const;
+
+    /**
+     * Returns the control's role.
+     * 
+     * @return Role. Zero by default.
+     *
+     * @see AddConnectionL()
+     */
+    IMPORT_C TInt Role() const;
+
+    /**
+     * Sets the control's role.
+     * 
+     * @param aRole Connection role.
+     *
+     * @see AddConnectionL()
+     */
+    IMPORT_C void SetRole(TInt aRole);
+
+    /**
+     * Returns the automatic visual host identification.
+     *
+     * @return Automatic visual host identification. Zero id not set.
+     */
+    IMPORT_C TInt HostId() const;
+
+    /**
+     * Sets the automatic visual host identification (non zero).
+     * Needs to be unique in the CHuiEnv. If using this automatic mechanism, 
+     * do not use the AddConnectionL() function - it will be automatically 
+     * called when this control is shown.
+     *
+     * @return Automatic visual host identification.
+     */
+    IMPORT_C void SetHostId(TInt aHostId);
+
+	/**
+	 * @internal
+	 *
+	 * Do not call outside the toolkit library!
+	 *
+	 * Sets the host of the control. This will be called by the AddConnectioL()
+	 *
+	 * @param aHost Host control.
+	 */
+    IMPORT_C void SetHost(CHuiControl* aHost);
+
+    /**
+     * Returns a container layout for the specified child control. 
+     * A container layout contains all the visuals of a child control.
+     *
+     * @param aConnected Child connection, which is querying for the visual host.
+     * 
+     * @return Container layout for the child controls' root visuals.
+     */
+    IMPORT_C virtual CHuiLayout* ContainerLayout(const CHuiControl* aConnected) const;
+
+    /**
+     * Coordinate conversion.
+     */
+    IMPORT_C TPoint HostToDisplay(const TPoint& aPoint) const;
+
+    /**
+     * Coordinate conversion.
+     */
+    IMPORT_C TPoint DisplayToHost(const TPoint& aPoint) const;
+
+    /**
+     * Calculates the region of the screen where the control's visuals are.
+     *
+     * @return  Rectangle in display coordinates.
+     */
+    IMPORT_C TRect Bounds() const;
+
+    /**
+     * Tests whether a point is inside the control.
+     *
+     * @param aPoint  Point in display coordinates.
+     *
+     * @return  <code>ETrue</code>, if the point is inside one of the
+     *          control's visuals. Otherwise <code>EFalse</code>.
+     */
+    IMPORT_C TBool HitTest(const TPoint& aPoint) const;
+
+    /**
+     * Acquires focus for this control.
+     */
+    IMPORT_C void AcquireFocus();
+
+    /**
+     * Determines whether the control has input focus.
+     */
+    IMPORT_C TBool Focus() const;
+
+    /**
+     * New virtual method. Determines whether the control wants to receive focus.
+     */
+    IMPORT_C virtual TBool IsFocusing() const;
+
+    /**
+     * New virtual method. Called when the control's focus state changes.
+     */
+    IMPORT_C virtual void FocusChanged(CHuiDisplay& aDisplay, TBool iFocused);
+
+    /**
+     * Determines whether the control accepts input events.
+     */
+    IMPORT_C TBool AcceptInput() const;
+
+    /**
+     * From MHuiEventHandler. Called when an input event is being offered to the control.
+     *
+     * @param aEvent  Event to be handled.
+     *
+     * @return  <code>ETrue</code>, if the event was handled.
+     *          Otherwise <code>EFalse</code>.
+     */
+    IMPORT_C TBool OfferEventL(const THuiEvent& aEvent);
+
+    /**
+     * Determines the display area.
+     *
+     * @return  Area of the display on which the control is shown.
+     */
+    IMPORT_C TRect DisplayArea() const;
+
+    /**
+     * Determines the coordinates of the center of the display.
+     *
+     * @return  Center of the display on which the control is shown.
+     */
+    IMPORT_C THuiRealPoint DisplayCenter() const __SOFTFP;
+
+    /**
+     * Cancel all scheduled commands related to this control and the control's
+     * visuals.
+     */
+    IMPORT_C void CancelAllCommands();
+
+    /**
+     * From MHuiVisualOwner. Notifies the control that one of the visuals it ows has been laid out.
+     * Called automatically from CHuiVisual::UpdateChildrenLayout().
+     * For example, occurs when a parent layout is resized.
+     *
+     * @param aVisual  Visual whose layout was updated.
+     */
+    IMPORT_C void VisualLayoutUpdated(CHuiVisual& aVisual);
+    
+    /**
+     * From MHuiVisualOwner. Called when a visual owned by the control is being destroyed.
+     * Visual is removed from the control.
+     *
+     * @param aVisual  Visual about to the destroyed.
+     */
+    IMPORT_C void VisualDestroyed(CHuiVisual& aVisual);
+
+	/**
+	 * From MHuiVisualOwner. Called when there was an error (a leave happened)
+	 * while preparing one of the controls visual for drawing. 
+	 * Typically the resource alloc errors such as out of 
+	 * memory is escalated through this callback.
+	 * 
+	 * By default this callback causes a panic with the
+	 * error code, so you should override this if you
+	 * want different behavior.
+	 * 
+     * @param aVisual    Visual that caused the error.
+     * @param aErrorCode Symbian KErr error code for the failure.
+	 */
+    IMPORT_C void VisualPrepareDrawFailed(CHuiVisual& aVisual, TInt aErrorCode); 
+
+    /**
+     * From MHuiVisualOwner. Returns a pointer to the event handler responsible for handling
+     * events related this control's visuals (i.e. the handler is this
+     * control).
+     */
+    IMPORT_C MHuiEventHandler* EventHandler();
+
+    /** @endAPI */
+
+
+    /**
+     * Sets the group that owns the control. Called by the control group
+     * when the control is added to the group.
+     *
+     * @param aOwnerGroup  Owner group.
+     */
+    void SetControlGroup(CHuiControlGroup& aOwnerGroup);
+
+    /**
+     * Shows all the unshown visuals of the control on the specified display.
+     * Visuals that are currently shown on another display are not affected.
+     *
+     * @param aDisplay  Display to add visuals to.
+     *
+     * @see CHuiControl::BindDisplay()
+     */
+    void ShowL(CHuiDisplay& aDisplay);
+
+    /**
+     * Hides those visuals that are displayed on the specified display. Other
+     * visuals are not affected.
+     *
+     * @param aDisplay  Display to remove visuals from.
+     */
+    void Hide(CHuiDisplay& aDisplay);
+
+    /**
+     * Changes the control's focus state.
+     */
+    void SetFocus(CHuiDisplay& aDisplay, TBool aHasFocus);
+
+    /**
+     * Sets the flag that tells whether the control wants to receive focus.
+     */
+    void SetFocusing(TBool aFocusing);
+
+    /**
+     * Clears the change flags of the control.
+     */
+    void ClearChanged();
+
+
+protected:
+
+    /** @beginAPI */
+
+    /* Methods. */
+
+    /**
+     * New virtual method. Notifies the control that its visible has been changed on a display.
+     * This is the earliest time when the control knows the dimensions of
+     * the display it is being shown on.
+     *
+     * @param aIsVisible  ETrue, if the control is now visible on the display.
+     *                    EFalse, if the control is about to the hidden on the display.
+     * @param aDisplay    The display on which the control's visibility is changing.
+     */
+    IMPORT_C virtual void NotifyControlVisibility(TBool aIsVisible, CHuiDisplay& aDisplay);
+
+
+    /* Utility methods. */
+
+    /**
+     * New virtual method. Called when a visual has been added to the control.
+     *
+     * @param aVisual  Visual that was added.
+     */
+    IMPORT_C virtual void VisualAddedL(CHuiVisual* aVisual);
+
+    /**
+     * New virtual method. Called when a visual has been removed from the control.
+     *
+     * @param aVisual  Visual that was removed.
+     */
+    IMPORT_C virtual void VisualRemoved(CHuiVisual* aVisual);
+
+    /**
+     * New virtual method. Called when a client control is added to the control.
+     * 
+     * @see AddConnectionL()
+     */
+    IMPORT_C virtual void ConnectionAddedL(CHuiControl* aConnectedControl, TInt aRole);
+
+    /**
+     * New virtual method. Called when a client control is removed from the control.
+     *
+     * @see RemoveConnection()
+     */
+    IMPORT_C virtual void ConnectionRemoved(CHuiControl* aConnectedControl, TInt aRole);
+
+    /**
+     * New virtual method. The host control is about to be changed. The control needs to
+     * add its visuals to the container layout provided by the new host.
+     *
+     * @see SetHost()
+     */
+    IMPORT_C virtual void HostChangingL(CHuiControl* aNewHost);
+
+    /**
+     * Virtual second phase constructor. Must be base called in deriving class.
+     */
+    IMPORT_C virtual void BaseConstructL();
+
+    IMPORT_C virtual void ControlExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+   /** @endAPI */
+ 
+
+protected: // from MHuiSessionObject
+    
+    /**
+     * ! Gets the object type.
+     */
+    IMPORT_C TType Type() const;
+
+    /**
+     * ! Gets the session id for object.
+     */
+    IMPORT_C TInt SessionId() const;
+
+    /**
+     * ! Sets the session id for object.
+     */
+    IMPORT_C void SetSessionId(TInt aSessionId);
+
+
+public: // internal utilities    
+    
+    /**
+     * Remove this control's visuals from the specified container layout.
+     *
+     * @param aHostControl Host control.
+     */
+    void RemoveVisualsFromHostControl( CHuiControl& aHostControl );
+
+private:
+
+    /** The environment where this visual belong to. */
+    CHuiEnv& iEnv;
+
+    /** The group into which this control belongs to. */
+    CHuiControlGroup* iOwnerGroup;
+
+    /** The display this control is currently bound to. */
+    CHuiDisplay* iBoundDisplay;
+
+    /** Identifier of the control. */
+    TInt iId;
+
+    /** Identifier of the host control. */
+    TInt iHostId;
+
+    /** Control's role. */
+    TInt iRole;
+
+    /** Visuals owned by the control. */
+    RPointerArray<CHuiVisual> iVisuals;
+
+    /** Host control. The host provides a container visual for this control's
+        visuals. */
+    CHuiControl* iHost;
+
+    /** Holds information about a client control. */
+    struct SConnection
+        {
+        /** Connected control. */
+        CHuiControl* iControl;
+
+        /** Role of the client. */
+        /** @todo The role here is redundant because each control knows
+                  its role? */
+        TInt iRole;
+        };
+
+    /** Connected controls and their roles. */
+    RArray<SConnection> iConnections;
+
+    /** ETrue, if the control wants to receive input focus. */
+    TBool iFocusing;
+
+    /** Control has input focus. */
+    TBool iHasFocus;
+
+    /** Session id */
+    TInt iSessionId;
+
+    TAny* iSpare;
+	};
+
+#endif  // __HUICONTROL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiControlGroup.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,253 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUICONTROLGROUP_H__
+#define __HUICONTROLGROUP_H__
+
+
+#include <e32base.h>
+#include <barsread.h>
+
+#include <uiacceltk/HuiTimedValue.h>
+#include <uiacceltk/HuiObserverArray.h>
+#include <uiacceltk/huieventhandler.h>
+#include <uiacceltk/HuiSessionObject.h>
+
+
+/* Forward declarations. */
+class CHuiEnv;
+class CHuiControl;
+class CHuiTransformation;
+
+
+/**
+ * CHuiControlgroup instances are used to organize controls into logical
+ * groups (based on, e.g., UI views or functionality).
+ *
+ * Control groups have ownership of CHuiControl instances in the toolkit.
+ *
+ * During the application startup the application programmer sets up
+ * controls into control groups. Typically the initialization phase ends
+ * up showing one or more control groups on a display:
+ *
+ * <code>
+ * iHuiDisplay->Roster().ShowL(group);
+ * </code>
+ */
+NONSHARABLE_CLASS(CHuiControlGroup) : public CBase, public MHuiSessionObject
+	{
+public:
+
+	/* Constructors and destructor. */
+
+	/**
+	 * Constructor.
+	 */
+	CHuiControlGroup(TInt aResourceId, CHuiEnv& aEnv);
+
+	/**
+	 * Second-phase constructor.
+	 */
+	void ConstructL();
+
+    /**
+	 * Second-phase constructor that reads definitions using a resource
+	 * reader.
+	 *
+	 * @param aReader  Resource reader initialized with the group definition.
+	 */
+	void ConstructFromResourceL(TResourceReader& aReader);
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~CHuiControlGroup();
+
+
+	/* Methods. */
+
+	/**
+	 * Determines the identifier of the control group (from a resource file).
+	 *
+	 * @return  Resource identifier.
+	 */
+	IMPORT_C TInt ResourceId() const;
+
+	/**
+	 * Adds a new control into the group. The group takes ownership of the
+	 * control.
+	 *
+	 * @param aControl  Control to insert into the group.
+	 */
+	IMPORT_C void AppendL(CHuiControl* aControl);
+
+	/**
+	 * Adds a new control into the group and pops it off of the cleanup
+	 * stack.
+	 *
+	 * @param aControl  Control to insert into the group and pop.
+	 */
+	IMPORT_C void AppendAndPopL(CHuiControl* aControl);
+
+    /**
+     * Removes a control from the control group.
+     *
+     * @param aControl  Control to remove from the group. The control's
+     *                  ownership is transferred to the caller. Note that
+     *                  controls should never be used unless they are
+     *                  owned by a control group.
+     *
+     * @return  KErrNone, if successful. KErrNotFound, if the control is not
+     *          in the group.
+     */
+    IMPORT_C TInt Remove(CHuiControl* aControl);
+
+    /**
+     * Returns the number of controls within this group.
+     * 
+     * @return Number of controls.
+     */
+    IMPORT_C TInt Count() const;
+
+    /**
+     * Access a control within the group, by its index into the
+     * internal list of controls. Will panic if an out-of-bounds
+     * index is passed.
+     * 
+     * @param aIndex  Index of the control to return.
+     * 
+     * @return Reference to the requested control. Always
+     *         returns a valid control.
+     */
+    IMPORT_C CHuiControl& Control(TInt aIndex) const;
+
+    /**
+     * @return  Pointer to the control, or <code>NULL</code> if the control
+     *          is not in the group.
+     */
+    IMPORT_C CHuiControl* FindControl(TInt aId) const;
+
+    /**
+     * Enables or disables transformation of the control group.
+     */
+    IMPORT_C void EnableTransformationL(TBool aIsTransformed = ETrue);
+
+    /**
+     * Determines if the control group has a transformation.
+     */
+    IMPORT_C TBool IsTransformed() const;
+
+    /**
+     * Returns the transformation of the control group.
+     *
+     * @return  Transformation steps.
+     *
+     * @panic  THuiPanic::EVisualTransformNotEnabled
+     */
+    IMPORT_C CHuiTransformation& Transformation();
+
+	/**
+	 * Determines whether the group accepts input events.
+	 */
+	IMPORT_C TBool AcceptInput() const;
+
+    /**
+     * Sets the input event acceptance of the group.
+     *
+     * @param aAcceptInput  Accept input events.
+     */
+    IMPORT_C void SetAcceptInput(TBool aAcceptInput);
+
+    /**
+     * Determines if the control group has been changed. The roster calls this
+     * to determine if larger updates are necessary.
+     */
+    TBool Changed() const;
+
+    /**
+     * Clears the change flags of the control group and its member controls.
+     */
+    void ClearChanged();
+
+
+    // Implementation of MHuiSessionObject
+    
+    /**
+     * Gets the object type.
+     */
+    IMPORT_C TType Type() const;
+
+    /**
+     * Gets the session id for object.
+     */
+    IMPORT_C TInt SessionId() const;
+
+    /**
+     * Sets the session id for object.
+     */
+    IMPORT_C void SetSessionId(TInt aSessionId);
+
+private:
+
+    /* Private methods */
+
+
+public:
+
+    /** Events that are not handled by any controls in the control group
+        are offered to these event handlers. */
+    RHuiObserverArray<MHuiEventHandler> iUnhandledEventObservers;
+
+
+private:
+
+	/** Resource ID that was passed in the constructor. */
+    TInt iResourceId;
+
+    /** Environment. */
+    CHuiEnv& iEnv;
+
+    /** Accepts input events. */
+    TBool iAcceptInput;
+
+    /** Controls owned by the group. */
+    RPointerArray<CHuiControl> iControls;
+
+    /** Common transformation for all the root visuals of the
+        control group. */
+    CHuiTransformation* iTransform;
+
+    /** Session id */
+    TInt iSessionId;
+
+public:
+
+    /** 
+     * Common opacity for all the controls of the group.
+     *    
+     * @deprecated  Do not use control and control group opacities.
+     *              Instead, set up common parent layouts and adjust their
+     *              opacities. Logic objects should not affect the visible
+     *              elements. 
+     */
+    THuiTimedValue iOpacity;
+
+	};
+
+#endif  // __HUICONTROLGROUP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCurvePath.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,319 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition for CHuiCurvePath. Curve paths are composed of path 
+*                segments and can be used as mapping functions, and in line visuals.
+*
+*/
+
+
+
+#ifndef __HUICURVEPATH_H__
+#define __HUICURVEPATH_H__
+
+
+#include <e32base.h>
+
+#include <uiacceltk/HuiTimedValue.h>
+#include <uiacceltk/HuiTimedPoint.h>
+#include <uiacceltk/HuiRealPoint.h>
+#include <uiacceltk/HuiImage.h>
+
+
+class CHuiGc;
+class CHuiVisual;
+struct THuiCurvePathExtension;
+
+
+/**
+ * CHuiCurvePath is a 2D path composed out of line segments and ellipse arcs.
+ * Each segment can have a length factor that causes it to be shorter or
+ * longer than its real length.
+ */
+class CHuiCurvePath : public CBase, public MHuiMappingFunction
+    {
+    
+    friend class CHuiLineVisual;
+    
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C static CHuiCurvePath* NewL();
+    
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     */
+    IMPORT_C static CHuiCurvePath* NewLC();
+    
+	/**
+	 * Constructor. Not exported.
+	 */
+    IMPORT_C CHuiCurvePath();
+
+    /** 
+     * Destructor.
+     */
+    IMPORT_C ~CHuiCurvePath();
+    
+    
+    /* Methods. */
+    
+    /** 
+     * Resets the path by removing all segments.
+     */
+    IMPORT_C virtual void Reset();
+    
+    /** 
+     * Enables or disables looping of the path. Looping means that all 
+     * positions are wrapped to the path, so that, e.g., positions past
+     * the end are wrapped to the beginning of the path. Looping is enabled by
+     * default.
+     */
+    IMPORT_C void EnableLoop(TBool aEnable = ETrue);
+    
+    /**
+     * Determines if the path is wrapped. 
+     */
+    IMPORT_C TBool Loop() const; 
+    
+    /**
+     * Determines if the path needs updating.
+     */
+    IMPORT_C TBool NeedUpdate() const;
+    
+    /**
+     * Called when the path needs updating.
+     */
+    IMPORT_C void SetNeedsUpdate();
+    
+    /**
+     * Sets the position that is at path location zero.
+     *
+     * @param aPosOrigin  Added to positions when evaluating.
+     */ 
+    IMPORT_C void SetOrigin(TReal32 aPosOrigin) __SOFTFP;
+    
+    /**
+     * Appends a line segment to the path.
+     * @deprecated     
+     *
+     * @param aLength  Negative length means that the length will be the 
+     *                 actual length of the line segment.
+     */
+    IMPORT_C void AppendLineL(const TPoint& aStart, const TPoint& aEnd, 
+                              TReal32 aLength = -1) __SOFTFP;
+
+    /**
+     * Appends a line segment to the path. Note that the coordinate values should 
+     * match to the metrics unit type of the visual that uses this class.
+	 *
+     * @param aStart  	Start point of the line segment. 
+     * @param aEnd  	End point of the line segment. 
+     * @param aLength  	Negative length means that the length will be the 
+     *                 	actual length of the line segment.
+     */
+    IMPORT_C void AppendLineL(const THuiRealPoint& aStart, const THuiRealPoint& aEnd, 
+                              TReal32 aLength = -1) __SOFTFP;
+
+    /**
+     * Appends a curve segment to the path.
+     * @deprecated     
+     *
+     * @param aOrigin      Origin of the arc ellipse.
+     * @param aSize        Horiz and vert radii of the arc ellipse.
+     * @param aStartAngle  Start angle of the arc (degrees).
+     * @param aEndAngle    End angle of the arc (degrees).
+     * @param aLength      Negative length means that the length will be the
+     *                     actual length of the arc.
+     */                              
+    IMPORT_C void AppendArcL(const TPoint& aOrigin, const TSize& aSize,
+                             TReal32 aStartAngle, TReal32 aEndAngle,
+                             TReal32 aLength = -1) __SOFTFP;               
+   
+    /**
+     * Appends a curve segment to the path. Note that the coordinate values should 
+     * match to the metrics unit type of the visual that uses this class.
+     *
+     * @param aOrigin      Origin of the arc ellipse.
+     * @param aSize        Horiz and vert radii of the arc ellipse.
+     * @param aStartAngle  Start angle of the arc (degrees).
+     * @param aEndAngle    End angle of the arc (degrees).
+     * @param aLength      Negative length means that the length will be the
+     *                     actual length of the arc.
+     */                              
+    IMPORT_C void AppendArcL(const THuiRealPoint& aOrigin, const THuiRealSize& aSize,
+                             TReal32 aStartAngle, TReal32 aEndAngle,
+                             TReal32 aLength = -1) __SOFTFP;               
+   
+    /**
+     * Determines the total length of the path.
+     */                
+    IMPORT_C TReal32 Length() const __SOFTFP;
+   
+    /**
+     * Evaluates a point along the curve path.
+     *
+     * @param aPos    Position along the path.
+     * @param aPoint  X and Y coordinates of the point on the path.
+     */
+    IMPORT_C void Evaluate(TReal32 aPos, THuiRealPoint& aPoint) const __SOFTFP;                                     
+    
+    /**
+     * Recalculate the path's vertices and colors. 
+     */
+    IMPORT_C virtual void Update(TReal32 aStartPos, TReal32 aEndPos, 
+                        TReal32 aAlphaFactor,
+                        MHuiMappingFunction* aAlphaFunction,
+                        MHuiMappingFunction* aWidthFunction) __SOFTFP;
+    
+    /** 
+     * Draws the path's triangles.
+     */
+    IMPORT_C virtual void Draw(const TPoint& aOrigin, CHuiGc* aGc) const;
+
+
+    /* Implements the MHuiMappingFunction interface. */
+    
+    IMPORT_C TReal32 MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP;
+    
+    IMPORT_C TBool MappingFunctionChanged() const;
+    
+    IMPORT_C void MappingFunctionClearChanged();
+    IMPORT_C void SetVisual(const CHuiVisual* aVisual) const;
+    IMPORT_C const CHuiVisual* GetVisual() const;
+    IMPORT_C TBool IsLegacyApiUsed() const;
+    
+protected:
+
+    /* Methods. */
+
+    /**
+     * Determines the total length of the path by summing the lengths of
+     * all the segments.
+     */                         
+    IMPORT_C TReal32 CalculateLength() const;
+            
+        
+protected:
+
+    /* Types. */
+    
+    /** Segment type. */
+    enum TSegmentType
+        {
+        ESegmentTypeLine,
+        ESegmentTypeArc
+        };
+    
+	/**
+	 * A single segment of a path, of shape TSegmentType. These are joined
+	 * together to make a complex path.
+	 * 
+	 */
+    struct TSegment
+        {
+        /** Straight or curved. */
+        TSegmentType iType;
+        /** Length of the path segment. */
+        TReal32 iLength;
+        /** Point where it starts. */
+        THuiRealPoint iOrigin;
+        /** Point where it ends. */
+        THuiRealPoint iDelta;
+        /** Starting angle (if curved). */
+        TReal32 iStartAngle;
+        /** Arc size (if curved). */
+        TReal32 iAngleDelta;
+        
+        /** Start position of the segment measured from the start. */
+        TReal32 iTotalPos;
+        };
+
+
+protected:
+
+    /* Methods. */
+  
+    /**
+     * Returns the number of segments.
+     */
+    IMPORT_C TInt SegmentCount() const;
+                         
+    /**
+     * Returns a segment.
+     *
+     * @return  Segment data.
+     */                         
+    IMPORT_C TSegment Segment(TInt aIndex) const;                         
+
+    /**
+     * Evaluates a point on a segment.
+     *
+     * @param aPos      Position.
+     * @param aSegment  Segment (arc or line).
+     * @param aPoint    Result point.
+     * @param aNormal   If specified, returns the normal of the path point.
+     */
+    IMPORT_C void EvaluateSegment(TReal32 aPos, const TSegment& aSegment, 
+                         THuiRealPoint& aPoint, 
+                         THuiRealPoint* aNormal = 0) const;
+                             
+    
+    /**
+     * Provides expandability, helps keeping the binary compatibility. Since virtual
+     * table is now exported and this class is dll derivable and the implementation
+     * is more difficult to change, hence this method, which can provide additional
+     * extension APIs.
+     * 
+     * @param aExtensionUid     UID, which is being used for recognizing the extension
+     * @param aExtensionParams  Return pointer to the extension API, once recognized from the extension uid
+     */
+    IMPORT_C virtual void CurvePathExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+
+private:
+
+    /** Array of line and arc segments. */
+    RArray<TSegment> iSegments;
+
+    /** Path location origin. */
+    TReal32 iPosOrigin;
+
+    TReal32 iTotalLength;
+
+    THuiCurvePathExtension* iExtension;
+    
+    /** Flag to determine if the path has changed. */
+    TBool iChanged;
+
+    TBool iNeedUpdate;   
+
+    /** Spare member to help keeping binary compatibility, since HuiCurvePath
+        is now dll derivable **/
+    TInt iSpare;
+
+public:
+
+    /* Public properties. */
+    
+    /** Offset to the entire path. */
+    THuiTimedPoint iOffset;
+    
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiCurvePathLayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition for CHuiCurvePathLayout. Combines a layout visual 
+*                and a curve path. The path is rescaled as the layout's size changes.
+*
+*/
+
+
+
+#ifndef __HUICURVEPATHLAYOUT_H__
+#define __HUICURVEPATHLAYOUT_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiCurvePath.h>
+#include <uiacceltk/HuiLayout.h>
+#include <uiacceltk/HuiTimedValue.h>
+
+
+/* Forward declarations */
+class CHuiEnv;
+class CHuiLayout;
+
+
+/**
+ * CHuiCurvePathLayout combines a layout visual and a curve path instance. 
+ * Using a curve path layout it is easy to create a curve path that scales
+ * to the size of the layout.
+ *
+ * The curve path layout itself can be used as a mapping function, because it 
+ * implements the MHuiMappingFunction interface. 
+ 
+ * To support legacy applications, if the metrics unit type is EHuiUnitPixel, 
+ * the curve path owned by the layout is scaled to the size of the layout visual.
+ * The path itself should be defined using relative coordinates in the range 0...1000.
+ *
+ * For example, to make the positions of child visuals (or any other visuals)
+ * follow the layout's curve path, call the THuiTimedValue::SetFunction() method
+ * for the position of the visual(s):
+ *
+ * <pre>iChild->Pos().SetFunction(iCurvePathLayout);</pre>
+ */
+NONSHARABLE_CLASS(CHuiCurvePathLayout): public CHuiLayout, public MHuiMappingFunction
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Construct a new curve path layout and give its ownership to a control.
+     *
+     * @param aOwnerControl  Owner control.
+     * @param aParentLayout  Parent layout for the new curve path layout.
+     */
+    IMPORT_C static CHuiCurvePathLayout* AddNewL(CHuiControl& aOwnerControl, 
+                                                 CHuiLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     *
+     * @param aOwner  Owner control.
+     */
+    CHuiCurvePathLayout(MHuiVisualOwner& aOwner);
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+    /**
+     * Destructor.
+     */
+    ~CHuiCurvePathLayout();
+
+
+    /* Methods. */
+
+    /**
+     * Returns the curve path instance of the layout.
+     *
+     * @return Curve path.
+     */
+    IMPORT_C CHuiCurvePath& CurvePath();
+    
+    /**
+     * Overridden version of size changing updates the layout of child visuals.
+     *
+     * @param aSize  New size for the layout.
+     * @param aTransitionTime  Time for the transition to new size to take 
+     *               place.
+     */
+    void SetSize(const THuiRealSize& aSize, TInt aTransitionTime=0);
+    
+    TBool ChildSize(TInt aOrdinal, TSize& aSize);
+    
+    TBool ChildPos(TInt aOrdinal, TPoint& aPos);
+
+    TInt ChildRect(TInt aOrdinal, THuiRealRect& aRect);
+    
+    void GetClassName(TDes& aName) const
+        {
+        aName = _L("CHuiCurvePathLayout");
+        }
+    
+    
+    /* Mapping function impl. */
+    
+    TReal32 MapValue(TReal32 aValue, TInt aMode) const __SOFTFP;
+    
+    TBool MappingFunctionChanged() const;
+    
+    void MappingFunctionClearChanged();
+    
+private:    
+
+    /* Private types. */
+    
+
+private:
+
+    CHuiCurvePath* iPath;
+    
+    };
+
+
+#endif  // __HUICURVEPATHLAYOUT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiDeckLayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition for CHuiDeckLayout. Deck layout is a very simple 
+*                layout that overlays all its children to match the layout's 
+*                own rectangle. Think of it as a deck of cards.
+*
+*/
+
+
+
+#ifndef __HUIDECKLAYOUT_H__
+#define __HUIDECKLAYOUT_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiLayout.h>
+#include <uiacceltk/HuiTimedValue.h>
+
+
+/* Forward declarations */
+class CHuiEnv;
+
+
+/**
+ * CHuiDeckLayout is a very simple layout that overlays all its children to 
+ * match the layout's own rectangle. A suitable analogy would be a deck of 
+ * cards.
+ */
+NONSHARABLE_CLASS(CHuiDeckLayout) : public CHuiLayout
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Construct a new deck layout and give its ownership to a control.
+     *
+     * @param aOwnerControl  Owner control.
+     * @param aParentLayout  Parent layout for the new deck layout.
+     */
+    IMPORT_C static CHuiDeckLayout* AddNewL(CHuiControl& aOwnerControl, 
+                                            CHuiLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     *
+     * @param aOwner  Owner control.
+     */
+    CHuiDeckLayout(MHuiVisualOwner& aOwner);
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C ~CHuiDeckLayout();
+
+
+    /* Methods. */
+
+    /**
+     * Overridden version of size changing updates the layout of child visuals.
+     *
+     * @param aSize  New size for the layout.
+     * @param aTransitionTime  Time for the transition to new size to take 
+     *               place.
+     */
+    void SetSize(const THuiRealSize& aSize, TInt aTransitionTime=0);
+    
+    TBool ChildSize(TInt aOrdinal, TSize& aSize);
+    
+    TBool ChildPos(TInt aOrdinal, TPoint& aPos);
+
+    TInt ChildRect(TInt aOrdinal, THuiRealRect& aRect);        
+
+    void GetClassName(TDes& aName) const
+        {
+        aName = _L("CHuiDeckLayout");
+        }    
+    };
+
+
+#endif  // __HUIDECKLAYOUT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiDisplay.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1001 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines CHuiDisplay, a drawing buffer into which a the toolkit 
+*                contents (visuals) are drawn.
+*
+*/
+
+
+
+#ifndef __HUIDISPLAY_H__
+#define __HUIDISPLAY_H__
+
+
+#include <e32base.h>
+#include <coemain.h>
+#include <gdi.h>
+#include <uiacceltk/HuiGc.h>
+#include <uiacceltk/HuiObserverArray.h>
+#include <uiacceltk/HuiOwnedPointer.h>
+#include <uiacceltk/HuiRoster.h>
+#include <uiacceltk/huidisplaybackgrounditem.h>
+
+
+/* Forward declarations */
+class MHuiRenderSurface;
+class CHuiEnv;
+class CHuiVisual;
+class CHuiControl;
+class CHuiControlGroup;
+class CHuiTransformation;
+class CHuiRosterImpl;
+class CHuiDisplay;
+class CCoeControl;
+class RDrawableWindow;
+
+/* Screen buffer uids */
+const TUid KHuiUidBackBufferAll = 			{0x2000e59d}; // Not used
+const TUid KHuiUidBackBufferScreen0 = 		{0x2000e59e};
+const TUid KHuiUidBackBufferScreen1 = 		{0x2000e59f};
+const TUid KHuiUidBackBufferTvOutNormal = 	{0x2000e5a0};
+const TUid KHuiUidBackBufferTvOutWide = 	{0x2000e5a1};
+
+/**
+*  The intended usage of the display. The display may use this info to 
+*  prioritize the HW usage and route content.
+*  Vendor specific meanings may be used at the end of the enum space.
+*/
+enum THuiDisplayUsageHint
+    {
+    EHuiDisplayUsageGeneric        = 0x00000001,
+    EHuiDisplayUsage3D             = 0x00000002,
+    EHuiDisplayUsageVideoPlayback  = 0x00000004,
+    EHuiDisplayUsageVideoCapture   = 0x00000008,
+    EHuiDisplayUsageViewfinder     = 0x00000010,
+    EHuiDisplayUsageStillImage     = 0x00000011,
+    EHuiDisplayUsageVendorSpecific = 0x80000000
+    };
+
+
+/**
+ * Roster observers are notified before and after draw.
+ */
+class MHuiRosterObserver
+    {
+public:
+
+    /**
+     * Called to notify that roster draw is about to start. 
+     */
+    virtual void NotifyRosterDrawStart(CHuiDisplay& aDisplay) = 0;
+
+    /**
+     * Called to notify that roster draw is finished.    
+     */
+    virtual void NotifyRosterDrawEnd(CHuiDisplay& aDisplay) = 0;
+
+    };
+
+/**
+ * Display refresh observers are notified before a display refresh begins.
+ */
+class MHuiDisplayRefreshObserver
+    {
+public:
+
+    /**
+     * Called to notify the observer that a display refresh is about to begin.
+     * The observer should prepare its state for the display.
+     */
+    virtual void NotifyDisplayRefreshStarted(CHuiDisplay& aDisplay) = 0;
+
+    };
+
+
+/**
+ * Display deletion observer is notified when the display is about to be
+ * destroyed.
+ */
+class MHuiDisplayDeletionObserver
+    {
+public:
+
+    /**
+     * Called to notify the observer that a display is about to be destroyed.
+     */
+    virtual void NotifyDisplayDeletion(CHuiDisplay& aDisplay) = 0;
+
+    };
+
+
+/**
+ * Display size observer is notified when the display is resized.
+  */
+class MHuiDisplayVisibleAreaObserver
+    {
+public:
+
+    /**
+     * Called to notify the observer that a display has been resized.
+     *
+     * @param aDisplay  Display that sends the notification.
+     */
+    virtual void NotifyDisplayVisibleAreaChanged(CHuiDisplay& aDisplay) = 0;
+
+    };
+
+class MHuiScreenBufferObserver
+    {
+public:
+       
+        enum THuiScreenBufferEvent
+            {
+			ENone,
+			EBufferComplete = ENone,
+            ECreated,				// Buffer created 
+            EDeleted, 	   			// Buffer deleted	
+            ERestored, 				// Not yet implemented
+            EReleased, 				// Not yet implemented
+            EBufferDrawComplete		// Buffer has been drawn to the internal window
+            };
+    
+    /**
+     * This is called when all the content have been draw to the buffer.
+     * If EFalse is returned, the buffer will be locked until the observer unlocks it.
+     * If ETrue is returned, the buffer is unlocked automatically, immediately after this method returns.
+     *
+     * @param aBufferUid Unique id of the buffer.
+     * @param aDisplayRect Screen buffer rect.
+     * @param aDirtyRect Dirty rect for the buffer.
+     * @return Return True, if buffer can be freed automatically after this call.
+     */
+    virtual TBool ScreenBufferComplete(TUid aBufferUid, TRect& aDisplayRect, TRect& aDirtyRect) = 0;
+    
+    /**
+     * Alf calls this when e.g. the back buffer is created or deleted.
+     *
+     * @param aId The unique id of the buffer.
+     * @param aEvent @see MAlfScreenBufferObserver::TAlfScreenBufferEvent
+     */
+    virtual void HandleScreenBufferEvent(TUid aBufferUid, TInt aEvent) = 0;
+    };
+
+
+/**
+ * This interface is to be used when drawing the buffer to the window etc.      
+ */
+class MHuiBufferDrawer
+    {
+public:
+    // Clean all resources, usually delete this
+    virtual void ReleaseDrawer() = 0;    
+    };
+
+/**
+ * This interface is to be used when modifying the buffer (sent back to server).      
+ * Could be attached to special content visual.
+ */
+class MHuiGc
+    {
+public:
+    // Clean all resources, usually delete this
+    virtual void ReleaseGc() = 0;
+    };
+
+/*
+ * Internal class. Not for public API.
+ */
+class MHuiFbsBitmapBufferGc: public MHuiGc
+    {
+public:
+    virtual CFbsBitmap* Bitmap() = 0;
+    };
+
+
+/**
+ * CHuiDisplays are the drawing surfaces for the applications using the
+ * toolkit.
+ *
+ * To be able to display any content with the toolkit, application must
+ * create an instance of CHuiDisplay. For that @see CHuiDisplayCoeControl
+ * class and @see CHuiEnv::NewDisplayL().
+ *
+ * CHuiDisplay is drawing buffer into which a roster is drawn. The drawing is
+ * done on the rendering surface associated with the display. The drawing
+ * surface itself can be an on-screen surface (attached to an RWindow) or an
+ * off-screen surface (buffer in memory).
+ *
+ * The display can be set to draw only onto a portion of the surface, so that
+ * multiple displays can share a single surface. The portion of the surface
+ * used by the display is set with SetVisibleArea().
+ *
+ * Displays remain owned by an environment (a CHuiEnv instance).
+ *
+ */
+NONSHARABLE_CLASS(CHuiDisplay) : public CBase,
+                                 public MCoeMessageMonitorObserver
+    {
+public:
+
+    /* Types. */
+
+    /** Background clear modes. */
+    enum TClearMode
+        {
+        /** Do not clear. This is more like an optimization flag.
+         * Using this with OpenGL ES renderer results
+         * to undefined (Trashed) background - so be sure to display content that
+         * fills the entire screen. With the BITGDI renderer the
+         * behavior is similar but the display are will show the previously
+         * rendered avkon content (if any). */
+        EClearNone,
+
+        /** Clear with a solid color. */
+        EClearWithColor,
+
+        /** Clear with the skin background texture. */
+        EClearWithSkinBackground
+        };
+
+    /** Display types. */
+
+    enum TDisplayType
+        {
+        /** @deprecated: Primary LCD display. */
+        EDisplayLcd0 = 0x0,              
+ 
+        /** @deprecated: Secondary LCD display, e.g. the cover display. */
+        EDisplayLcd1 = 0x1,
+        
+        /** @deprecated: TV out */
+        EDisplayTvOut = 0x2,
+
+        /** @deprecated: TV out widescreen */
+        EDisplayTvOutWide = 0x3,
+
+        /** Physical screen */
+        EDisplayNormal = 0x10,     
+ 
+        /** Virtual display */
+        EDisplayVirtual = 0x20,
+
+        /** @deprecated: Off screen buffer */
+        EDisplayOffScreenBuffer = 0x40
+        };
+              
+    /** Texture bitmap format info */
+    
+    class CTextureBitmapFormat: public CBase
+		{
+	public:
+		CTextureBitmapFormat(TDisplayMode aImage, TDisplayMode aMask)
+			: iImage(aImage), iMask(aMask)
+			{}
+	private:
+		CTextureBitmapFormat(const CTextureBitmapFormat& p); 		
+	public:		
+		TDisplayMode iImage;
+		TDisplayMode iMask;	
+		};	    
+		
+    
+    /* RnD: visual outline drawing */
+    enum TDrawVisualOutline
+        {
+        EDrawVisualOutlineNone,
+        EDrawVisualOutlineAllVisuals,      //draw outline for all visuals
+        EDrawVisualOutlineSelectedVisuals  //draw outline for selected visuals and their child visuals
+        };
+    	
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructors.
+     * This constructor should never be called explicitly by application developers,
+     * new displays should be created through the environment instead.
+     *
+     * @param aEnv  The environment that manages this display.
+     * @param aNativeControl  Native control where the display will be used (or <code>NULL</code>).
+     * @param aDisplayType  Display type.
+     * @param aScreenBufferUid  Screen buffer uid.
+     * @see CHuiEnv::NewDisplayL().
+     */     
+    CHuiDisplay(CHuiEnv& aEnv, CCoeControl* aNativeControl, TInt aDisplayType, TUid aScreenBufferUid);
+    CHuiDisplay(CHuiEnv& aEnv, RWindow* aNativeWindow, TInt aDisplayType, TUid aScreenBufferUid);
+
+
+    /**
+    * Destructor 
+    */
+    IMPORT_C ~CHuiDisplay();
+
+    /**
+     * Second-phase constructor. Creates a window and a rendering surface.
+     * Not exported because displays must be created using CHuiEnv.
+     *
+     * @param aRect  Frame rectangle for container.
+     * @param aSharedRoster  Existing roster to use.
+     */
+    void ConstructL(const TRect& aRect, CHuiRoster* aSharedRoster);
+
+    /* Methods. */
+
+    /** @beginAPI */
+
+    /**
+     * Returns the environment of the display.
+     */
+    IMPORT_C CHuiEnv& Env();
+
+    /**
+     * Activates or deactivates the display. Active displays are refreshed,
+     * deactivated ones are not. Display activation and deactivation is
+     * normally carried out automatically.
+     *
+     * @param aActivate  <code>ETrue</code> to activate.
+     */
+    IMPORT_C void Activate(TBool aActivate);
+
+    /**
+     * Determines if the display is active.
+     *
+     * @return  <code>ETrue</code>, if the display is active.
+     */
+    IMPORT_C TBool Active() const;
+
+    /**
+     * Sets a new size for the display. The display's rendering surface will
+     * also be resized.
+     *
+     * @param aSize  New size for the display.
+     */
+    IMPORT_C void SetSizeL(const TSize& aSize);
+
+    /**
+     * Returns the size of the display. The rendering surface of the display
+     * has this same size. This size may be greater than the visible display
+     * area, for example when multiple displays are drawn onto the same surface.
+     *
+     * @return  Size of the display and its rendering surface.
+     * @see VisibleArea()
+     * @see SetVisibleArea()
+     */
+    IMPORT_C TSize Size() const;
+
+    /**
+     * Sets the visible area of the display. The visible area is the area on
+     * the display's rendering surface where the display is drawn. Normally
+     * a display covers the entire rendering surface, but in the situation
+     * where multiple displays are drawn on the same surface, this would be
+     * used to define the visible area of each display.
+     * If there is no graphics context, this method has no effect.
+     *
+     * @param aArea  Visible area for the display.
+     * @see Size()
+     */
+    IMPORT_C void SetVisibleArea(const TRect& aArea);
+
+    /**
+     * Returns the visible area of the display.
+     *
+     * @return  Visible area of the display. Affected by display orientation
+     *          so that the returned rectangle uses the oriented coordinate
+     *          space.
+     *
+     * @todo  Test that the coordinates are calculated correctly.
+     * @see Size()
+     */
+    IMPORT_C TRect VisibleArea() const;
+
+    /**
+     * Sets display orientation.
+     *
+     * @param aOrientation  Display orientation.
+     */
+    IMPORT_C void SetOrientation(CHuiGc::TOrientation aOrientation);
+
+    /**
+     * Determines the orientation of the display, such as horizontal
+     * or vertical.
+     *
+     * @return  Orientation.
+     * @see CHuiGc::TOrientation
+     */
+    IMPORT_C CHuiGc::TOrientation Orientation() const;
+
+    /**
+     * Sets the flag that enables the use of depth testing.
+     *
+     * @param aUseDepth  <code>ETrue</code> to enable depth.
+     */
+    IMPORT_C void SetUseDepth(TBool aUseDepth);
+
+    /**
+     * Sets the flag that tells the display to clear the background before
+     * doing a refresh. Creates new objects required to be able to clear
+     * the background with the defined mode.
+     *
+     * @param aClearBackground  Background clearing mode.
+     * @see SetBackgroundColor()
+     */
+    IMPORT_C void SetClearBackgroundL(TClearMode aClearBackground);
+
+    /**
+     * Sets the background color of the display, if background clearing has
+     * been enabled.
+     *
+     * @param aBackgroundColor  The color to set the background to.
+     * @see SetClearBackgroundL()
+     */
+    IMPORT_C void SetBackgroundColor(const TRgb& aBackgroundColor);
+
+    /**
+     * Sets the items that specify how to clear display before display refresh.
+     * Items may have overlapping rectangles, drawing order is same as item order
+     * in the parameter array. But having lots of overlapping drawing 
+     * causes negative performance impact.
+     * 
+     * This method is alternative to SetClearBackgroundL and SetBackgroundColor
+     * methods.
+     * 
+     * @see SetBackgroundColor()
+     * @see SetClearBackgroundL()
+     * @param aItems Array of items that specify how to clear the background.
+     * 
+     */
+    IMPORT_C void SetBackgroundItemsL(const RArray<THuiDisplayBackgroundItem>& aItems);
+    
+    /**
+     * Makes a screen capture of the display's current content.
+     * This method uses the screen capture method of the current
+     * graphics context. This may return differing data depending on the
+     * chosen graphics context, and screen capture may not be supported.
+     * The returned pointer may be allocated from inside the graphics context,
+     * it may need to be deleted afterwards.
+     *
+     * @param aSize  Size of the captured image.
+     *
+     * @return  Captured pixel data, in the form returned by the HuiGc.
+     * @see HuiGles10Gc::CaptureLC()
+     */
+    IMPORT_C TUint8* CaptureLC(TSize& aSize) const;
+
+    /**
+     * Returns the transformation for the entire display.
+     */
+    IMPORT_C CHuiTransformation& Transformation() const;
+
+    /**
+     * Returns the roster of the display.
+     */
+    IMPORT_C CHuiRoster& Roster();
+    
+    /**
+     * Returns the const roster of the display.
+     */    
+    IMPORT_C const CHuiRoster& Roster() const;
+
+    /**
+     * Shows or hides the display. The application should call this if
+     * the display goes to background.
+     *
+     * @param aShow ETrue if display is shown. EFalse if display is hidden.
+     */
+    IMPORT_C void Show(TBool aShow);
+
+    /**
+     * Flag the entire display as dirty.
+     */
+    IMPORT_C void SetDirty();
+    /**
+     * Sets the rendering quality of the display.
+     */
+    IMPORT_C void SetQuality(THuiQuality aRenderingQuality);
+
+    /**
+     * Determines the rendering quality of the display.
+     */
+    IMPORT_C THuiQuality Quality() const;
+    
+    /**
+     * Tells display the intended usage of the display. Display may use this
+     * information to optimize the drawing.
+     *
+     * @param aUsage 
+     *
+     *   Possible values for parameter are:
+     *    EHuiDisplayUsageGeneric 
+     *    EHuiDisplayUsage3D      
+     *    EHuiDisplayUsageVideoPlayback
+     *    EHuiDisplayUsageVideoCapture 
+     *    EHuiDisplayUsageViewfinder   
+     *    EHuiDisplayUsageStillImage   
+     *    EHuiDisplayUsageVendorSpecific + n
+     *  
+     *  Supported values depend on display type
+     *  and underlying HW.
+     *
+     * 
+     */    
+    IMPORT_C void SetUsageL(TUint aUsageHint);
+
+    /**
+     * Temporarily release the rendering surfaces used by this display. You
+     * can call this method to free up resources related to display for example 
+     * when the display goes to background (ie. is not visible).
+     * @see RestoreL() 
+     */
+    IMPORT_C void Release();
+    
+    /**
+     * Recreate any released resources of this display. You
+     * can call this method to recreate resources related to display for example 
+     * when the display comes back to foreground (ie. becomes visible).
+     * @see Release() 
+     */
+    IMPORT_C void RestoreL();
+    
+    /**
+     * Lock or unlock the screen buffer. If the buffer is locked the system cannot draw to it. 
+     *
+     * @param TBool Lock or unlock the screen buffer
+     */
+	IMPORT_C void SetScreenBufferLock(TBool aLock);
+    
+    /**
+     * Returns locking state of the screen buffer. 
+     *
+     * @return TBool Locking state of the screen buffer
+     */
+	IMPORT_C TBool IsScreenBufferLocked() const;
+    
+    /**
+     * Returns an instance of an interface for drawing the buffer e.g. to a window. 
+     *
+     * @param aInterfaceUid Unique id of the interface.
+     */
+    IMPORT_C MHuiBufferDrawer* GetDrawingInterface(const TUid& aInterfaceUid);    
+    
+    /**
+     * Returns an instance of an interface for drawing to the buffer. 
+     *
+     * @param aInterfaceUid Unique id of the interface.
+     */
+    IMPORT_C MHuiGc* GetGraphicsContext(const TUid& aInterfaceUid);  
+    
+    /**
+     * Add an observer for a buffer. There can be only one observer at a time, so this overrides 
+     * the previous one.
+     *
+     * @param aObserver Pointer to the observer.
+     */
+    IMPORT_C void AddScreenBufferObserverL(MHuiScreenBufferObserver* aObserver);  
+    
+    /**
+     * Remove observer from the buffer.
+     */
+    IMPORT_C void RemoveScreenBufferObserver();
+    
+    /**
+     * Return the screen buffer observer.
+     *
+     * @return Screen buffer observer
+     */
+	IMPORT_C MHuiScreenBufferObserver* ScreenBufferObserver();
+	
+    /**
+     * Draw the screen buffer to the internal window 
+     */
+	IMPORT_C void DrawScreenBuffer(); 
+	
+    /**
+     * Return the screen buffer uid
+     *
+     * @return Screen buffer uid
+     */
+	IMPORT_C TUid ScreenBufferUid(); 
+	
+    /**
+     * Return the display type.
+     *
+     * @return Display type
+     */
+	IMPORT_C TInt DisplayType(); 
+	
+	/**
+	 * For debugging the dirty regions. Do not call in a release version.
+	 * Valid only with BitGDI renderer.
+	 * 
+	 * @param aShow ETrue shows the dirty regioins
+	 *              EFalse hides the dirty regions (default)
+	 */
+	IMPORT_C void ShowDirtyRegions( TBool aShow = ETrue );
+	
+	/**
+	 * Get a list of preferred texture formats that are optimal for the renderer. The formats are
+	 * in descending preference order, if applicable.
+	 * 
+	 * This method can be used for finding suitable format for textures to be created with 
+	 * EHuiTextureFlagAllowDirectBitmapUsage flag.  
+	 *
+	 * The ownership of array items is given to caller. The application should call ResetAndDestroy()
+	 * for the array before it goes out of scope, even if an error is returned.
+	 * 
+	 * @param aTextureFormats returns a list of preferred formats for this display.
+     * @return Error code.  
+	 */
+	IMPORT_C TInt GetPreferredTextureFormats(RPointerArray<CHuiDisplay::CTextureBitmapFormat>& aTextureFormats);
+
+    /**
+     * Sets clipping rect for display visible area. Does not modify actual visible area,
+     * but drawing outside the given clipping rect is clipped. Setting new VisibleArea
+     * cancels automatically clipping rect that has possibly been set with this method.
+     * @param aVisibleAreaClippingRect Clipping rect for visible area. Setting rect to value 
+     * TRect(0,0,0,0) disables clipping.
+     */
+     IMPORT_C void SetVisibleAreaClippingRect(const TRect& aVisibleAreaClippingRect);
+     
+    /**
+     * For debugging purposes. Do not call in a release version - needs a RnD central
+     * repository key for activation. See programmers guide for more information.
+     * 
+     * @param aDrawVisualOutline Holds the flag value for drawing visual outline.
+     * @see TDrawVisualOutline
+     */
+    IMPORT_C void SetDrawVisualOutline( TUint aDrawVisualOutline );
+     
+    /** @endAPI */
+
+    /**
+     * Returns the graphics context of the display.
+     */
+    CHuiGc* Gc();
+
+    /**
+     * Returns the native control associated with the display, if there is one.
+     *
+     * @return  CCoeControl in which the display is shown, or <code>NULL</code>.
+     */
+    IMPORT_C CCoeControl* NativeControl();
+
+    /**
+     * If there is a native window associated with the display (e.g., the
+     * display is using a native window as a rendering surface), returns
+     * a pointer to the window.
+     *
+     * @return  Pointer to native window, or <code>NULL</code>.
+     */
+    RDrawableWindow* NativeWindow();
+
+    /**
+     * Returns the rendering surface of the display.
+     */
+    IMPORT_C MHuiRenderSurface& RenderSurface() const;
+
+    /**
+     * Determines whether the display contains any dirty regions. Dirty
+     * regions are areas of the display that have changed but the changes
+     * are not yet visible on the screen.
+     *
+     * @return  <code>ETrue</code>, if one or more dirty regions have been
+     *          defined. Otherwise <code>EFalse</code>.
+     */
+    TBool IsDirty() const;
+
+    /**
+     * Defines a new dirty region that needs to be updated when the next
+     * refresh cycle is triggered. Called by visuals when they are modified.
+     * The dirty regions are stored within the CHuiDisplay class, and are used
+     * to decide which visuals need to be redrawn during the next refresh.
+     *
+     * @param aDirtyRegion  The area of the display that needs to be redrawn
+     *                      in screen coordinates.
+     */
+    void AddDirtyRegion(const TRect& aDirtyRegion);
+
+    /**
+     * Defines a new dirty region that needs to be updated when the next
+     * refresh cycle is triggered. Combines given previous and current dirty regions.
+     * Current dirty region is returned to the caller, before clipping and combining. 
+     * Called by visuals when they are modified. The dirty regions are stored within
+     * the CHuiDisplay class, and are used to decide which visuals need to be redrawn
+     * during the next refresh.
+     *
+     * @param aPrevDirtyRegion  The previous dirty area.
+     * @param aDirtyRegion  	The area of the display that needs to be redrawn
+     *                      	in screen coordinates.
+     */
+	void CombineAndAddDirtyRegion(const TRect& aPrevDirtyRegion, TRect& aDirtyRegion);
+
+    /**
+     * Refresh the display. This is only meaningful if there are dirty
+     * regions in the display. All dirty regions are cleared after the
+     * refresh is complete.
+     *
+     * @return  <code>ETrue</code>, if something was done that may lead to
+     *          visible changes on the display. <code>EFalse</code>, if there
+     *          was nothing to refresh.
+     */
+    TBool Refresh();
+
+    /**
+     * Returns the implementation of the roster.
+     */
+    CHuiRosterImpl& RosterImpl() const;
+    
+    /**
+     * Clear all change flags of visuals in the display's roster.
+     */
+    void ClearChanged();
+    
+    /**
+     * Return the display intended usage.
+     */
+	IMPORT_C TUint Usage() const;
+
+    /**
+     * Return the value of the S60 Platform specific unit.
+     */
+    TReal32 UnitValue() const;
+
+    /**
+     * Returns the window transformation for the entire display.
+     */
+     CHuiTransformation& WindowTransformation() const;
+
+    /**
+     * Returns ETrue if this display is for TV-out
+     */
+     IMPORT_C TBool IsDisplayTypeTvOut() const;
+
+    /**
+     * Returns ETrue if this display is able to utilize transformations when calculating dirty areas.
+     */
+     TBool UseTransformedDirtyRegions() const;
+     
+    /**
+     * Returns EFalse if this display is already set dirty enough so that adding new dirty regions does
+     * not make anymore diffenrence.
+     */
+     TBool IsDirtyScanNeeded() const;
+
+    /**
+     * Rnd: returns the draw Visual outline flag value
+     *
+     * @return Visual outline setting.
+     */     
+    TUint DrawVisualOutline() const;
+
+    /**
+     * Sets texture which is drawn on top of the the frame.
+     * Ownership is transferred to CHuiDisplay.
+     */     
+    IMPORT_C void SetForegroundTexture(CHuiTexture* aTexture);
+
+    /**
+     * Gets texture which is drawn on top of the the frame.
+     */     
+    IMPORT_C CHuiTexture* ForegroundTexture() const;
+    
+    /**
+     * Sets bitmap which is drawn on top of the frame
+     * (when used with @c SetForegroundTexture).
+     * 
+     * This bitmap is modified before visuals are rendered;
+     * dirty areas are cleared. Thus, the bitmap should 
+     * have alpha channel.
+     * @param aBitmap foreground bitmap.
+     */
+    IMPORT_C void SetForegroundBitmapL(CFbsBitmap* aBitmap);
+    
+    /**
+     * Retuns foreground bitmap set in @c SetForegroundBitmapL.
+     */
+    IMPORT_C CFbsBitmap* ForegroundBitmap() const;
+    
+private:
+
+    /**
+     * Draws foreground texture.
+     */     
+    void DrawForegroundTexture();
+
+    /**
+     * Returns ETrue if this displays renderer is BitGdi
+     */
+     TBool IsRendererBitgdi() const;
+
+     /**
+      * Returns ETrue if this displays renderer is OpenGLES or OpenVG (even if those
+      * are implemented using SW). Returns EFalse if the render is bitgdi.
+      */
+     TBool IsRendererHWAccelerated() const;
+     
+    /**
+     * Clips given dirty rect to the visible area.
+     */
+    void ClipDirtyRect(TRect& aRect);
+
+    void ClipDirtyRect(TRect& aRect, TRect aClippingRect);
+
+    /**
+     * Transforms given dirty rect.
+     */
+    void TransformDirtyRect(TRect& aRect); 
+
+    void ClearWithColor(TRect aRect);
+    void ClearWithSkinBackground(TRect aRect);
+    void ClearWithBackgroundItems(TRect aRect);
+    
+    void BitgdiClearWithColor(TRect aRect);
+    void BitgdiClearWithSkinBackground(TRect aRect);
+    void BitgdiClearWithBackgroundItems(TRect aRect);
+    
+    void HWAcceleratedClearWithColor(TRect aRect);
+    void HWAcceleratedClearWithSkinBackground(TRect aRect);
+    void HWAcceleratedClearWithBackgroundItems(TRect aRect);
+    
+    TRect VisibleAreaClippingRect() const;
+    TBool IsVisibleAreaClippingEnabled() const;
+
+public: // from MCoeMessageMonitorObserver
+	    
+    void MonitorWsMessage(const TWsEvent& aEvent);
+	
+protected:
+
+    /* Types. */
+
+    /** Array of dirty region rectangles. */
+    typedef RArray<TRect> RDirtyRegions;
+
+
+    /* Methods. */
+
+    /**
+     * Add to a specific array.
+     */
+    static void AddDirtyRegion(const TRect& aDirtyRegion, RDirtyRegions& aRegions, TBool aGrow = ETrue);
+
+
+private:
+
+    /** The environment that manages this display. */
+    CHuiEnv& iEnv;
+
+    /** The display type. */
+	TInt iDisplayType;
+	
+    /** Pointer to the native window of this display (if any). */
+    CCoeControl* iNativeControl;
+
+    /** Size of the display. */
+    TSize iSize;
+
+    /** Rendering surface of the display. */
+    MHuiRenderSurface* iRenderSurface;
+
+    /** Graphics context for drawing. */
+    CHuiGc* iGc;
+
+    /** Transformation for the entire display. */
+    CHuiTransformation* iTransform;
+
+    /** Control roster of the display. */
+    RHuiOwnedPointer<CHuiRoster> iRoster;
+
+    /** Flag that tells whether the display should currently be refreshed. */
+    TBool iActive;
+
+    /** Determines if depth testing can be used during rendering. */
+    TBool iUseDepth;
+
+    /** Determines if the background should be cleared before drawing. */
+    TInt iClearBackground;
+
+    /** Background color for the display, if clearing enabled. */
+    TRgb iBackgroundColor;
+
+    /** If true, updates the renderer state before the next frame is drawn.
+        Normally it is assumed that it is necessary to set the state only
+        once. */
+    TBool iUpdateRenderState;
+
+
+    /** @todo  The dirty tracker should support both frame copying and swapping. */
+    /** Is ETrue if the screen was dirtied at all in the last update.*/
+    TBool iGotDirtyReports;
+
+    /**
+     * Array of all the dirty regions of the display.
+     * This is flipped with iDirtyRegions2 every other frame.
+     */
+    RDirtyRegions iDirtyRegions;
+
+    /**
+     * Secondary array of all the dirty regions of the display.
+     * This is flipped with iDirtyRegions every other frame.
+     */
+    RDirtyRegions iDirtyRegions2;
+
+    /** Points to either iDirtyRegions or iDirtyRegions2. */
+    RDirtyRegions* iCurrentDirtyRegions;
+
+    /** Points to either iDirtyRegions or iDirtyRegions2. */
+    RDirtyRegions* iPreviousDirtyRegions;
+
+    /** Info how display is used */
+    TInt iUsageHint;
+
+    /** Determines whether this display is on the foreground in the system or not. */
+    TBool iOnForeground;
+
+public:
+
+    /* Public properties. */
+
+    /** Observers notified before a refresh begins. */
+    RHuiObserverArray<MHuiDisplayRefreshObserver> iRefreshObservers;
+
+    /** Observers notified before display deleted. */
+    RHuiObserverArray<MHuiDisplayDeletionObserver> iDeletionObservers;
+
+    /** Observers notified after display visible area changed. */
+    RHuiObserverArray<MHuiDisplayVisibleAreaObserver> iVisibleAreaObservers;
+
+    /** Observers notified before a roster draw begins and ends. */
+    RHuiObserverArray<MHuiRosterObserver> iRosterObservers;
+    
+private:
+
+	/** Screen buffer uid */
+	TUid iScreenBufferUid;
+	
+	/** Screen buffer lock */
+	TBool iIsScreenBufferLocked;
+	
+	/** Screen buffer observer */
+	MHuiScreenBufferObserver* iScreenBufferObserver;
+	
+    /** Transformation for the entire display. */
+    CHuiTransformation* iWindowTransform;
+
+    /** Is ETrue if the screen was reported as fully dirtied in the last update */
+    TBool iWholeDisplayAreaIsDirty;    
+    
+    /** Is ETrue if dirty regions are transformed */
+    TBool iUseTransformedDirtyRegions; 
+
+    // RnD
+    TBool iDrawDirtyRegions;
+    TUint iDrawVisualOutline;
+    
+    RArray<THuiDisplayBackgroundItem> iBackgroundItems;
+    
+    TRect iVisibleAreaClippingRect;
+    RWindow* iNativeWindow; // Not owned
+    
+    /** Texture which is draw on top of the roster */
+    CHuiTexture* iForegroundTexture;
+
+    /** Foreground bitmap */
+    CFbsBitmap* iForegroundBitmap;
+    /** Device for foreground bitmap */
+    CFbsBitmapDevice* iForegroundBitmapDevice;
+    /** Graphics context for foreground bitmap */
+    CFbsBitGc* iForegroundBitmapGc;
+    };
+
+#endif  // __HUIDISPLAY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiDisplayCoeControl.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,186 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of the CHuiDisplayCoeControl class. 
+*                CHuiDisplayCoeControl is a CCoeControl that has its own 
+*                CHuiDisplay instance attached to the control's RWindow.
+*
+*/
+
+
+
+#ifndef __HUIDISPLAYCOECONTROL_H__
+#define __HUIDISPLAYCOECONTROL_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiPlatform.h>
+
+
+/* Forward declarations. */
+class CHuiEnv;
+class CHuiDisplay;
+
+
+/**
+ * CHuiCoeControlDisplay is CCoeControl-derived, window-owning control that 
+ * is attached to a CHuiDisplay instance. The entire area of the control is 
+ * used for rendering. 
+ */
+class CHuiDisplayCoeControl : public CCoeControl, 
+                              public MCoeControlObserver
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Construct a new CoeControl that has a rendering surface.
+     *
+     * @param aEnv  Environment.
+     */
+    IMPORT_C static CHuiDisplayCoeControl* NewL(CHuiEnv& aEnv, const TRect& aRect, TInt aFlags = 0);
+    
+    /**
+     * Construct a new CoeControl that has a rendering surface, and leaves it 
+     * on the cleanup stack.
+     *
+     * @param aEnv  Environment.
+     */
+    IMPORT_C static CHuiDisplayCoeControl* NewLC(CHuiEnv& aEnv, const TRect& aRect, TInt aFlags = 0);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C ~CHuiDisplayCoeControl();
+
+
+    /* Methods. */
+
+    /**
+     * Returns the environment of this CHuiDisplayCoeControl.
+     */
+    IMPORT_C CHuiEnv& Env();
+
+    /**
+     * Returns the display of this CHuiDisplayCoeControl.
+     */
+    IMPORT_C CHuiDisplay& Display();
+    
+
+private: /* from CoeControl */
+
+    /**
+     * Called when the size of the control changes.
+     */
+    IMPORT_C void SizeChanged();
+
+    /**
+     * Returns the number of CoeControls inside this control.
+     *
+     * @return  Zero.
+     */
+    IMPORT_C TInt CountComponentControls() const;
+
+    /**
+     * Returns a pointer to a CoeControl inside this control.
+     *
+     * @return  <code>NULL</code>.
+     */
+    IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
+
+    /**
+     * From CCoeControl. Invalidate drawing area. No synchronous drawing takes place here
+     */
+    IMPORT_C void Draw(const TRect& aRect) const;
+
+    /**
+     * Handles resource change.
+     *
+     * @see  S60 documentation.
+     */ 
+    IMPORT_C void HandleResourceChange(TInt aType);
+
+    /**
+     * Acts upon changes in the hosted control's state.
+     *
+     * @param   aControl    The control changing its state
+     * @param   aEventType  The type of control event
+     */
+    IMPORT_C void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType);
+
+    /**
+     * Called when a key input event is received by the display. The input
+     * event is passed on to one of the controls in the display.
+     *
+     * @param aKeyEvent  Key event.
+     * @param aType      Type of the event.
+     */
+    IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
+
+    /** ! future proofing, just basecall */
+	IMPORT_C void MakeVisible(TBool aVisible);
+	IMPORT_C void SetDimmed(TBool aDimmed);
+	IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
+	IMPORT_C void ActivateL();
+	IMPORT_C void PrepareForFocusLossL();
+	IMPORT_C void PrepareForFocusGainL();
+	IMPORT_C TCoeInputCapabilities InputCapabilities() const;
+	IMPORT_C void FocusChanged(TDrawNow aDrawNow);
+	IMPORT_C void PositionChanged();
+	IMPORT_C void SetContainerWindowL(const CCoeControl& aContainer);
+
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor.
+     *
+     * @param aEnv  The environment that manages this display.
+     */
+    IMPORT_C CHuiDisplayCoeControl(CHuiEnv& aEnv);
+
+    /**
+     * Second-phase constructor. Creates a window and an OpenGL context.
+     *
+     * @param aRect  Frame rectangle for container.
+     * @param aFlags  New display flags from CHuiEnv.     
+     */
+    IMPORT_C virtual void ConstructL(const TRect& aRect, TInt aFlags);
+
+
+    /* Utility methods. */
+
+    /**
+     * Handle pointer events.
+     */
+    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
+
+    IMPORT_C virtual void DisplayCoeCntrlExtension(const TUid& aEstensionUid, TAny** aExtensionParams);
+
+private:
+
+    /** The environment that manages this display. */
+    CHuiEnv& iEnv;
+
+    /** Display attached to this CoeControl. Not owned. */
+    CHuiDisplay* iDisplay;
+    
+    /** Previous working rectangle of this container control. */
+    TRect iPrevRect;
+
+    TAny* iSpare;
+    };
+
+#endif  // __HUIDISPLAY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiDrawing.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Convenience header for including all of the HUITK core 
+*                drawing classes. This is indended for implementations of 
+*                visual classes.
+*
+*/
+
+
+
+#include <uiacceltk/HuiEnv.h>
+#include <uiacceltk/HuiSkin.h>
+#include <uiacceltk/HuiGc.h>
+#include <uiacceltk/HuiTexture.h>
+#include <uiacceltk/HuiFont.h>
+#include <uiacceltk/HuiImage.h>
+#include <uiacceltk/HuiBrushes.h>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiDropShadowBrush.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIDROPSHADOWBRUSH_H__
+#define __HUIDROPSHADOWBRUSH_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiBrush.h>
+#include <uiacceltk/HuiSkin.h>
+#include <uiacceltk/HuiGc.h>
+#include <uiacceltk/HuiTimedValue.h>
+#include <uiacceltk/huimetric.h>
+
+
+/**
+ * Drop shadow is drawn behind the visual, outside of its edges.
+ *
+ */
+NONSHARABLE_CLASS(CHuiDropShadowBrush) : public CHuiBrush
+    {
+public:
+   
+    /* Constructors and destructor. */
+
+    /**
+     * Constructor.
+     * @param aDepth Shadow depth in metric units.
+     */
+    IMPORT_C static CHuiDropShadowBrush* NewL(const THuiMetric& aDepth);
+    
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     * @param aDepth Shadow depth in metric units.
+     */
+    IMPORT_C static CHuiDropShadowBrush* NewLC(const THuiMetric& aDepth);
+
+    /**
+     * Constructor.
+     * @deprecated
+     * @param aDepth Shadow depth in pixels.
+     */
+    IMPORT_C static CHuiDropShadowBrush* NewL(TInt aDepth);
+    
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     * @deprecated
+     * @param aDepth Shadow depth in pixels.
+     */
+    IMPORT_C static CHuiDropShadowBrush* NewLC(TInt aDepth);
+
+    /**
+     * Sets shadow depth.
+     * @param aDepth Shadow depth in metric units.
+     */
+    IMPORT_C void SetDepth(const THuiMetric& aDepth);
+
+    /**
+     * Sets minimum width of soft edges.
+     * @param aDepth Shadow depth in metric units.
+     */
+    IMPORT_C void SetSoftness(const THuiMetric& aSoftness);
+
+    /**
+     * Sets shadow color.
+     * @param aColor Shadow color.
+     */
+    IMPORT_C void SetColor(const TRgb& aColor);
+
+    /**
+     * Destructor.
+     */
+    ~CHuiDropShadowBrush();
+
+
+    /* Methods. */
+    
+    /**
+     * From CHuiBrush.
+     * @see CHuiBrush::Changed()
+     */
+    TBool Changed() const;
+    
+    /**
+     * From CHuiBrush.
+     * @see CHuiBrush::ClearChanged()
+     */
+    void ClearChanged();
+        
+    /**
+     * Draw the brush.
+     */
+    void Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const;
+    
+    void ExpandVisualRect(TRect& aRect) const;
+                      
+
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor.
+     */
+    CHuiDropShadowBrush(TInt aDepth);
+
+    /**
+     * Constructor.
+     */
+    CHuiDropShadowBrush(const THuiMetric& aDepth);
+
+
+private:
+
+    /* Private methods */
+    TReal32 DepthInPixels(const CHuiVisual* aVisual) const;
+    TReal32 SoftnessInPixels(const CHuiVisual* aVisual) const;
+    TReal32 ValueInPixels(const CHuiVisual* aVisual, const THuiTimedValue& aValue) const;
+
+public:
+
+    /* Public properties. */
+
+    /** Minimum width of soft edges. */
+    THuiTimedValue iSoftness;
+
+    /** Depth of the shadow. */
+    THuiTimedValue iDepth;
+
+private:
+
+    /** Metric for depth of the shadow. */
+    THuiMetric iDepthMetric;
+
+    /** Metric for the shadow softness */
+    THuiMetric iSoftnessMetric;
+    
+    /** Color for depth of the shadow. */
+    TRgb iColor;
+    };
+
+#endif  // __HUIDROPSHADOWBRUSH_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiEnv.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,993 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines CHuiEnv, a common working environment for the Toolkit.
+*
+*/
+
+
+
+#ifndef __HUIENV_H__
+#define __HUIENV_H__
+
+#include <e32base.h>
+#include <w32std.h>
+#include <barsread.h>
+#include <coemain.h>
+
+#include <uiacceltk/HuiTextureManager.h>
+#include <uiacceltk/huifontmanager.h>
+#include <uiacceltk/HuiCommand.h>
+#include <uiacceltk/HuiObserverArray.h>
+#include <uiacceltk/HuiRenderer.h>
+#include <uiacceltk/huilowmemoryobserver.h>
+
+/* Forward declarations */
+class CCoeControl;
+class CHuiStatic;
+class CHuiDisplay;
+class CHuiRosterImpl;
+class CHuiSkin;
+class CHuiScheduler;
+class CHuiControl;
+class CHuiControlGroup;
+class CHuiVisualFactory;
+class CHuiVisual;
+class MHuiActionObserver;
+class THuiEvent;
+class CDirectScreenAccess;
+class MHuiEventHandler;
+class CHuiTextStyleManager;
+class CHuiThemeManager;
+class CHuiCanvasTextureCache;
+class CHuiFxEngine;
+
+class CHighResTimer;
+const TInt KHuiEnvReleasedActionId = 0x200100F8;
+const TInt KHuiEnvRestoredActionId = 0x200100F9;
+
+
+/**
+ * THuiRefreshMode modes can be used to define when the screen redraws
+ * should be performed.
+ * @see CHuiEnv::SetRefreshMode()
+ */
+enum THuiRefreshMode
+    {
+    /** Refresh occurs only when requested by calling CHuiEnv::RefreshCallBack(). */
+    EHuiRefreshModeManual,
+
+    /** Refresh is done automatically when necessary. */
+    EHuiRefreshModeAutomatic, // = default
+
+    /** Refresh is done all the time, even if nothing has changed. Dirty regions
+        are not used for determining what has changed. Instead, displays are
+        always fully redrawn. */
+    EHuiRefreshModeForced
+    };
+
+
+/**
+ * HUI environment observer. Instance of this class can be created
+ * by user application and passed in constructor to CHuiEnv. The
+ * observer class will be called for certain events.
+ */
+class MHuiEnvObserver
+	{
+public:
+
+    /**
+     * Called to create a new CHuiSkin derived object for the use
+     * of the calling CHuiEnv object. This method can return
+     * either an application specific Skin - object or NULL for
+     * allowing CHuiEnv to create it's default Skin object. The calling
+     * CHuiEnv will take responsibility of the created CHuiSkin object.
+     *
+     * @param aEnv The CHuiEnv object to which to create the
+     *             new skin object.
+     *
+     * @return New instance of a CHuiSkin - derived object.
+     */
+    virtual CHuiSkin* CreateSkinL(CHuiEnv& aEnv) = 0;
+
+    };
+
+
+/**
+ * Interface for observing action commands. When the scheduler executes an
+ * action command, the registered listeners that implement this interface
+ * will receive a notification of the action.
+ */
+class MHuiActionObserver
+    {
+public:
+
+    /**
+     * Called by the scheduler when an action command is executed.
+     *
+     * @param aActionCommand  The command that is being executed.
+     */
+    virtual void HandleActionL(const THuiActionCommand& aActionCommand) = 0;
+
+    };
+
+
+/**
+ * CHuiEnv is a common working environment for the Toolkit. CHuiEnv manages
+ * the common data for a HUITK application, such as displays, the texture
+ * manager, visual factory and currently used skin.
+ *
+ * An application that uses HUITK will need to create one CHuiEnv. Also
+ * destroying the CHuiEnv instance will clean up all resources associted
+ * with the UI.
+ *
+ * @see NewL()
+ * @see NewLC()
+ */
+NONSHARABLE_CLASS(CHuiEnv) : public CBase,
+                             public MHuiTextureManagerStateChangedObserver,
+                             public MHuiTextureLoadingCompletedObserver
+    {
+public:
+
+    /* Types. */
+
+    /** Flags for creating new displays. */
+    enum TNewDisplayFlags
+        {
+        ENewDisplayFullScreen = 0x1,
+        ENewDisplayOverlaid = 0x2
+        };
+
+
+    /** @beginAPI */
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructs a new HUI environment. An application that uses HUI will
+     * need to create one CHuiEnv. This will not start the timing used
+     * inside Hitchcock UI Toolkit. The animation timing will be started
+     * from the point in time when the first frame is drawn. So UI build up
+     * and precalculation can be done without affecting the animation time.
+     *
+     * @param aRenderer  Rendering interface to use in the environment.
+     * @param aObserver  Pointer to observer class instance that will be called
+     *                   to perform application specific configurations. Can be
+     *                   NULL to create a default CHuiEnv.
+     *
+     * @return  HUI environment.
+     */
+    IMPORT_C static CHuiEnv* NewL(THuiRenderer aRenderer = EHuiRendererDefault,
+                                  MHuiEnvObserver* aObserver = NULL);
+
+    /**
+     * Constructs a new HUI environment and leaves it on the cleanup stack.
+     * This will not start the timing used inside Hitchcock UI Toolkit. 
+     * The animation timing will be started from the point in time when 
+     * the first frame is drawn. So UI build up and precalculation can be 
+     * done without affecting the animation time. 
+     *
+     * @param aRenderer  Rendering interface to use in the environment.
+     * @param aObserver  Pointer to observer class instance that will be called
+     *                   to perform application specific configurations. Can be
+     *                   NULL to create a default CHuiEnv.
+     *
+     * @return  HUI environment.
+     */
+    IMPORT_C static CHuiEnv* NewLC(THuiRenderer aRenderer = EHuiRendererDefault,
+                                   MHuiEnvObserver* aObserver = NULL);
+
+    /** @endAPI */
+
+
+    /**
+     * Destructor.
+     */
+    virtual ~CHuiEnv();
+
+
+    /* Methods. */
+
+    /** @beginAPI */
+
+    /**
+     * Determines which renderer is currently in use. Always returns the real
+     * explicit identifier of the renderer, and not an ambiguous identifier
+     * like "Default".
+     *
+     * @return  THuiRenderer enum.
+     */
+    IMPORT_C THuiRenderer Renderer() const;
+
+    /**
+     * Creates a new HuiDisplay.
+     *
+     * @param aRect  Size of the display.
+     * @param aNativeControl  Native control to which to associate the display.
+     * @param aFlags  Flags for the display (TNewDisplayFlags).
+     * @param aRosterOwningDisplay  The display that will share its roster.
+     * @param aDisplayType  Display type.
+     *
+     * @return  Display.
+     */
+    IMPORT_C CHuiDisplay& NewDisplayL(const TRect& aRect,
+                                      CCoeControl* aNativeControl = 0,
+                                      TInt aFlags = 0,
+                                      CHuiDisplay* aRosterOwningDisplay  = NULL,
+                                      TInt aDisplayType = 0 );
+
+    /**
+     * Creates a new HuiDisplay.
+     *
+     * @param aRect  Size of the display.
+     * @param aNativeControl  Native control to which to associate the display.
+     * @param aFlags  Flags for the display (TNewDisplayFlags).
+     * @param aRosterOwningDisplay  The display that will share its roster.
+     * @param aDisplayType  Display type.
+     * @param aBackBufferUid  Screen back buffer uid.
+     *
+     * @return  Display.
+     */
+    IMPORT_C CHuiDisplay& NewDisplayL(const TRect& aRect,
+                                      CCoeControl* aNativeControl,
+                                      TInt aFlags,
+                                      CHuiDisplay* aRosterOwningDisplay,
+                                      TInt aDisplayType,
+                                      TUid aBackBufferUid );
+
+
+    /**
+     * Creates a new HuiDisplay.
+     *
+     * @param aNativeWindow  Native window to which to associate the display.
+     * @param aFlags  Flags for the display (TNewDisplayFlags).
+     * @param aRosterOwningDisplay  The display that will share its roster.
+     * @param aDisplayType  Display type.
+     * @param aBackBufferUid  Screen back buffer uid.
+     *
+     * @return  Display.
+     */
+    IMPORT_C CHuiDisplay& NewDisplayL(RWindow* aNativeWindow,
+                                      TInt aFlags,
+                                      CHuiDisplay* aRosterOwningDisplay,
+                                      TInt aDisplayType,
+                                      TUid aBackBufferUid );
+
+    /**
+     * Determines the number of displays currently created with NewDisplayL().
+     *
+     * @return  Display count.
+     */
+    IMPORT_C TInt DisplayCount() const;
+
+    /**
+     * Sets the refresh mode.
+     *
+     * @param aMode  New refresh mode.
+     *
+     * @see THuiRefreshMode
+     */
+    IMPORT_C void SetRefreshMode(THuiRefreshMode aMode);
+
+    /**
+     * Determines the environment's display refresh mode.
+     *
+     * @return  Refresh mode.
+     */
+    IMPORT_C THuiRefreshMode RefreshMode() const;
+
+    /**
+     * Sets the maximum allowed frame rate. Specify 0.0 to use the default limit.
+     *
+     * @param aFrameRate  New maximum frame rate in frames per second.
+     */
+    IMPORT_C void SetMaxFrameRate(TReal32 aFrameRate) __SOFTFP;
+
+    /**
+     * Continues normal display refreshing. If display refreshing is already
+     * being done, calling this has no effect. This is called automatically
+     * from inside the toolkit when something is done that may lead to a
+     * visible change on a display. The application may also call this if it
+     * has previously paused refresh with PauseRefresh().
+     * This does not affect any timing. 
+     *
+     * @see CHuiStatic
+     */
+    IMPORT_C void ContinueRefresh();
+
+    /**
+     * Continues normal display refreshing. If display refreshing is already
+     * being done, calling this has no effect. This is called automatically
+     * from inside the toolkit when something is done that may lead to a
+     * visible change on a display. The application may also call this if it
+     * has previously paused refresh with PauseRefresh().
+     * @param aFastFirstRefresh If ETrue and refresh timer is not active,
+     * first refresh will be done as soon as possible. Otherwise first refresh
+     * will occur after refresh timer has expred.  
+     *
+     * @see CHuiStatic
+     */
+    void ContinueRefresh(TBool aFastFirstRefresh);
+
+    /**
+     * Pauses display refreshing temporarily. This is called when it is clear
+     * that any displays will not be updated soon. The application may call
+     * this at times when it needs more processing time for other tasks.
+     */
+    IMPORT_C void PauseRefresh();
+    
+    /**
+     * Constructs a new empty control group.
+     *
+     * @param aId (Resource) Identifier of the new group.
+     *
+     * @return  Reference to the new group.
+     */
+    IMPORT_C CHuiControlGroup& NewControlGroupL(TInt aId);
+
+    /**
+     * Deletes a previously loaded control group. The controls inside the
+     * groups will also be destroyed. Note that this will also destroy the
+     * visuals of the controls, because they are owned by the controls.
+     *
+     * @param aId  Identifier of the group to be deleted.
+     *
+     * @return  <code>KErrNone</code>, if the deletion is successful.
+     *          <code>KErrNotFound</code>, if there are no control groups
+     *          with the specified identifier.
+     */
+    IMPORT_C TInt DeleteControlGroup(TInt aId);
+
+    /**
+     * Load controls and a group from a resource definition and create a
+     * HuiControlGroup out of them.
+     *
+     * @param aResourceId  Resource identifier of the group.
+     *
+     * @return  Control group with controls inside.
+     */
+    IMPORT_C CHuiControlGroup& LoadControlGroupL(TInt aResourceId);
+
+    /**
+     * Returns an existing control group based on its identifier.
+     * @note Will panic with THuiPanic::EInternal if the specified
+     * control group is not found.
+     */
+    IMPORT_C CHuiControlGroup& ControlGroup(TInt aResourceId);
+
+    /**
+     * "Loads" bitmaps specified in a resource. Works with all
+     * supported image formats, including BMP, PNG and JPG. The resource
+     * defines a numerical identifier for each bitmap. The bitmaps
+     * are added to the texture manager in this environment and can be
+     * accessed using the numerical identifiers.
+     * @see TextureManager()
+     *
+     * @note Does not really _load_ the bitmaps to textures. Instead, the
+     * bitmap filenames are bound to the id:s specified by the resource. The
+     * texture ids may be later used to load the texture resource (by calling
+     * CHuiTextureManager::LoadTextureL() with the id).
+     *
+     * @see CHuiTextureManager::LoadTextureL()
+     * @see CHuiTextureManager::TextureL()
+     * @see CHuiTextureManager::Texture()
+     *
+     * @todo The bitmap resource file format is not documented.
+     *
+     * @param aResourceId Resource containing a list of bitmap file names.
+     */
+    IMPORT_C void LoadBitmapsL(TInt aResourceId);
+
+    /**
+     * Returns the visual factory.
+     */
+    IMPORT_C CHuiVisualFactory& VisualFactory() const;
+
+    /**
+     * Returns the texture manager.
+     */
+    IMPORT_C CHuiTextureManager& TextureManager() const;
+
+    /**
+     * Returns the font manager object.
+     */
+    IMPORT_C THuiFontManager& FontManager() const;
+    
+    /**
+     * Returns the text style manager.
+     */
+    IMPORT_C CHuiTextStyleManager& TextStyleManager() const;
+
+    /**
+     * Finds a control from the control groups of this
+     * environment.
+     * @param aId The id of the control to find.
+     * @see CHuiControl::SetId()
+     * @see CHuiControl::Id()
+     * @return The control instance, or NULL if no such control exists.
+     */
+    IMPORT_C CHuiControl* FindControl(TInt aId) const;
+
+    /**
+     * Schedule a command.
+     *
+     * @param aCommand  Command to send.
+     * @param aDelayMilliSeconds  Time in ms to wait before executing the command. If
+     * set to zero, the command is executed immediately. Note that the point of
+     * execution may not be exactly this amount of milliseconds.
+     *
+     * @return  System-wide error code. If successful, returns <code>KErrNone</code>.
+     */
+    IMPORT_C TInt Send(const THuiCommand& aCommand, TInt aDelayMilliSeconds = 0);
+
+    /**
+     * Schedule a command. Leaves if there is a failure when posting the command
+     * to the scheduler.
+     *
+     * @param aCommand  Command to send.
+     * @param aDelayMilliSeconds  Time to wait before executing the command.
+     */
+    IMPORT_C void SendL(const THuiCommand& aCommand, TInt aDelayMilliSeconds = 0);
+
+    /**
+     * Cancel commands related to an object. This object may be a timed value,
+     * a visual, MHuiEventHandler, or anything you can do commands on.
+     *
+     * @param aObject Any commands owned by this object will be cancelled.
+     *                Note that you must cast derived classes that are passed,
+     *                otherwise the pointer will point to the base class.
+     */
+    IMPORT_C void CancelCommands(TAny* aObject);
+
+    /**
+     * Overloaded version of CancelCommands, especially for classes derived from
+     * MHuiEventHandler, so that correct pointer will be used.
+     * @see CHuiEnv::CancelCommands
+     */
+    IMPORT_C void CancelCommands(MHuiEventHandler* aObject);
+
+    /**
+     * Overloaded version of CancelCommands, especially for classes derived from
+     * MHuiEventHandler, so that correct pointer will be used.
+     * @see CHuiEnv::CancelCommands
+     */
+    IMPORT_C void CancelCommands(TAny* aObject,
+                                 THuiOp aCommandOperation);
+
+    /**
+     * Overloaded version of CancelCommands, especially for classes derived from
+     * MHuiEventHandler, so that correct pointer will be used.
+     * @see CHuiEnv::CancelCommands
+     */
+    IMPORT_C void CancelCommands(TAny* aObject,
+                                 THuiCommandType aCommandType,
+                                 TInt aParam);
+
+    /**
+     * Time until the given command will be executed on the given object.
+     * 
+     * @param aObject The object that is waiting for a command to be executed.
+     *                Note that you must cast derived classes that are passed,
+     *                otherwise the pointer will point to the base class.     
+     * @param aCommandType  Type of command.     
+     * @return  Time interval in milliseconds. -1, if no commands found.
+     */
+    IMPORT_C TInt TimeUntilCommand(TAny* aObject,
+                                   THuiCommandType aCommandType);
+
+    /**
+     * Returns the skin that is used by the environment. Only one skin can be
+     * used at a time.
+     */
+    IMPORT_C CHuiSkin& Skin() const;
+
+    /**
+     * Starts the refresh timer with given tick interval. Can be used to
+     * control how often the toolkit updates itself.
+     *
+     * @param aMilliSeconds  Milliseconds between ticks.
+     */
+    IMPORT_C void StartRefresh(TInt aMilliSeconds);
+
+    /**
+     * Starts the refresh timer with given tick interval. Can be used to
+     * control how often the toolkit updates itself.
+     *
+     * @param aMilliSeconds  Milliseconds between ticks.
+     * @param aDelayInMilliSeconds Milliseconds until first refrsh.
+     */
+     void StartRefresh(TInt aIntervalInMilliSeconds, TInt aDelayInMilliSeconds);
+
+    /**
+     * Handles a key event received from CONE.
+     *
+     * @param aKeyEvent  Received key event to handle.
+     * @param aType      Type of event.
+     * @param aAssocDisplay  Associated CHuiDisplay, if there is one.
+     *                   If specified, the event is handled by this display's
+     *                   roster only. If <code>NULL</code>, event is offered
+     *                   to all displays.
+     */
+    IMPORT_C TBool HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType,
+                                   CHuiDisplay* aAssocDisplay = 0);
+
+    /**
+     * Sets the interval before an idle notification is sent. Idling
+     * begins when no input has been received after this delay. 
+     * 
+     * If you want to reset the idle time counter you have to actually 
+     * generate a key event (for example by using TApaTask::SendKey(),
+     * or calling HandleKeyEventL() directly).
+     *
+     * @todo Add a convenience method to reset the idle time counter.
+     *
+     * @note Scheduled events keep display refresh running even
+     * when there's no input.
+     *
+     * @param aSeconds  Threshold in milliseconds. However the 
+     * granularity is one second, so use thousands of ms as your 
+     * input value.
+     */
+    IMPORT_C void SetIdleThreshold(TInt aMilliSeconds);
+
+    /**
+     * Broadcasts an event to all controls in the environment.
+     *
+     * @param aEvent  Event to broadcast.
+     */
+    IMPORT_C void BroadcastEventL(const THuiEvent& aEvent);
+
+    /**
+     * Returns the primary display, that is the display
+     * that was created first.
+     */
+    IMPORT_C CHuiDisplay& PrimaryDisplay() const;
+    
+    /**
+     * Returns the requested display.
+     *
+     * @param aIndex  Index of the display array.     
+     */
+    IMPORT_C CHuiDisplay& CHuiEnv::Display(TInt aIndex) const;
+
+    /**
+     * Notifies everyone of a change in the environment's skin. Called by the
+     * skin instance when a change occurs in it, or when the environment
+     * switches the skin instance. Exported so that application-implemented
+     * custom skins can call this, too.
+     */
+    IMPORT_C void NotifySkinChangedL();    
+
+
+    /* Static methods. */
+
+    /**
+     * Refresh callback, that is called by a refresh timer. Called periodically
+     * when there might be something to update on the display. Has the
+     * responsibility to update time for all HUI environments.
+     *
+     * @param aInstance  A CHuiEnv instance.
+     * @see StartRefresh() to modify how often updates are being made.
+     * @see StopRefresh() to stop updates.
+     */
+    IMPORT_C static TInt RefreshCallBack(TAny* aInstance);
+
+	/**
+     * Releases as many resources as possible. Among the released resources 
+     * may be all objects in the toolkit's ownership, for example texture 
+     * images and drawing surfaces. This should be called when the Hitchcock 
+     * user interface is not needed for a while, for example when the application 
+     * goes to the background. 
+     *
+     * At the moment the Environment releases all rendering surface and all displays,
+     * but not the rendering plugin. All textures are left unreleased.
+     * 
+     * The resources need to be restored with a call to RestoreL() before
+     * the Hitchcock user interface is used again.
+     *
+     * The AppUI can call this method to release resources. The AppUI can
+     * overload HandleWsEventL() and react to KAknFullOrPartialForegroundLost
+     * window server event by calling this method.
+     *
+     * @see RestoreL()
+     */
+    IMPORT_C void Release();
+    
+    /**
+     * Restores all resources that were released with a call to Release().
+     * After this the Hitchcock user interface should be in the same state
+     * in terms of resources as it was prior to the Release() call.
+     *     
+     * The AppUI can call this method to Restore resources. The AppUI can
+     * overload HandleWsEventL() and react to KAknFullOrPartialForegroundGained
+     * window server event by calling this method.
+     *
+     * @see Release()
+     */
+    IMPORT_C void RestoreL();    
+
+    /**
+     * Set environment scheduling to adapt on device load.
+     * Adaptive interval can only quarantee time for active objects inside 
+     * the same thread, though the interval calculation balances the
+     * effect of thread priority based schedulation and context switches as well 
+     *
+     * @param aPercent maximum time spent in RefreshCallBack() in percents. 
+     */
+    IMPORT_C void SetMaxCpuTime(TUint aPercent);
+
+
+    /** Gets a pointer to a CHuiEnv which can be used to access CHuiEnv's functions.
+     *  It allows application code to access CHuiEnv's functions even where there is
+     *  no direct access to a ChuiEnv object.
+     *
+     *  For example:
+     *
+     *  CHuiEnv::Static()->SetMaxCpuTime(TUint aPercent);
+     *
+     *  @return  CHuiEnv * The pointer for accessing CHuiEnv's functions. or
+     *           NULL if CHuiEnv has not been constructed yet. 
+     *
+     */
+     static IMPORT_C CHuiEnv *Static();
+
+
+
+     /**
+     * Returns the theme manager.
+     */
+    IMPORT_C CHuiThemeManager& ThemeManager() const;
+
+     /**
+      * Returns the effects engine or NULL if effects are not supported
+      * by the current rendering plugin.
+      */
+    IMPORT_C CHuiFxEngine* EffectsEngine() const;
+
+     /**
+     * RnD utility, shows FPS using User::InfoPrint using sample rate
+     * given in milliseconds
+     */
+    IMPORT_C void SetFPSCounterThreshold(TUint aMilliseconds);
+
+     /**
+     * Allows application to balance rendering loop active object priority
+     * compared to other active objects running within same scheduler
+     *
+     * Default value is CActive::EPriorityStandard
+     */
+    IMPORT_C void ChangeRefreshLoopPriority(CActive::TPriority aPriority);
+    
+    /**
+     * Enables or disables debug features, by setting Rnd flag bits of KUIAccelTKEffectsComplexityFactor, 
+     * of central repository key.
+     * 
+     * If 0x800 is set, Texturememory calculation is enabled. Calculates total memory used by texturemanager 
+     * for all the textures it holds. 
+     * Enabling this feature makes TextureManager to write info messages,
+     * with total memory used by total number of textures and average bit depth of textures. For debugging purpose.
+     * 
+     * @param aRndFlag holds the Rnd flag. 
+     */
+    IMPORT_C void EnableDebugFlag( TUint aRndFlag );
+
+    /** @endAPI */
+
+
+    /* Methods. */
+    
+    /**
+     * Sets the texture manager of this environment.
+     *
+     * @param aManager
+     */
+    void SetTextureManager(CHuiTextureManager& aManager);
+
+    /**
+     * Returns a reference to the scheduler of the environment.
+     */
+    CHuiScheduler& Scheduler();
+
+    /**
+     * Removes a display from the environment.
+     *
+     * @param aDisplay  The display to remove.
+     */
+    void RemoveDisplay(CHuiDisplay& aDisplay);
+
+    /**
+     * Update all displays by swapping an image drawn to a background display
+     * buffer to the foreground (visible) screen buffer. This is the last stage
+     * of display refresh.
+     */
+    void SwapBuffers(const RArray<TBool>& aDisplayRefreshed);
+
+    /**
+     * Called when input is received.
+     *
+     * @param aEvent  The received input event.
+     */
+    void NotifyInputReceivedL(const THuiEvent& aEvent);
+
+    /**
+     * Notify all displays of an idle event, ie. that
+     * we are entering or leaving an idle state.
+     *
+     * @param aIdleBegins  ETrue if we are entering an idle state.
+                           EFalse if we are leaving the idle state.
+     */
+    void SendIdleL(TBool aIdleBegins);
+
+    /**
+     * Notifies action observers of an action command.
+     *
+     * @param aCommand  Action command that is being executed.
+     *
+     * @return  System-wide error code from the first obserser that leaves.
+     *          If no leaves occur, returns <code>KErrNone</code>.
+     */
+    TInt ReportAction(const THuiActionCommand& aCommand);
+
+    /**
+     * Returns the array of all displays in the environment.
+     *
+     * @return  Array of all displays in the environment.
+     */
+    RPointerArray<CHuiDisplay> Displays() const;
+
+    IMPORT_C TInt& GlesRefCounter();
+
+    void SetTimeFromLastUpdate(TUint aTimeFromLastUpdate);
+
+    /**
+     * Gets the active display.
+     *
+     * @return Current HuiDisplay.
+     */
+    CHuiDisplay* CurrentDisplay() const;
+
+    CHuiCanvasTextureCache& CanvasTextureCache() const;
+
+public:
+
+    /* Implementaton of MHuiTextureLoadingCompletedObserver: */
+
+    void TextureLoadingCompleted(CHuiTexture& aTexture,
+                                    TInt aTextureId,
+                                    TInt aErrorCode);
+
+    /* Implementaton of MHuiTextureManagerStateChangedObserver: */
+
+    void TextureManagerStateChanged(const CHuiTextureManager& aManager);
+
+
+private:
+
+	/* Enumerations. */
+	
+	/** 
+	 * Environment state.
+	 */
+	enum TState
+		{
+		/** Normal state, where rendering is occuring. */
+		ENormal,
+		/** Released state, where displays are released and rendering is not occuring. */			
+		EReleased
+		};
+
+    /* Constructors. */
+
+    /**
+     * Constructor.
+     *
+     * @param aObserver  Pointer to observer class instance that will be called
+     *                   to perform application specific configurations. Can be
+     *                   NULL to create a default CHuiEnv.
+     */
+    CHuiEnv(MHuiEnvObserver* aObserver = NULL);
+
+    /**
+     * Second-phase constructor.
+     *
+     * @param aRenderer The renderer being used by the environment.
+     */
+    void ConstructL(THuiRenderer aRenderer);
+
+
+    /* Private methods. */
+
+    /**
+     * Create a resource reader.
+     *
+     * @param aReader      Resource reader.
+     * @param aResourceId  Identifier of the resource to read.
+     */
+    void CreateResourceReaderLC(TResourceReader& aReader, TInt aResourceId) const;
+
+    /**
+     * Stops the refresh timer.
+     * This does not affect animation timers.
+     *
+     * @see CHuiStatic
+     */
+    void StopRefresh();
+
+    /**
+     * Called when time has passed. The amount of elapsed time is passed
+     * to the scheduler and the displays are checked for refresh.
+     *
+     * @param aElapsedTime  Number of seconds elapsed.
+     */
+    void AdvanceTime(TReal32 aElapsedTime);
+
+    /**
+     * Makes the render surface of the display active.
+     *
+     * @param aDisplay  HuiDisplay to make current.
+     */
+    void MakeCurrent(const CHuiDisplay& aDisplay) const;
+
+    /**
+     * Checks if device supports thread CPU time measurements.
+     */
+    TBool CPUTimeSupported();
+    
+    /**
+     * Opens handle to null thread.
+     */
+    TBool OpenHandleToIdleCPUValueThread();
+    
+    /**
+     * Closes handle to null thread.
+     */
+    void CloseHandleToIdleCPUValueThread();
+
+public:
+
+    /** Action observers. */
+    RHuiObserverArray<MHuiActionObserver> iActionObservers;
+
+
+private:
+
+	/** Current environment state. */
+	TState iState;
+
+    /** Renderer instance. */
+    CHuiRenderPlugin* iRenderer;
+
+    /** Public identifier of the renderer selected at construction time. */
+    THuiRenderer iRendererIdentifier;
+
+    /** Current refresh mode. */
+    THuiRefreshMode iRefreshMode;
+
+    /** Refresh interval in milliseconds. */
+    TInt iRefreshInterval;
+    TInt iRefreshIntervalTarget;
+
+    /** Instance of the static data area. */
+    CHuiStatic* iStatic;
+
+    /** Array of all displays in the environment. Owned. */
+    RPointerArray<CHuiDisplay> iDisplays;
+
+    /** Array of all overlaid displays in the environment. Points to the
+        displays in iDisplays. */
+    RPointerArray<CHuiDisplay> iOverlaidDisplays;
+
+    /** The roster used by all overlaid displays. */
+    CHuiRosterImpl* iSharedRoster;
+
+    /** Refresh timer. */
+    CHighResTimer* iPeriodic;
+    //CPeriodic* iPeriodic;
+    
+    /** Number of refreshes that had no effect on anything. */
+    TInt iIdleRefreshCount;
+
+    /** The scheduler. */
+    CHuiScheduler* iScheduler;
+
+    /** All the loaded control groups are owned by the environment. */
+    RPointerArray<CHuiControlGroup> iLoadedGroups;
+
+    /** Texture manager. */
+    CHuiTextureManager* iTextureManager;
+    /** Theme Interface */
+    CHuiThemeManager* iThemeManager;
+
+    /** Font manager. */
+    THuiFontManager* iFontManager;
+    
+    /** Text Style manager. */
+    CHuiTextStyleManager* iTextStyleManager;
+
+    /** Effects engine */
+    CHuiFxEngine* iEffectsEngine;
+    
+    /** Skin. */
+    CHuiSkin* iSkin;
+
+    /** Visual factory. */
+    CHuiVisualFactory* iVisualFactory;
+
+    /** Environment observer object */
+    MHuiEnvObserver* iEnvObserver;
+
+    /** Time when input was last received. */
+    TTime iLastInputTime;
+
+    /** If ETrue, the input idle has been activated, so we are in idle state. */
+    TBool iInputIdleIsActive;
+
+    /** Number of seconds before sending an idle input notification. */
+    TInt iIdleThreshold;
+
+    TReal32 iPreviousFpsTime;
+		
+    TUint iMaxCPUUtilization;
+    
+    TInt iGlesRefCounter;
+
+    // FPS counter data    
+    TUint iFrames;
+    TUint iMillisecondFromFPSUpdate;
+    TUint iRefreshIntervalReal;
+    TUint iFpsCounterThreshold;
+    
+    mutable CHuiDisplay* iCurrentDisplay;
+    
+    CActive::TPriority iRefreshLoopPriority;
+
+	TBool iRefreshLoopActive;
+
+    
+    /** For measuring idle between frames */
+    TBool    iIdleCPUValueMonitored;
+    TInt64   iIdleCPUValuePreviousTime;
+    TInt64   iIdleCPUValue;
+    RThread  iIdleCPUValueThread;
+    
+    CHuiCanvasTextureCache* iCanvasTextureCache;    
+    
+    RPointerArray<MHuiLowMemoryObserver> iLowMemoryObservers;
+    RPointerArray<MHuiMemoryLevelObserver> iMemoryLevelObservers;
+    THuiMemoryLevel iMemoryLevel;
+    
+public:
+    class MHuiSwapObserver
+        {
+        public: 
+            virtual void PrepareSwap()=0;
+            virtual void SwapComplete()=0;
+            virtual void ReleaseWindowServer(TBool aRelease = ETrue) = 0;
+            virtual void SetWgIdArray(TInt* aArray) =0; 
+        };
+    
+    MHuiSwapObserver* iSwapObserver;
+    
+    IMPORT_C void AddLowMemoryObserver(MHuiLowMemoryObserver * aObserver);
+    IMPORT_C void RemoveLowMemoryObserver(MHuiLowMemoryObserver * aObserver);
+    IMPORT_C void NotifyLowMemory(TBool aEnable);
+
+    IMPORT_C void AddMemoryLevelObserver(MHuiMemoryLevelObserver * aObserver);
+    IMPORT_C void RemoveMemoryLevelObserver(MHuiMemoryLevelObserver * aObserver);
+    IMPORT_C void NotifyMemoryLevel(THuiMemoryLevel aMemoryLevel);
+    IMPORT_C THuiMemoryLevel MemoryLevel();
+    
+    };
+
+#endif  // __HUIENV_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiEvent.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,183 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIEVENT_H__
+#define __HUIEVENT_H__
+
+
+#include <e32base.h>
+#include <coedef.h>
+#include <w32std.h>
+
+
+/* Forward declarations. */
+class CHuiDisplay;
+class CHuiVisual;
+
+
+/**
+ * An input event. This class would typically be passed to a control.
+ * One example of an event would be a keypress,
+ * or a custom message arriving from another control.
+ * You cannot derive from this class.
+ */
+NONSHARABLE_CLASS(THuiEvent)
+	{
+public:
+
+    /** @beginAPI */
+
+    /** Event types. This is the most general type for the message.*/
+    enum TType
+        {
+        ETypeCustom, 		//!< a message passed from one control to another
+        ETypeKey,			//!< a message regarding a keypress
+        ETypePointer,		//!< a message regarding a touch screen interface
+        ETypeIdleBegin,	    //!< hui has entered the idle state
+        ETypeIdleEnd		//!< hui has left the idle state
+        };
+        
+
+	/* Constructors. */
+   
+    /**
+     * Constructor.
+     */
+    THuiEvent(CHuiDisplay* aDisplay, TType aType);
+    
+    /**
+     * Constructor for custom events (not bound to any display).
+     */
+    IMPORT_C THuiEvent(TInt aCustomParam);
+   
+    /**
+     * Constructor for pointer events.
+     */
+    IMPORT_C THuiEvent(CHuiDisplay* aDisplay, const TPointerEvent& aPointerEvent);
+    
+	/* Methods. */
+
+    /**
+     * Returns the type of the event.
+     * @see TType
+     */     
+    IMPORT_C TType Type() const;
+    
+    /**
+     * Determines whether the event is a custom event.
+     */     
+    IMPORT_C TBool IsCustomEvent() const;
+    
+    /**
+     * Determines whether the event is a key event, for example, a key was pressed.
+     */     
+    IMPORT_C TBool IsKeyEvent() const;
+    
+    /**
+     * Determines whether the event is a pointer event.
+     * A pointer event is caused by a pointing device, such as a click, move or drag.
+     * @return true if the event is a pointer event.
+     */     
+    IMPORT_C TBool IsPointerEvent() const;
+    
+    /**
+     * Returns a reference to the display which the event originated from.
+     */
+    IMPORT_C CHuiDisplay& Display() const;
+
+    /**
+     * Pointer is down.
+     * @return ETrue if this is a pointer event and the pointer has been pressed down.
+     */
+    IMPORT_C TBool PointerDown() const;
+
+    /**
+     * Pointer is up.
+     * @return ETrue if this is a pointer event and the pointer has been lifted up.
+     */
+    IMPORT_C TBool PointerUp() const;
+    
+    /**
+     * Pointer event is a long press.
+     * @return ETrue if this is a pointer event and the pointer has been pressed for long tap duration.
+     */
+    IMPORT_C TBool PointerLongTap() const;
+
+    IMPORT_C void SetVisual(CHuiVisual* aVisual);
+    
+    IMPORT_C CHuiVisual* Visual() const;
+
+    /** @endAPI */	
+
+    /**
+     * Constructor for key events.
+     */
+    THuiEvent(CHuiDisplay* aDisplay, const TKeyEvent& aKeyEvent, TEventCode aType);
+    
+
+private:
+    
+    /* Private methods */
+
+
+public:
+
+    /* Public member variables. */
+
+    /** The display from where the event originated. */
+    CHuiDisplay* iDisplay;
+
+    /** Type of this event, if it is a Symbian S60 event code.
+    *
+    * For example: EEventKeyUp, EEventKeyDown
+    *
+    * @see Symbian event codes.
+    */    
+    TEventCode iCode;
+
+    /** The S60 struct that contains scancode, key event information, etc.
+    * @see Symbian event codes.
+    */        
+    TKeyEvent iKeyEvent;
+
+
+    /** The S60 struct that contains pointer device event info, which would be
+    * triggered by touch screen interaction.
+    * @see Symbian event codes.
+    */            
+    TAdvancedPointerEvent iPointerEvent;
+    
+    /** Parameter for custom events. Alignment not BC between TB9.1 and 9.2 */
+    TInt iParam;
+
+
+private:
+
+    /** Type of the event. */
+    TType iType;
+    
+    /** Visual which the event is associated with. */
+    CHuiVisual* iVisual;
+    
+    // occupied by Advanced pointer event, to keep at least the size as same
+    //TInt iSpare1;
+    //TInt iSpare2;
+	};
+
+#endif  // __HUIEVENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiFlowLayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,172 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIFLOWLAYOUT_H__
+#define __HUIFLOWLAYOUT_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiLayout.h>
+
+
+/**
+ * Flow layout positions children next to each other either horizontally or
+ * vertically. The sizes of child visuals are not changed by default.
+ *
+ * The layout inner padding is used to determine the gap between children.
+ *
+ * Flow layout takes system wide layout mirroring into consideration by
+ * querying the mirroring state through AknLayoutUtils::LayoutMirrored().
+ * In western locales the visuals are layed out from left to right whereas
+ * in arabic locale for instance the visuals are layed out from right to left.
+ * Mirroring is considered only when the flow is horizontal. Vertical flow layout
+ * will always lay visuals from top to bottom.
+ */
+NONSHARABLE_CLASS(CHuiFlowLayout) : public CHuiLayout
+	{
+public:
+
+    /** Flow directions. */
+    enum TFlowDirection
+        {
+        /**
+         * Flow horizontally. System wide layout mirroring is considered
+         * to determine whether visuals are layed from left to right
+         * or from right to left.
+         * @see AknLayoutUtils::LayoutMirrored()
+         */
+        EFlowHorizontal = 0,
+        
+        /** Flow vertically. */
+        EFlowVertical
+        };
+    
+    /** Mode flags that specify how the flow is laid out. */
+    enum TMode
+        {
+        /** Center the children perpendicular to the flow direction.
+            For example, if the flow direction is horizontal (left->right)
+            this flag will center the children vertically along the flow. */
+        EModeCenterPerpendicular = 0x1,
+        
+        /** Fit the children perpendicular to the flow direction.
+            For example, if the flow direction is horizontal, the children
+            will be vertically resized to fit the layout's rectangle. */
+        EModeFitPerpendicular = 0x2,
+        };
+    
+
+	/* Constructors and destructor. */
+
+    /**
+     * Construct a new flow layout and append it to a control.
+     *
+     * @param aDirection     Flow direction.
+     * @param aOwnerControl  Control that will own the new layout visual.
+     * @param aParentLayout  Parent layout for the new layout visual.
+     *
+     * @return  Pointer to the new layout visual. The owner control retains
+     *          ownership of the returned visual. Do not delete the returned
+     *          visual manually.
+     */
+    IMPORT_C static CHuiFlowLayout* AddNewL(CHuiControl& aOwnerControl, 
+                                            TFlowDirection aDirection,
+                                            CHuiLayout* aParentLayout = 0);
+
+	/**
+	 * Constructor.
+	 */
+	CHuiFlowLayout(MHuiVisualOwner& aOwner);
+
+	/**
+	 * Second-phase constructor.
+	 */
+	void ConstructL();
+
+	/**
+	 * Destructor.
+	 */
+	IMPORT_C virtual ~CHuiFlowLayout();
+
+
+	/* Methods. */
+	
+    IMPORT_C void SetSize(const THuiRealSize& aSize, TInt aTransitionTime=0);
+
+    TBool ChildSize(TInt aOrdinal, TSize& aSize);
+    
+    TBool ChildPos(TInt aOrdinal, TPoint& aPos);
+
+    TInt ChildRect(TInt aOrdinal, THuiRealRect& aRect);
+
+    /**
+     * Sets the direction of the flow.
+     *
+     * @param aDirection  Flow direction.
+     */
+    IMPORT_C void SetFlowDirection(TFlowDirection aDirection);
+
+    /**
+     * Sets the centering mode of the flow. This sets/clears the 
+     * EModeCenterPerpendicular flag. Calling this is equivalent to calling
+     * SetMode() with that flag included or missing from the mode.
+     *
+     * @param aCentering  <code>ETrue</code> to set the EModeCenterPerpendicular mode.
+     *                    <code>EFalse</code> to clear it.
+     *
+     * @note  This method could be deprecated in the future, since SetMode()
+     *        does the same thing.
+     */    
+    IMPORT_C void SetCentering(TBool aCentering);
+    
+    /**
+     * Sets the mode of the flow. The mode flags determine how the flow layout
+     * behaves.
+     *
+     * @param aMode  Mode flags (OR'd together).
+     *
+     * @see CHuiFlowLayout::TMode
+     */
+    IMPORT_C void SetMode(TInt aMode);
+    
+    /**
+     * Returns the mode flags of the flow.
+     *
+     * @see CHuiFlowLayout::TMode
+     *
+     * @return  Returns the current mode flags.
+     */
+    IMPORT_C TInt Mode() const;
+
+private:
+    
+    /* Private methods */
+
+
+private:
+
+    /** Direction of the flow: horizontal or vertical. */
+    TFlowDirection iDirection;
+
+    /** Mode flags of the flow. */
+    TInt iMode;
+    
+	};
+
+#endif  // __HUIFLOWLAYOUT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiFont.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,233 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 base class.
+*
+*/
+
+
+
+#ifndef __HUIFONT_H__
+#define __HUIFONT_H__
+
+#include <AknFontSpecification.h> 
+
+#include <e32base.h>
+#include <gdi.h>
+#include <bitstd.h>
+
+/**
+ * THuiFont is presents an abstract font implementation. It cannot be used on
+ * its own. Its main purpose is to act as a handle to a system font and
+ * provide metrics to the layout and drawing routines.
+ *
+ * Different rendering plugins will implement their own version of this class
+ * to suit their own functionality.
+ */
+class THuiFont
+    {
+public:
+
+    /** @beginAPI */
+
+    /**
+     * Default constructor. This instance should be initialised before use.
+     */
+    IMPORT_C THuiFont();
+    
+    /**
+     * Constructor from a TFontSpec in twips.
+     * Since the metrics are mastered in pixels, the passed-in TFontSpec::Height() is converted to 
+     * pixels using the default screen device's twips-to-pixel ratio.
+     *
+     * @param aId       A handle id set into the THuiFont by the Texture manager or skin
+     * @param aFontSpec Symbian OS Font Specification to store
+     */
+    IMPORT_C THuiFont(TInt aId, const TFontSpec& aFontSpec);
+
+    /**
+     * Destructor.
+     * @todo: T-class shouldn't have destructor to begin with
+     */
+    IMPORT_C ~THuiFont();
+
+    /**
+     * Copy constructor.
+     * @param aFont Font to be copied.
+     */
+    IMPORT_C THuiFont( const THuiFont& aFont );
+            
+    /**
+     * Assignment operator.
+     * @param aFont Font to be copied.
+     * @return Reference to this instance.
+     */
+    IMPORT_C THuiFont& operator=( const THuiFont& aFont );
+
+    /* Methods. */
+
+    /**
+     * Determines the font's identifier.
+     *
+     * @return  Font identifier.
+     */
+    IMPORT_C TInt Id() const;
+
+    /**
+     * Returns the font category.
+     */
+    IMPORT_C TAknFontCategory Category() const;
+
+    /**
+     * Returns the Symbian font specification. Always returned in Twips
+     * 
+     *  @param aMap  Graphics device map containing desired pixel to twips ratio to use
+     *  @return Symbian OS Font specification
+     */
+    IMPORT_C TFontSpec FontSpec(MGraphicsDeviceMap* aMap = NULL) const;    
+    
+    /** @endAPI */
+
+    /**
+     * Sets the font specification.
+     */
+    IMPORT_C void SetFontSpec(const TFontSpec& aFontSpec);
+   
+    /**
+     * Sets the category.
+     */
+    IMPORT_C void SetCategory(const TAknFontCategory aCategory);
+
+    /**
+     * Required vertical extend of the font. This value is always returned in pixels.
+     * The text will fit within a rectangle of this height
+     * 
+     * @return  text pane height in pixels into which the text is to fit completely
+     */
+    IMPORT_C TInt TextPaneHeight() const;
+    
+    /**
+     * Required vertical extend of the font. This value is always specified in pixels.
+     * The text will fit within a rectangle of this height
+     * 
+     * @param aTextPaneHeight  text pane height in pixels into which the text is to fit completely
+     */
+    IMPORT_C void SetTextPaneHeight(TInt aTextPaneHeight);
+    
+    /**
+     * Returns the nearest CFont object representation of this THuiFont object.
+     * Creates the CFont object according to specifications in this THuiFont unless
+     * one is already created. If CFont object is already created then the already
+     * created instance is returned. Releasing of CFont - object is handled by this
+     * class.
+     *
+     * @param aTextMeshYScale  Height scale factor from LCD resolution to TV resolution. @todo: tell more...
+     * 
+     * @return Closest CFont - object representing this THuiFont.
+     */
+    IMPORT_C CFont* NearestFontL(TReal32 aTextMeshYScale = 1) __SOFTFP;
+    
+    /**
+     * Rasterizes the given text string to the target graphics context using this font.
+     * The caller has to configure the graphics context with parameters to be used in
+     * rasterization before calling this method.
+     * 
+     * @param aTextString 		The text string to be rasterized.
+     * @param aTargetContext 	The target graphics context to be used in rasterization.
+     */
+    IMPORT_C void RasterizeLineL(const TDesC& aTextString, CFbsBitGc& aTargetContext);
+
+    /**
+     * Retrieves the dimensions in pixels occupied by rasterization of the given string using
+     * this font.
+     * 
+     * @param aTextString String that is used in calculation of rasterization dimensions.
+     * @return Dimensions occupied by rasterization of the text string in pixels.
+     */
+    IMPORT_C TSize LineExtentsL(const TDesC& aTextString);
+    
+	/**
+	 * Release the Symbian font representation.
+	 */
+	IMPORT_C void ReleaseFont();
+	
+private:
+
+    /**
+    * This is backporting AknBidiTextUtils::MeasureTextBoundsWidth from S60 3.1 to have that
+    * functionality also when running hitchcock on S60 3.0 platform
+    *
+    * Measures the full horizontal width in pixels of the passed-in text using a particular font, 
+    * including in the width any side-bearings of the glyphs at the ends of the text, and any
+    * declared "advance" of the run of glyphs. 
+    * 
+    * It cannot be used for vertical text measurement.
+    * 
+    * Side-bearings are parts of glyphs that extend left or right from the normal width
+    * or "advance" of the glyph. A left side-bearing, for instance, will overlap with a glyph
+    * to its left. Another way of thinking about this is that the origin (0,0) of the glyph is 
+    * not at its bottom left. 
+    *
+    * The advance of a run of glyphs is the sum of the advances - once in visual ordering and 
+    * shaping has been performed - of all the glyphs. It is defined relative to a drawing origin.
+    * 
+    * Within runs of text, side-bearings do not contribute to the width of the text. However,
+    * at the (visual) ends of text, they are likely to need to be counted, depending upon the
+    * exact use case.
+    * 
+    * This method returns the width of the horizontal envelope of the text by taking the extreme 
+    * horizontal extents of the text bounds rectangle (which includes side-bearings on either end)
+    * and the extent of the advance. Thus it returns the width of :
+    *   Min(<left_text_bound>, 0), Max( <right_text_bound>, <advance>)
+    *   
+    * This method should be used when the proposed text is going to be drawn using any horizontal
+    * CGraphicsContext::DrawText drawing API. 
+    *
+    * The text can be in visual or logical order.
+    *
+    * @since 3.1
+    * @param aFont  Font to use
+    * @param aText  Text to be measured
+    * @param aOrder Whether the text provided is in visual or logical order
+    * @return       width of the text in pixels.
+    */
+    TInt THuiFont::MeasureBidiTextBoundsWidth(const CFont& aFont,
+                                          const TDesC& aText,
+                                          CFont::TMeasureTextInput::TFlags aOrder) const;
+
+
+    /** Identifier number. Assigned by the texture manager. */
+    TInt iId;
+
+    /** Symbian Font specification. */
+    TFontSpec iFontSpec;
+
+    // Structure containing Symbian Font instance and reference count.
+    struct TFontRef;
+
+    /** Nearest Font object. */
+    TFontRef* iFont;
+    
+    /** This is the vertical space in which the font will fit.
+    This measure is alwasy in pixels.
+    It may be necessary to use this request the font, rather than via the Fontspec*/
+    TInt iTextPaneHeight;
+    
+    TAknFontCategory iCategory;
+    
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+#endif // __HUIFONT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiGc.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1100 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition file for CHuiGc (graphics context) class.
+*
+*/
+
+
+
+#ifndef __HUIGC_H__
+#define __HUIGC_H__
+
+
+#include <e32base.h>
+#include <gdi.h>
+
+#include <uiacceltk/HuiRealPoint.h>
+#include <uiacceltk/HuiRealSize.h>
+#include <uiacceltk/HuiRealRect.h>
+
+
+/* Forward declarations. */
+class CHuiTexture;
+class THuiFont;
+class THuiImage;
+class CHuiMesh;
+class CHuiTextMesh;
+class CHuiCurvePath;
+class CHuiTransformation;
+class MHuiMappingFunction;
+
+const TInt KHuiGcClipRegionGranularity = 10;
+
+/** Point on a weighted path. */
+struct THuiPathPoint
+    {
+    /** Position of the point. */
+    TPoint iPoint;
+
+    /** Weight of the point. */
+    TReal32 iWeight;
+
+    inline THuiPathPoint(const TPoint& aPoint, const TReal32& aWeight)
+        : iPoint(aPoint), iWeight(aWeight) {}
+    };
+
+
+/** Weighted path. */
+typedef RArray<THuiPathPoint> THuiWeightedPath;
+
+
+/** Horizontal alignment. */
+enum THuiAlignHorizontal
+    {
+    EHuiAlignHLeft,
+    EHuiAlignHCenter,
+    EHuiAlignHRight,
+
+   /** Alignment that follows the directionality of the UI language. This is converted to left or
+        right alignment internally. e.g. into right-aligned for Arabic */
+    EHuiAlignHLocale,
+
+    /** Alignment that is opposite to the directionality of the UI language. This is 
+        converted to left or right alignment internally. e.g. into left-aligned for Arabic */
+    EHuiAlignHLocaleMirrored,
+
+    /** Alignment is text content dependent according to Unicode paragraph alignment rules. 
+         This is converted to left or right alignment according to text content. 
+         Where used in an editable context, the cursor alignment when empty comes from current input language.
+         This should not be used in a non-textual context, but if used, behaves like EHuiAlignHLocale. */
+    EHuiAlignHBidirectionalText,
+
+    /** Alignment is text content dependent according to Unicode paragraph alignment rules, but then reversed. 
+         This is converted to left or right alignment according to text content. 
+         Where used in an editable context, the cursor alignment when empty is opposite to current input language.
+         This should not be used in a non-textual context, but if used, behaves like EHuiAlignHLocaleMirrored. */
+    EHuiAlignHBidirectionalTextMirrored
+    };
+
+
+/** Vertical alignment. */
+enum THuiAlignVertical
+    {
+    EHuiAlignVTop,
+    EHuiAlignVCenter,
+    EHuiAlignVBottom
+    };
+
+
+/** Texture matrices. */
+enum THuiGcMatrix
+    {
+    /** Modelview matrix. */
+    EHuiGcMatrixModel,
+
+    /** Projection matrix. */
+    EHuiGcMatrixProjection,
+
+    /** Texture matrix. */
+    EHuiGcMatrixTexture
+    };
+
+
+/** Rendering quality. */
+enum THuiQuality
+    {
+    /** Accurate quality ensures the best visual quality. */
+    EHuiQualityAccurate,
+
+    /** Fastest rendering speed in exchange for lower quality. */
+    EHuiQualityFast
+    };
+
+/** Polygon draw mode */
+enum THuiFillMode
+    {
+    EHuiNoFill,
+    EHuiFillNonZero,
+    EHuiFillEvenOdd
+    };
+
+/**
+ * CHuiGc is a graphics context that is used for storing the state of the
+ * drawing tools. The graphics context provides a number of relatively
+ * low-level drawing routines.
+ *
+ * @todo  Check which exports are truly useful to applications.
+ *
+ */
+class CHuiGc : public CBase
+    {
+public:
+
+    /** Display orientation. */
+    enum TOrientation
+        {
+        /** Normal orientation. */
+        EOrientationNormal,
+
+        /** 90 degrees counterclockwise. */
+        EOrientationCCW90,
+
+        /** 90 degrees clockwise. */
+        EOrientationCW90,
+        
+        /** 180 degrees  */
+        EOrientation180        
+        };
+
+    /** Rendering features. */
+    enum TFeature
+        {
+        EFeatureTexturing,
+        EFeatureBlending,
+        EFeatureClipping,
+        EFeatureDepthTest,
+        EFeatureDepthWrite,
+        EFeatureAntialias,
+        EFeatureFog,
+        };
+
+    /** Blending modes. */
+    enum TBlendMode
+        {
+        EBlendNormal,
+        EBlendAdd,
+        EBlendReplace
+        };
+
+    /** Texture modes. */
+    enum TTextureMode
+        {
+        ETextureModeNormal,
+
+        /** Interpolation between two texture units. Parameter controls how
+            much interpolation is done. */
+        ETextureModeInterpolate
+        };
+
+    /** Projections. */
+    enum TProjection
+        {
+        EProjectionOrthographic,
+        EProjectionPerspective
+        };
+
+    /**
+     * Stretch modes.
+     * @see DrawStretchImage()
+     */
+    enum TStretchMode
+        {
+        EStretchNone = 0,   ///< Does not stretch
+        EStretchHorizontal, ///< Fits to horizontal width (left-right)
+        EStretchVertical,   ///< Fits to vertical height
+        EStretchFull		///< Stretches the image to the full area of the visual, disregarding the original aspect ratio.
+
+        };
+        
+	/**
+	 * Modes for drawing borders with images.
+	 * @see DrawBorders()
+	 */        
+    enum TBorderMode    
+	{
+        /**
+         * The whole image is stretched to the
+         * borders so that the pixels at the center of the image are placed at the 
+         * edges of the visual and the pixels at the edge of the image are placed
+         * at the outer edge. 
+         * 
+         * For example, a round-shaped ball having red centrum
+         * and white outer rim cretes a red square inner border having white
+         * rounded outer border.
+         */
+        EBorderImage = 0,
+
+        /**
+         * Only the edge pixels of the image are used to draw the borders. The edge is 
+         * defined with the (left,right,top,bottom-) border widths. The corners of the
+         * image are not stretched. The center image inside the borders won't be
+         * included in the border drawing.
+         * 
+         * This mode is used in CHuiImageBrush to draw background images to visuals 
+		 * (eg. Soft key backgrounds) and texture-mapped borders to them (for example 
+		 * to achieve rounded corners). 
+         */
+        EBorderFixedCorners
+
+        };
+
+    /** Gradient types. */
+    enum TGradientType
+        {
+        EGradientLinearUp,
+        EGradientLinearRight,
+        EGradientLinearDown,
+        EGradientLinearLeft
+        };
+
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CHuiGc();
+
+
+    /* Methods. */
+
+    /**
+     * Sets the quality preference of the graphics context.
+     *
+     * @param aQuality  Quality setting.
+     */
+    IMPORT_C virtual void SetQuality(THuiQuality aQuality);
+
+    /**
+     * Determines the quality preference of the graphics context.
+     *
+     * @return  Quality preference.
+     */
+    IMPORT_C THuiQuality Quality() const;
+
+    /**
+     * Pushes the current global transformation matrix on the stack.
+     */
+    IMPORT_C virtual void Push(THuiGcMatrix aStack) = 0;
+
+    /**
+     * Pops a matrix from the stack.
+     */
+    IMPORT_C virtual void Pop(THuiGcMatrix aStack) = 0;
+
+    /**
+     * Loads an identity matrix as the current matrix.
+     */
+    IMPORT_C virtual void LoadIdentity(THuiGcMatrix aStack) = 0;
+
+    /**
+     * Multiplies the current matrix with another matrix.
+     */
+    IMPORT_C virtual void Multiply(THuiGcMatrix aStack, TReal32 aMatrix[16]) = 0;
+
+    /**
+     * Apply a translation to given matrix stack.
+     */
+    IMPORT_C virtual void Translate(THuiGcMatrix aStack,
+                                    TReal32 aX, TReal32 aY, TReal32 aZ) __SOFTFP = 0;
+
+    /**
+     * Apply a scale to given matrix stack.
+     */
+    IMPORT_C virtual void Scale(THuiGcMatrix aStack,
+                                TReal32 aX, TReal32 aY, TReal32 aZ) __SOFTFP = 0;
+
+    /**
+     * Apply a rotation to given matrix stack.
+     */
+    IMPORT_C virtual void Rotate(THuiGcMatrix aStack, TReal32 aAngle,
+                                 TReal32 aX, TReal32 aY, TReal32 aZ) __SOFTFP = 0;
+
+    /**
+     * Apply a shear to given matrix stack.
+     */
+    virtual void Shear(THuiGcMatrix /*aStack*/,
+                                TReal32 /*aX*/, TReal32 /*aY*/, TReal32 /*aZ*/) __SOFTFP {} // cheers ;)
+    
+    /**
+     * Sets the orientation of the display. This affects clipping and
+     * projection.
+     *
+     * @param aOrientation  Orientation of the display.
+     */
+    IMPORT_C void SetOrientation(TOrientation aOrientation);
+
+    /**
+     * Determines the orientation of the graphics context.
+     *
+     * @return  Orientation.
+     */
+    IMPORT_C TOrientation Orientation() const;
+
+    /**
+     * Initialize the state of the context.
+     */
+    IMPORT_C virtual void InitState() = 0;
+
+    /**
+     * Selects the default data arrays.
+     */
+    IMPORT_C virtual void RestoreState() const = 0;
+
+    IMPORT_C void SetProjection(TProjection aProjection = EProjectionOrthographic);
+
+    IMPORT_C TProjection Projection() const;
+
+    /**
+     * Sets projection within a custom viewport.
+     */
+    IMPORT_C void SetProjection(TProjection aProjection, const TRect& aCustomViewport);
+
+    /**
+     * Defines an offset for the 3D frustum and updates the projection.
+     */
+    IMPORT_C void SetFrustumOffset(const THuiRealPoint& aFrustumOffset);
+
+    /**
+     * Determines the current frustum offset.
+     */
+    IMPORT_C THuiRealPoint FrustumOffset() const;
+
+    /**
+     * Updates the projection matrix without changing any settings.
+     */
+    IMPORT_C virtual void UpdateProjection() = 0;
+
+    /**
+     * Sets the display area of the normal orientation.
+     */
+    IMPORT_C void SetDisplayArea(const TRect& aDisplayArea);
+
+    /**
+     * Returns the display area. Affected by the display orientation.
+     */
+    IMPORT_C TRect DisplayArea() const;
+
+    /**
+     * Returns the number of available texture units.
+     *
+     * @return  Number of units (at least 1).
+     */
+    IMPORT_C virtual TInt TextureUnits() const = 0;
+
+    /**
+     * Sets the number of active texture units.
+     *
+     * @param aTextureUnitCount  Number of units to activate (e.g., 2 => 0,1)
+     */
+    IMPORT_C virtual void SetTextureUnits(TInt aTextureUnitCount) = 0;
+
+    /**
+     * Enable a feature.
+     */
+    IMPORT_C virtual void Enable(TFeature aFeature, TBool aDoEnable = ETrue) = 0;
+
+    /**
+     * Disable a feature.
+     */
+    IMPORT_C virtual void Disable(TFeature aFeature);
+
+    /**
+     * Changes the blending mode.
+     */
+    IMPORT_C virtual void SetBlendMode(TBlendMode aBlendMode) = 0;
+
+    /**
+     * Changes the texture mode.
+     *
+     * @param aTextureMode  Texturing mode.
+     * @param aParam        Parameter for the texturing.
+     */
+    IMPORT_C virtual void SetTextureMode(TTextureMode aTextureMode, TReal32 aParam = 0) __SOFTFP = 0;
+
+    /**
+     * Sets the strength of dimming fog. In order to have effect, enable the
+     * Fog feature.
+     *
+     * @param aColor   Color of dimming.
+     * @param aAmount  Amout of dimming (0...1).
+     */
+    IMPORT_C virtual void SetDimmingFog(const TRgb& aColor, TReal32 aAmount) __SOFTFP = 0;
+
+    /**
+     * Clear using the current pen color.
+     */
+    IMPORT_C virtual void Clear() = 0;
+
+    /**
+     * Clear the depth buffer.
+     */
+    IMPORT_C virtual void ClearDepth() = 0;
+    
+    /**
+     * Clear both color and depth buffer
+     */
+    IMPORT_C virtual void ClearColorAndDepth() = 0;
+
+	/**
+	 * Do initialization of new frame.
+	 * Called by CHuiDisplay when starting to render new frame.
+	 * Graphics context can do renderer specific state initializations here.
+	 */
+    IMPORT_C virtual void InitNewFrame() = 0;
+
+    /**
+     * Push the current clipping rectangle onto the clip stack.
+     */
+	IMPORT_C virtual void PushClip();
+
+    /**
+     * Pop a clipping rectangle off of the clip stack and activate it.
+     */
+    IMPORT_C virtual void PopClip();
+
+    /**
+     * Apply a clipping rectangle.
+     *
+     * @param aClipRect  Clipping rectangle.
+     */
+    IMPORT_C virtual void Clip(const TRect& aClipRect);
+
+    /**
+     * Apply a clipping region.
+     *
+     * @param aClipRegion  Clipping region.
+     */
+    IMPORT_C virtual void Clip(const TRegion& aClipRegion); 
+    
+    /**
+     * Apply a clipping region.
+     *
+     * @param aClipRegion  Region containing clipping rectangles.
+     */
+
+	IMPORT_C virtual void SetClipRegion(const TRegion& aClipRegion);
+	
+	/**
+	 * Cancel an applied clipping rectangle or region.
+	 */
+
+	IMPORT_C virtual void CancelClipping();
+	
+    /**
+     * Replace the current clipping rectangle.
+     *
+     * @param aClipRect  Clipping rectangle in display coordinates.
+     */
+    IMPORT_C virtual void SetClip(const TRect& aClipRect);
+
+    /**
+     * Returns the currently active clipping rectangle.
+     */
+    IMPORT_C TRect ClipRect() const;
+
+    /**
+     * Returns the currently active clipping region.
+     */
+    const TRegion& ClipRegion() const;
+
+
+    /**
+     * Determines the number of pushed clipping rectangles on the clip stack.
+     *
+     * @return  Size of the clip stack.
+     */
+    IMPORT_C TInt ClipStackCount() const;
+
+    /**
+     * Sets the pen color and alpha.
+     */
+    IMPORT_C void SetPenColorAlpha(const TRgb& aColor);
+
+    /**
+     * Sets the pen color.
+     */
+    IMPORT_C void SetPenColor(const TRgb& aColor);
+
+    /**
+     * Sets the pen alpha level.
+     *
+     * @param aAlpha  Alpha level (0..255).
+     */
+    IMPORT_C void SetPenAlpha(TInt aAlpha);
+
+    /**
+     * Determines the pen color and alpha.
+     *
+     * @return  Pen color and alpha.
+     */
+    IMPORT_C TRgb PenColorAlpha() const;
+
+    /**
+     * Determines the pen color.
+     *
+     * @return  Pen color.
+     */
+    IMPORT_C TRgb PenColor() const;
+
+    /**
+     * Determines the pen alpha level.
+     *
+     * @return  Alpha level (0..255).
+     */
+    IMPORT_C TInt PenAlpha() const;
+
+    /**
+     * Sets the current font.
+     *
+     * @param aFont  Font texture.
+     */
+    IMPORT_C void SetFont(THuiFont& aFont);
+
+    /**
+     * Sets the object alignment mode for both horizontal and vertical
+     * directions. Used in DrawImage() and DrawImages().
+     *
+     * @todo Should SetAlign() work also in other GC drawing operations?
+     *
+     * @param aHorizontalAlign  Horizontal alignment mode. The horizontal
+     *                          alignment mode determines if the used
+     *                          coordinates are relative to left edge, center
+     *                          or right edge of the screen.
+     * @param aVerticalAlign    Vertical alignment mode. The vertical
+     *                          alignment mode determines if the used
+     *                          coordinates are relative to top-edge, vertical
+     *                          center or bottom of the screen.
+     */
+    IMPORT_C void SetAlign(THuiAlignHorizontal aHorizontalAlign,
+                           THuiAlignVertical aVerticalAlign);
+
+    /**
+     * Determines the horizontal align mode.
+     */
+    IMPORT_C THuiAlignHorizontal AlignHorizontal() const;
+
+    /**
+     * Determines the vertical align mode.
+     */
+    IMPORT_C THuiAlignVertical AlignVertical() const;
+
+    /**
+     * Draws a line of text. Creates a temporary text mesh, so this is not as
+     * efficient as calling DrawText on an existing mesh.
+     */
+    IMPORT_C virtual void DrawTextL(const TDesC& aText,
+                                    const THuiRealRect& aBounds,
+                                    TReal32 aShadow = 0) __SOFTFP;
+
+    /**
+     * Draws a single line of text using the current pen color, font, and
+     * alignment mode.
+     *
+     * @param aTextMesh  Text string.
+     * @param aBounds    Bounding box for the text.
+     * @param aShadow    Darkness of text shadow.
+     */
+    IMPORT_C virtual void DrawText(const CHuiTextMesh& aTextMesh,
+                                   const THuiRealRect& aBounds,
+                                   TReal32 aShadow = 0) __SOFTFP;
+
+    /**
+     * Draws an image using the current pen color and alignment mode.
+     *
+     * @param aImage  Image specification.
+     * @param aPos    Origin point. Relative to the selected alignment point,
+     *                @see SetAlign()
+     * @param aSize   Size of the image.
+     */
+    IMPORT_C virtual void DrawImage(const THuiImage& aImage,
+                                    const THuiRealPoint& aPos,
+                                    const THuiRealSize& aSize);
+
+    /**
+     * Draws two images using the current pen color and alignment mode.
+     * The images are combined using the current texture mode.
+     *
+     * @param aImage   Image specification.
+     * @param aImage2  Image specification.
+     * @param aPos     Origin point. Relative to the selected alignment point,
+     *                 @see SetAlign()
+     * @param aSize    Size of the image.
+     */
+    IMPORT_C virtual void DrawImages(const THuiImage& aImage,
+                                     const THuiImage& aImage2,
+                                     const THuiRealPoint& aPos,
+                                     const THuiRealSize& aSize);
+
+    /**
+     * Draws an image scaled to a specific size inside the bounds.
+     *
+     * @param aImage   Image specification.
+     * @param aSize    Size of the image.
+     * @param aBounds  Rectangle in which to place the image,
+     *                 based on alignment. @see SetAlign()
+     */
+    IMPORT_C virtual void DrawImage(const THuiImage& aImage,
+                                    const THuiRealSize& aSize,
+                                    const THuiRealRect& aBounds);
+
+    /**
+     * Draws two images scaled to a specific size inside the bounds.
+     * The images are combined using the current texture mode.
+     *
+     * @param aImage   First image specification.
+     * @param aImage2  Second image specification.
+     * @param aSize    Size of the image.
+     * @param aBounds  Rectangle in which to place the image,
+     *                 based on alignment. @see SetAlign()
+     *
+     * @todo If multitexturing is not supported, use two calls to
+     * DrawImage with suitable blending to achieve the same effect in
+     * two passes..
+     *
+     * Currently, if multitexturing is not supported, only the first
+     * image will be drawn.
+     */
+    IMPORT_C virtual void DrawImages(const THuiImage& aImage,
+                                     const THuiImage& aImage2,
+                                     const THuiRealSize& aSize,
+                                     const THuiRealRect& aBounds);
+
+    /**
+     * Draws an image, placing it inside the given bounds using the alignment
+     * settings.
+     */
+    IMPORT_C virtual void DrawImage(const THuiImage& aImage,
+                                    const THuiRealRect& aBounds);
+
+
+    /**
+     * Draws a rectangle with the current graphics context parameters.
+     *
+     * @param aRect  Rectangle to draw.
+     */
+    IMPORT_C virtual void DrawRect(const TRect& aRect) = 0;
+    
+    /**
+     * Draws a solid line of uniform thickness with the current graphics context parameters.
+     *
+     * @param aStart     Start of line.
+     * @param aEnd       End of line.     
+     * @param aThickness Thickness of line in pixels.
+     */
+    IMPORT_C virtual void DrawLine(const TPoint& aStart, const TPoint& aEnd, const TInt aThickness) = 0;
+
+    /**
+     * Draws a stretched image. 
+     * 
+     * You may define a starting and ending sections for the image that will 
+     * not be stretched. This is useful for example in drawing scrollbars with
+     * arrows on a single run where the center of the image is stretched,
+     * but the arrows at the ends are drawn unstretched.
+     *
+     * @param aMode        Stretch mode. 
+     * @param aImage       Image to draw stretched.
+     * @param aRect        Rectangle to fill.
+     * @param aStretchStartWidth  
+     * 					   Define width of unstretchable start section (left or 
+     * 					   upper section). The pixels in this section will not be
+     *                     stretched. Only the center section of the image
+     *                     (between aStartWidth and aEndWidth) gets stretched.
+     *                     Defaults to zero.
+     * @param aStretchEndWidth    
+     * 					   Define width of unstretchable end section (right or 
+     * 					   lower section). The pixels in this section will not be
+     *                     stretched. Only the center section of the image
+     *                     (between aStartWidth and aEndWidth) gets stretched.
+     *                     Defaults to zero.
+     */
+    IMPORT_C virtual void DrawStretchImage(TStretchMode aMode,
+                                           const THuiImage& aImage,
+                                           const THuiRealRect& aRect,
+                                           TInt aStretchStartWidth = 0,
+                                           TInt aStretchEndWidth = 0) = 0;
+
+    /**
+     * Draws edges with a color or using a texture.
+     *
+     * @param aOuterRect         The outer edge of the borders.
+     * @param aLeftBorderWidth   The visible width of the left border, 
+     * 							 the width is assumed to be pixel units 
+     * 							 inside from the respective edge 
+     * 							 border. Use 0.0 for no left border.
+     * @param aRightBorderWidth  The visible width of the right border, 
+     * 							 the width is assumed to be pixel units 
+     * 							 inside from the respective edge 
+     * 							 border. Use 0.0 for no right border.
+     * @param aTopBorderWidth    The visible height of the top border, 
+     * 							 the height is assumed to be pixel units 
+     * 							 inside from the respective edge 
+     * 							 border. Use 0.0 for no border.
+     * @param aBottomBorderWidth The visible height of the bottom border, 
+     * 							 the height is assumed to be pixel units 
+     * 							 inside from the respective edge 
+     * 							 border. Use 0.0 for no border.
+     * @param aBorderMode		 Border drawing mode, defines how the
+     * 							 image is streched to the borders.
+     * 							 aImage needs to be defined in order 
+     * 							 to this modes to be effective.
+     * @param aImage			 The image to be used to draw borders,
+     * 							 according to the border drawing mode.
+     * 							 If left NULL will use the current pen 
+     * 							 color to draw single-color borders.
+     */
+    IMPORT_C virtual void DrawBorders(const TRect& aOuterRect, 
+    						  TReal32 aLeftBorderWidth,
+                              TReal32 aRightBorderWidth, 
+    						  TReal32 aTopBorderHeight,
+                              TReal32 aBottomBorderHeight, 
+                              TBorderMode aBorderMode = EBorderImage,
+                              const THuiImage* aImage = 0) __SOFTFP = 0;
+
+
+    /**
+     * Draws a path from the beginning to aPos.
+     *
+     * @param aPath      Weighted path.
+     * @param aOrigin    Offset.
+     * @param aStartPos  Start position on the path.
+     * @param aEndPos    End position on the path.
+     * @param aAlphaFunction  Function for determining alpha values.
+     * @param aWidthFunction  Function for determining line thickness.
+     */
+    IMPORT_C virtual void DrawPath(const CHuiCurvePath& aPath,
+                          const TPoint& aOrigin,
+                          TReal32 aStartPos,
+                          TReal32 aEndPos,
+                          MHuiMappingFunction* aAlphaFunction = 0,
+                          MHuiMappingFunction* aWidthFunction = 0) __SOFTFP = 0;
+
+    /**
+     * Sets up the appropriate rendering mode and draws the mesh. The caller
+     * is responsible for setting up the transformation and projection.
+     *
+     * @param aMesh            Mesh to draw.
+     * @param aImage           Primary surface image.
+     * @param aSecondaryImage  Secondary surface image.
+     * @param aSecondaryAlpha  Alpha level of the secondary image.
+     */
+    IMPORT_C virtual void DrawMesh(const CHuiMesh& aMesh, 
+                          const THuiImage* aImage = 0,
+                          const THuiImage* aSecondaryImage = 0,
+                          TReal32 aSecondaryAlpha = 0.0) __SOFTFP = 0;
+
+    /**
+     * Draws a thick arc.
+     *
+     * @param aOrigin           Center of the arc.
+     * @param aRadius           Radius of the arc.
+     * @param aStart            Start angle of the arc (degrees).
+     * @param aEnd              End angle of the arc (degrees).
+     * @param aAnglePerSegment  Degrees per segment.
+     * @param aWidth            Width of the segment line.
+     * @param aImage            Texture to use on the segment line.
+     * @param aAlphaFunc        Angle (degrees) to alpha (0..1) mapping function.
+     * @param aAbsoluteAngleParm  If true, absolute angles given to alpha func.
+     */
+    IMPORT_C virtual void DrawArc(const TPoint& aOrigin, const TSize& aRadius,
+                                  TReal32 aStart, TReal32 aEnd, TInt aAnglePerSegment,
+                                  TReal32 aWidth, const THuiImage& aImage,
+                                  TReal32 (*aAlphaFunc)(TReal32)=0,
+                                  TBool aAbsoluteAngleParm = EFalse) __SOFTFP = 0;
+
+    /**
+     * Draws a gradient.
+     *
+     * @param aType        Direction of the gradient.
+     * @param aRect        Coordinates of the rectangle in which the gradient is drawn.
+     * @param aStartColor  Color of the gradient on the start edge.
+     * @param aEndColor    Color of the gradient on the end edge.
+     * @param aStartOpacity  Optional opacity for the start edge. Opacity is gradually
+     *                     interpolated as well.
+     * @param aEndOpacity  Optional opacity for the end edge.
+     * @param aTexCoords   Optional texture coordinates for the gradient rectangle.
+     *                     If this is NULL, texturing is disabled when the gradient is
+     *                     drawn. Otherwise, the currently bound texture is used as
+     *                     the texture in the gradient rectangle.
+     */
+    IMPORT_C virtual void DrawGradient(TGradientType aType, const TRect& aRect,
+                                       const TRgb& aStartColor, const TRgb& aEndColor,
+                                       TReal32 aStartOpacity = 1.0,
+                                       TReal32 aEndOpacity = 1.0,
+                                       const THuiRealRect* aTexCoords = 0) __SOFTFP = 0;
+
+    /**
+     * Returns the currently active font.
+     */
+    IMPORT_C THuiFont* Font();
+
+    /**
+     * Determines the near clip distance of the context.
+     */
+    IMPORT_C TReal32 NearClipDistance() const __SOFTFP;
+
+    /**
+     * Determines the far clip distance of the context.
+     */
+    IMPORT_C TReal32 FarClipDistance() const __SOFTFP;
+
+    /**
+     * Returns the FOV factor.
+     */
+    IMPORT_C TReal32 FovFactor() const __SOFTFP;
+
+    /**
+     * Determines the Z offset for 2D graphics so that they are projected
+     * correctly when using a 3D projection.
+     */
+    IMPORT_C TReal32 Offset2D() const __SOFTFP;
+
+    /**
+     * Sets a depth offset. The depth offset is used when drawing overlaid
+     * surfaces with the same Z coordinates. Normally the depth offset is
+     * always zero.
+     *
+     * @param aOffset  Offset units.
+     */
+    IMPORT_C virtual void SetDepthOffset(TInt aOffset) = 0;
+
+    /**
+     * Makes a screen capture of the graphics context's current content.
+     *
+     * @param aSize  Returns the size of the buffer.
+     * @return  Rgb888 version of the content. Caller must pop and destroy
+     *          the returned buffer.
+     */
+    IMPORT_C virtual TUint8* CaptureLC(TSize& aSize) const = 0;
+
+    /**
+     * Sets a transformation that is applied as the final step of projection.
+     * To remove the transformation, set to <code>NULL</code>.
+     *
+     * @param aWindowTransformation  Window transformation steps.
+     */
+    IMPORT_C void SetWindowTransformation(CHuiTransformation* aWindowTransformation);
+
+
+    // @TODO: Renderer pluginization change: Should these be pure virtual or not?
+    /**
+     * Enables transformations for clipping rects. Implementing this method in
+     * inherited classes is optional (if e.g. transformed clipping rectangles
+     * aren't supported)
+     *
+     * @param aEnable  To transform clipping rects or not.
+     */
+    IMPORT_C virtual void EnableTransformedClippingRects(TBool aEnable=ETrue);
+
+    /**
+     * Replace the current clipping rectangle. Implementing this method in
+     * inherited classes is optional (if e.g. transformed clipping rectangles
+     * aren't supported)
+     *
+     * @param aClipRect  Clipping rectangle in display coordinates.
+     * @param aTransformClipRect  If ETrue. new clipping rect is transformed before it is taken as current rect.
+     */
+    IMPORT_C virtual void SetClip(const TRect& aClipRect, TBool aTransformClipRect);
+
+    /**
+     * Transforms a dirty rectangle. Implementing this method in
+     * inherited classes is optional (if e.g. dirty rects aren't supported)
+     *
+     * @param aRect  Rectangle to transform.
+     */
+    IMPORT_C virtual void TransformDirtyRect(THuiRealRect& aRect);
+
+
+    /* Static methods. */
+
+    /**
+     * Determines the horizontal alignment used for text in the current locale.
+     * Applications can use this for any text whose placement should change
+     * depending on the locale.
+     *
+     * @return  Left or right alignment.
+     */
+    IMPORT_C static THuiAlignHorizontal LocaleTextAlignment();
+
+public:
+    
+    /**
+     * Notifies image (and its texture object if it exists) that it is currently being 
+     * drawn into the display as the given size. Image may use this information to
+     * resize itself to a more optimal size.
+     *
+     * @aImage Image that is drawn.
+     * @aRect Rect where image is drawn.
+     * 
+     */
+    IMPORT_C void NotifyImagePreferredSize(const THuiImage& aImage, THuiRealRect aRect);
+
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C CHuiGc();
+
+    /* Methods. */
+
+    /**
+     * Determines the projection viewport.
+     */
+    IMPORT_C TRect ProjectionViewport() const;
+
+    /**
+     * Determines the display area not affected by orientation.
+     */
+    IMPORT_C TRect RawDisplayArea() const;
+
+    /**
+     * Determines the current window transformation.
+     *
+     * @return  CHuiTransformation, or <code>NULL</code> if none defined.
+     */
+    IMPORT_C const CHuiTransformation* WindowTransformation() const;
+
+    /**
+     * Orients the rectangle back to the normal orientation.
+     */
+    IMPORT_C TRect UnOrientRect(const TRect& aOrientedRect) const;
+
+    /**
+     * Orients the region back to the normal orientation.
+     */
+    IMPORT_C void UnOrientRegion(TRegion& aOrientedRegion) const;
+    
+    /**
+     * Calculate offset using the current alignment mode.
+     *
+     * @param bounds  Size of the object being aligned.
+     *
+     * @return  Offset from top-left corner.
+     */
+    IMPORT_C TPoint AlignOffset(const TSize& aBounds) const;
+
+    /**
+     * Sets the current OpenGL color based on the current selected Pen
+     * color value.
+     */
+    IMPORT_C virtual void UpdateColor(TReal32 aAlphaFactor = 1.f) __SOFTFP = 0;
+
+    /**
+     * Draw the image.
+     *
+     * @param aImage    Image to draw.
+     * @param aTopLeft  Coordinates of the top left corner.
+     * @param aSize     Size of the image.
+     */
+    IMPORT_C virtual void DoDrawImage(const THuiImage& aImage, const THuiRealPoint& aTopLeft,
+                             const THuiRealSize& aSize) = 0;
+
+    /**
+     * Draws two images simultaneously. Requires at least two texture units.
+     *
+     * Segment count must match and sizes must match if using multiple segments.
+     * Otherwise nothing is drawn.
+     *
+     * @param aImage    Image to draw.
+     * @param aImage2   Secondary image to draw.
+     * @param aTopLeft  Coordinates for the top left corner.
+     * @param aSize     Size of the image.
+     */
+    IMPORT_C virtual void DoDrawImages(const THuiImage& aImage,
+                              const THuiImage& aImage2,
+                              const THuiRealPoint& aTopLeft,
+                              const THuiRealSize& aSize) = 0;
+
+
+protected: // New methods
+    
+    /**
+     * Provides expandability, helps keeping the binary compatibility. Since virtual
+     * table is now exported and this class is dll derivable and the implementation
+     * is more difficult to change, hence this method, which can provide additional
+     * extension APIs.
+     * 
+     * @param aExtensionUid     UID, which is being used for recognizing the extension
+     * @param aExtensionParams  Return pointer to the extension API, once recognized from the extension uid
+     */
+    IMPORT_C virtual void GcExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+    
+private:
+
+    RRegion* CreateRecycledRegion();
+
+    void DeleteRecycledRegion(RRegion* aRegion);
+
+protected:
+
+    /** Stack of clipping regions. In user coordinate space (oriented). */
+    RPointerArray<RRegion> iClipRegionStack;
+
+    /** Current clipping region. In user coordinate space (oriented). */
+    RRegionBuf<KHuiGcClipRegionGranularity> iClipRegion;
+
+private:
+
+    /** Private temp region for general purpose, used to avoid excessive allocations of RRegion heap objects */
+    mutable RRegionBuf<KHuiGcClipRegionGranularity> iTempRegion;
+
+    /** Recycled clipping region objects for performance reasons */
+    mutable RPointerArray<RRegion> iRecycledRegions;
+
+    /** Size and position of the display in normal orientation. */
+    TRect iDisplayArea;
+
+    /** Orientation of the display. */
+    TOrientation iOrientation;
+
+    /** Projection mode. */
+    TProjection iProjection;
+
+    /** Projection viewport. */
+    TRect iProjectionViewport;
+
+    TReal32 iNearClipDistance;
+
+    TReal32 iFarClipDistance;
+
+    TReal32 iFovFactor;
+
+    /** Not owned. */
+    CHuiTransformation* iWindowTransform;
+
+    /** Offset for the 3D projection frustum center. */
+    THuiRealPoint iFrustumOffset;
+
+    /** Pen color for drawing lines. */
+    TRgb iPenColor;
+
+    /** Pen alpha level for drawing lines. */
+    TUint8 iPenAlpha;
+
+    /** Horizontal alignment mode. */
+    THuiAlignHorizontal iAlignHorizontal;
+
+    /** Vertical alignment mode. */
+    THuiAlignVertical iAlignVertical;
+
+    /** Current font. Not owned.
+        Fonts are owned by the texture manager. */
+    THuiFont* iCurrentFont;
+
+    /** Completeness (0..1) of the frustum offset. This is used when adjusting
+        the perspective effect in 3D projection. A complete frustum offset
+        means that the perspective is fully local to the object being drawn
+        (i.e., the visual's center point). A completeness of zero means that
+        the perspective is always in the center of the display. */
+    TReal32 iFrustumOffsetCompleteness;
+
+    /** Rendering quality. */
+    THuiQuality iQuality;
+    
+    /** Clip region count held separately in case OOM happens */
+    TInt iClipRegionStackCount;
+    };
+
+#endif  // __HUIGC_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiGradientBrush.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,171 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines CHuiLinearGradientBrush - a Brush that is able to 
+*                draw linear color gradients.
+*
+*/
+
+
+
+#ifndef __HUIGRADIENTBRUSH_H__
+#define __HUIGRADIENTBRUSH_H__
+
+#include <e32base.h>
+#include <uiacceltk/HuiBrush.h>
+#include <uiacceltk/HuiSkin.h>
+#include <uiacceltk/HuiGc.h>
+#include <uiacceltk/HuiImage.h>
+
+
+/**
+ * Linear gradient brush. Draws a sequence of colors in a linear gradient.
+ */
+NONSHARABLE_CLASS(CHuiGradientBrush) : public CHuiBrush
+    {
+public:
+
+    /** Linear gradient directions. */
+    enum TDirection
+        {
+        EDirectionUp,
+        EDirectionRight,
+        EDirectionDown,
+        EDirectionLeft
+        };
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C static CHuiGradientBrush* NewL();
+
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     */
+    IMPORT_C static CHuiGradientBrush* NewLC();
+
+    /**
+     * Destructor.
+     */
+    ~CHuiGradientBrush();
+
+
+    /* Methods. */
+
+    /**
+     * Sets the gradient direction.
+     */
+    IMPORT_C void SetDirection(TDirection aDirection);
+
+    /**
+     * Replaces all colors with a single color.
+     *
+     * @param aColor    Solid color for the gradient.
+     * @param aOpacity  Opacity.
+     */
+    IMPORT_C virtual void SetColor(const TRgb& aColor, TReal32 aOpacity = 1.0) __SOFTFP;
+
+    /**
+     * Sets the image for the gradient. By default, no image is used. The image
+     * can be cleared with <code>SetImage(THuiImage())</code>.
+     *
+     * @param aImage  Image to use in the gradient.
+     */
+    IMPORT_C virtual void SetImage(const THuiImage& aImage);
+
+    /**
+     * Returns a color from the gradient.
+     */
+    IMPORT_C virtual TRgb Color(TInt aIndex) const;
+
+    /**
+     * Returns an opacity value from the gradient.
+     */
+    IMPORT_C virtual TReal32 Opacity(TInt aIndex) const __SOFTFP;
+
+    /**
+     * Returns the image of the gradient brush.
+     */
+    IMPORT_C virtual const THuiImage& Image() const;
+
+    /**
+     * Appends a new color for the entire gradient. The caller must
+     * append colors in the correct order, by ascending position.
+     *
+     * @param aPosition  Position of the color.
+     * @param aColor     Color at the position.
+     * @param aOpacity   Opacity at the position.
+     */
+    IMPORT_C virtual void AppendColorL(TReal32 aPosition, const TRgb& aColor,
+                                       TReal32 aOpacity = 1.0) __SOFTFP;
+
+    /**
+     * Draw the brush.
+     */
+    virtual void Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const;
+
+
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor.
+     */
+    CHuiGradientBrush();
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+
+private:
+
+    /* Private data */
+
+    /** One color in the gradient. */
+    struct SColor
+        {
+        /** Position in the range 0..1. */
+        TReal32 iPosition;
+
+        /** RGB color. */
+        TRgb iColor;
+
+        /** Opacity. */
+        TReal32 iOpacity;
+        };
+
+
+private:
+
+    /* Private methods */
+
+
+private:
+
+    /** Direction of a linear gradient. */
+    TDirection iDirection;
+
+    /** Array of gradient colors. */
+    RArray<SColor> iColors;
+
+    /** Image for the gradient. */
+    THuiImage iImage;
+
+    };
+
+#endif  // __HUIGRADIENTBRUSH_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiGridLayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,499 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition for CHuiGridLayout. Grid layouts allow specifying 
+*                the placement of child visuals within a fixed grid.
+*
+*/
+
+
+
+#ifndef __HUIGRIDLAYOUT_H__
+#define __HUIGRIDLAYOUT_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiLayout.h>
+
+
+/* Forward declarations */
+class CHuiEnv;
+class THuiMetric;
+
+/* Each dimension corresponds to a different axis for the grid blocks */
+enum THuiGridDimension
+    {
+    EHuiGridColumn = 0,
+    EHuiGridRow,
+    
+    EHuiGridSize
+    };
+
+/**
+ * These flags specify where pixel error is distributed in grid layout calculations.
+ * 
+ * If none of these flags are set, then the pixel positions of all children are calculated
+ * using reals, then floored to the nearest pixel. If, however, the children must all be
+ * the same pixel size, then the following flags can be set. They place extra pixels into
+ * the layout's paddings to make up the difference.
+ * The flags for increasing and decreasing paddings are
+ * mutually exclusive, but you can apply inner and outer padding flags at the same time. This
+ * will result in the error being distributed between inner and outer paddings in the same
+ * proportion as inner to outer padding. Eg: if inner padding is 10 and outer padding is 20, twice
+ * as many error pixels will be distributed to the outer padding.
+ *
+ * @see SetLayoutModeFlags
+ */
+enum THuiGridLayoutModeFlags
+    {
+    /** Automatically increases innerpaddings if needed */
+    EHuiGridIncreaseInnerPadding = 0x1,  // default
+ 
+    /** Automatically decreases innerpaddings if needed */
+    EHuiGridDecreaseInnerPadding = 0x2, // default  
+    
+    /** Automatically increases outerpaddings if needed */    
+    EHuiGridIncreaseOuterPadding = 0x4,  // default
+
+    /** Automatically decreases outerpaddings if needed */    
+    EHuiGridDecreaseOuterPadding = 0x8,  // default
+    };
+    
+/**
+ * CHuiGridLayout is a layout that allows visuals to be positioned within a 
+ * grid.
+ *
+ * To use this class, a grid layout is created of a desired width and height.
+ * Then, when visuals are added to grid layout, they will populate the grid.
+ * By default, all slots in a grid layout are of a uniform size, but the weighting
+ * of individual rows and columns can be modified, and can be specified using
+ * metric units.
+ * Slots will resize automatically as the grid layout size changes.
+ *
+ * The standard application grid is one example of a grid layout.
+ * 
+ */
+class CHuiGridLayout : public CHuiLayout
+    	{
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Construct a new grid layout and give its ownership to a control.
+     *
+     * @note Default expansion direction is vertical. See SetExpanding() to
+     * changed the direction.
+     * @note the columns and rows will be initialized with unit weights equal to 1, so that blocks 
+     * will all share even proportions of the available area to start with.
+     * @note in order to use a mixture of metric weights, or to set different weights, set rows 
+     * and columns to zero when calling this method, then use e.g. @c AppendWeightL to 
+     * subsequently populate the weights.
+     * 
+     * @param aOwnerControl  Owner control.
+     * @param aColumns       Number of columns in the grid.
+     * @param aRows          Number of rows in the grid.
+     * @param aParentLayout  Parent layout for the new grid layout.
+     */
+    IMPORT_C static CHuiGridLayout* AddNewL(CHuiControl& aOwnerControl, 
+                                            TInt aColumns, TInt aRows,
+                                            CHuiLayout* aParentLayout = 0);
+
+    IMPORT_C CHuiGridLayout(MHuiVisualOwner& aOwner);
+
+    /** From CHuiLayout, deriving class must implement base call */
+    IMPORT_C void ConstructL();
+    IMPORT_C ~CHuiGridLayout();
+
+    /* Methods inherited from CHuiLayout. */
+    IMPORT_C void SetSize(const THuiRealSize& aSize, TInt aTransitionTime=0);
+    IMPORT_C TInt ChildOrdinal(TInt aIndex);
+    IMPORT_C TBool ChildPos(TInt aOrdinal, TPoint& aPos);
+    IMPORT_C TBool ChildSize(TInt aOrdinal, TSize& aSize);
+    IMPORT_C TInt ChildRect(TInt aOrdinal, THuiRealRect& aRect);
+    IMPORT_C THuiXYMetric BaseUnit() const;
+    IMPORT_C void RemoveAndDestroyAllD();
+    IMPORT_C CHuiVisual* FindTag(const TDesC8& aTag);
+    IMPORT_C TInt Count() const;
+    IMPORT_C CHuiVisual& Visual(TInt aIndex) const;
+    IMPORT_C void SetPos(const THuiRealPoint& aPos, TInt aTransitionTime = 0);
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0);
+    IMPORT_C TBool PrepareDrawL();
+    IMPORT_C void Draw(CHuiGc& aGc) const;
+    IMPORT_C void DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect) const;
+    IMPORT_C TBool Changed() const;
+    IMPORT_C void ReportChanged();
+    IMPORT_C void ClearChanged();
+    IMPORT_C void NotifySkinChangedL();
+    IMPORT_C void ExpandRectWithContent(TRect& aRect) const;
+    IMPORT_C void VisualExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+   
+public: // new methods   
+        
+    /**
+     * Sets the number of columns in this grid layout.
+     * All weights are set to 1 (ie. each column is of an equal
+     * width).
+     *
+     * @param aColumnCount The number of columns.
+     */
+    IMPORT_C void SetColumnsL(TInt aColumnCount);
+    
+    /**
+     * Sets the number of rows in this grid layout.
+     * All weights are set to 1 (ie. each column is of an equal
+     * height).     
+     *
+     * @param aRowCount The number of rows.
+     */    
+    IMPORT_C void SetRowsL(TInt aRowCount);
+    
+    /**
+     * Sets the number and weights of columns in this grid layout.
+     * The caller specifies an array of relative weights to use for each
+     * column.
+     * Weights can be any integer, ie a column of weight 30 would
+     * be twice the width of a column of weight 15.
+     *
+     * @note this is equivalent to using metrics with unit type EHuiUnitWeight.
+     *
+     * @param aWeights An array containing weights for each column.
+     */    
+    IMPORT_C void SetColumnsL(const RArray<TInt>& aWeights);
+    
+    /**
+     * Sets the number and weights of rows in this grid layout.
+     * The caller specifies an array of relative weights to use for each
+     * row.
+     * Weights can be any integer, ie a row of weight 30 would
+     * be twice the height of a row of weight 15.
+     *
+     * @note this is the same as using metrics with unit type EHuiUnitWeight.
+     *
+     * @param aWeights An array containing weights for each row.
+     */    
+    IMPORT_C void SetRowsL(const RArray<TInt>& aWeights);
+
+        
+    /**
+     * Sets the number and weights of blocks in this grid layout in the direction of the specified
+     * dimension. Each block's weight will be set to equal the supplied value, the result
+     * of which is that all blocks will be equally spaced, whatever the units. 
+     *
+     * @since S60 3.2
+     *
+     * @see AppendWeightL for more information on how weights are used to calculate layout positions.
+     *
+     * @note This API could be useful if then subsequent calls to @c ReplaceWeightL are made to 
+     * change specific values, depending on how many of the values are different. 
+     * @note Calling this with aCount set to 0 will clear all of the existing weights in the direction
+     * of the specified dimension.
+     * @note this is the same as using metrics with unit type EHuiUnitWeight.
+     *
+     * @param aDim the dimension along which to fill
+     * @param aCount The number of lines of blocks to fill
+     * @param aWeight the weights to be used for all blocks
+     */    
+    IMPORT_C void FillWeightsL(THuiGridDimension aDim, TInt aCount, const THuiMetric& aWeight);
+
+    /**
+     * Add a new line of blocks to this grid layout at the last position in the direction of the 
+     * specified dimension. It will have the supplied weight. Weights can be any metric value, 
+     * hence different units can be used for each block. In particular, EHuiUnitWeight can be used 
+     * to represent weight values in aribtrary proportional units.
+     *
+     * In the case of proportional weights, the effect of this will be to cause the other blocks to 
+     * resize according to the new total weight.
+     *
+     * @since S60 3.2
+     *
+     * @note If non-relative coordinates are specified (e.g., real pixels), the combined blocks might not 
+     *      fill the entire layout area. However, weights will always stretch to fill all available space 
+     *      after the fixed units have been determined. Therefore, depending on circumstances it may
+     *      be better to use EHuiUnitWeight
+     * @note For example [2 weights, 1 weight, 2 weights] in a layout of 100 pixels would result 
+     *      in [40 pixels, 20 pixels, 40 pixels]. 
+     * @note For example [10 pixels, 1 weight, 15 pixels] in a layout of 100 pixels would result 
+     *      in [10 pixels, 75 pixels, 15 pixels]. 
+     *
+     * @param aDim the dimension to which the weight corresponds
+     * @param aWeight the weight to be used for the block in the specified dimension, 
+     *          replacing any previously existing weight for that block
+     */
+    IMPORT_C void AppendWeightL(THuiGridDimension aDim, const THuiMetric& aWeight);
+
+    /**
+     * Add a new line of blocks to this grid layout at the specified position in the direciton of 
+     * the specified dimension. It will have the supplied weight. In the case of proportional 
+     * weights, the effect of this will be to cause the other blocks to resize according to the new 
+     * total weight. It will also mean that many child visuals will now occupy different blocks within
+     * the grid according to how the blocks wrap.
+     *
+     * @since S60 3.2
+     *
+     * @note will leave if the specified position is greater than the number of objects currently in the array, 
+     * so check first by calling @c Count
+     * @see AppendWeightL for more information on how weights are used to calculate layout positions.
+     *
+     * @param aDim the dimension to which the weight corresponds
+     * @param aWeight the weight to be used for the block in the specified dimension, 
+     *          replacing any previously existing weight for that block
+     * @param aPos the index of the block
+     */
+    IMPORT_C void InsertWeightL(THuiGridDimension aDim, const THuiMetric& aWeight, TInt aPos);
+    /**
+     * Sets the weight of a specific line of blocks in this grid layout, in the direction of the supplied dimension.
+     * In the case of proportional weights, the effect of this will be to cause the 
+     * other blocks to resize according to the new total weight. 
+     *
+     * @since S60 3.2
+     *
+     * @see AppendWeightL for more information on how weights are used to calculate layout positions.
+     *
+     * @param aDim the dimension to which the weight corresponds
+     * @param aWeight the weight to be used for the block in the specified dimension, 
+     *          replacing any previously existing weight for that cell
+     * @param aPos the index of the cell
+     */
+    IMPORT_C void ReplaceWeightL(THuiGridDimension aDim, const THuiMetric& aWeight, TInt aPos);
+
+    /**
+     * Remove a line of blocks from this grid layout at the specified position in the 
+     * specified dimension. In the case of proportional weights, the effect of this will 
+     * be to cause the other blocks to resize according to the new total weight. It will also mean 
+     * that many child visuals will now occupy different blocks within the grid according to how 
+     * the blocks wrap.
+     *
+     * @since S60 3.2
+     *
+     * @see AppendWeightL for more information on how weights are used to calculate layout positions.
+     *
+     * @param aDim the dimension to which the weight corresponds
+     * @param aPos the index of the cell
+     */
+    IMPORT_C void RemoveWeightL(THuiGridDimension aDim, TInt aPos);
+
+    /**
+     * Returns the weight of a specific line of blocks in this grid layout, in the
+     * specified dimension. 
+     *
+     * @since S60 3.2
+     *
+     * @see AppendWeightL for more information on how weights are used to calculate layout positions.
+     *
+     * @param aDim the dimension to which the weight corresponds
+     * @param aPos the index of the cell
+     * @return the weight being used for the cell in the specified dimension, will be 0 magnitude if not set
+     */
+    IMPORT_C THuiMetric Weight(THuiGridDimension aDim, TInt aPos) const;
+        
+    /**
+     * Return the number of lines of blocks in this grid, along the specified dimension.
+     *
+     * @since S60 3.2
+     *
+     * @param aDim the dimension along which to count
+     * @return The number of lines of blocks in this grid.
+     */        
+    IMPORT_C TInt DimensionCount(THuiGridDimension aDim) const;
+    
+    /**
+     * Sets the expansion flags to the given bitfield, made up of
+     * bits from CHuiLayout::TExpansionFlags.
+      *
+     * With EExpandVertically, the filling starts from 
+     * top left corner (right if mirrored) and a row is filled 
+     * full before moving to the next row. If there are more items
+     * than rows*colums, they are layouted accordingly below the grid
+     * content area.
+     * 
+     * With EExpandHorizontally, the filling starts from 
+     * top left corner (right if mirrored) and a column is filled 
+     * full before moving to the next column. If there are more items
+     * than rows*colums, they are layouted accordingly on the right
+     * side (left if mirrored) of the content area of the grid.
+     *
+     * @param aFlags Determines the expansion direction.  
+     *
+     */
+    IMPORT_C void SetExpanding(TInt aFlags);
+    
+    /**
+     * Return the number of rows in this grid.
+     *
+     * @return The number of rows in this grid.
+     */
+    IMPORT_C TInt RowCount() const;
+
+    /**
+     * Return the number of columns in this grid.
+     *
+     * @return The number of columns in this grid.
+     */        
+    IMPORT_C TInt ColumnCount() const;
+
+    /**
+     * Calculates the (x,y) position of a child in the grid. Returns the block
+     * position, where block (0, 0) is in the top left corner (top right corner
+     * when the layout is mirrored).
+     *
+     * @param aOrdinal  Ordinal of a child.
+     *
+     * @return  Block position of the child.
+     */    
+    IMPORT_C TPoint OrdinalToBlock(TInt aOrdinal) const;
+
+    /**
+     * Sets flag(s) which alter the children's pixel error distribution within the grid layout.
+     *
+     * This method allows the client to force all items in the grid layout to be the same
+     * pixel size. The floating point error that this introduces is distributed between the various
+     * paddings of the layout.
+     * 
+     * Example of use that allows outer paddings to be automatically adjusted:
+     * \code
+     * iGridLayout->SetLayoutModeFlags(EHuiGridRow, EHuiGridAdjustOuterPadding); 
+     * \endcode
+     *
+     * Note that some flags are mutually exclusive, and will clear some existing flags if set.
+     *
+     * @param aDim the dimension to which the given flag(s) affect.
+     * @param aGridLayoutModeFlags Flags to be set or cleared
+     * @see TAlfGridLayoutModeFlags, ClearLayoutModeFlags
+     */          
+    IMPORT_C void SetLayoutModeFlags(THuiGridDimension aDim, TUint aGridLayoutModeFlags);
+
+    /**
+     * Clears flag(s) which alter the children's pixel error distribution within the grid layout.
+     *
+     * @param aDim the dimension to which the given flag(s) affect.
+     * @param aGridLayoutModeFlags Flags to be cleared
+     * @see TAlfGridLayoutModeFlags, SetLayoutModeFlags
+     */                
+    IMPORT_C void ClearLayoutModeFlags(THuiGridDimension aDim, TUint aGridLayoutModeFlags);    
+    
+    /**
+     * Return flag(s) which alter the children's pixel error distribution within the grid layout.
+     *
+     * @param aDim the dimension to return the flags for.
+     */
+    IMPORT_C TUint LayoutModeFlags(THuiGridDimension aDim);
+    
+public: // RnD utilities
+
+    IMPORT_C void GetClassName(TDes& aName) const;
+    IMPORT_C void DumpTree() const;
+    IMPORT_C void GetInstanceName(TDes& aName) const;
+    IMPORT_C TType Type() const;
+    IMPORT_C TInt SessionId() const;
+    IMPORT_C void SetSessionId(TInt aSessionId);
+
+
+private:
+    
+    /* Private methods */
+    
+    /**
+     * Checks if the grid filling order is from top right corner instead 
+     * the top left (default)
+     * 
+     * @return ETrue if the fillig is started from top right.
+     */
+    TBool UseRightToLeftFillingOrder() const;
+
+    /**
+     * Calculates the size and position along the specified axis according to the current weights. 
+     * The non-weights are resolved into pixels and the remainder after subtracting from InnerSize 
+     * is shared between the other cells that are specified using weight metrics.
+     *
+     * @note that this calculation assumes that the inner paddings have already been subtracted 
+     * from the inner size, and that they will be added back in when calculating the actual 
+     * position in base units.
+     * @note when called repeatedly by UpdateChildrenLayout, all the cells will be calculated for 
+     * each time UpdateChildLayout is called.
+     *
+     * @param aDim the dimension along which to calculate
+     * @param aIndex the block being calculated
+     * @param aAvailablePixels the space available within the grid layout, after the paddings and 
+     *      inner paddings have already been subtracted
+     * @param aPos the resulting position in pixels of the block along the axis (replaces contents)
+     * @param aSize the resulting size in pixels of the block along the axis (replaces contents)
+     * @param aFloorPixelPos the total width assuming every item width is floored.
+     * @param aCeilingPixelPos the total width assuming every item width is ceilinged.
+     */
+    void CalculateCellInPixelsReal(
+        THuiGridDimension aDim, 
+        TInt aIndex, 
+        TReal32 aAvailablePixels, 
+        TReal32& aPos, 
+        TReal32& aSize,
+        TInt& aFloorPixelPos,
+        TInt& aCeilingPixelPos) const;
+
+    /**
+     * Calculates the size and position along the specified axis according to the current weights. 
+     * The non-weights are resolved into pixels and the remainder after subtracting from InnerSize 
+     * is shared between the other cells that are specified using weight metrics.
+     * Returns integer pixel values, taking into account the TAlfGridLayoutModeFlags for error rounding.
+     *
+     * @param aDim the dimension along which to calculate
+     * @param aIndex the block being calculated
+     * @param aAvailablePixels the space available within the grid layout, after the paddings and 
+     *      inner paddings have already been subtracted
+     * @param aPos the resulting position in pixels of the block along the axis (replaces contents)
+     * @param aSize the resulting size in pixels of the block along the axis (replaces contents)
+     * @see CalculateCellInPixelsReal
+     */
+    void CalculateCellInPixels(
+        THuiGridDimension aDim, 
+        TInt aIndex, 
+        TReal32 aAvailablePixels, 
+        TInt& aPos, 
+        TInt& aSize) const;
+
+    /** 
+     * Calculate inner/outer distribution of padding.
+     * Interpolates between the previously calculated positions for
+     * inner padding and outer padding of the child, according to the
+     * proportion between inner and outer padding size.
+     *
+     * @param aDim the dimension along which to calculate
+     * @param aInnerPadPos the calculated position if inner padding is applied
+     * @param aOuterPadPos the calculated position if outer padding is applied
+     */
+    TReal32 CHuiGridLayout::ProportionalInnerOuterPadding(  
+        THuiGridDimension aDim,
+        TReal32 aInnerPadPos,
+        TReal32 aOuterPadPos) const;
+
+    /**
+     * Retrieve the weight and pixel size from a metric.
+     * Returns one or the other depending on what type the metric is.
+     * Zeroes unused params.
+     *
+     * @param aDim the dimension along which to calculate     
+     * @param aMetric The metric to examine
+     * @param aWeight Contains weight from metric.
+     * @param aPix Contains pixel size from metric.
+     */
+    void WeightFromMetric(THuiGridDimension aDim, THuiMetric& aMetric, TReal32& aWeight, TInt& aPix) const;
+
+private:
+    // Private data structure. Owned.
+    struct TGridLayoutPrivateData;
+    TGridLayoutPrivateData* iGridLayoutData;
+    
+    TAny* iSpare;
+    };
+	
+#endif  // __HUIGRIDLAYOUT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiImage.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,244 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Image specification. Specifies an area on a (segmented) texture object.
+*
+*/
+
+
+
+#ifndef __HUIIMAGE_H__
+#define __HUIIMAGE_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiTimedPoint.h>
+#include <uiacceltk/HuiTextureHandle.h>
+#include <uiacceltk/HuiTexture.h>
+
+
+/**
+ * Image specification. Specifies an area on a texture object.
+ *
+ * The texture to with THuiImage refers is expected to the implement 
+ * the MHuiSegmentedTexture interface.
+ */
+NONSHARABLE_CLASS(THuiImage)
+    {
+public:
+
+    /* Constructors. */
+
+    /** @beginAPI */
+
+    /**
+     * Default constructor, creates an empty THuiImage.
+     * @see SetTexture()
+     * @see SetTexCoords()
+     */
+    IMPORT_C THuiImage();
+
+    /**
+     * Constructor. Textures coordinates will be normalized to match the
+     * size of the texture, so that (1,1) is always the lower right corner.
+     * Note that the THuiImage instance stores a pointer to aTexture.
+     * aTexture must continue to exist for the entire lifetime of the
+     * THuiImage instance. For example, passing a temporary THuiTextureHandle 
+     * instance will result in a crash when the image's texture is accessed.
+     *
+     * @param aTexture  Texture being drawn.
+     *                  The texture is expected to the implement the 
+     *                  MHuiSegmentedTexture interface.
+     * @param aTlX      Top left X coordinate (normalized).
+     * @param aTlY      Top left Y coordinate (normalized).
+     * @param aBrX      Bottom right X coordinate (normalized).
+     * @param aBrY      Bottom right Y coordinate (normalized).
+     */
+    IMPORT_C THuiImage(const MHuiTexture& aTexture,
+                       TReal32 aTlX = 0.f, TReal32 aTlY = 0.f,
+                       TReal32 aBrX = 1.f, TReal32 aBrY = 1.f) __SOFTFP;
+
+
+    /**
+     * Constructor. Textures coordinates will be normalized to match the
+     * size of the texture, so that (1,1) is always the lower right corner.
+     * Note that the THuiImage instance stores a pointer to aTexture.
+     * aTexture must continue to exist for the entire lifetime of the
+     * THuiImage instance. For example, passing a temporary THuiTextureHandle 
+     * instance will result in a crash when the image's texture is accessed.
+     *
+     * @param aTexture  Texture being drawn.
+     *                  The texture is expected to be derived from CHuiTexture.
+     * @param aTlX      Top left X coordinate (normalized).
+     * @param aTlY      Top left Y coordinate (normalized).
+     * @param aBrX      Bottom right X coordinate (normalized).
+     * @param aBrY      Bottom right Y coordinate (normalized).
+     */
+    IMPORT_C THuiImage(const CHuiTexture& aTexture,
+                       TReal32 aTlX = 0.f, TReal32 aTlY = 0.f,
+                       TReal32 aBrX = 1.f, TReal32 aBrY = 1.f) __SOFTFP;
+
+
+    /**
+     * Returns the number of segments in this image.
+     */
+    IMPORT_C TInt SegmentCount() const;
+
+    /**
+     * Calculate vertex coordinates for an image segment.
+     *
+     * @param aOutTexCoords  The texture coordinates for a quad are output to
+     *                       this array, two coordinates (x,y) per corner point.
+     *                       Must have room for at least 8 TInt16s.
+     * @param aSegment       Image segment number to return the coordinates for.
+     *
+     * @see SegmentCount() to return the number of image segments in this image.
+     */
+    IMPORT_C void GetVertexCoords(TInt16* aOutCoords, TInt aSegment = 0) const;
+
+    /**
+     * Calculate actual texture coordinates for image segment.
+     *
+     * @param aOutTexCoords  The texture coordinates for a quad are output to
+     *                       this array, two coordinates (u,v) per corner point.
+     *                       Must have room for at least 8 TReal32s.
+     * @param aSegment       Image segment number to return the coordinates for.
+     *
+     * @see SegmentCount() to return the number of image segments in thiss image.
+     */
+    IMPORT_C void GetTexCoords(TReal32* aOutTexCoords, TInt aSegment = 0) const;
+
+    /**
+     * Sets the texture coordinates for the whole image.
+     * Raw coords flag is cleared.
+     */
+    IMPORT_C void SetTexCoords(TReal32 aTlX = 0.f, TReal32 aTlY = 0.f,
+                               TReal32 aBrX = 1.f, TReal32 aBrY = 1.f,
+                               TInt aTransitionTime = 0) __SOFTFP;
+
+    /**
+     * Determines the current texture coordinates of the top-left corner of
+     * this image.
+     */
+    IMPORT_C THuiRealPoint TopLeft() const __SOFTFP;
+
+    /**
+     * Determines the current texture coordinates of the bottom-right corner of
+     * this image.
+     */
+    IMPORT_C THuiRealPoint BottomRight() const __SOFTFP;
+
+    /**
+     * Determines if a texture has been specified for the image.
+     */
+    IMPORT_C TBool HasTexture() const;
+
+    /**
+     * Sets the texture of the image. 
+     *
+     * The texture is expected to the implement the MHuiSegmentedTexture interface.
+     */
+    IMPORT_C void SetTexture(const MHuiTexture& aTexture);
+
+    /**
+     * Sets the texture of the image. 
+     *
+     * The texture is expected to be derived from CHuiTexture.
+     */
+    IMPORT_C void SetTexture(const CHuiTexture& aTexture);
+
+    /**
+     * Returns the texture object associated with the image.
+     */
+    IMPORT_C const MHuiSegmentedTexture& Texture() const;
+
+    /**
+     * Returns the interface of the texture object associated with the image.
+     *
+     * @return  Reference to MHuiTexture. This interface can be queried for 
+     *          the implemented texture interfaces.
+     */
+    IMPORT_C const MHuiTexture& TextureIf() const;
+    
+    /**
+     * Determines if the texture has a shadow.
+     */
+    IMPORT_C TBool HasShadow() const;
+    
+    /**
+     * Returns the shadow texture object associated with the image.
+     *
+     * @return  NULL, if no shadow available.
+     */
+    IMPORT_C THuiTextureHandle ShadowTexture() const;
+
+    /**
+     * Apply an offset to the texture coordinates.
+     */
+    IMPORT_C void Translate(TReal32 aDx, TReal32 aDy, TInt aTransitionTime = 0) __SOFTFP;
+
+    /**
+     * Apply a scaling factor to the texture coordinates.
+     */
+    IMPORT_C void Scale(TReal32 aScaleX, TReal32 aScaleY, TInt aTransitionTime = 0) __SOFTFP;
+
+    /**
+     * Returns true if the image has changed since the last change
+     * notification. Changed means that the image is dirtied, and must
+     * be redrawn.
+     */
+
+	IMPORT_C TBool Changed() const;
+
+    /**
+     * Clears the changed status of the visual.
+     */
+	
+	IMPORT_C void ClearChanged();
+
+    /** @endAPI */
+
+    /**
+     * Returns pointer to the texture object associated with the image. 
+     *
+     * @return  Pointer to MHuiTexture object. May return NULL if no texture is
+     * associated with the image.
+     */
+    const MHuiTexture* ImageTexture() const;
+
+    /**
+     * Returns pointer to the texture object associated with the image. 
+     *
+     * @return  Pointer to CHuiTexture object. May return NULL if no texture is
+     * associated with the image or if the texture type is not derived from CHuiTexture. 
+     */
+    const CHuiTexture* ImageDefaultTexture() const;
+
+private:
+
+    /** Texture containing the image data. */
+    const MHuiTexture* iTexture;
+
+    /** Texture coordinates of the top left corner, for the whole image. */
+    THuiTimedPoint iTl;
+
+    /** Texture coordinates of the bottom right corner, for the whole image. */
+    THuiTimedPoint iBr;
+
+    /** Flags for internal use */
+    TInt iFlags;
+    
+    TInt iSpare2;
+    };
+
+#endif  // __HUIIMAGE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiImageBrush.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,239 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   A brush that is able to draw images.
+*
+*/
+
+
+
+#ifndef __HUIImageBrush_H__
+#define __HUIImageBrush_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiBrush.h>
+#include <uiacceltk/HuiSkin.h>
+#include <uiacceltk/HuiGc.h>
+#include <uiacceltk/HuiImage.h>
+#include <uiacceltk/HuiTimedPoint.h>
+#include <uiacceltk/HuiImageVisual.h>
+
+
+/**
+ * HuiImageBrush is a brush that can be used to attach (draw) images to
+ * visuals. For example: backgrounds, pop-up icons or other image-based
+ * decorations.
+ *
+ * Has also ability to stretch-fit the image to the area and draw borders.
+ * 
+ */
+NONSHARABLE_CLASS(CHuiImageBrush) : public CHuiBrush
+    {
+public:
+
+    /* Constructors and destructor. */
+    
+    /** @beginAPI */
+
+    /**
+     * Constructs a new image brush.
+     *
+     * @param aImage            Texture image for this brush.
+     */
+    IMPORT_C static CHuiImageBrush* NewL(const THuiImage & aImage);
+
+    /**
+     * Constructs a new image brush.
+     *
+     * @param aImage            Texture image for this brush.
+     * @note 					The new brush is left on the cleanup stack.
+     */
+    IMPORT_C static CHuiImageBrush* NewLC(const THuiImage & aImage);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C ~CHuiImageBrush();
+
+
+    /* Methods. */
+    
+    /**
+     * Sets the scaling mode for the bitmap.
+     * An unscaled image will be drawn at a 1:1 mapping between its
+     * texture and the screen. A scaled image will be resized to fit the
+     * visual's size exactly.
+     * If unset, the default is EScaleFit.
+     * 
+     * @param aScaleMode The scaling mode of this image visual.
+     *
+     * @see CHuiImageVisual::SetScaleMode()
+     */
+    IMPORT_C void SetScaleMode( CHuiImageVisual::TScaleMode aScaleMode );
+
+    /**
+     * Sets an image for this brush.
+     *
+     * @param aImage            Texture image for this brush.
+     * 
+     * @see SetBorders() 	    Call this if the image also includes 
+     * 							borders.
+     */
+    IMPORT_C void SetImage(const THuiImage& aImage);
+
+    /**
+     * Returns the image of the brush.
+     */
+    IMPORT_C const THuiImage& Image() const;
+
+	/**
+	 * Define widths and heights for the borders of this image brush.
+	 * 
+     * @param aLeftBorderWidth  Specifies if this image brush should also
+     * 							draw a left border. Positive values specify
+     * 							border the visuals left edge 
+     * 							(extending the effective area of the visual),
+     * 							negative values specify border inside the
+     * 							area defined by the visual (visuals effective 
+     * 							area is not extended).
+     * 
+     * 							Also the absolute value defines the width 
+     * 							of the left border section of the image, 
+     * 							in pixel columns. 
+     * 							
+     * 							Set to zero to draw without border.
+     *
+     * @param aRightBorderWidth Specifies if this image brush should also
+     * 							draw a right border. Positive values specify
+     * 							border outside the visuals right 
+     * 							edge (extending the effective area of the 
+     * 							visual), negative values specify border inside 
+     * 							the	area defined by the visual (visuals 
+     * 							effective area is not extended).
+     * 
+     * 							Also the absolute value defines the width 
+     * 							of the right border section of the image, 
+     * 							in pixel columns. 
+     * 							
+     * 							Set to zero to draw without border.
+     * 
+     * @param aTopBorderHeight  Specifies if this image brush should also
+     * 							draw a top border. Positive values specify
+     * 							border on top of the visuals top edge 
+     * 							(extending the effective area of the visual),
+     * 							negative values specify border inside the
+     * 							area defined by the visual (visuals effective 
+     * 							area is not extended).
+     * 
+     * 							Also the absolute value defines the height 
+     * 							of the top border section of the image, 
+     * 							in pixel rows. 
+     * 							
+     * 							Set to zero to draw without border.
+     *
+     * @param aBottomBorderHeight  Specifies if this image brush should also
+     * 							draw a bottom border. Positive values specify
+     * 							border below the visuals bottom edge 
+     * 							(extending the effective area of the visual),
+     * 							negative values specify border inside the
+     * 							area defined by the visual (visuals effective 
+     * 							area is not extended).
+     * 
+     * 							Also the absolute value defines the height 
+     * 							of the top border section of the image, 
+     * 							in pixel rows. 
+     * 							
+     * 							Set to zero to draw without border.
+     * 
+     * 
+	 */                           
+	IMPORT_C void SetBorders(TInt aLeftBorderWidth = 0,
+                             TInt aRightBorderWidth = 0,
+                             TInt aTopBorderHeight = 0,
+                             TInt aBottomBorderHeight = 0);
+
+	/**
+	 * Returns true if borders should be drawn.
+	 */
+	IMPORT_C TBool BorderDrawingEnabled() const;
+
+	/**
+	 * Returns true if center should be also be drawn (not just borders).
+	 */
+	IMPORT_C TBool CenterDrawingEnabled() const;
+
+    /** @endAPI */
+
+    // From CHuiBrush ..
+
+    IMPORT_C virtual void ExpandVisualRect(TRect& aRect) const;
+    
+    /**
+     * From CHuiBrush.
+     * @see CHuiBrush::Changed()
+    */
+    TBool Changed() const;
+    
+    /**
+     * From CHuiBrush.
+     * @see CHuiBrush::ClearChanged()
+    */
+    void ClearChanged();
+
+    IMPORT_C virtual void Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const;
+
+    virtual TInt Type2() const { return EImageBrush; }
+
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Protected constructor.
+     * @see NewL
+     * @see NewLC
+     */
+    CHuiImageBrush(const THuiImage& aImage);
+
+private:
+
+    /* Private variables. */
+
+    /** Image for this brush. */
+    THuiImage iImage;
+    
+    /** Scalingmode of the visual. */
+    CHuiImageVisual::TScaleMode iScaleMode;
+
+    /** Border width for the left border, in pixels. 0 means no border. */
+    TInt iLeftBorderWidth;
+    /** Border width for the right border, in pixels. 0 means no border. */
+    TInt iRightBorderWidth;
+    /** Border width for the top border, in pixels. 0 means no border. */
+    TInt iTopBorderWidth;
+    /** Border width for the bottom border, in pixels. 0 means no border. */
+    TInt iBottomBorderWidth;
+
+public:
+    /* Public properties. */
+    
+    /** Uniform scale factor for the image. */
+    THuiTimedValue iScale;
+
+    /** Texture offset. */
+    THuiTimedPoint iImageOffset;
+
+    };
+
+#endif  // __HUIImageBrush_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiImageLoaderUtil.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiImageLoaderUtil, a utility to load skin-able image/icon.
+*
+*/
+
+
+
+#ifndef __HUIIMAGELOADERUTIL_H__
+#define __HUIIMAGELOADERUTIL_H__
+
+#include <AknsUtils.h>
+#include <AknIconUtils.h>
+#include <uiacceltk/HuiTextureManager.h>
+
+
+class MHuiBitmapProvider;
+class CHuiImageLoader;
+
+/**
+ * CHuiImageLoaderUtil is a utility class to create image loader with the system skin 
+ * applied. CHuiImageLoaderUtil holds all MHuiBitmapProvider instance created through
+ * CreateImageLoaderL() so that appplication/control does not need to keep it by itself.
+ * 
+ * Typically, an application or a control needs to hold instance of CHuiImageLoaderUtil
+ * during entire its object life time, because bitmap provision callback from texture
+ * manager may be called even after instanciation of texture. For instance, image re-loading
+ * happens when application coming back to foreground and resource was released.
+ */
+class CHuiImageLoaderUtil: public CBase
+	{
+public:
+	/**
+	 * Constructor
+	 */
+	IMPORT_C CHuiImageLoaderUtil();
+
+	/**
+	 * Deconstructor
+	 */
+	IMPORT_C ~CHuiImageLoaderUtil();
+	
+	/**
+     * Create MHuiBitmapProvider instance to load image with Avkon skin item ID with 
+     * fallback. The fallback is used when the current skin does not contain the image with 
+     * skin item ID. If either fails, this leaves.
+     * Use CHuiTextureManager::CreateTextureL() with return value of this method as a
+     * bitmap provider to create a HUI texture.
+     *
+     * @param aID  An Akvon skin item ID of the graphical item (e.g. an icon) to load.
+     * @param aFileName  File name of graphics file e.g. mif file) when sepcified item is not found in the current skin.
+     * @param aBitmapId  ID of the bitmap when fallback is used.
+     * @param aMaskId  ID of the mask bitmap when fallback is used.
+     */
+	IMPORT_C MHuiBitmapProvider* CreateImageLoaderL(const TAknsItemID &aID, const TDesC &aFileName, TInt aBitmapId, TInt aMaskId);
+
+    /**
+     * Create MHuiBitmapProvider instance to load Application icon image.
+     * Use CHuiTextureManager::CreateTextureL() with return value of this method as a
+     * bitmap provider to create a HUI texture.
+     *
+     * @param aAppUid  Application UID of the icon to be created.
+     * @param aType  Type of the application icon. Likely EAknsAppIconTypeContext is used...
+     */
+	IMPORT_C MHuiBitmapProvider* CreateImageLoaderL(TUid aAppUid, TAknsAppIconType aType);
+
+
+    /**
+     * Set size of the image to be loaded. This must be called before calling CreateImageLoaderL.
+     * This call only sets information and does *NOT* cause any scalable icon rasterization. Also
+     * Size setting does not affect any of image loaders already created.
+     *
+     * @param aSize     Size in pixel.
+     * @param aMode     Scaling mode enumeration from Avkon. It takes either of following three.
+     *                    EAspectRatioPreserved
+     *                    EAspectRatioPreservedAndUnusedSpaceRemoved
+     *                    EAspectRatioNotPreserved
+     *
+     */
+	IMPORT_C void SetSize(TSize aSize, TScaleMode aMode=EAspectRatioPreserved);
+
+    /**
+     * Set skin instance, which is acquired from AknsUtils::SkinInstance(). If skin instance
+     * is not explicitly set with this method, the image loader will use skin instance from 
+     * AknsUtils::SkinInstance().
+     *
+     * @param aSkinInstance     An Avkon skin instamce.
+     */
+	IMPORT_C void SetSkinInstance(MAknsSkinInstance *aSkinInstance);
+
+    IMPORT_C virtual void ImageLoaderExtension(const TUid& aExtensionUid, TAny** aExtensionParamters );
+
+private:
+	/** Skin instance. */
+	MAknsSkinInstance *iSkinInstance;
+	
+	/** Size of image to be created */
+	TSize iSize;
+	
+	/** Scale mode of image to be created */
+	TScaleMode iScaleMode;
+	    
+protected:
+
+	/** An array to hold all loader created. */
+	RPointerArray<CHuiImageLoader> iImageLoaderList;
+
+private:
+
+    TAny* iSpare;
+	};
+
+
+class CHuiAutoSizeImageLoaderUtil : public CHuiImageLoaderUtil, public MHuiTextureAutoSizeObserver
+    {
+    // From MHuiTextureAutoSizeObserver
+    IMPORT_C virtual TBool PreferredSizeChanged(const CHuiTexture& aTexture, TInt aTextureId, const THuiRealSize& aPreferredSize);    
+    
+    // From MHuiTextureAutoSizeObserver
+    IMPORT_C virtual void PreferredSizeReportCompleted();        
+    };
+
+#endif // __HUIIMAGELOADERUTIL_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiImageVisual.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,343 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiImageVisual. CHuiImageVisual is a visual
+*                that is able to display images.
+*
+*/
+
+
+
+#ifndef __HUIIMAGEVISUAL_H__
+#define __HUIIMAGEVISUAL_H__
+
+
+#include <e32base.h>
+#include <gdi.h>
+#include <uiacceltk/HuiVisual.h>
+#include <uiacceltk/HuiImage.h>
+#include <uiacceltk/HuiGc.h>
+
+
+/* Forward declarations */
+class CHuiEnv;
+class CHuiControl;
+struct THuiMetric;
+struct THuiXYMetric;
+
+
+/**
+ * Image visual displays an image.
+ *
+ * @see THuiImage
+ * @see CHuiTexture
+ */
+NONSHARABLE_CLASS(CHuiImageVisual) : public CHuiVisual
+    {
+    /** @beginAPI */    
+    
+public:
+
+    /** Image scaling modes. */
+    enum TScaleMode
+        {
+        /** Image is not scaled. It will be drawn at a 1:1 mapping between its texture and the screen pixels.*/
+        EScaleNormal,
+
+        /** Image is uniformly scaled to fit the width of the visual's area. The aspect
+            ratio of the image is preserved. */
+        EScaleFitWidth,
+        
+        /** Image is uniformly scaled to fit the height of the visual's area. The aspect
+            ratio of the image is preserved. */
+        EScaleFitHeight,
+
+        /** Image is uniformly scaled to fit the visual's area so that the entire area
+            is covered. The aspect ratio of the image is preserved. */
+        EScaleCover,            
+        
+        /** Image is uniformly scaled to fit the visual's area. The aspect ratio of the 
+            image is not preserved. This is the default scale mode. It allows
+            full control of the appearance of the image by adjusting the 
+            visual's size. */
+        EScaleFit,
+        
+        /** Image is uniformly scaled to fit inside the visual's area. The aspect ratio 
+            of the image is preserved. */
+        EScaleFitInside
+        };
+
+    /** Color modes. */
+    enum TColorMode
+        {
+        /** Default color mode. */
+        EColorModulate,
+        
+        /** A dimmed color mode will apply fogging to this visual. */
+        EColorDimmed
+        };
+        
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructs and appends a new image visual to the owner control.
+     *
+     * @param aOwnerControl  Control that will own the new visual.
+     *
+     * @return  The new visual.
+     */
+    IMPORT_C static CHuiImageVisual* AddNewL(CHuiControl& aOwnerControl,
+                                             CHuiLayout* aParentLayout = 0);
+
+    /** @endAPI */
+    
+    /**
+     * Constructor.
+     *
+     * @param aOwner  Owner of the new visual.
+     */
+    CHuiImageVisual(MHuiVisualOwner& aOwner);
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+    /**
+     * Destructor.
+     */
+    virtual ~CHuiImageVisual();
+
+
+	/** @beginAPI */
+
+    /* Methods. */
+
+    /**
+     * Sets the scaling mode for the bitmap.
+     * An unscaled image will be drawn at a 1:1 mapping between its
+     * texture and the screen. A scaled image will be resized to fit the
+     * visual's size exactly.
+     * If unset, the default is EScaleFit.
+     * 
+     * @param aScaleMode The scaling mode of this image visual.
+     */
+    IMPORT_C void SetScaleMode(TScaleMode aScaleMode);
+
+    /**
+     * Sets the image displayed by the image visual. If no image
+     * has been set for the visual, the visual does not draw anything.
+     *
+     * @note You may call SetImage also with images(/textures) that have not
+     * been loaded (yet). The toolkit has been designed so that SetImage()
+     * can be called before the texture has been finished loading. In the
+     * meantime, a placeholder could be used. In other words, the CHuiTexture
+     * that the THuiImage refers to does need to exist but it doesn't have to
+     * be loaded yet.
+     *
+     * @note Redrawing of the visual happens automatically after SetImage() has
+     * been called.
+     * @note Redrawing also happens automatically when a texture has been fully
+     * loaded by the texture manager. The manager notifies the environment,
+     * which issues a full display redraw.
+     *
+     * @param aImage Primary image to be visualized.
+     * @see SetSecondaryImage()
+     */
+    IMPORT_C void SetImage(const THuiImage& aImage);
+
+    /**
+     * Sets the secondary image displayed by the image visual.
+     *
+     * The reason there are two images is to make crossfading simpler from
+     * the application's point of view. The blending ratio between the images
+     * is controlled with the timed value iSecondaryAlpha of CHuiImageVisual.
+     *
+     * If iSecondaryAlpha is zero (the default), the secondary image will not be
+     * drawn. When iSecondaryAlpha increases, the secondary image becomes
+     * gradually visible as its opacity increases.
+     *
+     * When crossfading is not needed, SetSecondaryImage() and iSecondaryAlpha
+     * can be ignored.
+     *
+     * @see SetImage()
+     * @see iSecondaryAlpha
+     */
+    IMPORT_C void SetSecondaryImage(const THuiImage& aImage);
+
+    /**
+     * Returns the image of the visual.
+     */
+    IMPORT_C const THuiImage& Image() const;
+
+    inline const THuiImage& SecondaryImage() const
+        {
+        return iSecondaryImage;
+        }
+
+    /**
+     * Sets the color of the image. Defaults to white.
+     */
+    IMPORT_C void SetColor(const TRgb& aColor);
+
+    /**
+     * Sets the color mode of the image. Defaults to modulate.
+     *
+     * @param aColorMode  Color mode.
+     * @param aParam      Parameter for the mode. With blend, specifies the
+     *                    amount of color to blend (0...1). 1.0 will cause
+     *                    the image to be fully blended to the visual's color.
+     */
+    IMPORT_C void SetColorMode(TColorMode aColorMode, TReal32 aParam = 0.0) __SOFTFP;
+
+    /**
+     * Sets the stretch widths of the image. Set both to zero to disable stretching.
+     * A stretched image will be scaled over the whole width or height of the visual,
+     * except for a band specified by the parameters, which will not be scaled (1:1 pixel mapping).
+     * For doing uniform scaling of an image, use the SetScaleMode API instead.
+     *
+     * @deprecated  Deprecated as an unneeded and broken functionality.
+     *
+     * @param aTop     Top width in pixels.
+     * @param aBottom  Bottom width in pixels.
+     * @see SetStretchMode.
+     * @see CHuiGc::DrawStretchImage
+     */
+    IMPORT_C void SetStretch(TInt aTop, TInt aBottom);
+
+    /**
+     * Sets the stretch mode of the image.
+     *
+     * @see CHuiGc::DrawStretchImage.
+     * @see Setstretch.
+     * @param aStretchMode  Horizontal or vertical.
+     */
+    IMPORT_C void SetStretchMode(CHuiGc::TStretchMode aStretchMode);
+
+    /**
+     * @deprecated Use CHuiDropShadow
+     *
+     * Sets the drop shadow distance.
+     *
+     * @deprecated  Use metric unit version instead
+     *
+     * @param aShadowDistance  Pixels.
+     */
+    IMPORT_C void SetDropShadow(TInt aShadowDistance);
+
+    /**
+     * @deprecated Use CHuiDropShadow
+     *
+     * Sets the drop shadow distance.
+     *
+     * @param aShadowDistance  Shadow distance in metric units. Both X and Y will get same value.
+     */
+    IMPORT_C void SetDropShadow(const THuiMetric& aShadowDistance);
+
+    /**
+     * @deprecated Use CHuiDropShadow
+     *
+     * Sets the drop shadow distance.
+     *
+     * @param aShadowDistance  Shadow distance in metric units.
+     */
+    IMPORT_C void SetDropShadow(const THuiXYMetric& aShadowDistance);
+    
+    /** @endAPI */
+
+
+    /**
+     * Draw the visual.
+     */
+    
+    void DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect) const;
+
+    TBool Changed() const;
+
+    void ClearChanged();
+
+    void GetClassName(TDes& aName) const
+        {
+        aName = _L("CHuiImageVisual");
+        }
+        
+    void ExpandRectWithContent(TRect& aRect) const;
+
+    TBool PrepareDrawL();
+
+private:
+
+    /* Private methods */
+
+
+private:
+
+    /** Image displayed by the visual. By default scaled to fit the visual. */
+    THuiImage iImage;
+
+    /** Secondary image displayed by the visual. */
+    THuiImage iSecondaryImage;
+
+    /** Scalingmode of the visual. */
+    TScaleMode iScaleMode;
+
+    /** Width of the top stretch. */
+    TInt iTopStretch;
+
+    /** Width of the bottom stretch. */
+    TInt iBottomStretch;
+
+    /** Stretch mode. */
+    CHuiGc::TStretchMode iStretchMode;
+
+    /** @todo  Use THuiTimedRgb. */
+    TRgb iColor;
+
+    /** Color mode, e.g., modulate or blend. */
+    TColorMode iColorMode;
+
+    /** Color parameter. When blend mode, specifies amount of blending applied. */
+    TReal32 iColorParam;
+
+    // @deprecated Use CHuiDropShadow
+    TInt iDropShadowDeprecated;
+
+
+public:
+
+    /* Public properties. */
+
+    /** Angle for turning the image around its center point. */
+    THuiTimedValue iTurnAngle;
+
+    /** Uniform scale factor for the image. */
+    THuiTimedValue iScale;
+
+    /** Relative offset for scaled images. */
+    THuiTimedPoint iOffset;
+
+    /** Alpha for the secondary image. If one, the primary image is not
+        visible at all. */
+    THuiTimedValue iSecondaryAlpha;
+
+private:
+
+    
+    // @deprecated Use CHuiDropShadow
+	THuiXYMetric iDropShadow;
+
+    };
+
+#endif  // __HUIIMAGEVISUAL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiInteractionInterval.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   THuiInteractionInterval is a utility class that can be used 
+*                as specify intervals that adapt to user input.
+*
+*/
+
+ 
+
+#ifndef __HUIINTERACTIONINTERVAL_H__
+#define __HUIINTERACTIONINTERVAL_H__
+
+
+#include <e32base.h>
+
+
+/**
+ * THuiInteractionInterval is a utility class that can be used to determine
+ * the correct animation interval time, while taking into account how much time has
+ * elapsed since the last time the interval was determined. 
+ *
+ * An interaction interval is useful for example when animating a list selector. By default,
+ * the time interval for moving between two items could be 500 ms, but if
+ * the user moves faster than this, the selector's animation may be 
+ * unnecessarily delayed. In this situation, the interaction interval would
+ * shorten the time interval for the moving animation, if necessary, to keep
+ * better in sync with how quickly the user is moving in the list.
+ */
+class THuiInteractionInterval 
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Initializes the interaction interval.
+     *
+     * @param aScalar  Determines how strongly the interval adapts. 
+     *
+     * @see SetScalar()
+     */
+    IMPORT_C THuiInteractionInterval(TReal32 aScalar = 2.0f) __SOFTFP;
+
+
+    /* Methods. */
+
+    /**
+     * Sets the adaptation scalar. Determines how strongly the interval
+     * will adapt to the elapsed time since the last evaluation.
+     *
+     * For example, 1.0 would mean that the maximum interval time is the 
+     * time elapsed between the current evaluation and the
+     * previous one. In this case, when the animation frequency 
+     * stays the same, each sequence would have time to complete
+     * before the next sequence begins. When the scalar is 2.0, the
+     * maximum is twice the elapsed time, meaning that the 
+     * ongoing animation sequence would always be finished halfway 
+     * when the next sequence begins. This produces a smoother
+     * end result.
+     *
+     * @param aScalar  New adaptation scalar.
+     */
+    IMPORT_C void SetScalar(TReal32 aScalar) __SOFTFP;
+    
+    /**
+     * Returns the current adapation scalar.
+     *
+     * @return Adaptation scalar.
+     */
+    IMPORT_C TReal32 Scalar() const __SOFTFP;
+
+    /**
+     * Evaluates the current interval. The evaluated interval will always 
+     * be at least as large as the elapsed time since the last evaluation, 
+     * but at most <code>aIntervalTime</code>. 
+     *
+     * @param aIntervalTime  The requested normal interval time.
+     *
+     * @return  The evaluated interval, effective during the current frame.
+     *
+     * @see SetScalar()
+     */
+    IMPORT_C TInt Interval(TInt aIntervalTime);
+    
+    
+private:
+
+    /** Interval scalar. */
+    TReal32 iScalar;
+    
+    /** Last time interaction interval was determined. */
+    TUint32 iLastTimeMs;
+
+    };
+
+
+#endif  // __HUIINTERACTIONINTERVAL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiLayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,751 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines CHuiLayout class. Layouts are visuals that manage 
+*                the placement of a set of child visuals.
+*
+*/
+
+
+
+#ifndef __HUILAYOUT_H__
+#define __HUILAYOUT_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiVisual.h>
+#include <uiacceltk/huimetric.h>
+
+/* Forward declarations */
+class CHuiEnv;
+class CHuiControl;
+
+
+/** Layout types. */
+enum THuiLayoutType
+    {
+    EHuiLayoutTypeLayout,
+    EHuiLayoutTypeFlow,
+    EHuiLayoutTypeGrid,
+    EHuiLayoutTypeApp,
+    EHuiLayoutTypeAnchor
+    };
+
+/**
+ * Layouts are visuals that manage the placement of a set of child visuals
+ * (or other layouts).
+ *
+ * Layouts are responsible for setting the positions and sizes of their
+ * child visuals. Each layout can define a position, a size, or both
+ * (or neither) for their children.
+ *
+ * Layouts use the children's ordinal numbers to determine where each of
+ * them should be placed. For example, a grid layout could define that the
+ * top row contains children with ordinals 0..3, from left to right. The
+ * second row could then contain the children 4..7. When the order of the
+ * child visuals changes within their parent layout, the parent layout
+ * will recalculate the positions and sizes of the affected children.
+ *
+ * When the size of a layout changes, it will immediately recalculate the
+ * layout of its children. The transition time that is specified in the
+ * size transition of the layout is used when setting the targets of the
+ * children's new positions and sizes.
+ *
+ * Layouts are able to notify their controls when their size is changed.
+ * These notifications are needed because the size of a layout is not known
+ * until the display is refreshed. This means that the <strong>size of a layout
+ * is not available when your controls ConstructL is executed</strong>, unless
+ * it is explicitly set. The notifications are also handy because they allow
+ * the controls to respond to dynamic screen size changes. So unless if the
+ * whole screen is not used for the layout, the notifications are the only way
+ * to do calculations based on the layout size.
+ *
+ * To make the control receive layout update notifications call:
+ *
+ * <code>
+ * layout->SetFlags(EHuiVisualFlagLayoutUpdateNotification);
+ * </code>
+ *
+ * .. and override VisualLayoutUpdated() method in your control.
+ *
+ * @see SetSize()
+ * @see SetFlags()
+ * @see CHuiControl::VisualLayoutUpdated()
+ *
+ * Each layout defines its own local coordinate system used for interpreting
+ * the positions and sizes of its child visuals. The base unit of the 
+ * coordinate system is defined with the SetBaseUnit() method, which sets a
+ * THuiXYMetric to use as the basis for all coordinate calculations. The default
+ * metric is [1px, 1px] which corresponds to pixels on the display.
+ *
+ * The local coordinate system of a layout can be mirrored horizontally and/or
+ * vertically by using a negative magnitude in the relevant THuiMetric of the
+ * base unit. Note that this will only affect the local coordinate system 
+ * of the layout: the contents of the child visuals or child layouts will not 
+ * be mirrored. Visual mirroring should be done with a CHuiTransformation,
+ * and child layouts can be mirrored by further application of the negative
+ * base unit metrics. In order to enable a layout to automatically mirror the 
+ * horizontal component of the base unit based on locale mirroring, set the visual flag 
+ * @c EHuiVisualFlagAutomaticLocaleMirroringEnabled, note that it is necessary
+ * to set this flag for each layout for which this feature is required.
+ *
+ * To create to a fully scalable UI, the appropriate base unit metrics and
+ * layout visuals must be used. For example, the EHuiUnitS60 metric unit is
+ * dependent on the platform-specified measurement units for layout. 
+ * CHuiGridLayout and CHuiAnchorLayout provide support for pixel-independent 
+ * placement of their children.
+ *
+ * @see CHuiAnchorLayout
+ * @see CHuiGridLayout
+ *
+ * Applications that need more complex layouts should derive their own
+ * CHuiLayout based classes that implement the necessary layout calculations.
+ * In many cases, however, a combination of some of the built-in layout classes
+ * such as anchor and grid layouts will be sufficient.
+ */
+class CHuiLayout : public CHuiVisual
+    {
+public:
+
+    enum TExpansionFlags
+        {
+        /** Not expanding in any direction. */
+        EExpandNone = 0,
+
+        /** Expands horizontally. */
+        EExpandHorizontally = 1,
+
+        /** Expands vertically. */
+        EExpandVertically = 2
+        };
+
+
+    /** @beginAPI */
+
+    /* Constructors and destructor. */
+
+    /**
+     * Construct a new basic layout and give its ownership to a control.
+     * Note that CHuiLayout has no real layout functionality: its children
+     * must be laid out manually.
+     *
+     * @param aOwnerControl  Owner control.
+     * @param aParentLayout  Parent layout for the new layout.
+     */
+    IMPORT_C static CHuiLayout* AddNewL(CHuiControl& aOwnerControl,
+                                        CHuiLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C CHuiLayout(MHuiVisualOwner& aOwner);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C ~CHuiLayout();
+
+    /**
+     * Second-phase constructor from CHuiVisual, must be called in deriving class
+     */
+    IMPORT_C void ConstructL();
+
+
+
+    /* Methods. */
+
+    /**
+     * From CHuiVisual. Removes this layout from its owner and and destroys the layout.
+     * Also removes the entire hierarchy of child visuals and destroys all
+     * of them.
+     */
+    IMPORT_C void RemoveAndDestroyAllD();
+
+    /**
+     * From CHuiVisual. Finds a visual whose tag descriptor contains a specific tag.
+     * Checks self first, then looks through the child visuals.
+     *
+     * CHuiLayout::FindTag() extends upon the basic implementation
+     * in CHuiVisual::FindTag() by adding recursive visual hierarchy
+     * searching.
+     *
+     * @param aTag  Tag to look for. If this tag is found as a part of a
+     *              visual's colon-separated tag descriptor, it is treated
+     *              as a match and the visual is returned.
+     *              The tag to look for cannot contain separator characters (:).
+     *
+     * @return  Visual whose tag descriptor matches the tag. <code>NULL</code>,
+     *          if no such visual could be found. If a visual is returned,
+     *          it will either be this visual or one of its descendants.
+     *
+     * @see CHuiVisual::Tag()
+     * @see CHuiVisual::SetTagL()
+     * @see CHuiVisual::IsTagged()
+     * @see CHuiVisual::FindTag()
+     */
+    IMPORT_C CHuiVisual* FindTag(const TDesC8& aTag);
+
+    /**
+     * Append a new visual to the layout. If the visual is already a member of
+     * some other layout, it will be removed from the old layout first.
+     *
+     * @param aVisual  Visual to append.
+     * @param aLayoutTransitionTime How long the transition should take visually, in milliseconds.     
+     *
+     * @todo  Add a method for appending multiple visuals in one set, so that
+     *        they only cause a single layout update.
+     */
+    IMPORT_C void AppendL(CHuiVisual* aVisual, TInt aLayoutTransitionTime = 0);
+
+    /**
+     * Insert a new visual to the layout, at specified position (position 0 is the first,
+     * Count() -1 is the last). If the visual is already a member of
+     * some other layout, it will be removed from the old layout first.
+     *
+     * @param aVisual  Visual to append.
+     * @param TInt     Position to insert. This is the new ordinal number of the visual.
+     * @param aLayoutTransitionTime How long the transition should take visually, in milliseconds.     
+     */
+    IMPORT_C void InsertL(CHuiVisual* aVisual, TInt aPosition, TInt aLayoutTransitionTime = 0);
+
+    /**
+     * Remove a visual from the layout.
+     *
+     * @param aVisual  Visual to remove.
+     * @param aLayoutTransitionTime How long the transition should take visually, in milliseconds.     
+     * @todo  Add a method for removing multiple visuals in one set, so that
+     *        they only cause a single layout update.
+     */
+    IMPORT_C void Remove(CHuiVisual* aVisual, TInt aLayoutTransitionTime = 0);
+
+    /**
+     * From CHuiVisual. Returns the number of child visuals in the layout.
+     */
+    IMPORT_C TInt Count() const;
+
+    /**
+     * From CHuiVisual. Returns a child visual.
+     *
+     * @param aIndex  Index of the child visual.
+     *
+     * @return  Reference to a child visual.
+     */
+    IMPORT_C CHuiVisual& Visual(TInt aIndex) const;
+
+    /**
+     * Finds a visual's index.
+     *
+     * @param aVisual  Visual to look for.
+     *
+     * @return  Index of the visual, or <code>KErrNotFound</code>.
+     */
+    IMPORT_C TInt FindVisual(const CHuiVisual* aVisual) const;
+
+    
+     /**
+     * From CHuiVisual. Sets the position of the layout.
+     * @param aPos             Target position, in the local coordinate system as
+     *                         defined by the parent layout (or the display, 
+     *                         if there is no parent).
+     * @param aTransitionTime  Transition time in milliseconds.
+     */
+    IMPORT_C void SetPos(const THuiRealPoint& aPos, TInt aTransitionTime = 0);
+
+    /**
+     * From CHuiVisual. Change the size of the layout. Children's positions and sizes are
+     * updated accordingly. Each layout class is responsible for determining
+     * how to update children's layout.
+     *
+     * @param aSize                 Size to set the layout to.
+     * @param aLayoutTransitionTime How long the transition should take visually, in milliseconds.     
+     */
+    IMPORT_C void SetSize(const THuiRealSize& aSize, TInt aTransitionTime = 0);
+
+    /**
+     * From CHuiVisual. Update the layout of all children. Subclasses can call this to
+     * recalculate the layout of all children.
+     *
+     * @param aTransitionTime  Time for layout transition.
+     */
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0);
+
+
+    /**
+     * New virtual method. Update the layout of one child visual.
+     *
+     * @param aIndex           Child visual index.
+     * @param aTransitionTime  Time for layout transition.
+     */
+    IMPORT_C virtual void UpdateChildLayout(TInt aIndex, TInt aTransitionTime = 0);
+
+    /**
+     * Sets the inner padding of the layout. This is typically the amount
+     * of empty space between child visuals in the layout.
+     *
+     * @param aInnerPadding  Inner padding (e.g., column, row separation).
+     */
+    IMPORT_C void SetInnerPadding(const TPoint& aInnerPadding);
+
+    /**
+     * Sets the inner padding of the layout. This is typically the amount
+     * of empty space between child visuals in the layout. 
+     *
+     * @note as paddings are relative to the layout visual, if relative units are required, 
+     * it is advisable to use EHuiUnitRelativeToMySize so that the paddings are relative
+     * to the size of this layout visual
+     *
+     * @param aInnerPadding  Inner padding, using metrics.
+     */
+    IMPORT_C void SetInnerPadding(const THuiXYMetric& aInnerPadding);
+
+    /**
+     * Returns the current inner padding.
+     */
+    IMPORT_C const THuiXYMetric& InnerPadding() const;
+
+    /**
+     * Returns the inner horizontal padding. 
+     * @deprecated This is useless, use InnerPaddingInBaseUnits() instead.
+     */
+    IMPORT_C TInt HorizontalInnerPadding() const;
+
+    /**
+     * Returns the inner vertical padding.
+     * @deprecated This is useless, use InnerPaddingInBaseUnits() instead.
+     */
+    IMPORT_C TInt VerticalInnerPadding() const;
+
+    /**
+     * Returns the inner padding converted to the base units of this layout.
+     * These can be summed with the positions and sizes of the layout's children.
+     */
+    IMPORT_C THuiRealPoint InnerPaddingInBaseUnits() const __SOFTFP;
+
+    /**
+     * Enables or disables scrolling in the layout. An offset
+     * for the origin of the layout can be defined using 
+     * ScrollOffset() - method and manipulating the THuiTimedPoint
+     * returned by that method.
+     * 
+     * Scroll offset, unlike other layout parameters, is not directly applied 
+     * to layout children when UpdateChildrenLayout() is called. Instead, the 
+     * scroll offset is taken into consideration when individual child visual 
+     * display rectangles are calculated. This way the scroll offset is directly 
+     * applied to dirty rectangle calculations as well as to visual content
+     * rectangle calculations when visuals are drawn.
+     *
+     * @param aScrolling  <code>ETrue</code> to enable scrolling,
+     *                    <code>EFalse</code> to disable.
+     */
+    IMPORT_C void EnableScrollingL(TBool aScrolling = ETrue);
+
+    /**
+     * Indicates whether scrolling is enabled in this layout.
+     * @see EnableScrolling()
+     *
+     * @return ETrue if scrolling is enabled, EFalse otherwise.
+     */
+    IMPORT_C TBool Scrolling() const;
+
+    /**
+     * Returns the scroll offset of the layout. The scroll offset is in
+     * layout's base units. The scroll offset has to be enabled before this 
+     * method is called.
+     * @see EnableScrollingL()
+     *
+     * @return  Reference to timed point that defines the scroll offset.
+     *
+     * @panic THuiPanic::ELayoutNotScrolling  Scrolling is not enabled.
+     */
+    IMPORT_C THuiTimedPoint& ScrollOffset();
+    IMPORT_C const THuiTimedPoint& ScrollOffset() const;
+    
+    /**
+     * Specifies the scroll offset of this layout. The scroll offset
+     * is defined in layout's base units. The scroll offset has to be 
+     * enabled before this method is called.
+     * @see BaseUnit()
+     * @see EnableScrollingL()
+     *
+     * @param aOffset Offset in layout's base units.
+     * @param aTransitionTime Time when the offset is to be reached in milliseconds.
+     */
+    IMPORT_C void SetScrollOffsetInBaseUnits(const THuiRealPoint& aOffset, TInt aTransitionTime = 0);
+
+    /**
+     * Determines the virtual size of the layout. The virtual size may be
+     * larger than the actual size. The virtual size is updated automatically
+     * when the layout's children are positioned.
+     *
+     * @return  Virtual size.
+     *
+     * @panic THuiPanic::ELayoutNotScrolling  Scrolling is not enabled.
+     */
+    IMPORT_C TSize VirtualSize() const;
+
+    /**
+     * Layout is calculated according the ordinals. The effective ordinal
+     * may not be the same as the real child ordinal, because some visuals
+     * are laid out manually.
+     *
+     * @return  Effective ordinal for the child visual.
+     *
+     * @panic  THuiPanic::ELayoutChildVisualNotFound  aVisual is not a child
+     *         of this layout.
+     */
+    IMPORT_C TInt EffectiveLayoutOrdinal(const CHuiVisual& aVisual) const;
+
+    /**
+     * Moves the given child visual to specific position in the layout's list
+     * of child visuals. Affects the drawing order (last child is drawn last),
+     * and possibly the final laid out position and size of the visual.
+     * This is due to that many layout implementations calculate the
+     * positioning of their children based on child's order number
+     * in the list.
+     *
+     * Causes layout recalculation.
+     *
+     * @param aVisual    Child visual to move.
+     * @param aPosition  New position (and ordinal number)
+     * 					 in the child list (0 = first, Count()-1 = last).
+     * @param aLayoutTransitionTime How long the transition should take visually, in milliseconds.
+     * @see MoveVisualToBack()
+     * @see MoveVisualToFront()
+     */
+    IMPORT_C void Reorder(CHuiVisual& aVisual, TInt aPosition, TInt aLayoutTransitionTime = 0);
+
+    /**
+     * Moves a child visual to the front of the other children. In other words
+     * the visual is drawn last (on top of the other child visuals). In practise
+     * this affects the order of the visuals whithin this layout so that the
+     * visual is moved at the end of the list.
+     *
+     * Causes layout recalculation.
+     *
+     * @param aVisual  Child visual to move.
+     * @see MoveVisualToBack()
+     * @see Reorder()
+     * @param aLayoutTransitionTime How long the transition should take visually, in milliseconds.     
+     *
+     * @see MoveVisualToFront() - Use this instead!
+     */
+    IMPORT_C void MoveVisualToFront(CHuiVisual& aVisual, TInt aLayoutTransitionTime = 0);
+
+
+    /**
+     * Moves a child visual behind the other children (in drawing order).
+     * In other words the visual is drawn first (the other child visuals will
+     * be drawn on top of this visual).
+     *
+     * In practise this affects the order
+     * of the visuals whithin this layout so that the visual is moved at
+     * the beginning of the list (ordinal 0).
+     *
+     * @param aVisual  Child visual to move.
+     * @param aLayoutTransitionTime How long the transition should take visually, in milliseconds.     
+     * @see MoveVisualToFront()
+     * @see Reorder()
+     */
+    IMPORT_C void MoveVisualToBack(CHuiVisual& aVisual, TInt aLayoutTransitionTime = 0);
+
+    /**
+     * Notifies children of the change in the environment's skin.
+     */
+    IMPORT_C void NotifySkinChangedL();
+
+    /**
+     * Sets the transition time for the recalculation of this layout's
+     * contents. This is used when a visual is added or removed or when
+     * the order of the children is changed.
+     *
+     * You need to set the EHuiVisualFlagManualTransitionTime flag of this
+     * visual before this setting has any effect. This flag overrides the
+     * layout transition time hierarchy and uses a local value instead.
+     *
+     * @param aTransitionTime  Transition time in milliseconds.
+     *
+     * @see CHuiLayout::SetTransitionTime()     
+     * @see CHuiVisual::SetFlag()     
+     * @see EHuiVisualFlagManualTransitionTime
+     */
+    IMPORT_C void SetTransitionTime(TInt aTransitionTime);
+
+    /**
+     * Returns the transition time of this layout.
+     *
+     * @return  Transition time in milliseconds, or
+     *          KHuiLayoutDefaultTransitionTime.
+     *
+     * @see CHuiLayout::SetTransitionTime()
+     * @see CHuiVisual::SetFlag()     
+     * @see EHuiVisualFlagManualTransitionTime     
+     */
+    IMPORT_C TInt TransitionTime() const;
+
+    /**
+     * Determines the layout ordinal for a child visual. The child's placement
+     * depends on the ordinal number.
+     *
+     * @param aIndex  Index of the child visual.
+     */
+    IMPORT_C virtual TInt ChildOrdinal(TInt aIndex);
+
+	/**
+	 * From CHuiVisual. Prepares all children of this layout for 
+	 * drawing. The preparation is done in drawing 
+	 * order.
+	 * 
+	 * Actually this default implementation is not
+	 * leaving, since it traps the prepare errors
+	 * inside and handles the errors by calling
+	 * the visual owners "prepare draw failed" 
+	 * -callback.
+	 * 
+	 * @return ETrue if the prepare succeeded, or EFail if 
+	 * the prepare failed. Failing to prepare a draw 
+	 * terminates the screen refresh and drawing 
+	 * for the current frame.
+	 * 
+	 * @see MHuiVisualOwner::VisualPrepareDrawFailed()
+	 */
+	IMPORT_C TBool PrepareDrawL();	
+    /**
+     * From CHuiVisual. Draws (renders) this layout. 
+     * 
+     * The default implementataion applies transformations 
+     * (affects the positions of the layout), draws brushes
+     * and of course children.
+     * 
+     * Layout clipping is not affected by transformation.
+     * 
+     * @todo Clipping doesn't work if there is a transformation?
+     * @todo No need to draw children that won't be visible.
+     */
+    IMPORT_C void Draw(CHuiGc& aGc) const;
+
+    /**
+     * From CHuiVisual. Called to inform the display that a dirty region has to be defined.
+     *
+     * Forward the notification request to all the child visuals.
+     * Scrolling causes changed reports from the layout itself.
+     */
+    IMPORT_C void ReportChanged();
+
+    /** From CHuiVisual */
+    IMPORT_C void ClearChanged();
+
+    /** From CHuiVisual */
+    IMPORT_C TBool Changed() const;
+
+    /** From CHuiVisual */
+    IMPORT_C void DumpTree() const;
+
+    /**
+     * Defines the base unit used for positioning and sizing children
+     * within this layout. For example, the actual X position of a child is 
+     * determined by <tt>aBaseUnit.iX * childX</tt>. The effect of the 
+     * base unit is limited to the children of this layout -- the 
+     * grandchildren use the base units of their parents, not this base unit.
+     * 
+     * @note It is recommended to use EHuiUnitNormalized if proportional base units are 
+     * required. For example, EHuiUnitRelativeToMySize would not make sense as a base 
+     * unit.
+     *
+     * @param aMetric  Metric that will be used for both X and Y axes.
+     */
+    IMPORT_C void SetBaseUnit(const THuiMetric& aBaseUnit);
+
+    /**
+     * Defines the base unit used for positioning and sizing children
+     * within this layout. For example, the actual X position of a child is 
+     * determined by <tt>aBaseUnit.iX * childX</tt>. The effect of the 
+     * base unit is limited to the children of this layout -- the 
+     * grandchildren use the base units of their parents, not this base unit.
+     * 
+     * @param aMetric  Metric to use as the base unit.
+     */
+    IMPORT_C void SetBaseUnit(const THuiXYMetric& aBaseUnit);
+    
+    /**
+     * Returns the layout's base measurement unit. The positions and sizes
+     * of the children of this layout are interpreted as multiples of this
+     * base unit.  For example, the actual X position of a child is 
+     * determined by <tt>aBaseUnit.iX * childX</tt>. 
+     *
+     * The effect of the base unit is limited to the children of this layout 
+     * -- the grandchildren use the base units of their parents, not this 
+     * base unit.
+     *
+     * @note that if the visual flag @c EHuiVisualFlagAutomaticLocaleMirroringEnabled
+     * is set, the value returned by this method will change based on the current platform
+     * locale mirroring in the X-axis. So for example if the current layout is mirrored, then
+     * the value returned by this method will have the X magnitude set to the negative
+     * of the value that was set using @c SetBaseUnit.
+     *
+     * @return Metric used as the base unit for child coordinates and sizes.
+     */
+    IMPORT_C virtual THuiXYMetric BaseUnit() const;
+
+
+    /** @endAPI */
+
+
+    /**
+     * Calculate the bounding rectangle for the layout. The rectangle is
+     * calculated in the base units of the layout, i.e. it is calculated
+     * using unconverted the child coordinates and sizes.
+     *
+     * @return  Bounding rectangle: the smallest rectangle inside which
+     *          all the children of this layout can fit.
+     */
+    THuiRealRect BoundingRect() const;
+
+    /**
+     * Calculate the size of the inner area (bounds without outer padding).
+     * The size is calculated in the base units of this layout, so that
+     * children can be positioned within the layout based on this size.
+     *
+     * @return  Width and height of the inner area, in base units of 
+     *          this layout.
+     */
+    IMPORT_C THuiRealSize InnerSize() const __SOFTFP;
+    
+    /**
+     * Calculates the top left corner of the inner area (bounds without
+     * outer padding). The point is calculated in the base units of this
+     * layout, so that the children can be positioned within the layout
+     * based on this point.
+     *
+     * @return  Top left corner point of the inner area, in base units
+     *          of this layout.
+     */
+    IMPORT_C THuiRealPoint InnerTopLeft() const __SOFTFP; 
+
+    /** @beginAPI */
+
+    /**
+     * New virtual method. Determines the size of a child visual according to the layout.
+     * The child size is determined using the base units of the layout.
+     * Derived layout classes should refer to InnerSize() and InnerTopLeft()
+     * to determine the area suitable for placing children into.
+     *
+     * @param aOrdinal  Layout ordinal of the child visual.
+     * @param aSize     New target size for the child. This goes to 
+     *                  CHuiVisual::SetSize() with no conversions.
+     *
+     * @return  <code>ETrue</code>, if a new size was determined. Otherwise,
+     *          <code>EFalse</code> is returned and no size changes are
+     *          needed.
+     */
+    IMPORT_C virtual TBool ChildSize(TInt aOrdinal, TSize& aSize);
+
+    /**
+     * New virtual method. Determines the position of a child visual according to the layout.
+     * The child position is determined using the base units of the layout.
+     * Derived layout classes should refer to InnerSize() and InnerTopLeft()
+     * to determine the area suitable for placing children into.
+     *
+     * @param aOrdinal  Layout ordinal of the child visual.
+     * @param aPos      New position for the child. This goes to 
+     *                  CHuiVisual::SetPos() with no conversions.
+     *
+     * @return  <code>ETrue</code>, if a new position was determined.
+     *          Otherwise, <code>EFalse</code> is returned and no position
+     *          changes are needed.
+     */
+    IMPORT_C virtual TBool ChildPos(TInt aOrdinal, TPoint& aPos);
+
+
+    enum EHuiLayoutChildRect
+        {
+        THuiLayoutChildRectNotImplemented = -1,
+        THuiLayoutChildRectUpdateNotNeeded = 0,
+        THuiLayoutChildRectPosUpdateNeeded = 1,
+        THuiLayoutChildRectSizeUpdateNeeded = 2,
+        THuiLayoutChildRectLayoutUpdateNeeded = THuiLayoutChildRectPosUpdateNeeded | THuiLayoutChildRectSizeUpdateNeeded
+        };
+        
+    /**
+     * New virtual method.  Determines the position and size of a child visual according to the layout.
+     * The child position is determined using the base units of the layout.
+     * Derived layout classes should refer to InnerSize() and InnerTopLeft()
+     * to determine the area suitable for placing children into.
+     *
+     * @param aOrdinal  Layout ordinal of the child visual.
+     * @param aRect      New position for the child. This is used to set
+     *                          the child size and position with no conversions.
+     *
+     * @return one of the values belonging to EHuiLayoutChildRect as follows:
+     *      THuiLayoutChildRectNotImplemented -  method not implemented, ChildPos and ChildSize to be called as previously
+     *      THuiLayoutChildRectUpdateNotNeeded - method is implemented, but aRect was not calculated; child pos/size are not modified
+     *      THuiLayoutChildRectPosUpdateNeeded - method is implemented, but only iTl was calculated (pos)
+     *      THuiLayoutChildRectSizeUpdateNeeded - method is implemented, but only size was calculated (iTl will be returned as 0)
+     *      THuiLayoutChildRectLayoutUpdateNeeded - method is implemented and aRect was calculated
+     *
+     */
+    IMPORT_C virtual TInt ChildRect(TInt aOrdinal, THuiRealRect& aRect);
+
+
+    /** @endAPI */
+
+
+public: // From CHuiVisual. 
+
+
+    IMPORT_C TReal32 BrushOpacity() const __SOFTFP;
+
+    IMPORT_C THuiRealRect BrushRect() const __SOFTFP;
+
+    IMPORT_C CHuiSkin& BrushSkin() const;
+
+protected:
+     /**
+     * From CHuiVisual. Overridden by subclasses to draw the content of the visual.
+     * By default DrawSelf does not draw anything.
+     */
+    IMPORT_C void DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect) const;
+
+    /**
+     * Calculate the metric reference for this layout, relative to this layout's 
+     * base units.
+     *
+     * @param aLayout this parameter is no longer used, an alternative method is provided that does not take this parameter
+     * @param aMetric the metric for which we need a reference value
+     */
+    IMPORT_C THuiRealPoint MetricReferenceForLayoutInPixels(const CHuiLayout* aLayout, const THuiXYMetric& aMetric) const __SOFTFP;
+    IMPORT_C THuiRealPoint MetricReferenceForLayoutInPixels(const THuiXYMetric& aMetric) const __SOFTFP;
+    
+    IMPORT_C void ExpandRectWithContent(TRect& aRect) const;
+
+    /** ! From HuiVisual */
+    IMPORT_C void VisualExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+    TBool EffectIsAppliedToChildren() const;
+
+public: // RnD utilities from CHuiVisual
+    IMPORT_C void GetInstanceName(TDes& aName) const;
+    IMPORT_C void GetClassName(TDes& aName) const;
+    IMPORT_C TType Type() const;
+    IMPORT_C TInt SessionId() const;
+    IMPORT_C void SetSessionId(TInt aSessionId);
+
+private:
+     
+    TBool HasActiveChilderen() const;
+    void DrawStoredBitmap(CHuiGc &aGc) const;
+protected:
+    struct THuiLayoutPrivateData;
+    THuiLayoutPrivateData* iHuiLayoutPrivateData; // owned
+    };
+
+#endif  // __HUILAYOUT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiLayouts.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Convenience header for including all of the HUITK layouts. 
+*
+*/
+
+
+
+#include <uiacceltk/HuiLayout.h>
+#include <uiacceltk/HuiAnchorLayout.h>
+#include <uiacceltk/HuiDeckLayout.h>
+#include <uiacceltk/HuiCurvePathLayout.h>
+#include <uiacceltk/HuiFlowLayout.h>
+#include <uiacceltk/HuiGridLayout.h>
+#include <uiacceltk/huiviewportlayout.h>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiLineVisual.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,186 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines CHuiLineVisual, Visual that is able to draw lines 
+*                onto a curve path. 
+*
+*/
+
+
+
+#ifndef __HUILINEVISUAL_H__
+#define __HUILINEVISUAL_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiVisual.h>
+#include <uiacceltk/HuiImage.h>
+#include <uiacceltk/HuiOwnedPointer.h>
+#include <uiacceltk/HuiCurvePath.h>
+#include <uiacceltk/HuiGc.h>
+#include <uiacceltk/HuiMappingFunctions.h>
+
+
+/* Forward declarations */
+class CHuiEnv;
+class CHuiControl;
+
+
+/**
+ * Line visual draws a line along a curve path.
+ *
+ * A line visual will draw a bendy line that follows a specified
+ * curve path. Width and alpha functions can be set to change the
+ * opacity and thickness of the line along its length.
+ *
+ * Note that the Bitgdi renderer contains only a minimal implementation
+ * of line drawing. There is no aliasing or shading on the line, and
+ * thickness and alpha functions have no effect. The entire thickness of a Bitgdi
+ * line is set by the initial thickness at point 0.
+ *
+ * @see CHuiCurvePath
+ */
+NONSHARABLE_CLASS(CHuiLineVisual) : public CHuiVisual
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructs and appends a new text visual to the owner control.
+     *
+     * @param aOwnerControl  Control that will own the new visual.
+     *
+     * @return  The new visual.
+     */
+    IMPORT_C static CHuiLineVisual* AddNewL(CHuiControl& aOwnerControl,
+                                            CHuiLayout* aParentLayout);
+
+    /**
+     * Constructor.
+     */
+    CHuiLineVisual(MHuiVisualOwner& aOwner);
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+    /**
+     * Destructor.
+     */
+    virtual ~CHuiLineVisual();
+
+
+    /* Methods. */
+
+    /**
+     * Sets the path instance of the visual.
+     *
+     * @param aPath
+     * @param aOwnership
+     */
+    IMPORT_C void SetPath(CHuiCurvePath* aPath, THuiOwnership aOwnership);
+
+    /**
+     * Returns the path of the visual. The path can be modified via this
+     * reference.
+     */
+    IMPORT_C CHuiCurvePath& Path();
+
+    virtual TBool Changed() const;
+
+    virtual void ClearChanged();
+
+    /**
+     * Sets the image used by the line.
+     */
+    IMPORT_C void SetImage(const THuiImage& aImage);
+
+    /**
+     * Sets the alpha mapping function that generates alpha values for the
+     * path.
+     */
+    IMPORT_C void SetAlphaFunction(MHuiMappingFunction* aFunction);
+
+    /**
+     * Sets the width mapping function that generates width values for the
+     * path.
+     */
+    IMPORT_C void SetWidthFunction(MHuiMappingFunction* aFunction);
+
+     /**
+     * Sets the color of the line.
+     *
+     * @param aColor           Line color.
+     */
+    IMPORT_C void SetColor(const TRgb& aColor);
+
+    /**
+     * Draw the curve path.
+     */
+    virtual void DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect) const;
+    
+    /**
+     * Expand dirty region
+     */
+    void ExpandRectWithContent(TRect& aRect) const;
+
+private:
+
+    /* Private methods */
+
+
+private:
+
+    /** The path of the visual. */
+    RHuiOwnedPointer<CHuiCurvePath> iPath;
+
+    /** Image used by the line. */
+    THuiImage iImage;
+
+    /** Value mapping function that generates alpha values for path
+        positions. */
+    MHuiMappingFunction* iAlphaFunction;
+
+    /** Custom width mapping function. */
+    MHuiMappingFunction* iWidthFunction;
+
+    /** Determines the width of the line. Depends on the current value
+        of iThickness. */
+    mutable THuiConstantMappingFunction iDefaultWidthFunction;
+
+public:
+
+    /* Public properties. */
+
+    /** Thickness of the line. */
+    THuiTimedValue iThickness;
+
+    /** Thickness of the shadow around the line. */
+    THuiTimedValue iShadowThickness;
+
+    /** Current start position on the path. */
+    THuiTimedValue iStartPos;
+
+    /** Current end position on the path. */
+    THuiTimedValue iEndPos;
+
+private:
+
+    /** Line color */
+    TRgb iColor;
+    };
+
+#endif  // __HUILINEVISUAL_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiMappingFunctions.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,203 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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-purpose mapping functions.
+*
+*/
+
+
+ 
+#ifndef __HUIMAPPINGFUNCTIONS_H__
+#define __HUIMAPPINGFUNCTIONS_H__
+
+
+#include <uiacceltk/HuiTimedValue.h>
+
+/**
+* The parameters of each mapping function are declared and 
+* accessed as public for convenience.  To preserve binary 
+* compatiblity, avoid making changes to these classes.
+*/
+
+/**
+ * Constant value mapping function. 
+ *
+ * Does not implement change flags, which means that if iValue is changed 
+ * while the mapping function is in use, timed values will not notify the 
+ * change.
+ */
+class THuiConstantMappingFunction : public MHuiMappingFunction
+    {
+public:
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C THuiConstantMappingFunction(TReal32 aValue = 0.0) __SOFTFP;
+    
+    /* implements MHuiMappingFunction */
+    IMPORT_C TReal32 MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP;
+    
+
+public:
+
+    /* Parameters. */
+    
+    TReal32 iValue;
+    
+    };
+
+
+/**
+ * Linear mapping function.
+ *
+ * Does not implement change flags, which means that if iFactor or iOffset 
+ * is changed while the mapping function is in use, timed values will 
+ * not notify the change.
+ */
+class THuiLinearMappingFunction : public MHuiMappingFunction
+    {
+public:
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C THuiLinearMappingFunction(TReal32 aFactor = 1.0, TReal32 aOffset = 0.0) __SOFTFP;
+    
+    /* implements MHuiMappingFunction */
+    IMPORT_C TReal32 MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP;
+        
+    
+public:
+
+    /* Parameters. */
+    
+    /** Multiply by a factor. */
+    TReal32 iFactor;
+    
+    /** Apply offset after multiplication. */
+    TReal32 iOffset;    
+    
+    };
+
+
+/**
+ * Sine mapping function.
+ *
+ * Does not implement change flags, which means that if iFactor or iOffset 
+ * is changed while the mapping function is in use, timed values will 
+ * not notify the change.
+ */
+class THuiSineMappingFunction : public MHuiMappingFunction
+    {
+public:    
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C THuiSineMappingFunction(TReal32 aFactor = 1.0, TReal32 aOffset = 0.0) __SOFTFP;
+
+    /* implements MHuiMappingFunction */
+    IMPORT_C TReal32 MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP;
+
+
+public:
+
+    /* Parameters. */
+    
+    TReal32 iFactor;
+    
+    TReal32 iOffset;            
+    
+    };
+    
+    
+/**
+ * Cosine mapping function.
+ * 
+ * Does not implement change flags, which means that if iFactor or iOffset 
+ * is changed while the mapping function is in use, timed values will 
+ * not notify the change.
+ */    
+class THuiCosineMappingFunction : public MHuiMappingFunction
+    {
+public:
+    
+    /**
+     * Constructor.
+     */
+    IMPORT_C THuiCosineMappingFunction(TReal32 aFactor = 1.0, TReal32 aOffset = 0.0) __SOFTFP;
+
+    /* implements MHuiMappingFunction */
+    IMPORT_C TReal32 MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP;
+    
+
+public:    
+        
+    /* Parameters. */
+    
+    TReal32 iFactor;
+    
+    TReal32 iOffset;            
+        
+    };
+    
+    
+/**
+ * Weighted average function between two other mapping functions.
+ * By default calculates the average of the two functions.
+ */    
+class THuiAverageMappingFunction : public MHuiMappingFunction
+    {
+public:
+    
+    /**
+     * Constructor. 
+     *
+     * @param aFunc1  Function 1.
+     * @param aFunc2  Function 2.
+     */
+    IMPORT_C THuiAverageMappingFunction(MHuiMappingFunction* aFunc1 = 0, MHuiMappingFunction* aFunc2 = 0);
+
+
+    /* Implements MHuiMappingFunction. */
+    
+    IMPORT_C TReal32 MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP;
+    
+    IMPORT_C TBool MappingFunctionChanged() const;
+    
+    IMPORT_C void MappingFunctionClearChanged();
+
+
+public:
+
+    /* Parameters. */
+    
+    /** First mapping function to average with. */
+    MHuiMappingFunction* iFunc1;
+    
+    /** Second mapping function to average with. */    
+    MHuiMappingFunction* iFunc2;
+            
+    /** Defaults to 0.5. Applied to the sum of the functions 1 and 2. */            
+    THuiTimedValue iFactor;                
+            
+    /** Weight. 0.0 means function 2 does not contribute to the result, 1.0 
+        means that function 1 does not contribute to the result. The default
+        is 0.5, which means both functions contribute equally. */
+    THuiTimedValue iWeight;        
+            
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiMaterial.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIMATERIAL_H__
+#define __HUIMATERIAL_H__
+
+
+#include <gdi.h>
+#include <uiacceltk/HuiImage.h>
+#include <uiacceltk/HuiTimedValue.h>
+
+    
+/** Surface material. */    
+enum THuiMaterialPreset
+    {
+    /** Material that uses custom parameters. */
+    EHuiMaterialCustom,
+    
+    EHuiMaterialChrome,
+    EHuiMaterialPlastic,
+    EHuiMaterialGlass,
+    EHuiMaterialBrushedMetal,
+    EHuiMaterialTexture,
+    EHuiMaterialShadow
+    };
+
+
+
+/**
+ * THuiMaterial describes the appearance properties of a surface material.
+ * Used with 3D objects.
+ */
+struct THuiMaterial
+    {
+
+    /**
+     * Default constructor for initializing the struct.
+     */
+    IMPORT_C THuiMaterial();
+
+    /** Preset type. */
+    THuiMaterialPreset iPreset;
+    
+    /** Color. */
+    TRgb iColor;
+    
+    /** Image used as the texture for the surface. */
+    THuiImage iTextureImage;
+    
+    /** Image used as the specular reflection for the surface. */
+    THuiImage iSpecularImage;
+
+    /** Strength of specular reflections. */
+    THuiTimedValue iSpecular;
+    
+private:
+
+    TInt iSpare1;
+    TInt iSpare2;
+    
+    };
+
+
+#endif // __HUIMATERIAL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiMesh.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,204 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIMESH_H__
+#define __HUIMESH_H__
+
+
+#include <e32base.h>
+#include <gdi.h>
+
+#include <uiacceltk/HuiImage.h>
+#include <uiacceltk/HuiTimedValue.h>
+#include <uiacceltk/HuiMaterial.h>
+#include <uiacceltk/HuiSessionObject.h>
+#include <uiacceltk/HuiRealRect.h>
+
+
+/* Forward declarations. */
+class CHuiGc;
+
+/**
+ * Mesh types.
+ * These types can be used in NewL to create a concrete
+ * mesh object from the supported set.
+ */
+enum THuiMeshType
+    {
+    /** Procedural mesh. @see CHuiProceduralMesh */
+    EHuiMeshTypeProcedural,
+    
+    /** M3G mesh. @see CHuiM3GMesh */
+    EHuiMeshTypeM3G
+    };
+
+
+/**
+ * CHuiMesh is the base class for all 3D meshes. It also definces few
+ * simpliest 3D manipulation interfaces that applications can use to 
+ * manipulate meshes. It is possible to instantiate CHuiMesh 
+ * itself, but the resulting mesh instance will have no functionality. 
+ * Thus it can be used as a dummy instance in rendering plugins that do 
+ * not support drawing of 3D meshes.
+ */
+NONSHARABLE_CLASS(CHuiMesh) : public CBase, public MHuiSessionObject
+    {
+public:    
+
+    /* Constructors and destructors. */
+
+    /**
+     * Constructs a new mesh instance. Applications call this to create new
+     * mesh instances. The implementation of the returned mesh instance 
+     * depends on the active renderer. This method does not return CHuiMesh
+     * object but an object derived from CHuiMesh.
+     *
+     * @param  aMeshType  CHuiMesh derived concrete mesh type.
+     *
+     * @return  Concrete implementation of CHuiMesh.
+     */
+    IMPORT_C static CHuiMesh* NewL(THuiMeshType aMeshType);
+    
+    /**
+     * Constructs a new mesh instance and leaves it on the cleanup stack.
+     * Applications call this to create new mesh instances. The implementation 
+     * of the returned mesh instance depends on the active renderer.This method 
+     * does not return CHuiMesh object but an object derived from CHuiMesh.
+     *
+     * @param  aMeshType  CHuiMesh derived concrete mesh type.
+     *
+     * @return  Concrete implementation of CHuiMesh.
+     */
+    IMPORT_C static CHuiMesh* NewLC(THuiMeshType aMeshType);
+
+    /**
+     * Default constructor.
+     */
+    CHuiMesh(THuiMeshType aMeshType = EHuiMeshTypeProcedural);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C ~CHuiMesh();           
+
+    
+    /* Methods. */
+
+    /**
+     * Determines the concrete mesh type this instance implements.
+     *
+     * @return THuiMeshType The mesh type implemented by this object.
+     */
+    IMPORT_C THuiMeshType MeshType() const;
+
+    /**
+     * Resets the mesh. All contents are destroyed.
+     */
+    IMPORT_C virtual void Reset();
+
+    /**
+     * Stretch the mesh uniformly along the X, Y, and Z axes. Negative side
+     * of each axis is offseted negatively. Positive side of each side is 
+     * offseted positively. Normals are not affected.
+     *
+     * @param aXLimit
+     * @param aXOffset
+     * @param aYLimit
+     * @param aYOffset
+     * @param aZLimit
+     * @param aZOffset
+     */
+    IMPORT_C virtual void StretchUniformly(TReal32 aXLimit, TReal32 aXOffset, 
+                                           TReal32 aYLimit, TReal32 aYOffset,
+                                           TReal32 aZLimit, TReal32 aZOffset) __SOFTFP;
+                                
+    /**
+     * Scale the mesh uniformly along each axis. Normals are also scaled and
+     * renormalized.
+     *
+     * @param aX  X scaling factor.
+     * @param aY  Y scaling factor.
+     * @param aZ  Z scaling factor.
+     */                                
+    IMPORT_C virtual void ScaleUniformly(TReal32 aX, TReal32 aY, TReal32 aZ) __SOFTFP;
+
+    /**
+     * Draw the mesh.
+     */     
+    virtual void Draw(CHuiGc& aGc, const THuiImage* aImage = 0, 
+                      const THuiImage* aSecondaryImage = 0,
+                      TReal32 aSecondaryAlpha = 0.0) const __SOFTFP;
+        
+
+    // Implementation of MHuiSessionObject
+    
+    /**
+     * Gets the object type.
+     */
+    IMPORT_C TType Type() const;
+
+    /**
+     * Gets the session id for object.
+     */
+    IMPORT_C TInt SessionId() const;
+
+    /**
+     * Sets the session id for object.
+     */
+    IMPORT_C void SetSessionId(TInt aSessionId);
+
+	/**
+	 * Returns number of (hitchcock) animation controllers
+	 */
+	IMPORT_C virtual TInt AnimationControllerCount() const;
+	
+	/**
+	 * Set position of animation in animation controller.
+	 *
+	 * @param aControllerId  ID of the controller.
+	 * @param aTarget  Target position in the timeline (seconds)
+	 * @param aTime  Time to be used in animation
+	 */
+	IMPORT_C virtual void SetAnimationPosition(TInt aControllerId, TReal32 aTarget, TInt aTime) __SOFTFP;
+
+	/**
+	 * Start animation of the controller
+	 *
+	 * @param aControllerId  ID of the animation controller.
+	 */
+	IMPORT_C virtual void StartAnimationController(TInt aControllerId);
+	
+	/**
+	 * Stop animation of the controller
+	 *
+	 * @param aControllerId  ID of the animation controller.
+	 */
+    IMPORT_C virtual void StopAnimationController(TInt aControllerId);
+
+private:
+
+    /** Mesh type implemented by this instance. */
+    THuiMeshType iMeshType;
+
+    /** Session id */
+    TInt iSessionId;
+    
+    };
+
+#endif // __HUIMESH_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiMeshVisual.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,183 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiMeshVisual. CHuiMeshVisual is a visual
+*                that is able to display a 3D triangle mesh.
+*
+*/
+
+
+
+#ifndef __HUIMESHVISUAL_H__
+#define __HUIMESHVISUAL_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiOwnedPointer.h>
+#include <uiacceltk/HuiVisual.h>
+#include <uiacceltk/HuiSkin.h>
+#include <uiacceltk/HuiGc.h>
+#include <uiacceltk/HuiMesh.h>
+#include <uiacceltk/HuiImage.h>
+
+
+/* Forward declarations. */
+class CHuiControl;
+class CHuiProceduralMesh;
+class CHuiM3GMesh;
+
+/**
+ * Visual that displays a 3D triangle mesh. 
+ * This implementation only supports OpenGL ES as the renderer.
+ */
+NONSHARABLE_CLASS(CHuiMeshVisual) : public CHuiVisual
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructs and appends a new mesh visual to the owner control.
+     *
+     * Creates a concrete CHuiMesh - derived implementation into this mesh visual
+     * depending on the given mesh type. This method can leave with any leave codes
+     * defined in the NewL - method of the concrete mesh class that is
+     * constructed. This method allows creation of a specific mesh type upon the 
+     * construction of the visual. When visual is created through CHuiControl::AppendVisualL()
+     * or CHuiControl::AppendVisualLC() EHuiMeshTypeProcedural is used as the mesh
+     * type. The mesh type can be changed by calling CreateMeshL().
+     * 
+     * @param aOwnerControl  Control that will own the new visual.    
+     * 
+     * @param aMeshType The enumerator describing the type of concrete mesh
+     * to be created.     
+     *
+     * @return  The new visual.
+     */
+    IMPORT_C static CHuiMeshVisual* AddNewL(CHuiControl& aOwnerControl,
+    										THuiMeshType aMeshType,
+                                            CHuiLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     */
+    CHuiMeshVisual(MHuiVisualOwner& aOwner);
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+    /**
+     * Destructor.
+     */
+    ~CHuiMeshVisual();
+
+
+    /* Methods. */
+	/**
+	 * Creates CHuiMesh - derived object and attaches it to this CHuiMeshVisual.
+	 * This method will destroy the mesh object that was attached to this
+	 * mesh visual before. The created mesh object can be queried through
+	 * Mesh().
+	 *
+	 * @param aMeshType Mesh type to be created.
+	 */
+	IMPORT_C void CreateMeshL(THuiMeshType aMeshType);    
+    
+    /**
+     * Sets the texture image used with this CHuiMeshVisual.
+     */    
+    IMPORT_C void SetImage(const THuiImage& aImage);
+
+    /**
+     * Secondary image is used for crossfading.
+     */    
+    IMPORT_C void SetSecondaryImage(const THuiImage& aImage);
+
+    IMPORT_C void SetSpecularImage(const THuiImage& aImage);
+
+	
+    /**
+     * Returns the mesh object of the mesh visual.
+     *
+     * @return  Mesh.
+     */
+    IMPORT_C CHuiMesh& Mesh();
+
+	/**
+	 * Returns pointer to the procedural mesh of the mesh visual. If the 
+	 * contained mesh isn't procedural mesh, function returns NULL.
+	 * 
+	 * @return Pointer to the procedural mesh.
+	 */
+	IMPORT_C CHuiProceduralMesh* ProceduralMesh() const; 
+
+	/**
+	 * Returns pointer to the M3G mesh of the mesh visual. If the contained 
+	 * mesh isn't M3G mesh, function returns NULL.
+	 * 
+	 * @return Pointer to the M3G mesh.
+	 */
+	IMPORT_C CHuiM3GMesh* M3GMesh() const; 
+
+    void GetClassName(TDes& aName) const
+        {
+        aName = _L("CHuiMeshVisual");
+        }
+
+public: // From CHuiVisual
+
+	void SetSize(const THuiRealSize& aSize, TInt aTransitionTime = 0);
+	
+   	void SetPos(const THuiRealPoint& aPos, TInt aTransitionTime = 0);
+
+	void SetRect(const THuiRealRect& aRect, TInt aTransitionTime = 0);
+ 	
+ 	/**
+     * Draw the visual.
+     */
+    void DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect) const;
+
+    TBool Changed() const;
+
+    void ClearChanged();
+
+private:
+
+    /** Triangle mesh. */
+    RHuiOwnedPointer<CHuiMesh> iMesh;
+
+    /** Surface image for the mesh. */
+    THuiImage iImage;
+    
+    /** Secondary surface image for the mesh. */
+    THuiImage iSecondaryImage;
+
+
+public:
+
+    /* Public properties. */
+    
+    /** Alpha level of the secondary image. */
+    THuiTimedValue iSecondaryAlpha;
+    
+    THuiTimedValue iYawAngle;
+    
+    THuiTimedValue iPitchAngle;
+    
+    THuiTimedValue iScale;
+
+    };
+
+#endif  // __HUIMESHVISUAL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiObserverArray.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUI_OBSERVER_ARRAY_H__
+#define __HUI_OBSERVER_ARRAY_H__
+
+#include <uiacceltk/HuiPanic.h>
+
+/**
+ * Observer array template.
+ */
+template< class T >
+class RHuiObserverArray
+    {
+public:
+    RHuiObserverArray()
+        {
+        }
+
+    void Reset()
+        {
+        iObservers.Reset();
+        }
+        
+    void Close()
+        {
+        iObservers.Close();
+        }        
+    
+    void AppendL(T& aObserver)
+        {
+        __ASSERT_ALWAYS(iObservers.Find(&aObserver) == KErrNotFound,
+                        THuiPanic::Panic(THuiPanic::EDuplicateObserver));
+        User::LeaveIfError( iObservers.Append(&aObserver) );
+        }
+
+    void AppendIfNotFoundL(T& aObserver)
+        {
+        if(iObservers.Find(&aObserver) == KErrNotFound)
+            {
+            User::LeaveIfError( iObservers.Append(&aObserver) );
+            }
+        }
+        
+    void Remove(T& aObserver)
+        {
+        TInt index = iObservers.Find(&aObserver);
+        if(index == KErrNotFound)
+            {
+            THuiPanic::Panic(THuiPanic::EObserverNotFound);
+            }
+        iObservers.Remove(index);
+        }
+
+    void RemoveIfFound(T& aObserver)
+        {
+        TInt index = iObservers.Find(&aObserver);
+        if(index != KErrNotFound)
+            {
+            iObservers.Remove(index);
+            }
+        }
+
+    inline TInt Count() const
+        {
+        return iObservers.Count();
+        }
+        
+    inline T& operator[] (TInt aIndex) const
+        {
+        return *iObservers[aIndex];
+        }
+
+
+private:
+
+    /* Private methods. */
+    
+    /**
+     * Assignment is not allowed.  
+     */
+    RHuiObserverArray& operator = (const RHuiObserverArray& aObserverArray);
+    
+    
+private:
+    RArray<T*> iObservers;
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+    
+
+#endif // __HUI_OBSERVER_ARRAY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiOwnedPointer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIOWNEDPOINTER_H__
+#define __HUIOWNEDPOINTER_H__
+
+
+/* Types. */
+
+/** Ownership options. */
+enum THuiOwnership
+    {
+    EHuiDoesNotHaveOwnership,
+    EHuiHasOwnership
+    };
+
+
+/**
+ * Pointer that optionally has ownership.
+ */
+template< class T >
+class RHuiOwnedPointer
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Default constructor.
+     */
+    RHuiOwnedPointer()
+            : iOwnership(EHuiDoesNotHaveOwnership), iPointer(0)
+        {
+        }
+        
+    RHuiOwnedPointer(T* aPointer, THuiOwnership aOwnership)
+            : iOwnership(aOwnership), iPointer(aPointer)
+        {
+        }
+
+    /**
+     * Destructor. The object is deleted if the pointer has ownership.
+     */        
+    virtual ~RHuiOwnedPointer()
+        {
+        Close();
+        }
+        
+
+    /* Methods. */        
+
+    /**
+     * Reset the pointer.
+     */
+    inline void Close()
+        {
+        if(iOwnership == EHuiHasOwnership)
+            {
+            delete iPointer;
+            }
+        iPointer = 0;
+        iOwnership = EHuiDoesNotHaveOwnership;            
+        }
+        
+    inline operator T* ()
+        {
+        return iPointer;
+        }
+        
+    inline operator const T* () const
+        {
+        return iPointer;
+        }
+        
+    inline T* operator -> ()
+        {
+        return iPointer;
+        }
+        
+    inline const T* operator -> () const
+        {
+        return iPointer;
+        }
+        
+    inline T* Ptr()
+        {
+        return iPointer;
+        }
+        
+    inline const T* Ptr() const
+        {
+        return iPointer;
+        }
+        
+    inline T& Ref()
+        {
+        return *iPointer;
+        }
+        
+    inline const T& Ref() const
+        {
+        return *iPointer;
+        }
+
+    inline T& NonConstRef() const
+        {
+        return *iPointer;
+        }
+
+    inline void Set(T* aPointer, THuiOwnership aOwnership)
+        {
+        // Delete the previous object.
+        if(iOwnership == EHuiHasOwnership)
+            {
+            delete iPointer;
+            iPointer = 0;
+            }
+            
+        iOwnership = aOwnership;
+        iPointer = aPointer;
+        }
+        
+    inline THuiOwnership Ownership() const
+        {
+        return iOwnership;
+        }
+        
+        
+private:
+
+    /**
+     * Assignment prohibited. This isn't defined anywhere.
+     */
+    RHuiOwnedPointer& operator = (const RHuiOwnedPointer& aOwnedPointer);
+        
+        
+private:
+
+    /** Have ownership of the object being pointed to. If the owned pointer
+        is deleted, the object will be deleted as well. */
+    THuiOwnership iOwnership;    
+    
+    T* iPointer;
+    
+    };
+
+
+#endif // __HUIOWNERSHIPPOINTER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiPanic.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of THuiPanic. Utility class for panicing (macros 
+*                and panic codes).
+*
+*/
+
+
+
+#ifndef __HUIPANIC_H__
+#define __HUIPANIC_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiStatic.h>
+
+
+#define HUI_PANIC(reason) \
+    { \
+    CHuiStatic::Printf(_L8("HUI_PANIC -- Panic %i in "__FILE__" on line %i"), reason, __LINE__); \
+    THuiPanic::Panic(reason); \
+    }
+
+
+/**
+ * Panic utility class.
+ */
+NONSHARABLE_CLASS(THuiPanic)
+    {
+public:
+
+    /**
+     * Panic numbers.
+     * Note: some of these match with the KErrXY -error codes in
+     * e32err.h
+     */
+    enum TReason
+        {
+        ENone = 0, ///< No error has occurred
+
+        //
+        // Panics that are caused by invalid user actions.
+        //
+
+        // Generic.
+        EDuplicateObserver = 1,
+        EObserverNotFound,
+
+        // Environment.
+        EEnvConfigNotFound = 100,
+
+        // Static.
+        EStaticInvalidRenderer = 200,
+        EStaticDataNotCreated,
+        EStaticInvalidClock,
+        EStaticCurrentRenderSurfaceNotSpecified, ///< Current render surface is not specified (e.g. MakeCurrent is not called for any render surface)
+
+        // Scheduler.
+        ESchedulerUnknownCommandType = 300,
+
+        // Roster.
+        ERosterGroupNotFound = 400, ///< Visual's control group is not in the roster
+        ERosterUnknownInputObserverType = 401,
+
+        // Skin.
+        ESkinHasNoGraphicsContext = 500,
+        ESkinInvalidTextStyle,
+        ESkinFontLoadingFailed,
+        ESkinInvalidFontId,
+        ESkinFontSpecCachingFailed,
+        ESkinFontSpecCacheInvalid,
+
+        // Control groups.
+        EControlGroupTransformNotEnabled = 600,
+
+        // Controls.
+
+        // Visuals.
+        EVisualBrushArrayNotEnabled = 700,
+        EVisualTransformNotEnabled,
+        EVisualHasNoDisplayDuringRefresh,
+
+        /** 
+         * Error occurred while preparing a visual for drawing. 
+         * The error most probably was propagated to the owner
+         * of the visual, but no custom handlers for the errors
+         * were implemented. 
+         * 
+         * @see MHuiVisualOwner::VisualPrepareDrawFailed() - The
+         * default implementation in CHuiControl raises this panic. 
+         * Override this method in your huicontrols to avoid this 
+         * panic.
+         */
+		EVisualPrepareDrawFailed, 
+		
+        // Layouts.
+        ELayoutDuplicateVisual = 800,
+        ELayoutNotScrolling,
+        ELayoutChildVisualNotFound,
+        ELayoutInvalidChildPosition,
+
+        // Brushes.
+        EBrushArrayInvalidIndex = 900,
+
+        // Renderer (generic).
+        ERendererError = 1000, ///< glGetError() returned an error.
+
+        // Render surfaces.
+        ERenderSurfaceUnknownDisplayMode = 1100, ///< Unknown display mode encountered. No rendering surface could be created that matches the given display mode.
+        ERenderSurfaceConfigurationNotSupported, ///< Required render surface configuration is not supported by the system. No required rendering surface could be created.
+        ERenderSurfaceActivationFailed, ///< Render surface could not be activated for rendering. MakeCurrent has failed.
+
+        // Texture manager.
+        ETextureManagerNoProcessor = 1200,
+        ETextureManagerTextureDestroyedDuringRelease,
+        ETextureManagerTextureConstructedDuringRelease,
+        ETextureManagerTextureDestroyedDuringRestore,
+        ETextureManagerTextureConstructedDuringRestore,
+
+        // Display.
+        EDisplayClipStackUnpopped = 1300, ///< Rectangles remain on the stack
+        EDisplayClipStackEarlyPop, ///< Too many rectangles popped from the stack
+
+        // Image.
+        EImageNoTexture = 1400,
+        EImageNotSegmentedTexture, ///< Texture used by image must implement MHuiSegmentedTexture.
+
+        // Texture.
+        ETextureInvalidFormat = 1500, ///< Tried to use undefined format type
+        /**
+         * An attempt to use a texture that is not known by the toolkit.
+         * Also the texture reference used may be invalid or the texture
+         * may have been removed from the toolkit.
+         */
+        ETextureNotValid,
+
+        // Graphics context.
+        EGcClipStackPopFromEmpty = 1600, ///< Tried to pop from empty stack
+        EMatrixStackPopFromEmpty,
+        EGcInvalidMatrixStack,
+
+        // Text mesh.
+        ETextMeshNoText = 1700,
+
+        // OpenGL ES 1.0.
+        EGles10Invariant = 1900, ///< Gles10RenderPlugin encounters a fatal error (invariant fails).
+
+        // OpenGL ES 1.1.
+        EGles11IncompatibleGlesProfile = 2000,
+        EGles11IncompatibleGlesVersion,
+        EGles11UnknownGlesVersion,
+        
+        // OpenVG 1.0
+        EVg10Invariant = 3000, ///< Vg10RenderPlugin encounters a fatal error (invariant fails).
+
+        //
+        // Panics that are caused by the HUITK implementation.
+        // These should not occur even if user is doing something illegal.
+        //
+
+        ENotImplemented = 6000, ///< Feature not implemented at this time.
+        EMethodDeprecated,      ///< Feature has been deprecated and no longer functions. Should not be used as it will be will be removed.
+        EFontTextureNoVacancy, ///< Font texture has been filled with glyphs
+
+        EInternalBitmapFileNameNotFound = 6100,
+        EInternalBitmapNotFound,
+        EInternalBitmapLoadTextureFailure,
+
+
+        //
+        // Other panics.
+        //
+
+        EOutOfMemory = KErrNoMemory, ///< Not enough memory to perform the requested operation.
+        EUnknown = KErrGeneral, ///< Unknown (uncategorized) error.
+
+        /// @todo get rid of EInternal panic code (more specific error code has to be used instead!)
+        EInternal = -1 ///< Internal error (most probably a bug in the toolkit)
+        };
+
+
+public:
+
+    /**
+     * Panics the current thread with the HUI toolkit panic category
+     * and the specified panic number.
+     *
+     * @param aReason  panic number
+     * @todo Add description literals to panic codes, match code to description and
+     * debug output the error to clarify the situation..
+     */
+    IMPORT_C static void Panic(TReason aReason);
+    };
+
+
+#endif  // __HUIPANIC_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiPlatform.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Platform specific #definitions for the toolkit.
+*
+*/
+
+ 
+
+#ifndef __HUIPLATFORM_H__
+#define __HUIPLATFORM_H__
+
+#if !defined(SERIES_80) && !defined(SERIES_60)
+#define SERIES_60           // S60 is the default.
+#endif
+
+/*
+ * Series 80 definitions.
+ */
+#ifdef SERIES_80
+
+#include <coecntrl.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikappui.h>
+#include <eikon.hrh>
+
+#define C_HUI_APPLICATION   CEikApplication
+#define C_HUI_DOCUMENT      CEikDocument
+#define C_HUI_APP_UI        CEikAppUi
+#define C_HUI_CONTROL       CCoeControl
+
+#endif
+
+/*
+ * Series 90 definitions.
+ */
+#ifdef SERIES_90
+
+#include <eikbctrl.h>
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <eikappui.h>
+#include <eikon.hrh>
+
+#define C_HUI_APPLICATION   CEikApplication
+#define C_HUI_DOCUMENT      CEikDocument
+#define C_HUI_APP_UI        CEikAppUi
+#define C_HUI_CONTROL       CEikBorderedControl
+
+#endif
+
+/*
+ * Series 60 definitions.
+ */
+#ifdef SERIES_60
+
+#include <coecntrl.h>
+#include <aknapp.h>
+#include <AknDoc.h>
+#include <aknappui.h>
+#include <avkon.hrh>
+
+#define C_HUI_APPLICATION   CAknApplication
+#define C_HUI_DOCUMENT      CAknDocument
+#define C_HUI_APP_UI        CAknAppUi
+#define C_HUI_CONTROL       CCoeControl
+
+#endif
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiRealPoint.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIREALPOINT_H__
+#define __HUIREALPOINT_H__
+
+
+#include <uiacceltk/HuiRealSize.h>
+
+
+/**
+ * Point composed of two floating-point components.
+ */
+NONSHARABLE_CLASS(THuiRealPoint)
+    {
+public:
+    inline THuiRealPoint() 
+            : iX(0), iY(0) 
+        {
+        }
+
+    inline THuiRealPoint(TReal32 aX, TReal32 aY) 
+            : iX(aX), iY(aY) 
+        {
+        }
+        
+    inline THuiRealPoint(const TPoint& aPoint)
+            : iX((TReal32)aPoint.iX), iY((TReal32)aPoint.iY)
+        {
+        }
+
+    inline THuiRealSize AsSize() const
+        {
+        return THuiRealSize(iX, iY);
+        }
+        
+    inline operator TPoint() const
+        {
+        // Here is a rounding error!
+        return TPoint((TInt)iX, (TInt)iY);
+        }
+
+    inline TPoint Round() const
+        {
+        TPoint rounded;
+        rounded.iX = HUI_ROUND_FLOAT_TO_INT( iX );
+        rounded.iY = HUI_ROUND_FLOAT_TO_INT( iY );
+        return rounded; 
+        }
+
+    inline THuiRealPoint operator + (const THuiRealPoint& aOther) const
+        {
+        return THuiRealPoint(iX + aOther.iX, iY + aOther.iY);
+        }
+
+    inline THuiRealPoint& operator += (const THuiRealPoint& aOther) 
+        {
+        iX += aOther.iX;
+        iY += aOther.iY;
+        return *this;
+        }
+
+    inline THuiRealPoint& operator -= (const THuiRealPoint& aOther) 
+        {
+        iX -= aOther.iX;
+        iY -= aOther.iY;
+        return *this;
+        }
+        
+    inline THuiRealPoint operator - () const
+        {
+        return THuiRealPoint(-iX, -iY);
+        }
+
+    inline THuiRealPoint operator - (const THuiRealPoint& aOther) const
+        {
+        return THuiRealPoint(iX - aOther.iX, iY - aOther.iY);
+        }
+        
+    inline THuiRealPoint operator * (TReal32 aFactor) const
+        {
+        return THuiRealPoint(iX * aFactor, iY * aFactor);
+        }
+            
+    inline THuiRealPoint Abs() const
+        {
+        return THuiRealPoint(iX<0?-iX:iX, iY<0?-iY:iY);
+        }
+
+public:    
+
+    /** X coordinate. */    
+    TReal32 iX;
+
+    /** Y coordinate. */
+    TReal32 iY;
+    
+    };
+
+#endif // __HUIREALPOINT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiRealRect.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,169 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIREALRECT_H__
+#define __HUIREALRECT_H__
+
+
+#include <uiacceltk/HuiRealPoint.h>
+#include <uiacceltk/HuiRealSize.h>
+
+
+/**
+ * Rectangle based on real numbers.
+ */
+NONSHARABLE_CLASS(THuiRealRect)
+    {
+public:
+    inline THuiRealRect() 
+        {
+        }
+        
+    inline THuiRealRect(const THuiRealPoint& aTl,        
+                        const THuiRealPoint& aBr)
+            : iTl(aTl), iBr(aBr)
+        {
+        }
+        
+    inline THuiRealRect(const THuiRealPoint& aPoint, 
+                        const THuiRealSize& aSize)
+            : iTl(aPoint), iBr(aPoint)
+        {
+        iBr.iX += aSize.iWidth;
+        iBr.iY += aSize.iHeight;
+        }
+        
+    inline THuiRealRect(const TRect& aRect)
+            : iTl(aRect.iTl), iBr(aRect.iBr)
+        {
+        }
+        
+    inline TReal32 Width() const
+        {
+        return iBr.iX - iTl.iX;
+        }
+        
+    inline TReal32 Height() const
+        {
+        return iBr.iY - iTl.iY;
+        }
+        
+    inline THuiRealPoint TopRight() const
+        {
+        return THuiRealPoint(iBr.iX, iTl.iY);
+        }
+
+    inline THuiRealPoint BottomLeft() const
+        {
+        return THuiRealPoint(iTl.iX, iBr.iY);
+        }
+        
+    inline THuiRealSize Size() const
+        {
+        return THuiRealSize(Width(), Height());
+        }
+
+    inline THuiRealPoint Center() const
+        {
+        return iTl + THuiRealPoint(Width()/2, Height()/2);
+        }
+
+    inline void Grow(TReal32 aX, TReal32 aY)
+        {
+        iTl.iX -= aX;
+        iTl.iY -= aY;
+        iBr.iX += aX;
+        iBr.iY += aY;
+        }
+        
+    inline void Shrink(TReal32 aX, TReal32 aY)
+        {
+        iTl.iX += aX;
+        iTl.iY += aY;
+        iBr.iX -= aX;
+        iBr.iY -= aY;
+        }
+
+    inline void Shrink(const TPoint& aPoint)
+        {
+        iTl.iX += aPoint.iX;
+        iTl.iY += aPoint.iY;
+        iBr.iX -= aPoint.iX;
+        iBr.iY -= aPoint.iY;
+        }
+        
+    inline void Shrink(const THuiRealPoint& aPoint)
+        {
+        iTl.iX += aPoint.iX;
+        iTl.iY += aPoint.iY;
+        iBr.iX -= aPoint.iX;
+        iBr.iY -= aPoint.iY;
+        }
+        
+    inline void Shrink(const THuiRealRect& aRect)
+        {
+        iTl.iX += aRect.iTl.iX;
+        iTl.iY += aRect.iTl.iY;
+        iBr.iX -= aRect.iBr.iX;
+        iBr.iY -= aRect.iBr.iY;
+        }
+        
+    inline void Move(TReal32 aDx, TReal32 aDy)
+        {
+        iTl.iX += aDx;
+        iTl.iY += aDy;
+        iBr.iX += aDx;
+        iBr.iY += aDy;
+        }
+        
+    inline operator TRect() const
+        {
+        return TRect(TPoint((TInt)iTl.iX, (TInt)iTl.iY), 
+                     TPoint((TInt)iBr.iX, (TInt)iBr.iY));
+        }
+        
+    inline TRect Round() const
+        {
+        TRect rounded;
+        rounded.iTl.iX = HUI_ROUND_FLOAT_TO_INT( iTl.iX );
+        rounded.iTl.iY = HUI_ROUND_FLOAT_TO_INT( iTl.iY );
+        rounded.iBr.iX = HUI_ROUND_FLOAT_TO_INT( iBr.iX );
+        rounded.iBr.iY = HUI_ROUND_FLOAT_TO_INT( iBr.iY );
+        return rounded; 
+        }
+
+    inline void BoundingRect( const THuiRealRect& aRect )
+        {
+        iTl.iX = Min( iTl.iX, aRect.iTl.iX );
+        iTl.iY = Min( iTl.iY, aRect.iTl.iY );
+        iBr.iX = Max( iTl.iX, aRect.iTl.iX );
+        iBr.iY = Max( iTl.iY, aRect.iTl.iY );
+        }
+
+public:    
+
+    /** Top left corner. */
+    THuiRealPoint iTl;
+
+    /** Bottom right corner. */
+    THuiRealPoint iBr;
+    
+    };
+
+#endif // __HUIREALRECT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiRealSize.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIREALSIZE_H__
+#define __HUIREALSIZE_H__
+
+/** 
+ * Rounds a float (TReal32) correctly into an integer (TInt). Takes care of both negative
+ * and positive real number.
+ */
+#define HUI_ROUND_FLOAT_TO_INT(a) (a < 0 ? (TInt(a - 0.5f)) : (TInt(a + 0.5f)))
+    
+
+/**
+ * 2D floating-point size.
+ */
+NONSHARABLE_CLASS(THuiRealSize)
+    {
+public:
+    inline THuiRealSize() 
+            : iWidth(0), iHeight(0) 
+        {
+        }
+        
+    inline THuiRealSize(TReal32 aWidth, TReal32 aHeight)
+            : iWidth(aWidth), iHeight(aHeight)
+        {
+        }
+        
+    inline THuiRealSize(const TSize& aSize)
+            : iWidth((TReal32)aSize.iWidth), iHeight((TReal32)aSize.iHeight)
+        {
+        }
+        
+    inline operator TSize() const
+        {
+        // here is a rounding error!
+        return TSize((TInt)iWidth, (TInt)iHeight);
+        }
+        
+    inline TSize Round() const
+        {
+        TSize rounded;
+        rounded.iWidth = HUI_ROUND_FLOAT_TO_INT( iWidth );
+        rounded.iHeight = HUI_ROUND_FLOAT_TO_INT( iHeight );
+        return rounded; 
+        }
+
+    inline THuiRealSize operator * (TReal32 aFactor) const
+        {
+        return THuiRealSize(iWidth * aFactor, iHeight * aFactor);
+        }
+        
+public:    
+
+    /** Width. */    
+    TReal32 iWidth;
+
+    /** Height. */
+    TReal32 iHeight;
+    
+    };
+
+#endif // __HUIREALSIZE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiRenderer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines THuiRenderer, Hitchcock renderer enumeration.
+*
+*/
+
+
+
+#ifndef __HUIRENDERER_H__
+#define __HUIRENDERER_H__
+ 
+//-----------------------------------------------------------
+
+/*! \page cfbsbitmapsupport Input bitmaps supported
+
+Not all CFbsBitmap formats are supported by the Hitchcock UI toolkit. 
+The following tables describe which CFbsBitmap formats can be used with 
+CHuiTexture::UploadL, and bitmap providers 
+(CHuiTextureManager::CreateTextureL() with a MHuiBitmapProvider).
+
+\section cfbsbitmapsupport_gles OpenGL ES Renderer bitmap support
+
+<table cellspacing="1" cellpadding="1" border="0"><tr><td bgcolor="#eaeaea" > &nbsp; </td><th bgcolor="#dadada" align="center">  <strong>Mask Mode:<br/>NULL/Enone</strong>  </th><th bgcolor="#dadada" align="center">  <strong>EGray2</strong>  </th><th bgcolor="#dadada" align="center">  <strong>EGray4</strong>  </th><th bgcolor="#dadada" align="center">  <strong>EGray256</strong>  </th><th bgcolor="#dadada">  <strong>EColorXY-modes</strong>  </th></tr>
+
+<tr><th bgcolor="#dadada">  <strong>Bitmap Mode:<br/> EGray2</strong>  </th><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff"> &nbsp; </td></tr>
+<tr><th bgcolor="#dadada" align="center">  <strong>EGray4</strong>  </th><td bgcolor="#eaeaea"> &nbsp; </td><td bgcolor="#eaeaea"> &nbsp; </td><td bgcolor="#eaeaea"> &nbsp; </td><td bgcolor="#eaeaea"> &nbsp; </td><td bgcolor="#eaeaea"> &nbsp; </td></tr>
+<tr><th bgcolor="#dadada" align="center">  <strong>EGray16</strong>  </th><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff"> &nbsp; </td></tr>
+<tr><th bgcolor="#dadada" align="center">  <strong>EGray256</strong>  </th><td bgcolor="#eaeaea"> &nbsp; </td><td bgcolor="#eaeaea"> &nbsp; </td><td bgcolor="#eaeaea"> &nbsp; </td><td bgcolor="#eaeaea"> &nbsp; </td><td bgcolor="#eaeaea"> &nbsp; </td></tr>
+<tr><th bgcolor="#dadada" align="center">  <strong>EColor16</strong>  </th><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff"> &nbsp; </td></tr>
+<tr><th bgcolor="#dadada" align="center">  <strong>EColor256</strong>  </th><td bgcolor="#eaeaea"> &nbsp; </td><td bgcolor="#eaeaea"> &nbsp; </td><td bgcolor="#eaeaea"> &nbsp; </td><td bgcolor="#eaeaea" align="center"> Yes </td><td bgcolor="#eaeaea"> &nbsp; </td></tr>
+<tr><th bgcolor="#dadada" align="center">  <strong>EColor4K</strong>  </th><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff"> &nbsp; </td></tr>
+<tr><th bgcolor="#dadada" align="center">  <strong>EColor64K</strong>  </th><td bgcolor="#eaeaea" align="center"> Yes * </td><td bgcolor="#eaeaea" align="center"> Yes </td><td bgcolor="#eaeaea"> &nbsp; </td><td bgcolor="#eaeaea" align="center"> Yes </td><td bgcolor="#eaeaea"> &nbsp; </td></tr>
+<tr><th bgcolor="#dadada" align="center">  <strong>EColor16M</strong>  </th><td bgcolor="#ffffff" align="center"> Yes </td><td bgcolor="#ffffff" align="center"> Yes </td><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff" align="center"> Yes </td><td bgcolor="#ffffff"> &nbsp; </td></tr>
+<tr><th bgcolor="#dadada" align="center">  <strong>EColor16MU</strong>  </th><td bgcolor="#eaeaea" align="center"> Yes </td><td bgcolor="#eaeaea" align="center"> Yes </td><td bgcolor="#eaeaea"> &nbsp; </td><td bgcolor="#eaeaea" align="center"> Yes </td><td bgcolor="#eaeaea"> &nbsp; </td></tr>
+
+<tr><th bgcolor="#dadada" align="center">  <strong>EColor16MA</strong>  </th><td bgcolor="#ffffff" align="center"> Yes </td><td bgcolor="#ffffff" align="center"> Yes </td><td bgcolor="#ffffff"> &nbsp; </td><td bgcolor="#ffffff" align="center"> Yes </td><td bgcolor="#ffffff"> &nbsp; </td></tr>
+</table>
+
+(asterisk) = No conversion required (fastest upload)										
+
+You can also check the latest information from https://cwiki.nokia.com/HUIToolkit/HUITKBitmapSupport
+
+*/
+
+//-----------------------------------------------------------
+
+/**
+ * @enum THuiRenderer
+ * 
+ * Enumerates Hitchcock renderers. The renderer is specified by the 
+ * application when an environment is created.
+ * 
+ * Different renderers may not support all HuiGc methods available.
+ * For example the EHuiRendererBitgdi does not support any 3D-related
+ * methods, whereas EHuiRendererGles11 supports most of them.
+ * 
+ * To compare the features of different renderers see the Hitchcock
+ * UI programmers guide.
+ * 
+ * Also the support for input CFbsBitmaps varies between different
+ * renderers. See \ref cfbsbitmapsupport renderer bitmap support
+ * table. 
+ * 
+ * @see CHuiEnv::NewL()
+ */
+enum THuiRenderer
+    {
+
+    /**
+     * Automatically selects the best renderer plugin available.
+     *
+     * @todo Later, a system configuration variable may be defined
+     * that selects the  designated renderer plugin for a device.
+     */
+    EHuiRendererDefault      = 0,
+
+    /** Symbian BITGDI renderer. */
+    EHuiRendererBitgdi      = 1,
+
+    /** OpenVG 1.0 renderer (Not implemented). */
+    EHuiRendererVg10        = 2,
+
+    /** OpenGL ES 1.0 renderer. */
+    EHuiRendererGles10      = 3,
+
+    /** OpenGL ES 1.1 renderer. */
+    EHuiRendererGles11      = 4,
+
+    /** OpenGL ES 1.1 DSA renderer. Implemented, but please use EHuiRendererGles11. */
+    EHuiRendererGles11DSA   = 5,
+
+    /** OpenGL ES 2.0 renderer (Not implemented). */
+    EHuiRendererGles20      = 6
+    };
+
+    
+#endif // __HUIRENDERER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiRoster.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,248 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIROSTER_H__
+#define __HUIROSTER_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiObserverArray.h>
+#include <uiacceltk/huieventhandler.h>
+
+
+/* Forward declarations. */
+class MHuiFrameBuffer;
+class CHuiControlGroup;
+class CHuiControl;
+class CHuiVisual;
+class CHuiGc;
+class THuiEvent;
+class CHuiRosterEntry;
+struct THuiXYMetric;
+class MHuiEffectable;
+class CHuiRenderBuffer;
+
+/** Predefined positions for showing groups. */
+const TInt KHuiRosterShowAtTop = -2;
+const TInt KHuiRosterShowAtBottom = -1;
+
+
+/** Input event types for observing. */
+enum THuiInputType
+    {
+    EHuiInputPointerDrag,
+    EHuiInputPointerLongTap,
+    EHuiInputPointerUnhandled
+    };
+
+
+/**
+ * Roster defines a priority order of control groups shown an a display.
+ * The roster also offers input events to the groups, and handles the
+ * drawing of the groups' root visuals.
+ *
+ * The roster is responsible for managing the logical state of the UI: which
+ * controls are active, who has input focus, and which controls receive input
+ * events. In the roster, the logical structure and state of
+ * the user interface is represented by control groups and controls.
+ *
+ * This is an abstract base class. The methods here are accessible from
+ * the outside.
+ *
+ * There is a roster owned by the environment (a shared roster), if this is not
+ * passed to a display's ConstructL, it will create its own private roster automatically.
+ *
+ * @see HUITK Programmer's Guide for more information on using rosters.
+ */
+NONSHARABLE_CLASS(CHuiRoster) : public CBase
+	{
+public:
+
+	/* Destructor. */
+	virtual ~CHuiRoster();
+	
+
+	/* Methods. */
+	
+	/**
+	 * Shows a control group.
+	 *
+	 * @param aGroup  Control group.
+	 * @param aWhere  Where to show the group. Index, <code>KHuiRosterShowAtTop</code>,
+	 *                or <code>KHuiRosterShowAtBottom</code>.
+	 */
+	virtual void ShowL(CHuiControlGroup& aGroup, TInt aWhere = KHuiRosterShowAtTop) = 0;
+		
+	/**
+	 * Hides a control group.
+	 * Hides all the controls within a control group. Also disconnects the
+	 * control from its host.
+	 *
+	 * @param aGroup  Control group to be hidden.
+	 *
+	 * @see CHuiControl::Hide()
+	 */
+    virtual void Hide(CHuiControlGroup& aGroup) = 0;
+
+    /**
+     * Finds the index of a control group in the roster.
+     *
+     * @param aGroup  Control group. Should return KErrNotFound if not found.
+     */
+    virtual TInt Find(CHuiControlGroup* aGroup) const = 0;
+    
+    /**
+     * Returns the number of control groups.
+     */
+    virtual TInt Count() const = 0;
+    
+    /**
+     * Returns a control group.
+     *
+     * @see Count()
+     */
+    virtual CHuiControlGroup& ControlGroup(TInt aIndex) const = 0;
+    
+    /**
+     * Finds a control inside the roster.
+     *
+     * @param aControlId  Identifier of the control to find.
+     *
+     * @return  Pointer to the control.  <code>NULL</code>, if not found.
+     */
+    virtual CHuiControl* FindControl(TInt aControlId) const = 0;
+   
+    /**
+     * Gives input focus to a control.
+     */
+    virtual void SetFocus(CHuiControl& aControl) = 0;
+    
+    /**
+     * Clears the input focus so that no control has focus.
+     */
+    virtual void ClearFocus() = 0;
+                
+    /**
+     * Called when a key event occurs. The input event is offered to the 
+     * controls in the order defined by the groups.
+     */    
+    virtual TBool HandleEventL(const THuiEvent& aEvent) = 0;
+    
+    /**
+     * Show an individual visual in the roster. The visual is appended to the
+     * root level visuals of its group, at the end of the list of root visuals.
+     *
+     * @param aVisual  Visual to show.
+     */
+    IMPORT_C virtual void ShowVisualL(CHuiVisual* aVisual) = 0;
+
+    /**
+     * Hide an individual visual in the roster.
+     *
+     * @param aVisual  Visual to hide.
+     */
+    virtual void HideVisual(CHuiVisual* aVisual) = 0;
+
+    /**
+     * Moves a root visual to the front. Causes layout recalculation.
+     */
+    virtual void MoveVisualToFront(CHuiVisual* aRootVisual) = 0;
+    
+    /**
+     * Returns the array of input observers for a specific type of input 
+     * event.
+     *
+     * @param aInputType  Type of input being observed.
+     */
+    virtual RHuiObserverArray<MHuiEventHandler>& Observers(THuiInputType aInputType) = 0;
+
+    /**
+     * Sets treshold which pointer needs to be moved before starting to send 
+     * drag events.Default treshold is 4 pixels in both X and Y direction.
+     * Event handler must be added to some pointer event observer array, before
+     * calling this function. Also removing event handler from observer will 
+     * reset this treshold.
+     *
+     * NOTE: Not every unit type is feasible. Only these types are supported:
+     * EHuiUnitPixel, EHuiUnitRelativeToDisplay, EHuiUnitS60
+     *
+     * \code
+     *  Display()->Roster().Observers(EHuiInputPointerDrag).AppendL(*this);
+     *  Display()->Roster().SetPointerDragThresholdL(*this,THuiXYMetric(THuiMetric(0.2,EHuiUnitRelativeToDisplay),THuiMetric(0.1,EHuiUnitRelativeToDisplay)));
+     * \endcode
+     *
+     * @param aEventHandler  Event handler to which treshold affects.
+     * @param aXYMetric  Treshold in metric units.
+     */
+    virtual void SetPointerDragThresholdL(const MHuiEventHandler& aEventHandler, const THuiXYMetric& aXYMetric) = 0;
+
+    /**
+     * Disables long tap events when dragging is going on. Default 
+     * functionality is that long tap event will be delivered simultaneously
+     * with drag events. Event handler must be added to some pointer event 
+     * observer array, before calling this function. Also removing event 
+     * handler from observer will reset this feature.
+     *
+     * \code
+     *  Display()->Roster().Observers(EHuiInputPointerDrag).AppendL(*this);
+     *  Display()->Roster().DisableLongTapEventsWhenDraggingL(*this);
+     * \endcode
+     *
+     * @param aEventHandler  Event handler to which disabling affects.
+     * @param aDisable  Boolean to indicate whether feature is disabled or not.
+     */
+    virtual void  DisableLongTapEventsWhenDraggingL(const MHuiEventHandler& aEventHandler, TBool aDisable = ETrue) = 0;
+    
+    /**
+     * Moves a root visual to the given position.
+     *
+     * @param aRootVisual  Visual to move.
+     */
+    virtual void Move(CHuiVisual* aVisual, TInt aPos) = 0;
+
+    /**
+     * Returns effectable-interface if it is supported by the implementation.
+     *
+     */
+    virtual MHuiEffectable* Effectable() = 0;
+        
+    /**
+     * Takes screenshot from the roster content and keeps drawing that until
+     * this method is called again to unfreeze content.
+     * 
+     * @param aFreeze if ETrue, further frames are drawn from cached image of the
+     * roster content. If EFalse, normal drawing is used.
+     *
+     */
+    virtual void FreezeVisibleContentL(TBool aFreeze = ETrue) = 0;
+    
+    virtual TBool IsVisibleContentFrozen() const = 0;
+    
+protected:
+
+    /* Constructors. */
+
+	/**
+	 * Constructor.
+	 */
+	CHuiRoster();
+    
+	};
+
+#endif  // __HUIROSTER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiS60Skin.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiS60Skin. CHuiS60Skin is a HUITK skin that uses 
+*                resources from the current S60 skin.
+*
+*/
+
+
+
+#ifndef __HUIS60SKIN_H__
+#define __HUIS60SKIN_H__
+
+
+#include <e32base.h>
+#include <avkon.hrh>
+#include <AknsUtils.h>
+#include <AknsBasicBackgroundControlContext.h>
+#include <uiacceltk/HuiSkin.h>
+#include <uiacceltk/huidisplaybackgrounditem.h>
+#include <AknsSrvClient.h>
+
+/**
+ * An S60 skin implementation. Uses bitmaps, fonts, and layout from the 
+ * currently active S60 skin.
+ */
+class CHuiS60Skin : public CHuiSkin, public MAknsSkinChangeObserver
+	{
+public:
+
+	/* Constructors and destructor. */
+
+	/**
+	 * Constructor.
+	 */
+	IMPORT_C CHuiS60Skin(CHuiEnv& aEnv);
+
+	/**
+	 * From CHuiSkin. Second-phase constructor.
+	 */
+	IMPORT_C void ConstructL();
+
+	/**
+	 * Destructor.
+	 */
+	IMPORT_C ~CHuiS60Skin();
+
+
+	/* Methods from MAknsSkinChangeObserver */
+	  void SkinContentChanged();
+
+	  void SkinConfigurationChanged(
+	          const TAknsSkinStatusConfigurationChangeReason aReason );
+	  
+	  void SkinPackageChanged(
+	         const TAknsSkinStatusPackageChangeReason aReason );
+public:
+
+    /**
+	 * From CHuiSkin. Determines the preferred location for an element of the skin.
+     * The location of skin elements is determined with Avkon layout utilities.
+	 *
+	 * @param aElement  Element whose location to determine.
+	 *
+	 * @return Location specifier.
+     */
+    IMPORT_C THuiSkinLocation Location(THuiSkinElement aElement);
+
+	/**
+	 * From CHuiSkin. Returns a Series60 theme specific background image when
+	 * parameter EHuiSkinBackgroundTexture is specified.
+	 */
+	IMPORT_C const CHuiTexture& TextureL(TInt aSkinTextureId);
+	
+    /**
+     * From CHuiSkin. Release a skin texture.
+     * Will free up the given texture used by the skin.
+     * @param aSkinTextureResource The THuiSkinTextureResource skin texture ID to free.
+     */
+	IMPORT_C void ReleaseTexture(TInt aSkinTextureResource);	
+	
+    /**
+     * From CHuiSkin. Notification received when display size has changed.
+     */
+    IMPORT_C void NotifyDisplaySizeChangedL();
+
+    /**
+     * From CHuiSkin. Get text color based on style and background.
+     * Determines the colour to use for text, based on the current text style
+     * and the background type.
+     * @param aStyle The text style that is being used.
+     * @param aBackgroundType The background type that is currently under the text.
+     * @return The TRgb value of the text color to use.
+     */
+    IMPORT_C TRgb StyleTextColor(THuiPreconfiguredTextStyle aStyle, 
+                                         THuiBackgroundType aBackgroundType) const;
+       
+    /**
+     * From CHuiSkin. Restore content of texture.
+     * Restore content of the given texture.
+     * @param aTexture Texture to restore the content of.
+     */
+    IMPORT_C void RestoreTextureContentL(CHuiTexture& aTexture);
+
+    /** ! From CHuiSkin.*/
+    IMPORT_C THuiSkinOrientation Orientation() const;     
+    IMPORT_C void SetContext(CHuiGc& aGc);
+	IMPORT_C CHuiGc& Context() const;
+    IMPORT_C TInt GetTexture(TInt aSkinTextureResource, const CHuiTexture*& aOutTexture);	
+	
+    /**
+     * Return the skin control context.
+     */
+	inline CAknsBasicBackgroundControlContext* SkinControlContext() const
+	{
+		return iSkinControlContext;
+	}
+    void UpdateBackgroundsL(const RArray<THuiDisplayBackgroundItem>& aItems);
+    IMPORT_C CHuiTexture* BackgroundTexture(const TAknsItemID& aID);
+protected: // from CHuiSkin
+    IMPORT_C void SkinExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+    void FreeBackgrounds();
+    CHuiTexture* CreateSkinBackgroundL(const TAknsItemID& aID);
+    void ReloadBgTexturesL();
+protected:
+    
+    /* Methods. */
+
+    MAknsSkinInstance* SkinInstance() const;
+
+    /**
+     * Copies the S60 skin background bitmap onto a texture.
+     */
+    void UpdateBackgroundL();
+
+private:
+
+    /** Control context for the skin. */
+    CAknsBasicBackgroundControlContext* iSkinControlContext;
+
+    /** Background texture from S60. */
+    CHuiTexture* iBackgroundTexture;
+
+    /** To get CallBack from SkinServer when skin is changed */
+    RAknsSrvSession iSkinSrvSession;
+    TBool iSkinSrvConnected;
+     
+    /** Background should be reloaded the next time it is needed. */
+    TBool iReloadBackground;
+    TBool iSkinChanged;
+    CFbsBitmap* iBackgroundBitmap;
+    TAny* iSpare;    
+    };
+
+#endif  // __HUIS60SKIN_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiScheduler.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,171 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUISCHEDULER_H__
+#define __HUISCHEDULER_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiCommand.h>
+#include <uiacceltk/HuiObserverArray.h>
+
+
+/* Forward declaration. */
+class CHuiEnv;
+
+
+/**
+ * The scheduler executes commands at certain points in time. There is one
+ * scheduler instance created for each environment. Everyone has access to 
+ * their environment's scheduler, and can send commands with it. Commands
+ * include, for instance, visual animation commands and action commands sent
+ * by controls. An action command would be sent, for example, when a menu 
+ * item is selected or a button is pressed.
+ */
+NONSHARABLE_CLASS(CHuiScheduler) : public CBase
+	{
+public:
+
+	/* Constructors and destructor. */
+
+	/**
+	 * Constructor. This is only done internally in the toolkit. Applications
+	 * cannot construct schedulers.
+	 *
+	 * @param aEnv  Environment that owns the scheduler.
+	 */
+	CHuiScheduler(CHuiEnv& aEnv);
+	
+	/**
+	 * Destructor.
+	 */
+	virtual ~CHuiScheduler();
+
+
+	/* Methods. */
+
+    /**
+     * Called to notify the scheduler that time has passed and it may be 
+     * necessary to trigger new animations and actions.
+     *
+     * @param aElapsedTime  Number of elapsed seconds.
+     */
+    void AdvanceTime(TReal32 aElapsedTime);	
+
+    /**
+     * Post a new command that will be executed immediately or after a
+     * period of time.
+     *
+     * @param aCommand  Command to send.
+     * @param aDelayMilliSeconds  Time to wait before executing.
+     */
+    void PostCommandL(const THuiCommand& aCommand, TInt aDelayMilliSeconds);
+    
+    /** 
+     * Cancel all commands related to an object.
+     *
+     * @param aVisual  Visual.
+     */     
+    void CancelCommands(const TAny* aObject);
+    
+    /** 
+     * Cancel commands related to an object.
+     *
+     * @param aVisual       Visual.
+     & @param aCommandType  Type of command to cancel.
+     */     
+    void CancelCommands(const TAny* aObject, THuiOp aCommandOperation);
+    
+    /** 
+     * Cancel commands related to a specific object.
+     *
+     * @param aControl      Control.
+     * @param aCommandType  Type of command.
+     * @param aParam        Parameter for custom event.
+     */     
+    void CancelCommands(const TAny* aObject, THuiCommandType aCommandType, TInt aParam);
+    
+    /**
+     * Determines how much time is remaining until a command is to be
+     * executed.
+     *
+     * @param aObject       Object.
+     * @param aCommandType  Type of command.
+     *     
+     * @return  Time interval in milliseconds. -1, if no commands found.
+     */
+    TInt TimeUntilCommand(const TAny* aObject, THuiCommandType aCommandType);
+    
+    /**
+     * Counts the number of pending commands.
+     *
+     * @return  Number of commands waiting to be executed.
+     */
+    TInt PendingCount() const;
+    
+
+private:
+    
+    /* Private methods */
+        
+    /**
+     * Removes a pending command from the queue.
+     *
+     * @param aIndex  Index of the pending command.
+     */
+    void RemovePendingCommand(TInt aIndex);
+
+
+private:
+
+	/**
+	 * A command to be executed at a certain point in time. A list of these delayed
+	 * command events is stored in the HuiScheduler.
+	 * 
+	 */
+	 
+    class TDelayedCommand
+        {
+    public:
+    	/** Constructor. A command may be passed in the initialiser. */
+        TDelayedCommand(const THuiCommand* aCommand)
+                : iCommand(aCommand)
+            {
+            }
+        
+        /** The time when this command will be executed. */
+        TTime iExecutionTime;
+
+        /** 
+         * The command that will be executed.
+         * 
+         * @see THuiCommand
+         * */        
+        const THuiCommand* iCommand;
+        };
+
+    /** Scheduler's environment. */
+    CHuiEnv& iEnv;
+    
+    /** Pending commands waiting for execution. */
+    RArray<TDelayedCommand> iPendingCommands;
+    
+	};
+
+#endif  // __HUISCHEDULER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiSegmentedTexture.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Declares MHuiSegmentedTexture interface class for texture image objects.
+*
+*/
+
+
+
+#ifndef __HUISEGMENTEDTEXTURE_H__
+#define __HUISEGMENTEDTEXTURE_H__
+
+
+#include <e32base.h>
+
+
+/* Forward declarations. */
+class THuiTextureHandle;
+
+
+/**
+ * MHuiSegmentedTexture is an abstract base class for texture image objects.
+ * It specifies one or more texture images that comprise a larger (virtual) image.
+ * THuiImage refers to objects that implement MHuiSegmentedTexture.
+ *
+ * A segmented texture is a texture that is composed of one or more segments.
+ * Each segment has a position, dimensions, and a name that identifies the texture
+ * image of the segment. The purpose is that it is possible to compose large images
+ * out of smaller segments. The segments can overlap.
+ *
+ * One use case is where the OpenGL texture size is limited (e.g., 256x256). A class
+ * implementing MHuiSegmentedTexture would in this case split the uploaded source
+ * image to multiple segments and create a different OpenGL texture for each. All
+ * of the segments would still be hidden inside the implementing
+ * MHuiSegmentedTexture-derived class, though, so it could be treated as a single entity.
+ *
+ * When an object implements the MHuiSegmentedTexture interface, it can be drawn using
+ * the DrawImage() methods in CHuiGc (since THuiImage specifies the image as
+ * MHuiSegmentedTexture).
+ *
+ * @note CHuiGc and CHuiTexture only support single-segment textures at the moment.
+ * @see CHuiGles10Texture
+ * @see CHuiTexture
+ * @see CHuiGc
+ * @see THuiImage
+ *
+ */
+class MHuiSegmentedTexture
+    {
+public:
+
+    /** @beginAPI */
+
+    /** Construction / Destruction */
+
+    /**
+     * Virtual destructor, needed because we have a couple of implemented
+     * methods.
+     */
+    IMPORT_C virtual ~MHuiSegmentedTexture();
+
+
+    /* Methods. */
+
+    /**
+     * Returns the logical size of this texture. Ie. the original size of the
+     * image represented with this texture. This size is independent of the
+     * possible segmentation of this texture.
+     *
+     * On the other hand the actual texture size may
+     * vary across segments and typically has some driver/hw limitations.
+     *
+     * Note that all the segments must be contained inside the logical
+     * area defined with this function.
+     *
+     * @see SegmentSize() To return logical size for a particular texture segment.
+     * @see SegmentOffset() To return logical position for a particular texture segment.
+     * @see SegmentTextureSize() To return texture size for a segment.
+     */
+    virtual TSize Size() const = 0;
+
+    /**
+     * Determines how many segments the texture has. Will return 1 if
+     * the texture is not segmented.
+     *
+     * @return  Number of segments in this texture.
+     */
+    virtual TInt SegmentCount() const = 0;
+
+    /**
+     * Determines the texture name of a segment. For example with
+     * OpenGL ES renderer, this will be the texture id generated
+     * with glGenTextures().
+     *
+     * @param aSegment Segment index to access.
+     */
+    virtual TUint SegmentName(TInt aSegment) const = 0;
+
+    /**
+     * Determines the logical size of a texture segment.
+     * Can be non-power-of-two (NPOT) and may be different
+     * from the actual texture size.
+     *
+     * @param aSegment Valid segment index for this texture.
+     * @see Size() to return logical size of the whole texture.
+     * @see SegmentTextureSize() to determine the actual resolution of
+     * the texture.
+     */
+    virtual TSize SegmentSize(TInt aSegment) const = 0;
+
+    /**
+     * Determines the actual resolution of the texture used
+     * by the segment. Most likely only Power-of-Two, unless NPOT
+     * supported by the graphics library.
+     *
+     * @param aSegment Valid segment index for this texture.
+     */
+    virtual TSize SegmentTextureSize(TInt aSegment) const = 0;
+
+    /**
+     * Determines the logical offset for a texture segment.
+     *
+     * @param aSegment Valid segment index for this texture.
+     */
+    virtual TPoint SegmentOffset(TInt aSegment) const = 0;
+
+    /**
+     * Returns a handle to given texture segment. Defaults to first segment.
+     */
+    IMPORT_C THuiTextureHandle Handle(TInt aSegment = 0) const;
+
+    /**
+     * Binds given texture segment to the texture target. Binding makes
+     * the texture segment active.
+     *
+     * @param aSegment Index of a segment. Defaults to the first segment.
+     * @param aTextureUnit  Which (multi-)texture unit to bind to. The default
+     * value binds to the first texture unit (single-texturing mode).
+     * @see SegmentCount() to get the number of available segments.
+     */
+    IMPORT_C void Bind(TInt aSegment = 0, TInt aTextureUnit = 0) const;
+
+    /** @endAPI */
+    
+    };
+
+
+#endif // __HUISEGMENTEDTEXTURE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiSessionObject.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Declares a interface for session-attached objects
+*
+*/
+
+
+
+#ifndef __HUISESSIONOBJECT_H__
+#define __HUISESSIONOBJECT_H__
+
+#include <e32base.h>
+
+/**
+ * Interface for session-aware objects, providing a setter and getter for session id.
+ * Object type information is included too.
+ */
+class MHuiSessionObject
+    {
+public:
+    enum TType
+        {
+        ETypeVisual,
+        ETypeControl,
+        ETypeControlGroup,
+        ETypeBrush,
+        ETypeTexture,
+        ETypeRenderSurface,
+        ETypeMesh,
+        };
+
+    /**
+     * Gets the object type.
+     */
+    virtual TType Type() const = 0;
+
+    /**
+     * Gets the session id for object.
+     */
+    virtual TInt SessionId() const = 0;
+
+    /**
+     * Sets the session id for object.
+     */
+    virtual void SetSessionId(TInt aSessionId) = 0;
+    };
+
+#endif // __HUISESSIONOBJECT_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiShadowBorderBrush.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines CHuiShadowBorderBrush - Shadow borders for visuals.
+*
+*/
+
+
+
+#ifndef __HUISHADOWBORDERBRUSH_H__
+#define __HUISHADOWBORDERBRUSH_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiBrush.h>
+#include <uiacceltk/HuiSkin.h>
+#include <uiacceltk/HuiGc.h>
+#include <uiacceltk/HuiTimedValue.h>
+#include <uiacceltk/huimetric.h>
+
+
+/**
+ * Draws shadow borders for visuals using the skin shadow texture.
+ * The shadow borders are drawn outside the edges of a visual.
+ *
+ * @todo  Should affect the visual's dirty region by growing it?
+ */
+NONSHARABLE_CLASS(CHuiShadowBorderBrush) : public CHuiBrush
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructor.
+     * @param aWidth Border width in given metric units
+     */
+    IMPORT_C static CHuiShadowBorderBrush* NewL(const THuiMetric& aWidth);
+
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     * @param aWidth Border width in given metric units
+     */
+    IMPORT_C static CHuiShadowBorderBrush* NewLC(const THuiMetric& aWidth);
+
+    /**
+     * Constructor.
+     * @deprecated migrate to using metrics instead.
+     * @param aWidth Border width in pixels
+     */
+    IMPORT_C static CHuiShadowBorderBrush* NewL(TInt aWidth);
+
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     * @deprecated migrate to using metrics instead.
+     * @param aWidth Border width in pixels
+     */
+    IMPORT_C static CHuiShadowBorderBrush* NewLC(TInt aWidth);
+
+    /**
+     * Sets width of shadow border.
+     * @param aWidth Border width in given metric units.
+     */
+    IMPORT_C void SetWidth(const THuiMetric& aWidth);
+
+    /**
+     * Destructor.
+     */
+    virtual ~CHuiShadowBorderBrush();
+
+
+    /* Methods. */
+
+    void ExpandVisualRect(TRect& aRect) const;
+    
+    /**
+     * From CHuiBrush.
+     * @see CHuiBrush::Changed()
+     */
+    TBool Changed() const;
+    
+    /**
+     * From CHuiBrush.
+     * @see CHuiBrush::ClearChanged()
+     */
+    void ClearChanged();
+
+    /**
+     * Draw the brush.
+     */
+    virtual void Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const;
+
+
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor.
+     */
+    CHuiShadowBorderBrush(TInt aWidth);
+
+    /**
+     * Constructor.
+     */
+    CHuiShadowBorderBrush(const THuiMetric& aWidth);
+
+private:
+
+    TReal32 WidthInPixels(const CHuiVisual* aVisual) const;
+    
+public:
+
+    /* Public properties. */
+
+    /** Border width.*/
+    THuiTimedValue iWidth;
+
+private:
+
+    /** Border width in independed metric units */
+    THuiMetric iMetricWidth;
+    
+    };
+
+#endif  // __HUISHADOWBORDERBRUSH_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiShadowedTexture.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Declares the MHuiShadowedTexture interface. 
+*                MHuiShadowedTexture is an interface for textures that support 
+*                dropshadows that are generated out of the texture's content.
+*
+*/
+
+
+
+#ifndef __HUISHADOWEDTEXTURE_H__
+#define __HUISHADOWEDTEXTURE_H__
+
+
+#include <uiacceltk/HuiTextureIf.h>
+
+
+/* Forward declarations. */
+class MHuiSegmentedTexture;
+class MHuiShadowedTexture;
+class THuiTextureHandle;
+
+
+/** Generic shadowing styles. */
+enum THuiShadowStyle
+    {
+    /** Shadow is going to be used with an icon. Little detail. */
+    EHuiTextureShadowStyleIcon,
+    
+    /** Shadow is going to be used with rasterized text. High detail. */
+    EHuiTextureShadowStyleRasterizedText
+    };
+
+
+/**
+ * MHuiShadowedTexture is an interface for textures that support dropshadows 
+ * that are generated out of the texture's content.
+ */
+class MHuiShadowedTexture
+    {
+public:
+    
+    /* Destructor. */
+    
+    /**
+     * Virtual destructor.
+     */
+    virtual ~MHuiShadowedTexture() 
+        {
+        }
+    
+    
+    /* Interface methods. */
+    
+    /**
+     * @deprecated 
+     *
+     * Enables or disables the generation of a shadow when a new image is
+     * uploaded. Note that when the shadow is enabled, a new texture image
+     * needs to be uploaded before the shadow is actually generated.
+     *
+     * @param aEnable  Enables or disables shadow generation and usage.
+     */
+    virtual void EnableShadow(TBool aEnable = ETrue) = 0;
+
+    /**
+     * @deprecated 
+     *
+     * Determines if shadow generation has been enabled.
+     */
+    virtual TBool IsShadowEnabled() const = 0;
+
+    /**
+     * @deprecated 
+     *
+     * Gets a handle to the shadow texture. The handle can be a null handle 
+     * if the shadow is disabled or has not been generated yet. 
+     *
+     * Does not return the handle as a return value because that would make it too
+     * easy to construct a THuiImage directly out of the handle, and cause
+     * a crash since the THuiImage would then reference a temporary object.
+     *
+     * @param aHandle  Handle to the shadow texture is returned here.
+     *
+     * @return  <code>ETrue</code>, if a shadow texture is available.
+     *          Otherwise, <code>EFalse</code>.
+     */
+    virtual TBool GetShadowTexture(THuiTextureHandle& aHandle) const = 0;
+    
+    };
+
+
+#endif // __HUISHADOWEDTEXTURE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiSkin.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,317 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines CHuiSkin abstract base class for skins. Skins are a 
+*                collection resources forming custom graphical appearance.
+*
+*/
+
+
+
+#ifndef __HUISKIN_H__
+#define __HUISKIN_H__
+
+
+#include <e32base.h>
+#include <gdi.h>
+#include <uiacceltk/HuiTexture.h>
+#include <uiacceltk/huitextstylemanager.h>
+
+/* Forward declarations. */
+class CHuiEnv;
+class CHuiGc;
+//class THuiFont;
+
+/** Background type suggestions.
+ * 
+ * These enums suggest which sort of background is under the visual,
+ * in order for it to be rendered in an appropriate colour.
+ * A dark background means that the text will be rendered in white, and a
+ * light background means that the text will be black.*/
+enum THuiBackgroundType
+    {
+    /** background beneath the font is light. */
+    EHuiBackgroundTypeLight,
+    
+    /** background beneath the font is dark. */
+    EHuiBackgroundTypeDark
+    };
+
+/** Element of a skin. */
+enum THuiSkinElement
+    {
+    /** Soft key labels. */
+    EHuiSkinElementSoftKeys
+    };
+
+
+/** Location specifier for an element of the skin. */
+enum THuiSkinLocation
+    {
+    /** Location is not determined. */
+    EHuiSkinLocationNone,
+
+    /** Location is in the top. */
+    EHuiSkinLocationTop,
+
+    /** Location is on the right. */
+    EHuiSkinLocationRight,
+
+    /** Location is in the bottom. */
+    EHuiSkinLocationBottom,
+
+    /** Location is on the left. */
+    EHuiSkinLocationLeft
+    };
+
+
+/**
+ * Skin (texture) Resources.
+ */
+enum THuiSkinTextureResource
+    {
+    EHuiSkinBackgroundTexture,
+    EHuiSkinShadowTexture,
+    EHuiSkinGlyphShadowTexture,
+    EHuiSkinLineTexture
+    };
+    
+    
+/**
+ * Orientations.
+ */     
+enum THuiSkinOrientation
+    {
+    EHuiSkinOrientationPortrait,
+    EHuiSkinOrientationLandscape    
+    };
+
+
+/**
+ * Skin defines a collection of textures, fonts, and layout resources forming
+ * custom graphical appearance for a GUI that can be applied
+ * in order to suit the different tastes of different users.
+ *
+ * CHuiSkin is an abstract base class for all skin implementations.
+ *
+ * @todo  It should be possible to define a skin for each display separately.
+ *        The environment can still own the skins, but each display would
+ *        know the skin it is using. This way off-screen displays can look
+ *        different and use different DPI (e.g., different font sizes)
+ *        than on-screen displays.
+ */
+NONSHARABLE_CLASS(CHuiSkin) : public CBase, public MHuiTextureContentObserver
+	{
+public:
+
+	/* Constructors and destructor. */
+
+    /**
+     * Constructor.
+     */
+    CHuiSkin(CHuiEnv& aEnv);
+
+    /**
+     * Second-phase constructor for skin implementations. Note that the
+     * texture manager is not available when this is called, which means
+     * textures and fonts cannot be loaded during the execution of this
+     * method.
+     */
+    virtual void ConstructL() = 0;
+
+	/**
+	 * Destructor.
+	 */
+	~CHuiSkin();
+
+
+	/* Methods. */
+
+	/**
+	 * Returns the environment of the skin.
+	 */
+	inline CHuiEnv& Env()
+	    {
+	    return iEnv;
+	    }
+
+    /**
+     * Determines the orientation of the skin. Controls may use this to adapt 
+     * their content to a specific layout orientation.
+     *
+     * @return  Orientation of the skin.
+     */
+    IMPORT_C virtual THuiSkinOrientation Orientation() const;     
+
+	/**
+	 * Determines the preferred location for an element of the skin.
+	 *
+	 * @param aElement  Element whose location to determine.
+	 *
+	 * @return Location specifier.
+	 */
+	IMPORT_C virtual THuiSkinLocation Location(THuiSkinElement aElement);
+
+	/**
+	 * Called to notify the skin that there has been a change in the display
+	 * size. This will make the skin do things like determine new font sizes.
+	 * The application should call this manually from the AppUi class.
+	 */
+	IMPORT_C virtual void NotifyDisplaySizeChangedL();
+
+	/**
+	 * Makes a graphics context current.
+	 *
+	 * @param aGc  Graphics context.
+	 */
+	IMPORT_C virtual void SetContext(CHuiGc& aGc);
+
+	/**
+	 * Returns the current graphics context.
+	 *
+	 * @return  Graphics context.
+	 */
+	IMPORT_C virtual CHuiGc& Context() const;
+
+    /**
+     * Returns the text color to be used with a text style on a certain
+     * kind of background.
+     *
+     * @param aStyle           Text style.
+     * @param aBackgroundType  Type of background on which text is over.
+     */
+    virtual TRgb StyleTextColor(THuiPreconfiguredTextStyle aStyle,
+                                THuiBackgroundType aBackgroundType) const = 0;
+
+	/**
+	 * Returns a texture corresponding the requested skin texture resource.
+     *
+     * If the defined texture was not yet created the function will try to
+	 * create it and leaves if creation fails.
+	 *
+	 * @param aSkinTextureResource Enum of the texture to be created.
+     * @see THuiSkinTextureResource.
+     * @see ReleaseTexture().
+	 * @return Reference to the skin-owned texture object.
+     * @leave KErrNotSupported if invalid skin texture resource enum is provided.
+	 */
+	IMPORT_C virtual const CHuiTexture& TextureL(TInt aSkinTextureResource);
+	
+	/**
+	 * Explicit way for releasing textures from memory that are owned by this
+	 * skin. TextureL recreates the released texture if called after this.
+	 * This allows application developers to reduce amount of used texture memory on demand.
+	 *
+	 * @param aSkinTextureResource Enum of the texture to be released.
+	 * @see THuiSkinTextureResource.
+	 * @see TextureL().
+	 */
+	IMPORT_C virtual void ReleaseTexture(TInt aSkinTextureResource);
+
+    /**
+     * Returns a texture corresponding the requested skin texture resource.
+     *
+     * If the defined texture was not yet created the function will try to
+     * create it and returns an error value if creation fails. If texture
+     * cannot be created a blank texture is provided. Texture is passed
+     * in the output parameter.
+     *
+     * @param aSkinTextureResource Enum of the texture to be created.
+     * @see THuiSkinTextureResource.
+     *
+	 * @param aOutTexture Output parameter: Reference to a texture pointer
+     * where the requested texture will be stored. If texture creation fails
+     * a blank texture reference is assigned to this pointer, thus there should
+     * never be a situation where texture pointer is NULL or invalid.
+     *
+	 * @return Error code indicating whether the texture was acquired
+     * succesfully or not. KErrNone if everything went ok. KErrNoMemory if
+     * allocation of the texture failed. KErrNotSupported if invalid skin
+     * texture id is provided.
+	 */
+    IMPORT_C virtual TInt GetTexture(TInt aSkinTextureResource,
+                                     const CHuiTexture*& aOutTexture);
+                                     
+                                     
+public:
+
+    /* Implementation of MHuiTextureContentObserver. */
+    
+    IMPORT_C void TextureContentUploaded(CHuiTexture& aTexture);
+
+    IMPORT_C void TextureContentReleased(CHuiTexture& aTexture);
+    
+    IMPORT_C void RestoreTextureContentL(CHuiTexture& aTexture);
+
+
+protected:
+
+    virtual void SkinExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+private:
+
+    /* Private methods. */
+
+	/**
+	 * Returns a texture corresponding the requested skin texture resource.
+     *
+     * If the defined texture was not yet created the function will try to
+	 * create it and leaves if creation fails.
+	 *
+	 * @param aSkinTextureResource Enum of the texture to be created.
+	 * @param aForcedPrepare Content of texture always recreated.
+	 *
+	 *
+     * @see THuiSkinTextureResource.
+     * @see ReleaseTexture().
+	 * @return Reference to the skin-owned texture object.
+     * @leave KErrNotSupported if invalid skin texture resource enum is provided.
+	 */
+    const CHuiTexture& TextureL(TInt aSkinTextureId, TBool aForcedPrepare);
+
+    /**
+     * Prepares a shadow texture
+     */
+    void PrepareShadowTextureL(CHuiTexture& aTexture);
+
+    /**
+     * Prepares a glyph shadow texture
+     */
+    void PrepareGlyphShadowTextureL(CHuiTexture& aTexture);
+
+    /**
+     * Prepares a line texture
+     */
+    void PrepareLineTextureL(CHuiTexture& aTexture);
+
+
+private:
+
+    /** Environment. */
+    CHuiEnv& iEnv;
+
+    /** Current graphics context. */
+    CHuiGc* iGc;
+
+    /** Texture used for drawing shadows. */
+    CHuiTexture* iShadowTexture;
+
+    /** Texture used for soft lines. */
+    CHuiTexture* iLineTexture;
+
+    /** Texture used for text glyph shadows (managed). */
+    CHuiTexture* iGlyphShadowTexture;
+
+	};
+
+#endif  // __HUISKIN_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiSoftKeyControl.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,312 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of a soft key control class. CHuiSoftKeyControl 
+*                is a control that displays the soft key labels and handles 
+*                soft key input events.
+*
+*/
+
+
+
+#ifndef __HUISOFTKEYCONTROL_H__
+#define __HUISOFTKEYCONTROL_H__
+
+
+#include <uiacceltk/HuiControl.h>
+#include <uiacceltk/HuiSkin.h>
+#include <uiacceltk/HuiImage.h>
+
+/* Forward declarations. */
+class CHuiAppLayout;
+class CHuiTextVisual;
+class CHuiAnchorLayout;
+class CHuiImageBrush;
+
+/** Softkey button positions. */
+enum THuiSoftKeyPosition
+    {
+    EHuiSoftKeyUpper,
+    EHuiSoftKeyLower,
+    EHuiSoftKeyLeft,
+    EHuiSoftKeyRight
+    };
+
+
+/**
+ * @ deprecated: whole SoftKeyControl functionality is deprecated
+ *
+ * CHuiSoftKeyControl displays softkey labels and listens for key input.
+ *
+ * Soft key controls always recide either on the bottom of the UI
+ * (in portrait mode) or at the right side of the UI (in landscape mode).
+ * No other alignments are currently supported in the Toolkit.
+ *
+ * Soft keys automatically align and animate themselves when used. When
+ * mode is changed from portrait to landscape or vice versa the soft
+ * key controls first exit to the edge where they were aligned and enter
+ * from the new location edge. The exit-enter animation is also used to
+ * to change the softkey labels.
+ *
+ * The application user can animate the soft keys manually by calling
+ * methods in CHuiSoftKeyControl: EnterView() and ExitView()
+ *
+ * Furthermore animation duration times can be controlled using
+ * SetAnimationTimes() -method. If user want's to disable the
+ * animations altogether (?) she/he can set the animation duration
+ * times to zero.
+ */
+NONSHARABLE_CLASS(CHuiSoftKeyControl) : public CHuiControl
+	{
+public:
+
+    /** @beginAPI */
+
+    /**
+	 * @ deprecated
+     *
+	 * Mask flags to indicate the controlled softkey label.
+     * These flags can be used as parameter to the EnterView()
+     * and ExitView() methods.
+     */
+    enum THuiSoftkeyLabel
+        {
+        ESoftkeyLabelLeft = 0x1,
+        ESoftkeyLabelRight = 0x2
+        };
+
+	/* Constructors and destructor. */
+
+	/**
+	 * @ deprecated
+     *
+	 * Construct a new softkey control.
+	 */
+	IMPORT_C static CHuiSoftKeyControl* NewL(CHuiEnv& aEnv);
+
+	/**
+	 * @ deprecated
+     *
+	 * Construct a new softkey control and leave it on the cleanup stack.
+	 */
+	IMPORT_C static CHuiSoftKeyControl* NewLC(CHuiEnv& aEnv);
+
+	/**
+	 * @ deprecated
+     *
+     * Second-phase constructor for constructing the control from a resource
+	 * definition.
+	 *
+	 * @param aReader  Resource reader pointing to the beginning of the
+	 *                 control's data.
+	 */
+	//void ConstructFromResourceL(TResourceReader& aReader);
+
+	/**
+	 * @ deprecated
+     *
+	 * Destructor.
+	 */
+	IMPORT_C virtual ~CHuiSoftKeyControl();
+
+
+	/* Methods. */
+
+	/**
+	 * @ deprecated
+     *
+	 * Sets the text of the button. The method automatically animates the
+     * soft key control so that the changed button label is first exit from
+     * the view and later entered back with new label text.
+	 *
+	 * @param aKeyPos         Position of the key to change.
+	 * @param aText           Softkey label text.
+	 * @param aAnimateControl If this argument is true, the whole soft key
+     *                        control animates (exits and enters view).
+     *                        Otherwise only the altered softkey label
+     *                        animates.
+	 */
+	IMPORT_C void SetLabelL(THuiSoftKeyPosition aKeyPos, const TDesC& aText,
+                            TBool aAnimateControl = EFalse);
+
+    /**
+	 * @ deprecated
+     *
+     * Sets background image to the softkeys.
+     *
+     * @param aImage            The background image.
+     * @param aLeftBorderWidth  Width of left border section of the background,
+     *                          in pixels. This determines should background be
+     *                          expanded to the left, over the edge of the
+     *                          visual. Set to  zero to draw only inside
+     *                          the softkey label.
+     * @param aLeftBorderWidth  Width of right border section of the background,
+     *                          in pixels. This determines should background be
+     *                          expanded to the right, over the edge of the
+     *                          visual. Set to zero to draw only inside
+     *                          the softkey label.
+     */
+    IMPORT_C void SetBackgroundL(THuiImage aImage, TInt aLeftBorderWidth, TInt aRightBorderWidth);
+
+	/**
+	 * @ deprecated
+     *
+	 * Sets the softkey animation duration times. The duration time specifies
+     * how fast softkeys enter / exit from the view. Both enter and exit
+     * animation duration times default to 500 milliseconds.
+	 *
+	 * @param aEnterTransition Time taken for softkey control to enter the view.
+     *                         Time duration is specified in milliseconds.
+	 * @param aExitTransition  Time taken for softkey control to exit the view.
+     *                         Time duration is specified in milliseconds.
+	 */
+	IMPORT_C void SetAnimationTimes(TUint aEnterTransition, TUint aExitTransition);
+
+	/**
+	 * @ deprecated
+     *
+	 * Softkey enters view using entering animation.
+	 *
+	 * @param aLabelMask Bitwise mask parameter constructed of enumerators in
+     *                   THuiSoftkeyLabel. With this parameter user can define
+     *                   whether to animate left softkey, right softkey or both
+     *                   (default).
+     * @see THuiSoftkeyLabel.
+	 */
+	IMPORT_C void EnterView(TUint aLabelMask = ESoftkeyLabelLeft | ESoftkeyLabelRight);
+
+	/**
+	 * @ deprecated
+     *
+	 * Soft key exists view using exit animation.
+	 *
+	 * @param aLabelMask Bitwise mask parameter constructed of enumerators in
+     * THuiSoftkeyLabel. With this parameter user can define whether to animate
+     * left softkey, right softkey* or both (default). @see THuiSoftkeyLabel
+	 */
+	IMPORT_C void ExitView(TUint aLabelMask = ESoftkeyLabelLeft | ESoftkeyLabelRight);
+
+    /**
+	 * @ deprecated
+     *
+     * Sets the background type of the softkey control. Affects text labels.
+     * 
+     * @param aBackgroundType  Background type.
+     */
+    IMPORT_C void SetBackgroundType(THuiBackgroundType aBackgroundType);
+
+    /** @endAPI */
+
+	/**
+	 * @ deprecated
+     *
+	 * Event handler.
+	 */
+	virtual TBool OfferEventL(const THuiEvent& aEvent);
+
+	/**
+	 * @ deprecated
+     *
+	 * Notifies the soft key control of updated layout of its children.
+	 * The positioning of the labels is different depending on display
+	 * orientation.
+	 */
+	void VisualLayoutUpdated(CHuiVisual& aVisual);
+
+
+protected:
+
+    /* Constructors. */
+
+	/**
+	 * @ deprecated
+     *
+	 * Constructor.
+	 */
+	CHuiSoftKeyControl(CHuiEnv& aEnv);
+
+	/**
+	 * @ deprecated
+     *
+	 * Second-phase constructor.
+	 */
+	void ConstructL();
+
+
+private:
+
+    /* Private methods */
+
+    /**
+     * Resets the anchor points of the left and right softkey label
+     * according to the location where softkeys should be rendered.
+     *
+     * @param aSkinLocation One of the four locations where softkeys are drawn
+     * (top, bottom, left, right).
+     * @param aShown Boolean value indicating whether the softkeys should be
+     * visible or hidden.
+     * @param aLabelMask Mask which defines the modified keys (left, right or both labels). @see THuiSoftkeyLabel.
+     */
+    void SetAnchorPoints(THuiSkinLocation aSkinLocation,
+                         TBool aShown = ETrue,
+                         TUint aLabelMask = ESoftkeyLabelLeft | ESoftkeyLabelRight);
+
+    /**
+     * Exits the soft key control. Exit is done to the location specified in the parameter.
+     *
+     * @param aTarget Location where the soft keys are exited.
+     * @param aLabelMask Mask which defines the keys to exit (left, right or both labels). @see THuiSoftkeyLabel.
+     * @return Time for exit transition. This can be zero or current exit transition time
+     * depending on whether any animation is played or not.
+     */
+    TUint ExitView(THuiSkinLocation aTarget,
+                   TUint aLabelMask = ESoftkeyLabelLeft | ESoftkeyLabelRight);
+
+    /**
+     * Custom events that drive the animations in soft key control.
+     */
+    enum TCustomEvent
+        {
+        ECustomEventEnterView = 200,
+        ECustomEventUpdateLabel,
+        ECustomEventUpdateLabels
+        };
+
+private:
+
+    /** Label of the left key. */
+    CHuiTextVisual* iLeftLabel;
+    HBufC* iLeftText;
+    /** Background brush for the left key. */
+    CHuiImageBrush * iLeftLabelImageBrush;
+
+    /** Label of the right key. */
+    CHuiTextVisual* iRightLabel;
+    HBufC* iRightText;
+    /** Background brush for the right key. */
+    CHuiImageBrush * iRightLabelImageBrush;
+
+    /** Grid layout used to align the label visuals */
+    CHuiAnchorLayout* iLayout;
+
+    /** Current skin location. This is initialized to none. */
+    THuiSkinLocation iCurrentLocation;
+
+    /** Exit transition duration time in milliseconds */
+    TUint iExitTransitionTime;
+
+    /** Enter transition duration time in milliseconds */
+    TUint iEnterTransitionTime;
+	};
+
+#endif  // __HUISOFTKEYCONTROL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiStatic.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,538 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines CHuiStatic, static data access and utility functions 
+*                such as timing.
+*
+*/
+
+
+
+#ifndef __HUISTATIC_H__
+#define __HUISTATIC_H__
+
+
+#include <e32base.h>
+#include <f32file.h>
+#include <w32std.h>
+#include <AknsUtils.h>
+#include <bacntf.h>
+
+/* Forward declarations. */
+class CHuiEnv;
+class CHuiRenderPlugin;
+class CHuiBitgdiRenderPlugin;
+class CHuiVg10RenderPlugin;
+class CHuiGles10RenderPlugin;
+class CHuiGles11RenderPlugin;
+class CHuiGles20RenderPlugin;
+class MHuiRenderSurface;
+class MHuiProbe;
+class MAknsSkinInstance;
+
+/**
+ * Miscellaneous globally used functions, and thread local storage space.
+ * 
+ * CHuiStatic contains all the functions that tend to be used across classes.
+ * For example, global data access methods for timing functions, frame count,
+ * time since start, etc. It also contains globally-used functions
+ * such as printf. These functions are written in a non-OO fashion because
+ * they are used everywhere, so passing data such as delta step down through the
+ * entire class heirarchy is inefficient.
+ */
+NONSHARABLE_CLASS(CHuiStatic) : public CBase
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructor. The user application should not explicitly
+     * construct a CHuiStatic - it is constructed by CHuiEnv.
+     *
+     * @param aPrimaryEnv The toolkit environment. 
+     */
+    static CHuiStatic* NewLC(CHuiEnv* aPrimaryEnv = 0);
+
+    /**
+     * Constructor. The user application should not explicitly
+     * construct a CHuiStatic - it is constructed by CHuiEnv.
+     *
+     * @param aPrimaryEnv The toolkit environment. 
+     */
+    static CHuiStatic* NewL(CHuiEnv* aPrimaryEnv = 0);
+
+
+    /**
+     * Destructor.
+     */
+    virtual ~CHuiStatic();
+
+
+    /* Methods. */
+
+    /**
+     * Returns the current renderer.
+     * @panic Renderer not yet set. @see SetRenderer()
+     */
+    IMPORT_C static CHuiRenderPlugin& Renderer();
+
+    /**
+     * Sets the current renderer.
+     * @param aRenderer to be used with this HuiToolkit instance.
+     */
+    static void SetRenderer(CHuiRenderPlugin& aRenderer);
+
+    /**
+     * Returns a BITGDI renderer.
+     * To create a new renderer of this type, a function pointer
+     * to this method should be passed to CHuiEnv::NewL() when
+     * the environment is first constructed.
+     *
+     * @see CHuiEnv::NewL()
+     * @panic  BITGDI is not selected as the current renderer.
+     */
+    IMPORT_C static CHuiBitgdiRenderPlugin& BitgdiRenderer();
+
+    /**
+     * Returns a OpenVG 1.0 renderer.
+     * To create a new renderer of this type, a function pointer
+     * to this method should be passed to CHuiEnv::NewL() when
+     * the environment is first constructed.
+     *
+     * @see CHuiEnv::NewL()
+     *
+     * @panic  OpenVG 1.0 is not selected as the current renderer.
+     */
+    IMPORT_C static CHuiVg10RenderPlugin& Vg10Renderer();
+
+    /**
+     * Returns a OpenGL ES 1.0 renderer.
+     * To create a new renderer of this type, a function pointer
+     * to this method should be passed to CHuiEnv::NewL() when
+     * the environment is first constructed.
+     *
+     * @see CHuiEnv::NewL()
+     *
+     * @panic  OpenGL ES 1.0 is not selected as the current renderer.
+     */
+    IMPORT_C static CHuiGles10RenderPlugin& Gles10Renderer();
+
+    /**
+     * Returns a OpenGL ES 1.1 renderer.
+     * To create a new renderer of this type, a function pointer
+     * to this method should be passed to CHuiEnv::NewL() when
+     * the environment is first constructed.
+     *
+     * @see CHuiEnv::NewL()
+     *
+     * @panic  OpenGL ES 1.1 is not selected as the current renderer.
+     */
+    IMPORT_C static CHuiGles11RenderPlugin& Gles11Renderer();
+
+    /**
+     * Returns a OpenGL ES 2.0 renderer.
+     * To create a new renderer of this type, a function pointer
+     * to this method should be passed to CHuiEnv::NewL() when
+     * the environment is first constructed.
+     *
+     * @see CHuiEnv::NewL()
+     *
+     * @panic  OpenGL ES 2.0 is not selected as the current renderer.
+     */
+    IMPORT_C static CHuiGles20RenderPlugin& Gles20Renderer();
+
+    /**
+     * Returns the current rendering surface. Usually changes via
+     * MHuiRenderSurface::MakeCurrent(). Current render surface is NULL before
+     * it is set with the first MakeCurrent call.
+     *
+     * @return  Rendering surface.
+     */
+    IMPORT_C static MHuiRenderSurface* CurrentRenderSurface();
+
+    /**
+     * Sets the current rendering surface. Called from
+     * MHuiRenderSurface::MakeCurrent().
+     *
+     * @param aSurface  Rendering surface.
+     */
+    IMPORT_C static void SetCurrentRenderSurface(MHuiRenderSurface* aSurface);
+
+    /**
+     * Generates a new identifier number. All the numbers returned by this
+     * method are negative integers.
+     * Used for assigning a unique ID to all new controls, among other purposes.
+     *
+     * @return a negative ID number, unique to all ID's generated by this method.
+     */
+    static TInt GenerateId();
+
+    /**
+     * Determines the primary CHuiEnv instance.
+     */
+    IMPORT_C static CHuiEnv& Env();
+
+    /**
+     * Called internally when a change occurs that requires active display
+     * refreshing. All environments are notified. If only a specific
+     * environment should be notified, its ContinueRefresh() method should
+     * be called directly.
+     */
+    IMPORT_C static void ContinueRefresh();
+
+    /**
+     * Updates the toolkit's time counters. This includes the toolkit's
+     * realtime clock, the internal absolute clock (which is affected by the
+     * time factor), the amount of elapsed time since last UpdateTime()
+     * invocation, and the amount of elapsed time since the first UpdateTime()
+     * invocation (which was done in the beginning of the first refresh).
+     */
+    static void UpdateTime();
+    static TUint32 MilliSecondsSinceUpdateTime();
+    /**
+     * Returns the internal absolute clock. This is affected by the time
+     * factor.
+     *
+     * @see  TTime in Symbian OS Reference.
+     *
+     * @return  Internal absolute clock.
+     */
+    IMPORT_C static const TTime& Time();
+
+    /**
+     * Sets the time factor that affects the internal absolute clock, which
+     * is returned by Time(). Zero stops the progress of time completely,
+     * 0.5 means that time  progresses in half the speed compared to real
+     * time (1.0).
+     *
+     * @param aTimeFactor  Time factor.
+     */
+    IMPORT_C static void SetTimeFactor(TReal32 aTimeFactor) __SOFTFP;
+
+    /**
+     * Determines the current time factor.
+     *
+     * @return  Time factor.
+     */
+    IMPORT_C static TReal32 TimeFactor() __SOFTFP;
+
+    /**
+     * Pauses the progress of time completely. The internal absolute clock does
+     * not advance when time is paused. Does not affect the time factor.
+     */
+    IMPORT_C static void PauseTime();
+
+    /**
+     * Continues the progress of time with the same time factor as previously.
+     * Starts the internal absolute clock at the same point in time when it was
+     * paused.
+     */
+    IMPORT_C static void ContinueTime();
+
+    /**
+     * Determines if the time is paused.
+     *
+     * @return  <code>ETrue</code>, if time is paused.
+     */
+    IMPORT_C static TBool TimePaused();
+
+    /**
+     * Determines the number of seconds elapsed in the internal absolute clock
+     * since the last UpdateTime(). This is affected by the time factor.
+     *
+     * @return  Seconds.
+     */
+    IMPORT_C static TReal32 ElapsedSeconds() __SOFTFP;
+
+    /**
+     * Determines the number of seconds since the first UpdateTime() invocation.
+     * This is affected by the time factor.
+     *
+     * @return  Seconds since the first UpdateTime() invocation.
+     */
+    IMPORT_C static TReal32 SecondsSinceStart() __SOFTFP;
+
+    /**
+     * Determines the number of milliseconds since the first UpdateTime()
+     * invocation. This is the same value as returned by SecondsSinceStart(),
+     * only converted into milliseconds. This is affected by the time factor.
+     *
+     * Note that the value will wrap around back to zero in approximately
+     * 50 days after the static instance has been constructed. If this is
+     * a problem, you should handle the wraparound or use SecondsSinceStart()
+     * instead.
+     *
+     * @return  Milliseconds. Note the 32-bit range.
+     */
+    IMPORT_C static TUint32 MilliSecondsSinceStart();
+
+    /**
+     * Determines the number of frames shown.
+     *
+     * @return  Frame count since the application first began rendering.
+     */
+    IMPORT_C static TUint FrameCount();
+
+    /**
+     * Determines the current average frame rate.
+     *
+     * @return  Frame rate since the start of execution.
+     */
+    IMPORT_C static TReal32 AverageFrameRate() __SOFTFP;
+
+    /**
+     * Determines the current frame rate. The rate is calculated at most
+     * once per second. Calling this less frequently causes the rate to be
+     * calculated as an average since the last time this was called.
+     *
+     * @param aTrianglesPerSecond
+     * @param aDrawElementsPerSecond
+     *
+     * @return  Frames per second.
+     * 
+     */
+    IMPORT_C static TReal32 FrameRate() __SOFTFP;
+
+    /**
+     * Print debug text to the console (RDebug). Will also write
+     * debug output to a log file e:\HuiMessages.log (memory card)
+     * if EnableLogging() has been called. If there is no memory card
+     * available the log file will be written to c:\HuiMessages.log.
+     *
+     * @note Debugging to the log file is enabled by default for ARM debug builds.
+     * So you don't have to explicitly enable log file debugging in that case.
+     *
+     * @see EnableLogging()
+     * @note Uses 8-bit character strings, which may not be compatible
+     * with RDebug output. Printing to log file will work fine, but
+     * please use all purpose 16-bit variant if all possible.
+     */
+    IMPORT_C static void Printf(TRefByValue<const TDesC8> aFormat, ...);
+
+    /**
+     * Print debug text to the console (RDebug). Will also write
+     * debug output to a log file e:\HuiMessages.log (memory card)
+     * if EnableLogging() has been called. If there is no memory card
+     * available the log file will be written to c:\HuiMessages.log.
+     *
+     * @note Debugging to the log file is enabled by default for ARM debug builds.
+     * So you don't have to explicitly enable log file debugging in that case.
+     * @see EnableLogging()
+     * @param aFormat printf-style string and its parameters. The
+     * formatted result must not exceed 256 characters (incl the terminating
+     * null char "\0").
+     */
+    IMPORT_C static void Printf(TRefByValue<const TDesC16> aFormat, ...);
+
+    /**
+     * Increment the frame counter.
+     */
+    static void ReportNewFrame();
+
+    /**
+     * Enables or disables Printf message logging to a file.
+     *
+     * The log file is e:\HuiMessages.log (memory card), or if there is
+     * no memory card available the log file will be written to
+     * c:\HuiMessages.log.
+     *
+     * By default the log file logging is disabled for all other builds
+     * than ARM debug builds. Note that you also have to have the macro
+     * HUI_DEBUG_WITH_PRINTF enabled to make HUI_DEBUG*() macros use
+     * CHuiStatic::Printf() calls.
+     *
+     * @param aEnable Set to true to enable logging, false to disable.
+     *
+     * @see Printf()
+     */
+    IMPORT_C static void EnableLogging(TBool aEnable = ETrue);
+
+    /**
+     * Determines whether logging to file is enabled. Note that you may
+     * have RDebug logging even if this returns EFalse.
+     *
+     * @see EnableLogging() to enable/disable log file logging.
+     * @return  <code>ETrue</code>, if logging to file is enabled.
+     */
+    IMPORT_C static TBool Logging();
+
+    /**
+     * Start timing with a clock. Specifies timing starting point.
+     * Provides simple excution profiling capabilities.
+     * @param aClock Clock number to start timing with, use values 0-9.
+     * @see Toc()
+     */
+    IMPORT_C static void Tic(TInt aClock);
+
+    /**
+     * Determines seconds passed since the clock was started (with Tic()).
+     * Provides simple execution profiling capabilities.
+     * @param aClock Clock number used for profiling, use values 0-9.
+     * @see Tic()
+     */
+    IMPORT_C static TReal32 Toc(TInt aClock) __SOFTFP;
+
+    /**
+     * Returns the file server session to be used by the application.
+     * In most cases, this is the same as CEikonEnv::Static()->FsSession().
+     */
+    IMPORT_C static RFs& FsSession();
+
+    /**
+     * Returns the window server session to be used by the application.
+     * In most cases, this is the same as CEikonEnv::Static()->WsSession().
+     */
+    IMPORT_C static RWsSession& WsSession();
+
+    /**
+     * Returns the screen device used by the application.
+     * In most cases, this is the same as CEikonEnv::Static()->ScreenDevice().
+     */
+    IMPORT_C static CWsScreenDevice* ScreenDevice(TInt aScreenNumber = 0);
+
+    /**
+     * Returns the screen device used by the application.
+     * In most cases, this is the same as CEikonEnv::Static()->ScreenDevice().
+     */
+    IMPORT_C static RWindowGroup* RootWin(TInt aScreenNumber = 0);
+
+
+
+    /**
+     * Sets the global transition time used for doing layout transitions. All
+     * layout calculations that happen after the call to SetLayoutTransitionTime()
+     * are affected by the new time. A layout calculations occurs immediately
+     * when the dimensions of a layout visual are modified. By default, the
+     * transition time is ero for all layout calculations, which means they will
+     * become effective immediately.
+     *
+     * @param aTime  New global layout transition time in milliseconds.
+     * @deprecated Will be removed after 2007 wk13.
+     *             This API is ugly. This method should be removed altogether.
+     *             Set transition time as a parameter instead.     
+     */
+    IMPORT_C static void SetLayoutTransitionTime(TInt aTime);
+
+    /**
+     * Returns the global layout transition time.
+     *
+     * @return  Layout transition time in milliseconds.
+     * @deprecated Will be removed after 2007 wk13.
+     *             This API is ugly. This method should be removed altogether.
+     *             Set transition time as a parameter instead.     
+     */
+    IMPORT_C static TInt LayoutTransitionTime();
+
+    /**
+     * Sets the Hitchcock UI Probe object.
+     *
+     * @param aProbe The probe object
+     */
+    IMPORT_C static void SetProbe(MHuiProbe* aProbe);
+    
+    /**
+     * Returns the Probe object
+     *
+     * @return Probe object
+     */
+    static MHuiProbe& Probe();
+    
+    IMPORT_C static MAknsSkinInstance* SkinInstance();
+
+    // Internal utils 
+    static TBool LayoutMirrored();
+    static TInt CbaLocation();
+    static void LayoutMetricsRect(TInt aType, TRect& aRect);
+    static TInt GetCachedColor(TRgb& aRgb, const TAknsItemID& aID,
+            const TInt aIndex );
+    
+    static TBool ConvertToVisualAndClipL(
+        TDes& aLogicalText,
+        const CFont& aFont,
+        TInt aMaxWidthInPixels,
+        TInt aMaxClippedWidthInPixels );
+    
+    static HBufC* ConvertToVisualAndWrapToArrayL( 
+        const TDesC& aLogicalText,
+        TInt aLineWidth,
+        const CFont& aFont,
+        CArrayFix<TPtrC>& aWrappedArray);
+    
+    static CFbsBitmap* GetBgBitmapLC(const TAknsItemID& aID);
+    static void GetMaskedBitmapL(const TAknsItemID& aID, CFbsBitmap*& aBitmap, CFbsBitmap*& aBitmapMask,
+                                 const TDesC& aFileName, TInt aBitmapId, TInt aMaskId, const TSize& aSize, TScaleMode aScaleMode);    
+    static CAknsItemData* GetCachedSkinItemDataL(const TAknsItemID& aID, TInt aDataType);    
+    
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor. Should not be called through the API.
+     */
+    CHuiStatic();
+
+    /**
+     * Second-phase constructor.
+     * @param aPrimaryEnv Pass in the environment.
+     */
+    void ConstructL(CHuiEnv* aPrimaryEnv);
+
+
+private:
+
+    /* Private methods */
+
+    /**
+     * Returns a pointer to the thread-local data struct.
+     */
+    IMPORT_C static struct TTlsData* Data();
+
+    /**
+     * Updates the toolkit's time counters. This includes the toolkit's
+     * realtime clock, the internal absolute clock (which is affected by the
+     * time factor), the amount of elapsed time since last UpdateTime()
+     * invocation, and the amount of elapsed time since the first UpdateTime()
+     * invocation (which was done in the beginning of the first refresh).
+     * 
+     * @param aData TLS Data which encapsulates the internal time variables.
+     */
+    static void UpdateTime(struct TTlsData* aData);
+
+    /**
+     * Callback function.
+     * On system time change, Locale change, HuiStatic time member variables need to be reset. 
+     * CEnvironmentChangeNotifier gives notifications about the above mentioned changes.
+     * Huistatic registers itself for these notifications and SettingChangedCallBack() 
+     * is the callback function getting executed on these events.     
+     *     
+     */
+	static TInt SettingChangedCallBack(TAny* aInstance);
+	
+    TInt DoChange();
+    
+private:
+
+    /**
+     * Thread local storage for this DLL, as we cannot declare static
+     * global variables in Symbian.
+     */
+    struct TTlsData* iData;
+
+    //For system time change event
+    CEnvironmentChangeNotifier* iChangeNotifier;
+    };
+
+
+#endif  // __HUISTATIC_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTextMesh.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,362 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiTextMesh. CHuiTextMesh stores a cached 
+*                version of a text string.
+*
+*/
+
+
+
+#ifndef __HUITEXTMESH_H__
+#define __HUITEXTMESH_H__
+
+
+#include <e32base.h>
+#include <AknFontSpecification.h> 
+
+#include <uiacceltk/HuiRealPoint.h>
+#include <uiacceltk/HuiImage.h>
+#include <uiacceltk/HuiFont.h>
+#include <uiacceltk/huitextstyle.h>
+#include <uiacceltk/HuiDisplay.h>
+#include <uiacceltk/HuiEnv.h>
+
+
+/* Forward declarations. */
+class CHuiGc;
+class CHuiTexture;
+class CAknPictographInterface;
+
+/**
+ * CHuiTextMesh the abstract base class for text meshes. Text meshes store one or more 
+ * lines of text in a format suitable for rendering using a low-level graphics API.
+ * The rendering plugin is responsible for choosing the appropriate concrete text
+ * mesh implementation when a new text mesh needs to be created.
+ */
+NONSHARABLE_CLASS(CHuiTextMesh) : public CBase,
+                                  public MHuiDisplayVisibleAreaObserver, 
+                                  public MHuiDisplayDeletionObserver,
+                                  public MHuiActionObserver
+    {
+public:    
+
+    /* Types. */
+    
+    /** Line wrapping and truncation modes. */
+    enum TLineMode
+        {
+        /** Lines are truncated if they don't fit into the maximum line width.
+            Line breaks must be explicitly defined with line break characters. */
+        ELineModeTruncate,
+        
+        /** Automatic line wrapping. Text is wrapped onto multiple lines if it doesn't
+            fit into the maximum line width. If there are more lines than 
+            allowed by the maximum line count, the extra lines are truncated. 
+            Line break characters will also cause line breaks. */
+        ELineModeWrap
+        };
+
+
+    /* Constructors and destructors. */
+
+    /** 
+     * Destructor.
+     */
+    virtual ~CHuiTextMesh();           
+
+    
+    /* Methods. */
+
+    /**
+     * Resets the contents of the text mesh.
+     */
+    virtual void Reset();
+    
+    
+    /**
+    * Deletes textures for all rasterized lines.
+    * Derived class should supply an implementation.
+    */
+    virtual void ResetLines() {}
+    
+    
+    /**
+    * Deletes textures for all rasterized pictograph lines.
+    * Derived class should supply an implementation.
+    */
+    virtual void ResetPictographLines() {}
+
+
+    void SetLineMode(TLineMode aLineMode);
+    
+    TLineMode LineMode() const;
+    
+    /**
+     * Sets the maximum line width, in pixels. Does not rebuild the 
+     * mesh.
+     *
+     * @param aMaxLineWidth  Maximum line width.
+     *
+     * @return  ETrue, if the new width is different than the previous.
+     *          The mesh should be rebuilt in that case.
+     */
+    TBool SetMaxLineWidth(TInt aMaxLineWidth);
+    
+    /**
+     * Returns the maximum line width.
+     */    
+    TInt MaxLineWidth() const;
+    
+    /**
+     * Sets the maximum line count. Does not rebuild the mesh.
+     *
+     * @param aMaxLineCount  Maximum line count.
+     *
+     * @return  ETrue, if the new count is different than the previous.
+     *          The mesh should be rebuilt in that case.
+     */
+    TBool SetMaxLineCount(TInt aMaxLineCount);
+
+    /**
+     * Returns the maximum line count.
+     */    
+    TInt MaxLineCount() const;
+
+    /**
+     * Selects the default font used by the text mesh.
+     *
+     * @param aFont  Font texture.
+     */
+    void SetFontL(const THuiFont& aFont, TBool aRefreshTextures);
+
+    /**
+     * Prepares the text mesh with a string of text.
+     *
+     * @param aText       One or more strings of text.
+     * @param aRasterize  EFalse when the extents need to be recalculated,
+     *                    but the text doesn't need to be re-rendered.
+     *
+     * @todo  Support formatting escape sequences.
+     */
+    void SetTextL(const TDesC& aText, TBool aRasterize);
+    
+    /**
+     * Returns the text string of the mesh.
+     *
+     * @return  Pointer to descriptor, or <code>NULL</code>.
+     */
+    const TDesC* Text() const;
+    
+    /**
+     * Sets the distance of the sharp shadow. The sharp shadow is a 
+     * black version of the text drawn with an offset.
+     */
+    void EnableRasterizedShadow(const TBool aIsEnabled);
+
+    /**
+     * Determines if the rasterized shadow is enabled.
+     */
+    TBool RasterizedShadow() const;
+
+    /**
+     * Returns the extents of the text.
+     */
+    TSize Extents() const;    
+    
+    /**
+     * Draws the text mesh. 
+     *
+     * @param aGc             Graphics context.
+     * @param aShadowTexture  Texture to use for rendering shadows.    
+     * @param aShadowOpacity  Opacity of shadows.
+     */     
+    virtual void Draw(CHuiGc& aGc, TReal32 aShadowOpacity = 0.f) const __SOFTFP = 0;
+
+    /**
+     * Sets the text style of the text mesh. This style describes the style
+     * the text is rendered with. The text style has to be created with the text style 
+     * manager. If the given text style does not exist, the text style is reverted back
+     * to default text style.
+     * @see CHuiTextStyleManager::CreateTextStyleL
+     *
+     * @param aTextStyleId Text style ID provided by the text style manager.
+     */
+    void SetTextStyle(TInt aTextStyleId);
+
+    /**
+     * Retrieves the text style of the text mesh. This style describes the style
+     * the text is rendered with. 
+     * @see CHuiTextStyleManager::SetTextStyle
+     *
+     * @param Text style ID provided by the text style manager.
+     */
+    TInt TextStyle() const;
+    
+    /** 
+     * Initializes the pictograph support.
+     *
+     * @param aInterface Interface that can be used for drawing pictographs.
+     */
+    virtual void InitPictographsL(CAknPictographInterface* aInterface);
+
+    /**
+     * Updates the mesh pictographs.
+     */
+    virtual void BuildPictographsL();
+
+    /**
+     * Sets the line spacing for multiline text visual when the text wraps around.
+     *
+     * @param aLineSpacing Line spacing between lines in multiline text visual.
+     */
+    void SetLineSpacing(TInt aLineSpacingInPixels);
+    
+    
+    /** 
+    * Calculate scale factors from LCD resolution to TvOut resolution 
+    */
+    void CalculateTvOutScales();
+    
+    /** 
+     * Sets the realted visual
+     *
+     * @param aVisual which owns this text mesh
+     */
+    void SetRelatedVisual(CHuiVisual* aVisual);
+    
+    /* From MHuiDisplayVisibleAreaObserver */
+    /**
+    * Display size observer. Is notified when the display is resized.
+    *
+    * @param aDisplay  Display that sends the notification.
+    */
+    void NotifyDisplayVisibleAreaChanged(CHuiDisplay& aDisplay);
+    
+    /* From MHuiDisplayDeletionObserver */
+    /**
+    * Display deletion observer. Is notified when the display is about to be
+    * destroyed.
+    *
+    * @param aDisplay  Display that sends the notification.
+    */
+    void NotifyDisplayDeletion(CHuiDisplay& aDisplay);
+    
+    /* From MHuiActionObserver */
+    /**
+     * Called by the scheduler when an action command is executed.
+     *
+     * @param aActionCommand  The command that is being executed.
+     *                        TextVisual is interested in 
+     *                        KHuiActionNewTVOutDisplay command.
+     */
+    void HandleActionL(const THuiActionCommand& aActionCommand);
+
+
+protected:
+
+    /* Constructors. */
+    
+    /**    
+     * Default constructor.
+     */
+    CHuiTextMesh();
+   
+    /**    
+     * 2nd phase constructor.
+     */
+    void ConstructL();
+
+    /* Methods. */
+    
+    /** 
+     * Changes the extents of the text mesh.
+     *
+     * @param aExtents  Width and height of the text mesh.
+     */
+    void SetExtents(const TSize& aExtents);
+    
+    /**
+     * Updates the mesh and the extents. Both text and font must be set 
+     * when this is called.
+     *
+     * @param aRasterize Set this to ETrue if text is to be rendered. Set to
+     *                   EFalse if you only need to calculate text extents.
+     */
+    virtual void BuildL(TBool aRasterize) = 0;
+
+    /**
+     * Releases the font associated with this text mesh'es text style.
+     */
+    void ReleaseFont();
+
+public: 
+
+    /**
+     * Expands the given content rect with shadow.
+     * 
+     * @param aRect Content rect to be modified.
+     */    
+    virtual void ExpandRectWithShadow(TRect& aRect) const;    
+
+    /** Internal utility for prerasterized mesh */
+    virtual void UpdateMeshL(const TDesC8& aBuffer);
+
+    
+protected:
+
+    /** Current text style ID */
+    TInt iTextStyleId;
+    
+    /** Interface for drawing pictographs, NOT owned */
+    CAknPictographInterface* iPictographInterface;
+    
+    /** The line spacing for multiline text visual when the text wraps around. */
+    TInt iLineSpacing;
+    
+    /** Scale factor from LCD resolution to TvOut resolution */
+    TReal32 iTextMeshScale;
+    
+    // Related text visual
+    CHuiVisual* iVisual;
+
+private:
+
+    /** Line wrapping and truncation mode. */
+    TLineMode iLineMode;
+    
+    /** Maximum line width. */
+    TInt iMaxLineWidth;
+    
+    /** TvOut scaled maximum line width. Calculated using scale factors 
+    *   from LCD resolution to TvOut resolution */
+    TInt iScaledMaxLineWidth;
+    
+    /** Maximum line count. */
+    TInt iMaxLineCount;
+
+    /** Current text string. */
+    HBufC* iString;
+
+    /** Extents of the text string using the current font. */
+    TSize iExtents;
+
+    /** TvOut scaled extents of the text string using the current font. */
+    TSize iScaledExtents;
+
+    /** Are rasterized shadows being used. */
+    TBool iRasterizedShadow;
+    };
+
+
+#endif // __HUITEXTMESH_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTextStyle.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,397 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   A Text style encapsulates a unique text style 
+*                in Hitchcock UI Toolkit usage.
+*
+*/
+
+
+
+#ifndef __THUITEXTSTYLE_H__
+#define __THUITEXTSTYLE_H__
+
+#include <e32base.h>
+#include <uiacceltk/HuiFont.h>
+#include <uiacceltk/HuiTexture.h>
+
+class CEikonEnv; // needed to work around inclusion dependency in AknFontProvider.h
+
+/**
+ * Constants that are uset to set/reset local definition flags.
+ * Local definition flags describe which text style attributes are set/defined
+ * locally in this particular text style, and which come from the parent.
+ */
+const TInt  KTextColorDefined =         0x00000001;
+const TInt  KBackgroundColorDefined =   0x00000002;
+const TInt  KTextSizeDefined =          0x00000004;
+const TInt  KUnderlineDefined =         0x00000008;
+const TInt  KStrikeThroughDefined =     0x00000010;
+const TInt  KStrokeWeightDefined =      0x00000020;
+const TInt  KPostureDefined =           0x00000040;
+const TInt  KFontDefined =              0x00000080;
+
+/**
+ * THuiTextStyle presents an abstract text style implementation.
+ * Its main purpose is to act as an encapsulation of a particular text style.
+ *
+ * Derived platform dependant classes will implement their own version of this class
+ */
+class THuiTextStyle 
+{
+public:
+        
+    /* Constructors and destructor. */
+
+    /** @beginAPI */
+      
+    /**
+     * Copy constructor.
+     */
+    IMPORT_C THuiTextStyle( const THuiTextStyle& aTextStyle );
+    
+	
+    /**
+     * Returns THuiFont associated with this logical text style.
+     * 
+     * @return THuiFont associated with this logical text style. 
+     */
+    IMPORT_C THuiFont& Font();
+	
+    /**
+     * Returns THuiFont associated with this logical text style.
+     * 
+     * @return THuiFont associated with this logical text style. 
+     */
+    IMPORT_C const THuiFont& Font() const;
+	
+    /**
+     * Sets a THuiFont object associated with this logical text style.
+     * 
+     * @param aFont A HuiFont that willl be used in this text style. 
+     */
+    IMPORT_C virtual void SetFont(THuiFont aFont);
+
+    /**
+     * Retrieves a toolkit specific ID of the parent text style. The text styles 
+     * are cascaded. The parent of a text style is EHuiTextStyleNormal by default.
+     * 
+     * @see CHuiTextStyleManager::CreatePlatformTextStyleL
+     * 
+     * @return A toolkit specific ID of the parent text style.
+     */
+    IMPORT_C TInt ParentId() const;
+	
+    /**
+     * Sets a toolkit specific ID of the parent text style. The text styles are cascaded.
+     * Setting a parent ID will cause the text style to get all the text style attributes
+     * that are not locally defined from the parent.
+     * 
+     * @param aParentId A toolkit specific ID of the parent text style.
+     */
+    IMPORT_C void SetParentId(TInt aParentId);
+	
+    /**
+     * A unique toolkit specific ID assigned by the text style manager. The text style can be
+     * accessed anytime through the CHuiTextStyleManager::TextStyle - method based on this
+     * unique ID. The default text style has always ID 0.
+     * 
+     * @see CHuiTextStyleManager::CreatePlatformTextStyleL
+     * 
+     * @return A unique toolkit specific ID for this text style.
+     */
+    IMPORT_C TInt Id() const;
+	
+	/**
+	 * Retrieves the text style text color attribute.
+	 * 
+	 * @return The text style text color.
+	 */
+	IMPORT_C TRgb TextColor() const;
+	
+	/**
+	 * Sets the text style text color attribute.
+	 * 
+	 * @param aTextColour A new text color of the text style.
+	 */
+	IMPORT_C void SetTextColor(const TRgb& aTextColour);
+	
+	/**
+	 * @todo remove!!!
+	 */
+	IMPORT_C TRgb BackgroundColor() const;
+	
+	/**
+	 * @todo remove!!!
+	 */
+	IMPORT_C void SetBackgroundColor(const TRgb& aBackgroundColor);
+	
+	/**
+	 * Retrieves text style text size attribute in twips.
+	 * 
+ 	 * @param aIsDecoratedSize If true, the decoration size (the area reserved for decoration) 
+ 	 *                         is added to the actual text size. The decoration here means
+ 	 *                         various effects that can be added to the text, for example a 
+ 	 *                         shadow.
+ 	 *
+	 * @return The The actual text size in twips plus the decoration size if decorated size
+	 *         was requested.      .
+	 */
+	IMPORT_C TInt TextSizeInTwips(TBool aIsDecoratedSize = EFalse);
+	
+	/**
+	 * Sets the text style text size attribute in twips.
+	 * 
+	 * @param aTextSizeInTwips The new text style text size in twips.
+ 	 * @param aIsDecoratedSize If true, the decoration size is subtracted from the text size
+ 	 *                         to ensure that the rasterized text will fit into the reserved
+ 	 *                         area including the decoration. The decoration here means various
+ 	 *                         effects that can be added to the text, for example a shadow .
+	 */
+	IMPORT_C void SetTextSizeInTwips(TInt aTextSizeInTwips, TBool aIsDecoratedSize = EFalse);
+
+	/**
+	 * Retrieves text style text size attribute in pixels.
+	 * 
+ 	 * @param aIsDecoratedSize If true, the decoration size (the area reserved for decoration) 
+ 	 *                         is added to the actual text size. The decoration here means
+ 	 *                         various effects that can be added to the text, for example a 
+ 	 *                         shadow.
+ 	 *
+	 * @return The actual text size in pixels plus the decoration size if decorated size
+	 *         was requested.
+	 */
+	IMPORT_C TInt TextSizeInPixels(TBool aIsDecoratedSize = EFalse);
+	
+	/**
+	 * Sets the text style text size attribute in pixels.
+	 * 
+	 * @param aTextSizeInPix   The new text style text size in pixels.
+ 	 * @param aIsDecoratedSize If true, the decoration size is subtracted from the text size
+ 	 *                         to ensure that the rasterized text will fit into the reserved
+ 	 *                         area including the decoration. The decoration here means various
+ 	 *                         effects that can be added to the text, for example a shadow .
+	 */
+	IMPORT_C void SetTextSizeInPixels(TInt aTextSizeInPix, TBool aIsDecoratedSize = EFalse);
+	
+	/**
+	 * Retrieves text style text stroke weight attribute.
+	 * 
+	 * @return The text style text stroke weight. If ETrue, the text is bold,
+	 *         otherwise normal.
+	 */
+	IMPORT_C TBool StrokeWeight();
+	
+	/**
+	 * Sets the text style text stroke weight attribute.
+	 * 
+	 * @param aIsBold The new text style text stroke weight. If ETrue, the text is bold,
+	 *                otherwise normal. 
+	 */
+	IMPORT_C void SetStrokeWeight(TBool aIsBold);
+	
+	/**
+	 * Retrieves text style text posture attribute.
+	 * 
+	 * @return The text style text posture. If ETrue, the text is bold,
+	 *         otherwise normal.
+	 */
+	IMPORT_C TBool Posture();
+	
+	/**
+	 * Sets the text style text posture attribute.
+	 * 
+	 * @param aIsItalic The new text style text posture. If ETrue, the text is italic,
+	 *                  otherwise upright. 
+	 */
+	IMPORT_C void SetPosture(TBool aIsItalic);
+	
+	/**
+	 * Retrieves text style text underline attribute.
+	 * 
+	 * @return The text style text underlining. If ETrue, the text is underlined,
+	 *         otherwise normal.
+	 */
+	IMPORT_C TBool Underline() const;
+	
+	/**
+	 * Sets the text style text underline attribute.
+	 * 
+	 * @param aIsUnderline The new text style text underline attribute. If ETrue, 
+	 * the text is underlined, otherwise normal. 
+	 */
+	IMPORT_C void SetUnderline(TBool aIsUnderline);
+	
+	/**
+	 * Retrieves text style text strike through attribute.
+	 * 
+	 * @return The text style text strike through attribute. If ETrue, the text is 
+	 *         strike through, otherwise normal.
+	 */
+	IMPORT_C TBool StrikeThrough() const;
+	
+	/**
+	 * Sets the text style text strike through attribute.
+	 * 
+	 * @param aIsStrikeThrough The new text style text strike through attribute. 
+	 *                         If ETrue, the text is strike through, otherwise normal. 
+	 */
+	IMPORT_C void SetStrikeThrough(TBool aIsStrikeThrough);	
+    
+	/**
+	 * Retrieves font style id.
+	 * 
+	 * @return The text font style id.
+	 */            
+    IMPORT_C TInt FontStyleId() const;
+    
+    /**
+    * Get the typeface that would be used for this text style
+    *
+    * @param  aTypeface  Returned typeface structure
+    */
+    IMPORT_C void GetTypeface( TTypeface& aTypeface ) const;
+
+    /**
+     * Sets the text style text pane height in pixels. 
+     *
+     * @note This means that the text size (i.e. the return value from calling @c TextSizeInPixels)
+     *     will be in general smaller than the text pane height, as the text pane is intended to match 
+     *     the font's maximum extent.
+     * @note In order to convert a height from a metric value into pixels, use @c CHuiVisual::LocalToDisplay.
+     * 
+     * @param aTextPaneHeight   The new text style text pane height in pixels.
+     * @param aIsDecoratedSize If true, the decoration size is subtracted from the text pane height
+     *      to ensure that the rasterized text will fit into the reserved area including the 
+     *      decoration. The decoration here means various effects that can be added to the 
+     *      text, for example a shadow.
+     */    
+     IMPORT_C void SetTextPaneHeightInPixels(TInt aTextPaneHeight, TBool aIsDecoratedSize = EFalse);
+    
+    /** @endAPI */
+    
+    /**
+     * Constructs a text style that uses font according to font ID provided by font 
+     * manager. Uses a default text style when parameters are not set.
+     *
+     * @param aFontStyleId 	Font ID provided by font manager. If not set the default font
+     * 						is used.
+     * @param aParentId		The parent text style. Root style is created if the ID is not set.
+     */
+    THuiTextStyle( TInt aFontStyleId = 0, TInt aParentId = -1 );
+       
+    /**
+     * Rasterizes a single line of text using this style.
+     * Rasterization is done to the texture given as a parameter.
+     * Caller has to assure that the the texture is of correct dimentions
+     * and pixel format.
+     * 
+     * @todo Text shadow should be a property of the text style (or even a separate brush, maybe?)
+     * and not configured in text mesh.
+     *
+     * @param aTextLine  	 The line of text to rasterize.
+     * @param aTargetTexture Reference to a texture that the text is going 
+     * 						 to be rasterized to.
+     */
+    void RasterizeLineL(const TDesC& aTextLine, CHuiTexture& aTargetTexture);
+
+    /**
+     * Retrieves the dimensions in pixels occupied by rasterization of the given string using
+     * this text style.
+     * 
+     * @param aTextLine   String that is used in calculation of rasterization dimensions.
+     * @return Dimensions occupied by rasterization in pixels.
+     */
+    TSize LineExtentsL(const TDesC& aTextLine);    
+	
+    /**
+     * Text style manager is setting this ID when a new text style is created.
+     * @see CHuiTextStyleManager::CreatePlatformTextStyleL
+     * 
+     * @param aId A Unique toolkit specific ID for this text style.
+     *            This text style can be accessed anytime through the 
+     *            CHuiTextStyleManager::TextStyle - method using this ID.
+     */
+    void SetId(TInt aId);
+	
+    /**
+     * Retrieves the flags that describe which text style attributes are set/defined
+     * locally in this particular text style, and which come from the parent.
+     * Each flag can be used to set/reset a bit in definitions flags member variable.
+     * If a flag, KTextColorDefined for example, is set, it means that the respective 
+     * text style attribute is defined locally. If the flag is not set, the respective 
+     * attribute value will be looked from the parent.
+     * 
+     * @see KTextColorDefined as an example.
+     * 
+     * @return Current text style attribute flags.
+     */
+    TInt LocalDefinitionFlags() const;
+
+    /**
+     * Sets the flags that describe which text style attributes are set/defined
+     * locally in this particular text style, and which come from the parent.
+     * @see SetId
+     * 
+     * @param aLocalDefinitionFlags Will set all the text style attribute flags.
+     */
+    void SetLocalDefinitionFlags(TInt aLocalDefinitionFlags);
+    
+    void  EnableClipping(TRect aClipRect);
+	void  DisableClipping();
+	
+protected:
+
+    THuiFont iFont;
+	
+    /**
+     * Font style ID
+     */
+    TInt  iFontStyleId; 
+    
+    /**
+     * Local definition flags
+     */
+    TInt  iLocalDefinitionFlags;
+
+private:
+
+    /**
+     * Toolkit specific ID of the parent text style. The text styles are cascaded.
+     * The parent of a text style is EHuiTextStyleNormal by default.
+     */
+    TInt  iParentId;
+    
+    /**
+     * A unique toolkit specific ID for the text style. The text style can be accessed 
+     * anytime through the CHuiTextStyleManager based on this unique ID. 
+     * The default text style has always ID 0.
+     */
+    TInt  iId;
+    
+    TRgb  iTextColor;
+    TRgb  iBackgroundColor;
+    TBool iIsUnderline;
+    TBool iIsStrikeThrough;
+    
+    TBool iClippingEnabled;
+    TRect iClipRect;
+};
+
+#endif  //__THUITEXTSTYLE_H__
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTextStyleManager.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,177 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Text style manager allows creation and management of
+*                platform text styles in Hitchcock UI Toolkit usage.
+*
+*/
+
+
+
+
+#ifndef __HUITEXTSTYLEMANAGER_H__
+#define __HUITEXTSTYLEMANAGER_H__
+
+#include <e32base.h>
+#include <uiacceltk/huitextstyle.h>
+
+/** 
+ * Preconfigured text styles.
+ * Matching text styles always exist in the text style manager.
+ * It is possible to retrieve the associated text style object through
+ * CHuiTextStyleManager::TextStyle() - interface.
+ */
+enum THuiPreconfiguredTextStyle
+    {
+    EHuiTextStyleNormal = 0,
+    EHuiTextStyleNormalItalic,
+    EHuiTextStyleMenuItem,
+    EHuiTextStyleSmall,
+    EHuiTextStyleMenuSmall,
+    EHuiTextStyleMenuTitle,
+    EHuiTextStyleLarge,
+    EHuiTextStyleSoftkey,
+    EHuiTextStyleSupplement,
+    EHuiTextStyleTitle
+    };
+
+/**
+ * CHuiTextStyleManager allows user to create text styles supported by the platform
+ * that can be used in Hitchcock UI Toolkit user interfaces. Text styles are referred  
+ * to by Hithcock UI Toolkit session specific unique IDs. Collection of preconfigured
+ * text styles are constructed by default. @see THuiPreconfiguredTextStyle. 
+ */
+NONSHARABLE_CLASS(CHuiTextStyleManager): public CBase
+{
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructor.
+     */
+    static CHuiTextStyleManager* NewL();
+
+    /**
+     * Constructor.
+     */
+    static CHuiTextStyleManager* NewLC();
+
+    /**
+     * Destructor.
+     */    
+     ~CHuiTextStyleManager();
+     
+    /**
+     * Creates a new text style object based on the S60 font style id passed into this method. 
+     * Text style font and size are set according to the given S60 id. Ids are defined in
+     * avkon.hrh in TAknLogicalFontId enumeration.
+     * A unique toolkit specific ID is constructed and returned. This text style can be
+     * accessed anytime through the TextStyle - method based on the unique ID. The default 
+     * text style has always ID 0.
+     * Text styles cascade properties from their parent styles. By default all text styles
+     * are descended from EHuiTextStyleNormal text style.
+     * If an invalid parent id is given the created text style will use EHuiTextStyleNormal
+     * as its parent.
+     * @see TextStyle()
+     *
+     * Created text styles must be deleted with DeleteTextStyle.
+     * @see DeleteTextStyle()
+     * 
+     * @param aFontStyleId The S60 font style id based on which the text style object will be created.
+     * @param aParentId Toolkit specific ID of the parent text style. The text styles are cascaded.
+     *                          The parent of the created text style is EHuiTextStyleNormal by default.
+     * @return Unique toolkit specific ID for the created text style.
+     */
+     IMPORT_C TInt CreatePlatformTextStyleL(TInt aFontStyleId, TInt aParentId = EHuiTextStyleNormal);
+     
+    /**
+     * Returns a text style object based on the text style id passed into this method.
+     * If no matching text style is found from the system the method returns the EHuiTextStyleNormal
+     * text style. There is a collection of preconfigured text styles available. They can
+     * be queried using the id enumerations from THuiPreconfiguredTextStyle.
+     * @see CreatePlatformTextStyleL()
+     * 
+     * @param aId A text style id identifying the requested text style in the text style manager.
+     * @return A pointer to a requested text style. Various attributes of the text style 
+     * can be changed using the returned pointer.
+     */
+     IMPORT_C THuiTextStyle* TextStyle(TInt aId);
+     
+    /**
+     * Creates a new text style object that is identical with the given source text style.
+     * All the properties of the source text style are copied. The only difference is the 
+     * text style ID. Each text style has a unique toolkit specific ID.
+     *
+     * Created text styles must be deleted with DeleteTextStyle.
+     * @see DeleteTextStyle()
+     *
+     * @param aSourceId A toolkit specific ID of the text style to be cloned.
+     * @return Unique toolkit specific ID for the created text style.
+     */
+     IMPORT_C TInt CopyTextStyleL(TInt aSourceId);
+     
+     /**
+      * Deletes the given text style.
+      *
+      * @param aId Text style ID to delete.
+      *
+      * @return Error code. KErrNone if text style was deleted
+      *                     KErrArgument if there is no style defined with given ID
+      *                     KErrAccessDenied if the ID refers to pre-defined styles.
+     */ 
+     IMPORT_C TInt DeleteTextStyle(TInt aId);
+
+    /**
+     * Constructs the collection of built-in preconfigured text styles.
+     * @see THuiPreconfiguredTextStyle
+     */
+     void ConstructBuiltInStylesL();
+
+     /**
+      * 
+      */
+     void SetSoftkeyTextStyle(TInt aTextStyleId);
+     
+     void NotifyDisplaySizeChangedL();
+     
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Default constructor.
+     */
+    CHuiTextStyleManager();
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+    
+    void InsertIntoArrayAndSetIdL(THuiTextStyle& style);
+
+private:
+    
+    /** Registry of all text styles within this manager. These text styles are  
+     *  accessed by text style id. 
+     */
+    RPointerArray<THuiTextStyle> iTextStyles;
+    
+    /**
+     * Last id of built in styles.
+     */
+    TInt iLastBuiltInStyleId;
+};
+
+#endif  //__HUITEXTSTYLEMANAGER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTextVisual.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,398 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiTextVisual. CHuiTextVisual is a visual
+*                that draws text.
+*
+*/
+
+
+
+#ifndef __HUITEXTVISUAL_H__
+#define __HUITEXTVISUAL_H__
+
+
+#include <e32base.h>
+#include <AknsItemID.h>
+#include <uiacceltk/HuiVisual.h>
+#include <uiacceltk/HuiSkin.h>
+#include <uiacceltk/HuiGc.h>
+
+
+/* Forward declarations. */
+class CHuiControl;
+class CHuiTextMesh;
+class THuiTextStyle;
+class CAknPictographInterface;
+class CHuiPictographAnimator;
+
+
+/**
+ * Text visual shows one or more lines of text.
+ *
+ * @todo  Escape sequences for formatting (font, colors) will be supported.
+ * @todo  Changing text style with escape sequences.
+ */
+NONSHARABLE_CLASS(CHuiTextVisual) : public CHuiVisual
+    {
+public:
+
+    /* Types. */
+    
+    enum TLineWrap
+        {
+        /** Lines must be broken manually with line break characters. 
+            If the visual does not use clipping, long text lines will 
+            go outside the visual. This is the default mode. */
+        ELineWrapManual,
+        
+        /** Lines that do not fit in the visual's content area are truncated 
+            with an ellipsis (...). */
+        ELineWrapTruncate,
+        
+        /** Lines are broken to the visual's content area. */
+        ELineWrapBreak
+        };
+
+    enum TLineSpacingUnits
+        {
+        /** Line spacing is given in pixels */
+        EPixels,
+        
+        /** Line spacing is given in twips */
+        ETwips
+        };
+
+
+    /* Constructors and destructor. */
+
+    /** @beginAPI */
+
+    /**
+     * Constructs and appends a new text visual to the owner control.
+     *
+     * @param aOwnerControl  Control that will own the new visual.
+     *
+     * @return  The new visual.
+     */
+    IMPORT_C static CHuiTextVisual* AddNewL(CHuiControl& aOwnerControl,
+                                            CHuiLayout* aParentLayout = 0);
+
+    /** @endAPI */
+    
+    
+    /**
+     * Constructor.
+     */
+    CHuiTextVisual(MHuiVisualOwner& aOwner);
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+    /**
+     * Destructor.
+     */
+    virtual ~CHuiTextVisual();
+
+
+    /* Methods. */
+
+    /** @beginAPI */
+    
+    /**
+     * Set the text shown in the visual. The text may contain formatting
+     * codes to change the size, color, and alignment of the text.
+     *
+     * @param aText  Descriptor containing the text.
+     */
+    IMPORT_C void SetTextL(const TDesC& aText);
+
+    /**
+     * Returns the text of the visual.
+     */
+    IMPORT_C const TDesC& Text() const;
+
+    /**
+     * Sets the alignment of the text visual.
+     */
+    IMPORT_C void SetAlign(THuiAlignHorizontal aAlignHorizontal,
+                           THuiAlignVertical aAlignVertical);
+
+
+    /**
+     * Sets the line spacing for multiline text visual when the text wraps around.
+     *
+     * @param aLineSpacing Line spacing between lines in multiline text visual.
+     * @parem aUnits       Defines the units of the line spacing.
+     *                     @see TLineSpacingUnits. 
+     */
+    IMPORT_C void SetLineSpacing(TInt aLineSpacing, TLineSpacingUnits aUnits = EPixels);
+
+
+    /**
+     * Sets the default text style of the text visual. This style describes the size
+     * and color of the rendered text.
+     *
+     * @param aStyle           Text style.
+     * @param aBackgroundType  Text background type. Affects the color of 
+     *                         the text. Defaults to EHuiBackgroundTypeLight
+     *                         (ie, black text will be used).
+     */
+    IMPORT_C void SetStyle(THuiPreconfiguredTextStyle aStyle, 
+                           THuiBackgroundType aBackgroundType = EHuiBackgroundTypeLight);
+
+    /**
+     * Sets the default text style of the text visual. This style describes the style
+     * the text is rendered with. The text style has to be created with the text style 
+     * manager. If the given text style does not exist, the text style is reverted back
+     * to default text style.
+     * @see CHuiTextStyleManager
+     *
+     * @param aTextStyleId Text style ID provided by the text style manager.
+     */
+    IMPORT_C void SetTextStyle(TInt aTextStyleId);
+    
+    /**
+     * Accesses the text style of the text visual.
+     *
+     * If a value has been set by SetFontId which is not in THuiTextStyle, then
+     * this will return EHuiTextStyleNotAHuiStyle
+     */    
+    IMPORT_C THuiPreconfiguredTextStyle Style() const;
+
+    /**
+     * Accesses the text style id of the text visual, including non-predefined styles
+     *
+     * @return text style id
+     */    
+    IMPORT_C TInt TextStyle() const;
+
+    /**
+     * Sets the maximum number of lines displayed by the text visual.
+     * The default is KMaxTInt.
+     */
+    IMPORT_C void SetMaxLineCount(TInt aMaxLineCount);
+    
+    /**
+     * Determines the maximum number of line displayed by the text visual.
+     */
+    IMPORT_C TInt MaxLineCount() const;
+    
+    /**
+     * Determines the visual's line wrapping mode.
+     *
+     * @return  Line wrapping mode.
+     */
+    IMPORT_C TLineWrap Wrapping() const;    
+    
+    /**
+     * Sets the line wrapping mode.
+     *
+     * @param aWrap  Line wrapping mode.
+     */
+    IMPORT_C void SetWrapping(TLineWrap aWrap);
+    
+    /**
+     * Determines the background type of the text visual. This was set with a 
+     * call to SetStyle().
+     */    
+    IMPORT_C THuiBackgroundType BackgroundType() const;
+
+    inline THuiTimedPoint& Offset()
+        {
+        return iOffset;
+        }
+
+    inline const THuiTimedPoint& Offset() const
+        {
+        return iOffset;
+        }
+
+    /**
+     * Determines the size of the text in the visual.
+     * Text must have been updated / or drawn to be able
+     * to use these extents.
+     *
+     * @return Size of the text in pixels, or TSize(0,0) if 
+     * text is undefined or the mesh hasn't been updated.
+     * 
+     * @see UpdateMeshL() 
+     */
+    IMPORT_C TSize TextExtents() const;
+
+	/**
+	 * Prepares text for drawing. Updates the text max line
+	 * width according to the wrapping parameters, sets the
+	 * text style and updates the text mesh.
+	 * 
+	 * @see UpdateMeshL()
+	 */
+	IMPORT_C virtual TBool PrepareDrawL();	
+
+     /**
+     * Sets the color of the text.
+     *
+     * @param aColor           Text color.
+     */
+    IMPORT_C void SetColor(const TRgb& aColor);
+
+     /**
+     * Sets the color of the text via skin id.
+     *
+     * @param aID           Skin-id of the color group to use
+     * @param aIndex        Index within the color group
+     */
+     IMPORT_C void SetColor(const TAknsItemID& aID,const TInt aIndex);
+
+    /**
+     * Get the extents of a block of characters given the visual's
+     * current font style.
+     *
+     * Gets the local pixel extents of a block of text within
+     * this text visual.
+     *
+     * Note that these extents do not take into account line breaks,
+     * so it will only return accurate results on single lines of text.
+     *
+     * @param aStart The starting character of the substring.
+     * @param aEnd The end character of the substring.
+     */
+    IMPORT_C TRect SubstringExtents(TUint aStart, TUint aEnd) const;
+
+    /**
+     * @deprecated Use CHuiDropShadow
+     *
+     * Enables or disables the text shadow.
+     * The text shadow is a special implementation
+     * of shadow that looks good with text. If this value is
+     * false, then the text will not have a shadow.
+     * This method will also reset iShadow opacity to 0 or 1.
+     * 
+     * @param aDoEnable True enables shadows, false disables.
+     */
+    IMPORT_C void EnableShadow(TBool aDoEnable);    
+    
+    
+    /**
+     * Sets highlighting for a part of Text
+     *
+     * @param aStart Startng index of Highlighted text.
+     * @param aEnd Ending index of Highlighted text.
+     * @param aHighlightColor Background color of highlighted text.
+     * @param aHightlightColor Font color of Highlighted text.
+     */
+    IMPORT_C void SetHighlightRange(TInt aStart, TInt aEnd, TRgb& aHighlightColor, TRgb& aHighlightTextColor);
+ 	  
+    
+    /** @endAPI */
+
+    /**
+     * Draw the text visual.
+     */
+    virtual void DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect) const;
+
+    /**
+     * Returns true if the text has changed and needs redrawing.
+     */
+    virtual TBool Changed() const;
+
+    /**
+     * Clear the changed flag of the visual, ie, the text has been redrawn.
+     */
+    virtual void ClearChanged();
+
+    void NotifySkinChangedL();
+
+    void GetClassName(TDes& aName) const
+        {
+        aName = _L("CHuiTextVisual");
+        }
+        
+    void ExpandRectWithContent(TRect& aRect) const;
+
+     /**
+     * Updates the text mesh within this text visual. 
+     * Updates the text font and  the text itself (possibly 
+     * renders the text to a bitmap), if needed, and 
+     * recalculates the text extents.
+     */
+    void UpdateMeshL() const;
+
+    IMPORT_C void UpdateMeshL(const TDesC8& aBuffer);
+    
+private: 
+
+private:
+
+    /** Line wrapping mode. */
+    TLineWrap iLineWrapping;
+
+    /** Horizontal alignment. */
+    THuiAlignHorizontal iAlignHorizontal;
+
+    /** Vertical alignment. */
+    THuiAlignVertical iAlignVertical;
+
+    /** The text of drawn in the visual. */
+    HBufC* iText; // Owned
+
+    /** ETrue if the mesh has been updated. */
+    mutable TBool iMeshUpdated;
+
+    /** ETrue, if the extents have been updated. */
+    mutable TBool iExtentsUpdated;
+
+    /** ETrue, if the font and style has been updated. */
+    mutable TBool iFontUpdated;
+
+    /** Text mesh containing the text in a format suitable for 
+        efficient drawing. */
+    CHuiTextMesh* iTextMesh;
+
+    /** Default text style. Affects both font and other features of the text */
+    THuiPreconfiguredTextStyle iStyle;
+        
+    /** Text background type. Affects text style. */
+    THuiBackgroundType iBackgroundType;
+
+    /** Offset to the text position. */
+    THuiTimedPoint iOffset;
+
+    TRgb iFontColor;
+    TAknsItemID iFontColorId;
+    TInt iFontColorIndex;
+    TBool iFontColorValid;
+
+    /** Pictograph drawing interface */
+    CAknPictographInterface* iPictographInterface; 
+
+    /** Pictograph animator */
+    CHuiPictographAnimator* iPictographAnimator;
+    
+    
+    TInt iHighlightStart;
+    TInt iHighlightEnd;
+    TRgb iHighlightColor;
+    TRgb iHighlightTextColor;
+
+    
+public:
+
+    // @deprecated Use CHuiDropShadow
+    THuiTimedValue iShadow;
+
+    };
+
+#endif  // __HUITEXTVISUAL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTexture.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,951 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Declares CHuiTexture texture base class and THuiTextureFormat 
+*                texture data buffer formats.
+*
+*/
+
+
+
+#ifndef __HUITEXTURE_H__
+#define __HUITEXTURE_H__
+
+
+#include <e32base.h>
+#include <e32std.h>
+#include <gdi.h>
+
+#include <uiacceltk/HuiTextureIf.h>
+#include <uiacceltk/HuiTextureHandle.h>
+#include <uiacceltk/HuiSegmentedTexture.h>
+#include <uiacceltk/HuiShadowedTexture.h>
+#include <uiacceltk/HuiObserverArray.h>
+#include <uiacceltk/HuiSessionObject.h>
+#include <uiacceltk/HuiRealSize.h>
+#include <uiacceltk/huitextureautosizeparams.h>
+
+// Uids for the extension functions used by TextureExtension()
+const TUid KHuiTextureExtUid_UploadDirectL = {0x200100C3};
+
+/* Forward declaration. */
+class CHuiTexture;
+
+
+/**
+ * Texture content observing interface.
+ */
+class MHuiTextureContentObserver
+    {
+public:
+
+    virtual ~MHuiTextureContentObserver() 
+        {
+        }
+    
+    /**
+     * Called when new content has been uploaded to the specified texture.
+     * 
+     * The implementor should call the relevant methods in CHuiTexture to
+     * get more information about the new content (CFbsBitmaps or raw data;
+     * these are available while the notification is taking place).
+     *
+     * @param aTexture  Texture that has received new content.
+     */
+    virtual void TextureContentUploaded(CHuiTexture& aTexture) = 0;
+
+    /**
+     * Called when the texture's content has been released.
+     *
+     * @param aTexture  Texture that has been released.
+     */
+    virtual void TextureContentReleased(CHuiTexture& aTexture) = 0;
+    
+    /**
+     * Called when the content of the texture needs to be restored to the
+     * same state it was when the texture was released.
+     *
+     * @param aTexture  Texture that has been restored.
+     */
+    virtual void RestoreTextureContentL(CHuiTexture& aTexture) = 0;
+        
+    };
+
+
+
+/**
+ * CHuiTexture is the base class for all texture objects. It implements
+ * the MHuiSegmentedTexture interface for multipart support. Multi-segment
+ * textures can be operated in the same way as one would operate
+ * single-segment textures.
+ *
+ * The application will only need to call a  method with "Segment" in its name
+ * if it explicitly wants to manipulate a  specific segment in a texture.
+ * (E.g., when it wants to upload a new  sub-texture into the segment.)
+ *
+ * The base class enables CHuiTexture to handle large textures as smaller
+ * texture segments. Each segment has a position, dimensions, and a name that
+ * identifies the texture image of the segment. The purpose is that it is
+ * possible to compose large images out of smaller segments. The segments can
+ * overlap.
+ *
+ * One use case is where the OpenGL texture size is limited (e.g., 256x256).
+ * CHuiTexture can split the uploaded source image to multiple
+ * segments and create a different OpenGL texture for each. All of the segments
+ * are hidden inside CHuiTexture, though, so it could be treated as
+ * a single entity.
+ *
+ * A CHuiTexture always represents one or more fully loaded (OpenGL ES) texture
+ * objects. When drawing something, THuiImages are used for determining the
+ * area of  the texture to draw. However, different segments may utilize
+ * textures in different resolutions.
+ *
+ * @see THuiImage
+ * @see CHuiGc
+ *
+ */
+class CHuiTexture : public CBase, public MHuiTexture,
+                    public MHuiSegmentedTexture, public MHuiShadowedTexture,
+                    public MHuiSessionObject
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /** @beginAPI */
+
+    /**
+     * Exported static factory method. Creates a texture appropriate for the current
+     * renderer.
+     */
+    IMPORT_C static CHuiTexture* NewL(const THuiTextureHandle* aExistingTexture = 0);
+
+    /**
+     * Exported static factory method. Creates a texture appropriate for the current
+     * renderer.
+     */
+    IMPORT_C static CHuiTexture* NewLC(const THuiTextureHandle* aExistingTexture = 0);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C ~CHuiTexture();
+
+
+public: // new methods
+    /**
+     * Returns the file name of the texture's source image (if any).
+     */
+    IMPORT_C const TDesC& ImageFileName() const;
+
+    /**
+     * Determines whether the texture has content. Only textures that
+     * have content can be drawn.
+     *
+     * Note that a texture that has not finished loading will return EFalse
+     * here, because its content will only become available after it has
+     * been fully loaded.
+     *
+     * @return ETrue, if this texture has content.
+     */
+    IMPORT_C virtual TBool HasContent() const;
+
+
+
+    /* CHuiTexture pure virtual methods (interface methods). */
+
+    /**
+     * Determines if the texture has an alpha channel.
+     *
+     * @return  <code>ETrue</code>, if the texture has an alpha channel.
+     *          Otherwise, <code>EFalse</code>.
+     */
+    virtual TBool HasAlpha() const = 0;
+
+    /**
+     * Determines the maximum possible actual (OpenGL/in-memory) size for
+     * textures. Typically returns power-of-two dimensions. This limit is
+     * usually set by the underlying graphics driver/hardware.
+     */
+    virtual TSize MaxTextureSize() const = 0;
+
+    /**
+     * Uploads texture data from an FBS bitmap onto this texture.
+     *
+     * Bitmap to texture upload consists of the following tasks:
+     * <ul>
+     *    <li> Setups the texture (logical) size.</li>
+     *    <li> Calculates if segmentation is needed, and setups the segments
+     *         (as necessary / optional).</li>
+     *    <li> Convert / downscale and crop the bitmap data to create bitmap(s)
+     *         suitable for uploading.</li>
+     *    <li> Transfers bitmap data to the graphics device driver.
+     * </ul>
+     *
+     * If the texture uses EHuiTextureFlagAllowDirectBitmapUsage flag, the method
+     * CHuiTextureManager::UpdateTextureFromBitmapL() should be used instead. This 
+     * method leaves with KErrNotSupported in that case.  
+     *
+     * @param aBitmap       Bitmap to copy image contents and format from
+     *                      (RGB data).  The support for input CFbsBitmap formats 
+     *                      varies between different renderers. 
+     *                      See \ref cfbsbitmapsupport Table describing renderer 
+     *                      bitmap support. 
+     * 
+     * @param aMaskBitmap   Optional Bitmap for alpha (transparency) channel.
+     *                      If the image does not require an alpha channel or the
+     *                      aBitmap already has alpha information (RGBA image)
+     *                      this value may be left as NULL. The bitmap will be
+     *                      combined with aBitmap to single RGBA image. If used,
+     *                      this alpha mask bitmap will replace any alpha
+     *                      information in aBitmap.
+     * 
+     * @param aFlags        Specify texture upload behavior - how to convert the
+     *                      bitmap to texture. You can OR these flags together.
+     *
+     * If the UploadL runs out of memory while uploading/converting
+     * the method may try to upload with smaller bitmap sizes and
+     * force use of more memory-efficient single-segment texture.
+     *
+     * @see SetSize() Use if you want to change the logical size (for example to
+     * fix the aspect ratio of the bitmap) of the texture after uploading.
+     */
+    virtual void UploadL(const CFbsBitmap& aBitmap,
+                         const CFbsBitmap * aMaskBitmap = NULL,
+                         THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault) = 0;
+
+    /**
+     * Uploads bitmap data onto this texture.
+     *
+     * Bitmap to texture upload consists of the following tasks:
+     * <ul>
+     *    <li> Setups the texture (logical) size.</li>
+     *    <li> Transfers bitmap data to the graphics device driver.
+     * </ul>
+     *
+     * Note: This method does NOT support texture segmentation. See the
+     * CFbsBitmap upload methods (UploadL()) to create segmented textures.
+     *
+     * @param aFormat  Format of aBuffer, the image data buffer.
+     * @param aSize    Size (width and height in pixels) of the texture in the
+     *                 data buffer (aBuffer).
+     * @param aBuffer  Source Image data buffer.
+     * @param aFlags   Specify upload behavior - how to convert the bitmap to texure.
+     *
+     * @param aBufferSize Length of the compressed image data. Set as 0 for
+     * non-compressed formats.
+     */
+    virtual void UploadL(THuiTextureFormat aFormat,
+                         const TSize& aSize,
+                         const TUint8* aBuffer,
+                         THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault,
+                         TUint aBufferSize = 0) = 0;
+
+    /**
+     * Updates a partial area of this texture. Does not change the
+     * dimensions of the texture (logical size or segmentation).
+     *
+     * @note You must first call Upload() at least once so the texture object
+     * has dimensions.
+     *
+     * No local copy of the buffer data
+     * is made.
+     *
+     * @note Does not work with multisegmented textures!
+     *
+     * @param aFormat  Format of the data buffer.
+     * @param aOrigin  Position to place the partial texture data.
+     * @param aSize    Size of the texture in the data buffer.
+     * @param aBuffer  Texture data buffer.
+     */
+     virtual void PartialUploadL(THuiTextureFormat aFormat,
+                       const TPoint& aOrigin,
+                       const TSize& aSize,
+                       const TUint8* aBuffer) = 0;
+
+    /**
+     * Clears the texture object and initializes it with solid color pixels. Will
+     * setup the logical size and reserve space for the texture if size and
+     * segmentation has not yet been prepared.
+     *
+     * @param aSize Size of the texture. Does not matter if the size
+     * and segmentation of this texture has already been set up.
+     * @param aColor Initial color of the texture.
+     * @return System error code if task failed and KErrNone if successful.
+     */
+    IMPORT_C TInt ClearL(const TSize& aSize, const TRgb& aColor);
+
+    /**
+     * Clears the texture object and initializes it with solid color pixels.
+     * The texture will be initialized with alpha data. Will
+     * setup the logical size and reserve space for the texture, if needed.
+     *
+     * @param aSize Size of the texture. Does not matter if the size
+     * and segmentation of this texture has already been set up. Use
+     * Reset() before calling Clear() to change the texture resolution and
+     * dimensions.
+     * @param aColor  Initial color of the texture.
+     * @param aAlpha  Initial alpha level of the texture.
+     * @return System error code if task failed and KErrNone if successful.
+     */
+    IMPORT_C TInt ClearWithAlphaL(const TSize& aSize, const TRgb& aColor, TUint8 aAlpha);
+
+
+
+    /**
+     * @internal
+     *
+     * Creates shadow with given parameters. If the shadow already exists with the
+     * given paramters, this function does not do a thing.
+     *
+     * @param aBlurDimension 2*radius used by the blur filter
+     * @param aStyle Defines the used shadow texture size
+     */
+    void CreateShadowTextureL( TInt aBlurDimension, THuiShadowStyle aStyle );
+    
+    /**
+     * @internal
+     *
+     * Fetches shadow with given parameters.
+     *
+     * @param aHandle Will be filled with the shadow information if found.
+     *                i.e. the function returns ETrue,
+     * @param aBlurDimension 2*radius used by the blur filter
+     *
+     * @return ETrue if a shadow texture is found with the given dimension.
+     */
+    TBool GetShadowTexture( THuiTextureHandle& aHandle, TInt aBlurDimension ) const;
+        
+
+public: // from baseclasses
+
+    /* Implementation of MHuiTexture. */
+
+    IMPORT_C MHuiSegmentedTexture* SegmentedTexture();
+
+    IMPORT_C const MHuiSegmentedTexture* SegmentedTexture() const;
+
+    IMPORT_C MHuiShadowedTexture* ShadowedTexture();
+
+    IMPORT_C const MHuiShadowedTexture* ShadowedTexture() const;
+
+    /* Implementation of MHuiShadowedTexture. */
+
+    // @deprecated 
+    IMPORT_C virtual void EnableShadow(TBool aEnable = ETrue);
+    
+    // @deprecated 
+    IMPORT_C virtual TBool IsShadowEnabled() const;
+
+    /**
+     * Sets the shadow generation style of the texture.
+     *
+     * @param aShadowStyle  Shadowing style.
+     */
+    IMPORT_C virtual void SetShadowStyle(THuiShadowStyle aShadowStyle);
+
+    /**
+     * Determines the current shadow style.
+     */
+    IMPORT_C THuiShadowStyle ShadowStyle() const;
+    
+    IMPORT_C TBool GetShadowTexture(THuiTextureHandle& aHandle) const;
+
+
+    /**
+     * Set the logical dimensions of the texture. This is the original size
+     * of the image loaded as a texture. Also will update (resize) the
+     * logical sizes and offsets of texture segments, if such segments have
+     * been previously configured.
+     *
+     * @see Size() Use to check the logical size of the texture.
+     */
+    IMPORT_C virtual void SetSize(const TSize& aSize);
+
+
+    /* Implementation of MHuiSegmentedTexture. */
+
+    /**
+     * Return logical dimensions of texture.
+     * @return The logical dimensions of the texture.
+     * @see SetSize()
+     */
+    
+    IMPORT_C TSize Size() const;
+
+    /**
+     * Number of segments in the texture.
+     * @return The number of segments in the texture.
+     */
+    IMPORT_C TInt SegmentCount() const;
+
+    /**
+     * ID of the given segment.
+     * @param aSegment The ordinal of the segment that we want the name of.
+     * @return The ID of the segment at the passed ordinal.
+     */
+    IMPORT_C TUint SegmentName(TInt aSegment) const;
+
+    /**
+     * Return logical dimensions of a segment.
+     * @param aSegment The ordinal of the segment that we want the dimensions of. 
+     * @return The logical dimensions of the segment.
+     */
+    IMPORT_C TSize SegmentSize(TInt aSegment) const;
+
+    /**
+     * Return texture dimensions of a segment.
+     * @param aSegment The ordinal of the segment that we want the texture dimensions of. 
+     * @return The dimensions of the segment's texture.
+     */
+    IMPORT_C TSize SegmentTextureSize(TInt aSegment) const;
+
+    /**
+     * Return offset of a segment.
+     * @param aSegment The ordinal of the segment that we want the offset of. 
+     * @return The the segment's offset.
+     */
+    IMPORT_C TPoint SegmentOffset(TInt aSegment) const;
+
+    /**
+     * Has texture changed.
+     * Check if the texture has changed since the last update.
+     * @return ETrue if the texture has changed.
+     */
+	IMPORT_C virtual TBool TextureChanged() const;
+
+    /**
+     * Set texture as not changed.
+     * Clear the changed flag of this texture once changes have been handled.
+     * @see TextureChanged()
+     */
+	IMPORT_C virtual void TextureClearChanged() const;
+
+    /**
+     * Set texture as (not) changed.
+     * Clear the changed flag of this texture once changes have been handled.
+     * @see TextureChanged()
+     */
+	IMPORT_C void SetTextureChanged(TBool aChanged);
+
+    /* Segmented texture data methods. */
+
+    /**
+     * Sets the number of segments. Will delete/create new segments as
+     * needed.
+     *
+     * @param aSegmentCount  Number of segments.
+     */
+    IMPORT_C virtual void SetSegmentCountL(TInt aSegmentCount);
+
+    /**
+     * Sets the name of a segment.
+     */
+    IMPORT_C virtual void SetSegmentName(TInt aSegment, TUint aName);
+
+    /**
+     * Sets the size of a segment.
+     */
+    IMPORT_C virtual void SetSegmentSize(TInt aSegment, const TSize& aSegmentSize);
+
+    /**
+     * Sets the texture size of the segment.
+     *
+     * @param aSegment Valid segment index for this texture.
+     */
+    IMPORT_C virtual void SetSegmentTextureSize(TInt aSegment, const TSize& aSegmentTextureSize);
+
+    /**
+     * Sets the logical offset of a texture segment.
+     *
+     * @param aSegment Valid segment index for this texture.
+     * @param aOffset Offset of the texture segment. Must be inside the logical
+     * dimensions of the whole texture.
+     */
+    IMPORT_C virtual void SetSegmentOffset(TInt aSegment, const TPoint& aOffset);
+    
+    /**
+     * Defines whether the texture is of skin content or not. If this texture is
+     * a part of skin content this texture will be released and restored whenever
+     * CHuiEnv::NotifySkinChangedL is called. This allows skin specific texture
+     * observers to update the content of this texture depending on the skin and
+     * it's parameters. Textures that are not part of skin content will be inaffected
+     * by the call to the CHuiEnv::NotifySkinChangedL.
+     * 
+     * @see CHuiEnv::NotifySkinChangedL()
+     * @see IsSkinContent()
+     *
+     * @param aSkinContent ETrue to set this texture as part of skin content. EFalse
+     *                     to mark that this texture is not part of skin content.
+     */
+    IMPORT_C virtual void SetSkinContent(TBool aSkinContent);
+    
+    /**
+     * Informs whether this texture is part of skin content or not. By default textures
+     * are not part of skin content.
+     *
+     * @see SetSkinContent()
+     *
+     * @return ETrue if this texture is part of skin content, EFalse otherwise.
+     */
+    IMPORT_C virtual TBool IsSkinContent() const;
+
+    /* CHuiTexture segmentation pure virtual methods (interface methods). */
+
+    /**
+     * Calculates and sets up segmentation for given size. If
+     * the given size exceeds the available maximum texture
+     * size, the area is split up to segments having dimensions no
+     * more than the maximum texture size.
+     *
+     * @param aLogicalSize  Logical size of the full image.
+     * @param aTextureSize  Texture resolution required, in pixels.
+     * @param aUploadFlags  Specify segmentation behavior - how the uploaded
+     *                      data is laid out to a texture.
+     */
+    virtual void SetupSegmentsL(const TSize& aLogicalSize,
+                                const TSize& aTextureSize,
+                                THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault) = 0;
+
+    /**
+     * Uploads bitmap data onto a texture segment. Does not
+     * change the dimensions of the texture (logical size or segmentation).
+     *
+     * This method allows direct access to texture segments. @see UploadL()
+     * if you do not care about texture segmentation.
+     *
+     * @note The image segment has to have valid dimensions.
+     *
+     * @param aSegment Valid segment index for this texture.
+     * @param aFormat  Format of the image data buffer.
+     * @param aSize    Size (width and height in pixels) of the texture in the
+     * data buffer (aBuffer).
+     * @param aBuffer  Image data buffer.
+     * @param aBufferSize Length of the compressed image data. Set as 0 for
+     * non-compressed formats.
+     */
+    virtual void SegmentUploadL(TInt aSegment,
+                               THuiTextureFormat aFormat,
+                               const TSize& aSize,
+                               const TUint8* aBuffer,
+                               TUint aBufferSize = 0) = 0;
+
+    /**
+     * Uploads FBS bitmap data onto a texture segment. Does not
+     * change the dimensions of the texture (logical size or segmentation).
+     *
+     * This method allows direct access to texture segments. @see UploadL()
+     * if you do not care about texture segmentation.
+     *
+     * @note The image segment has to have valid dimensions.
+     *
+     * @param aSegment      Valid segment index for this texture.
+     * @param aBitmap       Bitmap to copy image contents and format from
+     *                      (RGB data).
+     * @param aMaskBitmap   Optional Bitmap for alpha (transparency) channel.
+     *                      If the image does not require an alpha channel or the
+     *                      aBitmap already has alpha information (RGBA image)
+     *                      this value may be left as NULL. The bitmap will be
+     *                      combined with aBitmap to single RGBA image. If used,
+     *                      this alpha mask bitmap will replace any alpha
+     *                      information in aBitmap.
+     * @param aFlags        Specify how the uploaded data is laid out to a
+     *                      texture.
+     */
+    virtual void SegmentUploadL(TInt aSegment,
+                                const CFbsBitmap& aBitmap,
+                                const CFbsBitmap * aMaskBitmap = NULL,
+                                THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault) = 0;
+
+    /**
+     * Updates a partial area to a texture segment. Does not change the
+     * dimensions of the texture (logical size or segmentation).
+     *
+     * This method allows direct access to texture segments.
+     * @see PartialUploadL() if you do not care about texture segmentation.
+
+     * @note You must first call Upload() at least once so the texture object
+     * has dimensions and at least one segment to be updated.
+     *
+     * No local copy of the buffer data is made.
+     *
+     * @param aSegment Valid segment index for this texture.
+     * @param aFormat  Format of the data buffer.
+     * @param aOrigin  Position to place the partial texture data.
+     * @param aSize    Size of the texture in the data buffer.
+     * @param aBuffer  Texture data buffer.
+     */
+     virtual void SegmentPartialUpload(
+                       TInt aSegment,
+                       THuiTextureFormat aFormat,
+                       const TPoint& aOrigin,
+                       const TSize& aSize,
+                       const TUint8* aBuffer) = 0;
+
+    /**
+     * Clear a texture segment to a solid color.
+     */
+    virtual void SegmentClearL(TInt aSegment,
+                               TBool aWithAlpha,
+                               const TRgb& aColor,
+                               TUint8 aAlpha) = 0;
+
+
+    // Implementation of MHuiSessionObject
+    
+    /**
+     * Gets the object type.
+     */
+    IMPORT_C TType Type() const;
+
+    /**
+     * Gets the session id for object.
+     */
+    IMPORT_C TInt SessionId() const;
+
+    /**
+     * Sets the session id for object.
+     */
+    IMPORT_C void SetSessionId(TInt aSessionId);
+
+    /** @endAPI */
+
+
+    /**
+     * Delete the texture.
+     */
+    IMPORT_C virtual void Reset();
+    
+    /**
+     * Deletes the shadow textures.
+     */
+    IMPORT_C void ResetShadows();
+    
+    /**
+     * Releases the texture. The caller is responsible of checking the 
+     * release priority of the texture.
+     */
+    IMPORT_C virtual void Release();
+    
+    /**
+     * Restores the texture.
+     */
+    IMPORT_C virtual void RestoreL();
+    
+    /**
+     * Sets the texture priority. The prioriry is used when the textures are
+     * released/restored.
+     *
+     * @param aPriority 0 = never release
+     *                  other values to be decided
+     *                  By default != 0
+     */ 
+    IMPORT_C void SetPriority( TInt aPriority );
+    
+    /**
+     * Returns the priority of the texture
+     *
+     * @return The priority
+     *
+     * @see SetPriority()
+     */
+    IMPORT_C TInt Priority() const;
+
+    /**
+     * Sets the placeholder texture. Set to zero to disable the placeholder.
+     *
+     * @param aPlaceholder  Placeholder texture.
+     */
+    void SetPlaceholder(THuiTextureHandle* aPlaceholder);
+
+    /**
+     * Generates a blob texture. The texture can be then used for drawing
+     * shadow edges, for example.
+     *
+     * @param aSize  Dimensions of the blob texture.
+     */
+    void GenerateBlobL(const TSize& aSize);
+
+    /**
+     * Sets the file name of the texture's source image.
+     *
+     * @param aFileName  Image file name.
+     */
+    void SetImageFileNameL(const TDesC& aFileName);
+
+    /**
+     * Uploads the texture data to the texture. Allows using EHuiTextureFlagAllowDirectBitmapUsage flag,
+     * but the caller have to take care of deleting the bitmaps. 
+     *
+     * The bitmaps must be suitable for direct usage. Otherwise this can cause panic in rendering.
+     *
+     * @param aBitmap       Bitmap to copy image contents from.
+     * @param aMaskBitmap   Optional Bitmap for alpha (transparency) channel.
+     * @param aFlags        Specify texture upload behavior. 
+     */
+	void UploadDirectL(const CFbsBitmap& aBitmap, const CFbsBitmap* aMaskBitmap, THuiTextureUploadFlags aFlags);
+
+    /**
+     * Notifies one size what would be the most optimal size for this texture. 
+     * This method can be called e.g. from some CHuiGc image drawing operation which knows
+     * the excact size that the image appears in the display.
+     *
+     * @param aSize Auto size candidate. 
+     */
+    void NotifyPreferredSize(const THuiRealSize& aSize);
+    
+    /**
+     * Clears auto size candidates that has been reported (during last frame). This
+     * is called by the texture manager after each frame.
+     */
+    void ResetAutoSizeCalculation();
+
+    /**
+     * Flag to indicate that auto size calculations for this texture is enabled.
+     * @return ETrue if auto size calculation is enabled. 
+     */
+    TBool IsAutoSizeCalculationEnabled() const;
+
+    /**
+     * Enables auto size calculations for this texture. 
+     *
+     * Caller of this method may observe auto size changes through texture managers 
+     * MHuiTextureAutoSizeObserver interface.
+     *
+     * @param aEnable ETrue if auto size calculation is to be enabled. 
+     */
+    IMPORT_C void EnableAutoSizeCalculation(TBool aEnable=ETrue);
+
+    /**
+     * Checks if calculated auto size has been changed since last frame.
+     * @return ETrue if calculated auto size is different than the size before last reset.
+     */
+    TBool CalculatedAutoSizeChanged() const;
+
+    /**
+     * Calculates one size which is most optimal based on all the reported sizes.
+     * @return Automatically determined size for this texture.
+     */
+    THuiRealSize CalculateAutoSize();
+
+    /**
+     * Sets parameters to be used when calculating auto size.
+     * @param aParams New parameters.
+     */
+    IMPORT_C void SetAutoSizeParams(const THuiTextureAutoSizeParams& aParams);
+    
+    /**
+     * Gets parameters to be used when calculating auto size.
+     * @return Currently used parameters.
+     */
+    IMPORT_C THuiTextureAutoSizeParams AutoSizeParams() const;
+
+    
+    /**
+     * Defines whether the texture is in NVG format or not. If the texture is in
+     * NVG format, it will not eat up any texture memory. Also the autosizing
+     * is being disabled by default, since the sizing is practically free with
+     * NVG and OpenVG backend.
+     * 
+     * @see EnableAutoSizeCalculation()
+     * @see IsNVGContent()
+     *
+     * @param aNvgContent ETrue to set this texture as extended with NVG content. EFalse
+     *                    to mark that this is not an extended texture.
+     */
+    IMPORT_C void SetNvgContent(TBool aNvgContent);
+
+    /**
+     * Informs whether this texture is in NVG format or not. 
+     *
+     * @see SetNvgContent()
+     *
+     * @return ETrue if this texture is extended and in NVG format, EFalse otherwise.
+     */
+    IMPORT_C TBool IsNvgContent() const;
+
+
+protected:
+
+
+    struct TExtParams_UploadDirectL
+   		{
+   		const CFbsBitmap& iBitmap;
+   		const CFbsBitmap* iMaskBitmap;
+   		THuiTextureUploadFlags iFlags;
+   		TInt iLeaveCode;
+   		};     
+
+
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor. Creates a new texture object with no texture maps.
+     */
+    IMPORT_C CHuiTexture();
+
+    /**
+     * Second-phase constructor.
+     */
+    IMPORT_C void BaseConstructL();
+
+
+    /* Methods. */
+
+    /**
+     * Set segment data. Note that the texture name is
+     * allocated when calling InitSegmentL().
+     */
+    IMPORT_C virtual void SetSegment(TInt aSegment,
+             const TSize & iSize,
+             const TPoint & iOffset,
+             const TSize & iTextureSize);
+
+
+    /**
+     * Deallocate resources associated with segment. Will free
+     * all resources associated with a texture segment.
+     * @see SetSegmentCount()
+     */
+    virtual void ResetSegment(TInt aSegment) = 0;
+
+    /**
+     * Initialize segment for holding texture data.
+     * Allocate texture name etc.
+     */
+    virtual void InitSegmentL(TInt aSegment) = 0;
+    
+        // from MHuiTexture
+    
+    IMPORT_C void TextureExtension(const TUid& aExtensionUid, TAny** aExtensionParameters); 
+
+
+private:
+
+	/** Flags for texture state. */
+	enum THuiTextureFlags
+	    {
+	    /** Default flags. All special properties disabled. */
+	    EHuiTextureFlagDefault = 0,
+	
+	    /**
+	     * Shadow is enabled in the texture.
+	     */
+	    EHuiTextureFlagShadowEnabled = 1,
+	
+	    /**
+	     * Texture is included in the skin content.
+	     */
+	    EHuiTextureFlagSkinContent = 2,
+	    
+	    EHuiTextureFlagAddedToTManager = 4,
+
+	    /**
+	     * Texture is extended and has NVG content
+	     */
+	    EHuiTextureFlagNvgContent = 8
+
+	    // note: next flag value is 16 (we use bit positions because
+	    // we want to be able to bitwise OR these together)
+	    };
+
+	/**
+	 * A subdivided segment of this texture. This may have its OpenGL texture
+	 * manipulated independently of its parent CHuiTexture.
+	 */
+    struct TSegment
+        {
+        /** Name of texture. */
+        TUint iName;
+        /** Dimensions of texture. */
+        TSize iSize;
+        /** Offset of segment within parent. */
+        TPoint iOffset;
+        /** Size of the texture. */
+        TSize iTextureSize;
+        };
+
+	/**
+	 * Resets and removes all texture segments
+	 */
+	void RemoveAllSegments();
+	
+public:
+
+    /**
+     * Array of content observers.
+     */
+    RHuiObserverArray<MHuiTextureContentObserver> iContentObservers;	
+    TInt iFrameNumber;
+    TInt iFrameCount;
+    TInt iFrameInterval;
+
+
+private:
+
+    /** Name of the image file where the texture was loaded from. */
+    HBufC* iImageFileName;
+
+    /** Temporary texture to use until the real texture has been loaded.*/
+    THuiTextureHandle* iPlaceholder;
+
+    /** Index of the active segment. */
+    mutable TInt iActiveSegment;
+
+    /** Names of the segments. */
+    RArray<TSegment> iSegments;
+
+    /** The logical size of this texture. */
+    TSize iSize;
+
+    /** The internal texture state. Composed of THuiTextureFlags. */
+    TUint iInternalState;
+        
+    /** Shadow generation style. */
+    THuiShadowStyle iShadowStyle;
+
+    /** Session id */
+    TInt iSessionId;
+    
+    /** Priority */
+    TInt iPriority;
+ 
+    /** Flag to indicate that auto size calculations for this texture is enabled */
+    TBool iAutoSizeCalculationEnabled;    
+    
+    /** Sizes reported for this texture during last frame */
+    RArray<THuiRealSize> iPreferredSizes;
+    
+    /** Most optimal size calculated based on all reported sizes */
+    THuiRealSize iCalculatedAutoSize;
+    
+    /** Previous most optimal size calculated based on all reported sizes */
+    THuiRealSize iCalculatedPreviousAutoSize;
+    
+    THuiTextureAutoSizeParams iAutoSizeParams;
+    
+    
+    NONSHARABLE_STRUCT( TShadowData )
+        {
+        CHuiTexture* iShadowTexture; 
+        TInt iBlurDimension;
+        };
+        
+    RArray<TShadowData> iShadows;
+    
+    mutable TBool iTextureChanged;
+    };
+
+#endif  // __HUITEXTURE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTextureHandle.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,159 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of THuiTextureHandle. THuiTextureHandle is a 
+*                handle to a named texture object. It does not have ownership 
+*                of the texture object.
+*
+*/
+
+
+
+#ifndef __HUITEXTUREHANDLE_H__
+#define __HUITEXTUREHANDLE_H__
+
+
+#include <uiacceltk/HuiSegmentedTexture.h>
+#include <uiacceltk/HuiShadowedTexture.h>
+
+
+/**
+ * Handle to a single-segment texture object. Only used for referencing existing
+ * textures. Destroying the handle does not affect the texture object itself.
+ */
+NONSHARABLE_CLASS(THuiTextureHandle) : public MHuiTexture, 
+                          public MHuiSegmentedTexture
+    {
+public:
+
+    /** Constructors and destructor. */
+
+    /** @beginAPI */
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C THuiTextureHandle();
+
+    /**
+     * Constructs a texture handle.
+     * @see Set()
+     */
+    IMPORT_C THuiTextureHandle(TUint aName,
+                               const TSize& aSize,
+                               const TSize& aTextureSize);
+
+    
+    /* Methods. */
+    
+    /**
+     * Determines if this is a null handle.
+     *
+     * @return  ETrue, if this is a null handle.
+     */
+    IMPORT_C TBool IsNull() const;
+    
+    IMPORT_C TBool HasContent() const;
+    
+    /**
+     * Releases the texture object that the handle references.
+     */
+    IMPORT_C void Release();
+
+    /**
+     * Sets the handle's texture name, logical size and texture size. This is
+     * equivalent to calling SetName(), SetSize(), and SetTextureSize().
+     *
+     * @param aName  Assigns texture name of this handle. For example, with
+     * OpenGL ES renderer, this will be the texture name generated
+     * with glGenTextures().
+     * @param aSize  The logical size of this texture.
+     * @param aSize  The actual texture size of this texture.
+     */
+    IMPORT_C void Set(TUint aName, const TSize& aSize, const TSize& aTextureSize);
+
+    /** 
+     * Sets the name of the named texture object that this handle refers to. 
+     *
+     * @param aName  Name of the texture object.
+     */
+    IMPORT_C void SetName(TUint aName);
+    
+    /** 
+     * Sets the logical size of the texture object this handle refers to.
+     *
+     * @param aSize  Logical size.
+     */
+    IMPORT_C void SetSize(const TSize& aSize);
+    
+    /** 
+     * Sets the actual size of the texture object this handle refers to.
+     * For example, with OpenGL ES, this is the size of the texture object
+     * itself, which is limited to powers of two.
+     *
+     * @param aTextureSize  Texture size.
+     */
+    IMPORT_C void SetTextureSize(const TSize& aTextureSize);
+    
+    
+public:
+
+    /* Implementation of MHuiTexture. */
+    
+    IMPORT_C virtual MHuiSegmentedTexture* SegmentedTexture();
+
+    IMPORT_C virtual const MHuiSegmentedTexture* SegmentedTexture() const;
+
+    IMPORT_C virtual MHuiShadowedTexture* ShadowedTexture();
+
+    IMPORT_C virtual const MHuiShadowedTexture* ShadowedTexture() const;
+
+	IMPORT_C virtual TBool TextureChanged() const;
+	
+	IMPORT_C virtual void TextureClearChanged() const;    
+
+    /* Implementation of MHuiSegmentedTexture. */
+
+    IMPORT_C TUint Name() const;
+    
+    IMPORT_C TSize Size() const;
+    
+    IMPORT_C TInt SegmentCount() const;
+
+    IMPORT_C TUint SegmentName(TInt aSegment) const;
+
+    IMPORT_C TSize SegmentSize(TInt aSegment) const;
+
+    IMPORT_C TSize SegmentTextureSize(TInt aSegment) const;
+
+    IMPORT_C TPoint SegmentOffset(TInt aSegment) const;
+
+protected:
+    
+    IMPORT_C void TextureExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+    
+public:
+
+    /** Name of the GL texture. */
+    TUint iName;
+
+    /** Logical size of this texture. */
+    TSize iSize;
+
+    /** Real size of the GL texture object. */
+    TSize iTextureSize;
+
+    };
+
+
+#endif // __HUITEXTUREHANDLE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTextureIf.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,176 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Declares the MHuiTexture interface. MHuiTexture is the most 
+*                generic interface that all textures need to implement.
+*
+*/
+
+
+
+#ifndef __HUITEXTUREIF_H__
+#define __HUITEXTUREIF_H__
+
+
+/* Forward declarations. */
+class MHuiSegmentedTexture;
+class MHuiShadowedTexture;
+
+
+/** Data buffer formats for uploading textures. */
+enum THuiTextureFormat
+    {
+    /** RGB, 5-6-5 bits per channel. */
+    EHuiTextureFormatRgb565,
+
+    /** RGB, 8 bits per channel. */
+    EHuiTextureFormatRgb888,
+
+    /** RGBA, 8 bits per channel. */
+    EHuiTextureFormatRgba8888,
+
+    /** Luminance + Alpha, 8 bits per channel. */
+    EHuiTextureFormatLa88,
+
+    /** RGB, PVRTC 4 bpp. */
+    EHuiTextureFormatRgbPVRTC4,
+
+    /** RGBA, PVRTC 4 bpp. */
+    EHuiTextureFormatRgbaPVRTC4,
+
+    /** RGB, PVRTC 2 bpp. */
+    EHuiTextureFormatRgbPVRTC2,
+
+    /** RGBA, PVRTC 2 bpp. */
+    EHuiTextureFormatRgbaPVRTC2
+    };
+
+
+/** Flags for texture uploading. */
+enum THuiTextureUploadFlags
+    {
+    /** No special actions/behavior needed. */
+    EHuiTextureUploadFlagDefault = 0,
+
+    /**
+     * @deprecated This is default functionality 
+     */
+    EHuiTextureUploadFlagRetainResolution = 1,
+
+    /**
+     * Automatically generates a shadow for the texture in texture upload
+     * phase.
+     */
+    EHuiTextureUploadFlagGenerateShadow = 2,
+
+    /**
+     * Use to retain the color depth of the
+     * ((up)loaded) image as well as possible. Otherwise
+     * the toolkit may reduce the color depth of the texture
+     * to conserve memory.
+     */
+    EHuiTextureUploadFlagRetainColorDepth = 4,
+
+    // note: value 0x8 is reserved in client server model so we leave hole here
+
+    /**
+     * Set if it is not necessary to retain the
+     * full resolution of the bitmap (tries to match texture resolution
+     * with bitmap resolution).
+     * This may save some memory with hardware acceleration, but image quality changes to worse
+     */
+    EHuiTextureUploadFlagDoNotRetainResolution = 0x10,
+
+    /**
+     * Use the provided bitmap directly for the texture, without conversion or copying. The bitmaps
+     * should be in the correct format and they shall not be compressed or have duplicated handle.
+     * If the direct bitmap cannot be used, this flag is ignored internally.
+     */
+    EHuiTextureFlagAllowDirectBitmapUsage = 0x20,
+
+    /**
+     * If given to texture's SegmentUpload() while bitmap being uploaded is in NVG format,
+     * the texture will have NVG ObjectCached data created for quicker drawing. 
+     * 
+     * By default if no flags is given as parameters, the NVG data will be rasterized
+     * into PBuffer (=VGImage) during upload, since using VGImages is the fastet way.
+     */
+    EHuiTextureUploadFlagUsePureNvg = 0x40
+    };
+
+
+/**
+ * MHuiTexture is the most generic interface that all texture classes need to
+ * implement. Using MHuiTexture, it is possible to determine which interfaces
+ * a specific texture supports.
+ */
+class MHuiTexture
+    {
+public:
+
+    /* Destructor. */
+
+    /**
+     * Virtual destructor.
+     */
+    IMPORT_C virtual ~MHuiTexture();
+
+
+    /* Interface methods. */
+
+    /**
+     * @return  The texture as a MHuiSegmentedTexture interface, or NULL is
+     *          the texture does not implement the segmented texture interface.
+     */
+    virtual MHuiSegmentedTexture* SegmentedTexture() = 0;
+
+    virtual const MHuiSegmentedTexture* SegmentedTexture() const = 0;
+
+    /**
+     * @return  The texture as a MHuiShadowedTexture interface, or NULL is
+     *          the texture does not implement the shadowed texture interface.
+     */
+    virtual MHuiShadowedTexture* ShadowedTexture() = 0;
+
+    virtual const MHuiShadowedTexture* ShadowedTexture() const = 0;
+
+    /**
+     * Returns true if the texture has changed since the last change
+     * notification. Changed means that the bitmap data of the texture
+     * has been modified, and must be re-uploaded to texture memory.
+     */
+	virtual TBool TextureChanged() const = 0;
+
+    /**
+     * Clears the changed status of the visual.
+     */
+	virtual void TextureClearChanged() const = 0;    
+	
+    /**
+     * Determines whether the texture has content. Only textures that
+     * have content can be drawn.
+     *
+     * Note that a texture that has not finished loading will return EFalse
+     * here, because its content will only become available after it has
+     * been fully loaded.
+     *
+     * @return ETrue, if this texture has content.
+     */
+    virtual TBool HasContent() const = 0;
+    
+    virtual void TextureExtension(const TUid& aExtensionUid, TAny** aExtensionParameters) = 0; 
+
+    };
+
+
+#endif // __HUITEXTUREIF_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTextureManager.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1174 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+*
+* Nokia Corporation - initial contribution.
+* Contributors:
+*
+* Description:   Defines CHuiTextureManager class for texture objects loading 
+*                and management.
+*
+*/
+
+
+
+#ifndef __HUITEXTUREMANAGER_H__
+#define __HUITEXTUREMANAGER_H__
+
+
+#include <e32base.h>
+#include <gdi.h>
+#include <imageconversion.h>
+
+#include <uiacceltk/HuiObserverArray.h>
+#include <uiacceltk/HuiTimeObserver.h>
+#include <uiacceltk/HuiTexture.h>
+#include <uiacceltk/HuiBitmapProvider.h>
+
+
+/* Forward declarations */
+class CHuiEnv;
+class CHuiTextureManager;
+class CHuiTextureProcessor;
+class CHuiTextureAnimationState;
+
+/**
+ * Provides callback methods for getting notifications of texture manager state
+ * changes. An observer of a CHuiTextureManager.
+ *
+ * The class willing to receive these events must implement the methods
+ * of this interface, and then register itself to the obsevers list of
+ * the texture manager.
+ *
+ * @see CHuiTextureManager
+ */
+class MHuiTextureManagerStateChangedObserver
+    {
+public:
+    /**
+     * Called to notify the observer that the state of the texture manager
+     * has changed. This is called when the state changes between Idle and
+     * Loading.
+     *
+     * @param aManager  Texture manager.
+     */
+    virtual void TextureManagerStateChanged(const CHuiTextureManager& aManager) = 0;
+
+    };
+
+/**
+ * Provides callback methods for getting notifications when texture manager
+ * finishes asynchronous texture loads. An observer of a CHuiTextureManager.
+ *
+ * The class willing to receive these events must implement the methods
+ * of this interface, and then register itself to the obsevers list of
+ * the texture manager.
+ *
+ * @see CHuiTextureManager
+ */
+class MHuiTextureLoadingCompletedObserver
+    {
+public:
+    /**
+     * Called to notify the observer that loading of a texture has
+     * been completed.
+     * @param aTexture Reference to the texture that has been loaded.
+     * @param aTextureId Id of the texture in the texture manager. Can be used
+     * to identify the loaded texture, provided that an id was assigned to the
+     * texture.
+     * @param aErrorCode KErrNone if the load was successful, otherwise one of
+     * the system-wide error codes indicating reason why the texture loading
+     * failed.
+     * @note One should not commence loading of a new texture in this callback method.
+     */
+    virtual void TextureLoadingCompleted(CHuiTexture& aTexture,
+                                         TInt aTextureId,
+                                         TInt aErrorCode) = 0;
+
+    };
+
+
+/**
+ * Provides callback methods for getting notifications when texture manager
+ * notices a texture which preferrred size is changed.
+ *
+ * The class willing to receive these events must implement the methods
+ * of this interface, and then register itself to the obsevers list of
+ * the texture manager.
+ *
+ * @see CHuiTextureManager
+ */
+class MHuiTextureAutoSizeObserver
+    {
+public:
+    /**
+     * Called to notify the observer that the preferred size of a texture
+     * has beem changed.
+     *
+     * @param aTexture  Texture which preferred size has changed.
+     * @param aTextureId Id of the changed texture.
+     * @param aSize New preferred size for texture.
+     * @return ETrue if observer accepts new size, EFalse if it does not accept or 
+     * doesn't care. 
+     */
+    virtual TBool PreferredSizeChanged(const CHuiTexture& aTexture, TInt aTextureId, const THuiRealSize& aSize) = 0;    
+    
+    /**
+     * Called to notify the observer that all changed preferred sizes of textures are
+     * reported (for this frame).
+     */
+    virtual void PreferredSizeReportCompleted() = 0;
+    };
+
+/**
+ * CHuiTextureManager is responsible for managing the texture objects used by
+ * the application. It provides asynchronous loading of image data into
+ * CHuiTexture instances. The texture manager also manages font textures,
+ * which can be used for compositing text in text meshes.
+ *
+ * The texture manager makes sure that only one copy of each image is loaded
+ * at a time, so even if the application requests the same image several times
+ * it is only loaded once. Textures are identified either by an integer ID or
+ * by their file name.
+ *
+ * @todo Document supported image (file) formats / how are the images loaded
+ *
+ * CHuiTextureManager is owned by CHuiEnv, and should be accessed via a
+ * CHuiEnv instance. You should never construct your own texturemanagers.
+ *
+ * @lib hitchcock.lib
+ */
+class CHuiTextureManager : public CActive
+    {
+public:
+
+    /**
+     * States of a CHuiTextureManager object.
+     */
+    enum TState
+        {
+        /** Indicates that the manager is in idle state. A new bitmap loading
+            operation can be started. */
+        EIdle,
+
+        /** Indicates that the manager is loading a bitmap. */
+        ELoading
+        };
+
+
+    /* Constructors and destructor. */
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CHuiTextureManager();
+
+
+    /* Methods. */
+
+    /** @beginAPI */
+
+    /**
+     * Determines the environment the manager belongs to.
+     */
+    IMPORT_C CHuiEnv& Env();
+
+    /**
+     * Retuns a texture having given id. Will return a blank
+     * texture if the id was not found. With this method
+     * there is a danger of editing the blank texture
+     * instead of the real texture you intended to edit.
+     */
+    IMPORT_C CHuiTexture* Texture(TInt aId);
+
+    /**
+     * Retuns a texture having given id. Will return a default blank
+     * texture if the id was not found.
+     */
+    IMPORT_C const CHuiTexture* Texture(TInt aId) const;
+
+    /**
+     * Returns a texture associated with the given id.
+     * Will leave if no associated texture exists. If the texture
+     * is defined using the DefineFileNameL but the texture data
+     * is not yet loaded then this method call will result in
+     * LoadTextureL call.
+     *
+     * @param aId Id of the retrieved texture.
+     * @return Pointer to the texture. If the method leaves the return value is undefined.
+     * @leave KErrNotFound If a texture with the given id does not exist.
+     */
+    IMPORT_C CHuiTexture* TextureL(TInt aId);
+
+    /**
+     * Sets the path where bitmaps are loaded from. If drive is not included, tries to resolver that 
+     * using CCoeEnv
+     *
+     * @param aPath  Path for bitmap files.
+     * @see LoadTexture() Call to load textures from this location.
+     */
+    IMPORT_C void SetImagePathL(const TDesC& aPath);
+
+    /**
+     * Returns the current image path.
+     * @see LoadTexture() Call to load textures from this location.
+     */
+    IMPORT_C const TDesC& ImagePath() const;
+
+    /**
+     * Returns the blank texture. This can be used as a dummy texture if
+     * no real texture is available.
+     */
+    IMPORT_C const CHuiTexture& BlankTexture() const;
+
+    /**
+     * Returns the blank texture. This can be used as a dummy texture if
+     * no real texture is available. Will generate the blank texture
+     * if the texture is not yet available.
+     */
+    IMPORT_C CHuiTexture& BlankTexture();
+
+    /**
+     * Loads an image and makes it a texture. The bitmap files are searched in
+     * the path specified with SetImagePathL. The format of the loaded image
+     * must be supported by the system (Series 60) codecs.
+     *
+     * LoadTextureL is an asynchronous method, which returns an empty texture
+     * which is loaded and filled in the background. Register an
+     * MHuiTextureLoadingCompletedObserver instance to the iLoadedObservers
+     * array, whose TextureLoadingCompleted() method will be called when
+     * textures finish loading. The same observer is also called if an error
+     * occurs during the loading process. The other method is to check if an
+     * image has been loaded with TextureManagers IsLoaded().
+     *
+     * If a texture with the given id or filename is already loaded the previously
+     * loaded texture is returned. If texture with the given id has been unloaded
+     * with UnloadTexture() method then the id is reused by loading a new texture
+     * on the id.
+     *
+     * @param aImageFileName    Name of the image bitmap file to load. Relative
+     *                          to the image load path. If empty filename is
+     *                          used, will check if a filename for the id has
+     *                          been defined and load a texture using that resource
+     *                          location, if possible.
+     * @param aFlags            Specify flags for the texture loading and
+     *                          uploading - how to convert the bitmap to
+     *                          texture.
+     * @param aId               Id for the texture. Must be unique, but may be
+     *                          left unassigned. Use zero for unassigned id.
+     *
+     * @note                    If both image name and id are left undefined
+     *                          ("" and zero), will return a blank texture.
+     *
+     * @return                  Reference to the texture.
+     *
+     * @see SetImagePathL() To set the image search path. Set to "" to use
+     * absolute image filenames.
+     * @see iLoadObservers
+     * @see MHuiTextureLoadingCompletedObserver::TextureLoadingCompleted()
+     * @see IsLoaded()
+     */
+    IMPORT_C CHuiTexture& LoadTextureL(const TDesC& aImageFileName,
+                                       THuiTextureUploadFlags aFlags
+                                         = EHuiTextureUploadFlagDefault,
+                                       TInt aId = 0,
+                                       TInt aFrameNumber = 0);
+
+   /**
+     * Loads an image based on pre-registered id and file name.
+     *
+     * @see DefineFileName()
+     *
+     * LoadTextureL is an asynchronous method, which returns an empty texture
+     * which is loaded and filled in the background. Register an
+     * MHuiTextureLoadingCompletedObserver instance to the iLoadedObservers
+     * array, whose TextureLoadingCompleted() method will be called when
+     * textures finish loading. The same observer is also called if an error
+     * occurs during the loading process. The other method is to check if an
+     * image has been loaded with TextureManagers IsLoaded().
+     *
+     * If a texture with the given id or filename is already loaded the previously
+     * loaded texture is returned. If texture with the given id has been unloaded
+     * with UnloadTexture() method then the id is reused by loading a new texture
+     * on the id.
+     *
+     * @param aId             The id of the texture/filename to load. The id must
+     *                        have a filename assigned by a call to DefineFileName().
+     *                        If the id is left undefined (zero), will return a
+     *                        blank texture.
+     * @param aTextureMaxSize Can be used to define a maximum dimensions for
+     *                        the final texture. The image data loaded will be
+     *                        scaled (down) and fitted to these dimensions. Use
+     *                        zero or below-zero values if size does not matter.
+     *                        If the texture size is larger than the texture size
+     *                        supported by the GL, the texture will be split to
+     *                        multiple segments.
+     * @param aFlags          Specify upload behavior - how to convert the bitmap
+     *                        to texture and other load/upload behavior.
+     *
+     * @return                Reference to the texture.
+     *
+     * @see SetImagePathL()   To set the image search path. Set to "" to use
+     *                        absolute image filenames.
+     * @see iLoadObservers
+     * @see MHuiTextureLoadingCompletedObserver::TextureLoadingCompleted()
+     * @see IsLoaded()
+     */
+    IMPORT_C CHuiTexture& LoadTextureL(const TInt aId,
+                                       const TSize& aTextureMaxSize = TSize(0,0),
+                                       THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault);
+
+    /**
+     * Loads an image and makes it a texture. The bitmap files are searched in
+     * the path specified with SetImagePathL. The format of the loaded image
+     * must be supported by the system (Series 60) codecs.
+     *
+     * LoadTextureL is an asynchronous method, which returns an empty texture
+     * which is loaded and filled in the background. Register an
+     * MHuiTextureLoadingCompletedObserver instance to the iLoadedObservers
+     * array, whose TextureLoadingCompleted() method will be called when
+     * textures finish loading. The same observer is also called if an error
+     * occurs during the loading process. The other method is to check if an
+     * image has been loaded with TextureManagers IsLoaded().
+     *
+     * If a texture with the given id or filename is already loaded the previously
+     * loaded texture is returned. If texture with the given id has been unloaded
+     * with UnloadTexture() method then the id is reused by loading a new texture
+     * on the id.
+     *
+     * @param aImageName            Name of the image bitmap file to load. If
+     *                              empty filename is used, will check if a
+     *                              filename for the aId has been defined
+     *                              (using DefineFileNameL()) and load a texture
+     *                              using that resource location, if possible.
+     * @param aTextureMaxSize       Can be used to define a maximum dimensions
+     *                              for the final texture. The image data
+     *                              loaded will be scaled (down) and fitted to
+     *                              these dimensions. Use zero or below-zero
+     *                              values if size does not matter. If the
+     *                              texture size is larger than the texture
+     *                              size supported by the GL, the texture will
+     *                              be split to multiple segments.
+     * @param aFlags                Specify load/upload behavior - how to convert
+     *                              the bitmap to texture.
+     * @param aId                   Id for the texture. Must be unique.
+     *                              Use zero for unassigned id.
+     *
+     * @note                        If both image name and id are left undefined
+     *                              ("" and zero), will return a blank texture.
+     *
+     * @return Reference to the texture.
+     *
+     * @see SetImagePathL() To set the image search path. Set to "" to use
+     * absolute image filenames.
+     * @see iLoadObservers
+     * @see MHuiTextureLoadingCompletedObserver::TextureLoadingCompleted()
+     * @see IsLoaded()
+     */
+    IMPORT_C CHuiTexture& LoadTextureL(const TDesC& aImageName,
+                                       const TSize& aTextureMaxSize,
+                                       THuiTextureUploadFlags aFlags
+                                         = EHuiTextureUploadFlagDefault,
+                                       TInt aId = 0,
+                                       TInt aFrameNumber = 0);
+
+    /**
+     * Creates a texture by calling the ProvideBitmapL method of the passed MHuiBitmapProvider.
+     *
+     * If a texture with the given id is already created or loaded the previously
+     * existing texture is returned. If texture with the given id has been unloaded
+     * with UnloadTexture() method then the id is reused by loading a new texture
+     * on the id.
+     *
+     * If EHuiTextureFlagAllowDirectBitmapUsage flag is used, the provided bitmaps should be in the 
+     * preferred format. That can be found using CHuiDisplay::GetPreferredTextureFormats(). Also 
+     * the bitmaps shall not be compressed or have duplicated handle.
+     *
+     * @param aBitmapProvider       A bitmap provider that will load the bitmaps for us. The
+     *                              ProvideBitmapL method of this will be called, which should
+     *                              load or generate the needed bitmaps.
+     * @param aFlags                Specify load/upload behavior - how to convert
+     *                              the bitmap to texture.
+     * @param aId                   Id for the texture. Must be unique.
+     *                              Use zero for unassigned id.
+     * @return Reference to the created texture.
+     * @leave KErrArgument The bitmap and the mask bitmap are incompatible (different size) or 
+                           in incorrect format
+     */
+    IMPORT_C CHuiTexture& CreateTextureL(TInt aId,
+                                         MHuiBitmapProvider* aBitmapProvider,
+                                         THuiTextureUploadFlags aFlags);
+
+    /**
+     * Update the texture content by calling the ProvideBitmapL method for the existing provider. 
+     * Also a new provider can be given as a parameter. The texture must exist prior calling this 
+     * method. 
+     *
+     * If EHuiTextureFlagAllowDirectBitmapUsage flag is used, the provided bitmaps should be in the 
+     * preferred format. That can be found using CHuiDisplay::GetPreferredTextureFormats(). Also 
+     * the bitmaps shall not be compressed or have duplicated handle.
+     *
+     * @param aId                   Id for the texture. Must be unique.
+     *                              Use zero for unassigned id.
+     * @param aBitmapProvider       A bitmap provider that will load the bitmaps for us. The
+     *                              ProvideBitmapL method of this will be called, which should
+     *                              load or generate the needed bitmaps.
+     * @leave KErrNotFound The texture id does not exist or the source bitmap is not found.
+     * @leave KErrArgument The bitmap and the mask bitmap are incompatible (different size) or 
+                           in incorrect format
+     */
+ 	IMPORT_C void UpdateTextureFromBitmapL(TInt aId, MHuiBitmapProvider* aBitmapProvider = NULL);
+ 
+   /**
+     * Unloads a texture from memory.
+     *
+     * This method releases the texture id and image name for reusing.
+     * @see LoadTexture().
+     *
+     * @note May unload several textures from memory, if they have the
+     * sane image name assigned!
+     */
+    IMPORT_C void UnloadTexture(const TDesC& aImageName, const TInt aFrameNumber = 0);
+
+    /**
+     * Unloads a texture from memory.
+     *
+     * This method releases the texture id and image name for reusing.
+     * @see LoadTexture().
+     */
+    IMPORT_C void UnloadTexture(TInt aId);
+
+    /**
+     * Define (register) a texture resource (filename/path) for
+     * a texture id. Enables calling the LoadTextureL only with an id.
+     * This resource will then be loaded when LoadTextureL
+     * is called with the id.
+     */
+    IMPORT_C void DefineFileNameL(TInt aId, const TDesC& aImageName);
+
+    /**
+     * Returns the number of images waiting to be loaded.
+     *
+     * @return  Length of the load queue.
+     */
+    IMPORT_C TInt LoadQueueCount() const;
+
+    /**
+     * Returns the state of the texture manager.
+     */
+    inline TState State() const
+        {
+        return iState;
+        }
+
+    /**
+     * Returns a reference to the texture processor.
+     *
+     * @panic THuiPanic::ETextureManagerNoProcessor  Texture processor is not available.
+     */
+    IMPORT_C CHuiTextureProcessor& Processor();
+
+    /**
+     * Prepends the image path to the beginning of the file name,
+     * if necessary.
+     */
+    IMPORT_C void PrependImagePath(TDes& aFileName) const;
+
+    /**
+     * Iterates through the managed textures to find aTexture, and then
+     * assigns it a new ID of aId.
+     *
+     * @param aTexture  The managed texture whose ID we want to change.
+     * @param aId       The texture ID that we want to assign to the managed texture.
+     *
+     * @return          ETrue if the texture was found and the ID set, EFalse if the
+     *                  texture was not found in the manager's list.
+     */
+    IMPORT_C TBool SetTextureId(CHuiTexture* aTexture, TInt aId);
+
+    /**
+     * Checks if a texture exists, has content and is not found
+     * from the texture load queue.
+     * 
+     * Mainly meant for file-based textures to check if the 
+     * texture is ready to be used. 
+     * 
+     * Note that textures may have some temporary placeholder
+     * content already before they have been fully loaded!
+     * 
+     * For CreateTextureL -based textures it is recommended to use
+     * CHuiTexture::HasContent() directly.
+     * 
+     * @see LoadTextureL()
+     * @see CreateTextureL()
+     * @see CHuiTexture::HasContent()
+     *
+     * @param aImageName  Name of the image bitmap file to check. 
+     * 					  ImagePath (if set) will be prepended to 
+     * 					  this name.
+     * @return 			  ETrue if texture exists, has content and 
+     * 					  is not found from the texture load queue.
+     */
+    IMPORT_C TBool IsLoaded(const TDesC& aImageName, const TInt aFrameNumber = 0) const;
+
+    /**
+     * Checks if a texture exists, has content and is not found
+     * from the texture load queue.
+     * 
+     * Mainly meant for file-based textures to check if the 
+     * texture is ready to be used. 
+     * 
+     * Note that textures may have some temporary placeholder
+     * content already before they have been fully loaded!
+     * 
+     * For CreateTextureL -based textures it is recommended to use
+     * CHuiTexture::HasContent() directly.
+     * 
+     * @see LoadTextureL()
+     * @see CreateTextureL()
+     * @see CHuiTexture::HasContent()
+     *
+     * @param aId 		Id of the texture.
+     * @return 			ETrue if texture exists, has content and is not found
+     * 					from the texture load queue.
+     */
+    IMPORT_C TBool IsLoaded(TInt aId) const;
+
+    /**
+     * Checks if a texture exists, has content and is not found
+     * from the texture load queue.
+     * 
+     * Mainly meant for file-based textures to check when the 
+     * texture is ready to be used. 
+     * 
+     * Note that textures may have some temporary placeholder
+     * content already before they have been fully loaded!
+     * 
+     * For CreateTextureL -based textures it is recommended to use
+     * CHuiTexture::HasContent() directly.
+     * 
+     * @see LoadTextureL()
+     * @see CreateTextureL()
+     * @see CHuiTexture::HasContent()
+     *
+     * @param aTexture Texture object.
+     * @return True if texture exists, has content and is not found
+     * from the texture load queue.
+     */
+    IMPORT_C TBool IsLoaded(const CHuiTexture * aTexture) const;
+
+    /** @endAPI */
+
+
+    /**
+     * Appends a texture to the texture manager's list of managed textures.
+     * Ownership of the texture is transferred to the manager; when the manager
+     * is destroyed, the texture will be destroyed, too.
+     *
+     * @param aTexture  Texture to transfer to the manager.
+     * @param aId       Id for the texture. Must be unique. Use zero for
+     * unassigned id.
+     * @leave KErrAlreadyExists if a texture with the given id already exists.
+     *
+     * @todo Does not check (or replace) already existing duplicate textures
+     * having matching id.
+     */
+    IMPORT_C virtual void AppendTextureL(CHuiTexture* aTexture, TInt aId = 0);
+
+    /**
+     * Removes a texture from management. The texture's ownership is
+     * transferred to the caller.
+     *
+     * @param aTexture  Texture to remove from management.
+     */
+    IMPORT_C virtual void RemoveTexture(CHuiTexture& aTexture);
+
+    /**
+     * Informs the texture manager that time has progressed. The manager will
+     * update any animated textures.
+     */
+    IMPORT_C void AdvanceTime(TReal32 aElapsedTime) const;
+
+    /**
+     * Releases texture manager resources. Releases all textures. Called when the
+     * render plugin is released.
+     *
+     * While the release operation is in progress, it is not possible to delete
+     * CHuiTexture instances or create new ones. After the release has been
+     * completed, textures can again be deleted and created.
+     *
+     * @return ETrue if the all the textures were released.
+     *         EFalse if some of the textures 
+     * @panic ETextureManagerTextureConstructedDuringRelease
+     *      A new CHuiTexture was constructed and added to the texture
+     *      manager during the release operation.
+     * @panic ETextureManagerTextureDestroyedDuringRelease
+     *      An existing CHuiTexture was destroyed and removed from the texture
+     *      manager during the release operation.
+     *
+     * @see RestoreL()
+     */
+    IMPORT_C virtual TBool Release();
+
+    /**
+     * Restores texture manager resources. Restores the content of all textures
+     * released in Release(). Called when render plugin restored.
+     *
+     * While the restore operation is in progress, it is not possible to delete
+     * CHuiTexture instances or create new ones. After the restore has been
+     * completed, textures can again be deleted and created.
+     *
+     * @panic ETextureManagerTextureConstructedDuringRestore
+     *      A new CHuiTexture was constructed and added to the texture
+     *      manager during the restore operation.
+     * @panic ETextureManagerTextureDestroyedDuringRestore
+     *      An existing CHuiTexture was destroyed and removed from the texture
+     *      manager during the restore operation.
+     *
+     * @see Release()
+     */
+    IMPORT_C virtual void RestoreL();
+    
+    /**
+     * Releases and restores skin dependent textures. Usually called after
+     * system skin has been changed.
+     */
+    IMPORT_C void NotifySkinChangedL();
+    
+    /**
+     * Adds animated texture group. 
+     * Use this method to inform texture manager that when texture is loaded, 
+     * it's allowed to use previous state of the group. Each texture id should 
+     * belong at most to one group. This method should be called before
+     * using these texture ids to load textures.
+     * @param aTextureIds texture ids that form a group.
+     * @return animated texture group id.
+     */
+    IMPORT_C TInt AddAnimatedTextureGroupL( const RArray<TInt>& aTextureIds );
+    
+    /**
+     * Removes animated texture group.
+     * @param aGroupId animated texture group id.
+     */
+    IMPORT_C void RemoveAnimatedTextureGroup( TInt aGroupId );
+
+    
+    /**
+     * Clears texture changed flags.
+     */
+    IMPORT_C void ClearChangedTextures();
+    
+    /**
+     * Sets a flag that indicates that there are changed textures.
+     */
+    IMPORT_C void SetHasChangedTextures();
+    
+    /**
+     * Sets a flag if texture memory usage calculation should be done and printed.
+     */
+    IMPORT_C void EnableTexMemoryCalculation( TBool aEnableTeMemCal );
+
+    /**
+     * Estimated mem usage for textures assuming that textures which have pixel content
+     * are using given amount of memory per pixel.
+     * @return Estimated texture memory usage in bytes
+     */
+    TInt EstimatedTextureMemUsage(TInt aAverageBitsPerPixel) const;
+
+    /**
+     * Enables (or disables) texture autosize calculations.
+     */
+    void EnableAutoSizeCalculation(TBool aEnable = ETrue);
+
+protected:
+
+    /* Protected data structures. */
+
+    /**
+     * Permanent registration entry for textures.
+     */
+    NONSHARABLE_CLASS(CTextureEntry) : public CBase, public MHuiTextureContentObserver
+        {
+    private:
+        CTextureEntry(); // the dummy constructor is private!
+    public:
+        CTextureEntry(TInt aId,
+                      const TFileName & aFileName,
+                      const TSize& aMaxTextureSize = TSize(0,0),
+                      THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault,
+                      TInt aFrameNumber = 0);
+                      
+        CTextureEntry(TInt aId, CHuiTexture * aTexture);
+        
+        CTextureEntry & operator=(const CTextureEntry &aSrc);
+        
+    private:
+        CTextureEntry(const CTextureEntry &aSrc);
+        
+    public:
+    
+        ~CTextureEntry();
+        
+        void SetFileName(const TFileName & aFileName);
+
+        void TextureContentUploaded(CHuiTexture& aTexture);
+
+        void TextureContentReleased(CHuiTexture& aTexture);
+
+        void RestoreTextureContentL(CHuiTexture& aTexture);
+
+        /** The texture id. Set to zero for no id. */
+        TInt iId;
+
+        /** Resource location for the texture. */
+        HBufC*  iFileName;
+
+        /** The texture entry. */
+        CHuiTexture* iTexture;
+
+        /** Requested maximum size for the texture. */
+        TSize iMaxTextureSize;
+
+        /** Specify upload behavior - how to convert the bitmap
+          to texture. */
+        THuiTextureUploadFlags iFlags;
+
+        /** Bitmap content provider. Alternative content (re)loading
+         * mechanism to filenames (loading from a file). */
+        MHuiBitmapProvider* iBitmapProvider;
+        
+        /* Number of bits perpixel, used by texture. This field is used while 
+         * calculating total memory consumption by texturemanager, for textures.
+         */
+        TInt iBitDepth;       
+        
+        /** The frame number. */
+        TInt iFrameNumber;
+        TInt iFrameCount;
+        TInt iFrameInterval;
+        };
+
+    /**
+     * Temporary asynchronous load entry for textures.
+     */
+    struct SLoadQueueEntry
+        {
+        /** The texture entry that is being loaded. */
+        CTextureEntry* iLoading;
+
+        /** The image being loaded has an alpha channel. */
+        TBool iHasAlpha;
+
+        /** The original, non-downscaled size of the image. */
+        TSize iOriginalSize;
+
+        /** Image decoder to load bitmap images. */
+        CImageDecoder* iDecoder;
+
+        /** True, if the texture was already unloaded before it finished
+            loading. */
+        TBool iUnloaded;
+
+        };
+
+
+    enum TReleaseState
+        {
+        /** The texture manager is operating normally in the non-released state. */
+        ENormal,
+
+        /** The texture manager is currently releasing textures. */
+        EReleasing,
+
+        /** The texture manager is operating normally in the released state. */
+        EReleased,
+        
+        /** The texture manager is operating normally in the partly released state. 
+            This occurs if some of the textures cannot be released*/
+        EPartiallyReleased,
+
+        /** The texture manager is current restoring textures. */
+        ERestoring
+        };
+
+
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C CHuiTextureManager(CHuiEnv& aEnv /*MHuiTextureManagerObserver* aObserver = NULL*/);
+
+    /**
+     * Second-phase constructor.
+     */
+    IMPORT_C void BaseConstructL();
+
+
+    /* Methods. */
+
+    /**
+     * Sets the texture processor of the manager. Ownership of the processor
+     * is given to the manager.
+     *
+     * @param aProcessor  Texture processor instance. Ownership is transferred.
+     */
+    IMPORT_C void SetProcessor(CHuiTextureProcessor* aProcessor);
+
+    /**
+     * Returns a texture entry.
+     *
+     * @param aIndex  Index of the texture.
+     *
+     * @return  Returns a texture entry from the set of existing textures.
+     */
+    IMPORT_C CTextureEntry* TextureEntry(TInt aIndex);
+
+    /**
+     * Returns the number of texture entries.
+     */
+    IMPORT_C TInt TextureEntryCount() const;
+
+    /**
+     * Check the existence of a texture.
+     *
+     * @param aFileName  File name of the texture.
+     *
+     * @return  Index of the texture, in the iTextures array, or -1 if not found.
+     */
+    IMPORT_C TInt CheckTexture(const TDesC& aFileName, TInt aFrameNumber = 0) const;
+
+    /**
+     * Check the existence of a texture.
+     * @param aId Id of the texture to check.
+     * @return  Index of the texture, in the iTextures array, or
+     * -1 if not found.
+     */
+    IMPORT_C TInt CheckTexture(TInt aId) const;
+
+    /**
+     * Helper method that notifies observers of texture load completion.
+     * @see iLoadObservers
+     */
+    IMPORT_C void NotifyTextureLoaded(CHuiTexture& aTexture,
+                             TInt aTextureId,
+                             TInt aErrorCode) const;
+
+protected: // New methods
+    
+    /**
+     * Provides expandability, helps keeping the binary compatibility. Since virtual
+     * table is now exported and this class is dll derivable and the implementation
+     * is more difficult to change, hence this method, which can provide additional
+     * extension APIs.
+     * 
+     * @param aExtensionUid     UID, which is being used for recognizing the extension
+     * @param aExtensionParams  Return pointer to the extension API, once recognized from the extension uid
+     */
+    IMPORT_C virtual void TextureManagerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+    
+    /* Private methods */
+
+    /**
+     * Creates a texture from the given CFbsBitmap and its mask bitmap.
+     * This is a synchronous method call and will result in consequent call
+     * of TextureLoadingCompleted of all observers if the texture creation
+     * was successful. As filename cannot be acquired for created
+     * textures the user provided string will be used. Note that the filename
+     * has to be unique for all textures. Textures are identified by their
+     * filename and if a texture with existing filename is loaded / created
+     * then already loaded / created texture will be returned instead of
+     * creating a new texture.
+     *
+     * @note There are problems in creating textures from icon bitmaps exported
+     * using AknsUtils::CreateAppIconLC(). It seems that it is impossible to
+     * access the bitmap data of created icon directly using DataAddtess() - method
+     * or THuiBitmapUtil - method. HUIToolkit relies on these methods.
+     * To create textures from the system icons you have to copy the icons to temporary
+     * CFbsBitmaps. Notice that duplicating the bitmap handle with CFbsBitmap::Duplicate is
+     * not enough. You have to make a physical copy.
+     *
+     * @param aBitmap    The source bitmap from which the texture is created.
+     * @param aMask      Pointer to the mask bitmap that is used as alpha blending
+     *                   mask for the texture. This parameter can be NULL for
+     *                   textures without alpha channel.
+     * @param aId        The id of the texture/filename to load. The id must have
+     *                   a filename assigned by a call to DefineFileName().
+     * @return Reference to the created texture.
+     * @leave KErrArgument The bitmap and the mask bitmap are incompatible (different size).
+     */
+    IMPORT_C virtual CHuiTexture& CreateTextureL(CFbsBitmap& aBitmap,
+                                         const CFbsBitmap* aMask,
+                                         THuiTextureUploadFlags aFlags,
+                                         TInt id);
+
+    /**
+     * Returns the file server session that should be used by the manager.
+     */
+    RFs& FsSession() const;
+
+    /** Returns true if the given texture is still in the load queue. */
+    TBool IsInLoadQueue(const CHuiTexture * texture) const;
+
+    /** Returns true if the given texture is still in the load queue. */
+    TBool IsInLoadQueue(TInt id) const;
+
+    /**
+     * Called when image loading (decoding) operation is complete.
+     */
+    IMPORT_C void RunL();
+
+    /**
+     * Handles a leave occurring in the request completion event handler RunL().
+     */
+    IMPORT_C TInt RunError( TInt aError );
+
+    /**
+     * Called when a sub-image has been loaded
+     * (before calling @c ImageLoadingCompleteL).
+     * This method checks if we need to continue loading.
+     * @return Error code or positive integer. If positive integer,
+     *         stop and do not continue to frame generation.
+     */
+    TInt ImageLoadingContinue();
+    
+    /**
+     * Called when an image has finished loading. Handles
+     * uploading of the loaded bitmap to the texture.
+     * @param aEntry queue entry.
+     */
+    void ImageLoadingCompleteL(SLoadQueueEntry& aEntry);
+
+    /**
+     * Processes animated frame.
+     * @param aEntry queue entry.
+     */
+    void ProcessAnimatedFrameL(SLoadQueueEntry& aEntry);
+
+    /**
+     * Cancel active object operation.
+     */
+    IMPORT_C void DoCancel();
+
+    /**
+     * Starts loading next images from the load queue. If scheduling a
+     * queue entry fails for some reason, the entry is discarded and the
+     * next queue entry is processed.
+     */
+    void StartLoading();
+
+    /**
+     * Cleans up the topmost load queue entry and removes it from the
+     * load queue. Deletes the decoder, but not the loaded texture entry.
+     */
+    SLoadQueueEntry PopLoadedQueueEntry();
+
+    /**
+     * Sets up image decoding and starts to load the first entry in the load
+     * queue.
+     * @leave Standard error code if decoder initialization/resource read
+     * fails.
+     */
+    void DoLoadNextL();
+
+    /**
+     * Unloads a texture having given index in the texture array (iTextures).
+     */
+    void DoUnload(TInt index);
+
+    /**
+     * Cancels the scheduled or ongoing loading of a texture.
+     * If the texture is found from load queue it is immediately removed from
+     * the queue.
+     * If the removed texture was being loaded at the time this method is called
+     * the loading is cancelled and restarted from the next unloaded texture.
+     *
+     * @param aTexture Reference to the texture of which load is cancelled.
+     */
+    void CancelLoadingOfTexture(CHuiTexture& aTexture);
+
+    /**
+     * Helper method that notifies observers of texture manager state change.
+     * @see iStateObservers
+     */
+    void NotifyStateChange() const;
+    
+    /**
+     * Update texture flags if needed.
+     * @param aBitmap    Bitmap.
+     * @param aMask      Mask.
+     * @param aFlags     Texture flags. This returns the changed value.
+     */
+    void UpdateFlags(const CFbsBitmap& aBitmap, const CFbsBitmap* aMaskBitmap, THuiTextureUploadFlags& aFlags);
+    
+    void NotifyTextureAutoSizeObservers() const;
+
+    /**
+     * Creates animation state.
+     * @param aGroupId group id.
+     * @param aImageFile image file.
+     * @param aFrameNumber frame number.
+     * @param aFrameCount frame count.
+     */
+    CHuiTextureAnimationState* CreateAnimationStateL( 
+        TInt aGroupId, const TDesC& aImageFile, 
+        TInt aFrameNumber, TInt aFrameCount );
+    
+    /**
+     * Finds animation state owned by aGroupId.
+     * @return animation state or NULL if not found.
+     */
+    CHuiTextureAnimationState* FindAnimationState( TInt aGroupId );
+    
+    /**
+     * Removes animation state.
+     * @param aState state to be removed.
+     */
+    void RemoveAnimationState( CHuiTextureAnimationState* aState );
+    
+    /**
+     * Finds group id by texture id.
+     * @param aTextureId texture id to look for.
+     * @param aGroupId updated to contain found group id.
+     * @return ETrue if succeeded, EFalse otherwise.
+     */
+    TBool FindGroupIdByTextureId( TInt aTextureId, TInt& aGroupId ) const;
+    
+    /**
+     * Checks if animation state is needed.
+     * @param aDecoder decoder.
+     * @return ETrue if needed, EFalse otherwise.
+     */
+    static TBool NeedsAnimationState( const CImageDecoder& aDecoder );
+    
+    // For debugging purposes! Used to calculate texture memory usage
+    /* Calculates memory used by texturemanager for all the textures and prints as info messages
+     */
+    void TextureMemUsage() const;
+
+public:
+
+    /* Public properties. */
+
+    /**
+     * Observers that are notified of changes in the state of the manager.
+     * Applications may directly add and remove their own observers using
+     * this public property.
+     */
+    RHuiObserverArray<MHuiTextureManagerStateChangedObserver> iStateObservers;
+
+    /**
+     * Observers that are notified loaded textures of the manager.
+     * Applications may directly add and remove their own observers using
+     * this public property.
+     */
+    RHuiObserverArray<MHuiTextureLoadingCompletedObserver> iLoadObservers;
+
+    /** Animated textures. */
+    RHuiObserverArray<MHuiTimeObserver> iAnimatedTextures;
+
+    /** 
+     * Observers that are notified when toolkit notices a change in texture
+     * auto size e.g. it is now being drawn as different size than before.
+     * Observers are notified possibly between every frame, they should handle
+     * notifications as quickly as possible.
+     */
+    RHuiObserverArray<MHuiTextureAutoSizeObserver> iTextureAutoSizeObservers;
+
+private:
+
+    /** Environment. */
+    CHuiEnv& iEnv;
+
+    /** Empty texture that is returned if an invalid image is specified. */
+    CHuiTexture* iBlankTexture;
+
+    /** State of the texture manager. */
+    TState iState;
+
+    /** This variable tells whether there has been a valid texture in the load queue
+        that we have started to load in the current texture load loop. This variable 
+        indicates that we have started to load at least one texture during the load loop. */
+    TBool iLoadQueueHadValidTexture;
+
+    /** State of the release/restore process. */
+    TReleaseState iReleaseState;
+
+    /** Path where image files are loaded from. */
+    HBufC* iImagePath;
+
+    /** Queue of loading tasks. */
+    RArray<SLoadQueueEntry> iLoadQueue;
+
+    /** Counter for generating new font identifiers. */
+    TInt iFontIdEnumerator;
+
+    /**
+     * Registry of all textures within this toolkit.
+     * Accessed by texture ids (iId) or texture filenames (iFileName).
+     * Members may be NULL if a texture is not loaded.
+     */
+    RPointerArray<CTextureEntry> iTextures;
+
+    /** Bitmap for loading asynchronously into. */
+    CFbsBitmap* iBitmap;
+
+    /** Mask bitmap for loading alpha channels. */
+    CFbsBitmap* iMaskBitmap;
+
+    /** Texture processor instance. */
+    CHuiTextureProcessor* iProcessor;
+
+    /** Open file server session for image loading. */
+    RFs& iFS;
+
+    /**
+     * Struct containing animated texture group item.
+     * Typically, each group consists of two textures and amount
+     * of groups is small. Thus, simple array based approach was
+     * selected. 
+     */
+    struct TAnimatedTextureGroupItem
+        {
+        TInt iGroupId;
+        TInt iTextureId;
+        };
+    
+    /**
+     * Array of animated texture group items.
+     */
+    RArray< TAnimatedTextureGroupItem > iAnimatedTextureGroupItems;
+    
+    /** 
+     * Array of animation states. 
+     * Own.
+     */
+    RPointerArray< CHuiTextureAnimationState > iAnimations;
+
+    /**
+     * Animation state that does not belong to any group.
+     * Own.
+     */    
+    CHuiTextureAnimationState* iAnimationWithoutGroup;
+
+    /** Flag to optimize changed texture lookup */
+    TBool iHasChangedTextures;
+
+    /** To do texture memory usage calculation and print it as info messages */
+    TBool iEnableTexMemCalculation;   
+    
+    /** Flag to tell wheter texture autosizing is enabled */
+    mutable TBool iTextureAutoSizingEnabled;
+    };
+
+#endif  // __HUITEXTUREMANAGER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTextureProcessor.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,230 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiTextureProcessor. CHuiTextureProcessor is 
+*                the abstract base class for texture processors.
+*
+*/
+
+
+
+#ifndef __HUITEXTUREPROCESSOR_H__
+#define __HUITEXTUREPROCESSOR_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiTextureHandle.h>
+
+
+/* Forward declarations. */
+class CHuiEnv;
+
+
+/**
+ * CHuiTextureProcessor is a collection of texture filters. Each filter 
+ * takes a texture as input, processes it, and produces a new texture as a 
+ * result. Examples of processing filters are blurring and shadow generation. 
+ * Concrete implementations of this class are rendering plugin specific.
+ * CHuiTextureProcessor is the public, user-friendly way of filtering 
+ * textures, because each filtering operation can be applied with a single
+ * function call.
+ *
+ * @todo  Create an abstract CHuiTextureFilter class to represent a filter
+ *        operation. Each filter could then be configured with an arbitrary
+ *        number of parameters, and then applied on a texture. This would
+ *        allow filters to have persistent state information.
+ */
+class CHuiTextureProcessor : public CBase
+    {
+public:
+
+    /* Types. */
+
+    /** @beginAPI */
+
+    /** Flags for blur filtering. */
+    enum TBlurFlags
+        {
+        /** Default blurring settings. */
+        EBlurFlagDefault = 0,
+        
+        /** Include an alpha channel in the result. */
+        EBlurFlagAlpha = 1,
+        
+        /** Retain extra space for edges so that the blurred edges that will
+            always remain within the bounds of the resulting texture. Note
+            that when the blurred texture is drawn, it has to be expanded 
+            so that it will match the original images content. */
+        EBlurFlagExpandEdges = 2,
+        
+        /** Replace source color RGB with white. Note that this flag is 
+            mutually exclusive with flag EBlurFlagBlack. If both are defined
+            then this flag overrides the EBlurFlagBlack. */
+        EBlurFlagWhite = 4,
+        
+        /** Replace source color RGB with black. Note that this flag is 
+            mutually exclusive with flag EBlurFlagWhite. If both are defined
+            then this flag overridden by EBlurFlagWhite. */
+        EBlurFlagBlack = 8,
+        
+        /** High quality blur. The blurring process is done twice, and the 
+            results are averaged. */
+        EBlurFlagHighQuality = 16,
+        };
+
+    /** @endAPI */
+
+
+    /* Destructor. */
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CHuiTextureProcessor();
+    
+
+    /* Methods. */
+
+    /**
+     * Returns the environment of the texture processor.
+     */
+    IMPORT_C CHuiEnv& Env();
+
+
+    /** @beginAPI */
+
+    /**
+     * Blurs a texture. The dimensions of the resulting image are chosen
+     * automatically. 
+     *
+     * Returns a handle to a new texture which contains
+     * a blurred version of the texture. Ownership of the new texture is
+     * transferred to the caller, which means it is responsible for either
+     * creating a CHuiTexture out of the handle, or calling 
+     * THuiTextureHandle::Release() when the generated texture is no longer
+     * needed.
+     *
+     * Note that the algorithm used for blurring favors speed over accuracy.
+     * This means that when hardware acceleration is available, the blurring
+     * can be redone for each frame. However, the quality of the blurring 
+     * may not be optimal. For example, color range reduction and pixel 
+     * artifacts may be visible.
+     *
+     * @param aSrc  Texture to be blurred (single segment). Not modified.
+     * @param aDest  New blurred texture. Ownership is transferred to the caller.
+     *               Allowed to be the same as aSrc.
+     * @param aFilterSize  Size of the blurring filter. 3 = 3x3 filter, 4 = 4x4 filter.
+     * @param aFlags  Flags that modify the filter's parameters. @see TBlurFlags
+     */    
+    IMPORT_C virtual void BlurL(const THuiTextureHandle& aSrc,
+                       THuiTextureHandle& aDest,
+                       TInt aFilterSize = 3, TInt aFlags = 0) = 0;
+
+    /**
+     * Blurs a texture. The dimensions of the resulting image are as close to
+     * aPreferredSize as possible, depending on the limitations of the 
+     * implementation. 
+     * 
+     * See comments avobe.
+     *
+     * @param aSrc  Texture to be blurred (single segment). Not modified.
+     * @param aDest  New blurred texture. Ownership is transferred to the caller.
+     *               Allowed to be the same as aSrc.
+     * @param aPreferredSize  Preferred size of the result.
+     * @param aFilterSize  Size of the blurring filter. 3 = 3x3 filter, 4 = 4x4 filter.
+     * @param aFlags  Flags that modify the filter's parameters. @see TBlurFlags
+     */
+    IMPORT_C virtual void BlurL(const THuiTextureHandle& aSrc, 
+                       THuiTextureHandle& aDest,
+                       const TSize& aPreferredSize,
+                       TInt aFilterSize = 3, TInt aFlag = 0) = 0;
+
+    
+    /**
+     * Blurs a texture. The dimensions of the resulting image are chosen
+     * automatically. 
+     *
+     * See comments avobe.
+     *
+     * @param aSrc  Texture to be blurred (multi segment). Not modified.
+     * @param aDest  New blurred texture. Ownership is transferred to the caller.
+     *               Allowed to be the same as aSrc.
+     * @param aFilterSize  Size of the blurring filter. 3 = 3x3 filter, 4 = 4x4 filter.
+     * @param aFlags  Flags that modify the filter's parameters. @see TBlurFlags
+     */ 
+    IMPORT_C virtual void BlurSegmentedL(const MHuiSegmentedTexture& aSrc,
+                       THuiTextureHandle& aDest,
+                       TInt aFilterSize = 3, TInt aFlags = 0) = 0;
+    
+    /**
+     * Blurs a texture. The dimensions of the resulting image are as close to
+     * aPreferredSize as possible, depending on the limitations of the 
+     * implementation. 
+     *
+     * See comments avobe.
+     *
+     *
+     * @param aSrc  Texture to be blurred (multi segment). Not modified.
+     * @param aDest  New blurred texture. Ownership is transferred to the caller.
+     *               Allowed to be the same as aSrc.
+     * @param aPreferredSize  Preferred size of the result.
+     * @param aFilterSize  Size of the blurring filter. 3 = 3x3 filter, 4 = 4x4 filter.
+     * @param aFlags  Flags that modify the filter's parameters. @see TBlurFlags
+     */                
+    IMPORT_C virtual void BlurSegmentedL(const MHuiSegmentedTexture& aSrc, 
+                       THuiTextureHandle& aDest,
+                       const TSize& aPreferredSize,
+                       TInt aFilterSize = 3, TInt aFlag = 0) = 0;
+
+    /** @endAPI */
+    
+    
+    IMPORT_C virtual void Release();
+    
+    IMPORT_C virtual void RestoreL();
+
+
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C CHuiTextureProcessor(CHuiEnv& aEnv);
+
+
+protected: // New methods
+    
+    /**
+     * Provides expandability, helps keeping the binary compatibility. Since virtual
+     * table is now exported and this class is dll derivable and the implementation
+     * is more difficult to change, hence this method, which can provide additional
+     * extension APIs.
+     * 
+     * @param aExtensionUid     UID, which is being used for recognizing the extension
+     * @param aExtensionParams  Return pointer to the extension API, once recognized from the extension uid
+     */
+    IMPORT_C virtual void TextureProcessorExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+    
+private:
+
+    /** Environment. */
+    CHuiEnv& iEnv;
+
+    /** Spare member to help keeping binary compatibility, since
+        HuiTextureProcessor is now dll derivable **/
+    TInt iSpare;
+    };
+
+#endif  // __HUITEXTUREPROCESSOR_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiThemeManager.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Declares CHuiThemeManager class which is the interface for 
+*                ThemeManager component.
+*
+*/
+
+
+
+#ifndef _HUITHEME_MANAGER
+#define _HUITHEME_MANAGER
+
+#include <e32base.h>
+#include <AknsItemID.h>
+#include <alf/alfconstants.h>
+
+namespace Alf
+    {
+    class ThemeManager; // forward declaration.
+    }
+using namespace Alf;
+
+struct THuiThemeImageparams
+{
+    TAknsItemID itemId;
+    TAknsItemID aSkinId;
+    TFileName iSkinLogicalName; 
+    //THuiTextureUploadFlags aFlag;   
+    TInt iDefaultBitmapId;
+    TInt iDefaultMaskId;	
+};
+
+/**
+ * @deprecated <b>Deprecated class</b>
+ * 
+ * CHuiThemeManager is the interface for Hui to access the ThemeManager 
+ * functionality
+ *
+ * @see 
+ * @see 
+ *
+ */
+NONSHARABLE_CLASS(CHuiThemeManager) : public CBase
+{
+
+public:
+
+
+	virtual ~CHuiThemeManager();
+	
+	    
+    /** @beginAPI */
+
+	/**
+     * Exported method. Two phase constructor
+     * renderer.
+     */
+	IMPORT_C void ConstructL();
+	
+    /**
+     * @deprecated Use GetItemIdL instead.
+     */
+	IMPORT_C void GetItemID(const TDesC& aSkinId, TAknsItemID& aItemID);
+	
+    /**
+     * @deprecated User GetSkinImageParamsL instead.
+     */
+	IMPORT_C THuiThemeImageparams GetSkinImageParams(const TDesC& aSkinLogicalName);
+
+    /**
+     * @deprecated <b>Doesn't retrieve TAknsItemID anymore!</b>
+     * 
+     * Exported method. Retrieves a TAknsItemID based on input text skin 
+     * image id.
+     *
+     * @param aSkinId Skin identifier.
+     * @param aItemID On returns contains the skin item ID.
+     */
+	IMPORT_C void GetItemIdL(const TDesC& aSkinId, TAknsItemID& aItemID);
+	
+    /**
+     * @deprecated <b>Doesn't return image parameters anymore!</b>
+     * 
+     * Exported method. Gets Skin Image parameters based on input 
+     * skin image id.
+     *
+     * @param aSkinLogicalName Logical name of the skin
+     * 
+     * @return Image parameters.
+     */
+	IMPORT_C THuiThemeImageparams GetSkinImageParamsL(const TDesC& aSkinLogicalName);
+
+    /** @endAPI */
+	
+public:
+    /**
+     * Constructs a new CHuiThemeManager
+     *
+     * @param 
+     */	
+     static CHuiThemeManager* NewL();
+
+	
+    /**
+     * Constructs a new CHuiThemeManager
+     *
+     * @param 
+     */	
+	static CHuiThemeManager* NewLC();
+private:
+	/**
+	 * Private constructor
+	 */
+	CHuiThemeManager();
+	
+private:
+
+	ThemeManager* iThemeManager;			// Thememanager 
+
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTimeObserver.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUITIMEOBSERVER_H__
+#define __HUITIMEOBSERVER_H__
+
+
+#include <e32def.h>
+
+
+/**
+ * Interface for classes that follow the progress of time.
+ */
+class MHuiTimeObserver
+    {
+public:
+
+    /**
+     * Called when time progresses.
+     *
+     * @param aElapsedTime  Elapsed time in seconds.
+     */
+    virtual void AdvanceTime(TReal32 aElapsedTime) __SOFTFP = 0;
+        
+    };
+
+
+#endif // __HUITIMEOBSERVER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTimedPoint.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,189 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUITIMEDPOINT_H__
+#define __HUITIMEDPOINT_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiTimedValue.h>
+#include <uiacceltk/HuiRealPoint.h>
+
+
+/**
+ * X/Y coordinate pair using timed values.
+ *
+ * @see THuiTimedValue
+ */
+class THuiTimedPoint
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    IMPORT_C THuiTimedPoint();
+
+    /**
+     * Constructor that sets default values.
+     *
+     * @param aX Sets the timed value's initial X component.
+     * @param aY Sets the timed value's initial Y component.
+     */
+    IMPORT_C THuiTimedPoint(TReal32 aX, TReal32 aY) __SOFTFP;
+
+
+    /* Methods. */
+
+    /**
+     * Sets the interpolation style of both components of the point.
+     *
+     * @param aStyle  Timed value interpolation style.
+     */
+    IMPORT_C void SetStyle(THuiInterpolationStyle aStyle);
+
+    /**
+     * Sets the mapping function for both the X and Y components. For
+     * example you can use a mapping function to constrain your
+     * visuals onto a path.
+     *
+     * @note If the mapping function does not support multiple modes
+     * (mode for X calculation and mode for Y calculation), both the
+     * X and Y components of the timed point will share the same value.
+     *
+     * The mapping component/mode parameter used to calculate
+     * value for X is mode 0, and the value for U is mode 1.
+     * @see MHuiMappingFunction::MapValue() is called twice with mode
+     * 0 for X and mode 1 for Y.
+     * @see CHuiCurvePath for curve path mapping fuction.
+     */
+    IMPORT_C void SetFunction(MHuiMappingFunction* aFunction);
+
+    /**
+     * Sets the target for the timed point.
+     *
+     * @param aPoint           Target point.
+     * @param aTransitionTime  Duration for reaching the target.
+     */
+    IMPORT_C void Set(const THuiRealPoint& aPoint, TInt aTransitionTime = 0);
+
+    /**
+     * Sets the target value of both components of the timed point.
+     *
+     * @param aValue           New target value.
+     * @param aTransitionTime  Duration for reaching the target.
+     */
+    IMPORT_C void Set(TReal32 aValue, TInt aTransitionTime = 0) __SOFTFP;
+
+    /**
+     * Sets the target value for the timed point, with a transition that is
+     * done using a specific speed.
+     *
+     * @param aPoint  Target point.
+     * @param aUnitsPerSecond  Units per second during the transition.
+     */
+    IMPORT_C void SetWithSpeed(const THuiRealPoint& aPoint, TReal32 aUnitsPerSecond) __SOFTFP;
+
+    /**
+     * Sets the target value of both components of the timed point.
+     *
+     * @param aValue  New target value.
+     * @param aUnitsPerSecond  Speed of change.
+     */
+    IMPORT_C void SetWithSpeed(TReal32 aValue, TReal32 aUnitsPerSecond) __SOFTFP;
+
+    /**
+     * Returns the current interpolatad value of the point rounded to nearest
+     * integer values. Note that the THuiTimedPoint values are
+     * floating-point.
+     *
+     * @see RealNow() For returning the floating-point current value.
+     *
+     * @return  Current values as a regular TPoint.
+     */
+    IMPORT_C TPoint Now() const;
+
+    /**
+     * Returns the current value of the point.
+     *
+     * @return  Current values as a regular THuiRealPoint.
+     */
+    IMPORT_C THuiRealPoint RealNow() const __SOFTFP;
+
+    /**
+     * Returns the target value of the point rounded to nearest
+     * integer values. Note that the THuiTimedPoint values are
+     * floating-point.
+     *
+     * @see RealTarget() For returning the floating-point values.
+     *
+     * @return Target values as a normal TPoint - target value rounded to
+     * nearest integer.
+     */
+    IMPORT_C TPoint Target() const;
+
+    /**
+     * Returns the target value of the point.
+     *
+     * @return  Target as a THuiRealPoint.
+     */
+    IMPORT_C THuiRealPoint RealTarget() const __SOFTFP;
+
+    /**
+     * Finishes the current interpolation.
+     */
+    IMPORT_C void Finish();
+
+    /**
+     * Checks if the point has been changed.
+     *
+     * @return ETrue if X or Y values have changed, EFalse if not.
+     *
+     * @see THuiTimedValue::Changed()
+     */
+    TBool Changed() const;
+
+    /**
+     * Clears the changed flags for X and Y values.
+     *
+     * @see THuiTimedValue::Changed()
+     */
+    void ClearChanged();
+
+
+private:
+
+    /* Private methods. */
+
+
+public:
+
+    /* Public member variables. */
+
+    /** X coordinate. */
+    THuiTimedValue iX;
+
+    /** Y coordinate. */
+    THuiTimedValue iY;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+#endif  // __HUITIMEDPOINT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTimedValue.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,457 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of THuiTimedValue. THuiTimedValue is value that can 
+*                change based on time.
+*
+*/
+
+
+
+#ifndef __HUITIMEDVALUE_H__
+#define __HUITIMEDVALUE_H__
+
+
+#include <e32base.h>
+#include <e32std.h>
+
+
+/**
+ * Mapping function interface. Timed values use this interface for mapping
+ * the return value of a timed value evaluation. Can be used to define
+ * custom interpolation functions for example timed values.
+ *
+ * @see THuiTimedValue::SetFunction()
+ */
+class MHuiMappingFunction
+    {
+public:
+
+    /**
+     * Virtual destructor.
+     */
+    virtual ~MHuiMappingFunction()
+        {
+        }
+
+    /**
+     * Perform the mapping. Defines a function y = f(x, mode).
+     *
+     * Implement this method that calculates a output value for
+     * a timed value based on the input value and a component/mode
+     * parameter.
+     *
+     * For example the aValue input could be an angle, and the aMode
+     * could be a X or Y component enumeration, then the MapValue could
+     * calculate return a x or y position on a curve path.
+     *
+     * @param aValue      Unmapped value.
+     * @param aMode       Mapping mode used for mapping this value.
+     *
+     * @return  Mapped value.
+     */
+    virtual TReal32 MapValue(TReal32 aValue, TInt aMode) const __SOFTFP = 0;
+    
+    /**
+     * Determines whether the mapping function has changed since the last
+     * call to MHuiMappingFunction::MappingFunctionClearChanged().
+     *
+     * By default, mapping functions themselves are assumed to be constant
+     * (not changing over time).
+     *
+     * @return  <code>ETrue</code>, if the mapping function has changed 
+     *          so that the same input value will return a different result.
+     *          Otherwise, <code>EFalse</code>.
+     */
+    IMPORT_C virtual TBool MappingFunctionChanged() const;
+    
+    /**
+     * Clears the change flags of the mapping function. This is called 
+     * by the refresh loop after a frame has been fully drawn.
+     */
+    IMPORT_C virtual void MappingFunctionClearChanged();
+
+    };
+
+
+/**
+ * Timed value interpolation styles.
+ *
+ * @see To implement custom interpolation styles, you can use
+ * mapping functions.
+ *
+ * @see MHuiMappingFunction
+ * @see THuiTimedValue::SetFunction()
+ */
+enum THuiInterpolationStyle
+    {
+    /** No interpolation is done. The target value becomes effective
+        in a single step. */
+    EHuiTimedValueStyleNone,
+
+    /** Use linear interpolation between the current value and the
+        target value. */
+    EHuiTimedValueStyleLinear,
+
+    /** Use a sine wave for approximating preservation of momentum. */
+    EHuiTimedValueStyleSineWave,
+
+    /** Quarter of a sine wave for decelerating movement. */
+    EHuiTimedValueStyleDecelerate,
+
+    /** Quarter of a sine wave for accelerating movement. */
+    EHuiTimedValueStyleAccelerate,
+
+    /** Sine wave or decelerating style based on when the target value
+        is defined. */
+    EHuiTimedValueStyleAdaptive,
+
+    /** Combination of linear and deceleration. */
+    EHuiTimedValueStyleImpulse,
+
+    EHuiTimedValueStyleLast
+    };
+
+
+/**
+ * Timed values are able to interpolate their value independently based on
+ * time. The interpolation can be configured to follow a curve instead of
+ * being linear. Timed value does not restrict the value units but interpolates
+ * on any given real value. Mapping function can be used that maps the interpolated
+ * values to some other real value space. If no mapping function is specified an
+ * identity mapping is used. Current values and target values of timed value can be
+ * set and current value according to the current CHuiStatic provided time can be retrieved
+ * through class methods. Delays for timed value to achieve the target value can
+ * be given in the Set - method. Timed value supports number of different interpolation
+ * styles.
+ *
+ * @todo  The size of a timed value should be minimized. Also possible:
+ *        centralize timed values to a static array, and make THuiTimedValue
+ *        a handle to an element there. Since timed values are sometimes
+ *        used as public member variables, their size cannot be changed
+ *        or binary compatibility will be broken.
+ */
+class THuiTimedValue
+    {
+public:
+
+    /* Constructors. */
+
+    /** @beginAPI */
+
+    /**
+     * Constructor. Enables creation of timed value with no explicitly set initial value.
+     * The timed value is set to zero.
+     *
+     * @param aStyle  Interpolation style used to reach target value.
+     */
+    IMPORT_C THuiTimedValue(THuiInterpolationStyle aStyle = EHuiTimedValueStyleAdaptive);
+
+    /**
+     * Constructor. Enables initial value setting.
+     *
+     * @param aInitialValue  Initial value.
+     *
+     * @param aStyle  Interpolation style used to reach target value.
+     */
+    IMPORT_C THuiTimedValue(TReal32 aInitialValue,
+                            THuiInterpolationStyle aStyle = EHuiTimedValueStyleAdaptive) __SOFTFP;
+
+
+    /* Methods. */
+
+    /**
+     * Returns the interpolation style of the timed value.
+     */
+    IMPORT_C THuiInterpolationStyle Style() const;
+
+    /**
+     * Sets the interpolation style of the timed value.
+     *
+     * @param aStyle  Interpolation style used to reach target value.
+     */
+    IMPORT_C void SetStyle(THuiInterpolationStyle aStyle);
+
+    /**
+     * Sets a mapping function that affects the value returned by
+     * Now(). The timed value does not receive ownership
+     * of the mapping function object.
+     *
+     * @param aFunction  Function that will map the current value to required
+     * number space.
+     */
+    IMPORT_C void SetFunction(MHuiMappingFunction* aFunction);
+
+    /**
+     * Sets the mapping mode that is communicated to the current mapping function
+     * (@see SetFunction()). The mapping function can map values differently
+     * according to the value mode. The mapping mode is represented as one
+     * bit, thus it can vary between 0 and 1. This can be ignored
+     * unless required by the used mapping function.
+     * @note Mode range may be extended in the future.
+     * @todo Add MappingMode - method.
+     *
+     * @param aMode  One bit integer that defines the mode of this timed value.
+     */
+    IMPORT_C void SetMappingMode(TInt aMode);
+
+    /**
+     * Returns the current value of the timed value. This is affected by the
+     * set mapping function. @see SetFunction()
+     *
+     * @return  Mapped current value.
+     */
+    IMPORT_C TReal32 Now() const __SOFTFP;
+
+    /**
+     * Returns the current value of the timed value, with no value mapping.
+     *
+     * @return  Unmapped value at the moment.
+     */
+    IMPORT_C TReal32 UnmappedNow() const __SOFTFP;
+
+    /**
+     * Returns the target value.
+     *
+     * @return  Target value.
+     */
+    IMPORT_C TReal32 Target() const __SOFTFP;
+
+    /**
+     * Set a new current value and target value. Change becomes effective immediately.
+     * This stops the current interpolation.
+     *
+     * @param aValue  New current and target value.
+     */
+    IMPORT_C void Set(TReal32 aValue) __SOFTFP;
+
+    /**
+     * Set a new target value that becomes effective after a delay.
+     * @see SetWithSpeed()
+     *
+     * @param aValue            New target value.
+     * @param aTransitionTime   When the target value will be in effect. Transition duration in milliseconds.
+     */
+    IMPORT_C void Set(TReal32 aValue, TInt aTransitionTime) __SOFTFP;
+
+    /**
+     * Sets a new target value. The transition time depends on the speed.
+     * @see Set()
+     *
+     * @param aValue           New target value.
+     * @param aUnitsPerSecond  Speed of change.
+     */
+    IMPORT_C void SetWithSpeed(TReal32 aValue, TReal32 aUnitsPerSecond) __SOFTFP;
+
+
+    /**
+     * Determines how much time remains until the transition is complete.
+     *
+     * @return  Time in milliseconds.
+     */
+    IMPORT_C TInt RemainingTime() const;
+
+    /**
+     * Finishes the current interpolation immediately. Sets the value to target value.
+     * If no interpolation is under progress nothing is done.
+     */
+    IMPORT_C void Finish();
+
+    /**
+     * Determines whether the value has changed since last call to
+     * ClearChanged().
+     */
+    inline TBool Changed() const
+        {
+        if(iMapFunction && iMapFunction->MappingFunctionChanged())
+            {
+            return ETrue;
+            }
+        return (iInternalState & EFlagChanged) != 0;
+        }
+
+    /**
+     * Determines whether the value is currently being interpolated towards
+     * a target value.
+     */
+    inline TBool Interpolating() const
+        {
+        return (iInternalState & EFlagInterpolating) != 0;
+        }
+
+    /**
+     * Flag the value as not changed. This is called by owning controls and visuals
+     * when they clear their change status. See CHuiControl and CHuiVisual.
+     */
+    IMPORT_C void ClearChanged();
+
+    /**
+     * Enables or disables timed value clock mode. In clock mode, the timed
+     * value's evaluated value is affected by the number of seconds since the
+     * initialization of CHuiStatic. The timed value will still operate like
+     * normally. In clock mode, a timed value can be used for perpetually
+     * continuing animations. Mapping functions can be used as normally.
+     * The clock mode is disabled by default.
+     *
+     * When a timed value's clock mode is activated, its evaluted value will
+     * be <i>MappingFunction((unmapped value) + (seconds since start))</i>.
+     * If you wish to make the evaluated value begin from zero at the time
+     * when the clock mode is enabled, use the following code:
+     * @code
+     * timedValue.EnableClock();
+     * timedValue.Set(-CHuiStatic::SecondsSinceStart());
+     * @endcode
+     *
+     * @see CHuiStatic::SecondsSinceStart()
+     *
+     * @param aEnable  <code>ETrue</code> to enable clock mode,
+     *                 <code>EFalse</code> to disable clock mode.
+     */
+    IMPORT_C void EnableClock(TBool aEnable = ETrue);
+
+    /**
+     * Suspends or restores the functionality of the timed value. When suspended,
+     * the timed value's internal state is not updated. This allows waiting
+     * for an indetermine period of time before the state accessed.
+     * @note The suspend state is not copied when a copy of the timed value
+     * is made with the assignment operator.
+     *
+     * @param aDoSuspend  <code>ETrue</code>, if the timed value is to be suspended.
+     *                    <code>EFalse</code>, if restored.
+     *
+     * @see THuiTimedValue::TFlags::EFlagFrozen
+     */
+    IMPORT_C void Suspend(TBool aDoSuspend = ETrue);
+
+    /**
+     * Assigns another timed value to this value. If the other value is suspended,
+     * it is automatically restored.
+     *
+     * @param aOtherValue  Other timed value.
+     *
+     * @return  Reference to this timed value.
+     */
+    IMPORT_C THuiTimedValue& operator = (const THuiTimedValue& aOtherValue);
+
+    /** @endAPI */
+
+    /**
+     * Helper method to calcuate seconds between start and end times.
+     * Can handle wrapping over of counter.
+     *
+     * @param aStart Starting time in milliseconds.
+     * @param aEnd Ending time in milliseconds.
+     * @return Seconds between the times.
+     */
+    TReal32 SecondsFrom(TUint32 aStart, TUint32 aEnd) const;
+
+protected:
+
+    /**
+     * Map a value using the mapping function.
+     *
+     * @param aValue Value to be mapped.
+     * @return Result of the mapping operation.
+     */
+    TReal32 MapValue(TReal32 aValue) const;
+
+
+private:
+
+    /**
+     * Flags that are used to store state and mode values
+     * to one internal state variable iInternalState.
+     * These are collected to one variable to save memory on
+     * used THuiTimedValue objects.
+     */
+    enum TFlags
+        {
+        /** True, if the value has changed since the last call to
+            ClearChanged(). */
+        EFlagChanged = 0x0001,
+
+        /** True, if the value is currently being interpolated between the
+            last value and the target. */
+        EFlagInterpolating = 0x0002,
+
+        /** Adapt interpolation style depending on the kind of change that
+            is occuring when a new target value is specified. */
+        EFlagAdaptive = 0x0004,
+
+        /** The number of seconds since initialization of the toolkit is
+            added to the value returned by UnmappedNow(). This can be used
+            for making perpetually ongoing animations.
+            @see CHuiStatic::SecondsSinceStart(). */
+        EFlagAddSecondsSinceStart = 0x0008,
+
+        /** The timed value is frozen so that if evaluated, it will remain
+            at iInterpolationStartValue and none of the time counters are updated. Frozen
+            values can be used for storing a timed value for an indeterminate
+            time and applying at a later time. This is used by
+            THuiValueCommand, for example, to store the new target state of
+            a value in a command that is executed at a later point in time.
+            @note This is an internal flag that will not be copied when a copy of
+            the timed value is made with the assignment operator. */
+        EFlagFrozen = 0x0010,
+
+        /** Mapping mode mask. The masked bit is used to store mapping mode. */
+        EFlagMappingModeMask = 0x0100,
+
+        /**
+          * Mapping mode bitwise shift. This shift value will shift the mapping
+          * mode value to bit 0.
+          */
+        EFlagMappingModeShift = 8
+        };
+
+private:
+
+    /** Interpolation style used to reach target value. */
+    THuiInterpolationStyle iStyle;
+
+    /** Internal state of the timed value. Collection of values masked using TFlags. */
+    mutable TInt16 iInternalState;
+
+    /**
+     * Time when the current interpolation was started (milliseconds).
+     * Relative to first call to CHuiStatic::UpdateTime().
+     * @see CHuiStatic::MilliSecondsSinceStart()
+     */
+    mutable TUint32 iInterpolationStartTime;
+
+    /**
+     * Time when the target value will be in effect in milliseconds.
+     * Relative to first CHuiStatic::UpdateTime().
+     * @see CHuiStatic::MilliSecondsSinceStart()
+     */
+    mutable TUint32 iInterpolationEndTime;
+
+    /**
+     * Start value of current interpolation.
+     */
+    mutable TReal32 iInterpolationStartValue;
+
+    /** Target value for the interpolation. */
+    TReal32 iTargetValue;
+
+    /** Pointer to a mapping function object. If <code>NULL</code>, an identity
+        mapping is used. */
+    MHuiMappingFunction* iMapFunction;
+
+private:
+    TInt iTimeRemainingWhenSuspended;
+    TInt iSpare2;
+    };
+
+
+#endif  // __HUITIMEDVALUE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiTransformation.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,246 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiTransformaton. CHuiTransformation describes 
+*                a series of matrix transformation operations.
+*
+*/
+
+
+
+#ifndef __HUITRANSFORMATION_H__
+#define __HUITRANSFORMATION_H__
+
+
+#include <e32base.h>
+
+#include <uiacceltk/HuiGc.h>
+#include <uiacceltk/HuiTimedValue.h>
+#include <uiacceltk/HuiTimedPoint.h>
+
+
+/**
+ * Indices to be used in the iParams array of TTransform.
+ */ 
+enum THuiTransformParam
+    {
+    // Translate.
+    EHuiTransformParamTranslateX = 0,
+    EHuiTransformParamTranslateY = 1,
+    EHuiTransformParamTranslateZ = 2,
+    
+    // Rotate.
+    EHuiTransformParamRotateAngle = 0,
+    EHuiTransformParamRotateAxisX = 1,
+    EHuiTransformParamRotateAxisY = 2,
+    EHuiTransformParamRotateAxisZ = 3,
+    
+    // Scale.
+    EHuiTransformParamScaleX = 0,
+    EHuiTransformParamScaleY = 1,
+    EHuiTransformParamScaleZ = 2
+    };
+
+
+/** Number of parameters for a transformation step. */
+const TInt KHuiTransformParamCount = 4;
+
+
+/**
+ * Transformation matrix with a manipulation interface.
+ */
+NONSHARABLE_CLASS(CHuiTransformation) : public CBase
+    {
+public:
+
+    /** @beginAPI */
+        
+    /** Transformation step types. */
+    enum TType
+        {
+        ETypeTranslate,
+        ETypeRotate,
+        ETypeScale
+        };
+
+    /** Transformation step. */
+    struct TTransform
+        {
+        TType iType;
+        THuiTimedValue iParams[KHuiTransformParamCount];
+        };
+        
+
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructs a new transformation.
+     */
+    IMPORT_C static CHuiTransformation* NewL();
+
+    /**
+     * Constructs a new transformation and leaves it on the cleanup stack.
+     */
+    IMPORT_C static CHuiTransformation* NewLC();
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CHuiTransformation();
+    
+    
+    /* Methods. */
+    
+    /**
+     * Returns the number of transform steps in the transformation.
+     */
+    IMPORT_C TInt Count() const;
+    
+    /**
+     * Returns the number of non-identity transform steps in the transformation.
+     * Non-identity steps will result in the transformation having an effect
+     * on geometry.
+     */
+    IMPORT_C TInt NonIdentityCount() const;
+    
+    /**
+     * Returns a reference to one of the transformation steps so that it 
+     * can be modified.
+     *
+     * @param aIndex  Index of the transformation step.
+     *
+     * @return  Reference to the transformation step. 
+     */
+    IMPORT_C TTransform& Step(TInt aIndex);
+    
+    /**
+     * Equivalent to Step().
+     */
+    IMPORT_C TTransform& operator [] (TInt aIndex);
+    
+    IMPORT_C void LoadIdentity();    
+    
+    //IMPORT_C void Begin();
+
+    /**
+     * 2D translation.
+     */
+    IMPORT_C void Translate(TReal32 aX, TReal32 aY) __SOFTFP;
+
+    /**
+     * 2D translation with timed values.
+     */
+    IMPORT_C void Translate(const THuiTimedValue& aX, const THuiTimedValue& aY);
+    
+    /**
+     * 2D scaling.
+     */
+    IMPORT_C void Scale(TReal32 aX, TReal32 aY) __SOFTFP;
+
+    /**
+     * 2D scaling with timed values.
+     */
+    IMPORT_C void Scale(const THuiTimedValue& aX, const THuiTimedValue& aY);
+
+    /**
+     * 3D scaling.
+     */
+    IMPORT_C void Scale(TReal32 aX, TReal32 aY, TReal32 aZ) __SOFTFP;
+
+    /**
+     * 3D scaling with timed values.
+     */
+    IMPORT_C void Scale(const THuiTimedValue& aX, const THuiTimedValue& aY,
+                        const THuiTimedValue& aZ);
+    
+    /**
+     * 2D rotation.
+     */
+    IMPORT_C void Rotate(TReal32 aAngle) __SOFTFP;
+    
+    /**
+     * 2D rotation with timed value.
+     */
+    IMPORT_C void Rotate(const THuiTimedValue& aAngle);
+
+    /**
+     * 3D rotation.
+     */
+    IMPORT_C void Rotate(TReal32 aAngle, TReal32 aAxisX, TReal32 aAxisY, TReal32 aAxisZ) __SOFTFP;
+    
+    /**
+     * 3D rotation with timed values.
+     */
+    IMPORT_C void Rotate(const THuiTimedValue& aAngle, 
+                         TReal32 aAxisX, TReal32 aAxisY, TReal32 aAxisZ) __SOFTFP;
+
+    /**
+     * Execute the transformation on a matrix.
+     *
+     * @param aMatrix  Matrix stack to execute the transformation on.
+     */
+    IMPORT_C void Execute(THuiGcMatrix aMatrix, CHuiGc& aGc) const;
+    
+    /** @endAPI */
+    
+    
+    /**
+     * Determines if the transformation has changed since the latest call
+     * to ClearChanged().
+     */
+    TBool Changed() const;
+
+    /**
+     * Clears the changed flags of the transformation.
+     */   
+    void ClearChanged();
+
+    const THuiTimedPoint& OriginPoint() const;
+
+
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor. Initializes member variables as an identity 
+     * transformation.
+     */   
+    CHuiTransformation();
+
+private:
+
+    /* Private methods. */
+    
+    /**
+     * Appends a new transformation step.
+     */
+    TInt Append(const TTransform& aTransform);
+
+
+private:
+
+    /** An array of transformation steps. These are executed in order. */
+    RPointerArray<TTransform> iTransforms;  
+    
+    /** Flag that tells if the transformation steps have changed. */
+    TBool iChanged;
+    
+    THuiTimedPoint iOriginPoint;
+     
+    };
+
+
+#endif  // __HUITRANSFORMATION_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiUtil.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,668 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Declares HuiUtil class, a collection of utility routines for HUITK.
+*
+*/
+
+
+
+#ifndef __HUIUTIL_H__
+#define __HUIUTIL_H__
+
+
+#include <e32base.h>
+#include <gdi.h>
+
+#include <uiacceltk/HuiRealSize.h> // for HUI_ROUND_FLOAT_TO_INT macro
+#include <uiacceltk/HuiImageVisual.h>
+
+const TUint KHuiAntialiasing = 0x00000001; // antialiasing enabled (bit mask)
+
+_LIT(KHuiUserInvariant, "User::Invariant"); // max 16 characters
+
+#define USER_INVARIANT() \
+    ( RDebug::Printf("User::Invariant in "__FILE__" on line %i", __LINE__), \
+      User::Panic(KHuiUserInvariant, 0) )
+
+/* Forward declarations. */
+class THuiRealPoint;
+class TAknFontSpecification;
+class THuiFont;
+class CHuiDisplay;
+
+
+/**
+ * HuiUtil is a collection of utility routines for HUITK.
+ * Many of the utility routines are mathematical operations such as
+ * the calculation of a vector cross product or linear interpolation between two
+ * values.
+ *
+ * HuiUtil contains only static member functions. It cannot be instantiated.
+ */
+NONSHARABLE_CLASS(HuiUtil)
+    {
+public:
+
+    /** @beginAPI */
+
+    /**
+     * Calculates the smallest power-of-two that is equal to or greater than
+     * a value (rounds value up to the nearest power-of-two).
+     *
+     * @param aValue Integer value.
+     *
+     * @return  Smallest power-of-two that is equal to or greater than
+     *          <code>aValue</code>.
+     *
+     * @see Power2RoundDown() for down-rounding equivalent.
+     */
+    IMPORT_C static TInt Power2(TInt aValue);
+
+    /**
+     * Calculates the largest power-of-two that is equal to or smaller than
+     * a value (rounds the value down to nearest power-of-two).
+     *
+     * @param aValue  Integer value.
+     *
+     * @return  Smallest power-of-two that is equal to or greater than
+     *          <code>aValue</code>.
+     */
+    IMPORT_C static TInt Power2RoundDown(TInt aValue);
+
+    /**
+     * Interpolates between two values. Calculates a linear interpolation
+     * between a minimum and maximum value.
+     *
+     * @param aPos  Position. 0.0 corresponds to the minimum value, 1.0
+     *              corresponds to the maximum value. Positions outside this
+     *              range are allowed, which results in extrapolation.
+     * @param aMin  Minimum value.
+     * @param aMax  Maximum value.
+     *
+     * @return  Interpolated value.
+     */
+    IMPORT_C static TReal32 Interpolate(TReal32 aPos, TReal32 aMin, TReal32 aMax) __SOFTFP;
+
+    /**
+     * Wraps a value to a range.
+     *
+     * @param aValue  Reference to the value to wrap. Will be modified.
+     * @param aLow    Range minimum. If aValue is equal to aLow, it will remain
+     *                at aLow.
+     * @param aHigh   Range maximum. If aValue is equal to aHigh, it will be
+     *                wrapped to aLow.
+     */
+    IMPORT_C static void WrapValue(TReal32& aValue, TReal32 aLow, TReal32 aHigh) __SOFTFP;
+
+    /**
+     * Generates a random integer.
+     *
+     * @param aMin  Minimum possible value.
+     * @param aMax  Maximum possible value.
+     *
+     * @return  Random integer between the minimum and maximum values,
+     *          inclusive.
+     */
+    IMPORT_C static TInt RandomInt(TInt aMin, TInt aMax);
+
+    /**
+     * Generates a random real number.
+     *
+     * @param aMin  Minimum possible value.
+     * @param aMax  Maximum possible value.
+     *
+     * @return  Random real number between the minimum and maximum values,
+     *          inclusive.
+     */
+    IMPORT_C static TReal32 RandomReal(TReal32 aMin, TReal32 aMax) __SOFTFP;
+
+    /**
+     * Approximates the length of a 2D vector. This is done without
+     * calculating a square root.
+     *
+     * @param aVector  2D vector as a point. The X and Y components are
+     *                 interpreted as deltas.
+     *
+     * @return  Approximate length of the vector.
+     */
+    IMPORT_C static TReal32 QuickLength(THuiRealPoint& aVector) __SOFTFP;
+
+    /**
+     * Approximates the length of a 2D vector. This is done without
+     * calculating a square root.
+     *
+     * @param aDx  X delta of the vector.
+     * @param aDy  Y delta of the vector.
+     *
+     * @return  Approximate length of the vector.
+     */
+    IMPORT_C static TReal32 QuickLength(TReal32 aDx, TReal32 aDy) __SOFTFP;
+
+    /**
+     * Normalizes a vector so that its length will be approximately 1.0.
+     * This is done without calculating a square root.
+     *
+     * @param aVector  2D vector to be normalized as a point. The X and Y
+     *                 components are interpreted as deltas. Will be modified.
+     */
+    IMPORT_C static void QuickNormalize(THuiRealPoint& aVector);
+
+    /**
+     * Normalizes a vector so that its length will be approximately 1.0.
+     * This is done without calculating a square root.
+     *
+     * @param aVector  3D vector to be normalized as a point (X, Y, Z components
+     *                 as an array of TReal32). Will be modified.
+     */
+    IMPORT_C static void QuickNormalize(TReal32 aVector[3]);
+
+    /**
+     * Calculates a cross product of 3D vectors. aProduct = aA x aB.
+     *
+     * @param aA  3D vector.
+     * @param aB  3D vector.
+     * @param aProduct  3D vector where the cross product is returned.
+     */
+    IMPORT_C static void CrossProduct(const TReal32 aA[3], const TReal32 aB[3], TReal32 aProduct[3]);
+
+    /**
+     * Calculates a normal vector for a plane defined by three points.
+     *
+     * @param aPoints  Array of three 3D vectors. The first index is the number
+     *                 of the vector, the second index is the vector component
+     *                 (x, y, z).
+     * @param aNormal  Resulting normal vector.
+     */
+    IMPORT_C static void NormalFromPoints(const TReal32 aPoints[3][3], TReal32 aNormal[3]);
+
+    /**
+     * Calculates a matrix that projects 3D points onto a plane. The name
+     * ShadowMatrix comes from the intended usage: when used as a modelview
+     * matrix, this matrix will flatten a 3D mesh onto a projected shadow.
+     *
+     * @param aPlanePoint  Point on the plane onto which the shadow is casted.
+     * @param aPlaneNormal  Normal of the plane onto which the shadow is casted.
+     * @param aLightPos  Position of the light source.
+     * @param aDestMat  Resulting matrix.
+     */
+    IMPORT_C static void ShadowMatrix(const TReal32 aPlanePoint[3],
+                                      const TReal32 aPlaneNormal[3],
+                                      const TReal32 aLightPos[4],
+                                      TReal32 aDestMat[16]);
+
+    /**
+     * Determines the amount of free memory in the system.
+     *
+     * @param aTotalMemory  If not NULL, the total amount of memory is
+     *                      returned here.
+     *
+     * @return  Bytes of free memory.
+     */
+    IMPORT_C static TUint FreeMemory(TUint* aTotalMemory = 0);
+
+    /**
+     * Determines the native resolution of the device's screen.
+     *
+     * @return  Screen size in pixels.
+     */
+    IMPORT_C static TSize ScreenSize();
+
+
+    /**
+     * Calculates a display size dependent length unit. This can be used for
+     * layout calculations that should be independent of the display size.
+     * For example, this could be the distance at which a shadow is drawn
+     * behind text strings (assuming the font size also depends on display
+     * size).
+     *
+     * @return  Length unit.
+     */
+    IMPORT_C static TReal32 LengthUnit() __SOFTFP;
+
+    /**
+     * Approximates the lightness of a color. The returned value is in range
+     * 0...1, where 0.0 means the equivalent of black and 1.0 means the
+     * equivalent of white. This is similar to the Value component in the HSV
+     * color model (but not exactly the same).
+     *
+     * @param aColor  Color whose lightness is to be evaluated.
+     *
+     * @return  Lightness value.
+     */
+    IMPORT_C static TReal32 ColorLightness(const TRgb& aColor) __SOFTFP;
+
+    /**
+     * Resamples given FBS bitmap to new size (converting
+     * color modes along the way..)
+     * @param aSrcBitmap Source bitmap to resample.
+     * @param aScaledBitmap Output bitmap. The original size of
+     * this CFbsBitmap defines the size of the downscaled bitmap.
+     */
+    IMPORT_C static void ScaleFbsBitmapL(const CFbsBitmap & aSrcBitmap,
+                                         CFbsBitmap & aScaledBitmap);
+
+    /**
+     * Converts separate mask and color bitmaps into single
+     * EColor16MA (24bpp colour plus 8bpp alpha) bitmap.
+     * @param aBitmap Source color channel bitmap.
+     * @param aMaskBitmap The source alpha mask bitmap. Use either a black and
+     * white (binary) mask bitmap, or if aMaskBitmap's display mode is EGray256,
+     * alpha blending is used. Use of any other mode may result in unpredictable
+     * results.
+     * @param aCombinedBitmap Bitmap that will to contain the target
+     * EColor16MA bitmap with color information from aBitmap and alpha information
+     * from aMaskBitmap. NOTE: Must have color mode EColor16MA!
+     */
+    IMPORT_C static void CombineMaskFbsBitmapL(const CFbsBitmap & aSrcBitmap,
+                                               const CFbsBitmap & aSrcMaskBitmap,
+                                               CFbsBitmap & aCombinedBitmap);
+
+    /**
+     * Crops an area of FBS bitmap to new image. The size of the
+     * copped bitmap defines the size of the area to crop.
+     */
+    IMPORT_C static void CropFbsBitmapL(const CFbsBitmap & aSrcBitmap,
+                                        CFbsBitmap & aCroppedBitmap,
+                                        TPoint aCropPosition);
+
+    /**
+     * Resamples given unsigned byte image data to new size. Uses box
+     * filtering. Can be used to downscale too large textures, for example.
+     *
+     * @param aComponents Number of image components (color channels) in the
+     * source image. Use 3 with RGB image and 4 with RGBA. The destination will
+     * have the same amount of color channels after this operation.
+     * @param aSrcSize Size (width and height) of the original image (aSrcBuffer),
+     * in number of pixels (width) or rows (height).
+     * @param aSrcBuffer Pointer to the source image data.
+     * @param aDestSize Size (width and height) of the new scaled image,
+     * (aDestBuffer) in number of pixels (width) or rows (height).
+     * @param aDestBuffer Output parameter: Pointer where new scaled image
+     * data will be stored. You must remember to allocate the space for the
+     * buffer before calling this method.
+     */
+    IMPORT_C static void ScaleImage(TInt aComponents,
+                                    const TSize& aSrcSize,
+                                    const TUint8* aSrcBuffer,
+                                    const TSize& aDestSize,
+                                    TUint8* aDestBuffer);
+
+    /**
+     * Crops given unsigned byte image data. Can be used to split
+     * large images to smaller sections.
+     *
+     * @param aComponents Number of image components (color channels) in the
+     * source image. Use 3 with RGB image and 4 with RGBA. The destination will
+     * have the same amount of color channels after this operation.
+     * @param aSrcBufferSize Size (width and height) of the original image (aSrcBuffer),
+     * in number of pixels (width) or rows (height).
+     * @param aSrcBuffer Pointer to the source image data.
+     * @param aCropOffset Cropping offset in the source image. Location of the
+     * top-left corner of the cropped area, in pixels.
+     * @param aCroppedSize Size of the cropped area. Is also the size of the
+     * image in aDestBuffer. Width and height in pixels.
+     * @param aDestBuffer Output parameter: Pointer where the cropped image
+     * data will be stored. You must remember to allocate the space for the
+     * buffer before calling this method.
+     */
+    IMPORT_C static void CropImage(TInt aComponents,
+                                    const TSize& aSrcBufferSize,
+                                    const TUint8* aSrcBuffer,
+                                    const TPoint& aCropOffset,
+                                    const TSize& aCroppedSize,
+                                    TUint8* aDestBuffer);
+
+
+    /**
+     * Checks if aTag is included in aTagsColonSeparated. Tags are case-sensitive.
+     *
+     * @param aTagsColonSeparated  One or more tags separated by colons (:).
+     *                             For example: "hello:world:tag3".
+     * @param aTag  Tag to look for. For example: "world".
+     *
+     * @return  <code>ETrue</code>, if the tag was found in the colon-separated
+     *          tags descriptor. <code>EFalse</code> otherwise.
+     *
+     * @see CHuiVisual::FindTag()
+     */
+    IMPORT_C static TBool TagMatches(const TDesC8& aTagsColonSeparated, const TDesC8& aTag);
+
+    /**
+     * Converts a bitmap to specified display mode.
+     * This method converts a bitmap in any display mode to specified display mode.
+     * Method creates a new bitmap, leaves it in cleanup stack and returns it.
+     *
+     * @param aBitmap The bitmap to be converted.
+     * @param aDisplaymode The target display mode to convert the bitmap into.
+     * @return Newly created conversion of the source bitmap.
+     */
+    IMPORT_C static CFbsBitmap* ConvertBitmapToDisplayModeLC( const CFbsBitmap& aBitmap, const TDisplayMode& aDisplaymode );
+
+    /** @endAPI */
+
+    /**
+     * Calculates the scale factor for an image content which is 
+     * place on a specific container are. 
+     *
+     * @param aContainerSize Container size where the image is been placed on.
+     * @param aContentSize Size of the image original.
+     * @param aScaleMode Scale mode.
+     * @param aInitialScale Initial scale value. 
+     * @return Result scale factor. Returns aInitialScale if aScaleMode = EScaleFit.
+     *
+     * @see CHuiImageVisual::TScaleMode
+     */
+    static TReal32 CalculateScaleFactorFromScaleMode( 
+        const THuiRealSize& aContainerSize,   
+        const THuiRealSize& aContentSize,
+        CHuiImageVisual::TScaleMode aScaleMode,
+        TReal32 aInitialScale = 1.f ); 
+     
+    /**
+     * Compares floating points.
+     *
+     * @param aCompare1 Another compare value
+     * @param aCompare2 Another compare value
+     * @param aEpsilon Delta value in which the compared values are treated
+     *        as equal float values.
+     * @return ETrue if the floating points are concidered to be the same.
+     */   
+    IMPORT_C static TBool RealCompare( 
+        TReal32 aCompare1, 
+        TReal32 aCompare2, 
+        TReal32 aEpsilon = 0.0001f );
+
+    /**
+     * Asserts if the given condition is false.
+     */
+    IMPORT_C static void Assert(TBool aCondition);
+
+
+    /**
+     * Creates a copy of a bitmap, ownership is transferred to caller
+     */
+    IMPORT_C static CFbsBitmap* CopyBitmapL(const CFbsBitmap& aSrc);
+    
+    /**
+     * Gets an integer value from central repository
+     * 
+     * @param aKey key whose value is queried
+     * @param aValue the value of the key
+     * @return error, if OK, KErrNone
+     *    if there is any error, aValue is not changed
+     */
+    IMPORT_C static TInt GetValueFromCentralRepository( const TUint32 aKey, TInt& aValue );
+
+    };
+
+/** Sign function template. */
+template <class T>
+inline TInt Sgn(T aVal)
+    {return(aVal>0 ? 1 : aVal<0 ? -1 : 0);}
+
+// Define our own HUI_ASSERT macro for trapping asserts.
+#ifdef _DEBUG
+// Define a wrapper for our assert method.
+#define HUI_ASSERT(cond) HuiUtil::Assert(TBool(cond))
+#define HUI_ASSERT2(cond, panic) { if(!(cond)) HUI_PANIC(panic) }
+#else // not _DEBUG
+// In release builds asserts are ignored.
+#define HUI_ASSERT(cond) //HuiUtil::Assert(cond)
+#define HUI_ASSERT2(cond, panic) 
+#endif //not _DEBUG
+
+/**
+ * Debug macros for printing debug messages. The debug messages will be
+ * redirected to console using RDebug::Print(), or to a log file if
+ * HUI_DEBUG_WITH_PRINTF is defined and CHuiStatic::EnableLogging() has been
+ * called.
+ *
+ * Note that the debug macros will not be compiled in to release builds,
+ * unless HUI_DEBUG_WITH_PRINTF is defined.
+ */
+ 
+// Debug output is disabled in windows by default.
+// It slows down the emulator, and often it is not needed
+// If you want debug output in windows, comment the following definition out.
+// It does not affect logging in hardware. In hardware debug version always logs.
+#define HUI_NO_DEBUG_OUTPUT_IN_WINS
+ 
+#ifndef __WINS__ 
+    #ifdef _DEBUG
+        #ifdef HUI_DEBUG_WITH_PRINTF
+            // Debug build that prints log output via CHuiStatic::Printf()
+            #  define HUI_DEBUG(s)                  CHuiStatic::Printf(s)
+            #  define HUI_DEBUG1(s, t)              CHuiStatic::Printf(s, t)
+            #  define HUI_DEBUG2(s, t, u)           CHuiStatic::Printf(s, t, u)
+            #  define HUI_DEBUG3(s, t, u, v)        CHuiStatic::Printf(s, t, u, v)
+            #  define HUI_DEBUG4(s, t, u, v, w)     CHuiStatic::Printf(s, t, u, v, w)
+            #  define HUI_DEBUG5(s, t, u, v, w, x)  CHuiStatic::Printf(s, t, u, v, w, x)
+            #  define HUI_DEBUG6(s, t, u, v, w, x, y)     CHuiStatic::Printf(s, t, u, v, w, x, y)
+            #  define HUI_DEBUG7(s, t, u, v, w, x, y, z)  CHuiStatic::Printf(s, t, u, v, w, x, y, z)
+        #else // HUI_DEBUG_WITH_PRINTF
+            // Debug build that prints log output via RDebug (preferably the WINSCW Emulator)
+            #  define HUI_DEBUG(s)                  RDebug::Print(s)
+            #  define HUI_DEBUG1(s, t)              RDebug::Print(s, t)
+            #  define HUI_DEBUG2(s, t, u)           RDebug::Print(s, t, u)
+            #  define HUI_DEBUG3(s, t, u, v)        RDebug::Print(s, t, u, v)
+            #  define HUI_DEBUG4(s, t, u, v, w)     RDebug::Print(s, t, u, v, w)
+            #  define HUI_DEBUG5(s, t, u, v, w, x)  RDebug::Print(s, t, u, v, w, x)
+            #  define HUI_DEBUG6(s, t, u, v, w, x, y)     RDebug::Print(s, t, u, v, w, x, y)
+            #  define HUI_DEBUG7(s, t, u, v, w, x, y, z)  RDebug::Print(s, t, u, v, w, x, y, z)
+        #endif // HUI_DEBUG_WITH_PRINTF
+    #else // _DEBUG
+        // No debug output for release builds
+        #  define HUI_DEBUG(s)
+        #  define HUI_DEBUG1(s, t)
+        #  define HUI_DEBUG2(s, t, u)
+        #  define HUI_DEBUG3(s, t, u, v)
+        #  define HUI_DEBUG4(s, t, u, v, w)
+        #  define HUI_DEBUG5(s, t, u, v, w, x)
+        #  define HUI_DEBUG6(s, t, u, v, w, x, y)
+        #  define HUI_DEBUG7(s, t, u, v, w, x, y, z)
+    #endif // _DEBUG
+#else // __WINS__ 
+    #ifdef HUI_NO_DEBUG_OUTPUT_IN_WINS
+        // No output in windows by default
+        #  define HUI_DEBUG(s)
+        #  define HUI_DEBUG1(s, t)
+        #  define HUI_DEBUG2(s, t, u)
+        #  define HUI_DEBUG3(s, t, u, v)
+        #  define HUI_DEBUG4(s, t, u, v, w)
+        #  define HUI_DEBUG5(s, t, u, v, w, x)
+        #  define HUI_DEBUG6(s, t, u, v, w, x, y)
+        #  define HUI_DEBUG7(s, t, u, v, w, x, y, z)
+    #else // HUI_NO_DEBUG_OUTPUT_IN_WINS
+        #ifdef HUI_DEBUG_WITH_PRINTF
+            // Debug build that prints log output via CHuiStatic::Printf()
+            #  define HUI_DEBUG(s)                  CHuiStatic::Printf(s)
+            #  define HUI_DEBUG1(s, t)              CHuiStatic::Printf(s, t)
+            #  define HUI_DEBUG2(s, t, u)           CHuiStatic::Printf(s, t, u)
+            #  define HUI_DEBUG3(s, t, u, v)        CHuiStatic::Printf(s, t, u, v)
+            #  define HUI_DEBUG4(s, t, u, v, w)     CHuiStatic::Printf(s, t, u, v, w)
+            #  define HUI_DEBUG5(s, t, u, v, w, x)  CHuiStatic::Printf(s, t, u, v, w, x)
+            #  define HUI_DEBUG6(s, t, u, v, w, x, y)     CHuiStatic::Printf(s, t, u, v, w, x, y)
+            #  define HUI_DEBUG7(s, t, u, v, w, x, y, z)  CHuiStatic::Printf(s, t, u, v, w, x, y, z)
+        #else // HUI_DEBUG_WITH_PRINTF
+            // Debug build that prints log output via RDebug (preferably the WINSCW Emulator)
+            #  define HUI_DEBUG(s)                  RDebug::Print(s)
+            #  define HUI_DEBUG1(s, t)              RDebug::Print(s, t)
+            #  define HUI_DEBUG2(s, t, u)           RDebug::Print(s, t, u)
+            #  define HUI_DEBUG3(s, t, u, v)        RDebug::Print(s, t, u, v)
+            #  define HUI_DEBUG4(s, t, u, v, w)     RDebug::Print(s, t, u, v, w)
+            #  define HUI_DEBUG5(s, t, u, v, w, x)  RDebug::Print(s, t, u, v, w, x)
+            #  define HUI_DEBUG6(s, t, u, v, w, x, y)     RDebug::Print(s, t, u, v, w, x, y)
+            #  define HUI_DEBUG7(s, t, u, v, w, x, y, z)  RDebug::Print(s, t, u, v, w, x, y, z)
+        #endif // HUI_DEBUG_WITH_PRINTF
+    #endif // HUI_NO_DEBUG_OUTPUT_IN_WINS
+#endif // __WINS__ 
+
+/** Framedraw debug macros for printing debug messages during frame drawing operation. */
+#ifdef HUI_DEBUG_FRAMEDRAW_WITH_PRINTF
+#  define HUI_DEBUGF(s)                  CHuiStatic::Printf(s)
+#  define HUI_DEBUGF1(s, t)              CHuiStatic::Printf(s, t)
+#  define HUI_DEBUGF2(s, t, u)           CHuiStatic::Printf(s, t, u)
+#  define HUI_DEBUGF3(s, t, u, v)        CHuiStatic::Printf(s, t, u, v)
+#  define HUI_DEBUGF4(s, t, u, v, w)     CHuiStatic::Printf(s, t, u, v, w)
+#  define HUI_DEBUGF5(s, t, u, v, w, x)  CHuiStatic::Printf(s, t, u, v, w, x)
+#  define HUI_DEBUGF6(s, t, u, v, w, x, y)     CHuiStatic::Printf(s, t, u, v, w, x, y)
+#  define HUI_DEBUGF7(s, t, u, v, w, x, y, z)  CHuiStatic::Printf(s, t, u, v, w, x, y, z)
+#else
+#ifdef HUI_DEBUG_FRAMEDRAW
+#  define HUI_DEBUGF(s)                  RDebug::Print(s)
+#  define HUI_DEBUGF1(s, t)              RDebug::Print(s, t)
+#  define HUI_DEBUGF2(s, t, u)           RDebug::Print(s, t, u)
+#  define HUI_DEBUGF3(s, t, u, v)        RDebug::Print(s, t, u, v)
+#  define HUI_DEBUGF4(s, t, u, v, w)     RDebug::Print(s, t, u, v, w)
+#  define HUI_DEBUGF5(s, t, u, v, w, x)  RDebug::Print(s, t, u, v, w, x)
+#  define HUI_DEBUGF6(s, t, u, v, w, x, y)     RDebug::Print(s, t, u, v, w, x, y)
+#  define HUI_DEBUGF7(s, t, u, v, w, x, y, z)  RDebug::Print(s, t, u, v, w, x, y, z)
+#else
+#  define HUI_DEBUGF(s)
+#  define HUI_DEBUGF1(s, t)
+#  define HUI_DEBUGF2(s, t, u)
+#  define HUI_DEBUGF3(s, t, u, v)
+#  define HUI_DEBUGF4(s, t, u, v, w)
+#  define HUI_DEBUGF5(s, t, u, v, w, x)
+#  define HUI_DEBUGF6(s, t, u, v, w, x, y)
+#  define HUI_DEBUGF7(s, t, u, v, w, x, y, z)
+#endif
+#endif
+
+
+
+/**
+ * Non-exporting implementation for MHuiSessionObject
+ */
+#define HUI_SESSION_OBJECT_IMPL(classname, type) \
+MHuiSessionObject::TType classname::Type() const \
+    { \
+    return type; \
+    } \
+\
+TInt classname::SessionId() const \
+    { \
+    return iSessionId; \
+    } \
+\
+void classname::SetSessionId(TInt aSessionId) \
+    { \
+    iSessionId = aSessionId; \
+    }
+
+
+/**
+ * Implementation for MHuiSessionObject with exports
+ */
+#define HUI_SESSION_OBJECT_IMPL_EXPORT(classname, type) \
+EXPORT_C MHuiSessionObject::TType classname::Type() const \
+    { \
+    return type; \
+    } \
+\
+EXPORT_C TInt classname::SessionId() const \
+    { \
+    return iSessionId; \
+    } \
+\
+EXPORT_C void classname::SetSessionId(TInt aSessionId) \
+    { \
+    iSessionId = aSessionId; \
+    }
+
+
+/* Probing macros. Probing is enabled only if macro HUI_PROBE_ENABLED is defined. */
+#ifdef HUI_PROBE_ENABLED
+
+/**
+ * Associate this object with current session.
+ */
+#define HUI_PROBE_ASSOCIATE_WITH_CURRENT_SESSION \
+    CHuiStatic::Probe().AssociateWithCurrentSession(*this);
+    
+/**
+ * Report to Hui Probe object; report construction of this object.
+ */
+#define HUI_PROBE_REPORT_CONSTRUCTED \
+    CHuiStatic::Probe().ReportObjectLifeCycleEvent(*this, MHuiProbe::ELifecycleEventConstructed);
+    
+/**
+ * Report to Hui Probe object; report destruction of this object.
+ */
+#define HUI_PROBE_REPORT_DESTRUCTED \
+    CHuiStatic::Probe().ReportObjectLifeCycleEvent(*this, MHuiProbe::ELifecycleEventDestructed);
+    
+/**
+ * Report to Hui Probe object; report release of this object.
+ */
+#define HUI_PROBE_REPORT_RELEASED \
+    CHuiStatic::Probe().ReportObjectLifeCycleEvent(*this, MHuiProbe::ELifecycleEventReleased);
+    
+/**
+ * Report to Hui Probe object; report restoration of this object.
+ */
+#define HUI_PROBE_REPORT_RESTORED \
+    CHuiStatic::Probe().ReportObjectLifeCycleEvent(*this, MHuiProbe::ELifecycleEventRestored);
+
+/**
+ * Report to Hui Probe object; report entering on program flow point
+ */
+#define HUI_PROBE_PROGRAMFLOW_ENTER(point) \
+    CHuiStatic::Probe().ReportProgramFlowEvent( \
+        point, \
+        MHuiProbe::EProgramFlowEventEnter);
+        
+/**
+ * Report to Hui Probe object; report exiting from program flow point
+ */
+#define HUI_PROBE_PROGRAMFLOW_EXIT(point) \
+    CHuiStatic::Probe().ReportProgramFlowEvent( \
+        point, \
+        MHuiProbe::EProgramFlowEventExit);
+
+/**
+ * Report to Hui Probe object; report entering on program flow point,
+ * where the program flow point is in session object.
+ */
+#define HUI_PROBE_PROGRAMFLOW_WITHSESSION_ENTER(point) \
+    CHuiStatic::Probe().ReportProgramFlowEvent( \
+        *this, \
+        point, \
+        MHuiProbe::EProgramFlowEventEnter);
+        
+/**
+ * Report to Hui Probe object; report exiting from program flow point,
+ * where the program flow point is in session object.
+ */
+#define HUI_PROBE_PROGRAMFLOW_WITHSESSION_EXIT(point) \
+    CHuiStatic::Probe().ReportProgramFlowEvent( \
+        *this, \
+        point, \
+        MHuiProbe::EProgramFlowEventExit);
+
+#else // HUI_PROBE_ENABLED
+
+#define HUI_PROBE_ASSOCIATE_WITH_CURRENT_SESSION
+#define HUI_PROBE_REPORT_CONSTRUCTED
+#define HUI_PROBE_REPORT_DESTRUCTED
+#define HUI_PROBE_REPORT_RELEASED
+#define HUI_PROBE_REPORT_RESTORED
+#define HUI_PROBE_PROGRAMFLOW_ENTER(point)
+#define HUI_PROBE_PROGRAMFLOW_EXIT(point)
+#define HUI_PROBE_PROGRAMFLOW_WITHSESSION_ENTER(point)
+#define HUI_PROBE_PROGRAMFLOW_WITHSESSION_EXIT(point)
+
+#endif // HUI_PROBE_ENABLED
+
+#endif // __HUIUTIL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiVisual.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1736 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines CHuiVisual. Visuals are graphical entities visible on a display
+*
+*/
+
+
+
+#ifndef __HUIVISUAL_H__
+#define __HUIVISUAL_H__
+
+
+#include <e32base.h>
+#include <e32std.h>
+#include <uiacceltk/HuiTimedPoint.h>
+#include <uiacceltk/huimetric.h>
+#include <uiacceltk/HuiRealRect.h>
+#include <uiacceltk/HuiRealPoint.h>
+#include <uiacceltk/HuiRealSize.h>
+#include <uiacceltk/HuiOwnedPointer.h>
+#include <uiacceltk/HuiBrush.h>
+#include <uiacceltk/HuiBrushArray.h>
+#include <uiacceltk/HuiSessionObject.h>
+
+
+/* Forward declarations. */
+class CHuiEnv;
+class CHuiControlGroup;
+class CHuiSkin;
+class CHuiControl;
+class MHuiEventHandler;
+class CHuiDisplay;
+class CHuiLayout;
+class CHuiGc;
+class CHuiVisual;
+class CHuiTransformation;
+class CHuiDropShadow;
+class CHuiFxEffect;
+class CHuiFxEffectParser;
+class MHuiEffectable;
+class CHuiCanvasRenderBuffer;
+/** Visual types. */
+enum THuiVisualType
+    {
+    EHuiVisualTypeVisual,
+    EHuiVisualTypeLine,
+    EHuiVisualTypeText,
+    EHuiVisualTypeImage,
+    EHuiVisualTypeMesh,
+    EHuiVisualTypeCanvas
+    };
+
+
+/**
+ * Visual flags.
+ *
+ * @see CHuiVisual::SetFlag()
+ * @see CHuiVisual::SetFlags()
+ * @see CHuiVisual::Flags() 
+ * @see CHuiVisual::ClearFlag() 
+ * @see CHuiVisual::ClearFlags()  
+ */
+enum THuiVisualFlags
+    {
+    /** Manual layout means that layouts can't change the position and
+        size of the visual; the owner of the visual is expected to
+        manually maintain the visual's placement. */
+    EHuiVisualFlagManualSize = 0x1,
+    EHuiVisualFlagManualPosition = 0x2,
+    EHuiVisualFlagManualLayout = EHuiVisualFlagManualSize |
+                                 EHuiVisualFlagManualPosition,
+
+    EHuiVisualFlagBlendAdd = 0x4,
+
+    /** Notify owner control when the visual's layout has been updated.
+        Notication is sent after all children have been updated. */
+    EHuiVisualFlagLayoutUpdateNotification = 0x8,
+
+    /** When the visual is drawn it will use a 3D projection. */
+    EHuiVisualFlag3DProjection = 0x10,
+
+    /** No depth test when drawing with a 3D projection. */
+    EHuiVisualFlagNoDepthOcclusion = 0x20,
+
+    /** Use a local horizon with a 3D projection. Otherwise, the global
+        display horizon is used instead. */
+    EHuiVisualFlagLocalHorizon = 0x40,
+
+    /** Contents of the visual are clipped to its display rectangle. */
+    EHuiVisualFlagClipping = 0x80,
+
+    /** Visual is using a horizontal center origin, i.e., the X coordinate
+        of the visual's position defines its horizontal center point. */
+    EHuiVisualFlagHOriginCenter = 0x100,
+
+    /** Visual is using a right edge origin, i.e., the X coordinate
+        of the visual's position defines its right edge. */
+    EHuiVisualFlagHOriginRight = 0x200,
+
+    /** Visual is using a vertical center origin, i.e., the Y coordinate
+        of the visual's position defines its vertical center point. */
+    EHuiVisualFlagVOriginCenter = 0x400,
+
+    /** Visual is using a bottom edge origin, i.e., the Y coordinate
+        of the visual's position defines its bottom edge. */
+    EHuiVisualFlagVOriginBottom = 0x800,
+
+    /** Visual has changed and needs refresh. */
+    EHuiVisualChanged = 0x1000,
+
+    /** When the visual is drawn, the depth buffer shouldn't be updated. */
+    EHuiVisualFlagNoDepthUpdate = 0x2000,
+
+    /** Use the visual's local layout transition time, do not inherit from parent. */
+    EHuiVisualFlagManualTransitionTime = 0x4000,
+
+    /** Draw above the normal drawing order. */
+    EHuiVisualFlagDrawAfterOthers = 0x10000,
+    
+    /** Do not automatically update the layout of children when doing 
+        changes in a layout (e.g., when reordering children). */
+    EHuiVisualFlagFreezeLayout = 0x20000,
+
+    /** The visual will be ignored when checking for possible pointer event
+        interaction. */
+    EHuiVisualFlagIgnorePointer = 0x40000,
+
+    /** 
+     * automatically reverse the base unit sign in the X axis if the current locale setting is 
+     * for mirrored layout
+     *
+     * @note this will only affect the positions of visuals contained
+     * within layout visuals, the contents within a visual such as a text visual will not be 
+     * affected. 
+     */
+    EHuiVisualFlagAutomaticLocaleMirroringEnabled = 0x80000,
+    
+    /** 
+     * RnD: if set, some of the debug features are enabled. See programmers'
+     * guide for more info.
+     *
+     * If the central repository has the setting to draw selected visual outline, 
+     * setting this flag will draw outline for the visual and its child visuals
+     */    
+    EHuiVisualFlagEnableDebugMode  = 0x100000,
+
+    /** 
+     * Setting this flag makes visual and its children Inactive i.e. it is ignored from roster operations 
+     * - Draw, Handle event, change notifications etc.
+     * Unsetting flag can again make visual tree active.
+     * Note that flag change does not take effect unless that display area is refreshed.
+     **/
+    EHuiVisualFlagInactive = 0x200000,
+
+    /** 
+     * Setting this flag informs renderer that visual is to be considered as opaque and thus
+     * renderer may choose not to draw visuals behind opaque visual. Note that visual
+     * attribute "opacity" is not affected by this flag.
+     **/
+    EHuiVisualFlagOpaqueHint = 0x400000,
+    
+    /** 
+     * \internal
+     * Setting this flag means that visual is not drawn to the normal place in visual tree.
+     * If some canvas visual has set this visual as an external content visual, it is drawn there.
+     * This is used only for canvas visuals and this is for internal use only.
+     **/    
+    EHuiVisualFlagDrawOnlyAsExternalContent = 0x800000,
+    
+    EHuiVisualFlagShouldBeHidden = 0x1000000,
+    
+    EHuiVisualFlagShouldDestroy = 0x2000000,
+            
+    EHuiVisualFlagShouldBeInactive = 0x4000000,
+    
+	EHuiVisualFlagAlwaysDraw = 0x8000000,
+
+    /**
+     * This indicates that this visual is completely under another opaque visual.
+     * So this is a hint, set by client, that the toolkit can use to optimize drawing.
+     */
+    EHuiVisualFlagUnderOpaqueHint = 0x10000000,
+
+    EHuiVisualFlagShouldBeUnderOpaqueHint = 0x20000000,
+    
+    EHuiVisualFlagShouldBeShown = 0x40000000,
+    
+    EHuiVisualFlagLast = 0xFFFFFFFF
+    };
+
+
+/** Horizontal origin of a visual. */
+enum THuiVisualHOrigin
+    {
+    EHuiVisualHOriginLeft = 0,
+    EHuiVisualHOriginCenter = 1,
+    EHuiVisualHOriginRight = 2
+    };
+
+
+/** Vertical origin of a visual. */
+enum THuiVisualVOrigin
+    {
+    EHuiVisualVOriginTop = 0,
+    EHuiVisualVOriginCenter = 1,
+    EHuiVisualVOriginBottom = 2
+    };
+
+enum THuiReferenceState
+ 	{
+  	EHuiReferenceStateNow = 0,
+  	EHuiReferenceStateTarget = 1
+  	};
+  	
+const TInt KHuiTactileFeedbackEventTypeNone = -1;
+
+/**
+ * Interface for visual owners. A class that owns a visual must implement 
+ * this interface. Visual owners are expected to destroy their visuals when
+ * the owner is destroyed.
+ */
+class MHuiVisualOwner
+    {
+public:
+
+    IMPORT_C virtual ~MHuiVisualOwner();
+
+    /**
+     * Returns the environment where this visual belongs into.
+     *
+     * @return  Environment.
+     */
+    virtual CHuiEnv& Env() const = 0;
+
+    /**
+     * Determines the control group in which the owner belong to. If the owner
+     * does not belong to a control group, <code>NULL</code> is returned.
+     *
+     * @return Control group or <code>NULL</code>.
+     */
+    virtual CHuiControlGroup* ControlGroup() const = 0;
+    
+    /**
+     * Returns the event handler resposible for handling events related to 
+     * the visual, for example when the visual receives a pointer down event.
+     */
+    virtual MHuiEventHandler* EventHandler() = 0;
+
+	/**
+	 * Appends a visual to the visual owner. 
+	 *
+	 * @param aVisual  Visual to append. The owner receives ownership
+	 * of the visual.
+	 *
+     * @return Reference to appended visual.
+	 */
+    virtual void AppendL(CHuiVisual* aVisual) = 0;
+
+	/**
+	 * Removes a visual from the owner. 
+	 *
+	 * @param aVisual  Visual to remove. 
+	 *
+	 * @return Pointer to removed visual. Caller gets ownership.
+	 */
+	virtual void Remove(CHuiVisual* aVisual) = 0;
+
+    /**
+     * Removes a visual from the ownership of the owner. This is called when
+     * the visual is being destroyed.
+     *
+     * @param aVisual  Visual to remove.
+     */
+    virtual void VisualDestroyed(CHuiVisual& aVisual) = 0;
+
+    /**
+     * Notifies the owner that the layout of a visual has been recalculated.
+     * Called only when the EHuiVisualFlagLayoutUpdateNotification flag has
+     * been set for the visual.
+     *
+     * @param aVisual  Visual that has been laid out.
+     */
+    virtual void VisualLayoutUpdated(CHuiVisual& aVisual) = 0;
+   
+	/**
+	 * Notifies the visual owner if there was an error (a leave happened)
+	 * when preparing the visual for drawing. Typically the resource alloc
+	 * errors such as out of memory is escalated through this callback.
+	 * 
+     * @param aVisual    Visual that caused the error.
+     * @param aErrorCode Symbian KErr error code for the failure.
+	 */
+    virtual void VisualPrepareDrawFailed(CHuiVisual& aVisual, TInt aErrorCode) = 0;
+
+    };
+
+
+/**
+ * Visuals are graphical entities visible on a display. They are responsible
+ * for maintaining their state independently.
+ *
+ * Visuals use a hierarchical coordinate system. All coordinate values are
+ * specified in the base unit of the parent layout, relative to the parent 
+ * visual's upper left corner. This is called the local coordinate system of
+ * the visual. Visuals that have no parent are relative to the upper left 
+ * corner of the HuiDisplay.
+ *
+ * In practice, this means that when a layout is moved 10 pixels to the right,
+ * all of its children are automatically also moved 10 pixels to the right
+ * on the screen.
+ *
+ * Visuals can be tagged with human-readable descriptors. @see SetTagL()
+ *
+ * Note that all layouts are derived from CHuiVisual. Layout visuals are
+ * used for building visual trees. @see CHuiLayout
+ */
+class CHuiVisual : public CBase, public MHuiBrushGuide, public MHuiSessionObject
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /** @beginAPI */
+
+    /**
+     * Constructs and appends a new visual to the owner control.
+     *
+     * @param aOwnerControl  Control that will own the new visual.
+     *
+     * @return  The new visual.
+     */
+    IMPORT_C static CHuiVisual* AddNewL(CHuiControl& aOwnerControl,
+                                        CHuiLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     *
+     * @param aEnv    The environment where this visuals belongs to.
+     * @param aOwner  Owner control.
+     */
+    IMPORT_C CHuiVisual(MHuiVisualOwner& aOwner);
+
+    /**
+     * Second-phase constructor, must be called in deriving class.
+     */
+    IMPORT_C virtual void ConstructL();
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C ~CHuiVisual();
+
+
+    /* New Methods. */
+
+    /**
+     * Destroys a hierarchy of visuals, along with this visual. The visuals
+     * are first removed from their owner.
+     */
+    IMPORT_C virtual void RemoveAndDestroyAllD();
+
+    /**
+     * Sets the tag of the visual.
+     *
+     * The tag is a descriptor, in the form of one or more colon-separated
+     * character sequences. By default, visuals have no tag (""). Normally,
+     * a visual could have a single tag, for example ("caption").
+     * The tag descriptor of the visual may contain multiple tags,
+     * for example: "tag1:tag2:tag3".
+     *
+     * Tags can be used for identifying visuals. In a typical use case, a control
+     * could identify which of its visuals represent certain elements of the
+     * control based on the tag descriptors. In this case, the tags would be
+     * set by an outside party that also sets the tags of the visuals.
+     *
+     * @param aTag  Tag descriptor for the visual.
+     *
+     * @see CHuiVisual::Tag()
+     * @see CHuiVisual::IsTagged()
+     * @see CHuiVisual::FindTag()
+     */
+    IMPORT_C void SetTagL(const TDesC8& aTag);
+
+    /**
+     * Determines the tag of the visual.
+     *
+     * @return  Tag descriptor of the visual.
+     *
+     * @see CHuiVisual::SetTagL()
+     * @see CHuiVisual::IsTagged()
+     * @see CHuiVisual::FindTag()
+     */
+    IMPORT_C const TDesC8& Tag() const;
+
+    /**
+     * Determines if the visual has a tag.
+     *
+     * @return  <code>ETrue</code>, if the visual has been tagged with SetTagL().
+     *          <code>EFalse</code> otherwise.
+     *
+     * @see CHuiVisual::Tag()
+     * @see CHuiVisual::SetTagL()
+     * @see CHuiVisual::FindTag()
+     */
+    IMPORT_C TBool IsTagged() const;
+
+    /**
+     * Finds a visual whose tag descriptor contains a specific tag.
+     *
+     * CHuiVisual::FindTag() is the basic implementation that checks if
+     * this visual's tag matches the specified tag. CHuiLayout::FindTag()
+     * extends the search into child visuals, covering recursively entire
+     * visual hierarchies.
+     *
+     * @param aTag  Tag to look for. If this tag is found as a part of a
+     *              visual's colon-separated tag descriptor, it is treated
+     *              as a match and the visual is returned. The tag to look
+     *              for cannot contain separator characters (:).
+     *
+     * @return  Visual whose tag descriptor matches the tag. <code>NULL</code>,
+     *          if no such visual could be found.
+     *
+     * @see CHuiVisual::Tag()
+     * @see CHuiVisual::SetTagL()
+     * @see CHuiVisual::IsTagged()
+     * @see CHuiLayout::FindTag()
+     */
+    IMPORT_C virtual CHuiVisual* FindTag(const TDesC8& aTag);
+
+    /**
+     * Set a flag that affects the visual's behaviour.
+     *
+     * @param aFlag  Flag to set.
+     */
+    IMPORT_C void SetFlag(THuiVisualFlags aFlag);
+
+    /**
+     * Sets one or more flags that affect the visual's behaviour.
+     *
+     * @param aAnyFlags  One or more flags to set.
+     */
+    IMPORT_C void SetFlags(TInt aAnyFlags);
+
+    /**
+     * Unset flags that affect the visual's behaviour.
+     *
+     * @param aFlag  Flag to clear.
+     */
+    IMPORT_C void ClearFlag(THuiVisualFlags aFlag);
+
+    /**
+     * Clear one or more flags that affect the visual's behaviour.
+     *
+     * @param aAnyFlags  One or more flags to clear.
+     */
+    IMPORT_C void ClearFlags(TInt aAnyFlags);
+
+    /**
+     * Returns the flags of the visual.
+     */
+    inline TInt Flags() const;
+
+    /**
+     * Returns the owner of the visual.
+     */
+    IMPORT_C MHuiVisualOwner& Owner() const;
+
+    /**
+     * Sets the owner of the visual.
+     *
+     * @param aOwner  New owner of the visual.
+     */
+    IMPORT_C void SetOwner(MHuiVisualOwner& aOwner);
+    
+    /**
+     * Returns the number of child visuals.
+     */
+    IMPORT_C virtual TInt Count() const;
+
+    /**
+     * Returns a child visual.
+     *
+     * @param aIndex  Index of the child visual.
+     *
+     * @return  Reference to a child visual.
+     */
+    IMPORT_C virtual CHuiVisual& Visual(TInt aIndex) const;
+
+    /**
+     * Returns the layout this visual belongs to.
+     */
+    IMPORT_C CHuiLayout* Layout() const;
+
+    /**
+     * Sets the layout this visual belongs to.
+     */
+    void SetLayout(CHuiLayout* aLayout);
+
+    /**
+     * Returns the environment of the visual.
+     */
+    IMPORT_C CHuiEnv& Env() const;
+
+    /**
+     * Returns the skin of the owner control's environment.
+     */
+    IMPORT_C CHuiSkin& Skin() const;
+
+    /**
+     * Returns the display of the visual (if shown).
+     *
+     * @return  Pointer to <code>CHuiDisplay</code> instance, or
+     * <code>NULL</code> if no display is associated with the visual.
+     */
+    IMPORT_C CHuiDisplay* Display() const;
+
+    /**
+     * Sets the display on which the visual is being shown.
+     */
+    void SetDisplay(CHuiDisplay* aDisplay);
+
+    /**
+     * Sets the origin of the visual. The origin defines the location of the
+     * visual's position in relation to its DisplayRect. By default the visual's
+     * position defines its top left corner.
+     *
+     * Calling this method is equivalent to setting/clearing the corresponding
+     * flags.
+     */
+    IMPORT_C void SetOrigin(THuiVisualHOrigin aHoriz, THuiVisualVOrigin aVert);
+
+    /**
+     * Determines the horizontal origin.
+     */
+    IMPORT_C THuiVisualHOrigin HorizontalOrigin() const;
+
+    /**
+     * Determines the vertical origin.
+     */
+    IMPORT_C THuiVisualVOrigin VerticalOrigin() const;
+    
+    /**
+     * Moves a point according to the visual's origin position. If this is called
+     * on both the iTl and iBr corners of a rectangle, the result is that the
+     * rectangle is aligned by the origin. This method is used during the calculations 
+     * to determine a visual's display rectangle.
+     *
+     * @param aPoint  Point to move.
+     * @param aUndo   Which way to offset the point (apply or undo the alignment).
+     */
+    IMPORT_C void AlignByOrigin(THuiRealPoint& aPoint, TBool aUndo = EFalse) const;
+
+    /**
+     * @deprecated  Use base unit version instead
+     *
+     * Sets the minimum size of the visual.
+     *
+     * @param aMinSize  Minimum size of the visual.
+     */
+    IMPORT_C void SetMinSize(const TSize& aMinSize);
+
+    /**
+     * Sets the minimum size of the visual.
+     *
+     * @param aMinSize  Minimum size of the visual in base units.
+     */
+    IMPORT_C void SetMinSize(const THuiRealSize& aMinSize);
+
+    /**
+     * @deprecated  Use base unit version instead
+     *
+     * Returns the minimum size of the visual.
+     */
+    IMPORT_C TSize MinSize() const;
+
+    /**
+     * Returns the minimum size of the visual in base units.
+     */
+    IMPORT_C THuiRealSize MinSizeInBaseUnits() const __SOFTFP;
+
+    /**
+     * @deprecated  Use base unit version instead
+     *    
+     * Sets the maximum size of the visual.
+     *
+     * @param aMaxSize  Maximum size of the visual.
+     */
+    IMPORT_C void SetMaxSize(const TSize& aMaxSize);
+
+    /**
+     * Sets the maximum size of the visual.
+     *
+     * @param aMaxSize  Maximum size of the visual in base units.
+     */
+    IMPORT_C void SetMaxSize(const THuiRealSize& aMaxSize);
+
+    /**
+     * @deprecated  Use base unit version instead
+     *    
+     * Returns the maximum size of the visual.
+     */
+    IMPORT_C TSize MaxSize() const;
+
+    /**
+     * Returns the maximum size of the visual in base units.
+     */
+    IMPORT_C THuiRealSize MaxSizeInBaseUnits() const __SOFTFP;
+
+    /**
+     * Returns the position of the visual. This is set by UpdateLayout().
+     */
+    IMPORT_C const THuiTimedPoint& Pos() const;
+
+    /**
+     * Returns the size of the visual. This is set by UpdateLayout().
+     */
+    IMPORT_C const THuiTimedPoint& Size() const;
+
+    inline THuiTimedPoint& Size();
+ 
+    /**
+     * Sets the position of the visual.
+     * 
+     * This method should be used only when doing manual layouting. 
+     * If the visuals are under a layout that defines positions for its children (such
+     * as CHuiGridLayout), then the layout class's facilities should be used instead.
+     * 
+     * If you want to move or otherwise layout the visual manually, you should 
+     * set the EHuiVisualFlagManualLayout flag using the SetFlag() method.
+     * 
+     * @note Even if the visual has no parent -- the roster will automatically 
+     * lay it out to cover the entire display, so the EHuiVisualFlagManualLayout
+     * will be needed if you want to assign the position yourself.
+     * 
+     * @param aPos             Target position, in the local coordinate system as
+     *                         defined by the parent layout (or the display, 
+     *                         if there is no parent).
+     * @param aTransitionTime  Transition time in milliseconds.
+     */
+    IMPORT_C virtual void SetPos(const THuiRealPoint& aPos, TInt aTransitionTime = 0);
+
+    /**
+     * Sets the size of the visual.
+     * 
+     * This method should be used only when doing manual layouting. 
+     * If the visuals are under a layout that defines sizes for its children (such
+     * as CHuiGridLayout), then the layout class's facilities should be used instead.
+     *
+     * If you want to move or otherwise layout the visual manually, you should 
+     * set the EHuiVisualFlagManualLayout flag using SetFlag() method.
+     * 
+     * @note Even if the visual has no parent -- the roster will automatically 
+     * lay it out to cover the entire display, so the EHuiVisualFlagManualLayout
+     * will be needed if you want to assign the size yourself.
+     * 
+     * @param aSize            New size for this visual, in the local coordinate 
+     *                         system as defined by the parent layout (or the display, 
+     *                         if there is no parent).
+     * @param aTransitionTime  Transition time in milliseconds.
+     */
+    IMPORT_C virtual void SetSize(const THuiRealSize& aSize, TInt aTransitionTime = 0);
+
+    /**
+     * Sets the position and size of the visual.
+     *
+     * This method should be used only when doing manual layouting. 
+     * If the visuals are under a layout that defines positions and sizes for 
+     * its children (such as CHuiGridLayout), then the layout class's facilities 
+     * should be used instead.
+     *
+     * If you want to move or otherwise layout the visual manually, you should 
+     * set the EHuiVisualFlagManualLayout flag using SetFlag() method.
+     * 
+     * @note Even if the visual has no parent -- the roster will automatically 
+     * lay it out to cover the entire display, so the EHuiVisualFlagManualLayout
+     * will be needed if you want to assign the rectangle yourself.
+     * 
+     * @param aRect            Target rectangle, in the local coordinate 
+     *                         system as defined by the parent layout (or the display, 
+     *                         if there is no parent).
+     * @param aTransitionTime  Transition time in milliseconds.
+     */
+    IMPORT_C void SetRect(const THuiRealRect& aRect, TInt aTransitionTime = 0);
+
+    /**
+     * @deprecated  Use base unit version instead
+     *    
+     * Moves the visual's position.
+     * 
+     * Move() should be used only when doing manual layouting (same goes for 
+     * SetPos() and SetSize()). 
+     * If the visuals are under a layout that defines positions for its children (such
+     * as CHuiGridLayout), then the layout class's facilities should be used instead.
+     * 
+     * If you want to move or otherwise layout the visual manually, you should 
+     * set the EHuiVisualFlagManualLayout flag using SetFlag() method.
+     * 
+     * @note Even if the visual has no parent -- the roster will automatically 
+     * lay it out to cover the entire display, so the EHuiVisualFlagManualLayout
+     * will be needed if you want to move this visual.
+     *
+     * @param aOffset          Offset from the current target.
+     * @param aTransitionTime  Transition time in milliseconds.
+     */
+    IMPORT_C void Move(const TPoint& aOffset, TInt aTransitionTime = 0);
+
+    /**
+     * Moves the visual's position.
+     * 
+     * Move() should be used only when doing manual layouting (same goes for 
+     * SetPos() and SetSize()). 
+     * If the visuals are under a layout that defines positions for its children (such
+     * as CHuiGridLayout), then the layout class's facilities should be used instead.
+     * 
+     * If you want to move or otherwise layout the visual manually, you should 
+     * set the EHuiVisualFlagManualLayout flag using SetFlag() method.
+     * 
+     * @note Even if the visual has no parent -- the roster will automatically 
+     * lay it out to cover the entire display, so the EHuiVisualFlagManualLayout
+     * will be needed if you want to move this visual.
+     *
+     * @param aOffset          Offset from the current target.
+     * @param aTransitionTime  Transition time in milliseconds.     
+     */
+    IMPORT_C void Move(const THuiRealPoint& aOffset, TInt aTransitionTime = 0);
+
+    /**
+     * Positions and sizes this visual to match another.
+     * 
+     * This method should be used only when doing manual layouting. If the visuals are under 
+     * a layout, then the layout class's facilities should be used instead.
+     *
+     * If you want to move or otherwise layout the visual manually, you should 
+     * set the EHuiVisualFlagManualLayout flag using SetFlag() method.
+     * 
+     * @note Even if the visual has no parent -- the roster will automatically 
+     * lay it out to cover the entire display, so the EHuiVisualFlagManualLayout
+     * will be needed if you want to mimic other visuals.
+     * 
+     * @param aVisual  Visual whose position and size to copy.
+     */
+    IMPORT_C void Mimic(const CHuiVisual& aVisual, TInt aTransitionTime = 0);
+
+    /**
+     * @deprecated  Use base unit version instead
+     *        
+     * Sets the position and size of the visual.
+     * 
+     * This method should be used only when doing manual layouting. If the visuals are under 
+     * a layout, then the layout class's facilities should be used instead.
+     *
+     * If you want to move or otherwise layout the visual manually, you should 
+     * set the EHuiVisualFlagManualLayout flag using SetFlag() method.
+     * 
+     * @note Even if the visual has no parent -- the roster will automatically 
+     * lay it out to cover the entire display, so the EHuiVisualFlagManualLayout
+     * will be needed if you want to assign the position and size yourself.
+     *
+     * @param aCenterPoint     New center point of the visual.
+     * @param aSize            New size of the visual.
+     * @param aTransitionTime  Number of milliseconds for transitioning to new values.
+     */
+    IMPORT_C void SetCenteredPosAndSize(const TPoint& aCenterPoint,
+                                        const TSize& aSize,
+                                        TInt aTransitionTime = 0);
+    /**
+     * Sets the position and size of the visual.
+     * 
+     * This method should be used only when doing manual layouting. If the visuals are under 
+     * a layout, then the layout class's facilities should be used instead.
+     *
+     * If you want to move or otherwise layout the visual manually, you should 
+     * set the EHuiVisualFlagManualLayout flag using SetFlag() method.
+     * 
+     * @note Even if the visual has no parent -- the roster will automatically 
+     * lay it out to cover the entire display, so the EHuiVisualFlagManualLayout
+     * will be needed if you want to assign the position and size yourself.
+     *
+     * @param aCenterPoint     New center point of the visual in metric units.
+     * @param aSize            New size of the visual in metric units.
+     * @param aTransitionTime  Number of milliseconds for transitioning to new values.     
+     */
+    IMPORT_C void SetCenteredPosAndSize(const THuiRealPoint& aCenterPoint,
+                                        const THuiRealSize& aSize,
+                                        TInt aTransitionTime = 0);
+
+    /**
+     * Update the layout of all children. Subclasses can call this to
+     * recalculate the layout of all children.
+     *
+     * @param aTransitionTime  Time for layout transition.
+     *      CHuiStatic::LayoutTransitionTime() should be used
+     *      as the default value, if an immediate transition is not required.
+     *
+     * @see CHuiStatic::LayoutTransitionTime()
+     */
+    IMPORT_C virtual void UpdateChildrenLayout(TInt aTransitionTime = 0);
+
+    /**
+     * For convenience. Updates the layout of the siblings of this visual. In other words,
+     * asks the parent layout to do a children layout.
+     *
+     * @param aTransitionTime  Time for layout transition.
+     */
+    IMPORT_C void UpdateSiblingLayout(TInt aTransitionTime = 0);
+
+    /**
+     * Calculates the visual's bounding rectangle in display coordinates.
+     * Display coordinates are defined relative to the display's visible area.
+     * Uses the current values of the position and size. Only calculated once 
+     * per frame. The rect is always in pixels.
+     */
+    IMPORT_C THuiRealRect DisplayRect() const __SOFTFP;
+
+    /**
+     * Calculates the visual's bounding rectangle animation target 
+     * in display coordinates. Display coordinates are defined 
+     * relative to the display's visible area. Uses the target 
+     * values of the rectangle position and size, which means 
+     * transitions are always immediate in the returned rectangle. 
+     * Only calculated once per frame. The rect is always in pixels.
+     */
+    IMPORT_C THuiRealRect DisplayRectTarget() const __SOFTFP;
+    
+    /**
+     * Determines the base unit of the local coordinate system, in which
+     * this visual's position and size are stored. The position and size
+     * of the visual are multiplied by this metric to get the actual
+     * position and size.
+     *
+     * @return  Base unit of the local coordinate system, as defined by the
+     *          parent layout, or the display if there is no parent.
+     */
+    IMPORT_C THuiXYMetric LocalBaseUnit() const;
+
+    /**
+     * ! deprecated, use method with THuiReferenceState instead
+     */
+    IMPORT_C THuiRealPoint LocalPointInPixels(const THuiRealPoint& aLocalPoint) const __SOFTFP;
+
+    /**
+     * Converts a point in the local coordinate system to pixels in the 
+     * local coordinate system. The local coordinate system is relative to 
+     * the top left corner of the parent. This method only
+     * does a unit conversion from the base units to pixels.
+     *
+     * @param aLocalPoint  Point to convert, which is using the local
+     *                     base unit.
+     * @param aReferenceState Defines whether now or target value is used in case 
+     *                        there are metrics transformations taking place
+     *
+     * @return  @c aLocalPoint converted to pixels in the local coordinate system.
+     */
+    IMPORT_C THuiRealPoint LocalPointInPixels(const THuiRealPoint& aLocalPoint, 
+                                              THuiReferenceState aReferenceState) const __SOFTFP;
+    
+
+    /**
+     * ! deprecated, use method with THuiReferenceState instead
+     */
+    IMPORT_C THuiRealPoint PixelPointInLocal(const THuiRealPoint& aPixelPoint) const __SOFTFP;
+
+    /**
+     * Converts a pixel point in the local coordinate system to a point that
+     * uses the base unit of the local coordinate system. 
+     * The local coordinate system is relative to the top left corner 
+     * of the parent. This method only does a unit conversion from pixels to
+     * the base units.
+     *
+     * @param aPixelPoint  Point to convert, which is in pixels.
+     * @param aReferenceState Defines whether now or target value is used in case 
+     *                        there are metrics transformations taking place
+     *
+     * @return @c aPixelPoint converts to the local base unit.
+     */
+    IMPORT_C THuiRealPoint PixelPointInLocal(const THuiRealPoint& aPixelPoint,
+                                             THuiReferenceState aReferenceState) const __SOFTFP;
+
+
+    /**
+     * Converts a pixel point to a specific unit.
+     *
+     * @param aPixelPoint  Point to convert, in pixels.
+     * @param aUnit        Unit to which the point is to be converted.
+     * @param aReferenceState Defines whether now or target value is used in case 
+     *                        there are metrics transformations taking place
+     *
+     * @return  The point as a multiple of @c aUnit.
+     */
+    THuiRealPoint PixelPointInUnits(const THuiRealPoint& aPixelPoint, 
+        const THuiXYMetric& aUnit, THuiReferenceState aReferenceState) const __SOFTFP;
+
+
+    /**
+     * ! deprecated, use method with THuiReferenceState instead
+     */
+    IMPORT_C THuiRealPoint MetricToPixels(const THuiXYMetric& aMetric) const __SOFTFP;
+
+    /**
+     * Converts an XY metric to a pixel point.
+     *
+     * @param aMetric  Metric to convert.
+     * @param aReferenceState Defines whether now or target value is used in case 
+     *                        there are metrics transformations taking place
+     *
+     * @return  The metric in pixels.
+     */
+    IMPORT_C THuiRealPoint MetricToPixels(const THuiXYMetric& aMetric,
+                                          THuiReferenceState aReferenceState) const __SOFTFP;
+
+    /**
+     * ! deprecated, use method with THuiReferenceState instead
+     */
+    IMPORT_C void PixelsToMetric(const THuiRealPoint& aPixels, THuiXYMetric& aMetric) const;
+
+    /**
+     * Converts a pixel point to an XY metric. The destination unit of the 
+     * conversion is taken from the @c aMetric parameter.
+     *
+     * @param aPixels  Pixel point to convert.
+     * @param aMetric  The result is written here. Only the magnitudes of the
+     *                 metric are modified. The @c iUnit of the conversion 
+     *                 is read from this metric.
+     */
+    IMPORT_C void PixelsToMetric(const THuiRealPoint& aPixels, THuiXYMetric& aMetric,
+                                 THuiReferenceState aReferenceState) const;
+    
+ 
+     /**
+     * ! deprecated, use method with THuiReferenceState instead
+     */
+    IMPORT_C THuiRealPoint MetricReferenceInPixels(const THuiXYMetric& aMetric) const __SOFTFP;               
+   
+    
+    /**
+     * Calculates the reference size for a metric. The reference size is, for
+     * example, the size of the parent layout in the case of the 
+     * EHuiUnitNormalized unit.
+     * 
+     * @param aMetric  Metric whose reference size is to be determined.
+     * @param aReferenceState Defines whether now or target value is used in case 
+     *                        there are metrics transformations taking place
+     * 
+     * @return  Reference size.
+     */
+    IMPORT_C THuiRealPoint MetricReferenceInPixels(const THuiXYMetric& aMetric,               
+                                 THuiReferenceState aReferenceState) const __SOFTFP;
+
+    /**
+     * Converts local coordinates to display coordinates. This method is used
+     * for calculating the position of the visual on the display when the visual
+     * is about to be drawn. Display coordinates are defined relative to the 
+     * display's visible area.
+     *
+     * @param aPoint  Point in the local coordinate system. This might be,
+     *                for example, the position or size of this visual.
+     *
+     * @return  The point in the display's coordinate system, in pixels.
+     */
+    IMPORT_C TPoint LocalToDisplay(const TPoint& aPoint) const;
+
+    /**
+     * Converts local coordinates to display coordinates. This method is used
+     * for calculating the position of the visual on the display when the visual
+     * is about to be drawn. Display coordinates are defined relative to the 
+     * display's visible area.
+     *
+     * @param aPoint  Point in the local coordinate system. This might be,
+     *                for example, the position or size of this visual.
+     *
+     * @return  The point in the display's coordinate system, in pixels.
+     */
+    IMPORT_C THuiRealPoint LocalToDisplay(const THuiRealPoint& aPoint) const __SOFTFP;
+
+    /**
+     * Converts display coordinates to local coordinates. This method can be
+     * used when determining where a particular point on the display is 
+     * in the local coordinate system of a layout, for instance when handling
+     * pointer input events. Display coordinates are defined relative to 
+     * the display's visible area.
+     *
+     * @param aPoint  Point in the display coordinate system. 
+     *
+     * @return  The point in this visual's local coordinate system, in the
+     *          base units of the parent layout (or display, if there is
+     *          no parent layout).
+     */
+    IMPORT_C TPoint DisplayToLocal(const TPoint& aPoint) const;
+
+    /**
+     * Converts display coordinates to local coordinates. This method can be
+     * used when determining where a particular point on the display is 
+     * in the local coordinate system of a layout, for instance when handling
+     * pointer input events. Display coordinates are defined relative to 
+     * the display's visible area.
+     *
+     * @param aPoint  Point in the display coordinate system. 
+     *
+     * @return  The point in this visual's local coordinate system, in the
+     *          base units of the parent layout (or display, if there is
+     *          no parent layout).
+     */
+    IMPORT_C THuiRealPoint DisplayToLocal(const THuiRealPoint& aPoint) const __SOFTFP;
+
+
+    IMPORT_C void BoxMetricToPixelRect(const THuiBoxMetric& aBox, 
+        THuiRealRect& aRectInPixels) const;
+
+    /**
+     * Converts a box metric to a pixel rectangle. This method is used for
+     * converting visual padding boxes to pixels.
+     *
+     * @param aBox  Box metric to be interpreted in the context of this visual.
+     * @param aRectInPixels  Resulting rectangle in pixels. Note that the width
+     *                       and height of this box are meaningless, because 
+     *                       each of the four sides is defined independently of
+     *                       each other.
+     * @param aReferenceState Defines whether now or target value is used in case 
+     *                        there are metrics transformations taking place
+     */
+    IMPORT_C void BoxMetricToPixelRect(const THuiBoxMetric& aBox, 
+        THuiRealRect& aRectInPixels, THuiReferenceState aReferenceState) const;
+
+    /**
+     * Converts a box metric to a rectangle in local coordinates. This method
+     * is used for converting visual padding boxes to local coordinate units
+     * when doing layout.
+     *
+     * @param aBox  Box metric to be interpreted in the context of this visual.
+     * @param aLocalRect  Top, left, right, and bottom values of the box in 
+     *                    the visual's local coordinate system.
+     *                    Note that the width and height of this box are meaningless, 
+     *                    because each of the four sides is defined independently of
+     *                    each other.
+     */
+    /*IMPORT_C void BoxMetricToLocalRect(const THuiBoxMetric& aBox,
+        THuiRealRect& aLocalRect) const;*/
+
+    /**
+     * Moves the visual to the front inside its parent layout. 
+     * In other words, the visual becames the last child of the parent.
+     * Causes layout recalculation.
+     */
+    IMPORT_C void MoveToFront(TInt aTransitionTime = 0);
+
+    /**
+     * Returns the position of the visual.
+     */
+    inline THuiTimedPoint& Pos();
+
+    /**
+     * Returns the opacity of the visual, taking into account the opacity
+     * of parent visuals.
+     *
+     * @return  Effective opacity level of the visual.
+     */
+    IMPORT_C TReal32 EffectiveOpacity() const __SOFTFP;
+
+    /**
+     * Sets the clipping mode of the layout.
+     *
+     * @param aClipping  <code>ETrue</code> to hide children that are outside
+     *                   the layout's real size.
+     */
+    IMPORT_C void SetClipping(TBool aClipping = ETrue);
+
+    /**
+     * Determines whether the visual is clipping its contents.
+     */
+    IMPORT_C TBool Clipping() const;
+
+    /**
+     * Enables or disables transformation of the visual.
+     */
+    IMPORT_C void EnableTransformationL(TBool aIsTransformed = ETrue);
+
+    /**
+     * Returns the transformation of the visual.
+     *
+     * @panic  THuiPanic::EVisualTransformNotEnabled
+     */
+    IMPORT_C CHuiTransformation& Transformation();
+
+    /**
+     * Sets the number of pixels that the visual uses for padding its contents.
+     * Sets both the horizontal and vertical padding.
+     *
+     * @param aPadding  Number of padding pixels.
+     */
+    IMPORT_C void SetPadding(TInt aPadding);
+
+    /**
+     * Sets the number of pixels that the visual uses for padding its contents.
+     * Sets the horizontal and vertical padding separately.
+     *
+     * @param aPadding  Number of padding pixels.
+     */
+    IMPORT_C void SetPadding(const TPoint& aPadding);
+
+    /**
+     * Sets the amount of padding that the visual uses for padding its contents.
+     * The box metric can have a different amount on all sides.
+     *
+     * @note as paddings are relative to the visual, if relative units are required for a layout, 
+     * it is advisable to use EHuiUnitRelativeToMySize so that the paddings are relative
+     * to the size of this layout visual
+     *
+     * @param aPadding  Amount of padding.
+     */
+    IMPORT_C void SetPadding(const THuiBoxMetric& aPadding);
+
+    /**
+     * Returns the padding of the visual.
+     *
+     * @return  Padding as a box metric.
+     */
+    IMPORT_C const THuiBoxMetric& Padding() const;
+
+     /**
+     * ! deprecated, use method with THuiReferenceState instead
+     */
+    IMPORT_C THuiRealRect PaddingInPixels() const __SOFTFP;
+
+    /**
+     * Returns the padding of the visual, in pixels.
+     *
+     * @param aReferenceState Defines whether now or target value is used in case 
+     *                        there are metrics transformations taking place
+     * @return  Padding, in pixels. iTl.iX is the left padding, iTl.iY is 
+     *          the top padding, iBr.iX is the right padding, and iBr.iY
+     *          is the bottom padding. The width and height of the returned 
+     *          rectangle are meaningless.
+     */
+    IMPORT_C THuiRealRect PaddingInPixels(THuiReferenceState aReferenceState) const __SOFTFP;
+
+	/**
+	 * PrepareDrawL prepares the visual for drawing (screen refresh).
+	 * Can be used to update the visual or execute any Leaving 
+	 * operations such as resource allocation needed for the 
+	 * actual drawing.
+	 * 
+	 * @return ETrue if the prepare succeeded, or EFail if 
+	 * the prepare failed. Failing to prepare a draw 
+	 * terminates the screen refresh and drawing 
+	 * for the frame that is currently been drawn.
+	 * 
+	 * By default the base class PrepareDrawL does not do anything.
+	 */
+	IMPORT_C virtual TBool PrepareDrawL();
+
+    /**
+     * Draws the visual. 
+     * 
+     * This default implementation applies local transformation,
+     * draws foreground brushes (over the content), 
+     * background brushes (under the content) and 
+     * content itself (by calling DrawSelf()) with clipping.
+     * 
+     * @note DrawSelf() should bee overridden by subclasses to 
+     * draw the content of the visual.
+     * 
+     * @see DrawSelf()
+     * @see PrepareDrawL()
+     */
+    IMPORT_C virtual void Draw(CHuiGc& aGc) const;
+
+    /**
+     * Draws a layer of brushes for the visual.
+     *
+     * @param aGc     Graphics context.
+     * @param aLayer  Brush layer.
+     */
+    IMPORT_C void DrawBrushes(CHuiGc& aGc, THuiBrushLayer aLayer) const;
+
+    /**
+     * Overridden by subclasses to draw the content of the visual.
+     * By default the base class DrawSelf does not draw anything.
+     * 
+     * @param aGc 			The graphics context to be used to draw the visual.
+     * @param aDisplayRect  The bounding rectangle of the visual content,
+     * 						in display coordinates. Same as calling 
+     *                      CHuiVisual::DisplayRect().
+     * 
+     * @note DrawSelf won't be called for fully transparent visuals.
+     * @see Draw()
+     * @see PrepareDrawL()
+     */
+    IMPORT_C virtual void DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect) const;
+
+    /**
+     * Raises the change flag for this visual. Visual will be updated as soon
+     * as possible.
+     */
+    IMPORT_C virtual void SetChanged();
+
+    /**
+     * Determines if the visual has changed since the last change
+     * notification. Changed means becoming dirty, so that the area
+     * of the visual has to be redrawn.
+     */
+    IMPORT_C virtual TBool Changed() const;
+
+    /**
+     * Called to inform the display that a dirty region has to be defined.
+     */
+    IMPORT_C virtual void ReportChanged();
+
+    /**
+     * Clears the changed status of the visual. This is called automatically
+     * by the refresh loop after a frame has been drawn.
+     */
+    IMPORT_C virtual void ClearChanged();
+
+    /**
+     * Enables or disables brushes for the visual.
+     */
+    IMPORT_C void EnableBrushesL(TBool aEnabled = ETrue);
+
+    /**
+     * Returns the brushes of the visual.
+     *
+     * @return  Brush array. <code>NULL</code>, if not enabled.
+     */
+    IMPORT_C CHuiBrushArray* Brushes();
+
+    /**
+     * Debug method for dumping the structure of a visual tree into the
+     * console.
+     */
+    IMPORT_C virtual void DumpTree() const;
+
+    IMPORT_C virtual void GetInstanceName(TDes& aName) const;
+
+    /**
+     * Returns the name of the class.
+     *
+     * @param aName  Name of the visual class.
+     */
+    IMPORT_C virtual void GetClassName(TDes& aName) const;
+
+    /**
+     * Applies or restores the local projection of the visual.
+     */
+    IMPORT_C void EnterLocalProjection(CHuiGc& aGc, TBool aApply,
+                                       TReal32 aExtraOffset = 0.0,
+                                       const THuiRealRect* aVisibleRect = 0) const __SOFTFP;
+
+    /**
+     * Notifies the visual that the environment's skin has been changed
+     * or updated. The visual should update its state (e.g., fonts)
+     * accordingly.
+     */
+    IMPORT_C virtual void NotifySkinChangedL();
+    
+    
+    /**
+     * Sets an automatic tactile feedback. If this visual is a layout,
+     * the feedback affects to the child visuals as well. This can 
+     * be overridden in child visuals.
+     * 
+     * @param aEventType Event which triggers the automatic feedback.
+     * @param aFeedbackType Feedback type.
+     *
+     * @see TTouchEventType from touchlogicalfeedback.h
+     * @see TTouchLogicalFeedback from touchlogicalfeedback.h
+     */
+    IMPORT_C void SetTactileFeedbackL( TInt aEventType, TInt aFeedbackType );
+        
+    /**
+     * Checks whether a tactile feedback has been assigned.
+     * Eventhough, this returns EFalse the layout may have feedback defined.
+     * @param aEventType Event type which needs to match
+     *        If KHuiTactileFeedbackEventTypeNone, the event type is irrelevant.
+     * 
+     * @return ETrue if the visual has a tactile feedback defined.
+     */
+    IMPORT_C TBool HasTactileFeedback( 
+        TInt aEventType = KHuiTactileFeedbackEventTypeNone ) const;
+       
+    /**
+     * Removes tactile feedback for the visual.
+     * 
+     * @param aEventType Event type which feedback to remove.
+     *        If KHuiTactileFeedbackEventTypeNone, all the feedbacks are removed.
+     */
+    IMPORT_C void RemoveTactileFeedback( TInt aEventType = KHuiTactileFeedbackEventTypeNone );
+    
+    /**
+     * Enables the drop shadow. Currently implemented for the image and text visuals.
+     * 
+     * @param aEnable ETrue to enable, EFalse to disable.
+     */
+    IMPORT_C void EnableDropShadowL( TBool aEnable = ETrue );
+    
+    /**
+     * Returns the drop shadow parameter handler.
+     *
+     * @return Drop shadow handler. NULL if drop shadow is disabled.
+     */
+    IMPORT_C CHuiDropShadow* DropShadowHandler() const;
+
+public: // From MHuiBrushGuide. 
+
+    IMPORT_C TReal32 BrushOpacity() const __SOFTFP;
+
+    IMPORT_C THuiRealRect BrushRect() const __SOFTFP;
+
+    IMPORT_C CHuiSkin& BrushSkin() const;
+
+public: // From MHuiSessionObject
+    
+    /**
+     * Gets the object type.
+     */
+    IMPORT_C TType Type() const;
+
+    /**
+     * Gets the session id for object.
+     */
+    IMPORT_C TInt SessionId() const;
+
+    /**
+     * Sets the session id for object.
+     */
+    IMPORT_C void SetSessionId(TInt aSessionId);
+
+    /** @endAPI */
+
+public: // Internal utilities
+
+    /**
+     * Reports a layout update to the owner. The owner is notified of
+     * the layout update if the layout update notification flag is set
+     * for the visual.
+     *
+     * @see EHuiVisualFlagLayoutUpdateNotification
+     */
+    void ReportLayoutUpdate();
+
+
+    /* Static member functions. */
+
+    /**
+     * Calculate dual alpha levels. Used when crossfading images.
+     */
+    IMPORT_C static void GetDualAlpha(TReal32 aOpacity, TReal32 aSecondary,
+                             TInt& aPrimaryAlpha, TInt& aSecondaryAlpha);
+                             
+   /**
+    * Return tactile feedback of the event. Checks the parent layouts
+    * if this visual has not defined a feedback.
+    * @param aEventType Event type 
+    * @return Feedback type. KErrNotFound if not found.
+    */
+   TInt TactileFeedback( TInt aEventType ) const;
+   
+      
+   /**
+    * Finds a tacticon from this visual.
+    * @param aEventType Event type to match
+    * @return Index of the found event. KErrNotFound if not found-
+    */
+   TInt FindTacticon( TInt aEventType ) const;
+
+    /**
+     * Gets the visual's bounding rectangle in display coordinates that were
+     * calculated during previous frame.
+     * Display coordinates are defined relative to the display's visible area.
+     * Uses the current values of the position and size. Only calculated once 
+     * per frame. The rect is always in pixels.
+     */
+   THuiRealRect CachedDisplayRect() const;
+
+    /**
+     * Returns the brushes of the visual.
+     *
+     * @return  Brush array. <code>NULL</code>, if not enabled.
+     */
+    CHuiBrushArray* Brushes() const; 
+
+    /**
+     *  Returns the currently active effect for the visual
+     *  or NULL if no effect is active.
+     *
+     *  @return CEffect instance or NULL.
+     */
+    IMPORT_C CHuiFxEffect* Effect() const;
+
+    IMPORT_C MHuiEffectable *Effectable() const;
+
+    IMPORT_C CHuiCanvasRenderBuffer *StoredRenderBuffer() const;
+    IMPORT_C void SetStoredRenderBuffer(CHuiCanvasRenderBuffer *aRenderBuffer);
+    IMPORT_C void SetStoredRenderBufferModificationsEnabled(TBool aEnabled);
+    IMPORT_C void SetFreezeState(TBool aEnabled);
+    IMPORT_C TBool Freezed() const;
+
+    /**
+     *  Assign an effect for the visual. The ownership of the
+     *  effect is transferred to the visual.
+     *
+     *  @param aEffect Effect instance.
+     */
+    IMPORT_C void SetEffect(CHuiFxEffect* aEffect);
+
+    /**
+     * Assign the effect parser to the visual. The ownership is transferred to the visual
+     * This must be done because the parsing is asynchronous, and we must be sure that the 
+     * visual is still alive when the parsing completes.
+     * 
+     * @param aEffectParser Effect parser instance
+     * 
+     */
+    void SetEffectParser( CHuiFxEffectParser* aEffectParser );
+    
+#ifdef HUI_DEBUG_TRACK_DRAWING
+    inline void SetTracking( TBool aValue )
+        {
+        iTrackVisual = aValue;
+        }
+       
+    inline TBool Tracking( ) const
+        {
+        return iTrackVisual;
+        }
+#endif      
+
+    inline TBool LoadingEffect() const
+        {
+        return iLoadingEffect;
+        };
+    inline void SetLoadingEffect( TBool aLoading )
+        {
+        iLoadingEffect = aLoading;
+        };
+    
+protected:
+
+    /* Transformation. */
+
+    /** @beginAPI */
+
+    /**
+     * Applies or restores the local transformation matrix of the visual.
+     * Should be called before and after drawing the visual.
+     *
+     * @param aGc     Graphics context.
+     * @param aApply  <code>ETrue</code>, if the local transformation should
+     *                be applied; <code>EFalse</code>, if it should be
+     *                removed.
+     */
+    IMPORT_C void Transform(CHuiGc& aGc, TBool aApply,
+                            const THuiRealRect* aVisibleRect = 0) const;
+
+    /** @endAPI */
+
+
+protected:
+
+    /* Protected methods. */
+
+    /**
+     * Expands the dirty region of the visual depending on the content of
+     * the visual. This includes any brushes attached to the visual. Used
+     * during dirty region reporting.
+     *
+     * @param aRect  Dirty region.
+     */
+    IMPORT_C virtual void ExpandRectWithContent(TRect& aRect) const;
+
+    /**
+     * Applies mirroring to a coordinate point according to the base unit
+     * of the local coordinate system. 
+     *
+     * @param aPixels  Point to mirror in pixels. The mirrored result is
+     *                 returned here.
+     * @param aReferenceState Defines whether now or target value is used in case 
+     *                        there are metrics transformations taking place
+     */
+    void ApplyMirroring(THuiRealPoint& aPixels, THuiReferenceState aReferenceState) const;
+
+    IMPORT_C virtual void VisualExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+   
+   /*
+    * Convert a metric, measured in its own units, using a metric reference value suitable for 
+    * that unit, into pixels.
+    *
+    * @note aReference will usually be supplied by calling MetricReferenceInPixels, or in the case of
+    * a layout that needs to convert from pixels into the metric for its child visuals, will be supplied by 
+    * calling CHuiLayout::MetricReferenceForLayoutInPixels
+    *
+    * @param aResult output the result of the calculation in pixels
+    * @param aMetric the metric to convert
+    * @param aReference the reference value, which must correspond to the unit type in the 
+    *       provided metric, and which must always be supplied in pixels
+    *
+    */
+   static void ConvertMetricLengthToPixels(TReal32& aResult, const THuiMetric& aMetric, TReal32 aReference);
+   
+   /*
+    * Convert a value measured in pixels, into a metric value (whose unit type is supplied), using a 
+    * metric reference value suitable for that unit type.
+    *
+    * @note aReference will usually be supplied by calling MetricReferenceInPixels, or in the case of
+    * a layout that needs to convert from pixels into the metric for its child visuals, will be supplied by 
+    * calling CHuiLayout::MetricReferenceForLayoutInPixels
+    *
+    * @param aResult when input, the metric unit type is used as the required unit type, and is not modified.
+    *       The metric magnitude is replaced with the result of the calculation in that unit type
+    * @param aPixles the pixel quantity to convert
+    * @param aReference the reference value, which must correspond to the unit type in the 
+    *       provided metric, and which must always be supplied in pixels
+    */
+   static void ConvertPixelsToMetricLength(THuiMetric& aResult, TReal32 aPixels, TReal32 aReference);
+
+   TBool IsDelayedEffectSource() const;
+
+private:
+
+    /**
+     * Converts local coordinates to display coordinates. This method is used
+     * for calculating the position of the visual on the display when the visual
+     * is about to be drawn. Display coordinates are defined relative to the 
+     * display's visible area.
+     *
+     * @param aPoint  Point in the local coordinate system. This might be,
+     *                for example, the position or size of this visual.
+     * @param aReferenceState Defines whether now or target value is used in case 
+     *                        there are metrics transformations taking place
+     *
+     * @return  The point in the display's coordinate system, in pixels.
+     */
+    THuiRealPoint LocalToDisplay(const THuiRealPoint& aPoint,
+        THuiReferenceState aReferenceState) const;
+
+
+    /**
+     * Converts display coordinates to local coordinates. This method can be
+     * used when determining where a particular point on the display is 
+     * in the local coordinate system of a layout, for instance when handling
+     * pointer input events. Display coordinates are defined relative to 
+     * the display's visible area.
+     *
+     * @param aPoint  Point in the display coordinate system. 
+     * @param aReferenceState Defines whether now or target value is used in case 
+     *                        there are metrics transformations taking place
+     *
+     * @return  The point in this visual's local coordinate system, in the
+     *          base units of the parent layout (or display, if there is
+     *          no parent layout).
+     */
+    THuiRealPoint DisplayToLocal(const THuiRealPoint& aPoint,
+            THuiReferenceState aReferenceState) const;
+
+
+    /**
+     * Determines if the visuals parent has changed since the last change
+     * notification so that it may require also this visual to report itself
+     * as changed.
+     */
+    TBool ParentChanged() const;
+
+    /**
+     * Checks if this visual is transformed.
+     */
+    TBool IsTransformed() const;
+    
+    /**
+     * Retruns pointer to transformation if this visual is transformed. Otherwise NULL is returned.
+     */
+    CHuiTransformation* Transformation() const;
+
+    /**
+     * Handle flags changes.
+     * @param aOldFlags flags previous to the changes.
+     */
+    void HandleFlagsChanged( TInt aOldFlags );
+
+protected:
+
+    /** Display area that was in effect during the previous draw operation.
+        This will be included in the dirty rectangle. */
+    mutable TRect iPreviousDrawn; 
+
+public:
+
+    /* Public properties. */
+    /** ! Position / order / size of public variables must not change */
+
+    /** Depth offset. */
+    THuiTimedValue iDepthOffset;
+
+    /**
+     * Opacity of this visual.
+     * The interpolation style of opacity values by default is linear.
+     * A value of 0 is fully transparent, a value of 1 is fully opaque.
+     */
+    THuiTimedValue iOpacity;
+
+private:
+
+    /** ! Following three members are accessed by inline methods:
+     * - Their location (at the beginning of member data) must not change
+     * - Their order and size must not change
+     */ 
+    
+    /** Flags. */
+    TInt iFlags;
+
+    /** Position of the visual. */
+    THuiTimedPoint iPos;
+
+    /** Size of the visual. */
+    THuiTimedPoint iSize;
+
+    /** ! ------------------------------- */
+
+protected: // RnD utils
+    /** Session id */
+    TInt iSessionId;
+    
+
+    /** Owner of the visual. */
+    MHuiVisualOwner* iOwner;
+
+#ifdef HUI_DEBUG_TRACK_DRAWING
+    /** Used for tracking the visual in different stages of rendering */
+	TBool iTrackVisual;
+#endif
+    
+private:
+
+    /** The display on which the visual is being shown. */
+    CHuiDisplay* iDisplay;
+
+    /** Layout this visual belongs to (may be <code>NULL</code>). */
+    CHuiLayout* iLayout;
+
+    /**
+     * Minimum allowed size for the visual. Layouts will respect this value
+     * when layout is being updated.
+     *
+     * @todo  Needs to be implemented.
+     */
+    THuiRealSize iMinSize;
+
+    /**
+     * Maximum allowed size for the visual. Layouts will respect this value
+     * when layout is being updated.
+     *
+     * @todo  Needs to be implemented.
+     */
+    THuiRealSize iMaxSize;
+
+    /**
+     * Padding between visual edges and content. The box metric can have a 
+     * different amount of padding on each of the four sides.
+     */
+    //TPoint iPadding;
+    THuiBoxMetric iPadding;
+
+    /** If not <code>NULL</code>, this transformation is used when the
+        content visual is drawn. */
+    CHuiTransformation* iTransform;
+
+    /** Background brushes. */
+    CHuiBrushArray* iBrushes;
+
+    /** If effect is still being loaded (parsing), visual may need to be hided */
+    TBool iLoadingEffect;
+
+    /** Tag. */
+    HBufC8* iTag;
+
+	/** 
+	 * Cached display rectangle for the current frame. Defines 
+	 * Calculates the visual's bounding rectangle in display coordinates. 
+	 * The rect is always in pixels.
+	 * @see DisplayRect()
+	 */
+	mutable THuiRealRect iDisplayRect;
+
+	/**
+	 * Describes during which frame the display rectance cache (iDisplayRect)
+	 * is valid.
+	 */
+	mutable TUint iDisplayRectFrameNumber;
+
+	/**	
+     * Cached visual's bounding rectangle animation target in display 
+     * coordinates. Uses the target values of the position and size, 
+     * which means transitions are always immediate in the returned 
+     * rectangle.
+     */
+	mutable THuiRealRect iDisplayRectTarget;
+
+	/**
+	 * Describes during which frame the display rectance target cache 
+	 * (iDisplayRectTarget) is valid.
+	 */
+	mutable TUint iDisplayRectTargetFrameNumber;
+    
+    // Rest of the private data
+    struct THuiVisualPrivateData;
+    THuiVisualPrivateData* iVisualData;
+    };
+
+
+/* Inline methods. */
+
+TInt CHuiVisual::Flags() const
+    {
+    return iFlags;
+    }
+
+inline THuiTimedPoint& CHuiVisual::Pos()
+    {
+    return iPos;
+    }
+
+inline THuiTimedPoint& CHuiVisual::Size()
+    {
+    return iSize;
+    }
+
+#endif  // __HUIVISUAL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/HuiVisuals.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Convenience header for including all of the HUITK visuals
+*
+*/
+
+
+
+#include <uiacceltk/HuiVisual.h>
+#include <uiacceltk/HuiLineVisual.h>
+#include <uiacceltk/HuiImageVisual.h>
+#include <uiacceltk/HuiTextVisual.h>
+#include <uiacceltk/HuiMeshVisual.h>
+#include <uiacceltk/HuiCanvasVisual.h>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/hitchcock.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Master header file for applications. Includes the entire 
+*                public API of the Hitchcock User Interface Toolkit.
+*
+*/
+
+
+
+/**
+ * @mainpage Hitchcock User Interface Toolkit
+ *
+ * @section sec1 Introduction
+ *
+ * The Hitchcock User Interface Toolkit (HUITK) is a library of classes that
+ * can be used for creating graphical user interfaces that are primarily 
+ * two-dimensional, but can utilize three-dimensional objects and effects, for 
+ * instance rotations. HUITK has been designed to be used with hardware-accelerated 
+ * graphics, but limited functionality software-only rendering is also supported.
+ * HUITK has been developed on Symbian OS 9.1.
+ *
+ * You are reading the HUITK API documentation. This is a reference manual 
+ * of the HUITK API classes. For higher-level developer documentation, see
+ * @ref sec_info.
+ *
+ * @section sec2 Typical Usage
+ *
+ * Initialization:
+ *  - Create environment. Specify the renderer to use, e.g., EHuiRendererGles11.
+ *  - Create a display. The most convenient way is to use CHuiDisplayCoeControl.
+ *  - Create one or more control groups.
+ *  - Create controls and append them to the groups.
+ *  - Display one (or more) of the groups.
+ *
+ * Normal runtime behaviour:
+ *  - Action and animation commands can be posted using the environment.
+ *  - Controls handle input events in CHuiControl::OfferEventL().
+ *  - Controls can manipulate visuals.
+ *  - Groups can be shown, hidden, and transformed.
+ *  - Display refresh is paused while nothing is happening. See 
+ *    CHuiEnv::ContinueRefresh().
+ *
+ * Cleanup:
+ *  - Delete CoeControls owned by the application (including 
+ *    CHuiDisplayCoeControl instances).
+ *  - Shut down by deleting the environment.
+ *
+ * @section sec_groups Classes
+ *
+ * The following classes form the public API of the toolkit. The API 
+ * documentation also includes information about internal classes. Note that
+ * exported methods are listed under an &quot;Exported API&quot; subsection
+ * in each class's description.
+ *
+ * Core Functionality:
+ * - CHuiEnv
+ * - CHuiDisplay
+ * - CHuiDisplayCoeControl
+ * - CHuiControl
+ * - CHuiControlGroup
+ * - CHuiRoster
+ * - CHuiStatic
+ * - THuiTimedValue
+ * - THuiTimedPoint
+ * - THuiCommand (and derived classes such as THuiValueCommand)
+ * - THuiEvent
+ *
+ * Utilities:
+ * - HuiUtil (only static methods)
+ * - MHuiMappingFunction implementations such as THuiLinearMappingFunction
+ * - THuiRealPoint
+ * - THuiRealRect
+ * - THuiRealSize
+ *
+ * Graphics (note HuiDrawing.h):
+ * - CHuiGc (available in CHuiVisual::Draw() methods)
+ * - CHuiTransformation
+ * - CHuiCurvePath
+ * - CHuiMesh
+ * - THuiMaterial
+ * - CHuiS60Skin
+ * - CHuiTextureManager
+ * - CHuiTextureProcessor
+ * - CHuiTexture
+ * - CHuiAnimatedTexture
+ * - THuiTextureHandle
+ * - THuiImage (reference to a region of a texture)
+ *
+ * Visuals and Layouts (note HuiVisuals.h and HuiLayouts.h):
+ * - CHuiVisual
+ *     - CHuiImageVisual
+ *     - CHuiLineVisual
+ *     - CHuiMeshVisual
+ *     - CHuiTextVisual
+ * - CHuiLayout
+ *     - CHuiAnchorLayout
+ *     - CHuiFlowLayout
+ *     - CHuiGridLayout
+ *
+ * Brushes (note HuiBrushes.h):
+ * - CHuiBrushArray (see CHuiVisual::EnableBrushesL())
+ * - CHuiBrush
+ *     - CHuiBorderBrush
+ *     - CHuiDropShadowBrush
+ *     - CHuiGradientBrush
+ *     - CHuiShadowBorderBrush
+ * 
+ * Common controls:
+ * - CHuiSoftKeyControl 
+ *
+ * @section sec_info More Information
+ *
+ * More information is available in the Nokia internal Wiki pages:
+ * http://nwiki.nokia.com/NSSProjects/HUIToolkit
+ *
+ *
+ * Copyright &copy; 2006 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.
+ */
+
+#include <uiacceltk/HuiCommand.h>
+#include <uiacceltk/HuiControl.h>
+#include <uiacceltk/HuiControlGroup.h>
+#include <uiacceltk/HuiRoster.h>
+#include <uiacceltk/HuiDisplay.h>
+#include <uiacceltk/HuiDisplayCoeControl.h>
+#include <uiacceltk/HuiEnv.h>
+#include <uiacceltk/HuiEvent.h>
+#include <uiacceltk/HuiPanic.h>
+#include <uiacceltk/HuiPlatform.h>
+#include <uiacceltk/HuiScheduler.h>
+#include <uiacceltk/HuiStatic.h>
+#include <uiacceltk/HuiTimedPoint.h>
+#include <uiacceltk/HuiTimedValue.h>
+#include <uiacceltk/huieventhandler.h>
+
+/* 
+ * Utilities 
+ */
+#include <uiacceltk/HuiMappingFunctions.h>
+#include <uiacceltk/HuiObserverArray.h>
+#include <uiacceltk/HuiTimeObserver.h>
+#include <uiacceltk/HuiOwnedPointer.h>
+#include <uiacceltk/HuiInteractionInterval.h>
+#include <uiacceltk/HuiRealPoint.h>
+#include <uiacceltk/HuiRealRect.h>
+#include <uiacceltk/HuiRealSize.h>
+#include <uiacceltk/HuiUtil.h>
+#include <uiacceltk/HuiImageLoaderUtil.h>
+
+/* 
+ * Graphics 
+ */
+#include <uiacceltk/HuiTransformation.h>
+#include <uiacceltk/HuiTextureManager.h>
+#include <uiacceltk/HuiTextureProcessor.h>
+#include <uiacceltk/HuiTextureIf.h>
+#include <uiacceltk/HuiSegmentedTexture.h>
+#include <uiacceltk/HuiShadowedTexture.h>
+#include <uiacceltk/HuiTexture.h>
+#include <uiacceltk/HuiTextureHandle.h>
+#include <uiacceltk/HuiCurvePath.h>
+#include <uiacceltk/HuiGc.h>
+#include <uiacceltk/HuiImage.h>
+#include <uiacceltk/HuiMesh.h>
+#include <uiacceltk/HuiMaterial.h>
+#include <uiacceltk/HuiTextMesh.h>
+#include <uiacceltk/HuiSkin.h>
+#include <uiacceltk/HuiS60Skin.h>
+#include <uiacceltk/HuiAnimatedTexture.h>
+
+/* 
+ * Visuals and Layouts 
+ */
+#include <uiacceltk/HuiDrawing.h>
+#include <uiacceltk/HuiVisuals.h>
+#include <uiacceltk/HuiLayouts.h>
+
+/* 
+ * Brushes 
+ */
+#include <uiacceltk/HuiBrushes.h>
+#include <uiacceltk/HuiBrushArray.h>
+
+/*
+ * Common Controls 
+ * @ deprecated
+ *
+ */
+#include <uiacceltk/HuiSoftKeyControl.h>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huidisplaybackgrounditem.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,236 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines item in display background.
+*
+*/
+
+
+
+#ifndef __HUIDISPLAYBACKGROUNDITEM_H__
+#define __HUIDISPLAYBACKGROUNDITEM_H__
+
+#include <e32base.h>
+#include <AknsUtils.h>
+
+/**
+ * This class specifies an item that is drawn in the display background.
+ * Item can specify background as either:
+ *
+ *  "None"  - Nothing is drawn to given display area. Can be used to minimize
+ *            updates to display background areas that e.g. are not visible 
+ *            and thus maximize framerate.
+ *
+ *  "Color" - Given display area is filled with given color. Can be defined as 
+ *            skinnable color or normal RGB color..
+ *            
+ *  "Skin background" - Given display area is filled with given skin background
+ *            graphics.
+ * 
+ */
+NONSHARABLE_CLASS( THuiDisplayBackgroundItem )
+    {
+public:   
+   /** 
+    * Constructor. Default constructor. 
+    */
+    IMPORT_C THuiDisplayBackgroundItem();
+
+   /**
+    * Constructor. Creates backgroun item which area is not cleared. 
+    * @param aRect Item area in display coordinates (pixels).
+    */
+    IMPORT_C THuiDisplayBackgroundItem( const TRect& aRect );
+    
+   /**
+    * Constructor. Creates backgroun item which area is cleared
+    * using the given skin background graphics.
+    * @param aRect Item area in display coordinates (pixels).
+    * @param aSkinID Skin background that is used to clear the item area.
+    *                Possible values are e.g.
+    *                KAknsIIDQsnBgScreen
+    *                KAknsIIDQsnBgScreenIdle
+    *                KAknsIIDQsnBgScreenMp
+    *                KAknsIIDQsnBgAreaMain
+    *                KAknsIIDQsnBgAreaMainAppsGrid 
+    *                KAknsIIDQsnBgAreaMainHigh 
+    *                KAknsIIDQsnBgAreaMainFlat 
+    *                KAknsIIDQsnBgAreaMainSmall
+    *                KAknsIIDWallpaper
+    *                KAknsIIDQsnBgAreaMainIdle 
+    *                KAknsIIDQsnBgAreaStatus 
+    *                KAknsIIDQsnBgAreaStatusIdle 
+    *                KAknsIIDQsnBgAreaStaconRt 
+    *                KAknsIIDQsnBgAreaStaconLt 
+    *                KAknsIIDQsnBgAreaStaconRb 
+    *                KAknsIIDQsnBgAreaStaconLb 
+    *                KAknsIIDQsnBgAreaStaconRtIdle 
+    *                KAknsIIDQsnBgAreaStaconLtIdle 
+    *                KAknsIIDQsnBgAreaStaconRbIdle 
+    *                KAknsIIDQsnBgAreaStaconLbIdle 
+    *                KAknsIIDQsnBgAreaControl 
+    *                KAknsIIDQsnBgAreaControlPopup 
+    *                KAknsIIDQsnBgAreaControlMp 
+    *                KAknsIIDQsnBgAreaControlMp 
+    *                KAknsIIDQsnBgNavipaneSolid 
+    *                KAknsIIDQsnBgNavipaneSolidIdle 
+    *
+    */
+    IMPORT_C THuiDisplayBackgroundItem( const TRect& aRect,
+                               const TAknsItemID& aSkinID );
+
+   /**
+    * Constructor. Creates backgroun item which area is cleared
+    * using the given skin color. 
+    * @param aRect Item area in display coordinates (pixels).
+    * @param aSkinID Skin color group that is used to clear the item area.
+    *                Possible values are e.g.                       
+    *                KAknsIIDQsnIconColors
+    *                KAknsIIDQsnTextColors
+    *                KAknsIIDQsnLineColors
+    *                KAknsIIDQsnOtherColors
+    *                KAknsIIDQsnHighlightColors
+    *                etc.
+    * @param aColorIndex Skin color index.
+    */
+    IMPORT_C THuiDisplayBackgroundItem( const TRect& aRect,
+                               const TAknsItemID& aSkinID, 
+                               TInt aColorIndex );
+
+   /**
+    * Constructor. Creates backgroun item which area is cleared
+    * using the given color. 
+    * @param aRect Item area in display coordinates (pixels).
+    * @param aColor Color that is used to clear the item area.
+    */
+    IMPORT_C THuiDisplayBackgroundItem( const TRect& aRect,
+                               const TRgb& aColor );
+    
+   /**
+    * Sets area for the item.
+    * @param aRect Item area in display coordinates (pixels).
+    */
+    IMPORT_C void SetRect( const TRect& aRect );            
+    
+   /**
+    * Sets color that is used clear the item area. This overrides
+    * old color or the skin background if it has been previously given.
+    * @param Item color.
+    */
+    IMPORT_C void SetColor( const TRgb& aColor );
+
+   /**
+    * Sets skinned color that is used clear the item area. This overrides
+    * old color or skin background if it has been previously given.
+    * @param aSkinID Skin color group that is used to clear the item area.
+    *                Possible values are e.g.                       
+    *                KAknsIIDQsnIconColors
+    *                KAknsIIDQsnTextColors
+    *                KAknsIIDQsnLineColors
+    *                KAknsIIDQsnOtherColors
+    *                KAknsIIDQsnHighlightColors
+    *                etc.
+    * @param aColorIndex Color index.
+    */
+    IMPORT_C void SetColor( const TAknsItemID& aSkinID, TInt aColorIndex );
+    
+   /**
+    * Sets skin backgroud that is used clear the item area. This overrides
+    * old color or skin background if it has been previously given.
+    * 
+    * @param aSkinID Skin background that is used to clear the item area.
+    *                Possible values are e.g.
+    *                KAknsIIDQsnBgScreen
+    *                KAknsIIDQsnBgScreenIdle
+    *                KAknsIIDQsnBgScreenMp
+    *                KAknsIIDQsnBgAreaMain
+    *                KAknsIIDQsnBgAreaMainAppsGrid 
+    *                KAknsIIDQsnBgAreaMainHigh 
+    *                KAknsIIDQsnBgAreaMainFlat 
+    *                KAknsIIDQsnBgAreaMainSmall
+    *                KAknsIIDWallpaper
+    *                KAknsIIDQsnBgAreaMainIdle 
+    *                KAknsIIDQsnBgAreaStatus 
+    *                KAknsIIDQsnBgAreaStatusIdle 
+    *                KAknsIIDQsnBgAreaStaconRt 
+    *                KAknsIIDQsnBgAreaStaconLt 
+    *                KAknsIIDQsnBgAreaStaconRb 
+    *                KAknsIIDQsnBgAreaStaconLb 
+    *                KAknsIIDQsnBgAreaStaconRtIdle 
+    *                KAknsIIDQsnBgAreaStaconLtIdle 
+    *                KAknsIIDQsnBgAreaStaconRbIdle 
+    *                KAknsIIDQsnBgAreaStaconLbIdle 
+    *                KAknsIIDQsnBgAreaControl 
+    *                KAknsIIDQsnBgAreaControlPopup 
+    *                KAknsIIDQsnBgAreaControlMp 
+    *                KAknsIIDQsnBgAreaControlMp 
+    *                KAknsIIDQsnBgNavipaneSolid 
+    *                KAknsIIDQsnBgNavipaneSolidIdle 
+    *
+    */
+    IMPORT_C void SetSkinBackground( const TAknsItemID& aSkinID );
+
+   /**
+    * Returns the proper display clear mode for drawing the item. 
+    * Possible values are:
+    * 
+    * CHuiDisplay::EClearNone
+    * CHuiDisplay::EClearWithColor
+    * CHuiDisplay::EClearWithSkinBackground
+    *
+    * @return Display clear mode that should be used for drawing the item.
+    */
+    IMPORT_C TInt ClearMode() const;
+    
+   /**
+    * Gets area for the item.
+    * @return Item area in display coordinates (pixels).
+    */
+    IMPORT_C TRect Rect() const;
+    
+   /**
+    * Gets color that is used clear the item area. Color is valid only if item
+    * has been set to "Color" using either skin color group or RBG color.
+    * @return Item color.
+    */
+    IMPORT_C TRgb Color() const;
+    
+   /**
+    * Gets backgroud that is used clear the item area. 
+    * @return Item skin id. Can be either skin background.
+    */
+    IMPORT_C TAknsItemID SkinBackground() const;
+    
+private:    
+    /** Item draw area, specified in display pixels */
+    TRect iRect;       
+
+    /** Item skin id. Can be a skin background or skin color */
+    TAknsItemID iSkinID;
+
+    /** Item skin color index */
+    TInt iColorIndex;
+
+    /** Item color (used if draw mode is clear with color) */
+    TRgb iColor;    
+    
+    /** Item draw mode */
+    TInt iClearMode;
+    
+    /** Reserved for future use */
+    TInt iSpare1;
+    TInt iSpare2;
+    TInt iSpare3;
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huidropshadow.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,209 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Drop shadow handler
+*
+*/
+
+
+
+#ifndef C_HUIDROPSHADOW_H
+#define C_HUIDROPSHADOW_H
+
+#include <gdi.h>
+#include <uiacceltk/HuiRealPoint.h>
+#include <uiacceltk/HuiRealRect.h>
+#include <uiacceltk/HuiTimedPoint.h>
+#include <uiacceltk/HuiTextureHandle.h>
+#include <uiacceltk/huimetric.h>
+
+class TAknsItemID;
+class MHuiSegmentedTexture;
+class CHuiTexture;
+class CHuiVisual;
+
+/**
+ *  Drop shadow parameter handler
+ *
+ *  This interface can be fetched from the visual
+ *  @see CHuiVisual::EnableDropShadowL
+ *  @see CHuiVisual::DropShadowHandler
+ *  
+ *  @code
+ *   // get the pointer
+ *   visual->EnableDropShadowL();
+ *   CHuiDropShadow* dropShadow = visual->DropShadowHandler();
+ *
+ *   // use it
+ *   dropShadow->SetColor( KRgbRed );
+ *   dropShadow->iOffset.Set( THuiRealPoint( 10, 10 ) );
+ *  @endcode
+ *
+ *  Disabling the drop shadow from the visual, deletes the instance and therefore loses
+ *  all set paramteres. If you want to just hide the drops shadow temporally, you can 
+ *   a) set the opacity into 0 or
+ *   b) set the scale into 0
+ *
+ *  @lib hitchcock.lib
+ *  @since S60 v5.0.1
+ */
+NONSHARABLE_CLASS( CHuiDropShadow ) : public CBase
+    {
+public: // Exported functions
+     
+    /**
+     * Sets the shadow in polar coordinates. This will be converted into xy
+     * coordinates
+     *
+     * @param aAngle Angle of the shadow. 0 degrees is on the right hand side and 90 in directly above.
+     * @param aDistance Distance of the shadow in unit defined by the user component. 
+     * @param aTransitionTime Time reach the target.
+     */ 
+    IMPORT_C void SetOffset( TReal32 aAngle, THuiMetric aDistance, TInt aTransitionTime = 0 ) __SOFTFP;
+        
+    /**
+     * Sets the color of the shadow.
+     *
+     * @param aColor Text color.
+     * @param aTransitionTime Time reach the target. (not supported )
+     */
+    IMPORT_C void SetColor(const TRgb& aColor, TInt aTransitionTime = 0 );
+
+     /**
+      * Sets the color of the shadow via skin id.
+      *
+      * @param aID      Skin ID of the color group to use
+      * @param aIndex   Index within the color group
+      * @param aTransitionTime Time reach the target. (not supported )
+      */
+     IMPORT_C void SetColor(const TAknsItemID& aID,const TInt aIndex, TInt aTransitionTime = 0 );
+     
+public: // internal methods
+
+    CHuiDropShadow();
+    void ConstructL();
+    ~CHuiDropShadow();
+    
+    TBool Changed() const;
+    void ClearChanged();
+    
+    TRgb Color() const;
+    
+    /**
+     * Calculates the drawing size of the shadow texture
+     *
+     * @param aImageDrawingSize     Image drawing size
+     * @param aShadowTextureSize    Shadow texture size
+     *
+     * @return Shadow drawing size
+     */
+    THuiRealSize ShadowDrawingSize( 
+        const TSize& aImageDrawingSize, 
+        const TSize& aShadowTextureSize ) const;
+        
+    /**
+     * Checks if the shadow is visible (checks opacity and scale != 0)
+     * 
+     * @return ETrue if visible.
+     */ 
+    TBool IsShadowVisible() const;
+    
+    /**
+     * Casts 'const MHuiTexture' into 'CHuiTexture' if applicaple.
+     *
+     * @param aTextureIf Original texture interface
+     *
+     * @return Casted to CHuiTexture instance if possible.
+     */
+    static CHuiTexture* ShadowedTextureInstance( const MHuiTexture& aTextureIf );
+    
+    /**
+     * Calculates the shadow distance in pixels.
+     *
+     * @param aReferenceVisual Visual which determines the metrics.
+     *
+     * @return Shadow distance in pixels.
+     */
+    THuiRealPoint DistanceInPixels( const CHuiVisual& aReferenceVisual ) const;
+    
+    /**
+     * Returns the rectangle in which the shadow is supposed to be drawn.
+     * Area is given as real/floating values.
+     *
+     * @param aImageDrawingPosition Position where the image is drawn
+     * @param aImageDrawingSize Size of the image to be drawn
+     * @param aShadowTextureSize Size of the shadow texture
+     * @prarm aReferenceVisual Reference visual for the relative metrics.
+     *
+     * @return Area used by the shadow.
+     */
+    THuiRealRect ShadowDrawingRealRect( 
+        const TPoint& aImageDrawingPosition,
+        const TSize& aImageDrawingSize, 
+        const TSize& aShadowTextureSize,
+        const CHuiVisual& aReferenceVisual  ) const;
+    
+    /**
+     * Returns the rectangle in which the shadow is supposed to be drawn.
+     * Area is given as integer/fixed values.
+     *
+     * @param aImageDrawingPosition Position where the image is drawn
+     * @param aImageDrawingSize Size of the image to be drawn
+     * @param aShadowTextureSize Size of the shadow texture
+     * @prarm aReferenceVisual Reference visual for the relative metrics.
+     *
+     * @return Area used by the shadow.
+     */    
+    TRect ShadowDrawingTRect( 
+        const TPoint& aImageDrawingPosition,
+        const TSize& aImageDrawingSize, 
+        const TSize& aShadowTextureSize,
+        const CHuiVisual& aReferenceVisual  ) const;
+    
+public: // public members
+
+    /**
+     * Opacity of the shadow
+     */ 
+    THuiTimedValue iOpacity;
+    
+    /**
+     * Shadow offset in timed xy-coordinates
+     */
+    THuiTimedPoint iOffset;
+    
+    /**
+     * Shadow offset unit
+     */
+    TInt iOffsetUnit;
+    
+    /**
+     * Sets the blur filter radius. This is used to generate the shadow from the
+     * texture. Normally between 2-5 pixels (in texture coordinates).
+     */
+    THuiTimedValue iRadius;
+    
+    /**
+     * Scale of the shadow - default 1.0.
+     */ 
+    THuiTimedValue iScale;
+   
+private:
+
+    struct THuiDropShadowData;
+    THuiDropShadowData* iData;
+
+    };
+
+
+#endif // C_HUIDROPSHADOW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huieventhandler.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of MHuiEventHandler, an interface enabling 
+*                handling of scheduled events.
+*
+*/
+
+
+ 
+#ifndef __HUIEVENTHANDLER_H__
+#define __HUIEVENTHANDLER_H__
+
+#include <e32base.h>
+
+/* Forward declarations. */
+class THuiEvent;
+
+/**
+ * MHuiEventHandler is an interface that can be derived by any object that want's to handle
+ * Hitchcock UI Toolkit events scheduled by HuiScheduler.
+ * 
+ * If an object wishes to process events from the toolkit, it should implement this interface. 
+ * 
+ * @note   The destructor will NOT cancel any pending commands enqueued to this object,
+ *         so you must call eg. <code>CHuiEnv::CancelCommands(this);</code> to cancel
+ *         still pending commands to prevent calling destroyed object.
+ */
+class MHuiEventHandler
+    {
+public:
+
+    /** 
+     * Destructor. 
+     * 
+     * @note   Will NOT cancel any pending commands scheduled to this object,
+     *         so you must call eg. <code>CHuiEnv::CancelCommands(this);</code> to cancel
+     *         still pending commands to prevent calling destroyed object.
+     */    
+    IMPORT_C virtual ~MHuiEventHandler();
+
+    /**
+     * Called when an input event is being offered to this object.
+     * 
+     * The implementation must ensure that the function returns EFalse if 
+     * it does not do anything in response to the event, otherwise, other objects
+     * may be prevented from receiving the event. If it is able to process the 
+     * event it should return ETrue.
+     *
+     * @param aEvent  Event to be handled.
+     *
+     * @return  <code>ETrue</code>, if the event was handled.
+     *          Otherwise <code>EFalse</code>.
+     */
+    virtual TBool OfferEventL(const THuiEvent& aEvent) = 0;
+
+    };  
+
+#endif  // __HUIEVENTHANDLER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huifixmath.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Fixed point arithmetics
+*
+*/
+
+
+
+#ifndef __HUIFIXMATH_H__
+#define __HUIFIXMATH_H__
+
+#include <e32def.h>
+
+static const TInt KFixPi = 0x3243F;
+
+
+class HuiFixMath
+{
+public:
+    IMPORT_C static TUint FixHypot(TInt aVal1,TInt aVal2);
+		IMPORT_C static TInt FixSin(TInt aRadians);
+		IMPORT_C static TInt FixCos(TInt aRadians);
+		
+		static inline TInt FixMul(TInt aVal1, TInt aVal2);
+		static inline TInt FixDiv(TInt aVal1, TInt aVal2);
+		static inline TInt FloatToFix(TReal32 aVal);
+		static inline TReal32 FixToFloat(TInt aVal);
+};
+
+TInt HuiFixMath::FixMul(TInt aVal1, TInt aVal2)
+		{
+		TInt64 result = (TInt64(aVal1))*(TInt64(aVal2));
+		return TInt(result>>16); 
+		};
+
+TInt HuiFixMath::FixDiv(TInt aVal1, TInt aVal2)
+		{
+		TUint64 temp = aVal1;
+		temp<<=16;
+		return TInt(temp/aVal2);
+		};
+
+TInt HuiFixMath::FloatToFix(TReal32 aVal)
+		{
+		return TInt(aVal*65536.0f);
+		}
+		
+TReal32 HuiFixMath::FixToFloat(TInt aVal)
+		{
+		return TReal32((TReal32(aVal))/65536.0f);
+		}
+
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huifontmanager.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 manager allows creation, enumeration and management of
+*                platform fonts in Hitchcock UI Toolkit usage.
+*
+*/
+
+
+
+#ifndef HUIFONTMANAGER_H
+#define HUIFONTMANAGER_H
+
+#include <e32std.h>
+
+#include <uiacceltk/huifontspecification.h>
+
+/**
+ * THuiFontManager allows user to enumerate all fonts supported by the platform
+ * that can be used in Hitchcock UI Toolkit user interfaces. THuiFontManager also
+ * allows creation of platform supported fonts and manages the lifetime of these
+ * font objects. Fonts are referred to by Hithcock UI Toolkit session specific 
+ * unique IDs.
+ */
+NONSHARABLE_CLASS(THuiFontManager)
+{
+public:
+
+    /**
+     * Default constructor. Creates the THuiFontManager object.
+     * This is called by CHuiEnv to create the system font manager instance.
+     */
+    IMPORT_C THuiFontManager();
+    
+    /**
+     * Default destructor.
+     */    
+    IMPORT_C virtual ~THuiFontManager();
+    
+    /** @beginAPI */
+    
+    /**
+     * Retrieves the CHuiFontSpecification array that describes all fonts
+     * supported by this platform. Any of these specifications can be used to create
+     * new font instances. The user has to pass in an array that will be filled by this
+     * method with the system font specifications.
+     * @see CreateFontL()
+     *
+     * @param aArray Reference to an array that is going to include all platform supported
+     * fonst specifications after this call has exited.
+     */
+    IMPORT_C void EnumerateFontsL(RArray<THuiFontSpecification>& aArray) const;
+    
+    /**
+     * Creates a new font object based on the font specification passed into this method.
+     * If no matching font specification is found from the system the method leaves with 
+     * KErrNotSupported leave code. User can make sure that the font is supported by using
+     * the EnumerateFontsL - method and using the font specification array generated by
+     * the method. A unique ID is constructed based on this font. This font can be accessed 
+     * anytime through the FontL - method based on this unique ID.
+     * @see FontL()
+     * @see EnumerateFontsL()
+     * 
+     * @param aSpecification A font specification object according to which the font object is created.
+     * @return Unique ID describing the newly created font object. If similar font already exists then
+     * the ID of the already created font is returned.
+     */
+    IMPORT_C TInt CreateFontL(const THuiFontSpecification& aSpecification);
+    
+    /** @endAPI */
+    
+private:
+
+    /** Registry of all fonts within this manager. These fonts are accessed by font id. */
+    RArray<THuiFontSpecification> iFonts;
+
+};
+
+#endif // HUIFONTMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huifontspecification.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 specification is a platform-independent way of describing
+*                font properties supported by Hitchcock UI Toolkit.
+*
+*/
+
+
+
+#ifndef HUIFONTSPECIFICATION_H
+#define HUIFONTSPECIFICATION_H
+
+#include <e32std.h>
+#include <gdi.h>
+
+/**
+ * THuiFontSpecification allows user to specify required font parameters for
+ * a created font or the Hitchcock UI Toolkit to describe the parameters of
+ * any given supported system font. This specification class can be used in
+ * conjunction with THuiFontManager to create platform-supported fonts and query them.
+ * @see THuiFontManager
+ */
+NONSHARABLE_CLASS(THuiFontSpecification)
+{
+public:
+	
+	/**
+	 * Default constructor of font specification. Will assign default values to
+	 * the specification parameters.
+	 */
+	THuiFontSpecification();
+	
+	/**
+	 * Default destructor.
+	 */
+	virtual ~THuiFontSpecification();
+	
+    /** @beginAPI */
+	
+	/**
+	 * Returns the typeface family name this font specification represents. E.g. "Helvetica".
+	 */
+	const TDesC& TypefaceFamily() const;
+	
+	/**
+	 * Sets the typeface family name
+	 * 
+	 * @param aName The typeface family name used by the system or required by the user.
+	 */
+	void SetTypefaceFamily(const TDesC& aName);
+	
+    /** @endAPI */
+	
+private:
+
+	/** Font typeface family */
+	TBuf<KMaxTypefaceNameLength> iFontFamily;
+
+};
+
+#endif // HUIFONTSPECIFICATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huiframebrush.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,244 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines a CHuiFrameBrush class - a brush that draws a frame element
+*
+*/
+
+
+
+#ifndef __HUIFRAMEBRUSH_H__
+#define __HUIFRAMEBRUSH_H__
+
+
+#include <e32base.h>
+#include <AknsItemID.h>
+#include <uiacceltk/HuiBrush.h>
+#include <uiacceltk/HuiSkin.h>
+#include <uiacceltk/HuiGc.h>
+#include <uiacceltk/HuiImage.h>
+#include <uiacceltk/HuiTimedPoint.h>
+#include <uiacceltk/HuiEnv.h>
+#include <uiacceltk/huimetric.h>
+
+class CHuiImageLoaderUtil;
+
+/**
+ *  Frame brush
+ *
+ *  @lib hitchcock.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS(CHuiFrameBrush): public CHuiBrush, public MHuiActionObserver
+    {
+public:
+
+    enum TFrameParts
+        {
+        EFramePartCornerTl = 0,
+        EFramePartCornerTr,
+        EFramePartCornerBl, 
+        EFramePartCornerBr,
+        EFramePartSideT,
+        EFramePartSideB,
+        EFramePartSideL,
+        EFramePartSideR,
+        EFramePartCenter
+        };
+
+    /**
+     * NewL. Creates new instance of CHuiFrameBrush.
+     *
+     * @param aImage Image for the frame. Image will be used as such, 
+     * framerects (if set) are ignored.
+     * @param aEdgeOffset Coordinates of the offset in metric units.
+     * @return New instance. Onwership tranferred to the caller.
+     */
+    IMPORT_C static CHuiFrameBrush* NewL(
+        const THuiImage& aImage,
+        const THuiXYMetric& aEdgeOffset);
+    
+    /**
+     * NewLC. Creates new instance of CHuiFrameBrush and leaves
+     * it onto the cleanup stack.
+     *
+     * @param aImage Image for the frame. Image will be used as such, 
+     * framerects (if set) are ignored.
+     * @param aEdgeOffset Coordinates of the offset in metric units.
+     * @return New instance. Onwership tranferred to the caller.
+     */
+    IMPORT_C static CHuiFrameBrush* NewLC(
+        const THuiImage& aImage,
+        const THuiXYMetric& aEdgeOffset);
+
+
+    /**
+     * NewL. Creates new instance of CHuiFrameBrush.
+     *
+     * @param aIID Skin ID for the frame.
+     * @param aEdgeOffset Coordinates of the offset in metric units.
+     * @return New instance. Onwership tranferred to the caller.
+     */
+    IMPORT_C static CHuiFrameBrush* NewL(
+        const TAknsItemID& aIID,
+        const THuiXYMetric& aEdgeOffset);
+    
+    /**
+     * NewLC. Creates new instance of CHuiFrameBrush and leaves
+     * it onto the cleanup stack.
+     *
+     * @param aIID Skin ID for the frame.
+     * @param aEdgeOffset Coordinates of the offset in metric units.
+     * @return New instance. Onwership tranferred to the caller.
+     */
+    IMPORT_C static CHuiFrameBrush* NewLC(
+        const TAknsItemID& aIID,
+        const THuiXYMetric& aEdgeOffset);
+
+    /**
+     * NewL. Creates new instance of CHuiFrameBrush.
+     *
+     * @deprecated
+     * @param aIID Skin ID for the frame.
+     * @param aEdgeOffsetX X coordinate of the offset in pixels.
+     * @param aEdgeOffsetY Y coordinate of the offset in pixels.
+     * @return New instance. Onwership tranferred to the caller.
+     */
+    IMPORT_C static CHuiFrameBrush* NewL(
+        const TAknsItemID& aIID,
+        TInt aEdgeOffsetX = 0, 
+        TInt aEdgeOffsetY = 0 );
+    
+    /**
+     * NewLC. Creates new instance of CHuiFrameBrush and leaves
+     * it onto the cleanup stack.
+     *
+     * @deprecated     
+     * @param aIID Skin ID for the frame.
+     * @param aEdgeOffsetX X coordinate of the offset in pixels.
+     * @param aEdgeOffsetY Y coordinate of the offset in pixels.
+     * @return New instance. Onwership tranferred to the caller.
+     */
+    IMPORT_C static CHuiFrameBrush* NewLC(
+        const TAknsItemID& aIID,
+        TInt aEdgeOffsetX = 0, 
+        TInt aEdgeOffsetY = 0);
+
+    /**
+     * Destructor
+     */
+    ~CHuiFrameBrush();
+
+    
+    /**
+     * Sets the frame rectangles which define the nine frame areas.
+     *
+     * @param aInnerRect Inner rect (pixels) in where the EFramePartCenter is drawn.
+     * @param aOuterRect Outter rect (pixels).
+     */
+    IMPORT_C void SetFrameRectsL(const TRect& aInnerRect, const TRect& aOuterRect);
+
+    /**
+     * Sets edge offset.
+     * @param aEdgeOffset Coordinates of the offset in metric units.
+     */
+    IMPORT_C void SetEdgeOffset(const THuiXYMetric& aEdgeOffset);
+
+    /**
+     * Sets frame image. Whole frame will be constrcuted from this image.
+     * @param aImage Image for the frame.
+     */
+    IMPORT_C void SetImage(const THuiImage& aImage);
+
+    /**
+     * Sets framepart image. Whole frame will be constrcuted from 9 parts, each part has
+     * to be set separately using this method. Genrally using 9-piece frame is not as
+     * efficient as 1-pice frame, so this method should be used only when really needed.
+     * @param aFramePart Frame part to which the image is intended.
+     * @param aImage Image for the frame part.
+     */
+    IMPORT_C void SetImage(TFrameParts aFramePart, const THuiImage& aImage);
+
+    /**
+     * From CHuiBrush.
+     * @see CHuiBrush::ExpandVisualRect(TRect& aRect)
+     */
+    void ExpandVisualRect(TRect& aRect) const;
+        
+    /**
+     * From CHuiBrush.
+     * @see CHuiBrush::Changed() const
+     */
+    TBool Changed() const;
+    
+    /**
+     * From CHuiBrush.
+     * @see CHuiBrush::ClearChanged()
+     */
+    void ClearChanged();
+
+    /**
+     * From CHuiBrush.
+     * @see CHuiBrush::Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const;
+     */
+    void Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const;
+
+protected:
+
+    CHuiFrameBrush(const THuiImage& aImage, const THuiXYMetric& aEdgeOffset);
+    CHuiFrameBrush(const TAknsItemID& aIID, const THuiXYMetric& aEdgeOffset);
+    CHuiFrameBrush(const TAknsItemID& aIID, TInt aEdgeOffsetX, TInt aEdgeOffsetY);
+    CHuiFrameBrush();
+    
+    // from MHuiActionObserver
+    void HandleActionL(const THuiActionCommand& aActionCommand);
+       
+private:
+    TSize GetFramePartSize(const TFrameParts aFramePart) const;
+    void ConstructFrameL();
+    static void ResetAndDestroyImageArray( TAny* aAny );
+    THuiRealPoint PointInPixels(const CHuiVisual* aVisual, const THuiTimedPoint& aPoint, const THuiXYMetric& aMetric) const;
+    void InitImagesL(TInt aNumberOfImages);
+    void ConstructL(const THuiImage& aImage);
+    TRect AdjustedOuterRect(const TSize& aFullFrameSize) const;
+    TRect AdjustedInnerRect(const TSize& aFullFrameSize) const;
+private:
+    TAknsItemID iFrameIID;
+    TRect iInnerRect;
+    TRect iOuterRect;
+    
+    NONSHARABLE_CLASS(CHuiImageWithID): public CBase
+        {
+        public:
+          CHuiImageWithID(THuiImage aImage, TInt aId):iImage(aImage),iId(aId){}
+          ~CHuiImageWithID();
+          const MHuiSegmentedTexture& Texture(); 
+          THuiImage& Image(); 
+          void SetImage(const THuiImage& aImage);   
+        private:
+          THuiImage iImage;
+          TInt iId;
+        };
+        
+    RPointerArray<CHuiImageWithID> iImages;	
+    CHuiImageLoaderUtil* iImageloader;
+    
+public:
+    THuiTimedPoint iEdgeOffset;
+private:
+    THuiXYMetric iEdgeOffsetMetric;
+    TBool iEnvReleased;
+    TBool iSkinChanged;
+    };
+
+#endif 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huigifanimationtexture.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIGIFANIMATIONTEXTURE__
+#define __HUIGIFANIMATIONTEXTURE__
+
+#include <uiacceltk/HuiAnimatedTexture.h>
+#include <uiacceltk/HuiTextureManager.h>
+
+NONSHARABLE_CLASS(CHuiGifAnimationTexture) : public CHuiAnimatedTexture,
+                                public MHuiTextureLoadingCompletedObserver
+    {
+public:
+    enum TAnimationState
+        {
+        EInitializing   = 0x1,
+        ERunning        = 0x2,
+        EStopped        = 0x4,
+        EEnabled        = 0x8
+        };
+    IMPORT_C static CHuiGifAnimationTexture* NewL(const TDesC& aFilename,
+                                                  CHuiTextureManager& aManager,
+                                                  TInt aID,
+                                                  THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault);
+    IMPORT_C virtual ~CHuiGifAnimationTexture();
+
+    void AdvanceTime(TReal32 aElapsedTime) __SOFTFP;
+    void TextureLoadingCompleted(CHuiTexture& aTexture,
+                                         TInt aTextureId,
+                                         TInt aErrorCode);
+                                       
+    IMPORT_C TInt Id();
+    IMPORT_C void Start();
+    IMPORT_C void Stop();
+    IMPORT_C void EnableAnimation(TBool aEnable);
+protected:
+    CHuiGifAnimationTexture(CHuiTextureManager& aManager,THuiTextureUploadFlags aFlags, TInt aId);
+    void ConstructL(const TDesC& aFilename);
+    void ReplaceTexture(CHuiTexture* aTexture);
+
+private:
+    CHuiTexture* iTexture1;
+    CHuiTexture* iTexture2;
+    TInt iTextureId1;
+    TInt iTextureId2;
+    TInt iCurrentTexture;
+    HBufC* iFilename;
+    
+    TAnimationState iAnimationState;
+    
+    TInt iFrameInterval;
+    TInt iFrameCount;
+    THuiTextureUploadFlags iFlags;
+    TInt iId;
+    TReal32 iElapsedTime;
+    TInt iAnimatedTextureGroupId;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huilowmemoryobserver.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,92 @@
+/*
+* 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: 
+*
+*/
+/*
+ * huilowmemoryobserver.h
+ *
+ *  Created on: Jun 9, 2009
+ *      Author: ranshett
+ */
+
+#ifndef HUILOWMEMORYOBSERVER_H_
+#define HUILOWMEMORYOBSERVER_H_
+
+enum THuiMemoryLevel
+    {
+    /** 
+     * No memory available at all. Even all rendering 
+     * surfaces and buffers should be released.
+     *  
+     **/
+    EHuiMemoryLevelNone = -50,
+
+    /** 
+     * Lowest memory level. Use SW rendering if possible, 
+     * only rendering surfaces etc. absolutely mandatory 
+     * objects are allowed to consume memory.
+     * 
+     **/
+    EHuiMemoryLevelLowest = -40,
+    
+    /** 
+     * To be defined.
+     *  
+     **/
+    EHuiMemoryLevelLower = -30,    
+    
+    /** 
+     * Low memory level, same as EnableLowMemoryState(ETrue). Normal
+     * functionality and user experience is not provided. Memory usage
+     * is minimized, but HW rendering is to be used. Caches, buffers,
+     * effects, etc. are to be disabled.
+     *  
+     **/
+    EHuiMemoryLevelLow = -20, 
+    
+    /** 
+     *  Reduced memory level. Normal functionality and user experience
+     *  should be provided, but all non-mandatory memory usage should
+     *  be avoided. 
+     *  
+     **/
+    EHuiMemoryLevelReduced = -10,    
+
+    /** 
+     * Normal memory level, same as EnableLowMemoryState(EFalse) 
+     **/
+    EHuiMemoryLevelNormal = 0    
+    };
+
+/** 
+ * Memory level observer interface is same as MHuiLowMemoryObserver
+ * but gives more detailed information about memory levels. 
+ **/
+class MHuiMemoryLevelObserver
+    {
+public:
+    IMPORT_C virtual void SetMemoryLevel(THuiMemoryLevel aLevel)=0;
+    };
+
+/** 
+ * @deprecated use MHuiMemoryLevelObserver instead.
+ **/
+class MHuiLowMemoryObserver
+    {
+public:
+    IMPORT_C virtual void EnableLowMemoryState(TBool aEnable)=0;
+    };
+
+#endif /* HUILOWMEMORYOBSERVER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huim3gmesh.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,246 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiM3GMesh, an interface enabling usage of M3G
+* 				 scene graphs within Hitchcock UI Toolkit user interfaces.
+*
+*/
+
+
+ 
+#ifndef __HUIM3GMESH_H__
+#define __HUIM3GMESH_H__
+
+#include <uiacceltk/HuiMesh.h>
+#include <uiacceltk/HuiRealRect.h>
+
+// Force softfp linkage until included header has its own definitions
+#if defined(__ARMCC_VERSION)
+#pragma push
+#pragma softfp_linkage
+#endif
+#include <M3G/m3g_core.h>
+#if defined(__ARMCC_VERSION)
+#pragma pop
+#endif
+
+/* Constants */
+
+// ID for Animating all controllers
+const TInt KHuiM3GAnimateAllControllers = 100000;  
+
+/* Forward declarations. */
+
+/* Structs */
+
+// Hitchcock M3G animation controller
+struct THuiM3GMeshAnimationController
+	{
+	M3GAnimationController iController;  // M3G controller
+	THuiTimedValue iPosition;            // position in timeline
+	TBool iAnimating;                    // is controller animating
+	TInt iTimeOffset;
+	TInt iPreviousTime;
+	};
+
+
+/**
+ * CHuiM3GMesh is a 3D mesh that can be used in Hitchcock UI Toolkit to incorporate
+ * M3G (Mobile 3D Graphics) objects into the user interface.
+ */
+class CHuiM3GMesh : public CHuiMesh
+    {
+public: // New
+    
+    /** @beginAPI */
+    
+    /**
+     * Loads an M3G scene graph from an M3G file. The M3G mesh scene graph is loaded 
+     * from the file given as a parameter. If the filename string is malformed and does not adhere to
+     * file path syntax this method leaves with KErrBadName error code. If the file
+     * path is not found this method leaves with KErrPathNotFound error code.
+     * If the specified file is not found this method leaves with KErrNotFound error code.
+     * If the M3G file does not contain any M3G objects or is corrupted this method
+     * leaves with KErrCorrupt error code. If this method leaves the whole scene graph content
+     * is released. This means that no partial scene graph content can be accessed through this object.
+     *
+     * @param aFileName Path to the M3G file from which the M3G scene graph is loaded
+     *                  into this M3G mesh. The texture image path is prepended to this
+     *                  resource file name. @see CHuiTextureManager::ImagePath().
+     */	
+	IMPORT_C virtual void LoadSceneL(const TDesC &aFileName);
+
+	/** @endAPI */
+
+    /**
+     * Default constructor.
+     */
+	IMPORT_C CHuiM3GMesh();
+
+    /**
+     * Destructor.
+     */
+	IMPORT_C virtual ~CHuiM3GMesh();
+
+	/**
+	 * Set viewport of the m3g mesh.
+	 */
+    IMPORT_C virtual void SetViewportRect( const THuiRealRect& aRect );
+
+	/**
+	 * Rotate world around Y axis.
+	 */
+	IMPORT_C virtual void RotateYaw(TReal32 aAngle) __SOFTFP;
+
+	/**
+	 * Rotate world around X axis.
+	 */
+	IMPORT_C virtual void RotatePitch(TReal32 aAngle) __SOFTFP;
+
+	/**
+	 * Store camera transformations of the M3G world so those can be restored later on and this way animations
+	 * doesn't mess with camera manipulations.
+	 */
+	IMPORT_C virtual void StoreCamera();
+	
+	/**
+	 * Restore camera transformations of the M3G world.
+	 */
+	IMPORT_C virtual void RestoreCamera();
+	
+	/**
+	 * Goes through animation controllers and does animations.
+	 */
+	IMPORT_C virtual void AnimateControllers();
+	
+public: // From CHuiMesh
+     /**
+     * Draws the loaded M3G scene.
+     */     
+    IMPORT_C virtual void Draw(CHuiGc& aGc, const THuiImage* aImage = 0, 
+                      const THuiImage* aSecondaryImage = 0,
+                      TReal32 aSecondaryAlpha = 0.0) const __SOFTFP;
+
+
+	/**
+	 * Returns number of (hitchcock) animation controllers
+	 */
+    IMPORT_C virtual TInt AnimationControllerCount() const;
+
+	/**
+	 * Set position of animation in animation controller.
+	 *
+	 * @param aControllerId  ID of the controller.
+	 * @param aTarget  Target position in the timeline (seconds)
+	 * @param aTime  Time to be used in animation
+	 */
+	IMPORT_C virtual void SetAnimationPosition(TInt aControllerId, TReal32 aTarget, TInt aTime) __SOFTFP;
+
+	/**
+	 * Start animation of the controller
+	 *
+	 * @param aControllerId  ID of the animation controller.
+	 */
+	IMPORT_C virtual void StartAnimationController(TInt aControllerId);
+	
+	/**
+	 * Stop animation of the controller
+	 *
+	 * @param aControllerId  ID of the animation controller.
+	 */
+    IMPORT_C virtual void StopAnimationController(TInt aControllerId);
+
+protected: // todo: to private?
+
+    /**
+     * 2nd phase constructor. 
+     */
+    IMPORT_C virtual void ConstructL();    
+
+    /**
+     * Will release the loaded scene.
+     */
+    IMPORT_C virtual void ReleaseScene();
+	
+	/**
+	 * Load scene with m3g interface parameter
+	 */
+	IMPORT_C void LoadSceneL(const TDesC& aFileName, M3GInterface aInterface);
+	
+	/**
+     * Provides expandability, helps keeping the binary compatibility. Since virtual
+     * table is now exported and this class is dll derivable and the implementation
+     * is more difficult to change, hence this method, which can provide additional
+     * extension APIs.
+     * 
+     * @param aExtensionUid     UID, which is being used for recognizing the extension
+     * @param aExtensionParams  Return pointer to the extension API, once recognized from the extension uid
+     */
+    IMPORT_C virtual void M3GMeshExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+
+	/**
+	 * Finds the center point of the groups objects. Goes the groups
+	 * inside the group recursively.
+	 *
+	 * @param aGroup  group thats center position is needed
+	 * @param aTrans  translation values to be returned
+	 * @param aFirst  indicates if aTrans has been initiliazed
+	 */
+	void FindObjectCenter(M3GGroup aGroup, TReal32 aTrans[4], TBool aFirst = ETrue);
+
+	void RotateObjects(TReal32 aAngle, TReal32 aAxisX, TReal32 aAxisY, TReal32 aAxisZ) __SOFTFP;                      
+	
+	/**
+	 * Populates the iControllers array with animation controllers found
+	 * from below given object in the M3G object net.
+	 */
+	void PopulateAnimationControllerArrayL(const M3GObject aObject);
+	
+	/**
+	 * Execute the actual scene graph loading.
+	 */
+	void DoLoadSceneL(const TDesC& aFileName, M3GInterface aInterface);	
+	
+protected:
+
+	// Area where M3G mesh is rendered.
+	THuiRealRect iViewportRect;
+
+	// World
+    M3GWorld iWorld;
+
+    // Camera
+    M3GCamera iCamera;
+    TBool iUpdateCamera;
+
+    // Objects
+    TInt iNumObjects;
+    M3GObject *iObjects;
+
+
+	// Stored camera transformations    
+    TReal32 iCamRotation[4];
+    TReal32 iCamTranslation[4];
+
+    // Animation controllers
+    RArray<THuiM3GMeshAnimationController> iControllers;
+    
+    /** Spare member to help keeping binary compatibility, since HuiM3GMesh is
+        now dll derivable **/
+    TInt iSpare;
+
+    };  
+
+#endif  // __HUIM3GMESH_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huimetric.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,284 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of THuiMetric, which is used to achieve 
+*                       text size dependent layouts, normalized child coordinate system and 
+*                       unified metrics system for all layout calculations. 
+*
+*/
+
+
+
+#ifndef __HUIMETRIC_H__
+#define __HUIMETRIC_H__
+
+
+#include <e32base.h>
+#include <e32std.h>
+
+#include <uiacceltk/huitextstylemanager.h>
+#include <uiacceltk/HuiRealPoint.h>
+
+/**
+ * Metric units. The unit defines how the @c iMagnitude member of the THuiMetric 
+ * struct is interpreted in practice. The interpretation may be dependent on 
+ * the size of the layout where it is being used, the size of a font, or 
+ * for example a globally defined constant.
+ */ 
+enum THuiUnit
+    {
+    /** Real pixel that corresponds the pixels on the physical device screen. */
+    EHuiUnitPixel,
+
+    /** Normalized to parent layout size (0.0 -- 1.0). */
+    EHuiUnitNormalized,
+    EHuiUnitParentSize = EHuiUnitNormalized,
+    
+    /** Relative to the display where the metric is being used (0.0 -- 1.0). */
+    EHuiUnitRelativeToDisplay,
+    EHuiUnitDisplaySize = EHuiUnitRelativeToDisplay,
+    
+    /**
+     * Layout unit defined by S60 for a particular display device.
+     * @see CHuiDisplay::UnitValue
+     */
+    EHuiUnitS60,
+
+    /** 
+     * Relative to the size of the visual where the metric is being used (0.0 -- 1.0). 
+     * This is particularly useful for anchor layout offsets, and for paddings.
+     */
+    EHuiUnitRelativeToMySize,
+    EHuiUnitMySize = EHuiUnitRelativeToMySize,
+
+    /** relative weight; interpretation depends on sibling elements 
+     * (for example, cells in a grid) 
+     */
+    EHuiUnitWeight,
+    
+    /** 
+     * Not supported at the moment. 
+     * Line height of the font of the reference text style (the "em width") 
+     */
+    EHuiUnitLine,
+    
+    /** 
+     * Not Supported at the moment. 
+     * Physical millimeters on the screen (for instance for icons). 
+     */
+    EHuiUnitMillimeter,
+    
+    /** 
+     * Similar to EHuiUnitMysize. Can be used for example to constrain the aspect ratio of a visual,
+     * by constraining one axis to be defined in relation to its orthogonal axis.
+     */
+    EHuiUnitMyWidth,
+    EHuiUnitMyHeight,
+    
+    /** 
+     * Similar to EHuiUnitNormalized. Can be used for example to constrain the aspect ratio of a visual
+     * by constraining one axis to be defined in relation to its parent's orthogonal axis.
+     */
+    EHuiUnitParentWidth,
+    EHuiUnitParentHeight,
+
+    /** 
+     * Not Supported at the moment. 
+     * Similar to EHuiUnitMysize. The minimum of a visual's dimensions.
+     */
+    EHuiUnitMyDimensionMinimum,
+    
+    /** 
+     * Similar to EHuiUnitMysize. The Average of a visual's dimensions.
+     */
+    EHuiUnitMyDimensionAverage,
+    };
+
+
+/**
+ * A Metric is used to represent a value in a specified unit type. This is
+ * to support the definition of Layouts using screen-size independent as well
+ * as screen-size dependent measurements.
+ * 
+ * The metrics are used for different things in different contexts: 
+ * coordinate base units, anchor offsets, grid column/row weights, paddings, etc. 
+ * The interpretation of the units used in the metric depends on the context, 
+ * the type of Layout in which they are used, etc.
+ *
+ */
+struct THuiMetric
+    {
+public:
+    /**
+     * Constructor. The constructor defaults to using [1px] units.
+     *
+     * @param aMagnitude the size of the metric value, for example it may represent a length or a scale factor
+     * @param aUnit the unit type in which the metric value is represented
+     * @param aReferenceTextStyleID can be used to specify a text style in the case of EHuiUnitLine. 
+     */    
+    IMPORT_C THuiMetric(TReal32 aMagnitude = 1.f, TInt aUnit = EHuiUnitPixel, TInt aReferenceTextStyleId = EHuiTextStyleNormal) __SOFTFP;
+
+    /**
+     * Constructor. Allows the compiler to pass integers instead of THuiMetric
+     * in parameters, in place of pixel metrics.
+     *
+     * @param aPixels  Number of pixels for the metric.
+     */
+    IMPORT_C THuiMetric(TInt aPixels);
+
+    /**
+     * Returns a copy of the metric with the absolute value of the magnitude component.
+     */    
+    inline THuiMetric Abs() const 
+        {
+        return THuiMetric(::Abs(iMagnitude), iUnit, iReferenceTextStyleId);
+        }
+
+    inline THuiMetric operator * (TReal32 aValue) const
+        {
+        THuiMetric result = *this;
+  	    result.iMagnitude *= aValue;
+  	    return result;
+        }
+    
+public:
+    TReal32 iMagnitude; 
+    
+    /**
+     * @see THuiUnit
+     */
+    TInt iUnit;
+    
+    /**
+     * @see CHuiTextStyleManager::TextStyle
+     */
+    TInt iReferenceTextStyleId;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+/**
+ * A pair of metrics used to represent a value in both X and Y directions, similar to a THuiRealPoint.
+ */
+struct THuiXYMetric
+    {
+public:
+    /**
+     * Constructor.
+     */
+    IMPORT_C THuiXYMetric();
+
+    /**
+     * Constructor. Uses the same metric for both axes.
+     *
+     * @param aMetric  Metric for the X and Y axes.
+     */
+    IMPORT_C THuiXYMetric(const THuiMetric& aMetric);
+
+    /**
+     * Constructor.
+     *
+     * @param aX metric for the X axis
+     * @param aY metric for the Y axis
+     */
+    IMPORT_C THuiXYMetric(const THuiMetric& aX, const THuiMetric& aY);
+    
+    inline THuiXYMetric operator * (const THuiRealPoint& aPoint) const 
+        {
+        THuiXYMetric result = *this;
+        result.iX.iMagnitude *= aPoint.iX;
+        result.iY.iMagnitude *= aPoint.iY;
+        return result;
+        }
+        
+    inline THuiXYMetric Abs() const 
+        {
+        return THuiXYMetric(iX.Abs(), iY.Abs());
+        }
+        
+
+public:
+    THuiMetric iX;
+    THuiMetric iY;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+/**
+ * Four metrics used to indicate space around the four edges of a rectangle.
+ * Not called a rectangle because those are typically made up of two XY points,
+ * while this contains just four edge metrics (named top, bottom, left, and right).
+ */
+struct THuiBoxMetric
+    {
+public:
+    /**
+     * Constructor.
+     */
+    IMPORT_C THuiBoxMetric();
+    
+    /**
+     * Constructor. Uses the same metric on all sides of the box.
+     *
+     * @param aMetric  Metric for all sides of the box.
+     */
+    IMPORT_C THuiBoxMetric(const THuiMetric& aMetric);
+
+    /**
+     * Constructor. The X metric is used for the left and right sides, and the
+     * Y metric is used for the top and bottom sides.
+     *
+     * @param aMetric  Metric for all sides of the box.
+     */
+    IMPORT_C THuiBoxMetric(const THuiXYMetric& aMetric);
+
+    /**
+     * Constructor. The top and left edges are specified in a single parameter, 
+     * and the bottom and right edges are also specified in a single parameter.
+     *
+     * @param aTopLeft  Metrics for the left and top sides.
+     * @param aBottomRight  Metrics for the right and bottom sides.
+     */
+    IMPORT_C THuiBoxMetric(const THuiXYMetric& aTopLeft, 
+        const THuiXYMetric& aBottomRight);
+
+    /**
+     * Constructor.
+     *
+     * @param aLeft Metric for the left edge of the box.
+     * @param aRight Metric for the right edge of the box.
+     * @param aTop Metric for the top edge of the box.
+     * @param aBottom Metric for the bottom edge of the box.
+     */    
+    IMPORT_C THuiBoxMetric(const THuiMetric& aLeft, const THuiMetric& aRight,
+        const THuiMetric& aTop, const THuiMetric& aBottom);
+        
+public:
+    THuiMetric iLeft;        
+    THuiMetric iRight;
+    THuiMetric iTop;
+    THuiMetric iBottom;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+#endif  // __HUIMETRIC_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huiproceduralmesh.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,172 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIPROCEDURALMESH_H__
+#define __HUIPROCEDURALMESH_H__
+
+
+#include <e32base.h>
+#include <gdi.h>
+
+#include <uiacceltk/HuiImage.h>
+#include <uiacceltk/HuiTimedValue.h>
+#include <uiacceltk/HuiMaterial.h>
+#include <uiacceltk/HuiSessionObject.h>
+#include <uiacceltk/HuiMesh.h>
+
+
+/* Forward declarations. */
+class CHuiGc;
+
+
+/**
+ * CHuiProceduralMesh is the base class for renderer-specific implementations  
+ * of 3D triangle meshes. It also defines the public interface that 
+ * applications can use to manipulate meshes. It is possible to instantiate 
+ * CHuiProceduralMesh itself, but the resulting mesh instance will have no 
+ * functionality. 
+ */
+class CHuiProceduralMesh : public CHuiMesh
+    {
+public:    
+
+    /* Constructors and destructors. */
+
+    /**
+     * Default constructor.
+     */
+    IMPORT_C CHuiProceduralMesh();
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C ~CHuiProceduralMesh();           
+
+    
+    /* Methods. */
+
+    /**
+     * Resets the mesh. All contents are destroyed.
+     */
+    IMPORT_C virtual void Reset();
+
+    /**
+     * Creates a cube mesh.
+     *
+     * @param aSizeX
+     * @param aSizeY
+     * @param aSizeZ
+     * @param aEdgeRadius
+     */
+    IMPORT_C virtual void MakeCubeL(TReal32 aSizeX, TReal32 aSizeY, TReal32 aSizeZ, 
+                                    TReal32 aEdgeRadius) __SOFTFP;
+
+    /**
+     * Creates a sphere mesh.
+     *
+     * @param aRadius
+     * @param aColumns
+     * @param aRows
+     */
+    IMPORT_C virtual void MakeSphereL(TReal32 aRadius, TInt aColumns, TInt aRows) __SOFTFP;
+
+    /** 
+     * Creates a torus mesh.
+     *
+     * @param aMainRadius
+     * @param aOuterRadius
+     * @param aMainSegments
+     * @param aOuterSegments
+     * @param aSegmentAngleOffset
+     */
+    IMPORT_C virtual void MakeTorusL(TReal32 aMainRadius, TReal32 aOuterRadius, 
+                             TInt aMainSegments, TInt aOuterSegments,
+                             TReal32 aSegmentAngleOffset = 0) __SOFTFP;
+    
+    /**
+     * Stretch the mesh uniformly along the X, Y, and Z axes. Negative side
+     * of each axis is offseted negatively. Positive side of each side is 
+     * offseted positively. Normals are not affected.
+     *
+     * @param aXLimit
+     * @param aXOffset
+     * @param aYLimit
+     * @param aYOffset
+     * @param aZLimit
+     * @param aZOffset
+     */
+    IMPORT_C virtual void StretchUniformly(TReal32 aXLimit, TReal32 aXOffset, 
+                                           TReal32 aYLimit, TReal32 aYOffset,
+                                           TReal32 aZLimit, TReal32 aZOffset) __SOFTFP;
+                                
+    /**
+     * Scale the mesh uniformly along each axis. Normals are also scaled and
+     * renormalized.
+     *
+     * @param aX  X scaling factor.
+     * @param aY  Y scaling factor.
+     * @param aZ  Z scaling factor.
+     */                                
+    IMPORT_C virtual void ScaleUniformly(TReal32 aX, TReal32 aY, TReal32 aZ) __SOFTFP;
+
+    /**
+     * Updates the surface material of the mesh.
+     * Generate new texture coordinates based on the angles.
+     *
+     * @param aYaw    Angle around object Y axis.
+     * @param aPitch  Angle around object X axis.
+     */
+    IMPORT_C virtual void UpdateSurface(TReal32 aYaw, TReal32 aPitch) __SOFTFP;
+
+    /**
+     * Draw the mesh.
+     */     
+    IMPORT_C virtual void Draw(CHuiGc& aGc, const THuiImage* aImage = 0, 
+                      const THuiImage* aSecondaryImage = 0,
+                      TReal32 aSecondaryAlpha = 0.0) const __SOFTFP;
+
+    
+protected:  // New methods
+    
+    /**
+     * Provides expandability, helps keeping the binary compatibility. Since virtual
+     * table is now exported and this class is dll derivable and the implementation
+     * is more difficult to change, hence this method, which can provide additional
+     * extension APIs.
+     * 
+     * @param aExtensionUid     UID, which is being used for recognizing the extension
+     * @param aExtensionParams  Return pointer to the extension API, once recognized from the extension uid
+     */
+    IMPORT_C virtual void ProceduralMeshExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+    
+    
+public:
+
+    /** Appearance properties. */
+    THuiMaterial iMaterial;
+
+private:
+
+    /** Spare member to help keeping binary compatibility, since
+        HuiProceduralMesh is now dll derivable **/
+    TInt iSpare;
+    
+    };
+
+#endif // __HUIPROCEDURALMESH_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huiskinanimationtexture.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Texture class to support Legacy theme animation
+*
+*/
+
+
+
+#ifndef __HUISKINANIMATIONTEXTURE__
+#define __HUISKINANIMATIONTEXTURE__
+
+#include <uiacceltk/HuiAnimatedTexture.h>
+#include <uiacceltk/HuiTextureManager.h>
+
+class CHuiSkinBitmapProvider;
+
+/**
+ * @deprecated <b>Trying to create this class will leave with KErrNotSupported!</b>
+ * 
+ * Loads a sequence of images from S60 theme to support animated texture.
+ */    
+NONSHARABLE_CLASS(CHuiSkinAnimationTexture) : public CHuiAnimatedTexture,
+                                public MHuiTextureLoadingCompletedObserver
+    {
+public:
+    // Animation state
+    enum TAnimationState
+        {
+        EInitializing   = 0x1,
+        ERunning        = 0x2,
+        EStopped        = 0x4
+        };
+
+     /**
+     * @deprecated <b>Trying to create this class will leave with KErrNotSupported!</b>
+     * 
+     * Loads a sequence of images and makes it an animated texture.
+     *
+     * @param aSkinName             Logical name of animated element
+     * @param aId                   Id for the texture. Must be unique.
+     * @param aFlags                Specify load/upload behavior
+     *
+     * @return Reference to the texture.
+     *
+     * @see SetImagePathL() To set the image search path. Set to "" to use
+     * absolute image filenames.
+     * @see IsLoaded()
+     */
+    IMPORT_C static CHuiSkinAnimationTexture* NewL(const TDesC& aSkinName,
+                                                      CHuiTextureManager& aManager,
+                                                      TInt aID,
+                                                      THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault);
+    //destructor
+    IMPORT_C ~CHuiSkinAnimationTexture();
+
+    // animation framework callback
+    void AdvanceTime(TReal32 aElapsedTime) __SOFTFP;
+    
+    // Framework callback after load texture complete
+    void TextureLoadingCompleted(CHuiTexture& aTexture,
+                                         TInt aTextureId,
+                                         TInt aErrorCode);
+                                       
+    IMPORT_C TInt Id();
+    
+    /** Start animation, continue refresh from current frame */
+    IMPORT_C void Start();
+    
+    /** Stop animation, stop refresh to current frame */
+    IMPORT_C void Stop();
+
+protected:
+    CHuiSkinAnimationTexture(CHuiTextureManager& aManager,THuiTextureUploadFlags aFlags, TInt aId);
+    void ConstructL(const TDesC& aFilename);
+    void ReplaceTexture(CHuiTexture* aTexture);
+
+private:
+    TInt iCurrentTextureId;
+    TInt iFrameInterval;
+    TInt iFrameCount;
+    
+    TInt iAnimationState; // todo: is this supposed operate based on finary flags or not ?
+    
+    THuiTextureUploadFlags iFlags;
+    TInt iId;
+    TReal32 iElapsedTime;
+    CHuiSkinBitmapProvider* iSkinBitmapProvider;	// Skin Bitmap provider
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huitextureautosizeparams.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,159 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Declares huitextureautosizeparams texture class.
+*
+*/
+
+
+
+#ifndef C_HUITEXTUREAUTOSIZEPARAMS_H
+#define C_HUITEXTUREAUTOSIZEPARAMS_H
+
+#include <e32std.h>
+
+/**
+ * Texture auto size parameters. These can be used to control texture 
+ * resizing when automatic size calculation is enabled. Actual behaviour
+ * of parameters may depend also on the used renderer, e.g. texture
+ * resizing algorithm may be more aggressive in BitGdi than in 
+ * OpenGLES renderer.
+ * 
+ * Example of use 
+ * @code
+ * texture->EnableAutoSizeCalculation();
+ * THuiTextureAutoSizeParams newparams = texture->AutoSizeParams();
+ * newparams.SetSizeLowerThreshold(THuiTextureAutoSizeParams::EHigh);
+ * newparams.SetSizeUpperThreshold(THuiTextureAutoSizeParams::ELow);
+ * texture->SetAutoSizeParams(newparams);
+ * @endcode
+ *
+ */
+NONSHARABLE_CLASS( THuiTextureAutoSizeParams )
+    {
+
+public:
+    
+    enum
+        {
+        EVeryLow = -20,
+        ELow = -10,
+        EMedium = 0,
+        EHigh = 10,
+        EVeryHigh = 20
+        };
+    
+    /**
+     * Constructor.
+     */
+    IMPORT_C THuiTextureAutoSizeParams();
+    
+    /** 
+     * Gets a size threshold which defines how much required size may
+     * decrease before it is considered to be small enough to 
+     * cause texture resizing.
+     *
+     * @return Texture downsize threshold
+     */  
+    IMPORT_C TInt SizeLowerThreshold() const;
+
+    /** 
+     * Sets a size threshold which defines how much required size may
+     * decrease before it is considered to be small enough to 
+     * cause texture resizing.
+     * 
+     * Exmple: Setting value to EVeryLow causes texture to be 
+     * very easily resized to a smaller size if needed. 
+     * 
+     * @param aSizeLowerThreshold Texture downscale threshold
+     */  
+    IMPORT_C void SetSizeLowerThreshold(TInt aSizeLowerThreshold);
+
+    /** 
+     * Gets a size threshold which defines how much required size may
+     * increase before it is considered to be big enough to 
+     * cause texture resizing.
+     *
+     * @return Texture upscale threshold
+     */  
+    IMPORT_C TInt SizeUpperThreshold() const;
+
+    /** 
+     * Sets a size threshold which defines how much required size may
+     * increase before it is considered to be big enough to 
+     * cause texture resizing.
+     *
+     * Exmple: Setting value to EVeryLow causes texture to be 
+     * very easily resized to a larger size if needed. 
+     *
+     * @param aSizeUpperThreshold Texture upscale threshold
+     */  
+    IMPORT_C void SetSizeUpperThreshold(TInt aSizeUpperThreshold);
+
+    /**
+     * Gets the minumum amount of resize. If height or width difference 
+     * between current size and required size is smaller than threshold
+     * specified by this value, resizing is not done 
+     * (except if the current texture size is zero).
+     * @return aMinSizeChange 
+     */
+     IMPORT_C TInt MinSizeChange() const;   
+
+    /**
+     * Sets the minumum amount of resize. If height or width difference 
+     * between current size and required size is smaller than threshold
+     * specified by this value, resizing is not done 
+     * (except if the current texture size is zero).
+     *
+     * Exmple: Setting value to EHigh can be used to prevent unnecessary
+     * size changes if the required size varies often but changes are small.
+     *
+     * @param aMinSizeChange 
+     */
+     IMPORT_C void SetMinSizeChange(TInt aMinSizeChange);   
+
+    /**
+     * Gets size threshold under which relative resizing calculations are
+     * settled to be less aggressive than specified. This is used to avoid unnecessary
+     * resizing when texture size is very small (small pixel changes may be large
+     * relative changes)
+     *
+     * @return Size threshold.
+     */
+    IMPORT_C TInt DownsizeSettleThreshold() const;
+
+    /**
+     * Sets size threshold under which relative resizing calculations are
+     * settled to be less aggressive than specified. This is used to avoid unnecessary
+     * resizing when texture size is very small (small pixel changes may be large
+     * relative changes)
+     *
+     * @param aDownsizeSettlethreshold Size threshold.
+     */
+    IMPORT_C void SetDownsizeSettleThreshold(TInt aDownsizeSettleThreshold);
+     
+
+private:
+    
+    /** Lower size threshold */
+    TInt iSizeLowerThreshold;
+    /** Higher size threshold */
+    TInt iSizeUpperThreshold;
+    /** Min resize amount that makes sense to do */
+    TInt iMinSizeChange;            
+    /** Size when texture is so small that relative lower/upper thresholds are no more followed strictly */
+    TInt iDownsizeSettleThreshold;
+    /** Reserved for future use */
+    TInt iSpare[10];
+    };
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huitk.hrh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* 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: 
+*
+*/
+
+
+enum
+    {
+    EHuiLoFlow,
+    EHuiLoGrid,
+    EHuiLoApp
+    };
+    
+enum
+    {
+    EHuiCtPane,
+    EHuiCtButton,
+    EHuiCtList,
+    EHuiCtGallery
+    };    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huitk.rh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,101 @@
+/*
+* 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: 
+*
+*/
+
+#include <uiacceltk/huitk.hrh>
+
+
+STRUCT BITMAP_LIST
+    {
+    STRUCT bitmaps[];
+    }
+    
+    
+STRUCT BITMAP
+    {
+    LONG id;
+    LTEXT filename;
+    }    
+
+
+STRUCT CONTROL_GROUP
+    {
+    // Add group params here.
+    
+    // Member controls of this group.
+    STRUCT members[];
+    }
+
+
+STRUCT GROUP_MEMBER
+    {
+    WORD type;
+    LONG id = 0;
+    LONG itemflags = 0;
+    LONG role = 0;
+    LONG host = 0;
+    STRUCT control;    
+    }
+    
+    
+STRUCT CT_PANE
+    {
+    WORD layouttype = EHuiLoFlow;
+    STRUCT layout;
+    }
+    
+    
+STRUCT CT_BUTTON
+    {
+    LTEXT text = "";
+    LONG image = 0;
+    }
+    
+    
+STRUCT CT_LIST
+    {
+    }    
+    
+    
+STRUCT CT_GALLERY
+    {
+    }    
+    
+    
+STRUCT LAYOUT_FLOW
+    {
+    WORD outerborder = 0;
+    WORD xborder = 0;
+    WORD yborder = 0;
+    }
+    
+    
+STRUCT LAYOUT_GRID
+    {
+    WORD columns = 1;
+    WORD rows = 1;
+    WORD outerborder = 0;
+    WORD xborder = 0;
+    WORD yborder = 0;
+    }    
+
+
+STRUCT LAYOUT_APP
+    {
+    WORD outerborder = 0;
+    WORD leftwidth = 30;
+    WORD rightwidth = 30;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_core_toolkit_api/inc/uiacceltk/huiviewportlayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,174 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Viewport visual.
+*
+*/
+
+
+
+#ifndef C_HUIVIEWPORTLAYOUT_H
+#define C_HUIVIEWPORTLAYOUT_H
+
+#include <e32base.h>
+#include <uiacceltk/HuiLayout.h>
+
+/* Forward declarations */
+class CHuiEnv;
+
+
+/**
+ * A CHuiViewportLayout is similar to a CHuiDeckLayout, but it can contain
+ * visuals larger than itself. The larger visuals can be scrolled around.
+ *
+ * The viewport visual can be thought of as providing a "window" onto a larger visual.
+ * Different parts of the visual can be viewed by moving the viewport. By default, the
+ * clipping region is enabled.
+ *
+ * To use the viewport visual, you first need to call SetVirtualSize() to define the
+ * coordinate system for the visual. You pass in the work area of the visual, in whatever
+ * units you choose. For example, if you set the virtual work area size to (1.0, 1.0), it
+ * will use a normalised (u, v) coordinate mapping system.
+ *
+ * Next, you can set the dimensions and position of the viewport (or "window") using SetViewportSize()
+ * and SetViewportPos(). This viewport can be moved around the virtual work area. The contents of the
+ * viewport will be fitted to the ViewportVisual.
+ *
+ * Possible uses for CHuiViewportVisual are for text marquee scrolling effects and photo zooming.
+ *
+ * @todo - insert diagram here.
+ * @see CHuiDeckLayout
+ *
+ */
+
+NONSHARABLE_CLASS(CHuiViewportLayout) : public CHuiLayout
+	{
+public:	
+
+    /** @beginAPI */
+    
+    // Bitfield of binary flags.
+	enum TFlags
+		{
+		/** Wrap contents of visual horizontally. */
+		EWrapHorizontal = 0x0001,
+		
+		/** Wrap contents of visual vertically. */
+		EWrapVertical = 0x0002
+		};
+	
+    /* Constructors and destructor. */
+
+    /**
+     * Construct a new viewport layout and give its ownership to a control.
+     *
+     * @param aOwnerControl  Owner control.
+     * @param aParentLayout  Parent layout for the new deck layout.
+     */
+    IMPORT_C static CHuiViewportLayout* AddNewL(CHuiControl& aOwnerControl, 
+                                                CHuiLayout* aParentLayout = 0);
+
+    /** @endAPI */
+
+public:
+
+    /**
+     * Constructor.
+     *
+     * @param aOwner  Owner control.
+     */
+    CHuiViewportLayout(MHuiVisualOwner& aOwner);    // Made public for unit tests.
+
+    void ConstructL();  // Made public for unit tests.
+
+    ~CHuiViewportLayout();  // Made public for unit tests.
+
+public:
+
+    /** @beginAPI */
+
+    /* Methods. */
+
+	/**
+	 * Set virtual size of the viewable area.
+	 *
+	 * This is different from the physical size of the viewport -
+	 * it defines the coordinate space that is used for scrolling.
+	 * To use a normalised (u, v) coordinate mapping system, set aSize to (,1.0, 1.0).
+	 *
+	 * @param aSize The bottom-right corner of the child visual, in the units you wish to use for positioning the viewport.
+	 * @param aTransitionTime The time it will take to complete the resizing of the virtual size.
+	 */
+	IMPORT_C void SetVirtualSize(const THuiRealSize& aSize, TInt aTransitionTime=0);
+
+	/**
+	 * Set size of the viewport area.
+	 *
+	 * This is the size of the "window" we are using to look at the visual.
+	 *
+	 * @param aSize The size of the viewport in the units defined by SetVirtualSize().
+	 * @param aTransitionTime The time it will take to complete the resizing of the viewport area.
+	 * @see SetVirtualSize, SetViewportPos
+	 */
+	IMPORT_C void SetViewportSize(const THuiRealSize& aSize, TInt aTransitionTime=0);
+
+	/**
+	 * Set position of the viewport area.
+	 *
+	 * This is the offset of the "window" we are using to look at the visual.
+	 *
+	 * @param aSize The size of the viewport in the units defined by SetVirtualSize().
+	 * @param aTransitionTime The time it will take to complete moving the viewport area.
+	 * @see SetVirtualSize, SetViewportSize
+	 */
+	IMPORT_C void SetViewportPos(const THuiRealPoint& aSize, TInt aTransitionTime=0);
+
+    /** @endAPI */
+
+    /**
+     * Overridden version of size changing updates the layout of child visuals.
+     *
+     * @param aSize  New size for the layout.
+     * @param aTransitionTime  Time for the transition to new size to take 
+     *                          place.
+     */
+    void SetSize(const THuiRealSize& aSize, TInt aTransitionTime=0);
+
+    TBool ChildSize(TInt aOrdinal, TSize& aSize);
+    
+    TBool ChildPos(TInt aOrdinal, TPoint& aPos);
+
+    TInt ChildRect(TInt aOrdinal, THuiRealRect& aRect);
+    	
+    void GetClassName(TDes& aName) const
+        {
+        aName = _L("CViewportLayout");
+        }
+        
+private: 
+
+    /** The bottom-right corner of the child visual, in the units defined by SetVirtualSize. */
+    THuiRealSize iVirtualSize;
+    
+    /** The top-left corner of the viewport window, relative to te position defined by iVirtualSize. */
+    THuiRealPoint iViewportPos;
+    
+    /** The size of the viewport window, relative to te position defined by iVirtualSize. */
+    THuiRealSize iViewportSize;
+    
+    /** Bitfield of flags to change the way the vieport is rendered. */
+    TInt iWrappingFlags;
+
+	};
+
+#endif // C_HUIVIEWPORTLAYOUT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extended_visual_api/alf_extended_visual_api.metaxml	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="ba1c545f4b34b4bbedc56a071266f5c7" dataversion="1.0">
+  <name>ALF Extended Visual API</name>
+  <description>Domain interfaces of ALF which not to be shared in public sdk, e.g. layout compiler related classes.</description>
+  <type>c++</type>
+  <subsystem>uiacceltk</subsystem>
+  <libs>
+    <lib name="alfclient.lib" />
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extended_visual_api/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 that exports the files belonging to 
+:                ALF Extended Visual API
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/alf/AlfTransEffectPlugin.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/AlfTransEffectPlugin.h)
+../inc/alf/alflcttextvisual.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alflcttextvisual.h)
+../inc/alf/alflctgridlayout.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alflctgridlayout.h)
+../inc/alf/alfsrveffectenv.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfsrveffectenv.h)
+../inc/alf/alflctanchorlayout.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alflctanchorlayout.h)
+../inc/alf/AlfTransEffectPlugin.hrh     MW_LAYER_PLATFORM_EXPORT_PATH(alf/AlfTransEffectPlugin.hrh)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extended_visual_api/inc/alf/AlfTransEffectPlugin.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,237 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Transition effect framework plugin interface
+*
+*/
+
+
+
+
+#ifndef M_ALFTRANSEFFECTPLUGIN_H
+#define M_ALFTRANSEFFECTPLUGIN_H
+
+#include <ecom/ecom.h>
+#include <implementationproxy.h>
+#include <avkondomainpskeys.h>
+#include <alf/AlfTransEffectPlugin.hrh>
+#include "alfuids.h"
+
+class CAlfSrvEffectEnv;
+
+// CONSTANTS
+
+// Common UID that identifies all effect plugins
+const TUid KAlfTransEffectPluginInterfaceUid = {KAlfTransEffectPluginInterfaceUidValue};
+
+const TUid KAlfGfxPluginInterfaceUId = {KAlfGfxPluginInterfaceUIdValue};
+
+// Common string that identifies all effect plugins
+_LIT8( KAlfTransEffectPluginTypeStringDesc, KAlfTransEffectPluginTypeString);
+
+// We define the PubSub keys here for testing purposes.
+// If the system works as intended, we need to create a separate file for the pubsub keys
+
+const TUid KPSAlfDomain = { KAlfAppServerInterfaceUid3 };
+
+/**
+ * Indicates the status of the transition
+ *
+ * 0 transition ongoing
+ * 1 transition finished - reserved windows can be released.
+ */
+const TUint32 KAlfTransitionStatus = 0x00000001; 
+
+
+/**
+ * This interface class is used for a callbacks from the effect plugins.
+ *
+ */
+class MAlfTransEffectObserver
+    {
+	public:
+    	virtual TInt AlfTransEffectCallback(TInt aEvent, TInt aState = 0, const TDesC8* aParams = NULL) = 0;
+	};
+	
+class MAlfGfxEffectPlugin
+    {
+    // Currently this class only contains the enumeration of the operations that are supported
+    // No actual interface at the moment.
+    // All commands are routed via HandleMessageL function
+    public:
+    
+// New enums are added when needed, this is just a list of those that
+// are currently rerouted in new gfxtransenginetfx
+
+// In order to route also the registration commands from tfxsrvplugin that Akn skin server
+// starts, more operations are added.
+
+// The whole message structure is a memory stream to handle varying parameters
+// The operation code defines what parameters will be present.
+
+// It is also possible to get back data, the return data must be a memory stream
+// that has length and some type indicator in the beginning.
+// Different operations may return different kind of data.
+// For example EBeginFullScreen will return error code KErrAbort if full screen effects are disabled.
+
+        enum TOp
+	        {
+	        ENoOp,
+	        // full screen effect operations
+	        EBeginFullscreen,
+	        EEndFullscreen,
+	        EAbortFullscreen,
+	        // control effects
+	        EBeginComponentTransition,
+	        EAbortComponentTransition,
+	        // full screen transition server operations
+	        ERegisterFullScreenEffectFile,
+	        EUnregisterFullScreenEffectFile,
+	        EBlockFullScreenUid,
+	        EUnregisterAllEffects,
+	        // operations coming via CAlfTransitionServerClient
+	        ETfxServerOpAddFullscreenKML,
+	        ETfxServerOpRemoveFullscreenKML,
+	        ETfxServerOpListBoxRegisterKML,
+	        ETfxServerOpListBoxUnregisterKML,
+	        ETfxServerOpListBoxSetFrameTime,
+	        ETfxServerOpListBoxSetMinFrameTime,
+	        ETfxServerOpControlSetFrameTime,
+	        ETfxServerOpControlSetMinFrameTime,
+	        ETfxServerOpBlockFullscreenUid,
+	        ETfxServerOpControlPolicyUpdate,
+	        ETfxServerOpControlPolicyRemove,
+	        ETfxServerOpRegisterControlKml,
+	        ETfxServerOpRegisterControlKmlEx,
+	        ETfxServerOpRemoveAllKml,
+	        ETfxServerOpRemoveControlKml,
+	        ETfxServerOpBeginGroup,
+	        ETfxServerOpEndGroup,
+	        ETfxServerOpSetWantedTime,
+	        ETfxServerOpSetMinTime,
+	        ETfxServerOpAddFullscreenKMLEx,
+	        ETfxServerVerifyConnection,
+	        ETfxServerOpFreeRam,
+	        ETfxServerOpMemoryGood,
+	        // policy update requests
+	        ETfxServerOpControlPolicyRequest,
+	        ETfxServerOpControlPolicyGet,
+	        ETfxServerOpControlCancelPolicyUpdate
+	        };
+     
+    };
+
+/**
+ * This interface class is implmented by plugins for Alf transition effect framework 
+ */
+class MAlfTransEffectPlugin
+	{
+	public:
+
+    	/**
+     	 * Default phase numbers for the effects
+     	 */
+		enum TPhase
+			{
+			EPhaseNone,
+			EFirstPhase,
+			ESecondPhase,
+			};
+
+	    /**
+	     * System effect contexts 
+	     */
+		enum TContext
+			{
+			EContextNone,
+			EContextFocusGained,
+			EContextFocusLost,
+			EContextStart,
+			EContextExit,
+			EContextEmbeddedStart,
+			EContextEmbeddedExit
+			};
+			
+        /**
+         * Types of data that may be returned by CAlfGfxEffects::HandleMessageL
+         * The caller 
+         */		
+	    enum TReturnParameterTypes
+	        {
+	        };
+    
+	public:
+	
+    	/**
+         * Creates the plugin implementation.
+     	 *
+     	 * @param aImplementationUid UID of the effect plugin implementation.
+     	 * @return Plugin implementation.
+     	 */
+ 		static MAlfTransEffectPlugin* NewExtensionL( TUid aImplementationUid );
+
+        /**
+        * Virtual destructor. 
+        * @since 2.8
+        */
+		virtual ~MAlfTransEffectPlugin() { REComSession::DestroyedImplementation (iDtor_ID_Key); };
+		
+    	/**
+         * Get all effect IDs that are supported.
+     	 *
+     	 * @param aSupportedEffectIds Array of supported effect IDs.
+     	 * @return System error code.
+     	 */
+    	virtual TInt GetSupportedEffects( RArray<TInt>& aSupportedEffectIds ) = 0;
+    
+    	/**
+         * Starts a new phase in the effect.
+     	 *
+     	 * @param aPhaseId Phase that is started.
+      	 * @param aEffectId Effect ID.
+     	 * @param aEffectEnv Effect environment for this session.
+     	 * @param aParams Other parameters.
+     	 * @return System error code.
+     	 */
+    	virtual TInt StartPhase( TInt aPhaseId, TInt aEffectId, CAlfSrvEffectEnv& aEffectEnv, const TDesC8* aParams = NULL ) = 0;
+    
+    	/**
+     	 * Not yet implemented
+     	 */
+    	virtual TInt Abort() = 0;
+    
+
+    	/**
+     	 * Not yet implemented
+     	 */
+    	virtual TInt AddEventObserver( MAlfTransEffectObserver* aObserver, TInt aEvents, const TDesC8* aParams = NULL ) = 0;
+    
+    	/**
+     	 * Not yet implemented
+     	 */
+   		virtual TInt RemoveEventObserver( MAlfTransEffectObserver* aObserver, TInt aEvents ) = 0;
+    
+    	/**
+     	 * Not yet implemented
+     	 */
+   		virtual TInt GetEventState( TInt aEvent, TInt* aState, TDes8* aParams = NULL ) = 0;
+    
+
+	public:
+
+		// The ID used by ECom for destroying this dll
+		TUid	iDtor_ID_Key;
+	};
+
+
+#endif // M_ALFTRANSEFFECTPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extended_visual_api/inc/alf/AlfTransEffectPlugin.hrh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Transition effect framework plugin constants 
+*
+*/
+
+
+
+
+#ifndef ALFTRANSEFFECTPLUGIN_HRH
+#define ALFTRANSEFFECTPLUGIN_HRH
+
+// CONSTANTS
+
+// Common UID that identifies all effect plugins
+#define KAlfTransEffectPluginInterfaceUidValue		0x10282CAF
+// Common string that identifies all effect plugins
+#define KAlfTransEffectPluginTypeString				"ALF_TFX_PLUGIN"
+
+#define KAlfGfxPluginInterfaceUIdValue 0x2001E2D0
+#define KAlfGfxPluginTypeString				"ALF_GFX_PLUGIN"
+
+// This constant should be used in source code to check
+// if opaque_data field of ecom plugin registration
+// file has value which identifies a plugin that should not be unloaded
+#define KAlfDoNotUnloadPlugin _L8("effectpluginnotunloaded")
+
+// This constant can be used in Ecom registration file
+// to set opaque_data field correctly.
+// e.g. opaque_data = KAlfDoNotUnloadPluginRss;
+#define KAlfDoNotUnloadPluginRss "effectpluginnotunloaded"
+
+
+#endif // ALFTRANSEFFECTPLUGIN_HRH
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extended_visual_api/inc/alf/alflctanchorlayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Anchor layout definition.
+*
+*/
+
+
+
+#ifndef C_ALFLCTANCHORLAYOUT_H
+#define C_ALFLCTANCHORLAYOUT_H
+
+#include <alf/alfanchorlayout.h> 
+
+class TAknLayoutHierarchyComponentHandle;
+
+/**
+ *  LCT Anchor layout
+ * 
+ * This is a specialised anchor layout, which is aware of the 
+ * avkon LCT layout system. It provides additional APIs
+ * that allow anchors to be set by referring to LCT layout 
+ * components from the Layout Specifcations.
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+class CAlfLCTAnchorLayout : public CAlfAnchorLayout
+    {
+
+public:
+
+    /**
+     * Two-phased constructor, which attach new object into the control.
+     * @param aOwnerControl Control that owns this new obejct.
+     * @param aParentLayout If given, the new object is set as child.
+     */
+    IMPORT_C static CAlfLCTAnchorLayout* AddNewL(CAlfControl& aOwnerControl,
+                                              CAlfLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C CAlfLCTAnchorLayout();
+
+    /**
+     * Second-phase constructor.
+     */
+    IMPORT_C void ConstructL(CAlfControl& aOwner);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C ~CAlfLCTAnchorLayout();
+
+    /**
+     * Defines both anchors for a child.. An anchor is a point within the layout control
+     * that a child control's corner may be attached to. The use of anchors
+     * allows for the neat layout of visuals within the layout control.
+     *     
+     * @param aOrdinal Ordinal of the child that this anchor applies to.
+     * @param aComponentHandle reference to the layout data that corresponds to 
+     *                                                  the visual that is anchored at this ordinal position.
+     * @ param aOffset timed point, note that the position of the timed point will be ignored.
+     */
+    IMPORT_C void SetAnchors(
+        TInt aOrdinal,
+        TAknLayoutHierarchyComponentHandle& aComponentHandle,
+        const TAlfTimedPoint& aOffset);
+
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void RemoveAndDestroyAllD();
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0);
+    IMPORT_C CAlfVisual* FindTag(const TDesC8& aTag);
+    /** 
+     * From CAlfLayout
+     * @see CAlfLayout
+     */
+    IMPORT_C TAlfXYMetric BaseUnit() const; 
+
+
+protected:
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void DoRemoveAndDestroyAllD();
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+
+private:
+
+    struct TLCTAnchorLayoutPrivateData;
+    TLCTAnchorLayoutPrivateData* iLCTAnchorLayoutData;
+    };
+
+
+
+#endif // C_ALFLCTANCHORLAYOUT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extended_visual_api/inc/alf/alflctgridlayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Grid Anchor layout definition.
+*
+*/
+
+
+
+#ifndef C_ALFLCTGRIDLAYOUT_H
+#define C_ALFLCTGRIDLAYOUT_H
+
+#include <alf/alfgridlayout.h> 
+
+class TAknLayoutHierarchyComponentHandle;
+
+/**
+ *  LCT Grid layout
+ * 
+ * This is a specialised anchor layout, which is aware of the 
+ * avkon LCT layout system. It provides additional APIs
+ * that allow grid layouts to be set by referring to LCT layout 
+ * components from the Layout Specifcations.
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+class CAlfLCTGridLayout : public CAlfGridLayout
+    {
+
+public:
+
+    /**
+     * Two-phased constructor, which attach new object into the control.
+     * @param aOwnerControl Control that owns this new obejct.
+     * @param aParentLayout If given, the new object is set as child.
+     */
+    IMPORT_C static CAlfLCTGridLayout* AddNewL(CAlfControl& aOwnerControl,
+                                              CAlfLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C CAlfLCTGridLayout();
+
+    /**
+     * Second-phase constructor.
+     */
+    IMPORT_C void ConstructL(CAlfControl& aOwner);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C ~CAlfLCTGridLayout();
+
+    /**
+     * Sets the rows and columns for the grid.
+     *     
+     * @param aComponentHandle reference to the layout data that corresponds to 
+     *                                                  the grid.
+     * @ param aOffset timed point, note that the position of the timed point will be ignored.
+     */
+    IMPORT_C void SetColsAndRows(
+        TAknLayoutHierarchyComponentHandle& aComponentHandle,
+        const TAlfTimedPoint& aOffset);
+
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void RemoveAndDestroyAllD();
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0);
+    IMPORT_C CAlfVisual* FindTag(const TDesC8& aTag);
+    /** 
+     * From CAlfLayout
+     * @see CAlfLayout
+     */
+    IMPORT_C TAlfXYMetric BaseUnit() const; 
+
+
+protected:
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void DoRemoveAndDestroyAllD();
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+
+    struct TLCTGridLayoutPrivateData;
+    TLCTGridLayoutPrivateData* iLCTGridLayoutData;
+    };
+
+
+
+#endif // C_ALFLCTGRIDLAYOUT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extended_visual_api/inc/alf/alflcttextvisual.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   LCT Text visual
+*
+*/
+
+
+
+#ifndef C_ALFLCTTEXTVISUAL_H
+#define C_ALFLCTTEXTVISUAL_H
+
+class TAknsItemID;
+class TRgb;
+
+#include <alf/alftextvisual.h>
+
+class TAknLayoutHierarchyComponentHandle;
+
+/**
+ *  Text visual for text drawing. Supports setting style from LCT layout data.
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+class CAlfLCTTextVisual : public CAlfTextVisual
+    {
+
+public:
+
+    /**
+     * Constructor, which gives ownership to the control.
+     *
+     * @param aOwnerControl The control
+     * @param aParentLayout If given, the parent layout.
+     * @return New instance. Ownership NOT transreffed (owned by control)
+     */
+    IMPORT_C static CAlfLCTTextVisual* AddNewL(CAlfControl& aOwnerControl,
+                                            CAlfLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C CAlfLCTTextVisual();
+
+    /**
+     * Second-phase constructor.
+     */
+    IMPORT_C void ConstructL(CAlfControl& aOwner);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C ~CAlfLCTTextVisual();
+
+    /**
+     * Sets the text pane layout of the text visual. Note that the actual
+     * text pane position should be called by setting an anchor on the containing layout.
+     *
+     * @param aComponentHandle reference to the layout data that corresponds to the text visual.
+     */
+    IMPORT_C void SetTextPane(TAknLayoutHierarchyComponentHandle& aComponentHandle);
+
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void RemoveAndDestroyAllD();
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0);
+    IMPORT_C CAlfVisual* FindTag(const TDesC8& aTag);
+
+protected:
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void DoRemoveAndDestroyAllD();
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+                           
+private:
+
+    struct TLCTTextVisualPrivateData;
+    TLCTTextVisualPrivateData* iLCTTextVisualData;
+    };
+
+
+#endif // C_ALFLCTTEXTVISUAL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extended_visual_api/inc/alf/alfsrveffectenv.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Environment class for transition effect plugins.
+*
+*/
+
+
+
+#ifndef C_ALFSRVEFFECTENV_H
+#define C_ALFSRVEFFECTENV_H
+
+#include <e32base.h>
+
+class CHuiEnv;
+class CHuiControlGroup;
+class CHuiDisplay;
+class CAlfAppSrvSession;
+
+/**
+ * This class implements an environment that can be utilized inside transition
+ * effect plugins to get access to the UI accelerator toolkit visuals, layouts
+ * and other resources that are needed in transition effects.
+ *
+ */
+NONSHARABLE_CLASS(CAlfSrvEffectEnv) : public CBase
+    {
+public:
+
+    /**
+     * Constructor
+     */
+    static CAlfSrvEffectEnv* NewL(CAlfAppSrvSession& aSession);
+
+    /**
+     * Constructor
+     */
+    static CAlfSrvEffectEnv* NewLC(CAlfAppSrvSession& aSession);
+
+    /**
+     * Destructor
+     */
+    ~CAlfSrvEffectEnv();
+
+    /**
+     * Returns number of available control groups for 
+     * currently active application.
+     *
+     * @return Amount of available control groups.
+     */
+    IMPORT_C TInt ControlGroupCountL();
+
+    /**
+     * Returns number of visible and available control groups
+     * for currently active application.      
+     *
+     * @return Amount of visible and available control groups.
+     */
+    IMPORT_C TInt VisibleControlGroupCountL();
+
+    /**
+     * Returns an available control group based on its index.
+     *
+     * @param aIndex Control group index.
+     * @return Control group
+     */
+    IMPORT_C CHuiControlGroup* ControlGroupL( TInt aIndex );
+    
+    /**
+     * Returns a visible control group based on its index.
+     *
+     * @param aIndex Control group index.
+     * @return Control group
+     */
+    IMPORT_C CHuiControlGroup* VisibleControlGroupL( TInt aIndex );
+
+    /**
+     * Returns number of available displays for 
+     * currently active applicaion.
+     *
+     * @return Amount of available displays.
+     */
+    IMPORT_C TInt DisplayCountL();
+
+    /**
+     * Returns an available display based on its index.
+     *
+     * @param aIndex Display index.
+     * @return Display
+     */
+    IMPORT_C CHuiDisplay* DisplayL( TInt aIndex );
+
+    /**
+     * Returns env which is shared between all client apps.
+     *
+     * @return HUI Env
+     */
+    IMPORT_C CHuiEnv* SharedEnv();
+
+private:
+
+    // Constructor
+    CAlfSrvEffectEnv(CAlfAppSrvSession& aSession);
+    
+    // ConstructL
+    void ConstructL();
+
+private:
+   
+   CAlfAppSrvSession* iSession; // Not owned
+
+};
+
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extension_api/alf_extension_api.metaxml	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,18 @@
+<?xml version="1.0" ?>
+<api id="ada4aeefe474b524d9f85b25048f3fb3" dataversion="1.0">
+  <name>ALF Extension API</name>
+  <description>Plugin interface for ALF extensions running inside alfred server. Only the components running inside server are allowed to access Core Toolkit Interface</description>
+  <type>c++</type>
+  <subsystem>uiacceltk</subsystem>
+  <libs>
+    <lib name="alfappservercore.lib" />
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extension_api/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 that exports the files belonging to 
+:                ALF Extension API
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/alf/alfserverutils.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfserverutils.h)
+../inc/alf/alfred.hrh     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfred.hrh)
+../inc/alf/alfextensionfactory.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfextensionfactory.h)
+../inc/alf/ftokenclient.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/ftokenclient.h)
+../inc/alf/alflayouthandlers.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alflayouthandlers.h)
+../inc/alf/alfvisualhandlers.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfvisualhandlers.h)
+../inc/alf/alfconstants.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfconstants.h)
+../inc/alf/alfbrushhandlers.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfbrushhandlers.h)
+../inc/alf/alfhintplugin.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfhintplugin.h)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extension_api/inc/alf/alfbrushhandlers.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,332 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef C_ALFBRUSHHANDLERS_H
+#define C_ALFBRUSHHANDLERS_H
+
+#include <alf/alfextensionfactory.h>
+#include <AknsConstants.h>
+
+class CHuiBrush;
+class THuiImage;
+struct TAlfMetric;
+struct TAlfXYMetric;
+class TAlfImage;
+
+
+/**
+ *  ?one_line_short_description
+ *
+ *  ?more_complete_description
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+class CAlfBrushHandler : public CBase, public MAlfExtension 
+    {
+    
+protected:
+
+    IMPORT_C CAlfBrushHandler(MAlfInterfaceProvider& aResolver);
+    
+    IMPORT_C void ConstructL( CHuiBrush* aBrush );
+    IMPORT_C ~CAlfBrushHandler();
+
+    /**
+     * From MAlfExtension.
+     */
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);
+
+public:
+    IMPORT_C void SetOwnership(TBool aHolderOwnsBrush);
+
+protected: // new member functions 
+    IMPORT_C virtual void BrushHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+protected: // data
+
+    CHuiBrush* iBrush;
+    MAlfInterfaceProvider& iResolver;
+
+private:
+    TBool iOwnsBrush;
+    TAny* iSpare;    
+    };
+
+
+/**
+ *  ?one_line_short_description
+ *
+ *  ?more_complete_description
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+class CAlfBorderBrushHandler : public CAlfBrushHandler
+    {
+public:
+
+    IMPORT_C static MAlfExtension* NewL( 
+        MAlfInterfaceProvider& aResolver,
+        TAlfXYMetric aThickness, 
+        TAlfXYMetric aEdgeOffset);
+
+    IMPORT_C static MAlfExtension* NewL( 
+        MAlfInterfaceProvider& aResolver,
+        TInt aThicknessWidth, 
+        TInt aThicknessHeight,
+        TInt aEdgeOffsetX, 
+        TInt aEdgeOffsetY );
+        
+    IMPORT_C CAlfBorderBrushHandler(MAlfInterfaceProvider& aResolver);
+
+    IMPORT_C void ConstructL( 
+        CHuiBrush* aBrush,
+        TAlfXYMetric aThickness, 
+        TAlfXYMetric aEdgeOffset);
+    
+    IMPORT_C void ConstructL( 
+        CHuiBrush* aBrush,
+        TInt aThicknessWidth, 
+        TInt aThicknessHeight,
+        TInt aEdgeOffsetX, 
+        TInt aEdgeOffsetY );
+
+protected:
+
+    IMPORT_C ~CAlfBorderBrushHandler();
+
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);
+
+    IMPORT_C void BrushHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+    TAny* iSpare;
+
+    };
+
+
+
+/**
+ *  ?one_line_short_description
+ *
+ *  ?more_complete_description
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+class CAlfImageBrushHandler : public CAlfBrushHandler
+    {
+public:
+
+    IMPORT_C static MAlfExtension* NewL( 
+        MAlfInterfaceProvider& aResolver, THuiImage aImage); 
+        
+    IMPORT_C CAlfImageBrushHandler(MAlfInterfaceProvider& aResolver);
+    
+    IMPORT_C void ConstructL( 
+        CHuiBrush* aBrush, THuiImage aImage); 
+
+protected:
+
+    IMPORT_C ~CAlfImageBrushHandler();
+
+// from base class MAlfExtension
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);
+
+    IMPORT_C void BrushHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+    TAny* iSpare;
+    };
+/**
+ *  ?one_line_short_description
+ *
+ *  ?more_complete_description
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+class CAlfShadowBorderBrushHandler : public CAlfBrushHandler
+    {
+public:
+
+    IMPORT_C static MAlfExtension* NewL( 
+        MAlfInterfaceProvider& aResolver,
+        TInt aWidth );
+
+    IMPORT_C static MAlfExtension* NewL( 
+        MAlfInterfaceProvider& aResolver,
+        TAlfMetric aWidth );
+        
+    IMPORT_C CAlfShadowBorderBrushHandler(MAlfInterfaceProvider& aResolver);
+    
+    IMPORT_C void ConstructL( 
+        CHuiBrush* aBrush,
+        TInt aWidth);
+
+    IMPORT_C void ConstructL( 
+        CHuiBrush* aBrush,
+        TAlfMetric aWidth );
+
+protected:
+
+    IMPORT_C ~CAlfShadowBorderBrushHandler();
+
+// from base class MAlfExtension
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);
+
+    IMPORT_C void BrushHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+    TAny* iSpare;
+    };
+
+/**
+ *  ?one_line_short_description
+ *
+ *  ?more_complete_description
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+class CAlfDropShadowBrushHandler : public CAlfBrushHandler
+    {
+public:
+
+    IMPORT_C static MAlfExtension* NewL( 
+        MAlfInterfaceProvider& aResolver,
+        TAlfMetric aDepth );
+
+    IMPORT_C static MAlfExtension* NewL( 
+        MAlfInterfaceProvider& aResolver,
+        TInt aDepth );
+        
+    IMPORT_C CAlfDropShadowBrushHandler(MAlfInterfaceProvider& aResolver);
+    
+    IMPORT_C void ConstructL( 
+        CHuiBrush* aBrush,
+        TAlfMetric aDepth );
+
+    IMPORT_C void ConstructL( 
+        CHuiBrush* aBrush,
+        TInt aDepth );
+
+protected:
+
+    IMPORT_C ~CAlfDropShadowBrushHandler();
+
+// from base class MAlfExtension
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);
+
+    IMPORT_C void BrushHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+    TAny* iSpare;
+    };
+/**
+ *  ?one_line_short_description
+ *
+ *  ?more_complete_description
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+class CAlfGradientBrushHandler : public CAlfBrushHandler
+    {
+public:
+
+    IMPORT_C static MAlfExtension* NewL( MAlfInterfaceProvider& aResolver );
+    IMPORT_C CAlfGradientBrushHandler(MAlfInterfaceProvider& aResolver);
+    IMPORT_C void ConstructL( CHuiBrush* aBrush );
+
+protected:
+
+    IMPORT_C ~CAlfGradientBrushHandler();
+
+// from base class MAlfExtension
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);
+
+    IMPORT_C void BrushHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+    TAny* iSpare;
+    };
+
+
+/**
+ *  ?one_line_short_description
+ *
+ *  ?more_complete_description
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+class CAlfFrameBrushHandler : public CAlfBrushHandler
+    {
+public:
+
+    IMPORT_C static MAlfExtension* NewL( 
+        MAlfInterfaceProvider& aResolver, const TAknsItemID& aIID, TAlfXYMetric aEdgeOffset); 
+
+    IMPORT_C static MAlfExtension* NewL( 
+        MAlfInterfaceProvider& aResolver, const TAknsItemID& aIID, TInt aEdgeOffsetX, TInt aEdgeOffsetY); 
+
+    IMPORT_C static MAlfExtension* NewL( 
+        MAlfInterfaceProvider& aResolver, const THuiImage& aImage, TAlfXYMetric aEdgeOffset); 
+        
+    IMPORT_C CAlfFrameBrushHandler(MAlfInterfaceProvider& aResolver);
+    
+    IMPORT_C void ConstructL( 
+        CHuiBrush* aBrush, const TAknsItemID& aIID, TInt aEdgeOffsetX, TInt aEdgeOffsetY); 
+
+    IMPORT_C void ConstructL( 
+        CHuiBrush* aBrush, const TAknsItemID& aIID, TAlfXYMetric aEdgeOffset); 
+
+    IMPORT_C void ConstructL( 
+        CHuiBrush* aBrush, const THuiImage& aImage, TAlfXYMetric aEdgeOffset); 
+
+protected:
+
+    IMPORT_C ~CAlfFrameBrushHandler();
+
+// from base class MAlfExtension
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);
+
+    IMPORT_C void BrushHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+    TAny* iSpare;
+    };
+
+#endif // C_ALFBRUSHHANDLERS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extension_api/inc/alf/alfconstants.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1123 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Constant definitions
+*
+*/
+
+
+
+#ifndef ALFCONSTANTS_H
+#define ALFCONSTANTS_H
+
+#include <alf/alfanchorlayout.h> 
+#include <alf/alfgridlayout.h> 
+#include <alf/alftimedvalue.h>
+#include <gdi.h>
+#include <w32std.h>
+#include <AknsItemID.h>
+#include <AknFontSpecification.h> 
+#include <alf/alfmaterial.h>
+#include <alf/alfclientwindow.h>
+
+/**
+ * Service UID which the Alfred Server implements.
+ */
+const TUid KAlfServiceUid = {0x10282847};
+
+/**
+ * HuiEnv action command UID to notify that a new TVOut display has been created.
+ */
+const TUid KHuiActionNewTVOutDisplayUid = {0x2000B5E6};
+
+/**
+ * IPC enums
+ *
+ * When adding new values, please obey the blocks and add new oppcodes at the end of suitable block 
+ * So that existing enumerations do not change.
+ *
+ * When implementing app specifc extension, define your opcodes so that they wont clash with system
+ * enumerations i.e. chooose value above EAlfLastReservedOpCmd
+ */
+enum TAlfredServerIPC
+    {
+    // Env & basic session managenemt 
+    EAlfEnvSetRefreshMode,
+    EAlfEnvSetMaxFrameRate,
+    EAlfEnvContinueRefresh,
+    EAlfEnvPauseRefresh,
+    EAlfEnvRefreshCallBack,
+    EAlfEnvSetIdleThreshold,
+    EAlfEnvRenderer,
+    EAlfGetPointerEvent,
+    EAlfCancelPtrEvents,
+    ESetFullScreenDrawing,
+    EAlfGetSystemEvent,
+    EAlfCancelSystemEvents,
+    EAlfNotifyAppVisibility,
+    EAlfDisplaySubSessionOpen,
+    EAlfControlGroupSubSessionOpen,
+    EAlfTransformationSubSessionOpen,
+    EAlfCreateSubSession,
+    EAlfCloseSubSession,
+    EAlfDoSubSessionCmd,
+    EAlfDoAsyncSubSessionCmd,
+    EAlfSubSCancelAsynchRequest,
+    EAlfSetWgParent,
+    EAlfSBufAddObserver, 
+    EAlfSBufRemoveObserver, 
+    EAlfSBufRequestEvent, 
+    EAlfSBufRequestNextBuffer, 
+    EAlfDisplaySubSessionOpen2, 
+    EAlfDoSubSessionBatchCmd,
+    EAlfConfigureBatchCmd,
+
+    EAlfNotifyTextureInfo,
+    EAlfCancelNotifyTextureInfo,
+    EAlfSBufRequestBufferDraw, 
+
+    // Control
+    EAlfCntrlCreate = 150,
+    
+    // Visual
+    EAlfVisualCreate = 200,
+    EAlfTextVisualCreate,
+    EAlfVisualRemoveAndDestroyAll,
+    EAlfVisualUpdateChildrenLayout,
+    EAlfTextVisualSetText,
+    EAlfTextVisualSetStyle,
+    EAlfTextVisualSetTextStyle,
+    EAlfTextVisualSetEffects,
+    EAlfTextVisualSetAlign,
+    EAlfTextVisualSetLineSpacing,
+    EAlfTextVisualTextExtents,
+    EAlfTextVisualSubstringExtents,
+    EAlfTextVisualStyle,
+    EAlfTextVisualSetMaxLineCount,
+    EAlfTextVisualMaxLineCount,
+    EAlfTextVisualWrapping,
+    EAlfTextVisualSetWrapping,
+    EAlfTextVisualShadowOpacity,  // deprecated
+    EAlfTextVisualSetShadowOpacity, // deprecated    
+    EAlfTextVisualSetColor,
+    EAlfTextVisualEnableShadow,  // deprecated       
+    EAlfVisualSetOpacity,
+    EAlfVisualGetOpacity,
+    EAlfVisualLocalToDisplay,
+    EAlfVisualDisplayToLocal,
+    EAlfVisualDisplayRectTarget,
+    EAlfVisualPos,
+    EAlfVisualSetPos,
+    EAlfVisualMoveToFront,
+    EAlfVisualSize,
+    EAlfVisualSetSize,
+    EAlfVisualBrushArrayReset,
+    EAlfVisualBrushArrayAppend,
+    EAlfVisualBrushArrayInsert,
+    EAlfVisualBrushArrayRemove,
+    EAlfVisualSetFlag,
+    EAlfVisualSetFlags,
+    EAlfVisualClearFlag,
+    EAlfVisualClearFlags,
+    EAlfVisualFlags,
+    EAlfVisualSetPaddingInt,
+    EAlfVisualSetPaddingPoint,
+    EAlfVisualSetPaddingBox,
+    EAlfVisualPaddingInPixels,
+    EAlfVisualEnableTransformation,
+    EAlfVisualDepthOffset,
+    EAlfVisualSetDepthOffset,
+    EAlfVisualSetMinSize,
+    EAlfVisualSetMaxSize,
+    EAlfVisualDisplayRect,
+    EAlfVisualEffectiveOpacity,
+    EAlfVisualSetPosTimed,
+    EAlfVisualSetSizeTimed,
+    EAlfVisualLayoutUpdatedNotification,
+    EAlfVisualLayoutUpdatedNotificationCancel,
+    EAlfVisualCopyValuesFromOtherVisual,
+    EAlfVisualSetMinSizeInBaseUnits,
+    EAlfVisualGetMinSize,
+    EAlfVisualGetMinSizeInBaseUnits,
+    EAlfVisualSetMaxSizeInBaseUnits,
+    EAlfVisualGetMaxSize,
+    EAlfVisualGetMaxSizeInBaseUnits,
+    EAlfVisualMove,
+    EAlfVisualSetCenteredPosAndSize,
+    EAlfVisualSetTactileFeedback,
+    EAlfVisualHasTactileFeedback,
+    EAlfVisualRemoveTactileFeedback,
+    EAlfVisualPauseProperties,
+    EAlfVisualResumeProperties,
+    EAlfVisualEnableDropShadow,
+    
+    EAlfTextVisualSetOffset,         
+    EAlfTextVisualOffset,         
+    
+	EAlfTextVisualSetHighlightRange,             
+	
+    // hip hop, slightly wrong context for these two but moving would break bc
+    EAlfVisualSetEffect,
+    EAlfVisualSetGroupEffect,
+    EAlfVisualRemoveEffect,
+    
+    EAlfTextVisualSetRasterizedMesh,
+    
+    EAlfQtCommandBuffer = 450,
+    EAlfDirectClientFPSCounterOn,
+    EAlfDirectClientFPSCounterOff,
+    
+    // LCT Text Visual
+    EAlfLCTTextVisualCreate = 500,
+    EAlfLCTTextVisualSetTextPane,
+
+    // Line visual
+    EAlfLineVisualCreate = 600,
+    EAlfLineVisualSetPath,
+    EAlfLineVisualSetImage,
+    EAlfLineVisualSetAlphaFunction,
+    EAlfLineVisualSetWidthFunction,
+    EAlfLineVisualGetThickness,
+    EAlfLineVisualSetThickness,
+    EAlfLineVisualGetShadowThickness,
+    EAlfLineVisualSetShadowThickness,
+    EAlfLineVisualGetStartPos,
+    EAlfLineVisualSetStartPos,
+    EAlfLineVisualGetEndPos,
+    EAlfLineVisualSetEndPos,
+    EAlfLineVisualSetColor,
+
+    // Image visual
+    EAlfImageVisualCreate = 700,
+    EAlfImageVisualSetImage,
+    EAlfImageVisualSetScaleMode,
+    EAlfImageVisualSetSecondaryImage,
+    EAlfImageVisualSetSecondaryAlpha,
+    EAlfImageVisualSecondaryAlpha,
+    EAlfImageVisualSetColor,
+    EAlfImageVisualSetColorMode,
+    EAlfImageVisualSetStretch,
+    EAlfImageVisualSetStretchMode,
+    EAlfImageVisualSetDropShadow, // deprecated
+    EAlfImageVisualSetTurnAngle,
+    EAlfImageVisualTurnAngle,
+    EAlfImageVisualSetScale,
+    EAlfImageVisualScale,
+    EAlfImageVisualSetOffset,
+    EAlfImageVisualOffset,
+    EAlfImageVisualSetDropShadowMetric, // deprecated
+    
+    // Mesh visual
+    EAlfMeshVisualCreate = 800,
+    EAlfMeshVisualCreateMesh,
+    EAlfMeshVisualSetImage,
+    EAlfMeshVisualSetSecondaryImage,
+    EAlfMeshVisualSetSpecularImage,
+    EAlfMeshVisualSecondaryAlpha,
+    EAlfMeshVisualSetSecondaryAlpha,
+    EAlfMeshVisualYawAngle,
+    EAlfMeshVisualSetYawAngle,
+    EAlfMeshVisualPitchAngle,
+    EAlfMeshVisualSetPitchAngle,
+    EAlfMeshVisualScale,
+    EAlfMeshVisualSetScale,
+    EAlfMeshReset,
+    EAlfMeshMakeCube,
+    EAlfMeshMakeSphere,
+    EAlfMeshMakeTorus,
+    EAlfMeshStretchUniformly,
+    EAlfMeshScaleUniformly,
+    EAlfMeshAnimationControllerCount,
+    EAlfMeshSetAnimationPosition,
+    EAlfMeshStartAnimationController,
+    EAlfMeshStopAnimationController,
+    EAlfMeshMaterial,
+    EAlfMeshSetMaterial,
+    EAlfMeshLoadM3GScene,
+
+    // canvas visual
+    EAlfCanvasVisualCreate  = 900,
+    EAlfCanvasVisualSendbuffer,
+
+    // Layout
+    EAlfLayoutCreate = 1000,
+    EAlfLayoutAppendVisual,
+    EAlfLayoutRemoveVisual, 
+    EAlfLayoutVisualFromIndex,
+    EAlfLayoutEnableScrolling,
+    EAlfLayoutScrollOffset,
+    EAlfLayoutSetScrollOffset,
+    EAlfLayoutChildOrdinal,
+    EAlfLayoutChildPos,
+    EAlfLayoutChildSize,
+    EAlfLayoutReorderVisual,
+    EAlfLayoutSetTransitionTime,
+    EAlfLayoutSetInnerPaddingPoint,
+    EAlfLayoutSetInnerPaddingMetric,
+    EAlfLayoutInnerPaddingInBaseUnits,
+    EAlfLayoutVirtualSize,
+    EAlfLayoutSetBaseUnit,
+    EAlfLayoutSetBaseUnitXY,
+    EAlfLayoutBaseUnit,
+    EAlfLayoutSetLayoutModeFlags,
+    EAlfLayoutLayoutModeFlags,
+    EAlfLayoutClearLayoutModeFlags,
+    
+    // Anchor layout
+    EAlfAnchorLayoutCreate = 1100,
+    EAlfAnchorLayoutReset,
+    EAlfAnchorLayoutSetAnchor,
+    EAlfAnchorLayoutSetRelativeAnchorRect,
+    EAlfAnchorLayoutRemoveAnchor,
+    EAlfAnchorLayoutAttachEdge,
+    EAlfAnchorLayoutAttachCorner,
+    EAlfAnchorLayoutAttachBox,
+    EAlfAnchorLayoutDetachAll,
+    EAlfAnchorLayoutDetach,
+
+    // LCT Anchor Layout
+    EAlfLCTAnchorLayoutCreate = 1200,
+    EAlfLCTAnchorLayoutSetAnchors,
+
+    // Grid layout
+    EAlfGridLayoutCreate = 1300,
+    EAlfGridLayoutSetColumns,
+    EAlfGridLayoutSetRows,
+    EAlfGridLayoutSetColumnWeights,
+    EAlfGridLayoutSetRowsWeights,
+    EAlfGridLayoutSetExpanding,
+    EAlfGridLayoutOrdinalToBlock,
+    EAlfGridLayoutColumnCount,
+    EAlfGridLayoutRowCount,
+    EAlfGridLayoutFillWeights,
+    EAlfGridLayoutAppendWeight,
+    EAlfGridLayoutInsertWeight,
+    EAlfGridLayoutReplaceWeight,
+    EAlfGridLayoutRemoveWeight,
+    EAlfGridLayoutWeight,
+    EAlfGridLayoutCount,
+    EAlfGridLayoutSetLayoutModeFlags,
+    EAlfGridLayoutLayoutModeFlags,
+    EAlfGridLayoutClearLayoutModeFlags,
+    
+    // LCT Grid Layout
+    EAlfLCTGridLayoutCreate = 1400,
+    EAlfLCTGridLayoutSetColsAndRows,
+    
+    // Deck layout
+    EAlfDeckLayoutCreate = 1500,
+    
+    // Flow layout
+    EAlfFlowLayoutCreate = 1600,
+    EAlfFlowLayoutSetFlowDirection,
+    EAlfFlowLayoutSetCentering,
+    EAlfFlowLayoutSetMode,
+    
+    // Curve path layout
+    EAlfCurvePathLayoutCreate = 1700,
+    EAlfCurvePathLayoutMapValue,
+    
+    // Viewport layout
+    EAlfViewportLayoutCreate = 1800,
+    EAlfViewportLayoutSetVirtualSize,
+    EAlfViewportLayoutSetViewportSize,
+    EAlfViewportLayoutSetViewportPos,
+    
+    // Roster
+    EAlfRosterShow = 2000,
+    EAlfRosterHide,
+    EAlfRosterShowVisual,
+    EAlfRosterHideVisual,
+    EAlfRosterMoveVisualToFront,
+    EAlfRosterSetPointerEventFlags,
+    EAlfRosterAddPointerEventObserver,
+    EAlfRosterRemovePointerEventObserver,
+	EAlfRosterSetPointerDragTreshold,
+	EAlfRosterDisableLongTapEventsWhenDragging,
+	
+    // Texture 
+    EAlfTextureCreateAnimated = 2100,
+    EAlfTextureStopAnimation,
+    EAlfTextureStartAnimation,
+    EAlfTextureCreate,
+    EAlfTextureLoad,
+    EAlfTextureUnload,
+    EAlfTextureBlur,
+    EAlfTextureHasContent,
+    EAlfTextureDelete,
+    EAlfTextureRelease,
+    EAlfTextureRestore,
+    EAlfTextureNotifySkinChanged,
+    EAlfTextureUpdateOwnerId,
+    EAlfTextureSetAutoSizeParams,
+        
+    // Display subsession functions
+    EAlfDisplaySetClearBackground =2200,
+    EAlfDisplaySetVisibleArea,
+    EAlfDisplayForceSetVisibleArea,
+    EAlfDisplayVisibleArea,
+    EAlfDisplaySubSessionClose,
+    EAlfDisplaySetDirty,
+    EAlfDisplaySetQuality,
+    EAlfDisplayQuality,
+    EAlfDisplaySetUseDepth,
+    EAlfDisplaySetUsage,
+    EAlfDisplaySetBackgroundItems,
+    EAlfDisplayHandlePointerEvent,
+    EAlfDisplaySuppressAutomaticFading,
+    EAlfDisplaySetClientWindowForDrawing,
+    
+    // Control group subsession functions
+    EAlfControlGroupAppend = 2300,
+    EAlfControlGroupRemove,
+    EAlfControlGroupEnableTransformation,
+    EAlfControlGroupSubSessionClose,
+    
+    // Brush
+    EAlfBrushSetOpacity = 2500,
+    EAlfBrushGetOpacity,
+    EAlfBrushSetLayer,
+    EAlfBorderBrushCreate,
+    EAlfBorderBrushSetImage,
+    EAlfBorderBrushSetColor,
+    EAlfBorderBrushSetThickness,
+    EAlfBorderBrushGetThickness,
+    EAlfBorderBrushSetEdgeOffset,
+    EAlfBorderBrushGetEdgeOffset,
+    EAlfBorderBrushSetImageOffset,
+    EAlfBorderBrushGetImageOffset,
+    EAlfBorderBrushCreateMetric,
+    EAlfBorderBrushSetThicknessMetric,
+    EAlfBorderBrushSetEdgeOffsetMetric,
+    EAlfBorderBrushSetImageOffsetMetric,
+    EAlfBrushSetClipToVisual,
+    EAlfBrushClipToVisual,
+    
+    // image brush
+    EAlfImageBrushCreate = 2600,
+    EAlfImageBrushSetBorders,
+    EAlfImageBrushSetImage,
+    EAlfImageBrushSetScaleMode,
+    EAlfImageBrushSetScale,
+    EAlfImageBrushScale,
+    EAlfImageBrushSetOffset,
+    EAlfImageBrushOffset,    
+    
+    // shadow border brush
+    EAlfShadowBorderBrushCreate = 2700,
+    EAlfShadowBorderBrushGetWidth,
+    EAlfShadowBorderBrushSetWidth,
+    EAlfShadowBorderBrushCreateMetric,
+    EAlfShadowBorderBrushGetWidthMetric,
+    EAlfShadowBorderBrushSetWidthMetric,
+    
+    // drop shadow brush
+    EAlfDropShadowBrushCreate = 2800,
+    EAlfDropShadowBrushGetSoftness,
+    EAlfDropShadowBrushSetSoftness,
+    EAlfDropShadowBrushGetDepth,
+    EAlfDropShadowBrushSetDepth,
+    EAlfDropShadowBrushCreateMetric,
+    EAlfDropShadowBrushSetDepthMetric,
+    EAlfDropShadowBrushSetSoftnessMetric,
+    EAlfDropShadowBrushSetColor,
+
+    
+    // gradient brush
+    EAlfGradientBrushCreate = 2900,
+    EAlfGradientBrushSetDirection,
+    EAlfGradientBrushSetColor,
+    EAlfGradientBrushSetImage,
+    EAlfGradientBrushColor,
+    EAlfGradientBrushOpacity,
+    EAlfGradientBrushAppendColor,
+    
+    // Frame brush
+    EAlfFrameBrushCreate = 3000,
+    EAlfFrameBrushSetFrameRects,
+    EAlfFrameBrushCreateMetric,
+    EAlfFrameBrushSetEdgeOffsetMetric,
+    EAlfFrameBrushCreateImage,
+    EAlfFrameBrushSetImage,
+    EAlfFrameBrushSetFramePartImage,
+    
+    // Transformation subsession functions
+    EAlfTransformationLoadIdentity = 3300,
+    EAlfTransformationTranslate,
+    EAlfTransformationRotate,
+    EAlfTransformationSubSessionClose,
+    EAlfTransformationCount,
+    EAlfTransformationNonIdentityCount,
+    EAlfTransformationStep,
+    EAlfTransformationReplaceStep,
+    EAlfTransformationRotate3D,
+    EAlfTransformationTranslate2D,
+    EAlfTransformationScale,
+       
+    // mapping functions
+    EAlfMappingFunctionAverageCreate = 3500,
+    EAlfMappingFunctionMapValue,
+    EAlfAverageMappingFunctionSetFunction1,
+    EAlfAverageMappingFunctionSetFunction2,
+    EAlfAverageMappingFunctionSetFunctions,
+    EAlfAverageMappingFunctionSetWeight,
+    EAlfMappingFunctionConstantCreate,
+    EAlfConstantMappingFunctionSetValue,
+    EAlfMappingFunctionLinearCreate,
+    EAlfLinearMappingFunctionSetFactor,
+    EAlfLinearMappingFunctionSetOffset,
+    EAlfMappingFunctionSineCreate,
+    EAlfSineMappingFunctionSetFactor,
+    EAlfSineMappingFunctionSetOffset,
+    EAlfMappingFunctionCosineCreate,
+    EAlfCosineMappingFunctionSetFactor,
+    EAlfCosineMappingFunctionSetOffset,
+    EAlfMappingFunctionTableCreate, 
+    EAlfMappingFunctionTableSetValues, 
+    
+    // curve path
+    EAlfCurvePathCreate = 3700,
+    EAlfCurvePathReset,
+    EAlfCurvePathEnableLoop,
+    EAlfCurvePathLoop,
+    EAlfCurvePathSetOrigin,
+    EAlfCurvePathAppendLine,
+    EAlfCurvePathAppendArc,
+    EAlfCurvePathLength,
+    EAlfCurvePathEvaluate,
+    EAlfCurvePathOffset,
+    EAlfCurvePathSetOffset,
+    EAlfCurvePathMapValue,
+    EAlfCurvePathAppendLine2,
+    EAlfCurvePathAppendArc2,
+
+    // text styles
+    EAlfPlatformTextStyleCreate = 3900,
+    EAlfPreconfiguredTextStyleCreate,
+    EAlfPlatformTextStyleCopy,
+    EAlfTextStyleSetParent,
+    EAlfTextStyleTextColor,
+    EAlfTextStyleSizeInTwips,
+    EAlfTextStyleSizeInPixels,
+    EAlfTextStyleIsBold,
+    EAlfTextStyleIsItalic,
+    EAlfTextStyleIsUnderline,
+    EAlfTextStyleIsStrikeThrough,
+    EAlfTextStyleSetTextColor,
+    EAlfTextStyleSetTextSizeInTwips,
+    EAlfTextStyleSetTextSizeInPixels,
+    EAlfTextStyleSetBold,
+    EAlfTextStyleSetItalic,
+    EAlfTextStyleSetUnderline,
+    EAlfTextStyleSetStrikeThrough,
+    EAlfTextStyleGetTypeface,
+    EAlfTextStyleSetTextPaneHeightInPixels,
+    EAlfTextStyleServerHandle,
+
+    // Layout metrics
+    EAlfLayoutMetricsTextStyleData = 4100,
+    
+    // Drop shadow handler
+    EAlfDropShadowSetOffsetInPolar = 4200,
+    EAlfDropShadowSetOffsetInXY,
+    EAlfDropShadowSetColorRgb,
+    EAlfDropShadowSetColorSkin,
+    EAlfDropShadowSetOpacity,
+    EAlfDropShadowSetBlurRadius,
+    EAlfDropShadowSetScale,
+
+    EAlfEnableLowMemoryState = 4300,
+    EAlfForceSwRendering,
+    
+    EAlfLastReservedOpCmd = 10000
+    };
+    
+struct TAlfLayoutSetAnchorParams
+    {
+    TAlfAnchor iAnchor;
+    TInt iOrdinal;
+    TAlfAnchorOrigin iHorizOrigin;
+    TAlfAnchorOrigin iVertOrigin;
+    TAlfAnchorMetric iHorizMetric;
+    TAlfAnchorMetric iVertMetric;
+    TAlfTimedPoint iOffset;
+    };
+    
+struct TAlfLayoutSetRelativeAnchorRectParams
+    {
+    TInt iOrdinal;
+    TAlfAnchorOrigin iTlHorizOrigin;
+    TAlfAnchorOrigin iTlVertOrigin;
+    TAlfRealPoint iTopLeftOffset;
+    TAlfAnchorOrigin iBrHorizOrigin;
+    TAlfAnchorOrigin iBrVertOrigin;
+    TAlfRealPoint iBottomRightOffset;
+    };
+
+struct TAlfLayoutAttachEdgeParams
+    {
+    TInt iOrdinal;
+    TAlfAnchorType iType;
+    TAlfMetric iOffset;
+    TAlfAnchorAttachmentOrigin iAttachmentOrigin;
+    TInt iAttachmentOrdinal;
+    };
+
+struct TAlfLayoutAttachCornerParams
+    {
+    TInt iOrdinal;
+    TAlfAnchorType iType;
+    TAlfXYMetric iOffset;
+    TAlfAnchorAttachmentOrigin iAttachmentOrigin;
+    TInt iAttachmentOrdinal;
+    };
+
+struct TAlfLayoutAttachBoxParams
+    {
+    TInt iOrdinal;
+    TAlfBoxMetric iOffset;
+    TAlfAnchorAttachmentOrigin iAttachmentOrigin;
+    TInt iAttachmentOrdinal;
+    };
+
+struct TAlfLCTAnchorSetAnchorsParams
+    {
+    TInt iOrdinal;
+    TInt iApiId;
+    TInt iComponentId;
+    TInt iOptionIndex;
+    TInt iDrawingOrderIndex;
+    TInt iVarietyIndex;
+    TInt iColumn;
+    TInt iRow;
+    TAlfTimedPoint iOffset;
+    };
+
+struct TAlfLCTGridSetColsAndRowsParams
+    {
+    TInt iOrdinal;
+    TInt iApiId;
+    TInt iComponentId;
+    TInt iOptionIndex;
+    TInt iDrawingOrderIndex;
+    TInt iVarietyIndex;
+    TInt iColumn;
+    TInt iRow;
+    TAlfTimedPoint iOffset;
+    };
+
+struct TAlfCreateBorderBrushParams
+    {
+    TInt iThicknessWidth; 
+    TInt iThicknessHeight;
+    TInt iEdgeOffsetX;
+    TInt iEdgeOffsetY;
+    };
+
+struct TAlfCreateBorderBrushMetricParams
+    {
+    TAlfXYMetric iThickness; 
+    TAlfXYMetric iEdgeOffset;
+    };
+
+struct TAlfFrameBrushParams
+    {
+    TAknsItemID iFrameIID;
+    TRect iInnerRect;
+    TRect iOuterRect;
+    TInt iEdgeOffsetX;
+    TInt iEdgeOffsetY;
+    };
+
+struct TAlfFrameBrushMetricParams
+    {
+    TAknsItemID iFrameIID;
+    TRect iInnerRect;
+    TRect iOuterRect;
+    TAlfXYMetric iEdgeOffset;
+    };
+
+struct TAlfImageBrushParams
+    {
+    TInt iTextureHandle;
+    TAlfTimedPoint iTl;
+    TAlfTimedPoint iBr;
+    TInt iLeftBorderWidth;
+    TInt iRightBorderWidth;
+    TInt iTopBorderWidth;
+    TInt iBottomBorderWidth;         
+    };
+    
+struct TAlfGradientBrushSetColorParams
+    {
+    TRgb iColor;
+    TReal32 iOpacity;
+    };
+    
+struct TAlfGradientBrushAppendColorParams
+    {
+    TReal32 iPosition;
+    TRgb iColor;
+    TReal32 iOpacity;
+    };
+
+struct TAlfCreateTextureAnimatedParams
+    {
+    TInt iId; 
+    TInt iBitmapHandle;
+    TInt iMaskBitmapHandle;
+    TInt iFlags;
+    TInt iManagerId;
+    TFileName iFilename;
+    };
+
+struct TAlfCreateTextureParams
+    {
+    TInt iId; 
+    TInt iBitmapHandle;
+    TInt iMaskBitmapHandle;
+    TInt iFlags;
+    TInt iManagerId;
+    };
+
+struct TAlfLoadTextureParams
+    {
+    TInt iId; 
+    TInt iBitmapHandle;
+    TInt iMaskBitmapHandle;
+    TInt iFlags;
+    TInt iManagerId;
+    };
+    
+struct TAlfBlurTextureParams
+    {
+    TInt iServerSideSrcHandle;
+    TInt iServerSideDstHandle;
+    TInt iManagerId;
+    TSize iPreferredSize;     
+    TInt iFilterSize;
+    TInt iFlag;        
+    };
+    
+struct TAlfImageParams
+    {
+    TAlfImageParams():iTextureHandle(0){}
+    TAlfImageParams(const TAlfImage& aImage)
+        : iTextureHandle( aImage.HasTexture() ? aImage.Texture().ServerHandle() : 0 ),
+          iTl(aImage.TimedTopLeft()),
+          iBr(aImage.TimedBottomRight()) {}
+    TInt iTextureHandle;
+    TAlfTimedPoint iTl;
+    TAlfTimedPoint iBr;
+    };
+    
+struct TAlfMeshLoadM3GSceneParams
+    {
+    TFileName iFilename;
+    };    
+
+struct TAlfMeshAnimationPositionParams
+	{
+	TInt iControllerId;
+	TReal32 iTarget;
+	TInt iTime;
+	};
+    
+struct TAlfMaterialParams
+    {
+    TAlfMaterialPreset iPreset;
+    TRgb iColor;
+    TAlfImageParams iTextureImage;
+    TAlfImageParams iSpecularImage;
+    TAlfTimedValue iSpecular;
+    };
+
+struct TAlfPointerEventDragTreshold
+	{
+	TInt iControlHandle;
+	TAlfXYMetric iXYMetric;
+	TInt iDisplayHandle;
+	};
+    
+/**
+ * @deprecated 
+ */
+struct TAlfCurvePathLineParams
+    {
+    TPoint iStart;
+    TPoint iEnd;
+    TReal32 iLength;
+    };
+    
+struct TAlfCurvePathLineRealParams
+    {
+    TAlfRealPoint iStart;
+    TAlfRealPoint iEnd;
+    TReal32 iLength;
+    };
+    
+/**
+ * @deprecated 
+ */
+struct TAlfCurvePathArcParams
+    {
+    TPoint iOrigin;
+    TSize iSize;
+    TReal32 iStartAngle;
+    TReal32 iEndAngle;
+    TReal32 iLength;
+    };
+
+struct TAlfCurvePathArcRealParams
+    {
+    TAlfRealPoint iOrigin;
+    TAlfRealSize iSize;
+    TReal32 iStartAngle;
+    TReal32 iEndAngle;
+    TReal32 iLength;
+    };
+
+
+struct TAlfTransformationRotateParams
+    {
+    TAlfTimedValue iAngle;
+    TReal32 iAxisX;
+    TReal32 iAxisY;
+    TReal32 iAxisZ;
+    };
+
+struct TAlfTransformationTimedParams
+    {
+    TAlfTimedValue iX;
+    TAlfTimedValue iY;
+    TAlfTimedValue iZ;
+    };
+
+const TInt KAlfTableMappingNumberOfMappedValues = 100;
+struct TAlfTableMappingFunctionParams
+    {
+    TInt iComponent;
+    TReal32 iValues[KAlfTableMappingNumberOfMappedValues];
+    TReal32 iMappedValues[KAlfTableMappingNumberOfMappedValues];
+    };
+
+struct TAlfTextVisualFontColorParams
+    {
+    TRgb iColor; // If iId is KAknsIIDNone only then iColor is valid     
+    TAknsItemID iId; 
+    TInt iIndex;     
+    };
+    
+struct TAlfTextVisualSetHighlightRangeParams
+    {
+    TInt    iStart;
+    TInt 	iEnd;
+    TRgb	iHighlightColor;
+	TRgb	iHighlightTextColor;    
+    };    
+
+struct TAlfLCTTextVisualSetTextPaneParams
+    {
+    TInt iApiId;
+    TInt iComponentId;
+    TInt iOptionIndex;
+    TInt iDrawingOrderIndex;
+    TInt iVarietyIndex;
+    TInt iColumn;
+    TInt iRow;
+    };
+
+struct TAlfDisplayCreateParams
+    {
+    TInt iWindowGroupId;
+    TInt iDisplayType;
+    };
+
+struct TAlfDisplayCreateParams2
+    {
+    TInt iWindowGroupId;
+    TInt iDisplayType;
+    TUid iBufferUid;
+    };
+
+struct TAlfGridLayoutFillWeightsParams
+    {
+    TAlfGridDimension iDim;
+    TInt iCount;
+    TAlfMetric iWeight;
+    };
+
+struct TAlfGridLayoutAppendWeightParams
+    {
+    TAlfGridDimension iDim;
+    TAlfMetric iWeight;
+    };
+    
+struct TAlfGridLayoutInsertWeightParams
+    {
+    TAlfGridDimension iDim;
+    TAlfMetric iWeight;
+    TInt iPos;
+    };
+    
+struct TAlfGridLayoutReplaceWeightParams
+    {
+    TAlfGridDimension iDim;
+    TAlfMetric iWeight;
+    TInt iPos;
+    };
+    
+struct TAlfGridLayoutRemoveWeightParams
+    {
+    TAlfGridDimension iDim;
+    TInt iPos;
+    };
+    
+struct TAlfGridLayoutWeightParams
+    {
+    TAlfGridDimension iDim;
+    TInt iPos;
+    };
+    
+    
+// todo: should rather use streaming
+struct TInt2
+    {
+    TInt2(TInt a1, TInt a2):iInt1(a1),iInt2(a2){}
+    TInt iInt1;
+    TInt iInt2;
+    };
+    
+struct TInt3
+    {
+    TInt3(TInt a1, TInt a2, TInt a3):iInt1(a1),iInt2(a2),iInt3(a3){}
+    TInt iInt1;
+    TInt iInt2;
+    TInt iInt3;
+    };
+
+struct TReal2
+    {
+    TReal2(TReal32 a1, TReal32 a2):iReal1(a1),iReal2(a2){}
+    TReal32 iReal1;
+    TReal32 iReal2;
+    };
+
+struct TIntTReal
+    {
+    TIntTReal(TInt a1, TReal32 a2):iInt(a1),iReal(a2){}
+    TInt iInt;
+    TReal32 iReal;    
+    };
+
+struct TAlfImplementationInformation
+    {
+    TAlfImplementationInformation(TInt aId = 0, TInt aImplUid = 0, TVersion aVersion = TVersion(0,0,0))
+        :iImplementationUid(aImplUid),iImplementationId(aId), iVersion(aVersion){}
+    TInt iImplementationUid;
+    TInt iImplementationId;
+    TVersion iVersion;
+    };
+
+struct TAlfVisualPos
+    {
+    TAlfRealPoint iPoint;
+    TInt iTime;
+    };
+
+struct TAlfVisualSize
+    {
+    TAlfRealSize iSize;
+    TInt iTime;
+    };
+
+struct TAlfVisualPosSize
+    {
+    TAlfRealPoint iPoint;
+    TAlfRealSize iSize;
+    TInt iTime;
+    };
+
+struct TAlfPosInt
+    {
+    TPoint iPoint;
+    TInt iInt;    
+    };
+
+struct TAlfSizeInt
+    {
+    TSize iSize;
+    TInt iInt;
+    };
+
+const TInt KAlfTouchEventControlCount = 10;
+
+struct TAlfTouchEvent
+    {
+    TAdvancedPointerEvent iEvent;
+    TInt iControls[KAlfTouchEventControlCount]; // @todo, is it ok to make assumptions, about max amount of controls in client  
+    TInt iVisuals[KAlfTouchEventControlCount]; // @todo, same as above
+    };
+  
+struct TAlfBackBufferUpdate
+    {
+    TUid iCommandUid;
+    TUid iBackBufferUid;
+    };
+    
+enum TAlfScreenBufferEventId
+	{
+	EAlfScreenBufferBufferComplete = 0,
+	EAlfScreenBufferEvent = 1,
+	};
+	
+struct TAlfScreenBufferEvent
+    {
+    // in
+    TUid iBufferUid;
+    // out
+    TInt iEventId;
+    TRect iDisplayRect;
+    TRect iDirtyRect;
+    };
+    
+struct TAlfScreenBufferBitmaps
+    {
+    // in
+    TUid iBufferUid;
+    TInt iPriority;
+    TInt iFlags;
+    // out
+    TInt iBitmapHandle;
+    TInt iMaskHandle;
+    };
+
+struct TAlfTextureInfoEvent
+    {
+    TInt iTextureId;
+    TSize iTextureSize;
+    };
+    
+struct TAlfFrameBrushImageParams
+    {
+    TAlfImageParams iImage;
+    TAlfXYMetric iEdgeOffset;
+    };
+
+struct TAlfFrameBrushFramePartImageParams
+    {
+    TAlfImageParams iImage;
+    TInt iFramePart;
+    };
+    
+struct TAlfDropShadowOffsetPolarParams
+    {
+    TReal32 iAngle;
+    TAlfMetric iDistance;
+    TInt iTransitionTime;
+    };
+    
+struct TAlfDropShadowOffsetXYParams
+    {
+    TAlfTimedPoint iOffset;
+    TInt iOffsetUnit;
+    };
+    
+struct TAlfDropShadowColorRgbParams
+    {
+    TRgb iColor;
+    TInt iTransitionTime;
+    };
+    
+struct TAlfDropShadowColorSkinParams
+    {
+    TAknsItemID iID;
+    TInt iIndex;
+    TInt iTransitionTime;
+    };
+struct TAlfQtCommandBufferParams
+    {
+    TInt iWsClientId;
+    TInt iWsWgId;
+    TInt iVisualHandle; // return param
+    TInt iLength;
+    TAlfCommandBufferStatus iBufferStatus;
+    TAny* iPtr;    
+    };
+struct TAlfVisualEffectParams
+    {
+    TFileName   iFileName;
+    TInt 		iGroupHandle;
+    };
+/**
+ * Use the following functions to serialize the RArray<T> objects so
+ * that they can be sent to server. 
+ *
+ * Client side should use ExternalizeLC function and the server side
+ * the InternalizeL function. 
+ */   
+const TUint KAlfArrayBufferSeparatorChar = ' ';
+    
+template <class T>
+HBufC8* ExternalizeLC( const RArray<T>& aArray )
+    {
+    const TInt itemCount = aArray.Count();
+    if ( !itemCount)
+        {
+        return HBufC8::NewLC(0);
+        }
+    
+    const T* firstItem = &aArray[0];
+    
+    TPtrC8 arrayPtr( (TUint8*)firstItem, itemCount*sizeof(T) );
+    
+    TBuf8<10> itemCountBuf;
+    itemCountBuf.AppendNum( itemCount );
+    
+    TChar separator( KAlfArrayBufferSeparatorChar );
+    
+    HBufC8* buffer = HBufC8::NewLC( itemCountBuf.Length() + 1 + arrayPtr.Length() );
+    TPtr8 ptr = buffer->Des();
+    
+    ptr.Append( itemCountBuf );
+    ptr.Append( separator );
+    ptr.Append( arrayPtr );
+    
+    return buffer;
+    }
+   
+template <class T> 
+void InternalizeL( const TDesC8& aDes, RArray<T>& aArray )
+    {
+    aArray.Reset();
+    if ( !aDes.Length() )
+        {
+        return;
+        }
+        
+    const TInt separatorIndex = aDes.Locate( TChar( KAlfArrayBufferSeparatorChar ) );
+    TInt itemCount = 0;
+    TLex8 lexer( aDes.Left( separatorIndex ) );
+    User::LeaveIfError( lexer.Val( itemCount ) );
+    
+    TPtrC8 buffer( &aDes[separatorIndex+1], itemCount*sizeof(T) );
+    
+    for ( TInt i = 0 ; i < itemCount ;  i++ )
+        {
+        T* itemPtr = (T*)&buffer[i*sizeof(T)];
+        T item = *itemPtr;
+        User::LeaveIfError( aArray.Append( item ) );
+        }
+    }
+
+#endif // ALFCONSTANTS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extension_api/inc/alf/alfextensionfactory.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,145 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   interface for creating custom extensions
+*
+*/
+
+
+
+#ifndef __M_ALF_EXTENSION_FACTORY__
+#define __M_ALF_EXTENSION_FACTORY__
+
+#include <e32base.h>
+
+class CAlfLayoutManager;
+class CHuiEnv;
+
+// binary
+enum THuiInterfaceSupport
+    {                                   // Cast to:
+    EHuiObjectTypeVisual = 0x0001,      // CHuiVisual
+    EHuiObjectTypeLayout = 0x0002,      // CHuiLayout   
+    EHuiObjectTypeControl = 0x0004 ,    // CHuiControl
+    EHuiObjectTypeControlGroup = 0x0008,// CHuiControlGroup
+    EHuiObjectTypeBrush = 0x0010,       // CHuiBrush 
+    EHuiObjectTypeDisplay = 0x0020,     // CHuiDisplay
+    EHuiObjectTypeCustom = 0x0040,      // For extension to decide
+    EHuiObjectTypeCurvePathProvider = 0x0080, // Implemented by object which shares curve path
+    
+    EHuiInterfaceMappingFunction = 0x00010000, // MHuiMappingFunction
+    EHuiInterfaceVisualOwner = 0x00020000,      // MHuiVisualOwner
+    EAlfBrushHandler = 0x00040000,  // CAlfBrushHandler, needed for controlling brush ownership
+    EAlfTextStyleHandler = 0x00080000,	// TAlfTextStyleHandler, needed for mapping client and server side text styles    
+    EAlfVisualHandler = 0x00100000	// CAlfVisualHandler
+    };
+
+
+
+class MAlfInterfaceProvider
+    {
+public:
+    /**
+    * Request to pointer of given type matching to given handle. 
+    * Leaves if object not found i.e. always returns pointer on completion
+    */
+    virtual TAny* GetInterfaceL(const THuiInterfaceSupport& aType, TInt aHandle) = 0;
+
+    /**
+    * Request identifier for pointer of given type 
+    * On error returns KErrNotFound
+    */
+    virtual TInt GetHandleFromInterface(const THuiInterfaceSupport& aType, TAny* aInterface) = 0;
+
+    /**
+    * Returns common layoutmanager or null
+    */
+    virtual CAlfLayoutManager* LayoutManager() const = 0;
+
+    /**
+    * Returns common hitchcock environment or null
+    */
+    virtual CHuiEnv* SharedHuiEnv() const = 0;
+    
+    /**
+    * Request to make current command (during MAlfExtension::HandleCmd) asynchronous
+    * returns command id that is needed for completing the command later on
+    *
+    * exntension should take references to buffers (in/out) in case it wants to modify client message
+    * before completing it
+    */
+    virtual TInt HandleCurrentCommanndAsynch() = 0;
+
+    /**
+    * Complete asynch command, if MAlfExtension implementing object utilizes asynch commands
+    * it should also take care that those messages are completed at latest when the extension is being 
+    * destoryed. FW will panic the client in case of orphean messages
+    */    
+    virtual void CompleteCmd(TInt aCommadIdentifier, TInt aResult = KErrNone) = 0;
+
+    /** ! Future proofing */
+    virtual void AlfInterfaceProviderExtension(const TUid& aExtensionUid, TAny** aExtensionParams) = 0;
+    };
+
+
+class MAlfExtension
+    {
+    public:
+        /**
+        * Free resources for instance, usually delete this
+        */
+        virtual void Release() = 0;
+
+        /**
+        * Returns pointer of correct type or null
+        * @param aInterface     type of interface requested
+        * @return               Pointer or null depending whether interface is implemented 
+        */
+        virtual TAny* GetInterface(const THuiInterfaceSupport& aInterface) = 0;
+
+        /**
+        * Handles command from controller
+        * @param aCommandId     Command identifier, values below EAlfLastReservedOpCmd (= 10000)
+        *                       are reserved for tookit fw and should not be utilized in app 
+        *                       specific extensions.
+        * @param aInputBuffer   Additional data attached to command
+        * @param aResponse      Response to be passed back to commander
+        * @leave                Any system wide error code
+        */
+        virtual void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse) = 0;
+
+    };
+
+
+class MAlfExtensionFactory
+    {
+    public:
+        /**
+        * Creates new instace of required type (unique for factory)
+        * Must not take ownership of created object
+        * 
+        * @param aObjectId      Object type required
+        * @param aInputBuffer   Additional data attached to object construction
+        * @param aResolver      Reference to Interface resolver 
+        * @leave                Any system wide error code
+        */
+        virtual MAlfExtension* CreateExtensionL(const TInt aObjectId, const TDesC8& aInitialParams, MAlfInterfaceProvider& aResolver) = 0;
+
+        /**
+        * Free resources for instance, usually delete this
+        */
+        virtual void Release() = 0; 
+
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extension_api/inc/alf/alfhintplugin.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   interface for creating custom extensions
+*
+*/
+
+
+#ifndef _ALFHINTPLUGIN_H_
+#define _ALFHINTPLUGIN_H_
+
+#include <s32mem.h> //RDesReadStream
+
+/*
+ * CAlfHintGraphic
+ * 
+ * This class is part of CAlfHintApi. Its enabes adding of custom markers 
+ * into gc command stream. It has two parts: CAlfHintGraphic and CAlfHintGraphicDrawer 
+ *
+ * When CAlfHintGraphic is created, wserv creates automatically its counter part 
+ * CAlfHintGraphicDrawer.
+ * 
+ * Use method CAlfHintGraphic::InsertTag for inserting a custom tags. These are 
+ * played by CAlfHintGraphicDrawer and delivered to CAlfRenderStage 
+ * (ResolveObjectInterface API used).
+ */
+NONSHARABLE_CLASS(CAlfHintGraphic): public CWsGraphic
+    {
+public:
+    
+    /*
+     * Available tags. 
+     */
+    enum TAlfContentTag
+        {
+        EAlfOffscreenContentBegin, // for Java
+        EAlfOffscreenContentEnd,   // for Java 
+        EAlfOffscreenContentFlush, // for Java
+        
+        EAlfSkinContentBegin,
+        EAlfSkinContentEnd,
+                
+        EAlfSetWindowId,
+        // EAlfContentScale, etc..
+        EAlfBeginSubWindow,
+        EAlfEndSubWindow,
+        EAlfContentLastTag
+        };
+    
+    IMPORT_C static CAlfHintGraphic* NewL();
+
+    IMPORT_C ~CAlfHintGraphic();
+
+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: // Alf hinting API  
+
+    IMPORT_C TInt InsertTag( TInt aTag );
+    IMPORT_C TInt InsertTag( TInt aTag, TRect aBoundingRectangle, TInt aLayerId );
+    
+    IMPORT_C void SetGc( CWindowGc* aGc ); 
+    
+private:
+    
+    void ConstructL();
+    
+    CAlfHintGraphic();
+    
+    void HandleMessage(const TDesC8& aData);
+
+    void OnReplace();
+    
+    TInt InsertTagL( TInt aTag  );
+    TInt InsertTagL( TInt aTag, TRect aBoundingRectangle, TInt aLayerId );
+    
+private:
+    
+    CWindowGc* iGc;
+    
+    mutable RBuf8 iMsgDataBuf;
+};
+#endif // _ALFHINTPLUGIN_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extension_api/inc/alf/alflayouthandlers.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,283 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 of alf built-in layout support
+*
+*/
+
+
+
+#ifndef __ALFLAYOUTHANDLERS__
+#define __ALFLAYOUTHANDLERS__
+
+#include <alf/alfvisualhandlers.h>
+
+//----------------------------
+// basic layout
+//----------------------------
+class CAlfLayoutHandler: public CAlfVisualHandler
+    {
+public: // new methods
+    IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
+    IMPORT_C CAlfLayoutHandler(MAlfInterfaceProvider& aResolver);
+
+public: // from CAlfVisualHandler
+    IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
+
+protected: // from CBase
+    IMPORT_C ~CAlfLayoutHandler();
+
+public: // From MAlfExtension
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); public: // From MAlfExtension    
+
+protected: // From CAlfVisualHandler
+    IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+private:
+    TAny* iSpare;
+    };
+
+//----------------------------
+// anchor layout
+//----------------------------
+class CAlfAnchorLayoutHandler: public CAlfLayoutHandler
+    {
+public: // new methods
+    IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
+    IMPORT_C CAlfAnchorLayoutHandler(MAlfInterfaceProvider& aResolver);
+
+public: // from CAlfVisualHandler
+    IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
+
+protected: // from CBase
+    IMPORT_C ~CAlfAnchorLayoutHandler();
+
+public: // From MAlfExtension
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); public: // From MAlfExtension   
+
+protected: // From CAlfVisualHandler
+    IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+private:
+    TAny* iSpare;
+    };
+
+//----------------------------
+// anchor layout
+//----------------------------
+
+class TAknWindowLineLayout;
+class TAknTextLineLayout;
+class CHuiAnchorLayout;
+    
+class CAlfLCTAnchorLayoutHandler: public CAlfAnchorLayoutHandler
+    {
+public: // new methods
+    IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
+    IMPORT_C CAlfLCTAnchorLayoutHandler(MAlfInterfaceProvider& aResolver);
+
+public: // from CAlfVisualHandler
+    IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
+
+protected: // from CBase
+    IMPORT_C ~CAlfLCTAnchorLayoutHandler();
+
+public: // From MAlfExtension
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); public: // From MAlfExtension
+
+private:
+    TBool IsParentRelative(TInt aVal) const;
+    void SetAnchors(CHuiAnchorLayout* aAnchor, TInt aOrdinal, const TAknWindowLineLayout& aLine, const THuiTimedPoint& aTimedPoint);
+    void DoSetAnchors(CHuiAnchorLayout* aAnchor, TInt aOrdinal, TInt aLeft, TInt aTop, TInt aRight, TInt aBottom, const THuiTimedPoint& aTimedPoint);
+
+protected: // From CAlfVisualHandler
+    IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+private:
+    TAny* iSpare;
+    };
+
+//----------------------------
+// grid layout
+//----------------------------
+class CAlfGridLayoutHandler: public CAlfLayoutHandler
+    {
+public: // new methods
+    IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
+    IMPORT_C CAlfGridLayoutHandler(MAlfInterfaceProvider& aResolver);
+
+public: // from CAlfVisualHandler
+    IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
+
+protected: // from CBase
+    IMPORT_C ~CAlfGridLayoutHandler();
+
+public: // From MAlfExtension
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); public: // From MAlfExtension
+
+protected: // From CAlfVisualHandler
+    IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+private:
+    TAny* iSpare;
+    };
+    
+//----------------------------
+// LCT grid layout
+//----------------------------
+class CAlfLCTGridLayoutHandler: public CAlfGridLayoutHandler
+    {
+public: // new methods
+    IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
+    IMPORT_C CAlfLCTGridLayoutHandler(MAlfInterfaceProvider& aResolver);
+
+public: // from CAlfVisualHandler
+    IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
+
+protected: // from CBase
+    IMPORT_C ~CAlfLCTGridLayoutHandler();
+
+public: // From MAlfExtension
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); public: // From MAlfExtension
+    
+protected: // From CAlfVisualHandler
+    IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+private:
+    TAny* iSpare;
+    };
+    
+//----------------------------
+// deck layout
+//----------------------------
+class CAlfDeckLayoutHandler: public CAlfLayoutHandler
+    {
+public: // new methods
+    IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
+    IMPORT_C CAlfDeckLayoutHandler(MAlfInterfaceProvider& aResolver);
+
+public: // from CAlfVisualHandler
+    IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
+
+public: // From MAlfExtension
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); public: // From MAlfExtension
+
+
+protected: // from CBase
+    IMPORT_C ~CAlfDeckLayoutHandler();
+    
+protected: // From CAlfVisualHandler
+    IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+private:
+    TAny* iSpare;
+    };
+    
+//----------------------------
+// flow layout
+//----------------------------
+class CAlfFlowLayoutHandler: public CAlfLayoutHandler
+    {
+public: // new methods
+    IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
+    IMPORT_C CAlfFlowLayoutHandler(MAlfInterfaceProvider& aResolver);
+
+public: // from CAlfVisualHandler
+    IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
+
+protected: // from CBase
+    IMPORT_C ~CAlfFlowLayoutHandler();
+
+public: // From MAlfExtension
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); public: // From MAlfExtension
+
+protected: // From CAlfVisualHandler
+    IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+private:
+    TAny* iSpare;
+    };
+
+//----------------------------
+// curve path layout
+//----------------------------
+class CAlfCurvePathLayoutHandler: public CAlfLayoutHandler
+    {
+public: // new methods
+    IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
+    IMPORT_C CAlfCurvePathLayoutHandler(MAlfInterfaceProvider& aResolver);
+
+public: // from CAlfVisualHandler
+    IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
+
+protected: // from CBase
+    IMPORT_C ~CAlfCurvePathLayoutHandler();
+
+public: // From MAlfExtension
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); public: // From MAlfExtension
+
+protected: // From CAlfVisualHandler
+    IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+private:
+    struct TCurvePathLayoutPrivateData;
+    TCurvePathLayoutPrivateData* iCurvePathLayoutPrivateData;    
+    };
+
+//----------------------------
+// viewport layout
+//----------------------------
+class CAlfViewportLayoutHandler: public CAlfLayoutHandler
+    {
+public: // new methods
+    IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
+    IMPORT_C CAlfViewportLayoutHandler(MAlfInterfaceProvider& aResolver);
+
+public: // from CAlfVisualHandler
+    IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
+
+protected: // from CBase
+    IMPORT_C ~CAlfViewportLayoutHandler();
+
+public: // From MAlfExtension
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); public: // From MAlfExtension
+
+protected: // From CAlfVisualHandler
+    IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+private:
+    TAny* iSpare;
+    };
+
+
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extension_api/inc/alf/alfred.hrh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef __ALFRED_HRH_
+#define __ALFRED_HRH_
+
+// Uid for service extension ecom interface
+#define K_ALF_SERVICE_INTERFACE 0x102828BB
+
+// Uid for extension factory ecom interface
+#define K_ALF_FACTORY_INTERFACE 0x10282E10
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extension_api/inc/alf/alfserverutils.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Application server
+*
+*/
+
+
+
+#ifndef C_ALFAPPSERVERUTILS_H
+#define C_ALFAPPSERVERUTILS_H
+
+#include <e32def.h>
+#include <alf/alftimedvalue.h>
+
+class TAlfTimedValue;
+class THuiTimedValue;
+class TAlfTimedPoint;
+class THuiTimedPoint;
+class MAlfInterfaceProvider;
+class RFile;
+
+struct TAlfBoxMetric;
+struct THuiBoxMetric;
+struct TAlfXYMetric;
+struct THuiXYMetric;
+struct TAlfMetric;
+struct THuiMetric;
+
+
+class AlfTimedValueUtility
+    {
+public:
+    /** 
+     *
+     * Helper function to copy TAlfTimedValue (including mapping function) into THuiTimedValue. 
+     * Can be used only inside the Alfred-server.
+     *
+     * @param aSrc Source ALF timedvalue.
+     * @param aDst Destination HUI timedvalue.
+     * @param aResolver Interface to be used for resolving MHuiMappingFunction from TAlfTimedValue 
+     *     MappingFunctionIdentifier
+     *
+     */
+    IMPORT_C static void CopyTimedValue(TAlfTimedValue& aSrc, THuiTimedValue& aDst, MAlfInterfaceProvider& aResolver);
+
+    /** 
+     *
+     * Helper function to copy TAlfTimedValue (NOT including mapping function) into THuiTimedValue. 
+     * Can be used only inside the Alfred-server.
+     *
+     * @param aSrc Source ALF timedvalue.
+     * @param aDst Destination HUI timedvalue.
+     *
+     */
+    IMPORT_C static void CopyTimedValue(TAlfTimedValue& aSrc, THuiTimedValue& aDst);
+
+    /** 
+     *
+     * Helper function to copy THuiTimedValue (NOT including mapping function) into TAlfTimedValue. 
+     * Can be used only inside the Alfred-server.
+     *
+     * @param aSrc Source HUI timedvalue.
+     * @param aSrc Destination ALF timedvalue.
+     *
+     */
+    IMPORT_C static void CopyTimedValue(THuiTimedValue& aSrc, TAlfTimedValue& aDst);
+    };
+
+class AlfTimedPointUtility
+    {
+public:
+     
+    /** 
+     *
+     * Helper function to copy TAlfTimedPoint (including mapping function) into THuiTimedPoint. 
+     * Can be used only inside the Alfred-server.
+     *
+     * @param aSrc Source ALF timedpoint.
+     * @param aDst Destination HUI timedpoint.
+     * @param aResolver Interface to be used for resolving MHuiMappingFunction from TAlfTimedPoint 
+     *     MappingFunctionIdentifier
+     *
+     */
+    IMPORT_C static void CopyTimedPoint(TAlfTimedPoint& aSrc, THuiTimedPoint& aDst, MAlfInterfaceProvider& aResolver);
+    
+    /** 
+     *
+     * Helper function to copy TAlfTimedPoint (NOT including mapping function) into THuiTimedPoint. 
+     * Can be used only inside the Alfred-server.
+     *
+     * @param aSrc Source ALF timedpoint.
+     * @param aDst Destination HUI timedpoint.
+     *
+     */
+    IMPORT_C static void CopyTimedPoint(TAlfTimedPoint& aSrc, THuiTimedPoint& aDst);
+
+    /** 
+     *
+     * Helper function to copy THuiTimedPoint (NOT including mapping functions) into TAlfTimedPoint. 
+     * Can be used only inside the Alfred-server.
+     *
+     * @param aDst Source HUI timedpoint.
+     * @param aDst Destination ALF timedpoint.
+     *
+     */
+    IMPORT_C static void CopyTimedPoint(THuiTimedPoint& aSrc, TAlfTimedPoint& aDst);
+
+    };
+
+class AlfFileTokenUtility
+    {
+    public:
+    /** 
+     *
+     * Helper function to open a file based on token received from client side
+     * As token remains valid as long as the client session is open, there's no need to keep file handle
+     * open unless file is really used
+     *
+     * @param aFile Handle to open
+     * @param aToken Token received from client
+     *
+     */
+    IMPORT_C static void OpenFileForTokenL(RFile& aFile, const TDesC8& aToken);
+    };
+
+
+
+class AlfBoxMetricUtility
+    {
+public:
+    static void CopyMetric(TAlfBoxMetric& aSrc, THuiBoxMetric& aDst);
+
+    static void CopyMetric(THuiBoxMetric& aSrc, TAlfBoxMetric& aDst);
+    };
+
+class AlfXYMetricUtility
+    {
+public:
+    static void CopyMetric(TAlfXYMetric& aSrc, THuiXYMetric& aDst);
+
+    static void CopyMetric(THuiXYMetric& aSrc, TAlfXYMetric& aDst);
+    };
+
+class AlfMetricUtility
+    {
+public:
+    static void CopyMetric(TAlfMetric& aSrc, THuiMetric& aDst);
+
+    static void CopyMetric(THuiMetric& aSrc, TAlfMetric& aDst);
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extension_api/inc/alf/alfvisualhandlers.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,420 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 of alf built-in visual support
+*
+*/
+
+
+
+#ifndef __ALFVISUALHANDLERS__
+#define __ALFVISUALHANDLERS__
+
+#include <alf/alfextensionfactory.h>
+#include <uiacceltk/HuiControl.h>
+#include <uiacceltk/HuiVisual.h>
+#include <uiacceltk/HuiLayout.h>
+#include <uiacceltk/HuiMesh.h>
+
+/**
+ * Handler for the visual base class.
+ */
+class CAlfVisualHandler: public CBase, public MAlfExtension
+    {
+public: // new methods
+
+    /**
+     * Constructor.
+     * @param aResolver The resolver for this visual handler.
+     * @param aOwner The owner control of this visual.
+     * @param aParentLayout The parent layout of this visual.
+     */
+    IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
+    
+    /**
+     * Constructor.
+     * @param aResolver The resolver for this visual handler. 
+     */
+    IMPORT_C CAlfVisualHandler(MAlfInterfaceProvider& aResolver);
+    
+    /**
+     * Second phase constructor.
+     * @param aOwner The owner control of this visual.
+     * @param aParentLayout The parent layout of this visual.
+     */    
+    IMPORT_C virtual void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
+
+protected: // from CBase
+    IMPORT_C ~CAlfVisualHandler();
+
+public: // From MAlfExtension
+    /**
+     * Release this visual handler.
+     */
+    IMPORT_C void Release();
+    
+    /**
+     * Gets the hui visual handled by this class.
+     * @param aInterface Return parameter containing the visual.
+     */
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    
+    /**
+     * Handle a command for this visual that has come from the client.
+     * @param aCommandId The TAlfredServerIPC enum specifying what command to execute.
+     * @param aInputBuffer The input parameters for this command, will be cast to the correct types internally.
+     * @param aResponse The return value for this command. Will be cast to correct type at the client side.
+     * @see TAlfredServerIPC
+     */
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); 
+    
+    // @internal
+    void HuiVisualAboutToTerminate();
+
+protected: // new methods
+    IMPORT_C virtual void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+protected: // data
+    CHuiVisual* iVisual; // not owned
+    MAlfInterfaceProvider& iResolver; // not owned
+
+private:
+    
+    struct TPrivateData;
+    TPrivateData* iPrivateData;    
+    };
+
+/**
+ * Handler for TextVisual.
+ */
+class CAlfTextVisualHandler: public CAlfVisualHandler
+    {
+public: // new methods
+    /**
+     * Constructor.
+     * @param aResolver The resolver for this visual handler.
+     * @param aOwner The owner control of this visual.
+     * @param aParentLayout The parent layout of this visual.
+     */
+    IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
+    
+    /**
+     * Constructor.
+     * @param aResolver The resolver for this visual handler. 
+     */    
+    IMPORT_C CAlfTextVisualHandler(MAlfInterfaceProvider& aResolver);
+
+public: // from CAlfVisualHandler
+    /**
+     * Second phase constructor.
+     * @param aOwner The owner control of this visual.
+     * @param aParentLayout The parent layout of this visual.
+     */
+    IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
+
+protected: // from CBase
+    IMPORT_C ~CAlfTextVisualHandler();
+
+public: // From MAlfExtension
+    /**
+     * Release this visual handler.
+     */
+    IMPORT_C void Release();
+    
+    /**
+     * Gets the hui visual handled by this class.
+     * @param aInterface Return parameter containing the visual.
+     */    
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+
+    /**
+     * Handle a command for this visual that has come from the client.
+     * @param aCommandId The TAlfredServerIPC enum specifying what command to execute.
+     * @param aInputBuffer The input parameters for this command, will be cast to the correct types internally.
+     * @param aResponse The return value for this command. Will be cast to correct type at the client side.
+     * @see TAlfredServerIPC
+     */    
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);    
+
+protected: // From CAlfVisualHandler
+    IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+private:
+    TAny* iSpare;
+    };
+
+//----------------------------
+// LCTTextVisual
+//----------------------------
+
+class CHuiTextVisual;
+class TAknTextLineLayout;
+
+class CAlfLCTTextVisualHandler: public CAlfTextVisualHandler
+    {
+public: // new methods
+    /**
+     * Constructor.
+     * @param aResolver The resolver for this visual handler.
+     * @param aOwner The owner control of this visual.
+     * @param aParentLayout The parent layout of this visual.
+     */
+    IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
+    
+    /**
+     * Constructor.
+     * @param aResolver The resolver for this visual handler. 
+     */        
+    IMPORT_C CAlfLCTTextVisualHandler(MAlfInterfaceProvider& aResolver);
+
+public: // from CAlfVisualHandler
+    /**
+     * Second phase constructor.
+     * @param aOwner The owner control of this visual.
+     * @param aParentLayout The parent layout of this visual.
+     */
+    IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
+
+protected: // from CBase
+    IMPORT_C ~CAlfLCTTextVisualHandler();
+
+public: // From MAlfExtension
+    /**
+     * Release this visual handler.
+     */
+    IMPORT_C void Release();
+    
+    /**
+     * Gets the hui visual handled by this class.
+     * @param aInterface Return parameter containing the visual.
+     */    
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+
+    /**
+     * Handle a command for this visual that has come from the client.
+     * @param aCommandId The TAlfredServerIPC enum specifying what command to execute.
+     * @param aInputBuffer The input parameters for this command, will be cast to the correct types internally.
+     * @param aResponse The return value for this command. Will be cast to correct type at the client side.
+     * @see TAlfredServerIPC
+     */    
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); 
+
+protected: // From CAlfVisualHandler
+    IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+private:
+    void SetTextPaneL(CHuiTextVisual* aTextVisual, const TAknTextLineLayout& aLine);
+
+private:
+    class TLCTTextVisualPrivateData;
+    TLCTTextVisualPrivateData* iLCTTextVisualPrivateData;
+    };
+
+//----------------------------
+// ImageVisual
+//----------------------------
+class CAlfImageVisualHandler: public CAlfVisualHandler
+    {
+public: // new methods
+
+    /**
+     * Constructor.
+     * @param aResolver The resolver for this visual handler.
+     * @param aOwner The owner control of this visual.
+     * @param aParentLayout The parent layout of this visual.
+     */
+    IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
+
+    /**
+     * Constructor.
+     * @param aResolver The resolver for this visual handler. 
+     */            
+    IMPORT_C CAlfImageVisualHandler(MAlfInterfaceProvider& aResolver);
+
+public: // from CAlfVisualHandler
+    /**
+     * Second phase constructor.
+     * @param aOwner The owner control of this visual.
+     * @param aParentLayout The parent layout of this visual.
+     */
+    IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
+
+protected: // from CBase
+    IMPORT_C ~CAlfImageVisualHandler();
+
+public: // From MAlfExtension
+    /**
+     * Release this visual handler.
+     */
+    IMPORT_C void Release();
+    
+    /**
+     * Gets the hui visual handled by this class.
+     * @param aInterface Return parameter containing the visual.
+     */    
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    
+    /**
+     * Handle a command for this visual that has come from the client.
+     * @param aCommandId The TAlfredServerIPC enum specifying what command to execute.
+     * @param aInputBuffer The input parameters for this command, will be cast to the correct types internally.
+     * @param aResponse The return value for this command. Will be cast to correct type at the client side.
+     * @see TAlfredServerIPC
+     */        
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);     
+
+protected: // From CAlfVisualHandler
+    IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+private:
+    TAny* iSpare;
+    };
+    
+//----------------------------
+// Line Visual
+//----------------------------
+class CAlfLineVisualHandler: public CAlfVisualHandler
+    {
+public: // new methods
+
+    /**
+     * Constructor.
+     * @see CAlfVisualHandler::NewL()
+     */
+    IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
+
+    /**
+     * Constructor.
+     * @see CAlfVisualHandler::CAlfVisualHandler()
+     */    
+    IMPORT_C CAlfLineVisualHandler(MAlfInterfaceProvider& aResolver);
+
+public: // from CAlfVisualHandler
+    /**
+     * Constructor.
+     * @see CAlfVisualHandler::ConstructL()
+     */    
+    IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
+
+protected: // from CBase
+    IMPORT_C ~CAlfLineVisualHandler();
+
+public: // From MAlfExtension
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); 
+
+protected: // From CAlfVisualHandler
+    IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+private:
+    class TLineVisualHandlerPrivateData;
+    TLineVisualHandlerPrivateData* iLineVisualPrivateData;    
+    };
+    
+//----------------------------
+// Mesh Visual
+//----------------------------
+class CAlfMeshVisualHandler: public CAlfVisualHandler
+    {
+public: // new methods
+
+    /**
+     * Constructor.
+     * @see CAlfVisualHandler::NewL()
+     */
+    IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, THuiMeshType aMeshType, CHuiLayout* aParentLayout);
+    
+    /**
+     * Constructor.
+     * @see CAlfVisualHandler::CAlfVisualHandler()
+     */        
+    IMPORT_C CAlfMeshVisualHandler(MAlfInterfaceProvider& aResolver);
+
+public: // from CAlfVisualHandler
+    /**
+     * Constructor.
+     * @see CAlfVisualHandler::ConstructL()
+     */    
+    IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, THuiMeshType aMeshType, CHuiLayout* aParentLayout);
+
+protected: // from CBase
+    IMPORT_C ~CAlfMeshVisualHandler();
+
+public: // From MAlfExtension
+    IMPORT_C void Release();
+    
+    /**
+     * Get interface.
+     * @see CAlfVisualHandler::GetInterface()
+     */        
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    
+    /**
+     * Handle command from client.
+     * @see CAlfVisualHandler::HandleCmdL()
+     */       
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); 
+
+protected: // From CAlfVisualHandler
+    IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+private:
+    class TMeshVisualHandlerPrivateData;
+    TMeshVisualHandlerPrivateData* iMeshVisualPrivateData;    
+    };
+
+//----------------------------
+// Canvas Visual
+//----------------------------
+class CAlfCanvasVisualHandler: public CAlfVisualHandler
+    {
+public: // new methods
+
+    /**
+     * Constructor.
+     * @see CAlfVisualHandler::NewL()
+     */
+    IMPORT_C static MAlfExtension* NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout);
+
+    /**
+     * Constructor.
+     * @see CAlfVisualHandler::CAlfVisualHandler()
+     */    
+    IMPORT_C CAlfCanvasVisualHandler(MAlfInterfaceProvider& aResolver);
+
+public: // from CAlfVisualHandler
+    /**
+     * Constructor.
+     * @see CAlfVisualHandler::ConstructL()
+     */    
+    IMPORT_C void ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout);
+
+protected: // from CBase
+    IMPORT_C ~CAlfCanvasVisualHandler();
+
+public: // From MAlfExtension
+    IMPORT_C void Release();
+    IMPORT_C TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    IMPORT_C void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse); 
+
+protected: // From CAlfVisualHandler
+    IMPORT_C void VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters);
+
+private:
+    class TCanvasVisualHandlerPrivateData;
+    TCanvasVisualHandlerPrivateData* iLineVisualPrivateData;    
+    };
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_extension_api/inc/alf/ftokenclient.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Interface for granting a permission and for using files from 
+*                apps' private cage. No capabilities required 
+*
+*/
+
+
+
+#ifndef __FTOKENCLIENT_H__
+#define __FTOKENCLIENT_H__
+
+#include <e32std.h>
+#include <f32file.h>
+
+const TInt KMaxTokenLenght(8);
+
+/**
+* Utility class for for giving another process permission (token) to
+* access on demand a specific file from another process. The class
+* permits process (provider) to grant another process (consumer) ability to
+* open, read and close the named file on demand as the consumer so wishes, 
+* without repeated interaction between provider and consumer. 
+*
+* Tokens are valid as long the session used for grating the permission is connected 
+* 
+* @code
+*
+*    // Provider should usually instantiate session as member variable as session lifetime 
+*    // defines the tokens lifetime also, consumer may generate session on-demand based as well
+*
+*    RFTokenClient client;
+*    User::LeaveIfError(client.Connect());
+*    CleanupClosePushL(client);
+*
+*   // Provider, generating token based on known uid (made up uid in this example ;)
+*
+*   TInt64 token = 0;
+*   TPckg<TInt64> tokenbuf(token); 
+*    
+*   _LIT(KMYPRIVATEFILE, "z:\\private\\1028289F\\focus.png"); // full path with drive letter must be given
+*   
+*   TSecureId consumerSecId(0x10282845); 
+*
+*   User::LeaveIfError(iClient.GenerateToken(),TSecurityPolicy(consumerSecId), tokenbuf));
+*
+*   // Generating token based on existing token
+*   // Nb. Consumer may ensure extended lifetime for token by "cloning" it
+*   // (i.e. make sure that token remains valid even the session of orifial provider
+*   // is closed )  
+*
+*   TInt64 token2 = 0;
+*   TPckg<TInt64> tokenbuf2(token2); 
+*
+*    User::LeaveIfError(client.GenerateToken(tokenbuf, Application()->AppDllUid(), tokenbuf2));
+*
+*  // Consumer, opening file based on token
+*
+*   RFile file;
+*   User::LeaveIfError(client.OpenFileForToken(file, tokenbuf2));
+*    
+* @endcode
+*/    
+NONSHARABLE_CLASS(RFTokenClient): public RSessionBase
+    {
+public:
+    /**
+	* Connects to server. If the server does not exist, starts the server .
+	*/
+    IMPORT_C TInt Connect();
+    
+    /* Methods for granting permission */
+    
+    /**
+	* Generates token based on filename. Method is synchronous.
+	*
+	* @param aFileName          Filename of file to be shared
+	* @param aSecurityPolicy    Security policy that a process that process must fullfill to gain access to file 
+	* @param aToken             Generated token, 64-bit integer as a 8-bit descriptor              
+	* @return                   Any system wide error code, KErrNone on success
+	*/
+    IMPORT_C TInt GenerateToken(const TDesC& aFileName, const TSecurityPolicy& aSecurityPolicy, TDes8& aToken) const;    
+    
+    /**
+	* Generates token based on open file handle. Method is synchronous.
+	*
+	* @param aOpenFile          Open filehandle, can reside other process gage as well
+	* @param aSecurityPolicy    Security policy that a process that process must fullfill to gain access to file 
+	* @param aToken             Generated token, 64-bit integer as a 8-bit descriptor              
+	* @return                   Any system wide error code, KErrNone on success
+	*/
+    IMPORT_C TInt GenerateToken(const RFile& aOpenFile, const TSecurityPolicy& aSecurityPolicy, TDes8& aToken) const;    
+    
+    /**
+	* Generates token based on existing token. Method is synchronous.
+	*
+	* @param aExistingToken     Token that is valid inside this process (SecId matches)
+	* @param aSecurityPolicy    Security policy that a process that process must fullfill to gain access to file 
+	* @param aToken             Generated token, 64-bit integer as a 8-bit descriptor              
+	* @return                   Any system wide error code, KErrNone on success
+	*/
+    IMPORT_C TInt GenerateToken(const TDesC8& aExistingToken, const TSecurityPolicy& aSecurityPolicy, TDes8& aToken) const;    
+
+    
+    /* Methods for granting permission, for convenience */
+    
+    /**
+	* Generates token based on filename. Method is synchronous.
+	*
+	* @param aFileName          Filename of file to be shared
+	* @param aConsumerUid       Secure id of process that gains access to file 
+	* @param aToken             Generated token, 64-bit integer as a 8-bit descriptor              
+	* @return                   Any system wide error code, KErrNone on success
+	*/
+    IMPORT_C TInt GenerateToken(const TDesC& aFileName, const TUid& aConsumerUid, TDes8& aToken) const;
+    
+    /**
+	* Generates token based on open file handle. Method is synchronous.
+	*
+	* @param aOpenFile          Open filehandle, can reside other process gage as well
+	* @param aConsumerUid       Secure id of process that gains access to file 
+	* @param aToken             Generated token, 64-bit integer as a 8-bit descriptor              
+	* @return                   Any system wide error code, KErrNone on success
+	*/
+    IMPORT_C TInt GenerateToken(const RFile& aOpenFile, const TUid& aConsumerUid, TDes8& aToken) const;    
+    
+    /**
+	* Generates token based on existing token. Method is synchronous.
+	*
+	* @param aExistingToken     Token that is valid inside this process (SecId matches)
+	* @param aConsumerUid       Secure id of process that gains access to file 
+	* @param aToken             Generated token, 64-bit integer as a 8-bit descriptor              
+	* @return                   Any system wide error code, KErrNone on success
+	*/
+    IMPORT_C TInt GenerateToken(const TDesC8& aExistingToken, const TUid& aConsumerUid, TDes8& aToken) const;    
+    
+    
+    /* Methods for accessing file based on token */
+    
+    /**
+	* Opens filehandle based on token. Method is synchronous.
+	*
+	* @param aHandle     Unattached handle 
+	* @param aToken      Token that is valid in for this process              
+	* @return            Any system wide error code, KErrNone on success
+	*/
+    IMPORT_C TInt OpenFileForToken(RFile& aHandle, const TDesC8& aToken) const;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+    
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_tracing_api/alf_tracing_api.metaxml	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,20 @@
+<?xml version="1.0" ?>
+<api id="389ef3741277e1d2b5f77b0c1a8b3e17" dataversion="1.0">
+  <name>ALF Tracing API</name>
+  <description>Interface providing means for printing out different kind of statistics of ui accelerator classes.</description>
+  <type>c++</type>
+  <subsystem>uiacceltk</subsystem>
+  <libs>
+    <lib name="alfappservercore.lib" />
+    <lib name="alfclient.lib" />
+    <lib name="hitchcock.lib" />
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_tracing_api/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 that exports the files belonging to 
+:                ALF Tracing API
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/uiacceltk/HuiProbe.h     MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/HuiProbe.h)
+../inc/alf/alfmetricsinterface.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfmetricsinterface.h)
+../inc/alf/alflayoutmetrics.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alflayoutmetrics.h)
+../inc/alf/alftraceextclient.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alftraceextclient.h)
+../inc/alf/alftraceinterface.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alftraceinterface.h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_tracing_api/inc/alf/alflayoutmetrics.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,181 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Layout metrics
+*
+*/
+
+
+
+#ifndef C_ALFLAYOUTMETRICS_H
+#define C_ALFLAYOUTMETRICS_H
+
+#include <e32base.h>
+
+class CAlfTextVisual;
+class CAlfEnv;
+struct TMarkedVisualEntry;
+
+/**
+ *  Layout metrics utility for measuring text visuals. Measuring is
+ *  is done based on text style or font id. Mesuring texts that has been 
+ *  defined using font specification are not yet supported.
+ *  
+ *
+ *  Example of use:
+ *  
+ *  void CHelloWorldAppUi::ConstructL()
+ *     {
+ *     iEnv = CAlfEnv::NewL();
+ *  #ifdef __DEBUG
+ *     // Enable layout metrics utility visual automarking in debug builds.
+ *     iEnv->LayoutMetricsUtility()->EnableAutoMarking(); 
+ *  #endif
+ *     ...
+ *     ...
+ *     // Create some textvisuals, these will be automatically included
+ *     // into metrics reports. 
+ *     iTextVisual = CAlfTextVisual::AddNewL(*this, iLayout);
+ *     iTextVisual->SetText(KMyText);
+ *     iTextVisual->SetStyle(EAlfTextStyleSmall);
+ *     ...
+ *     ...
+ *     }
+ *
+ *   // handle any menu commands
+ *  void CHelloWorldAppUi::HandleCommandL(TInt aCommand)
+ *     {
+ *     switch(aCommand)
+ *         {
+ *         case EHellowWorldCmdMeasureVisuals:
+ *             {
+ *             // Measure currently visible text visuals
+ *             iEnv->LayoutMetricsUtility()->MeasureVisuals();
+ *             // Write a metrics report into a file 
+ *             iEnv->LayoutMetricsUtility()->WriteReport();
+ *             break;
+ *             }
+ *          ...
+ *          ...    
+ *         }
+ *     ...
+ *     }        
+ *
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfLayoutMetricsUtility ): public CBase
+    {
+public:
+
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfLayoutMetricsUtility();
+    
+    /**
+     * 2-phase constructor.
+     */
+    static CAlfLayoutMetricsUtility* NewL(CAlfEnv& aEnv);
+
+    /**
+     * 2-phase constructor.
+     */
+    static CAlfLayoutMetricsUtility* NewLC(CAlfEnv& aEnv);
+    
+    /**
+     * Marks visual to be included into layout metric reports.
+     * @param aLogicalName Logical name for the visual, e.q. "title_pane_t1" or "qtn_title_text"...
+     *                     If NULL is given, text visual text will be used as logical name
+     *                     in the reports.
+     * @param aVisual      The visual to be included into reports.
+     */
+    IMPORT_C void MarkVisual(TDesC* aLogicalName, CAlfTextVisual* aVisual);
+    
+    /**
+     * Unmarks visual, it will not be included into layout metric reports.
+     * @param aVisual      The visual to be excluded from reports.
+     */
+    IMPORT_C void UnmarkVisual(CAlfTextVisual* aVisual);
+
+    /**
+     * Measures all currently visible visuals.
+     */
+    IMPORT_C void MeasureVisuals();
+
+    /**
+     * Writes a layout metric report into a file, by default C: drive is used.
+     * Report contains metrics data for each visual at the time of last call to the
+     * MeasureVisuals()-method.
+     *
+     * Report is intended to be used when text strings lenghts are decided and localized to 
+     * different language variants.
+     *
+     * Report contains data for each measured textvisual such as:
+     *
+     * - Component type ("Text" for text visual)
+     * - Id (Generated id number)
+     * - Variety (Generated variety id number)
+     * - Logical name (Given with MarkVisual()-method) 
+     * - Alias (Text that the text visual shows)
+     * - Font type (qfn_primary, qfn_secondary...)
+     * - Text width (Text width in pixels)
+     * - Text height (Text height in pixels)
+     * - Visual coordinates relative to parent layout left, right, top and bottom coordinates
+     * - Remarks (Free text, if any)
+     * - Layout parent id (Generated id for parent layout) 
+     * - Layout parent variety id (Generated variety id for parent layout) 
+     * - Wheter text visual is a multi row or not 
+     * - Max number of text rows 
+     * - Font style 1 (plain, bold -attributes)
+     * - Font style 2 (regular, italic -attributes)
+     * - Font style 3 (underline, strikethrough, outline, boxed or shadow)
+     * - Concatenated rows or not
+     *
+     */
+    IMPORT_C void WriteReport();
+
+    /**
+     * Enables (or disables) automarking of visuals. If enabled, when visuals are 
+     * created they are automatical marked to be included into reports.
+     */
+    IMPORT_C void EnableAutoMarking(TBool aEnabled=ETrue);
+
+    /**
+     * Tells if automatic visual marking is enabled.
+     * @retrun ETrue if automatic visual marking is enabled, otherwise EFalse.
+     */     
+    IMPORT_C TBool AutoMarking();
+
+private:
+
+    CAlfLayoutMetricsUtility();
+    
+    void ConstructL(CAlfEnv& aEnv);
+
+    void MarkVisualL(TDesC* aLogicalName, CAlfTextVisual* aVisual);
+
+    void MeasureVisualsL();
+
+    void PrintToFile( TDesC16& aBuf );
+    
+                           
+private:
+
+    struct TMetricsPrivateData;
+    TMetricsPrivateData* iMetricsData;
+    };
+
+
+#endif // C_ALFLAYOUTMETRICS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_tracing_api/inc/alf/alfmetricsinterface.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Application UI definition
+*
+*/
+
+
+
+#ifndef M_ALFMETRICSINTERFACE_H
+#define M_ALFMETRICSINTERFACE_H
+
+#include <e32base.h>
+#include <e32cmn.h>
+
+class MAlfTraceInterface;
+
+class MAlfMetricsInterface
+    {
+public:
+    /**
+     * New message from client has arrived. If the message shouldn't be processed futhther by session,
+     * Message must be completed in the implementation of method
+     *
+     * @param aSessionId identifies the session which received the message.
+     * @param aMessage refence to arrived message
+     *
+     */
+    virtual void EnterClientMessageL(TInt aSessionId, const RMessage2& aMessage) = 0;
+    
+    /**
+     * Handling of message has been completed in server, server is about to enter back to active status 
+     *
+     * @param aSessionId identifies the session which received the message.
+     * @param aMessage refence to arrived message
+     *
+     */
+    virtual void ExitClientMessage(TInt aSessionId, const RMessage2& aMessage) = 0;
+    
+    /**
+     * Called when new session is created on the server.
+     *
+     * @param aSessionId Session id for new session
+     *
+     */
+    virtual void SessionCreated(TInt aSessionId) = 0;
+    
+    /**
+     * Called when session is closing down on the server.
+     *
+     * @param aSessionId Session id for the session
+     *
+     */
+    virtual void SessionTerminated(TInt aSessionId) = 0;
+    
+    /**
+     * Get trace object for session id.
+     *
+     * @since S60 v3.2
+     * @param aSessionId Session id
+     * @return Trace object, or NULL in case of unknown session id
+     */
+    virtual MAlfTraceInterface* GetTraceForSession(TInt aSessionId) const = 0;
+
+    /**
+     * Make new session be the default session
+     *
+     * @since S60 v3.2
+     * @param aSessionId Session id
+     *
+     */
+    virtual void PushDefaultSession(TInt aSessionId) = 0;
+
+    /**
+     * Restore to previous default session.
+     *
+     * @since S60 v3.2
+     *
+     */
+    virtual void PopDefaultSession() = 0;
+    
+    /**
+     * Get trace object for default session. If there's no default session defined, the
+     * auxiliary trace will be returned.
+     *
+     * @since S60 v3.2
+     * @return Trace object for default session
+     */
+    virtual MAlfTraceInterface& GetDefaultSessionTrace() const = 0;
+
+    /**
+     * Get the current default session id. If there's no default session defined,
+     * the id will be 0.
+     *
+     * @since S60 v3.2
+     * @return The default session id
+     */
+    virtual TInt GetDefaultSessionId() const = 0;
+
+    /**
+     * Get auxiliary trace object for tracing without exact session id.
+     *
+     * @since S60 v3.2
+     * @param aSessionId Session id
+     * @return Trace object, or NULL in case of unknown session id
+     */
+    virtual MAlfTraceInterface& GetAuxiliaryTrace() const = 0;
+    };
+
+#endif // M_ALFMETRICSINTERFACE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_tracing_api/inc/alf/alftraceextclient.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,192 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Trace Extension definition
+*
+*/
+
+ 
+
+#ifndef R_ALFTRACEEXTCLIENT_H
+#define R_ALFTRACEEXTCLIENT_H
+
+#include <alf/alfclientbase.h>
+#include <alf/alftraceinterface.h>
+
+/**
+ *  Client-side session object for tracing
+ *
+ *  The tracing session ensures that the server has tracing extension available.
+ *  The trace session attaches to the main session, and forwards tracing requests via
+ *  main session IPC to tracing extension
+ *
+ *  @lib alftraceextclient.lib
+ *  @since S60 v3.2
+ *
+ */
+class RAlfTraceExtClient : public RAlfClientBase, public MAlfTraceInterface
+  	{
+public:
+    /**
+     * Constructor.
+     *
+     * @since S60 v3.2
+     *
+     */
+    IMPORT_C RAlfTraceExtClient();
+	
+    /**
+     * Attach to host client. Tracing actions are targetted to host client.
+     *
+     * @since S60 v3.2
+     * @param aHostClient Host client
+     *
+     */
+	IMPORT_C void AttachToHostClient(const RAlfClientBase& aHostClient);
+
+    /**
+     * Detach from host client.
+     *
+     * @since S60 v3.2
+     *
+     */
+	IMPORT_C void DetachFromHostClient();
+	
+    /**
+     * Starts a new test case. If existing test case is already started, new nested
+     * test case will be created.
+     *
+     * @since S60 v3.2
+     * @aTraceCategory Test case category
+     * @param aTestCaseName Test case name
+     *
+     */
+    IMPORT_C void StartTestCase(TInt32 aTraceCategory, const TDesC& aTestCaseName);
+
+    /**
+     * Closes the current (most-recently created) test case.
+     *
+     * @since S60 v3.2
+     *
+     */
+    IMPORT_C void EndTestCase(void);
+
+    /**
+     * Sets an output filter.
+     *
+     * Output filter controls which trace output events are actually written to trace file or device.    
+     * Parameter aCategories can be one or more flags from EAlfTraceCategory enumeration.
+     * Join multiple flags with OR (|) operator.
+     *
+     * @since S60 v3.2
+     * @param aCategories One or more flags from EAlfTraceCategory enumaration
+     * @return Previous output filter
+     *
+     */
+    IMPORT_C TInt32 SetOutputFilter(TInt32 aCategories);
+
+    /*
+     * Output single string to trace output device or file. Time stamp and current test case
+     * information will be concatenated with the string. Trace is written only if its
+     * category matches with current output filter. If the trace belongs to more than one
+     * category, categories can be joined with OR (|) operator.
+     *
+     * @since S60 v3.2
+     * @param aTraceCategory Flag in EAlfTraceCategory enumaration
+     * @param aString Output string
+     *
+     */
+    IMPORT_C void OutputString(TInt32 aTraceCategory, const TDesC& aString);
+
+    /*
+     * Output single unsigned integer number with description to trace output device or file.
+     * Time stamp and current test case information will be concatenated with the string. 
+     * Trace is written only if its category matches with current output filter. If the
+     * trace belongs to more than one category, categories can be joined with OR (|) operator.
+     *
+     * @since S60 v3.2
+     * @param aTraceCategory Flag in EAlfTraceCategory enumaration
+     * @param aDescription Description for number
+     * @param aNumber Number value
+     *
+     */
+    IMPORT_C void OutputNumber(TInt32 aTraceCategory, const TDesC& aDescription, TUint aNumber);
+
+    /*
+     * Output single signed integer number with description to trace output device or file.
+     * Time stamp and current test case information will be concatenated with the string. 
+     * Trace is written only if its category matches with current output filter. If the
+     * trace belongs to more than one category, categories can be joined with OR (|) operator.
+     *
+     * @since S60 v3.2
+     * @param aTraceCategory Flag in EAlfTraceCategory enumaration
+     * @param aDescription Description for number
+     * @param aNumber Number value
+     *
+     */
+    IMPORT_C void OutputNumber(TInt32 aTraceCategory, const TDesC& aDescription, TInt aNumber);
+
+    /*
+     * Output single floating point number with description to trace output device or file.
+     * Time stamp and current test case information will be concatenated with the string. 
+     * Trace is written only if its category matches with current output filter. If the
+     * trace belongs to more than one category, categories can be joined with OR (|) operator.
+     *
+     * @since S60 v3.2
+     * @param aTraceCategory Flag in EAlfTraceCategory enumaration
+     * @param aDescription Description for number
+     * @param aNumber Number value
+     *
+     */
+    IMPORT_C void OutputNumber(TInt32 aTraceCategory, const TDesC& aDescription, TReal32 aNumber) __SOFTFP;
+
+    /*
+     * Output arbitary string to trace output device or file, with no additional data nor filtering.
+     *
+     * @since S60 v3.2
+     * @param aString Output string
+     *
+     */
+    IMPORT_C void RawOutput(const TDesC& aString);
+
+    /*
+     * Flush buffered output data. This is effective only if the trace output device or file has
+     *
+     * @since S60 v3.2
+     *
+     */
+    IMPORT_C void Flush(void);
+
+private:
+    class RSessionPlugin : public RSessionBase
+        {
+    public:
+        void Attach(const RSessionBase& aHost);
+        void Detach();
+        TBool IsAttached() const;
+        TInt SendPluginMessage(TInt aFunction, const TIpcArgs &aArgs) const;
+        TInt SendReceivePluginMessage(TInt aFunction, const TIpcArgs &aArgs) const;
+        };
+	
+private: // data
+    
+    /**
+     * Forwarder session to the main session.
+     */
+    RSessionPlugin iHostClient;
+
+    TInt iSpare1;
+    TInt iSpare2;
+	};
+
+#endif // R_ALFTRACEEXTCLIENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_tracing_api/inc/alf/alftraceinterface.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,235 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Abstract Trace interface definition
+*
+*/
+
+ 
+
+#ifndef M_ALFTRACEINTERFACE_H
+#define M_ALFTRACEINTERFACE_H
+
+#include <e32base.h>
+
+/**
+ * Trace categories
+ */
+enum TAlfTraceCategory
+    {
+
+    /*
+    * Report categories those do not belong to any other category
+    */
+    EAlfTraceCategoryGeneral                = 0x00000001,
+
+    /*
+    * Report object life change time events
+    */
+    EAlfTraceCategoryObjectLifeTime         = 0x00000002,
+
+    /*
+    * Events
+    */
+    EAlfTraceCategoryKeyEvent               = 0x00000004,
+    EAlfTraceCategoryAppEvent               = 0x00000008,
+    EAlfTraceCategorySystemEvent            = 0x00000010,
+    EAlfTraceCategoryGeneralEvent           = 0x00000020,
+    EAlfTraceCategoryAllEvents              = EAlfTraceCategoryKeyEvent |
+                                              EAlfTraceCategoryAppEvent |
+                                              EAlfTraceCategorySystemEvent |
+                                              EAlfTraceCategoryGeneralEvent,
+
+    /*
+    * Program flow points
+    */
+    EAlfTraceCategoryProgramFlowSrcRefresh  = 0x00000040,
+    EAlfTraceCategoryProgramFlowTextureLoad = 0x00000080,
+    EAlfTraceCategoryProgramFlowGeneral     = 0x00000100,
+    EAlfTraceCategoryProgramFlowAll         = 
+                                              EAlfTraceCategoryProgramFlowSrcRefresh |
+                                              EAlfTraceCategoryProgramFlowTextureLoad |
+                                              EAlfTraceCategoryProgramFlowGeneral,
+
+    /*
+    * Report ipc event handling events
+    */
+    EAlfTraceCategoryIpcMessages            = 0x00000400,
+
+    /*
+    * Report RAM changes
+    */
+    EAlfTraceCategoryRAM                    = 0x00000800,
+
+    /*
+    * Report framerate
+    */
+    EAlfTraceCategoryFramerate              = 0x00001000,
+
+    /*
+    * General informational trace
+    */
+    EAlfTraceCategoryInfo                   = 0x08000000,
+
+    /*
+    * Trace from warnings
+    */
+    EAlfTraceCategoryWarning                = 0x10000000,    
+
+    /*
+    * Trace from errors
+    */
+    EAlfTraceCategoryError                  = 0x20000000,
+
+    /*
+    * Trace from panic situations
+    */
+    EAlfTraceCategoryPanic                  = 0x40000000,
+
+    /*
+    * Trace from trace internal error situations
+    */
+    EAlfTraceCategoryInternalError          = 0x80000000,
+
+    /*
+    * All traces
+    */
+    EAlfTraceCategoryAll                    = 0xffffffff,
+    
+    /*
+    * No traces
+    */    
+    EAlfTraceCategoryNone                   = 0x00000000,
+    };
+
+
+/**
+ *  Abstract trace interface
+ *
+ *  Interface for keeping track of test cases, and for receiving trace output requests.
+ *
+  *  @since S60 v3.2
+ */
+class MAlfTraceInterface
+    {
+public:
+
+    /**
+     * Starts a new test case. If existing test case is already started, new nested
+     * test case will be created.
+     *
+     * @since S60 v3.2
+     * @aTraceCategory Test case category
+     * @param aTestCaseName Test case name
+     *
+     */
+    virtual void StartTestCase(TInt32 aTraceCategory, const TDesC& aTestCaseName) = 0;
+
+    /**
+     * Closes the current (most-recently created) test case.
+     *
+     * @since S60 v3.2
+     *
+     */
+    virtual void EndTestCase(void) = 0;
+
+    /**
+     * Sets an output filter.
+     *
+     * Output filter controls which trace output events are actually written to trace file or device.    
+     * Parameter aCategories can be one or more flags from EAlfTraceCategory enumeration.
+     * Join multiple flags with OR (|) operator.
+     *
+     * @since S60 v3.2
+     * @param aCategories One or more flags from EAlfTraceCategory enumaration
+     * @return Previous output filter
+     *
+     */
+    virtual TInt32 SetOutputFilter(TInt32 aCategories) = 0;
+
+    /*
+     * Output single string to trace output device or file. Time stamp and current test case
+     * information will be concatenated with the string. Trace is written only if its
+     * category matches with current output filter. If the trace belongs to more than one
+     * category, categories can be joined with OR (|) operator.
+     *
+     * @since S60 v3.2
+     * @param aTraceCategory Flag in EAlfTraceCategory enumaration
+     * @param aString Output string
+     *
+     */
+    virtual void OutputString(TInt32 aTraceCategory, const TDesC& aString) = 0;
+
+    /*
+     * Output single unsigned integer number with description to trace output device or file.
+     * Time stamp and current test case information will be concatenated with the string. 
+     * Trace is written only if its category matches with current output filter. If the
+     * trace belongs to more than one category, categories can be joined with OR (|) operator.
+     *
+     * @since S60 v3.2
+     * @param aTraceCategory Flag in EAlfTraceCategory enumaration
+     * @param aDescription Description for number
+     * @param aNumber Number value
+     *
+     */
+    virtual void OutputNumber(TInt32 aTraceCategory, const TDesC& aDescription, TUint aNumber) = 0;
+
+    /*
+     * Output single signed integer number with description to trace output device or file.
+     * Time stamp and current test case information will be concatenated with the string. 
+     * Trace is written only if its category matches with current output filter. If the
+     * trace belongs to more than one category, categories can be joined with OR (|) operator.
+     *
+     * @since S60 v3.2
+     * @param aTraceCategory Flag in EAlfTraceCategory enumaration
+     * @param aDescription Description for number
+     * @param aNumber Number value
+     *
+     */
+    virtual void OutputNumber(TInt32 aTraceCategory, const TDesC& aDescription, TInt aNumber) = 0;
+
+    /*
+     * Output single floating point number with description to trace output device or file.
+     * Time stamp and current test case information will be concatenated with the string. 
+     * Trace is written only if its category matches with current output filter. If the
+     * trace belongs to more than one category, categories can be joined with OR (|) operator.
+     *
+     * @since S60 v3.2
+     * @param aTraceCategory Flag in EAlfTraceCategory enumaration
+     * @param aDescription Description for number
+     * @param aNumber Number value
+     *
+     */
+    virtual void OutputNumber(TInt32 aTraceCategory, const TDesC& aDescription, TReal32 aNumber) __SOFTFP = 0;
+
+    /*
+     * Output arbitary string to trace output device or file, with no additional data nor filtering.
+     *
+     * @since S60 v3.2
+     * @param aString Output string
+     *
+     */
+    virtual void RawOutput(const TDesC& aString) = 0;
+
+    /*
+     * Flush buffered output data. This is effective only if the trace output device or file has
+     * a output buffer.
+     *
+     * @since S60 v3.2
+     *
+     */
+    virtual void Flush(void) = 0;
+    };
+
+#endif // M_ALFTRACEINTERFACE_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_tracing_api/inc/uiacceltk/HuiProbe.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Declares a interface for metrics recorder class
+*
+*/
+
+
+
+#ifndef __HUIPROBE_H__
+#define __HUIPROBE_H__
+
+#include <e32base.h>
+
+class MHuiSessionObject;
+
+/**
+ * Interface for Hitchcock Toolkit Probe object.
+ */
+class MHuiProbe
+    {
+public:
+
+    /**
+     * Event enums for object lifecycle changes.
+     */
+    enum TLifecycleEvent
+        {
+        ELifecycleEventConstructed,
+        ELifecycleEventDestructed,
+        ELifecycleEventReleased,
+        ELifecycleEventRestored,
+        };
+
+    /**
+     * Location enums for points of interest in program flow.
+     */
+    enum TProgramFlowPoint
+        {   
+        EProgramFlowPointRefreshPrepareDraw,
+        EProgramFlowPointRefreshDraw,
+        EProgramFlowPointRefresh,
+        };
+
+    /**
+     * Event enums for entering to or exiting from the point of interest in program flow.
+     */
+    enum TProgramFlowEvent
+        {   
+        EProgramFlowEventEnter,
+        EProgramFlowEventExit,
+        };
+
+    /**
+     * Report change in object life cycle
+     */
+    virtual void ReportObjectLifeCycleEvent(
+        const MHuiSessionObject& aObject,
+        TLifecycleEvent aLifecycleEvent) = 0;
+
+    /**
+     * Report enter or exit to/from "point of interest" in program flow
+     */
+    virtual void ReportProgramFlowEvent(
+        TProgramFlowPoint aProgramFlowPoint,
+        TProgramFlowEvent aProgramFlowEvent) = 0;
+
+    /**
+     * Report enter or exit to/from "point of interest" in program flow, which
+     * resides inside session-aware object
+     */
+    virtual void ReportProgramFlowEvent(
+        const MHuiSessionObject& aSessionObject,
+        TProgramFlowPoint aProgramFlowPoint,
+        TProgramFlowEvent aProgramFlowEvent) = 0;
+
+    /**
+     * Explocitly report the frame rate
+     */
+    virtual void ReportFrameRate(TInt aFrameRate) const = 0;
+
+    /**
+     * Associate the given object with current session (e.g. session
+     * which is currently handling a message).
+     */
+    virtual void AssociateWithCurrentSession(MHuiSessionObject& aObject) = 0;
+
+    };
+
+#endif // __HUIPROBE_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/alf_visual_api.metaxml	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,19 @@
+<?xml version="1.0" ?>
+<api id="7d5da4099c34b731a4e024b24a1130fc" dataversion="1.0">
+  <name>ALF Visual API</name>
+  <description>ALF graphical user interface. Provides means for generating components and effects with strong visual appeal.</description>
+  <type>c++</type>
+  <subsystem>uiacceltk</subsystem>
+  <libs>
+    <lib name="alfclient.lib" />
+    <lib name="goommonitor.lib" />
+  </libs>
+  <release category="domain"/>
+  <attributes>
+     <!-- This indicates wether the api provedes separate html documentation -->
+     <!-- or is the additional documentation generated from headers. -->
+     <!-- If you are unsuere then the value is "no" -->
+     <htmldocprovided>yes</htmldocprovided>
+     <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 that exports the files belonging to 
+:                ALF Visual API
+*
+*/
+
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+../inc/alf/alftextstylemanager.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alftextstylemanager.h)
+../inc/alf/alftextvisual.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alftextvisual.h)
+../inc/alf/alfgencomponent.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfgencomponent.h)
+../inc/alf/alfcurvepathlayout.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfcurvepathlayout.h)
+../inc/alf/alfcontrol.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfcontrol.h)
+../inc/alf/alfviewportlayout.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfviewportlayout.h)
+../inc/alf/alfdecklayout.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfdecklayout.h)
+../inc/alf/alfimage.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfimage.h)
+../inc/alf/alfownership.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfownership.h)
+../inc/alf/alfimageloaderutil.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfimageloaderutil.h)
+../inc/alf/alfenv.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfenv.h)
+../inc/alf/alfmeshvisual.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfmeshvisual.h)
+../inc/alf/alfvisualfactory.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfvisualfactory.h)
+../inc/alf/alfgridlayout.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfgridlayout.h)
+../inc/alf/alfcurvepath.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfcurvepath.h)
+../inc/alf/alftimedvalue.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alftimedvalue.h)
+../inc/alf/alfgradientbrush.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfgradientbrush.h)
+../inc/alf/alftextstyle.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alftextstyle.h)
+../inc/alf/alfmetric.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfmetric.h)
+../inc/alf/alfbitmapprovider.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfbitmapprovider.h)
+../inc/alf/alfimagevisual.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfimagevisual.h)
+../inc/alf/alfanchorlayout.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfanchorlayout.h)
+../inc/alf/alfdropshadowbrush.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfdropshadowbrush.h)
+../inc/alf/alfmesh.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfmesh.h)
+../inc/alf/alfframebrush.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfframebrush.h)
+../inc/alf/alfeventhandler.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfeventhandler.h)
+../inc/alf/alfflowlayout.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfflowlayout.h)
+../inc/alf/alfimagebrush.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfimagebrush.h)
+../inc/alf/alfinputcapabilitiessupplier.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfinputcapabilitiessupplier.h)
+../inc/alf/alflayout.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alflayout.h)
+../inc/alf/alfborderbrush.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfborderbrush.h)
+../inc/alf/alfutil.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfutil.h)
+../inc/alf/alflinevisual.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alflinevisual.h)
+../inc/alf/alfproperty.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfproperty.h)
+../inc/alf/alfbrusharray.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfbrusharray.h)
+../inc/alf/alfstatic.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfstatic.h)
+../inc/alf/alfcommand.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfcommand.h)
+../inc/alf/alfmaterial.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfmaterial.h)
+../inc/alf/alfm3gmesh.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfm3gmesh.h)
+../inc/alf/alfpropertyowner.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfpropertyowner.h)
+../inc/alf/alftexturemanager.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alftexturemanager.h)
+../inc/alf/alfcontrolgroup.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfcontrolgroup.h)
+../inc/alf/alftransformation.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alftransformation.h)
+../inc/alf/alfbrush.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfbrush.h)
+../inc/alf/alfdisplay.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfdisplay.h)
+../inc/alf/alftexture.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alftexture.h)
+../inc/alf/alfroster.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfroster.h)
+../inc/alf/alfevent.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfevent.h)
+../inc/alf/alfgc.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfgc.h)
+../inc/alf/alfproceduralmesh.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfproceduralmesh.h)
+../inc/alf/alfmappingfunctions.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfmappingfunctions.h)
+../inc/alf/alfvisual.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfvisual.h)
+../inc/alf/alftextureprocessor.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alftextureprocessor.h)
+../inc/alf/alfshadowborderbrush.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfshadowborderbrush.h)
+../inc/alf/alfscrollerevent.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfscrollerevent.h)
+../inc/alf/alfversion.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfversion.h)
+../inc/alf/alfscreenbuffer.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfscreenbuffer.h)
+../inc/alf/alfsymbiansbdrawer.h MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfsymbiansbdrawer.h)
+../inc/alf/alfdisplaybackgrounditem.h MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfdisplaybackgrounditem.h)
+../inc/alf/alfbatchbuffer.h MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfbatchbuffer.h)
+../inc/alf/alfenvobject.h MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfenvobject.h)
+../inc/alf/alftextureautosizeparams.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alftextureautosizeparams.h)
+../inc/alf/alfdropshadow.h MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfdropshadow.h)
+../inc/alf/alftexturegroup.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alftexturegroup.h)
+../inc/alf/alfcanvasvisual.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfcanvasvisual.h)
+../inc/alf/alfrealline.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfrealline.h)
+../inc/alf/alfclientwindow.h     MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfclientwindow.h)
+
+// for now
+../inc/goommonitor/goommonitor.h     MW_LAYER_PLATFORM_EXPORT_PATH(goommonitor.h)
+../inc/goommonitor/goommonitorsession.h     MW_LAYER_PLATFORM_EXPORT_PATH(goommonitorsession.h)
+../inc/goommonitor/goommonitorplugin.h     MW_LAYER_PLATFORM_EXPORT_PATH(goommonitorplugin.h)
+../inc/goommonitor/goommonitorplugin.hrh     MW_LAYER_PLATFORM_EXPORT_PATH(goommonitorplugin.hrh)
+
+../inc/alf/alfcompositionclient.h	MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfcompositionclient.h)
+../inc/alf/alfcompositionutility.h	MW_LAYER_PLATFORM_EXPORT_PATH(alf/alfcompositionutility.h)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfanchorlayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,569 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Anchor layout definition.
+*
+*/
+
+
+
+#ifndef C_ALFANCHORLAYOUT_H
+#define C_ALFANCHORLAYOUT_H
+
+#include <alf/alflayout.h> 
+
+/** for internal use only */
+enum TAlfAnchorBitmask
+    { 
+    EAlfAnchorBitmaskHorizontal = 0x000F,
+    EAlfAnchorBitmaskVertical = 0x00F0
+    };
+
+/** for internal use only */
+enum TAlfAnchorBitmaskShift
+   {
+    EAlfAnchorBitmaskShiftHorizontal = 0,
+    EAlfAnchorBitmaskShiftVertical = 4
+    };
+
+/** for internal use only */
+enum TAlfAnchorAxis
+    {
+    EAlfAnchorAxisHorizontal = 0,
+    EAlfAnchorAxisVertical = 1
+    };
+
+/** for internal use only */
+enum TAlfAnchorProximity
+    {
+    EAlfAnchorProximityNone = 0,    
+    EAlfAnchorProximitySize,
+    EAlfAnchorProximityNear,
+    EAlfAnchorProximityCenter,
+    EAlfAnchorProximityFar
+    };
+
+/** 
+ * Anchor type. Used to determine which edge or corner of a child visual is 
+ * defined by an anchor.
+ *
+ * @note that if width or height are used as one anchor, they must be combined 
+ * with an appropriate anchor in order to unambiguously determine the size and 
+ * position of the child.
+ */
+enum TAlfAnchorType
+    {
+    EAlfAnchorTypeNone = EAlfAnchorProximityNone,
+    
+    EAlfAnchorTypeWidth = EAlfAnchorProximitySize << EAlfAnchorBitmaskShiftHorizontal,
+    EAlfAnchorTypeLeft = EAlfAnchorProximityNear << EAlfAnchorBitmaskShiftHorizontal,
+    EAlfAnchorTypeHCenter = EAlfAnchorProximityCenter << EAlfAnchorBitmaskShiftHorizontal,
+    EAlfAnchorTypeRight = EAlfAnchorProximityFar << EAlfAnchorBitmaskShiftHorizontal,
+    
+    EAlfAnchorTypeHeight = EAlfAnchorProximitySize << EAlfAnchorBitmaskShiftVertical,
+    EAlfAnchorTypeTop = EAlfAnchorProximityNear << EAlfAnchorBitmaskShiftVertical,
+    EAlfAnchorTypeVCenter = EAlfAnchorProximityCenter << EAlfAnchorBitmaskShiftVertical,
+    EAlfAnchorTypeBottom = EAlfAnchorProximityFar << EAlfAnchorBitmaskShiftVertical,
+    
+    
+    EAlfAnchorTypeSize = EAlfAnchorTypeHeight | EAlfAnchorTypeWidth,
+
+    EAlfAnchorTypeTopLeft = EAlfAnchorTypeTop | EAlfAnchorTypeLeft,
+    EAlfAnchorTypeTopCenter = EAlfAnchorTypeTop | EAlfAnchorTypeHCenter,
+    EAlfAnchorTypeTopRight = EAlfAnchorTypeTop | EAlfAnchorTypeRight,
+
+    EAlfAnchorTypeCenterLeft = EAlfAnchorTypeVCenter | EAlfAnchorTypeLeft,
+    EAlfAnchorTypeCenter = EAlfAnchorTypeVCenter | EAlfAnchorTypeHCenter,
+    EAlfAnchorTypeCenterRight = EAlfAnchorTypeVCenter | EAlfAnchorTypeRight,
+    
+    EAlfAnchorTypeBottomLeft = EAlfAnchorTypeBottom | EAlfAnchorTypeLeft,
+    EAlfAnchorTypeBottomCenter = EAlfAnchorTypeBottom | EAlfAnchorTypeHCenter,
+    EAlfAnchorTypeBottomRight = EAlfAnchorTypeBottom | EAlfAnchorTypeRight
+    };
+
+/** 
+ * Anchor origin, relative to a particular edge or corner. Direction is 
+ * measured along positive x and y axes, as modified by the metric used.
+ */
+enum TAlfAnchorAttachmentOrigin
+    {
+    EAlfAnchorAttachmentOriginNone = EAlfAnchorTypeNone,
+    
+    EAlfAnchorAttachmentOriginLeft = EAlfAnchorTypeLeft,
+    EAlfAnchorAttachmentOriginHCenter = EAlfAnchorTypeHCenter,
+    EAlfAnchorAttachmentOriginRight = EAlfAnchorTypeRight,
+    
+    EAlfAnchorAttachmentOriginTop = EAlfAnchorTypeTop,
+    EAlfAnchorAttachmentOriginVCenter = EAlfAnchorTypeVCenter,
+    EAlfAnchorAttachmentOriginBottom = EAlfAnchorTypeBottom,
+    
+    EAlfAnchorAttachmentOriginTopLeft = EAlfAnchorTypeTopLeft, 
+    EAlfAnchorAttachmentOriginTopCenter = EAlfAnchorTypeTopCenter, 
+    EAlfAnchorAttachmentOriginTopRight = EAlfAnchorTypeTopRight, 
+
+    EAlfAnchorAttachmentOriginCenterLeft = EAlfAnchorTypeCenterLeft,
+    EAlfAnchorAttachmentOriginCenter = EAlfAnchorTypeCenter, 
+    EAlfAnchorAttachmentOriginCenterRight = EAlfAnchorTypeCenterRight, 
+    
+    EAlfAnchorAttachmentOriginBottomLeft = EAlfAnchorTypeBottomLeft, 
+    EAlfAnchorAttachmentOriginBottomCenter = EAlfAnchorTypeBottomCenter, 
+    EAlfAnchorAttachmentOriginBottomRight = EAlfAnchorTypeBottomRight
+    };
+    
+/** 
+ * Type of attachment point used when attaching an anchor to another
+ * anchor in the same layout.
+ */
+enum TAlfAnchorAttachmentType
+    {
+    EAlfAnchorAttachToParent = -1
+    };
+    
+    
+/** 
+ * Determines which corner of a child visual is positioned by the anchor
+ * @deprecated, only retained for use with deprecated SetAnchor routines, use
+ *                        TAlfAnchorAttachmentOrigin instead with new APIs
+ */
+enum TAlfAnchor
+    {
+    /** Anchor that defines the top left corner of a visual. */
+    EAlfAnchorTopLeft,
+
+    /** Anchor that defines the bottom right corner of a visual. */
+    EAlfAnchorBottomRight
+    };
+
+/** 
+ * Anchor origins.
+ * @deprecated, only retained for use with deprecated SetAnchor routines, use
+ *                        TAlfAnchorAttachmentOrigin instead with new APIs
+ */
+enum TAlfAnchorOrigin
+    {
+    EAlfAnchorOriginLeft,
+    EAlfAnchorOriginHCenter,
+    EAlfAnchorOriginRight,
+    EAlfAnchorOriginTop,
+    EAlfAnchorOriginVCenter,
+    EAlfAnchorOriginBottom
+    };
+
+
+/** 
+ *Anchor metric types, for offsets and sizes.
+ * @deprecated, only retained for use with deprecated SetAnchor routines, use
+ *                        TAlfMetric instead with new APIs
+ */
+enum TAlfAnchorMetric
+    {
+    /** Use absolute pixel coordinates to specify the values. */        
+    EAlfAnchorMetricAbsolute,
+    /** 
+     * Use the size of the visual 
+     * either normalized between 0.0 (at origin) and 1.0 (farthest away edge)
+     * or -0.5 (min) and +0.5 (0.0 being always at the origin). For example if you 
+     * use EAlfAnchorOriginLeft with EAlfAnchorMetricRelativeToSize, the 
+     * left edge is at 0.0, and the right edge at 1.0. But if you use any of 
+     * the center origins (EAlfAnchorOriginHCenter or EAlfAnchorOriginVCenter),
+     * then the left/top edge is at -0.5 and right/top edge is at +0.5.
+     */
+    EAlfAnchorMetricRelativeToSize
+    };
+
+class TAlfTimedPoint;
+class CAlfControl;
+
+/**
+ * CAlfAnchorLayout is a layout that allows visuals to be positioned with 
+ * flexible relative anchor points. 
+ *
+ * To use this class, an anchor layout is created, and then a number of anchors
+ * are added to it using calls to the Attach() methods. The visuals
+ * inside the layout will be stretched between these anchor points.
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+class CAlfAnchorLayout : public CAlfLayout
+    {
+
+public:
+
+    /**
+     * Two-phased constructor, which attach new object into the control.
+     * @param aOwnerControl Control that owns this new obejct.
+     * @param aParentLayout If given, the new object is set as child.
+     */
+    IMPORT_C static CAlfAnchorLayout* AddNewL(CAlfControl& aOwnerControl,
+                                              CAlfLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C CAlfAnchorLayout();
+
+    /**
+     * From CAlfLayout. Second-phase constructor.
+     */
+    IMPORT_C void ConstructL(CAlfControl& aOwner);
+
+    /**
+     * Virtual destructor.
+     */
+    IMPORT_C ~CAlfAnchorLayout();
+    
+    /**
+     * Resets all the anchors.
+     */
+    IMPORT_C void Reset();
+
+    /**
+     * Anchors a child visual's corner to specific position within this layout.
+     *
+     * @deprecated, use new @c Attach APIs with TAlfMetric support.
+     * See the relevant API documentation for an example of how to migrate your code
+     *
+     * Each child can have two anchors: the top left and bottom right corners 
+     * of the child visual. These anchors can be fastened to any point within 
+     * this layout, as specified by the other parameters.
+     *
+     * In a typical case you set two anchors (both EAlfAnchorTopLeft and 
+     * EAlfAnchorBottomRight), which specifies both size and position for the 
+     * child. However it is also possible to set only the EAlfAnchorTopLeft 
+     * anchor, which only positions the child without affecting it's size.
+     * 
+     * @see RemoveAnchor() to remove an achor definition.
+     * 
+     * @note  After updating anchors, you should call 
+     *        CAlfLayout::UpdateChildrenLayout(), to cause the anchors to be 
+     *        applied to child positions and/or sizes.
+     * 
+     * For example the following code will anchor child visual number 0 in 
+     * the middle of the layout, with a 25% border around the outside:
+     *
+     * \code
+     *      // set top left corner position of 1st child ..
+     *	    iLayout->SetAnchor(EAlfAnchorTopLeft, 0,
+     *	        EAlfAnchorOriginLeft, 
+     *          EAlfAnchorOriginTop,
+     *          EAlfAnchorMetricRelativeToSize, // With EAlfAnchorOriginLeft means that 0.0 goes to left edge, and 1.0 to the right
+     *          EAlfAnchorMetricRelativeToSize, // With EAlfAnchorOriginTop means that 0.0 goes to top edge, and 1.0 to the bottom
+     *          TAlfTimedPoint(0.25, 0.25));
+     *      // .. and set the bottom right corner also to fix the size
+     * 	    iLayout->SetAnchor(EAlfAnchorBottomRight, 0,
+     *	        EAlfAnchorOriginRight, 
+     *          EAlfAnchorOriginBottom,
+     *   	EAlfAnchorMetricRelativeToSize, 
+     *          EAlfAnchorMetricRelativeToSize,
+     *          TAlfTimedPoint(-0.25, -0.25)); 
+     * \endcode
+     *
+     * @todo  Specifying a transition in the timed point may be useless:
+     *        layouts are evaluated pretty seldom.
+     *
+     * @param aAnchor       Type of the anchor (either EAlfAnchorTopLeft for the 
+     *                      top left corner or EAlfAnchorBottomRight for bottom right
+     *                      corner).
+     * @param aOrdinal      Ordinal of the child visual that this anchor applies to.
+     * @param aHorizOrigin  Horizontal origin for the anchor position (aPosition). 
+     *                      Defines the point inside the layout on which the 
+     *                      evaluation of the child's placement is based. May be 
+     *                      EAlfAnchorOriginLeft (left edge), 
+     *                      EAlfAnchorOriginHCenter (center) or
+     *                      EAlfAnchorOriginRight (right edge).
+     * @param aVertOrigin   Vertical origin for the anchor position (aPosition). 
+     *                      Defines the point inside the layout on which the 
+     *                      evaluation of the child's placement is based. Possible options 
+     *                      are EAlfAnchorOriginTop (top), EAlfAnchorOriginVCenter 
+     *                      (center) and EAlfAnchorOriginBottom (bottom).
+     * @param aHorizMetric  Specifies the metric to use to define the
+     *                      horizontal position: EAlfAnchorMetricAbsolute to use 
+     *                      absolute pixels or EAlfAnchorMetricRelativeToSize to 
+     *                      use normalized values relative to layout size.
+     * @param aVertMetric   Specifies the metric used in the vertical position:
+     *                      EAlfAnchorMetricAbsolute to use absolute pixels or 
+     *                      EAlfAnchorMetricRelativeToSize to use normalized 
+     *                      values relative to layout size.     
+     * @param aPosition     The achor position as an offset from the origin point, 
+     *                      applied using the metric specified with aHorizMetric 
+     *                      and aVertMetric.
+     * @return                   Error code
+     *
+     */
+    IMPORT_C TInt SetAnchor(
+        TAlfAnchor aAnchor, 
+        TInt aOrdinal,
+        TAlfAnchorOrigin aHorizOrigin,
+        TAlfAnchorOrigin aVertOrigin,
+        TAlfAnchorMetric aHorizMetric,
+        TAlfAnchorMetric aVertMetric,
+        const TAlfTimedPoint& aOffset);
+        
+    /**
+	 * Convenience method for setting top left and bottom right anchors in a single call.
+	 *
+	 * This method sets size-relative anchors for a single child visual.
+	 *
+	 * @param aOrdinal           Ordinal of child visual to set anchors for.
+     * @param aTlHorizOrigin     Horizontal origin for the top left anchor position (aPosition). 
+     *                           Defines the point inside the layout on which the 
+     *                           evaluation of the child's placement is based. May be 
+     *                           EAlfAnchorOriginLeft (left edge), 
+     *                           EAlfAnchorOriginHCenter (center) or
+     *                           EAlfAnchorOriginRight (right edge).
+     * @param aTlVertOrigin      Vertical origin for the top left anchor position (aPosition). 
+     *                           Defines the point inside the layout on which the 
+     *                           evaluation of the child's placement is based. Possible options 
+     *                           are EAlfAnchorOriginTop (top), EAlfAnchorOriginVCenter 
+     *                           (center) and EAlfAnchorOriginBottom (bottom).
+     * @param aTopLeftOffset     The achor position as an offset from the origin point, 
+     * @param aBrHorizOrigin     Horizontal origin for the bottom right anchor position (aPosition). 
+     *                           Defines the point inside the layout on which the 
+     *                           evaluation of the child's placement is based. May be 
+     *                           EAlfAnchorOriginLeft (left edge), 
+     *                           EAlfAnchorOriginHCenter (center) or
+     *                           EAlfAnchorOriginRight (right edge).
+     * @param aBrVertOrigin      Vertical origin for the bottom right anchor position (aPosition). 
+     *                           Defines the point inside the layout on which the 
+     *                           evaluation of the child's placement is based. Possible options 
+     *                       	 are EAlfAnchorOriginTop (top), EAlfAnchorOriginVCenter 
+     *                           (center) and EAlfAnchorOriginBottom (bottom).     
+     * @param aBottomRightOffset The achor position as an offset from the origin point,      
+     * @return                   Error code.
+     * 
+	 *
+	 * @see CAlfAnchorLayout::SetAnchor() for more information about anchors.
+	 */
+    IMPORT_C TInt SetRelativeAnchorRect(TInt aOrdinal,
+                                        TAlfAnchorOrigin aTlHorizOrigin,
+                                        TAlfAnchorOrigin aTlVertOrigin,
+                                        const TAlfRealPoint& aTopLeftOffset,
+                                        TAlfAnchorOrigin aBrHorizOrigin,
+                                        TAlfAnchorOrigin aBrVertOrigin,
+                                        const TAlfRealPoint& aBottomRightOffset);
+                                        
+    /**
+     * Undefines an anchor.
+     * @see SetAnchor()
+     * @deprecated instead use @c Detach and see relevant API documentation for
+     *      example code
+     */
+    IMPORT_C void RemoveAnchor(TAlfAnchor aAnchor, TInt aOrdinal);
+
+    /**
+     * Anchors one or more edges of a child visual to a specific position 
+     * within this layout. When combined together, a correctly specified group 
+     * of anchors provide sufficient information for the anchor layout to 
+     * determine the size and position of the child visual.
+     *
+     * Each child can have up to four anchors, each of which correspond to an 
+     * edge. A corner anchor is equivalent to supplying two similar orthogonal 
+     * edge anchors, so typically it is easier to use corners. Therefore, each 
+     * child can have up to two corner anchors, or a mixture of corners and 
+     * edges. Alternatively, four similar edges can be specified in one call by 
+     * supplying a box metric.
+     *
+     * In a typical case you set two different corner anchors (for example both 
+     * EAlfAnchorTypeTopLeft and EAlfAnchorTypeBottomRight), taking care
+     * to ensure that they are sufficiently orthogonal in order to define all needed
+     * coordinates. However it is also possible to set only one corner anchor, 
+     * which only positions the child without affecting it's size. Alternatively,
+     * one anchor can be specified as a corner, and then the other can be 
+     * specified as EAlfAnchorTypeSize; similarly the coordinates along
+     * one axis can be specified by an appropriate combination of edge and 
+     * width or height anchors.
+     *
+     * The position of each anchor relative to this layout is determined
+     * by the choice of origin (i.e. which point of the layout the 
+     * child's is attached to), and the offset position, which is specified
+     * using a TAlfMetric or related type. All available features of 
+     * TAlfMetric may be used to affect the resulting position, providing the 
+     * benefit that different metrics can be used for each child. Also note 
+     * that the metric used will override the base unit that has been set in 
+     * this layout.
+     * 
+     * @note if called again to specify the same anchor types
+     *      that have been previous set, those definitions will be updated. 
+     *      However, in order to change type, it is necessary to detach a 
+     *      previously defined anchor first, as there can only be a maximum 
+     *      of two anchors along each axis (for a given child).
+     * @note that size anchor type and attachment origins are not 
+     *      currenly supported. 
+     * @note that center anchor type is not currently supported.
+     * @note if an anchor of similar type has already been defined it will be 
+     *      replaced, however in general it is easier to manage anchors by 
+     *      removing them all and starting again.
+     * @note  After updating anchors, you should call 
+     *      @c CAlfLayout::UpdateChildrenLayout(), to cause the anchors to be 
+     *      applied to child positions and/or sizes.
+     * 
+     * @see @c Detach() to remove achor definitions for a given ordinal
+     *
+     * For example the following code will anchor three child visuals 0, 1, 2  in 
+     * the middle of the layout, with a 25% border around the outside, such that 
+     * they all occupy the same position:
+     *
+     * \code
+     *      // using edges...
+     *	    iLayout->Attach(0, 
+     *          EAlfAnchorTypeLeft,
+     *          TAlfXYMetric(0.25, EAlfMetricNormalized),
+     *          EAlfAnchorAttachmentOriginLeft);
+     *	    iLayout->Attach(0, 
+     *          EAlfAnchorTypeRight,
+     *          TAlfXYMetric(-0.25, EAlfMetricNormalized),
+     *          EAlfAnchorAttachmentOriginRight);
+     *	    iLayout->Attach(0, 
+     *          EAlfAnchorTypeTop,
+     *          TAlfXYMetric(0.25, EAlfMetricNormalized),
+     *          EAlfAnchorAttachmentOriginTop);
+     *	    iLayout->Attach(0, 
+     *          EAlfAnchorTypeBottom,
+     *          TAlfXYMetric(-0.25, EAlfMetricNormalized),
+     *          EAlfAnchorAttachmentOriginBottom);
+     *
+     *      // using corners...
+     *	    iLayout->Attach(1, 
+     *          EAlfAnchorTypeTopLeft,
+     *          TAlfXYMetric(0.25, EAlfMetricNormalized),
+     *          EAlfAnchorAttachmentOriginTopLeft);
+     * 	    iLayout->Attach(1, 
+     *	        EAlfAnchorTypeBottomRight, 
+     *         TAlfXYMetric(-0.25, EAlfMetricNormalized),
+     *	        EAlfAnchorAttachmentOriginBottomRight);
+     * 
+     *      // .. and using a box
+     * 	    iLayout->Attach(2, TAlfBoxMetric(
+     *          TAlfMetric(0.25, EAlfMetricNormalized),
+     *          TAlfMetric(-0.25, EAlfMetricNormalized),
+     *          TAlfMetric(0.25, EAlfMetricNormalized),
+     *          TAlfMetric(-0.25, EAlfMetricNormalized)));
+     * \endcode
+     *
+     * @param aOrdinal      Ordinal of the child visual that this anchor applies to
+     * @param aType       Type of the anchor, which determines how and where the anchor attaches to this layout
+     * @param aOffset     The anchor position as an offset from the origin point,
+     *      specifying both the magnitude and units of the offset for the relevant axes.
+     * @param aAttachmentOrigin  Origin for the anchor offset.
+     *      Defines the point inside the layout from which the 
+     *      evaluation of the child's placement is based. 
+     * @param aAttachmentOrdinal    the ordinal of the anchor to which this anchor is attached, 
+     *      use the default value of EAlfAnchorAttachToParent in order to attach to parent
+     * @return Error code
+     *
+     */
+    IMPORT_C TInt Attach(
+        TInt aOrdinal,
+        TAlfAnchorType aType, 
+        const TAlfMetric& aOffset,
+        TAlfAnchorAttachmentOrigin aAttachmentOrigin,
+        TInt aAttachmentOrdinal = EAlfAnchorAttachToParent);
+
+    /** 
+     * Attach a corner of a child visual  to a specific position 
+     * within this layout. 
+     *
+     * @see Attach() for all API documentation
+     */
+    IMPORT_C TInt Attach(
+        TInt aOrdinal,
+        TAlfAnchorType aType, 
+        const TAlfXYMetric& aOffset,
+        TAlfAnchorAttachmentOrigin aAttachmentOrigin = EAlfAnchorAttachmentOriginTopLeft,
+        TInt aAttachmentOrdinal = EAlfAnchorAttachToParent);
+
+    /** 
+     * Attach all four edges of a child visual  to a specific position 
+     * within this layout.
+     *
+     * @note, will detach all existing edges first. In case of error, all
+     * edges that were successfull added before the error occurred will be 
+     * detached.
+     *
+     * @see Attach() for all API documentation
+     * @param aAttachmentOrigin if set to EAlfAnchorAttachmentOriginNone, each edge will 
+     *        be attached to the corresponding edge
+     */
+    IMPORT_C TInt Attach(
+        TInt aOrdinal,
+        const TAlfBoxMetric& aOffset,
+        TAlfAnchorAttachmentOrigin aAttachmentOrigin = EAlfAnchorAttachmentOriginTopLeft,
+        TInt aAttachmentOrdinal = EAlfAnchorAttachToParent);
+
+
+    /**
+     * Undefines all anchors for a specified ordinal. Has no effect if the specified ordinal
+     * cannot be found.
+     *
+     * @see Attach()
+     * 
+     * @param aOrdinal the ordinal of the anchor to remove
+     */
+    IMPORT_C void Detach(TInt aOrdinal);
+    
+    /**
+     * Undefines an anchor. Has no effect if the specified anchor type 
+     * cannot be found. For example to detach a corner anchor with ordinal
+     * equal to zero:
+     *
+     * \code
+     *      iLayout->Detach(0, EAlfAnchorTypeTopLeft);
+     * \endcode
+     *
+     * @see Attach()
+     * @note can be used to separately remove the edges 
+     * that were attached using different combinations of types, 
+     * but try to be consistent in using either edges or corners to avoid 
+     * confusion.
+     * 
+     * @param aOrdinal the ordinal of the anchor to remove
+     * @param aType the edge relating to the anchor to remove
+     */    
+    IMPORT_C void Detach(TInt aOrdinal, TAlfAnchorType aType);
+
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void RemoveAndDestroyAllD();
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0);
+    IMPORT_C CAlfVisual* FindTag(const TDesC8& aTag);
+
+    /** 
+     * From CAlfLayout
+     * @see CAlfLayout
+     */
+    IMPORT_C TAlfXYMetric BaseUnit() const; 
+
+
+protected:
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void DoRemoveAndDestroyAllD();
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+                                
+private:
+
+    // Private data structure. Owned.
+    struct TAnchorLayoutPrivateData;
+    TAnchorLayoutPrivateData* iAnchorLayoutData;
+
+    };
+
+
+
+#endif // C_ALFANCHORLAYOUT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfbatchbuffer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,172 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   API to control the command batch buffer
+*
+*/
+
+
+
+
+#ifndef C_ALFBATCHBUFFER_H
+#define C_ALFBATCHBUFFER_H
+ 
+#include <e32base.h>
+
+class CAlfEnv;
+
+/**
+ * Auto flush modes
+ * @see SetAutoFlushMode, AutoFlushMode
+ */
+enum TAlfAutoFlushMode
+    {
+    // Batch buffer is flushed automatically by scheduler = default
+    EAlfAutoFlushDeferred = 0, 
+    
+    // Every command is flushed instantly i.e. no batching
+    EAlfAutoFlushInstant, 
+    
+    // Batch buffer is used but only flushed with 
+    // #1 manual call to FlushBatchBuffer
+    // #2 max buffer limit is reached
+    // #3 OOM when expanding the batch buffer
+    EAlfAutoFlushOnlyForced 
+    };
+ 
+/**
+ * Size modes
+ * @see SetMaxBatchBufferSize
+ */
+const TInt KAlfBatchBufferSizeLimitToSystemDefault = 0;
+const TInt KAlfBatchBufferSizeNoLimit = -1;
+
+
+/**
+ * Info types
+ * @see GetBatchBufferInfo
+ */
+enum TAlfBatchBufferInfoType
+    {
+    // Default buffer size which is used if not overridden.
+    // 100 <= DefaultBufferSize <= 10000 depending on the product.
+    EAlfBatchBufferInfoDefaultBufferSize,
+    
+    // User defined max size. See SetMaxBatchBufferSize for the values.
+    // If user defined: MaxSize >= DefaultBufferSize
+    EAlfBatchBufferInfoMaxSize, 
+     
+    // Currently allocated buffer size.
+    // If not limited: DefaultBufferSize <= CurrentlyAllocated
+    // If limited: DefaultBufferSize <= CurrentlyAllocated <= MaxSize
+    EAlfBatchBufferInfoCurrentlyAllocated,
+    
+    // Size which the commands use from the buffer. 
+    // Always: CommandsAllocate <= CurrentlyAllocated 
+    EAlfBatchBufferInfoCommandsAllocate
+    };
+
+/**
+ *  API to control the command batch buffer
+ *
+ *  @code
+ *   CAlfBatchBuffer& batchBuffer = iEnv->BatchBufferHandler();
+ *
+ *   // Get the batch buffer max size in bytes
+ *   const TInt maxSize = batchBuffer.GetBatchBufferInfo( EAlfBatchBufferInfoMaxSize );
+ *
+ *   // Flush manually
+ *   batchBuffer.FlushBatchBuffer();
+ *  @endcode
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CAlfBatchBuffer ): public CBase
+    {
+    
+public:
+
+    /**
+     * Two-phased constructor.
+     * @param aEnv Environment class
+     * @return New instance. Ownership returned.
+     */
+    static CAlfBatchBuffer* NewL( CAlfEnv& aEnv );
+
+
+    /**
+    * Destructor.
+    */
+    virtual ~CAlfBatchBuffer();
+
+    /**
+     * Sets the automatic flush mode.
+     *
+     * @param aAutoFlushMode - see TAutoFlushMode
+     */    
+    IMPORT_C void SetAutoFlushMode( TAlfAutoFlushMode aAutoFlushMode );
+    
+    /**
+     * Returns the automatic flush mode.
+     *
+     * @return Auto-flush mode - see TAlfAutoFlushMode.
+     */         
+    IMPORT_C TAlfAutoFlushMode AutoFlushMode() const;
+    
+    /**
+     * Flushes the batch buffer manually.
+     *
+     * Even on error case, the buffer is emptied.
+     *
+     * @return Symbian OS error code.
+     */
+    IMPORT_C TInt FlushBatchBuffer();
+    
+    /**
+     * Controls the batch buffer size. 
+     *
+     * When the buffer reaches the max size, it will be automatically flushed
+     * if mode not equals EAutoFlushNever.
+     *
+     * The buffer will be also flushed, if expanding the buffer fails in OOM.
+     *
+     * @param aBufferSize 
+     *        >0 Batch buffer size in bytes. If < default size, 
+     *          the default size will be used.
+     *        KAlfBatchBufferSizeLimitToSystemDefault uses the default size.
+     *        KAlfBatchBufferSizeNoLimit re-allocates a bigger 
+     *          buffer when needed until OOM.
+     */
+    IMPORT_C void SetMaxBatchBufferSize( TInt aBufferSize );
+    
+    /**
+     * Get info about the batch buffer. 
+     *
+     * @param aBufferInfoType See TAlfBatchBufferInfoType
+     *
+     * @return Value in bytes.
+     */
+    IMPORT_C TInt GetBatchBufferInfo( TAlfBatchBufferInfoType aBufferInfoType ) const;
+    
+private:
+
+    CAlfBatchBuffer();
+    void ConstructL( CAlfEnv& aEnv );
+private: // data
+
+    struct TBatchBufferData;
+    TBatchBufferData* iData;
+    };
+
+#endif // C_ALFBATCHBUFFER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfbitmapprovider.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Bitmap provider interface.
+*
+*/
+
+
+
+#ifndef C_ALFBITMAPPROVIDER_H
+#define C_ALFBITMAPPROVIDER_H
+
+class CFbsBitmap;
+
+/** 
+ * MAlfBitmapProvider is an interface that provides a bitmap and its alpha 
+ * mask when requested.
+ * 
+ * By storing MAlfBitmapProviders in the CAlfTextureManager we can delete and 
+ * regenerate the textures used by the toolkit as needed - enabling improved 
+ * use of memory resource, such as when the application goes to background.
+ * In this case, when we want to restore all the textures, we may just recall 
+ * the providers to reload the textures. 
+ *
+ * Typically, control classes would implement the ProvideBitmapL method of this
+ * class, which would handle all the loading or generation needed to produce the
+ * bitmaps stored by the TextureManager.
+ * 
+ * A provider should exist as long as the associated texture is stored within
+ * the texture manager.
+ */
+class MAlfBitmapProvider 
+    {
+public:
+
+    virtual ~MAlfBitmapProvider()
+        {
+        }
+            
+    /**
+     * Provide a bitmap and mask from the given UID.
+     * This method should create a bitmap and its mask, usually by loading it from disk.
+     *
+     * @param aId      TextureManager id of this bitmap, may be used for extracting
+     *                 an icon resource.
+     * @param aBitmap  Output parameter for the provider: On return, has to store 
+     *                 a pointer to the generated bitmap. Ownership transferred to caller.
+     *                 The support for input CFbsBitmap formats varies between 
+     *                 different renderers. See \ref cfbsbitmapsupport 
+     *                 Table describing renderer bitmap support.      
+     * @param aMaskBitmap  
+     *                 Output parameter for the provider: On return, has to store 
+     *                 a pointer to the generated alpha mask or <code>NULL</code> 
+     * 				   if there is no mask. Ownership of the bitmap is transferred 
+     *                 to the caller.
+     * 
+     * @see CAlfTextureManager::CreateTextureL()
+     */
+     virtual void ProvideBitmapL(TInt aId, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap) = 0;
+    
+    };
+
+
+#endif // C_ALFBITMAPPROVIDER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfborderbrush.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,239 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Border brush definition
+*
+*/
+
+
+
+#ifndef C_ALFBORDERBRUSH_H
+#define C_ALFBORDERBRUSH_H
+
+#include <alf/alfbrush.h>
+
+class CAlfEnv;
+class TRgb;
+class TAlfImage;
+struct TAlfXYMetric;
+
+/**
+ * Border brush draws borders for visuals.
+ * Border brush draws a border at a configurable distance. It can be inside
+ * or outside the visual edges. The horizontal and vertical edges can be
+ * configured separately. The border can either be a solid color or
+ * texture-mapped. A texture offset is supported for animated texture mapping.
+ *  
+ *  Usage:
+ *  @code
+ * 
+ *   // Creates a 2-unit pixel-border brush and adds it to a visual.
+ *   CAlfBorderBrush* borderBrush = CAlfBorderBrush::NewL( *iEnv, TAlfXYMetric(TAlfMetric(2)),
+ *              TAlfXYMetric(TAlfMetric(2, EAlfUnitPixel),
+ *              TAlfMetric(2, EAlfUnitPixel)));
+ * 	//Enable brush
+ *   visualWithBorders->EnableBrushesL();
+ * 
+ * 	//Add border brush in brush array, with ownership trnasfered to brush array
+ *  visualWithBorders->Brushes()->AppendL( borderBrush, EAlfHasOwnership );
+ * 
+ *  //Cleanup
+ *   borderBrush = 0; // ownership transferred to the brush array
+ * 
+ *  @endcode
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfBorderBrush ) : public CAlfBrush
+    {
+
+public:
+ 
+    /**
+     * Constructor.
+     * @param aEnv Environment
+     * @param aThickness Border width in specified metric units.
+     * @param aEdgeOffset Border edge offset in specified metric units.
+     *
+     */
+    IMPORT_C static CAlfBorderBrush* NewL(
+        CAlfEnv& aEnv,
+        const TAlfXYMetric& aThickness,
+        const TAlfXYMetric& aEdgeOffset);
+
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     * @param aEnv Environment
+     * @param aThickness Border width in specified metric units.
+     * @param aEdgeOffset Border edge offset in specified metric units.
+     */
+    IMPORT_C static CAlfBorderBrush* NewLC(
+        CAlfEnv& aEnv,
+        const TAlfXYMetric& aThickness,
+        const TAlfXYMetric& aEdgeOffset);
+
+    /**
+     * Constructor.
+     * @deprecated
+     * @param aEnv Environment
+     * @param aThicknessWidth Border width in pixels.
+     * @param aThicknessHeight Border height in pixels.
+     * @param aEdgeOffsetX Edge offset X coordinate in pixels    
+     * @param aEdgeOffsetY Edge offset Y coordinate in pixels    
+     *
+     */
+    IMPORT_C static CAlfBorderBrush* NewL(
+        CAlfEnv& aEnv,
+        TInt aThicknessWidth, 
+        TInt aThicknessHeight,
+        TInt aEdgeOffsetX, 
+        TInt aEdgeOffsetY );
+
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     * @deprecated
+     * @param aEnv Environment
+     * @param aThicknessWidth Border width in pixels.
+     * @param aThicknessHeight Border height in pixels.
+     * @param aEdgeOffsetX Edge offset X coordinate in pixels    
+     * @param aEdgeOffsetY Edge offset Y coordinate in pixels    
+     */
+    IMPORT_C static CAlfBorderBrush* NewLC(
+        CAlfEnv& aEnv,
+        TInt aThicknessWidth, 
+        TInt aThicknessHeight,
+        TInt aEdgeOffsetX, 
+        TInt aEdgeOffsetY );
+    
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfBorderBrush();
+    
+    /**
+     * Sets an image for the borders.
+     *
+     * @param aImage  Texture image for the borders.
+     */
+    IMPORT_C void SetImage(const TAlfImage& aImage);
+    
+    /**
+     * Returns the border image.
+     */
+    IMPORT_C const TAlfImage& Image() const;
+
+    /**
+     * Sets a color for the borders.
+     *
+     * @param aColor Border color.
+     */
+    IMPORT_C void SetColor(const TRgb& aColor);
+    
+    /**
+     * Gets border thickness in currently used metric units.
+     *
+     * @return Border thickness
+     */
+    IMPORT_C const TAlfTimedPoint& Thickness() const;
+
+    /**
+     * Sets border thickness in currently used metric units.
+     *
+     * @param aThickness Border thickness
+     */
+    IMPORT_C void SetThickness(const TAlfTimedPoint& aThickness);
+
+    /**
+     * Sets border thickness and used metric unit type.
+     *
+     * @param aThickness Border thickness including metric unit type.
+     */
+    IMPORT_C void SetThickness(const TAlfXYMetric& aThickness);
+    
+    /**
+     * Gets edge offset in currently used metric units.
+     *
+     * @return Border edge offset
+     */
+    IMPORT_C const TAlfTimedPoint& EdgeOffset() const;
+
+    /**
+     * Sets edge offset in currently used metric units.
+     *
+     * @param aEdgeOffset Border edge offset.
+     */
+    IMPORT_C void SetEdgeOffset(const TAlfTimedPoint& aEdgeOffset);
+
+    /**
+     * Sets edge offset and used metric unit type.
+     *
+     * @param aEdgeOffset Border edge offset including metric unit type.
+     */
+    IMPORT_C void SetEdgeOffset(const TAlfXYMetric& aEdgeOffset);
+    
+    /**
+     * Gets image offset in currently used metric units.
+     *
+     * @return Image offset
+     */
+    IMPORT_C const TAlfTimedPoint& ImageOffset() const;
+
+    /**
+     * Sets image offset in currently used metric units.
+     *
+     * @param aImageOffset Image offset.
+     */
+    IMPORT_C void SetImageOffset(const TAlfTimedPoint& aImageOffset);
+
+    /**
+     * Sets image offset and used metric unit type.
+     *
+     * @param aImageOffset Image offset including metric unit type.
+     */
+    IMPORT_C void SetImageOffset(const TAlfXYMetric& aImageOffset);
+
+private:
+
+    /**
+     * 1st pahse constructor.
+     */
+    CAlfBorderBrush();
+
+    /**
+     * 2nd phase constructor.
+     */
+    void ConstructL(
+        CAlfEnv& aEnv,
+        const TAlfXYMetric& aThickness,
+        const TAlfXYMetric& aEdgeOffset);
+
+    /**
+     * 2nd phase constructor.
+     */
+    void ConstructL(
+        CAlfEnv& aEnv,
+        TInt aThicknessWidth, 
+        TInt aThicknessHeight,
+        TInt aEdgeOffsetX, 
+        TInt aEdgeOffsetY);
+        
+private:
+
+    struct TBorderBrushPrivateData;
+    TBorderBrushPrivateData* iBorderBrushData;
+
+    };
+
+
+
+#endif // C_ALFBORDERBRUSH_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfbrush.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 class for all brushes.
+*
+*/
+
+
+
+#ifndef C_ALFBRUSH_H
+#define C_ALFBRUSH_H
+
+#include <e32base.h>
+#include <alf/alftimedvalue.h>
+#include <alf/alfpropertyowner.h>
+
+class CAlfGenComponent;
+class CAlfEnv;
+class CAlfBrushArray;
+
+/** Brush layers. */
+enum TAlfBrushLayer
+    {
+    EAlfBrushLayerBackground,
+    EAlfBrushLayerForeground
+    };
+
+/**
+ * A brush implements a series of graphics drawing operations. Brushes are 
+ * attached to visuals and drawn whenever the visual is drawn. Brushes can 
+ * be used for augmenting the normal appearance of visuals with graphical 
+ * features such as background pictures, gradients, overlay icons, and 
+ * selection highlights.
+ * This is base class for all brushes and it cannot be instantiated. 
+ * 
+ *  Usage:
+ *  @code
+ * 
+ * //Sets the brush layer
+ *   myBrush->setLayer( EAlfBrushLayerForeground );
+ * 
+ *  @endcode
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+class CAlfBrush : public CAlfPropertyOwner
+    {
+
+public:
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CAlfBrush();
+    
+    /**
+     * Get opacity
+     *
+     * @return Opacity in TAlfTimedValue
+     */
+    IMPORT_C const TAlfTimedValue& Opacity() const;
+    
+    /**
+     * Set opacity
+     *
+     * @param aOpacity New opacity value.
+     */
+    IMPORT_C void SetOpacity( const TAlfTimedValue& aOpacity );
+    
+    /**
+     * Set the layer
+     *
+     * @param aLayer Layer (foreground/backgroud).
+     */
+    IMPORT_C void SetLayer(TAlfBrushLayer aLayer);
+
+    /**
+     * Sets whether the brush can draw outside brush guide (i.e. visual's) rect
+     * @param aClipToVisual If ETrue, drawing is clipped to visuals area. 
+     */
+    IMPORT_C void SetClipToVisual(TBool aClipToVisual);
+    
+    /**
+     * Gets whether the brush can draw outside brush guide (i.e. visual's) rect
+     * @return ETrue if drawing is clipped to visuals area. 
+     */
+    IMPORT_C TBool ClipToVisual() const;
+
+    /**
+     * Return the server side handle
+     *
+     * @return Handle to the server side object. 0 if not set.
+     */
+    IMPORT_C TInt Identifier() const;
+    
+    /**
+     * Return communications
+     *
+     * @return Comms
+     */
+    IMPORT_C CAlfGenComponent* Comms() const;
+    
+    /**
+     * @internal
+     * 
+     * Called when this brush is added into a brush array
+     * @param aContainingArray Brush array in which this brush is added
+     * @return Error code.
+     */
+    TInt AppendContainingArray( CAlfBrushArray& aContainingArray );
+    
+    /**
+     * @internal
+     * 
+     * Called when this brush is removed from a brush array
+     * @param aContainingArray Brush array where this brush is removed from
+     */
+    void RemoveContainingArray( CAlfBrushArray& aContainingArray );
+
+protected:
+
+    /**
+     * Constructor
+     */
+    IMPORT_C CAlfBrush();
+
+    /**
+     * Second phase constructor
+     */
+    IMPORT_C void ConstructL( 
+        CAlfEnv& aEnv,
+        TInt aImplementationId, 
+        TInt aImplementationUid, 
+        const TDesC8& aConstructionParams );
+    
+    IMPORT_C void ConstructL();
+
+    /** ! future proofing */
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+
+private: // data
+
+    // Private data. Owned.
+    struct TPrivateData;
+    TPrivateData* iData;
+
+    };
+
+
+
+#endif // C_ALFBRUSH_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfbrusharray.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,168 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Place holder for brushes.
+*
+*/
+
+
+
+#ifndef C_ALFBRUSHARRY_H
+#define C_ALFBRUSHARRY_H
+
+#include <e32base.h>
+#include <alf/alfownership.h>
+
+class CAlfBrush;
+class CAlfVisual;
+
+/**
+ *  Array for brushes.
+ *
+ *  This client object can store owned items, but all the real objects
+ *  are on the server side. Also, the order of brushes is maintained on
+ *  the server side.
+ *  
+ * Usage:
+ * @code
+ * 
+ * //Create Visual
+ * CAlfTextVisual* textVisual = control.AppendVisualL( EAlfVisualTypeText, NULL );
+ * 
+ * //Create border brush
+ * CAlfBorderBrush* borderBrush = CAlfBorderBrush::NewL( *iEnv, TAlfXYMetric(TAlfMetric(1)),
+ *             TAlfXYMetric(TAlfMetric(KAlfDefaultBorderBrushEdgeOffsetX, EAlfUnitPixel),
+ *             TAlfMetric(KAlfDefaultBorderBrushEdgeOffsetY, EAlfUnitPixel)));
+ * 
+ * //Enable brush
+ * textVisual->EnableBrushesL();
+ * 
+ * //Get brush array
+ * CAlfBrushArray* brushArray = textVisual->Brushes();
+ * 
+ * //Append border brush in brush array, with ownership transfered
+ * brushArray->AppendL( borderBrush, EAlfHasOwnership );
+ * 
+ * //removes and deletes border brush in brush array
+ * brushArray->Remove(0);
+ * 
+ * //Cleanup
+ * delete iEnv; //Will delete visual , brush array as well.
+ * 
+ * @endcode
+ * 
+ * @lib alfclient.lib 
+ * @since S60 v3.2
+ */
+NONSHARABLE_CLASS(CAlfBrushArray) : public CBase
+    {
+
+public:
+
+    /**
+     * Constructor.
+     */
+    static CAlfBrushArray* NewL( CAlfVisual& aOwner );
+
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfBrushArray();
+    
+    /**
+     * Resets the array
+     */
+    IMPORT_C void Reset();
+
+    /**
+     * Appends a new brush to the array.
+     *
+     * @param aBrush      Brush instance.
+     * @param aOwnership  Ownership of the brush.
+     */
+    IMPORT_C void AppendL( CAlfBrush* aBrush, TAlfOwnership aOwnership );
+    
+    /**
+     * Inserts a brush to the array.
+     *
+     * @param aPos        Index for the new brush instance.
+     * @param aBrush      Brush instance.
+     * @param aOwnership  Ownership of the brush.
+     */
+    IMPORT_C void InsertL(TInt aPos, CAlfBrush* aBrush, TAlfOwnership aOwnership);
+    
+    /**
+     * Removes a brush from the array. If the array has ownership of the 
+     * brush, it will be deleted.
+     *
+     * @param aPos  Index of the brush instance to remove.
+     */
+    IMPORT_C void Remove(TInt aPos);
+
+    /** 
+     * Count the number of brushes in the array.
+     *
+     * @return  Number of brushes.
+     */
+    IMPORT_C TInt Count() const;    
+    
+    /**
+     * Returns a reference to a brush in the array.
+     *
+     * @param aPos  Index.
+     */
+    IMPORT_C CAlfBrush& operator [] (TInt aPos);
+
+    /**
+     * Returns a reference to a brush in the array.
+     *
+     * @param aPos  Index.
+     */
+    IMPORT_C CAlfBrush& At(TInt aPos);
+
+    /**
+     * @internal
+     *
+     * Called when a brush is deleted
+     * @param aBrush Deleted brush
+     */
+    void HandleBrushDestroyed( CAlfBrush& aBrush );
+
+private:
+
+    /**
+     * Constructor.
+     */
+    CAlfBrushArray();
+
+    /**
+     * Constructor.
+     */
+    void ConstructL( CAlfVisual& aOwner );
+
+    /**
+     * Remove a brush, plus owned brushes.
+     * @param aBrush Brushes owned by this brush array will be removed.
+     * @param aPosIndex This brush index will be removed if it is >= 0.
+     */
+    void RemoveBrush(CAlfBrush* aBrush, TInt aPosIndex = -1);
+    
+private: // data
+
+    // Private data structure. Owned.
+    struct TPrivateData;
+    TPrivateData* iData;
+
+    };
+    
+#endif // C_ALFBRUSHARRY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfcanvasvisual.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,283 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Canvas visual
+*
+*/
+
+
+
+#ifndef C_ALFCANVASVISUAL_H
+#define C_ALFCANVASVISUAL_H
+
+#include <alf/alfvisual.h>
+#include <alf/alftimedvalue.h>
+#include <alf/alfrealline.h>
+#include <alf/alfgc.h>
+#include <gdi.h>
+
+class CAlfControl;
+class CAlfLayout;
+class CAlfGc;
+class CAlfCanvasVisual;
+class CAlfTexture;
+class CAlfTextStyle;
+
+
+/**
+ * Provides callback method for getting notifications when there is a need 
+ * to update the canvas content. 
+ *
+ * Implementation of this method should do the drawing using given canvas
+ * and its drawing methods.
+ *
+ * @param aCanvas Canvas visual which is about to be refreshed.
+ */
+class MAlfCanvasObserver
+    {
+public:
+    virtual void UpdateCanvas(CAlfCanvasVisual& aCanvas) = 0;
+    };
+
+/**
+ *  Canvas visual can be used to draw custom graphics such as images, texts, 
+ *  lines, polygons,...into the display using simple drawing primitives.
+ *
+ *  Usage:
+ *  @code
+ *  void CMyCanvasControl::ConstructL()
+ *     {
+ *     ...    
+ *     iCanvasVisual = CAlfCanvasVisual::AddNewL(*this, iLayout);
+ *     iCanvasVisual->SetCanvasObserver(this);
+ *     UpdateCanvas(*iCanvasVisual);
+ *     ...
+ *     }
+ *   
+ *  void CMyCanvasControl::UpdateCanvas(CAlfCanvasVisual& aCanvas)
+ *      {
+ *      aCanvas.BeginDraw();
+ *      aCanvas.SetPenColor(KRgbBlue);
+ *      aCanvas.DrawText(_L("Hello world !"), iTextRect);    
+ *      aCanvas.EndDraw();
+ *      }
+ *
+ *  @endcode
+ * 
+ *  @lib alfclient.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CAlfCanvasVisual ) : public CAlfVisual
+    {
+public:
+    
+    /**
+     * Constructor, which gives ownership to the control.
+     *
+     * @param aOwnerControl The control
+     * @param aParentLayout If given, the parent layout.
+     * @return New instance. Ownership NOT transreffed (owned by control)
+     */
+    IMPORT_C static CAlfCanvasVisual* AddNewL(CAlfControl& aOwnerControl,
+                                            CAlfLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C CAlfCanvasVisual();
+
+    /**
+     * Second-phase constructor.
+     */
+    IMPORT_C void ConstructL(CAlfControl& aOwner);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CAlfCanvasVisual();
+    
+    /**
+     * Sets canvas observer which is responsible for doing the actual drawing
+     * commands into canvas.
+     *
+     * @param aObserver Canvas observer.
+     */
+    IMPORT_C void SetCanvasObserver( MAlfCanvasObserver* aObserver );
+    
+    /**
+     * Prepares the canvas for drawing.
+     * This method should be called before calling any drawing commands
+     */
+    IMPORT_C void BeginDraw();
+
+    /**
+     * Ends the actual drawing on the canvas.
+     * This method should be called after calling last drawing method. 
+     *
+     */
+    IMPORT_C void EndDraw();
+
+    /**
+     * Draws an image on the canvas visual. For more flexible image drawing 
+     * consider using CAlfImageVisual. 
+     *
+     * @param aTexture Image Texture
+     * @param aDestinationRect Bounding rectangle for the image
+     */
+    IMPORT_C void DrawImage(const CAlfTexture& aTexture, const TAlfRealRect& aDestinationRect);    
+    
+    /**
+     * Draws a text on the canvas visual. For more flexible text drawing 
+     * consider using CAlfTextVisual.  
+     *
+     * @param aText Text to be displayed
+     * @param aDestinationRect Bounding rectangle for the text
+     */    
+    IMPORT_C void DrawText(const TDesC& aText, const TAlfRealRect& aDestinationRect);  
+    
+   /**
+     * Draws lines on the canvas visual 
+     * @param aLines Array of Lines which is split into the number of lines specified in aLineCount
+     * @param aLineCount Number of linesl
+     */
+    IMPORT_C void DrawLines(const TAlfRealLine* aLines, TInt aLineCount);
+        
+   /**
+    * Draws ellipse on the canvas visual 
+    * @param aDestinationRect Bounding rectangle for the ellipse
+    */
+    IMPORT_C void DrawEllipse(const TAlfRealRect& aDestinationRect);
+    
+   /**
+    * Draws points  on the canvas visual 
+    * @param aPoints Array of Points to be drawn
+    * @param aPointcount Number of Points
+    */    
+    IMPORT_C void DrawPoints(const TAlfRealPoint* aPoints, TInt aPointCount); 
+
+   /**
+    * Draws a polygon on the canvas visual 
+    * @param aPoints Array of points defining the polygon
+    * @param aPointcount Number of Points
+    */
+    IMPORT_C void DrawPolygon(const TAlfRealPoint* aPoints, TInt aPointCount);
+
+   /**
+    * Draws rectangles on the canvas visual
+    * @param aRects Array of rectangles to be drawn
+    * @param aRectCount Number of rectangles
+    */
+    IMPORT_C void DrawRects(const TAlfRealRect* aRects, TInt aRectCount);
+
+   /**
+    * Sets the Text style. 
+    * Subsequent calls to DrawText will use this Text style
+    * @param aTextStyle Text style
+    */
+    IMPORT_C void SetTextStyle(const CAlfTextStyle& aTextStyle);
+
+   /**
+    * Sets the pen color for an object to be drawn
+    * Subsequent calls to Draw methods will use this pen color
+    * @param 
+    */	
+    IMPORT_C void SetPenColor(const TRgb& aColor);
+
+   /**
+    * Sets the pen width for an object to be drawn
+    * Subsequent calls to Draw methods will use this pen width
+    * @param 
+    */
+	IMPORT_C void SetPenWidth(const TReal32& aWidth);
+
+   /**
+    * Sets the opacity for an object to be drawn
+    * Subsequent calls to Draw methods will use this opacity
+    * @param
+    */
+	IMPORT_C void SetPenOpacity(const TReal32& aOpacity);
+
+   /**
+    * Sets the mode for filling a polygon
+    * @param aPolygonDrawMode Even-Odd fill or Non-Zero fill
+    */
+    IMPORT_C void SetPolygonDrawMode(TAlfPolygonDrawMode aPolygonDrawMode);
+
+   /**
+    * Sets the allignment of Text to be drawn
+    * Subsequent DrawText will draw text with this allignment
+    * @param aAlignHorizontal horizontal allignment
+    * @param aAlignVertical Vertical allignment
+    */
+  	IMPORT_C void SetTextAlign(TAlfAlignHorizontal aAlignHorizontal, TAlfAlignVertical aAlignVertical);
+
+   /**
+    * Loads identity matrix for canvas draw methods. Note that this does not
+    * affect on the visuals transformation that can be accessed using 
+    * CAlfVisual::Transfromation().
+    */
+ 	IMPORT_C void LoadIdentity();
+
+   /**
+    * Translates the canvas
+    * @param aX X-axis offset
+    * @param aY Y-axis offset
+    * @param aZ Z-axis offset
+    */	
+    IMPORT_C void Translate(const TReal32& aX, const TReal32& aY, const TReal32& aZ);
+
+   /**
+    * Scales the canvas
+    * @param aX X-axis offset
+    * @param aY Y-axis offset
+    * @param aZ Z-axis offset
+    */
+    IMPORT_C void Scale(const TReal32& aX, const TReal32& aY, const TReal32& aZ);
+
+   /**
+    * Rotates the canvas
+    * @param aX X-axis offset
+    * @param aY Y-axis offset
+    * @param aZ Z-axis offset
+    */
+    IMPORT_C void Rotate(const TReal32& aAngle, const TReal32& aX, const TReal32& aY, const TReal32& aZ);
+
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void RemoveAndDestroyAllD();
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0);
+    IMPORT_C CAlfVisual* FindTag(const TDesC8& aTag);
+
+
+protected:
+
+    void SendBuffer( const TPtrC8& aBuffer );
+
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void DoRemoveAndDestroyAllD();
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+    
+private:
+
+    struct TCanvasVisualPrivateData;
+    TCanvasVisualPrivateData* iCanvasVisualData;    
+    };
+
+
+#endif // C_ALFCANVASVISUAL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfclientwindow.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,109 @@
+/*
+* 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.
+*
+* Name        : alfclientwindow.h
+* Contributors:
+* Description :  AlfClientWindow class, to post drawing commands to server 
+*                side canvas
+*
+*/
+
+#ifndef ALFCLIENTWINDOW_H_
+#define ALFCLIENTWINDOW_H_
+class CAlfEnv;
+
+ /**
+  * To mention the status of command buffer to be posted
+  */
+enum TAlfCommandBufferStatus 
+   {
+       EComplete,  //Clear the canvas command buffer and post the complete buffer
+       EPartial,   //Partial buffer, dont clear canvas command buffer
+       ELastPart   //Last part of buffer
+   }; 
+
+
+/**
+ * CAlfClientWindow class 
+ *
+ * Represents the client side Alf window, corrosponding to a symbian side RWindow
+ * Client can create own instance of this class and hold the responsibility of cleaning it.
+ * 
+ * Posting the drawing commands through this class can hardware accelerate the commands,
+ * bypassing the windowserver
+ * 
+ * Currently functionality of this class is limited to posting the commands.
+ * Usage: 
+ * @code
+ *
+ * iAlfEnv = CAlfEnv::NewL();
+ * //Create Client window
+ * CAlfClientWindow* alfWindow = CAlfClientWindow::NewL(*iEnv, *rWindow);  
+ * 
+ * //Post drawing commands
+ * alfWindow->PostCommandsL( command, EComplete );
+ *
+ * //destruction
+ * delete alfWindow;
+ * delete iAlfEnv;
+ * @endcode 
+ *
+ */
+
+class CAlfClientWindow: public CBase
+    {
+public:
+    
+    /**
+     * Constructor
+     *
+     * @param   aEnv  Alf Environment
+     * @param   aWindow  RWindow for which the AlfClientwindow is to
+     *                   to be created
+     */
+
+    IMPORT_C static CAlfClientWindow* NewL( CAlfEnv& aEnv, RWindow& aWindow );
+    
+    /**
+     * Constructor
+     */
+    static CAlfClientWindow* NewLC( CAlfEnv& aEnv, RWindow& aWindow );   
+
+    /**
+     * Destructor
+     */
+    IMPORT_C virtual ~CAlfClientWindow(); 
+    
+    /*
+     * PostCommandsL
+     * 
+     *
+     * @param   aCommandBuffer  Serialized commands for HuiCanvasVisual
+     * @param   aStatus  Buffer status
+     *          @see TAlfCommandBufferStatus
+     */
+    IMPORT_C void PostCommandsL( TDes8& aCommandBuffer, TAlfCommandBufferStatus aStatus );
+
+    
+private:  
+
+   /**
+    * 2nd phase constructor
+    */
+    void ConstructL( CAlfEnv& aEnv, RWindow& aWindow );
+	
+    CAlfClientWindow();
+	
+    CAlfEnv* iEnv; //not owned
+    RWindow* iRWindow; //not owned
+    };
+
+#endif /* ALFCLIENTWINDOW_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfcommand.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1174 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef T_ALFCOMMAND_H
+#define T_ALFCOMMAND_H
+
+#include <alf/alfimage.h>
+
+class CAlfControl;
+class TAlfObjectCommand;
+class CAlfEnv;
+class CAlfVisual;
+class CAlfControlGroup;
+class CAlfTextVisual;
+class MAlfEventHandler;
+class CAlfDisplay;
+class CAlfImageVisual;
+class CAlfTransformation;
+
+/**
+ * Command types.
+ * All the commands that can be executed by the toolkit are enumerated here.
+ */
+enum TAlfCommandType
+    {
+  
+    /** None corresponds the base class (TAlfCommand). */
+    EAlfCommandTypeNone = 0,
+    
+    EAlfCommandTypeObject,
+    
+    EAlfCommandTypeAction,
+    
+    EAlfCommandTypeGroup,
+    
+    EAlfCommandTypeControl,
+    
+    EAlfCommandTypeVisual,
+    
+    EAlfCommandTypeImage,
+    
+    EAlfCommandTypeText,
+    
+    EAlfCommandTypeValue,
+    
+    EAlfCommandTypePoint,
+    
+    EAlfCommandTypeTransformation,
+    
+    EAlfCommandTypeCustomEvent,
+
+    /** Marker command type. Types up from here will be used for markers only. */    
+    EAlfCommandTypeMarkerFirst = 10000,
+    EAlfCommandTypeMarker0 = EAlfCommandTypeMarkerFirst,
+    EAlfCommandTypeMarker1,
+    EAlfCommandTypeMarker2,
+    EAlfCommandTypeMarker3,
+    EAlfCommandTypeMarker4,
+    EAlfCommandTypeMarker5,
+    EAlfCommandTypeMarker6,
+    EAlfCommandTypeMarker7,
+    EAlfCommandTypeMarker8,
+    EAlfCommandTypeMarker9,
+    EAlfCommandTypeMarker10
+    };
+
+
+/** 
+ * Command operations. 
+ */
+enum TAlfOp
+    {
+    EAlfOpNone = 0,
+    																
+    /* Control Group operations. */
+    EAlfOpHide = 1000,
+    EAlfOpShow,
+    EAlfOpEnableInput,
+    EAlfOpDisableInput,
+    
+    /* Control operations. */
+    /* (start from 2000) */  // None defined yet.
+    
+    /* Visual operations. */
+    EAlfOpRemoveAndDestroyAll = 3000,
+    EAlfOpModifyFlags,
+    EAlfOpSetPrimaryImage,
+    EAlfOpSetSecondaryImage,
+    EAlfOpSetText,
+    EAlfOpEnableTransformation,
+    EAlfOpDisableTransformation,
+    
+    /* Timed value operations. */
+    EAlfOpSet = 4000,
+    EAlfOpSetWithSpeed,
+    
+    /* Timed value style operations. The actual is:
+       TAlfInterpolationStyle(iOperation - EAlfOpSetStyle) */
+    EAlfOpSetStyle = 5000,
+    
+    /* Transformation operations. */
+    EAlfOpLoadIdentity = 6000,
+    EAlfOpTranslate,
+    EAlfOpScale,
+    EAlfOpRotate,
+    EAlfOpReplaceStep
+    };
+
+/**
+ * Object types.
+ * These are the different types of objects which can issue and receive commands.
+ */
+enum TAlfCommandObjectType
+    {
+    EAlfCommandObjectTypeNone,
+
+    /** This object is a visual. */
+    EAlfCommandObjectTypeVisual,
+
+    /** This object is a control. */
+    EAlfCommandObjectTypeControl,
+
+    /** This object is a control group. */
+    EAlfCommandObjectTypeControlGroup
+    };
+
+/**
+ * Value command target
+ * 
+ */
+enum TAlfValueCommandTarget
+    {
+    EAlfValueCommandVisualSetOpacity
+    };
+    
+/**
+ * Point command target
+ * 
+ */
+enum TAlfPointCommandTarget
+    {
+    EAlfPointCommandVisualSetPos,
+    EAlfPointCommandVisualSetSize
+    };
+
+/**
+ * TAlfCommand is the base class of all commands. A command is an
+ * instruction to some class that can be set to occur some time in the future.
+ * Each command stores information about an operation. Each command is also responsible for
+ * the execution of the command. 
+ * Commands are processed by the class's OfferEventL() method.
+ */
+class TAlfCommand
+    {
+public:
+
+    /* Destructor. */
+
+    IMPORT_C virtual ~TAlfCommand();
+    
+
+    /* Methods. */
+    
+    IMPORT_C TAlfCommandType Type() const;
+    
+    /**
+     * Returns a pointer to the command casted to TAlfObjectCommand.
+     * If this is not possible (the command is not derived from 
+     * TAlfObjectCommand), returns NULL instead.
+     */
+    IMPORT_C virtual const TAlfObjectCommand* ObjectCommand() const;
+
+    /**
+     * Executes the command.
+     *
+     * @param aEnv  The environment in which the command is being executed.
+     */
+    virtual void ExecuteL(CAlfEnv& aEnv) const = 0;
+    
+    /**
+     * Returns the size of the command.
+     */
+    virtual TInt Size() const = 0;
+    
+protected:
+
+    /* Constructor. */
+
+    /**
+     * Protected constructor.
+     *
+     * @param aType  Type of the command.
+     */
+    IMPORT_C TAlfCommand(TAlfCommandType aType);
+    
+    IMPORT_C virtual void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+
+    /* These member variables are shared by all commands. */
+    
+    /** Type of the command. Depends on the command class. */
+    TAlfCommandType iType;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+    
+/**
+ * TAlfActionCommand is a simple action that triggers an action notification.
+ * 
+ * They are reserved for notifying observers of user-initiated actions in the user
+ * interface. 
+ * For example, a button control might send an action command when the user clicks on
+ * the button.
+ * 
+ * Usage:
+ * @code
+ * 
+ * //Candidate, interested in action notification, should implement 
+ * // MAlfActionObserver interface
+ * class ActionCommandTest : public MAlfActionObserver
+ *  {
+ *   public:
+ * 	 .....
+ * 	 .....
+ * 	 .....
+ *   void HandleAction( const TAlfActionCommand& aActionCommand );
+ *  };
+ *   
+ * // From MAlfActionObserver
+ * void ActionCommandTest::HandleAction( const TAlfActionCommand& aActionCommand )
+ *    {
+ *    //Perform required action on notification
+ *    }
+ * -------------------------------------------------------------------------------
+ *  //Observer registrartion
+ *  ActionCommandTest* testClass = new ActionCommandTest();
+ * 
+ *  //Create command
+ *  TAlfActionCommand command( 1 );
+ * 
+ *  //Register test command as observer to environment
+ *  iEnv->AddActionObserverL( testClass );
+ *    
+ *   //Send command
+ *   iEnv->Send( command, 1 );
+ * 
+ *  //Cleanup
+ *  iEnv->RemoveActionObserver( testClass );
+ *  delete testClass;
+ * 
+ * @endcode
+ * 
+ * @see MAlfActionObserver
+ * @see CAlfEnv::AddActionObserverL()
+ * @see CAlfEnv::RemoveActionObserver()
+ */  
+ class TAlfActionCommand : public TAlfCommand
+    {
+public:
+    
+    /* Constructor. */
+
+    /**
+     * Constructs a new action command.
+     *
+     * @param aId  Identifier of the action.
+     */
+    IMPORT_C TAlfActionCommand(TInt aId);    
+
+    /* Methods. */
+
+    /* Implementation of TAlfCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CAlfEnv& aEnv) const;
+    
+    /* Implementation of TAlfCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+    /**
+     * Determines the action identifier of the command.
+     *
+     * @param  Action identifier.
+     */     
+    IMPORT_C TInt Id() const;
+
+
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+
+    /** Action identifier. */
+    TInt iId;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+/** 
+ * TAlfObjectCommand is the base class for commands that modify data owned by 
+ * an object. If the object gets deleted and the scheduler is notified of this, 
+ * the command will be automatically canceled.
+ *
+ * Deriving class needs to override Clone() and Execute() functions from the Command
+ * base class and NOT to call the base class implementation.
+ */
+class TAlfObjectCommand : public TAlfCommand
+    {
+public:
+
+    /* Methods. */
+
+    IMPORT_C const TAlfObjectCommand* ObjectCommand() const;
+
+    /**
+     * Returns the data owner object of the command.
+     */
+    IMPORT_C TAny* Object() const;
+    
+    /**
+     * Returns the operation of the command.
+     */
+    IMPORT_C TAlfOp Operation() const;
+    
+    
+    IMPORT_C void ExecuteL(CAlfEnv& aEnv) const;
+     
+     
+    IMPORT_C TInt Size() const; 
+     
+protected:     
+
+    /* Constructor. */
+
+    /**
+     * Protected constructor.
+     *
+     * @param aType             Type of the command.
+     * @param aDataOwnerObject  Object that owns the data this command handles.
+     * @param aOperation        Operation being done on the object.
+     */
+    IMPORT_C TAlfObjectCommand(TAlfCommandType aType, TAny* aDataOwnerObject, TAlfOp aOperation);
+    
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+
+    /** Object that owns the data this command handles. */
+    TAny* iObject;
+
+    /** Operation being done on the object. */
+    TAlfOp iOperation;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+    
+/**
+ * TAlfGroupCommand is an object command that operates on a control group.
+ * Usage:
+ * 
+ * @code
+ *  //Create control group command to show contro group on display
+ *  TAlfGroupCommand command( *iControlGroup, EAlfOpShow, &display );
+ *  
+ *  //Send command , control group will be shown
+ *   iEnv->Send( command, 1 );
+ * 
+ * //Create control group command to hide control group on display
+ *  TAlfGroupCommand command1( *iControlGroup, EAlfOpHide, &display );
+ *  
+ *  //Send command , control group will be hidden
+ *   iEnv->Send( command, 1 );
+ * @endcode
+*/    
+class TAlfGroupCommand : public TAlfObjectCommand
+    {
+public:
+
+    /* Constructor. */
+
+    /**
+     * Constructs a new control group command.
+     *
+     * @param aGroup      Control group.
+     * @param aDisplay    Display associated with the command.
+     * @param aOperation  Operation to do on the group.
+     */
+    IMPORT_C TAlfGroupCommand(CAlfControlGroup& aGroup, TAlfOp aOperation, 
+                              CAlfDisplay* aDisplay = NULL);    
+
+    /* Implementation of TAlfCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CAlfEnv& aEnv) const;
+    
+    /* Implementation of TAlfCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+
+    /* Methods. */
+    
+    /**
+     * Returns the control group that the command operates on.
+     */
+    IMPORT_C CAlfControlGroup& ControlGroup() const;
+    
+    /**
+     * Returns the display associated with the command.
+     */
+    IMPORT_C CAlfDisplay* Display() const;
+
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+
+    /** Display associated with the command. */
+    CAlfDisplay* iDisplay;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+    
+/**
+ * TAlfControlCommand is an object command that operates on a control.
+ */    
+class TAlfControlCommand : public TAlfObjectCommand
+    {
+public:
+
+    /* Constructor. */
+
+    /**
+     * Constructs a new control command.
+     *
+     * @param aControl    Control.
+     * @param aOperation  Operation to do on the control.
+     */
+    IMPORT_C TAlfControlCommand(CAlfControl& aControl, TAlfOp aOperation);    
+
+    /* Implementation of TAlfCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CAlfEnv& aEnv) const;
+
+    /* Implementation of TAlfCommand::Size(). */
+    IMPORT_C TInt Size() const;   
+
+    /* Methods. */
+    
+    /**
+     * Returns the control that the command operates on.
+     */
+    IMPORT_C CAlfControl& Control() const;
+    
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    }; 
+    
+/**
+ * TAlfVisualCommand is an object command that operates on a visual.
+ * Usage:
+ * 
+ * @code
+ *  //Create Visual command to move visual to front
+ *   TAlfVisualCommand command( *iVisual, EAlfOpEnableTransformation );
+ *  
+ *  //Send command , visual will be moved to front
+ *   iEnv->Send( command, 1 );
+ * 
+ * @endcode
+ * 
+ */    
+class TAlfVisualCommand : public TAlfObjectCommand
+    {
+public:
+
+    /* Constructor. */
+
+    /**
+     * Constructs a new visual command.
+     *
+     * @param aVisual     Visual.
+     * @param aOperation  Operation to do on the visual.
+     */
+    IMPORT_C TAlfVisualCommand(CAlfVisual& aVisual, TAlfOp aOperation,
+                               TInt aSetFlags = 0, TInt aClearFlags = 0);    
+
+    /* Implementation of TAlfCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CAlfEnv& aEnv) const;
+    
+    /* Implementation of TAlfCommand::Size(). */
+    IMPORT_C TInt Size() const;
+    
+    /* Methods. */
+    
+    /**
+     * Returns the visual that the command operates on.
+     */
+    IMPORT_C CAlfVisual& Visual() const;
+    
+    /**
+     * Returns the flags that will be set by the command.
+     */
+    IMPORT_C TInt FlagsToSet() const;
+    
+    /**
+     * Returns the flags that will be cleared by the command.
+     */
+    IMPORT_C TInt FlagsToClear() const;
+
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+
+    /** Flags to set. */
+    TInt iSetFlags;
+    
+    /** Flags to clear. */
+    TInt iClearFlags;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+
+    };
+    
+/**
+ * TAlfImageCommand is a command that operaters on an image visual.
+ * Usage:
+ * 
+ * @code
+ * 
+ *  //Create Image command to set primary image for imagevisual
+ *   TAlfImageCommand command( *imageVisual, *image, EAlfOpSetPrimaryImage );
+ *  
+ *  //Send command , Primary image will be set
+ *   iEnv->Send( command, 1 );
+ * 
+ * @endcode
+ */    
+class TAlfImageCommand : public TAlfObjectCommand
+    {
+public:    
+
+    /* Constructor. */
+
+    /**
+     * Constructs a new image command.
+     *
+     * @param aImageVisual  Image visual.
+     * @param aImage        Image.
+     * @param aOperation    Operation to do on the visual.
+     */
+    IMPORT_C TAlfImageCommand(CAlfImageVisual& aImageVisual, const TAlfImage& aImage, 
+                              TAlfOp aOperation = EAlfOpSetPrimaryImage);
+
+    /* Implementation of TAlfCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CAlfEnv& aEnv) const;
+    
+    /* Implementation of TAlfCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+
+    /* Methods. */
+    
+    /**
+     * Returns the visual that the command operates on.
+     */
+    IMPORT_C CAlfImageVisual& ImageVisual() const;
+    
+    /**
+     * Returns a reference to the image of the visual.
+     */
+    IMPORT_C const TAlfImage& Image() const;
+    
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+    
+private:
+
+    /** Image of the command. */
+    TAlfImage iImage;    
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };  
+    
+/**
+ * TAlfTextCommand is a command that operaters on a text visual.
+ *    
+ * Usage:
+ * 
+ * @code
+ * 
+ *  //Create text command to set text in textvisual
+ *   TAlfTextCommand command( *textVisual, _L( "Text" ) );
+ *  
+ *  //Send command , text will be set to textvisual
+ *   iEnv->Send( command, 1 );
+ * @endcode
+ */    
+class TAlfTextCommand : public TAlfObjectCommand
+    {
+public:    
+
+    /* Constructor. */
+
+    /**
+     * Constructs a new text command.
+     *
+     * @param aTextVisual  Text visual.
+     * @param aText        Text.
+     * @param aOperation   Operation to perform.
+     */
+    IMPORT_C TAlfTextCommand(CAlfTextVisual& aTextVisual, const TDesC& aText, 
+                             TAlfOp aOperation = EAlfOpSetText);
+
+    /* Implementation of TAlfCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CAlfEnv& aEnv) const;
+    
+    /* Implementation of TAlfCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+
+    /* Methods. */
+    
+    /**
+     * Returns the visual that the command operates on.
+     */
+    IMPORT_C CAlfTextVisual& TextVisual() const;
+    
+    /**
+     * Returns a reference to the text of the visual.
+     */
+    IMPORT_C const TDesC& Text() const;
+    
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+    
+private:
+
+    /** Text of the command. */
+    const TDesC& iText;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+    
+    
+/**
+ * TAlfValueCommand is a command that operates on a single timed value.
+ *
+ * @code
+ * 
+ *  //Create timed value command to set visualopacity of a visual
+ *  TAlfValueCommand command( visual, EAlfValueCommandVisualSetOpacity, 0.2, 15 );
+ *  
+ *  //Send command , visualopacity will be set
+ *   iEnv->Send( command, 1 );
+ * 
+ * @endcode
+ */    
+class TAlfValueCommand : public TAlfObjectCommand 
+    {
+public:
+
+    /* Constructor. */
+
+    /**
+     * Constructs a new value command.
+     *
+     * @param aObject          Object. Needs to match with aObjectType
+     * @param aObjectType      Timed value to modify.
+     * @param aTarget          Target value
+     * @param aTransitionTime  Time (in milliseconds) for the transition to occur.
+     */
+    IMPORT_C TAlfValueCommand(
+        TAny* aObject, 
+        TAlfValueCommandTarget aObjectType, 
+        TReal32 aTarget, 
+        TInt aTransitionTime = 0 ) __SOFTFP;  
+        
+    /**
+     * Constructs a new value command. This constructor takes an operation 
+     * parameter in addition to the target and timing values.
+     *
+     * @param aObject          Object. Needs to match with aObjectType
+     * @param aObjectType      Timed value to modify.
+     * @param aOperation  Operation to perform.
+     * @param aTarget     Target value
+     * @param aTiming     Time (in milliseconds) for the transition to occur.
+     */
+    IMPORT_C TAlfValueCommand(TAny* aObject, TAlfValueCommandTarget aObjectType, 
+                              TAlfOp aOperation = EAlfOpSet,
+                              TReal32 aTarget = 0.0, TReal32 aTiming = 0.0) __SOFTFP;
+                             
+    /* Implementation of TAlfCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CAlfEnv& aEnv) const;
+    
+    /* Implementation of TAlfCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+
+    /* Methods. */
+
+    /**
+     * Returns the visual that the command operates on.
+     */
+    IMPORT_C TAlfValueCommandTarget TimedValue() const;
+    
+    /**
+     * Returns the target value.
+     */
+    IMPORT_C TReal32 Target() const __SOFTFP;
+    
+    /**
+     * Returns the transition time.
+     */
+    IMPORT_C TInt TransitionTime() const;
+    
+    /**
+     * Returns the transition speed. Zero, if not set.
+     */
+    IMPORT_C TReal32 Speed() const __SOFTFP;
+       
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+    
+private:
+
+    /** Timed value being operated on. */
+    TAlfValueCommandTarget iTimedValue;
+
+    /** Target value. */
+    TReal32 iTarget;
+    
+    /** Transition time in milliseconds. */
+    TInt iTransitionTime;
+    
+    /** Optionally, transition speed in units/second. */
+    TReal32 iSpeed; 
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+/**
+ * TAlfPointCommand is a command that operates on a timed point.
+ * Usage:
+ * @code
+ * 
+ *  //Create timed point command to set visual size
+ *   TAlfRealPoint p1( 0.1, 0.1 );
+ *   TAlfPointCommand command1( iVisual, EAlfValueCommandVisualSize, p1, 1 );
+ *  
+ *  //Send command , Primary image will be set
+ *   iEnv->Send( command, 1 );
+ * 
+ * @endcode
+ */    
+class TAlfPointCommand : public TAlfObjectCommand 
+    {
+public:
+
+    enum TParameterTarget
+        {
+        EBoth = 0, // default
+        EXOnly,
+        EYOnly
+        };
+
+    /* Constructor. */
+
+    /**
+     * Constructs a new timed point command.
+     *
+     * @param aObject     Object. Needs to match with aObjectType
+     * @param aObjectType Timed value to modify.
+     * @param aOperation  Operation to perform.
+     */
+    IMPORT_C TAlfPointCommand(TAny* aObject, TAlfPointCommandTarget aObjectType, 
+                              TAlfOp aOperation);
+
+    /**
+     * Constructs a new timed point command.
+     *
+     * @param aObject          Object. Needs to match with aObjectType
+     * @param aObjectType      Timed value to modify.
+     * @param aTarget          Target value
+     * @param aTransitionTime  Time (in milliseconds) for the transition to occur.
+     */
+    IMPORT_C TAlfPointCommand(TAny* aObject, TAlfPointCommandTarget aObjectType, 
+                              TAlfRealPoint aTarget, TInt aTransitionTime = 0,
+                              TParameterTarget aParameterTarget = EBoth ); 
+    
+    /**
+     * Constructs a new timed point command. This constructor takes an operation 
+     * parameter in addition to the target and timing values.
+     *
+     * @param aObject     Object. Needs to match with aObjectType
+     * @param aObjectType Timed value to modify.
+     * @param aOperation  Operation to perform.
+     * @param aTarget     Target value.
+     * @param aTiming     Time (in milliseconds) for the transition to occur.
+     */
+    IMPORT_C TAlfPointCommand(TAny* aObject, TAlfPointCommandTarget aObjectType, 
+                              TAlfOp aOperation,
+                              TAlfRealPoint aTarget, TReal32 aTiming = 0.0,
+                              TParameterTarget aParameterTarget = EBoth) __SOFTFP;
+                             
+    /* Implementation of TAlfCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CAlfEnv& aEnv) const;
+    
+    /* Implementation of TAlfCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+
+    /* Methods. */
+    
+    /**
+     * Returns the object type that the command operates on.
+     */
+    IMPORT_C TAlfPointCommandTarget TimedPoint() const;
+    
+    /**
+     * Returns the target value.
+     */
+    IMPORT_C TAlfRealPoint Target() const;
+    
+    /**
+     * Returns the transition time.
+     */
+    IMPORT_C TInt TransitionTime() const;
+    
+    /**
+     * Returns the transition speed. Zero, if not set.
+     */
+    IMPORT_C TReal32 Speed() const __SOFTFP;
+
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+    
+private:
+
+    /** Timed point being operated on. */
+    TAlfPointCommandTarget iTimedPoint;
+
+    /** Target value. */
+    TAlfRealPoint iTarget;
+    
+    /** Transition time in milliseconds. */
+    TInt iTransitionTime;
+    
+    /** Optionally, transition speed in units/second. */
+    TReal32 iSpeed;
+
+    TParameterTarget iParameterTarget;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+/**
+ * TAlfTransformationCommand is a command that operates on a transformation.
+ * 
+ * Transformation command can generate one of the following operations:
+ * @li EAlfOpLoadIdentity - Loads an identity matrix to the transformation.
+ * @li EAlfOpTranslate - Applies a translation to the object affected by the transformation.
+ * @li EAlfOpScale - Applies scaling to the object affected by the transformation.
+ * @li EAlfOpRotate - Applies a rotation to the object that is affected by the transformation.
+ * @li EAlfOpReplaceStep - Replaces the whole transformation step values with the 
+ * ones given as command parameters
+ *
+ * If the transformation operation is rotation the default rotation is around z-axis.
+ * If the transformation operation is scaling the default scale factors are 1.0 on all axis.
+ * On any other transformation the x,y and z components are zero by default.
+ * 
+ * Usage:
+ * @code
+ * 	
+ * 	//Enable transformation
+ *  iVisual->EnableTransformationL( );
+ * 
+ * //Get transformation object
+ *  CAlfTransformation* transformation = &iVisual->Transformation();
+ * 
+ *  //Set transformation properties
+ *   const TInt rotateAngle = 23.67;
+ *   transformation->Rotate( rotateAngle );
+ * 
+ * //Create transformation command
+ * TAlfTransformationCommand command( iVisual,transformation, EAlfOpRotate, 0 );
+ * 
+ * //Properties can also be set through command
+ *  command.SetAngle( TAlfTimedValue( 56 ) );
+ * 
+ * //Send command
+ *  iEnv->Send( command, 1 );
+ * 
+ * @endcode
+ */    
+class TAlfTransformationCommand : public TAlfObjectCommand
+    {
+public:    
+
+    enum 
+        {
+        /** Used in the aStep parameter to specify that no step index is 
+            specified. */
+        EStepNone = -1
+        };
+
+
+    /* Constructor. */
+
+    /**
+     * Constructs a new transformation command.
+     *
+     * @param aOwner      Owner of the transformation. Allowed be NULL.
+     * @param aTransformation  Transformation to operate on.
+     * @param aOperation  Operation to perform.
+     * @param aStep       Step index in the transformation.
+     */
+    IMPORT_C TAlfTransformationCommand(TAny* aOwner, CAlfTransformation& aTransformation,
+                                       TAlfOp aOperation = EAlfOpLoadIdentity,
+                                       TInt aStep = EStepNone);
+
+    /* Implementation of TAlfCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CAlfEnv& aEnv) const;
+    
+    /* Implementation of TAlfCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+
+    /* Methods. */
+    
+    /**
+     * Returns the transformation that the command operates on.
+     */
+    IMPORT_C CAlfTransformation& Transformation() const;
+    
+    /**
+     * Returns the transformation step index.
+     */
+    IMPORT_C TInt Step() const;
+    
+    /**
+     * Sets the X component.
+     * - If transformation is translation this sets the amount of translation on X axis.
+     * - If transformation is rotation this sets the X component of rotation axis vector.
+     * - If transformation is scaling this sets the scaling factor for the X axis.
+     *
+     * @param aValue Timed value to set to the X component.
+     */
+    IMPORT_C void SetX(const TAlfTimedValue& aValue);
+
+    /**
+     * Sets the Y component.
+     * - If transformation is translation this sets the amount of translation on Y axis.
+     * - If transformation is rotation this sets the Y component of rotation axis vector.
+     * - If transformation is scaling this sets the scaling factor for the Y axis.
+     *
+     * @param aValue Timed value to set to the Y component.
+     */
+    IMPORT_C void SetY(const TAlfTimedValue& aValue);
+
+    /**
+     * Sets the Z component.
+     * - If transformation is translation this sets the amount of translation on Z axis.
+     * - If transformation is rotation this sets the Z component of rotation axis vector.
+     * - If transformation is scaling this sets the scaling factor for the Z axis.
+     *
+     * @param aValue Timed value to set to the Z component.
+     */
+    IMPORT_C void SetZ(const TAlfTimedValue& aValue);
+    
+    /**
+     * Set the angle of rotation if the transformation is rotation.
+     */
+    IMPORT_C void SetAngle(const TAlfTimedValue& aValue);
+    
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+    
+private:
+
+    /** Image of the command. */
+    CAlfTransformation& iTransformation;
+
+    /** Step index. */    
+    TInt iStep;
+
+    /** X component. Suspended. */
+    TAlfTimedValue iX;
+    
+    /** Y component. Suspended. */
+    TAlfTimedValue iY;
+    
+    /** Z component. Suspended. */
+    TAlfTimedValue iZ;
+    
+    /** Angle component. Suspended. */
+    TAlfTimedValue iAngle;
+    
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+/**
+ * TAlfMarkerCommand is a special marker command that has no functionality, 
+ * but can be entered into the scheduler to mark a specific point in time.
+ */
+class TAlfMarkerCommand : public TAlfCommand
+    {
+public:
+    
+    /* Constructor. */
+
+    /**
+     * Constructs a new marker command.
+     *
+     * @param aId  Identifier of the marker.
+     */
+    IMPORT_C TAlfMarkerCommand(TInt aId);    
+
+
+    /* Methods. */
+
+    /* Implementation of TAlfCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CAlfEnv& aEnv) const;
+    
+    /* Implementation of TAlfCommand::Size(). */
+    IMPORT_C TInt Size() const;
+    
+    /**
+     * Determines the identifier of the marker.
+     *
+     * @param  Marker identifier.
+     */     
+    IMPORT_C TInt Id() const;
+    
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+    
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+    
+    
+/**
+ * TAlfCustomEventCommand is a command that sends a custom event. The command
+ * can be sent to any individual MAlfEventHandler derived object or broadcasted to 
+ * all Control derived objects.
+ * 
+ * Usage
+ * 
+ * @code
+ *  //Create custom Event command, as iControl implements, MAlfEventHandler,
+ *  // it will recieve custom event
+ *  TAlfCustomEventCommand command( KCustomCommandIdDefault, iControl );
+ * 
+ * //Send command
+ *  iEnv->Send( command, 1 );
+ * 
+ * @endcode
+ */    
+class TAlfCustomEventCommand : public TAlfObjectCommand
+    {
+public:
+    
+    /* Constructor. */
+
+    /**
+     * Constructs a new custom event command.
+     *
+     * @param aEventParam  Parameter of the custom event.
+     * @param aRecipient   Optional recipient of the event.
+     * @param aEventData   Optional event data identifier.
+     *
+     * @todo  It would be good to be able to specify more information to 
+     *        be sent with the custom event, e.g., a pointer. Also check
+     *        out TAlfEvent.
+     */
+    IMPORT_C TAlfCustomEventCommand(
+        TInt aEventParam, MAlfEventHandler* aRecipient = NULL, TInt aEventData = 0 );
+
+    /* Methods. */
+
+    /* Implementation of TAlfCommand::ExecuteL(). */
+    IMPORT_C void ExecuteL(CAlfEnv& aEnv) const;
+    
+    /* Implementation of TAlfCommand::Size(). */
+    IMPORT_C TInt Size() const;
+
+    /**
+     * Returns the recipient of the event, or NULL if none defined.
+     */
+    IMPORT_C MAlfEventHandler* Recipient() const;
+    
+    /**
+     * Determines the custom event parameter of the command.
+     *
+     * @return  Parameter.
+     */     
+    IMPORT_C TInt Param() const;
+    
+    /**
+     * Returns the event data of the command.
+     *
+     * @return  Event data.
+     */     
+    IMPORT_C TInt EventData() const;    
+    
+protected:
+
+    IMPORT_C void CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+    
+private:
+
+    /** Custom event parameter.  @todo Could be a pointer as well? */
+    TInt iEventParam;
+        
+    /** Event data. */
+    TInt iEventData;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+#endif // T_ALFCOMMAND_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionclient.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,344 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __ALFCOMPOSITIONCLIENT_H__
+#define __ALFCOMPOSITIONCLIENT_H__
+
+#include <e32hashtab.h>
+#include <alf/alfcompositionutility.h>
+
+const TInt KAlfCompositionControllerIfUid(0x2002bcfc);
+
+/** Interface for class that actually controls the composition singleton **/
+class MAlfCompositionController: public MAlfCompositionControl
+    {
+public:
+    virtual TInt CreateTargetL(TInt aTarget, TInt aClientHandle, TInt aGrpHandle ) = 0;    
+    virtual void SetTargetL(TInt aTarget) = 0;    
+    virtual void SetExtentSurfaceId(const TSurfaceId& aSurfaceId) = 0;
+    virtual TInt SetOrder(TInt aTarget, TInt aTop, TBool aAbove, TBool aCombineTargets) =0;
+    virtual void DeleteTarget(TInt aTarget)=0;
+    virtual void LowOnGraphicsMemory()=0;
+    virtual void GraphicsMemoryGood(){}
+    
+    virtual void AlfBridgeCallback(TInt, TAny*){};
+    }; 
+
+/** Wrapper class IPC <-> MAlfCompositionController **/
+NONSHARABLE_CLASS(CAlfCompositionCntrlClient): public CAlfCompositionClientBase
+    {
+public:
+    CAlfCompositionCntrlClient(MAlfCompositionController* aController):iController(aController){}
+    IMPORT_C static CAlfCompositionCntrlClient* NewL(RAlfBridgerClient* aClient, MAlfCompositionController* aController);
+    IMPORT_C ~CAlfCompositionCntrlClient();
+    
+    // From base
+    void HandleEventL(TInt aEventType, TAny* aEventData);
+    // from CActive
+    TInt RunError(TInt aError);
+private:
+    MAlfCompositionController* iController;
+    
+    RHashMap<TInt, TInt> iHostBindingsHash;
+    RHashMap<TInt, TInt32> iHostPermittedOpsHash;
+    
+    };
+    
+
+/**
+Example1:
+* // to set target from other app semitransparent 
+* CAlfCompositionHost* me = CAlfCompositionHost::NewL(tokenFromSource, myCompositionKey);
+* me->EnableAlpha(); 
+* me->SetOpacity(0.5f);
+* //...
+**/
+class CAlfCompositionHost: public CAlfCompositionSource
+    {
+public:
+    /** 
+    * Constructor for application that wishes modify 
+    * composition information for some other process, see CreatePermissionToken()
+    *
+    * Leaves using KErrNotFound, if token is not valid
+    * 
+    * If the binded target layer is destroyed by its owner, any Set operations 
+    * will have no effect.
+    */
+    IMPORT_C static CAlfCompositionHost* NewL(TInt aToken, TInt aKey);
+
+    void ConstructL(TInt aToken, TInt aKey);
+    
+//private: // data
+//    class CAlfCompositionHostData;
+//    CAlfCompositionHostData* iData;
+    };
+
+
+// ================ Posting like SW interface ============================================
+// 
+// =======================================================================================
+
+/** Inferface for the pixel buffer provider to provide information, frames and get events concerning context events **/
+class MAlfBufferProvider
+    {
+public:
+    
+    enum TBufferFormat
+        {
+        ESourceFormatRGB_565 = 0,
+        ESourceFormatXRGB_8888 = 1, 
+        ESourceFormatARGB_8888 = 2,
+        ESourceFormatARGB_8888_PRE = 3
+        };
+
+    struct TBufferCreationAttributes
+        {
+        /*
+         * Buffer size
+         */
+        TInt iWidth;
+        TInt iHeight;
+        /**
+         * iStride should be at least bytes * width.
+         * iStride may still be adjusted by CAlfCompositionPixelSource for the target HW driver implementation
+         * Client should always use iStride value available after CAlfCompositionPixelSource::ActivateL call.
+         **/
+        TInt iStride;
+        
+        TInt iAlignment;
+        TBufferFormat iFormat;
+        };
+
+    /**
+     * Called by framework when the next buffer is ready and available for the client to draw.
+     * @param aVisibleRegion is currently visible surface region
+     * 
+     * @return ETrue to continue drawing of frames. EFalse to pause drawing.
+     *          After pausing drawing client needs to call CAlfCompositionPixelSource::ActivateL to
+     *          continue drawing of frames 
+     **/
+    virtual TBool ProduceNewFrameL(const TRegion& aVisibleRegion, TUint8*& aBuffer) = 0;
+
+    /**
+     * Called by framework when new buffer is been created. Client should provide desired creation attributes.
+     **/
+    virtual TBufferCreationAttributes& BufferAttributes() = 0;
+    
+    /**
+     * Notification from FW 
+     **/
+    virtual void ContextAboutToSuspend() =0;
+    virtual void OnActivation() = 0;
+    };
+
+/**
+* Example1:
+* // to draw frames with CAlfCompositionPixelSource API
+* class CMyClass: public CBase, public MAlfBufferProvider
+*     { 
+*     private:
+*         CAlfCompositionPixelSource* iAlfCompositionPixelSource;
+*         MAlfBufferProvider::TBufferCreationAttributes iAttributes;
+*     public:
+*     
+*     CMyClass() {}
+*     
+*     ConstructL()
+*       {
+*       // ...
+*       iAttributes.iWidth = width;
+*       iAttributes.iHeight = height;
+*       iAttributes.iFormat = MAlfBufferProvider::ESourceFormatARGB_8888;
+*       iAttributes.iStride =  iAttributes.iWidth * 4;
+*       iAttributes.iAlignment = 32;
+*       
+*       iAlfCompositionPixelSource = CAlfCompositionPixelSource::NewL(*this, iMyDrawableWindow);
+*       iAlfCompositionPixelSource->iActivateL()
+*       }
+*     
+*    TBool ProduceNewFrameL(const TRegion& aVisibleRegion, TUint8*& aBuffer)
+*       {
+*       // ...
+*       // copy pixel data to aBuffer
+*       TUint8* from = (TUint8*)bitmap->DataAddress();
+*       TUint bytes = bitmap->SizeInPixels()*4;
+*       for (TInt y = bitmap->SizeInPixels().iHeight; y > 0; y--)
+*           {
+*           Mem::Copy(aBuffer, from, bytes);
+*           aBuffer += iAttributes.iStride;
+*           from += bitmap->DataStride();
+*           }
+*       // ...
+*       return ETrue; // to continue getting ProduceNewFrameL callbacks
+*       };
+*
+*    MAlfBufferProvider::TBufferCreationAttributes& BufferAttributes() { return iAttributes };
+*   
+*    void ContextAboutToSuspend() {};
+*    void OnActivation() {};
+*    // ...
+*    }
+*
+* Example2:
+* // client may want or need to adjust ProduceNewFrameL-callbacks inverval
+* class CMyClass: public CActive, public MAlfBufferProvider
+*     { 
+*     private:
+*         CAlfCompositionPixelSource* iAlfCompositionPixelSource;
+*         MAlfBufferProvider::TBufferCreationAttributes iAttributes;
+*         TBool iDrawNext;
+*         TTimeIntervalMicroSeconds32 iWaitTime;
+*         RTimer iTimer;
+*     public:
+*     
+*     CMyClass() {}
+*     
+*     ConstructL()
+*       {
+*       // ...
+*       iDrawNext = ETrue;
+*       iWaitTime = 25*1000; 
+*       // ...
+*       }
+*
+*    void RunL()
+*       {
+*       if( iStatus.Int() != KErrNone )
+*           {
+*           iDrawNext = ETrue;
+*           iAlfCompositionPixelSource->ActivateL();
+*           }
+*       }
+*    // ... 
+*    TBool ProduceNewFrameL(const TRegion& aVisibleRegion, TUint8*& aBuffer)
+*       {
+*       if( iDrawNext )
+*           {
+*           iDrawNext = EFalse;
+*           }
+*       else
+*           {
+*           iTimer.After( iStatus, iWaitTime );
+*           return EFalse;
+*           }
+*       // ...
+*       // copy pixel data to aBuffer
+*       // ...
+*       return ETrue; // to continue getting ProduceNewFrameL callbacks
+*       };
+*    // ...
+*    }
+*    
+* Example3:
+* // API can be used withou the actual window
+* class CMyClass: public CBase, public MAlfBufferProvider
+*     { 
+*     private:
+*         CAlfCompositionPixelSource* iAlfCompositionPixelSource;
+*         MAlfBufferProvider::TBufferCreationAttributes iAttributes;
+*     public:
+*     
+*     CMyClass() {}
+*     
+*     ConstructL()
+*       {
+*       // ...
+*       iAttributes.iWidth = width;
+*       iAttributes.iHeight = height;
+*       iAttributes.iFormat = MAlfBufferProvider::ESourceFormatARGB_8888;
+*       iAttributes.iStride =  iAttributes.iWidth * 4;
+*       iAttributes.iAlignment = 32;
+*       
+*       iAlfCompositionPixelSource = CAlfCompositionPixelSource::NewL(*this, NULL);
+*       iAlfCompositionPixelSource->SetExtent(TRect(0,0,600,300),0,1);
+*       iAlfCompositionPixelSource->iActivateL();
+*       }
+*    // ... 
+*    TBool ProduceNewFrameL(const TRegion& aVisibleRegion, TUint8*& aBuffer)
+*       {
+*       // ...
+*       // copy pixel data to aBuffer
+*       // ...
+*       return ETrue; // to continue getting ProduceNewFrameL callbacks
+*       };
+*    // ...
+*    
+*    // Notice: When activating Composition pixel source after being suspended, SetExtent needs to be called again.
+*    void ContinueAfterSuspendL()
+*       {
+*       iAlfCompositionPixelSource->SetExtent(TRect(0,0,600,300),0,1);
+*       iAlfCompositionPixelSource->iActivateL();
+*       }
+*    }
+**/
+class CAlfCompositionPixelSource: public CAlfCompositionSource
+    {
+public:
+    /** 
+     * Constructor 
+     **/
+    IMPORT_C static CAlfCompositionPixelSource* NewL(MAlfBufferProvider& aProvider, RWindow* aWindow = NULL);
+    
+    /**
+     *  Activate drawing for the first time or continue drawing if it is being paused or suspended
+     **/
+    IMPORT_C void ActivateL();
+    
+    /**
+     * Suspend drawing 
+     **/
+    IMPORT_C void Suspend();
+
+    IMPORT_C ~CAlfCompositionPixelSource();
+
+    /** 
+    * From base class 
+    * Defines extent of the composition target on a defined screen
+    * Does not affect on hit testing, keyboard focus etc. but is just additional information for composition
+    **/
+    IMPORT_C TInt SetExtent(const TRect& aRect, TInt aScreen);
+    
+    /**
+     * Internal
+     * For drawing one frame
+     **/
+    TBool DrawFrameL(TRequestStatus& aStatus, TInt aBufferNumber = 0);
+
+protected:
+
+    /**
+     * Internal
+     * From base class 
+     **/
+    void HandleEventL(TInt aEventType, TAny* aEventData);                                          
+
+private: // Internal / utils
+    
+    void ConstructL(MAlfBufferProvider& aProvider, RWindow* aWindow);
+    void ConstructSurfaceL(MAlfBufferProvider::TBufferCreationAttributes& aCreationAttributes);
+    void FreeSurface();
+    TUint8* Buffer(TInt aBufferNumber);
+
+    
+private: // data
+    
+    class CAlfCompositionPixelSourceData;
+    CAlfCompositionPixelSourceData* iData;
+    };
+
+
+#endif // #define __ALFCOMPOSITIONCLIENT_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionutility.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,298 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __ALFCOMPOSITIONUTILITY_H__
+#define __ALFCOMPOSITIONUTILITY_H__
+
+#include <e32base.h>
+#include <w32std.h>
+
+
+class RAlfBridgerClient;
+/*
+ * CAlfRsSendBuffer creates in construction one CAlfCompositionClient. That client 
+ * will wait for request completion. Request is completed, when an application communicaties 
+ * to CAlfRenderStage via CAlfCompositionSource client. After request is completed, the 
+ * CAlfCompositionClient (owned by CAlfRsSendBuffer) is again set active and it waits for 
+ * the next message.
+ */
+
+/** Base classes for logistics **/
+class CAlfCompositionClientBase: public CActive
+    {
+public:
+    
+    enum TAlfCompositionPermission
+        {
+        EAlfAllowChangeExtent           = 1,
+        EAlfAllowChangeAlpha            = 2,
+        EAlfAllowChangeOpacity          = 4,
+        EAlfAllowChangeRotation         = 8,
+        EAlfAllowChangeBackgroundAnim   = 16
+        }; 
+    
+protected:
+    CAlfCompositionClientBase(TInt aPriority = CActive::EPriorityHigh):CActive(aPriority)
+        {
+        CActiveScheduler::Add(this);
+        }
+        
+    IMPORT_C ~CAlfCompositionClientBase();
+    IMPORT_C void RequestEventL(TInt aBufferSize, RAlfBridgerClient* aClient = 0);        
+    IMPORT_C TInt SendEvent(TInt aOp, const TAny* aEventData, TInt aEventSize);
+    IMPORT_C void SetHandleL(TInt aHandle);
+    
+    // Virtuals
+    IMPORT_C virtual void HandleEventL(TInt aEventType, TAny* aEventData);
+    // from CActive
+    IMPORT_C TInt RunError(TInt aError);
+
+private: // from CActive
+    void RunL();
+    void DoCancel();
+
+public: // for utils
+    TInt Handle() const;
+        
+private: // data
+    class CAlfCompositionClientBaseData;
+    CAlfCompositionClientBaseData* iData;
+    };
+
+NONSHARABLE_CLASS(CAlfCompositionClientBase::CAlfCompositionClientBaseData):public CBase
+    {
+    public:
+    static CAlfCompositionClientBaseData* NewL(TInt aBufferSize, RAlfBridgerClient* aClient);
+
+    void ConstructL(TInt aBufferSize, RAlfBridgerClient* aClient);
+
+    ~CAlfCompositionClientBaseData();
+
+    RAlfBridgerClient* iClient;
+    TBool iOwnsClient;
+    TBuf8<60> iBuffer;
+    TBool* iDeleted;
+    TInt iBufferSize;
+    TInt iHandle;
+    };
+
+class MAlfCompositionControl
+    {
+    public:
+        /** 
+    * Enables / disables alpha on composition target 
+    **/
+    virtual TInt EnableAlpha(TBool aEnable = ETrue) = 0;
+    
+    /** 
+    * Set constant opacity (0..255) multiplier that will be applied to 
+    * composition target <in practice, only 256 different shades supported> 
+    **/
+    virtual TInt SetOpacity(TReal32 aOpacity) __SOFTFP = 0;
+    
+    /** 
+    * rotation of composition target
+    * <in practice, only 90 degree steps supported, value given will be rounded to closest rotation> 
+    **/
+    virtual TInt SetRotation(TInt aRotationInDegrees) = 0;
+        
+    /** 
+    * Defines extent of the composition target on a defined screen
+    * Does not affect on hit testing, keyboard focus etc. but is just additional information for composition
+    **/
+    virtual TInt SetExtent(const TRect& aRect, TInt aScreen) = 0;
+
+    /** 
+    * Makes this composition target system wide background surface 
+    **/
+    virtual void SetIsBackgroundAnim(TBool ETrue) = 0;    
+
+    /** 
+    * Defines extent of the composition source rectangle
+    **/
+    virtual TInt SetSourceRect(const TRect& aRect) = 0;
+    };   
+
+
+/** Client interface for composition fw information **/
+class MAlfCompositionObserver
+    {
+public:
+    /**
+    * Called by framework when composition framework has completed a frame and thus can 
+    * efficiently handle changes and/or new content
+    **/    
+    virtual void FrameReady(TInt aScreenNumber) = 0;
+
+    /**
+    * Notifications from FW
+    **/    
+    virtual void RunningLowOnGraphicsMemory() = 0; // running low on resources, clear cahces etc.
+    virtual void CompositionTargetHidden() = 0; // target is no more visible on composition scene, 
+                                                // free at least slack resources 
+    virtual void GraphicsMemoryGood(){}         // graphics memory status is normal again  
+	virtual void CompositionTargetVisible() {}  // target is visible again after first being hidden                                  
+    };
+
+/**
+* Example1:
+* // to set target semitransparent 
+* CAlfCompositionSource* me = CAlfCompositionSource::NewL(iMyDrawableWindow);
+* me->EnableAlpha(); 
+* me->SetOpacity(0.5f);
+* //...
+* delete me; // deletion of client will restore state to original
+*
+* Example2:
+* // to fade in for composition target
+* class CMyClass: public CBase, private MAlfCompositionObserver
+*     { 
+*     CMyClass():iOpacity(0)
+*       {
+*       }
+*     ConstructL()
+*       {
+*       // ...
+*       iAlfCompositionSource = CAlfCompositionSource::NewL(iMyDrawableWindow);
+*       iAlfCompositionSource->EnableAlpha(); 
+*       iAlfCompositionSource->SetOpacity(iOpacity);
+*       }
+*     
+*     void FrameReady(TInt aScreenNumber)
+*       {
+*       if (iOpacity < 1)
+*           { 
+*           iOpacity += 0.03; // just follow refresh linearly      
+*           iAlfCompositionSource->SetOpacity(iOpacity);
+*           }
+*        else
+*           { // fade in complete, no need to have composition cntrl anymore
+*           delete iAlfCompositionSource;
+*           iAlfCompositionSource = 0;
+*           }       
+*       }    
+*
+* Example 3:       
+* // To grant other application / process a priviledged rights to modify composition target
+* const TInt mySuperSecretKeyForHost1 = 0x000FAB10;
+* const TInt flagsForHost1 = EAlfAllowChangeExtent | EAlfAllowChangeAlpha; // but not rotation  
+*
+* CAlfCompositionSource* me = CAlfCompositionSource::NewL(iMyDrawableWindow);
+* TInt generatedKey = me->CreatePermissionToken(0x000FAB10, flagsForHost1);
+* 
+* PassGeneratedKeyToHost(generatedKey); // it already knows the other key..
+*
+* TBD, will the generates key work even after composition source destroys the
+* CAlfCompositionSource instance
+*      
+**/
+class CAlfCompositionSource: public CAlfCompositionClientBase, MAlfCompositionControl
+    {
+public:
+
+    /** 
+    * Constructor 
+    **/
+    IMPORT_C static CAlfCompositionSource* NewL(RWindow& aClientWindow);
+
+    /** 
+    * Creates handle based on key
+    * Flags define which kind of operations are allowed by host application
+    * using the token. Same token can be used multiple times for different clients.
+    *
+    **/
+    IMPORT_C TInt CreatePermissionToken(TInt aKey, TInt aPermissionFlags);
+
+    /** 
+    * Enables / disables alpha on composition target 
+    **/
+    IMPORT_C TInt EnableAlpha(TBool aEnable = ETrue);
+    
+    /** 
+    * Set constant opacity 0.0 - 1.0f multiplier that will be applied to composition target
+    * <in practice, only 256 different shades supported> 
+    **/
+    IMPORT_C TInt SetOpacity(TReal32 aOpacity) __SOFTFP;
+    
+    /** 
+    * rotation of composition target
+    * <in practice, only 90 degree steps supported, value given will be rounded to closest rotation> 
+    **/
+    IMPORT_C TInt SetRotation(TInt aRotationInDegrees);
+    
+    /** 
+    * @prototype Consult owner about the usage and restrictions
+    *
+    * Defines the composition order. On success returns token
+    * that can be used to create new CAlfCompositionSource object to
+    * control union of theses two composition targets as single object 
+    * for convenience
+    *
+    * Does not affect on hit testing, keyboard focus etc.
+    * 
+    * @return new token to control the union of composition objects (assume key different from default)
+    * 
+    **/
+    IMPORT_C TInt SetZOrder(const CAlfCompositionClientBase& aNode, TBool aAbove, TInt aKey = -1); // todo magic
+    
+    /** 
+    * Defines extent of the composition target on a defined screen
+    * Does not affect on hit testing, keyboard focus etc. but is just additional information for composition
+    **/
+    IMPORT_C TInt SetExtent(const TRect& aRect, TInt aScreen);
+
+    /** 
+    * Adds composition observer for better synchronization
+    **/
+    IMPORT_C void AddCompositionObserverL(MAlfCompositionObserver& aObserver, TInt aScreenNumber = 0); // Todo: KMainScreen);
+
+    /** 
+    * Removes composition observer
+    **/
+    IMPORT_C void RemoveObserver(MAlfCompositionObserver& aObserver);
+
+    /** 
+    * Makes this composition target system wide background surface 
+    * any other target that was previously used as bg anim will be discarded
+    * < should this require some capability like WriteDeviceData ?>
+    **/
+    IMPORT_C void SetIsBackgroundAnim(TBool aIsBg);
+    
+    /** 
+    * Defines extent of the composition source rectangle
+    **/
+    IMPORT_C TInt SetSourceRect(const TRect& aRect);
+    
+    /** 
+    * Internal
+    * For testing applications on extrenal screen 
+    **/
+    IMPORT_C void EnableKeyboard(TBool aEnable, TInt aScreen);
+
+    IMPORT_C ~CAlfCompositionSource();
+
+protected: // utils / baseclass
+    IMPORT_C virtual void HandleEventL(TInt aEventType, TAny* aEventData);
+    virtual void ConstructL(TInt aHandle1, TInt aHandle2, TInt  aScreenNumber);
+    virtual void ConstructL(RWindow& aClientWindow);
+    TInt Handle();
+
+protected: // data
+    class CAlfCompositionSourceData;
+    CAlfCompositionSourceData* iData;
+    };
+
+#endif // #define __ALFCOMPOSITIONUTILITY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfcontrol.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,688 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 class for client side controls
+*
+*/
+
+
+
+#ifndef C_ALFCONTROL_H
+#define C_ALFCONTROL_H
+
+#include <e32base.h>
+#include <barsread.h>
+#include <alf/alfvisual.h>  
+#include <alf/alflayout.h>  
+#include <alf/alfeventhandler.h>
+#include <alf/alfpropertyowner.h>
+
+/* Forward declarations. */
+class CAlfEnv;
+class CAlfDisplay;
+class TAlfEvent;
+class CAlfControlGroup;
+
+/**
+ * CAlfControl provides a base class for gathering logical functionality in
+ * the UI.
+ *
+ * For example a list control could gather and control all visuals that form
+ * a listbox UI element. A thumbnail view control could be used to control visuals
+ * that form a thumbnail view in an image gallery application.
+ *
+ * Their main use is to handle interaction with the user by catching events through
+ * overloaded OfferEventL() - method.
+ *
+ * Developers should derive their controls from this base class to implement the UI logic
+ * of their application. Developers should remember to pass a reference to the CAlfEnv - object
+ * to the CAlfControl - base class when derived class is constructed through the 
+ * CAlfControl::ConstructL() - method. Failure to do this will result in KERN-EXEC 3 panic
+ * when CAlfControl - derived object is added to a CAlfControlGroup. Usually you would do this
+ * when ConstructL() - method of the derived class is called, like this:
+ *
+ * Usage: 
+ * @code
+ * class CMyControl : public CAlfControl
+ *    {
+ *  public:
+ *     CMyControl( CAlfEnv& aEnv );
+ *    ~CMyControl();
+ * 
+ *    //Handle interaction with the user by catching events
+ *    virtual TBool OfferEventL(const TAlfEvent& aEvent);
+ *    
+ *    //Few other notofication methods, overloaded by this custom
+ *    //control, to perform required action
+ *    void NotifyControlVisibility( TBool aIsVisible, CAlfDisplay& aDisplay );
+ *    void VisualLayoutUpdated( CAlfVisual& aVisual );
+ *    void FocusChanged( CAlfDisplay& aDisplay, TBool aFocused );
+ *    void HostChanging( CAlfControl* aNewHost );
+ *    TBool Focusing()const;
+ *   };
+ * 
+ *  void CMyControl::ConstructL(CAlfEnv& aEnv)
+ * 	{
+ *     CAlfControl::ConstructL(aEnv);
+ * 	}
+ * 
+ *  //To show the control on display
+ *  //Create a new control group
+ *  CAlfControlGroup& group = iEnv->NewControlGroupL( KControlGroupIdDefault );
+ * 
+ *  //Create control instance and append it to group
+ *  CMyControl* control = CMyControl::ConstructL(&iEnv);
+ *  group.AppendL( control );
+ * 
+ *  //Show control group on display
+ *  iDisplay->Roster().ShowL( group );
+ * 
+ * @endcode 
+ * Controls are not visible by themselves, but controls create and manipulate
+ * visuals (CAlfVisual - derived objects). Controls set the target values for visual properties and/or
+ * schedule animation commands.
+ *
+ * Controls are collected in groups represented by CAlfControlGroup - objects (e.g., one group per view). 
+ * Even though controls are contained within control groups they do not have a hierarchical organization.
+ * Controls can be, however, connected to each other for collaboration.
+ * This can be done using AddConnectionL() - method.
+ */
+class CAlfControl : public CAlfPropertyOwner, public MAlfEventHandler 
+	{
+public:
+
+	/** @beginAPI */
+	
+	/* Constructors and destructor. */
+
+	/**
+	 * Constructor.
+	 */
+	IMPORT_C CAlfControl();
+
+	/**
+	 * Second-phase constructor.
+	 */
+	IMPORT_C void ConstructL( CAlfEnv& aEnv );
+
+	/**
+	 * Destructor.
+	 */
+	IMPORT_C ~CAlfControl();
+
+
+	/* Methods. */
+	
+
+    IMPORT_C TInt Identifier() const;
+
+	/**
+	 * Set an id value for this control.
+	 */
+	IMPORT_C void SetId( TInt aId );
+
+	/**
+	 * Returns the id of this control. Zero (0) id the control has no id.
+	 */
+	IMPORT_C TInt Id() const;
+
+	/**
+	 * Returns the environment of the visual.
+	 */
+	IMPORT_C CAlfEnv& Env() const;
+
+	/**
+	 * Returns the control group of the visual's owner control.
+	 *
+	 * @return  Control group, or <code>NULL</code> if there isn't one.
+	 */
+	IMPORT_C CAlfControlGroup* ControlGroup() const;
+
+    /**
+     * Returns the display this control is bound to, or <code>NULL</code>.
+     */
+    IMPORT_C CAlfDisplay* Display() const;
+
+    /**
+     * Binds the control to a display. Called automatically by 
+     * CAlfControl::ShowL().
+     */
+    IMPORT_C void BindDisplay( CAlfDisplay& aDisplay );
+
+	/**
+	 * Appends a new visual to the list of visuals owned by the control.
+	 *
+	 * @see CAlfVisual::Owner()
+	 *
+	 * @param aVisual        Visual to be appended.
+	 * @param aParentLayout  Parent layout visual to which the visual will be appended to.
+	 * @return Error code.   KErrNotSupported if some other control already owns the visual
+	 *                       KErrAlreadyExists if visual was added to this control already
+	 *                       System wide error codes in case of OOM   
+	 */
+	IMPORT_C TInt Append( CAlfVisual* aVisual,
+                           CAlfLayout* aParentLayout = NULL);
+
+	/**
+	 * Removes a visual from the control. The caller also receives ownership
+	 * of the visual.
+	 *
+	 * @param aVisual  Visual to remove. Caller gets ownership.
+	 */
+	IMPORT_C void Remove( CAlfVisual* aVisual );
+
+	/**
+	 * Creates a new visual using the visual factory and appends it.
+	 *
+	 * @param aVisualType  Type of the visual to create.
+	 *
+	 * @return  Pointer to the created visual.
+	 */
+    IMPORT_C CAlfVisual* AppendVisualL( TAlfVisualType aVisualType,
+                                        CAlfLayout* aParentLayout = 0,
+                                        TInt aImplementationUid = 0 );
+
+    /**
+     * Creates a new layout using the visual factory and appends it.
+     *
+     * @param aLayoutType  Type of the layout to create.
+     *
+     * @return  Pointer to the created layout.
+     */
+    IMPORT_C CAlfLayout* AppendLayoutL( TAlfLayoutType aLayoutType,
+                                        CAlfLayout* aParentLayout = NULL,
+                                        TInt aImplementationUid = 0 );
+
+    /**
+     * Returns one of the visuals owned by the control.
+     *
+     * @param aIndex  Index number of the visual to return.
+     *
+     * @return  Visual.
+     */
+    IMPORT_C CAlfVisual& Visual( TInt aIndex ) const;
+
+    /**
+     * Determines the number of visuals owned by the control. 
+     *
+     * Note that in visual hierarchies, child visuals are not owned by 
+     * their parent visuals, but a control. This means that a control 
+     * that owns a tree of visuals will return the total number of visuals 
+     * in the tree, and not just the number of root visuals.
+     *
+     * @return  Number of visuals owned by the control.
+     */
+    IMPORT_C TInt VisualCount() const;
+
+    /**
+     * Finds the visual that matches a tag. Only the visuals owned by 
+     * this control are searched.
+     *
+     * @param aTag  Tag descriptor to match against.
+     *
+     * @return  The first visual that matches the tag, or <code>NULL</code>
+     *          if no visual matched the tag.
+     */
+    IMPORT_C CAlfVisual* FindTag( const TDesC8& aTag ) const;
+      
+	/**
+	 * Returns the visual host control.
+	 *
+	 * @return  Host control. NULL if not set.
+	 */
+	IMPORT_C CAlfControl* Host() const;
+
+	/**
+	 * Establishes a manual connection between this host control and another control.
+	 * 
+	 * If setting manually the connection, do not use the SetHostId() function
+	 * from the child control!
+	 *
+	 * Calls ConnectionAddedL when a connection has been created between the two
+	 * controls
+ 	 *
+	 * @param aConnectedControl  Control to connect.
+	 * @param aRole              Role of the control. Interpretation depends on
+	 *                           the host.
+	 *
+	 * @see ConnectionAddedL
+	 */
+	IMPORT_C virtual void AddConnectionL( CAlfControl* aConnectedControl, 
+	                                      TInt aRole );
+
+	/**
+	 * Removes a client.
+	 *
+	 * Calls ConnectionRemoved when a connection has been broken between the two
+	 * controls
+	 *
+	 * @param aConnectedControl  Connected control to remove.
+	 *
+	 * @see ConnectionRemoved
+	 */
+	IMPORT_C void RemoveConnection( CAlfControl* aConnectedControl );
+
+    /**
+     * Find a client's index number.
+     *
+     * @param aConnected  Connected control to find.
+     *
+     * @return  Index number.
+     */
+    IMPORT_C TInt FindConnection( const CAlfControl* aConnected ) const;
+
+	/**
+	 * Returns the number of clients.
+	 *
+	 * @return  Number of client controls.
+	 */
+    IMPORT_C TInt ConnectionCount() const;
+
+	/**
+	 * Returns a client control.
+	 *
+	 * @param aIndex  Index of the client.
+	 *
+	 * @return  Reference to the client control.
+	 */
+    IMPORT_C CAlfControl& Connection( TInt aIndex ) const;
+
+    /**
+     * @deprecated
+     *  
+     * Returns a client control.
+     *
+     * @param aOrdinal  Role or index.
+     */
+    IMPORT_C CAlfControl& ConnectionByOrdinal( TInt aOrdinal ) const;
+
+	/**
+	 * Returns the role of a client control.
+	 *
+	 * @param aIndex  Index of the client.
+	 *
+	 * @return  Role of the client control.
+	 */
+    IMPORT_C TInt ConnectionRole( TInt aIndex ) const;
+
+    /**
+     * @deprecated
+     *
+     * Ordinal is the effective index. Role overrides index.
+     */
+    IMPORT_C TInt ConnectionOrdinal( TInt aIndex ) const;
+
+    /**
+     * Returns the controls role.
+     * 
+     * @return Role.
+     */
+    IMPORT_C TInt Role() const;
+
+    /**
+     * Sets the controls role.
+     * 
+     * @param aRole New role.
+     */
+    IMPORT_C void SetRole( TInt aRole );
+
+    /**
+     * Returns the automatic visual host identification.
+     * 
+     * @return Identifier of the host control. Zero if not set,
+     */
+    IMPORT_C TInt HostId() const;
+
+    /**
+     * Sets the automatic visual host identification.
+     * When the control is shown, the connection is created automatically
+     * betweem this control and the host determined by the paramter.
+     * 
+     * If the automatic ID is set, do not use the manual AddConnectionL function!
+     * 
+     * @param aHostId Identifier of the host control. Zero if not set,
+     */
+    IMPORT_C void SetHostId( TInt aHostId );
+
+	/**
+	 * @internal
+	 *
+	 * Do not call this outside the library!
+	 *
+	 * Sets the host of the control. The AddConnectionL function will
+	 * call this after the host side has been set-up for the connection.
+	 *
+	 * @param aHost  Host control.
+	 */
+    IMPORT_C void SetHost( CAlfControl* aHost );
+
+    /**
+     * Returns a container layout for the specified child control.
+     *
+     * By default this function returns NULL. Override this function
+     * in your own control to select the container layout. 
+     *
+     * @param aConnected Child control, which is querying the layout.
+     *
+     * @return Container layout for the child controls' root visuals.
+     */
+    IMPORT_C virtual CAlfLayout* ContainerLayout(
+        const CAlfControl* aConnected ) const;
+
+    /**
+     * Coordinate conversion.
+     */
+    IMPORT_C TPoint HostToDisplay( const TPoint& aPoint ) const;
+
+    /**
+     * Coordinate conversion.
+     */
+    IMPORT_C TPoint DisplayToHost( const TPoint& aPoint ) const;
+
+    /**
+     * Calculates the region of the screen where the control's visuals are.
+     *
+     * @return  Rectangle in display coordinates.
+     */
+    IMPORT_C TRect Bounds() const;
+
+    /**
+     * Tests whether a point is inside the control.
+     *
+     * @param aPoint  Point in display coordinates.
+     *
+     * @return  <code>ETrue</code>, if the point is inside one of the
+     *          control's visuals. Otherwise <code>EFalse</code>.
+     */
+    IMPORT_C TBool HitTest( const TPoint& aPoint ) const;
+
+    /**
+     * Attempt to acquire focus for this control.
+     * 
+     * Actively attempt to acquire focus on all displays that contain visuals owned by this control.
+     * This will set the focused control in the rosters of these displays, and then, in most situations, call 
+     * <code>SetFocus</code> with a value of  <code>ETrue</code> on this control. The callback in 
+     * <code>CAlfControl::FocusChanged</code> or its virtual override is then called. It is there that the control 
+     * should perform whatever visual or functional changes that it performs upon change of focus.
+     * 
+     * If a display for this control is not currently focused (for example if another application is showing a popup or an element from
+     * another UI library, for instance an Avkon menu is displayed ) then calling this method will only set a latent focus 
+     * in that display's roster. That is, the focused control will be changed in the roster, but not in the control itself.
+     * The control will not receive a <code>FocusChanged</code> callback. The call to this method "fails" only in the sense 
+     * that there is no immediate setting of focus to the control by the environment.
+     *
+     * When focus is restored to the display, then the latent focus held in the roster will then be used to set focus again to the
+     * control. Alf controls will thus experience loss and gain of focus when displays lose and gain focus, with the record of which 
+     * control has the latent focus held in the roster.
+     */
+    IMPORT_C void AcquireFocus();
+
+    /**
+     * Attempt to give up focus.
+     *
+     * Actively give up focus on all displays containing visuals for this control. Whether the focus is 
+     * actually changed in the associated roster(s) depends upon the focus state of the related displays.
+     * @see CAlfControl::AcquireFocus
+     *
+     * @note If this control has latent focus in a roster then it is still cleared (i.e. is no longer even latent).
+     * @note If this control is not the currently focused control in a roster (either active or latent) then calling 
+     * this method has no effect on the focus state of that roster. 
+     */
+    IMPORT_C void RelinquishFocus();
+    
+    /**
+     * Determines whether the control has input focus.
+     */
+    IMPORT_C TBool Focus() const;
+    
+    /**
+     * Finds a child connection with focus or recursively one of its child
+     * connections have focus. Use Focus() to find out if the returned
+     * control instance has focus.
+     * 
+     * @return Child connection on a focus path. NULL if not found.
+     */
+    IMPORT_C CAlfControl* FocusedConnection() const;
+    
+    /**
+     * Called when this control is included/excluded from the focus chain.
+     *
+     * Example:
+     * There are controls c1, c2 and c3. The c3 is a child connection of the 
+     * c2 (i.e. c2 is a host of c3). When the c1 is focused, the c2 is not 
+     * part of the focus chain. Now, when c3 receives focus, the c2 becomes
+     * part of the focus chain and this function will be called for c2. When the c3
+     * loses focus (with RelinquishFocus() or back to c1), this function we be 
+     * called again for c2 object.
+     * 
+     * This function calls PropertyOwnerExtension() with parameters:
+     * aExtensionUid        KUidAlfPropOwnerExtControlFocusChainChanged
+     * aExtensionParams     TBool** True if focus chain is gained.
+     */
+    void FocusChainChanged( TBool aInFocusChain );
+
+    /**
+     * Determines whether the control wants to receive focus.
+     */
+    IMPORT_C virtual TBool IsFocusing() const;
+
+    /**
+     * Called when the control's focus state changes.
+     */
+    IMPORT_C virtual void FocusChanged( CAlfDisplay& aDisplay, TBool aFocused );
+
+    /**
+     * Determines whether the control accepts input events.
+     */
+    IMPORT_C TBool AcceptInput() const;
+
+    /**
+     * Called when an input event is being offered to the control.
+     *
+     * @param aEvent  Event to be handled.
+     *
+     * @return  <code>ETrue</code>, if the event was handled.
+     *          Otherwise <code>EFalse</code>.
+     */
+    IMPORT_C virtual TBool OfferEventL( const TAlfEvent& aEvent );
+
+    /**
+     * Determines the display area.
+     *
+     * @return  Area of the display on which the control is shown.
+     */
+    IMPORT_C TRect DisplayArea() const;
+
+    /**
+     * Determines the coordinates of the center of the display.
+     *
+     * @return  Center of the display on which the control is shown.
+     */
+    IMPORT_C TAlfRealPoint DisplayCenter() const;
+
+    /**
+     * Cancel all scheduled commands related to this control and the control's
+     * visuals.
+     */
+    IMPORT_C void CancelAllCommands();
+    
+    /**
+     * Called when a visual owned by the control is being destroyed.
+     * Visual is removed from the control.
+     *
+     * @param aVisual  Visual about to the destroyed.
+     */
+    IMPORT_C virtual void VisualDestroyed(CAlfVisual& aVisual);
+    
+    /**
+     * Notifies the owner that the layout of a visual has been recalculated.
+     * Called only when the EAlfVisualFlagLayoutUpdateNotification flag has
+     * been set for the visual.
+     *
+     * @param aVisual  Visual that has been laid out.
+     */
+     IMPORT_C virtual void VisualLayoutUpdated(CAlfVisual& aVisual);
+   
+	/**
+	 * Notifies the visual owner if there was an error (a leave happened)
+	 * when preparing the visual for drawing. Typically the resource alloc
+	 * errors such as out of memory is escalated through this callback.
+	 * 
+     * @param aVisual    Visual that caused the error.
+     * @param aErrorCode Symbian KErr error code for the failure.
+	 */
+     IMPORT_C virtual void VisualPrepareDrawFailed(CAlfVisual& aVisual, TInt aErrorCode);
+
+    /**
+     * Shows all the unshown visuals of the control on the specified display.
+     * Visuals that are currently shown on another display are not affected.
+     *
+     * @param aDisplay  Display to add visuals to.
+     *
+     * @see CAlfControl::BindDisplay()
+     */
+    IMPORT_C void ShowL( CAlfDisplay& aDisplay );
+
+    /** @endAPI */
+
+    /**
+     * Sets the group that owns the control. Called by the control group
+     * when the control is added to the group.
+     *
+     * @param aOwnerGroup  Owner group.
+     */
+    void SetControlGroup( CAlfControlGroup& aOwnerGroup );
+
+    /**
+     * Hides those visuals that are displayed on the specified display. Other
+     * visuals are not affected.
+     *
+     * @param aDisplay  Display to remove visuals from.
+     */
+    void Hide( CAlfDisplay& aDisplay );
+
+    /**
+     * Changes the control's focus state.
+     */
+    void SetFocus( CAlfDisplay& aDisplay, TBool aHasFocus );
+
+    /**
+     * Sets the flag that tells whether the control wants to receive focus.
+     */
+    void SetFocusing( TBool aFocusing );
+
+    /**
+     * Clears the change flags of the control.
+     */
+    void ClearChanged();
+
+
+protected:
+
+    /** @beginAPI */
+
+    /* Methods. */
+
+    /**
+     * Notifies the control that its visible has been changed on a display.
+     * This is the earliest time when the control knows the dimensions of
+     * the display it is being shown on.
+     *
+     * @param aIsVisible  ETrue, if the control is now visible on the display.
+     *                    EFalse, if the control is about to the hidden on the display.
+     * @param aDisplay    The display on which the control's visibility is changing.
+     */
+    IMPORT_C virtual void NotifyControlVisibility( TBool aIsVisible, 
+                                                   CAlfDisplay& aDisplay );
+
+
+    /* Utility methods. */
+
+    /**
+     * Called when a visual has been added to the control.
+     *
+     * @param aVisual  Visual that was added.
+     */
+    IMPORT_C virtual void VisualAddedL( CAlfVisual* aVisual );
+
+    /**
+     * Called when a visual has been removed from the control.
+     *
+     * @param aVisual  Visual that was removed.
+     */
+    IMPORT_C virtual void VisualRemoved( CAlfVisual* aVisual );
+
+    /**
+     * Called when a client control is added to the control.
+     *
+     * Override this function to get the notification.
+     *
+     * @param aConnectedControl Connected child control
+     * @parar aRole Role of the child control.
+     *
+     * @see AddConnectionL
+     */
+    IMPORT_C virtual void ConnectionAddedL( CAlfControl* aConnectedControl, 
+                                            TInt aRole );
+
+    /**
+     * Called when a client control is removed from the control.
+     *
+     * Override this function to get the notification.
+     *
+     * @param aConnectedControl Removed child control
+     * @parar aRole Role of the child control.
+     *
+     * @see RemoveConnection
+     */
+    IMPORT_C virtual void ConnectionRemoved( CAlfControl* aConnectedControl, 
+                                             TInt aRole );
+
+    /**
+     * The host control is about to be changed. The control needs to
+     * add its visuals to the container layout provided by the new host.
+     *
+     * Override this function to get the notification. Base call is
+     * mandatory. If this function leaves, the connection will not be
+     * created.
+     *
+     * @param aNewHost New host control. If NULL, the host is removed.
+     */
+    IMPORT_C virtual void HostChangingL( CAlfControl* aNewHost );
+
+    /** @endAPI */
+    
+    /**
+     * @internal
+     *
+     * Remove this control's visuals from the specified container layout.
+     *
+     * @param aHostControl Host control.
+     */
+    void RemoveVisualsFromHostControl( CAlfControl& aHostControl );
+
+protected:
+
+    /** ! future proofing */
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+
+private:
+    
+    // Private data. Owned.
+    struct TPrivateData;
+    TPrivateData* iData;
+
+	};
+
+#endif  // C_ALFCONTROL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfcontrolgroup.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,194 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Control group
+*
+*/
+
+
+
+#ifndef C_ALFCONTROLGROUP_H
+#define C_ALFCONTROLGROUP_H
+
+#include <e32base.h>
+
+class CAlfEnv;
+class CAlfControl;
+class CAlfTransformation;
+class CAlfDisplay;
+
+/**
+ *  A control group class is used to group controls that belong together.
+ *
+ *  Control group contains CAlfControl - derived classes. Control group can be
+ *  used to create logical compounds of several controls. For instance all controls
+ *  belonging to the same UI view can be grouped into a single control group.
+ *
+ *  Control groups should be instantiated through CAlfEnv::NewControlGroupL().
+ *  Usage:
+ *  @code
+ * //Create a new control group
+ *  CAlfControlGroup& group = iEnv->NewControlGroupL( KControlGroupIdDefault );
+ * 
+ * //Create control instance and append it to group
+ *  CMyControl* control = CMyControl::ConstructL(&iEnv);
+ *  group.AppendL( control );
+ * 
+ *  //Show control group on display
+ *  iDisplay->Roster().ShowL( group );
+ *  @endcode 
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfControlGroup ): public CBase
+    {
+public:
+
+    /**
+     * 1st phase constructor.
+     */
+    CAlfControlGroup();
+    
+    /**
+     * 2nd phase constructor.
+     * @param aResourceId Identifier.
+     * @param aEnv The env.
+     */
+    void ConstructL( TInt aResourceId, CAlfEnv& aEnv );
+
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfControlGroup();
+
+    /**
+     * Return the server side handle
+     *
+     * @return Handle to the server side CAlfSrvControlGroupSubSession object. 
+     *         0 if not set.
+     */
+    TInt Identifier() const;
+    
+    /**
+     * Binds a display to a control group. If a display is bound to a control group
+     * it is being shown. Otherwise the control group is hidden. CAlfRoster uses
+     * this method to notify control group about the display on which it is shown.
+     * User should use methods in CAlfRoster to show or hide a control group.
+     *
+     * @see CAlfRoster
+     *
+     * @param aDisplay Pointer to a display on which this control group is shown,
+     *                 or NULL if control group is hidden.
+     */
+    void BindDisplay(CAlfDisplay* aDisplay);
+    
+    /**
+	 * Determines the identifier of the control group (from a resource file).
+	 *
+	 * @return  Resource identifier.
+	 */
+    IMPORT_C TInt ResourceId() const;
+     
+    /**
+	 * Adds a new control into the group. The group takes ownership of the
+	 * control.
+	 *
+	 * @param aControl  Control to insert into the group.
+	 */ 
+    IMPORT_C void AppendL( CAlfControl* aControl );
+    
+    /**
+     * Removes a control from the control group.
+     *
+     * @param aControl  Control to remove from the group. The control's
+     *                  ownership is transferred to the caller. Note that
+     *                  controls should never be used unless they are
+     *                  owned by a control group.
+     *
+     * @return  KErrNone, if successful. KErrNotFound, if the control is not
+     *          in the group.
+     */
+    IMPORT_C TInt Remove(CAlfControl* aControl);
+    
+    /**
+	 * Determines whether the group accepts input events.
+	 *
+	 * @return ETrue is accepts input.
+	 */
+    IMPORT_C TBool AcceptInput() const;
+    
+    /**
+     * Sets the input event acceptance of the group.
+     *
+     * @param aAcceptInput  Accept input events.
+     */
+    IMPORT_C void SetAcceptInput( TBool aAcceptInput );
+    
+    /**
+     * Finds control
+     * @see CAlfEnv::FindControl()
+     * @return  Pointer to the control, or <code>NULL</code> if the control
+     *          is not in the group.
+     */
+    IMPORT_C CAlfControl* FindControl( TInt aId,  TBool aUserId = ETrue ) const;
+    
+    /**
+     * Returns the number of controls within this group.
+     * 
+     * @return Number of controls.
+     */
+    IMPORT_C TInt Count() const;
+    
+    /**
+     * Access a control within the group, by its index into the
+     * internal list of controls. Will panic if an out-of-bounds
+     * index is passed.
+     * 
+     * @param aIndex  Index of the control to return.
+     * 
+     * @return Reference to the requested control. Always
+     *         returns a valid control.
+     */
+    IMPORT_C CAlfControl& Control( TInt aIndex ) const;
+    
+    /**
+     * Enables or disables transformation of the control group.
+     *
+     * @param aIsTransformed ETrue for enabling.
+     */
+    IMPORT_C void EnableTransformationL( TBool aIsTransformed = ETrue );
+    
+    /**
+     * Determines if the control group has a transformation.
+     *
+     * @return ETrue is transformation is enabled.
+     */
+    IMPORT_C TBool IsTransformed() const;
+    
+    /**
+     * Returns the transformation of the control group.
+     *
+     * @return  Transformation steps.
+     */
+    IMPORT_C CAlfTransformation& Transformation();
+
+private:
+    
+    // Private data. Owned.
+    struct TPrivateData;
+    TPrivateData* iData;
+
+    };
+
+
+#endif // C_ALFCONTROLGROUP_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfcurvepath.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,284 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Curve paths are composed of path segments
+*                and can be used as mapping functions, and in line visuals.
+*
+*/
+
+
+
+#ifndef ALFCURVEPATH_H
+#define ALFCURVEPATH_H
+
+#include <e32base.h>
+#include <alf/alfmappingfunctions.h>
+
+class CAlfEnv;
+class CAlfGenComponent;
+
+/**
+ *  Curve paths are composed of path segments
+ *  and can be used as mapping functions, and to define the shape of line visuals.
+ *
+ *  The curve path can be constructed from two primitives: arcs and lines. The arcs
+ *  and lines can be defined through methods AppendArcL() and AppendLineL() respectively.
+ *
+ *  Coordinate values used when defining arcs and lines have to match the base unit type
+ *  of the visual associated with this curve path. So for instance, if this curve path
+ *  is used to define a layout using CAlfCurvePathLayout the definition of arcs and
+ *  lines have to match the base unit of the layout. If this path is used to define a
+ *  CAlfLineVisual, the coordinate values has to be defined in terms of base units affecting
+ *  the CAlfLineVisual.
+ *
+ *  In the code example below a curve path is defined to a curve path layout. The curve
+ *  path is constructed from two line segments and one arc segment and defines a path
+ *  that starts from the bottom left corner of the layout and ends in the bottom right corner
+ *  of the layout. The total length of the curve path is 4.0 units. Notice that the coordinates
+ *  of the curve path are defined in base units of the layout.
+ *
+ *  @code
+ * 	// Create a new curve path layout
+ * 	CAlfCurvePathLayout* layout = CAlfCurvePathLayout::AddNewL(*this);
+ * 	layout->SetBaseUnit(TAlfMetric(1.0f, EAlfUnitNormalized));
+	
+ *	// Construct the layout path
+ *	CAlfCurvePath& path = layout->CurvePath();
+ *	path.AppendLineL(TAlfRealPoint(0.0f, 1.0f), TAlfRealPoint(0.0f, 0.5f), 1);
+ *	path.AppendArcL(TAlfRealPoint(0.5f, 0.5f), TAlfRealSize(0.5f, 0.5f), 180.0f, 360.0f, 2);
+ *	path.AppendLineL(TAlfRealPoint(1.0f, 0.5f), TAlfRealPoint(1.0f, 1.0f), 1);
+ *  @endcode
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfCurvePath ): public CBase, public MAlfMappingFunction
+    {
+
+public:
+
+    /** 
+     * Construct a new curve path.
+     *
+     * @param aEnv The current environment.
+     * @param aCurvePathProviderHandle Handle to the server side curve path provider.
+     *        If 0, the server side will create a new instance of CHuiCurvePath.
+     * @return The new curve path.
+     * @see CAlfGenComponent
+     */
+    IMPORT_C static CAlfCurvePath* NewL( 
+        CAlfEnv& aEnv,
+        TInt aCurvePathProviderHandle = 0 );
+
+    /** 
+     * Construct a new curve path, leave on cleanup stack.
+     *
+     * @param aEnv The current environment.
+     * @param aCurvePathProviderHandle Handle to the server side curve path provider.
+     *        If 0, the server side will create a new instance of CHuiCurvePath.
+     * @return The new curve path.
+     * @see CAlfGenComponent
+     */
+    IMPORT_C static CAlfCurvePath* NewLC( 
+        CAlfEnv& aEnv,
+        TInt aCurvePathProviderHandle = 0  );
+
+    /** 
+     * Destructor.
+     */
+    IMPORT_C virtual ~CAlfCurvePath();
+
+    /** 
+     * Resets the path by removing all segments.
+     */
+    IMPORT_C void Reset();
+    
+    /** 
+     * Enables or disables looping of the path. Looping means that all 
+     * positions are wrapped to the path, so that, e.g., positions past
+     * the end are wrapped to the beginning of the path. Looping is enabled by
+     * default.
+     */
+    IMPORT_C void EnableLoop(TBool aEnable = ETrue);
+    
+    /**
+     * Determines if the path is looping. 
+     */
+    IMPORT_C TBool Loop() const; 
+    
+    /**
+     * Sets the position that is at path location zero.
+     *
+     * @param aPosOrigin  Added to positions when evaluating.
+     */ 
+    IMPORT_C void SetOrigin(TReal32 aPosOrigin) __SOFTFP;
+    
+    /**
+     * Appends a line segment to the path. Note that the coordinate values should 
+     * match to the metrics unit type of the visual that uses this class. 
+     * @deprecated Use the AppendLineL() - method with real values instead.
+     *
+     * @param aStart Start point
+     * @param aEnd End point
+     * @param aLength  Negative length means that the length will be the 
+     *                 actual length of the line segment.
+     */
+    IMPORT_C void AppendLineL(
+        const TPoint& aStart, 
+        const TPoint& aEnd, 
+        TReal32 aLength = -1) __SOFTFP;
+        
+    /**
+     * Appends a line segment to the path. Note that the coordinate values should 
+     * match to the metrics unit type of the visual that uses this class.
+     *
+     * @param aStart Start point
+     * @param aEnd End point
+     * @param aLength  Negative length means that the length will be the 
+     *                 actual length of the line segment.
+     */
+    IMPORT_C void AppendLineL(
+        const TAlfRealPoint& aStart, 
+        const TAlfRealPoint& aEnd, 
+        TReal32 aLength = -1) __SOFTFP;
+
+    /**
+     * Appends a curve segment to the path. Note that the coordinate values should 
+     * match to the metrics unit type of the visual that uses this class. The curve segment is defined
+     * as a segment of an ellipse.
+     *
+     * The span of the arc is defined in a range of degrees traversed on the
+     * ellipse. The direction of zero degrees points towards the positive x - axis and 
+     * 180 degrees points towards negative x - axis. The degrees are specified in
+     * clockwise manner so that 90 degrees points towards the positive y - axis (down).
+     * 
+     * @deprecated Use the AppendArcL(const TAlfRealPoint&, const TAlfRealSize&, TReal32, TReal32, TReal32) - method instead.    
+     *
+     * @param aOrigin      Origin of the arc ellipse.
+     * @param aSize        Horiz and vert radii of the arc ellipse.
+     * @param aStartAngle  Start angle of the arc in degrees.
+     * @param aEndAngle    End angle of the arc in degrees.
+     * @param aLength      Negative length means that the length will be the
+     *                     actual length of the arc.
+     */                              
+    IMPORT_C void AppendArcL(
+        const TPoint& aOrigin, 
+        const TSize& aSize,
+        TReal32 aStartAngle, 
+        TReal32 aEndAngle,
+        TReal32 aLength = -1) __SOFTFP;
+        
+    /**
+     * Appends a curve segment to the path. Note that the coordinate values should 
+     * match to the metrics unit type of the visual that uses this class. The curve segment is defined
+     * as a segment of an ellipse.
+     *
+     * The span of the arc is defined in a range of degrees traversed on the circle of an
+     * ellipse. The direction of zero degrees points towards the positive x - axis and 
+     * 180 degrees points towards negative x - axis. The degrees are specified in
+     * clockwise manner so that 90 degrees points towards the positive y - axis (down).      
+     *
+     * Image below depicts how a curve segment can be defined in the path.
+     *
+     * @image html CAlfCurvePath_ArcDefinition.png "Curve segment defined using AppendArcL()."
+     *
+     * @param aOrigin      Origin of the arc ellipse.
+     * @param aSize        Horiz and vert radii of the arc ellipse.
+     * @param aStartAngle  Start angle of the arc in degrees.
+     * @param aEndAngle    End angle of the arc in degrees.
+     * @param aLength      Negative length means that the length will be the
+     *                     actual length of the arc.
+     */                              
+    IMPORT_C void AppendArcL(
+        const TAlfRealPoint& aOrigin, 
+        const TAlfRealSize& aSize,
+        TReal32 aStartAngle, 
+        TReal32 aEndAngle,
+        TReal32 aLength = -1) __SOFTFP;
+                             
+    /**
+     * Determines the total length of the path.
+     *
+     * @return Length of the curve.
+     */                
+    IMPORT_C TReal32 Length() const __SOFTFP;
+   
+    /**
+     * Evaluates a point along the curve path.
+     *
+     * @param aPos    Position along the path.
+     * @param aPoint  Returns the X and Y coordinates of the point on the path.
+     */
+    IMPORT_C void Evaluate(TReal32 aPos, TAlfRealPoint& aPoint) const __SOFTFP;  
+        
+    /**
+     * Get offset of the entire path.
+     *
+     * @return Offset
+     * @see SetOffset()
+     */                
+    IMPORT_C const TAlfTimedPoint& Offset() const;
+                         
+    /**
+     * Set offset of the entire path.
+     * Sets the translation (ie. origin) of the path. Default is (0,0).
+     *
+     * @param aOffset Offset of the path.
+     */                
+    IMPORT_C void SetOffset( const TAlfTimedPoint& aOffset );
+
+    // From MAlfMappingFunction
+    
+    /**
+     * From MAlfMappingFunction
+     * Return mapping function ID.
+     * @return The mapping function identifier of this curve path. NULL if this class
+     *         was constructed with an existing CAlfGenComponent.
+     * @see CAlfGenComponent::Identifier()
+     * @see NewL()
+     */
+    IMPORT_C TInt MappingFunctionIdentifier() const;
+    
+    /**
+     * From MAlfMappingFunction
+     * Evaluate x/y component on a position on the path.
+     * @param aValue Position along the path to get the coordiantes of.
+     * @param aMode If equal to 0, evaluates X component, otherwise evaluates Y component.
+     * @return The x or y position evaluated for the given position on the curve.
+     */
+    IMPORT_C TReal32 MapValue(TReal32 aValue, TInt aMode) const __SOFTFP;
+
+private:
+
+    /**
+     * Constructor.
+     */
+    CAlfCurvePath();
+
+    /**
+     * Second phase constructor.
+     */
+    void ConstructL( 
+        CAlfEnv& aEnv,
+        TInt aCurvePathProviderHandle );
+
+private: // data
+
+    /** Private data.*/
+    struct TPrivateData;
+    
+    /** Private data.*/
+    TPrivateData* iData;
+    };
+
+#endif // ALFCURVEPATH_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfcurvepathlayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Curve path layout definition.
+*
+*/
+
+
+
+#ifndef C_ALFCURVEPATHLAYOUT_H
+#define C_ALFCURVEPATHLAYOUT_H
+
+#include <alf/alflayout.h>
+#include <alf/alfmappingfunctions.h>
+
+class CAlfCurvePath;
+
+/**
+ *  Curve path layout can be used to control size and position properties of
+ *  a visual using a curve path object.
+ *  @see CAlfCurvePath
+ *
+ *  When using a curve path layout the user has to specify which properties of
+ *  a visual should be controlled by the layout. By default the curve path layout
+ *  does not affect any properties of its child visuals. Mapping function identifier
+ *  retrieved through CAlfCurvePathLayout::MappingFunctionIdentifier() - method
+ *  can be used to bind the curve path layout to properties of a visual.
+ *
+ *  The curve path layout contains a curve path instance that can be used to
+ *  customize the path that is used to layout the properties of a visual. Reference
+ *  to the curve path can be acquired through the CAlfCurvePathLayout::CurvePath() - method.
+ *
+ *  The following code example creates a curve path layout, sets its base unit to normalized (0.0 - 1.0)
+ *  units, defines a curve path, binds the curve path layouting to image visual's position
+ *  property and animates the position of the image visual on the curve path from start point of the curve path (0.0)
+ *  to end point of the curve path (2.0) within 3 seconds. Notice that the curve path layout does not
+ *  adjust the size of the image visual and because of that the image visual size is explicitly set to (0.25, 0.25).
+ *  The size of the image visual is defined in base units of it's parent layout.
+ *
+ *	@code
+ *  // Create a curve path layout
+ *  CAlfCurvePathLayout* layout = CAlfCurvePathLayout::AddNewL(*this);
+ *  layout->SetBaseUnit(TAlfMetric(1.0, EAlfUnitNormalized));
+ *  
+ *  // Define a curve path
+ *  CAlfCurvePath& curvePath = layout->CurvePath();
+ *  curvePath.AppendArcL(TAlfRealPoint(0.5, 0.5), TAlfRealSize(0.5, 0.5), 180.0, 360.0, 2.0);
+ *  
+ *  // Create an image visual
+ *  CAlfImageVisual* imageVisual = CAlfImageVisual::AddNewL(*this, layout);
+ *  imageVisual->SetSize(TAlfRealSize(0.25, 0.25));
+ *  CAlfTextureManager& defaultTexture = aEnv.TextureManager( ); 
+ *  CAlfTexture& texture = defaultTexture.LoadTextureL(_L("album4.jpg"),EAlfTextureFlagDefault,KAlfAutoGeneratedTextureId);
+ *  imageVisual->SetImage(TAlfImage(texture));
+ *  
+ *  // Control the position of the image visual with the curve path
+ *  TAlfTimedPoint pos;
+ *  pos.SetMappingFunctionIdentifier(layout->MappingFunctionIdentifier());
+ *  pos.SetTarget(2.0, 3000);
+ *  imageVisual->SetPos(pos);
+ *  @endcode
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+class CAlfCurvePathLayout : public CAlfLayout, public MAlfMappingFunction
+    {
+
+public:
+
+    IMPORT_C static CAlfCurvePathLayout* AddNewL(
+        CAlfControl& aOwnerControl, 
+        CAlfLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     *
+     * @param aOwner  Owner control.
+     */
+    IMPORT_C CAlfCurvePathLayout();
+
+    /**
+     * From CAlfLayout. Second-phase constructor.
+     */
+    IMPORT_C void ConstructL(CAlfControl& aOwner);
+
+    /**
+     * Virtual destructor.
+     */
+    IMPORT_C ~CAlfCurvePathLayout();
+  
+    /**
+     * Returns the curve path instance of the layout. The returned instance
+     * can be used to modify the curve path that is used to control the properties
+     * of a layed out visual. The curve path instance is defined in the base units
+     * used by this layout.
+     * @see CAlfCurvePathLayout::BaseUnit()
+     * @see CAlfCurvePathLayout::SetBaseUnit()
+     *
+     * @return Curve path. This instance cannot be passed
+     *         as general mapping function to other instances.
+     */
+    IMPORT_C CAlfCurvePath& CurvePath();
+   
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void RemoveAndDestroyAllD();
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0);
+    IMPORT_C CAlfVisual* FindTag(const TDesC8& aTag);
+
+    /** 
+     * From CAlfLayout
+     * @see CAlfLayout
+     */
+    IMPORT_C TAlfXYMetric BaseUnit() const; 
+    
+    /**
+     * From MAlfMappingFunction
+     * @see MAlfMappingFunction
+     */
+    IMPORT_C TInt MappingFunctionIdentifier() const;
+    IMPORT_C TReal32 MapValue(TReal32 aValue, TInt aMode) const __SOFTFP;
+
+
+protected:
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void DoRemoveAndDestroyAllD();
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+
+private: // data
+
+    struct TCurvePathLayoutPrivateData;
+    TCurvePathLayoutPrivateData* iCurvePathLayoutData;
+
+    };
+
+
+#endif // C_ALFCURVEPATHLAYOUT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfdecklayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,111 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Deck layout definition.
+*
+*/
+
+
+
+#ifndef C_ALFDECKLAYOUT_H
+#define C_ALFDECKLAYOUT_H
+
+#include <alf/alflayout.h>
+
+/**
+ * Deck layout
+ * Deck layout is a very simple layout that overlays all its children to 
+ * match the layout's own rectangle. A suitable analogy would be a deck 
+ * of cards. 
+ *  Usage:
+ *  @code
+ *  // Create a deck layout to overlay two text visuals
+ *   CAlfDeckLayout* deckLayout = CAlfDeckLayout::AddNewL( control, NULL );
+ * 
+ * // The text visual that is aligned to the top edge of the deck layout.
+ *  TextVisual* topText = CAlfTextVisual::AddNewL( control, deck );
+ *  
+ *  topText->SetTextL( _L"Top Aligned" );
+ *  topText->SetAlign( EAlfAlignHLeft, EAlfAlignVTop );
+ * 
+ * // The text visual that is aligned to the bottom edge of the deck layout.
+ *  TextVisual* bottomText = CAlfTextVisual::AddNewL( control, deck );
+ *  topText->SetTextL( _L"Bottom Aligned" );
+ *  bottomText->SetAlign( EAlfAlignHCenter, EAlfAlignVBottom );
+ * 
+ *  @endcode
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+class CAlfDeckLayout : public CAlfLayout
+    {
+
+public:
+
+    /**
+     * Two-phased constructor, which attach new object into the control.
+     * @param aOwnerControl Control that owns this new obejct.
+     * @param aParentLayout If given, the new object is set as child.
+     */
+    IMPORT_C static CAlfDeckLayout* AddNewL(CAlfControl& aOwnerControl,
+                                            CAlfLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C CAlfDeckLayout();
+
+    /**
+     * Second-phase constructor.
+     */
+    IMPORT_C void ConstructL(CAlfControl& aOwner);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CAlfDeckLayout();
+
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void RemoveAndDestroyAllD();
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0);
+    IMPORT_C CAlfVisual* FindTag(const TDesC8& aTag);
+    /** 
+     * From CAlfLayout
+     * @see CAlfLayout
+     */
+    IMPORT_C TAlfXYMetric BaseUnit() const; 
+
+
+protected:
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void DoRemoveAndDestroyAllD();
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+                                
+private:
+
+    // Private data structure. Owned.
+    struct TDeckLayoutPrivateData;
+    TDeckLayoutPrivateData* iDeckLayoutData;
+
+    };
+
+
+
+#endif // C_ALFDECKLAYOUT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfdisplay.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,405 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Display class.
+*
+*/
+
+
+
+#ifndef C_ALFDISPLAY_H
+#define C_ALFDISPLAY_H
+
+#include <e32base.h>
+#include <alf/alfdisplaybackgrounditem.h>
+#include <alf/alfevent.h>
+
+class CAlfEnv;
+class CAlfRoster;
+class MAlfInputCapabilitiesSupplier;
+class MObjectProvider;
+class TPointerEvent;
+
+
+/* Screen buffer uids */
+const TUid KAlfUidBackBufferAll = 			{0x2000e59d}; // Not used
+const TUid KAlfUidBackBufferScreen0 = 		{0x2000e59e};
+const TUid KAlfUidBackBufferScreen1 = 		{0x2000e59f};
+const TUid KAlfUidBackBufferTvOutNormal = 	{0x2000e5a0};
+const TUid KAlfUidBackBufferTvOutWide = 	{0x2000e5a1};
+
+/**
+ * Rendering quality enumerator. 
+ *
+ * @see CAlfDisplay::SetQuality()
+ * @see CAlfDisplay::Quality()
+ */
+enum TAlfQuality
+    {
+    /** Accurate quality ensures the best visual quality. */
+    EAlfQualityAccurate,
+
+    /** Fastest rendering speed in exchange for lower quality. */
+    EAlfQualityFast
+    };
+
+/**
+*  The intended usage of the display. The display may use this info to 
+*  prioritize the HW usage and route content.
+*  Vendor specific meanings may be used at the end of the enum space.
+*
+*  @see CAlfDisplay::SetUsageL()
+*/
+enum TAlfDisplayUsageHint
+    {
+    EAlfDisplayUsageGeneric        = 0x00000001,
+    EAlfDisplayUsage3D             = 0x00000002,
+    EAlfDisplayUsageVideoPlayback  = 0x00000004,
+    EAlfDisplayUsageVideoCapture   = 0x00000008,
+    EAlfDisplayUsageViewfinder     = 0x00000010,
+    EAlfDisplayUsageStillImage     = 0x00000011,
+    EAlfDisplayUsageVendorSpecific = 0x80000000
+    };
+
+/**
+ *  Display class represents a drawing area on which UI Accelerator Toolkit
+ *  draws it's contents. 
+ *  
+ *  The display always occupies a rectangular area of a rendering surface. 
+ *  Usually the display occupies the whole rendering surface but it can also 
+ *  occupy only parts of the rendering surface. Multiple displays can then 
+ *  occupy multiple parts of the same rendering surface. This can be achieved 
+ *  by setting the visible area of a display through 
+ *  CAlfDisplay::SetVisibleArea() - method.
+ *
+ *  There should always be at least one display on which the contents of an
+ *  application UI can be drawn to. The display can be one of the several 
+ *  display types listed in CAlfDisplay::TDisplayType.
+ *
+ *  Before any visual content is drawn on the display, the display area is
+ *  cleared. Different parts of the display can be cleared with different 
+ *  methods and can be configured using the 
+ *  CAlfDisplay::SetBackgroundItemsL() - method. Alternatively the clearing 
+ *  mode to clear the whole display area can be assigned using 
+ *  CAlfDisplay::SetClearBackgroundL() - method.
+ *
+ *  A display contains always a CAlfRoster - object which defines the drawing
+ *  order of the CAlfControlGroup objects in the UI, controls the order in 
+ *  which events are passed from control group to another and defines which
+ *  control groups are shown and hidden at any given time.
+ *
+ *  To construct a display, use the CAlfEnv::NewDisplayL() - method.
+ *  Usage:
+ *  @code
+ *  CAlfDisplay* display = iEnv->NewDisplayLiEnv->NewDisplayL( ClientRect(), 
+ * 				CAlfEnv::ENewDisplayAsCoeControl );
+ * 
+ *  @endcode
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfDisplay ): public CBase
+    {
+public:
+
+    /* Types. */
+
+    /**
+     * Background clear modes. Different clear modes can be taken into use 
+     * with CAlfDisplay::SetClearBackgroundL() - method.
+     */
+    enum TClearMode
+        {
+        /**
+         * Do not clear. This is more like an optimization flag.
+         * Using this with OpenGL ES renderer results
+         * to undefined (Trashed) background - so be sure to display content
+         * that fills the entire screen. With the BITGDI renderer the
+         * behavior is similar but the display are will show the previously
+         * rendered avkon content (if any).
+         */
+        EClearNone = EFalse,
+
+        /**
+         * Clear with a solid color.
+         */
+        EClearWithColor = ETrue,
+
+        /**
+         * Clear with the skin background texture.
+         */
+        EClearWithSkinBackground
+        };
+
+    /** Display types. */
+    enum TDisplayType
+        {
+        /** @deprecated: Primary LCD display. */
+        EDisplayLcd0 = 0x0,              
+ 
+        /** @deprecated: TV out */
+        EDisplayTvOut = 0x2,
+
+        /** @deprecated: TV out widescreen */
+        EDisplayTvOutWide = 0x3,
+
+        /** Physical screen */
+        EDisplayNormal = 0x10,     
+ 
+        /** Not used. Virtual display */
+        EDisplayVirtual = 0x20,
+
+        /** @deprecated: Off screen buffer */
+        EDisplayOffScreenBuffer = 0x40
+        };
+                
+    /**
+     * Constructor
+     *
+     * To construct a new display, use CAlfEnv::NewDisplayL() - method.
+     */
+    CAlfDisplay();
+    
+    /**
+     * ConstructL
+     *
+     * To construct a new display, use CAlfEnv::NewDisplayL() - method.
+     */
+    void ConstructL(
+        CAlfEnv& aEnv, 
+        TBool aAsCoeControl,
+        const TRect& aRect, 
+        CAlfRoster* aSharedRoster,
+        TInt aDisplayType, 
+        TUid aBufferUid);
+
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfDisplay();
+
+    /**
+     * Sets the flag that tells the display to clear the background before
+     * doing a refresh. Creates new objects required to be able to clear
+     * the background with the defined mode.
+     *
+     * @param aClearBackground  Background clearing mode. For example EFalse,
+     *                          ETrue, EClearWithColor,
+     *                          EClearWithSkinBackground are the valid 
+     *                          alternatives. EClearWithColor is equivalent to 
+     *                          ETrue. EFalse is equivalent to EClearNone.
+     *
+     * @see CAlfDisplay::TClearMode
+     */
+    IMPORT_C void SetClearBackgroundL(TInt aClearBackground);
+
+    /**
+     * Sets the items that specify how to clear display before display
+     * refresh. Items may have overlapping rectangles, drawing order is same 
+     * as item order in the parameter array. But having lots of overlapping 
+     * drawing causes negative performance impact.
+     *
+     * This method is alternative to SetClearBackgroundL().
+     *
+     * @see SetClearBackgroundL()
+     * @param aItems Array of items that specify how to clear the background.
+     *
+     */
+    IMPORT_C void SetBackgroundItemsL(
+                    const RArray<TAlfDisplayBackgroundItem>& aItems);
+    
+    /**
+     * Returns the roster of the display.
+     * @return The roster.
+     */
+    IMPORT_C CAlfRoster& Roster();
+
+    /**
+     * Returns the roster of the display.
+     * @return The roster.
+     */
+    IMPORT_C const CAlfRoster& Roster() const;
+    
+    /**
+     * Sets the visible area of the display. The visible area is the area on
+     * the display's rendering surface where the display is drawn. Normally
+     * a display covers the entire rendering surface, but in the situation
+     * where multiple displays are drawn on the same surface, this would be
+     * used to define the visible area of each display.
+     * Note: This does not set the visible area if alf server session is not focused
+     * 
+     * @param aArea  Visible area for the display.
+     */
+    IMPORT_C void SetVisibleArea(const TRect& aArea);
+
+    /**
+     * Sets the visible area of the display. Similar to SetVisibleArea.
+     * But this sets the visible area even though alf server session is not focused.
+     * Shall be used by client app when Dynamic layout switch happens. 
+     *
+     * @param aArea  Visible area for the display.
+     */
+    IMPORT_C void ForceSetVisibleArea(const TRect& aArea);
+    
+    /**
+     * Returns the visible area of the display.
+     *
+     * @return  Visible area of the display. Affected by display orientation
+     *          so that the returned rectangle uses the oriented coordinate
+     *          space.
+     */
+    IMPORT_C TRect VisibleArea() const;
+    
+    /**
+     * Returns the environment of the display.
+     */
+    IMPORT_C CAlfEnv& Env();
+    
+    /**
+     * Return the server side handle
+     *
+     * @return Handle to the server side CAlfSrvDisplaySubSession object. 0 if
+     *         not set.
+     */
+    TInt ServerHandle() const;
+    
+    /**
+     * Set the current focused editor. 
+     */
+    IMPORT_C void SetFocusedEditor(
+                    MAlfInputCapabilitiesSupplier* aCurrentEditor);
+
+    /**
+     * Flag the entire display as dirty.
+     */
+    IMPORT_C void SetDirty();
+    
+    /**
+     * Sets the rendering quality of the display.
+     *
+     * @param aRenderingQuality One of the quality enumerators in TAlfQuality.
+     */
+    IMPORT_C void SetQuality(TAlfQuality aRenderingQuality);
+
+    /**
+     * Determines the rendering quality of the display.
+     *
+     * @return TAlfQuality enumerator that represents the rendering quality
+     *         setting.
+     */
+    IMPORT_C TAlfQuality Quality() const;
+    
+    /**
+     * Sets the flag that enables the use of depth testing.
+     *
+     * @param aUseDepth  <code>ETrue</code> to enable depth.
+     */
+    IMPORT_C void SetUseDepth(TBool aUseDepth);
+        
+    /**
+    * Method to return an object provider interface for this display.
+    *
+    * @return a pointer or NULL to an MObjectProvider interface
+    */
+    IMPORT_C MObjectProvider* ObjectProvider() const;
+
+    /**
+     * Tells display the intended usage of the display. Display may use this
+     * information to optimize the drawing.
+     *
+     * @param aUsageHint
+     *
+     *   Possible values for parameter are:
+     *   - EAlfDisplayUsageGeneric 
+     *   - EAlfDisplayUsage3D      
+     *   - EAlfDisplayUsageVideoPlayback
+     *   - EAlfDisplayUsageVideoCapture 
+     *   - EAlfDisplayUsageViewfinder   
+     *   - EAlfDisplayUsageStillImage   
+     *   - EAlfDisplayUsageVendorSpecific + n
+     *  
+     *  Supported values depend on display type
+     *  and underlying HW.
+     * 
+     *  @see TAlfDisplayUsageHint
+     */    
+    IMPORT_C void SetUsageL(TUint aUsageHint);
+
+    /**
+     * Suppresses automatic fading by display. This applies only to displays that are tied
+     * to windows. By default, automatic fading is enabled.
+     * @param aSuppress ETrue to suppress, EFalse to enable automatic fading.
+     * @return error code, KErrNone upon success.
+     */
+    IMPORT_C TInt SuppressAutomaticFading( TBool aSuppress = ETrue );
+
+    /**
+     * Visual content will be drawn to the given window. The visual can be a visual tree i.e.
+     * layout visual. The visual will not be any more drawn to the original place. The window
+     * need not to be a full screen window. Giving NULL as aVisual will remove the binding,
+     * and visual content will be drawn to the original place again.
+     *
+     * @param aWindow  Application window.
+     * @param aVisual  Visual or layout visual.
+     */
+	IMPORT_C void SetClientWindowForDrawingL(RWindow* aWindow, CAlfVisual* aVisual);
+
+    /** @endAPI */
+    
+    /**
+     * Handles layout change.
+     */
+    void NotifyLayoutChangedL();
+
+    /**
+    * Accesses whether this CAlfDisplay is focused. 
+    * A display should normally be focused. It will not be focused at least in
+    * the following cases:
+    *  - a non-ALF window in the current application is present in front of
+    *    this AlfDisplay
+    *  - a non-ALF window in another application is present in front of this
+    *    AlfDisplay
+    *
+    * @return the focus state
+    */
+    TBool IsFocused() const;
+
+    /**
+     * Forwards a pointer event received from CONE. This can be called directly by application
+     * to pass in external pointer events. You will have to call this from an application to pass
+     * pointer events to CAlfControl - derived objects if you have created the CAlfDisplay 
+     * class as offscreen buffer that has no native window to grab pointerevents automatically.
+     *
+     * @param aPointerEvent  Received pointer event to handle. Note that iParentPosition of the 
+     * pointerevent should always be in the same coordinate space as where the displays rect 
+     * was defined when it was created.
+     */
+    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
+
+private:
+
+    /**
+     * Chacks screen size.
+     */
+    void CheckScreenRect(TRect aRect);
+
+
+private:
+    
+    // Private data. Owned.
+    struct TPrivateData;
+    TPrivateData* iData;
+     
+    };
+
+#endif // C_ALFDISPLAY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfdisplaybackgrounditem.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,241 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines item in display background.
+*
+*/
+
+
+
+#ifndef __ALFDISPLAYBACKGROUNDITEM_H__
+#define __ALFDISPLAYBACKGROUNDITEM_H__
+
+#include <e32base.h>
+#include <AknsUtils.h>
+
+/**
+ * This class specifies an item that is drawn in the display background.
+ * Item can specify background as either:
+ *
+ *  "None"  - Nothing is drawn to given display area. Can be used to minimize
+ *            updates to display background areas that e.g. are not visible 
+ *            and thus maximize framerate.
+ *
+ *  "Color" - Given display area is filled with given color. Can be defined as 
+ *            skinnable color or normal RGB color..
+ *            
+ *  "Skin background" - Given display area is filled with given skin background
+ *            graphics.
+ * Usage:
+ * @code
+ * 
+ *  //Array to cotain background items
+ *  RArray<TAlfDisplayBackgroundItem> items;
+ *  
+ *  //Fill with Skin backgrounds
+ *  TAlfDisplayBackgroundItem newItem0( rect, logicalskin );
+ *  newItem0.SetRect( rect );
+ *  newItem0.SetThemeBackground(logicalskin);
+ * 
+ * //Append in items 
+ * items.AppendL( newItem0 );
+ * 
+ *  // Fill with Skin colors
+ *  TAlfDisplayBackgroundItem newItem1( rect, logicalskin, skinnedColorIndex1 );
+ *  newItem1.SetRect( rect1 );
+ *  newItem1.SetColor( logicalskin, 1 );
+ * 
+ * //Append in items 
+ *  items.AppendL( newItem1 );
+ * 
+ * // Fill with Colors
+ *  TAlfDisplayBackgroundItem newItem2( rect, 0x0 );
+ *  newItem2.SetRect( rect );
+ *  newItem2.SetColor( KRgbRed );
+ * 
+ * //Append in items vector   
+ *  items.AppendL( newItem2 );
+ *
+ * //Create display and set background items 
+ *  CAlfDisplay* display = iEnv->NewDisplayLiEnv->NewDisplayL( ClientRect(), 
+ * 				CAlfEnv::ENewDisplayAsCoeControl );
+ *  display->SetBackgroundItemsL( items );
+ *	
+ * @endcode
+ * @lib alfclient.lib
+ * @since S60 xxx
+ */
+NONSHARABLE_CLASS( TAlfDisplayBackgroundItem )
+    {
+public:   
+   /** 
+    * Constructor. Default constructor. 
+    */
+    IMPORT_C TAlfDisplayBackgroundItem();
+
+   /**
+    * Constructor. Creates backgroun item which area is not cleared. 
+    * @param aRect Item area in display coordinates (pixels).
+    */
+    IMPORT_C TAlfDisplayBackgroundItem( const TRect& aRect );
+    
+   /**
+    * Constructor. Creates backgroun item which area is cleared
+    * using the given skin background graphics.
+    * @param aRect Item area in display coordinates (pixels).
+    * @param aSkinID Skin background that is used to clear the item area.
+    *                Possible values are e.g.
+    *                KAknsIIDQsnBgScreen
+    *                KAknsIIDQsnBgScreenIdle
+    *                KAknsIIDQsnBgScreenMp
+    *                KAknsIIDQsnBgAreaMain
+    *                KAknsIIDQsnBgAreaMainAppsGrid 
+    *                KAknsIIDQsnBgAreaMainHigh 
+    *                KAknsIIDQsnBgAreaMainFlat 
+    *                KAknsIIDQsnBgAreaMainSmall
+    *                KAknsIIDWallpaper
+    *                KAknsIIDQsnBgAreaMainIdle 
+    *                KAknsIIDQsnBgAreaStatus 
+    *                KAknsIIDQsnBgAreaStatusIdle 
+    *                KAknsIIDQsnBgAreaStaconRt 
+    *                KAknsIIDQsnBgAreaStaconLt 
+    *                KAknsIIDQsnBgAreaStaconRb 
+    *                KAknsIIDQsnBgAreaStaconLb 
+    *                KAknsIIDQsnBgAreaStaconRtIdle 
+    *                KAknsIIDQsnBgAreaStaconLtIdle 
+    *                KAknsIIDQsnBgAreaStaconRbIdle 
+    *                KAknsIIDQsnBgAreaStaconLbIdle 
+    *                KAknsIIDQsnBgAreaControl 
+    *                KAknsIIDQsnBgAreaControlPopup 
+    *                KAknsIIDQsnBgAreaControlMp 
+    *                KAknsIIDQsnBgAreaControlMp 
+    *                KAknsIIDQsnBgNavipaneSolid 
+    *                KAknsIIDQsnBgNavipaneSolidIdle 
+    *
+    */
+    IMPORT_C TAlfDisplayBackgroundItem( const TRect& aRect,
+                               const TAknsItemID& aSkinID );
+
+   /**
+    * Constructor. Creates backgroun item which area is cleared
+    * using the given skin color. 
+    * @param aRect Item area in display coordinates (pixels).
+    * @param aSkinID Skin color group that is used to clear the item area.
+    *                Possible values are e.g.                       
+    *                KAknsIIDQsnIconColors
+    *                KAknsIIDQsnTextColors
+    *                KAknsIIDQsnLineColors
+    *                KAknsIIDQsnOtherColors
+    *                KAknsIIDQsnHighlightColors
+    *                etc.
+    * @param aColorIndex Skin color index.
+    */
+    IMPORT_C TAlfDisplayBackgroundItem( const TRect& aRect,
+                               const TAknsItemID& aSkinID, 
+                               TInt aColorIndex );
+
+   /**
+    * Constructor. Creates backgroun item which area is cleared
+    * using the given color. 
+    * @param aRect Item area in display coordinates (pixels).
+    * @param aColor Color that is used to clear the item area.
+    */
+    IMPORT_C TAlfDisplayBackgroundItem( const TRect& aRect,
+                               const TRgb& aColor );
+    
+   /**
+    * Sets area for the item.
+    * @param aRect Item area in display coordinates (pixels).
+    */
+    IMPORT_C void SetRect( const TRect& aRect );            
+    
+   /**
+    * Sets color that is used clear the item area. This overrides
+    * old color or the skin background if it has been previously given.
+    * @param Item color.
+    */
+    IMPORT_C void SetColor( const TRgb& aColor );
+
+   /**
+    * Sets skinned color that is used clear the item area. This overrides
+    * old color or skin background if it has been previously given.
+    * @param aSkinID Skin color group that is used to clear the item area.
+    *                Possible values are e.g.                       
+    *                KAknsIIDQsnIconColors
+    *                KAknsIIDQsnTextColors
+    *                KAknsIIDQsnLineColors
+    *                KAknsIIDQsnOtherColors
+    *                KAknsIIDQsnHighlightColors
+    *                etc.
+    * @param aColorIndex Color index.
+    */
+    IMPORT_C void SetColor( const TAknsItemID& aSkinID, TInt aColorIndex );
+    
+   /**
+    * Sets skin backgroud that is used clear the item area. This overrides
+    * old color or skin background if it has been previously given.
+    * 
+    * @param aSkinID Skin background that is used to clear the item area.
+    *                Possible values are e.g.
+    *                KAknsIIDQsnBgScreen
+    *                KAknsIIDQsnBgScreenIdle
+    *                KAknsIIDQsnBgScreenMp
+    *                KAknsIIDQsnBgAreaMain
+    *                KAknsIIDQsnBgAreaMainAppsGrid 
+    *                KAknsIIDQsnBgAreaMainHigh 
+    *                KAknsIIDQsnBgAreaMainFlat 
+    *                KAknsIIDQsnBgAreaMainSmall
+    *                KAknsIIDWallpaper
+    *                KAknsIIDQsnBgAreaMainIdle 
+    *                KAknsIIDQsnBgAreaStatus 
+    *                KAknsIIDQsnBgAreaStatusIdle 
+    *                KAknsIIDQsnBgAreaStaconRt 
+    *                KAknsIIDQsnBgAreaStaconLt 
+    *                KAknsIIDQsnBgAreaStaconRb 
+    *                KAknsIIDQsnBgAreaStaconLb 
+    *                KAknsIIDQsnBgAreaStaconRtIdle 
+    *                KAknsIIDQsnBgAreaStaconLtIdle 
+    *                KAknsIIDQsnBgAreaStaconRbIdle 
+    *                KAknsIIDQsnBgAreaStaconLbIdle 
+    *                KAknsIIDQsnBgAreaControl 
+    *                KAknsIIDQsnBgAreaControlPopup 
+    *                KAknsIIDQsnBgAreaControlMp 
+    *                KAknsIIDQsnBgAreaControlMp 
+    *                KAknsIIDQsnBgNavipaneSolid 
+    *                KAknsIIDQsnBgNavipaneSolidIdle 
+    */
+    IMPORT_C void SetSkinBackground( const TAknsItemID& aSkinID );
+    
+private:    
+    /** Item draw area, specified in display pixels */
+    TRect iRect;       
+
+    /** Item skin id. Can be a skin background or skin color */
+    TAknsItemID iSkinID;
+
+    /** Item skin color index */
+    TInt iColorIndex;
+
+    /** Item color (used if draw mode is clear with color) */
+    TRgb iColor;    
+    
+    /** Item draw mode */
+    TInt iClearMode;
+    
+    /** Reserved for future use */
+    TInt iSpare1;
+    TInt iSpare2;
+    TInt iSpare3;
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfdropshadow.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,150 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Drop shadow parameter handler
+*
+*/
+
+
+
+#ifndef C_ALFDROPSHADOW_H
+#define C_ALFDROPSHADOW_H
+
+#include <gdi.h>
+#include <alf/alftimedvalue.h>
+#include <alf/alfmetric.h>
+
+class TAknsItemID;
+class CAlfGenComponent;
+
+/**
+ *  Drop shadow parameter handler
+ *
+ *  This interface can be fetched from the visual
+ *  @see CAlfVisual::EnableDropShadowL
+ *  @see CAlfVisual::DropShadowHandler
+ *  
+ *  @code
+ *   // get the pointer
+ *   visual->EnableDropShadowL();
+ *   CAlfDropShadow* dropShadow = visual->DropShadowHandler();
+ *
+ *   // use it
+ *   dropShadow->SetColor( KRgbRed );
+ *   dropShadow->SetOffset( TAlfTimedPoint( 10, 10 ) );
+ *  @endcode
+ *
+ *  Disabling the drop shadow from the visual, deletes the instance and therefore loses
+ *  all set paramteres. If you want to just hide the drops shadow temporally, you can 
+ *   a) set the opacity into 0 or
+ *   b) set the scale into 0
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v5.0.1
+ */
+NONSHARABLE_CLASS( CAlfDropShadow ) : public CBase
+    {
+public: // Exported functions
+     
+    /**
+     * Sets the shadow offset in polar coordinates. This will be converted into xy
+     * coordinates
+     *
+     * @param aAngle Angle of the shadow. 0 degrees is on the right hand side and 90 in directly above.
+     * @param aDistance Distance of the shadow in unit defined by the user component. 
+     * @param aTransitionTime Time reach the target.
+     */ 
+    IMPORT_C void SetOffset( TReal32 aAngle, TAlfMetric aDistance, TInt aTransitionTime = 0 ) __SOFTFP;
+    
+    /**
+     * Sets the shadow offset in cartesian (XY) coordinates.
+     *
+     * @param aOffset Position offset.
+     * @param aOffsetUnit Used unit, see TAlfUnit from alfmetric.h
+     *                    KErrNotFound uses previous/defaut base unit.
+     */ 
+    IMPORT_C void SetOffset( const TAlfTimedPoint& aOffset, TInt aOffsetUnit = KErrNotFound );
+        
+    /**
+     * Sets the color of the shadow.
+     *
+     * @param aColor Text color.
+     * @param aTransitionTime Time reach the target. (not supported )
+     */
+    IMPORT_C void SetColor(const TRgb& aColor, TInt aTransitionTime = 0 );
+
+    /**
+     * Sets the color of the shadow via skin id.
+     *
+     * @param aID      Skin ID of the color group to use
+     * @param aIndex   Index within the color group
+     * @param aTransitionTime Time reach the target. (not supported )
+     */
+    IMPORT_C void SetColor(const TAknsItemID& aID,const TInt aIndex, TInt aTransitionTime = 0 );
+     
+    /**
+     * Sets the shadow opacity. The visual's opactity will be multiplied with this value.
+     *
+     * @param aOpacity Opacity of the drop shadow.
+     */
+    IMPORT_C void SetOpacity( const TAlfTimedValue& aOpacity );
+    
+    /**
+     * Sets the blur filter radius. This is used to generate the shadow from the
+     * texture. Normally between 2-5 pixels (in texture coordinates).
+     *
+     * @param aRadius Blur filter radius.
+     */
+    IMPORT_C void SetRadius( const TAlfTimedValue& aRadius );
+    
+    /**
+     * Scale of the shadow - default 1.0.
+     *
+     * @param aScale Scale factor.
+     */ 
+    IMPORT_C void SetScale( const TAlfTimedValue& aScale );
+
+     
+public: // internal methods
+
+    /**
+     * @internal
+     */ 
+    static CAlfDropShadow* NewL(CAlfGenComponent& aComms);
+    
+    /**
+     * @internal
+     */ 
+    ~CAlfDropShadow();
+    
+private:
+
+    /**
+     * @internal
+     */ 
+    CAlfDropShadow();
+    
+    /**
+     * @internal
+     */ 
+    void ConstructL(CAlfGenComponent& aComms);
+   
+private:
+
+    struct TAlfDropShadowData;
+    TAlfDropShadowData* iData;
+
+    };
+
+
+#endif // C_ALFDROPSHADOW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfdropshadowbrush.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,152 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Drop shadow brush
+*
+*/
+
+
+
+#ifndef C_ALFDROPSHADOWBRUSH_H
+#define C_ALFDROPSHADOWBRUSH_H
+
+#include <alf/alfbrush.h>
+
+class CAlfEnv;
+struct TAlfMetric; 
+class TRgb;
+
+/**
+ *  Drop shadow brush.
+ *  Drop shadow brush draws a shadow to a configurable depth. 
+ *  Usage:
+ *  @code
+ *   // Creates a drop shadow brush and adds it to a visual.
+ *   CAlfDropShadowBrush* dropShadowBrush = CAlfDropShadowBrush::NewL( *iEnv, TAlfMetric(5) );
+ *   visualWithBorders->EnableBrushesL();
+ *   visualWithBorders->Brushes()->AppendL( dropShadowBrush, EAlfHasOwnership )
+ *   //Cleanup
+ *   dropShadowBrush = 0; // ownership transferred to the brush array
+ *  @endcode 
+ *  @lib alfclient.dll
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfDropShadowBrush ): public CAlfBrush
+    {
+
+public:
+
+    /**
+     * Constructor.
+     * @param aEnv Environment
+     * @param aDepth Shadow depth in metric units.
+     */
+    IMPORT_C static CAlfDropShadowBrush* NewL(
+        CAlfEnv& aEnv,
+        const TAlfMetric& aDepth );
+
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     * @param aEnv Environment
+     * @param aDepth Shadow depth in metric units.
+     */
+    IMPORT_C static CAlfDropShadowBrush* NewLC(
+        CAlfEnv& aEnv,
+        const TAlfMetric& aDepth );
+
+    /**
+     * Constructor.
+     * @deprecated
+     * @param aEnv Environment
+     * @param aDepth Shadow depth in pixels.
+     */
+    IMPORT_C static CAlfDropShadowBrush* NewL(
+        CAlfEnv& aEnv,
+        TInt aDepth );
+
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     * @deprecated
+     * @param aEnv Environment
+     * @param aDepth Shadow depth in pixels.
+     */
+    IMPORT_C static CAlfDropShadowBrush* NewLC(
+        CAlfEnv& aEnv,
+        TInt aDepth );
+    
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfDropShadowBrush();
+    
+    /**
+     * Gets minimum width of soft edges.
+     * @return Shadow minumum width magnitude in current metric units.
+     */
+    IMPORT_C const TAlfTimedValue& Softness() const;
+
+    /**
+     * Sets minimum width of soft edges.
+     * @param aSoftness Shadow minumum width magnitude in current metric units.
+     */
+    IMPORT_C void SetSoftness( const TAlfTimedValue& aSoftness );
+
+    /**
+     * Sets minimum width of soft edges.
+     * @param aDepth Shadow depth in metric units.
+     */
+    IMPORT_C void SetSoftness(const TAlfMetric& aSoftness);
+
+    /**
+     * Gets shadow depth.
+     * @return Shadow depth in current metric units.
+     */
+    IMPORT_C const TAlfTimedValue& Depth() const;
+    
+    /**
+     * Sets shadow depth.
+     * @param aDepth Shadow depth magnitude in current metric units.
+     */
+    IMPORT_C void SetDepth( const TAlfTimedValue& aDepth );
+
+    /**
+     * Sets shadow depth.
+     * @param aDepth Shadow depth in metric units.
+     */
+    IMPORT_C void SetDepth(const TAlfMetric& aDepth);
+
+    /**
+     * Sets shadow color.
+     * @param aColor Shadow color.
+     */
+    IMPORT_C void SetColor(const TRgb& aColor);
+
+private:
+
+
+    CAlfDropShadowBrush();
+
+    void ConstructL( CAlfEnv& aEnv, TInt aDepth );
+
+    void ConstructL( CAlfEnv& aEnv, const TAlfMetric&  aDepth );
+
+private:
+
+    struct TDropShadowPrivateData;
+    TDropShadowPrivateData* iDropShadowData;
+
+    };
+
+
+
+#endif // C_ALFDROPSHADOWBRUSH_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfenv.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,873 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Environment class.
+*
+*/
+
+
+
+#ifndef C_ALFENV_H
+#define C_ALFENV_H
+
+#include <e32base.h>
+#include <aknappui.h>
+#include <AknWsEventObserver.h>
+#include <alf/alfcommand.h>
+#include <alf/alftexturemanager.h>
+#include <alf/alfversion.h>
+
+class RAlfClient;
+class CAlfDisplay;
+class CAlfDisplayCoeControl;
+class CAlfControlGroup;
+class CAlfControl;
+class TAlfEvent;
+class CAlfTextureManager;
+class CAlfTextStyleManager;
+class RFTokenClient;
+class CAlfLayoutMetricsUtility;
+class CAlfBatchBuffer;
+class MAlfEnvObject;
+
+namespace Alf
+    {
+    class IAlfWidgetFactory;            
+    class IAlfWidget;
+    }
+
+    
+using namespace Alf; 
+
+const TInt KAlfOrpheanPtrEventReceived(0x2000B4D0);
+
+
+/** Device screensize or ui style has changed */
+const TInt KAlfActionIdDeviceLayoutChanged(KEikDynamicLayoutVariantSwitch);
+
+/** Ui skin graphics has been changed */
+const TInt KAlfActionIdSkinChanged(KAknsMessageSkinChange);
+
+/** Application is now in the focused app */
+const TInt KAlfActionIdFocusGained(0x200110DB); 
+
+/** Application is no more the focused app */
+const TInt KAlfActionIdFocusLost(0x200110DC);
+
+/** Application is now brought to foreground */
+const TInt KAlfActionIdForegroundGained(0x200110DD);
+
+/** Application is no more in foreground */
+const TInt KAlfActionIdForegroundLost(0x200110DE);
+
+/** Device input language has been changed */
+const TInt KAlfActionIdInputLanguageChanged(0x200110DF);
+
+/** Application has been requested to exit (e.g. from a task manager or OOM watcher) */
+const TInt KAlfActionIdExitRequested(0x200110E0);
+
+
+/**
+ * TAlfRefreshMode modes can be used to define when the screen redraws
+ * should be performed.
+ * @see CAlfEnv::SetRefreshMode()
+ */
+enum TAlfRefreshMode
+    {
+    /** Refresh occurs only when requested by calling CAlfEnv::RefreshCallBack(). */
+    EAlfRefreshModeManual,
+
+    /** Refresh is done automatically when necessary. */
+    EAlfRefreshModeAutomatic, // = default
+
+    /** Refresh is done all the time, even if nothing has changed. Dirty regions
+        are not used for determining what has changed. Instead, displays are
+        always fully redrawn. */
+    EAlfRefreshModeForced
+    };
+    
+/**
+ * @enum TAlfRenderer
+ * 
+ * Enumerates renderers. The renderer depends on the used hardware.
+ * 
+ * Different renderers may not support all features available.
+ * For example the EAlfRendererBitgdi does not support any 3D-related
+ * methods, whereas EAlfRendererGles11 supports most of them.
+ * 
+ */
+enum TAlfRenderer
+    {
+    /** Symbian BITGDI renderer. */
+    EAlfRendererBitgdi      = 1,
+
+    /** OpenVG 1.0 renderer (Not implemented). */
+    EAlfRendererVg10        = 2,
+
+    /** OpenGL ES 1.0 renderer. */
+    EAlfRendererGles10      = 3,
+
+    /** OpenGL ES 1.1 renderer. */
+    EAlfRendererGles11      = 4,
+
+    /** OpenGL ES 1.1 DSA renderer. Implemented, but please use EAlfRendererGles11. */
+    EAlfRendererGles11DSA   = 5,
+
+    /** OpenGL ES 2.0 renderer (Not implemented). */
+    EAlfRendererGles20      = 6
+    };
+
+    
+
+class MAlfActionObserver
+    {
+public:
+
+    /**
+     * Called by the server when an action command is executed.
+     *
+     * @param aActionCommand  The command that is being executed.
+     */
+    virtual void HandleActionL(const TAlfActionCommand& aActionCommand) = 0;
+
+    };
+
+/**
+ *  This is the UI Accelerator Toolkit environment object. It needs to be created before any other toolkit
+ *  functionality can be used.
+ *
+ *  Through environment it is possible to create display objects that are required to display graphics.
+ *  It is also possible to create control groups that are required to include controls in.
+ *
+ *  Usually an application creates an environment object, after which it creates a single display object
+ *  to handle the drawing surface of the application. After this at least one control group is required
+ *  that can be used to encapsulate application controls. Controls themselves need to be derived from
+ *  CAlfControl - base class.
+ *
+ *  @code
+ *  // Create CAlfEnv
+ *  iEnv = CAlfEnv::NewL();
+ *
+ *  // Create a display
+ *  CAlfDisplay& display = iEnv->NewDisplayL(aRect, CAlfEnv::ENewDisplayAsCoeControl);
+ *	
+ *  // Create a control group
+ *  CAlfControlGroup& group = iEnv->NewControlGroupL(KIdMainGroup);
+ *  CMyControl* control = CMyControl::NewL(aEnv);
+ *  group.AppendL(control);
+ *
+ *  display.Roster().ShowL(group);
+ *  @endcode 
+ *  
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfEnv ): public CBase, public MAknWsEventObserver, 
+    public MAlfActionObserver, public MAlfTextureManagerStateChangedObserver, public MAlfTextureLoadingCompletedObserver, public MCoeMessageMonitorObserver
+    {
+
+public:
+
+    /**
+     * Flags for creating new displays.
+     * @see NewDisplayL()
+     */
+    enum TNewDisplayFlags
+        {
+        /** Newly created display will fill the whole device screen. */
+        ENewDisplayFullScreen = 0x1,        
+        ENewDisplayOverlaid = 0x2,
+        /**
+         * Newly created display will be created as a CCoeControl - derived object.
+         * This will ensure that key events are automatically delivered to the
+         * correct CAlfControl - derived objects within the roster of the newly
+         * created display.
+         */        
+        ENewDisplayAsCoeControl = 0x4
+        };
+
+
+    /**
+     * Constructor
+     * @param aVersion Default parameters should always be used as parameters for compatibility reasons.
+     */
+    IMPORT_C static CAlfEnv* NewL(TVersion aVersion = TVersion(ALF_VERSION_MAJOR, ALF_VERSION_MINOR, ALF_VERSION_BUILD));
+
+    /**
+     * Constructor
+     * @param aVersion Default parameters should always be used  as parameters for compatibility reasons.
+     */
+    IMPORT_C static CAlfEnv* NewLC(TVersion aVersion = TVersion(ALF_VERSION_MAJOR, ALF_VERSION_MINOR, ALF_VERSION_BUILD));
+
+    /**
+     * Destructor
+     */
+    IMPORT_C virtual ~CAlfEnv();
+
+    /**
+     * Returns client
+     *
+     * @return Client to Alfred server
+     */
+    IMPORT_C RAlfClient& Client();
+    
+    /**
+     * Creates a new display. You have to use ENewDisplayAsCoeControl - flag if you want to receive key events
+     * automatically to the CAlfControl - derived objects in your application. If display is created without
+     * ENewDisplayAsCoeControl - flag the key events have to be passed to the system manually using 
+     * the HandleKeyEventL() - method.
+     *
+     * @param aRect   Size of the display.
+     * @param aFlags  Flags for the display as a combination of flags from CAlfEnv::TNewDisplayFlags enumerator.
+     * @param aDisplayType Type of the display, flags from CAlfDisplay::TDisplayType enumerator.
+     * @return        Newly created CAlfDisplay object.
+     */
+    IMPORT_C CAlfDisplay& NewDisplayL( const TRect& aRect,
+                                       TInt aFlags = 0, 
+                                       TInt aDisplayType = 0  );
+                                      
+    /**
+     * Creates a new display. You have to use ENewDisplayAsCoeControl - flag if you want to receive key events
+     * automatically to the CAlfControl - derived objects in your application. If display is created without
+     * ENewDisplayAsCoeControl - flag the key events have to be passed to the system manually using 
+     * the HandleKeyEventL() - method.
+     *
+     * @param aRect   Size of the display.
+     * @param aFlags  Flags for the display as a combination of flags from CAlfEnv::TNewDisplayFlags enumerator.
+     * @param aRosterOwningDisplay Not used. Display that owns shared roster. 
+     * @param aDisplayType Type of the display, flags from CAlfDisplay::TDisplayType enumerator.
+     * @param aBackBufferUid Screen back buffer uid
+     * @return        Newly created CAlfDisplay object.
+     */
+	IMPORT_C CAlfDisplay& NewDisplayL( const TRect& aRect, 
+									   TInt aFlags, 
+									   CAlfDisplay* aRosterOwningDisplay, 
+                                       TInt aDisplayType, 
+                                       TUid aBackBufferUid );
+                                      
+    /**
+     * Removes a display from the environment.
+     *
+     * @param aDisplay  The display to remove.
+     */
+    void RemoveDisplay( CAlfDisplay& aDisplay );
+    
+    /**
+     * Constructs a new empty control group.
+     * Leaves with KErrAlreadyExists if the group with the same ID is already
+     * created.
+     *
+     * @param aId (Resource) Identifier of the new group.
+     * @return  Reference to the new group.
+     */                                  
+    IMPORT_C CAlfControlGroup& NewControlGroupL( TInt aId );
+    
+    /**
+     * Deletes a previously loaded control group. The controls inside the
+     * groups will also be destroyed. Note that this will also destroy the
+     * visuals of the controls, because they are owned by the controls.
+     *
+     * @param aId  Identifier of the group to be deleted.
+     *
+     * @return  <code>KErrNone</code>, if the deletion is successful.
+     *          <code>KErrNotFound</code>, if there are no control groups
+     *          with the specified identifier.
+     */
+    IMPORT_C TInt DeleteControlGroup(TInt aId);
+    
+    /**
+     * Returns an existing control group based on its identifier.
+     * @note Will panic with TAlfPanic::EInternal if the specified
+     * control group is not found.
+     *
+     * @param aResourceId Control group ID.
+     * @return Contorl group
+     */
+    IMPORT_C CAlfControlGroup& ControlGroup(TInt aResourceId);
+    
+    /**
+     * Returns an existing control group based on its identifier if
+     * it is found. Returns NULL if the group cannot be found.
+     *
+     * @param aResourceId Control group ID.
+     * @return Contorl group. Ownership not transferred. NULL if not found.
+     */ 
+    IMPORT_C CAlfControlGroup* FindControlGroup(TInt aResourceId) const;
+    
+    /**
+     * Finds a control from the control groups of this
+     * environment.
+     *
+     * @param aId The id of the control.
+     * @param aUserId searches user given id if set true, otherwise uses system generated identifier 
+     *
+     * @see CAlfControl::SetId()
+     * @see CAlfControl::Id()
+     * @see CAlfControl::Identifier()
+     * @return The control instance, or NULL if no such control exists.
+     */
+    IMPORT_C CAlfControl* FindControl(TInt aId, TBool aUserId = ETrue) const;
+    
+    /**
+     * Determines the number of displays currently created with NewDisplayL().
+     *
+     * @return  Display count.
+     */
+    IMPORT_C TInt DisplayCount() const;
+    
+    /**
+     * Sets the refresh mode.
+     *
+     * @param aMode  New refresh mode.
+     *
+     * @see TAlfRefreshMode
+     */
+    IMPORT_C void SetRefreshMode(TAlfRefreshMode aMode);
+
+    /**
+     * Gets the refresh mode.
+     *
+     * @return  Current refresh mode.
+     *
+     * @see TAlfRefreshMode
+     */
+    IMPORT_C TAlfRefreshMode RefreshMode();
+    
+    /**
+     * Sets the maximum allowed frame rate. Specify 0.0 to use the default limit.
+     *
+     * @param aFrameRate  New maximum frame rate in frames per second.
+     */
+    IMPORT_C void SetMaxFrameRate(TReal32 aFrameRate) __SOFTFP;
+    
+    /**
+     * Continues normal display refreshing. If display refreshing is already
+     * being done, calling this has no effect. This is called automatically
+     * from inside the toolkit when something is done that may lead to a
+     * visible change on a display. The application may also call this if it
+     * has previously paused refresh with PauseRefresh().
+     */
+    IMPORT_C void ContinueRefresh();
+
+    /**
+     * Pauses display refreshing temporarily. This is called when it is clear
+     * that any displays will not be updated soon. The application may call
+     * this at times when it needs more processing time for other tasks.
+     */
+    IMPORT_C void PauseRefresh();
+    
+    /**
+     * Refresh callback, that is called by a refresh timer. Called periodically
+     * when there might be something to update on the display. Has the
+     * responsibility to update time for all ALF environments.
+     *
+     * @param aInstance  A CAlfEnv instance.
+     * @see StartRefresh() to modify how often updates are being made.
+     * @see StopRefresh() to stop updates.
+     */
+    IMPORT_C static TInt RefreshCallBack(TAny* aInstance);
+    
+    /**
+     * Returns the primary display, that is the display
+     * that was created first.
+     *
+     * @return Display
+     */
+    IMPORT_C CAlfDisplay& PrimaryDisplay() const;
+
+    /**
+     * Returns the default texture manager.
+     * @return Default texture manager of this environment.
+     */
+    IMPORT_C CAlfTextureManager& TextureManager() const;
+
+    /**
+     * Returns the text style manager.
+     * @return Default text style manager of this environment.
+     */
+    IMPORT_C CAlfTextStyleManager& TextStyleManager() const;    
+    
+    /**
+     * Creates a shared texture manager. If texture manager with given uid already 
+     * exists, a pointer to it is returned and reference count is increased. 
+     *
+     * Shared texturemanager can be used to create/load textures that are 
+     * shared between components/applications to preserve memory. 
+     *
+     * @param aUid Unique identifier for the shared texture manager
+     * @return Shared texture manager
+     *   
+     * Example of shared texturemanager usage:
+     *
+     * CScrollBar::ConstructL()
+     *     {
+     *     // Create shared texturemanager instead of default texture manager to save RAM
+     *     // because same texture is used in multiple components in different apps.
+     *     CAlfTextureManager* sharedManager = 
+     *         iEnv->CreateSharedTextureManagerL(KScrollBarTextureManagerUid);
+     *     
+     *     // Create texture, if it already exists inside this application or in some
+     *     // other application, then bitmap from bitmapprovider and texture flags are ignored
+     *     // and already existing texture is returned.
+     *     iBackgroundTexture = sharedManager->CreateTexture(KScrollBarBackgroudId, 
+     *         iBitmapProvider,
+     *         EAlfTextureFlagDefault);
+     *     
+     *     // Create another texture...
+     *     iHandleTexture = sharedManager->CreateTexture(KScrollBarHandleId, 
+     *         iBitmapProvider,
+     *         EAlfTextureFlagDefault);
+     *     }
+     *
+     * CScrollBar::~CScrollBar()
+     *     {
+     *     // We created shared texture manager so we should delete it here.
+     *     // If this is last instance of this shared texture manager in the device, 
+     *     // all of its textures get unloaded.
+     *     iEnv->DeleteSharedTextureManagerL(KScrollBarTextureManagerUid);
+     *     }
+     */
+    IMPORT_C CAlfTextureManager* CreateSharedTextureManagerL(TUid aUid);
+
+    /**
+     * This method deletes shared texture manager and all its textures get released if there
+     * are no other references to the texture manager. Otherwise only the reference count
+     * is decreased.
+     * 
+     * @param aUid Unique identifier of the shared texture manager
+     *
+     */
+    IMPORT_C void DeleteSharedTextureManager(TUid aUid);
+
+    /**
+     * Returns pointer to a shared texture manager, NULL if it does not exist.
+     *
+     * @param aUid Unique identifier of the shared texture manager
+     * @return Shared texture manager
+     *   
+     */
+    IMPORT_C CAlfTextureManager* SharedTextureManager(TUid aUid) const;
+
+     /**
+     * Adds action observer
+     *
+     * @param aObserver observer to be added to array
+     * @leave any system wide error code
+     */
+    IMPORT_C void AddActionObserverL(MAlfActionObserver* aObserver);
+
+     /**
+     * Removes action observer, this must be done at latest when observer is being deleted
+     *
+     * @param aObserver observer to be added to array
+     */
+    IMPORT_C void RemoveActionObserver(MAlfActionObserver* aObserver);
+    
+    
+    /**
+     * Schedule a command.
+     *
+     * @param aCommand  Command to send.
+     * @param aDelayMilliSeconds  Time in ms to wait before executing the command. If
+     * set to zero, the command is executed immediately. Note that the point of
+     * execution may not be exactly this amount of milliseconds.
+     *
+     * @return  System-wide error code. If successful, returns <code>KErrNone</code>.
+     */
+    IMPORT_C TInt Send(const TAlfCommand& aCommand, TInt aDelayMilliSeconds = 0);
+    
+    /**
+     * Cancel commands where object is aObject.
+     *
+     * @param aObject Command object.
+     */
+    IMPORT_C void CancelCommands( TAny* aObject );
+    
+    /**
+     * Cancel commands where object is aObject and operation is aCommandOperation.
+     *
+     * @param aObject Command object.
+     * @param aCommandOperation Command operation.
+     */
+    IMPORT_C void CancelCommands( TAny* aObject, TAlfOp aCommandOperation);
+
+    /**
+     * Cancel commands where object is aObject and type is aCommandType.
+     *
+     * @param aObject Command object.
+     * @param aCommandType Command type.
+     */
+    IMPORT_C void CancelCommands( TAny* aObject, TAlfCommandType aCommandType );
+ 
+    /**
+     * Cancel custom commands where object is aObject.
+     *
+     * @param aObject Command object.
+     */   
+    IMPORT_C void CancelCustomCommands( MAlfEventHandler* aObject ); 
+    
+    /**
+     * Cancel commands where object is aObject and custom parater is aCustomParam 
+     *
+     * @param aObject Command object.
+     * @param aCustomParam Custom paramerer.
+     */
+    IMPORT_C void CancelCustomCommands( MAlfEventHandler* aObject, TInt aCustomParam );         
+    
+    /**
+     * Time until next command where object is aObject.
+     *
+     * @param aObject Command object.
+     * @return Time left in milliseconds to the first found command, which 
+     *         matched the criteria. KErrNotFound if the none found. The return
+     *         value is set to 0 if the command timer has expired and waits
+     *         execution from the active scheduler.
+     */
+    IMPORT_C TInt MilliSecondsUntilCommand( TAny* aObject );
+    
+    /**
+     * Time until next command where object is aObject and operation is aCommandOperation 
+     *
+     * @param aObject Command object.
+     * @param aCommandOperation Custom paramerer.
+     * @return Time left in milliseconds to the first found command, which 
+     *         matched the criteria. KErrNotFound if the none found. The return
+     *         value is set to 0 if the command timer has expired and waits
+     *         execution from the active scheduler.
+     */
+    IMPORT_C TInt MilliSecondsUntilCommand( TAny* aObject, TAlfOp aCommandOperation);
+
+    /**
+     * Time until next commands where object is aObject and type is aCommandType.
+     *
+     * @param aObject Command object.
+     * @param aCommandType Command type.
+     * @return Time left in milliseconds to the first found command, which 
+     *         matched the criteria. KErrNotFound if the none found. The return
+     *         value is set to 0 if the command timer has expired and waits
+     *         execution from the active scheduler.
+     */
+    IMPORT_C TInt MilliSecondsUntilCommand( TAny* aObject, TAlfCommandType aCommandType );
+        
+    /**
+     * Time until next custom commands where object is aObject.
+     *
+     * @param aObject Command object.
+     * @return Time left in milliseconds to the first found command, which 
+     *         matched the criteria. KErrNotFound if the none found. The return
+     *         value is set to 0 if the command timer has expired and waits
+     *         execution from the active scheduler.
+     */     
+    IMPORT_C TInt MilliSecondsUntilCustomCommand( MAlfEventHandler* aObject ); 
+    
+    /**
+     * Time until next commands where object is aObject and custom parater is aCustomParam 
+     *
+     * @param aObject Command object.
+     * @param aCustomParam Custom paramerer.
+     * @return Time left in milliseconds to the first found command, which 
+     *         matched the criteria. KErrNotFound if the none found. The return
+     *         value is set to 0 if the command timer has expired and waits
+     *         execution from the active scheduler.
+     */
+    IMPORT_C TInt MilliSecondsUntilCustomCommand( MAlfEventHandler* aObject, TInt aCustomParam ); 
+                                  
+    /**
+     * Handles a key event received from CONE. This can be called directly by application
+     * to pass in external key events. You will have to call this from an application to pass
+     * key events to CAlfControl - derived objects unless you have created the CAlfDisplay 
+     * class with the ENewDisplayAsCoeControl flag.
+     *
+     * @param aKeyEvent  Received key event to handle.
+     * @param aType      Type of event.
+     * @param aAssocDisplay  Associated CAlfDisplay, if there is one.
+     *                   If specified, the event is handled by this display's
+     *                   roster only. If <code>NULL</code>, event is offered
+     *                   to all displays.
+     */
+    IMPORT_C TKeyResponse HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType,
+                                   CAlfDisplay* aAssocDisplay = 0);
+
+
+    /**
+     * Handles a pointer event received from CONE. This can be called directly by application
+     * to pass in external pointer events. You will have to call this from an application to pass
+     * pointer events to CAlfControl - derived objects if you have created the CAlfDisplay 
+     * class as offscreen buffer that has no window.
+     *
+     * @param aPointerEvent  Received pointer event to handle. Note that iParentPosition of the 
+     * pointerevent should always be in the same coordinate space as where the displays rect 
+     * was defined when it was created.
+     * @param aAssocDisplay  Associated CAlfDisplay.
+     */
+    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent, 
+                                   CAlfDisplay& aAssocDisplay);
+                                  
+
+    /**
+     * Determines which renderer is currently in use. Returns the real
+     * explicit identifier of the renderer.
+     *
+     * @return  TAlfRenderer enum.
+     */
+    IMPORT_C TAlfRenderer Renderer() const;
+
+
+    /**
+     * Sets the interval before an idle notification is sent. Idling
+     * begins when no input has been received after this delay.
+     *
+     * Also note that scheduled events may keep display refresh running even
+     * when there's no input.
+     *
+     * @param aSeconds  Threshold in milliseconds.
+     */
+    IMPORT_C void SetIdleThreshold(TInt aMilliSeconds);
+
+	/**
+     * Releases as many resources as possible. Among the released resources 
+     * may be all objects in the toolkit's ownership, for example texture 
+     * images and drawing surfaces. This should be called when the Hitchcock 
+     * user interface is not needed for a while, for example when the application 
+     * goes to the background. 
+     *
+     * At the moment the Environment releases all textures. Shared textures
+     * are also tried to release if so instructed in the params.
+     * 
+     * The resources need to be restored with a call to RestoreL() before
+     * the user interface is used again.
+     *
+     * The AppUI can call this method to release resources. The AppUI can
+     * overload HandleWsEventL() and react to KAknFullOrPartialForegroundLost
+     * window server event by calling this method.
+     *
+     * @param aReleaseSharedTextures If ETrue also shared textures are released
+     *  if there are no other apps using them.
+     * @see RestoreL()
+     */
+    IMPORT_C void Release(TBool aReleaseSharedTextures=EFalse);
+    
+    /**
+     * Restores all resources that were released with a call to Release().
+     * After this the Hitchcock user interface should be in the same state
+     * in terms of resources as it was prior to the Release() call.
+     *     
+     * The AppUI can call this method to Restore resources. The AppUI can
+     * overload HandleWsEventL() and react to KAknFullOrPartialForegroundGained
+     * window server event by calling this method.
+     *
+     * @see Release()
+     */
+    IMPORT_C void RestoreL();    
+
+    /**
+     * Notifies everyone of a change in the environment's skin. Note that this
+     * method gets called automatically when system skin is changed.
+     * 
+     * Method is exported so that applications can call this in some special
+     * situations when skinned graphics needs to be refreshed.
+     */
+    IMPORT_C void NotifySkinChangedL();    
+
+    /**
+     * Notifies everyone of a change in the environment's layout. Exported so that 
+     * applications can call this from their HandleResourceChange() methods.
+     */
+    IMPORT_C void NotifyLayoutChangedL();    
+
+    /**
+    * defines if Alfred draws on top of (or below) application windowgroup 
+    */
+    IMPORT_C void SetFullScreenDrawing(TBool aEnable);
+
+    IMPORT_C RFTokenClient* TokenClient();
+
+    /**
+     * @deprecated <b>Always returns an invalid reference!</b>
+     * 
+     * Widget factory for widget and their part creation 
+     */
+    IMPORT_C IAlfWidgetFactory& WidgetFactory()const;
+    
+    /**
+     * @deprecated <b>Doesn't do anything anymore!</b>
+     * 
+     * Append widgets into environment
+     */
+    IMPORT_C void AppendWidgetL(IAlfWidget* aAlfWidget);
+
+    /**
+     * @deprecated <b>Doesn't do anything anymore!</b>
+     * 
+     * Destroy a widget from the environment
+     */
+    IMPORT_C TInt DestroyWidget(IAlfWidget* aAlfWidget);
+    
+    /**
+     * @deprecated <b>Always returns an invalid reference!</b>
+     * 
+     * Find named widgets owned by environment 
+     */
+    IMPORT_C IAlfWidget* FindWidget(const char* aWidgetName)const;
+
+    void BroadcastEventL(const TAlfEvent& aEvent);
+    
+    TInt ReportAction(const TAlfActionCommand& aCommand);
+
+    // From MAlfTextureLoadingCompletedObserver
+    void TextureLoadingCompleted(CAlfTexture& aTexture,
+                                         TInt aTextureId,
+                                         TInt aErrorCode);
+
+    // From MAlfTextureManagerStateChangedObserver
+    void TextureManagerStateChanged(const CAlfTextureManager& aManager);
+
+    //From MCoeMessageMonitorObserver
+	void MonitorWsMessage(const TWsEvent& aEvent);
+
+    /**
+     * Gets pointer into layout metrics utility.
+     */
+    IMPORT_C CAlfLayoutMetricsUtility* LayoutMetricsUtility();
+    
+    /**
+     * Gets pointer to application enviroment singleton
+     * @return singleton or NULL
+     */
+    IMPORT_C static CAlfEnv* Static();
+    
+    /**
+     * !Direct access to Symbian pointer event data. This information is usually relevant only when
+     * associated action command KAlfOrpheanPtrEventReceived is sent by environment 
+     * @return null or last received pointer event
+     */
+     IMPORT_C TPointerEvent* LastReceivedPtrEvent();
+    
+    /**
+     * Returns version of the Alf in runtime environment.
+     * @return Version of the runtime Alf
+     */
+     IMPORT_C TVersion Version() const;
+
+     /**
+     * Returns version of the Alf that application was compiled against
+     * @return Version of the compiletime Alf
+     */
+    TVersion ApiVersion() const;   
+    
+    /**
+     * Returns the batch buffer handler.
+     *
+     * @return Batch buffer handler
+     */
+    IMPORT_C CAlfBatchBuffer& BatchBufferHandler() const;
+   
+   
+    /**
+     * Handles texture info changed event.
+     * @param aEventData descriptor containing event data.
+     */
+    void HandleTextureInfo( const TDesC8& aEventData );
+    
+    TBool SkinChangePending() const;
+
+    void SetSkinChangePending(TBool aPending);
+
+    TBool LayoutChangePending() const;
+
+    void SetLayoutChangePending(TBool aPending);
+
+    void ReportWsEventAsActionCommand(TInt aActionCommandId);
+    
+    /**
+    * Access AlfEnv extensions via their UID
+    *
+    * AlfEnv holds a number of extensions that have been set there
+    * by users of AlfEnv.  They are owned by AlfEnv and are 
+    * deleted by it when the environment is destroyed. The objects
+    * must derive from MAlfEnvObject.
+    * 
+    * The objects are added to the environment with a Uid. This Uid is
+    * used here to access them.
+    * 
+    * @see AddExtension
+    *
+    * @param aUid   Uid corresponding to the object being requested
+    * @return pointer to object requested, or NULL
+    */
+    IMPORT_C MAlfEnvObject* Extension( TInt aUid) const;
+
+    /**
+    * Add an extension object to AlfEnv
+    *
+    * Extension objects, derived from MAlfEnvObject, can be given
+    * to AlfEnv, so that other AlfEnv clients can access the
+    * singleton objects.
+    * 
+    * The objects are added with an accompanying Uid. This Uid is used
+    * to access the object.
+    *
+    * Objects added to AlfEnv must have their Release() method implemented
+    * in DLLs that remain in memory until after AlfEnv is deleted.
+    *
+    * @see Extension
+    *
+    * @param aUid   Uid corresponding to the object being requested
+    * @param aNewExtension   Pointer to the new object given to the system
+    * @return an error code. KErrNone if there has been no error
+    */
+    IMPORT_C TInt AddExtension( TInt aUid, MAlfEnvObject* aNewExtension);
+
+    /**
+     * Finds the index of a display in the environment.
+     *
+     * @param aDisplay  Display.
+     * @return Index. KErrNotFound if not found.
+     */
+    IMPORT_C TInt FindDisplayIndex(const CAlfDisplay& aDisplay) const;
+    
+    /**
+     * Returns one of the displays owned by the environment.
+     * Panics with error code USER 130, if aIndex is negative, or is greater
+     * than the number of displays in the array.
+     *
+     * @param aIndex  Index number of the display to return.
+     *
+     * @return  Display.
+     */
+    IMPORT_C CAlfDisplay& Display( TInt aIndex) const;
+    
+
+private:
+
+    // Constructor
+    CAlfEnv();
+    
+    // ConstructL
+    void ConstructL(TVersion aVersion);
+    
+    // from MAknWsEventObserver
+    void HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination);
+
+    // from MAlfActionObserver
+    void HandleActionL(const TAlfActionCommand& aActionCommand);    
+     
+private:
+    
+    // Private data. Own.
+    struct TPrivateData;
+    TPrivateData* iData;
+
+    };
+
+#endif // C_ALFENV_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfenvobject.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 type for holding virtually releasable objects
+*
+*/
+
+
+
+#ifndef ALFENVOBJECT_H
+#define ALFENVOBJECT_H
+
+/**
+ * Base class for objects that required virtual release of heap objects
+ *  
+ *  @lib alfclient.lib
+ *  @since S60 v5.0.1
+ */
+class MAlfEnvObject
+    {
+public:
+    /**
+     * Method to release the owned object. 
+     * This method should be implemented in the derived classes to delete
+     * the heap object.
+     */
+    virtual void Release() = 0;
+    };
+
+#endif // ALFENVOBJECT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfevent.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,325 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Event class.
+*
+*/
+
+
+
+#ifndef T_ALFEVENT_H
+#define T_ALFEVENT_H
+
+#include <w32std.h>
+#include <alf/alfscrollerevent.h>
+
+class CAlfDisplay;
+class CAlfVisual;
+
+/**
+ *  Event class.
+ *  This class would typically be passed to a control.
+ *  One example of an event would be a keypress,
+ *  or a custom message arriving from another control.
+ *  You cannot derive from this class.
+ *  Usage:
+ *  A custom control, derived from Control, overwrides, OfferEventL()
+ *  @code
+ *  TBool LayoutControl::OfferEventL(const TAlfEvent& aEvent)
+ *  {
+ * 	TBool handled = EFalse;
+ *  if ( aEvent.IsKeyEvent() )
+ *       {
+ *        / Do something
+ *        handled = ETrue;         
+ *       }
+ *   else if ( aEvent.IsPointerEvent() )
+ *        {
+ *         switch ( aEvent.PointerEvent().iType )
+ *           {
+ *           case TPointerEvent::EButton1Down:
+ *              / Do something
+ *               break;
+ *           case TPointerEvent::EButton1Up:
+ *               / Do something
+ *               break;
+ *           case TPointerEvent::EDrag:
+ *              / Do something
+ *               break;
+ *           case TPointerEvent::EButtonRepeat:
+ *               / Do something
+ *               break;
+ *           default:
+ *              / Do something
+ *               break;
+ * 			 }
+ *          handled = ETrue;
+ *       }
+ *    }
+ *  @endcode
+ *  @see MAlfEventHandler::OfferEventL()
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( TAlfEvent )
+    {
+    
+public:
+
+    /** Event types. This is the most general type for the message.*/
+    enum TType
+        {
+        ETypeCustom, 		//!< a message passed from one control to another
+        ETypeKey,			//!< a message regarding a keypress
+        ETypePointer,		//!< a message regarding a touch screen interface
+        ETypeIdleBegin,	    //!< the toolkit has just entered the idle state
+        ETypeIdleEnd,		//!< the toolkit has just left the idle state
+        ETypeScroller,	    //!< a message sent from a scroller
+        
+        EAlfEventTypeLast = 1024
+        };
+        
+    /* Constructors. */
+   
+    /**
+     * Constructor.
+     */
+    TAlfEvent(CAlfDisplay& aDisplay, TType aType);
+    
+    /**
+     * Constructor for custom events (not bound to any display).
+     */
+    IMPORT_C TAlfEvent(TInt aCustomParam);
+
+    /**
+     * Constructor for custom events (not bound to any display).
+     */
+    IMPORT_C TAlfEvent(TInt aCustomParam, TInt aCustomEventData);
+   
+    /**
+     * Constructor for scroller event bound to a display.
+     */
+    IMPORT_C TAlfEvent(CAlfDisplay&, const TAlfScrollerEvent& aEvent );
+   
+    /**
+     * Constructor for key events.
+     *
+     * @param aDisplay Display where the event is received
+     * @param aKeyEvent Key event definition
+     * @param aType Event code
+     */
+    IMPORT_C TAlfEvent(CAlfDisplay& aDisplay, const TKeyEvent& aKeyEvent, TEventCode aType);
+
+    /**
+     * Constructor for pointer events.
+     *
+     * @param aDisplay Display where the event is received
+     * @param aPointerEvent Pointer event definition
+     *          iPosition Contains the coordinates relative to the hit visual
+     *          iParentPosition Contains the coordinates relative to the used display area.
+     */
+    IMPORT_C TAlfEvent(CAlfDisplay& aDisplay, const TPointerEvent& aPointerEvent );
+    
+    /**
+     * Determines whether the event is a pointer event.
+     *
+     * @todo needs more description
+     * @return ETrue if pointer event.
+     */
+    IMPORT_C TBool IsPointerEvent() const;
+    
+    /**
+     * Returns pointer event. Panics is not pointer event.
+     *
+     * On the stylus up and down events, the hit leaf visual can be fetched with
+     * Visual() function. If the function returns a visual, the iPosition member
+     * variable of the TPointerEvent states the event coordinates relative to that 
+     * visual area. If the visual is not found, the iPosition is the same as iParentPosition.
+     *
+     * The iParentPosition memeber variable of the TPointerEvent states the event
+     * coordinates relative to the used display visible area. See, that this is usually
+     * the main pane area and not the physical screen dimensions.
+     *
+     * The iParentPosition coornidates can be mapped to any visual's local coordinates by
+     * visual->DisplayToLocal( aEvent.PointerEvent().iParentPosition );
+     *
+     * If the visual is set, the following applies:
+     * aEvent.Visual()->LocalToDisplay( aEvent.PointerEvent().iPosition ) == aEvent.PointerEvent().iParentPosition
+     * aEvent.Visual()->DisplayToLocal( aEvent.PointerEvent().iParentPosition ) == aEvent.PointerEvent().iPosition
+     *
+     * @return Pointer event.
+     */
+    IMPORT_C const TPointerEvent& PointerEvent() const;
+
+    /**
+     * Returns the type of the event.
+     * @see TType
+     */     
+    IMPORT_C TType Type() const;
+    
+    /**
+     * Determines whether the event is a custom event.
+     */     
+    IMPORT_C TBool IsCustomEvent() const;
+
+    /**
+     * Returns whether the event is a scroller event.
+     *
+     * @return EFalse iff the event is not a scroller event
+     */     
+    IMPORT_C TBool TAlfEvent::IsScrollerEvent() const;
+
+    /**
+     * Access an ALF scroller event object. 
+     *
+     * Only can be called if IsScrollerEvent() is not EFalse
+     *
+     * @return a structure containing the scroller event
+     */
+    IMPORT_C TAlfScrollerEvent ScrollerEvent() const;
+    
+    /**
+     * Determines whether the event is a key event, for example, a key was pressed.
+     *
+     * @return ETrue is key event.
+     */ 
+    IMPORT_C TBool IsKeyEvent() const;
+    
+    /**
+     * Returns key event code. Panics if not key event.
+     *
+     * @return Key event code.
+     */
+    IMPORT_C const TEventCode& Code() const;
+    
+    /**
+     * Returns key event. Panics if not key event.
+     *
+     * @return Key event.
+     */
+    IMPORT_C const TKeyEvent& KeyEvent() const;
+    
+    /**
+     * Returns custom paramter. Panics if not custom event.
+     *
+     * @return Custom parameter.
+     */
+    IMPORT_C TInt CustomParameter() const;
+    
+    /**
+     * Returns additional custom event data. Panics if not a custom event.
+     * This can be either an identifier to find out the actual event data or
+     * it can contain the data directly.
+     *
+     * @return Custom event data.
+     */
+    IMPORT_C TInt CustomEventData() const;    
+    
+    /**
+     * Sets display
+     *
+     * @param aDisplay New display. Ownership not transferred.
+     */
+    void SetDisplay( CAlfDisplay* aDisplay );
+    
+    /**
+    * Returns the display that the event comes from, if any.
+    * NULL is returned if the event has not had a display set.  Custom events are
+    * likely not to have a display set. Key events may have a display set 
+    *
+    * @return The display the event is associated with
+    */
+    IMPORT_C CAlfDisplay* Display() const;
+    
+    /**
+     * Pointer is down.
+     * @return ETrue if this is a pointer event and the pointer has been pressed down.
+     */
+    IMPORT_C TBool PointerDown() const;
+
+    /**
+     * Pointer is up.
+     * @return ETrue if this is a pointer event and the pointer has been lifted up.
+     */
+    IMPORT_C TBool PointerUp() const;
+    
+    /**
+     * Pointer event is a long press.
+     * @return ETrue if this is a pointer event and the pointer has been pressed for long tap duration.
+     */
+    IMPORT_C TBool PointerLongTap() const;
+    
+    /**
+     * Sets visual associated with the event
+     *
+     * @param aVisual Associated visual.
+     */
+    IMPORT_C void SetVisual(CAlfVisual* aVisual);
+    
+    /**
+     * Returns visual associated with the event
+     *
+     * @return Associated visual. NULL if not set.
+     */
+    IMPORT_C CAlfVisual* Visual() const;
+
+private: // data
+
+    /** The display from where the event originated. */
+    CAlfDisplay* iDisplay;
+
+    /** Type of this event, if it is a Symbian S60 event code.
+    *
+    * For example: EEventKeyUp, EEventKeyDown
+    *
+    * @see Symbian event codes.
+    */    
+    TEventCode iCode;
+
+    /** The S60 struct that contains scancode, key event information, etc.
+    * @see Symbian event codes.
+    */        
+    TKeyEvent iKeyEvent;
+
+    /** The S60 struct that contains pointer device event info, which would be
+    * triggered by touch screen interaction.
+    * @see Symbian event codes.
+    */            
+    TAdvancedPointerEvent iPointerEvent;
+    
+    /**
+     * Holds an alf scroller event object
+     */
+    TAlfScrollerEvent iScrollerEvent;
+       
+    /** Parameter for custom events. */
+    TInt iParam;
+    
+    /** Additional event data for custom events. */
+    TInt iCustomEventData;
+
+    /** Type of the event. */
+    TType iType;
+    
+    /** Visual which the event is associated with. */
+    CAlfVisual* iVisual;
+
+private:
+    // Advanced pointer event occupies the extra space
+    //TInt iSpare1;
+    //TInt iSpare2;
+    };
+
+
+
+#endif // T_ALFEVENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfeventhandler.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Event handler API
+*
+*/
+
+
+ 
+#ifndef ALFEVENTHANDLER_H
+#define ALFEVENTHANDLER_H
+
+#include <e32base.h>
+
+class TAlfEvent;
+
+/**
+ * MAlfEventHandler is an interface that can be derived by any object that want's to handle
+ * Alfred UI Toolkit events scheduled by AlfCommandScheduler.
+ * 
+ * If an object wishes to process events from the toolkit, it should implement this interface. 
+ * 
+ * @note   The destructor will NOT cancel any pending commands enqueued to this object,
+ *         so you must call eg. <code>CAlfEnv::CancelCommands(this);</code> to cancel
+ *         still pending commands to prevent calling destroyed object.
+ */
+class MAlfEventHandler
+    {
+public:
+
+    /**
+     * Called when an input event is being offered to this object.
+     * 
+     * The implementation must ensure that the function returns EFalse if 
+     * it does not do anything in response to the event, otherwise, other objects
+     * may be prevented from receiving the event. If it is able to process the 
+     * event it should return ETrue.
+     *
+     * @param aEvent  Event to be handled.
+     *
+     * @return  <code>ETrue</code>, if the event was handled.
+     *          Otherwise <code>EFalse</code>.
+     */
+    virtual TBool OfferEventL(const TAlfEvent& aEvent) = 0;
+
+    };  
+
+#endif  // ALFEVENTHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfflowlayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,190 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Flow layout definition.
+*
+*/
+
+
+
+#ifndef C_ALFFLOWLAYOUT_H
+#define C_ALFFLOWLAYOUT_H
+
+#include <alf/alflayout.h> 
+
+/**
+ * Flow layout positions children next to each other either horizontally or
+ * vertically. The sizes of child visuals are not changed by default.
+ *
+ * The layout inner padding is used to determine the gap between children.
+ *
+ * Flow layout takes system wide layout mirroring into consideration by
+ * querying the mirroring state through AknLayoutUtils::LayoutMirrored().
+ * In western locales the visuals are layed out from left to right whereas
+ * in arabic locale for instance the visuals are layed out from right to left.
+ * Mirroring is considered only when the flow is horizontal. Vertical flow layout
+ * will always lay visuals from top to bottom.
+ * Usage:
+ * @code
+ * 
+ *  //create flowlayout
+ *  CAlfFlowLayout* flowLayout = CAlfFlowLayout::AddNewL( control );
+ *  //Add two child text visuals to flow layout
+ *  CAlfTextVisual* text1 = CAlfTextVisual::AddNewL( control, flowLayout );
+ *  CAlfTextVisual* text2 = CAlfTextVisual::AddNewL( control, flowLayout );
+ *  text1->SetTextL( _L"Text1" );
+ *  text2->SetTextL( _L"Text2" );
+ * 
+ *  //set Flow direction
+ *  flowLayout->SetFlowDirection( CAlfFlowLayout::EFlowHorizontal );
+ *  flowLayout->UpdateChildrenLayout( 1 );
+ * 
+ *  // Set Centring
+ *  flowLayout->SetCentering( ETrue );
+ *  flowLayout->UpdateChildrenLayout(transitionTimeInMilliSeconds);
+ * 
+ * //Set flow mode
+ *  flowLayout->SetMode( CAlfFlowLayout::EModeFitPerpendicular );
+ *  flowLayout->UpdateChildrenLayout( 1 );
+ * 
+ * @endcode
+ * @lib alfclient.lib
+ * @since S60 v3.2
+ */
+class CAlfFlowLayout : public CAlfLayout
+    {
+
+public:
+
+    /** Flow directions. */
+    enum TFlowDirection
+        {
+        /** 
+         * Flow horizontally. System wide layout mirroring is considered
+         * to determine whether visuals are layed from left to right
+         * or from right to left.
+         * @see AknLayoutUtils::LayoutMirrored()
+         */
+        EFlowHorizontal = 0,
+        
+        /** Flow vertically. */
+        EFlowVertical
+        };
+        
+    /** Mode flags that specify how the flow is laid out. */
+    enum TMode
+        {
+        /** Center the children perpendicular to the flow direction.
+            For example, if the flow direction is horizontal (left->right)
+            this flag will center the children vertically along the flow. */
+        EModeCenterPerpendicular = 0x1,
+        
+        /** Fit the children perpendicular to the flow direction.
+            For example, if the flow direction is horizontal, the children
+            will be vertically resized to fit the layout's rectangle. */
+        EModeFitPerpendicular = 0x2,
+        };        
+
+    /**
+     * Two-phased constructor, which attach new object into the control.
+     * @param aOwnerControl Control that owns this new obejct.
+     * @param aParentLayout If given, the new object is set as child.
+     */
+    IMPORT_C static CAlfFlowLayout* AddNewL(CAlfControl& aOwnerControl,
+                                            CAlfLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C CAlfFlowLayout();
+
+    /**
+     * Second-phase constructor.
+     */
+    IMPORT_C void ConstructL(CAlfControl& aOwner);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CAlfFlowLayout();
+
+    
+    /**
+     * Sets the direction of the flow.
+     *
+     * @param aDirection  Flow direction.
+     */
+    IMPORT_C void SetFlowDirection(TFlowDirection aDirection);
+
+    /**
+     * Sets the centering mode of the flow. This sets/clears the 
+     * EModeCenterPerpendicular flag. Calling this is equivalent to calling
+     * SetMode() with that flag included or missing from the mode.
+     *
+     * @param aCentering  <code>ETrue</code> to set the EModeCenterPerpendicular mode.
+     *                    <code>EFalse</code> to clear it.
+     */    
+    IMPORT_C void SetCentering(TBool aCentering);
+    
+    /**
+     * Sets the mode of the flow. The mode flags determine how the flow layout
+     * behaves.
+     *
+     * @param aMode  Mode flags (OR'd together).
+     *
+     * @see CAlfFlowLayout::TMode
+     */
+    IMPORT_C void SetMode(TInt aMode);
+    
+    /**
+     * Returns the mode flags of the flow.
+     *
+     * @see CAlfFlowLayout::TMode
+     *
+     * @return  Returns the current mode flags.
+     */
+    IMPORT_C TInt Mode() const;
+
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void RemoveAndDestroyAllD();
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0);
+    IMPORT_C CAlfVisual* FindTag(const TDesC8& aTag);
+    /** 
+     * From CAlfLayout
+     * @see CAlfLayout
+     */
+    IMPORT_C TAlfXYMetric BaseUnit() const; 
+
+
+protected:
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void DoRemoveAndDestroyAllD();
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+                                
+private:
+
+    struct TFlowLayoutPrivateData;
+    TFlowLayoutPrivateData* iFlowLayoutData;
+
+    };
+
+
+
+#endif // C_ALFFLOWLAYOUT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfframebrush.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,182 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Frame brush definition
+*
+*/
+
+
+
+#ifndef C_ALFFRAMEBRUSH_H
+#define C_ALFFRAMEBRUSH_H
+
+#include <AknsItemID.h>
+#include <alf/alfbrush.h>
+
+struct TAlfXYMetric;
+class TAlfImage;
+
+/**
+ * Frame brush.
+ * FrameBrush draws a 1-part or 9-part frame around a visual using bitmaps provided by the
+ * theme. The constructor takes a theme item identifier as a parameter. The bitmaps are rasterized
+ * when CAlfFrameBrush::SetFrameRects() is called. 
+ * Develper must call this method and specify the dimensions of the frame before the frame can be drawn.
+ * 
+ *  Usage:
+ *  @code
+ *  //Create framebrush instance
+ *  CAlfFrameBrush* frameBrush = CAlfFrameBrush::NewL( *iEnv, *image, TAlfXYMetric( TAlfMetric( 5 ) ) );
+ * 
+ *  //Create rect to set for framebrush
+ *  TRect innerRect( TPoint( 10, 10 ), TPoint( 20, 20 ) );
+ *  TRect outerRect( TPoint( 0, 0 ), TPoint( 30, 30 ) );
+ * 
+ *  //Set dimentions for framebrush
+ * 	frameBrush->SetFrameRects( innerRect, outerRect );
+ * 
+ *  @endcode
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+
+NONSHARABLE_CLASS( CAlfFrameBrush ): public CAlfBrush
+    {
+public:
+
+    enum TFrameParts
+        {
+        EFramePartCornerTl = 0,
+        EFramePartCornerTr,
+        EFramePartCornerBl, 
+        EFramePartCornerBr,
+        EFramePartSideT,
+        EFramePartSideB,
+        EFramePartSideL,
+        EFramePartSideR,
+        EFramePartCenter
+        };
+
+    /**
+     * Constructor. 
+     * @param aEnv Environmnet
+     * @param aImage Image for the frame. Image will be used as such, 
+     * framerects (if set) are ignored.
+     * @param aEdgeOffset Coordinates of the offset in metric units.
+     * @return New instance. Onwership tranferred to the caller.
+     */
+    IMPORT_C static CAlfFrameBrush* NewL(CAlfEnv& aEnv, const TAlfImage& aImage, const TAlfXYMetric& aEdgeOffset);
+    
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     * @param aEnv Environmnet
+     * @param aImage Image for the frame. Image will be used as such, 
+     * framerects (if set) are ignored.
+     * @param aEdgeOffset Coordinates of the offset in metric units.
+     * @return New instance. Onwership tranferred to the caller.
+     */
+    IMPORT_C static CAlfFrameBrush* NewLC(CAlfEnv& aEnv, const TAlfImage& aImage, const TAlfXYMetric& aEdgeOffset);
+
+    /**
+     * Constructor. 
+     * @param aEnv Environmnet
+     * @param aIID Skin ID for the frame.
+     * @param aEdgeOffset Coordinates of the offset in metric units.
+     * @return New instance. Onwership tranferred to the caller.
+     */
+    IMPORT_C static CAlfFrameBrush* NewL(CAlfEnv& aEnv, const TAknsItemID& aIID, const TAlfXYMetric& aEdgeOffset);
+    
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     * @param aEnv Environmnet
+     * @param aIID Skin ID for the frame.
+     * @param aEdgeOffset Coordinates of the offset in metric units.
+     * @return New instance. Onwership tranferred to the caller.
+     */
+    IMPORT_C static CAlfFrameBrush* NewLC(CAlfEnv& aEnv, const TAknsItemID& aIID, const TAlfXYMetric& aEdgeOffset);
+
+    /**
+     * Constructor. 
+     * @deprecated
+     * @param aIID Skin ID for the frame.
+     * @param aEdgeOffsetX X coordinate of the offset in pixels.
+     * @param aEdgeOffsetY Y coordinate of the offset in pixels.
+     * @return New instance. Onwership tranferred to the caller.
+     */
+    IMPORT_C static CAlfFrameBrush* NewL(CAlfEnv& aEnv, const TAknsItemID& aIID, TInt aEdgeOffsetX = 0, TInt aEdgeOffsetY = 0);
+    
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     * @deprecated
+     * @param aIID Skin ID for the frame.
+     * @param aEdgeOffsetX X coordinate of the offset in pixels.
+     * @param aEdgeOffsetY Y coordinate of the offset in pixels.
+     * @return New instance. Onwership tranferred to the caller.
+     */
+    IMPORT_C static CAlfFrameBrush* NewLC(CAlfEnv& aEnv, const TAknsItemID& aIID, TInt aEdgeOffsetX = 0, TInt aEdgeOffsetY = 0);
+        
+    /**
+     * Sets frame rects.
+     * @param aInnerRect Inner rect of the frame
+     * @param aOuterRect Outer rect of the frame
+     */
+    IMPORT_C void SetFrameRectsL(const TRect& aInnerRect, const TRect& aOuterRect);
+
+    /**
+     * Sets edge offset.
+     * @param aEdgeOffset Coordinates of the offset in metric units.
+     */
+    IMPORT_C void SetEdgeOffset(const TAlfXYMetric& aEdgeOffset);
+
+    /**
+     * Sets whole frame image. Image will be used as such, framerects (if set) are ignored.
+     * @param aImage Image for the frame.
+     */
+    IMPORT_C void SetImage(const TAlfImage& aImage);
+
+    /**
+     * Sets framepart image. Whole frame will be constrcuted from 9 parts, each part has
+     * to be set separately using this method. Genrally using 9-piece frame is not as
+     * efficient as 1-pice frame, so this method should be used only when really needed.
+     * @param aFramePart Frame part to which the image is intended.
+     * @param aImage Image for the frame part.
+     */
+    IMPORT_C void SetImage(TFrameParts aFramePart, const TAlfImage& aImage);
+
+    /**
+     * Destructor. 
+     */
+    virtual ~CAlfFrameBrush();
+
+private:
+
+    CAlfFrameBrush(const TAknsItemID& aIID, TInt aEdgeOffsetX, TInt aEdgeOffsetY);
+
+    CAlfFrameBrush(const TAknsItemID& aIID, const TAlfXYMetric& aEdgeOffset);
+   
+    CAlfFrameBrush();
+   
+    void ConstructL(CAlfEnv& aEnv, const TAknsItemID& aIID, TInt aEdgeOffsetX, TInt aEdgeOffsetY);
+
+    void ConstructL(CAlfEnv& aEnv, const TAknsItemID& aIID, const TAlfXYMetric& aEdgeOffset);
+
+    void ConstructL(CAlfEnv& aEnv, const TAlfImage& aImage, const TAlfXYMetric& aEdgeOffset);
+
+private:
+
+    // Private data. Owned.
+    struct TFrameBrushPrivateData;
+    TFrameBrushPrivateData* iFrameBrushData;
+    };
+
+#endif 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfgc.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 context.
+*
+*/
+
+
+
+#ifndef C_ALFGC_H
+#define C_ALFGC_H
+
+#include <e32base.h>
+#include <gdi.h>
+
+#include <alf/alftimedvalue.h>
+#include <alf/alfrealline.h>
+
+struct TAlfRealLine;
+
+
+class CAlfTexture;
+class CAlfTextStyle;
+
+
+/** Horizontal alignment. */
+enum TAlfAlignHorizontal
+    {
+    EAlfAlignHLeft,
+    EAlfAlignHCenter,
+    EAlfAlignHRight,
+
+    /** Special alignment for localized text. This is converted to left or
+        right alignment internally. */
+    EAlfAlignHLocale,
+
+    /** Special alignment for localized text. This is the mirrored
+        alignment of the normal locale alignment. Converted to left or
+        right alignment internally. */
+    EAlfAlignHLocaleMirrored
+    };
+
+
+/** Vertical alignment. */
+enum TAlfAlignVertical
+    {
+    EAlfAlignVTop,
+    EAlfAlignVCenter,
+    EAlfAlignVBottom
+    };    
+    
+/** Polygon draw mode */
+enum TAlfPolygonDrawMode
+    {
+    ENoFill,
+    EFillNonZero,
+    EFillEvenOdd
+    };
+    
+/**
+ * CAlfGc is a graphics context that is used for storing the state of the
+ * drawing tools. 
+ *
+ */
+NONSHARABLE_CLASS(CAlfGc) : public CBase
+    {
+public:
+
+    /**
+     * Stretch modes.
+     */
+    enum TStretchMode
+        {
+        EStretchNone = 0,   ///< Does not stretch
+        EStretchHorizontal, ///< Fits to horizontal width (left-right)
+        EStretchVertical,   ///< Fits to vertical height
+        EStretchFull		///< Stretches the image to the full area of the visual, disregarding the original aspect ratio.
+
+        };
+
+public:
+    
+    static CAlfGc* NewL();
+    ~CAlfGc();    
+    void ActivateL();
+    HBufC8* CommandBuffer();
+    void Deactivate();
+
+    void DrawImage(const CAlfTexture& aTexture, const TAlfRealRect& aDestinationRect);    
+    void DrawText(const TDesC& aText, const TAlfRealRect& aDestinationRect);    
+	void DrawEllipse(const TAlfRealRect& aDestinationRect);	
+	void DrawLines(const RArray<TReal32> & aLinesPointCords);
+	void DrawPoints(const RArray<TReal32> & aPointsCords); 
+  	void DrawPolygon(const RArray<TReal32> & aPolygonPointCords);
+  	void DrawRects(const RArray<TReal32> & aRectPointCords);
+	
+	// Setters
+    void SetTextStyle(const CAlfTextStyle& aTextStyle);
+	void SetPenColor(const TRgb& aColor);
+	void SetPenWidth(const TReal32& aWidth);
+	void SetOpacity(const TReal32& aOpacity);
+	void SetPolygonDrawMode(TAlfPolygonDrawMode aPolygonDrawMode);
+	void SetTextAlign(TAlfAlignHorizontal aAlignHorizontal, TAlfAlignVertical aAlignVertical);
+
+    // Transformations
+	void LoadIdentity();
+	void Translate(const TReal32& aX, const TReal32& aY, const TReal32& aZ);
+	void Scale(const TReal32& aX, const TReal32& aY, const TReal32& aZ);
+	void Rotate(const TReal32& aAngle, const TReal32& aX, const TReal32& aY, const TReal32& aZ);
+  
+    
+private:
+    CAlfGc();
+    void ConstructL();
+    
+    void AppendCommand( TInt aCommand, const TDesC8& aParams );
+    void AppendCommandL( TInt aCommand, const TDesC8& aParams );
+    
+private:
+    struct TAlfGcData;
+    TAlfGcData* iData;
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfgencomponent.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 C_ALFGENCOMPONENT_H
+#define C_ALFGENCOMPONENT_H
+
+#include <e32std.h>
+#include <e32base.h>
+
+class CAlfEnv;
+class CAlfMessageObserver;
+
+class MAlfAsyncOpObserver
+    {
+    public:
+        virtual void AlfAsyncOpCompleted(TInt aCommandId, TInt aStatus) = 0;
+    };
+
+/**
+ *  Generalisation of component command interface
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfGenComponent ): public CBase 
+    {
+public:
+
+    /**
+    *  
+    *
+    */
+    IMPORT_C static CAlfGenComponent* NewL(
+            CAlfEnv& aEnv,
+            TInt aImplementationId, 
+            TInt aImplementationUid, 
+            const TDesC8& aConstructionParams);
+    
+    /**
+    * Destructor  
+    */
+    IMPORT_C ~CAlfGenComponent();
+    
+    /**
+    *  Performs syncronous command and returns value of success, can be any system wide error code 
+    */
+    IMPORT_C TInt DoSynchronousCmd( TUint aOp, 
+                               const TDesC8& aInputBuf, TDes8& aOutBuf);
+                               
+    /**
+     * Sends a command without waiting for the reply from the server.
+     * Commands sent through this API can be batched as well. If the batching
+     * fails (or disabled) the DoSynchronousCmd will be called automatically.
+     * 
+     * @param aOp Command indentifier
+     * @param aInputBuf Input buffer. The function will take copy of the 
+     *        buffer content and delete it when the batch buffer is 
+     *        flushed.
+     *
+     * @return Symbian OS error code.
+     */
+    IMPORT_C TInt DoCmdNoReply( TUint aOp, const TDesC8& aInputBuf );
+    
+    /**
+    * Performs syncronous command. Given observer will be notified on success of operation via call back
+    * Caller must ensure that buffers exist when command is under progress.
+    *
+    * @return command id which can be used for cancelling the command
+    */
+    IMPORT_C  TInt DoAsynchronousCmdL(TUint aOp, const TDesC8& aInputBuf, 
+                               TDes8& aOutBuf, MAlfAsyncOpObserver* aObserver);
+    /**
+    * Cancel specificied asynchronous command. 
+    * To cancel all pending requests, use Cancel() from base class    
+    *
+    * @param aCmdId a command to be cancelled
+    */
+    IMPORT_C void CancelAsynchCmd(TInt aCmdId);
+
+    /**
+    *  Unique identifier of this component, returns zero if not generated yet
+    */
+    IMPORT_C TInt Identifier();
+    
+    /**
+     * Called when asynchronous command completed. This call deletes 
+     * the object.
+     * @param aMessageObserver Message which was completed.
+     */ 
+    void CommandCompleted( CAlfMessageObserver* aMessageObserver );
+
+
+private:
+    CAlfGenComponent(CAlfEnv& aEnv);    
+    void ConstructL( 
+            TInt aImplementationId, 
+            TInt aImplementationUid, 
+            const TDesC8& aConstructionParams);
+
+private: // data
+    CAlfEnv& iEnv;
+    class TPrivateData;
+    TPrivateData* iData;
+    };
+
+
+#endif // C_ALFGENCOMPONENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfgradientbrush.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,147 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Gradient brush class
+*
+*/
+
+
+
+#ifndef C_ALFGRADIENTBRUSH_H
+#define C_ALFGRADIENTBRUSH_H
+
+#include <alf/alfbrush.h>
+#include <gdi.h>
+
+class CAlfEnv;
+class TAlfImage;
+
+/**
+ * Linear gradient brush. Draws a sequence of colors in a linear gradient.
+ * A gradient brush can draw gradients in horizontal and vertical 
+ * directions using any number of colors.
+ * 
+ * Usage:
+ * @code
+ * 
+ * CAlfVisual* visual = CAlfVisual::AddNewL( control );
+ * visual->EnableBrushesL();
+ * CAlfGradientBrush* brush = CAlfGradientBrush::NewL( *iEnv );
+ * 
+ * // Configure the gradient: direction and colors.
+ * brush->SetDirection( CAlfGradientBrush::EDirectionDown );
+ * brush->SetColor( KRgbBlack, .5f );
+ * brush->AppendColorL( 1, KRgbRed, 1.f );
+ * brush->AppendColorL( 2, KRgbYellow, .1f );
+ * 
+ * //Append brush in brusharray with ownership to array 
+ * visual->Brushes()->AppendL( brush, EAlfHasOwnership );
+ * @endcode
+ * @lib alfclient.lib
+ * @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfGradientBrush ): public CAlfBrush
+    {
+    
+public:
+
+    /** Linear gradient directions. */
+    enum TDirection
+        {
+        EDirectionUp,
+        EDirectionRight,
+        EDirectionDown,
+        EDirectionLeft
+        };
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C static CAlfGradientBrush* NewL( CAlfEnv& aEnv );
+
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     */
+    IMPORT_C static CAlfGradientBrush* NewLC( CAlfEnv& aEnv );
+    
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfGradientBrush();
+    
+    /**
+     * Sets the gradient direction.
+     */
+    IMPORT_C void SetDirection(TDirection aDirection);
+
+    /**
+     * Replaces all colors with a single color.
+     *
+     * @param aColor    Solid color for the gradient.
+     * @param aOpacity  Opacity.
+     */
+    IMPORT_C void SetColor(const TRgb& aColor, TReal32 aOpacity = 1.0) __SOFTFP;
+
+    /**
+     * Sets the image for the gradient. By default, no image is used. The image
+     * can be cleared with <code>SetImage(TAlfImage())</code>.
+     *
+     * @param aImage  Image to use in the gradient.
+     */
+    IMPORT_C void SetImage(const TAlfImage& aImage);
+
+    /**
+     * Returns a color from the gradient.
+     */
+    IMPORT_C TRgb Color(TInt aIndex) const;
+
+    /**
+     * Returns an opacity value from the gradient.
+     */
+    IMPORT_C TReal32 Opacity(TInt aIndex) const;
+
+    /**
+     * Returns the image of the gradient brush.
+     */
+    IMPORT_C const TAlfImage& Image() const;
+
+    /**
+     * Appends a new color for the entire gradient. The caller must
+     * append colors in the correct order, by ascending position.
+     *
+     * @param aPosition  Position of the color.
+     * @param aColor     Color at the position.
+     * @param aOpacity   Opacity at the position.
+     */
+    IMPORT_C void AppendColorL(
+        TReal32 aPosition, 
+        const TRgb& aColor,
+        TReal32 aOpacity = 1.0) __SOFTFP;
+    
+
+private:
+
+    CAlfGradientBrush();
+
+    void ConstructL( CAlfEnv& aEnv );
+
+private: // data
+
+    struct TGradientBrushPrivateData;
+    TGradientBrushPrivateData* iGradientBrushData;
+    
+    };
+
+
+
+#endif // C_ALFGRADIENTBRUSH_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfgridlayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,434 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Layout base class
+*
+*/
+
+
+
+#ifndef C_ALFGRIDLAYOUT_H
+#define C_ALFGRIDLAYOUT_H
+
+#include <alf/alflayout.h>
+
+/* Each dimension corresponds to a different axis for the grid blocks */
+enum TAlfGridDimension 
+    {
+    EAlfGridColumn,
+    EAlfGridRow
+    };
+
+/**
+ * These flags specify where pixel error is distributed in grid layout calculations.
+ * 
+ * If none of these flags are set, then the pixel positions of all children are calculated
+ * using reals, then floored to the nearest pixel. If, however, the children must all be
+ * the same pixel size, then the following flags can be set. They place extra pixels into
+ * the layout's paddings to make up the difference.
+ * The flags for increasing and decreasing paddings are
+ * mutually exclusive, but you can apply inner and outer padding flags at the same time. This
+ * will result in the error being distributed between inner and outer paddings in the same
+ * proportion as inner to outer padding. Eg: if inner padding is 10 and outer padding is 20, twice
+ * as many error pixels will be distributed to the outer padding.
+ * @see SetLayoutModeFlags
+ */
+enum TAlfGridLayoutModeFlags
+    {
+    /** Automatically increases innerpaddings if needed. Clears EAlfGridDecreaseInnerPadding if set.*/
+    EAlfGridIncreaseInnerPadding = 0x1,
+ 
+    /** Automatically decreases innerpaddings if needed. Clears EAlfGridIncreaseInnerPadding if set.*/
+    EAlfGridDecreaseInnerPadding = 0x2,
+    
+    /** Automatically increases outerpaddings if needed. Clears EAlfGridDecreaseOuterPadding if set.*/    
+    EAlfGridIncreaseOuterPadding = 0x4,
+
+    /** Automatically decreases outerpaddings if needed. Clears EAlfGridIncreaseOuterPadding if set.*/    
+    EAlfGridDecreaseOuterPadding = 0x8,
+    
+    EAlfGridFlagAll = 0xF
+    };
+
+/**
+ * Grid layout class.
+ *
+ * To use this class, a grid layout is created of a desired width and height.
+ * Then, when visuals are added to grid layout, they will populate the grid.
+ * By default, all slots in a grid layout are of a uniform size, but the weighting
+ * of individual rows and columns can be modified, and can be specified using
+ * metric units.
+ * Slots will resize automatically as the grid layout size changes.
+ *
+ * The standard application grid is one example of a grid layout.
+ * 
+ * Usage:
+ *
+ * @code
+ * // Create a new 3x4 grid layout visual.
+ * CAlfGridLayout* grid = CAlfGridLayout::AddNewL( control, 3, 4 );
+ * 
+ * // Add a single text visual into the grid.
+ * CAlfTextVisual* text = CAlfTextVisual::AddNewL( control, grid );
+ * 
+ * // Make the text visual visible; if no text is specified, nothing is drawn.
+ * text->SetTextL(_L("T"));
+ * 
+ * //Setting grid dimentions with weight
+ * RArry<TInt> col;
+ * col.AppendL( 1 );
+ * col.AppendL( 2 );
+ * 
+ * //sets no of columns to 2 and width of second column
+ * //is double of that of first
+ * grid->SetColumns( col );
+ * 
+ * @endcode
+ * @lib alfclient.lib
+ * @since S60 v3.2
+ */
+class CAlfGridLayout : public CAlfLayout
+    {
+public:
+
+	/* Constructors and destructor. */
+
+    /**
+     * Construct a new grid layout and give its ownership to a control.
+     *
+     * @note the columns and rows will be initialized with equal unit weights, so that blocks will all share 
+     * even proportions of the available area to start with.
+     * @note in order to use a mixture of metric weights, or to set different weights, set rows 
+     * and columns to zero when calling this method, then use e.g. @c AppendWeightL to 
+     * subsequently populate the weights.
+     * 
+     * @param aOwnerControl  Owner control.
+     * @param aColumns       Number of columns in the grid.
+     * @param aRows          Number of rows in the grid.
+     * @param aParentLayout  Parent layout for the new grid layout.
+     */
+    IMPORT_C static CAlfGridLayout* AddNewL(CAlfControl& aOwnerControl, 
+                                            TInt aColumns, TInt aRows,
+                                            CAlfLayout* aParentLayout = 0);
+
+	/**
+	 * Constructor.
+	 */
+	IMPORT_C CAlfGridLayout();
+
+	/**
+	 * From CAlfLayout. Second-phase constructor.
+	 */
+	IMPORT_C void ConstructL(CAlfControl& aOwner);
+
+	/**
+	 * Virtual destructor.
+	 */
+	IMPORT_C ~CAlfGridLayout();
+
+
+	/* Methods. */    
+
+    /**
+     * Sets amount of columns.
+     *
+     * @param aColumnCount Amount of columns.
+     */
+    IMPORT_C void SetColumnsL(TInt aColumnCount);
+    
+    /**
+     * Sets amount of rows.
+     *
+     * @param aRowCount Amount of rows.
+     */
+    IMPORT_C void SetRowsL(TInt aRowCount);
+    
+    /**
+     * Sets the number and weights of columns in this grid layout.
+     * The caller specifies an array of relative weights to use for each
+     * column.
+     * Weights can be any integer, ie a column of weight 30 would
+     * be twice the width of a column of weight 15.
+     *
+     * @note this is equivalent to using metrics with unit type EAlfUnitWeight.
+     *
+     * @param aWeights An array containing weights for each column.
+     */    
+    IMPORT_C void SetColumnsL(const RArray<TInt>& aWeights);
+    
+    /**
+     * Sets the number and weights of rows in this grid layout.
+     * The caller specifies an array of relative weights to use for each
+     * row.
+     * Weights can be any integer, ie a row of weight 30 would
+     * be twice the height of a row of weight 15.
+     *
+     * @note this is the same as using metrics with unit type EAlfUnitWeight.
+     *
+     * @param aWeights An array containing weights for each row.
+     */    
+    IMPORT_C void SetRowsL(const RArray<TInt>& aWeights);
+
+    /**
+     * Sets the number and weights of blocks in this grid layout in the direction of the specified
+     * dimension. Each block's weight will be set to equal the supplied value, the result
+     * of which is that all blocks will be equally spaced, whatever the units. 
+     *
+     * @since S60 3.2
+     *
+     * @see @c AppendWeightL for more information on how weights are used to calculate layout positions.
+     *
+     * @note This API could be useful if then subsequent calls to @c ReplaceWeightL are made to 
+     * change specific values, depending on how many of the values are different. 
+     * @note Calling this with aCount set to 0 will clear all of the existing weights in the direction
+     * of the specified dimension.
+     * @note this is the same as using metrics with unit type EAlfUnitWeight.
+     *
+     * @param aDim the dimension along which to fill
+     * @param aCount The number of lines of blocks to fill
+     * @param aWeight the weights to be used for all blocks
+     */    
+    IMPORT_C void FillWeightsL(TAlfGridDimension aDim, TInt aCount, const TAlfMetric& aWeight);
+
+    /**
+     * Add a new line of blocks to this grid layout at the last position in the direction of the 
+     * specified dimension. It will have the supplied weight. Weights can be any metric value, 
+     * hence different units can be used for each block. In particular, EAlfUnitWeight can be used 
+     * to represent weight values in aribtrary proportional units.
+     *
+     * In the case of proportional weights, the effect of this will be to cause the other blocks to 
+     * resize according to the new total weight.
+     *
+     * @since S60 3.2
+     *
+     * @note If non-relative coordinates are specified (e.g., real pixels), the combined blocks might not 
+     *      fill the entire layout area. However, weights will always stretch to fill all available space 
+     *      after the fixed units have been determined. Therefore, depending on circumstances it may
+     *      be better to use EAlfUnitWeight
+     * @note For example [2 weights, 1 weight, 2 weights] in a layout of 100 pixels would result 
+     *      in [40 pixels, 20 pixels, 40 pixels]. 
+     * @note For example [10 pixels, 1 weight, 15 pixels] in a layout of 100 pixels would result 
+     *      in [10 pixels, 75 pixels, 15 pixels]. 
+     *
+     * @param aDim the dimension to which the weight corresponds
+     * @param aWeight the weight to be used for the block in the specified dimension, 
+     *          replacing any previously existing weight for that block
+     */
+    IMPORT_C void AppendWeightL(TAlfGridDimension aDim, const TAlfMetric& aWeight);
+
+    /**
+     * Add a new line of blocks to this grid layout at the specified position in the direciton of 
+     * the specified dimension. It will have the supplied weight. In the case of proportional 
+     * weights, the effect of this will be to cause the other blocks to resize according to the new 
+     * total weight. It will also mean that many child visuals will now occupy different blocks within
+     * the grid according to how the blocks wrap.
+     *
+     * @since S60 3.2
+     *
+     * @see @c AppendWeightL for more information on how weights are used to calculate layout positions.
+     *
+     * @param aDim the dimension to which the weight corresponds
+     * @param aWeight the weight to be used for the block in the specified dimension, 
+     *          replacing any previously existing weight for that block
+     * @param aPos the index of the block
+     */
+    IMPORT_C void InsertWeightL(TAlfGridDimension aDim, const TAlfMetric& aWeight, TInt aPos);
+
+    /**
+     * Sets the weight of a specific line of blocks in this grid layout, in the direction of the supplied dimension.
+     * In the case of proportional weights, the effect of this will be to cause the 
+     * other blocks to resize according to the new total weight. 
+     *
+     * @since S60 3.2
+     *
+     * @see @c AppendWeightL for more information on how weights are used to calculate layout positions.
+     *
+     * @param aDim the dimension to which the weight corresponds
+     * @param aWeight the weight to be used for the block in the specified dimension, 
+     *          replacing any previously existing weight for that cell
+     * @param aPos the index of the cell
+     */
+    IMPORT_C void ReplaceWeightL(TAlfGridDimension aDim, const TAlfMetric& aWeight, TInt aPos);
+
+    /**
+     * Remove a line of blocks from this grid layout at the specified position in the 
+     * specified dimension. In the case of proportional weights, the effect of this will 
+     * be to cause the other blocks to resize according to the new total weight. It will also mean 
+     * that many child visuals will now occupy different blocks within the grid according to how 
+     * the blocks wrap.
+     *
+     * @since S60 3.2
+     *
+     * @see @c AppendWeightL for more information on how weights are used to calculate layout positions.
+     *
+     * @param aDim the dimension to which the weight corresponds
+     * @param aPos the index of the cell
+     */
+    IMPORT_C void RemoveWeightL(TAlfGridDimension aDim, TInt aPos);
+
+    /**
+     * Returns the weight of a specific line of blocks in this grid layout, in the
+     * specified dimension. 
+     *
+     * @since S60 3.2
+     *
+     * @see @c AppendWeightL for more information on how weights are used to calculate layout positions.
+     *
+     * @param aDim the dimension to which the weight corresponds
+     * @param aPos the index of the cell
+     * @return the weight being used for the cell in the specified dimension, will be 0 magnitude if not set
+     */
+    IMPORT_C TAlfMetric Weight(TAlfGridDimension aDim, TInt aPos) const;
+    
+    /**
+     * Return the number of lines of blocks in this grid, along the specified dimension.
+     *
+     * @since S60 3.2
+     *
+     * @param aDim the dimension along which to count
+     * @return The number of lines of blocks in this grid.
+     */        
+    IMPORT_C TInt DimensionCount(TAlfGridDimension aDim) const;
+    
+        
+    /**
+     * ! Deprecated, use leaving method instead
+     */
+    void SetColumns(TInt aColumnCount)
+        {
+        TRAP_IGNORE(SetColumnsL(aColumnCount))
+        }
+    
+    /**
+     * ! Deprecated, use leaving method instead
+     */
+    void SetRows(TInt aRowCount)
+        {
+        TRAP_IGNORE(SetRowsL(aRowCount))
+        }
+    
+    /**
+     * ! Deprecated, use leaving method instead
+     */
+    void SetColumns(const RArray<TInt>& aWeights)
+        {
+        TRAP_IGNORE(SetColumnsL(aWeights))
+        }
+    
+    /**
+     * ! Deprecated, use leaving method instead
+     */
+    void SetRows(const RArray<TInt>& aWeights)
+        {
+        TRAP_IGNORE(SetRowsL(aWeights))
+        }
+    
+    /**
+     * Sets flags to control expanding behaviour.
+     *
+     * @param aFlags Flags
+     */
+    IMPORT_C void SetExpanding(TInt aFlags);
+        
+    /**
+     * Gets amount of rows.
+     *
+     * @return Amount of rows.
+     */
+    IMPORT_C TInt RowCount() const;
+        
+    /**
+     * Gets amount of columns.
+     *
+     * @return Amount of columns.
+     */
+    IMPORT_C TInt ColumnCount() const;
+
+    /**
+     * Calculates the position of a child in the grid. Returns the block
+     * position, where block (0, 0) is in the top left corner.
+     *
+     * @param aOrdinal  Ordinal of a child.
+     *
+     * @return  Block position of the child.
+     */    
+    IMPORT_C TPoint OrdinalToBlock(TInt aOrdinal) const;
+    
+    /**
+     * Sets flag(s) which alter the children's pixel error distribution within the grid layout.
+     *
+     * This method allows the client to force all items in the grid layout to be the same
+     * pixel size. The floating point error that this introduces is distributed between the various
+     * paddings of the layout.
+     * 
+     * Example of use that allows outer paddings to be automatically adjusted:
+     * \code
+     * iGridLayout->SetLayoutModeFlags(EHuiGridRow, EHuiGridAdjustOuterPadding); 
+     * \endcode
+     *
+     * Note that some flags are mutually exclusive, and will clear some existing flags if set.
+     *
+     * @param aDim the dimension to which the given flag(s) affect.
+     * @param aGridLayoutModeFlags Flags to be set or cleared
+     * @see TAlfGridLayoutModeFlags, ClearLayoutModeFlags
+     */        
+    IMPORT_C void SetLayoutModeFlags(TAlfGridDimension aDim, TUint aGridLayoutModeFlags);
+
+    /**
+     * Clears flag(s) which alter the children's pixel error distribution within the grid layout.
+     *
+     * @param aDim the dimension to which the given flag(s) affect.
+     * @param aGridLayoutModeFlags Flags to be cleared
+     * @see TAlfGridLayoutModeFlags, SetLayoutModeFlags
+     */        
+    IMPORT_C void ClearLayoutModeFlags(TAlfGridDimension aDim, TUint aGridLayoutModeFlags);    
+    
+    /**
+     * Return flag(s) which alter the children's pixel error distribution within the grid layout.
+     *
+     * @param aDim the dimension to return the flags for.
+     */
+    IMPORT_C TInt LayoutModeFlags(TAlfGridDimension aDim);
+    
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void RemoveAndDestroyAllD();
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0);
+    IMPORT_C CAlfVisual* FindTag(const TDesC8& aTag);
+    
+    /**
+     * From CAlfLayout
+     * @see CAlfLayout
+     */
+    IMPORT_C TAlfXYMetric BaseUnit() const;
+
+protected:
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void DoRemoveAndDestroyAllD();
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+          
+private:
+    
+    // Private structure. Owned.
+    struct TGridLayoutPrivateData;
+    TGridLayoutPrivateData* iGridLayoutData;
+
+    };
+
+
+#endif // C_ALFGRIDLAYOUT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfimage.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,358 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef T_ALFIMAGE_H
+#define T_ALFIMAGE_H
+
+#include <e32base.h>
+#include <AknIconUtils.h>
+#include <AknsUtils.h>
+#include <alf/alftimedvalue.h>
+#include <alf/alftexture.h>
+#include <alf/alftexturemanager.h>
+
+
+class TAknsItemID;
+class CAlfTexture;
+struct TAlfRealPoint;
+class TAlfTimedPoint;
+class CAlfTextureManager;
+class CAlfImageLoaderUtil;
+
+/**
+ * Image Class
+ * Image specifies an area on a texture object.
+ * Image is a class that is used to specify the region of a texture that is going to be drawn. 
+ * API methods in visuals and brushes use Image as the type of any parameters that are to 
+ * specify textures used for drawing. Image is a small class that contains a reference to a 
+ * texture object and the coordinates of a rectangular subregion within that texture, 
+ * in normalized coordinates (0.0–1.0). 
+ * 
+ * Usage
+ * 
+ * @code
+ * 
+ * //Get TextureManager
+ * CAlfTextureManage* textureManager = &iEnv->TextureManager();
+ * 
+ * //SetPath
+ * textureManager->setImagePath( _L( "C:\\data\\Images\\Pictures\\" ) );
+ * 
+ * //LoadTexture
+ * CAlfTexture* texture = textureManager->LoadTexture( _L( "1.bmp" ), 
+ * 						EAlfTextureFlagDefault, AUTO_GENERATED_TEXTURE_ID );
+ * 
+ * //Create Image
+ * TAlfImage image( *texture );
+ * 
+ * //Create icon as Image
+ * TSize size(10,10);
+ * TAlfImage image( iconUid, EAknsAppIconTypeList, size );
+ * 
+ * //Create image from skin logical name
+ * TAlfImage image( logicalskin, size );
+ * 
+ * @endcode
+ * 
+ * @lib alfclient.lib
+ * @since S60 v3.2
+ */
+NONSHARABLE_CLASS( TAlfImage )
+    {
+public:
+
+    /* Constructors. */
+    /** @beginAPI */
+
+    /**
+     * Default constructor, creates an empty TAlfImage.
+     */
+    IMPORT_C TAlfImage();
+
+    IMPORT_C ~TAlfImage();
+
+    /**
+     * Constructor. Textures coordinates will be normalized to match the
+     * size of the texture, so that (1,1) is always the lower right corner.
+     * Note that the TAlfImage instance stores a pointer to aTexture.
+     * aTexture must continue to exist for the entire lifetime of the
+     * TAlfImage instance. 
+     *
+     * @param aTexture  Texture being drawn.
+     */
+    IMPORT_C TAlfImage(const CAlfTexture& aTexture, 
+                       TReal32 aTlX = 0.f, TReal32 aTlY = 0.f,
+                       TReal32 aBrX = 1.f, TReal32 aBrY = 1.f) __SOFTFP;
+
+    /**
+     * Constructor. Creates image specification from the given skin parameteres. 
+     * This constructor is intended to be used when one-piece skin graphics is to be defined as
+     * the image.
+     *
+     * Actual texture object will not get created immediately, toolkit creates it later when
+     * it is needed.
+     *
+     * If skin id does not exist in the system, image is tried to be created from the given
+     * fallback .MIF or .MBM fallback iconfile.
+     *
+     * @param aID Skin id of the graphics to be used in the texture.
+     * @param aPreferredSize Size to which the skinned graphics will be texturized.
+     * @param aPreferredScaleMode Scalemode that is used when skinned graphics is texturized.
+     *        Possible values are: EAspectRatioPreserved, 
+     *                             EAspectRatioPreservedAndUnusedSpaceRemoved
+     *                             EAspectRatioNotPreserved
+     *                             EAspectRatioPreservedSlice 
+     *
+     * @param aFallbackFileName Filename of the .MIF iconfile. Note that ownership remains in the caller.
+     * @param aFallbackBitmapId Bitmap id inside iconfile.
+     * @param aFallbackMaskId Mask id inside iconfile.
+     * @param aTlX Texture topleft X-coordinate.
+     * @param aTlY Texture topleft Y-coordinate.    
+     * @param aBrX Texture bottomright X-coordinate.
+     * @param aBrY Texture bottomright Y-coordinate.
+     * @param aTextureFlags Texture flags to be used when skin data is texturized.
+     * @param aPreferredTextureId Texture id to be given when skin data is texturized.
+     * @param aPreferredTextureManager Texture manager to be used when skin data is texturized.
+     *
+     */
+    IMPORT_C TAlfImage(TAknsItemID aID,
+                       TSize aPreferredSize,
+                       TScaleMode aPreferredScaleMode = EAspectRatioPreserved, 
+                       const TDesC *aFallbackFileName = NULL, 
+                       TInt aFallbackBitmapId = -1, 
+                       TInt aFallbackMaskId = -1,
+                       TReal32 aTlX = 0.f, TReal32 aTlY = 0.f,
+                       TReal32 aBrX = 1.f, TReal32 aBrY = 1.f,
+                       TAlfTextureFlags aTextureFlags = EAlfTextureFlagSkinContent,
+                       TInt aPreferredTextureId = KAlfAutoGeneratedTextureId,
+                       CAlfTextureManager* aPreferredTextureManager = NULL) __SOFTFP;
+
+    
+    /**
+     * @deprecated <b>DO NOT USE! Won't create usable TAlfImage<\b>
+     * 
+     * Constructor. Creates image specification from the given skin parameteres. 
+     * This constructor is intended to be used when one-piece skin graphics is to be defined as
+     * the image.
+     *
+     * Actual texture object will not get created immediately, toolkit creates it later when
+     * it is needed.
+     *
+     * If skin id does not exist in the system, image is tried to be created from the given
+     * fallback .MIF or .MBM fallback iconfile.
+     *
+     * @param aLogical Name Skin name of the graphics to be used in the texture.
+     * @param aPreferredSize Size to which the skinned graphics will be texturized.
+     * @param aPreferredScaleMode Scalemode that is used when skinned graphics is texturized.
+     *        Possible values are: EAspectRatioPreserved, 
+     *                             EAspectRatioPreservedAndUnusedSpaceRemoved
+     *                             EAspectRatioNotPreserved
+     *                             EAspectRatioPreservedSlice 
+     *
+     * @param aFallbackFileName Filename of the .MIF iconfile. Note that ownership remains in the caller.
+     * @param aFallbackBitmapId Bitmap id inside iconfile.
+     * @param aFallbackMaskId Mask id inside iconfile.
+     * @param aTlX Texture topleft X-coordinate.
+     * @param aTlY Texture topleft Y-coordinate.    
+     * @param aBrX Texture bottomright X-coordinate.
+     * @param aBrY Texture bottomright Y-coordinate.
+     * @param aTextureFlags Texture flags to be used when skin data is texturized.
+     * @param aPreferredTextureId Texture id to be given when skin data is texturized.
+     * @param aPreferredTextureManager Texture manager to be used when skin data is texturized.
+     *
+     */
+    IMPORT_C TAlfImage(const TDesC* aLogicalName,
+            TSize aPreferredSize,
+            TScaleMode aPreferredScaleMode, 
+            const TDesC* aFallbackFileName, 
+            TInt aFallbackBitmapId, 
+            TInt aFallbackMaskId,
+            TReal32 aTlX, TReal32 aTlY,
+            TReal32 aBrX, TReal32 aBrY,
+            TAlfTextureFlags aFlags,
+            TInt aPreferredTextureId,
+            CAlfTextureManager* aPreferredTextureManager) __SOFTFP;
+    /**
+     * Constructor. Creates image specification from the given skin parameteres. This
+     * constructor is intended to be used when application icons are to be defined as the image. 
+     *
+     * Actual texture object will not get created immediately, toolkit creates it later when
+     * it is needed.
+     *
+     * @param aAppIconUid Application uid which icon is to be used.
+     * @param aAppIconType Application icon type.
+     * @param aPreferredSize Size to which the skinned graphics will be texturized.
+     * @param aPreferredScaleMode Scalemode that is used when skinned graphics is texturized.
+     *        Possible values are: EAspectRatioPreserved, 
+     *                             EAspectRatioPreservedAndUnusedSpaceRemoved
+     *                             EAspectRatioNotPreserved
+     *                             EAspectRatioPreservedSlice 
+     *
+     * @param aTlX Texture topleft X-coordinate.
+     * @param aTlY Texture topleft Y-coordinate.    
+     * @param aBrX Texture bottomright X-coordinate.
+     * @param aBrY Texture bottomright Y-coordinate.
+     * @param aTextureFlags Texture flags to be used when skin data is texturized.
+     * @param aPreferredTextureId Texture id to be given when skin data is texturized.
+     * @param aPreferredTextureManager Texture manager to be used when skin data is texturized.
+     */
+    IMPORT_C TAlfImage(TUid aAppIconUid, 
+                       TAknsAppIconType aIconType,
+                       TSize aPreferredSize,
+                       TScaleMode aPreferredScaleMode = EAspectRatioPreserved, 
+                       TReal32 aTlX = 0.f, TReal32 aTlY = 0.f,
+                       TReal32 aBrX = 1.f, TReal32 aBrY = 1.f,
+                       TAlfTextureFlags aTextureFlags = EAlfTextureFlagSkinContent,
+                       TInt aPreferredTextureId = KAlfAutoGeneratedTextureId,
+                       CAlfTextureManager* aPreferredTextureManager = NULL) __SOFTFP;
+                       
+    /**
+     * Returns texture of the image.
+     * @return  Texture being drawn.
+     */
+    IMPORT_C const CAlfTexture& Texture() const; 	                       
+
+    /**
+     * Determines the current texture coordinates of the top-left corner of
+     * this image.
+     */
+    IMPORT_C TAlfRealPoint TopLeft() const;
+
+    /**
+     * Determines the current texture coordinates of the bottom-right corner of
+     * this image.
+     */
+    IMPORT_C TAlfRealPoint BottomRight() const;
+
+    /**
+     * Determines if a texture has been specified for the image.
+     */
+    IMPORT_C TBool HasTexture() const;
+
+    /**
+     * Sets the texture of the image.
+     */
+    IMPORT_C void SetTexture(CAlfTexture& aTexture);
+
+    /**
+     * Apply an offset to the texture coordinates.
+     */
+    IMPORT_C void Translate(TReal32 aDx, TReal32 aDy, TInt aTransitionTime = 0) __SOFTFP;
+
+    /**
+     * Apply a scaling factor to the texture coordinates.
+     */
+    IMPORT_C void Scale(TReal32 aScaleX, TReal32 aScaleY, TInt aTransitionTime = 0) __SOFTFP;
+
+    /**
+     * Sets the texture coordinates for the whole image.
+     */
+    IMPORT_C void SetTexCoords(TReal32 aTlX = 0.f, TReal32 aTlY = 0.f,
+                                  TReal32 aBrX = 1.f, TReal32 aBrY = 1.f,
+                                  TInt aTransitionTime = 0) __SOFTFP;
+
+    /** @endAPI */
+
+    TAlfTimedPoint TimedTopLeft() const;
+
+    TAlfTimedPoint TimedBottomRight() const;
+
+    TAknsItemID SkinID() const;
+    
+    TSize PreferredSize() const;
+    
+    TScaleMode PreferredScaleMode() const;
+    
+    const TDesC* FallbackFileName() const;
+    
+    TInt FallbackBitmapId() const;
+    
+    TInt FallbackMaskId() const;
+    
+    CAlfTextureManager* PreferredTextureManager() const;
+
+    TBool SkinnableImage() const;
+    
+    TAlfTextureFlags TextureFlags() const;
+
+    TInt PreferredTextureId() const;
+    
+    TUid AppIconUid() const;
+
+    TAknsAppIconType AppIconType() const;
+
+private:
+
+    void InitSkinData();    
+    
+private:
+	
+    /** Texture  for the image. */
+	const CAlfTexture* iTexture;
+
+    /** Texture coordinates of the top left corner, for the whole image. */
+    TAlfTimedPoint iTl;
+
+    /** Texture coordinates of the bottom right corner, for the whole image. */
+    TAlfTimedPoint iBr;
+	
+    /** Skin id for the image. */
+	TAknsItemID iSkinID;
+
+    /** App uid for application image */
+    TUid iAppIconUid;
+    
+    /** Icon type for application image */
+    TAknsAppIconType iAppIconType;
+
+    /** Rendering size for the image. */
+    TSize iPreferredSize;
+    
+    /** Rendering scalemode for the image. */
+    TScaleMode iPreferredScaleMode;
+    
+    /** Fallback image filename for the image. */
+  	const TDesC* iFallbackFileName;
+  	
+    /** Fallback image bitmap id for the image. */
+  	TInt iFallbackBitmapId;
+	  
+    /** Fallback image mask id for the image. */
+    TInt iFallbackMaskId;
+  
+    /** Preferred texturemanager for loading the skinned image. */
+    CAlfTextureManager* iPreferredTextureManager;
+
+    /** Preferred texture id for skinned image. */
+    TInt iPreferredTextureId;
+    
+    /** Flags for loading the skinned image. */
+    TAlfTextureFlags iFlags;
+    
+    /** Flags to tell if this is skinned image. */
+    TBool iSkinnableImage;
+    
+    /** Reserved for future */
+    TInt iSpare1;
+    TInt iSpare2;
+    TInt iSpare3;
+	
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfimagebrush.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,232 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Image brush definition
+*
+*/
+
+
+
+#ifndef C_ALFIMAGEBRUSH_H
+#define C_ALFIMAGEBRUSH_H
+
+#include <alf/alfbrush.h>
+#include <alf/alfimagevisual.h>
+
+class CAlfEnv;
+class TAlfImage;
+class TRgb;
+
+/**
+ * Image brush can be used to fill the entire background of a visual. 
+ * It can also be used for stretching out a single bitmap.
+ * For example, in the case below, image is used as the borders and background of a visual.
+ * 
+ * Usage:
+ * @code
+ * 
+ * // Create layout and visual, and set up some padding.
+ * CAlfDeckLayout* deck = CAlfDeckLayout::AddNewL( control );
+ * deck->SetPadding( TPoint( 10, 10 ) );
+ * CAlfTextVisual* text = CAlfTextVisual::AddNewL( control, deck );
+ * text->EnableBrushesL();
+ * 
+ * //For image in imagebrush
+ * CAlfTexture* texture = iEnv->TextureManager().LoadTexture( _L("1.bmp"), 
+ * 						EAlfTextureFlagDefault, AUTO_GENERATED_TEXTURE_ID );
+ * 
+ * // Image brush with borders within the brush area.
+ * CAlfImageBrush* brush = CAlfImageBrush::NewL( &iEnv, TAlfImage( *texture ) );
+ * brush->SetLayer( EAlfBrushLayerBackground );
+ * text->Brushes()->AppendL( brush, EAlfHasOwnership );
+ * 
+ * @endcode
+ * @lib alfclient.lib
+ * @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfImageBrush ): public CAlfBrush
+    {
+
+public:
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C static CAlfImageBrush* NewL(CAlfEnv& aEnv, const TAlfImage & aImage);
+
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     */
+    IMPORT_C static CAlfImageBrush* NewLC(CAlfEnv& aEnv, const TAlfImage & aImage);
+
+    /**
+     * Sets the scaling mode for the bitmap.
+     * An unscaled image will be drawn at a 1:1 mapping between its
+     * texture and the screen. A scaled image will be resized to fit the
+     * visual's size exactly.
+     * If unset, the default is EScaleFit.
+     * 
+     * @param aScaleMode The scaling mode of this image visual.
+     */
+    IMPORT_C void SetScaleMode(CAlfImageVisual::TScaleMode aScaleMode);
+
+    /**
+     * Sets an image for this brush.
+     *
+     * @param aImage            Texture image for this brush.
+     * 
+     * @see SetBorders() 	    Call this if the image also includes 
+     * 							borders.
+     */
+    IMPORT_C void SetImage(const TAlfImage& aImage);
+    
+    /**
+     * Returns the brush image.
+     */
+    IMPORT_C const TAlfImage& Image() const;
+
+	/**
+	 * Define widths and heights for the borders of this image brush.
+	 * Note that image won't be scaled if this brush has borders.
+     *
+     * @param aLeftBorderWidth  Specifies if this image brush should also
+     * 							draw a left border. Positive values specify
+     * 							border the visuals left edge 
+     * 							(extending the effective area of the visual),
+     * 							negative values specify border inside the
+     * 							area defined by the visual (visuals effective 
+     * 							area is not extended).
+     * 
+     * 							Also the absolute value defines the width 
+     * 							of the left border section of the image, 
+     * 							in pixel columns. 
+     * 							
+     * 							Set to zero to draw without border.
+     *
+     * @param aRightBorderWidth Specifies if this image brush should also
+     * 							draw a right border. Positive values specify
+     * 							border outside the visuals right 
+     * 							edge (extending the effective area of the 
+     * 							visual), negative values specify border inside 
+     * 							the	area defined by the visual (visuals 
+     * 							effective area is not extended).
+     * 
+     * 							Also the absolute value defines the width 
+     * 							of the right border section of the image, 
+     * 							in pixel columns. 
+     * 							
+     * 							Set to zero to draw without border.
+     * 
+     * @param aTopBorderHeight  Specifies if this image brush should also
+     * 							draw a top border. Positive values specify
+     * 							border on top of the visuals top edge 
+     * 							(extending the effective area of the visual),
+     * 							negative values specify border inside the
+     * 							area defined by the visual (visuals effective 
+     * 							area is not extended).
+     * 
+     * 							Also the absolute value defines the height 
+     * 							of the top border section of the image, 
+     * 							in pixel rows. 
+     * 							
+     * 							Set to zero to draw without border.
+     *
+     * @param aBottomBorderHeight  Specifies if this image brush should also
+     * 							draw a bottom border. Positive values specify
+     * 							border below the visuals bottom edge 
+     * 							(extending the effective area of the visual),
+     * 							negative values specify border inside the
+     * 							area defined by the visual (visuals effective 
+     * 							area is not extended).
+     * 
+     * 							Also the absolute value defines the height 
+     * 							of the top border section of the image, 
+     * 							in pixel rows. 
+     * 							
+     * 							Set to zero to draw without border.
+     * 
+     * 
+	 */                           
+	IMPORT_C void SetBorders(TInt aLeftBorderWidth = 0,
+                             TInt aRightBorderWidth = 0,
+                             TInt aTopBorderHeight = 0,
+                             TInt aBottomBorderHeight = 0);
+
+	/**
+	 * Returns true if borders should be drawn.
+	 */
+	IMPORT_C TBool BorderDrawingEnabled() const;
+
+	/**
+	 * Returns true if center should be also be drawn (not just borders).
+	 */
+	IMPORT_C TBool CenterDrawingEnabled() const;    
+    
+    /** 
+     * Sets relative offset for scaled images.
+     * 
+     * @param aOffset relative offset Default value is (0,0).
+     *                (0.5,1) moves the brush half the visual width right
+     *                and the visual height downwards.
+     */
+    IMPORT_C void SetOffset(const TAlfTimedPoint& aOffset);
+    
+    /** 
+     * Gets relative offset for scaled images.
+     * @return relative offset
+     */
+    IMPORT_C const TAlfTimedPoint& Offset() const;
+    
+    /** 
+     * Sets uniform scale factor for the image. 
+     * Note that image won't be scaled if this brush has borders.
+     *
+     * @param aScale Scale factor. Value 1 is default.
+     *               2 means double the size and 0.5 half the size.
+     */
+    IMPORT_C void SetScale(const TAlfTimedValue& aScale);
+    
+    /** 
+     * Gets uniform scale factor for the image. 
+     * @return aScale Scale factor
+     */
+    IMPORT_C const TAlfTimedValue& Scale() const;
+        
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfImageBrush();
+
+
+private:
+
+    /**
+     * 1st pahse constructor.
+     */
+    CAlfImageBrush();
+
+    /**
+     * 1nd pahse constructor.
+     */
+    void ConstructL(CAlfEnv& aEnv, const TAlfImage & aImage);
+
+private:
+
+    // Private data. Owned.
+    struct TImageBrushPrivateData;
+    TImageBrushPrivateData* iImageBrushData;
+
+    };
+
+    
+#endif // C_ALFIMAGEBRUSH_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfimageloaderutil.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,216 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Utility for creating textures from skin graphics
+*
+*/
+
+
+
+#ifndef C_AlfIMAGELOADERUTIL_H
+#define C_AlfIMAGELOADERUTIL_H
+
+#include <AknsUtils.h>
+#include <AknIconUtils.h>
+#include <alf/alftexturemanager.h>
+
+class CAlfImageLoader;
+class MAlfBitmapProvider;
+class CAlfTextureManager;
+
+/**
+ * CAlfImageLoaderUtil is a utility class to create image loader with the system skin 
+ * applied. CAlfImageLoaderUtil holds all MAlfBitmapProvider instance created through
+ * CreateImageLoaderL() so that appplication/control does not need to keep it by itself.
+ * 
+ * Typically, an application or a control needs to hold instance of CAlfImageLoaderUtil
+ * during entire its object life time, because bitmap provision callback from texture
+ * manager may be called even after instanciation of texture. For instance, image re-loading
+ * happens when application coming back to foreground and resource was released.
+ *  * 
+ * Usage:
+ * 
+ * @code
+ *  // Create ImageLoaderUtil
+ * CAlfImageLoaderUtil* imageloader = new ( ELeave ) CAlfImageLoaderUtil();
+ * 
+ * //To create svgImageLoader
+ * MAlfBitmapProvider* bitmapprovider = imageloader->CreateSVGImageLoaderL( svgfilename );	
+ * 
+ * //Create texture using bitmap provider istance
+ * CAlfTexture* texture = iTextureMgr->CreateTexture( 42, *bitmapprovider, EAlfTextureFlagDefault );
+ * 
+ * //Use texture to create image istance
+ * TAlfImage image( *texture );
+ * 
+ * //To create iconbased bitmap provider
+ * bitmapprovider = imageloader->createImageLoader( iconUid, EAknsAppIconTypeList );
+ * 
+ * //Cleanup
+ *  delete imageloader
+ *  delete bitmapprovider;
+ * @endcode
+ * 
+ * @see CAlfTextureManager::CreateTexture()
+ * 
+ * @lib alfclient.lib
+ * @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfImageLoaderUtil ): public CBase
+	{
+public:
+	/**
+	 * Constructor
+	 */
+	IMPORT_C CAlfImageLoaderUtil();
+
+	/**
+	 * Deconstructor
+	 */
+	IMPORT_C ~CAlfImageLoaderUtil();
+	
+	/**
+     * Create MAlfBitmapProvider instance to load image with Avkon skin item ID with 
+     * fallback. The fallback is used when the current skin does not contain the image with 
+     * skin item ID. If either fails, this leaves.
+     * Use CAlfTextureManager::CreateTextureL() with return value of this method as a
+     * bitmap provider to create a Alf texture. You can set the size of the provided bitmap
+     * in pixels using SetSize().
+     *
+     * @param aID  An Akvon skin item ID of the graphical item (e.g. an icon) to load.
+     * @param aFileName  File name of graphics file e.g. mif file) when sepcified item is not found in the current skin.
+     * @param aBitmapId  ID of the bitmap when fallback is used.
+     * @param aMaskId  ID of the mask bitmap when fallback is used.
+     */
+	IMPORT_C MAlfBitmapProvider* CreateImageLoaderL(const TAknsItemID &aID, const TDesC &aFileName, TInt aBitmapId, TInt aMaskId);
+
+	/**
+     * Create MAlfBitmapProvider instance to load frame image with Avkon skin item ID 
+     * Use CAlfTextureManager::CreateTextureL() with return value of this method as a
+     * bitmap provider to create a Alf texture. 
+     *
+     * @param aFrameID  An Avkon skin item ID of the graphical frame item to load.
+     * @param aInnerRect Inner rect of the frame
+     * @param aOuterRect Outer rect of the frame
+     */
+	IMPORT_C MAlfBitmapProvider* CreateImageLoaderL(const TAknsItemID &aFrameID, const TRect& aInnerRect, const TRect& aOuterRect);
+
+    /**
+     * Create MAlfBitmapProvider instance to load Application icon image.
+     * Use CAlfTextureManager::CreateTextureL() with return value of this method as a
+     * bitmap provider to create a Alf texture. You can set the size of the provided bitmap
+     * in pixels using SetSize().
+     *
+     * @param aAppUid  Application UID of the icon to be created.
+     * @param aType  Type of the application icon. Likely EAknsAppIconTypeContext is used...
+     */
+	IMPORT_C MAlfBitmapProvider* CreateImageLoaderL(TUid aAppUid, TAknsAppIconType aType);
+
+
+    /**
+     * Create MAlfBitmapProvider instance to load an SVG Image
+     * Use CAlfTextureManager::CreateTextureL() with return value of this method as a
+     * bitmap provider to create a Alf texture. You can set the size of the provided bitmap
+     * in pixels using SetSize(). This function works only with true SVG-T files.
+     *
+     * @param aFilename  Filename of the SVG file to load. If filename does not contain full path
+     * then path is taken from primary env default texturemanager image path. 
+     * 
+     */
+	IMPORT_C MAlfBitmapProvider* CreateSVGImageLoaderL(const TDesC &aFileName);
+
+    /**
+     * Set size of the image to be loaded. This must be called before calling CreateImageLoaderL.
+     * This call only sets information and does *NOT* cause any scalable icon rasterization. Also
+     * Size setting does not affect any of image loaders already created.
+     *
+     * @param aSize     Size in pixel.
+     * @param aMode     Scaling mode enumeration from Avkon. It takes either of following three.
+     *                    EAspectRatioPreserved
+     *                    EAspectRatioPreservedAndUnusedSpaceRemoved
+     *                    EAspectRatioNotPreserved
+     *
+     */
+	IMPORT_C void SetSize(TSize aSize, TScaleMode aMode=EAspectRatioPreserved);
+
+    /**
+     * Set skin instance, which is acquired from AknsUtils::SkinInstance(). If skin instance
+     * is not explicitly set with this method, the image loader will use skin instance from 
+     * AknsUtils::SkinInstance().
+     *
+     * @param aSkinInstance     An Avkon skin instamce.
+     */
+	IMPORT_C void SetSkinInstance(MAknsSkinInstance *aSkinInstance);
+
+protected:
+
+	/** An array to hold all loader created. */
+	RPointerArray<CAlfImageLoader> iImageLoaderList;
+
+private:
+	/** Skin instance. */
+	MAknsSkinInstance *iSkinInstance;
+	
+	/** Size of image to be created */
+	TSize iSize;
+	
+	/** Scale mode of image to be created */
+	TScaleMode iScaleMode;
+		
+	};
+
+
+/**
+ * CAlfAutoSizeImageLoaderUtil is an extended image loader utility class.
+ * This class can automatically keep track of the preferred sizes for
+ * textures and their bitmap providers and thus always provide correct size 
+ * bitmaps.
+ * 
+ * Example of use:
+ * 
+ * @code
+ *
+ * // Create CAlfAutoSizeImageLoaderUtil
+ * iImageloader = new (ELeave) CAlfAutoSizeImageLoaderUtil;
+ *
+ * // Register CAlfAutoSizeImageLoaderUtil as autosize observer
+ * texturemanager->AddAutoSizeObserverL(iImageloader); 
+ *
+ * // Create provider for a skin item
+ * MAlfBitmapProvider* imageprovider = iImageloader->CreateImageLoaderL(SkinID(), 
+ *      FallbackFileName(),
+ *      FallbackBitmapId(),
+ *      FallbackMaskId());            
+ * 
+ * // Create a texture using provider, set autosize flags to enable automatic texture resizing.
+ * texturemanager->CreateTextureL(KAlfAutoGeneratedTextureId,
+ *     imageprovider,
+ *     EAlfTextureFlagAutoSize);
+ * 
+ * @endcode
+ */
+NONSHARABLE_CLASS( CAlfAutoSizeImageLoaderUtil ): public CAlfImageLoaderUtil, public MAlfTextureAutoSizeObserver
+    {
+public:
+    /**
+     * Constructor
+     */
+    IMPORT_C CAlfAutoSizeImageLoaderUtil();
+    
+private:
+    // From MAlfTexturePreferredSizeObserver
+    IMPORT_C TBool PreferredSizeChanged(const CAlfTexture& aChangedTexture, TSize aPreferredSize);
+        
+    };
+
+#endif // C_AlfIMAGELOADERUTIL_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfimagevisual.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,350 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Image visual displays an image.
+*
+*/
+
+
+
+#ifndef C_ALFIMAGEVISUAL_H
+#define C_ALFIMAGEVISUAL_H
+
+#include <alf/alfvisual.h> 
+#include <alf/alfgc.h> 
+
+class TAlfImage;
+class TRgb;
+struct TAlfMetric;
+struct TAlfXYMetric;
+
+/**
+ * Image visual displays an image.
+ *
+ * An image visual can be used to display portions of CAlfTextures on the UI.
+ * Crossfading between two images in a single image visual is possible.
+ * The secondaryAlpha property controls the blending between the primary and secondary images 
+ * of the visual. The default value is 0.0, which results in only the primary image being drawn. 
+ * The secondary image is ignored when doing scaling calculations.
+ * 
+ * Usage:
+ * @code
+ * //Create image visual and set image
+ * //It will set primary image for imagevisual
+ * CAlfImageVisual* imagevisual =  CAlfImageVisual::AddNewL( control );
+ * imagevisual->SetImage( iImage );
+ * 
+ * 
+ * //Set secondary image and alpha value for crossfading
+ * imagevisual->SetSecondaryImage( iImage2 );
+ * imagevisual->SetSecondaryAlpha( 0.5 );
+ * 
+ * @endcode
+ * @see TAlfImage
+ * @see CAlfTexture
+ * 
+ * @lib alfclient.lib
+ * @since S60 v3.2
+ */
+class CAlfImageVisual : public CAlfVisual
+    {
+
+public:
+
+    /** @beginAPI */
+
+    /** Image scaling modes. */
+    enum TScaleMode
+        {
+        /** Image is not scaled. It will be drawn at a 1:1 mapping between its texture and the screen pixels.*/
+        EScaleNormal,
+    
+        /** Image is uniformly scaled to fit the width of the visual's area. The aspect
+            ratio of the image is preserved. */
+        EScaleFitWidth,
+        
+        /** Image is uniformly scaled to fit the height of the visual's area. The aspect
+            ratio of the image is preserved. */
+        EScaleFitHeight,
+    
+        /** Image is uniformly scaled to fit the visual's area so that the entire area
+            is covered. The aspect ratio of the image is preserved. */
+        EScaleCover,            
+        
+        /** Image is uniformly scaled to fit the visual's area. The aspect ratio of the 
+            image is not preserved. This is the default scale mode. It allows
+            full control of the appearance of the image by adjusting the 
+            visual's size. */
+        EScaleFit,
+        
+        /** Image is uniformly scaled to fit inside the visual's area. The aspect ratio 
+            of the image is preserved. */
+        EScaleFitInside
+        };
+    
+    /** Color modes. */
+    enum TColorMode
+        {
+        /** Default color mode. */
+        EColorModulate,
+        
+        /** A dimmed color mode will apply fogging to this visual. */
+        EColorDimmed
+        };
+
+    /** @endAPI */        
+        
+    /**
+     * Constructor.
+     */
+    IMPORT_C CAlfImageVisual();
+
+    /**
+     * Second-phase constructor, from CAlfVisual 
+     */
+    IMPORT_C void ConstructL(CAlfControl& aOwner);
+
+    /**
+     * Destructor
+     */
+    IMPORT_C virtual ~CAlfImageVisual();
+
+	/** @beginAPI */
+    
+    /**
+     * Constructs and appends a new image visual to the owner control.
+     *
+     * @param aOwnerControl  Control that will own the new visual.
+     *
+     * @return  The new visual.
+     */
+    IMPORT_C static CAlfImageVisual* AddNewL(CAlfControl& aOwnerControl,
+                                            CAlfLayout* aParentLayout = 0);
+
+
+    /**
+     * Sets the scaling mode for the bitmap.
+     * An unscaled image will be drawn at a 1:1 mapping between its
+     * texture and the screen. A scaled image will be resized to fit the
+     * visual's size exactly.
+     * If unset, the default is EScaleFit.
+     * 
+     * @param aScaleMode The scaling mode of this image visual.
+     */
+    IMPORT_C void SetScaleMode(CAlfImageVisual::TScaleMode aScaleMode);
+    
+    /**
+     * Gets the scaling mode of the Image Visual texture.
+     * Returns the Scalemode set to Image Visual, using SetScaleMode()
+     * Default is EScaleFit.
+     * 
+     * @return Scaling mode of the image visual.
+     * @see SetScaleMode()
+     */
+    IMPORT_C CAlfImageVisual::TScaleMode ScaleMode();
+       
+    /**
+     * Sets the image displayed by the image visual. If no image
+     * has been set for the visual, the visual does not draw anything.
+     *
+     * @note You may call SetImage also with images(/textures) that have not
+     * been loaded (yet). The toolkit has been designed so that SetImage()
+     * can be called before the texture has been finished loading. In the
+     * meantime, a placeholder could be used. In other words, the CAlfTexture
+     * that the TAlfImage refers to does need to exist but it doesn't have to
+     * be loaded yet.
+     *
+     * @note Redrawing of the visual happens automatically after SetImage() has
+     * been called.
+     * @note Redrawing also happens automatically when a texture has been fully
+     * loaded by the texture manager. The manager notifies the environment,
+     * which issues a full display redraw.
+     *
+     * @param aImage Primary image to be visualized.
+     */
+    IMPORT_C void SetImage(const TAlfImage& aImage); 
+
+    /**
+     * Sets the secondary image displayed by the image visual.
+     *
+     * The reason there are two images is to make crossfading simpler from
+     * the application's point of view. The blending ratio between the images
+     * is controlled with the timed value iSecondaryAlpha of CAlfImageVisual.
+     *
+     * If iSecondaryAlpha is zero (the default), the secondary image will not be
+     * drawn. When iSecondaryAlpha increases, the secondary image becomes
+     * gradually visible as its opacity increases.
+     *
+     * When crossfading is not needed, SetSecondaryImage() and iSecondaryAlpha
+     * can be ignored.
+     *
+     * @see SetImage()
+     * @see SetSecondaryAlpha()
+     */
+    IMPORT_C void SetSecondaryImage(const TAlfImage& aImage);
+
+    /** 
+     * Sets alpha for the secondary image. If one, the primary image is not
+     * visible at all. 
+     * @param aAlpha Alpha value for the image  
+     */
+    IMPORT_C void SetSecondaryAlpha(const TAlfTimedValue& aAlpha);
+
+    /** 
+     * Gets alpha for the secondary image. 
+     * @return Alpha value for the image  
+     */
+    IMPORT_C TAlfTimedValue SecondaryAlpha();
+
+    /**
+     * Returns the image of the visual.
+     */
+    IMPORT_C const TAlfImage& Image() const;
+
+    /**
+     * Returns the secondary image of the visual.
+     */
+    IMPORT_C const TAlfImage& SecondaryImage() const;
+
+    /**
+     * Sets the color of the image. Defaults to white.
+     */
+    IMPORT_C void SetColor(const TRgb& aColor);
+
+    /**
+     * Sets the color mode of the image. Defaults to modulate.
+     *
+     * @param aColorMode  Color mode.
+     * @param aParam      Parameter for the mode. With blend, specifies the
+     *                    amount of color to blend (0...1). 1.0 will cause
+     *                    the image to be fully blended to the visual's color.
+     */
+    IMPORT_C void SetColorMode(CAlfImageVisual::TColorMode aColorMode, TReal32 aParam = 0.0) __SOFTFP;
+
+    /**
+     * Sets the stretch widths of the image. Set both to zero to disable stretching.
+     * A stretched image will be scaled over the whole width or height of the visual,
+     * except for a band specified by the parameters, which will not be scaled (1:1 pixel mapping).
+     * For doing uniform scaling of an image, use the SetScaleMode API instead.
+     *
+     * @deprecated  Deprecated as an unneeded and broken functionality.
+     *
+     * @param aTop     Top width in pixels.
+     * @param aBottom  Bottom width in pixels.
+     * @see SetStretchMode.
+     * @see CHuiGc::DrawStretchImage
+     */
+    IMPORT_C void SetStretch(TInt aTop, TInt aBottom);
+	
+    /**
+     * Sets the stretch mode of the image.
+     *
+     * @see CHuiGc::DrawStretchImage.
+     * @see Setstretch.
+     * @param aStretchMode  Horizontal or vertical.
+     */
+    IMPORT_C void SetStretchMode(CAlfGc::TStretchMode aStretchMode);
+
+    /**
+     * @deprecated Use CAlfDropShadow
+     * 
+     * Sets the drop shadow distance.
+     *
+     * @deprecated  Use metric unit version instead.
+     *
+     * @param aShadowDistance  Pixels.
+     */
+    IMPORT_C void SetDropShadow(TInt aShadowDistance);
+
+    /**
+     * @deprecated Use CAlfDropShadow
+     *
+     * Sets the drop shadow distance.
+     *
+     * @param aShadowDistance  Set shadow distance in metric units. Both X and Y will use this value.
+     */
+    IMPORT_C void SetDropShadow(const TAlfMetric& aShadowDistance);
+
+    /**
+     * @deprecated Use CAlfDropShadow
+     *
+     * Sets the drop shadow distance.
+     *
+     * @param aShadowDistance  Set shadow distance in metric units.
+     */
+    IMPORT_C void SetDropShadow(const TAlfXYMetric& aShadowDistance);
+
+    /** 
+     * Sets angle for turning the image around its center point. 
+     * @param Turn angle
+     */
+    IMPORT_C void SetTurnAngle(const TAlfTimedValue& aAngle);
+
+    /** 
+     * Gets angle for turning the image around its center point. 
+     * @return Turn angle
+     */
+    IMPORT_C TAlfTimedValue TurnAngle();
+
+    /** 
+     * Sets uniform scale factor for the image. 
+     * @param aScale Scale factor
+     */
+    IMPORT_C void SetScale(const TAlfTimedValue& aScale);
+
+    /** 
+     * Gets uniform scale factor for the image. 
+     * @return aScale Scale factor
+     */
+    IMPORT_C TAlfTimedValue Scale();
+
+    /** 
+     * Sets relative offset for scaled images.
+     * @param aOffset relative offset
+     */
+    IMPORT_C void SetOffset(const TAlfTimedPoint& aOffset);
+
+    /** 
+     * Gets relative offset for scaled images.
+     * @return relative offset
+     */
+    IMPORT_C TAlfTimedPoint Offset();
+
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void RemoveAndDestroyAllD();
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0);
+    IMPORT_C CAlfVisual* FindTag(const TDesC8& aTag);
+
+    /** @endAPI */
+
+protected:
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void DoRemoveAndDestroyAllD();
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+
+private:
+
+	/** Private data */
+    struct TImageVisualPrivateData;    
+    TImageVisualPrivateData* iImageVisualData;
+    };
+
+
+#endif // C_ALFIMAGEVISUAL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfinputcapabilitiessupplier.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Mixin class for objects to interface with the FEP
+*
+*/
+
+
+
+#ifndef C_ALFINPUTCAPABILITIESSUPPLIER_H
+#define C_ALFINPUTCAPABILITIESSUPPLIER_H
+
+#include <e32base.h>
+class TCoeInputCapabilities;
+
+/**
+* This mixin allows objects to be handled within the Alf system to 
+* interface to a FEP.  Objects implementing this mixin are likely to be those
+* implementing editor functionality
+*/ 
+class MAlfInputCapabilitiesSupplier
+    {
+    public:
+
+    /**
+    * The method that will be called by CAlfDisplayCoeControl on the currently focused editor
+    * in its implementation of CCoeControl::InputCapabilities().
+    *
+    * @return   Cone-defined FEP interface structure
+    */
+    virtual TCoeInputCapabilities InputCapabilities() const = 0;
+
+    /**
+    * Extension interface factory
+    */
+    virtual TAny* MAlfInputCapabilitiesSupplier_ExtendedInterface( const TUid& aInterfaceUid ) const = 0;    
+    };
+
+#endif  // C_ALFINPUTCAPABILITIESSUPPLIER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alflayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,547 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Layout base class
+*
+*/
+
+
+
+#ifndef C_ALFLAYOUT_H
+#define C_ALFLAYOUT_H
+
+#include <alf/alfvisual.h> 
+#include <alf/alftimedvalue.h>
+#include <alf/alfmetric.h>
+
+/** Layout types. */
+enum TAlfLayoutType
+    {
+    EAlfLayoutTypeLayout,
+    EAlfLayoutTypeFlow,
+    EAlfLayoutTypeGrid,
+    EAlfLayoutTypeLCTGrid,
+    EAlfLayoutTypeApp,
+    EAlfLayoutTypeAnchor,
+    EAlfLayoutTypeLCTAnchor,
+    EAlfLayoutTypeDeck,
+    EAlfLayoutTypeViewport,
+    EAlfLayoutTypeCurvePath
+    };
+
+/** The default transition time is queried from CAlfStatic. */
+const TInt KAlfLayoutDefaultTransitionTime = -1;
+
+class CAlfControl;
+
+/**
+ *  Base class for all layouts.
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ *
+ * Layouts are visuals that manage the placement of a set of child visuals
+ * (or other layouts).
+ *
+ * Layouts are responsible for setting the positions and sizes of their
+ * child visuals. Each layout can define a position, a size, or both
+ * (or neither) for their children.
+ *
+ * Layouts use the children's ordinal numbers to determine where each of
+ * them should be placed. For example, a grid layout could define that the
+ * top row contains children with ordinals 0..3, from left to right. The
+ * second row could then contain the children 4..7. When the order of the
+ * child visuals changes within their parent layout, the parent layout
+ * will recalculate the positions and sizes of the affected children.
+ *
+ * When the size of a layout changes, it will immediately recalculate the
+ * layout of its children. The transition time that is specified in the
+ * size transition of the layout is used when setting the targets of the
+ * children's new positions and sizes.
+ *
+ * Layouts are able to notify their controls when their size is changed.
+ * These notifications are needed because the size of a layout is not known
+ * until the display is refreshed. This means that the <strong>size of a layout
+ * is not available when your controls ConstructL is executed</strong>, unless
+ * it is explicitly set. The notifications are also handy because they allow
+ * the controls to respond to dynamic screen size changes. So unless if the
+ * whole screen is not used for the layout, the notifications are the only way
+ * to do calculations based on the layout size.
+ *
+ * To make the control receive layout update notifications call:
+ *
+ * <code>
+ * layout->SetFlags(EAlfVisualFlagLayoutUpdateNotification);
+ * </code>
+ *
+ * .. and override VisualLayoutUpdated() method in your control.
+ *
+ * @see SetSize()
+ * @see SetFlags()
+ * @see CAlfControl::VisualLayoutUpdated()
+ *
+ * Each layout defines its own local coordinate system used for interpreting
+ * the positions and sizes of its child visuals. The base unit of the 
+ * coordinate system is defined with the SetBaseUnit() method, which sets a
+ * TAlfXYMetric to use as the basis for all coordinate calculations. The default
+ * metric is [1px, 1px] which corresponds to pixels on the display.
+ *
+ * The local coordinate system of a layout can be mirrored horizontally and/or
+ * vertically by using a negative magnitude in the relevant TAlfMetric of the
+ * base unit. Note that this will only affect the local coordinate system 
+ * of the layout: the contents of the child visuals or child layouts will not 
+ * be mirrored. Visual mirroring should be done with a CAlfTransformation,
+ * and child layouts can be mirrored by further application of the negative
+ * base unit metrics. In order to enable a layout to automatically mirror the 
+ * horizontal component of the base unit based on locale mirroring, set the visual flag 
+ * @c EAlfVisualFlagAutomaticLocaleMirroringEnabled, note that it is necessary
+ * to set this flag for each layout for which this feature is required.
+ *
+ * To create to a fully scalable UI, the appropriate base unit metrics and
+ * layout visuals must be used. For example, the EAlfUnitS60 metric unit is
+ * dependent on the platform-specified measurement units for layout. 
+ * CAlfGridLayout and CAlfAnchorLayout provide support for pixel-independent 
+ * placement of their children.
+ *
+ * @see CAlfAnchorLayout
+ * @see CAlfGridLayout
+ *
+ * Applications that need more complex layouts should derive their own
+ * CAlfLayout based classes that implement the necessary layout calculations.
+ * In many cases, however, a combination of some of the built-in layout classes
+ * such as anchor and grid layouts will be sufficient.
+ */
+class CAlfLayout : public CAlfVisual
+    {
+
+public:
+
+    enum TExpansionFlags
+        {
+        /** Not expanding in any direction. */
+        EExpandNone = 0,
+
+        /** Expands horizontally. */
+        EExpandHorizontally = 1,
+
+        /** Expands vertically. */
+        EExpandVertically = 2
+        };
+
+
+    /**
+     * 2-phased constructor which also gives ownedship to control.
+     *
+     * @param aOwnerControl Control which owns new layout
+     * @param aParentLayout If given, has the parent layout.
+     * @return New object. Ownership NOT returned. Instead given to control.
+     */
+    IMPORT_C static CAlfLayout* AddNewL( CAlfControl& aOwner,
+                                         CAlfLayout* aParentLayout = 0 );
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C CAlfLayout();
+
+    /**
+     * From CAlfVisual. Second-phase constructor.
+     */
+    IMPORT_C void ConstructL( CAlfControl& aOwner );
+
+    /**
+     * Virtual destructor.
+     */
+    IMPORT_C ~CAlfLayout();
+    
+    /**
+     * From CAlfVisual. Removes this layout from its owner and and destroys the layout.
+     * Also removes the entire hierarchy of child visuals and destroys all
+     * of them.
+     */
+    IMPORT_C void RemoveAndDestroyAllD();
+
+    /**
+     * Append a new visual to the layout.
+     *
+     * @param aVisual  Visual to append.
+     * @param aConstructedWithParentInformation Whether visual already knows its parent
+     * @return Error code.
+     *
+     * @todo  Add a method for appending multiple visuals in one set, so that
+     *        they only cause a single layout update.
+     */
+    IMPORT_C TInt Append( CAlfVisual* aVisual, TBool aConstructedWithParentInformation = EFalse, TInt aLayoutTransitionTime = 0 );
+ 
+    /**
+     * Remove a visual from the layout.
+     *
+     * @param aVisual  Visual to remove.
+     * @param aLayoutTransitionTime How long the transition should take visually, in milliseconds.          
+     *
+     * @todo  Add a method for removing multiple visuals in one set, so that
+     *        they only cause a single layout update.
+     */
+    IMPORT_C void Remove( CAlfVisual* aVisual, TInt aLayoutTransitionTime = 0 );
+    
+     /**
+     * Moves the given child visual to specific position in the layout's list
+     * of child visuals. Affects the drawing order (last child is drawn last),
+     * and possibly the final laid out position and size of the visual.
+     * This is due to that many layout implementations calculate the
+     * positioning of their children based on child's order number
+     * in the list.
+     *
+     * Causes layout recalculation.
+     *
+     * @param aVisual    Child visual to move.
+     * @param aPosition  New position (and ordinal number)
+     * 					 in the child list (0 = first, Count()-1 = last).
+     * @see MoveVisualToBack()
+     * @see MoveVisualToFront()
+     */
+    IMPORT_C void Reorder(CAlfVisual& aVisual, TInt aPosition, TInt aLayoutTransitionTime = 0 );
+
+    /**
+     * Moves a child visual to the front of the other children. In other words
+     * the visual is drawn last (on top of the other child visuals). In practise
+     * this affects the order of the visuals whithin this layout so that the
+     * visual is moved at the end of the list.
+     *
+     * Causes layout recalculation.
+     *
+     * @param aVisual  Child visual to move.
+     * @param aLayoutTransitionTime How long the transition should take visually, in milliseconds.          
+     * @see MoveVisualToBack()
+     * @see Reorder()
+     *
+     * @see MoveVisualToFront() - Use this instead!
+     */
+    IMPORT_C void MoveVisualToFront(CAlfVisual& aVisual, TInt aLayoutTransitionTime = 0 );
+
+
+    /**
+     * Moves a child visual behind the other children (in drawing order).
+     * In other words the visual is drawn first (the other child visuals will
+     * be drawn on top of this visual).
+     *
+     * In practise this affects the order
+     * of the visuals whithin this layout so that the visual is moved at
+     * the beginning of the list (ordinal 0).
+     *
+     * @param aVisual  Child visual to move.
+     * @param aLayoutTransitionTime How long the transition should take visually, in milliseconds.          
+     * @see MoveVisualToFront()
+     * @see Reorder()
+     */
+    IMPORT_C void MoveVisualToBack(CAlfVisual& aVisual, TInt aLayoutTransitionTime = 0 );
+
+
+    /**
+     * Returns the number of child visuals in the layout.
+     *
+     * @return Child visual count.
+     */
+    IMPORT_C TInt Count() const;
+    
+    /**
+     * Returns a child visual.
+     *
+     * @param aIndex  Index of the child visual.
+     *
+     * @return  Reference to a child visual.
+     */
+    IMPORT_C CAlfVisual& Visual( TInt aIndex ) const;
+    
+    /**
+     * Enables or disables scrolling in the layout.
+     *
+     * @param aScrolling  ETrue to enable scrolling,
+     *                    EFalse to disable.
+     */
+    IMPORT_C void EnableScrollingL(TBool aScrolling = ETrue);
+    
+    /**
+     * Is scrolling in the layout.
+     *
+     * @return ETrue if scrolling is enabled.
+     */
+    IMPORT_C TBool Scrolling() const;
+
+    /**
+     * Returns the scroll offset of the layout. The scroll offset is in
+     * layout's base units.
+     *
+     * @return  Reference to timed point that defines the scroll offset.
+     */
+    IMPORT_C const TAlfTimedPoint& ScrollOffset() const;
+    
+    /**
+     * Set the scroll offset
+     *
+     * @param aPoint Sets the point.
+     */
+    IMPORT_C void SetScrollOffset(const TAlfTimedPoint& aPoint);
+     
+
+    /**
+     * Determines the layout ordinal for a child visual. The child's placement
+     * depends on the ordinal number.
+     *
+     * @param aIndex  Index of the child visual.
+     */
+    IMPORT_C TInt ChildOrdinal(TInt aIndex);
+
+    /**
+     * Determines the position of a child visual according to the layout.
+     *
+     * @param aOrdinal  Layout ordinal of the child visual.
+     * @param aPos      New position for the child.
+     *
+     * @return  <code>ETrue</code>, if a new position was determined.
+     *          Otherwise, <code>EFalse</code> is returned and no position
+     *          changes are needed.
+     */
+    IMPORT_C TBool ChildPos(TInt aOrdinal, TPoint& aPos);
+
+    /**
+     * Determines the size of a child visual according to the layout.
+     *
+     * @param aOrdinal  Layout ordinal of the child visual.
+     * @param aSize     New target size for the child.
+     *
+     * @return  <code>ETrue</code>, if a new size was determined. Otherwise,
+     *          <code>EFalse</code> is returned and no size changes are
+     *          needed.
+     */
+    IMPORT_C TBool ChildSize(TInt aOrdinal, TSize& aSize);
+    
+     /**
+     * @from CAlfVisual
+     * Update the layout of all children. Subclasses can call this to
+     * recalculate the layout of all children.
+     *
+     * @param aTransitionTime  Time for layout transition in milliseconds.
+     *                         Any negative value uses value given in 
+     *                         CAlfEnv::StaticSetLayoutTransitionTime()
+     */
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0); 
+    
+    /**
+     * @from CAlfVisual
+     * Finds a visual whose tag descriptor contains a specific tag.
+     *
+     * CAlfLayout::FindTag() extends the search into child visuals,
+     * covering recursively entire visual hierarchies.
+     * 
+     * @param aTag  Tag to look for. If this tag is found as a part of a
+     *              visual's colon-separated tag descriptor, it is treated
+     *              as a match and the visual is returned. The tag to look
+     *              for cannot contain separator characters (:).
+     *
+     * @return  Visual whose tag descriptor matches the tag. <code>NULL</code>,
+     *          if no such visual could be found. 
+     *
+     * Todo: how should several visuals with matching tag to be handled ??
+     *
+     * @see CAlfVisual::Tag()
+     * @see CAlfVisual::SetTagL()
+     * @see CAlfVisual::IsTagged()
+     * @see CAlfVisual::FindTag()
+     */
+    IMPORT_C CAlfVisual* FindTag(const TDesC8& aTag);
+
+    /**
+     * Sets the transition time for the recalculation of this layout's
+     * contents. This is used when a visual is added or removed or when
+     * the order of the children is changed.
+     *
+     * Set to KAlfLayoutDefaultTransitionTime to make the layout use the
+     * default transition time queried from CAlfStatic.
+     *
+     * @param aTransitionTime  Transition time in milliseconds, or
+     *                         KAlfLayoutDefaultTransitionTime.
+     */
+    IMPORT_C void SetTransitionTime(TInt aTransitionTime);
+
+    /**
+     * Returns the transition time of this layout.
+     *
+     * @return  Transition time in milliseconds, or
+     *          KAlfLayoutDefaultTransitionTime.
+     *
+     * @see CAlfLayout::SetTransitionTime()
+     */
+    IMPORT_C TInt TransitionTime() const;
+    
+    /**
+     * Determines the virtual size of the layout. The virtual size may be
+     * larger than the actual size. The virtual size is updated automatically
+     * when the layout's children are positioned.
+     *
+     * @return  Virtual size.
+     */
+    IMPORT_C TSize VirtualSize() const;
+
+    /**
+     * Sets the inner padding of the layout. This is typically the amount
+     * of empty space between child visuals in the layout.
+     *
+     * @note that the left and right paddings will be the same, and the top and bottom
+     *      paddings will be the same.
+     * @deprecated migrate to using metrics instead
+     * @param aInnerPadding  Inner padding (e.g., column, row separation).
+     */
+    IMPORT_C void SetInnerPadding(const TPoint& aInnerPadding);
+
+    /**
+     * Sets the inner padding of the layout. This is typically the amount
+     * of empty space between child visuals in the layout.
+     *
+     * @note as paddings are relative to the layout visual, if relative units are required, 
+     * it is advisable to use EAlfUnitRelativeToMySize so that the paddings are relative
+     * to the size of this layout visual
+     *
+     * @param aInnerPadding  Inner padding, using metrics.
+     */
+    IMPORT_C void SetInnerPadding(const TAlfXYMetric& aInnerPadding);
+
+    /**
+     * Returns the inner padding.
+     * @deprecated this will return correct pixel values only if paddings were set 
+     *      using deprecated pixel based APIs, so migrate to using metrics instead
+     */
+    IMPORT_C TPoint InnerPadding() const;
+
+    /**
+     * Returns the inner padding metric
+     * @see InnerPadding() which is superceded by this method
+     */
+    IMPORT_C const TAlfXYMetric& InnerPaddingAsMetric() const;
+
+    /**
+     * Returns the inner horizontal padding.
+     *
+     * @deprecated this will return correct pixel values only if paddings were set 
+     *      using deprecated pixel based APIs, so migrate to using metrics instead
+     */
+    IMPORT_C TInt HorizontalInnerPadding() const;
+
+    /**
+     * Returns the inner vertical padding.
+     *
+     * @deprecated this will return correct pixel values only if paddings were set 
+     *      using deprecated pixel based APIs, so migrate to using metrics instead
+     */
+    IMPORT_C TInt VerticalInnerPadding() const;
+    
+    /**
+     * Returns the inner padding converted to the base units of this layout.
+     * These can be summed with the positions and sizes of the layout's children.
+     */
+    IMPORT_C TAlfRealPoint InnerPaddingInBaseUnits() const;
+    
+    /**
+     * Finds a visual's index.
+     *
+     * @param aVisual  Visual to look for.
+     *
+     * @return  Index of the visual, or <code>KErrNotFound</code>.
+     */
+    IMPORT_C TInt FindVisual(CAlfVisual* aVisual) const;
+
+    /**
+     * Insert a new visual to the layout, at specified position (position 0 is the first,
+     * Count() -1 is the last). If the visual is already a member of
+     * some other layout, it will be removed from the old layout first.
+     *
+     * @param aVisual  Visual to append.
+     * @param TInt     Position to insert. This is the new ordinal number of the visual.
+     * @return Error code
+     */
+    IMPORT_C TInt Insert(CAlfVisual* aVisual, TInt aPosition);
+    
+    /**
+     * Layout is calculated according the ordinals. The effective ordinal
+     * may not be the same as the real child ordinal, because some visuals
+     * are laid out manually.
+     *
+     * @return  Effective ordinal for the child visual.
+     */
+    IMPORT_C TInt EffectiveLayoutOrdinal(const CAlfVisual& aVisual) const;
+
+    /**
+     * Defines the base unit used for positioning and sizing children
+     * within this layout. For example, the actual X position of a child is 
+     * determined by <tt>aBaseUnit.iX * childX</tt>. The effect of the 
+     * base unit is limited to the children of this layout -- the 
+     * grandchildren use the base units of their parents, not this base unit.
+     * 
+     * @note It is recommended to use EAlfUnitNormalized if proportional base units are 
+     * required. For example, EAlfUnitRelativeToMySize would not make sense as a base 
+     * unit.
+     *
+     * @param aMetric  Metric that will be used for both X and Y axes.
+     */
+    IMPORT_C void SetBaseUnit(const TAlfMetric& aBaseUnit);
+
+    /**
+     * Defines the base unit used for positioning and sizing children
+     * within this layout. For example, the actual X position of a child is 
+     * determined by <tt>aBaseUnit.iX * childX</tt>. The effect of the 
+     * base unit is limited to the children of this layout -- the 
+     * grandchildren use the base units of their parents, not this base unit.
+     * 
+     * @param aMetric  Metric to use as the base unit.
+     */
+    IMPORT_C void SetBaseUnit(const TAlfXYMetric& aBaseUnit);
+       
+    /**
+     * Returns the layout's base measurement unit. The positions and sizes
+     * of the children of this layout are interpreted as multiples of this
+     * base unit.  For example, the actual X position of a child is 
+     * determined by <tt>aBaseUnit.iX * childX</tt>. 
+     *
+     * The effect of the base unit is limited to the children of this layout 
+     * -- the grandchildren use the base units of their parents, not this 
+     * base unit.
+     *
+     * @note that if the visual flag @c EAlfVisualFlagAutomaticLocaleMirroringEnabled
+     * is set, the value returned by this method will change based on the current platform
+     * locale mirroring in the X-axis. So for example if the current layout is mirrored, then
+     * the value returned by this method will have the X magnitude set to the negative
+     * of the value that was set using @c SetBaseUnit.
+     *
+     * @return Metric used as the base unit for child coordinates and sizes.
+     */
+    IMPORT_C virtual TAlfXYMetric BaseUnit() const;
+
+protected:
+
+    /**
+     * @from CAlfVisual
+     * Deletes the child visuals
+     */
+    IMPORT_C void DoRemoveAndDestroyAllD();
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private:
+    
+    // Private structure. Owned.
+    struct TLayoutPrivateData;
+    TLayoutPrivateData* iLayoutData;
+
+    };
+
+
+#endif // C_ALFLAYOUT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alflinevisual.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,201 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Line visual
+*
+*/
+
+
+
+
+#ifndef C_ALFLINEVISUAL_H
+#define C_ALFLINEVISUAL_H
+
+#include <alf/alfvisual.h>
+#include <alf/alfownership.h>
+
+class CAlfControl;
+class CAlfLayout;
+class CAlfCurvePath;
+class MAlfMappingFunction;
+class TAlfImage;
+class TRgb;
+
+
+/**
+ * Line visual draws a line along a curve path.
+ *
+ * A line visual will draw a bendy line that follows a specified
+ * curve path. Width and alpha functions can be set to change the
+ * opacity and thickness of the line along its length.
+ *
+ * Note that the Bitgdi renderer contains only a minimal implementation
+ * of line drawing. There is no aliasing or shading on the line, and
+ * thickness and alpha functions have no effect. The entire thickness of a Bitgdi
+ * line is set by the initial thickness at point 0.
+ * Usage:
+ * 
+ * @code
+ * 
+ * //Create curvepath, which can be used as a path for linevisual
+ * CAlfCurvePath* path = CAlfCurvePath::NewL( &iEnv );
+ * path->AppendArcL( TPoint(120, 120), TSize(60, 60), 180, 180 + 270, 0.5 );
+ * path->AppendLineL( TPoint(120, 180), TPoint(20, 180), 0.5 );
+ * 
+ * //Create linevisual
+ * CAlfLineVisual* line = CAlfLineVisual::AddNewL( control );
+ * //set curvepath instance, with ownership transfered to visual
+ * line->SetPath( path, EAlfHasOwnership );
+ * 
+ * //Line opacity function. Line visuals can use a mapping function to determine the opacity
+ * //of the line along the path. 
+ * //member variable : LinearMappingFunction linearFunc;
+ * linearFunc.SetFactor( 1 );
+ * //setlinevisual alpha function
+ * line->SetAlphaFunction( &linearFunc );
+ * 
+ * //Similerly, line visuals can use a mapping function to determine the width of the
+ * //line along the path. 
+ * linearFunc.SetFactor( 60 );
+ * line->SetWidthFunction( &linearFunc ); * 
+ * 
+ * @endcode
+ * 
+ * @lib alfclient.lib
+ * @since S60 v3.2
+ * @see CAlfCurvePath
+ */
+
+class CAlfLineVisual : public CAlfVisual
+    {
+
+public:
+    
+    /**
+     * Constructor, which gives ownership to the control.
+     *
+     * @param aOwnerControl The control
+     * @param aParentLayout If given, the parent layout.
+     * @return New instance. Ownership NOT transreffed (owned by control)
+     */
+    IMPORT_C static CAlfLineVisual* AddNewL(CAlfControl& aOwnerControl,
+                                            CAlfLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C CAlfLineVisual();
+
+    /**
+     * Second-phase constructor.
+     */
+    IMPORT_C void ConstructL(CAlfControl& aOwner);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CAlfLineVisual();
+
+    /**
+     * Sets the path instance of the visual.
+     *
+     * @param aPath
+     * @param aOwnership
+     */
+    IMPORT_C void SetPath(CAlfCurvePath* aPath, TAlfOwnership aOwnership);
+
+    /**
+     * Returns the path of the visual. The path can be modified via this
+     * reference.
+     *
+     * @return Path. NULL if not set.
+     */
+    IMPORT_C CAlfCurvePath* Path();
+
+    /**
+     * Sets the image used by the line.
+     */
+    IMPORT_C void SetImage(const TAlfImage& aImage);
+    
+    /**
+     * Returns the image used by the line.
+     */
+    IMPORT_C const TAlfImage& Image() const;
+
+    /**
+     * Sets the alpha mapping function that generates alpha values for the
+     * path.
+     */
+    IMPORT_C void SetAlphaFunction(MAlfMappingFunction* aFunction);
+
+    /**
+     * Sets the width mapping function that generates width values for the
+     * path.
+     */
+    IMPORT_C void SetWidthFunction(MAlfMappingFunction* aFunction);
+
+    /** 
+     * Thickness of the line. 
+     */
+    IMPORT_C const TAlfTimedValue& Thickness() const;
+    IMPORT_C void SetThickness( const TAlfTimedValue& aThickness );
+
+    /** 
+     * Thickness of the shadow around the line. 
+     */
+    IMPORT_C const TAlfTimedValue& ShadowThickness() const;
+    IMPORT_C void SetShadowThickness( const TAlfTimedValue& aShadowThickness );
+
+    /** 
+     * Current start position on the path. 
+     */
+    IMPORT_C const TAlfTimedValue& StartPos() const;
+    IMPORT_C void SetStartPos( const TAlfTimedValue& aStartPos );
+
+    /** 
+     * Current end position on the path.
+     */
+    IMPORT_C const TAlfTimedValue& EndPos() const;
+    IMPORT_C void SetEndPos( const TAlfTimedValue& aEndPos );
+    
+    /**
+     * Sets the color of the line.
+     */
+    IMPORT_C void SetColor(const TRgb& aColor);
+
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void RemoveAndDestroyAllD();
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0);
+    IMPORT_C CAlfVisual* FindTag(const TDesC8& aTag);
+
+
+protected:
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void DoRemoveAndDestroyAllD();
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+
+private: // data
+
+    struct TLineVisualPrivateData;
+    TLineVisualPrivateData* iLineVisualData;
+
+    };
+
+#endif // C_ALFLINEVISUAL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfm3gmesh.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   M3G Mesh definition
+*
+*/
+
+
+
+#ifndef C_ALFM3GMESH_H
+#define C_ALFM3GMESH_H
+
+#include <alf/alfmesh.h>
+
+// ID for Animating all controllers
+const TInt KAlfM3GAnimateAllControllers = 100000;  
+
+/**
+ *  M3G Mesh support.
+ *
+ *  This is a CAlfMesh - derived mesh implementation that supports M3G
+ *  scene graph loading and integration into the UI. This mesh can
+ *  be used through CAlfMeshVisual and created with CAlfMeshVisual::CreateMeshL()
+ *  method with argument EAlfMeshTypeM3G.
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfM3GMesh ): public CAlfMesh
+    {
+
+public:
+
+    /**
+     * Constructs a new CAlfM3G mesh instance.
+     */
+    static CAlfM3GMesh* NewL( CAlfGenComponent& aComms, CAlfEnv& aEnv );
+
+    /**
+     * Destructor
+     */
+    ~CAlfM3GMesh();
+
+    /**
+     * Loads an M3G scene graph from an M3G file. The M3G mesh scene graph is loaded 
+     * from the file given as a parameter. 
+     * If the filename string is malformed and does not adhere to
+     * file path syntax this method leaves with KErrBadName error code.
+     * If the file path is not found this method leaves with KErrPathNotFound error code.
+     * Notice that CAlfTextureManager::ImagePath() is prepended to the filename before
+     * loading the M3G file.
+     * If the specified file is not found this method leaves with KErrNotFound error code.
+     * If the M3G file does not contain any M3G objects or is corrupted this method
+     * leaves with KErrCorrupt error code. In case the M3G scene graph loading fails
+     * due to any of the errors listed above the loaded M3G scene graph and any created
+     * resources due to the commenced loading are released. This means that no partially
+     * loaded M3G content can be accessed through this object.
+     * 
+     *
+     * @param aFileName Path to the M3G file from which the M3G scene graph is loaded
+     *                  into this M3G mesh. The texture image path is prepended to this
+     *                  resource file name. @see CHuiTextureManager::ImagePath().
+     */	
+	IMPORT_C virtual void LoadSceneL(const TDesC &aFileName);    
+
+private:
+
+    /**
+     * Constructor
+     */
+    CAlfM3GMesh();
+
+    /**
+     * Second phase constructor
+     */
+    void ConstructL( CAlfGenComponent& aComms, CAlfEnv& aEnv );
+
+private: // data
+
+    struct TM3GMeshPrivateData;
+    TM3GMeshPrivateData* iData;
+
+    };
+
+
+#endif // C_ALFM3GMESH_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfmappingfunctions.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,391 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Alf mapping functions
+*
+*/
+
+
+
+#ifndef M_ALFMAPPINGFUNCTIONS_H
+#define M_ALFMAPPINGFUNCTIONS_H
+
+#include <e32base.h>
+#include <alf/alftimedvalue.h>
+
+class CAlfEnv;
+
+/**
+ * Mapping function interface. 
+ * Timed values use this interface for mapping
+ * the return value of a timed value evaluation. Can be used to define
+ * custom interpolation functions for example timed values.
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+class MAlfMappingFunction
+    {
+
+public:
+
+    /**
+     * Perform the mapping. Defines a function y = f(x, mode).
+     *
+     * Implement this method that calculates a output value for
+     * a timed value based on the input value and a component/mode
+     * parameter.
+     *
+     * For example the aValue input could be an angle, and the aMode
+     * could be a X or Y component enumeration, then the MapValue could
+     * calculate return a x or y position on a curve path.
+     *
+     * @param aValue      Unmapped value.
+     * @param aMode       Mapping mode used for mapping this value.
+     *
+     * @return  Mapped value.
+     */
+    virtual TReal32 MapValue(TReal32 aValue, TInt aMode) const __SOFTFP = 0;
+    
+    /**
+     * Returns the mapping function identifier on the server side.
+     */ 
+    virtual TInt MappingFunctionIdentifier() const = 0;
+    
+    };
+    
+    
+/**
+ * Constant value mapping function. 
+ *
+ * Does not implement change flags, which means that if iValue is changed 
+ * while the mapping function is in use, timed values will not notify the 
+ * change.
+ * Usage:
+ * @code
+ * //Create constant mapping function instant
+ * CAlfConstantMappingFunction* imageXposMappingFun = CAlfConstantMappingFunction::NewL(*iEnv);  
+ * 
+ * TAlfTimedPoint timedPoint;
+ * //Set mapping function on x timed value
+ * timedPoint.iX.SetValueNow(0); 
+ * timedPoint.iX.SetTarget( 2000 );
+ * timedPoint.iX.SetMappingFunctionIdentifier( imageXposMappingFun->MappingFunctionIdentifier() );
+ * 
+ * //Set mapping function on Y timed value
+ * timedPoint.iY.SetValueNow(0); 
+ * timedPoint.iY.SetTarget(2000);
+ * timedPoint.iY.SetMappingFunctionIdentifier( imageYposMappingFunction->MappingFunctionIdentifier() );
+ * //Set position of image visual
+ * iImageVisual->SetPos( timedPoint );   
+ * @endcode
+ */
+class CAlfConstantMappingFunction : public CBase, public MAlfMappingFunction
+    {
+public:
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C static CAlfConstantMappingFunction* NewL( 
+        CAlfEnv& aEnv, 
+        TReal32 aValue = 0.0 ) __SOFTFP;
+    IMPORT_C ~CAlfConstantMappingFunction();
+    
+    /* implements MAlfMappingFunction */
+    TReal32 MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP;
+    
+    /* implements MAlfMappingFunction */
+    TInt MappingFunctionIdentifier() const;
+    
+    IMPORT_C void SetValue( TReal32 aValue ) __SOFTFP;
+    IMPORT_C TReal32 Value() const __SOFTFP;
+    
+private:
+
+    CAlfConstantMappingFunction();
+    void ConstructL( CAlfEnv& aEnv, TReal32 aValue );
+
+private:
+
+    struct TPrivateData;
+    TPrivateData* iData;
+    
+    };
+    
+/**
+ * Linear mapping function.
+ *
+ * Does not implement change flags, which means that if iFactor or iOffset 
+ * is changed while the mapping function is in use, timed values will 
+ * not notify the change.
+ */
+class CAlfLinearMappingFunction : public CBase, public MAlfMappingFunction
+    {
+public:
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C static CAlfLinearMappingFunction* NewL( 
+        CAlfEnv& aEnv, 
+        TReal32 aFactor = 1.0,
+        TReal32 aOffset = 0.0 ) __SOFTFP;
+    IMPORT_C ~CAlfLinearMappingFunction();
+    
+    /* implements MAlfMappingFunction */
+    TReal32 MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP;
+    
+    /* implements MAlfMappingFunction */
+    TInt MappingFunctionIdentifier() const;
+    
+    IMPORT_C void SetFactor( TReal32 aFactor ) __SOFTFP;
+    IMPORT_C TReal32 Factor() const __SOFTFP;
+    
+    IMPORT_C void SetOffset( TReal32 aOffset ) __SOFTFP;
+    IMPORT_C TReal32 Offset() const __SOFTFP;
+        
+private:
+
+    CAlfLinearMappingFunction();
+    void ConstructL( CAlfEnv& aEnv,TReal32 aFactor, TReal32 aOffset );
+    
+private:
+
+    struct TPrivateData;
+    TPrivateData* iData;
+    
+    };
+
+/**
+ * Sine mapping function.
+ *
+ * Does not implement change flags, which means that if iFactor or iOffset 
+ * is changed while the mapping function is in use, timed values will 
+ * not notify the change.
+ */
+class CAlfSineMappingFunction : public CBase, public MAlfMappingFunction
+    {
+public:    
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C static CAlfSineMappingFunction* NewL( 
+        CAlfEnv& aEnv, 
+        TReal32 aFactor = 1.0,
+        TReal32 aOffset = 0.0 ) __SOFTFP;
+    IMPORT_C ~CAlfSineMappingFunction();
+    
+    /* implements MAlfMappingFunction */
+    TReal32 MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP;
+    
+    /* implements MAlfMappingFunction */
+    TInt MappingFunctionIdentifier() const;
+    
+    IMPORT_C void SetFactor( TReal32 aFactor ) __SOFTFP;
+    IMPORT_C TReal32 Factor() const __SOFTFP;
+    
+    IMPORT_C void SetOffset( TReal32 aOffset ) __SOFTFP;
+    IMPORT_C TReal32 Offset() const __SOFTFP;
+
+private:
+    CAlfSineMappingFunction();
+    void ConstructL( CAlfEnv& aEnv, TReal32 aFactor, TReal32 aOffset );
+
+private:
+
+    struct TPrivateData;
+    TPrivateData* iData;        
+    
+    };
+    
+    
+ 
+    
+/**
+ * Cosine mapping function.
+ * 
+ * Does not implement change flags, which means that if iFactor or iOffset 
+ * is changed while the mapping function is in use, timed values will 
+ * not notify the change.
+ */    
+class CAlfCosineMappingFunction : public CBase, public MAlfMappingFunction
+    {
+public:    
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C static CAlfCosineMappingFunction* NewL( 
+        CAlfEnv& aEnv, 
+        TReal32 aFactor = 1.0,
+        TReal32 aOffset = 0.0 ) __SOFTFP;
+    IMPORT_C ~CAlfCosineMappingFunction();
+    
+    /* implements MAlfMappingFunction */
+    TReal32 MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP;
+    
+    /* implements MAlfMappingFunction */
+    TInt MappingFunctionIdentifier() const;
+    
+    IMPORT_C void SetFactor( TReal32 aFactor ) __SOFTFP;
+    IMPORT_C TReal32 Factor() const __SOFTFP;
+    
+    IMPORT_C void SetOffset( TReal32 aOffset ) __SOFTFP;
+    IMPORT_C TReal32 Offset() const __SOFTFP;
+
+private:
+    CAlfCosineMappingFunction();
+    void ConstructL( CAlfEnv& aEnv, TReal32 aFactor, TReal32 aOffset );
+
+private:
+
+    struct TPrivateData;
+    TPrivateData* iData;        
+    
+    };
+    
+    
+/**
+ * Weighted average function between two other mapping functions.
+ * By default calculates the average of the two functions.
+ */       
+class CAlfAverageMappingFunction : public CBase, public MAlfMappingFunction
+    {
+public:
+    
+    /**
+     * Constructor. 
+     *
+     * @param aFunc1  Function 1.
+     * @param aFunc2  Function 2.
+     */
+    IMPORT_C static CAlfAverageMappingFunction* NewL( 
+        CAlfEnv& aEnv,
+        MAlfMappingFunction* aFunc1 = 0, 
+        MAlfMappingFunction* aFunc2 = 0 );
+    
+    IMPORT_C ~CAlfAverageMappingFunction();
+
+    /* Implements MAlfMappingFunction. */
+    
+    TReal32 MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP;
+    
+    TInt MappingFunctionIdentifier() const;
+    
+    IMPORT_C void SetMappingFunction1( MAlfMappingFunction* aFunction1 );
+    IMPORT_C void SetMappingFunction2( MAlfMappingFunction* aFunction2 );
+    IMPORT_C void SetMappingFunctions( 
+        MAlfMappingFunction* aFunction1,
+        MAlfMappingFunction* aFunction2 );
+        
+    IMPORT_C void SetWeight( const TAlfTimedValue& aWeight );
+    
+private:
+
+    CAlfAverageMappingFunction();
+    
+    void ConstructL( 
+        CAlfEnv& aEnv,
+        MAlfMappingFunction* aFunc1, 
+        MAlfMappingFunction* aFunc2
+        );
+
+private:
+    
+    struct TPrivateData;
+    TPrivateData* iData;
+    };
+
+
+/**
+ *  Mapping table function data provider, to be used with CAlfTableMappingFunction.
+ *
+ */
+class MAlfTableMappingFunctionDataProvider
+    {
+
+public:
+
+    /**
+     * Perform the mapping. Defines a function y = f(x, mode).
+     *
+     * Implement this method that calculates a output value for
+     * a timed value based on the input value and a component/mode
+     * parameter.
+     *
+     * For example the aValue input could be an angle, and the aMode
+     * could be a X or Y component enumeration, then the MapValue could
+     * calculate return a x or y position on a curve path.
+     *
+     * @param aValue      Unmapped value.
+     * @param aMode       Mapping mode used for mapping this value.
+     *
+     * @return  Mapped value.
+     */
+    virtual TReal32 MapValue(TReal32 aValue, TInt aMode) const __SOFTFP = 0;    
+    };
+
+/**
+ *
+ * Mapping table based mapping function. This can be used in some situations
+ * to implement new mapping function functionality, without writing a whole new 
+ * mapping function (as a server extension).
+ * 
+ */       
+class CAlfTableMappingFunction : public CBase, public MAlfMappingFunction
+    {
+public:
+    
+    /**
+     * Constructor. 
+     */
+    IMPORT_C static CAlfTableMappingFunction* NewL(CAlfEnv& aEnv);
+    
+    /**
+     * Destructor. 
+     */
+    IMPORT_C ~CAlfTableMappingFunction();
+
+    /**
+     * Calculates mapping table for given range using given mapping data provider function. This fucntion
+     * should be called at least once to initialize the mapping table values.
+     *
+     * @param aStart Start value for the mapping table
+     * @param aEnd End value for the mapping table
+     * @param aFunction Function that is used to calculate mapping table values.
+     *
+     */
+    IMPORT_C void SetMappingTableValues(TReal32 aStart, TReal32 aEnd, MAlfTableMappingFunctionDataProvider* aFunction) __SOFTFP;
+
+    /* Implements MAlfMappingFunction. */
+    
+    TReal32 MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP;
+    
+    TInt MappingFunctionIdentifier() const;
+        
+private:
+
+    CAlfTableMappingFunction();
+    
+    void ConstructL(CAlfEnv& aEnv);
+
+private:
+    
+    struct TPrivateData;
+    TPrivateData* iData;
+    };
+
+
+#endif // M_ALFMAPPINGFUNCTIONS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfmaterial.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,85 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef T_ALFMATERIAL_H
+#define T_ALFMATERIAL_H
+
+#include <alf/alfimage.h>
+#include <alf/alftimedvalue.h>
+#include <gdi.h>
+
+/** Surface material. */    
+enum TAlfMaterialPreset
+    {
+    /** Material that uses custom parameters. */
+    EAlfMaterialCustom,
+    
+    EAlfMaterialChrome,
+    EAlfMaterialPlastic,
+    /*
+     * Speculer Image in material (iSpecularImage) has to be set
+     * before setting  EAlfMaterialGlass preset. If iSpecularImage
+     * is not set, Toolkit will Panic, while drawing the mesh.
+     */
+    EAlfMaterialGlass,
+    /*
+     * Speculer Image in material (iSpecularImage) has to be set
+     * before setting  EAlfMaterialBrushedMetal preset. If iSpecularImage
+     * is not set, Toolkit will Panic, while drawing the mesh.
+     */
+    EAlfMaterialBrushedMetal,
+    /*
+     * Speculer Image in material (iSpecularImage) has to be set
+     * before setting  EAlfMaterialTexture preset. If iSpecularImage
+     * is not set, Toolkit will Panic, while drawing the mesh.
+     */
+    EAlfMaterialTexture,
+    EAlfMaterialShadow
+    };
+
+struct TAlfMaterial
+    {
+    /** Preset type. */
+    TAlfMaterialPreset iPreset;
+    
+    /** Color. */
+    TRgb iColor;
+    
+    /** Image used as the texture for the surface. */
+    TAlfImage iTextureImage;
+    
+    /** Image used as the specular reflection for the surface. */
+    TAlfImage iSpecularImage;
+
+    /** Strength of specular reflections. */
+    TAlfTimedValue iSpecular;
+
+    
+    /**
+     * Default constructor for initializing the struct.
+     */
+    inline TAlfMaterial()
+        : iPreset(EAlfMaterialCustom), iColor(KRgbWhite)
+        {
+        iSpecular.SetValueNow(1);
+        }
+        
+    };
+
+#endif // T_ALFMATERIAL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfmesh.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,190 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef C_ALFMESH_H
+#define C_ALFMESH_H
+
+#include <e32base.h>
+#include <alf/alfmaterial.h>
+
+class CAlfGenComponent;
+class TAlfImage;
+
+/**
+ * Mesh types.
+ * These types identify concrete mesh - derived object types.
+ */
+enum TAlfMeshType
+    {
+    /** Procedural mesh. @see CAlfProceduralMesh */
+    EAlfMeshTypeProcedural,
+    
+    /** M3G mesh. @see CAlfM3GMesh */
+    EAlfMeshTypeM3G
+    };
+
+
+/**
+ * Mesh class.
+ * Base class for M3G and Procedural Mesh
+ * 
+ * Usage:
+ * @code
+ * //Create procedural Mesh
+ * meshVisual->CreateMeshL( EAlfMeshTypeProcedural ); 
+ * CAlfProceduralMesh* mesh = meshVisual->ProceduralMesh();
+ * 
+ * //Make it a cube
+ *  mesh->MakeCubeL( 30000, 20000, 25000, 3000 );
+ * 
+ * //Stretch Mesh
+ *  mesh->StretchUniformly( xLimit, xOffset, yLimit, yOffset, zLimit, zOffset );
+ *  
+ * @endcode
+ * 
+ * @see CAlfMeshVisual::CreateMeshL()
+ * @see CAlfProceduralMesh
+ * @see CAlfM3GMesh
+ *
+ * @lib alfclient.lib
+ * @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfMesh ): public CBase
+    {
+
+public:
+
+    static CAlfMesh* NewL( CAlfGenComponent& aComms );
+
+    ~CAlfMesh();
+
+    /**
+     * Determines the concrete mesh type this CAlfMesh instance implements.
+     *
+     * @return TAlfMeshType The mesh type implemented by this object,  
+     * possible values are e.g EAlfMeshTypeProcedural and EAlfMeshTypeM3G, but
+     * in the future also other types may be supported.
+     */
+    IMPORT_C TInt MeshType() const;
+
+    /**
+     * Resets the mesh. All contents are destroyed.
+     */
+    IMPORT_C void Reset();
+    
+    /**
+     * Stretch the mesh uniformly along the X, Y, and Z axes. Negative side
+     * of each axis is offseted negatively. Positive side of each side is 
+     * offseted positively. Normals are not affected.
+     *
+     * @param aXLimit
+     * @param aXOffset
+     * @param aYLimit
+     * @param aYOffset
+     * @param aZLimit
+     * @param aZOffset
+     */
+    IMPORT_C void StretchUniformly(
+        TReal32 aXLimit, 
+        TReal32 aXOffset, 
+        TReal32 aYLimit, 
+        TReal32 aYOffset,
+        TReal32 aZLimit, 
+        TReal32 aZOffset) __SOFTFP;
+                                
+    /**
+     * Scale the mesh uniformly along each axis. Normals are also scaled and
+     * renormalized.
+     *
+     * @param aX  X scaling factor.
+     * @param aY  Y scaling factor.
+     * @param aZ  Z scaling factor.
+     */                                
+    IMPORT_C void ScaleUniformly(TReal32 aX, TReal32 aY, TReal32 aZ) __SOFTFP;
+    
+	/**
+	 * Returns number of ALF animation controllers
+	 */
+	IMPORT_C virtual TInt AnimationControllerCount() const;
+	
+	/**
+	 * Set position of animation in animation controller.
+	 *
+	 * @param aControllerId  ID of the controller.
+	 * @param aTarget  Target position in the timeline (seconds)
+	 * @param aTime  Time to be used in animation
+	 */
+	IMPORT_C virtual void SetAnimationPosition(TInt aControllerId, TReal32 aTarget, TInt aTime) __SOFTFP;
+
+	/**
+	 * Start animation of the controller
+	 *
+	 * @param aControllerId  ID of the animation controller.
+	 */
+	IMPORT_C virtual void StartAnimationController(TInt aControllerId);
+	
+	/**
+	 * Stop animation of the controller
+	 *
+	 * @param aControllerId  ID of the animation controller.
+	 */
+    IMPORT_C virtual void StopAnimationController(TInt aControllerId);
+    
+    
+protected:
+
+    CAlfMesh();
+
+    /**
+     * The second phase constructor. CAlfMesh - derived objects
+     * have to pass the mesh type they represent in a call to
+     * this method.
+     */
+    void ConstructL( CAlfGenComponent& aComms, TInt aMeshType = EAlfMeshTypeProcedural );
+
+private:
+
+    void StretchUniformlyL(
+        TReal32 aXLimit, 
+        TReal32 aXOffset, 
+        TReal32 aYLimit, 
+        TReal32 aYOffset,
+        TReal32 aZLimit, 
+        TReal32 aZOffset);
+                                
+    void ScaleUniformlyL(TReal32 aX, TReal32 aY, TReal32 aZ);
+
+	virtual TInt DoAnimationControllerCount() const;
+	
+	virtual void SetAnimationPositionL(TInt aControllerId, TReal32 aTarget, TInt aTime);
+
+	virtual void StartAnimationControllerL(TInt aControllerId);
+	
+	virtual void StopAnimationControllerL(TInt aControllerId);
+
+
+private: // data
+
+    struct TMeshPrivateData;
+    TMeshPrivateData* iData;
+
+    };
+
+
+#endif // C_ALFMESH_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfmeshvisual.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,182 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef C_ALFMESHVISUAL_H
+#define C_ALFMESHVISUAL_H
+
+#include <alf/alfvisual.h>
+#include <alf/alfmesh.h>
+
+class TAlfImage;
+class CAlfControl;
+class CAlfLayout;
+class CAlfProceduralMesh;
+class CAlfM3GMesh;
+
+/**
+ *  Mesh visual
+ *
+ *  Mesh visual allows integration of 3D shapes (meshes) with the user interface.
+ *  The mesh visual always contains one CAlfMesh - derived concrete mesh implementation.
+ *  By default the mesh visual contains a CAlfProceduralMesh object. The concrete
+ *  mesh object can be queried through the Mesh() - interface and can be recreated
+ *  using the CreateMeshL() - interface.
+ *
+ *  Usage:
+ *  @code
+ *  //Create Mesh Visual
+ *   CAlfMeshVisual* meshVisual = CAlfMeshVisual::AddNewL( control );
+ * 
+ *  //Create M3GMesh and get it
+ *  meshVisual->CreateMeshL( EAlfMeshTypeM3G  );
+ *  CAlfM3GMesh* m3gmesh = mMeshVisual->M3GMesh();
+ *  
+ *  //Create ProceduralMesh and get it
+ *  meshVisual->CreateMeshL( EAlfMeshTypeProcedural  );
+ *  CAlfProceduralMesh* proceduralmesh = mMeshVisual->ProceduralMesh();
+ * 
+ *  //Set MeshVisual Yaw angle
+ *  TAlfTimedValue tv( 2 );
+ *  tv.setTarget( 20, 500 );
+ *  meshVisual->SetYawAngle( tv );
+    
+ *  @endcode
+ * 
+ *  @see CAlfM3GMesh
+ *  @see CAlfProceduralMesh
+ * 
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+class CAlfMeshVisual : public CAlfVisual
+    {
+public:
+    
+    /**
+     * Constructor, which gives ownership to the control.
+     *
+     * @param aOwnerControl The control
+     * @param aParentLayout If given, the parent layout.
+     * @return New instance. Ownership NOT transreffed (owned by control)
+     */
+    IMPORT_C static CAlfMeshVisual* AddNewL(CAlfControl& aOwnerControl,
+                                            CAlfLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C CAlfMeshVisual();
+
+    /**
+     * Second-phase constructor.
+     */
+    IMPORT_C void ConstructL(CAlfControl& aOwner);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CAlfMeshVisual();
+    
+    /* Methods. */
+	/**
+	 * Creates CAlfMesh - derived object and attaches it to this CAlfMeshVisual.
+	 * This method will destroy the mesh object that was contained in this
+	 * mesh visual before. The created mesh object can be queried through
+	 * Mesh() - method.
+	 *
+	 * @param aMeshType Concrete mesh type to be created. Possible values are
+	 * e.g EAlfMeshTypeProcedural and EAlfMeshTypeM3G.
+	 * 
+	 */
+	IMPORT_C void CreateMeshL(TInt aMeshType);
+		
+    IMPORT_C void SetImage(const TAlfImage& aImage);
+    IMPORT_C const TAlfImage& Image() const;
+
+    /**
+     * Secondary image is used for crossfading.
+     */    
+    IMPORT_C void SetSecondaryImage(const TAlfImage& aImage);
+    IMPORT_C const TAlfImage& SecondaryImage() const;
+
+    IMPORT_C void SetSpecularImage(const TAlfImage& aImage);
+    IMPORT_C const TAlfImage& SpecularImage() const;
+
+    /**
+     * Returns the mesh object contained in this mesh visual.
+     *
+     * @return  Mesh.
+     */
+    IMPORT_C CAlfMesh& Mesh();
+    
+    /**
+     * Returns pointer to the procedural mesh contained in this mesh visual.
+     * If contained mesh isn't a procedural mesh, NULL is returned.
+     * 
+     * @return Pointer to the procedural mesh.
+     */
+ 	IMPORT_C CAlfProceduralMesh* ProceduralMesh() const; 
+
+    /**
+     * Returns pointer to the M3G mesh contained in this mesh visual.
+     * If contained mesh isn't an M3G mesh, NULL is returned.
+     * 
+     * @return Pointer to the M3G mesh.
+     */
+ 	IMPORT_C CAlfM3GMesh* M3GMesh() const;     
+    
+    IMPORT_C TAlfTimedValue SecondaryAlpha() const;
+    IMPORT_C void SetSecondaryAlpha( const TAlfTimedValue& aSecondaryAlpha );
+    
+    IMPORT_C TAlfTimedValue YawAngle() const;
+    IMPORT_C void SetYawAngle( const TAlfTimedValue& aYawAngle );
+    
+    IMPORT_C TAlfTimedValue PitchAngle() const;
+    IMPORT_C void SetPitchAngle( const TAlfTimedValue& aPitchAngle );
+    
+    IMPORT_C TAlfTimedValue Scale() const;
+    IMPORT_C void SetScale( const TAlfTimedValue& aScale );
+   
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void RemoveAndDestroyAllD();
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0);
+    IMPORT_C CAlfVisual* FindTag(const TDesC8& aTag);
+
+
+protected:
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void DoRemoveAndDestroyAllD();
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+    
+private:
+
+    struct TMeshVisualPrivateData;
+    TMeshVisualPrivateData* iMeshVisualData;
+
+    };
+
+
+#endif // C_ALFMESHVISUAL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfmetric.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,263 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of TAlfMetric, which is used to achieve 
+*                       text size dependent layouts, normalized child coordinate system and 
+*                       unified metrics system for all layout calculations. 
+*
+*/
+
+
+
+#ifndef __ALFMETRIC_H__
+#define __ALFMETRIC_H__
+
+
+#include <e32base.h>
+#include <e32std.h>
+
+#include <alf/alftextstylemanager.h>
+
+/**
+ * Metric units. The unit defines how the @c iMagnitude member of the TAlfMetric 
+ * struct is interpreted in practice. The interpretation may be dependent on 
+ * the size of the layout where it is being used, the size of a font, or 
+ * for example a globally defined constant.
+ */ 
+enum TAlfUnit
+    {
+    /** Real pixel that corresponds the pixels on the physical device screen. */
+    EAlfUnitPixel,
+
+    /** Normalized to parent layout size (0.0 -- 1.0). */
+    EAlfUnitNormalized,
+    EAlfUnitParentSize = EAlfUnitNormalized,
+    
+    /** Relative to the display where the metric is being used (0.0 -- 1.0). */
+    EAlfUnitRelativeToDisplay,
+    EAlfUnitDisplaySize = EAlfUnitRelativeToDisplay,
+    
+    /**
+     * Layout unit defined by S60 for a particular display device.
+     */
+    EAlfUnitS60,
+
+    /** 
+     * Relative to the size of the visual where the metric is being used (0.0 -- 1.0). 
+     * This is particularly useful for anchor layout offsets, and for paddings.
+     */
+    EAlfUnitRelativeToMySize,
+    EAlfUnitMySize = EAlfUnitRelativeToMySize,
+
+    /** relative weight; interpretation depends on sibling elements 
+     * (for example, cells in a grid) 
+     */
+    EAlfUnitWeight,
+    
+    /** 
+     * Not supported at the moment. 
+     * Line height of the font of the reference text style (the "em width") 
+     */
+    EAlfUnitLine,
+    
+    /** 
+     * Not Supported at the moment. 
+     * Physical millimeters on the screen (for instance for icons). 
+     */
+    EAlfUnitMillimeter,
+    
+    /** 
+     * Similar to EAlfUnitMysize. Can be used for example to constrain the aspect ratio of a visual,
+     * by constraining one axis to be defined in relation to its orthogonal axis.
+     */
+    EAlfUnitMyWidth,
+    EAlfUnitMyHeight,
+    
+    /** 
+     * Similar to EAlfUnitNormalized. Can be used for example to constrain the aspect ratio of a visual
+     * by constraining one axis to be defined in relation to its parent's orthogonal axis.
+     */
+    EAlfUnitParentWidth,
+    EAlfUnitParentHeight,
+
+    /** 
+     * Not Supported at the moment. 
+     * Similar to EAlfUnitMysize. The minimum of a visual's dimensions.
+     */
+    EAlfUnitMyDimensionMinimum,
+    
+    /** 
+     * Similar to EAlfUnitMysize. The Average of a visual's dimensions.
+     */
+    EAlfUnitMyDimensionAverage,
+    };
+
+
+/**
+ * A Metric is used to represent a value in a specified unit type. This is
+ * to support the definition of Layouts using screen-size independent as well
+ * as screen-size dependent measurements.
+ * 
+ * The metrics are used for different things in different contexts: 
+ * coordinate base units, anchor offsets, grid column/row weights, paddings, etc. 
+ * The interpretation of the units used in the metric depends on the context, 
+ * the type of Layout in which they are used, etc.
+ * Usage:
+ * @code
+ * TAlfMetric metricX(1.0, EAlfUnitNormalized); 
+ * TAlfMetric metricY(2.0, EAlfUnitNormalized);
+ * //Set Layout base unit using Metrc
+ * layout->SetBaseUnit(metricX);
+ * 
+ * //Create XYMetric using Metric 
+ * TAlfXYMetric metricXY(metricX, metricY);
+ * //Set Layout base unit using XYMetrc
+ * layout->SetBaseUnit( metricXY );
+ * 
+ * //Create Anchor offset as boxMetric
+ * TAlfBoxMetric offset(
+ *       TAlfMetric(0.1, EAlfUnitMySize),
+ *       TAlfMetric(-0.1, EAlfUnitMySize),
+ *       TAlfMetric(0.1, EAlfUnitMySize),
+ *       TAlfMetric(-0.1, EAlfUnitMySize));
+ * TAlfAnchorAttachmentOrigin attachmentOrigin(EAlfAnchorAttachmentOriginNone);
+ * TInt attachmentOrdinal(EAlfAnchorAttachToParent);
+ *  
+ * //Attach anchor origin
+ * anchorLayout->Attach(ordinal, offset, attachmentOrigin, attachmentOrdinal);
+ * @endcode
+ * 
+ */
+struct TAlfMetric
+    {
+public:
+    /**
+     * Constructor. The constructor defaults to using [1px] units.
+     *
+     * @param aMagnitude the size of the metric value, for example it may represent a length or a scale factor
+     * @param aUnit the unit type in which the metric value is represented
+     * @param aReferenceTextStyleID can be used to specify a text style in the case of EAlfUnitLine. 
+     */    
+    IMPORT_C TAlfMetric(TReal32 aMagnitude = 1.f, TInt aUnit = EAlfUnitPixel, TInt aReferenceTextStyleId = EAlfTextStyleNormal) __SOFTFP;
+
+    /**
+     * Constructor. Allows the compiler to pass integers instead of TAlfMetric
+     * in parameters, in place of pixel metrics.
+     *
+     * @param aPixels  Number of pixels for the metric.
+     */
+    IMPORT_C TAlfMetric(TInt aPixels);
+    
+public:
+    TReal32 iMagnitude; 
+
+    /**
+      * @see TAlfUnit
+     */
+    TInt iUnit;
+    
+    /**
+     * @see CAlfTextStyleManager::TextStyle
+     */
+    TInt iReferenceTextStyleId;
+    };
+
+/**
+ * A pair of metrics used to represent a value in both X and Y directions, similar to a TAlfRealPoint.
+ */
+struct TAlfXYMetric
+    {
+public:
+    /**
+     * Constructor.
+     */
+    IMPORT_C TAlfXYMetric();
+
+    /**
+     * Constructor. Uses the same metric for both axes.
+     *
+     * @param aMetric  Metric for the X and Y axes.
+     */
+    IMPORT_C TAlfXYMetric(const TAlfMetric& aMetric);
+
+    /**
+     * Constructor.
+     *
+     * @param aX metric for the X axis
+     * @param aY metric for the Y axis
+     */
+    IMPORT_C TAlfXYMetric(const TAlfMetric& aX,  const TAlfMetric& aY);
+
+public:
+    TAlfMetric iX;
+    TAlfMetric iY;
+    };
+
+/**
+ * Four metrics used to indicate space around the four edges of a rectangle.
+ * Not called a rectangle because those are typically made up of two XY points,
+ * while this contains just four edge metrics (named top, bottom, left, and right).
+ */
+struct TAlfBoxMetric
+    {
+public:
+    /**
+     * Constructor.
+     */
+    IMPORT_C TAlfBoxMetric();
+    
+    /**
+     * Constructor. Uses the same metric on all sides of the box.
+     *
+     * @param aMetric  Metric for all sides of the box.
+     */
+    IMPORT_C TAlfBoxMetric(const TAlfMetric& aMetric);
+
+    /**
+     * Constructor. The X metric is used for the left and right sides, and the
+     * Y metric is used for the top and bottom sides.
+     *
+     * @param aMetric  Metric for all sides of the box.
+     */
+    IMPORT_C TAlfBoxMetric(const TAlfXYMetric& aMetric);
+
+    /**
+     * Constructor. The top and left edges are specified in a single parameter, 
+     * and the bottom and right edges are also specified in a single parameter.
+     *
+     * @param aTopLeft  Metrics for the left and top sides.
+     * @param aBottomRight  Metrics for the right and bottom sides.
+     */
+    IMPORT_C TAlfBoxMetric(const TAlfXYMetric& aTopLeft, 
+        const TAlfXYMetric& aBottomRight);
+
+    /**
+     * Constructor.
+     *
+     * @param aLeft Metric for the left edge of the box.
+     * @param aRight Metric for the right edge of the box.
+     * @param aTop Metric for the top edge of the box.
+     * @param aBottom Metric for the bottom edge of the box.
+     */    
+    IMPORT_C TAlfBoxMetric(const TAlfMetric& aLeft, const TAlfMetric& aRight,
+        const TAlfMetric& aTop, const TAlfMetric& aBottom);
+        
+public:
+    TAlfMetric iLeft;        
+    TAlfMetric iRight;
+    TAlfMetric iTop;
+    TAlfMetric iBottom;
+    };
+
+
+#endif  // __ALFMETRIC_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfownership.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Ownership definition.
+*
+*/
+
+
+
+#ifndef C_ALFOWNERSHIP_H
+#define C_ALFOWNERSHIP_H
+
+/** Ownership options. */
+enum TAlfOwnership
+    {
+    EAlfDoesNotHaveOwnership,
+    EAlfHasOwnership
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfplaintexteditorcontrol.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,443 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Concrete editor control for plain (descriptor content) text
+*
+*/
+
+
+
+#ifndef C_ALFPLAINTEXTEDITORCONTROL_H
+#define C_ALFPLAINTEXTEDITORCONTROL_H
+
+#include <e32base.h>
+#include <alf/alfcontrol.h>
+#include <alf/alfeditorcontrol.h>
+#include <eikon.hrh> // For Avkon key mappings
+
+/* Forward declarations. */
+class CAlfTextEditorVisualization;
+class CAlfTextSource;
+class CAlfEditorPlainTextModifier;
+class CRichText;
+class CAlfTextEditorFunctionalState;
+
+/**
+ * CAlfPlainTextEditorControl provides un-marked up text editing
+ *
+ * Usage:
+ * @code
+ *  //Create editor control
+ *  CAlfPlainTextEditorControl* control = new (ELeave) CAlfPlainTextEditorControl;
+ *  control->ConstructL( *iEnv );
+ *  control->SetMaximumTextLength( KTestMaximumTextLength );
+ * 
+ *  //Read entered text
+ *   HBufC* readText = control->GetTextInHBufL();
+ * 
+ *  //Access plain text buffer
+ *  CPlainText& text = control->Text();
+ *  TPtrC readText = text.Read(control->TextLength());
+ * 
+ * @endcode
+ * @lib alfclient.lib
+ * @since S60 3.2
+ */
+NONSHARABLE_CLASS(CAlfPlainTextEditorControl) : public CAlfEditorControl
+    {
+
+public:
+
+    /** @beginAPI */
+
+    /**
+    * Statically creates in instance of this class
+    *
+    * @param aEnv   Alfred environment object
+    * @return   a fully-constructed instance
+    */
+    IMPORT_C static CAlfPlainTextEditorControl* NewL(CAlfEnv& aEnv);
+
+    /**
+    * Constructor.
+    * 
+    */
+    CAlfPlainTextEditorControl();
+
+    /**
+    * 2nd stage constructor
+    *
+    * @param aEnv   The Alf Environment
+    */
+    void ConstructL(CAlfEnv& aEnv);
+            	
+    /**
+      * Destructor.
+      */
+    virtual ~CAlfPlainTextEditorControl();
+
+public:  // From CAlfControl
+    
+    /**
+     * Called when the control's focus state changes.
+     *
+     * @param aDisplay  The display where this control is changing focus
+     * @param aFocused  EFalse iff losing focus.
+     */
+    void FocusChanged( CAlfDisplay& aDisplay, TBool aFocused );
+
+    /**
+     * Called when an input event is being offered to the control.
+     *
+     * @param aEvent  Event to be handled.
+     *
+     * @return  <code>ETrue</code>, if the event was handled.
+     *          Otherwise <code>EFalse</code>.
+     */
+    virtual TBool OfferEventL( const TAlfEvent& aEvent );
+    
+    /**
+     * Notifies the control that its visible has been changed on a display.
+     * This is the earliest time when the control knows the dimensions of
+     * the display it is being shown on.
+     *
+     * @param aIsVisible  ETrue, if the control is now visible on the display.
+     *                    EFalse, if the control is about to the hidden on the display.
+     * @param aDisplay    The display on which the control's visibility is changing.
+     */    
+    virtual void NotifyControlVisibility( 
+        TBool aIsVisible, 
+        CAlfDisplay& aDisplay );
+
+public:  // From MVisualOwner:
+ 
+    virtual void VisualLayoutUpdated(CAlfVisual& aVisual);
+
+public:   // From CAlfEditorControl
+ 
+    virtual void VisualizeL(  CAlfLayout* aParentLayout );
+    
+ public: // New Methods
+  
+    /**
+    * Copy a descriptor into the editor as the current text.
+    * Note this method is not suitable for long texts since a copy of the text is made.
+    *
+    * @param aText  Text descriptor to be copied in
+    */
+    IMPORT_C void SetTextL( const TDesC& aText );
+
+    /**
+    * Transfer to the caller ownership of newly constructed copy of the text.
+    * Note that this method is not recommended for long texts.
+    *
+    * The returned buffer will have have length TextLength() and will not have an appended paragraph marker.
+    * 
+    * @return A newly instantiated copy of the text in the editor. Owned by the caller.
+    */
+    IMPORT_C HBufC* GetTextInHBufL() const;
+    
+    /**
+    * Access the plain text buffer
+    *
+    * The CPlainText object will always have an end of paragraph mark (0x2029) appended. This will be at character index
+    * TextLength(). 
+    * @see TextLength()
+    * 
+    * @return a reference to a CPlainText object containing the document.. No ownership is transferred.
+    */
+    IMPORT_C CPlainText& Text() const;
+
+    /**
+    * Access the current text length.
+    *
+    * The returned value does not count the end of paragraph mark ( 0x2029 ) which is found ad the end of the CPlainText object.
+    *
+    * @return The length of the text
+    */
+    IMPORT_C TInt TextLength() const;
+
+    /**
+    * Sets the maximum text length.
+    * 
+    * This method will panic if the passed-in value is greater than the current TextLength()
+    *
+    * @param maximum allowed length of text
+    */
+    IMPORT_C void SetMaximumTextLength( TInt aMaxTextLength );
+
+    /**
+    * Access the maximum text length
+    *
+    * @return maximum allowed length of text
+    */
+    IMPORT_C TInt MaximumTextLength() const;
+
+    /**
+    * Set the current input position within the document. It is possible to set both the pending input position (cursor position)
+    * in logical order, and to set to which run of text that cursor should be associated with. 
+    * 
+    * In the following, the terms "next", "previous", "after" and "before" all refer to the logical ordering of characters in the text
+    * buffer.  The terms "left" and "right" refer to visual positioning.
+    * 
+    * The valid range for the position is 0 to TextLength(), inclusive. A value of TextLength() indicates the cursor is positioned after 
+    * the last character. The value of the cursor position can be though of as a "gap number", where the first gap is that before 
+    * character 0, and the last gap is that after TextLength(). Another way of thinking of this is the cursor position represents
+    * the 0-based index of a character that would be input at that point. More simply, it can be thought of as sharing an
+    * index value with the next character in the buffer.
+    *
+    * The leading flag can be used to associate the cursor visually with the next character in logical order (aLeading = ETrue)
+    * or with the previous character in logical order. This has an effect visually, if the previous and next characters are in runs of 
+    * text with different directionality. If a cursor is at ( N, Trailing ), and character at index N-1 is in a left-to-right (L-R) run of text, 
+    * then the cursor will be displayed to the right of character N-1. This would be the default for a cursor at the end of a run of 
+    * L-R text.  However, if the cursor is set to ( N, Leading ) and the character at index N is in a right-to-left (R-L) text run, then 
+    * the cursor will adhere to that block and be positioned to the right side of character N. Note that this cursor position could 
+    * potentially be at some distance to the right from the (N, Trailing) visual position. 
+    * 
+    * Conversely if there is a run of R-L text followed (logically) by L-R text, and the curosr is positioned at N. (i.e. N is in the 
+    * L-R text and N-1 is in the R-L). In this case, if the cursor is trailing, it trails character N-1, and therefore is 
+    * positioned at the end (left side) of the R-L text - which is positioned visually between the runs of text. If the cursor is 
+    * set to leading, then it leads character N, and is therefore at the left end of the L-R text, probably at the left end of the whole text. 
+    * 
+    * Note that the values of ( 0, Trailing ), and ( TextLength(), Leading ) are both legal, and behave as they are specified. 
+    * SetCursorPos(0) is generally what one wants. It will cause the cursor to adhere to the end of text that is entered/pasted.
+    * SetCursorPos( MaxLength(), ETrue ) will generally behave the same as SetCursorPos( MaxLength(), EFalse) since there
+    * will still be no "next run" of text after input.
+    * 
+    * @param a "gap number" in the document. 
+    * @param aLeading = EFalse iff the cursor is to be associated visually to the previous character's run of text. 
+    */
+    IMPORT_C void SetCursorPos( TInt aNewPosition, TBool aLeading = EFalse );
+    
+    /**
+    * Gets the current input position within the document.
+    * @see SetCursorPos( TInt, TBool );
+    *
+    * @param returns the logical position of the cursor
+    * @param returns the leading/trailing flag
+    */
+    IMPORT_C void GetCursorPos( TInt& aPosition, TBool& aLeading );
+    
+    /**
+    * Obtain the simple cursor position without leading/trailing information.
+    * This API is appropriate in many cases that the visual positioning of the cursor is not a concern.
+    * @see SetCursorPos( TInt, TBool );
+    *
+    * @return the gap number that the cursor is presently located in
+    */
+    IMPORT_C TInt CursorPos() const;
+    
+    /**
+    * Set a selection on the editor contents.  The selection is single contiguous range of indices with a 
+    * starting cursor position (the "Anchor") and an end position (the "Cursor"). It thus has a directionality.
+    * The semantics of the selection is that it indicates what set of characters the next user input is going 
+    * to affect. It is usually indicated to the user with a selection highlight. The ends of the selection may or 
+    * may not be differentiated visually to the user.
+    *
+    * Both anchor and cursor follow the conventions of the the cursor in SetCursorPos. 
+    * @see SetCursorPos( TInt, TBool )
+    * Note however, that the selected set of characters comprises those characters between the anchor and cursor.
+    * So if a selection is set at (M,N), and then the selection is deleted, the characters at indices M, M+1...N-1 will be deleted.
+    *
+    * The Set/GetCursorPos APIs interoperate with the selection-oriented APIs. The cursor position is merely the 
+    * end point of the selection.
+    * 
+    * Setting a zero length selection is the same as setting a (non-selection) cursor position. This action leaves the 
+    * leading/trailing flag state of the cursor unchanged. If the editor client needs to zero the selection and also change the 
+    * leading/trailing flag, he must first call SetSelection with zero length, and then call SetCursorPos, explicitly setting the
+    * leading/trailing flag.
+    * 
+    * Setting a non-zero length selection does affect the leading trailing flag, according to the following rules: 
+    * If aCursorPosition > aAnchorPosition, then the flag is set to Trailing. 
+    * If aCursorPosition < aAnchorPosition, then the flag is set to Leading.
+    * 
+    * Deletion or replacing the selection (by user activity or via the Text() interface leaves the leading trailing state 
+    * unchanged
+    * 
+    * @param aAnchorPosition    Starting gap position of the selection
+    * @param aCursorPosition    End gap position of the selection
+    */
+    IMPORT_C void SetSelection( TInt aAnchorPosition, TInt aCursorPosition );
+
+    /**
+    * Moves only the cursor position of the selection. The anchor position remains unchanged.
+    * 
+    * @param the cursor position to move the end of the selection to.
+    */
+    IMPORT_C void ExtendSelection( TInt aNewCursorPosition );
+
+    /**
+    * Obtain the current selection. 
+    * @see SetSelection( TInt, TInt );
+    * 
+    * @param aAnchorPosition  Returns the anchor gap number
+    * @param aCursorPosition  Returns the cursor gap number
+    */
+    IMPORT_C void GetSelection( TInt& aAnchorPosition, TInt& aCursorPosition )const;
+
+    /**
+     * Sets permitted cases for the editor.
+     * Possible flags from @c uikon.hrh are @c EAknEditorAllCaseModes, 
+     * @c EAknEditorUpperCase, @c EAknEditorLowerCase and 
+     * @c EAknEditorTextCase. 
+     * @c EAknEditorAllCaseModes is default.
+     *
+     * @param aPermittedCaseModes Case modes that are available in the editor.
+     */
+    IMPORT_C void SetPermittedCaseModes(TInt aPermittedCaseModes);
+
+    /**
+     * Sets default case for the editor. The case is used when the editor
+     * is focused first time. Available case flags from @c uikon.hrh
+     * are @c EAknEditorUpperCase, @c EAknEditorLowerCase and 
+     * @c EAknEditorTextCase. @c EAknEditorTextCase is used if the initial 
+     * case by default.
+     *
+     * @param aCase Initial case to be used in the editor.
+     */
+    IMPORT_C void SetDefaultCase(TInt aDefaultCase);
+    
+    /**
+     * Updates editor case. FEP is automatically notified of the
+     * case change in editor state and FEP takes new case to use immediately.
+     * Available case flags from @c uikon.hrh are @c EAknEditorUpperCase, 
+     * @c EAknEditorLowerCase and @c EAknEditorTextCase.
+     * This method should not be used to set initial case for the editor.
+     * Use @c SetAknEditorCase() method instead for setting initial case.
+     *
+     * @param aCase New case for the editor.
+     */
+    IMPORT_C void SetCurrentCase(TInt aCase);
+        
+    /**
+     * Sets default input mode for the editor. The input mode is used when 
+     * the editor is focused first time. 
+     * @c EAknEditorTextInputMode is used if the initial input mode by default.
+     *
+     * @param aInputMode Initial input mode to be used in the editor.
+     */
+    IMPORT_C void SetDefaultInputMode( TInt aInputMode );
+    
+    /**
+     * Updates editor input mode. FEP is automatically notified of the
+     * new input mode in editor state and FEP takes new input mode to use 
+     * immediatelly. Current inline editing is reset.
+     * This method should not be used for setting initial input mode for the 
+     * editor. Use @c SetAknEditorInputMode() method instead for setting 
+     * initial input mode.
+     *
+     * @param aInputMode New input mode for the editor.
+     */
+    IMPORT_C void SetCurrentInputMode( TInt aInputMode );
+
+    /**
+     * Sets allowed input modes for the editor. 
+     * All input modes are allowed (@c EAknEditorAllInputModes) if the value 
+     * is not set from EDWIN resource @c allowed_input_modes or with this API.
+     *
+     * @param aInputModes Input modes that are allowed in the editor.
+     */
+    IMPORT_C void SetPermittedInputModes( TInt aInputModes );
+    
+    /**
+     * Sets number mode key mapping for '*' and '#' keys. The key mapping is 
+     * used in editors when numeric input mode is used. Key mapping characters
+     * for '*' key are shown on special character table if also text input 
+     * modes are allowed in the editor but the current input mode is numeric 
+     * mode. @c EAknEditorStandardNumberModeKeymap is used in editors that 
+     * allow only numeric input if the mapping is not set from EDWIN resource 
+     * @c numeric_keymap or with this API. 
+     * @c EAknEditorAlphanumericNumberModeKeymap is used as default if the 
+     * editor allows also text input mode.
+     *
+     * @param aNumericKeymap Key mapping used in an editor with number input 
+     *        mode.
+     */
+    IMPORT_C void SetNumericKeymap(
+        TAknEditorNumericKeymap aNumericKeymap);
+    
+     /**
+     * Sets the @c EOnlyASCIIChars flag. 
+     *
+     * @param aASCIIOnly If @c ETrue the EOnlyASCIIChars flag will be set. If 
+     *        @c EFalse the EOnlyASCIIChars flag will be removed.
+     */
+    IMPORT_C void SetOnlyASCIIChars( TBool aASCIIOnly );
+    
+    /**
+    * Autoselection of text. When set, this initially sets the editor to have the cursor position 
+    * at the end of the document with the selection's anchor at the beginning. 
+    * That is, the whole text is selected.
+    *
+    * If cursor positioning at the end is desired, but with no auto-selection, then the flag 
+    * EAutoCursorAtEndIndex should be used.  But if selection is desired, then this flag only 
+    * is needed.
+    * 
+    * This setting is looked at whenever SetTextL is called and not just at initial display of the editor.
+    *
+    * @param aAutoSelection     iff not EFalse, will cause autoselection
+    */
+    IMPORT_C void SetAutoSelection( TBool aAutoSelection );
+
+    /**
+    * Automatic setting of the cursor at the end of the document.
+    * If set, this initially sets the editor to have the cursor position at the end of the document,
+    * but with no selection.
+    *
+    * This setting is looked at whenever SetTextL is called and not just at initial display of the editor.
+    *
+    * @param aCursorAtEnd     iff not EFalse, will cause auto-positioning of the cursor at the end of the document
+    */
+    IMPORT_C void SetInitialCursorAtEnd( TBool aCursorAtEnd );
+    
+    /**
+    * Access method for visualizations to get at the non editor content state
+    * @return A pointer to a CAknEditorState object
+    */ 
+    CAlfTextEditorFunctionalState& State() const;
+    
+    /**
+    * Set the text style for the text.  The Id passed in is either a pre-allocated
+    * Alf text style ID or a derived ID using the TextStyleManager.
+    *
+    * @param aTextStyleId Alf platform-specifc text id
+    */
+    IMPORT_C void SetTextStyleId( TInt aTextStyleId );
+    
+protected:
+
+private:
+
+    /**
+    * Create visuals for this editor in the given parent
+    */
+    void CreateVisualizationL( CAlfLayout* aParentLayout );
+    
+    void SetSingleAknEditorFlagAndReportIfChanged( TInt aSingleFlag, TBool aNewValue );
+    
+private:
+    // @todo Not properly BC-proofed
+    CAlfTextSource* iTextSource;    // Owned
+    CAlfEditorPlainTextModifier* iTextModifier; // Owned
+    TInt iMaximumTextLength;
+    CAlfTextEditorVisualization* iTextVisualization; // Not Owned
+    
+    // Functional flags:
+    CAlfTextEditorFunctionalState* iState;
+    // textStyleId to be passed to the visualization 
+    TInt iTextStyleId;
+
+    TInt iSpare;
+    };
+
+#endif  // C_ALFPLAINTEXTEDITORCONTROL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfproceduralmesh.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,176 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Procedural mesh definition
+*
+*/
+
+
+
+#ifndef C_ALFPROCEDURALMESH_H
+#define C_ALFPROCEDURALMESH_H
+
+#include <alf/alfmesh.h>
+
+/**
+ *  Procedural mesh support.
+ *
+ *  This is a CAlfMesh - derived mesh implementation that provides support
+ *  for procedural meshes. There are collection of shapes that can be procedurally
+ *  constructed using this object. This mesh can be used through CAlfMeshVisual
+ *  and created with CAlfMeshVisual::CreateMeshL() method with argument EAlfMeshTypeProcedural.
+ * Usage:
+ * @code
+ *  //Create Procedural Mesh and get it from Mesh Visual
+ *  meshVisual->CreateMeshL( EAlfMeshTypeProcedural );                
+ *  CAlfProceduralMesh* mesh = meshVisual->ProceduralMesh();
+ * 
+ *  //Make a cube
+ *  int sizeX = 30000;
+ *  int sizeY = 20000; 
+ *  int sizeZ = 25000;
+ *  int edgeRadius = 3000;
+ *  mesh->MakeCubeL( sizeX, sizeY, sizeZ, edgeRadius );
+ * 
+ *  //Make a sphere
+ *  int radius = 15000;
+ *  int columns = 20;
+ *  int rows = 20;
+ *  mesh->MakeSphereL( radius, columns, rows );
+ *           
+ *  //Make a Torus
+ *  int mainRadius = 15000;
+ *  int outerRadius = 2000;
+ *  int mainSegments = 20;
+ *  int outerSegments = 20;
+ *  float segmentAngleOffset = 0.0;
+ *  mesh->MakeTorusL( mainRadius, outerRadius, mainSegments, outerSegments, segmentAngleOffset );
+ *  
+ *  //Material setting
+ *  TAlfMaterial material;
+ * 	material.iColor = Color( 128 );
+ *  material.iPreset = EAlfMaterialShadow;
+ *  const float KValueNow = 0.2;
+ * 	const float KTargetValue = 0.5;
+ * 	TAlfTimedValue tv( KValueNow );
+ * 	tv.SetTarget( KTargetValue, 500 );    
+ * 	material.iSpecular = tv;
+ *  mesh->SetMaterial( material );               
+ * 
+ *  //Set glass preset with speculer image set.
+ *  material.iSpecularImage = TAlfImage();
+ *  material.iPreset = EAlfMaterialGlass;
+ *  mesh->SetMaterial(material);  
+ * 
+ * @endcode
+ * @see TAlfMaterial
+ * @lib alfclient.lib
+ * @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfProceduralMesh ): public CAlfMesh
+    {
+
+public:
+
+    /**
+     * Constructs a new CAlfProceduralMesh instance.
+     */
+    static CAlfProceduralMesh* NewL( CAlfGenComponent& aComms );
+
+    /**
+     * Destructor
+     */
+    ~CAlfProceduralMesh();
+
+    /**
+     * Creates a cube mesh.
+     * @todo move.
+     * @param aSizeX
+     * @param aSizeY
+     * @param aSizeZ
+     * @param aEdgeRadius
+     */
+    IMPORT_C void MakeCubeL(
+        TReal32 aSizeX, 
+        TReal32 aSizeY, 
+        TReal32 aSizeZ, 
+        TReal32 aEdgeRadius) __SOFTFP;
+
+    /**
+     * Creates a sphere mesh.
+     * @todo move
+     * @param aRadius
+     * @param aColumns
+     * @param aRows
+     */
+    IMPORT_C void MakeSphereL(
+        TReal32 aRadius, 
+        TInt aColumns, 
+        TInt aRows) __SOFTFP;
+
+    /** 
+     * Creates a torus mesh.
+     * @todo move
+     * @param aMainRadius
+     * @param aOuterRadius
+     * @param aMainSegments
+     * @param aOuterSegments
+     * @param aSegmentAngleOffset
+     */
+    IMPORT_C void MakeTorusL(
+        TReal32 aMainRadius, 
+        TReal32 aOuterRadius, 
+        TInt aMainSegments, 
+        TInt aOuterSegments,
+        TReal32 aSegmentAngleOffset = 0) __SOFTFP;
+
+    /**
+     * Returns the material definition used by this procedural mesh.
+     *
+     * @return TAlfMaterial material definition.
+     */
+    IMPORT_C const TAlfMaterial& Material() const;
+    
+    /**
+     * Sets the material definition used by this procedural mesh.
+     *
+     * @param aMaterial Material definition to be applied to this mesh.
+     */    
+    IMPORT_C void SetMaterial( const TAlfMaterial& aMaterial );
+
+    /**
+     * Sets the specular image of the mesh material.
+     */
+    void SetSpecularImage(const TAlfImage& aImage);
+
+private:
+
+    /**
+     * Constructor
+     */
+    CAlfProceduralMesh();
+
+    /**
+     * Second phase constructor
+     */
+    void ConstructL( CAlfGenComponent& aComms );
+
+private: // data
+
+    struct TProceduralMeshPrivateData;
+    TProceduralMeshPrivateData* iData;
+
+    };
+
+
+#endif // C_ALFPROCEDURALMESH_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfproperty.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,209 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Property value for Alfred
+*
+*/
+
+
+
+#ifndef C_ALFPROPERTYVALUE_H
+#define C_ALFPROPERTYVALUE_H
+
+#include <e32base.h>
+#include <libc/limits.h> // For max and min int sizes.
+
+#include <alf/alftimedvalue.h>
+
+
+/** Property types. */
+enum TAlfPropertyType
+    {
+    /** Property has no value type. */
+    EAlfPropertyTypeUndefined,
+    
+    /** Property is a string. */
+    EAlfPropertyTypeString,
+    
+    /** Property is a TRangedValue. */    
+    EAlfPropertyTypeInteger,
+    
+    /** Property is a CAlfTimedValue. */
+    EAlfPropertyTypeTimedValue
+    };
+
+/**
+ * A ranged value with specifiable min/max bounds.
+ */
+class TRangedValue
+{
+public:
+    TRangedValue()
+    {
+    iValue = 0;
+    iMin = INT_MIN;
+    iMax = INT_MAX;
+    }
+    
+    TRangedValue(TInt aValue, TInt aMin, TInt aMax)
+    :
+    iValue(aValue),
+    iMin(aMin),
+    iMax(aMax)
+    {
+    }
+    
+    TInt iValue;
+    TInt iMin;
+    TInt iMax;
+};
+
+
+
+/**
+ * Property base class
+ *
+ * A generic property value, it can be derived to create new property types
+ * that can be accessed by name.
+ *
+ * @todo This class should be able to represent a generic property without any type.
+ *
+ * @see CAlfPropertyOwner
+ *
+ */
+NONSHARABLE_CLASS(CAlfProperty) : public CBase
+    {
+public:
+
+    CAlfProperty();
+
+    ~CAlfProperty();
+
+    /**
+     * Constructs a new empty property.
+     *
+     * @param aName the name of this property.
+     */
+    void ConstructL(const TDesC8& aName);
+
+    /**
+     * Returns the type of this property.
+     *
+     * @return Property type.
+     * @see TAlfPropertyType
+     */
+    TAlfPropertyType Type() const;
+
+    /**
+     * Returns the name of this property.
+     *
+     * @return Property name.
+     */
+    const TDesC8& Name() const;
+    
+    /**
+     * Compare names for sort operations.
+     * Does a letter-by-letter compare of property names.
+     *
+     * @param aA First property.
+     * @param aA Second property.     
+     * @return difference between names.
+     */
+    static TInt CompareByName(const CAlfProperty& aA, const CAlfProperty& aB);
+
+    /**
+     * Do names match.
+     * Compares the names of two properties.
+     * @param aA First property.
+     * @param aA Second property.     
+     * @return ETrue on a match.
+     */
+    static TBool Matches(const CAlfProperty& aA, const CAlfProperty& aB);
+    
+protected:
+    HBufC8* iName;   // Owned.        
+    TAlfPropertyType iType;    
+    };
+
+/**
+ *  Integer value property base class
+ *
+ *  A single property containing an integer value and its range.
+ *
+ */
+NONSHARABLE_CLASS(CAlfPropertyInteger) : public CAlfProperty
+    {
+    public:
+    /* Constructors and destructor. */
+
+    CAlfPropertyInteger();
+
+    ~CAlfPropertyInteger();    
+    
+    void Set(const TRangedValue& aValue);
+    
+    TRangedValue Data() const;
+        
+    private:
+    TRangedValue iValue;        
+    };
+
+/**
+ *  Timed value property base class
+ *
+ *  A single property containing an integer value and its range.
+ *
+ */
+NONSHARABLE_CLASS(CAlfPropertyTimedValue) : public CAlfProperty
+    {
+    public:
+    /* Constructors and destructor. */
+
+    CAlfPropertyTimedValue();
+
+    ~CAlfPropertyTimedValue();    
+    
+    void Set(TAlfTimedValue& aValue);
+    
+    TAlfTimedValue& Data();
+        
+    private:
+    TAlfTimedValue iTimedValue;         
+    };
+    
+    
+/**
+ *  String property base class
+ *
+ *  A single property containing a string.
+ *
+ */
+NONSHARABLE_CLASS(CAlfPropertyString) : public CAlfProperty
+    {
+    public:
+    /* Constructors and destructor. */
+
+    CAlfPropertyString();
+
+    ~CAlfPropertyString();    
+    
+    void SetL(const TDesC& aValue);
+    
+    TDesC* Data() const;
+        
+    private:
+    HBufC* iString;         
+    };
+
+
+#endif // C_ALFPROPERTYVALUE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfpropertyowner.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,161 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Property object for Alfred
+*
+*/
+
+
+
+#ifndef C_ALFPROPERTYOWNER_H
+#define C_ALFPROPERTYOWNER_H
+
+#include <e32base.h>
+
+#include "alf/alfproperty.h"
+
+// Property extension UIDs
+
+static const TUid KUidAlfPropOwnerExtControlFocusChainChanged = {0x200110DA};
+
+
+/**
+ *  Value property object base class
+ *
+ *  Manages a list of properties.
+ *  The current policy is that properties must always return a valid pointer, never NULL.
+ * @todo more
+ *
+ */
+class CAlfPropertyOwner: public CBase
+    {
+    public:
+    /* Constructor and destructor. */
+    IMPORT_C CAlfPropertyOwner();
+    
+    IMPORT_C ~CAlfPropertyOwner();    
+
+    /**
+     * Remove the property by name, if it exists.
+     *
+     * @param aName the name of the property to remove.
+     * @return ETrue if found.
+     */        
+    IMPORT_C TBool PropertyRemove(const TDesC8& aName);
+    
+    /**
+     * Remove all properties.
+     */            
+    IMPORT_C void PropertyClear();
+
+
+    // We have a different registration method for each property type, eg value, string, timedvalue.
+
+    /**
+     * Set a value property.
+     * This will set a property of type integer. If the property is already set,
+     * it will update the property's value. If not, it will create a new property.
+     * Can be overridden to provide custom handling of properties.
+     *
+     * @param aName the name of the property to set.
+     * @param aVal The value of the property.
+     * @return EFalse if value was set as a different type already, or zero-length name supplied.
+     *         The property was not set.
+     */    
+    IMPORT_C TBool PropertySetIntegerL(const TDesC8& aName, TInt aVal, TInt aMin = INT_MIN, TInt aMax = INT_MAX);
+    
+    /**
+     * Find the property by name.
+     * Can be overridden to provide custom handling of properties.     
+     *
+     * @param aName the name of the property to find.
+     * @param aRet Return parameter for the found value, or NULL if no value required.
+     * @return ETrue if found.
+     */    
+    IMPORT_C TBool PropertyFindInteger(const TDesC8& aName, TInt* aRet = NULL) const;
+
+    /**
+     * Set a string property.
+     * This will set a property of type string. If the property is already set,
+     * it will update the property's value. If not, it will create a new property.
+     * Can be overridden to provide custom handling of properties.
+     *
+     * @param aName the name of the property to set.
+     * @param aVal The value of the property.
+     * @return EFalse if value was set as a different type already, or zero-length name supplied.
+     *         The property was not set.
+     */    
+    IMPORT_C TBool PropertySetStringL(const TDesC8& aName, const TDesC& aVal);
+    
+    /**
+     * Find the property by name.
+     * Can be overridden to provide custom handling of properties.     
+     *
+     * @param aName the name of the property to find.
+     * @param aRet Return parameter for the found value, or NULL if no value required.
+     * @return ETrue if found.
+     */    
+    IMPORT_C TBool PropertyFindString(const TDesC8& aName, TDesC** aRet = NULL) const;
+
+    /**
+    * Copies named property from another object
+    * 
+    * @param aOwner        Object which has the property to be copied
+    * @param aPropertyName The name of a property
+    *
+    * @return System wide error codes
+    */
+    IMPORT_C TInt CopyProperty(const CAlfPropertyOwner& aOwner, const TDesC8& aPropertyName);
+    
+    private:
+    
+    /**
+     * Find a generic property object.
+     *
+     * @param aName the name of the property to find.     
+     * @param aIndex Return parameter for index found.
+     * @param aType Return parameter for type found.     
+     * @return ETrue if found.
+     */
+    TBool Find(const TDesC8& aName, TInt* aIndex = NULL, TAlfPropertyType* aType = NULL) const;
+    
+    /**
+     * Find a property object of given type.
+     *
+     * Does type checking to ensure that we got the expected property type.
+     *
+     * @param aName the name of the property to find.     
+     * @param aIndex Return parameter for index found.
+     * @param aRequiredType Type that is expected
+     * @return ETrue if found and correct type, EFalse if not found or wrong type.
+     */    
+    TBool FindOfType(const TDesC8& aName, TInt* aIndex, TAlfPropertyType aRequiredType) const;
+    
+    /**
+    * !Internal util: Find complete ranged value.
+    */
+    TBool PropertyFindInteger(const TDesC8& aName, TRangedValue& aValue) const;
+
+protected: // new methods    
+    
+    IMPORT_C virtual void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+private: // data
+    
+    RPointerArray<CAlfProperty> iProperties;
+    
+    TAny* iSpare;
+    };
+
+#endif // C_ALFPROPERTYOBJECT_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfrealline.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   UID definitions
+*
+*/
+
+
+
+#ifndef ALFREALLINE_H
+#define ALFREALLINE_H
+
+struct TAlfRealLine
+    {
+    TAlfRealLine(){}
+    TAlfRealLine(const TAlfRealPoint& aStart, const TAlfRealPoint& aEnd):iStart(aStart),iEnd(aEnd){}
+
+    TAlfRealPoint iStart;
+    TAlfRealPoint iEnd;    
+
+	private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+        
+        
+    
+#endif    
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfroster.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,374 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Roster
+*
+*/
+
+
+
+#ifndef C_ALFROSTER_H
+#define C_ALFROSTER_H
+
+#include <e32base.h>
+
+class CAlfDisplay;
+class CAlfControlGroup;
+class TAlfEvent;
+class CAlfControl;
+class CAlfVisual;
+struct TAlfXYMetric;
+
+
+/** Predefined positions for showing groups. */
+const TInt KAlfRosterShowAtTop = -2;
+const TInt KAlfRosterShowAtBottom = -1;
+
+enum TAlfPointerEventFlags
+    {
+    EAlfPointerEventReportDrag      = 0x01, 
+    EAlfPointerEventReportLongTap   = 0x02,
+    EAlfPointerEventReportUnhandled = 0x04
+    };
+
+class CAlfRoster;
+
+/**
+ * Observer class that can be used to notify users about changes in the
+ * relative order of control groups in the roster.
+ *
+ * The NotifyControlGroupOrderChanged() method will be called when control
+ * groups are shown or hidden and as a result the relative order the control groups
+ * are in is modified. The notification is also called when the first control
+ * group is shown or when the last control group is hidden.
+ *
+ * It is on the user's responsibility to remove the callback object from the 
+ * CAlfRoster objects it has been added into before destroying the callback
+ * object.
+ * Usage:
+ * @code
+ *  // Create a control group.
+ *  CAlfControlGroup& group = iEnv->NewControlGroupL( KPrimaryGroup );
+ *
+ *  // Add a control to the group.
+ *  AnchorControl* hello = AnchorControl::ConstructL(*iEnv);
+ *  group.AppendL(*hello);
+ * 
+ *  // Show the control group on the display.
+ * display.Roster().ShowL(group);
+ * @endcode
+ * @see CAlfRoster::AddControlGroupOrderChangedObserverL()
+ * @see CAlfRoster::RemoveControlGroupOrderChangedObserver()
+ *
+ * @lib alfclient.lib
+ * @since S60 v5.0
+ */
+class MAlfControlGroupOrderChangedObserver
+    {
+public:
+    
+    /**
+     * Callback method that is called whenever relative order of the control 
+     * groups is modified. This is a result of calls to CAlfRoster::ShowL()
+     * or CAlfRoster::Hide(). Notification is called after relative order of control
+     * groups has changed. User can analyze the observed CAlfRoster object for more 
+     * information about the changes. This observer has to be registered to a CAlfRoster
+     * object to acquire notifications through this method.
+     */
+    virtual void NotifyControlGroupOrderChanged() = 0;   
+
+    };
+
+/**
+ *  Roster keeps track of the visible control groups.
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfRoster ): public CBase
+    {
+
+public:
+
+    /**
+     * Constructor
+     */
+    CAlfRoster();
+
+    /**
+     * ConstructL
+     * 
+     * @param aDisplay. Associated display. NULL for shared roster.
+     */
+    void ConstructL(CAlfDisplay* aDisplay);
+
+    /**
+     * Destructor
+     */
+    virtual ~CAlfRoster();
+
+    /**
+	 * Shows a control group.
+	 *
+	 * @param aGroup  Control group.
+	 * @param aWhere  Where to show the group. Index, <code>KAlfRosterShowAtTop</code>,
+	 *                or <code>KAlfRosterShowAtBottom</code>.
+	 */
+    IMPORT_C void ShowL( CAlfControlGroup& aGroup, 
+                         TInt aWhere = KAlfRosterShowAtTop);
+                         
+    /**
+	 * Hides a control group.
+	 *
+	 * @param aGroup  Group.
+	 */
+    IMPORT_C void Hide(CAlfControlGroup& aGroup);
+
+    /**
+     * Finds the index of a control group in the roster.
+     *
+     * @param aGroup  Control group.
+     * @return Index. KErrNotFound if not found.
+     */
+    IMPORT_C TInt Find(const CAlfControlGroup& aGroup) const;
+    
+    /**
+	 * Removes a control group from the roster.
+	 * 
+	 * @param aGroup  Control group to remove. NULL does nothing.
+	 */
+    void Remove(CAlfControlGroup* aGroup);
+    
+    /**
+     * Returns the number of control groups.
+     *
+     * @return Number of control groups.
+     */
+    IMPORT_C TInt Count() const;
+    
+    /**
+     * Returns a control group.
+     */
+    IMPORT_C CAlfControlGroup& ControlGroup(TInt aIndex) const;
+    
+    /**
+     * Finds a control inside the roster.
+     *
+     * @param aControlId  Identifier of the control to find.
+     *
+     * @return  Pointer to the control.  <code>NULL</code>, if not found.
+     */
+    IMPORT_C CAlfControl* FindControl(TInt aControlId) const;
+    
+    /**
+     * Gives input focus to a control.
+     */
+    IMPORT_C void SetFocus(CAlfControl& aControl);
+    
+    /**
+     * Clears the input focus so that no control has focus.
+     */
+    IMPORT_C void ClearFocus();
+    
+    /**
+     * Moves an existing control group into a new position in the roster.
+     *
+     * @param aGroup Moved group.
+     * @param aPos  Position to move into.
+     */
+    TBool Move(CAlfControlGroup& aGroup, TInt aPos);
+    
+    /**
+	 * Appends a new control group on top of the roster.
+	 *
+	 * @param aGroup  Control group to add.
+	 */
+    void AppendL(CAlfControlGroup& aGroup);
+    
+    	/** 
+	 * Inserts a control group into a specific position in the roster.
+	 *
+	 * @param aGroup  Control group.
+	 * @param aPos    Position to insert into.
+	 *
+	 * @leave KErrAlreadyExists  The control group is already in the roster.
+	 */
+    void InsertL(CAlfControlGroup& aGroup, TInt aPos);
+    
+    /**
+     * Called when a key event occurs. The input event is offered to the 
+     * controls in the order defined by the groups.
+     * 
+     * @param aEvent Received event.
+     * @return ETrue if event was consumed.
+     */
+    TBool HandleEventL(const TAlfEvent& aEvent);
+    
+    /**
+     * Show an individual visual in the roster. The visual is appended to the
+     * root level visuals of its group.
+     *
+     * @param aVisual  Visual to show.
+     */
+    IMPORT_C void ShowVisualL(CAlfVisual& aVisual);
+
+    /**
+     * Hide an individual visual in the roster.
+     *
+     * @param aVisual  Visual to hide.
+     */
+    IMPORT_C void HideVisual(CAlfVisual& aVisual);
+    
+    /**
+     * Moves a root visual to the front. Causes layout recalculation.
+     */
+    IMPORT_C void MoveVisualToFront(CAlfVisual& aRootVisual);
+    
+    /**
+     * Adds a pointer event observer.
+     * 
+     * @param aObserver Observer type.
+     * @param aControl Control which receives the events.
+     * @return Error code.
+     */
+    IMPORT_C TInt AddPointerEventObserver( 
+        TAlfPointerEventFlags aObserver, 
+        CAlfControl& aControl );
+    
+    /**
+     * Removes a pointer event observer.
+     * 
+     * @param aObserver Observer type.
+     * @param aControl Control which receives the events.
+     * @return Error code.
+     */
+    IMPORT_C TInt RemovePointerEventObserver( 
+        TAlfPointerEventFlags aObserver, 
+        CAlfControl& aControl );
+    
+    /**
+     * Sets pointer event observer flags. See TAlfPointerEventFlags for
+     * possible combinations.
+     * 
+     * @param aPointerEventFlags Flags. 
+     * @param aControl Control which receives the events.
+     * @return Error code.
+     */
+    IMPORT_C TInt SetPointerEventObservers( 
+        TUint aPointerEventFlags, 
+        CAlfControl& aControl );
+
+    /**
+    * To be called on the display's roster when the display's focus changes state.
+    * The roster will remove focus from controls if NULL is passed in. It does this without
+    * changing its FocusedControl(), which becomes a latent focus.
+    * When ETrue is passed in, the FocusedConrol() is again given control focus.
+    *
+    * @param aDisplay The display losing its focus as a whole
+    * @param aNewFocusState The new focus state
+    */
+    void DisplayFocusChanged( CAlfDisplay& aDisplay, TBool aNewFocusState );
+        
+    /**
+    * Access to the control to which the roster will send events first.
+    *
+    * @return the roster's currently focused control
+    */
+    CAlfControl* FocusedControl() const;
+
+    /**
+     * Sets treshold that pointer needs to be moved before starting to send 
+     * drag events. Default treshold is 4 pixels in both X and Y direction.
+     * Control must be added to some pointer event observer array, before
+     * calling this function. Also removing control from observer will 
+     * reset this treshold.
+     *
+     * NOTE: Not every unit type is feasible. Only these types are supported:
+     * EAlfUnitPixel, EAlfUnitRelativeToDisplay, EAlfUnitS60
+     *
+     * \code
+     *  Display()->Roster().SetPointerEventObservers( EAlfPointerEventReportDrag, *this );     
+     *  Display()->Roster().SetPointerDragThreshold(*this,TAlfXYMetric(TAlfMetric(0.2,EAlfUnitRelativeToDisplay),TAlfMetric(0.1,EAlfUnitRelativeToDisplay)));     
+     * \endcode
+     *
+     * @param aControl  Control to which treshold affects.
+     * @param aXYMetric  Treshold in metric units.
+     * @return Error code.
+     */
+    IMPORT_C TInt SetPointerDragThreshold(const CAlfControl& aControl, const TAlfXYMetric& aXYMetric);
+
+    /**
+     * Disables long tap events when dragging is going on. Default 
+     * functionality is that long tap event will be delivered simultaneously
+     * with drag events. Control must be added to some pointer event observer 
+     * array, before calling this function. Also removing control from 
+     * observer will reset this feature.
+     *
+     * \code
+     *  Display()->Roster().SetPointerEventObservers( EAlfPointerEventReportDrag, *this );     
+     *  Display()->Roster().DisableLongTapEventsWhenDragging(*this);
+     * \endcode
+     *
+     * @param aControl  Control to which disabling affects.
+     * @param aDisable  Boolean to indicate whether feature will be disabled 
+     *                  or not.
+     * @return Error code.
+     */
+    IMPORT_C TInt DisableLongTapEventsWhenDragging(const CAlfControl& aControl, TBool aDisable = ETrue);
+
+    /**
+     * Adds the given MAlfControlGroupOrderChangedObserver object to the observer array of this CAlfRoster.
+     *
+     * The observer object will be notified whenever relative order of control groups changes in this CAlfRoster.
+     *
+     * @see RemoveControlGroupOrderChangedObserver()
+     * @see MAlfControlGroupOrderChangedObserver
+     *
+     * @param aObserver The MAlfControlGroupOrderChangedObserver object to add to the array of active observers.
+     *
+     * @since S60 v5.0
+     */
+    IMPORT_C void AddControlGroupOrderChangedObserverL(MAlfControlGroupOrderChangedObserver& aObserver);
+    
+    /**
+     * Removes the given MAlfControlGroupOrderChangedObserver object from the observer array of this CAlfRoster.
+     *
+     * If the MAlfControlGroupOrderChangedObserver object is not found from the array of observers the call
+     * is ignored.
+     *
+     * @see AddControlGroupOrderChangedObserverL()
+     * @see MAlfControlGroupOrderChangedObserver
+     *
+     * @param aObserver MAlfControlGroupOrderChangedObserver object to be searched from the array of observers
+     *                  and removed if found.
+     *
+     * @since S60 v5.0     
+     */
+    IMPORT_C void RemoveControlGroupOrderChangedObserver(MAlfControlGroupOrderChangedObserver& aObserver);
+        
+private:
+    
+    void ChangeInputFocus(CAlfControl* aControl);
+    void ReportHostsAboutChangingInputFocus( CAlfControl* aOldFocusControl, CAlfControl* aNewFocusControl );
+    void NotifyControlGroupOrderChangedObservers();
+
+private:
+    
+    // Private data. Owned.
+    struct TPrivateData;
+    TPrivateData* iData;
+
+    };
+
+
+#endif // C_ALFROSTER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfscreenbuffer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,224 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 buffer class
+*
+*/
+
+
+
+#ifndef C_ALFSCREENBUFFER_H
+#define C_ALFSCREENBUFFER_H
+
+#include <e32base.h>
+
+class CAlfEnv;
+
+/**
+ * @deprecated 
+ *  Observer class for screen buffer.
+ */
+class MAlfScreenBufferObserver
+    {
+    /**
+     * Screen buffer Events.
+     */
+public:     
+        enum TAlfScreenBufferEvent
+            {
+            ENone,
+            ECreated,  			// Buffer created 
+            EDeleted, 			// Buffer deleted
+            ERestored, 			// Not yet implemented
+            EReleased, 			// Not yet implemented
+            EBufferDrawComplete // Buffer has been drawn to window
+            };
+    
+    /**
+     * Alf calls this when all the content have been draw to the back buffer.
+     * If EFalse is returned, the buffer is locked until the observer calls RequestNextBuffer().
+     * If ETrue is returned, the RequestNextBuffer() is called automatically, immediately after this method returns.
+     *
+     * @param aBufferUid Unique id of the buffer.
+     * @param aDisplayRect Screen buffer rect.
+     * @param aDirtyRect Dirty rect for the buffer.
+     * @return Return True, if buffer can be freed automatically after this call.
+     */
+    virtual TBool BufferComplete(TUid aBufferUid, TRect& aDisplayRect, TRect& aDirtyRect) = 0;
+    
+    /**
+     * Alf calls this when e.g. the back buffer is created or deleted.
+     *
+     * @param aId The unique id of the buffer.
+     * @param aEvent @see MAlfScreenBufferObserver::TAlfScreenBufferEvent
+     */
+    virtual void HandleScreenBufferEvent(TUid aBufferUid, TInt aEvent) = 0;
+    };
+
+
+/**
+ * This interface is to be used when drawing the buffer to the window etc.      
+ */
+class MAlfBufferDrawer
+    {
+public:
+    /**
+     * Clean all resources (usually delete this).
+     */
+    virtual void ReleaseDrawer() = 0;    
+    };
+
+/**
+ * @deprecated 
+ * This interface is to be used when modifying the buffer (sent back to server).      
+ * Could be attached to special content visual.
+ */
+class MAlfBufferGc
+    {
+    public:
+    /**
+     * Clean all resources (usually delete this).
+     */
+    virtual void ReleaseGc() = 0;
+    };
+
+
+/**
+ * @deprecated 
+ * The class for managing screen buffers.
+ *
+ * Usage:
+ * @code
+ * 
+ * //Create screen buffer and observer
+ * CAlfScreenBuffer* screenBuffer = CAlfScreenBuffer::NewL( *iEnv );
+ * CallbackObserver* observer = new (ELeave) CallbackObserver();
+ * 
+ * // Add observer
+ * screenBuffer->AddObserverL( testScreenBufferUid, observer );
+ * MAlfBufferDrawer* drawer = screenBuffer->GetDrawingInterface( SYMBIAN_BUFFER_DRAWER_UID, 
+ * 																	testScreenBufferUid );
+ * 
+ * //Request for next sceenbuffer
+ * screenBuffer->RequestNextBuffer( testScreenBufferUid );
+ * 
+ * drawer->ReleaseDrawer();
+ * drawer = NULL; 
+ * 
+ * //Remove observer
+ * 	screenBuffer->RemoveObserver( testScreenBufferUid );
+ * 
+ * //Clean up
+ *  delete screenBuffer;
+ *  delete observer;
+ * 
+ * @endcode
+ */
+NONSHARABLE_CLASS(CAlfScreenBuffer): public CBase
+    {
+public:
+	enum TAlfScreenBufferFlags 
+		{
+		EFlagNone = 0,
+		EFlagDisableDrawToWindow = 1 // Do not automatically draw buffer content to the window
+		};
+
+    /**
+     * Constructor.
+     *
+     * @param aEnv Alf environment.
+     */
+    IMPORT_C static CAlfScreenBuffer* NewL(CAlfEnv& aEnv);
+    
+    /**
+     * Constructor.
+     * 
+     * Creates own Alf environment
+     */
+    IMPORT_C static CAlfScreenBuffer* NewL();
+    
+    /**
+     * Destructor.
+     *
+     * If Alf environment is owned, it is deleted.
+     */
+    IMPORT_C virtual ~CAlfScreenBuffer();
+    
+    /**
+     * Returns an instance of an interface for drawing the buffer e.g. to a window. 
+     *
+     * @param aInterfaceUid Unique id of the interface.
+     * @param aBufferUid Unique id of the buffer.
+     */
+    IMPORT_C MAlfBufferDrawer* GetDrawingInterface(TUid aInterfaceUid, TUid aBufferUid);
+    
+    /**
+     * Returns an instance of an interface for drawing to the buffer. 
+     *
+     * @param aInterfaceUid Unique id of the interface.
+     * @param aBufferUid Unique id of the buffer.
+     */
+    IMPORT_C MAlfBufferGc* GetGraphicsContext(TUid aInterfaceUid, TUid aBufferUid);  
+    
+    /**
+     * Request next buffer from the server. Unlocks buffer for drawing.
+     *
+     * @param aBufferUid Unique id of the buffer.
+     */
+    IMPORT_C void RequestNextBuffer(TUid aBufferUid);  
+    
+    /**
+     * Request the server to draw the screen buffer to the window.
+     *
+     * @param aBufferUid Unique id of the buffer.
+     */
+    IMPORT_C void RequestBufferDraw(TUid aBufferUid);  
+    
+    /**
+     * Add an observer for a buffer.
+     *
+     * @param aBufferUid Unique id of the buffer.
+     * @param aObserver Pointer to the observer.
+     * @param aPriority Not yet implemented.
+     */
+    IMPORT_C void AddObserverL(TUid aBufferUid, MAlfScreenBufferObserver* aObserver, TInt aPriority = 0  );  
+    
+    /**
+     * Add an observer for a buffer.
+     *
+     * @param aBufferUid Unique id of the buffer.
+     * @param aFlags Screen buffer flags.
+     * @param aObserver Pointer to the observer.
+     * @param aPriority Not yet implemented.
+     */
+    IMPORT_C void AddObserverL(TUid aBufferUid, TUint aFlags, MAlfScreenBufferObserver* aObserver, TInt aPriority = 0  );  
+    
+    /**
+     * Remove observer from the buffer.
+     *
+     * @param aBufferUid Unique id of the buffer.
+     */
+    IMPORT_C void RemoveObserver(TUid aBufferId);  
+
+private: 
+    	CAlfScreenBuffer();
+    	CAlfScreenBuffer(CAlfEnv& aEnv);
+		void ConstructL(CAlfEnv* aEnv, TBool aIsAlfEnvOwned);
+		void ConstructL();
+		
+private:    
+        class CPrivateData;
+        CPrivateData* iData; 
+    };
+
+#endif // C_ALFSCREENBUFFER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfscrollerevent.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,148 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Events generated by scrollers.
+*
+*/
+
+
+
+#ifndef T_ALFSCROLLEREVENT_H
+#define T_ALFSCROLLEREVENT_H
+
+#include <e32std.h>
+/**
+ * ScrollerEvent class.
+ * Usage:
+ * @code
+ * 
+ * TBool CMyControl::OfferEventL(const TAlfEvent& aEvent)
+ *   {
+ *   TBool consumed(EFalse);
+ *   if ( aEvent.IsPointerEvent() )
+ *       {
+ *       CAlfVisual* visual = aEvent.Visual();
+ *       //Orientation for scroller
+ *       TAlfScrollerEvent::TOrientation orientation = TAlfScrollerEvent::EVertical;
+ *       
+ *       if ( aEvent.PointerDown() )
+ *           {
+ *           //if ( some condition to start scroller event handling )
+ *               {
+ *               //Create event instance
+ *               TAlfScrollerEvent scrollEvent(TAlfScrollerEvent::EMoveByItem, orientation, -1);
+ *               TAlfEvent event( *(visual->Display()), scrollEvent );
+ *               //Pass it to handler
+ *               scrollerInputHandler->OfferEventL( event ); 
+ *               consumed = ETrue;
+ *               }
+ *           }
+ *        }
+ *    return consumed;
+ *    }
+ * @endcode
+ * @lib alfclient.lib
+ * @since S60 xxx
+ */
+NONSHARABLE_CLASS( TAlfScrollerEvent )
+    {
+    
+public:
+    /**
+     * Indicates what type of scroller the event originated in
+     */
+    enum TOrientation
+        {
+        EVertical,
+        EHorizontal
+        };
+
+    /** 
+     *Scroller event code
+     */
+    enum TCode
+        {
+        EMoveByItem, // Moves the view by a single logical unit. i.e. a text line or a list item
+        EMoveByView, // Moves the view by an amount similar to a view height/width
+        EMoveToPosition // Moves the view top to the requested position
+        };
+
+public: 
+    /* Constructors. */
+   
+    /**
+     * Constructor.
+     */
+    IMPORT_C TAlfScrollerEvent( TCode aCode, TOrientation aOrientation, TInt aMagnitude );
+
+    /**
+     * Constructor.
+     *
+     * Supplied only for default construction within TAlfEvent
+     */
+    TAlfScrollerEvent();
+    
+public: // Access methods
+
+    /**
+     * @return the event code for the scroller event
+     */
+    IMPORT_C TCode Code() const;
+    
+    /**
+     * Orientation of the scroller
+     *
+     * @return orientation of the scroller generating this event
+     */
+    IMPORT_C TOrientation Orientation() const;
+    
+    /**
+     * Access to the size of the scroller event.
+     *
+     * This magnitude represents the number of items, views, or other event code-dependent quantity
+     *
+     * For EMoveByItem, this number is the number of items to move forward. If negative, then it represents 
+     * moving the view backward by this number of items.
+     *
+     * For EMoveByView, this number is the number of views forward to move.
+     *
+     * For EMoveToPosition, this number is in the arbitrary units of the associated scroller model. (i.e,.in order to
+     * generate this type of event you must be observing the corresponding @c MAlfScrollerModelReader )
+     *
+     *  @return the magnitude of the event
+     */
+    IMPORT_C TInt Magnitude() const;
+    
+private: 
+    
+    /** 
+     * The scroller event code. 
+     */
+    TCode iCode;
+
+    /**
+     * Orientation of this scroller
+     */
+    TOrientation iOrientation;    
+
+    /**
+     * A magnitude representing the number of items, views, or other code-dependent quantity
+     * @see Magnitude()
+     */
+    TInt iMagnitude;
+    
+    TInt iSpare;    
+    };
+
+
+#endif // T_ALFSCROLLEREVENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfshadowborderbrush.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,146 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Shadowed border brush
+*
+*/
+
+
+
+#ifndef C_ALFSHADOWBORDERBRUSH_H
+#define C_ALFSHADOWBORDERBRUSH_H
+
+#include <alf/alfbrush.h>
+#include <alf/alfmetric.h>
+
+class CAlfEnv;
+
+/**
+ *  Shadowed border brush
+ *
+ * A brush that creates a shadow border around its visual.
+ * When comparing a shadow border brush to a drop shadow brush, the main difference is that 
+ * the shadow border brush draws only the borders, while the drop shadow brush fills 
+ * the entire shadow area.
+ * 
+ * The shadow border brush draws the shadow on the outside of the visual rectangle. 
+ * One can conveniently combine it with a regular border brush.
+ * 
+ * Usage:
+ * @code
+ * 
+ * //Create ImageVisual and set image
+ * CAlfImageVisual* imagevisual = CAlfImageVisual::AddNewL( control );
+ * imagevisual->SetImage(*image);
+ * imagevisual->SetFlags(EAlfVisualFlagManualLayout);
+ * 
+ * //Manually set up an image visual to be 2/3 of the original size of the image 
+ * Size texSize = image->Texture().Size();
+ * imagevisual->SetRect(TRect(Point(50, 50),TSize(texSize.iWidth*2/3, texSize.iHeight*2/3)));
+ * imagevisual->EnableBrushesL();
+ * 
+ * //Create shadow border brush
+ * CAlfShadowBorderBrush* brush = CAlfShadowBorderBrush::NewL(iEnv, TAlfMetric( 0.25 ) );
+ * brush->SetOpacity(0.25);
+ * imagevisual->Brushes()->AppendL(brush, EAlfHasOwnership);
+ *
+ * @endcode
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v 3.2
+ */
+NONSHARABLE_CLASS( CAlfShadowBorderBrush ): public CAlfBrush
+    {
+
+public:
+
+    /**
+     * Constructor.
+     *
+     * @param aEnv Environment
+     * @param aWidth Shadow border width in given metric units.
+     */
+    IMPORT_C static CAlfShadowBorderBrush* NewL(
+        CAlfEnv& aEnv,
+        const TAlfMetric& aWidth );
+
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     *
+     * @param aEnv Environment
+     * @param aWidth Shadow border width in given metric units.
+     */
+    IMPORT_C static CAlfShadowBorderBrush* NewLC(
+        CAlfEnv& aEnv,
+        const TAlfMetric& aWidth );
+
+    /**
+     * Constructor.
+     * @deprecated migrate to using metrics instead.     
+     */
+    IMPORT_C static CAlfShadowBorderBrush* NewL(
+        CAlfEnv& aEnv,
+        TInt aWidth );
+
+    /**
+     * Constructor. The new brush is left on the cleanup stack.
+     * @deprecated migrate to using metrics instead.     
+     */
+    IMPORT_C static CAlfShadowBorderBrush* NewLC(
+        CAlfEnv& aEnv,
+        TInt aWidth );
+
+    
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfShadowBorderBrush();
+    
+    /**
+     * Gets width of the shadow border.
+     * @return Width magnitude of the border in metric units.
+     */
+    IMPORT_C const TAlfTimedValue& Width() const;
+
+    /**
+     * Sets width of the shadow border.
+     * @param aWidth Width magnitude of the border in metric units.
+     */
+    IMPORT_C void SetWidth( const TAlfTimedValue& aWidth );
+
+    /**
+     * Sets width of the shadow border.
+     * @param aWidth Width of the border in metric units.
+     */
+    IMPORT_C void SetWidth( const TAlfMetric& aWidth );
+
+
+private:
+
+
+    CAlfShadowBorderBrush();
+
+    void ConstructL( CAlfEnv& aEnv, TInt aWidth );
+
+    void ConstructL( CAlfEnv& aEnv, const TAlfMetric& aWidth );
+
+private:
+
+    struct TShadowBorderPrivateData;
+    TShadowBorderPrivateData* iShadowBorderData;
+
+    };
+
+
+
+#endif // C_ALFSHADOWBORDERBRUSH_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfstatic.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Static class.
+*
+*/
+
+
+
+#ifndef __ALFSTATIC_H__
+#define __ALFSTATIC_H__
+
+#include <e32base.h>
+
+/* Forward declarations. */
+class CAlfEnv;
+
+/**
+ * Miscellaneous globally used functions, and thread local storage space.
+ * 
+ * CAlfStatic contains all the functions that tend to be used across classes.
+ * These functions are written in a non-OO fashion because
+ * they are used everywhere, so passing data such as delta step down through the
+ * entire class heirarchy is inefficient.
+ */
+NONSHARABLE_CLASS(CAlfStatic) : public CBase
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructor. The user application should not explicitly
+     * construct a CAlfStatic - it is constructed by CHuiEnv.
+     *
+     * @param aPrimaryEnv The toolkit environment. 
+     */
+    IMPORT_C static CAlfStatic* NewLC(CAlfEnv* aPrimaryEnv);
+
+    /**
+     * Constructor. The user application should not explicitly
+     * construct a CAlfStatic - it is constructed by CHuiEnv.
+     *
+     * @param aPrimaryEnv The toolkit environment. 
+     */
+    IMPORT_C static CAlfStatic* NewL(CAlfEnv* aPrimaryEnv);
+
+
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfStatic();
+
+
+    /* Methods. */
+
+    /**
+     * Determines the primary CHuiEnv instance.
+     */
+    IMPORT_C static CAlfEnv& Env();
+
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor. Should not be called through the API.
+     */
+    CAlfStatic();
+
+    /**
+     * Second-phase constructor.
+     * @param aPrimaryEnv Pass in the environment.
+     */
+    void ConstructL(CAlfEnv* aPrimaryEnv);
+
+
+private:
+
+    /* Private methods */
+
+    /**
+     * Returns a pointer to the thread-local data struct.
+     */
+    IMPORT_C static struct TTlsData* Data();
+
+    /**
+     * Updates the toolkit's time counters. This includes the toolkit's
+     * realtime clock, the internal absolute clock (which is affected by the
+     * time factor), the amount of elapsed time since last UpdateTime()
+     * invocation, and the amount of elapsed time since the first UpdateTime()
+     * invocation (which was done in the beginning of the first refresh).
+     * 
+     * @param aData TLS Data which encapsulates the internal time variables.
+     */
+    static void UpdateTime(struct TTlsData* aData);
+
+private:
+
+    /**
+     * Thread local storage for this DLL, as we cannot declare static
+     * global variables in Symbian.
+     */
+    struct TTlsData* iData;
+
+    friend class CAlfEnv;
+    };
+
+#endif //__ALFSTATIC_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfsymbiansbdrawer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Symbian screenbuffer drawing IF
+*
+*/
+
+
+
+
+#ifndef __ALFSYMBIANSBDRAWER_H__
+#define __ALFSYMBIANSBDRAWER_H__
+
+
+#include "alf/alfscreenbuffer.h"
+
+const TUid KAlfSymbianBufferDrawerUid = {0x2000e5a2}; 
+
+class CBitmapContext;
+class CFbsBitmap;
+
+/**
+ * The class for drawing screen buffer to a bitmap context.
+ *  
+ * Usage:
+ * @code
+ * 
+ * //Create screen buffer instance
+ * CAlfScreenBuffer* screenBuffer = CAlfScreenBuffer::NewL( *iEnv );
+ * //add the candidate , who has implemented MAlfScreenBufferObserver interface, as observer
+ * 
+ * screenBuffer->AddObserverL( testScreenBufferUid, observer );
+ * 
+ *  //Get symbian bufferdrawer instance
+ * CAlfSymbianBufferDrawer* drawer = ( CAlfSymbianBufferDrawer* )screenBuffer->
+ * 										GetDrawingInterface( SYMBIAN_BUFFER_DRAWER_UID, 
+ * 															 testScreenBufferUid );
+ * 
+ *  // Draw
+ *  CFbsBitGc* context = NULL;
+ *  User::LeaveIfError( device->CreateContext( context ) );
+ *  drawer->DrawBuffer( context, TPoint(), iDisplayRect );
+ * 
+ * 
+ * // release
+ * 	drawer->ReleaseDrawer();
+ * 	drawer = NULL;
+ * 
+ * // Cleanup  
+ * 	drawer->ReleaseDrawer();
+ * 	drawer = NULL;
+ * 	screenBuffer->RemoveObserver( testScreenBufferUid );
+ *  delete screenBuffer;
+ * 
+ * @endcode
+ * 
+ * @see ScreenBuffer::getDrawingInterface()
+ * @lib osnalf.lib
+ * @since S60 xxx
+ */
+NONSHARABLE_CLASS(CAlfSymbianBufferDrawer) : public CBase, public MAlfBufferDrawer
+    {
+    public:    
+    	/**
+     	 * Draw buffer to the bitmap context.
+     	 *
+     	 * @param aContext Drawing context.
+     	 * @param aPos Position on destination.
+     	 * @param aRect Source rectangle.
+     	 */
+        IMPORT_C void DrawBuffer(CBitmapContext& aContext, const TPoint& aPos, const TRect& aRect);
+        
+    	/**
+     	 * Draw buffer to the bitmap context.
+     	 *
+     	 * @param aContext Drawing context.
+     	 * @param aPos Position on destination.
+     	 * @param aRect Source rectangle.
+     	 */
+        IMPORT_C void DrawBufferMasked(CBitmapContext& aContext, const CFbsBitmap* aMask,const TPoint& aPos, const TRect& aRect);
+                
+    	/**
+     	 * Get pointers to buffer bitmaps. If the screen buffer is not yet ready, NULL pointers are returned. 
+     	 * This method does not get the ownership of the bitmaps. 
+     	 *
+     	 * @param aBitmap Buffer bitmap.
+     	 * @param aMask Buffer mask.
+     	 */
+   		IMPORT_C void GetBufferBitmaps(CFbsBitmap*& aBitmap, CFbsBitmap*& aMask) const;
+
+    public: // from MAlfBufferDrawer        
+        IMPORT_C void ReleaseDrawer();
+        
+    protected:    
+    	/**
+     	 * Constuctors and destructor
+     	 */
+        CAlfSymbianBufferDrawer();
+        
+        virtual ~CAlfSymbianBufferDrawer();
+        
+        static CAlfSymbianBufferDrawer* NewL();
+        
+        void ConstructL();
+        
+    	/**
+     	 * Setup for drawing.
+     	 *
+     	 * @param aBitmapHandle Screen buffer bitmap handle.
+     	 * @param aMaskHandle Mask for the bitmap.
+     	 */
+        void SetBufferL(TInt aBitmapHandle, TInt aMaskHandle);
+        
+        
+    private:
+        struct TPrivData;
+        TPrivData* iPrivData;
+        friend class CAlfScreenBuffer;
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alftextstyle.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,344 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Text style class.
+*
+*/
+
+
+
+#ifndef C_ALFTEXTSTYLE_H
+#define C_ALFTEXTSTYLE_H
+
+#include <e32base.h>
+#include <gdi.h>    // for TRgb
+#include <alf/alftexture.h>
+
+class CAlfEnv;
+class CAlfGenComponent;
+class THuiFont;
+class CAlfTextStyleManager;
+
+/**
+ * CAlfTextStyle presents an abstract text style implementation.
+ * Its main purpose is to act as an encapsulation of a particular text style.
+ * Usage:
+ * @code
+ * 
+ *  //Get Textstyle manager from environment
+ *  CAlfTextStyleManager* styleMgr = &iEnv->TextStyleManager();
+ * 
+ *  //Get textstyle
+ *  TInt styleId = styleMgr->CreatePlatformTextStyleL();
+ * 	CAlfTextstyle* style =  styleMgr->TextStyle( styleId );
+ * 
+ *  //Customise textstyle
+ *  style->SetStrikeThrough( ETrue );
+ *  style->SetUnderline( ETrue );
+ * 
+ *  //Assign style to text visual
+ *  textVisual->SetTextStyle( style->Id() );
+ * 
+ *  //Cleanup 
+ *  styleMgr->DeleteTextStyle(  styleId );
+ *  delete iEnv;
+ * 
+ * @endcode
+ * 
+ * @see CAlfTextStyleManager
+ * Derived platform dependant classes will implement their own version of this class
+ */
+NONSHARABLE_CLASS( CAlfTextStyle ): public CBase
+    {
+
+public:
+
+    /* Constructors and destructor. */
+	
+	/**
+	 * Destructor.
+	 */
+	~CAlfTextStyle();
+	
+	/**
+	 * Constructs a new CAlfTextStyle object.
+	 *
+     * @param aEnv					Current Alf environment.
+     * @param aId					The unique ID of this text style. Created by CAlfTextStyleManager.
+     * @param aImplementationId 	Describes the type of text style that is created (platform text style, etc.)
+     * @param aConstructionParams 	Construction parameters.
+	 */
+	static CAlfTextStyle* NewL(CAlfEnv& aEnv, TInt aId, TInt aImplementationId, const TDesC8& aConstructionParams);
+
+	/**
+	 * Constructs a new CAlfTextStyle object and leaves it into the cleanup stack.
+	 *
+     * @param aEnv					Current Alf environment.
+     * @param aId					The unique ID of this text style. Created by CAlfTextStyleManager.
+     * @param aImplementationId 	Describes the type of text style that is created (platform text style, etc.)
+     * @param aConstructionParams 	Construction parameters.
+	 */
+	static CAlfTextStyle* NewLC(CAlfEnv& aEnv, TInt aId, TInt aImplementationId, const TDesC8& aConstructionParams);
+	
+    /**
+     * Returns the S60 font style id of this text style. Ids are defined in avkon.hrh in 
+     * TAknLogicalFontId enumeration.
+     * 
+     * @return The S60 font style id of this text style.
+     */
+    TInt FontStyleId() const;
+
+    /**
+     * Sets the S60 font style id for this text style. Alf representation of the text style
+     * stores this attribute for its own reference. Setting font style id here only
+     * sets the font style id in alf private data. Does not set the font style id in
+     * hitchcock core. 
+     * Ids are defined in avkon.hrh in TAknLogicalFontId enumeration.
+     * 
+     * @param aFontStyleId The S60 font style id.
+     */
+    void SetFontStyleId(TInt aFontStyleId);
+
+    /**
+     * Returns the parent id of this text style. Text styles can be cascaded
+     * so that the child text styles use the parameters of their parents unless
+     * the parameters are explicitly overridden in the child.
+     * 
+     * @return the parent id of this text style.
+     */
+    IMPORT_C TInt ParentId() const;
+    
+    /**
+     * Sets the parent style for this text style. The parent style has to be created
+     * through the CAlfTextStyleManager. Parent Id of a preconfigured text style
+     * cannot be changed.
+     * @See TAlfPreconfiguredTextStyle
+     * 
+     * @param aParentId the parent style for this text style
+     * @see CAlfTextStyleManager
+     */
+    IMPORT_C void SetParentId(TInt aParentId);
+    
+    /**
+     * Returns the id of the text style. This id is set by the CAlfTextStyleManager.
+     * 
+     * @return The unique id of this text style.
+     */
+    IMPORT_C TInt Id() const;
+    
+    /**
+     * Returns the text color of this text style.
+     * 
+     * @return A TRgb object that represents the color of the text used with this
+     *         text style.
+     */
+    IMPORT_C TRgb TextColor() const;
+    
+    /**
+     * Sets the color of the text rasterized with this style. Text color of a preconfigured 
+     * text style cannot be changed.
+     * @See TAlfPreconfiguredTextStyle     
+     * 
+     * @param aTextColor The color of the text to be set.
+     */
+    IMPORT_C void SetTextColor(const TRgb& aTextColor);
+    
+	/**
+	 * Gets text style text size attribute in twips.
+	 * 
+ 	 * @param aIsDecoratedSize If true, the decoration size (the area reserved for decoration) 
+ 	 *                         is added to the actual text size. The decoration here means
+ 	 *                         various effects that can be added to the text, for example a 
+ 	 *                         shadow.
+ 	 *
+	 * @return The actual text size in twips plus the decoration size if decorated size
+	 *         was requested.      .
+	 */
+	IMPORT_C TInt TextSizeInTwips(TBool aIsDecoratedSize = EFalse) const;
+	
+    /**
+     * Sets the text size of this style in screen size independent units (twips). Text size
+     * of a preconfigured text style cannot be changed.
+     * @See TAlfPreconfiguredTextStyle     
+     * 
+     * @param aTextSizeInTwips Size of the text in twips.
+ 	 * @param aIsDecoratedSize If true, the decoration size is subtracted from the text size
+ 	 *                         to ensure that the rasterized text will fit into the reserved
+ 	 *                         area including the decoration. The decoration here means various
+ 	 *                         effects that can be added to the text, for example a shadow .
+     */    
+    IMPORT_C void SetTextSizeInTwips(TInt aTextSizeInTwips, TBool aIsDecoratedSize = EFalse);
+    
+	/**
+	 * Gets text style text size attribute in pixels.
+	 * 
+ 	 * @param aIsDecoratedSize If true, the decoration size (the area reserved for decoration) 
+ 	 *                         is added to the actual text size. The decoration here means
+ 	 *                         various effects that can be added to the text, for example a 
+ 	 *                         shadow.
+ 	 *
+	 * @return The actual text size in pixels plus the decoration size if decorated size
+	 *         was requested.
+	 */
+	IMPORT_C TInt TextSizeInPixels(TBool aIsDecoratedSize = EFalse) const;
+	
+    /**
+     * Sets the text size of this style in pixels. Text size of a preconfigured 
+     * text style cannot be changed.
+     * @See TAlfPreconfiguredTextStyle
+     * 
+     * @param aTextSizeInPixels Size of the text in pixels.
+ 	 * @param aIsDecoratedSize If true, the decoration size is subtracted from the text size
+ 	 *                         to ensure that the rasterized text will fit into the reserved
+ 	 *                         area including the decoration. The decoration here means various
+ 	 *                         effects that can be added to the text, for example a shadow .
+     */    
+    IMPORT_C void SetTextSizeInPixels(TInt aTextSizeInPixels, TBool aIsDecoratedSize = EFalse);
+    
+    /**
+     * Indicates whether the text is rasterized in bold or normal.
+     * 
+     * @return Boolean indicating whether text is bold or not.
+     */    
+    IMPORT_C TBool IsBold() const;
+    
+    /**
+     * Sets the bold on and off in the text style. Setting bold on and off is
+     * not possible for a preconfigured text style.
+     * @See TAlfPreconfiguredTextStyle
+     * 
+     * @param aIsBold True for bold and false normal.
+     */    
+    IMPORT_C void SetBold(TBool aIsBold);
+    
+    /**
+     * Indicates whether the text is rasterized in italic or normal.
+     * 
+     * @return Boolean indicating whether text is italic or not.
+     */    
+    IMPORT_C TBool IsItalic() const;
+    
+    /**
+     * Sets the italic on and off in the text style. Setting italic on and off is
+     * not possible for a preconfigured text style.
+     * @See TAlfPreconfiguredTextStyle
+     * 
+     * @param aIsItalic True for italic and false for normal.
+     */    
+    IMPORT_C void SetItalic(TBool aIsItalic);
+    
+    /**
+     * Indicates whether the text is underlined or not.
+     * 
+     * @return Boolean indicating whether text is underlined.
+     */    
+    IMPORT_C TBool IsUnderline() const;
+    
+    /**
+     * Sets the underlining on and off in the text style. Setting underline on and off is
+     * not possible for a preconfigured text style.
+     * @See TAlfPreconfiguredTextStyle
+     * 
+     * @param aIsUnderline True for underlined and false for normal text.
+     */    
+    IMPORT_C void SetUnderline(TBool aIsUnderline);
+    
+    /**
+     * Indicates whether the text is struck through or not.
+     * 
+     * @return Boolean indicating whether text has a strike through or not.
+     */        
+    IMPORT_C TBool IsStrikeThrough() const;
+    
+    /**
+     * Sets the strike through on and off in the text style. Setting strike through on 
+     * and off is not possible for a preconfigured text style.
+     * @See TAlfPreconfiguredTextStyle
+     * 
+     * @param aIsStrikeThrough True for text with strike through and false for normal text.
+     */    
+    IMPORT_C void SetStrikeThrough(TBool aIsStrikeThrough);
+
+    /**
+     * Gets the typeface in use for the text style.
+     * The typeface may be blank.
+     * 
+     * @param on return, contains the typeface information.
+     */    
+    void GetTypeface(TTypeface& aTypeface) const;
+
+    /**
+     * Gets the typeface in use for the text style.
+     * The typeface may be zero length, but the pointer returned will not be NULL
+     * 
+     * @return a descriptor on the heap containing the typeface name, owned by the caller.
+     */    
+    IMPORT_C HBufC* TypefaceNameL() const;
+    
+    /**
+     * Sets the text style text pane height in pixels. 
+     *
+     * @note This means that the text size (i.e. the return value from calling @c TextSizeInPixels)
+     *     will be in general smaller than the text pane height, as the text pane is intended to match 
+     *     the font's maximum extent.
+     * @note In order to convert a height from a metric value into pixels, use @c CHuiVisual::LocalToDisplay.
+     * 
+     * @param aTextPaneHeight   The new text style text pane height in pixels.
+     * @param aIsDecoratedSize If true, the decoration size is subtracted from the text pane height
+     *          to ensure that the rasterized text will fit into the reserved area including the 
+     *          decoration. The decoration here means various effects that can be added to the 
+     *          text, for example a shadow.
+     */    
+     IMPORT_C void SetTextPaneHeightInPixels(TInt aTextPaneHeight, TBool aIsDecoratedSize = EFalse);
+            
+    /**
+     * Return associated CAlfGenComponent object.
+     */
+    CAlfGenComponent* Comms() const;
+    
+    /**
+     * Return associated serverside object.
+     */
+    TInt ServerHandle() const;
+
+#ifdef ALF_RASTER_TEXT    
+public: // internal utils
+
+    THuiFont* Font() const; // returns used font, either own ir parent style
+    THuiFont* OwnFont(); // ensures that style has its own font override and returns that
+    void SetFont(THuiFont* aFont);
+    void ReportChanged(); // propagate changes on mesh (asynch)
+    void RasterizeLineL(const TDesC& aTextLine, CAlfTexture** aTargetTexture); // uploads rasterized texture to scene
+    TSize LineExtentsL(const TDesC& aTextLine); // measures the extents for given text
+    void SetManager(CAlfTextStyleManager* aManager);
+#endif    
+protected:
+	/**
+	 * Constructor.
+	 */
+	CAlfTextStyle();	
+	
+    /**
+     * Second phase constructor.
+     */
+    void ConstructL(CAlfEnv& aEnv, TInt aId, TInt aImplementationId, const TDesC8& aConstructionParams);	
+	    
+private:
+	
+    // Private data. Own. 
+    struct TPrivateData;
+    TPrivateData* iData;	
+	
+    };
+
+#endif // C_ALFTEXTSTYLE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alftextstylemanager.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,240 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Text style manager class.
+*
+*/
+
+
+
+#ifndef C_ALFTEXTSTYLEMANAGER_H
+#define C_ALFTEXTSTYLEMANAGER_H
+
+#include <e32base.h>
+
+/** 
+ * Preconfigured text styles.
+ * Matching text styles always exist in the text style manager.
+ * It is possible to retrieve the associated text style object through
+ * CAlfTextStyleManager::TextStyle() - interface.
+ */
+enum TAlfPreconfiguredTextStyle
+    {
+    EAlfTextStyleNormal = 0,
+    EAlfTextStyleNormalItalic,
+    EAlfTextStyleMenuItem,
+    EAlfTextStyleSmall,
+    EAlfTextStyleMenuSmall,
+    EAlfTextStyleMenuTitle,
+    EAlfTextStyleLarge,
+    EAlfTextStyleSoftkey,
+    EAlfTextStyleSupplement,
+    EAlfTextStyleTitle,
+    
+    /** Not a default alf style, will be treated as normal. */
+    EAlfTextStyleNotAHuiStyle = EAlfTextStyleNormal
+    };
+
+// Forward declarations.
+class CAlfTextStyle;
+class CAlfTextVisual;
+class CAlfEnv;
+
+/**
+ * Text style manager class. This class provides means to create and
+ * query text styles that will be used to render text.
+ * Usage:
+ * 
+ * @code
+ *  //Get Textstyle Manager
+ * CAlfTextStyleManager* styleMgr = &iEnv->TextStyleManager();
+ * 
+ *  // Create a textstyle, by passing fontid and preconfigured textstyle as parent id
+ * TInt newStyleId= styleMgr->CreatePlatformTextStyleL( fontStyleId,
+ * 							 EAlfTextStyleNormal );
+ * CAlfTextStyle* newStyle =  styleMgr->TextStyle( newStyleId );
+ * 
+ * //Copy textstyle
+ * TInt copiedId =  styleMgr->CopyTextStyle( newStyleId );
+ * CAlfTextstyle* copiedStyle =  styleMgr->TextStyle( copiedId );
+ * 
+ * //Delete textstyle
+ * TBool issuccess = styleMgr->DeleteTextStyle( newStyleId );
+ * issuccess = styleMgr->DeleteTextStyle( copiedId );
+ * @endcode
+ * 
+ * @see CAlfTextstyle
+ * @see CAlfEnv::TextstyleManager()
+ * @lib alfclient.lib
+ * @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfTextStyleManager ): public CBase
+    {
+public:
+
+    /* Constructors and destructor. */
+    
+    /**
+     * Constructor.
+     */
+    static CAlfTextStyleManager* NewL(CAlfEnv& aEnv);
+    
+    /**
+     * Constructor.
+     */
+    static CAlfTextStyleManager* NewLC(CAlfEnv& aEnv);
+    
+    /**
+     * Destructor.
+     */    
+    ~CAlfTextStyleManager();
+
+public:
+    
+    /**
+     * Creates a new text style object based on the S60 font style id passed into this method. 
+     * Text style font and size are set according to the given S60 id. Ids are defined in
+     * avkon.hrh in TAknLogicalFontId enumeration.
+     * A unique toolkit specific ID is constructed and returned. This text style can be
+     * accessed anytime through the TextStyle - method based on the unique ID. The default 
+     * text style has always ID 0.
+     * Text styles cascade properties from their parent styles. By default all text styles
+     * are descended from EAlfTextStyleNormal text style.
+     * If an invalid parent id is given the created text style will use EAlfTextStyleNormal
+     * as its parent.
+     * @see TextStyle()
+     *
+     * Created text styles must be deleted with DeleteTextStyle.
+     * @see DeleteTextStyle()
+     * 
+     * @param aFontStyleId The S60 font style id based on which the text style object will be created.
+     * @param aParentId Toolkit specific ID of the parent text style. The text styles are cascaded.
+     *      
+     * @return Unique toolkit specific ID for the created text style.
+     */
+    IMPORT_C TInt CreatePlatformTextStyleL(TInt aFontStyleId, TInt aParentId);
+    
+    /**
+     * Creates a new text style object based on the parent text style id passed into this method. 
+     * Text style font and size will be the same as the given parent style has.
+     * A unique toolkit specific ID is constructed and returned. This text style can be
+     * accessed anytime through the TextStyle - method based on the unique ID.
+     * Text styles cascade properties from their parent styles. By default all text styles
+     * are descended from EAlfTextStyleNormal text style.
+     * If an invalid parent id is given the created text style will use EAlfTextStyleNormal
+     * as its parent.
+     * @see TextStyle()
+     *
+     * Created text styles must be deleted with DeleteTextStyle.
+     * @see DeleteTextStyle()
+     * 
+     * @param aParentId Toolkit specific ID of the parent text style. The text styles are cascaded.
+     *                  The parent of the created text style is EAlfTextStyleNormal by default.
+     * @return Unique toolkit specific ID for the created text style.
+     */
+    IMPORT_C TInt CreatePlatformTextStyleL(TInt aParentId = EAlfTextStyleNormal);
+    
+    /**
+     * Returns a text style object based on the text style id passed into this method.
+     * If no matching text style is found from the system the method returns the EAlfTextStyleNormal
+     * text style. There is a collection of preconfigured text styles available. They can
+     * be queried using the id enumerations from TAlfPreconfiguredTextStyle.
+     * @see CreatePlatformTextStyleL()
+     * 
+     * @param aId A text style id identifying the requested text style in the text style manager.
+     * @return A pointer to a requested text style. Various attributes of the text style 
+     * can be changed using the returned pointer.
+     */
+    IMPORT_C CAlfTextStyle* TextStyle(TInt aId);    
+    
+    /**
+     * Creates a new text style object that is identical with the given source text style.
+     *
+     * Created/copied text styles must be deleted with DeleteTextStyle.
+     * @see DeleteTextStyle()
+     *
+     * @param aSourceId A toolkit specific ID of the text style to be cloned.
+     * @return Unique toolkit specific ID for the created text style.
+     */
+    IMPORT_C TInt CopyTextStyleL(TInt aSourceId);
+  
+    /**
+     * Deletes the given text style.
+     *
+     * @param aId Text style ID to delete.
+     *
+     * @return Error code. KErrNone if text style was deleted
+     *                     KErrArgument if there is no style defined with given ID
+     *                     KErrAccessDenied if the ID refers to pre-defined styles.
+     */ 
+    IMPORT_C TInt DeleteTextStyle(TInt aId);
+
+public: // internal utils
+    CAlfTextStyle* SwitchTextStyle(TInt aStyle, CAlfTextVisual* aUser);
+    void Unregister(CAlfTextVisual* aVisual);
+    void RefreshVisuals(TInt aStyle);
+    void ReleaseAllVisuals();
+    void RefreshAllVisuals();
+    
+protected:
+
+    /* Constructors. */
+    
+    /**
+     * Default constructor.
+     */
+    CAlfTextStyleManager();
+    
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL(CAlfEnv& aEnv);
+    
+private:
+	
+    /**
+     * Constructs a collection of CAlfTextStyle objects to match the ones
+     * in TAlfPreconfiguredTextStyle.
+     * @see TAlfPreconfiguredTextStyle
+     */
+    void ConstructPreconfiguredStylesL();	
+
+    /**
+     * Find free slot index
+     *
+     * @return free slot index
+     */    
+    TInt FindFreeSlotIndex() const;
+    
+    /**
+     * Create a platform style.
+     *
+     * @see CreatePlatformTextStyleL
+     * @see CopyTextStyleL
+     *
+     * @param aFontStyleId The S60 font style id based on which the text style object will be created.
+     * @param aParentId Toolkit specific ID of the parent text style. The text styles are cascaded.
+     * @param aImplementationId 	Describes the type of text style that is created (platform text style, etc.)
+     * @return Unique toolkit specific ID for the created text style.
+     */
+    TInt DoCreatePlatformTextStyleL(TInt aFontStyleId, TInt aParentId, TInt aImplementationId);
+
+private:
+	
+	/* Private data. Owned */
+    struct TPrivateData;    
+    TPrivateData* iData;
+    
+    };
+
+#endif // C_ALFTEXTSTYLEMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alftexture.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,394 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Declares CAlfTexture texture class.
+*
+*/
+
+
+
+#ifndef C_ALFTEXTURE_H
+#define C_ALFTEXTURE_H
+
+#include <coemain.h>
+#include <alf/alftextureautosizeparams.h>
+
+class CAlfEnv;
+class MAlfBitmapProvider;
+class CAlfTextureManager;
+
+/** Flags for texture Uploading. */
+enum TAlfTextureFlags
+    {
+    /** No special actions/behavior needed. */
+    EAlfTextureFlagDefault = 0,
+
+    /**
+     * @deprecated This is default functionality
+     */
+    EAlfTextureFlagRetainResolution = 1,
+
+    /**
+     * @deprecated 
+     * Automatically generates a shadow for the texture.
+     */
+    EAlfTextureFlagGenerateShadow = 2,
+
+    /**
+     * Use to retain the color depth of the
+     * ((up)loaded) image as well as possible. Otherwise
+     * the toolkit may reduce the color depth of the texture
+     * to conserve memory.
+     */
+    EAlfTextureFlagRetainColorDepth = 4,
+
+    /**
+     * If this flag has been set, texturemanager automatically releases and 
+     * restores texture after system skin changes so that it has the
+     * updated content. 
+     */
+    EAlfTextureFlagSkinContent = 8,
+
+    /**
+     * Set if it is not necessary to retain the full resolution of the bitmap. 
+     * Default functionality is try to match texture resolution
+     * with bitmap resolution).
+     * This may save some memory with hardware acceleration, but image quality changes to worse
+     */
+    EAlfTextureFlagDoNotRetainResolution = 0x10,
+
+    /**
+     * Lets texture manager report preferred texture size via MAlfTexturePreferredSizeObserver 
+     * interface and automatically re-request upload from the bitmap provider 
+     * (which should be aware of the new size).
+     * 
+     * Preferred size is determined by the actual usage of the texture and the size(s) that
+     * texture appears on the display.
+     *   
+     * Automatically determined preferred size may not be always the most optimal and 
+     * performance may be degraded due multiple (re)uploads if texture usage changes frequently.
+     * 
+     * Also it is not quaranteed that texture manager is able to report preferred size in 
+     * all possible situations.
+     */
+    EAlfTextureFlagAutoSize = 0x40,
+    
+    /*
+     * If defined the texture manager will not try to check whether or not the texture has
+     * multiple frames. This can be used load animated texture's first frame as a simple image
+     * or to reduce the loading time of a texture (e.g. in case of large size images) if the
+     * user knows that the image does not have any frames. 
+     */
+    EAlfTextureFlagLoadAnimAsImage = 0x80
+    };
+
+
+    
+/**
+ * CAlfTexture is the client side class for all texture objects.
+ *
+ * A CAlfTexture always represents one or more fully loaded (OpenGL ES) texture
+ * objects. When drawing something, TAlfImages are used for determining the
+ * area of  the texture to draw. However, different segments may utilize
+ * textures in different resolutions.
+ * Usage:
+ * @code
+ *  //load texture from Texture Manager
+ *   CAlfTexture* tex = iTextureMgr->LoadTexture(imageFileName1,
+ * 								 EAlfTextureFlagDefault,
+ * 								 AUTO_GENERATED_TEXTURE_ID);
+ *  
+ *  //Use texture to create Image instance
+ *  TAlfImage image( *tex );
+ * 
+ *  //For textures, which should never be released, set priority to be 0
+ *  //see CAlfEnv::Release()
+ *  tex->SetPriority(0);
+ *  
+ *  //cleanup
+ *   delete env; //  delete texturemanager and all the textures.
+ * 
+ * @endcode
+ * @see CAlfTextureManager
+ * @see TAlfImage
+ * @lib alfclient.dll
+ * @since S60 v3.2
+ */
+
+NONSHARABLE_CLASS( CAlfTexture ): public CBase
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CAlfTexture();
+
+    /**
+     * Static factory method. Creates a texture appropriate for the current
+     * renderer.
+     */
+    static CAlfTexture* NewL(CAlfEnv& aEnv, TUid aManagerUid, 
+        TInt aId = 0, TInt aBitmapHandle = 0, TInt aMaskHandle = 0, 
+        TAlfTextureFlags aFlags = EAlfTextureFlagDefault, 
+        TBool aAnimated = EFalse );
+
+    /**
+     * Static factory method. Creates a texture appropriate for the current
+     * renderer.
+     */
+    static CAlfTexture* NewLC(CAlfEnv& aEnv, TUid aManagerUid, 
+        TInt aId = 0, TInt aBitmapHandle = 0, TInt aMaskHandle = 0, 
+        TAlfTextureFlags aFlags = EAlfTextureFlagDefault,
+        TBool aAnimated = EFalse);
+
+    /**
+     * Sets server side handle.
+     * @param aHandle Serverside handle
+     */
+    void SetServerHandle(TInt aHandle);
+
+    /**
+     * Sets bitmap provider.
+     * @param bitmap provider.
+     */
+    void SetBitmapProvider(MAlfBitmapProvider* aBitmapProvider);
+    
+    /**
+     * Gets bitmap provider.
+     * @return bitmap provider.
+     */
+    MAlfBitmapProvider* BitmapProvider() const;
+    
+    /**
+     * Sets filename.
+     * @param file name.
+     */    
+    void SetFileNameL(const TFileName & aFileName);
+
+    /**
+     * Sets max texture size.
+     * @param max texture size.
+     */    
+    void SetMaxTextureSize(TSize aTextureMaxSize);    
+
+    /**
+     * Gets texture flags.
+     * @return Texture flags.
+     */    
+    TAlfTextureFlags Flags() const;
+
+    /**
+     * Sets texture flags.
+     * @param Texture flags.
+     */    
+    void SetFlags(TAlfTextureFlags aFlags);
+    
+    /**
+     * Sets texture logical size.
+     * @param logical texture size.
+     */    
+    void SetSize(TSize aSize);        
+    
+    /** @beginAPI */
+
+    /**
+     * Gets texture id.
+     * @return Texture id.
+     */    
+    IMPORT_C TInt Id() const;
+        
+    /**
+     * Gets server side handle.
+     * @return Serverside handle
+     */
+    IMPORT_C TInt ServerHandle() const;    
+
+    /**
+     * Gets filename.
+     * @param file name.
+     */    
+    IMPORT_C HBufC* FileName() const;
+    
+    /**
+     * Returns ETrue if the texture has content - existing texture
+     * data. This indicates that the texture has been (up)loaded 
+     * and is ready to be used.
+     */
+    IMPORT_C TBool HasContent() const;
+
+    /**
+     * Gets max texture size.
+     * @return max texture size.
+     */    
+    IMPORT_C TSize MaxTextureSize();    
+
+    /**
+     * Gets texture logical size.
+     * @return logical texture size.
+     */    
+    IMPORT_C TSize Size() const;    
+
+    /**
+     * Returns ETrue if the texture is animated,
+     * EFalse otherwise
+     * @return the animation status of the texture.
+     */    
+    IMPORT_C TBool IsAnimated() const;
+
+    /**
+     * Starts the animation if the texture is animated.
+     * Does nothing if the texture is not animated, or
+     * the animation has already been started
+     */    
+    IMPORT_C void StartAnimation();
+
+    /**
+     * Stops the animation if the texture is animated.
+     * Does nothing if the texture is not animated, or
+     * the animation has already been stopped
+     */    
+    IMPORT_C void StopAnimation();
+    
+    /**
+     * Sets the texture priority. The priority is used when releasing/restoring
+     * textures.
+     *
+     * @param aPriority 0 = never release
+     *                  See TAlfTexturePriority from
+     *                  alftexturemanager.h
+     *                  By default != 0
+     */ 
+    IMPORT_C void SetPriority( TInt aPriority );
+    
+    /**
+     * Returns the priority of the texture
+     *
+     * @return The priority
+     *
+     * @see SetPriority()
+     */
+    IMPORT_C TInt Priority() const;
+
+    /**
+     * Sets parameters to be used when automatically calculating preferred size.
+     * @param aParams New parameters.
+     */
+    IMPORT_C void SetAutoSizeParams(const TAlfTextureAutoSizeParams& aParams);
+    
+    /**
+     * Gets parameters to be used when automatically calculating preferred size.
+     * @return Currently used parameters.
+     */
+    IMPORT_C TAlfTextureAutoSizeParams AutoSizeParams() const;
+
+    /**
+    * Enables texture reference counting. If enabled,the user
+    * does not need to delete or unload the texture, but can leave 
+    * the responsibility for the toolkit. Needs to be enabled per texture. Allows
+    * keeping important textures in memory if disabled. Even if
+    * the refcounting is disabled, internally bookkeeping is still
+    * made in order to correctly free unused textures when 
+    * refcounting is enabled again.
+    *
+    * The whole feature is disabled by default and needs to be enabled
+    * when necessary.
+    *
+    * Action that will be taken when ref count reaches zero 
+    * can be defined using SetRefCountingAction method, by default
+    * it is ERefCountingActionUnload.
+    *
+    * @param aEnable if ETrue, reference counting is enabled.
+    */
+    IMPORT_C void EnableRefCounting(TBool aEnable=ETrue);
+    
+    /**
+    * Queries the reference counting state
+    *
+    * @return ETrue if texture is refcounted, EFalse otherwise.
+    */
+    IMPORT_C TBool RefCountingEnabled();
+
+    
+    enum TAlfTextureRefCountingAction
+        {
+        ERefCountingActionDelete,
+        ERefCountingActionUnload
+        };
+
+    /** 
+    * Sets action that is performed when reference counting reaches zero.
+    * @param aAction Possible values are ERefCountingActionDelete and
+    * ERefCountingActionUnload but in the future there may be new ones.
+    *   
+    */
+    IMPORT_C void SetRefCountingAction(TInt aAction);
+
+    /**
+    * Gets action that is performed when reference counting reaches zero.
+    * @return Possible values are ERefCountingActionDelete and
+    * ERefCountingActionUnload but in the future there may be new ones.
+    */
+    IMPORT_C TInt RefCountingAction() const;
+
+    /** @endAPI */
+
+    enum TAlfTextureReleaseFlags
+        {
+        EReleaseNone = 0x0,
+        EReleaseFromEnv = 0x1,
+        EReleaseFromRefCounting = 0x2,
+        EReleaseFromUnload = 0x4           
+        };
+    /**
+     * Returns the flags which tell if texture has been released.
+     * @return Release flags
+     */
+    TInt ReleaseFlags() const;
+    
+    /**
+     * Sets the flags which tell if texture has been released.
+     * @param aReleased EReleaseNone when it is restored, others when texture gets released.
+     */
+    void SetReleaseFlags(TInt aReleaseFlags); 
+
+    /**
+     * Gets the texturemanager instance which manages this texture.
+     * @return Texture manager for this texture.
+     */
+     CAlfTextureManager* TextureManager();
+        
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor. Creates a new texture object with no texture maps.
+     */
+    CAlfTexture();
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL(CAlfEnv& aEnv, TUid aManagerUid, TInt aId, TInt aBitmapHandle, TInt aMaskHandle, TAlfTextureFlags aFlags, TBool aAnimated);
+
+private:
+
+	/** Private data */
+    struct TPrivateData;    
+    TPrivateData* iData;
+    };
+
+#endif  // C_ALFTEXTURE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alftextureautosizeparams.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,225 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Declares alftextureautosizeparams texture class.
+*
+*/
+
+
+
+#ifndef C_ALFTEXTUREAUTOSIZEPARAMS_H
+#define C_ALFTEXTUREAUTOSIZEPARAMS_H
+
+#include <e32std.h>
+
+/**
+ * Texture auto size parameters. These can be used to control texture 
+ * resizing when automatic size calculation is enabled. Actual behaviour
+ * of parameters may depend also on the used renderer, e.g. texture
+ * resizing algorithm may be more aggressive in BitGdi than in 
+ * OpenGLES renderer.
+ * 
+ * Example of use 
+ * @code
+ * TAlfTextureAutoSizeParams newparams = texture->AutoSizeParams();
+ * newparams.SetSizeLowerThreshold(TAlfTextureAutoSizeParams::EHigh);
+ * newparams.SetSizeUpperThreshold(TAlfTextureAutoSizeParams::ELow);
+ * texture->SetAutoSizeParams(newparams);
+ * @endcode
+ *
+ */
+NONSHARABLE_CLASS( TAlfTextureAutoSizeParams )
+    {
+
+public:
+    
+    enum
+        {
+        EVeryLow = -20,
+        ELow = -10,
+        EMedium = 0,
+        EHigh = 10,
+        EVeryHigh = 20
+        };
+    
+    /**
+     * Constructor.
+     */
+    IMPORT_C TAlfTextureAutoSizeParams();
+    
+    /** 
+     * Gets a size threshold which defines how much required size may
+     * decrease before it is considered to be small enough to 
+     * cause texture resizing.
+     *
+     * Possible values are e.g:
+     *   EVeryHigh
+     *   EHigh
+     *   EMedium
+     *   ELow
+     *   EVeryLow            
+     * but more values may be added in the future.            
+     * 
+     * @return Texture downsize threshold
+     */  
+    IMPORT_C TInt SizeLowerThreshold() const;
+
+    /** 
+     * Sets a size threshold which defines how much required size may
+     * decrease before it is considered to be small enough to 
+     * cause texture resizing.
+     * 
+     * Exmple: Setting value to EVeryLow causes texture to be 
+     * very easily resized to a smaller size if needed. 
+     * 
+     * Possible values are e.g:
+     *   EVeryHigh
+     *   EHigh
+     *   EMedium
+     *   ELow
+     *   EVeryLow            
+     * but more values may be added in the future.            
+     *
+     * @param aSizeLowerThreshold Texture downscale threshold
+     */  
+    IMPORT_C void SetSizeLowerThreshold(TInt aSizeLowerThreshold);
+
+    /** 
+     * Gets a size threshold which defines how much required size may
+     * increase before it is considered to be big enough to 
+     * cause texture resizing.
+     *
+     * Possible values are e.g:
+     *   EVeryHigh
+     *   EHigh
+     *   EMedium
+     *   ELow
+     *   EVeryLow            
+     * but more values may be added in the future.            
+     *
+     * @return Texture upscale threshold
+     */  
+    IMPORT_C TInt SizeUpperThreshold() const;
+
+    /** 
+     * Sets a size threshold which defines how much required size may
+     * increase before it is considered to be big enough to 
+     * cause texture resizing.
+     *
+     * Exmple: Setting value to EVeryLow causes texture to be 
+     * very easily resized to a larger size if needed. 
+     *
+     * Possible values are e.g:
+     *   EVeryHigh
+     *   EHigh
+     *   EMedium
+     *   ELow
+     *   EVeryLow            
+     * but more values may be added in the future.            
+     *
+     * @param aSizeUpperThreshold Texture upscale threshold
+     */  
+    IMPORT_C void SetSizeUpperThreshold(TInt aSizeUpperThreshold);
+
+    /**
+     * Gets the minumum amount of resize. If height or width difference 
+     * between current size and required size is smaller than threshold
+     * specified by this value, resizing is not done 
+     * (except if the current texture size is zero).
+     *
+     * Possible values are e.g:
+     *   EVeryHigh
+     *   EHigh
+     *   EMedium
+     *   ELow
+     *   EVeryLow            
+     * but more values may be added in the future.            
+     *
+     * @return aMinSizeChange 
+     */
+     IMPORT_C TInt MinSizeChange() const;   
+
+    /**
+     * Sets the minumum amount of resize. If height or width difference 
+     * between current size and required size is smaller than threshold
+     * specified by this value, resizing is not done 
+     * (except if the current texture size is zero).
+     *
+     * Exmple: Setting value to EHigh can be used to prevent unnecessary
+     * size changes if the required size varies often but changes are small.
+     *
+     * Possible values are e.g:
+     *   EVeryHigh
+     *   EHigh
+     *   EMedium
+     *   ELow
+     *   EVeryLow            
+     * but more values may be added in the future.            
+     *
+     * @param aMinSizeChange 
+     */
+     IMPORT_C void SetMinSizeChange(TInt aMinSizeChange);   
+
+    /**
+     * Gets size threshold under which relative resizing calculations are
+     * settled to be less aggressive than specified. This is used to avoid unnecessary
+     * resizing when texture size is very small (small pixel changes may be large
+     * relative changes)
+     *
+     * Possible values are e.g:
+     *   EVeryHigh
+     *   EHigh
+     *   EMedium
+     *   ELow
+     *   EVeryLow            
+     * but more values may be added in the future.            
+     *
+     * @return Size threshold.
+     */
+    IMPORT_C TInt DownsizeSettleThreshold() const;
+
+    /**
+     * Sets size threshold under which relative resizing calculations are
+     * settled to be less aggressive than specified. This is used to avoid unnecessary
+     * resizing when texture size is very small (small pixel changes may be large
+     * relative changes)
+     *
+     * Possible values are e.g:
+     *   EVeryHigh
+     *   EHigh
+     *   EMedium
+     *   ELow
+     *   EVeryLow
+     * but more values may be added in the future.            
+     *
+     * @param aDownsizeSettleThreshold Size threshold.
+     */
+    IMPORT_C void SetDownsizeSettleThreshold(TInt aDownsizeSettleThreshold);
+     
+
+private:
+    
+    /** Lower size threshold */
+    TInt iSizeLowerThreshold;
+    /** Higher size threshold */
+    TInt iSizeUpperThreshold;
+    /** Min resize amount that makes sense to do */
+    TInt iMinSizeChange;            
+    /** Size when texture is so small that relative lower/upper thresholds are no more followed strictly */
+    TInt iDownsizeSettleThreshold;
+    /** Reserved for future use */
+    TInt iSpare[10];
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alftexturegroup.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,228 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Group of textures.
+*
+*/
+
+
+
+#ifndef C_ALFTEXTUREGROUP_H
+#define C_ALFTEXTUREGROUP_H
+
+#include <coemain.h>
+#include <alf/alftexturemanager.h>
+
+class CAlfEnv;
+class CAlfTexture;
+class CAlfTextureGroup;
+
+/**
+ * Provides callback methods for getting notifications when texture manager
+ * finishes asynchronous texture loads for a group of textures.
+ *
+ * The class willing to receive these events must implement the methods
+ * of this interface and register itself as an observer to a texture group.
+ *
+ */
+class MAlfTextureGroupLoadingCompletedObserver
+    {
+public:
+    /**
+     * Called to notify the observer that loading of a texture group has
+     * been completed.
+     * @param aTextureGroup Group of textures that has been loaded.
+     * @param aErrorCode KErrNone if the loading of all textures was successful, 
+     * otherwise one of the system-wide error codes indicating reason why the first failed 
+     * texture loading failed.
+     * @note One should not commence loading of a new texture in this callback method. Also
+     * one should not make any changes to a texture group e.g. add or remove textures
+     * in this method.
+     */
+    virtual void TextureGroupLoadingCompleted(CAlfTextureGroup& aTextureGroup, TInt aErrorCode) = 0;
+
+    };
+
+
+/**
+ * This class is a utility class that can be used to group textures into logical group and
+ * then performing operations for the whole group at once.
+ *
+ * Example of utilizing texture group load observer service.  
+ * @code
+ * CMyObserver::InitL()
+ *    {
+ *    // Precondition is that textures has been created at this point but are still possibly 
+ *    // being loaded in the background... 
+ *
+ *    // Create a texturegroup and add textures into it
+ *    iTextureGroup = CAlfTextureGroup::NewL(iEnv);
+ *    iTextureGroup.AddTextureL(texture1);
+ *    iTextureGroup.AddTextureL(texture2);
+ *    iTextureGroup.AddTextureL(texture3);
+ *
+ *    if (iTextureGroup.IsLoadingCompleted())
+ *        {
+ *        // Already all textures have content. We are done, no need to observe.
+ *        TextureGroupLoadingCompleted(iTextureGroup, KErrNone);
+ *        }
+ *    else
+ *        {
+ *        // Not all textures have their content ready, we start observing and get notification later.
+ *        iTextureGroup->AddLoadObserverL(*this);
+ *        }   
+ *     ...
+ *     ...
+ *    }
+ *
+ * CMyObserver::TextureGroupLoadingCompleted(CAlfTextureGroup& aTextureGroup, TInt aErrorCode)
+ *     {
+ *     if (&aTextureGroup = iTextureGroup)
+ *         { 
+ *         // Do needed things here, e.g. show all visuals that use grouped textures   
+ *         iLayout->SetOpacity(TAlfTimedValue(1.f, 300));     
+ *         }
+ *     }
+ *  @endcode
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ *
+ */
+NONSHARABLE_CLASS( CAlfTextureGroup ) : public CBase
+    {
+public:
+
+    /**
+     * Static factory method. 
+     * @param aEnv Environment
+     */
+    IMPORT_C static CAlfTextureGroup* NewL(CAlfEnv& aEnv);
+
+    /**
+     * Static factory method. 
+     * @param aEnv Environment
+     */
+    IMPORT_C static CAlfTextureGroup* NewLC(CAlfEnv& aEnv);
+
+   /**
+     * Destructor
+     */
+    IMPORT_C virtual ~CAlfTextureGroup();
+
+   /**
+     * Adds a texture into group. Ownership is not transferred.
+     * If added texture is deleted, it should be removed from the group 
+     * before deletion happens.
+     * @param aTexture Texture to be added into group. 
+     */
+    IMPORT_C void AddTextureL(CAlfTexture& aTexture);
+
+   /**
+     * Removes a texture from group.
+     * @param aTexture Texture to be removed from group. 
+     */
+    IMPORT_C void RemoveTexture(CAlfTexture& aTexture);
+
+    /**
+     * Checks if all textures in the group have content.
+     * @return ETrue if group contains textures, all textures have content
+     * and are bigger than zero size.
+     * otherwise returns EFalse. 
+     *
+     */
+    IMPORT_C TBool IsLoadingCompleted() const;
+
+    /**
+     * Returns the number of textures in the group.
+     *
+     * @return Texture count.
+     */
+    IMPORT_C TInt Count() const;
+    
+    /**
+     * Returns a texture.
+     *
+     * @param aIndex  Index of the texture.
+     *
+     * @return  Reference to a texture.
+     */
+     IMPORT_C CAlfTexture& Texture( TInt aIndex ) const;
+
+    /**
+     * Adds texture group observer.
+     * @param aObserver Observer to be added.
+     */
+    IMPORT_C void AddLoadObserverL(MAlfTextureGroupLoadingCompletedObserver& aObserver);
+
+    /**
+     * Removes texture group observer, this must be done at latest when observer is being deleted.
+     * @param aObserver Observer to be removed.
+     */
+    IMPORT_C void RemoveLoadObserver(MAlfTextureGroupLoadingCompletedObserver& aObserver);
+
+    /**
+     * This method can be used to temporarely enable/disable notifications to observers
+     * when e.g. texture group content is being modified. By default notifications are
+     * enabaled.
+     * @param aEnable If ETrue notifications are delivered normally, otherwise notifications
+     * are not delivered.
+     */
+    IMPORT_C void EnableLoadObservers(TBool aEnable = ETrue);
+
+public:  
+    
+    /**
+     * Called by the toolkit when one texture has been loaded
+     */
+    void NotifyTextureAvailability(CAlfTexture& aTexture, TInt aErrorCode);    
+    
+private:
+
+   /**
+     * Constructor.
+     */
+    CAlfTextureGroup();
+    
+   /**
+     * Constructor.
+     */
+    void ConstructL(CAlfEnv& aEnv);
+    
+   /**
+     * Checks if given texture is part of the group. 
+     */
+    TBool IsTextureInGroup(CAlfTexture& aTexture) const;
+
+   /**
+     * Notifies observers.
+     */
+    void NotifyObservers();
+
+   /**
+     * Registers this object as loading observer to the given texturemanager.
+     */
+    void RegisterAsTextureLoadObserverL(CAlfTextureManager* aManager);
+
+   /**
+     * Unregisters this object as loading observer from the given texturemanager.
+     */
+    void UnRegisterAsTextureLoadObserver(CAlfTextureManager* aManager);
+
+private:
+
+	/* Private data. Owned */
+    struct TPrivateData;    
+    TPrivateData* iData;
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alftexturemanager.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,938 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Loads textures.
+*
+*/
+
+
+
+#ifndef C_ALFTEXTUREMANAGER_H
+#define C_ALFTEXTUREMANAGER_H
+
+#include <e32base.h>
+#include <e32cmn.h>
+#include <alf/alftexture.h>
+
+
+/* Forward declarations */
+class CAlfEnv;
+class CAlfTextureProcessor;
+class CAlfTextureManager;
+class MAlfBitmapProvider;
+struct TLoadQueueEntry;
+struct TTextureEntry;
+
+/**
+ * Special texture id, can be used to let CAlfTextureManager to assign
+ * ids for textures when those are created or loaded.
+ * 
+ * @see CAlfTextureManager
+ */
+const TInt KAlfAutoGeneratedTextureId = 0;
+
+/**
+ * Texture release level. 
+ *
+ * @see Release(), RestoreL()
+ * @see CAlfTexture::SetPriority()
+ */
+enum TAlfTexturePriority
+    {
+    /** Texture is released only on destruction */
+    EAlfTexturePriorityHighest = 0,
+    
+    /** Texture is released on the background only if memory is running out */ 
+    EAlfTexturePriorityHigh = 1000,
+    
+    /** Texture is released when application goes into background */ 
+    EAlfTexturePriorityNormal= 2000, // = default
+    
+    /** Texture is released on the foreground if memory is running out */
+    EAlfTexturePriorityLow= 3000
+    };
+
+/**
+ * Provides callback methods for getting notifications when texture manager
+ * finishes asynchronous texture loads. An observer of a CAlfTextureManager.
+ *
+ * The class willing to receive these events must implement the methods
+ * of this interface, and then register itself to the obsevers list of
+ * the texture manager.
+ *
+ * @see CAlfTextureManager
+ */
+class MAlfTextureLoadingCompletedObserver
+    {
+public:
+    /**
+     * Called to notify the observer that loading of a texture has
+     * been completed.
+     * @param aTexture Reference to the texture that has been loaded.
+     * @param aTextureId Id of the texture in the texture manager. Can be used
+     * to identify the loaded texture, provided that an id was assigned to the
+     * texture.
+     * @param aErrorCode KErrNone if the load was successful, otherwise one of
+     * the system-wide error codes indicating reason why the texture loading
+     * failed.
+     * @note One should not commence loading of a new texture in this callback method.
+     */
+    virtual void TextureLoadingCompleted(CAlfTexture& aTexture,
+                                         TInt aTextureId,
+                                         TInt aErrorCode) = 0;
+
+    };
+
+/**
+ * Provides callback methods for getting notifications of texture manager state
+ * changes. An observer of a CAlfTextureManager.
+ *
+ * @see CAlfTextureManager
+ */
+class MAlfTextureManagerStateChangedObserver
+    {
+public:
+    /**
+     * Called to notify the observer that the state of the texture manager
+     * has changed. This is called when the state changes between Idle and
+     * Loading.
+     *
+     * @param aManager  Texture manager.
+     */
+    virtual void TextureManagerStateChanged(const CAlfTextureManager& aManager) = 0;
+
+    };
+
+
+
+/**
+ * Provides callback methods for getting notifications when texture manager
+ * notices a texture which preferrred size is changed.
+ *
+ * The class willing to receive these events must implement the methods
+ * of this interface, and then register itself to the obsevers list of
+ * the texture manager.
+ *
+ */
+class MAlfTextureAutoSizeObserver
+    {
+public:
+    /**
+     * Called to notify the observer that the preferred size of some texture
+     * has been changed.
+     *
+     * @param aChangedTexture  Texture which preferred size has changed.
+     * @param aPreferredSize preferred size for texture.
+     * @return ETrue if observer accepts new size, EFalse if it does not accept or 
+     * doesn't care. 
+     */
+    virtual TBool PreferredSizeChanged(const CAlfTexture& aChangedTexture, TSize aPreferredSize) = 0;
+    };
+
+
+/**
+ * CAlfTextureManager is responsible for managing the texture objects used by
+ * the application. It provides asynchronous loading of image data into
+ * CAlfTexture instances. The texture manager also manages font textures,
+ * which can be used for compositing text in text meshes.
+ *
+ * The texture manager makes sure that only one copy of each image is loaded
+ * at a time, so even if the application requests the same image several times
+ * it is only loaded once. Textures are identified either by an integer ID or
+ * by their file name.
+ *
+ * CAlfTextureManager is owned by CAlfEnv, and should be accessed via a
+ * CAlfEnv instance. You should never construct your own texturemanagers.
+ * 
+ * Usage:
+ * @code
+ * 
+ *  //Get TextureManager
+ * CAlfTextureManager* textureMgr =  &iEnv->TextureManager();
+ * 
+ * //Set texturemanager image path
+ * textureMgr->setImagePath(_L( "C:\\data\\Images\\Pictures\\" ) );
+ * 
+ * //Load texture
+ * CAlfTexture* texture = textureMgr->LoadTextureL( _L("1.bmp"), EAlfTextureFlagDefault, 10 );
+ * 
+ * //Unload texture. Here, texture instance itself is not destroyed, only its 
+ * //contents are emptied.
+ * textureMgr->UnloadTexture(10);
+ * 
+ *  //Update texturecontent without changing the texture istance
+ *  textureMgr->updateTextureFromFile( 10, _L( "2.jpg" ) );
+ * 
+ *  //Create texture 
+ *  //BitmapProviderTest - implements MalfBitMapProvider interface
+ *  //Default implementation of this interface, provided by toolkit is
+ *  //CAlfImageLoaderUtil
+ *  BitmapProviderTest* callback = new (ELeave) BitmapProviderTest();
+ *  textureMgr->CreateTextureL( 42, *callback, EAlfTextureFlagDefault );
+ * 
+ *  @endcode
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfTextureManager ): public CActive
+    {
+public:
+
+    /**
+     * States of a CAlfTextureManager object.
+     */
+    enum TState
+        {
+        /** Indicates that the manager is in idle state. A new bitmap loading
+            operation can be started. */
+        EIdle,
+
+        /** Indicates that the manager is loading a bitmap. */
+        ELoading
+        };
+
+    /* Constructors and destructor. */
+
+    /**
+     * Static factory method. Creates a texture appropriate for the current
+     * renderer.
+     */
+    static CAlfTextureManager* NewL(CAlfEnv& aEnv, TUid aUid);
+
+    /**
+     * Static factory method. Creates a texture appropriate for the current
+     * renderer.
+     */
+    static CAlfTextureManager* NewLC(CAlfEnv& aEnv, TUid aUid);
+
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfTextureManager();
+
+
+    /* Methods. */
+
+    /** @beginAPI */
+
+    /**
+     * Determines the environment the manager belongs to.
+     */
+	IMPORT_C CAlfEnv& Env();
+
+    /**
+     * Retuns a texture having given id. Will return a default blank
+     * texture if the id was not found.
+     */
+    IMPORT_C const CAlfTexture* Texture(TInt aId) const;
+
+    /**
+     * Returns a texture associated with the given id.
+     * Will leave if no associated texture exists. 
+     *
+     * @param aId Id of the retrieved texture.
+     * @return Pointer to the texture. If the method leaves the return value is undefined.
+     * @leave KErrNotFound If a texture with the given id does not exist.
+     */
+    IMPORT_C CAlfTexture* TextureL(TInt aId);
+ 
+    /**
+     * Sets the path where bitmaps are loaded from. If drive is not included, tries to resolver that 
+     * using CCoeEnv
+     *
+     * @param aPath  Path for bitmap files.
+     * @see LoadTexture() Call to load textures from this location.
+     */
+    IMPORT_C void SetImagePathL(const TDesC& aPath);
+
+    /**
+     * Returns the current image path.
+     * @see LoadTexture() Call to load textures from this location.
+     */
+    IMPORT_C const TDesC& ImagePath() const;
+
+    /**
+     * Returns the blank texture. This can be used as a dummy texture if
+     * no real texture is available.
+     */
+    IMPORT_C const CAlfTexture& BlankTexture() const;
+
+    /**
+     * Returns the blank texture. This can be used as a dummy texture if
+     * no real texture is available. Will generate the blank texture
+     * if the texture is not yet available.
+     */
+    IMPORT_C CAlfTexture& BlankTexture();
+
+    /**
+     * Loads an image and makes it a texture. The bitmap files are searched in
+     * the path specified with SetImagePathL. The format of the loaded image
+     * must be supported by the system (Series 60) codecs.
+     *
+     * LoadTextureL is an asynchronous method, which returns an empty texture
+     * which is loaded and filled in the background. Register an
+     * MAlfTextureLoadingCompletedObserver instance to the iLoadedObservers
+     * array, whose TextureLoadingCompleted() method will be called when
+     * textures finish loading. The same observer is also called if an error
+     * occurs during the loading process. The other method is to check if an
+     * image has been loaded with TextureManagers IsLoaded().
+     *
+     * If a texture with the given id or filename is already loaded the previously
+     * loaded texture is returned. If texture with the given id has been unloaded
+     * with UnloadTexture() method then the id is reused by loading a new texture
+     * on the id.
+     *
+     * @param aImageFileName    Name of the image bitmap file to load. Relative
+     *                          to the image load path. If empty filename is
+     *                          used, will check if a filename for the id has
+     *                          been defined and load a texture using that resource
+     *                          location, if possible.
+     * @param aFlags            Specify flags for the texture loading and
+     *                          uploading - how to convert the bitmap to
+     *                          texture.
+     * @param aId               Id for the texture. Must be unique.
+     *                          KAlfAutoGeneratedTextureId can be used to let 
+     *                          texture manager automatically decide id.
+     *
+     * @note                    If both image name and id are left undefined
+     *                          ("" and zero), will return a blank texture.
+     *
+     * @return                  Reference to the texture.
+     *
+     * @see SetImagePathL() To set the image search path. Set to "" to use
+     * absolute image filenames.
+     * @see iLoadObservers
+     * @see MAlfTextureLoadingCompletedObserver::TextureLoadingCompleted()
+     * @see IsLoaded()
+     */
+    IMPORT_C CAlfTexture& LoadTextureL(const TDesC& aImageFileName,
+                                       TAlfTextureFlags aFlags,
+                                       TInt aId);
+
+   /**
+     * Loads an image based on pre-registered id and file name.
+     *
+     * @see DefineFileName()
+     *
+     * LoadTextureL is an asynchronous method, which returns an empty texture
+     * which is loaded and filled in the background. Register an
+     * MAlfTextureLoadingCompletedObserver instance to the iLoadedObservers
+     * array, whose TextureLoadingCompleted() method will be called when
+     * textures finish loading. The same observer is also called if an error
+     * occurs during the loading process. The other method is to check if an
+     * image has been loaded with TextureManagers IsLoaded().
+     *
+     * If a texture with the given id or filename is already loaded the previously
+     * loaded texture is returned. If texture with the given id has been unloaded
+     * with UnloadTexture() method then the id is reused by loading a new texture
+     * on the id.
+     *
+     * @param aId             The id of the texture/filename to load. The id must
+     *                        have a filename assigned by a call to DefineFileName().
+     *                        
+     * @param aTextureMaxSize Can be used to define a maximum dimensions for
+     *                        the final texture. The image data loaded will be
+     *                        scaled (down) and fitted to these dimensions. Use
+     *                        zero or below-zero values if size does not matter.
+     *                        If the texture size is larger than the texture size
+     *                        supported by the GL, the texture will be split to
+     *                        multiple segments.
+     * @param aFlags          Specify upload behavior - how to convert the bitmap
+     *                        to texture and other load/upload behavior.
+     *
+     * @return                Reference to the texture.
+     *
+     * @see SetImagePathL()   To set the image search path. Set to "" to use
+     *                        absolute image filenames.
+     * @see iLoadObservers
+     * @see MAlfTextureLoadingCompletedObserver::TextureLoadingCompleted()
+     * @see IsLoaded()
+     */
+    IMPORT_C CAlfTexture& LoadTextureL(const TInt aId,
+                                       TSize aTextureMaxSize = TSize(0,0),
+                                       TAlfTextureFlags aFlags = EAlfTextureFlagDefault);
+
+    /**
+     * Loads an image and makes it a texture. The bitmap files are searched in
+     * the path specified with SetImagePathL. The format of the loaded image
+     * must be supported by the system (Series 60) codecs.
+     *
+     * LoadTextureL is an asynchronous method, which returns an empty texture
+     * which is loaded and filled in the background. Register an
+     * MAlfTextureLoadingCompletedObserver instance to the iLoadedObservers
+     * array, whose TextureLoadingCompleted() method will be called when
+     * textures finish loading. The same observer is also called if an error
+     * occurs during the loading process. The other method is to check if an
+     * image has been loaded with TextureManagers IsLoaded().
+     *
+     * If a texture with the given id or filename is already loaded the previously
+     * loaded texture is returned. If texture with the given id has been unloaded
+     * with UnloadTexture() method then the id is reused by loading a new texture
+     * on the id.
+     *
+     * @param aImageName            Name of the image bitmap file to load. If
+     *                              empty filename is used, will check if a
+     *                              filename for the aId has been defined
+     *                              (using DefineFileNameL()) and load a texture
+     *                              using that resource location, if possible.
+     * @param aTextureMaxSize       Can be used to define a maximum dimensions
+     *                              for the final texture. The image data
+     *                              loaded will be scaled (down) and fitted to
+     *                              these dimensions. Use zero or below-zero
+     *                              values if size does not matter. If the
+     *                              texture size is larger than the texture
+     *                              size supported by the GL, the texture will
+     *                              be split to multiple segments.
+     * @param aFlags                Specify load/upload behavior - how to convert
+     *                              the bitmap to texture.
+     * @param aId                   Id for the texture. Must be unique.
+     *                              KAlfAutoGeneratedTextureId can be used to let 
+     *                              texture manager automatically decide id.
+     *
+     * @note                        If both image name and id are left undefined
+     *                              ("" and zero), will return a blank texture.
+     *
+     * @return Reference to the texture.
+     *
+     * @see SetImagePathL() To set the image search path. Set to "" to use
+     * absolute image filenames.
+     * @see iLoadObservers
+     * @see MAlfTextureLoadingCompletedObserver::TextureLoadingCompleted()
+     * @see IsLoaded()
+     */
+    IMPORT_C CAlfTexture& LoadTextureL(const TDesC& aImageName,
+                                       TSize aTextureMaxSize,
+                                       TAlfTextureFlags aFlags,
+                                       TInt aId);
+
+    /**
+     * Creates a texture by calling the ProvideBitmapL method of the passed MAlfBitmapProvider.
+     *
+     * If a texture with the given id is already created or loaded the previously
+     * existing texture is returned. If texture with the given id has been unloaded
+     * with UnloadTexture() method then the id is reused by loading a new texture
+     * on the id.
+     *
+     * @param aBitmapProvider       A bitmap provider that will load the bitmaps for us. The
+     *                              ProvideBitmapL method of this will be called, which should
+     *                              load or generate the needed bitmaps.
+     * @param aFlags                Specify load/upload behavior - how to convert
+     *                              the bitmap to texture.
+     * @param aId                   Id for the texture. Must be unique, use
+     *                              KAlfAutoGeneratedTextureId to let texture manager
+     *                              automatically decide id.
+     *                              
+     * @return Reference to the created texture.
+     * @leave KErrArgument The bitmap and the mask bitmap are incompatible (different size).
+     */
+    IMPORT_C CAlfTexture& CreateTextureL(TInt aId,
+                                         MAlfBitmapProvider* aBitmapProvider,
+                                         TAlfTextureFlags aFlags);
+
+
+
+    /**
+     * Unloads a texture from memory.
+     *
+     * This method releases the texture id and image name for reusing.
+     * @see LoadTexture().
+     *
+     * @note May unload several textures from memory, if they have the
+     * sane image name assigned!
+     */
+    IMPORT_C void UnloadTexture(const TDesC& aImageName);
+
+    /**
+     * Unloads a texture from memory.
+     *
+     * This method releases the texture id and image name for reusing.
+     * 
+     */
+    IMPORT_C void UnloadTexture(TInt aId);
+
+    /**
+     * Updates texture content without changing the texture address.
+     *
+     * this is an asynchronous method which is loaded and filled in 
+     * the background. Register an MAlfTextureLoadingCompletedObserver instance
+     * to the iLoadedObservers array, whose TextureLoadingCompleted() method 
+     * will be called when textures finish loading. The same observer is also 
+     * called if an error occurs during the loading process. The other method 
+     * is to check if an image has been loaded with TextureManagers IsLoaded().
+     *
+     * @param aId               Id for the texture. Must be unique.
+     *
+     * @param aFileName    		Name of the image bitmap file to load. Relative
+     *                          to the image load path. If filename is empty or
+     *                          not given, will check if a filename for the id has
+     *                          been defined and load a texture using that resource
+     *                          location, if possible.
+     * @leave 					If this method leaves the texture is not valid any more.
+     *
+     * @see SetImagePathL() To set the image search path. Set to "" to use
+     * absolute image filenames.
+     * @see iLoadObservers
+     * @see MAlfTextureLoadingCompletedObserver::TextureLoadingCompleted()
+     * @see IsLoaded()
+     */
+    IMPORT_C void UpdateTextureFromFileL(TInt aId, const TDesC* aFileName = NULL);
+
+    /**
+     * Updates texture content without changing the texture address.
+     *
+     * @param aId               Id for the texture. 
+     * @param aBitmapProvider	A bitmap provider that will load the bitmaps for us. The
+     *                          ProvideBitmapL method of this will be called, which should
+     *                          load or generate the needed bitmaps. If this is not given 
+     *                          the current provider is called instead.
+     * @leave 					If this method leaves the texture is not valid any more.
+     */
+    IMPORT_C void UpdateTextureFromBitmapL(TInt aId, MAlfBitmapProvider* aBitmapProvider = NULL);
+
+    /**
+     * Define (register) a texture resource (filename/path) for
+     * a texture id. Enables calling the LoadTextureL only with an id.
+     * This resource will then be loaded when LoadTextureL
+     * is called with the id.
+     */
+    IMPORT_C void DefineFileNameL(TInt aId, const TDesC& aImageName);
+
+    /**
+     * Prepends the image path to the beginning of the file name,
+     * if necessary.
+     */
+    IMPORT_C void PrependImagePath(TDes& aFileName);
+
+     /**
+     * Adds texture loading observer
+     *
+     * @param aObserver observer to be added to array
+     * @leave any system wide error code
+     */
+    IMPORT_C void AddLoadObserverL(MAlfTextureLoadingCompletedObserver* aObserver);
+
+     /**
+     * Removes texture loading observer, this must be done at latest when observer is being deleted
+     *
+     * @param aObserver observer to be removed from array
+     */
+    IMPORT_C void RemoveLoadObserver(MAlfTextureLoadingCompletedObserver* aObserver);
+
+     /**
+     * Adds texture manager state observer
+     *
+     * @param aObserver observer to be added to array
+     * @leave any system wide error code
+     */
+    IMPORT_C void AddStateObserverL(MAlfTextureManagerStateChangedObserver* aObserver);
+
+     /**
+     * Removes texture manager state observer, this must be done at latest when observer is being deleted
+     *
+     * @param aObserver observer to be removed from array
+     */
+    IMPORT_C void RemoveStateObserver(MAlfTextureManagerStateChangedObserver* aObserver);
+
+    /**
+     * Returns a reference to the texture processor.
+     * @return Texture processor
+     */
+    IMPORT_C CAlfTextureProcessor& Processor();
+
+    /**
+     * Sets the range where texture manager is allowed to assign new texture ids automatically.
+     *
+     * @param aLow  Smallest texture id that can be auto assigned.
+     * @param aHigh Largest texture id that can be auto assigned.
+     *
+     */
+    IMPORT_C void SetAutomaticTextureIdRange(TInt aLow, TInt aHigh);
+    
+    /**
+     * Checks if a texture exists, has content and is not found
+     * from the texture load queue.
+     * 
+     * Mainly meant for file-based textures to check if the 
+     * texture is ready to be used. 
+     * 
+     * Note that textures may have some temporary placeholder
+     * content already before they have been fully loaded!
+     * 
+     * For CreateTextureL -based textures it is recommended to use
+     * CAlfTexture::HasContent() directly.
+     * 
+     * @see LoadTextureL()
+     * @see CreateTextureL()
+     * @see CAlfTexture::HasContent()
+     *
+     * @param aImageName  Name of the image bitmap file to check. 
+     * 					  ImagePath (if set) will be prepended to 
+     * 					  this name.
+     * @return 			  ETrue if texture exists, has content and 
+     * 					  is not found from the texture load queue.
+     */
+    IMPORT_C TBool IsLoaded(const TDesC& aImageName) const;
+    
+    /**
+     * Returns the texture ID of the previously loaded file.
+     *
+     * @param aImageName  Name of the image bitmap file to check. 
+     * 					  ImagePath (if set) will be prepended to 
+     * 					  this name.
+     * @return 			  Texture ID of the already created texture
+     *                    KErrNotFound if the texture has not been created.
+     */
+    IMPORT_C TInt TextureId(const TDesC& aImageName) const;
+
+    /**
+     * Checks if a texture exists, has content and is not found
+     * from the texture load queue.
+     * 
+     * Mainly meant for file-based textures to check if the 
+     * texture is ready to be used. 
+     * 
+     * Note that textures may have some temporary placeholder
+     * content already before they have been fully loaded!
+     * 
+     * For CreateTextureL -based textures it is recommended to use
+     * CAlfTexture::HasContent() directly.
+     * 
+     * @see LoadTextureL()
+     * @see CreateTextureL()
+     * @see CAlfTexture::HasContent()
+     *
+     * @param aId 		Id of the texture.
+     * @return 			ETrue if texture exists, has content and is not found
+     * 					from the texture load queue.
+     */
+    IMPORT_C TBool IsLoaded(TInt aId) const;
+
+    /**
+     * Checks if a texture exists, has content and is not found
+     * from the texture load queue.
+     * 
+     * Mainly meant for file-based textures to check when the 
+     * texture is ready to be used. 
+     * 
+     * Note that textures may have some temporary placeholder
+     * content already before they have been fully loaded!
+     * 
+     * For CreateTextureL -based textures it is recommended to use
+     * CAlfTexture::HasContent() directly.
+     * 
+     * @see LoadTextureL()
+     * @see CreateTextureL()
+     * @see CAlfTexture::HasContent()
+     *
+     * @param aTexture Texture object.
+     * @return True if texture exists, has content and is not found
+     * from the texture load queue.
+     */
+    IMPORT_C TBool IsLoaded(const CAlfTexture * aTexture) const;
+
+    /**
+     * @deprecated <b>Always returns an invalid reference!</b>
+     * 
+     * Loads a sequence of images and makes it an animated texture.
+     *
+     * @param aSkinName             Logical name of animated element
+     * @param aTextureMaxSize       Can be used to define a maximum dimensions
+     *                              for the final texture. The image data
+     *                              loaded will be scaled (down) and fitted to
+     *                              these dimensions. Use zero or below-zero
+     *                              values if size does not matter.
+     * @param aFlags                Specify load/upload behavior
+     * @param aId                   Id for the texture. Must be unique.
+     *                              KAlfAutoGeneratedTextureId can be used to let 
+     *                              texture manager automatically decide id.
+     *
+     * @return Reference to the texture.
+     */
+	IMPORT_C CAlfTexture& LoadAnimatedTextureL(const TDesC& aSkinName,
+	                                       TSize aTextureMaxSize,
+	                                       TAlfTextureFlags aFlags,
+	                                       TInt aId);
+
+    /** @endAPI */
+    
+    TUid ManagerUid();
+    
+    /**
+     * Appends a texture to the texture manager's list of managed textures.
+     * Ownership of the texture is transferred to the manager; when the manager
+     * is destroyed, the texture will be destroyed, too.
+     *
+     * Checks already existing duplicate textures
+     * having matching id and leaves with appropriate errorcode if needed.
+     *
+     * @param aTexture  Texture to transfer to the manager.
+     * @param aId       Id for the texture. Must be unique.
+     * @leave KErrAlreadyExists if a texture with the given id already exists.
+     *
+     */
+    void AppendTextureL(CAlfTexture* aTexture);
+
+    /**
+     * Removes a texture from management. The texture's ownership is
+     * transferred to the caller.
+     *
+     * @param aTexture  Texture to remove from management.
+     */
+    void RemoveTexture(CAlfTexture& aTexture);
+    
+    /**
+     * Gets the state of the texture manager.
+     *
+     * @return State of the texture manager.
+     */
+    TState State() const;
+    
+    /**
+     * Releases texture manager resources. Releases all textures. 
+     * Called when AlfEnv is restored.
+     *
+     * While the release operation is in progress, it is not possible to delete
+     * CAlfTexture instances or create new ones. After the release has been
+     * completed, textures can again be deleted and created.
+     *
+     * @param aReleasePriorityLevel Priority level. All textures, which 
+     *        priority has equal or higher value are released.
+     *
+     * @return Were all textures released? If ETrue all texture were released.
+     *         If EFalse, some texture were not released.
+     * 
+     * @panic ETextureManagerTextureConstructedDuringRelease
+     *      A new CAlfTexture was constructed and added to the texture
+     *      manager during the release operation.
+     * @panic ETextureManagerTextureDestroyedDuringRelease
+     *      An existing CAlfTexture was destroyed and removed from the texture
+     *      manager during the release operation.
+     *
+     * @see RestoreL()
+     */
+    TBool Release( TInt aReleasePriorityLevel = EAlfTexturePriorityNormal );
+
+    /**
+     * Restores texture manager resources. Restores the content of all textures
+     * released in Release(). Called when AlfEnv is restored.
+     *
+     * While the restore operation is in progress, it is not possible to delete
+     * CAlfTexture instances or create new ones. After the restore has been
+     * completed, textures can again be deleted and created.
+     *
+     * @param aRestorePriorityLevel Priority level. All textures, which 
+     *        priority has equal or lower value are restored.
+     *
+     * @return Were all textures restored? If ETrue all texture were restored.
+     *         If EFalse, some texture were not restored.
+     *
+     * @panic ETextureManagerTextureConstructedDuringRestore
+     *      A new CAlfTexture was constructed and added to the texture
+     *      manager during the restore operation.
+     * @panic ETextureManagerTextureDestroyedDuringRestore
+     *      An existing CAlfTexture was destroyed and removed from the texture
+     *      manager during the restore operation.
+     *
+     * @see Release()
+     */
+    TBool RestoreL( TInt aRestorePriorityLevel = EAlfTexturePriorityLow );
+
+    /**
+     * Releases and restores skin dependent textures. Usually called after
+     * system skin has been changed.
+     */
+    void NotifySkinChangedL();
+
+    /**
+    * Increases the texture reference count based on texture id.
+    *
+    * @param aId the texture id
+    */
+    void IncRefcount(TInt aId);
+
+    /**
+    * Decreases the texture reference count based on texture id.
+    *
+    * @param aId the texture id
+    */
+    void DecRefcount(TInt aId);
+
+    /**
+     * Reports texture information, i.e. what's the size of texture in
+     * display.
+     * @param aTextureId texture identifier.
+     * @param aSize texture size.
+     */
+    void ReportTextureInfoL( TInt aTextureId, const TSize& aTextureSize );
+
+    /**
+     * Adds texture manager texture auto size observer.
+     *
+     * @param aObserver observer to be added to array
+     * @leave any system wide error code
+     */
+    IMPORT_C void AddAutoSizeObserverL(MAlfTextureAutoSizeObserver* aObserver);
+
+    /**
+     * Removes texture manager texture auto size observer.
+     *
+     * @param aObserver observer to be removed from array
+     */
+    IMPORT_C void RemoveAutoSizeObserver(MAlfTextureAutoSizeObserver* aObserver);
+
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor.
+     */
+    CAlfTextureManager();
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL(CAlfEnv& aEnv, TUid aUid);
+
+private:
+
+    /**
+     * Check the existence of a texture.
+     *
+     * @param aFileName  File name of the texture.
+     *
+     * @return  Index of the texture, in the iTextures array, or KErrNotFound if not found.
+     */
+    TInt CheckTexture(const TDesC& aFileName) const;
+
+    /**
+     * Check if texture exists with given id.
+     *
+     * @return  Index of the texture, in the iTextures array, or KErrNotFound if not found.     
+     */
+    TInt CheckTexture(TInt aId) const;
+
+    /**
+     * Called when image loading (decoding) operation is complete.
+     */
+    void RunL();
+
+    /**
+     * Handles a leave occurring in the request completion event handler RunL().
+     */
+    TInt RunError(TInt aError);
+
+    /**
+     * Cancel active object operation.
+     */
+    void DoCancel();
+
+    /**
+     * Starts loading next images from the load queue. If scheduling a
+     * queue entry fails for some reason, the entry is discarded and the
+     * next queue entry is processed.
+     */
+    void StartLoading();
+
+    /**
+     * Cleans up the topmost load queue entry and removes it from the
+     * load queue. Deletes the decoder, but not the loaded texture entry.
+     */
+    TLoadQueueEntry PopLoadedQueueEntry();
+
+    /**
+     * Sets up image decoding and starts to load the first entry in the load
+     * queue.
+     * @leave Standard error code if decoder initialization/resource read
+     * fails.
+     */
+    void DoLoadNextL();
+
+    /**
+     * Called when an image has finished loading. Handles
+     * uploading of the loaded bitmap to the texture.
+     *
+     * @param aEntry  Entry whose contents have been loaded.
+     */
+    void ImageLoadingCompleteL(TLoadQueueEntry& aEntry);
+
+    /**
+     * Helper method that notifies observers of texture manager state change.
+     * 
+     */
+    void NotifyStateChange() const;
+
+    /**
+     * Helper method that notifies observers of texture load completion.
+     */
+    void NotifyTextureLoaded(CAlfTexture& aTexture,
+                             TInt aTextureId,
+                             TInt aErrorCode) const;
+    
+
+    /** Returns true if the given texture is still in the load queue. */
+    TBool IsInLoadQueue(const CAlfTexture* texture) const;
+    
+    /** Cancels loading of a texture */
+    void CancelLoadingOfTexture(CAlfTexture& aTexture);    
+
+    /** Generates unique id for texture */
+    TInt GenerateTextureId();
+    
+    /** Releases one texture */
+    void ReleaseEntry(const TTextureEntry& aEntry);
+
+    /** Restores one texture */
+    void RestoreEntryL(const TTextureEntry& aEntry);
+    
+    /** Returns ETrue if this texturemanager is a shared texture manager */
+    TBool IsShared();
+
+    /** Updates texture by re-uploading content */    
+    void UpdateTextureL(TInt aId, TSize aSize);
+
+    /** Reloads texture from a file */    
+    void ReloadTextureL(const TDesC& aImageName,
+                        TSize aTextureMaxSize,
+                        TAlfTextureFlags aFlags,
+                        TInt aId);
+
+    /** Recreates texture from a bitmap provider */    
+    void RecreateTextureL(TInt aId,
+                          MAlfBitmapProvider* aBitmapProvider,
+                          TAlfTextureFlags aFlags);
+
+    /** Starts the texture garbagecollecting, triggered
+    * automatically when zero refcount textures are
+    * detected
+    */
+    void StartGarbageCollect();
+    
+    /* Garbace collector callback function */
+    static TInt GarbageCollect(TAny* aPtr);
+
+    /* Modifies flags */
+    void RemoveFlags(TAlfTextureFlags& aFlags, TInt aFlagsToBeRemoved);
+
+    /* Modifies flags */
+    void SetFlags(TAlfTextureFlags& aFlags, TInt aFlagsToBeSet);
+
+private:
+
+	/* Private data. Owned */
+    struct TPrivateData;    
+    TPrivateData* iData;
+    
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alftextureprocessor.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,185 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Declares CAlfTextureProcessor class.
+*
+*/
+
+
+
+#ifndef C_ALFTEXTUREPROCESSOR_H
+#define C_ALFTEXTUREPROCESSOR_H
+
+
+#include <e32base.h>
+
+
+/* Forward declarations. */
+class CAlfEnv;
+class CAlfTexture;
+
+/**
+ * CAlfTextureProcessor is a collection of texture filters. Each filter 
+ * takes a texture as input, processes it, and produces a new texture as a 
+ * result. Examples of processing filters are blurring and shadow generation. 
+ * Concrete serverside implementations of this class are rendering plugin specific.
+ * CAlfTextureProcessor is the public, user-friendly way of filtering 
+ * textures, because each filtering operation can be applied with a single
+ * function call.
+ * Usage:
+ * @code
+ * //Get texture processor
+ * CAlfTextureProcessor* textureProcessor = &iTxrMgr->TextureProcessor();
+ * 
+ *  //Blur texture, source and destination textures are same
+ * textureProcessor->BlurL(*tex,*tex);
+ * 
+ * @endcode
+ * @see CAlfTextureProcessor::BlurL()
+ * @lib alfclient.lib
+ * @since S60 v3.2
+ *
+ */
+NONSHARABLE_CLASS(CAlfTextureProcessor) : public CBase
+    {
+public:
+
+    /* Types. */
+
+    /** @beginAPI */
+
+    /** Flags for blur filtering. */
+    enum TBlurFlags
+        {
+        /** Default blurring settings. */
+        EBlurFlagDefault = 0,
+        
+        /** Include an alpha channel in the result. */
+        EBlurFlagAlpha = 1,
+        
+        /** Retain extra space for edges so that the blurred edges that will
+            always remain within the bounds of the resulting texture. Note
+            that when the blurred texture is drawn, it has to be expanded 
+            so that it will match the original images content. */
+        EBlurFlagExpandEdges = 2,
+        
+        /** Replace source color RGB with white. Note that this flag is 
+            mutually exclusive with flag EBlurFlagBlack. If both are defined
+            then this flag overrides the EBlurFlagBlack. */
+        EBlurFlagWhite = 4,
+        
+        /** Replace source color RGB with black. Note that this flag is 
+            mutually exclusive with flag EBlurFlagWhite. If both are defined
+            then this flag overridden by EBlurFlagWhite. */
+        EBlurFlagBlack = 8,
+        
+        /** High quality blur. The blurring process is done twice, and the 
+            results are averaged. */
+        EBlurFlagHighQuality = 16,
+        };
+
+    /** @endAPI */
+
+
+    /* Destructor. */
+
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfTextureProcessor();
+
+    /**
+     * Constructor.
+     */
+    static CAlfTextureProcessor* NewL(CAlfEnv& aEnv);    
+
+    /**
+     * Constructor.
+     */
+    static CAlfTextureProcessor* NewLC(CAlfEnv& aEnv);    
+
+    /* Methods. */
+
+    /** @beginAPI */
+
+    /**
+     * Blurs a texture. The dimensions of the resulting image are chosen
+     * automatically. Returns a pointer to a new texture which contains
+     * a blurred version of the texture. Ownership of the new texture is
+     * transferred to the caller.
+     *
+     * Note that the algorithm used for blurring favors speed over accuracy.
+     * This means that when hardware acceleration is available, the blurring
+     * can be redone for each frame. However, the quality of the blurring 
+     * may not be optimal. For example, color range reduction and pixel 
+     * artifacts may be visible.
+     *
+     * @param aSrc  Source texture to be blurred. Not modified.
+     * @param aDest Destination texture to be blurred. Modified. Allowed to be the same as aSrc.
+     * @param aFilterSize  Size of the blurring filter. 3 = 3x3 filter, 4 = 4x4 filter.
+     * @param aFlags  Flags that modify the filter's parameters. @see TBlurFlags
+     */    
+     IMPORT_C void BlurL(const CAlfTexture& aSrc,
+                       CAlfTexture& aDest,
+                       TInt aFilterSize = 3, TInt aFlags = 0);
+
+    /**
+     * Blurs a texture. The dimensions of the resulting image are as close to
+     * aPreferredSize as possible, depending on the limitations of the 
+     * implementation. Returns a pointer to a new texture which contains
+     * a blurred version of the texture. Ownership of the new texture is
+     * transferred to the caller.
+     *
+     * Note that the algorithm used for blurring favors speed over accuracy.
+     * This means that when hardware acceleration is available, the blurring
+     * can be redone for each frame. However, the quality of the blurring 
+     * may not be optimal. For example, color range reduction and pixel 
+     * artifacts may be visible.
+     *
+     * @param aSrc  Source texture to be blurred. Not modified.
+     * @param aDest Destination texture to be blurred. Modified. Allowed to be the same as aSrc.
+     * @param aPreferredSize  Preferred size of the result.
+     * @param aFilterSize  Size of the blurring filter. 3 = 3x3 filter, 4 = 4x4 filter.
+     * @param aFlags  Flags that modify the filter's parameters. @see TBlurFlags
+     */
+    IMPORT_C void BlurL(const CAlfTexture& aSrc, 
+                       CAlfTexture& aDest,
+                       const TSize& aPreferredSize,
+                       TInt aFilterSize = 3, TInt aFlag = 0);
+
+    /** @endAPI */
+
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor.
+     */
+    CAlfTextureProcessor();
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL(CAlfEnv& aEnv);
+
+
+private:
+
+	/** Private data */
+    struct TPrivateData;    
+    TPrivateData* iData;
+
+    };
+
+#endif  // C_ALFTEXTUREPROCESSOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alftextvisual.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,372 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Text visual
+*
+*/
+
+
+
+#ifndef C_ALFTEXTVISUAL_H
+#define C_ALFTEXTVISUAL_H
+
+class TAknsItemID;
+class TRgb;
+
+#include <alf/alfvisual.h>
+#include <alf/alftextstylemanager.h>
+#include <alf/alfgc.h>
+#include <AknFontSpecification.h> 
+#include <AknFontIdOffsets.hrh>
+
+/** Background type suggestions.
+ * 
+ * These enums suggest which sort of background is under the visual,
+ * in order for it to be rendered in an appropriate colour.
+ * A dark background means that the text will be rendered in white, and a
+ * light background means that the text will be black.*/
+enum TAlfBackgroundType
+    {
+    /** background beneath the font is light. */
+    EAlfBackgroundTypeLight,
+    
+    /** background beneath the font is dark. */
+    EAlfBackgroundTypeDark
+    };
+
+/**
+ *  Text visual for text drawing.
+ * Text visual shows one or more lines of text.
+ *
+ * @code
+ * CAlfTextVisual* textVisual = CAlfTextVisual::AddNewL( control );
+ * textVisual->SetTextL( _L( "Hello" ) ); * 
+ * @endcode
+ * 
+ * @lib alfclient.lib
+ * @since S60 v3.2
+ */
+class CAlfTextVisual : public CAlfVisual
+    {
+
+public:
+
+    /* Types. */
+    
+    enum TLineWrap
+        {
+        /** Lines must be broken manually with line break characters. 
+            If the visual does not use clipping, long text lines will 
+            go outside the visual. */
+        ELineWrapManual,
+        
+        /** Lines that do not fit in the visual's content area are truncated 
+            with an ellipsis (...). */
+        ELineWrapTruncate,
+        
+        /** Lines are broken to the visual's content area. */
+        ELineWrapBreak
+        };
+
+    enum TLineSpacingUnits
+        {
+        /** Line spacing is given in pixels */
+        EPixels,
+        
+        /** Line spacing is given in twips */
+        ETwips
+        };
+
+
+    /**
+     * Constructor, which gives ownership to the control.
+     *
+     * @param aOwnerControl The control
+     * @param aParentLayout If given, the parent layout.
+     * @return New instance. Ownership NOT transreffed (owned by control)
+     */
+    IMPORT_C static CAlfTextVisual* AddNewL(CAlfControl& aOwnerControl,
+                                            CAlfLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C CAlfTextVisual();
+
+    /**
+     * Second-phase constructor.
+     */
+    IMPORT_C void ConstructL(CAlfControl& aOwner);
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CAlfTextVisual();
+
+    /**
+     * Set the text shown in the visual. The text may contain formatting
+     * codes to change the size, color, and alignment of the text.
+     *
+     * @param aText  Descriptor containing the text.
+     */
+    IMPORT_C void SetTextL(const TDesC& aText);
+    
+    /**
+     * Returns the text of the visual.
+     *
+     * @return The text.
+     */
+    IMPORT_C const TDesC& Text() const;
+    
+    /**
+     * Sets the default text style of the text visual. This style describbes the size
+     * and colour of the rendered text. Parameters passed here can be overridden by
+     * call to SetFontSpec().
+     * @see SetFontSpec()
+     *
+     * @param aStyle           Text style.
+     * @param aBackgroundType  Text background type. Affects the color of 
+     *                         the text. Defaults to EAlfBackgroundTypeLight
+     *                         (ie, black text will be used).
+     */
+    IMPORT_C void SetStyle(
+        TAlfPreconfiguredTextStyle aStyle, 
+        TAlfBackgroundType aBackgroundType = EAlfBackgroundTypeLight);
+        
+
+    /**
+     * Sets the default text style of the text visual. This style describes the style
+     * the text is rendered with. The text style has to be created with the text style 
+     * manager. If the given text style does not exist, the text style is reverted back
+     * to default text style.
+     * @see CAlfTextStyleManager
+     *
+     * @param aTextStyleId Text style ID provided by the text style manager.
+     */
+    IMPORT_C void SetTextStyle(TInt aTextStyleId);
+            
+    /**
+     * Sets the alignment of the text visual.
+     *
+     * @param aAlignHorizontal Horizontal alignment.
+     * @param aAlignVertical Vertical alignment.
+     */
+    IMPORT_C void SetAlign(TAlfAlignHorizontal aAlignHorizontal,
+                           TAlfAlignVertical aAlignVertical);
+                           
+    /**
+     * Sets the line spacing for multiline text visual when the text wraps around.
+     *
+     * @param aLineSpacing Line spacing between lines in multiline text visual.
+     * @parem aUnits       Defines the units of the line spacing.
+     *                     @see TLineSpacingUnits. 
+     */
+    IMPORT_C void SetLineSpacing(TInt aLineSpacing, TLineSpacingUnits aUnits = EPixels);
+
+    /**
+     * Determines the size of the text in the visual.
+     * Text must have been updated / or drawn to be able
+     * to use these extents.
+     *
+     * @return Size of the text in pixels, or TSize(0,0) if 
+     * text is undefined or the mesh hasn't been updated.
+     * 
+     * @see UpdateMeshL() 
+     */
+    IMPORT_C TSize TextExtents() const;
+
+    /**
+     * Determines the size of the text in the visual.
+     * Text must have been updated / or drawn to be able
+     * to use these extents.
+     *
+     * @return Size of the text in pixels, or TSize(0,0) if 
+     * text is undefined or the mesh hasn't been updated.
+     * 
+     * @see UpdateMeshL() 
+     */
+    IMPORT_C TRect SubstringExtents(TUint aStart, TUint aEnd) const;
+
+    /**
+     * Accesses the text style of the text visual.
+     *
+     * @deprecated
+     *
+     * @return the text style, but only valid if the text style corresponds to a preconfigured 
+     *      text style
+     */    
+    IMPORT_C TAlfPreconfiguredTextStyle Style();
+
+    /**
+     * Accesses the text style id of the text visual.
+     *
+     * @note This API should be used in preference to @c Style
+     *
+     * @return the text style id, this can be used to access the actual text style, 
+     *      see @c CAlfTextStyleManager::TextStyle
+     */    
+    IMPORT_C TInt TextStyle() const;
+            
+    /**
+     * Sets the maximum number of lines displayed by the text visual.
+     * The default is KMaxTInt.
+     */
+    IMPORT_C void SetMaxLineCount(TInt aMaxLineCount);
+    
+    /**
+     * Determines the maximum number of line displayed by the text visual.
+     */
+    IMPORT_C TInt MaxLineCount() const;
+    
+    /**
+     * Determines the visual's line wrapping mode.
+     *
+     * @return  Line wrapping mode.
+     */
+    IMPORT_C TLineWrap Wrapping() const;    
+    
+    /**
+     * Sets the line wrapping mode.
+     *
+     * @param aWrap  Line wrapping mode.
+     */
+    IMPORT_C void SetWrapping(TLineWrap aWrap);
+    
+    /**
+     * Determines the background type of the text visual. This was set with a 
+     * call to SetStyle().
+     */    
+    IMPORT_C TAlfBackgroundType BackgroundType();
+
+    /**
+     * @deprecated Use CAlfDropShadow
+     *
+     * Returns shadow opacity.
+     *
+     * @return Shadow opacity
+     */
+    IMPORT_C TAlfTimedValue ShadowOpacity();
+
+    /**
+     * @deprecated Use CAlfDropShadow
+     *
+     * Sets shadow opacity.
+     * Changes the opacity of the text soft shadow.
+     * Currently SetShadowStrength is only implemented in the OpenGL renderer,
+     * and will have no effect in BitGDI. 
+     *
+     * @param aShadowOpacity Shadow opacity
+     * @see EnableShadow     
+     */
+    IMPORT_C void SetShadowOpacity(const TAlfTimedValue& aShadowOpacity);
+       
+     /**
+     * Sets the color of the text.
+     *
+     * @param aColor           Text color.
+     */
+    IMPORT_C void SetColor(TRgb aColor);
+
+     /**
+     * Sets the color of the text via skin id.
+     *
+     * @param aID           Skin-id of the color group to use
+     * @param aIndex        Index within the color group
+     */
+     IMPORT_C void SetColor(const TAknsItemID& aId,const TInt aIndex);
+    
+    /**
+     * Sets the color of the text via skin id.
+     *
+     * @param aTextColorTable    Skin-id name of the color group to use
+     * @param aColorIndex        Index within the color group
+     */    
+    IMPORT_C void SetColor(const TDesC& aTextColorTable,const TDesC& aColorIndex);
+    
+    /**
+     * @deprecated Use CAlfDropShadow
+     * 
+     * Enables or disables the text shadow.
+     * The rasterized text shadow is a special implementation
+     * of shadow that looks good with text. If this value is
+     * false, then the text will not have a rasterized shadow.
+     * 
+     * @param aDoEnable True enables rasterized shadows, false disables.
+     * @see SetShadowOpacity
+     * @see ShadowOpacity     
+     */     
+     IMPORT_C void EnableShadow(TBool aDoEnable);     
+ 
+    /**
+     * Sets offset for the text.
+     *
+     * @param aOffset text offset.
+     */    
+     IMPORT_C void SetOffset(const TAlfTimedPoint& aOffset);
+     
+    /**
+     * Gets offset for the text.
+     *
+     * @return text offset.
+     */    
+     IMPORT_C TAlfTimedPoint Offset() const;
+     
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void RemoveAndDestroyAllD();
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0);
+    IMPORT_C CAlfVisual* FindTag(const TDesC8& aTag);
+    
+    /**
+     * Sets highlighting for a part of Text
+     * Start and end index of text to be highlighted, are ordinal indices. 
+     * In case of multiple language, bidirectional text (e.g. English + Arabic), 
+     * mixed text selection for highlight, might give strange results.
+     * e.g.TextVisual text :  "E n g l i s h c i b a r A"  ( Arabic script is 
+     *      read/written from right to left. Assume 'c i b a r A' is Arabic script )
+     *      and highlight range : 5-9.
+     *      Expected result : "i s h" and "r A" should get highlighted 
+     *      Actual Result:  "i s h c i"
+     * Hence, it is recommended to use different text visuals in case of selection of 
+     * bidirectional text.
+     *                                 
+     * @param aStart Startng index of Highlighted text.
+     * @param aEnd Ending index of Highlighted text.
+     * @param aHighlightColor Background color of highlighted text.
+     * @param aHightlightColor Font color of Highlighted text.
+     */
+    IMPORT_C void SetHighlightRange(TInt aStart, TInt aEnd, TRgb& aHighlightColor, TRgb& aHighlightTextColor);
+
+    /** Internal utils */
+    void PrepareForUpdateMesh();
+    void UpdateMesh(TBool aSynchronousUpdate = EFalse);     	 
+    void ReleaseMesh();
+    
+protected:
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void DoRemoveAndDestroyAllD();
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+ 
+private:
+
+    struct TTextVisualPrivateData;
+    TTextVisualPrivateData* iTextVisualData;
+    };
+
+
+#endif // C_ALFTEXTVISUAL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alftimedvalue.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,595 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Timed values
+*
+*/
+
+
+
+#ifndef __ALF_TIMED_VALUE__
+#define __ALF_TIMED_VALUE__
+
+#include <e32std.h>
+
+// Todo: is there need to expose these
+enum TAlfTimedValueFlags
+    {
+    EAlfValueFlagsNone = 0,
+    EAlfValueNowChanged = 1,
+    EAlfValueTargetChanged = 2,
+    EAlfInterpolationStyleChanged =4,
+    EAlfMappingFunctionChanged = 8,
+    EAlfSpeedChanged = 16,    
+    EAlfValueFlagsAll = 0xffffffff
+    };
+
+/**
+ * Timed value interpolation styles.
+ *
+ * @see To implement custom interpolation styles, you can use
+ * mapping functions.
+ *
+ * @see MAlfMappingFunction
+ * @see TAlfTimedValue::SetFunction()
+ */
+enum TAlfInterpolationStyle
+    {
+    /** No interpolation is done. The target value becomes effective
+        in a single step. */
+    EAlfTimedValueStyleUseSystemDefault,
+
+    EAlfTimedValueStyleNone,
+
+    /** Use linear interpolation between the current value and the
+        target value. */
+    EAlfTimedValueStyleLinear,
+
+    /** Use a sine wave for approximating preservation of momentum. */
+    EAlfTimedValueStyleSineWave,
+
+    /** Quarter of a sine wave for decelerating movement. */
+    EAlfTimedValueStyleDecelerate,
+
+    /** Quarter of a sine wave for accelerating movement. */
+    EAlfTimedValueStyleAccelerate,
+
+    /** Sine wave or decelerating style based on when the target value
+        is defined. */
+    EAlfTimedValueStyleAdaptive,
+
+    /** Combination of linear and deceleration. */
+    EAlfTimedValueStyleImpulse,
+
+    EAlfTimedValueStyleLast
+    };
+
+/**
+ * 
+ * Timed value class.
+ *
+ * Timed values are able to interpolate their value independently based on
+ * time. The interpolation can be configured to follow a curve instead of
+ * being linear. Timed value does not restrict the value units but interpolates
+ * on any given real value. Mapping function can be used that maps the interpolated
+ * values to some other real value space. If no mapping function is specified an
+ * identity mapping is used. Current values and target values of timed value can be
+ * set through class methods. Delays for timed value to achieve the target value can
+ * be given in the Set - method. Timed value supports number of different interpolation
+ * styles.
+ *
+ * @code
+ *   // Here are some examples how the timed value can be used.
+ *   // In the examples, the opacity of the visual is used as
+ *   // an example, but any of the timed values work the same.
+ * 
+ *   // #1 New variable - getters are not really relevant
+ *   TAlfTimedValue opacity;
+ *   opacity->SetTarget( 1, 500 );
+ *   visual->SetOpacity( opacity ); // changes only the target
+ *   
+ *   // 2# Data fetching
+ *   // a) preferred
+ *   const TAlfTimedValue& opacity = visual->Opacity();
+ *   TReal32 valueNow = opacity->ValueNow();
+ *   TReal32 target = opacity->Target();
+ *   // b) 
+ *   TReal32 valueNow = visual->Opacity().ValueNow();
+ *   TReal32 target = visual->Opacity().Target();
+ *   
+ *   // 3# Data fetching and value update
+ *   TAlfTimedValue opacity( visual->Opacity() );
+ *   TReal32 target = opacity->Target();
+ *   opacity->SetTarget( target*2, 500 );
+ *   visual->SetOpacity( opacity );
+ *   
+ *   // 4# Use the same timed value for other places:
+ *   // a)
+ *   const TAlfTimedValue& visualOpacity = visual->Opacity();
+ *   layout->SetOpacity( visualOpacity );
+ *   // b)
+ *   TAlfTimedValue visualOpacity( visual->Opacity() );
+ *   visualOpacity->SetTarget( 1, 500 );
+ *   layout->SetOpacity( visualOpacity );
+ * @endcode
+ *
+ * @lib alfclient.lib
+ * @since S60 v3.2
+ **/
+class TAlfTimedValue
+    {
+    public:
+
+    /**
+     * Constructor. Enables creation of timed value with no explicitly set initial value.
+     * The timed value is set to zero.
+     *
+     */
+    IMPORT_C TAlfTimedValue();
+    
+    /**
+     * Constructor. Enables initial value setting.
+     *
+     * @param aInitialValue  Initial value.
+     *
+     */
+    IMPORT_C TAlfTimedValue(TReal32 aInitialValue) __SOFTFP; 
+
+    /**
+     * Constructor. Enables target value setting.
+     *
+     * @param aTargetValue  Target value.
+     * @param aTime When the target value will be in effect. Transition duration in milliseconds.
+     *
+     */
+    IMPORT_C TAlfTimedValue(TReal32 aTargetValue, TInt aTime) __SOFTFP; 
+    
+    /**
+     * Set a new current value Change becomes effective immediately.
+     *
+     * @param aValueNow  New currentvalue.
+     */
+    IMPORT_C void SetValueNow(const TReal32& aValueNow);
+
+    /**
+     * Gets current value.
+     *
+     * @return Current value.
+     */
+    IMPORT_C TReal32 ValueNow() const __SOFTFP;
+    
+    /**
+     * Set a new target value that becomes effective after a delay.
+     * @see SetTargetWithSpeed()
+     *
+     * @param aValue            New target value.
+     * @param aTime   Time duration after the target value will be in effect. Transition duration in milliseconds.
+     */
+    IMPORT_C void SetTarget(const TReal32& aTarget, TInt aTime); 
+
+    /**
+     * Sets a new target value. The transition time depends on the speed.
+     * @see SetTarget()
+     *
+     * @param aTarget          New target value.
+     * @param aUnitsPerSecond  Speed of change.
+     */
+    IMPORT_C void SetTargetWithSpeed(TReal32 aTarget, TReal32 aUnitsPerSecond) __SOFTFP;
+
+    /**
+     * Gets target value.
+     *
+     * @return Target value.
+     */
+    IMPORT_C TReal32 Target() const __SOFTFP;
+
+    /**
+     * Gets duration of the transition.
+     *
+     * @return Duration time in milliseconds..
+     */
+    IMPORT_C TInt TimeToTargetinMilliSeconds() const;
+
+    /**
+     * Gets speed of the transition in units per second if it has been set
+     * with SetTargetWithSpeed.
+     *
+     * @return Speed of the transition in units per second.
+     */
+    IMPORT_C TReal32 Speed() const __SOFTFP;
+        
+    /**
+     * Sets the interpolation style of the timed value.
+     *
+     * @param aStyle  Interpolation style used to reach target value.
+     */
+    IMPORT_C void SetStyle(TAlfInterpolationStyle aStyle);
+    
+    /**
+     * Sets identifier of a mapping function that affects the timed value. 
+     *
+     * @param aIdentifier Identifier of a function that will map the current value to required
+     * number space.
+     */
+    IMPORT_C void SetMappingFunctionIdentifier(TInt aIdentifier);    
+
+    /**
+     * Gets identifier of a mapping function that affects the timed value. 
+     *
+     * @return aIdentifier Identifier of a function that will map the current value to required
+     * number space.
+     */
+    IMPORT_C TInt MappingFunctionIdentifier() const;
+            
+    /**
+     * Gets flags.
+     *
+     * @return Flags.
+     */
+    IMPORT_C TInt& Flags();
+        
+    /**
+     * Gets the interpolation style of the timed value.
+     *
+     * @return Interpolation style used to reach target value.
+     */
+    IMPORT_C TAlfInterpolationStyle Style();
+        
+private:
+    TReal32 iValueNow;
+    TReal32 iValueTarget;
+    TInt iTimeToTarget;
+    TInt iInterpolationStyle;
+    TInt iMappingFunctionIdentifier;
+    TReal32 iSpeed;
+    TInt iFlags;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    }; 
+
+struct TAlfRealPoint
+    {
+    TAlfRealPoint():iX(0),iY(0){}
+    TAlfRealPoint(const TReal32& aX, const TReal32& aY):iX(aX),iY(aY){}
+    TAlfRealPoint(const TPoint& aPoint):iX(aPoint.iX),iY(aPoint.iY){}
+        
+    inline operator TPoint() const
+        {
+        return TPoint((TInt)iX, (TInt)iY);
+        }
+
+    inline TSize AsSize() const
+        {
+        return TSize((TInt)iX, (TInt)iY);
+        }
+
+    inline TAlfRealPoint operator-(const TAlfRealPoint& aPoint) const
+        {
+        return TAlfRealPoint(iX - aPoint.iX, iY - aPoint.iY);
+        }
+
+    inline TAlfRealPoint operator+(const TAlfRealPoint& aPoint) const
+        {
+        return TAlfRealPoint(iX + aPoint.iX, iY + aPoint.iY);
+        }
+
+    inline TAlfRealPoint& operator+=(const TAlfRealPoint& aPoint)
+        {
+        iX += aPoint.iX;
+        iY += aPoint.iY;
+        return *this;
+        }
+
+    inline TAlfRealPoint& operator-=(const TAlfRealPoint& aPoint)
+        {
+        iX -= aPoint.iX;
+        iY -= aPoint.iY;
+        return *this;
+        }
+    
+    inline TBool operator==(const TAlfRealPoint& aPoint) const 
+        {
+        if ( Abs(iX-aPoint.iX) < 0.0001 && Abs(iY-aPoint.iY) < 0.0001 )
+            {
+            return ETrue;
+            }
+        
+        return EFalse;
+        }
+
+    TReal32 iX;
+    TReal32 iY;    
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+struct TAlfRealSize
+    {
+    TAlfRealSize()
+        : iWidth(0.f), iHeight(0.f) {}
+        
+    inline TAlfRealSize(TReal32 aWidth, TReal32 aHeight)
+            : iWidth(aWidth), iHeight(aHeight)
+        {
+        }
+        
+    inline TAlfRealSize(const TSize& aSize)
+            : iWidth((TReal32)aSize.iWidth), iHeight((TReal32)aSize.iHeight)
+        {
+        }
+        
+    inline TAlfRealSize(const TAlfRealPoint& aPoint)
+            : iWidth( aPoint.iX ), iHeight( aPoint.iY )
+        {
+        }
+        
+    inline operator TSize() const
+        {
+        return TSize((TInt)iWidth, (TInt)iHeight);
+        }
+        
+public:    
+
+    /** Width. */    
+    TReal32 iWidth;
+
+    /** Height. */
+    TReal32 iHeight;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+struct TAlfRealRect
+    {
+    TAlfRealRect(){}
+    TAlfRealRect(const TRect& aRect):iTl(aRect.iTl),iBr(aRect.iBr){}
+    TAlfRealRect(const TAlfRealPoint& aTl, const TAlfRealPoint& aBr):iTl(aTl),iBr(aBr){}
+    inline operator TRect() const
+        {
+        return TRect((TPoint)iTl, (TPoint)iBr);
+        }
+
+    inline TReal32 Width() const
+        {
+        return iBr.iX - iTl.iX;
+        }
+        
+    inline TReal32 Height() const
+        {
+        return iBr.iY - iTl.iY;
+        }
+        
+    inline TAlfRealPoint TopRight() const
+        {
+        return TAlfRealPoint(iBr.iX, iTl.iY);
+        }
+
+    inline TAlfRealPoint BottomLeft() const
+        {
+        return TAlfRealPoint(iTl.iX, iBr.iY);
+        }
+
+    inline TAlfRealSize Size() const
+        {
+        return TAlfRealSize(Width(), Height());
+        }
+
+
+    inline TAlfRealPoint Center() const
+        {
+        return iTl + TAlfRealPoint(Width()/2, Height()/2);
+        }
+
+
+    inline void Grow(TReal32 aX, TReal32 aY)
+        {
+        iTl.iX -= aX;
+        iTl.iY -= aY;
+        iBr.iX += aX;
+        iBr.iY += aY;
+        }
+        
+    inline void Shrink(TReal32 aX, TReal32 aY)
+        {
+        iTl.iX += aX;
+        iTl.iY += aY;
+        iBr.iX -= aX;
+        iBr.iY -= aY;
+        }
+
+    inline void Shrink(const TPoint& aPoint)
+        {
+        iTl.iX += aPoint.iX;
+        iTl.iY += aPoint.iY;
+        iBr.iX -= aPoint.iX;
+        iBr.iY -= aPoint.iY;
+        }
+        
+    inline void Shrink(const TAlfRealPoint& aPoint)
+        {
+        iTl.iX += aPoint.iX;
+        iTl.iY += aPoint.iY;
+        iBr.iX -= aPoint.iX;
+        iBr.iY -= aPoint.iY;
+        }
+        
+    inline void Shrink(const TAlfRealRect& aRect)
+        {
+        iTl.iX += aRect.iTl.iX;
+        iTl.iY += aRect.iTl.iY;
+        iBr.iX -= aRect.iBr.iX;
+        iBr.iY -= aRect.iBr.iY;
+        }
+        
+    inline void Move(TReal32 aDx, TReal32 aDy)
+        {
+        iTl.iX += aDx;
+        iTl.iY += aDy;
+        iBr.iX += aDx;
+        iBr.iY += aDy;
+        }
+
+    TAlfRealPoint iTl;
+    TAlfRealPoint iBr;    
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+class TAlfTimedPoint
+    {
+public:    
+    /**
+     * Default constructor.
+     */
+    IMPORT_C TAlfTimedPoint();
+
+    /**
+     * Constructor that sets default values.
+     */
+    IMPORT_C TAlfTimedPoint(TReal32 aX, TReal32 aY) __SOFTFP;
+
+    /**
+     * Constructor. Enables target value setting.
+     *
+     * @param aXTarget  Target X value.
+     * @param aYTarget  Target Y value.
+     * @param aTransitionTime When the target value will be in effect. Transition duration in milliseconds.
+     *
+     */
+    IMPORT_C TAlfTimedPoint(TReal32 aXTarget, TReal32 aYTarget, TInt aTransitionTime) __SOFTFP;
+
+    /**
+     * Sets the interpolation style of both components of the point.
+     *
+     * @param aStyle  Timed value interpolation style.
+     */
+    IMPORT_C void SetStyle(TAlfInterpolationStyle aStyle);
+
+    /**
+     * Sets identifier of a mapping function that affects the timed value for both 
+     * components of the point. 
+     *
+     * @param aIdentifier Identifier of a function that will map the current value to required
+     * number space.
+     */
+    IMPORT_C void SetMappingFunctionIdentifier(TInt aIdentifier);    
+ 
+     /**
+     * Sets the target for the timed point.
+     *
+     * @param aPoint           Target point.
+     * @param aTransitionTime  Duration for reaching the target.
+     */
+    IMPORT_C void SetTarget(const TAlfRealPoint& aPoint, TInt aTransitionTime = 0);
+
+    /**
+     * Sets the target value of both components of the timed point.
+     *
+     * @param aValue           New target value.
+     * @param aTransitionTime  Duration for reaching the target.
+     */
+    IMPORT_C void SetTarget(TReal32 aValue, TInt aTransitionTime = 0) __SOFTFP;
+
+    /**
+     * Sets the target value for the timed point, with a transition that is
+     * done using a specific speed.
+     *
+     * @param aPoint  Target point.
+     * @param aUnitsPerSecond  Units per second during the transition.
+     */
+    IMPORT_C void SetTargetWithSpeed(const TAlfRealPoint& aPoint, TReal32 aUnitsPerSecond) __SOFTFP;
+
+    /**
+     * Sets the target value of both components of the timed point.
+     *
+     * @param aValue  New target value.
+     * @param aUnitsPerSecond  Speed of change.
+     */
+    IMPORT_C void SetTargetWithSpeed(TReal32 aValue, TReal32 aUnitsPerSecond) __SOFTFP;
+    
+    /**
+     * Returns the current value of the point.
+     *
+     * @return  Current values as a regular TAlfRealPoint.
+     */
+    inline TAlfRealPoint ValueNow() const
+        {
+        return TAlfRealPoint(iX.ValueNow(), iY.ValueNow());
+        }
+        
+    /**
+     * Returns the target value of the point.
+     *
+     * @return  Target as a TAlfRealPoint.
+     */
+    inline TAlfRealPoint Target()  const
+        {
+        return TAlfRealPoint(iX.Target(), iY.Target());
+        }
+    
+    /**
+     * Returns the transition time value of the point.
+     *
+     * @return  Transition times as a TAlfRealPoint.
+     */
+    inline TAlfRealPoint TimeToTargetinMilliSeconds()  const
+        {
+        return TAlfRealPoint(iX.TimeToTargetinMilliSeconds(), iY.TimeToTargetinMilliSeconds());
+        }
+
+    /**
+     * Returns the current interpolatad value of the point rounded to nearest
+     * integer values. Note that the TAlfTimedPoint values are
+     * floating-point.
+     *
+     * @see ValueNow() For returning the floating-point current value.
+     *
+     * @return  Current values as a regular TPoint.
+     */
+    IMPORT_C TPoint IntValueNow() const;
+
+    /**
+     * Returns the target value of the point rounded to nearest
+     * integer values. Note that the TAlfTimedPoint values are
+     * floating-point.
+     *
+     * @see Target() For returning the floating-point values.
+     *
+     * @return Target values as a normal TPoint - target value rounded to
+     * nearest integer.
+     */
+    IMPORT_C TPoint IntTarget() const;
+
+public:
+    
+    TAlfTimedValue iX;
+    TAlfTimedValue iY;
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alftransformation.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,237 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Transformation class.
+*
+*/
+
+
+
+#ifndef C_ALFTRANSFORMATION_H
+#define C_ALFTRANSFORMATION_H
+
+#include <e32base.h>
+
+#include <alf/alftimedvalue.h>
+
+class CAlfEnv;
+
+/**
+ * Indices to be used in the iParams array of TTransform.
+ */ 
+enum TAlfTransformParam
+    {
+    // Translate.
+    EAlfTransformParamTranslateX = 0,
+    EAlfTransformParamTranslateY = 1,
+    EAlfTransformParamTranslateZ = 2,
+    
+    // Rotate.
+    EAlfTransformParamRotateAngle = 0,
+    EAlfTransformParamRotateAxisX = 1,
+    EAlfTransformParamRotateAxisY = 2,
+    EAlfTransformParamRotateAxisZ = 3,
+    
+    // Scale.
+    EAlfTransformParamScaleX = 0,
+    EAlfTransformParamScaleY = 1,
+    EAlfTransformParamScaleZ = 2
+    };
+
+/** Number of parameters for a transformation step. */
+const TInt KAlfTransformParamCount = 4;
+
+/**
+ *  Transformation class for visual effects.
+ *  Usage:
+ *  @code
+ * 
+ *   // Spin around the control group
+ *   group.EnableTransformationL(); 
+ *   CAlfTransformation& xf = group.Transformation();
+ *   
+ *   // Set up a transformation that makes the control group rotate a full
+ *   // 360 degrees around the center of the display.
+ *   
+ *   TAlfTimedValue angle;
+ *   angle.SetValueNow(0);
+ *   angle.SetTarget(360, 5000); // 360 degrees in 5 seconds
+ *   
+ *   // Clear previously created transformation steps.
+ *   xf.LoadIdentity();
+ *   
+ *   xf.Translate(displaySize.mWidth/2, displaySize.mHeight/2);
+ *   xf.Rotate(angle);
+ *   xf.Translate(-displaySize.mWidth/2, -displaySize.mHeight/2);
+ * 
+ *  @endcode
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfTransformation ): public CBase
+    {
+
+public:
+
+    /** Transformation step types. */
+    enum TType
+        {
+        ETypeTranslate,
+        ETypeRotate,
+        ETypeScale
+        };
+
+    /** Transformation step. */
+    struct TTransform
+        {
+        TType iType;
+        TAlfTimedValue iParams[KAlfTransformParamCount];
+        };
+
+    /**
+     * Constructor
+     */
+    IMPORT_C static CAlfTransformation* NewL(CAlfEnv& aEnv);
+
+    /**
+     * Constructor
+     */
+    IMPORT_C static CAlfTransformation* NewLC(CAlfEnv& aEnv);
+
+    /**
+     * Destructor
+     */
+    IMPORT_C virtual ~CAlfTransformation();
+
+    /**
+     * Return the server side handle
+     *
+     * @return Handle to the server side CAlfSrvTransformationSubSession 
+     * object. 0 if not set.
+     */
+    TInt ServerHandle() const;
+    
+
+    /**
+     * Returns the number of transform steps in the transformation.
+     */
+    IMPORT_C TInt Count() const;
+    
+    /**
+     * Returns the number of non-identity transform steps in the transformation.
+     * Non-identity steps will result in the transformation having an effect
+     * on geometry.
+     */
+    IMPORT_C TInt NonIdentityCount() const;
+
+    /**
+     * Returns a one of the transformation steps so that it 
+     * can be modified and set with SetStep method.
+     *
+     * @param aIndex  Index of the transformation step.
+     *
+     * @return  Transformation step. 
+     */
+    IMPORT_C TTransform Step(TInt aIndex);
+
+    /**
+     * Modifies a one of the transformation steps by replacing
+     * the existing step with a given step.
+     *
+     * @param aIndex  Index of the transformation step to be replaced
+     *
+     * @return  Transformation step. 
+     */
+    IMPORT_C void ReplaceStep(TInt aIndex, TTransform aTransformationStep);
+    
+    /**
+     * Clears previously created transformation steps.
+     */
+    IMPORT_C void LoadIdentity();
+
+    /**
+     * 2D rotation.
+     */
+    IMPORT_C void Rotate(TReal32 aAngle) __SOFTFP;
+    
+    /**
+     * 2D translation.
+     *
+     * @param aX x-coordinate
+     * @param aY y-coordinate
+     */
+    IMPORT_C void Translate(TReal32 aX, TReal32 aY) __SOFTFP;
+
+    /**
+     * 2D translation with timed values.
+     */
+    IMPORT_C void Translate(const TAlfTimedValue& aX, const TAlfTimedValue& aY);
+
+    /**
+     * 2D scaling.
+     */
+    IMPORT_C void Scale(TReal32 aX, TReal32 aY) __SOFTFP;
+
+    /**
+     * 2D scaling with timed values.
+     */
+    IMPORT_C void Scale(const TAlfTimedValue& aX, const TAlfTimedValue& aY);
+
+    /**
+     * 3D scaling.
+     */
+    IMPORT_C void Scale(TReal32 aX, TReal32 aY, TReal32 aZ) __SOFTFP;
+
+    /**
+     * 3D scaling with timed values.
+     */
+    IMPORT_C void Scale(const TAlfTimedValue& aX, const TAlfTimedValue& aY,
+                        const TAlfTimedValue& aZ);
+    
+    
+    /**
+     * 2D rotation with timed value.
+     *
+     * @param aAngle How much and the duration.
+     */
+    IMPORT_C void Rotate(const TAlfTimedValue& aAngle);
+
+    /**
+     * 3D rotation.
+     */
+    IMPORT_C void Rotate(TReal32 aAngle, TReal32 aAxisX, TReal32 aAxisY, TReal32 aAxisZ) __SOFTFP;
+    
+    /**
+     * 3D rotation with timed values.
+     */
+    IMPORT_C void Rotate(const TAlfTimedValue& aAngle, 
+                         TReal32 aAxisX, TReal32 aAxisY, TReal32 aAxisZ) __SOFTFP;
+
+
+
+private:
+
+    // private constructors
+    CAlfTransformation();
+    void ConstructL(CAlfEnv& aEnv);
+
+private: // data
+
+    // Private data. Owned.
+    struct TPrivateData;
+    TPrivateData* iData;
+
+    };
+
+
+#endif // C_ALFTRANSFORMATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfutil.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,393 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Misc. utilities
+*
+*/
+
+
+
+#ifndef C_ALFUTIL_H
+#define C_ALFUTIL_H
+
+
+#include <e32base.h>
+#include <gdi.h>
+#include <AknsItemID.h>
+#include <alf/alfenv.h>
+
+/* Forward declarations. */
+struct TAlfRealPoint;
+
+
+/**
+ * AlfUtil is a collection of utility routines for Alfred.dll.
+ * Many of the utility routines are mathematical operations such as
+ * the calculation of a vector cross product or linear interpolation between two
+ * values.
+ *
+ * AlfUtil contains only static member functions. It cannot be instantiated.
+ */
+NONSHARABLE_CLASS(AlfUtil)
+    {
+public:
+
+    /** @beginAPI */
+
+    /**
+     * Calculates the smallest power-of-two that is equal to or greater than
+     * a value (rounds value up to the nearest power-of-two).
+     *
+     * @param aValue Integer value.
+     *
+     * @return  Smallest power-of-two that is equal to or greater than
+     *          <code>aValue</code>.
+     *
+     * @see Power2RoundDown() for down-rounding equivalent.
+     */
+    IMPORT_C static TInt Power2(TInt aValue);
+
+    /**
+     * Calculates the largest power-of-two that is equal to or smaller than
+     * a value (rounds the value down to nearest power-of-two).
+     *
+     * @param aValue  Integer value.
+     *
+     * @return  Smallest power-of-two that is equal to or greater than
+     *          <code>aValue</code>.
+     */
+    IMPORT_C static TInt Power2RoundDown(TInt aValue);
+
+    /**
+     * Interpolates between two values. Calculates a linear interpolation
+     * between a minimum and maximum value.
+     *
+     * @param aPos  Position. 0.0 corresponds to the minimum value, 1.0
+     *              corresponds to the maximum value. Positions outside this
+     *              range are allowed, which results in extrapolation.
+     * @param aMin  Minimum value.
+     * @param aMax  Maximum value.
+     *
+     * @return  Interpolated value.
+     */
+    IMPORT_C static TReal32 Interpolate(TReal32 aPos, TReal32 aMin, TReal32 aMax) __SOFTFP;
+
+    /**
+     * Wraps a value to a range.
+     *
+     * @param aValue  Reference to the value to wrap. Will be modified.
+     * @param aLow    Range minimum. If aValue is equal to aLow, it will remain
+     *                at aLow.
+     * @param aHigh   Range maximum. If aValue is equal to aHigh, it will be
+     *                wrapped to aLow.
+     */
+    IMPORT_C static void WrapValue(TReal32& aValue, TReal32 aLow, TReal32 aHigh) __SOFTFP;
+
+    /**
+     * Generates a random integer.
+     *
+     * @param aMin  Minimum possible value.
+     * @param aMax  Maximum possible value.
+     *
+     * @return  Random integer between the minimum and maximum values,
+     *          inclusive.
+     */
+    IMPORT_C static TInt RandomInt(TInt aMin, TInt aMax);
+
+    /**
+     * Generates a random real number.
+     *
+     * @param aMin  Minimum possible value.
+     * @param aMax  Maximum possible value.
+     *
+     * @return  Random real number between the minimum and maximum values,
+     *          inclusive.
+     */
+    IMPORT_C static TReal32 RandomReal(TReal32 aMin, TReal32 aMax) __SOFTFP;
+
+    /**
+     * Approximates the length of a 2D vector. This is done without
+     * calculating a square root.
+     *
+     * @param aVector  2D vector as a point. The X and Y components are
+     *                 interpreted as deltas.
+     *
+     * @return  Approximate length of the vector.
+     */
+    IMPORT_C static TReal32 QuickLength(TAlfRealPoint& aVector) __SOFTFP;
+
+    /**
+     * Approximates the length of a 2D vector. This is done without
+     * calculating a square root.
+     *
+     * @param aDx  X delta of the vector.
+     * @param aDy  Y delta of the vector.
+     *
+     * @return  Approximate length of the vector.
+     */
+    IMPORT_C static TReal32 QuickLength(TReal32 aDx, TReal32 aDy) __SOFTFP;
+
+    /**
+     * Normalizes a vector so that its length will be approximately 1.0.
+     * This is done without calculating a square root.
+     *
+     * @param aVector  2D vector to be normalized as a point. The X and Y
+     *                 components are interpreted as deltas. Will be modified.
+     */
+    IMPORT_C static void QuickNormalize(TAlfRealPoint& aVector);
+
+    /**
+     * Normalizes a vector so that its length will be approximately 1.0.
+     * This is done without calculating a square root.
+     *
+     * @param aVector  3D vector to be normalized as a point (X, Y, Z components
+     *                 as an array of TReal32). Will be modified.
+     */
+    IMPORT_C static void QuickNormalize(TReal32 aVector[3]) __SOFTFP;
+
+    /**
+     * Calculates a cross product of 3D vectors. aProduct = aA x aB.
+     *
+     * @param aA  3D vector.
+     * @param aB  3D vector.
+     * @param aProduct  3D vector where the cross product is returned.
+     */
+    IMPORT_C static void CrossProduct(const TReal32 aA[3], const TReal32 aB[3], TReal32 aProduct[3]) __SOFTFP;
+
+    /**
+     * Calculates a normal vector for a plane defined by three points.
+     *
+     * @param aPoints  Array of three 3D vectors. The first index is the number
+     *                 of the vector, the second index is the vector component
+     *                 (x, y, z).
+     * @param aNormal  Resulting normal vector.
+     */
+    IMPORT_C static void NormalFromPoints(const TReal32 aPoints[3][3], TReal32 aNormal[3]) __SOFTFP;
+
+    /**
+     * Calculates a matrix that projects 3D points onto a plane. The name
+     * ShadowMatrix comes from the intended usage: when used as a modelview
+     * matrix, this matrix will flatten a 3D mesh onto a projected shadow.
+     *
+     * @param aPlanePoint  Point on the plane onto which the shadow is casted.
+     * @param aPlaneNormal  Normal of the plane onto which the shadow is casted.
+     * @param aLightPos  Position of the light source.
+     * @param aDestMat  Resulting matrix.
+     */
+    IMPORT_C static void ShadowMatrix(const TReal32 aPlanePoint[3],
+                                      const TReal32 aPlaneNormal[3],
+                                      const TReal32 aLightPos[4],
+                                      TReal32 aDestMat[16]) __SOFTFP;
+
+    /**
+     * Determines the amount of free memory in the system.
+     *
+     * @param aTotalMemory  If not NULL, the total amount of memory is
+     *                      returned here.
+     *
+     * @return  Bytes of free memory.
+     */
+    IMPORT_C static TUint FreeMemory(TUint* aTotalMemory = 0);
+
+    /**
+     * Determines the native resolution of the device's screen.
+     *
+     * @return  Screen size in pixels.
+     */
+    IMPORT_C static TSize ScreenSize();
+
+    /**
+     * Finds the font that is the closest match to a font specification.
+     * Note that the returned font instance must be released with
+     * AlfUtil::ReleaseFont(). Deleting the returned font instance is not allowed.
+     *
+     * @param aFontSpec  Font specification.
+     *
+     * @return  Font instance. Must be released with a call to AlfUtil::ReleaseFont()
+     *          when no longer needed.
+     */
+    IMPORT_C static CFont* NearestFontInTwipsL(const TFontSpec& aFontSpec);
+
+    /**
+     * Releases a font that was returned by NearestFontInTwipsL(). Must be
+     * called when the font is no longer needed.
+     *
+     * @param aFont  Font returned by a previous allocation by AlfUtil.
+     */
+    IMPORT_C static void ReleaseFont(CFont* aFont);
+
+    /**
+     * Calculates a display size dependent length unit. This can be used for
+     * layout calculations that should be independent of the display size.
+     * For example, this could be the distance at which a shadow is drawn
+     * behind text strings (assuming the font size also depends on display
+     * size).
+     *
+     * @return  Length unit.
+     */
+    IMPORT_C static TReal32 LengthUnit() __SOFTFP;
+
+    /**
+     * Approximates the lightness of a color. The returned value is in range
+     * 0...1, where 0.0 means the equivalent of black and 1.0 means the
+     * equivalent of white. This is similar to the Value component in the HSV
+     * color model (but not exactly the same).
+     *
+     * @param aColor  Color whose lightness is to be evaluated.
+     *
+     * @return  Lightness value.
+     */
+    IMPORT_C static TReal32 ColorLightness(const TRgb& aColor) __SOFTFP;
+
+    /**
+     * Resamples given FBS bitmap to new size (converting
+     * color modes along the way..)
+     * @param aSrcBitmap Source bitmap to resample.
+     * @param aScaledBitmap Output bitmap. The original size of
+     * this CFbsBitmap defines the size of the downscaled bitmap.
+     */
+    IMPORT_C static void ScaleFbsBitmapL(const CFbsBitmap & aSrcBitmap,
+                                         CFbsBitmap & aScaledBitmap);
+
+    /**
+     * Converts separate mask and color bitmaps into single
+     * EColor16MA (24bpp colour plus 8bpp alpha) bitmap.
+     * @param aBitmap Source color channel bitmap.
+     * @param aMaskBitmap The source alpha mask bitmap. Use either a black and
+     * white (binary) mask bitmap, or if aMaskBitmap's display mode is EGray256,
+     * alpha blending is used. Use of any other mode may result in unpredictable
+     * results.
+     * @param aCombinedBitmap Bitmap that will to contain the target
+     * EColor16MA bitmap with color information from aBitmap and alpha information
+     * from aMaskBitmap. NOTE: Must have color mode EColor16MA!
+     */
+    IMPORT_C static void CombineMaskFbsBitmapL(const CFbsBitmap & aSrcBitmap,
+                                               const CFbsBitmap & aSrcMaskBitmap,
+                                               CFbsBitmap & aCombinedBitmap);
+
+    /**
+     * Crops an area of FBS bitmap to new image. The size of the
+     * copped bitmap defines the size of the area to crop.
+     */
+    IMPORT_C static void CropFbsBitmapL(const CFbsBitmap & aSrcBitmap,
+                                        CFbsBitmap & aCroppedBitmap,
+                                        TPoint aCropPosition);
+
+    /**
+     * Resamples given unsigned byte image data to new size. Uses box
+     * filtering. Can be used to downscale too large textures, for example.
+     *
+     * @param aComponents Number of image components (color channels) in the
+     * source image. Use 3 with RGB image and 4 with RGBA. The destination will
+     * have the same amount of color channels after this operation.
+     * @param aSrcSize Size (width and height) of the original image (aSrcBuffer),
+     * in number of pixels (width) or rows (height).
+     * @param aSrcBuffer Pointer to the source image data.
+     * @param aDestSize Size (width and height) of the new scaled image,
+     * (aDestBuffer) in number of pixels (width) or rows (height).
+     * @param aDestBuffer Output parameter: Pointer where new scaled image
+     * data will be stored. You must remember to allocate the space for the
+     * buffer before calling this method.
+     */
+    IMPORT_C static void ScaleImage(TInt aComponents,
+                                    const TSize& aSrcSize,
+                                    const TUint8* aSrcBuffer,
+                                    const TSize& aDestSize,
+                                    TUint8* aDestBuffer);
+
+    /**
+     * Crops given unsigned byte image data. Can be used to split
+     * large images to smaller sections.
+     *
+     * @param aComponents Number of image components (color channels) in the
+     * source image. Use 3 with RGB image and 4 with RGBA. The destination will
+     * have the same amount of color channels after this operation.
+     * @param aSrcBufferSize Size (width and height) of the original image (aSrcBuffer),
+     * in number of pixels (width) or rows (height).
+     * @param aSrcBuffer Pointer to the source image data.
+     * @param aCropOffset Cropping offset in the source image. Location of the
+     * top-left corner of the cropped area, in pixels.
+     * @param aCroppedSize Size of the cropped area. Is also the size of the
+     * image in aDestBuffer. Width and height in pixels.
+     * @param aDestBuffer Output parameter: Pointer where the cropped image
+     * data will be stored. You must remember to allocate the space for the
+     * buffer before calling this method.
+     */
+    IMPORT_C static void CropImage(TInt aComponents,
+                                    const TSize& aSrcBufferSize,
+                                    const TUint8* aSrcBuffer,
+                                    const TPoint& aCropOffset,
+                                    const TSize& aCroppedSize,
+                                    TUint8* aDestBuffer);
+
+
+    /**
+     * Checks if aTag is included in aTagsColonSeparated. Tags are case-sensitive.
+     *
+     * @param aTagsColonSeparated  One or more tags separated by colons (:).
+     *                             For example: "hello:world:tag3".
+     * @param aTag  Tag to look for. For example: "world".
+     *
+     * @return  <code>ETrue</code>, if the tag was found in the colon-separated
+     *          tags descriptor. <code>EFalse</code> otherwise.
+     *
+     * @see CAlfVisual::FindTag()
+     */
+    IMPORT_C static TBool TagMatches(const TDesC8& aTagsColonSeparated, const TDesC8& aTag);
+
+    /**
+     * Converts a bitmap to specified display mode.
+     * This method converts a bitmap in any display mode to specified display mode.
+     * Method creates a new bitmap, leaves it in cleanup stack and returns it.
+     *
+     * @param aBitmap The bitmap to be converted.
+     * @param aDisplaymode The target display mode to convert the bitmap into.
+     * @return Newly created conversion of the source bitmap.
+     */
+    IMPORT_C static CFbsBitmap* ConvertBitmapToDisplayModeLC( const CFbsBitmap& aBitmap, const TDisplayMode& aDisplaymode );
+
+ 
+    /**
+     * @deprecated <b>Always returns KAknsIIDNone<\b>
+     * 
+     * Retrieves the TAknsItemID corresponding to the Textual skin identifier
+     *
+     * @param aEnv Alf Environment variable
+     * @param aSkinId The textual identifier for which corresponding TAknsItemID is
+     *	required
+     *
+     * @return TAknsItemID object corresponding to aSkinId
+     */
+	 IMPORT_C static TAknsItemID ThemeItemIdL(CAlfEnv& aEnv, const TDesC& aSkinId );
+
+    /** @endAPI */
+
+    /**
+     * Asserts if the given condition is false.
+     */
+    static void Assert(TBool aCondition);
+
+    /**
+     * Rounds a float (TReal32) correctly into an integer (TInt). Takes care of both negative
+     * and positive real number.
+     * 
+     * @param aVal The value to be rounded to the closest integer.
+     * @return Rounded integer.
+     */
+    static TInt RoundFloatToInt(TReal32 aVal);
+    
+    };
+
+
+
+#endif // C_ALFUTIL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfversion.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Version information of the Alfred.
+*
+*/
+
+
+
+#ifndef C_ALFVERSION_H
+#define C_ALFVERSION_H
+
+/** 
+ * This header contains version information of the Alfred. Version information
+ * is divided into three parts: major, minor and build.
+ *
+ * ============================================================================ 
+ *
+ * ALF_VERSION_MAJOR defines client API version, it is increased if API 
+ * backwards compatibility is broken during API future development. 
+ *
+ * If application compilation time major-version value is found to be 
+ * different than  the runtime value of the Alfred, then client can not use 
+ * Alfred at all because the API:s are not compatible.
+ *
+ * ============================================================================
+ *
+ * ALF_VERSION_MINOR defines Server & coretoolkit API version, it is increased 
+ * if API backwards compatibility is broken during API future development.
+ *
+ * If application compilation time minor-version value is found to be 
+ * different than the runtime value of the Alfred, then no server extensions 
+ * are allowed to be loaded because the compatibility of the coretoolkit/server 
+ * API is no more what it was when the server extension was compiled.
+ *
+ * ============================================================================
+ *
+ * ALF_VERSION_BUILD defines API version is general level, it is increased if 
+ * API forward compatibility is broken during API future development. This kind 
+ * of break comes for intance when new exported methods are added into API as 
+ * a part of normal API future development.
+ *
+ * If application compilation time build-version value is found to be larger 
+ * than the runtime value of the Alfred, then no server extension is allowed 
+ * to be loaded for the application because there might potentially not exist 
+ * runtime implementation for the methods that the server extension expects 
+ * to exist in the API.
+ *
+ * ============================================================================
+ *
+ * Version history:
+ * 1.1.3 - ??.??.2007 : -
+ * 1.1.4 - 24.10.2007 : Increasing version at the end of development sprint.
+ *                      First version which has SIS upgrade enablers in place.
+ * 1.1.5 - ??.??.???? : Increasing version at the end of development sprint.
+ *                      Some functional break in alfclient pointer event handling.
+ * 1.1.6 - 22.10.2007 : Increasing version at the end of development sprint.
+ * 1.1.7 -  7.12.2007 : Increasing version at the end of development sprint.
+ * 1.1.8 - 20.12.2007 : Increasing version at the end of development sprint.
+ * 1.1.9 - 17.01.2008 : Increasing version at the end of development sprint.
+ * 1.1.10 - 30.01.2008: Increasing version at the end of development sprint.
+ * 1.1.11 - 14.03.2008: Increasing version at the end of development sprint.
+ * 1.1.12 - 2.4.2008  : Increasing version at the devbranch -> S60 5.0 update.
+ * 1.1.13 - 24.4.2008 : Increasing version at the end of development sprint.
+ * 1.1.14 - 18.6.2008 : Increasing version at the end of development sprint.
+ * 1.1.16 - 21.8.2008 : Increasing version at the end of development sprint.                      
+ * 1.1.17 - 18.9.2008 : Increasing version at the end of development sprint.                      
+ * 1.1.18 - 14.11.2008 : Increasing version at the end of development sprint.
+ * 1.1.19 - 04.02.2009 : Increasing version at the end of development sprint.                      
+ */
+
+/**
+ * NOTE: Update the version history and also change version numbers in package 
+ * files in /uiaccelerator/uiacceltk/hitchcock/sis/ 
+ */
+
+/** Client API version, increased only if backwards compatibility is broken */
+#define ALF_VERSION_MAJOR 1
+
+/** Server & core API version, increased only if backwards compatibility is broken */
+#define ALF_VERSION_MINOR 1
+
+/** Common build version, increased if either of the API:s are no more forward compatible */
+#define ALF_VERSION_BUILD 22
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfviewportlayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Viewport layout definition.
+*
+*/
+
+
+
+#ifndef C_ALFVIEWPORTLAYOUT_H
+#define C_ALFVIEWPORTLAYOUT_H
+
+#include <alf/alflayout.h>
+
+/**
+ *  Viewport layout
+ *  Usage:
+ *  @code
+ *  // Aim is to zoom into one of the grids of icons using a viewport layout.
+ *
+ *  // Create a anchor layout and grid layout into the parent anchor layout and 
+ *  // populate it with application icons.
+ * 
+ *  // The viewport layout sits in the middle of the screen.
+ *   parent->SetRelativeAnchorRect(1, EAlfAnchorOriginHCenter, EAlfAnchorOriginVCenter, TAlfRealPoint(-0.2, -0.2),
+ *                                    EAlfAnchorOriginHCenter, EAlfAnchorOriginVCenter, TAlfRealPoint(0.2, 0.2));
+ *   
+ *   // Create the viewport.
+ *   CAlfViewportLayout* viewport = CAlfViewportLayout::AddNewL(*this, parent);
+ * 
+ *  // Set our virtual coordinate system to be based on the number of items in the grid (KNumGridItems).
+ *   viewport->SetVirtualSize(TAlfRealSize(KNumGridItems, 1.0), 0);
+ *   
+ *   // Set the size and position of the viewport to look at the middle icon in the list.
+ *   viewport->SetViewportSize(TAlfRealSize(2, 1.0/6.0), 0);
+ *   viewport->SetViewportPos(TAlfRealPoint(TReal32(KNumGridItems/2)-1.0f, 5.0/12.0), 0);
+ *   
+ *   // This anchor layout will contain a strip of large icons clipped by the viewport window.
+ *   CAlfAnchorLayout* zoomedParent = CAlfAnchorLayout::AddNewL(*this, viewport);     
+ *   
+ *  @endcode
+ * 
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+class CAlfViewportLayout : public CAlfLayout
+    {
+
+public:
+
+    /**
+     * Two-phased constructor, which attach new object into the control.
+     * @param aOwnerControl Control that owns this new obejct.
+     * @param aParentLayout If given, the new object is set as child.
+     */
+    IMPORT_C static CAlfViewportLayout* AddNewL(CAlfControl& aOwnerControl,
+                                            CAlfLayout* aParentLayout = 0);
+
+    /**
+     * Constructor.
+     */
+    IMPORT_C CAlfViewportLayout();
+
+    /**
+     * Second-phase constructor.
+     */
+    IMPORT_C void ConstructL(CAlfControl& aOwner);
+
+    /**
+     * Virtual destructor.
+     */
+    IMPORT_C ~CAlfViewportLayout();
+
+    /** @beginAPI */
+
+	/**
+	 * Set virtual size of the viewable area.
+	 *
+	 * This is different from the physical size of the viewport -
+	 * it defines the coordinate space that is used for scrolling.
+	 * To use a normalised (u, v) coordinate mapping system, set aSize to (,1.0, 1.0).
+	 *
+	 * @param aSize The bottom-right corner of the child visual, in the units you wish to use for positioning the viewport.
+	 * @param aTransitionTime The time it will take to complete the resizing of the virtual size.
+	 */
+    IMPORT_C void SetVirtualSize(const TAlfRealSize& aSize, TInt aTransitionTime);
+
+	/**
+	 * Set size of the viewport area.
+	 *
+	 * This is the size of the "window" we are using to look at the visual.
+	 *
+	 * @param aSize The size of the viewport in the units defined by SetVirtualSize().
+	 * @param aTransitionTime The time it will take to complete the resizing of the viewport area.
+	 * @see SetVirtualSize, SetViewportPos
+	 */
+    IMPORT_C void SetViewportSize(const TAlfRealSize& aSize, TInt aTransitionTime);
+
+	/**
+	 * Set position of the viewport area.
+	 *
+	 * This is the offset of the "window" we are using to look at the visual.
+	 *
+	 * @param aSize The size of the viewport in the units defined by SetVirtualSize().
+	 * @param aTransitionTime The time it will take to complete moving the viewport area.
+	 * @see SetVirtualSize, SetViewportSize
+	 */
+    IMPORT_C void SetViewportPos(const TAlfRealPoint& aPos, TInt aTransitionTime);
+
+    /** @endAPI */
+
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void RemoveAndDestroyAllD();
+    IMPORT_C void UpdateChildrenLayout(TInt aTransitionTime = 0);
+    IMPORT_C CAlfVisual* FindTag(const TDesC8& aTag);
+    
+    /** 
+     * From CAlfLayout
+     * @see CAlfLayout
+     */
+    IMPORT_C TAlfXYMetric BaseUnit() const; 
+
+
+protected:
+    /**
+     * From CAlfVisual
+     * @see CAlfVisual
+     */
+    IMPORT_C void DoRemoveAndDestroyAllD();
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+
+private:
+
+    // Private data structure. Owned.
+    struct TViewportLayoutPrivateData;
+    TViewportLayoutPrivateData* iViewportLayoutData;
+
+    };
+
+
+
+#endif // C_ALFVIEWPORTLAYOUT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfvisual.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,942 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 class for visuals
+*
+*/
+
+
+
+#ifndef C_ALFVISUAL_H
+#define C_ALFVISUAL_H
+
+class CAlfEnv;
+class CAlfVisual;
+class CAlfControlGroup;
+class CAlfControl;
+class MAlfEventHandler;
+struct TAlfBoxMetric;
+class CAlfDropShadow;
+
+#include <e32base.h>
+#include <alf/alftimedvalue.h>
+#include <alf/alfpropertyowner.h>
+
+/** Visual types. */
+enum TAlfVisualType
+    {
+    EAlfVisualTypeVisual,
+    EAlfVisualTypeLine,
+    EAlfVisualTypeText,
+    EAlfVisualTypeLCTText,
+    EAlfVisualTypeImage,
+    EAlfVisualTypeMesh,
+    EAlfVisualTypeCanvas
+    };
+
+/** Visual flags. */
+enum TAlfVisualFlags
+    {
+    /** Manual layout means that layouts can't change the position and
+        size of the visual; the owner of the visual is expected to
+        manually maintain the visual's placement. */
+    EAlfVisualFlagManualSize = 0x1,
+    EAlfVisualFlagManualPosition = 0x2,
+    EAlfVisualFlagManualLayout = EAlfVisualFlagManualSize |
+                                 EAlfVisualFlagManualPosition,
+
+    /** 
+     * This enum is retained for source compatibility.
+     * @deprecated 
+     * @note See EAlfVisualFlagClipping
+     */
+    AlfVisualFlagClipping = 0x4,
+    
+    /** Notify owner control when the visual's layout has been updated.
+        Notication is sent after all children have been updated. */
+    EAlfVisualFlagLayoutUpdateNotification = 0x8,
+
+    /** When the visual is drawn it will use a 3D projection. */
+    EAlfVisualFlag3DProjection = 0x10,
+
+    /** No depth test when drawing with a 3D projection. */
+    EAlfVisualFlagNoDepthOcclusion = 0x20,
+
+    /** Use a local horizon with a 3D projection. Otherwise, the global
+        display horizon is used instead. */
+    EAlfVisualFlagLocalHorizon = 0x40,
+
+    /** Contents of the visual are clipped to its display rectangle. */
+    EAlfVisualFlagClipping = 0x80,
+
+    EAlfVisualFlagHOriginCenter = 0x100,
+
+    EAlfVisualFlagHOriginRight = 0x200,
+
+    EAlfVisualFlagVOriginCenter = 0x400,
+
+    EAlfVisualFlagVOriginBottom = 0x800,
+
+    /** Visual has changed and needs refresh. */
+    EAlfVisualChanged = 0x1000,
+    
+    /** When the visual is drawn, the depth buffer shouldn't be updated. */
+    EAlfVisualFlagNoDepthUpdate = 0x2000,
+
+    /** Use the visual's local layout transition time, do not inherit from parent. */
+    EAlfVisualFlagManualTransitionTime = 0x4000,
+
+    /** Draw above the normal drawing order. */
+    EAlfVisualFlagDrawAfterOthers = 0x10000,
+    
+    /** Do not automatically update the layout of children when doing 
+        changes in a layout (e.g., when reordering children). */
+    EAlfVisualFlagFreezeLayout = 0x20000,
+    
+    /** The visual will be ignored when checking for possible pointer event
+        interaction. */
+    EAlfVisualFlagIgnorePointer = 0x40000,
+
+    /** 
+     * automatically reverse the base unit sign in the X axis if the current locale setting is 
+     * for mirrored layout
+     *
+     * @note this will only affect the positions of visuals contained
+     * within layout visuals, the contents within a visual such as a text visual will not be 
+     * affected. 
+     */
+    EAlfVisualFlagAutomaticLocaleMirroringEnabled = 0x80000,
+    
+    /** 
+     * RnD: if set, some of the debug features are enabled. See programmers'
+     * guide for more info.
+     *
+     * If the central repository has the setting to draw selected visual outline, 
+     * setting this flag will draw outline for the visual and its child visuals
+     */    
+    EAlfVisualFlagEnableDebugMode  = 0x100000,
+
+    //Code added by Devayani
+    /** 
+     * Setting this flag makes visual and its children Inactive i.e. it is ignored from roster operations 
+     * - Draw, Handle event, change notifications etc.
+     * Unsetting flag can again make visual tree active.
+     * Note that flag change does not take effect unless that display area is refreshed.
+     **/
+    EAlfVisualFlagInactive = 0x200000,
+
+    /** 
+     * Setting this flag informs renderer that visual is to be considered as opaque and thus
+     * renderer may choose not to draw visuals behind opaque visual. Note that visual
+     * attribute "opacity" is not affected by this flag.
+     **/
+    EAlfVisualFlagOpaqueHint = 0x400000,
+    
+    EAlfVisualFlagLast = 0xFFFFFFFF
+    };
+
+/** Horizontal origin of a visual. */
+enum TAlfVisualHOrigin
+    {
+    EAlfVisualHOriginLeft = 0,
+    EAlfVisualHOriginCenter = 1,
+    EAlfVisualHOriginRight = 2
+    };
+
+
+/** Vertical origin of a visual. */
+enum TAlfVisualVOrigin
+    {
+    EAlfVisualVOriginTop = 0,
+    EAlfVisualVOriginCenter = 1,
+    EAlfVisualVOriginBottom = 2
+    };
+
+const TText KAlfTagSeparator = ':';
+
+const TInt KAlfTactileFeedbackEventTypeNone = -1;
+
+class CAlfControl;
+class CAlfLayout;
+class CAlfDisplay;
+class CAlfEnv;
+class CAlfBrushArray;
+class CAlfGenComponent;
+class MAlfMappingFunction;
+class CAlfTransformation;
+
+/** Fixed properties for visuals, Use these for efficient copying of visual properties. */ 
+class AlfVisualProperties
+    {
+    public:
+    enum 
+        {
+        ENone = 0x0,
+        ESize = 0x1,
+        EPosition = 0x2,
+        EOpacity = 0x4,
+        EDepthOffset = 0x8,
+        ESecondaryImageAlpha = 0x10, 
+        EScale = 0x20,
+        EPosOffset = 0x40,
+        ETextVisShadowOpacity = 0x80,
+        EImageVisTurnAngle = 0x100,
+        ELineVisThickness = 0x200,
+        ELineVisShadowThickness = 0x400,
+        ELineVisStartPos = 0x800,
+        ELineVisEndPos = 0x1000,
+        EMeshVisYawAngle = 0x2000, 
+        EMeshVisPitchAngle = 0x4000,
+        EMeshVisMaterial = 0x8000,
+        ELayoutScrollOffset = 0x10000,
+        // Add new properties here (next value: 0x20000)
+        
+        EAll = 0xFFFFFFFF
+        };
+    };
+
+
+/**
+ *  Visual base class
+ *
+ *  All visuals and layout are derived from this.
+ *  Usage:
+ *  @code
+ *    // #1 Visual object usage
+ *    CAlfVisual* newVisual = CAlfVisual::AddNewL( *myMainControl, mMainGridLayout );
+ *    newVisual->EnableBrushesL();
+ *    newVisual->Brushes->AppendL( borderBrush, EAlfHasOwnership );
+ *    
+ *   // #2 as a base class
+ *   class CMyVisual : public CAlfVisual
+ *       {    
+ *   public:
+ *       // allocation function
+ *       CMyVisual(CAlfControl& aOwnerControl, CAlfLayout* aParentLayout = 0);  
+ *    
+ *       // Function documentation
+ *       void MyVisualSpecificFunction();
+ *   protected:
+ *
+ *       ~CAlfVisual();
+ *   private:
+ *       TInt mMyPrivateData;    
+ *       };
+ *  @endcode
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+class CAlfVisual : public CAlfPropertyOwner
+    {
+
+public:
+
+    /**
+     * Constructor
+     */
+    IMPORT_C CAlfVisual();
+
+    /**
+     * ConstructL
+     */
+    IMPORT_C virtual void ConstructL(CAlfControl& aOwner);
+
+    /**
+     * Destructor
+     */
+    IMPORT_C virtual ~CAlfVisual();
+    
+    /**
+     * Destroys a hierarchy of visuals, along with this visual. The visuals
+     * are first removed from their owner.
+     */
+    IMPORT_C virtual void RemoveAndDestroyAllD();
+    
+    /**
+     * Return the server side handle
+     *
+     * @return Handle to the server side CAlfVisual object. 0 if not set.
+     */
+    IMPORT_C TInt Identifier() const;
+     
+    /**
+     * Sets the layout this visual belongs to.
+     *
+     * @param aLayout Parent layout
+     */
+    void SetLayout(CAlfLayout* aLayout);
+    
+    /**
+     * Set a flag that affects the visual's behaviour.
+     *
+     * @param aFlag  Flag to set.
+     */
+    IMPORT_C void SetFlag(TAlfVisualFlags aFlag);
+
+    /**
+     * Sets one or more flags that affect the visual's behaviour.
+     *
+     * @param aAnyFlags  One or more flags to set.
+     */
+    IMPORT_C void SetFlags(TUint aAnyFlags);
+
+    /**
+     * Unset flags that affect the visual's behaviour.
+     *
+     * @param aFlag  Flag to clear.
+     */
+    IMPORT_C void ClearFlag(TAlfVisualFlags aFlag);
+
+    /**
+     * Clear one or more flags that affect the visual's behaviour.
+     *
+     * @param aAnyFlags  One or more flags to clear.
+     */
+    IMPORT_C void ClearFlags(TUint aAnyFlags);
+
+    /**
+     * Returns the flags of the visual.
+     * @return Flags.
+     */
+    IMPORT_C TUint Flags() const;
+    
+    /**
+     * Returns the layout this visual belongs to.
+     *
+     * @return Parent layout. NULL if not set.
+     */
+    IMPORT_C CAlfLayout* Layout() const;
+    
+    /**
+     * Returns the position of the visual. This is set by UpdateLayout().
+     *
+     * @return Position.
+     */
+    IMPORT_C TAlfTimedPoint Pos() const;
+
+    /**
+     * Sets the position of the visual.
+     */
+    IMPORT_C void SetPos(const TAlfRealPoint& aPos, TInt aTransitionTime = 0);
+    
+    /**
+     * Returns the size of the visual. This is set by UpdateLayout().
+     */
+    IMPORT_C const TAlfTimedPoint Size() const;
+
+    /**
+     * Sets the size of the visual.
+     */
+    IMPORT_C void SetSize(const TAlfRealSize& aSize, TInt aTransitionTime = 0);
+    
+    /**
+     * Returns the overall opacity affecting the owner's visuals. All visuals 
+     * owned by this object are affected by this opacity.
+     *
+     * @return  Timed value.
+     */
+    IMPORT_C const TAlfTimedValue& Opacity() const;
+    
+    /**
+     * Set opacity
+     *
+     * @param aOpacity Opacity value.
+     */
+    IMPORT_C void SetOpacity( const TAlfTimedValue& aOpacity );
+    
+    /**
+     * Returns the environment where this visual belongs into.
+     *
+     * @return  Environment.
+     */
+    IMPORT_C CAlfEnv& Env() const;
+    
+    /**
+     * Returns the display of the visual (if shown).
+     *
+     * @return  Pointer to <code>CAlfDisplay</code> instance, or
+     * <code>NULL</code> if no display is associated with the visual.
+     */
+    IMPORT_C CAlfDisplay* Display() const;
+    
+    /**
+     * Sets the display on which the visual is being shown.
+     *
+     * @param aDisplay  Pointer to display onto which to attach the visual
+     */
+    void SetDisplay(CAlfDisplay* aDisplay);
+        
+    /**
+     * Determines the tag of the visual.
+     *
+     * @return  Tag descriptor of the visual.
+     *
+     * @see CAlfVisual::SetTagL()
+     * @see CAlfVisual::IsTagged()
+     * @see CAlfVisual::FindTag()
+     */
+    IMPORT_C const TDesC8& Tag() const;
+    
+    /**
+     * Update the layout of all children. Subclasses can call this to
+     * recalculate the layout of all children.
+     *
+     * @param aTransitionTime  Time for layout transition in milliseconds.
+     *                         Any negative value uses value given in 
+     *                         CAlfEnv::StaticSetLayoutTransitionTime()
+     */
+    IMPORT_C virtual void UpdateChildrenLayout(TInt aTransitionTime = 0);
+    
+    /**
+     * Calculates the visual's bounding rectangle in display coordinates.
+     * Display coordinates are defined relative to the display's visible area.
+     * Uses the target values of the position and size, which means transitions
+     * are always immediate in the returned rectangle.
+     *
+     * @return Rectange.
+     */
+    IMPORT_C TAlfRealRect DisplayRectTarget() const;
+    
+    /**
+     * Convert local coordiantes to display coordinates.
+     * Display coordinates are defined relative to the display's visible area.
+     *
+     * @return Converted point.
+     */
+    IMPORT_C TPoint LocalToDisplay(const TPoint& aPoint) const;
+    
+    /**
+     * Convert local coordinates to display coordinates.
+     * Display coordinates are defined relative to the display's visible area.
+     *
+     * @param aPoint  Point in local coordinates.
+     * @return  Point in display coordinates.
+     */
+    IMPORT_C TAlfRealPoint LocalToDisplay(const TAlfRealPoint& aPoint) const;
+    
+    /*
+     * Convert display coordinates to local coordinates.
+     * Display coordinates are defined relative to the display's visible area.
+     *
+     * @param aPoint  Point in display coordinates.
+     * @return  Point in local coordinates.
+     */
+    IMPORT_C TPoint DisplayToLocal(const TPoint& aPoint) const;
+    
+    /**
+     * Convert display coordinates to local coordinate.
+     * Display coordinates are defined relative to the display's visible area.
+     *
+     * @param aPoint  Point in display coordinates.
+     * @return  Point in local coordinates.
+     */
+    IMPORT_C TAlfRealPoint DisplayToLocal(const TAlfRealPoint& aPoint) const;
+    
+    /**
+     * Enables or disables brushes for the visual.
+     */
+    IMPORT_C void EnableBrushesL(TBool aEnabled = ETrue);
+    
+    /**
+     * Returns the brushes of the visual.
+     *
+     * @return  Brush array. <code>NULL</code>, if not enabled.
+     */
+    IMPORT_C CAlfBrushArray* Brushes();
+  
+    /**
+     * Moves the visual to the front inside its parent layout. 
+     * In other words, the visual becames the last child of the parent.
+     * Causes layout recalculation.
+     */
+    IMPORT_C void MoveToFront(TInt aTransitionTime = 0);
+    
+    /**
+     * Enables or disables transformation of the control group.
+     *
+     * @param aIsTransformed ETrue for enabling.
+     */
+    IMPORT_C void EnableTransformationL( TBool aIsTransformed = ETrue );
+    
+    /**
+     * Returns the transformation of the control group.
+     *
+     * @return  Transformation steps.
+     */
+    IMPORT_C CAlfTransformation& Transformation();
+    
+    /**
+     * Sets the number of pixels that the visual uses for padding its contents.
+     * Sets both the horizontal and vertical padding.
+     *
+     * @note that the left and right paddings will be the same, and the top and bottom
+     *      paddings will be the same.
+     * @deprecated migrate to using metrics instead
+     *
+     * @param aPadding  Number of padding pixels.
+     */
+    IMPORT_C void SetPadding(TInt aPadding);
+
+    /**
+     * Sets the number of pixels that the visual uses for padding its contents.
+     * Sets the horizontal and vertical padding separately.
+     *
+     * @note that the left and right paddings will be the same, and the top and bottom
+     *      paddings will be the same.
+     * @deprecated migrate to using metrics instead
+     *
+     * @param aPadding  Number of padding pixels.
+     */
+    IMPORT_C void SetPadding(const TPoint& aPadding);
+
+    /**
+     * Sets the amount of padding that the visual uses for padding its contents.
+     * The box metric can have a different amount on all sides.
+     *
+     * @note as paddings are relative to the layout visual, if relative units are required, 
+     * it is advisable to use EAlfUnitRelativeToMySize so that the paddings are relative
+     * to the size of this layout visual
+     *
+     * @param aPadding  Amount of padding.
+     */
+    IMPORT_C void SetPadding(const TAlfBoxMetric& aPadding);
+
+    /**
+     * Returns the padding of the visual, in pixels.
+     *
+     * @return  Padding, in pixels. iTl.iX is the left padding, iTl.iY is 
+     *          the top padding, iBr.iX is the right padding, and iBr.iY
+     *          is the bottom padding. The width and height of the returned 
+     *          rectangle are meaningless.
+     */
+    IMPORT_C TAlfRealRect PaddingInPixels() const;
+
+    /**
+     * Sets the tag of the visual.
+     *
+     * The tag is a descriptor, in the form of one or more colon-separated
+     * character sequences. By default, visuals have no tag (""). Normally,
+     * a visual could have a single tag, for example ("caption").
+     * The tag descriptor of the visual may contain multiple tags,
+     * for example: "tag1:tag2:tag3".
+     *
+     * Tags can be used for identifying visuals. In a typical use case, a control
+     * could identify which of its visuals represent certain elements of the
+     * control based on the tag descriptors. In this case, the tags would be
+     * set by an outside party that also sets the tags of the visuals.
+     *
+     * @param aTag  Tag descriptor for the visual.
+     *
+     * @see CAlfVisual::Tag()
+     * @see CAlfVisual::IsTagged()
+     * @see CAlfVisual::FindTag()
+     */
+    IMPORT_C void SetTagL(const TDesC8& aTag);
+
+    /**
+     * Determines if the visual has a tag.
+     *
+     * @return  <code>ETrue</code>, if the visual has been tagged with SetTagL().
+     *          <code>EFalse</code> otherwise.
+     *
+     * @see CAlfVisual::Tag()
+     * @see CAlfVisual::SetTagL()
+     * @see CAlfVisual::FindTag()
+     */
+    IMPORT_C TBool IsTagged() const;
+
+    /**
+     * Finds a visual whose tag descriptor contains a specific tag.
+     *
+     * CAlfVisual::FindTag() is the basic implementation that checks if
+     * this visual's tag matches the specified tag. CAlfLayout::FindTag()
+     * extends the search into child visuals, covering recursively entire
+     * visual hierarchies.
+     *
+     * @param aTag  Tag to look for. If this tag is found as a part of a
+     *              visual's colon-separated tag descriptor, it is treated
+     *              as a match and the visual is returned. The tag to look
+     *              for cannot contain separator characters (:).
+     *
+     * @return  Visual whose tag descriptor matches the tag. <code>NULL</code>,
+     *          if no such visual could be found. 
+     *
+     * Todo: how should several visuals with matching tag to be handled ??
+     *
+     * @see CAlfVisual::Tag()
+     * @see CAlfVisual::SetTagL()
+     * @see CAlfVisual::IsTagged()
+     * @see CAlfLayout::FindTag()
+     */
+    IMPORT_C virtual CAlfVisual* FindTag(const TDesC8& aTag);
+
+    /**
+     * Construct a visual.
+     *
+     * @todo This method is probably to allow extended visual types to be created.
+     *
+     * @param aOwner Who owns this new control.
+     */
+    IMPORT_C void ConstructL(CAlfControl& aOwner, TInt aImplementationId, TInt aImplementationUid, const TDesC8& aConstructionParams );
+
+    IMPORT_C CAlfGenComponent* Comms() const;
+
+    
+    /**
+     * Gets the depth offset.
+     *
+     * @return Depth offset.
+     */
+    IMPORT_C TAlfTimedValue DepthOffset() const;
+
+    /**
+     * Sets the depth offset.
+     *
+     * @param aDepthOffset Depth offset.
+     */
+    IMPORT_C void SetDepthOffset(const TAlfTimedValue& aDepthOffset);
+
+    /**
+     * Returns the owner of the visual.
+     */
+    IMPORT_C CAlfControl& Owner() const;
+
+    /**
+     * Sets the owner of the visual.
+     *
+     * @param aOwner  New owner of the visual.
+     */
+    IMPORT_C void SetOwner(CAlfControl& aOwner);
+
+    /**
+     * Sets the origin of the visual. The origin defines the location of the
+     * visual's position in relation to its DisplayRect. By default the visual's
+     * position defines its top left corner.
+     *
+     * Calling this method is equivalent to setting/clearing the corresponding
+     * flags.
+     */
+    IMPORT_C void SetOrigin(TAlfVisualHOrigin aHoriz, TAlfVisualVOrigin aVert);
+
+    /**
+     * Determines the horizontal origin.
+     */
+    IMPORT_C TAlfVisualHOrigin HorizontalOrigin() const;
+
+    /**
+     * Determines the vertical origin.
+     */
+    IMPORT_C TAlfVisualVOrigin VerticalOrigin() const;
+
+    /**
+     * Aligns the rectangle using the visual's origin position.
+     *
+     * @param aRect  A rectangle (origin at top left). Modified to suit the
+     *               visual's origin.
+     */
+    IMPORT_C void AlignByOrigin(TAlfRealRect& aRect) const;
+
+    /**
+     * @deprecated  Use base unit version instead
+     *
+     * Sets the minimum size of the visual.
+     *
+     * @param aMinSize  Minimum size of the visual.
+     */
+    IMPORT_C void SetMinSize(const TSize& aMinSize);
+
+    /**
+     * Sets the minimum size of the visual.
+     *
+     * @param aMinSize  Minimum size of the visual in base units.
+     */
+    IMPORT_C void SetMinSize(const TAlfRealSize& aMinSize);
+
+    /**
+     * @deprecated  Use base unit version instead
+     *
+     * Returns the minimum size of the visual.
+     */
+    IMPORT_C TSize MinSize() const;
+
+    /**
+     * Returns the minimum size of the visual in base units.
+     */
+    IMPORT_C TAlfRealSize MinSizeInBaseUnits() const;
+
+    /**
+     * @deprecated  Use base unit version instead
+     *
+     * Sets the maximum size of the visual.
+     *
+     * @param aMaxSize  Maximum size of the visual.
+     */
+    IMPORT_C void SetMaxSize(const TSize& aMaxSize);
+
+    /**
+     * Sets the maximum size of the visual.
+     *
+     * @param aMaxSize  Maximum size of the visual.
+     */
+    IMPORT_C void SetMaxSize(const TAlfRealSize& aMaxSize);
+
+    /**
+     * @deprecated  Use base unit version instead
+     *
+     * Returns the maximum size of the visual.
+     */
+    IMPORT_C TSize MaxSize() const;
+
+    /**
+     * Returns the maximum size of the visual in base units.
+     */
+    IMPORT_C TAlfRealSize MaxSizeInBaseUnits() const;
+
+    /**
+     * Sets the position and size of the visual.
+     *
+     * @param aRect            Target rectangle.
+     * @param aTransitionTime  Transition timein milliseconds.
+     */
+    IMPORT_C void SetRect(const TAlfRealRect& aRect, TInt aTransitionTime = 0);
+
+    /**
+     * @deprecated  Use base unit version instead
+     *
+     * Moves the visual's position.
+     *
+     * @param aOffset          Offset from the current target.
+     * @param aTransitionTime  Transition time in milliseconds.
+     */
+    IMPORT_C void Move(const TPoint& aOffset, TInt aTransitionTime = 0);
+
+    /**
+     * Moves the visual's position.
+     *
+     * @param aOffset          Offset from the current target in base units.
+     * @param aTransitionTime  Transition time in milliseconds.
+     */
+    IMPORT_C void Move(const TAlfRealPoint& aOffset, TInt aTransitionTime = 0);
+
+    /**
+     * Positions and sizes this visual to match another.
+     *
+     * @param aVisual  Visual whose position and size to copy.
+     */
+    IMPORT_C void Mimic(CAlfVisual& aVisual, TInt aTransitionTime = 0);
+
+    /**
+     * @deprecated  Use base unit version instead
+     *
+     * Sets the position and size of the visual.
+     *
+     * @param aCenterPoint     New center point of the visual.
+     * @param aSize            New size of the visual.
+     * @param aTransitionTime  Number of milliseconds for transitioning to new values.
+     */
+    IMPORT_C void SetCenteredPosAndSize(const TPoint& aCenterPoint,
+                                        const TSize& aSize,
+                                        TInt aTransitionTime = 0);
+
+    /**
+     * Sets the position and size of the visual.
+     *
+     * @param aCenterPoint     New center point of the visual in base units.
+     * @param aSize            New size of the visual in base units.
+     * @param aTransitionTime  Number of milliseconds for transitioning to new values.
+     */
+    IMPORT_C void SetCenteredPosAndSize(const TAlfRealPoint& aCenterPoint,
+                                        const TAlfRealSize& aSize,
+                                        TInt aTransitionTime = 0);
+
+    /**
+     * Calculates the visual's bounding rectangle in display coordinates.
+     * Display coordinates are defined relative to the display's visible area.
+     * Uses the current values of the position and size. Only calculated once 
+     * per frame.
+     */
+    IMPORT_C TAlfRealRect DisplayRect() const;
+
+    /**
+     * Returns the opacity of the visual, taking into account the opacity
+     * of parent visuals.
+     *
+     * @return  Effective opacity level of the visual.
+     */
+    IMPORT_C TReal32 EffectiveOpacity() const __SOFTFP;
+
+    /**
+     * Sets the clipping mode of the layout.
+     *
+     * @param aClipping  <code>ETrue</code> to hide children that are outside
+     *                   the layout's real size.
+     */
+    IMPORT_C void SetClipping(TBool aClipping = ETrue);
+
+    /**
+     * Determines whether the visual is clipping its contents.
+     */
+    IMPORT_C TBool Clipping() const;
+
+    /**
+     * Returns the padding pixels. Visuals can use this to determine the
+     * amount of padding that should be applied to the content.
+     *
+     * @deprecated this will return correct pixel values only if paddings were set 
+     *      using deprecated pixel based APIs, so migrate to using metrics instead
+     *
+     * @return  Horizontal and vertical padding, in pixels.
+     */
+    IMPORT_C TPoint Padding() const;
+
+    /**
+     * Returns the padding of the visual.
+     *
+     * @return  Padding as a box metric.
+     */
+    IMPORT_C const TAlfBoxMetric& PaddingAsMetric() const;
+    
+    /**
+     * Returns the horizontal padding pixels. Visuals can use this to
+     * determine the amount of padding that should be applied to the content.
+     *
+     * @deprecated this will return correct pixel values only if paddings were set 
+     *      using deprecated pixel based APIs, so migrate to using metrics instead
+     *
+     * @return  Horizontal padding, in pixels.
+     */
+    IMPORT_C TInt HorizontalPadding() const;
+
+    /**
+     * Returns the vertical padding pixels. Visuals can use this to
+     * determine the amount of padding that should be applied to the content.
+     *
+     * @deprecated this will return correct pixel values only if paddings were set 
+     *      using deprecated pixel based APIs, so migrate to using metrics instead
+     *
+     * @return  Vertical padding, in pixels.
+     */
+    IMPORT_C TInt VerticalPadding() const;
+
+    /**
+     * Sets the position of the visual.
+     */
+    IMPORT_C void SetPos(const TAlfTimedPoint& aPos);
+
+    /**
+     * Sets the size of the visual.
+     */
+    IMPORT_C void SetSize(const TAlfTimedPoint& aSize);
+
+    /**
+    * Copies selected, basic types of properties from another visual
+    * If another visual is in the middle of interpolating selected value(s), target value is used
+    * with given transition time.
+    *
+    * For dynamic properties, use CAlfPropertyOwner::CopyProperty()
+    * 
+    * @param aSourceVisual   Visual, from which the values are copied
+    * @param aBitmask        Defines what properties to copy
+    * @param aTransitionTime Number of milliseconds for transitioning to new values.     
+    * 
+    * @return System wide error codes
+    */
+    IMPORT_C TInt CopyValues(const CAlfVisual& aSourceVisual, TInt aBitmask = AlfVisualProperties::EAll, TInt aTransitionTime = 0);
+
+    /**
+    * Pauses selected, basic types of timed properties of this visual
+    *
+    * @param aPropertiesBitmask   defines what properties are paused,  combination of AlfVisualProperties
+    */
+    IMPORT_C void Pause(TInt aPropertiesBitmask = AlfVisualProperties::EAll);
+
+    /**
+    * Resumes selected basic types of timed properties of this visual
+    * that were paused using CAlfVisual::Pause().
+    * If a property was not paused before calling Resume, call does not have effect
+    *
+    * @param aPropertiesBitmask   defines what properties are paused, combination of AlfVisualProperties
+    */
+    IMPORT_C void Resume(TInt aPropertiesBitmask = AlfVisualProperties::EAll);
+
+    // internal
+    TBool TagMatches(const TDesC8& aTag) const;
+    
+    /** ! Deletes the visual */
+    IMPORT_C virtual void DoRemoveAndDestroyAllD();
+    
+    
+    /**
+     * Sets an automatic tactile feedback. If this visual is a layout,
+     * the feedback affects to the child visuals as well. This can 
+     * be overridden in child visuals.
+     * 
+     * @param aEventType Event which triggers the automatic feedback.
+     * @param aFeedbackType Feedback type.
+     *
+     * @see TTouchEventType from touchlogicalfeedback.h
+     * @see TTouchLogicalFeedback from touchlogicalfeedback.h
+     */
+    IMPORT_C void SetTactileFeedbackL( TInt aEventType, TInt aFeedbackType );
+        
+    /**
+     * Checks whether a tactile feedback has been assigned.
+     * Eventhough, this returns EFalse the layout may have feedback defined.
+     * @param aEventType Event type which needs to match
+     *        If KAlfTactileFeedbackEventTypeNone, the event type is irrelevant.
+     * 
+     * @return ETrue if the visual has a tactile feedback defined.
+     */
+    IMPORT_C TBool HasTactileFeedback( 
+        TInt aEventType = KAlfTactileFeedbackEventTypeNone ) const;
+       
+    /**
+     * Removes tactile feedback for the visual.
+     * 
+     * @param aEventType Event type which feedback to remove.
+     *        If KAlfTactileFeedbackEventTypeNone, all the feedbacks are removed.
+     */
+    IMPORT_C void RemoveTactileFeedback( TInt aEventType = KAlfTactileFeedbackEventTypeNone );
+    
+    /**
+     * Enables the drop shadow. Currently implemented for the image and text visuals.
+     * 
+     * @param aEnable ETrue to enable, EFalse to disable.
+     */
+    IMPORT_C void EnableDropShadowL( TBool aEnable = ETrue );
+    
+    /**
+     * Returns the drop shadow parameter handler.
+     *
+     * @return Drop shadow handler. NULL if drop shadow is disabled.
+     */
+    IMPORT_C CAlfDropShadow* DropShadowHandler() const;
+    IMPORT_C void CAlfVisual::SetEffectL( const TDesC& aEffectFile );
+    IMPORT_C void CAlfVisual::SetGroupEffectL( const TDesC& aEffectFile, TInt aGroupHandle );
+
+protected:
+
+    /** ! future proofing */
+    IMPORT_C void PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+
+private:
+
+    // Private data. Own. 
+    struct TPrivateData;
+    TPrivateData* iData;
+
+    };
+
+
+#endif // C_ALFVISUAL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/alf/alfvisualfactory.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Factory for visuals and layouts.
+*
+*/
+
+
+
+#ifndef ALFVISUALFACTORY_H
+#define ALFVISUALFACTORY_H
+
+#include <alf/alfvisual.h>
+#include <alf/alflayout.h>
+
+class CAlfEnv;
+
+/**
+ *  Factory for visuals and layouts.
+ *
+ *  This factory object is meant to be used by toolkit extensions only. It is recommended
+ *  to use the AddNewL() - method of the visual or layout itself. You can also use
+ *  CAlfControl::AppendVisualL() or CAlfControl::AppendLayoutL() - methods.
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( AlfVisualFactory )
+	{
+public:
+
+	/**
+	 * Creates a new layout visual.
+	 *
+	 * CAlfControl::Append() - method has to be explicitly called after this method
+	 * has been called to complete the control's ownership of the created layout. After this
+	 * method returns the CAlfVisual::Owner() of the created layout will point
+	 * to the owner control passed as the parameter, but the layout has not yet been
+	 * added to the visual array of the control.
+	 *
+	 * @param aLayoutType  Type of the layout.
+	 * @param aOwner Owner control
+	 * @param aEnv The environment.
+	 * @leave KErrNotFound  The layout type was not registered.
+	 */
+	IMPORT_C static CAlfLayout* NewLayoutL(
+	    TAlfLayoutType aLayoutType,
+	    CAlfLayout* aParentLayout,
+	    CAlfControl& aOwner,
+	    CAlfEnv& aEnv,
+	    TInt aImplementationUid = 0);
+	
+	/**
+	 * Creates a new layout visual, leaving it on the cleanup stack.
+	 *
+	 * CAlfControl::Append() - method has to be explicitly called after this method
+	 * has been called to complete the control's ownership of the created layout. After this
+	 * method returns the CAlfVisual::Owner() of the created layout will point
+	 * to the owner control passed as the parameter, but the layout has not yet been
+	 * added to the visual array of the control.
+	 *
+	 * @param aLayoutType  Type of the layout.
+	 * @param aOwner Owner control
+	 * @param aEnv The environment.
+	 * @leave KErrNotFound  The layout type was not registered.
+	 */
+	IMPORT_C static CAlfLayout* NewLayoutLC(TAlfLayoutType aLayoutType,
+                                	    CAlfLayout* aParentLayout,
+	                                    CAlfControl& aOwner,
+	                                    CAlfEnv& aEnv,
+	                                    TInt aImplementationUid = 0);
+	                                 
+	/**
+	 * Creates a new visual.
+	 *
+	 * CAlfControl::Append() - method has to be explicitly called after this method
+	 * has been called to complete the control's ownership of the created visual. After this
+	 * method returns the CAlfVisual::Owner() of the created visual will point
+	 * to the owner control passed as the parameter, but the visual has not yet been
+	 * added to the visual array of the control.
+	 *
+	 * @param aVisualType  Type of the visual.
+	 * @param aOwner Owner control
+	 * @param aEnv The environment.
+	 * @leave KErrNotFound  The visual type was not registered.
+	 */
+    IMPORT_C static CAlfVisual* NewVisualL( TAlfVisualType aVisualType,
+                                    	    CAlfLayout* aParentLayout,
+	                                        CAlfControl& aOwner,
+	                                        CAlfEnv& aEnv,
+	                                        TInt aImplementationUid = 0);
+                                    
+	/**
+	 * Creates a new visual, leaving it on the cleanup stack.
+	 *
+	 * CAlfControl::Append() - method has to be explicitly called after this method
+	 * has been called to complete the control's ownership of the created visual. After this
+	 * method returns the CAlfVisual::Owner() of the created visual will point
+	 * to the owner control passed as the parameter, but the visual has not yet been
+	 * added to the visual array of the control.
+	 *
+	 * @param aVisualType  Type of the visual.
+	 * @param aOwner Owner control
+	 * @param aEnv The environment.
+	 * @leave KErrNotFound  The visual type was not registered.
+	 */
+    IMPORT_C static CAlfVisual* NewVisualLC(TAlfVisualType aVisualType,
+                                    	    CAlfLayout* aParentLayout,
+	                                        CAlfControl& aOwner,
+	                                        CAlfEnv& aEnv,
+	                                        TInt aImplementationUid = 0);
+
+	};
+
+#endif  // ALFVISUALFACTORY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/goommonitor/goommonitor.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* 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:  Main functionality for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMMONITOR_H
+#define GOOMMONITOR_H
+
+#include <e32std.h>
+
+/**
+ * Creates thread for Graphics OOM (Out Of Memory) watchers.
+ * Called by the server in which the GOOM Monitor runs.
+ *
+ * @lib goommonitor.lib
+ */
+IMPORT_C void CreateGOOMWatcherThreadL();
+
+#endif // GOOMMONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/goommonitor/goommonitorplugin.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,191 @@
+/*
+* 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:  Main functionality for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMMONITORPLUGIN_H
+#define GOOMMONITORPLUGIN_H
+
+#include <e32base.h>
+
+class CMemoryMonitor;
+class RFs;
+class RWsSession;
+
+
+/**
+* Panic codes with category "OomMonitorPlugin"
+*/
+enum TGOomMonitorPluginPanic
+    {
+    /**
+    * The plugin has been constructed by a thread other than the GOOM monitor.
+    */
+    EGOomMonitorPluginPanic_PluginConstructedOutsideGOomMonitorThread
+    };
+
+// Message type used to signal an GOOM plug-in to free some memory.
+const TInt KAppGOomMonitor_FreeRam = 0x10282304;
+
+// Message type used to signal an OOM plug-in that there is free memory again.
+const TInt KAppGOomMonitor_MemoryGood = 0x10282305;
+
+class CGOomMonitorPluginBase : public CBase
+	{
+public:
+	/**
+	* Constructor
+	* Plugins should assume that the system memory is good when
+	* they are created.
+	*/
+	IMPORT_C CGOomMonitorPluginBase();
+	/**
+	* Destructor
+	*/
+	IMPORT_C ~CGOomMonitorPluginBase();
+	/**
+	* 2nd stage constructor
+	*/
+	IMPORT_C void ConstructL();
+
+public:
+	/**
+	* FreeRam is called when the system RAM level becomes
+	* low. This plugin is requested to help free some RAM.
+	*/
+	virtual void FreeRam(TInt aBytesToFree) = 0;
+
+	/**
+	* MemoryGood is called when the system RAM level becomes
+	* good after being low.The plugin may take this opportunity
+	* to start using RAM again.
+	* Nb It is assumed that the plugin will not immediately
+	* cause a large increase in memory use, but that memory may be
+	* used over time, otherwise the plugin may cause oscillation
+	* between low and good memory states.
+	*/
+	virtual void MemoryGood() = 0;
+
+public:
+    /**
+    * Get a handle to the file server.
+    * @return a connected file server session.
+    */
+    IMPORT_C RFs& FsSession();
+    /**
+    * Get a handle to the window server.
+    * @return a connected window server session.
+    */
+    IMPORT_C RWsSession& WsSession();
+
+	IMPORT_C virtual void ExtensionInterface(TUid aInterfaceId, TAny*& aImplementaion);
+
+private:
+	CMemoryMonitor* iMemoryMonitor;
+	};
+
+
+class CGOomMonitorPlugin : public CGOomMonitorPluginBase
+	{
+public:	// new functions
+
+	CGOomMonitorPlugin():CGOomMonitorPluginBase(){}    
+
+public:	// From CGOomMonitorPluginBase
+	/**
+	* FreeRam is called when the system graphics memory level becomes
+	* low. This plugin is requested to help free some RAM.
+	*
+	* this version of the function should not need to be implemented.
+	* The definition of this function should change once the alf plugin is stable and finetuned
+    * @param aBytesToFree The minimum number of bytes of free memory that the plugin should try to free.
+	*/
+
+    virtual void FreeRam(TInt aBytesToFree) = 0;
+
+	/**
+	* MemoryGood is called when the system RAM level becomes
+	* good after being low.The plugin may take this opportunity
+	* to start using RAM again.
+	* Nb It is assumed that the plugin will not immediately
+	* cause a large increase in memory use, but that memory may be
+	* used over time, otherwise the plugin may cause oscillation
+	* between low and good memory states.
+	*/
+	virtual void MemoryGood() = 0;
+	};
+
+
+
+/**
+* CAppOomMonitorPlugin is a specialised OOM monitor plugin
+* that sends messages to applications when the memory state
+* changes.
+* The target application is specified by the appUid parameter.
+* the message will be sent to all running instances of this app.
+* The messages are:
+* KAppOomMonitor_FreeRam when memory should be released.
+* KAppOomMonitor_MemoryGood when memory is good again.
+*
+* These messages can be picked up in the app UI like this:
+* void CMyAppUi::HandleApplicationSpecificEventL(TInt aType, const TWsEvent& aEvent)
+*     {
+*     CAknAppUi::HandleApplicationSpecificEventL(aType, aEvent);
+*     if (aType == KAppOomMonitor_FreeRam)
+*         {
+*         // release memory and disable memory use
+*         }
+*     else if (aType == KAppOomMonitor_MemoryGood)
+*         {
+*         // re-enable memory use
+*         }
+*     }
+*
+* The plugin can be instantiated in an ECom factory function.
+* The application does not need to derive from this class.
+* For example:
+* TAny* CreateAppPlugin()
+*     {
+*     return CAppOomMonitorPlugin::NewL(KMyAppUid);
+*     }
+*/
+NONSHARABLE_CLASS(CAppGOomMonitorPlugin) : public CGOomMonitorPluginBase
+    {
+public:
+    IMPORT_C static CAppGOomMonitorPlugin* NewL(TUid aAppUid);
+
+private:
+	CAppGOomMonitorPlugin(TUid aAppUid);
+
+	void FreeRam(TInt aFreeMemory);
+	void MemoryGood();
+
+    void SendMessageToApp(TInt aMessage);
+
+private:
+    TUid iAppUid;
+    };
+
+
+/**
+* Sets the CMemoryMonitor object for this DLL.
+* Only for use by CMemoryMonitor.
+* @internal
+*/
+IMPORT_C void SetGMemoryMonitorTls(CMemoryMonitor* aMonitor);
+
+
+#endif // OOMMONITORPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/goommonitor/goommonitorplugin.hrh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* 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: UID definition for GOOM Monitor plug-ins.
+*
+*/
+
+
+#ifndef GOOMMONITORPLUGIN_HRH
+#define GOOMMONITORPLUGIN_HRH
+
+#define KGOomPluginInterfaceUidValue 0x20026790
+#define KGOomPluginInterfaceUid (TUid::Uid(KGOomPluginInterfaceUidValue))
+
+// Extension interface "uids"
+#define KGoomClientSecureId     0x1000
+
+#endif // GOOMMONITORPLUGIN_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/inc/goommonitor/goommonitorsession.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,179 @@
+/*
+* 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:  Client/server interface for GOOM Monitor.
+*
+*/
+
+
+#ifndef R_GOOMMONITORSESSION_H
+#define R_GOOMMONITORSESSION_H
+
+#include <e32std.h>
+
+/**
+ *  The maximum amount of memory that can be allocated without permission.
+ */
+const TInt KGOomMaxAllocationWithoutPermission = 1048576;
+
+/**
+ *  The client interface for GOOM (Out Of Memory) monitor.
+ *
+ *  @lib oommonitor.lib
+ */
+class RGOomMonitorSession : public RSessionBase
+    {
+public:
+
+    /**  Defines the application priorities of GOOM monitor. */
+    enum TGOomPriority
+        {
+        /**
+        * Application can be closed if needed.
+        */
+        EGOomPriorityNormal = 0,
+
+        /**
+        * Application should not be closed if possible.
+        */
+        EGOomPriorityHigh,
+
+        /**
+        * Application is busy and should not be closed.
+        */
+        EGOomPriorityBusy
+        };
+
+public:
+    /**
+    * Connects a new session.
+    * Sessions must be connected before any other APIs can be used.
+    * When the client has finished using a session, Close() must be called.
+    * @return KErrNone if successful, error code otherwise.
+    */
+    IMPORT_C TInt Connect();
+
+    /**
+    * Tells whether Goom FW is really present and connected
+    * In some platforms, there's no need for GOOM to run
+    * and all operations do just nothing 
+    */
+    IMPORT_C TBool IsConnected();
+
+    /**
+    * Request that the GOOM monitor attempts to free some memory.
+    * This function may take several seconds to execute, depending on
+    * the memory state. It will not return until the attempt to recover
+    * memory has completed.
+    * @param aBytesRequested The number of bytes of free memory that the client requests.
+    * @return KErrNone if the request memory is free. KErrNoMemory if that
+    *         amount of memory could not be recovered.
+    */
+    IMPORT_C TInt RequestFreeMemory(TInt aBytesRequested);
+
+    /**
+    * Request that the GOOM monitor attempts to free some memory.
+    * This is an asynchronous version of the request for free memory.
+    * @param aBytesRequested The number of bytes of free memory that the client requests.
+    * @param aStatus will be completed when the attempt to recover memory
+    *        has finished. This may take several seconds, depending on
+    *        the memory state. On completion, aStatus will be set to
+    *        KErrNone if the request memory is free. KErrNoMemory if that
+    *        amount of memory could not be recovered.
+    */
+    IMPORT_C void RequestFreeMemory(TInt aBytesRequested, TRequestStatus& aStatus);
+
+    /**
+    * Request that the GOOM monitor attempts to free some memory for an optional allocation.
+    * The passed in plugin ID is used to determine the priority for this allocation.
+    * Lower priority OOM actions may be executed to free enough RAM for this allocation.
+    * This function may take several seconds to execute, depending on
+    * the memory state. It will not return until the attempt to recover
+    * memory has completed.
+    * @param aBytesRequested The number of bytes of free memory that the client requests.
+    * @param aPluginId The ID of the plugin that may delete the allocation in event of low memory.
+    * @return KErrNone if the request memory is free. KErrNoMemory if that
+    *         amount of memory could not be recovered.  
+    */
+    IMPORT_C TInt RequestOptionalRam(TInt aBytesRequested, TInt aMinimumBytesNeeded, TInt aPluginId, TInt& aBytesAvailable);
+
+    /**
+    * Request that the GOOM monitor attempts to free some memory for an optional allocation.
+    * The passed in plugin ID is used to determine the priority for this allocation.
+    * Lower priority OOM actions may be executed to free enough RAM for this allocation.
+    * This function may take several seconds to execute, depending on
+    * the memory state. It will not return until the attempt to recover
+    * memory has completed.
+    * @param aBytesRequested The number of bytes of free memory that the client requests.
+    * @param aPluginId The ID of the plugin that may delete the allocation in event of low memory.
+    * @param aStatus The TRequestStatus (completes with the number of bytes freed (aStatus >= 0) or an error (aStatus <= 0))
+    * @return None
+    */
+    IMPORT_C void RequestOptionalRam(TInt aBytesRequested, TInt aMinimumBytesNeeded, TInt aPluginId, TRequestStatus& aStatus);
+
+    /**
+    * Cancels the asynchronous request for free memory.
+    */
+    IMPORT_C void CancelRequestFreeMemory();
+
+    /**
+    * Notify the GOOM monitor that this application is not responding
+    * to the EEikCmdExit request to exit the application.
+    * This function is used by the Avkon framework's app shutter.
+    * @param aWgId the window group identifier of the app that is not exiting.
+    */
+    IMPORT_C void ThisAppIsNotExiting(TInt aWgId);
+
+    /**
+    * Notify the GOOM monitor that this application has the specified priority
+    * @param aPriority the priority of the application
+    */
+    IMPORT_C void SetGOomPriority(TGOomPriority aPriority);
+
+    /**
+    * Notify the GOOM monitor that this application about to laucnh
+    * effectively set the application specific threshold if found from 
+    * config file
+    * @param aAppUid the identifier of the application
+    */
+    IMPORT_C void ApplicationAboutToStart(const TUid& aAppUid);
+
+    /**
+    * Tell goom that number requested by application should be used as such
+    * and not combined with currently active global threshold
+    * @param aUseAbsoluteAmount whtether global thresholds are combined with targets
+    */
+    IMPORT_C void UsesAbsoluteMemTargets(TBool aUseAbsoluteAmount = ETrue);
+
+    /**
+    * Asynchronous version of Connect.
+    * @param aStatus request status, completed later only 
+    *        if return value equals to KErrNone.
+    * @return error code, KErrNone if connection started.
+    */
+    IMPORT_C TInt Connect(TRequestStatus& aStatus);
+
+    /**
+    * Asynchronous version of AppAboutToStart.
+    * @param aStatus request status.
+    * @param aAppUid application UID being started.
+    */
+    IMPORT_C void AppAboutToStart(TRequestStatus& aStatus, const TUid& aAppUid);
+
+private://data 
+    TInt iFlags;
+    };
+    
+    
+
+#endif // R_GOOMMONITORSESSION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/data/alfbatchextplugin.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource definitions for project alfbatchextplugin
+*
+*/
+
+
+#include <RegistryInfo.rh>
+#include <alf/alfred.hrh>
+
+RESOURCE REGISTRY_INFO theInfo
+{
+    dll_uid = 0x0DDDDDDD;
+    interfaces =
+    {
+    INTERFACE_INFO
+        {
+        interface_uid = K_ALF_FACTORY_INTERFACE;
+        implementations =
+            {
+            IMPLEMENTATION_INFO
+                {
+                implementation_uid = 0x0DDDDDDE;
+                version_no = 1;
+                display_name = "alf cmd batch ext";
+                default_data = "";
+                opaque_data	 = "0";
+                }
+            };
+        }
+    };
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/group/alfbatchextplugin.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+
+TARGET          alfbatchextplugin.dll
+TARGETTYPE      PLUGIN
+UID             0x10009d8d 0x0DDDDDDD
+
+CAPABILITY      CAP_ECOM_PLUGIN
+VENDORID        VID_DEFAULT
+
+USERINCLUDE     ../inc
+USERINCLUDE     .
+
+#ifdef RD_ALF_IN_PLATFORM
+#include <platform_paths.hrh>
+MW_LAYER_SYSTEMINCLUDE
+#else
+SYSTEMINCLUDE   /epoc32/include
+#endif
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+SOURCEPATH      ../data
+START RESOURCE  alfbatchextplugin.rss
+END
+
+SOURCEPATH      ../src
+SOURCE          alfbatchextplugin.cpp
+
+LIBRARY         ECOM.LIB
+LIBRARY         euser.lib
+LIBRARY         alfappservercore.lib
+LIBRARY         apparc.lib
+LIBRARY         avkon.lib 
+LIBRARY         eikcore.lib 
+LIBRARY         cone.lib
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  build info file
+*
+*/
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+
+
+PRJ_EXPORTS
+
+
+PRJ_TESTMMPFILES
+testplatalfvisual.mmp
+alfbatchextplugin.mmp
+
+PRJ_MMPFILES
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/group/testplatalfvisual.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,109 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  mmp file
+*
+*/
+
+
+#include <data_caging_paths.hrh> 
+#include <platform_paths.hrh>
+
+TARGET          testplatalfvisual.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x2001CB80
+
+CAPABILITY      ALL -TCB
+
+DEFFILE         testplatalfvisual.def
+
+USERINCLUDE     ../inc 
+
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH      ../src
+
+SOURCE          testplatalfvisual.cpp
+SOURCE          testplatalfvisualblocks.cpp
+SOURCE          testplatalfvisualblocksvisual.cpp
+SOURCE          testplatalfvisualblocksanchorlayout.cpp
+SOURCE          testplatalfvisualblocksbatchbuffer.cpp
+SOURCE          testplatalfvisualblocksborderbrush.cpp
+SOURCE          testplatalfvisualblocksvisualfactory.cpp
+SOURCE          testplatalfvisualblockscontrol.cpp
+SOURCE          testplatalfvisualblockscontrolgroup.cpp
+SOURCE          testplatalfvisualblocksviewportlayout.cpp
+SOURCE          testplatalfvisualblockscurvepath.cpp
+SOURCE          testplatalfvisualblocksutil.cpp
+SOURCE          testplatalfvisualblockscurvepathlayout.cpp
+SOURCE          testplatalfvisualblocksdecklayout.cpp
+SOURCE          testplatalfvisualblocksdisplay.cpp
+SOURCE          testplatalfvisualblocksdisplaybackgrounditem.cpp
+SOURCE          testplatalfvisualblocksdropshadow.cpp
+SOURCE          testplatalfvisualblocksdropshadowbrush.cpp
+SOURCE          testplatalfvisualblocksenv.cpp
+SOURCE          testplatalfvisualblockstransformation.cpp
+SOURCE          testplatalfvisualblockstimedvalue.cpp
+SOURCE          testplatalfvisualblocksevent.cpp
+SOURCE          testplatalfvisualblocksflowlayout.cpp
+SOURCE          testplatalfvisualblocksframebrush.cpp
+SOURCE          testplatalfvisualblocksimage.cpp
+SOURCE          testplatalfvisualblocksgencomponent.cpp
+SOURCE          testplatalfvisualblockstextvisual.cpp
+SOURCE          testplatalfvisualblocksgradientbrush.cpp
+SOURCE          testplatalfvisualblocksgridlayout.cpp
+SOURCE          testplatalfvisualblockstextureprocessor.cpp
+SOURCE          testplatalfvisualblocksimagebrush.cpp
+SOURCE          testplatalfvisualblocksimageloaderutil.cpp
+SOURCE          testplatalfvisualblocksimagevisual.cpp
+SOURCE          testplatalfvisualblockstexturegroup.cpp
+SOURCE          testplatalfvisualblockstexturemanager.cpp
+SOURCE          testplatalfvisualblockslayout.cpp
+SOURCE          testplatalfvisualblocksstatic.cpp
+SOURCE          testplatalfvisualblockssymbiansbdrawer.cpp
+SOURCE          testplatalfvisualblockstextstylemanager.cpp
+SOURCE          testplatalfvisualblockstextstyle.cpp
+SOURCE          testplatalfvisualblockstexture.cpp
+SOURCE          testplatalfvisualblockstextureautosizeparams.cpp
+SOURCE          testplatalfvisualblocksshadowborderbrush.cpp
+SOURCE          testplatalfvisualblockslinevisual.cpp
+SOURCE          testplatalfvisualblocksmeshvisual.cpp
+SOURCE          testplatalfvisualblockspropertyowner.cpp
+SOURCE          testplatalfvisualblocksroster.cpp
+SOURCE          testplatalfvisualblocksscreenbuffer.cpp
+SOURCE          testplatalfvisualblocksscrollerevent.cpp
+SOURCE          testplatalfvisualblocksmetric.cpp
+SOURCE          testplatalfvisualblocksproceduralmesh.cpp
+SOURCE          testplatalfvisualblocksmesh.cpp
+SOURCE          testplatalfvisualblocksmaterial.cpp
+SOURCE          testplatalfvisualblocksmappingfunctions.cpp
+SOURCE          testplatalfvisualblocksm3gmesh.cpp
+SOURCE          testplatalfvisualblockscommand.cpp
+SOURCE          testplatalfvisualblocksbrush.cpp
+SOURCE          testplatalfvisualblocksbrusharray.cpp
+
+
+LIBRARY         euser.lib
+LIBRARY         stiftestinterface.lib
+LIBRARY         stiftestengine.lib
+LIBRARY         alfclient.lib
+LIBRARY         eikcore.lib
+LIBRARY         cone.lib
+LIBRARY         fbscli.lib
+LIBRARY         gdi.lib
+LIBRARY         aknicon.lib
+LIBRARY         bitgdi.lib
+
+LANG            SC
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/group/testplatalfvisual.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,151 @@
+;
+; 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: 
+;
+; Languages
+&EN
+
+; Header
+#{"testplatalfvisual"}, (0x2001CB80), 1, 0, 0, TYPE=SA
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+
+;Copying ordinary file (not language dependent) to fixed drive drive.
+
+"..\init\testplatalfvisual.ini"-"c:\Testframework\testplatalfvisual.ini", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualvisual.cfg"-"c:\Testframework\tctestplatalfvisualvisual.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualvisual.cfg"-"c:\Testframework\ui_testplatalfvisualvisual.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualanchorlayout.cfg"-"c:\Testframework\tctestplatalfvisualanchorlayout.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualanchorlayout.cfg"-"c:\Testframework\ui_testplatalfvisualanchorlayout.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualbatchbuffer.cfg"-"c:\Testframework\tctestplatalfvisualbatchbuffer.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualbatchbuffer.cfg"-"c:\Testframework\ui_testplatalfvisualbatchbuffer.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualvisualfactory.cfg"-"c:\Testframework\tctestplatalfvisualvisualfactory.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualvisualfactory.cfg"-"c:\Testframework\ui_testplatalfvisualvisualfactory.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualborderbrush.cfg"-"c:\Testframework\tctestplatalfvisualborderbrush.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualborderbrush.cfg"-"c:\Testframework\ui_testplatalfvisualborderbrush.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualcontrol.cfg"-"c:\Testframework\tctestplatalfvisualcontrol.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualcontrol.cfg"-"c:\Testframework\ui_testplatalfvisualcontrol.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualcontrolgroup.cfg"-"c:\Testframework\tctestplatalfvisualcontrolgroup.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualcontrolgroup.cfg"-"c:\Testframework\ui_testplatalfvisualcontrolgroup.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualviewportlayout.cfg"-"c:\Testframework\tctestplatalfvisualviewportlayout.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualviewportlayout.cfg"-"c:\Testframework\ui_testplatalfvisualviewportlayout.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualcurvepath.cfg"-"c:\Testframework\tctestplatalfvisualcurvepath.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualcurvepath.cfg"-"c:\Testframework\ui_testplatalfvisualcurvepath.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualutil.cfg"-"c:\Testframework\tctestplatalfvisualutil.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualutil.cfg"-"c:\Testframework\ui_testplatalfvisualutil.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualcurvepathlayout.cfg"-"c:\Testframework\tctestplatalfvisualcurvepathlayout.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualcurvepathlayout.cfg"-"c:\Testframework\ui_testplatalfvisualcurvepathlayout.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualtransformation.cfg"-"c:\Testframework\tctestplatalfvisualtransformation.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualtransformation.cfg"-"c:\Testframework\ui_testplatalfvisualtransformation.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualtimedvalue.cfg"-"c:\Testframework\tctestplatalfvisualtimedvalue.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualtimedvalue.cfg"-"c:\Testframework\ui_testplatalfvisualtimedvalue.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualtextvisual.cfg"-"c:\Testframework\tctestplatalfvisualtextvisual.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualtextvisual.cfg"-"c:\Testframework\ui_testplatalfvisualtextvisual.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualtextureprocessor.cfg"-"c:\Testframework\tctestplatalfvisualtextureprocessor.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualtextureprocessor.cfg"-"c:\Testframework\ui_testplatalfvisualtextureprocessor.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualtexturegroup.cfg"-"c:\Testframework\tctestplatalfvisualtexturegroup.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualtexturegroup.cfg"-"c:\Testframework\ui_testplatalfvisualtexturegroup.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualtexturemanager.cfg"-"c:\Testframework\tctestplatalfvisualtexturemanager.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualtexturemanager.cfg"-"c:\Testframework\ui_testplatalfvisualtexturemanager.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualstatic.cfg"-"c:\Testframework\tctestplatalfvisualstatic.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualstatic.cfg"-"c:\Testframework\ui_testplatalfvisualstatic.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualsymbiansbdrawer.cfg"-"c:\Testframework\tctestplatalfvisualsymbiansbdrawer.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualsymbiansbdrawer.cfg"-"c:\Testframework\ui_testplatalfvisualsymbiansbdrawer.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualtextstylemanager.cfg"-"c:\Testframework\tctestplatalfvisualtextstylemanager.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualtextstylemanager.cfg"-"c:\Testframework\ui_testplatalfvisualtextstylemanager.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualtextstyle.cfg"-"c:\Testframework\tctestplatalfvisualtextstyle.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualtextstyle.cfg"-"c:\Testframework\ui_testplatalfvisualtextstyle.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualtexture.cfg"-"c:\Testframework\tctestplatalfvisualtexture.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualtexture.cfg"-"c:\Testframework\ui_testplatalfvisualtexture.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualtextureautosizeparams.cfg"-"c:\Testframework\tctestplatalfvisualtextureautosizeparams.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualtextureautosizeparams.cfg"-"c:\Testframework\ui_testplatalfvisualtextureautosizeparams.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualshadowborderbrush.cfg"-"c:\Testframework\tctestplatalfvisualshadowborderbrush.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualshadowborderbrush.cfg"-"c:\Testframework\ui_testplatalfvisualshadowborderbrush.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualpropertyowner.cfg"-"c:\Testframework\tctestplatalfvisualpropertyowner.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualpropertyowner.cfg"-"c:\Testframework\ui_testplatalfvisualpropertyowner.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualroster.cfg"-"c:\Testframework\tctestplatalfvisualroster.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualroster.cfg"-"c:\Testframework\ui_testplatalfvisualroster.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualscreenbuffer.cfg"-"c:\Testframework\tctestplatalfvisualscreenbuffer.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualscreenbuffer.cfg"-"c:\Testframework\ui_testplatalfvisualscreenbuffer.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualscrollerevent.cfg"-"c:\Testframework\tctestplatalfvisualscrollerevent.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualscrollerevent.cfg"-"c:\Testframework\ui_testplatalfvisualscrollerevent.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualdecklayout.cfg"-"c:\Testframework\tctestplatalfvisualdecklayout.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualdecklayout.cfg"-"c:\Testframework\ui_testplatalfvisualdecklayout.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualdisplay.cfg"-"c:\Testframework\tctestplatalfvisualdisplay.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualdisplay.cfg"-"c:\Testframework\ui_testplatalfvisualdisplay.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualdisplaybackgrounditem.cfg"-"c:\Testframework\tctestplatalfvisualdisplaybackgrounditem.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualdisplaybackgrounditem.cfg"-"c:\Testframework\ui_testplatalfvisualdisplaybackgrounditem.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualdropsshadow.cfg"-"c:\Testframework\tctestplatalfvisualdropsshadow.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualdropsshadow.cfg"-"c:\Testframework\ui_testplatalfvisualdropsshadow.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualdropsshadowbrush.cfg"-"c:\Testframework\tctestplatalfvisualdropsshadowbrush.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualdropsshadowbrush.cfg"-"c:\Testframework\ui_testplatalfvisualdropsshadowbrush.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualenv.cfg"-"c:\Testframework\tctestplatalfvisualenv.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualenv.cfg"-"c:\Testframework\ui_testplatalfvisualenv.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualevent.cfg"-"c:\Testframework\tctestplatalfvisualevent.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualevent.cfg"-"c:\Testframework\ui_testplatalfvisualevent.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualflowlayout.cfg"-"c:\Testframework\tctestplatalfvisualflowlayout.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualflowlayout.cfg"-"c:\Testframework\ui_testplatalfvisualflowlayout.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualframebrush.cfg"-"c:\Testframework\tctestplatalfvisualframebrush.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualframebrush.cfg"-"c:\Testframework\ui_testplatalfvisualframebrush.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualgencomponent.cfg"-"c:\Testframework\tctestplatalfvisualgencomponent.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualgencomponent.cfg"-"c:\Testframework\ui_testplatalfvisualgencomponent.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualgradientbrush.cfg"-"c:\Testframework\tctestplatalfvisualgradientbrush.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualgradientbrush.cfg"-"c:\Testframework\ui_testplatalfvisualgradientbrush.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualgridlayout.cfg"-"c:\Testframework\tctestplatalfvisualgridlayout.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualgridlayout.cfg"-"c:\Testframework\ui_testplatalfvisualgridlayout.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualimage.cfg"-"c:\Testframework\tctestplatalfvisualimage.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualimage.cfg"-"c:\Testframework\ui_testplatalfvisualimage.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualimagebrush.cfg"-"c:\Testframework\tctestplatalfvisualimagebrush.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualimagebrush.cfg"-"c:\Testframework\ui_testplatalfvisualimagebrush.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualimageloaderutil.cfg"-"c:\Testframework\tctestplatalfvisualimageloaderutil.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualimageloaderutil.cfg"-"c:\Testframework\ui_testplatalfvisualimageloaderutil.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisuallayout.cfg"-"c:\Testframework\tctestplatalfvisuallayout.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisuallayout.cfg"-"c:\Testframework\ui_testplatalfvisuallayout.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisuallinevisual.cfg"-"c:\Testframework\tctestplatalfvisuallinevisual.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisuallinevisual.cfg"-"c:\Testframework\ui_testplatalfvisuallinevisual.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualmeshvisual.cfg"-"c:\Testframework\tctestplatalfvisualmeshvisual.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualmeshvisual.cfg"-"c:\Testframework\ui_testplatalfvisualmeshvisual.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualmetric.cfg"-"c:\Testframework\tctestplatalfvisualmetric.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualmetric.cfg"-"c:\Testframework\ui_testplatalfvisualmetric.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualproceduralmesh.cfg"-"c:\Testframework\tctestplatalfvisualproceduralmesh.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualproceduralmesh.cfg"-"c:\Testframework\ui_testplatalfvisualproceduralmesh.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualmesh.cfg"-"c:\Testframework\ui_testplatalfvisualmesh.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualmesh.cfg"-"c:\Testframework\tctestplatalfvisualmesh.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualmaterial.cfg"-"c:\Testframework\ui_testplatalfvisualmaterial.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualmaterial.cfg"-"c:\Testframework\tctestplatalfvisualmaterial.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualmapfunc.cfg"-"c:\Testframework\ui_testplatalfvisualmapfunc.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualmapfunc.cfg"-"c:\Testframework\tctestplatalfvisualmapfunc.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualm3gmesh.cfg"-"c:\Testframework\ui_testplatalfvisualm3gmesh.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualm3gmesh.cfg"-"c:\Testframework\tctestplatalfvisualm3gmesh.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualcommand.cfg"-"c:\Testframework\ui_testplatalfvisualcommand.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualcommand.cfg"-"c:\Testframework\tctestplatalfvisualcommand.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualbrush.cfg"-"c:\Testframework\ui_testplatalfvisualbrush.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualbrush.cfg"-"c:\Testframework\tctestplatalfvisualbrush.cfg", FF   ; FF stands for Normal file
+"..\conf\ui_testplatalfvisualbrusharray.cfg"-"c:\Testframework\ui_testplatalfvisualbrusharray.cfg", FF   ; FF stands for Normal file
+"..\conf\tctestplatalfvisualbrusharray.cfg"-"c:\Testframework\tctestplatalfvisualbrusharray.cfg", FF   ; FF stands for Normal file
+
+"\epoc32\RELEASE\ARMV5\urel\alfbatchextplugin.dll"-"c:\sys\bin\alfbatchextplugin.dll", FF
+"\epoc32\RELEASE\ARMV5\urel\testplatalfvisual.dll"-"c:\sys\bin\testplatalfvisual.dll", FF
+
+"\epoc32\data\Z\resource\plugins\alfbatchextplugin.rsc"-"c:\resource\plugins\alfbatchextplugin.rsc", FF
+
+
+; Trim For Mms
+; ------------
+; to be added later
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/inc/alfbatchextplugin.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Batch extension plugin.
+*
+*/
+
+
+#ifndef T_ALFBATCHEXTPLUGIN_H
+#define T_ALFBATCHEXTPLUGIN_H
+
+#include <alf/alfextensionfactory.h>
+
+class TAlfBatchExtPlugin : public MAlfExtensionFactory
+    {
+public:
+    MAlfExtension* CreateExtensionL(
+        const TInt aObjectId, 
+        const TDesC8& aInitialParams, 
+        MAlfInterfaceProvider& aResolver );
+    void Release();
+    };
+
+#endif // T_ALFBATCHEXTPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/inc/alfbatchextpluginconstants.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 ALFBATCHEXTPLUGINCONSTANTS_H
+#define ALFBATCHEXTPLUGINCONSTANTS_H
+
+#include <alf/alftimedvalue.h>
+
+const TInt KAlfBatchExtPluginImplementationId = 0x0DDDDDDE;
+
+// All the components in this factory
+enum 
+    {
+    EAlfBatchExtPluginCreateExtension
+    };
+
+// Commands for this plugin
+enum
+    {
+    EAlfBatchExtensionCmdReset,
+    EAlfBatchExtensionCmdGetCount,
+    EAlfBatchExtensionCmdGetIndex,
+    EAlfBatchExtensionCmdInteger,
+    EAlfBatchExtensionCmdReal,
+    EAlfBatchExtensionCmdBufferMin,
+    EAlfBatchExtensionCmdBufferMax = EAlfBatchExtensionCmdBufferMin + 2048,
+    EAlfBatchExtensionCmdNotSupported = 0xFFFF
+    };
+
+#endif // ALFBATCHEXTPLUGINCONSTANTS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/inc/testplatalfvisual.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,3645 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions in alf_visual_api
+*
+*/
+
+
+
+#ifndef C_TESTPLATALFVISUAL_H
+#define C_TESTPLATALFVISUAL_H
+
+//  INCLUDES
+#include <stiflogger.h>
+#include <testscripterinternal.h>
+#include <stiftestmodule.h>
+#include <testclassassert.h>
+#include <eikenv.h>
+#include <coemain.h>
+
+#include <alf/alfenv.h>
+#include <alf/alfcontrol.h>
+#include <alf/alfcontrolgroup.h>
+#include <alf/alfdisplay.h>
+#include <alf/alfroster.h>
+#include <alf/alfvisual.h>
+#include <alf/alfcurvepath.h>
+#include <alf/alfcurvepathlayout.h>
+#include <alf/alfdecklayout.h>
+#include <alf/alfdropshadow.h>
+#include <alf/alftextvisual.h>
+#include <alf/alfdropshadowbrush.h>
+#include <alf/alfevent.h>
+#include <alf/alfscrollerevent.h>
+#include <alf/alfflowlayout.h>
+#include <alf/alfframebrush.h>
+#include <alf/alfgencomponent.h>
+#include <alf/alfgradientbrush.h>
+#include <alf/alfgridlayout.h>
+#include <alf/alfimage.h>
+#include <alf/alfimagebrush.h>
+#include <alf/alfimageloaderutil.h>
+#include <alf/alfimagevisual.h>
+#include <alf/alflayout.h>
+#include <alf/alflinevisual.h>
+#include <alf/alfownership.h>
+#include <alf/alfmeshvisual.h>
+#include <alf/alfownership.h>
+#include <alf/alfmeshvisual.h>
+#include <alf/alfmaterial.h>
+#include <alf/alfmappingfunctions.h>
+#include <alf/alfm3gmesh.h>
+#include <alf/alftexture.h>
+#include <alf/alfbrush.h>
+
+
+
+
+// MACROS
+#define TEST_CLASS_VERSION_MAJOR 0
+#define TEST_CLASS_VERSION_MINOR 0
+#define TEST_CLASS_VERSION_BUILD 0
+
+// Logging path
+_LIT( KtestplatalfvisualLogPath, "\\logs\\testframework\\testplatalfvisual\\" ); 
+// Log file
+_LIT( KtestplatalfvisualLogFile, "testplatalfvisual.txt" ); 
+_LIT( KtestplatalfvisualLogFileWithTitle, "testplatalfvisual_[%S].txt" );
+
+/**
+*  CTestPlatAlfVisual test class for STIF Test Framework TestScripter.
+*  @since S60 5.0
+*/
+NONSHARABLE_CLASS( CTestPlatAlfVisual ) : public CScriptBase
+    {
+public:  // Constructors and destructor
+
+    /**
+    * Two-phased constructor.
+    */
+    static CTestPlatAlfVisual* NewL( CTestModuleIf& aTestModuleIf );
+
+    /**
+    * Destructor.
+    */
+    virtual ~CTestPlatAlfVisual();
+
+public: // Functions from base classes
+
+    /**
+    * From CScriptBase Runs a script line.
+    * @since S60 5.0
+    * @param aItem Script line containing method name and parameters
+    * @return Symbian OS error code
+    */
+    virtual TInt RunMethodL( CStifItemParser& aItem );
+
+private:
+
+    /**
+    * C++ default constructor.
+    */
+    CTestPlatAlfVisual( CTestModuleIf& aTestModuleIf );
+
+    /**
+    * By default Symbian 2nd phase constructor is private.
+    */
+    void ConstructL();
+
+    /**
+     * Method used to log version of test class
+     */
+    void SendTestClassVersion();
+    
+    /**
+     * Turn off ScreenSaver
+     * @since S60 5.0
+     * @return Symbian OS error code.
+     */
+    void TurnOffScreenSaver();
+
+    /**
+     * Restore ScreenSaver
+     * @since S60 5.0
+     * @return Symbian OS error code.
+     */
+    void RestoreScreenSaver();
+
+private: // [TestMethods]
+//FOR TEST alfanchorlayout.h
+    /**
+    * TestAnchorLayoutAddNewL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutAddNewL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutConstructorL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutConstructorL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutConstructL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutConstructL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutResetL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutResetL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutSetAnchorL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutSetAnchorL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutSetRelativeAnchorRectL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutSetRelativeAnchorRectL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutRemoveAnchorL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutRemoveAnchorL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutAttachEdgeL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutAttachEdgeL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutAttachCornerL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutAttachCornerL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutAttachBoxL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutAttachBoxL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutDetachL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutDetachL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutDetachTypeL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutDetachTypeL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutRemoveAndDestroyAllDL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutRemoveAndDestroyAllDL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutUpdateChildrenLayoutL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutUpdateChildrenLayoutL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutFindTagL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutFindTagL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutBaseUnitL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutBaseUnitL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutDoRemoveAndDestroyAllDL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutDoRemoveAndDestroyAllDL( CStifItemParser& aItem );
+    /**
+    * TestAnchorLayoutPropertyOwnerExtensionL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAnchorLayoutPropertyOwnerExtensionL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfvisual.h
+    /**
+    * TestCAlfVCAlfVisualL tests Constructor of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVCAlfVisualL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVConstructL tests ConstructL of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVConstructL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVRemoveAndDestroyAllDL tests RemoveAndDestroyAllD of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVRemoveAndDestroyAllDL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVIdentifierL tests Identifier of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVIdentifierL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetFlagL tests SetFlag of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetFlagL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetFlagsL tests SetFlags of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetFlagsL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVClearFlagL tests ClearFlag of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVClearFlagL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVClearFlagsL tests ClearFlags of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVClearFlagsL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVFlagsL tests Flags of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVFlagsL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVLayoutL tests Layout of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVLayoutL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVPosL tests Pos of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVPosL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetPosL tests SetPos of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetPosL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSizeL tests Size of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSizeL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetSizeL tests SetSize of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetSizeL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVOpacityL tests Opacity of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVOpacityL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetOpacityL tests SetOpacity of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetOpacityL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVEnvL tests Env of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVEnvL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVDisplayL tests Display of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVDisplayL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVTagL tests Tag of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVTagL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVUpdateChildrenLayoutL tests UpdateChildrenLayout of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVUpdateChildrenLayoutL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVDisplayRectTargetL tests DisplayRectTarget of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVDisplayRectTargetL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVLocalToDisplayL tests LocalToDisplay of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVLocalToDisplayL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVLocalToDisplayWithRealPointL tests LocalToDisplay of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVLocalToDisplayWithRealPointL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVDisplayToLocalL tests DisplayToLocal of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVDisplayToLocalL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVDisplayToLocalWithRealPointL tests DisplayToLocal of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVDisplayToLocalWithRealPointL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVEnableBrushesL tests EnableBrushesL of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVEnableBrushesL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVBrushesL tests Brushes of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVBrushesL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVMoveToFrontL tests MoveToFront of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVMoveToFrontL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVEnableTransformationL tests EnableTransformationL of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVEnableTransformationL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVTransformationL tests Transformation of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVTransformationL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetPaddingL tests SetPadding of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetPaddingL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetPaddingWithPointL tests SetPadding of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetPaddingWithPointL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetPaddingWithMetricL tests SetPadding of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetPaddingWithMetricL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVPaddingInPixelsL tests PaddingInPixels of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVPaddingInPixelsL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetTagL tests SetTagL of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetTagL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVIsTaggedL tests IsTagged of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVIsTaggedL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVFindTagL tests FindTag of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVFindTagL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVConstructWithMoreParamsL tests ConstructL of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVConstructWithMoreParamsL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVCommsL tests Comms of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVCommsL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVDepthOffsetL tests DepthOffset of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVDepthOffsetL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetDepthOffsetL tests SetDepthOffset of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetDepthOffsetL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVOwnerL tests Owner of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVOwnerL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetOwnerL tests SetOwner of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetOwnerL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetOriginL tests SetOrigin of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetOriginL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVHorizontalOriginL tests HorizontalOrigin of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVHorizontalOriginL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVVerticalOriginL tests VerticalOrigin of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVVerticalOriginL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVAlignByOriginL tests AlignByOrigin of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVAlignByOriginL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetMinSizeL tests SetMinSize of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetMinSizeL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetMinSizeWithRealSizeL tests SetMinSize of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetMinSizeWithRealSizeL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVMinSizeL tests MinSize of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVMinSizeL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVMinSizeInBaseUnitsL tests MinSizeInBaseUnits of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVMinSizeInBaseUnitsL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetMaxSizeL tests SetMaxSize of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetMaxSizeL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetMaxSizeWithRealSizeL tests SetMaxSize of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetMaxSizeWithRealSizeL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVMaxSizeL tests MaxSize of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVMaxSizeL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVMaxSizeInBaseUnitsL tests MaxSizeInBaseUnits of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVMaxSizeInBaseUnitsL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetRectL tests SetRect of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetRectL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVMoveL tests Move of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVMoveL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVMoveWithRealPointL tests Move of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVMoveWithRealPointL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVMimicL tests Mimic of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVMimicL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetCenteredPosAndSizeL tests SetCenteredPosAndSize of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetCenteredPosAndSizeL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetCenteredPosAndSizeWithRealL tests SetCenteredPosAndSize of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetCenteredPosAndSizeWithRealL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVDisplayRectL tests DisplayRect of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVDisplayRectL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVEffectiveOpacityL tests EffectiveOpacity of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVEffectiveOpacityL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetClippingL tests SetClipping of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetClippingL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVClippingL tests Clipping of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVClippingL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVPaddingL tests Padding of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVPaddingL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVPaddingAsMetricL tests PaddingAsMetric of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVPaddingAsMetricL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVHorizontalPaddingL tests HorizontalPadding of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVHorizontalPaddingL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVVerticalPaddingL tests VerticalPadding of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVVerticalPaddingL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetPosWithTimedPointL tests SetPos of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetPosWithTimedPointL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetSizeWithTimedSizeL tests SetSize of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetSizeWithTimedPointL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVCopyValuesL tests CopyValues of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVCopyValuesL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVPauseL tests Pause of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVPauseL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVResumeL tests Resume of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVResumeL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVDoRemoveAndDestroyAllDL tests DoRemoveAndDestroyAllD of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVDoRemoveAndDestroyAllDL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVSetTactileFeedbackL tests SetTactileFeedbackL of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVSetTactileFeedbackL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVHasTactileFeedbackL tests HasTactileFeedback of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVHasTactileFeedbackL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVRemoveTactileFeedbackL tests RemoveTactileFeedback of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVRemoveTactileFeedbackL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVEnableDropShadowL tests EnableDropShadowL of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVEnableDropShadowL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVDropShadowHandlerL tests DropShadowHandler of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVDropShadowHandlerL( CStifItemParser& aItem );
+    /**
+    * TestCAlfVPropertyOwnerExtensionL tests PropertyOwnerExtension of CAlfVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCAlfVPropertyOwnerExtensionL( CStifItemParser& aItem );
+
+    
+private: //FOR TEST alfvisualfactory.h
+    /**
+    * TestAlfVFNewLayoutL tests NewLayoutL of AlfVisualFactory.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfVFNewLayoutL( CStifItemParser& aItem );
+    /**
+    * TestAlfVFNewLayoutLCL tests NewLayoutLC of AlfVisualFactory.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfVFNewLayoutLCL( CStifItemParser& aItem );
+    /**
+    * TestAlfVFNewVisualL tests NewVisualL of AlfVisualFactory.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfVFNewVisualL( CStifItemParser& aItem );
+    /**
+    * TestAlfVFNewVisualLCL tests NewVisualLC of AlfVisualFactory.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfVFNewVisualLCL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfcontrol.h
+    /**
+    * TestAlfCtrlConstructorL tests constructor of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlConstructorL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlConstructorL tests ConstructL of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlConstructL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlIdL tests SetId and Id of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlIdL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlGetCtrlMember tests Env, ControlGroup and Display of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlGetCtrlMember( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlProcessVisualL tests Append, Remove, AppendVisualL, Visual,
+    * FindTag, VisualCount, VisualDestroyed, VisualLayoutUpdated and 
+    * VisualPrepareDrawFailed of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlProcessVisualL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlProcessConnectL tests AddConnectionL, RemoveConnection, 
+    * FindConnection, ConnectionCount,Connection, ConnectionByOrdinal,
+    * ConnectionRole and ConnectionOrdinal of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlProcessConnectL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlProcessRole tests SetRole and Role of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlProcessRole( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlProcessHostL tests Host, HostId, SetHostId and SetHost
+    * of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlProcessHostL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlHostDisplayL tests HostToDisplay and DisplayToHost
+    * of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlHostDisplayL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlDisplayPos tests DisplayArea and DisplayCenter
+    * of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlDisplayPos( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlEventL tests AcceptInput, OfferEventL, CancelAllCommands and
+    * HitTest of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlEventL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlProcessFocus tests AcquireFocus, RelinquishFocus, Focus,
+    * FocusedConnection, IsFocusing and FocusChanged of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlProcessFocus( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlLayoutL tests AppendLayoutL and ContainerLayout
+    * of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlLayoutL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlIdentifier tests Identifier of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlIdentifier( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlBounds tests Bounds of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlBounds( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlShowL tests ShowL of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlShowL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlAddAndRemoveVisualL tests VisualAddedL and VisualRemoved
+    * of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlAddAndRemoveVisualL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlNotifyControlVisibilityL tests NotifyControlVisibility
+    * of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlNotifyControlVisibilityL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlAddAndRemoveConnectionL tests ConnectionAddedL and 
+    * ConnectionRemoved of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlAddAndRemoveConnectionL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlHostChangingL tests HostChangingL of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlHostChangingL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlPropertyOwnerExtensionL tests PropertyOwnerExtension
+    * of CAlfControl.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlPropertyOwnerExtensionL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfcontrolgroup.h
+    /**
+    * TestAlfCtrlGroupResourceId tests ResourceId
+    * of CAlfControlGroup.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlGroupResourceId( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlGroupProcessCtrlL tests AppendL, Remove, FindControl, Count
+    * and Control of CAlfControlGroup.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlGroupProcessCtrlL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlGroupProcessInput tests AcceptInput and SetAcceptInput
+    * of CAlfControlGroup.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlGroupProcessInput( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCtrlGroupProcessTransformL tests EnableTransformationL, 
+    * IsTransformed and Transformation of CAlfControlGroup.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCtrlGroupProcessTransformL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfcurvepath.h
+    /**
+    * TestAlfCurvePathNewL tests NewL and NewLC of CAlfCurvePath.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCurvePathNewL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCurvePathLoopL tests EnableLoop and Loop of CAlfCurvePath.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCurvePathLoopL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCurvePathOffsetL tests SetOffset and Offset of CAlfCurvePath.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCurvePathOffsetL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCurvePathProcessPointsL tests MapValue, SetOrigin, two AppendLineL,
+    * two AppendArcL, Length and Evaluate of CAlfCurvePath.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCurvePathProcessPointsL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCurvePathResetL tests Reset of CAlfCurvePath.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCurvePathResetL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCurvePathMappingFunctionIdentifierL tests MappingFunctionIdentifier
+    * of CAlfCurvePath.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCurvePathMappingFunctionIdentifierL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfcurvepathlayout.h
+    /**
+    * TestAlfCurvePathLayoutAddNewL tests AddNewL
+    * of CAlfCurvePathLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCurvePathLayoutAddNewL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCurvePathLayoutFullConstructL tests constructor and ConstructL
+    * of CAlfCurvePathLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCurvePathLayoutFullConstructL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCurvePathLayoutForLayoutL tests CurvePath and BaseUnit
+    * of CAlfCurvePathLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCurvePathLayoutForLayoutL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCurvePathLayoutForVisualL tests FindTag, UpdateChildrenLayout and
+    * RemoveAndDestroyAllD of CAlfCurvePathLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCurvePathLayoutForVisualL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCurvePathLayoutForMapL tests MappingFunctionIdentifier and
+    * MapValue of CAlfCurvePathLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCurvePathLayoutForMapL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfCurvePathLayoutProtectedFuncL tests DoRemoveAndDestroyAllD and
+    * PropertyOwnerExtension of CAlfCurvePathLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCurvePathLayoutProtectedFuncL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfdecklayout.h
+    /**
+    * TestAlfDeckLayoutAddNewL tests AddNewL of CAlfDeckLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDeckLayoutAddNewL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfDeckLayoutFullConstructL tests constructor and ConstructL
+    * of CAlfDeckLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDeckLayoutFullConstructL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfDeckLayoutForLayoutL tests BaseUnit
+    * of CAlfDeckLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDeckLayoutForLayoutL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfDeckLayoutForVisualL tests FindTag, UpdateChildrenLayout and
+    * RemoveAndDestroyAllD of CAlfDeckLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDeckLayoutForVisualL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfDeckLayoutProtectedFuncL tests DoRemoveAndDestroyAllD and
+    * PropertyOwnerExtension of CAlfDeckLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDeckLayoutProtectedFuncL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfdisplay.h
+    /**
+    * TestAlfDisplayForBackgroundL tests SetClearBackgroundL and
+    * SetBackgroundItemsL of CAlfDisplay.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDisplayForBackgroundL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfDisplayForRoster tests two Roster of CAlfDisplay.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDisplayForRoster( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfDisplayForVisibleArea tests SetVisibleArea, VisibleArea and
+    * ForceSetVisibleArea of CAlfDisplay.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDisplayForVisibleArea( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfDisplayForSetAttributesL tests SetFocusedEditor, SetQuality, 
+    * SetUseDepth, SetUsageL and SetDirty of CAlfDisplay.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDisplayForSetAttributesL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfDisplayGetAttributes tests Env, Quality and ObjectProvider
+    * of CAlfDisplay.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDisplayGetAttributes( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfDisplayFading tests SuppressAutomaticFading of CAlfDisplay.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDisplayFading( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfDisplayHandlePointerEventL tests HandlePointerEventL of CAlfDisplay.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDisplayHandlePointerEventL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfdisplaybackgrounditem.h
+    /**
+    * TestAlfDisplayBgItemConstructor tests SetClearBackgroundL and
+    * SetBackgroundItemsL of CAlfDisplay.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDisplayBgItemConstructor( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfDisplayBgItemSetAttributes tests SetRect, SetColor, SetColor and
+    * SetSkinBackground of CAlfDisplayBackGroundItem.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDisplayBgItemSetAttributes( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfdropshadow.h
+    /**
+    * TestAlfDropShadowSetAttributesL tests two SetOffset, two SetColor, 
+    * SetOpacity, SetRadius and SetScale of CAlfDropShadow.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDropShadowSetAttributesL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfdropshadowbrush.h
+    /**
+    * TestAlfDropShadowBrushNewFuncsL tests two NewL and two NewLC
+    * of CAlfDropShadowBrush.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDropShadowBrushNewFuncsL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfDropShadowBrushSoftnessL tests two SetSoftness and Softness
+    * of CAlfDropShadowBrush.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDropShadowBrushSoftnessL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfDropShadowBrushDepthL tests two SetDepth and Depth
+    * of CAlfDropShadowBrush.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDropShadowBrushDepthL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfDropShadowBrushSetColorL tests  SetColor of CAlfDropShadowBrush.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfDropShadowBrushSetColorL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfenv.h
+    /**
+    * TestAlfEnvNewFuncsL tests  NewL and NewLC of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvNewFuncsL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEnvClient tests  Client and TokenClient of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvClient( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEnvNewDisplayL tests  two NewDisplayL, PrimaryDisplay and 
+    * DisplayCount of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvNewDisplayL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEnvCtrlGroupL tests  NewControlGroupL, DeleteControlGroup, 
+    * ControlGroup and FindControlGroup of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvCtrlGroupL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEnvProcessFresh tests  SetRefreshMode, RefreshMode, SetMaxFrameRate
+    * ContinueRefresh, PauseRefresh and RefreshCallBack of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvProcessFresh( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEnvProcessTextureManagerL tests  CreateSharedTextureManagerL, 
+    * SharedTextureManager, TextureManager, TextStyleManager and
+    * DeleteSharedTextureManager of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvProcessTextureManagerL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEnvObserverL tests  AddActionObserverL and 
+    * RemoveActionObserver of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvObserverL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEnvProcessCmd tests  Send, two CancelCommands, 
+    * two CancelCustomCommands, three MilliSecondsUntilCommand  and two 
+    * MilliSecondsUntilCustomCommand of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvProcessCmd( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEnvKeyAndPointerEventL tests  HandleKeyEventL and HandlePointerEventL 
+    * of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvKeyAndPointerEventL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEnvNotifyL tests  NotifySkinChangedL and NotifyLayoutChangedL 
+    * of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvNotifyL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEnvProcessWidgetL tests  WidgetFactory, AppendWidgetL, 
+    * DestroyWidget and FindWidget of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvProcessWidgetL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEnvGetAttributes tests  LayoutMetricsUtility, Renderer, 
+    * LastReceivedPtrEvent, Version, BatchBufferHandler, Extension and
+    * Display of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvGetAttributes( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEnvFindDisplayIndex tests  FindDisplayIndex of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvFindDisplayIndex( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEnvFindControl tests  TestAlfEnvFindControl of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvFindControl( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEnvAddExtension tests  AddExtension of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvAddExtension( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEnvSetAndReSetL tests  SetIdleThreshold, Release, RestoreL and 
+    * SetFullScreenDrawing of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvSetAndReSetL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEnvStatic tests  Static of CAlfEnv.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEnvStatic( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfevent.h
+    /**
+    * TestAlfEventConstructor tests five TAlfEvent constructor of TAlfEvent.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEventConstructor( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEventParameters tests PointerDown, PointerUp, PointerLongTap, 
+    * IsPointerEvent, Type, IsCustomEvent, PointerEvent, IsScrollerEvent,
+    * ScrollerEvent, Code, KeyEvent and IsKeyEvent of TAlfEvent.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEventParameters( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEventCustomData tests CustomParameter and CustomEventData
+    * of TAlfEvent.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEventCustomData( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfEventDisplayAndVisual tests Display, SetVisual and Visual
+    * of TAlfEvent.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfEventDisplayAndVisual( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfflowlayout.h
+    /**
+    * TestAlfFlowLayoutAddNewL tests AddNewL of CAlfFlowLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfFlowLayoutAddNewL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfFlowLayoutFullConstructL tests constructor and ConstructL
+    * of CAlfFlowLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfFlowLayoutFullConstructL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfFlowLayoutForLayoutL tests BaseUnit
+    * of CAlfFlowLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfFlowLayoutForLayoutL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfFlowLayoutForVisualL tests FindTag, UpdateChildrenLayout and
+    * RemoveAndDestroyAllD of CAlfFlowLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfFlowLayoutForVisualL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfFlowLayoutProtectedFuncL tests DoRemoveAndDestroyAllD and
+    * PropertyOwnerExtension of CAlfFlowLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfFlowLayoutProtectedFuncL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfFlowLayoutSetParametersL tests SetFlowDirection, SetCentering,
+    * SetMode and Mode of CAlfFlowLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfFlowLayoutSetParametersL( CStifItemParser& aItem );
+    
+private: //FOR TEST alfframebrush.h
+    /**
+    * TestAlfFrameBrushNewL tests three NewL and three NewLC of CAlfFrameBrush.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfFrameBrushNewL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfFrameBrushSetParaL tests SetFrameRectsL, SetEdgeOffset and two
+    * SetImage of CAlfFrameBrush.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfFrameBrushSetParaL( CStifItemParser& aItem );
+    
+private: //FOR TEST alfgencomponent.h
+    /**
+    * TestAlfGenComponentNewL tests NewL of CAlfGenComponent.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfGenComponentNewL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfGenComponentProcessL tests DoCmdNoReply, DoSynchronousCmd, 
+    * DoAsynchronousCmdL, CancelAsynchCmd and Identifier of CAlfGenComponent.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfGenComponentProcessL( CStifItemParser& aItem );
+    
+private: //FOR TEST alfgradientbrush.h
+    /**
+    * TestAlfGradientBrushNewL tests NewL and NewLC of CAlfGradientBrush.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfGradientBrushNewL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfGradientBrushSetL tests SetDirection, SetColor, SetImage and 
+    * AppendColorL of CAlfGradientBrush.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfGradientBrushSetL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfGradientBrushGetL tests Color, Opacity and Image of CAlfGradientBrush.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfGradientBrushGetL( CStifItemParser& aItem );
+    
+private: //FOR TEST alfgridlayout.h
+    /**
+    * TestAlfGridLayoutAddNewL tests AddNewL of CAlfGridLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfGridLayoutAddNewL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfGridLayoutFullConstructL tests constructor and ConstructL
+    * of CAlfGridLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfGridLayoutFullConstructL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfGridLayoutForLayoutL tests BaseUnit of CAlfGridLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfGridLayoutForLayoutL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfGridLayoutForVisualL tests FindTag, UpdateChildrenLayout and 
+    * RemoveAndDestroyAllD of CAlfGridLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfGridLayoutForVisualL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfGridLayoutProtectedFuncL tests PropertyOwnerExtension and 
+    * DoRemoveAndDestroyAllD of CAlfGridLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfGridLayoutProtectedFuncL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfGridLayoutSetParametersL tests SetColumnsL, SetRowsL, SetColumnsL,
+    * SetRowsL, FillWeightsL, AppendWeightL, InsertWeightL,ReplaceWeightL,
+    * RemoveWeightL, DimensionCount, SetExpanding, OrdinalToBlock, 
+    * SetLayoutModeFlags and ClearLayoutModeFlags of CAlfGridLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfGridLayoutSetParametersL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfGridLayoutGetParaL tests Weight, LayoutModeFlags, RowCount and
+    * ColumnCount of CAlfGridLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfGridLayoutGetParaL( CStifItemParser& aItem );
+    
+private: //FOR TEST alfimage.h
+    /**
+    * TestAlfImageConstructorL tests five constructor of TAlfImage.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfImageConstructorL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfImageSetAttributesL tests SetTexture, Translate, Scale and
+    * SetTexCoords of TAlfImage.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfImageSetAttributesL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfImageGetAttributesL tests Texture, TopLeft, BottomRight and
+    * HasTexture of TAlfImage.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfImageGetAttributesL( CStifItemParser& aItem );
+    
+private: //FOR TEST alfimagebrush.h
+    /**
+    * TestAlfImageBrushNewL tests NewL and NewLC of CAlfImageBrush.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfImageBrushNewL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfImageBrushSetAndGetParaL tests SetScaleMode, SetImage, SetBorders,
+    * SetOffset, SetScale, Image, BorderDrawingEnabled, Offset, 
+    * CenterDrawingEnabled and Scale of CAlfImageBrush.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfImageBrushSetAndGetParaL( CStifItemParser& aItem );
+    
+private: //FOR TEST alfimageloaderutil.h
+    /**
+    * TestAlfImgLoadUtilConstructorL tests constructor of CAlfImageLoaderUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfImgLoadUtilConstructorL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfImgLoadUtilCreateImageLoaderL tests three CreateImageLoaderL and 
+    * CreateSVGImageLoaderL of CAlfImageLoaderUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfImgLoadUtilCreateImageLoaderL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfImgLoadUtilSetL tests SetSize and SetSkinInstance 
+    * of CAlfImageLoaderUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfImgLoadUtilSetL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfAutoSizeImgLoadUtilSetL tests functions 
+    * of CAlfAutoSizeImageLoaderUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfAutoSizeImgLoadUtilSetL( CStifItemParser& aItem );
+    
+private: //FOR TEST alfimagevisual.h
+    /**
+    * TestAlfImgVisualFullConstructorL tests constructor and ConstructL
+    * of CAlfImageVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfImgVisualFullConstructorL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfImgVisualAddNewL tests AddNewL of CAlfImageVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfImgVisualAddNewL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfImgVisualSetAndGetL tests SetColor, SetColorMode, SetStretch,
+    * SetStretchMode, three SetDropShadow, SetTurnAngle, TurnAngle, SetScale,
+    * Scale, SetOffset, Offset, SetScaleMode, ScaleMode, SetImage,
+    * SetSecondaryImage, SetSecondaryAlpha, SecondaryAlpha, Image and
+    * SecondaryImage of CAlfImageVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfImgVisualSetAndGetL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfImgVisualForVisualL tests FindTag, UpdateChildrenLayout and 
+    * RemoveAndDestroyAllD of CAlfImageVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfImgVisualForVisualL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfImgVisualProtectedFuncL tests PropertyOwnerExtension and 
+    * DoRemoveAndDestroyAllD of CAlfImageVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfImgVisualProtectedFuncL( CStifItemParser& aItem );
+    
+private: //FOR TEST alflayout.h
+    /**
+    * TestAlfLayoutFullConstructorL tests constructor and ConstructL
+    * of CAlfLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfLayoutFullConstructorL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfLayoutAddNewL tests AddNewL of CAlfLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfLayoutAddNewL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfLayoutSetAndGetL tests EnableScrollingL, Scrolling, ScrollOffset, 
+    * SetScrollOffset, ChildOrdinal, ChildPos, ChildSize, SetTransitionTime, 
+    * TransitionTime, SetInnerPadding, SetInnerPadding, InnerPadding, 
+    * InnerPaddingAsMetric, HorizontalInnerPadding, VerticalInnerPadding,
+    * InnerPaddingInBaseUnits EffectiveLayoutOrdinal of CAlfLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfLayoutSetAndGetL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfLayoutForVisualL tests Append, Remove, Reorder, MoveVisualToFront, 
+    * MoveVisualToBack, VirtualSize, FindVisual, Insert, Count, Visual, FindTag,
+    * UpdateChildrenLayout and RemoveAndDestroyAllD of CAlfLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfLayoutForVisualL( CStifItemParser& aItem );
+
+    /**
+    * TestAlfLayoutBaseUnitL tests two SetBaseUnit and BaseUnit of CAlfLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfLayoutBaseUnitL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfLayoutProtectedFuncL tests PropertyOwnerExtension and 
+    * DoRemoveAndDestroyAllD of CAlfLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfLayoutProtectedFuncL( CStifItemParser& aItem );
+    
+private: //FOR TEST alflinevisual.h
+    /**
+    * TestAlfLineVisualFullConstructorL tests constructor and ConstructL
+    * of CAlfLineVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfLineVisualFullConstructorL( CStifItemParser& aItem ); 
+    
+    /**
+    * TestAlfLineVisualAddNewL tests AddNewL of CAlfLineVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfLineVisualAddNewL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfLineVisualSetAndGetL tests SetPath,, Path, SetImage, Image, 
+    * SetAlphaFunction, SetWidthFunction, Thickness, SetThickness, 
+    * ShadowThickness, SetShadowThickness, StartPos, SetStartPos, EndPos(), 
+    * SetEndPos and SetColor of CAlfLineVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfLineVisualSetAndGetL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfLineVisualForVisualL tests FindTag, UpdateChildrenLayout and 
+    * RemoveAndDestroyAllD of CAlfLineVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfLineVisualForVisualL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfLineVisualProtectedFuncL tests PropertyOwnerExtension and 
+    * DoRemoveAndDestroyAllD of CAlfLineVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfLineVisualProtectedFuncL( CStifItemParser& aItem );
+    
+private: //FOR TEST alfm3gmesh.h
+    /**
+    * TestAlfM3GMeshLoadSceneL tests LoadSceneL of CAlfM3GMesh.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfM3GMeshLoadSceneL( CStifItemParser& aItem ); 
+    
+private: //FOR TEST alfmappingfunctions.h
+    /**
+    * TestAlfConstantMapFuncL tests NewL, SetValue and Value 
+    * of CAlfConstantMappingFunction.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfConstantMapFuncL( CStifItemParser& aItem ); 
+    
+    /**
+    * TestAlfLinearMapFuncL tests NewL, SetOffset, Offset, SetFactor and Factor 
+    * of CAlfLinearMappingFunction.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfLinearMapFuncL( CStifItemParser& aItem ); 
+    
+    /**
+    * TestAlfSineMapFuncL tests NewL, SetOffset, Offset, SetFactor and Factor 
+    * of CAlfSineMappingFunction.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfSineMapFuncL( CStifItemParser& aItem ); 
+    
+    /**
+    * TestAlfCosineMapFuncL tests NewL, SetOffset, Offset, SetFactor and Factor 
+    * of CAlfCosineMappingFunction.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfCosineMapFuncL( CStifItemParser& aItem ); 
+    
+    /**
+    * TestAlfAverageMapFuncL tests NewL, SetMappingFunction1, 
+    * SetMappingFunction2, SetMappingFunctions and SetWeight 
+    * of CAlfAverageMappingFunction.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfAverageMapFuncL( CStifItemParser& aItem ); 
+    
+    /**
+    * TestAlfTableMapFuncL tests NewL and SetMappingTableValues 
+    * of CAlfTableMappingFunction.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfTableMapFuncL( CStifItemParser& aItem ); 
+    
+private: //FOR TEST alfmaterial.h
+    /**
+    * TestAlfMaterialConstructor tests constructor of CAlfMaterial.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfMaterialConstructor( CStifItemParser& aItem ); 
+    
+private: //FOR TEST alfmesh.h
+    /**
+    * TestAlfMeshSetAndGetL tests MeshType, Reset, StretchUniformly, 
+    * ScaleUniformly, AnimationControllerCount, SetAnimationPosition, 
+    * StartAnimationController and StopAnimationController of CAlfMesh.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfMeshSetAndGetL( CStifItemParser& aItem ); 
+    
+private: //FOR TEST alfmeshvisual.h
+    /**
+    * TestAlfMeshVisualFullConstructorL tests constructor and ConstructL
+    * of CAlfMeshVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfMeshVisualFullConstructorL( CStifItemParser& aItem ); 
+    
+    /**
+    * TestAlfMeshVisualAddNewL tests AddNewL of CAlfMeshVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfMeshVisualAddNewL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfMeshVisualSetAndGetL tests CreateMeshL, SetImage, Image, 
+    * SetSecondaryImage, SecondaryImage, SetSpecularImage,SpecularImage, Mesh, 
+    * ProceduralMesh, M3GMesh, SecondaryAlpha, SetSecondaryAlpha,YawAngle, 
+    * SetYawAngle, PitchAngle, SetPitchAngle, Scale and 
+    * SetScale of CAlfMeshVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfMeshVisualSetAndGetL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfMeshVisualForVisualL tests FindTag, UpdateChildrenLayout and 
+    * RemoveAndDestroyAllD of CAlfMeshVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfMeshVisualForVisualL( CStifItemParser& aItem );
+    
+    /**
+    * TestAlfMeshVisualProtectedFuncL tests PropertyOwnerExtension and 
+    * DoRemoveAndDestroyAllD of CAlfMeshVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestAlfMeshVisualProtectedFuncL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfbatchbuffer.h
+    /**
+    * TestBBSetAutoFlushModeL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBBSetAutoFlushMode( CStifItemParser& aItem ); 
+    /**
+    * TestBBAutoFlushModeL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBBAutoFlushMode( CStifItemParser& aItem ); 
+    /**
+    * TestBBFlushBatchBufferL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBBFlushBatchBufferL( CStifItemParser& aItem ); 
+    /**
+    * TestBBSetMaxBatchBufferSize test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBBSetMaxBatchBufferSize( CStifItemParser& aItem ); 
+    /**
+    * TestBBGetBatchBufferInfoL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBBGetBatchBufferInfoL( CStifItemParser& aItem ); 
+    
+    
+private: //FOR TEST alfborderbrush.h
+    /**
+    * TestBorderBrushNewL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBorderBrushNewL( CStifItemParser& aItem ); 
+    /**
+    * TestBorderBrushNewLCL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBorderBrushNewLCL( CStifItemParser& aItem ); 
+    /**
+    * TestBorderBrushOffsetNewL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBorderBrushOffsetNewL( CStifItemParser& aItem ); 
+    /**
+    * TestBorderBrushOffsetNewLCL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBorderBrushOffsetNewLCL( CStifItemParser& aItem ); 
+    /**
+    * TestBorderBrushSetImageL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBorderBrushSetImageL( CStifItemParser& aItem ); 
+    /**
+    * TestBorderBrushImageL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBorderBrushImageL( CStifItemParser& aItem ); 
+    /**
+    * TestBorderBrushSetColorL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBorderBrushSetColorL( CStifItemParser& aItem ); 
+    /**
+    * TestBorderBrushThicknessL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBorderBrushThicknessL( CStifItemParser& aItem ); 
+    /**
+    * TestBorderBrushSetThicknessL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBorderBrushSetThicknessL( CStifItemParser& aItem ); 
+    /**
+    * TestBorderBrushSetThicknessMetricL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBorderBrushSetThicknessMetricL( CStifItemParser& aItem ); 
+    /**
+    * TestBorderBrushEdgeOffsetL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBorderBrushEdgeOffsetL( CStifItemParser& aItem ); 
+    /**
+    * TestBorderBrushSetEdgeOffsetL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBorderBrushSetEdgeOffsetL( CStifItemParser& aItem ); 
+    /**
+    * TestBorderBrushSetEdgeOffsetMetricL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBorderBrushSetEdgeOffsetMetricL( CStifItemParser& aItem ); 
+    /**
+    * TestBorderBrushImageOffsetL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBorderBrushImageOffsetL( CStifItemParser& aItem ); 
+    /**
+    * TestBorderBrushSetImageOffsetL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBorderBrushSetImageOffsetL( CStifItemParser& aItem ); 
+    /**
+    * TestBorderBrushSetImageOffsetMetricL test method.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBorderBrushSetImageOffsetMetricL( CStifItemParser& aItem ); 
+    
+    
+private: //FOR TEST alfviewportlayout.h
+    /**
+    * TestVpLayoutAddNewL test AddNewL of CAlfViewportLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestVpLayoutAddNewL( CStifItemParser& aItem ); 
+    /**
+    * TestVpLayoutConstructorL test constructor of CAlfViewportLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestVpLayoutConstructorL( CStifItemParser& aItem ); 
+    /**
+    * TestVpLayoutConstructL test ConstructL of CAlfViewportLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestVpLayoutConstructL( CStifItemParser& aItem ); 
+    /**
+    * TestVpLayoutSetVirtualSizeL test SetVirtualSize of CAlfViewportLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestVpLayoutSetVirtualSizeL( CStifItemParser& aItem ); 
+    /**
+    * TestVpLayoutSetViewportSizeL test SetViewportSize of CAlfViewportLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestVpLayoutSetViewportSizeL( CStifItemParser& aItem ); 
+    /**
+    * TestVpLayoutSetViewportPosL test SetViewportPos of CAlfViewportLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestVpLayoutSetViewportPosL( CStifItemParser& aItem ); 
+    /**
+    * TestVpLayoutRemoveAndDestroyAllDL test RemoveAndDestroyAllD of CAlfViewportLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestVpLayoutRemoveAndDestroyAllDL( CStifItemParser& aItem ); 
+    /**
+    * TestVpLayoutUpdateChildrenLayoutL test UpdateChildrenLayout of CAlfViewportLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestVpLayoutUpdateChildrenLayoutL( CStifItemParser& aItem ); 
+    /**
+    * TestVpLayoutFindTagL test FindTag of CAlfViewportLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestVpLayoutFindTagL( CStifItemParser& aItem ); 
+    /**
+    * TestVpLayoutBaseUnitL test BaseUnit of CAlfViewportLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestVpLayoutBaseUnitL( CStifItemParser& aItem ); 
+    /**
+    * TestVpLayoutDoRemoveAndDestroyAllDL test DoRemoveAndDestroyAllD of CAlfViewportLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestVpLayoutDoRemoveAndDestroyAllDL( CStifItemParser& aItem ); 
+    /**
+    * TestVpLayoutPropertyOwnerExtensionL test PropertyOwnerExtension of CAlfViewportLayout.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestVpLayoutPropertyOwnerExtensionL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfutil.h
+    /**
+    * TestUtilPower2 test Power2 of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilPower2( CStifItemParser& aItem );
+    /**
+    * TestUtilPower2RoundDown test Power2RoundDown of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilPower2RoundDown( CStifItemParser& aItem );
+    /**
+    * TestUtilInterpolate test Interpolate of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilInterpolate( CStifItemParser& aItem );
+    /**
+    * TestUtilWrapValue test WrapValue of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilWrapValue( CStifItemParser& aItem );
+    /**
+    * TestUtilRandomInt test RandomInt of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilRandomInt( CStifItemParser& aItem );
+    /**
+    * TestUtilRandomReal test RandomReal of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilRandomReal( CStifItemParser& aItem );
+    /**
+    * TestUtilQuickLengthWithPoint test QuickLength of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilQuickLengthWithPoint( CStifItemParser& aItem );
+    /**
+    * TestUtilQuickLength test QuickLength of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilQuickLength( CStifItemParser& aItem );
+    /**
+    * TestUtilQuickNormalize test QuickNormalize of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilQuickNormalize( CStifItemParser& aItem );
+    /**
+    * TestUtilQuickNormalizeWithVector test QuickNormalize of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilQuickNormalizeWithVector( CStifItemParser& aItem );
+    /**
+    * TestUtilCrossProduct test CrossProduct of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilCrossProduct( CStifItemParser& aItem );
+    /**
+    * TestUtilNormalFromPoints test NormalFromPoints of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilNormalFromPoints( CStifItemParser& aItem );
+    /**
+    * TestUtilShadowMatrix test ShadowMatrix of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilShadowMatrix( CStifItemParser& aItem );
+    /**
+    * TestUtilFreeMemory test FreeMemory of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilFreeMemory( CStifItemParser& aItem );
+    /**
+    * TestUtilScreenSize test ScreenSize of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilScreenSize( CStifItemParser& aItem );
+    /**
+    * TestUtilNearestFontInTwipsL test NearestFontInTwipsL of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilNearestFontInTwipsL( CStifItemParser& aItem );
+    /**
+    * TestUtilReleaseFont test ReleaseFont of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilReleaseFont( CStifItemParser& aItem );
+    /**
+    * TestUtilLengthUnit test LengthUnit of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilLengthUnit( CStifItemParser& aItem );
+    /**
+    * TestUtilColorLightness test ColorLightness of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilColorLightness( CStifItemParser& aItem );
+    /**
+    * TestUtilScaleFbsBitmapL test ScaleFbsBitmapL of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilScaleFbsBitmapL( CStifItemParser& aItem );
+    /**
+    * TestUtilCombineMaskFbsBitmapL test CombineMaskFbsBitmapL of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilCombineMaskFbsBitmapL( CStifItemParser& aItem );
+    /**
+    * TestUtilCropFbsBitmapL test CropFbsBitmapL of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilCropFbsBitmapL( CStifItemParser& aItem );
+    /**
+    * TestUtilScaleImageL test ScaleImage of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilScaleImageL( CStifItemParser& aItem );
+    /**
+    * TestUtilCropImageL test CropImage of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilCropImageL( CStifItemParser& aItem );
+    /**
+    * TestUtilTagMatches test TagMatches of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilTagMatches( CStifItemParser& aItem );
+    /**
+    * TestUtilConvertBitmapToDisplayModeLCL test ConvertBitmapToDisplayModeLC of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilConvertBitmapToDisplayModeLCL( CStifItemParser& aItem );
+    /**
+    * TestUtilThemeItemIdL test ConvertBitmapToDisplayModeLC of AlfUtil.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestUtilThemeItemIdL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alftransformation.h
+    /**
+    * TestTransNewL test NewL of CAlfTransformation.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTransNewL( CStifItemParser& aItem );
+    /**
+    * TestTransNewLCL test NewLC of CAlfTransformation.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTransNewLCL( CStifItemParser& aItem );
+    /**
+    * TestTransCountL test Count of CAlfTransformation.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTransCountL( CStifItemParser& aItem );
+    /**
+    * TestTransNonIdentityCountL test NonIdentityCount of CAlfTransformation.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTransNonIdentityCountL( CStifItemParser& aItem );
+    /**
+    * TestTransStepL test Step of CAlfTransformation.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTransStepL( CStifItemParser& aItem );
+    /**
+    * TestTransReplaceStepL test ReplaceStep of CAlfTransformation.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTransReplaceStepL( CStifItemParser& aItem );
+    /**
+    * TestTransLoadIdentityL test LoadIdentity of CAlfTransformation.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTransLoadIdentityL( CStifItemParser& aItem );
+    /**
+    * TestTransTranslateL test Translate of CAlfTransformation.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTransTranslateL( CStifItemParser& aItem );
+    /**
+    * TestTransScaleL test Scale of CAlfTransformation.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTransScaleL( CStifItemParser& aItem );
+    /**
+    * TestTransRotateL test Rotate of CAlfTransformation.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTransRotateL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alftimedvalue.h
+    /**
+    * TestTimedValueConstructor test Constructor of TAlfTimedValue.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTimedValueConstructor( CStifItemParser& aItem );
+    /**
+    * TestTimedValueValueNow test Methods of TAlfTimedValue.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTimedValueValueNow( CStifItemParser& aItem );
+    /**
+    * TestTimedValueTargetAndSpeed test Methods of TAlfTimedValue.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTimedValueTargetAndSpeed( CStifItemParser& aItem );
+    /**
+    * TestTimedValueStyle test Methods of TAlfTimedValue.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTimedValueStyle( CStifItemParser& aItem );
+    /**
+    * TestTimedValueMappingFunctionIdentifier test Methods of TAlfTimedValue.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTimedValueMappingFunctionIdentifier( CStifItemParser& aItem );
+    /**
+    * TestTimedValueFlags test Flags of TAlfTimedValue.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTimedValueFlags( CStifItemParser& aItem );
+    /**
+    * TestRealPointMethods test Methods of TAlfRealPoint.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestRealPointMethods( CStifItemParser& aItem );
+    /**
+    * TestRealSizeMethods test Methods of TAlfRealSize.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestRealSizeMethods( CStifItemParser& aItem );
+    /**
+    * TestRealRectMethods test Methods of TAlfRealRect.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestRealRectMethods( CStifItemParser& aItem );
+    /**
+    * TestTimedPointConstructor test Constructor of TAlfTimedPoint.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTimedPointConstructor( CStifItemParser& aItem );
+    /**
+    * TestTimedPointSetStyle test SetStyle of TAlfTimedPoint.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTimedPointSetStyle( CStifItemParser& aItem );
+    /**
+    * TestTimedPointSetMapFuncIdentifier test SetMappingFunctionIdentifier of TAlfTimedPoint.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTimedPointSetMapFuncIdentifier( CStifItemParser& aItem );
+    /**
+    * TestTimedPointTargetMethods test Target Methods of TAlfTimedPoint.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTimedPointTargetMethods( CStifItemParser& aItem );
+    /**
+    * TestTimedPointValueNowMethods test ValueNow Methods of TAlfTimedPoint.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTimedPointValueNowMethods( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alftextvisual.h
+    /**
+    * TestTxtVisualAddNewL test AddNewL of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualAddNewL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualConstructor test Constructor of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualConstructorL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualConstructL test ConstructL of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualConstructL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualTxtMethodsL test Text Methods of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualTxtMethodsL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualStyleMethodsL test Style Methods of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualStyleMethodsL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualSetAlignL test SetAlign of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualSetAlignL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualSetLineSpacingL test SetLineSpacing of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualSetLineSpacingL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualExtentsMethodsL test TextExtents Methods of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualExtentsMethodsL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualMaxLineCountMethodsL test MaxLineCount Methods of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualMaxLineCountMethodsL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualWrappingMethodsL test Wrapping Methods of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualWrappingMethodsL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualBackgroundTypeL test BackgroundType of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualBackgroundTypeL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualShadowOpacityMethodsL test ShadowOpacity Methods of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualShadowOpacityMethodsL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualColorMethodsL test Color Methods of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualColorMethodsL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualEnableShadowL test EnableShadow of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualEnableShadowL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualOffsetMethodsL test Offset Methods of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualOffsetMethodsL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualRemoveAndDestroyAllDL test RemoveAndDestroyAllD of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualRemoveAndDestroyAllDL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualUpdateChildrenLayoutL test UpdateChildrenLayout of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualUpdateChildrenLayoutL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualFindTagL test FindTag of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualFindTagL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualSetHighlightRangeL test SetHighlightRange of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualSetHighlightRangeL( CStifItemParser& aItem );
+    /**
+    * TestTxtVisualProtectedMethodsL test protected methods of CAlfTextVisual.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtVisualProtectedMethodsL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alftextureprocessor.h
+    /**
+    * TestTxtProcessorBlurL test BlurL methods of CAlfTextureProcessor.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtProcessorBlurL( CStifItemParser& aItem );
+    
+    
+private: // FOR TEST alftexturegroup.h
+    /**
+    * TestTxtGroupNewL test NewL of CAlfTextureGroup.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtGroupNewL( CStifItemParser& aItem );
+    /**
+    * TestTxtGroupNewLCL test NewLC of CAlfTextureGroup.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtGroupNewLCL( CStifItemParser& aItem );
+    /**
+    * TestTxtGroupTextureMethodsL test Texture Methods of CAlfTextureGroup.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtGroupTextureMethodsL( CStifItemParser& aItem );
+    /**
+    * TestTxtGroupIsLoadingCompletedL test IsLoadingCompleted of CAlfTextureGroup.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtGroupIsLoadingCompletedL( CStifItemParser& aItem );
+    /**
+    * TestTxtGroupObserverMethodsL test Observer Methods of CAlfTextureGroup.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtGroupObserverMethodsL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alftexturemanager.h
+    /**
+    * TestTxtMgrEnv test Env of CAlfTextureManager.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtMgrEnv( CStifItemParser& aItem );
+    /**
+    * TestTxtMgrTextureL test Texture of CAlfTextureManager.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtMgrTextureL( CStifItemParser& aItem );
+    /**
+    * TestTxtMgrImagePathL test ImagePath Methods of CAlfTextureManager.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtMgrImagePathL( CStifItemParser& aItem );
+    /**
+    * TestTxtMgrBlankTexture test BlankTexture of CAlfTextureManager.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtMgrBlankTexture( CStifItemParser& aItem );
+    /**
+    * TestTxtMgrLoadTextureL test LoadTextureL of CAlfTextureManager.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtMgrLoadTextureL( CStifItemParser& aItem );
+    /**
+    * TestTxtMgrCreateTextureL test CreateTextureL of CAlfTextureManager.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtMgrCreateTextureL( CStifItemParser& aItem );
+    /**
+    * TestTxtMgrUnloadTextureL test UnloadTexture of CAlfTextureManager.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtMgrUnloadTextureL( CStifItemParser& aItem );
+    /**
+    * TestTxtMgrUpdateTextureL test UpdateTexture of CAlfTextureManager.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtMgrUpdateTextureL( CStifItemParser& aItem );
+    /**
+    * TestTxtMgrDefineFileNameL test DefineFileNameL of CAlfTextureManager.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtMgrDefineFileNameL( CStifItemParser& aItem );
+    /**
+    * TestTxtMgrPrependImagePath test PrependImagePath of CAlfTextureManager.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtMgrPrependImagePath( CStifItemParser& aItem );
+    /**
+    * TestTxtMgrObserverMethodsL test Observer Methods of CAlfTextureManager.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtMgrObserverMethodsL( CStifItemParser& aItem );
+    /**
+    * TestTxtMgrProcessor test Processor of CAlfTextureManager.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtMgrProcessor( CStifItemParser& aItem );
+    /**
+    * TestTxtMgrSetAutomaticTextureIdRange test SetAutomaticTextureIdRange of CAlfTextureManager.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtMgrSetAutomaticTextureIdRange( CStifItemParser& aItem );
+    /**
+    * TestTxtMgrIsLoadedL test IsLoaded of CAlfTextureManager.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtMgrIsLoadedL( CStifItemParser& aItem );
+    /**
+    * TestTxtMgrTextureIdL test TextureId of CAlfTextureManager.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtMgrTextureIdL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfstatic.h
+    /**
+    * TestStaticEnv test Env of CAlfStatic.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestStaticEnv( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfsymbiansbdrawer.h
+    /**
+    * TestBufDrawerDrawBufferL test DrawBuffer of CAlfSymbianBufferDrawer.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBufDrawerDrawBufferL( CStifItemParser& aItem );
+    /**
+    * TestBufDrawerGetBufferBitmapsL test GetBufferBitmaps of CAlfSymbianBufferDrawer.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBufDrawerGetBufferBitmapsL( CStifItemParser& aItem );
+    /**
+    * TestBufDrawerReleaseDrawerL test ReleaseDrawer of CAlfSymbianBufferDrawer.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBufDrawerReleaseDrawerL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alftextstylemanager.h
+    /**
+    * TestStyleMgrTextStyleMethodsL test TextStyle Methods of CAlfTextStyleManager.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestStyleMgrTextStyleMethodsL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alftextstyle.h
+    /**
+    * TestStyleParentIdL test ParentId of CAlfTextStyle.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestStyleParentIdL( CStifItemParser& aItem );
+    /**
+    * TestStyleIdL test Id of CAlfTextStyle.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestStyleIdL( CStifItemParser& aItem );
+    /**
+    * TestStyleTextColorL test TextColor of CAlfTextStyle.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestStyleTextColorL( CStifItemParser& aItem );
+    /**
+    * TestStyleTextSizeL test TextSize Methods of CAlfTextStyle.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestStyleTextSizeL( CStifItemParser& aItem );
+    /**
+    * TestStyleBoldL test Bold Methods of CAlfTextStyle.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestStyleBoldL( CStifItemParser& aItem );
+    /**
+    * TestStyleItalicL test Italic Methods of CAlfTextStyle.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestStyleItalicL( CStifItemParser& aItem );
+    /**
+    * TestStyleUnderlineL test Underline Methods of CAlfTextStyle.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestStyleUnderlineL( CStifItemParser& aItem );
+    /**
+    * TestStyleStrikeThroughL test StrikeThrough Methods of CAlfTextStyle.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestStyleStrikeThroughL( CStifItemParser& aItem );
+    /**
+    * TestStyleTypefaceNameL test TypefaceNameL of CAlfTextStyle.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestStyleTypefaceNameL( CStifItemParser& aItem );
+    /**
+    * TestStyleSetTextPaneHeightInPixelsL test SetTextPaneHeightInPixels of CAlfTextStyle.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestStyleSetTextPaneHeightInPixelsL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alftexture.h
+    /**
+    * TestTextureGetMethods test Get Methods of CAlfTexture.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTextureGetMethods( CStifItemParser& aItem );
+    /**
+    * TestTextureAnimation test Animation Methods of CAlfTexture.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTextureAnimation( CStifItemParser& aItem );
+    /**
+    * TestTextureSetMethodsL test Set Methods of CAlfTexture.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTextureSetMethodsL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alftextureautosizeparams.h
+    /**
+    * TestTxtAutoSizeParamsConstructor test Constructor of CAlfTexture.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtAutoSizeParamsConstructor( CStifItemParser& aItem );
+    /**
+    * TestTxtAutoSizeParamsGetMethods test Get Methods of TAlfTextureAutoSizeParams.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtAutoSizeParamsGetMethods( CStifItemParser& aItem );
+    /**
+    * TestTxtAutoSizeParamsSetMethods test Set Methods of CAlfTexture.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTxtAutoSizeParamsSetMethods( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfshadowborderbrush.h
+    /**
+    * TestShadowBBNewL test NewL Methods of CAlfShadowBorderBrush.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestShadowBBNewL( CStifItemParser& aItem );
+    /**
+    * TestShadowBBNewLCL test NewLCL Methods of CAlfShadowBorderBrush.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestShadowBBNewLCL( CStifItemParser& aItem );
+    /**
+    * TestShadowBBWidthMethodsL test Width Methods of CAlfShadowBorderBrush.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestShadowBBWidthMethodsL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfpropertyowner.h
+    /**
+    * TestPropOwnerConstructorL test Constructor of CAlfPropertyOwner.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestPropOwnerConstructorL( CStifItemParser& aItem );
+    /**
+    * TestPropOwnerPropertyRemoveL test PropertyRemove of CAlfPropertyOwner.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestPropOwnerPropertyRemoveL( CStifItemParser& aItem );
+    /**
+    * TestPropOwnerPropertyClearL test PropertyClear of CAlfPropertyOwner.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestPropOwnerPropertyClearL( CStifItemParser& aItem );
+    /**
+    * TestPropOwnerPropertyIntegerL test PropertyInteger Methods of CAlfPropertyOwner.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestPropOwnerPropertyIntegerL( CStifItemParser& aItem );
+    /**
+    * TestPropOwnerPropertyStringL test PropertyString Methods of CAlfPropertyOwner.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestPropOwnerPropertyStringL( CStifItemParser& aItem );
+    /**
+    * TestPropOwnerCopyPropertyL test CopyProperty of CAlfPropertyOwner.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestPropOwnerCopyPropertyL( CStifItemParser& aItem );
+    /**
+    * TestPropOwnerPropertyOwnerExtensionL test PropertyOwnerExtension of CAlfPropertyOwner.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestPropOwnerPropertyOwnerExtensionL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfroster.h
+    /**
+    * TestRosterCtrlGroupMethodsL test ControlGroup Methods of CAlfRoster.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestRosterCtrlGroupMethodsL( CStifItemParser& aItem );
+    /**
+    * TestRosterCtrlMethodsL test Control Methods of CAlfRoster.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestRosterCtrlMethodsL( CStifItemParser& aItem );
+    /**
+    * TestRosterVisualMethodsL test Visual Methods of CAlfRoster.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestRosterVisualMethodsL( CStifItemParser& aItem );
+    /**
+    * TestRosterPointerEventObserverMethodsL test PointerEventObserver Methods of CAlfRoster.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestRosterPointerEventObserverMethodsL( CStifItemParser& aItem );
+    /**
+    * TestRosterSetPointerDragThresholdL test SetPointerDragThreshold of CAlfRoster.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestRosterSetPointerDragThresholdL( CStifItemParser& aItem );
+    /**
+    * TestRosterDisableLongTapEventsWhenDraggingL test DisableLongTapEventsWhenDragging of CAlfRoster.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestRosterDisableLongTapEventsWhenDraggingL( CStifItemParser& aItem );
+    /**
+    * TestRosterCtrlGroupOrderChangedObserverL test ControlGroupOrderChangedObserver Methods of CAlfRoster.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestRosterCtrlGroupOrderChangedObserverL( CStifItemParser& aItem );
+
+    
+private: //FOR TEST alfscreenbuffer.h
+    /**
+    * TestScrBufNewLMethodsL test NewL Methods of CAlfScreenBuffer.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestScrBufNewLMethodsL( CStifItemParser& aItem );
+    /**
+    * TestScrBufGetMethodsL test Get Methods of CAlfScreenBuffer.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestScrBufGetMethodsL( CStifItemParser& aItem );
+    /**
+    * TestScrBufRequestMethodsL test Request Methods of CAlfScreenBuffer.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestScrBufRequestMethodsL( CStifItemParser& aItem );
+    /**
+    * TestScrBufObserverMethodsL test Observer Methods of CAlfScreenBuffer.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestScrBufObserverMethodsL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfscrollerevent.h
+    /**
+    * TestScrollEventMethods test Methods of TAlfScrollerEvent.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestScrollEventMethods( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfmetric.h
+    /**
+    * TestMetricMethods test Methods of TAlfMetric.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestMetricMethods( CStifItemParser& aItem );
+    /**
+    * TestXYMetricMethods test Methods of TAlfXYMetric.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestXYMetricMethods( CStifItemParser& aItem );
+    /**
+    * TestBoxMetricMethods test Methods of TAlfBoxMetric.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestBoxMetricMethods( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfproceduralmesh.h
+    /**
+    * TestProMeshMakeMethodsL test Make Methods of CAlfProceduralMesh.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestProMeshMakeMethodsL( CStifItemParser& aItem );
+    /**
+    * TestProMeshMaterialMethodsL test Material Methods of CAlfProceduralMesh.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestProMeshMaterialMethodsL( CStifItemParser& aItem );
+    
+    
+private: //FOR TEST alfcommand.h
+    /**
+    * TestCmdMethods test Methods of TAlfCommand.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCmdMethods( CStifItemParser& aItem );
+    /**
+    * TestActCmdMethodsL test Methods of TAlfActionCommand.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestActCmdMethodsL( CStifItemParser& aItem );
+    /**
+    * TestObjCmdMethodsL test Methods of TAlfObjectCommand.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestObjCmdMethodsL( CStifItemParser& aItem );
+    /**
+    * TestGroupCmdMethodsL test Methods of TAlfGroupCommand.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestGroupCmdMethodsL( CStifItemParser& aItem );
+    /**
+    * TestCtrlCmdMethodsL test Methods of TAlfControlCommand.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCtrlCmdMethodsL( CStifItemParser& aItem );
+    /**
+    * TestVisualCmdMethodsL test Methods of TAlfVisualCommand.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestVisualCmdMethodsL( CStifItemParser& aItem );
+    /**
+    * TestImageCmdMethodsL test Methods of TAlfImageCommand.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestImageCmdMethodsL( CStifItemParser& aItem );
+    /**
+    * TestTextCmdMethodsL test Methods of TAlfTextCommand.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTextCmdMethodsL( CStifItemParser& aItem );
+    /**
+    * TestValueCmdMethodsL test Methods of TAlfValueCommand.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestValueCmdMethodsL( CStifItemParser& aItem );
+    /**
+    * TestPointCmdMethodsL test Methods of TAlfPointCommand.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestPointCmdMethodsL( CStifItemParser& aItem );
+    /**
+    * TestTransCmdMethodsL test Methods of TAlfTransformationCommand.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestTransCmdMethodsL( CStifItemParser& aItem );
+    /**
+    * TestMarkerCmdMethodsL test Methods of TAlfMarkerCommand.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestMarkerCmdMethodsL( CStifItemParser& aItem );
+    /**
+    * TestCustomEventCmdMethodsL test Methods of TAlfCustomEventCommand.
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    virtual TInt TestCustomEventCmdMethodsL( CStifItemParser& aItem );
+    
+private: //FOR TEST alfbrush.h
+    /**
+     * TestAlfBrushOpacityL test Opacity method of CAlfBrush.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestAlfBrushOpacityL( CStifItemParser& aItem );
+    /**
+     * TestAlfBrushSetOpacityL test SetOpacity method of CAlfBrush.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestAlfBrushSetOpacityL( CStifItemParser& aItem );
+    /**
+     * TestAlfBrushSetLayerL test SetLayer method of CAlfBrush.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestAlfBrushSetLayerL( CStifItemParser& aItem );
+    /**
+     * TestAlfBrushSetClipToVisualL test SetClipToVisual method of CAlfBrush.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestAlfBrushSetClipToVisualL( CStifItemParser& aItem );
+    /**
+     * TestAlfBrushClipToVisualL test ClipToVisual method of CAlfBrush.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestAlfBrushClipToVisualL( CStifItemParser& aItem );
+    /**
+     * TestAlfBrushIdentifierL test Identifier method of CAlfBrush.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestAlfBrushIdentifierL( CStifItemParser& aItem );
+    /**
+     * TestAlfBrushCommsL test Comms method of CAlfBrush.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestAlfBrushCommsL( CStifItemParser& aItem );
+    /**
+     * TestAlfBrushConstructLWithParamL test ConstructL method with param of CAlfBrush.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestAlfBrushConstructLWithParamL( CStifItemParser& aItem );
+    /**
+     * TestAlfBrushConstructL test ConstructL method of CAlfBrush.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestAlfBrushConstructL( CStifItemParser& aItem );
+    /**
+     * TestAlfBrushPropertyOwnerExtL test PropertyOwnerExtension method of CAlfBrush.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestAlfBrushPropertyOwnerExtL( CStifItemParser& aItem );
+    
+private: //FOR TEST alfbrusharray.h
+    /**
+     * TestBrushArrayResetL test Reset of CAlfBrushArray.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBrushArrayResetL( CStifItemParser& aItem );
+    /**
+     * TestBrushArrayAppendL test AppendL of CAlfBrushArray.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBrushArrayAppendL( CStifItemParser& aItem );
+    /**
+     * TestBrushArrayInsertL test InsertL of CAlfBrushArray.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBrushArrayInsertL( CStifItemParser& aItem );
+    /**
+     * TestBrushArrayRemoveL test Remove of CAlfBrushArray.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBrushArrayRemoveL( CStifItemParser& aItem );
+    /**
+     * TestBrushArrayCountL test Count of CAlfBrushArray.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBrushArrayCountL( CStifItemParser& aItem );
+    /**
+     * TestBrushArrayOperatorL test operator [] of CAlfBrushArray.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBrushArrayOperatorL( CStifItemParser& aItem );
+    /**
+     * TestBrushArrayAtL test At of CAlfBrushArray.
+     * @since S60 5.0
+     * @param aItem is not used.
+     * @return Symbian OS error code.
+     */
+    virtual TInt TestBrushArrayAtL( CStifItemParser& aItem );
+    
+private:    // Data
+
+    /**
+     * ScreenSaver Property
+     */
+    TInt iOldScreenSaverProperty;
+    
+    /**
+     * Own: pointer to CAlfEnv object
+     */
+    CAlfEnv* iAlfEnv;
+    
+    /**
+     * Own by iAlfEnv for binding to display
+     */
+    CAlfControl* iAlfCtl;
+    
+    /**
+     * Own by iAlfEnv
+     */
+    CAlfDisplay* iAlfDisplay;
+    
+    /**
+     * Own by iAlfEnv
+     */
+    CAlfControlGroup* iAlfCtrlGroup;
+
+    };
+
+#endif      // C_TESTPLATALFVISUAL_H
+
+// End of File
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/init/testplatalfvisual.ini	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,232 @@
+
+#
+# This is STIFTestFramework initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+# - Set Test Reporting mode. TestReportMode's possible values are:
+#     + 'Summary': Summary of the tested test cases.
+#     + 'Environment': Hardware and software info.
+#     + 'TestCases': Test case report.
+#     + 'FullReport': Set of all above ones.
+#     + Example 'TestReportMode= Summary TestCases'
+#
+#     - CreateTestReport setting controls report creation mode
+#     + YES, Test report will created.
+#     + NO, No Test report.
+#
+#     - File path indicates the base path of the test report.
+#     - File name indicates the name of the test report.
+#
+#     - File format indicates the type of the test report.
+#     + TXT, Test report file will be txt type, for example 'TestReport.txt'.
+#     + HTML, Test report will be html type, for example 'TestReport.html'.
+#
+#     - File output indicates output source of the test report.
+#     + FILE, Test report logging to file.
+#     + RDEBUG, Test report logging to using rdebug.
+#
+#     - File Creation Mode indicates test report overwriting if file exist.
+#     + OVERWRITE, Overwrites if the Test report file exist.
+#     + APPEND, Continue logging after the old Test report information if 
+#           report exist.
+
+[Engine_Defaults]
+
+TestReportMode= FullReport    # Possible values are: 
+                              # 'Summary', 'Environment', 'TestCases' or 'FullReport'
+
+CreateTestReport= YES         # Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT         # Possible values: TXT or HTML
+TestReportOutput= FILE        # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE    # Possible values: OVERWRITE or APPEND
+UITestingSupport= Yes
+SeparateProcesses= YES
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= testplatalfvisualtestplatalfvisualtestplatalfvisual
+# Modules might have initialisation file, specified as
+# IniFile= YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= NormalCases.txt
+# TestCaseFile= SmokeCases.txt
+# TestCaseFile= ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags 
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+[New_Module]
+ModuleName= testcombiner
+TestCaseFile= c:\testframework\tctestplatalfvisualvisual.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualanchorlayout.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualvisualfactory.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualbatchbuffer.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualborderbrush.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualcontrol.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualcontrolgroup.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualviewportlayout.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualutil.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualtransformation.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualtimedvalue.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualtextvisual.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualtextureprocessor.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualtexturegroup.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualtexturemanager.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualstatic.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualsymbiansbdrawer.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualtextstylemanager.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualtextstyle.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualtexture.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualtextureautosizeparams.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualshadowborderbrush.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualpropertyowner.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualroster.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualscreenbuffer.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualscrollerevent.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualcurvepath.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualcurvepathlayout.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualdecklayout.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualdisplay.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualdisplaybackgrounditem.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualdropsshadow.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualdropsshadowbrush.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualenv.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualevent.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualflowlayout.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualframebrush.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualgencomponent.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualimage.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualgradientbrush.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualgridlayout.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualimagebrush.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualimageloaderutil.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualimagevisual.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisuallayout.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisuallinevisual.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualmeshvisual.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualm3gmesh.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualmapfunc.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualmaterial.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualmesh.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualmetric.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualproceduralmesh.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualcommand.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualbrush.cfg
+TestCaseFile= c:\testframework\tctestplatalfvisualbrusharray.cfg
+[End_Module]
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+#Load testmoduletestplatalfvisual, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuletestplatalfvisual used initialization file
+#IniFile= init.txt
+
+#TestModuletestplatalfvisual used configuration file(s)
+#TestCaseFile= testcases1.cfg
+#TestCaseFile= testcases2.cfg
+#TestCaseFile= manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIFTestFramework logging overwrite parameters for Logger.
+# Hardware and emulator environment logging path and styles can
+# be configured from here to overwrite the Logger's implemented values.
+#   
+# Settings description:
+# - Indicates option for creation log directory/directories. If log directory/directories
+#       is/are not created by user they will make by software.
+#     + YES, Create log directory/directories if not allready exist.
+#     + NO, Log directory/directories not created. Only created one is used.
+#
+# - Overwrite emulator path setting.
+#     + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined 
+#       Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+#       will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+# - Overwrite emulator's logging format.
+#     + TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+#     + HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+# - Overwrited emulator logging output source.
+#     + FILE, Logging to file(s).
+#     + RDEBUG, Logging to using rdebug(s).
+#
+# - Overwrite hardware path setting (Same description as above in emulator path).
+# - Overwrite hardware's logging format(Same description as above in emulator format).
+# - Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+# - File Creation Mode indicates file overwriting if file exist.
+#     + OVERWRITE, Overwrites if file(s) exist.
+#     + APPEND, Continue logging after the old logging information if file(s) exist.
+#
+# - Will thread id include to the log filename.
+#     + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+#     + NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+# - Will time stamps include the to log file.
+#     + YES, Time stamp added to each line in log file(s). Time stamp is 
+#       for example'12.Nov.2003 115958 LOGGING INFO'
+#     + NO, No time stamp(s).
+#
+# - Will line breaks include to the log file.
+#     + YES, Each logging event includes line break and next log event is in own line.
+#     + NO, No line break(s).
+#
+# - Will event ranking include to the log file.
+#     + YES, Event ranking number added to each line in log file(s). Ranking number 
+#       depends on environment's tics, for example(includes time stamp also)
+#       '012   12.Nov.2003 115958    LOGGING INFO'
+#     + NO, No event ranking.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' 
+
+CreateLogDirectories= YES    # Possible values: YES or NO
+
+EmulatorBasePath= C:\LOGS\TestFramework\
+EmulatorFormat= HTML         # Possible values: TXT or HTML
+EmulatorOutput= FILE         # Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML        # Possible values: TXT or HTML
+#HardwareOutput= FILE        # Possible values: FILE or RDEBUG
+
+FileCreationMode= OVERWRITE  # Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES      # Possible values: YES or NO
+#WithTimeStamp= YES          # Possible values: YES or NO
+#WithLineBreak= YES          # Possible values: YES or NO
+#WithEventRanking= YES       # Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/alfbatchextplugin.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,181 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Batch ext plugin implementation
+*
+*/
+
+
+#include "alfbatchextplugin.h"
+#include "alfbatchextpluginconstants.h"
+#include <implementationproxy.h>
+#include <alf/alfconstants.h>
+#include <alf/alflayouthandlers.h>
+
+class CAlfBatchExtPluginExtension : public CBase, public MAlfExtension
+    {
+    public:
+        ~CAlfBatchExtPluginExtension();
+        virtual void Release();
+        virtual TAny* GetInterface( const THuiInterfaceSupport& aInterface );
+        virtual void HandleCmdL( TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse );
+    private:
+        RArray<TInt> iReceived;
+    };
+
+MAlfExtension* TAlfBatchExtPlugin::CreateExtensionL(
+        const TInt aObjectId, 
+        const TDesC8& /*aInitialParams*/, 
+        MAlfInterfaceProvider& /*aResolver*/ )
+    {
+    MAlfExtension* result = 0;
+    switch( aObjectId )
+        {
+        case EAlfBatchExtPluginCreateExtension:
+            {
+            result = new (ELeave) CAlfBatchExtPluginExtension;
+            break;
+            }  
+
+        default:
+            User::Leave( KErrNotSupported );
+        }
+    return result;
+    }
+
+void TAlfBatchExtPlugin::Release()
+    {
+    delete this;
+    }
+
+CAlfBatchExtPluginExtension::~CAlfBatchExtPluginExtension()
+    {
+    iReceived.Close();
+    }
+
+void CAlfBatchExtPluginExtension::Release()
+    {
+    delete this;
+    }
+
+TAny* CAlfBatchExtPluginExtension::GetInterface( const THuiInterfaceSupport& /*aInterface*/ )
+    {
+    return NULL;
+    }
+
+void CAlfBatchExtPluginExtension::HandleCmdL( TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse )
+    {
+    switch ( aCommandId )
+        {
+        case EAlfBatchExtensionCmdReset:
+            iReceived.Close();
+            break;
+
+        case EAlfBatchExtensionCmdGetCount:
+            {
+            TPckgBuf<TInt> countPckg( iReceived.Count() );
+            aResponse.Copy( countPckg );
+            }
+            break;
+
+        case EAlfBatchExtensionCmdGetIndex:
+            {
+            TInt* param = (TInt*)aInputBuffer.Ptr();
+
+            if ( *param >= 0 && *param < iReceived.Count() )
+                {
+                TPckgBuf<TInt> result( iReceived[ *param ] );
+                aResponse.Copy( result );
+                }
+            else
+                {
+                User::Leave( KErrArgument );
+                }
+            }
+            break;
+
+        case EAlfBatchExtensionCmdInteger:
+            {
+            TInt* param = (TInt*)aInputBuffer.Ptr();
+            iReceived.AppendL( *param );
+            }
+            break;
+
+        case EAlfBatchExtensionCmdReal:
+            {
+            TReal32* param = (TReal32*)aInputBuffer.Ptr();
+            TInt asInteger = *param;
+            iReceived.AppendL( asInteger );
+            }
+            break;
+
+        case EAlfBatchExtensionCmdNotSupported:
+            User::Leave( KErrNotSupported );
+            break;
+
+        default:
+            {
+            if ( aCommandId >= EAlfBatchExtensionCmdBufferMin && 
+                 aCommandId <= EAlfBatchExtensionCmdBufferMax )
+                {
+                const TInt length = aCommandId - EAlfBatchExtensionCmdBufferMin;
+                
+                if ( aInputBuffer.Length() == length )
+                    {
+                    for ( TInt ii = 0; ii < length; ii++ )
+                        {
+                        TUint8 val = (TUint8)ii;
+                        if ( aInputBuffer[ ii ] != val )
+                            {
+                            User::Leave( KErrArgument );
+                            }
+                        }
+                    iReceived.AppendL( aCommandId );
+                    }
+                else
+                    {
+                    User::Leave( KErrArgument );
+                    }
+                }
+            else
+                {
+                User::Leave( KErrNotSupported );
+                }
+            }
+            break;
+        }
+    }
+
+// Global functions:
+
+MAlfExtensionFactory* Instance()
+    {
+    TAlfBatchExtPlugin* me = NULL;
+    me = new TAlfBatchExtPlugin;
+    return me;
+    }
+
+const TImplementationProxy ImplementationTable[] =
+    {
+#ifdef __EABI__
+    {{KAlfBatchExtPluginImplementationId}, (TFuncPtr)Instance}
+#else
+    {{KAlfBatchExtPluginImplementationId}, Instance}
+#endif
+    };
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy) ;
+    return ImplementationTable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,205 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 implement of CTestPlatAlfVisual
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <stiftestinterface.h>
+#include <settingserverclient.h>
+#include <screensaverinternalpskeys.h>
+#include <e32property.h>
+
+
+#include "testplatalfvisual.h"
+
+// CONSTANTS
+_LIT( KModuleName, "testplatalfvisual.dll" );
+
+const TInt KControlGroupId = 1;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::CTestPlatAlfVisual
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+CTestPlatAlfVisual::CTestPlatAlfVisual( CTestModuleIf& aTestModuleIf ):
+    CScriptBase( aTestModuleIf )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::~CTestPlatAlfVisual
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CTestPlatAlfVisual::~CTestPlatAlfVisual()
+    {
+    // Delete logger
+    delete iLog; 
+    
+    // Delete CAlfEnv
+    delete iAlfEnv;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::ConstructL
+// Symbian 2nd phase constructor can leave.
+// -----------------------------------------------------------------------------
+//
+void CTestPlatAlfVisual::ConstructL()
+    {
+    //Read logger settings to check whether test case name is to be
+    //appended to log file name.
+    RSettingServer settingServer;
+    CleanupClosePushL( settingServer );
+    TInt ret = settingServer.Connect();
+    if ( ret != KErrNone )
+        {
+        User::Leave(ret);
+        }
+    // Struct to StifLogger settigs.
+    TLoggerSettings loggerSettings; 
+    // Parse StifLogger defaults from STIF initialization file.
+    ret = settingServer.GetLoggerSettings( loggerSettings );
+    if ( ret != KErrNone )
+        {
+        User::Leave( ret );
+        } 
+    // Close Setting server session
+    settingServer.Close();
+    CleanupStack::PopAndDestroy( &settingServer );
+
+    TFileName logFileName;
+    
+    if ( loggerSettings.iAddTestCaseTitle )
+        {
+        TName title;
+        TestModuleIf().GetTestCaseTitleL( title );
+        logFileName.Format( KtestplatalfvisualLogFileWithTitle, &title );
+        }
+    else
+        {
+        logFileName.Copy( KtestplatalfvisualLogFile );
+        }
+
+    iLog = CStifLogger::NewL( KtestplatalfvisualLogPath, 
+                          logFileName,
+                          CStifLogger::ETxt,
+                          CStifLogger::EFile,
+                          EFalse );
+    
+    SendTestClassVersion();
+    
+    TurnOffScreenSaver();
+    
+    // Create CAlfEnv instance
+    iAlfEnv = CAlfEnv::NewL();
+    
+    TRect rect = CEikonEnv::Static()->AppUiFactory()->ClientRect();
+    iAlfDisplay = &( iAlfEnv->NewDisplayL( rect ) );
+    iAlfCtrlGroup = &( iAlfEnv->NewControlGroupL( KControlGroupId ) );
+    
+    // Create CAlfControl instance
+    iAlfCtl = new ( ELeave ) CAlfControl;
+    iAlfCtl->ConstructL( *iAlfEnv );
+    
+    iAlfCtrlGroup->AppendL( iAlfCtl );
+    
+    iAlfCtl->BindDisplay( *iAlfDisplay );
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CTestPlatAlfVisual* CTestPlatAlfVisual::NewL( CTestModuleIf& aTestModuleIf )
+    {
+    CTestPlatAlfVisual* self = new( ELeave ) CTestPlatAlfVisual( aTestModuleIf );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+
+    }
+
+//-----------------------------------------------------------------------------
+// CTestPlatAlfVisual::SendTestClassVersion
+// Method used to send version of test class
+//-----------------------------------------------------------------------------
+//
+void CTestPlatAlfVisual::SendTestClassVersion()
+    {
+    TVersion moduleVersion;
+    moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR;
+    moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR;
+    moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD;
+
+    TFileName moduleName;
+    moduleName = KModuleName;
+
+    TBool newVersionOfMethod = ETrue;
+    TestModuleIf().SendTestModuleVersion( moduleVersion, moduleName, 
+        newVersionOfMethod );
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point.
+// Returns: CScriptBase: New CScriptBase derived object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CScriptBase* LibEntryL( 
+    CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework
+    {
+    return ( CScriptBase* ) CTestPlatAlfVisual::NewL( aTestModuleIf );
+    }
+
+// -----------------------------------------------------------------------------
+// Turn off ScreenSaver
+// -----------------------------------------------------------------------------
+//
+void CTestPlatAlfVisual::TurnOffScreenSaver()
+    {
+    TInt err1 = RProperty::Get( KPSUidScreenSaver, KScreenSaverAllowScreenSaver, 
+        iOldScreenSaverProperty );
+    TInt err2 = RProperty::Set( KPSUidScreenSaver, KScreenSaverAllowScreenSaver, 
+        KScreenSaverAllowScreenSaver );    
+    RDebug::Printf( "screensaver property=%d err1=%d err2=%d\n", 
+        iOldScreenSaverProperty, err1, err2 );
+    }
+
+// -----------------------------------------------------------------------------
+// Restore ScreenSaver
+// -----------------------------------------------------------------------------
+//
+void CTestPlatAlfVisual::RestoreScreenSaver()
+    {
+    RProperty::Set( KPSUidScreenSaver, KScreenSaverAllowScreenSaver, 
+        iOldScreenSaverProperty );
+    User::ResetInactivityTime();
+    }
+
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocks.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,606 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 function implement of CTestPlatAlfVisual
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::RunMethodL
+// Run specified method. Contains also table of test mothods and their names.
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::RunMethodL( CStifItemParser& aItem ) 
+    {
+
+    static TStifFunctionInfo const KFunctions[] =
+        {  
+        // First string is the function name used in TestScripter script file.
+        // Second is the actual implementation member function.
+        //FOR TEST alfanchorlayout.h        
+        ENTRY( "TestAnchorLayoutAddNewL", CTestPlatAlfVisual::TestAnchorLayoutAddNewL ),
+        ENTRY( "TestAnchorLayoutConstructorL", CTestPlatAlfVisual::TestAnchorLayoutConstructorL ),
+        ENTRY( "TestAnchorLayoutConstructL", CTestPlatAlfVisual::TestAnchorLayoutConstructL ),
+        ENTRY( "TestAnchorLayoutResetL", CTestPlatAlfVisual::TestAnchorLayoutResetL ),
+        ENTRY( "TestAnchorLayoutSetAnchorL", CTestPlatAlfVisual::TestAnchorLayoutSetAnchorL ),
+        ENTRY( "TestAnchorLayoutSetRelativeAnchorRectL", CTestPlatAlfVisual::TestAnchorLayoutSetRelativeAnchorRectL ),
+        ENTRY( "TestAnchorLayoutRemoveAnchorL", CTestPlatAlfVisual::TestAnchorLayoutRemoveAnchorL ),
+        ENTRY( "TestAnchorLayoutAttachEdgeL", CTestPlatAlfVisual::TestAnchorLayoutAttachEdgeL ),
+        ENTRY( "TestAnchorLayoutAttachCornerL", CTestPlatAlfVisual::TestAnchorLayoutAttachCornerL ),
+        ENTRY( "TestAnchorLayoutAttachBoxL", CTestPlatAlfVisual::TestAnchorLayoutAttachBoxL ),
+        ENTRY( "TestAnchorLayoutDetachL", CTestPlatAlfVisual::TestAnchorLayoutDetachL ),
+        ENTRY( "TestAnchorLayoutDetachTypeL", CTestPlatAlfVisual::TestAnchorLayoutDetachTypeL ),
+        ENTRY( "TestAnchorLayoutRemoveAndDestroyAllDL", CTestPlatAlfVisual::TestAnchorLayoutRemoveAndDestroyAllDL ),
+        ENTRY( "TestAnchorLayoutUpdateChildrenLayoutL", CTestPlatAlfVisual::TestAnchorLayoutUpdateChildrenLayoutL ),
+        ENTRY( "TestAnchorLayoutFindTagL", CTestPlatAlfVisual::TestAnchorLayoutFindTagL ),
+        ENTRY( "TestAnchorLayoutBaseUnitL", CTestPlatAlfVisual::TestAnchorLayoutBaseUnitL ),
+        ENTRY( "TestAnchorLayoutDoRemoveAndDestroyAllDL", CTestPlatAlfVisual::TestAnchorLayoutDoRemoveAndDestroyAllDL ),
+        ENTRY( "TestAnchorLayoutPropertyOwnerExtensionL", CTestPlatAlfVisual::TestAnchorLayoutPropertyOwnerExtensionL ),
+        
+        //FOR TEST alfvisual.h
+        ENTRY( "TestCAlfVCAlfVisualL", CTestPlatAlfVisual::TestCAlfVCAlfVisualL ),
+        ENTRY( "TestCAlfVConstructL", CTestPlatAlfVisual::TestCAlfVConstructL ),
+        ENTRY( "TestCAlfVRemoveAndDestroyAllDL", CTestPlatAlfVisual::TestCAlfVRemoveAndDestroyAllDL ),
+        ENTRY( "TestCAlfVIdentifierL", CTestPlatAlfVisual::TestCAlfVIdentifierL ),
+        ENTRY( "TestCAlfVSetFlagL", CTestPlatAlfVisual::TestCAlfVSetFlagL ),
+        ENTRY( "TestCAlfVSetFlagsL", CTestPlatAlfVisual::TestCAlfVSetFlagsL ),
+        ENTRY( "TestCAlfVClearFlagL", CTestPlatAlfVisual::TestCAlfVClearFlagL ),
+        ENTRY( "TestCAlfVClearFlagsL", CTestPlatAlfVisual::TestCAlfVClearFlagsL ),
+        ENTRY( "TestCAlfVFlagsL", CTestPlatAlfVisual::TestCAlfVFlagsL ),
+        ENTRY( "TestCAlfVLayoutL", CTestPlatAlfVisual::TestCAlfVLayoutL ),
+        ENTRY( "TestCAlfVPosL", CTestPlatAlfVisual::TestCAlfVPosL ),
+        ENTRY( "TestCAlfVSetPosL", CTestPlatAlfVisual::TestCAlfVSetPosL ),
+        ENTRY( "TestCAlfVSizeL", CTestPlatAlfVisual::TestCAlfVSizeL ),
+        ENTRY( "TestCAlfVSetSizeL", CTestPlatAlfVisual::TestCAlfVSetSizeL ),
+        ENTRY( "TestCAlfVOpacityL", CTestPlatAlfVisual::TestCAlfVOpacityL ),
+        ENTRY( "TestCAlfVSetOpacityL", CTestPlatAlfVisual::TestCAlfVSetOpacityL ),
+        ENTRY( "TestCAlfVEnvL", CTestPlatAlfVisual::TestCAlfVEnvL ),
+        ENTRY( "TestCAlfVDisplayL", CTestPlatAlfVisual::TestCAlfVDisplayL ),
+        ENTRY( "TestCAlfVTagL", CTestPlatAlfVisual::TestCAlfVTagL ),
+        ENTRY( "TestCAlfVUpdateChildrenLayoutL", CTestPlatAlfVisual::TestCAlfVUpdateChildrenLayoutL ),
+        ENTRY( "TestCAlfVDisplayRectTargetL", CTestPlatAlfVisual::TestCAlfVDisplayRectTargetL ),
+        ENTRY( "TestCAlfVLocalToDisplayL", CTestPlatAlfVisual::TestCAlfVLocalToDisplayL ),
+        ENTRY( "TestCAlfVLocalToDisplayWithRealPointL", CTestPlatAlfVisual::TestCAlfVLocalToDisplayWithRealPointL ),
+        ENTRY( "TestCAlfVDisplayToLocalL", CTestPlatAlfVisual::TestCAlfVDisplayToLocalL ),
+        ENTRY( "TestCAlfVDisplayToLocalWithRealPointL", CTestPlatAlfVisual::TestCAlfVDisplayToLocalWithRealPointL ),
+        ENTRY( "TestCAlfVEnableBrushesL", CTestPlatAlfVisual::TestCAlfVEnableBrushesL ),
+        ENTRY( "TestCAlfVBrushesL", CTestPlatAlfVisual::TestCAlfVBrushesL ),
+        ENTRY( "TestCAlfVMoveToFrontL", CTestPlatAlfVisual::TestCAlfVMoveToFrontL ),
+        ENTRY( "TestCAlfVEnableTransformationL", CTestPlatAlfVisual::TestCAlfVEnableTransformationL ),
+        ENTRY( "TestCAlfVTransformationL", CTestPlatAlfVisual::TestCAlfVTransformationL ),
+        ENTRY( "TestCAlfVSetPaddingL", CTestPlatAlfVisual::TestCAlfVSetPaddingL ),
+        ENTRY( "TestCAlfVSetPaddingWithPointL", CTestPlatAlfVisual::TestCAlfVSetPaddingWithPointL ),
+        ENTRY( "TestCAlfVSetPaddingWithMetricL", CTestPlatAlfVisual::TestCAlfVSetPaddingWithMetricL ),
+        ENTRY( "TestCAlfVPaddingInPixelsL", CTestPlatAlfVisual::TestCAlfVPaddingInPixelsL ),
+        ENTRY( "TestCAlfVSetTagL", CTestPlatAlfVisual::TestCAlfVSetTagL ),
+        ENTRY( "TestCAlfVIsTaggedL", CTestPlatAlfVisual::TestCAlfVIsTaggedL ),
+        ENTRY( "TestCAlfVFindTagL", CTestPlatAlfVisual::TestCAlfVFindTagL ),
+        ENTRY( "TestCAlfVConstructWithMoreParamsL", CTestPlatAlfVisual::TestCAlfVConstructWithMoreParamsL ),
+        ENTRY( "TestCAlfVCommsL", CTestPlatAlfVisual::TestCAlfVCommsL ),
+        ENTRY( "TestCAlfVDepthOffsetL", CTestPlatAlfVisual::TestCAlfVDepthOffsetL ),
+        ENTRY( "TestCAlfVSetDepthOffsetL", CTestPlatAlfVisual::TestCAlfVSetDepthOffsetL ),
+        ENTRY( "TestCAlfVOwnerL", CTestPlatAlfVisual::TestCAlfVOwnerL ),
+        ENTRY( "TestCAlfVSetOwnerL", CTestPlatAlfVisual::TestCAlfVSetOwnerL ),
+        ENTRY( "TestCAlfVSetOriginL", CTestPlatAlfVisual::TestCAlfVSetOriginL ),
+        ENTRY( "TestCAlfVHorizontalOriginL", CTestPlatAlfVisual::TestCAlfVHorizontalOriginL ),
+        ENTRY( "TestCAlfVVerticalOriginL", CTestPlatAlfVisual::TestCAlfVVerticalOriginL ),
+        ENTRY( "TestCAlfVAlignByOriginL", CTestPlatAlfVisual::TestCAlfVAlignByOriginL ),
+        ENTRY( "TestCAlfVSetMinSizeL", CTestPlatAlfVisual::TestCAlfVSetMinSizeL ),
+        ENTRY( "TestCAlfVSetMinSizeWithRealSizeL", CTestPlatAlfVisual::TestCAlfVSetMinSizeWithRealSizeL ),
+        ENTRY( "TestCAlfVMinSizeL", CTestPlatAlfVisual::TestCAlfVMinSizeL ),
+        ENTRY( "TestCAlfVMinSizeInBaseUnitsL", CTestPlatAlfVisual::TestCAlfVMinSizeInBaseUnitsL ),
+        ENTRY( "TestCAlfVSetMaxSizeL", CTestPlatAlfVisual::TestCAlfVSetMaxSizeL ),
+        ENTRY( "TestCAlfVSetMaxSizeWithRealSizeL", CTestPlatAlfVisual::TestCAlfVSetMaxSizeWithRealSizeL ),
+        ENTRY( "TestCAlfVMaxSizeL", CTestPlatAlfVisual::TestCAlfVMaxSizeL ),
+        ENTRY( "TestCAlfVMaxSizeInBaseUnitsL", CTestPlatAlfVisual::TestCAlfVMaxSizeInBaseUnitsL ),
+        ENTRY( "TestCAlfVSetRectL", CTestPlatAlfVisual::TestCAlfVSetRectL ),
+        ENTRY( "TestCAlfVMoveL", CTestPlatAlfVisual::TestCAlfVMoveL ),
+        ENTRY( "TestCAlfVMoveWithRealPointL", CTestPlatAlfVisual::TestCAlfVMoveWithRealPointL ),
+        ENTRY( "TestCAlfVMimicL", CTestPlatAlfVisual::TestCAlfVMimicL ),
+        ENTRY( "TestCAlfVSetCenteredPosAndSizeL", CTestPlatAlfVisual::TestCAlfVSetCenteredPosAndSizeL ),
+        ENTRY( "TestCAlfVSetCenteredPosAndSizeWithRealL", CTestPlatAlfVisual::TestCAlfVSetCenteredPosAndSizeWithRealL ),
+        ENTRY( "TestCAlfVDisplayRectL", CTestPlatAlfVisual::TestCAlfVDisplayRectL ),
+        ENTRY( "TestCAlfVEffectiveOpacityL", CTestPlatAlfVisual::TestCAlfVEffectiveOpacityL ),
+        ENTRY( "TestCAlfVSetClippingL", CTestPlatAlfVisual::TestCAlfVSetClippingL ),
+        ENTRY( "TestCAlfVClippingL", CTestPlatAlfVisual::TestCAlfVClippingL ),
+        ENTRY( "TestCAlfVPaddingL", CTestPlatAlfVisual::TestCAlfVPaddingL ),
+        ENTRY( "TestCAlfVPaddingAsMetricL", CTestPlatAlfVisual::TestCAlfVPaddingAsMetricL ),
+        ENTRY( "TestCAlfVHorizontalPaddingL", CTestPlatAlfVisual::TestCAlfVHorizontalPaddingL ),
+        ENTRY( "TestCAlfVVerticalPaddingL", CTestPlatAlfVisual::TestCAlfVVerticalPaddingL ),
+        ENTRY( "TestCAlfVSetPosWithTimedPointL", CTestPlatAlfVisual::TestCAlfVSetPosWithTimedPointL ),
+        ENTRY( "TestCAlfVSetSizeWithTimedPointL", CTestPlatAlfVisual::TestCAlfVSetSizeWithTimedPointL ),
+        ENTRY( "TestCAlfVCopyValuesL", CTestPlatAlfVisual::TestCAlfVCopyValuesL ),
+        ENTRY( "TestCAlfVPauseL", CTestPlatAlfVisual::TestCAlfVPauseL ),
+        ENTRY( "TestCAlfVResumeL", CTestPlatAlfVisual::TestCAlfVResumeL ),
+        ENTRY( "TestCAlfVDoRemoveAndDestroyAllDL", CTestPlatAlfVisual::TestCAlfVDoRemoveAndDestroyAllDL ),
+        ENTRY( "TestCAlfVSetTactileFeedbackL", CTestPlatAlfVisual::TestCAlfVSetTactileFeedbackL ),
+        ENTRY( "TestCAlfVHasTactileFeedbackL", CTestPlatAlfVisual::TestCAlfVHasTactileFeedbackL ),
+        ENTRY( "TestCAlfVRemoveTactileFeedbackL", CTestPlatAlfVisual::TestCAlfVRemoveTactileFeedbackL ),
+        ENTRY( "TestCAlfVEnableDropShadowL", CTestPlatAlfVisual::TestCAlfVEnableDropShadowL ),
+        ENTRY( "TestCAlfVDropShadowHandlerL", CTestPlatAlfVisual::TestCAlfVDropShadowHandlerL ),
+        ENTRY( "TestCAlfVPropertyOwnerExtensionL", CTestPlatAlfVisual::TestCAlfVPropertyOwnerExtensionL ),
+        
+        //FOR TEST alfvisualfactory.h
+        ENTRY( "TestAlfVFNewLayoutL", CTestPlatAlfVisual::TestAlfVFNewLayoutL ),
+        ENTRY( "TestAlfVFNewLayoutLCL", CTestPlatAlfVisual::TestAlfVFNewLayoutLCL ),
+        ENTRY( "TestAlfVFNewVisualL", CTestPlatAlfVisual::TestAlfVFNewVisualL ),
+        ENTRY( "TestAlfVFNewVisualLCL", CTestPlatAlfVisual::TestAlfVFNewVisualLCL ),
+        
+        //FOR TEST alfcontrol.h
+        ENTRY( "TestAlfCtrlConstructorL", CTestPlatAlfVisual::TestAlfCtrlConstructorL ),
+        ENTRY( "TestAlfCtrlConstructL", CTestPlatAlfVisual::TestAlfCtrlConstructL ),
+        ENTRY( "TestAlfCtrlIdL", CTestPlatAlfVisual::TestAlfCtrlIdL ),
+        ENTRY( "TestAlfCtrlGetCtrlMember", CTestPlatAlfVisual::TestAlfCtrlGetCtrlMember ),
+        ENTRY( "TestAlfCtrlProcessVisualL", CTestPlatAlfVisual::TestAlfCtrlProcessVisualL ),
+        ENTRY( "TestAlfCtrlProcessConnectL", CTestPlatAlfVisual::TestAlfCtrlProcessConnectL ),
+        ENTRY( "TestAlfCtrlProcessRole", CTestPlatAlfVisual::TestAlfCtrlProcessRole ),
+        ENTRY( "TestAlfCtrlProcessHostL", CTestPlatAlfVisual::TestAlfCtrlProcessHostL ),
+        ENTRY( "TestAlfCtrlHostDisplayL", CTestPlatAlfVisual::TestAlfCtrlHostDisplayL ),
+        ENTRY( "TestAlfCtrlDisplayPos", CTestPlatAlfVisual::TestAlfCtrlDisplayPos ),
+        ENTRY( "TestAlfCtrlEventL", CTestPlatAlfVisual::TestAlfCtrlEventL ),
+        ENTRY( "TestAlfCtrlProcessFocus", CTestPlatAlfVisual::TestAlfCtrlProcessFocus ),
+        ENTRY( "TestAlfCtrlLayoutL", CTestPlatAlfVisual::TestAlfCtrlLayoutL ),
+        ENTRY( "TestAlfCtrlIdentifier", CTestPlatAlfVisual::TestAlfCtrlIdentifier ),
+        ENTRY( "TestAlfCtrlBounds", CTestPlatAlfVisual::TestAlfCtrlBounds ),
+        ENTRY( "TestAlfCtrlShowL", CTestPlatAlfVisual::TestAlfCtrlShowL ),
+        ENTRY( "TestAlfCtrlAddAndRemoveVisualL", CTestPlatAlfVisual::TestAlfCtrlAddAndRemoveVisualL ),
+        ENTRY( "TestAlfCtrlNotifyControlVisibilityL", CTestPlatAlfVisual::TestAlfCtrlNotifyControlVisibilityL ),
+        ENTRY( "TestAlfCtrlAddAndRemoveConnectionL", CTestPlatAlfVisual::TestAlfCtrlAddAndRemoveConnectionL ),
+        ENTRY( "TestAlfCtrlHostChangingL", CTestPlatAlfVisual::TestAlfCtrlHostChangingL ),
+        ENTRY( "TestAlfCtrlPropertyOwnerExtensionL", CTestPlatAlfVisual::TestAlfCtrlPropertyOwnerExtensionL ),
+        
+        //FOR TEST alfcontrolgroup.h
+        ENTRY( "TestAlfCtrlGroupResourceId", CTestPlatAlfVisual::TestAlfCtrlGroupResourceId ),
+        ENTRY( "TestAlfCtrlGroupProcessCtrlL", CTestPlatAlfVisual::TestAlfCtrlGroupProcessCtrlL ),
+        ENTRY( "TestAlfCtrlGroupProcessInput", CTestPlatAlfVisual::TestAlfCtrlGroupProcessInput ),
+        ENTRY( "TestAlfCtrlGroupProcessTransformL", CTestPlatAlfVisual::TestAlfCtrlGroupProcessTransformL ),
+        
+        //FOR TEST alfcurvepath.h
+        ENTRY( "TestAlfCurvePathNewL", CTestPlatAlfVisual::TestAlfCurvePathNewL ),
+        ENTRY( "TestAlfCurvePathLoopL", CTestPlatAlfVisual::TestAlfCurvePathLoopL ),
+        ENTRY( "TestAlfCurvePathOffsetL", CTestPlatAlfVisual::TestAlfCurvePathOffsetL ),
+        ENTRY( "TestAlfCurvePathProcessPointsL", CTestPlatAlfVisual::TestAlfCurvePathProcessPointsL ),
+        ENTRY( "TestAlfCurvePathResetL", CTestPlatAlfVisual::TestAlfCurvePathResetL ),
+        ENTRY( "TestAlfCurvePathMappingFunctionIdentifierL", CTestPlatAlfVisual::TestAlfCurvePathMappingFunctionIdentifierL ),
+        
+        //FOR TEST alfcurvepathlayout.h
+        ENTRY( "TestAlfCurvePathLayoutAddNewL", CTestPlatAlfVisual::TestAlfCurvePathLayoutAddNewL ),
+        ENTRY( "TestAlfCurvePathLayoutFullConstructL", CTestPlatAlfVisual::TestAlfCurvePathLayoutFullConstructL ),
+        ENTRY( "TestAlfCurvePathLayoutForLayoutL", CTestPlatAlfVisual::TestAlfCurvePathLayoutForLayoutL ),
+        ENTRY( "TestAlfCurvePathLayoutForVisualL", CTestPlatAlfVisual::TestAlfCurvePathLayoutForVisualL ),
+        ENTRY( "TestAlfCurvePathLayoutForMapL", CTestPlatAlfVisual::TestAlfCurvePathLayoutForMapL ),
+        ENTRY( "TestAlfCurvePathLayoutProtectedFuncL", CTestPlatAlfVisual::TestAlfCurvePathLayoutProtectedFuncL ),
+        
+        //FOR TEST alfdecklayout.h
+        ENTRY( "TestAlfDeckLayoutAddNewL", CTestPlatAlfVisual::TestAlfDeckLayoutAddNewL ),
+        ENTRY( "TestAlfDeckLayoutFullConstructL", CTestPlatAlfVisual::TestAlfDeckLayoutFullConstructL ),
+        ENTRY( "TestAlfDeckLayoutForLayoutL", CTestPlatAlfVisual::TestAlfDeckLayoutForLayoutL ),
+        ENTRY( "TestAlfDeckLayoutForVisualL", CTestPlatAlfVisual::TestAlfDeckLayoutForVisualL ),
+        ENTRY( "TestAlfDeckLayoutProtectedFuncL", CTestPlatAlfVisual::TestAlfDeckLayoutProtectedFuncL ),
+        
+        //FOR TEST alfdisplay.h
+        ENTRY( "TestAlfDisplayForBackgroundL", CTestPlatAlfVisual::TestAlfDisplayForBackgroundL ),
+        ENTRY( "TestAlfDisplayForRoster", CTestPlatAlfVisual::TestAlfDisplayForRoster ),
+        ENTRY( "TestAlfDisplayForVisibleArea", CTestPlatAlfVisual::TestAlfDisplayForVisibleArea ),
+        ENTRY( "TestAlfDisplayForSetAttributesL", CTestPlatAlfVisual::TestAlfDisplayForSetAttributesL ),
+        ENTRY( "TestAlfDisplayGetAttributes", CTestPlatAlfVisual::TestAlfDisplayGetAttributes ),
+        ENTRY( "TestAlfDisplayFading", CTestPlatAlfVisual::TestAlfDisplayFading ),
+        ENTRY( "TestAlfDisplayHandlePointerEventL", CTestPlatAlfVisual::TestAlfDisplayHandlePointerEventL ),
+        
+        //FOR TEST alfdisplaybackgrounditem.h
+        ENTRY( "TestAlfDisplayBgItemConstructor", CTestPlatAlfVisual::TestAlfDisplayBgItemConstructor ),
+        ENTRY( "TestAlfDisplayBgItemSetAttributes", CTestPlatAlfVisual::TestAlfDisplayBgItemSetAttributes ),
+        
+        //FOR TEST alfdropshadow.h
+        ENTRY( "TestAlfDropShadowSetAttributesL", CTestPlatAlfVisual::TestAlfDropShadowSetAttributesL ),
+        
+        //FOR TEST alfdropshadowbrush.h
+        ENTRY( "TestAlfDropShadowBrushNewFuncsL", CTestPlatAlfVisual::TestAlfDropShadowBrushNewFuncsL ),
+        ENTRY( "TestAlfDropShadowBrushSoftnessL", CTestPlatAlfVisual::TestAlfDropShadowBrushSoftnessL ),
+        ENTRY( "TestAlfDropShadowBrushDepthL", CTestPlatAlfVisual::TestAlfDropShadowBrushDepthL ),
+        ENTRY( "TestAlfDropShadowBrushSetColorL", CTestPlatAlfVisual::TestAlfDropShadowBrushSetColorL ),
+        
+        //FOR TEST alfenv.h
+        ENTRY( "TestAlfEnvNewFuncsL", CTestPlatAlfVisual::TestAlfEnvNewFuncsL ),
+        ENTRY( "TestAlfEnvClient", CTestPlatAlfVisual::TestAlfEnvClient ),
+        ENTRY( "TestAlfEnvNewDisplayL", CTestPlatAlfVisual::TestAlfEnvNewDisplayL ),
+        ENTRY( "TestAlfEnvCtrlGroupL", CTestPlatAlfVisual::TestAlfEnvCtrlGroupL ),
+        ENTRY( "TestAlfEnvProcessFresh", CTestPlatAlfVisual::TestAlfEnvProcessFresh ),
+        ENTRY( "TestAlfEnvProcessTextureManagerL", CTestPlatAlfVisual::TestAlfEnvProcessTextureManagerL ),
+        ENTRY( "TestAlfEnvObserverL", CTestPlatAlfVisual::TestAlfEnvObserverL ),
+        ENTRY( "TestAlfEnvProcessCmd", CTestPlatAlfVisual::TestAlfEnvProcessCmd ),
+        ENTRY( "TestAlfEnvKeyAndPointerEventL", CTestPlatAlfVisual::TestAlfEnvKeyAndPointerEventL ),
+        ENTRY( "TestAlfEnvNotifyL", CTestPlatAlfVisual::TestAlfEnvNotifyL ),
+        ENTRY( "TestAlfEnvProcessWidgetL", CTestPlatAlfVisual::TestAlfEnvProcessWidgetL ),
+        ENTRY( "TestAlfEnvGetAttributes", CTestPlatAlfVisual::TestAlfEnvGetAttributes ),
+        ENTRY( "TestAlfEnvFindDisplayIndex", CTestPlatAlfVisual::TestAlfEnvFindDisplayIndex ),
+        ENTRY( "TestAlfEnvFindControl", CTestPlatAlfVisual::TestAlfEnvFindControl ),
+        ENTRY( "TestAlfEnvAddExtension", CTestPlatAlfVisual::TestAlfEnvAddExtension ),
+        ENTRY( "TestAlfEnvSetAndReSetL", CTestPlatAlfVisual::TestAlfEnvSetAndReSetL ),
+        ENTRY( "TestAlfEnvStatic", CTestPlatAlfVisual::TestAlfEnvStatic ),
+        
+        //FOR TEST alfevent.h
+        ENTRY( "TestAlfEventConstructor", CTestPlatAlfVisual::TestAlfEventConstructor ),
+        ENTRY( "TestAlfEventParameters", CTestPlatAlfVisual::TestAlfEventParameters ),
+        ENTRY( "TestAlfEventCustomData", CTestPlatAlfVisual::TestAlfEventCustomData ),
+        ENTRY( "TestAlfEventDisplayAndVisual", CTestPlatAlfVisual::TestAlfEventDisplayAndVisual ),
+        
+        //FOR TEST alfflowlayout.h
+        ENTRY( "TestAlfFlowLayoutAddNewL", CTestPlatAlfVisual::TestAlfFlowLayoutAddNewL ),
+        ENTRY( "TestAlfFlowLayoutFullConstructL", CTestPlatAlfVisual::TestAlfFlowLayoutFullConstructL ),
+        ENTRY( "TestAlfFlowLayoutForLayoutL", CTestPlatAlfVisual::TestAlfFlowLayoutForLayoutL ),
+        ENTRY( "TestAlfFlowLayoutForVisualL", CTestPlatAlfVisual::TestAlfFlowLayoutForVisualL ),
+        ENTRY( "TestAlfFlowLayoutProtectedFuncL", CTestPlatAlfVisual::TestAlfFlowLayoutProtectedFuncL ),
+        ENTRY( "TestAlfFlowLayoutSetParametersL", CTestPlatAlfVisual::TestAlfFlowLayoutSetParametersL ),
+        
+        //FOR TEST alfframebrush.h
+        ENTRY( "TestAlfFrameBrushNewL", CTestPlatAlfVisual::TestAlfFrameBrushNewL ),
+        ENTRY( "TestAlfFrameBrushSetParaL", CTestPlatAlfVisual::TestAlfFrameBrushSetParaL ),
+        
+        //FOR TEST alfgencomponent.h
+        ENTRY( "TestAlfGenComponentNewL", CTestPlatAlfVisual::TestAlfGenComponentNewL ),
+        ENTRY( "TestAlfGenComponentProcessL", CTestPlatAlfVisual::TestAlfGenComponentProcessL ),
+        
+        //FOR TEST alfgradientbrush.h
+        ENTRY( "TestAlfGradientBrushNewL", CTestPlatAlfVisual::TestAlfGradientBrushNewL ),
+        ENTRY( "TestAlfGradientBrushSetL", CTestPlatAlfVisual::TestAlfGradientBrushSetL ),
+        ENTRY( "TestAlfGradientBrushGetL", CTestPlatAlfVisual::TestAlfGradientBrushGetL ),
+        
+        //FOR TEST alfgridlayout.h
+        ENTRY( "TestAlfGridLayoutAddNewL", CTestPlatAlfVisual::TestAlfGridLayoutAddNewL ),
+        ENTRY( "TestAlfGridLayoutFullConstructL", CTestPlatAlfVisual::TestAlfGridLayoutFullConstructL ),
+        ENTRY( "TestAlfGridLayoutForLayoutL", CTestPlatAlfVisual::TestAlfGridLayoutForLayoutL ),
+        ENTRY( "TestAlfGridLayoutForVisualL", CTestPlatAlfVisual::TestAlfGridLayoutForVisualL ),
+        ENTRY( "TestAlfGridLayoutProtectedFuncL", CTestPlatAlfVisual::TestAlfGridLayoutProtectedFuncL ),
+        ENTRY( "TestAlfGridLayoutSetParametersL", CTestPlatAlfVisual::TestAlfGridLayoutSetParametersL ),
+        ENTRY( "TestAlfGridLayoutGetParaL", CTestPlatAlfVisual::TestAlfGridLayoutGetParaL ),
+        
+        //FOR TEST alfimage.h
+        ENTRY( "TestAlfImageConstructorL", CTestPlatAlfVisual::TestAlfImageConstructorL ),
+        ENTRY( "TestAlfImageSetAttributesL", CTestPlatAlfVisual::TestAlfImageSetAttributesL ),
+        ENTRY( "TestAlfImageGetAttributesL", CTestPlatAlfVisual::TestAlfImageGetAttributesL ),
+        
+        //FOR TEST alfimagebrush.h
+        ENTRY( "TestAlfImageBrushNewL", CTestPlatAlfVisual::TestAlfImageBrushNewL ),
+        ENTRY( "TestAlfImageBrushSetAndGetParaL", CTestPlatAlfVisual::TestAlfImageBrushSetAndGetParaL ),
+        
+        //FOR TEST alfimageloaderutil.h
+        ENTRY( "TestAlfImgLoadUtilConstructorL", CTestPlatAlfVisual::TestAlfImgLoadUtilConstructorL ),
+        ENTRY( "TestAlfImgLoadUtilCreateImageLoaderL", CTestPlatAlfVisual::TestAlfImgLoadUtilCreateImageLoaderL ),
+        ENTRY( "TestAlfImgLoadUtilSetL", CTestPlatAlfVisual::TestAlfImgLoadUtilSetL ),
+        ENTRY( "TestAlfAutoSizeImgLoadUtilSetL", CTestPlatAlfVisual::TestAlfAutoSizeImgLoadUtilSetL ),
+        
+        //FOR TEST alfimagevisual.h
+        ENTRY( "TestAlfImgVisualFullConstructorL", CTestPlatAlfVisual::TestAlfImgVisualFullConstructorL ),
+        ENTRY( "TestAlfImgVisualAddNewL", CTestPlatAlfVisual::TestAlfImgVisualAddNewL ),
+        ENTRY( "TestAlfImgVisualSetAndGetL", CTestPlatAlfVisual::TestAlfImgVisualSetAndGetL ),
+        ENTRY( "TestAlfImgVisualForVisualL", CTestPlatAlfVisual::TestAlfImgVisualForVisualL ),
+        ENTRY( "TestAlfImgVisualProtectedFuncL", CTestPlatAlfVisual::TestAlfImgVisualProtectedFuncL ),
+        
+        //FOR TEST alflayout.h
+        ENTRY( "TestAlfLayoutFullConstructorL", CTestPlatAlfVisual::TestAlfLayoutFullConstructorL ),
+        ENTRY( "TestAlfLayoutAddNewL", CTestPlatAlfVisual::TestAlfLayoutAddNewL ),
+        ENTRY( "TestAlfLayoutSetAndGetL", CTestPlatAlfVisual::TestAlfLayoutSetAndGetL ),
+        ENTRY( "TestAlfLayoutForVisualL", CTestPlatAlfVisual::TestAlfLayoutForVisualL ),
+        ENTRY( "TestAlfLayoutBaseUnitL", CTestPlatAlfVisual::TestAlfLayoutBaseUnitL ),
+        ENTRY( "TestAlfLayoutProtectedFuncL", CTestPlatAlfVisual::TestAlfLayoutProtectedFuncL ),
+        
+        //FOR TEST alflinevisual.h
+        ENTRY( "TestAlfLineVisualFullConstructorL", CTestPlatAlfVisual::TestAlfLineVisualFullConstructorL ),
+        ENTRY( "TestAlfLineVisualAddNewL", CTestPlatAlfVisual::TestAlfLineVisualAddNewL ),
+        ENTRY( "TestAlfLineVisualSetAndGetL", CTestPlatAlfVisual::TestAlfLineVisualSetAndGetL ),
+        ENTRY( "TestAlfLineVisualForVisualL", CTestPlatAlfVisual::TestAlfLineVisualForVisualL ),
+        ENTRY( "TestAlfLineVisualProtectedFuncL", CTestPlatAlfVisual::TestAlfLineVisualProtectedFuncL ),
+        
+        //FOR TEST alfm3gmesh.h
+        ENTRY( "TestAlfM3GMeshLoadSceneL", CTestPlatAlfVisual::TestAlfM3GMeshLoadSceneL ),
+        
+        //FOR TEST alfmappingfunctions.h
+        ENTRY( "TestAlfConstantMapFuncL", CTestPlatAlfVisual::TestAlfConstantMapFuncL ),
+        ENTRY( "TestAlfLinearMapFuncL", CTestPlatAlfVisual::TestAlfLinearMapFuncL ),
+        ENTRY( "TestAlfSineMapFuncL", CTestPlatAlfVisual::TestAlfSineMapFuncL ),
+        ENTRY( "TestAlfCosineMapFuncL", CTestPlatAlfVisual::TestAlfCosineMapFuncL ),
+        ENTRY( "TestAlfAverageMapFuncL", CTestPlatAlfVisual::TestAlfAverageMapFuncL ),
+        ENTRY( "TestAlfTableMapFuncL", CTestPlatAlfVisual::TestAlfTableMapFuncL ),
+        
+        //FOR TEST alfmaterial.h
+        ENTRY( "TestAlfMaterialConstructor", CTestPlatAlfVisual::TestAlfMaterialConstructor ),
+        
+        //FOR TEST alfmesh.h
+        ENTRY( "TestAlfMeshSetAndGetL", CTestPlatAlfVisual::TestAlfMeshSetAndGetL ),
+        
+        //FOR TEST alfmeshvisual.h
+        ENTRY( "TestAlfMeshVisualFullConstructorL", CTestPlatAlfVisual::TestAlfMeshVisualFullConstructorL ),
+        ENTRY( "TestAlfMeshVisualAddNewL", CTestPlatAlfVisual::TestAlfMeshVisualAddNewL ),
+        ENTRY( "TestAlfMeshVisualSetAndGetL", CTestPlatAlfVisual::TestAlfMeshVisualSetAndGetL ),
+        ENTRY( "TestAlfMeshVisualForVisualL", CTestPlatAlfVisual::TestAlfMeshVisualForVisualL ),
+        ENTRY( "TestAlfMeshVisualProtectedFuncL", CTestPlatAlfVisual::TestAlfMeshVisualProtectedFuncL ),
+        
+        //FOR TEST alfbatchbuffer.h
+        ENTRY( "TestBBSetAutoFlushModeL", CTestPlatAlfVisual::TestBBSetAutoFlushMode ),
+        ENTRY( "TestBBAutoFlushModeL", CTestPlatAlfVisual::TestBBAutoFlushMode ),
+        ENTRY( "TestBBFlushBatchBufferL", CTestPlatAlfVisual::TestBBFlushBatchBufferL ),
+        ENTRY( "TestBBSetMaxBatchBufferSizeL", CTestPlatAlfVisual::TestBBSetMaxBatchBufferSize ),
+        ENTRY( "TestBBGetBatchBufferInfoL", CTestPlatAlfVisual::TestBBGetBatchBufferInfoL ),
+        
+        //FOR TEST alfborderbrush.h
+        ENTRY( "TestBorderBrushNewL", CTestPlatAlfVisual::TestBorderBrushNewL ),
+        ENTRY( "TestBorderBrushNewLCL", CTestPlatAlfVisual::TestBorderBrushNewLCL ),
+        ENTRY( "TestBorderBrushOffsetNewL", CTestPlatAlfVisual::TestBorderBrushOffsetNewL ),
+        ENTRY( "TestBorderBrushOffsetNewLCL", CTestPlatAlfVisual::TestBorderBrushOffsetNewLCL ),
+        ENTRY( "TestBorderBrushSetImageL", CTestPlatAlfVisual::TestBorderBrushSetImageL ),
+        ENTRY( "TestBorderBrushImageL", CTestPlatAlfVisual::TestBorderBrushImageL ),
+        ENTRY( "TestBorderBrushSetColorL", CTestPlatAlfVisual::TestBorderBrushSetColorL ),
+        ENTRY( "TestBorderBrushThicknessL", CTestPlatAlfVisual::TestBorderBrushThicknessL ),
+        ENTRY( "TestBorderBrushSetThicknessL", CTestPlatAlfVisual::TestBorderBrushSetThicknessL ),
+        ENTRY( "TestBorderBrushSetThicknessMetricL", CTestPlatAlfVisual::TestBorderBrushSetThicknessMetricL ),
+        ENTRY( "TestBorderBrushEdgeOffsetL", CTestPlatAlfVisual::TestBorderBrushEdgeOffsetL ),
+        ENTRY( "TestBorderBrushSetEdgeOffsetL", CTestPlatAlfVisual::TestBorderBrushSetEdgeOffsetL ),
+        ENTRY( "TestBorderBrushSetEdgeOffsetMetricL", CTestPlatAlfVisual::TestBorderBrushSetEdgeOffsetMetricL ),
+        ENTRY( "TestBorderBrushImageOffsetL", CTestPlatAlfVisual::TestBorderBrushImageOffsetL ),
+        ENTRY( "TestBorderBrushSetImageOffsetL", CTestPlatAlfVisual::TestBorderBrushSetImageOffsetL ),
+        ENTRY( "TestBorderBrushSetImageOffsetMetricL", CTestPlatAlfVisual::TestBorderBrushSetImageOffsetMetricL ),
+        
+        //FOR TEST alfviewportlayout.h
+        ENTRY( "TestVpLayoutAddNewL", CTestPlatAlfVisual::TestVpLayoutAddNewL ),
+        ENTRY( "TestVpLayoutConstructorL", CTestPlatAlfVisual::TestVpLayoutConstructorL ),
+        ENTRY( "TestVpLayoutConstructL", CTestPlatAlfVisual::TestVpLayoutConstructL ),
+        ENTRY( "TestVpLayoutSetVirtualSizeL", CTestPlatAlfVisual::TestVpLayoutSetVirtualSizeL ),
+        ENTRY( "TestVpLayoutSetViewportSizeL", CTestPlatAlfVisual::TestVpLayoutSetViewportSizeL ),
+        ENTRY( "TestVpLayoutSetViewportPosL", CTestPlatAlfVisual::TestVpLayoutSetViewportPosL ),
+        ENTRY( "TestVpLayoutRemoveAndDestroyAllDL", CTestPlatAlfVisual::TestVpLayoutRemoveAndDestroyAllDL ),
+        ENTRY( "TestVpLayoutUpdateChildrenLayoutL", CTestPlatAlfVisual::TestVpLayoutUpdateChildrenLayoutL ),
+        ENTRY( "TestVpLayoutFindTagL", CTestPlatAlfVisual::TestVpLayoutFindTagL ),
+        ENTRY( "TestVpLayoutBaseUnitL", CTestPlatAlfVisual::TestVpLayoutBaseUnitL ),
+        ENTRY( "TestVpLayoutDoRemoveAndDestroyAllDL", CTestPlatAlfVisual::TestVpLayoutDoRemoveAndDestroyAllDL ),
+        ENTRY( "TestVpLayoutPropertyOwnerExtensionL", CTestPlatAlfVisual::TestVpLayoutPropertyOwnerExtensionL ),
+        
+        //FOR TEST alfutil.h
+        ENTRY( "TestUtilPower2", CTestPlatAlfVisual::TestUtilPower2 ),
+        ENTRY( "TestUtilPower2RoundDown", CTestPlatAlfVisual::TestUtilPower2RoundDown ),
+        ENTRY( "TestUtilInterpolate", CTestPlatAlfVisual::TestUtilInterpolate ),
+        ENTRY( "TestUtilWrapValue", CTestPlatAlfVisual::TestUtilWrapValue ),
+        ENTRY( "TestUtilRandomInt", CTestPlatAlfVisual::TestUtilRandomInt ),
+        ENTRY( "TestUtilRandomReal", CTestPlatAlfVisual::TestUtilRandomReal ),
+        ENTRY( "TestUtilQuickLengthWithPoint", CTestPlatAlfVisual::TestUtilQuickLengthWithPoint ),
+        ENTRY( "TestUtilQuickLength", CTestPlatAlfVisual::TestUtilQuickLength ),
+        ENTRY( "TestUtilQuickNormalize", CTestPlatAlfVisual::TestUtilQuickNormalize ),
+        ENTRY( "TestUtilQuickNormalizeWithVector", CTestPlatAlfVisual::TestUtilQuickNormalizeWithVector ),
+        ENTRY( "TestUtilCrossProduct", CTestPlatAlfVisual::TestUtilCrossProduct ),
+        ENTRY( "TestUtilNormalFromPoints", CTestPlatAlfVisual::TestUtilNormalFromPoints ),
+        ENTRY( "TestUtilShadowMatrix", CTestPlatAlfVisual::TestUtilShadowMatrix ),
+        ENTRY( "TestUtilFreeMemory", CTestPlatAlfVisual::TestUtilFreeMemory ),
+        ENTRY( "TestUtilScreenSize", CTestPlatAlfVisual::TestUtilScreenSize ),
+        ENTRY( "TestUtilNearestFontInTwipsL", CTestPlatAlfVisual::TestUtilNearestFontInTwipsL ),
+        ENTRY( "TestUtilReleaseFont", CTestPlatAlfVisual::TestUtilReleaseFont ),
+        ENTRY( "TestUtilLengthUnit", CTestPlatAlfVisual::TestUtilLengthUnit ),
+        ENTRY( "TestUtilColorLightness", CTestPlatAlfVisual::TestUtilColorLightness ),
+        ENTRY( "TestUtilScaleFbsBitmapL", CTestPlatAlfVisual::TestUtilScaleFbsBitmapL ),
+        ENTRY( "TestUtilCombineMaskFbsBitmapL", CTestPlatAlfVisual::TestUtilCombineMaskFbsBitmapL ),
+        ENTRY( "TestUtilCropFbsBitmapL", CTestPlatAlfVisual::TestUtilCropFbsBitmapL ),
+        ENTRY( "TestUtilScaleImageL", CTestPlatAlfVisual::TestUtilScaleImageL ),
+        ENTRY( "TestUtilCropImageL", CTestPlatAlfVisual::TestUtilCropImageL ),
+        ENTRY( "TestUtilTagMatches", CTestPlatAlfVisual::TestUtilTagMatches ),
+        ENTRY( "TestUtilConvertBitmapToDisplayModeLCL", CTestPlatAlfVisual::TestUtilConvertBitmapToDisplayModeLCL ),
+        ENTRY( "TestUtilThemeItemIdL", CTestPlatAlfVisual::TestUtilThemeItemIdL ),
+        
+        //FOR TEST alftransformation.h
+        ENTRY( "TestTransNewL", CTestPlatAlfVisual::TestTransNewL ),
+        ENTRY( "TestTransNewLCL", CTestPlatAlfVisual::TestTransNewLCL ),
+        ENTRY( "TestTransCountL", CTestPlatAlfVisual::TestTransCountL ),
+        ENTRY( "TestTransNonIdentityCountL", CTestPlatAlfVisual::TestTransNonIdentityCountL ),
+        ENTRY( "TestTransStepL", CTestPlatAlfVisual::TestTransStepL ),
+        ENTRY( "TestTransReplaceStepL", CTestPlatAlfVisual::TestTransReplaceStepL ),
+        ENTRY( "TestTransLoadIdentityL", CTestPlatAlfVisual::TestTransLoadIdentityL ),
+        ENTRY( "TestTransTranslateL", CTestPlatAlfVisual::TestTransTranslateL ),
+        ENTRY( "TestTransScaleL", CTestPlatAlfVisual::TestTransScaleL ),
+        ENTRY( "TestTransRotateL", CTestPlatAlfVisual::TestTransRotateL ),
+        
+        //FOR TEST alftimedvalue.h
+        ENTRY( "TestTimedValueConstructor", CTestPlatAlfVisual::TestTimedValueConstructor ),
+        ENTRY( "TestTimedValueValueNow", CTestPlatAlfVisual::TestTimedValueValueNow ),
+        ENTRY( "TestTimedValueTargetAndSpeed", CTestPlatAlfVisual::TestTimedValueTargetAndSpeed ),
+        ENTRY( "TestTimedValueStyle", CTestPlatAlfVisual::TestTimedValueStyle ),
+        ENTRY( "TestTimedValueMappingFunctionIdentifier", CTestPlatAlfVisual::TestTimedValueMappingFunctionIdentifier ),
+        ENTRY( "TestTimedValueFlags", CTestPlatAlfVisual::TestTimedValueFlags ),
+        ENTRY( "TestRealPointMethods", CTestPlatAlfVisual::TestRealPointMethods ),
+        ENTRY( "TestRealSizeMethods", CTestPlatAlfVisual::TestRealSizeMethods ),
+        ENTRY( "TestRealRectMethods", CTestPlatAlfVisual::TestRealRectMethods ),
+        ENTRY( "TestTimedPointConstructor", CTestPlatAlfVisual::TestTimedPointConstructor ),
+        ENTRY( "TestTimedPointSetStyle", CTestPlatAlfVisual::TestTimedPointSetStyle ),
+        ENTRY( "TestTimedPointSetMapFuncIdentifier", CTestPlatAlfVisual::TestTimedPointSetMapFuncIdentifier ),
+        ENTRY( "TestTimedPointTargetMethods", CTestPlatAlfVisual::TestTimedPointTargetMethods ),
+        ENTRY( "TestTimedPointValueNowMethods", CTestPlatAlfVisual::TestTimedPointValueNowMethods ),
+        
+        //FOR TEST alftextvisual.h
+        ENTRY( "TestTxtVisualAddNewL", CTestPlatAlfVisual::TestTxtVisualAddNewL ),
+        ENTRY( "TestTxtVisualConstructorL", CTestPlatAlfVisual::TestTxtVisualConstructorL ),
+        ENTRY( "TestTxtVisualConstructL", CTestPlatAlfVisual::TestTxtVisualConstructL ),
+        ENTRY( "TestTxtVisualTxtMethodsL", CTestPlatAlfVisual::TestTxtVisualTxtMethodsL ),
+        ENTRY( "TestTxtVisualStyleMethodsL", CTestPlatAlfVisual::TestTxtVisualStyleMethodsL ),
+        ENTRY( "TestTxtVisualSetAlignL", CTestPlatAlfVisual::TestTxtVisualSetAlignL ),
+        ENTRY( "TestTxtVisualSetLineSpacingL", CTestPlatAlfVisual::TestTxtVisualSetLineSpacingL ),
+        ENTRY( "TestTxtVisualExtentsMethodsL", CTestPlatAlfVisual::TestTxtVisualExtentsMethodsL ),
+        ENTRY( "TestTxtVisualMaxLineCountMethodsL", CTestPlatAlfVisual::TestTxtVisualMaxLineCountMethodsL ),
+        ENTRY( "TestTxtVisualWrappingMethodsL", CTestPlatAlfVisual::TestTxtVisualWrappingMethodsL ),
+        ENTRY( "TestTxtVisualBackgroundTypeL", CTestPlatAlfVisual::TestTxtVisualBackgroundTypeL ),
+        ENTRY( "TestTxtVisualShadowOpacityMethodsL", CTestPlatAlfVisual::TestTxtVisualShadowOpacityMethodsL ),
+        ENTRY( "TestTxtVisualColorMethodsL", CTestPlatAlfVisual::TestTxtVisualColorMethodsL ),
+        ENTRY( "TestTxtVisualEnableShadowL", CTestPlatAlfVisual::TestTxtVisualEnableShadowL ),
+        ENTRY( "TestTxtVisualOffsetMethodsL", CTestPlatAlfVisual::TestTxtVisualOffsetMethodsL ),
+        ENTRY( "TestTxtVisualRemoveAndDestroyAllDL", CTestPlatAlfVisual::TestTxtVisualRemoveAndDestroyAllDL ),
+        ENTRY( "TestTxtVisualUpdateChildrenLayoutL", CTestPlatAlfVisual::TestTxtVisualUpdateChildrenLayoutL ),
+        ENTRY( "TestTxtVisualFindTagL", CTestPlatAlfVisual::TestTxtVisualFindTagL ),
+        ENTRY( "TestTxtVisualSetHighlightRangeL", CTestPlatAlfVisual::TestTxtVisualSetHighlightRangeL ),
+        ENTRY( "TestTxtVisualProtectedMethodsL", CTestPlatAlfVisual::TestTxtVisualProtectedMethodsL ),
+        
+        //FOR TEST alftextureprocessor.h
+        ENTRY( "TestTxtProcessorBlurL", CTestPlatAlfVisual::TestTxtProcessorBlurL ),
+        
+        //FOR TEST alftexturegroup.h
+        ENTRY( "TestTxtGroupNewL", CTestPlatAlfVisual::TestTxtGroupNewL ),
+        ENTRY( "TestTxtGroupNewLCL", CTestPlatAlfVisual::TestTxtGroupNewLCL ),
+        ENTRY( "TestTxtGroupTextureMethodsL", CTestPlatAlfVisual::TestTxtGroupTextureMethodsL ),
+        ENTRY( "TestTxtGroupIsLoadingCompletedL", CTestPlatAlfVisual::TestTxtGroupIsLoadingCompletedL ),
+        ENTRY( "TestTxtGroupObserverMethodsL", CTestPlatAlfVisual::TestTxtGroupObserverMethodsL ),
+        
+        //FOR TEST alftexturemanager.h
+        ENTRY( "TestTxtMgrEnv", CTestPlatAlfVisual::TestTxtMgrEnv ),
+        ENTRY( "TestTxtMgrTextureL", CTestPlatAlfVisual::TestTxtMgrTextureL ),
+        ENTRY( "TestTxtMgrImagePathL", CTestPlatAlfVisual::TestTxtMgrImagePathL ),
+        ENTRY( "TestTxtMgrBlankTexture", CTestPlatAlfVisual::TestTxtMgrBlankTexture ),
+        ENTRY( "TestTxtMgrLoadTextureL", CTestPlatAlfVisual::TestTxtMgrLoadTextureL ),
+        ENTRY( "TestTxtMgrCreateTextureL", CTestPlatAlfVisual::TestTxtMgrCreateTextureL ),
+        ENTRY( "TestTxtMgrUnloadTextureL", CTestPlatAlfVisual::TestTxtMgrUnloadTextureL ),
+        ENTRY( "TestTxtMgrUpdateTextureL", CTestPlatAlfVisual::TestTxtMgrUpdateTextureL ),
+        ENTRY( "TestTxtMgrDefineFileNameL", CTestPlatAlfVisual::TestTxtMgrDefineFileNameL ),
+        ENTRY( "TestTxtMgrPrependImagePath", CTestPlatAlfVisual::TestTxtMgrPrependImagePath ),
+        ENTRY( "TestTxtMgrObserverMethodsL", CTestPlatAlfVisual::TestTxtMgrObserverMethodsL ),
+        ENTRY( "TestTxtMgrProcessor", CTestPlatAlfVisual::TestTxtMgrProcessor ),
+        ENTRY( "TestTxtMgrSetAutomaticTextureIdRange", CTestPlatAlfVisual::TestTxtMgrSetAutomaticTextureIdRange ),
+        ENTRY( "TestTxtMgrIsLoadedL", CTestPlatAlfVisual::TestTxtMgrIsLoadedL ),
+        ENTRY( "TestTxtMgrTextureIdL", CTestPlatAlfVisual::TestTxtMgrTextureIdL ),
+        
+        //FOR TEST alfstatic.h
+        ENTRY( "TestStaticEnv", CTestPlatAlfVisual::TestStaticEnv ),
+        
+        //FOR TEST alfsymbiansbdrawer.h
+        ENTRY( "TestBufDrawerDrawBufferL", CTestPlatAlfVisual::TestBufDrawerDrawBufferL ),
+        ENTRY( "TestBufDrawerGetBufferBitmapsL", CTestPlatAlfVisual::TestBufDrawerGetBufferBitmapsL ),
+        ENTRY( "TestBufDrawerReleaseDrawerL", CTestPlatAlfVisual::TestBufDrawerReleaseDrawerL ),
+        
+        //FOR TEST alftextstylemanager.h
+        ENTRY( "TestStyleMgrTextStyleMethodsL", CTestPlatAlfVisual::TestStyleMgrTextStyleMethodsL ),
+        
+        //FOR TEST alftextstyle.h
+        ENTRY( "TestStyleParentIdL", CTestPlatAlfVisual::TestStyleParentIdL ),
+        ENTRY( "TestStyleIdL", CTestPlatAlfVisual::TestStyleIdL ),
+        ENTRY( "TestStyleTextColorL", CTestPlatAlfVisual::TestStyleTextColorL ),
+        ENTRY( "TestStyleTextSizeL", CTestPlatAlfVisual::TestStyleTextSizeL ),
+        ENTRY( "TestStyleBoldL", CTestPlatAlfVisual::TestStyleBoldL ),
+        ENTRY( "TestStyleItalicL", CTestPlatAlfVisual::TestStyleItalicL ),
+        ENTRY( "TestStyleUnderlineL", CTestPlatAlfVisual::TestStyleUnderlineL ),
+        ENTRY( "TestStyleStrikeThroughL", CTestPlatAlfVisual::TestStyleStrikeThroughL ),
+        ENTRY( "TestStyleTypefaceNameL", CTestPlatAlfVisual::TestStyleTypefaceNameL ),
+        ENTRY( "TestStyleSetTextPaneHeightInPixelsL", CTestPlatAlfVisual::TestStyleSetTextPaneHeightInPixelsL ),
+        
+        //FOR TEST alftexture.h
+        ENTRY( "TestTextureGetMethods", CTestPlatAlfVisual::TestTextureGetMethods ),
+        ENTRY( "TestTextureAnimation", CTestPlatAlfVisual::TestTextureAnimation ),
+        ENTRY( "TestTextureSetMethodsL", CTestPlatAlfVisual::TestTextureSetMethodsL ),
+        
+        //FOR TEST alftextureautosizeparams.h
+        ENTRY( "TestTxtAutoSizeParamsConstructor", CTestPlatAlfVisual::TestTxtAutoSizeParamsConstructor ),
+        ENTRY( "TestTxtAutoSizeParamsGetMethods", CTestPlatAlfVisual::TestTxtAutoSizeParamsGetMethods ),
+        ENTRY( "TestTxtAutoSizeParamsSetMethods", CTestPlatAlfVisual::TestTxtAutoSizeParamsSetMethods ),
+        
+        //FOR TEST alfshadowborderbrush.h
+        ENTRY( "TestShadowBBNewL", CTestPlatAlfVisual::TestShadowBBNewL ),
+        ENTRY( "TestShadowBBNewLCL", CTestPlatAlfVisual::TestShadowBBNewLCL ),
+        ENTRY( "TestShadowBBWidthMethodsL", CTestPlatAlfVisual::TestShadowBBWidthMethodsL ),
+        
+        //FOR TEST alfpropertyowner.h
+        ENTRY( "TestPropOwnerConstructorL", CTestPlatAlfVisual::TestPropOwnerConstructorL ),
+        ENTRY( "TestPropOwnerPropertyRemoveL", CTestPlatAlfVisual::TestPropOwnerPropertyRemoveL ),
+        ENTRY( "TestPropOwnerPropertyClearL", CTestPlatAlfVisual::TestPropOwnerPropertyClearL ),
+        ENTRY( "TestPropOwnerPropertyStringL", CTestPlatAlfVisual::TestPropOwnerPropertyStringL ),
+        ENTRY( "TestPropOwnerCopyPropertyL", CTestPlatAlfVisual::TestPropOwnerCopyPropertyL ),
+        ENTRY( "TestPropOwnerPropertyOwnerExtensionL", CTestPlatAlfVisual::TestPropOwnerPropertyOwnerExtensionL ),
+        
+        //FOR TEST alfroster.h
+        ENTRY( "TestRosterCtrlGroupMethodsL", CTestPlatAlfVisual::TestRosterCtrlGroupMethodsL ),
+        ENTRY( "TestRosterCtrlMethodsL", CTestPlatAlfVisual::TestRosterCtrlMethodsL ),
+        ENTRY( "TestRosterVisualMethodsL", CTestPlatAlfVisual::TestRosterVisualMethodsL ),
+        ENTRY( "TestRosterPointerEventObserverMethodsL", CTestPlatAlfVisual::TestRosterPointerEventObserverMethodsL ),
+        ENTRY( "TestRosterSetPointerDragThresholdL", CTestPlatAlfVisual::TestRosterSetPointerDragThresholdL ),
+        ENTRY( "TestRosterDisableLongTapEventsWhenDraggingL", CTestPlatAlfVisual::TestRosterDisableLongTapEventsWhenDraggingL ),
+        ENTRY( "TestRosterCtrlGroupOrderChangedObserverL", CTestPlatAlfVisual::TestRosterCtrlGroupOrderChangedObserverL ),
+        
+        //FOR TEST alfscreenbuffer.h
+        ENTRY( "TestScrBufNewLMethodsL", CTestPlatAlfVisual::TestScrBufNewLMethodsL ),
+        ENTRY( "TestScrBufGetMethodsL", CTestPlatAlfVisual::TestScrBufGetMethodsL ),
+        ENTRY( "TestScrBufRequestMethodsL", CTestPlatAlfVisual::TestScrBufRequestMethodsL ),
+        ENTRY( "TestScrBufObserverMethodsL", CTestPlatAlfVisual::TestScrBufObserverMethodsL ),
+        
+        //FOR TEST alfscrollerevent.h
+        ENTRY( "TestScrollEventMethods", CTestPlatAlfVisual::TestScrollEventMethods ),
+        
+        //FOR TEST alfmetric.h
+        ENTRY( "TestMetricMethods", CTestPlatAlfVisual::TestMetricMethods ),
+        ENTRY( "TestXYMetricMethods", CTestPlatAlfVisual::TestXYMetricMethods ),
+        ENTRY( "TestBoxMetricMethods", CTestPlatAlfVisual::TestBoxMetricMethods ),
+        
+        //FOR TEST alfproceduralmesh.h
+        ENTRY( "TestProMeshMakeMethodsL", CTestPlatAlfVisual::TestProMeshMakeMethodsL ),
+        ENTRY( "TestProMeshMaterialMethodsL", CTestPlatAlfVisual::TestProMeshMaterialMethodsL ),
+        
+        //FOR TEST alfcommand.h
+        ENTRY( "TestCmdMethods", CTestPlatAlfVisual::TestCmdMethods ),
+        ENTRY( "TestActCmdMethodsL", CTestPlatAlfVisual::TestActCmdMethodsL ),
+        ENTRY( "TestObjCmdMethodsL", CTestPlatAlfVisual::TestObjCmdMethodsL ),
+        ENTRY( "TestGroupCmdMethodsL", CTestPlatAlfVisual::TestGroupCmdMethodsL ),
+        ENTRY( "TestCtrlCmdMethodsL", CTestPlatAlfVisual::TestCtrlCmdMethodsL ),
+        ENTRY( "TestVisualCmdMethodsL", CTestPlatAlfVisual::TestVisualCmdMethodsL ),
+        ENTRY( "TestImageCmdMethodsL", CTestPlatAlfVisual::TestImageCmdMethodsL ),
+        ENTRY( "TestTextCmdMethodsL", CTestPlatAlfVisual::TestTextCmdMethodsL ),
+        ENTRY( "TestValueCmdMethodsL", CTestPlatAlfVisual::TestValueCmdMethodsL ),
+        ENTRY( "TestPointCmdMethodsL", CTestPlatAlfVisual::TestPointCmdMethodsL ),
+        ENTRY( "TestTransCmdMethodsL", CTestPlatAlfVisual::TestTransCmdMethodsL ),
+        ENTRY( "TestMarkerCmdMethodsL", CTestPlatAlfVisual::TestMarkerCmdMethodsL ),
+        ENTRY( "TestCustomEventCmdMethodsL", CTestPlatAlfVisual::TestCustomEventCmdMethodsL ),
+        
+        //FOR TEST alfbrush.h
+        ENTRY( "TestAlfBrushOpacityL", CTestPlatAlfVisual::TestAlfBrushOpacityL ),
+        ENTRY( "TestAlfBrushSetOpacityL", CTestPlatAlfVisual::TestAlfBrushSetOpacityL ),
+        ENTRY( "TestAlfBrushSetLayerL", CTestPlatAlfVisual::TestAlfBrushSetLayerL ),
+        ENTRY( "TestAlfBrushSetClipToVisualL", CTestPlatAlfVisual::TestAlfBrushSetClipToVisualL ),
+        ENTRY( "TestAlfBrushClipToVisualL", CTestPlatAlfVisual::TestAlfBrushClipToVisualL ),
+        ENTRY( "TestAlfBrushIdentifierL", CTestPlatAlfVisual::TestAlfBrushIdentifierL ),
+        ENTRY( "TestAlfBrushCommsL", CTestPlatAlfVisual::TestAlfBrushCommsL ),
+        ENTRY( "TestAlfBrushConstructLWithParamL", CTestPlatAlfVisual::TestAlfBrushConstructLWithParamL ),
+        ENTRY( "TestAlfBrushConstructL", CTestPlatAlfVisual::TestAlfBrushConstructL ),
+        ENTRY( "TestAlfBrushPropertyOwnerExtL", CTestPlatAlfVisual::TestAlfBrushPropertyOwnerExtL ),
+        
+        //FOR TEST alfbrusharray.h
+        ENTRY( "TestBrushArrayResetL", CTestPlatAlfVisual::TestBrushArrayResetL ),
+        ENTRY( "TestBrushArrayAppendL", CTestPlatAlfVisual::TestBrushArrayAppendL ),
+        ENTRY( "TestBrushArrayInsertL", CTestPlatAlfVisual::TestBrushArrayInsertL ),
+        ENTRY( "TestBrushArrayRemoveL", CTestPlatAlfVisual::TestBrushArrayRemoveL ),
+        ENTRY( "TestBrushArrayCountL", CTestPlatAlfVisual::TestBrushArrayCountL ),
+        ENTRY( "TestBrushArrayOperatorL", CTestPlatAlfVisual::TestBrushArrayOperatorL ),
+        ENTRY( "TestBrushArrayAtL", CTestPlatAlfVisual::TestBrushArrayAtL ),
+
+        // [test cases entries]
+
+        };
+
+    const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo );
+
+    return RunInternalL( KFunctions, count, aItem );
+
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksanchorlayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,551 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 function implement of CTestPlatAlfVisual
+*
+*/
+
+
+// [INCLUDE FILES]
+#include <alf/alfanchorlayout.h>
+#include <alf/alfcontrol.h>
+#include <alf/alfenv.h>
+#include <alf/alftextvisual.h>
+#include <alf/alfmetric.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TReal32 KRealX = 10.0;
+const TReal32 KRealY = 10.0;
+const TReal32 KRealWidth = 100.0;
+const TReal32 KRealHeight = 100.0;
+
+const TReal32 KValueNow = 0.3;
+
+//for test alfanchorlayout.h protected
+class CTestAlfAnchorLayout : public CAlfAnchorLayout
+    {
+public:
+    /**
+     * From CAlfAnchorLayout
+     */
+    void DoRemoveAndDestroyAllD()
+        {
+        CAlfAnchorLayout::DoRemoveAndDestroyAllD();
+        }
+    
+    /**
+     * From CAlfAnchorLayout
+     */
+    void PropertyOwnerExtension( const TUid& aExtensionUid, TAny** aExtensionParams )
+        {
+        CAlfAnchorLayout::PropertyOwnerExtension( aExtensionUid, aExtensionParams );
+        }
+    
+    };
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutAddNewL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutAddNewL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutAddNewL, "TestAnchorLayoutAddNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutAddNewL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutAddNewL );
+
+    CAlfAnchorLayout* layout = CAlfAnchorLayout::AddNewL( *iAlfCtl );
+
+    STIF_ASSERT_NOT_NULL( layout );
+    
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutConstructorL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutConstructorL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutConstructorL, "TestAnchorLayoutConstructorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutConstructorL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutConstructorL );
+
+    CAlfAnchorLayout* layout = new ( ELeave ) CAlfAnchorLayout();
+    CleanupStack::PushL( layout );
+    STIF_ASSERT_NOT_NULL( layout );
+    CleanupStack::PopAndDestroy( layout );
+    
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutConstructL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutConstructL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutConstructL, "TestAnchorLayoutConstructL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutConstructL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutConstructL );
+
+    CAlfAnchorLayout* layout = new ( ELeave ) CAlfAnchorLayout();
+    CleanupStack::PushL( layout );
+    layout->ConstructL( *iAlfCtl );
+
+    CleanupStack::PopAndDestroy( layout );
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutResetL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutResetL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutResetL, "TestAnchorLayoutResetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutResetL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutResetL );
+
+    CAlfAnchorLayout* layout = CAlfAnchorLayout::AddNewL( *iAlfCtl );
+    layout->SetSize( TAlfRealSize( KRealWidth, KRealHeight ) );
+    layout->SetPos( TAlfRealPoint( KRealX, KRealY ) );
+    
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+
+    layout->Reset();
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutSetAnchorL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutSetAnchorL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutSetAnchorL, "TestAnchorLayoutSetAnchorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutSetAnchorL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutSetAnchorL );
+    
+    CAlfAnchorLayout* layout = CAlfAnchorLayout::AddNewL( *iAlfCtl );
+    layout->SetSize( TAlfRealSize( KRealWidth, KRealHeight ) );
+    layout->SetPos( TAlfRealPoint( KRealX, KRealY ) );
+    
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    
+    TAlfTimedPoint point;
+    point.iX.SetValueNow( 0.1 );
+    point.iY.SetValueNow( 0.2 );
+    layout->SetAnchor( EAlfAnchorTopLeft, 0, EAlfAnchorOriginLeft,
+                       EAlfAnchorOriginTop, EAlfAnchorMetricRelativeToSize,
+                       EAlfAnchorMetricRelativeToSize, point );
+
+    point.iX.SetValueNow( KValueNow );
+    point.iY.SetValueNow( KValueNow );
+    layout->SetAnchor( EAlfAnchorBottomRight, 0,
+                       EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
+                       EAlfAnchorMetricRelativeToSize,
+                       EAlfAnchorMetricRelativeToSize, point );
+
+    layout->UpdateChildrenLayout();
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutSetRelativeAnchorRectL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutSetRelativeAnchorRectL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutSetRelativeAnchorRectL, "TestAnchorLayoutSetRelativeAnchorRectL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutSetRelativeAnchorRectL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutSetRelativeAnchorRectL );
+
+    CAlfAnchorLayout* layout = CAlfAnchorLayout::AddNewL( *iAlfCtl );
+    layout->SetSize( TAlfRealSize( KRealWidth, KRealHeight ) );
+    layout->SetPos( TAlfRealPoint( KRealX, KRealY ) );
+    
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    
+    TAlfRealPoint topLeftOffset;
+    TAlfRealPoint bottomRightOffset;
+         
+    layout->SetRelativeAnchorRect( 0, EAlfAnchorOriginLeft,
+                                   EAlfAnchorOriginBottom,
+                                   topLeftOffset,
+                                   EAlfAnchorOriginLeft,
+                                   EAlfAnchorOriginBottom,
+                                   bottomRightOffset );
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutRemoveAnchorL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutRemoveAnchorL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutRemoveAnchorL, "TestAnchorLayoutRemoveAnchorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutRemoveAnchorL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutRemoveAnchorL );
+
+    CAlfAnchorLayout* layout = CAlfAnchorLayout::AddNewL( *iAlfCtl );
+    layout->SetSize( TAlfRealSize( KRealWidth, KRealHeight ) );
+    layout->SetPos( TAlfRealPoint( KRealX, KRealY ) );
+    
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+
+    layout->RemoveAnchor( EAlfAnchorTopLeft, 0 );
+    
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutAttachEdgeL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutAttachEdgeL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutAttachEdgeL, "TestAnchorLayoutAttachEdgeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutAttachEdgeL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutAttachEdgeL );
+    
+    CAlfAnchorLayout* layout = CAlfAnchorLayout::AddNewL( *iAlfCtl );
+    layout->SetSize( TAlfRealSize( KRealWidth, KRealHeight ) );
+    layout->SetPos( TAlfRealPoint( KRealX, KRealY ) );
+    
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    
+    TAlfMetric offset( 0.1, EAlfUnitMySize );
+         
+    TInt attached0 = layout->Attach( 0, EAlfAnchorTypeLeft, offset,
+                                     EAlfAnchorAttachmentOriginLeft,
+                                     EAlfAnchorAttachToParent );
+    TInt attached1 = layout->Attach( 0, EAlfAnchorTypeBottom,
+                                     offset, EAlfAnchorAttachmentOriginTop,
+                                     EAlfAnchorAttachToParent );
+    STIF_ASSERT_EQUALS( attached0, KErrNone );
+    STIF_ASSERT_EQUALS( attached1, KErrNone );
+
+    // try to create a cycle
+    TInt attached2 = layout->Attach( 1, EAlfAnchorTypeRight, offset,
+                                     EAlfAnchorAttachmentOriginLeft, 0 );
+    TInt attached3 = layout->Attach( 2, EAlfAnchorTypeLeft, offset,
+                                     EAlfAnchorAttachmentOriginRight, 1 );
+    TInt attached4 = layout->Attach( 0, EAlfAnchorTypeLeft, offset,
+                                     EAlfAnchorAttachmentOriginLeft, 2 );
+    STIF_ASSERT_EQUALS( attached2, KErrNone );
+    STIF_ASSERT_EQUALS( attached3, KErrNone );
+    STIF_ASSERT_EQUALS( attached4, KErrArgument ); // this one should fail as it completes the cycle
+    
+    // and along the vertical axis, other way around this time
+    TInt attached5 = layout->Attach( 2, EAlfAnchorTypeTop, offset, 
+                                     EAlfAnchorAttachmentOriginBottom, 0 );
+    TInt attached6 = layout->Attach( 1, EAlfAnchorTypeBottom,
+                                     offset, EAlfAnchorAttachmentOriginTop, 2 );
+    TInt attached7 = layout->Attach( 0, EAlfAnchorTypeBottom, offset,
+                                     EAlfAnchorAttachmentOriginBottom, 1 );
+    STIF_ASSERT_EQUALS( attached5, KErrNone );
+    STIF_ASSERT_EQUALS( attached6, KErrNone );
+    STIF_ASSERT_EQUALS( attached7, KErrArgument ); // this one should fail as it completes the cycle
+    
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutAttachCornerL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutAttachCornerL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutAttachCornerL, "TestAnchorLayoutAttachCornerL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutAttachCornerL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutAttachCornerL );
+    
+    CAlfAnchorLayout* layout = CAlfAnchorLayout::AddNewL( *iAlfCtl );
+    layout->SetSize( TAlfRealSize( KRealWidth, KRealHeight ) );
+    layout->SetPos( TAlfRealPoint( KRealX, KRealY ) );
+    
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    
+    TAlfTimedPoint point;
+    point.iX.SetValueNow( 0.1 );
+    point.iY.SetValueNow( 0.2 );
+    layout->SetAnchor( EAlfAnchorTopLeft, 0, EAlfAnchorOriginLeft,
+                       EAlfAnchorOriginTop, EAlfAnchorMetricRelativeToSize,
+                       EAlfAnchorMetricRelativeToSize, point );
+
+    point.iX.SetValueNow( KValueNow );
+    point.iY.SetValueNow( KValueNow );
+    layout->SetAnchor( EAlfAnchorBottomRight, 0,
+                       EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
+                       EAlfAnchorMetricRelativeToSize,
+                       EAlfAnchorMetricRelativeToSize, point );
+
+    layout->UpdateChildrenLayout();
+    
+    TInt ordinal(0);
+    TAlfAnchorType type( EAlfAnchorTypeLeft );
+    TAlfXYMetric offset(
+        TAlfMetric( 0.1, EAlfUnitMySize ),
+        TAlfMetric( 0.1, EAlfUnitMySize ) );
+    TAlfAnchorAttachmentOrigin attachmentOrigin( EAlfAnchorAttachmentOriginLeft );
+    TInt attachmentOrdinal( EAlfAnchorAttachToParent );
+          
+    layout->Attach( ordinal, type, offset, attachmentOrigin, attachmentOrdinal );
+    
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutAttachBoxL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutAttachBoxL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutAttachBoxL, "TestAnchorLayoutAttachBoxL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutAttachBoxL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutAttachBoxL );
+
+    CAlfAnchorLayout* layout = CAlfAnchorLayout::AddNewL( *iAlfCtl );
+    layout->SetSize( TAlfRealSize( KRealWidth, KRealHeight ) );
+    layout->SetPos( TAlfRealPoint( KRealX, KRealY ) );
+    
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    
+    TInt ordinal(0);
+    TAlfBoxMetric offset(
+        TAlfMetric( 0.1, EAlfUnitMySize ),
+        TAlfMetric( -0.1, EAlfUnitMySize ),
+        TAlfMetric( 0.1, EAlfUnitMySize ),
+        TAlfMetric( -0.1, EAlfUnitMySize ) );
+    TAlfAnchorAttachmentOrigin attachmentOrigin( EAlfAnchorAttachmentOriginNone );
+    TInt attachmentOrdinal( EAlfAnchorAttachToParent );
+          
+    layout->Attach( ordinal, offset, attachmentOrigin, attachmentOrdinal );
+    
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutDetachL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutDetachL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutDetachL, "TestAnchorLayoutDetachL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutDetachL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutDetachL );
+
+    CAlfAnchorLayout* layout = CAlfAnchorLayout::AddNewL( *iAlfCtl );
+    layout->SetSize( TAlfRealSize( KRealWidth, KRealHeight ) );
+    layout->SetPos( TAlfRealPoint( KRealX, KRealY ) );
+    
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+
+    layout->Detach( 0 );
+    
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutDetachTypeL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutDetachTypeL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutDetachTypeL, "TestAnchorLayoutDetachTypeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutDetachTypeL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutDetachTypeL );
+
+    CAlfAnchorLayout* layout = CAlfAnchorLayout::AddNewL( *iAlfCtl );
+    layout->SetSize( TAlfRealSize( KRealWidth, KRealHeight ) );
+    layout->SetPos( TAlfRealPoint( KRealX, KRealY ) );
+    
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+    CAlfTextVisual::AddNewL( *iAlfCtl, layout );
+
+    layout->Detach( 0, EAlfAnchorTypeLeft );
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutRemoveAndDestroyAllDL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutRemoveAndDestroyAllDL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutRemoveAndDestroyAllDL, "TestAnchorLayoutRemoveAndDestroyAllDL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutRemoveAndDestroyAllDL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutRemoveAndDestroyAllDL );
+
+    CAlfAnchorLayout* layout = CAlfAnchorLayout::AddNewL( *iAlfCtl );
+
+    layout->RemoveAndDestroyAllD( );
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutUpdateChildrenLayoutL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutUpdateChildrenLayoutL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutUpdateChildrenLayoutL, "TestAnchorLayoutUpdateChildrenLayoutL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutUpdateChildrenLayoutL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutUpdateChildrenLayoutL );
+
+    CAlfAnchorLayout* layout = CAlfAnchorLayout::AddNewL( *iAlfCtl );
+
+    layout->UpdateChildrenLayout( );
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutFindTagL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutFindTagL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutFindTagL, "TestAnchorLayoutFindTagL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutFindTagL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutFindTagL );
+    _LIT8( KTest, "Test" );
+    CAlfAnchorLayout* layout = CAlfAnchorLayout::AddNewL( *iAlfCtl );
+
+    layout->FindTag( KTest );
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutBaseUnitL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutBaseUnitL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutBaseUnitL, "TestAnchorLayoutBaseUnitL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutBaseUnitL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutBaseUnitL );
+
+    CAlfAnchorLayout* layout = CAlfAnchorLayout::AddNewL( *iAlfCtl );
+
+    layout->BaseUnit();
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutDoRemoveAndDestroyAllDL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutDoRemoveAndDestroyAllDL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutDoRemoveAndDestroyAllDL, "TestAnchorLayoutDoRemoveAndDestroyAllDL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutDoRemoveAndDestroyAllDL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutDoRemoveAndDestroyAllDL );
+
+    CTestAlfAnchorLayout* layout = new ( ELeave ) CTestAlfAnchorLayout();
+    CleanupStack::PushL( layout );
+    layout->ConstructL( *iAlfCtl );
+    layout->DoRemoveAndDestroyAllD();
+    CleanupStack::Pop( layout );
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAnchorLayoutPropertyOwnerExtensionL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestAnchorLayoutPropertyOwnerExtensionL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAnchorLayoutPropertyOwnerExtensionL, "TestAnchorLayoutPropertyOwnerExtensionL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAnchorLayoutPropertyOwnerExtensionL );
+    // Print to log file
+    iLog->Log( KTestAnchorLayoutPropertyOwnerExtensionL );
+
+    CTestAlfAnchorLayout* layout = new ( ELeave ) CTestAlfAnchorLayout();
+    CleanupStack::PushL( layout );
+    layout->ConstructL( *iAlfCtl );
+    TUid extensionUid = { 0x00000001 };
+    layout->PropertyOwnerExtension( extensionUid, 0 );
+
+    CleanupStack::PopAndDestroy( layout );
+    return KErrNone;
+    }
+
+
+//  [End of File]
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksbatchbuffer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 function implement of CTestPlatAlfVisual
+*
+*/
+
+
+// [INCLUDE FILES]
+#include <alf/alfbatchbuffer.h>
+#include <alf/alfborderbrush.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TInt KBufferSize = 2222;
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBBSetAutoFlushMode
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBBSetAutoFlushMode( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBBSetAutoFlushModeL, "TestBBSetAutoFlushModeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBBSetAutoFlushModeL );
+    // Print to log file
+    iLog->Log( KTestBBSetAutoFlushModeL );
+    
+    CAlfBatchBuffer* buffer = &( iAlfEnv->BatchBufferHandler() );
+    buffer->SetAutoFlushMode( EAlfAutoFlushInstant );
+    STIF_ASSERT_EQUALS( EAlfAutoFlushInstant, buffer->AutoFlushMode() );
+    
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBBAutoFlushMode
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBBAutoFlushMode( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBBAutoFlushModeL, "TestBBAutoFlushModeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBBAutoFlushModeL );
+    // Print to log file
+    iLog->Log( KTestBBAutoFlushModeL );
+
+    CAlfBatchBuffer* buffer = &( iAlfEnv->BatchBufferHandler() );
+    TAlfAutoFlushMode defaultMode = buffer->AutoFlushMode();
+    STIF_ASSERT_EQUALS( defaultMode, EAlfAutoFlushDeferred );
+    
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBBFlushBatchBufferL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBBFlushBatchBufferL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBBFlushBatchBufferL, "TestBBFlushBatchBufferL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBBFlushBatchBufferL );
+    // Print to log file
+    iLog->Log( KTestBBFlushBatchBufferL );
+
+    CAlfBatchBuffer* buffer = &( iAlfEnv->BatchBufferHandler() );
+
+    buffer->FlushBatchBuffer();
+    STIF_ASSERT_EQUALS( 0, buffer->GetBatchBufferInfo( EAlfBatchBufferInfoCommandsAllocate ) );
+     
+    // create a command on the buffer
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewLC( *iAlfEnv, 2,2,2,2 );
+    brush->SetColor( KRgbRed ); // this should leave the command on the buffer
+    
+    STIF_ASSERT_NOT_EQUALS( 0, buffer->GetBatchBufferInfo( EAlfBatchBufferInfoCommandsAllocate ) );
+     
+    buffer->FlushBatchBuffer();
+    STIF_ASSERT_EQUALS( 0, buffer->GetBatchBufferInfo( EAlfBatchBufferInfoCommandsAllocate ) );
+     
+    // clean up
+    CleanupStack::PopAndDestroy( brush );
+    
+    
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBBSetMaxBatchBufferSize
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBBSetMaxBatchBufferSize( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBBSetMaxBatchBufferSizeL, "TestBBSetMaxBatchBufferSizeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBBSetMaxBatchBufferSizeL );
+    // Print to log file
+    iLog->Log( KTestBBSetMaxBatchBufferSizeL );
+
+    CAlfBatchBuffer* buffer = &( iAlfEnv->BatchBufferHandler() );
+    buffer->SetMaxBatchBufferSize( KBufferSize );
+    STIF_ASSERT_EQUALS( KBufferSize, buffer->GetBatchBufferInfo( EAlfBatchBufferInfoMaxSize ) );
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBBGetBatchBufferInfoL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBBGetBatchBufferInfoL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBBGetBatchBufferInfoL, "TestBBGetBatchBufferInfoL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBBGetBatchBufferInfoL );
+    // Print to log file
+    iLog->Log( KTestBBGetBatchBufferInfoL );
+
+    CAlfBatchBuffer* buffer = &( iAlfEnv->BatchBufferHandler() );
+    // Change some of the values
+    buffer->SetMaxBatchBufferSize( KBufferSize );
+    
+    // create a command on the buffer
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewLC( *iAlfEnv, 2,2,2,2 );
+    brush->SetColor( KRgbRed ); // this should leave the command on the buffer
+    
+    // Get the data
+    TInt gotDefaultSize = buffer->GetBatchBufferInfo( EAlfBatchBufferInfoDefaultBufferSize );
+    TInt gotMaxSize = buffer->GetBatchBufferInfo( EAlfBatchBufferInfoMaxSize );
+    TInt gotCurrentlyAllocatedSize = buffer->GetBatchBufferInfo( EAlfBatchBufferInfoCurrentlyAllocated );
+    TInt gotCommandsAllocateSize = buffer->GetBatchBufferInfo( EAlfBatchBufferInfoCommandsAllocate );
+    
+    // Check;
+    ASSERT( gotDefaultSize > 0 ); // this is really the only check we can do
+    STIF_ASSERT_EQUALS( gotMaxSize, KBufferSize );
+    STIF_ASSERT_EQUALS( gotCurrentlyAllocatedSize ,  gotDefaultSize ); // one command should fit in the default buffer
+    ASSERT( gotCommandsAllocateSize > 0 ); 
+     
+    // clean up
+    CleanupStack::PopAndDestroy( brush );
+
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksborderbrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,475 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 function implement of CTestPlatAlfVisual
+*
+*/
+
+
+// [INCLUDE FILES]
+#include <alf/alfborderbrush.h>
+#include <alf/alfbitmapprovider.h>
+#include <avkon.mbg>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TInt KImageWidth = 60;
+const TInt KImageHeight = 670;
+const TInt KGeneralTime = 1000000;
+
+
+// FORWARD DECLARATION
+// class CTestBitmapProvider for testing CAlfBorderBrush
+class CTestBitmapProvider : public CBase, public MAlfBitmapProvider
+    {
+public:
+    /**
+     * Constructor
+     */
+    CTestBitmapProvider() : iImageNumber( 0 ) {}
+    
+    /**
+     * From MAlfBitmapProvider
+     * 
+     * Provide a bitmap and mask from the given UID.
+     */
+    void ProvideBitmapL( TInt /*aId*/, CFbsBitmap*& aBitmap, CFbsBitmap*& aBitmapMask )
+        {
+        TBool done = EFalse;
+        
+        while ( !done )
+            {
+            AknIconUtils::CreateIconL( aBitmap, aBitmapMask, 
+                AknIconUtils::AvkonIconFileName(), 
+                EMbmAvkonQgn_indi_find_glass + iImageNumber,
+                EMbmAvkonQgn_indi_find_glass_mask + iImageNumber );
+
+            AknIconUtils::SetSize( aBitmap, TSize( KImageWidth, KImageHeight ) );
+            
+            // Alf does not support all displaymodes, so continue until we find supported image
+            if ( !aBitmap || aBitmap->DisplayMode() < EColor64K
+                 || !aBitmapMask || aBitmapMask->DisplayMode() != EGray256 )
+                {
+                delete aBitmap;
+                delete aBitmapMask;
+                aBitmap = NULL;
+                aBitmapMask = NULL;
+                iImageNumber += 2;
+                }
+            else
+                {
+                done = ETrue;
+                }
+            }
+        }
+    
+private:
+    /**
+     * The number of image
+     */
+    TInt iImageNumber;
+    };
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBorderBrushNewL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBorderBrushNewL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBorderBrushNewL, "TestBorderBrushNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBorderBrushNewL );
+    // Print to log file
+    iLog->Log( KTestBorderBrushNewL );
+    
+    TAlfXYMetric thickness;
+    TAlfXYMetric edgeOffset;
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewL( *iAlfEnv, thickness, edgeOffset );
+    CleanupStack::PushL( brush );
+    STIF_ASSERT_NOT_NULL( brush );
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBorderBrushNewLCL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBorderBrushNewLCL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBorderBrushNewLCL, "TestBorderBrushNewLCL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBorderBrushNewLCL );
+    // Print to log file
+    iLog->Log( KTestBorderBrushNewLCL );
+    
+    TAlfXYMetric thickness;
+    TAlfXYMetric edgeOffset;
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewLC( *iAlfEnv, thickness, edgeOffset );
+    STIF_ASSERT_NOT_NULL( brush );
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBorderBrushOffsetNewL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBorderBrushOffsetNewL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBorderBrushOffsetNewL, "TestBorderBrushOffsetNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBorderBrushOffsetNewL );
+    // Print to log file
+    iLog->Log( KTestBorderBrushOffsetNewL );
+    
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewL( *iAlfEnv, 0,0,0,0 ); 
+    CleanupStack::PushL( brush );
+    STIF_ASSERT_NOT_NULL( brush );
+    CleanupStack::PopAndDestroy( brush );
+    
+    brush = CAlfBorderBrush::NewL( *iAlfEnv, -1, 11231230, -04234234234, 0 );
+    CleanupStack::PushL( brush );
+    STIF_ASSERT_NOT_NULL( brush );
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBorderBrushOffsetNewLCL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBorderBrushOffsetNewLCL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBorderBrushOffsetNewLCL, "TestBorderBrushOffsetNewLCL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBorderBrushOffsetNewLCL );
+    // Print to log file
+    iLog->Log( KTestBorderBrushOffsetNewLCL );
+
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewLC( *iAlfEnv, 0, 0, 0, 0 );
+    STIF_ASSERT_NOT_NULL( brush );
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBorderBrushSetImageL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBorderBrushSetImageL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBorderBrushSetImageL, "TestBorderBrushSetImageL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBorderBrushSetImageL );
+    // Print to log file
+    iLog->Log( KTestBorderBrushSetImageL );
+
+    CTestBitmapProvider* bmpProvider = new ( ELeave ) CTestBitmapProvider;
+    CleanupStack::PushL( bmpProvider );
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewL( *iAlfEnv, 0, 0, 0, 0 );
+    CleanupStack::PushL( brush );
+    CAlfTexture& texture = iAlfEnv->TextureManager().CreateTextureL( 2,
+                                         bmpProvider,
+                                         EAlfTextureFlagGenerateShadow );
+                                         
+    brush->SetImage( TAlfImage( texture ) );
+    CleanupStack::PopAndDestroy( brush );
+    CleanupStack::PopAndDestroy( bmpProvider );
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBorderBrushImageL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBorderBrushImageL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBorderBrushImageL, "TestBorderBrushImageL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBorderBrushImageL );
+    // Print to log file
+    iLog->Log( KTestBorderBrushImageL );
+
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewL( *iAlfEnv, 0, 0, 0, 0 );
+    CleanupStack::PushL( brush );
+    brush->Image();
+    CleanupStack::PopAndDestroy( brush );
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBorderBrushSetColorL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBorderBrushSetColorL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBorderBrushSetColorL, "TestBorderBrushSetColorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBorderBrushSetColorL );
+    // Print to log file
+    iLog->Log( KTestBorderBrushSetColorL );
+
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewL( *iAlfEnv, 0, 0, 0, 0 );
+    CleanupStack::PushL( brush );
+    brush->SetColor( KRgbDarkGray );
+    CleanupStack::PopAndDestroy( brush );
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBorderBrushThicknessL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBorderBrushThicknessL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBorderBrushThicknessL, "TestBorderBrushThicknessL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBorderBrushThicknessL );
+    // Print to log file
+    iLog->Log( KTestBorderBrushThicknessL );
+
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewL( *iAlfEnv, 0, 0, 0, 0 );
+    CleanupStack::PushL( brush );
+    const TAlfTimedPoint& valueGet = brush->Thickness();
+    STIF_ASSERT_EQUALS( 0.f, valueGet.iX.ValueNow() );
+    STIF_ASSERT_EQUALS( 0.f, valueGet.iX.Target() );
+    STIF_ASSERT_EQUALS( 0, valueGet.iX.TimeToTargetinMilliSeconds() );
+    CleanupStack::PopAndDestroy( brush );
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBorderBrushSetThicknessL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBorderBrushSetThicknessL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBorderBrushSetThicknessL, "TestBorderBrushSetThicknessL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBorderBrushSetThicknessL );
+    // Print to log file
+    iLog->Log( KTestBorderBrushSetThicknessL );
+
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewL( *iAlfEnv, 0, 0, 0, 0 );
+    CleanupStack::PushL( brush );
+    TAlfTimedPoint valueSet;
+    valueSet.iY.SetValueNow( 0 );
+    valueSet.iY.SetTarget( 1, KGeneralTime );
+    brush->SetThickness( valueSet );
+    
+    const TAlfTimedPoint& valueGet = brush->Thickness();
+    STIF_ASSERT_EQUALS( 0.f, valueGet.iY.ValueNow() );
+    STIF_ASSERT_EQUALS( 1.f, valueGet.iY.Target() );
+    STIF_ASSERT_NOT_EQUALS( 0, valueGet.iY.TimeToTargetinMilliSeconds() );
+    CleanupStack::PopAndDestroy( brush );
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBorderBrushSetThicknessMetricL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBorderBrushSetThicknessMetricL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBorderBrushSetThicknessMetricL, "TestBorderBrushSetThicknessMetricL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBorderBrushSetThicknessMetricL );
+    // Print to log file
+    iLog->Log( KTestBorderBrushSetThicknessMetricL );
+
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewL( *iAlfEnv, 0, 0, 0, 0 );
+    CleanupStack::PushL( brush );
+    TAlfMetric valueSet( 2.f );
+    brush->SetThickness( valueSet );
+    
+    const TAlfTimedPoint& valueGet = brush->Thickness();
+    STIF_ASSERT_EQUALS( 2.f, valueGet.iY.ValueNow() );
+    STIF_ASSERT_EQUALS( 2.f, valueGet.iY.Target() );
+    STIF_ASSERT_EQUALS( 0, valueGet.iY.TimeToTargetinMilliSeconds() );
+    CleanupStack::PopAndDestroy( brush );
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBorderBrushEdgeOffsetL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBorderBrushEdgeOffsetL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBorderBrushEdgeOffsetL, "TestBorderBrushEdgeOffsetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBorderBrushEdgeOffsetL );
+    // Print to log file
+    iLog->Log( KTestBorderBrushEdgeOffsetL );
+
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewL( *iAlfEnv, 0, 0, 0, 0 );
+    CleanupStack::PushL( brush );
+    const TAlfTimedPoint& valueGet = brush->EdgeOffset();
+    STIF_ASSERT_EQUALS( 0.f, valueGet.iX.ValueNow() );
+    STIF_ASSERT_EQUALS( 0.f, valueGet.iX.Target() );
+    STIF_ASSERT_EQUALS( 0, valueGet.iX.TimeToTargetinMilliSeconds() );
+    CleanupStack::PopAndDestroy( brush );
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBorderBrushSetEdgeOffsetL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBorderBrushSetEdgeOffsetL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBorderBrushSetEdgeOffsetL, "TestBorderBrushSetEdgeOffsetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBorderBrushSetEdgeOffsetL );
+    // Print to log file
+    iLog->Log( KTestBorderBrushSetEdgeOffsetL );
+
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewL( *iAlfEnv, 0, 0, 0, 0 );
+    CleanupStack::PushL( brush );
+    TAlfTimedPoint valueSet;
+    valueSet.iX.SetValueNow( 0 );
+    valueSet.iX.SetTarget( 1, KGeneralTime );
+    brush->SetEdgeOffset( valueSet );
+    
+    const TAlfTimedPoint& valueGet = brush->EdgeOffset();
+    STIF_ASSERT_EQUALS( 0.f, valueGet.iX.ValueNow() );
+    STIF_ASSERT_EQUALS( 1.f, valueGet.iX.Target() );
+    STIF_ASSERT_NOT_EQUALS( 0, valueGet.iX.TimeToTargetinMilliSeconds() );
+    CleanupStack::PopAndDestroy( brush );
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBorderBrushSetEdgeOffsetMetricL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBorderBrushSetEdgeOffsetMetricL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBorderBrushSetEdgeOffsetMetricL, "TestBorderBrushSetEdgeOffsetMetricL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBorderBrushSetEdgeOffsetMetricL );
+    // Print to log file
+    iLog->Log( KTestBorderBrushSetEdgeOffsetMetricL );
+
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewL( *iAlfEnv, 0, 0, 0, 0 );
+    CleanupStack::PushL( brush );
+    TAlfMetric valueSet( 2.f );
+    brush->SetEdgeOffset( valueSet );
+    
+    const TAlfTimedPoint& valueGet = brush->EdgeOffset();
+    STIF_ASSERT_EQUALS( 2.f, valueGet.iX.ValueNow() );
+    STIF_ASSERT_EQUALS( 2.f, valueGet.iX.Target() );
+    STIF_ASSERT_EQUALS( 0, valueGet.iX.TimeToTargetinMilliSeconds() );
+    CleanupStack::PopAndDestroy( brush );
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBorderBrushImageOffsetL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBorderBrushImageOffsetL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBorderBrushImageOffsetL, "TestBorderBrushImageOffsetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBorderBrushImageOffsetL );
+    // Print to log file
+    iLog->Log( KTestBorderBrushImageOffsetL );
+
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewL( *iAlfEnv, 0, 0, 0, 0 );
+    CleanupStack::PushL( brush );
+    const TAlfTimedPoint& valueGet = brush->ImageOffset();
+    STIF_ASSERT_EQUALS( 0.f, valueGet.iX.ValueNow() );
+    STIF_ASSERT_EQUALS( 0.f, valueGet.iX.Target() );
+    STIF_ASSERT_EQUALS( 0, valueGet.iX.TimeToTargetinMilliSeconds() );
+    CleanupStack::PopAndDestroy( brush );
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBorderBrushSetImageOffsetL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBorderBrushSetImageOffsetL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBorderBrushSetImageOffsetL, "TestBorderBrushSetImageOffsetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBorderBrushSetImageOffsetL );
+    // Print to log file
+    iLog->Log( KTestBorderBrushSetImageOffsetL );
+
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewL( *iAlfEnv, 0, 0, 0, 0 );
+    CleanupStack::PushL( brush );
+    TAlfTimedPoint valueSet;
+    valueSet.iY.SetValueNow( 0 );
+    valueSet.iY.SetTarget( 1, KGeneralTime );
+    brush->SetImageOffset( valueSet );
+    
+    const TAlfTimedPoint& valueGet = brush->ImageOffset();
+    STIF_ASSERT_EQUALS( 0.f, valueGet.iY.ValueNow() );
+    STIF_ASSERT_EQUALS( 1.f, valueGet.iY.Target() );
+    STIF_ASSERT_NOT_EQUALS( 0, valueGet.iY.TimeToTargetinMilliSeconds() );
+    CleanupStack::PopAndDestroy( brush );
+
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBorderBrushSetImageOffsetMetricL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBorderBrushSetImageOffsetMetricL( CStifItemParser& /*aItem*/ )
+    {
+
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBorderBrushSetImageOffsetMetricL, "TestBorderBrushSetImageOffsetMetricL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBorderBrushSetImageOffsetMetricL );
+    // Print to log file
+    iLog->Log( KTestBorderBrushSetImageOffsetMetricL );
+
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewL( *iAlfEnv, 0, 0, 0, 0 );
+    CleanupStack::PushL( brush );
+    TAlfMetric valueSet( 2.f );
+    brush->SetImageOffset( valueSet );
+    
+    const TAlfTimedPoint& valueGet = brush->ImageOffset();
+    STIF_ASSERT_EQUALS( 2.f, valueGet.iY.ValueNow() );
+    STIF_ASSERT_EQUALS( 2.f, valueGet.iY.Target() );
+    STIF_ASSERT_EQUALS( 0, valueGet.iY.TimeToTargetinMilliSeconds() );
+    CleanupStack::PopAndDestroy( brush );
+
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksbrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,288 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfbrush.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alfconstants.h>
+
+#include "testplatalfvisual.h"
+
+
+// FORWARD DECLARATION
+/**
+ * This class is used to test CAlfBrush protected function
+ * 
+ * @lib none
+ * @since S60 v3.2
+ */
+class CTestAlfBrush : public CAlfBrush
+    {
+public:
+    /**
+     * Test constructL method of CAlfBrush.
+     */
+    void TestConstructL(
+        CAlfEnv& aEnv,
+        TInt aImplementationId, 
+        TInt aImplementationUid, 
+        const TDesC8& aConstructionParams )
+        {
+        CAlfBrush::ConstructL( aEnv, aImplementationId, aImplementationUid, aConstructionParams );
+        }
+    /**
+     * Test constructL method of CAlfBrush.
+     */
+    void TestConstructL()
+        {
+        CAlfBrush::ConstructL();
+        }
+    /**
+     * Test PropertyOwnerExtension method of CAlfBrush.
+     */
+    void TestPropertyOwnerExtension( const TUid& aExtensionUid, TAny** aExtensionParams )
+        {
+        CAlfBrush::PropertyOwnerExtension( aExtensionUid, aExtensionParams );
+        }
+    };
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfBrushOpacityL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfBrushOpacityL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfBrush, "TestPlatAlfBrush" );
+    _LIT( KTestAlfBrushOpacityL, "TestAlfBrushOpacityL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfBrush, KTestAlfBrushOpacityL );
+    // Print to log file
+    iLog->Log( KTestAlfBrushOpacityL );
+    
+    CAlfBrush* brush = CAlfGradientBrush::NewL( *iAlfEnv );
+    CleanupStack::PushL( brush );
+    STIF_ASSERT_NOT_NULL( brush );
+    brush->Opacity();
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfBrushSetOpacityL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfBrushSetOpacityL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfBrush, "TestPlatAlfBrush" );
+    _LIT( KTestAlfBrushSetOpacityL, "TestAlfBrushSetOpacityL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfBrush, KTestAlfBrushSetOpacityL );
+    // Print to log file
+    iLog->Log( KTestAlfBrushSetOpacityL );
+    
+    CAlfBrush* brush = CAlfGradientBrush::NewL( *iAlfEnv );
+    CleanupStack::PushL( brush );
+    STIF_ASSERT_NOT_NULL( brush );
+    TAlfTimedValue value( 0 );
+    brush->SetOpacity( value );
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfBrushSetLayerL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfBrushSetLayerL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfBrush, "TestPlatAlfBrush" );
+    _LIT( KTestAlfBrushSetLayerL, "TestAlfBrushSetLayerL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfBrush, KTestAlfBrushSetLayerL );
+    // Print to log file
+    iLog->Log( KTestAlfBrushSetLayerL );
+    
+    CAlfBrush* brush = CAlfGradientBrush::NewL( *iAlfEnv );
+    CleanupStack::PushL( brush );
+    STIF_ASSERT_NOT_NULL( brush );
+    TAlfBrushLayer layer = EAlfBrushLayerBackground;
+    brush->SetLayer( layer );
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfBrushSetClipToVisualL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfBrushSetClipToVisualL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfBrush, "TestPlatAlfBrush" );
+    _LIT( KTestAlfBrushSetClipToVisualL, "TestAlfBrushSetClipToVisualL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfBrush, KTestAlfBrushSetClipToVisualL );
+    // Print to log file
+    iLog->Log( KTestAlfBrushSetClipToVisualL );
+    
+    CAlfBrush* brush = CAlfGradientBrush::NewL( *iAlfEnv );
+    CleanupStack::PushL( brush );
+    STIF_ASSERT_NOT_NULL( brush );
+    brush->SetClipToVisual( EFalse );
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfBrushClipToVisualL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfBrushClipToVisualL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfBrush, "TestPlatAlfBrush" );
+    _LIT( KTestAlfBrushClipToVisualL, "TestAlfBrushClipToVisualL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfBrush, KTestAlfBrushClipToVisualL );
+    // Print to log file
+    iLog->Log( KTestAlfBrushClipToVisualL );
+    
+    CAlfBrush* brush = CAlfGradientBrush::NewL( *iAlfEnv );
+    CleanupStack::PushL( brush );
+    STIF_ASSERT_NOT_NULL( brush );
+    brush->ClipToVisual();
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfBrushIdentifierL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfBrushIdentifierL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfBrush, "TestPlatAlfBrush" );
+    _LIT( KTestAlfBrushIdentifierL, "TestAlfBrushIdentifierL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfBrush, KTestAlfBrushIdentifierL );
+    // Print to log file
+    iLog->Log( KTestAlfBrushIdentifierL );
+    
+    CAlfBrush* brush = CAlfGradientBrush::NewL( *iAlfEnv );
+    CleanupStack::PushL( brush );
+    STIF_ASSERT_NOT_NULL( brush );
+    brush->Identifier();
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfBrushCommsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfBrushCommsL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfBrush, "TestPlatAlfBrush" );
+    _LIT( KTestAlfBrushCommsL, "TestAlfBrushCommsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfBrush, KTestAlfBrushCommsL );
+    // Print to log file
+    iLog->Log( KTestAlfBrushCommsL );
+    
+    CAlfBrush* brush = CAlfGradientBrush::NewL( *iAlfEnv );
+    CleanupStack::PushL( brush );
+    STIF_ASSERT_NOT_NULL( brush );
+    brush->Comms();
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfBrushConstructLWithParamL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfBrushConstructLWithParamL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfBrush, "TestPlatAlfBrush" );
+    _LIT( KTestAlfBrushConstructLWithParamL, "TestAlfBrushConstructLWithParamL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfBrush, KTestAlfBrushConstructLWithParamL );
+    // Print to log file
+    iLog->Log( KTestAlfBrushConstructLWithParamL );
+    
+    CTestAlfBrush* brush = new ( ELeave ) CTestAlfBrush;
+    CleanupStack::PushL( brush );
+    STIF_ASSERT_NOT_NULL( brush );
+    TAlfXYMetric aThickness, aEdgeOffset;
+    TAlfCreateBorderBrushMetricParams params;
+    params.iThickness = aThickness; 
+    params.iEdgeOffset = aEdgeOffset;
+    TPckgC<TAlfCreateBorderBrushMetricParams> paramsPckg(params);
+    brush->TestConstructL( *iAlfEnv, 
+            EAlfBorderBrushCreateMetric,
+            0,
+            paramsPckg );
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfBrushConstructL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfBrushConstructL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfBrush, "TestPlatAlfBrush" );
+    _LIT( KTestAlfBrushConstructL, "TestAlfBrushConstructL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfBrush, KTestAlfBrushConstructL );
+    // Print to log file
+    iLog->Log( KTestAlfBrushConstructL );
+    
+    CTestAlfBrush* brush = new ( ELeave ) CTestAlfBrush;
+    CleanupStack::PushL( brush );
+    STIF_ASSERT_NOT_NULL( brush );
+    brush->TestConstructL();
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    
+    }
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfBrushPropertyOwnerExtL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfBrushPropertyOwnerExtL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfBrush, "TestPlatAlfBrush" );
+    _LIT( KTestAlfBrushPropertyOwnerExtL, "TestAlfBrushPropertyOwnerExtL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfBrush, KTestAlfBrushPropertyOwnerExtL );
+    // Print to log file
+    iLog->Log( KTestAlfBrushPropertyOwnerExtL );
+    
+    CTestAlfBrush* brush = new ( ELeave ) CTestAlfBrush;
+    CleanupStack::PushL( brush );
+    STIF_ASSERT_NOT_NULL( brush );
+    brush->TestPropertyOwnerExtension( TUid::Uid( 0 ), NULL );
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksbrusharray.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,265 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 function implement of CTestPlatAlfVisual
+*
+*/
+
+
+// [INCLUDE FILES]
+#include <alf/alfbrusharray.h>
+#include <alf/alflayout.h>
+#include <alf/alfborderbrush.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TInt KBrushParam = 3;
+const TInt KBrushCount = 4;
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBrushArrayResetL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBrushArrayResetL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBrushArrayResetL, "TestBrushArrayResetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBrushArrayResetL );
+    // Print to log file
+    iLog->Log( KTestBrushArrayResetL );
+    
+    CAlfBrush* brush = CAlfBorderBrush::NewLC( *iAlfEnv, 0, 0, 0, 0 );
+    CAlfBrush* brushOwn = CAlfBorderBrush::NewLC( *iAlfEnv, 1, 1, 1, 1 );
+
+    CAlfVisual* visual = CAlfLayout::AddNewL( *iAlfCtl );
+    visual->EnableBrushesL();
+    CAlfBrushArray* brushArray = visual->Brushes();
+    STIF_ASSERT_EQUALS( 0, brushArray->Count() );
+    
+    brushArray->AppendL( brush, EAlfDoesNotHaveOwnership );
+    brushArray->AppendL( brushOwn, EAlfHasOwnership );
+    
+    STIF_ASSERT_EQUALS( 2, brushArray->Count() );
+    
+    brushArray->Reset();
+    STIF_ASSERT_EQUALS( 0, brushArray->Count() );
+    
+    CleanupStack::Pop( brushOwn );
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBrushArrayAppendL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBrushArrayAppendL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBrushArrayAppendL, "TestBrushArrayAppendL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBrushArrayAppendL );
+    // Print to log file
+    iLog->Log( KTestBrushArrayAppendL );
+    
+    CAlfBrush* brush = CAlfBorderBrush::NewLC( *iAlfEnv, 0, 0, 0, 0 );
+    CAlfBrush* brushOwn = CAlfBorderBrush::NewLC( *iAlfEnv, 1, 1, 1, 1 );
+    
+    CAlfVisual* visual = CAlfLayout::AddNewL( *iAlfCtl );
+    visual->EnableBrushesL();
+    CAlfBrushArray* brushArray = visual->Brushes();
+    
+    STIF_ASSERT_EQUALS( 0, brushArray->Count() );
+    brushArray->AppendL( brushOwn, EAlfHasOwnership );
+    brushArray->AppendL( brush, EAlfDoesNotHaveOwnership );
+    STIF_ASSERT_EQUALS( 2, brushArray->Count() );
+    
+    CleanupStack::Pop( brushOwn );
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBrushArrayInsertL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBrushArrayInsertL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBrushArrayInsertL, "TestBrushArrayInsertL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBrushArrayInsertL );
+    // Print to log file
+    iLog->Log( KTestBrushArrayInsertL );
+    
+    CAlfBrush* brush = CAlfBorderBrush::NewLC( *iAlfEnv, 0, 0, 0, 0 );
+    CAlfBrush* brushOwn = CAlfBorderBrush::NewLC( *iAlfEnv, 1, 1, 1, 1 );
+    
+    CAlfVisual* visual = CAlfLayout::AddNewL( *iAlfCtl );
+    visual->EnableBrushesL();
+    CAlfBrushArray* brushArray = visual->Brushes();
+    
+    STIF_ASSERT_EQUALS( 0, brushArray->Count() );
+    brushArray->AppendL( brush, EAlfDoesNotHaveOwnership );
+    brushArray->InsertL( 0, brushOwn, EAlfHasOwnership );
+    STIF_ASSERT_EQUALS( 2, brushArray->Count() );
+    
+    CleanupStack::Pop( brushOwn );
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBrushArrayRemoveL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBrushArrayRemoveL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBrushArrayRemoveL, "TestBrushArrayRemoveL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBrushArrayRemoveL );
+    // Print to log file
+    iLog->Log( KTestBrushArrayRemoveL );
+    
+    CAlfBrush* brush = CAlfBorderBrush::NewLC( *iAlfEnv, 0, 0, 0, 0 );
+    CAlfBrush* brushOwn = CAlfBorderBrush::NewLC( *iAlfEnv, 1, 1, 1, 1 );
+    
+    CAlfVisual* visual = CAlfLayout::AddNewL( *iAlfCtl );
+    visual->EnableBrushesL();
+    CAlfBrushArray* brushArray = visual->Brushes();
+    
+    STIF_ASSERT_EQUALS( 0, brushArray->Count() );
+    brushArray->AppendL( brushOwn, EAlfHasOwnership );
+    brushArray->AppendL( brush, EAlfDoesNotHaveOwnership );
+    STIF_ASSERT_EQUALS( 2, brushArray->Count() );
+    CleanupStack::Pop( brushOwn );
+    brushArray->Remove( 0 );
+    STIF_ASSERT_EQUALS( 1, brushArray->Count() );
+    brushArray->Remove( 0 );
+    STIF_ASSERT_EQUALS( 0, brushArray->Count() );
+    CleanupStack::PopAndDestroy( brush );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBrushArrayCountL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBrushArrayCountL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBrushArrayCountL, "TestBrushArrayCountL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBrushArrayCountL );
+    // Print to log file
+    iLog->Log( KTestBrushArrayCountL );
+    
+    CAlfBrush* brush1 = CAlfBorderBrush::NewLC( *iAlfEnv, 0, 0, 0, 0 );
+    CAlfBrush* brush2 = CAlfBorderBrush::NewLC( *iAlfEnv, 1, 1, 1, 1 );
+    CAlfBrush* brushOwn1 = CAlfBorderBrush::NewLC( *iAlfEnv, 2, 2, 2, 2 );
+    CAlfBrush* brushOwn2 = CAlfBorderBrush::NewLC( *iAlfEnv,
+            KBrushParam, KBrushParam, KBrushParam, KBrushParam );
+    
+    CAlfVisual* visual = CAlfLayout::AddNewL( *iAlfCtl );
+    visual->EnableBrushesL();
+    CAlfBrushArray* brushArray = visual->Brushes();
+    
+    TInt count = brushArray->Count();
+    STIF_ASSERT_EQUALS( 0, count );
+    
+    brushArray->AppendL( brushOwn1, EAlfHasOwnership );
+    brushArray->AppendL( brush1, EAlfDoesNotHaveOwnership );
+    brushArray->AppendL( brushOwn2, EAlfHasOwnership );
+    brushArray->AppendL( brush2, EAlfDoesNotHaveOwnership );
+    
+    count = brushArray->Count();
+    STIF_ASSERT_EQUALS( KBrushCount, count );
+    
+    CleanupStack::Pop( brushOwn2 );
+    CleanupStack::Pop( brushOwn1 );
+    CleanupStack::PopAndDestroy( brush2 );
+    CleanupStack::PopAndDestroy( brush1 );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBrushArrayOperatorL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBrushArrayOperatorL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBrushArrayOperatorL, "TestBrushArrayOperatorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBrushArrayOperatorL );
+    // Print to log file
+    iLog->Log( KTestBrushArrayOperatorL );
+    
+    CAlfBrush* brushOwn = CAlfBorderBrush::NewLC( *iAlfEnv, 1, 1, 1, 1 );
+    
+    CAlfVisual* visual = CAlfLayout::AddNewL( *iAlfCtl );
+    visual->EnableBrushesL();
+    CAlfBrushArray* brushArray = visual->Brushes();
+    
+    brushArray->AppendL( brushOwn, EAlfHasOwnership );
+    
+    if ( brushArray->Count() > 0 )
+        {
+        CAlfBrush* brush = &(*brushArray)[0];
+        STIF_ASSERT_EQUALS( brush, brushOwn );
+        }
+    
+    CleanupStack::Pop( brushOwn );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBrushArrayAtL
+// -----------------------------------------------------------------------------
+TInt CTestPlatAlfVisual::TestBrushArrayAtL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBrushArrayAtL, "TestBrushArrayAtL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBrushArrayAtL );
+    // Print to log file
+    iLog->Log( KTestBrushArrayAtL );
+    
+    CAlfBrush* brushOwn = CAlfBorderBrush::NewLC( *iAlfEnv, 1, 1, 1, 1 );
+    
+    CAlfVisual* visual = CAlfLayout::AddNewL( *iAlfCtl );
+    visual->EnableBrushesL();
+    CAlfBrushArray* brushArray = visual->Brushes();
+    
+    brushArray->AppendL( brushOwn, EAlfHasOwnership );
+    
+    if ( brushArray->Count() > 0 )
+        {
+        CAlfBrush* brush = &brushArray->At( 0 );
+        STIF_ASSERT_EQUALS( brush, brushOwn );
+        }
+    
+    CleanupStack::Pop( brushOwn );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockscommand.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,638 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfcommand.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alfcommand.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TUid KTestUid = { 0x00000001 };
+
+
+// FORWARD DECLARATION
+
+// class TTestActionCmd for testing TAlfActionCommand
+class TTestActionCmd : public TAlfActionCommand
+    {
+public:
+    /**
+     * Constructor
+     */
+    TTestActionCmd( TInt aId ) : TAlfActionCommand( aId ) {}
+    
+public:
+    /**
+     * From TAlfActionCommand
+     */
+    void CommandExtension( const TUid& aExtensionUid, TAny** aExtensionParams )
+        {
+        TAlfActionCommand::CommandExtension( aExtensionUid, aExtensionParams );
+        }
+    };
+
+// class TTestObjCmd for testing TAlfObjectCommand
+class TTestObjCmd : public TAlfObjectCommand
+    {
+public:
+    /**
+     * Constructor
+     */
+    TTestObjCmd( TAlfCommandType aType, TAny* aDataOwnerObject, TAlfOp aOperation )
+    : TAlfObjectCommand( aType, aDataOwnerObject, aOperation ) {}
+    
+public:
+    /**
+     * From TAlfObjectCommand
+     */
+    void CommandExtension( const TUid& aExtensionUid, TAny** aExtensionParams )
+        {
+        TAlfObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+        }
+    };
+
+// class TTestGroupCmd for testing TAlfGroupCommand
+class TTestGroupCmd : public TAlfGroupCommand
+    {
+public:
+    /**
+     * Constructor
+     */
+    TTestGroupCmd( CAlfControlGroup& aGroup, TAlfOp aOperation )
+    : TAlfGroupCommand( aGroup, aOperation ) {}
+    
+public:
+    /**
+     * From TAlfGroupCommand
+     */
+    void CommandExtension( const TUid& aExtensionUid, TAny** aExtensionParams )
+        {
+        TAlfGroupCommand::CommandExtension( aExtensionUid, aExtensionParams );
+        }
+    };
+
+// class TTestCtrlCmd for testing TAlfControlCommand
+class TTestCtrlCmd : public TAlfControlCommand
+    {
+public:
+    /**
+     * Constructor
+     */
+    TTestCtrlCmd( CAlfControl& aControl, TAlfOp aOperation )
+    : TAlfControlCommand( aControl, aOperation ) {}
+    
+public:
+    /**
+     * From TAlfControlCommand
+     */
+    void CommandExtension( const TUid& aExtensionUid, TAny** aExtensionParams )
+        {
+        TAlfControlCommand::CommandExtension( aExtensionUid, aExtensionParams );
+        }
+    };
+
+// class TTestVisualCmd for testing TAlfVisualCommand
+class TTestVisualCmd : public TAlfVisualCommand
+    {
+public:
+    /**
+     * Constructor
+     */
+    TTestVisualCmd( CAlfVisual& aVisual, TAlfOp aOperation )
+    : TAlfVisualCommand( aVisual, aOperation ) {}
+    
+public:
+    /**
+     * From TAlfVisualCommand
+     */
+    void CommandExtension( const TUid& aExtensionUid, TAny** aExtensionParams )
+        {
+        TAlfVisualCommand::CommandExtension( aExtensionUid, aExtensionParams );
+        }
+    };
+
+// class TTestImageCmd for testing TAlfImageCommand
+class TTestImageCmd : public TAlfImageCommand
+    {
+public:
+    /**
+     * Constructor
+     */
+    TTestImageCmd( CAlfImageVisual& aImageVisual, const TAlfImage& aImage )
+    : TAlfImageCommand( aImageVisual, aImage ) {}
+    
+public:
+    /**
+     * From TAlfImageCommand
+     */
+    void CommandExtension( const TUid& aExtensionUid, TAny** aExtensionParams )
+        {
+        TAlfImageCommand::CommandExtension( aExtensionUid, aExtensionParams );
+        }
+    };
+
+// class TTestTextCmd for testing TAlfTextCommand
+class TTestTextCmd : public TAlfTextCommand
+    {
+public:
+    /**
+     * Constructor
+     */
+    TTestTextCmd( CAlfTextVisual& aTextVisual, const TDesC& aText )
+    : TAlfTextCommand( aTextVisual, aText ) {}
+    
+public:
+    /**
+     * From TAlfTextCommand
+     */
+    void CommandExtension( const TUid& aExtensionUid, TAny** aExtensionParams )
+        {
+        TAlfTextCommand::CommandExtension( aExtensionUid, aExtensionParams );
+        }
+    };
+
+// class TTestValueCmd for testing TAlfValueCommand
+class TTestValueCmd : public TAlfValueCommand
+    {
+public:
+    /**
+     * Constructor
+     */
+    TTestValueCmd( TAny* aObject, TAlfValueCommandTarget aObjectType )
+    : TAlfValueCommand( aObject, aObjectType ) {}
+    
+public:
+    /**
+     * From TAlfValueCommand
+     */
+    void CommandExtension( const TUid& aExtensionUid, TAny** aExtensionParams )
+        {
+        TAlfValueCommand::CommandExtension( aExtensionUid, aExtensionParams );
+        }
+    };
+
+// class TTestPointCmd for testing TAlfPointCommand
+class TTestPointCmd : public TAlfPointCommand
+    {
+public:
+    /**
+     * Constructor
+     */
+    TTestPointCmd( TAny* aObject, TAlfPointCommandTarget aObjectType, TAlfOp aOperation )
+    : TAlfPointCommand( aObject, aObjectType, aOperation ) {}
+    
+public:
+    /**
+     * From TAlfPointCommand
+     */
+    void CommandExtension( const TUid& aExtensionUid, TAny** aExtensionParams )
+        {
+        TAlfPointCommand::CommandExtension( aExtensionUid, aExtensionParams );
+        }
+    };
+
+// class TTestTransCmd for testing TAlfTransformationCommand
+class TTestTransCmd : public TAlfTransformationCommand
+    {
+public:
+    /**
+     * Constructor
+     */
+    TTestTransCmd( TAny* aOwner, CAlfTransformation& aTransformation )
+    : TAlfTransformationCommand( aOwner, aTransformation ) {}
+    
+public:
+    /**
+     * From TAlfTransformationCommand
+     */
+    void CommandExtension( const TUid& aExtensionUid, TAny** aExtensionParams )
+        {
+        TAlfTransformationCommand::CommandExtension( aExtensionUid, aExtensionParams );
+        }
+    };
+
+// class TTestMarkerCmd for testing TAlfMarkerCommand
+class TTestMarkerCmd : public TAlfMarkerCommand
+    {
+public:
+    /**
+     * Constructor
+     */
+    TTestMarkerCmd( TInt aId ) : TAlfMarkerCommand( aId ) {}
+    
+public:
+    /**
+     * From TAlfMarkerCommand
+     */
+    void CommandExtension( const TUid& aExtensionUid, TAny** aExtensionParams )
+        {
+        TAlfMarkerCommand::CommandExtension( aExtensionUid, aExtensionParams );
+        }
+    };
+
+// class TTestCustomEventCmd for testing TAlfCustomEventCommand
+class TTestCustomEventCmd : public TAlfCustomEventCommand
+    {
+public:
+    /**
+     * Constructor
+     */
+    TTestCustomEventCmd( TInt aEventParam, MAlfEventHandler* aRecipient = NULL )
+    : TAlfCustomEventCommand( aEventParam, aRecipient ) {}
+    
+public:
+    /**
+     * From TAlfCustomEventCommand
+     */
+    void CommandExtension( const TUid& aExtensionUid, TAny** aExtensionParams )
+        {
+        TAlfCustomEventCommand::CommandExtension( aExtensionUid, aExtensionParams );
+        }
+    };
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCmdMethods
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCmdMethods( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCmdMethods, "TestCmdMethods" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCmdMethods );
+    // Print to log file
+    iLog->Log( KTestCmdMethods );
+    
+    // TAlfActionCommand::TAlfActionCommand will call TAlfCommand::TAlfCommand
+    // TAlfActionCommand::~TAlfActionCommand will call TAlfCommand::~TAlfCommand
+    TAlfActionCommand cmd( 1 );
+    cmd.Type();
+    cmd.ObjectCommand();
+    
+    // TTestActionCmd::CommandExtension will call TAlfCommand::CommandExtension
+    TTestActionCmd testCmd( 1 );
+    TAny* extensionParams = NULL;
+    testCmd.CommandExtension( KTestUid, &extensionParams );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestActCmdMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestActCmdMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestActCmdMethodsL, "TestActCmdMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestActCmdMethodsL );
+    // Print to log file
+    iLog->Log( KTestActCmdMethodsL );
+    
+    TAlfActionCommand actCmd( 1 );
+    actCmd.ExecuteL( *iAlfEnv );
+    actCmd.Size();
+    actCmd.Id();
+    
+    TTestActionCmd testCmd( 1 );
+    TAny* extensionParams = NULL;
+    testCmd.CommandExtension( KTestUid, &extensionParams );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestObjCmdMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestObjCmdMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestObjCmdMethodsL, "TestObjCmdMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestObjCmdMethodsL );
+    // Print to log file
+    iLog->Log( KTestObjCmdMethodsL );
+    
+    TTestObjCmd objCmd( EAlfCommandTypeObject, NULL, EAlfOpNone );
+    objCmd.ObjectCommand();
+    objCmd.Object();
+    objCmd.Operation();
+    objCmd.ExecuteL( *iAlfEnv );
+    objCmd.Size();
+    
+    TAny* extensionParams = NULL;
+    objCmd.CommandExtension( KTestUid, &extensionParams );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestGroupCmdMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestGroupCmdMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestGroupCmdMethodsL, "TestGroupCmdMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestGroupCmdMethodsL );
+    // Print to log file
+    iLog->Log( KTestGroupCmdMethodsL );
+    
+    TAlfGroupCommand groupCmd( *iAlfCtrlGroup, EAlfOpHide, iAlfDisplay );
+    groupCmd.ExecuteL( *iAlfEnv );
+    groupCmd.Size();
+    groupCmd.ControlGroup();
+    groupCmd.Display();
+    
+    TTestGroupCmd testCmd( *iAlfCtrlGroup, EAlfOpHide );
+    TAny* extensionParams = NULL;
+    testCmd.CommandExtension( KTestUid, &extensionParams );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCtrlCmdMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCtrlCmdMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCtrlCmdMethodsL, "TestCtrlCmdMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCtrlCmdMethodsL );
+    // Print to log file
+    iLog->Log( KTestCtrlCmdMethodsL );
+    
+    TAlfControlCommand ctrlCmd( *iAlfCtl, EAlfOpNone );
+    ctrlCmd.ExecuteL( *iAlfEnv );
+    ctrlCmd.Size();
+    ctrlCmd.Control();
+    
+    TTestCtrlCmd testCmd( *iAlfCtl, EAlfOpNone );
+    TAny* extensionParams = NULL;
+    testCmd.CommandExtension( KTestUid, &extensionParams );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestVisualCmdMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestVisualCmdMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestVisualCmdMethodsL, "TestVisualCmdMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestVisualCmdMethodsL );
+    // Print to log file
+    iLog->Log( KTestVisualCmdMethodsL );
+    
+    CAlfVisual* visual = iAlfCtl->AppendVisualL( EAlfVisualTypeVisual );
+    TAlfVisualCommand visualCmd( *visual, EAlfOpNone );
+    visualCmd.ExecuteL( *iAlfEnv );
+    visualCmd.Size();
+    visualCmd.Visual();
+    visualCmd.FlagsToSet();
+    visualCmd.FlagsToClear();
+    
+    TTestVisualCmd testCmd( *visual, EAlfOpNone );
+    TAny* extensionParams = NULL;
+    testCmd.CommandExtension( KTestUid, &extensionParams );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestImageCmdMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestImageCmdMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestImageCmdMethodsL, "TestImageCmdMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestImageCmdMethodsL );
+    // Print to log file
+    iLog->Log( KTestImageCmdMethodsL );
+    
+    TAlfImage image;
+    CAlfImageVisual* imageVisual =
+        STATIC_CAST( CAlfImageVisual*, iAlfCtl->AppendVisualL( EAlfVisualTypeImage ) );
+    TAlfImageCommand imageCmd( *imageVisual, image );
+    imageCmd.ExecuteL( *iAlfEnv );
+    imageCmd.Size();
+    imageCmd.ImageVisual();
+    imageCmd.Image();
+    
+    TTestImageCmd testCmd( *imageVisual, image );
+    TAny* extensionParams = NULL;
+    testCmd.CommandExtension( KTestUid, &extensionParams );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTextCmdMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTextCmdMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTextCmdMethodsL, "TestTextCmdMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTextCmdMethodsL );
+    // Print to log file
+    iLog->Log( KTestTextCmdMethodsL );
+    
+    _LIT( KTestText, "Test" );
+    CAlfTextVisual* txtVisual =
+        STATIC_CAST( CAlfTextVisual*, iAlfCtl->AppendVisualL( EAlfVisualTypeText ) );
+    TAlfTextCommand txtCmd( *txtVisual, KTestText );
+    txtCmd.ExecuteL( *iAlfEnv );
+    txtCmd.Size();
+    txtCmd.TextVisual();
+    txtCmd.Text();
+    
+    TTestTextCmd testCmd( *txtVisual, KTestText );
+    TAny* extensionParams = NULL;
+    testCmd.CommandExtension( KTestUid, &extensionParams );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestValueCmdMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestValueCmdMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestValueCmdMethodsL, "TestValueCmdMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestValueCmdMethodsL );
+    // Print to log file
+    iLog->Log( KTestValueCmdMethodsL );
+    
+    CAlfTextVisual* txtVisual =
+        STATIC_CAST( CAlfTextVisual*, iAlfCtl->AppendVisualL( EAlfVisualTypeText ) );
+    TAlfValueCommand valueCmd( txtVisual, EAlfValueCommandVisualSetOpacity, 1.0 );
+    TAlfValueCommand valueCmd2( txtVisual, EAlfValueCommandVisualSetOpacity );
+    valueCmd.ExecuteL( *iAlfEnv );
+    valueCmd.Size();
+    valueCmd.TimedValue();
+    valueCmd.Target();
+    valueCmd.TransitionTime();
+    valueCmd.Speed();
+    
+    TTestValueCmd testCmd( txtVisual, EAlfValueCommandVisualSetOpacity );
+    TAny* extensionParams = NULL;
+    testCmd.CommandExtension( KTestUid, &extensionParams );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestPointCmdMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestPointCmdMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestPointCmdMethodsL, "TestPointCmdMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestPointCmdMethodsL );
+    // Print to log file
+    iLog->Log( KTestPointCmdMethodsL );
+    
+    CAlfTextVisual* txtVisual =
+        STATIC_CAST( CAlfTextVisual*, iAlfCtl->AppendVisualL( EAlfVisualTypeText ) );
+    TAlfPointCommand pointCmd( txtVisual, EAlfPointCommandVisualSetPos, EAlfOpSet );
+    TAlfRealPoint realPoint;
+    TAlfPointCommand pointCmd2( txtVisual, EAlfPointCommandVisualSetPos, realPoint );
+    TAlfPointCommand pointCmd3( txtVisual, EAlfPointCommandVisualSetPos, EAlfOpSet, realPoint );
+    pointCmd.ExecuteL( *iAlfEnv );
+    pointCmd.Size();
+    pointCmd.TimedPoint();
+    pointCmd.Target();
+    pointCmd.TransitionTime();
+    pointCmd.Speed();
+    
+    TTestPointCmd testCmd( txtVisual, EAlfPointCommandVisualSetPos, EAlfOpSet );
+    TAny* extensionParams = NULL;
+    testCmd.CommandExtension( KTestUid, &extensionParams );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTransCmdMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTransCmdMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTransCmdMethodsL, "TestTransCmdMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransCmdMethodsL );
+    // Print to log file
+    iLog->Log( KTestTransCmdMethodsL );
+    
+    iAlfCtrlGroup->EnableTransformationL();
+    CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
+    TAlfTransformationCommand transCmd( iAlfCtrlGroup, alfTrans );
+    transCmd.ExecuteL( *iAlfEnv );
+    transCmd.Size();
+    transCmd.Transformation();
+    transCmd.Step();
+    TAlfTimedValue timedValue;
+    transCmd.SetX( timedValue );
+    transCmd.SetY( timedValue );
+    transCmd.SetZ( timedValue );
+    transCmd.SetAngle( timedValue );
+    
+    TTestTransCmd testCmd( iAlfCtrlGroup, alfTrans );
+    TAny* extensionParams = NULL;
+    testCmd.CommandExtension( KTestUid, &extensionParams );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestMarkerCmdMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestMarkerCmdMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestMarkerCmdMethodsL, "TestMarkerCmdMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestMarkerCmdMethodsL );
+    // Print to log file
+    iLog->Log( KTestMarkerCmdMethodsL );
+    
+    TAlfMarkerCommand markerCmd( 1 );
+    markerCmd.ExecuteL( *iAlfEnv );
+    markerCmd.Size();
+    markerCmd.Id();
+    
+    TTestMarkerCmd testCmd( 1 );
+    TAny* extensionParams = NULL;
+    testCmd.CommandExtension( KTestUid, &extensionParams );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCustomEventCmdMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCustomEventCmdMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCustomEventCmdMethodsL, "TestCustomEventCmdMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCustomEventCmdMethodsL );
+    // Print to log file
+    iLog->Log( KTestCustomEventCmdMethodsL );
+    
+    TAlfCustomEventCommand customEventCmd( 1 );
+    customEventCmd.ExecuteL( *iAlfEnv );
+    customEventCmd.Size();
+    customEventCmd.Recipient();
+    customEventCmd.Param();
+    customEventCmd.EventData();
+    
+    TTestCustomEventCmd testCmd( 1 );
+    TAny* extensionParams = NULL;
+    testCmd.CommandExtension( KTestUid, &extensionParams );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockscontrol.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,664 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// CONSTANTS
+_LIT8( KVisualTag, "visual" );
+const TInt KBufSize = 64;
+
+// FORWARD DECLARATION
+class CTestCAlfControl : public CAlfControl
+    {
+public:
+    /**
+    * C++ default constructor.
+    */
+    CTestCAlfControl();
+    
+    /**
+    * Destructor.
+    */
+    ~CTestCAlfControl();
+    
+    /**
+     * It test protected function NotifyControlVisibility of CAlfControl
+     * @param aIsVisible  ETrue, if the control is now visible on the display.
+     *                    EFalse, if the control is about to the hidden on the display.
+     * @param aDisplay    The display on which the control's visibility is changing.
+     * return symbian error code
+     */
+    TInt TestNotifyControlVisibility( TBool aIsVisible, CAlfDisplay& aDisplay );
+    
+    /**
+     * It test protected function VisualAddedL of CAlfControl
+     * @param aVisual  Visual that was added.
+     * return symbian error code
+     */
+    TInt TestVisualAddedL( CAlfVisual* aVisual );
+    
+    /**
+     * It test protected function VisualRemoved of CAlfControl
+     * @param aVisual  Visual that was removed.
+     * return symbian error code
+     */
+    TInt TestVisualRemoved( CAlfVisual* aVisual );
+    
+    /**
+     * It test protected function ConnectionAddedL of CAlfControl
+     * @param aConnectedControl Connected child control
+     * @parar aRole Role of the child control.
+     * return symbian error code
+     */
+    TInt TestConnectionAddedL( CAlfControl* aConnectedControl, 
+                                            TInt aRole );
+    
+    /**
+     * It test protected function ConnectionRemoved of CAlfControl
+     * @param aConnectedControl Removed child control
+     * @parar aRole Role of the child control.
+     * return symbian error code
+     */
+    TInt TestConnectionRemoved( CAlfControl* aConnectedControl, 
+                                             TInt aRole );
+    
+    /**
+     * It test protected function HostChangingL of CAlfControl
+     * @param aNewHost New host control. If NULL, the host is removed.
+     * return symbian error code
+     */
+    TInt TestHostChangingL( CAlfControl* aNewHost );
+    
+    /*
+     * It test protected function VisualAddedL of CAlfControl
+     * @param aExtensionUid extension uid
+     * @parar aExtensionParams extension parameters
+     * return symbian error code
+     * */
+    TInt TestPropertyOwnerExtension(const TUid& aExtensionUid, 
+            TAny** aExtensionParams);
+    
+    };
+
+// -----------------------------------------------------------------------------
+// CTestCAlfControl::CTestCAlfControl
+// -----------------------------------------------------------------------------
+//
+CTestCAlfControl::CTestCAlfControl(){}
+// -----------------------------------------------------------------------------
+// CTestCAlfControl::~CTestCAlfControl
+// -----------------------------------------------------------------------------
+//
+CTestCAlfControl::~CTestCAlfControl(){}
+// -----------------------------------------------------------------------------
+// CTestCAlfControl::TestNotifyControlVisibility
+// -----------------------------------------------------------------------------
+//
+TInt CTestCAlfControl::TestNotifyControlVisibility( TBool aIsVisible, 
+        CAlfDisplay& aDisplay )
+    {
+    NotifyControlVisibility( aIsVisible, aDisplay );
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestCAlfControl::TestVisualAddedL
+// -----------------------------------------------------------------------------
+//
+TInt CTestCAlfControl::TestVisualAddedL( CAlfVisual* aVisual )
+    {
+    VisualAddedL( aVisual );
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestCAlfControl::TestVisualRemoved
+// -----------------------------------------------------------------------------
+//
+TInt CTestCAlfControl::TestVisualRemoved( CAlfVisual* aVisual )
+    {
+    VisualRemoved( aVisual );
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestCAlfControl::TestConnectionAddedL
+// -----------------------------------------------------------------------------
+//
+TInt CTestCAlfControl::TestConnectionAddedL( CAlfControl* aConnectedControl, 
+                                            TInt aRole )
+    {
+    ConnectionAddedL( aConnectedControl, aRole );
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestCAlfControl::TestConnectionRemoved
+// -----------------------------------------------------------------------------
+//
+TInt CTestCAlfControl::TestConnectionRemoved( CAlfControl* aConnectedControl, 
+                                             TInt aRole )
+    {
+    ConnectionRemoved( aConnectedControl, aRole );
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestCAlfControl::TestHostChangingL
+// -----------------------------------------------------------------------------
+//
+TInt CTestCAlfControl::TestHostChangingL( CAlfControl* aNewHost )
+    {
+    HostChangingL( aNewHost );
+    return KErrNone;
+    }
+// -----------------------------------------------------------------------------
+// CTestCAlfControl::TestPropertyOwnerExtension
+// -----------------------------------------------------------------------------
+//
+TInt CTestCAlfControl::TestPropertyOwnerExtension(const TUid& aExtensionUid, 
+            TAny** aExtensionParams)
+    {
+    PropertyOwnerExtension( aExtensionUid, aExtensionParams );
+    return KErrNone;
+    }
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlConstructorL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlConstructorL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlConstructorL, "TestAlfCtrlConstructorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlConstructorL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlConstructorL );
+    CAlfControl* ctrl = new ( ELeave ) CAlfControl;
+    CleanupStack::PushL( ctrl );
+    STIF_ASSERT_NOT_NULL( ctrl );
+    CleanupStack::PopAndDestroy( ctrl );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlConstructL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlConstructL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlConstructL, "TestAlfCtrlConstructL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlConstructL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlConstructL );
+    CAlfControl* ctrl = new ( ELeave ) CAlfControl;
+    CleanupStack::PushL( ctrl );
+    ctrl->ConstructL( *iAlfEnv );
+    CleanupStack::PopAndDestroy( ctrl );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlIdL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlIdL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlIdL, "TestAlfCtrlIdL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlIdL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlIdL );
+    CAlfControl* ctrl = new ( ELeave ) CAlfControl;
+    CleanupStack::PushL( ctrl );
+    ctrl->ConstructL( *iAlfEnv );
+    ctrl->SetId( 1 );
+    TInt vId = ctrl->Id();
+    STIF_ASSERT_EQUALS( 1, vId );
+    
+    CleanupStack::PopAndDestroy( ctrl );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlGetCtrlMember
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlGetCtrlMember( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlGetCtrlMember, "TestAlfCtrlGetCtrlMember" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlGetCtrlMember );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlGetCtrlMember );
+    CAlfEnv* env = &( iAlfCtl->Env() );
+    STIF_ASSERT_SAME( iAlfEnv, env );
+    
+    CAlfControlGroup* group = iAlfCtl->ControlGroup();
+    STIF_ASSERT_SAME( iAlfCtrlGroup, group );
+    
+    CAlfDisplay* display = iAlfCtl->Display();
+    STIF_ASSERT_SAME( iAlfDisplay, display );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlProcessVisualL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlProcessVisualL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlProcessVisualL, "TestAlfCtrlProcessVisualL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlProcessVisualL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlProcessVisualL );
+    CAlfVisual* vVisual = new ( ELeave ) CAlfVisual();
+    CleanupStack::PushL( vVisual );
+    vVisual->ConstructL( *iAlfCtl );
+    TInt err = iAlfCtl->Append( vVisual );
+    if ( err != KErrNone )
+        {
+        CleanupStack::PopAndDestroy( vVisual );
+        return err;
+        }
+    CleanupStack::Pop( vVisual );
+    TBuf8<KBufSize> vBuf(KVisualTag);
+    vVisual->SetTagL( vBuf );
+    STIF_ASSERT_EQUALS( 1, iAlfCtl->VisualCount() );
+    STIF_ASSERT_NOT_NULL( iAlfCtl->FindTag( vBuf ) );
+    STIF_ASSERT_SAME( vVisual, &( iAlfCtl->Visual( 0 ) ) );
+    
+    iAlfCtl->VisualLayoutUpdated( *vVisual );
+    iAlfCtl->VisualPrepareDrawFailed( *vVisual, -1 );
+    iAlfCtl->VisualDestroyed( *vVisual );
+    
+    iAlfCtl->Remove( vVisual );
+    STIF_ASSERT_EQUALS( 0, iAlfCtl->VisualCount() );
+    iAlfCtl->AppendVisualL( EAlfVisualTypeText );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlProcessConnectL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlProcessConnectL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlProcessConnectL, "TestAlfCtrlProcessConnectL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlProcessConnectL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlProcessConnectL );
+    CAlfControl* ctrl = new ( ELeave ) CAlfControl;
+    CleanupStack::PushL( ctrl );
+    ctrl->ConstructL( *iAlfEnv );
+    STIF_ASSERT_EQUALS( 0, (TInt)ctrl->Host() );
+    const TInt KAlfRoleSlave = 234;
+    iAlfCtl->AddConnectionL( ctrl, KAlfRoleSlave );
+    STIF_ASSERT_EQUALS( (TInt)iAlfCtl, (TInt)ctrl->Host() );
+    STIF_ASSERT_EQUALS( 0, iAlfCtl->FindConnection( ctrl ) );
+    STIF_ASSERT_EQUALS( 1, iAlfCtl->ConnectionCount() );
+    STIF_ASSERT_EQUALS( (TInt)ctrl, (TInt)&iAlfCtl->Connection( 0 ) );
+    iAlfCtl->ConnectionByOrdinal( 0 );
+    STIF_ASSERT_EQUALS( KAlfRoleSlave, iAlfCtl->ConnectionRole( 0 ) );
+    iAlfCtl->ConnectionOrdinal( 0 );
+    
+    iAlfCtl->RemoveConnection( ctrl );
+    STIF_ASSERT_EQUALS( 0, iAlfCtl->ConnectionCount() );
+    
+    CleanupStack::PopAndDestroy( ctrl );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlProcessRole
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlProcessRole( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlProcessRoleL, "TestAlfCtrlProcessRoleL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlProcessRoleL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlProcessRoleL );
+    iAlfCtl->SetRole( 1 );
+    STIF_ASSERT_EQUALS( 1, iAlfCtl->Role() );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlProcessHostL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlProcessHostL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlProcessHostL, "TestAlfCtrlProcessHostL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlProcessHostL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlProcessHostL );
+    CAlfControl* ctrl = new ( ELeave ) CAlfControl;
+    CleanupStack::PushL( ctrl );
+    ctrl->ConstructL( *iAlfEnv );
+    const TInt id = 123;
+    ctrl->SetHostId( id );
+    STIF_ASSERT_EQUALS( id, ctrl->HostId() );
+    
+    CleanupStack::PopAndDestroy( ctrl );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlHostDisplayL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlHostDisplayL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlHostDisplayL, "TestAlfCtrlHostDisplayL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlHostDisplayL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlHostDisplayL );
+    CAlfControl* ctrl = new ( ELeave ) CAlfControl;
+    CleanupStack::PushL( ctrl );
+    ctrl->ConstructL( *iAlfEnv );
+    
+    const TPoint source( 23 , 34 );
+    const TPoint converted = ctrl->HostToDisplay( source );
+    STIF_ASSERT_EQUALS( source.iX, converted.iX );
+    STIF_ASSERT_EQUALS( source.iY, converted.iY );\
+    
+    CleanupStack::PopAndDestroy( ctrl );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlDisplayPos
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlDisplayPos( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlDisplayPos, "TestAlfCtrlDisplayPos" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlDisplayPos );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlDisplayPos );
+    iAlfCtl->DisplayArea();
+    iAlfCtl->DisplayCenter();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlEventL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlEventL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlEventL, "TestAlfCtrlEventL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlEventL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlEventL );
+    TAlfEvent vEvent( 0 );
+    iAlfCtl->AcceptInput();
+    iAlfCtl->OfferEventL( vEvent );
+    const TInt num = 23;
+    TAlfCustomEventCommand event( num, iAlfCtl );
+    iAlfEnv->Send( event,num );
+    iAlfCtl->CancelAllCommands();
+    const TPoint point( num, num );
+    TBool result = iAlfCtl->HitTest( point );
+    STIF_ASSERT_FALSE( result );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlProcessFocus
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlProcessFocus( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlProcessFocus, "TestAlfCtrlProcessFocus" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlProcessFocus );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlProcessFocus );
+    iAlfCtl->AcquireFocus();
+    iAlfCtl->RelinquishFocus();
+    TBool vBool = iAlfCtl->Focus();
+    STIF_ASSERT_FALSE( vBool );
+    iAlfCtl->FocusedConnection();
+    vBool = iAlfCtl->IsFocusing();
+    STIF_ASSERT_FALSE( vBool );
+    iAlfCtl->FocusChanged( *iAlfDisplay, EFalse );
+    STIF_ASSERT_FALSE( iAlfCtl->IsFocusing() );
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlLayoutL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlLayoutL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlLayoutL, "TestAlfCtrlLayoutL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlLayoutL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlLayoutL );
+    
+    CAlfControl* ctrl = new ( ELeave ) CAlfControl;
+    CleanupStack::PushL( ctrl );
+    ctrl->ConstructL( *iAlfEnv );
+    iAlfCtl->AddConnectionL( ctrl, 0 );
+    iAlfCtl->AppendLayoutL( EAlfLayoutTypeFlow );
+    iAlfCtl->ContainerLayout( ctrl );
+    STIF_ASSERT_NULL( iAlfCtl->ContainerLayout( NULL ) );
+    iAlfCtl->RemoveConnection( ctrl );
+    CleanupStack::PopAndDestroy( ctrl );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlIdentifier
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlIdentifier( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlIdentifier, "TestAlfCtrlIdentifier" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlIdentifier );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlIdentifier );
+    
+    const TInt vId = iAlfCtl->Identifier();
+    STIF_ASSERT_NOT_EQUALS( 0, vId );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlBounds
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlBounds( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlBounds, "TestAlfCtrlBounds" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlBounds );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlBounds );
+    
+    const TRect vRect = iAlfCtl->Bounds();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlShowL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlShowL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlShowL, "TestAlfCtrlShowL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlShowL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlShowL );
+    
+    iAlfCtl->ShowL( *iAlfDisplay );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlAddAndRemoveVisualL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlAddAndRemoveVisualL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlAddAndRemoveVisualL, "TestAlfCtrlAddAndRemoveVisualL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlAddAndRemoveVisualL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlAddAndRemoveVisualL );
+    CTestCAlfControl* ctrl = new ( ELeave ) CTestCAlfControl;
+    CleanupStack::PushL( ctrl );
+    ctrl->ConstructL( *iAlfEnv );
+    CAlfVisual* vVisual = new ( ELeave ) CAlfVisual();
+    CleanupStack::PushL( vVisual );
+    vVisual->ConstructL( *ctrl );
+    CleanupStack::Pop( vVisual );
+    ctrl->TestVisualAddedL( vVisual );
+    ctrl->TestVisualRemoved( vVisual );
+    
+    CleanupStack::PopAndDestroy( ctrl );
+    
+    return KErrNone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlNotifyControlVisibilityL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlNotifyControlVisibilityL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlNotifyControlVisibilityL, "TestAlfCtrlNotifyControlVisibilityL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlNotifyControlVisibilityL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlNotifyControlVisibilityL );
+    CTestCAlfControl* ctrl = new ( ELeave ) CTestCAlfControl;
+    CleanupStack::PushL( ctrl );
+    ctrl->ConstructL( *iAlfEnv );
+    ctrl->TestNotifyControlVisibility( EFalse, *iAlfDisplay );
+    
+    CleanupStack::PopAndDestroy( ctrl );
+    
+    return KErrNone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlAddAndRemoveConnectionL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlAddAndRemoveConnectionL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlAddAndRemoveConnectionL, "TestAlfCtrlAddAndRemoveConnectionL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlAddAndRemoveConnectionL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlAddAndRemoveConnectionL );
+    CTestCAlfControl* ctrl = new ( ELeave ) CTestCAlfControl;
+    CleanupStack::PushL( ctrl );
+    ctrl->ConstructL( *iAlfEnv );
+    ctrl->TestConnectionAddedL( iAlfCtl, 1 );
+    ctrl->TestConnectionRemoved( iAlfCtl, 1 );
+    
+    CleanupStack::PopAndDestroy( ctrl );
+    
+    return KErrNone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlHostChangingL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlHostChangingL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlHostChangingL, "TestAlfCtrlHostChangingL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlHostChangingL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlHostChangingL );
+    CTestCAlfControl* ctrl = new ( ELeave ) CTestCAlfControl;
+    CleanupStack::PushL( ctrl );
+    ctrl->ConstructL( *iAlfEnv );
+    ctrl->TestHostChangingL( NULL );
+    
+    CleanupStack::PopAndDestroy( ctrl );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlPropertyOwnerExtensionL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlPropertyOwnerExtensionL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlPropertyOwnerExtensionL, "TestAlfCtrlPropertyOwnerExtensionL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlPropertyOwnerExtensionL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlPropertyOwnerExtensionL );
+    CTestCAlfControl* ctrl = new ( ELeave ) CTestCAlfControl;
+    CleanupStack::PushL( ctrl );
+    ctrl->ConstructL( *iAlfEnv );
+    
+    TUid vUid = { 0x00000000 };
+    ctrl->TestPropertyOwnerExtension( vUid, NULL );
+    
+    CleanupStack::PopAndDestroy( ctrl );
+    
+    return KErrNone;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockscontrolgroup.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlGroupResourceId
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlGroupResourceId( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlGroupResourceIdL, "TestAlfCtrlGroupResourceIdL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlGroupResourceIdL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlGroupResourceIdL );
+    
+    TInt vId = iAlfCtrlGroup->ResourceId();
+    STIF_ASSERT_EQUALS( 1, vId );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlGroupProcessCtrlL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlGroupProcessCtrlL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlGroupProcessCtrlL, "TestAlfCtrlGroupProcessCtrlL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlGroupProcessCtrlL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlGroupProcessCtrlL );
+    
+    CAlfControl* ctrl = new ( ELeave ) CAlfControl;
+    CleanupStack::PushL( ctrl );
+    ctrl->ConstructL( *iAlfEnv );
+    const TInt num = 23;
+    ctrl->SetId( num );
+    iAlfCtrlGroup->AppendL( ctrl );
+    STIF_ASSERT_EQUALS( 2, iAlfCtrlGroup->Count() );
+    CAlfControl* foundControl = &iAlfCtrlGroup->Control( 1 );
+    STIF_ASSERT_EQUALS( (TInt)ctrl, (TInt)foundControl );
+    iAlfCtrlGroup->FindControl( num );
+    foundControl = iAlfCtrlGroup->FindControl( num );
+    STIF_ASSERT_NOT_EQUALS( 0, (TInt)foundControl );
+    iAlfCtrlGroup->Remove( ctrl );
+    CleanupStack::PopAndDestroy( ctrl );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlGroupProcessInput
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlGroupProcessInput( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlGroupProcessInput, "TestAlfCtrlGroupProcessInput" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlGroupProcessInput );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlGroupProcessInput );
+    
+    iAlfCtrlGroup->SetAcceptInput( ETrue );
+    STIF_ASSERT_TRUE( iAlfCtrlGroup->AcceptInput() );
+    
+    return KErrNone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlGroupProcessTransformL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCtrlGroupProcessTransformL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCtrlGroupProcessTransformL, "TestAlfCtrlGroupProcessTransformL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCtrlGroupProcessTransformL );
+    // Print to log file
+    iLog->Log( KTestAlfCtrlGroupProcessTransformL );
+    
+    iAlfCtrlGroup->EnableTransformationL( ETrue );
+    STIF_ASSERT_TRUE( iAlfCtrlGroup->IsTransformed() );
+    iAlfCtrlGroup->Transformation();
+    iAlfCtrlGroup->EnableTransformationL( EFalse );
+    STIF_ASSERT_FALSE( iAlfCtrlGroup->IsTransformed() );
+    
+    return KErrNone;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockscurvepath.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,183 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCtrlGroupResourceId
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCurvePathNewL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCurvePathNewL, "TestAlfCurvePathNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathNewL );
+    // Print to log file
+    iLog->Log( KTestAlfCurvePathNewL );
+    
+    CAlfCurvePath* vPath = CAlfCurvePath::NewL( *iAlfEnv );
+    CleanupStack::PushL( vPath );
+    STIF_ASSERT_NOT_NULL( vPath );
+    CleanupStack::PopAndDestroy( vPath );
+    
+    vPath = NULL;
+    vPath = CAlfCurvePath::NewLC( *iAlfEnv );
+    STIF_ASSERT_NOT_NULL( vPath );
+    CleanupStack::PopAndDestroy( vPath );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCurvePathLoopL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCurvePathLoopL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCurvePathLoopL, "TestAlfCurvePathLoopL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathLoopL );
+    // Print to log file
+    iLog->Log( KTestAlfCurvePathLoopL );
+    
+    CAlfCurvePath* vPath = CAlfCurvePath::NewL( *iAlfEnv );
+    CleanupStack::PushL( vPath );
+    vPath->EnableLoop( ETrue );
+    STIF_ASSERT_TRUE( vPath->Loop() );
+    vPath->EnableLoop( EFalse );
+    STIF_ASSERT_FALSE( vPath->Loop() );
+    CleanupStack::PopAndDestroy( vPath );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCurvePathOffsetL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCurvePathOffsetL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCurvePathOffsetL, "TestAlfCurvePathOffsetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathOffsetL );
+    // Print to log file
+    iLog->Log( KTestAlfCurvePathOffsetL );
+    
+    CAlfCurvePath* vPath = CAlfCurvePath::NewL( *iAlfEnv );
+    CleanupStack::PushL( vPath );
+    TAlfTimedPoint offset;
+    offset.iX.SetValueNow( 0.5 );
+    offset.iY.SetValueNow( 0.6 );
+    vPath->SetOffset(offset);
+    
+    const TAlfTimedPoint& newOffSet = vPath->Offset();
+    STIF_ASSERT_EQUALS( (float)0.5, newOffSet.iX.ValueNow() );
+    STIF_ASSERT_EQUALS( (float)0.6, newOffSet.iY.ValueNow() );
+    CleanupStack::PopAndDestroy( vPath );
+    
+    return KErrNone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCurvePathProcessPointsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCurvePathProcessPointsL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCurvePathProcessPointsL, "TestAlfCurvePathProcessPointsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathProcessPointsL );
+    // Print to log file
+    iLog->Log( KTestAlfCurvePathProcessPointsL );
+    
+    CAlfCurvePath* vPath = CAlfCurvePath::NewL( *iAlfEnv );
+    CleanupStack::PushL( vPath );
+    TReal32 vRealnum = 0;
+    TPoint vStartPoiont( 0, 0 );
+    TPoint vEndPoint( 1, 1 );
+    TSize vSize( 1, 1 );
+    TAlfRealSize vRealSize( 0.5, 0.5 );
+    TAlfRealPoint vRealStartPoint;
+    TAlfRealPoint vRealEndPoint( vEndPoint );
+    vPath->SetOrigin( vRealnum );
+    
+    vPath->AppendLineL( vStartPoiont, vEndPoint );
+    vPath->AppendLineL( vRealStartPoint, vRealEndPoint );
+    
+    vPath->AppendArcL( vStartPoiont, vSize, 0.5, 0.5 );
+    vPath->AppendArcL( vRealStartPoint, vRealSize, 0.5, 0.5 );
+    STIF_ASSERT_NOT_EQUALS( (float)0.0, vPath->Length() )
+    vPath->MapValue( 0.5, 0 );
+    vPath->Evaluate( 0.4, vRealStartPoint );
+    CleanupStack::PopAndDestroy( vPath );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCurvePathResetL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCurvePathResetL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCurvePathResetL, "TestAlfCurvePathResetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathResetL );
+    // Print to log file
+    iLog->Log( KTestAlfCurvePathResetL );
+    
+    CAlfCurvePath* vPath = CAlfCurvePath::NewL( *iAlfEnv );
+    CleanupStack::PushL( vPath );
+    vPath->Reset();
+    CleanupStack::PopAndDestroy( vPath );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCurvePathMappingFunctionIdentifierL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCurvePathMappingFunctionIdentifierL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCurvePathMappingFunctionIdentifierL, "TestAlfCurvePathMappingFunctionIdentifierL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathMappingFunctionIdentifierL );
+    // Print to log file
+    iLog->Log( KTestAlfCurvePathMappingFunctionIdentifierL );
+    
+    CAlfCurvePath* vPath = CAlfCurvePath::NewL( *iAlfEnv );
+    CleanupStack::PushL( vPath );
+    vPath->MappingFunctionIdentifier();
+    CleanupStack::PopAndDestroy( vPath );
+    
+    return KErrNone;
+    }
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockscurvepathlayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,198 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// CONSTANTS
+const TInt KBufSize = 64;
+
+// FORWARD DECLARATION
+/*This class test protected function of CAlfCurvePathLayout*/
+class CTestCAlfCurvePathLayout : public CAlfCurvePathLayout
+    {
+public:
+    /**
+    * C++ default constructor.
+    */
+    CTestCAlfCurvePathLayout();
+    /**
+    * Destructor.
+    */
+    ~CTestCAlfCurvePathLayout();
+    /**
+    * TestProtectedFuncForVisual test protected functions of CAlfCurvePathLayout
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    TInt TestProtectedFuncForVisual( CStifItemParser& aItem );
+    };
+
+// -----------------------------------------------------------------------------
+// CTestCAlfCurvePathLayout::CTestCAlfCurvePathLayout
+// -----------------------------------------------------------------------------
+//
+CTestCAlfCurvePathLayout::CTestCAlfCurvePathLayout(){}
+
+// -----------------------------------------------------------------------------
+// CTestCAlfCurvePathLayout::~CTestCAlfCurvePathLayout
+// -----------------------------------------------------------------------------
+//
+CTestCAlfCurvePathLayout::~CTestCAlfCurvePathLayout(){}
+
+// -----------------------------------------------------------------------------
+// CTestCAlfCurvePathLayout::TestProtectedFuncForVisual
+// -----------------------------------------------------------------------------
+//
+TInt CTestCAlfCurvePathLayout::TestProtectedFuncForVisual( CStifItemParser& /*aItem*/ )
+    {
+    TUid vUid = { 0x00000000 };
+    PropertyOwnerExtension( vUid, NULL );
+    DoRemoveAndDestroyAllD();
+    return KErrNone;
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCurvePathLayoutAddNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCurvePathLayoutAddNewL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCurvePathLayoutAddNewL, "TestAlfCurvePathLayoutAddNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathLayoutAddNewL );
+    // Print to log file
+    iLog->Log( KTestAlfCurvePathLayoutAddNewL );
+    
+    CAlfCurvePathLayout* vLayout = CAlfCurvePathLayout::AddNewL( *iAlfCtl );
+    STIF_ASSERT_NOT_NULL( vLayout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCurvePathLayoutFullConstructL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCurvePathLayoutFullConstructL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCurvePathLayoutFullConstructL, "TestAlfCurvePathLayoutFullConstructL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathLayoutFullConstructL );
+    // Print to log file
+    iLog->Log( KTestAlfCurvePathLayoutFullConstructL );
+    
+    CAlfCurvePathLayout* vLayout = new ( ELeave ) CAlfCurvePathLayout;
+    CleanupStack::PushL( vLayout );
+    vLayout->ConstructL( *iAlfCtl );
+    CleanupStack::Pop( vLayout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCurvePathLayoutForLayoutL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCurvePathLayoutForLayoutL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCurvePathLayoutForLayoutL, "TestAlfCurvePathLayoutForLayoutL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathLayoutForLayoutL );
+    // Print to log file
+    iLog->Log( KTestAlfCurvePathLayoutForLayoutL );
+    
+    CAlfCurvePathLayout* vLayout = CAlfCurvePathLayout::AddNewL( *iAlfCtl );
+    vLayout->BaseUnit();
+    vLayout->CurvePath();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCurvePathLayoutForVisualL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCurvePathLayoutForVisualL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCurvePathLayoutForVisualL, "TestAlfCurvePathLayoutForVisualL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathLayoutForVisualL );
+    // Print to log file
+    iLog->Log( KTestAlfCurvePathLayoutForVisualL );
+    
+    CAlfCurvePathLayout* vLayout = CAlfCurvePathLayout::AddNewL( *iAlfCtl );
+    _LIT8( KTest, "tset" );
+    TBuf8<KBufSize> vBuf( KTest );
+    vLayout->FindTag( vBuf );
+    vLayout->UpdateChildrenLayout();
+    vLayout->RemoveAndDestroyAllD();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCurvePathLayoutForMapL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCurvePathLayoutForMapL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCurvePathLayoutForMapL, "TestAlfCurvePathLayoutForMapL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathLayoutForMapL );
+    // Print to log file
+    iLog->Log( KTestAlfCurvePathLayoutForMapL );
+    
+    CAlfCurvePathLayout* vLayout = CAlfCurvePathLayout::AddNewL( *iAlfCtl );
+    
+    vLayout->MappingFunctionIdentifier();
+    vLayout->MapValue( 1, 0 );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCurvePathLayoutProtectedFuncL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCurvePathLayoutProtectedFuncL( CStifItemParser& aItem )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCurvePathLayoutProtectedFuncL, "TestAlfCurvePathLayoutProtectedFuncL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCurvePathLayoutProtectedFuncL );
+    // Print to log file
+    iLog->Log( KTestAlfCurvePathLayoutProtectedFuncL );
+    
+    CTestCAlfCurvePathLayout* vLayout = new ( ELeave ) CTestCAlfCurvePathLayout;
+    CleanupStack::PushL( vLayout );
+    vLayout->ConstructL( *iAlfCtl );
+    vLayout->TestProtectedFuncForVisual( aItem );
+    CleanupStack::Pop( vLayout );
+    
+    return KErrNone;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksdecklayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,177 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// CONSTANTS
+const TInt KBufSize = 64;
+
+// FORWARD DECLARATION
+/*This class test protected function of CAlfDeckLayout*/
+class CTestCAlfDeckLayout : public CAlfDeckLayout
+    {
+public:
+    /**
+    * C++ default constructor.
+    */
+    CTestCAlfDeckLayout();
+    /**
+    * Destructor.
+    */
+    ~CTestCAlfDeckLayout();
+    /**
+    * TestProtectedFuncForVisual test protected functions of CAlfDeckLayout
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    TInt TestProtectedFuncForVisual( CStifItemParser& aItem );
+    };
+
+// -----------------------------------------------------------------------------
+// CTestCAlfDeckLayout::CTestCAlfDeckLayout
+// -----------------------------------------------------------------------------
+//
+CTestCAlfDeckLayout::CTestCAlfDeckLayout(){}
+
+// -----------------------------------------------------------------------------
+// CTestCAlfDeckLayout::~CTestCAlfDeckLayout
+// -----------------------------------------------------------------------------
+//
+CTestCAlfDeckLayout::~CTestCAlfDeckLayout(){}
+
+// -----------------------------------------------------------------------------
+// CTestCAlfDeckLayout::TestProtectedFuncForVisual
+// -----------------------------------------------------------------------------
+//
+TInt CTestCAlfDeckLayout::TestProtectedFuncForVisual( CStifItemParser& /*aItem*/ )
+    {
+    TUid vUid = { 0x00000000 };
+    PropertyOwnerExtension( vUid, NULL );
+    DoRemoveAndDestroyAllD();
+    return KErrNone;
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDeckLayoutAddNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDeckLayoutAddNewL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDeckLayoutAddNewL, "TestAlfDeckLayoutAddNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDeckLayoutAddNewL );
+    // Print to log file
+    iLog->Log( KTestAlfDeckLayoutAddNewL );
+    
+    CAlfDeckLayout* vLayout = CAlfDeckLayout::AddNewL( *iAlfCtl );
+    STIF_ASSERT_NOT_NULL( vLayout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDeckLayoutFullConstructL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDeckLayoutFullConstructL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDeckLayoutFullConstructL, "TestAlfDeckLayoutFullConstructL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDeckLayoutFullConstructL );
+    // Print to log file
+    iLog->Log( KTestAlfDeckLayoutFullConstructL );
+    
+    CAlfDeckLayout* vLayout = new ( ELeave ) CAlfDeckLayout;
+    CleanupStack::PushL( vLayout );
+    vLayout->ConstructL( *iAlfCtl );
+    CleanupStack::Pop( vLayout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDeckLayoutForLayoutL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDeckLayoutForLayoutL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDeckLayoutForLayoutL, "TestAlfDeckLayoutForLayoutL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDeckLayoutForLayoutL );
+    // Print to log file
+    iLog->Log( KTestAlfDeckLayoutForLayoutL );
+    
+    CAlfDeckLayout* vLayout = CAlfDeckLayout::AddNewL( *iAlfCtl );
+    vLayout->BaseUnit();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDeckLayoutForVisualL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDeckLayoutForVisualL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDeckLayoutForVisualL, "TestAlfDeckLayoutForVisualL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDeckLayoutForVisualL );
+    // Print to log file
+    iLog->Log( KTestAlfDeckLayoutForVisualL );
+    
+    CAlfDeckLayout* vLayout = CAlfDeckLayout::AddNewL( *iAlfCtl );
+    _LIT8( KTest, "tset" );
+    TBuf8<KBufSize> vBuf( KTest );
+    vLayout->FindTag( vBuf );
+    vLayout->UpdateChildrenLayout();
+    vLayout->RemoveAndDestroyAllD();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDeckLayoutProtectedFuncL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDeckLayoutProtectedFuncL( CStifItemParser& aItem )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDeckLayoutProtectedFuncL, "TestAlfDeckLayoutProtectedFuncL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDeckLayoutProtectedFuncL );
+    // Print to log file
+    iLog->Log( KTestAlfDeckLayoutProtectedFuncL );
+    
+    CTestCAlfDeckLayout* vLayout = new ( ELeave ) CTestCAlfDeckLayout;
+    CleanupStack::PushL( vLayout );
+    vLayout->ConstructL( *iAlfCtl );
+    vLayout->TestProtectedFuncForVisual( aItem );
+    CleanupStack::Pop( vLayout );
+    
+    return KErrNone;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksdisplay.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDisplayForBackgroundL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDisplayForBackgroundL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDisplayForBackgroundL, "TestAlfDisplayForBackgroundL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDisplayForBackgroundL );
+    // Print to log file
+    iLog->Log( KTestAlfDisplayForBackgroundL );
+    
+    iAlfDisplay->SetClearBackgroundL( CAlfDisplay::EClearWithColor );
+    RArray<TAlfDisplayBackgroundItem> vArray( 1 );
+    iAlfDisplay->SetBackgroundItemsL( vArray );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDisplayForRoster
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDisplayForRoster( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDisplayForRoster, "TestAlfDisplayForRoster" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDisplayForRoster );
+    // Print to log file
+    iLog->Log( KTestAlfDisplayForRoster );
+    
+    iAlfDisplay->Roster();
+    ( ( const CAlfDisplay*) iAlfDisplay )->Roster();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDisplayForVisibleArea
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDisplayForVisibleArea( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDisplayForVisibleAreaL, "TestAlfDisplayForVisibleAreaL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDisplayForVisibleAreaL );
+    // Print to log file
+    iLog->Log( KTestAlfDisplayForVisibleAreaL );
+    TRect rect( 0, 0, 1, 1 );
+    iAlfDisplay->SetVisibleArea( rect );
+//    iAlfDisplay->ForceSetVisibleArea( rect );
+    iAlfDisplay->VisibleArea();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDisplayForSetAttributesL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDisplayForSetAttributesL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDisplayForSetAttributesL, "TestAlfDisplayForSetAttributesL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDisplayForSetAttributesL );
+    // Print to log file
+    iLog->Log( KTestAlfDisplayForSetAttributesL );
+    
+//    iAlfDisplay->SetFocusedEditor( NULL );
+    iAlfDisplay->SetQuality( EAlfQualityFast );
+    iAlfDisplay->SetDirty();
+    iAlfDisplay->SetUseDepth( EFalse );
+    iAlfDisplay->SetUsageL( EAlfDisplayUsageGeneric );
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDisplayGetAttributes
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDisplayGetAttributes( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDisplayGetAttributes, "TestAlfDisplayGetAttributes" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDisplayGetAttributes );
+    // Print to log file
+    iLog->Log( KTestAlfDisplayGetAttributes );
+    
+    iAlfDisplay->Env();
+    iAlfDisplay->Quality();
+    iAlfDisplay->ObjectProvider();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDisplayFading
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDisplayFading( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDisplayFading, "TestAlfDisplayFading" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDisplayFading );
+    // Print to log file
+    iLog->Log( KTestAlfDisplayFading );
+    
+    iAlfDisplay->SuppressAutomaticFading();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDisplayHandlePointerEventL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDisplayHandlePointerEventL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDisplayHandlePointerEventL, "TestAlfDisplayHandlePointerEventL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDisplayHandlePointerEventL );
+    // Print to log file
+    iLog->Log( KTestAlfDisplayHandlePointerEventL );
+    
+    TPointerEvent vEvent;
+    iAlfDisplay->HandlePointerEventL( vEvent );
+    
+    return KErrNone;
+    }
+
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksdisplaybackgrounditem.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDisplayBgItemConstructor
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDisplayBgItemConstructor( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDisplayBgItemConstructor, "TestAlfDisplayBgItemConstructor" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDisplayBgItemConstructor );
+    // Print to log file
+    iLog->Log( KTestAlfDisplayBgItemConstructor );
+    
+    TAlfDisplayBackgroundItem vItem1;
+    
+    TRect rect( 0, 0, 1, 1 );
+    TAlfDisplayBackgroundItem vItem2( rect );
+    
+    TAknsItemID vId;
+    TAlfDisplayBackgroundItem vItem3( rect, vId );
+    
+    TAlfDisplayBackgroundItem vItem4( rect, vId, 0 );
+    
+    TRgb vRgb( KRgbBlack );
+    TAlfDisplayBackgroundItem vItem5( rect, vRgb );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDisplayBgItemSetAttributes
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDisplayBgItemSetAttributes( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDisplayBgItemSetAttributes, "TestAlfDisplayBgItemSetAttributes" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDisplayBgItemSetAttributes );
+    // Print to log file
+    iLog->Log( KTestAlfDisplayBgItemSetAttributes );
+    
+    TRgb vRgb( KRgbBlack );
+    TAknsItemID vId;
+    TRect rect( 0, 0, 1, 1 );
+    TAlfDisplayBackgroundItem vItem;
+    vItem.SetRect( rect );
+    vItem.SetColor( vRgb );
+    vItem.SetColor( vId, 0 );
+    vItem.SetSkinBackground( vId );
+    return KErrNone;
+    }
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksdropshadow.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// CONSTANTS
+const TInt KBufSize = 64;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDropShadowSetAttributesL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDropShadowSetAttributesL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDropShadowSetAttributesL, "TestAlfDropShadowSetAttributesL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDropShadowSetAttributesL );
+    // Print to log file
+    iLog->Log( KTestAlfDropShadowSetAttributesL );
+    CAlfTextVisual* vVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    _LIT( KTest, "test" );
+    TBuf<KBufSize> vBuf( KTest );
+    vVisual->SetTextL( vBuf );
+    vVisual->EnableDropShadowL();
+    CAlfDropShadow* vDropShadow = vVisual->DropShadowHandler();
+    TReal32 vReal = 0;
+    TAlfMetric vMetric( 0 );
+    TAlfTimedPoint vPoint;
+    TRgb vRgb( KRgbBlack );
+    TAknsItemID vId;
+    TAlfTimedValue vValue( 0 );
+    
+    vDropShadow->SetOffset( vReal, vMetric );
+    vDropShadow->SetOffset( vPoint );
+    vDropShadow->SetColor( vRgb );
+    vDropShadow->SetColor( vId, 0 );
+    vDropShadow->SetOpacity( vValue);
+    vDropShadow->SetRadius( vValue);
+    vDropShadow->SetScale( vValue);
+    
+    return KErrNone;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksdropshadowbrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,152 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDropShadowBrushNewFuncsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDropShadowBrushNewFuncsL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDropShadowBrushNewFuncsL, "TestAlfDropShadowBrushNewFuncsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDropShadowBrushNewFuncsL );
+    // Print to log file
+    iLog->Log( KTestAlfDropShadowBrushNewFuncsL );
+    
+    CAlfDropShadowBrush* vBrush = CAlfDropShadowBrush::NewL( *iAlfEnv, 0 );
+    CleanupStack::PushL( vBrush );
+    STIF_ASSERT_NOT_NULL( vBrush );
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    vBrush = NULL;
+    TAlfMetric vMetric( 0 );
+    vBrush = CAlfDropShadowBrush::NewL( *iAlfEnv, vMetric );
+    CleanupStack::PushL( vBrush );
+    STIF_ASSERT_NOT_NULL( vBrush );
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    vBrush = NULL;
+    vBrush = CAlfDropShadowBrush::NewLC( *iAlfEnv, 0 );
+    STIF_ASSERT_NOT_NULL( vBrush );
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    vBrush = NULL;
+    vBrush = CAlfDropShadowBrush::NewLC( *iAlfEnv, vMetric );
+    STIF_ASSERT_NOT_NULL( vBrush );
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDropShadowBrushSoftnessL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDropShadowBrushSoftnessL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDropShadowBrushSoftnessL, "TestAlfDropShadowBrushSoftnessL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDropShadowBrushSoftnessL );
+    // Print to log file
+    iLog->Log( KTestAlfDropShadowBrushSoftnessL );
+    
+    CAlfDropShadowBrush* vBrush = CAlfDropShadowBrush::NewLC( *iAlfEnv, 0 );
+    TAlfMetric vMetric( 0 );
+    vBrush->SetSoftness( vMetric );
+    TAlfTimedValue valueSet;
+    valueSet.SetValueNow( 0 );
+    const TInt num = 1000000;
+    valueSet.SetTarget( 1, num );
+    vBrush->SetSoftness( valueSet );
+    
+    const TAlfTimedValue& valueGet = vBrush->Softness();
+    STIF_ASSERT_EQUALS( (float)0.0, valueGet.ValueNow() );
+    STIF_ASSERT_EQUALS( (float)1.0, valueGet.Target() );
+    STIF_ASSERT_NOT_EQUALS( 0, valueGet.TimeToTargetinMilliSeconds() );
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDropShadowBrushDepthL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDropShadowBrushDepthL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDropShadowBrushDepthL, "TestAlfDropShadowBrushDepthL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDropShadowBrushDepthL );
+    // Print to log file
+    iLog->Log( KTestAlfDropShadowBrushDepthL );
+    
+    CAlfDropShadowBrush* vBrush = CAlfDropShadowBrush::NewLC( *iAlfEnv, 0 );
+    TAlfMetric vMetric( 0 );
+    vBrush->SetDepth( vMetric );
+    
+    TAlfTimedValue valueSet;
+    valueSet.SetValueNow( 0 );
+    const TInt num = 1000000;
+    valueSet.SetTarget( 1, num );
+    vBrush->SetDepth( valueSet );
+    
+    const TAlfTimedValue& valueGet = vBrush->Depth();
+    STIF_ASSERT_EQUALS( (float)0.0, valueGet.ValueNow() );
+    STIF_ASSERT_EQUALS( (float)1.0, valueGet.Target() );
+    STIF_ASSERT_NOT_EQUALS( 0, valueGet.TimeToTargetinMilliSeconds() );
+    
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfDropShadowBrushSetColorL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfDropShadowBrushSetColorL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfDropShadowBrushSetColorL, "TestAlfDropShadowBrushSetColorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfDropShadowBrushSetColorL );
+    // Print to log file
+    iLog->Log( KTestAlfDropShadowBrushSetColorL );
+    
+    CAlfDropShadowBrush* vBrush = CAlfDropShadowBrush::NewLC( *iAlfEnv, 0 );
+    TRgb vRgb( KRgbBlack );
+    vBrush->SetColor( vRgb );
+    
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    return KErrNone;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksenv.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,404 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+#include <alf/alfbatchbuffer.h>
+#include "testplatalfvisual.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvNewFuncsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvNewFuncsL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvNewFuncsL, "TestAlfEnvNewFuncsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvNewFuncsL );
+    // Print to log file
+    iLog->Log( KTestAlfEnvNewFuncsL );
+    
+    STIF_ASSERT_NOT_NULL( iAlfEnv );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvClient
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvClient( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvClient, "TestAlfEnvClient" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvClient );
+    // Print to log file
+    iLog->Log( KTestAlfEnvClient );
+    
+    iAlfEnv->Client();
+    iAlfEnv->TokenClient();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvNewDisplayL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvNewDisplayL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvNewDisplayL, "TestAlfEnvNewDisplayL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvNewDisplayL );
+    // Print to log file
+    iLog->Log( KTestAlfEnvNewDisplayL );
+    
+    TRect vRect( 0, 0, 1, 1 );
+    TUid vUid = { 0x00000001 };
+    STIF_ASSERT_EQUALS( 1, iAlfEnv->DisplayCount() );
+    STIF_ASSERT_SAME( iAlfDisplay, &iAlfEnv->PrimaryDisplay() );
+    TRAPD( err, iAlfEnv->NewDisplayL( vRect, CAlfEnv::ENewDisplayAsCoeControl, NULL,
+            CAlfDisplay::EDisplayNormal, vUid ) );
+    if ( err != KErrNone )
+        {
+        return KErrNone;
+        }
+    else
+        {
+        return KErrNone;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvCtrlGroupL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvCtrlGroupL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvCtrlGroupL, "TestAlfEnvCtrlGroupL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvCtrlGroupL );
+    // Print to log file
+    iLog->Log( KTestAlfEnvCtrlGroupL );
+    const TInt groupName = 23;
+    CAlfControlGroup& ctrlgroup = iAlfEnv->NewControlGroupL( groupName );
+    iAlfEnv->ControlGroup( ctrlgroup.ResourceId() );
+    CAlfControlGroup* group = iAlfEnv->FindControlGroup( groupName );
+    STIF_ASSERT_NOT_EQUALS( 0, (TInt)group );
+    iAlfEnv->DeleteControlGroup( groupName );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvProcessFresh
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvProcessFresh( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvProcessFresh, "TestAlfEnvProcessFresh" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvProcessFresh );
+    // Print to log file
+    iLog->Log( KTestAlfEnvProcessFresh );
+    
+    TAlfRefreshMode mode = EAlfRefreshModeManual;
+    iAlfEnv->SetRefreshMode(mode);
+    mode = EAlfRefreshModeAutomatic;
+    iAlfEnv->SetRefreshMode(mode);
+    mode = EAlfRefreshModeForced;
+    iAlfEnv->SetRefreshMode(mode);
+    
+    iAlfEnv->RefreshMode();
+    
+    TReal32 framerate = 0.0;
+    iAlfEnv->SetMaxFrameRate(framerate);
+    framerate = 1000.0;
+    iAlfEnv->SetMaxFrameRate(framerate);
+    framerate = 0.0;
+    iAlfEnv->SetMaxFrameRate(framerate);
+    iAlfEnv->ContinueRefresh();
+    iAlfEnv->PauseRefresh();
+    CAlfEnv::RefreshCallBack( iAlfEnv );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvProcessTextureManagerL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvProcessTextureManagerL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvProcessTextureManagerL, "TestAlfEnvProcessTextureManagerL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvProcessTextureManagerL );
+    // Print to log file
+    iLog->Log( KTestAlfEnvProcessTextureManagerL );
+    
+    TUid vUid = { 0x00000002 };
+    iAlfEnv->CreateSharedTextureManagerL( vUid );
+    CAlfTextureManager* found1 = iAlfEnv->SharedTextureManager( vUid );
+    STIF_ASSERT_NOT_EQUALS( 0 , (TInt)found1);
+    iAlfEnv->TextureManager();
+    iAlfEnv->TextStyleManager();
+    iAlfEnv->DeleteSharedTextureManager( vUid );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvObserverL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvObserverL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvObserverL, "TestAlfEnvObserverL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvObserverL );
+    // Print to log file
+    iLog->Log( KTestAlfEnvObserverL );
+    
+    iAlfEnv->AddActionObserverL( NULL );
+    iAlfEnv->RemoveActionObserver( NULL );
+    
+    return KErrNone;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvProcessCmd
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvProcessCmd( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvProcessCmd, "TestAlfEnvProcessCmd" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvProcessCmd );
+    // Print to log file
+    iLog->Log( KTestAlfEnvProcessCmd );
+    const TInt cmdnum = 23;
+    const TInt num = 1000000;
+    TAlfCustomEventCommand command( cmdnum );
+    iAlfEnv->Send(command);
+    iAlfEnv->Send( command, num );
+    iAlfEnv->CancelCommands( &command );
+    iAlfEnv->CancelCommands( NULL );
+    iAlfEnv->Send( command, num );
+    iAlfEnv->CancelCommands( &command, EAlfOpNone );
+    iAlfEnv->Send( command, num );
+    iAlfEnv->CancelCommands( &command, EAlfCommandTypeNone );
+    iAlfEnv->Send( command, num );
+    iAlfEnv->CancelCustomCommands( NULL );
+    iAlfEnv->Send( command, num );
+    iAlfEnv->CancelCustomCommands( NULL, cmdnum );
+    iAlfEnv->Send( command, num );
+    iAlfEnv->MilliSecondsUntilCommand( &command );
+    iAlfEnv->MilliSecondsUntilCommand( &command, EAlfOpNone );
+    iAlfEnv->MilliSecondsUntilCommand( &command, EAlfCommandTypeNone );
+    iAlfEnv->MilliSecondsUntilCustomCommand( NULL );
+    iAlfEnv->MilliSecondsUntilCustomCommand( NULL, 0 );
+    
+    return KErrNone;
+    
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvKeyAndPointerEventL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvKeyAndPointerEventL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvKeyAndPointerEventL, "TestAlfEnvKeyAndPointerEventL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvKeyAndPointerEventL );
+    // Print to log file
+    iLog->Log( KTestAlfEnvKeyAndPointerEventL );
+    
+    TKeyEvent vEvent;
+    TPointerEvent vPointEvent;
+    iAlfEnv->HandleKeyEventL( vEvent, EEventKeyDown );
+    iAlfEnv->HandlePointerEventL( vPointEvent, *iAlfDisplay );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvNotifyL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvNotifyL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvNotifyL, "TestAlfEnvNotifyL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvNotifyL );
+    // Print to log file
+    iLog->Log( KTestAlfEnvNotifyL );
+    
+    iAlfEnv->NotifySkinChangedL();
+    iAlfEnv->NotifyLayoutChangedL();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvProcessWidgetL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvProcessWidgetL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvProcessWidgetL, "TestAlfEnvProcessWidgetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvProcessWidgetL );
+    // Print to log file
+    iLog->Log( KTestAlfEnvProcessWidgetL );
+    iAlfEnv->WidgetFactory();
+    iAlfEnv->AppendWidgetL( NULL );
+    char* p = "test";
+    iAlfEnv->FindWidget( p );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvGetAttributes
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvGetAttributes( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvGetAttributes, "TestAlfEnvGetAttributes" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvGetAttributes );
+    // Print to log file
+    iLog->Log( KTestAlfEnvGetAttributes );
+
+    iAlfEnv->LayoutMetricsUtility();
+    iAlfEnv->Renderer();
+    iAlfEnv->LastReceivedPtrEvent();
+    CAlfBatchBuffer& batch = iAlfEnv->BatchBufferHandler();
+    const TAlfAutoFlushMode defaultFlushMode = batch.AutoFlushMode();
+    STIF_ASSERT_EQUALS( defaultFlushMode, EAlfAutoFlushDeferred );
+    iAlfEnv->Version();
+    iAlfEnv->Extension( 0 );
+    iAlfEnv->Display( 0 );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvFindControl
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvFindControl( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvFindControl, "TestAlfEnvFindControl" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvFindControl );
+    // Print to log file
+    iLog->Log( KTestAlfEnvFindControl );
+
+    iAlfCtl->SetId( 1 );
+    CAlfControl* vTemp = iAlfEnv->FindControl( 1 );
+    STIF_ASSERT_SAME( iAlfCtl, vTemp );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvFindDisplayIndex
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvFindDisplayIndex( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvFindDisplayIndex, "TestAlfEnvFindDisplayIndex" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvFindDisplayIndex );
+    // Print to log file
+    iLog->Log( KTestAlfEnvFindDisplayIndex );
+
+    TInt vIndex = iAlfEnv->FindDisplayIndex( *iAlfDisplay );
+    STIF_ASSERT_EQUALS( 0, vIndex );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvAddExtension
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvAddExtension( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvAddExtension, "TestAlfEnvAddExtension" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvAddExtension );
+    // Print to log file
+    iLog->Log( KTestAlfEnvAddExtension );
+
+    iAlfEnv->AddExtension( 0, NULL );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvSetAndReSetL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvSetAndReSetL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvSetAndReSetL, "TestAlfEnvSetAndReSetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvSetAndReSetL );
+    // Print to log file
+    iLog->Log( KTestAlfEnvSetAndReSetL );
+
+    const TInt num = 1000000;
+    iAlfEnv->SetIdleThreshold( num );
+    iAlfEnv->Release();
+    iAlfEnv->RestoreL();
+    iAlfEnv->SetFullScreenDrawing( ETrue );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEnvStatic
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEnvStatic( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEnvStatic, "TestAlfEnvStatic" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEnvStatic );
+    // Print to log file
+    iLog->Log( KTestAlfEnvStatic );
+    
+    CAlfEnv* vTemp = CAlfEnv::Static();
+    STIF_ASSERT_SAME( iAlfEnv, vTemp );
+    vTemp = NULL;
+    
+    return KErrNone;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksevent.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEventConstructor
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEventConstructor( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEventConstructor, "TestAlfEventConstructor" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEventConstructor );
+    // Print to log file
+    iLog->Log( KTestAlfEventConstructor );
+    
+    TAlfEvent vEvent1( 0 );
+    TAlfEvent vEvent2( 0, 0 );
+    TAlfScrollerEvent vScrollEvent( TAlfScrollerEvent::EMoveByItem,
+            TAlfScrollerEvent::EHorizontal, 0 );
+    TAlfEvent vEvent3( *iAlfDisplay, vScrollEvent );
+    TKeyEvent vKey;
+    TAlfEvent vEvent4( *iAlfDisplay, vKey, EEventKey );
+    TPointerEvent vPointer;
+    TAlfEvent vEvent5( *iAlfDisplay, vPointer );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEventParameters
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEventParameters( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEventParameters, "TestAlfEventParameters" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEventParameters );
+    // Print to log file
+    iLog->Log( KTestAlfEventParameters );
+    
+    TPointerEvent vPointer;
+    TAlfEvent vPointerEvent( *iAlfDisplay, vPointer );
+    vPointerEvent.PointerDown();
+    vPointerEvent.PointerUp();
+    vPointerEvent.PointerLongTap();
+    vPointerEvent.IsPointerEvent();
+    vPointerEvent.PointerEvent();
+    vPointerEvent.Type();
+    TAlfEvent vCustomEvent( 0, 0 );
+    vCustomEvent.IsCustomEvent();
+    TAlfScrollerEvent vScroll( TAlfScrollerEvent::EMoveByItem,
+            TAlfScrollerEvent::EHorizontal, 0 );
+    TAlfEvent vScrollEvent( *iAlfDisplay, vScroll );
+    vScrollEvent.ScrollerEvent();
+    vScrollEvent.IsScrollerEvent();
+    TKeyEvent vKey;
+    TAlfEvent vKeyEvent( *iAlfDisplay, vKey, EEventKey );
+    vKeyEvent.IsKeyEvent();
+    vKeyEvent.Code();
+    vKeyEvent.KeyEvent();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEventCustomData
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEventCustomData( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEventCustomData, "TestAlfEventCustomData" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEventCustomData );
+    // Print to log file
+    iLog->Log( KTestAlfEventCustomData );
+    
+    TAlfEvent vCustomEvent( 0, 0 );
+    vCustomEvent.CustomEventData();
+    vCustomEvent.CustomParameter();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfEventDisplayAndVisual
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfEventDisplayAndVisual( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfEventDisplayAndVisual, "TestAlfEventDisplayAndVisual" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfEventDisplayAndVisual );
+    // Print to log file
+    iLog->Log( KTestAlfEventDisplayAndVisual );
+    
+    TKeyEvent vKey;
+    TAlfEvent vKeyEvent( *iAlfDisplay, vKey, EEventKey );
+    vKeyEvent.Display();
+    vKeyEvent.SetVisual( NULL );
+    vKeyEvent.Visual();
+    
+    return KErrNone;
+    }
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksflowlayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,199 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// CONSTANTS
+const TInt KBufSize = 64;
+
+// FORWARD DECLARATION
+/*This class test protected functions of CAlfFlowLayout*/
+class CTestCAlfFlowLayout : public CAlfFlowLayout
+    {
+public:
+    /**
+    * C++ default constructor.
+    */
+    CTestCAlfFlowLayout();
+    /**
+    * Destructor.
+    */
+    ~CTestCAlfFlowLayout();
+    /**
+    * TestProtectedFuncForVisual test protected functions of CAlfFlowLayout
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    TInt TestProtectedFuncForVisual( CStifItemParser& aItem );
+    };
+
+// -----------------------------------------------------------------------------
+// CTestCAlfFlowLayout::CTestCAlfFlowLayout
+// -----------------------------------------------------------------------------
+//
+CTestCAlfFlowLayout::CTestCAlfFlowLayout(){}
+
+// -----------------------------------------------------------------------------
+// CTestCAlfFlowLayout::~CTestCAlfFlowLayout
+// -----------------------------------------------------------------------------
+//
+CTestCAlfFlowLayout::~CTestCAlfFlowLayout(){}
+
+// -----------------------------------------------------------------------------
+// CTestCAlfFlowLayout::TestProtectedFuncForVisual
+// -----------------------------------------------------------------------------
+//
+TInt CTestCAlfFlowLayout::TestProtectedFuncForVisual( CStifItemParser& /*aItem*/ )
+    {
+    TUid vUid = { 0x00000000 };
+    PropertyOwnerExtension( vUid, NULL );
+    DoRemoveAndDestroyAllD();
+    return KErrNone;
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfFlowLayoutAddNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfFlowLayoutAddNewL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfFlowLayoutAddNewL, "TestAlfFlowLayoutAddNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfFlowLayoutAddNewL );
+    // Print to log file
+    iLog->Log( KTestAlfFlowLayoutAddNewL );
+    
+    CAlfFlowLayout* vLayout = CAlfFlowLayout::AddNewL( *iAlfCtl );
+    STIF_ASSERT_NOT_NULL( vLayout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfFlowLayoutFullConstructL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfFlowLayoutFullConstructL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfFlowLayoutFullConstructL, "TestAlfFlowLayoutFullConstructL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfFlowLayoutFullConstructL );
+    // Print to log file
+    iLog->Log( KTestAlfFlowLayoutFullConstructL );
+    
+    CAlfFlowLayout* vLayout = new ( ELeave ) CAlfFlowLayout;
+    CleanupStack::PushL( vLayout );
+    vLayout->ConstructL( *iAlfCtl );
+    CleanupStack::Pop( vLayout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfFlowLayoutForLayoutL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfFlowLayoutForLayoutL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfFlowLayoutForLayoutL, "TestAlfFlowLayoutForLayoutL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfFlowLayoutForLayoutL );
+    // Print to log file
+    iLog->Log( KTestAlfFlowLayoutForLayoutL );
+    
+    CAlfFlowLayout* vLayout = CAlfFlowLayout::AddNewL( *iAlfCtl );
+    vLayout->BaseUnit();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfFlowLayoutForVisualL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfFlowLayoutForVisualL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfFlowLayoutForVisualL, "TestAlfFlowLayoutForVisualL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfFlowLayoutForVisualL );
+    // Print to log file
+    iLog->Log( KTestAlfFlowLayoutForVisualL );
+    
+    CAlfFlowLayout* vLayout = CAlfFlowLayout::AddNewL( *iAlfCtl );
+    _LIT8( KTest, "tset" );
+    TBuf8<KBufSize> vBuf( KTest );
+    vLayout->FindTag( vBuf );
+    vLayout->UpdateChildrenLayout();
+    vLayout->RemoveAndDestroyAllD();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfFlowLayoutProtectedFuncL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfFlowLayoutProtectedFuncL( CStifItemParser& aItem )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfFlowLayoutProtectedFuncL, "TestAlfFlowLayoutProtectedFuncL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfFlowLayoutProtectedFuncL );
+    // Print to log file
+    iLog->Log( KTestAlfFlowLayoutProtectedFuncL );
+    
+    CTestCAlfFlowLayout* vLayout = new ( ELeave ) CTestCAlfFlowLayout;
+    CleanupStack::PushL( vLayout );
+    vLayout->ConstructL( *iAlfCtl );
+    vLayout->TestProtectedFuncForVisual( aItem );
+    CleanupStack::Pop( vLayout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfFlowLayoutSetParametersL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfFlowLayoutSetParametersL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfFlowLayoutSetParametersL, "TestAlfFlowLayoutSetParametersL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfFlowLayoutSetParametersL );
+    // Print to log file
+    iLog->Log( KTestAlfFlowLayoutSetParametersL );
+    
+    CAlfFlowLayout* vLayout = CAlfFlowLayout::AddNewL( *iAlfCtl );
+    vLayout->SetFlowDirection( CAlfFlowLayout::EFlowHorizontal );
+    vLayout->SetCentering( ETrue );
+    vLayout->SetMode( CAlfFlowLayout::EModeCenterPerpendicular );
+    vLayout->Mode();
+    
+    return KErrNone;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksframebrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,124 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfFrameBrushNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfFrameBrushNewL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfFrameBrushNewL, "TestAlfFrameBrushNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfFrameBrushNewL );
+    // Print to log file
+    iLog->Log( KTestAlfFrameBrushNewL );
+    
+    TAlfImage vImage;
+    TUid vUid;
+    vUid.Null();
+    CAlfFrameBrush* vBrush = CAlfFrameBrush::NewL( *iAlfEnv, vImage, 
+            TAlfXYMetric( 0, 0) );
+    CleanupStack::PushL( vBrush );
+    STIF_ASSERT_NOT_NULL( vBrush );
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    vBrush = NULL;
+    vBrush = CAlfFrameBrush::NewLC( *iAlfEnv, vImage, TAlfXYMetric( 0, 0 ) );
+    STIF_ASSERT_NOT_NULL( vBrush );
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    vBrush = NULL;
+    vBrush = CAlfFrameBrush::NewL( *iAlfEnv, KAknsIIDQsnFrList, 
+            TAlfXYMetric( 0, 0 ) );
+    CleanupStack::PushL( vBrush );
+    STIF_ASSERT_NOT_NULL( vBrush );
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    vBrush = NULL;
+    vBrush = CAlfFrameBrush::NewLC( *iAlfEnv, KAknsIIDQsnFrList, TAlfXYMetric( 0, 0 ) );
+    STIF_ASSERT_NOT_NULL( vBrush );
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    vBrush = NULL;
+    vBrush = CAlfFrameBrush::NewL( *iAlfEnv, KAknsIIDQsnFrList );
+    CleanupStack::PushL( vBrush );
+    STIF_ASSERT_NOT_NULL( vBrush );
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    vBrush = NULL;
+    vBrush = CAlfFrameBrush::NewLC( *iAlfEnv, KAknsIIDQsnFrList );
+    STIF_ASSERT_NOT_NULL( vBrush );
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfFrameBrushSetParaL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfFrameBrushSetParaL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfFrameBrushSetParaL, "TestAlfFrameBrushSetParaL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfFrameBrushSetParaL );
+    // Print to log file
+    iLog->Log( KTestAlfFrameBrushSetParaL );
+    
+    TAlfImage vImage;
+    TUid vUid = { 0x00000000 };
+    CAlfTextureManager* vTextManager = iAlfEnv->CreateSharedTextureManagerL( vUid );
+    CAlfTexture* vText = &( vTextManager->BlankTexture() );
+    vImage.SetTexture( *vText );
+    TAlfXYMetric vMetric;
+    CAlfFrameBrush* vBrush = CAlfFrameBrush::NewL( *iAlfEnv, vImage, vMetric );
+    CleanupStack::PushL( vBrush );
+    
+    TAlfImage vNewImage;
+    TRect vInner( 0, 0, 100, 100 );
+    TRect vOuter( 10, 10, 90, 90 );
+    vBrush->SetFrameRectsL( vInner, vOuter );
+    TAlfMetric valueSet(2.f);
+    vBrush->SetEdgeOffset( valueSet );
+    vBrush->SetImage( vNewImage );
+    TAlfImage emptyImage;
+    const TInt KMaxEnumValue = 9;
+    for ( TInt i = 0;i < KMaxEnumValue; i++ )
+        {
+        vBrush->SetImage(CAlfFrameBrush::TFrameParts(i), emptyImage);
+        }
+    
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    
+    return KErrNone;
+    }
+
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksgencomponent.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TInt KBufSize = 64;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfGenComponentNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfGenComponentNewL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfGenComponentNewL, "TestAlfGenComponentNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfGenComponentNewL );
+    // Print to log file
+    iLog->Log( KTestAlfGenComponentNewL );
+    _LIT8( KTest, "test" );
+    TBuf8<KBufSize> vBuf( KTest );
+    CAlfGenComponent* vComponent = CAlfGenComponent::NewL( *iAlfEnv, 0, 0x0DDDDDDE,
+            vBuf );
+    CleanupStack::PushL( vComponent );
+    STIF_ASSERT_NOT_NULL( vComponent );
+    CleanupStack::PopAndDestroy( vComponent );
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfGenComponentProcessL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfGenComponentProcessL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfGenComponentProcessL, "TestAlfGenComponentProcessL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfGenComponentProcessL );
+    // Print to log file
+    iLog->Log( KTestAlfGenComponentProcessL );
+    _LIT8( KTest, "test" );
+    TBuf8<KBufSize> vBuf( KTest );
+    CAlfGenComponent* vComponent = CAlfGenComponent::NewL( *iAlfEnv, 0, 0x0DDDDDDE,
+            vBuf );
+    CleanupStack::PushL( vComponent );
+    vComponent->Identifier();
+    _LIT8( KInput, "in" );
+    TBuf8<KBufSize> vInputBuf( KInput );
+    _LIT8( KOut, "out" );
+    TBuf8<KBufSize> vOutBuf( KOut );
+    vComponent->DoSynchronousCmd( 0, vInputBuf, vOutBuf );
+    vComponent->CancelAsynchCmd( 0 );
+    vComponent->DoAsynchronousCmdL( 0, vInputBuf, vOutBuf, NULL );
+    vComponent->DoCmdNoReply( 0 , vInputBuf );
+    
+    CleanupStack::PopAndDestroy( vComponent );
+    
+    return KErrNone;
+    }
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksgradientbrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfGradientBrushNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfGradientBrushNewL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfGradientBrushNewL, "TestAlfGradientBrushNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfGradientBrushNewL );
+    // Print to log file
+    iLog->Log( KTestAlfGradientBrushNewL );
+    
+    CAlfGradientBrush* vBrush = CAlfGradientBrush::NewL( *iAlfEnv );
+    CleanupStack::PushL( vBrush );
+    STIF_ASSERT_NOT_NULL( vBrush );
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    vBrush = NULL;
+    vBrush = CAlfGradientBrush::NewLC( *iAlfEnv );
+    STIF_ASSERT_NOT_NULL( vBrush );
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfGradientBrushSetL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfGradientBrushSetL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfGradientBrushSetL, "TestAlfGradientBrushSetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfGradientBrushSetL );
+    // Print to log file
+    iLog->Log( KTestAlfGradientBrushSetL );
+    
+    CAlfGradientBrush* vBrush = CAlfGradientBrush::NewLC( *iAlfEnv );
+    vBrush->SetDirection( CAlfGradientBrush::EDirectionLeft );
+    TRgb vRgb( KRgbBlue );
+    vBrush->SetColor( vRgb );
+    TAlfImage vImage;
+    vBrush->SetImage( vImage );
+    vBrush->AppendColorL( 1.0, vRgb);
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfGradientBrushGetL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfGradientBrushGetL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfGradientBrushGetL, "TestAlfGradientBrushGetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfGradientBrushGetL );
+    // Print to log file
+    iLog->Log( KTestAlfGradientBrushGetL );
+    
+    CAlfGradientBrush* vBrush = CAlfGradientBrush::NewLC( *iAlfEnv );
+    vBrush->Color( 0 );
+    vBrush->Opacity( 0 );
+    vBrush->Image();
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    return KErrNone;
+    }
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksgridlayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,235 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// CONSTANTS
+const TInt KBufSize = 64;
+
+// FORWARD DECLARATION
+/*This class test protected functions of CAlfGridLayout*/
+class CTestCAlfGridLayout : public CAlfGridLayout
+    {
+public:
+    /**
+    * C++ default constructor.
+    */
+    CTestCAlfGridLayout();
+    /**
+    * Destructor.
+    */
+    ~CTestCAlfGridLayout();
+    /**
+    * TestProtectedFuncForVisual test protected functions of CAlfGridLayout
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    TInt TestProtectedFuncForVisual( CStifItemParser& aItem );
+    };
+
+// -----------------------------------------------------------------------------
+// CTestCAlfGridLayout::CTestCAlfGridLayout
+// -----------------------------------------------------------------------------
+//
+CTestCAlfGridLayout::CTestCAlfGridLayout(){}
+
+// -----------------------------------------------------------------------------
+// CTestCAlfGridLayout::~CTestCAlfGridLayout
+// -----------------------------------------------------------------------------
+//
+CTestCAlfGridLayout::~CTestCAlfGridLayout(){}
+
+// -----------------------------------------------------------------------------
+// CTestCAlfGridLayout::TestProtectedFuncForVisual
+// -----------------------------------------------------------------------------
+//
+TInt CTestCAlfGridLayout::TestProtectedFuncForVisual( CStifItemParser& /*aItem*/ )
+    {
+    TUid vUid = { 0x00000000 };
+    PropertyOwnerExtension( vUid, NULL );
+    DoRemoveAndDestroyAllD();
+    return KErrNone;
+    }
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfGridLayoutAddNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfGridLayoutAddNewL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfGridLayoutAddNewL, "TestAlfGridLayoutAddNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfGridLayoutAddNewL );
+    // Print to log file
+    iLog->Log( KTestAlfGridLayoutAddNewL );
+    
+    CAlfGridLayout* vLayout = CAlfGridLayout::AddNewL( *iAlfCtl, 1, 1 );
+    STIF_ASSERT_NOT_NULL( vLayout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfGridLayoutFullConstructL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfGridLayoutFullConstructL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfGridLayoutFullConstructL, "TestAlfGridLayoutFullConstructL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfGridLayoutFullConstructL );
+    // Print to log file
+    iLog->Log( KTestAlfGridLayoutFullConstructL );
+    
+    CAlfGridLayout* vLayout = new ( ELeave ) CAlfGridLayout;
+    CleanupStack::PushL( vLayout );
+    vLayout->ConstructL( *iAlfCtl );
+    CleanupStack::Pop( vLayout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfGridLayoutForLayoutL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfGridLayoutForLayoutL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfGridLayoutForLayoutL, "TestAlfGridLayoutForLayoutL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfGridLayoutForLayoutL );
+    // Print to log file
+    iLog->Log( KTestAlfGridLayoutForLayoutL );
+    
+    CAlfGridLayout* vLayout = CAlfGridLayout::AddNewL( *iAlfCtl, 1, 1 );
+    vLayout->BaseUnit();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfGridLayoutForVisualL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfGridLayoutForVisualL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfGridLayoutForVisualL, "TestAlfGridLayoutForVisualL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfGridLayoutForVisualL );
+    // Print to log file
+    iLog->Log( KTestAlfGridLayoutForVisualL );
+    
+    CAlfGridLayout* vLayout = CAlfGridLayout::AddNewL( *iAlfCtl, 1, 1 );
+    _LIT8( KTest, "tset" );
+    TBuf8<KBufSize> vBuf( KTest );
+    vLayout->FindTag( vBuf );
+    vLayout->UpdateChildrenLayout();
+    vLayout->RemoveAndDestroyAllD();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfGridLayoutProtectedFuncL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfGridLayoutProtectedFuncL( CStifItemParser& aItem )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfGridLayoutProtectedFuncL, "TestAlfGridLayoutProtectedFuncL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfGridLayoutProtectedFuncL );
+    // Print to log file
+    iLog->Log( KTestAlfGridLayoutProtectedFuncL );
+    
+    CTestCAlfGridLayout* vLayout = new ( ELeave ) CTestCAlfGridLayout;
+    CleanupStack::PushL( vLayout );
+    vLayout->ConstructL( *iAlfCtl );
+    vLayout->TestProtectedFuncForVisual( aItem );
+    CleanupStack::Pop( vLayout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfGridLayoutSetParametersL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfGridLayoutSetParametersL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfGridLayoutSetParametersL, "TestAlfGridLayoutSetParametersL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfGridLayoutSetParametersL );
+    // Print to log file
+    iLog->Log( KTestAlfGridLayoutSetParametersL );
+    
+    CAlfGridLayout* vLayout = CAlfGridLayout::AddNewL( *iAlfCtl, 1, 1 );
+    vLayout->SetColumnsL( 1 );
+    vLayout->SetRowsL( 1 );
+    RArray<TInt> vWeights(2);
+    vWeights.Append( 1 );
+    vWeights.Append( 1 );
+    vLayout->SetRowsL( vWeights );
+    vLayout->SetColumnsL( vWeights );
+    TAlfMetric vMetric( 1 );
+    vLayout->FillWeightsL( EAlfGridColumn, 1, vMetric );
+    vLayout->InsertWeightL( EAlfGridColumn, vMetric, 0 );
+    vLayout->ReplaceWeightL( EAlfGridColumn, vMetric, 1 );
+    vLayout->DimensionCount( EAlfGridColumn );
+    vLayout->RemoveWeightL( EAlfGridColumn, 1 );
+    vLayout->SetExpanding( 0 );
+    vLayout->OrdinalToBlock( 0 );
+    vLayout->SetLayoutModeFlags( EAlfGridColumn, 0 );
+    vLayout->ClearLayoutModeFlags( EAlfGridColumn, 0 );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfGridLayoutGetParaL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfGridLayoutGetParaL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfGridLayoutGetParaL, "TestAlfGridLayoutGetParaL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfGridLayoutGetParaL );
+    // Print to log file
+    iLog->Log( KTestAlfGridLayoutGetParaL );
+    
+    CAlfGridLayout* vLayout = CAlfGridLayout::AddNewL( *iAlfCtl, 1, 1 );
+    TAlfMetric vMetric( 1 );
+    vLayout->InsertWeightL( EAlfGridColumn, vMetric, 0 );
+    vLayout->Weight( EAlfGridColumn, 1 );
+    vLayout->LayoutModeFlags( EAlfGridColumn );
+    vLayout->RowCount();
+    vLayout->ColumnCount();
+    
+    return KErrNone;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksimage.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+#include <aknsconstants.h>
+
+#include "testplatalfvisual.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfImageConstructorL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfImageConstructorL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfImageConstructorL, "TestAlfImageConstructorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImageConstructorL );
+    // Print to log file
+    iLog->Log( KTestAlfImageConstructorL );
+    
+    TAlfImage vImage1;
+    TUid vUid = { 0x00000000 };
+    CAlfTextureManager* vTextManager = iAlfEnv->CreateSharedTextureManagerL( vUid );
+    const CAlfTexture* vText = vTextManager->Texture( 0 );
+    TAlfImage vImage2( *vText );
+    TAlfImage vImage3( KAknsIIDNone, TSize( 1, 1) );
+    TAlfImage vImage4( NULL, TSize( 1, 1), EAspectRatioPreservedAndUnusedSpaceRemoved,
+           NULL, 0, 0, 0, 0, 0, 0, EAlfTextureFlagDefault, 0, NULL );
+    TAlfImage vImage5( vUid, EAknsAppIconTypeList, 
+            TSize( 1, 1), EAspectRatioPreserved, 0, 0, 0, 0 );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfImageSetAttributesL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfImageSetAttributesL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfImageSetAttributesL, "TestAlfImageSetAttributesL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImageSetAttributesL );
+    // Print to log file
+    iLog->Log( KTestAlfImageSetAttributesL );
+    
+    TAlfImage vImage;
+    TUid vUid = { 0x00000000 };
+    CAlfTextureManager* vTextManager = iAlfEnv->CreateSharedTextureManagerL( vUid );
+    CAlfTexture* vText = &( vTextManager->BlankTexture() );
+    vImage.SetTexture( *vText );
+    vImage.Translate( 0, 0 );
+    vImage.Scale( 1, 1 );
+
+    vImage.SetTexCoords();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfImageGetAttributesL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfImageGetAttributesL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfImageGetAttributesL, "TestAlfImageGetAttributesL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImageGetAttributesL );
+    // Print to log file
+    iLog->Log( KTestAlfImageGetAttributesL );
+    
+    TAlfImage vImage;
+    TUid vUid = { 0x00000000 };
+    CAlfTextureManager* vTextManager = iAlfEnv->CreateSharedTextureManagerL( vUid );
+    CAlfTexture* vText = &( vTextManager->BlankTexture() );
+    vImage.SetTexture( *vText );
+    vImage.HasTexture();
+    vImage.BottomRight();
+    vImage.TopLeft();
+    vImage.Texture();
+    
+    return KErrNone;
+    }
+
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksimagebrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfImageBrushNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfImageBrushNewL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfImageBrushNewL, "TestAlfImageBrushNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImageBrushNewL );
+    // Print to log file
+    iLog->Log( KTestAlfImageBrushNewL );
+    
+    TAlfImage vImage;
+    TUid vUid = { 0x00000000 };
+    CAlfTextureManager* vTextManager = iAlfEnv->CreateSharedTextureManagerL( vUid );
+    CAlfTexture* vText = &( vTextManager->BlankTexture() );
+    vImage.SetTexture( *vText );
+    CAlfImageBrush* vBrush = CAlfImageBrush::NewL( *iAlfEnv, vImage );
+    CleanupStack::PushL( vBrush );
+    STIF_ASSERT_NOT_NULL( vBrush );
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    vBrush = NULL;
+    vBrush = CAlfImageBrush::NewLC( *iAlfEnv, vImage );
+    STIF_ASSERT_NOT_NULL( vBrush );
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfImageBrushSetAndGetParaL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfImageBrushSetAndGetParaL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfImageBrushSetAndGetParaL, "TestAlfImageBrushSetAndGetParaL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImageBrushSetAndGetParaL );
+    // Print to log file
+    iLog->Log( KTestAlfImageBrushSetAndGetParaL );
+    
+    TAlfImage vImage;
+    TUid vUid = { 0x00000000 };
+    CAlfTextureManager* vTextManager = iAlfEnv->CreateSharedTextureManagerL( vUid );
+    CAlfTexture* vText = &( vTextManager->BlankTexture() );
+    vImage.SetTexture( *vText );
+    CAlfImageBrush* vBrush = CAlfImageBrush::NewLC( *iAlfEnv, vImage );
+    vBrush->SetScale( CAlfImageVisual::EScaleFitHeight );
+    TAlfImage vNewImage;
+    CAlfTexture* vNewText = &( vTextManager->BlankTexture() );
+    vNewImage.SetTexture( *vNewText );
+    vBrush->SetImage( vNewImage );
+    vBrush->SetBorders( 1, 1, 1, 1 );
+    TAlfTimedPoint vPoint( 1, 1 );
+    vBrush->SetOffset( vPoint );
+    TAlfTimedValue vValue( 1 );
+    vBrush->SetScale( vValue );
+    vBrush->Image();
+    vBrush->BorderDrawingEnabled();
+    vBrush->CenterDrawingEnabled();
+    vBrush->Offset();
+    vBrush->Scale();
+    
+    CleanupStack::PopAndDestroy( vBrush );
+    
+    return KErrNone;
+    }
+
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksimageloaderutil.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// CONSTANTS
+const TInt KBufSize = 64;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfImgLoadUtilConstructorL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfImgLoadUtilConstructorL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfImgLoadUtilConstructorL, "TestAlfImgLoadUtilConstructorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImgLoadUtilConstructorL );
+    // Print to log file
+    iLog->Log( KTestAlfImgLoadUtilConstructorL );
+    
+    CAlfImageLoaderUtil* vUtil = new ( ELeave ) CAlfImageLoaderUtil;
+    CleanupStack::PushL( vUtil );
+    STIF_ASSERT_NOT_NULL( vUtil );
+    CleanupStack::PopAndDestroy( vUtil );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfImgLoadUtilCreateImageLoaderL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfImgLoadUtilCreateImageLoaderL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfImgLoadUtilCreateImageLoaderL, "TestAlfImgLoadUtilCreateImageLoaderL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImgLoadUtilCreateImageLoaderL );
+    // Print to log file
+    iLog->Log( KTestAlfImgLoadUtilCreateImageLoaderL );
+    
+    CAlfImageLoaderUtil* vUtil = new ( ELeave ) CAlfImageLoaderUtil;
+    CleanupStack::PushL( vUtil );
+    const TInt KIconIdMessaging = 268458181; 
+    TUid uid; 
+    uid.iUid = KIconIdMessaging;
+    vUtil->CreateImageLoaderL( uid, EAknsAppIconTypeContext );
+    TAknsItemID vID;
+    TRect vInnerRect( 0, 0, 1, 1 );
+    TRect vOutRect( 0, 0, 1, 1 );
+    vUtil->CreateImageLoaderL( vID, vInnerRect, vOutRect );
+    _LIT( KBitmapFile, "Z:\\resource\\apps\\avkon2.mbm" );
+    TBuf<KBufSize> vBuf( KBitmapFile );
+    const TInt number = 6000;
+    vUtil->CreateImageLoaderL( vID, vBuf, number, number );
+    vUtil->CreateSVGImageLoaderL( vBuf );
+    CleanupStack::PopAndDestroy( vUtil );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfImgLoadUtilSetL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfImgLoadUtilSetL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfImgLoadUtilSetL, "TestAlfImgLoadUtilSetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImgLoadUtilSetL );
+    // Print to log file
+    iLog->Log( KTestAlfImgLoadUtilSetL );
+    
+    CAlfImageLoaderUtil* vUtil = new ( ELeave ) CAlfImageLoaderUtil;
+    CleanupStack::PushL( vUtil );
+    TUid vUid = { 0x00000001 };
+    vUtil->CreateImageLoaderL( vUid, EAknsAppIconTypeContext );
+    vUtil->SetSize( TSize( 1, 1 ) );
+    vUtil->SetSkinInstance( NULL );
+    CleanupStack::PopAndDestroy( vUtil );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfAutoSizeImgLoadUtilSetL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfAutoSizeImgLoadUtilSetL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfAutoSizeImgLoadUtilSetL, "TestAlfAutoSizeImgLoadUtilSetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfAutoSizeImgLoadUtilSetL );
+    // Print to log file
+    iLog->Log( KTestAlfAutoSizeImgLoadUtilSetL );
+    
+    CAlfAutoSizeImageLoaderUtil* vUtil = new ( ELeave ) CAlfAutoSizeImageLoaderUtil;
+    CleanupStack::PushL( vUtil );
+    STIF_ASSERT_NOT_NULL( vUtil );
+    CleanupStack::PopAndDestroy( vUtil );
+    
+    return KErrNone;
+    }
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksimagevisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,213 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// CONSTANTS
+const TInt KBufSize = 64;
+
+// FORWARD DECLARATION
+/*This class test protected functions of CAlfImageVisual*/
+class CTestCAlfImageVisual : public CAlfImageVisual
+    {
+public:
+    /**
+    * C++ default constructor.
+    */
+    CTestCAlfImageVisual();
+    /**
+    * Destructor.
+    */
+    ~CTestCAlfImageVisual();
+    /**
+    * TestProtectedFuncForVisual test protected functions of CAlfImageVisual
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    TInt TestProtectedFuncForVisual( CStifItemParser& aItem );
+    };
+
+// -----------------------------------------------------------------------------
+// CTestCAlfImageVisual::CTestCAlfImageVisual
+// -----------------------------------------------------------------------------
+//
+CTestCAlfImageVisual::CTestCAlfImageVisual(){}
+
+// -----------------------------------------------------------------------------
+// CTestCAlfImageVisual::~CTestCAlfImageVisual
+// -----------------------------------------------------------------------------
+//
+CTestCAlfImageVisual::~CTestCAlfImageVisual(){}
+
+// -----------------------------------------------------------------------------
+// CTestCAlfFlowLayout::TestProtectedFuncForVisual
+// -----------------------------------------------------------------------------
+//
+TInt CTestCAlfImageVisual::TestProtectedFuncForVisual( CStifItemParser& /*aItem*/ )
+    {
+    TUid vUid = { 0x00000000 };
+    PropertyOwnerExtension( vUid, NULL );
+    DoRemoveAndDestroyAllD();
+    return KErrNone;
+    }
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfImgVisualFullConstructorL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfImgVisualFullConstructorL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfImgVisualFullConstructorL, "TestAlfImgVisualFullConstructorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImgVisualFullConstructorL );
+    // Print to log file
+    iLog->Log( KTestAlfImgVisualFullConstructorL );
+    
+    CAlfImageVisual* vVisual = new ( ELeave ) CAlfImageVisual;
+    CleanupStack::PushL( vVisual );
+    STIF_ASSERT_NOT_NULL( vVisual );
+    vVisual->ConstructL( *iAlfCtl );
+    CleanupStack::PopAndDestroy( vVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfImgVisualAddNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfImgVisualAddNewL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfImgVisualAddNewL, "TestAlfImgVisualAddNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImgVisualAddNewL );
+    // Print to log file
+    iLog->Log( KTestAlfImgVisualAddNewL );
+    
+    CAlfImageVisual* vVisual = CAlfImageVisual::AddNewL( *iAlfCtl );
+    STIF_ASSERT_NOT_NULL( vVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfImgVisualSetAndGetL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfImgVisualSetAndGetL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfImgVisualSetAndGetL, "TestAlfImgVisualSetAndGetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImgVisualSetAndGetL );
+    // Print to log file
+    iLog->Log( KTestAlfImgVisualSetAndGetL );
+    
+    CAlfImageVisual* vVisual = CAlfImageVisual::AddNewL( *iAlfCtl );
+    
+    TRgb vRgb( KRgbBlue );
+    vVisual->SetColor( vRgb );
+    vVisual->SetColorMode( CAlfImageVisual::EColorModulate );
+    vVisual->SetStretch( 0, 1 );
+    vVisual->SetStretchMode( CAlfGc::EStretchHorizontal );
+    vVisual->SetDropShadow( 0 );
+    TAlfXYMetric vXYMetric;
+    vVisual->SetDropShadow( vXYMetric );
+    TAlfMetric vMetric;
+    vVisual->SetDropShadow( vMetric );
+    TAlfTimedValue vValue( 0 );
+    vVisual->SetTurnAngle( vValue );
+    vVisual->TurnAngle();
+    vVisual->SetTurnAngle( vValue );
+    vVisual->SetScale( vValue );
+    vVisual->Scale();
+    TAlfTimedPoint vPoint( 0, 0 );
+    vVisual->SetOffset( vPoint );
+    vVisual->Offset();
+    vVisual->SetScaleMode( CAlfImageVisual::EScaleNormal );
+    vVisual->ScaleMode();
+    TUid vUid = { 0x00000000 };
+    CAlfTextureManager* vTextManager = iAlfEnv->CreateSharedTextureManagerL( vUid );
+    const CAlfTexture* vText = vTextManager->Texture( 0 );
+    TAlfImage vFirstImage( *vText );
+    TAlfImage vSecImage( vUid, EAknsAppIconTypeList, 
+            TSize( 1, 1), EAspectRatioPreserved, 0, 0, 0, 0 );
+    
+    vVisual->SetImage( vFirstImage );
+    vVisual->SetSecondaryImage( vSecImage );
+    TAlfTimedValue vAlpha( 1 );
+    vVisual->SetSecondaryAlpha( vAlpha );
+    vVisual->Image();
+    vVisual->SecondaryImage();
+    vVisual->SecondaryAlpha();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfImgVisualForVisualL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfImgVisualForVisualL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfImgVisualForVisualL, "TestAlfImgVisualForVisualL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImgVisualForVisualL );
+    // Print to log file
+    iLog->Log( KTestAlfImgVisualForVisualL );
+    
+    CAlfImageVisual* vVisual = CAlfImageVisual::AddNewL( *iAlfCtl );
+    _LIT8( KTest, "tset" );
+    TBuf8<KBufSize> vBuf( KTest );
+    vVisual->FindTag( vBuf );
+    vVisual->UpdateChildrenLayout();
+    vVisual->RemoveAndDestroyAllD();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfImgVisualProtectedFuncL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfImgVisualProtectedFuncL( CStifItemParser& aItem )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfImgVisualProtectedFuncL, "TestAlfImgVisualProtectedFuncL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfImgVisualProtectedFuncL );
+    // Print to log file
+    iLog->Log( KTestAlfImgVisualProtectedFuncL );
+    
+    CTestCAlfImageVisual* vImgVisual = new ( ELeave ) CTestCAlfImageVisual;
+    CleanupStack::PushL( vImgVisual );
+    vImgVisual->ConstructL( *iAlfCtl );
+    vImgVisual->TestProtectedFuncForVisual( aItem );
+    CleanupStack::Pop( vImgVisual );
+    
+    return KErrNone;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockslayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,275 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+#include <alf/alfvisual.h>
+
+#include "testplatalfvisual.h"
+
+// CONSTANTS
+const TInt KBufSize = 64;
+
+// FORWARD DECLARATION
+/*This class test protected functions of CAlfLayout*/
+class CTestCAlfLayout : public CAlfLayout
+    {
+public:
+    /**
+    * C++ default constructor.
+    */
+    CTestCAlfLayout();
+    /**
+    * Destructor.
+    */
+    ~CTestCAlfLayout();
+    /**
+    * TestProtectedFuncForVisual test protected functions of CTestCAlfLayout
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    TInt TestProtectedFuncForVisual( CStifItemParser& aItem );
+    };
+
+// -----------------------------------------------------------------------------
+// CTestCAlfLayout::CTestCAlfLayout
+// -----------------------------------------------------------------------------
+//
+CTestCAlfLayout::CTestCAlfLayout(){}
+
+// -----------------------------------------------------------------------------
+// CTestCAlfLayout::~CTestCAlfLayout
+// -----------------------------------------------------------------------------
+//
+CTestCAlfLayout::~CTestCAlfLayout(){}
+
+// -----------------------------------------------------------------------------
+// CTestCAlfFlowLayout::TestProtectedFuncForVisual
+// -----------------------------------------------------------------------------
+//
+TInt CTestCAlfLayout::TestProtectedFuncForVisual( CStifItemParser& /*aItem*/ )
+    {
+    TUid vUid = { 0x00000000 };
+    PropertyOwnerExtension( vUid, NULL );
+    DoRemoveAndDestroyAllD();
+    return KErrNone;
+    }
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfLayoutFullConstructorL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfLayoutFullConstructorL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfLayoutFullConstructorL, "TestAlfLayoutFullConstructorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfLayoutFullConstructorL );
+    // Print to log file
+    iLog->Log( KTestAlfLayoutFullConstructorL );
+    
+    CAlfLayout* vLayout = new ( ELeave ) CAlfLayout;
+    CleanupStack::PushL( vLayout );
+    STIF_ASSERT_NOT_NULL( vLayout );
+    vLayout->ConstructL( *iAlfCtl );
+    CleanupStack::PopAndDestroy( vLayout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfLayoutAddNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfLayoutAddNewL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfLayoutAddNewL, "TestAlfLayoutAddNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfLayoutAddNewL );
+    // Print to log file
+    iLog->Log( KTestAlfLayoutAddNewL );
+    
+    CAlfLayout* vLayout = CAlfLayout::AddNewL( *iAlfCtl );
+    STIF_ASSERT_NOT_NULL( vLayout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfLayoutSetAndGetL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfLayoutSetAndGetL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfLayoutSetAndGetL, "TestAlfLayoutSetAndGetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfLayoutSetAndGetL );
+    // Print to log file
+    iLog->Log( KTestAlfLayoutSetAndGetL );
+    
+    CAlfLayout* vLayout = CAlfLayout::AddNewL( *iAlfCtl );
+    CAlfImageVisual* vVisualOne = CAlfImageVisual::AddNewL( *iAlfCtl );
+    TUid vUid = { 0x00000000 };
+    TAlfImage vFirstImage( vUid, EAknsAppIconTypeList, 
+            TSize( 1, 1), EAspectRatioPreserved, 0, 0, 0, 0 );
+    vVisualOne->SetImage( vFirstImage );
+    
+    CAlfImageVisual* vVisualTwo = CAlfImageVisual::AddNewL( *iAlfCtl );
+    TUid vSecUid = { 0x00000001 };
+    TAlfImage vSecImage( vSecUid, EAknsAppIconTypeList, 
+            TSize( 1, 1), EAspectRatioPreserved, 0, 0, 0, 0 );
+    vVisualTwo->SetImage( vSecImage );
+    
+    vLayout->Append( vVisualOne );
+    vLayout->Append( vVisualTwo );
+    
+    vLayout->EnableScrollingL();
+    vLayout->Scrolling();
+    TAlfTimedPoint vPoint( 0, 0 );
+    vLayout->SetScrollOffset( vPoint );
+    vLayout->ScrollOffset();
+    TPoint vPos( 0, 1);
+    TSize vSize( 1, 1 );
+    vLayout->ChildOrdinal( 1 );
+    vLayout->ChildPos( 0, vPos );
+    vLayout->ChildSize( 0, vSize );
+    
+    TAlfXYMetric vXYMetric;
+    vLayout->SetInnerPadding( vXYMetric );
+    vLayout->InnerPaddingAsMetric();
+    const TPoint vConstPos( 1, 1);
+    vLayout->SetInnerPadding( vConstPos );
+    vLayout->InnerPadding();
+    vLayout->SetTransitionTime( 1 );
+    
+    vLayout->TransitionTime();
+    vLayout->HorizontalInnerPadding();
+    vLayout->VerticalInnerPadding();
+    vLayout->InnerPaddingInBaseUnits();
+    vLayout->EffectiveLayoutOrdinal( *vVisualTwo );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfLayoutForVisualL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfLayoutForVisualL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfLayoutForVisualL, "TestAlfLayoutForVisualL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfLayoutForVisualL );
+    // Print to log file
+    iLog->Log( KTestAlfLayoutForVisualL );
+    
+    CAlfLayout* vLayout = CAlfLayout::AddNewL( *iAlfCtl );
+    CAlfImageVisual* vVisualOne = CAlfImageVisual::AddNewL( *iAlfCtl );
+    TUid vUid = { 0x00000000 };
+    TAlfImage vFirstImage( vUid, EAknsAppIconTypeList, 
+            TSize( 1, 1), EAspectRatioPreserved, 0, 0, 0, 0 );
+    vVisualOne->SetImage( vFirstImage );
+    
+    CAlfImageVisual* vVisualTwo = CAlfImageVisual::AddNewL( *iAlfCtl );
+    TUid vSecUid = { 0x00000001 };
+    TAlfImage vSecImage( vSecUid, EAknsAppIconTypeList, 
+            TSize( 1, 1), EAspectRatioPreserved, 0, 0, 0, 0 );
+    vVisualTwo->SetImage( vSecImage );
+    vLayout->Append( vVisualOne );
+    vLayout->Remove( vVisualOne );
+    vLayout->Append( vVisualOne );
+    vLayout->Append( vVisualTwo );
+    vLayout->Reorder( *vVisualOne, 0 );
+    vLayout->MoveVisualToFront( *vVisualTwo );
+    vLayout->MoveVisualToBack( *vVisualTwo );
+//    vLayout->VirtualSize();//error
+    vLayout->FindVisual( vVisualOne );
+    vLayout->Remove( vVisualOne );
+    vLayout->Insert( vVisualOne, 0 );
+    vLayout->Count();
+    vLayout->Visual( 1 );
+    _LIT8( KTest, "tset" );
+    TBuf8<KBufSize> vBuf( KTest );
+    vLayout->FindTag( vBuf );
+    vLayout->UpdateChildrenLayout();
+    vLayout->RemoveAndDestroyAllD();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfLayoutBaseUnitL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfLayoutBaseUnitL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfLayoutBaseUnitL, "TestAlfLayoutBaseUnitL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfLayoutBaseUnitL );
+    // Print to log file
+    iLog->Log( KTestAlfLayoutBaseUnitL );
+    
+    CAlfLayout* vLayout = CAlfLayout::AddNewL( *iAlfCtl );
+    TAlfMetric metricX(1.0, EAlfUnitNormalized);
+    TAlfMetric metricY(2.0, EAlfUnitNormalized);
+    vLayout->SetBaseUnit(metricX);
+    
+    TAlfXYMetric metricXY( metricX, metricY );
+    vLayout->SetBaseUnit( metricXY );
+    TAlfXYMetric resultMetricXY = vLayout->BaseUnit();
+    TAlfMetric resultMetricX = resultMetricXY.iX;
+    TAlfMetric resultMetricY = resultMetricXY.iY;
+    
+    STIF_ASSERT_EQUALS( metricX.iMagnitude, resultMetricX.iMagnitude );
+    STIF_ASSERT_EQUALS( metricX.iUnit, resultMetricX.iUnit );
+    STIF_ASSERT_EQUALS( metricX.iReferenceTextStyleId, resultMetricX.iReferenceTextStyleId );
+
+    STIF_ASSERT_EQUALS( metricY.iMagnitude, resultMetricY.iMagnitude );
+    STIF_ASSERT_EQUALS( metricY.iUnit, resultMetricY.iUnit );
+    STIF_ASSERT_EQUALS( metricY.iReferenceTextStyleId, resultMetricY.iReferenceTextStyleId );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfLayoutProtectedFuncL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfLayoutProtectedFuncL( CStifItemParser& aItem )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfLayoutProtectedFuncL, "TestAlfLayoutProtectedFuncL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfLayoutProtectedFuncL );
+    // Print to log file
+    iLog->Log( KTestAlfLayoutProtectedFuncL );
+    
+    CTestCAlfLayout* vLayout = new ( ELeave ) CTestCAlfLayout;
+    CleanupStack::PushL( vLayout );
+    vLayout->ConstructL( *iAlfCtl );
+    vLayout->TestProtectedFuncForVisual( aItem );
+    CleanupStack::Pop( vLayout );
+    
+    return KErrNone;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockslinevisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,235 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+#include <alf/alfmappingfunctions.h>
+
+#include "testplatalfvisual.h"
+
+// CONSTANTS
+const TInt KBufSize = 64;
+const TInt KNumber = 1000000;
+
+// FORWARD DECLARATION
+/*This class test protected functions of CAlfLineVisual*/
+class CTestCAlfLineVisual : public CAlfLineVisual
+    {
+public:
+    /**
+    * C++ default constructor.
+    */
+    CTestCAlfLineVisual();
+    /**
+    * Destructor.
+    */
+    ~CTestCAlfLineVisual();
+    /**
+    * TestProtectedFuncForVisual test protected functions of CTestCAlfLineVisual
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    TInt TestProtectedFuncForVisual( CStifItemParser& aItem );
+    };
+
+// -----------------------------------------------------------------------------
+// CTestCAlfLineVisual::CTestCAlfLineVisual
+// -----------------------------------------------------------------------------
+//
+CTestCAlfLineVisual::CTestCAlfLineVisual(){}
+
+// -----------------------------------------------------------------------------
+// CTestCAlfLineVisual::~CTestCAlfLineVisual
+// -----------------------------------------------------------------------------
+//
+CTestCAlfLineVisual::~CTestCAlfLineVisual(){}
+
+// -----------------------------------------------------------------------------
+// CTestCAlfLineVisual::TestProtectedFuncForVisual
+// -----------------------------------------------------------------------------
+//
+TInt CTestCAlfLineVisual::TestProtectedFuncForVisual( CStifItemParser& /*aItem*/ )
+    {
+    TUid vUid = { 0x00000000 };
+    PropertyOwnerExtension( vUid, NULL );
+    DoRemoveAndDestroyAllD();
+    return KErrNone;
+    }
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfLineVisualFullConstructorL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfLineVisualFullConstructorL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfLineVisualFullConstructorL, "TestAlfLineVisualFullConstructorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfLineVisualFullConstructorL );
+    // Print to log file
+    iLog->Log( KTestAlfLineVisualFullConstructorL );
+    
+    CAlfLineVisual* vVisual = new ( ELeave ) CAlfLineVisual;
+    CleanupStack::PushL( vVisual );
+    STIF_ASSERT_NOT_NULL( vVisual );
+    vVisual->ConstructL( *iAlfCtl );
+    CleanupStack::PopAndDestroy( vVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfLineVisualAddNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfLineVisualAddNewL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfLineVisualAddNewL, "TestAlfLineVisualAddNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfLineVisualAddNewL );
+    // Print to log file
+    iLog->Log( KTestAlfLineVisualAddNewL );
+    
+    CAlfLineVisual* vVisual = CAlfLineVisual::AddNewL( *iAlfCtl );
+    STIF_ASSERT_NOT_NULL( vVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfLineVisualSetAndGetL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfLineVisualSetAndGetL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfLineVisualSetAndGetL, "TestAlfLineVisualSetAndGetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfLineVisualSetAndGetL );
+    // Print to log file
+    iLog->Log( KTestAlfLineVisualSetAndGetL );
+    
+    CAlfLineVisual* vVisual = CAlfLineVisual::AddNewL( *iAlfCtl );
+    CAlfCurvePath* vPath = CAlfCurvePath::NewL( *iAlfEnv );
+    vVisual->SetPath( vPath, EAlfDoesNotHaveOwnership );
+    CAlfCurvePath* pathResult = vVisual->Path();
+    STIF_ASSERT_EQUALS( (TInt)vPath , (TInt)pathResult );
+    const CAlfTexture* texture = iAlfEnv->TextureManager().Texture( 0 );
+    TAlfImage vImage( *texture );
+    vVisual->SetImage( vImage );
+    vVisual->Image();
+    CAlfAverageMappingFunction* mappingFunction = 
+    CAlfAverageMappingFunction::NewL( *iAlfEnv );
+    CleanupStack::PushL( mappingFunction );
+    vVisual->SetAlphaFunction( mappingFunction );
+    CleanupStack::PopAndDestroy( mappingFunction );
+    mappingFunction = CAlfAverageMappingFunction::NewL( *iAlfEnv );
+    CleanupStack::PushL( mappingFunction );
+    vVisual->SetWidthFunction( mappingFunction );
+    CleanupStack::PopAndDestroy( mappingFunction );
+    
+    TAlfTimedValue valueSet;
+    valueSet.SetValueNow( 0 );
+    valueSet.SetTarget( 1, KNumber );
+    vVisual->SetThickness(valueSet);
+    const TAlfTimedValue& valueGet = vVisual->Thickness();
+    STIF_ASSERT_EQUALS( (float)0.0, valueGet.ValueNow() );
+    STIF_ASSERT_EQUALS( (float)1.0, valueGet.Target() );
+    STIF_ASSERT_NOT_EQUALS( 0, valueGet.TimeToTargetinMilliSeconds() );
+ 
+    valueSet.SetValueNow( 0 );
+    valueSet.SetTarget( 1, KNumber );
+    vVisual->SetShadowThickness(valueSet);
+    
+    const TAlfTimedValue& valueGet1 = vVisual->ShadowThickness();
+    STIF_ASSERT_EQUALS( (float)0.0, valueGet1.ValueNow() );
+    STIF_ASSERT_EQUALS( (float)1.0, valueGet1.Target() );
+    STIF_ASSERT_NOT_EQUALS( 0, valueGet1.TimeToTargetinMilliSeconds() );
+    
+    valueSet.SetValueNow( 0 );
+    valueSet.SetTarget( 1, KNumber );
+    vVisual->SetStartPos( valueSet );
+    
+    const TAlfTimedValue& valueGet2 = vVisual->StartPos();
+    STIF_ASSERT_EQUALS( (float)0.0, valueGet2.ValueNow() );
+    STIF_ASSERT_EQUALS( (float)1.0, valueGet2.Target() );
+    STIF_ASSERT_NOT_EQUALS( 0, valueGet2.TimeToTargetinMilliSeconds() );
+    
+    valueSet.SetValueNow( 0 );
+    valueSet.SetTarget( 1, KNumber );
+    vVisual->SetEndPos(valueSet);
+    
+    const TAlfTimedValue& valueGet3 = vVisual->EndPos();
+    STIF_ASSERT_EQUALS( (float)0.0, valueGet3.ValueNow() );
+    STIF_ASSERT_EQUALS( (float)1.0, valueGet3.Target() );
+    STIF_ASSERT_NOT_EQUALS( 0, valueGet3.TimeToTargetinMilliSeconds() );
+    
+    TRgb vRgb( KRgbBlue );
+    vVisual->SetColor( vRgb );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfLineVisualForVisualL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfLineVisualForVisualL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfLineVisualForVisualL, "TestAlfLineVisualForVisualL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfLineVisualForVisualL );
+    // Print to log file
+    iLog->Log( KTestAlfLineVisualForVisualL );
+    
+    CAlfLineVisual* vVisual = CAlfLineVisual::AddNewL( *iAlfCtl );
+    _LIT8( KTest, "tset" );
+    TBuf8<KBufSize> vBuf( KTest );
+    vVisual->FindTag( vBuf );
+    vVisual->UpdateChildrenLayout();
+    vVisual->RemoveAndDestroyAllD();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfLineVisualProtectedFuncL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfLineVisualProtectedFuncL( CStifItemParser& aItem )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfLineVisualProtectedFuncL, "TestAlfLineVisualProtectedFuncL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfLineVisualProtectedFuncL );
+    // Print to log file
+    iLog->Log( KTestAlfLineVisualProtectedFuncL );
+    
+    CTestCAlfLineVisual* vLineVisual = new ( ELeave ) CTestCAlfLineVisual;
+    CleanupStack::PushL( vLineVisual );
+    vLineVisual->ConstructL( *iAlfCtl );
+    vLineVisual->TestProtectedFuncForVisual( aItem );
+    CleanupStack::Pop( vLineVisual );
+    
+    return KErrNone;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksm3gmesh.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// CONSTANT
+const TInt KBufSize = 64;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfM3GMeshLoadSceneL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfM3GMeshLoadSceneL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfM3GMeshLoadSceneL, "TestAlfM3GMeshLoadSceneL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfM3GMeshLoadSceneL );
+    // Print to log file
+    iLog->Log( KTestAlfM3GMeshLoadSceneL );
+    
+    CAlfMeshVisual* vVisual = CAlfMeshVisual::AddNewL( *iAlfCtl );
+    vVisual->CreateMeshL( EAlfMeshTypeM3G );
+    CAlfM3GMesh* vMesh = vVisual->M3GMesh();
+    _LIT( KM3gFile, "testm3g.m3g");
+    TBuf<KBufSize> buf( KM3gFile );
+    TRAPD( err, vMesh->LoadSceneL( buf ) );
+    if ( err != KErrNone )
+        {
+        return KErrNone;
+        }
+    else
+        {
+        return KErrNone;
+        }
+
+    }
+
+// End of file
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksmappingfunctions.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,154 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfConstantMapFuncL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfConstantMapFuncL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfConstantMapFuncL, "TestAlfConstantMapFuncL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfConstantMapFuncL );
+    // Print to log file
+    iLog->Log( KTestAlfConstantMapFuncL );
+    
+    CAlfConstantMappingFunction* vMapFunc = 
+        CAlfConstantMappingFunction::NewL( *iAlfEnv );
+    vMapFunc->SetValue( 0 );
+    vMapFunc->Value();
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfLinearMapFuncL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfLinearMapFuncL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfLinearMapFuncL, "TestAlfLinearMapFuncL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfLinearMapFuncL );
+    // Print to log file
+    iLog->Log( KTestAlfLinearMapFuncL );
+    
+    CAlfLinearMappingFunction* vMapFunc = 
+        CAlfLinearMappingFunction::NewL( *iAlfEnv );
+    vMapFunc->SetFactor( 0 );
+    vMapFunc->Factor();
+    vMapFunc->SetOffset( 0 );
+    vMapFunc->Offset();
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfSineMapFuncL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfSineMapFuncL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfSineMapFuncL, "TestAlfSineMapFuncL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfSineMapFuncL );
+    // Print to log file
+    iLog->Log( KTestAlfSineMapFuncL );
+    
+    CAlfSineMappingFunction* vMapFunc = 
+        CAlfSineMappingFunction::NewL( *iAlfEnv );
+    vMapFunc->SetFactor( 0 );
+    vMapFunc->Factor();
+    vMapFunc->SetOffset( 0 );
+    vMapFunc->Offset();
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfCosineMapFuncL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfCosineMapFuncL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfCosineMapFuncL, "TestAlfCosineMapFuncL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfCosineMapFuncL );
+    // Print to log file
+    iLog->Log( KTestAlfCosineMapFuncL );
+    
+    CAlfCosineMappingFunction* vMapFunc = 
+        CAlfCosineMappingFunction::NewL( *iAlfEnv );
+    vMapFunc->SetFactor( 0 );
+    vMapFunc->Factor();
+    vMapFunc->SetOffset( 0 );
+    vMapFunc->Offset();
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfAverageMapFuncL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfAverageMapFuncL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfAverageMapFuncL, "TestAlfAverageMapFuncL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfAverageMapFuncL );
+    // Print to log file
+    iLog->Log( KTestAlfAverageMapFuncL );
+    
+    CAlfAverageMappingFunction* vMapFunc = 
+        CAlfAverageMappingFunction::NewL( *iAlfEnv );
+    const TAlfTimedValue vValue( 0 );
+    vMapFunc->SetWeight( vValue );
+    vMapFunc->SetMappingFunction1( NULL );
+    vMapFunc->SetMappingFunction2( NULL );
+    vMapFunc->SetMappingFunctions( NULL, NULL );
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfTableMapFuncL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfTableMapFuncL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfTableMapFuncL, "TestAlfTableMapFuncL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfTableMapFuncL );
+    // Print to log file
+    iLog->Log( KTestAlfTableMapFuncL );
+    
+    CAlfTableMappingFunction* vMapFunc = 
+        CAlfTableMappingFunction::NewL( *iAlfEnv );
+    const TAlfTimedValue vValue( 0 );
+    vMapFunc->SetMappingTableValues( 0, 0, NULL );
+    
+    return KErrNone;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksmaterial.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfMaterialConstructor
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfMaterialConstructor( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfMaterialConstructor, "TestAlfMaterialConstructor" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfMaterialConstructor );
+    // Print to log file
+    iLog->Log( KTestAlfMaterialConstructor );
+    
+    TAlfMaterial vMaterial;
+    
+    return KErrNone;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksmesh.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfMeshSetAndGetL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfMeshSetAndGetL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfMeshSetAndGetL, "TestAlfMeshSetAndGetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfMeshSetAndGetL );
+    // Print to log file
+    iLog->Log( KTestAlfMeshSetAndGetL );
+    
+    CAlfMeshVisual* vVisual = CAlfMeshVisual::AddNewL( *iAlfCtl );
+    vVisual->CreateMeshL( EAlfMeshTypeM3G );
+    CAlfMesh& vMesh = vVisual->Mesh();
+    vMesh.MeshType();
+    vMesh.StretchUniformly( 0, 0, 0, 0, 0, 0 );
+    vMesh.ScaleUniformly( 0, 0, 0 );
+    vMesh.AnimationControllerCount();
+    vMesh.SetAnimationPosition( iAlfCtl->Id(), 0, 0 );
+    vMesh.StartAnimationController( iAlfCtl->Id() );
+    vMesh.StopAnimationController( iAlfCtl->Id() );
+    vMesh.Reset();
+    
+    return KErrNone;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksmeshvisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,205 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <e32svr.h>
+#include <stifparser.h>
+#include <stiftestinterface.h>
+
+#include "testplatalfvisual.h"
+
+// CONSTANTS
+const TInt KBufSize = 64;
+
+// FORWARD DECLARATION
+/*This class test protected functions of CAlfMeshVisual*/
+class CTestCAlfMeshVisual : public CAlfMeshVisual
+    {
+public:
+    /**
+    * C++ default constructor.
+    */
+    CTestCAlfMeshVisual();
+    /**
+    * Destructor.
+    */
+    ~CTestCAlfMeshVisual();
+    /**
+    * TestProtectedFuncForVisual test protected functions of CTestCAlfMeshVisual
+    * @since S60 5.0
+    * @param aItem is not used.
+    * @return Symbian OS error code.
+    */
+    TInt TestProtectedFuncForVisual( CStifItemParser& aItem );
+    };
+
+// -----------------------------------------------------------------------------
+// CTestCAlfMeshVisual::CTestCAlfMeshVisual
+// -----------------------------------------------------------------------------
+//
+CTestCAlfMeshVisual::CTestCAlfMeshVisual(){}
+
+// -----------------------------------------------------------------------------
+// CTestCAlfMeshVisual::~CTestCAlfMeshVisual
+// -----------------------------------------------------------------------------
+//
+CTestCAlfMeshVisual::~CTestCAlfMeshVisual(){}
+
+// -----------------------------------------------------------------------------
+// CTestCAlfMeshVisual::TestProtectedFuncForVisual
+// -----------------------------------------------------------------------------
+//
+TInt CTestCAlfMeshVisual::TestProtectedFuncForVisual( CStifItemParser& /*aItem*/ )
+    {
+    TUid vUid = { 0x00000000 };
+    PropertyOwnerExtension( vUid, NULL );
+    DoRemoveAndDestroyAllD();
+    return KErrNone;
+    }
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfMeshVisualFullConstructorL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfMeshVisualFullConstructorL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfMeshVisualFullConstructorL, "TestAlfMeshVisualFullConstructorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfMeshVisualFullConstructorL );
+    // Print to log file
+    iLog->Log( KTestAlfMeshVisualFullConstructorL );
+    
+    CAlfMeshVisual* vVisual = new ( ELeave ) CAlfMeshVisual;
+    CleanupStack::PushL( vVisual );
+    STIF_ASSERT_NOT_NULL( vVisual );
+    vVisual->ConstructL( *iAlfCtl );
+    CleanupStack::PopAndDestroy( vVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfMeshVisualAddNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfMeshVisualAddNewL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfMeshVisualAddNewL, "TestAlfMeshVisualAddNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfMeshVisualAddNewL );
+    // Print to log file
+    iLog->Log( KTestAlfMeshVisualAddNewL );
+    
+    CAlfMeshVisual* vVisual = CAlfMeshVisual::AddNewL( *iAlfCtl );
+    STIF_ASSERT_NOT_NULL( vVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfMeshVisualSetAndGetL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfMeshVisualSetAndGetL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfMeshVisualSetAndGetL, "TestAlfMeshVisualSetAndGetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfMeshVisualSetAndGetL );
+    // Print to log file
+    iLog->Log( KTestAlfMeshVisualSetAndGetL );
+    
+    CAlfMeshVisual* vVisual = CAlfMeshVisual::AddNewL( *iAlfCtl );
+    vVisual->CreateMeshL( EAlfMeshTypeM3G );
+    TUid vUid = { 0x00000000 };
+    CAlfTextureManager* vTextManager = iAlfEnv->CreateSharedTextureManagerL( vUid );
+    const CAlfTexture* vText = vTextManager->Texture( 0 );
+    TAlfImage vImage( *vText );
+    vVisual->SetImage( vImage );
+    vVisual->Image();
+    TAlfImage vSecImage( vUid, EAknsAppIconTypeList, 
+                TSize( 1, 1), EAspectRatioPreserved, 0, 0, 0, 0 );
+    vVisual->SetSecondaryImage( vSecImage );
+    vVisual->SecondaryImage();
+    TUid vSecUid = { 0x00000001 };
+    TAlfImage vNewImage( vSecUid, EAknsAppIconTypeList, 
+                    TSize( 1, 1), EAspectRatioPreserved, 0, 0, 0, 0 );
+    vVisual->SetSpecularImage( vNewImage );
+    vVisual->SpecularImage();
+    vVisual->Mesh();
+    vVisual->ProceduralMesh(); 
+    vVisual->M3GMesh();
+    const TAlfTimedValue vValue( 1 );
+    vVisual->SetSecondaryAlpha( vValue );
+    vVisual->SecondaryAlpha();
+    vVisual->SetYawAngle( vValue );
+    vVisual->YawAngle();
+    vVisual->SetPitchAngle( vValue );
+    vVisual->PitchAngle();
+    vVisual->SetScale( vValue );
+    vVisual->Scale();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfMeshVisualForVisualL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfMeshVisualForVisualL( CStifItemParser& /*aItem*/ )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfMeshVisualForVisualL, "TestAlfMeshVisualForVisualL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfMeshVisualForVisualL );
+    // Print to log file
+    iLog->Log( KTestAlfMeshVisualForVisualL );
+    
+    CAlfMeshVisual* vVisual = CAlfMeshVisual::AddNewL( *iAlfCtl );
+    _LIT8( KTest, "tset" );
+    TBuf8<KBufSize> vBuf( KTest );
+    vVisual->FindTag( vBuf );
+    vVisual->UpdateChildrenLayout();
+    vVisual->RemoveAndDestroyAllD();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfMeshVisualProtectedFuncL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfMeshVisualProtectedFuncL( CStifItemParser& aItem )
+    {
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfMeshVisualProtectedFuncL, "TestAlfMeshVisualProtectedFuncL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfMeshVisualProtectedFuncL );
+    // Print to log file
+    iLog->Log( KTestAlfMeshVisualProtectedFuncL );
+    
+    CTestCAlfMeshVisual* vMeshVisual = new ( ELeave ) CTestCAlfMeshVisual;
+    CleanupStack::PushL( vMeshVisual );
+    vMeshVisual->ConstructL( *iAlfCtl );
+    vMeshVisual->TestProtectedFuncForVisual( aItem );
+    CleanupStack::Pop( vMeshVisual );
+    
+    return KErrNone;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksmetric.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfmetric.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alfmetric.h>
+
+#include "testplatalfvisual.h"
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestMetricMethods
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestMetricMethods( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestMetricMethods, "TestMetricMethods" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestMetricMethods );
+    // Print to log file
+    iLog->Log( KTestMetricMethods );
+    
+    TAlfMetric metric;
+    
+    TAlfMetric metric2( 1 );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestXYMetricMethods
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestXYMetricMethods( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestXYMetricMethods, "TestXYMetricMethods" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestXYMetricMethods );
+    // Print to log file
+    iLog->Log( KTestXYMetricMethods );
+    
+    TAlfXYMetric xyMetric;
+    
+    TAlfMetric metricX;
+    TAlfXYMetric xyMetric2( metricX );
+    
+    TAlfMetric metricY;
+    TAlfXYMetric xyMetric3( metricX, metricY );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBoxMetricMethods
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestBoxMetricMethods( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBoxMetricMethods, "TestBoxMetricMethods" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBoxMetricMethods );
+    // Print to log file
+    iLog->Log( KTestBoxMetricMethods );
+    
+    TAlfBoxMetric boxMetric;
+    
+    TAlfMetric metric;
+    TAlfBoxMetric boxMetric2( metric );
+    
+    TAlfXYMetric xyMetric;
+    TAlfBoxMetric boxMetric3( xyMetric );
+    
+    TAlfXYMetric topLeft, bottomRight;
+    TAlfBoxMetric boxMetric4( topLeft, bottomRight ); 
+    
+    TAlfMetric left, right, top, bottom;
+    TAlfBoxMetric boxMetric5( left, right, top, bottom );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksproceduralmesh.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfproceduralmesh.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alfproceduralmesh.h>
+#include <alf/alfmeshvisual.h>
+
+#include "testplatalfvisual.h"
+
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestProMeshMakeMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestProMeshMakeMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestProMeshMakeMethodsL, "TestProMeshMakeMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestProMeshMakeMethodsL );
+    // Print to log file
+    iLog->Log( KTestProMeshMakeMethodsL );
+    
+    CAlfMeshVisual* meshVisual = CAlfMeshVisual::AddNewL( *iAlfCtl );
+    meshVisual->CreateMeshL( EAlfMeshTypeProcedural );
+    CAlfProceduralMesh* proMesh = meshVisual->ProceduralMesh();
+    STIF_ASSERT_NOT_NULL(  proMesh );
+    proMesh->MakeCubeL( 1, 1, 1, 1 );
+    proMesh->MakeSphereL( 1, 1, 1 );
+    proMesh->MakeTorusL( 1, 1, 1, 1, 1 );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestProMeshMaterialMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestProMeshMaterialMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestProMeshMaterialMethodsL, "TestProMeshMaterialMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestProMeshMaterialMethodsL );
+    // Print to log file
+    iLog->Log( KTestProMeshMaterialMethodsL );
+    
+    CAlfMeshVisual* meshVisual = CAlfMeshVisual::AddNewL( *iAlfCtl );
+    meshVisual->CreateMeshL( EAlfMeshTypeProcedural );
+    CAlfProceduralMesh* proMesh = meshVisual->ProceduralMesh();
+    STIF_ASSERT_NOT_NULL(  proMesh );
+    TAlfMaterial material = proMesh->Material();
+    proMesh->SetMaterial( material );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockspropertyowner.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,259 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfpropertyowner.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alfpropertyowner.h>
+#include <alf/alfvisual.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TInt KFooIntValue = 23;
+const TInt KFooIntValue2 = 19;
+
+_LIT8( KFooName, "FooProperty" );
+_LIT8( KFooName2, "Bar" );
+_LIT8( KFooName3, "listbox.opacity" );
+_LIT( KFooValue, "Hello world!" );
+_LIT( KFooValue2, "My test string... This will be stored as a property value." );
+
+
+// FORWARD DECLARATION
+// class CTestPropertyOwner for testing CAlfPropertyOwner
+class CTestPropertyOwner : public CAlfPropertyOwner
+    {
+public:
+    void TestPropertyOwnerExtension()
+        {
+        TBool inFocusChain( EFalse );
+        TAny* pInFocusChain = &inFocusChain;
+        CAlfPropertyOwner::PropertyOwnerExtension( KUidAlfPropOwnerExtControlFocusChainChanged, &pInFocusChain );
+        }
+    };
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestPropOwnerConstructorL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestPropOwnerConstructorL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestPropOwnerConstructorL, "TestPropOwnerConstructorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestPropOwnerConstructorL );
+    // Print to log file
+    iLog->Log( KTestPropOwnerConstructorL );
+    
+    CAlfPropertyOwner* owner = new ( ELeave ) CAlfPropertyOwner();
+    CleanupStack::PushL( owner );
+    STIF_ASSERT_NOT_NULL( owner );
+    CleanupStack::PopAndDestroy( owner );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestPropOwnerPropertyRemoveL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestPropOwnerPropertyRemoveL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestPropOwnerPropertyRemoveL, "TestPropOwnerPropertyRemoveL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestPropOwnerPropertyRemoveL );
+    // Print to log file
+    iLog->Log( KTestPropOwnerPropertyRemoveL );
+    
+    CAlfPropertyOwner* owner = new ( ELeave ) CAlfVisual;
+    CleanupStack::PushL( owner );
+    STIF_ASSERT_NOT_NULL( owner );
+    owner->PropertySetIntegerL( KFooName, 0 );
+    owner->PropertySetIntegerL( KFooName2, 0 );
+    owner->PropertySetIntegerL( KFooName3, 0 );
+    TBool success = owner->PropertyFindInteger( KFooName );
+    STIF_ASSERT_TRUE( success );
+    success = owner->PropertyRemove( KFooName );
+    STIF_ASSERT_TRUE( success );
+    CleanupStack::PopAndDestroy( owner );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestPropOwnerPropertyClearL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestPropOwnerPropertyClearL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestPropOwnerPropertyClearL, "TestPropOwnerPropertyClearL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestPropOwnerPropertyClearL );
+    // Print to log file
+    iLog->Log( KTestPropOwnerPropertyClearL );
+    
+    CAlfPropertyOwner* owner = new ( ELeave ) CAlfVisual;
+    CleanupStack::PushL( owner );
+    STIF_ASSERT_NOT_NULL( owner );
+    owner->PropertySetIntegerL( KFooName, 0 );
+    owner->PropertySetIntegerL( KFooName2, 0 );
+    owner->PropertySetIntegerL( KFooName3, 0 );
+    
+    owner->PropertyClear();
+       
+    STIF_ASSERT_TRUE( !owner->PropertyFindInteger( KFooName ) ); 
+    STIF_ASSERT_TRUE( !owner->PropertyFindInteger( KFooName2 ) ); 
+    STIF_ASSERT_TRUE( !owner->PropertyFindInteger( KFooName3 ) );
+
+    CleanupStack::PopAndDestroy( owner );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestPropOwnerPropertyIntegerL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestPropOwnerPropertyIntegerL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestPropOwnerPropertyIntegerL, "TestPropOwnerPropertyIntegerL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestPropOwnerPropertyIntegerL );
+    // Print to log file
+    iLog->Log( KTestPropOwnerPropertyIntegerL );
+    
+    CAlfPropertyOwner* owner = new ( ELeave ) CAlfVisual;
+    CleanupStack::PushL( owner );
+    STIF_ASSERT_NOT_NULL( owner );
+    
+    TInt ret = 0;
+    
+    // Set initial value.
+    owner->PropertySetIntegerL( KFooName, KFooIntValue );
+    TBool success = owner->PropertyFindInteger(KFooName, &ret);
+    STIF_ASSERT_TRUE( success );
+    STIF_ASSERT_EQUALS( KFooIntValue, ret );
+    
+    // Set a new value.
+    owner->PropertySetIntegerL( KFooName, KFooIntValue2 );
+    success = owner->PropertyFindInteger(KFooName, &ret);
+    STIF_ASSERT_TRUE( success );
+    STIF_ASSERT_EQUALS( KFooIntValue2, ret );
+    
+    STIF_ASSERT_TRUE( owner->PropertyRemove( KFooName ) );
+    
+    STIF_ASSERT_TRUE( !owner->PropertyFindInteger( KFooName ) );
+    
+    CleanupStack::PopAndDestroy( owner );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestPropOwnerPropertyStringL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestPropOwnerPropertyStringL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestPropOwnerPropertyStringL, "TestPropOwnerPropertyStringL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestPropOwnerPropertyStringL );
+    // Print to log file
+    iLog->Log( KTestPropOwnerPropertyStringL );
+    
+    CAlfPropertyOwner* owner = new ( ELeave ) CAlfVisual;
+    CleanupStack::PushL( owner );
+    STIF_ASSERT_NOT_NULL( owner );
+    
+    TDesC* ret = NULL;
+    
+    owner->PropertySetStringL( KFooName, KFooValue2 );
+    owner->PropertySetStringL( KFooName2, KFooValue );
+    owner->PropertySetStringL( KFooName3, KFooValue );
+    
+    TBool success = owner->PropertyFindString( KFooName, &ret );
+    
+    STIF_ASSERT_TRUE( success );
+    
+    success = *ret == KFooValue2;
+    STIF_ASSERT_TRUE( success );
+    
+    CleanupStack::PopAndDestroy( owner );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestPropOwnerCopyPropertyL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestPropOwnerCopyPropertyL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestPropOwnerCopyPropertyL, "TestPropOwnerCopyPropertyL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestPropOwnerCopyPropertyL );
+    // Print to log file
+    iLog->Log( KTestPropOwnerCopyPropertyL );
+    
+    CAlfPropertyOwner* originalOwner = new ( ELeave ) CAlfPropertyOwner();
+    CleanupStack::PushL( originalOwner );
+    STIF_ASSERT_NOT_NULL( originalOwner );
+    originalOwner->PropertySetStringL( KFooName, KFooValue );
+    CAlfPropertyOwner* owner = new ( ELeave ) CAlfPropertyOwner();
+    CleanupStack::PushL( owner );
+    STIF_ASSERT_NOT_NULL( owner );
+    owner->CopyProperty( *originalOwner, KFooName );
+    CleanupStack::PopAndDestroy( owner );
+    CleanupStack::PopAndDestroy( originalOwner );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestPropOwnerPropertyOwnerExtensionL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestPropOwnerPropertyOwnerExtensionL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestPropOwnerPropertyOwnerExtensionL, "TestPropOwnerPropertyOwnerExtensionL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestPropOwnerPropertyOwnerExtensionL );
+    // Print to log file
+    iLog->Log( KTestPropOwnerPropertyOwnerExtensionL );
+    
+    CTestPropertyOwner* owner = new ( ELeave ) CTestPropertyOwner;
+    CleanupStack::PushL( owner );
+    STIF_ASSERT_NOT_NULL( owner );
+    owner->TestPropertyOwnerExtension();
+    CleanupStack::PopAndDestroy( owner );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksroster.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,452 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfroster.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alfroster.h>
+#include <alf/alfmetric.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TInt KNum3 = 3;
+const TInt KNum4 = 4;
+const TInt KNum5 = 5;
+const TReal32 KMagnitude = 5;
+const TInt KControlId = 222;
+
+
+// FORWARD DECLARATION
+//class CTestControlGroupOrderChangedObserver for testing CAlfRoster
+class CTestControlGroupOrderChangedObserver
+: public CBase, public MAlfControlGroupOrderChangedObserver
+    {
+public:
+    /**
+     * Default constructor
+     */
+    CTestControlGroupOrderChangedObserver( CAlfRoster& aRoster )
+    : iRoster( aRoster ), iNoOfCalls( 0 )
+        {}
+    
+    /**
+     * Default destructor
+     */
+    ~CTestControlGroupOrderChangedObserver()
+        {
+        iRoster.RemoveControlGroupOrderChangedObserver( *this );
+        }
+    
+    /**
+     * ConstructL
+     */
+    void ConstructL()
+        {
+        iRoster.AddControlGroupOrderChangedObserverL( *this );
+        }
+    
+    /**
+     * From MAlfControlGroupOrderChangedObserver
+     */
+    void NotifyControlGroupOrderChanged()
+        {
+        iNoOfCalls++;
+        }
+    
+    /**
+     * Accessor to the number of calls to the callback method
+     */
+    TInt NumberOfCalls() const
+        {
+        return iNoOfCalls;
+        }
+    
+private:
+    /** Roster to which this callback object is added to. */
+    CAlfRoster& iRoster;
+    
+    /**
+     * Number of calls to the callback method
+     */
+    TInt iNoOfCalls;
+    };
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestRosterCtrlGroupMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestRosterCtrlGroupMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestRosterCtrlGroupMethodsL, "TestRosterCtrlGroupMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestRosterCtrlGroupMethodsL );
+    // Print to log file
+    iLog->Log( KTestRosterCtrlGroupMethodsL );
+    
+    CAlfRoster* roster = &( iAlfDisplay->Roster() );
+    STIF_ASSERT_NOT_NULL( roster );
+    
+    CAlfControlGroup& group1 = iAlfEnv->NewControlGroupL( 2 );
+    CAlfControlGroup& group2 = iAlfEnv->NewControlGroupL( KNum3 );
+    CAlfControlGroup& group3 = iAlfEnv->NewControlGroupL( KNum4 );
+    CAlfControlGroup& group4 = iAlfEnv->NewControlGroupL( KNum5 );
+    
+    STIF_ASSERT_EQUALS( KErrNotFound, roster->Find( group1 ) );
+    STIF_ASSERT_EQUALS( 0, roster->Count() );
+    
+    // Create controls and append them to control group 1
+    CAlfControl* control = new (ELeave) CAlfControl;
+    CleanupStack::PushL( control );
+    control->ConstructL( *iAlfEnv );
+    group1.AppendL( control );
+    CleanupStack::Pop( control );
+    CAlfControl* control1 = new (ELeave) CAlfControl;
+    CleanupStack::PushL( control1 );
+    control1->ConstructL( *iAlfEnv );
+    group1.AppendL( control1 );
+    CleanupStack::Pop( control1 );
+    
+    roster->ShowL( group1 );
+    STIF_ASSERT_EQUALS( 1, roster->Count() );
+    roster->ShowL( group2 );
+    STIF_ASSERT_EQUALS( 2, roster->Count() );
+    roster->ShowL( group3 );
+    STIF_ASSERT_EQUALS( KNum3, roster->Count() );
+    roster->ShowL( group4 );
+    STIF_ASSERT_EQUALS( KNum4, roster->Count() );
+    
+    STIF_ASSERT_EQUALS( 0, roster->Find( group1 ) );
+    STIF_ASSERT_EQUALS( 1, roster->Find( group2 ) );
+    STIF_ASSERT_EQUALS( 2, roster->Find( group3 ) );
+    STIF_ASSERT_EQUALS( KNum3, roster->Find( group4 ) );
+    
+    if ( roster->Count() > 0 )
+        {
+        STIF_ASSERT_EQUALS( &group1, &roster->ControlGroup( 0 ) );
+        }
+    
+    // Verify that the controls are shown
+    STIF_ASSERT_EQUALS( iAlfDisplay, control->Display() );
+    STIF_ASSERT_EQUALS( iAlfDisplay, control1->Display() );
+    
+    roster->ShowL( group3, KAlfRosterShowAtBottom );
+    
+    STIF_ASSERT_EQUALS( 0, roster->Find( group3 ) );
+    STIF_ASSERT_EQUALS( 1, roster->Find( group1 ) );
+    STIF_ASSERT_EQUALS( 2, roster->Find( group2 ) ); 
+    STIF_ASSERT_EQUALS( KNum3, roster->Find( group4 ) );
+    
+    if ( roster->Count() > 0 )
+        {
+        STIF_ASSERT_EQUALS( &group3, &roster->ControlGroup( 0 ) );
+        }
+    
+    roster->ShowL( group3, KNum3 );
+     
+    STIF_ASSERT_EQUALS( 0, roster->Find( group1 ) );
+    STIF_ASSERT_EQUALS( 1, roster->Find( group2 ) ); 
+    STIF_ASSERT_EQUALS( 2, roster->Find( group4 ) );
+    STIF_ASSERT_EQUALS( KNum3, roster->Find( group3 ) );
+    
+    if ( roster->Count() > 0 )
+        {
+        STIF_ASSERT_EQUALS( &group1, &roster->ControlGroup( 0 ) );
+        }
+    
+    // Focus the appended control
+    roster->SetFocus( *control );
+    STIF_ASSERT_TRUE( control->Focus() );
+    
+    roster->Hide( group1 );
+    STIF_ASSERT_EQUALS( KErrNotFound, roster->Find( group1 ) );
+    STIF_ASSERT_EQUALS( KNum3, roster->Count() );
+    roster->Hide( group2 );
+    STIF_ASSERT_EQUALS( 2, roster->Count() );
+    roster->Hide( group3 );
+    STIF_ASSERT_EQUALS( 1, roster->Count() );
+    roster->Hide( group4 );
+    STIF_ASSERT_EQUALS( 0, roster->Count() );
+    
+    // Verify that focus was removed from control and 
+    // that the control was hidden
+    STIF_ASSERT_FALSE( control->Focus() );
+    STIF_ASSERT_NULL( control->Display() );
+    
+    // Add a control to a hidden control group
+    // Create controls and append them to iAlfCtrlGroup
+    CAlfControl* control2 = new (ELeave) CAlfControl;
+    CleanupStack::PushL( control2 );
+    control2->ConstructL( *iAlfEnv );
+    group1.AppendL( control2 );
+    CleanupStack::Pop( control2 );
+    
+    // Verify that the control2 is not shown
+    STIF_ASSERT_NULL( control2->Display() );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestRosterCtrlMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestRosterCtrlMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestRosterCtrlMethodsL, "TestRosterCtrlMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestRosterCtrlMethodsL );
+    // Print to log file
+    iLog->Log( KTestRosterCtrlMethodsL );
+    
+    CAlfRoster* roster = &( iAlfDisplay->Roster() );
+    STIF_ASSERT_NOT_NULL( roster );
+    STIF_ASSERT_NULL( roster->FindControl( KControlId ) );
+    iAlfCtl->SetId( KControlId );
+    roster->ShowL( *iAlfCtrlGroup );
+    roster->SetFocus( *iAlfCtl );
+    STIF_ASSERT_TRUE( iAlfCtl->Focus() );
+    STIF_ASSERT_EQUALS( iAlfCtl, roster->FindControl( KControlId ) );
+    roster->ClearFocus();
+    roster->Hide( *iAlfCtrlGroup );
+    STIF_ASSERT_FALSE( iAlfCtl->Focus() );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestRosterVisualMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestRosterVisualMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestRosterVisualMethodsL, "TestRosterVisualMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestRosterVisualMethodsL );
+    // Print to log file
+    iLog->Log( KTestRosterVisualMethodsL );
+    
+    CAlfRoster* roster = &( iAlfDisplay->Roster() );
+    STIF_ASSERT_NOT_NULL( roster );
+    
+    CAlfLayout* layout = CAlfLayout::AddNewL( *iAlfCtl );
+    
+    roster->ShowL( *iAlfCtrlGroup );
+    
+    TInt err = KErrNone;
+//    TRAP( err, roster->ShowVisualL( *layout ) );
+//    roster->MoveVisualToFront( *layout );
+    roster->HideVisual( *layout );
+    if ( err != KErrNone )
+        {
+        return KErrNone;
+        }
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestRosterPointerEventObserverMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestRosterPointerEventObserverMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestRosterPointerEventObserverMethodsL, "TestRosterPointerEventObserverMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestRosterPointerEventObserverMethodsL );
+    // Print to log file
+    iLog->Log( KTestRosterPointerEventObserverMethodsL );
+    
+    CAlfRoster* roster = &( iAlfDisplay->Roster() );
+    STIF_ASSERT_NOT_NULL( roster );
+    
+    STIF_ASSERT_EQUALS( KErrNone,
+            roster->AddPointerEventObserver( EAlfPointerEventReportDrag, *iAlfCtl ) );
+    STIF_ASSERT_EQUALS( KErrNone,
+            roster->AddPointerEventObserver( EAlfPointerEventReportLongTap, *iAlfCtl ) );
+    STIF_ASSERT_EQUALS( KErrNone,
+            roster->AddPointerEventObserver( EAlfPointerEventReportUnhandled, *iAlfCtl ) );
+    
+    STIF_ASSERT_EQUALS( KErrNone,
+            roster->RemovePointerEventObserver( EAlfPointerEventReportDrag, *iAlfCtl ) );
+    STIF_ASSERT_EQUALS( KErrNone,
+            roster->RemovePointerEventObserver( EAlfPointerEventReportLongTap, *iAlfCtl ) );
+    STIF_ASSERT_EQUALS( KErrNone,
+            roster->RemovePointerEventObserver( EAlfPointerEventReportUnhandled, *iAlfCtl ) );
+    
+    STIF_ASSERT_EQUALS( KErrNone,
+            roster->SetPointerEventObservers( EAlfPointerEventReportDrag, *iAlfCtl ) );
+    STIF_ASSERT_EQUALS(
+            KErrNone,
+            roster->SetPointerEventObservers(
+                    EAlfPointerEventReportDrag | EAlfPointerEventReportUnhandled,
+                    *iAlfCtl
+                    )
+            );
+    STIF_ASSERT_EQUALS( KErrNone,
+            roster->SetPointerEventObservers( EAlfPointerEventReportLongTap, *iAlfCtl ) );
+    STIF_ASSERT_EQUALS( KErrNone
+            , roster->SetPointerEventObservers( 0, *iAlfCtl ) );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestRosterSetPointerDragThresholdL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestRosterSetPointerDragThresholdL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestRosterSetPointerDragThresholdL, "TestRosterSetPointerDragThresholdL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestRosterSetPointerDragThresholdL );
+    // Print to log file
+    iLog->Log( KTestRosterSetPointerDragThresholdL );
+    
+    CAlfRoster* roster = &( iAlfDisplay->Roster() );
+    STIF_ASSERT_NOT_NULL( roster );
+    
+    STIF_ASSERT_EQUALS( KErrNone,
+            roster->SetPointerEventObservers( EAlfPointerEventReportDrag, *iAlfCtl ) );
+    STIF_ASSERT_EQUALS(
+            KErrNone,
+            roster->SetPointerDragThreshold(
+                    *iAlfCtl,
+                    TAlfXYMetric( KMagnitude, KMagnitude )
+                    )
+            );
+    STIF_ASSERT_EQUALS(
+            KErrNone,
+            roster->SetPointerDragThreshold(
+                    *iAlfCtl,
+                    TAlfXYMetric(
+                            TAlfMetric( KMagnitude, EAlfUnitS60 ),
+                            TAlfMetric( 0.2, EAlfUnitRelativeToDisplay )
+                            )
+                    )
+            );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestRosterDisableLongTapEventsWhenDraggingL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestRosterDisableLongTapEventsWhenDraggingL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestRosterDisableLongTapEventsWhenDraggingL, "TestRosterDisableLongTapEventsWhenDraggingL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestRosterDisableLongTapEventsWhenDraggingL );
+    // Print to log file
+    iLog->Log( KTestRosterDisableLongTapEventsWhenDraggingL );
+    
+    CAlfRoster* roster = &( iAlfDisplay->Roster() );
+    STIF_ASSERT_NOT_NULL( roster );
+    
+    STIF_ASSERT_EQUALS( KErrNone,
+            roster->SetPointerEventObservers( EAlfPointerEventReportDrag, *iAlfCtl ) );
+    STIF_ASSERT_EQUALS( KErrNone,
+            roster->DisableLongTapEventsWhenDragging( *iAlfCtl ));
+    STIF_ASSERT_EQUALS( KErrNone,
+            roster->DisableLongTapEventsWhenDragging( *iAlfCtl, EFalse ) );
+    
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestRosterCtrlGroupOrderChangedObserverL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestRosterCtrlGroupOrderChangedObserverL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestRosterCtrlGroupOrderChangedObserverL, "TestRosterCtrlGroupOrderChangedObserverL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestRosterCtrlGroupOrderChangedObserverL );
+    // Print to log file
+    iLog->Log( KTestRosterCtrlGroupOrderChangedObserverL );
+    
+    CAlfRoster* roster = &( iAlfDisplay->Roster() );
+    STIF_ASSERT_NOT_NULL( roster );
+    // Create test control groups
+    CAlfControlGroup& group2 = iAlfEnv->NewControlGroupL( 2 );
+    CAlfControlGroup& group3 = iAlfEnv->NewControlGroupL( KNum3 );
+    
+    // Show first control group [Roster: cg1]
+    roster->ShowL( *iAlfCtrlGroup );
+    
+    // Create an observer
+    CTestControlGroupOrderChangedObserver* observer =
+                new ( ELeave ) CTestControlGroupOrderChangedObserver( *roster );
+    CleanupStack::PushL( observer );
+    observer->ConstructL();
+    
+    // Show second control group [Roster: cg2, cg1]
+    roster->ShowL( group2 );
+              
+    // Remove observer
+    roster->RemoveControlGroupOrderChangedObserver( *observer );
+    
+    // Swap order of control group 1 and 2 [Roster: cg1, cg2]
+    roster->ShowL( *iAlfCtrlGroup );
+    
+    // Re-add observer
+    roster->AddControlGroupOrderChangedObserverL( *observer );
+    
+    // Reswap order of control group 1 and 2 [Roster: cg2, cg1]
+    roster->ShowL( group2 );
+
+    // Don't modify the order of control groups [Roster: cg2, cg1]
+    roster->ShowL( group2 );
+
+    // Delete control group 2 [Roster: cg1]
+    iAlfEnv->DeleteControlGroup( 2 );
+    
+    // Show new control group [Roster: cg3, cg1]
+    roster->ShowL( group3 );
+    
+    // Hide old control group [Roster: cg3]
+    roster->Hide( *iAlfCtrlGroup );
+    
+    // Hide hidden control group [Roster: cg3]
+    roster->Hide( *iAlfCtrlGroup );
+
+    // Hide last control group [Roster: ]
+    roster->Hide( group3 );
+    
+    CleanupStack::PopAndDestroy( observer );
+    
+    // Verify that control group order change does not panic
+    roster->ShowL( *iAlfCtrlGroup );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksscreenbuffer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,309 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfscreenbuffer.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alfscreenbuffer.h>
+#include <alf/alfsymbiansbdrawer.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TInt KTestDisplayPosX = 20;
+const TInt KTestDisplayPosY = 10;
+const TInt KTestDisplayWidth = 100;
+const TInt KTestDisplayHeight = 200;
+
+const TUid KTestScreenBufferUid = { 0x28032002 };
+const TUid KDummyUid = { 0x12345678 };
+
+
+// FORWARD DECLARATION
+// class CTestScreenBufferObserver for testing CAlfScreenBuffer
+ class CTestScreenBufferObserver : public CBase, public MAlfScreenBufferObserver
+     {
+ public:
+     /**
+      * Alf calls this when all the content have been draw to the back buffer.
+      */
+     TBool BufferComplete( TUid /*aBufferUid*/, TRect& /*aDisplayRect*/, TRect& /*aDirtyRect*/ )
+         {
+         return ETrue;
+         }
+     
+     /**
+      * Alf calls this when e.g. the back buffer is created or deleted.
+      */
+     void HandleScreenBufferEvent( TUid /*aBufferUid*/, TInt /*aEvent*/ ) {}
+     };
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestScrBufNewLMethodsL
+// -----------------------------------------------------------------------------
+
+TInt CTestPlatAlfVisual::TestScrBufNewLMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestScrBufNewLMethodsL, "TestScrBufNewLMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestScrBufNewLMethodsL );
+    // Print to log file
+    iLog->Log( KTestScrBufNewLMethodsL );
+    
+    CAlfScreenBuffer* scrBuf = NULL;
+    scrBuf = CAlfScreenBuffer::NewL( *iAlfEnv );
+    CleanupStack::PushL( scrBuf );
+    STIF_ASSERT_NOT_NULL( scrBuf );
+    CleanupStack::PopAndDestroy( scrBuf );
+    
+    scrBuf = CAlfScreenBuffer::NewL();
+    CleanupStack::PushL( scrBuf );
+    STIF_ASSERT_NOT_NULL( scrBuf );
+    CleanupStack::PopAndDestroy( scrBuf );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestScrBufGetMethodsL
+// -----------------------------------------------------------------------------
+
+TInt CTestPlatAlfVisual::TestScrBufGetMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestScrBufGetMethodsL, "TestScrBufGetMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestScrBufGetMethodsL );
+    // Print to log file
+    iLog->Log( KTestScrBufGetMethodsL );
+    
+    TRect dispRect( TPoint( KTestDisplayPosX, KTestDisplayPosY ),
+                    TSize( KTestDisplayWidth, KTestDisplayHeight ) );
+    CAlfDisplay* display = NULL;
+    TRAPD( err,
+           display = &iAlfEnv->NewDisplayL(
+                                   dispRect, 0, NULL,
+                                   CAlfDisplay::EDisplayOffScreenBuffer,
+                                   KTestScreenBufferUid
+                                   )
+          );
+    if ( ( err == KErrNotSupported ) &&
+         ( iAlfEnv->Renderer() != EAlfRendererBitgdi ) )
+        {
+        // Ok, as off-screen buffer should work only in BitGdi mode
+            err = KErrNone;
+        }
+    else
+        {
+        User::LeaveIfError( err );
+        display->SetVisibleArea( dispRect );
+        }   
+    
+    CAlfScreenBuffer* scrBuf = CAlfScreenBuffer::NewL( *iAlfEnv );
+    CleanupStack::PushL( scrBuf );
+    STIF_ASSERT_NOT_NULL( scrBuf );
+    
+    MAlfBufferDrawer* result = scrBuf->GetDrawingInterface( KDummyUid, KDummyUid );
+    STIF_ASSERT_EQUALS( result, ( MAlfBufferDrawer* )NULL );
+    result = scrBuf->GetDrawingInterface( KAlfSymbianBufferDrawerUid, KDummyUid );
+    STIF_ASSERT_EQUALS( result, ( MAlfBufferDrawer* )NULL );
+    result = scrBuf->GetDrawingInterface( KDummyUid, KTestScreenBufferUid );
+    STIF_ASSERT_EQUALS( result, ( MAlfBufferDrawer* )NULL );
+    
+    // *** Test with observer
+    CTestScreenBufferObserver* observer = new ( ELeave ) CTestScreenBufferObserver;
+    CleanupStack::PushL( observer );
+    STIF_ASSERT_NOT_NULL( observer );
+    
+    scrBuf->AddObserverL( KTestScreenBufferUid, observer );
+    result = scrBuf->GetDrawingInterface( KDummyUid, KDummyUid );
+    STIF_ASSERT_EQUALS( result, ( MAlfBufferDrawer* )NULL );
+    result = scrBuf->GetDrawingInterface( KAlfSymbianBufferDrawerUid, KDummyUid );
+    STIF_ASSERT_EQUALS( result, ( MAlfBufferDrawer* )NULL );
+    result = scrBuf->GetDrawingInterface( KDummyUid, KTestScreenBufferUid );
+    STIF_ASSERT_EQUALS( result, ( MAlfBufferDrawer* )NULL );
+    MAlfBufferDrawer* drawer = scrBuf->GetDrawingInterface(
+                            KAlfSymbianBufferDrawerUid, KTestScreenBufferUid );
+    if ( iAlfEnv->Renderer() == EAlfRendererBitgdi )
+        {
+        STIF_ASSERT_NOT_EQUALS( drawer, ( MAlfBufferDrawer* )NULL );
+        }
+    else
+        {
+        STIF_ASSERT_EQUALS( drawer, ( MAlfBufferDrawer* )NULL );
+        }
+
+    // Test ReleaseDrawer
+    if ( drawer )
+        {
+        drawer->ReleaseDrawer();
+        }
+    drawer = NULL;
+    
+    // *** Test with removed observer
+    scrBuf->RemoveObserver( KTestScreenBufferUid );
+    drawer = scrBuf->GetDrawingInterface( KAlfSymbianBufferDrawerUid, KTestScreenBufferUid );
+    STIF_ASSERT_EQUALS( drawer, ( MAlfBufferDrawer* )NULL );
+    
+    MAlfBufferGc* resultGc = scrBuf->GetGraphicsContext( KDummyUid, KDummyUid );
+    STIF_ASSERT_EQUALS( resultGc, ( MAlfBufferGc* )NULL );
+    
+    CleanupStack::PopAndDestroy( observer );
+    CleanupStack::PopAndDestroy( scrBuf );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestScrBufRequestMethodsL
+// -----------------------------------------------------------------------------
+
+TInt CTestPlatAlfVisual::TestScrBufRequestMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestScrBufRequestMethodsL, "TestScrBufRequestMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestScrBufRequestMethodsL );
+    // Print to log file
+    iLog->Log( KTestScrBufRequestMethodsL );
+    
+    TRect dispRect( TPoint( KTestDisplayPosX, KTestDisplayPosY ),
+                    TSize( KTestDisplayWidth, KTestDisplayHeight ) );
+    CAlfDisplay* display = NULL;
+    TRAPD( err,
+           display = &iAlfEnv->NewDisplayL(
+                                   dispRect, 0, NULL,
+                                   CAlfDisplay::EDisplayOffScreenBuffer,
+                                   KTestScreenBufferUid
+                                   )
+          );
+    if ( ( err == KErrNotSupported ) &&
+         ( iAlfEnv->Renderer() != EAlfRendererBitgdi ) )
+        {
+        // Ok, as off-screen buffer should work only in BitGdi mode
+            err = KErrNone;
+        }
+    else
+        {
+        User::LeaveIfError( err );
+        display->SetVisibleArea( dispRect );
+        }   
+    
+    CAlfScreenBuffer* scrBuf = CAlfScreenBuffer::NewL( *iAlfEnv );
+    CleanupStack::PushL( scrBuf );
+    STIF_ASSERT_NOT_NULL( scrBuf );
+    
+    CTestScreenBufferObserver* observer = new ( ELeave ) CTestScreenBufferObserver;
+    CleanupStack::PushL( observer );
+    STIF_ASSERT_NOT_NULL( observer );
+    
+    scrBuf->RequestNextBuffer( KTestScreenBufferUid ); 
+    scrBuf->RequestNextBuffer( KDummyUid );
+    
+    scrBuf->AddObserverL( KTestScreenBufferUid, observer );
+
+    // ***
+    scrBuf->RequestNextBuffer( KTestScreenBufferUid );
+    scrBuf->RequestNextBuffer( KDummyUid );
+    scrBuf->RequestNextBuffer( KTestScreenBufferUid );
+
+    scrBuf->AddObserverL( KDummyUid, observer );
+
+    scrBuf->RequestNextBuffer( KTestScreenBufferUid );
+    scrBuf->RequestNextBuffer( KDummyUid );
+    scrBuf->RequestNextBuffer( KTestScreenBufferUid );
+
+    scrBuf->RemoveObserver( KDummyUid );
+    scrBuf->RemoveObserver( KTestScreenBufferUid );
+    
+    CleanupStack::PopAndDestroy( observer );
+    CleanupStack::PopAndDestroy( scrBuf );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestScrBufObserverMethodsL
+// -----------------------------------------------------------------------------
+
+TInt CTestPlatAlfVisual::TestScrBufObserverMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestScrBufObserverMethodsL, "TestScrBufObserverMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestScrBufObserverMethodsL );
+    // Print to log file
+    iLog->Log( KTestScrBufObserverMethodsL );
+    
+    TRect dispRect( TPoint( KTestDisplayPosX, KTestDisplayPosY ),
+                    TSize( KTestDisplayWidth, KTestDisplayHeight ) );
+    CAlfDisplay* display = NULL;
+    TRAPD( err,
+           display = &iAlfEnv->NewDisplayL(
+                                   dispRect, 0, NULL,
+                                   CAlfDisplay::EDisplayOffScreenBuffer,
+                                   KTestScreenBufferUid
+                                   )
+          );
+    if ( ( err == KErrNotSupported ) &&
+         ( iAlfEnv->Renderer() != EAlfRendererBitgdi ) )
+        {
+        // Ok, as off-screen buffer should work only in BitGdi mode
+            err = KErrNone;
+        }
+    else
+        {
+        User::LeaveIfError( err );
+        display->SetVisibleArea( dispRect );
+        }   
+    
+    CAlfScreenBuffer* scrBuf = CAlfScreenBuffer::NewL( *iAlfEnv );
+    CleanupStack::PushL( scrBuf );
+    STIF_ASSERT_NOT_NULL( scrBuf );
+    
+    CTestScreenBufferObserver* observer = new ( ELeave ) CTestScreenBufferObserver;
+    CleanupStack::PushL( observer );
+    STIF_ASSERT_NOT_NULL( observer );
+    
+    scrBuf->AddObserverL( KTestScreenBufferUid, observer );
+    scrBuf->RemoveObserver( KTestScreenBufferUid );
+    
+    scrBuf->AddObserverL( KTestScreenBufferUid, observer, 1 ); // Just test non null priority even if it do not has an effect
+    scrBuf->RemoveObserver( KTestScreenBufferUid );
+    
+    scrBuf->AddObserverL( KTestScreenBufferUid, observer );
+    TRAP( err, scrBuf->AddObserverL( KTestScreenBufferUid, observer ) );
+    STIF_ASSERT_EQUALS( err, KErrAlreadyExists );
+    
+    scrBuf->RemoveObserver( KTestScreenBufferUid );
+    
+    scrBuf->AddObserverL( KTestScreenBufferUid, 0, observer );
+    scrBuf->RemoveObserver( KTestScreenBufferUid );
+    
+    CleanupStack::PopAndDestroy( observer );
+    CleanupStack::PopAndDestroy( scrBuf );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksscrollerevent.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfscrollerevent.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alfscrollerevent.h>
+
+#include "testplatalfvisual.h"
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestScrollEventMethods
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestScrollEventMethods( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestScrollEventMethods, "TestScrollEventMethods" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestScrollEventMethods );
+    // Print to log file
+    iLog->Log( KTestScrollEventMethods );
+    
+    TAlfScrollerEvent scrollerEvent(
+            TAlfScrollerEvent::EMoveByItem,
+            TAlfScrollerEvent::EVertical, 1
+            );
+    scrollerEvent.Code();
+    scrollerEvent.Orientation();
+    scrollerEvent.Magnitude();
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksshadowborderbrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfshadowborderbrush.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alfshadowborderbrush.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TInt KGeneralNum = 100;
+const TInt KTime = 1000000;
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestShadowBBNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestShadowBBNewL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestShadowBBNewL, "TestShadowBBNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestShadowBBNewL );
+    // Print to log file
+    iLog->Log( KTestShadowBBNewL );
+    
+    CAlfShadowBorderBrush* borderBrush = NULL;
+    
+    TAlfMetric metricWidth( KGeneralNum );
+    borderBrush = CAlfShadowBorderBrush::NewL( *iAlfEnv, metricWidth );
+    CleanupStack::PushL( borderBrush );
+    STIF_ASSERT_NOT_NULL( borderBrush );
+    CleanupStack::PopAndDestroy( borderBrush );
+    
+    borderBrush = CAlfShadowBorderBrush::NewL( *iAlfEnv, KGeneralNum );
+    CleanupStack::PushL( borderBrush );
+    STIF_ASSERT_NOT_NULL( borderBrush );
+    CleanupStack::PopAndDestroy( borderBrush );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestShadowBBNewLCL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestShadowBBNewLCL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestShadowBBNewLCL, "TestShadowBBNewLCL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestShadowBBNewLCL );
+    // Print to log file
+    iLog->Log( KTestShadowBBNewLCL );
+    
+    CAlfShadowBorderBrush* borderBrush = NULL;
+    
+    TAlfMetric metricWidth( KGeneralNum );
+    borderBrush = CAlfShadowBorderBrush::NewLC( *iAlfEnv, metricWidth );
+    STIF_ASSERT_NOT_NULL( borderBrush );
+    CleanupStack::PopAndDestroy( borderBrush );
+    
+    borderBrush = CAlfShadowBorderBrush::NewLC( *iAlfEnv, KGeneralNum );
+    STIF_ASSERT_NOT_NULL( borderBrush );
+    CleanupStack::PopAndDestroy( borderBrush );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestShadowBBWidthMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestShadowBBWidthMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestShadowBBWidthMethodsL, "TestShadowBBWidthMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestShadowBBWidthMethodsL );
+    // Print to log file
+    iLog->Log( KTestShadowBBWidthMethodsL );
+    
+    CAlfShadowBorderBrush* borderBrush = CAlfShadowBorderBrush::NewLC( *iAlfEnv, KGeneralNum );
+    STIF_ASSERT_NOT_NULL( borderBrush );
+    
+    const TAlfTimedValue& valueGet = borderBrush->Width();
+    STIF_ASSERT_EQUALS( 0, valueGet.TimeToTargetinMilliSeconds() );
+    
+    TAlfTimedValue valueSet;
+    valueSet.SetValueNow( 0 );
+    valueSet.SetTarget( 1, KTime );
+    borderBrush->SetWidth( valueSet );
+    borderBrush->Width();
+    STIF_ASSERT_EQUALS( 0.f, valueGet.ValueNow() );
+    STIF_ASSERT_EQUALS( 1.f, valueGet.Target() );
+    STIF_ASSERT_NOT_EQUALS( 0, valueGet.TimeToTargetinMilliSeconds() );
+    
+    TAlfMetric valueSet2( 2.f );
+    borderBrush->SetWidth( valueSet2 );
+    borderBrush->Width();
+    STIF_ASSERT_EQUALS( 2.f, valueGet.ValueNow() );
+    STIF_ASSERT_EQUALS( 2.f, valueGet.Target() );
+    STIF_ASSERT_EQUALS( 0, valueGet.TimeToTargetinMilliSeconds() );
+
+    CleanupStack::PopAndDestroy( borderBrush );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksstatic.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfstatic.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alfstatic.h>
+
+#include "testplatalfvisual.h"
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestStaticEnv
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestStaticEnv( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestStaticEnv, "TestStaticEnv" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestStaticEnv );
+    // Print to log file
+    iLog->Log( KTestStaticEnv );
+    
+    STIF_ASSERT_EQUALS( iAlfEnv, &CAlfStatic::Env() );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockssymbiansbdrawer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,203 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfsymbiansbdrawer.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alfsymbiansbdrawer.h>
+#include <alf/alfscreenbuffer.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TInt KTestDisplayPosX = 20;
+const TInt KTestDisplayPosY = 10;
+const TInt KTestDisplayWidth = 100;
+const TInt KTestDisplayHeight = 200;
+
+const TUid KTestScreenBufferUid = { 0x28032002 };
+
+
+// FORWARD DECLARATION
+//class CTestScreenBufferObserver for testing CAlfScreenBuffer
+class CTestScreenBufferObserver : public CBase, public MAlfScreenBufferObserver
+    {
+public:
+    /**
+     * From MAlfScreenBufferObserver
+     */
+    TBool BufferComplete( TUid /*aBufferUid*/, TRect& /*aDisplayRect*/, TRect& /*aDirtyRect*/ )
+        {
+        return ETrue;
+        }
+    
+    /**
+     * From MAlfScreenBufferObserver
+     */
+    void HandleScreenBufferEvent( TUid /*aBufferUid*/, TInt /*aEvent*/ ) {}
+    };
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBufDrawerDrawBufferL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestBufDrawerDrawBufferL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBufDrawerDrawBufferL, "TestBufDrawerDrawBufferL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBufDrawerDrawBufferL );
+    // Print to log file
+    iLog->Log( KTestBufDrawerDrawBufferL );
+    
+    TRect dispRect = TRect(
+                        TPoint( KTestDisplayPosX, KTestDisplayPosY ),
+                        TSize( KTestDisplayWidth, KTestDisplayHeight )
+                        );
+    CAlfDisplay* alfDisp = &( iAlfEnv->NewDisplayL(
+                            dispRect, 0, NULL,
+                            CAlfDisplay::EDisplayOffScreenBuffer,
+                            KTestScreenBufferUid ) );
+    STIF_ASSERT_NOT_NULL( alfDisp );
+    STIF_ASSERT_EQUALS( EAlfRendererBitgdi, iAlfEnv->Renderer() );
+    CTestScreenBufferObserver* observer = new ( ELeave ) CTestScreenBufferObserver;
+    CleanupStack::PushL( observer );
+    CAlfScreenBuffer* scrBuffer = CAlfScreenBuffer::NewL( *iAlfEnv );
+    CleanupStack::PushL( scrBuffer );
+    scrBuffer->AddObserverL( KTestScreenBufferUid, observer );
+    CAlfSymbianBufferDrawer* drawer =
+        ( CAlfSymbianBufferDrawer* ) scrBuffer->GetDrawingInterface(
+                KAlfSymbianBufferDrawerUid, KTestScreenBufferUid );
+    STIF_ASSERT_NOT_NULL( drawer );
+    
+    // create a bitmap, device and context to be used off-screen
+    CFbsBitmap* bitmap = new ( ELeave ) CFbsBitmap();
+    CleanupStack::PushL( bitmap );
+    TRect visibleRect = alfDisp->VisibleArea();
+    User::LeaveIfError( bitmap->Create( visibleRect.Size(), EColor64K ) );
+    CFbsBitmapDevice* device = CFbsBitmapDevice::NewL( bitmap );
+    CleanupStack::PushL( device );
+    CFbsBitGc* context = NULL;
+    User::LeaveIfError( device->CreateContext( context ) ); 
+    CleanupStack::PushL( context );
+
+    // Draw
+    drawer->DrawBuffer( *context, TPoint(), visibleRect );
+    
+    // Draw masked
+    CFbsBitmap* mask = new ( ELeave ) CFbsBitmap();
+    CleanupStack::PushL( mask );
+    User::LeaveIfError( mask->Create( visibleRect.Size(), EColor256 ) );
+    drawer->DrawBufferMasked( *context, mask, TPoint(), visibleRect );
+    
+    CleanupStack::PopAndDestroy( mask );
+    CleanupStack::PopAndDestroy( context );
+    CleanupStack::PopAndDestroy( device );
+    CleanupStack::PopAndDestroy( bitmap );
+    CleanupStack::PopAndDestroy( scrBuffer );
+    CleanupStack::PopAndDestroy( observer );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBufDrawerGetBufferBitmapsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestBufDrawerGetBufferBitmapsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBufDrawerGetBufferBitmapsL, "TestBufDrawerGetBufferBitmapsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBufDrawerGetBufferBitmapsL );
+    // Print to log file
+    iLog->Log( KTestBufDrawerGetBufferBitmapsL );
+    
+    TRect dispRect = TRect(
+                        TPoint( KTestDisplayPosX, KTestDisplayPosY ),
+                        TSize( KTestDisplayWidth, KTestDisplayHeight )
+                        );
+    CAlfDisplay* alfDisp = &( iAlfEnv->NewDisplayL(
+                            dispRect, 0, NULL,
+                            CAlfDisplay::EDisplayOffScreenBuffer,
+                            KTestScreenBufferUid ) );
+    STIF_ASSERT_NOT_NULL( alfDisp );
+    STIF_ASSERT_EQUALS( EAlfRendererBitgdi, iAlfEnv->Renderer() );
+    CTestScreenBufferObserver* observer = new ( ELeave ) CTestScreenBufferObserver;
+    CleanupStack::PushL( observer );
+    CAlfScreenBuffer* scrBuffer = CAlfScreenBuffer::NewL( *iAlfEnv );
+    CleanupStack::PushL( scrBuffer );
+    scrBuffer->AddObserverL( KTestScreenBufferUid, observer );
+    CAlfSymbianBufferDrawer* drawer =
+        ( CAlfSymbianBufferDrawer* ) scrBuffer->GetDrawingInterface(
+                KAlfSymbianBufferDrawerUid, KTestScreenBufferUid );
+    STIF_ASSERT_NOT_NULL( drawer );
+    CFbsBitmap* bitmap = NULL;
+    CFbsBitmap* mask = NULL;
+    drawer->GetBufferBitmaps( bitmap, mask );
+    CleanupStack::PopAndDestroy( scrBuffer );
+    CleanupStack::PopAndDestroy( observer );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestBufDrawerReleaseDrawerL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestBufDrawerReleaseDrawerL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestBufDrawerReleaseDrawerL, "TestBufDrawerReleaseDrawerL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestBufDrawerReleaseDrawerL );
+    // Print to log file
+    iLog->Log( KTestBufDrawerReleaseDrawerL );
+    
+    TRect dispRect = TRect(
+                        TPoint( KTestDisplayPosX, KTestDisplayPosY ),
+                        TSize( KTestDisplayWidth, KTestDisplayHeight )
+                        );
+    CAlfDisplay* alfDisp = &( iAlfEnv->NewDisplayL(
+                            dispRect, 0, NULL,
+                            CAlfDisplay::EDisplayOffScreenBuffer,
+                            KTestScreenBufferUid ) );
+    STIF_ASSERT_NOT_NULL( alfDisp );
+    STIF_ASSERT_EQUALS( EAlfRendererBitgdi, iAlfEnv->Renderer() );
+    CTestScreenBufferObserver* observer = new ( ELeave ) CTestScreenBufferObserver;
+    CleanupStack::PushL( observer );
+    CAlfScreenBuffer* scrBuffer = CAlfScreenBuffer::NewL( *iAlfEnv );
+    CleanupStack::PushL( scrBuffer );
+    scrBuffer->AddObserverL( KTestScreenBufferUid, observer );
+    CAlfSymbianBufferDrawer* drawer =
+        ( CAlfSymbianBufferDrawer* ) scrBuffer->GetDrawingInterface(
+                KAlfSymbianBufferDrawerUid, KTestScreenBufferUid );
+    STIF_ASSERT_NOT_NULL( drawer );
+    drawer->ReleaseDrawer();
+    drawer = NULL;
+    CleanupStack::PopAndDestroy( scrBuffer );
+    CleanupStack::PopAndDestroy( observer );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstextstyle.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,305 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alftextstyle.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alftextstyle.h>
+
+#include "testplatalfvisual.h"
+
+// CONSTANTS
+const TInt KTextPaneHeight = 20;
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestStyleParentIdL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestStyleParentIdL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestStyleParentIdL, "TestStyleParentIdL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestStyleParentIdL );
+    // Print to log file
+    iLog->Log( KTestStyleParentIdL );
+    
+    CAlfTextStyleManager* styleMgr = &( iAlfEnv->TextStyleManager() );
+    STIF_ASSERT_NOT_NULL( styleMgr );
+    
+    // create a new TextStyle A
+    TInt styleAId = styleMgr->CreatePlatformTextStyleL(
+                        EAknLogicalFontSecondaryFont, EAlfTextStyleNormal );
+    
+    // create a new style B having A as parent
+    TInt styleBId = styleMgr->CreatePlatformTextStyleL(
+                        EAknLogicalFontSecondaryFont, styleAId );
+    
+    // clone TextStyle C from B
+    TInt styleCId = styleMgr->CopyTextStyleL( styleBId );
+       
+    CAlfTextStyle* styleA = styleMgr->TextStyle( styleAId );
+    CAlfTextStyle* styleB = styleMgr->TextStyle( styleBId );
+    CAlfTextStyle* styleC = styleMgr->TextStyle( styleCId );
+
+    TInt resultAId = styleA->Id();
+    TInt resultBParentId = styleB->ParentId();
+    TInt resultCParentId = styleC->ParentId();
+
+    STIF_ASSERT_EQUALS( resultAId, resultBParentId );
+    STIF_ASSERT_EQUALS( resultAId, resultCParentId );
+    STIF_ASSERT_EQUALS( resultBParentId, resultCParentId );
+    
+    styleB->SetParentId( resultBParentId );
+    styleC->SetParentId( resultCParentId );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestStyleIdL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestStyleIdL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestStyleIdL, "TestStyleIdL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestStyleIdL );
+    // Print to log file
+    iLog->Log( KTestStyleIdL );
+    
+    CAlfTextStyleManager* styleMgr = &( iAlfEnv->TextStyleManager() );
+    STIF_ASSERT_NOT_NULL( styleMgr );
+    
+    TInt styleAId = styleMgr->CreatePlatformTextStyleL(
+                            EAknLogicalFontSecondaryFont, EAlfTextStyleNormal );
+    TInt styleBId = styleMgr->CreatePlatformTextStyleL(
+                            EAknLogicalFontSecondaryFont, styleAId );
+    TInt styleCId = styleMgr->CopyTextStyleL( styleBId );
+       
+    CAlfTextStyle* styleA = styleMgr->TextStyle( styleAId );
+    CAlfTextStyle* styleB = styleMgr->TextStyle( styleBId );
+    CAlfTextStyle* styleC = styleMgr->TextStyle( styleCId );
+
+    STIF_ASSERT_NOT_EQUALS( styleA->Id(), styleB->Id() );
+    STIF_ASSERT_NOT_EQUALS( styleB->Id(), styleC->Id() );
+    STIF_ASSERT_NOT_EQUALS( styleA->Id(), styleC->Id() );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestStyleTextColorL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestStyleTextColorL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestStyleTextColorL, "TestStyleTextColorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestStyleTextColorL );
+    // Print to log file
+    iLog->Log( KTestStyleTextColorL );
+    
+    CAlfTextStyleManager* styleMgr = &( iAlfEnv->TextStyleManager() );
+    TInt styleId = styleMgr->CreatePlatformTextStyleL(
+            EAknLogicalFontSecondaryFont, EAlfTextStyleNormal );
+    CAlfTextStyle* style = styleMgr->TextStyle( styleId );
+    style->SetTextColor( KRgbRed );
+    TRgb txtColor = style->TextColor();
+    STIF_ASSERT_EQUALS( KRgbRed, txtColor );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestStyleTextSizeL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestStyleTextSizeL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestStyleTextSizeL, "TestStyleTextSizeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestStyleTextSizeL );
+    // Print to log file
+    iLog->Log( KTestStyleTextSizeL );
+    
+    CAlfTextStyleManager* styleMgr = &( iAlfEnv->TextStyleManager() );
+    TInt styleId = styleMgr->CreatePlatformTextStyleL(
+            EAknLogicalFontSecondaryFont, EAlfTextStyleNormal );
+    CAlfTextStyle* style = styleMgr->TextStyle( styleId );
+    style->SetTextSizeInTwips( 1 );
+    TInt txtSizeInTwips = style->TextSizeInTwips();
+    STIF_ASSERT_EQUALS( 1, txtSizeInTwips );
+    style->SetTextSizeInPixels( 1 );
+    TInt txtSizeInPixels = style->TextSizeInPixels();
+    STIF_ASSERT_EQUALS( 1, txtSizeInPixels );
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestStyleBoldL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestStyleBoldL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestStyleBoldL, "TestStyleBoldL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestStyleBoldL );
+    // Print to log file
+    iLog->Log( KTestStyleBoldL );
+    
+    CAlfTextStyleManager* styleMgr = &( iAlfEnv->TextStyleManager() );
+    TInt styleId = styleMgr->CreatePlatformTextStyleL(
+            EAknLogicalFontSecondaryFont, EAlfTextStyleNormal );
+    CAlfTextStyle* style = styleMgr->TextStyle( styleId );
+    style->SetBold( ETrue );
+    TBool isBold = style->IsBold();
+    STIF_ASSERT_TRUE( isBold );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestStyleItalicL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestStyleItalicL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestStyleItalicL, "TestStyleItalicL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestStyleItalicL );
+    // Print to log file
+    iLog->Log( KTestStyleItalicL );
+    
+    CAlfTextStyleManager* styleMgr = &( iAlfEnv->TextStyleManager() );
+    TInt styleId = styleMgr->CreatePlatformTextStyleL(
+            EAknLogicalFontSecondaryFont, EAlfTextStyleNormal );
+    CAlfTextStyle* style = styleMgr->TextStyle( styleId );
+    style->SetItalic( ETrue );
+    TBool isItalic = style->IsItalic();
+    STIF_ASSERT_TRUE( isItalic );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestStyleUnderlineL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestStyleUnderlineL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestStyleUnderlineL, "TestStyleUnderlineL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestStyleUnderlineL );
+    // Print to log file
+    iLog->Log( KTestStyleUnderlineL );
+    
+    CAlfTextStyleManager* styleMgr = &( iAlfEnv->TextStyleManager() );
+    TInt styleId = styleMgr->CreatePlatformTextStyleL(
+            EAknLogicalFontSecondaryFont, EAlfTextStyleNormal );
+    CAlfTextStyle* style = styleMgr->TextStyle( styleId );
+    style->SetUnderline( ETrue );
+    TBool isUnderline = style->IsUnderline();
+    STIF_ASSERT_TRUE( isUnderline );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestStyleStrikeThroughL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestStyleStrikeThroughL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestStyleStrikeThroughL, "TestStyleStrikeThroughL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestStyleStrikeThroughL );
+    // Print to log file
+    iLog->Log( KTestStyleStrikeThroughL );
+    
+    CAlfTextStyleManager* styleMgr = &( iAlfEnv->TextStyleManager() );
+    TInt styleId = styleMgr->CreatePlatformTextStyleL(
+            EAknLogicalFontSecondaryFont, EAlfTextStyleNormal );
+    CAlfTextStyle* style = styleMgr->TextStyle( styleId );
+    style->SetStrikeThrough( ETrue );
+    TBool isStrikeThrough = style->IsStrikeThrough();
+    STIF_ASSERT_TRUE( isStrikeThrough );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestStyleTypefaceNameL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestStyleTypefaceNameL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestStyleTypefaceNameL, "TestStyleTypefaceNameL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestStyleTypefaceNameL );
+    // Print to log file
+    iLog->Log( KTestStyleTypefaceNameL );
+    
+    CAlfTextStyleManager* styleMgr = &( iAlfEnv->TextStyleManager() );
+    TInt styleId = styleMgr->CreatePlatformTextStyleL(
+            EAknLogicalFontSecondaryFont, EAlfTextStyleNormal );
+    CAlfTextStyle* style = styleMgr->TextStyle( styleId );
+    style->TypefaceNameL();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestStyleSetTextPaneHeightInPixelsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestStyleSetTextPaneHeightInPixelsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestStyleSetTextPaneHeightInPixelsL, "TestStyleSetTextPaneHeightInPixelsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestStyleSetTextPaneHeightInPixelsL );
+    // Print to log file
+    iLog->Log( KTestStyleSetTextPaneHeightInPixelsL );
+    
+    CAlfTextStyleManager* styleMgr = &( iAlfEnv->TextStyleManager() );
+    TInt styleId = styleMgr->CreatePlatformTextStyleL(
+            EAknLogicalFontSecondaryFont, EAlfTextStyleNormal );
+    CAlfTextStyle* style = styleMgr->TextStyle( styleId );
+    
+    style->SetTextPaneHeightInPixels( KTextPaneHeight );
+    TInt size = style->TextSizeInPixels();
+    TBool within = ( size <= KTextPaneHeight );
+    STIF_ASSERT_TRUE( within );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstextstylemanager.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alftextstylemanager.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alftextstylemanager.h>
+#include <alf/alftextstyle.h>
+
+#include "testplatalfvisual.h"
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestStyleMgrTextStyleMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestStyleMgrTextStyleMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestStyleMgrTextStyleMethodsL, "TestStyleMgrTextStyleMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestStyleMgrTextStyleMethodsL );
+    // Print to log file
+    iLog->Log( KTestStyleMgrTextStyleMethodsL );
+    
+    CAlfTextStyleManager* styleMgr = &( iAlfEnv->TextStyleManager() );
+    
+    // create a new TextStyle A
+    TInt styleAId = styleMgr->CreatePlatformTextStyleL(
+            EAknLogicalFontSecondaryFont, EAlfTextStyleNormal );
+    
+    // create a new style B having A as parent
+    TInt styleBId = styleMgr->CreatePlatformTextStyleL( styleAId );
+    
+    // clone TextStyle C from B
+    TInt styleCId = styleMgr->CopyTextStyleL( styleBId );
+       
+    styleMgr->TextStyle( styleAId );
+    styleMgr->TextStyle( styleBId );
+    styleMgr->TextStyle( styleCId );
+    
+    styleMgr->DeleteTextStyle( styleAId );
+    styleMgr->DeleteTextStyle( styleBId );
+    styleMgr->DeleteTextStyle( styleCId );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstexture.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,144 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alftexture.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alftexture.h>
+#include <alf/alfbitmapprovider.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TInt KExistingTextureId = 1000;
+
+const TInt KProvidedBitmapWidth = 64;
+const TInt KProvidedBitmapHeight = 64;
+
+_LIT( KImageName, "OneExistingTexture" );
+
+
+// FORWARD DECLARATION
+class CTestBmpProvider : public CBase, public MAlfBitmapProvider
+    {
+public:
+    /**
+     * Provide a bitmap and mask from the given UID.
+     * This method should create a bitmap and its mask, usually by loading it from disk.
+     */
+    void ProvideBitmapL(TInt /*aId*/, CFbsBitmap*& aBitmap, CFbsBitmap*& aBitmapMask)
+        {
+        aBitmap = new ( ELeave ) CFbsBitmap;
+        aBitmapMask = new ( ELeave ) CFbsBitmap;
+        TSize bmpSize( KProvidedBitmapWidth, KProvidedBitmapHeight );
+        aBitmap->Create( bmpSize, EColor64K );
+        aBitmapMask->Create( bmpSize, EGray256 );
+        }
+    };
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTextureGetMethods
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTextureGetMethods( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTextureGetMethods, "TestTextureGetMethods" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTextureGetMethods );
+    // Print to log file
+    iLog->Log( KTestTextureGetMethods );
+    
+    CAlfTexture* texture = &( iAlfEnv->TextureManager().BlankTexture() );
+    texture->Id();
+    texture->ServerHandle();
+    texture->FileName();
+    texture->HasContent();
+    texture->MaxTextureSize();
+    texture->Size();
+    texture->IsAnimated();
+    texture->Priority();
+    texture->AutoSizeParams();
+    texture->RefCountingEnabled();
+    texture->RefCountingAction();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTextureAnimation
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTextureAnimation( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTextureAnimation, "TestTextureAnimation" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTextureAnimation );
+    // Print to log file
+    iLog->Log( KTestTextureAnimation );
+    
+    CAlfTexture* texture = &( iAlfEnv->TextureManager().BlankTexture() );
+    texture->StartAnimation();
+    texture->StopAnimation();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTextureSetMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTextureSetMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTextureSetMethodsL, "TestTextureSetMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTextureSetMethodsL );
+    // Print to log file
+    iLog->Log( KTestTextureSetMethodsL );
+    
+    CTestBmpProvider* bmpProvider = new ( ELeave ) CTestBmpProvider;
+    CleanupStack::PushL( bmpProvider );
+    iAlfEnv->TextureManager().DefineFileNameL(
+                        KExistingTextureId, KImageName );
+    CAlfTexture* texture = &( iAlfEnv->TextureManager().CreateTextureL(
+                    KExistingTextureId, bmpProvider, EAlfTextureFlagAutoSize ) );
+    texture->SetPriority( texture->Priority() );
+    texture->SetAutoSizeParams( texture->AutoSizeParams() );
+    texture->EnableRefCounting( texture->RefCountingEnabled() );
+    texture->SetRefCountingAction( texture->RefCountingAction() );
+    
+    TAlfTextureAutoSizeParams newparams = texture->AutoSizeParams();
+    newparams.SetSizeLowerThreshold( TAlfTextureAutoSizeParams::EHigh );
+    texture->SetAutoSizeParams(newparams);
+    TAlfTextureAutoSizeParams resultparams = texture->AutoSizeParams();
+    TInt target = TAlfTextureAutoSizeParams::EHigh;
+    STIF_ASSERT_EQUALS( target, resultparams.SizeLowerThreshold() );
+
+    CleanupStack::PopAndDestroy( bmpProvider );
+
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstextureautosizeparams.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alftextureautosizeparams.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alftextureautosizeparams.h>
+
+#include "testplatalfvisual.h"
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtAutoSizeParamsConstructor
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtAutoSizeParamsConstructor( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtAutoSizeParamsConstructor, "TestTxtAutoSizeParamsConstructor" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtAutoSizeParamsConstructor );
+    // Print to log file
+    iLog->Log( KTestTxtAutoSizeParamsConstructor );
+    
+    TAlfTextureAutoSizeParams params;
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtAutoSizeParamsGetMethods
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtAutoSizeParamsGetMethods( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtAutoSizeParamsGetMethods, "TestTxtAutoSizeParamsGetMethods" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtAutoSizeParamsGetMethods );
+    // Print to log file
+    iLog->Log( KTestTxtAutoSizeParamsGetMethods );
+    
+    TAlfTextureAutoSizeParams params;
+    
+    TInt target = TAlfTextureAutoSizeParams::EHigh;
+    params.SetSizeLowerThreshold( target );
+    TInt result = params.SizeLowerThreshold();
+    STIF_ASSERT_EQUALS( target, result );
+    target = TAlfTextureAutoSizeParams::ELow;
+    params.SetSizeLowerThreshold( target );
+    result = params.SizeLowerThreshold();
+    STIF_ASSERT_EQUALS( target, result );
+    
+    target = TAlfTextureAutoSizeParams::EHigh;
+    params.SetSizeUpperThreshold( target );
+    result = params.SizeUpperThreshold();
+    STIF_ASSERT_EQUALS( target, result );
+    target = TAlfTextureAutoSizeParams::ELow;
+    params.SetSizeUpperThreshold( target );
+    result = params.SizeUpperThreshold();
+    STIF_ASSERT_EQUALS( target, result );
+    
+    target = TAlfTextureAutoSizeParams::EHigh;
+    params.SetMinSizeChange( target );
+    result = params.MinSizeChange();
+    STIF_ASSERT_EQUALS( target, result );
+    target = TAlfTextureAutoSizeParams::ELow;
+    params.SetMinSizeChange( target );
+    result = params.MinSizeChange();
+    STIF_ASSERT_EQUALS( target, result );
+    
+    target = TAlfTextureAutoSizeParams::EHigh;
+    params.SetDownsizeSettleThreshold( target );
+    result = params.DownsizeSettleThreshold();
+    STIF_ASSERT_EQUALS( target, result );
+    target = TAlfTextureAutoSizeParams::ELow;
+    params.SetDownsizeSettleThreshold( target );
+    result = params.DownsizeSettleThreshold();
+    STIF_ASSERT_EQUALS( target, result );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtAutoSizeParamsSetMethods
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtAutoSizeParamsSetMethods( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtAutoSizeParamsSetMethods, "TestTxtAutoSizeParamsSetMethods" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtAutoSizeParamsSetMethods );
+    // Print to log file
+    iLog->Log( KTestTxtAutoSizeParamsSetMethods );
+    
+    TAlfTextureAutoSizeParams params;
+    
+    TInt target = TAlfTextureAutoSizeParams::EHigh;
+    params.SetSizeLowerThreshold( target );
+    TInt result = params.SizeLowerThreshold();
+    STIF_ASSERT_EQUALS( target, result );
+    target = TAlfTextureAutoSizeParams::ELow;
+    params.SetSizeLowerThreshold( target );
+    result = params.SizeLowerThreshold();
+    STIF_ASSERT_EQUALS( target, result );
+    
+    target = TAlfTextureAutoSizeParams::EHigh;
+    params.SetSizeUpperThreshold( target );
+    result = params.SizeUpperThreshold();
+    STIF_ASSERT_EQUALS( target, result );
+    target = TAlfTextureAutoSizeParams::ELow;
+    params.SetSizeUpperThreshold( target );
+    result = params.SizeUpperThreshold();
+    STIF_ASSERT_EQUALS( target, result );
+    
+    target = TAlfTextureAutoSizeParams::EHigh;
+    params.SetMinSizeChange( target );
+    result = params.MinSizeChange();
+    STIF_ASSERT_EQUALS( target, result );
+    target = TAlfTextureAutoSizeParams::ELow;
+    params.SetMinSizeChange( target );
+    result = params.MinSizeChange();
+    STIF_ASSERT_EQUALS( target, result );
+    
+    target = TAlfTextureAutoSizeParams::EHigh;
+    params.SetDownsizeSettleThreshold( target );
+    result = params.DownsizeSettleThreshold();
+    STIF_ASSERT_EQUALS( target, result );
+    target = TAlfTextureAutoSizeParams::ELow;
+    params.SetDownsizeSettleThreshold( target );
+    result = params.DownsizeSettleThreshold();
+    STIF_ASSERT_EQUALS( target, result );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstexturegroup.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,341 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alftexturegroup.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alftexturegroup.h>
+#include <alf/alfbitmapprovider.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TInt KProvidedBitmapWidth = 64;
+const TInt KProvidedBitmapHeight = 64;
+
+const TInt KTextureNum = 3;
+
+
+// FORWARD DECLARATION
+// CTestBmpProvider for testing methods of CAlfTextureGroup
+class CTestBmpProvider : public CBase, public MAlfBitmapProvider
+    {
+public:
+    /**
+     * Provide a bitmap and mask from the given UID.
+     * This method should create a bitmap and its mask, usually by loading it from disk.
+     */
+    void ProvideBitmapL(TInt /*aId*/, CFbsBitmap*& aBitmap, CFbsBitmap*& aBitmapMask)
+        {
+        aBitmap = new ( ELeave ) CFbsBitmap;
+        aBitmapMask = new ( ELeave ) CFbsBitmap;
+        TSize providedBitmapSize( KProvidedBitmapWidth, KProvidedBitmapHeight );
+        aBitmap->Create( providedBitmapSize, EColor64K );
+        aBitmapMask->Create( providedBitmapSize, EGray256 );
+        }
+    };
+
+// CTestTextureGroupObserver for testing methods of CAlfTextureGroup
+class CTestTextureGroupObserver : public CBase, public MAlfTextureGroupLoadingCompletedObserver
+    {
+public:
+    /**
+     * Constructor
+     */
+    CTestTextureGroupObserver() : iObservedTexturegroup( NULL ) {}
+    
+    /**
+     * From MAlfTextureGroupLoadingCompletedObserver
+     */
+    void TextureGroupLoadingCompleted( CAlfTextureGroup& aTextureGroup, TInt /*aErrorCode*/ )
+        {
+        iObservedTexturegroup = &aTextureGroup;
+        }
+    
+public:
+    /**
+     * OWN: Group of textures that has been loaded
+     */
+    CAlfTextureGroup* iObservedTexturegroup;
+    };
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtGroupNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtGroupNewL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtGroupNewL, "TestTxtGroupNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtGroupNewL );
+    // Print to log file
+    iLog->Log( KTestTxtGroupNewL );
+    
+    CAlfTextureGroup* txtGroup = CAlfTextureGroup::NewL( *iAlfEnv );
+    CleanupStack::PushL( txtGroup );
+    STIF_ASSERT_NOT_NULL( txtGroup );
+    CleanupStack::PopAndDestroy( txtGroup );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtGroupNewLCL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtGroupNewLCL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtGroupNewLCL, "TestTxtGroupNewLCL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtGroupNewLCL );
+    // Print to log file
+    iLog->Log( KTestTxtGroupNewLCL );
+    
+    CAlfTextureGroup* txtGroup = CAlfTextureGroup::NewLC( *iAlfEnv );
+    STIF_ASSERT_NOT_NULL( txtGroup );
+    CleanupStack::PopAndDestroy( txtGroup );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtGroupTextureMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtGroupTextureMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtGroupTextureMethodsL, "TestTxtGroupTextureMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtGroupTextureMethodsL );
+    // Print to log file
+    iLog->Log( KTestTxtGroupTextureMethodsL );
+    
+    CAlfTextureGroup* txtGroup = CAlfTextureGroup::NewL( *iAlfEnv );
+    CleanupStack::PushL( txtGroup );
+    STIF_ASSERT_NOT_NULL( txtGroup );
+    
+    STIF_ASSERT_EQUALS( 0, txtGroup->Count() );
+
+    CTestBmpProvider* bmpProvider = new ( ELeave ) CTestBmpProvider;
+    CleanupStack::PushL( bmpProvider );
+    STIF_ASSERT_NOT_NULL( bmpProvider );
+    CAlfTextureManager& textureMgr = iAlfEnv->TextureManager();
+    CAlfTexture& firstTexture = textureMgr.CreateTextureL(
+            KAlfAutoGeneratedTextureId, bmpProvider, EAlfTextureFlagDefault );
+    CAlfTexture& secondTexture = textureMgr.CreateTextureL(
+            KAlfAutoGeneratedTextureId, bmpProvider, EAlfTextureFlagDefault );
+    CAlfTexture& thirdTexture = textureMgr.CreateTextureL(
+            KAlfAutoGeneratedTextureId, bmpProvider, EAlfTextureFlagDefault );
+
+    // Add one texture
+    txtGroup->AddTextureL( firstTexture );
+    STIF_ASSERT_EQUALS( 1, txtGroup->Count() );
+    STIF_ASSERT_EQUALS( &firstTexture, &txtGroup->Texture( 0 ) );
+    
+    // Try adding first texture again (it should not increase count)
+    txtGroup->AddTextureL( firstTexture );
+    STIF_ASSERT_EQUALS( 1, txtGroup->Count() );
+    
+    txtGroup->AddTextureL( secondTexture );
+    STIF_ASSERT_EQUALS( 2, txtGroup->Count() );
+    STIF_ASSERT_EQUALS( &firstTexture, &txtGroup->Texture( 0 ) );
+    STIF_ASSERT_EQUALS( &secondTexture, &txtGroup->Texture( 1 ) );
+    
+    txtGroup->AddTextureL( thirdTexture );
+    STIF_ASSERT_EQUALS( KTextureNum, txtGroup->Count() );
+    STIF_ASSERT_EQUALS( &firstTexture, &txtGroup->Texture( 0 ) );
+    STIF_ASSERT_EQUALS( &secondTexture, &txtGroup->Texture( 1 ) );
+    STIF_ASSERT_EQUALS( &thirdTexture, &txtGroup->Texture( 2 ) );
+    
+    // Try adding first texture again (it should not increase count)
+    txtGroup->AddTextureL( firstTexture );
+    STIF_ASSERT_EQUALS( KTextureNum, txtGroup->Count() );
+    
+    txtGroup->RemoveTexture( secondTexture );
+    STIF_ASSERT_EQUALS( &firstTexture, &txtGroup->Texture( 0 ) );
+    STIF_ASSERT_EQUALS( &thirdTexture, &txtGroup->Texture( 1 ) );
+    STIF_ASSERT_EQUALS( 2, txtGroup->Count() );
+    
+    // add removed back
+    txtGroup->AddTextureL( secondTexture );
+    STIF_ASSERT_EQUALS( KTextureNum, txtGroup->Count() );
+    
+    // Remove succesful first texture
+    txtGroup->RemoveTexture( firstTexture );
+    STIF_ASSERT_EQUALS( 2, txtGroup->Count() );
+    
+    // Try to remove texture which does not exist (unsuccesful)
+    txtGroup->RemoveTexture( firstTexture );
+    STIF_ASSERT_EQUALS( 2, txtGroup->Count() );
+    
+    // Remove succesful last texture of array
+    txtGroup->RemoveTexture( thirdTexture );
+    STIF_ASSERT_EQUALS( 1, txtGroup->Count() );
+    
+    // Remove succesful last texture 
+    txtGroup->RemoveTexture( secondTexture );
+    STIF_ASSERT_EQUALS( 0, txtGroup->Count() );
+    
+    // Remove from empty group (unsuccesful)
+    txtGroup->RemoveTexture( secondTexture );
+    STIF_ASSERT_EQUALS( 0, txtGroup->Count() );
+    
+    CleanupStack::PopAndDestroy( bmpProvider );
+    CleanupStack::PopAndDestroy( txtGroup );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtGroupIsLoadingCompletedL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtGroupIsLoadingCompletedL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtGroupIsLoadingCompletedL, "TestTxtGroupIsLoadingCompletedL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtGroupIsLoadingCompletedL );
+    // Print to log file
+    iLog->Log( KTestTxtGroupIsLoadingCompletedL );
+    
+    CAlfTextureGroup* txtGroup = CAlfTextureGroup::NewL( *iAlfEnv );
+    CleanupStack::PushL( txtGroup );
+    STIF_ASSERT_NOT_NULL( txtGroup );
+    
+    STIF_ASSERT_FALSE( txtGroup->IsLoadingCompleted() );
+
+    CAlfTextureManager& textureMgr = iAlfEnv->TextureManager();
+    CTestBmpProvider* bmpProvider = new ( ELeave ) CTestBmpProvider;
+    CleanupStack::PushL( bmpProvider );
+    STIF_ASSERT_NOT_NULL( bmpProvider );
+    CAlfTexture& firstTexture = textureMgr.CreateTextureL(
+                    KAlfAutoGeneratedTextureId, bmpProvider, EAlfTextureFlagDefault );
+
+    // Add one texture that has content
+    txtGroup->AddTextureL( firstTexture );
+    txtGroup->IsLoadingCompleted();
+    
+    // Unload texture content
+    textureMgr.UnloadTexture( firstTexture.Id() );
+    txtGroup->IsLoadingCompleted();
+    
+    // restore texture content
+    textureMgr.UpdateTextureFromBitmapL( firstTexture.Id() );
+    txtGroup->IsLoadingCompleted();
+    
+    CleanupStack::PopAndDestroy( bmpProvider );
+    CleanupStack::PopAndDestroy( txtGroup );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtGroupObserverMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtGroupObserverMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtGroupObserverMethodsL, "TestTxtGroupObserverMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtGroupObserverMethodsL );
+    // Print to log file
+    iLog->Log( KTestTxtGroupObserverMethodsL );
+    
+    CAlfTextureGroup* txtGroup = CAlfTextureGroup::NewL( *iAlfEnv );
+    CleanupStack::PushL( txtGroup );
+    STIF_ASSERT_NOT_NULL( txtGroup );
+    CTestTextureGroupObserver* testObserver = new ( ELeave ) CTestTextureGroupObserver;
+    CleanupStack::PushL( testObserver );
+    STIF_ASSERT_NOT_NULL( testObserver );
+    
+    txtGroup->AddLoadObserverL( *testObserver );
+    txtGroup->RemoveLoadObserver( *testObserver );
+    
+    txtGroup->RemoveLoadObserver( *testObserver );
+    txtGroup->AddLoadObserverL( *testObserver );
+    txtGroup->RemoveLoadObserver( *testObserver );
+
+    CAlfTextureManager& textureMgr = iAlfEnv->TextureManager();
+    CTestBmpProvider* bmpProvider = new ( ELeave ) CTestBmpProvider;
+    CleanupStack::PushL( bmpProvider );
+    STIF_ASSERT_NOT_NULL( bmpProvider );
+    CAlfTexture& firstTexture = textureMgr.CreateTextureL(
+                    KAlfAutoGeneratedTextureId, bmpProvider, EAlfTextureFlagDefault );
+    
+    // Add one texture that has content
+    txtGroup->AddTextureL( firstTexture );
+    
+    // Unload texture content
+    textureMgr.UnloadTexture( firstTexture.Id() );
+    testObserver->iObservedTexturegroup = NULL;
+    
+    // restore texture content
+    textureMgr.UpdateTextureFromBitmapL( firstTexture.Id() );
+    
+    txtGroup->AddLoadObserverL( *testObserver );
+
+    // Add one texture that has content
+    txtGroup->AddTextureL( firstTexture );
+    
+    // Unload texture content
+    textureMgr.UnloadTexture( firstTexture.Id() );
+    testObserver->iObservedTexturegroup = NULL;
+    
+    // restore texture content
+    textureMgr.UpdateTextureFromBitmapL( firstTexture.Id() );
+    
+    // Unload texture content
+    textureMgr.UnloadTexture( firstTexture.Id() );
+    testObserver->iObservedTexturegroup = NULL;
+    
+    // Disable observing
+    txtGroup->EnableLoadObservers( EFalse );
+    
+    // restore texture content
+    textureMgr.UpdateTextureFromBitmapL( firstTexture.Id() );
+
+    // Unload texture content
+    textureMgr.UnloadTexture( firstTexture.Id() );
+    testObserver->iObservedTexturegroup = NULL;
+    
+    // Enable observing
+    txtGroup->EnableLoadObservers( ETrue );
+
+    // restore texture content
+    textureMgr.UpdateTextureFromBitmapL( firstTexture.Id() );
+
+    txtGroup->RemoveLoadObserver( *testObserver );
+    
+    CleanupStack::PopAndDestroy( bmpProvider );
+    CleanupStack::PopAndDestroy( testObserver );
+    CleanupStack::PopAndDestroy( txtGroup );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstexturemanager.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,435 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alftexturemanager.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alftexturemanager.h>
+#include <alf/alfbitmapprovider.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+_LIT( KEmptyImagePath, "" );
+_LIT( KEmptyImageFileName, "" );
+_LIT( KTestImageFileName, "testfile" );
+
+const TInt KExistingTextureId = 1000;
+
+const TInt KProvidedBitmapWidth = 64;
+const TInt KProvidedBitmapHeight = 64;
+const TInt KTextureMaxWidth = 64;
+const TInt KTextureMaxHeight = 64;
+
+
+// FORWARD DECLARATION
+// class CTestBmpProvider for testing CAlfTextureManager
+class CTestBmpProvider : public CBase, public MAlfBitmapProvider
+    {
+public:
+    /**
+     * Constructor of CTestBmpProvider.
+     * @param aWidth    The width of provided bitmap.
+     * @param aHeight   The height of provided bitmap.
+     */
+    CTestBmpProvider( TInt aWidth, TInt aHeight )
+        {
+        iProvidedBmpSize = TSize( aWidth, aHeight );
+        }
+    
+    /**
+     * From CAlfBitmapProvider
+     */
+    void ProvideBitmapL(TInt /*aId*/, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap)
+        {
+        aBitmap = new ( ELeave ) CFbsBitmap;
+        aMaskBitmap = new ( ELeave ) CFbsBitmap;
+        aBitmap->Create( iProvidedBmpSize, EColor64K );
+        aMaskBitmap->Create( iProvidedBmpSize, EGray256 );
+        }
+    
+private:
+    /**
+     * OWN : The size of provided bitmap.
+     */
+    TSize iProvidedBmpSize;
+    };
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtMgrEnv
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtMgrEnv( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtMgrEnv, "TestTxtMgrEnv" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtMgrEnv );
+    // Print to log file
+    iLog->Log( KTestTxtMgrEnv );
+    
+    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
+    STIF_ASSERT_EQUALS( iAlfEnv, &txtMgr->Env() );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtMgrTextureL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtMgrTextureL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtMgrTextureL, "TestTxtMgrTextureL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtMgrTextureL );
+    // Print to log file
+    iLog->Log( KTestTxtMgrTextureL );
+    
+    CTestBmpProvider* bmpProvider =
+        new ( ELeave ) CTestBmpProvider( KProvidedBitmapWidth, KProvidedBitmapHeight );
+    CleanupStack::PushL( bmpProvider );
+    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
+    CAlfTexture* texture = &txtMgr->CreateTextureL(
+            KExistingTextureId, bmpProvider, EAlfTextureFlagDefault );
+    CleanupStack::PushL( texture );
+    STIF_ASSERT_EQUALS( KExistingTextureId, texture->Id() );
+    
+    const CAlfTexture* texture2 = txtMgr->Texture( KExistingTextureId );
+    STIF_ASSERT_NOT_NULL( texture2 );
+    STIF_ASSERT_EQUALS( KExistingTextureId, texture2->Id() );
+    
+    CAlfTexture* texture3 = txtMgr->TextureL( KExistingTextureId );
+    STIF_ASSERT_NOT_NULL( texture3 );
+    STIF_ASSERT_EQUALS( KExistingTextureId, texture3->Id() );
+    
+    CleanupStack::Pop( texture );
+    CleanupStack::PopAndDestroy( bmpProvider );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtMgrImagePathL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtMgrImagePathL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtMgrImagePathL, "TestTxtMgrImagePathL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtMgrImagePathL );
+    // Print to log file
+    iLog->Log( KTestTxtMgrImagePathL );
+    
+    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
+    txtMgr->SetImagePathL( KEmptyImagePath );
+    const TDesC& path = txtMgr->ImagePath();
+    STIF_ASSERT_TRUE( path == KEmptyImagePath );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtMgrBlankTexture
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtMgrBlankTexture( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtMgrBlankTexture, "TestTxtMgrBlankTexture" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtMgrBlankTexture );
+    // Print to log file
+    iLog->Log( KTestTxtMgrBlankTexture );
+    
+    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
+    const CAlfTexture& texture = ( ( const CAlfTextureManager* ) txtMgr )->BlankTexture();
+    STIF_ASSERT_EQUALS( 0, texture.Id() );
+    
+    CAlfTexture& texture2 = txtMgr->BlankTexture();
+    STIF_ASSERT_EQUALS( 0, texture2.Id() );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtMgrLoadTextureL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtMgrLoadTextureL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtMgrLoadTextureL, "TestTxtMgrLoadTextureL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtMgrLoadTextureL );
+    // Print to log file
+    iLog->Log( KTestTxtMgrLoadTextureL );
+    
+    CTestBmpProvider* bmpProvider =
+        new ( ELeave ) CTestBmpProvider( KProvidedBitmapWidth, KProvidedBitmapHeight );
+    CleanupStack::PushL( bmpProvider );
+    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
+    txtMgr->CreateTextureL( KExistingTextureId, bmpProvider, EAlfTextureFlagDefault );
+    txtMgr->LoadTextureL( KEmptyImageFileName, EAlfTextureFlagDefault, KExistingTextureId );
+    TSize txtMaxSize( KTextureMaxWidth, KTextureMaxHeight );
+    txtMgr->LoadTextureL( KExistingTextureId, txtMaxSize, EAlfTextureFlagDefault );
+    txtMgr->LoadTextureL( KEmptyImageFileName, txtMaxSize, EAlfTextureFlagDefault, KExistingTextureId );
+    txtMgr->LoadAnimatedTextureL(KEmptyImageFileName, txtMaxSize, EAlfTextureFlagDefault, KExistingTextureId );
+    CleanupStack::PopAndDestroy( bmpProvider );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtMgrCreateTextureL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtMgrCreateTextureL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtMgrCreateTextureL, "TestTxtMgrCreateTextureL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtMgrCreateTextureL );
+    // Print to log file
+    iLog->Log( KTestTxtMgrCreateTextureL );
+    
+    CTestBmpProvider* bmpProvider =
+        new ( ELeave ) CTestBmpProvider( KProvidedBitmapWidth, KProvidedBitmapHeight );
+    CleanupStack::PushL( bmpProvider );
+    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
+    CAlfTexture& texture = txtMgr->CreateTextureL( KExistingTextureId,
+                                        bmpProvider, EAlfTextureFlagDefault );
+    STIF_ASSERT_EQUALS( KExistingTextureId, texture.Id() );
+    CleanupStack::PopAndDestroy( bmpProvider );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtMgrUnloadTextureL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtMgrUnloadTextureL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtMgrUnloadTextureL, "TestTxtMgrUnloadTextureL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtMgrUnloadTextureL );
+    // Print to log file
+    iLog->Log( KTestTxtMgrUnloadTextureL );
+    
+    CTestBmpProvider* bmpProvider =
+        new ( ELeave ) CTestBmpProvider( KProvidedBitmapWidth, KProvidedBitmapHeight );
+    CleanupStack::PushL( bmpProvider );
+    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
+    txtMgr->DefineFileNameL( KExistingTextureId, KTestImageFileName );
+    txtMgr->CreateTextureL( KExistingTextureId, bmpProvider, EAlfTextureFlagDefault );
+    txtMgr->UnloadTexture( KTestImageFileName );
+    STIF_ASSERT_FALSE( txtMgr->Texture( KExistingTextureId )->HasContent() );
+    txtMgr->DefineFileNameL( KExistingTextureId, KTestImageFileName );
+    txtMgr->CreateTextureL( KExistingTextureId, bmpProvider, EAlfTextureFlagDefault );
+    txtMgr->UnloadTexture( KExistingTextureId );
+    STIF_ASSERT_FALSE( txtMgr->Texture( KExistingTextureId )->HasContent() );
+    CleanupStack::PopAndDestroy( bmpProvider );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtMgrUpdateTextureL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtMgrUpdateTextureL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtMgrUpdateTextureL, "TestTxtMgrUpdateTextureL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtMgrUpdateTextureL );
+    // Print to log file
+    iLog->Log( KTestTxtMgrUpdateTextureL );
+    
+    CTestBmpProvider* bmpProvider =
+        new ( ELeave ) CTestBmpProvider( KProvidedBitmapWidth, KProvidedBitmapHeight );
+    CleanupStack::PushL( bmpProvider );
+    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
+    txtMgr->DefineFileNameL( KExistingTextureId, KTestImageFileName );
+    txtMgr->UpdateTextureFromFileL( KExistingTextureId, &KEmptyImageFileName );
+    txtMgr->UpdateTextureFromBitmapL( KExistingTextureId, bmpProvider );
+    CleanupStack::PopAndDestroy( bmpProvider );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtMgrDefineFileNameL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtMgrDefineFileNameL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtMgrDefineFileNameL, "TestTxtMgrDefineFileNameL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtMgrDefineFileNameL );
+    // Print to log file
+    iLog->Log( KTestTxtMgrDefineFileNameL );
+    
+    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
+    txtMgr->DefineFileNameL( KExistingTextureId, KEmptyImageFileName );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtMgrPrependImagePath
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtMgrPrependImagePath( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtMgrPrependImagePath, "TestTxtMgrPrependImagePath" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtMgrPrependImagePath );
+    // Print to log file
+    iLog->Log( KTestTxtMgrPrependImagePath );
+    
+    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
+    TFileName fileName( KEmptyImageFileName );
+    txtMgr->PrependImagePath( fileName );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtMgrObserverMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtMgrObserverMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtMgrObserverMethodsL, "TestTxtMgrObserverMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtMgrObserverMethodsL );
+    // Print to log file
+    iLog->Log( KTestTxtMgrObserverMethodsL );
+    
+    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
+    txtMgr->AddLoadObserverL( NULL );
+    txtMgr->AddStateObserverL( NULL );
+    txtMgr->AddAutoSizeObserverL( NULL );
+    txtMgr->RemoveLoadObserver( NULL );
+    txtMgr->RemoveStateObserver( NULL );
+    txtMgr->RemoveAutoSizeObserver( NULL );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtMgrProcessor
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtMgrProcessor( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtMgrProcessor, "TestTxtMgrProcessor" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtMgrProcessor );
+    // Print to log file
+    iLog->Log( KTestTxtMgrProcessor );
+    
+    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
+    txtMgr->Processor();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtMgrSetAutomaticTextureIdRange
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtMgrSetAutomaticTextureIdRange( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtMgrSetAutomaticTextureIdRange, "TestTxtMgrSetAutomaticTextureIdRange" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtMgrSetAutomaticTextureIdRange );
+    // Print to log file
+    iLog->Log( KTestTxtMgrSetAutomaticTextureIdRange );
+    
+    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
+    txtMgr->SetAutomaticTextureIdRange( 1, 2 );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtMgrIsLoadedL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtMgrIsLoadedL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtMgrIsLoadedL, "TestTxtMgrIsLoadedL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtMgrIsLoadedL );
+    // Print to log file
+    iLog->Log( KTestTxtMgrIsLoadedL );
+    
+    CTestBmpProvider* bmpProvider =
+        new ( ELeave ) CTestBmpProvider( KProvidedBitmapWidth, KProvidedBitmapHeight );
+    CleanupStack::PushL( bmpProvider );
+    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
+    txtMgr->CreateTextureL( KExistingTextureId, bmpProvider, EAlfTextureFlagDefault );
+    txtMgr->IsLoaded( KEmptyImageFileName );
+    txtMgr->IsLoaded( KExistingTextureId );
+    txtMgr->IsLoaded( txtMgr->Texture( KExistingTextureId ) );
+    CleanupStack::PopAndDestroy( bmpProvider );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtMgrTextureIdL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtMgrTextureIdL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtMgrTextureIdL, "TestTxtMgrTextureIdL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtMgrTextureIdL );
+    // Print to log file
+    iLog->Log( KTestTxtMgrTextureIdL );
+    
+    CTestBmpProvider* bmpProvider =
+        new ( ELeave ) CTestBmpProvider( KProvidedBitmapWidth, KProvidedBitmapHeight );
+    CleanupStack::PushL( bmpProvider );
+    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
+    txtMgr->CreateTextureL( KExistingTextureId, bmpProvider, EAlfTextureFlagDefault );
+    txtMgr->TextureId( KEmptyImageFileName );
+    CleanupStack::PopAndDestroy( bmpProvider );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstextureprocessor.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alftextureprocessor.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alftextureprocessor.h>
+#include <avkon.mbg>
+
+#include "testplatalfvisual.h"
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtProcessorBlurL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtProcessorBlurL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtProcessorBlurL, "TestTxtProcessorBlurL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtProcessorBlurL );
+    // Print to log file
+    iLog->Log( KTestTxtProcessorBlurL );
+    
+    CAlfTextureManager* txtMgr = &( iAlfEnv->TextureManager() );
+    
+    CAlfImageVisual* imgVisual = CAlfImageVisual::AddNewL( *iAlfCtl );
+    imgVisual->SetScaleMode(CAlfImageVisual::EScaleFitInside);
+    TAlfImage magnifyingGlassImage(
+            KAknsIIDQgnIndiFindGlass,
+            iAlfDisplay->VisibleArea().Size(),
+            EAspectRatioPreserved,
+            &AknIconUtils::AvkonIconFileName(), 
+            EMbmAvkonQgn_indi_find_glass,
+            EMbmAvkonQgn_indi_find_glass_mask,
+            0.f,0.f,1.f,1.f,
+            TAlfTextureFlags( EAlfTextureFlagGenerateShadow | EAlfTextureFlagSkinContent ),
+            2,
+            txtMgr );
+    imgVisual->SetImage( magnifyingGlassImage );
+    
+    CAlfTexture* tex = ( CAlfTexture* ) &( imgVisual->Image().Texture() );
+
+    txtMgr->Processor().BlurL( *tex, *tex );
+    txtMgr->Processor().BlurL( *tex, *tex, iAlfDisplay->VisibleArea().Size() );
+
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstextvisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,510 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alftextvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alftextvisual.h>
+#include <aknsconstants.h>
+#include <alf/alfpropertyowner.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TInt KGeneralNum = 10;
+
+_LIT( KTestTxt, "Test" );
+_LIT( KColorIndex, "0" );
+_LIT( KTextColorTable, "KAknsIIDNone" );
+_LIT8( KTagText, "Caption" );
+
+
+// FORWARD DECLARATION
+// CTestTextVisual for testing protected fuctions of CAlfTextVisual
+class CTestTextVisual : public CAlfTextVisual
+    {
+public:
+    /**
+     * CTestTextVisual for testing protected fuctions of CAlfTextVisual
+     */
+    void TestProtectedFunctionsForTxtVisual()
+        {
+        TBool inFocusChain( EFalse );
+        TAny* pInFocusChain = &inFocusChain;
+        CAlfTextVisual::PropertyOwnerExtension( KUidAlfPropOwnerExtControlFocusChainChanged, &pInFocusChain );
+        CAlfTextVisual::DoRemoveAndDestroyAllD();
+        }
+    };
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualAddNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualAddNewL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualAddNewL, "TestTxtVisualAddNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualAddNewL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualAddNewL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    CleanupStack::Pop( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualConstructorL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualConstructorL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualConstructorL, "TestTxtVisualConstructorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualConstructorL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualConstructorL );
+    
+    CAlfTextVisual* txtVisual = new ( ELeave ) CAlfTextVisual;
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    CleanupStack::PopAndDestroy( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualConstructL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualConstructL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualConstructL, "TestTxtVisualConstructL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualConstructL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualConstructL );
+    
+    CAlfTextVisual* txtVisual = new ( ELeave ) CAlfTextVisual;
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    txtVisual->ConstructL( *iAlfCtl );
+    CleanupStack::PopAndDestroy( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualTxtMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualTxtMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualTxtMethodsL, "TestTxtVisualTxtMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualTxtMethodsL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualTxtMethodsL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    txtVisual->SetTextL( KTestTxt );
+    txtVisual->Text();
+    CleanupStack::Pop( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualStyleMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualStyleMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualStyleMethodsL, "TestTxtVisualStyleMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualStyleMethodsL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualStyleMethodsL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    txtVisual->SetStyle( EAlfTextStyleNormal );
+    STIF_ASSERT_EQUALS( EAlfTextStyleNormal, txtVisual->Style() );
+    txtVisual->SetTextStyle( 1 );
+    STIF_ASSERT_EQUALS( 1, txtVisual->TextStyle() );
+    CleanupStack::Pop( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualSetAlignL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualSetAlignL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualSetAlignL, "TestTxtVisualSetAlignL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualSetAlignL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualSetAlignL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    txtVisual->SetAlign( EAlfAlignHLeft, EAlfAlignVTop );
+    CleanupStack::Pop( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualSetLineSpacingL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualSetLineSpacingL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualSetLineSpacingL, "TestTxtVisualSetLineSpacingL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualSetLineSpacingL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualSetLineSpacingL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    txtVisual->SetLineSpacing( KGeneralNum );
+    CleanupStack::Pop( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualExtentsMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualExtentsMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualExtentsMethodsL, "TestTxtVisualExtentsMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualExtentsMethodsL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualExtentsMethodsL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    txtVisual->TextExtents();
+    txtVisual->SubstringExtents( 1, 2 );
+    CleanupStack::Pop( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualMaxLineCountMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualMaxLineCountMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualMaxLineCountMethodsL, "TestTxtVisualMaxLineCountMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualMaxLineCountMethodsL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualMaxLineCountMethodsL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    txtVisual->SetMaxLineCount( KGeneralNum );
+    STIF_ASSERT_EQUALS( KGeneralNum, txtVisual->MaxLineCount() );
+    CleanupStack::Pop( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualWrappingMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualWrappingMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualWrappingMethodsL, "TestTxtVisualWrappingMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualWrappingMethodsL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualWrappingMethodsL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    txtVisual->SetWrapping( CAlfTextVisual::ELineWrapManual );
+    STIF_ASSERT_EQUALS( CAlfTextVisual::ELineWrapManual, txtVisual->Wrapping() );
+    CleanupStack::Pop( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualBackgroundTypeL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualBackgroundTypeL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualBackgroundTypeL, "TestTxtVisualBackgroundTypeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualBackgroundTypeL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualBackgroundTypeL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    txtVisual->BackgroundType();
+    CleanupStack::Pop( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualShadowOpacityMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualShadowOpacityMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualShadowOpacityMethodsL, "TestTxtVisualShadowOpacityMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualShadowOpacityMethodsL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualShadowOpacityMethodsL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    TAlfTimedValue opacity;
+    txtVisual->SetShadowOpacity( opacity );
+    txtVisual->ShadowOpacity();
+    CleanupStack::Pop( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualColorMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualColorMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualColorMethodsL, "TestTxtVisualColorMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualColorMethodsL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualColorMethodsL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    txtVisual->SetColor( KRgbDarkGray );
+    txtVisual->SetColor( KAknsIIDNone, 0 );
+    txtVisual->SetColor( KTextColorTable, KColorIndex );
+    CleanupStack::Pop( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualEnableShadowL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualEnableShadowL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualEnableShadowL, "TestTxtVisualEnableShadowL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualEnableShadowL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualEnableShadowL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    txtVisual->EnableShadow( ETrue );
+    CleanupStack::Pop( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualOffsetMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualOffsetMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualOffsetMethodsL, "TestTxtVisualOffsetMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualOffsetMethodsL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualOffsetMethodsL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    TAlfTimedPoint offset;
+    txtVisual->SetOffset( offset );
+    txtVisual->Offset();
+    CleanupStack::Pop( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualRemoveAndDestroyAllDL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualRemoveAndDestroyAllDL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualRemoveAndDestroyAllDL, "TestTxtVisualRemoveAndDestroyAllDL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualRemoveAndDestroyAllDL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualRemoveAndDestroyAllDL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    txtVisual->RemoveAndDestroyAllD();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualUpdateChildrenLayoutL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualUpdateChildrenLayoutL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualUpdateChildrenLayoutL, "TestTxtVisualUpdateChildrenLayoutL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualUpdateChildrenLayoutL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualUpdateChildrenLayoutL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    txtVisual->UpdateChildrenLayout();
+    CleanupStack::Pop( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualFindTagL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualFindTagL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualFindTagL, "TestTxtVisualFindTagL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualFindTagL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualFindTagL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    txtVisual->FindTag( KTagText );
+    CleanupStack::Pop( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualSetHighlightRangeL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualSetHighlightRangeL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualSetHighlightRangeL, "TestTxtVisualSetHighlightRangeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualSetHighlightRangeL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualSetHighlightRangeL );
+    
+    CAlfTextVisual* txtVisual = CAlfTextVisual::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( txtVisual );
+    STIF_ASSERT_NOT_NULL( txtVisual );
+    TRgb yellow = KRgbYellow;
+    TRgb red = KRgbDarkRed;
+    txtVisual->SetTextL( KTestTxt );
+    txtVisual->SetHighlightRange( 0, 1, yellow, red );
+    CleanupStack::Pop( txtVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTxtVisualProtectedMethodsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTxtVisualProtectedMethodsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTxtVisualProtectedMethodsL, "TestTxtVisualProtectedMethodsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTxtVisualProtectedMethodsL );
+    // Print to log file
+    iLog->Log( KTestTxtVisualProtectedMethodsL );
+    
+    CTestTextVisual *testVisual = new ( ELeave ) CTestTextVisual;
+    CleanupStack::PushL( testVisual );
+    STIF_ASSERT_NOT_NULL( testVisual );
+    testVisual->ConstructL( *iAlfCtl );
+    testVisual->TestProtectedFunctionsForTxtVisual();
+    CleanupStack::Pop( testVisual );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstimedvalue.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,358 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alftimedvalue.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alftimedvalue.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TInt KGeneralNum = 100;
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTimedValueConstructor
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTimedValueConstructor( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTimedValueConstructor, "TestTimedValueConstructor" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTimedValueConstructor );
+    // Print to log file
+    iLog->Log( KTestTimedValueConstructor );
+    
+    TAlfTimedValue value1;
+    TAlfTimedValue value2( 1.0 );
+    TAlfTimedValue value3( 1.0, 1 );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTimedValueValueNow
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTimedValueValueNow( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTimedValueValueNow, "TestTimedValueValueNow" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTimedValueValueNow );
+    // Print to log file
+    iLog->Log( KTestTimedValueValueNow );
+    
+    TAlfTimedValue value;
+    value.SetValueNow( 1.0 );
+    STIF_ASSERT_EQUALS( TReal32( 1.0 ), value.ValueNow() );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTimedValueTargetAndSpeed
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTimedValueTargetAndSpeed( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTimedValueTargetAndSpeed, "TestTimedValueTargetAndSpeed" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTimedValueTargetAndSpeed );
+    // Print to log file
+    iLog->Log( KTestTimedValueTargetAndSpeed );
+    
+    TAlfTimedValue value;
+    value.SetTarget( 1.0, KGeneralNum );
+    STIF_ASSERT_EQUALS( TReal32( 1.0 ), value.Target() );
+    value.SetTargetWithSpeed( 1.0, 2.0 );
+    STIF_ASSERT_EQUALS( TReal32( 1.0 ), value.Target() );
+    STIF_ASSERT_EQUALS( TReal32( 2.0 ), value.Speed() );
+    value.TimeToTargetinMilliSeconds();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTimedValueStyle
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTimedValueStyle( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTimedValueStyle, "TestTimedValueStyle" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTimedValueStyle );
+    // Print to log file
+    iLog->Log( KTestTimedValueStyle );
+    
+    TAlfTimedValue value;
+    value.SetStyle( EAlfTimedValueStyleUseSystemDefault );
+    STIF_ASSERT_EQUALS( EAlfTimedValueStyleUseSystemDefault, value.Style() );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTimedValueMappingFunctionIdentifier
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTimedValueMappingFunctionIdentifier( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTimedValueMappingFunctionIdentifier, "TestTimedValueMappingFunctionIdentifier" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTimedValueMappingFunctionIdentifier );
+    // Print to log file
+    iLog->Log( KTestTimedValueMappingFunctionIdentifier );
+    
+    TAlfTimedValue value;
+    value.SetMappingFunctionIdentifier( 1 );
+    STIF_ASSERT_EQUALS( 1, value.MappingFunctionIdentifier() );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTimedValueFlags
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTimedValueFlags( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTimedValueFlags, "TestTimedValueFlags" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTimedValueFlags );
+    // Print to log file
+    iLog->Log( KTestTimedValueFlags );
+    
+    TAlfTimedValue value;
+    value.Flags();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestRealPointMethods
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestRealPointMethods( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestRealPointMethods, "TestRealPointMethods" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestRealPointMethods );
+    // Print to log file
+    iLog->Log( KTestRealPointMethods );
+    
+    TAlfRealPoint realPoint1( 1.0, 2.0 );
+    TAlfRealPoint realPoint2( 0.0, 1.0 );
+    
+    TPoint point;
+    point += realPoint1;
+    
+    realPoint1.AsSize();
+    
+    TAlfRealPoint realPoint3 = realPoint1 - realPoint2;
+    TAlfRealPoint realPoint4 = realPoint2 + realPoint3;
+    realPoint4 += realPoint3;
+    realPoint4 -= realPoint3;
+    TBool value = realPoint1 == realPoint4;
+    STIF_ASSERT_TRUE( value );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestRealSizeMethods
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestRealSizeMethods( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestRealSizeMethods, "TestRealSizeMethods" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestRealSizeMethods );
+    // Print to log file
+    iLog->Log( KTestRealSizeMethods );
+    
+    TAlfRealSize realSize1( 2.0, 2.0 );
+    
+    TSize size( 2, 2 );
+    TAlfRealSize realSize2( size );
+    
+    TAlfRealPoint realPoint( 2.0, 2.0 );
+    TAlfRealSize realSize3( realPoint );
+    
+    TSize size2;
+    size2 += realSize1;
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestRealRectMethods
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestRealRectMethods( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestRealRectMethods, "TestRealRectMethods" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestRealRectMethods );
+    // Print to log file
+    iLog->Log( KTestRealRectMethods );
+    
+    TAlfRealRect realRect;
+    
+    TRect rect;
+    rect == realRect; //operator TRect() const
+    
+    realRect.Width(); //TReal32 Width() const
+    realRect.Height(); //TReal32 Height() const
+    realRect.TopRight(); //TAlfRealPoint TopRight() const
+    realRect.BottomLeft(); //TAlfRealPoint BottomLeft() const
+    realRect.Size(); //TAlfRealSize Size() const
+    realRect.Center(); //TAlfRealPoint Center() const
+    realRect.Grow( 1.0, 1.0 ); //void Grow(TReal32 aX, TReal32 aY)
+    realRect.Shrink( 1.0, 1.0 ); //void Shrink(TReal32 aX, TReal32 aY)
+    
+    TPoint point( 1, 1 );
+    realRect.Shrink( point ); //void Shrink(const TPoint& aPoint)
+    
+    TAlfRealPoint realPoint( 1.0, 1.0 );
+    realRect.Shrink( realPoint ); //void Shrink(const TAlfRealPoint& aPoint)
+    
+    realRect.Shrink( realRect ); //void Shrink(const TAlfRealRect& aRect)
+    realRect.Move( 1.0, 1.0 ); //void Move(TReal32 aDx, TReal32 aDy)
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTimedPointConstructor
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTimedPointConstructor( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTimedPointConstructor, "TestTimedPointConstructor" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTimedPointConstructor );
+    // Print to log file
+    iLog->Log( KTestTimedPointConstructor );
+    
+    TAlfTimedPoint point1;
+    TAlfTimedPoint point2( 1.0, 1.0 );
+    TAlfTimedPoint point3( 1.0, 1.0, KGeneralNum );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTimedPointSetStyle
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTimedPointSetStyle( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTimedPointSetStyle, "TestTimedPointSetStyle" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTimedPointSetStyle );
+    // Print to log file
+    iLog->Log( KTestTimedPointSetStyle );
+    
+    TAlfTimedPoint point;
+    point.SetStyle( EAlfTimedValueStyleUseSystemDefault );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTimedPointSetMapFuncIdentifier
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTimedPointSetMapFuncIdentifier( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTimedPointSetMapFuncIdentifier, "TestTimedPointSetMapFuncIdentifier" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTimedPointSetMapFuncIdentifier );
+    // Print to log file
+    iLog->Log( KTestTimedPointSetMapFuncIdentifier );
+    
+    TAlfTimedPoint point;
+    point.SetMappingFunctionIdentifier( 1 );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTimedPointTargetMethods
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTimedPointTargetMethods( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTimedPointTargetMethods, "TestTimedPointTargetMethods" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTimedPointTargetMethods );
+    // Print to log file
+    iLog->Log( KTestTimedPointTargetMethods );
+    
+    TAlfTimedPoint point;
+    TAlfRealPoint realPoint( 1.0, 1.0 );
+    point.SetTarget( realPoint, KGeneralNum );
+    point.SetTarget( 1.0, KGeneralNum );
+    point.SetTargetWithSpeed( realPoint, KGeneralNum );
+    point.SetTargetWithSpeed( 1.0, KGeneralNum );
+    point.Target();
+    point.TimeToTargetinMilliSeconds();
+    point.IntTarget();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTimedPointValueNowMethods
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTimedPointValueNowMethods( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTimedPointValueNowMethods, "TestTimedPointValueNowMethods" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTimedPointValueNowMethods );
+    // Print to log file
+    iLog->Log( KTestTimedPointValueNowMethods );
+    
+    TAlfTimedPoint point;
+    point.ValueNow();
+    point.IntValueNow();
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblockstransformation.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,250 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alftransformation.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alftransformation.h>
+
+#include "testplatalfvisual.h"
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTransNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTransNewL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTransNewL, "TestTransNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransNewL );
+    // Print to log file
+    iLog->Log( KTestTransNewL );
+    
+    CAlfTransformation* alfTrans = CAlfTransformation::NewL( *iAlfEnv );
+    CleanupStack::PushL( alfTrans );
+    STIF_ASSERT_NOT_NULL( alfTrans );
+    CleanupStack::PopAndDestroy( alfTrans );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTransNewLCL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTransNewLCL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTransNewLCL, "TestTransNewLCL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransNewLCL );
+    // Print to log file
+    iLog->Log( KTestTransNewLCL );
+    
+    CAlfTransformation* alfTrans = CAlfTransformation::NewLC( *iAlfEnv );
+    STIF_ASSERT_NOT_NULL( alfTrans );
+    CleanupStack::PopAndDestroy( alfTrans );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTransCountL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTransCountL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTransCountL, "TestTransCountL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransCountL );
+    // Print to log file
+    iLog->Log( KTestTransCountL );
+    
+    iAlfCtrlGroup->EnableTransformationL();
+    CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
+    alfTrans.Count();
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTransNonIdentityCountL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTransNonIdentityCountL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTransNonIdentityCountL, "TestTransNonIdentityCountL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransNonIdentityCountL );
+    // Print to log file
+    iLog->Log( KTestTransNonIdentityCountL );
+    
+    iAlfCtrlGroup->EnableTransformationL();
+    CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
+    alfTrans.NonIdentityCount();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTransStepL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTransStepL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTransStepL, "TestTransStepL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransStepL );
+    // Print to log file
+    iLog->Log( KTestTransStepL );
+    
+    iAlfCtrlGroup->EnableTransformationL();
+    CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
+    alfTrans.Rotate( 0, 0, 1, 0 );
+    alfTrans.Rotate( 0, 1, 0, 0 );
+    alfTrans.Step( 1 );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTransReplaceStepL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTransReplaceStepL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTransReplaceStepL, "TestTransReplaceStepL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransReplaceStepL );
+    // Print to log file
+    iLog->Log( KTestTransReplaceStepL );
+    
+    iAlfCtrlGroup->EnableTransformationL();
+    CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
+    alfTrans.Rotate( 0, 0, 1, 0 );
+    alfTrans.Rotate( 0, 1, 0, 0 );
+    CAlfTransformation::TTransform transStep = alfTrans.Step( 1 );;
+    alfTrans.ReplaceStep( 1, transStep );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTransLoadIdentityL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTransLoadIdentityL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTransLoadIdentityL, "TestTransLoadIdentityL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransLoadIdentityL );
+    // Print to log file
+    iLog->Log( KTestTransLoadIdentityL );
+    
+    iAlfCtrlGroup->EnableTransformationL();
+    CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
+    alfTrans.LoadIdentity();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTransTranslateL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTransTranslateL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTransTranslateL, "TestTransTranslateL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransTranslateL );
+    // Print to log file
+    iLog->Log( KTestTransTranslateL );
+    
+    iAlfCtrlGroup->EnableTransformationL();
+    CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
+    
+    alfTrans.Translate( 1.0, 1.0 );
+    TAlfTimedValue x, y;
+    alfTrans.Translate( x, y );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTransScaleL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTransScaleL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTransScaleL, "TestTransScaleL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransScaleL );
+    // Print to log file
+    iLog->Log( KTestTransScaleL );
+    
+    iAlfCtrlGroup->EnableTransformationL();
+    CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
+    
+    alfTrans.Scale( 1.0, 2.0 );
+    TAlfTimedValue x, y;
+    alfTrans.Scale( x, y );
+    alfTrans.Scale( 1.0, 2.0, 3.0 );
+    TAlfTimedValue z;
+    alfTrans.Scale( x, y, z );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestTransRotateL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestTransRotateL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestTransRotateL, "TestTransRotateL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestTransRotateL );
+    // Print to log file
+    iLog->Log( KTestTransRotateL );
+    
+    iAlfCtrlGroup->EnableTransformationL();
+    CAlfTransformation& alfTrans = iAlfCtrlGroup->Transformation();
+    
+    TAlfTimedValue angle;
+    alfTrans.Rotate( 1.0 );
+    alfTrans.Rotate( angle );
+    alfTrans.Rotate( 1.0, 2.0, 3.0, 4.0 );
+    alfTrans.Rotate( angle, 1.0, 2.0, 3.0 );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksutil.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,679 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfutil.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alfutil.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TInt KArrayLen = 3;
+const TInt KLightPosArrayLen = 4;
+const TInt KDestMatArrayLen = 16;
+
+const TInt KGeneralNum = 256;
+
+const TInt KComponentsNum = 4;
+
+const TInt KRed = 16; // red
+const TInt KGreen = 24; // green
+const TInt KBlue = 32; // blue
+const TInt KAlpha = 255; // alpha
+
+const TInt KScreenW = 320;
+const TInt KScreenH = 200;
+const TInt KGeneralSize = 16;
+const TInt KScrBufSizeW = 160;
+const TInt KScrBufSizeH = 100;
+
+const TInt KSrcBufLen1 = KComponentsNum * KScreenW * KScreenH;
+const TInt KSrcBufLen2 = KComponentsNum * KScrBufSizeW * KScrBufSizeH;
+const TInt KDesBufLen = KComponentsNum * KGeneralSize * KGeneralSize;
+
+const TInt KTempSrcNum1 = KGeneralSize * KScrBufSizeW * KComponentsNum;
+const TInt KTempSrcNum2 = 2 * KGeneralSize * KScrBufSizeW * KComponentsNum;
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilPower2
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilPower2( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilPower2, "TestUtilPower2" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilPower2 );
+    // Print to log file
+    iLog->Log( KTestUtilPower2 );
+    
+    AlfUtil::Power2( 1 );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilPower2RoundDown
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilPower2RoundDown( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilPower2RoundDown, "TestUtilPower2RoundDown" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilPower2RoundDown );
+    // Print to log file
+    iLog->Log( KTestUtilPower2RoundDown );
+    
+    AlfUtil::Power2RoundDown( 1 );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilInterpolate
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilInterpolate( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilInterpolate, "TestUtilInterpolate" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilInterpolate );
+    // Print to log file
+    iLog->Log( KTestUtilInterpolate );
+    
+    AlfUtil::Interpolate( 1.0, 1.0, 2.0 );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilWrapValue
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilWrapValue( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilWrapValue, "TestUtilWrapValue" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilWrapValue );
+    // Print to log file
+    iLog->Log( KTestUtilWrapValue );
+    
+    TReal32 value = 0.0;
+    AlfUtil::WrapValue( value, 1.0, 1.0 );//aHigh - aLow <= 0
+    AlfUtil::WrapValue( value, 1.0, 2.0 );//aHigh - aLow > 0 && aValue < aLow
+    value = 2.0;
+    AlfUtil::WrapValue( value, 1.0, 2.0 );//aHigh - aLow > 0 && aValue >= aHigh
+    value = 1.0;
+    AlfUtil::WrapValue( value, 1.0, 2.0 );//aHigh - aLow > 0 && aValue >= aLow && aValue < aHigh
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilRandomInt
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilRandomInt( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilRandomInt, "TestUtilRandomInt" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilRandomInt );
+    // Print to log file
+    iLog->Log( KTestUtilRandomInt );
+    
+    AlfUtil::RandomInt( 1, 2 );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilRandomReal
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilRandomReal( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilRandomReal, "TestUtilRandomReal" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilRandomReal );
+    // Print to log file
+    iLog->Log( KTestUtilRandomReal );
+    
+    AlfUtil::RandomReal( 1.0, 3.0 );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilQuickLengthWithPoint
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilQuickLengthWithPoint( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilQuickLengthWithPoint, "TestUtilQuickLengthWithPoint" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilQuickLengthWithPoint );
+    // Print to log file
+    iLog->Log( KTestUtilQuickLengthWithPoint );
+    
+    TAlfRealPoint vector( 0.f, 1.f );
+    AlfUtil::QuickLength( vector );//Abs( aVector.iX ) < Abs( aVector.iY )
+    vector.iX = 2.0;
+    AlfUtil::QuickLength( vector );//Abs( aVector.iX ) >= Abs( aVector.iY )
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilQuickLength
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilQuickLength( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilQuickLength, "TestUtilQuickLength" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilQuickLength );
+    // Print to log file
+    iLog->Log( KTestUtilQuickLength );
+    
+    AlfUtil::QuickLength( 1.0, 2.0 );//Abs( aDx ) < Abs( aDy )
+    AlfUtil::QuickLength( 2.0, 1.0 );//Abs( aDx ) >= Abs( aDy )
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilQuickNormalize
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilQuickNormalize( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilQuickNormalize, "TestUtilQuickNormalize" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilQuickNormalize );
+    // Print to log file
+    iLog->Log( KTestUtilQuickNormalize );
+    
+    TAlfRealPoint normal;
+    AlfUtil::QuickNormalize( normal );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilQuickNormalizeWithVector
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilQuickNormalizeWithVector( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilQuickNormalizeWithVector, "TestUtilQuickNormalizeWithVector" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilQuickNormalizeWithVector );
+    // Print to log file
+    iLog->Log( KTestUtilQuickNormalizeWithVector );
+    
+    TReal32 vector[3] = { 1.0, 2.0, 3.0 };
+    AlfUtil::QuickNormalize( vector );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilCrossProduct
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilCrossProduct( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilCrossProduct, "TestUtilCrossProduct" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilCrossProduct );
+    // Print to log file
+    iLog->Log( KTestUtilCrossProduct );
+    
+    TReal32 vectorA[ KArrayLen ] = { 1.0, 2.0, 3.0 };
+    TReal32 vectorB[ KArrayLen ] = { 1.0, 2.0, 3.0 };
+    TReal32 product[ KArrayLen ];
+    AlfUtil::CrossProduct( vectorA, vectorB, product );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilNormalFromPoints
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilNormalFromPoints( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilNormalFromPoints, "TestUtilNormalFromPoints" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilNormalFromPoints );
+    // Print to log file
+    iLog->Log( KTestUtilNormalFromPoints );
+    
+    TReal32 points[ KArrayLen ][ KArrayLen ] =
+        { 
+        { 1.0, 2.0, 3.0 },
+        { 1.0, 2.0, 3.0 },
+        { 1.0, 2.0, 3.0 }
+        };
+    TReal32 normal[ KArrayLen ];
+    
+    AlfUtil::NormalFromPoints( points, normal );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilShadowMatrix
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilShadowMatrix( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilShadowMatrix, "TestUtilShadowMatrix" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilShadowMatrix );
+    // Print to log file
+    iLog->Log( KTestUtilShadowMatrix );
+    
+    TReal32 planePoint[ KArrayLen ] = { 1.0, 2.0, 3.0 };
+    TReal32 planeNormal[ KArrayLen ] = { 1.0, 2.0, 3.0 };
+    TReal32 lightPos[ KLightPosArrayLen ] = { 1.0, 2.0, 3.0, 4.0 };
+    TReal32 destMat[ KDestMatArrayLen ];
+    
+    AlfUtil::ShadowMatrix( planePoint, planeNormal, lightPos, destMat );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilFreeMemory
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilFreeMemory( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilFreeMemory, "TestUtilFreeMemory" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilFreeMemory );
+    // Print to log file
+    iLog->Log( KTestUtilFreeMemory );
+    
+    TUint totalMemo;
+    AlfUtil::FreeMemory( &totalMemo );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilScreenSize
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilScreenSize( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilScreenSize, "TestUtilScreenSize" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilScreenSize );
+    // Print to log file
+    iLog->Log( KTestUtilScreenSize );
+    
+    AlfUtil::ScreenSize();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilNearestFontInTwipsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilNearestFontInTwipsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilNearestFontInTwipsL, "TestUtilNearestFontInTwipsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilNearestFontInTwipsL );
+    // Print to log file
+    iLog->Log( KTestUtilNearestFontInTwipsL );
+    
+    TFontSpec fontSpec;
+    AlfUtil::NearestFontInTwipsL( fontSpec );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilReleaseFont
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilReleaseFont( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilReleaseFont, "TestUtilReleaseFont" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilReleaseFont );
+    // Print to log file
+    iLog->Log( KTestUtilReleaseFont );
+
+    CFont* font = NULL;
+    AlfUtil::ReleaseFont( font );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilLengthUnit
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilLengthUnit( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilLengthUnit, "TestUtilLengthUnit" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilLengthUnit );
+    // Print to log file
+    iLog->Log( KTestUtilLengthUnit );
+
+    AlfUtil::LengthUnit();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilColorLightness
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilColorLightness( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilColorLightness, "TestUtilColorLightness" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilColorLightness );
+    // Print to log file
+    iLog->Log( KTestUtilColorLightness );
+
+    TRgb color;
+    AlfUtil::ColorLightness( color );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilScaleFbsBitmapL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilScaleFbsBitmapL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilScaleFbsBitmapL, "TestUtilScaleFbsBitmapL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilScaleFbsBitmapL );
+    // Print to log file
+    iLog->Log( KTestUtilScaleFbsBitmapL );
+
+    TSize sizeInPixels = TSize( KGeneralNum, KGeneralNum );
+    CFbsBitmap *srcBmp = new ( ELeave ) CFbsBitmap();
+    CleanupStack::PushL( srcBmp );
+    User::LeaveIfError( srcBmp->Create( sizeInPixels, EColor16M ) );
+    CFbsBitmap *scaledBmp = new ( ELeave ) CFbsBitmap();
+    CleanupStack::PushL( scaledBmp );
+    User::LeaveIfError( scaledBmp->Create( sizeInPixels, EColor16MA ) );
+    AlfUtil::ScaleFbsBitmapL( *srcBmp, *scaledBmp );
+    CleanupStack::PopAndDestroy( scaledBmp );
+    CleanupStack::PopAndDestroy( srcBmp );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilCombineMaskFbsBitmapL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilCombineMaskFbsBitmapL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilCombineMaskFbsBitmapL, "TestUtilCombineMaskFbsBitmapL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilCombineMaskFbsBitmapL );
+    // Print to log file
+    iLog->Log( KTestUtilCombineMaskFbsBitmapL );
+
+    TSize sizeInPixels = TSize( KGeneralNum, KGeneralNum );
+    CFbsBitmap *srcBmp = new ( ELeave ) CFbsBitmap();
+    CleanupStack::PushL( srcBmp );
+    User::LeaveIfError( srcBmp->Create( sizeInPixels, EColor16M ) );
+    CFbsBitmap *srcMaskBmp = new ( ELeave ) CFbsBitmap();
+    CleanupStack::PushL( srcMaskBmp );
+    User::LeaveIfError( srcMaskBmp->Create( sizeInPixels, EGray2 ) );
+    CFbsBitmap *combinedBmp = new ( ELeave ) CFbsBitmap;
+    CleanupStack::PushL( combinedBmp );
+    User::LeaveIfError( combinedBmp->Create( sizeInPixels, EColor16MA ) );
+    
+    AlfUtil::CombineMaskFbsBitmapL( *srcBmp, *srcMaskBmp, *combinedBmp );
+    CleanupStack::PopAndDestroy( combinedBmp );
+    CleanupStack::PopAndDestroy( srcMaskBmp );
+    CleanupStack::PopAndDestroy( srcBmp );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilCropFbsBitmapL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilCropFbsBitmapL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilCropFbsBitmapL, "TestUtilCropFbsBitmapL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilCropFbsBitmapL );
+    // Print to log file
+    iLog->Log( KTestUtilCropFbsBitmapL );
+
+    TSize sizeInPixels = TSize( KGeneralNum, KGeneralNum );
+    CFbsBitmap *srcBmp = new ( ELeave ) CFbsBitmap();
+    CleanupStack::PushL( srcBmp );
+    User::LeaveIfError( srcBmp->Create( sizeInPixels, EColor16M ) );
+    CFbsBitmap *cropedBmp = new ( ELeave ) CFbsBitmap();
+    CleanupStack::PushL( cropedBmp );
+    User::LeaveIfError( cropedBmp->Create( sizeInPixels, EGray2 ) );
+    TPoint cropPos;
+    AlfUtil::CropFbsBitmapL( *srcBmp, *cropedBmp, cropPos );
+    CleanupStack::PopAndDestroy( cropedBmp );
+    CleanupStack::PopAndDestroy( srcBmp );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilScaleImageL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilScaleImageL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilScaleImageL, "TestUtilScaleImageL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilScaleImageL );
+    // Print to log file
+    iLog->Log( KTestUtilScaleImageL );
+
+    TUint8* srcBuf = new TUint8[ KSrcBufLen1 ];
+    STIF_ASSERT_NOT_NULL( srcBuf );
+    CleanupStack::PushL( srcBuf );
+    // fill with
+    for ( TInt t = 0; t < KSrcBufLen1; )
+        {
+        srcBuf[t++] = KRed; // red
+        srcBuf[t++] = KGreen; // green
+        srcBuf[t++] = KBlue; // blue
+        srcBuf[t++] = KAlpha; // alpha
+        }
+
+    // try to allocate dummy image buffer for 320x200 image
+    TUint8* desBuf = new TUint8[ KDesBufLen ];
+    STIF_ASSERT_NOT_NULL( desBuf );
+    CleanupStack::PushL( desBuf );
+    // fill with zero pixels
+    for ( TInt t = 0; t < KDesBufLen; t++ )
+        {
+        desBuf[t] = 0;
+        }
+    TSize srcSize = TSize( KScreenW, KScreenH );
+    TSize desSize = TSize( KGeneralSize, KGeneralSize );
+    AlfUtil::ScaleImage( KComponentsNum, srcSize, srcBuf, desSize, desBuf );
+    CleanupStack::PopAndDestroy( desBuf );
+    CleanupStack::PopAndDestroy( srcBuf );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilCropImageL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilCropImageL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilCropImageL, "TestUtilCropImageL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilCropImageL );
+    // Print to log file
+    iLog->Log( KTestUtilCropImageL );
+
+    TUint8* srcBuf = new TUint8[ KSrcBufLen2 ];
+    STIF_ASSERT_NOT_NULL( srcBuf );
+    CleanupStack::PushL( srcBuf );
+    // fill with
+    for ( TInt t = 0; t < KSrcBufLen2; )
+        {
+        // fill the target crop area a bit differently
+        if ( ( t >= KTempSrcNum1 ) && ( t <= KTempSrcNum2 ) )
+            {
+            srcBuf[t++] = KRed; // red
+            srcBuf[t++] = KGreen; // green
+            srcBuf[t++] = KBlue; // blue
+            srcBuf[t++] = KAlpha; // alpha
+            }
+        else
+            {
+            srcBuf[t++] = 1; // red
+            srcBuf[t++] = 1; // green
+            srcBuf[t++] = 1; // blue
+            srcBuf[t++] = 1; // alpha
+            }
+    }
+
+    // try to allocate dummy image buffer for 160x100 image
+    TUint8* desBuf = new TUint8[ KDesBufLen ];
+    STIF_ASSERT_NOT_NULL( desBuf );
+    CleanupStack::PushL( desBuf );
+    // fill with zero pixels
+    for (TInt t = 0; t< KDesBufLen; t++)
+        {
+        desBuf[t] = 0;
+        }
+    TSize srcBufSize = TSize( KScrBufSizeW, KScrBufSizeH );
+    TPoint cropOffset = TPoint( 0, KGeneralSize );
+    TSize croppedSize = TSize( KGeneralSize, KGeneralSize );
+    AlfUtil::CropImage( KComponentsNum, srcBufSize, srcBuf, cropOffset, croppedSize, desBuf );
+    CleanupStack::PopAndDestroy( desBuf );
+    CleanupStack::PopAndDestroy( srcBuf );
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilTagMatches
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilTagMatches( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilTagMatches, "TestUtilTagMatches" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilTagMatches );
+    // Print to log file
+    iLog->Log( KTestUtilTagMatches );
+
+    _LIT8( KTagTxt, "Caption" );
+    _LIT8( KTagsColonSeparatedTxt, "Test:Caption" );
+    AlfUtil::TagMatches( KTagsColonSeparatedTxt, KTagTxt );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilConvertBitmapToDisplayModeLCL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilConvertBitmapToDisplayModeLCL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilConvertBitmapToDisplayModeLCL, "TestUtilConvertBitmapToDisplayModeLCL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilConvertBitmapToDisplayModeLCL );
+    // Print to log file
+    iLog->Log( KTestUtilConvertBitmapToDisplayModeLCL );
+
+    TSize sizeInPixels = TSize( KGeneralNum, KGeneralNum );
+    CFbsBitmap *srcBmp = new ( ELeave ) CFbsBitmap();
+    CleanupStack::PushL( srcBmp );
+    User::LeaveIfError( srcBmp->Create( sizeInPixels, EColor16M ) );
+    CFbsBitmap* desBmp = AlfUtil::ConvertBitmapToDisplayModeLC( *srcBmp, EGray2 );
+    CleanupStack::PopAndDestroy( desBmp );
+    CleanupStack::PopAndDestroy( srcBmp );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestUtilThemeItemIdL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestUtilThemeItemIdL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestUtilThemeItemIdL, "TestUtilThemeItemIdL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestUtilThemeItemIdL );
+    // Print to log file
+    iLog->Log( KTestUtilThemeItemIdL );
+
+    _LIT( KTxtNone, "None" );
+    AlfUtil::ThemeItemIdL( *iAlfEnv, KTxtNone );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksviewportlayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,326 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfviewportlayout.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alfviewportlayout.h>
+#include <alf/alfpropertyowner.h>
+
+#include "testplatalfvisual.h"
+
+
+// Forward Declaration
+// class CTestAlfViewportLayout for testing CAlfViewportLayout
+class CTestAlfViewportLayout : public CAlfViewportLayout
+    {
+public:
+    // constructor
+    CTestAlfViewportLayout() {}
+    
+    // ConstructL
+    void ConstructL( CAlfControl& aOwner )
+        {
+        CAlfViewportLayout::ConstructL( aOwner );
+        }
+    
+    // From CAlfViewportLayout
+    void DoRemoveAndDestroyAllD()
+        {
+        CAlfViewportLayout::DoRemoveAndDestroyAllD();
+        }
+    
+    // From CAlfViewportLayout
+    void PropertyOwnerExtension( const TUid& aExtensionUid, TAny** aExtensionParams )
+        {
+        CAlfViewportLayout::PropertyOwnerExtension( aExtensionUid, aExtensionParams );
+        }
+    };
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestVpLayoutAddNewL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestVpLayoutAddNewL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestVpLayoutAddNewL, "TestVpLayoutAddNewL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestVpLayoutAddNewL );
+    // Print to log file
+    iLog->Log( KTestVpLayoutAddNewL );
+    
+    CAlfViewportLayout* layout = CAlfViewportLayout::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( layout );
+    STIF_ASSERT_NOT_NULL( layout );
+    CleanupStack::Pop( layout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestVpLayoutConstructorL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestVpLayoutConstructorL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestVpLayoutConstructorL, "TestVpLayoutConstructorL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestVpLayoutConstructorL );
+    // Print to log file
+    iLog->Log( KTestVpLayoutConstructorL );
+    
+    CAlfViewportLayout* layout = new ( ELeave ) CAlfViewportLayout();
+    CleanupStack::PushL( layout );
+    STIF_ASSERT_NOT_NULL( layout );
+    CleanupStack::PopAndDestroy( layout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestVpLayoutConstructL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestVpLayoutConstructL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestVpLayoutConstructL, "TestVpLayoutConstructL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestVpLayoutConstructL );
+    // Print to log file
+    iLog->Log( KTestVpLayoutConstructL );
+    
+    CAlfViewportLayout* layout = new ( ELeave ) CAlfViewportLayout();
+    CleanupStack::PushL( layout );
+    STIF_ASSERT_NOT_NULL( layout );
+    layout->ConstructL( *iAlfCtl );
+    CleanupStack::PopAndDestroy( layout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestVpLayoutSetVirtualSizeL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestVpLayoutSetVirtualSizeL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestVpLayoutSetVirtualSizeL, "TestVpLayoutSetVirtualSizeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestVpLayoutSetVirtualSizeL );
+    // Print to log file
+    iLog->Log( KTestVpLayoutSetVirtualSizeL );
+    
+    CAlfViewportLayout* layout = CAlfViewportLayout::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( layout );
+    STIF_ASSERT_NOT_NULL( layout );
+    TAlfRealSize size;
+    layout->SetVirtualSize( size, 1 );
+    CleanupStack::Pop( layout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestVpLayoutSetViewportSizeL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestVpLayoutSetViewportSizeL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestVpLayoutSetViewportSizeL, "TestVpLayoutSetViewportSizeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestVpLayoutSetViewportSizeL );
+    // Print to log file
+    iLog->Log( KTestVpLayoutSetViewportSizeL );
+    
+    CAlfViewportLayout* layout = CAlfViewportLayout::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( layout );
+    STIF_ASSERT_NOT_NULL( layout );
+    TAlfRealSize size;
+    layout->SetViewportSize( size, 1 );
+    CleanupStack::Pop( layout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestVpLayoutSetViewportPosL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestVpLayoutSetViewportPosL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestVpLayoutSetViewportPosL, "TestVpLayoutSetViewportPosL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestVpLayoutSetViewportPosL );
+    // Print to log file
+    iLog->Log( KTestVpLayoutSetViewportPosL );
+    
+    CAlfViewportLayout* layout = CAlfViewportLayout::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( layout );
+    STIF_ASSERT_NOT_NULL( layout );
+    TAlfRealPoint pos;
+    layout->SetViewportPos( pos, 1 );
+    CleanupStack::Pop( layout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestVpLayoutRemoveAndDestroyAllDL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestVpLayoutRemoveAndDestroyAllDL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestVpLayoutRemoveAndDestroyAllDL, "TestVpLayoutRemoveAndDestroyAllDL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestVpLayoutRemoveAndDestroyAllDL );
+    // Print to log file
+    iLog->Log( KTestVpLayoutRemoveAndDestroyAllDL );
+    
+    CAlfViewportLayout* layout = CAlfViewportLayout::AddNewL( *iAlfCtl );
+    STIF_ASSERT_NOT_NULL( layout );
+    layout->RemoveAndDestroyAllD();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestVpLayoutUpdateChildrenLayoutL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestVpLayoutUpdateChildrenLayoutL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestVpLayoutUpdateChildrenLayoutL, "TestVpLayoutUpdateChildrenLayoutL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestVpLayoutUpdateChildrenLayoutL );
+    // Print to log file
+    iLog->Log( KTestVpLayoutUpdateChildrenLayoutL );
+    
+    CAlfViewportLayout* layout = CAlfViewportLayout::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( layout );
+    STIF_ASSERT_NOT_NULL( layout );
+    layout->UpdateChildrenLayout();
+    CleanupStack::Pop( layout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestVpLayoutFindTagL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestVpLayoutFindTagL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestVpLayoutFindTagL, "TestVpLayoutFindTagL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestVpLayoutFindTagL );
+    // Print to log file
+    iLog->Log( KTestVpLayoutFindTagL );
+    
+    CAlfViewportLayout* layout = CAlfViewportLayout::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( layout );
+    STIF_ASSERT_NOT_NULL( layout );
+    _LIT8( KTagText, "Caption" );
+    layout->SetTagL( KTagText );
+    STIF_ASSERT_NOT_NULL( layout->FindTag( KTagText ) );
+    CleanupStack::Pop( layout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestVpLayoutBaseUnitL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestVpLayoutBaseUnitL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestVpLayoutBaseUnitL, "TestVpLayoutBaseUnitL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestVpLayoutBaseUnitL );
+    // Print to log file
+    iLog->Log( KTestVpLayoutBaseUnitL );
+    
+    CAlfViewportLayout* layout = CAlfViewportLayout::AddNewL( *iAlfCtl );
+    CleanupStack::PushL( layout );
+    STIF_ASSERT_NOT_NULL( layout );
+    layout->BaseUnit();
+    CleanupStack::Pop( layout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestVpLayoutDoRemoveAndDestroyAllDL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestVpLayoutDoRemoveAndDestroyAllDL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestVpLayoutDoRemoveAndDestroyAllDL, "TestVpLayoutDoRemoveAndDestroyAllDL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestVpLayoutDoRemoveAndDestroyAllDL );
+    // Print to log file
+    iLog->Log( KTestVpLayoutDoRemoveAndDestroyAllDL );
+    
+    CTestAlfViewportLayout* testLayout = new ( ELeave ) CTestAlfViewportLayout;
+    CleanupStack::PushL( testLayout );
+    STIF_ASSERT_NOT_NULL( testLayout );
+    testLayout->ConstructL( *iAlfCtl );
+    testLayout->DoRemoveAndDestroyAllD();
+    CleanupStack::Pop( testLayout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestVpLayoutPropertyOwnerExtensionL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestVpLayoutPropertyOwnerExtensionL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestVpLayoutPropertyOwnerExtensionL, "TestVpLayoutPropertyOwnerExtensionL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestVpLayoutPropertyOwnerExtensionL );
+    // Print to log file
+    iLog->Log( KTestVpLayoutPropertyOwnerExtensionL );
+    
+    CTestAlfViewportLayout* testLayout = new ( ELeave ) CTestAlfViewportLayout;
+    CleanupStack::PushL( testLayout );
+    STIF_ASSERT_NOT_NULL( testLayout );
+    testLayout->ConstructL( *iAlfCtl );
+    TBool inFocusChain( EFalse );
+    TAny* pInFocusChain = &inFocusChain;
+    testLayout->PropertyOwnerExtension( KUidAlfPropOwnerExtControlFocusChainChanged, &pInFocusChain );
+    CleanupStack::PopAndDestroy( testLayout );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksvisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,2384 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisual.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alfvisual.h>
+#include <alf/alfvisualfactory.h>
+#include <touchlogicalfeedback.h>
+#include <alf/alfpropertyowner.h>
+
+#include "testplatalfvisual.h"
+
+
+// CONSTANTS
+const TUint KRefFlag = 0;
+
+const TInt KNum10 = 10;
+const TInt KNum20 = 20;
+const TInt KNum30 = 30;
+const TInt KNum40 = 40;
+const TInt KNum50 = 50;
+const TInt KNum65 = 65;
+const TInt KNum88 = 88;
+const TInt KNum100 = 100;
+const TInt KNum120 = 120;
+const TInt KNum200 = 200;
+const TInt KNum300 = 300;
+
+const TReal32 KReal1 = 20.4;
+const TReal32 KReal2 = 30.3;
+const TReal32 KReal3 = 40.3;
+const TReal32 KReal4 = 50.4;
+const TReal32 KReal5 = 0.6;
+const TReal32 KReal6 = 0.3;
+const TReal32 KReal7 = 12.3;
+
+
+// FORWARD DECLARATION
+// class CTestAlfVisual for testing CAlfVisual
+class CTestAlfVisual : public CAlfVisual
+    {
+public:
+    // From CAlfVisual
+    void PropertyOwnerExtension( const TUid& aExtensionUid, TAny** aExtensionParams )
+        {
+        CAlfVisual::PropertyOwnerExtension( aExtensionUid, aExtensionParams );
+        }
+    };
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVCAlfVisualL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVCAlfVisualL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVCAlfVisualL, "TestCAlfVCAlfVisualL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVCAlfVisualL );
+    // Print to log file
+    iLog->Log( KTestCAlfVCAlfVisualL );
+    
+    CAlfVisual* alfVisual = new ( ELeave ) CAlfVisual();
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVConstructL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVConstructL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVConstructL, "TestCAlfVConstructL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVConstructL );
+    // Print to log file
+    iLog->Log( KTestCAlfVConstructL );
+    
+    CAlfVisual* alfVisual = new ( ELeave ) CAlfVisual();
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->ConstructL( *iAlfCtl );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVRemoveAndDestroyAllDL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVRemoveAndDestroyAllDL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVRemoveAndDestroyAllDL, "TestCAlfVRemoveAndDestroyAllDL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVRemoveAndDestroyAllDL );
+    // Print to log file
+    iLog->Log( KTestCAlfVRemoveAndDestroyAllDL );
+    
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+            EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->RemoveAndDestroyAllD();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVIdentifierL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVIdentifierL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVIdentifierL, "TestCAlfVIdentifierL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVIdentifierL );
+    // Print to log file
+    iLog->Log( KTestCAlfVIdentifierL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    STIF_ASSERT_NOT_EQUALS( 0, alfVisual->Identifier() );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetFlagL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetFlagL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetFlagL, "TestCAlfVSetFlagL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetFlagL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetFlagL );
+    
+    CAlfVisual* alfVisual = iAlfCtl->AppendVisualL( EAlfVisualTypeVisual );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    
+    // Create layout parent for testing purposes
+    CAlfLayout* parentLayout = iAlfCtl->AppendLayoutL( EAlfLayoutTypeDeck );
+    CleanupStack::PushL( parentLayout );
+    User::LeaveIfError( parentLayout->Append( alfVisual ) ); 
+    parentLayout->SetFlag( EAlfVisualFlagManualLayout );
+    parentLayout->SetPos( TAlfRealPoint( KNum40, KNum50 ) );
+    parentLayout->SetSize( TAlfRealSize( KNum100, KNum120 ) );
+    parentLayout->UpdateChildrenLayout();
+    TAlfTimedPoint size = alfVisual->Size(); 
+    STIF_ASSERT_EQUALS( KNum100+0.f, size.iX.Target() );
+    STIF_ASSERT_EQUALS( KNum120+0.f, size.iY.Target() );
+    TAlfTimedPoint pos = alfVisual->Pos(); 
+    STIF_ASSERT_EQUALS( 0.f, pos.iX.Target() );
+    STIF_ASSERT_EQUALS( 0.f, pos.iY.Target() );
+    
+    // 1# EAlfVisualFlagManualSize
+    alfVisual->SetSize( TAlfRealSize( KNum10, KNum20 ) );   // 1. resize without the flag
+    parentLayout->UpdateChildrenLayout();           // 2. relayout siblings
+    size = alfVisual->Size();                       // 3. check that the visual still has the original size
+    STIF_ASSERT_EQUALS( KNum100+0.f, size.iX.Target() );
+    STIF_ASSERT_EQUALS( KNum120+0.f, size.iY.Target() );
+    alfVisual->SetFlag( EAlfVisualFlagManualSize ); // 4. set the manual size flag
+    alfVisual->SetSize( TAlfRealSize( KNum10, KNum20 ) );   // 5. resize again
+    parentLayout->UpdateChildrenLayout();           // 6. relayout siblings
+    size = alfVisual->Size();                       // 7. check the the new size is still valid
+    STIF_ASSERT_EQUALS( KNum10+0.f, size.iX.Target() );
+    STIF_ASSERT_EQUALS( KNum20+0.f, size.iY.Target() );
+    
+    // 2# EAlfVisualFlagManualPosition
+    alfVisual->SetPos( TAlfRealPoint( KNum10, KNum20 ) );   // 1. replace without the flag
+    parentLayout->UpdateChildrenLayout();           // 2. relayout siblings
+    pos = alfVisual->Pos();                         // 3. check that the visual still has the original position
+    STIF_ASSERT_EQUALS( 0.f, pos.iX.Target() );
+    STIF_ASSERT_EQUALS( 0.f, pos.iY.Target() );
+    alfVisual->SetFlag( EAlfVisualFlagManualPosition );// 4. set the manual position flag
+    alfVisual->SetPos( TAlfRealPoint( KNum10, KNum20 ) );      // 5. replace again
+    parentLayout->UpdateChildrenLayout();              // 6. relayout siblings
+    pos = alfVisual->Pos();                            // 7. check the the new posotion is still valid
+    STIF_ASSERT_EQUALS( KNum10+0.f, pos.iX.Target() );
+    STIF_ASSERT_EQUALS( KNum20+0.f, pos.iY.Target() );
+    
+    // 3# AlfVisualFlagClipping
+    alfVisual->SetFlag( AlfVisualFlagClipping );
+    
+    // 4# EAlfVisualFlagLayoutUpdateNotification
+    parentLayout->UpdateChildrenLayout();
+    
+    // 5# EAlfVisualFlag3DProjection
+    alfVisual->SetFlag( EAlfVisualFlag3DProjection );
+    
+    // 6# EAlfVisualFlagNoDepthOcclusion
+    alfVisual->SetFlag( EAlfVisualFlagNoDepthOcclusion );
+    
+    // 7# EAlfVisualFlagLocalHorizon
+    alfVisual->SetFlag( EAlfVisualFlagLocalHorizon );
+    
+    // 8# EAlfVisualFlagClipping
+    alfVisual->SetFlag( EAlfVisualFlagClipping );
+    
+    // 8# EAlfVisualFlagHOriginCenter
+    alfVisual->SetFlag( EAlfVisualFlagHOriginCenter );
+    
+    // 8# EAlfVisualFlagHOriginRight
+    alfVisual->SetFlag( EAlfVisualFlagHOriginRight );
+    
+    // 8# EAlfVisualFlagVOriginCenter
+    alfVisual->SetFlag( EAlfVisualFlagVOriginCenter );
+    
+    // 8# EAlfVisualFlagVOriginBottom
+    alfVisual->SetFlag( EAlfVisualFlagVOriginBottom );
+    
+    CleanupStack::Pop( parentLayout );
+    CleanupStack::Pop( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetFlagsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetFlagsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetFlagsL, "TestCAlfVSetFlagsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetFlagsL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetFlagsL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TUint flags = EAlfVisualFlagVOriginCenter +
+                  EAlfVisualFlagNoDepthOcclusion +
+                  EAlfVisualFlagClipping;
+    alfVisual->SetFlags( flags );
+    TUint retFlags = alfVisual->Flags();
+    STIF_ASSERT_NOT_EQUALS( KRefFlag, ( retFlags & EAlfVisualFlagVOriginCenter ) );
+    STIF_ASSERT_NOT_EQUALS( KRefFlag, ( retFlags & EAlfVisualFlagNoDepthOcclusion ) );
+    STIF_ASSERT_NOT_EQUALS( KRefFlag, ( retFlags & EAlfVisualFlagClipping ) );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVClearFlagL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVClearFlagL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVClearFlagL, "TestCAlfVClearFlagL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVClearFlagL );
+    // Print to log file
+    iLog->Log( KTestCAlfVClearFlagL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TUint flags = EAlfVisualFlagVOriginCenter +
+                  EAlfVisualFlagNoDepthOcclusion +
+                  EAlfVisualFlagClipping;
+    alfVisual->SetFlags( flags );
+    alfVisual->ClearFlag( EAlfVisualFlagNoDepthOcclusion );
+    alfVisual->ClearFlag( EAlfVisualFlagClipping );
+    TUint retFlags = alfVisual->Flags();
+    STIF_ASSERT_NOT_EQUALS( KRefFlag, ( retFlags & EAlfVisualFlagVOriginCenter ) );
+    STIF_ASSERT_EQUALS( KRefFlag, ( retFlags & EAlfVisualFlagNoDepthOcclusion ) );
+    STIF_ASSERT_EQUALS( KRefFlag, ( retFlags & EAlfVisualFlagClipping ) );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVClearFlagsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVClearFlagsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVClearFlagsL, "TestCAlfVClearFlagsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVClearFlagsL );
+    // Print to log file
+    iLog->Log( KTestCAlfVClearFlagsL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TUint flags = EAlfVisualFlagVOriginCenter +
+                  EAlfVisualFlagNoDepthOcclusion +
+                  EAlfVisualFlagClipping;
+    alfVisual->SetFlags( flags );
+    alfVisual->ClearFlags( EAlfVisualFlagNoDepthOcclusion + EAlfVisualFlagClipping );
+    TUint retFlags = alfVisual->Flags();
+    STIF_ASSERT_NOT_EQUALS( KRefFlag, ( retFlags & EAlfVisualFlagVOriginCenter ) );
+    STIF_ASSERT_EQUALS( KRefFlag, ( retFlags & EAlfVisualFlagNoDepthOcclusion ) );
+    STIF_ASSERT_EQUALS( KRefFlag, ( retFlags & EAlfVisualFlagClipping ) );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVFlagsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVFlagsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVFlagsL, "TestCAlfVFlagsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVFlagsL );
+    // Print to log file
+    iLog->Log( KTestCAlfVFlagsL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    
+    alfVisual->SetFlag( EAlfVisualFlagVOriginCenter );
+    TUint retFlags = alfVisual->Flags();
+    STIF_ASSERT_NOT_EQUALS( KRefFlag , ( retFlags & EAlfVisualFlagVOriginCenter ) );
+    
+    alfVisual->SetFlag( EAlfVisualFlagNoDepthOcclusion );
+    retFlags = alfVisual->Flags();
+    STIF_ASSERT_NOT_EQUALS( KRefFlag , ( retFlags & EAlfVisualFlagNoDepthOcclusion ) );
+    
+    alfVisual->SetFlag( EAlfVisualFlagClipping );
+    retFlags = alfVisual->Flags();
+    STIF_ASSERT_NOT_EQUALS( KRefFlag , ( retFlags & EAlfVisualFlagClipping ) );
+    
+    alfVisual->ClearFlag( EAlfVisualFlagNoDepthOcclusion );
+    retFlags = alfVisual->Flags();
+    STIF_ASSERT_EQUALS( KRefFlag , ( retFlags & EAlfVisualFlagNoDepthOcclusion ) );
+    
+    alfVisual->ClearFlag( EAlfVisualFlagVOriginCenter );
+    retFlags = alfVisual->Flags();
+    STIF_ASSERT_EQUALS( KRefFlag , ( retFlags & EAlfVisualFlagVOriginCenter ) );
+    
+    alfVisual->ClearFlag( EAlfVisualFlagClipping );
+    retFlags = alfVisual->Flags();
+    STIF_ASSERT_EQUALS( KRefFlag , ( retFlags & EAlfVisualFlagClipping ) );
+    
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVLayoutL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVLayoutL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVLayoutL, "TestCAlfVLayoutL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVLayoutL );
+    // Print to log file
+    iLog->Log( KTestCAlfVLayoutL );
+    
+    CAlfVisual* alfVisual = iAlfCtl->AppendVisualL( EAlfVisualTypeVisual );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    
+    STIF_ASSERT_NULL( alfVisual->Layout() );
+    
+    CAlfLayout* parentLayout = iAlfCtl->AppendLayoutL( EAlfLayoutTypeDeck );
+    CleanupStack::PushL( parentLayout );
+    STIF_ASSERT_NOT_NULL( parentLayout );
+    User::LeaveIfError( parentLayout->Append( alfVisual ) ); // calls SetLayout()
+    
+    STIF_ASSERT_EQUALS( parentLayout, alfVisual->Layout() );
+    
+    CleanupStack::Pop( parentLayout );
+    CleanupStack::Pop( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVPosL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVPosL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVPosL, "TestCAlfVPosL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVPosL );
+    // Print to log file
+    iLog->Log( KTestCAlfVPosL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    
+    TAlfRealPoint pos( KNum20, KNum30 );
+    alfVisual->SetPos( pos );
+    
+    TAlfTimedPoint result = alfVisual->Pos();
+    STIF_ASSERT_EQUALS( KNum20+0.f, result.iX.ValueNow() );
+    STIF_ASSERT_EQUALS( KNum30+0.f, result.iY.ValueNow() );
+    STIF_ASSERT_EQUALS( KNum20+0.f, result.iX.Target() );
+    STIF_ASSERT_EQUALS( KNum30+0.f, result.iY.Target() );
+    
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetPosL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetPosL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetPosL, "TestCAlfVSetPosL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetPosL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetPosL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    
+    TAlfRealPoint pos( KNum20, KNum30 );
+    alfVisual->SetPos( pos );
+    
+    TAlfTimedPoint result = alfVisual->Pos();
+    STIF_ASSERT_EQUALS( KNum20+0.f, result.iX.ValueNow() );
+    STIF_ASSERT_EQUALS( KNum30+0.f, result.iY.ValueNow() );
+    STIF_ASSERT_EQUALS( KNum20+0.f, result.iX.Target() );
+    STIF_ASSERT_EQUALS( KNum30+0.f, result.iY.Target() );
+    
+    pos = TAlfRealPoint( KNum40, KNum50 );
+    alfVisual->SetPos( pos, KNum10);
+    
+    result = alfVisual->Pos();
+    STIF_ASSERT_NOT_EQUALS( KNum40+0.f, result.iX.ValueNow() );
+    STIF_ASSERT_NOT_EQUALS( KNum50+0.f, result.iY.ValueNow() );
+    STIF_ASSERT_EQUALS( KNum40+0.f, result.iX.Target() );
+    STIF_ASSERT_EQUALS( KNum50+0.f, result.iY.Target() );
+    
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSizeL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSizeL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSizeL, "TestCAlfVSizeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSizeL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSizeL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    
+    TAlfRealSize size( KNum20, KNum30 );
+    alfVisual->SetSize( size );
+    
+    TAlfTimedPoint result = alfVisual->Size();
+    STIF_ASSERT_EQUALS( KNum20+0.f, result.iX.ValueNow() );
+    STIF_ASSERT_EQUALS( KNum30+0.f, result.iY.ValueNow() );
+    STIF_ASSERT_EQUALS( KNum20+0.f, result.iX.Target() );
+    STIF_ASSERT_EQUALS( KNum30+0.f, result.iY.Target() );
+    
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetSizeL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetSizeL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetSizeL, "TestCAlfVSetSizeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetSizeL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetSizeL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    
+    TAlfRealSize size( KNum20, KNum30 );
+    alfVisual->SetSize( size );
+    
+    TAlfTimedPoint result = alfVisual->Size();
+    STIF_ASSERT_EQUALS( KNum20+0.f, result.iX.ValueNow() );
+    STIF_ASSERT_EQUALS( KNum30+0.f, result.iY.ValueNow() );
+    STIF_ASSERT_EQUALS( KNum20+0.f, result.iX.Target() );
+    STIF_ASSERT_EQUALS( KNum30+0.f, result.iY.Target() );
+    
+    size = TAlfRealSize( KNum40, KNum50 );
+    alfVisual->SetSize( size, KNum10);
+    
+    result = alfVisual->Size();
+    STIF_ASSERT_NOT_EQUALS( KNum40+0.f, result.iX.ValueNow() );
+    STIF_ASSERT_NOT_EQUALS( KNum50+0.f, result.iY.ValueNow() );
+    STIF_ASSERT_EQUALS( KNum40+0.f, result.iX.Target() );
+    STIF_ASSERT_EQUALS( KNum50+0.f, result.iY.Target() );
+    
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVOpacityL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVOpacityL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVOpacityL, "TestCAlfVOpacityL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVOpacityL );
+    // Print to log file
+    iLog->Log( KTestCAlfVOpacityL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TAlfTimedValue opacity = alfVisual->Opacity();
+    STIF_ASSERT_EQUALS( 1.f, opacity.ValueNow() );
+    STIF_ASSERT_EQUALS( 1.f, opacity.Target() );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetOpacityL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetOpacityL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetOpacityL, "TestCAlfVSetOpacityL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetOpacityL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetOpacityL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    
+    TAlfTimedValue opacity;
+    opacity.SetValueNow( 0.2 );
+    alfVisual->SetOpacity( opacity );
+    
+    TAlfTimedValue result = alfVisual->Opacity();
+    STIF_ASSERT_EQUALS( 0.2f, result.ValueNow() );
+    STIF_ASSERT_EQUALS( 0.2f, result.Target() );
+    
+    opacity.SetTarget( KReal5, KNum10 );
+    alfVisual->SetOpacity( opacity );
+    
+    result = alfVisual->Opacity();
+    STIF_ASSERT_NOT_EQUALS( KReal5, result.ValueNow() );
+    STIF_ASSERT_EQUALS( KReal5, result.Target() );
+    
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVEnvL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVEnvL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVEnvL, "TestCAlfVEnvL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVEnvL );
+    // Print to log file
+    iLog->Log( KTestCAlfVEnvL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    STIF_ASSERT_EQUALS( iAlfEnv, &alfVisual->Env() );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVDisplayL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVDisplayL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVDisplayL, "TestCAlfVDisplayL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVDisplayL );
+    // Print to log file
+    iLog->Log( KTestCAlfVDisplayL );
+    
+    CAlfVisual* alfVisual = iAlfCtl->AppendVisualL( EAlfVisualTypeVisual );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->Display();
+    CleanupStack::Pop( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVTagL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVTagL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVTagL, "TestCAlfVTagL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVTagL );
+    // Print to log file
+    iLog->Log( KTestCAlfVTagL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    const TDesC8& tag = alfVisual->Tag();
+    STIF_ASSERT_EQUALS( 0, tag.Length() );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVUpdateChildrenLayoutL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVUpdateChildrenLayoutL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVUpdateChildrenLayoutL, "TestCAlfVUpdateChildrenLayoutL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVUpdateChildrenLayoutL );
+    // Print to log file
+    iLog->Log( KTestCAlfVUpdateChildrenLayoutL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->UpdateChildrenLayout();
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVDisplayRectTargetL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVDisplayRectTargetL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVDisplayRectTargetL, "TestCAlfVDisplayRectTargetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVDisplayRectTargetL );
+    // Print to log file
+    iLog->Log( KTestCAlfVDisplayRectTargetL );
+    
+    CAlfVisual* alfVisual = iAlfCtl->AppendVisualL( EAlfVisualTypeVisual );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    
+    // Create layout parent for testing purposes
+    CAlfLayout* parentLayout = iAlfCtl->AppendLayoutL( EAlfLayoutTypeDeck );
+    CleanupStack::PushL( parentLayout );
+    STIF_ASSERT_NOT_NULL( parentLayout );
+    User::LeaveIfError( parentLayout->Append( alfVisual ) );
+    parentLayout->SetFlag( EAlfVisualFlagManualLayout );
+    parentLayout->SetPos( TAlfRealPoint( KNum40, KNum50 ) );
+    parentLayout->SetSize( TAlfRealSize( KNum100, KNum120 ) );
+    parentLayout->UpdateChildrenLayout();
+    
+    alfVisual->DisplayRectTarget();
+    
+    CleanupStack::Pop( parentLayout );
+    CleanupStack::Pop( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVLocalToDisplayL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVLocalToDisplayL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVLocalToDisplayL, "TestCAlfVLocalToDisplayL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVLocalToDisplayL );
+    // Print to log file
+    iLog->Log( KTestCAlfVLocalToDisplayL );
+    
+    CAlfVisual* alfVisual = iAlfCtl->AppendVisualL( EAlfVisualTypeVisual );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    
+    // Create layout parent for testing purposes
+    CAlfLayout* parentLayout = iAlfCtl->AppendLayoutL( EAlfLayoutTypeDeck );
+    CleanupStack::PushL( parentLayout );
+    STIF_ASSERT_NOT_NULL( parentLayout );
+    User::LeaveIfError( parentLayout->Append( alfVisual ) );
+    parentLayout->SetFlag( EAlfVisualFlagManualLayout );
+    parentLayout->SetPos( TAlfRealPoint( KNum40, KNum50 ) );
+    parentLayout->SetSize( TAlfRealSize( KNum100, KNum120 ) );
+    parentLayout->UpdateChildrenLayout();
+    
+    iAlfDisplay->Roster().ShowL( *iAlfCtrlGroup );
+    
+    TAlfRealPoint result = alfVisual->LocalToDisplay( TPoint( KNum65, KNum88 ) );
+    
+    STIF_ASSERT_EQUALS( result.iX, KNum65+KNum40+0.f );
+    STIF_ASSERT_EQUALS( result.iY, KNum88+KNum50+0.f );
+
+    iAlfDisplay->Roster().Hide( *iAlfCtrlGroup );
+    
+    CleanupStack::Pop( parentLayout );
+    CleanupStack::Pop( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVLocalToDisplayWithRealPointL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVLocalToDisplayWithRealPointL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVLocalToDisplayWithRealPointL, "TestCAlfVLocalToDisplayWithRealPointL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVLocalToDisplayWithRealPointL );
+    // Print to log file
+    iLog->Log( KTestCAlfVLocalToDisplayWithRealPointL );
+    
+    CAlfVisual* alfVisual = iAlfCtl->AppendVisualL( EAlfVisualTypeVisual );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    
+    // Create layout parent for testing purposes
+    CAlfLayout* parentLayout = iAlfCtl->AppendLayoutL( EAlfLayoutTypeDeck );
+    CleanupStack::PushL( parentLayout );
+    STIF_ASSERT_NOT_NULL( parentLayout );
+    User::LeaveIfError( parentLayout->Append( alfVisual ) );
+    parentLayout->SetFlag( EAlfVisualFlagManualLayout );
+    parentLayout->SetPos( TAlfRealPoint( KNum40, KNum50 ) );
+    parentLayout->SetSize( TAlfRealSize( KNum100, KNum120 ) );
+    parentLayout->UpdateChildrenLayout();
+    
+    TAlfRealPoint result = alfVisual->LocalToDisplay( TAlfRealPoint( KNum65, KNum88 ) );
+    
+    STIF_ASSERT_EQUALS( result.iX, KNum65+KNum40+0.f );
+    STIF_ASSERT_EQUALS( result.iY, KNum88+KNum50+0.f );
+    
+    CleanupStack::Pop( parentLayout );
+    CleanupStack::Pop( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVDisplayToLocalL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVDisplayToLocalL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVDisplayToLocalL, "TestCAlfVDisplayToLocalL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVDisplayToLocalL );
+    // Print to log file
+    iLog->Log( KTestCAlfVDisplayToLocalL );
+    
+    CAlfVisual* alfVisual = iAlfCtl->AppendVisualL( EAlfVisualTypeVisual );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    
+    // Create layout parent for testing purposes
+    CAlfLayout* parentLayout = iAlfCtl->AppendLayoutL( EAlfLayoutTypeDeck );
+    CleanupStack::PushL( parentLayout );
+    STIF_ASSERT_NOT_NULL( parentLayout );
+    User::LeaveIfError( parentLayout->Append( alfVisual ) );
+    parentLayout->SetFlag( EAlfVisualFlagManualLayout );
+    parentLayout->SetPos( TAlfRealPoint( KNum40, KNum50 ) );
+    parentLayout->SetSize( TAlfRealSize( KNum100, KNum120 ) );
+    parentLayout->UpdateChildrenLayout();
+    
+    iAlfDisplay->Roster().ShowL( *iAlfCtrlGroup );
+    
+    TPoint result = alfVisual->DisplayToLocal( TPoint( KNum10, KNum20 ) );
+    
+    STIF_ASSERT_EQUALS( result.iX, KNum10-KNum40 );
+    STIF_ASSERT_EQUALS( result.iY, KNum20-KNum50 );
+    
+    iAlfDisplay->Roster().Hide( *iAlfCtrlGroup );
+    
+    CleanupStack::Pop( parentLayout );
+    CleanupStack::Pop( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVDisplayToLocalWithRealPointL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVDisplayToLocalWithRealPointL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVDisplayToLocalWithRealPointL, "TestCAlfVDisplayToLocalWithRealPointL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVDisplayToLocalWithRealPointL );
+    // Print to log file
+    iLog->Log( KTestCAlfVDisplayToLocalWithRealPointL );
+    
+    CAlfVisual* alfVisual = iAlfCtl->AppendVisualL( EAlfVisualTypeVisual );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    
+    // Create layout parent for testing purposes
+    CAlfLayout* parentLayout = iAlfCtl->AppendLayoutL( EAlfLayoutTypeDeck );
+    CleanupStack::PushL( parentLayout );
+    STIF_ASSERT_NOT_NULL( parentLayout );
+    User::LeaveIfError( parentLayout->Append( alfVisual ) );
+    parentLayout->SetFlag( EAlfVisualFlagManualLayout );
+    parentLayout->SetPos( TAlfRealPoint( KNum40, KNum50 ) );
+    parentLayout->SetSize( TAlfRealSize( KNum100, KNum120 ) );
+    parentLayout->UpdateChildrenLayout();
+    
+    TAlfRealPoint result = alfVisual->DisplayToLocal( TAlfRealPoint( KNum10, KNum20 ) );
+    
+    STIF_ASSERT_EQUALS( result.iX, KNum10-KNum40+0.f );
+    STIF_ASSERT_EQUALS( result.iY, KNum20-KNum50+0.f );
+    
+    CleanupStack::Pop( parentLayout );
+    CleanupStack::Pop( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVEnableBrushesL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVEnableBrushesL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVEnableBrushesL, "TestCAlfVEnableBrushesL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVEnableBrushesL );
+    // Print to log file
+    iLog->Log( KTestCAlfVEnableBrushesL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->EnableBrushesL();
+    alfVisual->EnableBrushesL( EFalse );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVBrushesL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVBrushesL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVBrushesL, "TestCAlfVBrushesL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVBrushesL );
+    // Print to log file
+    iLog->Log( KTestCAlfVBrushesL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->EnableBrushesL( EFalse );
+    STIF_ASSERT_NULL( alfVisual->Brushes() );
+    alfVisual->EnableBrushesL( ETrue );
+    STIF_ASSERT_NOT_NULL( alfVisual->Brushes() );
+    alfVisual->EnableBrushesL( EFalse );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVMoveToFrontL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVMoveToFrontL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVMoveToFrontL, "TestCAlfVMoveToFrontL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVMoveToFrontL );
+    // Print to log file
+    iLog->Log( KTestCAlfVMoveToFrontL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->MoveToFront();
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVEnableTransformationL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVEnableTransformationL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVEnableTransformationL, "TestCAlfVEnableTransformationL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVEnableTransformationL );
+    // Print to log file
+    iLog->Log( KTestCAlfVEnableTransformationL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->EnableTransformationL();
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVTransformationL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVTransformationL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVTransformationL, "TestCAlfVTransformationL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVTransformationL );
+    // Print to log file
+    iLog->Log( KTestCAlfVTransformationL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->EnableTransformationL();
+    alfVisual->Transformation();
+    alfVisual->EnableTransformationL( EFalse );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetPaddingL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetPaddingL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetPaddingL, "TestCAlfVSetPaddingL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetPaddingL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetPaddingL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->SetPadding( KNum100 );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetPaddingWithPointL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetPaddingWithPointL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetPaddingWithPointL, "TestCAlfVSetPaddingWithPointL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetPaddingWithPointL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetPaddingWithPointL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TPoint point( KNum100, KNum50 );
+    alfVisual->SetPadding( point );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetPaddingWithMetricL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetPaddingWithMetricL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetPaddingWithMetricL, "TestCAlfVSetPaddingWithMetricL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetPaddingWithMetricL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetPaddingWithMetricL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TAlfBoxMetric boxMetric;
+    alfVisual->SetPadding( boxMetric );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVPaddingInPixelsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVPaddingInPixelsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVPaddingInPixelsL, "TestCAlfVPaddingInPixelsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVPaddingInPixelsL );
+    // Print to log file
+    iLog->Log( KTestCAlfVPaddingInPixelsL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TAlfBoxMetric boxMetric;
+    alfVisual->PaddingInPixels();
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetTagL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetTagL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetTagL, "TestCAlfVSetTagL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetTagL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetTagL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    _LIT8( KTagText, "Caption" );
+    TBufC8<KNum20> text( KTagText );
+    alfVisual->SetTagL( text );
+    const TDesC8& tag = alfVisual->Tag();
+    STIF_ASSERT_EQUALS( text.Length(), tag.Length() );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVIsTaggedL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVIsTaggedL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVIsTaggedL, "TestCAlfVIsTaggedL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVIsTaggedL );
+    // Print to log file
+    iLog->Log( KTestCAlfVIsTaggedL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->IsTagged();
+    STIF_ASSERT_FALSE( alfVisual->IsTagged() );
+    _LIT8( KTagText, "Caption" );
+    TBufC8<KNum20> text( KTagText );
+    alfVisual->SetTagL( text );
+    STIF_ASSERT_TRUE( alfVisual->IsTagged() );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVFindTagL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVFindTagL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVFindTagL, "TestCAlfVFindTagL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVFindTagL );
+    // Print to log file
+    iLog->Log( KTestCAlfVFindTagL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    _LIT8( KTagText, "Caption" );
+    TBufC8<KNum20> text( KTagText );
+    alfVisual->SetTagL( text );
+    _LIT8( KWhat, "What..." );
+    STIF_ASSERT_NULL( alfVisual->FindTag( KWhat ) );
+    STIF_ASSERT_EQUALS( alfVisual, alfVisual->FindTag( text ) );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVConstructWithMoreParamsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVConstructWithMoreParamsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVConstructWithMoreParamsL, "TestCAlfVConstructWithMoreParamsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVConstructWithMoreParamsL );
+    // Print to log file
+    iLog->Log( KTestCAlfVConstructWithMoreParamsL );
+    
+    // AlfVisualFactory::NewVisualL calls CAlfVisual::ConstructL with more params
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVCommsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVCommsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVCommsL, "TestCAlfVCommsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVCommsL );
+    // Print to log file
+    iLog->Log( KTestCAlfVCommsL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->Comms();
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVDepthOffsetL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVDepthOffsetL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVDepthOffsetL, "TestCAlfVDepthOffsetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVDepthOffsetL );
+    // Print to log file
+    iLog->Log( KTestCAlfVDepthOffsetL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TAlfTimedValue timedValue;
+    alfVisual->SetDepthOffset( timedValue );
+    TAlfTimedValue result = alfVisual->DepthOffset();
+    STIF_ASSERT_EQUALS( 0.f, result.ValueNow() );
+    STIF_ASSERT_EQUALS( 0.f, result.Target() );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetDepthOffsetL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetDepthOffsetL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetDepthOffsetL, "TestCAlfVSetDepthOffsetL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetDepthOffsetL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetDepthOffsetL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    
+    TAlfTimedValue offset;
+    offset.SetValueNow( KReal6 );
+    alfVisual->SetDepthOffset( offset );
+    
+    TAlfTimedValue result = alfVisual->DepthOffset();
+    STIF_ASSERT_EQUALS( KReal6, result.ValueNow() );
+    STIF_ASSERT_EQUALS( KReal6, result.Target() );
+    
+    offset.SetTarget( KReal5, KNum10 );
+    alfVisual->SetDepthOffset( offset );
+    
+    result = alfVisual->DepthOffset();
+    STIF_ASSERT_NOT_EQUALS( KReal5, result.ValueNow() );
+    STIF_ASSERT_EQUALS( KReal5, result.Target() );
+    
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVOwnerL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVOwnerL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVOwnerL, "TestCAlfVOwnerL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVOwnerL );
+    // Print to log file
+    iLog->Log( KTestCAlfVOwnerL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    STIF_ASSERT_EQUALS( iAlfCtl, &alfVisual->Owner() );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetOwnerL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetOwnerL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetOwnerL, "TestCAlfVSetOwnerL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetOwnerL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetOwnerL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->SetOwner( *iAlfCtl );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetOriginL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetOriginL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetOriginL, "TestCAlfVSetOriginL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetOriginL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetOriginL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->SetOrigin( EAlfVisualHOriginLeft, EAlfVisualVOriginTop );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVHorizontalOriginL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVHorizontalOriginL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVHorizontalOriginL, "TestCAlfVHorizontalOriginL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVHorizontalOriginL );
+    // Print to log file
+    iLog->Log( KTestCAlfVHorizontalOriginL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->SetOrigin( EAlfVisualHOriginLeft, EAlfVisualVOriginTop );
+    STIF_ASSERT_EQUALS( EAlfVisualHOriginLeft, alfVisual->HorizontalOrigin() );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVVerticalOriginL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVVerticalOriginL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVVerticalOriginL, "TestCAlfVVerticalOriginL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVVerticalOriginL );
+    // Print to log file
+    iLog->Log( KTestCAlfVVerticalOriginL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->SetOrigin( EAlfVisualHOriginLeft, EAlfVisualVOriginTop );
+    STIF_ASSERT_EQUALS( EAlfVisualVOriginTop, alfVisual->VerticalOrigin() );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVAlignByOriginL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVAlignByOriginL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVAlignByOriginL, "TestCAlfVAlignByOriginL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVAlignByOriginL );
+    // Print to log file
+    iLog->Log( KTestCAlfVAlignByOriginL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TAlfRealRect realRect( TRect( 0, 0, 2, 2 ) );
+    alfVisual->AlignByOrigin( realRect );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetMinSizeL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetMinSizeL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetMinSizeL, "TestCAlfVSetMinSizeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetMinSizeL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetMinSizeL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TSize size( KNum20, KNum30 );
+    alfVisual->SetMinSize( size );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetMinSizeWithRealSizeL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetMinSizeWithRealSizeL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetMinSizeWithRealSizeL, "TestCAlfVSetMinSizeWithRealSizeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetMinSizeWithRealSizeL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetMinSizeWithRealSizeL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TAlfRealSize size( KReal1, KReal2 );
+    alfVisual->SetMinSize( size );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVMinSizeL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVMinSizeL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVMinSizeL, "TestCAlfVMinSizeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVMinSizeL );
+    // Print to log file
+    iLog->Log( KTestCAlfVMinSizeL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TSize minSize( KNum20, KNum30 );
+    alfVisual->SetMinSize( minSize );
+    TSize result = alfVisual->MinSize();
+    STIF_ASSERT_EQUALS( minSize.iHeight , result.iHeight );
+    STIF_ASSERT_EQUALS( minSize.iWidth , result.iWidth );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVMinSizeInBaseUnitsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVMinSizeInBaseUnitsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVMinSizeInBaseUnitsL, "TestCAlfVMinSizeInBaseUnitsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVMinSizeInBaseUnitsL );
+    // Print to log file
+    iLog->Log( KTestCAlfVMinSizeInBaseUnitsL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TAlfRealSize minSize( KReal1, KReal2 );
+    alfVisual->SetMinSize( minSize );
+    TAlfRealSize result = alfVisual->MinSizeInBaseUnits();
+    STIF_ASSERT_EQUALS( minSize.iWidth, result.iWidth );
+    STIF_ASSERT_EQUALS( minSize.iHeight, result.iHeight );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetMaxSizeL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetMaxSizeL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetMaxSizeL, "TestCAlfVSetMaxSizeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetMaxSizeL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetMaxSizeL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TSize maxSize( KNum20, KNum30 );
+    alfVisual->SetMaxSize( maxSize );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetMaxSizeWithRealSizeL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetMaxSizeWithRealSizeL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetMaxSizeWithRealSizeL, "TestCAlfVSetMaxSizeWithRealSizeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetMaxSizeWithRealSizeL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetMaxSizeWithRealSizeL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TAlfRealSize maxSize( KReal1, KReal2 );
+    alfVisual->SetMaxSize( maxSize );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVMaxSizeL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVMaxSizeL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVMaxSizeL, "TestCAlfVMaxSizeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVMaxSizeL );
+    // Print to log file
+    iLog->Log( KTestCAlfVMaxSizeL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TSize maxSize( KNum20, KNum30 );
+    alfVisual->SetMaxSize( maxSize );
+    TSize result = alfVisual->MaxSize();
+    STIF_ASSERT_EQUALS( maxSize.iHeight , result.iHeight );
+    STIF_ASSERT_EQUALS( maxSize.iWidth , result.iWidth );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVMaxSizeInBaseUnitsL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVMaxSizeInBaseUnitsL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVMaxSizeInBaseUnitsL, "TestCAlfVMaxSizeInBaseUnitsL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVMaxSizeInBaseUnitsL );
+    // Print to log file
+    iLog->Log( KTestCAlfVMaxSizeInBaseUnitsL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TAlfRealSize maxSize( KReal1, KReal2 );
+    alfVisual->SetMaxSize( maxSize );
+    TAlfRealSize result = alfVisual->MaxSizeInBaseUnits();
+    STIF_ASSERT_EQUALS( maxSize.iWidth, result.iWidth );
+    STIF_ASSERT_EQUALS( maxSize.iHeight, result.iHeight );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetRectL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetRectL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetRectL, "TestCAlfVSetRectL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetRectL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetRectL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TAlfRealRect rect ( TRect( KNum20, KNum30, KNum40, KNum50 ) );
+    alfVisual->SetFlag( EAlfVisualFlagManualLayout );
+    alfVisual->SetRect( rect );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVMoveL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVMoveL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVMoveL, "TestCAlfVMoveL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVMoveL );
+    // Print to log file
+    iLog->Log( KTestCAlfVMoveL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TPoint offset( KNum20, KNum20 );
+    alfVisual->SetFlag( EAlfVisualFlagManualLayout );
+    alfVisual->Move( offset );
+    TAlfTimedPoint visualPos = alfVisual->Pos();
+    STIF_ASSERT_EQUALS( visualPos.iX.Target(), offset.iX+0.f );
+    STIF_ASSERT_EQUALS( visualPos.iY.Target(), offset.iY+0.f );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVMoveWithRealPointL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVMoveWithRealPointL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVMoveWithRealPointL, "TestCAlfVMoveWithRealPointL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVMoveWithRealPointL );
+    // Print to log file
+    iLog->Log( KTestCAlfVMoveWithRealPointL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TAlfRealPoint offset( KReal1, KReal7 );
+    alfVisual->SetFlag( EAlfVisualFlagManualLayout );
+    alfVisual->Move( offset );
+    TAlfTimedPoint visualPos = alfVisual->Pos();
+    STIF_ASSERT_EQUALS( visualPos.iX.Target(), offset.iX );
+    STIF_ASSERT_EQUALS( visualPos.iY.Target(), offset.iY );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVMimicL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVMimicL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVMimicL, "TestCAlfVMimicL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVMimicL );
+    // Print to log file
+    iLog->Log( KTestCAlfVMimicL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->SetFlag( EAlfVisualFlagManualLayout );
+    alfVisual->Mimic( *alfVisual );
+    CleanupStack::PopAndDestroy( alfVisual );
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetCenteredPosAndSizeL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetCenteredPosAndSizeL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetCenteredPosAndSizeL, "TestCAlfVSetCenteredPosAndSizeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetCenteredPosAndSizeL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetCenteredPosAndSizeL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TPoint centerPoint( KNum20, KNum30 );
+    TSize size( KNum40, KNum50 );
+    alfVisual->SetFlag( EAlfVisualFlagManualLayout );
+    alfVisual->SetCenteredPosAndSize( centerPoint, size );
+    TAlfTimedPoint visualPos = alfVisual->Pos();
+    TAlfTimedPoint visualSize = alfVisual->Size();
+    STIF_ASSERT_EQUALS( visualPos.iX.Target() , centerPoint.iX-(size.iWidth/2.f) );
+    STIF_ASSERT_EQUALS( visualPos.iY.Target() , centerPoint.iY-(size.iHeight/2.f) );
+    STIF_ASSERT_EQUALS( visualSize.iX.Target(), size.iWidth+0.f );
+    STIF_ASSERT_EQUALS( visualSize.iY.Target(), size.iHeight+0.f );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetCenteredPosAndSizeWithRealL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetCenteredPosAndSizeWithRealL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetCenteredPosAndSizeWithRealL, "TestCAlfVSetCenteredPosAndSizeWithRealL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetCenteredPosAndSizeWithRealL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetCenteredPosAndSizeWithRealL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TAlfRealPoint centerPoint( KReal1, KReal2 );
+    TAlfRealSize size( KReal3, KReal4 );
+    alfVisual->SetFlag( EAlfVisualFlagManualLayout );
+    alfVisual->SetCenteredPosAndSize( centerPoint, size );
+    TAlfTimedPoint visualPos = alfVisual->Pos();
+    TAlfTimedPoint visualSize = alfVisual->Size();
+    STIF_ASSERT_EQUALS( visualPos.iX.Target(), centerPoint.iX-(size.iWidth/2.f) );
+    STIF_ASSERT_EQUALS( visualPos.iY.Target(), centerPoint.iY-(size.iHeight/2.f) );
+    STIF_ASSERT_EQUALS( visualSize.iX.Target(), size.iWidth );
+    STIF_ASSERT_EQUALS( visualSize.iY.Target(), size.iHeight );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVDisplayRectL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVDisplayRectL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVDisplayRectL, "TestCAlfVDisplayRectL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVDisplayRectL );
+    // Print to log file
+    iLog->Log( KTestCAlfVDisplayRectL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->DisplayRect();
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVEffectiveOpacityL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVEffectiveOpacityL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVEffectiveOpacityL, "TestCAlfVEffectiveOpacityL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVEffectiveOpacityL );
+    // Print to log file
+    iLog->Log( KTestCAlfVEffectiveOpacityL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->EffectiveOpacity();
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetClippingL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetClippingL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetClippingL, "TestCAlfVSetClippingL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetClippingL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetClippingL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->SetClipping();
+    alfVisual->SetClipping( EFalse );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVClippingL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVClippingL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVClippingL, "TestCAlfVClippingL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVClippingL );
+    // Print to log file
+    iLog->Log( KTestCAlfVClippingL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->SetClipping();
+    STIF_ASSERT_TRUE( alfVisual->Clipping() );
+    alfVisual->SetClipping( EFalse );
+    STIF_ASSERT_FALSE( alfVisual->Clipping() );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVPaddingL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVPaddingL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVPaddingL, "TestCAlfVPaddingL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVPaddingL );
+    // Print to log file
+    iLog->Log( KTestCAlfVPaddingL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TPoint result = alfVisual->Padding();
+    STIF_ASSERT_EQUALS( 0, result.iX );
+    STIF_ASSERT_EQUALS( 0, result.iY );
+    alfVisual->SetPadding( KNum10 );
+    result = alfVisual->Padding();
+    STIF_ASSERT_EQUALS( KNum10, result.iX );
+    STIF_ASSERT_EQUALS( KNum10, result.iY );
+    alfVisual->SetPadding( TPoint( KNum10, KNum20 ) );
+    result = alfVisual->Padding();
+    STIF_ASSERT_EQUALS( KNum10, result.iX );
+    STIF_ASSERT_EQUALS( KNum20, result.iY );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVPaddingAsMetricL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVPaddingAsMetricL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVPaddingAsMetricL, "TestCAlfVPaddingAsMetricL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVPaddingAsMetricL );
+    // Print to log file
+    iLog->Log( KTestCAlfVPaddingAsMetricL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->PaddingAsMetric();
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVHorizontalPaddingL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVHorizontalPaddingL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVHorizontalPaddingL, "TestCAlfVHorizontalPaddingL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVHorizontalPaddingL );
+    // Print to log file
+    iLog->Log( KTestCAlfVHorizontalPaddingL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TInt result = alfVisual->HorizontalPadding();
+    STIF_ASSERT_EQUALS( 0, result );
+    alfVisual->SetPadding( KNum10 );
+    result = alfVisual->HorizontalPadding();
+    STIF_ASSERT_EQUALS( KNum10, result );
+    alfVisual->SetPadding( TPoint( KNum10, KNum20 ) );
+    result = alfVisual->HorizontalPadding();
+    STIF_ASSERT_EQUALS( KNum10, result );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVVerticalPaddingL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVVerticalPaddingL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVVerticalPaddingL, "TestCAlfVVerticalPaddingL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVVerticalPaddingL );
+    // Print to log file
+    iLog->Log( KTestCAlfVVerticalPaddingL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TInt result = alfVisual->VerticalPadding();
+    STIF_ASSERT_EQUALS( 0, result );
+    alfVisual->SetPadding( KNum10 );
+    result = alfVisual->VerticalPadding();
+    STIF_ASSERT_EQUALS( KNum10, result );
+    alfVisual->SetPadding( TPoint( KNum10, KNum20 ) );
+    result = alfVisual->VerticalPadding();
+    STIF_ASSERT_EQUALS( KNum20, result );
+    alfVisual->VerticalPadding();
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetPosWithTimedPointL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetPosWithTimedPointL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetPosWithTimedPointL, "TestCAlfVSetPosWithTimedPointL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetPosWithTimedPointL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetPosWithTimedPointL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TAlfTimedPoint point;
+    point.iX.SetValueNow( KNum20 );
+    point.iY.SetValueNow( KNum30 );
+    point.iX.SetTarget( KNum200, KNum10 );
+    point.iY.SetTarget( KNum300, KNum10 );
+    alfVisual->SetPos( point );
+    TAlfTimedPoint result = alfVisual->Pos();
+    STIF_ASSERT_NOT_EQUALS( KNum200+0.f, result.iX.ValueNow() );
+    STIF_ASSERT_NOT_EQUALS( KNum300+0.f, result.iY.ValueNow() );
+    STIF_ASSERT_EQUALS( KNum200+0.f, result.iX.Target() );
+    STIF_ASSERT_EQUALS( KNum300+0.f, result.iY.Target() );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetSizeWithTimedPointL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetSizeWithTimedPointL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetSizeWithTimedPointL, "TestCAlfVSetSizeWithTimedPointL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetSizeWithTimedPointL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetSizeWithTimedPointL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TAlfTimedPoint size;
+    size.iX.SetValueNow( KNum20 );
+    size.iY.SetValueNow( KNum30 );
+    size.iX.SetTarget( KNum200, KNum10 );
+    size.iY.SetTarget( KNum300, KNum10 );
+    alfVisual->SetSize( size );
+    TAlfTimedPoint result = alfVisual->Size();
+    STIF_ASSERT_NOT_EQUALS( KNum200+0.f, result.iX.ValueNow() );
+    STIF_ASSERT_NOT_EQUALS( KNum300+0.f, result.iY.ValueNow() );
+    STIF_ASSERT_EQUALS( KNum200+0.f, result.iX.Target() );
+    STIF_ASSERT_EQUALS( KNum300+0.f, result.iY.Target() );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVCopyValuesL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVCopyValuesL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVCopyValuesL, "TestCAlfVCopyValuesL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVCopyValuesL );
+    // Print to log file
+    iLog->Log( KTestCAlfVCopyValuesL );
+    
+    CAlfVisual* visual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( visual );
+    STIF_ASSERT_NOT_NULL( visual );
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->CopyValues( *visual );
+    CleanupStack::PopAndDestroy( alfVisual );
+    CleanupStack::PopAndDestroy( visual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVPauseL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVPauseL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVPauseL, "TestCAlfVPauseL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVPauseL );
+    // Print to log file
+    iLog->Log( KTestCAlfVPauseL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->Pause();
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVResumeL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVResumeL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVResumeL, "TestCAlfVResumeL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVResumeL );
+    // Print to log file
+    iLog->Log( KTestCAlfVResumeL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->Resume();
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVDoRemoveAndDestroyAllDL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVDoRemoveAndDestroyAllDL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVDoRemoveAndDestroyAllDL, "TestCAlfVDoRemoveAndDestroyAllDL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVDoRemoveAndDestroyAllDL );
+    // Print to log file
+    iLog->Log( KTestCAlfVDoRemoveAndDestroyAllDL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->DoRemoveAndDestroyAllD();
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVSetTactileFeedbackL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVSetTactileFeedbackL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVSetTactileFeedbackL, "TestCAlfVSetTactileFeedbackL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVSetTactileFeedbackL );
+    // Print to log file
+    iLog->Log( KTestCAlfVSetTactileFeedbackL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->SetTactileFeedbackL( 0 , 0 );
+    alfVisual->SetTactileFeedbackL( 1 , 1 );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVHasTactileFeedbackL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVHasTactileFeedbackL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVHasTactileFeedbackL, "TestCAlfVHasTactileFeedbackL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVHasTactileFeedbackL );
+    // Print to log file
+    iLog->Log( KTestCAlfVHasTactileFeedbackL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    STIF_ASSERT_TRUE( !alfVisual->HasTactileFeedback() );
+    STIF_ASSERT_TRUE( !alfVisual->HasTactileFeedback( 0 ) );
+    STIF_ASSERT_TRUE( !alfVisual->HasTactileFeedback( 1 ) );
+    alfVisual->SetTactileFeedbackL( 0 , 0 );
+    STIF_ASSERT_TRUE( alfVisual->HasTactileFeedback() );
+    STIF_ASSERT_TRUE( alfVisual->HasTactileFeedback( 0 ) );
+    STIF_ASSERT_TRUE( !alfVisual->HasTactileFeedback( 1 ) );
+    alfVisual->RemoveTactileFeedback();
+    STIF_ASSERT_TRUE( !alfVisual->HasTactileFeedback() );
+    STIF_ASSERT_TRUE( !alfVisual->HasTactileFeedback( 0 ) );
+    STIF_ASSERT_TRUE( !alfVisual->HasTactileFeedback( 1 ) );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVRemoveTactileFeedbackL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVRemoveTactileFeedbackL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVRemoveTactileFeedbackL, "TestCAlfVRemoveTactileFeedbackL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVRemoveTactileFeedbackL );
+    // Print to log file
+    iLog->Log( KTestCAlfVRemoveTactileFeedbackL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    STIF_ASSERT_TRUE( !alfVisual->HasTactileFeedback() );
+    alfVisual->RemoveTactileFeedback(); // do nothing
+    alfVisual->RemoveTactileFeedback( 0 ); // do nothing
+    STIF_ASSERT_TRUE( !alfVisual->HasTactileFeedback() );
+    alfVisual->SetTactileFeedbackL( 0 , 0 ); // add 0
+    alfVisual->SetTactileFeedbackL( 1 , 1 ); // add 1
+    STIF_ASSERT_TRUE( alfVisual->HasTactileFeedback( 0 ) );
+    STIF_ASSERT_TRUE( alfVisual->HasTactileFeedback( 1 ) );
+    alfVisual->RemoveTactileFeedback( 0 ); // remove 0
+    STIF_ASSERT_TRUE( !alfVisual->HasTactileFeedback( 0 ) );
+    STIF_ASSERT_TRUE( alfVisual->HasTactileFeedback( 1 ) );
+    alfVisual->SetTactileFeedbackL( 0 , 2 ); // add 0
+    STIF_ASSERT_TRUE( alfVisual->HasTactileFeedback( 1 ) );
+    STIF_ASSERT_TRUE( alfVisual->HasTactileFeedback( 0 ) );
+    alfVisual->RemoveTactileFeedback(); // remove all
+    STIF_ASSERT_TRUE( !alfVisual->HasTactileFeedback( 0 ) );
+    STIF_ASSERT_TRUE( !alfVisual->HasTactileFeedback( 1 ) );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVEnableDropShadowL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVEnableDropShadowL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVEnableDropShadowL, "TestCAlfVEnableDropShadowL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVEnableDropShadowL );
+    // Print to log file
+    iLog->Log( KTestCAlfVEnableDropShadowL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->EnableDropShadowL();
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVDropShadowHandlerL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVDropShadowHandlerL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVDropShadowHandlerL, "TestCAlfVDropShadowHandlerL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVDropShadowHandlerL );
+    // Print to log file
+    iLog->Log( KTestCAlfVDropShadowHandlerL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+                    EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    alfVisual->EnableDropShadowL();
+    alfVisual->DropShadowHandler();
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestCAlfVPropertyOwnerExtensionL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestCAlfVPropertyOwnerExtensionL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestCAlfVPropertyOwnerExtensionL, "TestCAlfVPropertyOwnerExtensionL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestCAlfVPropertyOwnerExtensionL );
+    // Print to log file
+    iLog->Log( KTestCAlfVPropertyOwnerExtensionL );
+    
+    CTestAlfVisual* alfVisual = new ( ELeave ) CTestAlfVisual;
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    TBool inFocusChain( EFalse );
+    TAny* pInFocusChain = &inFocusChain;
+    alfVisual->PropertyOwnerExtension( KUidAlfPropOwnerExtControlFocusChainChanged, &pInFocusChain );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/alf_visual_api/tsrc/src/testplatalfvisualblocksvisualfactory.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions for alfvisualfactory.h
+*
+*/
+
+
+
+// [INCLUDE FILES]
+#include <alf/alflayout.h>
+#include <alf/alfvisual.h>
+#include <alf/alfvisualfactory.h>
+
+#include "testplatalfvisual.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfVFNewLayoutL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfVFNewLayoutL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfVFNewLayoutL, "TestAlfVFNewLayoutL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfVFNewLayoutL );
+    // Print to log file
+    iLog->Log( KTestAlfVFNewLayoutL );
+    
+    CAlfLayout* alfLayout = AlfVisualFactory::NewLayoutL( 
+            EAlfLayoutTypeLayout, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfLayout );
+    STIF_ASSERT_NOT_NULL( alfLayout );
+    CleanupStack::PopAndDestroy( alfLayout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfVFNewLayoutLCL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfVFNewLayoutLCL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfVFNewLayoutLCL, "TestAlfVFNewLayoutLCL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfVFNewLayoutLCL );
+    // Print to log file
+    iLog->Log( KTestAlfVFNewLayoutLCL );
+    
+    CAlfLayout* alfLayout = AlfVisualFactory::NewLayoutLC(
+            EAlfLayoutTypeLayout, NULL, *iAlfCtl, *iAlfEnv );
+    STIF_ASSERT_NOT_NULL( alfLayout );
+    CleanupStack::PopAndDestroy( alfLayout );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfVFNewVisualL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfVFNewVisualL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfVFNewVisualL, "TestAlfVFNewVisualL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfVFNewVisualL );
+    // Print to log file
+    iLog->Log( KTestAlfVFNewVisualL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualL(
+            EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    CleanupStack::PushL( alfVisual );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CTestPlatAlfVisual::TestAlfVFNewVisualLCL
+// -----------------------------------------------------------------------------
+//
+TInt CTestPlatAlfVisual::TestAlfVFNewVisualLCL( CStifItemParser& /*aItem*/ )
+    {
+    // Print to UI
+    _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" );
+    _LIT( KTestAlfVFNewVisualLCL, "TestAlfVFNewVisualLCL" );
+    TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfVFNewVisualLCL );
+    // Print to log file
+    iLog->Log( KTestAlfVFNewVisualLCL );
+    
+    CAlfVisual* alfVisual = AlfVisualFactory::NewVisualLC(
+            EAlfVisualTypeVisual, NULL, *iAlfCtl, *iAlfEnv );
+    STIF_ASSERT_NOT_NULL( alfVisual );
+    CleanupStack::PopAndDestroy( alfVisual );
+    
+    return KErrNone;
+    }
+
+
+//  [End of File]
Binary file uiaccelerator_plat/apidoc_images/CAlfCurvePath_ArcDefinition.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/group/Doxyfile.txt	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1301 @@
+# Doxyfile 1.5.2
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file that 
+# follow. The default is UTF-8 which is also the encoding used for all text before 
+# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into 
+# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of 
+# possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = "UI Accelerator Toolkit"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = ../apidoc
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of 
+# source files, where putting all generated files in the same directory would 
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
+# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, 
+# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, 
+# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, 
+# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is 
+# used as the annotated text. Otherwise, the brief description is used as-is. 
+# If left blank, the following values are used ("$name" is automatically 
+# replaced with the name of the entity): "The $name class" "The $name widget" 
+# "The $name file" "is" "provides" "specifies" "contains" 
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
+# inherited members of a class in the documentation of that class as if those 
+# members were ordinary class members. Constructors, destructors and assignment 
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like the Qt-style comments (thus requiring an 
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF      = YES
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member 
+# documentation.
+
+DETAILS_AT_TOP         = YES
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
+# a new page for each member. If set to NO, the documentation of a member will 
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 4
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = panic=@exception \
+                         leave=@exception \
+                         "internalTechnology=@par Internal technology" \
+                         "internalComponent=@par Internal component" \
+                         "internalAll=@par Internal all" \
+                         "publishedPartner=@par Published-partner" \
+                         "publishedAll=@par Published-all" \
+                         "prototype=@par Prototype" \
+                         "interim=@par Interim" \
+                         "released=@par Released" \
+                         "removed=@par Removed" \
+                         "test=@par Test" \
+                         "realtime=@par Realtime" \
+                         "beginAPI=@name Exported API\n @{" \
+                         endAPI=@}
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
+# sources only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
+# sources only. Doxygen will then generate output that is more tailored for Java. 
+# For instance, namespaces will be presented as packages, qualified scopes 
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to 
+# include (a tag file for) the STL sources as input, then you should 
+# set this tag to YES in order to let doxygen match functions declarations and 
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
+# func(std::string) {}). This also make the inheritance and collaboration 
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = YES
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
+# doxygen should invoke to get the current version for each file (typically from the 
+# version control system). Doxygen will invoke the program by executing (via 
+# popen()) the command <command> <input-file>, where <command> is the value of 
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
+# provided by doxygen. Whatever the program writes to standard output 
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for 
+# functions that are documented, but have no documentation for their parameters 
+# or return value. If set to NO (the default) doxygen will only warn about 
+# wrong or incomplete parameter documentation, but not about the absence of 
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text. Optionally the format may contain 
+# $version, which will be replaced by the version of the file (if it could 
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  = ../alf_client_server_api/inc/alf \
+                         ../alf_extended_visual_api/inc/alf \
+                         ../alf_extension_api/inc/alf \
+                         ../alf_tracing_api/inc/alf \
+                         ../alf_visual_api/inc/alf
+
+# This tag can be used to specify the character encoding of the source files that 
+# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default 
+# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. 
+# See http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
+
+FILE_PATTERNS          = *.c \
+                         *.cc \
+                         *.cpp \
+                         *.h \
+                         *.hh \
+                         *.hrh \
+                         *.dox
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = 
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
+# directories that are symbolic links (a Unix filesystem feature) are excluded 
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories. Note that the wildcards are matched 
+# against the file with absolute path, so to exclude all test directories 
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = *Bitgdi* \
+                         *Gles10* \
+                         *Gles11* \
+                         *MatrixStack* \
+                         *blitter*
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
+# (namespaces, classes, functions, etc.) that should be excluded from the output. 
+# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, 
+# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = ../apidoc_images
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.  Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code 
+# will point to the HTML generated by the htags(1) tool instead of doxygen 
+# built-in source browser. The htags tool is part of GNU's global source 
+# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 3
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = TAlf \
+                         SAlf \
+                         CAlf \
+                         RAlf \
+                         MAlf \
+                         Alf
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = 
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = "NONSHARABLE_CLASS(name)=class name" \
+                         "_LIT(name,string)=const static TLitC<sizeof(L##string)/2> name={sizeof(L##string)/2-1,L##string}"
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse 
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
+# or super classes. Setting the tag to NO turns the diagrams off. Note that 
+# this option is superseded by the HAVE_DOT option below. This is only a 
+# fallback. It is recommended to install and use dot, since it yields more 
+# powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc 
+# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to 
+# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to 
+# specify the directory where the mscgen tool resides. If left empty the tool is assumed to 
+# be found in the default search path.
+
+MSCGEN_PATH            = 
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = YES
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a call dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable call graphs for selected 
+# functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a caller dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable caller graphs for selected 
+# functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
+# then doxygen will show the dependencies a directory has on other directories 
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
+# nodes that will be shown in the graph. If the number of nodes in a graph 
+# becomes larger than this value, doxygen will truncate the graph, which is 
+# visualized by representing a node as a red box. Note that doxygen will always 
+# show the root nodes and its direct children regardless of this setting.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
+# background. This is disabled by default, which results in a white background. 
+# Warning: Depending on the platform used, enabling this option may lead to 
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to 
+# read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
+# files in one run (i.e. multiple -o and -T options on the command line). This 
+# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/group/Doxyfile_coretoolkit.txt	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1297 @@
+# Doxyfile 1.5.2
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file that 
+# follow. The default is UTF-8 which is also the encoding used for all text before 
+# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into 
+# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of 
+# possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = "Hitchcockcore"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = ../apidoc_coretoolkit
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of 
+# source files, where putting all generated files in the same directory would 
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
+# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, 
+# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, 
+# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, 
+# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is 
+# used as the annotated text. Otherwise, the brief description is used as-is. 
+# If left blank, the following values are used ("$name" is automatically 
+# replaced with the name of the entity): "The $name class" "The $name widget" 
+# "The $name file" "is" "provides" "specifies" "contains" 
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
+# inherited members of a class in the documentation of that class as if those 
+# members were ordinary class members. Constructors, destructors and assignment 
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like the Qt-style comments (thus requiring an 
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF      = YES
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member 
+# documentation.
+
+DETAILS_AT_TOP         = YES
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
+# a new page for each member. If set to NO, the documentation of a member will 
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 4
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = panic=@exception \
+                         leave=@exception \
+                         "internalTechnology=@par Internal technology" \
+                         "internalComponent=@par Internal component" \
+                         "internalAll=@par Internal all" \
+                         "publishedPartner=@par Published-partner" \
+                         "publishedAll=@par Published-all" \
+                         "prototype=@par Prototype" \
+                         "interim=@par Interim" \
+                         "released=@par Released" \
+                         "removed=@par Removed" \
+                         "test=@par Test" \
+                         "realtime=@par Realtime" \
+                         "beginAPI=@name Exported API\n @{" \
+                         endAPI=@}
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
+# sources only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
+# sources only. Doxygen will then generate output that is more tailored for Java. 
+# For instance, namespaces will be presented as packages, qualified scopes 
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to 
+# include (a tag file for) the STL sources as input, then you should 
+# set this tag to YES in order to let doxygen match functions declarations and 
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
+# func(std::string) {}). This also make the inheritance and collaboration 
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = YES
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
+# doxygen should invoke to get the current version for each file (typically from the 
+# version control system). Doxygen will invoke the program by executing (via 
+# popen()) the command <command> <input-file>, where <command> is the value of 
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
+# provided by doxygen. Whatever the program writes to standard output 
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for 
+# functions that are documented, but have no documentation for their parameters 
+# or return value. If set to NO (the default) doxygen will only warn about 
+# wrong or incomplete parameter documentation, but not about the absence of 
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text. Optionally the format may contain 
+# $version, which will be replaced by the version of the file (if it could 
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  = ../alf_core_toolkit_api/inc/uiacceltk
+
+# This tag can be used to specify the character encoding of the source files that 
+# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default 
+# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. 
+# See http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
+
+FILE_PATTERNS          = *.c \
+                         *.cc \
+                         *.cpp \
+                         *.h \
+                         *.hh \
+                         *.hrh \
+                         *.dox
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = 
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
+# directories that are symbolic links (a Unix filesystem feature) are excluded 
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories. Note that the wildcards are matched 
+# against the file with absolute path, so to exclude all test directories 
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = *Bitgdi* \
+                         *Gles10* \
+                         *Gles11* \
+                         *MatrixStack* \
+                         *blitter*
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
+# (namespaces, classes, functions, etc.) that should be excluded from the output. 
+# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, 
+# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.  Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code 
+# will point to the HTML generated by the htags(1) tool instead of doxygen 
+# built-in source browser. The htags tool is part of GNU's global source 
+# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = YES
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 3
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = THui \
+                         SHui \
+                         CHui \
+                         RHui \
+                         MHui \
+                         Hui
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = 
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = YES
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = "NONSHARABLE_CLASS(name)=class name" \
+                         "_LIT(name,string)=const static TLitC<sizeof(L##string)/2> name={sizeof(L##string)/2-1,L##string}"
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse 
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
+# or super classes. Setting the tag to NO turns the diagrams off. Note that 
+# this option is superseded by the HAVE_DOT option below. This is only a 
+# fallback. It is recommended to install and use dot, since it yields more 
+# powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc 
+# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to 
+# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to 
+# specify the directory where the mscgen tool resides. If left empty the tool is assumed to 
+# be found in the default search path.
+
+MSCGEN_PATH            = 
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = NO
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = YES
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a call dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable call graphs for selected 
+# functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a caller dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable caller graphs for selected 
+# functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
+# then doxygen will show the dependencies a directory has on other directories 
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
+# nodes that will be shown in the graph. If the number of nodes in a graph 
+# becomes larger than this value, doxygen will truncate the graph, which is 
+# visualized by representing a node as a red box. Note that doxygen will always 
+# show the root nodes and its direct children regardless of this setting.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
+# background. This is disabled by default, which results in a white background. 
+# Warning: Depending on the platform used, enabling this option may lead to 
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to 
+# read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
+# files in one run (i.e. multiple -o and -T options on the command line). This 
+# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiaccelerator_plat/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Includes all the Domain API specific bld.inf files, which 
+*                export files.
+*
+*/
+
+
+
+#include <bldvariant.hrh>
+
+#include "../alf_core_toolkit_api/group/bld.inf"
+#include "../alf_visual_api/group/bld.inf"
+#include "../alf_extended_visual_api/group/bld.inf"
+#include "../alf_extension_api/group/bld.inf"
+#include "../alf_tracing_api/group/bld.inf"
+#include "../alf_client_server_api/group/bld.inf"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Build information file for UI Accelerator Toolkit 
+*
+*/
+
+
+#include <bldvariant.hrh>
+#include <platform_paths.hrh>
+
+#include "../hitchcock/group/bld.inf"
+
+PRJ_EXPORTS
+../hitchcock/sis/uiaccelerator_stub.sis    /epoc32/release/armv5/urel/uiaccelerator_stub.sis
+../../rom/alfred.iby   CORE_MW_LAYER_IBY_EXPORT_PATH(alfred.iby)
+../../rom/alftranseffectplugin.iby   CORE_MW_LAYER_IBY_EXPORT_PATH(alftranseffectplugin.iby)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfCommandDebug/bwins/alfcommanddebugu.def	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,21 @@
+EXPORTS
+	?SetPoint@CAlfCommandDebug@@QAEXABVTPoint@@@Z @ 1 NONAME ; void CAlfCommandDebug::SetPoint(class TPoint const &)
+	?Print@CAlfCommandDebug@@QAEXXZ @ 2 NONAME ; void CAlfCommandDebug::Print(void)
+	?TrackProcess@CAlfCommandDebug@@QAEHPAVHBufC16@@@Z @ 3 NONAME ; int CAlfCommandDebug::TrackProcess(class HBufC16 *)
+	?SetRegion@CAlfCommandDebug@@QAEXABVTRegion@@@Z @ 4 NONAME ; void CAlfCommandDebug::SetRegion(class TRegion const &)
+	?NewL@CAlfCommandDebug@@SAPAV1@XZ @ 5 NONAME ; class CAlfCommandDebug * CAlfCommandDebug::NewL(void)
+	?SetRect@CAlfCommandDebug@@QAEXABVTRect@@@Z @ 6 NONAME ; void CAlfCommandDebug::SetRect(class TRect const &)
+	??1CAlfCommandDebug@@UAE@XZ @ 7 NONAME ; CAlfCommandDebug::~CAlfCommandDebug(void)
+	?StartFrame@CAlfCommandDebug@@QAEXXZ @ 8 NONAME ; void CAlfCommandDebug::StartFrame(void)
+	?WServClientFileName@CAlfCommandDebug@@QAE?AV?$TBuf@$0BAA@@@HAAVRWsSession@@@Z @ 9 NONAME ; class TBuf<256> CAlfCommandDebug::WServClientFileName(int, class RWsSession &)
+	?SetHandle@CAlfCommandDebug@@QAEXABH@Z @ 10 NONAME ; void CAlfCommandDebug::SetHandle(int const &)
+	?SetDescription@CAlfCommandDebug@@QAEXABEH@Z @ 11 NONAME ; void CAlfCommandDebug::SetDescription(unsigned char const &, int)
+	?SetColor@CAlfCommandDebug@@QAEXAAVTRgb@@@Z @ 12 NONAME ; void CAlfCommandDebug::SetColor(class TRgb &)
+	?SetPrint@CAlfCommandDebug@@QAEXH@Z @ 13 NONAME ; void CAlfCommandDebug::SetPrint(int)
+	?AdjustCommand@CAlfCommandDebug@@QAEXABEH@Z @ 14 NONAME ; void CAlfCommandDebug::AdjustCommand(unsigned char const &, int)
+	?PrintStatistic@CAlfCommandDebug@@QAEXXZ @ 15 NONAME ; void CAlfCommandDebug::PrintStatistic(void)
+	?SetText@CAlfCommandDebug@@QAEXAAVTPtr16@@@Z @ 16 NONAME ; void CAlfCommandDebug::SetText(class TPtr16 &)
+	?EndFrame@CAlfCommandDebug@@QAEXXZ @ 17 NONAME ; void CAlfCommandDebug::EndFrame(void)
+	?SetDescriptionAndSize@CAlfCommandDebug@@QAEXABEABHH@Z @ 18 NONAME ; void CAlfCommandDebug::SetDescriptionAndSize(unsigned char const &, int const &, int)
+	?Text@CAlfCommandDebug@@QAEAAVTDesC16@@XZ @ 19 NONAME ; class TDesC16 & CAlfCommandDebug::Text(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfCommandDebug/eabi/alfcommanddebugu.def	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,23 @@
+EXPORTS
+	_ZN16CAlfCommandDebug10StartFrameEv @ 1 NONAME
+	_ZN16CAlfCommandDebug12TrackProcessEP7HBufC16 @ 2 NONAME
+	_ZN16CAlfCommandDebug13AdjustCommandERKhi @ 3 NONAME
+	_ZN16CAlfCommandDebug14PrintStatisticEv @ 4 NONAME
+	_ZN16CAlfCommandDebug14SetDescriptionERKhi @ 5 NONAME
+	_ZN16CAlfCommandDebug19WServClientFileNameEiR10RWsSession @ 6 NONAME
+	_ZN16CAlfCommandDebug21SetDescriptionAndSizeERKhRKii @ 7 NONAME
+	_ZN16CAlfCommandDebug4NewLEv @ 8 NONAME
+	_ZN16CAlfCommandDebug4TextEv @ 9 NONAME
+	_ZN16CAlfCommandDebug5PrintEv @ 10 NONAME
+	_ZN16CAlfCommandDebug7SetRectERK5TRect @ 11 NONAME
+	_ZN16CAlfCommandDebug7SetTextER6TPtr16 @ 12 NONAME
+	_ZN16CAlfCommandDebug8EndFrameEv @ 13 NONAME
+	_ZN16CAlfCommandDebug8SetColorER4TRgb @ 14 NONAME
+	_ZN16CAlfCommandDebug8SetPointERK6TPoint @ 15 NONAME
+	_ZN16CAlfCommandDebug8SetPrintEi @ 16 NONAME
+	_ZN16CAlfCommandDebug9SetHandleERKi @ 17 NONAME
+	_ZN16CAlfCommandDebug9SetRegionERK7TRegion @ 18 NONAME
+	_ZN16CAlfCommandDebugD0Ev @ 19 NONAME
+	_ZN16CAlfCommandDebugD1Ev @ 20 NONAME
+	_ZN16CAlfCommandDebugD2Ev @ 21 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfCommandDebug/group/alfcommanddebug.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* 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:   Project definition file for project alfcommanddebug
+*
+*/
+
+// Uncomment in lines alfcommanddebug.dll and alfcommanddescriptions.rsg in alfred.iby when using this in rom image. 
+
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+#include <platform_paths.hrh>
+
+TARGETTYPE DLL
+TARGET alfcommanddebug.dll
+
+UID 0 0x20022F32
+
+SYSTEMINCLUDE /epoc32/include 
+SYSTEMINCLUDE ../../CommonInc
+
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH ../src
+SOURCE alfcommanddebug.cpp
+
+CAPABILITY              CAP_GENERAL_DLL
+VENDORID                VID_DEFAULT
+
+SOURCEPATH      ../group
+START RESOURCE alfcommanddescriptions.rss
+HEADER
+TARGETPATH ECOM_RESOURCE_DIR
+END
+
+
+LIBRARY     euser.lib
+LIBRARY     bafl.lib
+LIBRARY     commonengine.lib        // Resource loader
+LIBRARY     efsrv.lib
+LIBRARY     flogger.lib
+LIBRARY     ws32.lib 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfCommandDebug/group/alfcommanddescriptions.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,789 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Resource definitions for project ?myapp
+ *
+*/
+
+
+
+NAME ALFR
+
+#include <eikon.rh>
+#include <avkon.rh>
+#include <avkon.rsg>
+#include <huiwscanvascommands.h>
+#include <alfbridgecommands.h>
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+// ---------------------------------------------------------------------------
+// ?resource_name
+// ?description
+// ---------------------------------------------------------------------------
+//
+STRUCT ALF_COMMAND_DESCRIPTIONS_ARRAY
+    {
+    STRUCT alf_command_description[];
+    }
+
+// ---------------------------------------------------------------------------
+// ?resource_name
+// ?description
+// ---------------------------------------------------------------------------
+//
+STRUCT ALF_COMMAND_DESCRIPTION
+    {
+    BYTE command = 0;
+    LTEXT description;
+    }
+
+// ---------------------------------------------------------------------------
+// r_alf_command_description_array
+// Contains names enums in TSgcCanvasCommands (huiwscanvascommands.h)
+// ---------------------------------------------------------------------------
+//
+RESOURCE ALF_COMMAND_DESCRIPTIONS_ARRAY r_alf_command_description_array
+    {
+    alf_command_description = 
+    {
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSendSyncDataBlock;
+                description = "EAlfSendSyncDataBlock";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawCommandsStart;
+                description = "EAlfDrawCommandsStart";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfCommandEndMarker;
+                description = "EAlfCommandEndMarker";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSendEndMarker;
+                description = "EAlfSendEndMarker";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfBitBlt;
+                description = "EAlfBitBlt";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfBitBltRect;
+                description = "EAlfBitBltRect";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfBitBltMasked;
+                description = "EAlfBitBltMasked";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfBitBltMaskedPoint;
+                description = "EAlfBitBltMaskedPoint";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfCombinedBitBlitMasked;
+                description = "EAlfCombinedBitBlitMasked";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfResetClippingRegion;
+                description = "EAlfResetClippingRegion";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfClear;
+                description = "EAlfClear";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfClearRect;
+                description = "EAlfClearRect";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfResetBrushPattern;
+                description = "EAlfResetBrushPattern";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfResetFont;
+                description = "EAlfResetFont";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawArc;
+                description = "EAlfDrawArc";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawPie;
+                description = "EAlfDrawPie";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawBitmap1;
+                description = "EAlfDrawBitmap1";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawBitmap2;
+                description = "EAlfDrawBitmap2";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawBitmap3;
+                description = "EAlfDrawBitmap3";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawBitmapMasked;
+                description = "EAlfDrawBitmapMasked";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawRoundRect;
+                description = "EAlfDrawRoundRect";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawPolyLine;
+                description = "EAlfDrawPolyLine";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawPolyLineNoEndPoint;
+                description = "EAlfDrawPolyLineNoEndPoint";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawPolygon;
+                description = "EAlfDrawPolygon";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawEllipse;
+                description = "EAlfDrawEllipse";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawLine;
+                description = "EAlfDrawLine";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawLineTo;
+                description = "EAlfDrawLineTo";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawLineBy;
+                description = "EAlfDrawLineBy";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawRect;
+                description = "EAlfDrawRect";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawText1;
+                description = "EAlfDrawText1";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawText2;
+                description = "EAlfDrawText2";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawText3;
+                description = "EAlfDrawText3";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawText4;
+                description = "EAlfDrawText4";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawText5;
+                description = "EAlfDrawText5";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawTextVertical1;
+                description = "EAlfDrawTextVertical1";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawTextVertical2;
+                description = "EAlfDrawTextVertical2";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawTextVertical3;
+                description = "EAlfDrawTextVertical3";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawTextVertical4;
+                description = "EAlfDrawTextVertical4";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawTextVertical5;
+                description = "EAlfDrawTextVertical5";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfMoveTo;
+                description = "EAlfMoveTo";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfMoveBy;
+                description = "EAlfMoveBy";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfPlot;
+                description = "EAlfPlot";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfReset;
+                description = "EAlfReset";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetBrushColor;
+                description = "EAlfSetBrushColor";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetBrushColor;
+                description = "EAlfSetBrushColor";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetBrushOrigin;
+                description = "EAlfSetBrushOrigin";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetBrushStyle;
+                description = "EAlfSetBrushStyle";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetClippingRegion;
+                description = "EAlfSetClippingRegion";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetDrawMode;
+                description = "EAlfSetDrawMode";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetOrigin;
+                description = "EAlfSetOrigin";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetPenColor;
+                description = "EAlfSetPenColor";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetPenStyle;
+                description = "EAlfSetPenStyle";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetPenSize;
+                description = "EAlfSetPenSize";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetTextShadowColor;
+                description = "EAlfSetTextShadowColor";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetCharJustification;
+                description = "EAlfSetCharJustification";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetWordJustification;
+                description = "EAlfSetWordJustification";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetUnderlineStyle;
+                description = "EAlfSetUnderlineStyle";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetStrikethroughStyle;
+                description = "EAlfSetStrikethroughStyle";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetBrushPattern;
+                description = "EAlfSetBrushPattern";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetBrushPattern2;
+                description = "EAlfSetBrushPattern2";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetFont;
+                description = "EAlfSetFont";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfCopyRect;
+                description = "EAlfCopyRect";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfUpdateJustification;
+                description = "EAlfUpdateJustification";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfUpdateJustificationVertical;
+                description = "EAlfUpdateJustificationVertical";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawRoundRect;
+                description = "EAlfDrawRoundRect";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetFontNoDuplicate;
+                description = "EAlfSetFontNoDuplicate";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfHasBrushPattern;
+                description = "EAlfHasBrushPattern";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfHasFont;
+                description = "EAlfHasFont";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfBrushColor;
+                description = "EAlfBrushColor";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfPenColor;
+                description = "EAlfPenColor";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfTextShadowColor;
+                description = "EAlfTextShadowColor";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfCopySettings;
+                description = "EAlfCopySettings";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetClippingRect;
+                description = "EAlfSetClippingRect";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfCancelClippingRect;
+                description = "EAlfCancelClippingRect";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetFaded;
+                description = "EAlfSetFaded";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetFadingParameters;
+                description = "EAlfSetFadingParameters";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfFadeArea;
+                description = "EAlfFadeArea";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfMapColors;
+                description = "EAlfMapColors";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetUserDisplayMode;
+                description = "EAlfSetUserDisplayMode";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfUseFont;
+                description = "EAlfUseFont";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetUpdateRegion;
+                description = "EAlfSetUpdateRegion";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfPacketReady;
+                description = "EAlfPacketReady";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfPacketNotReady;
+                description = "EAlfPacketNotReady";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfPacketPadding;
+                description = "EAlfPacketPadding";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDrawCommandsEnd;
+                description = "EAlfDrawCommandsEnd";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetWindowId;
+                description = "EAlfSetWindowId";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfWindowInactivateWindow;
+                description = "EAlfWindowInactivateWindow";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfWrap;
+                description = "EAlfWrap";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetShapeRegion;
+                description = "EAlfSetShapeRegion";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfSetExtent;
+                description = "EAlfSetExtent";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfNodeCreated;
+                description = "EAlfNodeCreated";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfNodeReleased;
+                description = "EAlfNodeReleased";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfNodeActivated;
+                description = "EAlfNodeActivated";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfNodeExtentChanged;
+                description = "EAlfNodeExtentChanged";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfNodeSiblingOrderChanged;
+                description = "EAlfNodeSiblingOrderChanged";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfNodeFlagChanged;
+                description = "EAlfNodeFlagChanged";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfNodeAttributeChanged;
+                description = "EAlfNodeAttributeChanged";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfNodeFadeCountChanged;
+                description = "EAlfNodeFadeCountChanged";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfNodeTransparentRegionChanged;
+                description = "EAlfNodeTransparentRegionChanged";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfNodeLayerAdded;
+                description = "EAlfNodeLayerAdded";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfNodeMovedToWindowGroup;
+                description = "EAlfNodeMovedToWindowGroup";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfNodeWindowGroupChained;
+                description = "EAlfNodeWindowGroupChained";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfNodeWindowGroupChainBrokenAfter;
+                description = "EAlfNodeWindowGroupChainBrokenAfter";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfCommandNotInitialized;
+                description = "EAlfCommandNotInitialized";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfCommitBatch;
+                description = "EAlfCommitBatch";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfFrameContainsUnsupportedCommands;
+                description = "EAlfFrameContainsUnsupportedCommands";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDebugTrackNode;
+                description = "EAlfDebugTrackNode";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfNodeLayerExtentChanged;
+                description = "EAlfNodeLayerExtentChanged";
+                }    
+     };
+    }
+
+// ---------------------------------------------------------------------------
+// r_alf_bridge_command_description_array
+// Contains names enums in TAlfDecoderServerBindings (alfbridgecommands.h)
+// ---------------------------------------------------------------------------
+//    
+RESOURCE ALF_COMMAND_DESCRIPTIONS_ARRAY r_alf_bridge_command_description_array
+    {
+    alf_command_description = 
+            {
+            
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSNewWindow;
+                description = "EAlfDSNewWindow";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSDestroyWindow;
+                description = "EAlfDSDestroyWindow";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSSetWindowPos;
+                description = "EAlfDSSetWindowPos";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSSetWindowSize;
+                description = "EAlfDSSetWindowSize";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSSetWindowRotation;
+                description = "EAlfDSSetWindowRotation";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSSetWindowOpacity;
+                description = "EAlfDSSetWindowOpacity";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSRefreshCallback;
+                description = "EAlfDSRefreshCallback";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDsUpdateTexture;
+                description = "EAlfDsUpdateTexture";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSReorder;
+                description = "EAlfDSReorder";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSSetWindowActive;
+                description = "EAlfDSSetWindowActive";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSPostCanvasBuffer;
+                description = "EAlfDSPostCanvasBuffer";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSSetCursorData;
+                description = "EAlfDSSetCursorData";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSSetSurfaceExtent;
+                description = "EAlfDSSetSurfaceExtent";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSGroupChained;
+                description = "EAlfDSGroupChained";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSGroupChainBroken;
+                description = "EAlfDSGroupChainBroken";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSMoveWindowToNewGroup;
+                description = "EAlfDSMoveWindowToNewGroup";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSCreateNewDisplay;
+                description = "EAlfDSCreateNewDisplay";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSDestroyDisplay;
+                description = "EAlfDSDestroyDisplay";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSRequestCommandsStart;
+                description = "EAlfDSRequestCommandsStart";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfRequestWrap;
+                description = "EAlfRequestWrap";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSSetNodeTracking;
+                description = "EAlfDSSetNodeTracking";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfRequestCommitBatch;
+                description = "EAlfRequestCommitBatch";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfRequestCommandReadNotification;
+                description = "EAlfRequestCommandReadNotification";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSRequestCommandsEnd;
+                description = "EAlfDSRequestCommandsEnd";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSRequestCommandsStart;
+                description = "EAlfDSRequestCommandsStart";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSGetAlfNativeWindowData;
+                description = "EAlfDSGetAlfNativeWindowData";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSGetCommandsEnd;
+                description = "EAlfDSGetCommandsEnd";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfEffectFx;
+                description = "EAlfEffectFx";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfStopEffectFx;
+                description = "EAlfStopEffectFx";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfControlEffectFx;
+                description = "EAlfControlEffectFx";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSSetCapturingBitmap;
+                description = "EAlfDSSetCapturingBitmap";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfDSSetCoveringBitmap;
+                description = "EAlfDSSetCoveringBitmap";
+                },
+            ALF_COMMAND_DESCRIPTION
+                {
+                command = EAlfReleaseTemporaryChunk;
+                description = "EAlfReleaseTemporaryChunk";
+                },
+	        ALF_COMMAND_DESCRIPTION
+                {
+                command = KUnInitialized;
+                description = "KUnInitialized";
+                }
+           };
+    }
+        
+
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfCommandDebug/src/alfcommanddebug.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,509 @@
+/* 
+ * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:   Help class for debugging/optimizing the command stream. 
+ *                This is file is not compiled by default. Enable flag 
+ *                _ALF_PRINT_WS_COMMANDS_ in alfrenderstageplugin.mmp in order
+ *                to use it.
+ *              
+ *                 SEE USAGE INSTRUCTIONS IN ALRCOMMANDDEBUG.H 
+ */
+#include <e32def.h>
+#include <barsread.h>
+#include <barsc.h>
+#include <ConeResLoader.h>
+#include <s32mem.h> // RDesWriteStream
+#include <alflogger.h> 
+#include <huiwscanvascommands.h>
+#include "alfcommanddebug.h"
+#include <data_caging_path_literals.hrh>
+#include <alfcommanddescriptions.rsg>    
+#include <gdi.h>
+#include <uiacceltk/HuiStatic.h>
+
+_LIT( KRendererCommandDescriptions,"alfcommanddescriptions.rsc" );
+
+// ---------------------------------------------------------------------------
+// ReadCommandDescriptionsL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfCommandDebug* CAlfCommandDebug::NewL()
+    {
+    CAlfCommandDebug* self = new (ELeave) CAlfCommandDebug;
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfCommandDebug::ConstructL()
+    {
+    iCommandDescriptions = new (ELeave) RHashMap<TUint32, TCommand> ;
+    iBridgeCommandDescriptions = new (ELeave) RHashMap<TUint32, TCommand> ;
+    ReadCommandDescriptionsL( iCommandDescriptions, R_ALF_COMMAND_DESCRIPTION_ARRAY );
+    ReadCommandDescriptionsL( iBridgeCommandDescriptions, R_ALF_BRIDGE_COMMAND_DESCRIPTION_ARRAY );
+    
+    // TODO: define only exe name, TrackProcess can do the parsing
+#ifdef __WINSCW__
+    _LIT( KTrackThisProcess, "Z:\\sys\\bin\\matrixmenu.exe");
+#else
+    _LIT( KTrackThisProcess, "C:\\sys\\bin\\matrixmenu.exe");
+#endif
+    iTrackedProcess.Copy( KTrackThisProcess );
+    
+	// iMode = EPrintOnlyCommands;
+    iMode = EPrintCommandParameters; 
+    // iMode = EPrintSummary;
+    //iMode = EPrintStatisticsForLargeBuffers;
+     
+    switch( iMode )
+        {
+        default:  // 0
+            {
+            iPrint = EFalse; 
+            break;
+            }
+        case EPrintCommandParameters:
+            {
+            iPrintColors = ETrue;
+            iPrintRegions  = ETrue;
+            iPrintRects = ETrue;
+            iPrintPoints = ETrue;
+            iPrintHandles = ETrue;
+            iPrintTexts = ETrue;
+            iPrint = ETrue;
+            break;
+            }
+        case EPrintOnlyCommands:
+            {
+            iPrint = ETrue;
+            break;
+            }
+        case EPrintStatistics:
+            {
+            iPrintStatistics = ETrue;
+            iLargeBufferDefinition = 0;
+            break;
+            }
+        case EPrintStatisticsForLargeBuffers:
+            {
+            iPrintStatistics = ETrue;
+            iLargeBufferDefinition = 1500;
+            break;
+            }
+        case EPrintSummary:
+            {
+            iPrintSummary = ETrue;
+            iLargeBufferDefinition = 0;
+            break;
+            }
+                
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ReadCommandDescriptionsL
+// ---------------------------------------------------------------------------
+//
+void CAlfCommandDebug::ReadCommandDescriptionsL( RHashMap<TUint32,TCommand>* aDescriptionArray, TInt aId )
+    {
+    // Read unsupported command resource
+    RFs fs;
+    User::LeaveIfError(fs.Connect());
+    CleanupClosePushL(fs);
+    RResourceFile resFile;
+    TInt result;
+
+    TFileName resourceFileName;
+    TPtrC driveLetter = TParsePtrC(RProcess().FileName()).Drive();
+    resourceFileName.Copy(driveLetter);
+    resourceFileName.Append(KDC_ECOM_RESOURCE_DIR);
+    resourceFileName.Append(KRendererCommandDescriptions);
+
+    TRAP( result, resFile.OpenL(fs,resourceFileName); );
+    if (result == KErrNone)
+        {
+        CleanupClosePushL(resFile);
+        resFile.ConfirmSignatureL(0); // offset value.
+        TInt resId = aId;
+
+        HBufC8* readData = resFile.AllocReadL(resId);
+        // now first get rid of RResourceFile and RFs as they are not needed any more
+        CleanupStack::PopAndDestroy(); // resFile
+        CleanupStack::PopAndDestroy(); // fs
+        CleanupStack::PushL(readData);
+
+        // now parse it and store the values in cmdTextArray
+        TResourceReader reader;
+        reader.SetBuffer(readData);
+        const TInt count = reader.ReadInt16();
+        TInt8 commandId;
+        for (TInt i = 0; i < count; i++)
+            {
+            commandId = reader.ReadInt8();
+            TCommand command;
+            command.iDescription = reader.ReadHBufC16L();
+
+            aDescriptionArray->Insert(commandId, command);
+            }
+        CleanupStack::PopAndDestroy(readData);
+        }
+    else
+        {
+        __ALFLOGSTRING1("CAlfRsSendBuffer::ConstructL - WARNING! Failed to read unsupported commands from resource file: %S! Error code:st %d.", &resourceFileName );
+        CleanupStack::PopAndDestroy(); // fs
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SetHandle
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCommandDebug::SetHandle( const TInt& aHandle )
+    {
+    if (!iPrintHandles )
+        {
+        return;
+        }
+    iText.AppendFormat( _L("Handle: [%d] "), aHandle );
+    }
+
+// ---------------------------------------------------------------------------
+// SetPoint
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCommandDebug::SetPoint( const TPoint& aPoint )
+    {
+    if (!iPrintPoints )
+        {
+        return;
+        }
+    iText.AppendFormat( _L("Point: (%d,%d) "), aPoint.iX, aPoint.iY );
+    }
+
+// ---------------------------------------------------------------------------
+// SetRect
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCommandDebug::SetRect( const TRect& aRect )
+    {
+    if (!iPrintRects )
+        {
+        return;
+        }
+    iText.AppendFormat( _L("Rect: (%d,%d)-(%d,%d) "), aRect.iTl.iX, aRect.iTl.iY, aRect.iBr.iX, aRect.iBr.iY );
+    }
+
+// ---------------------------------------------------------------------------
+// SetRegion
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCommandDebug::SetRegion( const TRegion& aRegion)
+    {
+    _LIT( KDescRegion, "Region of %d");
+    if (!iPrintRegions )
+        {
+        return;
+        }
+    /*if ( iText.MaxLength() < iText.Length() + KDescRegion->Length() )
+        {
+        return;
+        }*/
+    iText.AppendFormat( KDescRegion, aRegion.Count() );
+    for( TInt i = 0; i < aRegion.Count() ; i++ )
+        {
+        TRect rect = aRegion[i];
+        iText.AppendFormat( _L("[%d]: Rect: (%d,%d)-(%d,%d) "), i, rect.iTl.iX, rect.iTl.iY, rect.iBr.iX, rect.iBr.iY );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SetRegion
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCommandDebug::SetText( TPtr& aText )
+    {
+    if (!iPrintTexts )
+        {
+        return;
+        }
+    iText.AppendFormat( _L("Text: [%S] "), &aText );
+    }
+
+// ---------------------------------------------------------------------------
+// SetColor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCommandDebug::SetColor( TRgb& aColor )
+    {
+    if (!iPrintColors )
+        {
+        return;
+        }
+    iText.AppendFormat( _L("Color: R[%d]G[%d]B[%d] A[%d] "), aColor.Red(), aColor.Green(), aColor.Blue(), aColor.Alpha() );
+    }
+
+// ---------------------------------------------------------------------------
+// Print
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCommandDebug::Print()
+    {
+    if ( iPrint )
+        {
+        RDebug::Print(_L("%S"), &iText );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// AdjustCommand
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCommandDebug::SetDescription(const TUint8& aCommand, TInt aDescriptionList )
+    {
+    TInt32 commandId = aCommand;
+    TCommand* command = NULL;
+
+    if ( aDescriptionList == R_ALF_COMMAND_DESCRIPTION_ARRAY )
+        {
+        command = iCommandDescriptions->Find(commandId);
+        }
+    else
+        {
+        // assuming, aDescriptionList is R_ALF_BRIDGE_COMMAND_DESCRIPTION_ARRAY
+        command = iBridgeCommandDescriptions->Find(commandId);
+        }
+     iTotalCmdCount++;
+
+     if (command )
+            {
+            HBufC16* buf = command->iDescription;
+            iText.Format( _L("Cmd: %S - "), buf );
+            }
+        else
+            {
+            iText.Format( _L("Cmd: %d - "), aCommand );
+            }
+    }
+// ---------------------------------------------------------------------------
+// PrintDescription
+//
+// Note, you can enable/disable command at run-time in debugger by modifying 
+// printCommands variable.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCommandDebug::SetDescriptionAndSize(const TUint8& aCommand,
+        const TInt& aParametersSize, TInt aDescriptionList )
+    {
+    TInt32 commandId = aCommand;
+    TCommand* command = NULL;
+
+    if ( aDescriptionList == R_ALF_COMMAND_DESCRIPTION_ARRAY )
+          {
+          command = iCommandDescriptions->Find(commandId);
+          }
+      else
+          {
+          // assuming, aDescriptionList is R_ALF_BRIDGE_COMMAND_DESCRIPTION_ARRAY
+          command = iBridgeCommandDescriptions->Find(commandId);
+          }
+      
+    if ( command )
+    	{
+		command->iCount++;
+		command->iSize = sizeof(TUint8) + aParametersSize;
+		iTotalCmdSize += command->iSize;
+    	}
+    iTotalCmdCount++;
+    
+    if ( !iPrint )
+        {
+        // empty the string. Otherwise parameters start piling up to iText
+        iText.Format(_L("")); 
+        return;
+        }
+    
+    if (command)
+        {
+        HBufC16* buf = command->iDescription;
+        iText.Format( _L("Cmd: %S (%d/Size: %d) "), buf, aCommand, command->iSize );
+        }
+    else
+        {
+        iText.Format( _L("Cmd: %d"), aCommand );
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+// AdjustCommand
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCommandDebug::AdjustCommand(const TUint8& aCommand,
+        TInt aAdjustment)
+    {
+    TCommand* command = NULL;
+
+    command = iCommandDescriptions->Find(aCommand);
+
+    if (command)
+        {
+        command->iCount--;
+
+        iTotalCmdCount--;
+        iTotalCmdSize += aAdjustment;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// StartFrame
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCommandDebug::StartFrame()
+    {
+    // clear statistics
+    for (TInt i = 0; i < EAlfLastCommand; i++)
+        {
+        TCommand* command = iCommandDescriptions->Find(i);
+        if (command)
+            {
+            command->iCount = 0;
+            }
+        }
+    iTotalCmdCount = 0;
+    iTotalCmdSize = 0;
+
+    }
+
+// ---------------------------------------------------------------------------
+// EndFrame
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCommandDebug::EndFrame()
+    {
+    if (iPrintSummary)
+        {
+        RDebug::Print(_L("CAlfCommandDebug::EndFrame, Commands: %d, Size %d"), 
+                iTotalCmdCount,
+                iTotalCmdSize );
+                
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// PrintStatistic
+//
+// Note, you can enable iPrintStatistics at run-time in debugger  
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCommandDebug::PrintStatistic()
+    {
+    if (iPrintStatistics && iTotalCmdSize > iLargeBufferDefinition )
+        {
+        for (TInt i = 0; i < EAlfLastCommand; i++)
+            {
+            TCommand* command = iCommandDescriptions->Find(i);
+            if (command)
+                {
+                TInt totalSize = command->iCount * command->iSize;
+                RDebug::Print(
+                        _L("Cmd: %S - Count: %d - Size: %d (%d)"), command->iDescription,
+                        command->iCount, totalSize, command->iSize);
+                }
+            }
+        iFrameTotalSize += iTotalCmdSize;
+        iFrameCount++;
+        TInt averageFrame = iFrameTotalSize / iFrameCount;
+        RDebug::Print(_L("Total, Count: %d, Size %d (average: %d)"), iTotalCmdCount,
+                iTotalCmdSize, averageFrame);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SetPrint
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCommandDebug::SetPrint( TBool aPrint )
+    {
+    iPrint = aPrint;
+    }
+
+// ---------------------------------------------------------------------------
+// destructor
+//
+// Note, you can enable iPrintStatistics at run-time in debugger  
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfCommandDebug::~CAlfCommandDebug()
+    {
+    delete iCommandDescriptions;
+    }
+
+// ---------------------------------------------------------------------------
+// DebugPrintControlGroupOrder
+// Can be used only from CAlfBridge
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TFileName CAlfCommandDebug::WServClientFileName( TInt aClientWindowGroupId, RWsSession& aSession )
+    {
+    
+    TFileName processName;
+    if( aClientWindowGroupId != KErrNotFound || aClientWindowGroupId != 0 )
+        {
+        TThreadId threadId;
+        TInt error = aSession.GetWindowGroupClientThreadId( aClientWindowGroupId, threadId );
+        if( error )
+            {
+            }
+        else
+            {
+            RThread thread;
+            TInt err = thread.Open( threadId );
+            if( !err )
+                {
+                RProcess process;
+                err = thread.Process( process );
+                if( !err )
+                    {
+                    processName = process.FileName();
+                    }
+                process.Close();
+                }
+            thread.Close();
+            }
+        }        
+    return processName;
+    }
+
+// ---------------------------------------------------------------------------
+// TrackProcess
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TBool CAlfCommandDebug::TrackProcess( HBufC16* aFileName )
+    {
+    // this is separate function to allow in the future tracking of multiple processes
+    return aFileName->Compare( iTrackedProcess ) == 0;
+    }
+
+// ---------------------------------------------------------------------------
+// Text
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TDesC16& CAlfCommandDebug::Text()
+    {
+    return iText;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfDecoderServerClient/bwins/alfdecoderserverclientu.def	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,43 @@
+EXPORTS
+	?CancelAsynchronousData@RAlfTfxClient@@QAEXABVTUid@@H@Z @ 1 NONAME ; void RAlfTfxClient::CancelAsynchronousData(class TUid const &, int)
+	?LoadTfxPlugin@RAlfTfxClient@@QAEHABVTUid@@@Z @ 2 NONAME ; int RAlfTfxClient::LoadTfxPlugin(class TUid const &)
+	?Open@RAlfTfxClient@@QAEHXZ @ 3 NONAME ; int RAlfTfxClient::Open(void)
+	?SendAsynchronousData@RAlfTfxClient@@QAEXABVTUid@@ABVTDesC8@@AAVTDes8@@AAVTRequestStatus@@@Z @ 4 NONAME ; void RAlfTfxClient::SendAsynchronousData(class TUid const &, class TDesC8 const &, class TDes8 &, class TRequestStatus &)
+	?SendSynchronousData@RAlfTfxClient@@QAEHABVTUid@@ABVTDesC8@@AAVTDes8@@@Z @ 5 NONAME ; int RAlfTfxClient::SendSynchronousData(class TUid const &, class TDesC8 const &, class TDes8 &)
+	?UnloadTfxPlugin@RAlfTfxClient@@QAEXABVTUid@@@Z @ 6 NONAME ; void RAlfTfxClient::UnloadTfxPlugin(class TUid const &)
+	?PrepareFrame@RAlfTfxClient@@QAEXI@Z @ 7 NONAME ; void RAlfTfxClient::PrepareFrame(unsigned int)
+	?Connect@RAlfBridgerClient@@QAEHXZ @ 8 NONAME ; int RAlfBridgerClient::Connect(void)
+	?SendSynch@RAlfBridgerClient@@QAEHHABVTDesC8@@@Z @ 9 NONAME ; int RAlfBridgerClient::SendSynch(int, class TDesC8 const &)
+	?SendSynch@RAlfBridgerClient@@QAEHHABVTIpcArgs@@@Z @ 10 NONAME ; int RAlfBridgerClient::SendSynch(int, class TIpcArgs const &)
+	?SendAsynchronous@RAlfBridgerClient@@QAEXHABVTIpcArgs@@AAVTRequestStatus@@@Z @ 11 NONAME ; void RAlfBridgerClient::SendAsynchronous(int, class TIpcArgs const &, class TRequestStatus &)
+	?SendBlind@RAlfBridgerClient@@QAEHHABVTIpcArgs@@@Z @ 12 NONAME ; int RAlfBridgerClient::SendBlind(int, class TIpcArgs const &)
+	?StartL@AlfServerStarter@@SAXAAVTRequestStatus@@H@Z @ 13 NONAME ; void AlfServerStarter::StartL(class TRequestStatus &, int)
+	?SetHandleL@CAlfCompositionClientBase@@IAEXH@Z @ 14 NONAME ; void CAlfCompositionClientBase::SetHandleL(int)
+	?SetZOrder@CAlfCompositionSource@@QAEHABVCAlfCompositionClientBase@@HH@Z @ 15 NONAME ; int CAlfCompositionSource::SetZOrder(class CAlfCompositionClientBase const &, int, int)
+	??1CAlfCompositionClientBase@@MAE@XZ @ 16 NONAME ; CAlfCompositionClientBase::~CAlfCompositionClientBase(void)
+	?HandleEventL@CAlfCompositionSource@@MAEXHPAX@Z @ 17 NONAME ; void CAlfCompositionSource::HandleEventL(int, void *)
+	?AddCompositionObserverL@CAlfCompositionSource@@QAEXAAVMAlfCompositionObserver@@H@Z @ 18 NONAME ; void CAlfCompositionSource::AddCompositionObserverL(class MAlfCompositionObserver &, int)
+	?SetRotation@CAlfCompositionSource@@UAEHH@Z @ 19 NONAME ; int CAlfCompositionSource::SetRotation(int)
+	?SetOpacity@CAlfCompositionSource@@UAEHM@Z @ 20 NONAME ; int CAlfCompositionSource::SetOpacity(float)
+	?NewL@CAlfCompositionCntrlClient@@SAPAV1@PAVRAlfBridgerClient@@PAVMAlfCompositionController@@@Z @ 21 NONAME ; class CAlfCompositionCntrlClient * CAlfCompositionCntrlClient::NewL(class RAlfBridgerClient *, class MAlfCompositionController *)
+	?RunError@CAlfCompositionClientBase@@MAEHH@Z @ 22 NONAME ; int CAlfCompositionClientBase::RunError(int)
+	?RequestEventL@CAlfCompositionClientBase@@IAEXHPAVRAlfBridgerClient@@@Z @ 23 NONAME ; void CAlfCompositionClientBase::RequestEventL(int, class RAlfBridgerClient *)
+	??1CAlfCompositionPixelSource@@UAE@XZ @ 24 NONAME ; CAlfCompositionPixelSource::~CAlfCompositionPixelSource(void)
+	?NewL@CAlfCompositionPixelSource@@SAPAV1@AAVMAlfBufferProvider@@PAVRWindow@@@Z @ 25 NONAME ; class CAlfCompositionPixelSource * CAlfCompositionPixelSource::NewL(class MAlfBufferProvider &, class RWindow *)
+	??1CAlfCompositionSource@@UAE@XZ @ 26 NONAME ; CAlfCompositionSource::~CAlfCompositionSource(void)
+	?Suspend@CAlfCompositionPixelSource@@QAEXXZ @ 27 NONAME ; void CAlfCompositionPixelSource::Suspend(void)
+	?SetExtent@CAlfCompositionPixelSource@@UAEHABVTRect@@H@Z @ 28 NONAME ; int CAlfCompositionPixelSource::SetExtent(class TRect const &, int)
+	?SetIsBackgroundAnim@CAlfCompositionSource@@UAEXH@Z @ 29 NONAME ; void CAlfCompositionSource::SetIsBackgroundAnim(int)
+	?EnableAlpha@CAlfCompositionSource@@UAEHH@Z @ 30 NONAME ; int CAlfCompositionSource::EnableAlpha(int)
+	?HandleEventL@CAlfCompositionClientBase@@MAEXHPAX@Z @ 31 NONAME ; void CAlfCompositionClientBase::HandleEventL(int, void *)
+	?CreatePermissionToken@CAlfCompositionSource@@QAEHHH@Z @ 32 NONAME ; int CAlfCompositionSource::CreatePermissionToken(int, int)
+	?EnableKeyboard@CAlfCompositionSource@@QAEXHH@Z @ 33 NONAME ; void CAlfCompositionSource::EnableKeyboard(int, int)
+	?RemoveObserver@CAlfCompositionSource@@QAEXAAVMAlfCompositionObserver@@@Z @ 34 NONAME ; void CAlfCompositionSource::RemoveObserver(class MAlfCompositionObserver &)
+	?NewL@CAlfCompositionHost@@SAPAV1@HH@Z @ 35 NONAME ; class CAlfCompositionHost * CAlfCompositionHost::NewL(int, int)
+	?ActivateL@CAlfCompositionPixelSource@@QAEXXZ @ 36 NONAME ; void CAlfCompositionPixelSource::ActivateL(void)
+	?SetExtent@CAlfCompositionSource@@UAEHABVTRect@@H@Z @ 37 NONAME ; int CAlfCompositionSource::SetExtent(class TRect const &, int)
+	?NewL@CAlfCompositionSource@@SAPAV1@AAVRWindow@@@Z @ 38 NONAME ; class CAlfCompositionSource * CAlfCompositionSource::NewL(class RWindow &)
+	?SendEvent@CAlfCompositionClientBase@@IAEHHPBXH@Z @ 39 NONAME ; int CAlfCompositionClientBase::SendEvent(int, void const *, int)
+	??1CAlfCompositionCntrlClient@@UAE@XZ @ 40 NONAME ; CAlfCompositionCntrlClient::~CAlfCompositionCntrlClient(void)
+	?SetSourceRect@CAlfCompositionSource@@UAEHABVTRect@@@Z @ 41 NONAME ; int CAlfCompositionSource::SetSourceRect(class TRect const &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfDecoderServerClient/eabi/alfdecoderserverclientu.def	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,64 @@
+EXPORTS
+	_ZN13RAlfTfxClient13LoadTfxPluginERK4TUid @ 1 NONAME
+	_ZN13RAlfTfxClient15UnloadTfxPluginERK4TUid @ 2 NONAME
+	_ZN13RAlfTfxClient19SendSynchronousDataERK4TUidRK6TDesC8R5TDes8 @ 3 NONAME
+	_ZN13RAlfTfxClient20SendAsynchronousDataERK4TUidRK6TDesC8R5TDes8R14TRequestStatus @ 4 NONAME
+	_ZN13RAlfTfxClient22CancelAsynchronousDataERK4TUidi @ 5 NONAME
+	_ZN13RAlfTfxClient4OpenEv @ 6 NONAME
+	_ZN13RAlfTfxClient12PrepareFrameEj @ 7 NONAME
+	_ZN17RAlfBridgerClient7ConnectEv @ 8 NONAME
+	_ZN17RAlfBridgerClient9SendSynchEiRK6TDesC8 @ 9 NONAME
+	_ZN17RAlfBridgerClient9SendSynchEiRK8TIpcArgs @ 10 NONAME
+	_ZN17RAlfBridgerClient16SendAsynchronousEiRK8TIpcArgsR14TRequestStatus @ 11 NONAME
+	_ZN17RAlfBridgerClient9SendBlindEiRK8TIpcArgs @ 12 NONAME
+	_ZN16AlfServerStarter6StartLER14TRequestStatusi @ 13 NONAME
+	_ZN19CAlfCompositionHost4NewLEii @ 14 NONAME
+	_ZN21CAlfCompositionSource10SetOpacityEf @ 15 NONAME
+	_ZN21CAlfCompositionSource11EnableAlphaEi @ 16 NONAME
+	_ZN21CAlfCompositionSource11SetRotationEi @ 17 NONAME
+	_ZN21CAlfCompositionSource12HandleEventLEiPv @ 18 NONAME
+	_ZN21CAlfCompositionSource14EnableKeyboardEii @ 19 NONAME
+	_ZN21CAlfCompositionSource14RemoveObserverER23MAlfCompositionObserver @ 20 NONAME
+	_ZN21CAlfCompositionSource19SetIsBackgroundAnimEi @ 21 NONAME
+	_ZN21CAlfCompositionSource21CreatePermissionTokenEii @ 22 NONAME
+	_ZN21CAlfCompositionSource23AddCompositionObserverLER23MAlfCompositionObserveri @ 23 NONAME
+	_ZN21CAlfCompositionSource4NewLER7RWindow @ 24 NONAME
+	_ZN21CAlfCompositionSource9SetExtentERK5TRecti @ 25 NONAME
+	_ZN21CAlfCompositionSource9SetZOrderERK25CAlfCompositionClientBaseii @ 26 NONAME
+	_ZN21CAlfCompositionSourceD0Ev @ 27 NONAME
+	_ZN21CAlfCompositionSourceD1Ev @ 28 NONAME
+	_ZN21CAlfCompositionSourceD2Ev @ 29 NONAME
+	_ZN25CAlfCompositionClientBase10SetHandleLEi @ 30 NONAME
+	_ZN25CAlfCompositionClientBase12HandleEventLEiPv @ 31 NONAME
+	_ZN25CAlfCompositionClientBase13RequestEventLEiP17RAlfBridgerClient @ 32 NONAME
+	_ZN25CAlfCompositionClientBase8RunErrorEi @ 33 NONAME
+	_ZN25CAlfCompositionClientBase9SendEventEiPKvi @ 34 NONAME
+	_ZN25CAlfCompositionClientBaseD0Ev @ 35 NONAME
+	_ZN25CAlfCompositionClientBaseD1Ev @ 36 NONAME
+	_ZN25CAlfCompositionClientBaseD2Ev @ 37 NONAME
+	_ZN26CAlfCompositionCntrlClient4NewLEP17RAlfBridgerClientP25MAlfCompositionController @ 38 NONAME
+	_ZN26CAlfCompositionPixelSource4NewLER18MAlfBufferProviderP7RWindow @ 39 NONAME
+	_ZN26CAlfCompositionPixelSource7SuspendEv @ 40 NONAME
+	_ZN26CAlfCompositionPixelSource9ActivateLEv @ 41 NONAME
+	_ZN26CAlfCompositionPixelSource9SetExtentERK5TRecti @ 42 NONAME
+	_ZN26CAlfCompositionPixelSourceD0Ev @ 43 NONAME
+	_ZN26CAlfCompositionPixelSourceD1Ev @ 44 NONAME
+	_ZN26CAlfCompositionPixelSourceD2Ev @ 45 NONAME
+	_ZTI21CAlfCompositionSource @ 46 NONAME
+	_ZTI25CAlfCompositionClientBase @ 47 NONAME
+	_ZTI26CAlfCompositionPixelSource @ 48 NONAME
+	_ZTV21CAlfCompositionSource @ 49 NONAME
+	_ZTV25CAlfCompositionClientBase @ 50 NONAME
+	_ZTV26CAlfCompositionPixelSource @ 51 NONAME
+	_ZThn32_N21CAlfCompositionSource10SetOpacityEf @ 52 NONAME
+	_ZThn32_N21CAlfCompositionSource11EnableAlphaEi @ 53 NONAME
+	_ZThn32_N21CAlfCompositionSource11SetRotationEi @ 54 NONAME
+	_ZThn32_N21CAlfCompositionSource19SetIsBackgroundAnimEi @ 55 NONAME
+	_ZThn32_N21CAlfCompositionSource9SetExtentERK5TRecti @ 56 NONAME
+	_ZThn32_N26CAlfCompositionPixelSource9SetExtentERK5TRecti @ 57 NONAME
+	_ZN26CAlfCompositionCntrlClientD0Ev @ 58 NONAME
+	_ZN26CAlfCompositionCntrlClientD1Ev @ 59 NONAME
+	_ZN26CAlfCompositionCntrlClientD2Ev @ 60 NONAME
+	_ZN21CAlfCompositionSource13SetSourceRectERK5TRect @ 61 NONAME
+	_ZThn32_N21CAlfCompositionSource13SetSourceRectERK5TRect @ 62 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfDecoderServerClient/src/alfcompositionclient.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1141 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <alfdecoderserverclient.h>
+#include <alfstreamerconsts.h>
+
+#include <uiacceltk/HuiUtil.h>
+#include <coemain.h>
+#include <alf/alfcompositionclient.h>
+#include "graphics/surfacemanager.h"
+#include "graphics/surface.h"
+#include "graphics/surfaceupdateclient.h"
+#include "graphics/suerror.h" // KAllScreens
+
+#include "graphics/surfaceconfiguration.h" // TSurfaceConfiguration
+
+#include "alflogger.h"
+
+// ---------------------------------------------------------------------------
+// CAlfCompositionClientBaseData::NewL
+// ---------------------------------------------------------------------------
+//
+CAlfCompositionClientBase::CAlfCompositionClientBaseData* 
+    CAlfCompositionClientBase::CAlfCompositionClientBaseData::NewL(
+            TInt aBufferSize, 
+            RAlfBridgerClient* aClient)
+    {
+    CAlfCompositionClientBaseData* me = new (ELeave) CAlfCompositionClientBaseData();
+    CleanupStack::PushL(me);
+    me->ConstructL(aBufferSize, aClient);
+    CleanupStack::Pop();
+    return me;
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfCompositionClientBaseData::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfCompositionClientBase::CAlfCompositionClientBaseData::ConstructL(TInt /*aBufferSize*/, RAlfBridgerClient* aClient)
+    {
+    if (!aClient)
+        {
+        iClient = new (ELeave) RAlfBridgerClient();     
+        iOwnsClient = ETrue; 
+        User::LeaveIfError(iClient->Connect());
+        }
+    else
+        {
+        iClient = aClient;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ~CAlfCompositionClientBaseData
+// ---------------------------------------------------------------------------
+//
+CAlfCompositionClientBase::CAlfCompositionClientBaseData::~CAlfCompositionClientBaseData()
+    {
+    if (iOwnsClient && iClient)
+        {
+        iClient->Close();
+        delete iClient;    
+        }
+    if (iDeleted)
+        {
+        *iDeleted = ETrue;
+        }    
+    }    
+// ---------------------------------------------------------------------------
+// RequestEventL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCompositionClientBase::RequestEventL(TInt aBufferSize, RAlfBridgerClient* aClient)
+    {
+    if (!IsActive())
+        {    
+        if (!iData)
+            {    
+            iData = CAlfCompositionClientBaseData::NewL(aBufferSize, aClient);
+            }
+        SetActive();
+        iData->iClient->SendAsynchronous(KAlfCompOpRequestEvent,TIpcArgs(&iData->iBuffer), iStatus);
+        }    
+    }            
+
+// ---------------------------------------------------------------------------
+// SendEvent
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfCompositionClientBase::SendEvent(TInt aOp, const TAny* aEventData, TInt aEventSize)
+    {
+    // Todo, should support batching / asynch    
+    if (!iData)
+        {    
+        TRAPD(err, iData = CAlfCompositionClientBaseData::NewL(aEventSize, 0)) // basically zero buffer would do 
+        if (err)
+            {
+            return err;
+            }    
+        }
+
+    TPtrC8 ptr(reinterpret_cast<const TUint8*>(aEventData), aEventSize);
+
+    return iData->iClient->SendSynch(aOp, ptr); 
+    }            
+
+// ---------------------------------------------------------------------------
+// HandleEventL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCompositionClientBase::HandleEventL(TInt /*aEventType*/, TAny* /*aEventData*/)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// NullBoolPtr
+// ---------------------------------------------------------------------------
+//
+void NullBoolPtr(TAny* ptr)
+    {
+    TBool** boolptr = static_cast<TBool**>(ptr);
+    *boolptr = 0;    
+    }
+ 
+// ---------------------------------------------------------------------------
+// RunL
+// ---------------------------------------------------------------------------
+//
+void CAlfCompositionClientBase::RunL()
+    {
+    TInt status = iStatus.Int();
+    User::LeaveIfError(status);
+    TBool deleted = EFalse;
+    iData->iDeleted = &deleted; 
+    CleanupStack::PushL(TCleanupItem(NullBoolPtr, &iData->iDeleted));
+    HandleEventL(status, (void*)iData->iBuffer.Ptr());
+    CleanupStack::PopAndDestroy();
+    if (!deleted) // just small precaution if client deletes itself on callback
+        {
+        RequestEventL(sizeof(TInt));
+        }
+    } 
+
+// ---------------------------------------------------------------------------
+// DoCancel
+// ---------------------------------------------------------------------------
+//    
+void CAlfCompositionClientBase::DoCancel()
+    {
+    if (iData)
+        {
+        iData->iClient->SendSynch(KAlfCompOpCancelEventRequest, TIpcArgs(Handle()) );
+        }
+    }    
+
+// ---------------------------------------------------------------------------
+// RunError
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfCompositionClientBase::RunError(TInt aError)
+    {
+    RDebug::Print(_L("CAlfCompositionClientBase::RunError( %d )"),aError);
+    if ( aError == KErrServerTerminated )
+        {
+        RDebug::Print(_L("CAlfCompositionClientBase::RunError - ALF server has died. Everything is lost. Halting."));
+        USER_INVARIANT();
+        }
+    return KErrNone;
+    }    
+
+// ---------------------------------------------------------------------------
+// ~CAlfCompositionClientBase
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfCompositionClientBase::~CAlfCompositionClientBase()
+    {
+    Cancel();
+    delete iData;
+    iData = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// SetHandleL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCompositionClientBase::SetHandleL(TInt aHandle)
+    {
+    User::LeaveIfError(aHandle);
+    if (!iData)
+        {    
+        iData = CAlfCompositionClientBaseData::NewL(sizeof(TInt),0);// basically zero buffer would do 
+        }
+    iData->iHandle = aHandle;
+    }
+
+// ---------------------------------------------------------------------------
+// Handle
+// ---------------------------------------------------------------------------
+//
+TInt CAlfCompositionClientBase::Handle() const
+    {
+    return iData?iData->iHandle:0;
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfCompositionCntrlClient* CAlfCompositionCntrlClient::NewL(RAlfBridgerClient* aClient, MAlfCompositionController* aController)
+    {
+    CAlfCompositionCntrlClient* me = new (ELeave) CAlfCompositionCntrlClient(aController);    
+    me->RequestEventL(60, aClient); // magic, extent with options
+    me->SendEvent(KAlfCompositionWServReady,0,0);
+    return me;
+    }
+     
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfCompositionCntrlClient::~CAlfCompositionCntrlClient()
+    {
+    iHostBindingsHash.Close();
+    iHostPermittedOpsHash.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// HandleEventL
+// ---------------------------------------------------------------------------
+//
+void CAlfCompositionCntrlClient::HandleEventL(TInt aEventType, TAny* aEventData)
+    {
+    __ASSERT_DEBUG(iController, USER_INVARIANT());
+    
+    if (aEventType == KAlfCompositionLowOnGraphicsMemory && iController)
+        {
+        iController->LowOnGraphicsMemory();    
+        return;
+        }
+    
+    if (aEventType == KAlfCompositionGoodOnGraphicsMemory && iController)
+        {
+        iController->GraphicsMemoryGood();
+        return;
+        }    
+    
+    TInt* ptr = static_cast<TInt*>(aEventData);
+    TInt target;
+    
+    // find out if target is a host (is binded to some other target)
+    TInt bindedTarget = 0;
+    TInt* tempbind = iHostBindingsHash.Find(*ptr);
+    if(tempbind)
+        bindedTarget = *tempbind;
+    TInt32 permittedOps = 0;
+    if(bindedTarget)
+        {
+        target = bindedTarget;
+        TInt32* tempOps = iHostPermittedOpsHash.Find(*ptr);
+        if(tempOps)
+            permittedOps = *tempOps; 
+        }
+    else
+        {
+        target = *ptr;
+        }
+        
+    // SetTargetL is always sent before the actual command.
+    iController->SetTargetL(target); // When this is composition
+    
+    switch (aEventType)
+        {
+        case KAlfCompOpCreateToken:
+            {
+            break;
+            }
+        case KAlfCompOpBindSourceToToken:
+            {
+            RDebug::Print(_L("ptr0: %d, Target %d, Flags %d, combinedtarget"), ptr[0], ptr[1], ptr[2]);
+            if( ptr[1] != 0) // add binding information for new host to given target with permitted operations
+                {
+                iHostBindingsHash.Insert(*ptr, ptr[1]);
+                iHostPermittedOpsHash.Insert(*ptr, ptr[2]);
+                }
+            else // remove old host bindings when the host is being deleted.
+                {
+                iHostBindingsHash.Remove(*ptr);
+                iHostPermittedOpsHash.Remove(*ptr);
+                }
+            break;
+            }
+        case KAlfCompOpCreateSource:    
+            {
+            iController->CreateTargetL(target, ptr[2], ptr[3]); 
+            break;
+            }    
+        case KAlfCompOpEnableAlpha:
+            {
+            if ( !bindedTarget || permittedOps & CAlfCompositionHost::EAlfAllowChangeAlpha)
+                {
+                iController->EnableAlpha(ptr[1]);
+                }
+            break;
+            }    
+        case KAlfCompOpSetOpacity:
+            {
+            if ( !bindedTarget || permittedOps & CAlfCompositionHost::EAlfAllowChangeOpacity)
+                {
+                TReal32* opacity = /*static_cast<*/(TReal32*)(++ptr);
+                iController->SetOpacity(*opacity);
+                }
+            break;
+            }    
+        case KAlfCompOpSetRotation:
+            {
+            if ( !bindedTarget || permittedOps & CAlfCompositionHost::EAlfAllowChangeRotation)
+                {      
+                iController->SetRotation(ptr[1]);
+                }
+            break;
+            }     
+        case KAlfCompOpSetZOrder:
+            {
+            TInt newToken = 0;
+            if( ptr[3] != KErrNotFound)
+                {
+                newToken = iController->SetOrder(target,ptr[1],ptr[2],ETrue); //  top, below, combineTargets             
+                }
+            else
+                {
+                newToken = iController->SetOrder(target,ptr[1],ptr[2],EFalse); //  top, below, combineTargets             
+                }
+            TInt array[] = {ptr[0], newToken, ptr[3]}; // caller session, newToken, secretKey
+            SendEvent(KAlfCompositionTargetCreated, array, sizeof(array));
+            break;
+            }    
+
+        case KAlfCompOpSetExtent:
+            {
+            if ( !bindedTarget || permittedOps & CAlfCompositionHost::EAlfAllowChangeExtent)
+                {
+                TRect rect(ptr[1],ptr[2],ptr[3],ptr[4]);
+                TSurfaceId surfaceId;
+                surfaceId.iInternal[0] = ptr[6];
+                surfaceId.iInternal[1] = ptr[7];
+                surfaceId.iInternal[2] = ptr[8];
+                surfaceId.iInternal[3] = ptr[9];
+                iController->SetExtentSurfaceId(surfaceId);
+                iController->SetExtent(rect, ptr[5]); // rect, screen
+                }
+            break;
+            }
+        case KAlfCompOpSetSRect:
+            {
+            if ( !bindedTarget || permittedOps & CAlfCompositionHost::EAlfAllowChangeExtent)
+                {
+                TRect rect(ptr[1],ptr[2],ptr[3],ptr[4]);
+                iController->SetSourceRect(rect);
+                }
+            break;
+            }
+        case KAlfComOpSetBackgroundAnim:
+            {
+            if ( !bindedTarget || permittedOps & CAlfCompositionHost::EAlfAllowChangeBackgroundAnim)
+                {
+                iController->SetIsBackgroundAnim(ptr[1]);
+                }
+            break;
+            }
+        case KAlfCompOpSessionClosed:
+            {
+            iController->DeleteTarget(target);
+            break;
+            }
+            
+        default:
+            break;
+        }
+    }    
+
+// ---------------------------------------------------------------------------
+// RunError
+// ---------------------------------------------------------------------------
+//
+TInt CAlfCompositionCntrlClient::RunError(TInt aError)
+    {
+    CAlfCompositionClientBase::RunError(aError);
+    // reactivate
+    TRAPD(err, RequestEventL(60)); // magic, extent with options
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+NONSHARABLE_CLASS(CAlfCompositionSource::CAlfCompositionSourceData):public CBase
+    {
+    public:
+    static CAlfCompositionSourceData* NewL()
+        {
+        CAlfCompositionSourceData* me = new (ELeave) CAlfCompositionSourceData();
+        CleanupStack::PushL(me);
+        // jada
+        CleanupStack::Pop();
+        return me;
+        }
+
+    ~CAlfCompositionSourceData()
+        {
+        if (iDeleted)
+            {
+            *iDeleted = ETrue;
+            }    
+        iObservers.Reset();
+        }    
+
+    TBool* iDeleted;
+    TSurfaceId iSurfaceId;
+    RPointerArray<MAlfCompositionObserver> iObservers;
+    };
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfCompositionSource* CAlfCompositionSource::NewL(RWindow& aClientWindow)
+    {
+    CAlfCompositionSource* me = new (ELeave) CAlfCompositionSource();
+    CleanupStack::PushL(me);
+    me->ConstructL(aClientWindow);
+    CleanupStack::Pop(me);
+    return me;
+    }
+
+// ---------------------------------------------------------------------------
+// ~CAlfCompositionSource
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfCompositionSource::~CAlfCompositionSource()
+    {
+    delete iData;
+    iData = NULL;
+    }
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfCompositionSource::ConstructL(TInt aWsHandle, TInt aGroupHandle, TInt aScreenNumber)
+    {
+    iData = CAlfCompositionSourceData::NewL();
+    RDebug::Print(_L("CAlfCompositionClientBase::ConstructL - %d"), iData );
+
+    User::LeaveIfError( SendEvent(KAlfCompositionSourceScreenNumber, &aScreenNumber, sizeof(TInt)));
+    
+    TInt array[] = { 0, aWsHandle, aGroupHandle}; 
+    TInt handle = SendEvent(KAlfCompOpCreateSource, array, sizeof(array));   
+    SetHandleL(handle);
+    }
+
+void CAlfCompositionSource::ConstructL(RWindow& aClientWindow)
+    {
+    ConstructL(aClientWindow.ClientHandle(), aClientWindow.WindowGroupId(), aClientWindow.ScreenNumber());
+    TSurfaceConfiguration surfaceConfigs;
+    User::LeaveIfError(aClientWindow.GetBackgroundSurface(surfaceConfigs));
+    surfaceConfigs.GetSurfaceId(iData->iSurfaceId);
+    if(iData->iSurfaceId.IsNull())
+        {
+        __ALFLOGSTRING( "CAlfCompositionSource::NewL - Window does not have background surface set - Leaving");
+        User::Leave(KErrNotFound);
+        }   
+    }
+
+// ---------------------------------------------------------------------------
+// CreatePermissionToken
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TInt CAlfCompositionSource::CreatePermissionToken(TInt aKey, TInt aPermissionFlags)
+    {
+    TInt array[] = {aKey, aPermissionFlags};    
+    return SendEvent(KAlfCompOpCreateToken, array, sizeof(array));
+    }    
+
+// ---------------------------------------------------------------------------
+// EnableAlpha
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfCompositionSource::EnableAlpha(TBool aEnable)
+    {
+    return SendEvent(KAlfCompOpEnableAlpha, &aEnable, sizeof(TInt));
+    }
+
+// ---------------------------------------------------------------------------
+// SetOpacity
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfCompositionSource::SetOpacity(TReal32 aOpacity) __SOFTFP
+    {
+    return SendEvent(KAlfCompOpSetOpacity, &aOpacity, sizeof(TReal32));
+    }
+
+// ---------------------------------------------------------------------------
+// SetRotation
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfCompositionSource::SetRotation(TInt aRotationInDegrees)
+    {
+    return SendEvent(KAlfCompOpSetRotation, &aRotationInDegrees, sizeof(TInt));
+    }
+
+// ---------------------------------------------------------------------------
+// SetZOrder
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfCompositionSource::SetZOrder(const CAlfCompositionClientBase& aNode, TBool aAbove, TInt aKey)
+    {
+    TInt array[] = {aNode.Handle(), aAbove, aKey};
+    return SendEvent(KAlfCompOpSetZOrder, array, sizeof(array));
+    }
+
+// ---------------------------------------------------------------------------
+// SetExtent
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfCompositionSource::SetExtent(const TRect& aRect, TInt aScreen)
+    {
+    TInt array[] = {aRect.iTl.iX,aRect.iTl.iY,aRect.iBr.iX,aRect.iBr.iY, aScreen,
+            iData->iSurfaceId.iInternal[0], iData->iSurfaceId.iInternal[1], iData->iSurfaceId.iInternal[2],
+            iData->iSurfaceId.iInternal[3]};
+    return SendEvent(KAlfCompOpSetExtent, array, sizeof(array));
+    }
+
+// ---------------------------------------------------------------------------
+// SetSourceRect
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfCompositionSource::SetSourceRect(const TRect& aRect)
+    {
+    TInt array[] = {aRect.iTl.iX,aRect.iTl.iY,aRect.iBr.iX,aRect.iBr.iY};
+    return SendEvent(KAlfCompOpSetSRect, array, sizeof(array));
+    }
+
+// ---------------------------------------------------------------------------
+// AddCompositionObserverL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCompositionSource::AddCompositionObserverL(MAlfCompositionObserver& aObserver, TInt aScreenNumber)
+    {
+    if (iData->iObservers.Count() == 1 || aScreenNumber != 0)    
+        { // TODO: support only single observer for now 
+          // because we can't currently handle deletion of an observer
+          // during handle event properly (if there were more than one observers present)
+        User::Leave(KErrNotSupported);    
+        }
+        
+    TInt index = iData->iObservers.Find(&aObserver);
+    if (index == KErrNotFound)
+        {
+        iData->iObservers.AppendL(&aObserver);
+        }
+    RequestEventL(sizeof(TInt)); // enable notifications if not active yet
+    }
+
+// ---------------------------------------------------------------------------
+// RemoveObserver
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCompositionSource::RemoveObserver(MAlfCompositionObserver& aObserver)
+    {
+    TInt index = iData->iObservers.Find(&aObserver);
+    if (index != KErrNotFound)
+        {
+        iData->iObservers.Remove(index);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SetIsBackgroundAnim
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCompositionSource::SetIsBackgroundAnim(TBool aIsBg)
+    {    
+    SendEvent(KAlfComOpSetBackgroundAnim, &aIsBg, sizeof(TBool));
+    }
+
+// ---------------------------------------------------------------------------
+// EnableKeyboard
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCompositionSource::EnableKeyboard(TBool aEnable, TInt aScreen)
+    {
+    TInt array[] = {aEnable, aScreen};
+    SendEvent(KAlfCompOpEnableKb, array, sizeof(array));
+    }
+
+// ---------------------------------------------------------------------------
+// HandleEventL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCompositionSource::HandleEventL(TInt aEventType, TAny* aEventData)
+    {
+    switch (aEventType)
+        {        
+        case KAlfCompositionFrameReady:
+            {
+            for (TInt i = 0; i < iData->iObservers.Count(); i++)
+                {
+                iData->iObservers[i]->FrameReady(*static_cast<TInt*>(aEventData)); // todo multiple screens    
+                }
+            break;
+            }    
+        case KAlfCompositionLowOnGraphicsMemory:
+            {
+            for (TInt i = 0; i < iData->iObservers.Count(); i++)
+                {
+                iData->iObservers[i]->RunningLowOnGraphicsMemory(); // todo multiple screens    
+                }
+            break;
+            }    
+        case KAlfCompositionTargetHidden:
+            {
+            for (TInt i = 0; i < iData->iObservers.Count(); i++)
+                {
+                iData->iObservers[i]->CompositionTargetHidden(); // todo multiple screens    
+                }
+            break;
+            }    
+        case KAlfCompositionGoodOnGraphicsMemory:
+            {
+            TInt count = iData->iObservers.Count();
+            for (TInt i = 0; i < count; i++)
+                {
+                iData->iObservers[i]->GraphicsMemoryGood();
+                }
+            break;
+            }     
+        case KAlfCompositionTargetVisible:
+            {
+            for (TInt i = 0; i < iData->iObservers.Count(); i++)
+                {
+                iData->iObservers[i]->CompositionTargetVisible(); // todo multiple screens    
+                }
+            break;
+            }    
+
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfCompositionHost::NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfCompositionHost* CAlfCompositionHost::NewL(TInt aToken, TInt aKey)
+    {
+    CAlfCompositionHost* me = new (ELeave) CAlfCompositionHost();
+    CleanupStack::PushL(me);        
+    me->ConstructL(aToken, aKey);
+    CleanupStack::Pop();
+    return me;
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfCompositionHost::ConstructL(TInt aToken, TInt aKey)
+    {
+    iData = CAlfCompositionSourceData::NewL();
+    RDebug::Print(_L("CAlfCompositionClientBase::ConstructL - %d"), iData );
+
+    TInt array[] = { 0, aToken, aKey }; 
+    TInt result  = SendEvent(KAlfCompOpBindSourceToToken, array, sizeof(array));   
+    User::LeaveIfError(result);
+    SetHandleL(result);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+NONSHARABLE_CLASS( CSurfaceUpdateCallback ) : public CActive
+    { 
+    public:
+ 
+    public:
+        CSurfaceUpdateCallback( CAlfCompositionPixelSource& aPixelSource, TInt aBufferNumber,
+                                TInt aPriority): CActive(aPriority), iPixelSource(aPixelSource),
+                                iBufferNumber(aBufferNumber) { CActiveScheduler::Add(this); };
+        ~CSurfaceUpdateCallback() { Cancel(); };
+    public:
+
+        void SetActive() {iStatus = KRequestPending;  CActive::SetActive();};
+
+        void RunL() 
+            {
+            if( iStatus == KErrNone )
+                {
+                SetActive();
+                if( !iPixelSource.DrawFrameL(iStatus, iBufferNumber) )
+                    {
+                    __ALFLOGSTRING( "CSurfaceUpdateCallBack::RunL - DrawFrameL returned EFalse -> Pause");
+                    TRequestStatus* status = &iStatus;
+                    User::RequestComplete(status, KErrNone);
+                    Cancel();
+                   }
+                }
+            else
+                {
+                __ALFLOGSTRING1("CSurfaceUpdateCallBack::RunL %d", iStatus.Int());
+                iPixelSource.Suspend();
+                }
+
+            
+            };
+        void DoCancel() {  };
+        
+    private: // Data
+        CAlfCompositionPixelSource& iPixelSource;
+        TInt iBufferNumber;
+    };
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+NONSHARABLE_CLASS(CAlfCompositionPixelSource::CAlfCompositionPixelSourceData):public CBase
+    {
+    public:
+        
+        enum TPixelSourceStatus
+            {
+            EActive = 0, // drawing loop running
+            EPaused = 1, // drawing paused but resources are still reserved
+            ESuspended = 2 // drawing suspended and surface related resources freed until activated again
+            };
+
+        static CAlfCompositionPixelSourceData* NewL(MAlfBufferProvider& aProvider)
+        {
+        CAlfCompositionPixelSourceData* me = new (ELeave) CAlfCompositionPixelSourceData(aProvider);
+        return me;
+        }
+
+    
+    CAlfCompositionPixelSourceData(MAlfBufferProvider& aProvider) : 
+        iProvider( aProvider), iSourceStatus(ESuspended) {iSurfaceId.CreateNullId();}
+    
+    ~CAlfCompositionPixelSourceData()
+        {
+        if(iWindow && iSourceStatus != ESuspended)
+            {
+            iWindow->RemoveBackgroundSurface(ETrue);
+            }
+        
+        if(iSourceStatus != ESuspended)
+            {
+            iSurfaceUpdateSession.CancelAllUpdateNotifications();
+            }
+
+        iSurfaceUpdateSession.Close();
+
+        if(iSurfaceManager)
+            {
+            iSurfaceManager->CloseSurface(iSurfaceId);
+            iSurfaceManager->Close();
+            delete iSurfaceManager;
+            }
+        
+        if(iSurfaceChunk)
+            {
+            iSurfaceChunk->Close();
+            delete iSurfaceChunk;
+            }
+
+        if(iSurfaceUpdateWaiter && iSurfaceUpdateWaiter->IsActive())
+            {
+            iSurfaceUpdateWaiter->Cancel();
+            }
+        delete iSurfaceUpdateWaiter;
+        
+        }
+    MAlfBufferProvider& iProvider;
+
+    TPixelSourceStatus iSourceStatus;
+    
+    RSurfaceUpdateSession iSurfaceUpdateSession;
+    TSurfaceId iSurfaceId;
+    RSurfaceManager* iSurfaceManager;
+    RChunk* iSurfaceChunk;
+
+    // Not owned
+    RWindow* iWindow;
+    
+    TUint8* iSurfaceBuffer;
+
+    CSurfaceUpdateCallback* iSurfaceUpdateWaiter;
+    
+    TInt iCurrentBuffer;
+    
+    TRect iSurfaceRect;
+    };
+
+
+
+// ---------------------------------------------------------------------------
+// CAlfCompositionPixelSource::NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfCompositionPixelSource* CAlfCompositionPixelSource::NewL(MAlfBufferProvider& aProvider, RWindow* aWindow)
+    {
+    CAlfCompositionPixelSource* me = new (ELeave) CAlfCompositionPixelSource();
+    CleanupStack::PushL(me);
+    me->ConstructL(aProvider, aWindow);
+    CleanupStack::Pop(me);
+    return me;    
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfCompositionPixelSource::ActivateL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCompositionPixelSource::ActivateL()
+    {
+    if( !iData->iWindow && iData->iSurfaceId.IsNull() )
+        {
+        User::Leave(KErrNotReady);
+        }
+    
+    if( iData->iSourceStatus == CAlfCompositionPixelSourceData::ESuspended )
+        {
+        MAlfBufferProvider::TBufferCreationAttributes& creationAttribs = iData->iProvider.BufferAttributes();
+        
+        iData->iSurfaceRect = TRect(TPoint(0,0), TSize(creationAttribs.iWidth, creationAttribs.iHeight));
+
+        ConstructSurfaceL(creationAttribs);
+
+        iData->iWindow->SetBackgroundSurface(iData->iSurfaceId);
+
+        TInt array[] = { 0, iData->iWindow->ClientHandle(), iData->iWindow->WindowGroupId() }; 
+        TInt handle = SendEvent(KAlfCompOpCreateSource, array, sizeof(array));
+        CAlfCompositionClientBase::SetHandleL( handle );
+
+        User::LeaveIfError( iData->iSurfaceUpdateSession.Connect() );       
+        }
+  
+    if( iData->iSourceStatus != CAlfCompositionPixelSourceData::EActive )
+        {
+        if( !iData->iSurfaceUpdateWaiter )
+            {
+            iData->iSurfaceUpdateWaiter = new (ELeave) CSurfaceUpdateCallback( *this, 0, CActive::EPriorityIdle );
+            }
+
+        iData->iSurfaceUpdateWaiter->SetActive();
+        TRequestStatus* status = &iData->iSurfaceUpdateWaiter->iStatus;
+        User::RequestComplete(status, KErrNone);
+        
+        iData->iProvider.OnActivation();
+        iData->iSourceStatus = CAlfCompositionPixelSourceData::EActive;
+        }
+   
+    // do nothing if content was already active
+    }
+    
+// --------------------------------------------------------------------------- 
+// CAlfCompositionPixelSource::Suspend
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCompositionPixelSource::Suspend()
+    {
+    if(iData->iSourceStatus != CAlfCompositionPixelSourceData::ESuspended)
+        {
+        iData->iProvider.ContextAboutToSuspend();
+    
+        TInt error = SendEvent(KAlfCompOpSessionClosed,0,0);
+        
+        // todo: what if error != KErrNone
+        
+        FreeSurface();
+        
+        if(iData->iSurfaceUpdateWaiter && iData->iSurfaceUpdateWaiter->IsActive())
+            {
+            iData->iSurfaceUpdateWaiter->Cancel();
+            }
+        
+            
+        iData->iSourceStatus = CAlfCompositionPixelSourceData::ESuspended;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfCompositionPixelSource::CAlfCompositionPixelSource
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfCompositionPixelSource::~CAlfCompositionPixelSource()
+    {
+    Suspend();
+    delete iData;
+    iData = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfCompositionPixelSource::SetExtent
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfCompositionPixelSource::SetExtent(const TRect& aRect, TInt aScreen)
+    {
+    TInt error = KErrNone;
+    if(iData->iSurfaceId.IsNull() && !iData->iWindow) 
+        {
+        //create surface as client did not supply window
+        MAlfBufferProvider::TBufferCreationAttributes& creationAttribs = iData->iProvider.BufferAttributes();
+        
+        iData->iSurfaceRect = TRect(TPoint(0,0), TSize(creationAttribs.iWidth, creationAttribs.iHeight));
+
+        TRAP(error, ConstructSurfaceL(creationAttribs) );
+
+        if( error == KErrNone )
+            {
+            error = iData->iSurfaceUpdateSession.Connect();       
+            iData->iSourceStatus = CAlfCompositionPixelSourceData::EPaused;
+            }
+        }
+    
+    if( error == KErrNone )
+        {
+        TInt array[] = {aRect.iTl.iX,aRect.iTl.iY,aRect.iBr.iX,aRect.iBr.iY, aScreen,
+                iData->iSurfaceId.iInternal[0], iData->iSurfaceId.iInternal[1], iData->iSurfaceId.iInternal[2],
+                iData->iSurfaceId.iInternal[3]};
+        error = SendEvent(KAlfCompOpSetExtent, array, sizeof(array));
+        }
+    return error;
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfCompositionPixelSource::ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfCompositionPixelSource::ConstructL(MAlfBufferProvider& aProvider, RWindow* aWindow)
+    {
+    iData = CAlfCompositionPixelSourceData::NewL( aProvider );
+    TInt screenNumber = KErrNotFound;
+    if( aWindow )
+        {
+        iData->iWindow = aWindow;
+        screenNumber = aWindow->ScreenNumber();
+        }
+    else // let's just initialize baseclass and wait for client to call SetExtent
+        {
+        iData->iWindow = NULL;
+        }
+    // construct the base class
+    CAlfCompositionSource::ConstructL(0, 0, screenNumber);
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfCompositionPixelSource::ConstructSurfaceL
+// ---------------------------------------------------------------------------
+//
+void CAlfCompositionPixelSource::ConstructSurfaceL(MAlfBufferProvider::TBufferCreationAttributes& aCreationAttributes)
+    {
+    TSize size(aCreationAttributes.iWidth, aCreationAttributes.iHeight);
+
+    TUidPixelFormat surfaceFormat = EUidPixelFormatUnknown;
+    switch (aCreationAttributes.iFormat)
+        {
+        case MAlfBufferProvider::ESourceFormatRGB_565:
+            surfaceFormat = EUidPixelFormatRGB_565;
+            break;
+        case MAlfBufferProvider::ESourceFormatXRGB_8888:
+            surfaceFormat = EUidPixelFormatXRGB_8888;
+            break;
+        case MAlfBufferProvider::ESourceFormatARGB_8888:
+            surfaceFormat = EUidPixelFormatARGB_8888;
+            break;
+        case MAlfBufferProvider::ESourceFormatARGB_8888_PRE:
+            surfaceFormat = EUidPixelFormatARGB_8888_PRE;
+            break;
+        default:
+            User::Leave( KErrNotSupported );
+            break;
+        }
+    
+    TInt err = KErrNone;
+    if(!iData->iSurfaceManager)
+        {
+        iData->iSurfaceManager = new RSurfaceManager();
+        User::LeaveIfNull(iData->iSurfaceManager);    
+          
+        err = iData->iSurfaceManager->Open();
+        User::LeaveIfError(err);    
+        
+        RSurfaceManager::TSurfaceCreationAttributesBuf attributes;
+        attributes().iPixelFormat           = surfaceFormat;
+        attributes().iSize                  = size;
+        attributes().iBuffers               = 1;
+        attributes().iStride                = aCreationAttributes.iStride;
+        attributes().iAlignment             = aCreationAttributes.iAlignment;
+        attributes().iContiguous            = ETrue;
+        attributes().iMappable              = ETrue;
+
+        // Create surface
+        err = iData->iSurfaceManager->CreateSurface(attributes, iData->iSurfaceId);
+        User::LeaveIfError(err);    
+        }
+    
+    if(!iData->iSurfaceChunk)
+        {
+        // Map to chunk
+        iData->iSurfaceChunk = new RChunk();
+        User::LeaveIfNull(iData->iSurfaceChunk);    
+        err = iData->iSurfaceManager->MapSurface(iData->iSurfaceId, *iData->iSurfaceChunk);
+        User::LeaveIfError(err);    
+        }
+
+    // Get the info from the surfaceManager
+    RSurfaceManager::TInfoBuf info;
+    err = iData->iSurfaceManager->SurfaceInfo(iData->iSurfaceId, info);
+    User::LeaveIfError(err);        
+    RSurfaceManager::TSurfaceInfoV01 surfaceInfo = info();
+    aCreationAttributes.iStride = surfaceInfo.iStride;
+    
+    TInt offset = 0;
+    iData->iSurfaceManager->GetBufferOffset(iData->iSurfaceId, 0,  offset);
+
+    // Store pointer to the pixel data
+    iData->iSurfaceBuffer = iData->iSurfaceChunk->Base() + offset;
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfCompositionPixelSource::FreeSurface
+// ---------------------------------------------------------------------------
+//
+void CAlfCompositionPixelSource::FreeSurface()
+    {
+    if(iData->iWindow &&  iData->iSourceStatus != CAlfCompositionPixelSourceData::ESuspended)
+        {
+        iData->iWindow->RemoveBackgroundSurface(ETrue);
+        iData->iWindow->Session()->Flush();
+        }
+    
+    if(iData->iSourceStatus != CAlfCompositionPixelSourceData::ESuspended)
+        {
+        iData->iSurfaceUpdateSession.CancelAllUpdateNotifications();
+        }
+    iData->iSurfaceUpdateSession.Close();
+    
+    if(iData->iSurfaceManager)
+        {
+        iData->iSurfaceManager->CloseSurface(iData->iSurfaceId);
+        iData->iSurfaceManager->Close();
+        delete iData->iSurfaceManager;
+        iData->iSurfaceManager = NULL;
+        }
+    
+    iData->iSurfaceId = TSurfaceId::CreateNullId();
+    
+    if(iData->iSurfaceChunk)
+        {
+        iData->iSurfaceChunk->Close();
+        delete iData->iSurfaceChunk;
+        iData->iSurfaceChunk = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfCompositionPixelSource::Buffer
+// ---------------------------------------------------------------------------
+//
+TUint8* CAlfCompositionPixelSource::Buffer(TInt /*aBufferNumber*/)
+    {
+    return iData->iSurfaceBuffer;
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfCompositionPixelSource::DrawFrameL
+// ---------------------------------------------------------------------------
+//
+TBool CAlfCompositionPixelSource::DrawFrameL(TRequestStatus& aStatus, TInt aBufferNumber)
+    {
+    // Region indicates the currently visible region of the surface. The information is not yet available.
+    RRegion region;
+    region.AddRect(iData->iSurfaceRect);
+    TUint8* buffer = Buffer(aBufferNumber);
+    TBool draw = iData->iProvider.ProduceNewFrameL(region, buffer);
+    if(draw)
+        {
+        iData->iSurfaceUpdateSession.NotifyWhenAvailable(aStatus);        
+    
+        iData->iSurfaceUpdateSession.SubmitUpdate(KAllScreens, iData->iSurfaceId, aBufferNumber);
+        }
+    else
+        {
+        iData->iSourceStatus = CAlfCompositionPixelSourceData::EPaused;
+        }
+    region.Close();
+    return draw;
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfCompositionPixelSource::HandleEventL
+// ---------------------------------------------------------------------------
+//
+void CAlfCompositionPixelSource::HandleEventL(TInt aEventType, TAny* aEventData)
+    {
+    switch (aEventType)
+        {        
+        case KAlfCompositionFrameReady:
+            {
+            // do nothing for now
+            }    
+            break;
+        case KAlfCompositionLowOnGraphicsMemory:
+        case KAlfCompositionTargetHidden:
+            {
+            // suspend drawing
+            Suspend();
+            }    
+            break;
+        default:
+            break;
+        }
+    // call base class
+    CAlfCompositionSource::HandleEventL( aEventType, aEventData );
+    }
+
+//end of file    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfDecoderServerClient/src/alfdecoderserverclient.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,219 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <alf/alfappui.h>
+#include "alfdecoderserverclient.h"
+#include "alfstreamerconsts.h"
+#include "alfuids.h"
+
+_LIT(KAlfServerThreadName, "alfredserver");
+static void RunServerL()
+    {
+    CActiveScheduler* s=new(ELeave) CActiveScheduler;
+    CleanupStack::PushL(s);
+    CActiveScheduler::Install(s);
+
+    CAlfAppUi* appUiStub = new (ELeave) CAlfAppUi();
+    CleanupStack::PushL(appUiStub);
+    appUiStub->ConstructL(); 
+     
+    CActiveScheduler::Start();
+        
+    CleanupStack::PopAndDestroy(2); 
+    }
+
+TInt AlfThreadFucntion(TAny*)
+    {
+    TInt err = User::RenameThread(KAlfServerThreadName);
+    if ( err != KErrNone )
+        {
+        return err;
+        }
+        
+    // create CCleanup
+    CTrapCleanup * cleanup = CTrapCleanup::New();
+    if (cleanup)
+        {
+        TRAP(err, RunServerL());
+        delete cleanup;
+        }
+
+    return err;
+    }
+
+EXPORT_C void AlfServerStarter::StartL(TRequestStatus& aStatus, TBool aCreateProcess)
+	{
+    TName serverName;
+    TUid appUid = TUid::Uid(KAlfAppServerCoreUid3);
+    _LIT(KServerNameFormat, "%08x_%08x_AppServer");
+    serverName.Format( 
+            KServerNameFormat, 
+            appUid, 
+            appUid.iUid );
+    TFindServer serverFinder(serverName);
+    TFullName fullName;
+    if (serverFinder.Next(fullName) != KErrNone)
+        {
+ 	    const TUidType serverUid(TUid::Uid(0x1000007a),TUid::Uid(0x100039ce),TUid::Uid(0xdabadaba));
+
+		if (aCreateProcess)
+			{
+	    	RProcess server;
+	    	User::LeaveIfError(server.Create(_L("z:\\sys\\bin\\alfserver.exe"),_L(""),serverUid));
+	        server.Rendezvous(aStatus);
+	        if (aStatus!=KRequestPending)
+	            {
+		        server.Kill(0);         // abort startup
+	            }
+	        else
+	            {
+		        server.Resume();        // logon OK - start the server
+	            }
+	        }
+	    else
+	    	{
+    	    RThread serverThread;
+    	    User::LeaveIfError(serverThread.Create(
+	    	        KAlfServerThreadName,
+	    	        AlfThreadFucntion,
+	    	        16384, // magic
+	    	        20000, // uses own heap for now
+	    	        10000000,
+	    	        0,
+	    	        EOwnerThread));
+	    	    
+	    	serverThread.Rendezvous(aStatus);
+	    	serverThread.Resume();
+	    	serverThread.Close();
+	    	}
+        }
+	else
+		{
+		// Someone else already started the server, weird
+		User::Leave(KErrAlreadyExists);
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// Connect
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RAlfBridgerClient::Connect()
+    {
+	return CreateSession(ALFSTREAMER_SERVER_NAME,TVersion(1,1,1));
+    }
+
+// ---------------------------------------------------------------------------
+// SendSynch
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RAlfBridgerClient::SendSynch(TInt aOp, const TDesC8& aBuffer)
+    {
+    return SendReceive(aOp, TIpcArgs(&aBuffer));
+    }
+
+// ---------------------------------------------------------------------------
+// SendSynch
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RAlfBridgerClient::SendSynch(TInt aOp, const TIpcArgs& aIPCArgs )
+    {
+    return SendReceive(aOp, aIPCArgs );
+    }
+
+// ---------------------------------------------------------------------------
+// SendAsyncronous
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RAlfBridgerClient::SendAsynchronous(TInt aOp, const TIpcArgs& aIPCArgs,TRequestStatus& aStatus )
+    {
+    SendReceive(aOp, aIPCArgs, aStatus );
+    }
+
+// Open
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RAlfTfxClient::Open()
+    {
+    return RAlfBridgerClient::Connect();
+    }
+    
+// ---------------------------------------------------------------------------
+// LoadTfxPlugin
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RAlfTfxClient::LoadTfxPlugin(const TUid& aPluginUid)
+    {
+    return SendReceive(EAlfDecodSLoadPlugin, TIpcArgs(aPluginUid.iUid));
+    }
+    
+// ---------------------------------------------------------------------------
+// UnloadTfxPlugin
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RAlfTfxClient::UnloadTfxPlugin(const TUid& aPluginUid)
+    {
+    SendReceive(EAlfDecodSUnloadPlugin, TIpcArgs(aPluginUid.iUid));
+    }
+    
+// ---------------------------------------------------------------------------
+// SendSynchronousData
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RAlfTfxClient::SendSynchronousData(const TUid& aPluginUid, const TDesC8& aInBuf, TDes8& aOutBuf)
+    {
+    return SendReceive(EAlfDecodSSendSynch, TIpcArgs(aPluginUid.iUid, &aInBuf, &aOutBuf));
+    }
+
+// ---------------------------------------------------------------------------
+// SendAsynchronousData
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RAlfTfxClient::SendAsynchronousData(const TUid& aPluginUid, const TDesC8& aInBuf, TDes8& aOutBuf, TRequestStatus& aStatus)
+    {
+    SendReceive(EAlfDecodSSendAsynch, TIpcArgs(aPluginUid.iUid, &aInBuf, &aOutBuf), aStatus);    
+    }
+    
+// ---------------------------------------------------------------------------
+// CancelAsynchronousData
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RAlfTfxClient::CancelAsynchronousData(const TUid& aPluginUid,TInt aCommandId)
+    {
+    SendReceive(EAlfDecodSCancelAsynch, TIpcArgs(aPluginUid.iUid, aCommandId));
+    }
+
+// ---------------------------------------------------------------------------
+// PrepareFrame
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RAlfTfxClient::PrepareFrame(TUint aEstimatedFrameInterval)
+    {
+    Send(EAlfDecodSPrepareFrame, TIpcArgs(aEstimatedFrameInterval));
+    }
+
+// ---------------------------------------------------------------------------
+// SendSynch
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RAlfBridgerClient::SendBlind(TInt aOp, const TIpcArgs& aIPCArgs )
+    {
+    return Send(aOp, aIPCArgs);
+    }
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfDecoderServerClient/src/alfdecoderserverclient.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project alfclient
+*
+*/
+
+
+
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+
+TARGET                  alfdecoderserverclient.dll
+TARGETTYPE              dll
+UID                     0x1000008d 0x2001CB59
+VERSION                 10.0
+
+CAPABILITY              CAP_CLIENT_DLL
+VENDORID                VID_DEFAULT
+
+SOURCEPATH              ../src
+SOURCE                  alfdecoderserverclient.cpp
+SOURCE                  alfcompositionclient.cpp
+
+SYSTEMINCLUDE             ../../ServerCore/Inc
+SYSTEMINCLUDE             ../../CommonInc
+
+
+#include <platform_paths.hrh>
+MW_LAYER_SYSTEMINCLUDE
+
+
+SYSTEMINCLUDE           ../../../../inc
+
+
+LIBRARY                 euser.lib alfappservercore.lib ws32.lib
+LIBRARY					cone.lib 
+LIBRARY					surfaceupdateclient.lib
+LIBRARY					surfacemanager.lib
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfHintPlugin/bwins/alfhintpluginu.def	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,13 @@
+EXPORTS
+	?NewL@CAlfHintGraphic@@SAPAV1@XZ @ 1 NONAME ; class CAlfHintGraphic * CAlfHintGraphic::NewL(void)
+	??1CAlfHintGraphic@@UAE@XZ @ 2 NONAME ; CAlfHintGraphic::~CAlfHintGraphic(void)
+	?UnShare@CAlfHintGraphic@@UAEHVTSecureId@@@Z @ 3 NONAME ; int CAlfHintGraphic::UnShare(class TSecureId)
+	?ShareGlobally@CAlfHintGraphic@@UAEHXZ @ 4 NONAME ; int CAlfHintGraphic::ShareGlobally(void)
+	?HandleMessage@CAlfHintGraphic@@EAEXABVTDesC8@@@Z @ 5 NONAME ; void CAlfHintGraphic::HandleMessage(class TDesC8 const &)
+	?Share@CAlfHintGraphic@@UAEHVTSecureId@@@Z @ 6 NONAME ; int CAlfHintGraphic::Share(class TSecureId)
+	?UnShareGlobally@CAlfHintGraphic@@UAEHXZ @ 7 NONAME ; int CAlfHintGraphic::UnShareGlobally(void)
+	?OnReplace@CAlfHintGraphic@@EAEXXZ @ 8 NONAME ; void CAlfHintGraphic::OnReplace(void)
+	?SetGc@CAlfHintGraphic@@QAEXPAVCWindowGc@@@Z @ 9 NONAME ; void CAlfHintGraphic::SetGc(class CWindowGc *)
+	?InsertTag@CAlfHintGraphic@@QAEHH@Z @ 10 NONAME ; int CAlfHintGraphic::InsertTag(int)
+	?InsertTag@CAlfHintGraphic@@QAEHHVTRect@@H@Z @ 11 NONAME ; int CAlfHintGraphic::InsertTag(int, class TRect, int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfHintPlugin/eabi/alfhintpluginu.def	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,15 @@
+EXPORTS
+	_ZN15CAlfHintGraphic13HandleMessageERK6TDesC8 @ 1 NONAME
+	_ZN15CAlfHintGraphic13ShareGloballyEv @ 2 NONAME
+	_ZN15CAlfHintGraphic15UnShareGloballyEv @ 3 NONAME
+	_ZN15CAlfHintGraphic4NewLEv @ 4 NONAME
+	_ZN15CAlfHintGraphic5ShareE9TSecureId @ 5 NONAME
+	_ZN15CAlfHintGraphic7UnShareE9TSecureId @ 6 NONAME
+	_ZN15CAlfHintGraphic9InsertTagEi @ 7 NONAME
+	_ZN15CAlfHintGraphic9OnReplaceEv @ 8 NONAME
+	_ZN15CAlfHintGraphicD0Ev @ 9 NONAME
+	_ZN15CAlfHintGraphicD1Ev @ 10 NONAME
+	_ZN15CAlfHintGraphicD2Ev @ 11 NONAME
+	_ZN15CAlfHintGraphic5SetGcEP9CWindowGc @ 12 NONAME
+	_ZN15CAlfHintGraphic9InsertTagEi5TRecti @ 13 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfHintPlugin/group/AlfHintPlugin.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project alfappservercore
+*
+*/
+
+
+
+
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+#include <platform_paths.hrh>
+
+TARGETTYPE DLL
+TARGET alfhintplugin.dll
+
+UID 0 0x200242A3
+
+CAPABILITY	CAP_GENERAL_DLL
+VENDORID	0x70000001
+
+SYSTEMINCLUDE /epoc32/include 
+USERINCLUDE ../inc
+SYSTEMINCLUDE ../../CommonInc
+
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH ../src
+
+SOURCE alfhintplugin.cpp
+
+LIBRARY		estor.lib
+LIBRARY		euser.lib
+LIBRARY 	ws32.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfHintPlugin/group/AlfHintPluginDrawer.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project alfappservercore
+*
+*/
+
+
+
+
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+#include <platform_paths.hrh>
+
+TARGETTYPE PLUGIN
+TARGET alfhintplugindrawer.dll
+
+UID			0x10009D8D 0x200242A2
+CAPABILITY      CAP_ECOM_PLUGIN
+VENDORID        VID_DEFAULT 
+
+SYSTEMINCLUDE /epoc32/include 
+SYSTEMINCLUDE ../../CommonInc
+USERINCLUDE	../inc
+SOURCEPATH ../src
+
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCE alfhintplugindrawer.cpp
+
+SOURCEPATH .
+START RESOURCE	alfhintplugindrawer.rss
+TARGET alfhintplugindrawer.rsc
+END
+
+LIBRARY		estor.lib 
+LIBRARY		euser.lib
+LIBRARY		wsgraphicdrawer.lib 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfHintPlugin/group/alfhintplugindrawer.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* 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: 
+*
+*/
+#include <ecom/registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid = 0x200242A2; // KAlfHintDrawerEcomPluginUid
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = 0x200242A4; 
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x200242A1; // KAlfHintDrawerTypeUid 
+					version_no = 1;
+					display_name = "CAlfHintPlugin";
+					default_data = "";
+					opaque_data = "";
+					}
+				
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfHintPlugin/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Build information file for UI Accelerator Architetecture Domain 
+*
+*/
+
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+AlfHintPlugin.mmp
+AlfHintPluginDrawer.mmp
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfHintPlugin/inc/alfhintplugindrawer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef _ALFHINTPLUGINDRAWER_H_
+#define _ALFHINTPLUGINDRAWER_H_
+
+#include <e32std.h>
+#include "graphics/wsgraphicdrawer.h"   // class CWsGraphicDrawer
+
+#include <alfhintpluginuids.h>
+#include <alfhintapi.h>
+
+
+NONSHARABLE_CLASS(CAlfHintGraphicDrawer) : public CWsGraphicDrawer
+    {
+public:
+    enum { EImplUid = 0x200242A1 /*KAlfHintDrawerTypeUid */ };
+    
+    static CAlfHintGraphicDrawer* CreateL();
+    
+    ~CAlfHintGraphicDrawer();
+    
+    void ConstructL(MWsGraphicDrawerEnvironment& aEnv, const TGraphicDrawerId& aId, MWsClient& aOwner, const TDesC8& aData);
+    
+    void HandleMessage(const TDesC8& aData);
+
+private: // from MWsObjectProvider
+
+    TAny* ResolveObjectInterface(TUint aTypeId);
+
+private: // from CWsGraphicDrawer
+
+    void DoDraw(MWsGc& aGc, const TRect& aRect,const TDesC8& aData) const;
+
+private:
+
+    CAlfHintGraphicDrawer();
+    
+private:
+
+    
+    MWsGraphicDrawerEnvironment* iEnv;
+    
+    MAlfHintObserver* iHintApi;
+    
+    /*RPointerArray<CSkin> iSkins;
+    
+    RArray<TInt> iCurrentTargetWindows;
+    */
+    };
+
+#endif // _ALFHINTPLUGINDRAWER_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfHintPlugin/src/alfcrpplugintest.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* 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: 
+*
+*/
+
+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;
+	}
+	
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfHintPlugin/src/alfhintplugin.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,223 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   interface for creating custom extensions
+*
+*/
+ 
+
+#include <s32mem.h> //RDesReadStream
+#include <graphics/commandbuffer.h>
+#include <alfhintpluginuids.h>
+#include <alf/alfhintplugin.h>
+
+// ---------------------------------------------------------------------------
+// constructor
+// ---------------------------------------------------------------------------
+//
+CAlfHintGraphic::CAlfHintGraphic()
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfHintGraphic::~CAlfHintGraphic()
+	{
+	iMsgDataBuf.Close();
+	}
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfHintGraphic* CAlfHintGraphic::NewL(  )
+	{
+	CAlfHintGraphic* self = new(ELeave) CAlfHintGraphic;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfHintGraphic::ConstructL()
+    {
+    /*iMsgDataBuf.ReAllocL(0x100);
+    RDesWriteStream out(iMsgDataBuf);
+    TPckgBuf<TInt32> tag(aWindowHandle);
+    out.WriteL( tag );
+    out.CommitL();*/
+    
+    BaseConstructL( KAlfHintDrawerInstanceUid,  KAlfHintDrawerTypeUid, iMsgDataBuf );
+    //iGc = aGc;
+    
+
+    }
+EXPORT_C void CAlfHintGraphic::SetGc( CWindowGc* aGc )
+    {
+    iGc = aGc;
+    }
+// ---------------------------------------------------------------------------
+// HandleMessage
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfHintGraphic::HandleMessage(const TDesC8& /*aData*/)
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// OnReplace
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfHintGraphic::OnReplace()
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// ShareGlobally
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfHintGraphic::ShareGlobally()
+	{
+	return CWsGraphic::ShareGlobally();
+	}
+
+// ---------------------------------------------------------------------------
+// UnShareGlobally
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfHintGraphic::UnShareGlobally()
+	{
+	return CWsGraphic::UnShareGlobally();
+	}
+
+// ---------------------------------------------------------------------------
+// Share
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfHintGraphic::Share(TSecureId aClientId)
+	{
+	return CWsGraphic::Share(aClientId);
+	}
+
+// ---------------------------------------------------------------------------
+// UnShare
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfHintGraphic::UnShare(TSecureId aClientId)
+	{
+	return CWsGraphic::UnShare(aClientId);
+	}
+
+// ---------------------------------------------------------------------------
+// InsertTagL
+// ---------------------------------------------------------------------------
+//
+TInt CAlfHintGraphic::InsertTagL( TInt aTag  )
+    {
+    TRect aBoundingRectangle(0,0,360,640);
+    TInt aLayerId = 0;
+    if ( aTag >= 0 && aTag < EAlfContentLastTag )
+        {
+        iMsgDataBuf.ReAllocL(0x100);
+        RDesWriteStream out(iMsgDataBuf);
+        TPckgBuf<TUint8> tag(aTag);
+        TPckgBuf<TUint8> zero(0);
+        TPckgBuf<TRect> rect(aBoundingRectangle); 
+        TPckgBuf<TInt32> layerId(aLayerId);
+        out.WriteL( tag );
+        out.WriteL( zero );
+        out.WriteL( rect );
+        out.WriteL( layerId );
+        out.CommitL();
+        const TUid drawerCrpUid = KAlfHintDrawerInstanceUid;
+        const TWsGraphicId KDrawerCrpId(drawerCrpUid);
+
+        static_cast<CWindowGc*>(iGc)->DrawWsGraphic(KDrawerCrpId, TRect(0,0,360,640), iMsgDataBuf );
+        out.Close();
+        }
+    else
+        {
+        return KErrNotSupported;
+        }
+    return KErrNone;
+    }
+
+//
+// This version of InsertTagL() is meant for subwindow effects. 
+//
+TInt CAlfHintGraphic::InsertTagL( TInt aTag, TRect aBoundingRectangle, TInt aLayerId )
+    {
+    if ( aTag >= 0 && aTag < EAlfContentLastTag )
+        {
+        iMsgDataBuf.ReAllocL(0x100);
+        RDesWriteStream out(iMsgDataBuf);
+        TPckgBuf<TUint8> tag(aTag);
+        TPckgBuf<TUint8> zero((TInt)1);
+        TPckgBuf<TRect> rect(aBoundingRectangle); 
+        TPckgBuf<TInt32> layerId(aLayerId);
+        out.WriteL( tag );
+        out.WriteL( zero );
+        out.WriteL( rect );
+        out.WriteL( layerId );
+        out.CommitL();
+        const TUid drawerCrpUid = KAlfHintDrawerInstanceUid;
+        const TWsGraphicId KDrawerCrpId(drawerCrpUid);
+        static_cast<CWindowGc*>(iGc)->DrawWsGraphic(KDrawerCrpId, TRect(0,0,360,640), iMsgDataBuf );
+        out.Close();
+        }
+    else
+        {
+        return KErrNotSupported;
+        }
+    return KErrNone;
+    
+    }
+
+EXPORT_C TInt CAlfHintGraphic::InsertTag( TInt aTag, TRect aBoundingRectangle, TInt aLayerId )
+    {
+    TInt result(KErrNone);
+    TRAPD( err, result = InsertTagL( aTag, aBoundingRectangle, aLayerId ) );
+    if (err )
+        {
+        return err;
+        }
+    else
+        {
+        return result;        
+        }
+    
+    }
+
+// ---------------------------------------------------------------------------
+// InsertTag
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfHintGraphic::InsertTag( TInt aTag  )
+    {// TODO; trap or change name
+    TInt result(KErrNone);
+    TRAPD( err, result = InsertTagL( aTag ) );
+    if (err )
+        {
+        return err;
+        }
+    else
+        {
+        return result;        
+        }
+    } 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfHintPlugin/src/alfhintplugindrawer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,133 @@
+/*
+* 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: 
+*
+*/
+
+#include <ecom/implementationproxy.h>
+#include <s32mem.h> // for RDesReadStream
+#include "alfhintplugindrawer.h"
+#include <alfhintapi.h>
+
+LOCAL_C const TImplementationProxy KImplementationTable[] = 
+    {
+    // TODO: CHANGE ID
+    IMPLEMENTATION_PROXY_ENTRY(CAlfHintGraphicDrawer::EImplUid, CAlfHintGraphicDrawer::CreateL),
+    };
+
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = (sizeof(KImplementationTable) / sizeof(TImplementationProxy));
+    return KImplementationTable;
+    }
+
+// ---------------------------------------------------------------------------
+// CreateL
+// ---------------------------------------------------------------------------
+//
+CAlfHintGraphicDrawer* CAlfHintGraphicDrawer::CreateL()
+    {
+    return new(ELeave) CAlfHintGraphicDrawer;
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfHintGraphicDrawer
+// ---------------------------------------------------------------------------
+//
+CAlfHintGraphicDrawer::CAlfHintGraphicDrawer()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ~CAlfHintGraphicDrawer
+// ---------------------------------------------------------------------------
+//
+CAlfHintGraphicDrawer::~CAlfHintGraphicDrawer()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfHintGraphicDrawer::ConstructL(MWsGraphicDrawerEnvironment& aEnv, const TGraphicDrawerId& aId, 
+                                MWsClient& aOwner, const TDesC8& aData)
+    {
+    iEnv = &aEnv;
+    BaseConstructL(aEnv, aId, aOwner);
+    iHintApi = static_cast<MAlfHintObserver*>(aEnv.Screen(0)->ResolveObjectInterface( KAlfHintObjectInterface ) );
+    /*RDesReadStream in(aData);
+    TInt windowHandle = in.ReadInt32L();
+*/
+    User::LeaveIfError(ShareGlobally());
+    }
+    
+// ---------------------------------------------------------------------------
+// ResolveObjectInterface
+// ---------------------------------------------------------------------------
+//
+TAny* CAlfHintGraphicDrawer::ResolveObjectInterface(TUint aTypeId)
+    {
+    switch(aTypeId)
+        {
+        default:
+            return CWsGraphicDrawer::ResolveObjectInterface(aTypeId);
+        }
+    }   
+
+// ---------------------------------------------------------------------------
+// DoDraw
+// ---------------------------------------------------------------------------
+//
+void CAlfHintGraphicDrawer::DoDraw(MWsGc& aGc, const TRect& aRect, const TDesC8& aData) const
+    {
+    // read data
+    TInt err = 0;
+    TInt tag = KErrNotFound;
+    TRect boundingRectangle(0,0,360,240);
+    TInt layerId = 0;
+    TInt extraParameters = 0;
+    TRAP( err, 
+    RDesReadStream in(aData);
+    tag = in.ReadInt8L();
+    extraParameters = in.ReadInt8L();
+    in.ReadL((TUint8*)&boundingRectangle,sizeof(TRect));
+    layerId = in.ReadInt32L();
+    );
+    
+    if (iHintApi) 
+        {
+        if (!extraParameters)
+            {
+            iHintApi->InsertTagL( tag );
+            }
+        else
+            {
+            iHintApi->InsertTagL( tag, boundingRectangle, layerId );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// HandleMessage
+// ---------------------------------------------------------------------------
+//
+void CAlfHintGraphicDrawer::HandleMessage(const TDesC8& aData)
+    {
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfRenderStage/group/alfnonsupportedwscommands.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Resource definitions for project alfrenderstageplugin
+ *
+*/
+
+
+
+NAME ALFR
+
+#include <eikon.rh>
+#include <avkon.rh>
+#include <avkon.rsg>
+#include <huiwscanvascommands.h>
+
+RESOURCE RSS_SIGNATURE { }
+
+RESOURCE TBUF { buf=""; }
+
+// ---------------------------------------------------------------------------
+// NON_SUPPORTED_COMMAND_ARRAY
+// 
+// ---------------------------------------------------------------------------
+//
+STRUCT NON_SUPPORTED_COMMAND_ARRAY
+    {
+    STRUCT non_supported_command[];
+    }
+
+// ---------------------------------------------------------------------------
+// SUPPORTED_PARAMETER
+// 
+// ---------------------------------------------------------------------------
+//
+STRUCT SUPPORTED_PARAMETER
+    {
+    BYTE value = 0;
+    BYTE bitgdi  = 0;  
+    BYTE vg10    = 0;
+    BYTE gles10  = 0;
+    BYTE gles11  = 0;
+    BYTE gles11DSA = 0;
+    BYTE gles20 = 0;
+    }
+// ---------------------------------------------------------------------------
+// NON_SUPPORTED_COMMAND
+// 
+// ---------------------------------------------------------------------------
+//
+STRUCT NON_SUPPORTED_COMMAND
+    {
+    BYTE command = 0;
+    BYTE bitgdi  = 1;  
+    BYTE vg10    = 1;
+    BYTE gles10  = 1;
+    BYTE gles11  = 1;
+    BYTE gles11DSA = 1;
+    BYTE gles20 = 1;
+    BYTE possible_performance_problem_in_window = 0;
+    STRUCT supported_parameter[];
+    }
+
+// ---------------------------------------------------------------------------
+// r_alf_non_supported_commands_array
+// Contains non supported commands. Non supported commands can be defined by
+// renderer. AlfRenderStage will mark frames, that contain unsupported
+// commands for renderer in use.
+// ---------------------------------------------------------------------------
+//
+RESOURCE NON_SUPPORTED_COMMAND_ARRAY r_alf_non_supported_commands_array
+    {
+    non_supported_command = 
+    {
+    // This is deprecated. Supported commands are hardcoded to CAlfRsGc
+    };
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfRenderStage/group/alfrenderstage.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2001 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Resource definitions for project AlfRenderStage
+*
+*/
+
+#include <ecom/registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid = 0x200184B5;
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = 0x10285A29;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x200184B6;
+					version_no = 1;
+					display_name = "CAlfRenderStage";
+					default_data = "";
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfRenderStage/group/alfrenderstageplugin.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project alfrenderstageplugin
+*
+*/
+
+
+
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+#include <platform_paths.hrh>
+#include "../../CommonInc/huicompileroptions.mmh"
+
+TARGET		alfrenderstage.dll //200184B5.dll
+TARGETTYPE	PLUGIN
+UID			0x10009D8D 0x200184B5
+CAPABILITY  PowerMgmt ReadDeviceData WriteDeviceData ProtServ
+VENDORID	VID_DEFAULT
+
+//macro _ALF_PRINT_WS_COMMANDS_
+//#define _ALF_PRINT_WS_COMMANDS_
+
+// Basic optimization, delayed state change, use of previously defined text
+// macro _OPTIMIZE_WS_COMMANDS_BASIC_
+
+// unsolved issues with font optimization. e.g. when err
+// macro _OPTIMIZE_WS_COMMANDS_FONT_
+
+// Clipping, still some problems with these
+// macro _OPTIMIZE_WS_COMMANDS_ADVANCED_
+
+#ifndef USERINCLUDE_WSGRAPHICDRAWERINTERFACE_H
+macro USERINCLUDE_WSGRAPHICDRAWERINTERFACE_H
+#endif
+
+#ifndef SYMBIAN_VARIATION_POLICY_DOES_NOT_SUCK
+macro SYMBIAN_GRAPHICS_GCE
+#endif
+
+MACRO WS_SETSHAPE_SUPPORT
+
+// MACRO ALF_DEBUG_TRACK_DRAWING
+
+// For disabling the DoPatternSearch command when using NVG
+MACRO __NVG
+
+SOURCEPATH      ../group
+START RESOURCE alfnonsupportedwscommands.rss
+HEADER
+TARGETPATH ECOM_RESOURCE_DIR
+END
+
+
+USERINCLUDE 	../inc
+SYSTEMINCLUDE /epoc32/include 
+SYSTEMINCLUDE ../../CommonInc
+SYSTEMINCLUDE ../../ServerCore/Inc // todo..
+
+MW_LAYER_SYSTEMINCLUDE
+
+SOURCEPATH	../src
+SOURCE      alfrenderstageplugin.cpp 
+SOURCE      alfrenderstage.cpp
+SOURCE      alfrenderstagefactory.cpp
+SOURCE      alfrssendbuffer.cpp
+SOURCE      alfrsgc.cpp
+SOURCE      alfasynchgoomsession.cpp
+
+SOURCEPATH	../group
+RESOURCE	alfrenderstage.rss // 200184B5.rss
+
+LIBRARY     bitgdi.lib
+LIBRARY     ecom.lib
+LIBRARY     estor.lib
+LIBRARY     euser.lib
+LIBRARY     fbscli.lib
+LIBRARY     gdi.lib
+LIBRARY     alfdecoderserverclient.lib
+LIBRARY     wsgraphicdrawer.lib
+LIBRARY     hal.lib
+LIBRARY     lookuptable.lib // for fader
+LIBRARY     bafl.lib
+LIBRARY     commonengine.lib        // Resource loader
+LIBRARY     efsrv.lib
+LIBRARY     flogger.lib
+LIBRARY     goommonitor.lib
+
+#ifdef _ALF_PRINT_WS_COMMANDS_
+LIBRARY 	    alfcommanddebug.lib
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfRenderStage/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Build information file for project alfrenderstageplugin
+*
+*/
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_MMPFILES
+
+alfrenderstageplugin.mmp
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfRenderStage/inc/alfasynchgoomsession.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   alfasynchgoomsession provides asynchronous 
+*                connection to graphics out of memory monitor.
+*
+*/
+
+
+
+#ifndef __ALFASYNCHGOOMSESSION_H__
+#define __ALFASYNCHGOOMSESSION_H__
+
+#include <e32base.h>
+#include <goommonitorsession.h>
+
+/**
+ * Active object to handle asynchronous connection to GOOM thread.
+ */
+NONSHARABLE_CLASS( CAlfAsynchGoomSession ) : public CActive
+    {
+public:
+    /**
+     * Constructor.
+     */
+    CAlfAsynchGoomSession();
+
+    /**
+     * Destructor.
+     */
+    ~CAlfAsynchGoomSession();
+    
+    /**
+     * Informs that application is about to start.
+     * This is the method clients should use.
+     * @param aAppUid application UID.
+     */
+    void AppAboutToStart( const TUid& aAppUid );
+
+    /**
+     * Informs that application is considered to be closed.
+     * @param aAppUid application UID.
+     */
+    void AppClosed( const TUid& aAppUid );
+
+public:
+    /**
+     * Starts connection creation to goom.
+     */
+    void Start();
+
+    /**
+     * Handles completion of request.
+     */
+    void RunL();
+    
+    /**
+     * Cancels pending request.
+     */
+    void DoCancel();
+
+private:
+    // Goom session. Owned.
+    RGOomMonitorSession iGoomSession;
+    
+    // ETrue if connecting, EFalse otherwise.
+    TBool iConnecting;
+    
+    // ETrue if connected. 
+    TBool iConnected;
+    
+    // Pending UIDs of started applications, but not yet
+    // delivered to GOOM. Owned.
+    RArray<TUid> iPendingUids;
+    
+    // Running application list. Owned.
+    RArray<TInt> iRunningAppsList;
+    };
+
+#endif //__ALFASYNCHGOOMSESSION_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfRenderStage/inc/alfrenderstage.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,301 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   AlfRenderStage provides a method for redirect avkon drawing to a graphics accelerator
+*
+*/
+
+
+
+#ifndef __ALFRENDERSTAGE_H__
+#define __ALFRENDERSTAGE_H__
+
+#include <graphics/wsrenderstage.h>
+#include <graphics/wscursor.h>
+#include "alfrsgc.h"
+#include <alfhintapi.h>
+
+#include <graphics/wsgraphicdrawer.h>
+#include <e32hashtab.h>
+#include <alfstreamerconsts.h>
+#include "alfrssendbuffer.h"
+#include "alfrenderstageutils.h"
+
+class CAlfFader;
+class CFbsBitGc;
+class MWsGraphicDrawerEnvironment;
+class CAlfRenderStage;
+class CAlfAsynchGoomSession;
+
+ 
+/**
+ *  This is the implementation of CAlfRenderStage which is created by a CAlfRenderStageFactory
+ *
+ *  This class provides interface for applications to draw and manipulate the screen. It listenes
+ *  window events and draw commands (passed via CAlfGraphicsContext) and serializes the data. After frame
+ *  draw is complete, the serialized data is passed to AlfStreamerServer for further processing.
+ *
+ *  @lib alfrenderstage.lib
+ *  @since S60 v5.2
+ */
+
+class CAlfRenderStage : 
+    public CWsRenderStage, 
+    public MWsEventHandler,
+    public MWsTextCursor,
+    public MAlfCompositionAgnosticWindowTreeObserver,
+    public MAlfHintObserver,
+    public MWsDrawAnnotationObserver
+        {
+public:
+
+    /**
+     * NewL
+     * 
+     * Constructor
+     * 
+     * @param aEnv   
+     * @param aScreen   
+     * @param aScreenNumber   
+     * @return  New instance of the class
+     */
+    static CAlfRenderStage* NewL(MWsGraphicDrawerEnvironment* aEnv, MWsScreen* aScreen, TInt aScreenNumber, CWsRenderStage* aNext);
+	
+    /**
+     * C++ destructor
+     */
+    ~CAlfRenderStage();    
+
+public: // New methods
+        
+    /**
+     * EndCallBack
+     *
+     * Asynchronous SendBuffer
+     * 
+     * @param aFinished   
+     */
+    void EndCallBack( TRequestStatus* aFinished );
+
+    /**
+     * WsGraphicsContext
+     *
+     * Getter function
+     * 
+     * @return Graphics context
+     */
+    CAlfGraphicsContext* WsGraphicsContext();
+
+    /**
+     * AlfSendBuffer
+     * 
+     * Getter function
+     * 
+     * @return Send buffer
+     */
+    CAlfRsSendBuffer* AlfSendBuffer();
+
+    /**
+     * ScreenNumber
+     * 
+     * Getter function
+     * 
+     * @return Screen number
+     */     
+   TInt ScreenNumber() const;
+
+public: // From CWsRenderStage
+
+    TAny* ResolveObjectInterface(TUint aTypeId);
+    void Begin(const TRegion* aRegion);
+    void End(TRequestStatus* aFinished);	
+public: // from MWsEventHandler
+
+    /**
+     * @note This will be soon obsolete.
+     */
+    void DoHandleEvent(const TWservCrEvent& aEvent);
+    
+public: // from MWsTextCursor
+    
+    void DrawTextCursor(const TTextCursorInfo& aTextCursorInfo);
+
+public: // from MAlfCompositionWsWindowTreeObserver
+
+	void NodeCreated(const MWsWindowTreeNode& aWindowTreeNode, MWsWindowTreeNode const* aParent);
+	void NodeReleased(const MWsWindowTreeNode& aWindowTreeNode);
+	void NodeActivated(const MWsWindowTreeNode& aWindowTreeNode);
+	void NodeExtentChanged(const MWsWindowTreeNode& aWindowTreeNode, const TRect& aRect );
+	void SiblingOrderChanged(const MWsWindowTreeNode& aWindowTreeNode, TInt aNewPos);
+	void FlagChanged(const MWsWindowTreeNode& aWindowTreeNode, TInt aFlags, TBool aNewValue);
+	void AttributeChanged(const MWsWindowTreeNode& aWindowTreeNode, TInt aAttribute );
+	void FadeCountChanged(const MWsWindowTreeNode& aWindowTreeNode, TInt aFadeCount);
+	void TransparentRegionChanged(const MWsWindowTreeNode& aWindowTreeNode, const TRegion& aNewTransparentRegion, const TRegion* aNewOpaqueRegion);
+	void MovedToWindowGroup(const MWsWindowTreeNode& aWindowTreeNode, const MWsWindowTreeNode& aNewWindowGroupNode);
+	void WindowGroupChained(const MWsWindowTreeNode& aParent, const MWsWindowTreeNode& aChild);
+	void WindowGroupChainBrokenAfter(const MWsWindowTreeNode& aWindowGroupNode);
+	void FadeAllChildren(const MWsWindowTreeNode& aWindowTreeNode, TBool aFaded);
+	
+public: // from MWsDrawAnnotationObserver
+	void WindowRedrawStart(const MWsWindowTreeNode& aWindowTreeNode, const TRegion& aRegion);
+	void WindowRedrawEnd(const MWsWindowTreeNode& aWindowTreeNode);
+	void WindowAnimRedrawStart(const MWsWindowTreeNode& aWindowTreeNode, const TRegion& aRegion);
+	void WindowAnimRedrawEnd(const MWsWindowTreeNode& aWindowTreeNode);
+	void SpriteRedrawStart(const MWsWindowTreeNode& aWindowTreeNode, const TRegion& aRegion);
+	void SpriteRedrawEnd(const MWsWindowTreeNode& aWindowTreeNode);
+	void SpriteFlash(const MWsWindowTreeNode& aWindowTreeNode, TBool aFlashOn);
+	void SegmentRedrawStart( const TRegion& /*aRegion */);
+	void SegmentRedrawEnd( );
+	
+public: // from MAlfHintObserver
+    
+    void InsertTagL( TInt aTag, TInt32 aParameter = 0 );
+    void InsertTagL( TInt aTag, TRect aBoundingRect, TInt aLayerId );
+    
+protected: // New methods
+
+    /**
+     * C++ constructor
+     */
+    CAlfRenderStage(CWsRenderStage* aNext);
+
+    /**
+     * ConstructL
+     *
+     * @param aEnv
+     * @param aScreen
+     * @param aScreenNumber
+     */
+    virtual void ConstructL(MWsGraphicDrawerEnvironment* aEnv, MWsScreen* aScreen, TInt aScreenNumber);
+
+    /**
+     * InitL
+     */
+    virtual void InitL();
+
+    /**
+     * HasWindowRectChanged
+     *
+     * Temporary function until WServ can provide the same information.
+     * 
+     * @param aId
+     * @param aRect
+     * @return 
+     */
+    TBool HasWindowRectChanged( TUint32 aId, TRect& aRect );
+
+    /**
+     * DoHandleRedraw
+     *
+     * Handles window drawing related events.
+     *
+     * @param aEvent    Event to be handled
+     */
+    void DoHandleRedrawL( const TWservCrEvent& aEvent );
+
+    /**
+     * Draws standard text cursor. Client is expected to call commit.
+     * @param aWindowTreeNode window tree node.
+     * @param aExtent extent.
+     * @param aClipRect clip rect.
+	 * @param aCursorRect cursor rect.
+     */
+    void DoDrawTextCursor( 
+        const MWsWindowTreeNode& aWindowTreeNode, 
+        const TRect& aExtent, 
+        const TRect& aClipRect,
+        const TRect& aCursorRect );
+
+protected:
+	
+    //TTimeStamp iTimeStamp;
+		
+    const TRegion* iUpdateRegion;
+    
+    /**
+     * Own.
+     */
+    MWsScreen* iScreen;
+        
+    /**
+     * Own.
+     */
+	CAlfGraphicsContext* iWsGraphicsContext; // MWsGraphicsContext
+
+    /**
+     * Own.
+     */
+	CAlfRsSendBuffer* iAlfSendBuffer;
+    
+    /**
+     * Not own.
+     */
+	MWsGraphicDrawerEnvironment* iEnv;
+    
+    /**
+     * Returns the stream size
+     */
+	TInt iWindowBufferIndex;
+
+	/**
+	 * @todo
+	 * @note This is temporary structure for figuring out, if window size or position has changed since previous update.
+	 *       WServ will provide event about these in the future.
+	 */
+	RHashMap<TUint32, TRect> iWindowData;
+	
+	/**
+	 * Fader interface
+	 * Own.
+	 */
+	CAlfFader*  iFader;
+	
+    TInt iScreenNumber;
+    
+    TBool iDrawingActive;
+    
+    RArray<TInt> iWindowIds;
+
+    /**
+     * @note Remove this when there is screen device for hw and correct sizes can be asked from there
+     */
+    TBool iNormalOrientation;
+
+    /** For keeping track of segmentredraws inside windowredraws **/
+    const MWsWindowTreeNode* iWindowDrawingNode;
+    TBool iSegmentRedrawActive;
+    
+	CWsRenderStage* iNext;
+private:
+    // Goom connection. Owned.
+    CAlfAsynchGoomSession* iGoomSession;
+    
+    // Current sprite draw node.
+    const MWsWindowTreeNode* iSpriteRedraw;
+    
+    // Enumeration for sprite flash
+    enum TSpriteFlash
+        {
+        // Sprite flash hasn't been set
+        ESpriteFlashUndefined,
+        // Sprite flash set with ETrue parameter
+        ESpriteFlashOn,
+        // Sprite flash set with EFalse parameter
+        ESpriteFlashOff
+        };
+    // Sprite flash setting for iSpriteRedraw
+    TSpriteFlash iSpriteRedrawFlash;
+    
+	};
+
+#endif //__ALFRENDERSTAGE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfRenderStage/inc/alfrenderstagefactory.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   AlfRenderStage provides a method for redirect avkon drawing to a graphics accelerator
+*
+*/
+
+
+
+#ifndef __ALFRENDERSTAGEFACTORY_H__
+#define __ALFRENDERSTAGEFACTORY_H__
+
+#include "graphics/wsplugin.h"
+#include "graphics/wsrenderstagefactory.h"
+
+class CWsRenderStage;
+class MWsGraphicDrawerEnvironment;
+
+/**
+This is an implementation of MWsRenderStageFactory, in the form of a CWsPlugin.
+The window server will use this to create standard render stages for each screen,
+if the ini file specifies them.
+*/
+NONSHARABLE_CLASS(CAlfRenderStageFactory) : public CWsPlugin, public MWsRenderStageFactory
+	{
+public:
+	enum { EImplUid = 0x200184B6 };
+	
+public: // New
+    
+    /**
+     * CreateL
+     * 
+     * Create the class
+     * 
+     * @return New instance of the class
+     */
+	static CAlfRenderStageFactory* CreateL();
+	
+    /**
+     * C++ destructor
+     */
+	~CAlfRenderStageFactory();
+	
+public: // From CWsPlugin
+
+	void ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TDesC8& aData);
+	const TDesC& PluginName() const;
+
+public: // implementation of MWsObjectProvider
+	
+    TAny* ResolveObjectInterface(TUint aTypeId);
+
+public: // implementation of MWsRenderStageFactory
+    
+    CWsRenderStage* CreateFinalRenderStageL(MWsScreen* aScreen, MWsScreenRedraw* aScreenRedraw, TInt aScreenNumber);
+    CWsRenderStage* CreateRenderStageL(MWsScreen* aScreen, MWsScreenRedraw* aScreenRedraw, CWsRenderStage* aNextStage);
+    CWsRenderStage * CreateStageL(MWsScreen * aScreen, MWsScreenRedraw * aScreenRedraw)
+        {
+        return CreateRenderStageL(aScreen, aScreenRedraw, 0);
+        }
+
+private: // New
+    
+    /**
+     * C++ constructor
+     */
+	CAlfRenderStageFactory();
+	
+	};
+
+#endif //__STDRENDERSTAGEFACTORY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfRenderStage/inc/alfrsgc.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,397 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   AlfRenderStage provides a method for redirect avkon drawing to a graphics accelerator
+*
+*/
+
+#ifndef CALFRSGC_H_
+#define CALFRSGC_H_
+
+#include <graphics/wsgraphicscontext.h>
+#include <s32mem.h>
+#include <e32std.h>
+#include <gdi.h>
+
+class CAlfRsSendBuffer;
+class CFbsBitGc;
+class CFbsScreenDevice;
+
+const TInt KAlfRsGcMaxClippingRects = 20;
+
+/**
+ *  This class serializes commands sent to graphics context by using CAlfRsSendBuffer . 
+ *  
+ *  @lib alfrenderstage.lib
+ *  @since S60 v5.2
+ */
+
+NONSHARABLE_CLASS(CAlfGraphicsContext) : public CBase, public MWsGraphicsContext
+		{
+	public: // New methods
+
+        /**
+         * NewL
+         * 
+         * Constructor
+         *
+         * @param   aAlfSendBuffer Send buffer
+         * @return  New instance of the class
+         */
+		static CAlfGraphicsContext* NewL( CAlfRsSendBuffer& aAlfSendBuffer );
+
+        /**
+         * C++ destructor
+         */
+		~CAlfGraphicsContext();
+
+        /**
+         * ResetDrawCommandCount
+         *
+         * Each call of command which requires drawing increases iDrawCommandCount. This is used for
+         * skipping serialization of draw commands that have no effect on screen. @See  DrawCommandCount.
+         */
+        void ResetDrawCommandCount() 
+            {
+            iDrawCommandCount = 0; 
+            };
+
+        /**
+         * DrawCommandCount
+         *
+         * @return Amount of effective draw commands since last call of ResetDrawCommand.
+         */
+        TInt DrawCommandCount()
+            {
+            return iDrawCommandCount; 
+            };
+    
+#ifdef _OPTIMIZE_WS_COMMANDS_ADVANCED_
+        /**
+         * CheckDelayedClipping
+         * 
+         * Assertains if the previous clipping (EAlfSetClipRegion) command can be delayed or skipped.
+         * 
+         * @param   aClippingRect
+         * @return  previous clipping command status 
+         */
+        TBool CheckDelayedClipping( TRect aClippingRect );
+#endif
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_     
+        /**
+         * FlushStateL
+         * 
+         * Flushes all the modified Gc states.
+         * 
+         * @param aRollbackClippingState contains states that should be rollbacked after flush.
+         *        Currently this is relevant only for clipping.
+         * 
+         */
+        void FlushStateL(  TInt& aRollbackClippingState );
+#endif
+        
+	public: // From MWsGraphicsContext
+	    
+        /**
+         * Following commands are serialized
+         */
+
+	    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 DrawBitmap(const TPoint &aTopLeft, const CFbsBitmap &aSource);
+		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 DrawPolyLine(const CArrayFix<TPoint>* aPointList);
+		void DrawPolyLine(const TPoint *aPointList, TInt aNumPoints);
+		void DrawPolyLineNoEndPoint(const TArray<TPoint>& aPointList);
+		void DrawPolyLineNoEndPoint(const CArrayFix<TPoint>* aPointList);
+		void DrawPolyLineNoEndPoint(const TPoint *aPointList, TInt aNumPoints);
+		void DrawPolygon(const CArrayFix<TPoint>* aPointList, TFillRule aFillRule=EAlternate);
+		void DrawPolygon(const TArray<TPoint>& aPointList, TFillRule aFillRule=EAlternate);
+		void DrawPolygon(const TPoint *aPointList, TInt aNumPoints, 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;
+		void InternalizeL(RReadStream& aReadStream);
+		void ExternalizeL(RWriteStream& aWriteStream);
+		TRgb BrushColor() const;
+		TRgb PenColor() const;
+		TRgb TextShadowColor() const;
+		void CopySettings(const MWsGraphicsContext& aGc);
+		void SetFaded(TBool aFaded);
+		void SetFadingParameters(TUint8 aBlackMap, TUint8 aWhiteMap);
+		void FadeArea(const TRegion *aRegion);
+		void MapColors(const TRect &aRect, const TRgb *aColors, TInt aNumPairs=2, TBool aMapForwards=ETrue);
+		void SetUserDisplayMode(TDisplayMode aDisplayMode);
+		TInt UseFont(TInt aFontHandle);
+
+        /**
+         * GetError
+         * 
+         * Return current error status of MWsGraphicsContext
+         *
+         * @return 
+         */
+		TInt GetError()
+		    {
+		    return KErrNone; // @todo
+		    }
+
+		/**
+         * Origin
+         * 
+         * The origin of the GC relative to the screen's origin
+         *
+         * @return Origin
+         */
+		TPoint Origin() const;
+
+        /**
+         * ClippingRegion
+         * 
+         * The clipping region currently being used
+         *
+         * @return Clipping region
+         */
+		const TRegion& ClippingRegion()
+	       {
+	       return iClippingRegion;
+	       }
+		
+		/**
+		 * Push
+		 * 
+		 * Saves the state of the GC to an internal buffer.  Several GC states can be saved in a FILO.
+		 * Do not restore a GC (using Pop()) that wasn't properly saved!
+		 *
+		 * @return KErrNone if successful, else one of the system-wide error codes
+		 */
+		TInt Push()
+		    {
+		    return KErrNotSupported; // @todo
+		    }
+		
+		/**
+		 * Pop
+		 * 
+		 * Restores the last GC state that was saved.
+		 */
+		void Pop()
+		    {
+		    // @todo
+		    }
+
+    private: // New methods
+        
+        /**
+         * C++ constructor
+         *
+         * @param aAlfSendBuffer
+         */
+        CAlfGraphicsContext( CAlfRsSendBuffer& aAlfSendBuffer );
+
+        /**
+         * ConstructL
+         *
+         * Construct
+         */
+        void ConstructL( );
+
+        /**
+         * DoReset
+         * 
+         * Reset all context variables to their default values
+         */
+        void DoReset();
+        
+	private:
+
+        /**
+         * locally cached context variables.
+         */
+	    TPoint iOrigin;
+	
+        /**
+         * clipping regions are in screen coordinates
+         */
+	    RRegionBuf<KAlfRsGcMaxClippingRects> iClippingRegion;
+	    
+	    TRect  iClippingRect;
+	    
+	    TInt iFontHandle;
+	    	    
+	    TRgb iTextShadowColor;
+	    
+	    TBool iBrushPatternSet;
+	    
+	    TInt iBrushPattern;
+	    
+	    TRgb iPenColor;
+	    
+	    TRgb iBrushColor;
+	    
+	    TSize iPenSize;
+	    
+	    TInt iDrawMode;
+	    
+	    TPoint iLinePosition;
+	    
+	    TBool iBrushUsed;
+	    
+	    TPoint iBrushOrigin;
+        
+	    TInt iBrushStyle;
+        
+	    TInt iCharJustExcess;
+        
+	    TInt iCharJustNum;
+        
+	    TInt iWordJustExcess;
+        
+	    TInt iWordJustNum;
+        
+	    TPoint iDitherOrigin;
+        
+	    TInt iDotLength;
+        
+	    TInt iDotMask;
+        
+	    TInt iDotParam;
+        
+	    TInt iDotDirection;
+        
+	    TInt iShadowMode;
+        
+	    TInt iStrikethrough;
+        
+	    TInt iUnderline;
+        
+	    TInt iUserDisplayMode;
+        
+	    TInt iPenStyle;
+        
+	    /**
+	     * Not owned.
+	     */
+		CAlfRsSendBuffer& iSendBuffer;
+
+		/*
+		 * Increased whenever command that requires actual drawing is called.
+		 */
+		TInt  iDrawCommandCount;
+		
+#ifdef _OPTIMIZE_WS_COMMANDS_ADVANCED_
+		
+		RRegionBuf<5> iDelayedClippingRegion;
+		RRegionBuf<5> iDelayedDrawRegion;
+
+		enum TRollbackStates
+		    {
+		    ERollbackClippingState = 1 
+		    //ERollbackFontState = 2
+		    };
+
+		RRegionBuf<20> iPreviousClippingRegion;
+
+#endif
+		
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_		
+
+		TInt iRollback;
+
+		enum TDelayedContextState
+            {
+            EModifiedPenStyle = 1,
+            EModifiedBrushStyle = 2,
+            EModifiedPenColor = 4,
+            EModifiedBrushColor = 8,
+            
+            EModifiedClipRect = 16,
+            EModifiedClipReset = 32,
+            
+            EModifiedJustification = 64,
+            EModifiedBrushPattern1 = 128,
+            EModifiedBrushPattern2 = 256,
+            
+            EModifiedSetFontNoDuplicate = 512,
+            EModifiedResetFont = 1024
+            };
+		
+		TInt iPreviousPenStyle;
+		TInt iPreviousBrushStyle;
+		TRgb iPreviousPenColor;
+		TRgb iPreviousBrushColor;
+		TInt iPreviousBrushPattern;
+		TInt iPreviousFontHandle;
+	    
+        TInt32 iDelayedContextState;
+
+#endif
+
+		};
+#endif /*CALFRSGC_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfRenderStage/inc/alfrssendbuffer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,795 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Handles serializing of data and sending it to alf streamer server.
+*
+*/
+
+#ifndef CALFSENDBUFFER_H_
+#define CALFSENDBUFFER_H_
+
+#include <e32cmn.h>
+#include <e32std.h> 
+#include <s32mem.h>
+#include <gdi.h>
+#include <alfwindowstructs.h>
+#include <huiwscanvascommands.h>
+#include "alfrenderstageutils.h"
+
+#define _OLD_STREAM
+
+const TInt KAlfWsCommandCount = 90; 
+const TInt KAlfWsMaxParameterCount = 15;
+const TInt KAlfRsSearchRectMaxCount = 9;
+
+class RAlfBridgerClient;
+class CAlfCommandDebug;
+class TRgb;
+class CAlfRenderStage;
+class TResourceReader;
+class CAlfCompositionCntrlClient;
+/**
+ *  The class handles data serialization and syncronous sending to server. Multiple renderstages will share the same chunk.
+ *
+ *  @code
+ *   iAlfSendBuffer = CAlfRsSendBuffer::NewL();
+ *  @endcode
+ *
+ *  @lib alfrenderstage.lib
+ *  @since S60 v5.2
+ */
+NONSHARABLE_CLASS(CAlfRsSendBuffer) : public CActive, public MAlfBridge
+	{
+    public: // New methods
+      
+	    /**
+	     * NewL
+	     * 
+	     * Constructor
+	     * 
+	     * @param aParent   
+	     * @param aScreenNumber   
+	     * @return  New instance of the class
+	     */
+		static CAlfRsSendBuffer* NewL( CAlfRenderStage& aParent, TInt aScreenNumber );
+
+	    /**
+	     * C++ destructor.
+	     */
+		virtual ~CAlfRsSendBuffer();
+
+		/**
+	     * ConnectL
+	     *
+	     * Establish connection to AlfStreamerServer.
+	     *
+	     * @return ETrue, if connection was made or connection was already established. Otherwise returns EFalse
+	     */
+		TBool ConnectL();
+
+        /**
+         * Connected
+         *
+         * Check connection state
+         *
+         * @return Connection state
+         */
+		TBool Connected(){ return iChunk.Handle(); }
+		
+        /**
+         * WriteIntsL
+         * 
+         * Convenience function for writing TInt values to the stream
+         *
+         * @param aCommand  CommandId
+         * @param aCount    Amount of TInt values to be streamed
+         * @param aFirst    The first value
+         * @param ...       variable aCount-1 amount of TInt values
+         */
+	    void WriteIntsL( const TUint8& aCommand, TInt aCount, TRefByValue<const TInt> aFirst, ...);
+
+	    /**
+         * WriteIntL
+         * 
+         * Convenience function for writing possible unsupported command (depending on its parameters) to the stream 
+         *
+         * @param aCommand   CommandId
+         * @param aValue    parameters value
+         */
+	    void WriteIntL( const TUint8& aCommand, TInt aValue );
+	    
+        /**
+         * WriteRegionL
+         * 
+         * Convenience function for writing region to the stream 
+         *
+         * @param aCommand   CommandId
+         * @param aRegion    Region
+         */
+	    void WriteRegionL( const TUint8& aCommand, const TRegion& aRegion );
+	    
+	    /**
+         * WriteDescriptorAndIntsL
+         * 
+         * Convenience function for writing TDesC reference and TInt values to the stream.
+         * Inserts padding to ensure that text starts on divisible by 4 offset.
+         *
+         * @param aCommand  CommandId
+         * @param aText     Descriptor to be streamed
+         * @param aCount    Amount of TInt values to be streamed
+         * @param aFirst    The first value
+         * @param ...       variable aCount-1 amount of TInt values
+         */
+        void WriteDescriptorAndIntsL( const TUint8& aCommand, const TDesC& aText, TInt aCount, TRefByValue<const TInt> aFirst,... );
+
+        /**
+         * WriteDescriptorL
+         * 
+         * Convenience function for writing TDesC reference to the stream. 
+         * Inserts padding to ensure that text starts on divisible by 4 offset.
+         *
+         * @param aCommand  CommandId
+         * @param aText  Descriptor to be streamed
+         * @param aTextParameter    Text parameters
+         * @param aCount Amount of Ints to be streamed
+         * @param aFirst    The first value
+         * @param ...       variable aCount-1 amount of TInt values
+         */
+        void WriteDescriptorAndIntsL(const TUint8& aCommand, const TDesC& aText, const CGraphicsContext::TTextParameters* aTextParameter, TInt aCount, TRefByValue<const TInt> aFirst, ... );
+
+	    /**
+         * WriteCommandL
+         * 
+         * Convenience function for writing 1 value to the stream
+         *
+         * @param aCommand  Command
+         * @param aSize  Size
+         */
+        void WriteCommandL( const TUint8& aCommand, TInt aSize = 0);
+
+        /**
+         * WritePointArrayL
+         * 
+         * Convenience function for writing pointer array to the stream
+         *
+         * @param aCommand  CommandId
+         * @param aPoWriteIntList  Point array to be streamed
+         */
+        void WritePointArrayL( const TUint8& aCommand, const CArrayFix<TPoint>* aPoWriteIntList );
+
+        /**
+         * WritePointArrayL
+         * 
+         * Convenience function for writing pointer array to the stream
+         *
+         * @param aCommand  CommandId
+         * @param aPoWriteIntList  Point array to be streamed
+         * @param aNumPoints  Point array to be streamed
+         */
+        void WritePointArrayL( const TUint8& aCommand, const TPoint* aPoWriteIntList, TInt aNumPoints );
+
+        /**
+         * WritePointArrayL
+         * 
+         * Convenience function for writing pointer array to the stream
+         *
+         * @param aCommand  CommandId
+         * @param aPoWriteIntList  Point array to be streamed
+         */
+        void WritePointArrayL( const TUint8& aCommand, const TArray<TPoint>* aPoWriteIntList );
+        
+        /**
+         * WriteFlagsL
+         * 
+         * Write flags to the stream
+         */
+        void WriteFlagsL();
+        
+	//
+	// ARRAY IMPLEMENTATION
+	//	
+	struct TOffsetElem
+	{
+	TInt32 iOffset; // offset from beginning of buffer
+	TInt32 iSize;   // size of the data.
+	TInt32 iLayerId;
+    TRect iBoundingRectangle;
+    };
+
+
+	void WriteArrayHeaderTemplateL();
+	void InitTOffsetElemArray(RArray<TOffsetElem> &aOffset);
+	void WriteArrayHeaderL(const TOffsetElem &aIndexArrayOffset);
+	TOffsetElem WriteIndexArrayL(const RArray<TOffsetElem> &aOffset);
+	void InitMarker(TInt &aMarker);
+	void StartMarkerL(TInt &aMarker, TRect &aRectangle, TInt &aLayer, TRect aBoundingRectangle, TInt aLayerId);
+	void EndMarkerL(RArray<TOffsetElem> &aOffset, TInt &aMarker, const TRect &aRectangle, TInt aLayerId);
+    void StartMarkerL(TRect aBoundingRectangle, TInt aLayerId);
+    void EndMarkerL();
+	
+       /**
+        * SendL
+        *
+        * Sends commands to via AlfBridger to AlfStreamerServer. Flushes the buffer.
+        * iBufStream is ready for writing after this call.
+        *
+        * @param aStatus  Request status
+        */
+        void SendL( TRequestStatus* aStatus );
+
+        /**
+         * Commit
+         * 
+         * Report the last written offset. Reader side may read until
+		 * offset.
+         * 
+         */
+        void Commit();
+
+        /**
+         * CommitL
+         * 
+         * Starts the timer for FlushBuffer call. The idea is to deliver bigger 
+         * patch of commands to alf in one go and avoid unnecessary IPC calls.
+         * 
+         */
+        void CommitL( );
+
+        /**
+         * SetFlag
+         * 
+         * Set flags
+         * 
+         * @param aFlag  Flags
+         */
+        void SetFlag( TAlfSendBufferFrameFlags aFlag );
+
+        /**
+         * EndFrameL
+         * 
+         * Prepares frame for sending
+         */
+        void EndFrameL();
+
+        /**
+         * FrameContainsDataL
+         * 
+         * @return  ETrue, if data has been serialized to the frame after previous call to PrepareBufferL. this is used for filtering out empty
+         *          frames. Wserv might be fixed in the future and this could become obsolete.
+         */
+        TBool FrameContainsDataL();
+
+        /**
+         * SendAsyncCmd
+         * 
+         * Called by CRsAlfNativeWindowListener::RequestEvent. Used when requesting native window handle from 
+         * Alf.
+         * 
+         * @param aFlag  aCmd
+         * @param aFlag  aBuf
+         * @param aFlag  aStatus
+         */
+		void SendAsyncCmd(TInt aCmd, TDes8& aBuf, TRequestStatus& aStatus);
+
+        /**
+         * OpenPrimaryChunkForWritingL
+         * 
+         * Open the stream 
+         */
+		void OpenPrimaryChunkForWritingL();
+		
+        /**
+         * PrepareBufferL
+         * 
+         * Resets buffer. Must be called before Write*L and SendSyncL.
+         */
+        void PrepareBufferL();
+
+		/**
+         * WriteWindowDataL
+         *
+         * Writes data to the stream
+         *
+         * @param aWindowUid
+         * @param aRegionSize
+         * @param aShapeRegionSize
+         */
+        void WriteWindowDataL(TUint32 aWindowUid, TInt aRegionSize, TInt aShapeRegionSize );
+
+        /**
+         * WriteFrameSizeTemplateL
+         * 
+         * Writes a temporary value to the beginning of a frame. This value is later updated with WriteNextFrameBeginL.
+         */
+        void WriteFollowingFrameOffsetTemplateL();
+        
+        /**
+         * WriteFollowingFrameOffsetL
+         * 
+         * Goes back to header of the drawing commands and updates the offset to the following frame.
+         * This is called, when drawing into a single window in a frame is complete.
+         * 
+         * @return  ETrue, If this frame contains any commands. Otherwise EFalse.
+         */
+        TBool WriteFollowingFrameOffsetL(TBool aWriteArray= ETrue);
+	 	
+        /**
+		 * WriteWindowIdentifierL
+		 *
+		 * Convience function for writing window id and group id to the stream
+		 */
+		void WriteWindowIdentifierL();
+
+		/**
+		 * FlushBuffer
+		 * 
+		 * Commands are not passed immediately after they are serialized. There
+		 * is a timer, which regularly flushes the buffer. See doFlushBuffer. 
+		 *
+		 * Buffer is also flushed (or in fact the flushtimer is canceled, and buffer
+		 * is flushed) when SendL is called from CAlfRsRenderStage
+		 * 
+		 */
+		void FlushBuffer();
+
+        /**
+         * SetSupportedCommand
+         * 
+         * Sets this command as supported
+         * 
+         * @param aIndex
+         * @param aSupport
+         */
+		void SetSupportedCommand( TInt aIndex, TInt8 aSupport );
+  
+		/**
+		 * AppendPatternSearchCache
+		 * 
+		 * Caches data for the pattern search. This is call from CAlfRsGc. Cache is released by
+		 * ResetPatternSearch.
+		 * 
+         * @param aSourceBitmap
+         * @param aMaskBitmap
+         * @param aSourceRect
+         * @param aDestPos
+         * @param aInvertMask
+		 */
+	    void AppendPatternSearchCache( const CFbsBitmap& aSourceBitmap, const CFbsBitmap* aMaskBitmap,const TRect& aSourceRect, const TPoint& aDestPos, TBool aInvertMask );
+
+        /**
+         * PreviousCommand
+         * 
+         * This is used for filtering out sequential reset commands in window command stream
+         * 
+         * @return Previous command
+         */
+        inline TInt PreviousCommand(){ return iPreviousCommand; } 
+        
+    public: // From CActive
+
+	    void RunL();
+	    void DoCancel();
+
+	private:
+	    
+       /**
+        * CAlfRsSendBuffer
+        * 
+        * C++ constructor
+        * 
+        * @param aParent
+        * @param aScreenNumber
+        */
+	    CAlfRsSendBuffer( CAlfRenderStage& aParent, TInt aScreenNumber ) : iParent( aParent), iScreenNumber( aScreenNumber) , CActive( EPriorityStandard ){CActiveScheduler::Add( this ); };
+
+       /**
+        * ConstructL
+        * 
+        * Constructor
+        */
+        void ConstructL();
+
+        /**
+         * ReadNonSupportedCommandsL
+         * 
+         * It is known that some commands are not/cannot be supported by certain
+         * renderers. Each frame is inspected in case of such command and frame 
+         * is marked if it has unsupported commands for certain renderer. This
+         * information can be in the future used for selecting suitable renderer
+         * during runtime.
+         * 
+         * @todo This table could be shared with multiple renderstages. 
+         *       Currently each sendbuffer has own table.
+         */
+        void ReadNonSupportedCommandsL();
+        
+        // only in debug mode
+#ifdef _ALF_PRINT_WS_COMMANDS_
+        void ReadCommandDescriptionsL();
+#endif
+
+		/**
+		 * SeekL
+		 * 
+		 */
+	    void SeekL( const TInt aOffset );
+	    
+	    /**
+	     * ConvertToBitsL
+	     * 
+	     * Converts aCount bytes of data into one byte.
+	     * 
+	     * @param  aCount  Must be under 7.
+	     * @param  aReader
+	     * @return Converted result
+	     */
+	    TUint8 ConvertToBitsL( TInt aCount, TResourceReader* aReader );
+           
+        /**
+         * JumpToAnotherChunkL
+         */
+	    void JumpToAnotherChunkL( TInt32 aChunkId, TInt aChunkSize );
+
+        /**
+         * WriteInt8L
+         */
+	    inline void WriteInt8L( const TInt8& aValue )
+	        {
+#ifdef _OLD_STREAM
+	        iBufStream->WriteInt8L( aValue );
+#else
+	        //memcpy( ( TUint8*)(iStreamPtr->Ptr()+iOffset), (const TUint8*)&aValue, sizeof(TInt8));
+	        *(( TUint8*)(iStreamPtr->Ptr()+iOffset)) = aValue;
+#endif
+            iOffset += sizeof(TInt8);
+            }
+		
+        /**
+         * WriteInt32L
+         */
+	    inline void WriteInt32L( const TInt32& aValue )
+	        {
+#ifdef _OLD_STREAM
+	        iBufStream->WriteInt32L( aValue );
+#else
+	        memcpy( ( TUint8*)(iStreamPtr->Ptr()+iOffset), (const TUint8*)&aValue, sizeof(TInt32));
+#endif
+            iOffset += sizeof(TInt32);
+	        }
+	    
+        /**
+         * WriteL
+         */
+	    inline void WriteL( const TUint8* aPtr, TInt aSize )
+	        {
+#ifdef _OLD_STREAM	        
+	        iBufStream->WriteL( aPtr, aSize );
+#else
+	        memcpy( ( TUint8*)(iStreamPtr->Ptr()+iOffset), (const TUint8*)aPtr, aSize);
+#endif
+	        iOffset += aSize;
+	        }
+
+        /**
+         * DoCreateTemporaryChunkL
+         */
+		void DoCreateTemporaryChunkL( TInt aMinimumRequiredSize );
+	    
+	    /**
+	     * DoWrapL
+	     * 
+	     * Wraps the writing in the chunk. This happens when write head has reached the maximum size of the chunk.
+	     * After wrapping, writing continues from the beginning of the chunk. If wrap happens during a frame, then 
+	     * the frame is split into two parts. The first part is padded (@see InsertPaddingL) 
+	     * 
+	     */
+	    void DoWrapL( TInt aCommandSize, TBool aCreateTempororaryChunk );
+	    
+	    /**
+	     * ReserveSpaceL
+	     * 
+	     * Checks if there is enough space to stream the command. Calls DoWrap 
+	     * or DoWait, if there is not enough space for serializing the command. 
+	     * 
+	     * @param  aCommandSize
+	     */
+	    TBool ReserveSpaceL( TInt aCommandSize );
+	    
+        /**
+         * InitCommandL
+         */
+	    TBool InitCommandL( const TUint8& aCommand, TInt aSize );
+
+        /**
+         * CreateTemporaryChunkL
+         */
+	    TBool CreateTemporaryChunkL( TInt& aSize );
+	    
+        /**
+         * OpenRewindChunkL
+         */
+	    void OpenRewindChunkL( TInt aSize );
+	    
+	    /**
+	     * DoPatternSearch
+	     * 
+	     * Searches for certain bitblit pattern.
+	     * 
+	     * This functions is most likely to change in the future.
+	     * 
+	     */
+	    void DoPatternSearch( const TUint8& aCommand, TInt aSize );
+	    
+	    /**
+	     * ResetPatternSearch
+	     * 
+	     * Called when searched pattern was not found and search needs to start
+	     * from beginning.
+	     */
+	    void ResetPatternSearch();
+	  
+	    /**
+	     * FinalizePatternL
+	     * 
+	     * Full pattern was found. Replace the bitblits with EAlfCombinedBitBlit
+	     * that joins the clipping regions, drawrects and partial images into single 
+	     * command.
+	     */
+	    void FinalizePatternL(const TUint8& aCommand);
+	    
+	    /**
+	     * InsertPaddingL
+	     * 
+	     * Each frame payload need to start on address divisible by 4.
+	     * Otherwise operations on the streamed data will fail due to alignment
+	     * issues. This function adds padding if necessary.
+	     */
+	    void InsertPaddingL();
+
+    public:	    
+	    RAlfBridgerClient* Client()
+	        {
+            return iAlfBridgerClient;
+            }
+        void WriteIntsL(TUint8 aCommand, TInt aCount, TInt* aArray);
+	        
+	private:    // data
+	    
+        /**
+         * If this is true this class acts as a stub, the does not really do anything.
+         * That is used when we handle tv-out drawing commands as they should not go to anywhere. 
+         */
+	    TBool iDisabled;
+	    
+        /**
+    	 * Window Uid is cached for the use of FlushBuffer
+    	 */
+    	TUint32 iWindowId;
+
+        TInt iWindowGroupIdentifier;
+
+        /**
+         * Stream access for chunk received from server side
+         */
+#ifdef _OLD_STREAM
+        RMemWriteStream* iBufStream;
+#else        
+        TPtr8* iStreamPtr;
+#endif
+        
+        TInt iNextFrameOffsetPos;
+        
+        TBool iIsSprite;
+        
+        /**
+    	 *	Bridge to Alf stream server
+    	 *
+    	 * 	Own.
+    	 */
+    	RAlfBridgerClient* iAlfBridgerClient;
+
+        /**
+         * Our handle to server chunk. InitBufferL must be called before this is valid.
+         */
+        RChunk iChunk;
+
+        /**
+         * Cache chunks are needed for 2 purposes. See DoCreateTemporaryChunkL for more information.
+         * 1. During booting, the primary chunk (owned by alf) is not available and data must be serialized into something
+         * 2. App (and sequentially Wserv) pushes more data than the primary chunk can chew (write head reachs read head).
+         */  
+        RArray<RChunk> iCacheChunks;
+        
+        /**
+    	 * Non drawing window updates have no relevance to the drawing. If frame update contains only such
+    	 * commands, it can be discarded altogether.
+    	 *
+    	 * Use Mark() to mark the place of frame start. Use RollBack() to set the buffer to the original place,
+    	 * if only non-drawing commands were issued. See CAlfGraphicsContext::iDrawCommandCount for more details.
+    	 */
+#ifdef _OLD_STREAM
+        TStreamPos iFrameBeginOffset;
+#else
+        TInt iFrameBeginOffset;
+#endif
+        /**
+         * Data transfer is normally asynchronous operation. iParent is used for the callback.
+         * Not own.
+         */
+        CAlfRenderStage& iParent;
+
+        /**
+         * The maximum size of the iChunk and iBufStream
+         */
+        TInt iUsedChunkMaxSize;
+        
+        TInt iPrimaryChunkMaxSize;
+        
+        TTime   iBeginTime;
+        
+        TInt iOffset;
+        
+        /**
+         * iState values
+         */
+        enum
+            {
+            EIdle,
+            EWaitingAck,
+            EWaitingHandle
+            };
+
+        TInt iState;
+        
+        TInt iTemplateOpen;
+
+        TRequestStatus* iQuedStatus;
+
+        TChunkHeader* iChunkHeader;
+        
+        TBool iReceivingDrawingCommands;
+
+        /**
+         * Debug variable for tracking the delivered chunk sizes. Can be used for optimizing the junk size.
+         */
+        //TInt iMaxSentBatchSize;
+        
+        TBool iWrappingFrame;
+        
+        /**
+         * Screen connected to this CAlfRsSendBuffer
+         */
+        TInt iScreenNumber; 
+
+        CPeriodic* iFlushBufferTimer;
+        
+        TUint8 iNonSupportedCommandsInWindow;
+        
+        /**
+         * See ReadNonSupportedCommandsL for more information
+         */
+        TUint8 iNonSupportedCommands[KAlfWsCommandCount];
+
+        TUint8 iSupportedCommandParameters[KAlfWsCommandCount][2]; // [index of first parameter in iSupportedParameters][index of last parameter in iSupportedParameters] 
+        TInt8 iSupportedParameters[KAlfWsMaxParameterCount][2]; // [parameter value][render support], note the limited count
+        
+        TInt iPerformanceIssueCommandCount;
+        
+        TInt iMaxPerformanceIssueCommandCount;
+        
+        struct TWindowHeaderStruct
+            {
+            TInt32 iWindowEndOffset;
+            TUint8 iCommandEndMarker;
+            TUint8 iContainsUnsupportedCommandsCommand;
+            TUint8 iUnsupportedCommandsInWindow;
+            };
+                
+        TWindowHeaderStruct iWindowHeaderStruct;
+        
+        TUint8 iFramePadding;
+        
+        TInt32 iFlags;
+
+        TUint8 iPreviousCommand;
+        
+        /**
+         * AlfRsSendBuffers searches certain bitblit pattern in the serialized 
+         * commands. It tries to combine joined bitblits into one command, which 
+         * can be handled more efficiently on HW.
+         * 
+         * See DoPatternSearch, AppendPatternSearchCache, ResetPatternSearch and FinalizePatternL for more 
+         * information.
+         * 
+         */ 
+        TInt iPatternSearchState;
+        
+        TInt iPatterSearchSequentialBlits;
+        
+        TInt iPenStyle;
+        
+        /**
+         * Under normal circumtances, a single chunk is used for passing the 
+         * commands to alf. However, if Wserv pushes large frames that fill the
+         * whole chunk, alfsendbuffer takes a growing cache chunk into use.
+         * 
+         * The cache chunk is destroyed, when it is no longer needed.
+         */
+       
+        TUint8 iChunkInUse;
+        
+        /**
+         * Joined clipping region is usually different than the following joined blit region (iSearchPatternBlitRect)
+         */
+        RRegionBuf<KAlfRsSearchRectMaxCount> iSearchPatternClipRegion;
+        
+        RRegionBuf<KAlfRsSearchRectMaxCount> iSearchPatternBlitRect;
+        
+        class TBlitStruct
+            {
+        
+        public:
+        
+        	TBlitStruct( TInt aHandle, TInt aMaskHandle, TPoint aTl ) : iHandle( aHandle ), iMaskHandle( aMaskHandle ), iTl( aTl ){};
+            TInt iHandle;
+            TInt iMaskHandle;
+            TPoint iTl;
+            };
+        
+        RArray<TBlitStruct> iPatternHandleCache;
+#ifdef _OLD_STREAM        
+        TStreamPos iPatternCacheBeginPosition;
+#else
+        TInt iPatternCacheBeginPosition;
+#endif
+        TBool iBooting;
+        
+#ifdef _ALF_PRINT_WS_COMMANDS_
+
+        /**
+         * debug for printing the serializaed commands in human understandable format
+         */
+        TBool iLog;
+        
+        CAlfCommandDebug* iCommandDebugger;
+        
+        class TPatternCommand
+            {
+        public:
+        
+            TPatternCommand( TUint8 aCommand, TInt aSize ): iCommand( aCommand ), iSize(aSize){};
+            
+            TUint8 iCommand;
+            
+            TInt iSize;
+            };
+			
+        RArray<TPatternCommand> iPatternCommands;
+                
+#endif  
+
+        // caches text. If same text is used 2nd time inside buffer
+        HBufC16* iCachedText;
+        CAlfCompositionCntrlClient* iAlfCompositionCntrlClient;
+        
+        // array implementation
+        RArray<TOffsetElem> iOffsetArray;
+        TInt iMarker;
+        TRect iBoundingRectangle;
+        TInt iLayerId;
+        TInt iArrayImplOffset;
+        TInt iPreviousBlockOffset;
+        TInt iExtraLayerId;
+        TBool iLayersEnabled;
+	};
+#endif /*CALFSENDBUFFER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfRenderStage/src/alfasynchgoomsession.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   alfasynchgoomsession provides asynchronous 
+*                connection to graphics out of memory monitor.
+*
+*/
+
+
+#include "alfasynchgoomsession.h"
+#include "alflogger.h"
+
+// Granularity for pending uids array
+const TInt KAlfPendingUidsGranularity = 2;
+
+// Granularity for running apps array
+const TInt KAlfRunningAppsGranularity = 8;
+
+// ---------------------------------------------------------------------------
+// CAlfAsynchGoomSession::CAlfAsynchGoomSession
+// ---------------------------------------------------------------------------
+//
+CAlfAsynchGoomSession::CAlfAsynchGoomSession() 
+    : CActive( EPriorityHigh ),
+      iPendingUids( KAlfPendingUidsGranularity ),
+      iRunningAppsList( KAlfRunningAppsGranularity )
+    {
+    __ALFLOGSTRING("CAlfAsynchGoomSession::CAlfAsynchGoomSession");        
+    CActiveScheduler::Add(this);
+    }
+    
+// ---------------------------------------------------------------------------
+// CAlfAsynchGoomSession::~CAlfAsynchGoomSession
+// ---------------------------------------------------------------------------
+//
+CAlfAsynchGoomSession::~CAlfAsynchGoomSession()
+    {
+    __ALFLOGSTRING("CAlfAsynchGoomSession::~CAlfAsynchGoomSession");
+    Cancel();
+
+    iGoomSession.Close();
+    
+    iPendingUids.Close();
+    iRunningAppsList.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfAsynchGoomSession::AppAboutToStart
+// ---------------------------------------------------------------------------
+//
+void CAlfAsynchGoomSession::AppAboutToStart( const TUid& aAppUid )
+    {
+    if ( iRunningAppsList.Find( aAppUid.iUid ) != KErrNotFound ) 
+        {
+        // Application already running - ingored.
+        return;
+        }
+    iRunningAppsList.Append( aAppUid.iUid );
+    
+    if ( IsActive() )
+        {
+        __ALFLOGSTRING1("CAlfAsynchGoomSession::AppAboutToStart queue %x", aAppUid.iUid);
+        iPendingUids.Append( aAppUid );
+        return;
+        }
+        
+    if ( !iConnected )
+        {
+        Start();
+        }
+    else
+        {
+        __ALFLOGSTRING1("CAlfAsynchGoomSession::AppAboutToStart %x", aAppUid.iUid);
+        iGoomSession.AppAboutToStart( iStatus, aAppUid );
+        SetActive();
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfAsynchGoomSession::AppClosed
+// ---------------------------------------------------------------------------
+//
+void CAlfAsynchGoomSession::AppClosed( const TUid& aAppUid )
+    {
+    TInt index = iRunningAppsList.Find( aAppUid.iUid );
+    if ( index != KErrNotFound )
+        {
+        iRunningAppsList.Remove( index );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfAsynchGoomSession::Start
+// ---------------------------------------------------------------------------
+//
+void CAlfAsynchGoomSession::Start()
+    {
+    if ( iConnecting )
+        {
+        return;
+        }
+        
+    TInt err = iGoomSession.Connect( iStatus );        
+    
+    __ALFLOGSTRING1("CAlfAsynchGoomSession::Start Connect %d", err);
+    
+    if ( err == KErrNone )
+        {
+        SetActive();
+        iConnecting = ETrue;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfAsynchGoomSession::RunL
+// ---------------------------------------------------------------------------
+//
+void CAlfAsynchGoomSession::RunL()
+    {       
+    if ( iConnecting )
+        {        
+        iConnected = ( iStatus.Int() == KErrNone );
+        iConnecting = EFalse;
+
+        __ALFLOGSTRING1("CAlfAsynchGoomSession::RunL Connected %d", iConnected);
+    
+        if ( !iConnected )
+            {
+            iGoomSession.Close();
+            }
+        }
+    
+    if ( iConnected && iPendingUids.Count() )
+        {
+        TUid uid = iPendingUids[0];
+        iPendingUids.Remove(0);
+        
+        __ALFLOGSTRING1("CAlfAsynchGoomSession::RunL %x", uid.iUid);
+
+        iGoomSession.AppAboutToStart( iStatus, uid );
+        SetActive();
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// CAlfAsynchGoomSession::DoCancel
+// ---------------------------------------------------------------------------
+//
+void CAlfAsynchGoomSession::DoCancel()
+    {
+    // There is not much we can do.
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstage.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1006 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   AlfRenderStage provides a way to redirect avkon drawing to a graphics accelerator
+*
+*/
+
+#include "alfrenderstage.h"
+
+#include <fbs.h>
+#include <bitstd.h>
+#include <bitdev.h>
+#include <graphics/wsgraphicdrawer.h>
+#include <graphics/wsgraphicscontext.h>
+
+#include <alfdecoderserverclient.h>
+#include <huiwscanvascommands.h>
+#include <uiacceltk/HuiUtil.h>
+#include <alf/alfhintplugin.h>
+#include <alf/alfcompositionclient.h>
+
+#include "alflogger.h"
+#include "alfrsgc.h"
+#include "alfrssendbuffer.h"
+#include "alfasynchgoomsession.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfRenderStage* CAlfRenderStage::NewL(MWsGraphicDrawerEnvironment* aEnv,MWsScreen* aScreen, TInt aScreenNumber, CWsRenderStage* aNext)
+	{
+	CAlfRenderStage * stage = new(ELeave) CAlfRenderStage(aNext);
+	CleanupStack::PushL(stage);
+	stage->ConstructL(aEnv, aScreen, aScreenNumber);
+	CleanupStack::Pop(stage);
+	return stage;
+	}
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CAlfRenderStage::CAlfRenderStage(CWsRenderStage* aNext) : iNormalOrientation(ETrue), iNext(aNext)
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// C++ destructor
+// ---------------------------------------------------------------------------
+//
+CAlfRenderStage::~CAlfRenderStage()
+	{
+	iWindowIds.Reset();
+	iEnv->UnregisterWsEventHandler(this);
+	iScreen = NULL;
+	delete iAlfSendBuffer;
+	delete iWsGraphicsContext;
+	delete iGoomSession;
+	
+	// Used just as a temporary holding place, do not delete!
+	iWindowDrawingNode = NULL;	
+	}
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::ConstructL(MWsGraphicDrawerEnvironment* aEnv, MWsScreen* aScreen, TInt aScreenNumber)
+	{
+	iEnv = aEnv;
+	iScreen = aScreen;
+	iScreenNumber = aScreenNumber;
+	
+	__ALFLOGSTRING1("CAlfRenderStage: About to baseconstruct. iScreenNumber=%d", iScreenNumber);
+	CWsRenderStage::BaseConstructL();
+    CWsRenderStage::SetNext(iNext);
+	
+	__ALFLOGSTRING("CAlfRenderStage: About to initialize send buffer");
+    iAlfSendBuffer = CAlfRsSendBuffer::NewL( *this, aScreenNumber );
+	
+	iEnv->RegisterWsEventHandler( this, TWservCrEvent::EScreenOrientationChanged  );
+	iWsGraphicsContext = CAlfGraphicsContext::NewL( *iAlfSendBuffer );
+
+    // Initialize segment redraw helper attributes to default values
+    iWindowDrawingNode = NULL;
+    iSegmentRedrawActive = EFalse;
+    
+    // Initialise system
+    InitL();
+
+    // set up the link for composition rs
+    MAlfCompositionController* compcntrl = ( MAlfCompositionController*)ResolveObjectInterface(KAlfCompositionControllerIfUid);
+    if (compcntrl)
+      {
+      compcntrl->AlfBridgeCallback(MAlfBridge::ESetWindowTreeObserver,(MAlfCompositionAgnosticWindowTreeObserver*)this);  
+      }
+
+    __ALFLOGSTRING("CAlfRenderStage: ready to rock");
+    }
+
+// ---------------------------------------------------------------------------
+// InitL
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::InitL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ResolveObjectInterface
+// ---------------------------------------------------------------------------
+//
+TAny* CAlfRenderStage::ResolveObjectInterface(TUint aTypeId)
+	{
+	switch(aTypeId)
+		{
+    	case MWsGraphicsContext::EWsObjectInterfaceId:
+    		return static_cast<MWsGraphicsContext*>(iWsGraphicsContext);
+    	case MWsTextCursor::EWsObjectInterfaceId:
+    	    return static_cast<MWsTextCursor*>(this);
+    	case KAlfCompositionAgnosticWindowTreeObserverInterfaceId:
+    	    return static_cast<MAlfCompositionAgnosticWindowTreeObserver*>(this);
+    	case MAlfHintObserver::EWsObjectInterfaceId:
+    	    return static_cast<MAlfHintObserver*>(this);
+			
+    	case MWsDrawAnnotationObserver::EWsObjectInterfaceId:
+    	    return static_cast<MWsDrawAnnotationObserver*>(this);
+    	default:
+    	    return CWsRenderStage::ResolveObjectInterface(aTypeId);
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// Begin
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::Begin(const TRegion* aRegion )
+	{
+	iDrawingActive = ETrue;
+	__ALFLOGSTRING1("CAlfRenderStage::Begin.  iScreenNumber=%d", iScreenNumber);
+	TRAPD( err, iAlfSendBuffer->PrepareBufferL() );
+	if ( err )
+	    {
+	    __ALFLOGSTRING1("CAlfRenderStage::Begin, Leave occured %d", err );
+	    }
+		
+	iUpdateRegion = aRegion;
+	iNext->Begin(aRegion);
+	}
+
+// ---------------------------------------------------------------------------
+// End
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::End( TRequestStatus* aFinished ) 
+	{
+	iDrawingActive = EFalse;
+	TInt err(KErrNone);
+	__ALFLOGSTRING2("CAlfRenderStage::End. iScreenNumber=%d, aFinished=%d", iScreenNumber,aFinished);
+	if (iAlfSendBuffer->FrameContainsDataL() ) 
+	    {
+	    TRAP( err, iAlfSendBuffer->SendL( aFinished ));
+	    }
+	else
+	    {
+	    __ALFLOGSTRING("CAlfRenderStage::End - Empty Frame");
+	    // frame was empty for some reason. Complete request.
+	    EndCallBack( aFinished );
+	    }
+	if ( err )
+	    {
+	    __ALFLOGSTRING("CAlfRenderStage::End, Leave occured!!");
+	    }
+	}
+
+// ---------------------------------------------------------------------------
+// EndCallBack
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::EndCallBack( TRequestStatus* aFinished )
+    {   
+    __ALFLOGSTRING("CAlfRenderStage::EndCallBack 1");
+	iNext->End(aFinished);
+    __ALFLOGSTRING("CAlfRenderStage::EndCallBack 2");
+    }
+
+// ---------------------------------------------------------------------------
+// ScreenNumber
+// ---------------------------------------------------------------------------
+//
+TInt CAlfRenderStage::ScreenNumber() const
+	{
+    __ALFLOGSTRING1("CAlfRenderStage::ScreenNumber. screen=%d", iScreenNumber);
+	return iScreenNumber;
+	}
+// ---------------------------------------------------------------------------
+// SizeInPixels
+// ---------------------------------------------------------------------------
+//
+/*TSize CAlfRenderStage::SizeInPixels() const
+	{
+    __ALFLOGSTRING2( "CAlfRenderStage::SizeInPixels() iNormalOrientation=%d, iScreenNumber=%d ",iNormalOrientation, iScreenNumber  );
+    
+	TSize res = iDisplayPolicy->SizeInPixels();
+	
+    if( !iNormalOrientation )
+        {
+        res = TSize( res.iHeight, res.iWidth ); 
+        }
+    
+    __ALFLOGSTRING2( "CAlfRenderStage::SizeInPixels() %d x %d ", res.iWidth, res.iHeight );
+	return res;
+	}
+*/
+void CAlfRenderStage::DrawTextCursor(const TTextCursorInfo& aTextCursorInfo)
+    {
+    TRegionFix<1> fullWindowRegion;
+    	const TRegion *clippingRegion= &aTextCursorInfo.iRegion;
+    	if (aTextCursorInfo.iRegion.CheckError())
+    		{
+    		fullWindowRegion.AddRect(aTextCursorInfo.iWindow->AbsRect());
+    		clippingRegion = &fullWindowRegion;
+    		}
+
+    	if (clippingRegion->IsEmpty())
+    		{
+    		return;
+    		}
+
+    	iWsGraphicsContext->SetDrawMode(MWsGraphicsContext::EDrawModePEN);
+
+    	switch (aTextCursorInfo.iTextCursorType)
+    		{
+    		case TTextCursor::ETypeRectangle:
+    			{
+    			iWsGraphicsContext->SetBrushStyle(MWsGraphicsContext::ESolidBrush);
+    			iWsGraphicsContext->SetPenStyle(MWsGraphicsContext::ENullPen);
+    			iWsGraphicsContext->SetBrushColor(KRgbBlack); /* we are ignoring aTextCursorInfo.iTextCursorColor */
+    			}
+    			break;
+    		case TTextCursor::ETypeHollowRectangle:
+    			{
+    			iWsGraphicsContext->SetBrushStyle(MWsGraphicsContext::ENullBrush);
+    			iWsGraphicsContext->SetPenStyle(MWsGraphicsContext::ESolidPen);
+    			iWsGraphicsContext->SetPenColor(KRgbBlack); /* we are ignoring aTextCursorInfo.iTextCursorColor */
+    			}
+    			break;
+    		default:
+    		    {
+    		    break;
+    		    }
+    		}
+    	iWsGraphicsContext->SetClippingRegion(*clippingRegion);
+    	//
+    	// During Sprite drawing, the GC gets reset.  Possibly other code could
+    	// have done this also.  So make sure we setup the origin so that window-relative
+    	// co-ordinates work as expected; iCursorRect is in window co-ordinates.
+    	//
+    	iWsGraphicsContext->SetOrigin(aTextCursorInfo.iWindow->Origin());
+    	iWsGraphicsContext->DrawRect(aTextCursorInfo.iCursorRect);    
+    }
+
+// ---------------------------------------------------------------------------
+// DoHandleEvent
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::DoHandleEvent(const TWservCrEvent& aEvent)
+    {
+    TUint eventType = aEvent.Type();
+    switch( eventType )
+        {
+    	case TWservCrEvent::EDeviceOrientationChanged:
+    		{
+    		__ALFLOGSTRING("CAlfRenderStage::DoHandleEvent EDeviceOrientationChanged");
+    		break;
+    		}
+        default:
+            // no other events have been registered
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// WsGraphicsContext
+// ---------------------------------------------------------------------------
+//
+CAlfGraphicsContext* CAlfRenderStage::WsGraphicsContext()
+    {
+    return iWsGraphicsContext;
+    }
+
+// ---------------------------------------------------------------------------
+// AlfSendBuffer
+// ---------------------------------------------------------------------------
+//
+CAlfRsSendBuffer* CAlfRenderStage::AlfSendBuffer()
+    {
+    return iAlfSendBuffer;
+    }
+
+
+// ---------------------------------------------------------------------------
+// DoDrawTextCursor
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::DoDrawTextCursor( 
+    const MWsWindowTreeNode& aWindowTreeNode, 
+    const TRect& aExtent, 
+    const TRect& aClipRect,
+    const TRect& aCursorRect )
+    {
+    // It might be possible to reduce amount of drawing. 
+    
+    TRegionFix<1> drawRegion;
+    drawRegion.AddRect( aExtent );
+    TRegionFix<1> clipRegion;
+    clipRegion.AddRect( aClipRect );
+            
+    WindowRedrawStart( aWindowTreeNode, drawRegion );
+    iWsGraphicsContext->Reset();
+    iWsGraphicsContext->SetDrawMode( MWsGraphicsContext::EDrawModePEN );
+    iWsGraphicsContext->SetBrushStyle( MWsGraphicsContext::ESolidBrush );
+    iWsGraphicsContext->SetPenStyle( MWsGraphicsContext::ESolidPen );
+    iWsGraphicsContext->SetBrushColor( KRgbBlack ); // color from interface is white, so temporirily putting black
+    //const TRect clipRect = cursor->ClipRect();
+    //const TRect cursorRect = cursor->Rect();
+    iWsGraphicsContext->SetClippingRegion( clipRegion );
+    iWsGraphicsContext->DrawRect( aCursorRect );    
+    WindowRedrawEnd( aWindowTreeNode );
+    }
+
+// ---------------------------------------------------------------------------
+// NodeCreated
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::NodeCreated(const MWsWindowTreeNode& aWindowTreeNode, MWsWindowTreeNode const* aParent)
+    {
+    __ALFLOGSTRING("CAlfRenderStage::NodeCreated");
+    // You need to enable ALF_DEBUG_TRACK_DRAWING in alfappservercore.mmp
+    // and change this value to 1, if you want to track this node in debugger.
+   
+    iWindowIds.AppendL( (TInt) &aWindowTreeNode );
+    TInt nodeType = aWindowTreeNode.NodeType();
+    switch (nodeType)
+        {
+        case MWsWindowTreeNode::EWinTreeNodeClient:
+            {
+            const MWsWindow* window = aWindowTreeNode.Window();
+            TInt ordinalPriority = window->OrdinalPriority();
+            TInt windowId = window->Handle();
+            TInt windowGroupId = KErrNotFound;
+            
+            const MWsWindowTreeNode* parentWindowGroup = aParent;
+            while (parentWindowGroup)
+                {
+                if (parentWindowGroup->NodeType() == MWsWindowTreeNode::EWinTreeNodeGroup)
+                    {
+                    windowGroupId = parentWindowGroup->WindowGroup()->Identifier();
+                    break;
+                    }
+                parentWindowGroup = parentWindowGroup->ParentNode();
+                }
+            TSize size = window->Size();
+            TPoint origin = window->Origin();
+            //TInt parent = GetIdentifierL(aParent );
+    	    iAlfSendBuffer->WriteIntsL( EAlfNodeCreated,
+    	        10,
+    	        nodeType,
+    	        &aWindowTreeNode,
+    	        origin.iX,
+    	        origin.iY,
+    	        size.iWidth,
+    	        size.iHeight,
+    	        ordinalPriority,
+    	        (TInt)aParent,
+    	        windowGroupId,
+    	        windowId
+    	        );
+            break;
+            }
+        case MWsWindowTreeNode::EWinTreeNodeRoot:
+            {
+            TSize size = TSize( 360, 640);
+            TPoint origin = TPoint( 0, 0 );
+            //TInt parent = GetIdentifierL(aParent );
+            iAlfSendBuffer->WriteIntsL( EAlfNodeCreated,
+                6,
+                nodeType,
+                &aWindowTreeNode,
+                origin.iX,
+                origin.iY,
+                size.iWidth,
+                size.iHeight
+                );
+            break;
+            }
+        case MWsWindowTreeNode::EWinTreeNodeGroup:
+            {
+            const MWsWindowGroup* windowGroup = aWindowTreeNode.WindowGroup();
+            ASSERT(windowGroup);
+			TInt identifier = windowGroup->Identifier();
+			TInt secureId = windowGroup->Client()->SecureId();
+
+#ifndef __WINS__  
+            if( iScreenNumber == 0 )
+		        {          
+                if ( secureId != 0x10207218 && // Capserver / AKA goom
+                     secureId != 0x10204c27 )  // Policy server 
+                    {
+                    // Todo: Must actually check whether the configuration uses goom
+                    // would create drastic performance hit in a system that does not need
+                    // (and construct) goom
+                    if ( !iGoomSession )
+	                    {
+	                    iGoomSession = new CAlfAsynchGoomSession;
+	                    }
+                    if ( iGoomSession )
+	                    {
+	                    iGoomSession->AppAboutToStart(TUid::Uid(secureId));
+	                    }
+			        }
+                }
+#endif
+			
+            iAlfSendBuffer->WriteIntsL( EAlfNodeCreated,
+    	        5,
+    	        nodeType,
+    	        &aWindowTreeNode,
+    	        identifier,
+    	        secureId,
+    	        (TInt)aParent
+    	        );
+            break;
+            }
+        case MWsWindowTreeNode::EWinTreeNodeSprite:
+            {
+            __ALFLOGSTRING1("CAlfRenderStage::NodeCreated node Id: %d", &aWindowTreeNode );
+            TRect spriteRect = aWindowTreeNode.Sprite()->Rect();
+            // TODO, MCL 09+
+            // TSpriteType spriteType = aWindowTreeNode.Sprite()->SpriteType();
+            iAlfSendBuffer->WriteIntsL( EAlfNodeCreated,
+                7,
+                nodeType,
+                &aWindowTreeNode,
+                spriteRect.iTl.iX,
+                spriteRect.iTl.iY,
+                spriteRect.iBr.iX,
+                spriteRect.iBr.iY,
+                // sprite type 
+                (TInt)aParent
+                );
+            break;
+            }
+        case MWsWindowTreeNode::EWinTreeNodeAnim:
+            {
+            TSize size = TSize( 0, 0 );
+            TPoint origin = TPoint( 0, 0 );
+            iAlfSendBuffer->WriteIntsL( EAlfNodeCreated,
+                    7,
+                    nodeType,
+                    &aWindowTreeNode,
+                    origin.iX,
+                    origin.iY,
+                    size.iWidth,
+                    size.iHeight,
+                    (TInt)aParent
+            );
+            break;
+            }
+        case MWsWindowTreeNode::EWinTreeNodeStandardTextCursor:
+            {
+            // TODO
+            // Use interface MWsStandardTextCursors for Type, Rect, cliptRect, flags, color and flashinterval
+            const MWsStandardTextCursor* cursor = aWindowTreeNode.StandardTextCursor();
+            
+            iAlfSendBuffer->WriteIntsL( EAlfNodeCreated,
+                    15,
+                    nodeType,
+                    &aWindowTreeNode,
+                    cursor->Type(),
+                    cursor->Rect().iTl.iX,
+                    cursor->Rect().iTl.iY,
+                    cursor->Rect().iBr.iX,
+                    cursor->Rect().iBr.iY,
+                    cursor->ClipRect().iTl.iX,
+                    cursor->ClipRect().iTl.iY,
+                    cursor->ClipRect().iBr.iX,
+                    cursor->ClipRect().iBr.iY,
+                    cursor->Flags(),
+                    cursor->Color().Internal(),
+                    cursor->FlashInterval().Int(),
+                    (TInt)aParent );
+            
+            
+            // Initial command buffer for the cursor
+            DoDrawTextCursor( aWindowTreeNode, cursor->Rect(), cursor->ClipRect(), cursor->Rect() );
+            break;
+            }
+        default:
+            {
+            __ALFLOGSTRING1("CAlfRenderStage:: EAlfNodeCreated, unknown node type: %i",  nodeType);
+            break;
+            }
+        }
+#ifdef ALF_DEBUG_TRACK_DRAWING
+    TInt trackThisNode = 0;
+    if ( trackThisNode )
+        {
+        iAlfSendBuffer->WriteIntsL( EAlfDebugTrackNode, 2, (TInt32)&aWindowTreeNode, 1 );
+        }
+#endif    
+	iAlfSendBuffer->CommitL();
+    }
+
+// ---------------------------------------------------------------------------
+// NodeReleased
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::NodeReleased(const MWsWindowTreeNode& aWindowTreeNode)
+    {
+    __ALFLOGSTRING("CAlfRenderStage::NodeReleased");
+    TInt nodeType = aWindowTreeNode.NodeType();
+ 
+#ifndef __WINS__     
+	if ( iScreenNumber == 0 )
+        {
+        if ( iGoomSession && nodeType == MWsWindowTreeNode::EWinTreeNodeGroup )
+            {
+            const MWsWindowGroup* windowGroup = aWindowTreeNode.WindowGroup();
+            TInt secureId = windowGroup->Client()->SecureId();
+        
+            iGoomSession->AppClosed( TUid::Uid( secureId ) );
+            }
+	    }
+#endif        
+    
+    iAlfSendBuffer->WriteIntsL( EAlfNodeReleased,
+        2,
+        nodeType,
+        &aWindowTreeNode
+        );
+	iAlfSendBuffer->CommitL();
+	TInt index = iWindowIds.Find( (TInt)&aWindowTreeNode );
+	if ( index != KErrNotFound )
+	    {
+        iWindowIds.Remove( index );
+	    }
+	else
+	    {
+	    __ALFLOGSTRING("CAlfRenderStage::NodeReleased - WARNING: Node not found!!");
+	    }
+
+    }
+
+// ---------------------------------------------------------------------------
+// NodeActivated
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::NodeActivated(const MWsWindowTreeNode& aWindowTreeNode)
+    {
+    __ALFLOGSTRING("CAlfRenderStage::NodeActivated >>");
+    TInt nodeType = aWindowTreeNode.NodeType();
+    iAlfSendBuffer->WriteIntsL( EAlfNodeActivated,
+        2,
+        nodeType,
+        &aWindowTreeNode );
+
+	iAlfSendBuffer->CommitL();
+    __ALFLOGSTRING("CAlfRenderStage::NodeActivated <<");
+    }
+
+// ---------------------------------------------------------------------------
+// NodeExtentChanged
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::NodeExtentChanged(const MWsWindowTreeNode& aWindowTreeNode, const TRect& aRect)
+    {
+     __ALFLOGSTRING("CAlfRenderStage::NodeExtentChanged");
+    if ( aWindowTreeNode.NodeType() == MWsWindowTreeNode::EWinTreeNodeStandardTextCursor )
+        {           
+        const MWsStandardTextCursor* cursor = aWindowTreeNode.StandardTextCursor();
+        TRect rect(cursor->Rect());
+        iAlfSendBuffer->WriteIntsL( EAlfNodeExtentChanged,
+            5,
+            rect.iTl.iX,
+            rect.iTl.iY,
+            rect.iBr.iX,
+            rect.iBr.iY,
+            &aWindowTreeNode
+            );    
+
+        DoDrawTextCursor( aWindowTreeNode, cursor->Rect(), cursor->ClipRect(), cursor->Rect() );          
+        }
+    else
+        {
+        iAlfSendBuffer->WriteIntsL( EAlfNodeExtentChanged,
+            5,
+            aRect.iTl.iX,
+            aRect.iTl.iY,
+            aRect.iBr.iX,
+            aRect.iBr.iY,
+            &aWindowTreeNode
+            );    
+        }
+	iAlfSendBuffer->CommitL();
+    }
+
+// ---------------------------------------------------------------------------
+// SiblingOrderChanged
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::SiblingOrderChanged(const MWsWindowTreeNode& aWindowTreeNode, TInt aNewPos)
+    {
+    __ALFLOGSTRING("CAlfRenderStage::SiblingOrderChanged");
+    TInt nodeType = aWindowTreeNode.NodeType();
+    iAlfSendBuffer->WriteIntsL( EAlfNodeSiblingOrderChanged,
+        2,
+        aNewPos,
+        &aWindowTreeNode );
+
+    iAlfSendBuffer->CommitL();
+        }
+
+// ---------------------------------------------------------------------------
+// FlagChanged
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::FlagChanged(const MWsWindowTreeNode& aWindowTreeNode, TInt aFlag, TBool aNewValue)
+    {
+    __ALFLOGSTRING("CAlfRenderStage::FlagChanged");
+    iAlfSendBuffer->WriteIntsL(
+            EAlfNodeFlagChanged,
+            3,
+            aFlag,
+            aNewValue,
+            &aWindowTreeNode   );
+	iAlfSendBuffer->CommitL();
+    }
+
+// ---------------------------------------------------------------------------
+// AttributeChanged
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::AttributeChanged(const MWsWindowTreeNode& aWindowTreeNode, TInt aAttribute )
+    {
+    if ( aWindowTreeNode.NodeType() == MWsWindowTreeNode::EWinTreeNodeStandardTextCursor )
+        {
+        TInt32 nodeId = (TInt32)&aWindowTreeNode;
+        switch( aAttribute )
+            {
+            case ECursorType:
+                {
+                iAlfSendBuffer->WriteIntsL(
+                        EAlfNodeAttributeChanged,
+                        3,
+                        nodeId,
+                        aAttribute,
+                        aWindowTreeNode.StandardTextCursor()->Type() );
+                break;
+                }
+            case ECursorClipRect:
+                {
+                const TRect rect = aWindowTreeNode.StandardTextCursor()->ClipRect();
+                iAlfSendBuffer->WriteIntsL(
+                        EAlfNodeAttributeChanged,
+                        6,
+                        nodeId,
+                        aAttribute,
+                        rect.iTl.iX,
+                        rect.iTl.iY,
+                        rect.iBr.iX,
+                        rect.iBr.iY );
+
+                const MWsStandardTextCursor* cursor = aWindowTreeNode.StandardTextCursor();       
+                DoDrawTextCursor( aWindowTreeNode, cursor->Rect(), cursor->ClipRect(), cursor->Rect() );
+                break;
+                }
+            case ECursorFlags:
+                {
+                iAlfSendBuffer->WriteIntsL(
+                        EAlfNodeAttributeChanged,
+                        3,
+                        nodeId,
+                        aAttribute,
+                        aWindowTreeNode.StandardTextCursor()->Flags() );
+                break;
+                }
+            case ECursorColor:
+                {
+                iAlfSendBuffer->WriteIntsL(
+                        EAlfNodeAttributeChanged,
+                        3,
+                        nodeId,
+                        aAttribute,
+                        aWindowTreeNode.StandardTextCursor()->Color().Internal() );
+                break;
+                }
+            }
+        iAlfSendBuffer->CommitL();
+        } 
+    }
+
+// ---------------------------------------------------------------------------
+// FadeCountChanged
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::FadeCountChanged(const MWsWindowTreeNode& aWindowTreeNode, TInt aFadeCount)
+    {
+    iAlfSendBuffer->WriteIntsL( EAlfNodeFadeCountChanged, 2, (TInt32)&aWindowTreeNode, aFadeCount );
+	iAlfSendBuffer->CommitL();
+    }
+
+// ---------------------------------------------------------------------------
+// TransparentRegionChanged
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::TransparentRegionChanged(const MWsWindowTreeNode& /*aWindowTreeNode*/, const TRegion& /*aNewTransparentRegion*/, const TRegion* /*aNewOpaqueRegion*/)
+    {
+    // @todo
+	// NULL region received from wserv. causes crash. quickfix is to ignore this as the
+	// output is ignored in anycase in alfhierarchymodel.cpp
+    /*
+    iAlfSendBuffer->WriteIntsL( EAlfNodeTransparentRegionChanged, 1, (TUint32)&aWindowTreeNode );
+    iAlfSendBuffer->WriteRegionL( EAlfNodeTransparentRegionChanged, aNewTransparentRegion );
+    iAlfSendBuffer->WriteRegionL( EAlfNodeTransparentRegionChanged, *aNewOpaqueRegion );
+    iAlfSendBuffer->CommitL();
+    */
+    }
+
+
+// ---------------------------------------------------------------------------
+// MovedToWindowGroup
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::MovedToWindowGroup(const MWsWindowTreeNode& aWindowTreeNode, const MWsWindowTreeNode& aNewWindowGroupNode)
+    {
+    iAlfSendBuffer->WriteIntsL( EAlfNodeMovedToWindowGroup, 2, (TUint32)&aWindowTreeNode, (TUint32)&aNewWindowGroupNode );
+    iAlfSendBuffer->CommitL();
+    }
+
+// ---------------------------------------------------------------------------
+// WindowGroupChained
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::WindowGroupChained(const MWsWindowTreeNode& aParent, const MWsWindowTreeNode& aChild)
+    {
+    __ALFLOGSTRING("CAlfRenderStage::WindowGroupChained");
+    iAlfSendBuffer->WriteIntsL( EAlfNodeWindowGroupChained, 2, (TUint32)&aParent, (TUint32)&aChild );
+	iAlfSendBuffer->CommitL();
+    }
+
+// ---------------------------------------------------------------------------
+// WindowGroupChainBrokenAfter
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::WindowGroupChainBrokenAfter(const MWsWindowTreeNode& aWindowGroupNode)
+    {
+    iAlfSendBuffer->WriteIntsL( EAlfNodeWindowGroupChainBrokenAfter, 1, (TUint32)&aWindowGroupNode );
+    iAlfSendBuffer->CommitL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// WindowRedrawStart
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::WindowRedrawStart( const MWsWindowTreeNode& aWindowTreeNode, const TRegion& aRegion )
+    {
+    __ALFLOGSTRING("AlfRenderStage::WindowRedrawStart");
+    iWsGraphicsContext->ResetDrawCommandCount();
+    // This is being saved since SegmentRedraw stuff will call WindowRedraw methods 
+    iWindowDrawingNode = &aWindowTreeNode;
+
+#ifdef ALF_DEBUG_TRACK_DRAWING
+    TInt trackThisNode = 0;
+    if ( trackThisNode )
+        {
+        iAlfSendBuffer->WriteIntsL( EAlfDebugTrackNode, 2, (TInt32)&aWindowTreeNode, 1 );
+        }
+#endif   
+    
+    TInt shapeRectCount = 0;
+    
+    if ( aWindowTreeNode.NodeType() == MWsWindowTreeNode::EWinTreeNodeClient )
+        {
+        const TRegion& windowArea = aWindowTreeNode.Window()->WindowArea();
+        if ( !(windowArea.Count() == 1 && windowArea.BoundingRect() == aWindowTreeNode.Window()->AbsRect())
+                && windowArea.Count() > 0)
+            {
+            /*
+            TRect rect = aWindowTreeNode.Window()->AbsRect();
+            RDebug::Print(_L("%d %d %d %d"), rect.iTl.iX, rect.iTl.iY, rect.iBr.iX, rect.iBr.iY );
+            
+            for ( TInt i= 0; i < windowArea.Count();i++)
+                {
+                TRect rect = windowArea[i]; 
+                RDebug::Print(_L("CAlfRenderStage::WindowRedrawStart - Shape") );
+                RDebug::Print(_L("%d %d %d %d"), rect.iTl.iX, rect.iTl.iY, rect.iBr.iX, rect.iBr.iY );
+                }
+            */
+            
+            shapeRectCount = windowArea.Count();
+            __ALFLOGSTRING1("CAlfRenderStage::WindowRedrawStart - some shape, %d rects", shapeRectCount );
+            }
+        }
+    // Write window header
+    iAlfSendBuffer->WriteWindowDataL( (TUint32)&aWindowTreeNode, aRegion.Count(), shapeRectCount );
+    
+    iAlfSendBuffer->WriteRegionL( EAlfSetUpdateRegion, aRegion );
+
+    if ( shapeRectCount )
+        {
+        // Write Shape region only if defined
+        iAlfSendBuffer->WriteRegionL( EAlfSetShapeRegion, aWindowTreeNode.Window()->WindowArea() );
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// WindowRedrawEnd
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::WindowRedrawEnd( const MWsWindowTreeNode& /*aWindowTreeNode*/ )
+    {
+    __ALFLOGSTRING("AlfRenderStage::WindowRedrawEnd");
+    iSegmentRedrawActive = EFalse;
+    iAlfSendBuffer->EndFrameL();
+    }
+
+// ---------------------------------------------------------------------------
+// WindowAnimRedrawStart
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::WindowAnimRedrawStart( const MWsWindowTreeNode& aWindowTreeNode, const TRegion& aRegion )
+    {
+    //_ALFLOGSTRING("AlfRenderStage::WindowAnimRedrawStart");
+    WindowRedrawStart( aWindowTreeNode, aRegion );
+    }
+
+// ---------------------------------------------------------------------------
+// WindowAnimRedrawEnd
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::WindowAnimRedrawEnd( const MWsWindowTreeNode& aWindowTreeNode )
+    {
+    //_ALFLOGSTRING("AlfRenderStage::WindowAnimRedrawEnd");
+    WindowRedrawEnd( aWindowTreeNode );    
+    }
+
+// ---------------------------------------------------------------------------
+// SpriteRedrawStart
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::SpriteRedrawStart( const MWsWindowTreeNode& aWindowTreeNode, const TRegion& aRegion )
+    {
+    WindowRedrawStart( aWindowTreeNode, aRegion );
+    iSpriteRedraw = &aWindowTreeNode;
+    iSpriteRedrawFlash = ESpriteFlashUndefined;
+    }
+
+// ---------------------------------------------------------------------------
+// SpriteRedrawEnd
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::SpriteRedrawEnd( const MWsWindowTreeNode& aWindowTreeNode )
+    {
+    WindowRedrawEnd( aWindowTreeNode );
+    const MWsWindowTreeNode* spriteRedraw = iSpriteRedraw;
+    iSpriteRedraw = NULL;
+    
+    if ( spriteRedraw && iSpriteRedrawFlash != ESpriteFlashUndefined )
+        {
+        SpriteFlash( *spriteRedraw, iSpriteRedrawFlash == ESpriteFlashOn );
+        iSpriteRedrawFlash = ESpriteFlashUndefined;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SpriteFlash
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::SpriteFlash( const MWsWindowTreeNode& aWindowTreeNode, TBool aFlashOn )
+    {
+    __ALFLOGSTRING1("CAlfRenderStage::SpriteFlash %d", aFlashOn );
+    if ( !iSpriteRedraw )
+        {
+        FlagChanged( aWindowTreeNode, MWsWindowTreeObserver::EVisible, aFlashOn );
+        }
+    else
+        {
+        iSpriteRedrawFlash = aFlashOn ? ESpriteFlashOn : ESpriteFlashOff;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SegmentRedrawStart
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::SegmentRedrawStart( const TRegion& aRegion)
+    {
+    // If this is the first (and only ) time SegmentRedraw is being called within WindowRedrawStart
+    // and WindowRedrawEnd, nothing needs to be done.
+    //
+    // Otherwise, if there's multiple segment redraws between WindowRedrawStart/End, we will separate
+    // each segment to its own buffer.
+    if (iSegmentRedrawActive)
+        {
+        WindowRedrawEnd(*iWindowDrawingNode);
+        WindowRedrawStart(*iWindowDrawingNode, aRegion);
+        }
+    iSegmentRedrawActive = ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// SegmentRedrawEnd
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::SegmentRedrawEnd(  )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// FadeAllChildren
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::FadeAllChildren(const MWsWindowTreeNode& aWindowTreeNode, TBool aFaded)
+    {
+    TUint32 nodeId = (TUint32)&aWindowTreeNode;
+    iAlfSendBuffer->WriteIntsL( EAlfNodeFadeAllChildren, 2, nodeId, aFaded );                      
+    iAlfSendBuffer->CommitL();
+    }
+
+// ---------------------------------------------------------------------------
+// InsertTagL
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStage::InsertTagL( TInt aTag, TInt32 /*aParameter*/ )
+    {
+    // Must be between WindowRedrawStart and WindowRedrawEnd calls
+    
+    switch( aTag )
+        {
+        case CAlfHintGraphic::EAlfOffscreenContentBegin:
+            {
+            iAlfSendBuffer->SetFlag( EAlfTransparentContent );
+            iAlfSendBuffer->WriteIntL( EAlfContentTag, aTag );
+            break;
+            }
+        case CAlfHintGraphic::EAlfOffscreenContentEnd:
+            {
+            iAlfSendBuffer->WriteIntL( EAlfContentTag, aTag );
+            break;
+            }
+        case  CAlfHintGraphic::EAlfOffscreenContentFlush:
+            {
+            iAlfSendBuffer->SetFlag( EAlfTransparentContentFlush );
+            iAlfSendBuffer->SetFlag( EAlfTransparentContent );
+            iAlfSendBuffer->WriteIntL( EAlfContentTag, aTag );
+            break;
+            }
+        case CAlfHintGraphic::EAlfSetWindowId:
+            {
+            break;
+            }
+        case CAlfHintGraphic::EAlfEndSubWindow:
+            {
+            iAlfSendBuffer->EndMarkerL();
+            break;
+            }
+            
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+void CAlfRenderStage::InsertTagL( TInt aTag, TRect aBoundingRectangle, TInt aLayerId )
+    {
+    switch(aTag)
+        {
+        case CAlfHintGraphic::EAlfBeginSubWindow:
+            {
+            iAlfSendBuffer->StartMarkerL(aBoundingRectangle, aLayerId);
+            break;
+            }
+        }
+    
+    }
+
+
+// end of file    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstagefactory.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,114 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   AlfRenderStage provides a method for redirect avkon drawing to a graphics accelerator
+*
+*/
+
+#include <graphics/wsscreendevice.h>
+#include "alflogger.h"
+#include "alfrenderstagefactory.h"
+#include "alfrenderstage.h"
+
+_LIT(KAlfRenderStageName, "alf");
+
+// ---------------------------------------------------------------------------
+// CreateL
+// ---------------------------------------------------------------------------
+//
+CAlfRenderStageFactory* CAlfRenderStageFactory::CreateL()
+	{
+	return new(ELeave) CAlfRenderStageFactory;
+	}
+	
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfRenderStageFactory::ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TDesC8& /*aData*/)
+	{
+	__ALFLOGSTRING("ALF-RS: About to baseconstruct factory");
+    BaseConstructL(aEnv);
+	}
+	
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CAlfRenderStageFactory::CAlfRenderStageFactory()
+	{
+	}
+	
+// ---------------------------------------------------------------------------
+// C++ destructor
+// ---------------------------------------------------------------------------
+//
+CAlfRenderStageFactory::~CAlfRenderStageFactory()
+	{
+	}
+
+/**
+Overidding MWsObjectProvider
+*/
+
+// ---------------------------------------------------------------------------
+// ResolveObjectInterface
+// ---------------------------------------------------------------------------
+//
+TAny* CAlfRenderStageFactory::ResolveObjectInterface(TUint aTypeId)
+	{
+	switch (aTypeId)
+		{
+		case KMWsRenderStageFactory:
+			return static_cast<MWsRenderStageFactory*>(this);
+		default:
+		    __ALFLOGSTRING("ALF-RS: Unknown interface required, returning NULL");
+		}
+
+	return NULL;
+	}
+
+// ---------------------------------------------------------------------------
+// CreateFinalRenderStageL
+// ---------------------------------------------------------------------------
+//
+CWsRenderStage* CAlfRenderStageFactory::CreateFinalRenderStageL(MWsScreen* /*aScreen*/, MWsScreenRedraw* /*aScreenRedraw*/, TInt /*aScreenNumber*/)
+	{
+	// this factory does not have an implementation that could be used as final render stage  
+    CAlfRenderStage* stage = NULL;
+	return stage;
+	}
+	
+// ---------------------------------------------------------------------------
+// CreateRenderStageL
+// ---------------------------------------------------------------------------
+//
+CWsRenderStage* CAlfRenderStageFactory::CreateRenderStageL(MWsScreen* aScreen, MWsScreenRedraw* /*aScreenRedraw*/, CWsRenderStage* aNextStage)
+	{
+	MWsScreenDevice* wsScreenDevice = (MWsScreenDevice*)aNextStage->ResolveObjectInterface(MWsScreenDevice::EWsObjectInterfaceId);
+	CAlfRenderStage* stage = 0;
+	if (wsScreenDevice)  
+        {	
+        stage = CAlfRenderStage::NewL( &Env(), aScreen, wsScreenDevice->ScreenNumber(), aNextStage);
+        }
+	return stage;
+	}
+
+// ---------------------------------------------------------------------------
+// PluginName
+// ---------------------------------------------------------------------------
+//
+const TDesC& CAlfRenderStageFactory::PluginName() const
+	{
+	return KAlfRenderStageName; // The name _must_be_ the same as defined in wsini.ini
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfRenderStage/src/alfrenderstageplugin.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   AlfRenderStage provides a method for redirect avkon drawing to a graphics accelerator
+*
+*/
+
+
+
+#include <ecom/implementationproxy.h>
+#include "alfrenderstagefactory.h"
+
+
+// ---------------------------------------------------------------------------
+// KImplementationTable
+// ---------------------------------------------------------------------------
+//
+LOCAL_C const TImplementationProxy KImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY(CAlfRenderStageFactory::EImplUid,CAlfRenderStageFactory::CreateL)
+	};
+	
+// ---------------------------------------------------------------------------
+// ImplementationGroupProxy
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+	{
+	aTableCount = (sizeof(KImplementationTable) / sizeof(TImplementationProxy));
+	return KImplementationTable;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfRenderStage/src/alfrsgc.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1662 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   AlfRenderStage provides a way to redirect avkon drawing to a graphics accelerator
+*
+*/
+
+/*
+ * @note: There are a lot of L functions called by non-leaving GC functions and thus possibly causing 
+ *        WServ and phone to boot in leave situation. That has been done on purpose, because 
+ *        it is extreamly fatal case if those functions leave. We cannot skip critical commands.
+ *        In practise, those functions never leave.
+ * 
+ */
+
+#include <gdi.h>
+#include <uiacceltk/HuiCanvasVisual.h>
+#include <huiwscanvascommands.h>
+#include "alfrssendbuffer.h"
+#include "alfrsgc.h"
+
+const TUint8 KNoSupportInAnyRenderer = 63; 
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfGraphicsContext* CAlfGraphicsContext::NewL( CAlfRsSendBuffer& aAlfSendBuffer )
+	{
+	CAlfGraphicsContext* self = new(ELeave) CAlfGraphicsContext( aAlfSendBuffer );
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+// ---------------------------------------------------------------------------
+// C++ constructor
+// ---------------------------------------------------------------------------
+//
+CAlfGraphicsContext::CAlfGraphicsContext( CAlfRsSendBuffer& aAlfSendBuffer) :
+    iFontHandle(0),
+    iTextShadowColor( TRgb(KRgbBlack) ),
+    iBrushPatternSet( EFalse ),
+    iPenColor( TRgb( KRgbBlack ) ),
+    iBrushColor( TRgb( KRgbBlack ) ),
+    iSendBuffer( aAlfSendBuffer )
+        {}
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::ConstructL( )
+	{
+	iFontHandle = 0;
+	iBrushPatternSet = EFalse;
+	DoReset();
+	}
+
+// ---------------------------------------------------------------------------
+// C++ destructor
+// ---------------------------------------------------------------------------
+//
+CAlfGraphicsContext::~CAlfGraphicsContext()
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// BitBlt
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::BitBlt(const TPoint& aDestPos, const CFbsBitmap& aSourceBitmap)
+    {
+    
+#ifdef _OPTIMIZE_WS_COMMANDS_ADVANCED_
+    if ( !CheckDelayedClipping( TRect( aDestPos, aSourceBitmap.SizeInPixels()))) 
+        {
+        // outside clipping region
+        return;
+        }
+    FlushStateL( iRollback );
+#endif    
+    
+    iSendBuffer.WriteIntsL(EAlfBitBlt,
+            3,
+            aDestPos.iX,
+            aDestPos.iY,
+            aSourceBitmap.Handle());
+
+	const TRect rect = aSourceBitmap.SizeInPixels() + aDestPos;
+	iSendBuffer.AppendPatternSearchCache( aSourceBitmap, NULL, rect, aDestPos, 1 );
+	iDrawCommandCount++;
+	}
+
+// ---------------------------------------------------------------------------
+// BitBlt
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::BitBlt(
+        const TPoint& aDestPos, 
+        const CFbsBitmap& aSourceBitmap, 
+        const TRect& aSourceRect )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_ADVANCED_    
+    if ( !CheckDelayedClipping( TRect( aDestPos, aSourceRect.Size()))) 
+        {
+        // outside clipping region
+        return;
+        }
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WriteIntsL(EAlfBitBltRect,
+            7,
+            aDestPos.iX,
+            aDestPos.iY,
+            aSourceBitmap.Handle(),
+            aSourceRect.iTl.iX,
+	        aSourceRect.iTl.iY,
+	        aSourceRect.iBr.iX,
+	        aSourceRect.iBr.iY );
+	iSendBuffer.AppendPatternSearchCache( aSourceBitmap, NULL, aSourceRect, aDestPos, 1 );
+	iDrawCommandCount++;
+	}
+
+// ---------------------------------------------------------------------------
+// BitBltMasked
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::BitBltMasked(
+        const TPoint& aDestPos, 
+        const CFbsBitmap& aSourceBitmap, 
+        const TRect& aSourceRect, 
+        const CFbsBitmap& aMaskBitmap, 
+        TBool aInvertMask )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_ADVANCED_    
+    if ( !CheckDelayedClipping( TRect( aDestPos, aSourceRect.Size()))) 
+        {
+        // outside clipping region
+        return;
+        }
+
+    FlushStateL( iRollback );
+#endif    
+    iSendBuffer.WriteIntsL(EAlfBitBltMasked,
+            9,
+            aDestPos.iX,
+            aDestPos.iY,
+            aSourceBitmap.Handle(),
+            aSourceRect.iTl.iX,
+	        aSourceRect.iTl.iY,
+	        aSourceRect.iBr.iX,
+	        aSourceRect.iBr.iY,
+	        aMaskBitmap.Handle(),
+	        aInvertMask );
+	
+	iSendBuffer.AppendPatternSearchCache( 
+	        aSourceBitmap, 
+	        &aMaskBitmap, 
+	        aSourceRect, 
+	        aDestPos, 
+	        aInvertMask );
+    iDrawCommandCount++;
+	}
+
+// ---------------------------------------------------------------------------
+// BitBltMasked
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::BitBltMasked(
+        const TPoint& aDestPos, 
+        const CFbsBitmap& aSourceBitmap, 
+        const TRect& aSourceRect, 
+        const CFbsBitmap& aMaskBitmap, 
+        const TPoint& aMaskPos )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_ADVANCED_
+    if ( !CheckDelayedClipping( TRect( aDestPos, aSourceRect.Size()))) 
+        {
+        // outside clipping region
+        return;
+        }
+    FlushStateL( iRollback );	
+#endif
+    iSendBuffer.WriteIntsL( EAlfBitBltMaskedPoint,
+            10,
+            aDestPos.iX,
+            aDestPos.iY,
+            aSourceBitmap.Handle(),
+            aSourceRect.iTl.iX,
+            aSourceRect.iTl.iY,
+            aSourceRect.iBr.iX,
+            aSourceRect.iBr.iY,
+            aMaskBitmap.Handle(),
+            aMaskPos.iX,
+            aMaskPos.iY );
+    iDrawCommandCount++;
+	}
+
+// ---------------------------------------------------------------------------
+// Reioion
+// calls CancelClippingRegion
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::ResetClippingRegion()
+    {
+    if ( iClippingRegion.Count() == 0 )
+        {
+        return;
+        }
+    iClippingRegion.Clear();
+#ifdef _OPTIMIZE_WS_COMMANDS_ADVANCED_	
+    iDelayedContextState |= EModifiedClipReset;
+    iDelayedContextState &= ~EModifiedClipRect;
+    iPreviousClippingRegion.Clear();
+#else
+    iSendBuffer.WriteCommandL( EAlfResetClippingRegion );
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// Clear
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::Clear()
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_ADVANCED_  
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WriteCommandL( EAlfClear );
+    iDrawCommandCount++;
+    }
+
+// ---------------------------------------------------------------------------
+// Clear
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::Clear(const TRect& aRect)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_ADVANCED_    
+    // This will result skipping the preceding clipping rect setting, if text is fully inside the clip
+    CheckDelayedClipping( aRect );
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WriteIntsL( EAlfClearRect,
+            4,
+            aRect.iTl.iX,
+            aRect.iTl.iY,
+            aRect.iBr.iX,
+            aRect.iBr.iY );
+    iDrawCommandCount++;
+	}
+
+// ---------------------------------------------------------------------------
+// ResetBrushPattern
+// calls DiscardBrushPattern on the other side
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::ResetBrushPattern()
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    if (!iBrushPatternSet)
+        return;
+#endif
+    iBrushPatternSet = EFalse;
+    iSendBuffer.WriteCommandL( EAlfResetBrushPattern );
+    }
+
+// ---------------------------------------------------------------------------
+// ResetFont
+// calls DiscardFont on the other side
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::ResetFont()
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    if (iFontHandle == 0)
+        return;
+#endif
+    iFontHandle = 0;
+#ifdef  _OPTIMIZE_WS_COMMANDS_FONT_
+    iDelayedContextState |= EModifiedResetFont;
+    iDelayedContextState &= ~EModifiedSetFontNoDuplicate;
+#else    
+    iSendBuffer.WriteCommandL( EAlfResetFont );
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// DrawArc
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawArc(
+        const TRect& aRect, 
+        const TPoint& aStart, 
+        const TPoint& aEnd )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif    
+    iSendBuffer.WriteIntsL( EAlfDrawArc,
+            8,
+            aRect.iTl.iX,
+            aRect.iTl.iY,
+            aRect.iBr.iX,
+            aRect.iBr.iY,
+	        aStart.iX,
+	        aStart.iY,
+	        aEnd.iX,
+	        aEnd.iY );
+    iDrawCommandCount++;
+	}
+
+// ---------------------------------------------------------------------------
+// DrawPie
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawPie(const TRect& aRect, const TPoint& aStart, const TPoint& aEnd)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WriteIntsL( EAlfDrawPie,
+            8,
+            aRect.iTl.iX,
+            aRect.iTl.iY,
+            aRect.iBr.iX,
+            aRect.iBr.iY,
+            aStart.iX,
+            aStart.iY,
+            aEnd.iX,
+            aEnd.iY );
+    iDrawCommandCount++;
+    }
+
+// ---------------------------------------------------------------------------
+// DrawBitmap
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawBitmap(const TRect& aDestRect, const CFbsBitmap& aSourceBitmap)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif    
+    iSendBuffer.WriteIntsL( EAlfDrawBitmap1,
+            5,
+            aDestRect.iTl.iX,
+            aDestRect.iTl.iY,
+            aDestRect.iBr.iX,
+            aDestRect.iBr.iY,
+	        aSourceBitmap.Handle() );
+    iDrawCommandCount++;
+	}
+
+// ---------------------------------------------------------------------------
+// DrawBitmap
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawBitmap(
+        const TRect& aDestRect, 
+        const CFbsBitmap& aSourceBitmap, 
+        const TRect& aSourceRect )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WriteIntsL( EAlfDrawBitmap2,
+            9,
+            aDestRect.iTl.iX,
+            aDestRect.iTl.iY,
+            aDestRect.iBr.iX,
+            aDestRect.iBr.iY,
+	        aSourceBitmap.Handle(),
+	        aSourceRect.iTl.iX,
+	        aSourceRect.iTl.iY,
+	        aSourceRect.iBr.iX,
+	        aSourceRect.iBr.iY );
+    iDrawCommandCount++;
+	}
+
+// ---------------------------------------------------------------------------
+// DrawBitmap
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawBitmap(const TPoint &aTopLeft, const CFbsBitmap &aSource)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WriteIntsL( EAlfDrawBitmap3,
+            3,
+            aTopLeft.iX,
+            aTopLeft.iY,
+            aSource.Handle() );
+    iDrawCommandCount++; 
+	}
+
+// ---------------------------------------------------------------------------
+// DrawBitmapMasked
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawBitmapMasked(
+        const TRect& aDestRect,
+        const CFbsBitmap& aSourceBitmap,
+        const TRect& aSourceRect,
+        const CFbsBitmap& aMaskBitmap,
+        TBool aInvertMask )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WriteIntsL( EAlfDrawBitmapMasked,
+            11,
+            aDestRect.iTl.iX,
+            aDestRect.iTl.iY,
+            aDestRect.iBr.iX,
+            aDestRect.iBr.iY,
+            aSourceBitmap.Handle(),
+            aSourceRect.iTl.iX,
+            aSourceRect.iTl.iY,
+            aSourceRect.iBr.iX,
+            aSourceRect.iBr.iY,
+            aMaskBitmap.Handle(),
+            aInvertMask  );
+    iDrawCommandCount++;
+	}
+
+// ---------------------------------------------------------------------------
+// DrawRoundRect
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawRoundRect(const TRect& aRect, const TSize& aEllipse)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif    
+    iSendBuffer.WriteIntsL( EAlfDrawRoundRect,
+            6,
+            aRect.iTl.iX,
+            aRect.iTl.iY,
+            aRect.iBr.iX,
+            aRect.iBr.iY,
+	        aEllipse.iWidth,
+	        aEllipse.iHeight );
+    iDrawCommandCount++;
+	}
+
+// ---------------------------------------------------------------------------
+// DrawPolyLine
+// Funnel both DrawPolyline to the same
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawPolyLine(const CArrayFix<TPoint>* aPoWriteIntList)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WritePointArrayL( EAlfDrawPolyLine, aPoWriteIntList );
+    iDrawCommandCount++; 
+    }
+
+// ---------------------------------------------------------------------------
+// DrawPolyLine
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawPolyLine(const TArray<TPoint>& aPointList)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WritePointArrayL( EAlfDrawPolyLine, &aPointList );
+    iDrawCommandCount++; 
+    };
+// ---------------------------------------------------------------------------
+// DrawPolyLineNoEndPoint
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawPolyLineNoEndPoint(
+        const TPoint *aPoWriteIntList, 
+        TInt aNumPoints )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif    
+    iSendBuffer.WritePointArrayL( EAlfDrawPolyLineNoEndPoint, aPoWriteIntList, aNumPoints );
+    iDrawCommandCount++; 
+    }
+
+
+// ---------------------------------------------------------------------------
+// DrawPolyLine
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawPolyLine(const TPoint *aPoWriteIntList, TInt aNumPoints)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WritePointArrayL( EAlfDrawPolyLine, aPoWriteIntList, aNumPoints );
+    iDrawCommandCount++; 
+    }
+
+// ---------------------------------------------------------------------------
+// DrawPolyLineNoEndPoint
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawPolyLineNoEndPoint(const TArray<TPoint>& aPointList)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WritePointArrayL( EAlfDrawPolyLineNoEndPoint, &aPointList );
+    iDrawCommandCount++; 
+    }
+
+// ---------------------------------------------------------------------------
+// DrawPolyLineNoEndPoint
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawPolyLineNoEndPoint(const CArrayFix<TPoint>* aPoWriteIntList)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WritePointArrayL( EAlfDrawPolyLineNoEndPoint, aPoWriteIntList );
+    iDrawCommandCount++; 
+    }
+
+// ---------------------------------------------------------------------------
+// DrawPolygon
+// Funnel all polygons into one. The ouput structure is the same in all of these
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawPolygon(
+        const CArrayFix<TPoint>* aPoWriteIntList, 
+        TFillRule aFillRule )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WritePointArrayL( EAlfDrawPolygon, aPoWriteIntList );
+    iSendBuffer.WriteIntL( EAlfDrawPolygon, aFillRule );
+    iDrawCommandCount++; 
+    }
+
+// ---------------------------------------------------------------------------
+// DrawPolygon
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawPolygon(const TArray<TPoint>& aPointList, TFillRule aFillRule)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif    
+    iSendBuffer.WritePointArrayL( EAlfDrawPolygon, &aPointList );
+    iSendBuffer.WriteIntL( EAlfDrawPolygon, aFillRule );
+    iDrawCommandCount++;
+    };
+
+// ---------------------------------------------------------------------------
+// DrawPolygon
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawPolygon(
+        const TPoint *aPoWriteIntList, 
+        TInt aNumPoints, 
+        TFillRule aFillRule )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif    
+    iSendBuffer.WritePointArrayL( EAlfDrawPolygon, aPoWriteIntList, aNumPoints );
+    iSendBuffer.WriteIntL( EAlfDrawPolygon, aFillRule );
+    iDrawCommandCount++; 
+    }
+
+// ---------------------------------------------------------------------------
+// DrawEllipse
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawEllipse(const TRect& aRect)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WriteIntsL( EAlfDrawEllipse,
+            4,
+            aRect.iTl.iX,
+            aRect.iTl.iY,
+            aRect.iBr.iX,
+            aRect.iBr.iY );
+    iDrawCommandCount++;
+	}
+
+// ---------------------------------------------------------------------------
+// DrawLine
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawLine(const TPoint& aStart, const TPoint& aEnd)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WriteIntsL( EAlfDrawLine,
+            4,
+            aStart.iX,
+            aStart.iY,
+            aEnd.iX,
+            aEnd.iY );
+    iDrawCommandCount++;
+	}
+
+// ---------------------------------------------------------------------------
+// DrawLineTo
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawLineTo(const TPoint& aPoint)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WriteIntsL( EAlfDrawLineTo, 2, aPoint.iX, aPoint.iY );
+    iDrawCommandCount++; 
+
+    }
+
+// ---------------------------------------------------------------------------
+// DrawLineBy
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawLineBy(const TPoint& aVector)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WriteIntsL( EAlfDrawLineBy, 2, aVector.iX, aVector.iY );
+    iDrawCommandCount++; 
+
+    }
+
+// ---------------------------------------------------------------------------
+// DrawRect
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawRect(const TRect& aRect)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WriteIntsL( EAlfDrawRect,
+            4,
+            aRect.iTl.iX,
+            aRect.iTl.iY,
+            aRect.iBr.iX,
+            aRect.iBr.iY );
+    iDrawCommandCount++;
+	}
+
+
+// ---------------------------------------------------------------------------
+// DrawText
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawText(const TDesC& aText,const TTextParameters* aParam)
+    {
+    TInt tmp;
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    FlushStateL( iRollback );
+#endif    
+    iSendBuffer.WriteDescriptorAndIntsL( EAlfDrawText1, aText,
+            (CGraphicsContext::TTextParameters*)aParam->iStart,0, tmp );
+
+    iDrawCommandCount++;
+    }
+
+// ---------------------------------------------------------------------------
+// DrawText
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawText(
+        const TDesC& aText,
+        const TTextParameters* aParam,
+        const TPoint& aPosition )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    FlushStateL( iRollback );
+#endif    
+    iSendBuffer.WriteDescriptorAndIntsL( EAlfDrawText2, aText,
+            (CGraphicsContext::TTextParameters*)aParam,
+            2,
+            aPosition.iX,
+            aPosition.iY );
+    iDrawCommandCount++; 
+    }
+
+// ---------------------------------------------------------------------------
+// DrawText
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawText(
+        const TDesC& aText,
+        const TTextParameters* aParam,
+        const TRect& aClipRect )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_ADVANCED_   
+    CheckDelayedClipping( aClipRect );
+#endif
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif    
+    iSendBuffer.WriteDescriptorAndIntsL( EAlfDrawText3, aText,
+            (CGraphicsContext::TTextParameters*)aParam,
+            4,
+            aClipRect.iTl.iX,
+            aClipRect.iTl.iY,
+            aClipRect.iBr.iX,
+            aClipRect.iBr.iY
+            );
+    iDrawCommandCount++;
+    }
+
+// ---------------------------------------------------------------------------
+// DrawText
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawText(
+        const TDesC& aText,
+        const TTextParameters* aParam,
+        const TRect& aClipFillRect,
+        TInt aBaselineOffset,
+        TTextAlign aHrz,
+        TInt aMargin )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_ADVANCED_
+    // This will result skipping the preceding clipping rect setting, if text is fully inside the clip
+    CheckDelayedClipping( aClipFillRect );
+#endif
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WriteDescriptorAndIntsL( EAlfDrawText4, aText,
+            (CGraphicsContext::TTextParameters*)aParam,
+            7,
+            aClipFillRect.iTl.iX,
+            aClipFillRect.iTl.iY,
+            aClipFillRect.iBr.iX,
+            aClipFillRect.iBr.iY,
+            aBaselineOffset,
+            aHrz,
+            aMargin
+            );
+    iDrawCommandCount++;
+    }
+
+// ---------------------------------------------------------------------------
+// DrawTextVertical
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawTextVertical(
+        const TDesC& aText,
+        const TTextParameters* aParam,
+        TBool aUp )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    FlushStateL( iRollback );
+#endif    
+    iSendBuffer.WriteDescriptorAndIntsL( EAlfDrawTextVertical1, aText,
+            (CGraphicsContext::TTextParameters*)aParam,
+            1,
+            aUp
+    );
+    iDrawCommandCount++; 
+    }
+
+// ---------------------------------------------------------------------------
+// DrawTextVertical
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawTextVertical(
+        const TDesC& aText,
+        const TTextParameters* aParam,
+        const TPoint& aPosition,
+        TBool aUp )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    FlushStateL( iRollback );
+#endif    
+    iSendBuffer.WriteDescriptorAndIntsL( EAlfDrawTextVertical2, aText,
+            (CGraphicsContext::TTextParameters*)aParam,
+            3,
+            aPosition.iX,
+            aPosition.iY,
+            aUp);
+    iDrawCommandCount++;
+    }
+
+// ---------------------------------------------------------------------------
+// DrawTextVertical
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawTextVertical(
+        const TDesC& aText,
+        const TTextParameters* aParam,
+        const TRect& aClipRect,
+        TBool aUp )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    FlushStateL( iRollback );
+#endif    
+    iSendBuffer.WriteDescriptorAndIntsL( EAlfDrawTextVertical3, aText,
+            (CGraphicsContext::TTextParameters*)aParam,
+            5,
+            aClipRect.iTl.iX,
+            aClipRect.iTl.iY,
+            aClipRect.iBr.iX,
+            aClipRect.iBr.iY,
+            aUp
+            );
+    iDrawCommandCount++;
+    }
+// ---------------------------------------------------------------------------
+// DrawTextVertical
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawTextVertical(
+        const TDesC& aText,
+        const TTextParameters* aParam,
+        const TRect& aClipRect,
+        TInt aBaselineOffset,
+        TBool aUp,
+        TTextAlign aVert,
+        TInt aMargin )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    FlushStateL( iRollback );
+#endif    
+    iSendBuffer.WriteDescriptorAndIntsL( EAlfDrawTextVertical4, aText,
+            (CGraphicsContext::TTextParameters*)aParam,
+            8,
+            aClipRect.iTl.iX,
+            aClipRect.iTl.iY,
+            aClipRect.iBr.iX,
+             aClipRect.iBr.iY,
+             aBaselineOffset,
+             aUp,
+             aVert,
+             aMargin
+             );
+    iDrawCommandCount++;
+    }
+
+// ---------------------------------------------------------------------------
+// DrawTextVertical
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DrawTextVertical(
+        const TDesC& aText,
+        const TTextParameters* aParam,
+        const TRect& aClipRect,
+        TInt aBaselineOffset,
+        TInt aTextWidth,
+        TBool aUp,
+        TTextAlign aVert,
+        TInt aMargin )
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    FlushStateL( iRollback );
+#endif    
+    iSendBuffer.WriteDescriptorAndIntsL( EAlfDrawTextVertical5, aText,
+            (CGraphicsContext::TTextParameters*)aParam,
+            9,
+            aClipRect.iTl.iX,
+            aClipRect.iTl.iY,
+            aClipRect.iBr.iX,
+             aClipRect.iBr.iY,
+             aBaselineOffset,
+             aTextWidth,
+             aUp,
+             aVert,
+             aMargin
+             );
+    iDrawCommandCount++;
+    }
+
+// ---------------------------------------------------------------------------
+// MoveTo
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::MoveTo(const TPoint& aPoint)
+	{
+	iSendBuffer.WriteIntsL( EAlfMoveTo, 2, aPoint.iX, aPoint.iY );
+	}
+
+// ---------------------------------------------------------------------------
+// MoveBy
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::MoveBy(const TPoint& aVector)
+	{
+    iSendBuffer.WriteIntsL( EAlfMoveBy, 2, aVector.iX, aVector.iY );
+	}
+
+// ---------------------------------------------------------------------------
+// Plot
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::Plot(const TPoint& aPoint)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    FlushStateL( iRollback );
+#endif
+    iSendBuffer.WriteIntsL( EAlfPlot,  2, aPoint.iX, aPoint.iY );
+    iDrawCommandCount++; 
+    }
+
+// ---------------------------------------------------------------------------
+// Reset
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::Reset()
+    {
+    // filter away sequential reset commands
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    if ( iSendBuffer.PreviousCommand() == EAlfReset ) 
+        {
+        return;
+        }
+#endif
+    DoReset();
+    iSendBuffer.WriteCommandL( EAlfReset );
+    }
+
+// ---------------------------------------------------------------------------
+// DoReset
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::DoReset()
+    {
+    iFontHandle = 0;
+    iOrigin = KHuiWsDefaultOrigin;
+    iClippingRegion.Clear();
+    
+    iClippingRect = KHuiWsDefaultUserClipRect;
+    iTextShadowColor = KHuiWsDefaultShadowColor;
+    iBrushPatternSet = EFalse;
+    iPenColor = KHuiWsDefaultPenColor;
+    // SetPenColor( KHuiWsDefaultPenColor );
+    iPenSize = KHuiWsDefaultPenSize;
+    iDrawMode = KHuiWsDefaultDrawMode;
+    iLinePosition = KHuiWsDefaultLinePosition;
+
+
+    iBrushOrigin = KHuiWsDefaultBrushOrigin;
+    iCharJustExcess = KHuiWsDefaultCharJustExcess;
+    iCharJustNum = KHuiWsDefaultCharJustNum;
+    iWordJustExcess = KHuiWsDefaultWordJustExcess;
+    iWordJustNum = KHuiWsDefaultWordJustNum;
+    iDitherOrigin = KHuiWsDefaultDitherOrigin;
+    iDotLength = KHuiWsDefaultDotLength;
+    iDotMask = KHuiWsDefaultDotMask;
+    iDotParam = KHuiWsDefaultDotParam;
+    iDotDirection = KHuiWsDefaultDotDirection;
+    iShadowMode = KHuiWsDefaultShadowMode;
+    iStrikethrough = KHuiWsDefaultStrikethrough;
+    iUnderline = KHuiWsDefaultUnderline;
+    iUserDisplayMode = KHuiWsDefaultUserDisplayMode;
+    iPenStyle = KHuiWsDefaultPenStyle;
+    //SetPenColor( KHuiWsDefaultPenStyle );
+
+        
+#ifdef  _OPTIMIZE_WS_COMMANDS_ADVANCED_
+    iPreviousClippingRegion.Clear();
+    iPreviousFontHandle = 0;
+#endif
+    
+#ifdef  _OPTIMIZE_WS_COMMANDS_BASIC_
+    iDelayedContextState = 0;
+    
+        
+    iPreviousPenStyle = KHuiWsDefaultPenStyle;
+    iPreviousPenColor = KHuiWsDefaultPenColor;
+
+    iPreviousBrushStyle = KHuiWsDefaultBrushStyle;
+    iPreviousBrushColor = KHuiWsDefaultBrushColor;
+
+    
+    SetBrushStyle( ENullBrush  ); // KHuiWsDefaultBrushStyle
+    SetBrushColor( KHuiWsDefaultBrushColor );
+#else
+    iBrushColor = KHuiWsDefaultBrushColor;
+    iBrushStyle = KHuiWsDefaultBrushStyle;
+        
+    
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// SetBrushColor
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetBrushColor(const TRgb& aColor)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    if (aColor == iBrushColor)
+        return;
+#endif
+    iBrushColor = aColor;
+#ifdef	_OPTIMIZE_WS_COMMANDS_BASIC_
+    iDelayedContextState |= EModifiedBrushColor;
+#else
+    iSendBuffer.WriteIntsL( EAlfSetBrushColor, 1, aColor.Internal());
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// SetBrushOrigin
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetBrushOrigin(const TPoint& aOrigin)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    if (aOrigin == iBrushOrigin)
+        return;
+#endif    
+    iBrushOrigin = aOrigin;
+    iSendBuffer.WriteIntsL( EAlfSetBrushOrigin, 2, aOrigin.iX, aOrigin.iY );
+    }
+
+// ---------------------------------------------------------------------------
+// SetBrushStyle
+// calls SetBrushStyle(MWsGraphicsContextToBitGdiMappings::Convert(
+//  (MWsGraphicsContext::TBrushStyle)value))
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetBrushStyle(TBrushStyle aBrushStyle)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    if (aBrushStyle == iBrushStyle)
+        return;
+#endif
+    iBrushStyle = aBrushStyle;
+    
+    if ( aBrushStyle == ENullBrush || aBrushStyle == ESolidBrush || aBrushStyle == EPatternedBrush) 
+        {
+        // this is supported only by bitgdi
+        iSendBuffer.SetSupportedCommand( EAlfSetBrushStyle, 0 ); // All renderer support this
+        }
+    else
+        {
+        // 63 = binary 0b0111111, not supported by any renderer
+        iSendBuffer.SetSupportedCommand( EAlfSetBrushStyle, KNoSupportInAnyRenderer );
+        }
+    
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    iDelayedContextState |= EModifiedBrushStyle;
+#else
+    iSendBuffer.WriteIntL( EAlfSetBrushStyle, aBrushStyle );
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// SetClippingRegion
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetClippingRegion(const TRegion& aRegion)
+    {
+    iClippingRegion.Copy( aRegion );
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    iDelayedContextState |= EModifiedClipRect;
+    iDelayedContextState &= ~EModifiedClipReset;
+#else
+    iSendBuffer.WriteRegionL( EAlfSetClippingRegion, aRegion );
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// SetDrawMode
+// calls SetDrawMode(MWsGraphicsContextToBitGdiMappings::LossyConvert(
+//  (MWsGraphicsContext::TDrawMode)value))
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetDrawMode(TDrawMode aDrawMode)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    if (aDrawMode == iDrawMode)
+        return;
+#endif
+    iDrawMode = aDrawMode;
+    iSendBuffer.WriteIntL( EAlfSetDrawMode, aDrawMode);
+    }
+
+// ---------------------------------------------------------------------------
+// SetOrigin
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetOrigin(const TPoint& aPoint)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    if (iOrigin == aPoint)
+        return;
+#endif
+    iOrigin = aPoint;
+    iSendBuffer.WriteIntsL( EAlfSetOrigin,  2, aPoint.iX, aPoint.iY);
+    }
+
+// ---------------------------------------------------------------------------
+// SetPenColor
+// @todo Init to KRgbBlack
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetPenColor(const TRgb& aColor)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    if (aColor == iPenColor)
+        return;
+#endif
+    iPenColor = aColor;
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    iDelayedContextState |= EModifiedPenColor;
+#else
+    iSendBuffer.WriteIntsL( EAlfSetPenColor, 1, aColor.Internal());
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// SetPenStyle
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetPenStyle(TPenStyle aPenStyle)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    if (aPenStyle == iPenStyle)
+        return;
+#endif
+    iPenStyle = aPenStyle;
+    
+    if ( aPenStyle == ENullPen || aPenStyle == ESolidPen) 
+        {
+        // this is supported only by bitgdi
+        iSendBuffer.SetSupportedCommand( EAlfSetPenStyle, 0 ); // All renderer support this
+        }
+    else
+        {
+        // 63 = binary 0b0111111, not supported by any renderer
+        iSendBuffer.SetSupportedCommand( EAlfSetPenStyle, KNoSupportInAnyRenderer );
+        }
+    
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    iDelayedContextState |= EModifiedPenStyle;
+#else
+    iSendBuffer.WriteIntL( EAlfSetPenStyle, aPenStyle );
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// SetPenSize
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetPenSize(const TSize& aSize)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    if (aSize == iPenSize)
+        return;
+#endif    
+    if ( aSize.iWidth == aSize.iHeight ) 
+        {
+        // this is supported only by bitgdi
+        iSendBuffer.SetSupportedCommand( EAlfSetPenSize, 0 ); // All renderer support this
+        }
+    else
+        {
+        // 63 = binary 0b0111111, not supported by any renderer
+        iSendBuffer.SetSupportedCommand( EAlfSetPenSize, KNoSupportInAnyRenderer );
+        }
+    iPenSize = aSize;
+    iSendBuffer.WriteIntsL( EAlfSetPenSize, 2, aSize.iWidth, aSize.iHeight );
+	}
+
+// ---------------------------------------------------------------------------
+// SetTextShadowColor
+// call to SetShadowColor
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetTextShadowColor(const TRgb& aColor)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    if (iTextShadowColor == aColor)
+        return;
+#endif
+    iTextShadowColor = aColor;
+    iSendBuffer.WriteIntsL( EAlfSetTextShadowColor, 1 , aColor.Internal());
+    }
+
+// ---------------------------------------------------------------------------
+// SetCharJustification
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetCharJustification(TInt aExcessWidth, TInt aNumChars)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    if (aExcessWidth == iCharJustExcess && aNumChars == iCharJustNum)
+        return;
+#endif
+    iCharJustExcess = aExcessWidth;
+    iCharJustNum = aNumChars;
+    iSendBuffer.WriteIntsL( EAlfSetCharJustification, 2, aExcessWidth, aNumChars );
+    }
+
+// ---------------------------------------------------------------------------
+// SetWordJustification
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetWordJustification(TInt aExcessWidth, TInt aNumGaps)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    if (aExcessWidth == iWordJustExcess && aNumGaps == iWordJustNum)
+        return;
+#endif
+    iWordJustExcess = aExcessWidth;
+    iWordJustNum = aNumGaps;
+    iSendBuffer.WriteIntsL( EAlfSetCharJustification, 2, aExcessWidth, aNumGaps );
+    }
+
+// ---------------------------------------------------------------------------
+// SetUnderlineStyle
+// SetUnderlineStyle(MWsGraphicsContextToBitGdiMappings::Convert(
+//    (MWsGraphicsContext::TFontUnderline)value))
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetUnderlineStyle(TFontUnderline aUnderlineStyle)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    if (aUnderlineStyle == iUnderline)
+        return;
+#endif
+    iUnderline = aUnderlineStyle;
+    iSendBuffer.WriteIntsL( EAlfSetUnderlineStyle, 1, aUnderlineStyle );
+    }
+
+// ---------------------------------------------------------------------------
+//  SetStrikethroughStyle
+//  calls SetStrikethroughStyle(MWsGraphicsContextToBitGdiMappings::Convert(
+//  (MWsGraphicsContext::TFontStrikethrough)value));
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    if (aStrikethroughStyle == iStrikethrough)
+        return;
+#endif
+    iStrikethrough = aStrikethroughStyle;	
+    iSendBuffer.WriteIntsL( EAlfSetStrikethroughStyle, 1, aStrikethroughStyle );
+    }
+
+// ---------------------------------------------------------------------------
+// SetBrushPattern
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetBrushPattern(const CFbsBitmap& aBitmap)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    if ( iBrushPattern == iPreviousBrushPattern )
+        {
+        return;
+        }
+#endif    
+    iBrushPatternSet = ETrue;
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    iDelayedContextState |= EModifiedBrushPattern1;
+    iBrushPattern = aBitmap.Handle();
+#else
+    iSendBuffer.WriteIntsL( EAlfSetBrushPattern, 1, aBitmap.Handle() );
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// SetBrushPattern
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetBrushPattern(TInt aFbsBitmapHandle)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    if ( iBrushPattern == iPreviousBrushPattern )
+        {
+        return;
+        }
+#endif    
+    iBrushPatternSet = ETrue;
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    iDelayedContextState |= EModifiedBrushPattern2;
+    iBrushPattern = aFbsBitmapHandle;
+#else
+    iSendBuffer.WriteIntsL( EAlfSetBrushPattern, 1, aFbsBitmapHandle );
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// SetFont
+// calls UseFont
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetFont( const CFont* aFont)
+    {
+    const CFbsFont* font = static_cast<const CFbsFont*>(aFont);
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    if (iFontHandle == font->Handle())
+        return;	
+#endif
+    iFontHandle = font->Handle();
+
+#ifdef _OPTIMIZE_WS_COMMANDS_FONT_
+    iDelayedContextState &= ~EModifiedResetFont;
+    iDelayedContextState |= EModifiedSetFontNoDuplicate;
+#else        
+    iSendBuffer.WriteIntsL( EAlfSetFont, 1, font->Handle() );
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// CopyRect
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::CopyRect(
+        const TPoint& aOffset, 
+        const TRect& aRect )
+	{
+	iSendBuffer.WriteIntsL( EAlfCopyRect, 6,
+	        aOffset.iX,
+	        aOffset.iY,
+	        aRect.iTl.iX,
+	        aRect.iTl.iY,
+	        aRect.iBr.iX,
+	        aRect.iBr.iY );
+	}
+
+// ---------------------------------------------------------------------------
+// UpdateJustification
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::UpdateJustification(
+        const TDesC& aText,
+        const TTextParameters* aParam)
+    {
+    // Temp is not written to the stream, because 0 parameter is given to WriteDescriptorAndIntsL as TInt count.
+    // This is simply to avoid creating yet another WriteDescriptorL method. 
+    TInt notUsed; 
+    iSendBuffer.WriteDescriptorAndIntsL( EAlfUpdateJustification, aText, (CGraphicsContext::TTextParameters*)aParam, 0, notUsed );
+    }
+
+// ---------------------------------------------------------------------------
+// UpdateJustificationVertical
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::UpdateJustificationVertical(
+        const TDesC& aText,
+        const TTextParameters* aParam,
+        TBool aUp )
+    {
+    iSendBuffer.WriteDescriptorAndIntsL( EAlfUpdateJustificationVertical, aText, (CGraphicsContext::TTextParameters*)aParam, 1, aUp );
+    }
+
+// ---------------------------------------------------------------------------
+// SetFontNoDuplicate
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetFontNoDuplicate(const CFont* aFont)
+    {
+    const CFbsFont* font = static_cast<const CFbsFont*>(aFont);
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_    
+    if (iFontHandle == font->Handle())
+        return;	
+#endif
+    iFontHandle = font->Handle();
+
+#ifdef  _OPTIMIZE_WS_COMMANDS_FONT_
+    iDelayedContextState &= ~EModifiedResetFont;
+    iDelayedContextState |= EModifiedSetFontNoDuplicate;
+#else    
+    iSendBuffer.WriteIntsL( EAlfSetFontNoDuplicate, 1, font->Handle() );
+#endif
+
+    }
+
+// ---------------------------------------------------------------------------
+// HasBrushPattern
+// ---------------------------------------------------------------------------
+//
+TBool CAlfGraphicsContext::HasBrushPattern() const
+	{
+	return iBrushPatternSet;
+	}
+
+// ---------------------------------------------------------------------------
+// HasFont
+// ---------------------------------------------------------------------------
+//
+TBool CAlfGraphicsContext::HasFont() const
+	{
+	return iFontHandle;
+	}
+
+// ---------------------------------------------------------------------------
+// InternalizeL
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::InternalizeL(RReadStream& /*aReadStream*/)
+	{
+	//iContext->InternalizeL(aReadStream);
+	}
+
+// ---------------------------------------------------------------------------
+// ExternalizeL
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::ExternalizeL(RWriteStream& /*aWriteStream*/)
+	{
+	//iContext->ExternalizeL(aWriteStream);
+	}
+
+// ---------------------------------------------------------------------------
+// BrushColor
+// ---------------------------------------------------------------------------
+//
+TRgb CAlfGraphicsContext::BrushColor() const
+	{
+	return iBrushColor;
+	}
+
+// ---------------------------------------------------------------------------
+// PenColor
+// ---------------------------------------------------------------------------
+//
+TRgb CAlfGraphicsContext::PenColor() const
+	{
+	return iPenColor;
+	}
+
+// ---------------------------------------------------------------------------
+// TextShadowColor
+// ---------------------------------------------------------------------------
+//
+TRgb CAlfGraphicsContext::TextShadowColor() const
+	{
+    return iTextShadowColor;
+	}
+
+// ---------------------------------------------------------------------------
+// CopySettings
+// Copies all settings from the specified bitmap graphics context. 
+// const CFbsBitGc &aGc The bitmap graphics context whose settings are to be copied.
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::CopySettings(const MWsGraphicsContext& /*aGc*/)
+	{
+	// NOP
+	}
+
+// ---------------------------------------------------------------------------
+//  SetFaded
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetFaded(TBool /*aFaded*/)
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// SetFadingParameters
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetFadingParameters(TUint8 /*aBlackMap*/, TUint8 /*aWhiteMap*/)
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// FadeArea
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::FadeArea(const TRegion* /*aRegion*/ )
+    {
+	}
+
+// ---------------------------------------------------------------------------
+// This is not implemented by hitchcock
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::MapColors(    
+        const TRect &/*aRect*/, 
+        const TRgb */*aColors*/, 
+        TInt /*aNumPairs*/, 
+        TBool /*aMapForwards*/)
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// SetUserDisplayMode
+// ---------------------------------------------------------------------------
+//
+void CAlfGraphicsContext::SetUserDisplayMode(TDisplayMode aDisplayMode)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+    if (aDisplayMode == iUserDisplayMode)
+        return;
+#endif
+    iUserDisplayMode = aDisplayMode;
+    iSendBuffer.WriteIntsL( EAlfSetUserDisplayMode, 1, aDisplayMode );
+    }
+
+// ---------------------------------------------------------------------------
+// UseFont
+// hes value locally
+// @todo Check Symbian reference imnplementation for return value
+// ---------------------------------------------------------------------------
+//
+TInt CAlfGraphicsContext::UseFont(TInt aFontHandle)
+    {
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_   
+    if (iFontHandle == aFontHandle)
+        return KErrNone;	
+#endif
+    iFontHandle = aFontHandle;
+    iSendBuffer.WriteIntsL( EAlfUseFont, 1, aFontHandle );
+    // TODO: DANGER!! What should this in REALITY return?
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// Origin
+// ---------------------------------------------------------------------------
+//
+TPoint CAlfGraphicsContext::Origin() const
+    {
+    return iOrigin;
+    }
+
+#ifdef _OPTIMIZE_WS_COMMANDS_ADVANCED_
+// ---------------------------------------------------------------------------
+// CheckDelayedClipping
+// ---------------------------------------------------------------------------
+//
+TBool CAlfGraphicsContext::CheckDelayedClipping( TRect aDrawRect )
+    {
+    iDelayedClippingRegion.Copy( iClippingRegion );
+    aDrawRect.Move( iOrigin );
+    iDelayedDrawRegion.Clear();
+    iDelayedDrawRegion.AddRect( aDrawRect );
+    iDelayedDrawRegion.Intersect( iDelayedClippingRegion );
+
+    if ( iDelayedContextState & EModifiedClipRect 
+            && iDelayedDrawRegion.Count() == 1 && iDelayedDrawRegion[0] == aDrawRect )
+        {
+        iDelayedContextState &= ~EModifiedClipRect;
+        iRollback |= ERollbackClippingState;
+        return ETrue;
+        }
+
+    if ( iDelayedDrawRegion.IsEmpty() && iClippingRegion.Count() )
+        {
+        return EFalse;
+        }
+    return ETrue;
+    }
+#endif
+
+// ---------------------------------------------------------------------------
+// FlushStateL
+// ---------------------------------------------------------------------------
+//
+#ifdef _OPTIMIZE_WS_COMMANDS_BASIC_
+void CAlfGraphicsContext::FlushStateL( TInt& aRollbackClippingState )
+    {
+    /// Pen
+    if ( iDelayedContextState & EModifiedPenStyle 
+            && iPenStyle != iPreviousPenStyle )
+        {
+        iSendBuffer.WriteIntL( EAlfSetPenStyle, iPenStyle );
+        iPreviousPenStyle = iPenStyle;
+        }
+    if ( iDelayedContextState & EModifiedPenColor 
+            && iPenColor != iPreviousPenColor )
+        {
+        iSendBuffer.WriteIntsL( EAlfSetPenColor, 1, iPenColor.Internal());
+        iPreviousPenColor = iPenColor;
+        }
+
+    // Brush - Brush style must be set before any other brush related settings.
+    if ( iDelayedContextState & EModifiedBrushStyle 
+            && iBrushStyle != iPreviousBrushStyle )
+        {
+        iSendBuffer.WriteIntL( EAlfSetBrushStyle, iBrushStyle );
+        iPreviousBrushStyle = iBrushStyle;
+        }    
+
+    if ( iDelayedContextState & EModifiedBrushPattern1 
+            && iBrushStyle != iPreviousBrushStyle )
+        {
+        iSendBuffer.WriteIntL( EAlfSetBrushPattern, iBrushPattern );
+        iPreviousBrushPattern = iBrushPattern;
+        }
+
+    if ( iDelayedContextState & EModifiedBrushPattern2 
+            && iBrushStyle != iPreviousBrushStyle )
+        {
+        iSendBuffer.WriteIntL( EAlfSetBrushPattern2, iBrushPattern );
+        iPreviousBrushPattern = iBrushPattern;
+        }
+
+    if ( iDelayedContextState & EModifiedBrushColor 
+            && iBrushColor != iPreviousBrushColor )
+        {
+        iSendBuffer.WriteIntsL( EAlfSetBrushColor, 1, iBrushColor.Internal());
+        iPreviousBrushColor = iBrushColor;               
+        }
+#ifdef  _OPTIMIZE_WS_COMMANDS_ADVANCED_
+    // Clipping rect
+    if ( iDelayedContextState & EModifiedClipRect 
+            && !( iPreviousClippingRegion.Count() == 1 && iClippingRegion.Count() == 1 
+                    && iPreviousClippingRegion[0] == iClippingRegion[0] ))
+        {
+        iSendBuffer.WriteRegionL( EAlfSetClippingRegion, iClippingRegion );
+        iPreviousClippingRegion.Copy( iClippingRegion );
+        }
+    if ( iDelayedContextState & EModifiedClipReset )
+        {
+        iSendBuffer.WriteCommandL( EAlfResetClippingRegion );
+        } 
+#endif
+#ifdef  _OPTIMIZE_WS_COMMANDS_FONT_
+    // font
+    if ( iDelayedContextState & EModifiedSetFontNoDuplicate 
+            && iFontHandle != iPreviousFontHandle )
+        {
+        iSendBuffer.WriteIntsL( EAlfSetFontNoDuplicate, 1, iFontHandle );
+        iPreviousFontHandle = iFontHandle;
+        }
+    if ( iDelayedContextState & EModifiedResetFont )
+        {
+        iSendBuffer.WriteCommandL( EAlfResetFont );
+        }
+#endif
+    iDelayedContextState = 0;
+
+#ifdef  _OPTIMIZE_WS_COMMANDS_ADVANCED_
+    if ( aRollbackClippingState & ERollbackClippingState )
+        {
+        iDelayedContextState |= EModifiedClipRect;
+        aRollbackClippingState &= ~ERollbackClippingState;
+        }
+#endif    
+    }
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/AlfRenderStage/src/alfrssendbuffer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,2108 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Handles serializing of data and sending it to alf streamer server.
+*
+*/
+
+
+
+// Maybe...
+// - EAlfCancelClippingRect is many times followed by EAlfSetClippingRect. Could the EAlfCancelClippingRect be ignored?
+// - EAlfSetBrushStyle (etc. other non drawing commands) are followed by AlfReset and no drawing is done. Could the Set
+//   commands be ignored.
+// Can ignoring be done faster than executing useless commands?
+
+#include <barsread.h>
+#include <barsc.h>
+#include <e32std.h>
+#include <alfstreamerconsts.h>
+#include <huiwscanvascommands.h>
+#include <uiacceltk/HuiUtil.h>
+
+#include <alfdecoderserverclient.h>
+#include <alflogger.h>
+#include "alf/alfcompositionclient.h"
+#include "alfrssendbuffer.h"
+#include "alfrenderstage.h"
+#include "alfcommanddebug.h"
+#include <alfnonsupportedwscommands.rsg>
+
+#include <data_caging_path_literals.hrh>
+
+_LIT( KRendererSupportedCommands,"alfnonsupportedwscommands.rsc" );
+
+const TInt KFrameHeaderSizeWhenCacheChunks = 500;
+const TInt KFrameHeaderSize = 5000;
+const TInt KFrameOffsetTemplate = 12345678;
+const TInt KCacheChunkMinSize = 50000;
+const TUint8 KDivisibleByX = 8;
+const TInt KWindowFrameHeader1 = 6; // bytes
+const TInt KWindowFrameHeader2 = 18 + 10; // bytes // TP +10 
+
+const TInt KAllRenderersMask = 63;
+const TInt KPossiblePerformanceProblemInWindow = 64;
+const TInt KPossiblePerformanceProblemInWindowThreshold = 1000;
+
+
+enum TPatternSearchStates
+    {
+    ESeekSetClippingRegion = 0,
+    ESeekBitBlit = 1,
+    ESeekResetClipping = 2,
+    ESeekBrushStyle1 = 3,
+    ESeekBrushStyle2 = 4
+    };
+
+
+#ifdef _OPTIMIZE_WS_COMMANDS_ADVANCED_
+const TInt TSearchPatternBitBlit[2][3] = { 
+                // Search command           // state                // alternative command in this state
+                { EAlfSetClippingRegion,    ESeekSetClippingRegion, KErrNotFound },
+                { EAlfBitBltMasked,         ESeekBitBlit,           EAlfBitBltRect }};
+#else
+const TInt TSearchPatternBitBlit[5][3] = { 
+				// Search command			// state				// alternative command in this state
+        		{ EAlfSetClippingRegion, 	ESeekSetClippingRegion, KErrNotFound },
+        		{ EAlfBitBltMasked, 		ESeekBitBlit, 			EAlfBitBltRect },
+        		{ EAlfResetClippingRegion, 	ESeekResetClipping, 	KErrNotFound },
+        		{ EAlfSetBrushStyle, 		ESeekBrushStyle1, 		KErrNotFound },
+        		{ EAlfSetBrushStyle, 		ESeekBrushStyle2, 		EAlfSetPenStyle} };
+#endif
+                
+
+// ---------------------------------------------------------------------------
+// class CAlfObserver
+// ---------------------------------------------------------------------------
+//
+
+NONSHARABLE_CLASS(CAlfObserver):public CActive
+    {
+    public:
+
+        // ---------------------------------------------------------------------------
+        // SetL
+        // ---------------------------------------------------------------------------
+        //
+        static void SetL(CAlfRsSendBuffer* aHost, TBool aStartServer )
+             {
+             CAlfObserver* me = new (ELeave)  CAlfObserver(aHost, aStartServer);
+             me->SetActive();
+             // breahe one cycle to allow wserv kick its server object alive
+             TRequestStatus* status = &me->iStatus; 
+             User::RequestComplete(status, KErrNone);   
+             }
+  
+        // ---------------------------------------------------------------------------
+        // NewL
+        // ---------------------------------------------------------------------------
+        //
+        CAlfObserver(CAlfRsSendBuffer* aHost, TBool aStartServer):CActive(2*EPriorityHigh),
+            iHost(aHost), iStartServer(aStartServer),  iBreathe(ETrue)
+            {
+            CActiveScheduler::Add(this);
+            iTimer.CreateLocal();
+            }
+        
+        // ---------------------------------------------------------------------------
+        // RunL
+        // ---------------------------------------------------------------------------
+        //
+        void RunL()
+            {
+            if (iBreathe && iStartServer)
+                {
+                iBreathe = EFalse;
+                SetActive();
+                TRAPD(err, AlfServerStarter::StartL(iStatus, EFalse));
+                if (err)
+                    {
+                    // Important, and thus enabled even in release builds. Other option would be letting leave to fall through 
+                    // render stage stack and let window server panic the boot
+                    RDebug::Print(_L("********* Error occurred when starting alf: %d"),err);
+                    }
+                else
+                    {
+                    return;
+                    }
+                }
+            else
+                {
+                if( !iHost->ConnectL() ) // if connecting fails, try again a bit later
+                    {
+                    SetActive();
+                    if( iStartServer )
+                        {
+                        iTimer.After( iStatus, 250000); // primary display is more important
+                        }
+                    else
+                        {
+                        iTimer.After( iStatus, 1000000);
+                        }
+                    }
+                else
+                    {
+                    __ALFLOGSTRING("********************FLUSHING WSERV");    
+					TRAP_IGNORE(iHost->PrepareBufferL());
+					TRAP_IGNORE(iHost->SendL( NULL ));
+                    iTimer.Close();
+                    delete this;
+                    }
+                }
+            }
+
+        // ---------------------------------------------------------------------------
+        // DoCancel
+        // ---------------------------------------------------------------------------
+        //
+        void DoCancel()
+            {
+            // not applicable atm
+            }
+        
+    private: // Data
+        
+        CAlfRsSendBuffer* iHost;
+        TBool iStartServer;
+        TBool iBreathe;
+        RTimer iTimer;
+    };
+        
+// ---------------------------------------------------------------------------
+// doFlushBuffer
+// Local function
+// ---------------------------------------------------------------------------
+//
+TInt doFlushBuffer( TAny* aPtr )
+    {
+    ((CAlfRsSendBuffer*)aPtr)->FlushBuffer();
+    return 0; // must return something
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfRsSendBuffer* CAlfRsSendBuffer::NewL(CAlfRenderStage& aParent, TInt aScreenNumber )
+	{
+	CAlfRsSendBuffer* self = new(ELeave) CAlfRsSendBuffer( aParent, aScreenNumber );
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+	
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfRsSendBuffer::~CAlfRsSendBuffer()
+    {
+    if ( iAlfBridgerClient )
+        {
+        iAlfBridgerClient->Close();
+        delete iAlfBridgerClient;
+        iAlfBridgerClient = NULL;
+        delete iAlfCompositionCntrlClient;
+        }
+#ifdef _OLD_STREAM    
+    if ( iBufStream )
+        {
+        iBufStream->Close();
+        delete iBufStream;
+        iBufStream = NULL;
+        }
+#endif    
+    iChunk.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::ConstructL()
+    {
+    // If this is not the primary screen (0) do not send any commands to Alf server
+    iDisabled = (iScreenNumber != 0);
+    
+    ReadNonSupportedCommandsL();
+    iChunkInUse = 0;
+    iBooting = ETrue;
+#ifdef _ALF_PRINT_WS_COMMANDS_
+    iLog = 0;
+    iCommandDebugger = CAlfCommandDebug::NewL();
+#endif
+    
+    TBool runInsideWserv = ETrue; // EFalse;
+    if( runInsideWserv )
+        {
+        TBool startServer = ETrue;
+        if (iScreenNumber != 0) // we need one instance only
+            {
+            startServer = EFalse;
+            }
+        CAlfObserver::SetL(this, startServer);
+        }
+    else
+        {
+        CAlfObserver::SetL(this, EFalse);
+        }
+    
+    MAlfCompositionController* compcntrl = (MAlfCompositionController*)iParent.ResolveObjectInterface(KAlfCompositionControllerIfUid);
+    if (compcntrl)
+      {
+      compcntrl->AlfBridgeCallback(MAlfBridge::EAlfBridgeCreated, (MAlfBridge*)this);  
+      }
+    }
+
+// ---------------------------------------------------------------------------
+// ReadNonSupportedCommandsL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::ReadNonSupportedCommandsL()
+    {
+    RFs fs;
+    User::LeaveIfError(fs.Connect());
+    CleanupClosePushL(fs);
+    RResourceFile resFile;    
+    TInt result;
+    // resolve the absolute path
+    // Read unsupported command resource
+    TFileName resourceFileName;
+    TPtrC driveLetter = TParsePtrC( RProcess().FileName() ).Drive();
+    resourceFileName.Copy( driveLetter );  
+    resourceFileName.Append( KDC_ECOM_RESOURCE_DIR );
+    resourceFileName.Append( KRendererSupportedCommands );
+
+    TRAP( result, resFile.OpenL(fs,resourceFileName); );
+    if ( result == KErrNone )
+        {
+        CleanupClosePushL(resFile);
+        resFile.ConfirmSignatureL(0); // offset value.
+
+        TInt resId = R_ALF_NON_SUPPORTED_COMMANDS_ARRAY;
+
+        HBufC8* readData = resFile.AllocReadL(resId);
+        // now first get rid of RResourceFile and RFs as they are not needed any more
+        CleanupStack::PopAndDestroy(); // resFile
+        CleanupStack::PopAndDestroy(); // fs
+        CleanupStack::PushL(readData);
+
+        // now parse it and store the values in cmdTextArray
+        TResourceReader reader;
+        reader.SetBuffer(readData);
+        const TInt count = reader.ReadInt16();
+        TInt8 command;
+
+        TInt8 value;
+        TInt nonSupportedParameterCount = 0;
+        // resource file contains only non supported commands by renderers. Patch them to the iSupportedCommands
+        TInt supportedParameterIndex = 0;
+        for ( TInt i = 0; i < count ; i++ )
+            {
+            command = reader.ReadInt8();
+            value = ConvertToBitsL( 7, &reader );
+
+            nonSupportedParameterCount = reader.ReadInt16();
+            if ( nonSupportedParameterCount > 0 )
+                {
+                iSupportedCommandParameters[command][0] = supportedParameterIndex;
+                for ( TInt l = 0 ; l < nonSupportedParameterCount ; l ++ )
+                    {
+                    TInt8 parameterValue = reader.ReadInt8();
+                    iSupportedParameters[supportedParameterIndex][0] = parameterValue;
+                    TInt8 value2 = ConvertToBitsL( 6, &reader  );
+                    iSupportedParameters[supportedParameterIndex][1] = value2;
+                    supportedParameterIndex++;
+                    }
+                iSupportedCommandParameters[command][1] = supportedParameterIndex;
+                }
+            iNonSupportedCommands[command] = value;
+            }
+        CleanupStack::PopAndDestroy(readData);
+        }
+    else
+        {
+        __ALFLOGSTRING1("CAlfRsSendBuffer::ConstructL - WARNING! Failed to read unsupported commands from resource file: %S! Error code:st %d.", &resourceFileName );
+        CleanupStack::PopAndDestroy(); // fs
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ConvertToBitsL
+// ---------------------------------------------------------------------------
+//
+TUint8 CAlfRsSendBuffer::ConvertToBitsL( TInt aCount, TResourceReader* aReader )
+    {
+#ifdef _DEBUG    
+    if ( aCount > 7 )
+        {
+        __ALFLOGSTRING("CAlfRsSendBuffer::ConvertToBitsL - Can convert only 7 sequantial bytes to one byte");
+        USER_INVARIANT(); //
+        }
+#endif    
+    TInt8 value = 0;
+    TInt8 notSupported[7];
+    aReader->Read( notSupported, aCount );
+    TUint8 mask = 1;
+    for (TInt j = 0; j < aCount ; j ++)
+        {
+        if ( notSupported[j] ){ value |= mask ; }
+        mask = mask << 1;
+        }
+    return value;
+    }
+
+// ---------------------------------------------------------------------------
+// RunL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::RunL()
+    {
+    switch( iState )
+        {
+        case EWaitingAck:
+            {
+            if ( iStatus == EAlfBridgerAsyncronousData || iStatus < 0 )
+                {
+                TInt chunkIndex = 0;
+                // The following is written to the last created chunk.
+                TInt cacheChunkCount = iCacheChunks.Count();
+                
+                if ( cacheChunkCount > 0 )
+                    {
+                    // request destruction of all temporary chunks
+                    while ( chunkIndex < cacheChunkCount )
+                        {
+                        WriteInt8L( EAlfDestroyChunk );
+                        WriteInt8L( 0 ); // screen number, not used.
+                        WriteInt32L( iCacheChunks[chunkIndex].Handle() );
+                        WriteInt8L( EAlfCommandEndMarker );
+                        
+                        chunkIndex++;
+                        }
+                    if ( !iBooting )
+                        {
+                        // This is not necessary in the first boot, because jump 
+                        // request has been already created in PrepareBufferL
+                        
+                        JumpToAnotherChunkL( 0, iPrimaryChunkMaxSize );
+                        OpenPrimaryChunkForWritingL();
+                        SeekL(0); // rewind stream to the beginning
+                        WriteInt8L( EAlfCommandEndMarker );
+                        CommitL();
+                        FlushBuffer();
+                        }
+                    // destroy renderstage side handles to the chunk. alfhierarchy
+                    // has still open handles for a while.
+                    while( iCacheChunks.Count() )    
+                        {
+                        iCacheChunks[ 0 ].Close();
+                        iCacheChunks.Remove( 0 );
+                        }
+                    }
+                iUsedChunkMaxSize = iPrimaryChunkMaxSize - sizeof( TChunkHeader);
+                iChunkInUse = 0;
+                iBooting = EFalse; // alf has acknowledged the first frame
+                iParent.EndCallBack( iQuedStatus );
+                iState = EIdle;
+                }
+            break;
+            }
+        case EWaitingHandle:
+            {
+            break;
+            }
+        case EIdle:
+            {
+            break;
+            }
+        default:;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// DoCancel
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::DoCancel()
+    {
+    // TODO
+    }
+
+// ---------------------------------------------------------------------------
+// WriteFlagsL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::WriteFlagsL( )
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    // space has been reserved for us
+    WriteInt8L( EAlfFrameFlags ); 
+    WriteInt32L( iFlags);
+    WriteInt8L( EAlfCommandEndMarker );
+    }
+
+// ---------------------------------------------------------------------------
+// WriteCommandL
+// writes 1 TInt value to the stream
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::WriteCommandL( const TUint8& aCommand, TInt aSize )
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    if ( 
+#ifdef _OLD_STREAM
+            iBufStream->Sink() && 
+#endif
+            aCommand == EAlfPacketReady )
+        {
+        iReceivingDrawingCommands = EFalse;
+        // if offscreen content has not been flushed, we'll keep the frame in not completed state.
+        // it will be delivered to CHuiCanvasVisual, but not processed until finished packet arrives.
+        // make sure, that frame flags (iFlags) follow this command.
+        }
+
+    if (! InitCommandL( aCommand, aSize)){ return;}
+#ifdef _ALF_PRINT_WS_COMMANDS_  
+    if ( !iReceivingDrawingCommands )
+        {
+        aSize += sizeof(TUint8);
+        }
+    iCommandDebugger->SetDescriptionAndSize( aCommand, aSize, R_ALF_COMMAND_DESCRIPTION_ARRAY  );
+    iCommandDebugger->Print();
+#endif   
+    if ( !iReceivingDrawingCommands )
+        {
+        WriteInt8L( EAlfCommandEndMarker ); 
+        }
+    if ( aCommand == EAlfPacketReady )
+        {
+        iReceivingDrawingCommands = EFalse;
+        iWrappingFrame = EFalse;
+        
+#ifdef _ALF_PRINT_WS_COMMANDS_    
+        iCommandDebugger->PrintStatistic();
+        iCommandDebugger->EndFrame();
+#endif
+       
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// WriteIntsL
+// writes aCount amount of variables to the stream and updates stream index.
+// ---------------------------------------------------------------------------
+//
+// @todo Reference to Tint parameter was removed, because it did not pass armv5 compiler
+
+void CAlfRsSendBuffer::WriteIntsL( const TUint8& aCommand, TInt aCount, TRefByValue<const TInt> aFirst,... )
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    const TInt size = sizeof(TInt32) * aCount;
+    if (! InitCommandL( aCommand, size )){ return;}
+#ifdef _ALF_PRINT_WS_COMMANDS_    
+    iCommandDebugger->SetDescriptionAndSize( aCommand, size, R_ALF_COMMAND_DESCRIPTION_ARRAY  );
+    iCommandDebugger->Print();
+#endif
+    
+	if ( aCount > 0 )
+	    {
+	    aCount--; // first item is serialized separately. It seems to exist at different location as rest of the parameters.
+	    WriteInt32L( aFirst );
+	    WriteL( (TUint8*)&aFirst + sizeof(TInt32), aCount * sizeof(TInt32) );
+	    //TInt size = sizeof(TInt32) * aCount;
+	    //iBufStream->WriteL( (TUint8*)&aFirst + sizeof(TInt32), size ); iOffset += size ; 
+	    }
+	if ( !iReceivingDrawingCommands )
+	    {
+	    WriteInt8L( EAlfCommandEndMarker );
+	    }
+    }
+
+void CAlfRsSendBuffer::WriteIntsL(TUint8 aCommand, TInt aCount, TInt* aArray)
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    const TInt size = sizeof(TInt32) * aCount;
+    if (!InitCommandL( aCommand, size ))
+      { 
+      return;
+      }
+
+#ifdef _ALF_PRINT_WS_COMMANDS_    
+    iCommandDebugger->SetDescriptionAndSize( aCommand, size, R_ALF_COMMAND_DESCRIPTION_ARRAY  );
+    iCommandDebugger->Print();
+#endif
+    
+    for(TInt i = 0; i < aCount; i++)
+        {	    
+        WriteInt32L( aArray[i] );
+        }
+        
+	if ( !iReceivingDrawingCommands )
+	    {
+	    WriteInt8L( EAlfCommandEndMarker );
+	    }
+    }
+
+// ---------------------------------------------------------------------------
+// WriteIntL
+// All possibly non-supported commands that have a parameter are using this version
+// of WriteIntL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::WriteIntL( const TUint8& aCommand, TInt aValue )
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    TBool supported = EFalse;
+    if (iNonSupportedCommands[aCommand])
+        {        
+        for( TInt i = iSupportedCommandParameters[aCommand][0]; i < iSupportedCommandParameters[aCommand][1]; i++ )
+            {
+            if ( !supported && aValue == iSupportedParameters[i][0])
+                {
+                supported = ETrue;
+                iNonSupportedCommands[aCommand] = iSupportedParameters[i][1];
+                }
+            }
+        }
+    else
+        {
+        supported = ETrue;
+        }
+    
+     if ( !supported )
+         {
+         iNonSupportedCommands[aCommand] = KAllRenderersMask;
+         }
+    if (! InitCommandL( aCommand, sizeof(TInt32) )){ return;}
+#ifdef _ALF_PRINT_WS_COMMANDS_    
+    iCommandDebugger->SetDescriptionAndSize( aCommand, sizeof(TInt32), R_ALF_COMMAND_DESCRIPTION_ARRAY );
+    iCommandDebugger->Print();
+#endif    
+    // only commands, that may not be supported use this function
+    if ( aCommand == EAlfSetPenStyle )
+        {
+        iPenStyle = aValue; // for patter search
+        }
+    WriteInt32L( aValue);
+    if ( !iReceivingDrawingCommands )
+        {
+        WriteInt8L( EAlfCommandEndMarker );
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// WriteRegionL
+// writes aCount amount of variables to the stream and updates stream index.
+// ---------------------------------------------------------------------------
+//
+// @todo Reference to Tint parameter was removed, because it did not pass armv5 compiler
+
+void CAlfRsSendBuffer::WriteRegionL( const TUint8& aCommand, const TRegion& aRegion )
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    TInt count = aRegion.Count();
+    const TInt size = sizeof(TInt32) * ( 4 * count + 1);
+
+    if (! InitCommandL( aCommand, size )){ return;}
+#ifdef _ALF_PRINT_WS_COMMANDS_    
+    iCommandDebugger->SetDescriptionAndSize( aCommand, size, R_ALF_COMMAND_DESCRIPTION_ARRAY );
+    iCommandDebugger->SetRegion( aRegion );
+    iCommandDebugger->Print();
+#endif
+    WriteInt32L( count );
+    TInt i = 0;
+    while( i < count )
+        {
+        WriteL( (TUint8*)&aRegion[i].iTl.iX, 4 * sizeof(TInt32 ));
+        if ( aCommand == EAlfSetClippingRegion )
+            {
+            iSearchPatternClipRegion.AddRect(aRegion[i]);
+            }
+        i++;
+        }
+    
+    if ( !iReceivingDrawingCommands )
+        {
+        WriteInt8L( EAlfCommandEndMarker );
+        }
+  
+    }
+
+// ---------------------------------------------------------------------------
+// WriteDescriptorAndIntsL
+// writes aCount amount of variables to the stream and updates stream index.
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::WriteDescriptorAndIntsL(
+        const TUint8& aCommand,
+        const TDesC& aText,
+        const CGraphicsContext::TTextParameters* aTextParameter,
+                TInt aCount,
+        TRefByValue<const TInt> aFirst,... )
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    if ( aText.Length() == 0 )
+        {
+        return;
+        }
+   
+   TBool useCachedText( EFalse );
+   if ( iCachedText 
+           && iCachedText->Length() == aText.Length() 
+           && iCachedText->Compare( aText ) == 0 )
+       {
+       useCachedText = ETrue;
+       }
+   else
+       {
+       delete iCachedText;
+       iCachedText = aText.AllocL();
+       }
+   // calculate size for the command
+   TInt  size = sizeof(TInt32) * ( 2 + aCount ) + //  ints
+                + 2 * sizeof(TInt8);  // existances of: text and TextParameters
+               
+   if ( !useCachedText )
+       {
+       size += aText.Size() + sizeof(TInt32); // text + its length  
+       }
+    
+    if ( aTextParameter )
+        {
+        size += ( 2 * sizeof(TInt32) )+ sizeof(TUint16);
+        }
+
+    if (! InitCommandL( aCommand, size )){ return;}
+#ifdef _ALF_PRINT_WS_COMMANDS_    
+    iCommandDebugger->SetDescriptionAndSize( aCommand, size, R_ALF_COMMAND_DESCRIPTION_ARRAY );
+    iCommandDebugger->Print();
+#endif                
+    WriteInt8L( useCachedText );
+    if ( !useCachedText )
+        {
+        WriteInt32L( aText.Size() );
+
+        TInt offset = iOffset + 2 * sizeof(TUint8);
+        TInt startPadding = offset % KDivisibleByX;
+        startPadding = startPadding == 0 ? 0 : KDivisibleByX - startPadding;
+        WriteInt8L( startPadding ); 
+
+        TInt endPadding = (offset + startPadding + aText.Size() ) % KDivisibleByX;
+        endPadding = endPadding == 0 ? 0 : KDivisibleByX - endPadding;
+        WriteInt8L( endPadding );
+        TUint8 padding[KDivisibleByX];
+        WriteL( (TUint8*)padding, startPadding );
+        WriteL( (TUint8*)aText.Ptr(), aText.Size() );
+        WriteL( (TUint8*)padding, endPadding ); 
+        // aTextParameter can be null.
+        }
+    if ( aTextParameter )
+        { 
+        // TODO: Remove commented code, when this is tested.
+        if ( aTextParameter->iStart == 0 
+                && aTextParameter->iEnd == aText.Length()
+                && aTextParameter->iFlags == 0 )
+            {
+			// actually, this never comes so far...
+            WriteInt8L( 2 ); // Use the default values
+            }
+        else
+            {
+            WriteInt8L( 1 ); 
+            TInt size =  2 * sizeof (TInt) + sizeof (TUint16) ;
+            WriteL( (TUint8*)&aTextParameter->iStart, size);
+            }
+        }
+    else
+        {
+        WriteInt8L( 0 );
+        }
+	if ( aCount > 0 )
+	{
+	    aCount--;
+	    WriteInt32L( aFirst );
+	    TInt size = aCount * sizeof(TInt32);
+	    WriteL( (TUint8*)&aFirst + sizeof(TInt32), size );
+    }
+    if ( !iReceivingDrawingCommands )
+        {
+        WriteInt8L( EAlfCommandEndMarker );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// WritePointArrayL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::WritePointArrayL( const TUint8& aCommand, const CArrayFix<TPoint>* aPoWriteIntList )
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    TInt count = aPoWriteIntList->Count();
+    const TInt size = sizeof(TInt32) * (2 * count + 1);
+
+    if (! InitCommandL( aCommand, size )){ return;}
+
+    TInt index(0);
+    WriteInt32L( count );
+	while( index < count )
+        {
+        WriteInt32L( aPoWriteIntList->At(index).iX );
+		WriteInt32L( aPoWriteIntList->At(index).iY );
+		index++;
+        }
+    if ( !iReceivingDrawingCommands )
+        {
+        WriteInt8L( EAlfCommandEndMarker );
+		}
+    }
+
+// ---------------------------------------------------------------------------
+// WritePointArrayL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::WritePointArrayL( const TUint8& aCommand, const TPoint* aPoWriteIntList, TInt aNumPoints )
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    const TInt size = sizeof(TInt32) * (2 * aNumPoints + 1);
+    if (! InitCommandL( aCommand, size )){ return;}
+
+    TInt index(0);
+    WriteInt32L( aNumPoints );
+	while( index < aNumPoints )
+        {
+        WriteInt32L( aPoWriteIntList[index].iX );
+		WriteInt32L( aPoWriteIntList[index].iY );
+		index++;
+        }
+    if ( !iReceivingDrawingCommands )
+        {
+        WriteInt8L( EAlfCommandEndMarker );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// WritePointArrayL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::WritePointArrayL( const TUint8& aCommand, const TArray<TPoint>* aPoWriteIntList  )
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    const TInt size = sizeof(TInt32) * (2 * aPoWriteIntList->Count() + 1);
+    if (! InitCommandL( aCommand, size )){ return;}
+
+    TInt index(0);
+    TInt count = aPoWriteIntList->Count(); 
+    WriteInt32L( count );
+    TArray<TPoint> list = *aPoWriteIntList;
+            
+    while( index < count )
+        {
+        const TPoint& point = list[index]; 
+        WriteInt32L( point.iX );
+		WriteInt32L( point.iY );
+		 index++;
+        }   
+    if ( !iReceivingDrawingCommands )
+        {
+        WriteInt8L( EAlfCommandEndMarker );
+		}
+    }
+
+// ---------------------------------------------------------------------------
+// ConnectL
+// ---------------------------------------------------------------------------
+//
+TBool CAlfRsSendBuffer::ConnectL()
+    {
+/*    if (iDisabled) // return if this send buffer is not in use
+        {
+        return ETrue;
+        }
+  */  
+    if ( iAlfBridgerClient )
+        {
+        return ETrue; // already connected
+        }
+    iAlfBridgerClient = new(ELeave)RAlfBridgerClient();
+    TInt result = iAlfBridgerClient->Connect();
+    if ( result != KErrNone )
+        {
+        // server is not available
+        delete iAlfBridgerClient;
+        iAlfBridgerClient = NULL;
+        return EFalse;
+        }
+    TIpcArgs args(iScreenNumber);
+    User::LeaveIfError(iAlfBridgerClient->SendSynch(KAlfCompositionWServScreenNumber, args));
+
+    MAlfCompositionController* compcntrl = (MAlfCompositionController*)iParent.ResolveObjectInterface(KAlfCompositionControllerIfUid);
+    if (compcntrl)
+      {
+#ifndef USE_UI_LAYER_FOR_ALF
+        TAlfNativeWindowData data;
+        TPckg<TAlfNativeWindowData> pkg(data);
+
+        if( iScreenNumber == 0) // only for primary screen
+            {
+            User::LeaveIfError(iAlfBridgerClient->SendSynch(EAlfGetNativeWindowHandles, TIpcArgs(&pkg)));
+            compcntrl->AlfBridgeCallback(MAlfBridge::EAlfNativeWindowCreated, &data); 
+            }
+        }
+ #endif //#ifdef USE_UI_LAYER_FOR_ALF   
+    iAlfCompositionCntrlClient = CAlfCompositionCntrlClient::NewL(iAlfBridgerClient, compcntrl);
+    return ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+//  WriteWindowIdentifierL
+//  Convenience function
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::WriteWindowIdentifierL( )
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+#ifdef _OLD_STREAM
+   if ( !iBufStream->Sink() )
+        {
+        return;
+        }
+#endif    
+    // <HEADER1>
+    // if you change <HEADER1>, you must update its size in the beginning of this file
+    WriteInt8L( EAlfSetWindowId );
+	ResetPatternSearch();
+    
+    WriteInt8L( iScreenNumber );
+    WriteInt32L( iWindowId );
+	// </HEADER1>
+    WriteFollowingFrameOffsetTemplateL();
+     }
+
+// ---------------------------------------------------------------------------
+//  WriteWindowDataL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::WriteWindowDataL(
+		TUint32 aWindowUid,
+		TInt aRegionSize, 
+		TInt aShapeRegionSize )
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+	// TODO: TERO: END	
+    iNonSupportedCommandsInWindow = 0;
+    iPerformanceIssueCommandCount = 0;
+    iFlags = 0;
+    delete iCachedText;
+    iCachedText = NULL;
+
+    iPreviousCommand = EAlfCommandNotInitialized;
+	// Note, the size tells the maximum space needed for the command
+    TInt size = sizeof(TUint32) + // windowId
+        sizeof(TUint32) + // next frame offset
+        3 * sizeof(TUint8) + // command + contains unsupported commands + end marker
+        sizeof(TUint8) + // screen number ( in WriteFollowingFrameOffsetTemplate)
+        sizeof(TUint32) * ( 4 * aRegionSize + 1 ) +  // updateregion 
+        sizeof(TUint8) * KDivisibleByX + // possible padding
+        sizeof(TUint32) * ( 4 * aShapeRegionSize + 1) + // possible shape region
+        sizeof(EAlfCommandEndMarker); // endmarker for update region and this command
+    if (! InitCommandL( EAlfSetWindowId, size )){ return;}
+#ifdef _ALF_PRINT_WS_COMMANDS_    
+    iCommandDebugger->StartFrame();
+#endif
+    ResetPatternSearch();
+    iWindowId = aWindowUid;
+    WriteInt32L( aWindowUid );
+	WriteFollowingFrameOffsetTemplateL();
+    iReceivingDrawingCommands = ETrue; // WriteCommand will set to false, when ERedrawComplete is received
+    }
+
+// ---------------------------------------------------------------------------
+//  WriteFollowingFrameOffsetTemplateL
+//  Convenience function
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::WriteFollowingFrameOffsetTemplateL()
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+		
+#ifdef _OLD_STREAM
+    if ( iBufStream->Sink() )
+#endif        
+        {
+        iTemplateOpen++;
+        if ( iTemplateOpen != 1 )
+            {
+            USER_INVARIANT();
+            }
+        iNextFrameOffsetPos = iOffset;
+        
+        // If you add anything to <HEADER2>, you must update its size in the beginning of the file.
+        // <HEADER2>
+        TInt chunkId = 0;
+        if ( iChunkInUse)
+            {
+            chunkId = iCacheChunks[iChunkInUse-1].Handle(); 
+            }
+        WriteInt32L( chunkId );
+		WriteInt32L( KFrameOffsetTemplate ); // we'll come back later on, and write the correct frame size to this location
+        // determine need for padding
+        TInt pos = iOffset; 
+        TInt offset = pos + 2 * sizeof(TUint8) + sizeof(TUint8) + sizeof(TInt32); // padding and endmarker.
+        TInt startPadding = offset % KDivisibleByX;
+        startPadding = startPadding == 0 ? 0 : KDivisibleByX - startPadding;
+        WriteInt8L( EAlfFrameFlags );
+		WriteInt32L( 0 ); 
+		
+        WriteInt8L( startPadding );
+		iFramePadding = startPadding;
+        WriteInt8L( EAlfCommandEndMarker );
+		// actual padding
+        while ( startPadding-- )
+            {
+            WriteInt8L( 0 );
+			}
+        iArrayImplOffset = iOffset;
+        InitMarker(iMarker);
+		WriteInt8L( EAlfFrameContainsUnsupportedCommands );
+        WriteInt8L( 0 );
+        WriteArrayHeaderTemplateL();
+        InitTOffsetElemArray(iOffsetArray);
+        // </HEADER2>
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  WriteFollowingFrameOffsetL
+// ---------------------------------------------------------------------------
+//
+TBool CAlfRsSendBuffer::WriteFollowingFrameOffsetL(TBool aSendArray)
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return ETrue;
+        }
+    TOffsetElem e;
+    if (aSendArray)
+        {
+        e = WriteIndexArrayL(iOffsetArray);
+        }
+    
+#ifdef _OLD_STREAM    
+    if ( iBufStream->Sink() )
+#endif        
+        {
+        if ( iPerformanceIssueCommandCount > KPossiblePerformanceProblemInWindowThreshold )
+            {
+            if ( iPerformanceIssueCommandCount > iMaxPerformanceIssueCommandCount )
+                {
+                iMaxPerformanceIssueCommandCount = iPerformanceIssueCommandCount;
+                }
+            iNonSupportedCommandsInWindow |= KPossiblePerformanceProblemInWindow; 
+            }
+        
+        iTemplateOpen--;
+        // Empty frames should not be serialized as they cause unnecessary work on Alfserver side. 
+        // WServ sends empty frames from time to time
+        TInt previousPos = iOffset;
+        // Remember to update KWindowFrameHeaderX, if you add stuff to frame header
+        TInt frameSize = previousPos - iNextFrameOffsetPos - KWindowFrameHeader2 - iFramePadding; 
+        if ( !frameSize ) 
+            {
+            SeekL( iNextFrameOffsetPos - KWindowFrameHeader1 );
+            iReceivingDrawingCommands = EFalse;
+            return EFalse;  
+            }
+        SeekL( iNextFrameOffsetPos );
+        // <HEADER2>
+        TInt chunkId = 0;
+        if ( iChunkInUse)
+            {
+            chunkId = iCacheChunks[iChunkInUse-1].Handle(); 
+            }
+        WriteInt32L( chunkId );
+		WriteInt32L( previousPos );
+		WriteInt8L( EAlfFrameFlags );
+		WriteInt32L( iFlags );
+		
+        WriteInt8L( iFramePadding ); 
+		WriteInt8L( EAlfCommandEndMarker ); 
+		// Padding
+        while ( iFramePadding-- )
+            {
+            WriteInt8L( 0xff );
+			}
+        WriteInt8L( EAlfFrameContainsUnsupportedCommands );
+		WriteInt8L( iNonSupportedCommandsInWindow );
+		if (aSendArray) 
+		    {
+		    WriteArrayHeaderL(e);
+		    }
+		/*iWindowHeaderStruct.iWindowEndOffset = previousPos.Offset();
+        iWindowHeaderStruct.iUnsupportedCommandsInWindow = iNonSupportedCommandsInWindow;
+        iBufStream->WriteL( (TUint8*)&iWindowHeaderStruct, sizeof(TWindowHeaderStruct) );*/
+        // <HEADER2>
+        // return to end of frame
+        SeekL( previousPos );
+        
+        if ( iTemplateOpen )
+            {
+            USER_INVARIANT();
+            }
+        }
+    return ETrue; 
+    }
+//
+// ARRAY IMPLEMENTATION
+//
+
+const TInt KArrayOffsetTemplate = 23456789;
+const TInt KArraySizeTemplate = 23456789;
+
+void CAlfRsSendBuffer::WriteArrayHeaderTemplateL()
+{
+    WriteInt8L( EAlfCommandIndexArrayHeader );
+    WriteInt8L( 0 ); // align
+    WriteInt32L( KArrayOffsetTemplate ); // these will be rewritten in WriteArrayHeader2
+    WriteInt32L( KArraySizeTemplate );   // these will be rewritten in WriteArrayHeader2
+}
+
+
+void CAlfRsSendBuffer::InitTOffsetElemArray(RArray<TOffsetElem> &aOffsets)
+{
+    TInt count = aOffsets.Count();
+    for(TInt i=0;i<count;i++)
+        aOffsets.Remove(0);
+}
+
+CAlfRsSendBuffer::TOffsetElem CAlfRsSendBuffer::WriteIndexArrayL(const RArray<TOffsetElem> &aOffsets)
+{
+    TInt marker = iBufStream->Sink()->TellL( MStreamBuf::EWrite ).Offset();
+    if (iPreviousBlockOffset != marker && iLayersEnabled)
+        {
+        TInt size = marker - iPreviousBlockOffset;
+        TOffsetElem e;
+        e.iOffset = iPreviousBlockOffset - iArrayImplOffset; //iFrameBeginOffset + KWindowFrameHeader1 + KWindowFrameHeader2;
+        e.iSize = size;
+        e.iBoundingRectangle = TRect(0,0,0,0);
+        e.iLayerId = iExtraLayerId++;
+        iOffsetArray.AppendL( e ); 
+        }
+    InsertPaddingL();
+
+   // first command to allow wspainter to skip the index array section
+   WriteInt8L(EAlfCommandIndexArray);
+   WriteInt8L(aOffsets.Count());
+   WriteInt8L(0);
+   WriteInt8L(0);
+   TInt offset = iOffset;
+   TInt count = aOffsets.Count();
+
+   // then the actual index array
+   for(TInt i = 0; i<count; i++)
+	{
+	WriteInt32L( aOffsets[i].iOffset );
+	WriteInt32L( aOffsets[i].iSize );	
+	WriteInt32L( aOffsets[i].iLayerId);
+	WriteL( (TUint8*)&aOffsets[i].iBoundingRectangle, sizeof(TRect) );
+	}
+   TOffsetElem e;
+   e.iOffset = offset  - iArrayImplOffset; //iFrameBeginOffset + KWindowFrameHeader1 + KWindowFrameHeader2;
+   e.iSize = aOffsets.Count()*sizeof(TOffsetElem);
+   return e;
+}
+
+void CAlfRsSendBuffer::WriteArrayHeaderL(const TOffsetElem &aIndexArrayOffset)
+{
+   WriteInt8L( EAlfCommandIndexArrayHeader );
+   WriteInt8L( 0 ); // align
+   WriteInt32L( aIndexArrayOffset.iOffset );
+   WriteInt32L( aIndexArrayOffset.iSize );
+}
+
+void CAlfRsSendBuffer::InitMarker(TInt &aMarker)
+{
+   aMarker = -1;
+   iPreviousBlockOffset = iBufStream->Sink()->TellL( MStreamBuf::EWrite ).Offset();
+   iExtraLayerId = 667;
+   iLayersEnabled = EFalse;
+}
+void CAlfRsSendBuffer::StartMarkerL(TInt &aMarker, TRect &aRectangle, TInt &aLayer, TRect aBoundingRectangle, TInt aLayerId)
+{
+   ASSERT(aMarker == -1);
+   aMarker = iBufStream->Sink()->TellL( MStreamBuf::EWrite ).Offset();
+   if (iPreviousBlockOffset != aMarker)
+       {
+       TInt size = aMarker - iPreviousBlockOffset;
+       TOffsetElem e;
+       e.iOffset = iPreviousBlockOffset - iArrayImplOffset; //iFrameBeginOffset + KWindowFrameHeader1 + KWindowFrameHeader2;
+       e.iSize = size;
+       e.iBoundingRectangle = TRect(0,0,0,0);
+       e.iLayerId = iExtraLayerId++;
+       iOffsetArray.AppendL( e ); 
+       }
+   
+   //aMarker = iOffset;
+   aRectangle = aBoundingRectangle;
+   aLayer = aLayerId;
+   iLayersEnabled = ETrue;
+}
+void CAlfRsSendBuffer::EndMarkerL(RArray<TOffsetElem> &aOffset, TInt &aMarker, const TRect &aRectangle, TInt aLayerId)
+{
+   //TODO ASSERT(aMarker != -1);
+   if (aMarker==-1) return; 
+   TInt offset = iBufStream->Sink()->TellL( MStreamBuf::EWrite ).Offset();
+
+   TInt size = offset - aMarker;
+   TOffsetElem e;
+   e.iOffset = aMarker - iArrayImplOffset; //iFrameBeginOffset + KWindowFrameHeader1 + KWindowFrameHeader2;
+   e.iSize = size;
+   e.iBoundingRectangle = aRectangle;
+   e.iLayerId = aLayerId;
+   aOffset.AppendL( e ); 
+   aMarker = -1;
+   iPreviousBlockOffset = offset;
+}
+void CAlfRsSendBuffer::StartMarkerL(TRect aBoundingRectangle, TInt aLayerId)
+    {
+    StartMarkerL(iMarker, iBoundingRectangle, iLayerId, aBoundingRectangle, aLayerId);
+    }
+void CAlfRsSendBuffer::EndMarkerL()
+    {
+    EndMarkerL(iOffsetArray, iMarker, iBoundingRectangle, iLayerId);
+    }
+// ---------------------------------------------------------------------------
+// SendL
+// sends data syncronously in one or more packets to the streamer server
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::SendL( TRequestStatus* aStatus )
+	{
+	// dont send to alf, if chunk is not available or nothing was written
+	if (iDisabled || !iChunk.Handle() )
+        {
+        if ( aStatus )
+            {
+            // AlfRenderStage may complete the request, because we wont do anything with the data
+            iParent.EndCallBack( aStatus );
+            }
+        return;
+        }
+
+    WriteInt8L( EAlfCommitBatch );
+	WriteInt8L( iScreenNumber );
+	WriteInt8L( EAlfCommandEndMarker );
+	
+    iState = EWaitingAck;
+    TInt lastWrittenOffset( iOffset );
+    Commit();
+    
+    TIpcArgs args( lastWrittenOffset );
+    // __ALFLOGSTRING1("CAlfRsSendBuffer::SendL, offset %d ( TRequestStatus)"), lastWrittenOffset );
+    if ( iFlushBufferTimer ) 
+        {
+        iFlushBufferTimer->Cancel();
+        }
+    iAlfBridgerClient->SendAsynchronous( EAlfBridgerAsyncronousData, args, iStatus );
+
+    if ( aStatus )  // aStatus is null, if this was event notification and not drawing
+        {
+        iQuedStatus = aStatus;
+        *aStatus = KRequestPending;
+        }
+
+    if ( !IsActive() )
+        {
+        SetActive();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// FlushBuffer
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::FlushBuffer()
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    TBool connected = (iAlfBridgerClient != NULL);
+    if (!connected)
+        {
+        TRAP_IGNORE(connected = ConnectL());
+        }
+    if (!connected)
+        {
+        // Cannot connect
+        return;
+        }
+    TIpcArgs args( 0 );
+    TInt result = iAlfBridgerClient->SendBlind( EAlfBridgerBlindSend, args  );
+    if ( result != KErrNone && result != KErrServerBusy)
+    	{
+    	__ALFLOGSTRING1("CAlfRsSendBuffer::FlushBuffer, err %d", result );
+    	// This means that AlfDecoderServer has died and is not coming back. 
+    	// There is no point of continuing with non updating UI.
+   		USER_INVARIANT();
+    	}
+    if ( iFlushBufferTimer ) 
+    	{
+    	iFlushBufferTimer->Cancel();
+    	}
+
+	// during boot time, server is known to answer with this. Just try again little later.
+	if ( result == KErrServerBusy)
+		{
+		CommitL();
+		}
+    }
+
+// ---------------------------------------------------------------------------
+// CommitL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::CommitL( )
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    if ( iBooting )
+        {
+        return;
+        }
+    Commit();
+    // RDebug::Print(_L("CAlfRsSendBuffer::CommitL - %d %d %d "), iChunkHeader, iChunkHeader->iCommittedWriteOffset, iOffset );
+      if ( !iFlushBufferTimer )
+        {
+        iFlushBufferTimer = CPeriodic::NewL( EPriorityNormal );
+        iFlushBufferTimer->Start( 5000, 10 * 1000000 , TCallBack( doFlushBuffer, this ));
+        }
+    if ( !iFlushBufferTimer->IsActive() )
+        {
+        //__ALFLOGSTRING("CAlfRsSendBuffer::CommitL, activating timer");
+        iFlushBufferTimer->After( 5000 );
+        }
+    else
+    	{
+    	//__ALFLOGSTRING("CAlfRsSendBuffer::CommitL, timer already active ");
+    	}
+    }
+
+// ---------------------------------------------------------------------------
+// SendAsyncCmd
+// Send asynchronous command
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::SendAsyncCmd(TInt aCmd, TDes8& aBuf, TRequestStatus& aStatus)
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+   iAlfBridgerClient->SendAsynchronous(aCmd, TIpcArgs(&aBuf), aStatus);
+    }
+
+// ---------------------------------------------------------------------------
+// OpenPrimaryChunkForWritingL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::OpenPrimaryChunkForWritingL()
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    iChunkHeader = reinterpret_cast<TChunkHeader*>(iChunk.Base());
+    if ( iChunkHeader->iMemWriteStream )
+        {
+#ifdef _OLD_STREAM        
+        iBufStream->Close();
+        delete iBufStream;
+        iBufStream=NULL;
+        iBufStream = new(ELeave)RMemWriteStream;
+        // iBufStream = iChunkHeader->iMemWriteStream;
+        iBufStream->Open( iChunk.Base() + sizeof( TChunkHeader), iPrimaryChunkMaxSize );
+#else
+        delete iStreamPtr;
+        iStreamPtr = new(ELeave)TPtr8( (TUint8*)(iChunk.Base() + sizeof( TChunkHeader)), iPrimaryChunkMaxSize - sizeof( TChunkHeader));
+        iChunkHeader->iMemWriteStream = (RMemWriteStream*)1;
+#endif
+        SeekL( iOffset );
+        iChunkInUse = 0;
+        }
+    else
+        {
+#ifdef _OLD_STREAM
+        iBufStream->Open( iChunk.Base() + sizeof( TChunkHeader), iPrimaryChunkMaxSize );
+        iChunkHeader->iMemWriteStream = iBufStream;
+#else
+        iStreamPtr = new(ELeave)TPtr8( (TUint8*)(iChunk.Base() + sizeof( TChunkHeader)), iPrimaryChunkMaxSize - sizeof( TChunkHeader) );
+        iChunkHeader->iMemWriteStream = (RMemWriteStream*)1;
+#endif        
+        SeekL(0);
+        iChunkHeader->iMemWriteStreamUsers++;
+        }
+    WriteInt8L( EAlfCommandEndMarker );
+    Commit();
+    
+    }
+
+// ---------------------------------------------------------------------------
+// Commit
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::Commit()
+    {
+    iChunkHeader->iCommittedWriteOffset = iOffset;
+    // RDebug::Print(_L("CAlfRsSendBuffer::Commit - %d"), iChunkHeader->iCommittedWriteOffset );
+    }
+
+// ---------------------------------------------------------------------------
+// PrepareBufferL
+// Sets up the stream
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::PrepareBufferL()
+	{
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+	// is alfstreamerserver running?
+	if ( !ConnectL() )
+        {
+        return;
+        }
+	iBeginTime.HomeTime();
+	 
+	// alfstreamerserver is now running, but do we already have chunk for serialization
+	if ( iChunk.Handle() == 0 )
+	    {// Note, ConnectL() == ETrue and iChunk.Handle() == 0  is true ONLY ONCE in runtime.  
+
+	    // write jump to the primary chunk. This chunk jump gets special treatment in RunL. Look for iBooting variable.
+	    JumpToAnotherChunkL( 0, iPrimaryChunkMaxSize ); // 2nd parameter is ignored on alfside, because it knows the primary chunksize
+	    Commit();
+#ifdef _OLD_STREAM	    
+	    iBufStream->Close();
+#endif
+	    // Request chunk from server: handle and lenght of chunk come as response
+	    TPckg<TInt> pkgLength(  iUsedChunkMaxSize );
+	    TIpcArgs args( &pkgLength, iScreenNumber );
+	    TInt handle;
+	    handle = iAlfBridgerClient->SendSynch( EAlfBridgerRequestDataBlock, args);
+	    iPrimaryChunkMaxSize = iUsedChunkMaxSize;
+	    iChunk.SetReturnedHandle( handle );
+
+	    if ( iChunk.Handle() > 0 )
+	        {
+	        OpenPrimaryChunkForWritingL();
+	        }
+	    else
+	        {
+	        // Chunk was not received from server. We cannot continue
+	        USER_INVARIANT();
+	        }
+	    }
+	// The first boot cache chunk is sent here. 
+	if ( iBooting && iCacheChunks.Count() && iChunkInUse )
+	    {
+	    if ( iChunkHeader->iMemWriteStreamUsers > 1 ) 
+            {
+            // make "sure", that there will be space for all the cached data
+            CommitL();
+            }
+
+	    while ( iChunkInUse )
+             {
+             iChunkInUse--;
+             TInt size( KCacheChunkMinSize );
+             TIpcArgs args( size, iCacheChunks[iChunkInUse], iChunkInUse == 0 /* open chunk for reading */);
+             iAlfBridgerClient->SendSynch( EAlfBridgerSendChunk, args);
+             }	    
+        }
+	iFrameBeginOffset = iOffset; // iBufStream->Sink()->TellL( MStreamBuf::EWrite);
+	}
+
+// ---------------------------------------------------------------------------
+// FrameContainsDataL
+// ---------------------------------------------------------------------------
+//
+TBool CAlfRsSendBuffer::FrameContainsDataL()
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return EFalse; // Must return false as no draw commands are allowed 
+        }
+		
+#ifdef _OLD_STREAM    
+    if ( iBufStream->Sink() )
+#endif        
+        {
+#ifdef _OLD_STREAM        
+        iBufStream->CommitL();
+#endif        
+        return ( iFrameBeginOffset != iOffset );
+        }
+#ifdef _OLD_STREAM
+    else
+        {
+        return EFalse;
+        }
+#endif    
+    }
+
+// ---------------------------------------------------------------------------
+// JumpToAnotherChunkL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::JumpToAnotherChunkL( TInt32 aChunkId, TInt aChunkSize )
+    {
+    WriteInt8L( EAlfJumpToAnotherChunk );
+	WriteInt8L( 0 ); // screen number, not used.
+    WriteInt32L( aChunkId );
+	WriteInt32L( aChunkSize );
+	WriteInt8L( EAlfCommandEndMarker );
+	Commit();
+    }
+
+// ---------------------------------------------------------------------------
+// DoCreateTemporaryChunkL
+//
+// If wserv pushes more data in frame that we can handle,  separate one time use 
+// "temporary" chunks are taken into use. 
+//  1. Big enough chunk to contain atleast the command + minimum chunk size is created
+//  2. Jump of from the current chunk to the temporary chunk is created
+//  3. new chunk is taken as the active chunk
+//  4. chunk is rewinded
+//  5. commands can be serialized as before
+//
+//  Same starts from the step 1, if temporary chunk turns out to be not big enough.
+//
+//  Chunks are destroyed in RunL, when asyncronous (frame processed) complete is
+//  received. In RunL, (see RunL for the code)
+//  
+//  The following things are serialized to the active (the last temporary chunk created)
+//  1. destroy command for each existing temporary chunk is created
+//  2. if not in first boot, jump to the primary chunk is created.
+//  3. handles to the temporary chunks on this side are closed 
+//     and chunks removed.
+//
+//  After AlfHierarchy has read the jump command, serialization will be in the normal mode.
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::DoCreateTemporaryChunkL( TInt aMinimumRequiredSize )
+    {
+    __ALFLOGSTRING2("CAlfRsSendBuffer::DoWaitWrapperL iReceivingDrawing commands %d chunk in use: %d", iReceivingDrawingCommands, iChunkInUse );
+    // Optimize bitblits backtracks in a _single chunk_, so changing or wrapping a chunk is 
+    // a very bad idea. Lets skip the optimization, if this rare occation happens.
+    ResetPatternSearch(); 
+            
+    if ( iReceivingDrawingCommands )
+         {
+         // if window drawing is active, the window commands are split. 
+         InsertPaddingL(); // padding is required, that the combined parts on the other side have correct alignment for descriptors
+         WriteFollowingFrameOffsetL(EFalse);
+         WriteInt8L( EAlfPacketNotReady );
+		 WriteInt8L( EAlfCommandEndMarker );
+		 }
+    else
+        {
+        __ALFLOGSTRING("CAlfRsSendBuffer::DoCreateTemporaryChunkL, creating during hierarchy commands");
+        }
+    
+    // rest of this frame will be serilized to cache chunk
+    CommitL();
+    if ( ConnectL() )
+        {
+        FlushBuffer();
+	    }
+    TInt chunkSize = aMinimumRequiredSize;
+    if ( CreateTemporaryChunkL( chunkSize ) == KErrNone )
+        {
+        if ( ConnectL() )
+           {
+           TInt size( chunkSize );
+           TIpcArgs args( size, iCacheChunks[iChunkInUse], EFalse /* open chunk for reading */ );
+           iAlfBridgerClient->SendSynch( EAlfBridgerSendChunk, args); // alf server must open the chunk before it can be read. reading is asyncronous
+           }
+        JumpToAnotherChunkL( iCacheChunks[iChunkInUse].Handle(), chunkSize );
+        OpenRewindChunkL( chunkSize );
+        WriteInt8L( EAlfCommandEndMarker ); // This is must command after jumping to another chunk.
+		CommitL();
+
+        if ( iReceivingDrawingCommands )
+            {
+            WriteWindowIdentifierL();
+            }
+        }
+    else
+        {
+        // TODO: We could not reserve memory. The only option will be to ignore this frame.
+        // 1. rollback to the beginning of the frame
+        // 2. skip all sequential drawing commands to this frame.
+        // problem: what if OOM during hierarchy tree commmands
+        }
+ }
+
+// ---------------------------------------------------------------------------
+// ReserveSpaceL
+//
+// Check, if buffer has enough space for this command.
+// If we encounter the end of buffer, then do a wrap around if possible.
+// If wrap is not possible, create a temporary space for command
+// ---------------------------------------------------------------------------
+//
+TBool CAlfRsSendBuffer::ReserveSpaceL( TInt aCommandSize )
+    {
+    // TInt minumumHeaderSize = iCacheChunks.Count() > 0 ? KFrameHeaderSizeWhenCacheChunks : KFrameHeaderSize;
+    TInt minumumHeaderSize = KFrameHeaderSize;
+    if ( iCacheChunks.Count() > 0 )
+        {
+        // if cache chunks still exists, then wserv is trying to push commands out of redrawstart/end loop and we hope that 
+        minumumHeaderSize = KFrameHeaderSizeWhenCacheChunks; 
+        }
+    TInt writeOffset = iOffset;
+    TInt commandTailOffset = writeOffset + aCommandSize + KFrameHeaderSize;
+    TInt readOffset = iChunkHeader->iReadOffset;
+    TInt bytesFree(0);
+    if ( readOffset > writeOffset)
+        {//                       V
+        // |RRRRRRRRR|W---------RRRRRRRRRRRR | 
+       // ASSERT( iWrappingFrame );
+       bytesFree = readOffset - writeOffset;
+       }
+    if ( readOffset < writeOffset )
+       {
+       //       V              W
+       // | ----RRRRRRRRRRRRRRRW------ |
+       iWrappingFrame = EFalse;
+       bytesFree = iUsedChunkMaxSize - writeOffset; // there might be more free and the beginning of the chunk, but this is not relevant. The entire command needs to fit as one piece
+       }
+    if ( readOffset == writeOffset )
+       {
+       if ( iWrappingFrame )
+           {
+           //                V
+           // | RRRRRRRRRRRRRWRRRRRRRRRRRRR |
+           bytesFree = 0;
+           }
+       else
+           {
+           //  V
+           // | --------------------------- |
+           // the entire chunk is free
+           bytesFree = iUsedChunkMaxSize;
+           }
+       }
+    // are we trying to overwrite unprocessed data
+    if ( bytesFree < aCommandSize + minumumHeaderSize && commandTailOffset <= iUsedChunkMaxSize 
+            || ( bytesFree < aCommandSize + minumumHeaderSize && iWrappingFrame ))
+        {
+        // __ALFLOGSTRING("CAlfRsSendBuffer::CanWriteToBufferL -> DoCreateTemporaryChunkL");
+        DoCreateTemporaryChunkL( aCommandSize );
+        }
+    else if ( commandTailOffset > iUsedChunkMaxSize )
+        {
+        if ( !iChunkInUse )
+            {
+            DoWrapL( aCommandSize,  aCommandSize > readOffset );
+            }
+        else
+            {
+            // we are already using temporary chunks and those cannot be wrapped. The only option is to create 
+            // yet another temporary chunk.
+            DoCreateTemporaryChunkL( aCommandSize );
+            }
+        }
+    return ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// DoWrapL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::DoWrapL( TInt aCommandSize, TBool aCreateTempororaryChunk )
+    {
+    if ( iCacheChunks.Count() )
+        {
+        DoCreateTemporaryChunkL( aCommandSize );
+        }
+    __ALFLOGSTRING2("CanWriteToBufferL Read/Write %d/%d", iChunkHeader->iReadOffset, iChunkHeader->iWriteOffset);
+
+    if ( aCreateTempororaryChunk )
+        {
+        __ALFLOGSTRING("CAlfRsSendBuffer::DoWrapL -> DoCreateTemporaryChunkL");
+        DoCreateTemporaryChunkL( aCommandSize );
+        return;
+        }
+    else
+        {
+        if ( iReceivingDrawingCommands )
+            {
+            InsertPaddingL();
+            WriteFollowingFrameOffsetL(EFalse);
+            WriteInt8L( EAlfPacketNotReady );
+			WriteInt8L( EAlfCommandEndMarker );
+			}
+        else
+            {
+            __ALFLOGSTRING("CAlfRsSendBuffer::CanWriteToBufferL, non drawing command");
+            }
+        }
+    WriteInt8L( EAlfWrap );
+	WriteInt8L( iScreenNumber );
+	WriteInt8L( EAlfCommandEndMarker );
+	// Optimize bitblits backtracks in a _single chunk_, so changing or wrapping a chunk is 
+    // a very bad idea. Lets skip the optimization, if this rare occation happens.
+    ResetPatternSearch(); 
+
+    iWrappingFrame = ETrue;
+    __ALFLOGSTRING1("CAlfRsSendBuffer::CanWriteToBufferL, Wrap at offset %d", iChunkHeader->iWriteOffset);
+    SeekL(0);
+    WriteInt8L( EAlfCommandEndMarker );
+	
+    if ( iReceivingDrawingCommands )
+        {
+        WriteWindowIdentifierL();
+        }
+    else
+        {
+        __ALFLOGSTRING("CAlfRsSendBuffer::CanWriteToBufferL Wrapping while not receiving drawing commands");
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SetSupportedCommand
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::SetSupportedCommand( TInt aIndex, TInt8 aSupport )
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    iNonSupportedCommands[aIndex] = aSupport;
+    }
+
+// ---------------------------------------------------------------------------
+// InitCommandL
+// Takes care that data fits to the stream
+// ---------------------------------------------------------------------------
+//
+TBool CAlfRsSendBuffer::InitCommandL( const TUint8& aCommand, TInt aCommandSize  )
+    {
+	// THIS IS DIRTY HACK UNTIL WSERV STOPS DOING DRAWING OUTSIDE WINDOW
+	// RE-EVALUATE FOR WK14 RELEASE
+    if ( ( aCommand >= EAlfDrawCommandsStart && aCommand <= EAlfDrawCommandsEnd && !iReceivingDrawingCommands ) && 
+            ( aCommand != EAlfPacketReady && aCommand != EAlfPacketNotReady ))
+        {
+#ifdef _DEBUG
+        RDebug::Print(_L("CAlfRsSendBuffer::InitCommandL - Drawing outside window, Cmd: %d"), aCommand );
+#endif
+        return EFalse;
+		}
+	// END OF DIRTY HACK    
+    if ( iReceivingDrawingCommands )
+        {
+        aCommandSize += sizeof(EAlfCommandEndMarker);
+        }
+    iNonSupportedCommandsInWindow |= iNonSupportedCommands[aCommand] & KAllRenderersMask;
+    if ( iNonSupportedCommands[aCommand] & KPossiblePerformanceProblemInWindow ) // indicates possible performance problem if frame has many of this of commands
+        {
+        iPerformanceIssueCommandCount++;
+        }
+     
+    // Check if chunk has been opened. Must for streaming.
+    if ( 
+#ifdef _OLD_STREAM
+            !iBufStream && 
+#else
+            !iChunkHeader  &&
+#endif            
+            iCacheChunks.Count() == 0 )
+        {
+        TInt chunkSize = aCommandSize;
+        CreateTemporaryChunkL( chunkSize );
+        OpenRewindChunkL( chunkSize );
+        }
+
+
+    // EAlfPacketReady is the last command in the window, and it is guaranteened to fit without checking. Checking would possible slice the command stream unnecessary.
+    if ( aCommand != EAlfPacketReady )
+        {
+        // check for running out of space in the chunk
+        if ( !ReserveSpaceL( aCommandSize + 2*sizeof(TUint8)) )
+            {
+            return EFalse;
+            }
+        }
+    // write command to a chunk. There will be space.
+    // __ALFLOGSTRING3("Command %d, Offset: %d Screen: %d Command: %d",  aCommand, iScreenNumber, aCommand );
+    WriteInt8L( aCommand );
+	iPreviousCommand = aCommand;
+    if ( aCommand < EAlfDrawCommandsStart || aCommand > EAlfDrawCommandsEnd )
+    	{
+    	WriteInt8L( iScreenNumber );
+		}
+    else
+        {
+        // Uncomment following line to do chaff bitblit optimization
+#ifndef __NVG // TODO: Implement the 9-piece drawing for NVG
+        // DoPatternSearch( aCommand, aCommandSize );
+#endif
+        }
+    return ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// CreateTemporaryChunkL
+// ---------------------------------------------------------------------------
+//
+TBool CAlfRsSendBuffer::CreateTemporaryChunkL( TInt& aSize )
+    {
+    aSize+= KCacheChunkMinSize;
+    iCacheChunks.Append( RChunk() );
+    TInt result = iCacheChunks[iChunkInUse].CreateDisconnectedGlobal( KNullDesC, 0, aSize, aSize );
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// OpenRewindChunkL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::OpenRewindChunkL( TInt aSize )
+    {
+#ifdef _OLD_STREAM    
+    if ( iBufStream && iChunkInUse) 
+        {
+        iBufStream->Close();
+        }
+    iBufStream = new(ELeave)RMemWriteStream;
+    iBufStream->Open( iCacheChunks[iChunkInUse].Base() + sizeof( TChunkHeader), aSize );
+#else
+    iStreamPtr = new(ELeave)TPtr8( (TUint8*)(iCacheChunks[iChunkInUse].Base() + sizeof( TChunkHeader)), aSize - sizeof( TChunkHeader));
+    
+#endif
+    iChunkHeader = reinterpret_cast<TChunkHeader*>(iCacheChunks[iChunkInUse].Base());
+    SeekL(0);
+    memset( iChunkHeader, 0, sizeof( TChunkHeader ) );
+    iUsedChunkMaxSize = aSize -  sizeof( TChunkHeader);
+    iChunkInUse++; 
+    }
+
+// ---------------------------------------------------------------------------
+// DoPatternSearch
+//
+// Pattern search seeks for predefined sequence of commands. In TSearchPatternBitBlit case the seqence is 
+// EAlfSetBrushStyle -> EAlfSetBrushStyle -> EAlfSetClippingRegion -> EAlfBitBltMasked -> EAlfResetClippingRegion .
+//
+// When possible pattern is found, the start offset of the pattern is saved. If pattern is
+// noticed 8 or more times in sequence, the pattern is complete. Functions seeks back to the
+// start offset and serializes cached data of the pattern. Some data can be dropped as it has 
+// no significance.
+// ---------------------------------------------------------------------------
+//
+#ifdef _ALF_PRINT_WS_COMMANDS_
+void CAlfRsSendBuffer::DoPatternSearch( const TUint8& aCommand, TInt aSize )
+#else
+void CAlfRsSendBuffer::DoPatternSearch( const TUint8& aCommand, TInt )
+#endif
+    {
+    TInt sizeOfPattern = sizeof(TSearchPatternBitBlit) / (3 * sizeof(TInt32)); // rows = size / width
+    if ( ( TSearchPatternBitBlit[iPatternSearchState][0] == aCommand  
+    		|| ( TSearchPatternBitBlit[iPatternSearchState][2] != KErrNotFound && TSearchPatternBitBlit[iPatternSearchState][2] == aCommand ))
+    		&& TSearchPatternBitBlit[iPatternSearchState][1] == iPatternSearchState )
+    	{
+    	TInt tmp = iPatternSearchState;
+    	iPatternSearchState = TSearchPatternBitBlit[iPatternSearchState+1][1];
+#ifdef _ALF_PRINT_WS_COMMANDS_
+    	TPatternCommand command( aCommand, aSize );
+    	iPatternCommands.Append( command );
+#endif    	
+    	if ( tmp == 0 && iPatterSearchSequentialBlits == 0 )
+    		{
+    		// This is the beginning of the sequence. Save position (offset minus size of the current command) 
+    		// the for later use.
+    		iPatternCacheBeginPosition = iOffset;
+#ifdef _OLD_STREAM    		
+    		iPatternCacheBeginPosition = TStreamPos( iPatternCacheBeginPosition - sizeof(TUint8) ); // the command
+#else
+    		iPatternCacheBeginPosition = iPatternCacheBeginPosition - sizeof(TUint8) ; // the command
+#endif
+    		iSearchPatternClipRegion.Clear();
+#ifdef _ALF_PRINT_WS_COMMANDS_
+    		iPatternCommands.Reset();
+#endif    		
+    		}
+    	else if ( tmp == sizeOfPattern - 1)
+    		{
+    		// Start from the beginning the next sequential pattern
+    		iPatternSearchState = TSearchPatternBitBlit[0][1]; 
+    		iPatterSearchSequentialBlits++;
+    		}
+    	}
+    else
+    	{
+    	TRAP_IGNORE(FinalizePatternL( aCommand ));
+    	}
+    }
+
+// ---------------------------------------------------------------------------
+// FinalizePatternL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::FinalizePatternL( const TUint8& aCommand )
+    {
+    // We are looking 8 or more connected chaff pieces 
+    if ( iPatterSearchSequentialBlits >= 9 )
+        {
+        iSearchPatternClipRegion.Tidy(); // will return only one region, if pieces are connected 
+        iSearchPatternBlitRect.Tidy();
+        
+        
+        if ( iSearchPatternClipRegion.Count() == 1 && iSearchPatternBlitRect.Count() == 1)
+            {
+#ifdef _OLD_STREAM
+            SeekL( iPatternCacheBeginPosition.Offset() );
+#else
+            SeekL( iPatternCacheBeginPosition );
+#endif
+            WriteInt8L( EAlfCombinedBitBlitMasked );
+#ifdef _ALF_PRINT_WS_COMMANDS_
+            TInt size = iPatterSearchSequentialBlits * sizeof(TBlitStruct) + 2 * sizeof(TRect);
+            iCommandDebugger->SetDescriptionAndSize( EAlfCombinedBitBlitMasked, size, R_ALF_COMMAND_DESCRIPTION_ARRAY );
+            iCommandDebugger->Print();
+            while ( iPatternCommands.Count())
+                {
+                iCommandDebugger->AdjustCommand( iPatternCommands[0].iCommand,  (-1) * iPatternCommands[0].iSize );
+                iPatternCommands.Remove(0);
+                }
+#endif
+            // item count
+            WriteInt8L( iPatterSearchSequentialBlits );
+            // Clipping region for all the pieces. 
+            // This contains the clippingregion (set by EAlfSetClippingRegion) and rect for all the pieces 
+            // (from EAlfBitBlit, EAlfBitBltRect, EAlfBitBlitMasked )
+            TRect clipRect = iSearchPatternClipRegion.BoundingRect();
+            TRect clipBlitRect = iSearchPatternBlitRect.BoundingRect();
+
+            WriteL( (TUint8*)&clipRect,     sizeof(TRect));
+            WriteL( (TUint8*)&clipBlitRect, sizeof(TRect));
+                        
+            // Items
+            while( iPatterSearchSequentialBlits-- )
+                {
+                TPoint point = iPatternHandleCache[iPatterSearchSequentialBlits].iTl;
+                WriteL( (TUint8*)&iPatternHandleCache[iPatterSearchSequentialBlits], sizeof(TBlitStruct)  );
+                }
+#ifndef _OPTIMIZE_WS_COMMANDS_ADVANCED_
+            WriteInt8L( EAlfSetPenStyle );
+            WriteInt32L( iPenStyle );
+#endif                        
+            // Write again the current command (after the pattern sequence), because we just overwrote it
+            WriteInt8L( aCommand );
+            }
+        }
+    ResetPatternSearch();
+    }
+
+// ---------------------------------------------------------------------------
+// ResetPatternSearch
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::ResetPatternSearch()
+    {
+    iPatternSearchState = ESeekSetClippingRegion;
+    iPatterSearchSequentialBlits = 0;
+    iSearchPatternClipRegion.Clear();
+    iSearchPatternBlitRect.Clear();
+    iPatternHandleCache.Reset();
+#ifdef _ALF_PRINT_WS_COMMANDS_
+    iPatternCommands.Reset();
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// AppendPatternSearchCache
+// saves masked bitblits to the cache
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::AppendPatternSearchCache( const CFbsBitmap& aSourceBitmap, const CFbsBitmap* aMaskBitmap, const TRect& aSourceRect, const TPoint& aDestPos, TBool aInvertMask )
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    TSize size1 = aSourceRect.Size();
+    TSize size2 = aSourceBitmap.SizeInPixels();
+    if ( aInvertMask == 1 )
+        {
+        TInt handle = aMaskBitmap ?  aMaskBitmap->Handle() : 0;
+        iPatternHandleCache.Append( TBlitStruct( aSourceBitmap.Handle(),handle, aDestPos ) ); 
+        TRect rect( TPoint(0,0), aSourceRect.Size() );
+        rect.Move( aDestPos );
+        iSearchPatternBlitRect.AddRect( rect );
+        }
+    else
+        {
+        ResetPatternSearch();
+        }
+    }    
+
+
+// ---------------------------------------------------------------------------
+// InsertPaddingL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::InsertPaddingL()
+    {
+    // padding is required for the 1st part of the package, because the 2nd package 
+    // is attached straight to it and it MUST start at offset divisible by 4. Otherwise 
+    // possible strings in the second package will not be correctly alligned.
+    TInt offset = iOffset; 
+    TInt padding = offset % KDivisibleByX;
+    if ( padding > 0)
+        {
+        padding = KDivisibleByX - ( offset + sizeof(TUint8) * 2 ) % KDivisibleByX; // 2 = sizeof( EAlfPacketPadding + padding )
+        WriteInt8L( EAlfPacketPadding );
+		WriteInt8L( padding );
+		while( padding--)
+            {
+            WriteInt8L( 0 );
+			}
+        if ( !iReceivingDrawingCommands )
+            {
+            WriteInt8L( EAlfCommandEndMarker );
+			}
+        }
+#ifdef _DEBUG
+    ASSERT( ( offset = iOffset ) % KDivisibleByX == 0);
+#endif    
+    }
+
+// ---------------------------------------------------------------------------
+// SetFlag
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::SetFlag( TAlfSendBufferFrameFlags aFlag )
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    iFlags |= aFlag;
+    }
+
+// ---------------------------------------------------------------------------
+// EndFrameL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::EndFrameL()
+    {
+    if (iDisabled) // return if this send buffer is not in use
+        {
+        return;
+        }
+    
+    TUint8 command(EAlfPacketReady);
+    if ( iFlags & EAlfTransparentContent && !(iFlags & EAlfTransparentContentFlush ) )
+        {
+        InsertPaddingL();
+        }
+
+    if ( WriteFollowingFrameOffsetL() )
+        {
+        WriteCommandL( command );  
+        }
+#ifdef ALF_DEBUG_TRACK_DRAWING
+    TInt trackThisNode = 0;
+    if ( trackThisNode )
+        {
+        WriteIntsL( EAlfDebugTrackNode, 2, (TInt32)&iWindowId, 1 );
+        }
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// SeekL
+// ---------------------------------------------------------------------------
+//
+void CAlfRsSendBuffer::SeekL( const TInt aOffset )
+    {
+#ifdef _OLD_STREAM    
+    iBufStream->Sink()->SeekL( MStreamBuf::EWrite, TStreamPos(aOffset));
+#endif    
+    iOffset = aOffset;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/BWINS/alfclientu.DEF	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1108 @@
+EXPORTS
+	?NewL@CAlfEnv@@SAPAV1@VTVersion@@@Z @ 1 NONAME ; class CAlfEnv * CAlfEnv::NewL(class TVersion)
+	?NewLC@CAlfEnv@@SAPAV1@VTVersion@@@Z @ 2 NONAME ; class CAlfEnv * CAlfEnv::NewLC(class TVersion)
+	?Version@CAlfEnv@@QBE?AVTVersion@@XZ @ 3 NONAME ; class TVersion CAlfEnv::Version(void) const
+	??0CAlfControl@@QAE@XZ @ 4 NONAME ; CAlfControl::CAlfControl(void)
+	??0CAlfCurvePathLayout@@QAE@XZ @ 5 NONAME ; CAlfCurvePathLayout::CAlfCurvePathLayout(void)
+	??0CAlfDeckLayout@@QAE@XZ @ 6 NONAME ; CAlfDeckLayout::CAlfDeckLayout(void)
+	??0CAlfFlowLayout@@QAE@XZ @ 7 NONAME ; CAlfFlowLayout::CAlfFlowLayout(void)
+	??0CAlfGridLayout@@QAE@XZ @ 8 NONAME ; CAlfGridLayout::CAlfGridLayout(void)
+	??0CAlfImageLoaderUtil@@QAE@XZ @ 9 NONAME ; CAlfImageLoaderUtil::CAlfImageLoaderUtil(void)
+	??0CAlfImageVisual@@QAE@XZ @ 10 NONAME ; CAlfImageVisual::CAlfImageVisual(void)
+	??0CAlfLCTAnchorLayout@@QAE@XZ @ 11 NONAME ; CAlfLCTAnchorLayout::CAlfLCTAnchorLayout(void)
+	??0CAlfLCTGridLayout@@QAE@XZ @ 12 NONAME ; CAlfLCTGridLayout::CAlfLCTGridLayout(void)
+	??0CAlfLCTTextVisual@@QAE@XZ @ 13 NONAME ; CAlfLCTTextVisual::CAlfLCTTextVisual(void)
+	??0CAlfLayout@@QAE@XZ @ 14 NONAME ; CAlfLayout::CAlfLayout(void)
+	??0CAlfLineVisual@@QAE@XZ @ 15 NONAME ; CAlfLineVisual::CAlfLineVisual(void)
+	??0CAlfMeshVisual@@QAE@XZ @ 16 NONAME ; CAlfMeshVisual::CAlfMeshVisual(void)
+	??0CAlfPropertyOwner@@QAE@XZ @ 17 NONAME ; CAlfPropertyOwner::CAlfPropertyOwner(void)
+	??0CAlfTextVisual@@QAE@XZ @ 18 NONAME ; CAlfTextVisual::CAlfTextVisual(void)
+	??0CAlfViewportLayout@@QAE@XZ @ 19 NONAME ; CAlfViewportLayout::CAlfViewportLayout(void)
+	??0CAlfVisual@@QAE@XZ @ 20 NONAME ; CAlfVisual::CAlfVisual(void)
+	??0RAlfClientBase@@QAE@H@Z @ 21 NONAME ; RAlfClientBase::RAlfClientBase(int)
+	??0TAlfActionCommand@@QAE@H@Z @ 22 NONAME ; TAlfActionCommand::TAlfActionCommand(int)
+	??0TAlfBoxMetric@@QAE@ABUTAlfMetric@@000@Z @ 23 NONAME ; TAlfBoxMetric::TAlfBoxMetric(struct TAlfMetric const &, struct TAlfMetric const &, struct TAlfMetric const &, struct TAlfMetric const &)
+	??0TAlfBoxMetric@@QAE@ABUTAlfMetric@@@Z @ 24 NONAME ; TAlfBoxMetric::TAlfBoxMetric(struct TAlfMetric const &)
+	??0TAlfBoxMetric@@QAE@ABUTAlfXYMetric@@@Z @ 25 NONAME ; TAlfBoxMetric::TAlfBoxMetric(struct TAlfXYMetric const &)
+	??0TAlfBoxMetric@@QAE@XZ @ 26 NONAME ; TAlfBoxMetric::TAlfBoxMetric(void)
+	??0TAlfCommand@@IAE@W4TAlfCommandType@@@Z @ 27 NONAME ; TAlfCommand::TAlfCommand(enum TAlfCommandType)
+	??0TAlfControlCommand@@QAE@AAVCAlfControl@@W4TAlfOp@@@Z @ 28 NONAME ; TAlfControlCommand::TAlfControlCommand(class CAlfControl &, enum TAlfOp)
+	??0TAlfCustomEventCommand@@QAE@HPAVMAlfEventHandler@@H@Z @ 29 NONAME ; TAlfCustomEventCommand::TAlfCustomEventCommand(int, class MAlfEventHandler *, int)
+	??0TAlfEvent@@QAE@AAVCAlfDisplay@@ABUTKeyEvent@@W4TEventCode@@@Z @ 30 NONAME ; TAlfEvent::TAlfEvent(class CAlfDisplay &, struct TKeyEvent const &, enum TEventCode)
+	??0TAlfEvent@@QAE@AAVCAlfDisplay@@ABUTPointerEvent@@@Z @ 31 NONAME ; TAlfEvent::TAlfEvent(class CAlfDisplay &, struct TPointerEvent const &)
+	??0TAlfEvent@@QAE@AAVCAlfDisplay@@ABVTAlfScrollerEvent@@@Z @ 32 NONAME ; TAlfEvent::TAlfEvent(class CAlfDisplay &, class TAlfScrollerEvent const &)
+	??0TAlfEvent@@QAE@H@Z @ 33 NONAME ; TAlfEvent::TAlfEvent(int)
+	??0TAlfEvent@@QAE@HH@Z @ 34 NONAME ; TAlfEvent::TAlfEvent(int, int)
+	??0TAlfGroupCommand@@QAE@AAVCAlfControlGroup@@W4TAlfOp@@PAVCAlfDisplay@@@Z @ 35 NONAME ; TAlfGroupCommand::TAlfGroupCommand(class CAlfControlGroup &, enum TAlfOp, class CAlfDisplay *)
+	??0TAlfImage@@QAE@ABVCAlfTexture@@MMMM@Z @ 36 NONAME ; TAlfImage::TAlfImage(class CAlfTexture const &, float, float, float, float)
+	??0TAlfImage@@QAE@VTAknsItemID@@VTSize@@W4TScaleMode@@PBVTDesC16@@HHMMMMW4TAlfTextureFlags@@HPAVCAlfTextureManager@@@Z @ 37 NONAME ; TAlfImage::TAlfImage(class TAknsItemID, class TSize, enum TScaleMode, class TDesC16 const *, int, int, float, float, float, float, enum TAlfTextureFlags, int, class CAlfTextureManager *)
+	??0TAlfImage@@QAE@VTUid@@W4TAknsAppIconType@@VTSize@@W4TScaleMode@@MMMMW4TAlfTextureFlags@@HPAVCAlfTextureManager@@@Z @ 38 NONAME ; TAlfImage::TAlfImage(class TUid, enum TAknsAppIconType, class TSize, enum TScaleMode, float, float, float, float, enum TAlfTextureFlags, int, class CAlfTextureManager *)
+	??0TAlfImage@@QAE@XZ @ 39 NONAME ; TAlfImage::TAlfImage(void)
+	??0TAlfImageCommand@@QAE@AAVCAlfImageVisual@@ABVTAlfImage@@W4TAlfOp@@@Z @ 40 NONAME ; TAlfImageCommand::TAlfImageCommand(class CAlfImageVisual &, class TAlfImage const &, enum TAlfOp)
+	??0TAlfMarkerCommand@@QAE@H@Z @ 41 NONAME ; TAlfMarkerCommand::TAlfMarkerCommand(int)
+	??0TAlfMetric@@QAE@H@Z @ 42 NONAME ; TAlfMetric::TAlfMetric(int)
+	??0TAlfMetric@@QAE@MHH@Z @ 43 NONAME ; TAlfMetric::TAlfMetric(float, int, int)
+	??0TAlfObjectCommand@@IAE@W4TAlfCommandType@@PAXW4TAlfOp@@@Z @ 44 NONAME ; TAlfObjectCommand::TAlfObjectCommand(enum TAlfCommandType, void *, enum TAlfOp)
+	??0TAlfPointCommand@@QAE@PAXW4TAlfPointCommandTarget@@UTAlfRealPoint@@HW4TParameterTarget@0@@Z @ 45 NONAME ; TAlfPointCommand::TAlfPointCommand(void *, enum TAlfPointCommandTarget, struct TAlfRealPoint, int, enum TAlfPointCommand::TParameterTarget)
+	??0TAlfPointCommand@@QAE@PAXW4TAlfPointCommandTarget@@W4TAlfOp@@@Z @ 46 NONAME ; TAlfPointCommand::TAlfPointCommand(void *, enum TAlfPointCommandTarget, enum TAlfOp)
+	??0TAlfPointCommand@@QAE@PAXW4TAlfPointCommandTarget@@W4TAlfOp@@UTAlfRealPoint@@MW4TParameterTarget@0@@Z @ 47 NONAME ; TAlfPointCommand::TAlfPointCommand(void *, enum TAlfPointCommandTarget, enum TAlfOp, struct TAlfRealPoint, float, enum TAlfPointCommand::TParameterTarget)
+	??0TAlfScrollerEvent@@QAE@W4TCode@0@W4TOrientation@0@H@Z @ 48 NONAME ; TAlfScrollerEvent::TAlfScrollerEvent(enum TAlfScrollerEvent::TCode, enum TAlfScrollerEvent::TOrientation, int)
+	??0TAlfTextCommand@@QAE@AAVCAlfTextVisual@@ABVTDesC16@@W4TAlfOp@@@Z @ 49 NONAME ; TAlfTextCommand::TAlfTextCommand(class CAlfTextVisual &, class TDesC16 const &, enum TAlfOp)
+	??0TAlfTimedPoint@@QAE@MM@Z @ 50 NONAME ; TAlfTimedPoint::TAlfTimedPoint(float, float)
+	??0TAlfTimedPoint@@QAE@MMH@Z @ 51 NONAME ; TAlfTimedPoint::TAlfTimedPoint(float, float, int)
+	??0TAlfTimedPoint@@QAE@XZ @ 52 NONAME ; TAlfTimedPoint::TAlfTimedPoint(void)
+	??0TAlfTimedValue@@QAE@M@Z @ 53 NONAME ; TAlfTimedValue::TAlfTimedValue(float)
+	??0TAlfTimedValue@@QAE@MH@Z @ 54 NONAME ; TAlfTimedValue::TAlfTimedValue(float, int)
+	??0TAlfTimedValue@@QAE@XZ @ 55 NONAME ; TAlfTimedValue::TAlfTimedValue(void)
+	??0TAlfTransformationCommand@@QAE@PAXAAVCAlfTransformation@@W4TAlfOp@@H@Z @ 56 NONAME ; TAlfTransformationCommand::TAlfTransformationCommand(void *, class CAlfTransformation &, enum TAlfOp, int)
+	??0TAlfValueCommand@@QAE@PAXW4TAlfValueCommandTarget@@MH@Z @ 57 NONAME ; TAlfValueCommand::TAlfValueCommand(void *, enum TAlfValueCommandTarget, float, int)
+	??0TAlfValueCommand@@QAE@PAXW4TAlfValueCommandTarget@@W4TAlfOp@@MM@Z @ 58 NONAME ; TAlfValueCommand::TAlfValueCommand(void *, enum TAlfValueCommandTarget, enum TAlfOp, float, float)
+	??0TAlfVisualCommand@@QAE@AAVCAlfVisual@@W4TAlfOp@@HH@Z @ 59 NONAME ; TAlfVisualCommand::TAlfVisualCommand(class CAlfVisual &, enum TAlfOp, int, int)
+	??0TAlfXYMetric@@QAE@ABUTAlfMetric@@0@Z @ 60 NONAME ; TAlfXYMetric::TAlfXYMetric(struct TAlfMetric const &, struct TAlfMetric const &)
+	??0TAlfXYMetric@@QAE@ABUTAlfMetric@@@Z @ 61 NONAME ; TAlfXYMetric::TAlfXYMetric(struct TAlfMetric const &)
+	??0TAlfXYMetric@@QAE@XZ @ 62 NONAME ; TAlfXYMetric::TAlfXYMetric(void)
+	??1CAlfAnchorLayout@@UAE@XZ @ 63 NONAME ; CAlfAnchorLayout::~CAlfAnchorLayout(void)
+	??1CAlfAverageMappingFunction@@UAE@XZ @ 64 NONAME ; CAlfAverageMappingFunction::~CAlfAverageMappingFunction(void)
+	??1CAlfBrush@@UAE@XZ @ 65 NONAME ; CAlfBrush::~CAlfBrush(void)
+	??1CAlfConstantMappingFunction@@UAE@XZ @ 66 NONAME ; CAlfConstantMappingFunction::~CAlfConstantMappingFunction(void)
+	??1CAlfControl@@UAE@XZ @ 67 NONAME ; CAlfControl::~CAlfControl(void)
+	??1CAlfCosineMappingFunction@@UAE@XZ @ 68 NONAME ; CAlfCosineMappingFunction::~CAlfCosineMappingFunction(void)
+	??1CAlfCurvePath@@UAE@XZ @ 69 NONAME ; CAlfCurvePath::~CAlfCurvePath(void)
+	??1CAlfCurvePathLayout@@UAE@XZ @ 70 NONAME ; CAlfCurvePathLayout::~CAlfCurvePathLayout(void)
+	??1CAlfDeckLayout@@UAE@XZ @ 71 NONAME ; CAlfDeckLayout::~CAlfDeckLayout(void)
+	??1CAlfEnv@@UAE@XZ @ 72 NONAME ; CAlfEnv::~CAlfEnv(void)
+	??1CAlfFlowLayout@@UAE@XZ @ 73 NONAME ; CAlfFlowLayout::~CAlfFlowLayout(void)
+	??1CAlfGenComponent@@UAE@XZ @ 74 NONAME ; CAlfGenComponent::~CAlfGenComponent(void)
+	??1CAlfGridLayout@@UAE@XZ @ 75 NONAME ; CAlfGridLayout::~CAlfGridLayout(void)
+	??1CAlfImageLoaderUtil@@UAE@XZ @ 76 NONAME ; CAlfImageLoaderUtil::~CAlfImageLoaderUtil(void)
+	??1CAlfImageVisual@@UAE@XZ @ 77 NONAME ; CAlfImageVisual::~CAlfImageVisual(void)
+	??1CAlfLCTAnchorLayout@@UAE@XZ @ 78 NONAME ; CAlfLCTAnchorLayout::~CAlfLCTAnchorLayout(void)
+	??1CAlfLCTGridLayout@@UAE@XZ @ 79 NONAME ; CAlfLCTGridLayout::~CAlfLCTGridLayout(void)
+	??1CAlfLCTTextVisual@@UAE@XZ @ 80 NONAME ; CAlfLCTTextVisual::~CAlfLCTTextVisual(void)
+	??1CAlfLayout@@UAE@XZ @ 81 NONAME ; CAlfLayout::~CAlfLayout(void)
+	??1CAlfLineVisual@@UAE@XZ @ 82 NONAME ; CAlfLineVisual::~CAlfLineVisual(void)
+	??1CAlfLinearMappingFunction@@UAE@XZ @ 83 NONAME ; CAlfLinearMappingFunction::~CAlfLinearMappingFunction(void)
+	??1CAlfMeshVisual@@UAE@XZ @ 84 NONAME ; CAlfMeshVisual::~CAlfMeshVisual(void)
+	??1CAlfPropertyOwner@@UAE@XZ @ 85 NONAME ; CAlfPropertyOwner::~CAlfPropertyOwner(void)
+	??1CAlfSineMappingFunction@@UAE@XZ @ 86 NONAME ; CAlfSineMappingFunction::~CAlfSineMappingFunction(void)
+	??1CAlfTableMappingFunction@@UAE@XZ @ 87 NONAME ; CAlfTableMappingFunction::~CAlfTableMappingFunction(void)
+	??1CAlfTextVisual@@UAE@XZ @ 88 NONAME ; CAlfTextVisual::~CAlfTextVisual(void)
+	??1CAlfTransformation@@UAE@XZ @ 89 NONAME ; CAlfTransformation::~CAlfTransformation(void)
+	??1CAlfViewportLayout@@UAE@XZ @ 90 NONAME ; CAlfViewportLayout::~CAlfViewportLayout(void)
+	??1CAlfVisual@@UAE@XZ @ 91 NONAME ; CAlfVisual::~CAlfVisual(void)
+	??1TAlfCommand@@UAE@XZ @ 92 NONAME ; TAlfCommand::~TAlfCommand(void)
+	??1TAlfImage@@QAE@XZ @ 93 NONAME ; TAlfImage::~TAlfImage(void)
+	??ACAlfBrushArray@@QAEAAVCAlfBrush@@H@Z @ 94 NONAME ; class CAlfBrush & CAlfBrushArray::operator[](int)
+	?AcceptInput@CAlfControl@@QBEHXZ @ 95 NONAME ; int CAlfControl::AcceptInput(void) const
+	?AcceptInput@CAlfControlGroup@@QBEHXZ @ 96 NONAME ; int CAlfControlGroup::AcceptInput(void) const
+	?AcquireFocus@CAlfControl@@QAEXXZ @ 97 NONAME ; void CAlfControl::AcquireFocus(void)
+	?AddActionObserverL@CAlfEnv@@QAEXPAVMAlfActionObserver@@@Z @ 98 NONAME ; void CAlfEnv::AddActionObserverL(class MAlfActionObserver *)
+	?AddConnectionL@CAlfControl@@UAEXPAV1@H@Z @ 99 NONAME ; void CAlfControl::AddConnectionL(class CAlfControl *, int)
+	?AddLoadObserverL@CAlfTextureManager@@QAEXPAVMAlfTextureLoadingCompletedObserver@@@Z @ 100 NONAME ; void CAlfTextureManager::AddLoadObserverL(class MAlfTextureLoadingCompletedObserver *)
+	?AddNewL@CAlfAnchorLayout@@SAPAV1@AAVCAlfControl@@PAVCAlfLayout@@@Z @ 101 NONAME ; class CAlfAnchorLayout * CAlfAnchorLayout::AddNewL(class CAlfControl &, class CAlfLayout *)
+	?AddNewL@CAlfCurvePathLayout@@SAPAV1@AAVCAlfControl@@PAVCAlfLayout@@@Z @ 102 NONAME ; class CAlfCurvePathLayout * CAlfCurvePathLayout::AddNewL(class CAlfControl &, class CAlfLayout *)
+	?AddNewL@CAlfDeckLayout@@SAPAV1@AAVCAlfControl@@PAVCAlfLayout@@@Z @ 103 NONAME ; class CAlfDeckLayout * CAlfDeckLayout::AddNewL(class CAlfControl &, class CAlfLayout *)
+	?AddNewL@CAlfFlowLayout@@SAPAV1@AAVCAlfControl@@PAVCAlfLayout@@@Z @ 104 NONAME ; class CAlfFlowLayout * CAlfFlowLayout::AddNewL(class CAlfControl &, class CAlfLayout *)
+	?AddNewL@CAlfGridLayout@@SAPAV1@AAVCAlfControl@@HHPAVCAlfLayout@@@Z @ 105 NONAME ; class CAlfGridLayout * CAlfGridLayout::AddNewL(class CAlfControl &, int, int, class CAlfLayout *)
+	?AddNewL@CAlfImageVisual@@SAPAV1@AAVCAlfControl@@PAVCAlfLayout@@@Z @ 106 NONAME ; class CAlfImageVisual * CAlfImageVisual::AddNewL(class CAlfControl &, class CAlfLayout *)
+	?AddNewL@CAlfLCTAnchorLayout@@SAPAV1@AAVCAlfControl@@PAVCAlfLayout@@@Z @ 107 NONAME ; class CAlfLCTAnchorLayout * CAlfLCTAnchorLayout::AddNewL(class CAlfControl &, class CAlfLayout *)
+	?AddNewL@CAlfLCTGridLayout@@SAPAV1@AAVCAlfControl@@PAVCAlfLayout@@@Z @ 108 NONAME ; class CAlfLCTGridLayout * CAlfLCTGridLayout::AddNewL(class CAlfControl &, class CAlfLayout *)
+	?AddNewL@CAlfLCTTextVisual@@SAPAV1@AAVCAlfControl@@PAVCAlfLayout@@@Z @ 109 NONAME ; class CAlfLCTTextVisual * CAlfLCTTextVisual::AddNewL(class CAlfControl &, class CAlfLayout *)
+	?AddNewL@CAlfLayout@@SAPAV1@AAVCAlfControl@@PAV1@@Z @ 110 NONAME ; class CAlfLayout * CAlfLayout::AddNewL(class CAlfControl &, class CAlfLayout *)
+	?AddNewL@CAlfLineVisual@@SAPAV1@AAVCAlfControl@@PAVCAlfLayout@@@Z @ 111 NONAME ; class CAlfLineVisual * CAlfLineVisual::AddNewL(class CAlfControl &, class CAlfLayout *)
+	?AddNewL@CAlfMeshVisual@@SAPAV1@AAVCAlfControl@@PAVCAlfLayout@@@Z @ 112 NONAME ; class CAlfMeshVisual * CAlfMeshVisual::AddNewL(class CAlfControl &, class CAlfLayout *)
+	?AddNewL@CAlfTextVisual@@SAPAV1@AAVCAlfControl@@PAVCAlfLayout@@@Z @ 113 NONAME ; class CAlfTextVisual * CAlfTextVisual::AddNewL(class CAlfControl &, class CAlfLayout *)
+	?AddNewL@CAlfViewportLayout@@SAPAV1@AAVCAlfControl@@PAVCAlfLayout@@@Z @ 114 NONAME ; class CAlfViewportLayout * CAlfViewportLayout::AddNewL(class CAlfControl &, class CAlfLayout *)
+	?AddPointerEventObserver@CAlfRoster@@QAEHW4TAlfPointerEventFlags@@AAVCAlfControl@@@Z @ 115 NONAME ; int CAlfRoster::AddPointerEventObserver(enum TAlfPointerEventFlags, class CAlfControl &)
+	?AddStateObserverL@CAlfTextureManager@@QAEXPAVMAlfTextureManagerStateChangedObserver@@@Z @ 116 NONAME ; void CAlfTextureManager::AddStateObserverL(class MAlfTextureManagerStateChangedObserver *)
+	?AlignByOrigin@CAlfVisual@@QBEXAAUTAlfRealRect@@@Z @ 117 NONAME ; void CAlfVisual::AlignByOrigin(struct TAlfRealRect &) const
+	?AnimationControllerCount@CAlfMesh@@UBEHXZ @ 118 NONAME ; int CAlfMesh::AnimationControllerCount(void) const
+	?Append@CAlfControl@@QAEHPAVCAlfVisual@@PAVCAlfLayout@@@Z @ 119 NONAME ; int CAlfControl::Append(class CAlfVisual *, class CAlfLayout *)
+	?Append@CAlfLayout@@QAEHPAVCAlfVisual@@HH@Z @ 120 NONAME ; int CAlfLayout::Append(class CAlfVisual *, int, int)
+	?AppendArcL@CAlfCurvePath@@QAEXABVTPoint@@ABVTSize@@MMM@Z @ 121 NONAME ; void CAlfCurvePath::AppendArcL(class TPoint const &, class TSize const &, float, float, float)
+	?AppendColorL@CAlfGradientBrush@@QAEXMABVTRgb@@M@Z @ 122 NONAME ; void CAlfGradientBrush::AppendColorL(float, class TRgb const &, float)
+	?AppendL@CAlfBrushArray@@QAEXPAVCAlfBrush@@W4TAlfOwnership@@@Z @ 123 NONAME ; void CAlfBrushArray::AppendL(class CAlfBrush *, enum TAlfOwnership)
+	?AppendL@CAlfControlGroup@@QAEXPAVCAlfControl@@@Z @ 124 NONAME ; void CAlfControlGroup::AppendL(class CAlfControl *)
+	?AppendLayoutL@CAlfControl@@QAEPAVCAlfLayout@@W4TAlfLayoutType@@PAV2@H@Z @ 125 NONAME ; class CAlfLayout * CAlfControl::AppendLayoutL(enum TAlfLayoutType, class CAlfLayout *, int)
+	?AppendLineL@CAlfCurvePath@@QAEXABVTPoint@@0M@Z @ 126 NONAME ; void CAlfCurvePath::AppendLineL(class TPoint const &, class TPoint const &, float)
+	?AppendVisualL@CAlfControl@@QAEPAVCAlfVisual@@W4TAlfVisualType@@PAVCAlfLayout@@H@Z @ 127 NONAME ; class CAlfVisual * CAlfControl::AppendVisualL(enum TAlfVisualType, class CAlfLayout *, int)
+	?AppendWeightL@CAlfGridLayout@@QAEXW4TAlfGridDimension@@ABUTAlfMetric@@@Z @ 128 NONAME ; void CAlfGridLayout::AppendWeightL(enum TAlfGridDimension, struct TAlfMetric const &)
+	?AppendWidgetL@CAlfEnv@@QAEXPAVIAlfWidget@Alf@@@Z @ 129 NONAME ; void CAlfEnv::AppendWidgetL(class Alf::IAlfWidget *)
+	?At@CAlfBrushArray@@QAEAAVCAlfBrush@@H@Z @ 130 NONAME ; class CAlfBrush & CAlfBrushArray::At(int)
+	?AutoMarking@CAlfLayoutMetricsUtility@@QAEHXZ @ 131 NONAME ; int CAlfLayoutMetricsUtility::AutoMarking(void)
+	?BackgroundType@CAlfTextVisual@@QAE?AW4TAlfBackgroundType@@XZ @ 132 NONAME ; enum TAlfBackgroundType CAlfTextVisual::BackgroundType(void)
+	?BaseUnit@CAlfAnchorLayout@@UBE?AUTAlfXYMetric@@XZ @ 133 NONAME ; struct TAlfXYMetric CAlfAnchorLayout::BaseUnit(void) const
+	?BaseUnit@CAlfCurvePathLayout@@UBE?AUTAlfXYMetric@@XZ @ 134 NONAME ; struct TAlfXYMetric CAlfCurvePathLayout::BaseUnit(void) const
+	?BaseUnit@CAlfDeckLayout@@UBE?AUTAlfXYMetric@@XZ @ 135 NONAME ; struct TAlfXYMetric CAlfDeckLayout::BaseUnit(void) const
+	?BaseUnit@CAlfFlowLayout@@UBE?AUTAlfXYMetric@@XZ @ 136 NONAME ; struct TAlfXYMetric CAlfFlowLayout::BaseUnit(void) const
+	?BaseUnit@CAlfGridLayout@@UBE?AUTAlfXYMetric@@XZ @ 137 NONAME ; struct TAlfXYMetric CAlfGridLayout::BaseUnit(void) const
+	?BaseUnit@CAlfLCTAnchorLayout@@UBE?AUTAlfXYMetric@@XZ @ 138 NONAME ; struct TAlfXYMetric CAlfLCTAnchorLayout::BaseUnit(void) const
+	?BaseUnit@CAlfLCTGridLayout@@UBE?AUTAlfXYMetric@@XZ @ 139 NONAME ; struct TAlfXYMetric CAlfLCTGridLayout::BaseUnit(void) const
+	?BaseUnit@CAlfLayout@@UBE?AUTAlfXYMetric@@XZ @ 140 NONAME ; struct TAlfXYMetric CAlfLayout::BaseUnit(void) const
+	?BaseUnit@CAlfViewportLayout@@UBE?AUTAlfXYMetric@@XZ @ 141 NONAME ; struct TAlfXYMetric CAlfViewportLayout::BaseUnit(void) const
+	?BindDisplay@CAlfControl@@QAEXAAVCAlfDisplay@@@Z @ 142 NONAME ; void CAlfControl::BindDisplay(class CAlfDisplay &)
+	?BlankTexture@CAlfTextureManager@@QAEAAVCAlfTexture@@XZ @ 143 NONAME ; class CAlfTexture & CAlfTextureManager::BlankTexture(void)
+	?BlankTexture@CAlfTextureManager@@QBEABVCAlfTexture@@XZ @ 144 NONAME ; class CAlfTexture const & CAlfTextureManager::BlankTexture(void) const
+	?BlurL@CAlfTextureProcessor@@QAEXABVCAlfTexture@@AAV2@ABVTSize@@HH@Z @ 145 NONAME ; void CAlfTextureProcessor::BlurL(class CAlfTexture const &, class CAlfTexture &, class TSize const &, int, int)
+	?BlurL@CAlfTextureProcessor@@QAEXABVCAlfTexture@@AAV2@HH@Z @ 146 NONAME ; void CAlfTextureProcessor::BlurL(class CAlfTexture const &, class CAlfTexture &, int, int)
+	?BorderDrawingEnabled@CAlfImageBrush@@QBEHXZ @ 147 NONAME ; int CAlfImageBrush::BorderDrawingEnabled(void) const
+	?BottomRight@TAlfImage@@QBE?AUTAlfRealPoint@@XZ @ 148 NONAME ; struct TAlfRealPoint TAlfImage::BottomRight(void) const
+	?Bounds@CAlfControl@@QBE?AVTRect@@XZ @ 149 NONAME ; class TRect CAlfControl::Bounds(void) const
+	?Brushes@CAlfVisual@@QAEPAVCAlfBrushArray@@XZ @ 150 NONAME ; class CAlfBrushArray * CAlfVisual::Brushes(void)
+	?CancelAllCommands@CAlfControl@@QAEXXZ @ 151 NONAME ; void CAlfControl::CancelAllCommands(void)
+	?CancelAsynchCmd@CAlfGenComponent@@QAEXH@Z @ 152 NONAME ; void CAlfGenComponent::CancelAsynchCmd(int)
+	?CancelCommands@CAlfEnv@@QAEXPAX@Z @ 153 NONAME ; void CAlfEnv::CancelCommands(void *)
+	?CancelCommands@CAlfEnv@@QAEXPAXW4TAlfCommandType@@@Z @ 154 NONAME ; void CAlfEnv::CancelCommands(void *, enum TAlfCommandType)
+	?CancelCommands@CAlfEnv@@QAEXPAXW4TAlfOp@@@Z @ 155 NONAME ; void CAlfEnv::CancelCommands(void *, enum TAlfOp)
+	?CancelCustomCommands@CAlfEnv@@QAEXPAVMAlfEventHandler@@@Z @ 156 NONAME ; void CAlfEnv::CancelCustomCommands(class MAlfEventHandler *)
+	?CancelCustomCommands@CAlfEnv@@QAEXPAVMAlfEventHandler@@H@Z @ 157 NONAME ; void CAlfEnv::CancelCustomCommands(class MAlfEventHandler *, int)
+	?CenterDrawingEnabled@CAlfImageBrush@@QBEHXZ @ 158 NONAME ; int CAlfImageBrush::CenterDrawingEnabled(void) const
+	?ChildOrdinal@CAlfLayout@@QAEHH@Z @ 159 NONAME ; int CAlfLayout::ChildOrdinal(int)
+	?ChildPos@CAlfLayout@@QAEHHAAVTPoint@@@Z @ 160 NONAME ; int CAlfLayout::ChildPos(int, class TPoint &)
+	?ChildSize@CAlfLayout@@QAEHHAAVTSize@@@Z @ 161 NONAME ; int CAlfLayout::ChildSize(int, class TSize &)
+	?ClearFlag@CAlfVisual@@QAEXW4TAlfVisualFlags@@@Z @ 162 NONAME ; void CAlfVisual::ClearFlag(enum TAlfVisualFlags)
+	?ClearFlags@CAlfVisual@@QAEXI@Z @ 163 NONAME ; void CAlfVisual::ClearFlags(unsigned int)
+	?ClearFocus@CAlfRoster@@QAEXXZ @ 164 NONAME ; void CAlfRoster::ClearFocus(void)
+	?Client@CAlfEnv@@QAEAAVRAlfClient@@XZ @ 165 NONAME ; class RAlfClient & CAlfEnv::Client(void)
+	?Clipping@CAlfVisual@@QBEHXZ @ 166 NONAME ; int CAlfVisual::Clipping(void) const
+	?Code@TAlfEvent@@QBEABW4TEventCode@@XZ @ 167 NONAME ; enum TEventCode const & TAlfEvent::Code(void) const
+	?Code@TAlfScrollerEvent@@QBE?AW4TCode@1@XZ @ 168 NONAME ; enum TAlfScrollerEvent::TCode TAlfScrollerEvent::Code(void) const
+	?Color@CAlfGradientBrush@@QBE?AVTRgb@@H@Z @ 169 NONAME ; class TRgb CAlfGradientBrush::Color(int) const
+	?ColorLightness@AlfUtil@@SAMABVTRgb@@@Z @ 170 NONAME ; float AlfUtil::ColorLightness(class TRgb const &)
+	?ColumnCount@CAlfGridLayout@@QBEHXZ @ 171 NONAME ; int CAlfGridLayout::ColumnCount(void) const
+	?CombineMaskFbsBitmapL@AlfUtil@@SAXABVCFbsBitmap@@0AAV2@@Z @ 172 NONAME ; void AlfUtil::CombineMaskFbsBitmapL(class CFbsBitmap const &, class CFbsBitmap const &, class CFbsBitmap &)
+	?CommandExtension@TAlfActionCommand@@MAEXABVTUid@@PAPAX@Z @ 173 NONAME ; void TAlfActionCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@TAlfCommand@@MAEXABVTUid@@PAPAX@Z @ 174 NONAME ; void TAlfCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@TAlfControlCommand@@MAEXABVTUid@@PAPAX@Z @ 175 NONAME ; void TAlfControlCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@TAlfCustomEventCommand@@MAEXABVTUid@@PAPAX@Z @ 176 NONAME ; void TAlfCustomEventCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@TAlfGroupCommand@@MAEXABVTUid@@PAPAX@Z @ 177 NONAME ; void TAlfGroupCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@TAlfImageCommand@@MAEXABVTUid@@PAPAX@Z @ 178 NONAME ; void TAlfImageCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@TAlfMarkerCommand@@MAEXABVTUid@@PAPAX@Z @ 179 NONAME ; void TAlfMarkerCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@TAlfObjectCommand@@MAEXABVTUid@@PAPAX@Z @ 180 NONAME ; void TAlfObjectCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@TAlfPointCommand@@MAEXABVTUid@@PAPAX@Z @ 181 NONAME ; void TAlfPointCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@TAlfTextCommand@@MAEXABVTUid@@PAPAX@Z @ 182 NONAME ; void TAlfTextCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@TAlfTransformationCommand@@MAEXABVTUid@@PAPAX@Z @ 183 NONAME ; void TAlfTransformationCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@TAlfValueCommand@@MAEXABVTUid@@PAPAX@Z @ 184 NONAME ; void TAlfValueCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@TAlfVisualCommand@@MAEXABVTUid@@PAPAX@Z @ 185 NONAME ; void TAlfVisualCommand::CommandExtension(class TUid const &, void * *)
+	?Comms@CAlfBrush@@QBEPAVCAlfGenComponent@@XZ @ 186 NONAME ; class CAlfGenComponent * CAlfBrush::Comms(void) const
+	?Comms@CAlfVisual@@QBEPAVCAlfGenComponent@@XZ @ 187 NONAME ; class CAlfGenComponent * CAlfVisual::Comms(void) const
+	?Connection@CAlfControl@@QBEAAV1@H@Z @ 188 NONAME ; class CAlfControl & CAlfControl::Connection(int) const
+	?ConnectionAddedL@CAlfControl@@MAEXPAV1@H@Z @ 189 NONAME ; void CAlfControl::ConnectionAddedL(class CAlfControl *, int)
+	?ConnectionByOrdinal@CAlfControl@@QBEAAV1@H@Z @ 190 NONAME ; class CAlfControl & CAlfControl::ConnectionByOrdinal(int) const
+	?ConnectionCount@CAlfControl@@QBEHXZ @ 191 NONAME ; int CAlfControl::ConnectionCount(void) const
+	?ConnectionOrdinal@CAlfControl@@QBEHH@Z @ 192 NONAME ; int CAlfControl::ConnectionOrdinal(int) const
+	?ConnectionRemoved@CAlfControl@@MAEXPAV1@H@Z @ 193 NONAME ; void CAlfControl::ConnectionRemoved(class CAlfControl *, int)
+	?ConnectionRole@CAlfControl@@QBEHH@Z @ 194 NONAME ; int CAlfControl::ConnectionRole(int) const
+	?ConstructL@CAlfAnchorLayout@@UAEXAAVCAlfControl@@@Z @ 195 NONAME ; void CAlfAnchorLayout::ConstructL(class CAlfControl &)
+	?ConstructL@CAlfBrush@@IAEXAAVCAlfEnv@@HHABVTDesC8@@@Z @ 196 NONAME ; void CAlfBrush::ConstructL(class CAlfEnv &, int, int, class TDesC8 const &)
+	?ConstructL@CAlfBrush@@IAEXXZ @ 197 NONAME ; void CAlfBrush::ConstructL(void)
+	?ConstructL@CAlfControl@@QAEXAAVCAlfEnv@@@Z @ 198 NONAME ; void CAlfControl::ConstructL(class CAlfEnv &)
+	?ConstructL@CAlfCurvePathLayout@@UAEXAAVCAlfControl@@@Z @ 199 NONAME ; void CAlfCurvePathLayout::ConstructL(class CAlfControl &)
+	?ConstructL@CAlfDeckLayout@@UAEXAAVCAlfControl@@@Z @ 200 NONAME ; void CAlfDeckLayout::ConstructL(class CAlfControl &)
+	?ConstructL@CAlfFlowLayout@@UAEXAAVCAlfControl@@@Z @ 201 NONAME ; void CAlfFlowLayout::ConstructL(class CAlfControl &)
+	?ConstructL@CAlfGridLayout@@UAEXAAVCAlfControl@@@Z @ 202 NONAME ; void CAlfGridLayout::ConstructL(class CAlfControl &)
+	?ConstructL@CAlfImageVisual@@UAEXAAVCAlfControl@@@Z @ 203 NONAME ; void CAlfImageVisual::ConstructL(class CAlfControl &)
+	?ConstructL@CAlfLCTAnchorLayout@@UAEXAAVCAlfControl@@@Z @ 204 NONAME ; void CAlfLCTAnchorLayout::ConstructL(class CAlfControl &)
+	?ConstructL@CAlfLCTGridLayout@@UAEXAAVCAlfControl@@@Z @ 205 NONAME ; void CAlfLCTGridLayout::ConstructL(class CAlfControl &)
+	?ConstructL@CAlfLCTTextVisual@@UAEXAAVCAlfControl@@@Z @ 206 NONAME ; void CAlfLCTTextVisual::ConstructL(class CAlfControl &)
+	?ConstructL@CAlfLayout@@UAEXAAVCAlfControl@@@Z @ 207 NONAME ; void CAlfLayout::ConstructL(class CAlfControl &)
+	?ConstructL@CAlfLineVisual@@UAEXAAVCAlfControl@@@Z @ 208 NONAME ; void CAlfLineVisual::ConstructL(class CAlfControl &)
+	?ConstructL@CAlfMeshVisual@@UAEXAAVCAlfControl@@@Z @ 209 NONAME ; void CAlfMeshVisual::ConstructL(class CAlfControl &)
+	?ConstructL@CAlfTextVisual@@UAEXAAVCAlfControl@@@Z @ 210 NONAME ; void CAlfTextVisual::ConstructL(class CAlfControl &)
+	?ConstructL@CAlfViewportLayout@@UAEXAAVCAlfControl@@@Z @ 211 NONAME ; void CAlfViewportLayout::ConstructL(class CAlfControl &)
+	?ConstructL@CAlfVisual@@QAEXAAVCAlfControl@@HHABVTDesC8@@@Z @ 212 NONAME ; void CAlfVisual::ConstructL(class CAlfControl &, int, int, class TDesC8 const &)
+	?ConstructL@CAlfVisual@@UAEXAAVCAlfControl@@@Z @ 213 NONAME ; void CAlfVisual::ConstructL(class CAlfControl &)
+	?ConstructServerName@RAlfClientBase@@KAXAAV?$TBuf@$0IA@@@VTUid@@I@Z @ 214 NONAME ; void RAlfClientBase::ConstructServerName(class TBuf<128> &, class TUid, unsigned int)
+	?ContainerLayout@CAlfControl@@UBEPAVCAlfLayout@@PBV1@@Z @ 215 NONAME ; class CAlfLayout * CAlfControl::ContainerLayout(class CAlfControl const *) const
+	?ContinueRefresh@CAlfEnv@@QAEXXZ @ 216 NONAME ; void CAlfEnv::ContinueRefresh(void)
+	?Control@CAlfControlGroup@@QBEAAVCAlfControl@@H@Z @ 217 NONAME ; class CAlfControl & CAlfControlGroup::Control(int) const
+	?Control@TAlfControlCommand@@QBEAAVCAlfControl@@XZ @ 218 NONAME ; class CAlfControl & TAlfControlCommand::Control(void) const
+	?ControlGroup@CAlfControl@@QBEPAVCAlfControlGroup@@XZ @ 219 NONAME ; class CAlfControlGroup * CAlfControl::ControlGroup(void) const
+	?ControlGroup@CAlfEnv@@QAEAAVCAlfControlGroup@@H@Z @ 220 NONAME ; class CAlfControlGroup & CAlfEnv::ControlGroup(int)
+	?ControlGroup@CAlfRoster@@QBEAAVCAlfControlGroup@@H@Z @ 221 NONAME ; class CAlfControlGroup & CAlfRoster::ControlGroup(int) const
+	?ControlGroup@TAlfGroupCommand@@QBEAAVCAlfControlGroup@@XZ @ 222 NONAME ; class CAlfControlGroup & TAlfGroupCommand::ControlGroup(void) const
+	?ConvertBitmapToDisplayModeLC@AlfUtil@@SAPAVCFbsBitmap@@ABV2@ABW4TDisplayMode@@@Z @ 223 NONAME ; class CFbsBitmap * AlfUtil::ConvertBitmapToDisplayModeLC(class CFbsBitmap const &, enum TDisplayMode const &)
+	?CopyProperty@CAlfPropertyOwner@@QAEHABV1@ABVTDesC8@@@Z @ 224 NONAME ; int CAlfPropertyOwner::CopyProperty(class CAlfPropertyOwner const &, class TDesC8 const &)
+	?CopyTextStyleL@CAlfTextStyleManager@@QAEHH@Z @ 225 NONAME ; int CAlfTextStyleManager::CopyTextStyleL(int)
+	?CopyValues@CAlfVisual@@QAEHABV1@HH@Z @ 226 NONAME ; int CAlfVisual::CopyValues(class CAlfVisual const &, int, int)
+	?Count@CAlfBrushArray@@QBEHXZ @ 227 NONAME ; int CAlfBrushArray::Count(void) const
+	?Count@CAlfControlGroup@@QBEHXZ @ 228 NONAME ; int CAlfControlGroup::Count(void) const
+	?Count@CAlfLayout@@QBEHXZ @ 229 NONAME ; int CAlfLayout::Count(void) const
+	?Count@CAlfRoster@@QBEHXZ @ 230 NONAME ; int CAlfRoster::Count(void) const
+	?Count@CAlfTransformation@@QBEHXZ @ 231 NONAME ; int CAlfTransformation::Count(void) const
+	?CreateImageLoaderL@CAlfImageLoaderUtil@@QAEPAVMAlfBitmapProvider@@ABVTAknsItemID@@ABVTDesC16@@HH@Z @ 232 NONAME ; class MAlfBitmapProvider * CAlfImageLoaderUtil::CreateImageLoaderL(class TAknsItemID const &, class TDesC16 const &, int, int)
+	?CreateImageLoaderL@CAlfImageLoaderUtil@@QAEPAVMAlfBitmapProvider@@VTUid@@W4TAknsAppIconType@@@Z @ 233 NONAME ; class MAlfBitmapProvider * CAlfImageLoaderUtil::CreateImageLoaderL(class TUid, enum TAknsAppIconType)
+	?CreateMeshL@CAlfMeshVisual@@QAEXH@Z @ 234 NONAME ; void CAlfMeshVisual::CreateMeshL(int)
+	?CreatePlatformTextStyleL@CAlfTextStyleManager@@QAEHH@Z @ 235 NONAME ; int CAlfTextStyleManager::CreatePlatformTextStyleL(int)
+	?CreatePlatformTextStyleL@CAlfTextStyleManager@@QAEHHH@Z @ 236 NONAME ; int CAlfTextStyleManager::CreatePlatformTextStyleL(int, int)
+	?CreateSharedTextureManagerL@CAlfEnv@@QAEPAVCAlfTextureManager@@VTUid@@@Z @ 237 NONAME ; class CAlfTextureManager * CAlfEnv::CreateSharedTextureManagerL(class TUid)
+	?CreateTextureL@CAlfTextureManager@@QAEAAVCAlfTexture@@HPAVMAlfBitmapProvider@@W4TAlfTextureFlags@@@Z @ 238 NONAME ; class CAlfTexture & CAlfTextureManager::CreateTextureL(int, class MAlfBitmapProvider *, enum TAlfTextureFlags)
+	?CropFbsBitmapL@AlfUtil@@SAXABVCFbsBitmap@@AAV2@VTPoint@@@Z @ 239 NONAME ; void AlfUtil::CropFbsBitmapL(class CFbsBitmap const &, class CFbsBitmap &, class TPoint)
+	?CropImage@AlfUtil@@SAXHABVTSize@@PBEABVTPoint@@0PAE@Z @ 240 NONAME ; void AlfUtil::CropImage(int, class TSize const &, unsigned char const *, class TPoint const &, class TSize const &, unsigned char *)
+	?CrossProduct@AlfUtil@@SAXQBM0QAM@Z @ 241 NONAME ; void AlfUtil::CrossProduct(float const * const, float const * const, float * const)
+	?CurvePath@CAlfCurvePathLayout@@QAEAAVCAlfCurvePath@@XZ @ 242 NONAME ; class CAlfCurvePath & CAlfCurvePathLayout::CurvePath(void)
+	?CustomEventData@TAlfEvent@@QBEHXZ @ 243 NONAME ; int TAlfEvent::CustomEventData(void) const
+	?CustomParameter@TAlfEvent@@QBEHXZ @ 244 NONAME ; int TAlfEvent::CustomParameter(void) const
+	?Data@CAlfStatic@@CAPAUTTlsData@@XZ @ 245 NONAME ; struct TTlsData * CAlfStatic::Data(void)
+	?DefineFileNameL@CAlfTextureManager@@QAEXHABVTDesC16@@@Z @ 246 NONAME ; void CAlfTextureManager::DefineFileNameL(int, class TDesC16 const &)
+	?DeleteControlGroup@CAlfEnv@@QAEHH@Z @ 247 NONAME ; int CAlfEnv::DeleteControlGroup(int)
+	?DeleteSharedTextureManager@CAlfEnv@@QAEXVTUid@@@Z @ 248 NONAME ; void CAlfEnv::DeleteSharedTextureManager(class TUid)
+	?Depth@CAlfDropShadowBrush@@QBEABVTAlfTimedValue@@XZ @ 249 NONAME ; class TAlfTimedValue const & CAlfDropShadowBrush::Depth(void) const
+	?DepthOffset@CAlfVisual@@QBE?AVTAlfTimedValue@@XZ @ 250 NONAME ; class TAlfTimedValue CAlfVisual::DepthOffset(void) const
+	?DimensionCount@CAlfGridLayout@@QBEHW4TAlfGridDimension@@@Z @ 251 NONAME ; int CAlfGridLayout::DimensionCount(enum TAlfGridDimension) const
+	?Display@CAlfControl@@QBEPAVCAlfDisplay@@XZ @ 252 NONAME ; class CAlfDisplay * CAlfControl::Display(void) const
+	?Display@CAlfVisual@@QBEPAVCAlfDisplay@@XZ @ 253 NONAME ; class CAlfDisplay * CAlfVisual::Display(void) const
+	?Display@TAlfEvent@@QBEPAVCAlfDisplay@@XZ @ 254 NONAME ; class CAlfDisplay * TAlfEvent::Display(void) const
+	?Display@TAlfGroupCommand@@QBEPAVCAlfDisplay@@XZ @ 255 NONAME ; class CAlfDisplay * TAlfGroupCommand::Display(void) const
+	?DisplayArea@CAlfControl@@QBE?AVTRect@@XZ @ 256 NONAME ; class TRect CAlfControl::DisplayArea(void) const
+	?DisplayCenter@CAlfControl@@QBE?AUTAlfRealPoint@@XZ @ 257 NONAME ; struct TAlfRealPoint CAlfControl::DisplayCenter(void) const
+	?DisplayCount@CAlfEnv@@QBEHXZ @ 258 NONAME ; int CAlfEnv::DisplayCount(void) const
+	?DisplayRect@CAlfVisual@@QBE?AUTAlfRealRect@@XZ @ 259 NONAME ; struct TAlfRealRect CAlfVisual::DisplayRect(void) const
+	?DisplayRectTarget@CAlfVisual@@QBE?AUTAlfRealRect@@XZ @ 260 NONAME ; struct TAlfRealRect CAlfVisual::DisplayRectTarget(void) const
+	?DisplayToHost@CAlfControl@@QBE?AVTPoint@@ABV2@@Z @ 261 NONAME ; class TPoint CAlfControl::DisplayToHost(class TPoint const &) const
+	?DisplayToLocal@CAlfVisual@@QBE?AUTAlfRealPoint@@ABU2@@Z @ 262 NONAME ; struct TAlfRealPoint CAlfVisual::DisplayToLocal(struct TAlfRealPoint const &) const
+	?DisplayToLocal@CAlfVisual@@QBE?AVTPoint@@ABV2@@Z @ 263 NONAME ; class TPoint CAlfVisual::DisplayToLocal(class TPoint const &) const
+	?DoAsynchronousCmdL@CAlfGenComponent@@QAEHIABVTDesC8@@AAVTDes8@@PAVMAlfAsyncOpObserver@@@Z @ 264 NONAME ; int CAlfGenComponent::DoAsynchronousCmdL(unsigned int, class TDesC8 const &, class TDes8 &, class MAlfAsyncOpObserver *)
+	?DoRemoveAndDestroyAllD@CAlfAnchorLayout@@MAEXXZ @ 265 NONAME ; void CAlfAnchorLayout::DoRemoveAndDestroyAllD(void)
+	?DoRemoveAndDestroyAllD@CAlfCurvePathLayout@@MAEXXZ @ 266 NONAME ; void CAlfCurvePathLayout::DoRemoveAndDestroyAllD(void)
+	?DoRemoveAndDestroyAllD@CAlfDeckLayout@@MAEXXZ @ 267 NONAME ; void CAlfDeckLayout::DoRemoveAndDestroyAllD(void)
+	?DoRemoveAndDestroyAllD@CAlfFlowLayout@@MAEXXZ @ 268 NONAME ; void CAlfFlowLayout::DoRemoveAndDestroyAllD(void)
+	?DoRemoveAndDestroyAllD@CAlfGridLayout@@MAEXXZ @ 269 NONAME ; void CAlfGridLayout::DoRemoveAndDestroyAllD(void)
+	?DoRemoveAndDestroyAllD@CAlfImageVisual@@MAEXXZ @ 270 NONAME ; void CAlfImageVisual::DoRemoveAndDestroyAllD(void)
+	?DoRemoveAndDestroyAllD@CAlfLCTAnchorLayout@@MAEXXZ @ 271 NONAME ; void CAlfLCTAnchorLayout::DoRemoveAndDestroyAllD(void)
+	?DoRemoveAndDestroyAllD@CAlfLCTGridLayout@@MAEXXZ @ 272 NONAME ; void CAlfLCTGridLayout::DoRemoveAndDestroyAllD(void)
+	?DoRemoveAndDestroyAllD@CAlfLCTTextVisual@@MAEXXZ @ 273 NONAME ; void CAlfLCTTextVisual::DoRemoveAndDestroyAllD(void)
+	?DoRemoveAndDestroyAllD@CAlfLayout@@MAEXXZ @ 274 NONAME ; void CAlfLayout::DoRemoveAndDestroyAllD(void)
+	?DoRemoveAndDestroyAllD@CAlfLineVisual@@MAEXXZ @ 275 NONAME ; void CAlfLineVisual::DoRemoveAndDestroyAllD(void)
+	?DoRemoveAndDestroyAllD@CAlfMeshVisual@@MAEXXZ @ 276 NONAME ; void CAlfMeshVisual::DoRemoveAndDestroyAllD(void)
+	?DoRemoveAndDestroyAllD@CAlfTextVisual@@MAEXXZ @ 277 NONAME ; void CAlfTextVisual::DoRemoveAndDestroyAllD(void)
+	?DoRemoveAndDestroyAllD@CAlfViewportLayout@@MAEXXZ @ 278 NONAME ; void CAlfViewportLayout::DoRemoveAndDestroyAllD(void)
+	?DoRemoveAndDestroyAllD@CAlfVisual@@UAEXXZ @ 279 NONAME ; void CAlfVisual::DoRemoveAndDestroyAllD(void)
+	?DoSynchronousCmd@CAlfGenComponent@@QAEHIABVTDesC8@@AAVTDes8@@@Z @ 280 NONAME ; int CAlfGenComponent::DoSynchronousCmd(unsigned int, class TDesC8 const &, class TDes8 &)
+	?EdgeOffset@CAlfBorderBrush@@QBEABVTAlfTimedPoint@@XZ @ 281 NONAME ; class TAlfTimedPoint const & CAlfBorderBrush::EdgeOffset(void) const
+	?EffectiveLayoutOrdinal@CAlfLayout@@QBEHABVCAlfVisual@@@Z @ 282 NONAME ; int CAlfLayout::EffectiveLayoutOrdinal(class CAlfVisual const &) const
+	?EffectiveOpacity@CAlfVisual@@QBEMXZ @ 283 NONAME ; float CAlfVisual::EffectiveOpacity(void) const
+	?EnableAutoMarking@CAlfLayoutMetricsUtility@@QAEXH@Z @ 284 NONAME ; void CAlfLayoutMetricsUtility::EnableAutoMarking(int)
+	?EnableBrushesL@CAlfVisual@@QAEXH@Z @ 285 NONAME ; void CAlfVisual::EnableBrushesL(int)
+	?EnableLoop@CAlfCurvePath@@QAEXH@Z @ 286 NONAME ; void CAlfCurvePath::EnableLoop(int)
+	?EnableScrollingL@CAlfLayout@@QAEXH@Z @ 287 NONAME ; void CAlfLayout::EnableScrollingL(int)
+	?EnableShadow@CAlfTextVisual@@QAEXH@Z @ 288 NONAME ; void CAlfTextVisual::EnableShadow(int)
+	?EnableTransformationL@CAlfControlGroup@@QAEXH@Z @ 289 NONAME ; void CAlfControlGroup::EnableTransformationL(int)
+	?EnableTransformationL@CAlfVisual@@QAEXH@Z @ 290 NONAME ; void CAlfVisual::EnableTransformationL(int)
+	?EndPos@CAlfLineVisual@@QBEABVTAlfTimedValue@@XZ @ 291 NONAME ; class TAlfTimedValue const & CAlfLineVisual::EndPos(void) const
+	?Env@CAlfControl@@QBEAAVCAlfEnv@@XZ @ 292 NONAME ; class CAlfEnv & CAlfControl::Env(void) const
+	?Env@CAlfDisplay@@QAEAAVCAlfEnv@@XZ @ 293 NONAME ; class CAlfEnv & CAlfDisplay::Env(void)
+	?Env@CAlfStatic@@SAAAVCAlfEnv@@XZ @ 294 NONAME ; class CAlfEnv & CAlfStatic::Env(void)
+	?Env@CAlfTextureManager@@QAEAAVCAlfEnv@@XZ @ 295 NONAME ; class CAlfEnv & CAlfTextureManager::Env(void)
+	?Env@CAlfVisual@@QBEAAVCAlfEnv@@XZ @ 296 NONAME ; class CAlfEnv & CAlfVisual::Env(void) const
+	?Evaluate@CAlfCurvePath@@QBEXMAAUTAlfRealPoint@@@Z @ 297 NONAME ; void CAlfCurvePath::Evaluate(float, struct TAlfRealPoint &) const
+	?EventData@TAlfCustomEventCommand@@QBEHXZ @ 298 NONAME ; int TAlfCustomEventCommand::EventData(void) const
+	?ExecuteL@TAlfActionCommand@@UBEXAAVCAlfEnv@@@Z @ 299 NONAME ; void TAlfActionCommand::ExecuteL(class CAlfEnv &) const
+	?ExecuteL@TAlfControlCommand@@UBEXAAVCAlfEnv@@@Z @ 300 NONAME ; void TAlfControlCommand::ExecuteL(class CAlfEnv &) const
+	?ExecuteL@TAlfCustomEventCommand@@UBEXAAVCAlfEnv@@@Z @ 301 NONAME ; void TAlfCustomEventCommand::ExecuteL(class CAlfEnv &) const
+	?ExecuteL@TAlfGroupCommand@@UBEXAAVCAlfEnv@@@Z @ 302 NONAME ; void TAlfGroupCommand::ExecuteL(class CAlfEnv &) const
+	?ExecuteL@TAlfImageCommand@@UBEXAAVCAlfEnv@@@Z @ 303 NONAME ; void TAlfImageCommand::ExecuteL(class CAlfEnv &) const
+	?ExecuteL@TAlfMarkerCommand@@UBEXAAVCAlfEnv@@@Z @ 304 NONAME ; void TAlfMarkerCommand::ExecuteL(class CAlfEnv &) const
+	?ExecuteL@TAlfObjectCommand@@UBEXAAVCAlfEnv@@@Z @ 305 NONAME ; void TAlfObjectCommand::ExecuteL(class CAlfEnv &) const
+	?ExecuteL@TAlfPointCommand@@UBEXAAVCAlfEnv@@@Z @ 306 NONAME ; void TAlfPointCommand::ExecuteL(class CAlfEnv &) const
+	?ExecuteL@TAlfTextCommand@@UBEXAAVCAlfEnv@@@Z @ 307 NONAME ; void TAlfTextCommand::ExecuteL(class CAlfEnv &) const
+	?ExecuteL@TAlfTransformationCommand@@UBEXAAVCAlfEnv@@@Z @ 308 NONAME ; void TAlfTransformationCommand::ExecuteL(class CAlfEnv &) const
+	?ExecuteL@TAlfValueCommand@@UBEXAAVCAlfEnv@@@Z @ 309 NONAME ; void TAlfValueCommand::ExecuteL(class CAlfEnv &) const
+	?ExecuteL@TAlfVisualCommand@@UBEXAAVCAlfEnv@@@Z @ 310 NONAME ; void TAlfVisualCommand::ExecuteL(class CAlfEnv &) const
+	?Factor@CAlfCosineMappingFunction@@QBEMXZ @ 311 NONAME ; float CAlfCosineMappingFunction::Factor(void) const
+	?Factor@CAlfLinearMappingFunction@@QBEMXZ @ 312 NONAME ; float CAlfLinearMappingFunction::Factor(void) const
+	?Factor@CAlfSineMappingFunction@@QBEMXZ @ 313 NONAME ; float CAlfSineMappingFunction::Factor(void) const
+	?FileName@CAlfTexture@@QBEPAVHBufC16@@XZ @ 314 NONAME ; class HBufC16 * CAlfTexture::FileName(void) const
+	?FillWeightsL@CAlfGridLayout@@QAEXW4TAlfGridDimension@@HABUTAlfMetric@@@Z @ 315 NONAME ; void CAlfGridLayout::FillWeightsL(enum TAlfGridDimension, int, struct TAlfMetric const &)
+	?Find@CAlfRoster@@QBEHABVCAlfControlGroup@@@Z @ 316 NONAME ; int CAlfRoster::Find(class CAlfControlGroup const &) const
+	?FindConnection@CAlfControl@@QBEHPBV1@@Z @ 317 NONAME ; int CAlfControl::FindConnection(class CAlfControl const *) const
+	?FindControl@CAlfControlGroup@@QBEPAVCAlfControl@@HH@Z @ 318 NONAME ; class CAlfControl * CAlfControlGroup::FindControl(int, int) const
+	?FindControl@CAlfEnv@@QBEPAVCAlfControl@@HH@Z @ 319 NONAME ; class CAlfControl * CAlfEnv::FindControl(int, int) const
+	?FindControl@CAlfRoster@@QBEPAVCAlfControl@@H@Z @ 320 NONAME ; class CAlfControl * CAlfRoster::FindControl(int) const
+	?FindTag@CAlfAnchorLayout@@UAEPAVCAlfVisual@@ABVTDesC8@@@Z @ 321 NONAME ; class CAlfVisual * CAlfAnchorLayout::FindTag(class TDesC8 const &)
+	?FindTag@CAlfControl@@QBEPAVCAlfVisual@@ABVTDesC8@@@Z @ 322 NONAME ; class CAlfVisual * CAlfControl::FindTag(class TDesC8 const &) const
+	?FindTag@CAlfCurvePathLayout@@UAEPAVCAlfVisual@@ABVTDesC8@@@Z @ 323 NONAME ; class CAlfVisual * CAlfCurvePathLayout::FindTag(class TDesC8 const &)
+	?FindTag@CAlfDeckLayout@@UAEPAVCAlfVisual@@ABVTDesC8@@@Z @ 324 NONAME ; class CAlfVisual * CAlfDeckLayout::FindTag(class TDesC8 const &)
+	?FindTag@CAlfFlowLayout@@UAEPAVCAlfVisual@@ABVTDesC8@@@Z @ 325 NONAME ; class CAlfVisual * CAlfFlowLayout::FindTag(class TDesC8 const &)
+	?FindTag@CAlfGridLayout@@UAEPAVCAlfVisual@@ABVTDesC8@@@Z @ 326 NONAME ; class CAlfVisual * CAlfGridLayout::FindTag(class TDesC8 const &)
+	?FindTag@CAlfImageVisual@@UAEPAVCAlfVisual@@ABVTDesC8@@@Z @ 327 NONAME ; class CAlfVisual * CAlfImageVisual::FindTag(class TDesC8 const &)
+	?FindTag@CAlfLCTAnchorLayout@@UAEPAVCAlfVisual@@ABVTDesC8@@@Z @ 328 NONAME ; class CAlfVisual * CAlfLCTAnchorLayout::FindTag(class TDesC8 const &)
+	?FindTag@CAlfLCTGridLayout@@UAEPAVCAlfVisual@@ABVTDesC8@@@Z @ 329 NONAME ; class CAlfVisual * CAlfLCTGridLayout::FindTag(class TDesC8 const &)
+	?FindTag@CAlfLCTTextVisual@@UAEPAVCAlfVisual@@ABVTDesC8@@@Z @ 330 NONAME ; class CAlfVisual * CAlfLCTTextVisual::FindTag(class TDesC8 const &)
+	?FindTag@CAlfLayout@@UAEPAVCAlfVisual@@ABVTDesC8@@@Z @ 331 NONAME ; class CAlfVisual * CAlfLayout::FindTag(class TDesC8 const &)
+	?FindTag@CAlfLineVisual@@UAEPAVCAlfVisual@@ABVTDesC8@@@Z @ 332 NONAME ; class CAlfVisual * CAlfLineVisual::FindTag(class TDesC8 const &)
+	?FindTag@CAlfMeshVisual@@UAEPAVCAlfVisual@@ABVTDesC8@@@Z @ 333 NONAME ; class CAlfVisual * CAlfMeshVisual::FindTag(class TDesC8 const &)
+	?FindTag@CAlfTextVisual@@UAEPAVCAlfVisual@@ABVTDesC8@@@Z @ 334 NONAME ; class CAlfVisual * CAlfTextVisual::FindTag(class TDesC8 const &)
+	?FindTag@CAlfViewportLayout@@UAEPAVCAlfVisual@@ABVTDesC8@@@Z @ 335 NONAME ; class CAlfVisual * CAlfViewportLayout::FindTag(class TDesC8 const &)
+	?FindTag@CAlfVisual@@UAEPAV1@ABVTDesC8@@@Z @ 336 NONAME ; class CAlfVisual * CAlfVisual::FindTag(class TDesC8 const &)
+	?FindVisual@CAlfLayout@@QBEHPAVCAlfVisual@@@Z @ 337 NONAME ; int CAlfLayout::FindVisual(class CAlfVisual *) const
+	?FindWidget@CAlfEnv@@QBEPAVIAlfWidget@Alf@@PBD@Z @ 338 NONAME ; class Alf::IAlfWidget * CAlfEnv::FindWidget(char const *) const
+	?Flags@CAlfVisual@@QBEIXZ @ 339 NONAME ; unsigned int CAlfVisual::Flags(void) const
+	?Flags@TAlfTimedValue@@QAEAAHXZ @ 340 NONAME ; int & TAlfTimedValue::Flags(void)
+	?FlagsToClear@TAlfVisualCommand@@QBEHXZ @ 341 NONAME ; int TAlfVisualCommand::FlagsToClear(void) const
+	?FlagsToSet@TAlfVisualCommand@@QBEHXZ @ 342 NONAME ; int TAlfVisualCommand::FlagsToSet(void) const
+	?Focus@CAlfControl@@QBEHXZ @ 343 NONAME ; int CAlfControl::Focus(void) const
+	?FocusChanged@CAlfControl@@UAEXAAVCAlfDisplay@@H@Z @ 344 NONAME ; void CAlfControl::FocusChanged(class CAlfDisplay &, int)
+	?FreeMemory@AlfUtil@@SAIPAI@Z @ 345 NONAME ; unsigned int AlfUtil::FreeMemory(unsigned int *)
+	?GrantAccessToPrivateFile@RAlfClientBase@@QAEHABVRFile@@HH@Z @ 346 NONAME ; int RAlfClientBase::GrantAccessToPrivateFile(class RFile const &, int, int)
+	?GrantAccessToPrivateFile@RAlfClientBase@@QAEHABVTDesC16@@HH@Z @ 347 NONAME ; int RAlfClientBase::GrantAccessToPrivateFile(class TDesC16 const &, int, int)
+	?HandleKeyEventL@CAlfEnv@@QAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@PAVCAlfDisplay@@@Z @ 348 NONAME ; enum TKeyResponse CAlfEnv::HandleKeyEventL(struct TKeyEvent const &, enum TEventCode, class CAlfDisplay *)
+	?HasContent@CAlfTexture@@QBEHXZ @ 349 NONAME ; int CAlfTexture::HasContent(void) const
+	?HasTexture@TAlfImage@@QBEHXZ @ 350 NONAME ; int TAlfImage::HasTexture(void) const
+	?Hide@CAlfRoster@@QAEXAAVCAlfControlGroup@@@Z @ 351 NONAME ; void CAlfRoster::Hide(class CAlfControlGroup &)
+	?HideVisual@CAlfRoster@@QAEXAAVCAlfVisual@@@Z @ 352 NONAME ; void CAlfRoster::HideVisual(class CAlfVisual &)
+	?HitTest@CAlfControl@@QBEHABVTPoint@@@Z @ 353 NONAME ; int CAlfControl::HitTest(class TPoint const &) const
+	?HorizontalInnerPadding@CAlfLayout@@QBEHXZ @ 354 NONAME ; int CAlfLayout::HorizontalInnerPadding(void) const
+	?HorizontalOrigin@CAlfVisual@@QBE?AW4TAlfVisualHOrigin@@XZ @ 355 NONAME ; enum TAlfVisualHOrigin CAlfVisual::HorizontalOrigin(void) const
+	?HorizontalPadding@CAlfVisual@@QBEHXZ @ 356 NONAME ; int CAlfVisual::HorizontalPadding(void) const
+	?Host@CAlfControl@@QBEPAV1@XZ @ 357 NONAME ; class CAlfControl * CAlfControl::Host(void) const
+	?HostChangingL@CAlfControl@@MAEXPAV1@@Z @ 358 NONAME ; void CAlfControl::HostChangingL(class CAlfControl *)
+	?HostId@CAlfControl@@QBEHXZ @ 359 NONAME ; int CAlfControl::HostId(void) const
+	?HostToDisplay@CAlfControl@@QBE?AVTPoint@@ABV2@@Z @ 360 NONAME ; class TPoint CAlfControl::HostToDisplay(class TPoint const &) const
+	?Id@CAlfControl@@QBEHXZ @ 361 NONAME ; int CAlfControl::Id(void) const
+	?Id@CAlfTextStyle@@QBEHXZ @ 362 NONAME ; int CAlfTextStyle::Id(void) const
+	?Id@CAlfTexture@@QBEHXZ @ 363 NONAME ; int CAlfTexture::Id(void) const
+	?Id@TAlfActionCommand@@QBEHXZ @ 364 NONAME ; int TAlfActionCommand::Id(void) const
+	?Id@TAlfMarkerCommand@@QBEHXZ @ 365 NONAME ; int TAlfMarkerCommand::Id(void) const
+	?Identifier@CAlfBrush@@QBEHXZ @ 366 NONAME ; int CAlfBrush::Identifier(void) const
+	?Identifier@CAlfControl@@QBEHXZ @ 367 NONAME ; int CAlfControl::Identifier(void) const
+	?Identifier@CAlfGenComponent@@QAEHXZ @ 368 NONAME ; int CAlfGenComponent::Identifier(void)
+	?Identifier@CAlfVisual@@QBEHXZ @ 369 NONAME ; int CAlfVisual::Identifier(void) const
+	?Image@CAlfBorderBrush@@QBEABVTAlfImage@@XZ @ 370 NONAME ; class TAlfImage const & CAlfBorderBrush::Image(void) const
+	?Image@CAlfGradientBrush@@QBEABVTAlfImage@@XZ @ 371 NONAME ; class TAlfImage const & CAlfGradientBrush::Image(void) const
+	?Image@CAlfImageBrush@@QBEABVTAlfImage@@XZ @ 372 NONAME ; class TAlfImage const & CAlfImageBrush::Image(void) const
+	?Image@CAlfImageVisual@@QBEABVTAlfImage@@XZ @ 373 NONAME ; class TAlfImage const & CAlfImageVisual::Image(void) const
+	?Image@CAlfLineVisual@@QBEABVTAlfImage@@XZ @ 374 NONAME ; class TAlfImage const & CAlfLineVisual::Image(void) const
+	?Image@CAlfMeshVisual@@QBEABVTAlfImage@@XZ @ 375 NONAME ; class TAlfImage const & CAlfMeshVisual::Image(void) const
+	?Image@TAlfImageCommand@@QBEABVTAlfImage@@XZ @ 376 NONAME ; class TAlfImage const & TAlfImageCommand::Image(void) const
+	?ImageOffset@CAlfBorderBrush@@QBEABVTAlfTimedPoint@@XZ @ 377 NONAME ; class TAlfTimedPoint const & CAlfBorderBrush::ImageOffset(void) const
+	?ImagePath@CAlfTextureManager@@QBEABVTDesC16@@XZ @ 378 NONAME ; class TDesC16 const & CAlfTextureManager::ImagePath(void) const
+	?ImageVisual@TAlfImageCommand@@QBEAAVCAlfImageVisual@@XZ @ 379 NONAME ; class CAlfImageVisual & TAlfImageCommand::ImageVisual(void) const
+	?InnerPadding@CAlfLayout@@QBE?AVTPoint@@XZ @ 380 NONAME ; class TPoint CAlfLayout::InnerPadding(void) const
+	?InnerPaddingAsMetric@CAlfLayout@@QBEABUTAlfXYMetric@@XZ @ 381 NONAME ; struct TAlfXYMetric const & CAlfLayout::InnerPaddingAsMetric(void) const
+	?InnerPaddingInBaseUnits@CAlfLayout@@QBE?AUTAlfRealPoint@@XZ @ 382 NONAME ; struct TAlfRealPoint CAlfLayout::InnerPaddingInBaseUnits(void) const
+	?Insert@CAlfLayout@@QAEHPAVCAlfVisual@@H@Z @ 383 NONAME ; int CAlfLayout::Insert(class CAlfVisual *, int)
+	?InsertL@CAlfBrushArray@@QAEXHPAVCAlfBrush@@W4TAlfOwnership@@@Z @ 384 NONAME ; void CAlfBrushArray::InsertL(int, class CAlfBrush *, enum TAlfOwnership)
+	?InsertWeightL@CAlfGridLayout@@QAEXW4TAlfGridDimension@@ABUTAlfMetric@@H@Z @ 385 NONAME ; void CAlfGridLayout::InsertWeightL(enum TAlfGridDimension, struct TAlfMetric const &, int)
+	?IntTarget@TAlfTimedPoint@@QBE?AVTPoint@@XZ @ 386 NONAME ; class TPoint TAlfTimedPoint::IntTarget(void) const
+	?IntValueNow@TAlfTimedPoint@@QBE?AVTPoint@@XZ @ 387 NONAME ; class TPoint TAlfTimedPoint::IntValueNow(void) const
+	?Interpolate@AlfUtil@@SAMMMM@Z @ 388 NONAME ; float AlfUtil::Interpolate(float, float, float)
+	?IsAnimated@CAlfTexture@@QBEHXZ @ 389 NONAME ; int CAlfTexture::IsAnimated(void) const
+	?IsBold@CAlfTextStyle@@QBEHXZ @ 390 NONAME ; int CAlfTextStyle::IsBold(void) const
+	?IsCustomEvent@TAlfEvent@@QBEHXZ @ 391 NONAME ; int TAlfEvent::IsCustomEvent(void) const
+	?IsFocusing@CAlfControl@@UBEHXZ @ 392 NONAME ; int CAlfControl::IsFocusing(void) const
+	?IsItalic@CAlfTextStyle@@QBEHXZ @ 393 NONAME ; int CAlfTextStyle::IsItalic(void) const
+	?IsKeyEvent@TAlfEvent@@QBEHXZ @ 394 NONAME ; int TAlfEvent::IsKeyEvent(void) const
+	?IsLoaded@CAlfTextureManager@@QBEHABVTDesC16@@@Z @ 395 NONAME ; int CAlfTextureManager::IsLoaded(class TDesC16 const &) const
+	?IsLoaded@CAlfTextureManager@@QBEHH@Z @ 396 NONAME ; int CAlfTextureManager::IsLoaded(int) const
+	?IsLoaded@CAlfTextureManager@@QBEHPBVCAlfTexture@@@Z @ 397 NONAME ; int CAlfTextureManager::IsLoaded(class CAlfTexture const *) const
+	?IsPointerEvent@TAlfEvent@@QBEHXZ @ 398 NONAME ; int TAlfEvent::IsPointerEvent(void) const
+	?IsScrollerEvent@TAlfEvent@@QBEHXZ @ 399 NONAME ; int TAlfEvent::IsScrollerEvent(void) const
+	?IsStrikeThrough@CAlfTextStyle@@QBEHXZ @ 400 NONAME ; int CAlfTextStyle::IsStrikeThrough(void) const
+	?IsTagged@CAlfVisual@@QBEHXZ @ 401 NONAME ; int CAlfVisual::IsTagged(void) const
+	?IsTransformed@CAlfControlGroup@@QBEHXZ @ 402 NONAME ; int CAlfControlGroup::IsTransformed(void) const
+	?IsUnderline@CAlfTextStyle@@QBEHXZ @ 403 NONAME ; int CAlfTextStyle::IsUnderline(void) const
+	?KeyEvent@TAlfEvent@@QBEABUTKeyEvent@@XZ @ 404 NONAME ; struct TKeyEvent const & TAlfEvent::KeyEvent(void) const
+	?LastReceivedPtrEvent@CAlfEnv@@QAEPAUTPointerEvent@@XZ @ 405 NONAME ; struct TPointerEvent * CAlfEnv::LastReceivedPtrEvent(void)
+	?LaunchAppL@RAlfClientBase@@IAEXVTUid@@IAAVTThreadId@@@Z @ 406 NONAME ; void RAlfClientBase::LaunchAppL(class TUid, unsigned int, class TThreadId &)
+	?Layout@CAlfVisual@@QBEPAVCAlfLayout@@XZ @ 407 NONAME ; class CAlfLayout * CAlfVisual::Layout(void) const
+	?LayoutMetricsUtility@CAlfEnv@@QAEPAVCAlfLayoutMetricsUtility@@XZ @ 408 NONAME ; class CAlfLayoutMetricsUtility * CAlfEnv::LayoutMetricsUtility(void)
+	?Length@CAlfCurvePath@@QBEMXZ @ 409 NONAME ; float CAlfCurvePath::Length(void) const
+	?LengthUnit@AlfUtil@@SAMXZ @ 410 NONAME ; float AlfUtil::LengthUnit(void)
+	?LoadIdentity@CAlfTransformation@@QAEXXZ @ 411 NONAME ; void CAlfTransformation::LoadIdentity(void)
+	?LoadSceneL@CAlfM3GMesh@@UAEXABVTDesC16@@@Z @ 412 NONAME ; void CAlfM3GMesh::LoadSceneL(class TDesC16 const &)
+	?LoadTextureL@CAlfTextureManager@@QAEAAVCAlfTexture@@ABVTDesC16@@VTSize@@W4TAlfTextureFlags@@H@Z @ 413 NONAME ; class CAlfTexture & CAlfTextureManager::LoadTextureL(class TDesC16 const &, class TSize, enum TAlfTextureFlags, int)
+	?LoadTextureL@CAlfTextureManager@@QAEAAVCAlfTexture@@ABVTDesC16@@W4TAlfTextureFlags@@H@Z @ 414 NONAME ; class CAlfTexture & CAlfTextureManager::LoadTextureL(class TDesC16 const &, enum TAlfTextureFlags, int)
+	?LoadTextureL@CAlfTextureManager@@QAEAAVCAlfTexture@@HVTSize@@W4TAlfTextureFlags@@@Z @ 415 NONAME ; class CAlfTexture & CAlfTextureManager::LoadTextureL(int, class TSize, enum TAlfTextureFlags)
+	?LocalToDisplay@CAlfVisual@@QBE?AUTAlfRealPoint@@ABU2@@Z @ 416 NONAME ; struct TAlfRealPoint CAlfVisual::LocalToDisplay(struct TAlfRealPoint const &) const
+	?LocalToDisplay@CAlfVisual@@QBE?AVTPoint@@ABV2@@Z @ 417 NONAME ; class TPoint CAlfVisual::LocalToDisplay(class TPoint const &) const
+	?Loop@CAlfCurvePath@@QBEHXZ @ 418 NONAME ; int CAlfCurvePath::Loop(void) const
+	?M3GMesh@CAlfMeshVisual@@QBEPAVCAlfM3GMesh@@XZ @ 419 NONAME ; class CAlfM3GMesh * CAlfMeshVisual::M3GMesh(void) const
+	?Magnitude@TAlfScrollerEvent@@QBEHXZ @ 420 NONAME ; int TAlfScrollerEvent::Magnitude(void) const
+	?MakeCubeL@CAlfProceduralMesh@@QAEXMMMM@Z @ 421 NONAME ; void CAlfProceduralMesh::MakeCubeL(float, float, float, float)
+	?MakeSphereL@CAlfProceduralMesh@@QAEXMHH@Z @ 422 NONAME ; void CAlfProceduralMesh::MakeSphereL(float, int, int)
+	?MakeTorusL@CAlfProceduralMesh@@QAEXMMHHM@Z @ 423 NONAME ; void CAlfProceduralMesh::MakeTorusL(float, float, int, int, float)
+	?MapValue@CAlfCurvePath@@UBEMMH@Z @ 424 NONAME ; float CAlfCurvePath::MapValue(float, int) const
+	?MapValue@CAlfCurvePathLayout@@UBEMMH@Z @ 425 NONAME ; float CAlfCurvePathLayout::MapValue(float, int) const
+	?MappingFunctionIdentifier@CAlfCurvePath@@UBEHXZ @ 426 NONAME ; int CAlfCurvePath::MappingFunctionIdentifier(void) const
+	?MappingFunctionIdentifier@CAlfCurvePathLayout@@UBEHXZ @ 427 NONAME ; int CAlfCurvePathLayout::MappingFunctionIdentifier(void) const
+	?MappingFunctionIdentifier@TAlfTimedValue@@QBEHXZ @ 428 NONAME ; int TAlfTimedValue::MappingFunctionIdentifier(void) const
+	?MarkVisual@CAlfLayoutMetricsUtility@@QAEXPAVTDesC16@@PAVCAlfTextVisual@@@Z @ 429 NONAME ; void CAlfLayoutMetricsUtility::MarkVisual(class TDesC16 *, class CAlfTextVisual *)
+	?Material@CAlfProceduralMesh@@QBEABUTAlfMaterial@@XZ @ 430 NONAME ; struct TAlfMaterial const & CAlfProceduralMesh::Material(void) const
+	?MaxLineCount@CAlfTextVisual@@QBEHXZ @ 431 NONAME ; int CAlfTextVisual::MaxLineCount(void) const
+	?MaxSize@CAlfVisual@@QBE?AVTSize@@XZ @ 432 NONAME ; class TSize CAlfVisual::MaxSize(void) const
+	?MaxTextureSize@CAlfTexture@@QAE?AVTSize@@XZ @ 433 NONAME ; class TSize CAlfTexture::MaxTextureSize(void)
+	?MeasureVisuals@CAlfLayoutMetricsUtility@@QAEXXZ @ 434 NONAME ; void CAlfLayoutMetricsUtility::MeasureVisuals(void)
+	?Mesh@CAlfMeshVisual@@QAEAAVCAlfMesh@@XZ @ 435 NONAME ; class CAlfMesh & CAlfMeshVisual::Mesh(void)
+	?MeshType@CAlfMesh@@QBEHXZ @ 436 NONAME ; int CAlfMesh::MeshType(void) const
+	?MilliSecondsUntilCommand@CAlfEnv@@QAEHPAX@Z @ 437 NONAME ; int CAlfEnv::MilliSecondsUntilCommand(void *)
+	?MilliSecondsUntilCommand@CAlfEnv@@QAEHPAXW4TAlfCommandType@@@Z @ 438 NONAME ; int CAlfEnv::MilliSecondsUntilCommand(void *, enum TAlfCommandType)
+	?MilliSecondsUntilCommand@CAlfEnv@@QAEHPAXW4TAlfOp@@@Z @ 439 NONAME ; int CAlfEnv::MilliSecondsUntilCommand(void *, enum TAlfOp)
+	?MilliSecondsUntilCustomCommand@CAlfEnv@@QAEHPAVMAlfEventHandler@@@Z @ 440 NONAME ; int CAlfEnv::MilliSecondsUntilCustomCommand(class MAlfEventHandler *)
+	?MilliSecondsUntilCustomCommand@CAlfEnv@@QAEHPAVMAlfEventHandler@@H@Z @ 441 NONAME ; int CAlfEnv::MilliSecondsUntilCustomCommand(class MAlfEventHandler *, int)
+	?Mimic@CAlfVisual@@QAEXAAV1@H@Z @ 442 NONAME ; void CAlfVisual::Mimic(class CAlfVisual &, int)
+	?MinSize@CAlfVisual@@QBE?AVTSize@@XZ @ 443 NONAME ; class TSize CAlfVisual::MinSize(void) const
+	?Mode@CAlfFlowLayout@@QBEHXZ @ 444 NONAME ; int CAlfFlowLayout::Mode(void) const
+	?Move@CAlfVisual@@QAEXABVTPoint@@H@Z @ 445 NONAME ; void CAlfVisual::Move(class TPoint const &, int)
+	?MoveToFront@CAlfVisual@@QAEXH@Z @ 446 NONAME ; void CAlfVisual::MoveToFront(int)
+	?MoveVisualToBack@CAlfLayout@@QAEXAAVCAlfVisual@@H@Z @ 447 NONAME ; void CAlfLayout::MoveVisualToBack(class CAlfVisual &, int)
+	?MoveVisualToFront@CAlfLayout@@QAEXAAVCAlfVisual@@H@Z @ 448 NONAME ; void CAlfLayout::MoveVisualToFront(class CAlfVisual &, int)
+	?MoveVisualToFront@CAlfRoster@@QAEXAAVCAlfVisual@@@Z @ 449 NONAME ; void CAlfRoster::MoveVisualToFront(class CAlfVisual &)
+	?NearestFontInTwipsL@AlfUtil@@SAPAVCFont@@ABVTFontSpec@@@Z @ 450 NONAME ; class CFont * AlfUtil::NearestFontInTwipsL(class TFontSpec const &)
+	?NewControlGroupL@CAlfEnv@@QAEAAVCAlfControlGroup@@H@Z @ 451 NONAME ; class CAlfControlGroup & CAlfEnv::NewControlGroupL(int)
+	?NewDisplayL@CAlfEnv@@QAEAAVCAlfDisplay@@ABVTRect@@HH@Z @ 452 NONAME ; class CAlfDisplay & CAlfEnv::NewDisplayL(class TRect const &, int, int)
+	?NewL@CAlfAverageMappingFunction@@SAPAV1@AAVCAlfEnv@@PAVMAlfMappingFunction@@1@Z @ 453 NONAME ; class CAlfAverageMappingFunction * CAlfAverageMappingFunction::NewL(class CAlfEnv &, class MAlfMappingFunction *, class MAlfMappingFunction *)
+	?NewL@CAlfBorderBrush@@SAPAV1@AAVCAlfEnv@@HHHH@Z @ 454 NONAME ; class CAlfBorderBrush * CAlfBorderBrush::NewL(class CAlfEnv &, int, int, int, int)
+	?NewL@CAlfConstantMappingFunction@@SAPAV1@AAVCAlfEnv@@M@Z @ 455 NONAME ; class CAlfConstantMappingFunction * CAlfConstantMappingFunction::NewL(class CAlfEnv &, float)
+	?NewL@CAlfCosineMappingFunction@@SAPAV1@AAVCAlfEnv@@MM@Z @ 456 NONAME ; class CAlfCosineMappingFunction * CAlfCosineMappingFunction::NewL(class CAlfEnv &, float, float)
+	?NewL@CAlfCurvePath@@SAPAV1@AAVCAlfEnv@@H@Z @ 457 NONAME ; class CAlfCurvePath * CAlfCurvePath::NewL(class CAlfEnv &, int)
+	?NewL@CAlfDropShadowBrush@@SAPAV1@AAVCAlfEnv@@H@Z @ 458 NONAME ; class CAlfDropShadowBrush * CAlfDropShadowBrush::NewL(class CAlfEnv &, int)
+	?NewL@CAlfFrameBrush@@SAPAV1@AAVCAlfEnv@@ABVTAknsItemID@@HH@Z @ 459 NONAME ; class CAlfFrameBrush * CAlfFrameBrush::NewL(class CAlfEnv &, class TAknsItemID const &, int, int)
+	?NewL@CAlfGenComponent@@SAPAV1@AAVCAlfEnv@@HHABVTDesC8@@@Z @ 460 NONAME ; class CAlfGenComponent * CAlfGenComponent::NewL(class CAlfEnv &, int, int, class TDesC8 const &)
+	?NewL@CAlfGradientBrush@@SAPAV1@AAVCAlfEnv@@@Z @ 461 NONAME ; class CAlfGradientBrush * CAlfGradientBrush::NewL(class CAlfEnv &)
+	?NewL@CAlfImageBrush@@SAPAV1@AAVCAlfEnv@@ABVTAlfImage@@@Z @ 462 NONAME ; class CAlfImageBrush * CAlfImageBrush::NewL(class CAlfEnv &, class TAlfImage const &)
+	?NewL@CAlfLinearMappingFunction@@SAPAV1@AAVCAlfEnv@@MM@Z @ 463 NONAME ; class CAlfLinearMappingFunction * CAlfLinearMappingFunction::NewL(class CAlfEnv &, float, float)
+	?NewL@CAlfShadowBorderBrush@@SAPAV1@AAVCAlfEnv@@H@Z @ 464 NONAME ; class CAlfShadowBorderBrush * CAlfShadowBorderBrush::NewL(class CAlfEnv &, int)
+	?NewL@CAlfSineMappingFunction@@SAPAV1@AAVCAlfEnv@@MM@Z @ 465 NONAME ; class CAlfSineMappingFunction * CAlfSineMappingFunction::NewL(class CAlfEnv &, float, float)
+	?NewL@CAlfStatic@@SAPAV1@PAVCAlfEnv@@@Z @ 466 NONAME ; class CAlfStatic * CAlfStatic::NewL(class CAlfEnv *)
+	?NewL@CAlfTableMappingFunction@@SAPAV1@AAVCAlfEnv@@@Z @ 467 NONAME ; class CAlfTableMappingFunction * CAlfTableMappingFunction::NewL(class CAlfEnv &)
+	?NewL@CAlfTransformation@@SAPAV1@AAVCAlfEnv@@@Z @ 468 NONAME ; class CAlfTransformation * CAlfTransformation::NewL(class CAlfEnv &)
+	?NewLC@CAlfBorderBrush@@SAPAV1@AAVCAlfEnv@@HHHH@Z @ 469 NONAME ; class CAlfBorderBrush * CAlfBorderBrush::NewLC(class CAlfEnv &, int, int, int, int)
+	?NewLC@CAlfCurvePath@@SAPAV1@AAVCAlfEnv@@H@Z @ 470 NONAME ; class CAlfCurvePath * CAlfCurvePath::NewLC(class CAlfEnv &, int)
+	?NewLC@CAlfDropShadowBrush@@SAPAV1@AAVCAlfEnv@@H@Z @ 471 NONAME ; class CAlfDropShadowBrush * CAlfDropShadowBrush::NewLC(class CAlfEnv &, int)
+	??0CAlfAnchorLayout@@QAE@XZ @ 472 NONAME ; CAlfAnchorLayout::CAlfAnchorLayout(void)
+	?NewLC@CAlfFrameBrush@@SAPAV1@AAVCAlfEnv@@ABVTAknsItemID@@HH@Z @ 473 NONAME ; class CAlfFrameBrush * CAlfFrameBrush::NewLC(class CAlfEnv &, class TAknsItemID const &, int, int)
+	?NewLC@CAlfGradientBrush@@SAPAV1@AAVCAlfEnv@@@Z @ 474 NONAME ; class CAlfGradientBrush * CAlfGradientBrush::NewLC(class CAlfEnv &)
+	?NewLC@CAlfImageBrush@@SAPAV1@AAVCAlfEnv@@ABVTAlfImage@@@Z @ 475 NONAME ; class CAlfImageBrush * CAlfImageBrush::NewLC(class CAlfEnv &, class TAlfImage const &)
+	?NewLC@CAlfShadowBorderBrush@@SAPAV1@AAVCAlfEnv@@H@Z @ 476 NONAME ; class CAlfShadowBorderBrush * CAlfShadowBorderBrush::NewLC(class CAlfEnv &, int)
+	?NewLC@CAlfStatic@@SAPAV1@PAVCAlfEnv@@@Z @ 477 NONAME ; class CAlfStatic * CAlfStatic::NewLC(class CAlfEnv *)
+	?NewLC@CAlfTransformation@@SAPAV1@AAVCAlfEnv@@@Z @ 478 NONAME ; class CAlfTransformation * CAlfTransformation::NewLC(class CAlfEnv &)
+	?NewLayoutL@AlfVisualFactory@@SAPAVCAlfLayout@@W4TAlfLayoutType@@PAV2@AAVCAlfControl@@AAVCAlfEnv@@H@Z @ 479 NONAME ; class CAlfLayout * AlfVisualFactory::NewLayoutL(enum TAlfLayoutType, class CAlfLayout *, class CAlfControl &, class CAlfEnv &, int)
+	?NewLayoutLC@AlfVisualFactory@@SAPAVCAlfLayout@@W4TAlfLayoutType@@PAV2@AAVCAlfControl@@AAVCAlfEnv@@H@Z @ 480 NONAME ; class CAlfLayout * AlfVisualFactory::NewLayoutLC(enum TAlfLayoutType, class CAlfLayout *, class CAlfControl &, class CAlfEnv &, int)
+	?NewVisualL@AlfVisualFactory@@SAPAVCAlfVisual@@W4TAlfVisualType@@PAVCAlfLayout@@AAVCAlfControl@@AAVCAlfEnv@@H@Z @ 481 NONAME ; class CAlfVisual * AlfVisualFactory::NewVisualL(enum TAlfVisualType, class CAlfLayout *, class CAlfControl &, class CAlfEnv &, int)
+	?NewVisualLC@AlfVisualFactory@@SAPAVCAlfVisual@@W4TAlfVisualType@@PAVCAlfLayout@@AAVCAlfControl@@AAVCAlfEnv@@H@Z @ 482 NONAME ; class CAlfVisual * AlfVisualFactory::NewVisualLC(enum TAlfVisualType, class CAlfLayout *, class CAlfControl &, class CAlfEnv &, int)
+	?NonIdentityCount@CAlfTransformation@@QBEHXZ @ 483 NONAME ; int CAlfTransformation::NonIdentityCount(void) const
+	?NormalFromPoints@AlfUtil@@SAXQAY02MQAM@Z @ 484 NONAME ; void AlfUtil::NormalFromPoints(float [3] * const, float * const)
+	?NotifyControlVisibility@CAlfControl@@MAEXHAAVCAlfDisplay@@@Z @ 485 NONAME ; void CAlfControl::NotifyControlVisibility(int, class CAlfDisplay &)
+	?NotifyLayoutChangedL@CAlfEnv@@QAEXXZ @ 486 NONAME ; void CAlfEnv::NotifyLayoutChangedL(void)
+	?NotifySkinChangedL@CAlfEnv@@QAEXXZ @ 487 NONAME ; void CAlfEnv::NotifySkinChangedL(void)
+	?Object@TAlfObjectCommand@@QBEPAXXZ @ 488 NONAME ; void * TAlfObjectCommand::Object(void) const
+	?ObjectCommand@TAlfCommand@@UBEPBVTAlfObjectCommand@@XZ @ 489 NONAME ; class TAlfObjectCommand const * TAlfCommand::ObjectCommand(void) const
+	?ObjectCommand@TAlfObjectCommand@@UBEPBV1@XZ @ 490 NONAME ; class TAlfObjectCommand const * TAlfObjectCommand::ObjectCommand(void) const
+	?ObjectProvider@CAlfDisplay@@QBEPAVMObjectProvider@@XZ @ 491 NONAME ; class MObjectProvider * CAlfDisplay::ObjectProvider(void) const
+	?OfferEventL@CAlfControl@@UAEHABVTAlfEvent@@@Z @ 492 NONAME ; int CAlfControl::OfferEventL(class TAlfEvent const &)
+	?Offset@CAlfCosineMappingFunction@@QBEMXZ @ 493 NONAME ; float CAlfCosineMappingFunction::Offset(void) const
+	?Offset@CAlfCurvePath@@QBEABVTAlfTimedPoint@@XZ @ 494 NONAME ; class TAlfTimedPoint const & CAlfCurvePath::Offset(void) const
+	?Offset@CAlfImageBrush@@QBEABVTAlfTimedPoint@@XZ @ 495 NONAME ; class TAlfTimedPoint const & CAlfImageBrush::Offset(void) const
+	?Offset@CAlfImageVisual@@QAE?AVTAlfTimedPoint@@XZ @ 496 NONAME ; class TAlfTimedPoint CAlfImageVisual::Offset(void)
+	?Offset@CAlfLinearMappingFunction@@QBEMXZ @ 497 NONAME ; float CAlfLinearMappingFunction::Offset(void) const
+	?Offset@CAlfSineMappingFunction@@QBEMXZ @ 498 NONAME ; float CAlfSineMappingFunction::Offset(void) const
+	?Opacity@CAlfBrush@@QBEABVTAlfTimedValue@@XZ @ 499 NONAME ; class TAlfTimedValue const & CAlfBrush::Opacity(void) const
+	?Opacity@CAlfGradientBrush@@QBEMH@Z @ 500 NONAME ; float CAlfGradientBrush::Opacity(int) const
+	?Opacity@CAlfVisual@@QBEABVTAlfTimedValue@@XZ @ 501 NONAME ; class TAlfTimedValue const & CAlfVisual::Opacity(void) const
+	?OpenL@RAlfClientBase@@QAEXXZ @ 502 NONAME ; void RAlfClientBase::OpenL(void)
+	?Operation@TAlfObjectCommand@@QBE?AW4TAlfOp@@XZ @ 503 NONAME ; enum TAlfOp TAlfObjectCommand::Operation(void) const
+	?OrdinalToBlock@CAlfGridLayout@@QBE?AVTPoint@@H@Z @ 504 NONAME ; class TPoint CAlfGridLayout::OrdinalToBlock(int) const
+	?Orientation@TAlfScrollerEvent@@QBE?AW4TOrientation@1@XZ @ 505 NONAME ; enum TAlfScrollerEvent::TOrientation TAlfScrollerEvent::Orientation(void) const
+	?Owner@CAlfVisual@@QBEAAVCAlfControl@@XZ @ 506 NONAME ; class CAlfControl & CAlfVisual::Owner(void) const
+	?Padding@CAlfVisual@@QBE?AVTPoint@@XZ @ 507 NONAME ; class TPoint CAlfVisual::Padding(void) const
+	?PaddingAsMetric@CAlfVisual@@QBEABUTAlfBoxMetric@@XZ @ 508 NONAME ; struct TAlfBoxMetric const & CAlfVisual::PaddingAsMetric(void) const
+	?PaddingInPixels@CAlfVisual@@QBE?AUTAlfRealRect@@XZ @ 509 NONAME ; struct TAlfRealRect CAlfVisual::PaddingInPixels(void) const
+	?Param@TAlfCustomEventCommand@@QBEHXZ @ 510 NONAME ; int TAlfCustomEventCommand::Param(void) const
+	?ParentId@CAlfTextStyle@@QBEHXZ @ 511 NONAME ; int CAlfTextStyle::ParentId(void) const
+	?Path@CAlfLineVisual@@QAEPAVCAlfCurvePath@@XZ @ 512 NONAME ; class CAlfCurvePath * CAlfLineVisual::Path(void)
+	?PauseRefresh@CAlfEnv@@QAEXXZ @ 513 NONAME ; void CAlfEnv::PauseRefresh(void)
+	?PitchAngle@CAlfMeshVisual@@QBE?AVTAlfTimedValue@@XZ @ 514 NONAME ; class TAlfTimedValue CAlfMeshVisual::PitchAngle(void) const
+	?PointerDown@TAlfEvent@@QBEHXZ @ 515 NONAME ; int TAlfEvent::PointerDown(void) const
+	?PointerEvent@TAlfEvent@@QBEABUTPointerEvent@@XZ @ 516 NONAME ; struct TPointerEvent const & TAlfEvent::PointerEvent(void) const
+	?PointerLongTap@TAlfEvent@@QBEHXZ @ 517 NONAME ; int TAlfEvent::PointerLongTap(void) const
+	?PointerUp@TAlfEvent@@QBEHXZ @ 518 NONAME ; int TAlfEvent::PointerUp(void) const
+	?Pos@CAlfVisual@@QBE?AVTAlfTimedPoint@@XZ @ 519 NONAME ; class TAlfTimedPoint CAlfVisual::Pos(void) const
+	?Power2@AlfUtil@@SAHH@Z @ 520 NONAME ; int AlfUtil::Power2(int)
+	?Power2RoundDown@AlfUtil@@SAHH@Z @ 521 NONAME ; int AlfUtil::Power2RoundDown(int)
+	?PrependImagePath@CAlfTextureManager@@QAEXAAVTDes16@@@Z @ 522 NONAME ; void CAlfTextureManager::PrependImagePath(class TDes16 &)
+	?PrimaryDisplay@CAlfEnv@@QBEAAVCAlfDisplay@@XZ @ 523 NONAME ; class CAlfDisplay & CAlfEnv::PrimaryDisplay(void) const
+	?Priority@CAlfTexture@@QBEHXZ @ 524 NONAME ; int CAlfTexture::Priority(void) const
+	?ProceduralMesh@CAlfMeshVisual@@QBEPAVCAlfProceduralMesh@@XZ @ 525 NONAME ; class CAlfProceduralMesh * CAlfMeshVisual::ProceduralMesh(void) const
+	?Processor@CAlfTextureManager@@QAEAAVCAlfTextureProcessor@@XZ @ 526 NONAME ; class CAlfTextureProcessor & CAlfTextureManager::Processor(void)
+	?PropertyClear@CAlfPropertyOwner@@QAEXXZ @ 527 NONAME ; void CAlfPropertyOwner::PropertyClear(void)
+	?PropertyFindInteger@CAlfPropertyOwner@@QBEHABVTDesC8@@PAH@Z @ 528 NONAME ; int CAlfPropertyOwner::PropertyFindInteger(class TDesC8 const &, int *) const
+	?PropertyFindString@CAlfPropertyOwner@@QBEHABVTDesC8@@PAPAVTDesC16@@@Z @ 529 NONAME ; int CAlfPropertyOwner::PropertyFindString(class TDesC8 const &, class TDesC16 * *) const
+	?PropertyOwnerExtension@CAlfAnchorLayout@@MAEXABVTUid@@PAPAX@Z @ 530 NONAME ; void CAlfAnchorLayout::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfBrush@@MAEXABVTUid@@PAPAX@Z @ 531 NONAME ; void CAlfBrush::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfControl@@MAEXABVTUid@@PAPAX@Z @ 532 NONAME ; void CAlfControl::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfCurvePathLayout@@MAEXABVTUid@@PAPAX@Z @ 533 NONAME ; void CAlfCurvePathLayout::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfDeckLayout@@MAEXABVTUid@@PAPAX@Z @ 534 NONAME ; void CAlfDeckLayout::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfFlowLayout@@MAEXABVTUid@@PAPAX@Z @ 535 NONAME ; void CAlfFlowLayout::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfGridLayout@@MAEXABVTUid@@PAPAX@Z @ 536 NONAME ; void CAlfGridLayout::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfImageVisual@@MAEXABVTUid@@PAPAX@Z @ 537 NONAME ; void CAlfImageVisual::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfLCTAnchorLayout@@MAEXABVTUid@@PAPAX@Z @ 538 NONAME ; void CAlfLCTAnchorLayout::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfLCTGridLayout@@MAEXABVTUid@@PAPAX@Z @ 539 NONAME ; void CAlfLCTGridLayout::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfLCTTextVisual@@MAEXABVTUid@@PAPAX@Z @ 540 NONAME ; void CAlfLCTTextVisual::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfLayout@@MAEXABVTUid@@PAPAX@Z @ 541 NONAME ; void CAlfLayout::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfLineVisual@@MAEXABVTUid@@PAPAX@Z @ 542 NONAME ; void CAlfLineVisual::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfMeshVisual@@MAEXABVTUid@@PAPAX@Z @ 543 NONAME ; void CAlfMeshVisual::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfPropertyOwner@@MAEXABVTUid@@PAPAX@Z @ 544 NONAME ; void CAlfPropertyOwner::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfTextVisual@@MAEXABVTUid@@PAPAX@Z @ 545 NONAME ; void CAlfTextVisual::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfViewportLayout@@MAEXABVTUid@@PAPAX@Z @ 546 NONAME ; void CAlfViewportLayout::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyOwnerExtension@CAlfVisual@@MAEXABVTUid@@PAPAX@Z @ 547 NONAME ; void CAlfVisual::PropertyOwnerExtension(class TUid const &, void * *)
+	?PropertyRemove@CAlfPropertyOwner@@QAEHABVTDesC8@@@Z @ 548 NONAME ; int CAlfPropertyOwner::PropertyRemove(class TDesC8 const &)
+	?PropertySetIntegerL@CAlfPropertyOwner@@QAEHABVTDesC8@@HHH@Z @ 549 NONAME ; int CAlfPropertyOwner::PropertySetIntegerL(class TDesC8 const &, int, int, int)
+	?PropertySetStringL@CAlfPropertyOwner@@QAEHABVTDesC8@@ABVTDesC16@@@Z @ 550 NONAME ; int CAlfPropertyOwner::PropertySetStringL(class TDesC8 const &, class TDesC16 const &)
+	?Quality@CAlfDisplay@@QBE?AW4TAlfQuality@@XZ @ 551 NONAME ; enum TAlfQuality CAlfDisplay::Quality(void) const
+	?QuickLength@AlfUtil@@SAMAAUTAlfRealPoint@@@Z @ 552 NONAME ; float AlfUtil::QuickLength(struct TAlfRealPoint &)
+	?QuickLength@AlfUtil@@SAMMM@Z @ 553 NONAME ; float AlfUtil::QuickLength(float, float)
+	?QuickNormalize@AlfUtil@@SAXAAUTAlfRealPoint@@@Z @ 554 NONAME ; void AlfUtil::QuickNormalize(struct TAlfRealPoint &)
+	?QuickNormalize@AlfUtil@@SAXQAM@Z @ 555 NONAME ; void AlfUtil::QuickNormalize(float * const)
+	?RandomInt@AlfUtil@@SAHHH@Z @ 556 NONAME ; int AlfUtil::RandomInt(int, int)
+	?RandomReal@AlfUtil@@SAMMM@Z @ 557 NONAME ; float AlfUtil::RandomReal(float, float)
+	?Recipient@TAlfCustomEventCommand@@QBEPAVMAlfEventHandler@@XZ @ 558 NONAME ; class MAlfEventHandler * TAlfCustomEventCommand::Recipient(void) const
+	?RefreshCallBack@CAlfEnv@@SAHPAX@Z @ 559 NONAME ; int CAlfEnv::RefreshCallBack(void *)
+	?RefreshMode@CAlfEnv@@QAE?AW4TAlfRefreshMode@@XZ @ 560 NONAME ; enum TAlfRefreshMode CAlfEnv::RefreshMode(void)
+	?Release@CAlfEnv@@QAEXH@Z @ 561 NONAME ; void CAlfEnv::Release(int)
+	?ReleaseFont@AlfUtil@@SAXPAVCFont@@@Z @ 562 NONAME ; void AlfUtil::ReleaseFont(class CFont *)
+	?RelinquishFocus@CAlfControl@@QAEXXZ @ 563 NONAME ; void CAlfControl::RelinquishFocus(void)
+	?Remove@CAlfBrushArray@@QAEXH@Z @ 564 NONAME ; void CAlfBrushArray::Remove(int)
+	?Remove@CAlfControl@@QAEXPAVCAlfVisual@@@Z @ 565 NONAME ; void CAlfControl::Remove(class CAlfVisual *)
+	?Remove@CAlfControlGroup@@QAEHPAVCAlfControl@@@Z @ 566 NONAME ; int CAlfControlGroup::Remove(class CAlfControl *)
+	?Remove@CAlfLayout@@QAEXPAVCAlfVisual@@H@Z @ 567 NONAME ; void CAlfLayout::Remove(class CAlfVisual *, int)
+	?RemoveActionObserver@CAlfEnv@@QAEXPAVMAlfActionObserver@@@Z @ 568 NONAME ; void CAlfEnv::RemoveActionObserver(class MAlfActionObserver *)
+	?RemoveAnchor@CAlfAnchorLayout@@QAEXW4TAlfAnchor@@H@Z @ 569 NONAME ; void CAlfAnchorLayout::RemoveAnchor(enum TAlfAnchor, int)
+	?RemoveAndDestroyAllD@CAlfAnchorLayout@@UAEXXZ @ 570 NONAME ; void CAlfAnchorLayout::RemoveAndDestroyAllD(void)
+	?RemoveAndDestroyAllD@CAlfCurvePathLayout@@UAEXXZ @ 571 NONAME ; void CAlfCurvePathLayout::RemoveAndDestroyAllD(void)
+	?RemoveAndDestroyAllD@CAlfDeckLayout@@UAEXXZ @ 572 NONAME ; void CAlfDeckLayout::RemoveAndDestroyAllD(void)
+	?RemoveAndDestroyAllD@CAlfFlowLayout@@UAEXXZ @ 573 NONAME ; void CAlfFlowLayout::RemoveAndDestroyAllD(void)
+	?RemoveAndDestroyAllD@CAlfGridLayout@@UAEXXZ @ 574 NONAME ; void CAlfGridLayout::RemoveAndDestroyAllD(void)
+	?RemoveAndDestroyAllD@CAlfImageVisual@@UAEXXZ @ 575 NONAME ; void CAlfImageVisual::RemoveAndDestroyAllD(void)
+	?RemoveAndDestroyAllD@CAlfLCTAnchorLayout@@UAEXXZ @ 576 NONAME ; void CAlfLCTAnchorLayout::RemoveAndDestroyAllD(void)
+	?RemoveAndDestroyAllD@CAlfLCTGridLayout@@UAEXXZ @ 577 NONAME ; void CAlfLCTGridLayout::RemoveAndDestroyAllD(void)
+	?RemoveAndDestroyAllD@CAlfLCTTextVisual@@UAEXXZ @ 578 NONAME ; void CAlfLCTTextVisual::RemoveAndDestroyAllD(void)
+	?RemoveAndDestroyAllD@CAlfLayout@@UAEXXZ @ 579 NONAME ; void CAlfLayout::RemoveAndDestroyAllD(void)
+	?RemoveAndDestroyAllD@CAlfLineVisual@@UAEXXZ @ 580 NONAME ; void CAlfLineVisual::RemoveAndDestroyAllD(void)
+	?RemoveAndDestroyAllD@CAlfMeshVisual@@UAEXXZ @ 581 NONAME ; void CAlfMeshVisual::RemoveAndDestroyAllD(void)
+	?RemoveAndDestroyAllD@CAlfTextVisual@@UAEXXZ @ 582 NONAME ; void CAlfTextVisual::RemoveAndDestroyAllD(void)
+	?RemoveAndDestroyAllD@CAlfViewportLayout@@UAEXXZ @ 583 NONAME ; void CAlfViewportLayout::RemoveAndDestroyAllD(void)
+	?RemoveAndDestroyAllD@CAlfVisual@@UAEXXZ @ 584 NONAME ; void CAlfVisual::RemoveAndDestroyAllD(void)
+	?RemoveConnection@CAlfControl@@QAEXPAV1@@Z @ 585 NONAME ; void CAlfControl::RemoveConnection(class CAlfControl *)
+	?RemoveLoadObserver@CAlfTextureManager@@QAEXPAVMAlfTextureLoadingCompletedObserver@@@Z @ 586 NONAME ; void CAlfTextureManager::RemoveLoadObserver(class MAlfTextureLoadingCompletedObserver *)
+	?RemovePointerEventObserver@CAlfRoster@@QAEHW4TAlfPointerEventFlags@@AAVCAlfControl@@@Z @ 587 NONAME ; int CAlfRoster::RemovePointerEventObserver(enum TAlfPointerEventFlags, class CAlfControl &)
+	?RemoveStateObserver@CAlfTextureManager@@QAEXPAVMAlfTextureManagerStateChangedObserver@@@Z @ 588 NONAME ; void CAlfTextureManager::RemoveStateObserver(class MAlfTextureManagerStateChangedObserver *)
+	?RemoveWeightL@CAlfGridLayout@@QAEXW4TAlfGridDimension@@H@Z @ 589 NONAME ; void CAlfGridLayout::RemoveWeightL(enum TAlfGridDimension, int)
+	?Renderer@CAlfEnv@@QBE?AW4TAlfRenderer@@XZ @ 590 NONAME ; enum TAlfRenderer CAlfEnv::Renderer(void) const
+	?Reorder@CAlfLayout@@QAEXAAVCAlfVisual@@HH@Z @ 591 NONAME ; void CAlfLayout::Reorder(class CAlfVisual &, int, int)
+	?ReplaceStep@CAlfTransformation@@QAEXHUTTransform@1@@Z @ 592 NONAME ; void CAlfTransformation::ReplaceStep(int, struct CAlfTransformation::TTransform)
+	?ReplaceWeightL@CAlfGridLayout@@QAEXW4TAlfGridDimension@@ABUTAlfMetric@@H@Z @ 593 NONAME ; void CAlfGridLayout::ReplaceWeightL(enum TAlfGridDimension, struct TAlfMetric const &, int)
+	?Reset@CAlfAnchorLayout@@QAEXXZ @ 594 NONAME ; void CAlfAnchorLayout::Reset(void)
+	?Reset@CAlfBrushArray@@QAEXXZ @ 595 NONAME ; void CAlfBrushArray::Reset(void)
+	?Reset@CAlfCurvePath@@QAEXXZ @ 596 NONAME ; void CAlfCurvePath::Reset(void)
+	?Reset@CAlfMesh@@QAEXXZ @ 597 NONAME ; void CAlfMesh::Reset(void)
+	?ResourceId@CAlfControlGroup@@QBEHXZ @ 598 NONAME ; int CAlfControlGroup::ResourceId(void) const
+	?RestoreL@CAlfEnv@@QAEXXZ @ 599 NONAME ; void CAlfEnv::RestoreL(void)
+	?Role@CAlfControl@@QBEHXZ @ 600 NONAME ; int CAlfControl::Role(void) const
+	?Roster@CAlfDisplay@@QAEAAVCAlfRoster@@XZ @ 601 NONAME ; class CAlfRoster & CAlfDisplay::Roster(void)
+	?Roster@CAlfDisplay@@QBEABVCAlfRoster@@XZ @ 602 NONAME ; class CAlfRoster const & CAlfDisplay::Roster(void) const
+	?Rotate@CAlfTransformation@@QAEXABVTAlfTimedValue@@@Z @ 603 NONAME ; void CAlfTransformation::Rotate(class TAlfTimedValue const &)
+	?Rotate@CAlfTransformation@@QAEXABVTAlfTimedValue@@MMM@Z @ 604 NONAME ; void CAlfTransformation::Rotate(class TAlfTimedValue const &, float, float, float)
+	?Rotate@CAlfTransformation@@QAEXM@Z @ 605 NONAME ; void CAlfTransformation::Rotate(float)
+	?Rotate@CAlfTransformation@@QAEXMMMM@Z @ 606 NONAME ; void CAlfTransformation::Rotate(float, float, float, float)
+	?RowCount@CAlfGridLayout@@QBEHXZ @ 607 NONAME ; int CAlfGridLayout::RowCount(void) const
+	?Scale@CAlfImageBrush@@QBEABVTAlfTimedValue@@XZ @ 608 NONAME ; class TAlfTimedValue const & CAlfImageBrush::Scale(void) const
+	?Scale@CAlfImageVisual@@QAE?AVTAlfTimedValue@@XZ @ 609 NONAME ; class TAlfTimedValue CAlfImageVisual::Scale(void)
+	?Scale@CAlfMeshVisual@@QBE?AVTAlfTimedValue@@XZ @ 610 NONAME ; class TAlfTimedValue CAlfMeshVisual::Scale(void) const
+	?Scale@CAlfTransformation@@QAEXABVTAlfTimedValue@@00@Z @ 611 NONAME ; void CAlfTransformation::Scale(class TAlfTimedValue const &, class TAlfTimedValue const &, class TAlfTimedValue const &)
+	?Scale@CAlfTransformation@@QAEXABVTAlfTimedValue@@0@Z @ 612 NONAME ; void CAlfTransformation::Scale(class TAlfTimedValue const &, class TAlfTimedValue const &)
+	?Scale@CAlfTransformation@@QAEXMM@Z @ 613 NONAME ; void CAlfTransformation::Scale(float, float)
+	?Scale@CAlfTransformation@@QAEXMMM@Z @ 614 NONAME ; void CAlfTransformation::Scale(float, float, float)
+	?Scale@TAlfImage@@QAEXMMH@Z @ 615 NONAME ; void TAlfImage::Scale(float, float, int)
+	?ScaleFbsBitmapL@AlfUtil@@SAXABVCFbsBitmap@@AAV2@@Z @ 616 NONAME ; void AlfUtil::ScaleFbsBitmapL(class CFbsBitmap const &, class CFbsBitmap &)
+	?ScaleImage@AlfUtil@@SAXHABVTSize@@PBE0PAE@Z @ 617 NONAME ; void AlfUtil::ScaleImage(int, class TSize const &, unsigned char const *, class TSize const &, unsigned char *)
+	?ScaleUniformly@CAlfMesh@@QAEXMMM@Z @ 618 NONAME ; void CAlfMesh::ScaleUniformly(float, float, float)
+	?ScreenSize@AlfUtil@@SA?AVTSize@@XZ @ 619 NONAME ; class TSize AlfUtil::ScreenSize(void)
+	?ScrollOffset@CAlfLayout@@QBEABVTAlfTimedPoint@@XZ @ 620 NONAME ; class TAlfTimedPoint const & CAlfLayout::ScrollOffset(void) const
+	?ScrollerEvent@TAlfEvent@@QBE?AVTAlfScrollerEvent@@XZ @ 621 NONAME ; class TAlfScrollerEvent TAlfEvent::ScrollerEvent(void) const
+	?Scrolling@CAlfLayout@@QBEHXZ @ 622 NONAME ; int CAlfLayout::Scrolling(void) const
+	?SecondaryAlpha@CAlfImageVisual@@QAE?AVTAlfTimedValue@@XZ @ 623 NONAME ; class TAlfTimedValue CAlfImageVisual::SecondaryAlpha(void)
+	?SecondaryAlpha@CAlfMeshVisual@@QBE?AVTAlfTimedValue@@XZ @ 624 NONAME ; class TAlfTimedValue CAlfMeshVisual::SecondaryAlpha(void) const
+	?SecondaryImage@CAlfImageVisual@@QBEABVTAlfImage@@XZ @ 625 NONAME ; class TAlfImage const & CAlfImageVisual::SecondaryImage(void) const
+	?SecondaryImage@CAlfMeshVisual@@QBEABVTAlfImage@@XZ @ 626 NONAME ; class TAlfImage const & CAlfMeshVisual::SecondaryImage(void) const
+	?Send@CAlfEnv@@QAEHABVTAlfCommand@@H@Z @ 627 NONAME ; int CAlfEnv::Send(class TAlfCommand const &, int)
+	?ServerHandle@CAlfTexture@@QBEHXZ @ 628 NONAME ; int CAlfTexture::ServerHandle(void) const
+	?ServiceUid@RAlfClientBase@@UBE?AVTUid@@XZ @ 629 NONAME ; class TUid RAlfClientBase::ServiceUid(void) const
+	?SetAcceptInput@CAlfControlGroup@@QAEXH@Z @ 630 NONAME ; void CAlfControlGroup::SetAcceptInput(int)
+	?SetAlign@CAlfTextVisual@@QAEXW4TAlfAlignHorizontal@@W4TAlfAlignVertical@@@Z @ 631 NONAME ; void CAlfTextVisual::SetAlign(enum TAlfAlignHorizontal, enum TAlfAlignVertical)
+	?SetAlphaFunction@CAlfLineVisual@@QAEXPAVMAlfMappingFunction@@@Z @ 632 NONAME ; void CAlfLineVisual::SetAlphaFunction(class MAlfMappingFunction *)
+	?SetAnchor@CAlfAnchorLayout@@QAEHW4TAlfAnchor@@HW4TAlfAnchorOrigin@@1W4TAlfAnchorMetric@@2ABVTAlfTimedPoint@@@Z @ 633 NONAME ; int CAlfAnchorLayout::SetAnchor(enum TAlfAnchor, int, enum TAlfAnchorOrigin, enum TAlfAnchorOrigin, enum TAlfAnchorMetric, enum TAlfAnchorMetric, class TAlfTimedPoint const &)
+	?SetAnchors@CAlfLCTAnchorLayout@@QAEXHAAVTAknLayoutHierarchyComponentHandle@@ABVTAlfTimedPoint@@@Z @ 634 NONAME ; void CAlfLCTAnchorLayout::SetAnchors(int, class TAknLayoutHierarchyComponentHandle &, class TAlfTimedPoint const &)
+	?SetAngle@TAlfTransformationCommand@@QAEXABVTAlfTimedValue@@@Z @ 635 NONAME ; void TAlfTransformationCommand::SetAngle(class TAlfTimedValue const &)
+	?SetAnimationPosition@CAlfMesh@@UAEXHMH@Z @ 636 NONAME ; void CAlfMesh::SetAnimationPosition(int, float, int)
+	?SetAutomaticTextureIdRange@CAlfTextureManager@@QAEXHH@Z @ 637 NONAME ; void CAlfTextureManager::SetAutomaticTextureIdRange(int, int)
+	?SetBaseUnit@CAlfLayout@@QAEXABUTAlfMetric@@@Z @ 638 NONAME ; void CAlfLayout::SetBaseUnit(struct TAlfMetric const &)
+	?SetBaseUnit@CAlfLayout@@QAEXABUTAlfXYMetric@@@Z @ 639 NONAME ; void CAlfLayout::SetBaseUnit(struct TAlfXYMetric const &)
+	?SetBold@CAlfTextStyle@@QAEXH@Z @ 640 NONAME ; void CAlfTextStyle::SetBold(int)
+	?SetBorders@CAlfImageBrush@@QAEXHHHH@Z @ 641 NONAME ; void CAlfImageBrush::SetBorders(int, int, int, int)
+	?SetCenteredPosAndSize@CAlfVisual@@QAEXABVTPoint@@ABVTSize@@H@Z @ 642 NONAME ; void CAlfVisual::SetCenteredPosAndSize(class TPoint const &, class TSize const &, int)
+	?SetCentering@CAlfFlowLayout@@QAEXH@Z @ 643 NONAME ; void CAlfFlowLayout::SetCentering(int)
+	?SetClearBackgroundL@CAlfDisplay@@QAEXH@Z @ 644 NONAME ; void CAlfDisplay::SetClearBackgroundL(int)
+	?SetClipping@CAlfVisual@@QAEXH@Z @ 645 NONAME ; void CAlfVisual::SetClipping(int)
+	?SetColor@CAlfBorderBrush@@QAEXABVTRgb@@@Z @ 646 NONAME ; void CAlfBorderBrush::SetColor(class TRgb const &)
+	?SetColor@CAlfGradientBrush@@QAEXABVTRgb@@M@Z @ 647 NONAME ; void CAlfGradientBrush::SetColor(class TRgb const &, float)
+	?SetColor@CAlfImageVisual@@QAEXABVTRgb@@@Z @ 648 NONAME ; void CAlfImageVisual::SetColor(class TRgb const &)
+	?SetColor@CAlfTextVisual@@QAEXABVTAknsItemID@@H@Z @ 649 NONAME ; void CAlfTextVisual::SetColor(class TAknsItemID const &, int)
+	?SetColor@CAlfTextVisual@@QAEXVTRgb@@@Z @ 650 NONAME ; void CAlfTextVisual::SetColor(class TRgb)
+	?SetColorMode@CAlfImageVisual@@QAEXW4TColorMode@1@M@Z @ 651 NONAME ; void CAlfImageVisual::SetColorMode(enum CAlfImageVisual::TColorMode, float)
+	?SetColsAndRows@CAlfLCTGridLayout@@QAEXAAVTAknLayoutHierarchyComponentHandle@@ABVTAlfTimedPoint@@@Z @ 652 NONAME ; void CAlfLCTGridLayout::SetColsAndRows(class TAknLayoutHierarchyComponentHandle &, class TAlfTimedPoint const &)
+	?SetColumnsL@CAlfGridLayout@@QAEXABV?$RArray@H@@@Z @ 653 NONAME ; void CAlfGridLayout::SetColumnsL(class RArray<int> const &)
+	?SetColumnsL@CAlfGridLayout@@QAEXH@Z @ 654 NONAME ; void CAlfGridLayout::SetColumnsL(int)
+	?SetDepth@CAlfDropShadowBrush@@QAEXABVTAlfTimedValue@@@Z @ 655 NONAME ; void CAlfDropShadowBrush::SetDepth(class TAlfTimedValue const &)
+	?SetDepthOffset@CAlfVisual@@QAEXABVTAlfTimedValue@@@Z @ 656 NONAME ; void CAlfVisual::SetDepthOffset(class TAlfTimedValue const &)
+	?SetDirection@CAlfGradientBrush@@QAEXW4TDirection@1@@Z @ 657 NONAME ; void CAlfGradientBrush::SetDirection(enum CAlfGradientBrush::TDirection)
+	?SetDirty@CAlfDisplay@@QAEXXZ @ 658 NONAME ; void CAlfDisplay::SetDirty(void)
+	?SetDropShadow@CAlfImageVisual@@QAEXH@Z @ 659 NONAME ; void CAlfImageVisual::SetDropShadow(int)
+	?SetEdgeOffset@CAlfBorderBrush@@QAEXABVTAlfTimedPoint@@@Z @ 660 NONAME ; void CAlfBorderBrush::SetEdgeOffset(class TAlfTimedPoint const &)
+	?SetEndPos@CAlfLineVisual@@QAEXABVTAlfTimedValue@@@Z @ 661 NONAME ; void CAlfLineVisual::SetEndPos(class TAlfTimedValue const &)
+	?SetExpanding@CAlfGridLayout@@QAEXH@Z @ 662 NONAME ; void CAlfGridLayout::SetExpanding(int)
+	?SetFactor@CAlfCosineMappingFunction@@QAEXM@Z @ 663 NONAME ; void CAlfCosineMappingFunction::SetFactor(float)
+	?SetFactor@CAlfLinearMappingFunction@@QAEXM@Z @ 664 NONAME ; void CAlfLinearMappingFunction::SetFactor(float)
+	?SetFactor@CAlfSineMappingFunction@@QAEXM@Z @ 665 NONAME ; void CAlfSineMappingFunction::SetFactor(float)
+	?SetFlag@CAlfVisual@@QAEXW4TAlfVisualFlags@@@Z @ 666 NONAME ; void CAlfVisual::SetFlag(enum TAlfVisualFlags)
+	?SetFlags@CAlfVisual@@QAEXI@Z @ 667 NONAME ; void CAlfVisual::SetFlags(unsigned int)
+	?SetFlowDirection@CAlfFlowLayout@@QAEXW4TFlowDirection@1@@Z @ 668 NONAME ; void CAlfFlowLayout::SetFlowDirection(enum CAlfFlowLayout::TFlowDirection)
+	?SetFocus@CAlfRoster@@QAEXAAVCAlfControl@@@Z @ 669 NONAME ; void CAlfRoster::SetFocus(class CAlfControl &)
+	?SetFocusedEditor@CAlfDisplay@@QAEXPAVMAlfInputCapabilitiesSupplier@@@Z @ 670 NONAME ; void CAlfDisplay::SetFocusedEditor(class MAlfInputCapabilitiesSupplier *)
+	?SetFrameRectsL@CAlfFrameBrush@@QAEXABVTRect@@0@Z @ 671 NONAME ; void CAlfFrameBrush::SetFrameRectsL(class TRect const &, class TRect const &)
+	?SetFullScreenDrawing@CAlfEnv@@QAEXH@Z @ 672 NONAME ; void CAlfEnv::SetFullScreenDrawing(int)
+	?SetHost@CAlfControl@@QAEXPAV1@@Z @ 673 NONAME ; void CAlfControl::SetHost(class CAlfControl *)
+	?SetHostId@CAlfControl@@QAEXH@Z @ 674 NONAME ; void CAlfControl::SetHostId(int)
+	?SetId@CAlfControl@@QAEXH@Z @ 675 NONAME ; void CAlfControl::SetId(int)
+	?SetIdleThreshold@CAlfEnv@@QAEXH@Z @ 676 NONAME ; void CAlfEnv::SetIdleThreshold(int)
+	?SetImage@CAlfBorderBrush@@QAEXABVTAlfImage@@@Z @ 677 NONAME ; void CAlfBorderBrush::SetImage(class TAlfImage const &)
+	?SetImage@CAlfGradientBrush@@QAEXABVTAlfImage@@@Z @ 678 NONAME ; void CAlfGradientBrush::SetImage(class TAlfImage const &)
+	?SetImage@CAlfImageBrush@@QAEXABVTAlfImage@@@Z @ 679 NONAME ; void CAlfImageBrush::SetImage(class TAlfImage const &)
+	?SetImage@CAlfImageVisual@@QAEXABVTAlfImage@@@Z @ 680 NONAME ; void CAlfImageVisual::SetImage(class TAlfImage const &)
+	?SetImage@CAlfLineVisual@@QAEXABVTAlfImage@@@Z @ 681 NONAME ; void CAlfLineVisual::SetImage(class TAlfImage const &)
+	?SetImage@CAlfMeshVisual@@QAEXABVTAlfImage@@@Z @ 682 NONAME ; void CAlfMeshVisual::SetImage(class TAlfImage const &)
+	?SetImageOffset@CAlfBorderBrush@@QAEXABVTAlfTimedPoint@@@Z @ 683 NONAME ; void CAlfBorderBrush::SetImageOffset(class TAlfTimedPoint const &)
+	?SetImagePathL@CAlfTextureManager@@QAEXABVTDesC16@@@Z @ 684 NONAME ; void CAlfTextureManager::SetImagePathL(class TDesC16 const &)
+	?SetInnerPadding@CAlfLayout@@QAEXABUTAlfXYMetric@@@Z @ 685 NONAME ; void CAlfLayout::SetInnerPadding(struct TAlfXYMetric const &)
+	?SetInnerPadding@CAlfLayout@@QAEXABVTPoint@@@Z @ 686 NONAME ; void CAlfLayout::SetInnerPadding(class TPoint const &)
+	?SetItalic@CAlfTextStyle@@QAEXH@Z @ 687 NONAME ; void CAlfTextStyle::SetItalic(int)
+	?SetLayer@CAlfBrush@@QAEXW4TAlfBrushLayer@@@Z @ 688 NONAME ; void CAlfBrush::SetLayer(enum TAlfBrushLayer)
+	?SetLineSpacing@CAlfTextVisual@@QAEXHW4TLineSpacingUnits@1@@Z @ 689 NONAME ; void CAlfTextVisual::SetLineSpacing(int, enum CAlfTextVisual::TLineSpacingUnits)
+	?SetMappingFunction1@CAlfAverageMappingFunction@@QAEXPAVMAlfMappingFunction@@@Z @ 690 NONAME ; void CAlfAverageMappingFunction::SetMappingFunction1(class MAlfMappingFunction *)
+	?SetMappingFunction2@CAlfAverageMappingFunction@@QAEXPAVMAlfMappingFunction@@@Z @ 691 NONAME ; void CAlfAverageMappingFunction::SetMappingFunction2(class MAlfMappingFunction *)
+	?SetMappingFunctionIdentifier@TAlfTimedPoint@@QAEXH@Z @ 692 NONAME ; void TAlfTimedPoint::SetMappingFunctionIdentifier(int)
+	?SetMappingFunctionIdentifier@TAlfTimedValue@@QAEXH@Z @ 693 NONAME ; void TAlfTimedValue::SetMappingFunctionIdentifier(int)
+	?SetMappingFunctions@CAlfAverageMappingFunction@@QAEXPAVMAlfMappingFunction@@0@Z @ 694 NONAME ; void CAlfAverageMappingFunction::SetMappingFunctions(class MAlfMappingFunction *, class MAlfMappingFunction *)
+	?SetMappingTableValues@CAlfTableMappingFunction@@QAEXMMPAVMAlfTableMappingFunctionDataProvider@@@Z @ 695 NONAME ; void CAlfTableMappingFunction::SetMappingTableValues(float, float, class MAlfTableMappingFunctionDataProvider *)
+	?SetMaterial@CAlfProceduralMesh@@QAEXABUTAlfMaterial@@@Z @ 696 NONAME ; void CAlfProceduralMesh::SetMaterial(struct TAlfMaterial const &)
+	?SetMaxFrameRate@CAlfEnv@@QAEXM@Z @ 697 NONAME ; void CAlfEnv::SetMaxFrameRate(float)
+	?SetMaxLineCount@CAlfTextVisual@@QAEXH@Z @ 698 NONAME ; void CAlfTextVisual::SetMaxLineCount(int)
+	?SetMaxSize@CAlfVisual@@QAEXABVTSize@@@Z @ 699 NONAME ; void CAlfVisual::SetMaxSize(class TSize const &)
+	?SetMinSize@CAlfVisual@@QAEXABVTSize@@@Z @ 700 NONAME ; void CAlfVisual::SetMinSize(class TSize const &)
+	?SetMode@CAlfFlowLayout@@QAEXH@Z @ 701 NONAME ; void CAlfFlowLayout::SetMode(int)
+	?SetOffset@CAlfCosineMappingFunction@@QAEXM@Z @ 702 NONAME ; void CAlfCosineMappingFunction::SetOffset(float)
+	?SetOffset@CAlfCurvePath@@QAEXABVTAlfTimedPoint@@@Z @ 703 NONAME ; void CAlfCurvePath::SetOffset(class TAlfTimedPoint const &)
+	?SetOffset@CAlfImageBrush@@QAEXABVTAlfTimedPoint@@@Z @ 704 NONAME ; void CAlfImageBrush::SetOffset(class TAlfTimedPoint const &)
+	?SetOffset@CAlfImageVisual@@QAEXABVTAlfTimedPoint@@@Z @ 705 NONAME ; void CAlfImageVisual::SetOffset(class TAlfTimedPoint const &)
+	?SetOffset@CAlfLinearMappingFunction@@QAEXM@Z @ 706 NONAME ; void CAlfLinearMappingFunction::SetOffset(float)
+	?SetOffset@CAlfSineMappingFunction@@QAEXM@Z @ 707 NONAME ; void CAlfSineMappingFunction::SetOffset(float)
+	?SetOpacity@CAlfBrush@@QAEXABVTAlfTimedValue@@@Z @ 708 NONAME ; void CAlfBrush::SetOpacity(class TAlfTimedValue const &)
+	?SetOpacity@CAlfVisual@@QAEXABVTAlfTimedValue@@@Z @ 709 NONAME ; void CAlfVisual::SetOpacity(class TAlfTimedValue const &)
+	?SetOrigin@CAlfCurvePath@@QAEXM@Z @ 710 NONAME ; void CAlfCurvePath::SetOrigin(float)
+	?SetOrigin@CAlfVisual@@QAEXW4TAlfVisualHOrigin@@W4TAlfVisualVOrigin@@@Z @ 711 NONAME ; void CAlfVisual::SetOrigin(enum TAlfVisualHOrigin, enum TAlfVisualVOrigin)
+	?SetOwner@CAlfVisual@@QAEXAAVCAlfControl@@@Z @ 712 NONAME ; void CAlfVisual::SetOwner(class CAlfControl &)
+	?SetPadding@CAlfVisual@@QAEXABUTAlfBoxMetric@@@Z @ 713 NONAME ; void CAlfVisual::SetPadding(struct TAlfBoxMetric const &)
+	?SetPadding@CAlfVisual@@QAEXABVTPoint@@@Z @ 714 NONAME ; void CAlfVisual::SetPadding(class TPoint const &)
+	?SetPadding@CAlfVisual@@QAEXH@Z @ 715 NONAME ; void CAlfVisual::SetPadding(int)
+	?SetParentId@CAlfTextStyle@@QAEXH@Z @ 716 NONAME ; void CAlfTextStyle::SetParentId(int)
+	?SetPath@CAlfLineVisual@@QAEXPAVCAlfCurvePath@@W4TAlfOwnership@@@Z @ 717 NONAME ; void CAlfLineVisual::SetPath(class CAlfCurvePath *, enum TAlfOwnership)
+	?SetPitchAngle@CAlfMeshVisual@@QAEXABVTAlfTimedValue@@@Z @ 718 NONAME ; void CAlfMeshVisual::SetPitchAngle(class TAlfTimedValue const &)
+	?SetPointerEventObservers@CAlfRoster@@QAEHIAAVCAlfControl@@@Z @ 719 NONAME ; int CAlfRoster::SetPointerEventObservers(unsigned int, class CAlfControl &)
+	?SetPos@CAlfVisual@@QAEXABUTAlfRealPoint@@H@Z @ 720 NONAME ; void CAlfVisual::SetPos(struct TAlfRealPoint const &, int)
+	?SetPos@CAlfVisual@@QAEXABVTAlfTimedPoint@@@Z @ 721 NONAME ; void CAlfVisual::SetPos(class TAlfTimedPoint const &)
+	?SetPriority@CAlfTexture@@QAEXH@Z @ 722 NONAME ; void CAlfTexture::SetPriority(int)
+	?SetQuality@CAlfDisplay@@QAEXW4TAlfQuality@@@Z @ 723 NONAME ; void CAlfDisplay::SetQuality(enum TAlfQuality)
+	?SetRect@CAlfVisual@@QAEXABUTAlfRealRect@@H@Z @ 724 NONAME ; void CAlfVisual::SetRect(struct TAlfRealRect const &, int)
+	?SetRefreshMode@CAlfEnv@@QAEXW4TAlfRefreshMode@@@Z @ 725 NONAME ; void CAlfEnv::SetRefreshMode(enum TAlfRefreshMode)
+	?SetRelativeAnchorRect@CAlfAnchorLayout@@QAEHHW4TAlfAnchorOrigin@@0ABUTAlfRealPoint@@001@Z @ 726 NONAME ; int CAlfAnchorLayout::SetRelativeAnchorRect(int, enum TAlfAnchorOrigin, enum TAlfAnchorOrigin, struct TAlfRealPoint const &, enum TAlfAnchorOrigin, enum TAlfAnchorOrigin, struct TAlfRealPoint const &)
+	?SetRole@CAlfControl@@QAEXH@Z @ 727 NONAME ; void CAlfControl::SetRole(int)
+	?SetRowsL@CAlfGridLayout@@QAEXABV?$RArray@H@@@Z @ 728 NONAME ; void CAlfGridLayout::SetRowsL(class RArray<int> const &)
+	?SetRowsL@CAlfGridLayout@@QAEXH@Z @ 729 NONAME ; void CAlfGridLayout::SetRowsL(int)
+	?SetScale@CAlfImageBrush@@QAEXABVTAlfTimedValue@@@Z @ 730 NONAME ; void CAlfImageBrush::SetScale(class TAlfTimedValue const &)
+	?SetScale@CAlfImageVisual@@QAEXABVTAlfTimedValue@@@Z @ 731 NONAME ; void CAlfImageVisual::SetScale(class TAlfTimedValue const &)
+	?SetScale@CAlfMeshVisual@@QAEXABVTAlfTimedValue@@@Z @ 732 NONAME ; void CAlfMeshVisual::SetScale(class TAlfTimedValue const &)
+	?SetScaleMode@CAlfImageBrush@@QAEXW4TScaleMode@CAlfImageVisual@@@Z @ 733 NONAME ; void CAlfImageBrush::SetScaleMode(enum CAlfImageVisual::TScaleMode)
+	?SetScaleMode@CAlfImageVisual@@QAEXW4TScaleMode@1@@Z @ 734 NONAME ; void CAlfImageVisual::SetScaleMode(enum CAlfImageVisual::TScaleMode)
+	?SetScrollOffset@CAlfLayout@@QAEXABVTAlfTimedPoint@@@Z @ 735 NONAME ; void CAlfLayout::SetScrollOffset(class TAlfTimedPoint const &)
+	?SetSecondaryAlpha@CAlfImageVisual@@QAEXABVTAlfTimedValue@@@Z @ 736 NONAME ; void CAlfImageVisual::SetSecondaryAlpha(class TAlfTimedValue const &)
+	?SetSecondaryAlpha@CAlfMeshVisual@@QAEXABVTAlfTimedValue@@@Z @ 737 NONAME ; void CAlfMeshVisual::SetSecondaryAlpha(class TAlfTimedValue const &)
+	?SetSecondaryImage@CAlfImageVisual@@QAEXABVTAlfImage@@@Z @ 738 NONAME ; void CAlfImageVisual::SetSecondaryImage(class TAlfImage const &)
+	?SetSecondaryImage@CAlfMeshVisual@@QAEXABVTAlfImage@@@Z @ 739 NONAME ; void CAlfMeshVisual::SetSecondaryImage(class TAlfImage const &)
+	?SetShadowOpacity@CAlfTextVisual@@QAEXABVTAlfTimedValue@@@Z @ 740 NONAME ; void CAlfTextVisual::SetShadowOpacity(class TAlfTimedValue const &)
+	?SetShadowThickness@CAlfLineVisual@@QAEXABVTAlfTimedValue@@@Z @ 741 NONAME ; void CAlfLineVisual::SetShadowThickness(class TAlfTimedValue const &)
+	?SetSize@CAlfImageLoaderUtil@@QAEXVTSize@@W4TScaleMode@@@Z @ 742 NONAME ; void CAlfImageLoaderUtil::SetSize(class TSize, enum TScaleMode)
+	?SetSize@CAlfVisual@@QAEXABUTAlfRealSize@@H@Z @ 743 NONAME ; void CAlfVisual::SetSize(struct TAlfRealSize const &, int)
+	?SetSize@CAlfVisual@@QAEXABVTAlfTimedPoint@@@Z @ 744 NONAME ; void CAlfVisual::SetSize(class TAlfTimedPoint const &)
+	?SetSkinInstance@CAlfImageLoaderUtil@@QAEXPAVMAknsSkinInstance@@@Z @ 745 NONAME ; void CAlfImageLoaderUtil::SetSkinInstance(class MAknsSkinInstance *)
+	?SetSoftness@CAlfDropShadowBrush@@QAEXABVTAlfTimedValue@@@Z @ 746 NONAME ; void CAlfDropShadowBrush::SetSoftness(class TAlfTimedValue const &)
+	?SetSpecularImage@CAlfMeshVisual@@QAEXABVTAlfImage@@@Z @ 747 NONAME ; void CAlfMeshVisual::SetSpecularImage(class TAlfImage const &)
+	?SetStartPos@CAlfLineVisual@@QAEXABVTAlfTimedValue@@@Z @ 748 NONAME ; void CAlfLineVisual::SetStartPos(class TAlfTimedValue const &)
+	?SetStretch@CAlfImageVisual@@QAEXHH@Z @ 749 NONAME ; void CAlfImageVisual::SetStretch(int, int)
+	?SetStretchMode@CAlfImageVisual@@QAEXW4TStretchMode@CAlfGc@@@Z @ 750 NONAME ; void CAlfImageVisual::SetStretchMode(enum CAlfGc::TStretchMode)
+	?SetStrikeThrough@CAlfTextStyle@@QAEXH@Z @ 751 NONAME ; void CAlfTextStyle::SetStrikeThrough(int)
+	?SetStyle@CAlfTextVisual@@QAEXW4TAlfPreconfiguredTextStyle@@W4TAlfBackgroundType@@@Z @ 752 NONAME ; void CAlfTextVisual::SetStyle(enum TAlfPreconfiguredTextStyle, enum TAlfBackgroundType)
+	?SetStyle@TAlfTimedPoint@@QAEXW4TAlfInterpolationStyle@@@Z @ 753 NONAME ; void TAlfTimedPoint::SetStyle(enum TAlfInterpolationStyle)
+	?SetStyle@TAlfTimedValue@@QAEXW4TAlfInterpolationStyle@@@Z @ 754 NONAME ; void TAlfTimedValue::SetStyle(enum TAlfInterpolationStyle)
+	?SetTagL@CAlfVisual@@QAEXABVTDesC8@@@Z @ 755 NONAME ; void CAlfVisual::SetTagL(class TDesC8 const &)
+	?SetTarget@TAlfTimedPoint@@QAEXABUTAlfRealPoint@@H@Z @ 756 NONAME ; void TAlfTimedPoint::SetTarget(struct TAlfRealPoint const &, int)
+	?SetTarget@TAlfTimedPoint@@QAEXMH@Z @ 757 NONAME ; void TAlfTimedPoint::SetTarget(float, int)
+	?SetTarget@TAlfTimedValue@@QAEXABMH@Z @ 758 NONAME ; void TAlfTimedValue::SetTarget(float const &, int)
+	?SetTargetWithSpeed@TAlfTimedPoint@@QAEXABUTAlfRealPoint@@M@Z @ 759 NONAME ; void TAlfTimedPoint::SetTargetWithSpeed(struct TAlfRealPoint const &, float)
+	?SetTargetWithSpeed@TAlfTimedPoint@@QAEXMM@Z @ 760 NONAME ; void TAlfTimedPoint::SetTargetWithSpeed(float, float)
+	?SetTargetWithSpeed@TAlfTimedValue@@QAEXMM@Z @ 761 NONAME ; void TAlfTimedValue::SetTargetWithSpeed(float, float)
+	?SetTexCoords@TAlfImage@@QAEXMMMMH@Z @ 762 NONAME ; void TAlfImage::SetTexCoords(float, float, float, float, int)
+	?SetTextColor@CAlfTextStyle@@QAEXABVTRgb@@@Z @ 763 NONAME ; void CAlfTextStyle::SetTextColor(class TRgb const &)
+	?SetTextL@CAlfTextVisual@@QAEXABVTDesC16@@@Z @ 764 NONAME ; void CAlfTextVisual::SetTextL(class TDesC16 const &)
+	?SetTextPane@CAlfLCTTextVisual@@QAEXAAVTAknLayoutHierarchyComponentHandle@@@Z @ 765 NONAME ; void CAlfLCTTextVisual::SetTextPane(class TAknLayoutHierarchyComponentHandle &)
+	?SetTextSizeInPixels@CAlfTextStyle@@QAEXHH@Z @ 766 NONAME ; void CAlfTextStyle::SetTextSizeInPixels(int, int)
+	?SetTextSizeInTwips@CAlfTextStyle@@QAEXHH@Z @ 767 NONAME ; void CAlfTextStyle::SetTextSizeInTwips(int, int)
+	?SetTextStyle@CAlfTextVisual@@QAEXH@Z @ 768 NONAME ; void CAlfTextVisual::SetTextStyle(int)
+	?SetTexture@TAlfImage@@QAEXAAVCAlfTexture@@@Z @ 769 NONAME ; void TAlfImage::SetTexture(class CAlfTexture &)
+	?SetThickness@CAlfBorderBrush@@QAEXABVTAlfTimedPoint@@@Z @ 770 NONAME ; void CAlfBorderBrush::SetThickness(class TAlfTimedPoint const &)
+	?SetThickness@CAlfLineVisual@@QAEXABVTAlfTimedValue@@@Z @ 771 NONAME ; void CAlfLineVisual::SetThickness(class TAlfTimedValue const &)
+	?SetTransitionTime@CAlfLayout@@QAEXH@Z @ 772 NONAME ; void CAlfLayout::SetTransitionTime(int)
+	?SetTurnAngle@CAlfImageVisual@@QAEXABVTAlfTimedValue@@@Z @ 773 NONAME ; void CAlfImageVisual::SetTurnAngle(class TAlfTimedValue const &)
+	?SetUnderline@CAlfTextStyle@@QAEXH@Z @ 774 NONAME ; void CAlfTextStyle::SetUnderline(int)
+	?SetUsageL@CAlfDisplay@@QAEXI@Z @ 775 NONAME ; void CAlfDisplay::SetUsageL(unsigned int)
+	?SetUseDepth@CAlfDisplay@@QAEXH@Z @ 776 NONAME ; void CAlfDisplay::SetUseDepth(int)
+	?SetValue@CAlfConstantMappingFunction@@QAEXM@Z @ 777 NONAME ; void CAlfConstantMappingFunction::SetValue(float)
+	?SetValueNow@TAlfTimedValue@@QAEXABM@Z @ 778 NONAME ; void TAlfTimedValue::SetValueNow(float const &)
+	?SetViewportPos@CAlfViewportLayout@@QAEXABUTAlfRealPoint@@H@Z @ 779 NONAME ; void CAlfViewportLayout::SetViewportPos(struct TAlfRealPoint const &, int)
+	?SetViewportSize@CAlfViewportLayout@@QAEXABUTAlfRealSize@@H@Z @ 780 NONAME ; void CAlfViewportLayout::SetViewportSize(struct TAlfRealSize const &, int)
+	?SetVirtualSize@CAlfViewportLayout@@QAEXABUTAlfRealSize@@H@Z @ 781 NONAME ; void CAlfViewportLayout::SetVirtualSize(struct TAlfRealSize const &, int)
+	?SetVisibleArea@CAlfDisplay@@QAEXABVTRect@@@Z @ 782 NONAME ; void CAlfDisplay::SetVisibleArea(class TRect const &)
+	?SetVisual@TAlfEvent@@QAEXPAVCAlfVisual@@@Z @ 783 NONAME ; void TAlfEvent::SetVisual(class CAlfVisual *)
+	?SetWeight@CAlfAverageMappingFunction@@QAEXABVTAlfTimedValue@@@Z @ 784 NONAME ; void CAlfAverageMappingFunction::SetWeight(class TAlfTimedValue const &)
+	?SetWidth@CAlfShadowBorderBrush@@QAEXABVTAlfTimedValue@@@Z @ 785 NONAME ; void CAlfShadowBorderBrush::SetWidth(class TAlfTimedValue const &)
+	?SetWidthFunction@CAlfLineVisual@@QAEXPAVMAlfMappingFunction@@@Z @ 786 NONAME ; void CAlfLineVisual::SetWidthFunction(class MAlfMappingFunction *)
+	?SetWrapping@CAlfTextVisual@@QAEXW4TLineWrap@1@@Z @ 787 NONAME ; void CAlfTextVisual::SetWrapping(enum CAlfTextVisual::TLineWrap)
+	?SetX@TAlfTransformationCommand@@QAEXABVTAlfTimedValue@@@Z @ 788 NONAME ; void TAlfTransformationCommand::SetX(class TAlfTimedValue const &)
+	?SetY@TAlfTransformationCommand@@QAEXABVTAlfTimedValue@@@Z @ 789 NONAME ; void TAlfTransformationCommand::SetY(class TAlfTimedValue const &)
+	?SetYawAngle@CAlfMeshVisual@@QAEXABVTAlfTimedValue@@@Z @ 790 NONAME ; void CAlfMeshVisual::SetYawAngle(class TAlfTimedValue const &)
+	?SetZ@TAlfTransformationCommand@@QAEXABVTAlfTimedValue@@@Z @ 791 NONAME ; void TAlfTransformationCommand::SetZ(class TAlfTimedValue const &)
+	?ShadowMatrix@AlfUtil@@SAXQBM00QAM@Z @ 792 NONAME ; void AlfUtil::ShadowMatrix(float const * const, float const * const, float const * const, float * const)
+	?ShadowOpacity@CAlfTextVisual@@QAE?AVTAlfTimedValue@@XZ @ 793 NONAME ; class TAlfTimedValue CAlfTextVisual::ShadowOpacity(void)
+	?ShadowThickness@CAlfLineVisual@@QBEABVTAlfTimedValue@@XZ @ 794 NONAME ; class TAlfTimedValue const & CAlfLineVisual::ShadowThickness(void) const
+	?SharedTextureManager@CAlfEnv@@QBEPAVCAlfTextureManager@@VTUid@@@Z @ 795 NONAME ; class CAlfTextureManager * CAlfEnv::SharedTextureManager(class TUid) const
+	?ShowL@CAlfControl@@QAEXAAVCAlfDisplay@@@Z @ 796 NONAME ; void CAlfControl::ShowL(class CAlfDisplay &)
+	?ShowL@CAlfRoster@@QAEXAAVCAlfControlGroup@@H@Z @ 797 NONAME ; void CAlfRoster::ShowL(class CAlfControlGroup &, int)
+	?ShowVisualL@CAlfRoster@@QAEXAAVCAlfVisual@@@Z @ 798 NONAME ; void CAlfRoster::ShowVisualL(class CAlfVisual &)
+	?Size@CAlfTexture@@QBE?AVTSize@@XZ @ 799 NONAME ; class TSize CAlfTexture::Size(void) const
+	?Size@CAlfVisual@@QBE?BVTAlfTimedPoint@@XZ @ 800 NONAME ; class TAlfTimedPoint const CAlfVisual::Size(void) const
+	?Size@TAlfActionCommand@@UBEHXZ @ 801 NONAME ; int TAlfActionCommand::Size(void) const
+	?Size@TAlfControlCommand@@UBEHXZ @ 802 NONAME ; int TAlfControlCommand::Size(void) const
+	?Size@TAlfCustomEventCommand@@UBEHXZ @ 803 NONAME ; int TAlfCustomEventCommand::Size(void) const
+	?Size@TAlfGroupCommand@@UBEHXZ @ 804 NONAME ; int TAlfGroupCommand::Size(void) const
+	?Size@TAlfImageCommand@@UBEHXZ @ 805 NONAME ; int TAlfImageCommand::Size(void) const
+	?Size@TAlfMarkerCommand@@UBEHXZ @ 806 NONAME ; int TAlfMarkerCommand::Size(void) const
+	?Size@TAlfObjectCommand@@UBEHXZ @ 807 NONAME ; int TAlfObjectCommand::Size(void) const
+	?Size@TAlfPointCommand@@UBEHXZ @ 808 NONAME ; int TAlfPointCommand::Size(void) const
+	?Size@TAlfTextCommand@@UBEHXZ @ 809 NONAME ; int TAlfTextCommand::Size(void) const
+	?Size@TAlfTransformationCommand@@UBEHXZ @ 810 NONAME ; int TAlfTransformationCommand::Size(void) const
+	?Size@TAlfValueCommand@@UBEHXZ @ 811 NONAME ; int TAlfValueCommand::Size(void) const
+	?Size@TAlfVisualCommand@@UBEHXZ @ 812 NONAME ; int TAlfVisualCommand::Size(void) const
+	?Softness@CAlfDropShadowBrush@@QBEABVTAlfTimedValue@@XZ @ 813 NONAME ; class TAlfTimedValue const & CAlfDropShadowBrush::Softness(void) const
+	?SpecularImage@CAlfMeshVisual@@QBEABVTAlfImage@@XZ @ 814 NONAME ; class TAlfImage const & CAlfMeshVisual::SpecularImage(void) const
+	?Speed@TAlfPointCommand@@QBEMXZ @ 815 NONAME ; float TAlfPointCommand::Speed(void) const
+	?Speed@TAlfTimedValue@@QBEMXZ @ 816 NONAME ; float TAlfTimedValue::Speed(void) const
+	?Speed@TAlfValueCommand@@QBEMXZ @ 817 NONAME ; float TAlfValueCommand::Speed(void) const
+	?StartAnimation@CAlfTexture@@QAEXXZ @ 818 NONAME ; void CAlfTexture::StartAnimation(void)
+	?StartAnimationController@CAlfMesh@@UAEXH@Z @ 819 NONAME ; void CAlfMesh::StartAnimationController(int)
+	?StartPos@CAlfLineVisual@@QBEABVTAlfTimedValue@@XZ @ 820 NONAME ; class TAlfTimedValue const & CAlfLineVisual::StartPos(void) const
+	?StartServerL@RAlfClientBase@@IAEIVTUid@@@Z @ 821 NONAME ; unsigned int RAlfClientBase::StartServerL(class TUid)
+	?Static@CAlfEnv@@SAPAV1@XZ @ 822 NONAME ; class CAlfEnv * CAlfEnv::Static(void)
+	?Step@CAlfTransformation@@QAE?AUTTransform@1@H@Z @ 823 NONAME ; struct CAlfTransformation::TTransform CAlfTransformation::Step(int)
+	?Step@TAlfTransformationCommand@@QBEHXZ @ 824 NONAME ; int TAlfTransformationCommand::Step(void) const
+	?StopAnimation@CAlfTexture@@QAEXXZ @ 825 NONAME ; void CAlfTexture::StopAnimation(void)
+	?StopAnimationController@CAlfMesh@@UAEXH@Z @ 826 NONAME ; void CAlfMesh::StopAnimationController(int)
+	?StretchUniformly@CAlfMesh@@QAEXMMMMMM@Z @ 827 NONAME ; void CAlfMesh::StretchUniformly(float, float, float, float, float, float)
+	?Style@CAlfTextVisual@@QAE?AW4TAlfPreconfiguredTextStyle@@XZ @ 828 NONAME ; enum TAlfPreconfiguredTextStyle CAlfTextVisual::Style(void)
+	?Style@TAlfTimedValue@@QAE?AW4TAlfInterpolationStyle@@XZ @ 829 NONAME ; enum TAlfInterpolationStyle TAlfTimedValue::Style(void)
+	?SubstringExtents@CAlfTextVisual@@QBE?AVTRect@@II@Z @ 830 NONAME ; class TRect CAlfTextVisual::SubstringExtents(unsigned int, unsigned int) const
+	?Tag@CAlfVisual@@QBEABVTDesC8@@XZ @ 831 NONAME ; class TDesC8 const & CAlfVisual::Tag(void) const
+	?TagMatches@AlfUtil@@SAHABVTDesC8@@0@Z @ 832 NONAME ; int AlfUtil::TagMatches(class TDesC8 const &, class TDesC8 const &)
+	?Target@TAlfPointCommand@@QBE?AUTAlfRealPoint@@XZ @ 833 NONAME ; struct TAlfRealPoint TAlfPointCommand::Target(void) const
+	?Target@TAlfTimedValue@@QBEMXZ @ 834 NONAME ; float TAlfTimedValue::Target(void) const
+	?Target@TAlfValueCommand@@QBEMXZ @ 835 NONAME ; float TAlfValueCommand::Target(void) const
+	?Text@CAlfTextVisual@@QBEABVTDesC16@@XZ @ 836 NONAME ; class TDesC16 const & CAlfTextVisual::Text(void) const
+	?Text@TAlfTextCommand@@QBEABVTDesC16@@XZ @ 837 NONAME ; class TDesC16 const & TAlfTextCommand::Text(void) const
+	?TextColor@CAlfTextStyle@@QBE?AVTRgb@@XZ @ 838 NONAME ; class TRgb CAlfTextStyle::TextColor(void) const
+	?TextExtents@CAlfTextVisual@@QBE?AVTSize@@XZ @ 839 NONAME ; class TSize CAlfTextVisual::TextExtents(void) const
+	?TextSizeInPixels@CAlfTextStyle@@QBEHH@Z @ 840 NONAME ; int CAlfTextStyle::TextSizeInPixels(int) const
+	?TextSizeInTwips@CAlfTextStyle@@QBEHH@Z @ 841 NONAME ; int CAlfTextStyle::TextSizeInTwips(int) const
+	?TextStyle@CAlfTextStyleManager@@QAEPAVCAlfTextStyle@@H@Z @ 842 NONAME ; class CAlfTextStyle * CAlfTextStyleManager::TextStyle(int)
+	?TextStyleManager@CAlfEnv@@QBEAAVCAlfTextStyleManager@@XZ @ 843 NONAME ; class CAlfTextStyleManager & CAlfEnv::TextStyleManager(void) const
+	?TextVisual@TAlfTextCommand@@QBEAAVCAlfTextVisual@@XZ @ 844 NONAME ; class CAlfTextVisual & TAlfTextCommand::TextVisual(void) const
+	?Texture@CAlfTextureManager@@QBEPBVCAlfTexture@@H@Z @ 845 NONAME ; class CAlfTexture const * CAlfTextureManager::Texture(int) const
+	?Texture@TAlfImage@@QBEABVCAlfTexture@@XZ @ 846 NONAME ; class CAlfTexture const & TAlfImage::Texture(void) const
+	?TextureL@CAlfTextureManager@@QAEPAVCAlfTexture@@H@Z @ 847 NONAME ; class CAlfTexture * CAlfTextureManager::TextureL(int)
+	?TextureManager@CAlfEnv@@QBEAAVCAlfTextureManager@@XZ @ 848 NONAME ; class CAlfTextureManager & CAlfEnv::TextureManager(void) const
+	?Thickness@CAlfBorderBrush@@QBEABVTAlfTimedPoint@@XZ @ 849 NONAME ; class TAlfTimedPoint const & CAlfBorderBrush::Thickness(void) const
+	?Thickness@CAlfLineVisual@@QBEABVTAlfTimedValue@@XZ @ 850 NONAME ; class TAlfTimedValue const & CAlfLineVisual::Thickness(void) const
+	?TimeToTargetinMilliSeconds@TAlfTimedValue@@QBEHXZ @ 851 NONAME ; int TAlfTimedValue::TimeToTargetinMilliSeconds(void) const
+	?TimedPoint@TAlfPointCommand@@QBE?AW4TAlfPointCommandTarget@@XZ @ 852 NONAME ; enum TAlfPointCommandTarget TAlfPointCommand::TimedPoint(void) const
+	?TimedValue@TAlfValueCommand@@QBE?AW4TAlfValueCommandTarget@@XZ @ 853 NONAME ; enum TAlfValueCommandTarget TAlfValueCommand::TimedValue(void) const
+	?TokenClient@CAlfEnv@@QAEPAVRFTokenClient@@XZ @ 854 NONAME ; class RFTokenClient * CAlfEnv::TokenClient(void)
+	?TopLeft@TAlfImage@@QBE?AUTAlfRealPoint@@XZ @ 855 NONAME ; struct TAlfRealPoint TAlfImage::TopLeft(void) const
+	?Transformation@CAlfControlGroup@@QAEAAVCAlfTransformation@@XZ @ 856 NONAME ; class CAlfTransformation & CAlfControlGroup::Transformation(void)
+	?Transformation@CAlfVisual@@QAEAAVCAlfTransformation@@XZ @ 857 NONAME ; class CAlfTransformation & CAlfVisual::Transformation(void)
+	?Transformation@TAlfTransformationCommand@@QBEAAVCAlfTransformation@@XZ @ 858 NONAME ; class CAlfTransformation & TAlfTransformationCommand::Transformation(void) const
+	?TransitionTime@CAlfLayout@@QBEHXZ @ 859 NONAME ; int CAlfLayout::TransitionTime(void) const
+	?TransitionTime@TAlfPointCommand@@QBEHXZ @ 860 NONAME ; int TAlfPointCommand::TransitionTime(void) const
+	?TransitionTime@TAlfValueCommand@@QBEHXZ @ 861 NONAME ; int TAlfValueCommand::TransitionTime(void) const
+	?Translate@CAlfTransformation@@QAEXABVTAlfTimedValue@@0@Z @ 862 NONAME ; void CAlfTransformation::Translate(class TAlfTimedValue const &, class TAlfTimedValue const &)
+	?Translate@CAlfTransformation@@QAEXMM@Z @ 863 NONAME ; void CAlfTransformation::Translate(float, float)
+	?Translate@TAlfImage@@QAEXMMH@Z @ 864 NONAME ; void TAlfImage::Translate(float, float, int)
+	?TurnAngle@CAlfImageVisual@@QAE?AVTAlfTimedValue@@XZ @ 865 NONAME ; class TAlfTimedValue CAlfImageVisual::TurnAngle(void)
+	?Type@TAlfCommand@@QBE?AW4TAlfCommandType@@XZ @ 866 NONAME ; enum TAlfCommandType TAlfCommand::Type(void) const
+	?Type@TAlfEvent@@QBE?AW4TType@1@XZ @ 867 NONAME ; enum TAlfEvent::TType TAlfEvent::Type(void) const
+	?TypefaceNameL@CAlfTextStyle@@QBEPAVHBufC16@@XZ @ 868 NONAME ; class HBufC16 * CAlfTextStyle::TypefaceNameL(void) const
+	?UnloadTexture@CAlfTextureManager@@QAEXABVTDesC16@@@Z @ 869 NONAME ; void CAlfTextureManager::UnloadTexture(class TDesC16 const &)
+	?UnloadTexture@CAlfTextureManager@@QAEXH@Z @ 870 NONAME ; void CAlfTextureManager::UnloadTexture(int)
+	?UnmarkVisual@CAlfLayoutMetricsUtility@@QAEXPAVCAlfTextVisual@@@Z @ 871 NONAME ; void CAlfLayoutMetricsUtility::UnmarkVisual(class CAlfTextVisual *)
+	?UpdateChildrenLayout@CAlfAnchorLayout@@UAEXH@Z @ 872 NONAME ; void CAlfAnchorLayout::UpdateChildrenLayout(int)
+	?UpdateChildrenLayout@CAlfCurvePathLayout@@UAEXH@Z @ 873 NONAME ; void CAlfCurvePathLayout::UpdateChildrenLayout(int)
+	?UpdateChildrenLayout@CAlfDeckLayout@@UAEXH@Z @ 874 NONAME ; void CAlfDeckLayout::UpdateChildrenLayout(int)
+	?UpdateChildrenLayout@CAlfFlowLayout@@UAEXH@Z @ 875 NONAME ; void CAlfFlowLayout::UpdateChildrenLayout(int)
+	?UpdateChildrenLayout@CAlfGridLayout@@UAEXH@Z @ 876 NONAME ; void CAlfGridLayout::UpdateChildrenLayout(int)
+	?UpdateChildrenLayout@CAlfImageVisual@@UAEXH@Z @ 877 NONAME ; void CAlfImageVisual::UpdateChildrenLayout(int)
+	?UpdateChildrenLayout@CAlfLCTAnchorLayout@@UAEXH@Z @ 878 NONAME ; void CAlfLCTAnchorLayout::UpdateChildrenLayout(int)
+	?UpdateChildrenLayout@CAlfLCTGridLayout@@UAEXH@Z @ 879 NONAME ; void CAlfLCTGridLayout::UpdateChildrenLayout(int)
+	?UpdateChildrenLayout@CAlfLCTTextVisual@@UAEXH@Z @ 880 NONAME ; void CAlfLCTTextVisual::UpdateChildrenLayout(int)
+	?UpdateChildrenLayout@CAlfLayout@@UAEXH@Z @ 881 NONAME ; void CAlfLayout::UpdateChildrenLayout(int)
+	?UpdateChildrenLayout@CAlfLineVisual@@UAEXH@Z @ 882 NONAME ; void CAlfLineVisual::UpdateChildrenLayout(int)
+	?UpdateChildrenLayout@CAlfMeshVisual@@UAEXH@Z @ 883 NONAME ; void CAlfMeshVisual::UpdateChildrenLayout(int)
+	?UpdateChildrenLayout@CAlfTextVisual@@UAEXH@Z @ 884 NONAME ; void CAlfTextVisual::UpdateChildrenLayout(int)
+	?UpdateChildrenLayout@CAlfViewportLayout@@UAEXH@Z @ 885 NONAME ; void CAlfViewportLayout::UpdateChildrenLayout(int)
+	?UpdateChildrenLayout@CAlfVisual@@UAEXH@Z @ 886 NONAME ; void CAlfVisual::UpdateChildrenLayout(int)
+	?Value@CAlfConstantMappingFunction@@QBEMXZ @ 887 NONAME ; float CAlfConstantMappingFunction::Value(void) const
+	?ValueNow@TAlfTimedValue@@QBEMXZ @ 888 NONAME ; float TAlfTimedValue::ValueNow(void) const
+	??0CAlfBrush@@IAE@XZ @ 889 NONAME ; CAlfBrush::CAlfBrush(void)
+	?VerticalInnerPadding@CAlfLayout@@QBEHXZ @ 890 NONAME ; int CAlfLayout::VerticalInnerPadding(void) const
+	?VerticalOrigin@CAlfVisual@@QBE?AW4TAlfVisualVOrigin@@XZ @ 891 NONAME ; enum TAlfVisualVOrigin CAlfVisual::VerticalOrigin(void) const
+	?VerticalPadding@CAlfVisual@@QBEHXZ @ 892 NONAME ; int CAlfVisual::VerticalPadding(void) const
+	?VirtualSize@CAlfLayout@@QBE?AVTSize@@XZ @ 893 NONAME ; class TSize CAlfLayout::VirtualSize(void) const
+	?VisibleArea@CAlfDisplay@@QBE?AVTRect@@XZ @ 894 NONAME ; class TRect CAlfDisplay::VisibleArea(void) const
+	?Visual@CAlfControl@@QBEAAVCAlfVisual@@H@Z @ 895 NONAME ; class CAlfVisual & CAlfControl::Visual(int) const
+	?Visual@CAlfLayout@@QBEAAVCAlfVisual@@H@Z @ 896 NONAME ; class CAlfVisual & CAlfLayout::Visual(int) const
+	?Visual@TAlfEvent@@QBEPAVCAlfVisual@@XZ @ 897 NONAME ; class CAlfVisual * TAlfEvent::Visual(void) const
+	?Visual@TAlfVisualCommand@@QBEAAVCAlfVisual@@XZ @ 898 NONAME ; class CAlfVisual & TAlfVisualCommand::Visual(void) const
+	?VisualAddedL@CAlfControl@@MAEXPAVCAlfVisual@@@Z @ 899 NONAME ; void CAlfControl::VisualAddedL(class CAlfVisual *)
+	?VisualCount@CAlfControl@@QBEHXZ @ 900 NONAME ; int CAlfControl::VisualCount(void) const
+	?VisualDestroyed@CAlfControl@@UAEXAAVCAlfVisual@@@Z @ 901 NONAME ; void CAlfControl::VisualDestroyed(class CAlfVisual &)
+	?VisualLayoutUpdated@CAlfControl@@UAEXAAVCAlfVisual@@@Z @ 902 NONAME ; void CAlfControl::VisualLayoutUpdated(class CAlfVisual &)
+	?VisualPrepareDrawFailed@CAlfControl@@UAEXAAVCAlfVisual@@H@Z @ 903 NONAME ; void CAlfControl::VisualPrepareDrawFailed(class CAlfVisual &, int)
+	?VisualRemoved@CAlfControl@@MAEXPAVCAlfVisual@@@Z @ 904 NONAME ; void CAlfControl::VisualRemoved(class CAlfVisual *)
+	?Weight@CAlfGridLayout@@QBE?AUTAlfMetric@@W4TAlfGridDimension@@H@Z @ 905 NONAME ; struct TAlfMetric CAlfGridLayout::Weight(enum TAlfGridDimension, int) const
+	?WidgetFactory@CAlfEnv@@QBEAAVIAlfWidgetFactory@Alf@@XZ @ 906 NONAME ; class Alf::IAlfWidgetFactory & CAlfEnv::WidgetFactory(void) const
+	?Width@CAlfShadowBorderBrush@@QBEABVTAlfTimedValue@@XZ @ 907 NONAME ; class TAlfTimedValue const & CAlfShadowBorderBrush::Width(void) const
+	?WrapValue@AlfUtil@@SAXAAMMM@Z @ 908 NONAME ; void AlfUtil::WrapValue(float &, float, float)
+	?Wrapping@CAlfTextVisual@@QBE?AW4TLineWrap@1@XZ @ 909 NONAME ; enum CAlfTextVisual::TLineWrap CAlfTextVisual::Wrapping(void) const
+	?WriteReport@CAlfLayoutMetricsUtility@@QAEXXZ @ 910 NONAME ; void CAlfLayoutMetricsUtility::WriteReport(void)
+	?YawAngle@CAlfMeshVisual@@QBE?AVTAlfTimedValue@@XZ @ 911 NONAME ; class TAlfTimedValue CAlfMeshVisual::YawAngle(void) const
+	?CreateSVGImageLoaderL@CAlfImageLoaderUtil@@QAEPAVMAlfBitmapProvider@@ABVTDesC16@@@Z @ 912 NONAME ; class MAlfBitmapProvider * CAlfImageLoaderUtil::CreateSVGImageLoaderL(class TDesC16 const &)
+	?SetColor@CAlfLineVisual@@QAEXABVTRgb@@@Z @ 913 NONAME ; void CAlfLineVisual::SetColor(class TRgb const &)
+	?AppendArcL@CAlfCurvePath@@QAEXABUTAlfRealPoint@@ABUTAlfRealSize@@MMM@Z @ 914 NONAME ; void CAlfCurvePath::AppendArcL(struct TAlfRealPoint const &, struct TAlfRealSize const &, float, float, float)
+	?AppendLineL@CAlfCurvePath@@QAEXABUTAlfRealPoint@@0M@Z @ 915 NONAME ; void CAlfCurvePath::AppendLineL(struct TAlfRealPoint const &, struct TAlfRealPoint const &, float)
+	?SetDropShadow@CAlfImageVisual@@QAEXABUTAlfMetric@@@Z @ 916 NONAME ; void CAlfImageVisual::SetDropShadow(struct TAlfMetric const &)
+	?SetDropShadow@CAlfImageVisual@@QAEXABUTAlfXYMetric@@@Z @ 917 NONAME ; void CAlfImageVisual::SetDropShadow(struct TAlfXYMetric const &)
+	?NewL@CAlfBorderBrush@@SAPAV1@AAVCAlfEnv@@ABUTAlfXYMetric@@1@Z @ 918 NONAME ; class CAlfBorderBrush * CAlfBorderBrush::NewL(class CAlfEnv &, struct TAlfXYMetric const &, struct TAlfXYMetric const &)
+	?NewL@CAlfDropShadowBrush@@SAPAV1@AAVCAlfEnv@@ABUTAlfMetric@@@Z @ 919 NONAME ; class CAlfDropShadowBrush * CAlfDropShadowBrush::NewL(class CAlfEnv &, struct TAlfMetric const &)
+	?NewL@CAlfFrameBrush@@SAPAV1@AAVCAlfEnv@@ABVTAknsItemID@@ABUTAlfXYMetric@@@Z @ 920 NONAME ; class CAlfFrameBrush * CAlfFrameBrush::NewL(class CAlfEnv &, class TAknsItemID const &, struct TAlfXYMetric const &)
+	?NewL@CAlfShadowBorderBrush@@SAPAV1@AAVCAlfEnv@@ABUTAlfMetric@@@Z @ 921 NONAME ; class CAlfShadowBorderBrush * CAlfShadowBorderBrush::NewL(class CAlfEnv &, struct TAlfMetric const &)
+	?NewLC@CAlfBorderBrush@@SAPAV1@AAVCAlfEnv@@ABUTAlfXYMetric@@1@Z @ 922 NONAME ; class CAlfBorderBrush * CAlfBorderBrush::NewLC(class CAlfEnv &, struct TAlfXYMetric const &, struct TAlfXYMetric const &)
+	?NewLC@CAlfDropShadowBrush@@SAPAV1@AAVCAlfEnv@@ABUTAlfMetric@@@Z @ 923 NONAME ; class CAlfDropShadowBrush * CAlfDropShadowBrush::NewLC(class CAlfEnv &, struct TAlfMetric const &)
+	?NewLC@CAlfFrameBrush@@SAPAV1@AAVCAlfEnv@@ABVTAknsItemID@@ABUTAlfXYMetric@@@Z @ 924 NONAME ; class CAlfFrameBrush * CAlfFrameBrush::NewLC(class CAlfEnv &, class TAknsItemID const &, struct TAlfXYMetric const &)
+	?NewLC@CAlfShadowBorderBrush@@SAPAV1@AAVCAlfEnv@@ABUTAlfMetric@@@Z @ 925 NONAME ; class CAlfShadowBorderBrush * CAlfShadowBorderBrush::NewLC(class CAlfEnv &, struct TAlfMetric const &)
+	?SetColor@CAlfDropShadowBrush@@QAEXABVTRgb@@@Z @ 926 NONAME ; void CAlfDropShadowBrush::SetColor(class TRgb const &)
+	?SetDepth@CAlfDropShadowBrush@@QAEXABUTAlfMetric@@@Z @ 927 NONAME ; void CAlfDropShadowBrush::SetDepth(struct TAlfMetric const &)
+	?SetEdgeOffset@CAlfBorderBrush@@QAEXABUTAlfXYMetric@@@Z @ 928 NONAME ; void CAlfBorderBrush::SetEdgeOffset(struct TAlfXYMetric const &)
+	?SetEdgeOffset@CAlfFrameBrush@@QAEXABUTAlfXYMetric@@@Z @ 929 NONAME ; void CAlfFrameBrush::SetEdgeOffset(struct TAlfXYMetric const &)
+	?SetImageOffset@CAlfBorderBrush@@QAEXABUTAlfXYMetric@@@Z @ 930 NONAME ; void CAlfBorderBrush::SetImageOffset(struct TAlfXYMetric const &)
+	?SetSoftness@CAlfDropShadowBrush@@QAEXABUTAlfMetric@@@Z @ 931 NONAME ; void CAlfDropShadowBrush::SetSoftness(struct TAlfMetric const &)
+	?SetThickness@CAlfBorderBrush@@QAEXABUTAlfXYMetric@@@Z @ 932 NONAME ; void CAlfBorderBrush::SetThickness(struct TAlfXYMetric const &)
+	?SetWidth@CAlfShadowBorderBrush@@QAEXABUTAlfMetric@@@Z @ 933 NONAME ; void CAlfShadowBorderBrush::SetWidth(struct TAlfMetric const &)
+	?LoadAnimatedTextureL@CAlfTextureManager@@QAEAAVCAlfTexture@@ABVTDesC16@@VTSize@@W4TAlfTextureFlags@@H@Z @ 934 NONAME ; class CAlfTexture & CAlfTextureManager::LoadAnimatedTextureL(class TDesC16 const &, class TSize, enum TAlfTextureFlags, int)
+	?DestroyWidget@CAlfEnv@@QAEHPAVIAlfWidget@Alf@@@Z @ 935 NONAME ; int CAlfEnv::DestroyWidget(class Alf::IAlfWidget *)
+	?Attach@CAlfAnchorLayout@@QAEHHABUTAlfBoxMetric@@W4TAlfAnchorAttachmentOrigin@@H@Z @ 936 NONAME ; int CAlfAnchorLayout::Attach(int, struct TAlfBoxMetric const &, enum TAlfAnchorAttachmentOrigin, int)
+	?Attach@CAlfAnchorLayout@@QAEHHW4TAlfAnchorType@@ABUTAlfMetric@@W4TAlfAnchorAttachmentOrigin@@H@Z @ 937 NONAME ; int CAlfAnchorLayout::Attach(int, enum TAlfAnchorType, struct TAlfMetric const &, enum TAlfAnchorAttachmentOrigin, int)
+	?Attach@CAlfAnchorLayout@@QAEHHW4TAlfAnchorType@@ABUTAlfXYMetric@@W4TAlfAnchorAttachmentOrigin@@H@Z @ 938 NONAME ; int CAlfAnchorLayout::Attach(int, enum TAlfAnchorType, struct TAlfXYMetric const &, enum TAlfAnchorAttachmentOrigin, int)
+	?Detach@CAlfAnchorLayout@@QAEXH@Z @ 939 NONAME ; void CAlfAnchorLayout::Detach(int)
+	?Detach@CAlfAnchorLayout@@QAEXHW4TAlfAnchorType@@@Z @ 940 NONAME ; void CAlfAnchorLayout::Detach(int, enum TAlfAnchorType)
+	?MaxSizeInBaseUnits@CAlfVisual@@QBE?AUTAlfRealSize@@XZ @ 941 NONAME ; struct TAlfRealSize CAlfVisual::MaxSizeInBaseUnits(void) const
+	?MinSizeInBaseUnits@CAlfVisual@@QBE?AUTAlfRealSize@@XZ @ 942 NONAME ; struct TAlfRealSize CAlfVisual::MinSizeInBaseUnits(void) const
+	?Move@CAlfVisual@@QAEXABUTAlfRealPoint@@H@Z @ 943 NONAME ; void CAlfVisual::Move(struct TAlfRealPoint const &, int)
+	?SetCenteredPosAndSize@CAlfVisual@@QAEXABUTAlfRealPoint@@ABUTAlfRealSize@@H@Z @ 944 NONAME ; void CAlfVisual::SetCenteredPosAndSize(struct TAlfRealPoint const &, struct TAlfRealSize const &, int)
+	?SetMaxSize@CAlfVisual@@QAEXABUTAlfRealSize@@@Z @ 945 NONAME ; void CAlfVisual::SetMaxSize(struct TAlfRealSize const &)
+	?SetMinSize@CAlfVisual@@QAEXABUTAlfRealSize@@@Z @ 946 NONAME ; void CAlfVisual::SetMinSize(struct TAlfRealSize const &)
+	??0TAlfBoxMetric@@QAE@ABUTAlfXYMetric@@0@Z @ 947 NONAME ; TAlfBoxMetric::TAlfBoxMetric(struct TAlfXYMetric const &, struct TAlfXYMetric const &)
+	??1CAlfTexture@@UAE@XZ @ 948 NONAME ; CAlfTexture::~CAlfTexture(void)
+	?ClearLayoutModeFlags@CAlfGridLayout@@QAEXW4TAlfGridDimension@@I@Z @ 949 NONAME ; void CAlfGridLayout::ClearLayoutModeFlags(enum TAlfGridDimension, unsigned int)
+	?LayoutModeFlags@CAlfGridLayout@@QAEHW4TAlfGridDimension@@@Z @ 950 NONAME ; int CAlfGridLayout::LayoutModeFlags(enum TAlfGridDimension)
+	?SetLayoutModeFlags@CAlfGridLayout@@QAEXW4TAlfGridDimension@@I@Z @ 951 NONAME ; void CAlfGridLayout::SetLayoutModeFlags(enum TAlfGridDimension, unsigned int)
+	?HasTactileFeedback@CAlfVisual@@QBEHH@Z @ 952 NONAME ; int CAlfVisual::HasTactileFeedback(int) const
+	?RemoveTactileFeedback@CAlfVisual@@QAEXH@Z @ 953 NONAME ; void CAlfVisual::RemoveTactileFeedback(int)
+	?SetTactileFeedbackL@CAlfVisual@@QAEXHH@Z @ 954 NONAME ; void CAlfVisual::SetTactileFeedbackL(int, int)
+	?DisableLongTapEventsWhenDragging@CAlfRoster@@QAEHABVCAlfControl@@H@Z @ 955 NONAME ; int CAlfRoster::DisableLongTapEventsWhenDragging(class CAlfControl const &, int)
+	?SetPointerDragThreshold@CAlfRoster@@QAEHABVCAlfControl@@ABUTAlfXYMetric@@@Z @ 956 NONAME ; int CAlfRoster::SetPointerDragThreshold(class CAlfControl const &, struct TAlfXYMetric const &)
+	??0TAlfImage@@QAE@PBVTDesC16@@VTSize@@W4TScaleMode@@0HHMMMMW4TAlfTextureFlags@@HPAVCAlfTextureManager@@@Z @ 957 NONAME ; TAlfImage::TAlfImage(class TDesC16 const *, class TSize, enum TScaleMode, class TDesC16 const *, int, int, float, float, float, float, enum TAlfTextureFlags, int, class CAlfTextureManager *)
+	?SetColor@CAlfTextVisual@@QAEXABVTDesC16@@0@Z @ 958 NONAME ; void CAlfTextVisual::SetColor(class TDesC16 const &, class TDesC16 const &)
+	??0CAlfScreenBuffer@@AAE@AAVCAlfEnv@@@Z @ 959 NONAME ; CAlfScreenBuffer::CAlfScreenBuffer(class CAlfEnv &)
+	??1CAlfScreenBuffer@@UAE@XZ @ 960 NONAME ; CAlfScreenBuffer::~CAlfScreenBuffer(void)
+	?AddObserverL@CAlfScreenBuffer@@QAEXVTUid@@PAVMAlfScreenBufferObserver@@H@Z @ 961 NONAME ; void CAlfScreenBuffer::AddObserverL(class TUid, class MAlfScreenBufferObserver *, int)
+	?ConstructL@CAlfScreenBuffer@@AAEXXZ @ 962 NONAME ; void CAlfScreenBuffer::ConstructL(void)
+	?DrawBuffer@CAlfSymbianBufferDrawer@@QAEXAAVCBitmapContext@@ABVTPoint@@ABVTRect@@@Z @ 963 NONAME ; void CAlfSymbianBufferDrawer::DrawBuffer(class CBitmapContext &, class TPoint const &, class TRect const &)
+	?DrawBufferMasked@CAlfSymbianBufferDrawer@@QAEXAAVCBitmapContext@@PBVCFbsBitmap@@ABVTPoint@@ABVTRect@@@Z @ 964 NONAME ; void CAlfSymbianBufferDrawer::DrawBufferMasked(class CBitmapContext &, class CFbsBitmap const *, class TPoint const &, class TRect const &)
+	?GetDrawingInterface@CAlfScreenBuffer@@QAEPAVMAlfBufferDrawer@@VTUid@@0@Z @ 965 NONAME ; class MAlfBufferDrawer * CAlfScreenBuffer::GetDrawingInterface(class TUid, class TUid)
+	?GetGraphicsContext@CAlfScreenBuffer@@QAEPAVMAlfBufferGc@@VTUid@@0@Z @ 966 NONAME ; class MAlfBufferGc * CAlfScreenBuffer::GetGraphicsContext(class TUid, class TUid)
+	?NewDisplayL@CAlfEnv@@QAEAAVCAlfDisplay@@ABVTRect@@HPAV2@HVTUid@@@Z @ 967 NONAME ; class CAlfDisplay & CAlfEnv::NewDisplayL(class TRect const &, int, class CAlfDisplay *, int, class TUid)
+	?NewL@CAlfScreenBuffer@@SAPAV1@AAVCAlfEnv@@@Z @ 968 NONAME ; class CAlfScreenBuffer * CAlfScreenBuffer::NewL(class CAlfEnv &)
+	?ReleaseDrawer@CAlfSymbianBufferDrawer@@UAEXXZ @ 969 NONAME ; void CAlfSymbianBufferDrawer::ReleaseDrawer(void)
+	?RemoveObserver@CAlfScreenBuffer@@QAEXVTUid@@@Z @ 970 NONAME ; void CAlfScreenBuffer::RemoveObserver(class TUid)
+	?RequestNextBuffer@CAlfScreenBuffer@@QAEXVTUid@@@Z @ 971 NONAME ; void CAlfScreenBuffer::RequestNextBuffer(class TUid)
+	?DeleteTextStyle@CAlfTextStyleManager@@QAEHH@Z @ 972 NONAME ; int CAlfTextStyleManager::DeleteTextStyle(int)
+	?UpdateTextureFromBitmapL@CAlfTextureManager@@QAEXHPAVMAlfBitmapProvider@@@Z @ 973 NONAME ; void CAlfTextureManager::UpdateTextureFromBitmapL(int, class MAlfBitmapProvider *)
+	?UpdateTextureFromFileL@CAlfTextureManager@@QAEXHPBVTDesC16@@@Z @ 974 NONAME ; void CAlfTextureManager::UpdateTextureFromFileL(int, class TDesC16 const *)
+	?Pause@CAlfVisual@@QAEXH@Z @ 975 NONAME ; void CAlfVisual::Pause(int)
+	?Resume@CAlfVisual@@QAEXH@Z @ 976 NONAME ; void CAlfVisual::Resume(int)
+	??0TAlfDisplayBackgroundItem@@QAE@ABVTRect@@@Z @ 977 NONAME ; TAlfDisplayBackgroundItem::TAlfDisplayBackgroundItem(class TRect const &)
+	??0TAlfDisplayBackgroundItem@@QAE@ABVTRect@@ABVTAknsItemID@@@Z @ 978 NONAME ; TAlfDisplayBackgroundItem::TAlfDisplayBackgroundItem(class TRect const &, class TAknsItemID const &)
+	??0TAlfDisplayBackgroundItem@@QAE@ABVTRect@@ABVTAknsItemID@@H@Z @ 979 NONAME ; TAlfDisplayBackgroundItem::TAlfDisplayBackgroundItem(class TRect const &, class TAknsItemID const &, int)
+	??0TAlfDisplayBackgroundItem@@QAE@ABVTRect@@ABVTRgb@@@Z @ 980 NONAME ; TAlfDisplayBackgroundItem::TAlfDisplayBackgroundItem(class TRect const &, class TRgb const &)
+	??0TAlfDisplayBackgroundItem@@QAE@XZ @ 981 NONAME ; TAlfDisplayBackgroundItem::TAlfDisplayBackgroundItem(void)
+	?SetBackgroundItemsL@CAlfDisplay@@QAEXABV?$RArray@VTAlfDisplayBackgroundItem@@@@@Z @ 982 NONAME ; void CAlfDisplay::SetBackgroundItemsL(class RArray<class TAlfDisplayBackgroundItem> const &)
+	?SetColor@TAlfDisplayBackgroundItem@@QAEXABVTAknsItemID@@H@Z @ 983 NONAME ; void TAlfDisplayBackgroundItem::SetColor(class TAknsItemID const &, int)
+	?SetColor@TAlfDisplayBackgroundItem@@QAEXABVTRgb@@@Z @ 984 NONAME ; void TAlfDisplayBackgroundItem::SetColor(class TRgb const &)
+	?SetRect@TAlfDisplayBackgroundItem@@QAEXABVTRect@@@Z @ 985 NONAME ; void TAlfDisplayBackgroundItem::SetRect(class TRect const &)
+	?SetSkinBackground@TAlfDisplayBackgroundItem@@QAEXABVTAknsItemID@@@Z @ 986 NONAME ; void TAlfDisplayBackgroundItem::SetSkinBackground(class TAknsItemID const &)
+	?AutoFlushMode@CAlfBatchBuffer@@QBE?AW4TAlfAutoFlushMode@@XZ @ 987 NONAME ; enum TAlfAutoFlushMode CAlfBatchBuffer::AutoFlushMode(void) const
+	?BatchBufferHandler@CAlfEnv@@QBEAAVCAlfBatchBuffer@@XZ @ 988 NONAME ; class CAlfBatchBuffer & CAlfEnv::BatchBufferHandler(void) const
+	?DoCmdNoReply@CAlfGenComponent@@QAEHIABVTDesC8@@@Z @ 989 NONAME ; int CAlfGenComponent::DoCmdNoReply(unsigned int, class TDesC8 const &)
+	?FlushBatchBuffer@CAlfBatchBuffer@@QAEHXZ @ 990 NONAME ; int CAlfBatchBuffer::FlushBatchBuffer(void)
+	?GetBatchBufferInfo@CAlfBatchBuffer@@QBEHW4TAlfBatchBufferInfoType@@@Z @ 991 NONAME ; int CAlfBatchBuffer::GetBatchBufferInfo(enum TAlfBatchBufferInfoType) const
+	?SetAutoFlushMode@CAlfBatchBuffer@@QAEXW4TAlfAutoFlushMode@@@Z @ 992 NONAME ; void CAlfBatchBuffer::SetAutoFlushMode(enum TAlfAutoFlushMode)
+	?SetMaxBatchBufferSize@CAlfBatchBuffer@@QAEXH@Z @ 993 NONAME ; void CAlfBatchBuffer::SetMaxBatchBufferSize(int)
+	?SetTextPaneHeightInPixels@CAlfTextStyle@@QAEXHH@Z @ 994 NONAME ; void CAlfTextStyle::SetTextPaneHeightInPixels(int, int)
+	?TextStyle@CAlfTextVisual@@QBEHXZ @ 995 NONAME ; int CAlfTextVisual::TextStyle(void) const
+	?ThemeItemIdL@AlfUtil@@SA?AVTAknsItemID@@AAVCAlfEnv@@ABVTDesC16@@@Z @ 996 NONAME ; class TAknsItemID AlfUtil::ThemeItemIdL(class CAlfEnv &, class TDesC16 const &)
+	?TextureId@CAlfTextureManager@@QBEHABVTDesC16@@@Z @ 997 NONAME ; int CAlfTextureManager::TextureId(class TDesC16 const &) const
+	?FocusedConnection@CAlfControl@@QBEPAV1@XZ @ 998 NONAME ; class CAlfControl * CAlfControl::FocusedConnection(void) const
+	??0TAlfTextureAutoSizeParams@@QAE@XZ @ 999 NONAME ; TAlfTextureAutoSizeParams::TAlfTextureAutoSizeParams(void)
+	?AddAutoSizeObserverL@CAlfTextureManager@@QAEXPAVMAlfTextureAutoSizeObserver@@@Z @ 1000 NONAME ; void CAlfTextureManager::AddAutoSizeObserverL(class MAlfTextureAutoSizeObserver *)
+	?AutoSizeParams@CAlfTexture@@QBE?AVTAlfTextureAutoSizeParams@@XZ @ 1001 NONAME ; class TAlfTextureAutoSizeParams CAlfTexture::AutoSizeParams(void) const
+	?DownsizeSettleThreshold@TAlfTextureAutoSizeParams@@QBEHXZ @ 1002 NONAME ; int TAlfTextureAutoSizeParams::DownsizeSettleThreshold(void) const
+	?MinSizeChange@TAlfTextureAutoSizeParams@@QBEHXZ @ 1003 NONAME ; int TAlfTextureAutoSizeParams::MinSizeChange(void) const
+	?PreferredSizeChanged@CAlfAutoSizeImageLoaderUtil@@EAEHABVCAlfTexture@@VTSize@@@Z @ 1004 NONAME ; int CAlfAutoSizeImageLoaderUtil::PreferredSizeChanged(class CAlfTexture const &, class TSize)
+	?RemoveAutoSizeObserver@CAlfTextureManager@@QAEXPAVMAlfTextureAutoSizeObserver@@@Z @ 1005 NONAME ; void CAlfTextureManager::RemoveAutoSizeObserver(class MAlfTextureAutoSizeObserver *)
+	?SetAutoSizeParams@CAlfTexture@@QAEXABVTAlfTextureAutoSizeParams@@@Z @ 1006 NONAME ; void CAlfTexture::SetAutoSizeParams(class TAlfTextureAutoSizeParams const &)
+	?SetDownsizeSettleThreshold@TAlfTextureAutoSizeParams@@QAEXH@Z @ 1007 NONAME ; void TAlfTextureAutoSizeParams::SetDownsizeSettleThreshold(int)
+	?SetMinSizeChange@TAlfTextureAutoSizeParams@@QAEXH@Z @ 1008 NONAME ; void TAlfTextureAutoSizeParams::SetMinSizeChange(int)
+	?SetSizeLowerThreshold@TAlfTextureAutoSizeParams@@QAEXH@Z @ 1009 NONAME ; void TAlfTextureAutoSizeParams::SetSizeLowerThreshold(int)
+	?SetSizeUpperThreshold@TAlfTextureAutoSizeParams@@QAEXH@Z @ 1010 NONAME ; void TAlfTextureAutoSizeParams::SetSizeUpperThreshold(int)
+	?SizeLowerThreshold@TAlfTextureAutoSizeParams@@QBEHXZ @ 1011 NONAME ; int TAlfTextureAutoSizeParams::SizeLowerThreshold(void) const
+	?SizeUpperThreshold@TAlfTextureAutoSizeParams@@QBEHXZ @ 1012 NONAME ; int TAlfTextureAutoSizeParams::SizeUpperThreshold(void) const
+	?EnableRefCounting@CAlfTexture@@QAEXH@Z @ 1013 NONAME ; void CAlfTexture::EnableRefCounting(int)
+	?RefCountingEnabled@CAlfTexture@@QAEHXZ @ 1014 NONAME ; int CAlfTexture::RefCountingEnabled(void)
+	?GetBufferBitmaps@CAlfSymbianBufferDrawer@@QBEXAAPAVCFbsBitmap@@0@Z @ 1015 NONAME ; void CAlfSymbianBufferDrawer::GetBufferBitmaps(class CFbsBitmap * &, class CFbsBitmap * &) const
+	?NewL@CAlfScreenBuffer@@SAPAV1@XZ @ 1016 NONAME ; class CAlfScreenBuffer * CAlfScreenBuffer::NewL(void)
+	??0CAlfAutoSizeImageLoaderUtil@@QAE@XZ @ 1017 NONAME ; CAlfAutoSizeImageLoaderUtil::CAlfAutoSizeImageLoaderUtil(void)
+	?FindControlGroup@CAlfEnv@@QBEPAVCAlfControlGroup@@H@Z @ 1018 NONAME ; class CAlfControlGroup * CAlfEnv::FindControlGroup(int) const
+	?AddExtension@CAlfEnv@@QAEHHPAVMAlfEnvObject@@@Z @ 1019 NONAME ; int CAlfEnv::AddExtension(int, class MAlfEnvObject *)
+	?Extension@CAlfEnv@@QBEPAVMAlfEnvObject@@H@Z @ 1020 NONAME ; class MAlfEnvObject * CAlfEnv::Extension(int) const
+	?CreateImageLoaderL@CAlfImageLoaderUtil@@QAEPAVMAlfBitmapProvider@@ABVTAknsItemID@@ABVTRect@@1@Z @ 1021 NONAME ; class MAlfBitmapProvider * CAlfImageLoaderUtil::CreateImageLoaderL(class TAknsItemID const &, class TRect const &, class TRect const &)
+	?NewL@CAlfFrameBrush@@SAPAV1@AAVCAlfEnv@@ABVTAlfImage@@ABUTAlfXYMetric@@@Z @ 1022 NONAME ; class CAlfFrameBrush * CAlfFrameBrush::NewL(class CAlfEnv &, class TAlfImage const &, struct TAlfXYMetric const &)
+	?NewLC@CAlfFrameBrush@@SAPAV1@AAVCAlfEnv@@ABVTAlfImage@@ABUTAlfXYMetric@@@Z @ 1023 NONAME ; class CAlfFrameBrush * CAlfFrameBrush::NewLC(class CAlfEnv &, class TAlfImage const &, struct TAlfXYMetric const &)
+	?SetImage@CAlfFrameBrush@@QAEXABVTAlfImage@@@Z @ 1024 NONAME ; void CAlfFrameBrush::SetImage(class TAlfImage const &)
+	?HandlePointerEventL@CAlfDisplay@@QAEXABUTPointerEvent@@@Z @ 1025 NONAME ; void CAlfDisplay::HandlePointerEventL(struct TPointerEvent const &)
+	?HandlePointerEventL@CAlfEnv@@QAEXABUTPointerEvent@@AAVCAlfDisplay@@@Z @ 1026 NONAME ; void CAlfEnv::HandlePointerEventL(struct TPointerEvent const &, class CAlfDisplay &)
+	?RefCountingAction@CAlfTexture@@QBEHXZ @ 1027 NONAME ; int CAlfTexture::RefCountingAction(void) const
+	?SetImage@CAlfFrameBrush@@QAEXW4TFrameParts@1@ABVTAlfImage@@@Z @ 1028 NONAME ; void CAlfFrameBrush::SetImage(enum CAlfFrameBrush::TFrameParts, class TAlfImage const &)
+	?SetRefCountingAction@CAlfTexture@@QAEXH@Z @ 1029 NONAME ; void CAlfTexture::SetRefCountingAction(int)
+	?AddObserverL@CAlfScreenBuffer@@QAEXVTUid@@IPAVMAlfScreenBufferObserver@@H@Z @ 1030 NONAME ; void CAlfScreenBuffer::AddObserverL(class TUid, unsigned int, class MAlfScreenBufferObserver *, int)
+	?RequestBufferDraw@CAlfScreenBuffer@@QAEXVTUid@@@Z @ 1031 NONAME ; void CAlfScreenBuffer::RequestBufferDraw(class TUid)
+	?SuppressAutomaticFading@CAlfDisplay@@QAEHH@Z @ 1032 NONAME ; int CAlfDisplay::SuppressAutomaticFading(int)
+	?DropShadowHandler@CAlfVisual@@QBEPAVCAlfDropShadow@@XZ @ 1033 NONAME ; class CAlfDropShadow * CAlfVisual::DropShadowHandler(void) const
+	?EnableDropShadowL@CAlfVisual@@QAEXH@Z @ 1034 NONAME ; void CAlfVisual::EnableDropShadowL(int)
+	?SetColor@CAlfDropShadow@@QAEXABVTAknsItemID@@HH@Z @ 1035 NONAME ; void CAlfDropShadow::SetColor(class TAknsItemID const &, int, int)
+	?SetColor@CAlfDropShadow@@QAEXABVTRgb@@H@Z @ 1036 NONAME ; void CAlfDropShadow::SetColor(class TRgb const &, int)
+	?SetOffset@CAlfDropShadow@@QAEXABVTAlfTimedPoint@@H@Z @ 1037 NONAME ; void CAlfDropShadow::SetOffset(class TAlfTimedPoint const &, int)
+	?SetOffset@CAlfDropShadow@@QAEXMUTAlfMetric@@H@Z @ 1038 NONAME ; void CAlfDropShadow::SetOffset(float, struct TAlfMetric, int)
+	?SetOpacity@CAlfDropShadow@@QAEXABVTAlfTimedValue@@@Z @ 1039 NONAME ; void CAlfDropShadow::SetOpacity(class TAlfTimedValue const &)
+	?SetRadius@CAlfDropShadow@@QAEXABVTAlfTimedValue@@@Z @ 1040 NONAME ; void CAlfDropShadow::SetRadius(class TAlfTimedValue const &)
+	?SetScale@CAlfDropShadow@@QAEXABVTAlfTimedValue@@@Z @ 1041 NONAME ; void CAlfDropShadow::SetScale(class TAlfTimedValue const &)
+	?AddControlGroupOrderChangedObserverL@CAlfRoster@@QAEXAAVMAlfControlGroupOrderChangedObserver@@@Z @ 1042 NONAME ; void CAlfRoster::AddControlGroupOrderChangedObserverL(class MAlfControlGroupOrderChangedObserver &)
+	?RemoveControlGroupOrderChangedObserver@CAlfRoster@@QAEXAAVMAlfControlGroupOrderChangedObserver@@@Z @ 1043 NONAME ; void CAlfRoster::RemoveControlGroupOrderChangedObserver(class MAlfControlGroupOrderChangedObserver &)
+	?ClipToVisual@CAlfBrush@@QBEHXZ @ 1044 NONAME ; int CAlfBrush::ClipToVisual(void) const
+	?Offset@CAlfTextVisual@@QBE?AVTAlfTimedPoint@@XZ @ 1045 NONAME ; class TAlfTimedPoint CAlfTextVisual::Offset(void) const
+	?SetClipToVisual@CAlfBrush@@QAEXH@Z @ 1046 NONAME ; void CAlfBrush::SetClipToVisual(int)
+	?SetOffset@CAlfTextVisual@@QAEXABVTAlfTimedPoint@@@Z @ 1047 NONAME ; void CAlfTextVisual::SetOffset(class TAlfTimedPoint const &)
+	??0CAlfTextureGroup@@AAE@XZ @ 1048 NONAME ; CAlfTextureGroup::CAlfTextureGroup(void)
+	??1CAlfTextureGroup@@UAE@XZ @ 1049 NONAME ; CAlfTextureGroup::~CAlfTextureGroup(void)
+	?AddLoadObserverL@CAlfTextureGroup@@QAEXAAVMAlfTextureGroupLoadingCompletedObserver@@@Z @ 1050 NONAME ; void CAlfTextureGroup::AddLoadObserverL(class MAlfTextureGroupLoadingCompletedObserver &)
+	?AddTextureL@CAlfTextureGroup@@QAEXAAVCAlfTexture@@@Z @ 1051 NONAME ; void CAlfTextureGroup::AddTextureL(class CAlfTexture &)
+	?ConstructL@CAlfTextureGroup@@AAEXAAVCAlfEnv@@@Z @ 1052 NONAME ; void CAlfTextureGroup::ConstructL(class CAlfEnv &)
+	?Count@CAlfTextureGroup@@QBEHXZ @ 1053 NONAME ; int CAlfTextureGroup::Count(void) const
+	?IsLoadingCompleted@CAlfTextureGroup@@QBEHXZ @ 1054 NONAME ; int CAlfTextureGroup::IsLoadingCompleted(void) const
+	?NewL@CAlfTextureGroup@@SAPAV1@AAVCAlfEnv@@@Z @ 1055 NONAME ; class CAlfTextureGroup * CAlfTextureGroup::NewL(class CAlfEnv &)
+	?NewLC@CAlfTextureGroup@@SAPAV1@AAVCAlfEnv@@@Z @ 1056 NONAME ; class CAlfTextureGroup * CAlfTextureGroup::NewLC(class CAlfEnv &)
+	?RemoveLoadObserver@CAlfTextureGroup@@QAEXAAVMAlfTextureGroupLoadingCompletedObserver@@@Z @ 1057 NONAME ; void CAlfTextureGroup::RemoveLoadObserver(class MAlfTextureGroupLoadingCompletedObserver &)
+	?RemoveTexture@CAlfTextureGroup@@QAEXAAVCAlfTexture@@@Z @ 1058 NONAME ; void CAlfTextureGroup::RemoveTexture(class CAlfTexture &)
+	?Texture@CAlfTextureGroup@@QBEAAVCAlfTexture@@H@Z @ 1059 NONAME ; class CAlfTexture & CAlfTextureGroup::Texture(int) const
+	?EnableLoadObservers@CAlfTextureGroup@@QAEXH@Z @ 1060 NONAME ; void CAlfTextureGroup::EnableLoadObservers(int)
+	?Display@CAlfEnv@@QBEAAVCAlfDisplay@@H@Z @ 1061 NONAME ; class CAlfDisplay & CAlfEnv::Display(int) const
+	?FindDisplayIndex@CAlfEnv@@QBEHABVCAlfDisplay@@@Z @ 1062 NONAME ; int CAlfEnv::FindDisplayIndex(class CAlfDisplay const &) const
+	??0CAlfCanvasVisual@@QAE@XZ @ 1063 NONAME ; CAlfCanvasVisual::CAlfCanvasVisual(void)
+	??1CAlfCanvasVisual@@UAE@XZ @ 1064 NONAME ; CAlfCanvasVisual::~CAlfCanvasVisual(void)
+	?AddNewL@CAlfCanvasVisual@@SAPAV1@AAVCAlfControl@@PAVCAlfLayout@@@Z @ 1065 NONAME ; class CAlfCanvasVisual * CAlfCanvasVisual::AddNewL(class CAlfControl &, class CAlfLayout *)
+	?BeginDraw@CAlfCanvasVisual@@QAEXXZ @ 1066 NONAME ; void CAlfCanvasVisual::BeginDraw(void)
+	?ConstructL@CAlfCanvasVisual@@UAEXAAVCAlfControl@@@Z @ 1067 NONAME ; void CAlfCanvasVisual::ConstructL(class CAlfControl &)
+	?DoRemoveAndDestroyAllD@CAlfCanvasVisual@@MAEXXZ @ 1068 NONAME ; void CAlfCanvasVisual::DoRemoveAndDestroyAllD(void)
+	?DrawEllipse@CAlfCanvasVisual@@QAEXABUTAlfRealRect@@@Z @ 1069 NONAME ; void CAlfCanvasVisual::DrawEllipse(struct TAlfRealRect const &)
+	?DrawImage@CAlfCanvasVisual@@QAEXABVCAlfTexture@@ABUTAlfRealRect@@@Z @ 1070 NONAME ; void CAlfCanvasVisual::DrawImage(class CAlfTexture const &, struct TAlfRealRect const &)
+	?DrawLines@CAlfCanvasVisual@@QAEXPBUTAlfRealLine@@H@Z @ 1071 NONAME ; void CAlfCanvasVisual::DrawLines(struct TAlfRealLine const *, int)
+	?DrawPoints@CAlfCanvasVisual@@QAEXPBUTAlfRealPoint@@H@Z @ 1072 NONAME ; void CAlfCanvasVisual::DrawPoints(struct TAlfRealPoint const *, int)
+	?DrawPolygon@CAlfCanvasVisual@@QAEXPBUTAlfRealPoint@@H@Z @ 1073 NONAME ; void CAlfCanvasVisual::DrawPolygon(struct TAlfRealPoint const *, int)
+	?DrawRects@CAlfCanvasVisual@@QAEXPBUTAlfRealRect@@H@Z @ 1074 NONAME ; void CAlfCanvasVisual::DrawRects(struct TAlfRealRect const *, int)
+	?DrawText@CAlfCanvasVisual@@QAEXABVTDesC16@@ABUTAlfRealRect@@@Z @ 1075 NONAME ; void CAlfCanvasVisual::DrawText(class TDesC16 const &, struct TAlfRealRect const &)
+	?EndDraw@CAlfCanvasVisual@@QAEXXZ @ 1076 NONAME ; void CAlfCanvasVisual::EndDraw(void)
+	?FindTag@CAlfCanvasVisual@@UAEPAVCAlfVisual@@ABVTDesC8@@@Z @ 1077 NONAME ; class CAlfVisual * CAlfCanvasVisual::FindTag(class TDesC8 const &)
+	?LoadIdentity@CAlfCanvasVisual@@QAEXXZ @ 1078 NONAME ; void CAlfCanvasVisual::LoadIdentity(void)
+	?PropertyOwnerExtension@CAlfCanvasVisual@@MAEXABVTUid@@PAPAX@Z @ 1079 NONAME ; void CAlfCanvasVisual::PropertyOwnerExtension(class TUid const &, void * *)
+	?RemoveAndDestroyAllD@CAlfCanvasVisual@@UAEXXZ @ 1080 NONAME ; void CAlfCanvasVisual::RemoveAndDestroyAllD(void)
+	?Rotate@CAlfCanvasVisual@@QAEXABM000@Z @ 1081 NONAME ; void CAlfCanvasVisual::Rotate(float const &, float const &, float const &, float const &)
+	?Scale@CAlfCanvasVisual@@QAEXABM00@Z @ 1082 NONAME ; void CAlfCanvasVisual::Scale(float const &, float const &, float const &)
+	?SetCanvasObserver@CAlfCanvasVisual@@QAEXPAVMAlfCanvasObserver@@@Z @ 1083 NONAME ; void CAlfCanvasVisual::SetCanvasObserver(class MAlfCanvasObserver *)
+	?SetPenOpacity@CAlfCanvasVisual@@QAEXABM@Z @ 1084 NONAME ; void CAlfCanvasVisual::SetPenOpacity(float const &)
+	?SetPenColor@CAlfCanvasVisual@@QAEXABVTRgb@@@Z @ 1085 NONAME ; void CAlfCanvasVisual::SetPenColor(class TRgb const &)
+	?SetPenWidth@CAlfCanvasVisual@@QAEXABM@Z @ 1086 NONAME ; void CAlfCanvasVisual::SetPenWidth(float const &)
+	?SetPolygonDrawMode@CAlfCanvasVisual@@QAEXW4TAlfPolygonDrawMode@@@Z @ 1087 NONAME ; void CAlfCanvasVisual::SetPolygonDrawMode(enum TAlfPolygonDrawMode)
+	?SetTextAlign@CAlfCanvasVisual@@QAEXW4TAlfAlignHorizontal@@W4TAlfAlignVertical@@@Z @ 1088 NONAME ; void CAlfCanvasVisual::SetTextAlign(enum TAlfAlignHorizontal, enum TAlfAlignVertical)
+	?SetTextStyle@CAlfCanvasVisual@@QAEXABVCAlfTextStyle@@@Z @ 1089 NONAME ; void CAlfCanvasVisual::SetTextStyle(class CAlfTextStyle const &)
+	?Translate@CAlfCanvasVisual@@QAEXABM00@Z @ 1090 NONAME ; void CAlfCanvasVisual::Translate(float const &, float const &, float const &)
+	?UpdateChildrenLayout@CAlfCanvasVisual@@UAEXH@Z @ 1091 NONAME ; void CAlfCanvasVisual::UpdateChildrenLayout(int)
+	?SetHighlightRange@CAlfTextVisual@@QAEXHHAAVTRgb@@0@Z @ 1092 NONAME ; void CAlfTextVisual::SetHighlightRange(int, int, class TRgb &, class TRgb &)
+	?ScaleMode@CAlfImageVisual@@QAE?AW4TScaleMode@1@XZ @ 1093 NONAME ; enum CAlfImageVisual::TScaleMode CAlfImageVisual::ScaleMode(void)
+	?StartL@CAlfAsynchStartup@@SAXXZ @ 1094 NONAME ; void CAlfAsynchStartup::StartL(void)
+	?ForceSetVisibleArea@CAlfDisplay@@QAEXABVTRect@@@Z @ 1095 NONAME ; void CAlfDisplay::ForceSetVisibleArea(class TRect const &)
+	?SetClientWindowForDrawingL@CAlfDisplay@@QAEXPAVRWindow@@PAVCAlfVisual@@@Z @ 1096 NONAME ; void CAlfDisplay::SetClientWindowForDrawingL(class RWindow *, class CAlfVisual *)
+	?PostCommandsL@CAlfClientWindow@@QAEXAAVTDes8@@W4TAlfCommandBufferStatus@@@Z @ 1097 NONAME ; void CAlfClientWindow::PostCommandsL(class TDes8 &, enum TAlfCommandBufferStatus)
+	?SetEffectL@CAlfVisual@@QAEXABVTDesC16@@@Z @ 1098 NONAME ; void CAlfVisual::SetEffectL(class TDesC16 const &)
+	?NewL@CAlfClientWindow@@SAPAV1@AAVCAlfEnv@@AAVRWindow@@@Z @ 1099 NONAME ; class CAlfClientWindow * CAlfClientWindow::NewL(class CAlfEnv &, class RWindow &)
+	??1CAlfClientWindow@@UAE@XZ @ 1100 NONAME ; CAlfClientWindow::~CAlfClientWindow(void)
+	?MeasureFPS@RAlfDirectClient@@QAEXJH@Z @ 1101 NONAME ; void RAlfDirectClient::MeasureFPS(long, int)
+	??0RAlfDirectClient@@QAE@XZ @ 1102 NONAME ; RAlfDirectClient::RAlfDirectClient(void)
+	?Disconnect@RAlfDirectClient@@QAEXXZ @ 1103 NONAME ; void RAlfDirectClient::Disconnect(void)
+	?EnableLowMemoryState@RAlfDirectClient@@QAEXH@Z @ 1104 NONAME ; void RAlfDirectClient::EnableLowMemoryState(int)
+	?SetGroupEffectL@CAlfVisual@@QAEXABVTDesC16@@H@Z @ 1105 NONAME ; void CAlfVisual::SetGroupEffectL(class TDesC16 const &, int)
+	?ForceSwRendering@RAlfDirectClient@@QAEHH@Z @ 1106 NONAME ; int RAlfDirectClient::ForceSwRendering(int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/eabi/alfclientu.DEF	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1341 @@
+EXPORTS
+	_ZN7CAlfEnv4NewLE8TVersion @ 1 NONAME
+	_ZN7CAlfEnv5NewLCE8TVersion @ 2 NONAME
+	_ZNK7CAlfEnv7VersionEv @ 3 NONAME
+	_ZN10CAlfLayout11SetBaseUnitERK12TAlfXYMetric @ 4 NONAME
+	_ZN10CAlfLayout12ChildOrdinalEi @ 5 NONAME
+	_ZN10CAlfLayout15SetInnerPaddingERK12TAlfXYMetric @ 6 NONAME
+	_ZN10CAlfLayout15SetInnerPaddingERK6TPoint @ 7 NONAME
+	_ZN10CAlfLayout15SetScrollOffsetERK14TAlfTimedPoint @ 8 NONAME
+	_ZN10CAlfLayout16EnableScrollingLEi @ 9 NONAME
+	_ZN10CAlfLayout16MoveVisualToBackER10CAlfVisuali @ 10 NONAME
+	_ZN10CAlfLayout17MoveVisualToFrontER10CAlfVisuali @ 11 NONAME
+	_ZN10CAlfLayout17SetTransitionTimeEi @ 12 NONAME
+	_ZN10CAlfLayout20RemoveAndDestroyAllDEv @ 13 NONAME
+	_ZN10CAlfLayout20UpdateChildrenLayoutEi @ 14 NONAME
+	_ZN10CAlfLayout22DoRemoveAndDestroyAllDEv @ 15 NONAME
+	_ZN10CAlfLayout22PropertyOwnerExtensionERK4TUidPPv @ 16 NONAME
+	_ZN10CAlfLayout6AppendEP10CAlfVisualii @ 17 NONAME
+	_ZN10CAlfLayout6InsertEP10CAlfVisuali @ 18 NONAME
+	_ZN10CAlfLayout6RemoveEP10CAlfVisuali @ 19 NONAME
+	_ZN10CAlfLayout7AddNewLER11CAlfControlPS_ @ 20 NONAME
+	_ZN10CAlfLayout7FindTagERK6TDesC8 @ 21 NONAME
+	_ZN10CAlfLayout7ReorderER10CAlfVisualii @ 22 NONAME
+	_ZN10CAlfLayout8ChildPosEiR6TPoint @ 23 NONAME
+	_ZN10CAlfLayout9ChildSizeEiR5TSize @ 24 NONAME
+	_ZN10CAlfLayoutC1Ev @ 25 NONAME
+	_ZN10CAlfLayoutC2Ev @ 26 NONAME
+	_ZN10CAlfLayoutD0Ev @ 27 NONAME
+	_ZN10CAlfLayoutD1Ev @ 28 NONAME
+	_ZN10CAlfLayoutD2Ev @ 29 NONAME
+	_ZN10CAlfRoster10ClearFocusEv @ 30 NONAME
+	_ZN10CAlfRoster10HideVisualER10CAlfVisual @ 31 NONAME
+	_ZN10CAlfRoster11ShowVisualLER10CAlfVisual @ 32 NONAME
+	_ZN10CAlfRoster17MoveVisualToFrontER10CAlfVisual @ 33 NONAME
+	_ZN10CAlfRoster23AddPointerEventObserverE21TAlfPointerEventFlagsR11CAlfControl @ 34 NONAME
+	_ZN10CAlfRoster24SetPointerEventObserversEjR11CAlfControl @ 35 NONAME
+	_ZN10CAlfRoster26RemovePointerEventObserverE21TAlfPointerEventFlagsR11CAlfControl @ 36 NONAME
+	_ZN10CAlfRoster4HideER16CAlfControlGroup @ 37 NONAME
+	_ZN10CAlfRoster5ShowLER16CAlfControlGroupi @ 38 NONAME
+	_ZN10CAlfRoster8SetFocusER11CAlfControl @ 39 NONAME
+	_ZN10CAlfStatic3EnvEv @ 40 NONAME
+	_ZN10CAlfStatic4DataEv @ 41 NONAME
+	_ZN10CAlfStatic5NewLCEP7CAlfEnv @ 42 NONAME
+	_ZN10CAlfVisual10ClearFlagsEj @ 43 NONAME
+	_ZN10CAlfVisual10ConstructLER11CAlfControl @ 44 NONAME
+	_ZN10CAlfVisual10ConstructLER11CAlfControliiRK6TDesC8 @ 45 NONAME
+	_ZN10CAlfVisual10CopyValuesERKS_ii @ 46 NONAME
+	_ZN10CAlfVisual10SetMaxSizeERK5TSize @ 47 NONAME
+	_ZN10CAlfVisual10SetMinSizeERK5TSize @ 48 NONAME
+	_ZN10CAlfVisual10SetOpacityERK14TAlfTimedValue @ 49 NONAME
+	_ZN10CAlfVisual10SetPaddingERK13TAlfBoxMetric @ 50 NONAME
+	_ZN10CAlfVisual10SetPaddingERK6TPoint @ 51 NONAME
+	_ZN10CAlfVisual10SetPaddingEi @ 52 NONAME
+	_ZN10CAlfVisual11MoveToFrontEi @ 53 NONAME
+	_ZN10CAlfVisual11SetClippingEi @ 54 NONAME
+	_ZN10CAlfVisual14EnableBrushesLEi @ 55 NONAME
+	_ZN10CAlfVisual14SetDepthOffsetERK14TAlfTimedValue @ 56 NONAME
+	_ZN10CAlfVisual14TransformationEv @ 57 NONAME
+	_ZN10CAlfVisual20RemoveAndDestroyAllDEv @ 58 NONAME
+	_ZN10CAlfVisual20UpdateChildrenLayoutEi @ 59 NONAME
+	_ZN10CAlfVisual21EnableTransformationLEi @ 60 NONAME
+	_ZN10CAlfVisual21SetCenteredPosAndSizeERK6TPointRK5TSizei @ 61 NONAME
+	_ZN10CAlfVisual22DoRemoveAndDestroyAllDEv @ 62 NONAME
+	_ZN10CAlfVisual22PropertyOwnerExtensionERK4TUidPPv @ 63 NONAME
+	_ZN10CAlfVisual4MoveERK6TPointi @ 64 NONAME
+	_ZN10CAlfVisual5MimicERS_i @ 65 NONAME
+	_ZN10CAlfVisual6SetPosERK13TAlfRealPointi @ 66 NONAME
+	_ZN10CAlfVisual6SetPosERK14TAlfTimedPoint @ 67 NONAME
+	_ZN10CAlfVisual7BrushesEv @ 68 NONAME
+	_ZN10CAlfVisual7FindTagERK6TDesC8 @ 69 NONAME
+	_ZN10CAlfVisual7SetFlagE15TAlfVisualFlags @ 70 NONAME
+	_ZN10CAlfVisual7SetRectERK12TAlfRealRecti @ 71 NONAME
+	_ZN10CAlfVisual7SetSizeERK12TAlfRealSizei @ 72 NONAME
+	_ZN10CAlfVisual7SetSizeERK14TAlfTimedPoint @ 73 NONAME
+	_ZN10CAlfVisual7SetTagLERK6TDesC8 @ 74 NONAME
+	_ZN10CAlfVisual8SetFlagsEj @ 75 NONAME
+	_ZN10CAlfVisual8SetOwnerER11CAlfControl @ 76 NONAME
+	_ZN10CAlfVisual9ClearFlagE15TAlfVisualFlags @ 77 NONAME
+	_ZN10CAlfVisual9SetOriginE17TAlfVisualHOrigin17TAlfVisualVOrigin @ 78 NONAME
+	_ZN10CAlfVisualC1Ev @ 79 NONAME
+	_ZN10CAlfVisualC2Ev @ 80 NONAME
+	_ZN10CAlfVisualD0Ev @ 81 NONAME
+	_ZN10CAlfVisualD1Ev @ 82 NONAME
+	_ZN10CAlfVisualD2Ev @ 83 NONAME
+	_ZN10TAlfMetricC1Efii @ 84 NONAME
+	_ZN10TAlfMetricC1Ei @ 85 NONAME
+	_ZN10TAlfMetricC2Efii @ 86 NONAME
+	_ZN10TAlfMetricC2Ei @ 87 NONAME
+	_ZN11CAlfControl10ConstructLER7CAlfEnv @ 88 NONAME
+	_ZN11CAlfControl11BindDisplayER11CAlfDisplay @ 89 NONAME
+	_ZN11CAlfControl11OfferEventLERK9TAlfEvent @ 90 NONAME
+	_ZN11CAlfControl12AcquireFocusEv @ 91 NONAME
+	_ZN11CAlfControl12FocusChangedER11CAlfDisplayi @ 92 NONAME
+	_ZN11CAlfControl12VisualAddedLEP10CAlfVisual @ 93 NONAME
+	_ZN11CAlfControl13AppendLayoutLE14TAlfLayoutTypeP10CAlfLayouti @ 94 NONAME
+	_ZN11CAlfControl13AppendVisualLE14TAlfVisualTypeP10CAlfLayouti @ 95 NONAME
+	_ZN11CAlfControl13HostChangingLEPS_ @ 96 NONAME
+	_ZN11CAlfControl13VisualRemovedEP10CAlfVisual @ 97 NONAME
+	_ZN11CAlfControl14AddConnectionLEPS_i @ 98 NONAME
+	_ZN11CAlfControl15RelinquishFocusEv @ 99 NONAME
+	_ZN11CAlfControl15VisualDestroyedER10CAlfVisual @ 100 NONAME
+	_ZN11CAlfControl16ConnectionAddedLEPS_i @ 101 NONAME
+	_ZN11CAlfControl16RemoveConnectionEPS_ @ 102 NONAME
+	_ZN11CAlfControl17CancelAllCommandsEv @ 103 NONAME
+	_ZN11CAlfControl17ConnectionRemovedEPS_i @ 104 NONAME
+	_ZN11CAlfControl19VisualLayoutUpdatedER10CAlfVisual @ 105 NONAME
+	_ZN11CAlfControl22PropertyOwnerExtensionERK4TUidPPv @ 106 NONAME
+	_ZN11CAlfControl23NotifyControlVisibilityEiR11CAlfDisplay @ 107 NONAME
+	_ZN11CAlfControl23VisualPrepareDrawFailedER10CAlfVisuali @ 108 NONAME
+	_ZN11CAlfControl5SetIdEi @ 109 NONAME
+	_ZN11CAlfControl5ShowLER11CAlfDisplay @ 110 NONAME
+	_ZN11CAlfControl6AppendEP10CAlfVisualP10CAlfLayout @ 111 NONAME
+	_ZN11CAlfControl6RemoveEP10CAlfVisual @ 112 NONAME
+	_ZN11CAlfControl7SetHostEPS_ @ 113 NONAME
+	_ZN11CAlfControl7SetRoleEi @ 114 NONAME
+	_ZN11CAlfControl9SetHostIdEi @ 115 NONAME
+	_ZN11CAlfControlC1Ev @ 116 NONAME
+	_ZN11CAlfControlC2Ev @ 117 NONAME
+	_ZN11CAlfControlD0Ev @ 118 NONAME
+	_ZN11CAlfControlD1Ev @ 119 NONAME
+	_ZN11CAlfControlD2Ev @ 120 NONAME
+	_ZN11CAlfDisplay10SetQualityE11TAlfQuality @ 121 NONAME
+	_ZN11CAlfDisplay11SetUseDepthEi @ 122 NONAME
+	_ZN11CAlfDisplay14SetVisibleAreaERK5TRect @ 123 NONAME
+	_ZN11CAlfDisplay16SetFocusedEditorEP29MAlfInputCapabilitiesSupplier @ 124 NONAME
+	_ZN11CAlfDisplay19SetClearBackgroundLEi @ 125 NONAME
+	_ZN11CAlfDisplay3EnvEv @ 126 NONAME
+	_ZN11CAlfDisplay6RosterEv @ 127 NONAME
+	_ZN11CAlfDisplay8SetDirtyEv @ 128 NONAME
+	_ZN11CAlfDisplay9SetUsageLEj @ 129 NONAME
+	_ZN11CAlfM3GMesh10LoadSceneLERK7TDesC16 @ 130 NONAME
+	_ZN11CAlfTexture11SetPriorityEi @ 131 NONAME
+	_ZN11CAlfTexture13StopAnimationEv @ 132 NONAME
+	_ZN11CAlfTexture14MaxTextureSizeEv @ 133 NONAME
+	_ZN11CAlfTexture14StartAnimationEv @ 134 NONAME
+	_ZN11TAlfCommand16CommandExtensionERK4TUidPPv @ 135 NONAME
+	_ZN11TAlfCommandC2E15TAlfCommandType @ 136 NONAME
+	_ZN11TAlfCommandD0Ev @ 137 NONAME
+	_ZN11TAlfCommandD1Ev @ 138 NONAME
+	_ZN11TAlfCommandD2Ev @ 139 NONAME
+	_ZN12TAlfXYMetricC1ERK10TAlfMetric @ 140 NONAME
+	_ZN12TAlfXYMetricC1ERK10TAlfMetricS2_ @ 141 NONAME
+	_ZN12TAlfXYMetricC1Ev @ 142 NONAME
+	_ZN12TAlfXYMetricC2ERK10TAlfMetric @ 143 NONAME
+	_ZN12TAlfXYMetricC2ERK10TAlfMetricS2_ @ 144 NONAME
+	_ZN12TAlfXYMetricC2Ev @ 145 NONAME
+	_ZN13CAlfCurvePath10AppendArcLERK6TPointRK5TSizefff @ 146 NONAME
+	_ZN13CAlfCurvePath10EnableLoopEi @ 147 NONAME
+	_ZN13CAlfCurvePath11AppendLineLERK6TPointS2_f @ 148 NONAME
+	_ZN13CAlfCurvePath4NewLER7CAlfEnvi @ 149 NONAME
+	_ZN13CAlfCurvePath5NewLCER7CAlfEnvi @ 150 NONAME
+	_ZN13CAlfCurvePath5ResetEv @ 151 NONAME
+	_ZN13CAlfCurvePath9SetOffsetERK14TAlfTimedPoint @ 152 NONAME
+	_ZN13CAlfCurvePath9SetOriginEf @ 153 NONAME
+	_ZN13CAlfCurvePathD0Ev @ 154 NONAME
+	_ZN13CAlfCurvePathD1Ev @ 155 NONAME
+	_ZN13CAlfCurvePathD2Ev @ 156 NONAME
+	_ZN13CAlfTextStyle11SetParentIdEi @ 157 NONAME
+	_ZN13CAlfTextStyle12SetTextColorERK4TRgb @ 158 NONAME
+	_ZN13CAlfTextStyle12SetUnderlineEi @ 159 NONAME
+	_ZN13CAlfTextStyle16SetStrikeThroughEi @ 160 NONAME
+	_ZN13CAlfTextStyle18SetTextSizeInTwipsEii @ 161 NONAME
+	_ZN13CAlfTextStyle19SetTextSizeInPixelsEii @ 162 NONAME
+	_ZN13CAlfTextStyle7SetBoldEi @ 163 NONAME
+	_ZN13CAlfTextStyle9SetItalicEi @ 164 NONAME
+	_ZN13TAlfBoxMetricC1ERK10TAlfMetric @ 165 NONAME
+	_ZN13TAlfBoxMetricC1ERK10TAlfMetricS2_S2_S2_ @ 166 NONAME
+	_ZN13TAlfBoxMetricC1ERK12TAlfXYMetric @ 167 NONAME
+	_ZN13TAlfBoxMetricC1Ev @ 168 NONAME
+	_ZN13TAlfBoxMetricC2ERK10TAlfMetric @ 169 NONAME
+	_ZN13TAlfBoxMetricC2ERK10TAlfMetricS2_S2_S2_ @ 170 NONAME
+	_ZN13TAlfBoxMetricC2ERK12TAlfXYMetric @ 171 NONAME
+	_ZN13TAlfBoxMetricC2Ev @ 172 NONAME
+	_ZN14CAlfBrushArray2AtEi @ 173 NONAME
+	_ZN14CAlfBrushArray5ResetEv @ 174 NONAME
+	_ZN14CAlfBrushArray6RemoveEi @ 175 NONAME
+	_ZN14CAlfBrushArray7AppendLEP9CAlfBrush13TAlfOwnership @ 176 NONAME
+	_ZN14CAlfBrushArray7InsertLEiP9CAlfBrush13TAlfOwnership @ 177 NONAME
+	_ZN14CAlfBrushArrayixEi @ 178 NONAME
+	_ZN14CAlfDeckLayout10ConstructLER11CAlfControl @ 179 NONAME
+	_ZN14CAlfDeckLayout20RemoveAndDestroyAllDEv @ 180 NONAME
+	_ZN14CAlfDeckLayout20UpdateChildrenLayoutEi @ 181 NONAME
+	_ZN14CAlfDeckLayout22DoRemoveAndDestroyAllDEv @ 182 NONAME
+	_ZN14CAlfDeckLayout22PropertyOwnerExtensionERK4TUidPPv @ 183 NONAME
+	_ZN14CAlfDeckLayout7AddNewLER11CAlfControlP10CAlfLayout @ 184 NONAME
+	_ZN14CAlfDeckLayout7FindTagERK6TDesC8 @ 185 NONAME
+	_ZN14CAlfDeckLayoutC1Ev @ 186 NONAME
+	_ZN14CAlfDeckLayoutC2Ev @ 187 NONAME
+	_ZN14CAlfDeckLayoutD0Ev @ 188 NONAME
+	_ZN14CAlfDeckLayoutD1Ev @ 189 NONAME
+	_ZN14CAlfDeckLayoutD2Ev @ 190 NONAME
+	_ZN14CAlfFlowLayout10ConstructLER11CAlfControl @ 191 NONAME
+	_ZN14CAlfFlowLayout12SetCenteringEi @ 192 NONAME
+	_ZN14CAlfFlowLayout16SetFlowDirectionENS_14TFlowDirectionE @ 193 NONAME
+	_ZN14CAlfFlowLayout20RemoveAndDestroyAllDEv @ 194 NONAME
+	_ZN14CAlfFlowLayout20UpdateChildrenLayoutEi @ 195 NONAME
+	_ZN14CAlfFlowLayout22DoRemoveAndDestroyAllDEv @ 196 NONAME
+	_ZN14CAlfFlowLayout22PropertyOwnerExtensionERK4TUidPPv @ 197 NONAME
+	_ZN14CAlfFlowLayout7AddNewLER11CAlfControlP10CAlfLayout @ 198 NONAME
+	_ZN14CAlfFlowLayout7FindTagERK6TDesC8 @ 199 NONAME
+	_ZN14CAlfFlowLayout7SetModeEi @ 200 NONAME
+	_ZN14CAlfFlowLayoutC1Ev @ 201 NONAME
+	_ZN14CAlfFlowLayoutC2Ev @ 202 NONAME
+	_ZN14CAlfFlowLayoutD0Ev @ 203 NONAME
+	_ZN14CAlfFlowLayoutD1Ev @ 204 NONAME
+	_ZN14CAlfFlowLayoutD2Ev @ 205 NONAME
+	_ZN14CAlfFrameBrush14SetFrameRectsLERK5TRectS2_ @ 206 NONAME
+	_ZN14CAlfFrameBrush4NewLER7CAlfEnvRK11TAknsItemIDii @ 207 NONAME
+	_ZN14CAlfFrameBrush5NewLCER7CAlfEnvRK11TAknsItemIDii @ 208 NONAME
+	_ZN14CAlfGridLayout10ConstructLER11CAlfControl @ 209 NONAME
+	_ZN14CAlfGridLayout11SetColumnsLERK6RArrayIiE @ 210 NONAME
+	_ZN14CAlfGridLayout11SetColumnsLEi @ 211 NONAME
+	_ZN14CAlfGridLayout12FillWeightsLE17TAlfGridDimensioniRK10TAlfMetric @ 212 NONAME
+	_ZN14CAlfGridLayout12SetExpandingEi @ 213 NONAME
+	_ZN14CAlfGridLayout13AppendWeightLE17TAlfGridDimensionRK10TAlfMetric @ 214 NONAME
+	_ZN14CAlfGridLayout13InsertWeightLE17TAlfGridDimensionRK10TAlfMetrici @ 215 NONAME
+	_ZN14CAlfGridLayout13RemoveWeightLE17TAlfGridDimensioni @ 216 NONAME
+	_ZN14CAlfGridLayout14ReplaceWeightLE17TAlfGridDimensionRK10TAlfMetrici @ 217 NONAME
+	_ZN14CAlfGridLayout20RemoveAndDestroyAllDEv @ 218 NONAME
+	_ZN14CAlfGridLayout20UpdateChildrenLayoutEi @ 219 NONAME
+	_ZN14CAlfGridLayout22DoRemoveAndDestroyAllDEv @ 220 NONAME
+	_ZN14CAlfGridLayout22PropertyOwnerExtensionERK4TUidPPv @ 221 NONAME
+	_ZN14CAlfGridLayout7AddNewLER11CAlfControliiP10CAlfLayout @ 222 NONAME
+	_ZN14CAlfGridLayout7FindTagERK6TDesC8 @ 223 NONAME
+	_ZN14CAlfGridLayout8SetRowsLERK6RArrayIiE @ 224 NONAME
+	_ZN14CAlfGridLayout8SetRowsLEi @ 225 NONAME
+	_ZN14CAlfGridLayoutC1Ev @ 226 NONAME
+	_ZN14CAlfGridLayoutC2Ev @ 227 NONAME
+	_ZN14CAlfGridLayoutD0Ev @ 228 NONAME
+	_ZN14CAlfGridLayoutD1Ev @ 229 NONAME
+	_ZN14CAlfGridLayoutD2Ev @ 230 NONAME
+	_ZN14CAlfImageBrush10SetBordersEiiii @ 231 NONAME
+	_ZN14CAlfImageBrush12SetScaleModeEN15CAlfImageVisual10TScaleModeE @ 232 NONAME
+	_ZN14CAlfImageBrush4NewLER7CAlfEnvRK9TAlfImage @ 233 NONAME
+	_ZN14CAlfImageBrush5NewLCER7CAlfEnvRK9TAlfImage @ 234 NONAME
+	_ZN14CAlfImageBrush8SetImageERK9TAlfImage @ 235 NONAME
+	_ZN14CAlfImageBrush8SetScaleERK14TAlfTimedValue @ 236 NONAME
+	_ZN14CAlfImageBrush9SetOffsetERK14TAlfTimedPoint @ 237 NONAME
+	_ZN14CAlfLineVisual10ConstructLER11CAlfControl @ 238 NONAME
+	_ZN14CAlfLineVisual11SetStartPosERK14TAlfTimedValue @ 239 NONAME
+	_ZN14CAlfLineVisual12SetThicknessERK14TAlfTimedValue @ 240 NONAME
+	_ZN14CAlfLineVisual16SetAlphaFunctionEP19MAlfMappingFunction @ 241 NONAME
+	_ZN14CAlfLineVisual16SetWidthFunctionEP19MAlfMappingFunction @ 242 NONAME
+	_ZN14CAlfLineVisual18SetShadowThicknessERK14TAlfTimedValue @ 243 NONAME
+	_ZN14CAlfLineVisual20RemoveAndDestroyAllDEv @ 244 NONAME
+	_ZN14CAlfLineVisual20UpdateChildrenLayoutEi @ 245 NONAME
+	_ZN14CAlfLineVisual22DoRemoveAndDestroyAllDEv @ 246 NONAME
+	_ZN14CAlfLineVisual22PropertyOwnerExtensionERK4TUidPPv @ 247 NONAME
+	_ZN14CAlfLineVisual4PathEv @ 248 NONAME
+	_ZN14CAlfLineVisual7AddNewLER11CAlfControlP10CAlfLayout @ 249 NONAME
+	_ZN14CAlfLineVisual7FindTagERK6TDesC8 @ 250 NONAME
+	_ZN14CAlfLineVisual7SetPathEP13CAlfCurvePath13TAlfOwnership @ 251 NONAME
+	_ZN14CAlfLineVisual8SetImageERK9TAlfImage @ 252 NONAME
+	_ZN14CAlfLineVisual9SetEndPosERK14TAlfTimedValue @ 253 NONAME
+	_ZN14CAlfLineVisualC1Ev @ 254 NONAME
+	_ZN14CAlfLineVisualC2Ev @ 255 NONAME
+	_ZN14CAlfLineVisualD0Ev @ 256 NONAME
+	_ZN14CAlfLineVisualD1Ev @ 257 NONAME
+	_ZN14CAlfLineVisualD2Ev @ 258 NONAME
+	_ZN14CAlfMeshVisual10ConstructLER11CAlfControl @ 259 NONAME
+	_ZN14CAlfMeshVisual11CreateMeshLEi @ 260 NONAME
+	_ZN14CAlfMeshVisual11SetYawAngleERK14TAlfTimedValue @ 261 NONAME
+	_ZN14CAlfMeshVisual13SetPitchAngleERK14TAlfTimedValue @ 262 NONAME
+	_ZN14CAlfMeshVisual16SetSpecularImageERK9TAlfImage @ 263 NONAME
+	_ZN14CAlfMeshVisual17SetSecondaryAlphaERK14TAlfTimedValue @ 264 NONAME
+	_ZN14CAlfMeshVisual17SetSecondaryImageERK9TAlfImage @ 265 NONAME
+	_ZN14CAlfMeshVisual20RemoveAndDestroyAllDEv @ 266 NONAME
+	_ZN14CAlfMeshVisual20UpdateChildrenLayoutEi @ 267 NONAME
+	_ZN14CAlfMeshVisual22DoRemoveAndDestroyAllDEv @ 268 NONAME
+	_ZN14CAlfMeshVisual22PropertyOwnerExtensionERK4TUidPPv @ 269 NONAME
+	_ZN14CAlfMeshVisual4MeshEv @ 270 NONAME
+	_ZN14CAlfMeshVisual7AddNewLER11CAlfControlP10CAlfLayout @ 271 NONAME
+	_ZN14CAlfMeshVisual7FindTagERK6TDesC8 @ 272 NONAME
+	_ZN14CAlfMeshVisual8SetImageERK9TAlfImage @ 273 NONAME
+	_ZN14CAlfMeshVisual8SetScaleERK14TAlfTimedValue @ 274 NONAME
+	_ZN14CAlfMeshVisualC1Ev @ 275 NONAME
+	_ZN14CAlfMeshVisualC2Ev @ 276 NONAME
+	_ZN14CAlfMeshVisualD0Ev @ 277 NONAME
+	_ZN14CAlfMeshVisualD1Ev @ 278 NONAME
+	_ZN14CAlfMeshVisualD2Ev @ 279 NONAME
+	_ZN14CAlfTextVisual10ConstructLER11CAlfControl @ 280 NONAME
+	_ZN14CAlfTextVisual11SetWrappingENS_9TLineWrapE @ 281 NONAME
+	_ZN14CAlfTextVisual12EnableShadowEi @ 282 NONAME
+	_ZN14CAlfTextVisual12SetTextStyleEi @ 283 NONAME
+	_ZN14CAlfTextVisual13ShadowOpacityEv @ 284 NONAME
+	_ZN14CAlfTextVisual14BackgroundTypeEv @ 285 NONAME
+	_ZN14CAlfTextVisual14SetLineSpacingEiNS_17TLineSpacingUnitsE @ 286 NONAME
+	_ZN14CAlfTextVisual15SetMaxLineCountEi @ 287 NONAME
+	_ZN14CAlfTextVisual16SetShadowOpacityERK14TAlfTimedValue @ 288 NONAME
+	_ZN14CAlfTextVisual20RemoveAndDestroyAllDEv @ 289 NONAME
+	_ZN14CAlfTextVisual20UpdateChildrenLayoutEi @ 290 NONAME
+	_ZN14CAlfTextVisual22DoRemoveAndDestroyAllDEv @ 291 NONAME
+	_ZN14CAlfTextVisual22PropertyOwnerExtensionERK4TUidPPv @ 292 NONAME
+	_ZN14CAlfTextVisual5StyleEv @ 293 NONAME
+	_ZN14CAlfTextVisual7AddNewLER11CAlfControlP10CAlfLayout @ 294 NONAME
+	_ZN14CAlfTextVisual7FindTagERK6TDesC8 @ 295 NONAME
+	_ZN14CAlfTextVisual8SetAlignE19TAlfAlignHorizontal17TAlfAlignVertical @ 296 NONAME
+	_ZN14CAlfTextVisual8SetColorE4TRgb @ 297 NONAME
+	_ZN14CAlfTextVisual8SetColorERK11TAknsItemIDi @ 298 NONAME
+	_ZN14CAlfTextVisual8SetStyleE26TAlfPreconfiguredTextStyle18TAlfBackgroundType @ 299 NONAME
+	_ZN14CAlfTextVisual8SetTextLERK7TDesC16 @ 300 NONAME
+	_ZN14CAlfTextVisualC1Ev @ 301 NONAME
+	_ZN14CAlfTextVisualC2Ev @ 302 NONAME
+	_ZN14CAlfTextVisualD0Ev @ 303 NONAME
+	_ZN14CAlfTextVisualD1Ev @ 304 NONAME
+	_ZN14CAlfTextVisualD2Ev @ 305 NONAME
+	_ZN14RAlfClientBase10LaunchAppLE4TUidjR9TThreadId @ 306 NONAME
+	_ZN14RAlfClientBase12StartServerLE4TUid @ 307 NONAME
+	_ZN14RAlfClientBase19ConstructServerNameER4TBufILi128EE4TUidj @ 308 NONAME
+	_ZN14RAlfClientBase24GrantAccessToPrivateFileERK5RFileii @ 309 NONAME
+	_ZN14RAlfClientBase24GrantAccessToPrivateFileERK7TDesC16ii @ 310 NONAME
+	_ZN14RAlfClientBase5OpenLEv @ 311 NONAME
+	_ZN14RAlfClientBaseC1Ei @ 312 NONAME
+	_ZN14RAlfClientBaseC2Ei @ 313 NONAME
+	_ZN14TAlfTimedPoint18SetTargetWithSpeedERK13TAlfRealPointf @ 314 NONAME
+	_ZN14TAlfTimedPoint18SetTargetWithSpeedEff @ 315 NONAME
+	_ZN14TAlfTimedPoint28SetMappingFunctionIdentifierEi @ 316 NONAME
+	_ZN14TAlfTimedPoint8SetStyleE22TAlfInterpolationStyle @ 317 NONAME
+	_ZN14TAlfTimedPoint9SetTargetERK13TAlfRealPointi @ 318 NONAME
+	_ZN14TAlfTimedPoint9SetTargetEfi @ 319 NONAME
+	_ZN14TAlfTimedPointC1Eff @ 320 NONAME
+	_ZN14TAlfTimedPointC1Effi @ 321 NONAME
+	_ZN14TAlfTimedPointC1Ev @ 322 NONAME
+	_ZN14TAlfTimedPointC2Eff @ 323 NONAME
+	_ZN14TAlfTimedPointC2Effi @ 324 NONAME
+	_ZN14TAlfTimedPointC2Ev @ 325 NONAME
+	_ZN14TAlfTimedValue11SetValueNowERKf @ 326 NONAME
+	_ZN14TAlfTimedValue18SetTargetWithSpeedEff @ 327 NONAME
+	_ZN14TAlfTimedValue28SetMappingFunctionIdentifierEi @ 328 NONAME
+	_ZN14TAlfTimedValue5FlagsEv @ 329 NONAME
+	_ZN14TAlfTimedValue5StyleEv @ 330 NONAME
+	_ZN14TAlfTimedValue8SetStyleE22TAlfInterpolationStyle @ 331 NONAME
+	_ZN14TAlfTimedValue9SetTargetERKfi @ 332 NONAME
+	_ZN14TAlfTimedValueC1Ef @ 333 NONAME
+	_ZN14TAlfTimedValueC1Efi @ 334 NONAME
+	_ZN14TAlfTimedValueC1Ev @ 335 NONAME
+	_ZN14TAlfTimedValueC2Ef @ 336 NONAME
+	_ZN14TAlfTimedValueC2Efi @ 337 NONAME
+	_ZN14TAlfTimedValueC2Ev @ 338 NONAME
+	_ZN15CAlfBorderBrush12SetThicknessERK14TAlfTimedPoint @ 339 NONAME
+	_ZN15CAlfBorderBrush13SetEdgeOffsetERK14TAlfTimedPoint @ 340 NONAME
+	_ZN15CAlfBorderBrush14SetImageOffsetERK14TAlfTimedPoint @ 341 NONAME
+	_ZN15CAlfBorderBrush4NewLER7CAlfEnviiii @ 342 NONAME
+	_ZN15CAlfBorderBrush5NewLCER7CAlfEnviiii @ 343 NONAME
+	_ZN15CAlfBorderBrush8SetColorERK4TRgb @ 344 NONAME
+	_ZN15CAlfBorderBrush8SetImageERK9TAlfImage @ 345 NONAME
+	_ZN15CAlfImageVisual10ConstructLER11CAlfControl @ 346 NONAME
+	_ZN15CAlfImageVisual10SetStretchEii @ 347 NONAME
+	_ZN15CAlfImageVisual12SetColorModeENS_10TColorModeEf @ 348 NONAME
+	_ZN15CAlfImageVisual12SetScaleModeENS_10TScaleModeE @ 349 NONAME
+	_ZN15CAlfImageVisual12SetTurnAngleERK14TAlfTimedValue @ 350 NONAME
+	_ZN15CAlfImageVisual13SetDropShadowEi @ 351 NONAME
+	_ZN15CAlfImageVisual14SecondaryAlphaEv @ 352 NONAME
+	_ZN15CAlfImageVisual14SetStretchModeEN6CAlfGc12TStretchModeE @ 353 NONAME
+	_ZN15CAlfImageVisual17SetSecondaryAlphaERK14TAlfTimedValue @ 354 NONAME
+	_ZN15CAlfImageVisual17SetSecondaryImageERK9TAlfImage @ 355 NONAME
+	_ZN15CAlfImageVisual20RemoveAndDestroyAllDEv @ 356 NONAME
+	_ZN15CAlfImageVisual20UpdateChildrenLayoutEi @ 357 NONAME
+	_ZN15CAlfImageVisual22DoRemoveAndDestroyAllDEv @ 358 NONAME
+	_ZN15CAlfImageVisual22PropertyOwnerExtensionERK4TUidPPv @ 359 NONAME
+	_ZN15CAlfImageVisual5ScaleEv @ 360 NONAME
+	_ZN15CAlfImageVisual6OffsetEv @ 361 NONAME
+	_ZN15CAlfImageVisual7AddNewLER11CAlfControlP10CAlfLayout @ 362 NONAME
+	_ZN15CAlfImageVisual7FindTagERK6TDesC8 @ 363 NONAME
+	_ZN15CAlfImageVisual8SetColorERK4TRgb @ 364 NONAME
+	_ZN15CAlfImageVisual8SetImageERK9TAlfImage @ 365 NONAME
+	_ZN15CAlfImageVisual8SetScaleERK14TAlfTimedValue @ 366 NONAME
+	_ZN15CAlfImageVisual9SetOffsetERK14TAlfTimedPoint @ 367 NONAME
+	_ZN15CAlfImageVisual9TurnAngleEv @ 368 NONAME
+	_ZN15CAlfImageVisualC1Ev @ 369 NONAME
+	_ZN15CAlfImageVisualC2Ev @ 370 NONAME
+	_ZN15CAlfImageVisualD0Ev @ 371 NONAME
+	_ZN15CAlfImageVisualD1Ev @ 372 NONAME
+	_ZN15CAlfImageVisualD2Ev @ 373 NONAME
+	_ZN15TAlfTextCommand16CommandExtensionERK4TUidPPv @ 374 NONAME
+	_ZN15TAlfTextCommandC1ER14CAlfTextVisualRK7TDesC166TAlfOp @ 375 NONAME
+	_ZN15TAlfTextCommandC2ER14CAlfTextVisualRK7TDesC166TAlfOp @ 376 NONAME
+	_ZN16AlfVisualFactory10NewLayoutLE14TAlfLayoutTypeP10CAlfLayoutR11CAlfControlR7CAlfEnvi @ 377 NONAME
+	_ZN16AlfVisualFactory10NewVisualLE14TAlfVisualTypeP10CAlfLayoutR11CAlfControlR7CAlfEnvi @ 378 NONAME
+	_ZN16AlfVisualFactory11NewLayoutLCE14TAlfLayoutTypeP10CAlfLayoutR11CAlfControlR7CAlfEnvi @ 379 NONAME
+	_ZN16AlfVisualFactory11NewVisualLCE14TAlfVisualTypeP10CAlfLayoutR11CAlfControlR7CAlfEnvi @ 380 NONAME
+	_ZN16CAlfAnchorLayout10ConstructLER11CAlfControl @ 381 NONAME
+	_ZN16CAlfAnchorLayout12RemoveAnchorE10TAlfAnchori @ 382 NONAME
+	_ZN16CAlfAnchorLayout20RemoveAndDestroyAllDEv @ 383 NONAME
+	_ZN16CAlfAnchorLayout20UpdateChildrenLayoutEi @ 384 NONAME
+	_ZN16CAlfAnchorLayout21SetRelativeAnchorRectEi16TAlfAnchorOriginS0_RK13TAlfRealPointS0_S0_S3_ @ 385 NONAME
+	_ZN16CAlfAnchorLayout22DoRemoveAndDestroyAllDEv @ 386 NONAME
+	_ZN16CAlfAnchorLayout22PropertyOwnerExtensionERK4TUidPPv @ 387 NONAME
+	_ZN16CAlfAnchorLayout5ResetEv @ 388 NONAME
+	_ZN16CAlfAnchorLayout7AddNewLER11CAlfControlP10CAlfLayout @ 389 NONAME
+	_ZN16CAlfAnchorLayout7FindTagERK6TDesC8 @ 390 NONAME
+	_ZN16CAlfAnchorLayout9SetAnchorE10TAlfAnchori16TAlfAnchorOriginS1_16TAlfAnchorMetricS2_RK14TAlfTimedPoint @ 391 NONAME
+	_ZN16CAlfAnchorLayoutC1Ev @ 392 NONAME
+	_ZN16CAlfAnchorLayoutC2Ev @ 393 NONAME
+	_ZN16CAlfAnchorLayoutD0Ev @ 394 NONAME
+	_ZN16CAlfAnchorLayoutD1Ev @ 395 NONAME
+	_ZN16CAlfAnchorLayoutD2Ev @ 396 NONAME
+	_ZN16CAlfControlGroup14SetAcceptInputEi @ 397 NONAME
+	_ZN16CAlfControlGroup14TransformationEv @ 398 NONAME
+	_ZN16CAlfControlGroup21EnableTransformationLEi @ 399 NONAME
+	_ZN16CAlfControlGroup6RemoveEP11CAlfControl @ 400 NONAME
+	_ZN16CAlfControlGroup7AppendLEP11CAlfControl @ 401 NONAME
+	_ZN16CAlfGenComponent10IdentifierEv @ 402 NONAME
+	_ZN16CAlfGenComponent15CancelAsynchCmdEi @ 403 NONAME
+	_ZN16CAlfGenComponent16DoSynchronousCmdEjRK6TDesC8R5TDes8 @ 404 NONAME
+	_ZN16CAlfGenComponent18DoAsynchronousCmdLEjRK6TDesC8R5TDes8P19MAlfAsyncOpObserver @ 405 NONAME
+	_ZN16CAlfGenComponent4NewLER7CAlfEnviiRK6TDesC8 @ 406 NONAME
+	_ZN16CAlfGenComponentD0Ev @ 407 NONAME
+	_ZN16CAlfGenComponentD1Ev @ 408 NONAME
+	_ZN16CAlfGenComponentD2Ev @ 409 NONAME
+	_ZN16TAlfGroupCommand16CommandExtensionERK4TUidPPv @ 410 NONAME
+	_ZN16TAlfGroupCommandC1ER16CAlfControlGroup6TAlfOpP11CAlfDisplay @ 411 NONAME
+	_ZN16TAlfGroupCommandC2ER16CAlfControlGroup6TAlfOpP11CAlfDisplay @ 412 NONAME
+	_ZN16TAlfImageCommand16CommandExtensionERK4TUidPPv @ 413 NONAME
+	_ZN16TAlfImageCommandC1ER15CAlfImageVisualRK9TAlfImage6TAlfOp @ 414 NONAME
+	_ZN16TAlfImageCommandC2ER15CAlfImageVisualRK9TAlfImage6TAlfOp @ 415 NONAME
+	_ZN16TAlfPointCommand16CommandExtensionERK4TUidPPv @ 416 NONAME
+	_ZN16TAlfPointCommandC1EPv22TAlfPointCommandTarget13TAlfRealPointiNS_16TParameterTargetE @ 417 NONAME
+	_ZN16TAlfPointCommandC1EPv22TAlfPointCommandTarget6TAlfOp @ 418 NONAME
+	_ZN16TAlfPointCommandC1EPv22TAlfPointCommandTarget6TAlfOp13TAlfRealPointfNS_16TParameterTargetE @ 419 NONAME
+	_ZN16TAlfPointCommandC2EPv22TAlfPointCommandTarget13TAlfRealPointiNS_16TParameterTargetE @ 420 NONAME
+	_ZN16TAlfPointCommandC2EPv22TAlfPointCommandTarget6TAlfOp @ 421 NONAME
+	_ZN16TAlfPointCommandC2EPv22TAlfPointCommandTarget6TAlfOp13TAlfRealPointfNS_16TParameterTargetE @ 422 NONAME
+	_ZN16TAlfValueCommand16CommandExtensionERK4TUidPPv @ 423 NONAME
+	_ZN16TAlfValueCommandC1EPv22TAlfValueCommandTarget6TAlfOpff @ 424 NONAME
+	_ZN16TAlfValueCommandC1EPv22TAlfValueCommandTargetfi @ 425 NONAME
+	_ZN16TAlfValueCommandC2EPv22TAlfValueCommandTarget6TAlfOpff @ 426 NONAME
+	_ZN16TAlfValueCommandC2EPv22TAlfValueCommandTargetfi @ 427 NONAME
+	_ZN17CAlfGradientBrush12AppendColorLEfRK4TRgbf @ 428 NONAME
+	_ZN17CAlfGradientBrush12SetDirectionENS_10TDirectionE @ 429 NONAME
+	_ZN17CAlfGradientBrush4NewLER7CAlfEnv @ 430 NONAME
+	_ZN17CAlfGradientBrush5NewLCER7CAlfEnv @ 431 NONAME
+	_ZN17CAlfGradientBrush8SetColorERK4TRgbf @ 432 NONAME
+	_ZN17CAlfGradientBrush8SetImageERK9TAlfImage @ 433 NONAME
+	_ZN17CAlfLCTGridLayout10ConstructLER11CAlfControl @ 434 NONAME
+	_ZN17CAlfLCTGridLayout14SetColsAndRowsER34TAknLayoutHierarchyComponentHandleRK14TAlfTimedPoint @ 435 NONAME
+	_ZN17CAlfLCTGridLayout20RemoveAndDestroyAllDEv @ 436 NONAME
+	_ZN17CAlfLCTGridLayout20UpdateChildrenLayoutEi @ 437 NONAME
+	_ZN17CAlfLCTGridLayout22DoRemoveAndDestroyAllDEv @ 438 NONAME
+	_ZN17CAlfLCTGridLayout22PropertyOwnerExtensionERK4TUidPPv @ 439 NONAME
+	_ZN17CAlfLCTGridLayout7AddNewLER11CAlfControlP10CAlfLayout @ 440 NONAME
+	_ZN17CAlfLCTGridLayout7FindTagERK6TDesC8 @ 441 NONAME
+	_ZN17CAlfLCTGridLayoutC1Ev @ 442 NONAME
+	_ZN17CAlfLCTGridLayoutC2Ev @ 443 NONAME
+	_ZN17CAlfLCTGridLayoutD0Ev @ 444 NONAME
+	_ZN17CAlfLCTGridLayoutD1Ev @ 445 NONAME
+	_ZN17CAlfLCTGridLayoutD2Ev @ 446 NONAME
+	_ZN17CAlfLCTTextVisual10ConstructLER11CAlfControl @ 447 NONAME
+	_ZN17CAlfLCTTextVisual11SetTextPaneER34TAknLayoutHierarchyComponentHandle @ 448 NONAME
+	_ZN17CAlfLCTTextVisual20RemoveAndDestroyAllDEv @ 449 NONAME
+	_ZN17CAlfLCTTextVisual20UpdateChildrenLayoutEi @ 450 NONAME
+	_ZN17CAlfLCTTextVisual22DoRemoveAndDestroyAllDEv @ 451 NONAME
+	_ZN17CAlfLCTTextVisual22PropertyOwnerExtensionERK4TUidPPv @ 452 NONAME
+	_ZN17CAlfLCTTextVisual7AddNewLER11CAlfControlP10CAlfLayout @ 453 NONAME
+	_ZN17CAlfLCTTextVisual7FindTagERK6TDesC8 @ 454 NONAME
+	_ZN17CAlfLCTTextVisualC1Ev @ 455 NONAME
+	_ZN17CAlfLCTTextVisualC2Ev @ 456 NONAME
+	_ZN17CAlfLCTTextVisualD0Ev @ 457 NONAME
+	_ZN17CAlfLCTTextVisualD1Ev @ 458 NONAME
+	_ZN17CAlfLCTTextVisualD2Ev @ 459 NONAME
+	_ZN17CAlfPropertyOwner12CopyPropertyERKS_RK6TDesC8 @ 460 NONAME
+	_ZN17CAlfPropertyOwner13PropertyClearEv @ 461 NONAME
+	_ZN17CAlfPropertyOwner14PropertyRemoveERK6TDesC8 @ 462 NONAME
+	_ZN17CAlfPropertyOwner18PropertySetStringLERK6TDesC8RK7TDesC16 @ 463 NONAME
+	_ZN17CAlfPropertyOwner19PropertySetIntegerLERK6TDesC8iii @ 464 NONAME
+	_ZN17CAlfPropertyOwner22PropertyOwnerExtensionERK4TUidPPv @ 465 NONAME
+	_ZN17CAlfPropertyOwnerC1Ev @ 466 NONAME
+	_ZN17CAlfPropertyOwnerC2Ev @ 467 NONAME
+	_ZN17CAlfPropertyOwnerD0Ev @ 468 NONAME
+	_ZN17CAlfPropertyOwnerD1Ev @ 469 NONAME
+	_ZN17CAlfPropertyOwnerD2Ev @ 470 NONAME
+	_ZN17TAlfActionCommand16CommandExtensionERK4TUidPPv @ 471 NONAME
+	_ZN17TAlfActionCommandC1Ei @ 472 NONAME
+	_ZN17TAlfActionCommandC2Ei @ 473 NONAME
+	_ZN17TAlfMarkerCommand16CommandExtensionERK4TUidPPv @ 474 NONAME
+	_ZN17TAlfMarkerCommandC1Ei @ 475 NONAME
+	_ZN17TAlfMarkerCommandC2Ei @ 476 NONAME
+	_ZN17TAlfObjectCommand16CommandExtensionERK4TUidPPv @ 477 NONAME
+	_ZN17TAlfObjectCommandC1E15TAlfCommandTypePv6TAlfOp @ 478 NONAME
+	_ZN17TAlfObjectCommandC2E15TAlfCommandTypePv6TAlfOp @ 479 NONAME
+	_ZN17TAlfScrollerEventC1ENS_5TCodeENS_12TOrientationEi @ 480 NONAME
+	_ZN17TAlfScrollerEventC2ENS_5TCodeENS_12TOrientationEi @ 481 NONAME
+	_ZN17TAlfVisualCommand16CommandExtensionERK4TUidPPv @ 482 NONAME
+	_ZN17TAlfVisualCommandC1ER10CAlfVisual6TAlfOpii @ 483 NONAME
+	_ZN17TAlfVisualCommandC2ER10CAlfVisual6TAlfOpii @ 484 NONAME
+	_ZN18CAlfProceduralMesh10MakeTorusLEffiif @ 485 NONAME
+	_ZN18CAlfProceduralMesh11MakeSphereLEfii @ 486 NONAME
+	_ZN18CAlfProceduralMesh11SetMaterialERK12TAlfMaterial @ 487 NONAME
+	_ZN18CAlfProceduralMesh9MakeCubeLEffff @ 488 NONAME
+	_ZN18CAlfTextureManager12BlankTextureEv @ 489 NONAME
+	_ZN18CAlfTextureManager12LoadTextureLERK7TDesC1616TAlfTextureFlagsi @ 490 NONAME
+	_ZN18CAlfTextureManager12LoadTextureLERK7TDesC165TSize16TAlfTextureFlagsi @ 491 NONAME
+	_ZN18CAlfTextureManager12LoadTextureLEi5TSize16TAlfTextureFlags @ 492 NONAME
+	_ZN18CAlfTextureManager13SetImagePathLERK7TDesC16 @ 493 NONAME
+	_ZN18CAlfTextureManager13UnloadTextureERK7TDesC16 @ 494 NONAME
+	_ZN18CAlfTextureManager13UnloadTextureEi @ 495 NONAME
+	_ZN18CAlfTextureManager14CreateTextureLEiP18MAlfBitmapProvider16TAlfTextureFlags @ 496 NONAME
+	_ZN18CAlfTextureManager15DefineFileNameLEiRK7TDesC16 @ 497 NONAME
+	_ZN18CAlfTextureManager16AddLoadObserverLEP35MAlfTextureLoadingCompletedObserver @ 498 NONAME
+	_ZN18CAlfTextureManager16PrependImagePathER6TDes16 @ 499 NONAME
+	_ZN18CAlfTextureManager17AddStateObserverLEP38MAlfTextureManagerStateChangedObserver @ 500 NONAME
+	_ZN18CAlfTextureManager18RemoveLoadObserverEP35MAlfTextureLoadingCompletedObserver @ 501 NONAME
+	_ZN18CAlfTextureManager19RemoveStateObserverEP38MAlfTextureManagerStateChangedObserver @ 502 NONAME
+	_ZN18CAlfTextureManager26SetAutomaticTextureIdRangeEii @ 503 NONAME
+	_ZN18CAlfTextureManager3EnvEv @ 504 NONAME
+	_ZN18CAlfTextureManager8TextureLEi @ 505 NONAME
+	_ZN18CAlfTextureManager9ProcessorEv @ 506 NONAME
+	_ZN18CAlfTransformation11ReplaceStepEiNS_10TTransformE @ 507 NONAME
+	_ZN18CAlfTransformation12LoadIdentityEv @ 508 NONAME
+	_ZN18CAlfTransformation4NewLER7CAlfEnv @ 509 NONAME
+	_ZN18CAlfTransformation4StepEi @ 510 NONAME
+	_ZN18CAlfTransformation5NewLCER7CAlfEnv @ 511 NONAME
+	_ZN18CAlfTransformation5ScaleERK14TAlfTimedValueS2_ @ 512 NONAME
+	_ZN18CAlfTransformation5ScaleERK14TAlfTimedValueS2_S2_ @ 513 NONAME
+	_ZN18CAlfTransformation5ScaleEff @ 514 NONAME
+	_ZN18CAlfTransformation5ScaleEfff @ 515 NONAME
+	_ZN18CAlfTransformation6RotateERK14TAlfTimedValue @ 516 NONAME
+	_ZN18CAlfTransformation6RotateERK14TAlfTimedValuefff @ 517 NONAME
+	_ZN18CAlfTransformation6RotateEf @ 518 NONAME
+	_ZN18CAlfTransformation6RotateEffff @ 519 NONAME
+	_ZN18CAlfTransformation9TranslateERK14TAlfTimedValueS2_ @ 520 NONAME
+	_ZN18CAlfTransformation9TranslateEff @ 521 NONAME
+	_ZN18CAlfTransformationD0Ev @ 522 NONAME
+	_ZN18CAlfTransformationD1Ev @ 523 NONAME
+	_ZN18CAlfTransformationD2Ev @ 524 NONAME
+	_ZN18CAlfViewportLayout10ConstructLER11CAlfControl @ 525 NONAME
+	_ZN18CAlfViewportLayout14SetViewportPosERK13TAlfRealPointi @ 526 NONAME
+	_ZN18CAlfViewportLayout14SetVirtualSizeERK12TAlfRealSizei @ 527 NONAME
+	_ZN18CAlfViewportLayout15SetViewportSizeERK12TAlfRealSizei @ 528 NONAME
+	_ZN18CAlfViewportLayout20RemoveAndDestroyAllDEv @ 529 NONAME
+	_ZN18CAlfViewportLayout20UpdateChildrenLayoutEi @ 530 NONAME
+	_ZN18CAlfViewportLayout22DoRemoveAndDestroyAllDEv @ 531 NONAME
+	_ZN18CAlfViewportLayout22PropertyOwnerExtensionERK4TUidPPv @ 532 NONAME
+	_ZN18CAlfViewportLayout7AddNewLER11CAlfControlP10CAlfLayout @ 533 NONAME
+	_ZN18CAlfViewportLayout7FindTagERK6TDesC8 @ 534 NONAME
+	_ZN18CAlfViewportLayoutC1Ev @ 535 NONAME
+	_ZN18CAlfViewportLayoutC2Ev @ 536 NONAME
+	_ZN18CAlfViewportLayoutD0Ev @ 537 NONAME
+	_ZN18CAlfViewportLayoutD1Ev @ 538 NONAME
+	_ZN18CAlfViewportLayoutD2Ev @ 539 NONAME
+	_ZN18TAlfControlCommand16CommandExtensionERK4TUidPPv @ 540 NONAME
+	_ZN18TAlfControlCommandC1ER11CAlfControl6TAlfOp @ 541 NONAME
+	_ZN18TAlfControlCommandC2ER11CAlfControl6TAlfOp @ 542 NONAME
+	_ZN19CAlfCurvePathLayout10ConstructLER11CAlfControl @ 543 NONAME
+	_ZN19CAlfCurvePathLayout20RemoveAndDestroyAllDEv @ 544 NONAME
+	_ZN19CAlfCurvePathLayout20UpdateChildrenLayoutEi @ 545 NONAME
+	_ZN19CAlfCurvePathLayout22DoRemoveAndDestroyAllDEv @ 546 NONAME
+	_ZN19CAlfCurvePathLayout22PropertyOwnerExtensionERK4TUidPPv @ 547 NONAME
+	_ZN19CAlfCurvePathLayout7AddNewLER11CAlfControlP10CAlfLayout @ 548 NONAME
+	_ZN19CAlfCurvePathLayout7FindTagERK6TDesC8 @ 549 NONAME
+	_ZN19CAlfCurvePathLayout9CurvePathEv @ 550 NONAME
+	_ZN19CAlfCurvePathLayoutC1Ev @ 551 NONAME
+	_ZN19CAlfCurvePathLayoutC2Ev @ 552 NONAME
+	_ZN19CAlfCurvePathLayoutD0Ev @ 553 NONAME
+	_ZN19CAlfCurvePathLayoutD1Ev @ 554 NONAME
+	_ZN19CAlfCurvePathLayoutD2Ev @ 555 NONAME
+	_ZN19CAlfDropShadowBrush11SetSoftnessERK14TAlfTimedValue @ 556 NONAME
+	_ZN19CAlfDropShadowBrush4NewLER7CAlfEnvi @ 557 NONAME
+	_ZN19CAlfDropShadowBrush5NewLCER7CAlfEnvi @ 558 NONAME
+	_ZN19CAlfDropShadowBrush8SetDepthERK14TAlfTimedValue @ 559 NONAME
+	_ZN19CAlfImageLoaderUtil15SetSkinInstanceEP17MAknsSkinInstance @ 560 NONAME
+	_ZN19CAlfImageLoaderUtil18CreateImageLoaderLE4TUid16TAknsAppIconType @ 561 NONAME
+	_ZN19CAlfImageLoaderUtil18CreateImageLoaderLERK11TAknsItemIDRK7TDesC16ii @ 562 NONAME
+	_ZN19CAlfImageLoaderUtil7SetSizeE5TSize10TScaleMode @ 563 NONAME
+	_ZN19CAlfImageLoaderUtilC1Ev @ 564 NONAME
+	_ZN19CAlfImageLoaderUtilC2Ev @ 565 NONAME
+	_ZN19CAlfImageLoaderUtilD0Ev @ 566 NONAME
+	_ZN19CAlfImageLoaderUtilD1Ev @ 567 NONAME
+	_ZN19CAlfImageLoaderUtilD2Ev @ 568 NONAME
+	_ZN19CAlfLCTAnchorLayout10ConstructLER11CAlfControl @ 569 NONAME
+	_ZN19CAlfLCTAnchorLayout10SetAnchorsEiR34TAknLayoutHierarchyComponentHandleRK14TAlfTimedPoint @ 570 NONAME
+	_ZN19CAlfLCTAnchorLayout20RemoveAndDestroyAllDEv @ 571 NONAME
+	_ZN19CAlfLCTAnchorLayout20UpdateChildrenLayoutEi @ 572 NONAME
+	_ZN19CAlfLCTAnchorLayout22DoRemoveAndDestroyAllDEv @ 573 NONAME
+	_ZN19CAlfLCTAnchorLayout22PropertyOwnerExtensionERK4TUidPPv @ 574 NONAME
+	_ZN19CAlfLCTAnchorLayout7AddNewLER11CAlfControlP10CAlfLayout @ 575 NONAME
+	_ZN19CAlfLCTAnchorLayout7FindTagERK6TDesC8 @ 576 NONAME
+	_ZN19CAlfLCTAnchorLayoutC1Ev @ 577 NONAME
+	_ZN19CAlfLCTAnchorLayoutC2Ev @ 578 NONAME
+	_ZN19CAlfLCTAnchorLayoutD0Ev @ 579 NONAME
+	_ZN19CAlfLCTAnchorLayoutD1Ev @ 580 NONAME
+	_ZN19CAlfLCTAnchorLayoutD2Ev @ 581 NONAME
+	_ZN20CAlfTextStyleManager14CopyTextStyleLEi @ 582 NONAME
+	_ZN20CAlfTextStyleManager24CreatePlatformTextStyleLEi @ 583 NONAME
+	_ZN20CAlfTextStyleManager24CreatePlatformTextStyleLEii @ 584 NONAME
+	_ZN20CAlfTextStyleManager9TextStyleEi @ 585 NONAME
+	_ZN20CAlfTextureProcessor5BlurLERK11CAlfTextureRS0_RK5TSizeii @ 586 NONAME
+	_ZN20CAlfTextureProcessor5BlurLERK11CAlfTextureRS0_ii @ 587 NONAME
+	_ZN21CAlfShadowBorderBrush4NewLER7CAlfEnvi @ 588 NONAME
+	_ZN21CAlfShadowBorderBrush5NewLCER7CAlfEnvi @ 589 NONAME
+	_ZN21CAlfShadowBorderBrush8SetWidthERK14TAlfTimedValue @ 590 NONAME
+	_ZN22TAlfCustomEventCommand16CommandExtensionERK4TUidPPv @ 591 NONAME
+	_ZN22TAlfCustomEventCommandC1EiP16MAlfEventHandleri @ 592 NONAME
+	_ZN22TAlfCustomEventCommandC2EiP16MAlfEventHandleri @ 593 NONAME
+	_ZN23CAlfSineMappingFunction4NewLER7CAlfEnvff @ 594 NONAME
+	_ZN23CAlfSineMappingFunction9SetFactorEf @ 595 NONAME
+	_ZN23CAlfSineMappingFunction9SetOffsetEf @ 596 NONAME
+	_ZN23CAlfSineMappingFunctionD0Ev @ 597 NONAME
+	_ZN23CAlfSineMappingFunctionD1Ev @ 598 NONAME
+	_ZN23CAlfSineMappingFunctionD2Ev @ 599 NONAME
+	_ZN24CAlfLayoutMetricsUtility10MarkVisualEP7TDesC16P14CAlfTextVisual @ 600 NONAME
+	_ZN24CAlfLayoutMetricsUtility11AutoMarkingEv @ 601 NONAME
+	_ZN24CAlfLayoutMetricsUtility11WriteReportEv @ 602 NONAME
+	_ZN24CAlfLayoutMetricsUtility12UnmarkVisualEP14CAlfTextVisual @ 603 NONAME
+	_ZN24CAlfLayoutMetricsUtility14MeasureVisualsEv @ 604 NONAME
+	_ZN24CAlfLayoutMetricsUtility17EnableAutoMarkingEi @ 605 NONAME
+	_ZN24CAlfTableMappingFunction21SetMappingTableValuesEffP36MAlfTableMappingFunctionDataProvider @ 606 NONAME
+	_ZN24CAlfTableMappingFunction4NewLER7CAlfEnv @ 607 NONAME
+	_ZN24CAlfTableMappingFunctionD0Ev @ 608 NONAME
+	_ZN24CAlfTableMappingFunctionD1Ev @ 609 NONAME
+	_ZN24CAlfTableMappingFunctionD2Ev @ 610 NONAME
+	_ZN25CAlfCosineMappingFunction4NewLER7CAlfEnvff @ 611 NONAME
+	_ZN25CAlfCosineMappingFunction9SetFactorEf @ 612 NONAME
+	_ZN25CAlfCosineMappingFunction9SetOffsetEf @ 613 NONAME
+	_ZN25CAlfCosineMappingFunctionD0Ev @ 614 NONAME
+	_ZN25CAlfCosineMappingFunctionD1Ev @ 615 NONAME
+	_ZN25CAlfCosineMappingFunctionD2Ev @ 616 NONAME
+	_ZN25CAlfLinearMappingFunction4NewLER7CAlfEnvff @ 617 NONAME
+	_ZN25CAlfLinearMappingFunction9SetFactorEf @ 618 NONAME
+	_ZN25CAlfLinearMappingFunction9SetOffsetEf @ 619 NONAME
+	_ZN25CAlfLinearMappingFunctionD0Ev @ 620 NONAME
+	_ZN25CAlfLinearMappingFunctionD1Ev @ 621 NONAME
+	_ZN25CAlfLinearMappingFunctionD2Ev @ 622 NONAME
+	_ZN25TAlfTransformationCommand16CommandExtensionERK4TUidPPv @ 623 NONAME
+	_ZN25TAlfTransformationCommand4SetXERK14TAlfTimedValue @ 624 NONAME
+	_ZN25TAlfTransformationCommand4SetYERK14TAlfTimedValue @ 625 NONAME
+	_ZN25TAlfTransformationCommand4SetZERK14TAlfTimedValue @ 626 NONAME
+	_ZN25TAlfTransformationCommand8SetAngleERK14TAlfTimedValue @ 627 NONAME
+	_ZN25TAlfTransformationCommandC1EPvR18CAlfTransformation6TAlfOpi @ 628 NONAME
+	_ZN25TAlfTransformationCommandC2EPvR18CAlfTransformation6TAlfOpi @ 629 NONAME
+	_ZN26CAlfAverageMappingFunction19SetMappingFunction1EP19MAlfMappingFunction @ 630 NONAME
+	_ZN26CAlfAverageMappingFunction19SetMappingFunction2EP19MAlfMappingFunction @ 631 NONAME
+	_ZN26CAlfAverageMappingFunction19SetMappingFunctionsEP19MAlfMappingFunctionS1_ @ 632 NONAME
+	_ZN26CAlfAverageMappingFunction4NewLER7CAlfEnvP19MAlfMappingFunctionS3_ @ 633 NONAME
+	_ZN26CAlfAverageMappingFunction9SetWeightERK14TAlfTimedValue @ 634 NONAME
+	_ZN26CAlfAverageMappingFunctionD0Ev @ 635 NONAME
+	_ZN26CAlfAverageMappingFunctionD1Ev @ 636 NONAME
+	_ZN26CAlfAverageMappingFunctionD2Ev @ 637 NONAME
+	_ZN27CAlfConstantMappingFunction4NewLER7CAlfEnvf @ 638 NONAME
+	_ZN27CAlfConstantMappingFunction8SetValueEf @ 639 NONAME
+	_ZN27CAlfConstantMappingFunctionD0Ev @ 640 NONAME
+	_ZN27CAlfConstantMappingFunctionD1Ev @ 641 NONAME
+	_ZN27CAlfConstantMappingFunctionD2Ev @ 642 NONAME
+	_ZN7AlfUtil10FreeMemoryEPj @ 643 NONAME
+	_ZN7AlfUtil10LengthUnitEv @ 644 NONAME
+	_ZN7AlfUtil10RandomRealEff @ 645 NONAME
+	_ZN7AlfUtil10ScaleImageEiRK5TSizePKhS2_Ph @ 646 NONAME
+	_ZN7AlfUtil10ScreenSizeEv @ 647 NONAME
+	_ZN7AlfUtil10TagMatchesERK6TDesC8S2_ @ 648 NONAME
+	_ZN7AlfUtil11InterpolateEfff @ 649 NONAME
+	_ZN7AlfUtil11QuickLengthER13TAlfRealPoint @ 650 NONAME
+	_ZN7AlfUtil11QuickLengthEff @ 651 NONAME
+	_ZN7AlfUtil11ReleaseFontEP5CFont @ 652 NONAME
+	_ZN7AlfUtil12CrossProductEPKfS1_Pf @ 653 NONAME
+	_ZN7AlfUtil12ShadowMatrixEPKfS1_S1_Pf @ 654 NONAME
+	_ZN7AlfUtil14ColorLightnessERK4TRgb @ 655 NONAME
+	_ZN7AlfUtil14CropFbsBitmapLERK10CFbsBitmapRS0_6TPoint @ 656 NONAME
+	_ZN7AlfUtil14QuickNormalizeEPf @ 657 NONAME
+	_ZN7AlfUtil14QuickNormalizeER13TAlfRealPoint @ 658 NONAME
+	_ZN7AlfUtil15Power2RoundDownEi @ 659 NONAME
+	_ZN7AlfUtil15ScaleFbsBitmapLERK10CFbsBitmapRS0_ @ 660 NONAME
+	_ZN7AlfUtil16NormalFromPointsEPA3_KfPf @ 661 NONAME
+	_ZN7AlfUtil19NearestFontInTwipsLERK9TFontSpec @ 662 NONAME
+	_ZN7AlfUtil21CombineMaskFbsBitmapLERK10CFbsBitmapS2_RS0_ @ 663 NONAME
+	_ZN7AlfUtil28ConvertBitmapToDisplayModeLCERK10CFbsBitmapRK12TDisplayMode @ 664 NONAME
+	_ZN7AlfUtil6Power2Ei @ 665 NONAME
+	_ZN7AlfUtil9CropImageEiRK5TSizePKhRK6TPointS2_Ph @ 666 NONAME
+	_ZN7AlfUtil9RandomIntEii @ 667 NONAME
+	_ZN7AlfUtil9WrapValueERfff @ 668 NONAME
+	_ZN7CAlfEnv11NewDisplayLERK5TRectii @ 669 NONAME
+	_ZN7CAlfEnv11RefreshModeEv @ 670 NONAME
+	_ZN7CAlfEnv11TokenClientEv @ 671 NONAME
+	_ZN7CAlfEnv12ControlGroupEi @ 672 NONAME
+	_ZN7CAlfEnv12PauseRefreshEv @ 673 NONAME
+	_ZN7CAlfEnv13AppendWidgetLEPN3Alf10IAlfWidgetE @ 674 NONAME
+	_ZN7CAlfEnv14CancelCommandsEPv @ 675 NONAME
+	_ZN7CAlfEnv14CancelCommandsEPv15TAlfCommandType @ 676 NONAME
+	_ZN7CAlfEnv14CancelCommandsEPv6TAlfOp @ 677 NONAME
+	_ZN7CAlfEnv14SetRefreshModeE15TAlfRefreshMode @ 678 NONAME
+	_ZN7CAlfEnv15ContinueRefreshEv @ 679 NONAME
+	_ZN7CAlfEnv15HandleKeyEventLERK9TKeyEvent10TEventCodeP11CAlfDisplay @ 680 NONAME
+	_ZN7CAlfEnv15RefreshCallBackEPv @ 681 NONAME
+	_ZN7CAlfEnv15SetMaxFrameRateEf @ 682 NONAME
+	_ZN7CAlfEnv16NewControlGroupLEi @ 683 NONAME
+	_ZN7CAlfEnv16SetIdleThresholdEi @ 684 NONAME
+	_ZN7CAlfEnv18AddActionObserverLEP18MAlfActionObserver @ 685 NONAME
+	_ZN7CAlfEnv18DeleteControlGroupEi @ 686 NONAME
+	_ZN7CAlfEnv18NotifySkinChangedLEv @ 687 NONAME
+	_ZN7CAlfEnv20CancelCustomCommandsEP16MAlfEventHandler @ 688 NONAME
+	_ZN7CAlfEnv20CancelCustomCommandsEP16MAlfEventHandleri @ 689 NONAME
+	_ZN7CAlfEnv20LastReceivedPtrEventEv @ 690 NONAME
+	_ZN7CAlfEnv20LayoutMetricsUtilityEv @ 691 NONAME
+	_ZN7CAlfEnv20NotifyLayoutChangedLEv @ 692 NONAME
+	_ZN7CAlfEnv20RemoveActionObserverEP18MAlfActionObserver @ 693 NONAME
+	_ZN7CAlfEnv20SetFullScreenDrawingEi @ 694 NONAME
+	_ZN7CAlfEnv24MilliSecondsUntilCommandEPv @ 695 NONAME
+	_ZN7CAlfEnv24MilliSecondsUntilCommandEPv15TAlfCommandType @ 696 NONAME
+	_ZN7CAlfEnv24MilliSecondsUntilCommandEPv6TAlfOp @ 697 NONAME
+	_ZN7CAlfEnv26DeleteSharedTextureManagerE4TUid @ 698 NONAME
+	_ZN7CAlfEnv27CreateSharedTextureManagerLE4TUid @ 699 NONAME
+	_ZN7CAlfEnv30MilliSecondsUntilCustomCommandEP16MAlfEventHandler @ 700 NONAME
+	_ZN7CAlfEnv30MilliSecondsUntilCustomCommandEP16MAlfEventHandleri @ 701 NONAME
+	_ZN10CAlfStatic4NewLEP7CAlfEnv @ 702 NONAME
+	_ZN7CAlfEnv4SendERK11TAlfCommandi @ 703 NONAME
+	_ZN10CAlfLayout10ConstructLER11CAlfControl @ 704 NONAME
+	_ZN7CAlfEnv6ClientEv @ 705 NONAME
+	_ZN7CAlfEnv6StaticEv @ 706 NONAME
+	_ZN7CAlfEnv7ReleaseEi @ 707 NONAME
+	_ZN7CAlfEnv8RestoreLEv @ 708 NONAME
+	_ZN7CAlfEnvD0Ev @ 709 NONAME
+	_ZN7CAlfEnvD1Ev @ 710 NONAME
+	_ZN7CAlfEnvD2Ev @ 711 NONAME
+	_ZN8CAlfMesh14ScaleUniformlyEfff @ 712 NONAME
+	_ZN8CAlfMesh16StretchUniformlyEffffff @ 713 NONAME
+	_ZN8CAlfMesh20SetAnimationPositionEifi @ 714 NONAME
+	_ZN8CAlfMesh23StopAnimationControllerEi @ 715 NONAME
+	_ZN8CAlfMesh24StartAnimationControllerEi @ 716 NONAME
+	_ZN8CAlfMesh5ResetEv @ 717 NONAME
+	_ZN9CAlfBrush10ConstructLER7CAlfEnviiRK6TDesC8 @ 718 NONAME
+	_ZN9CAlfBrush10ConstructLEv @ 719 NONAME
+	_ZN9CAlfBrush10SetOpacityERK14TAlfTimedValue @ 720 NONAME
+	_ZN9CAlfBrush22PropertyOwnerExtensionERK4TUidPPv @ 721 NONAME
+	_ZN9CAlfBrush8SetLayerE14TAlfBrushLayer @ 722 NONAME
+	_ZN9CAlfBrushC1Ev @ 723 NONAME
+	_ZN9CAlfBrushC2Ev @ 724 NONAME
+	_ZN9CAlfBrushD0Ev @ 725 NONAME
+	_ZN9CAlfBrushD1Ev @ 726 NONAME
+	_ZN9CAlfBrushD2Ev @ 727 NONAME
+	_ZN9TAlfEvent9SetVisualEP10CAlfVisual @ 728 NONAME
+	_ZN9TAlfEventC1ER11CAlfDisplayRK13TPointerEvent @ 729 NONAME
+	_ZN9TAlfEventC1ER11CAlfDisplayRK17TAlfScrollerEvent @ 730 NONAME
+	_ZN9TAlfEventC1ER11CAlfDisplayRK9TKeyEvent10TEventCode @ 731 NONAME
+	_ZN9TAlfEventC1Ei @ 732 NONAME
+	_ZN9TAlfEventC1Eii @ 733 NONAME
+	_ZN9TAlfEventC2ER11CAlfDisplayRK13TPointerEvent @ 734 NONAME
+	_ZN9TAlfEventC2ER11CAlfDisplayRK17TAlfScrollerEvent @ 735 NONAME
+	_ZN9TAlfEventC2ER11CAlfDisplayRK9TKeyEvent10TEventCode @ 736 NONAME
+	_ZN9TAlfEventC2Ei @ 737 NONAME
+	_ZN9TAlfEventC2Eii @ 738 NONAME
+	_ZN9TAlfImage10SetTextureER11CAlfTexture @ 739 NONAME
+	_ZN9TAlfImage12SetTexCoordsEffffi @ 740 NONAME
+	_ZN9TAlfImage5ScaleEffi @ 741 NONAME
+	_ZN9TAlfImage9TranslateEffi @ 742 NONAME
+	_ZN9TAlfImageC1E11TAknsItemID5TSize10TScaleModePK7TDesC16iiffff16TAlfTextureFlagsiP18CAlfTextureManager @ 743 NONAME
+	_ZN9TAlfImageC1E4TUid16TAknsAppIconType5TSize10TScaleModeffff16TAlfTextureFlagsiP18CAlfTextureManager @ 744 NONAME
+	_ZN9TAlfImageC1ERK11CAlfTextureffff @ 745 NONAME
+	_ZN9TAlfImageC1Ev @ 746 NONAME
+	_ZN9TAlfImageC2E11TAknsItemID5TSize10TScaleModePK7TDesC16iiffff16TAlfTextureFlagsiP18CAlfTextureManager @ 747 NONAME
+	_ZN9TAlfImageC2E4TUid16TAknsAppIconType5TSize10TScaleModeffff16TAlfTextureFlagsiP18CAlfTextureManager @ 748 NONAME
+	_ZN9TAlfImageC2ERK11CAlfTextureffff @ 749 NONAME
+	_ZN9TAlfImageC2Ev @ 750 NONAME
+	_ZN9TAlfImageD1Ev @ 751 NONAME
+	_ZN9TAlfImageD2Ev @ 752 NONAME
+	_ZNK10CAlfLayout10FindVisualEP10CAlfVisual @ 753 NONAME
+	_ZNK10CAlfLayout11VirtualSizeEv @ 754 NONAME
+	_ZNK10CAlfLayout12InnerPaddingEv @ 755 NONAME
+	_ZNK10CAlfLayout12ScrollOffsetEv @ 756 NONAME
+	_ZNK10CAlfLayout14TransitionTimeEv @ 757 NONAME
+	_ZNK10CAlfLayout20InnerPaddingAsMetricEv @ 758 NONAME
+	_ZNK10CAlfLayout20VerticalInnerPaddingEv @ 759 NONAME
+	_ZNK10CAlfLayout22EffectiveLayoutOrdinalERK10CAlfVisual @ 760 NONAME
+	_ZNK10CAlfLayout22HorizontalInnerPaddingEv @ 761 NONAME
+	_ZNK10CAlfLayout23InnerPaddingInBaseUnitsEv @ 762 NONAME
+	_ZNK10CAlfLayout5CountEv @ 763 NONAME
+	_ZNK10CAlfLayout6VisualEi @ 764 NONAME
+	_ZNK10CAlfLayout8BaseUnitEv @ 765 NONAME
+	_ZNK10CAlfLayout9ScrollingEv @ 766 NONAME
+	_ZNK10CAlfRoster11FindControlEi @ 767 NONAME
+	_ZNK10CAlfRoster12ControlGroupEi @ 768 NONAME
+	_ZNK10CAlfRoster4FindERK16CAlfControlGroup @ 769 NONAME
+	_ZNK10CAlfRoster5CountEv @ 770 NONAME
+	_ZNK10CAlfVisual10IdentifierEv @ 771 NONAME
+	_ZNK10CAlfVisual11DepthOffsetEv @ 772 NONAME
+	_ZNK10CAlfVisual11DisplayRectEv @ 773 NONAME
+	_ZNK10CAlfVisual13AlignByOriginER12TAlfRealRect @ 774 NONAME
+	_ZNK10CAlfVisual14DisplayToLocalERK13TAlfRealPoint @ 775 NONAME
+	_ZNK10CAlfVisual14DisplayToLocalERK6TPoint @ 776 NONAME
+	_ZNK10CAlfVisual14LocalToDisplayERK13TAlfRealPoint @ 777 NONAME
+	_ZNK10CAlfVisual14LocalToDisplayERK6TPoint @ 778 NONAME
+	_ZNK10CAlfVisual14VerticalOriginEv @ 779 NONAME
+	_ZNK10CAlfVisual15PaddingAsMetricEv @ 780 NONAME
+	_ZNK10CAlfVisual15PaddingInPixelsEv @ 781 NONAME
+	_ZNK10CAlfVisual15VerticalPaddingEv @ 782 NONAME
+	_ZNK10CAlfVisual16EffectiveOpacityEv @ 783 NONAME
+	_ZNK10CAlfVisual16HorizontalOriginEv @ 784 NONAME
+	_ZNK10CAlfVisual17DisplayRectTargetEv @ 785 NONAME
+	_ZNK10CAlfVisual17HorizontalPaddingEv @ 786 NONAME
+	_ZNK10CAlfVisual3EnvEv @ 787 NONAME
+	_ZNK10CAlfVisual3PosEv @ 788 NONAME
+	_ZNK10CAlfVisual3TagEv @ 789 NONAME
+	_ZNK10CAlfVisual4SizeEv @ 790 NONAME
+	_ZNK10CAlfVisual5CommsEv @ 791 NONAME
+	_ZNK10CAlfVisual5FlagsEv @ 792 NONAME
+	_ZNK10CAlfVisual5OwnerEv @ 793 NONAME
+	_ZNK10CAlfVisual6LayoutEv @ 794 NONAME
+	_ZNK10CAlfVisual7DisplayEv @ 795 NONAME
+	_ZNK10CAlfVisual7MaxSizeEv @ 796 NONAME
+	_ZNK10CAlfVisual7MinSizeEv @ 797 NONAME
+	_ZNK10CAlfVisual7OpacityEv @ 798 NONAME
+	_ZNK10CAlfVisual7PaddingEv @ 799 NONAME
+	_ZNK10CAlfVisual8ClippingEv @ 800 NONAME
+	_ZNK10CAlfVisual8IsTaggedEv @ 801 NONAME
+	_ZNK11CAlfControl10ConnectionEi @ 802 NONAME
+	_ZNK11CAlfControl10IdentifierEv @ 803 NONAME
+	_ZNK11CAlfControl10IsFocusingEv @ 804 NONAME
+	_ZNK11CAlfControl11AcceptInputEv @ 805 NONAME
+	_ZNK11CAlfControl11DisplayAreaEv @ 806 NONAME
+	_ZNK11CAlfControl11VisualCountEv @ 807 NONAME
+	_ZNK11CAlfControl12ControlGroupEv @ 808 NONAME
+	_ZNK11CAlfControl13DisplayCenterEv @ 809 NONAME
+	_ZNK11CAlfControl13DisplayToHostERK6TPoint @ 810 NONAME
+	_ZNK11CAlfControl13HostToDisplayERK6TPoint @ 811 NONAME
+	_ZNK11CAlfControl14ConnectionRoleEi @ 812 NONAME
+	_ZNK11CAlfControl14FindConnectionEPKS_ @ 813 NONAME
+	_ZNK11CAlfControl15ConnectionCountEv @ 814 NONAME
+	_ZNK11CAlfControl15ContainerLayoutEPKS_ @ 815 NONAME
+	_ZNK11CAlfControl17ConnectionOrdinalEi @ 816 NONAME
+	_ZNK11CAlfControl19ConnectionByOrdinalEi @ 817 NONAME
+	_ZNK11CAlfControl2IdEv @ 818 NONAME
+	_ZNK11CAlfControl3EnvEv @ 819 NONAME
+	_ZNK11CAlfControl4HostEv @ 820 NONAME
+	_ZNK11CAlfControl4RoleEv @ 821 NONAME
+	_ZNK11CAlfControl5FocusEv @ 822 NONAME
+	_ZNK11CAlfControl6BoundsEv @ 823 NONAME
+	_ZNK11CAlfControl6HostIdEv @ 824 NONAME
+	_ZNK11CAlfControl6VisualEi @ 825 NONAME
+	_ZNK11CAlfControl7DisplayEv @ 826 NONAME
+	_ZNK11CAlfControl7FindTagERK6TDesC8 @ 827 NONAME
+	_ZNK11CAlfControl7HitTestERK6TPoint @ 828 NONAME
+	_ZNK11CAlfDisplay11VisibleAreaEv @ 829 NONAME
+	_ZNK11CAlfDisplay14ObjectProviderEv @ 830 NONAME
+	_ZNK11CAlfDisplay6RosterEv @ 831 NONAME
+	_ZNK11CAlfDisplay7QualityEv @ 832 NONAME
+	_ZNK11CAlfTexture10HasContentEv @ 833 NONAME
+	_ZNK11CAlfTexture10IsAnimatedEv @ 834 NONAME
+	_ZNK11CAlfTexture12ServerHandleEv @ 835 NONAME
+	_ZNK11CAlfTexture2IdEv @ 836 NONAME
+	_ZNK11CAlfTexture4SizeEv @ 837 NONAME
+	_ZNK11CAlfTexture8FileNameEv @ 838 NONAME
+	_ZNK11CAlfTexture8PriorityEv @ 839 NONAME
+	_ZNK11TAlfCommand13ObjectCommandEv @ 840 NONAME
+	_ZNK11TAlfCommand4TypeEv @ 841 NONAME
+	_ZNK13CAlfCurvePath25MappingFunctionIdentifierEv @ 842 NONAME
+	_ZNK13CAlfCurvePath4LoopEv @ 843 NONAME
+	_ZNK13CAlfCurvePath6LengthEv @ 844 NONAME
+	_ZNK13CAlfCurvePath6OffsetEv @ 845 NONAME
+	_ZNK13CAlfCurvePath8EvaluateEfR13TAlfRealPoint @ 846 NONAME
+	_ZNK13CAlfCurvePath8MapValueEfi @ 847 NONAME
+	_ZNK13CAlfTextStyle11IsUnderlineEv @ 848 NONAME
+	_ZNK13CAlfTextStyle13TypefaceNameLEv @ 849 NONAME
+	_ZNK13CAlfTextStyle15IsStrikeThroughEv @ 850 NONAME
+	_ZNK13CAlfTextStyle15TextSizeInTwipsEi @ 851 NONAME
+	_ZNK13CAlfTextStyle16TextSizeInPixelsEi @ 852 NONAME
+	_ZNK13CAlfTextStyle2IdEv @ 853 NONAME
+	_ZNK13CAlfTextStyle6IsBoldEv @ 854 NONAME
+	_ZNK13CAlfTextStyle8IsItalicEv @ 855 NONAME
+	_ZNK13CAlfTextStyle8ParentIdEv @ 856 NONAME
+	_ZNK13CAlfTextStyle9TextColorEv @ 857 NONAME
+	_ZNK14CAlfBrushArray5CountEv @ 858 NONAME
+	_ZNK14CAlfDeckLayout8BaseUnitEv @ 859 NONAME
+	_ZNK14CAlfFlowLayout4ModeEv @ 860 NONAME
+	_ZNK14CAlfFlowLayout8BaseUnitEv @ 861 NONAME
+	_ZNK14CAlfGridLayout11ColumnCountEv @ 862 NONAME
+	_ZNK14CAlfGridLayout14DimensionCountE17TAlfGridDimension @ 863 NONAME
+	_ZNK14CAlfGridLayout14OrdinalToBlockEi @ 864 NONAME
+	_ZNK14CAlfGridLayout6WeightE17TAlfGridDimensioni @ 865 NONAME
+	_ZNK14CAlfGridLayout8BaseUnitEv @ 866 NONAME
+	_ZNK14CAlfGridLayout8RowCountEv @ 867 NONAME
+	_ZNK14CAlfImageBrush20BorderDrawingEnabledEv @ 868 NONAME
+	_ZNK14CAlfImageBrush20CenterDrawingEnabledEv @ 869 NONAME
+	_ZNK14CAlfImageBrush5ImageEv @ 870 NONAME
+	_ZNK14CAlfImageBrush5ScaleEv @ 871 NONAME
+	_ZNK14CAlfImageBrush6OffsetEv @ 872 NONAME
+	_ZNK14CAlfLineVisual15ShadowThicknessEv @ 873 NONAME
+	_ZNK14CAlfLineVisual5ImageEv @ 874 NONAME
+	_ZNK14CAlfLineVisual6EndPosEv @ 875 NONAME
+	_ZNK14CAlfLineVisual8StartPosEv @ 876 NONAME
+	_ZNK14CAlfLineVisual9ThicknessEv @ 877 NONAME
+	_ZNK14CAlfMeshVisual10PitchAngleEv @ 878 NONAME
+	_ZNK14CAlfMeshVisual13SpecularImageEv @ 879 NONAME
+	_ZNK14CAlfMeshVisual14ProceduralMeshEv @ 880 NONAME
+	_ZNK14CAlfMeshVisual14SecondaryAlphaEv @ 881 NONAME
+	_ZNK14CAlfMeshVisual14SecondaryImageEv @ 882 NONAME
+	_ZNK14CAlfMeshVisual5ImageEv @ 883 NONAME
+	_ZNK14CAlfMeshVisual5ScaleEv @ 884 NONAME
+	_ZNK14CAlfMeshVisual7M3GMeshEv @ 885 NONAME
+	_ZNK14CAlfMeshVisual8YawAngleEv @ 886 NONAME
+	_ZNK14CAlfTextVisual11TextExtentsEv @ 887 NONAME
+	_ZNK14CAlfTextVisual12MaxLineCountEv @ 888 NONAME
+	_ZNK14CAlfTextVisual16SubstringExtentsEjj @ 889 NONAME
+	_ZNK14CAlfTextVisual4TextEv @ 890 NONAME
+	_ZNK14CAlfTextVisual8WrappingEv @ 891 NONAME
+	_ZNK14RAlfClientBase10ServiceUidEv @ 892 NONAME
+	_ZNK14TAlfTimedPoint11IntValueNowEv @ 893 NONAME
+	_ZNK14TAlfTimedPoint9IntTargetEv @ 894 NONAME
+	_ZNK14TAlfTimedValue25MappingFunctionIdentifierEv @ 895 NONAME
+	_ZNK14TAlfTimedValue26TimeToTargetinMilliSecondsEv @ 896 NONAME
+	_ZNK14TAlfTimedValue5SpeedEv @ 897 NONAME
+	_ZNK14TAlfTimedValue6TargetEv @ 898 NONAME
+	_ZNK14TAlfTimedValue8ValueNowEv @ 899 NONAME
+	_ZNK15CAlfBorderBrush10EdgeOffsetEv @ 900 NONAME
+	_ZNK15CAlfBorderBrush11ImageOffsetEv @ 901 NONAME
+	_ZNK15CAlfBorderBrush5ImageEv @ 902 NONAME
+	_ZNK15CAlfBorderBrush9ThicknessEv @ 903 NONAME
+	_ZNK15CAlfImageVisual14SecondaryImageEv @ 904 NONAME
+	_ZNK15CAlfImageVisual5ImageEv @ 905 NONAME
+	_ZNK15TAlfTextCommand10TextVisualEv @ 906 NONAME
+	_ZNK15TAlfTextCommand4SizeEv @ 907 NONAME
+	_ZNK15TAlfTextCommand4TextEv @ 908 NONAME
+	_ZNK15TAlfTextCommand8ExecuteLER7CAlfEnv @ 909 NONAME
+	_ZNK16CAlfAnchorLayout8BaseUnitEv @ 910 NONAME
+	_ZNK16CAlfControlGroup10ResourceIdEv @ 911 NONAME
+	_ZNK16CAlfControlGroup11AcceptInputEv @ 912 NONAME
+	_ZNK16CAlfControlGroup11FindControlEii @ 913 NONAME
+	_ZNK16CAlfControlGroup13IsTransformedEv @ 914 NONAME
+	_ZNK16CAlfControlGroup5CountEv @ 915 NONAME
+	_ZNK16CAlfControlGroup7ControlEi @ 916 NONAME
+	_ZNK16TAlfGroupCommand12ControlGroupEv @ 917 NONAME
+	_ZNK16TAlfGroupCommand4SizeEv @ 918 NONAME
+	_ZNK16TAlfGroupCommand7DisplayEv @ 919 NONAME
+	_ZNK16TAlfGroupCommand8ExecuteLER7CAlfEnv @ 920 NONAME
+	_ZNK16TAlfImageCommand11ImageVisualEv @ 921 NONAME
+	_ZNK16TAlfImageCommand4SizeEv @ 922 NONAME
+	_ZNK16TAlfImageCommand5ImageEv @ 923 NONAME
+	_ZNK16TAlfImageCommand8ExecuteLER7CAlfEnv @ 924 NONAME
+	_ZNK16TAlfPointCommand10TimedPointEv @ 925 NONAME
+	_ZNK16TAlfPointCommand14TransitionTimeEv @ 926 NONAME
+	_ZNK16TAlfPointCommand4SizeEv @ 927 NONAME
+	_ZNK16TAlfPointCommand5SpeedEv @ 928 NONAME
+	_ZNK16TAlfPointCommand6TargetEv @ 929 NONAME
+	_ZNK16TAlfPointCommand8ExecuteLER7CAlfEnv @ 930 NONAME
+	_ZNK16TAlfValueCommand10TimedValueEv @ 931 NONAME
+	_ZNK16TAlfValueCommand14TransitionTimeEv @ 932 NONAME
+	_ZNK16TAlfValueCommand4SizeEv @ 933 NONAME
+	_ZNK16TAlfValueCommand5SpeedEv @ 934 NONAME
+	_ZNK16TAlfValueCommand6TargetEv @ 935 NONAME
+	_ZNK16TAlfValueCommand8ExecuteLER7CAlfEnv @ 936 NONAME
+	_ZNK17CAlfGradientBrush5ColorEi @ 937 NONAME
+	_ZNK17CAlfGradientBrush5ImageEv @ 938 NONAME
+	_ZNK17CAlfGradientBrush7OpacityEi @ 939 NONAME
+	_ZNK17CAlfLCTGridLayout8BaseUnitEv @ 940 NONAME
+	_ZNK17CAlfPropertyOwner18PropertyFindStringERK6TDesC8PP7TDesC16 @ 941 NONAME
+	_ZNK17CAlfPropertyOwner19PropertyFindIntegerERK6TDesC8Pi @ 942 NONAME
+	_ZNK17TAlfActionCommand2IdEv @ 943 NONAME
+	_ZNK17TAlfActionCommand4SizeEv @ 944 NONAME
+	_ZNK17TAlfActionCommand8ExecuteLER7CAlfEnv @ 945 NONAME
+	_ZNK17TAlfMarkerCommand2IdEv @ 946 NONAME
+	_ZNK17TAlfMarkerCommand4SizeEv @ 947 NONAME
+	_ZNK17TAlfMarkerCommand8ExecuteLER7CAlfEnv @ 948 NONAME
+	_ZNK17TAlfObjectCommand13ObjectCommandEv @ 949 NONAME
+	_ZNK17TAlfObjectCommand4SizeEv @ 950 NONAME
+	_ZNK17TAlfObjectCommand6ObjectEv @ 951 NONAME
+	_ZNK17TAlfObjectCommand8ExecuteLER7CAlfEnv @ 952 NONAME
+	_ZNK17TAlfObjectCommand9OperationEv @ 953 NONAME
+	_ZNK17TAlfScrollerEvent11OrientationEv @ 954 NONAME
+	_ZNK17TAlfScrollerEvent4CodeEv @ 955 NONAME
+	_ZNK17TAlfScrollerEvent9MagnitudeEv @ 956 NONAME
+	_ZNK17TAlfVisualCommand10FlagsToSetEv @ 957 NONAME
+	_ZNK17TAlfVisualCommand12FlagsToClearEv @ 958 NONAME
+	_ZNK17TAlfVisualCommand4SizeEv @ 959 NONAME
+	_ZNK17TAlfVisualCommand6VisualEv @ 960 NONAME
+	_ZNK17TAlfVisualCommand8ExecuteLER7CAlfEnv @ 961 NONAME
+	_ZNK18CAlfProceduralMesh8MaterialEv @ 962 NONAME
+	_ZNK18CAlfTextureManager12BlankTextureEv @ 963 NONAME
+	_ZNK18CAlfTextureManager7TextureEi @ 964 NONAME
+	_ZNK18CAlfTextureManager8IsLoadedEPK11CAlfTexture @ 965 NONAME
+	_ZNK18CAlfTextureManager8IsLoadedERK7TDesC16 @ 966 NONAME
+	_ZNK18CAlfTextureManager8IsLoadedEi @ 967 NONAME
+	_ZNK18CAlfTextureManager9ImagePathEv @ 968 NONAME
+	_ZNK18CAlfTransformation16NonIdentityCountEv @ 969 NONAME
+	_ZNK18CAlfTransformation5CountEv @ 970 NONAME
+	_ZNK18CAlfViewportLayout8BaseUnitEv @ 971 NONAME
+	_ZNK18TAlfControlCommand4SizeEv @ 972 NONAME
+	_ZNK18TAlfControlCommand7ControlEv @ 973 NONAME
+	_ZNK18TAlfControlCommand8ExecuteLER7CAlfEnv @ 974 NONAME
+	_ZNK19CAlfCurvePathLayout25MappingFunctionIdentifierEv @ 975 NONAME
+	_ZNK19CAlfCurvePathLayout8BaseUnitEv @ 976 NONAME
+	_ZNK19CAlfCurvePathLayout8MapValueEfi @ 977 NONAME
+	_ZNK19CAlfDropShadowBrush5DepthEv @ 978 NONAME
+	_ZNK19CAlfDropShadowBrush8SoftnessEv @ 979 NONAME
+	_ZNK19CAlfLCTAnchorLayout8BaseUnitEv @ 980 NONAME
+	_ZNK21CAlfShadowBorderBrush5WidthEv @ 981 NONAME
+	_ZNK22TAlfCustomEventCommand4SizeEv @ 982 NONAME
+	_ZNK22TAlfCustomEventCommand5ParamEv @ 983 NONAME
+	_ZNK22TAlfCustomEventCommand8ExecuteLER7CAlfEnv @ 984 NONAME
+	_ZNK22TAlfCustomEventCommand9EventDataEv @ 985 NONAME
+	_ZNK22TAlfCustomEventCommand9RecipientEv @ 986 NONAME
+	_ZNK23CAlfSineMappingFunction6FactorEv @ 987 NONAME
+	_ZNK23CAlfSineMappingFunction6OffsetEv @ 988 NONAME
+	_ZNK25CAlfCosineMappingFunction6FactorEv @ 989 NONAME
+	_ZNK25CAlfCosineMappingFunction6OffsetEv @ 990 NONAME
+	_ZNK25CAlfLinearMappingFunction6FactorEv @ 991 NONAME
+	_ZNK25CAlfLinearMappingFunction6OffsetEv @ 992 NONAME
+	_ZNK25TAlfTransformationCommand14TransformationEv @ 993 NONAME
+	_ZNK25TAlfTransformationCommand4SizeEv @ 994 NONAME
+	_ZNK25TAlfTransformationCommand4StepEv @ 995 NONAME
+	_ZNK25TAlfTransformationCommand8ExecuteLER7CAlfEnv @ 996 NONAME
+	_ZNK27CAlfConstantMappingFunction5ValueEv @ 997 NONAME
+	_ZNK7CAlfEnv10FindWidgetEPKc @ 998 NONAME
+	_ZNK7CAlfEnv11FindControlEii @ 999 NONAME
+	_ZNK7CAlfEnv12DisplayCountEv @ 1000 NONAME
+	_ZNK7CAlfEnv13WidgetFactoryEv @ 1001 NONAME
+	_ZNK7CAlfEnv14PrimaryDisplayEv @ 1002 NONAME
+	_ZNK7CAlfEnv14TextureManagerEv @ 1003 NONAME
+	_ZNK7CAlfEnv16TextStyleManagerEv @ 1004 NONAME
+	_ZNK7CAlfEnv20SharedTextureManagerE4TUid @ 1005 NONAME
+	_ZN10CAlfLayout11SetBaseUnitERK10TAlfMetric @ 1006 NONAME
+	_ZNK7CAlfEnv8RendererEv @ 1007 NONAME
+	_ZNK8CAlfMesh24AnimationControllerCountEv @ 1008 NONAME
+	_ZNK8CAlfMesh8MeshTypeEv @ 1009 NONAME
+	_ZNK9CAlfBrush10IdentifierEv @ 1010 NONAME
+	_ZNK9CAlfBrush5CommsEv @ 1011 NONAME
+	_ZNK9CAlfBrush7OpacityEv @ 1012 NONAME
+	_ZNK9TAlfEvent10IsKeyEventEv @ 1013 NONAME
+	_ZNK9TAlfEvent11PointerDownEv @ 1014 NONAME
+	_ZNK9TAlfEvent12PointerEventEv @ 1015 NONAME
+	_ZNK9TAlfEvent13IsCustomEventEv @ 1016 NONAME
+	_ZNK9TAlfEvent13ScrollerEventEv @ 1017 NONAME
+	_ZNK9TAlfEvent14IsPointerEventEv @ 1018 NONAME
+	_ZNK9TAlfEvent14PointerLongTapEv @ 1019 NONAME
+	_ZNK9TAlfEvent15CustomEventDataEv @ 1020 NONAME
+	_ZNK9TAlfEvent15CustomParameterEv @ 1021 NONAME
+	_ZNK9TAlfEvent15IsScrollerEventEv @ 1022 NONAME
+	_ZNK9TAlfEvent4CodeEv @ 1023 NONAME
+	_ZNK9TAlfEvent4TypeEv @ 1024 NONAME
+	_ZNK9TAlfEvent6VisualEv @ 1025 NONAME
+	_ZNK9TAlfEvent7DisplayEv @ 1026 NONAME
+	_ZNK9TAlfEvent8KeyEventEv @ 1027 NONAME
+	_ZNK9TAlfEvent9PointerUpEv @ 1028 NONAME
+	_ZNK9TAlfImage10HasTextureEv @ 1029 NONAME
+	_ZNK9TAlfImage11BottomRightEv @ 1030 NONAME
+	_ZNK9TAlfImage7TextureEv @ 1031 NONAME
+	_ZNK9TAlfImage7TopLeftEv @ 1032 NONAME
+	_ZTI10CAlfLayout @ 1033 NONAME ; #<TI>#
+	_ZTI10CAlfVisual @ 1034 NONAME ; #<TI>#
+	_ZTI11CAlfControl @ 1035 NONAME ; #<TI>#
+	_ZTI11TAlfCommand @ 1036 NONAME ; #<TI>#
+	_ZTI14CAlfDeckLayout @ 1037 NONAME ; #<TI>#
+	_ZTI14CAlfFlowLayout @ 1038 NONAME ; #<TI>#
+	_ZTI14CAlfGridLayout @ 1039 NONAME ; #<TI>#
+	_ZTI14CAlfLineVisual @ 1040 NONAME ; #<TI>#
+	_ZTI14CAlfMeshVisual @ 1041 NONAME ; #<TI>#
+	_ZTI14CAlfTextVisual @ 1042 NONAME ; #<TI>#
+	_ZTI14RAlfClientBase @ 1043 NONAME ; #<TI>#
+	_ZTI15CAlfImageVisual @ 1044 NONAME ; #<TI>#
+	_ZTI15TAlfTextCommand @ 1045 NONAME ; #<TI>#
+	_ZTI16CAlfAnchorLayout @ 1046 NONAME ; #<TI>#
+	_ZTI16TAlfGroupCommand @ 1047 NONAME ; #<TI>#
+	_ZTI16TAlfImageCommand @ 1048 NONAME ; #<TI>#
+	_ZTI16TAlfPointCommand @ 1049 NONAME ; #<TI>#
+	_ZTI16TAlfValueCommand @ 1050 NONAME ; #<TI>#
+	_ZTI17CAlfLCTGridLayout @ 1051 NONAME ; #<TI>#
+	_ZTI17CAlfLCTTextVisual @ 1052 NONAME ; #<TI>#
+	_ZTI17CAlfPropertyOwner @ 1053 NONAME ; #<TI>#
+	_ZTI17TAlfActionCommand @ 1054 NONAME ; #<TI>#
+	_ZTI17TAlfMarkerCommand @ 1055 NONAME ; #<TI>#
+	_ZTI17TAlfObjectCommand @ 1056 NONAME ; #<TI>#
+	_ZTI17TAlfVisualCommand @ 1057 NONAME ; #<TI>#
+	_ZTI18CAlfViewportLayout @ 1058 NONAME ; #<TI>#
+	_ZTI18TAlfControlCommand @ 1059 NONAME ; #<TI>#
+	_ZTI19CAlfCurvePathLayout @ 1060 NONAME ; #<TI>#
+	_ZTI19CAlfLCTAnchorLayout @ 1061 NONAME ; #<TI>#
+	_ZTI22TAlfCustomEventCommand @ 1062 NONAME ; #<TI>#
+	_ZTI23CAlfSineMappingFunction @ 1063 NONAME ; #<TI>#
+	_ZTI24CAlfTableMappingFunction @ 1064 NONAME ; #<TI>#
+	_ZTI25CAlfCosineMappingFunction @ 1065 NONAME ; #<TI>#
+	_ZTI25CAlfLinearMappingFunction @ 1066 NONAME ; #<TI>#
+	_ZTI25TAlfTransformationCommand @ 1067 NONAME ; #<TI>#
+	_ZTI26CAlfAverageMappingFunction @ 1068 NONAME ; #<TI>#
+	_ZTI27CAlfConstantMappingFunction @ 1069 NONAME ; #<TI>#
+	_ZTI9CAlfBrush @ 1070 NONAME ; #<TI>#
+	_ZTIN20CAlfCommandScheduler11CTimedEventE @ 1071 NONAME ; #<TI>#
+	_ZTV10CAlfLayout @ 1072 NONAME ; #<VT>#
+	_ZTV10CAlfVisual @ 1073 NONAME ; #<VT>#
+	_ZTV11CAlfControl @ 1074 NONAME ; #<VT>#
+	_ZTV11TAlfCommand @ 1075 NONAME ; #<VT>#
+	_ZTV14CAlfDeckLayout @ 1076 NONAME ; #<VT>#
+	_ZTV14CAlfFlowLayout @ 1077 NONAME ; #<VT>#
+	_ZTV14CAlfGridLayout @ 1078 NONAME ; #<VT>#
+	_ZTV14CAlfLineVisual @ 1079 NONAME ; #<VT>#
+	_ZTV14CAlfMeshVisual @ 1080 NONAME ; #<VT>#
+	_ZTV14CAlfTextVisual @ 1081 NONAME ; #<VT>#
+	_ZTV14RAlfClientBase @ 1082 NONAME ; #<VT>#
+	_ZTV15CAlfImageVisual @ 1083 NONAME ; #<VT>#
+	_ZTV15TAlfTextCommand @ 1084 NONAME ; #<VT>#
+	_ZTV16CAlfAnchorLayout @ 1085 NONAME ; #<VT>#
+	_ZTV16TAlfGroupCommand @ 1086 NONAME ; #<VT>#
+	_ZTV16TAlfImageCommand @ 1087 NONAME ; #<VT>#
+	_ZTV16TAlfPointCommand @ 1088 NONAME ; #<VT>#
+	_ZTV16TAlfValueCommand @ 1089 NONAME ; #<VT>#
+	_ZTV17CAlfLCTGridLayout @ 1090 NONAME ; #<VT>#
+	_ZTV17CAlfLCTTextVisual @ 1091 NONAME ; #<VT>#
+	_ZTV17CAlfPropertyOwner @ 1092 NONAME ; #<VT>#
+	_ZTV17TAlfActionCommand @ 1093 NONAME ; #<VT>#
+	_ZTV17TAlfMarkerCommand @ 1094 NONAME ; #<VT>#
+	_ZTV17TAlfObjectCommand @ 1095 NONAME ; #<VT>#
+	_ZTV17TAlfVisualCommand @ 1096 NONAME ; #<VT>#
+	_ZTV18CAlfViewportLayout @ 1097 NONAME ; #<VT>#
+	_ZTV18TAlfControlCommand @ 1098 NONAME ; #<VT>#
+	_ZTV19CAlfCurvePathLayout @ 1099 NONAME ; #<VT>#
+	_ZTV19CAlfLCTAnchorLayout @ 1100 NONAME ; #<VT>#
+	_ZTV22TAlfCustomEventCommand @ 1101 NONAME ; #<VT>#
+	_ZTV23CAlfSineMappingFunction @ 1102 NONAME ; #<VT>#
+	_ZTV24CAlfTableMappingFunction @ 1103 NONAME ; #<VT>#
+	_ZTV25CAlfCosineMappingFunction @ 1104 NONAME ; #<VT>#
+	_ZTV25CAlfLinearMappingFunction @ 1105 NONAME ; #<VT>#
+	_ZTV25TAlfTransformationCommand @ 1106 NONAME ; #<VT>#
+	_ZTV26CAlfAverageMappingFunction @ 1107 NONAME ; #<VT>#
+	_ZTV27CAlfConstantMappingFunction @ 1108 NONAME ; #<VT>#
+	_ZTV9CAlfBrush @ 1109 NONAME ; #<VT>#
+	_ZTVN20CAlfCommandScheduler11CTimedEventE @ 1110 NONAME ; #<VT>#
+	_ZThn32_N11CAlfControl11OfferEventLERK9TAlfEvent @ 1111 NONAME ; #<thunk>#
+	_ZThn40_NK19CAlfCurvePathLayout25MappingFunctionIdentifierEv @ 1112 NONAME ; #<thunk>#
+	_ZThn40_NK19CAlfCurvePathLayout8MapValueEfi @ 1113 NONAME ; #<thunk>#
+	_ZThn4_NK13CAlfCurvePath25MappingFunctionIdentifierEv @ 1114 NONAME ; #<thunk>#
+	_ZThn4_NK13CAlfCurvePath8MapValueEfi @ 1115 NONAME ; #<thunk>#
+	_ZN19CAlfImageLoaderUtil21CreateSVGImageLoaderLERK7TDesC16 @ 1116 NONAME
+	_ZN14CAlfLineVisual8SetColorERK4TRgb @ 1117 NONAME
+	_ZN13CAlfCurvePath10AppendArcLERK13TAlfRealPointRK12TAlfRealSizefff @ 1118 NONAME
+	_ZN13CAlfCurvePath11AppendLineLERK13TAlfRealPointS2_f @ 1119 NONAME
+	_ZN15CAlfImageVisual13SetDropShadowERK10TAlfMetric @ 1120 NONAME
+	_ZN15CAlfImageVisual13SetDropShadowERK12TAlfXYMetric @ 1121 NONAME
+	_ZN14CAlfFrameBrush13SetEdgeOffsetERK12TAlfXYMetric @ 1122 NONAME
+	_ZN14CAlfFrameBrush4NewLER7CAlfEnvRK11TAknsItemIDRK12TAlfXYMetric @ 1123 NONAME
+	_ZN14CAlfFrameBrush5NewLCER7CAlfEnvRK11TAknsItemIDRK12TAlfXYMetric @ 1124 NONAME
+	_ZN15CAlfBorderBrush12SetThicknessERK12TAlfXYMetric @ 1125 NONAME
+	_ZN15CAlfBorderBrush13SetEdgeOffsetERK12TAlfXYMetric @ 1126 NONAME
+	_ZN15CAlfBorderBrush14SetImageOffsetERK12TAlfXYMetric @ 1127 NONAME
+	_ZN15CAlfBorderBrush4NewLER7CAlfEnvRK12TAlfXYMetricS4_ @ 1128 NONAME
+	_ZN15CAlfBorderBrush5NewLCER7CAlfEnvRK12TAlfXYMetricS4_ @ 1129 NONAME
+	_ZN19CAlfDropShadowBrush11SetSoftnessERK10TAlfMetric @ 1130 NONAME
+	_ZN19CAlfDropShadowBrush4NewLER7CAlfEnvRK10TAlfMetric @ 1131 NONAME
+	_ZN19CAlfDropShadowBrush5NewLCER7CAlfEnvRK10TAlfMetric @ 1132 NONAME
+	_ZN19CAlfDropShadowBrush8SetColorERK4TRgb @ 1133 NONAME
+	_ZN19CAlfDropShadowBrush8SetDepthERK10TAlfMetric @ 1134 NONAME
+	_ZN21CAlfShadowBorderBrush4NewLER7CAlfEnvRK10TAlfMetric @ 1135 NONAME
+	_ZN21CAlfShadowBorderBrush5NewLCER7CAlfEnvRK10TAlfMetric @ 1136 NONAME
+	_ZN21CAlfShadowBorderBrush8SetWidthERK10TAlfMetric @ 1137 NONAME
+	_ZN18CAlfTextureManager20LoadAnimatedTextureLERK7TDesC165TSize16TAlfTextureFlagsi @ 1138 NONAME
+	_ZN7CAlfEnv13DestroyWidgetEPN3Alf10IAlfWidgetE @ 1139 NONAME
+	_ZN16CAlfAnchorLayout6AttachEi14TAlfAnchorTypeRK10TAlfMetric26TAlfAnchorAttachmentOrigini @ 1140 NONAME
+	_ZN16CAlfAnchorLayout6AttachEi14TAlfAnchorTypeRK12TAlfXYMetric26TAlfAnchorAttachmentOrigini @ 1141 NONAME
+	_ZN16CAlfAnchorLayout6AttachEiRK13TAlfBoxMetric26TAlfAnchorAttachmentOrigini @ 1142 NONAME
+	_ZN16CAlfAnchorLayout6DetachEi @ 1143 NONAME
+	_ZN16CAlfAnchorLayout6DetachEi14TAlfAnchorType @ 1144 NONAME
+	_ZN10CAlfVisual10SetMaxSizeERK12TAlfRealSize @ 1145 NONAME
+	_ZN10CAlfVisual10SetMinSizeERK12TAlfRealSize @ 1146 NONAME
+	_ZN10CAlfVisual21SetCenteredPosAndSizeERK13TAlfRealPointRK12TAlfRealSizei @ 1147 NONAME
+	_ZN10CAlfVisual4MoveERK13TAlfRealPointi @ 1148 NONAME
+	_ZNK10CAlfVisual18MaxSizeInBaseUnitsEv @ 1149 NONAME
+	_ZNK10CAlfVisual18MinSizeInBaseUnitsEv @ 1150 NONAME
+	_ZN13TAlfBoxMetricC1ERK12TAlfXYMetricS2_ @ 1151 NONAME
+	_ZN13TAlfBoxMetricC2ERK12TAlfXYMetricS2_ @ 1152 NONAME
+	_ZN11CAlfTextureD0Ev @ 1153 NONAME
+	_ZN11CAlfTextureD1Ev @ 1154 NONAME
+	_ZN11CAlfTextureD2Ev @ 1155 NONAME
+	_ZN14CAlfGridLayout15LayoutModeFlagsE17TAlfGridDimension @ 1156 NONAME
+	_ZN14CAlfGridLayout18SetLayoutModeFlagsE17TAlfGridDimensionj @ 1157 NONAME
+	_ZN14CAlfGridLayout20ClearLayoutModeFlagsE17TAlfGridDimensionj @ 1158 NONAME
+	_ZN10CAlfVisual19SetTactileFeedbackLEii @ 1159 NONAME
+	_ZN10CAlfVisual21RemoveTactileFeedbackEi @ 1160 NONAME
+	_ZNK10CAlfVisual18HasTactileFeedbackEi @ 1161 NONAME
+	_ZN10CAlfRoster23SetPointerDragThresholdERK11CAlfControlRK12TAlfXYMetric @ 1162 NONAME
+	_ZN10CAlfRoster32DisableLongTapEventsWhenDraggingERK11CAlfControli @ 1163 NONAME
+	_ZN14CAlfTextVisual8SetColorERK7TDesC16S2_ @ 1164 NONAME
+	_ZN9TAlfImageC1EPK7TDesC165TSize10TScaleModeS2_iiffff16TAlfTextureFlagsiP18CAlfTextureManager @ 1165 NONAME
+	_ZN9TAlfImageC2EPK7TDesC165TSize10TScaleModeS2_iiffff16TAlfTextureFlagsiP18CAlfTextureManager @ 1166 NONAME
+	_ZN16CAlfScreenBuffer10ConstructLEv @ 1167 NONAME
+	_ZN16CAlfScreenBuffer12AddObserverLE4TUidP24MAlfScreenBufferObserveri @ 1168 NONAME
+	_ZN16CAlfScreenBuffer14RemoveObserverE4TUid @ 1169 NONAME
+	_ZN16CAlfScreenBuffer17RequestNextBufferE4TUid @ 1170 NONAME
+	_ZN16CAlfScreenBuffer18GetGraphicsContextE4TUidS0_ @ 1171 NONAME
+	_ZN16CAlfScreenBuffer19GetDrawingInterfaceE4TUidS0_ @ 1172 NONAME
+	_ZN16CAlfScreenBuffer4NewLER7CAlfEnv @ 1173 NONAME
+	_ZN16CAlfScreenBufferC1ER7CAlfEnv @ 1174 NONAME
+	_ZN16CAlfScreenBufferC2ER7CAlfEnv @ 1175 NONAME
+	_ZN16CAlfScreenBufferD0Ev @ 1176 NONAME
+	_ZN16CAlfScreenBufferD1Ev @ 1177 NONAME
+	_ZN16CAlfScreenBufferD2Ev @ 1178 NONAME
+	_ZN23CAlfSymbianBufferDrawer10DrawBufferER14CBitmapContextRK6TPointRK5TRect @ 1179 NONAME
+	_ZN23CAlfSymbianBufferDrawer13ReleaseDrawerEv @ 1180 NONAME
+	_ZN23CAlfSymbianBufferDrawer16DrawBufferMaskedER14CBitmapContextPK10CFbsBitmapRK6TPointRK5TRect @ 1181 NONAME
+	_ZN7CAlfEnv11NewDisplayLERK5TRectiP11CAlfDisplayi4TUid @ 1182 NONAME
+	_ZThn4_N23CAlfSymbianBufferDrawer13ReleaseDrawerEv @ 1183 NONAME ; #<thunk>#
+	_ZN20CAlfTextStyleManager15DeleteTextStyleEi @ 1184 NONAME
+	_ZN18CAlfTextureManager22UpdateTextureFromFileLEiPK7TDesC16 @ 1185 NONAME
+	_ZN18CAlfTextureManager24UpdateTextureFromBitmapLEiP18MAlfBitmapProvider @ 1186 NONAME
+	_ZN10CAlfVisual5PauseEi @ 1187 NONAME
+	_ZN10CAlfVisual6ResumeEi @ 1188 NONAME
+	_ZN11CAlfDisplay19SetBackgroundItemsLERK6RArrayI25TAlfDisplayBackgroundItemE @ 1189 NONAME
+	_ZN25TAlfDisplayBackgroundItem17SetSkinBackgroundERK11TAknsItemID @ 1190 NONAME
+	_ZN25TAlfDisplayBackgroundItem7SetRectERK5TRect @ 1191 NONAME
+	_ZN25TAlfDisplayBackgroundItem8SetColorERK11TAknsItemIDi @ 1192 NONAME
+	_ZN25TAlfDisplayBackgroundItem8SetColorERK4TRgb @ 1193 NONAME
+	_ZN25TAlfDisplayBackgroundItemC1ERK5TRect @ 1194 NONAME
+	_ZN25TAlfDisplayBackgroundItemC1ERK5TRectRK11TAknsItemID @ 1195 NONAME
+	_ZN25TAlfDisplayBackgroundItemC1ERK5TRectRK11TAknsItemIDi @ 1196 NONAME
+	_ZN25TAlfDisplayBackgroundItemC1ERK5TRectRK4TRgb @ 1197 NONAME
+	_ZN25TAlfDisplayBackgroundItemC1Ev @ 1198 NONAME
+	_ZN25TAlfDisplayBackgroundItemC2ERK5TRect @ 1199 NONAME
+	_ZN25TAlfDisplayBackgroundItemC2ERK5TRectRK11TAknsItemID @ 1200 NONAME
+	_ZN25TAlfDisplayBackgroundItemC2ERK5TRectRK11TAknsItemIDi @ 1201 NONAME
+	_ZN25TAlfDisplayBackgroundItemC2ERK5TRectRK4TRgb @ 1202 NONAME
+	_ZN25TAlfDisplayBackgroundItemC2Ev @ 1203 NONAME
+	_ZN15CAlfBatchBuffer16FlushBatchBufferEv @ 1204 NONAME
+	_ZN15CAlfBatchBuffer16SetAutoFlushModeE17TAlfAutoFlushMode @ 1205 NONAME
+	_ZN15CAlfBatchBuffer21SetMaxBatchBufferSizeEi @ 1206 NONAME
+	_ZN16CAlfGenComponent12DoCmdNoReplyEjRK6TDesC8 @ 1207 NONAME
+	_ZNK15CAlfBatchBuffer13AutoFlushModeEv @ 1208 NONAME
+	_ZNK15CAlfBatchBuffer18GetBatchBufferInfoE23TAlfBatchBufferInfoType @ 1209 NONAME
+	_ZNK7CAlfEnv18BatchBufferHandlerEv @ 1210 NONAME
+	_ZN13CAlfTextStyle25SetTextPaneHeightInPixelsEii @ 1211 NONAME
+	_ZNK14CAlfTextVisual9TextStyleEv @ 1212 NONAME
+	_ZN7AlfUtil12ThemeItemIdLER7CAlfEnvRK7TDesC16 @ 1213 NONAME
+	_ZNK18CAlfTextureManager9TextureIdERK7TDesC16 @ 1214 NONAME
+	_ZNK11CAlfControl17FocusedConnectionEv @ 1215 NONAME
+	_ZTI15CAlfImageLoader @ 1216 NONAME ; #<TI>#
+	_ZTV15CAlfImageLoader @ 1217 NONAME ; #<VT>#
+	_ZN11CAlfTexture17SetAutoSizeParamsERK25TAlfTextureAutoSizeParams @ 1218 NONAME
+	_ZN18CAlfTextureManager20AddAutoSizeObserverLEP27MAlfTextureAutoSizeObserver @ 1219 NONAME
+	_ZN18CAlfTextureManager22RemoveAutoSizeObserverEP27MAlfTextureAutoSizeObserver @ 1220 NONAME
+	_ZN25TAlfTextureAutoSizeParams16SetMinSizeChangeEi @ 1221 NONAME
+	_ZN25TAlfTextureAutoSizeParams21SetSizeLowerThresholdEi @ 1222 NONAME
+	_ZN25TAlfTextureAutoSizeParams21SetSizeUpperThresholdEi @ 1223 NONAME
+	_ZN25TAlfTextureAutoSizeParams26SetDownsizeSettleThresholdEi @ 1224 NONAME
+	_ZN25TAlfTextureAutoSizeParamsC1Ev @ 1225 NONAME
+	_ZN25TAlfTextureAutoSizeParamsC2Ev @ 1226 NONAME
+	_ZN27CAlfAutoSizeImageLoaderUtil20PreferredSizeChangedERK11CAlfTexture5TSize @ 1227 NONAME
+	_ZNK11CAlfTexture14AutoSizeParamsEv @ 1228 NONAME
+	_ZNK25TAlfTextureAutoSizeParams13MinSizeChangeEv @ 1229 NONAME
+	_ZNK25TAlfTextureAutoSizeParams18SizeLowerThresholdEv @ 1230 NONAME
+	_ZNK25TAlfTextureAutoSizeParams18SizeUpperThresholdEv @ 1231 NONAME
+	_ZNK25TAlfTextureAutoSizeParams23DownsizeSettleThresholdEv @ 1232 NONAME
+	_ZThn44_N27CAlfAutoSizeImageLoaderUtil20PreferredSizeChangedERK11CAlfTexture5TSize @ 1233 NONAME ; #<thunk>#
+	_ZN11CAlfTexture17EnableRefCountingEi @ 1234 NONAME
+	_ZN11CAlfTexture18RefCountingEnabledEv @ 1235 NONAME
+	_ZN16CAlfScreenBuffer4NewLEv @ 1236 NONAME
+	_ZNK23CAlfSymbianBufferDrawer16GetBufferBitmapsERP10CFbsBitmapS2_ @ 1237 NONAME
+	_ZN27CAlfAutoSizeImageLoaderUtilC1Ev @ 1238 NONAME
+	_ZN27CAlfAutoSizeImageLoaderUtilC2Ev @ 1239 NONAME
+	_ZNK7CAlfEnv16FindControlGroupEi @ 1240 NONAME
+	_ZN7CAlfEnv12AddExtensionEiP13MAlfEnvObject @ 1241 NONAME
+	_ZNK7CAlfEnv9ExtensionEi @ 1242 NONAME
+	_ZN14CAlfFrameBrush4NewLER7CAlfEnvRK9TAlfImageRK12TAlfXYMetric @ 1243 NONAME
+	_ZN14CAlfFrameBrush5NewLCER7CAlfEnvRK9TAlfImageRK12TAlfXYMetric @ 1244 NONAME
+	_ZN14CAlfFrameBrush8SetImageERK9TAlfImage @ 1245 NONAME
+	_ZN19CAlfImageLoaderUtil18CreateImageLoaderLERK11TAknsItemIDRK5TRectS5_ @ 1246 NONAME
+	_ZN11CAlfDisplay19HandlePointerEventLERK13TPointerEvent @ 1247 NONAME
+	_ZN11CAlfTexture20SetRefCountingActionEi @ 1248 NONAME
+	_ZN14CAlfFrameBrush8SetImageENS_11TFramePartsERK9TAlfImage @ 1249 NONAME
+	_ZN7CAlfEnv19HandlePointerEventLERK13TPointerEventR11CAlfDisplay @ 1250 NONAME
+	_ZNK11CAlfTexture17RefCountingActionEv @ 1251 NONAME
+	_ZN16CAlfScreenBuffer12AddObserverLE4TUidjP24MAlfScreenBufferObserveri @ 1252 NONAME
+	_ZN16CAlfScreenBuffer17RequestBufferDrawE4TUid @ 1253 NONAME
+	_ZN11CAlfDisplay23SuppressAutomaticFadingEi @ 1254 NONAME
+	_ZN10CAlfVisual17EnableDropShadowLEi @ 1255 NONAME
+	_ZN14CAlfDropShadow10SetOpacityERK14TAlfTimedValue @ 1256 NONAME
+	_ZN14CAlfDropShadow8SetColorERK11TAknsItemIDii @ 1257 NONAME
+	_ZN14CAlfDropShadow8SetColorERK4TRgbi @ 1258 NONAME
+	_ZN14CAlfDropShadow8SetScaleERK14TAlfTimedValue @ 1259 NONAME
+	_ZN14CAlfDropShadow9SetOffsetERK14TAlfTimedPointi @ 1260 NONAME
+	_ZN14CAlfDropShadow9SetOffsetEf10TAlfMetrici @ 1261 NONAME
+	_ZN14CAlfDropShadow9SetRadiusERK14TAlfTimedValue @ 1262 NONAME
+	_ZNK10CAlfVisual17DropShadowHandlerEv @ 1263 NONAME
+	_ZN10CAlfRoster36AddControlGroupOrderChangedObserverLER36MAlfControlGroupOrderChangedObserver @ 1264 NONAME
+	_ZN10CAlfRoster38RemoveControlGroupOrderChangedObserverER36MAlfControlGroupOrderChangedObserver @ 1265 NONAME
+	_ZN14CAlfTextVisual9SetOffsetERK14TAlfTimedPoint @ 1266 NONAME
+	_ZN9CAlfBrush15SetClipToVisualEi @ 1267 NONAME
+	_ZNK14CAlfTextVisual6OffsetEv @ 1268 NONAME
+	_ZNK9CAlfBrush12ClipToVisualEv @ 1269 NONAME
+	_ZN16CAlfTextureGroup10ConstructLER7CAlfEnv @ 1270 NONAME
+	_ZN16CAlfTextureGroup11AddTextureLER11CAlfTexture @ 1271 NONAME
+	_ZN16CAlfTextureGroup13RemoveTextureER11CAlfTexture @ 1272 NONAME
+	_ZN16CAlfTextureGroup16AddLoadObserverLER40MAlfTextureGroupLoadingCompletedObserver @ 1273 NONAME
+	_ZN16CAlfTextureGroup18RemoveLoadObserverER40MAlfTextureGroupLoadingCompletedObserver @ 1274 NONAME
+	_ZN16CAlfTextureGroup19EnableLoadObserversEi @ 1275 NONAME
+	_ZN16CAlfTextureGroup4NewLER7CAlfEnv @ 1276 NONAME
+	_ZN16CAlfTextureGroup5NewLCER7CAlfEnv @ 1277 NONAME
+	_ZN16CAlfTextureGroupC1Ev @ 1278 NONAME
+	_ZN16CAlfTextureGroupC2Ev @ 1279 NONAME
+	_ZN16CAlfTextureGroupD0Ev @ 1280 NONAME
+	_ZN16CAlfTextureGroupD1Ev @ 1281 NONAME
+	_ZN16CAlfTextureGroupD2Ev @ 1282 NONAME
+	_ZNK16CAlfTextureGroup18IsLoadingCompletedEv @ 1283 NONAME
+	_ZNK16CAlfTextureGroup5CountEv @ 1284 NONAME
+	_ZNK16CAlfTextureGroup7TextureEi @ 1285 NONAME
+	_ZNK7CAlfEnv16FindDisplayIndexERK11CAlfDisplay @ 1286 NONAME
+	_ZNK7CAlfEnv7DisplayEi @ 1287 NONAME
+	_ZN16CAlfCanvasVisual10ConstructLER11CAlfControl @ 1288 NONAME
+	_ZN16CAlfCanvasVisual10DrawPointsEPK13TAlfRealPointi @ 1289 NONAME
+	_ZN16CAlfCanvasVisual13SetPenOpacityERKf @ 1290 NONAME
+	_ZN16CAlfCanvasVisual11DrawEllipseERK12TAlfRealRect @ 1291 NONAME
+	_ZN16CAlfCanvasVisual11DrawPolygonEPK13TAlfRealPointi @ 1292 NONAME
+	_ZN16CAlfCanvasVisual11SetPenColorERK4TRgb @ 1293 NONAME
+	_ZN16CAlfCanvasVisual11SetPenWidthERKf @ 1294 NONAME
+	_ZN16CAlfCanvasVisual12LoadIdentityEv @ 1295 NONAME
+	_ZN16CAlfCanvasVisual12SetTextAlignE19TAlfAlignHorizontal17TAlfAlignVertical @ 1296 NONAME
+	_ZN16CAlfCanvasVisual12SetTextStyleERK13CAlfTextStyle @ 1297 NONAME
+	_ZN16CAlfCanvasVisual17SetCanvasObserverEP18MAlfCanvasObserver @ 1298 NONAME
+	_ZN16CAlfCanvasVisual18SetPolygonDrawModeE19TAlfPolygonDrawMode @ 1299 NONAME
+	_ZN16CAlfCanvasVisual20RemoveAndDestroyAllDEv @ 1300 NONAME
+	_ZN16CAlfCanvasVisual20UpdateChildrenLayoutEi @ 1301 NONAME
+	_ZN16CAlfCanvasVisual22DoRemoveAndDestroyAllDEv @ 1302 NONAME
+	_ZN16CAlfCanvasVisual22PropertyOwnerExtensionERK4TUidPPv @ 1303 NONAME
+	_ZN16CAlfCanvasVisual5ScaleERKfS1_S1_ @ 1304 NONAME
+	_ZN16CAlfCanvasVisual6RotateERKfS1_S1_S1_ @ 1305 NONAME
+	_ZN16CAlfCanvasVisual7AddNewLER11CAlfControlP10CAlfLayout @ 1306 NONAME
+	_ZN16CAlfCanvasVisual7EndDrawEv @ 1307 NONAME
+	_ZN16CAlfCanvasVisual7FindTagERK6TDesC8 @ 1308 NONAME
+	_ZN16CAlfCanvasVisual8DrawTextERK7TDesC16RK12TAlfRealRect @ 1309 NONAME
+	_ZN16CAlfCanvasVisual9BeginDrawEv @ 1310 NONAME
+	_ZN16CAlfCanvasVisual9DrawImageERK11CAlfTextureRK12TAlfRealRect @ 1311 NONAME
+	_ZN16CAlfCanvasVisual9DrawLinesEPK12TAlfRealLinei @ 1312 NONAME
+	_ZN16CAlfCanvasVisual9DrawRectsEPK12TAlfRealRecti @ 1313 NONAME
+	_ZN16CAlfCanvasVisual9TranslateERKfS1_S1_ @ 1314 NONAME
+	_ZN16CAlfCanvasVisualC1Ev @ 1315 NONAME
+	_ZN16CAlfCanvasVisualC2Ev @ 1316 NONAME
+	_ZN16CAlfCanvasVisualD0Ev @ 1317 NONAME
+	_ZN16CAlfCanvasVisualD1Ev @ 1318 NONAME
+	_ZN16CAlfCanvasVisualD2Ev @ 1319 NONAME
+	_ZN14CAlfTextVisual17SetHighlightRangeEiiR4TRgbS1_ @ 1320 NONAME
+	_ZN15CAlfImageVisual9ScaleModeEv @ 1321 NONAME
+	_ZN17CAlfAsynchStartup6StartLEv @ 1322 NONAME
+	_ZN11CAlfDisplay19ForceSetVisibleAreaERK5TRect @ 1323 NONAME
+	_ZN11CAlfDisplay26SetClientWindowForDrawingLEP7RWindowP10CAlfVisual @ 1324 NONAME
+	_ZN10CAlfVisual10SetEffectLERK7TDesC16 @ 1325 NONAME
+	_ZN16CAlfClientWindow13PostCommandsLER5TDes823TAlfCommandBufferStatus @ 1326 NONAME
+	_ZN16CAlfClientWindow4NewLER7CAlfEnvR7RWindow @ 1327 NONAME
+	_ZN16CAlfClientWindowD0Ev @ 1328 NONAME
+	_ZN16CAlfClientWindowD1Ev @ 1329 NONAME
+	_ZN16CAlfClientWindowD2Ev @ 1330 NONAME
+	_ZTI16CAlfClientWindow @ 1331 NONAME ; #<TI>#
+	_ZTV16CAlfClientWindow @ 1332 NONAME ; #<VT>#
+	_ZN16RAlfDirectClient10MeasureFPSEli @ 1333 NONAME
+	_ZN16RAlfDirectClient10DisconnectEv @ 1334 NONAME
+	_ZN16RAlfDirectClientC1Ev @ 1335 NONAME
+	_ZN16RAlfDirectClientC2Ev @ 1336 NONAME
+	_ZN16RAlfDirectClient20EnableLowMemoryStateEi @ 1337 NONAME
+	_ZN10CAlfVisual15SetGroupEffectLERK7TDesC16i @ 1338 NONAME
+	_ZN16RAlfDirectClient16ForceSwRenderingEi @ 1339 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/inc/alfclient.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,353 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 class for the alfredserver.exe
+*
+*/
+
+
+
+#ifndef R_ALFCLIENT_H
+#define R_ALFCLIENT_H
+
+#include <alf/alfconstants.h>
+#include <alf/alfclientbase.h>
+#include "alf/alfvisual.h"
+#include "alf/alflayout.h"
+#include "alf/alfenv.h"
+#include "alf/alftexture.h"
+#include "alf/alfimage.h"
+#include "alf/alfroster.h"
+#include "alf/alfbatchbuffer.h"
+
+#include <AknsItemID.h>
+#include <gdi.h>
+
+/**
+ *  Alfred client.
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( RAlfClient ): public RAlfClientBase
+    {
+    
+public:
+
+    /**
+     * Constructor
+     */
+    RAlfClient();
+    
+    /**
+     * Disconnect from the server. Must be called before destruction (not just Close() )
+     */ 
+    void Disconnect();
+    
+// Env
+
+    /**
+     * Sets the refresh mode.
+     *
+     * @Todo: should be protected with capability or deprecated completely(?)
+     * @param aMode  New refresh mode.
+     *
+     * @see TAlfRefreshMode
+     */
+    void EnvSetRefreshMode( TAlfRefreshMode aMode );
+    
+    /**
+     * @Todo: should be protected with capability or deprecated completely(?)
+     * Sets the maximum allowed frame rate. Specify 0.0 to use the default limit.
+     *
+     * @param aFrameRate  New maximum frame rate in frames per second.
+     */
+    void EnvSetMaxFrameRate( TReal32 aFrameRate );
+    
+    /**
+     * Continues normal display refreshing. If display refreshing is already
+     * being done, calling this has no effect. This is called automatically
+     * from inside the toolkit when something is done that may lead to a
+     * visible change on a display. The application may also call this if it
+     * has previously paused refresh with PauseRefresh().
+     */
+    void EnvContinueRefresh();
+
+    /**
+     * Pauses display refreshing temporarily. This is called when it is clear
+     * that any displays will not be updated soon. The application may call
+     * this at times when it needs more processing time for other tasks.
+     */
+    void EnvPauseRefresh();
+    
+    /**
+     * Called on manual refresh.
+     */
+    void EnvRefreshCallBack();
+    
+    /**
+     * Determines which renderer is currently in use. Always returns the real
+     * explicit identifier of the renderer, and not an ambiguous identifier
+     * like "Default".
+     */
+    TInt EnvRenderer() const;
+    
+    /**
+     * Sets the interval before an idle notification is sent. 
+     *
+     * @param aSeconds  Threshold in milliseconds.
+     */
+    void EnvSetIdleThreshold(TInt aMilliseconds);
+   
+// Roster
+
+    /**
+     * Shows given control group in the roster using given display.
+     *
+     * @param aCntrlGroupHandle Handle to the server side object.
+     * @param aWhere Where on the roster (top/under/middle/...)
+     * @param aDisplayHandle Handle to the server side object.
+     * @return Error code.
+     */
+    TInt RosterShow( TInt aCntrlGroupHandle, TInt aWhere, TInt aDisplayHandle );
+    
+    /**
+     * Hides given control group.
+     *
+     * @param aCntrlGroupHandle Handle to the server side object.
+     * @param aDisplayHandle Handle to the server side object.
+     * @return Error code.
+     */
+    TInt RosterHide( TInt aCntrlGroupHandle, TInt aDisplayHandle );
+    
+    TInt RosterShowVisual( TInt aVisualHandle, TInt aDisplayHandle );
+    TInt RosterHideVisual( TInt aVisualHandle,  TInt aDisplayHandle );
+    TInt RosterMoveVisualToFront( TInt aVisualHandle, TInt aDisplayHandle );
+    
+    TInt RosterSetPointerEventObservers( TInt aFlags, TInt aCntrlHandle, TInt aDisplayHandle );
+    TInt RosterAddPointerEventObserver( TAlfPointerEventFlags aObserver, TInt aCntrlHandle, TInt aDisplayHandle );
+    TInt RosterRemovePointerEventObserver( TAlfPointerEventFlags aObserver, TInt aCntrlHandle, TInt aDisplayHandle );
+
+    TInt RosterSetPointerDragTreshold( TInt aCntrlHandle, const TAlfXYMetric& aXYMetric, TInt aDisplayHandle );
+    TInt RosterDisableLongTapEventsWhenDragging( TInt aCntrlHandle, TBool aDisable, TInt aDisplayHandle );
+    
+// Static
+
+// Texture 
+    
+    /**
+     * Updates owner id.
+     * This method must be called before calling other texture related methods.
+     * @return Error code.
+     */
+    TInt TextureUpdateOwnerId();
+    
+    /**
+     * Creates new texture. Leaves on error.
+     *
+     * @param aId ID of the texture.
+     * @param aFlags Texture flags.
+     * @param aFilename the filename of the image
+     * @return Error code.
+     */
+    TInt TextureCreateAnimatedL(TInt aId, TAlfTextureFlags aFlags, TInt aManagerId, const TDesC& aFilename);
+
+    /**
+     * Creates new texture. Leaves on error.
+     *
+     * @param aId ID of the texture.
+     * @param aBitmapHandle Handle to the bitmap.
+     * @param aMaskBitmapHandle Handle to the bitmap mask.
+     * @param aFlags Texture flags.
+     * @param aManagerId Id of texture manager
+     * @return Error code.
+     */
+    TInt TextureCreateL( TInt aId, TInt aBitmapHandle, TInt aMaskBitmapHandle, TAlfTextureFlags aFlags, TInt aManagerId );
+
+    /**
+     * Loads texture. Leaves on error.
+     *
+     * @param aId ID of the texture.
+     * @param aBitmapHandle Handle to the bitmap.
+     * @param aMaskBitmapHandle Handle to the bitmap mask.
+     * @param aFlags Texture flags.
+     * @param aManagerId Id of texture manager
+     * @return Error code.
+     */
+	TInt TextureLoadL( TInt aId, TInt aBitmapHandle, TInt aMaskBitmapHandle, TAlfTextureFlags aFlags, TInt aManagerId  );
+
+    /**
+     * Unloads given texture. 
+     *
+     * @param aId ID of the texture.
+     * @param aManagerId Id of texture manager
+     * @return Error code.
+     */
+	TInt TextureUnload( TInt aId, TInt aManagerId );
+
+    /**
+     * Releases given texture.
+     * @param aId ID of the texture.
+     * @param aManagerId Id of texture manager
+     * @return Error code.
+     */
+	TInt TextureRelease( TInt aId, TInt aManagerId );
+
+    /**
+     * Restores given texture.
+     * @param aId ID of the texture.
+     * @param aManagerId Id of texture manager
+     * @return Error code.
+     */
+	TInt TextureRestore( TInt aId, TInt aManagerId );
+
+    /**
+     * Notifies skin change for given texture.
+     * @param aId ID of the texture.
+     * @param aManagerId Id of texture manager
+     * @return Error code.
+     */
+	TInt TextureNotifySkinChanged( TInt aId, TInt aManagerId );
+
+    /**
+     * Blurs given texture. 
+     *
+     */
+	TInt TextureProcessorBlurL( const TInt aServerSideSrcHandle, 
+	    TInt aServerSideDstHandle, 
+	    TInt aManagerId, 
+	    const TSize& aPreferredSize, 
+	    TInt aFilterSize, 
+	    TInt aFlag );
+
+    /**
+     * Checks if given texture has content. 
+     *
+     */
+	TInt TextureHasContent( TBool& aHasContent, TInt aId, TInt aManagerId );
+
+    /**
+     * Delete given texture. 
+     *
+     * @param aId ID of the texture.
+     * @param aManagerId Id of texture manager
+     * @return Error code.
+     */
+	TInt TextureDelete( TInt aId, TInt aManagerId );
+
+    /**
+     * Starts to animate the texture if the texture
+     * was animated.
+     *
+     * @param aId ID of the texture.
+     */
+    TInt TextureStartAnimation( TInt aId );
+    
+    /**
+     * Stops the texture animation if the texture
+     * was animated.
+     *
+     * @param aId ID of the texture.
+     */
+    TInt TextureStopAnimation( TInt aId );
+
+    /** 
+     * Notifies texture information.
+     * @param aStatus request status.
+     * @param aDest destination buffer which will contain events.
+     */
+    void TextureNotifyInfo( TRequestStatus& aStatus, TDes8& aDest );
+
+    /**
+     * Cancels texture information notification.
+     */
+    void TextureCancelNotifyInfo();
+
+    /**
+     * Sets parameters for the preferred size calculation.
+     * 
+     * @param aId ID of the texture.
+     * @param aManagerId Id of texture manager
+     * @param aParams auto size paramters.
+     */
+    TInt TextureSetAutoSizeParams( TInt aId, TInt aManagerId, const TAlfTextureAutoSizeParams& aParams );
+
+// Misc
+
+    /**
+    * Notify server about this application foreground status
+    */ 
+    void ApplicationIsForeground(TBool aIsPartiallyOrFullyForeground);
+    
+    void RequestPointerEvents(TDes8& aEventAsDescriptor, TRequestStatus& aStatus);
+
+    void CancelPointerEvents();
+    
+    void SetFullScreenDrawing(TBool aEnable);
+    
+    TInt LayoutMetricsTextStyleData(TInt& aFontCategory, TInt aTextStyle);
+    
+    void RequestSystemEvents(TDes8& aEventAsDescriptor, TRequestStatus& aStatus);
+
+    void CancelSystemEvents();
+    
+    void SetWgParent(TInt aParentId);
+    
+    /** 
+     * Generic command
+     */
+	void SendCmd(TUint aCmd, TDes8& aBuf);
+    
+    /** 
+     * Generic synchronous command
+     */
+	TInt SendSyncCmd(TUint aCmd, TDes8& aBuf);
+
+    /** 
+     * Generic asynchronous command
+     */
+	void SendAsyncCmd(TUint aCmd, TDes8& aBuf, TRequestStatus& aStatus);
+     
+     
+    TInt SendNoReply(TUint aOp, const TDesC8& aInputBuf, TInt aSubSessionHandle);
+    
+    TAlfAutoFlushMode AutoFlushMode() const;
+    void SetAutoFlushMode( TAlfAutoFlushMode aAutoFlushMode );
+    TInt FlushBatchBuffer();
+    void SetMaxBatchBufferSize( TInt aBufferSize );
+    TInt GetBatchBufferInfo( TAlfBatchBufferInfoType aBufferInfoType ) const;
+    
+   /** 
+    * Post QT command buffer to server side canvas
+    */
+    TInt PostQtBuffer( TInt aWsWgId, TInt aWsClientId, TDes8& aCommandBuffer, 
+           TAlfCommandBufferStatus aStatus );
+private:
+    TInt AllocateExtendedBuffer( TInt aMoreSpaceNeeded );
+    inline static void AppendPadding( TDes8& aBuffer, TInt aAmount );
+    
+private:
+
+    HBufC8* iDefaultBatchBuffer; // owned
+    HBufC8* iExtendedBatchBuffer; // owned
+    HBufC8* iUsedBatchBuffer; // not owned. points to iDefaultBatchBuffer or iExtendedBatchBuffer
+    
+    class CBatchBufferAutoFlusher;
+    CBatchBufferAutoFlusher* iAutoFlusher;
+    
+    TAlfAutoFlushMode iAutoFlushMode;
+    TInt iUsedMaxBufferSize;
+    };
+
+
+#endif // R_ALFCLIENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/inc/alfcommandscheduler.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Command scheduler.
+*
+*/
+
+
+
+#ifndef C_ALFCOMMANDSCHEDULER_H
+#define C_ALFCOMMANDSCHEDULER_H
+
+#include <e32base.h>
+#include <alf/alfcommand.h>
+#include <hwrmlight.h>
+
+class CAlfEnv;
+
+/**
+ *  Command scheduler.
+ *
+ *  Schedules the commands (see alfcommand.h) which are send to 
+ *  to the environment class with a timeout != 0.
+ *
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfCommandScheduler ) : 
+    public CBase, 
+    public MHWRMLightObserver
+    {
+
+public:
+
+    /**
+     * Constructor
+     */
+    static CAlfCommandScheduler* NewL( CAlfEnv& aEnv );
+
+    /**
+     * Destructor
+     */
+    virtual ~CAlfCommandScheduler();
+
+    /**
+     * Executes given command in given time.
+     *
+     * @param aCommand Command to execute.
+     * @param aTimeInMilliSeconds Time to execution.
+     */
+    void ScheduleCommandL( const TAlfCommand& aCommand, 
+                           TInt aTimeInMilliSeconds );
+    
+    /**
+     * Cancel all commands for given object.
+     *
+     * @param aObject All commands associated to this object are cancelled.
+     */
+    void CancelCommands( TAny* aObject );
+    
+    /**
+     * Cancels all commands for the given object with given operation.
+     *
+     * @param aObject Associated object.
+     * @param aCommandOperation Operation which is cancelled.
+     */
+    void CancelCommands( TAny* aObject, TAlfOp aCommandOperation);
+    
+    /**
+     * Cancels all commands for the given object with given type and paramter.
+     *
+     * @param aObject Associated object.
+     * @param aCommandType Command type.
+     * @param aParam Custom parater (only checked if 
+     *               aCommandType equals EAlfCommandTypeCustomEvent)
+     */
+    void CancelCommands( TAny* aObject, 
+                         TAlfCommandType aCommandType, 
+                         TInt aParam );
+    
+    /**
+     * Calculates the milliseconds until the command.
+     * 
+     * @param aObject Associated object.
+     * @return Time left in milliseconds to the first found command, which 
+     *         matched the criteria. KErrNotFound if the none found. The return
+     *         value is set to 0 if the command timer has expired and waits
+     *         execution from the active scheduler.
+     */ 
+    TInt MilliSecondsUntilCommand( 
+        TAny* aObject );
+                             
+    /**
+     * Calculates the milliseconds until the command.
+     * 
+     * @param aObject Associated object.
+     * @param aCommandOperation Operation which is checked.
+     * @return Time left in milliseconds to the first found command, which 
+     *         matched the criteria. KErrNotFound if the none found. The return
+     *         value is set to 0 if the command timer has expired and waits
+     *         execution from the active scheduler.
+     */ 
+    TInt MilliSecondsUntilCommand( 
+        TAny* aObject, 
+        TAlfOp aCommandOperation );
+      
+    /**
+     * Calculates the milliseconds until the command.
+     * 
+     * @param aObject Associated object.
+     * @param aCommandType Command type.
+     * @param aParam Custom parater (only checked if 
+     *               aCommandType equals EAlfCommandTypeCustomEvent)
+     * @return Time left in milliseconds to the first found command, which 
+     *         matched the criteria. KErrNotFound if the none found. The return
+     *         value is set to 0 if the command timer has expired and waits
+     *         execution from the active scheduler.
+     */   
+    TInt MilliSecondsUntilCommand( 
+        TAny* aObject, 
+        TAlfCommandType aCommandType, 
+        TInt aParam );
+    
+    /**
+     * Executes the command. Called when timer triggers.
+     *
+     * @param aCommand Command to execute.
+     */
+    void ExecuteEventL( TAlfCommand& aCommand );
+    
+    /**
+     * Called when the application foreground status changes.
+     *
+     * @param aForeground ETrue if the application is (partially) on foreground.
+     */
+    void AppicationOnForeground( TBool aForeground );
+    
+    /**
+     * From MHWRMLightObserver
+     *
+     * Called when display light status changes.
+     */
+    void LightStatusChanged(TInt aTarget, CHWRMLight::TLightStatus aStatus);
+ 
+private:
+
+    CAlfCommandScheduler( CAlfEnv& aEnv);
+
+    void ConstructL();
+    
+    void UpdateSchedulerState();
+    void Run();
+    void Pause();
+
+private: // data
+
+    // Timed command class.
+    class CTimedEvent : public CTimer
+        {
+    public:
+        static CTimedEvent* NewLC( 
+            const TAlfCommand& aCommand,
+            CAlfCommandScheduler& aScheduler );
+        ~CTimedEvent();
+        
+        void ExecuteAfter( TInt aIntervalInMilliSeconds, TBool aStartPaused );
+        void Pause();
+        void Continue();
+        TInt TimeLeftInMilliSeconds() const;
+        
+    protected:
+        CTimedEvent( CAlfCommandScheduler& aScheduler );
+        void ConstructL(const TAlfCommand& aCommand);
+        void RunL();
+        TInt RunError(TInt aError);
+    public:
+        TAlfCommand* iCommand;
+    private:
+        CAlfCommandScheduler& iScheduler;
+        TTime iLastStartTime;
+        TInt iTimeLeftInMilliSeconds;
+        };
+      
+    // Timed commands.  
+    RPointerArray<CTimedEvent> iEvents;
+    
+    // Environment.
+    CAlfEnv& iEnv;
+        
+    // Internal flags.
+    TUint iFlags;
+    
+    // Light controller/observer. Own.
+    CHWRMLight* iLight; 
+    };
+
+
+#endif // C_ALFCOMMANDSCHEDULER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/inc/alfcontrolgroupsubsession.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Sub-session for control group
+*
+*/
+
+
+
+#ifndef R_ALFCONTROLGROUPSUBSESSION_H
+#define R_ALFCONTROLGROUPSUBSESSION_H
+
+#include <e32std.h>
+#include "alfclient.h"
+
+/**
+ *  Sub-session for control group
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( RAlfControlGroupSubSession ): public RSubSessionBase 
+    {
+
+public:
+
+    /**
+     * Open subsession for given session.
+     *
+     * @param aSession Used session.
+     * @param aId Control group ID.
+     * @return Error code.
+     */
+    TInt Open( RAlfClient& aSession, TInt aId );
+    
+    /**
+     *  Closes the subsession.
+     */
+    void Close();
+    
+    /**
+     * Appends a control
+     *
+     * @param aControlHandle Handle to the server side object. 
+     * @return Error code.
+     */
+    TInt Append( TInt aControlHandle );
+    
+    /**
+     * Removes a control
+     *
+     * @param aControlHandle Handle to the server side object. 
+     * @return Error code.
+     */
+    TInt Remove( TInt aControlHandle );
+    
+    /**
+     * Enables/disabels transformation
+     *
+     * @param aTransformationHandle Handle to the server side object.                       
+     * @param aIsTransformed ETrue if enabled. 
+     * @return Error code.
+     */
+    TInt EnableTransformation( 
+        TInt aTransformationHandle,
+        TBool aIsTransformed );
+    };
+
+
+#endif // R_ALFCONTROLGROUPSUBSESSION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/inc/alfdisplaysubsession.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Sub-session for display
+*
+*/
+
+
+
+#ifndef R_ALFDISPLAYSUBSESSION_H
+#define R_ALFDISPLAYSUBSESSION_H
+
+#include <e32std.h>
+#include "alfclient.h"
+#include "alf/alfdisplay.h"
+
+/**
+ *  Sub-session for display
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( RAlfDisplaySubSession ): public RSubSessionBase 
+    {
+
+public:
+
+    /**
+     * Open subsession for given session.
+     *
+     * @param aSession Used session.
+     * @param aRect Display area.
+     * @return Error code.
+     */
+    TInt Open( RAlfClient& aSession, const TRect& aRect, TInt aDisplayType, TUid aBufferUid );
+    
+    /**
+     *  Closes the subsession.
+     */
+    void Close();
+    
+    /**
+     * Set background clearing mode. 
+     *
+     * @param aClearBackground Mode. See CAlfDisplay::TClearMode.
+     * @return Error code.
+     */
+    TInt SetClearBackground( TInt aClearBackground );
+    
+    /**
+     * Set visible area. 
+     *
+     * @param aRect Visible area rect.
+     * @return Error code.
+     */
+    TInt SetVisibleArea( const TRect& aRect, TBool aForce = EFalse );
+    
+    /**
+     * Returns visible area. 
+     *
+     * @param aRect Visible area rect is set here (if returns KErrNone).
+     * @return Error code.
+     */
+    TInt VisibleArea( TRect& aRect ) const;
+    
+    /**
+     * Sets whole display as dirty. 
+     *
+     */
+    void SetDirty();
+    
+    /**
+     * Sets redering quality. 
+     *
+     */
+    TInt SetQuality(TAlfQuality aRenderingQuality);
+    
+    /**
+     * Gets redering quality. 
+     *
+     */
+    TInt Quality(TAlfQuality& aRenderingQuality) const;
+
+    /**
+     * Sets depth test. 
+     *
+     */
+    TInt SetUseDepth(TBool aUseDepth);
+    
+    /**
+     * Sets intended usage of display. 
+     *
+     */
+    TInt SetUsage(TUint aUsageHint);
+    
+    /**
+     * Sets display background items. 
+     *
+     */
+    TInt SetBackgroundItemsL(const RArray<TAlfDisplayBackgroundItem>& aItems);    
+
+    /**
+     * Forwards a pointer event to display.
+     *
+     */
+    TInt HandlePointerEventL(const TPointerEvent& aPointerEvent);
+
+    /**
+     * Suppresses automatic fading.
+     * @param aSuppress ETrue to suppress, EFalse to enable back.
+     */
+    TInt SuppressAutomaticFading( TBool aSuppress );
+    
+    /**
+     * Set the client window where the visual or layout will be drawn to.
+     * @param aWindowGroupId Window group id.
+     * @param aClientWindowHandle Client side window handle.
+     * @param aVisualHandle Visual handle.
+     */
+    void SetClientWindowForDrawingL(TInt aWindowGroupId, TInt aClientWindowHandle, TInt aVisualHandle);
+
+    };
+
+
+#endif // R_ALFDISPLAYSUBSESSION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/inc/alfpanic.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Panic header for Alfred
+*
+*/
+
+
+
+#ifndef C_ALFPANIC_H
+#define C_ALFPANIC_H
+
+#include <e32def.h>
+#include "alfpanicreasons.h"
+
+GLREF_C void Panic(TAlfPanic aPanic);
+
+#endif // C_ALFPANIC_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/inc/alfskinnableimage.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Skinned image
+*
+*/
+
+
+
+#ifndef C_ALFSKINNABLEIMAGE_H
+#define C_ALFSKINNABLEIMAGE_H
+
+
+#include <e32base.h>
+#include <alf/alfimage.h>
+#include <alf/alfimageloaderutil.h>
+
+class CAlfEnv;
+
+
+/**
+ *  Internal class that provides texturization for a skinned TAlfImage.
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfSkinnableImage ): public CBase
+	{
+public:
+    
+    /* Constructors and destructors. */
+    
+    /**
+     * Constructor.
+     *
+     * @param aEnv Environment. Ownership not transferred.
+     */
+    CAlfSkinnableImage(CAlfEnv* aEnv);
+    
+    /**
+     * Destructor. 
+     */
+    ~CAlfSkinnableImage();
+    
+    
+    /* Methods. */
+    
+    /**
+     * Sets the image specification and texturizes the image if it does 
+     * not yet have a texture.
+     *
+     * @param aImage The image.
+     */
+    void SetImage(const TAlfImage& aImage);
+    
+    /**
+     * Gets the image specification.
+     *
+     * @return The image.
+     */
+    TAlfImage& Image();
+
+private:
+
+    void CreateTextureL();    
+    void DeleteTexture();
+    CAlfTextureManager& ImageTextureManager(const TAlfImage& aImage);
+    CAlfTextureManager& ImageTextureManager(TUid aManagerUid);
+
+private:
+
+    TAlfImage iImage;
+    CAlfEnv* iEnv;
+    TInt iSkinnedImageTextureId;
+    TUid iSkinnedImageTextureManagerId;
+    CAlfAutoSizeImageLoaderUtil* iSkinnedImageUtil;        
+    // Skin Logical Name
+    const TDesC* iSkinIdName;
+	TInt iId;
+	};
+	
+#endif // C_ALFSKINNABLEIMAGE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/inc/alftransformationsubsession.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Sub-session for transformation
+*
+*/
+
+
+
+#ifndef R_ALFTRANSFORMATIONSUBSESSION_H
+#define R_ALFTRANSFORMATIONSUBSESSION_H
+
+#include <e32std.h>
+#include "alfclient.h"
+#include "alf/alftransformation.h"
+
+/**
+ *  Sub-session for transformation
+ *
+ *  @lib alfclient.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( RAlfTransformationSubSession ): public RSubSessionBase 
+    {
+
+public:
+
+    /**
+     * Open subsession for given session.
+     *
+     * @param aSession Used session.
+     * @return Error code.
+     */
+    TInt Open( RAlfClient& aSession );
+    
+    /**
+     *  Closes the subsession.
+     */
+    void Close();
+
+    /**
+     * Loads transformation identity matrix i.e. reset.
+     */
+    void LoadIdentity();
+    
+    /**
+     * 2D translation.
+     *
+     * @param aX X coordinate.
+     * @param aY Y coordinate.
+     */
+    void Translate( TReal32 aX, TReal32 aY );
+    
+    /**
+     * 2D rotation.
+     *
+     * @param aAngle Rotation angle.
+     */
+    void Rotate( const TAlfTimedValue& aAngle );
+
+    /**
+     * Returns the number of transform steps in the transformation.
+     */
+    TInt Count() const;
+    
+    /**
+     * Returns the number of non-identity transform steps in the transformation.
+     * Non-identity steps will result in the transformation having an effect
+     * on geometry.
+     */
+    TInt NonIdentityCount() const;
+
+    /**
+     * Returns a one of the transformation steps so that it 
+     * can be modified and set with SetStep method.
+     *
+     * @param aIndex  Index of the transformation step.
+     *
+     * @return  Transformation step. 
+     */
+    CAlfTransformation::TTransform Step(TInt aIndex);
+
+    /**
+     * Modifies a one of the transformation steps by replacing
+     * the existing step with a given step.
+     *
+     * @param aIndex  Index of the transformation step to be replaced
+     *
+     * @return  Transformation step. 
+     */
+    void ReplaceStep(TInt aIndex, CAlfTransformation::TTransform aTransformationStep);
+
+    /**
+     * 3D rotation with timed values.
+     */
+    void Rotate(const TAlfTimedValue& aAngle, 
+                         TReal32 aAxisX, TReal32 aAxisY, TReal32 aAxisZ);
+    
+    /**
+     * 2D translation with timed values.
+     */
+    void Translate(const TAlfTimedValue& aX, const TAlfTimedValue& aY);
+
+    /**
+     * 3D scaling with timed values.
+     */
+    void Scale(const TAlfTimedValue& aX, const TAlfTimedValue& aY,
+                        const TAlfTimedValue& aZ);
+    };
+
+
+#endif // R_ALFTRANSFORMATIONSUBSESSION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/sis/Client.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,47 @@
+;
+; 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: 
+;
+
+; ============================================================================
+;  Name        : client.pkg
+;  Part of     : alfclient.dll / Alfred
+;  Description : Package file for project hitchcock
+;  Version     : %version: 1.1.1.1.1 % << Don't touch! Updated by Synergy at check-out.
+;
+;  Copyright © 2006-2007 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.1
+
+; standard SIS file header
+#{"Hitchcock Client Dll"},(0x10282846),1,0,0
+
+;Supports Series 60 v 3.0
+(0x101F7961), 0, 0, 0, {"Series60ProductID"}
+
+;Localized Vendor Name
+%{"Nokia-EN"}
+
+;Unique Vendor name
+:"Nokia"
+
+; Files to copy
+"\epoc32\release\armv5\urel\alfclient.dll"-"!:\sys\bin\alfclient.dll"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfanchorlayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,398 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Anchor layout
+*
+*/
+
+
+
+#include "alf/alfanchorlayout.h"
+#include "alf/alfcontrol.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alf/alfconstants.h"
+#include "alf/alfgencomponent.h"
+#include "alflogger.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+/** Specifies a cardinal point for an anchor corner. These would
+ *  typically be used in pairs to specify the top left and bottom right
+ *  anchor points of a layout. 
+ */
+NONSHARABLE_STRUCT(TCornerAnchor)
+        {
+        /** <code>ETrue</code>, if this corner anchor should be applied. */
+        TBool iActive;
+
+        /** Horizontal origin. */
+        TAlfAnchorOrigin iHorizontalOrigin;
+
+        /** Vertical origin. */
+        TAlfAnchorOrigin iVerticalOrigin;
+
+        /** Horizontal offset type. */
+        TAlfAnchorMetric iHorizontalMetric;
+
+        /** Horizontal offset type. */
+        TAlfAnchorMetric iVerticalMetric;
+
+        /** Offset in coordinates or relative to size (e.g., 1.0 * width). */
+        TAlfTimedPoint iOffset;
+        };
+
+/** Anchor that defines a visual's position and/or size. */
+NONSHARABLE_STRUCT(TAnchor)
+        {
+        /** Child ordinal to which the anchor applies. */
+        TInt iOrdinal;
+
+        /** Anchor for the top left corner (i.e., SetPos(tl)). */
+        TCornerAnchor iTl;
+
+        /** Anchor for the bottom right corner (i.e., SetSize(br - tl)). */
+        TCornerAnchor iBr;
+        };
+
+
+
+// ======== LOCAL FUNCTIONS ========
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// 1st phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfAnchorLayout::CAlfAnchorLayout()
+    : CAlfLayout()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfAnchorLayout::ConstructL(CAlfControl& aOwner)
+    {
+    CAlfLayout::ConstructL(aOwner);
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfAnchorLayout::~CAlfAnchorLayout()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Creates new anchor layout for the control.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfAnchorLayout* CAlfAnchorLayout::AddNewL(
+    CAlfControl& aOwnerControl,
+    CAlfLayout* aParentLayout )
+    {
+    CAlfAnchorLayout* layout = STATIC_CAST(CAlfAnchorLayout*,
+        aOwnerControl.AppendLayoutL(EAlfLayoutTypeAnchor, aParentLayout));
+    return layout;
+    }
+
+// ---------------------------------------------------------------------------
+// Resets anchors.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfAnchorLayout::Reset()
+    {
+    TBuf8<1> outDum;
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfAnchorLayoutReset, KNullDesC8(), outDum );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfAnchorLayout::Reset panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Sets anchor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfAnchorLayout::SetAnchor(
+    TAlfAnchor aAnchor, 
+    TInt aOrdinal,
+    TAlfAnchorOrigin aHorizOrigin,
+    TAlfAnchorOrigin aVertOrigin,
+    TAlfAnchorMetric aHorizMetric,
+    TAlfAnchorMetric aVertMetric,
+    const TAlfTimedPoint& aOffset)
+    {
+    TAlfLayoutSetAnchorParams params;
+    params.iAnchor = aAnchor;
+    params.iOrdinal = aOrdinal;
+    params.iHorizOrigin = aHorizOrigin;
+    params.iVertOrigin = aVertOrigin;
+    params.iHorizMetric = aHorizMetric;
+    params.iVertMetric = aVertMetric;
+    params.iOffset = aOffset;
+    
+    TPckg<TAlfLayoutSetAnchorParams> paramsPckg(params);
+
+    TBuf8<1> dum;
+    TInt err = Comms()->DoSynchronousCmd(EAlfAnchorLayoutSetAnchor, paramsPckg, dum );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfAnchorLayout::SetAnchor return error %d", err )
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Set relative anchor rect
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfAnchorLayout::SetRelativeAnchorRect(TInt aOrdinal,
+                                        TAlfAnchorOrigin aTlHorizOrigin,
+                                        TAlfAnchorOrigin aTlVertOrigin,
+                                        const TAlfRealPoint& aTopLeftOffset,
+                                        TAlfAnchorOrigin aBrHorizOrigin,
+                                        TAlfAnchorOrigin aBrVertOrigin,
+                                        const TAlfRealPoint& aBottomRightOffset)
+    {
+    TAlfLayoutSetRelativeAnchorRectParams params;
+    params.iOrdinal = aOrdinal;
+    params.iTlHorizOrigin = aTlHorizOrigin;
+    params.iTlVertOrigin = aTlVertOrigin;
+    params.iTopLeftOffset = aTopLeftOffset;
+    params.iBrHorizOrigin = aBrHorizOrigin;
+    params.iBrVertOrigin = aBrVertOrigin;
+    params.iBottomRightOffset = aBottomRightOffset;
+    
+    TPckg<TAlfLayoutSetRelativeAnchorRectParams> paramsPckg(params);
+    TBuf8<1> outDum;
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfAnchorLayoutSetRelativeAnchorRect, paramsPckg, outDum );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfAnchorLayout::SetRelativeAnchorRect return error %d", err )
+        }
+    return err;
+    }
+   
+// ---------------------------------------------------------------------------
+// Removes an anchor.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfAnchorLayout::RemoveAnchor(TAlfAnchor aAnchor, TInt aOrdinal)
+    {
+    TInt2 params( aAnchor, aOrdinal );
+    TPckg<TInt2> paramsPckg(params);
+    TBuf8<1> outDum;
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfAnchorLayoutRemoveAnchor, paramsPckg, outDum );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfAnchorLayout::RemoveAnchor panic error %d", err )
+        USER_INVARIANT(); 
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Attach edge
+// ---------------------------------------------------------------------------
+EXPORT_C TInt CAlfAnchorLayout::Attach(
+    TInt aOrdinal,
+    TAlfAnchorType aType, 
+    const TAlfMetric& aOffset,
+    TAlfAnchorAttachmentOrigin aAttachmentOrigin,
+    TInt aAttachmentOrdinal)
+    {
+    TAlfMetric metric(aOffset);
+    
+    TAlfLayoutAttachEdgeParams params = 
+        {
+        aOrdinal,
+        aType, 
+        metric,
+        aAttachmentOrigin,
+        aAttachmentOrdinal
+        };
+
+    TPckg<TAlfLayoutAttachEdgeParams> paramsPckg(params);
+    TBuf8<1> outDum;
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfAnchorLayoutAttachEdge, paramsPckg, outDum );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfAnchorLayout::Attach error %d", err )
+        }
+        
+    return err;
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// Attach corner
+// ---------------------------------------------------------------------------
+EXPORT_C TInt CAlfAnchorLayout::Attach(
+    TInt aOrdinal,
+    TAlfAnchorType aType, 
+    const TAlfXYMetric& aOffset,
+    TAlfAnchorAttachmentOrigin aAttachmentOrigin,
+    TInt aAttachmentOrdinal)
+    {
+    TAlfLayoutAttachCornerParams params = 
+        {
+        aOrdinal,
+        aType, 
+        aOffset,
+        aAttachmentOrigin,
+        aAttachmentOrdinal
+        };
+
+    TPckg<TAlfLayoutAttachCornerParams> paramsPckg(params);
+    TBuf8<1> outDum;
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfAnchorLayoutAttachCorner, paramsPckg, outDum );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfAnchorLayout::Attach error %d", err )
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Attach box
+// ---------------------------------------------------------------------------
+EXPORT_C TInt CAlfAnchorLayout::Attach(
+    TInt aOrdinal,
+    const TAlfBoxMetric& aOffset,
+    TAlfAnchorAttachmentOrigin aAttachmentOrigin,
+    TInt aAttachmentOrdinal)
+    {
+    TAlfLayoutAttachBoxParams params = 
+        {
+        aOrdinal,
+        aOffset,
+        aAttachmentOrigin,
+        aAttachmentOrdinal
+        };
+
+    TPckg<TAlfLayoutAttachBoxParams> paramsPckg(params);
+    TBuf8<1> outDum;
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfAnchorLayoutAttachBox, paramsPckg, outDum );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfAnchorLayout::Attach error %d", err )
+        }
+    return err;        
+    }
+
+
+// ---------------------------------------------------------------------------
+// Detach all anchors
+// ---------------------------------------------------------------------------
+EXPORT_C void CAlfAnchorLayout::Detach(TInt aOrdinal)
+    {
+    TInt param( aOrdinal );
+    TPckg<TInt> paramsPckg(param);
+    TBuf8<1> outDum;
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfAnchorLayoutDetachAll, paramsPckg, outDum );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfAnchorLayout::Detach panic error %d", err )
+        USER_INVARIANT(); 
+        }    
+    }
+    
+// ---------------------------------------------------------------------------
+// Detach anchor
+// ---------------------------------------------------------------------------
+EXPORT_C void CAlfAnchorLayout::Detach(TInt aOrdinal, TAlfAnchorType aType)
+    {
+    TInt2 params( aOrdinal, aType );
+    TPckg<TInt2> paramsPckg(params);
+    TBuf8<1> outDum;
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfAnchorLayoutDetach, paramsPckg, outDum );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfAnchorLayout::Detach panic error %d", err )
+        USER_INVARIANT(); 
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfAnchorLayout::RemoveAndDestroyAllD()
+    {
+    CAlfLayout::RemoveAndDestroyAllD();
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfAnchorLayout::UpdateChildrenLayout(TInt aTransitionTime )
+    {
+    CAlfLayout::UpdateChildrenLayout( aTransitionTime );
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfVisual* CAlfAnchorLayout::FindTag(const TDesC8& aTag)
+    {
+    return CAlfLayout::FindTag( aTag );
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfAnchorLayout::DoRemoveAndDestroyAllD()
+    {
+    CAlfLayout::DoRemoveAndDestroyAllD();
+    }
+    
+// ---------------------------------------------------------------------------
+// Place holder from CAlfLayout
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TAlfXYMetric CAlfAnchorLayout::BaseUnit() const
+    {
+    return CAlfLayout::BaseUnit();
+    }
+    
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfAnchorLayout::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfLayout::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
+    }
+    
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfbatchbuffer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   API to control the command batch buffer
+*
+*/
+
+
+
+#include "alf/alfbatchbuffer.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+
+// ---------------------------------------------------------------------------
+// TBatchBufferData
+//
+// private member data
+// ---------------------------------------------------------------------------
+//
+struct CAlfBatchBuffer::TBatchBufferData
+    {
+    TBatchBufferData() : 
+        iClient(0) {}
+    
+    RAlfClient* iClient;
+    };
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfBatchBuffer::CAlfBatchBuffer()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+void CAlfBatchBuffer::ConstructL( CAlfEnv& aEnv )
+    {
+    iData = new (ELeave) TBatchBufferData;
+    iData->iClient = &aEnv.Client();
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2-phased constructor
+// ---------------------------------------------------------------------------
+//
+CAlfBatchBuffer* CAlfBatchBuffer::NewL( CAlfEnv& aEnv )
+    {
+    CAlfBatchBuffer* self = new( ELeave ) CAlfBatchBuffer;
+    CleanupStack::PushL( self );
+    self->ConstructL(aEnv);
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfBatchBuffer::~CAlfBatchBuffer()
+    {
+    if ( iData )
+        {
+        }
+    delete iData;
+    iData = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Sets the flush mode
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfBatchBuffer::SetAutoFlushMode( TAlfAutoFlushMode aAutoFlushMode )
+    {
+    iData->iClient->SetAutoFlushMode( aAutoFlushMode );
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the flush mode
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C TAlfAutoFlushMode CAlfBatchBuffer::AutoFlushMode() const
+    {
+    return iData->iClient->AutoFlushMode();
+    }
+
+// ---------------------------------------------------------------------------
+// Manual flush
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C TInt CAlfBatchBuffer::FlushBatchBuffer()
+    {
+    return iData->iClient->FlushBatchBuffer();
+    }
+
+// ---------------------------------------------------------------------------
+// Set the max size
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfBatchBuffer::SetMaxBatchBufferSize( TInt aBufferSize )
+    {
+    iData->iClient->SetMaxBatchBufferSize( aBufferSize );
+    }
+
+// ---------------------------------------------------------------------------
+// Get batch buffer info
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C TInt CAlfBatchBuffer::GetBatchBufferInfo( 
+        TAlfBatchBufferInfoType aBufferInfoType ) const
+    {
+    return iData->iClient->GetBatchBufferInfo( aBufferInfoType );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfborderbrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,412 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Border brush
+*
+*/
+
+
+
+#include "alf/alfborderbrush.h"
+#include "alf/alfenv.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfimage.h"
+#include "alf/alftexture.h"
+#include "alflogger.h"
+#include "alfskinnableimage.h"
+#include "alf/alfconstants.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+struct CAlfBorderBrush::TBorderBrushPrivateData
+    {
+    TAlfTimedPoint iThickness;
+    TAlfTimedPoint iEdgeOffset;
+    TAlfTimedPoint iImageOffset;
+    CAlfSkinnableImage* iImage;
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfBorderBrush::CAlfBorderBrush()
+    : CAlfBrush()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfBorderBrush::ConstructL(
+    CAlfEnv& aEnv,
+    const TAlfXYMetric& aThickness,
+    const TAlfXYMetric& aEdgeOffset)
+    {
+    
+    TAlfCreateBorderBrushMetricParams params;
+    params.iThickness = aThickness; 
+    params.iEdgeOffset = aEdgeOffset;
+    TPckgC<TAlfCreateBorderBrushMetricParams> paramsPckg(params);
+    
+    
+    CAlfBrush::ConstructL(
+        aEnv,
+        EAlfBorderBrushCreateMetric,
+        0,
+        paramsPckg
+        );
+                
+    iBorderBrushData = new (ELeave) TBorderBrushPrivateData;
+    iBorderBrushData->iImage = NULL;
+    iBorderBrushData->iImage = new (ELeave) CAlfSkinnableImage(&aEnv);       
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfBorderBrush::ConstructL(
+    CAlfEnv& aEnv,
+    TInt aThicknessWidth, 
+    TInt aThicknessHeight,
+    TInt aEdgeOffsetX, 
+    TInt aEdgeOffsetY )
+    {
+    
+    TAlfCreateBorderBrushParams params;
+    params.iThicknessWidth = aThicknessWidth; 
+    params.iThicknessHeight = aThicknessHeight;
+    params.iEdgeOffsetX = aEdgeOffsetX;
+    params.iEdgeOffsetY = aEdgeOffsetY;
+    TPckgC<TAlfCreateBorderBrushParams> paramsPckg(params);
+    
+    
+    CAlfBrush::ConstructL(
+        aEnv,
+        EAlfBorderBrushCreate,
+        0,
+        paramsPckg
+        );
+                
+    iBorderBrushData = new (ELeave) TBorderBrushPrivateData;
+    iBorderBrushData->iImage = NULL;
+    iBorderBrushData->iImage = new (ELeave) CAlfSkinnableImage(&aEnv);       
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfBorderBrush* CAlfBorderBrush::NewL(
+    CAlfEnv& aEnv,
+    const TAlfXYMetric& aThickness,
+    const TAlfXYMetric& aEdgeOffset)
+    {
+    CAlfBorderBrush* self = CAlfBorderBrush::NewLC(
+        aEnv,
+        aThickness,
+        aEdgeOffset);
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfBorderBrush* CAlfBorderBrush::NewLC(
+    CAlfEnv& aEnv,
+    const TAlfXYMetric& aThickness,
+    const TAlfXYMetric& aEdgeOffset)
+    {
+    CAlfBorderBrush* self = new( ELeave ) CAlfBorderBrush;
+    CleanupStack::PushL( self );
+    self->ConstructL(
+        aEnv,
+        aThickness,
+        aEdgeOffset);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfBorderBrush* CAlfBorderBrush::NewL(
+    CAlfEnv& aEnv,
+    TInt aThicknessWidth, 
+    TInt aThicknessHeight,
+    TInt aEdgeOffsetX, 
+    TInt aEdgeOffsetY )
+    {
+    CAlfBorderBrush* self = CAlfBorderBrush::NewLC(
+        aEnv,
+        aThicknessWidth,
+        aThicknessHeight,
+        aEdgeOffsetX,
+        aEdgeOffsetY );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfBorderBrush* CAlfBorderBrush::NewLC(
+    CAlfEnv& aEnv,
+    TInt aThicknessWidth, 
+    TInt aThicknessHeight,
+    TInt aEdgeOffsetX, 
+    TInt aEdgeOffsetY)
+    {
+    CAlfBorderBrush* self = new( ELeave ) CAlfBorderBrush;
+    CleanupStack::PushL( self );
+    self->ConstructL(
+        aEnv,
+        aThicknessWidth,
+        aThicknessHeight,
+        aEdgeOffsetX,
+        aEdgeOffsetY );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CAlfBorderBrush::~CAlfBorderBrush()
+    {
+    if (iBorderBrushData)
+        {
+        delete iBorderBrushData->iImage;
+        iBorderBrushData->iImage = NULL;    	
+        }
+
+    delete iBorderBrushData;
+    }
+
+// ---------------------------------------------------------------------------
+// Set image
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfBorderBrush::SetImage(const TAlfImage& aImage)
+    {    
+    iBorderBrushData->iImage->SetImage(aImage); // This texturizes skin graphics if needed
+    
+    TAlfImageParams params(iBorderBrushData->iImage->Image());
+    
+    TPckgC<TAlfImageParams> buf(params);
+    TInt err = Comms()->DoCmdNoReply(EAlfBorderBrushSetImage, buf );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfBorderBrush::SetImage ignore error %d", err )
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Get image
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C const TAlfImage& CAlfBorderBrush::Image() const
+    {
+    return iBorderBrushData->iImage->Image();   
+    }
+
+// ---------------------------------------------------------------------------
+// Set color
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfBorderBrush::SetColor(const TRgb& aColor)
+    {
+    // Just send to server
+    TPckgC<TRgb> inBuf(aColor);
+    TInt err = Comms()->DoCmdNoReply( EAlfBorderBrushSetColor, inBuf );
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfBorderBrush::SetColor ignore error %d", err )
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Thickness
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TAlfTimedPoint& CAlfBorderBrush::Thickness() const
+    {
+    TPckg<TAlfTimedPoint> buf(iBorderBrushData->iThickness);
+    TInt err = Comms()->DoSynchronousCmd( EAlfBorderBrushGetThickness, buf, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfBorderBrush::Thickness panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return iBorderBrushData->iThickness;
+    }
+  
+// ---------------------------------------------------------------------------
+// Sets thickness
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfBorderBrush::SetThickness(const TAlfTimedPoint& aThickness)
+    {
+    TPckgC<TAlfTimedPoint> buf(aThickness);
+    TInt err = Comms()->DoCmdNoReply( EAlfBorderBrushSetThickness, buf);
+
+    if ( err == KErrNone )
+        {
+        iBorderBrushData->iThickness = aThickness;
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfBorderBrush::SetThickness panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+   
+// ---------------------------------------------------------------------------
+// Edge offset
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C const TAlfTimedPoint& CAlfBorderBrush::EdgeOffset() const
+    {
+    TPckg<TAlfTimedPoint> buf(iBorderBrushData->iEdgeOffset);
+    TInt err = Comms()->DoSynchronousCmd( EAlfBorderBrushGetEdgeOffset, buf, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfBorderBrush::EdgeOffset panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return iBorderBrushData->iEdgeOffset;
+    }
+    
+// ---------------------------------------------------------------------------
+// Set edge offset
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfBorderBrush::SetEdgeOffset(const TAlfTimedPoint& aEdgeOffset)
+    {
+    TPckgC<TAlfTimedPoint> buf(aEdgeOffset);
+    TInt err = Comms()->DoCmdNoReply( EAlfBorderBrushSetEdgeOffset, buf );
+
+    if ( err == KErrNone )
+        {
+        iBorderBrushData->iEdgeOffset = aEdgeOffset;
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfBorderBrush::SetEdgeOffset panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Image offset
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C const TAlfTimedPoint& CAlfBorderBrush::ImageOffset() const
+    {
+    TPckg<TAlfTimedPoint> buf(iBorderBrushData->iImageOffset);
+    TInt err = Comms()->DoSynchronousCmd( EAlfBorderBrushGetImageOffset, buf, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfBorderBrush::ImageOffset panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return iBorderBrushData->iImageOffset;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets image offset
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfBorderBrush::SetImageOffset(const TAlfTimedPoint& aImageOffset)
+    {
+    TPckgC<TAlfTimedPoint> buf(aImageOffset);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfBorderBrushSetImageOffset, buf );
+
+    if ( err == KErrNone )
+        {
+        iBorderBrushData->iImageOffset = aImageOffset;
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfBorderBrush::SetImageOffset panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Sets image offset
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfBorderBrush::SetImageOffset(const TAlfXYMetric& aImageOffset)
+    {
+    TPckgC<TAlfXYMetric> buf(aImageOffset);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfBorderBrushSetImageOffsetMetric, buf );
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfBorderBrush::SetImageOffset panic error %d", err )
+        USER_INVARIANT();
+        }        
+    }
+// ---------------------------------------------------------------------------
+// Sets edge offset
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfBorderBrush::SetEdgeOffset(const TAlfXYMetric& aEdgeOffset)
+    {
+    TPckgC<TAlfXYMetric> buf(aEdgeOffset);
+    TInt err = Comms()->DoCmdNoReply( EAlfBorderBrushSetEdgeOffsetMetric, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfBorderBrush::SetEdgeOffset panic error %d", err )
+        USER_INVARIANT();
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// Sets thickness
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfBorderBrush::SetThickness(const TAlfXYMetric& aThickness)
+    {
+    TPckgC<TAlfXYMetric> buf(aThickness);
+    TInt err = Comms()->DoCmdNoReply( EAlfBorderBrushSetThicknessMetric, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfBorderBrush::SetThickness panic error %d", err )
+        USER_INVARIANT();
+        }        
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfbrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,266 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 class for brushes
+*
+*/
+
+
+
+#include "alf/alfbrush.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfconstants.h"
+#include "alf/alfbrusharray.h"
+#include "alflogger.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+// Private data structure
+struct CAlfBrush::TPrivateData
+    {
+    CAlfGenComponent* iComms;   // owned 
+    TAlfTimedValue iOpacity;
+    TBool iClipToVisual;
+    
+    // Array keeps track of all the brush arrays in which this brush instance
+    // has been added on. Duplicates are allowed.
+    RPointerArray<CAlfBrushArray> iContainingBrushArrays;
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfBrush::CAlfBrush()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfBrush::ConstructL( 
+        CAlfEnv& aEnv,
+        TInt aImplementationId, 
+        TInt aImplementationUid, 
+        const TDesC8& aConstructionParams )
+    {
+    ConstructL();
+   
+    if (!iData->iComms)
+        {
+        iData->iComms = CAlfGenComponent::NewL(
+            aEnv,
+            aImplementationId, 
+            aImplementationUid, 
+            aConstructionParams);         
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfBrush::ConstructL()
+    {
+    iData = new (ELeave) TPrivateData;
+    
+    iData->iComms = NULL;
+    iData->iClipToVisual = EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfBrush::~CAlfBrush()
+    {
+    if ( iData )
+        {
+        const TInt containingBrushArrayCount = iData->iContainingBrushArrays.Count();
+        if ( containingBrushArrayCount )
+            {
+            __ALFLOGSTRING1( "CAlfBrush::~CAlfBrush Warning: deleted brush still in %d arrays", containingBrushArrayCount )
+            }
+        
+        // Remove from containing arrays
+        for ( TInt i = containingBrushArrayCount-1 ; i>=0 ; i-- )
+            {
+            iData->iContainingBrushArrays[i]->HandleBrushDestroyed(*this);
+            }
+        
+        iData->iContainingBrushArrays.Close();
+        
+        delete iData->iComms;
+        }
+    delete iData;
+    iData = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C const TAlfTimedValue& CAlfBrush::Opacity() const
+    {
+    TPckg<TAlfTimedValue> buf(iData->iOpacity);
+    TInt err = iData->iComms->DoSynchronousCmd( EAlfBrushGetOpacity, buf, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfBrush::Opacity panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return iData->iOpacity;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfBrush::SetOpacity( const TAlfTimedValue& aOpacity )
+    {
+    TPckgC<TAlfTimedValue> buf(aOpacity);
+
+    TInt err = iData->iComms->DoCmdNoReply( EAlfBrushSetOpacity, buf );
+
+    if ( err == KErrNone )
+        {
+        iData->iOpacity = aOpacity;
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfBrush::SetOpacity panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// Returns server handle. 0 if not set.
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TInt CAlfBrush::Identifier() const
+    {
+    return iData->iComms->Identifier();
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C void CAlfBrush::SetLayer(TAlfBrushLayer aLayer)
+    {
+    TPckgC<TAlfBrushLayer> buf(aLayer);
+
+    TInt err = iData->iComms->DoCmdNoReply( EAlfBrushSetLayer, buf );
+
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfBrush::SetLayer panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C CAlfGenComponent* CAlfBrush::Comms() const
+    {
+    ASSERT(iData);
+    return iData->iComms;
+    }
+
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfBrush::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfPropertyOwner::PropertyOwnerExtension(aExtensionUid, aExtensionParams);
+    }
+
+
+// ---------------------------------------------------------------------------
+// Append a brush array which holds this brush
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfBrush::AppendContainingArray( CAlfBrushArray& aContainingArray )
+    {
+    __ASSERT_ALWAYS( iData , USER_INVARIANT() );
+    
+    // allow duplicates, because a brush can be in the same array many times.
+    return iData->iContainingBrushArrays.Append( &aContainingArray );
+    }
+
+// ---------------------------------------------------------------------------
+// Removes a brush array which holds this brush
+// ---------------------------------------------------------------------------
+// 
+void CAlfBrush::RemoveContainingArray( CAlfBrushArray& aContainingArray )
+    {
+    __ASSERT_ALWAYS( iData , USER_INVARIANT() );
+    
+    for ( TInt i = iData->iContainingBrushArrays.Count()-1 ; i>=0 ; i-- )
+        {
+        if ( iData->iContainingBrushArrays[i] == &aContainingArray )
+            {
+            // remove one instance only once becuase it might be on the same array
+            // several times
+            iData->iContainingBrushArrays.Remove(i);
+            iData->iContainingBrushArrays.Compress();
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfBrush::SetClipToVisual(TBool aClipToVisual)
+    {
+    TPckgC<TBool> buf(aClipToVisual);
+
+    TInt err = iData->iComms->DoCmdNoReply( EAlfBrushSetClipToVisual, buf );
+
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfBrush::SetClipToVisual panic error %d", err )
+        USER_INVARIANT();
+        }        
+    }
+    
+// ---------------------------------------------------------------------------
+//  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TBool CAlfBrush::ClipToVisual() const
+    {
+    TPckg<TBool> buf(iData->iClipToVisual);
+    TInt err = iData->iComms->DoSynchronousCmd( EAlfBrushClipToVisual, buf, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfBrush::ClipToVisual panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return iData->iClipToVisual;
+        
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfbrusharray.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,396 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Array for brushes
+*
+*/
+
+
+
+#include "alf/alfbrusharray.h"
+#include "alf/alfvisual.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alf/alfbrush.h"
+#include "alflogger.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfconstants.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+/**
+ * This watcher is a helper class to detect misusages of the brush arrays.
+ *
+ * A classic example is that the user creates a brush which is deleted before
+ * it is removed from all the arrays where it is added. 
+ *
+ * This idle-loop is started when the system notices when a brush is deleted which
+ * is still in this array. This is only acceptable if the owning visual is deleted
+ * in the same scheduler loop. See the CAlfBrushArrayUsageWatcher::RunL
+ * for the result if the array is not deleted right away.
+ */ 
+NONSHARABLE_CLASS(CAlfBrushArrayUsageWatcher) : public CActive
+    {
+public:
+    CAlfBrushArrayUsageWatcher();
+    ~CAlfBrushArrayUsageWatcher();
+protected:
+    void RunL();
+    void DoCancel(){};
+    };
+
+// Constructor, which initiates the idle-loop
+CAlfBrushArrayUsageWatcher::CAlfBrushArrayUsageWatcher() : CActive( EPriorityIdle )
+    {
+    CActiveScheduler::Add( this );
+    
+    SetActive();
+    iStatus = KRequestPending;
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone );
+    }
+
+// destructor which cancels the loop    
+CAlfBrushArrayUsageWatcher::~CAlfBrushArrayUsageWatcher()
+    {
+    Cancel();
+    }
+
+// RunL is called when the idle-loop is executed.
+void CAlfBrushArrayUsageWatcher::RunL()
+    {
+    // In normal usage, this code snippet should never ne run.
+    // This is called, when a user deletes a brush (directly or through a brush array)
+    // which is still left in this brush array. 
+    
+    __ALFLOGSTRING( "CAlfBrushArrayUsageWatcher::RunL Incorrect brush deletion!" )
+#ifdef _DEBUG
+    USER_INVARIANT();
+#endif
+    User::Leave( KErrGeneral ); 
+    }
+
+
+// Private data structure.
+struct CAlfBrushArray::TPrivateData
+    {
+    CAlfVisual* iOwner;
+    RPointerArray<CAlfBrush> iBrushes;
+    RPointerArray<CAlfBrush> iOwnedBrushes;
+    CAlfBrushArrayUsageWatcher* iWatcher;
+    };
+    
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------------------------
+//
+CAlfBrushArray::CAlfBrushArray()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+void CAlfBrushArray::ConstructL(CAlfVisual& aOwner)
+    {
+    iData = new (ELeave) TPrivateData;
+    
+    iData->iOwner = &aOwner;
+    iData->iOwnedBrushes.Reset();
+    iData->iBrushes.Reset();
+    iData->iWatcher = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Two-phased constructor.
+// ---------------------------------------------------------------------------
+//
+CAlfBrushArray* CAlfBrushArray::NewL(CAlfVisual& aOwner)
+    {
+    CAlfBrushArray* self = new( ELeave ) CAlfBrushArray;
+    CleanupStack::PushL( self );
+    self->ConstructL(aOwner);
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CAlfBrushArray::~CAlfBrushArray()
+    {
+    if ( iData )
+        {
+        Reset();
+        }
+    delete iData;
+    iData = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Resets the array.
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfBrushArray::Reset()
+    {
+    for ( TInt i = iData->iBrushes.Count()-1 ; i>= 0; i-- )
+        {
+        iData->iBrushes[i]->RemoveContainingArray( *this );
+        }
+
+    iData->iOwnedBrushes.ResetAndDestroy();
+    iData->iBrushes.Reset();
+    
+    delete iData->iWatcher;
+    iData->iWatcher= NULL;
+    
+    // Update the server side.
+    TBuf8<1> dummy;   
+    TInt err = iData->iOwner->Comms()->DoSynchronousCmd(EAlfVisualBrushArrayReset, KNullDesC8(), dummy); 
+
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfBrushArray::Reset panic error %d", err )
+        USER_INVARIANT();
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+// Add brush onto the array.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfBrushArray::AppendL(CAlfBrush* aBrush, TAlfOwnership aOwnership)
+    {
+    // Add to iBrushes array.
+    TInt err = iData->iBrushes.Append( aBrush );
+    if ( err != KErrNone )
+        {
+        // on failure, log'n'leave
+        __ALFLOGSTRING1( "CAlfBrushArray::AppendL leave error %d", err )
+        User::Leave( err );
+        }
+        
+    err = aBrush->AppendContainingArray( *this );
+    if ( err != KErrNone )
+        {
+        // on failure remove from iBrushes, log'n'leave
+        iData->iBrushes.Remove( iData->iBrushes.Count() - 1 );
+        iData->iBrushes.Compress();
+        __ALFLOGSTRING1( "CAlfBrushArray::AppendL leave error %d", err )
+        User::Leave( err );
+        }
+
+    // Update the server side.
+    TInt2 int2(aBrush->Identifier(), aOwnership); 
+    TPckgC<TInt2> buf(int2);
+    TBuf8<1> dum;
+
+    err = iData->iOwner->Comms()->DoSynchronousCmd(EAlfVisualBrushArrayAppend, buf, dum ); 
+    if ( err != KErrNone )
+        {
+        // On error, remove it from the iBrushes and log'n'leave
+        RemoveBrush(aBrush, iData->iBrushes.Count() - 1);        
+        
+        __ALFLOGSTRING1( "CAlfBrushArray::AppendL leave error %d", err )
+        User::Leave(err);
+        }
+    // append ownership only on success (otherwise double deletion takes place on leave)
+    if ( aOwnership == EAlfHasOwnership )
+        {
+        err = iData->iOwnedBrushes.Append( aBrush );
+        if ( err != KErrNone )
+            {
+            // on failure remove brush (inform server as well) and log'n'leave
+            Remove( iData->iBrushes.Count() - 1);
+            __ALFLOGSTRING1( "CAlfBrushArray::AppendL leave error %d", err )
+            User::Leave( err );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Insert
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfBrushArray::InsertL(TInt aPos, CAlfBrush* aBrush, TAlfOwnership aOwnership)
+    {
+    // Add to iBrushes array.
+    TInt err = iData->iBrushes.Insert( aBrush, aPos );
+    if ( err != KErrNone )
+        {
+        // on failure, log'n'leave
+        __ALFLOGSTRING1( "CAlfBrushArray::InsertL leave error %d", err )
+        User::Leave( err );
+        }
+        
+    err = aBrush->AppendContainingArray( *this );
+    if ( err != KErrNone )
+        {
+        // on failure remove from iBrushes, log'n'leave
+        iData->iBrushes.Remove( aPos );
+        iData->iBrushes.Compress();
+        __ALFLOGSTRING1( "CAlfBrushArray::InsertL leave error %d", err )
+        User::Leave( err );
+        }
+        
+    // Update the server side.
+    TInt3 int3(aBrush->Identifier(), aOwnership, aPos); 
+    TPckgC<TInt3> buf(int3);
+    TBuf8<1> dum;
+
+    err = iData->iOwner->Comms()->DoSynchronousCmd(EAlfVisualBrushArrayInsert, buf, dum ); 
+    if ( err != KErrNone )
+        {
+        // On error, remove it from the iBrushes and log'n'leave 
+        RemoveBrush(aBrush, aPos);
+        
+        __ALFLOGSTRING1( "CAlfBrushArray::InsertL leave error %d", err )
+        User::Leave(err);
+        }
+    
+    // append ownership only on success (otherwise double deletion takes place on leave)    
+    if ( aOwnership == EAlfHasOwnership )
+        {
+        err = iData->iOwnedBrushes.Append( aBrush );
+        if ( err != KErrNone )
+            {
+            // on failure remove brush (inform server as well) and log'n'leave
+            Remove( aPos );
+            __ALFLOGSTRING1( "CAlfBrushArray::InsertL leave error %d", err )
+            User::Leave( err );
+            }
+        }
+    }
+  
+// ---------------------------------------------------------------------------
+// Remove
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfBrushArray::Remove(TInt aPos)
+    {
+    // Update the server side.
+    TPckgC<TInt> buf(aPos);
+    TBuf8<1> dum;
+
+    TInt err = iData->iOwner->Comms()->DoSynchronousCmd(EAlfVisualBrushArrayRemove, buf, dum ); 
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfBrushArray::Remove panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    RemoveBrush(iData->iBrushes[aPos], aPos);
+    }
+  
+// ---------------------------------------------------------------------------
+// Brush count
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TInt CAlfBrushArray::Count() const
+    {
+    if ( iData )
+        {
+        return iData->iBrushes.Count();
+        }
+    return 0;
+    }
+  
+// ---------------------------------------------------------------------------
+// []
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C CAlfBrush& CAlfBrushArray::operator [] (TInt aPos)
+    {
+    return At(aPos);
+    }
+
+// ---------------------------------------------------------------------------
+// At
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfBrush& CAlfBrushArray::At(TInt aPos)
+    {
+    return *iData->iBrushes[aPos];
+    }
+
+
+// ---------------------------------------------------------------------------
+// Remove brush and owned brushes if they exist
+// ---------------------------------------------------------------------------
+//  
+void CAlfBrushArray::RemoveBrush(CAlfBrush* aBrush, TInt aPosIndex)
+    {
+    aBrush->RemoveContainingArray( *this );
+            
+    const TInt ownedIndex = iData->iOwnedBrushes.Find( aBrush );
+    if ( ownedIndex != KErrNotFound )
+        {
+        iData->iOwnedBrushes.Remove( ownedIndex );
+        iData->iOwnedBrushes.Compress();
+        delete aBrush;
+        }
+    
+    if ( aPosIndex != KErrNotFound )
+        {
+        iData->iBrushes.Remove( aPosIndex );
+        iData->iBrushes.Compress();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Brush is been deleted. Remove it from the array (if exists - might be several times).
+// ---------------------------------------------------------------------------
+// 
+void CAlfBrushArray::HandleBrushDestroyed( CAlfBrush& aBrush )
+    {
+    for ( TInt index = Count()-1 ; index>=0 ; index-- )
+        {
+        if ( &At(index) == &aBrush )
+            {
+            // Update the server side.
+            TPckgC<TInt> buf(index);
+            TBuf8<1> dum;
+            TInt err = iData->iOwner->Comms()->DoSynchronousCmd(EAlfVisualBrushArrayRemove, buf, dum ); 
+            if ( err )
+                {
+                __ALFLOGSTRING1( "CAlfBrushArray::HandleBrushDestroyed panic error %d", err )
+                USER_INVARIANT();
+                }
+            
+            // Check the owned brushes - should never found!
+            const TInt ownedIndex = iData->iOwnedBrushes.Find( &aBrush );
+            __ASSERT_ALWAYS( ownedIndex == KErrNotFound, USER_INVARIANT() );
+            
+            // Remove from iBrushes array
+            iData->iBrushes.Remove( index );
+            iData->iBrushes.Compress();
+            
+            // create watcher
+            if ( !iData->iWatcher )
+                {
+                // do not mind the OOM
+                iData->iWatcher = new CAlfBrushArrayUsageWatcher;
+                }
+            }
+        }
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfcanvasvisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,366 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Canvas visual
+*
+*/
+
+
+
+#include "alf/alfcanvasvisual.h"
+#include "alf/alfcontrol.h"
+#include "alflogger.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfconstants.h"
+#include "alf/alfenv.h"
+#include "alf/alfgc.h"
+#include "alflogger.h"
+
+
+
+// ======== MEMBER FUNCTIONS ========
+
+struct CAlfCanvasVisual::TCanvasVisualPrivateData
+    {
+    TCanvasVisualPrivateData() : iObserver(NULL) {}
+    MAlfCanvasObserver* iObserver;
+    CAlfGc* iGc;
+    };
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+
+EXPORT_C CAlfCanvasVisual* CAlfCanvasVisual::AddNewL(
+    CAlfControl& aOwnerControl,
+    CAlfLayout* aParentLayout )
+    {
+    CAlfCanvasVisual* canvas = STATIC_CAST(CAlfCanvasVisual*,
+        aOwnerControl.AppendVisualL(EAlfVisualTypeCanvas, aParentLayout));
+    return canvas;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C CAlfCanvasVisual::CAlfCanvasVisual()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::ConstructL(CAlfControl& aOwner)
+    {
+    CAlfVisual::ConstructL(aOwner);
+    
+    iCanvasVisualData = new (ELeave) TCanvasVisualPrivateData;
+    iCanvasVisualData->iGc = CAlfGc::NewL();
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C CAlfCanvasVisual::~CAlfCanvasVisual()
+    {
+    if ( iCanvasVisualData )
+        {
+        delete iCanvasVisualData->iGc;
+        }
+        
+    delete iCanvasVisualData;
+    iCanvasVisualData = NULL;    
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::SetCanvasObserver( MAlfCanvasObserver* aObserver )
+    {
+    iCanvasVisualData->iObserver = aObserver;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+void CAlfCanvasVisual::SendBuffer( const TPtrC8& aBuffer )
+    {
+    TBuf8<1> dum;
+    TInt err = Comms()->DoSynchronousCmd(EAlfCanvasVisualSendbuffer, aBuffer, dum);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::BeginDraw()
+    {
+    TRAP_IGNORE(iCanvasVisualData->iGc->ActivateL());    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::EndDraw()
+    {
+    HBufC8* commandBuffer = iCanvasVisualData->iGc->CommandBuffer();        
+    __ALFLOGSTRING1( "CAlfCanvasVisual::Refresh buffer length: %d", commandBuffer->Length() )        
+    if (commandBuffer)
+        {
+        SendBuffer( commandBuffer->Des() );            
+        }
+    
+    iCanvasVisualData->iGc->Deactivate();        
+    }
+    
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::RemoveAndDestroyAllD()
+    {
+    CAlfVisual::RemoveAndDestroyAllD();
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfCanvasVisual::UpdateChildrenLayout(TInt aTransitionTime )
+    {
+    CAlfVisual::UpdateChildrenLayout( aTransitionTime );
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfVisual* CAlfCanvasVisual::FindTag(const TDesC8& aTag)
+    {
+    return CAlfVisual::FindTag( aTag );
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfCanvasVisual::DoRemoveAndDestroyAllD()
+    {
+    CAlfVisual::DoRemoveAndDestroyAllD();
+    }
+    
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfCanvasVisual::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfVisual::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::DrawImage(const CAlfTexture& aTexture, const TAlfRealRect& aDestinationRect)
+    {
+    iCanvasVisualData->iGc->DrawImage(aTexture, aDestinationRect);    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::DrawText(const TDesC& aText, const TAlfRealRect& aDestinationRect)
+    {
+    iCanvasVisualData->iGc->DrawText(aText, aDestinationRect);    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::DrawLines(const TAlfRealLine* aLines, TInt aLineCount)
+	{
+	RArray<TReal32> linesPointCords;
+	for(TInt i = 0; i< aLineCount; i++)
+		{
+		linesPointCords.Append(aLines[i].iStart.iX);
+		linesPointCords.Append(aLines[i].iStart.iY);
+		linesPointCords.Append(aLines[i].iEnd.iX);
+		linesPointCords.Append(aLines[i].iEnd.iY);
+		}
+	iCanvasVisualData->iGc->DrawLines(linesPointCords);    
+	linesPointCords.Close();  
+	}
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::DrawEllipse(const TAlfRealRect& aDestinationRect)
+	{
+	iCanvasVisualData->iGc->DrawEllipse(aDestinationRect);
+	}
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::DrawPoints(const TAlfRealPoint* aPoints, TInt aPointCount)
+	{
+	RArray<TReal32> pointCords;
+	for(TInt i = 0; i< aPointCount; i++)
+		{
+		pointCords.Append(aPoints[i].iX);
+		pointCords.Append(aPoints[i].iY);
+		}
+	iCanvasVisualData->iGc->DrawPoints(pointCords);
+	pointCords.Close();  
+	}
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::DrawPolygon(const TAlfRealPoint* aPoints, TInt aPointCount)
+	{
+	RArray<TReal32> pointCords;
+	for(TInt i = 0; i< aPointCount; i++)
+		{
+		pointCords.Append(aPoints[i].iX);
+		pointCords.Append(aPoints[i].iY);
+		}
+	iCanvasVisualData->iGc->DrawPolygon(pointCords);
+    pointCords.Close();
+	}
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::DrawRects(const TAlfRealRect* aRects, TInt aRectCount)
+	{
+	RArray<TReal32> rectPointCords;
+	for(TInt i = 0; i< aRectCount; i++)
+		{
+		rectPointCords.Append(aRects[i].iTl.iX);
+		rectPointCords.Append(aRects[i].iTl.iY);
+		rectPointCords.Append(aRects[i].iBr.iX);
+		rectPointCords.Append(aRects[i].iBr.iY);
+		}
+	iCanvasVisualData->iGc->DrawRects(rectPointCords);
+	rectPointCords.Close();
+	}
+
+    
+// Setters
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::SetTextStyle(const CAlfTextStyle& aTextStyle)
+    {
+    iCanvasVisualData->iGc->SetTextStyle(aTextStyle);            
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::SetPenColor(const TRgb& aColor)
+	{
+    iCanvasVisualData->iGc->SetPenColor(aColor);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::SetPenWidth(const TReal32& aWidth)
+	{
+    iCanvasVisualData->iGc->SetPenWidth(aWidth);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::SetPenOpacity(const TReal32& aOpacity)
+	{
+    iCanvasVisualData->iGc->SetOpacity(aOpacity);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::SetPolygonDrawMode(TAlfPolygonDrawMode aPolygonDrawMode)
+	{
+    iCanvasVisualData->iGc->SetPolygonDrawMode(aPolygonDrawMode);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::SetTextAlign(TAlfAlignHorizontal aAlignHorizontal, TAlfAlignVertical aAlignVertical)
+	{
+    iCanvasVisualData->iGc->SetTextAlign(aAlignHorizontal, aAlignVertical);
+    }
+
+
+// Transformations
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::LoadIdentity()
+	{
+    iCanvasVisualData->iGc->LoadIdentity();
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::Translate(const TReal32& aX, const TReal32& aY, const TReal32& aZ)
+	{
+    iCanvasVisualData->iGc->Translate(aX, aY, aZ);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::Scale(const TReal32& aX, const TReal32& aY, const TReal32& aZ)
+	{
+    iCanvasVisualData->iGc->Scale(aX, aY, aZ);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCanvasVisual::Rotate(const TReal32& aAngle, const TReal32& aX, const TReal32& aY, const TReal32& aZ)
+	{
+    iCanvasVisualData->iGc->Rotate(aAngle, aX, aY, aZ);
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfclient.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1118 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Server client for alfredserver.exe
+*
+*/
+
+
+
+#include "alfclient.h"
+#include "alf/alfconstants.h"
+#include "alfuids.h"
+#include "alflogger.h"
+#include "alfclientserver.h"
+#include "alf/alftexture.h"
+#include "alf/alfcontrol.h"
+#include <e32math.h>
+
+#include "uiacceltk/HuiUtil.h"
+
+const TInt KAlfClientDefaultBatchBufferSize = 
+    KAlfClientServerDefaultCommandBatchBufferSize;
+
+// ======== HELPER CLASSES ========
+
+// ---------------------------------------------------------------------------
+// CBatchBufferAutoFlusher
+//
+// This class is responsible of flushing the client side command buffer
+// when it gets time - hopefully as fast as possible after synchronous 
+// commands.
+// ---------------------------------------------------------------------------
+//
+NONSHARABLE_CLASS( RAlfClient::CBatchBufferAutoFlusher ) : public CActive
+    {
+public:
+    CBatchBufferAutoFlusher( RAlfClient& aClient );
+    ~CBatchBufferAutoFlusher();
+    
+    void StartAutoFlush();
+protected:
+    void RunL();
+    void DoCancel();
+private:
+    RAlfClient& iClient;
+    };
+
+RAlfClient::CBatchBufferAutoFlusher::CBatchBufferAutoFlusher( RAlfClient& aClient )
+ : CActive( EPriorityHigh+5), // Priority must be bigger than any received events from the server
+    iClient( aClient ) 
+    {
+    CActiveScheduler::Add( this );
+    }
+     
+RAlfClient::CBatchBufferAutoFlusher::~CBatchBufferAutoFlusher()
+    {
+    Cancel();
+    }
+    
+void RAlfClient::CBatchBufferAutoFlusher::StartAutoFlush()
+    {
+    if ( !IsActive() )
+        {
+        iStatus = KRequestPending;
+        SetActive();
+        
+        TRequestStatus* status = &iStatus;
+        User::RequestComplete( status, KErrNone );
+        }
+    }
+    
+void RAlfClient::CBatchBufferAutoFlusher::RunL()
+    {
+    iClient.FlushBatchBuffer();
+    }
+    
+void RAlfClient::CBatchBufferAutoFlusher::DoCancel()
+    {
+    }
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+RAlfClient::RAlfClient()
+    : RAlfClientBase(KAlfServiceUid.iUid), 
+        iDefaultBatchBuffer(0), 
+        iExtendedBatchBuffer(0),
+        iUsedBatchBuffer(0),
+        iAutoFlusher(0),
+        iAutoFlushMode( EAlfAutoFlushDeferred ),
+        iUsedMaxBufferSize( KAlfBatchBufferSizeNoLimit )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// "destructor"
+// ---------------------------------------------------------------------------
+//    
+void RAlfClient::Disconnect()
+    {
+    if ( Handle() )
+        {
+        FlushBatchBuffer();
+        }
+   
+    delete iExtendedBatchBuffer;
+    iExtendedBatchBuffer = NULL;   
+        
+    delete iDefaultBatchBuffer;
+    iDefaultBatchBuffer = NULL;
+
+    iUsedBatchBuffer = NULL;
+    
+    delete iAutoFlusher;
+    iAutoFlusher = NULL;
+    
+    Close();
+    }
+ 
+// ---------------------------------------------------------------------------
+// Sets refresh mode
+// ---------------------------------------------------------------------------
+//   
+void RAlfClient::EnvSetRefreshMode( TAlfRefreshMode aMode )
+    {
+    Send(EAlfEnvSetRefreshMode, TIpcArgs(aMode) );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets frame rate
+// ---------------------------------------------------------------------------
+//
+void RAlfClient::EnvSetMaxFrameRate( TReal32 aFrameRate )
+    {
+    TPckg<TReal32> frameRatePckg( aFrameRate );
+    SendReceive(EAlfEnvSetMaxFrameRate, TIpcArgs(&frameRatePckg) );
+    }
+
+// ---------------------------------------------------------------------------
+// Shows control group in roster.
+// ---------------------------------------------------------------------------
+// 
+TInt RAlfClient::RosterShow( 
+    TInt aCntrlGroupHandle, 
+    TInt aWhere, 
+    TInt aDisplayHandle )
+    {
+    // Need to flush.
+    FlushBatchBuffer();
+    
+    TInt err = SendReceive(
+        EAlfRosterShow, 
+        TIpcArgs(aCntrlGroupHandle, aWhere, aDisplayHandle) );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::RosterShow return error %d", err )
+        }
+    return err;
+    }
+ 
+// ---------------------------------------------------------------------------
+// Hides the control group from the roster.
+// ---------------------------------------------------------------------------
+//   
+TInt RAlfClient::RosterHide( TInt aCntrlGroupHandle, TInt aDisplayHandle )
+    {
+    TInt err = SendReceive(
+        EAlfRosterHide, 
+        TIpcArgs(aCntrlGroupHandle, aDisplayHandle) );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::RosterHide return error %d", err )
+        }
+    return err;
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+//  
+TInt RAlfClient::RosterShowVisual( TInt aVisualHandle, TInt aDisplayHandle )
+    {
+    TInt err = SendReceive(
+        EAlfRosterShowVisual, 
+        TIpcArgs(aVisualHandle, aDisplayHandle) );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::RosterShowVisual return error %d", err )
+        }
+    return err;
+    }
+   
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+//  
+TInt RAlfClient::RosterHideVisual( TInt aVisualHandle,  TInt aDisplayHandle )
+    {
+    TInt err = SendReceive(
+        EAlfRosterHideVisual, 
+        TIpcArgs(aVisualHandle, aDisplayHandle) );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::RosterHideVisual return error %d", err )
+        }
+    return err;
+    }
+   
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+//  
+TInt RAlfClient::RosterSetPointerEventObservers( 
+    TInt aFlags, TInt aCntrlHandle, TInt aDisplayHandle )
+    {
+    TInt err = SendReceive(
+        EAlfRosterSetPointerEventFlags, 
+        TIpcArgs(aFlags, aCntrlHandle, aDisplayHandle) );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::RosterSetPointerEventObservers return error %d", err )
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+//    
+TInt RAlfClient::RosterAddPointerEventObserver( 
+    TAlfPointerEventFlags aObserver, TInt aCntrlHandle, TInt aDisplayHandle )
+    {
+    TInt err = SendReceive(
+        EAlfRosterAddPointerEventObserver, 
+        TIpcArgs(aObserver, aCntrlHandle, aDisplayHandle) );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::RosterAddPointerEventObserver return error %d", err )
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+//
+TInt RAlfClient::RosterRemovePointerEventObserver( 
+    TAlfPointerEventFlags aObserver, TInt aCntrlHandle, TInt aDisplayHandle )
+    {
+    TInt err = SendReceive(
+        EAlfRosterRemovePointerEventObserver, 
+        TIpcArgs(aObserver, aCntrlHandle, aDisplayHandle) );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::RosterRemovePointerEventObserver return error %d", err )
+        }
+    return err;
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+//  
+TInt RAlfClient::RosterMoveVisualToFront( TInt aVisualHandle, TInt aDisplayHandle )
+    {
+    TInt err = SendReceive(
+        EAlfRosterMoveVisualToFront, 
+        TIpcArgs(aVisualHandle, aDisplayHandle) );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::RosterMoveVisualToFront return error %d", err )
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Asks server to update owner id.
+// --------------------------------------------------------------------------
+//   
+TInt RAlfClient::TextureUpdateOwnerId()
+    {
+    return SendReceive( EAlfTextureUpdateOwnerId, TIpcArgs() );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+//   
+TInt RAlfClient::TextureCreateAnimatedL(TInt aId, TAlfTextureFlags aFlags, TInt aManagerId, const TDesC& aFilename)
+    {
+    TInt flags = aFlags;
+    flags &= ~EAlfTextureFlagSkinContent; // Skin content is handled in the client side    
+	
+    TInt handle = 0;
+    TPckg<TInt> handlePckg(handle);
+    
+    TAlfCreateTextureAnimatedParams params;
+    params.iId = aId; 
+    params.iBitmapHandle = 0;
+    params.iMaskBitmapHandle = 0;
+    params.iFlags = flags;
+    params.iManagerId = aManagerId;
+    params.iFilename = aFilename;
+    
+    TPckg<TAlfCreateTextureAnimatedParams> paramsPckg(params);
+    TInt err = SendReceive(EAlfTextureCreateAnimated, TIpcArgs(&handlePckg, &paramsPckg) );
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::TextureCreateAnimatedL leave error %d", err )
+        }
+    
+    User::LeaveIfError( err );
+    return handle;		
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+// 
+TInt RAlfClient::TextureStartAnimation( TInt aId )
+    {
+    TPckg<TInt> idPckg(aId);
+    return SendReceive(EAlfTextureStartAnimation, TIpcArgs(aId) );
+    }
+   
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+//      
+TInt RAlfClient::TextureStopAnimation( TInt aId )
+    {
+    TPckg<TInt> idPckg(aId);
+    return SendReceive(EAlfTextureStopAnimation, TIpcArgs(aId) );
+    }
+
+// ---------------------------------------------------------------------------
+// Creates a texture.
+// ---------------------------------------------------------------------------
+// 
+TInt RAlfClient::TextureCreateL(TInt aId, 
+    TInt aBitmapHandle, 
+    TInt aMaskBitmapHandle, 
+    TAlfTextureFlags aFlags,
+    TInt aManagerId )
+	{
+    TInt flags = aFlags;
+    flags &= ~EAlfTextureFlagSkinContent; // Skin content is handled in the client side    
+	
+    TInt handle = 0;
+    TPckg<TInt> handlePckg(handle);
+
+    TAlfCreateTextureParams params;
+    params.iId = aId; 
+    params.iBitmapHandle = aBitmapHandle;
+    params.iMaskBitmapHandle = aMaskBitmapHandle;
+    params.iFlags = flags;
+    params.iManagerId = aManagerId;
+    
+    TPckg<TAlfCreateTextureParams> paramsPckg(params);
+    TInt err = SendReceive(EAlfTextureCreate, TIpcArgs(&handlePckg, &paramsPckg) );
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::TextureCreateL leave error %d", err )
+        }
+    
+    User::LeaveIfError( err );
+    return handle;		
+	}
+
+// ---------------------------------------------------------------------------
+// Loads a texture.
+// ---------------------------------------------------------------------------
+// 
+TInt RAlfClient::TextureLoadL(TInt aId, 
+    TInt aBitmapHandle, 
+    TInt aMaskBitmapHandle, 
+    TAlfTextureFlags aFlags,
+    TInt aManagerId )
+	{
+    TInt flags = aFlags;
+    flags &= ~EAlfTextureFlagSkinContent; // Skin content is handled in the client side    
+
+    TInt handle = 0;
+    TPckg<TInt> handlePckg(handle);
+
+    TAlfLoadTextureParams params;
+    params.iId = aId; 
+    params.iBitmapHandle = aBitmapHandle;
+    params.iMaskBitmapHandle = aMaskBitmapHandle;
+    params.iFlags = flags;
+    params.iManagerId = aManagerId;
+    
+    TPckg<TAlfLoadTextureParams> paramsPckg(params);
+    TInt err = SendReceive(EAlfTextureLoad, TIpcArgs(&handlePckg, &paramsPckg) );
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::TextureLoadL leave error %d", err )
+        }
+    
+    User::LeaveIfError( err );
+    return handle;		
+	}
+
+// ---------------------------------------------------------------------------
+// Unloads a texture.
+// ---------------------------------------------------------------------------
+// 
+TInt RAlfClient::TextureUnload( TInt aId, TInt aManagerId )
+    {
+    TInt err =  SendReceive(EAlfTextureUnload, TIpcArgs(aId, aManagerId));
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::TextureUnload return error %d", err )
+        }
+        
+    return err;
+    }	
+
+// ---------------------------------------------------------------------------
+// Delete a texture.
+// ---------------------------------------------------------------------------
+// 
+TInt RAlfClient::TextureDelete( TInt aId, TInt aManagerId )
+    {
+    TInt err = SendReceive(EAlfTextureDelete, TIpcArgs(aId, aManagerId));
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::TextureDelete return error %d", err )
+        }	
+    
+    return err;	                    
+    }	
+
+// ---------------------------------------------------------------------------
+// Release a texture.
+// ---------------------------------------------------------------------------
+// 
+TInt RAlfClient::TextureRelease( TInt aId, TInt aManagerId )
+    {
+    TInt err = SendReceive(EAlfTextureRelease, TIpcArgs(aId, aManagerId));
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::TextureRelease return error %d", err )
+        }	
+    
+    return err;	                    
+    }	
+
+// ---------------------------------------------------------------------------
+// Restore a texture.
+// ---------------------------------------------------------------------------
+// 
+TInt RAlfClient::TextureRestore( TInt aId, TInt aManagerId )
+    {
+    TInt err = SendReceive(EAlfTextureRestore, TIpcArgs(aId, aManagerId));
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::TextureRestore return error %d", err )
+        }	
+    
+    return err;	                    
+    }	
+
+// ---------------------------------------------------------------------------
+// Notifies a skin change for a texture.
+// ---------------------------------------------------------------------------
+// 
+TInt RAlfClient::TextureNotifySkinChanged( TInt aId, TInt aManagerId )
+    {
+    TInt err = SendReceive(EAlfTextureNotifySkinChanged, TIpcArgs(aId, aManagerId));
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::TextureNotifySkinChanged return error %d", err )
+        }	
+    
+    return err;	                    
+    }	
+
+
+// ---------------------------------------------------------------------------
+// Blurs a texture.
+// ---------------------------------------------------------------------------
+// 
+TInt RAlfClient::TextureProcessorBlurL( const TInt aServerSideSrcHandle, 
+	    TInt aServerSideDstHandle, 
+	    TInt aManagerId, 
+	    const TSize& aPreferredSize, 
+	    TInt aFilterSize, 
+	    TInt aFlag )
+    {
+    TAlfBlurTextureParams params;
+    params.iServerSideSrcHandle = aServerSideSrcHandle;
+    params.iServerSideDstHandle = aServerSideDstHandle;
+    params.iManagerId = aManagerId;
+    params.iPreferredSize = aPreferredSize;     
+    params.iFilterSize = aFilterSize;
+    params.iFlag = aFlag;
+    
+    TPckg<TAlfBlurTextureParams> paramsPckg(params);
+    TInt err = SendReceive(EAlfTextureBlur, TIpcArgs(&paramsPckg) );   
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::TextureProcessorBlurL return error %d", err )
+        }	
+    
+    return err;	  
+    }
+
+// ---------------------------------------------------------------------------
+// Checks texture content.
+// ---------------------------------------------------------------------------
+// 
+TInt RAlfClient::TextureHasContent( TBool& aHasContent, TInt aId, TInt aManagerId )
+    {
+    TPckg<TBool> retValPckg(aHasContent);
+    TInt err = SendReceive(EAlfTextureHasContent, TIpcArgs(&retValPckg, aId, aManagerId));		                            
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::TextureHasContent return error %d", err )
+        }	
+    
+    return err;	  
+    }
+
+// ---------------------------------------------------------------------------
+// Sends texture information notification request to alfred server.
+// ---------------------------------------------------------------------------
+//
+void RAlfClient::TextureNotifyInfo( TRequestStatus& aStatus, TDes8& aDest )
+    {
+    SendReceive( EAlfNotifyTextureInfo, TIpcArgs( &aDest ), aStatus );
+    }
+
+// ---------------------------------------------------------------------------
+// Cancels texture information notification request.
+// ---------------------------------------------------------------------------
+//
+void RAlfClient::TextureCancelNotifyInfo()
+    {
+    SendReceive( EAlfCancelNotifyTextureInfo, TIpcArgs() );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets params for texture preferred size calculation.
+// ---------------------------------------------------------------------------
+//
+TInt RAlfClient::TextureSetAutoSizeParams( TInt aId, TInt aManagerId, 
+    const TAlfTextureAutoSizeParams& aParams )
+    {
+    TPckg<TAlfTextureAutoSizeParams> paramsPckg(aParams);
+
+    TInt err = SendReceive(EAlfTextureSetAutoSizeParams, 
+        TIpcArgs(aId, aManagerId, &paramsPckg) );
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::TextureSetAutoSizeParams return error %d", err )
+        }	
+    
+    return err;	                            
+    }
+
+//----------------------------------------------------------------------------
+// Notify about visibility of an application this instance is running
+// ---------------------------------------------------------------------------
+// 
+void RAlfClient::ApplicationIsForeground(TBool aIsPartiallyOrFullyForeground)
+    {
+    SendReceive(EAlfNotifyAppVisibility, TIpcArgs(aIsPartiallyOrFullyForeground));
+    }
+  
+// ---------------------------------------------------------------------------
+// Continue refresh
+// ---------------------------------------------------------------------------
+//   
+void RAlfClient::EnvContinueRefresh()
+    {
+    Send(EAlfEnvContinueRefresh, TIpcArgs() );
+    }
+   
+// ---------------------------------------------------------------------------
+// Pause refresh
+// ---------------------------------------------------------------------------
+//    
+void RAlfClient::EnvPauseRefresh()
+    {
+    Send(EAlfEnvPauseRefresh, TIpcArgs() );
+    }
+
+// ---------------------------------------------------------------------------
+// Refresh call back
+// ---------------------------------------------------------------------------
+//  
+void RAlfClient::EnvRefreshCallBack()
+    {
+    Send(EAlfEnvRefreshCallBack, TIpcArgs() );
+    }
+
+// ---------------------------------------------------------------------------
+// Get renderer type.
+// ---------------------------------------------------------------------------
+//    
+TInt RAlfClient::EnvRenderer() const
+    {
+    TInt retVal = 0;
+    TPckg<TInt> retValPckg(retVal);
+    TInt err = SendReceive(EAlfEnvRenderer, TIpcArgs(&retValPckg));		                            
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::Renderer return error %d", err )
+        }	
+    
+    return retVal;	          
+    }
+
+// ---------------------------------------------------------------------------
+// Set idle treshold
+// ---------------------------------------------------------------------------
+//    
+void RAlfClient::EnvSetIdleThreshold(TInt aMilliseconds)
+    {
+    TInt err = SendReceive(EAlfEnvSetIdleThreshold, TIpcArgs(aMilliseconds));
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::EnvSetIdleTreshold return error %d", err )
+        }	
+    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+// 
+void RAlfClient::CancelPointerEvents()
+    {
+    SendReceive(EAlfCancelPtrEvents);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+// 
+void RAlfClient::RequestPointerEvents(TDes8& aEventAsDescriptor,TRequestStatus& aStatus)
+    {
+    SendReceive(EAlfGetPointerEvent, TIpcArgs(&aEventAsDescriptor), aStatus);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+// 
+void RAlfClient::SetFullScreenDrawing(TBool aEnable)
+    {
+    Send(ESetFullScreenDrawing, TIpcArgs(aEnable));
+    }
+        
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+// 
+TInt RAlfClient::LayoutMetricsTextStyleData(TInt& aFontCategory, TInt aTextStyle)
+    {
+    TPckg<TInt> retValPckg(aFontCategory);
+    TInt err = SendReceive(EAlfLayoutMetricsTextStyleData, TIpcArgs(&retValPckg, aTextStyle));		                                
+    return err;	          
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+// 
+void RAlfClient::CancelSystemEvents()
+    {
+    SendReceive(EAlfCancelSystemEvents);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+// 
+void RAlfClient::RequestSystemEvents(TDes8& aEventAsDescriptor,TRequestStatus& aStatus)
+    {
+    SendReceive(EAlfGetSystemEvent, TIpcArgs(&aEventAsDescriptor), aStatus);
+    }
+
+void RAlfClient::SetWgParent(TInt aParentId)
+    {
+    Send(EAlfSetWgParent, TIpcArgs(aParentId));
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+//  
+TInt RAlfClient::RosterSetPointerDragTreshold( 
+     TInt aCntrlHandle, const TAlfXYMetric& aXYMetric, TInt aDisplayHandle )
+    {
+    TAlfPointerEventDragTreshold params;
+    params.iControlHandle = aCntrlHandle;
+    params.iXYMetric = aXYMetric;
+    params.iDisplayHandle = aDisplayHandle;
+    
+    TPckg<TAlfPointerEventDragTreshold> paramsPckg(params);
+    TInt err = SendReceive(EAlfRosterSetPointerDragTreshold, TIpcArgs(&paramsPckg) );   
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::RosterSetPointerDragTreshold return error %d", err )
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// --------------------------------------------------------------------------
+//  
+TInt RAlfClient::RosterDisableLongTapEventsWhenDragging( 
+     TInt aCntrlHandle, TBool aDisable, TInt aDisplayHandle )
+    {    
+    
+    TInt err = SendReceive(EAlfRosterDisableLongTapEventsWhenDragging, TIpcArgs(aCntrlHandle, aDisable, aDisplayHandle) );   
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfClient::RosterSetPointerDragTreshold return error %d", err )
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Send synchronous command
+// ---------------------------------------------------------------------------
+//
+void RAlfClient::SendCmd(TUint aCmd, TDes8& aBuf)
+    {
+    Send(aCmd, TIpcArgs(&aBuf));
+    }
+
+// ---------------------------------------------------------------------------
+// Send asynchronous command
+// ---------------------------------------------------------------------------
+//
+void RAlfClient::SendAsyncCmd(TUint aCmd, TDes8& aBuf, TRequestStatus& aStatus)
+    {
+    SendReceive(aCmd, TIpcArgs(&aBuf), aStatus);
+    }
+
+// ---------------------------------------------------------------------------
+// Send command
+// ---------------------------------------------------------------------------
+//
+TInt RAlfClient::SendSyncCmd(TUint aCmd, TDes8& aBuf)
+    {
+    return SendReceive(aCmd, TIpcArgs(&aBuf));
+    }
+
+// ---------------------------------------------------------------------------
+// Appends the command in the buffer.
+// On any error case, the caller is expected to call "synch with reply" instead.
+// ---------------------------------------------------------------------------
+//
+TInt RAlfClient::SendNoReply(TUint aOp, const TDesC8& aInputBuf, TInt aSubSessionHandle)
+    {
+    if ( iAutoFlushMode == EAlfAutoFlushInstant )
+        {
+        // this will generate a function calls flush and "send with reply"
+        return KErrGeneral;
+        }
+    
+    // Make sure the default buffer is allocated
+    if ( !iDefaultBatchBuffer )
+        {
+        iDefaultBatchBuffer = HBufC8::New( KAlfClientDefaultBatchBufferSize );
+        if ( !iDefaultBatchBuffer )
+            {
+            return KErrNoMemory;
+            }
+            
+        // start adding commands on the default buffer
+        iUsedBatchBuffer = iDefaultBatchBuffer;
+        }
+        
+    TPtr8 prtToUsedBuffer = iUsedBatchBuffer->Des();
+    
+    TInt3 param( aOp, aSubSessionHandle, aInputBuf.Length() );
+    TPckgC<TInt3> paramPckg( param );
+    
+    // check max length
+    const TInt paddedParamsPckgLength = AlfPaddedLength( paramPckg.Length() );
+    const TInt paddedInputBufLength = AlfPaddedLength( aInputBuf.Length() );
+    const TInt lengthNeededByTheCommand = 
+        paddedParamsPckgLength + paddedInputBufLength;
+    
+    // check if we can fit in the used buffer
+    if ( lengthNeededByTheCommand > prtToUsedBuffer.MaxLength() - prtToUsedBuffer.Length() )
+        {
+        // we cannot fit. Let's try to allocate more buffer:
+        TInt allocError = AllocateExtendedBuffer( lengthNeededByTheCommand );
+        
+        if ( allocError != KErrNone )
+            {
+            if ( iAutoFlushMode != EAlfAutoFlushOnlyForced )
+                {
+                FlushBatchBuffer();
+                }
+            }
+        }
+   
+    // the used buffer might have changed in the previous if-statement
+    prtToUsedBuffer.Set( iUsedBatchBuffer->Des() );
+    
+    // check if we can fit in the used buffer - again
+    if ( lengthNeededByTheCommand > prtToUsedBuffer.MaxLength() - prtToUsedBuffer.Length() )
+        {
+        // we still do not fit...
+        return KErrOverflow;
+        }
+    
+    prtToUsedBuffer.Append( paramPckg );
+    AppendPadding( 
+        prtToUsedBuffer, 
+        paddedParamsPckgLength - paramPckg.Length() ); 
+    prtToUsedBuffer.Append( aInputBuf );
+    AppendPadding( 
+        prtToUsedBuffer, 
+        paddedInputBufLength - aInputBuf.Length() );
+    
+    __ASSERT_DEBUG( 
+        !( prtToUsedBuffer.Length() % KAlfClientServerRoundToBoundary ), 
+        USER_INVARIANT() );
+    
+    if ( !iAutoFlusher && iAutoFlushMode == EAlfAutoFlushDeferred )
+        {
+        iAutoFlusher = new CBatchBufferAutoFlusher(*this);
+        if ( !iAutoFlusher )
+            {
+            // if cannot allocate auto-flusher, flush now
+            FlushBatchBuffer();
+            return KErrNone;
+            }
+        }
+        
+    if ( iAutoFlusher )
+        {
+        iAutoFlusher->StartAutoFlush();
+        }
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the flush mode
+// ---------------------------------------------------------------------------
+//
+TAlfAutoFlushMode RAlfClient::AutoFlushMode() const
+    {
+    return iAutoFlushMode;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the flush mode
+// ---------------------------------------------------------------------------
+//
+void RAlfClient::SetAutoFlushMode( TAlfAutoFlushMode aAutoFlushMode )
+    {
+    if ( iAutoFlushMode == aAutoFlushMode )
+        {
+        // no action required
+        return;
+        }
+    
+    FlushBatchBuffer();
+    iAutoFlushMode = aAutoFlushMode;
+    
+    switch( iAutoFlushMode  )
+        {
+        case EAlfAutoFlushOnlyForced:
+            delete iAutoFlusher;
+            iAutoFlusher = NULL;
+            break;
+            
+        case EAlfAutoFlushInstant:
+            // these are not needed 
+            delete iDefaultBatchBuffer;
+            iDefaultBatchBuffer = NULL;
+            
+            iUsedBatchBuffer = NULL;
+            
+            delete iAutoFlusher;
+            iAutoFlusher = NULL;
+            break;
+            
+        default:
+            break;
+        }
+        
+    __ALFLOGSTRING1( "RAlfClient::SetAutoFlushMode New flush mode %d", aAutoFlushMode )
+    }
+
+// ---------------------------------------------------------------------------
+// Flushes the command buffer
+// ---------------------------------------------------------------------------
+//
+TInt RAlfClient::FlushBatchBuffer()
+    {
+    TInt err = KErrNone;
+    if ( iUsedBatchBuffer && iUsedBatchBuffer->Length() )
+        {
+        TPtr8 ptr(iUsedBatchBuffer->Des());
+        err = SendSyncCmd( EAlfDoSubSessionBatchCmd, ptr );
+        
+        // all the commands in the buffer are handled -> it can be emptied
+        delete iExtendedBatchBuffer;
+        iExtendedBatchBuffer = NULL;
+        
+        iDefaultBatchBuffer->Des().Zero();
+        
+        iUsedBatchBuffer = iDefaultBatchBuffer;
+        
+        // the iDefaultBatchBuffer could be deleted here, but we might end up
+        // fragmenting the memory
+        }
+        
+    if ( iAutoFlusher ) 
+        {
+        iAutoFlusher->Cancel();
+        }
+    
+    // the iAutoFlusher could be deleted here, but we might end up
+    // fragmenting the memory
+    
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the flush buffer size
+// ---------------------------------------------------------------------------
+//
+void RAlfClient::SetMaxBatchBufferSize( TInt aBufferSize )
+    {
+    FlushBatchBuffer();
+   
+    if ( aBufferSize == KAlfBatchBufferSizeNoLimit )
+        {
+        iUsedMaxBufferSize = KAlfBatchBufferSizeNoLimit;
+        }
+    else if ( aBufferSize == KAlfBatchBufferSizeLimitToSystemDefault )
+        {
+        // KAlfClientDefaultBatchBufferSize will be used
+        iUsedMaxBufferSize = KAlfClientDefaultBatchBufferSize;
+        }
+    else
+        {
+        // The buffer >= KAlfClientDefaultBatchBufferSize always
+        iUsedMaxBufferSize = Max( aBufferSize, KAlfClientDefaultBatchBufferSize );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Tries to allocate the extended buffer
+// ---------------------------------------------------------------------------
+//
+TInt RAlfClient::AllocateExtendedBuffer( TInt aMoreSpaceNeeded )
+    {
+    TPtr8 prtToUsedBuffer = iUsedBatchBuffer->Des();
+    
+    // Note that max buffer size may be slightly larger than
+    // iUsedMaxBufferSize, since when you create instance using
+    // HBufC8::NewL( len ) its max size may be larger than len.
+    if ( ( iUsedMaxBufferSize != KAlfBatchBufferSizeNoLimit ) &&
+         ( prtToUsedBuffer.MaxLength() >= iUsedMaxBufferSize ) )
+        {
+        // Cannot make make buffer any bigger
+        return KErrGeneral;
+        }
+ 
+    // Go for twice the required size.
+    TInt newExtendedSize = 
+        ( prtToUsedBuffer.Length() + aMoreSpaceNeeded ) * 2;
+    if ( iUsedMaxBufferSize != KAlfBatchBufferSizeNoLimit )
+        {
+        // There is a max limit - we need to balace with it
+        newExtendedSize = Min( newExtendedSize, iUsedMaxBufferSize );
+        }
+    
+    HBufC8* newBuffer = HBufC8::New( newExtendedSize );
+    if ( !newBuffer )
+        {
+        return KErrNoMemory;
+        }
+    
+    // Copy from the old one
+    TPtr8 newBufferPtr = newBuffer->Des();
+    newBufferPtr.Copy( *iUsedBatchBuffer );
+    
+    // Clear the old one
+    if ( iUsedBatchBuffer == iExtendedBatchBuffer )
+        {
+        // delete old extended buffer
+        delete iExtendedBatchBuffer;
+        iExtendedBatchBuffer = NULL;
+        }
+    else
+        {
+        iDefaultBatchBuffer->Des().Zero();
+        }
+        
+    // set the pointers point to the new buffer
+    iExtendedBatchBuffer = newBuffer;
+    iUsedBatchBuffer = iExtendedBatchBuffer;
+    
+    __ALFLOGSTRING1( "RAlfClient::AllocateExtendedBuffer New buffer size %d", newExtendedSize )
+    
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// Appends padding to the command
+// ---------------------------------------------------------------------------
+//    
+inline void RAlfClient::AppendPadding( TDes8& aBuffer, TInt aAmount )
+    {
+    if ( aAmount )
+        {
+        // Modify length
+        TInt length = aBuffer.Length();
+        aBuffer.SetLength( length + aAmount );
+        
+        // Zero bytes used for padding
+        do 
+            {
+            aAmount--;
+            aBuffer[ length ] = 0;
+            length++;
+            }
+        while ( aAmount );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Post Qt buffer received from Qt port
+// ---------------------------------------------------------------------------
+//
+
+TInt RAlfClient::PostQtBuffer( TInt aWsWgId, TInt aWsClientId, TDes8& aCommandBuffer,
+        TAlfCommandBufferStatus aStatus )
+    {
+    TAlfQtCommandBufferParams params;
+    params.iWsClientId = aWsClientId;
+    params.iPtr = (TAny*)aCommandBuffer.Ptr();
+    params.iLength = aCommandBuffer.Length();
+    params.iBufferStatus = aStatus;
+    params.iVisualHandle = 0;
+    params.iWsWgId = aWsWgId;
+    TPckg<TAlfQtCommandBufferParams> paramsPckg(params);    
+  
+    TInt err = SendReceive( EAlfQtCommandBuffer, TIpcArgs(&paramsPckg) );
+
+    if ( err != KErrNone )
+       {
+       __ALFLOGSTRING1( "RAlfClient::PostQtBuffer return error %d", err )
+       }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the requested info about the batch buffer
+// ---------------------------------------------------------------------------
+//    
+TInt RAlfClient::GetBatchBufferInfo( TAlfBatchBufferInfoType aBufferInfoType ) const
+    {
+    switch ( aBufferInfoType )
+        {
+        case EAlfBatchBufferInfoDefaultBufferSize:
+            return KAlfClientDefaultBatchBufferSize;
+    
+        case EAlfBatchBufferInfoMaxSize:
+            return iUsedMaxBufferSize == KAlfClientDefaultBatchBufferSize ? 
+                KAlfBatchBufferSizeLimitToSystemDefault : iUsedMaxBufferSize;
+    
+        case EAlfBatchBufferInfoCurrentlyAllocated:
+            return iUsedBatchBuffer ? iUsedBatchBuffer->Des().MaxLength() : 0;
+    
+        case EAlfBatchBufferInfoCommandsAllocate:
+            return iUsedBatchBuffer ? iUsedBatchBuffer->Length() : 0;
+           
+        default:
+            return 0;
+        }
+    }
+
+// end of file
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfclient.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project alfclient
+*
+*/
+
+
+
+#include "../../CommonInc/alfuids.h"
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+
+TARGET                  alfclient.dll
+TARGETTYPE              dll
+UID                     0x1000008d KAlfClientUid3
+VERSION                 10.0
+
+CAPABILITY              CAP_CLIENT_DLL
+VENDORID                VID_DEFAULT
+
+MACRO ALF_RASTER_TEXT
+
+SOURCEPATH              ../src
+SOURCE                  alfclientBase.cpp
+SOURCE                  alfclient.cpp
+SOURCE                  alfenv.cpp
+SOURCE                  alfscreenbuffer.cpp
+SOURCE                  alfdisplay.cpp
+SOURCE                  alfroster.cpp
+SOURCE                  alfcontrolgroup.cpp
+SOURCE                  alfcontrol.cpp
+SOURCE                  alfvisual.cpp
+SOURCE                  alflayout.cpp
+SOURCE                  alfvisualfactory.cpp
+SOURCE                  alftextvisual.cpp
+SOURCE                  alfanchorlayout.cpp
+SOURCE                  alfbrush.cpp
+SOURCE                  alfbrusharray.cpp
+SOURCE                  alfborderbrush.cpp
+SOURCE                  alfevent.cpp
+SOURCE                  alftransformation.cpp
+SOURCE                  alftexture.cpp
+SOURCE                  alftextureprocessor.cpp
+SOURCE                  alftexturemanager.cpp
+SOURCE                  alfimage.cpp
+SOURCE                  alfimagevisual.cpp
+SOURCE                  alfgridlayout.cpp
+SOURCE                  alfdisplaysubsession.cpp
+SOURCE                  alfcontrolgroupsubsession.cpp
+SOURCE                  alftransformationsubsession.cpp
+SOURCE                  alfgencomponent.cpp
+SOURCE                  alfcommand.cpp
+SOURCE                  alftimedvalue.cpp
+SOURCE                  alfmappingfunctions.cpp
+SOURCE                  alfimagebrush.cpp
+SOURCE                  alfdecklayout.cpp
+SOURCE                  alfflowlayout.cpp
+SOURCE                  alfcurvepath.cpp
+SOURCE                  alfcurvepathlayout.cpp
+SOURCE                  alflinevisual.cpp
+SOURCE                  alfdropshadowbrush.cpp
+SOURCE                  alfshadowborderbrush.cpp
+SOURCE                  alfcommandscheduler.cpp
+SOURCE                  alfgradientbrush.cpp
+SOURCE                  alfutil.cpp
+SOURCE                  alfimageloaderutil.cpp
+SOURCE                  alfframebrush.cpp
+SOURCE                  alfviewportlayout.cpp
+SOURCE                  alflctanchorlayout.cpp
+SOURCE                  alfmeshvisual.cpp
+SOURCE                  alfmesh.cpp
+SOURCE                  alfproceduralmesh.cpp
+SOURCE                  alfm3gmesh.cpp
+SOURCE                  alflctgridlayout.cpp
+SOURCE                  alflcttextvisual.cpp
+SOURCE                  alflayoutmetrics.cpp
+SOURCE	                 alftextstylemanager.cpp
+SOURCE	                 alftextstyle.cpp
+SOURCE                  alfskinnableimage.cpp
+SOURCE                  alfstatic.cpp
+SOURCE                  alfpanic.cpp
+SOURCE                  alfmetric.cpp
+SOURCE                  alfproperty.cpp
+SOURCE                  alfpropertyowner.cpp
+SOURCE                  alfscrollerevent.cpp
+SOURCE                  alfsymbiansbdrawer.cpp
+SOURCE                  alfdisplaybackgrounditem.cpp
+SOURCE                  alfbatchbuffer.cpp
+SOURCE                  alftextureautosizeparams.cpp
+SOURCE                  alfdropshadow.cpp
+SOURCE                  alftexturegroup.cpp
+
+SOURCE                  alfgc.cpp
+SOURCE                  alfcanvasvisual.cpp 
+SOURCE                  alfclientwindow.cpp
+SOURCE                  alfdirectclient.cpp
+USERINCLUDE             ../inc
+USERINCLUDE             ../../CommonInc
+
+
+#include <platform_paths.hrh>
+MW_LAYER_SYSTEMINCLUDE
+
+
+
+SYSTEMINCLUDE           ../../../../inc
+
+LIBRARY                 apgrfx.lib
+LIBRARY                 apparc.lib
+LIBRARY                 avkon.lib
+LIBRARY                 cone.lib
+LIBRARY                 eikcore.lib 
+LIBRARY                 euser.lib
+LIBRARY                 flogger.lib
+LIBRARY                 ws32.lib 
+LIBRARY                 fbscli.lib 
+LIBRARY                 imageconversion.lib
+LIBRARY                 efsrv.lib
+LIBRARY                 hal.lib
+LIBRARY                 bitgdi.lib
+LIBRARY     	        aknicon.lib
+LIBRARY                 aknskins.lib
+LIBRARY                 ftokenclient.lib
+LIBRARY                 fontutils.lib 
+LIBRARY                 gdi.lib
+LIBRARY                 tagma.lib
+LIBRARY                 linebreak.lib
+LIBRARY                 fntstr.lib
+LIBRARY                 eikcoctl.lib
+LIBRARY                 fepbase.lib
+LIBRARY                 hwrmlightclient.lib
+LIBRARY                 etext.lib
+LIBRARY                 bafl.lib
+LIBRARY                 estor.lib
+LIBRARY                 svgengine.lib
+LIBRARY                 charconv.lib
+LIBRARY                 centralrepository.lib
+
+#if defined (__S60_32__) || defined (RD_ALF_IN_PLATFORM)
+LIBRARY                 inlinetext.lib
+#endif
+
+LIBRARY                 aknlayout2hierarchy.lib
+LIBRARY                 aknfepuiinterface.lib
+LIBRARY 		hitchcock.lib
+LIBRARY         	fontprovider.lib
+LIBRARY			goommonitor.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfclientBase.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,358 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Server client for alfredserver.exe
+*
+*/
+
+
+
+#include <apgcli.h>
+#include <centralrepository.h>
+#include <alf/ftokenclient.h>
+
+#include <eikenv.h>
+#include "alf/alfenv.h"
+#include "alfuids.h"
+#include "alf/alfclientbase.h"
+#include "alflogger.h"
+#include "alf/alfconstants.h"
+#include <goommonitor.h>
+#include <pslninternalcrkeys.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+#ifndef __WINS__
+#define START_GOOM_FROM_ALF_CLIENT	 
+#endif
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C RAlfClientBase::RAlfClientBase(TInt aServiceUid)
+    : RAknAppServiceBase(), iServiceUid(aServiceUid), iEnv(0), iCmdLine(0), iApa(0)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Opens the connection
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void RAlfClientBase::OpenL()
+    {
+    __ALFLOGSTRING( "RAlfClient::OpenL start" )
+    TUint differentiator = 
+        StartServerL( TUid::Uid(KAlfAppServerInterfaceUid3) );
+    TName serverName;
+    ConstructServerName( 
+        serverName, 
+        TUid::Uid(KAlfAppServerInterfaceUid3), 
+        differentiator );
+    ConnectExistingByNameL( serverName );
+    __ALFLOGSTRING( "RAlfClient::OpenL end" )
+    }
+  
+// ---------------------------------------------------------------------------
+// Creates server name
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void RAlfClientBase::ConstructServerName( TName& aServerName, 
+                                        TUid aAppServerUid, 
+                                        TUint aServerDifferentiator )
+    {
+
+    _LIT(KServerNameFormat, "%08x_%08x_AppServer");
+    aServerName.Format( 
+        KServerNameFormat, 
+        aServerDifferentiator, 
+        aAppServerUid.iUid );
+    }    
+    
+// ---------------------------------------------------------------------------
+// Creates name, launches server and waits it to start.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TUint RAlfClientBase::StartServerL( TUid aAppUid )
+    {
+    // Start the server application
+    TName serverName;
+    TUint differentiator( 0 );
+    
+    differentiator = KAlfAppServerInterfaceUid3;
+    ConstructServerName( 
+        serverName, 
+        TUid::Uid(KAlfAppServerInterfaceUid3) , 
+        differentiator );
+        
+    TFindServer find( serverName );
+    TFullName fullName;
+    if ( find.Next( fullName ) == KErrNone )
+        {
+        return differentiator;
+        }
+    
+    TThreadId serverThreadId;
+    LaunchAppL( aAppUid, differentiator, serverThreadId );
+
+    return differentiator;
+    }
+    
+// ---------------------------------------------------------------------------
+// Launches the app server.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void RAlfClientBase::LaunchAppL( 
+    TUid aAppUid, 
+    TUint aServerDifferentiator, 
+    TThreadId& aThreadId )
+	{
+	RApaLsSession apa;
+	User::LeaveIfError( apa.Connect() );
+	CleanupClosePushL( apa );
+	
+	TApaAppInfo info;
+	User::LeaveIfError( apa.GetAppInfo( info, aAppUid ) );
+
+	CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
+	cmdLine->SetExecutableNameL( info.iFullName );
+	cmdLine->SetServerRequiredL( aServerDifferentiator );
+    // Set the command to start the server in background
+    cmdLine->SetCommandL( EApaCommandBackground );        
+
+	TRequestStatus status;	
+	TInt err = apa.StartApp( *cmdLine, aThreadId, &status );
+    
+    User::LeaveIfError( err );
+    
+    User::WaitForRequest(status);
+    
+    User::LeaveIfError( status.Int() );
+    
+	CleanupStack::PopAndDestroy( cmdLine );
+	CleanupStack::PopAndDestroy( &apa );
+	}
+
+// ---------------------------------------------------------------------------
+// From class RAknAppServiceBase.
+// Returns the service UID supported.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TUid RAlfClientBase::ServiceUid() const
+    {
+    return TUid::Uid(iServiceUid);
+    }
+
+
+// ---------------------------------------------------------------------------
+// Grant access
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RAlfClientBase::GrantAccessToPrivateFile( 
+                                            const TDesC& aFileName, 
+                                            TInt aObjectIdentfier, 
+                                            TInt aCommandId )
+    {
+    if (!iEnv || !iEnv->TokenClient())
+        {
+        return KErrNotReady;        
+        }
+    
+    TInt64 token = 0;
+    TPckg<TInt64> tokenBuf(token);
+    TInt err = iEnv->TokenClient()->GenerateToken(aFileName, TUid::Uid(KAlfAppServerInterfaceUid3), tokenBuf);
+    if (!err)
+        {
+        err = SendReceive(EAlfDoSubSessionCmd, TIpcArgs(aCommandId,&tokenBuf,&tokenBuf,aObjectIdentfier));
+        }
+ 
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Grant access
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt RAlfClientBase::GrantAccessToPrivateFile( 
+                                            const RFile& aFile, 
+                                            TInt aObjectIdentfier, 
+                                            TInt aCommandId )
+   {
+    if (!iEnv || !iEnv->TokenClient())
+        {
+        return KErrNotReady;        
+        }
+    
+    TInt64 token = 0;
+    TPckg<TInt64> tokenBuf(token);
+    TInt err = iEnv->TokenClient()->GenerateToken(aFile, TUid::Uid(KAlfAppServerInterfaceUid3), tokenBuf);
+    if (!err)
+        {
+        err = SendReceive(EAlfDoSubSessionCmd, TIpcArgs(aCommandId,&tokenBuf,&tokenBuf,aObjectIdentfier));
+        }
+ 
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets env
+// ---------------------------------------------------------------------------
+//
+void RAlfClientBase::SetAlfEnv(CAlfEnv& aAlf)
+    {
+    iEnv = &aAlf;
+    }
+
+void RAlfClientBase::StartAsyncL(TRequestStatus* aStatus)
+    {
+    ASSERT(iApa==0 && iCmdLine == 0);
+    // Start the server application
+    TName serverName;
+    TUint differentiator( 0 );
+    
+    differentiator = KAlfAppServerInterfaceUid3;
+    ConstructServerName( 
+        serverName, 
+        TUid::Uid(KAlfAppServerInterfaceUid3) , 
+        differentiator );
+    
+    TFindServer serverFinder(serverName);
+    TFullName fullName;
+    if (serverFinder.Next(fullName) == KErrNone)
+        {
+        User::Leave(KErrAlreadyExists);
+        }
+        
+    TThreadId threadId;
+    // we don't have proper destructor and thus we don't take
+    // "normal" ownership on our members...
+    
+    // assign to member after poping from cleanup stack - codescanner now happy
+  RApaLsSession*  apa = new (ELeave) RApaLsSession;
+	CleanupStack::PushL(apa);
+	User::LeaveIfError( apa->Connect() );
+	CleanupClosePushL( *apa );
+	
+	TApaAppInfo info;
+	User::LeaveIfError( apa->GetAppInfo( info, TUid::Uid(KAlfAppServerInterfaceUid3) ) );
+
+	CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
+	cmdLine->SetExecutableNameL( info.iFullName );
+	cmdLine->SetServerRequiredL( differentiator );
+    // Set the command to start the server in background
+    cmdLine->SetCommandL( EApaCommandBackground );        
+
+	User::LeaveIfError(apa->StartApp( *cmdLine, threadId, aStatus ));
+
+    CleanupStack::Pop(3);
+    iCmdLine=cmdLine;
+    iApa = apa;
+    }
+
+#if !defined(__WINS__)    
+_LIT(KBgAnimExeName, "z:\\sys\\bin\\backgroundanimhost.exe");
+#endif
+
+void RAlfClientBase::CompleteAsynchConstructionL()
+    {
+    if (iApa)
+        {    
+        delete iCmdLine;
+        iCmdLine = 0; 
+        iApa->Close();
+        delete iApa;
+        iApa = 0;
+
+        TName serverName;
+            ConstructServerName( 
+            serverName, 
+            TUid::Uid(KAlfAppServerInterfaceUid3), 
+            KAlfAppServerInterfaceUid3 );
+        ConnectExistingByNameL( serverName );
+        }
+    else
+        {
+    	TInt value = 0;
+        CRepository* repo = CRepository::NewLC(KCRUidThemes);
+        User::LeaveIfError(repo->Get(KThemesAnimBackgroundSupport, value));
+        CleanupStack::PopAndDestroy();
+#if !defined(__WINS__)
+        if (!value)
+            {         
+            RProcess image;
+            User::LeaveIfError(image.Create(KBgAnimExeName,KNullDesC));
+            image.Resume();
+            image.Close();
+            }
+#endif
+        }
+	       
+    }
+
+CAlfAsynchStartup::CAlfAsynchStartup():CActive(CActive::EPriorityHigh), iClient(RAlfClientBase(KAlfAppServerInterfaceUid3))
+    {
+    CActiveScheduler::Add(this);
+    }
+
+EXPORT_C void CAlfAsynchStartup::StartL()
+    {
+	  TInt err(KErrNone);
+	
+#ifdef START_GOOM_FROM_ALF_CLIENT	 
+	  // do the actual goom startup : starting this first in case something goes wrong and startup needs to stop
+    TRAP( err, CreateGOOMWatcherThreadL());
+	if(err != KErrNone)
+		{
+	    RDebug::Print(_L("Creating out of graphics mem thread failed with err %d"), err);
+		}
+#endif
+	
+	//everything went ok for goom: moving over for alf now
+    CAlfAsynchStartup* me = new (ELeave) CAlfAsynchStartup();
+    TRAP(err, me->iClient.StartAsyncL(&(me->iStatus)));
+    if ( err )
+        {
+        if (err == KErrAlreadyExists) // NGA Always
+            {
+            me->SetActive();    
+            TRequestStatus* sptr = &(me->iStatus);
+            User::RequestComplete(sptr, err);    
+            }    
+        else
+            {
+            // just die gracefully
+            delete me;
+            }
+        return;
+        }
+
+    // everything fine, wait for rendezvous
+    me->SetActive();    
+    }
+    
+void CAlfAsynchStartup::RunL()
+    {
+
+    TRAP_IGNORE(iClient.CompleteAsynchConstructionL());
+    iClient.Close();
+    
+    delete this;
+    }
+
+void CAlfAsynchStartup::DoCancel()
+    {
+    // not possible at the moment
+    }
+
+// end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfclientwindow.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,86 @@
+/*
+* 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:
+* Name        : alfclientwindow.cpp
+* Part of     : Alfred UI Toolkit / alfclient.dll
+* Description : AlfClientWindow class to post drawing commands to
+*               serverside canvas
+*
+*/
+
+#include <alf/alfenv.h>
+#include <alf/alfclientwindow.h>
+#include "alfclient.h"
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+
+EXPORT_C CAlfClientWindow* CAlfClientWindow::NewL( CAlfEnv& aEnv, RWindow& aWindow )
+    {
+    CAlfClientWindow* self = CAlfClientWindow::NewLC( aEnv, aWindow );
+    CleanupStack::Pop();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+
+CAlfClientWindow* CAlfClientWindow::NewLC( CAlfEnv& aEnv, RWindow& aWindow )
+    {
+    CAlfClientWindow* self = new(ELeave)CAlfClientWindow;
+    CleanupStack::PushL(self);
+    self->ConstructL( aEnv, aWindow );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfClientWindow::CAlfClientWindow()
+    {    
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+
+void CAlfClientWindow::ConstructL( CAlfEnv& aEnv, RWindow& aWindow )
+    {
+    iEnv = &aEnv;
+    iRWindow = &aWindow;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+
+EXPORT_C CAlfClientWindow::~CAlfClientWindow()
+    {    
+    }
+
+// ---------------------------------------------------------------------------
+// PostCommandsL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfClientWindow::PostCommandsL( TDes8& aCommandBuffer, TAlfCommandBufferStatus aStatus )
+    {
+    User::LeaveIfError(iEnv->Client().PostQtBuffer( iRWindow->WindowGroupId(),
+            iRWindow->ClientHandle(), aCommandBuffer, aStatus ));
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfcommand.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,882 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of the commands
+*
+*/
+
+
+
+#include "alf/alfcommand.h"
+#include "alf/alfevent.h"
+#include "alf/alfcontrol.h"
+#include "alf/alfenv.h"
+#include "alf/alftextvisual.h"
+#include "alf/alfeventhandler.h"
+#include "alf/alfdisplay.h"
+#include "alf/alfroster.h"
+#include "alf/alfcontrolgroup.h"
+#include "alf/alfimagevisual.h"
+#include "alf/alftransformation.h"
+#include "alflogger.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+
+EXPORT_C TAlfCommand::TAlfCommand(TAlfCommandType aType)
+        : iType(aType)
+    {
+    }
+
+
+EXPORT_C TAlfCommand::~TAlfCommand()
+    {
+    }
+
+
+EXPORT_C TAlfCommandType TAlfCommand::Type() const
+    {
+    return iType;
+    }
+    
+EXPORT_C void TAlfCommand::CommandExtension(const TUid& /*aExtensionUid*/, TAny** /*aExtensionParams*/)
+    {
+    }
+
+
+EXPORT_C const TAlfObjectCommand* TAlfCommand::ObjectCommand() const
+    {
+    return NULL;
+    }
+
+// GROUP COMMAND
+
+EXPORT_C TAlfGroupCommand::TAlfGroupCommand(CAlfControlGroup& aGroup, TAlfOp aOperation,
+                                            CAlfDisplay* aDisplay)
+        : TAlfObjectCommand(EAlfCommandTypeGroup, &aGroup, aOperation),
+          iDisplay(aDisplay)
+    {
+    }
+
+
+EXPORT_C void TAlfGroupCommand::ExecuteL(CAlfEnv& /*aEnv*/) const
+    {
+    __ALFLOGSTRING1( "TAlfGroupCommand::ExecuteL operation %d", Operation() )
+    switch(Operation())
+        {
+        case EAlfOpShow:
+            if(iDisplay)
+                {
+                iDisplay->Roster().ShowL(ControlGroup());
+                }
+            break;
+
+        case EAlfOpHide:
+            if(iDisplay)
+                {
+                iDisplay->Roster().Hide(ControlGroup());
+                }
+            break;
+
+        case EAlfOpEnableInput:
+            ControlGroup().SetAcceptInput(ETrue);
+            break;
+
+        case EAlfOpDisableInput:
+            ControlGroup().SetAcceptInput(EFalse);
+            break;
+
+        default:
+            __ALFLOGSTRING1( "TAlfGroupCommand::ExecuteL Unknown operation %d", Operation() )
+            break;
+        }
+    }
+
+
+EXPORT_C TInt TAlfGroupCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C CAlfControlGroup& TAlfGroupCommand::ControlGroup() const
+    {
+    return *(CAlfControlGroup*) Object();
+    }
+
+
+EXPORT_C CAlfDisplay* TAlfGroupCommand::Display() const
+    {
+    return iDisplay;
+    }
+    
+EXPORT_C void TAlfGroupCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    TAlfObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+    
+// CONTROL COMMAND
+
+EXPORT_C TAlfControlCommand::TAlfControlCommand(CAlfControl& aControl, TAlfOp aOperation)
+        : TAlfObjectCommand(EAlfCommandTypeControl, &aControl, aOperation)
+    {
+    }
+
+
+EXPORT_C void TAlfControlCommand::ExecuteL(CAlfEnv& /*aEnv*/) const
+    {
+    __ALFLOGSTRING1( "TAlfControlCommand::ExecuteL Unknown operation %d", Operation() )
+    }
+
+
+EXPORT_C TInt TAlfControlCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C CAlfControl& TAlfControlCommand::Control() const
+    {
+    return *(CAlfControl*) Object();
+    }
+    
+EXPORT_C void TAlfControlCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    TAlfObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+// VISUAL COMMAND
+
+
+EXPORT_C TAlfVisualCommand::TAlfVisualCommand(CAlfVisual& aVisual, TAlfOp aOperation,
+                                              TInt aSetFlags, TInt aClearFlags)
+        : TAlfObjectCommand(EAlfCommandTypeVisual, &aVisual, aOperation),
+          iSetFlags(aSetFlags), iClearFlags(aClearFlags)
+    {
+    }
+
+
+EXPORT_C void TAlfVisualCommand::ExecuteL(CAlfEnv& /*aEnv*/) const
+    {
+    switch(Operation())
+        {
+        case EAlfOpRemoveAndDestroyAll:
+            Visual().RemoveAndDestroyAllD();
+            // The object is no longer valid after this.
+            break;
+        case EAlfOpEnableTransformation:
+            Visual().EnableTransformationL(ETrue);
+            break;
+
+        case EAlfOpDisableTransformation:
+            Visual().EnableTransformationL(EFalse);
+            break;
+
+        case EAlfOpModifyFlags:
+            if(iSetFlags)
+                {
+                Visual().SetFlags(iSetFlags);
+                }
+            if(iClearFlags)
+                {
+                Visual().ClearFlags(iClearFlags);
+                }
+            break;
+
+        default:
+            __ALFLOGSTRING1( "TAlfVisualCommand::ExecuteL Unknown operation %d", Operation() )
+            break;
+        }
+    }
+
+
+EXPORT_C TInt TAlfVisualCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C CAlfVisual& TAlfVisualCommand::Visual() const
+    {
+    return *(CAlfVisual*) Object();
+    }
+
+
+EXPORT_C TInt TAlfVisualCommand::FlagsToSet() const
+    {
+    return iSetFlags;
+    }
+
+
+EXPORT_C TInt TAlfVisualCommand::FlagsToClear() const
+    {
+    return iClearFlags;
+    }
+    
+EXPORT_C void TAlfVisualCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    TAlfObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+// IMAGE COMMAND
+
+EXPORT_C TAlfImageCommand::TAlfImageCommand(CAlfImageVisual& aImageVisual,
+                                            const TAlfImage& aImage,
+                                            TAlfOp aOperation)
+        : TAlfObjectCommand(EAlfCommandTypeImage, &aImageVisual, aOperation),
+          iImage(aImage)
+    {
+    }
+
+
+EXPORT_C void TAlfImageCommand::ExecuteL(CAlfEnv& /*aEnv*/) const
+    {
+    switch(Operation())
+        {
+        case EAlfOpSetPrimaryImage:
+            ImageVisual().SetImage(iImage);
+            break;
+
+        case EAlfOpSetSecondaryImage:
+            ImageVisual().SetSecondaryImage(iImage);
+            break;
+
+        default:
+            __ALFLOGSTRING1( "TAlfImageCommand::ExecuteL Unknown operation %d", Operation() )
+            break;
+        }
+    }
+
+
+EXPORT_C TInt TAlfImageCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C CAlfImageVisual& TAlfImageCommand::ImageVisual() const
+    {
+    return *(CAlfImageVisual*) Object();
+    }
+
+
+EXPORT_C const TAlfImage& TAlfImageCommand::Image() const
+    {
+    return iImage;
+    }
+
+EXPORT_C void TAlfImageCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    TAlfObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+    
+// ACTION COMMAND
+
+EXPORT_C TAlfActionCommand::TAlfActionCommand(TInt aId)
+        : TAlfCommand(EAlfCommandTypeAction), iId(aId)
+    {
+    }
+
+EXPORT_C void TAlfActionCommand::ExecuteL(CAlfEnv& aEnv) const
+    {
+    TInt error = aEnv.ReportAction(*this);
+    if(error != KErrNone)
+        {
+        // Leave with the error code if one of the observers failed.
+        User::Leave(error);
+        }
+    }
+
+EXPORT_C TInt TAlfActionCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C TInt TAlfActionCommand::Id() const
+    {
+    return iId;
+    }
+
+EXPORT_C void TAlfActionCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    TAlfCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+// OBJECT COMMAND
+
+
+EXPORT_C TAlfObjectCommand::TAlfObjectCommand(TAlfCommandType aType, TAny* aDataOwnerObject, TAlfOp aOperation)
+        : TAlfCommand(aType), iObject(aDataOwnerObject), iOperation(aOperation)
+    {
+    }
+
+EXPORT_C TInt TAlfObjectCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+    
+EXPORT_C void TAlfObjectCommand::ExecuteL(CAlfEnv& /*aEnv*/) const
+    {
+    __ALFLOGSTRING1( "TAlfObjectCommand::ExecuteL Unknown operation %d", Operation() )
+    }
+
+EXPORT_C TAny* TAlfObjectCommand::Object() const
+    {
+    return iObject;
+    }
+
+
+EXPORT_C TAlfOp TAlfObjectCommand::Operation() const
+    {
+    return iOperation;
+    }
+
+
+EXPORT_C const TAlfObjectCommand* TAlfObjectCommand::ObjectCommand() const
+    {
+    // All object commands can be casted to TAlfObjectCommand.
+    return this;
+    }
+    
+EXPORT_C void TAlfObjectCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    TAlfCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+
+// TEXT COMMAND
+
+EXPORT_C TAlfTextCommand::TAlfTextCommand(CAlfTextVisual& aTextVisual, const TDesC& aText,
+                                          TAlfOp aOperation)
+        : TAlfObjectCommand(EAlfCommandTypeText, &aTextVisual, aOperation),
+          iText(aText)
+    {
+    }
+
+EXPORT_C void TAlfTextCommand::ExecuteL(CAlfEnv& /*aEnv*/) const
+    {
+    switch(Operation())
+        {
+        case EAlfOpSetText:
+            TextVisual().SetTextL(iText);
+            break;
+
+        default:
+            __ALFLOGSTRING1( "TAlfTextCommand::ExecuteL Unknown operation %d", Operation() )
+            break;
+        }
+    }
+
+
+EXPORT_C TInt TAlfTextCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C CAlfTextVisual& TAlfTextCommand::TextVisual() const
+    {
+    return *(CAlfTextVisual*) Object();
+    }
+
+
+EXPORT_C const TDesC& TAlfTextCommand::Text() const
+    {
+    return iText;
+    }
+
+EXPORT_C void TAlfTextCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    TAlfObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+// VALUE COMMAND
+
+EXPORT_C TAlfValueCommand::TAlfValueCommand(TAny* aObject, TAlfValueCommandTarget aObjectType,
+                                            TReal32 aTarget, TInt aTransitionTime) __SOFTFP
+        : TAlfObjectCommand(EAlfCommandTypeValue, aObject, EAlfOpSet),
+          iTimedValue(aObjectType), iTarget(aTarget), iTransitionTime(aTransitionTime),
+          iSpeed(0.0)
+    {
+    }
+
+
+EXPORT_C TAlfValueCommand::TAlfValueCommand(TAny* aObject, TAlfValueCommandTarget aObjectType,
+                                            TAlfOp aOperation,
+                                            TReal32 aTarget, TReal32 aTiming) __SOFTFP
+        : TAlfObjectCommand(EAlfCommandTypeValue, aObject, aOperation),
+          iTimedValue(aObjectType), iTarget(aTarget), iTransitionTime(0),
+          iSpeed(0.0)
+    {
+    if(aOperation == EAlfOpSetWithSpeed)
+        {
+        iSpeed = aTiming;
+        }
+    else
+        {
+        iTransitionTime = TInt(aTiming);
+        }
+    }
+
+EXPORT_C void TAlfValueCommand::ExecuteL(CAlfEnv& /*aEnv*/) const
+    {
+    TAlfTimedValue value;
+    
+    TInt op = Operation();
+    if(op >= EAlfOpSetStyle && op < EAlfOpSetStyle + EAlfTimedValueStyleLast)
+        {
+        value.SetStyle(TAlfInterpolationStyle(op - EAlfOpSetStyle));
+        }
+    
+    switch(Operation())
+        {
+        case EAlfOpSet:
+            {
+            value.SetTarget( iTarget, iTransitionTime );
+            break;
+            }
+        case EAlfOpSetWithSpeed:
+            {
+            value.SetTargetWithSpeed(iTarget, iSpeed);
+            break;
+            }
+        default:
+            __ALFLOGSTRING1( "TAlfValueCommand::ExecuteL Unknown operation %d", Operation() )
+            break;
+        }
+        
+    switch( TimedValue() )
+        {
+        case EAlfValueCommandVisualSetOpacity:
+            {
+            CAlfVisual*visual = (CAlfVisual*) Object();
+            visual->SetOpacity( value );
+            break;
+            }
+        default:
+            __ALFLOGSTRING1( "TAlfValueCommand::ExecuteL Unknown target %d", TimedValue() )
+            break;
+        }
+    }
+
+
+EXPORT_C TInt TAlfValueCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C TAlfValueCommandTarget TAlfValueCommand::TimedValue() const
+    {
+    return iTimedValue;
+    }
+
+
+EXPORT_C TReal32 TAlfValueCommand::Target() const __SOFTFP
+    {
+    return iTarget;
+    }
+
+
+EXPORT_C TInt TAlfValueCommand::TransitionTime() const
+    {
+    return iTransitionTime;
+    }
+
+
+EXPORT_C TReal32 TAlfValueCommand::Speed() const __SOFTFP
+    {
+    return iSpeed;
+    }
+    
+EXPORT_C void TAlfValueCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    TAlfObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+    
+// POINT COMMAND
+
+EXPORT_C TAlfPointCommand::TAlfPointCommand(TAny* aObject, TAlfPointCommandTarget aObjectType,
+                                            TAlfOp aOperation)
+        : TAlfObjectCommand(EAlfCommandTypePoint, aObject, aOperation),
+          iTimedPoint(aObjectType), iTransitionTime(0), iSpeed(0.0)
+    {
+    }
+
+
+EXPORT_C TAlfPointCommand::TAlfPointCommand(TAny* aObject, TAlfPointCommandTarget aObjectType,
+                                            TAlfRealPoint aTarget, TInt aTransitionTime,
+                                            TParameterTarget aParameterTarget)
+        : TAlfObjectCommand(EAlfCommandTypePoint, aObject, EAlfOpSet),
+          iTimedPoint(aObjectType), iTarget(aTarget),
+          iTransitionTime(aTransitionTime), iSpeed(0.0), iParameterTarget(aParameterTarget)
+    {
+    }
+
+
+EXPORT_C TAlfPointCommand::TAlfPointCommand(TAny* aObject, TAlfPointCommandTarget aObjectType,
+                                            TAlfOp aOperation,
+                                            TAlfRealPoint aTarget, TReal32 aTiming,
+                                            TParameterTarget aParameterTarget) __SOFTFP
+        : TAlfObjectCommand(EAlfCommandTypePoint, aObject, aOperation),
+          iTimedPoint(aObjectType), iTarget(aTarget),
+          iTransitionTime(0), iSpeed(0.0), iParameterTarget(aParameterTarget)
+    {
+    if(aOperation == EAlfOpSetWithSpeed)
+        {
+        iSpeed = aTiming;
+        }
+    else
+        {
+        iTransitionTime = TInt(aTiming);
+        }
+    }
+
+
+EXPORT_C void TAlfPointCommand::ExecuteL(CAlfEnv& /*aEnv*/) const
+    {        
+    TAlfTimedPoint point;
+    
+    // Check for interpolation style change ops.
+    TInt op = Operation();
+    if(op >= EAlfOpSetStyle && op < EAlfOpSetStyle + EAlfTimedValueStyleLast)
+        {
+        point.SetStyle(TAlfInterpolationStyle(op - EAlfOpSetStyle));
+        }
+        
+    switch( Operation() )
+        {
+        case EAlfOpSet:
+            point.SetTarget(iTarget, iTransitionTime);
+            break;
+
+        case EAlfOpSetWithSpeed:
+            point.SetTargetWithSpeed(iTarget, iSpeed);
+            break;
+
+        default:
+            __ALFLOGSTRING1( "TAlfPointCommand::ExecuteL() - Unknown op %d.", Operation())
+            break;
+        }
+    
+    if ( iParameterTarget == EBoth || iParameterTarget == EXOnly )
+        {
+        point.iX.SetTarget( iTarget.iX, iTransitionTime );
+        }
+                 
+    if ( iParameterTarget == EBoth || iParameterTarget == EYOnly )
+        {
+        point.iY.SetTarget( iTarget.iY, iTransitionTime );
+        }
+        
+    switch( TimedPoint() )
+        {
+        case EAlfPointCommandVisualSetPos:
+            {
+            CAlfVisual* visual = (CAlfVisual*) Object();
+            visual->SetPos( point );
+            break;
+            }
+        case EAlfPointCommandVisualSetSize:
+            {
+            CAlfVisual*visual = (CAlfVisual*) Object();
+            visual->SetSize( point );
+            break;
+            }
+        
+        default:
+            __ALFLOGSTRING1( "TAlfPointCommand::ExecuteL Unknown target %d", TimedPoint() )
+            break;
+        }    
+    }
+
+
+EXPORT_C TInt TAlfPointCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C TAlfPointCommandTarget TAlfPointCommand::TimedPoint() const
+    {
+    return iTimedPoint;
+    }
+
+
+EXPORT_C TAlfRealPoint TAlfPointCommand::Target() const
+    {
+    return iTarget;
+    }
+
+
+EXPORT_C TInt TAlfPointCommand::TransitionTime() const
+    {
+    return iTransitionTime;
+    }
+
+
+EXPORT_C TReal32 TAlfPointCommand::Speed() const __SOFTFP
+    {
+    return iSpeed;
+    }
+    
+EXPORT_C void TAlfPointCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    TAlfObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+// TRANSFORMATION COMMAND
+
+EXPORT_C TAlfTransformationCommand::TAlfTransformationCommand(
+    TAny* aOwner, CAlfTransformation& aTransformation, TAlfOp aOperation, TInt aStep)
+        : TAlfObjectCommand(EAlfCommandTypeTransformation, aOwner, aOperation),
+          iTransformation(aTransformation), iStep(aStep)
+    {
+    // Set default values for transformation
+    switch(aOperation)
+        {
+        case EAlfOpRotate:
+            iX = TAlfTimedValue(0.0f);
+            iY = TAlfTimedValue(0.0f);
+            iZ = TAlfTimedValue(1.0f);
+        break;
+        case EAlfOpScale:
+            iX = TAlfTimedValue(1.0f);
+            iY = TAlfTimedValue(1.0f);
+            iZ = TAlfTimedValue(1.0f);
+        break;        
+        default:
+        break;
+        }
+    }
+
+
+EXPORT_C void TAlfTransformationCommand::ExecuteL(CAlfEnv& /*aEnv*/) const
+    {
+    switch(Operation())
+        {
+        case EAlfOpLoadIdentity:
+            iTransformation.LoadIdentity();
+            break;
+
+        case EAlfOpTranslate:
+            if(iStep != EStepNone)
+                {
+                CAlfTransformation::TTransform xs = iTransformation.Step(iStep);
+                xs.iType = CAlfTransformation::ETypeTranslate;
+                xs.iParams[EAlfTransformParamTranslateX] = iX;
+                xs.iParams[EAlfTransformParamTranslateY] = iY;
+                xs.iParams[EAlfTransformParamTranslateZ] = iZ;
+                iTransformation.ReplaceStep(iStep,xs);
+                }
+            else
+                {
+                iTransformation.Translate(iX, iY);
+                }
+            break;
+
+        case EAlfOpScale:
+            if(iStep != EStepNone)
+                {
+                CAlfTransformation::TTransform xs = iTransformation.Step(iStep);
+                xs.iType = CAlfTransformation::ETypeScale;
+                xs.iParams[EAlfTransformParamScaleX] = iX;
+                xs.iParams[EAlfTransformParamScaleY] = iY;
+                xs.iParams[EAlfTransformParamScaleZ] = iZ;
+                iTransformation.ReplaceStep(iStep,xs);
+                }
+            else
+                {
+                iTransformation.Scale(iX, iY, iZ);
+                }
+            break;
+
+        case EAlfOpRotate:
+            if(iStep != EStepNone)
+                {
+                CAlfTransformation::TTransform xs = iTransformation.Step(iStep);
+                xs.iType = CAlfTransformation::ETypeRotate;
+                xs.iParams[EAlfTransformParamRotateAngle] = iAngle;
+                xs.iParams[EAlfTransformParamRotateAxisX] = iX;
+                xs.iParams[EAlfTransformParamRotateAxisY] = iY;
+                xs.iParams[EAlfTransformParamRotateAxisZ] = iZ;
+                iTransformation.ReplaceStep(iStep,xs);
+                }
+            else
+                {
+                TAlfTimedValue unsuspended;
+                unsuspended = iX;
+                TReal32 x = unsuspended.ValueNow();
+                unsuspended = iY;
+                TReal32 y = unsuspended.ValueNow();
+                unsuspended = iZ;
+                TReal32 z = unsuspended.ValueNow();
+                iTransformation.Rotate(iAngle, x, y, z);
+                }
+            break;
+            
+        case EAlfOpReplaceStep:
+            {
+            if(iStep != EStepNone)
+                {
+                CAlfTransformation::TTransform xs = iTransformation.Step(iStep);
+                xs.iParams[EAlfTransformParamRotateAngle] = iAngle;
+                xs.iParams[EAlfTransformParamRotateAxisX] = iX;
+                xs.iParams[EAlfTransformParamRotateAxisY] = iY;
+                xs.iParams[EAlfTransformParamRotateAxisZ] = iZ;
+                iTransformation.ReplaceStep(iStep,xs);
+                }
+            break;
+            }
+
+        default:
+            __ALFLOGSTRING1( "TAlfTransformationCommand::ExecuteL Unknown operation %d", Operation() )
+            break;
+        }
+    }
+
+
+EXPORT_C TInt TAlfTransformationCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C CAlfTransformation& TAlfTransformationCommand::Transformation() const
+    {
+    return iTransformation;
+    }
+
+
+EXPORT_C TInt TAlfTransformationCommand::Step() const
+    {
+    return iStep;
+    }
+
+
+EXPORT_C void TAlfTransformationCommand::SetX(const TAlfTimedValue& aValue)
+    {
+    iX = aValue;
+    //iX.Suspend();
+    }
+
+
+EXPORT_C void TAlfTransformationCommand::SetY(const TAlfTimedValue& aValue)
+    {
+    iY = aValue;
+    //iY.Suspend();
+    }
+
+
+EXPORT_C void TAlfTransformationCommand::SetZ(const TAlfTimedValue& aValue)
+    {
+    iZ = aValue;
+    //iZ.Suspend();
+    }
+
+
+EXPORT_C void TAlfTransformationCommand::SetAngle(const TAlfTimedValue& aValue)
+    {
+    iAngle = aValue;
+    //iAngle.Suspend();
+    }
+    
+EXPORT_C void TAlfTransformationCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    TAlfObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+// MARKER COMMAND
+
+EXPORT_C TAlfMarkerCommand::TAlfMarkerCommand(TInt aId)
+        : TAlfCommand(TAlfCommandType(EAlfCommandTypeMarkerFirst + aId))
+    {
+    }
+
+
+EXPORT_C void TAlfMarkerCommand::ExecuteL(CAlfEnv& /*aEnv*/) const
+    {
+    __ALFLOGSTRING1( "TAlfMarkerCommand::ExecuteL - Marker %d reached.", Id() )
+    }
+
+
+EXPORT_C TInt TAlfMarkerCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C TInt TAlfMarkerCommand::Id() const
+    {
+    return Type() - EAlfCommandTypeMarkerFirst;
+    }
+
+EXPORT_C void TAlfMarkerCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    TAlfCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+// CUSTOM EVENT
+
+EXPORT_C TAlfCustomEventCommand::TAlfCustomEventCommand(
+    TInt aEventParam, MAlfEventHandler* aRecipient, TInt aEventData)
+        : TAlfObjectCommand(EAlfCommandTypeCustomEvent, aRecipient, EAlfOpNone),
+          iEventParam(aEventParam),
+          iEventData(aEventData)
+    {
+    }
+ 
+
+EXPORT_C void TAlfCustomEventCommand::ExecuteL(CAlfEnv& aEnv) const
+    {
+    TAlfEvent customEvent(iEventParam, iEventData);
+
+    if(Recipient())
+        {
+        Recipient()->OfferEventL(customEvent);
+        }
+    else
+        {
+        aEnv.BroadcastEventL(customEvent);
+        }
+    }
+
+
+EXPORT_C TInt TAlfCustomEventCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C MAlfEventHandler* TAlfCustomEventCommand::Recipient() const
+    {
+    return (MAlfEventHandler*) Object();
+    }
+
+EXPORT_C TInt TAlfCustomEventCommand::Param() const
+    {
+    return iEventParam;
+    }
+    
+EXPORT_C TInt TAlfCustomEventCommand::EventData() const
+    {
+    return iEventData;
+    }
+
+EXPORT_C void TAlfCustomEventCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    TAlfObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfcommandscheduler.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,591 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Command scheduler.
+*
+*/
+
+
+
+#include "alfcommandscheduler.h"
+#include "alf/alfcommand.h"
+#include "alflogger.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+// Internal flags.
+enum TAlfSchedulerFlags
+   {
+   EAlfSchedulerPrimaryLightsOn        = 0x01,
+   EAlfSchedulerSecondaryLightsOn      = 0x02,
+   EAlfSchedulerApplicationForeground  = 0x04,
+   EAlfSchedulerRunning                = 0x08
+   };
+
+// ======== CTimedEvent MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+CAlfCommandScheduler::CTimedEvent* CAlfCommandScheduler::CTimedEvent::NewLC( 
+            const TAlfCommand& aCommand,
+            CAlfCommandScheduler& aScheduler )
+    {
+    CTimedEvent* self = new (ELeave) CTimedEvent(aScheduler);
+    CleanupStack::PushL( self );
+    self->ConstructL( aCommand );
+    return self;
+    }
+  
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//  
+CAlfCommandScheduler::CTimedEvent::~CTimedEvent()
+    {
+    Cancel();
+    delete iCommand;
+    }
+  
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//  
+CAlfCommandScheduler::CTimedEvent::CTimedEvent( CAlfCommandScheduler& aScheduler )
+ : CTimer( EPriorityStandard ), iScheduler( aScheduler )
+    {
+    CActiveScheduler::Add( this );
+    }
+  
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//  
+void CAlfCommandScheduler::CTimedEvent::ConstructL(const TAlfCommand& aCommand)
+    {
+    CTimer::ConstructL();
+    
+    // Make a copy of the command.
+    TAlfCommand* data = (TAlfCommand*) new (ELeave) TUint8[aCommand.Size()];
+    Mem::Copy((TAny*)data, (TAny*)&aCommand, aCommand.Size());
+    iCommand = data;
+    }
+ 
+// ---------------------------------------------------------------------------
+// Called when timer triggers.
+// ---------------------------------------------------------------------------
+//   
+void CAlfCommandScheduler::CTimedEvent::RunL()
+    {
+    iScheduler.ExecuteEventL( *iCommand );
+    delete this;
+    }
+
+// ---------------------------------------------------------------------------
+// Called when RunL leaves
+// ---------------------------------------------------------------------------
+//     
+TInt CAlfCommandScheduler::CTimedEvent::RunError(TInt aError)
+    {
+    __ALFLOGSTRING1( "CAlfCommandScheduler::ExecuteEventL leaves with %d", aError )
+    delete this;
+    return aError;
+    }
+
+// ---------------------------------------------------------------------------
+// Execute command after given timed.
+// ---------------------------------------------------------------------------
+//    
+void CAlfCommandScheduler::CTimedEvent::ExecuteAfter( 
+    TInt aIntervalInMilliSeconds, 
+    TBool aStartPaused )
+    {
+    __ASSERT_ALWAYS( !IsActive(), USER_INVARIANT() );
+    iTimeLeftInMilliSeconds = aIntervalInMilliSeconds; 
+    
+    // If the scheduler is not paused...
+    if ( !aStartPaused )
+        {
+        // ...start the timer.
+        After( aIntervalInMilliSeconds * 1000 );
+        iLastStartTime.UniversalTime(); // Update the start-time stamp.
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Pauses the time
+// ---------------------------------------------------------------------------
+//    
+void CAlfCommandScheduler::CTimedEvent::Pause()
+    {
+    // If not paused...
+    if ( IsActive() )
+        {
+        // ... cancel the timer and update the time left.
+        Cancel();
+        TTime timeNow;
+        timeNow.UniversalTime();
+        iTimeLeftInMilliSeconds -= 
+            timeNow.MicroSecondsFrom( iLastStartTime ).Int64()/1000;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Continue timer.
+// ---------------------------------------------------------------------------
+//    
+void CAlfCommandScheduler::CTimedEvent::Continue()
+    {
+    // If not running...
+    if ( !IsActive() )
+        {
+        // ... execute the event...
+        if ( iTimeLeftInMilliSeconds <= 0 )
+            {
+            // ...now
+            TRAP_IGNORE(iScheduler.ExecuteEventL( *iCommand ))
+            delete this;
+            }
+        else
+            {
+            // ...after the time left.
+            After( iTimeLeftInMilliSeconds * 1000 );
+            iLastStartTime.UniversalTime(); // Update the start-time stamp.
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Calculates the time left.
+// ---------------------------------------------------------------------------
+//    
+TInt CAlfCommandScheduler::CTimedEvent::TimeLeftInMilliSeconds() const
+    {
+    TInt timeLeftInMilliSeconds = 0;
+    if ( IsActive() )
+        {
+        TTime timeNow;
+        timeNow.UniversalTime();
+        timeLeftInMilliSeconds = 
+            iTimeLeftInMilliSeconds - 
+            timeNow.MicroSecondsFrom( iLastStartTime ).Int64()/1000;
+        }
+    else
+        {
+        timeLeftInMilliSeconds = iTimeLeftInMilliSeconds;
+        }
+             
+    if ( timeLeftInMilliSeconds < 0 )
+        {
+        timeLeftInMilliSeconds = 0;
+        }
+    return timeLeftInMilliSeconds;
+    }
+
+// ======== CAlfCommandScheduler MEMBER FUNCTIONS ========
+    
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfCommandScheduler* CAlfCommandScheduler::NewL( CAlfEnv& aEnv)
+    {
+    CAlfCommandScheduler* self = new (ELeave) CAlfCommandScheduler( aEnv );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+ 
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//   
+CAlfCommandScheduler::CAlfCommandScheduler( CAlfEnv& aEnv)
+ : iEnv(aEnv)
+    {
+    }
+ 
+// ---------------------------------------------------------------------------
+// ConstructL
+// Update internal flags.
+// ---------------------------------------------------------------------------
+//   
+void CAlfCommandScheduler::ConstructL()
+    {
+    iLight = CHWRMLight::NewL(this); // Calls LightStatusChanged()
+    
+    iFlags |= EAlfSchedulerApplicationForeground;
+    iFlags |= EAlfSchedulerRunning;
+
+    // Workaround for non-working light status reports  
+    iFlags |= EAlfSchedulerPrimaryLightsOn; 
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//    
+CAlfCommandScheduler::~CAlfCommandScheduler()
+    {
+    iEvents.ResetAndDestroy();
+    delete iLight;
+    }
+ 
+// ---------------------------------------------------------------------------
+// Executes given command after given time
+// ---------------------------------------------------------------------------
+//   
+void CAlfCommandScheduler::ScheduleCommandL( 
+    const TAlfCommand& aCommand, 
+    TInt aTimeInMilliSeconds )
+    {
+    if (aTimeInMilliSeconds == 0)
+        {
+        __ALFLOGSTRING( "CAlfCommandScheduler::ScheduleCommandL execute now" )
+        // Execute now
+        aCommand.ExecuteL( iEnv );
+        return;
+        }
+    
+    // Create timed event
+    __ALFLOGSTRING1( "CAlfCommandScheduler::ScheduleCommandL in %dms", aTimeInMilliSeconds )
+    CTimedEvent* event = CTimedEvent::NewLC( aCommand, *this );
+    iEvents.AppendL( event );
+    CleanupStack::Pop( event );
+    event->ExecuteAfter( aTimeInMilliSeconds, !(iFlags&EAlfSchedulerRunning) );
+    }
+
+// ---------------------------------------------------------------------------
+// Cancel all object commands.
+// ---------------------------------------------------------------------------
+//    
+void CAlfCommandScheduler::CancelCommands( TAny* aObject )
+    {
+    for ( TInt i = iEvents.Count() - 1; i >= 0; i--)
+        {
+        const TAlfObjectCommand* objectCommand = 
+            iEvents[i]->iCommand->ObjectCommand();
+        if(objectCommand && objectCommand->Object() == aObject)
+            {
+            delete iEvents[i];
+            iEvents.Remove( i );
+            }
+        }
+    iEvents.Compress();
+    }
+
+// ---------------------------------------------------------------------------
+// Cancels specific operation for given object
+// ---------------------------------------------------------------------------
+//    
+void CAlfCommandScheduler::CancelCommands(TAny* aObject, TAlfOp aCommandOperation)
+    {
+    for(TInt i = iEvents.Count() - 1; i >= 0; --i)
+        {
+        const TAlfObjectCommand* objectCommand = 
+            iEvents[i]->iCommand->ObjectCommand();
+        if(objectCommand && 
+           objectCommand->Object() == aObject &&
+           objectCommand->Operation() == aCommandOperation)
+            {
+            // Cancel this one.
+            delete iEvents[i];
+            iEvents.Remove( i );
+            }
+        }
+    iEvents.Compress();
+    }
+    
+// ---------------------------------------------------------------------------
+// Cancels given command types from given object
+// ---------------------------------------------------------------------------
+//    
+void CAlfCommandScheduler::CancelCommands(TAny* aObject,
+                                   TAlfCommandType aCommandType,
+                                   TInt aParam)
+    {
+    for(TInt i = iEvents.Count() - 1; i >= 0; --i)
+        {
+        const TAlfObjectCommand* objectCommand = 
+            iEvents[i]->iCommand->ObjectCommand();
+
+        if(objectCommand && 
+           objectCommand->Object() == aObject &&
+           objectCommand->Type() == aCommandType)
+            {
+            if(objectCommand->Type() == EAlfCommandTypeCustomEvent)
+                {
+                const TAlfCustomEventCommand* cec = 
+                    (const TAlfCustomEventCommand*) objectCommand;
+                    
+                if(cec->Param() != aParam)
+                    {
+                    // Not this one, wrong parameter.
+                    continue;
+                    }
+                }
+            // Cancel this one.
+            delete iEvents[i];
+            iEvents.Remove( i );
+            }
+        }
+        
+    iEvents.Compress();
+    }
+
+// ---------------------------------------------------------------------------
+// Returns time left ot the command
+// ---------------------------------------------------------------------------
+//     
+TInt CAlfCommandScheduler::MilliSecondsUntilCommand( 
+        TAny* aObject )
+    {
+    TInt returnValue = KErrNotFound;
+    
+    for ( TInt i = iEvents.Count() - 1; i >= 0; i--)
+        {
+        const TAlfObjectCommand* objectCommand = 
+            iEvents[i]->iCommand->ObjectCommand();
+        if(objectCommand && objectCommand->Object() == aObject)
+            {
+            TInt timeLeft = iEvents[i]->TimeLeftInMilliSeconds();
+            if ( returnValue == KErrNotFound || timeLeft < returnValue )
+                {
+                returnValue = timeLeft;
+                }
+            }
+        }
+        
+    return returnValue;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns time left ot the command
+// ---------------------------------------------------------------------------
+//    
+TInt CAlfCommandScheduler::MilliSecondsUntilCommand( 
+        TAny* aObject, 
+        TAlfOp aCommandOperation )
+    {
+    TInt returnValue = KErrNotFound;
+    
+    for(TInt i = iEvents.Count() - 1; i >= 0; --i)
+        {
+        const TAlfObjectCommand* objectCommand = 
+            iEvents[i]->iCommand->ObjectCommand();
+        if(objectCommand && 
+           objectCommand->Object() == aObject &&
+           objectCommand->Operation() == aCommandOperation)
+            {
+            TInt timeLeft = iEvents[i]->TimeLeftInMilliSeconds();
+            if ( returnValue == KErrNotFound || timeLeft < returnValue )
+                {
+                returnValue = timeLeft;
+                }
+            }
+        }
+    
+    return returnValue;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns time left ot the command
+// ---------------------------------------------------------------------------
+//      
+TInt CAlfCommandScheduler::MilliSecondsUntilCommand( 
+        TAny* aObject, 
+        TAlfCommandType aCommandType, 
+        TInt aParam )
+    {
+    TInt returnValue = KErrNotFound;
+    
+    for(TInt i = iEvents.Count() - 1; i >= 0; --i)
+        {
+        const TAlfObjectCommand* objectCommand = 
+            iEvents[i]->iCommand->ObjectCommand();
+
+        if(objectCommand && 
+           objectCommand->Object() == aObject &&
+           objectCommand->Type() == aCommandType)
+            {
+            if(objectCommand->Type() == EAlfCommandTypeCustomEvent)
+                {
+                const TAlfCustomEventCommand* cec = 
+                    (const TAlfCustomEventCommand*) objectCommand;
+                    
+                if(cec->Param() != aParam)
+                    {
+                    // Not this one, wrong parameter.
+                    continue;
+                    }
+                }
+            TInt timeLeft = iEvents[i]->TimeLeftInMilliSeconds();
+            if ( returnValue == KErrNotFound || timeLeft < returnValue )
+                {
+                returnValue = timeLeft;
+                }
+            }
+        }
+    
+    return returnValue;
+    }
+  
+// ---------------------------------------------------------------------------
+// Executes command
+// ---------------------------------------------------------------------------
+//  
+void CAlfCommandScheduler::ExecuteEventL( TAlfCommand& aCommand )
+    { 
+    for ( TInt i = 0 ; i < iEvents.Count() ; i++ )
+        {
+        if ( iEvents[i]->iCommand == &aCommand )
+            {
+            iEvents.Remove( i );
+            iEvents.Compress();
+            break;
+            }
+        }
+    
+    aCommand.ExecuteL( iEnv );
+    }     
+
+// ---------------------------------------------------------------------------
+// Called when foreground status changes.
+// ---------------------------------------------------------------------------
+//    
+void CAlfCommandScheduler::AppicationOnForeground( TBool aForeground )
+    {
+    if ( aForeground )
+        {
+        iFlags |= EAlfSchedulerApplicationForeground;
+        }
+    else
+        {
+        iFlags &= ~EAlfSchedulerApplicationForeground;
+        }
+        
+    UpdateSchedulerState();
+    }
+
+// ---------------------------------------------------------------------------
+// Called when display light status changes.
+// ---------------------------------------------------------------------------
+//    
+void CAlfCommandScheduler::LightStatusChanged(
+    TInt aTarget, 
+    CHWRMLight::TLightStatus aStatus )
+    {
+    if( aTarget&CHWRMLight::EPrimaryDisplay )
+        {
+        if( aStatus == CHWRMLight::ELightOn || 
+            aStatus == CHWRMLight::ELightStatusUnknown )
+            {
+            iFlags |= EAlfSchedulerPrimaryLightsOn;
+            }
+        else if( aStatus == CHWRMLight::ELightOff )
+            {
+            iFlags &= ~EAlfSchedulerPrimaryLightsOn;
+            }
+        else
+            {
+            // for PC lint
+            }
+        }
+        
+    if( aTarget&CHWRMLight::ESecondaryDisplay )
+        {
+        if( aStatus == CHWRMLight::ELightOn || 
+            aStatus == CHWRMLight::ELightStatusUnknown )
+            {
+            iFlags |= EAlfSchedulerSecondaryLightsOn;
+            }
+        else if( aStatus == CHWRMLight::ELightOff )
+            {
+            iFlags &= ~EAlfSchedulerSecondaryLightsOn;
+            }
+        else
+            {
+            // for PC lint
+            }
+        }
+        
+    UpdateSchedulerState();
+    }
+
+// ---------------------------------------------------------------------------
+// Updates scheduling state based on the internal flags.
+// ---------------------------------------------------------------------------
+//    
+void CAlfCommandScheduler::UpdateSchedulerState()
+    {
+    if ( (iFlags&EAlfSchedulerPrimaryLightsOn ||
+          iFlags&EAlfSchedulerSecondaryLightsOn ) && 
+         iFlags&EAlfSchedulerApplicationForeground )
+        {
+        // Run the scheduler
+        Run();
+        }
+    else
+        {
+        // Pause schduler
+        Pause();
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// Restarts the scheduling.
+// ---------------------------------------------------------------------------
+//   
+void CAlfCommandScheduler::Run()
+    {
+    if ( iFlags&EAlfSchedulerRunning )
+        {
+        return; // Already running
+        }
+        
+    iFlags |= EAlfSchedulerRunning;
+
+    for(TInt i = iEvents.Count() - 1; i >= 0; --i)
+        {
+        iEvents[i]->Continue();
+        
+        // Executing a command may have potentially altered the iEvents array,
+        // e.g. application may have canceled other commands when one command was
+        // executed. We must make sure that we don't overindex here !
+        if (i > iEvents.Count() + 1)
+            {
+            i = iEvents.Count();    
+            }
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// Pause scheduling.
+// ---------------------------------------------------------------------------
+//   
+void CAlfCommandScheduler::Pause()
+    {
+    if ( !(iFlags&EAlfSchedulerRunning) )
+        {
+        return; // Already paused
+        }
+
+    iFlags &= ~EAlfSchedulerRunning;
+    for(TInt i = iEvents.Count() - 1; i >= 0; --i)
+        {
+        iEvents[i]->Pause();
+        }
+
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfcontrol.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1149 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Control base class.
+*
+*/
+
+
+
+#include "alf/alfcontrol.h"
+#include "alf/alfcontrolgroup.h"
+#include "alf/alfdisplay.h"
+#include "alf/alfroster.h"
+#include "alf/alfenv.h"
+#include "alf/alfvisualfactory.h"
+#include "alfclient.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfconstants.h"
+#include "alf/alftimedvalue.h"
+#include "alflogger.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+#include <eikappui.h>
+
+// Private structure
+struct CAlfControl::TPrivateData
+    {
+    CAlfEnv* iEnv;                      // Not owned.
+    CAlfControlGroup* iOwnerGroup;      // Not owned.
+    CAlfDisplay* iBoundDisplay;         // Not owned.
+    TInt iId;                           // Owned.
+    TInt iHostId;                       // Owned.
+    TInt iRole;                         // Owned.
+    RPointerArray<CAlfVisual> iVisuals; // Not owned.
+    CAlfControl* iHost;                 // Not owned.
+    struct SConnection
+        {
+        CAlfControl* iControl;          // Not owned.
+        TInt iRole;                     // Owned.
+        };
+    RArray<SConnection> iConnections;   // Owned.
+    TBool iFocusing;                    // Owned.
+    TBool iHasFocus;                    // Owned.
+    CAlfGenComponent* iComms;           // Owned
+    };
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfControl::CAlfControl()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::ConstructL(CAlfEnv& aEnv)
+    {
+    iData = new (ELeave) TPrivateData;
+    
+    iData->iEnv = &aEnv;
+    iData->iFocusing = EFalse;
+    //iData->iId = CAlfStatic::GenerateId();  
+        
+    // NULL data
+    iData->iOwnerGroup = NULL;
+    iData->iBoundDisplay = NULL;
+    iData->iId = 0;
+    iData->iHostId = 0;
+    iData->iRole = 0;
+    iData->iVisuals.Reset();
+    iData->iHost = NULL;
+    iData->iConnections.Reset();
+    iData->iHasFocus = EFalse;
+    iData->iComms = 0;
+    iData->iComms = CAlfGenComponent::NewL(aEnv,
+            EAlfCntrlCreate, 
+            0, 
+            KNullDesC8);
+
+    iData->iId = Identifier(); // to have unique value 
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfControl::~CAlfControl()
+    {
+    if ( iData )
+        { 
+        // Cancel scheduled commands for this control.
+        Env().CancelCustomCommands(this);
+        Env().CancelCommands(this);
+
+        if(iData->iHost)
+            {
+            iData->iHost->RemoveConnection(this);
+            iData->iHost = NULL;
+            }
+
+        for(TInt i = iData->iConnections.Count() - 1; i >= 0; --i)
+            {
+            RemoveConnection(iData->iConnections[i].iControl);
+            }
+        iData->iConnections.Reset();
+
+        // The visuals are owned by the control.
+        iData->iVisuals.ResetAndDestroy();
+        delete iData->iComms;
+        }
+    delete iData;
+    iData = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns server handle
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfControl::Identifier() const
+    {
+    return iData->iComms->Identifier();
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the env
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfEnv& CAlfControl::Env() const
+    {
+    return *iData->iEnv;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Returns control group that this control is in.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfControlGroup* CAlfControl::ControlGroup() const
+    {
+    return iData->iOwnerGroup;
+    }
+    
+// ---------------------------------------------------------------------------
+// Sets the control group
+// ---------------------------------------------------------------------------
+//   
+void CAlfControl::SetControlGroup(CAlfControlGroup& aOwnerGroup)
+    {
+    iData->iOwnerGroup = &aOwnerGroup;
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns bound display
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C CAlfDisplay* CAlfControl::Display() const
+    {
+    return iData->iBoundDisplay;
+    }
+    
+// ---------------------------------------------------------------------------
+// Sets bound display
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C void CAlfControl::BindDisplay(CAlfDisplay& aDisplay)
+    {
+    iData->iBoundDisplay = &aDisplay;
+    }    
+
+// ---------------------------------------------------------------------------
+// Sets control ID.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::SetId(TInt aId)
+    {
+    iData->iId = aId;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns control ID.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfControl::Id() const
+    {
+    return iData->iId;
+    }
+
+// ---------------------------------------------------------------------------
+// Appends new visual
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfControl::Append(CAlfVisual* aVisual, CAlfLayout* aParentLayout)
+    {
+    TInt err = KErrNone;
+    
+    ASSERT(aVisual); // must not be null
+    
+    if(&aVisual->Owner() != this) // ownership cannot be altered here
+        {
+        return KErrNotSupported;
+        }
+    
+    // prevent adding visual several times
+    for (TInt i = iData->iVisuals.Count()-1;i>=0;i--)
+        {
+        if (iData->iVisuals[i] == aVisual)
+            {
+            return KErrAlreadyExists;
+            }
+        }
+
+    // Append the visual to the visuals array.
+    err = iData->iVisuals.Append(aVisual);
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfControl::Append return error %d", err )
+        return err;
+        }
+
+    if(aParentLayout)
+        { // once parent layout has been set, the visual has already relation in shape 
+          // server side, tell the layout that theres no need to synch that info to server 
+          // anymore (latter param)
+        err = aParentLayout->Append(aVisual, ETrue);  
+        if ( err != KErrNone )
+            {
+            __ALFLOGSTRING1( "CAlfControl::Append return error %d", err )
+            // Do cleanup
+            iData->iVisuals.Remove(iData->iVisuals.Find(aVisual));
+            return err;
+            }
+        }
+     /*   
+    if ( iData->iInformServerAboutAppendRemove )
+        {
+        TInt2 params(aVisual->Identifier(), aParentLayout ? aParentLayout ->Identifier() : 0 );
+        TPckgC<TInt2> inPckg(params);
+        TBuf8<1> dum;
+        TInt err = iData->iComms->DoSynchronousCmd( EAlfCntrlAppendVisual, inPckg , dum );
+        if ( err != KErrNone )
+            {
+            __ALFLOGSTRING1( "CAlfControl::Append return error %d", err )
+            // Do cleanup
+            if ( aParentLayout )
+                {
+                aParentLayout->Remove(aVisual);  
+                }
+            iData->iVisuals.Remove(iData->iVisuals.Find(aVisual));
+            return err;
+            }
+        }*/
+
+    TRAP(err, VisualAddedL(aVisual));
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfControl::Append return error %d", err )
+        // Do cleanup
+        if ( aParentLayout )
+            {
+            aParentLayout->Remove(aVisual);
+            }
+        Remove( aVisual );
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Removes visual
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::Remove(CAlfVisual* aVisual)
+    {
+    /*
+    if ( iData->iInformServerAboutAppendRemove && aVisual)
+        {
+        TPckgC<TInt> inPckg(aVisual->Identifier());
+        TBuf8<1> dum;
+        iData->iComms->DoSynchronousCmd( EAlfCntrlRemoveVisual, inPckg , dum );
+        }*/
+    
+    TInt index = iData->iVisuals.Find(aVisual);
+    if(index != KErrNotFound)
+        {
+        VisualRemoved(aVisual);
+        iData->iVisuals.Remove(index);
+        }
+    }
+
+// --------------------------------------------------------------------------
+// Creates and appends new visual
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfVisual* CAlfControl::AppendVisualL(TAlfVisualType aVisualType,
+                                                CAlfLayout* aParentLayout,
+                                                TInt aImplementationUid )
+    {
+    CAlfVisual* visual = AlfVisualFactory::NewVisualLC(aVisualType, 
+                                        aParentLayout, *this, *iData->iEnv, aImplementationUid);
+                                                             
+    TInt err = Append(visual, aParentLayout);
+    User::LeaveIfError( err );
+    CleanupStack::Pop(visual);
+    return visual;
+    }
+
+// ---------------------------------------------------------------------------
+// Creates and appends new layout
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfLayout* CAlfControl::AppendLayoutL(TAlfLayoutType aLayoutType,
+                                                CAlfLayout* aParentLayout,
+                                                TInt aImplementationUid)
+    {
+    CAlfLayout* layout = AlfVisualFactory::NewLayoutLC(aLayoutType,
+                        aParentLayout, *this, *iData->iEnv, aImplementationUid);
+     
+    TInt err = Append(layout, aParentLayout);
+    User::LeaveIfError( err );
+    CleanupStack::Pop(layout);
+    return layout;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns indexed visual
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfVisual& CAlfControl::Visual(TInt aIndex) const
+    {
+    return *iData->iVisuals[aIndex];
+    }
+
+// ---------------------------------------------------------------------------
+// Returns visual count.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfControl::VisualCount() const
+    {
+    return iData->iVisuals.Count();
+    }
+
+// ---------------------------------------------------------------------------
+// Finds visual with given tag.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfVisual* CAlfControl::FindTag(const TDesC8& aTag) const
+    {
+    ASSERT(iData);
+
+    for(TInt i = 0; i < iData->iVisuals.Count(); ++i)
+        {
+        if(iData->iVisuals[i]->TagMatches(aTag))
+            {
+            return iData->iVisuals[i];
+            }
+        }   
+        
+    return NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Returns host.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfControl* CAlfControl::Host() const
+    {
+    return iData->iHost;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets host.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::SetHost(CAlfControl* aHost)
+    {
+    // do not call this function directly. This should be only called by the 
+    // AddConnectionL and RemoveConnection functions.
+    
+    if ( aHost )
+        {    
+        // When adding a host, the host must be aware of this connection first.
+        __ASSERT_ALWAYS( aHost->FindConnection(this) != KErrNotFound, USER_INVARIANT() );
+        }
+    
+    TRAPD(err, HostChangingL(aHost));
+    if(err != KErrNone)
+        {
+        if(aHost)
+            {
+            RemoveVisualsFromHostControl(*aHost);
+            }
+        return;
+        }
+
+    iData->iHost = aHost;
+    }
+
+// ---------------------------------------------------------------------------
+// Adds control connection.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::AddConnectionL(CAlfControl* aConnectedControl, TInt aRole)
+    {
+    // check that the connection does not exist:
+    if ( FindConnection( aConnectedControl ) != KErrNotFound )
+        {
+        User::Leave( KErrAlreadyExists );
+        }
+    
+    TPrivateData::SConnection client;
+    client.iControl = aConnectedControl;
+    client.iRole = aRole;
+    User::LeaveIfError(iData->iConnections.Append(client));
+
+    // This control is now the client's host.
+    aConnectedControl->SetHost(this);
+
+    ConnectionAddedL(aConnectedControl, aRole);
+    }
+
+// ---------------------------------------------------------------------------
+// Removes control connection
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::RemoveConnection(CAlfControl* aConnectedControl)
+    {
+    for(TInt i = 0; i < iData->iConnections.Count(); ++i)
+        {
+        if(iData->iConnections[i].iControl == aConnectedControl)
+            {
+            aConnectedControl->SetHost(NULL);
+            const TInt role = iData->iConnections[i].iRole;
+            iData->iConnections.Remove(i);
+            
+            ConnectionRemoved(aConnectedControl, role);
+            return;
+            }
+        }
+    // The client must exist.
+    USER_INVARIANT();
+    }
+
+// ---------------------------------------------------------------------------
+// Returns connection count
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfControl::ConnectionCount() const
+    {
+    return iData->iConnections.Count();
+    }
+
+// ---------------------------------------------------------------------------
+// Returns indexed connection.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfControl& CAlfControl::Connection(TInt aIndex) const
+    {
+    return *iData->iConnections[aIndex].iControl;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns ordinal-indexed connection.
+// @deprecated
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfControl& CAlfControl::ConnectionByOrdinal(TInt aOrdinal) const
+    {
+    // First look based on role.
+    for(TInt i = 0; i < iData->iConnections.Count(); ++i)
+        {
+        if(iData->iConnections[i].iRole == aOrdinal + 1)
+            {
+            return *iData->iConnections[i].iControl;
+            }
+        }
+
+    // Fall back to index.
+    return Connection(aOrdinal);
+    }
+
+// ---------------------------------------------------------------------------
+// Returns given connection index.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfControl::FindConnection(const CAlfControl* aConnected) const
+    {
+    for(TInt i = 0; i < iData->iConnections.Count(); ++i)
+        {
+        if(iData->iConnections[i].iControl == aConnected)
+            {
+            return i;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns connection role
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfControl::ConnectionRole(TInt aIndex) const
+    {
+    return iData->iConnections[aIndex].iRole;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns connection ordinal
+// @deprecated
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfControl::ConnectionOrdinal(TInt aIndex) const
+    {
+    if(iData->iConnections[aIndex].iRole)
+        {
+        return iData->iConnections[aIndex].iRole - 1;
+        }
+    return aIndex;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns role
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfControl::Role() const
+    {
+    /*if(iHost)
+        {
+        return iHost->ClientRole(iHost->FindClient(this));
+        }
+    // Zero is the default role.
+    return 0;*/
+    return iData->iRole;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets role
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::SetRole(TInt aRole)
+    {
+    iData->iRole = aRole;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns host ID.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfControl::HostId() const
+    {
+    return iData->iHostId;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets host ID
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::SetHostId(TInt aHostId)
+    {
+    // If adding automatic visual host, there cannot be already one defined.
+    __ASSERT_ALWAYS( !iData->iHost, USER_INVARIANT() );
+    
+    iData->iHostId = aHostId;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns container layout if set.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfLayout* CAlfControl::ContainerLayout(const CAlfControl* /*aConnected*/) const
+    {
+    // Generic controls aren't able to provide container layouts.
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Called when new visual is added.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::VisualAddedL(CAlfVisual* aVisual)
+    {
+    // Add the new visual to the container layout.
+    if(iData->iHost && !aVisual->Layout())
+        {
+        CAlfLayout* container = iData->iHost->ContainerLayout(this);
+        if(container)
+            {
+            User::LeaveIfError( container->Append(aVisual) );
+            }
+        }
+    else
+        {
+        // @todo Calling ShowVisualL panics the server, becuase it has
+        // been called already on the construction.
+        /*
+        // If the control has been bound to a display (for example, when
+        // the control is shown), new visuals will be automatically shown.
+        if( iData->iBoundDisplay && 
+                (iData->iOwnerGroup && 
+                 iData->iBoundDisplay->Roster().Find(
+                    *iData->iOwnerGroup) != KErrNotFound) && 
+           !aVisual->Layout() && !aVisual->Display())
+            {
+            iData->iBoundDisplay->Roster().ShowVisualL(*aVisual);
+            }
+            */
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Called when visual is removed.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::VisualRemoved(CAlfVisual* aVisual)
+    {
+    // Add the new visual to the container layout.
+    if(iData->iHost)
+        {
+        CAlfLayout* container = iData->iHost->ContainerLayout(this);
+        if(container && aVisual->Layout() == container )
+            {
+            container->Remove(aVisual);
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Called when connection is added.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::ConnectionAddedL(CAlfControl* /*aConnectedControl*/, TInt /*aRole*/)
+    {
+    // Do nothing.
+    }
+
+// ---------------------------------------------------------------------------
+// Called when connection is removed.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::ConnectionRemoved(CAlfControl* /*aConnectedControl*/, TInt /*aRole*/)
+    {
+    // Do nothing.
+    }
+
+// ---------------------------------------------------------------------------
+// Removes visual from layout.
+// ---------------------------------------------------------------------------
+//
+void CAlfControl::RemoveVisualsFromHostControl( CAlfControl& aHostControl )
+    {
+    __ASSERT_ALWAYS( &aHostControl != this, USER_INVARIANT() );
+    
+    // Remove the visuals.
+    for(TInt i = 0; i < iData->iVisuals.Count(); ++i)
+        {
+        if ( iData->iVisuals[i]->Layout() && &iData->iVisuals[i]->Layout()->Owner() == &aHostControl )
+            {
+            iData->iVisuals[i]->Layout()->Remove(iData->iVisuals[i]);
+            
+            // If the own control group is showing still in some roster,
+            // we need to add the root visuals over there
+            /* // do we need this?
+            if ( iBoundDisplay )
+                {
+                TRAP_IGNORE( iBoundDisplay->Roster().ShowVisualL( iVisuals[i] ) );
+                }*/
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Called when the host is about to change
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::HostChangingL(CAlfControl* aNewHost)
+    {
+    CAlfLayout* newContainer = 0;
+    TInt i = 0;
+
+    if(aNewHost)
+        {
+        // The container layout provided by the new host.
+        newContainer = aNewHost->ContainerLayout(this);
+        }
+
+    if(iData->iHost)
+        {
+        // There is a previous host.
+        // Remove the visuals.
+        RemoveVisualsFromHostControl(*iData->iHost);
+        }
+
+    if(newContainer)
+        {
+        for(i = 0; i < iData->iVisuals.Count(); ++i)
+            {
+            // Only the visuals that aren't already attached to a layout
+            // are added to the container layout.
+            if(!iData->iVisuals[i]->Layout())
+                {
+                User::LeaveIfError( newContainer->Append(iData->iVisuals[i]) );
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Shows conttol on the given display
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::ShowL(CAlfDisplay& aDisplay)
+    {
+    if(HostId())
+        {
+        CAlfControl* host = Env().FindControl(HostId());
+
+        if(host)
+            {
+            host->AddConnectionL(this, Role());
+            }
+        else
+            {
+            /** @todo Leave? */
+            }
+        }
+
+    BindDisplay(aDisplay);
+
+    // @todo: do we need this? the roster::show is already passed
+    // to the server side, which call the same thing.
+    
+    // Show all the visuals on the specified display.
+    for(TInt i = 0; i < iData->iVisuals.Count(); ++i)
+        {
+
+        // Set the display of the root visual
+        if( !iData->iVisuals[i]->Layout() )
+            {
+            iData->iVisuals[i]->SetDisplay( &aDisplay );
+            }
+        }
+        
+    NotifyControlVisibility(ETrue, aDisplay);
+    }
+
+// ---------------------------------------------------------------------------
+// Hides control from the given display
+// ---------------------------------------------------------------------------
+//
+void CAlfControl::Hide(CAlfDisplay& aDisplay)
+    {
+    NotifyControlVisibility(EFalse, aDisplay);
+    
+    // Hide all the visuals on the specified display.
+    for(TInt i = 0; i < iData->iVisuals.Count(); ++i)
+        {
+        // The visuals that are part of a layout will be shown when the
+        // layout is shown.
+        if(!iData->iVisuals[i]->Layout() && iData->iVisuals[i]->Display() == &aDisplay)
+            {
+            aDisplay.Roster().HideVisual(*iData->iVisuals[i]);
+            }
+        }
+
+    // Relinquish focus on this display
+    CAlfRoster& roster = aDisplay.Roster();
+    if ( roster.FocusedControl() == this )
+        {
+        roster.ClearFocus();
+        }
+    
+    // Unbind from display?
+    if(iData->iBoundDisplay == &aDisplay)
+        {
+        iData->iBoundDisplay = NULL;
+        }
+
+    // Unlink from parent control.
+    if(Host() && HostId() )
+        {
+        Host()->RemoveConnection(this);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Called when visibility changes.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::NotifyControlVisibility(TBool /*aIsVisible*/, 
+                                                   CAlfDisplay& /*aDisplay*/)
+    {
+    // Nothing to do by default.
+    }
+
+// ---------------------------------------------------------------------------
+// Converts point from relative to absolute coordinates
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TPoint CAlfControl::HostToDisplay(const TPoint& aPoint) const
+    {
+    if(!iData->iHost)
+        {
+        return aPoint;
+        }
+
+    CAlfLayout* container = iData->iHost->ContainerLayout(this);
+
+    return container->LocalToDisplay(aPoint) + container->Pos().Target();
+    }
+
+// ---------------------------------------------------------------------------
+// Converts point from absolute to relative coordinates
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TPoint CAlfControl::DisplayToHost(const TPoint& aPoint) const
+    {
+    if(!iData->iHost)
+        {
+        return aPoint;
+        }
+
+    CAlfLayout* container = iData->iHost->ContainerLayout(this);
+
+    return container->DisplayToLocal(aPoint) - container->Pos().Target();
+    }
+
+// ---------------------------------------------------------------------------
+// Returns bounding rect.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TRect CAlfControl::Bounds() const
+    {
+    TPoint min;
+    TPoint max;
+
+    min.iX = KMaxTInt;
+    min.iY = KMaxTInt;
+    max.iX = KMinTInt;
+    max.iY = KMinTInt;
+
+    for(TInt i = 0; i < iData->iVisuals.Count(); ++i)
+        {
+        TRect visualRect = iData->iVisuals[i]->DisplayRectTarget();
+
+        min.iX = Min(min.iX, visualRect.iTl.iX);
+        min.iY = Min(min.iY, visualRect.iTl.iY);
+        max.iX = Max(max.iX, visualRect.iBr.iX);
+        max.iY = Max(max.iY, visualRect.iBr.iY);
+        }
+
+    return TRect(min, max);
+    }
+
+// ---------------------------------------------------------------------------
+// Is the given point inside the control area?
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfControl::HitTest(const TPoint& aPoint) const
+    {
+    return Bounds().Contains(aPoint);
+    }
+
+    
+// ---------------------------------------------------------------------------
+// Tries to get the focus.
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfControl::AcquireFocus()
+    {
+    if ( !AcceptInput() ) // Cannot take focus to this control
+        {
+        return;
+        }
+
+    // Focus is set set separately in each display the control has visuals in.
+    // Find all the displays
+    RPointerArray<CAlfDisplay> displays;
+    for(TInt i = 0; i < iData->iVisuals.Count(); ++i)
+        {
+        if(iData->iVisuals[i]->Display())
+            {
+            // Do not allow duplicates. Ignore error.
+            (void)displays.InsertInAddressOrder( iData->iVisuals[i]->Display() );
+            }
+        }
+    
+    // go through the displays
+    for ( TInt d = 0 ; d < displays.Count() ; d++ )
+        {
+        if ( displays[d]->Roster().FocusedControl() != this )
+            {
+            displays[d]->Roster().SetFocus(*this );
+            }
+        }
+    
+    displays.Close();
+    }   
+
+// ---------------------------------------------------------------------------
+// Attempt to remove the focus from this control
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfControl::RelinquishFocus()
+    {
+    // Focus needs to be removed from all displays that the control has visuals in
+    for(TInt i = 0; i < iData->iVisuals.Count(); ++i)
+        {
+        if(iData->iVisuals[i]->Display())
+            {
+            // This method should have no effect on rosters where this does not match the currently focused control
+            CAlfRoster& roster = iData->iVisuals[i]->Display()->Roster();
+            if ( roster.FocusedControl() == this )
+                {
+                roster.ClearFocus(); // Potentially called repeatedly for each visual. Optimization is in CAlfRoster
+                }
+            }
+        }
+    }   
+// ---------------------------------------------------------------------------
+// Does this control have focus?
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfControl::Focus() const
+    {
+    return iData->iHasFocus;
+    }
+
+// ---------------------------------------------------------------------------
+// Is one of the child focused?
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C CAlfControl* CAlfControl::FocusedConnection() const
+    {
+    CAlfControl* focusChild = NULL;
+    
+    const TInt connectionCount = ConnectionCount();
+    for ( TInt c = 0 ; c < connectionCount && !focusChild ; c++ )
+        {
+        CAlfControl& childConnection =  Connection(c);
+        if ( childConnection.Focus() || childConnection.FocusedConnection() )
+            {
+            focusChild = &childConnection;
+            }
+        }
+        
+    return focusChild;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//      
+void CAlfControl::FocusChainChanged( TBool aInFocusChain )
+    {
+    TAny* pInFocusChain = &aInFocusChain;
+    PropertyOwnerExtension( KUidAlfPropOwnerExtControlFocusChainChanged, &pInFocusChain );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets focus
+// ---------------------------------------------------------------------------
+//
+void CAlfControl::SetFocus(CAlfDisplay& aDisplay, TBool aHasFocus)
+    {
+    if ( ( iData->iHasFocus && !aHasFocus ) || 
+         ( !iData->iHasFocus && aHasFocus ) )
+        {
+        iData->iHasFocus = aHasFocus;
+        FocusChanged(aDisplay, aHasFocus);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Is focusing control?
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfControl::IsFocusing() const
+    {
+    return iData->iFocusing;
+    }
+
+// ---------------------------------------------------------------------------
+// Set is focusing control.
+// ---------------------------------------------------------------------------
+//
+void CAlfControl::SetFocusing(TBool aFocusing)
+    {
+    iData->iFocusing = aFocusing;
+    }
+
+// ---------------------------------------------------------------------------
+// Called when focus changes.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::FocusChanged(CAlfDisplay& /*aDisplay*/, TBool /*aFocused*/)
+    {
+    // Do nothing by default.
+    }
+
+// ---------------------------------------------------------------------------
+// Does control group accept input?
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfControl::AcceptInput() const
+    {
+    if(iData->iOwnerGroup)
+        {
+        return iData->iOwnerGroup->AcceptInput();
+        }
+    return ETrue;    
+    }
+
+
+// ---------------------------------------------------------------------------
+// Called when event is received.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfControl::OfferEventL(const TAlfEvent& /*aEvent*/)
+    {
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns control area.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TRect CAlfControl::DisplayArea() const
+    {
+    if(iData->iBoundDisplay)
+        {
+        return iData->iBoundDisplay->VisibleArea();
+        }
+    
+    // The first visual shown on a display determines the display area.            
+    for(TInt i = 0; i < iData->iVisuals.Count(); ++i)
+        {
+        if(iData->iVisuals[i]->Display())
+            {
+            return iData->iVisuals[i]->Display()->VisibleArea();
+            }
+        }
+        
+    if(!Env().DisplayCount())
+        {
+        // No displays created in the environment yet. Assume device 
+        // native resolution.
+        //return TRect(TPoint(0, 0), AlfUtil::ScreenSize());
+        CCoeEnv* coe = CCoeEnv::Static();
+        if ( coe )
+            {
+            return static_cast<CEikAppUi*>(coe->AppUi())->ClientRect(); 
+            }
+        else
+            {
+            return TRect( 0,0,0,0 );
+            }
+        }
+        
+    // Assume it is the primary display, then.   
+    return Env().PrimaryDisplay().VisibleArea();
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the center point of the area.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfRealPoint CAlfControl::DisplayCenter() const
+    {
+    TRect area(DisplayArea());
+    return area.iTl + TAlfRealPoint(area.Width()/2.f, area.Height()/2.f);
+    }
+
+// ---------------------------------------------------------------------------
+// Cancels all commands
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::CancelAllCommands()
+    {
+    iData->iEnv->CancelCustomCommands(this);
+    iData->iEnv->CancelCommands(this);
+    
+    for(TInt i = 0; i < iData->iVisuals.Count(); ++i)
+        {
+        iData->iEnv->CancelCommands(iData->iVisuals[i]);
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Clear flag.
+// ---------------------------------------------------------------------------
+//
+void CAlfControl::ClearChanged()
+    { // todo: does client need to access this information
+    }
+
+// ---------------------------------------------------------------------------
+// Called when layout changes.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::VisualDestroyed(CAlfVisual& aVisual)
+    {
+    // If called from CAlfVisual::RemoveAndDestroyAllD the server
+    // side object is removed also automatically. Otherwise not..
+    Remove(&aVisual);
+    }
+
+// ---------------------------------------------------------------------------
+// Called when visual layout is updated (see visual flags)
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControl::VisualLayoutUpdated(CAlfVisual& /*aVisual*/)
+    {
+    
+    }
+  
+// ---------------------------------------------------------------------------
+// Called when draw preparation failed (not implemented currenltly)
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfControl::VisualPrepareDrawFailed(CAlfVisual& /*aVisual*/, TInt /*aErrorCode*/)
+    {
+    
+    }
+
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfControl::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfPropertyOwner::PropertyOwnerExtension(aExtensionUid, aExtensionParams);
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfcontrolgroup.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,335 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Control group
+*
+*/
+
+
+
+#include "alf/alfcontrolgroup.h"
+#include "alfcontrolgroupsubsession.h"
+#include "alf/alfcontrol.h" 
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alf/alftransformation.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+// used flags
+enum TAlfControlGroupFlags
+    {
+    EAlfControlGroupAllowInput =        0x01
+    };
+
+// private data
+struct CAlfControlGroup::TPrivateData
+    {
+    RAlfControlGroupSubSession iControlGroupSubSession; // Owned
+    TUint iFlags;                           // Owned.
+    TInt iResourceId;                       // Owned.
+    CAlfEnv* iEnv;                          // Not owned.
+    RPointerArray<CAlfControl> iControls;   // Owned.
+    CAlfTransformation* iTransform;         // Owned.
+    CAlfDisplay* iBoundDisplay;				// Not owned.
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfControlGroup::CAlfControlGroup()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfControlGroup::ConstructL(TInt aResourceId, CAlfEnv& aEnv)
+    {
+    iData = new (ELeave) TPrivateData;
+    
+    User::LeaveIfError(
+        iData->iControlGroupSubSession.Open(aEnv.Client(), aResourceId) );
+    
+    iData->iFlags = EAlfControlGroupAllowInput;
+    iData->iEnv = &aEnv;
+    //iData->iOpacity.Set(1.0);
+    iData->iResourceId = aResourceId;
+    iData->iTransform = NULL;
+    iData->iBoundDisplay = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfControlGroup::~CAlfControlGroup()
+    {
+    if ( iData )
+        {
+        iData->iControls.ResetAndDestroy();
+        
+        delete iData->iTransform;
+        iData->iTransform = NULL;
+        
+        iData->iControlGroupSubSession.Close();
+        }
+    
+    delete iData;
+    iData = NULL;
+    }
+  
+// ---------------------------------------------------------------------------
+// Returns server side handle
+// ---------------------------------------------------------------------------
+//  
+TInt CAlfControlGroup::Identifier() const
+    {
+    return iData->iControlGroupSubSession.SubSessionHandle();
+    }
+
+// ---------------------------------------------------------------------------
+// Binds this control group to the given display.
+// ---------------------------------------------------------------------------
+//
+void CAlfControlGroup::BindDisplay(CAlfDisplay* aDisplay)
+	{
+	iData->iBoundDisplay = aDisplay;
+	}
+
+// ---------------------------------------------------------------------------
+// Returns ID.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfControlGroup::ResourceId() const
+    {
+    return iData->iResourceId;
+    }
+
+// ---------------------------------------------------------------------------
+// Appends a control
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfControlGroup::AppendL(CAlfControl* aControl)
+    {
+    TInt err = KErrNone;
+    
+    User::LeaveIfError( iData->iControls.Append(aControl) );
+        
+    // Update server side:
+    err = iData->iControlGroupSubSession.Append( aControl->Identifier() );
+    if ( err != KErrNone )
+        {
+        iData->iControls.Remove( iData->iControls.Count()-1 );
+        User::LeaveIfError( err );
+        }
+    
+    // Show the appended control if the control group was shown.
+    if ( iData->iBoundDisplay )
+    	{
+        TRAP( err, aControl->ShowL( *iData->iBoundDisplay ));    	
+    	}
+
+    // If a leave occurred remove the control from client and server side control group.
+    if ( err != KErrNone )
+        {        
+        iData->iControlGroupSubSession.Remove( aControl->Identifier() );
+        iData->iControls.Remove( iData->iControls.Count()-1 );
+        User::LeaveIfError( err );
+        }
+    
+    // Everything OK.
+    aControl->SetControlGroup(*this);    
+    }
+ 
+// ---------------------------------------------------------------------------
+// Removes a control
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C TInt CAlfControlGroup::Remove(CAlfControl* aControl)
+    {
+    // Update server side:
+    TInt err = iData->iControlGroupSubSession.Remove( aControl->Identifier() );
+    
+    // Update own array if server side is OK.
+    if ( err == KErrNone )
+        {
+        // If found on the server side, we must find it also from the client side.
+        TInt index = iData->iControls.Find(aControl);
+        __ASSERT_DEBUG( index != KErrNotFound, USER_INVARIANT() );
+        if(index != KErrNotFound)
+            {
+            iData->iControls.Remove(index);
+            }
+        else
+            {
+            err = KErrNotFound;
+            }
+        }
+    else
+        {
+        // If we cannot find it from the server side, we must not find it on the client side.
+        __ASSERT_DEBUG( iData->iControls.Find(aControl) == KErrNotFound , USER_INVARIANT() );
+        }
+    
+    if ( err == KErrNone )
+        {
+        CAlfControlGroup* dummy = NULL;
+        aControl->SetControlGroup(*dummy);
+        
+        // Hide the control, if this control group has been visible
+        if( iData->iBoundDisplay )
+        	{
+        	aControl->Hide( *iData->iBoundDisplay );
+        	}
+        }
+    
+    return err;
+    }
+   
+// ---------------------------------------------------------------------------
+// Accepts input?
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TBool CAlfControlGroup::AcceptInput() const
+    {
+    return iData->iFlags&EAlfControlGroupAllowInput;
+    }
+    
+// ---------------------------------------------------------------------------
+// Set accepts input
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfControlGroup::SetAcceptInput(TBool aAcceptInput) 
+    {
+    if ( aAcceptInput )
+        {
+        iData->iFlags|=EAlfControlGroupAllowInput;
+        }
+    else
+        {
+        iData->iFlags&=~EAlfControlGroupAllowInput;
+        }
+    }
+   
+// ---------------------------------------------------------------------------
+// Finds control by ID
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfControl* CAlfControlGroup::FindControl(TInt aId, TBool aUserId) const
+    {
+    for(TInt i = 0; i < iData->iControls.Count(); ++i)
+        {
+        if( (aUserId?
+            iData->iControls[i]->Id():
+            iData->iControls[i]->Identifier()) 
+                == aId)
+            {
+            return iData->iControls[i];
+            }
+        }
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns control count.
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C TInt CAlfControlGroup::Count() const
+    {
+    return iData->iControls.Count();
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns indexed control
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C CAlfControl& CAlfControlGroup::Control(TInt aIndex) const
+    {
+    return *iData->iControls[aIndex];
+    }
+
+// ---------------------------------------------------------------------------
+// Enables transformation.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfControlGroup::EnableTransformationL(TBool aIsTransformed)
+    {
+    if ( aIsTransformed && iData->iTransform )
+        {
+        // Already enabled
+        return;
+        }
+    
+    if ( !aIsTransformed && !iData->iTransform )
+        {
+        // Already disabled
+        return;
+        }
+    
+    if ( aIsTransformed )
+        {
+        iData->iTransform = CAlfTransformation::NewL(*iData->iEnv);
+        }
+   
+    // use the server handle from the transformation object if present
+    TInt transformationHandle = 
+        iData->iTransform ? 
+            iData->iTransform->ServerHandle() : 
+            0 ;
+            
+    // send the message to the server
+    TInt err = iData->iControlGroupSubSession.EnableTransformation(
+        transformationHandle,
+        aIsTransformed );
+     
+    if ( err == KErrNone && !aIsTransformed )
+        {
+        delete iData->iTransform;
+        iData->iTransform = NULL;
+        }
+    
+    if ( err != KErrNone )
+        {
+        delete iData->iTransform;
+        iData->iTransform = NULL;
+        User::Leave( err );
+        }
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// Returns is transformation enabled
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TBool CAlfControlGroup::IsTransformed() const
+    {
+    return iData->iTransform != 0;
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns transformation
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C CAlfTransformation& CAlfControlGroup::Transformation()
+    {
+    __ASSERT_ALWAYS( iData->iTransform, USER_INVARIANT() );
+    return *iData->iTransform;        
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfcontrolgroupsubsession.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Sub-session for control group
+*
+*/
+
+
+
+#include "alfcontrolgroupsubsession.h"
+#include "alf/alfconstants.h"
+#include "alflogger.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Opens subsession
+// ---------------------------------------------------------------------------
+//
+TInt RAlfControlGroupSubSession::Open( RAlfClient& aSession, TInt aId )
+    {
+    TAlfImplementationInformation info(EAlfControlGroupSubSessionOpen);
+    TPckgC<TAlfImplementationInformation> infoBuf(info);
+
+    return CreateSubSession( 
+        aSession,
+        EAlfCreateSubSession,
+        TIpcArgs(&infoBuf, aId) );
+    }
+ 
+// ---------------------------------------------------------------------------
+// Closes subsession
+// ---------------------------------------------------------------------------
+//   
+void RAlfControlGroupSubSession::Close()
+    {
+    CloseSubSession( EAlfCloseSubSession );
+    }
+
+// ---------------------------------------------------------------------------
+// Appends control
+// ---------------------------------------------------------------------------
+// 
+TInt RAlfControlGroupSubSession::Append( TInt aControlHandle )
+    {
+    TInt err =  SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfControlGroupAppend, aControlHandle) );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfControlGroupSubSession::Append return error %d", err )
+        }
+    return err;
+    }
+    
+// ---------------------------------------------------------------------------
+// Removes a control
+// ---------------------------------------------------------------------------
+// 
+TInt RAlfControlGroupSubSession::Remove( TInt aControlHandle )
+    {
+    TInt err =  SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfControlGroupRemove, aControlHandle) );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfControlGroupSubSession::Remove return error %d", err )
+        }
+    return err;
+    }
+    
+
+// ---------------------------------------------------------------------------
+// Enables transformation.
+// ---------------------------------------------------------------------------
+// 
+TInt RAlfControlGroupSubSession::EnableTransformation(
+        TInt aTransformationHandle,
+        TBool aIsTransformed )
+    {
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs( EAlfControlGroupEnableTransformation, aIsTransformed, aTransformationHandle) );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfControlGroupSubSession::EnableTransformation return error %d", err )
+        }
+    return err;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfcurvepath.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,439 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Curve paths are composed of path segments
+*                and can be used as mapping functions, and in line visuals.
+*
+*/
+
+
+
+#include "alf/alfcurvepath.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfconstants.h"
+#include "alflogger.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+struct CAlfCurvePath::TPrivateData
+    {
+    CAlfGenComponent* iComms; // Own
+    TAlfTimedPoint iOffset; // Own.
+    };
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfCurvePath::CAlfCurvePath()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Second phase constructor.
+// ---------------------------------------------------------------------------
+//
+void CAlfCurvePath::ConstructL( CAlfEnv& aEnv, TInt aCurvePathProviderHandle )
+    {
+    iData = new (ELeave) TPrivateData;
+
+    iData->iComms = NULL;
+    
+    TPckgC<TInt> constructionParamBuf( aCurvePathProviderHandle );
+    iData->iComms = CAlfGenComponent::NewL(
+        aEnv,
+        EAlfCurvePathCreate, 
+        0, 
+        constructionParamBuf );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfCurvePath* CAlfCurvePath::NewL( CAlfEnv& aEnv, TInt aCurvePathProviderHandle )
+    {
+    CAlfCurvePath* self = CAlfCurvePath::NewLC(aEnv, aCurvePathProviderHandle);
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor, leave on cleanup stack
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfCurvePath* CAlfCurvePath::NewLC( CAlfEnv& aEnv, TInt aCurvePathProviderHandle )
+    {
+    CAlfCurvePath* self = new( ELeave ) CAlfCurvePath;
+    CleanupStack::PushL( self );
+    self->ConstructL(aEnv,aCurvePathProviderHandle);
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfCurvePath::~CAlfCurvePath()
+    {
+    if ( iData )
+        {
+        delete iData->iComms;
+        iData->iComms = NULL;
+        }
+        
+    delete iData;
+    iData = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Reset path
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCurvePath::Reset()
+    {
+    TBufC8<1> inDummy;
+    TBuf8<1> outDummy;
+    
+    TInt err = iData->iComms->DoSynchronousCmd(
+        EAlfCurvePathReset, 
+        inDummy, 
+        outDummy );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfCurvePath::Reset panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Enable closed loop path
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCurvePath::EnableLoop(TBool aEnable)
+    {
+    TPckgC<TBool> inBuf( aEnable );
+    TBuf8<1> outDummy;
+    
+    TInt err = iData->iComms->DoSynchronousCmd(
+        EAlfCurvePathEnableLoop, 
+        inBuf, 
+        outDummy );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfCurvePath::EnableLoop panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Is path a loop
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfCurvePath::Loop() const
+    {
+    TBool result = EFalse;
+    TPckg<TBool> outBuf( result );
+    
+    TInt err = iData->iComms->DoSynchronousCmd(
+        EAlfCurvePathLoop, 
+        KNullDesC8(), 
+        outBuf );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfCurvePath::Loop panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return result;
+    }
+    
+// ---------------------------------------------------------------------------
+// Set origin of path
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCurvePath::SetOrigin(TReal32 aPosOrigin) __SOFTFP
+    {
+    TPckgC<TReal32> inBuf( aPosOrigin );
+    TBuf8<1> outDummy;
+    
+    TInt err = iData->iComms->DoSynchronousCmd(
+        EAlfCurvePathSetOrigin, 
+        inBuf, 
+        outDummy );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfCurvePath::SetOrigin panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+   
+// ---------------------------------------------------------------------------
+// Add line segment
+// @deprecated
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfCurvePath::AppendLineL(
+    const TPoint& aStart, 
+    const TPoint& aEnd,
+    TReal32 aLength ) __SOFTFP
+    {
+    TAlfCurvePathLineParams params;
+    params.iStart = aStart;
+    params.iEnd = aEnd;
+    params.iLength = aLength;
+    
+    TPckgC<TAlfCurvePathLineParams> inBuf( params );
+    TBuf8<1> outDummy;
+    
+    TInt err = iData->iComms->DoSynchronousCmd(
+        EAlfCurvePathAppendLine, 
+        inBuf, 
+        outDummy );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfCurvePath::AppendLineL panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Add line segment
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfCurvePath::AppendLineL(
+    const TAlfRealPoint& aStart, 
+    const TAlfRealPoint& aEnd,
+    TReal32 aLength ) __SOFTFP
+    {
+    TAlfCurvePathLineRealParams params;
+    params.iStart = aStart;
+    params.iEnd = aEnd;
+    params.iLength = aLength;
+    
+    TPckgC<TAlfCurvePathLineRealParams> inBuf( params );
+    TBuf8<1> outDummy;
+    
+    TInt err = iData->iComms->DoSynchronousCmd(
+        EAlfCurvePathAppendLine2, 
+        inBuf, 
+        outDummy );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfCurvePath::AppendLineL panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Add arc
+// @deprecated
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCurvePath::AppendArcL(
+    const TPoint& aOrigin, 
+    const TSize& aSize,
+    TReal32 aStartAngle, 
+    TReal32 aEndAngle,
+    TReal32 aLength ) __SOFTFP
+    {
+    TAlfCurvePathArcParams params;
+    params.iOrigin = aOrigin;
+    params.iSize = aSize;
+    params.iStartAngle = aStartAngle;
+    params.iEndAngle = aEndAngle;
+    params.iLength = aLength;
+    
+    TPckgC<TAlfCurvePathArcParams> inBuf( params );
+    TBuf8<1> outDummy;
+    
+    TInt err = iData->iComms->DoSynchronousCmd(
+        EAlfCurvePathAppendArc, 
+        inBuf, 
+        outDummy );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfCurvePath::AppendArcL panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// Add arc
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCurvePath::AppendArcL(
+    const TAlfRealPoint& aOrigin, 
+    const TAlfRealSize& aSize,
+    TReal32 aStartAngle, 
+    TReal32 aEndAngle,
+    TReal32 aLength ) __SOFTFP
+    {
+    TAlfCurvePathArcRealParams params;
+    params.iOrigin = aOrigin;
+    params.iSize = aSize;
+    params.iStartAngle = aStartAngle;
+    params.iEndAngle = aEndAngle;
+    params.iLength = aLength;
+    
+    TPckgC<TAlfCurvePathArcRealParams> inBuf( params );
+    TBuf8<1> outDummy;
+    
+    TInt err = iData->iComms->DoSynchronousCmd(
+        EAlfCurvePathAppendArc2, 
+        inBuf, 
+        outDummy );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfCurvePath::AppendArcL panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// Get length of curved path
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C TReal32 CAlfCurvePath::Length() const __SOFTFP
+    {
+    TReal32 result = 0.0;
+    TPckg<TReal32> outBuf( result );
+    
+    TInt err = iData->iComms->DoSynchronousCmd(
+        EAlfCurvePathLength, 
+        KNullDesC8(), 
+        outBuf );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfCurvePath::Length panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return result;
+    }
+   
+// ---------------------------------------------------------------------------
+// Calculate a point on the path
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfCurvePath::Evaluate(TReal32 aPos, TAlfRealPoint& aPoint) const __SOFTFP
+    {
+    TPckgC<TReal32> inBuf( aPos );
+    TPckg<TAlfRealPoint> outBuf( aPoint );
+    
+    TInt err = iData->iComms->DoSynchronousCmd(
+        EAlfCurvePathEvaluate, 
+        inBuf, 
+        outBuf );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfCurvePath::Evaluate panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Get offset of path
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C const TAlfTimedPoint& CAlfCurvePath::Offset() const
+    {
+    TPckg<TAlfTimedPoint> outBuf( iData->iOffset );
+    
+    TInt err = iData->iComms->DoSynchronousCmd(
+        EAlfCurvePathOffset, 
+        KNullDesC8(), 
+        outBuf );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfCurvePath::Offset panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return iData->iOffset;
+    }
+    
+// ---------------------------------------------------------------------------
+// Set offset of path
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfCurvePath::SetOffset( const TAlfTimedPoint& aOffset )
+    {
+    TPckgC<TAlfTimedPoint> inBuf( aOffset );
+    TBuf8<1> outDummy;
+    
+    TInt err = iData->iComms->DoSynchronousCmd(
+        EAlfCurvePathSetOffset, 
+        inBuf, 
+        outDummy );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfCurvePath::SetOffset panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    iData->iOffset = aOffset;
+    }
+
+// ---------------------------------------------------------------------------
+// Get the mapping function ID of this path
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfCurvePath::MappingFunctionIdentifier() const
+    {
+    return iData->iComms->Identifier();
+    }
+  
+// ---------------------------------------------------------------------------
+// Evaluate an x/y value on the path
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TReal32 CAlfCurvePath::MapValue(TReal32 aValue, TInt aMode) const __SOFTFP
+    {
+    TIntTReal mapValues( aMode, aValue );
+    TPckgC<TIntTReal> mapValuesPckg( mapValues );
+    
+    TReal32 returnValue = aValue;
+    TPckg<TReal32> returnBuf(returnValue);
+    
+    TInt err = iData->iComms->DoSynchronousCmd(
+        EAlfCurvePathMapValue, 
+        mapValuesPckg, 
+        returnBuf );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfCurvePath::MapValue panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return returnValue;
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfcurvepathlayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,191 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Layout which uses a curve path for the child positions
+*
+*/
+
+
+
+#include "alf/alfcurvepathlayout.h"
+#include "alf/alfcontrol.h"
+#include "alf/alfcurvepath.h"
+#include "alf/alfgencomponent.h"
+#include "alflogger.h"
+#include "alf/alfconstants.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+struct CAlfCurvePathLayout::TCurvePathLayoutPrivateData
+    {
+    CAlfCurvePath* iCurvePath; // Own
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfCurvePathLayout::CAlfCurvePathLayout()
+: CAlfLayout()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfCurvePathLayout::ConstructL(CAlfControl& aOwner)
+    {
+    CAlfLayout::ConstructL(aOwner);
+    
+    iCurvePathLayoutData = new (ELeave) TCurvePathLayoutPrivateData;
+    iCurvePathLayoutData->iCurvePath = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfCurvePathLayout* CAlfCurvePathLayout::AddNewL(
+    CAlfControl& aOwnerControl,
+    CAlfLayout* aParentLayout )
+    {
+    CAlfCurvePathLayout* layout = STATIC_CAST(CAlfCurvePathLayout*,
+        aOwnerControl.AppendLayoutL(EAlfLayoutTypeCurvePath, aParentLayout));
+    return layout;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfCurvePathLayout::~CAlfCurvePathLayout()
+    {
+    if ( iCurvePathLayoutData )
+        {
+        delete iCurvePathLayoutData->iCurvePath;
+        iCurvePathLayoutData->iCurvePath = NULL;
+        }
+    delete iCurvePathLayoutData;
+    iCurvePathLayoutData = NULL;
+    }
+ 
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C CAlfCurvePath& CAlfCurvePathLayout::CurvePath()
+    {
+    // The curve path cannot be contructed in the ConstructL() because
+    // the comms is not allocated yet.
+    if ( !iCurvePathLayoutData->iCurvePath )
+        {
+        // Create curve path. The curve path uses this subsesison for its
+        // communication with the server side instance.
+        TRAPD( err, iCurvePathLayoutData->iCurvePath = CAlfCurvePath::NewL( Env(), Identifier() ) );
+        if ( err )
+            {
+            __ALFLOGSTRING1( "CAlfCurvePathLayout::CurvePath panic error %d", err )
+            USER_INVARIANT();
+            }
+        }
+    
+    return *iCurvePathLayoutData->iCurvePath;
+    }
+
+EXPORT_C TInt CAlfCurvePathLayout::MappingFunctionIdentifier() const
+    {
+    return Comms()->Identifier();
+    }
+    
+EXPORT_C TReal32 CAlfCurvePathLayout::MapValue(TReal32 aValue, TInt aMode) const __SOFTFP
+    {
+    TIntTReal mapValues( aMode, aValue );
+    TPckgC<TIntTReal> mapValuesPckg( mapValues );
+    
+    TReal32 returnValue = aValue;
+    TPckg<TReal32> returnBuf(returnValue);
+    
+    TInt err = Comms()->DoSynchronousCmd(
+        EAlfCurvePathLayoutMapValue, 
+        mapValuesPckg, 
+        returnBuf );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfCurvePathLayout::MapValue panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return returnValue;
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfCurvePathLayout::RemoveAndDestroyAllD()
+    {
+    CAlfLayout::RemoveAndDestroyAllD();
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfCurvePathLayout::UpdateChildrenLayout(TInt aTransitionTime )
+    {
+    CAlfLayout::UpdateChildrenLayout( aTransitionTime );
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfVisual* CAlfCurvePathLayout::FindTag(const TDesC8& aTag)
+    {
+    return CAlfLayout::FindTag( aTag );
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfCurvePathLayout::DoRemoveAndDestroyAllD()
+    {
+    CAlfLayout::DoRemoveAndDestroyAllD();
+    }
+    
+// ---------------------------------------------------------------------------
+// Place holder from CAlfLayout
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TAlfXYMetric CAlfCurvePathLayout::BaseUnit() const
+    {
+    return CAlfLayout::BaseUnit();
+    }
+
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfCurvePathLayout::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfLayout::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
+    }
+   
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfdecklayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Deck layout
+*
+*/
+
+
+
+#include "alf/alfdecklayout.h"
+#include "alf/alfcontrol.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alf/alfconstants.h"
+#include "alf/alfgencomponent.h"
+#include "alflogger.h"
+
+struct CAlfDeckLayout::TDeckLayoutPrivateData
+    {
+    // Add member variables here.
+    };
+
+// ======== LOCAL FUNCTIONS ========
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// 1st phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfDeckLayout::CAlfDeckLayout()
+    : CAlfLayout()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfDeckLayout::ConstructL(CAlfControl& aOwner)
+    {
+    CAlfLayout::ConstructL(aOwner);
+    
+    // Allocate iDeckLayoutData here if it gets member data.
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfDeckLayout::~CAlfDeckLayout()
+    {
+    delete iDeckLayoutData;
+    iDeckLayoutData = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Creates new anchor layout for the control.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfDeckLayout* CAlfDeckLayout::AddNewL(
+    CAlfControl& aOwnerControl,
+    CAlfLayout* aParentLayout )
+    {
+    CAlfDeckLayout* layout = STATIC_CAST(CAlfDeckLayout*,
+        aOwnerControl.AppendLayoutL(EAlfLayoutTypeDeck, aParentLayout));
+    return layout;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfDeckLayout::RemoveAndDestroyAllD()
+    {
+    CAlfLayout::RemoveAndDestroyAllD();
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfDeckLayout::UpdateChildrenLayout(TInt aTransitionTime )
+    {
+    CAlfLayout::UpdateChildrenLayout( aTransitionTime );
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfVisual* CAlfDeckLayout::FindTag(const TDesC8& aTag)
+    {
+    return CAlfLayout::FindTag( aTag );
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfLayout
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TAlfXYMetric CAlfDeckLayout::BaseUnit() const
+    {
+    return CAlfLayout::BaseUnit();
+    }
+ 
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfDeckLayout::DoRemoveAndDestroyAllD()
+    {
+    CAlfLayout::DoRemoveAndDestroyAllD();
+    }
+    
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfDeckLayout::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfLayout::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfdirectclient.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* 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:   This direct client to alf server, that does not require Alf 
+*                environment.
+*                
+*/
+
+
+#include <alf/alfdirectclient.h>
+#include <alf/alfconstants.h>
+
+// ---------------------------------------------------------------------------
+// Send synchronous command
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void RAlfDirectClient::MeasureFPS( TInt32 aId, TBool aStart )
+    {
+    if (!Handle())
+        {
+        TRAPD(err, OpenL());
+        if (err)
+            {
+            return;
+            }
+        }
+    TInt command = EAlfDirectClientFPSCounterOn;
+    if ( !aStart )
+        {
+        command = EAlfDirectClientFPSCounterOff;
+        }
+    Send( command, TIpcArgs(aId));
+    }
+
+EXPORT_C void RAlfDirectClient::EnableLowMemoryState( TBool aMode )
+    {
+    if (!Handle())
+        {
+        TRAPD(err, OpenL());
+        if (err)
+            {
+            return;
+            }
+        }
+    SendReceive(EAlfEnableLowMemoryState, TIpcArgs(aMode));
+    }
+
+EXPORT_C TInt RAlfDirectClient::ForceSwRendering( TBool aEnabled )
+    {
+    if (!Handle())
+        {
+        TRAPD(err, OpenL());
+        if (err)
+            {
+            return err;
+            }
+        }
+    return SendReceive(EAlfForceSwRendering, TIpcArgs(aEnabled));
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C RAlfDirectClient::RAlfDirectClient()
+    : RAlfClientBase(KAlfServiceUid.iUid) 
+    {
+    // elegant SW design, right
+	TRAP_IGNORE(OpenL());
+    }
+
+// ---------------------------------------------------------------------------
+// "destructor"
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void RAlfDirectClient::Disconnect()
+    {
+    if (Handle())	
+    	     {
+    	     Close();
+    		   }
+    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfdisplay.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,840 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Display
+*
+*/
+
+
+
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <uikon/eikdefmacros.h>
+#endif
+#include <aknappui.h>
+#include <coecntrl.h>
+#include <coecobs.h>
+#include <gdi.h>
+#include <AknUtils.h>
+#include <babitflags.h>
+
+#include "alf/alfdisplay.h"
+#include "alfdisplaysubsession.h"
+#include "alf/alfroster.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alf/alfevent.h"
+#include "alf/alfinputcapabilitiessupplier.h"
+#include "alflogger.h"
+#include "alf/alfevent.h"
+#include <alf/alfscreenbuffer.h>
+#include <alf/alfsymbiansbdrawer.h>
+
+#include "uiacceltk/HuiUtil.h"
+
+// Flags
+enum TAlfDisplayFlags
+    {
+    EAlfDisplayActive =                     0x01,
+    EAlfDisplayUpdateRenderState =          0x02,
+    EAlfDisplayOwnRoster =                  0x04
+    };
+ 
+// Default flags.   
+const TUint KAlfDisplayDefaultFlags = 0x00;
+
+enum
+    {
+    EAlfDisplayRectCustom,
+    EAlfDisplayRectMainPane,
+    EAlfDisplayRectWholeSceen        
+    };
+
+
+// Private data.
+struct CAlfDisplay::TPrivateData
+    {
+    TPrivateData():iEnv(0),iNativeControl(0),iRoster(0){}
+    RAlfDisplaySubSession iDisplaySubSession; // Owned
+    TUint iFlags;                           // Owned.
+    CAlfEnv* iEnv;                          // Not owned.
+    CAlfDisplayCoeControl* iNativeControl;  // Owned.
+    CAlfRoster* iRoster;                    // Owned/not owned - see EAlfDisplayOwnRoster
+    TInt iDisplayRectType; // To allow automatic screensize change in layout switch
+    };
+
+// ======== LOCAL FUNCTIONS ========
+
+NONSHARABLE_CLASS( CAlfDisplayCoeControl ): 
+    public CCoeControl
+    {
+public: // Enumerations
+    enum 
+        {
+        EManipulatingInputFocusIndex,
+        EIsActiveIndex
+        };
+
+public: 
+
+    CAlfDisplayCoeControl(){}
+    CAlfDisplayCoeControl( CAlfDisplay& aDisplay ) : iDisplay(&aDisplay){}
+    void SetFocusedEditor( MAlfInputCapabilitiesSupplier* aFocusedEditor );
+    
+    /**
+    * This returns whether the CCoeControl is focused in general. However, during an operation where 
+    * focus is temporarily withdrawn from the CCoeControl, this state will continue to return ETrue.
+    * This method cannot be called IsFocused since that would access the instantaneous 
+    * CONE focus, which is not what is required here.
+    */
+    TBool IsActive() const;
+    
+    /**
+    * Sets the active state according to the current focus state from CONE
+    */
+    void SetActiveState();
+    
+    virtual void InitL();
+    
+    virtual TBool DrawsIntoLocalWindow() const;
+    
+protected:
+    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+    void HandlePointerEventL(const TPointerEvent& aPointerEvent);
+    void HandleResourceChange(TInt aType);
+    /** 
+    * From CCoeControl
+    */
+protected:
+    virtual TCoeInputCapabilities InputCapabilities() const;
+    virtual void FocusChanged(TDrawNow aDrawNow);
+
+protected:
+    CAlfDisplay* iDisplay;
+    MAlfInputCapabilitiesSupplier* iFocusedEditor;
+    TBitFlags iFlags; // Cleared at construction
+    };
+
+void CAlfDisplayCoeControl::InitL()
+    {
+    // Window is needed for HandleResourceChange to get events
+    CreateWindowL();    
+    Window().EnableOSB(EFalse);
+    }
+
+
+TKeyResponse CAlfDisplayCoeControl::OfferKeyEventL(
+    const TKeyEvent& aKeyEvent,
+    TEventCode aType)
+    {
+    TAlfEvent event(*iDisplay, aKeyEvent, aType);
+    if(iDisplay->Roster().HandleEventL(event))
+        {
+        return EKeyWasConsumed;
+        }
+    return EKeyWasNotConsumed;
+    }
+
+
+void CAlfDisplayCoeControl::HandlePointerEventL(
+    const TPointerEvent& aPointerEvent)
+    {
+    CCoeControl::HandlePointerEventL( aPointerEvent );
+    }
+
+void CAlfDisplayCoeControl::HandleResourceChange(TInt aType)
+    {
+    CCoeControl::HandleResourceChange( aType );
+    if (aType == KEikDynamicLayoutVariantSwitch)
+        {
+        iDisplay->Env().ReportWsEventAsActionCommand(KAlfActionIdDeviceLayoutChanged);            
+        }
+    }
+
+TCoeInputCapabilities CAlfDisplayCoeControl::InputCapabilities() const
+    {
+    if ( iFocusedEditor )
+        {
+        return iFocusedEditor->InputCapabilities();
+        }
+    else
+        {
+        TCoeInputCapabilities nullCapabilities(TCoeInputCapabilities::ENavigation);
+        return nullCapabilities;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the pointer to the object supplying input capabilities.
+// This method needs to ensure that the FEP registers the change in focus of the AlfControl 
+// - some sort of editor in this case. 
+// ---------------------------------------------------------------------------
+//
+void CAlfDisplayCoeControl::SetFocusedEditor( MAlfInputCapabilitiesSupplier* aFocusedEditor )
+    {
+    // A flag is set to register the fact that we are currently manipulating focus of the CCoeControl, albeit temporarily.
+    // The flag is used by call-backs to suppress Alf reacting too deeply to the focus changes.
+    iFlags.Set( EManipulatingInputFocusIndex );
+    if ( !aFocusedEditor )
+        {
+        // The focus state of this CCoeControl must be preserved through this "kicking" of the FEP
+        // Use a local variable to highlight that the "IsActive" flag may change temporarily during this sequence
+        // (depending on implementation)
+        TBool focusStateToKeep = iFlags.IsSet( EIsActiveIndex );
+        if ( focusStateToKeep ) // No need to even remove focus if off already
+            {
+            SetFocus(EFalse, ENoDrawNow); // Forces focus off this 
+            // Force removal of focus to be synchronous
+            ControlEnv()->SyncNotifyFocusObserversOfChangeInFocus();
+            }
+        iFocusedEditor = aFocusedEditor; // Removed only after FEP has taken focus off
+
+        if ( !IsFocused() && focusStateToKeep ) // Ensure focus gets put back on
+            {
+            SetFocus(ETrue, ENoDrawNow); // Forces focus on again but now there is no AlfControl
+            }
+        }
+    else
+        { 
+        iFocusedEditor = aFocusedEditor; // Put in place before focus is forced on
+        SetFocus(ETrue, ENoDrawNow); // Forces focus onto this control
+        }
+    iFlags.Clear( EManipulatingInputFocusIndex );
+    }
+    
+// ---------------------------------------------------------------------------
+// This is a call-back from CONE when the focus is changed on a this CCoeControl.
+// The roster must be kept "in step" with the focus change, and is called strictly 
+// only when the focus state changes. 
+// However Alf should not track focus changes when SetFocusedEditor is being processed
+// This interlock is effected by the ManipulatingInputFocus flag
+// ---------------------------------------------------------------------------
+void CAlfDisplayCoeControl::FocusChanged( TDrawNow aDrawNow )
+    {
+    if ( iFlags.IsClear( EManipulatingInputFocusIndex ) )
+        {
+        TBool coneFocus = IsFocused();
+        if ( !COMPARE_BOOLS(iFlags.IsSet( EIsActiveIndex ), coneFocus ) )
+            {
+            iFlags.Assign( EIsActiveIndex, coneFocus );
+            iDisplay->Roster().DisplayFocusChanged( *iDisplay, coneFocus );
+            }
+        }
+    CCoeControl::FocusChanged( aDrawNow );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Implemenation of CCoeControl virtual.
+// Used here to set up the focus state at the construction point of the control.
+// ---------------------------------------------------------------------------
+void CAlfDisplayCoeControl::SetActiveState()
+    {
+    iFlags.Assign( EIsActiveIndex, IsFocused() );
+    iDisplay->Roster().DisplayFocusChanged( *iDisplay, iFlags.IsSet( EIsActiveIndex ) );
+    }
+
+TBool CAlfDisplayCoeControl::IsActive() const
+    {
+    return iFlags.IsSet( EIsActiveIndex );
+    }
+
+TBool CAlfDisplayCoeControl::DrawsIntoLocalWindow() const
+    {
+    return EFalse;    
+    }
+
+//
+//
+//
+//	
+NONSHARABLE_CLASS( CAlfDisplayOffScreenBufferCoeControl ): 
+    public CAlfDisplayCoeControl, public MAlfScreenBufferObserver
+    {
+public:    
+    CAlfDisplayOffScreenBufferCoeControl( CAlfDisplay& aDisplay );
+    
+    ~CAlfDisplayOffScreenBufferCoeControl();
+    
+    void InitL(TUid aBufferUid);
+
+    void Draw( const TRect& aRect ) const;
+
+    void SizeChanged();
+
+    TBool DrawsIntoLocalWindow() const;
+
+protected:
+    void HandlePointerEventL(const TPointerEvent& aPointerEvent);
+
+private: // From MAlfScreenBufferObserver
+	
+	TBool BufferComplete(TUid aId, TRect& aDisplayRect, TRect& aDirtyRect);
+	void HandleScreenBufferEvent(TUid aId, TInt aEvent);
+
+private:
+    CAlfScreenBuffer* iAlfScreenBuffer;  
+	TRect iDisplayRect;		          
+    CAlfSymbianBufferDrawer* iBufferDrawer;
+    TUid iBufferUid;   
+    };
+
+CAlfDisplayOffScreenBufferCoeControl::CAlfDisplayOffScreenBufferCoeControl(CAlfDisplay& aDisplay)
+    {
+    iDisplay = &aDisplay;
+    }
+
+CAlfDisplayOffScreenBufferCoeControl::~CAlfDisplayOffScreenBufferCoeControl()
+    {
+    if(iBufferDrawer)
+    	iBufferDrawer->ReleaseDrawer();
+    delete iAlfScreenBuffer;        
+    }
+    
+void CAlfDisplayOffScreenBufferCoeControl::InitL(TUid aBufferUid)
+    {
+    CAlfDisplayCoeControl::InitL();    
+
+    // Set the windows size
+    SetRect( iDisplay->VisibleArea() );
+
+    // Activate the window, which makes it ready to be drawn
+    ActivateL();
+    
+    iAlfScreenBuffer = CAlfScreenBuffer::NewL(iDisplay->Env());
+   	iAlfScreenBuffer->AddObserverL(aBufferUid, this);   
+    iBufferUid = aBufferUid;
+    
+    EnableDragEvents();
+    }
+
+
+void CAlfDisplayOffScreenBufferCoeControl::Draw( const TRect& /*aRect*/ ) const
+    {
+    // Get the standard graphics context
+    CWindowGc& gc = SystemGc();
+
+    if (iBufferDrawer)
+    	{
+  		iBufferDrawer->DrawBuffer(gc, TPoint(), iDisplayRect);
+    	}
+        
+    }
+
+void CAlfDisplayOffScreenBufferCoeControl::SizeChanged()
+    {
+    DrawDeferred();  
+    }
+
+TBool CAlfDisplayOffScreenBufferCoeControl::BufferComplete(TUid aId, TRect& aDisplayRect, TRect& /*aDirtyRect*/)
+	{
+	if (aId == iBufferUid)
+	    {	        
+    	if (!iBufferDrawer)
+    		{
+        	iBufferDrawer = (CAlfSymbianBufferDrawer*)iAlfScreenBuffer->GetDrawingInterface(KAlfSymbianBufferDrawerUid, iBufferUid);		
+    		}
+    	iDisplayRect = aDisplayRect;
+    	DrawNow();
+	    }
+
+	return ETrue;
+	}
+	
+	
+void CAlfDisplayOffScreenBufferCoeControl::HandleScreenBufferEvent(TUid aId, TInt aEvent)
+	{
+	if (aId == iBufferUid)
+	    {	        
+    	if (aEvent == MAlfScreenBufferObserver::ECreated)
+    		{
+    		}
+    	else if (aEvent == MAlfScreenBufferObserver::EDeleted)
+    		{
+    		// delete bitmap drawer etc.
+        	if(iBufferDrawer)
+        		iBufferDrawer->ReleaseDrawer();
+        	iBufferDrawer = NULL;
+        	// Draw
+    		DrawNow();
+    		}
+	    }
+	}
+	
+void CAlfDisplayOffScreenBufferCoeControl::HandlePointerEventL(
+    const TPointerEvent& aPointerEvent)
+    {
+    CCoeControl::HandlePointerEventL( aPointerEvent );
+    iDisplay->HandlePointerEventL( aPointerEvent );
+    }
+    
+TBool CAlfDisplayOffScreenBufferCoeControl::DrawsIntoLocalWindow() const
+    {
+    return ETrue;    
+    }
+	
+	
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfDisplay::CAlfDisplay()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfDisplay::ConstructL(
+    CAlfEnv& aEnv, 
+    TBool aAsCoeControl,
+    const TRect& aRect, 
+    CAlfRoster* aSharedRoster,
+    TInt aDisplayType,
+    TUid aBufferUid)
+    {
+    iData = new (ELeave) TPrivateData;
+    
+    User::LeaveIfError( iData->iDisplaySubSession.Open(aEnv.Client(), aRect, aDisplayType, aBufferUid) );
+        
+    
+    iData->iFlags = KAlfDisplayDefaultFlags;
+
+    iData->iEnv = &aEnv;
+    iData->iNativeControl = NULL;
+    iData->iFlags |= EAlfDisplayActive;
+    iData->iFlags |= EAlfDisplayUpdateRenderState;
+    
+    
+    // Create a control roster.
+    if(aSharedRoster)
+        {
+        iData->iRoster = aSharedRoster;
+        iData->iFlags &= ~EAlfDisplayOwnRoster;
+        }
+    else
+        {
+        // Construct a private roster.
+        CAlfRoster* roster = new (ELeave) CAlfRoster;
+        CleanupStack::PushL(roster);
+        roster->ConstructL(this);
+        CleanupStack::Pop(roster);
+        iData->iRoster= roster;
+        iData->iFlags |= EAlfDisplayOwnRoster;
+        }
+        
+    if ( aAsCoeControl )
+        {        
+        if (aDisplayType == EDisplayOffScreenBuffer && aBufferUid.iUid != 0)
+            {
+            CAlfDisplayOffScreenBufferCoeControl* osbf = new (ELeave) CAlfDisplayOffScreenBufferCoeControl(*this);
+            iData->iNativeControl = osbf;
+            iData->iNativeControl->SetMopParent( iAvkonAppUi );
+            CCoeEnv::Static()->AppUi()->AddToStackL(iData->iNativeControl);
+            iData->iNativeControl->SetActiveState();
+            osbf->InitL(aBufferUid);                       
+            }
+        else
+            {                
+            iData->iNativeControl = new (ELeave) CAlfDisplayCoeControl(*this);
+            iData->iNativeControl->SetMopParent( iAvkonAppUi );
+            CCoeEnv::Static()->AppUi()->AddToStackL(iData->iNativeControl);
+            iData->iNativeControl->SetActiveState();
+            iData->iNativeControl->InitL();       
+            }    
+        }
+
+    iData->iDisplayRectType = EAlfDisplayRectCustom;   
+    if ( CCoeEnv::Static() ) // check that we are running this from Symbian application
+        {
+        CheckScreenRect(aRect);
+
+        // In case of display is created after application has already received foregound
+        // we notify just to make sure we really have foreground
+        aEnv.Client().ApplicationIsForeground(iAvkonAppUi->IsForeground() || 
+            iAvkonAppUi->IsPartialForeground());    
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfDisplay::~CAlfDisplay()
+    {
+    if ( iData )
+        {
+        if ( (iData->iFlags&EAlfDisplayOwnRoster) && iData->iRoster )
+            {
+            delete iData->iRoster;
+            }
+        iData->iFlags &= ~EAlfDisplayOwnRoster;
+        iData->iRoster = NULL;
+        
+        if ( iData->iNativeControl )
+            {
+            CCoeEnv::Static()->AppUi()->RemoveFromStack(iData->iNativeControl);
+            delete iData->iNativeControl;
+            iData->iNativeControl = NULL;
+            }
+        
+        if ( iData->iEnv )
+            {
+            iData->iEnv->RemoveDisplay(*this);
+            }
+            
+        iData->iDisplaySubSession.Close();
+        }
+    
+    delete iData;
+    iData = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets clear background method
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfDisplay::SetClearBackgroundL(TInt aClearBackground)
+    {
+    TInt err =
+        iData->iDisplaySubSession.SetClearBackground( 
+            aClearBackground );
+            
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfDisplay::SetClearBackgroundL leave error %d", err )
+        User::Leave( err );
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// Returns roster
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C CAlfRoster& CAlfDisplay::Roster()
+    {
+    __ASSERT_ALWAYS( iData, USER_INVARIANT() );
+    __ASSERT_ALWAYS( iData->iRoster, USER_INVARIANT() );
+    return *iData->iRoster;
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns roster
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const CAlfRoster& CAlfDisplay::Roster() const
+    {
+    __ASSERT_ALWAYS( iData, USER_INVARIANT() );
+    __ASSERT_ALWAYS( iData->iRoster, USER_INVARIANT() );
+    return *iData->iRoster;
+    }
+   
+// ---------------------------------------------------------------------------
+// Sets visible area.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfDisplay::SetVisibleArea(const TRect& aArea)
+    {
+    TInt err = iData->iDisplaySubSession.SetVisibleArea( aArea );
+    
+    if ( err != KErrNone )
+        {
+        // panic?
+        __ALFLOGSTRING1( "CAlfDisplay::SetVisibleArea ignore error %d", err )
+        }
+        
+    if ( CCoeEnv::Static() ) // check that we are running this from Symbian application
+        {
+        CheckScreenRect(aArea);
+        
+        // If offscreenbuffer is drawn, then set its rect too.
+        if (iData->iNativeControl && iData->iNativeControl->DrawsIntoLocalWindow())
+            {
+            iData->iNativeControl->SetRect(aArea);    
+            }        
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Sets visible area.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfDisplay::ForceSetVisibleArea(const TRect& aArea)
+    {
+    // forces to set visible area
+    TInt err = iData->iDisplaySubSession.SetVisibleArea( aArea, ETrue );
+    
+    if ( err != KErrNone )
+        {
+        // panic?
+        __ALFLOGSTRING1( "CAlfDisplay::ForceSetVisibleArea ignore error %d", err )
+        }
+        
+    if ( CCoeEnv::Static() ) // check that we are running this from Symbian application
+        {
+        CheckScreenRect(aArea);
+        
+        // If offscreenbuffer is drawn, then set its rect too.
+        if (iData->iNativeControl && iData->iNativeControl->DrawsIntoLocalWindow())
+            {
+            iData->iNativeControl->SetRect(aArea);    
+            }        
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Returns visible area
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C TRect CAlfDisplay::VisibleArea() const
+    {
+    TRect area(0,0,0,0);
+
+    TInt err = iData->iDisplaySubSession.VisibleArea( area );
+    
+    if ( err != KErrNone )
+        {
+        // panic?
+        __ALFLOGSTRING1( "CAlfDisplay::VisibleArea ignore error %d", err )
+        }
+        
+    return area;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns env.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C CAlfEnv& CAlfDisplay::Env()
+    {
+    return *iData->iEnv;
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// Returns server handle
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfDisplay::ServerHandle() const
+    {
+    return iData->iDisplaySubSession.SubSessionHandle();
+    }
+// ---------------------------------------------------------------------------
+// Set the current focused editor. 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfDisplay::SetFocusedEditor( MAlfInputCapabilitiesSupplier*  aCurrentEditor  )
+    {
+    __ASSERT_ALWAYS(iData->iNativeControl, USER_INVARIANT() );
+    iData->iNativeControl->SetFocusedEditor(aCurrentEditor);
+    }
+
+// ---------------------------------------------------------------------------
+// Set display dirty.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfDisplay::SetDirty()
+    {
+    iData->iDisplaySubSession.SetDirty();
+    }
+    
+// ---------------------------------------------------------------------------
+// Set display rendering quality.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfDisplay::SetQuality(TAlfQuality aRenderingQuality)
+    {
+    TInt err = iData->iDisplaySubSession.SetQuality(aRenderingQuality);
+    if ( err != KErrNone )
+        {
+        // panic?
+        __ALFLOGSTRING1( "CAlfDisplay::SetQuality ignore error %d", err )
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Get display rendering quality.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TAlfQuality CAlfDisplay::Quality() const
+    {
+    TAlfQuality renderingQuality;
+    TInt err = iData->iDisplaySubSession.Quality(renderingQuality);
+    if ( err != KErrNone )
+        {
+        // panic?
+        __ALFLOGSTRING1( "CAlfDisplay::Quality ignore error %d", err )
+        }
+    return renderingQuality;
+    }
+    
+// ---------------------------------------------------------------------------
+// Set display depth test use
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfDisplay::SetUseDepth(TBool aUseDepth)
+    {
+    TInt err = iData->iDisplaySubSession.SetUseDepth(aUseDepth);
+    if ( err != KErrNone )
+        {
+        // panic?
+        __ALFLOGSTRING1( "CAlfDisplay::SetUseDepth ignore error %d", err )
+        }                
+    }
+
+// ---------------------------------------------------------------------------
+// Handles layout switch
+// ---------------------------------------------------------------------------
+// 
+void CAlfDisplay::NotifyLayoutChangedL()
+    {
+    // If screen size had been set to main pane or whole screen, 
+    // set it automatically here to new value.
+    // Otherwise let application handle it.
+    if (iData->iDisplayRectType == EAlfDisplayRectMainPane)
+        {
+        TRect metricsRect = TRect(0,0,0,0);
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, metricsRect);
+        ForceSetVisibleArea(metricsRect);
+        }
+    else if (iData->iDisplayRectType == EAlfDisplayRectWholeSceen)
+        {
+        TRect metricsRect = TRect(0,0,0,0);
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, metricsRect);
+        ForceSetVisibleArea(metricsRect);
+        }
+    else
+        {
+        // for PC lint
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfDisplay::CheckScreenRect(TRect aRect)
+    {
+    TRect mainpaneRect = TRect(0,0,0,0);
+    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainpaneRect);
+
+    TRect screenRect = TRect(0,0,0,0);
+    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, screenRect);
+    
+    if (aRect == mainpaneRect)
+        {
+        iData->iDisplayRectType = EAlfDisplayRectMainPane;    
+        }
+    else if (aRect == screenRect)
+        {
+        iData->iDisplayRectType = EAlfDisplayRectWholeSceen;    
+        }
+    else
+        {
+        iData->iDisplayRectType = EAlfDisplayRectCustom;           
+        }            
+    }
+    
+// ---------------------------------------------------------------------------
+// Access the object provider for the display. 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C MObjectProvider* CAlfDisplay::ObjectProvider() const
+    {
+    return iData->iNativeControl;
+    }
+    
+TBool CAlfDisplay::IsFocused() const
+    {
+    return iData->iNativeControl ? iData->iNativeControl->IsActive() : ETrue;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Sets usage hint
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfDisplay::SetUsageL(TUint aUsageHint)
+    {
+    TInt err = iData->iDisplaySubSession.SetUsage(aUsageHint);
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfDisplay::SetUsageL leave error %d", err )
+        User::Leave( err );
+        }                        
+    }
+
+// ---------------------------------------------------------------------------
+// Suppresses automatic fading
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TInt CAlfDisplay::SuppressAutomaticFading( TBool aSuppress )
+    {
+    TInt err = iData->iDisplaySubSession.SuppressAutomaticFading( aSuppress );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfDisplay::SuppressAutomaticFading return error %d", err )
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfDisplay::SetBackgroundItemsL(const RArray<TAlfDisplayBackgroundItem>& aItems)
+    {
+    TInt err = iData->iDisplaySubSession.SetBackgroundItemsL(aItems);
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfDisplay::SetBackgroundItemsL ignore error %d", err )
+        }                        
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfDisplay::HandlePointerEventL(const TPointerEvent& aPointerEvent)
+    {
+    TInt err = iData->iDisplaySubSession.HandlePointerEventL(aPointerEvent);
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfDisplay::HandlePointerEventL ignore error %d", err )
+        }        
+    }
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+// 
+
+EXPORT_C void CAlfDisplay::SetClientWindowForDrawingL(RWindow* aWindow, CAlfVisual* aVisual)
+	{
+	TInt windowGroupId = 0; 
+	TInt clientWindowHandle = 0;
+	TInt visualHandle = NULL;
+	windowGroupId = aWindow->WindowGroupId(); 
+	clientWindowHandle = aWindow->ClientHandle();
+	if (aVisual)
+		{
+		visualHandle = aVisual->Identifier();
+		}
+    iData->iDisplaySubSession.SetClientWindowForDrawingL(windowGroupId, clientWindowHandle, visualHandle);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfdisplaybackgrounditem.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines item in display background.
+*
+*/
+
+
+
+#include "alf/alfdisplaybackgrounditem.h"  // Class definition
+#include "alf/alfdisplay.h"  
+
+
+// Constructors
+EXPORT_C TAlfDisplayBackgroundItem::TAlfDisplayBackgroundItem()
+    :iRect(TRect(0,0,0,0)), 
+     iSkinID(KAknsIIDNone), 
+     iColorIndex(0), 
+     iColor(KRgbWhite), 
+     iClearMode(CAlfDisplay::EClearNone)
+    {   
+             
+    }
+
+EXPORT_C TAlfDisplayBackgroundItem::TAlfDisplayBackgroundItem( const TRect& aRect ) 
+    :iRect(aRect), 
+     iSkinID(KAknsIIDNone), 
+     iColorIndex(0), 
+     iColor(KRgbWhite), 
+     iClearMode(CAlfDisplay::EClearNone)
+    {        
+    }
+
+EXPORT_C TAlfDisplayBackgroundItem::TAlfDisplayBackgroundItem( const TRect& aRect,
+                           const TAknsItemID& aSkinID )
+    :iRect(aRect),
+     iSkinID(aSkinID), 
+     iColorIndex(0), 
+     iColor(KRgbWhite), 
+     iClearMode(CAlfDisplay::EClearWithSkinBackground)
+    {
+    }
+
+EXPORT_C TAlfDisplayBackgroundItem::TAlfDisplayBackgroundItem( const TRect& aRect,
+                           const TAknsItemID& aSkinID,
+                           TInt aColorIndex )
+    :iRect(aRect),
+     iSkinID(aSkinID), 
+     iColorIndex(aColorIndex), 
+     iColor(KRgbWhite), 
+     iClearMode(CAlfDisplay::EClearWithColor)
+    {
+    }
+
+EXPORT_C TAlfDisplayBackgroundItem::TAlfDisplayBackgroundItem( const TRect& aRect,
+                           const TRgb& aColor )
+    :iRect(aRect),
+     iSkinID(KAknsIIDNone), 
+     iColorIndex(0), 
+     iColor(aColor), 
+     iClearMode(CAlfDisplay::EClearWithColor)
+    {        
+    }
+
+EXPORT_C void TAlfDisplayBackgroundItem::SetRect( const TRect& aRect )
+    {
+    iRect = aRect;   
+    }
+
+EXPORT_C void TAlfDisplayBackgroundItem::SetColor( const TRgb& aColor )
+    {
+    iColor = aColor;    
+    iClearMode = CAlfDisplay::EClearWithColor;
+    }
+    
+EXPORT_C void TAlfDisplayBackgroundItem::SetColor( const TAknsItemID& aSkinID, TInt aColorIndex )
+    {
+    iSkinID = aSkinID;
+    iColorIndex = aColorIndex;      
+    iClearMode = CAlfDisplay::EClearWithColor;
+    }
+    
+EXPORT_C void TAlfDisplayBackgroundItem::SetSkinBackground( const TAknsItemID& aSkinID )
+    {
+    iSkinID = aSkinID;
+    iClearMode = CAlfDisplay::EClearWithSkinBackground;    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfdisplaysubsession.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,311 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Sub-session for display
+*
+*/
+
+
+
+#include "alfdisplaysubsession.h"
+#include "alf/alfconstants.h"
+#include "alf/alfdisplaybackgrounditem.h"
+#include "alflogger.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Opens subsession
+// ---------------------------------------------------------------------------
+//
+TInt RAlfDisplaySubSession::Open( RAlfClient& aSession, const TRect& aRect, TInt aDisplayType, 
+	TUid aBufferUid )
+    {
+    if (aDisplayType >= CAlfDisplay::EDisplayNormal)       
+    	{   	
+    	TPckg<TRect> rectPckg(aRect);
+    
+    	TAlfDisplayCreateParams2 params;
+    	params.iWindowGroupId = 0;
+    	CCoeEnv* coeStatic = CCoeEnv::Static();
+    	if ( coeStatic )
+        	{
+        	params.iWindowGroupId = coeStatic->RootWin().Identifier();
+        	}
+    	params.iDisplayType = aDisplayType;
+    	params.iBufferUid = aBufferUid;
+    
+    	TPckg<TAlfDisplayCreateParams2> paramPckg(params);    
+    	TAlfImplementationInformation info(EAlfDisplaySubSessionOpen2);
+    	TPckgC<TAlfImplementationInformation> infoBuf(info);
+    	return CreateSubSession( 
+        	aSession,
+        	EAlfCreateSubSession,
+        	TIpcArgs( &infoBuf, &rectPckg, &paramPckg ));
+    	}    
+    else // deprecated API
+    	{
+    	TPckg<TRect> rectPckg(aRect);
+    
+    	TAlfDisplayCreateParams params;
+    	params.iWindowGroupId = 0;
+    	CCoeEnv* coeStatic = CCoeEnv::Static();
+    	if ( coeStatic )
+        	{
+        	params.iWindowGroupId = coeStatic->RootWin().Identifier();
+        	}
+    	params.iDisplayType = aDisplayType;
+    
+    	TPckg<TAlfDisplayCreateParams> paramPckg(params);    
+    	TAlfImplementationInformation info(EAlfDisplaySubSessionOpen);
+    	TPckgC<TAlfImplementationInformation> infoBuf(info);
+    	return CreateSubSession( 
+        	aSession,
+        	EAlfCreateSubSession,
+        	TIpcArgs( &infoBuf, &rectPckg, &paramPckg ));
+    	}
+    }
+ 
+// ---------------------------------------------------------------------------
+// Closes subsession
+// ---------------------------------------------------------------------------
+//   
+void RAlfDisplaySubSession::Close()
+    {
+    CloseSubSession( EAlfCloseSubSession );
+    }
+    
+// ---------------------------------------------------------------------------
+// Display background
+// ---------------------------------------------------------------------------
+//
+TInt RAlfDisplaySubSession::SetClearBackground( TInt aClearBackground )
+    {
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs( EAlfDisplaySetClearBackground, aClearBackground ) );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfDisplaySubSession::SetClearBackground return error %d", err )
+        }
+    return err;
+    }
+ 
+// ---------------------------------------------------------------------------
+// Sets visible area
+// ---------------------------------------------------------------------------
+//
+TInt RAlfDisplaySubSession::SetVisibleArea( const TRect& aRect, TBool aForce)
+    {
+    TPckg<TRect> rectPckg(aRect);
+    TInt err;
+    if(aForce)
+        {
+        err = SendReceive(
+            EAlfDoSubSessionCmd, 
+            TIpcArgs(EAlfDisplayForceSetVisibleArea, &rectPckg) );
+        }
+    else
+        {
+        err = SendReceive(
+            EAlfDoSubSessionCmd, 
+            TIpcArgs(EAlfDisplaySetVisibleArea, &rectPckg) );        
+        }
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfDisplaySubSession::SetVisibleArea return error %d", err )
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns visible area
+// ---------------------------------------------------------------------------
+//
+TInt RAlfDisplaySubSession::VisibleArea( TRect& aRect ) const
+    {
+    TPckg<TRect> rectPckg(aRect);
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfDisplayVisibleArea,0,&rectPckg) );
+        
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfDisplaySubSession::VisibleArea return error %d", err )
+        }
+    return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Sets display dirty.
+// ---------------------------------------------------------------------------
+//
+void RAlfDisplaySubSession::SetDirty()
+    {
+    Send/*Receive*/(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs( EAlfDisplaySetDirty ) );
+    __ALFLOGSTRING( "RAlfDisplaySubSession::SetDirty sent" );        
+    }
+    
+// ---------------------------------------------------------------------------
+// Sets rendering quality
+// ---------------------------------------------------------------------------
+//
+TInt RAlfDisplaySubSession::SetQuality(TAlfQuality aRenderingQuality)
+    {
+    TPckg<TAlfQuality> inPckg(aRenderingQuality);
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfDisplaySetQuality, &inPckg) );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfDisplaySubSession::SetQuality return error %d", err )
+        }
+    return err;        
+    }
+
+// ---------------------------------------------------------------------------
+// Returns rendering quality
+// ---------------------------------------------------------------------------
+//
+TInt RAlfDisplaySubSession::Quality(TAlfQuality& aRenderingQuality) const
+    {
+    TPckg<TAlfQuality> retPckg(aRenderingQuality);
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfDisplayQuality,0,&retPckg) );
+        
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfDisplaySubSession::Quality return error %d", err )
+        }
+    return err;        
+    }
+
+// ---------------------------------------------------------------------------
+// Sets flag to specify if depth test is to be used
+// ---------------------------------------------------------------------------
+//
+TInt RAlfDisplaySubSession::SetUseDepth(TBool aUseDepth)
+    {
+    TPckg<TBool> inPckg(aUseDepth);
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfDisplaySetUseDepth, &inPckg) );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfDisplaySubSession::SetUseDepth return error %d", err )
+        }
+    return err;                
+    }
+
+// ---------------------------------------------------------------------------
+// Sets usage hint for the display.
+// ---------------------------------------------------------------------------
+//
+TInt RAlfDisplaySubSession::SetUsage(TUint aUsageHint)
+    {
+    TPckg<TUint> inPckg(aUsageHint);
+
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfDisplaySetUsage,&inPckg) );
+        
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfDisplaySubSession::SetUsageHint return error %d", err )
+        }
+    return err;        
+        
+    }
+
+// ---------------------------------------------------------------------------
+// Sets background items
+// ---------------------------------------------------------------------------
+//
+TInt RAlfDisplaySubSession::SetBackgroundItemsL(const RArray<TAlfDisplayBackgroundItem>& aItems)
+    {
+    HBufC8* buffer = ExternalizeLC(aItems);
+
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfDisplaySetBackgroundItems, buffer) );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "RAlfDisplaySubSession::SetBackgroundItemsL error %d", err )
+        }
+        
+    CleanupStack::PopAndDestroy( buffer );        
+    return err;        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt RAlfDisplaySubSession::HandlePointerEventL(const TPointerEvent& aPointerEvent)
+    {
+    TPckg<TAdvancedPointerEvent> inPckg(*aPointerEvent.AdvancedPointerEvent());
+
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfDisplayHandlePointerEvent,&inPckg) );
+        
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfDisplaySubSession::HandlePointerEventL return error %d", err )
+        }
+    return err;        
+    }
+
+// ---------------------------------------------------------------------------
+// Suppresses automatic fading
+// ---------------------------------------------------------------------------
+//
+TInt RAlfDisplaySubSession::SuppressAutomaticFading( TBool aSuppress )
+    {
+    TPckg<TBool> inPckg(aSuppress);
+
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs( EAlfDisplaySuppressAutomaticFading, &inPckg ) );
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfDisplaySubSession::SuppressAutomaticFading return error %d", err )
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void RAlfDisplaySubSession::SetClientWindowForDrawingL(TInt aWindowGroupId, TInt aClientWindowHandle, TInt aVisualHandle)
+	{
+	TInt3 data(aWindowGroupId, aClientWindowHandle, aVisualHandle);
+    TPckg<TInt3> inPckg(data);
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfDisplaySetClientWindowForDrawing, &inPckg) );
+        
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "RAlfDisplaySubSession::SetClientWindowForDrawing return error %d", err )
+        }
+  User::LeaveIfError(err);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfdropshadow.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,177 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Drop shadow parameter handler
+*
+*/
+
+
+
+#include "alf/alfdropshadow.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfconstants.h"
+
+// ======== LOCAL FUNCTIONS ========
+
+NONSHARABLE_STRUCT( CAlfDropShadow::TAlfDropShadowData )
+    {
+    TAlfDropShadowData(): iComms(NULL) {}
+    
+    CAlfGenComponent* iComms; // not own
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// 2-phased constructor
+// ---------------------------------------------------------------------------
+//
+CAlfDropShadow* CAlfDropShadow::NewL(CAlfGenComponent& aComms)
+    {
+    CAlfDropShadow* self = new (ELeave) CAlfDropShadow;
+    CleanupStack::PushL( self );
+    self->ConstructL( aComms );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// First phase constructor
+// ---------------------------------------------------------------------------
+//
+CAlfDropShadow::CAlfDropShadow()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Sencond phase constructor
+// ---------------------------------------------------------------------------
+//
+void CAlfDropShadow::ConstructL(CAlfGenComponent& aComms)
+    {
+    iData = new (ELeave) TAlfDropShadowData;
+
+    iData->iComms = &aComms;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// --------------------------------------------------------------------------
+//
+CAlfDropShadow::~CAlfDropShadow()
+    {
+    delete iData;
+    }
+   
+// ---------------------------------------------------------------------------
+// Sets offset in polar coordinates.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfDropShadow::SetOffset( 
+    TReal32 aAngle, 
+    TAlfMetric aDistance, 
+    TInt aTransitionTime ) __SOFTFP
+    {
+    TAlfDropShadowOffsetPolarParams params;
+    params.iAngle = aAngle;
+    params.iDistance = aDistance;
+    params.iTransitionTime = aTransitionTime;
+    
+    TPckgC<TAlfDropShadowOffsetPolarParams> inBuf( params );
+    
+    iData->iComms->DoCmdNoReply(EAlfDropShadowSetOffsetInPolar, inBuf );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets RGB color
+// ---------------------------------------------------------------------------
+//        
+EXPORT_C void CAlfDropShadow::SetColor(
+    const TRgb& aColor, 
+    TInt aTransitionTime)
+    {
+    TAlfDropShadowColorRgbParams params;
+    params.iColor = aColor;
+    params.iTransitionTime = aTransitionTime;
+    
+    TPckgC<TAlfDropShadowColorRgbParams> inBuf( params );
+    
+    iData->iComms->DoCmdNoReply(EAlfDropShadowSetColorRgb, inBuf );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets skinned color
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfDropShadow::SetColor(
+    const TAknsItemID& aID,
+    const TInt aIndex, 
+    TInt aTransitionTime )
+    {
+    TAlfDropShadowColorSkinParams params;
+    params.iID = aID;
+    params.iIndex = aIndex;
+    params.iTransitionTime = aTransitionTime;
+    
+    TPckgC<TAlfDropShadowColorSkinParams> inBuf( params );
+    
+    iData->iComms->DoCmdNoReply(EAlfDropShadowSetColorSkin, inBuf );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets opacity
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfDropShadow::SetOpacity( const TAlfTimedValue& aOpacity )
+    {
+    TPckgC<TAlfTimedValue> inBuf(aOpacity);
+    iData->iComms->DoCmdNoReply(EAlfDropShadowSetOpacity, inBuf );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets offset in cartesian coordinates
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfDropShadow::SetOffset( const TAlfTimedPoint& aOffset, TInt aOffsetUnit )
+    {
+    TAlfDropShadowOffsetXYParams params;
+    params.iOffset = aOffset;
+    params.iOffsetUnit = aOffsetUnit;
+
+    TPckgC<TAlfDropShadowOffsetXYParams> inBuf( params );
+    
+    iData->iComms->DoCmdNoReply(EAlfDropShadowSetOffsetInXY, inBuf );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets blur radius
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfDropShadow::SetRadius( const TAlfTimedValue& aRadius )
+    {
+    TPckgC<TAlfTimedValue> inBuf(aRadius);
+    iData->iComms->DoCmdNoReply(EAlfDropShadowSetBlurRadius, inBuf );
+    }
+    
+
+// ---------------------------------------------------------------------------
+// Sets scale factor
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfDropShadow::SetScale( const TAlfTimedValue& aScale )
+    {
+    TPckgC<TAlfTimedValue> inBuf(aScale);
+    iData->iComms->DoCmdNoReply(EAlfDropShadowSetScale, inBuf );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfdropshadowbrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,271 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Drop shadow brush
+*
+*/
+
+
+
+#include "alf/alfdropshadowbrush.h"
+#include "alf/alfconstants.h"
+#include "alf/alfgencomponent.h"
+#include "alflogger.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+struct CAlfDropShadowBrush::TDropShadowPrivateData
+    {
+    TAlfTimedValue iSoftness;
+    TAlfTimedValue iDepth;
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfDropShadowBrush::CAlfDropShadowBrush()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor (with metric depth)
+// ---------------------------------------------------------------------------
+//
+void CAlfDropShadowBrush::ConstructL( CAlfEnv& aEnv, const TAlfMetric&  aDepth )
+    {
+    TPckgC<TAlfMetric> paramsPckg( aDepth );
+    
+    CAlfBrush::ConstructL(
+        aEnv,
+        EAlfDropShadowBrushCreateMetric,
+        0,
+        paramsPckg
+        );
+        
+    iDropShadowData = new (ELeave) TDropShadowPrivateData;
+    }
+
+// ---------------------------------------------------------------------------
+// 2-phased constructor
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C CAlfDropShadowBrush* CAlfDropShadowBrush::NewL(
+        CAlfEnv& aEnv,
+        const TAlfMetric&  aDepth )
+    {
+    CAlfDropShadowBrush* self = NewLC( aEnv, aDepth );
+    CleanupStack::Pop( self);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// 2-phased constructor with the object left on the cleanup stack
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C CAlfDropShadowBrush* CAlfDropShadowBrush::NewLC(
+        CAlfEnv& aEnv,
+        const TAlfMetric&  aDepth )
+    {
+    CAlfDropShadowBrush* self = new (ELeave) CAlfDropShadowBrush;
+    CleanupStack::PushL( self );
+    self->ConstructL( aEnv, aDepth );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor (with pixel depth)
+// ---------------------------------------------------------------------------
+//    
+void CAlfDropShadowBrush::ConstructL( CAlfEnv& aEnv, TInt aDepth )
+    {
+    TPckgC<TInt> paramsPckg( aDepth );
+    
+    CAlfBrush::ConstructL(
+        aEnv,
+        EAlfDropShadowBrushCreate,
+        0,
+        paramsPckg
+        );
+        
+    iDropShadowData = new (ELeave) TDropShadowPrivateData;
+    }
+
+// ---------------------------------------------------------------------------
+// 2-phased constructor
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C CAlfDropShadowBrush* CAlfDropShadowBrush::NewL(
+        CAlfEnv& aEnv,
+        TInt aDepth )
+    {
+    CAlfDropShadowBrush* self = NewLC( aEnv, aDepth );
+    CleanupStack::Pop( self);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// 2-phased constructor with the object left on the cleanup stack
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C CAlfDropShadowBrush* CAlfDropShadowBrush::NewLC(
+        CAlfEnv& aEnv,
+        TInt aDepth )
+    {
+    CAlfDropShadowBrush* self = new (ELeave) CAlfDropShadowBrush;
+    CleanupStack::PushL( self );
+    self->ConstructL( aEnv, aDepth );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// destructor
+// ---------------------------------------------------------------------------
+//    
+CAlfDropShadowBrush::~CAlfDropShadowBrush()
+    {
+    delete iDropShadowData;
+    }
+
+// ---------------------------------------------------------------------------
+// Softness getter
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C const TAlfTimedValue& CAlfDropShadowBrush::Softness() const
+    {
+    TPckg<TAlfTimedValue> buf(iDropShadowData->iSoftness);
+    TInt err = Comms()->DoSynchronousCmd( EAlfDropShadowBrushGetSoftness, buf, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfDropShadowBrush::Softness panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return iDropShadowData->iSoftness;
+    }
+
+// ---------------------------------------------------------------------------
+// Softness setter
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfDropShadowBrush::SetSoftness( const TAlfTimedValue& aSoftness )
+    {
+    TPckgC<TAlfTimedValue> buf(aSoftness);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfDropShadowBrushSetSoftness, buf );
+
+    if ( err == KErrNone )
+        {
+        iDropShadowData->iSoftness = aSoftness;
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfDropShadowBrush::SetSoftness panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Depth getter
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C const TAlfTimedValue& CAlfDropShadowBrush::Depth() const
+    {
+    TPckg<TAlfTimedValue> buf(iDropShadowData->iDepth);
+    TInt err = Comms()->DoSynchronousCmd( EAlfDropShadowBrushGetDepth, buf, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfDropShadowBrush::Depth panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return iDropShadowData->iDepth;
+    }
+
+// ---------------------------------------------------------------------------
+// Depth setter
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfDropShadowBrush::SetDepth( const TAlfTimedValue& aDepth )
+    {
+    TPckgC<TAlfTimedValue> buf(aDepth);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfDropShadowBrushSetDepth, buf );
+
+    if ( err == KErrNone )
+        {
+        iDropShadowData->iDepth = aDepth;
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfDropShadowBrush::SetDepth panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Softness setter
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfDropShadowBrush::SetSoftness(const TAlfMetric& aSoftness)
+    {
+    TPckgC<TAlfMetric> buf(aSoftness);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfDropShadowBrushSetSoftnessMetric, buf );
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfDropShadowBrush::SetSoftness panic error %d", err )
+        USER_INVARIANT();
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// Depth setter
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfDropShadowBrush::SetDepth(const TAlfMetric& aDepth)
+    {
+    TPckgC<TAlfMetric> buf(aDepth);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfDropShadowBrushSetDepthMetric, buf );
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfDropShadowBrush::SetDepth panic error %d", err )
+        USER_INVARIANT();
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// Color setter
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfDropShadowBrush::SetColor(const TRgb& aColor)
+    {
+    TPckgC<TRgb> buf(aColor);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfDropShadowBrushSetColor, buf );
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfDropShadowBrush::SetColor panic error %d", err )
+        USER_INVARIANT();
+        }        
+        
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfenv.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1797 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Environment
+*
+*/
+
+
+
+#include <coemain.h>
+#include <AknsConstants.h>
+#include <AknTaskList.h>
+#include <alf/ftokenclient.h>
+#include <aknappui.h>
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alf/alfdisplay.h"
+#include "alf/alfroster.h"
+#include "alf/alfcontrolgroup.h"
+#include "alf/alfevent.h"
+#include "alf/alftexturemanager.h"
+#include "alf/alftextstylemanager.h"
+#include "alfcommandscheduler.h"
+#include "alf/alfstatic.h"
+#include "alf/alflayoutmetrics.h"
+#include "alf/alfconstants.h"
+#include "alf/alfevent.h"
+#include "alf/alfcontrol.h"
+#include "alf/alfbatchbuffer.h"
+#include "alf/alfenvobject.h"
+#include "alfuids.h"
+#include "alfpanic.h"
+
+#include "uiacceltk/HuiUtil.h"
+#include "alflogger.h"
+// Literals and constants
+// This string is used with multiple ALF clients -panic. The panic conserns 
+// only ALF clients, NOT the server!
+_LIT( KUIAcceltkClientPanic, "UIAcceltkClient" );
+
+struct TSharedTextureManagerEntry 
+    {
+    public:
+    	~TSharedTextureManagerEntry()
+        {
+        }
+    	TSharedTextureManagerEntry()                      
+                      : iRefCount(0), iTextureManager(NULL)
+        {                            
+        }
+    	
+    	TSharedTextureManagerEntry(CAlfTextureManager* aTextureManager)                      
+                      : iRefCount(1), iTextureManager(aTextureManager)
+        {
+        }
+
+    /** The texturemanager reference count */
+    TInt iRefCount;
+
+    /** The shared texture manager entry. */
+    CAlfTextureManager* iTextureManager;
+    };
+
+
+// Used flags.
+enum TAlfEnvFlags
+    {
+    EOwnClient =            0x01,
+    ETokenClientConnected = 0x02 
+    // ...add other flags...
+    };
+
+
+// Deault max framerate
+const TInt KAlfDefaultMaxFrameRate = 33;
+    
+// Default flags
+const TUint KAlfEnvDefaultFlags = 0x00;
+
+// Size of buffer towards client side.
+const TInt KAlfTextureInfoMonitorBufferSize = 128;
+
+// ---------------------------------------------------------------------------
+// Returns connected control with ID 
+// ---------------------------------------------------------------------------
+//
+CAlfControl* FindConnectedControl(CAlfControl& aControl, TInt aId, TBool aUserId)
+    {
+    CAlfControl* result = NULL;
+    for ( TInt connectionIndex = 0 ; connectionIndex < aControl.ConnectionCount() && !result ; connectionIndex++ )
+        {
+        CAlfControl& connection = aControl.Connection( connectionIndex );
+        if( (aUserId?
+            connection.Id():
+            connection.Identifier()) 
+                == aId)
+            {
+            result = &connection;
+            }
+        else
+            {
+            result = FindConnectedControl( connection, aId, aUserId );
+            }
+        }
+    
+    return result;
+    }
+
+/**
+ * Gets the pointer evetns from the server
+ */
+NONSHARABLE_CLASS(CAlfPtrEventFetcher):public CActive
+    {
+    public:
+    CAlfPtrEventFetcher(RAlfClient& aClient, CAlfEnv& aEnv)
+        :CActive(CActive::EPriorityHigh),iClient(aClient),iEventAsDescriptor(iEvent),iEnv(aEnv)
+        {
+        CActiveScheduler::Add(this);
+        }
+
+    ~CAlfPtrEventFetcher()
+        {
+        Cancel();
+        }
+
+    void Start()
+        {
+        ASSERT(!IsActive());
+        SetActive();
+        iClient.RequestPointerEvents(iEventAsDescriptor, iStatus);
+        }
+
+    private:
+    void DeliverPointerEventL();
+    
+    void RunL()
+        {
+        if(iStatus.Int() == KErrNone)    
+        	{
+        	DeliverPointerEventL();		
+        	Start();
+        	}
+        else
+        	{
+        	__ALFLOGSTRING1( "~CAlfPtrEventFetcher::RunL error %d", iStatus.Int() )	
+        	}
+        
+        }
+        
+    void DoCancel()
+        {
+        iClient.CancelPointerEvents();
+        }
+
+    TInt RunError(TInt /*aError*/)
+        {
+        //Nothing to worry, just restart
+        Start();
+        return KErrNone;
+        }
+
+    RAlfClient& iClient;
+    TAlfTouchEvent iEvent;
+    TPckg<TAlfTouchEvent> iEventAsDescriptor;
+    CAlfEnv& iEnv;
+    friend class CAlfEnv; // allow env to acces our event data
+    };
+
+void CAlfPtrEventFetcher::DeliverPointerEventL()
+    {
+    TBool eventSent(EFalse);
+    
+    // search clients based on handles from server
+    CAlfControl* ctrl = iEnv.FindControl(iEvent.iControls[0], EFalse);
+    TInt visualIdentifier = iEvent.iVisuals[0];
+    
+    for(TInt ii = 1; ctrl ; ii++)
+        {
+        // Find the visual index
+        CAlfVisual* visual = NULL;
+        for ( TInt i = ctrl->VisualCount() - 1 ; i >= 0 && visualIdentifier ; i-- )
+            {
+            if ( ctrl->Visual( i ).Identifier() == visualIdentifier )
+                {
+                visual = &ctrl->Visual( i );
+                break;
+                }
+            }
+        
+        // Todo: Do we allow ctrl to leave and still pass the event to other cntrls ??
+        TBool consumed = EFalse;
+        TAlfEvent event(*ctrl->Display(), iEvent.iEvent); 
+        event.SetVisual( visual );
+        eventSent = ETrue;
+        /*TRAP_IGNORE(*/consumed = ctrl->OfferEventL(event)/*)*/;
+        if (consumed)
+            {
+            break;
+            }
+            
+        ctrl = iEnv.FindControl(iEvent.iControls[ii], EFalse);
+        visualIdentifier = iEvent.iVisuals[ii];
+        }
+    
+    if (!eventSent)
+        {
+        // ptr event hit visual having groupless control as an owner
+        // we can't resolve destination in toolkit side, just post infromation about the event data to 
+        // action observers and let the app implementation decide whether event is used or nor.
+        iEnv.ReportAction(TAlfActionCommand(KAlfOrpheanPtrEventReceived));
+        }
+    }
+
+
+NONSHARABLE_CLASS(CAlfSystemEventFetcher):public CActive
+    {
+    public:
+    CAlfSystemEventFetcher(RAlfClient& aClient, CAlfEnv& aEnv)
+        :CActive(CActive::EPriorityHigh),iClient(aClient),iEventAsDescriptor(iEvent),iEnv(aEnv)
+        {
+        CActiveScheduler::Add(this);
+        }
+
+    ~CAlfSystemEventFetcher()
+        {
+        Cancel();
+        }
+
+    void Start()
+        {
+        ASSERT(!IsActive());
+        SetActive();
+        iClient.RequestSystemEvents(iEventAsDescriptor, iStatus);
+        }
+
+    private:
+    void DeliverSystemEventL();
+    
+    void RunL()
+        {
+        if(iStatus.Int() != KErrNone)
+            { // for now..
+            USER_INVARIANT();
+            }
+            
+        DeliverSystemEventL();
+        Start();
+        }
+        
+    void DoCancel()
+        {
+        iClient.CancelSystemEvents();
+        }
+
+    TInt RunError(TInt /*aError*/)
+        {
+        //Nothing to worry, just restart
+        Start();
+        return KErrNone;
+        }
+
+    RAlfClient& iClient;
+    TInt iEvent;
+    TPckg<TInt> iEventAsDescriptor;
+    CAlfEnv& iEnv;
+    };
+
+void CAlfSystemEventFetcher::DeliverSystemEventL()
+    {
+    if (iEvent == KAknsMessageSkinChange)
+        {
+        iEnv.SetSkinChangePending(ETrue);
+        iEnv.ReportWsEventAsActionCommand(KAlfActionIdSkinChanged); 
+        // Some action observer may have already called by themselves
+        // NotifySkinChangedL, so check before we do it.
+        if (iEnv.SkinChangePending())
+            {
+            iEnv.NotifySkinChangedL();            
+            }        
+        }
+    }
+       
+/**
+ * Texture information monitor.
+ */
+NONSHARABLE_CLASS( CAlfTextureInfoMonitor ) : public CActive
+    {
+public:
+    /**
+     * Two-phased constructor.
+     * @param aClient reference to client.
+     */
+    static CAlfTextureInfoMonitor* NewL( CAlfEnv& aEnv );
+    
+    /**
+     * Destructor.
+     */
+    ~CAlfTextureInfoMonitor();
+       
+private:
+
+    /**
+     * Constructor.
+     * @param aClient reference to client.
+     */
+    CAlfTextureInfoMonitor( CAlfEnv& aEnv );
+    
+    /**
+     * Symbian OS constructor.
+     */
+    void ConstructL();
+
+    /**
+     * Issues a request.
+     */
+    void IssueRequest();
+    
+    /**
+     * Called by active object framework when request is completed.
+     */
+    virtual void RunL();
+    
+    /**
+     * Cancels pending request.
+     */
+    virtual void DoCancel();
+    
+private:
+    
+    /**
+     * Reference to environment.
+     */
+    CAlfEnv& iEnv;    
+    
+    /**
+     * Buffer containing texture info events.
+     */
+    TBuf8< KAlfTextureInfoMonitorBufferSize > iTextureEventBuffer;
+    };
+
+CAlfTextureInfoMonitor* CAlfTextureInfoMonitor::NewL( CAlfEnv& aEnv )
+    {
+    CAlfTextureInfoMonitor* self = 
+        new (ELeave) CAlfTextureInfoMonitor( aEnv );
+
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    
+    return self;    
+    }
+    
+CAlfTextureInfoMonitor::~CAlfTextureInfoMonitor()
+    {
+    Cancel();
+    }
+    
+CAlfTextureInfoMonitor::CAlfTextureInfoMonitor( CAlfEnv& aEnv )
+    : CActive( CActive::EPriorityStandard ),
+      iEnv( aEnv )
+    {
+    CActiveScheduler::Add( this );
+    }
+    
+void CAlfTextureInfoMonitor::ConstructL()
+    {
+    IssueRequest();
+    }
+
+void CAlfTextureInfoMonitor::IssueRequest()
+    {
+    iEnv.Client().TextureNotifyInfo( iStatus, iTextureEventBuffer );
+    SetActive();
+    }
+    
+void CAlfTextureInfoMonitor::RunL()
+    {
+    if ( iStatus.Int() == KErrNone )
+        {
+        iEnv.HandleTextureInfo( iTextureEventBuffer );
+        IssueRequest();
+        }
+    }
+    
+void CAlfTextureInfoMonitor::DoCancel()
+    {
+    iEnv.Client().TextureCancelNotifyInfo();
+    }
+
+// Private data
+struct CAlfEnv::TPrivateData
+    {
+    // Structure used to hold owned objects in the extension array
+    struct TObjectHolder
+        {
+        TInt iUid;
+        MAlfEnvObject* iObject;
+        };
+    TPrivateData():iFlags(0),iClient(0),iSharedRoster(0),
+                   iTextureManager(0),iTextStyleManager(0),iScheduler(0),
+                   iMaxFrameRate(0),iRefreshMode(EAlfRefreshModeAutomatic),
+                   iStatic(0),iLayoutMetricsUtility(0),iPointerEventAo(0),
+                   iBatchBufferHandler(0){}
+    TUint iFlags;                                   // Owned.
+    RAlfClient* iClient;                            // Owned/not owned - see EOwnClient
+    CAlfRoster* iSharedRoster;                      // Owned.
+    RPointerArray<CAlfDisplay> iDisplays;           // Owned.
+    RPointerArray<CAlfControlGroup> iLoadedGroups;  // Owned.
+    CAlfTextureManager* iTextureManager;            // Owned.
+    CAlfTextStyleManager* iTextStyleManager;        // Owned.
+    RPointerArray<MAlfActionObserver> iActionObservers;   // Owned.
+    RArray<TSharedTextureManagerEntry> iSharedTextureManagers; // Owned.
+    CAlfCommandScheduler* iScheduler;               // Owned.
+    TInt iMaxFrameRate;
+    TAlfRefreshMode iRefreshMode;
+    RFTokenClient   iTokenClient;                    // lazy bound, connected once first real request occurs
+    CAlfStatic* iStatic;                              // Owned.
+    CAlfLayoutMetricsUtility* iLayoutMetricsUtility;  // Owned.
+    CAlfPtrEventFetcher* iPointerEventAo;             // Owned.
+    CAlfSystemEventFetcher* iSystemEventAo;             // Owned.
+    TVersion iApiVersion;
+    CAlfBatchBuffer* iBatchBufferHandler;
+        
+    // Flags to avoid unnecessary skin & layout notify calls
+    TBool iNotifySkinChangePending;  
+    TBool iNotifyLayoutChangePending;  
+    
+    CAlfTextureInfoMonitor* iTextureInfoMonitor; // Owned.
+    
+    RArray<CAlfEnv::TPrivateData::TObjectHolder> iExtensionArray;
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfEnv::CAlfEnv()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfEnv::ConstructL(TVersion aVersion)
+    {
+    /*  
+    // AknEventMonitor can be used if we want to know the target control also
+    // Otherwise CoeMonitor should be used for better compatibility between 
+    // releases 
+      
+    CAknAppUi* appUi = iAvkonAppUi; // actually macro using coe static...
+    if (appUi && appUi->EventMonitor())
+        {
+        appUi->EventMonitor()->AddObserverL(this);
+        appUi->EventMonitor()->Enable();
+        }
+*/
+
+    // Enforces single CAlfEnv policy. Panics ONLY the client, NOT the server!!
+    __ASSERT_ALWAYS( !CAlfEnv::Static(), User::Panic( KUIAcceltkClientPanic, EAlfEnvPanicMultipleAlfEnvironments ) );
+    
+    CCoeEnv* coeStatic = CCoeEnv::Static();
+    if ( coeStatic )
+        {
+        coeStatic->AddMessageMonitorObserverL(*this);
+        }
+
+    // Create private data
+    iData = new (ELeave) TPrivateData;
+
+    iData->iApiVersion = aVersion;
+    
+    // NULL member data before anything else may leave.
+    iData->iClient = NULL;
+    iData->iSharedRoster = NULL;
+    iData->iTextureManager = NULL;
+    iData->iTextStyleManager = NULL;
+    iData->iScheduler = NULL;
+    iData->iStatic = NULL;
+    iData->iLayoutMetricsUtility = NULL;
+    iData->iPointerEventAo = NULL;
+    iData->iSystemEventAo = NULL;
+    iData->iBatchBufferHandler = NULL;
+    iData->iTextureInfoMonitor = NULL;
+                
+    // Set flags
+    iData->iFlags = KAlfEnvDefaultFlags;
+    
+    // Set client ( pekjokel: client can be passed from outside as well? )
+    iData->iClient = new (ELeave) RAlfClient;
+    iData->iFlags |= EOwnClient;
+    iData->iClient->OpenL();
+    
+    if (coeStatic)
+        {
+        CAknTaskList* taskList = CAknTaskList::NewLC(coeStatic->WsSession());
+        const RArray<RWsSession::TWindowGroupChainInfo>& chain = taskList->WgArray();
+        const TInt chainCount = chain.Count();
+
+        TInt parentId = 0;
+
+        TInt wgId = coeStatic->RootWin().Identifier();
+        for ( TInt ii = 0; ii < chainCount; ii++ )
+            {
+            const RWsSession::TWindowGroupChainInfo& info = chain[ ii ];
+            if ( info.iId == wgId )
+                {
+                parentId = info.iParentId;
+                break;
+                }
+            }
+        
+        if (parentId > 0)
+            {
+            iData->iClient->SetWgParent(parentId);
+            }
+  
+        CleanupStack::PopAndDestroy();       
+        }
+        
+     // Create a shared roster. This is used by all overlaid displays.
+    iData->iSharedRoster = new (ELeave) CAlfRoster;
+    iData->iSharedRoster->ConstructL(NULL);
+    
+    iData->iDisplays.Reset();
+    iData->iLoadedGroups.Reset();
+    
+    iData->iMaxFrameRate = KAlfDefaultMaxFrameRate;
+        
+    // Create a texture manager.
+    User::LeaveIfError( iData->iClient->TextureUpdateOwnerId() );
+    iData->iTextureManager = CAlfTextureManager::NewL(*this, TUid::Uid(0));
+    iData->iTextureManager->AddLoadObserverL(this);
+    iData->iTextureManager->AddStateObserverL(this);
+    iData->iSharedTextureManagers.Reset();
+    
+    // Create a text style manager.
+    iData->iTextStyleManager = CAlfTextStyleManager::NewL(*this);
+    
+    // Command scheduler
+    iData->iScheduler = CAlfCommandScheduler::NewL( *this ); 
+    
+    // Static data storage
+    iData->iStatic = CAlfStatic::NewL(this);
+        
+    // Layout metrics utility
+    iData->iLayoutMetricsUtility = CAlfLayoutMetricsUtility::NewL(*this);
+    
+    // Create one shared pointer event fetcher for all displays and start it
+    // to listen to incoming pointer events.
+    iData->iPointerEventAo = new (ELeave) CAlfPtrEventFetcher(Client(), *this); 
+    iData->iPointerEventAo->Start();
+
+    iData->iSystemEventAo = new (ELeave) CAlfSystemEventFetcher(Client(), *this); 
+    iData->iSystemEventAo->Start();
+    
+    iData->iBatchBufferHandler = CAlfBatchBuffer::NewL( *this );
+
+    iData->iNotifySkinChangePending = EFalse;
+    iData->iNotifyLayoutChangePending = EFalse;
+
+    iData->iTextureInfoMonitor = 
+        CAlfTextureInfoMonitor::NewL( *this );
+    
+    }
+
+// ---------------------------------------------------------------------------
+// 2-phased contructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfEnv* CAlfEnv::NewL(TVersion aVersion)
+    {
+    CAlfEnv* self = CAlfEnv::NewLC(aVersion);
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2-phased contructor. Object stays on the stack.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfEnv* CAlfEnv::NewLC(TVersion aVersion)
+    {
+    CAlfEnv* self = new( ELeave ) CAlfEnv;
+    CleanupStack::PushL( self );    
+    
+    // Check client API compatibility. 
+    if (aVersion.iMajor != self->Version().iMajor)
+        {
+        User::Leave(KErrNotSupported);    
+        }
+    
+    self->ConstructL(aVersion);
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfEnv::~CAlfEnv()
+    {
+    // Delete struct items
+    if ( iData )
+        {
+        delete iData->iBatchBufferHandler;
+        iData->iBatchBufferHandler = NULL;
+        
+        // Destroy pointer event fetcher
+        delete iData->iPointerEventAo;
+        iData->iPointerEventAo = NULL;
+
+        delete iData->iSystemEventAo;
+        iData->iSystemEventAo = NULL;
+                
+        iData->iLoadedGroups.ResetAndDestroy();
+        iData->iDisplays.ResetAndDestroy();
+        delete iData->iSharedRoster;
+        iData->iSharedRoster = NULL;        
+        
+        delete iData->iScheduler;
+        iData->iScheduler= NULL;
+        
+        // Delete extension objects in reverse order.
+        // (Objects should be added with dependent objects after the object on which they depend)
+        for (TInt extensionIndex = iData->iExtensionArray.Count()-1 ; 
+            extensionIndex >= 0; 
+            extensionIndex--)
+            {
+            MAlfEnvObject* obj =  iData->iExtensionArray[extensionIndex].iObject;
+            if ( obj)
+                {
+                obj->Release();   
+                }
+            }
+        iData->iExtensionArray.Reset();
+        iData->iExtensionArray.Close();
+                
+        if (iData->iTextureManager)
+            {
+            iData->iTextureManager->RemoveLoadObserver(this);
+            iData->iTextureManager->RemoveStateObserver(this);
+            }
+
+        delete iData->iTextureManager;
+        iData->iTextureManager = NULL;
+    
+        delete iData->iTextStyleManager;
+        iData->iTextStyleManager = NULL;
+        
+        // Remove shared texture managers if any exists
+   	    RArray<TSharedTextureManagerEntry>& managers = (iData->iSharedTextureManagers);
+       	TInt count = iData->iSharedTextureManagers.Count();
+        for(TInt i = 0; i < count; i++)
+          	{
+          	TSharedTextureManagerEntry entry = managers[i];
+            entry.iTextureManager->RemoveLoadObserver(this);
+            entry.iTextureManager->RemoveStateObserver(this);          	
+          	delete entry.iTextureManager;
+      		managers.Remove(i);
+        	}  								                       
+
+        iData->iSharedTextureManagers.Close();	    
+
+        delete iData->iTextureInfoMonitor;
+        iData->iTextureInfoMonitor = NULL;
+
+        // ... close, release, delete other member data...
+        iData->iActionObservers.Close();
+        
+        // Disconnect and delete client if owned
+        if ( (iData->iFlags&EOwnClient) && iData->iClient )
+            {
+            iData->iClient->Disconnect();
+            delete iData->iClient;
+            }
+        iData->iClient = NULL;
+        iData->iFlags &= ~EOwnClient;
+        
+        delete iData->iLayoutMetricsUtility;
+        
+      
+
+        delete iData->iStatic;
+        }
+    
+    // Delete struct
+    delete iData;
+    iData = NULL;
+
+/*  
+    // AknEventMonitor can be used if we want to know the target control also
+    // Otherwise CoeMonitor should be used for better compatibility between 
+    // releases 
+  
+    CAknAppUi* appUi = iAvkonAppUi; // actually macro using coe static...
+    if (appUi && appUi->EventMonitor())
+        {
+        appUi->EventMonitor()->RemoveObserver(this);
+        appUi->EventMonitor()->Enable(EFalse);
+        }
+*/
+
+    CCoeEnv* coeStatic = CCoeEnv::Static();
+    if ( coeStatic )
+        {
+        coeStatic->RemoveMessageMonitorObserver(*this);
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Returns the client
+// ---------------------------------------------------------------------------
+//
+EXPORT_C RAlfClient& CAlfEnv::Client()
+    {
+    __ASSERT_ALWAYS( iData, USER_INVARIANT() );
+    __ASSERT_ALWAYS( iData->iClient, USER_INVARIANT() );
+    __ASSERT_ALWAYS( iData->iClient->Handle(), USER_INVARIANT() );
+    
+    iData->iClient->SetAlfEnv(*this);
+    return *iData->iClient;
+    }
+
+// ---------------------------------------------------------------------------
+// Creates new display
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C CAlfDisplay& CAlfEnv::NewDisplayL(
+    const TRect& aRect,
+    TInt aFlags,
+    TInt aDisplayType)
+    {
+    return NewDisplayL(aRect, aFlags, NULL, aDisplayType, KAlfUidBackBufferScreen0);    
+    }  
+    
+// ---------------------------------------------------------------------------
+// Creates new display
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C CAlfDisplay& CAlfEnv::NewDisplayL( 
+	const TRect& aRect, 
+	TInt aFlags, 
+	CAlfDisplay* /*aRosterOwningDisplay*/, 
+    TInt aDisplayType, 
+    TUid aBackBufferUid )
+    {
+    CAlfRoster* roster = NULL;
+    
+    if(aFlags & ENewDisplayOverlaid)
+        {
+        roster = iData->iSharedRoster;
+        }
+    
+    TBool asCoeControl = EFalse;
+    if ( aFlags & ENewDisplayAsCoeControl )
+        {
+        asCoeControl = ETrue;
+        }
+           
+    CAlfDisplay* display = new (ELeave) CAlfDisplay;
+    CleanupStack::PushL(display);
+    display->ConstructL(*this, asCoeControl,aRect, roster, aDisplayType, aBackBufferUid);
+    CleanupStack::Pop(display);
+    TInt err = iData->iDisplays.Append(display);
+    if ( err != KErrNone )
+        {
+        delete display;
+        User::Leave( err );
+        }                
+    return *display;
+    }  
+// ---------------------------------------------------------------------------
+// Called when display is deleted.
+// ---------------------------------------------------------------------------
+// 
+void CAlfEnv::RemoveDisplay(CAlfDisplay& aDisplay)
+    {
+    // Actually this is "DestroyDisplay"
+
+    /** @todo  Make a proper observer. */
+    TInt index = iData->iDisplays.Find(&aDisplay);
+    if(index >= 0)
+        {
+        iData->iDisplays.Remove(index);
+        iData->iDisplays.Compress();
+        }
+    // @todo: remove from the server side
+    }
+
+// ---------------------------------------------------------------------------
+// Creates new control group
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfControlGroup& CAlfEnv::NewControlGroupL( TInt aId )
+    {
+    if ( FindControlGroup( aId ) )
+        {
+        User::Leave( KErrAlreadyExists );
+        }
+    
+    CAlfControlGroup* group = new (ELeave) CAlfControlGroup;
+    CleanupStack::PushL( group );
+    group->ConstructL( aId, *this );
+    CleanupStack::Pop( group );
+    TInt err = iData->iLoadedGroups.Append( group );
+    if ( err != KErrNone )
+        {
+        delete group;
+        User::Leave( err );
+        }
+    
+    return *group;
+    }
+ 
+// ---------------------------------------------------------------------------
+// Deletes control group
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C TInt CAlfEnv::DeleteControlGroup(TInt aId)
+    {
+    TInt i;
+
+    for(i = 0; i < iData->iLoadedGroups.Count(); ++i)
+        {
+        if(iData->iLoadedGroups[i]->ResourceId() == aId)
+            {
+            CAlfControlGroup* group = iData->iLoadedGroups[i];
+
+            CancelCommands(group);
+
+            for (TInt ii = iData->iDisplays.Count()-1; ii>=0; ii--)
+                {
+                CAlfRoster& r = iData->iDisplays[ii]->Roster();
+                TInt index = r.Find(*group);
+                if (index != KErrNotFound)
+                    {
+                    r.Hide(*group); // update server
+                    r.Remove(group); // update client 
+                    }
+                }
+
+            // This is control group to delete.
+            iData->iLoadedGroups.Remove(i);
+            delete group;
+            return KErrNone;
+            }
+        }
+
+    return KErrNotFound;
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns control group with ID
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfControlGroup& CAlfEnv::ControlGroup(TInt aResourceId)
+    {
+    for(TInt i = 0; i < iData->iLoadedGroups.Count(); ++i)
+        {
+        if(iData->iLoadedGroups[i]->ResourceId() == aResourceId)
+            {
+            return *iData->iLoadedGroups[i];
+            }
+        }
+
+    // Group hasn't been loaded yet
+    /** @todo load automatically? */
+    __ASSERT_DEBUG( EFalse, USER_INVARIANT() );
+    return *iData->iLoadedGroups[0];
+    }
+   
+// ---------------------------------------------------------------------------
+// Returns control group with ID or NULL if not found
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C CAlfControlGroup* CAlfEnv::FindControlGroup(TInt aResourceId) const
+    {
+    for(TInt i = 0; i < iData->iLoadedGroups.Count(); ++i)
+        {
+        if(iData->iLoadedGroups[i]->ResourceId() == aResourceId)
+            {
+            return iData->iLoadedGroups[i];
+            }
+        }
+
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns control with ID
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfControl* CAlfEnv::FindControl(TInt aId, TBool aUserId) const
+    {
+    for(TInt i = 0; i < iData->iLoadedGroups.Count(); ++i)
+        {
+        CAlfControl* control = iData->iLoadedGroups[i]->FindControl(aId, aUserId);
+        if(control)
+            {
+            return control;
+            }
+        }
+        
+    // If we cannot found it from any of the groups, check the connections
+    for(TInt groupIndex = 0; groupIndex < iData->iLoadedGroups.Count(); ++groupIndex)
+        {
+        CAlfControlGroup* controlGroup = iData->iLoadedGroups[groupIndex];
+        
+        for ( TInt controlIndex = 0 ; controlIndex < controlGroup->Count() ; controlIndex++ )
+            {
+            CAlfControl* foundControl = FindConnectedControl(controlGroup->Control(controlIndex), aId, aUserId);
+            if ( foundControl )
+                {
+                return foundControl;
+                }
+            }
+        } 
+        
+    // The control does not exist.
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns display count
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfEnv::DisplayCount() const
+    {
+    return iData->iDisplays.Count();
+    }
+ 
+// ---------------------------------------------------------------------------
+// Set refresh mode.
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C void CAlfEnv::SetRefreshMode( TAlfRefreshMode aMode )
+    {
+    Client().EnvSetRefreshMode( aMode );
+    iData->iRefreshMode = TAlfRefreshMode(aMode);
+    }
+    
+// ---------------------------------------------------------------------------
+// Set max frame rate.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfEnv::SetMaxFrameRate( TReal32 aFrameRate ) __SOFTFP
+    {
+    Client().EnvSetMaxFrameRate( aFrameRate );
+    iData->iMaxFrameRate = (TInt)aFrameRate;
+    }
+
+// ---------------------------------------------------------------------------
+// Continues refresh
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfEnv::ContinueRefresh()
+    {
+    Client().EnvContinueRefresh();
+    }
+
+// ---------------------------------------------------------------------------
+// Pauses refresh
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfEnv::PauseRefresh()
+    {
+    Client().EnvPauseRefresh();
+    }
+  
+// ---------------------------------------------------------------------------
+// Called when a redraw is wanted
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C TInt CAlfEnv::RefreshCallBack(TAny* aInstance)
+    {
+    CAlfEnv* self = static_cast<CAlfEnv*>( aInstance );
+    self->Client().EnvRefreshCallBack();
+    return KErrNone;
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns the first display
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfDisplay& CAlfEnv::PrimaryDisplay() const
+    {
+    return *iData->iDisplays[0];
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTextureManager& CAlfEnv::TextureManager() const
+    {
+    return *iData->iTextureManager;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTextStyleManager& CAlfEnv::TextStyleManager() const
+    {
+    return *iData->iTextStyleManager;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MAknWsEventObserver
+// Controls server based on raw ws events
+// ---------------------------------------------------------------------------
+//
+void CAlfEnv::HandleWsEventL(const TWsEvent& aEvent, CCoeControl* /*aDestination*/)
+    {
+    __ASSERT_ALWAYS(iData, USER_INVARIANT());
+
+	TInt eventType = aEvent.Type();
+	// block these two here to avoid any extra execution beneath avkon level
+    if (eventType == KAknFullOrPartialForegroundLost ||
+        eventType == KAknFullOrPartialForegroundGained )
+        {        
+        const TBool foreground = (eventType == KAknFullOrPartialForegroundGained);      
+         
+        iData->iClient->ApplicationIsForeground(foreground);
+        iData->iScheduler->AppicationOnForeground(foreground);
+
+        if (foreground)
+            {
+            ReportWsEventAsActionCommand(KAlfActionIdForegroundGained); 
+            }
+        else
+            {            
+            ReportWsEventAsActionCommand(KAlfActionIdForegroundLost);    
+            }                                    
+        } 
+    else if (eventType == EEventFocusGained)
+        {
+        ReportWsEventAsActionCommand(KAlfActionIdFocusGained);            
+        }        
+    else if (eventType == EEventFocusLost)
+        {
+        ReportWsEventAsActionCommand(KAlfActionIdFocusLost);                        
+        }        
+    else if (eventType == KEikInputLanguageChange)
+        {
+        ReportWsEventAsActionCommand(KAlfActionIdInputLanguageChanged);    
+        }
+    else if (eventType == EEventUser)
+        {
+        TApaSystemEvent* systemEvent = (TApaSystemEvent*) aEvent.EventData();
+        if (*systemEvent == EApaSystemEventSecureShutdown)
+            {
+            ReportWsEventAsActionCommand(KAlfActionIdExitRequested);        
+            }
+        else if (CEikonEnv::Static())
+            {                                         
+            if (*systemEvent == EApaSystemEventShutdown && 
+                !CEikonEnv::Static()->IsSystem())
+                {
+                ReportWsEventAsActionCommand(KAlfActionIdExitRequested);    
+                }
+            }
+        }        
+    else
+        {
+        // for PC lint
+        }
+
+
+    // - Skin change events are handled from CAlfSystemEventFetcher
+    // - Layout change events are handled from CAlfDisplay
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfEnv::AddActionObserverL(MAlfActionObserver* aObserver)
+    {
+    if (iData->iActionObservers.Find(aObserver) == KErrNotFound)
+        {
+        iData->iActionObservers.AppendL(aObserver);        
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfEnv::RemoveActionObserver(MAlfActionObserver* aObserver)
+    {
+    TInt index = iData->iActionObservers.Find(aObserver); 
+    if (index != KErrNotFound )
+        {
+        iData->iActionObservers.Remove(index);            
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfEnv::HandleActionL(const TAlfActionCommand& aActionCommand)
+    { // handle in reverse order as action observer may remove it self during handling of command
+    for (TInt ii = iData->iActionObservers.Count()-1; ii >= 0; ii-- )
+        {
+        iData->iActionObservers[ii]->HandleActionL(aActionCommand);
+        }
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfEnv::Send(const TAlfCommand& aCommand, TInt aDelayMilliSeconds )
+    {
+    TRAPD( err , iData->iScheduler->ScheduleCommandL( aCommand, aDelayMilliSeconds ) );
+    return err;
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfEnv::CancelCommands( TAny* aObject )
+    {
+    if (iData->iScheduler)
+        {
+        iData->iScheduler->CancelCommands( aObject );
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfEnv::CancelCustomCommands(MAlfEventHandler* aObject)
+    {
+    if (iData->iScheduler)
+        {
+        iData->iScheduler->CancelCommands( aObject );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfEnv::CancelCommands(TAny* aObject, TAlfOp aCommandOperation)
+    {
+    if (iData->iScheduler)
+        {
+        iData->iScheduler->CancelCommands( aObject , aCommandOperation );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfEnv::CancelCommands( TAny* aObject, TAlfCommandType aCommandType )
+    {
+    // use overloaded CancelCustomCommands instead for custom commands
+    __ASSERT_DEBUG( aCommandType != EAlfCommandTypeCustomEvent, USER_INVARIANT() );
+    
+    if (iData->iScheduler)
+        {
+        iData->iScheduler->CancelCommands( aObject, aCommandType, 0 );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfEnv::CancelCustomCommands(MAlfEventHandler* aObject, TInt aCustomParam )
+    {
+    if (iData->iScheduler)
+        {
+        iData->iScheduler->CancelCommands( aObject, EAlfCommandTypeCustomEvent, aCustomParam );
+        }
+    }
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfEnv::MilliSecondsUntilCommand( TAny* aObject )
+    {
+    return iData->iScheduler->MilliSecondsUntilCommand( aObject ); 
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfEnv::MilliSecondsUntilCustomCommand(MAlfEventHandler* aObject)
+    {
+    return iData->iScheduler->MilliSecondsUntilCommand( aObject ); 
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfEnv::MilliSecondsUntilCommand(TAny* aObject, TAlfOp aCommandOperation)
+    {
+    return iData->iScheduler->MilliSecondsUntilCommand( aObject , aCommandOperation ); 
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfEnv::MilliSecondsUntilCommand( TAny* aObject, TAlfCommandType aCommandType )
+    {
+    // use overloaded CancelCustomCommands instead for custom commands
+    __ASSERT_DEBUG( aCommandType != EAlfCommandTypeCustomEvent, USER_INVARIANT() );
+    
+    return iData->iScheduler->MilliSecondsUntilCommand( aObject, aCommandType, 0 ); 
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C TInt CAlfEnv::MilliSecondsUntilCustomCommand(MAlfEventHandler* aObject, TInt aCustomParam )
+    {
+    return iData->iScheduler->MilliSecondsUntilCommand( aObject, EAlfCommandTypeCustomEvent, aCustomParam ); 
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TKeyResponse CAlfEnv::HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType,
+                                        CAlfDisplay* aAssocDisplay)
+    {
+    if(aAssocDisplay)
+        {
+        TAlfEvent event(*aAssocDisplay, aKeyEvent, aType);
+
+        if(aAssocDisplay->Roster().HandleEventL(event))
+            {
+            return EKeyWasConsumed;
+            }
+        return EKeyWasNotConsumed;
+        }
+
+    return EKeyWasNotConsumed;
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfEnv::BroadcastEventL(const TAlfEvent& aEvent)
+    {
+    for(TInt i = 0; i < iData->iDisplays.Count(); ++i)
+        {
+        TAlfEvent event = aEvent;
+        event.SetDisplay( iData->iDisplays[i] );
+        /** @todo  Musn't access the roster directly. */
+        iData->iDisplays[i]->Roster().HandleEventL(event);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CAlfEnv::ReportAction(const TAlfActionCommand& aCommand)
+    {
+    TInt resultError = KErrNone;
+
+    for(TInt i = 0; i < iData->iActionObservers.Count(); ++i)
+        {
+        TRAPD(err, iData->iActionObservers[i]->HandleActionL(aCommand));
+        if(err != KErrNone && resultError == KErrNone)
+            {
+            // The first error code is returned.
+            resultError = err;
+            }
+        }
+    return resultError;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTextureManager* CAlfEnv::CreateSharedTextureManagerL(TUid aUid)
+    {
+    CAlfTextureManager* retVal = NULL;
+    RArray<TSharedTextureManagerEntry>& managers = (iData->iSharedTextureManagers);
+    TInt count = managers.Count();
+    for(TInt i = 0; i < count; i++)
+      	{
+    	if (managers[i].iTextureManager->ManagerUid() == aUid)
+    		{
+    		managers[i].iRefCount++;    			
+    		retVal = managers[i].iTextureManager;
+    		}
+    	}
+    	
+    // Does not yet exist, create new one	
+    if (!retVal)
+        {
+       	CAlfTextureManager* manager = CAlfTextureManager::NewL(*this, aUid);	  								                       
+        TSharedTextureManagerEntry entry(manager);
+        managers.Append(entry);
+        retVal = manager;    	          
+        retVal->AddLoadObserverL(this);
+        retVal->AddStateObserverL(this);        
+        }                
+
+    return retVal;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfEnv::DeleteSharedTextureManager(TUid aUid)
+    {
+    RArray<TSharedTextureManagerEntry>& managers = (iData->iSharedTextureManagers);
+    TInt count = managers.Count();
+    for(TInt i = 0; i < count; i++)
+      	{
+    	if (managers[i].iTextureManager->ManagerUid() == aUid)
+    		{
+    		if (managers[i].iRefCount <= 1)
+    		    {
+                managers[i].iTextureManager->RemoveLoadObserver(this);
+                managers[i].iTextureManager->RemoveStateObserver(this);
+    		    delete managers[i].iTextureManager;
+       			managers.Remove(i);
+       			managers.Compress();    			        
+    		    }
+    		else
+    		    {
+    		    managers[i].iRefCount--;        
+    		    }    			    
+    		break;
+    		}  								                       
+        }                
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTextureManager* CAlfEnv::SharedTextureManager(TUid aUid) const
+    {
+    CAlfTextureManager* retVal = NULL;
+
+    RArray<TSharedTextureManagerEntry>& managers = (iData->iSharedTextureManagers);
+    TInt count = managers.Count();
+    for(TInt i = 0; i < count; i++)
+      	{
+    	if (managers[i].iTextureManager->ManagerUid() == aUid)
+    		{
+            retVal = managers[i].iTextureManager;
+         	break;
+    		}  								                       
+        }                
+        
+    return retVal;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfEnv::TextureLoadingCompleted(CAlfTexture& /*aTexture*/,
+                                         TInt /*aTextureId*/,
+                                         TInt /*aErrorCode*/)
+    {
+    // This is not used at the moment, but in the future may be needed.            
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfEnv::TextureManagerStateChanged(const CAlfTextureManager& /*aManager*/)
+    {
+    // When texture manager is loading, reduce framerate little.
+/*
+    if (aManager.State() == CAlfTextureManager::EIdle)
+        {
+        Client().EnvSetMaxFrameRate( iData->iMaxFrameRate );
+        }
+    else
+        {        
+        Client().EnvSetMaxFrameRate( iData->iMaxFrameRate/2 );            
+        }            
+*/
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfRefreshMode CAlfEnv::RefreshMode()
+    {
+    return iData->iRefreshMode;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfRenderer CAlfEnv::Renderer() const
+    {
+    return TAlfRenderer(iData->iClient->EnvRenderer());            
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfEnv::SetIdleThreshold(TInt aMilliSeconds)
+    {
+    Client().EnvSetIdleThreshold(aMilliSeconds);    
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfEnv::Release(TBool aReleaseSharedTextures)
+    {
+    iData->iTextStyleManager->ReleaseAllVisuals();
+    
+    iData->iTextureManager->Release();
+    if (aReleaseSharedTextures)
+        {
+        RArray<TSharedTextureManagerEntry>& managers = (iData->iSharedTextureManagers);
+        TInt count = managers.Count();
+        for(TInt i = 0; i < count; i++)
+          	{
+        	managers[i].iTextureManager->Release();    	  								                       
+            }                            
+        }        
+
+    }
+   
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfEnv::RestoreL()
+    {
+    iData->iTextureManager->RestoreL();
+    RArray<TSharedTextureManagerEntry>& managers = (iData->iSharedTextureManagers);
+    TInt count = managers.Count();
+    for(TInt i = 0; i < count; i++)
+      	{
+    	managers[i].iTextureManager->RestoreL();    	  								                       
+        }                            
+    iData->iTextStyleManager->RefreshAllVisuals();
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfEnv::SetFullScreenDrawing(TBool aEnable)
+    {
+    Client().SetFullScreenDrawing(aEnable);
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfEnv::NotifySkinChangedL()
+    {
+    SetSkinChangePending(EFalse);       
+    iData->iTextureManager->NotifySkinChangedL();
+    RArray<TSharedTextureManagerEntry>& managers = (iData->iSharedTextureManagers);
+    TInt count = managers.Count();
+    for(TInt i = 0; i < count; i++)
+      	{
+    	managers[i].iTextureManager->NotifySkinChangedL();    	  								                       
+        }                            
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfEnv::NotifyLayoutChangedL()
+    {
+    SetLayoutChangePending(EFalse); 
+    for(TInt i = 0; i < iData->iDisplays.Count(); ++i)
+        {
+        iData->iDisplays[i]->NotifyLayoutChangedL();
+        }        
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C RFTokenClient* CAlfEnv::TokenClient()
+    {
+    ASSERT(iData);
+    if (!(iData->iFlags&ETokenClientConnected))
+        {
+        TInt err = iData->iTokenClient.Connect();
+        if (!err)
+            {
+            iData->iFlags |= ETokenClientConnected;
+            }
+        }
+    
+    if (iData->iFlags&ETokenClientConnected)
+        {
+        return &iData->iTokenClient;
+        }
+    else 
+        {
+        return NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// for better compatibility with different S60 releases
+// ---------------------------------------------------------------------------
+//
+void CAlfEnv::MonitorWsMessage(const TWsEvent& aEvent)
+    {
+    TRAP_IGNORE(CAlfEnv::HandleWsEventL(aEvent, 0))
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfLayoutMetricsUtility* CAlfEnv::LayoutMetricsUtility()
+    {
+    return iData->iLayoutMetricsUtility;    
+    }
+
+// ---------------------------------------------------------------------------
+// DEPRECATED: Widget code removed!
+// ---------------------------------------------------------------------------
+//
+EXPORT_C IAlfWidgetFactory& CAlfEnv::WidgetFactory()const
+    {
+    IAlfWidgetFactory* ret(NULL); 
+    return *ret;    
+    }
+
+// ---------------------------------------------------------------------------
+// DEPRECATED: Widget code removed!
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfEnv::AppendWidgetL(IAlfWidget* /*aAlfWidget*/)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// DEPRECATED: Widget code removed!
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfEnv::DestroyWidget(IAlfWidget* /*aAlfWidget*/)
+    {
+    return 0;    
+    }
+
+// ---------------------------------------------------------------------------
+// DEPRECATED: Widget code removed!
+// ---------------------------------------------------------------------------
+//
+EXPORT_C IAlfWidget* CAlfEnv::FindWidget(const char* /*aWidgetName*/) const
+    {
+    IAlfWidget* ret(NULL);
+    return ret;
+    }
+
+// ---------------------------------------------------------------------------
+// Uses CAlfStatic directly. friend is needed to access dll static 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfEnv* CAlfEnv::Static()
+    {
+    if ( CAlfStatic::Data() )
+        {
+        return &CAlfStatic::Env();
+        }
+        
+    return 0;
+    }
+
+// ---------------------------------------------------------------------------
+// Support for extreme usecases where there are several controls but they don't
+// belong to ctrl groups (so env cannot deliver the event by it self, but 
+// application needs to fetch events based on notifications from environment) 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TPointerEvent* CAlfEnv::LastReceivedPtrEvent()
+    {
+    if (iData && iData->iPointerEventAo)
+        {
+        return &iData->iPointerEventAo->iEvent.iEvent;
+        }
+    return 0;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TVersion CAlfEnv::Version() const
+    {
+    return TVersion(ALF_VERSION_MAJOR, ALF_VERSION_MINOR, ALF_VERSION_BUILD);    
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TVersion CAlfEnv::ApiVersion() const
+    {
+    return iData->iApiVersion;    
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfBatchBuffer& CAlfEnv::BatchBufferHandler() const
+    {
+    return *iData->iBatchBufferHandler;
+    }
+
+void CAlfEnv::ReportWsEventAsActionCommand(TInt aActionCommandId)
+    {
+    if (aActionCommandId == KAlfActionIdDeviceLayoutChanged) 
+        {            
+        SetLayoutChangePending(ETrue); 
+        ReportAction(TAlfActionCommand(aActionCommandId));      
+        // If action obeserver did not call NotifyLayoutChangedL, we do it.
+        if (LayoutChangePending())
+            {
+            TRAP_IGNORE(NotifyLayoutChangedL());    
+            }
+        }
+    else
+        {
+        ReportAction(TAlfActionCommand(aActionCommandId));      
+        }            
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CAlfEnv::SkinChangePending() const
+    {
+    return iData->iNotifySkinChangePending;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfEnv::SetSkinChangePending(TBool aPending)
+    {
+    iData->iNotifySkinChangePending = aPending;        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CAlfEnv::LayoutChangePending() const
+    {
+    return iData->iNotifyLayoutChangePending;   
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfEnv::SetLayoutChangePending(TBool aPending)
+    {
+    iData->iNotifyLayoutChangePending = aPending;    
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfEnv::HandleTextureInfo( const TDesC8& aEventData )
+    {
+    // Notify texture manager with new information.
+
+    TAlfTextureInfoEvent eventData;
+    TPckg< TAlfTextureInfoEvent > eventBuf( eventData );
+    const TInt eventBufMaxLength = eventBuf.MaxLength();
+    TPtrC8 remainder( aEventData );
+    
+    while ( eventBufMaxLength <= remainder.Length() )
+        {
+        // Get event data - note that as data is copied to local buffer,
+        // there is no need to worry about padding issues.
+        eventBuf.Copy( remainder.Left( eventBufMaxLength ) );
+        remainder.Set( remainder.Mid( eventBufMaxLength ) );
+        
+        // Inform texture manager.
+        TRAP_IGNORE(iData->iTextureManager->ReportTextureInfoL( 
+            eventData.iTextureId, 
+            eventData.iTextureSize ));      
+        }
+            
+    // Note: texture information events are not delivered to shared texture
+    // managers (iData->iSharedTextureManagers) as this feature is not supported
+    // for those.    
+    }
+
+
+
+EXPORT_C MAlfEnvObject* CAlfEnv::Extension( TInt aUid) const
+    {
+    TPrivateData::TObjectHolder holder;
+    holder.iUid = aUid;
+    TInt index = iData->iExtensionArray.Find(holder);
+    if (index!=KErrNotFound)
+        {
+        return iData->iExtensionArray[index].iObject;
+        }
+    else
+        {
+        return NULL;
+        } 
+    }
+
+EXPORT_C TInt CAlfEnv::AddExtension( TInt aUid, MAlfEnvObject* aNewExtension)
+    {
+    TPrivateData::TObjectHolder holder;
+    holder.iUid = aUid;
+    holder.iObject = aNewExtension;
+    return iData->iExtensionArray.Append(holder);
+    }
+
+EXPORT_C void CAlfEnv::HandlePointerEventL(const TPointerEvent& aPointerEvent, 
+                                   CAlfDisplay& aAssocDisplay)
+    {
+    aAssocDisplay.HandlePointerEventL(aPointerEvent);
+    }
+
+// ---------------------------------------------------------------------------
+// Returns index of the display
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfEnv::FindDisplayIndex(const CAlfDisplay& aDisplay) const
+    {
+    TInt index = iData->iDisplays.Find(&aDisplay);
+    return index;
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns indexed display
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C CAlfDisplay& CAlfEnv::Display( TInt aIndex) const
+    {
+    return *iData->iDisplays[aIndex];
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfevent.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,300 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Event class.
+*
+*/
+
+
+
+#include "alf/alfevent.h"
+#include "alf/alfvisual.h"
+#include <alf/alfscrollerevent.h>
+
+#include <uiacceltk/HuiUtil.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TAlfEvent::TAlfEvent(CAlfDisplay& aDisplay, TType aType)
+        : iDisplay(&aDisplay),
+          iCode( EEventNull ),
+          iParam(KErrNotFound),
+          iType(aType),
+          iVisual( NULL )
+          
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfEvent::TAlfEvent(TInt aCustomParam)
+        : iDisplay(NULL),
+          iCode( EEventNull ),
+          iParam(aCustomParam),
+          iCustomEventData(0),
+          iType(ETypeCustom),
+          iVisual( NULL )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfEvent::TAlfEvent(TInt aCustomParam, TInt aCustomEventData)
+        : iDisplay(NULL),
+          iCode( EEventNull ),
+          iParam(aCustomParam),
+          iCustomEventData(aCustomEventData),
+          iType(ETypeCustom),
+          iVisual( NULL )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfEvent::TAlfEvent( 
+    CAlfDisplay& aDisplay, 
+    const TAlfScrollerEvent& aEvent )
+        : iDisplay(&aDisplay),
+          iCode( EEventNull ),
+          iScrollerEvent(aEvent),
+          iParam(0),
+          iCustomEventData(0),
+          iType(ETypeScroller),
+          iVisual( NULL )
+    {
+    }
+
+   
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TAlfEvent::TAlfEvent(
+    CAlfDisplay& aDisplay, const TKeyEvent& aKeyEvent, TEventCode aType)
+        : iDisplay(&aDisplay),
+          iCode(aType),
+          iKeyEvent(aKeyEvent),
+          iParam(KErrNotFound),
+          iType(ETypeKey),
+          iVisual( NULL )
+    {
+    }
+  
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TAlfEvent::TAlfEvent( CAlfDisplay& aDisplay, 
+                      const TPointerEvent& aPointerEvent )
+        : iDisplay(&aDisplay),
+          iCode( EEventNull ),
+          /*iPointerEvent(*aPointerEvent.AdvancedPointerEvent()),*/
+          iParam( KErrNotFound ),
+          iType(ETypePointer),
+          iVisual( NULL )
+    {
+     if ( aPointerEvent.iModifiers &EModifierAdvancedPointerEvent )
+         {
+         iPointerEvent = *aPointerEvent.AdvancedPointerEvent();
+         }
+     else
+         {
+         iPointerEvent.iType=aPointerEvent.iType;       
+         iPointerEvent.iPosition=aPointerEvent.iPosition;
+         iPointerEvent.iParentPosition=aPointerEvent.iParentPosition;
+         }
+    }
+
+// ---------------------------------------------------------------------------
+// Is pointer event?
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool TAlfEvent::IsPointerEvent() const
+    {
+    return iType == ETypePointer;
+    }
+   
+// ---------------------------------------------------------------------------
+// Returns pointer event
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C const TPointerEvent& TAlfEvent::PointerEvent() const
+    {
+    __ASSERT_ALWAYS( IsPointerEvent(), USER_INVARIANT() );
+    return iPointerEvent;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns event type.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfEvent::TType TAlfEvent::Type() const
+    {
+    return iType;    
+    }
+    
+// ---------------------------------------------------------------------------
+// Is custom event?
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool TAlfEvent::IsCustomEvent() const
+    {
+    return iType == ETypeCustom;        
+    }
+
+// ---------------------------------------------------------------------------
+// Is it a scroller input event?
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool TAlfEvent::IsScrollerEvent() const
+    {
+    return iType == ETypeScroller; 
+    }
+
+// ---------------------------------------------------------------------------
+// Returns scroller event
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TAlfScrollerEvent TAlfEvent::ScrollerEvent() const
+    {
+    __ASSERT_ALWAYS( IsScrollerEvent(), USER_INVARIANT() );
+    TAlfScrollerEvent scrollerEvent = iScrollerEvent;
+    return scrollerEvent;
+    }
+    
+// ---------------------------------------------------------------------------
+// Is key event?
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool TAlfEvent::IsKeyEvent() const
+    {
+    return iType == ETypeKey;
+    }
+
+// ---------------------------------------------------------------------------
+// Return key event code.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TEventCode& TAlfEvent::Code() const
+    {
+    __ASSERT_ALWAYS( IsKeyEvent(), USER_INVARIANT() );
+    return iCode;
+    }
+
+// ---------------------------------------------------------------------------
+// Return key event.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TKeyEvent& TAlfEvent::KeyEvent() const
+    {
+    __ASSERT_ALWAYS( IsKeyEvent(), USER_INVARIANT() );
+    return iKeyEvent;
+    }
+    
+// ---------------------------------------------------------------------------
+// Return custom event parameter
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt TAlfEvent::CustomParameter() const
+    {
+    __ASSERT_ALWAYS( IsCustomEvent(), USER_INVARIANT() );
+    return iParam;
+    }
+
+// ---------------------------------------------------------------------------
+// Return custom event data
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt TAlfEvent::CustomEventData() const
+    {
+    __ASSERT_ALWAYS( IsCustomEvent(), USER_INVARIANT() );
+    return iCustomEventData;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets display
+// ---------------------------------------------------------------------------
+//    
+void TAlfEvent::SetDisplay( CAlfDisplay* aDisplay )
+    {
+    iDisplay = aDisplay;
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns display or NULL
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C CAlfDisplay* TAlfEvent::Display( ) const
+    {
+    return iDisplay;
+    }
+
+// ---------------------------------------------------------------------------
+// Check if the event is pointer down event.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TBool TAlfEvent::PointerDown() const
+    {
+    return iType == ETypePointer &&
+           iPointerEvent.iType == TPointerEvent::EButton1Down;
+    }
+
+// ---------------------------------------------------------------------------
+// Check if the event is pointer up event.
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C TBool TAlfEvent::PointerUp() const
+    {
+    return iType == ETypePointer &&
+           iPointerEvent.iType == TPointerEvent::EButton1Up;
+    }
+
+// ---------------------------------------------------------------------------
+// Check if the event is long pointer event.
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C TBool TAlfEvent::PointerLongTap() const
+    {
+    return iType == ETypePointer &&
+           iPointerEvent.iType == TPointerEvent::EButtonRepeat;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the associated visual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void TAlfEvent::SetVisual(CAlfVisual* aVisual)
+    {
+    iVisual = aVisual;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the visual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C CAlfVisual* TAlfEvent::Visual() const
+    {
+    return iVisual;
+    }
+    
+  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfflowlayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,200 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Flow layout
+*
+*/
+
+
+
+#include "alf/alfflowlayout.h"
+#include "alf/alfcontrol.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alf/alfconstants.h"
+#include "alf/alfgencomponent.h"
+#include "alflogger.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+// Private structure
+struct CAlfFlowLayout::TFlowLayoutPrivateData
+    {
+    TInt iMode; // flow mode flags
+    };
+
+
+// ======== LOCAL FUNCTIONS ========
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// 1st phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfFlowLayout::CAlfFlowLayout()
+    : CAlfLayout()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfFlowLayout::ConstructL(CAlfControl& aOwner)
+    {
+    CAlfLayout::ConstructL(aOwner);
+    
+    iFlowLayoutData = new (ELeave) TFlowLayoutPrivateData;
+    iFlowLayoutData->iMode = 0;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfFlowLayout::~CAlfFlowLayout()
+    {
+    delete iFlowLayoutData;
+    iFlowLayoutData = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Creates new anchor layout for the control.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfFlowLayout* CAlfFlowLayout::AddNewL(
+    CAlfControl& aOwnerControl,
+    CAlfLayout* aParentLayout )
+    {
+    CAlfFlowLayout* layout = STATIC_CAST(CAlfFlowLayout*,
+        aOwnerControl.AppendLayoutL(EAlfLayoutTypeFlow, aParentLayout));
+    return layout;
+    }
+
+EXPORT_C void CAlfFlowLayout::SetFlowDirection(TFlowDirection aDirection)
+    {
+    TPckgC<TFlowDirection> inBuf(aDirection);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfFlowLayoutSetFlowDirection, inBuf );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfFlowLayout::SetFlowDirection panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+    
+EXPORT_C void CAlfFlowLayout::SetCentering(TBool aCentering)
+    {
+    TPckgC<TBool> inBuf(aCentering);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfFlowLayoutSetCentering, inBuf );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfFlowLayout::SetCentering panic error %d", err )
+        USER_INVARIANT();
+        }
+        
+	// Update client side data
+    if(aCentering)
+        {
+        iFlowLayoutData->iMode |= EModeCenterPerpendicular;
+        }
+    else
+        {
+        iFlowLayoutData->iMode &= ~EModeCenterPerpendicular;
+        }
+        
+    }
+
+EXPORT_C void CAlfFlowLayout::SetMode(TInt aMode)
+    {
+    TPckgC<TInt> inBuf(aMode);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfFlowLayoutSetMode, inBuf );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfFlowLayout::SetMode panic error %d", err )
+        USER_INVARIANT();
+        }
+        
+    // Update local copy of data.
+    iFlowLayoutData->iMode = aMode;        
+    }
+    
+EXPORT_C TInt CAlfFlowLayout::Mode() const
+    {
+    return iFlowLayoutData->iMode;    
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfFlowLayout::RemoveAndDestroyAllD()
+    {
+    CAlfLayout::RemoveAndDestroyAllD();
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfFlowLayout::UpdateChildrenLayout(TInt aTransitionTime )
+    {
+    CAlfLayout::UpdateChildrenLayout( aTransitionTime );
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfVisual* CAlfFlowLayout::FindTag(const TDesC8& aTag)
+    {
+    return CAlfLayout::FindTag( aTag );
+    }
+// ---------------------------------------------------------------------------
+// Place holder from CAlfLayout
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TAlfXYMetric CAlfFlowLayout::BaseUnit() const
+    {
+    return CAlfLayout::BaseUnit();
+    }
+ 
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfFlowLayout::DoRemoveAndDestroyAllD()
+    {
+    CAlfLayout::DoRemoveAndDestroyAllD();
+    }
+    
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfFlowLayout::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfLayout::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
+    }
+    
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfframebrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,327 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Frame brush
+*
+*/
+
+
+
+#include "alf/alfframebrush.h"
+#include "alf/alfenv.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfconstants.h"
+#include "alflogger.h"
+#include "alfskinnableimage.h"
+
+const TInt KNumberOfFrameParts = 9;
+
+// Private data structure
+struct CAlfFrameBrush::TFrameBrushPrivateData
+    {
+    CAlfSkinnableImage* iImage;
+    CAlfSkinnableImage* iFramePartImages[KNumberOfFrameParts];
+    };
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfFrameBrush::CAlfFrameBrush()
+    : CAlfBrush()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfFrameBrush::ConstructL(CAlfEnv& aEnv, const TAknsItemID& aIID, 
+    const TAlfXYMetric& aEdgeOffset)
+    {
+    iFrameBrushData = new (ELeave) TFrameBrushPrivateData;
+    iFrameBrushData->iImage = NULL;
+    Mem::FillZ(iFrameBrushData->iFramePartImages, (sizeof(TInt)*KNumberOfFrameParts));
+
+    iFrameBrushData->iImage = new (ELeave) CAlfSkinnableImage(&aEnv);       
+    
+    for (TInt i=0; i<KNumberOfFrameParts;i++)
+        {
+        iFrameBrushData->iFramePartImages[i] = new (ELeave) CAlfSkinnableImage(&aEnv); 
+        }
+    
+    TAlfFrameBrushMetricParams params;
+    params.iInnerRect = TRect(0,0,0,0);
+    params.iOuterRect = TRect(0,0,0,0);
+    params.iFrameIID = aIID;
+    params.iEdgeOffset = aEdgeOffset;
+    
+    TPckgC<TAlfFrameBrushMetricParams> paramsPckg(params);
+        
+    CAlfBrush::ConstructL(
+        aEnv,
+        EAlfFrameBrushCreateMetric,
+        0,
+        paramsPckg
+        );
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfFrameBrush::ConstructL(CAlfEnv& aEnv, const TAknsItemID& aIID, 
+    TInt aEdgeOffsetX, TInt aEdgeOffsetY)
+    {
+    iFrameBrushData = new (ELeave) TFrameBrushPrivateData;
+    iFrameBrushData->iImage = NULL;
+    Mem::FillZ(iFrameBrushData->iFramePartImages, (sizeof(TInt)*KNumberOfFrameParts));
+
+    iFrameBrushData->iImage = new (ELeave) CAlfSkinnableImage(&aEnv);       
+
+    for (TInt i=0; i<KNumberOfFrameParts;i++)
+        {
+        iFrameBrushData->iFramePartImages[i] = new (ELeave) CAlfSkinnableImage(&aEnv); 
+        }
+    
+    TAlfFrameBrushParams params;
+    params.iInnerRect = TRect(0,0,0,0);
+    params.iOuterRect = TRect(0,0,0,0);
+    params.iFrameIID = aIID;
+    params.iEdgeOffsetX = aEdgeOffsetX;
+    params.iEdgeOffsetY = aEdgeOffsetY;
+    
+    TPckgC<TAlfFrameBrushParams> paramsPckg(params);
+        
+    CAlfBrush::ConstructL(
+        aEnv,
+        EAlfFrameBrushCreate,
+        0,
+        paramsPckg
+        );
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfFrameBrush::ConstructL(CAlfEnv& aEnv, const TAlfImage& aImage, const TAlfXYMetric& aEdgeOffset)
+    {
+    iFrameBrushData = new (ELeave) TFrameBrushPrivateData;
+    iFrameBrushData->iImage = NULL;
+    Mem::FillZ(iFrameBrushData->iFramePartImages, (sizeof(TInt)*KNumberOfFrameParts));
+
+    iFrameBrushData->iImage = new (ELeave) CAlfSkinnableImage(&aEnv);       
+    for (TInt i=0; i<KNumberOfFrameParts;i++)
+        {
+        iFrameBrushData->iFramePartImages[i] = new (ELeave) CAlfSkinnableImage(&aEnv); 
+        }
+    
+    iFrameBrushData->iImage->SetImage(aImage); // This texturizes skin graphics if needed
+
+    TAlfFrameBrushImageParams params;
+    params.iEdgeOffset = aEdgeOffset;
+    params.iImage = TAlfImageParams(iFrameBrushData->iImage->Image());
+    
+    TPckgC<TAlfFrameBrushImageParams> paramsPckg(params);
+        
+    CAlfBrush::ConstructL(
+        aEnv,
+        EAlfFrameBrushCreateImage,
+        0,
+        paramsPckg
+        );        
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfFrameBrush* CAlfFrameBrush::NewL(CAlfEnv& aEnv,
+    const TAknsItemID& aIID, TInt aEdgeOffsetX, TInt aEdgeOffsetY)
+    {
+    CAlfFrameBrush* self = CAlfFrameBrush::NewLC( aEnv, aIID, aEdgeOffsetX, aEdgeOffsetY );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfFrameBrush* CAlfFrameBrush::NewLC(CAlfEnv& aEnv, 
+    const TAknsItemID& aIID, TInt aEdgeOffsetX, TInt aEdgeOffsetY)
+    {
+    CAlfFrameBrush* self = new( ELeave ) CAlfFrameBrush;
+    CleanupStack::PushL( self );
+    self->ConstructL(aEnv, aIID, aEdgeOffsetX, aEdgeOffsetY);
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfFrameBrush* CAlfFrameBrush::NewL(CAlfEnv& aEnv,
+    const TAknsItemID& aIID, const TAlfXYMetric& aEdgeOffset)
+    {
+    CAlfFrameBrush* self = CAlfFrameBrush::NewLC( aEnv, aIID, aEdgeOffset );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfFrameBrush* CAlfFrameBrush::NewLC(CAlfEnv& aEnv, 
+    const TAknsItemID& aIID, const TAlfXYMetric& aEdgeOffset)
+    {
+    CAlfFrameBrush* self = new( ELeave ) CAlfFrameBrush;
+    CleanupStack::PushL( self );
+    self->ConstructL( aEnv, aIID, aEdgeOffset );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfFrameBrush::SetFrameRectsL(const TRect& aInnerRect, const TRect& aOuterRect)
+    {
+    TAlfFrameBrushParams params;
+    params.iInnerRect = aInnerRect;
+    params.iOuterRect = aOuterRect;
+
+    TPckgC<TAlfFrameBrushParams> paramsPckg(params);        
+
+    TInt err = Comms()->DoCmdNoReply(EAlfFrameBrushSetFrameRects, paramsPckg );    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfFrameBrush::SetFrameRectsL ignore error %d", err )
+        }
+        
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CAlfFrameBrush::~CAlfFrameBrush()
+    {
+    if ( iFrameBrushData )
+        {
+        delete iFrameBrushData->iImage;
+        iFrameBrushData->iImage = NULL;    	        
+        
+        for (TInt i=0; i<KNumberOfFrameParts;i++)
+            {
+            delete iFrameBrushData->iFramePartImages[i]; 
+            iFrameBrushData->iFramePartImages[i] = NULL;
+            }        
+        }
+    delete iFrameBrushData;
+    iFrameBrushData = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfFrameBrush::SetEdgeOffset(const TAlfXYMetric& aEdgeOffset)
+    {
+    TPckgC<TAlfXYMetric> paramsPckg(aEdgeOffset);        
+
+    TInt err = Comms()->DoCmdNoReply(EAlfFrameBrushSetEdgeOffsetMetric, paramsPckg);    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfFrameBrush::SetEdgeOffset (TAlfXYMetric) ignore error %d", err )
+        }                        
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfFrameBrush::SetImage(const TAlfImage& aImage)
+    {
+    iFrameBrushData->iImage->SetImage(aImage); // This texturizes skin graphics if needed
+
+    TAlfImageParams params = TAlfImageParams(iFrameBrushData->iImage->Image());
+    TPckgC<TAlfImageParams> paramsPckg(params);        
+
+    TInt err = Comms()->DoCmdNoReply(EAlfFrameBrushSetImage, paramsPckg );    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfFrameBrush::SetImage ignore error %d", err )
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfFrameBrush* CAlfFrameBrush::NewL(CAlfEnv& aEnv, const TAlfImage& aImage, const TAlfXYMetric& aEdgeOffset)
+    {
+    CAlfFrameBrush* self = CAlfFrameBrush::NewLC( aEnv, aImage, aEdgeOffset );
+    CleanupStack::Pop( self );
+    return self;        
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfFrameBrush* CAlfFrameBrush::NewLC(CAlfEnv& aEnv, const TAlfImage& aImage, const TAlfXYMetric& aEdgeOffset)
+    {
+    CAlfFrameBrush* self = new( ELeave ) CAlfFrameBrush;
+    CleanupStack::PushL( self );
+    self->ConstructL( aEnv, aImage, aEdgeOffset );
+    return self;        
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfFrameBrush::SetImage(TFrameParts aFramePart, const TAlfImage& aImage)
+    {
+    iFrameBrushData->iFramePartImages[aFramePart]->SetImage(aImage); // This texturizes skin graphics if needed
+
+    TAlfImageParams imageparams = TAlfImageParams(iFrameBrushData->iFramePartImages[aFramePart]->Image());
+    
+    TAlfFrameBrushFramePartImageParams params;
+    params.iImage = imageparams;
+    params.iFramePart = aFramePart;
+    
+    TPckgC<TAlfFrameBrushFramePartImageParams> paramsPckg(params);        
+
+    TInt err = Comms()->DoCmdNoReply(EAlfFrameBrushSetFramePartImage, paramsPckg );    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfFrameBrush::SetImage () ignore error %d", err )
+        }        
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfgc.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,460 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 context
+*
+*/
+
+
+
+#include <alf/alfgc.h>
+#include <alf/alfenv.h>
+#include <alf/alftexture.h>
+#include <alf/alftimedvalue.h>
+#include <alf/alftextstyle.h>
+#include <alf/alfrealline.h>
+#include "alflogger.h"
+
+//#include <uiacceltk/huicanvasconstants.h>
+
+
+enum TAlfCanvasCommands
+    {
+    EAlfCanvasDrawImage,
+    EAlfCanvasDrawText,
+    EAlfCanvasDrawLines,
+	EAlfCanvasDrawEllipse,
+	EAlfCanvasDrawPoints,
+	EAlfCanvasDrawPolygon,
+	EAlfCanvasDrawRects,
+
+	// Setters
+    EAlfCanvasSetTextStyle,
+	EAlfCanvasSetPenColor,
+	EAlfCanvasSetPenWidth,
+	EAlfCanvasSetOpacity,
+	EAlfCanvasSetPolygonDrawMode,
+	EAlfCanvasSetTextAlign,
+
+    // Transformations
+	EAlfCanvasLoadIdentity,
+	EAlfCanvasTranslate,
+	EAlfCanvasScale,
+	EAlfCanvasRotate,
+	
+	EAlfCanvasPrepareDrawText
+    };
+
+NONSHARABLE_STRUCT( TAlfCanvasEndDrawParams )
+    {
+    TInt    iDummy1;
+    TInt    iDummy2;
+    TInt    iDummy3;
+    TInt    iDummy4;
+    };
+    
+NONSHARABLE_STRUCT( TAlfCanvasDrawImageParams )
+    {
+    TInt    iTexture;
+    TReal32 iDestinationRectTopLeftX;
+    TReal32 iDestinationRectTopLeftY;
+    TReal32 iDestinationRectBottomRightX;
+    TReal32 iDestinationRectBottomRightY;
+    };
+
+NONSHARABLE_STRUCT( TAlfCanvasDrawTextParams )
+    {
+    TReal32 iDestinationRectTopLeftX;
+    TReal32 iDestinationRectTopLeftY;
+    TReal32 iDestinationRectBottomRightX;
+    TReal32 iDestinationRectBottomRightY;
+    };
+    
+NONSHARABLE_STRUCT( TAlfCanvasDrawLinesParams )
+    {
+    TInt iLineCount;
+	RArray<TReal32> iPointCords;
+	};    
+
+NONSHARABLE_STRUCT( TAlfCanvasDrawEllipseParams )
+	{
+    TReal32 iDestinationRectTopLeftX;
+    TReal32 iDestinationRectTopLeftY;
+    TReal32 iDestinationRectBottomRightX;
+    TReal32 iDestinationRectBottomRightY;
+    };
+    	
+	
+	// Setters
+NONSHARABLE_STRUCT( TAlfCanvasSetTextStyleParams )
+    {
+    TInt  iTextstyleId;
+    };
+
+NONSHARABLE_STRUCT( TAlfCanvasSetPenColorParams )
+	{
+    TRgb  iPenColor;
+    };
+NONSHARABLE_STRUCT( TAlfCanvasSetPenWidthParams )
+	{
+    TReal32  iPenWidth;
+    };
+NONSHARABLE_STRUCT( TAlfCanvasSetOpacityParams )
+	{
+    TReal32  iOpacity;
+    };
+NONSHARABLE_STRUCT( TAlfCanvasSetPolygonDrawModeParams )
+	{
+    TInt  iPolygonDrawMode;
+    };
+NONSHARABLE_STRUCT( TAlfCanvasSetTextAlignParams )
+	{
+    TInt  iTextAlignHorizontal;
+    TInt  iTextAlignVertical;
+    };
+
+
+   // Transformations
+NONSHARABLE_STRUCT( TAlfCanvasLoadIdentityParams )
+	{
+	TInt iDummy;
+	};
+	
+NONSHARABLE_STRUCT( TAlfCanvasTranslateParams )
+	{
+	TReal32 iX; 
+	TReal32 iY; 
+	TReal32 iZ;
+	};
+	
+NONSHARABLE_STRUCT( TAlfCanvasScaleParams )
+	{
+	TReal32 iX; 
+	TReal32 iY; 
+	TReal32 iZ;
+	};
+	
+NONSHARABLE_STRUCT( TAlfCanvasRotateParams )
+	{
+	TReal32 iAngle;
+	TReal32 iX; 
+	TReal32 iY; 
+	TReal32 iZ;
+	};
+
+    
+template <class T>
+HBufC8* AlfGcExternalizeL( const RArray<T>& aArray )
+    {
+    const TInt itemCount = aArray.Count();
+    if ( !itemCount)
+        {
+        return HBufC8::NewL(0);
+        }
+    
+    const T* firstItem = &aArray[0];    
+    TPtrC8 arrayPtr( (TUint8*)firstItem, itemCount*sizeof(T) );            
+    HBufC8* buffer = HBufC8::NewL( sizeof(TInt) + arrayPtr.Length() );
+    TPtr8 ptr = buffer->Des();     
+    
+    ptr.Append( (const TUint8*)&itemCount, sizeof(TInt) );
+    ptr.Append( arrayPtr );    
+    return buffer;
+    }
+
+
+const TInt KAlfGcBufferGranularity = 1024;
+
+struct CAlfGc::TAlfGcData
+    {
+    TAlfGcData() : iBuffer(NULL) {}
+    HBufC8* iBuffer;
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CAlfGc* CAlfGc::NewL()
+    {
+    CAlfGc* self = new (ELeave) CAlfGc;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CAlfGc::CAlfGc()
+    {
+    }
+    
+void CAlfGc::ConstructL()
+    {
+    iData = new (ELeave) TAlfGcData;
+    }
+    
+CAlfGc::~CAlfGc()
+    {
+    if ( iData )
+        {
+        delete iData->iBuffer;
+        iData->iBuffer = NULL;
+        }
+    delete iData;
+    iData = NULL;
+    }
+    
+
+void CAlfGc::ActivateL()
+    {    
+    Deactivate(); // Just in case...
+    iData->iBuffer = HBufC8::NewL( KAlfGcBufferGranularity );
+    }
+
+HBufC8* CAlfGc::CommandBuffer()
+    {
+    return iData->iBuffer;      
+    }
+    
+void CAlfGc::Deactivate()
+    {        
+    delete iData->iBuffer;
+    iData->iBuffer = NULL;
+    }
+    
+void CAlfGc::AppendCommand( TInt aCommand, const TDesC8& aParams )
+    {
+    TRAP_IGNORE(AppendCommandL(aCommand,aParams));
+    }
+
+void CAlfGc::AppendCommandL( TInt aCommand, const TDesC8& aParams )
+    {
+    if (!iData->iBuffer)
+        {
+        return;    
+        }
+    
+    __ALFLOGSTRING1( "CAlfGc::AppendCommand - start, buffer length: %d", iData->iBuffer->Length() )
+    
+    // create a bigger buffer if needed
+    const TInt newSpaceNeeded = 4 + 4 + aParams.Length() + 4;
+    __ALFLOGSTRING1( "CAlfGc::AppendCommand - new space needed: %d", newSpaceNeeded)
+    if ( iData->iBuffer->Des().MaxLength() - iData->iBuffer->Length() < newSpaceNeeded )
+        {
+        __ALFLOGSTRING1( "CAlfGc::AppendCommand - allocating new buffer length: %d", iData->iBuffer->Length() + newSpaceNeeded * 2  )
+        iData->iBuffer = iData->iBuffer->ReAllocL( iData->iBuffer->Length() + newSpaceNeeded * 2 );
+        } 
+    
+    TPtr8 ptr = iData->iBuffer->Des();
+    TInt length = aParams.Length();
+    TInt command = aCommand;
+    
+    ptr.Append( (const TUint8*)&command, sizeof(TInt) );
+    ptr.Append( (const TUint8*)&length, sizeof(TInt) );
+    ptr.Append( aParams );
+    
+    TInt padding = 0;
+    if (length % 4)
+        {
+        padding = 4 - length % 4;    
+        }
+    
+    for ( TInt i = 0 ; i < padding ; i++ )
+        {
+        ptr.Append( 0xFF );        
+        }        
+    
+    for ( TInt i = 0 ; i < aParams.Length() ; i++ )
+        {
+        __ALFLOGSTRING2( "[%d]: %d", i, aParams[i] )
+        }
+    
+    __ALFLOGSTRING1( "CAlfGc::AppendCommand - end, buffer length: %d", iData->iBuffer->Length() )
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfGc::DrawImage(const CAlfTexture& aTexture, const TAlfRealRect& aDestinationRect)   
+    {
+    TInt serversideTexture = aTexture.ServerHandle();
+    
+    const TAlfCanvasDrawImageParams params = {serversideTexture, 
+        aDestinationRect.iTl.iX,
+        aDestinationRect.iTl.iY,
+        aDestinationRect.iBr.iX,
+        aDestinationRect.iBr.iY
+     };
+    TPckgC<TAlfCanvasDrawImageParams> paramsPckg( params );
+    AppendCommand( EAlfCanvasDrawImage, paramsPckg );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfGc::DrawText(const TDesC& aText, const TAlfRealRect& aDestinationRect)
+    {
+        TPtrC8 ptr(reinterpret_cast<const TUint8 *>(aText.Ptr()), aText.Length()*2);                
+        AppendCommand( EAlfCanvasPrepareDrawText, ptr );
+        
+        const TAlfCanvasDrawTextParams params = { 
+            aDestinationRect.iTl.iX,
+            aDestinationRect.iTl.iY,
+            aDestinationRect.iBr.iX,
+            aDestinationRect.iBr.iY
+            };
+        TPckgC<TAlfCanvasDrawTextParams> paramsPckg( params );                    
+        AppendCommand( EAlfCanvasDrawText, paramsPckg );        
+    }
+
+void CAlfGc::DrawLines(const RArray<TReal32> & aLinesPointCords)
+	{
+	HBufC8* buffer = NULL;
+    TRAP_IGNORE(buffer = AlfGcExternalizeL(aLinesPointCords))
+    if (buffer)
+        {        
+    	AppendCommand( EAlfCanvasDrawLines, *buffer );
+    	delete buffer;
+    	buffer = NULL;
+        }
+	}
+	
+
+void CAlfGc::DrawEllipse(const TAlfRealRect& aDestinationRect)
+	{
+	const TAlfCanvasDrawEllipseParams params = {
+        aDestinationRect.iTl.iX,
+        aDestinationRect.iTl.iY,
+        aDestinationRect.iBr.iX,
+        aDestinationRect.iBr.iY
+     };
+    TPckgC<TAlfCanvasDrawEllipseParams> paramsPckg( params );
+    AppendCommand( EAlfCanvasDrawEllipse, paramsPckg );
+	}
+
+void CAlfGc::DrawPoints(const RArray<TReal32> & aPointsCords)
+	{
+	HBufC8* buffer = NULL;
+    TRAP_IGNORE(buffer = AlfGcExternalizeL(aPointsCords))
+    if (buffer)
+        {        
+    	AppendCommand( EAlfCanvasDrawPoints, *buffer );
+    	delete buffer;
+    	buffer = NULL;
+        }
+	}
+	
+void CAlfGc::DrawPolygon(const RArray<TReal32> & aPolygonPointCords)
+	{
+	HBufC8* buffer = NULL;
+    TRAP_IGNORE(buffer = AlfGcExternalizeL(aPolygonPointCords))
+    if (buffer)
+        {        
+    	AppendCommand( EAlfCanvasDrawPolygon, *buffer );
+    	delete buffer;
+    	buffer = NULL;
+        }
+	}
+
+void CAlfGc::DrawRects(const RArray<TReal32> & aRectPointCords)
+	{
+	HBufC8* buffer = NULL;
+    TRAP_IGNORE(buffer = AlfGcExternalizeL(aRectPointCords))
+    if (buffer)
+        {        
+    	AppendCommand( EAlfCanvasDrawRects, *buffer );
+    	delete buffer;
+    	buffer = NULL;
+        }
+	}
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfGc::SetTextStyle(const CAlfTextStyle& aTextStyle)
+    {
+    TInt serverSideTextStyleId = aTextStyle.ServerHandle();    
+    TAlfCanvasSetTextStyleParams params = {serverSideTextStyleId};
+    TPckgC<TAlfCanvasSetTextStyleParams> paramsPckg( params );                    
+    AppendCommand( EAlfCanvasSetTextStyle, paramsPckg );        
+    }
+    
+
+void CAlfGc::SetPenColor(const TRgb& aColor)
+	{
+	TAlfCanvasSetPenColorParams params = {aColor};
+    TPckgC<TAlfCanvasSetPenColorParams> paramsPckg( params );                    
+    AppendCommand( EAlfCanvasSetPenColor, paramsPckg );        
+	}
+	
+void CAlfGc::SetPenWidth(const TReal32& aWidth)
+	{
+	TAlfCanvasSetPenWidthParams params = {aWidth};
+    TPckgC<TAlfCanvasSetPenWidthParams> paramsPckg( params );                    
+    AppendCommand( EAlfCanvasSetPenWidth, paramsPckg );        
+	}
+	
+void CAlfGc::SetOpacity(const TReal32& aOpacity)
+	{
+	TAlfCanvasSetOpacityParams params = {aOpacity};
+    TPckgC<TAlfCanvasSetOpacityParams> paramsPckg( params );                    
+    AppendCommand( EAlfCanvasSetOpacity, paramsPckg );        
+	}
+	
+
+void CAlfGc::SetPolygonDrawMode(TAlfPolygonDrawMode aPolygonDrawMode)
+	{
+	TAlfCanvasSetPolygonDrawModeParams params = {aPolygonDrawMode};
+    TPckgC<TAlfCanvasSetPolygonDrawModeParams> paramsPckg( params );                    
+    AppendCommand( EAlfCanvasSetPolygonDrawMode, paramsPckg );	
+	}
+void CAlfGc::SetTextAlign(TAlfAlignHorizontal aAlignHorizontal, TAlfAlignVertical aAlignVertical)
+	{
+	TAlfCanvasSetTextAlignParams params = {aAlignHorizontal, aAlignVertical};
+    TPckgC<TAlfCanvasSetTextAlignParams> paramsPckg( params );                    
+    AppendCommand( EAlfCanvasSetTextAlign, paramsPckg );	
+	}
+
+    // Transformations
+void CAlfGc::LoadIdentity()
+	{
+	TAlfCanvasLoadIdentityParams params = {0};
+    TPckgC<TAlfCanvasLoadIdentityParams> paramsPckg( params );                    
+    AppendCommand( EAlfCanvasLoadIdentity, paramsPckg );
+	}
+	
+void CAlfGc::Translate(const TReal32& aX, const TReal32& aY, const TReal32& aZ)
+	{
+	TAlfCanvasTranslateParams params = {aX, aY, aZ};
+    TPckgC<TAlfCanvasTranslateParams> paramsPckg( params );                    
+    AppendCommand( EAlfCanvasTranslate, paramsPckg );        
+	}
+	
+void CAlfGc::Scale(const TReal32& aX, const TReal32& aY, const TReal32& aZ)
+	{
+	TAlfCanvasScaleParams params = {aX, aY, aZ};
+    TPckgC<TAlfCanvasScaleParams> paramsPckg( params );                    
+    AppendCommand( EAlfCanvasScale, paramsPckg );        
+	}
+	
+void CAlfGc::Rotate(const TReal32& aAngle, const TReal32& aX, const TReal32& aY, const TReal32& aZ)
+	{
+	TAlfCanvasRotateParams params = {aAngle, aX, aY, aZ};
+    TPckgC<TAlfCanvasRotateParams> paramsPckg( params );                    
+    AppendCommand( EAlfCanvasRotate, paramsPckg );        
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfgencomponent.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,351 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "alf/alfgencomponent.h"
+#include "alf/alfconstants.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alflogger.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+class CAlfMessageObserver;
+ 
+NONSHARABLE_CLASS(RAlfSubsessionSimple): public RSubSessionBase
+    {
+public:
+    TInt Open(CAlfEnv& aEnv, TInt aImplementationId, TInt aImplementationUid, const TDesC8& aConstuctionParams);
+    TInt SendSynch(TUint aOp, const TDesC8& aInputBuf, TDes8& aOutBuf);
+    TInt SendNoReply(TUint aOp, const TDesC8& aInputBuf);
+    void SendAsync(const TDesC8& aInputBuf, TDes8& aOutBuf, CAlfMessageObserver* aObserver); 
+    void Cancel(TInt aCmdId);
+    void Close();
+    TInt Identifier()
+        {
+        return SubSessionHandle();
+        }
+    
+private:
+    RAlfClient* iClient;
+    };
+
+
+NONSHARABLE_CLASS(CAlfMessageObserver):public CActive
+    {
+    public:
+    static CAlfMessageObserver* NewRequestLC(RAlfSubsessionSimple& aClient, MAlfAsyncOpObserver* aObserver, TInt aCmdId, CAlfGenComponent& aComms)
+        {
+        CAlfMessageObserver* me = new (ELeave) CAlfMessageObserver(aClient, aObserver, aCmdId, aComms);
+        me->SetActive();
+        CleanupStack::PushL(me);
+        return me;
+        }
+    
+    TRequestStatus& Status() 
+        {
+        return iStatus;
+        }
+
+    ~CAlfMessageObserver()
+        {
+        Cancel();
+        if (iObserver)
+            {
+            iObserver->AlfAsyncOpCompleted(TInt(this), KErrCancel);
+            }
+        }
+
+    const TDesC8& Des() const
+        {
+        return iAsDescriptor;
+        }
+
+    private:
+    CAlfMessageObserver(RAlfSubsessionSimple& aClient, MAlfAsyncOpObserver* aObserver, TInt aCmdId, CAlfGenComponent& aComms)
+        :CActive(CActive::EPriorityHigh),iClient(aClient), iObserver(aObserver), iComms( aComms ),
+        iParametersAsInts(0,0),
+        iAsDescriptor( iParametersAsInts )
+        {
+        ASSERT(aClient.Identifier());
+        CActiveScheduler::Add(this);
+        iParametersAsInts.iInt1 = aCmdId;
+        iParametersAsInts.iInt2 = reinterpret_cast<TInt>(this);
+        }
+        
+    // ---------------------------------------------------------------------------
+    // from CActive, called when asych request completed by server
+    // ---------------------------------------------------------------------------
+    //    
+    void RunL()
+        {
+        iObserver->AlfAsyncOpCompleted(TInt(this), iStatus.Int());
+        iObserver = 0;
+        
+        iComms.CommandCompleted( this ); // function call deletes 'this'
+        }
+        
+    // ---------------------------------------------------------------------------
+    // from CActive, called if Cancel called while active
+    // ---------------------------------------------------------------------------
+    //
+    void DoCancel()
+        {
+        iClient.Cancel(TInt(this));        
+        }
+
+    // ---------------------------------------------------------------------------
+    // from CActive, will be called if RunL leaves (in this case note allowed )
+    // ---------------------------------------------------------------------------  
+    //
+    TInt RunError(TInt /*aError*/)
+        {
+        // client leaved in AlfAsyncOpCompleted, just panic it
+        USER_INVARIANT();
+        return KErrNone;
+        }
+
+    RAlfSubsessionSimple& iClient;
+    MAlfAsyncOpObserver* iObserver;
+    CAlfGenComponent& iComms;
+    
+    TInt2 iParametersAsInts;
+    TPckgC<TInt2> iAsDescriptor;
+    };
+
+
+// ---------------------------------------------------------------------------
+// creates new subsession
+// ---------------------------------------------------------------------------
+//
+TInt RAlfSubsessionSimple::Open(CAlfEnv& aEnv, TInt aImplementationId, TInt aImplementationUid, const TDesC8& aConstuctionParams)
+    {
+    iClient = &aEnv.Client();
+    (void)iClient->FlushBatchBuffer();
+    TAlfImplementationInformation info(aImplementationId,aImplementationUid, aEnv.ApiVersion());
+    TPckgC<TAlfImplementationInformation> infoBuf(info);
+    return CreateSubSession(*iClient, EAlfCreateSubSession, TIpcArgs(&infoBuf, &aConstuctionParams));
+    }
+
+// ---------------------------------------------------------------------------
+// Synchronous server request
+// ---------------------------------------------------------------------------
+//
+TInt RAlfSubsessionSimple::SendSynch(TUint aOp, const TDesC8& aInputBuf, TDes8& aOutBuf)
+    {
+    (void)iClient->FlushBatchBuffer();
+    return SendReceive(EAlfDoSubSessionCmd, TIpcArgs(aOp,&aInputBuf,&aOutBuf));
+    }
+	 
+TInt RAlfSubsessionSimple::SendNoReply(TUint aOp, const TDesC8& aInputBuf )
+    {
+	return(iClient->SendNoReply(aOp, aInputBuf, SubSessionHandle()));
+    }
+
+// ---------------------------------------------------------------------------
+// Sets asynchronous request
+// ---------------------------------------------------------------------------
+//
+void RAlfSubsessionSimple::SendAsync(const TDesC8& aInputBuf, TDes8& aOutBuf, CAlfMessageObserver* aObserver)
+    {
+    (void)iClient->FlushBatchBuffer();
+    SendReceive(EAlfDoAsyncSubSessionCmd, TIpcArgs(&aObserver->Des(),&aInputBuf,&aOutBuf), aObserver->Status());
+    }
+
+// ---------------------------------------------------------------------------
+// cancels asynch operation if active
+// ---------------------------------------------------------------------------
+//
+void RAlfSubsessionSimple::Cancel(TInt aCmdId)
+    {
+    if (SubSessionHandle())
+        {
+        SendReceive(EAlfSubSCancelAsynchRequest, TIpcArgs(aCmdId));
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// terminates server side resources
+// ---------------------------------------------------------------------------
+//
+void RAlfSubsessionSimple::Close()
+    {
+    if ( SubSessionHandle() )
+        {
+        (void)iClient->FlushBatchBuffer();
+        }
+    CloseSubSession(EAlfCloseSubSession);    
+    }
+
+// private data
+NONSHARABLE_CLASS(CAlfGenComponent::TPrivateData)
+    {
+    public:
+    
+    RAlfSubsessionSimple iClient;
+    RPointerArray<CAlfMessageObserver> iObservers;
+    };
+
+// ---------------------------------------------------------------------------
+// Public constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfGenComponent* CAlfGenComponent::NewL(
+            CAlfEnv& aEnv,
+            TInt aImplementationId, 
+            TInt aImplementationUid, 
+            const TDesC8& aConstructionParams)
+    {
+    CAlfGenComponent* me = new (ELeave) CAlfGenComponent(aEnv);
+    CleanupStack::PushL(me);
+    me->ConstructL( aImplementationId, aImplementationUid,aConstructionParams);
+    CleanupStack::Pop(me);
+    return me;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C CAlfGenComponent::~CAlfGenComponent()
+    {
+    if (iData)
+        {
+        iData->iObservers.ResetAndDestroy(); // will cancel outstanding requests 
+        iData->iObservers.Close();
+        iData->iClient.Close();
+        }
+        
+    delete iData;
+    }
+
+// ---------------------------------------------------------------------------
+// performs synchronous request
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfGenComponent::DoSynchronousCmd( TUint aOp, 
+                               const TDesC8& aInputBuf, TDes8& aOutBuf)
+    {
+    ASSERT(iData);
+    return iData->iClient.SendSynch(aOp, aInputBuf, aOutBuf);
+    }
+
+// ---------------------------------------------------------------------------
+// performs synchronous request without waiting the reply from the server
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C  TInt CAlfGenComponent::DoCmdNoReply( TUint aOp, const TDesC8& aInputBuf )
+    {
+    ASSERT(iData);
+    TInt err = iData->iClient.SendNoReply(aOp, aInputBuf);
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfGenComponent::DoCmdNoReply buffer error %d - using DoSynchronousCmd", err )
+        
+        TBuf8<1> dum;
+        err = DoSynchronousCmd( aOp, aInputBuf, dum );
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Raises async request to server
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfGenComponent::DoAsynchronousCmdL(TUint aOp, const TDesC8& aInputBuf, 
+                               TDes8& aOutBuf, MAlfAsyncOpObserver* aObserver)
+    {
+    ASSERT(iData);
+    // ASSERT(aObserver); // todo: does client need to provide observer if it is not interested about response
+
+    CAlfMessageObserver* obsEntry = CAlfMessageObserver::NewRequestLC(iData->iClient, aObserver, aOp, *this);
+    iData->iObservers.AppendL(obsEntry);
+    CleanupStack::Pop();
+
+    iData->iClient.SendAsync(aInputBuf, aOutBuf, obsEntry);
+    
+    return TInt(obsEntry);
+    }
+
+// ---------------------------------------------------------------------------
+// Request to cancel possible async request
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfGenComponent::CancelAsynchCmd(TInt aCmdId)
+    {
+    if (iData)
+        {
+        const TInt index = iData->iObservers.Find(reinterpret_cast<CAlfMessageObserver*>(aCmdId));
+        if (index != KErrNotFound)
+            {
+            CAlfMessageObserver* item = iData->iObservers[index];
+            iData->iObservers.Remove(index);
+            delete item;
+            }
+        }
+    }
+
+EXPORT_C TInt CAlfGenComponent::Identifier()
+    {
+    if (iData)
+        return iData->iClient.Identifier();
+    
+    return 0;
+    }
+
+// ---------------------------------------------------------------------------
+// Default construtor, private
+// ---------------------------------------------------------------------------
+//
+CAlfGenComponent::CAlfGenComponent(CAlfEnv& aEnv)
+    :iEnv(aEnv)
+    {
+    __ASSERT_ALWAYS(aEnv.Client().Handle(), USER_INVARIANT());
+
+    }
+
+// ---------------------------------------------------------------------------
+// 2nd phase ctr, opens subsession to envs client
+// ---------------------------------------------------------------------------
+//    
+void CAlfGenComponent::ConstructL(
+            TInt aImplementationId, 
+            TInt aImplementationUid, 
+            const TDesC8& aConstructionParams)
+    {
+    iData = new (ELeave) TPrivateData();
+    User::LeaveIfError(iData->iClient.Open(iEnv, aImplementationId,aImplementationUid,aConstructionParams));
+    iData->iObservers.Reset();
+    }
+
+// ---------------------------------------------------------------------------
+// Called when message completes
+// ---------------------------------------------------------------------------
+//        
+void CAlfGenComponent::CommandCompleted( CAlfMessageObserver* aMessageObserver )
+    {
+    ASSERT(iData);
+    
+    const TInt index = iData->iObservers.Find(aMessageObserver);
+    ASSERT(index != KErrNotFound);
+
+    delete iData->iObservers[index];
+    iData->iObservers.Remove(index);
+    }
+    
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfgradientbrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,234 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Gradient brush
+*
+*/
+
+
+
+#include "alf/alfgradientbrush.h"
+#include "alf/alfconstants.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfimage.h"
+#include "alf/alftexture.h"
+#include "alflogger.h"
+#include "alf/alfenv.h"
+#include "alfskinnableimage.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+struct CAlfGradientBrush::TGradientBrushPrivateData
+    {
+    CAlfSkinnableImage* iImage;
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfGradientBrush* CAlfGradientBrush::NewL( CAlfEnv& aEnv )
+    {
+    CAlfGradientBrush* self = CAlfGradientBrush::NewLC( aEnv );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfGradientBrush* CAlfGradientBrush::NewLC( CAlfEnv& aEnv )
+    {
+    CAlfGradientBrush* self = new( ELeave ) CAlfGradientBrush;
+    CleanupStack::PushL( self );
+    self->ConstructL( aEnv );
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfGradientBrush::CAlfGradientBrush()
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CAlfGradientBrush::ConstructL( CAlfEnv& aEnv )
+    {
+    CAlfBrush::ConstructL(
+        aEnv,
+        EAlfGradientBrushCreate,
+        0,
+        KNullDesC8()
+        );
+        
+    iGradientBrushData = new (ELeave) TGradientBrushPrivateData;
+    iGradientBrushData->iImage = NULL;
+    iGradientBrushData->iImage = new (ELeave) CAlfSkinnableImage(&aEnv);       
+    
+    }
+    
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfGradientBrush::~CAlfGradientBrush()
+    {
+    if ( iGradientBrushData )
+        {
+        delete iGradientBrushData->iImage;
+        iGradientBrushData->iImage = NULL;
+        }
+    delete iGradientBrushData;
+    iGradientBrushData = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Set gradient direction
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfGradientBrush::SetDirection(TDirection aDirection)
+    {
+    TPckgC<TDirection> buf(aDirection);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfGradientBrushSetDirection, buf );
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfGradientBrush::SetDirection panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+   
+// ---------------------------------------------------------------------------
+// Set gradient base color
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfGradientBrush::SetColor(const TRgb& aColor, TReal32 aOpacity ) __SOFTFP
+    {
+    TAlfGradientBrushSetColorParams params;
+    params.iColor = aColor;
+    params.iOpacity = aOpacity;
+    
+    TPckgC<TAlfGradientBrushSetColorParams> buf(params);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfGradientBrushSetColor, buf );
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfGradientBrush::SetColor panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Set gradient image
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfGradientBrush::SetImage(const TAlfImage& aImage)
+    {      
+    iGradientBrushData->iImage->SetImage(aImage); // This texturizes skin graphics if needed
+
+    TAlfImageParams params(iGradientBrushData->iImage->Image());
+    
+    TPckgC<TAlfImageParams> buf(params);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfGradientBrushSetImage, buf );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfGradientBrush::SetImage ignore error %d", err )
+        }
+    }
+  
+// ---------------------------------------------------------------------------
+// Return color at index
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TRgb CAlfGradientBrush::Color(TInt aIndex) const
+    {
+    TPckgC<TInt> inBuf(aIndex);
+    TRgb result;
+    TPckg<TRgb> outBuf(result);
+    TInt err = Comms()->DoSynchronousCmd( EAlfGradientBrushColor, inBuf, outBuf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfGradientBrush::Color panic error %d", err )
+        USER_INVARIANT();
+        }
+        
+    return result;
+    }
+  
+// ---------------------------------------------------------------------------
+// Return opacity at index
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TReal32 CAlfGradientBrush::Opacity(TInt aIndex) const
+    {
+    TPckgC<TInt> inBuf(aIndex);
+    TReal32 result = 1.f;
+    TPckg<TReal32> outBuf(result);
+    TInt err = Comms()->DoSynchronousCmd( EAlfGradientBrushOpacity, inBuf, outBuf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfGradientBrush::Opacity panic error %d", err )
+        USER_INVARIANT();
+        }
+        
+    return result;
+    }
+ 
+// ---------------------------------------------------------------------------
+// Return image
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C const TAlfImage& CAlfGradientBrush::Image() const
+    {
+    return iGradientBrushData->iImage->Image();
+    }
+
+// ---------------------------------------------------------------------------
+// Add color bar to gradient
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfGradientBrush::AppendColorL(
+        TReal32 aPosition, 
+        const TRgb& aColor,
+        TReal32 aOpacity ) __SOFTFP
+    {
+    TAlfGradientBrushAppendColorParams params;
+    params.iPosition = aPosition;
+    params.iColor = aColor;
+    params.iOpacity = aOpacity;
+    
+    TPckgC<TAlfGradientBrushAppendColorParams> buf(params);
+    TBuf8<1> dum;
+    TInt err = Comms()->DoSynchronousCmd( EAlfGradientBrushAppendColor, buf, dum);
+
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfGradientBrush::AppendColorL leave error %d", err )
+        User::Leave( err );
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfgridlayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,461 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Grid layout
+*
+*/
+
+
+
+#include "alf/alfgridlayout.h"
+#include "alf/alflayout.h"
+#include "alf/alfcontrol.h"
+#include "alfclient.h"
+#include "alf/alfenv.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfconstants.h"
+#include "alflogger.h"
+
+
+// Struct for private data
+struct CAlfGridLayout::TGridLayoutPrivateData
+    {
+    
+    };
+
+// ======== LOCAL FUNCTIONS ========
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// 1st phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfGridLayout::CAlfGridLayout()
+    : CAlfLayout()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfGridLayout::ConstructL(CAlfControl& aOwner)
+    {
+    CAlfLayout::ConstructL(aOwner);     
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfGridLayout::~CAlfGridLayout()
+    {
+    if ( iGridLayoutData )
+        {
+        }
+        
+    delete iGridLayoutData;
+    iGridLayoutData = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Creates new grid layout for the control.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfGridLayout* CAlfGridLayout::AddNewL(
+    CAlfControl& aOwnerControl,
+    TInt aColumns, TInt aRows,
+    CAlfLayout* aParentLayout )
+    {
+    CAlfGridLayout* layout = STATIC_CAST(CAlfGridLayout*,
+        aOwnerControl.AppendLayoutL(EAlfLayoutTypeGrid, aParentLayout));
+    layout->SetColumnsL(aColumns);
+    layout->SetRowsL(aRows);
+    return layout;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets amount of columns in the grid.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfGridLayout::SetColumnsL(TInt aColumnCount)
+    {
+    TPckgC<TInt> buf (aColumnCount);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfGridLayoutSetColumns, buf );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::SetColumnsL error %d", err )
+        User::Leave(err);
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Sets amount of rows in the grid.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfGridLayout::SetRowsL(TInt aRowCount)
+    {
+    TPckgC<TInt> buf (aRowCount);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfGridLayoutSetRows, buf );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::SetRowsL error %d", err )
+        User::Leave(err);
+        }
+    }
+
+EXPORT_C void CAlfGridLayout::SetColumnsL(const RArray<TInt>& aWeights)
+    {
+    HBufC8* buffer = ExternalizeLC(aWeights);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfGridLayoutSetColumnWeights, *buffer );
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::SetColumnsL error %d", err )
+        User::Leave(err);
+        }
+        
+    CleanupStack::PopAndDestroy( buffer );
+    }
+
+EXPORT_C void CAlfGridLayout::SetRowsL(const RArray<TInt>& aWeights)
+    {
+    HBufC8* buffer = ExternalizeLC(aWeights);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfGridLayoutSetRowsWeights, *buffer );
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::SetRowsL error %d", err )
+        User::Leave(err);
+        }
+        
+    CleanupStack::PopAndDestroy( buffer );
+    }
+
+// ---------------------------------------------------------------------------
+// Weight metrics
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfGridLayout::FillWeightsL(TAlfGridDimension aDim, TInt aCount, const TAlfMetric& aWeight)
+    {
+    TAlfGridLayoutFillWeightsParams params;
+    params.iDim = aDim;
+    params.iCount = aCount;
+    params.iWeight = aWeight;
+    TPckg<TAlfGridLayoutFillWeightsParams> paramsPckg(params);
+
+    TBuf8<1> dum;
+    TInt err = Comms()->DoSynchronousCmd(EAlfGridLayoutFillWeights, paramsPckg, dum );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::FillWeightsL return error %d", err )
+        User::Leave(err);
+        }
+    }
+    
+EXPORT_C void CAlfGridLayout::AppendWeightL(TAlfGridDimension aDim, const TAlfMetric& aWeight)
+    {
+    TAlfGridLayoutAppendWeightParams params;
+    params.iDim = aDim;
+    params.iWeight = aWeight;
+    TPckg<TAlfGridLayoutAppendWeightParams> paramsPckg(params);
+
+    TBuf8<1> dum;
+    TInt err = Comms()->DoSynchronousCmd(EAlfGridLayoutAppendWeight, paramsPckg, dum );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::AppendWeightL return error %d", err )
+        User::Leave(err);
+        }
+    }
+    
+EXPORT_C void CAlfGridLayout::InsertWeightL(TAlfGridDimension aDim, const TAlfMetric& aWeight, TInt aPos)
+    {
+    TAlfGridLayoutInsertWeightParams params;
+    params.iDim = aDim;
+    params.iWeight = aWeight;
+    params.iPos = aPos;
+    TPckg<TAlfGridLayoutInsertWeightParams> paramsPckg(params);
+
+    TBuf8<1> dum;
+    TInt err = Comms()->DoSynchronousCmd(EAlfGridLayoutInsertWeight, paramsPckg, dum );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::InsertWeightL return error %d", err )
+        User::Leave(err);
+        }
+    }
+    
+EXPORT_C void CAlfGridLayout::ReplaceWeightL(TAlfGridDimension aDim, const TAlfMetric& aWeight, TInt aPos)
+    {
+    TAlfGridLayoutReplaceWeightParams params;
+    params.iDim = aDim;
+    params.iWeight = aWeight;
+    params.iPos = aPos;
+    TPckg<TAlfGridLayoutReplaceWeightParams> paramsPckg(params);
+
+    TBuf8<1> dum;
+    TInt err = Comms()->DoSynchronousCmd(EAlfGridLayoutReplaceWeight, paramsPckg, dum );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::ReplaceWeightL return error %d", err )
+        User::Leave(err);
+        }
+    }
+    
+EXPORT_C void CAlfGridLayout::RemoveWeightL(TAlfGridDimension aDim, TInt aPos)
+    {
+    TAlfGridLayoutRemoveWeightParams params;
+    params.iDim = aDim;
+    params.iPos = aPos;
+    TPckg<TAlfGridLayoutRemoveWeightParams> paramsPckg(params);
+
+    TBuf8<1> dum;
+    TInt err = Comms()->DoSynchronousCmd(EAlfGridLayoutRemoveWeight, paramsPckg, dum );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::RemoveWeightL return error %d", err )
+        User::Leave(err);
+        }
+    
+    }
+    
+EXPORT_C TAlfMetric CAlfGridLayout::Weight(TAlfGridDimension aDim, TInt aPos) const
+    {
+    TAlfGridLayoutWeightParams params;
+    params.iDim = aDim;
+    params.iPos = aPos;
+    TPckg<TAlfGridLayoutWeightParams> paramsPckg(params);
+
+    TAlfMetric metric;
+    TPckg<TAlfMetric> metricPckg(metric);
+        
+    TInt err = Comms()->DoSynchronousCmd(EAlfGridLayoutWeight, paramsPckg, metricPckg);
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::RowCount ignore error %d", err )
+        }
+    return metric;
+    }
+    
+EXPORT_C TInt CAlfGridLayout::DimensionCount(TAlfGridDimension aDim) const
+    {
+    TPckgC<TInt> buf (aDim);
+    TInt count = 0;
+    TPckg<TInt> countPckg(count);
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfGridLayoutCount, buf, countPckg);
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::RowCount ignore error %d", err )
+        }
+    
+    return count;
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// Sets expanding flags in the grid.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfGridLayout::SetExpanding(TInt aFlags)
+    {
+    TPckgC<TInt> buf (aFlags);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfGridLayoutSetExpanding, buf);
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::SetExpanding ignore error %d", err )
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Gets amount of rows in the grid.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfGridLayout::RowCount() const
+    {
+    TBuf8<1> dum;
+    TInt count = 0;
+    TPckg<TInt> countPckg(count);
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfGridLayoutRowCount, dum, countPckg);
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::RowCount ignore error %d", err )
+        }
+    
+    return count;
+    }
+    
+// ---------------------------------------------------------------------------
+// Gets amount of columns in the grid.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfGridLayout::ColumnCount() const
+    {
+    TBuf8<1> dum;
+    TInt count = 0;
+    TPckg<TInt> countPckg(count);
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfGridLayoutColumnCount, dum, countPckg);
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::ColumnCount ignore error %d", err )
+        }
+    
+    return count;
+    }
+    
+// ---------------------------------------------------------------------------
+// Calculates the position of a child in the grid.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TPoint CAlfGridLayout::OrdinalToBlock(TInt aOrdinal) const
+    {
+    TPckgC<TInt> buf (aOrdinal);
+    TPoint result;
+    TPckg<TPoint> resBuf(result);
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfGridLayoutOrdinalToBlock, buf, resBuf);
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::OrdinalToBlock ignore error %d", err )
+        }
+        
+    return result;                                 
+    }
+
+
+// ---------------------------------------------------------------------------
+// Set Layout Mode Flags
+// ---------------------------------------------------------------------------
+// 
+
+EXPORT_C void CAlfGridLayout::SetLayoutModeFlags(TAlfGridDimension aDim, TUint aGridLayoutModeFlags)
+{
+    TInt2 params( aDim, aGridLayoutModeFlags );
+    TPckg<TInt2> paramsPckg(params);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfGridLayoutSetLayoutModeFlags, paramsPckg );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::SetLayoutModeFlags ignore error %d", err )
+        }
+}
+
+// ---------------------------------------------------------------------------
+// Get Layout Mode Flags
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TInt CAlfGridLayout::LayoutModeFlags(TAlfGridDimension aDim)
+{
+    TUint flags = 0;
+    TPckg<TUint> flagPckg(flags);
+    TPckgC<TInt> paramsPckg (aDim);  
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfGridLayoutLayoutModeFlags, paramsPckg, flagPckg);
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::LayoutModeFlags ignore error %d", err )
+        }
+        
+   return flags;
+}
+    
+// ---------------------------------------------------------------------------
+// Clear Layout Mode Flags
+// ---------------------------------------------------------------------------
+// 
+
+EXPORT_C void CAlfGridLayout::ClearLayoutModeFlags(TAlfGridDimension aDim, TUint aGridLayoutModeFlags)
+{    
+    TInt2 params( aDim, aGridLayoutModeFlags );
+    TPckg<TInt2> paramsPckg(params);
+    TBuf8<1> resBuf;    
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfGridLayoutClearLayoutModeFlags, paramsPckg, resBuf);
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfGridLayout::ClearLayoutModeFlags ignore error %d", err )
+        }  
+}
+    
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfGridLayout::RemoveAndDestroyAllD()
+    {
+    CAlfLayout::RemoveAndDestroyAllD();
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfGridLayout::UpdateChildrenLayout(TInt aTransitionTime )
+    {
+    CAlfLayout::UpdateChildrenLayout( aTransitionTime );
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfVisual* CAlfGridLayout::FindTag(const TDesC8& aTag)
+    {
+    return CAlfLayout::FindTag( aTag );
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfGridLayout::DoRemoveAndDestroyAllD()
+    {
+    CAlfLayout::DoRemoveAndDestroyAllD();
+    }
+    
+// ---------------------------------------------------------------------------
+// Place holder from CAlfLayout
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TAlfXYMetric CAlfGridLayout::BaseUnit() const
+    {
+    return CAlfLayout::BaseUnit();
+    }
+
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfGridLayout::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfLayout::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfimage.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,421 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Image
+*  Version     : %version: 20.1.1 %
+*
+*/
+
+
+
+#include "alf/alfimage.h"
+#include <alf/alftexture.h>
+#include <alf/alfconstants.h>
+#include "alf/alfimageloaderutil.h"
+#include "alf/alftexturemanager.h"
+#include "alflogger.h"
+#include <uiacceltk/HuiUtil.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Default constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfImage::TAlfImage()
+    : iTexture( NULL ) 
+    {
+    iTl = TAlfTimedPoint(0.f, 0.f);    
+    // Target set because of serverside THuiImage      
+    iTl.SetTarget(0.f,0); 
+
+    iBr = TAlfTimedPoint(0.f, 0.f);        
+    // Target set because of serverside THuiImage      
+    iBr.SetTarget(0.f,0); 
+
+    InitSkinData();
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor with the texture
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfImage::TAlfImage(const CAlfTexture& aTexture, 
+                       TReal32 aTlX, TReal32 aTlY,
+                       TReal32 aBrX, TReal32 aBrY) __SOFTFP
+    :  iTexture (&aTexture)
+    {
+    iTl = TAlfTimedPoint(aTlX, aTlY);    
+    // Target set because of serverside THuiImage      
+    iTl.SetTarget(TAlfRealPoint(aTlX,aTlY)); 
+    
+    iBr = TAlfTimedPoint(aBrX, aBrY);
+    // Target set because of serverside THuiImage                  
+    iBr.SetTarget(TAlfRealPoint(aBrX,aBrY)); 
+
+    InitSkinData();
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfImage::~TAlfImage()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the texture
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const CAlfTexture& TAlfImage::Texture() const 
+    {
+    __ASSERT_ALWAYS( (TInt)iTexture, USER_INVARIANT());
+	return *iTexture;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns TL texture coordinate
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfRealPoint TAlfImage::TopLeft() const
+    {
+    TAlfRealPoint retVal;
+    retVal.iX = iTl.iX.ValueNow();
+    retVal.iY = iTl.iY.ValueNow();    
+    return retVal;    
+    }
+
+// ---------------------------------------------------------------------------
+// Returns BR texture coordinate
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfRealPoint TAlfImage::BottomRight() const
+    {
+    TAlfRealPoint retVal;
+    retVal.iX = iBr.iX.ValueNow();
+    retVal.iY = iBr.iY.ValueNow();    
+    return retVal;            
+    } 
+
+// ---------------------------------------------------------------------------
+// Returns ETrue if the texture has been set,
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool TAlfImage::HasTexture() const
+    {
+    return (iTexture != NULL);        
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the texture
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void TAlfImage::SetTexture(CAlfTexture& aTexture)
+    {
+    InitSkinData();
+    iTexture = &aTexture;        
+    }
+
+// ---------------------------------------------------------------------------
+// Moves the texture
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void TAlfImage::Translate(TReal32 aDx, TReal32 aDy, TInt aTransitionTime) __SOFTFP
+    {
+    iTl.iX.SetTarget(iTl.iX.Target() + aDx, aTransitionTime);
+    iTl.iY.SetTarget(iTl.iY.Target() + aDy, aTransitionTime);
+    iBr.iX.SetTarget(iBr.iX.Target() + aDx, aTransitionTime);
+    iBr.iY.SetTarget(iBr.iY.Target() + aDy, aTransitionTime);        
+    }
+
+// ---------------------------------------------------------------------------
+// Scales the texture
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void TAlfImage::Scale(TReal32 aScaleX, TReal32 aScaleY, TInt aTransitionTime) __SOFTFP
+    {
+    iTl.iX.SetTarget(iTl.iX.Target() * aScaleX, aTransitionTime);
+    iTl.iY.SetTarget(iTl.iY.Target() * aScaleY, aTransitionTime);
+    iBr.iX.SetTarget(iBr.iX.Target() * aScaleX, aTransitionTime);
+    iBr.iY.SetTarget(iBr.iY.Target() * aScaleY, aTransitionTime);        
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the texture coordinates
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void TAlfImage::SetTexCoords(TReal32 aTlX, TReal32 aTlY,
+                                  TReal32 aBrX, TReal32 aBrY,
+                                  TInt aTransitionTime) __SOFTFP
+    {
+    iTl.iX.SetTarget(aTlX, aTransitionTime);
+    iTl.iY.SetTarget(aTlY, aTransitionTime);
+    iBr.iX.SetTarget(aBrX, aTransitionTime);
+    iBr.iY.SetTarget(aBrY, aTransitionTime);                
+    }    
+    
+// ---------------------------------------------------------------------------
+// Returns TL texture coordinates
+// ---------------------------------------------------------------------------
+//
+TAlfTimedPoint TAlfImage::TimedTopLeft() const
+    {
+    return iTl;    
+    }
+
+// ---------------------------------------------------------------------------
+// Returns BR texture coordinates
+// ---------------------------------------------------------------------------
+//
+TAlfTimedPoint TAlfImage::TimedBottomRight() const
+    {
+    return iBr;            
+    }
+    
+  
+// ---------------------------------------------------------------------------
+// Inits skin data
+// ---------------------------------------------------------------------------
+//
+void TAlfImage::InitSkinData()
+    {
+    TAknsItemID id;
+    id.Set(0,0);
+    iSkinID = id;
+    iAppIconUid = TUid::Uid(0);    
+    iAppIconType = EAknsAppIconTypeList;
+    iPreferredSize = TSize(0,0);    
+    iPreferredScaleMode = EAspectRatioPreserved;
+    iFallbackFileName = NULL;
+ 	iFallbackBitmapId = -1;
+    iFallbackMaskId = -1;
+    iPreferredTextureId = KAlfAutoGeneratedTextureId;
+    iPreferredTextureManager = NULL;
+    iFlags = EAlfTextureFlagSkinContent;
+    iSkinnableImage = EFalse;
+    }
+    
+// ---------------------------------------------------------------------------
+// Constructor with skin data
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfImage::TAlfImage(TAknsItemID aID,
+                              TSize aPreferredSize,
+                              TScaleMode aPreferredScaleMode, 
+                              const TDesC* aFallbackFileName, 
+                              TInt aFallbackBitmapId, 
+                              TInt aFallbackMaskId,
+                              TReal32 aTlX, TReal32 aTlY,
+                              TReal32 aBrX, TReal32 aBrY,
+                              TAlfTextureFlags aFlags,
+                              TInt aPreferredTextureId,
+                              CAlfTextureManager* aPreferredTextureManager) __SOFTFP
+    {
+    InitSkinData();
+    iSkinnableImage = ETrue;
+    
+    iSkinID = aID;
+    iPreferredSize = aPreferredSize;
+    iPreferredScaleMode = aPreferredScaleMode;
+    
+    iFallbackFileName = aFallbackFileName;
+    iFallbackBitmapId = aFallbackBitmapId;
+    iFallbackMaskId = aFallbackMaskId;
+    
+    iTl = TAlfTimedPoint(aTlX, aTlY);    
+    // Target set because of serverside THuiImage      
+    iTl.SetTarget(TAlfRealPoint(aTlX,aTlY)); 
+    
+    iBr = TAlfTimedPoint(aBrX, aBrY);
+    // Target set because of serverside THuiImage                  
+    iBr.SetTarget(TAlfRealPoint(aBrX,aBrY)); 
+
+    iFlags = aFlags;
+    iPreferredTextureId = aPreferredTextureId;
+    iPreferredTextureManager = aPreferredTextureManager;
+    
+    iTexture = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor with app icon
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfImage::TAlfImage(TUid aAppIconUid, 
+                              TAknsAppIconType aAppIconType,
+                              TSize aPreferredSize,
+                              TScaleMode aPreferredScaleMode, 
+                              TReal32 aTlX, TReal32 aTlY,
+                              TReal32 aBrX, TReal32 aBrY,
+                              TAlfTextureFlags aFlags,
+                              TInt aPreferredTextureId,
+                              CAlfTextureManager* aPreferredTextureManager) __SOFTFP
+    {
+    InitSkinData();
+    iSkinnableImage = ETrue;
+    iAppIconUid = aAppIconUid;
+    iAppIconType = aAppIconType;
+    
+    
+    iPreferredSize = aPreferredSize;
+    iPreferredScaleMode = aPreferredScaleMode;
+
+    iTl = TAlfTimedPoint(aTlX, aTlY);    
+    // Target set because of serverside THuiImage      
+    iTl.SetTarget(TAlfRealPoint(aTlX,aTlY)); 
+    
+    iBr = TAlfTimedPoint(aBrX, aBrY);
+    // Target set because of serverside THuiImage                  
+    iBr.SetTarget(TAlfRealPoint(aBrX,aBrY)); 
+
+    iFlags = aFlags;
+    iPreferredTextureId = aPreferredTextureId;
+    iPreferredTextureManager = aPreferredTextureManager;
+    
+    iTexture = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor with logical name
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfImage::TAlfImage(const TDesC* /*aLogicalName*/,
+                              TSize /*aPreferredSize*/,
+                              TScaleMode /*aPreferredScaleMode*/, 
+                              const TDesC* /*aFallbackFileName*/, 
+                              TInt /*aFallbackBitmapId*/, 
+                              TInt /*aFallbackMaskId*/,
+                              TReal32 /*aTlX*/, TReal32 /*aTlY*/,
+                              TReal32 /*aBrX*/, TReal32 /*aBrY*/,
+                              TAlfTextureFlags /*aFlags*/,
+                              TInt /*aPreferredTextureId*/,
+                              CAlfTextureManager* /*aPreferredTextureManager*/) __SOFTFP
+    {
+    __ALFLOGSTRING( "TAlfImage::TAlfImage FUNCTIONALITY REMOVED. REFER TO ANTRIKSH PROJECT" );
+    }
+
+// ---------------------------------------------------------------------------
+// Returns skin ID.
+// ---------------------------------------------------------------------------
+//
+TAknsItemID TAlfImage::SkinID() const
+    {
+    return iSkinID;    
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns preferred size.
+// ---------------------------------------------------------------------------
+//
+TSize TAlfImage::PreferredSize() const
+    {
+    return iPreferredSize;  
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns preferred scalemode.
+// ---------------------------------------------------------------------------
+//
+TScaleMode TAlfImage::PreferredScaleMode() const
+    {
+    return iPreferredScaleMode;  
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns fallback filename
+// ---------------------------------------------------------------------------
+//
+const TDesC* TAlfImage::FallbackFileName() const
+    {
+    if (!iFallbackFileName)
+        {
+        return &KNullDesC;    
+        }
+    return iFallbackFileName; 
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns fallback index
+// ---------------------------------------------------------------------------
+//
+TInt TAlfImage::FallbackBitmapId() const
+    {
+    return iFallbackBitmapId;  
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns fallback index for the mask.
+// ---------------------------------------------------------------------------
+//
+TInt TAlfImage::FallbackMaskId() const
+    {
+    return iFallbackMaskId;  
+    }
+
+// ---------------------------------------------------------------------------
+// Returns preferred texture manager
+// ---------------------------------------------------------------------------
+//
+CAlfTextureManager* TAlfImage::PreferredTextureManager() const
+    {
+    return iPreferredTextureManager;    
+    }
+
+// ---------------------------------------------------------------------------
+// Is image from a skin?
+// ---------------------------------------------------------------------------
+//
+TBool TAlfImage::SkinnableImage() const
+    {
+    return iSkinnableImage;            
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns texture flags
+// ---------------------------------------------------------------------------
+//
+TAlfTextureFlags TAlfImage::TextureFlags() const
+    {
+    return iFlags;        
+    }
+    
+// ---------------------------------------------------------------------------
+// returns preferred texture id
+// ---------------------------------------------------------------------------
+//
+TInt TAlfImage::PreferredTextureId() const
+    {
+    return iPreferredTextureId;    
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns app icon UID
+// ---------------------------------------------------------------------------
+//
+TUid TAlfImage::AppIconUid() const
+    {
+    return iAppIconUid;    
+    }
+
+// ---------------------------------------------------------------------------
+// Returns app icon type
+// ---------------------------------------------------------------------------
+//
+TAknsAppIconType TAlfImage::AppIconType() const
+    {
+    return iAppIconType;            
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfimagebrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,324 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Image brush
+*
+*/
+
+
+
+#include "alf/alfimagebrush.h"
+#include "alf/alfimage.h"
+#include "alf/alftexture.h"
+#include "alf/alfenv.h"
+#include "alf/alfgencomponent.h"
+#include "alflogger.h"
+#include "alfskinnableimage.h"
+#include "alf/alfconstants.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+// Private data structure
+struct CAlfImageBrush::TImageBrushPrivateData
+    {
+    CAlfSkinnableImage* iImage;   // owned
+    TInt iLeftBorderWidth;
+    TInt iRightBorderWidth;
+    TInt iTopBorderWidth;
+    TInt iBottomBorderWidth;     
+    TAlfTimedPoint iOffset;
+    TAlfTimedValue iScale;
+    };
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfImageBrush::CAlfImageBrush()
+    : CAlfBrush()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfImageBrush::ConstructL(CAlfEnv& aEnv, const TAlfImage & aImage)
+    {
+    iImageBrushData = new (ELeave) TImageBrushPrivateData;
+    iImageBrushData->iImage = NULL;
+    iImageBrushData->iImage = new (ELeave) CAlfSkinnableImage(&aEnv);
+    iImageBrushData->iImage->SetImage(aImage); // This texturizes skin graphics if needed
+    iImageBrushData->iLeftBorderWidth = 0;
+    iImageBrushData->iRightBorderWidth = 0;
+    iImageBrushData->iTopBorderWidth = 0;
+    iImageBrushData->iBottomBorderWidth = 0;    
+    
+    TAlfImageBrushParams params;
+    params.iTextureHandle = iImageBrushData->iImage->Image().Texture().ServerHandle(); 
+    params.iTl = aImage.TimedTopLeft();
+    params.iBr = aImage.TimedBottomRight();
+    params.iLeftBorderWidth = iImageBrushData->iLeftBorderWidth;
+    params.iRightBorderWidth = iImageBrushData->iRightBorderWidth;
+    params.iTopBorderWidth = iImageBrushData->iTopBorderWidth;
+    params.iBottomBorderWidth = iImageBrushData->iBottomBorderWidth;
+    
+    TPckgC<TAlfImageBrushParams> paramsPckg(params);
+        
+    CAlfBrush::ConstructL(
+        aEnv,
+        EAlfImageBrushCreate,
+        0,
+        paramsPckg
+        );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfImageBrush* CAlfImageBrush::NewL(CAlfEnv& aEnv, 
+    const TAlfImage & aImage)
+    {
+    CAlfImageBrush* self = CAlfImageBrush::NewLC( aEnv, aImage );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfImageBrush* CAlfImageBrush::NewLC(CAlfEnv& aEnv, 
+    const TAlfImage & aImage)
+    {
+    CAlfImageBrush* self = new( ELeave ) CAlfImageBrush;
+    CleanupStack::PushL( self );
+    self->ConstructL(aEnv, aImage);
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor.
+// ---------------------------------------------------------------------------
+//
+CAlfImageBrush::~CAlfImageBrush()
+    {
+    if ( iImageBrushData )
+        {
+        delete iImageBrushData->iImage;
+        iImageBrushData->iImage = NULL;
+        }
+    delete iImageBrushData;
+    iImageBrushData = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Set image
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageBrush::SetImage(const TAlfImage& aImage)
+    {
+    iImageBrushData->iImage->SetImage(aImage); // This texturizes skin graphics if needed
+    
+    TAlfImageBrushParams params;
+    params.iTextureHandle = aImage.Texture().ServerHandle(); 
+    params.iTl = aImage.TimedTopLeft();
+    params.iBr = aImage.TimedBottomRight();
+    params.iLeftBorderWidth = iImageBrushData->iLeftBorderWidth;
+    params.iRightBorderWidth = iImageBrushData->iRightBorderWidth;
+    params.iTopBorderWidth = iImageBrushData->iTopBorderWidth;
+    params.iBottomBorderWidth = iImageBrushData->iBottomBorderWidth;    
+    TPckgC<TAlfImageBrushParams> paramsPckg(params);        
+
+    TInt err = Comms()->DoCmdNoReply(EAlfImageBrushSetImage, paramsPckg);    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageBrush::SetImage ignore error %d", err )
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// Get image
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C const TAlfImage& CAlfImageBrush::Image() const
+    {
+    return iImageBrushData->iImage->Image();
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageBrush::SetBorders(TInt aLeftBorderWidth,
+                             TInt aRightBorderWidth,
+                             TInt aTopBorderHeight,
+                             TInt aBottomBorderHeight)
+    {
+    iImageBrushData->iLeftBorderWidth = aLeftBorderWidth;
+    iImageBrushData->iRightBorderWidth = aRightBorderWidth;
+    iImageBrushData->iTopBorderWidth = aTopBorderHeight;
+    iImageBrushData->iBottomBorderWidth = aBottomBorderHeight;    
+
+    TAlfImageBrushParams params;
+    params.iLeftBorderWidth = iImageBrushData->iLeftBorderWidth;
+    params.iRightBorderWidth = iImageBrushData->iRightBorderWidth;
+    params.iTopBorderWidth = iImageBrushData->iTopBorderWidth;
+    params.iBottomBorderWidth = iImageBrushData->iBottomBorderWidth;    
+    TPckgC<TAlfImageBrushParams> paramsPckg(params);        
+
+    TInt err = Comms()->DoCmdNoReply(EAlfImageBrushSetBorders, paramsPckg);    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageBrush::SetBorders ignore error %d", err )
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfImageBrush::BorderDrawingEnabled() const
+    {
+	return ((iImageBrushData->iLeftBorderWidth!=0) || (iImageBrushData->iRightBorderWidth!=0)		
+		    || (iImageBrushData->iTopBorderWidth!=0) || (iImageBrushData->iBottomBorderWidth!=0));
+        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfImageBrush::CenterDrawingEnabled() const
+    {
+	if(!iImageBrushData->iImage->Image().HasTexture()) 
+		{
+		return EFalse;
+		}				
+	// determine if there are center pixels available inside borders
+	// if not, we can't draw the center..
+	TSize imageSize = iImageBrushData->iImage->Image().Texture().Size();	
+	if((imageSize.iWidth - iImageBrushData->iLeftBorderWidth - iImageBrushData->iRightBorderWidth <= 0)
+	   || (imageSize.iHeight - iImageBrushData->iTopBorderWidth - iImageBrushData->iBottomBorderWidth <= 0))
+		{
+		return EFalse;
+		}	  
+		
+	return ETrue;        
+    }
+
+// ---------------------------------------------------------------------------
+// Set scale mode for the image brush
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageBrush::SetScaleMode(CAlfImageVisual::TScaleMode aScaleMode)
+    {
+    TPckgC<TInt> paramsPckg(aScaleMode);        
+
+    TInt err = Comms()->DoCmdNoReply(EAlfImageBrushSetScaleMode, paramsPckg );    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageBrush::SetScaleMode panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Sets offfset for the image
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfImageBrush::SetOffset(const TAlfTimedPoint& aOffset)
+    {
+    iImageBrushData->iOffset.iX = aOffset.iX;
+    iImageBrushData->iOffset.iY = aOffset.iY;
+
+
+    TPckgC<TAlfTimedPoint> offsetPckg(iImageBrushData->iOffset);
+    
+    TInt err = Comms()->DoCmdNoReply(EAlfImageBrushSetOffset, offsetPckg);
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageBrush::SetOffset panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the offset
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C const TAlfTimedPoint& CAlfImageBrush::Offset() const
+    {
+    TPckg<TAlfTimedPoint> offsetPckg(iImageBrushData->iOffset);
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfImageBrushOffset, KNullDesC8, offsetPckg);
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageBrush::Offset ignore error %d", err )
+        }
+
+    return iImageBrushData->iOffset;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets scale factor
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfImageBrush::SetScale(const TAlfTimedValue& aScale)
+    {
+    TPckgC<TAlfTimedValue> buf(aScale);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfImageBrushSetScale, buf );
+
+    if ( err == KErrNone )
+        {
+        iImageBrushData->iScale = aScale;
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfImageBrush::SetScale panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Returns scale factor
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C const TAlfTimedValue& CAlfImageBrush::Scale() const
+    {
+    TPckg<TAlfTimedValue> buf(iImageBrushData->iScale);
+    TInt err = Comms()->DoSynchronousCmd( EAlfImageBrushScale, KNullDesC8, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfImageBrush::Scale panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return iImageBrushData->iScale;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfimageloaderutil.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1071 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Utility for loading skin graphics.
+*
+*/
+
+
+
+
+#include "alf/alfimageloaderutil.h"
+#include "alf/alfbitmapprovider.h"
+#include "alf/alfstatic.h"
+#include "alf/alfenv.h"
+#include <SVGEngineInterfaceImpl.h>
+#include <SVGRequestObserver.h>
+#include <AknsItemData.h>
+#include <AknsUtils.h>
+
+#include <uiacceltk/HuiUtil.h>
+
+// Set this flag to ETrue if autosize textures need to be exluded from Avkon
+// icon cache, e.g. because it get filled with different size variants of same icon.
+// Excluding is likely to decrease texture upload performance.
+const TBool KExcludeAutosizeTextureIconsFromAvkonIconCache = EFalse;
+
+const TInt KSkinFrameBorderWidthDefaultValue = 8;
+const TInt KSkinFrameBorderWidthSmallValue = 4;
+const TInt KSkinFrameBorderWidthSmallestValue = 1;
+const TInt KSkinFrameWidthMinValue = 1;
+
+const TInt KAlfImageLoaderDefaultWidth = 4;
+const TInt KAlfImageLoaderDefaultHeight = 4;
+const TScaleMode KAlfImageLoaderDefaultScaleMode = EAspectRatioPreserved;
+
+struct TAlfProvidedBitmap
+    {
+    TInt iId;
+    TSize iPreferredSize;        
+    };
+
+/**
+ * Base class of the image loader classes
+ */
+class CAlfImageLoader: public CBase, public MAlfBitmapProvider, public MAlfTextureAutoSizeObserver
+	{
+public:
+	CAlfImageLoader();
+
+    ~CAlfImageLoader();
+
+    /**
+     * Set size of the icon. This must be called before creating texture.
+     * This call only sets information and dees *NOT* cause any scalable icon rasterization.
+     *
+     * @param aSize     Size in pixel.
+     */
+	void SetSize(TSize aSize) {iSize = aSize;}
+
+	void SetScaleMode(TScaleMode aScaleMode) {iScaleMode = aScaleMode;}
+
+    /**
+     * Set skin instance, which is acquired from AknsUtils::SkinInstance().
+     *
+     * @param aSkinInstance     An Avkon skin instamce.
+     */
+	void SetSkinInstance(MAknsSkinInstance *aSkinInstance) {iSkinInstance = aSkinInstance;}
+
+public:
+    // From MHuiBitmapProvider
+	virtual void ProvideBitmapL (TInt aId, CFbsBitmap *& aBitmap, CFbsBitmap *& aMaskBitmap) ;
+
+    // From MHuiTextureAutoSizeObserver
+    virtual TBool PreferredSizeChanged(const CAlfTexture& aChangedTexture, TSize aPreferredSize);
+
+protected:
+	MAknsSkinInstance* GetValidSkinInstance();
+    TSize PreferredSize(TInt aId) const;
+
+protected:
+	// common source info data
+	MAknsSkinInstance *iSkinInstance;
+	TSize iSize;
+	TScaleMode iScaleMode;
+	RArray<TAlfProvidedBitmap> iProvidedBitmaps;
+	TBool iExcludeFromAvkonIconCache;
+	};
+
+
+/**
+ * Image loader utility for skin item image loading.
+ *
+ */
+NONSHARABLE_CLASS(CAlfSkinItemImageLoader): public CAlfImageLoader
+{
+public:
+
+    /**
+     * Default constructor      
+     */
+    CAlfSkinItemImageLoader();
+
+    /**
+     * Construct an icon source information with Avkon skin item ID. AknsUtils::CreateIconL()
+     * will be called in RAlfImageLoaderUtil::CreateIconL().
+     *
+     * @param aInstance     Skin instance.
+     * @param aID  An ID of the graphical item (e.g. an icon).
+     * @param aBitmapId  ID of the bitmap when fallback is used.
+     * @param aMaskId  ID of the mask bitmap when fallback is used.
+     */
+    CAlfSkinItemImageLoader( const TAknsItemID &aID, TInt aBitmapId, TInt aMaskId );
+
+    /**
+     * Construct an icon source information with Avkon skin item ID. AknsUtils::CreateIconL()
+     * will be called in RAlfImageLoaderUtil::CreateIconL().
+     *
+     * @param aFileName  File name of graphics file e.g. mif file) when sepcified item is not found in the current skin.
+     */
+	void ConstructL( const TDesC &aFileName );
+
+	/**
+     * Destructor
+     */		
+	~CAlfSkinItemImageLoader();
+
+    /**
+     * Implementation of MAlfBitmapProvider interface.
+     *
+     * @param aId     A unique ID of the texture needed to provide bitmaps.
+     * @param aBitmap     A bitmap.
+     * @param aMaskBitmap     A mask bitmap.
+     */
+	virtual void ProvideBitmapL (TInt aId, CFbsBitmap *& aBitmap, CFbsBitmap *& aMaskBitmap) ;
+
+protected:
+	TAknsItemID iId;
+	HBufC* iFileName;
+	TInt iBitmapId;
+	TInt iMaskId;
+};
+
+
+/**
+ * Image loader utility for skin frame item image loading.
+ *
+ */
+NONSHARABLE_CLASS(CAlfSkinFrameItemImageLoader): public CAlfSkinItemImageLoader
+{
+public:
+
+    enum TFrameParts
+            {
+            EFramePartCornerTl = 0,
+            EFramePartCornerTr,
+            EFramePartCornerBl, 
+            EFramePartCornerBr,
+            EFramePartSideT,
+            EFramePartSideB,
+            EFramePartSideL,
+            EFramePartSideR,
+            EFramePartCenter
+            };
+            
+    /**
+     * Create MAlfBitmapProvider instance to load frame image with Avkon skin item ID.
+     * @param aFrameID  An Akvon skin item ID of the graphical frame item to load.
+     * @param aInnerRect Inner rect of the frame
+     * @param aOuterRect Outer rect of the frame
+     */
+    CAlfSkinFrameItemImageLoader( const TAknsItemID &aFrameID, const TRect& aInnerRect, const TRect& aOuterRect );
+
+    /**
+     * Construct an icon source information with Avkon skin item ID. AknsUtils::CreateIconL()
+     * will be called in RAlfImageLoaderUtil::CreateIconL().
+     *
+     * @param aFileName  File name of graphics file e.g. mif file) when sepcified item is not found in the current skin.
+     * @param aBitmapId  ID of the bitmap when fallback is used.
+     * @param aMaskId  ID of the mask bitmap when fallback is used.
+     */
+	void ConstructL( const TDesC &aFileName, TInt aBitmapId, TInt aMaskId );
+
+	/**
+     * Destructor
+     */		
+	~CAlfSkinFrameItemImageLoader();
+
+    /**
+     * Implementation of MAlfBitmapProvider interface.
+     *
+     * @param aId     A unique ID of the texture needed to provide bitmaps.
+     * @param aBitmap     A bitmap.
+     * @param aMaskBitmap     A mask bitmap.
+     */
+	virtual void ProvideBitmapL (TInt aId, CFbsBitmap *& aBitmap, CFbsBitmap *& aMaskBitmap) ;
+
+private:
+    
+    TSize GetFramePartSize(const TFrameParts aFramePart, const TSize& aFullFrameSize) const;
+    TPoint GetFramePartPos(const TFrameParts aFramePart, const TSize& aFullFrameSize) const;
+    TRect AdjustedOuterRect(const TSize& aFullFrameSize) const;
+    TRect AdjustedInnerRect(const TSize& aFullFrameSize) const;
+    TInt FrameBorderWidth() const;
+
+private:
+
+    TRect iInnerRect; 
+    TRect iOuterRect;
+};
+
+/**
+ * Image loader utility for loading Svg Images
+ *
+ */
+NONSHARABLE_CLASS(CAlfSvgImageLoader): public CAlfImageLoader, public MSvgRequestObserver
+{
+public:
+
+    /**
+     * Construct an SVG loader
+     *
+     * @param aSVGFile     Svg File name.     
+     */
+    static CAlfSvgImageLoader* NewLC(const TDesC& aSVGFile); 
+
+    /**
+     * Destructor
+     */		
+	~CAlfSvgImageLoader();
+    
+    /**
+     * Implementation of MAlfBitmapProvider interface.
+     *
+     * @param aId     A unique ID of the texture needed to provide bitmaps.
+     * @param aBitmap     A bitmap.
+     * @param aMaskBitmap     A mask bitmap.
+     */
+	virtual void ProvideBitmapL (TInt aId, CFbsBitmap *& aBitmap, CFbsBitmap *& aMaskBitmap) ;
+	
+    /**
+     * Implementation of MSvgRequestObserver interface. - UpdateScreen
+     */
+	void UpdateScreen();
+	
+    /**
+     * Implementation of MSvgRequestObserver interface. - ScriptCall
+     */	
+	TBool ScriptCall( const TDesC& aScript,CSvgElementImpl* aCallerElement );
+	
+    /**
+     * Implementation of MSvgRequestObserver interface.- FetchImage
+     */	
+    TInt FetchImage( const TDesC& aUri, RFs& aSession, RFile& aFileHandle );
+    
+    /**
+     * Implementation of MSvgRequestObserver interface.-UpdatePresentation
+     */    
+    void UpdatePresentation(const TInt32&  aNoOfAnimation);
+    
+    /**
+     * Implementation of MSvgRequestObserver interface.-FetchFont
+     */    
+    TInt FetchFont( const TDesC& aUri, RFs& aSession, RFile& aFileHandle );	
+	
+private:	
+	CAlfSvgImageLoader();
+	void ConstructL(const TDesC& aSVGFile);
+	void LoadSVGFileL(TInt aId);
+private:
+    CSvgEngineInterfaceImpl* iSvgEngine;//owned
+    CFbsBitmap* iBitmap;//not owned
+    CFbsBitmap* iMask; //not owned
+    CFbsBitmap* iDummyBitmap;//owned
+    HBufC* iFileName;
+};
+
+CAlfSvgImageLoader::~CAlfSvgImageLoader()
+{
+	delete iSvgEngine;
+    delete iDummyBitmap;
+    delete iBitmap;
+    delete iMask; 	
+    delete iFileName;
+}
+// -----------------------------------------------------------------------------
+// CSVGPerfTestAppView::UpdateScreen
+// -----------------------------------------------------------------------------
+//
+void CAlfSvgImageLoader::UpdateScreen()
+    {
+    }
+    
+// -----------------------------------------------------------------------------
+// CSVGPerfTestAppView::ScriptCall
+// -----------------------------------------------------------------------------
+//
+TBool CAlfSvgImageLoader::ScriptCall(
+    const TDesC& /*aScript*/,
+    CSvgElementImpl* /*aCallerElement*/ )
+    {
+    return EFalse;
+    }
+
+// -----------------------------------------------------------------------------
+// CAlfSvgImageLoader::FetchImage
+// -----------------------------------------------------------------------------
+//
+TInt CAlfSvgImageLoader:: FetchImage(
+    const TDesC& /*aUri*/, RFs& /*aSession*/, RFile& /*aFileHandle*/ )
+    {
+    return KErrNotSupported;
+    }
+    
+// -----------------------------------------------------------------------------
+// CSVGPerfTestAppView::UpdatePresentation
+// -----------------------------------------------------------------------------
+//
+void CAlfSvgImageLoader::UpdatePresentation(
+    const TInt32& /*aNoOfAnimation*/ )
+    {
+    }
+    
+// -----------------------------------------------------------------------------
+// CAlfSvgImageLoader::UpdatePresentation
+// -----------------------------------------------------------------------------
+//    
+TInt CAlfSvgImageLoader::FetchFont( const TDesC& /*aUri*/, RFs& /*aSession*/, RFile& /*aFileHandle*/ )
+    {
+    return KErrNotSupported;
+    }   
+
+
+void CAlfSvgImageLoader::LoadSVGFileL(TInt aId)
+{
+  	// delete previous content
+	
+	delete iBitmap;
+	iBitmap = NULL;
+	delete iMask;
+	iMask = NULL;
+	
+	// create frame and frame mask buffers		
+	iBitmap = new( ELeave ) CFbsBitmap;
+	User::LeaveIfError( iBitmap->Create( PreferredSize(aId), EColor64K ) );
+
+	iMask = new( ELeave ) CFbsBitmap;
+	User::LeaveIfError( iMask->Create( PreferredSize(aId), EGray256 ) );
+	
+
+    // If filename does not contain full path, then prepend the path from 
+    // primary envs default texture manager.
+    TFileName filename;
+    TParsePtrC parse(*iFileName);
+    if (!parse.DrivePresent())
+        {
+        filename.Append(CAlfStatic::Env().TextureManager().ImagePath());        
+        }    
+    filename.Append(*iFileName);
+	
+	// Load and render SVG file
+	TInt handle = 0;
+	iSvgEngine->PrepareDom( filename, handle ) ;
+	iSvgEngine->UseDom( handle, iBitmap, iMask );
+	
+	// check the aspect ratio (taken from AknSvgFormatHandler.cpp)
+	TSvgPreserveAspectAlignType alignTypeValue = ESvgPreserveAspectRatio_XmidYmid;
+    TSvgMeetOrSliceType meetOrSliceTypeValue = ESvgMeetOrSlice_Meet;
+    switch ( iScaleMode )
+        {
+        case EAspectRatioPreserved: // fall through
+            {
+            // use default
+            break;
+            }
+        // Ensures SVG content fully covers            
+        // the area of the icon whilst preserving aspect ratio.
+        case EAspectRatioPreservedSlice:
+            {
+            // alignTypeValue use default
+            meetOrSliceTypeValue = ESvgMeetOrSlice_Slice;
+            break;
+            } 
+        // EAspectRatioPreservedAndUnusedSpaceRemoved is mapped to
+        // the same values as EAspectRatioNotPreserved
+        // because we already have a frame buffer
+        // with the dimensions that preserves the aspect ratio.
+        // This mapping ensures that SVG engine does not calculate aspect
+        // ratio twice and potentially resulting in precision loss.
+        case EAspectRatioPreservedAndUnusedSpaceRemoved:                        
+        case EAspectRatioNotPreserved:
+           {            
+            alignTypeValue = ESvgPreserveAspectRatio_None;
+           // meetOrSliceTypeValue use default
+            break;
+            }
+        default:
+            {
+            __ASSERT_DEBUG( 0, USER_INVARIANT() );
+           }
+        }    
+            
+    iSvgEngine->SetPreserveAspectRatio( NULL, alignTypeValue, meetOrSliceTypeValue, ETrue);      
+	
+
+	// render frame and frame mask
+	iSvgEngine->Start();	
+	iSvgEngine->UseDom( handle, NULL, NULL );
+	iSvgEngine->DeleteDom( handle );  
+
+}
+
+CAlfSvgImageLoader* CAlfSvgImageLoader::NewLC(const TDesC& aSVGFile)
+    {
+    CAlfSvgImageLoader* self = new ( ELeave ) CAlfSvgImageLoader();
+    CleanupStack::PushL( self );
+    self->ConstructL(aSVGFile);
+    return self;
+    }
+
+CAlfSvgImageLoader::CAlfSvgImageLoader()
+    {
+    }
+
+void CAlfSvgImageLoader::ConstructL(const TDesC& aSVGFile)
+    {
+    iFileName = aSVGFile.AllocL();
+    // Initialize SVG engine
+    TFontSpec spec;
+	if ( !iDummyBitmap )
+	    {
+	    // Have to give some bitmap to the engine in the constructor.
+	    iDummyBitmap = new( ELeave ) CFbsBitmap;
+	    TInt error = iDummyBitmap->Create( TSize( 0, 0 ), EGray2 );
+	    if ( error != KErrNone )
+	        {
+	        delete iDummyBitmap;
+	        iDummyBitmap = NULL;
+	        User::Leave( error );
+	        }
+	    }
+	    
+	iSvgEngine = CSvgEngineInterfaceImpl::NewL( iDummyBitmap, this, spec );
+	iSvgEngine->SetBackgroundColor( 0 );
+	// No DRM check needed.
+	iSvgEngine->SetDRMMode( EFalse );
+    }
+
+void CAlfSvgImageLoader::ProvideBitmapL (TInt aId, CFbsBitmap *& aBitmap, CFbsBitmap *& aMaskBitmap)
+{
+	CAlfImageLoader::ProvideBitmapL (aId, aBitmap, aMaskBitmap);
+
+	LoadSVGFileL(aId);
+	aBitmap = iBitmap; //ownership transfered
+	aMaskBitmap = iMask; // ownership transfered
+    iBitmap = NULL;
+    iMask = NULL;
+}
+
+
+/**
+ * Image loader utility for application icon loading.
+ *
+ */
+NONSHARABLE_CLASS(CAlfAppIconImageLoader): public CAlfImageLoader
+{
+public:
+    /**
+     * Construct an icon source information to create application icon. AknsUtils::CreateAppIconLC()
+     * will be called in RAlfImageLoaderUtil::CreateIconL().
+     *
+     * @param aInstance     Skin instance.
+     * @param aAppUid  Application UID of the icon to be created.
+     * @param aType  Type of the application icon. Likely EAknsAppIconTypeContext is used...
+     */
+	CAlfAppIconImageLoader(TUid aAppUid, TAknsAppIconType aType);
+    
+    /**
+     * Implementation of MAlfBitmapProvider interface.
+     *
+     * @param aId     A unique ID of the texture needed to provide bitmaps.
+     * @param aBitmap     A bitmap.
+     * @param aMaskBitmap     A mask bitmap.
+     */
+	virtual void ProvideBitmapL (TInt aId, CFbsBitmap *& aBitmap, CFbsBitmap *& aMaskBitmap) ;
+private:
+	TUid iAppUid;
+	TAknsAppIconType iType;
+};
+
+// Image loader util
+EXPORT_C CAlfImageLoaderUtil::CAlfImageLoaderUtil()
+		:iSize(KAlfImageLoaderDefaultWidth,
+		       KAlfImageLoaderDefaultHeight), 
+		 iScaleMode(KAlfImageLoaderDefaultScaleMode)
+	{
+	}
+
+
+EXPORT_C CAlfImageLoaderUtil::~CAlfImageLoaderUtil()
+	{
+	for (TInt i=0; i<iImageLoaderList.Count(); i++)
+		delete iImageLoaderList[i];
+	iImageLoaderList.Close();
+	}
+
+
+EXPORT_C MAlfBitmapProvider* CAlfImageLoaderUtil::CreateImageLoaderL(
+				const TAknsItemID &aID, 
+				const TDesC &aFileName, 
+				TInt aBitmapId, 
+				TInt aMaskId)
+	{
+	// Create frame item loader, it can also handle normal items.
+	CAlfSkinFrameItemImageLoader* imgLoader = new (ELeave) CAlfSkinFrameItemImageLoader(
+			aID, TRect(0,0,0,0), TRect(0,0,0,0));
+
+    CleanupStack::PushL( imgLoader );
+    imgLoader->ConstructL( aFileName, aBitmapId, aMaskId );
+	imgLoader->SetSize(iSize);
+	imgLoader->SetScaleMode(iScaleMode);
+	imgLoader->SetSkinInstance(iSkinInstance);
+	iImageLoaderList.AppendL(imgLoader);
+	CleanupStack::Pop( imgLoader );
+	return imgLoader;
+	}
+
+EXPORT_C MAlfBitmapProvider* CAlfImageLoaderUtil::CreateImageLoaderL(
+    const TAknsItemID &aFrameID, 
+    const TRect& aInnerRect, 
+    const TRect& aOuterRect)
+    {
+	CAlfSkinItemImageLoader* imgLoader = new (ELeave) CAlfSkinFrameItemImageLoader(
+			aFrameID, aInnerRect, aOuterRect);
+    CleanupStack::PushL( imgLoader );
+	imgLoader->SetSize(aOuterRect.Size());
+	imgLoader->SetScaleMode(iScaleMode);
+	imgLoader->SetSkinInstance(iSkinInstance);
+	iImageLoaderList.AppendL(imgLoader);
+	CleanupStack::Pop( imgLoader );	
+	return imgLoader;        
+    }
+
+
+
+EXPORT_C MAlfBitmapProvider* CAlfImageLoaderUtil::CreateSVGImageLoaderL(
+				const TDesC &aFileName)
+	{
+	CAlfSvgImageLoader* imgLoader = CAlfSvgImageLoader::NewLC(aFileName);
+	imgLoader->SetSize(iSize);
+	imgLoader->SetScaleMode(iScaleMode);
+    iImageLoaderList.AppendL(imgLoader);
+	CleanupStack::Pop( imgLoader );
+	return imgLoader;
+	}
+
+
+EXPORT_C MAlfBitmapProvider* CAlfImageLoaderUtil::CreateImageLoaderL(
+				TUid aAppUid, 
+				TAknsAppIconType aType)
+	{
+	CAlfAppIconImageLoader* imgLoader = new (ELeave) CAlfAppIconImageLoader(
+			aAppUid, aType);
+    CleanupStack::PushL( imgLoader );
+	imgLoader->SetSize(iSize);
+	imgLoader->SetScaleMode(iScaleMode);
+	imgLoader->SetSkinInstance(iSkinInstance);
+	iImageLoaderList.AppendL(imgLoader);
+	CleanupStack::Pop( imgLoader );
+	return imgLoader;
+	}
+
+
+EXPORT_C void CAlfImageLoaderUtil::SetSize(TSize aSize, TScaleMode aMode)
+	{
+	iSize = aSize;
+	iScaleMode = aMode;
+	}
+
+
+EXPORT_C void CAlfImageLoaderUtil::SetSkinInstance(MAknsSkinInstance *aSkinInstance)
+	{
+	iSkinInstance = aSkinInstance;
+	}
+
+
+// Image loaders
+CAlfImageLoader::CAlfImageLoader():
+    iSize(KAlfImageLoaderDefaultWidth,KAlfImageLoaderDefaultHeight), 
+    iScaleMode(KAlfImageLoaderDefaultScaleMode)
+    {
+    }
+
+CAlfImageLoader::~CAlfImageLoader()
+    {
+    iProvidedBitmaps.Close();
+    };
+
+MAknsSkinInstance* CAlfImageLoader::GetValidSkinInstance()
+	{
+	if (iSkinInstance == NULL)
+		{
+		return AknsUtils::SkinInstance();
+		}
+	else
+		{
+		return iSkinInstance;
+		}
+	}
+
+TSize CAlfImageLoader::PreferredSize(TInt aId) const
+    {
+    for(TInt i = 0; i < iProvidedBitmaps.Count(); i++)
+        {
+        if (iProvidedBitmaps[i].iId == aId)
+            {
+            // Already in list
+            return iProvidedBitmaps[i].iPreferredSize;   
+            }
+        }
+    return iSize;    
+    }
+
+
+TBool CAlfImageLoader::PreferredSizeChanged(const CAlfTexture& aChangedTexture, TSize aPreferredSize)
+    {
+    // Check if any of my bitmaps preferred size has changed
+    for(TInt ii = 0; ii < iProvidedBitmaps.Count(); ii++)
+        {
+        if (iProvidedBitmaps[ii].iId == aChangedTexture.Id())
+            {
+            iProvidedBitmaps[ii].iPreferredSize = aPreferredSize;     
+            
+            TInt flags = aChangedTexture.Flags();
+            
+            // Exclude autosized bitmaps from avkon icon cache
+            if (KExcludeAutosizeTextureIconsFromAvkonIconCache && 
+                (flags & EAlfTextureFlagAutoSize))
+                {                
+                iExcludeFromAvkonIconCache = ETrue;
+                }            
+
+            // If bitmap is excuded from avkon cache, we can use direct upload to gain slight
+            // performance improvement in bitgdi. No fear of anyone sharing the bitmap or compressing
+            // it etc.
+            if (iExcludeFromAvkonIconCache)
+                {
+                flags |= 0x20; // "Secret" flag, not in public API    
+                CAlfTexture* changedTexture = const_cast<CAlfTexture*> (&aChangedTexture);
+                changedTexture->SetFlags(TAlfTextureFlags(flags));                    
+                }
+            
+            return ETrue;
+            }
+        }        
+    return EFalse;
+    }
+
+void CAlfImageLoader::ProvideBitmapL (TInt aId, CFbsBitmap *& /*aBitmap*/, CFbsBitmap *& /*aMaskBitmap*/)
+    {
+    for(TInt i = 0; i < iProvidedBitmaps.Count(); i++)
+        {
+        if (iProvidedBitmaps[i].iId == aId)
+            {            
+            // Already in list, do nothing
+            return;   
+            }
+        }
+    
+    // If provided bitmap is not yet in the list, add it.    
+    TAlfProvidedBitmap providedBitmap;
+    providedBitmap.iId = aId;
+    providedBitmap.iPreferredSize = iSize;        
+    iProvidedBitmaps.AppendL(providedBitmap);            
+    }
+
+
+CAlfSkinItemImageLoader::CAlfSkinItemImageLoader():
+		iId(KAknsIIDNone),
+		iFileName(NULL),
+		iBitmapId(0),
+		iMaskId(0)
+	{
+	}
+
+CAlfSkinItemImageLoader::CAlfSkinItemImageLoader(
+		const TAknsItemID &aID, 
+		TInt aBitmapId, 
+		TInt aMaskId):
+		iId(aID),
+		iBitmapId(aBitmapId),
+		iMaskId(aMaskId)
+	{
+	}
+
+void CAlfSkinItemImageLoader::ConstructL( const TDesC &aFileName )
+	{
+	iFileName = aFileName.AllocL();
+	}
+
+CAlfSkinItemImageLoader::~CAlfSkinItemImageLoader()
+    {
+    delete iFileName;
+    }
+
+
+void CAlfSkinItemImageLoader::ProvideBitmapL (TInt aId, CFbsBitmap *& aBitmap, CFbsBitmap *& aMaskBitmap)
+	{
+	CAlfImageLoader::ProvideBitmapL (aId, aBitmap, aMaskBitmap);
+	
+	AknsUtils::CreateIconL(
+					GetValidSkinInstance(), iId,
+					aBitmap, aMaskBitmap, 
+					*iFileName, iBitmapId, iMaskId);
+
+    // Leave if bitmap or mask is NULL.
+    User::LeaveIfNull( aBitmap );
+    //User::LeaveIfNull( aMaskBitmap );
+
+	// Disable compression so that the bitmap may be able to be duplicated inside
+	// AlfTK when BITGDI renderer is in use.
+	AknIconUtils::DisableCompression( aBitmap );
+
+    // Exclude from icon cache to avoid flooding it or to avoid bitmap sharing
+    if (iExcludeFromAvkonIconCache)
+        {
+        AknIconUtils::ExcludeFromCache( aBitmap );    
+        }
+
+    // Set icon sizes and render them on the bitmaps.
+    // This does the actual rendering to specified size. (SVG -> bitmap)
+    AknIconUtils::SetSize( aBitmap, PreferredSize(aId), iScaleMode );
+	}
+
+
+
+CAlfSkinFrameItemImageLoader::CAlfSkinFrameItemImageLoader( const TAknsItemID &aFrameID, 
+    const TRect& aInnerRect, 
+    const TRect& aOuterRect ):
+    iInnerRect(aInnerRect),
+    iOuterRect(aOuterRect)
+    {
+    iId = aFrameID;                
+
+    // Sanity check to avoid evil things happening later
+    if (aOuterRect.iTl.iX - aInnerRect.iTl.iX > KSkinFrameWidthMinValue ||
+        aOuterRect.iTl.iY - aInnerRect.iTl.iY > KSkinFrameWidthMinValue ||
+        aOuterRect.iBr.iX - aInnerRect.iBr.iX < KSkinFrameWidthMinValue ||
+        aOuterRect.iBr.iY - aInnerRect.iBr.iY < KSkinFrameWidthMinValue)
+        {
+        iInnerRect = TRect(0,0,0,0);
+        iOuterRect = TRect(0,0,0,0);
+        }    
+    }
+
+void CAlfSkinFrameItemImageLoader::ConstructL( const TDesC &aFileName, TInt aBitmapId, TInt aMaskId )
+	{
+	iBitmapId = aBitmapId;
+	iMaskId = aMaskId;
+	iFileName = aFileName.AllocL();
+	}
+
+CAlfSkinFrameItemImageLoader::~CAlfSkinFrameItemImageLoader()
+    {        
+    // base class deletes iFileName
+    }
+
+void CAlfSkinFrameItemImageLoader::ProvideBitmapL(TInt aId, CFbsBitmap *& aBitmap, CFbsBitmap *& aMaskBitmap) 
+    {
+    CAknsItemData* itemData = NULL;    				
+    itemData = AknsUtils::SkinInstance()->CreateUncachedItemDataL( iId, EAknsITImageTable );
+
+    if (itemData)
+        {
+    	// Call grandparent class functionality instead of parent here.
+    	CAlfImageLoader::ProvideBitmapL (aId, aBitmap, aMaskBitmap);
+        
+        CAknsImageTableItemData* itemTableData = static_cast<CAknsImageTableItemData*>(itemData);        
+        CleanupStack::PushL( itemTableData );
+        
+        TSize frameSize = PreferredSize(aId);
+
+        // Create target bitmap
+        aBitmap = new CFbsBitmap();
+        aBitmap->Create( frameSize, EColor64K );
+
+        aMaskBitmap = new CFbsBitmap();
+        aMaskBitmap->Create( frameSize, EGray256 );
+
+        // Create bitmap device for target rendering
+        CFbsBitmapDevice* targetDevice = CFbsBitmapDevice::NewL( aBitmap );
+        CleanupStack::PushL( targetDevice );
+
+        CFbsBitmapDevice* targetMaskDevice = CFbsBitmapDevice::NewL( aMaskBitmap );
+        CleanupStack::PushL( targetMaskDevice );
+
+        // Create bitmap graphics context
+        CFbsBitGc* bitgc = CFbsBitGc::NewL();
+        CleanupStack::PushL( bitgc );
+        bitgc->Activate( targetDevice );
+
+        CFbsBitGc* maskbitgc = CFbsBitGc::NewL();
+        CleanupStack::PushL( maskbitgc );
+        maskbitgc->Activate( targetMaskDevice );
+        
+        // Fill mask just in case there are unmasked elements in the frame
+        maskbitgc->SetBrushStyle(CGraphicsContext::ESolidBrush);
+        maskbitgc->SetBrushColor(KRgbWhite);
+        maskbitgc->SetPenColor(KRgbWhite);
+        maskbitgc->DrawRect(TRect(TPoint(0,0), frameSize));
+        
+        // 9 part frame graphics
+        for (TInt count = 0; count < 9; count++)
+            {
+            TSize partsize = GetFramePartSize((TFrameParts)(count), frameSize);
+            TPoint partpos = GetFramePartPos((TFrameParts)(count), frameSize);
+            
+            TAknsItemID partSkinId = itemTableData->ImageIID(count);
+
+            CFbsBitmap* partBitmap = NULL;
+            CFbsBitmap* partMaskBitmap = NULL;
+            AknsUtils::GetCachedMaskedBitmap(AknsUtils::SkinInstance(), itemTableData->ImageIID(count), partBitmap, partMaskBitmap );
+            
+            TRect sourcerect = TRect(TPoint(0,0), partsize);    
+
+            if (partBitmap)
+                {
+                AknIconUtils::SetSize( partBitmap, partsize, EAspectRatioNotPreserved );    
+                bitgc->BitBlt(partpos, partBitmap,sourcerect);                
+                }
+                
+            if (partMaskBitmap)
+                {
+                AknIconUtils::SetSize( partMaskBitmap, partsize, EAspectRatioNotPreserved );    
+                maskbitgc->BitBlt(partpos, partMaskBitmap,sourcerect);                
+                }
+            }
+        
+        CleanupStack::PopAndDestroy( maskbitgc );
+        CleanupStack::PopAndDestroy( bitgc );
+        CleanupStack::PopAndDestroy( targetMaskDevice );
+        CleanupStack::PopAndDestroy( targetDevice );
+        CleanupStack::PopAndDestroy( itemTableData );
+        }
+    else
+        {
+        // 1 part frame graphics comes from the base class
+        CAlfSkinItemImageLoader::ProvideBitmapL(aId, aBitmap, aMaskBitmap);    
+        }    
+
+    }
+
+TSize CAlfSkinFrameItemImageLoader::GetFramePartSize(const TFrameParts aFramePart, const TSize& aFullFrameSize) const
+    {
+    TRect innerRect = AdjustedInnerRect(aFullFrameSize);
+    TRect outerRect = AdjustedOuterRect(aFullFrameSize);    
+    
+    TSize size(0,0);
+    
+    switch (aFramePart)
+        {
+        case EFramePartCornerTl:
+            size.iWidth = innerRect.iTl.iX - outerRect.iTl.iX;
+            size.iHeight = innerRect.iTl.iY - outerRect.iTl.iY;
+            break;
+        case EFramePartCornerTr:
+            size.iWidth = outerRect.iBr.iX - innerRect.iBr.iX;
+            size.iHeight = innerRect.iTl.iY - outerRect.iTl.iY;
+            break;
+        case EFramePartCornerBl:
+            size.iWidth = innerRect.iTl.iX - outerRect.iTl.iX;
+            size.iHeight = outerRect.iBr.iY - innerRect.iBr.iY;					
+            break;
+        case EFramePartCornerBr:
+            size.iWidth = outerRect.iBr.iX - innerRect.iBr.iX;
+            size.iHeight = outerRect.iBr.iY - innerRect.iBr.iY;					
+            break;
+        case EFramePartSideT:
+            size.iWidth = innerRect.iBr.iX - innerRect.iTl.iX;
+            size.iHeight = innerRect.iTl.iY - outerRect.iTl.iY;					
+            break;
+        case EFramePartSideB:
+            size.iWidth = innerRect.iBr.iX - innerRect.iTl.iX;
+            size.iHeight = outerRect.iBr.iY - innerRect.iBr.iY;					
+            break;
+        case EFramePartSideL:
+            size.iWidth = innerRect.iTl.iX - outerRect.iTl.iX;
+            size.iHeight = innerRect.iBr.iY - innerRect.iTl.iY;					
+            break;
+        case EFramePartSideR:
+            size.iWidth = outerRect.iBr.iX - innerRect.iBr.iX;
+            size.iHeight = innerRect.iBr.iY - innerRect.iTl.iY;					
+            break;
+        case EFramePartCenter:
+            size = innerRect.Size();
+            break;
+        default:
+            break;
+        }
+    return size;
+    }
+
+TPoint CAlfSkinFrameItemImageLoader::GetFramePartPos(const TFrameParts aFramePart, const TSize& aFullFrameSize) const
+    {
+    TRect innerRect = AdjustedInnerRect(aFullFrameSize);
+    TRect outerRect = AdjustedOuterRect(aFullFrameSize);    
+
+    TPoint pos(0,0);
+
+    switch (aFramePart)
+        {
+        case EFramePartCornerTl:
+            pos.iX = outerRect.iTl.iX;
+            pos.iY = outerRect.iTl.iY;
+            break;
+        case EFramePartCornerTr:
+            pos.iX = innerRect.iBr.iX;
+            pos.iY = outerRect.iTl.iY;
+            break;
+        case EFramePartCornerBl:
+            pos.iX = outerRect.iTl.iX;
+            pos.iY = innerRect.iBr.iY;
+            break;
+        case EFramePartCornerBr:
+            pos.iX = innerRect.iBr.iX;
+            pos.iY = innerRect.iBr.iY;
+            break;
+        case EFramePartSideT:
+            pos.iX = innerRect.iTl.iX;
+            pos.iY = outerRect.iTl.iY;
+            break;
+        case EFramePartSideB:
+            pos.iX = innerRect.iTl.iX;
+            pos.iY = innerRect.iBr.iY;
+            break;
+        case EFramePartSideL:
+            pos.iX = outerRect.iTl.iX;
+            pos.iY = innerRect.iTl.iY;
+            break;
+        case EFramePartSideR:
+            pos.iX = innerRect.iBr.iX;
+            pos.iY = innerRect.iTl.iY;
+            break;
+        case EFramePartCenter:
+            pos.iX = innerRect.iTl.iX;
+            pos.iY = innerRect.iTl.iY;
+            break;
+        default:
+            break;
+        }
+    return pos;
+    }
+
+TRect CAlfSkinFrameItemImageLoader::AdjustedOuterRect(const TSize& aFullFrameSize) const
+    {
+    if (aFullFrameSize != iOuterRect.Size())
+        {
+        return TRect(TPoint(0,0), aFullFrameSize);    
+        }
+    return iOuterRect;    
+    }
+
+TRect CAlfSkinFrameItemImageLoader::AdjustedInnerRect(const TSize& aFullFrameSize) const
+    {
+    TRect adjustedOuterRect = AdjustedOuterRect(aFullFrameSize);
+    if (adjustedOuterRect != iOuterRect)
+        {
+        TInt adjustment = 0;
+        
+        if ((adjustedOuterRect.Width() >= KSkinFrameBorderWidthDefaultValue * 2) &&
+            (adjustedOuterRect.Height() >= KSkinFrameBorderWidthDefaultValue * 2))
+            {
+            // Use default border width
+            adjustment = KSkinFrameBorderWidthDefaultValue;
+            }
+        else if ((adjustedOuterRect.Width() >= KSkinFrameBorderWidthSmallValue * 2) &&
+                 (adjustedOuterRect.Height() >= KSkinFrameBorderWidthSmallValue * 2))
+            {
+            // Frame size is too small, use small border
+            adjustment = KSkinFrameBorderWidthSmallValue;
+            }        
+        else if ((adjustedOuterRect.Width() >= KSkinFrameBorderWidthSmallestValue * 2) &&
+                 (adjustedOuterRect.Height() >= KSkinFrameBorderWidthSmallestValue * 2))
+            {
+            // Frame size is too small, use smallest border
+            adjustment = KSkinFrameBorderWidthSmallestValue;
+            }        
+        else
+            {
+            // Frame size is too small, just draw the center part
+            adjustment = 0;    
+            }
+                                            
+        adjustedOuterRect.iTl.iX += adjustment;
+        adjustedOuterRect.iBr.iX -= adjustment;            
+        adjustedOuterRect.iTl.iY += adjustment;
+        adjustedOuterRect.iBr.iY -= adjustment;
+        
+        return adjustedOuterRect;    
+        }
+    
+    return iInnerRect;    
+    }
+
+
+CAlfAppIconImageLoader::CAlfAppIconImageLoader(
+		TUid aAppUid, 
+		TAknsAppIconType aType):
+		iAppUid(aAppUid),
+		iType(aType)
+	{
+	}
+
+
+void CAlfAppIconImageLoader::ProvideBitmapL (
+		TInt aId, 
+		CFbsBitmap *& aBitmap, 
+		CFbsBitmap *& aMaskBitmap)
+	{
+	CAlfImageLoader::ProvideBitmapL (aId, aBitmap, aMaskBitmap);
+
+    AknsUtils::CreateAppIconLC( 
+					GetValidSkinInstance(), 
+					iAppUid, iType,
+					aBitmap, aMaskBitmap );
+
+    // Leave if bitmap or mask is NULL.
+    User::LeaveIfNull( aBitmap );
+    //User::LeaveIfNull( aMaskBitmap );
+
+	// diable compression so that the bitmap may be able to be duplicated inside
+	// AlfTK when BITGDI renderer is in use.
+	AknIconUtils::DisableCompression( aBitmap );
+
+    // Exclude from icon cache to avoid flooding it or to avoid bitmap sharing
+    if (iExcludeFromAvkonIconCache)
+        {
+        AknIconUtils::ExcludeFromCache( aBitmap );    
+        }
+
+    // Set icon sizes and render them on the bitmaps.
+    // This does the actual rendering to specified size. (SVG -> bitmap)
+    AknIconUtils::SetSize( aBitmap, PreferredSize(aId), iScaleMode );
+    
+	// pop the passed bitmap and mask 
+	CleanupStack::Pop(2);
+	}
+
+EXPORT_C CAlfAutoSizeImageLoaderUtil::CAlfAutoSizeImageLoaderUtil()
+    {
+    }
+
+EXPORT_C TBool CAlfAutoSizeImageLoaderUtil::PreferredSizeChanged(const CAlfTexture& aChangedTexture, TSize aPreferredSize)
+    {
+    TBool ret = EFalse;
+    TInt count = iImageLoaderList.Count();
+    for (TInt i=0; i<count;i++)
+        {
+        ret |= iImageLoaderList[i]->PreferredSizeChanged(aChangedTexture, aPreferredSize);    
+        }
+    return ret;    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfimagevisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,522 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Image visual
+*
+*/
+
+
+
+#include "alf/alfimagevisual.h"
+#include "alf/alfcontrol.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alf/alfimage.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alftexture.h" 
+#include "alf/alfconstants.h"
+#include "alflogger.h"
+#include "alf/alfimageloaderutil.h"
+#include "alfskinnableimage.h"
+#include "alf/alfdropshadow.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+// ======== LOCAL FUNCTIONS ========
+#define FLOAT_COMPARE(a, b) (Abs(a-b)<0.0001f)
+
+// Private data.
+struct CAlfImageVisual::TImageVisualPrivateData
+    {
+    CAlfSkinnableImage* iImage;
+    CAlfSkinnableImage* iSecondaryImage;    
+    CAlfImageVisual::TScaleMode iScaleMode;
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfImageVisual::CAlfImageVisual()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageVisual::ConstructL(CAlfControl& aOwner)
+    {
+    CAlfVisual::ConstructL(aOwner);    
+    iImageVisualData = new (ELeave) TImageVisualPrivateData;
+    iImageVisualData->iImage = NULL;
+    iImageVisualData->iSecondaryImage = NULL;
+    
+    iImageVisualData->iImage = new (ELeave) CAlfSkinnableImage(&aOwner.Env());
+    iImageVisualData->iSecondaryImage = new (ELeave) CAlfSkinnableImage(&aOwner.Env());    
+    iImageVisualData->iScaleMode = EScaleFit;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfImageVisual::~CAlfImageVisual()
+    {
+    if (iImageVisualData)
+        {
+        delete iImageVisualData->iImage;
+        iImageVisualData->iImage = NULL,
+        
+        delete iImageVisualData->iSecondaryImage;
+        iImageVisualData->iSecondaryImage = NULL;        
+        }
+    
+    delete iImageVisualData;
+    iImageVisualData = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfImageVisual* CAlfImageVisual::AddNewL(
+    CAlfControl& aOwnerControl,
+    CAlfLayout* aParentLayout)
+    {
+    CAlfImageVisual* image = STATIC_CAST(CAlfImageVisual*,
+        aOwnerControl.AppendVisualL(EAlfVisualTypeImage, aParentLayout));
+    return image;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets scale mode.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageVisual::SetScaleMode(CAlfImageVisual::TScaleMode aScaleMode)
+    {
+    TPckgC<CAlfImageVisual::TScaleMode> buf(aScaleMode);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfImageVisualSetScaleMode, buf);    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::SetScaleMode ignore error %d", err )
+        }
+    else
+        {
+        iImageVisualData->iScaleMode = aScaleMode;
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Gets scale mode.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfImageVisual::TScaleMode CAlfImageVisual::ScaleMode()
+    {
+    CAlfImageVisual::TScaleMode ret = EScaleFit;
+    if( iImageVisualData )
+        {
+        ret = iImageVisualData->iScaleMode;
+        }            
+    else
+        {
+        __ALFLOGSTRING( "CAlfImageVisual::ScaleMode Ignore ScaleMode iImageVisualData is NULL" )
+        }
+    return ret;
+    }
+// ---------------------------------------------------------------------------
+// Sets image.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageVisual::SetImage(const TAlfImage& aImage)
+    {    
+    iImageVisualData->iImage->SetImage(aImage); // This texturizes skin graphics if needed
+
+    TAlfImageParams params(iImageVisualData->iImage->Image());
+
+    TPckgC<TAlfImageParams> buf(params);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfImageVisualSetImage, buf);
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::SetImage ignore error %d", err )
+        }
+        
+    }
+
+// ---------------------------------------------------------------------------
+// Sets secondary image.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageVisual::SetSecondaryImage(const TAlfImage& aImage)
+    {        
+    iImageVisualData->iSecondaryImage->SetImage(aImage); // This texturizes skin graphics if needed
+
+    TAlfImageParams params(iImageVisualData->iSecondaryImage->Image());
+
+    TPckgC<TAlfImageParams> buf(params);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfImageVisualSetSecondaryImage, buf);
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::SetSecondaryImage ignore error %d", err )
+        }
+        
+    }
+
+// ---------------------------------------------------------------------------
+// Sets secondary image alpha value.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageVisual::SetSecondaryAlpha(const TAlfTimedValue& aAlpha)
+    {
+    TPckgC<TAlfTimedValue> alphaPckg(aAlpha);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfImageVisualSetSecondaryAlpha, alphaPckg );    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::SetSecondaryAlpha ignore error %d", err )
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Gets image.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TAlfImage& CAlfImageVisual::Image() const
+    {
+    return iImageVisualData->iImage->Image();    
+    }
+
+// ---------------------------------------------------------------------------
+// Gets secondary image.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TAlfImage& CAlfImageVisual::SecondaryImage() const
+    {
+    return iImageVisualData->iSecondaryImage->Image();            
+    }
+
+// ---------------------------------------------------------------------------
+// Sets color.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageVisual::SetColor(const TRgb& aColor)
+    {
+    TPckgC<TRgb> buf(aColor);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfImageVisualSetColor, buf );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::SetColor ignore error %d", err )
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Sets colormode.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageVisual::SetColorMode(CAlfImageVisual::TColorMode aColorMode, 
+    TReal32 aParam) __SOFTFP
+    {
+    TIntTReal params(aColorMode, aParam);
+    TPckg<TIntTReal> buf(params);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfImageVisualSetColorMode, buf );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::SetColorMode ignore error %d", err )
+        }
+    }    
+    
+// ---------------------------------------------------------------------------
+// Sets stretch.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageVisual::SetStretch(TInt aTop, TInt aBottom)
+    {
+    TInt2 params(aTop, aBottom);
+    TPckg<TInt2> buf(params);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfImageVisualSetStretch, buf );    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::SetStretch ignore error %d", err )
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Sets stretchmode.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageVisual::SetStretchMode(CAlfGc::TStretchMode aStretchMode)
+    {
+    TPckg<CAlfGc::TStretchMode> buf(aStretchMode);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfImageVisualSetStretchMode, buf );    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::SetStretchMode ignore error %d", err )
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Sets drop shadow. (deprecated)
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageVisual::SetDropShadow(TInt aShadowDistance)
+    {
+    if ( aShadowDistance == 0 )
+        {
+        TRAP_IGNORE( EnableDropShadowL(EFalse) );
+        return;
+        }
+        
+    TRAPD( err, EnableDropShadowL() );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::SetDropShadow ignore error %d", err )
+        return;
+        }
+        
+    DropShadowHandler()->SetOffset( TAlfTimedPoint( aShadowDistance, aShadowDistance ) );
+    }
+
+// ---------------------------------------------------------------------------
+// Sets drop shadow.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageVisual::SetDropShadow(const TAlfMetric& aShadowDistance)
+    {
+    SetDropShadow(TAlfXYMetric(aShadowDistance));
+    }
+
+// ---------------------------------------------------------------------------
+// Sets drop shadow.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageVisual::SetDropShadow(const TAlfXYMetric& aShadowDistance)
+    {
+    if ( FLOAT_COMPARE(aShadowDistance.iX.iMagnitude, 0.f ) && 
+         FLOAT_COMPARE(aShadowDistance.iY.iMagnitude, 0.f ) )
+        {
+        TRAP_IGNORE( EnableDropShadowL(EFalse) );
+        return;
+        }
+    
+    TRAPD( err, EnableDropShadowL() );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::SetDropShadow ignore error %d", err )
+        return;
+        }
+        
+    DropShadowHandler()->SetOffset( 
+        TAlfTimedPoint( aShadowDistance.iX.iMagnitude,aShadowDistance.iY.iMagnitude ),
+        aShadowDistance.iX.iUnit ); // assume that the unit for x and y are the same
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageVisual::SetTurnAngle(const TAlfTimedValue& aAngle)
+    {
+    TPckgC<TAlfTimedValue> pckg(aAngle);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfImageVisualSetTurnAngle, pckg );            
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::SetTurnAngle ignore error %d", err )
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageVisual::SetScale(const TAlfTimedValue& aScale)
+    {
+    TPckgC<TAlfTimedValue> pckg(aScale);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfImageVisualSetScale, pckg );                    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::SetScale ignore error %d", err )
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageVisual::SetOffset(const TAlfTimedPoint& aOffset)
+    {
+    TPckgC<TAlfTimedPoint> pckg(aOffset);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfImageVisualSetOffset, pckg );                    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::SetOffset ignore error %d", err )
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C TAlfTimedValue CAlfImageVisual::SecondaryAlpha()
+    {
+    TAlfTimedValue value;
+    TPckg<TAlfTimedValue> buf(value);
+    TInt err = Comms()->DoSynchronousCmd( EAlfImageVisualSecondaryAlpha, 
+        KNullDesC8, 
+        buf);    
+    
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::SecondaryAlpha panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return value;            
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfTimedValue CAlfImageVisual::TurnAngle()
+    {
+    TAlfTimedValue value;
+    TPckg<TAlfTimedValue> buf(value);
+    TInt err = Comms()->DoSynchronousCmd( EAlfImageVisualTurnAngle, 
+        KNullDesC8, 
+        buf);    
+    
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::TurnAngle panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return value;                    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfTimedValue CAlfImageVisual::Scale()
+    {
+    TAlfTimedValue value;
+    TPckg<TAlfTimedValue> buf(value);
+    TInt err = Comms()->DoSynchronousCmd( EAlfImageVisualScale, 
+        KNullDesC8, 
+        buf);    
+    
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::Scale panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return value;                            
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfTimedPoint CAlfImageVisual::Offset()
+    {
+    TAlfTimedPoint value;
+    TPckg<TAlfTimedPoint> buf(value);
+    TInt err = Comms()->DoSynchronousCmd( EAlfImageVisualOffset, 
+        KNullDesC8, 
+        buf);    
+    
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfImageVisual::Offset panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return value;                                    
+    }
+    
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfImageVisual::RemoveAndDestroyAllD()
+    {
+    CAlfVisual::RemoveAndDestroyAllD();
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfImageVisual::UpdateChildrenLayout(TInt aTransitionTime )
+    {
+    CAlfVisual::UpdateChildrenLayout( aTransitionTime );
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfVisual* CAlfImageVisual::FindTag(const TDesC8& aTag)
+    {
+    return CAlfVisual::FindTag( aTag );
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfImageVisual::DoRemoveAndDestroyAllD()
+    {
+    CAlfVisual::DoRemoveAndDestroyAllD();
+    }
+    
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfImageVisual::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfVisual::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alflayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,816 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 class for layouts.
+*
+*/
+
+
+
+#include "alf/alflayout.h"
+#include "alf/alfcontrol.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfconstants.h"
+#include "alflogger.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+// Private structure
+struct CAlfLayout::TLayoutPrivateData
+    {
+    TLayoutPrivateData():iScrollOffset(0),iSkipServer(EFalse), 
+        iTransitionTime(KAlfLayoutDefaultTransitionTime){}
+    RPointerArray<CAlfVisual> iChildren;    // not owned.
+    TAlfTimedPoint* iScrollOffset;          // owned.
+    TBool iSkipServer;                      // should rather use flags than booleans                          
+    TInt iTransitionTime;
+    TAlfXYMetric iInnerPadding;
+    };
+
+
+
+// ======== LOCAL FUNCTIONS ========
+
+void AssertInnerPaddingsWereSetUsingDeprecatedPixelAPIs(const TAlfXYMetric& aMetric)
+    {
+    __ASSERT_DEBUG(
+        (aMetric.iX.iMagnitude == aMetric.iY.iMagnitude) && 
+        (aMetric.iX.iUnit == EAlfUnitPixel) &&
+        (aMetric.iY.iUnit == EAlfUnitPixel)
+        , USER_INVARIANT());
+#ifndef _DEBUG // Remove compile warnings
+    TAlfXYMetric tmp = aMetric;
+    tmp = tmp;
+#endif
+    }
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfLayout::CAlfLayout()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfLayout::ConstructL( CAlfControl& aOwner )
+    {
+    CAlfVisual::ConstructL( aOwner );
+    
+    iLayoutData = new (ELeave) TLayoutPrivateData;
+    iLayoutData->iInnerPadding = TAlfXYMetric(TAlfMetric(0));
+    }
+
+
+// ---------------------------------------------------------------------------
+// Create new layout.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfLayout* CAlfLayout::AddNewL(
+    CAlfControl& aOwner,
+    CAlfLayout* aParentLayout )
+    {
+    CAlfLayout* layout = aOwner.AppendLayoutL(
+        EAlfLayoutTypeLayout, 
+        aParentLayout);
+    return layout;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfLayout::~CAlfLayout()
+    {
+    if (iLayoutData )
+        {
+        // Remove children in reverse order.
+        for(TInt i = iLayoutData->iChildren.Count() - 1; i >= 0; --i)
+            {
+            Remove(iLayoutData->iChildren[i]);
+            }
+        iLayoutData->iChildren.Reset();
+        
+        delete iLayoutData->iScrollOffset;
+        iLayoutData->iScrollOffset = NULL;
+        }
+    delete iLayoutData;
+    iLayoutData = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Appends new visual as a child.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfLayout::RemoveAndDestroyAllD()
+    {
+    TBuf8<1> dum;
+    // Remove and destory from the server side
+    TInt err = Comms()->DoSynchronousCmd( EAlfVisualRemoveAndDestroyAll,KNullDesC8, dum);
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfLayout::RemoveAndDestroyAllD ignore error %d", err )
+        }
+            
+    DoRemoveAndDestroyAllD();
+    }
+    
+EXPORT_C void CAlfLayout::DoRemoveAndDestroyAllD()
+    {
+    iLayoutData->iSkipServer = ETrue;
+    for(TInt i = iLayoutData->iChildren.Count() - 1; i >= 0; --i)
+        {
+        iLayoutData->iChildren[i]->DoRemoveAndDestroyAllD();
+        }
+    iLayoutData->iChildren.Reset();
+
+    // Calls the server function and removes the link
+    // from the owner
+    CAlfVisual::DoRemoveAndDestroyAllD();
+    }
+
+
+// ---------------------------------------------------------------------------
+// Appends new visual as a child.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfLayout::Append( CAlfVisual* aVisual, TBool aConstructedWithParentInformation, TInt aLayoutTransitionTime )
+    {
+    ASSERT( aVisual && aVisual->Identifier());
+    
+    __ASSERT_ALWAYS( iLayoutData->iChildren.Find(aVisual) == KErrNotFound,
+                     USER_INVARIANT() );
+
+    TInt err = iLayoutData->iChildren.Append(aVisual);
+    if ( err != KErrNone )
+        {
+        return err;
+        }
+    
+    if (!aConstructedWithParentInformation) // other wise visual was added to this layout 
+        {                                   // during construction -> we mustn't apped visual to same layout twice 
+        
+        TInt2 params(aVisual->Identifier(), aLayoutTransitionTime);
+        TPckgC<TInt2> buf(params);        
+        TBuf8<1> dum;
+    
+        err = Comms()->DoSynchronousCmd(EAlfLayoutAppendVisual, buf, dum);    
+        if ( err != KErrNone )
+            {
+            __ALFLOGSTRING1( "CAlfLayout::Append return error %d", err )
+            }
+        }
+    
+    if ( err == KErrNone )
+        {
+        aVisual->SetLayout(this);
+        }
+    else    
+        {
+        // remove the last one
+        iLayoutData->iChildren.Remove( iLayoutData->iChildren.Count()-1 );
+        }
+    return err;
+    }
+ 
+// ---------------------------------------------------------------------------
+// Removes visual
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C void CAlfLayout::Remove(CAlfVisual* aVisual, TInt aLayoutTransitionTime)
+    {
+    ASSERT( aVisual );
+    TInt index = iLayoutData->iChildren.Find(aVisual);
+    __ASSERT_DEBUG(index != KErrNotFound,
+                   USER_INVARIANT());
+    if(index != KErrNotFound)
+        {
+        if ( !iLayoutData->iSkipServer )
+            {
+            TInt2 params(aVisual->Identifier(), aLayoutTransitionTime);
+            TPckgC<TInt2> buf(params);        
+            TBuf8<1> dum;
+            TInt err = Comms()->DoSynchronousCmd(EAlfLayoutRemoveVisual, buf, dum );
+        
+            if ( err )
+                {
+                __ALFLOGSTRING1( "CAlfLayout::Remove panic error %d", err )
+                USER_INVARIANT();
+                }
+            }
+     
+        iLayoutData->iChildren.Remove(index);
+        aVisual->SetLayout(NULL);
+        }
+    }
+
+EXPORT_C void CAlfLayout::Reorder(CAlfVisual& aVisual, TInt aPosition, TInt aLayoutTransitionTime)
+    {
+    TInt index = iLayoutData->iChildren.Find(&aVisual);
+    if(index == aPosition)
+        {
+        // No need to change anything.
+        return;
+        }
+    
+    ASSERT( aPosition >= 0 && aPosition < iLayoutData->iChildren.Count());
+    ASSERT( index != KErrNotFound );
+    TInt3 params(aVisual.Identifier(), aPosition, aLayoutTransitionTime);
+    
+    TPckgC<TInt3> buf(params);
+    TBuf8<1> dum;
+    TInt err = Comms()->DoSynchronousCmd(EAlfLayoutReorderVisual, buf, dum );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLayout::Reorder panic error %d", err )
+        USER_INVARIANT();  
+        }
+    
+    // Move the children around in the array, so that aVisual ends up
+    // at aPosition.
+    TInt direction = (aPosition>index)? 1:-1;
+    for(TInt i = index; i != aPosition; i += direction)
+        {
+        iLayoutData->iChildren[i] = iLayoutData->iChildren[i + direction];
+        }
+    iLayoutData->iChildren[aPosition] = &aVisual;        
+
+    iLayoutData->iSkipServer = ETrue; // don't post update to server unless derived class implements its own 
+                                      // override for UpdateChildrenLayout  
+
+    // use time set in CAlfEnv::StaticSetTransitionTime()
+    UpdateChildrenLayout(KAlfLayoutDefaultTransitionTime); // should use LOCAL time like Env.StaticTransitionTime()
+
+    iLayoutData->iSkipServer = EFalse;
+    }
+
+EXPORT_C void CAlfLayout::MoveVisualToFront(CAlfVisual& aVisual, TInt aLayoutTransitionTime)
+    {
+    ASSERT(iLayoutData);
+    Reorder(aVisual, iLayoutData->iChildren.Count() - 1, aLayoutTransitionTime);
+    }
+
+
+EXPORT_C void CAlfLayout::MoveVisualToBack(CAlfVisual& aVisual, TInt aLayoutTransitionTime)
+    {
+    Reorder(aVisual, 0, aLayoutTransitionTime);
+    }
+
+
+ 
+// ---------------------------------------------------------------------------
+// Returns visual count
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C TInt CAlfLayout::Count() const
+    {
+    return iLayoutData->iChildren.Count();
+    }
+ 
+// ---------------------------------------------------------------------------
+// Returns indexed visual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C CAlfVisual& CAlfLayout::Visual(TInt aIndex) const
+    {
+    return *iLayoutData->iChildren[aIndex];
+    }
+
+// ---------------------------------------------------------------------------
+// Enables scrolling
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfLayout::EnableScrollingL( TBool aScrolling )
+    {
+    // Already enabled?
+    if ( aScrolling && iLayoutData->iScrollOffset )
+        {
+        return;
+        }
+        
+    // Already disabled?
+    if ( !aScrolling && !iLayoutData->iScrollOffset )
+        {
+        return;
+        }
+    
+    // Allocate scroll object if enabling.
+    if ( aScrolling )
+        {
+        iLayoutData->iScrollOffset = new (ELeave) TAlfTimedPoint;
+        }
+
+    TPckgC<TInt> buf(aScrolling);
+    TBuf8<1> dum;
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfLayoutEnableScrolling, buf, dum);
+    
+    // If disabled from server side, free the old scrolling object on client side.
+    if ( err == KErrNone && !aScrolling )
+        {
+        delete iLayoutData->iScrollOffset;
+        iLayoutData->iScrollOffset = NULL;
+        }
+    
+    // If error on enabling the server side, we need to free the allocated scroll 
+    // object on the client side.
+    if ( err != KErrNone && aScrolling )
+        {
+        delete iLayoutData->iScrollOffset;
+        iLayoutData->iScrollOffset = NULL;
+        }
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLayout::EnableScrollingL leave error %d", err )
+        User::Leave( err );
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Is scrolling enabled?
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TBool CAlfLayout::Scrolling() const
+    {
+    return iLayoutData->iScrollOffset != NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns scrolling offset
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C const TAlfTimedPoint& CAlfLayout::ScrollOffset() const
+    {
+    __ASSERT_ALWAYS( iLayoutData->iScrollOffset, USER_INVARIANT() );
+ 
+
+    TPckg<TAlfTimedPoint> offsetPckg(*iLayoutData->iScrollOffset);
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfLayoutScrollOffset, KNullDesC8, offsetPckg);
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLayout::ScrollOffset ignore error %d", err )
+        }
+
+    return *iLayoutData->iScrollOffset;
+    }
+  
+// ---------------------------------------------------------------------------
+// Sets scrolling offset
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C void CAlfLayout::SetScrollOffset(const TAlfTimedPoint& aPoint )
+    {
+    __ASSERT_ALWAYS( iLayoutData->iScrollOffset, USER_INVARIANT() );
+    
+    iLayoutData->iScrollOffset->iX = aPoint.iX;
+    iLayoutData->iScrollOffset->iY = aPoint.iY;
+
+
+    TPckgC<TAlfTimedPoint> offsetPckg(*iLayoutData->iScrollOffset);
+    
+    TInt err = Comms()->DoCmdNoReply(EAlfLayoutSetScrollOffset, offsetPckg );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLayout::SetScrollOffset panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Returns indexed child ordinal.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfLayout::ChildOrdinal(TInt aIndex)
+    {
+    TInt ordinal = 0;
+    
+    TPckgC<TInt> buf(aIndex);
+    TPckg<TInt> ordinalPckg(ordinal);
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfLayoutChildOrdinal, buf, ordinalPckg);
+
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLayout::ChildOrdinal panic error %d", err )
+        USER_INVARIANT();
+        }
+
+    return ordinal;        
+    }
+
+// ---------------------------------------------------------------------------
+// Returns position of the child in the given ordinal value. 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfLayout::ChildPos(TInt aOrdinal, TPoint& aPos)
+    {    
+    TAlfPosInt pos = 
+        {
+        aPos,
+        aOrdinal
+        };
+        
+    TPckgC<TAlfPosInt> posBuf(pos);
+    //TBool reply(EFalse);
+    TPckg<TAlfPosInt> rBuf(pos); 
+   
+    TInt err = Comms()->DoSynchronousCmd(EAlfLayoutChildPos, posBuf, rBuf);
+
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLayout::ChildPos panic error %d", err )
+        USER_INVARIANT();
+        }
+
+    aPos = pos.iPoint;
+    return pos.iInt;        
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns size of the child in the given ordinal value. 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfLayout::ChildSize(TInt aOrdinal, TSize& aSize)
+    {
+    TAlfSizeInt size = 
+        {
+        aSize,
+        aOrdinal
+        };
+        
+    TPckgC<TAlfSizeInt> sizeBuf(size);
+    //TBool reply(EFalse);
+    TPckg<TAlfSizeInt> rBuf(size); 
+ 
+    TInt err = Comms()->DoSynchronousCmd(EAlfLayoutChildSize, sizeBuf, rBuf);
+
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLayout::ChildSize panic error %d", err )
+        USER_INVARIANT();
+        }
+   
+    aSize = size.iSize;
+   
+    return size.iInt;
+    }
+ 
+// ---------------------------------------------------------------------------
+// basecall only when really needed, in case of reordering, the server does 
+// this automatically
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfLayout::UpdateChildrenLayout(TInt aTransitionTime)
+    {
+    if (!iLayoutData->iSkipServer)
+        {
+        CAlfVisual::UpdateChildrenLayout(aTransitionTime);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C CAlfVisual* CAlfLayout::FindTag(const TDesC8& aTag)
+    {
+    CAlfVisual* result = CAlfVisual::FindTag(aTag);
+    if(!result && iLayoutData)
+        {
+        for(TInt i = 0; i < iLayoutData->iChildren.Count(); ++i)
+            {
+            result = iLayoutData->iChildren[i]->FindTag(aTag);
+            if(result)
+                {
+                break;
+                }
+            }
+        }
+
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfLayout::SetTransitionTime(TInt aTransitionTime)
+    {
+    TPckgC<TInt> buf(aTransitionTime);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfLayoutSetTransitionTime, buf );
+
+    if ( err == KErrNone )
+        {
+        iLayoutData->iTransitionTime = aTransitionTime;
+        }
+    else
+        {
+        USER_INVARIANT();
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TInt CAlfLayout::TransitionTime() const
+    {
+    return iLayoutData->iTransitionTime;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TSize CAlfLayout::VirtualSize() const
+    {
+    TSize size(0,0);
+    TPckg<TSize> buf(size);
+    TInt err = Comms()->DoSynchronousCmd( EAlfLayoutVirtualSize, KNullDesC8, buf);
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLayout::VirtualSize panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return size;    
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfLayout::SetInnerPadding(const TPoint& aInnerPadding)
+    {
+    
+    TPckgC<TPoint> buf(aInnerPadding);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfLayoutSetInnerPaddingPoint, buf );
+
+    if ( err == KErrNone )
+        {
+        iLayoutData->iInnerPadding = TAlfXYMetric(TAlfMetric(aInnerPadding.iX), TAlfMetric(aInnerPadding.iY));
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfLayout::SetInnerPadding panic error %d", err )
+        USER_INVARIANT();
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfLayout::SetInnerPadding(const TAlfXYMetric& aInnerPadding)
+    {
+    TPckgC<TAlfXYMetric> buf(aInnerPadding);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfLayoutSetInnerPaddingMetric, buf );
+
+    if ( err == KErrNone )
+        {
+        iLayoutData->iInnerPadding = aInnerPadding;
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfLayout::SetInnerPadding panic error %d", err )
+        USER_INVARIANT();
+        }        
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TInt CAlfLayout::HorizontalInnerPadding() const
+    {
+    AssertInnerPaddingsWereSetUsingDeprecatedPixelAPIs(iLayoutData->iInnerPadding);
+    return iLayoutData->iInnerPadding.iX.iMagnitude;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TInt CAlfLayout::VerticalInnerPadding() const
+    {
+    AssertInnerPaddingsWereSetUsingDeprecatedPixelAPIs(iLayoutData->iInnerPadding);
+    return iLayoutData->iInnerPadding.iY.iMagnitude;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TPoint CAlfLayout::InnerPadding() const
+    {
+    AssertInnerPaddingsWereSetUsingDeprecatedPixelAPIs(iLayoutData->iInnerPadding);
+    return TPoint(iLayoutData->iInnerPadding.iX.iMagnitude, iLayoutData->iInnerPadding.iY.iMagnitude);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C const TAlfXYMetric& CAlfLayout::InnerPaddingAsMetric() const
+    {
+    return iLayoutData->iInnerPadding;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TAlfRealPoint CAlfLayout::InnerPaddingInBaseUnits() const
+    {
+    TBufC8<1> inDum;
+    TAlfRealPoint value;
+    TPckg<TAlfRealPoint> outBuf(value);    
+    TInt err = Comms()->DoSynchronousCmd(EAlfLayoutInnerPaddingInBaseUnits, inDum, outBuf);    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLayout::InnerPaddingInBaseUnits ignore error %d", err )
+        }
+        
+    return value;            
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TInt CAlfLayout::FindVisual(CAlfVisual* aVisual) const
+    {
+    return iLayoutData->iChildren.Find(aVisual);        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TInt CAlfLayout::Insert(CAlfVisual* aVisual, TInt aPosition)
+    {
+    ASSERT( aVisual && aVisual->Identifier());
+    
+    __ASSERT_ALWAYS( iLayoutData->iChildren.Find(aVisual) == KErrNotFound,
+                     USER_INVARIANT() );
+
+    CAlfLayout* oldLayout = aVisual->Layout();
+
+	// These could be optimized to one server call if needed.   
+    TInt err = Append(aVisual);        
+    if ( err == KErrNone )
+        {
+        if (oldLayout != NULL)
+    	    {
+    	    // If this visual is already a member of another layout, 
+    	    // remove it from the old one
+        	oldLayout->Remove(aVisual);
+	        }
+        Reorder(*aVisual, aPosition);
+        }
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TInt CAlfLayout::EffectiveLayoutOrdinal(const CAlfVisual& aVisual) const
+    {
+    TInt ordinal = 0;
+
+    for(TInt i = 0; i < iLayoutData->iChildren.Count(); ++i)
+        {
+        if(iLayoutData->iChildren[i] == &aVisual)
+            {
+            return ordinal;
+            }
+
+        // The visuals that are laid out completely manually do not affect
+        // the layout ordinal.
+        if((iLayoutData->iChildren[i]->Flags() & EAlfVisualFlagManualLayout) !=
+           EAlfVisualFlagManualLayout)
+            {
+            ++ordinal;
+            }
+        }
+
+    __ALFLOGSTRING( "CAlfLayout::EffectiveLayoutOrdinal panic visual not found")
+    USER_INVARIANT();
+    return 0;
+    }
+   
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfLayout::SetBaseUnit(const TAlfMetric& aBaseUnit)
+    {
+    TPckg<TAlfMetric> inBuf(aBaseUnit);
+    TInt err = Comms()->DoCmdNoReply(EAlfLayoutSetBaseUnit, inBuf);  
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLayout::SetBaseUnit panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfLayout::SetBaseUnit(const TAlfXYMetric& aBaseUnit)
+    {
+    TPckg<TAlfXYMetric> inBuf(aBaseUnit);
+    TInt err = Comms()->DoCmdNoReply(EAlfLayoutSetBaseUnitXY, inBuf);  
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLayout::SetBaseUnit panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TAlfXYMetric CAlfLayout::BaseUnit() const
+    {
+    TAlfXYMetric baseUnit;
+    
+    TBuf8<1> inDum;
+    TPckg<TAlfXYMetric> outBuf(baseUnit);
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfLayoutBaseUnit, 
+        inDum, outBuf);
+
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLayout::BaseUnit panic error %d", err )
+        USER_INVARIANT();
+        }
+
+    return baseUnit;
+    }
+
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfLayout::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfVisual::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alflayoutmetrics.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,713 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Layout metrics
+*
+*/
+
+
+
+#include "alf/alflayoutmetrics.h"
+#include "alf/alftextstylemanager.h"
+#include "alf/alftextstyle.h"
+#include "alf/alftextvisual.h"
+#include "alf/alfvisual.h"
+#include "alf/alfutil.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+
+#include <e32debug.h>
+#include <avkon.hrh>
+#include <flogger.h>
+#include <AknFontCategory.hrh>
+
+
+_LIT(KHeader,"Comp Type|id|variety|name|Alias|type|Width|Height|Left|Right|Top|Bottom|Remarks|parent_id|parent_variety|Multi Row|Number of rows|style 1|style 2|style 3|Concatenated rows");
+_LIT(KDelimeterChar,"|");
+_LIT(KTypeText,"Text");
+_LIT(KTypePane,"Pane");
+_LIT(KVariety,"0");
+_LIT(KFontPrimary,"qfn_primary");
+_LIT(KFontPrimarySmall,"qfn_primary_small"); 
+_LIT(KFontSecondary,"qfn_secondary");
+_LIT(KFontTitle,"qfn_title");
+_LIT(KFontDigital,"qfn_digital");
+_LIT(KFontEmpty," ");
+_LIT(KFontUnknown,"unknown font");
+_LIT(KRemarks," ");
+_LIT(KParentVariety,"0");
+_LIT(KMultiRowYes,"true");
+_LIT(KMultiRowNo,"-");
+_LIT(KNumberOfRowsNone,"-");
+_LIT(KStyle1Plain,"plain");
+_LIT(KStyle1Bold,"bold");
+_LIT(KStyle1Empty,"-");
+_LIT(KStyle2Regular,"regular");
+_LIT(KStyle2Italic,"italic");
+_LIT(KStyle2Empty,"-");
+_LIT(KStyle3None,"none");
+_LIT(KStyle3Empty,"-");
+_LIT(KStyleConcatenatedRowsDefault,"true");
+_LIT(KStyleConcatenatedRowsEmpty,"-");
+_LIT(KNewLine,"\n");
+_LIT(KReportFileNameDefaultStart, "\\pqp_apps_"); 
+_LIT(KReportFileNameDefaultLscEnd, "_lsc.txt"); 
+_LIT(KReportFileNameDefaultPrtEnd, "_prt.txt"); 
+
+
+
+const TInt KParentIdStart = 200000;
+const TInt KIdStart = 100000;
+
+
+struct TMarkedVisualEntry
+    {    
+    public:
+    	~TMarkedVisualEntry()
+        {
+        }
+    	TMarkedVisualEntry(): 
+    	    iLogicalName(NULL), 
+    	    iAlias(NULL),
+    	    iVisual(NULL),
+    	    iTextSize(0,0),
+    	    iMaxLineCount(0),
+    	    iFontId(0),
+    	    iTextStyle(EAlfTextStyleNotAHuiStyle),
+    	    iVisualPosition(0,0),
+    	    iVisualSize(0,0)                                           
+        {                            
+        }
+    
+    HBufC* iLogicalName; 
+    HBufC* iAlias; 
+    CAlfTextVisual* iVisual;
+    TSize iTextSize;
+    TInt iMaxLineCount;
+    TInt iFontId;
+    TAlfPreconfiguredTextStyle iTextStyle;
+    TPoint iVisualPosition;
+    TPoint iVisualSize;
+    };
+
+struct CAlfLayoutMetricsUtility::TMetricsPrivateData
+    {
+    RArray<TMarkedVisualEntry> iEntries; // Owned
+    TBool iAutoMarking;
+    CAlfEnv* iEnv;
+    };
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfLayoutMetricsUtility::CAlfLayoutMetricsUtility()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfLayoutMetricsUtility::~CAlfLayoutMetricsUtility()
+    {
+    if ( iMetricsData )
+        {
+        TInt count = iMetricsData->iEntries.Count();
+        for(TInt i = 0; i < count; i++)
+          	{
+          	delete iMetricsData->iEntries[i].iLogicalName;
+          	iMetricsData->iEntries[i].iLogicalName = NULL;
+        	
+        	delete iMetricsData->iEntries[i].iAlias;
+        	iMetricsData->iEntries[i].iAlias = NULL;
+        	}
+        iMetricsData->iEntries.Close();   
+        }
+        
+    delete iMetricsData;
+    iMetricsData = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+CAlfLayoutMetricsUtility* CAlfLayoutMetricsUtility::NewL(CAlfEnv& aEnv)
+	{
+	CAlfLayoutMetricsUtility* self = 
+		CAlfLayoutMetricsUtility::NewLC(aEnv);        
+    CleanupStack::Pop( self );
+    return self;		
+	}
+	
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+CAlfLayoutMetricsUtility* CAlfLayoutMetricsUtility::NewLC(CAlfEnv& aEnv)
+	{
+    CAlfLayoutMetricsUtility* self = new( ELeave ) CAlfLayoutMetricsUtility;
+    CleanupStack::PushL( self );
+    self->ConstructL(aEnv);
+    return self;	
+	}
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+void CAlfLayoutMetricsUtility::ConstructL(CAlfEnv& aEnv)
+	{
+    iMetricsData = new (ELeave) TMetricsPrivateData;
+    iMetricsData->iAutoMarking = EFalse;
+    iMetricsData->iEnv = &aEnv;
+	}
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfLayoutMetricsUtility::MarkVisual(TDesC* aLogicalName, 
+    CAlfTextVisual* aVisual)
+    {
+    TRAP_IGNORE(MarkVisualL(aLogicalName, aVisual))
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfLayoutMetricsUtility::MarkVisualL(TDesC* aLogicalName, 
+    CAlfTextVisual* aVisual)
+    {
+    TInt count = iMetricsData->iEntries.Count();
+    for(TInt i = 0; i < count; i++)
+      	{
+      	if (aVisual == iMetricsData->iEntries[i].iVisual)
+      	    {
+          	delete iMetricsData->iEntries[i].iLogicalName;
+          	iMetricsData->iEntries[i].iLogicalName = NULL;
+        	
+        	delete iMetricsData->iEntries[i].iAlias;
+        	iMetricsData->iEntries[i].iAlias = NULL;
+
+            iMetricsData->iEntries.Remove(i);
+            break;      	        
+      	    }
+    	}
+
+    TMarkedVisualEntry entry;
+    if (aLogicalName)
+        {
+        entry.iLogicalName = aLogicalName->AllocL();        
+        }
+    
+    entry.iVisual = aVisual;
+    iMetricsData->iEntries.Append(entry);        
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfLayoutMetricsUtility::UnmarkVisual(CAlfTextVisual* aVisual)
+    {
+    TInt count = iMetricsData->iEntries.Count();
+    for(TInt i = 0; i < count; i++)
+      	{
+      	if (aVisual == iMetricsData->iEntries[i].iVisual)
+      	    {
+          	delete iMetricsData->iEntries[i].iLogicalName;
+          	iMetricsData->iEntries[i].iLogicalName = NULL;
+        	
+        	delete iMetricsData->iEntries[i].iAlias;
+        	iMetricsData->iEntries[i].iAlias = NULL;
+            
+            iMetricsData->iEntries.Remove(i);
+            break;      	        
+      	    }
+    	}
+        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfLayoutMetricsUtility::MeasureVisuals()
+    {
+    TRAP_IGNORE(MeasureVisualsL())
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfLayoutMetricsUtility::MeasureVisualsL()
+    {
+    TInt count = iMetricsData->iEntries.Count();
+    for(TInt i = 0; i < count; i++)
+      	{
+      	CAlfTextVisual* visual = iMetricsData->iEntries[i].iVisual;
+    	if (visual->EffectiveOpacity() > 0.0)
+    	    {
+        	iMetricsData->iEntries[i].iTextSize = 
+        	    TSize(visual->Size().IntValueNow().iX - visual->HorizontalPadding()*2, 
+        	    visual->TextExtents().iHeight);        	
+        	
+        	iMetricsData->iEntries[i].iMaxLineCount = visual->MaxLineCount();    	        
+    	    // iMetricsData->iEntries[i].iFontId = visual->FontId();
+    	    // CAlfTextVisual::FontId() has been deprecated for long and returns only zero.
+    	    iMetricsData->iEntries[i].iFontId = 0;
+    	    iMetricsData->iEntries[i].iTextStyle = visual->Style();      	        
+    	    iMetricsData->iEntries[i].iVisualPosition = visual->Pos().IntValueNow();
+    	    iMetricsData->iEntries[i].iVisualPosition.iX += visual->HorizontalPadding(); 
+    	    iMetricsData->iEntries[i].iVisualSize = visual->Size().IntValueNow();
+    	    iMetricsData->iEntries[i].iVisualSize.iX -= visual->HorizontalPadding(); 
+
+        	delete iMetricsData->iEntries[i].iAlias;
+        	iMetricsData->iEntries[i].iAlias = NULL;
+            iMetricsData->iEntries[i].iAlias = visual->Text().AllocL();                 
+
+            if (!iMetricsData->iEntries[i].iLogicalName)
+                {
+                iMetricsData->iEntries[i].iLogicalName = visual->Text().AllocL();         
+                }
+                
+            // If max linecount has not been set to textvisual, 
+            // we kindly here calculate it.    
+            if (iMetricsData->iEntries[i].iMaxLineCount > 1)
+                {
+                if (iMetricsData->iEntries[i].iMaxLineCount == KMaxTInt && 
+                    iMetricsData->iEntries[i].iTextSize.iHeight)
+                    {                
+                    iMetricsData->iEntries[i].iMaxLineCount = 
+                        iMetricsData->iEntries[i].iVisualSize.iY/iMetricsData->iEntries[i].iTextSize.iHeight;
+                    }
+                }
+    	    }
+    	}        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfLayoutMetricsUtility::EnableAutoMarking(TBool aEnabled)
+    {
+    iMetricsData->iAutoMarking = aEnabled;        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfLayoutMetricsUtility::AutoMarking()
+    {
+    return iMetricsData->iAutoMarking;                
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfLayoutMetricsUtility::WriteReport()
+    {  	   	
+   	TBuf<512> b;
+    
+    b.Zero();
+    b.Append(KHeader);
+    b.Append(KNewLine);    
+    
+    PrintToFile(b);
+
+    TInt count = iMetricsData->iEntries.Count();
+    for(TInt i = 0; i < count; i++)
+      	{
+  	    TMarkedVisualEntry e = iMetricsData->iEntries[i];
+
+        TSize screensize = AlfUtil::ScreenSize();
+        
+        const TDesC* multiRow = &KMultiRowNo;
+    	TBuf<12> rows;
+        rows.Zero();
+    	
+        if (e.iMaxLineCount > 1)
+            {
+            multiRow = &KMultiRowYes;
+            rows.AppendNum(e.iMaxLineCount);        
+            }
+        else
+            {
+            rows.Append( KNumberOfRowsNone );    
+            }    
+
+
+    	TBuf<64> font;
+        font.Zero();
+
+    	TBuf<64> style1;
+        style1.Zero();
+
+    	TBuf<64> style2;
+        style2.Zero();
+
+    	TBuf<64> style3;
+        style3.Zero();
+        
+        if (e.iFontId)
+            {
+            // We use secret knowledge to decode font id
+        	const TUint encodedMask = 0x80000000; // 1 bits starting at bit 31 = 1000.0000.0000.0000.0000.0000.0000.0000
+        	const TUint categoryMask = 0x0000000F; // 4 bits starting at bit 0 = 0000.0000.0000.0000.0000.0000.0000.1111
+        	const TUint weightMask = 0x00000010; // 1 bits starting at bit 4 = 0000.0000.0000.0000.0000.0000.0001.0000
+        	const TUint postureMask = 0x00000020; // 1 bits starting at bit 5 = 0000.0000.0000.0000.0000.0000.0010.0000        
+
+            if ((e.iFontId & encodedMask) != 0)
+                {
+                TInt category = (e.iFontId & categoryMask);
+                    {
+                    if (category == KAknFontCategoryPrimary)
+                        {
+                        font.Append(KFontPrimary);                                                                                                                                        
+                        }
+                    else if (category == KAknFontCategorySecondary)
+                        {
+                        font.Append(KFontSecondary);                                                                                                            
+                        }
+                    else if (category == KAknFontCategoryTitle)
+                        {
+                        font.Append(KFontTitle);                                                                                
+                        }
+                    else if (category == KAknFontCategoryPrimarySmall)
+                        {
+                        font.Append(KFontPrimarySmall);                                                    
+                        }
+                    else if (category == KAknFontCategoryDigital)
+                        {
+                        font.Append(KFontDigital);                        
+                        }
+                    else
+                        {
+                        font.Append(KFontUnknown);                                                
+                        }                            
+                    }
+                
+                TInt weight = (e.iFontId & weightMask) >> 4;
+                if (weight == EStrokeWeightBold)
+                    {
+                    style1.Append(KStyle1Bold);                                                
+                    }
+                else
+                    {
+                    style1.Append(KStyle1Plain);                        
+                    }    
+                
+                TInt posture = (e.iFontId & postureMask) >> 5;
+                if (posture == EPostureItalic)
+                    {
+                    style2.Append(KStyle2Italic);                        
+                    }
+                else
+                    {                    
+                    style2.Append(KStyle2Regular);
+                    }    
+                                    
+                style3.Append(KStyle3None);                    
+                }
+            else
+                {
+                font.Append(KFontUnknown);                    
+                style1.Append(KStyle1Plain);
+                style2.Append(KStyle2Regular);
+                style3.Append(KStyle3None);                    
+                }
+            }
+        else
+            {
+            TInt fontStyleId = 0;
+            iMetricsData->iEnv->Client().LayoutMetricsTextStyleData(fontStyleId, e.iTextStyle);
+
+            CAlfTextStyleManager* tsm = &iMetricsData->iEnv->TextStyleManager();                                
+            CAlfTextStyle* ts = tsm->TextStyle(e.iTextStyle);
+
+            if (ts->IsBold())
+                {
+                style1.Append(KStyle1Bold);                        
+                }
+            else
+                {                        
+                style1.Append(KStyle1Plain);
+                }
+
+            if (ts->IsItalic())
+                {
+                style2.Append(KStyle2Italic);                        
+                }
+            else
+                {
+                style2.Append(KStyle2Regular);                        
+                }    
+                    
+            style3.Append(KStyle3None);
+
+            switch (fontStyleId)
+                {                                
+                case EAknLogicalFontPrimaryFont:
+                    {
+                    font.Append(KFontPrimary);
+                    break;    
+                    }
+                case EAknLogicalFontSecondaryFont:
+                    {
+                    font.Append(KFontSecondary);                    
+                    break;    
+                    }
+                case EAknLogicalFontTitleFont:
+                    {
+                    font.Append(KFontTitle);                                        
+                    break;    
+                    }
+                case EAknLogicalFontPrimarySmallFont:
+                    {
+                    font.Append(KFontPrimarySmall);
+                    break;    
+                    }
+                case EAknLogicalFontDigitalFont:
+                    {
+                    font.Append(KFontDigital);                    
+                    break;    
+                    }
+                default:
+                    {
+                    font.Append(KFontPrimary);                    
+                    break;    
+                    }                                                                                      
+                }    
+            }
+
+    	b.Zero();
+        b.Append( KTypeText );    
+        b.Append( KDelimeterChar );    
+        b.AppendNum( i + KIdStart );    
+        b.Append( KDelimeterChar );    
+        b.Append( KVariety );    
+        b.Append( KDelimeterChar );    
+        b.Append( (_L("%S"), *e.iLogicalName));    
+        b.Append( KDelimeterChar );    
+        b.Append( (_L("%S"), *e.iAlias));    
+        b.Append( KDelimeterChar );    
+        b.Append( font );    
+        b.Append( KDelimeterChar );    
+        b.AppendNum( e.iTextSize.iWidth );    
+        b.Append( KDelimeterChar );    
+        b.AppendNum( e.iTextSize.iHeight );    
+        b.Append( KDelimeterChar );    
+        b.AppendNum( e.iVisualPosition.iX );    
+        b.Append( KDelimeterChar );    
+        b.AppendNum( screensize.iWidth - e.iVisualPosition.iX - e.iVisualSize.iX );    
+        b.Append( KDelimeterChar );    
+        b.AppendNum( e.iVisualPosition.iY );    
+        b.Append( KDelimeterChar );    
+        b.AppendNum( screensize.iHeight -  e.iVisualPosition.iY - e.iVisualSize.iY );    
+        b.Append( KDelimeterChar );    
+        b.Append( KRemarks );    
+        b.Append( KDelimeterChar );    
+        if (e.iMaxLineCount > 1)
+            {
+            b.AppendNum( i + KParentIdStart );        
+            }
+        else
+            {
+            b.Append( KParentVariety );                    
+            }    
+        b.Append( KDelimeterChar );    
+        b.AppendNum( 0 );    // Parent variety, always 0
+        b.Append( KDelimeterChar );    
+	    b.Append( KMultiRowNo ); // Multi row attribute is in the parent pane
+        b.Append( KDelimeterChar );    
+	    b.Append( KNumberOfRowsNone ); // Number of rows attribute is in the parent pane
+        b.Append( KDelimeterChar );    
+        b.Append( style1 );    
+        b.Append( KDelimeterChar );    
+        b.Append( style2 );    
+        b.Append( KDelimeterChar );    
+        b.Append( style3 );    
+        b.Append( KDelimeterChar );    
+        b.Append( KStyleConcatenatedRowsDefault );    
+        b.Append( KNewLine );    
+
+        PrintToFile(b);
+
+        // For multirow texts a parent pane is needed.
+        if (e.iMaxLineCount > 1)
+            {
+            b.Zero(); 
+            b.Append( KTypePane );    
+            b.Append( KDelimeterChar );    
+            b.AppendNum( i + KParentIdStart );    
+            b.Append( KDelimeterChar );    
+            b.Append( KVariety );    
+            b.Append( KDelimeterChar );    
+            b.Append( (_L("%S"), *e.iLogicalName));    
+            b.Append( _L("_parent_pane"));    
+            b.Append( KDelimeterChar );    
+            b.Append( _L("Parent pane for "));    
+            b.Append( (_L("%S"), *e.iLogicalName));    
+            b.Append( _L(" (multirow text)"));                
+            b.Append( KDelimeterChar );    
+            b.Append( KFontEmpty );    
+            b.Append( KDelimeterChar );    
+            b.AppendNum( e.iTextSize.iWidth );    
+            b.Append( KDelimeterChar );    
+            b.AppendNum(e.iVisualSize.iY );    
+            b.Append( KDelimeterChar );    
+            b.AppendNum( e.iVisualPosition.iX );    
+            b.Append( KDelimeterChar );    
+            b.AppendNum( screensize.iWidth - e.iVisualPosition.iX - e.iVisualSize.iX );    
+            b.Append( KDelimeterChar );    
+            b.AppendNum( e.iVisualPosition.iY );    
+            b.Append( KDelimeterChar );    
+            b.AppendNum( screensize.iHeight -  e.iVisualPosition.iY - e.iVisualSize.iY );    
+            b.Append( KDelimeterChar );    
+            b.Append( KRemarks );    
+            b.Append( KDelimeterChar );    
+            b.AppendNum( 0 );    
+            b.Append( KDelimeterChar );    
+            b.Append( KParentVariety );    
+            b.Append( KDelimeterChar );    
+    	    b.Append( *multiRow );
+            b.Append( KDelimeterChar );    
+    	    b.Append( rows );
+            b.Append( KDelimeterChar );    
+            b.Append( KStyle1Empty );    
+            b.Append( KDelimeterChar );    
+            b.Append( KStyle2Empty );    
+            b.Append( KDelimeterChar );    
+            b.Append( KStyle3Empty );    
+            b.Append( KDelimeterChar );    
+            b.Append( KStyleConcatenatedRowsEmpty );    
+            b.Append( KNewLine );                    
+            PrintToFile(b);
+            }
+    	}        
+    }
+    
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+void CAlfLayoutMetricsUtility::PrintToFile( TDesC16& aBuf )
+    {
+    RFs fs;
+   	TBuf<512> filename;
+    filename.Zero();
+    TSize screensize = AlfUtil::ScreenSize();
+    filename.Append( KReportFileNameDefaultStart );
+    if (screensize == TSize(240,320))
+        {
+        filename.Append(_L("qvga"));    
+        filename.Append(KReportFileNameDefaultPrtEnd);
+        }
+    else if (screensize == TSize(320,240))
+        {
+        filename.Append(_L("qvga"));    
+        filename.Append(KReportFileNameDefaultLscEnd);            
+        }
+    else if (screensize == TSize(480,640))
+        {
+        filename.Append(_L("vga"));    
+        filename.Append(KReportFileNameDefaultPrtEnd);                                    
+        }
+    else if (screensize == TSize(640,480))
+        {
+        filename.Append(_L("vga"));    
+        filename.Append(KReportFileNameDefaultLscEnd);                        
+        }
+    else if (screensize == TSize(360,640))
+        {
+        filename.Append(_L("qhd"));    
+        filename.Append(KReportFileNameDefaultPrtEnd);                                    
+        }
+    else if (screensize == TSize(640,360))
+        {
+        filename.Append(_L("qhd"));    
+        filename.Append(KReportFileNameDefaultLscEnd);                        
+        }
+    else if (screensize == TSize(320,480))
+        {
+        filename.Append(_L("hvga"));    
+        filename.Append(KReportFileNameDefaultPrtEnd);                                    
+        }
+    else if (screensize == TSize(480,320))
+        {
+        filename.Append(_L("hvga"));    
+        filename.Append(KReportFileNameDefaultLscEnd);                        
+        }
+    else
+        {
+        filename.AppendNum(screensize.iWidth);    
+        filename.Append(_L("x"));    
+        filename.AppendNum(screensize.iHeight);    
+        if (screensize.iWidth < screensize.iHeight)
+            {
+            filename.Append(KReportFileNameDefaultPrtEnd);                                                    
+            }
+        else
+            {
+            filename.Append(KReportFileNameDefaultLscEnd);                                                                    
+            }                
+        }    
+        
+    
+    if ( fs.Connect() == KErrNone )
+        {
+        RFile file;
+
+        // Open file in an exclusive mode so that only one thread 
+        // can acess it simultaneously
+        TUint fileMode = EFileWrite | EFileShareExclusive;
+       
+        TInt err = file.Open( fs, filename, fileMode );
+
+        // Create a file if it doesn't exist
+        if ( err == KErrNotFound )
+            {
+            err = file.Create( fs, filename, fileMode );
+            }
+
+        // Check if we have access to a file
+        if ( err == KErrNone )
+            {
+            TInt offset = 0;
+            if ( file.Seek( ESeekEnd, offset ) == KErrNone )
+                {
+                // Append text to the end of file
+                TPtr8 ptr8( (TUint8*)aBuf.Ptr(), aBuf.Size(), aBuf.Size() );
+                file.Write( ptr8 );
+                }
+            file.Close();
+            }
+
+        fs.Close();
+        }
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alflctanchorlayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,181 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Anchor layout
+*
+*/
+
+
+
+#include "alf/alflctanchorlayout.h"
+#include "alf/alfcontrol.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alf/alfconstants.h"
+#include "alf/alfgencomponent.h"
+#include "alflogger.h"
+#include "alfuids.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+#ifdef RD_ALF_IN_PLATFORM
+#include <aknlayout2hierarchy.h>
+#endif
+
+
+// ======== LOCAL FUNCTIONS ========
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// 1st phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfLCTAnchorLayout::CAlfLCTAnchorLayout()
+    : CAlfAnchorLayout()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfLCTAnchorLayout::ConstructL(CAlfControl& aOwner)
+    {
+    CAlfLayout::ConstructL(aOwner);
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfLCTAnchorLayout::~CAlfLCTAnchorLayout()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Creates new anchor layout for the control.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfLCTAnchorLayout* CAlfLCTAnchorLayout::AddNewL(
+    CAlfControl& aOwnerControl,
+    CAlfLayout* aParentLayout )
+    {
+    CAlfLCTAnchorLayout* layout = STATIC_CAST(CAlfLCTAnchorLayout*,
+        aOwnerControl.AppendLayoutL(EAlfLayoutTypeLCTAnchor, aParentLayout));
+    return layout;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets anchor
+// ---------------------------------------------------------------------------
+//
+#ifdef RD_ALF_IN_PLATFORM            
+EXPORT_C void CAlfLCTAnchorLayout::SetAnchors(
+    TInt aOrdinal,
+    TAknLayoutHierarchyComponentHandle& aComponentHandle,
+    const TAlfTimedPoint& aOffset)
+    {
+    TAlfLCTAnchorSetAnchorsParams params;
+    
+    params.iOrdinal = aOrdinal;
+    params.iApiId = aComponentHandle.ApiId();
+    params.iComponentId = aComponentHandle.ComponentId();
+    params.iOptionIndex = 0; // not used yet
+    params.iDrawingOrderIndex = 0;  // not used yet
+    params.iVarietyIndex = aComponentHandle.VarietyIndex();
+    params.iColumn = aComponentHandle.Column();
+    params.iRow = aComponentHandle.Row();
+    
+    params.iOffset = aOffset;
+    
+    TPckg<TAlfLCTAnchorSetAnchorsParams> paramsPckg(params);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfLCTAnchorLayoutSetAnchors, paramsPckg  );
+    if ( err == KErrNone )
+        {
+        __ALFLOGSTRING( "LCTAnchorSetAnchors ok" )
+        }
+    else
+        {
+        __ALFLOGSTRING1( "LCTAnchorSetAnchors return error %d", err )
+        USER_INVARIANT(); 
+        }
+    }
+#else // RD_ALF_IN_PLATFORM
+EXPORT_C void CAlfLCTAnchorLayout::SetAnchors(TInt /*aOrdinal*/, TAknLayoutHierarchyComponentHandle& /*aComponentHandle*/, const TAlfTimedPoint& /*aOffset*/)
+    {
+    }
+#endif // RD_ALF_IN_PLATFORM
+
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfLCTAnchorLayout::RemoveAndDestroyAllD()
+    {
+    CAlfAnchorLayout::RemoveAndDestroyAllD();
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfLCTAnchorLayout::UpdateChildrenLayout(TInt aTransitionTime )
+    {
+    CAlfAnchorLayout::UpdateChildrenLayout( aTransitionTime );
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfVisual* CAlfLCTAnchorLayout::FindTag(const TDesC8& aTag)
+    {
+    return CAlfAnchorLayout::FindTag( aTag );
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfLayout
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TAlfXYMetric CAlfLCTAnchorLayout::BaseUnit() const
+    {
+    return CAlfAnchorLayout::BaseUnit();
+    }
+ 
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfLCTAnchorLayout::DoRemoveAndDestroyAllD()
+    {
+    CAlfAnchorLayout::DoRemoveAndDestroyAllD();
+    }
+    
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfLCTAnchorLayout::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfAnchorLayout::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
+    }
+    
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alflctgridlayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,175 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   LCT Grid Layout
+*
+*/
+
+
+
+#include "alf/alflctgridlayout.h"
+#include "alf/alfcontrol.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alf/alfconstants.h"
+#include "alf/alfgencomponent.h"
+#include "alflogger.h"
+#include "alfuids.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+#ifdef RD_ALF_IN_PLATFORM
+#include <aknlayout2hierarchy.h>
+#endif
+
+
+// ======== LOCAL FUNCTIONS ========
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// 1st phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfLCTGridLayout::CAlfLCTGridLayout()
+    : CAlfGridLayout()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfLCTGridLayout::ConstructL(CAlfControl& aOwner)
+    {
+    CAlfGridLayout::ConstructL(aOwner);
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfLCTGridLayout::~CAlfLCTGridLayout()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Creates new grid layout for the control.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfLCTGridLayout* CAlfLCTGridLayout::AddNewL(
+    CAlfControl& aOwnerControl,
+    CAlfLayout* aParentLayout )
+    {
+    CAlfLCTGridLayout* layout = STATIC_CAST(CAlfLCTGridLayout*,
+        aOwnerControl.AppendLayoutL(EAlfLayoutTypeLCTGrid, aParentLayout));
+    return layout;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets cols and rows
+// ---------------------------------------------------------------------------
+//
+#ifdef RD_ALF_IN_PLATFORM            
+EXPORT_C void CAlfLCTGridLayout::SetColsAndRows(
+    TAknLayoutHierarchyComponentHandle& aComponentHandle,
+    const TAlfTimedPoint& aOffset)
+    {
+    TAlfLCTGridSetColsAndRowsParams params;
+    
+    params.iApiId = aComponentHandle.ApiId();
+    params.iComponentId = aComponentHandle.ComponentId();
+    params.iOptionIndex = 0; // not used yet
+    params.iDrawingOrderIndex = 0;  // not used yet
+    params.iVarietyIndex = aComponentHandle.VarietyIndex();
+    params.iColumn = aComponentHandle.Column();
+    params.iRow = aComponentHandle.Row();
+    
+    params.iOffset = aOffset;
+    
+    TPckg<TAlfLCTGridSetColsAndRowsParams> paramsPckg(params);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfLCTGridLayoutSetColsAndRows, paramsPckg );
+    if ( err == KErrNone )
+        {
+        __ALFLOGSTRING( "LCTGridLayoutSetColsAndRows ok" )
+        }
+    else
+        {
+        __ALFLOGSTRING1( "LCTGridLayoutSetColsAndRows return error %d", err )
+        USER_INVARIANT(); 
+        }
+    }
+#else // RD_ALF_IN_PLATFORM
+EXPORT_C void CAlfLCTGridLayout::SetColsAndRows(TAknLayoutHierarchyComponentHandle& /*aComponentHandle*/, const TAlfTimedPoint& /*aOffset*/)
+    {
+    }
+#endif // RD_ALF_IN_PLATFORM
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfLCTGridLayout::RemoveAndDestroyAllD()
+    {
+    CAlfGridLayout::RemoveAndDestroyAllD();
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfLCTGridLayout::UpdateChildrenLayout(TInt aTransitionTime )
+    {
+    CAlfGridLayout::UpdateChildrenLayout( aTransitionTime );
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfVisual* CAlfLCTGridLayout::FindTag(const TDesC8& aTag)
+    {
+    return CAlfGridLayout::FindTag( aTag );
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfLayout
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TAlfXYMetric CAlfLCTGridLayout::BaseUnit() const
+    {
+    return CAlfGridLayout::BaseUnit();
+    }
+ 
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfLCTGridLayout::DoRemoveAndDestroyAllD()
+    {
+    CAlfGridLayout::DoRemoveAndDestroyAllD();
+    }
+    
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfLCTGridLayout::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfGridLayout::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alflcttextvisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,171 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   LCT Text visual
+*
+*/
+
+
+
+#include "alf/alflcttextvisual.h"
+#include "alf/alfcontrol.h"
+#include "alf/alfconstants.h"
+#include "alf/alfgencomponent.h"
+#include "alflogger.h"
+#include "alfuids.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+#ifdef RD_ALF_IN_PLATFORM
+#include <aknlayout2hierarchy.h>
+#endif
+
+struct CAlfLCTTextVisual::TLCTTextVisualPrivateData
+    {
+    };
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfLCTTextVisual::CAlfLCTTextVisual()
+    :
+    iLCTTextVisualData(NULL)
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfLCTTextVisual::ConstructL(CAlfControl& aOwner)
+    {
+    CAlfTextVisual::ConstructL(aOwner);
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfLCTTextVisual::~CAlfLCTTextVisual()
+    {
+    delete iLCTTextVisualData;
+    iLCTTextVisualData = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Creates new CAlfLCTTextVisual
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfLCTTextVisual* CAlfLCTTextVisual::AddNewL(
+    CAlfControl& aOwnerControl,
+    CAlfLayout* aParentLayout)
+    {
+    CAlfLCTTextVisual* text = STATIC_CAST(CAlfLCTTextVisual*,
+        aOwnerControl.AppendVisualL(EAlfVisualTypeLCTText, aParentLayout));
+    return text;
+    }
+    
+
+
+// ---------------------------------------------------------------------------
+// Sets the layout component handle for the text pane
+// ---------------------------------------------------------------------------
+//
+#ifdef RD_ALF_IN_PLATFORM            
+EXPORT_C void CAlfLCTTextVisual::SetTextPane(TAknLayoutHierarchyComponentHandle& aComponentHandle)
+    {
+    TAlfLCTTextVisualSetTextPaneParams params;
+    
+    params.iApiId = aComponentHandle.ApiId();
+    params.iComponentId = aComponentHandle.ComponentId();
+    params.iOptionIndex = 0; // not used yet
+    params.iDrawingOrderIndex = 0;  // not used yet
+    params.iVarietyIndex = aComponentHandle.VarietyIndex();
+    params.iColumn = aComponentHandle.Column();
+    params.iRow = aComponentHandle.Row();
+    
+    TPckg<TAlfLCTTextVisualSetTextPaneParams> paramsPckg(params);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfLCTTextVisualSetTextPane, paramsPckg );
+    if ( err == KErrNone )
+        {
+        __ALFLOGSTRING( "LCTTextVisualSetTextPane ok" )
+        }
+    else
+        {
+        __ALFLOGSTRING1( "LCTTxtVisualSetTextPane return error %d", err )
+        USER_INVARIANT(); 
+        }
+    }
+#else // RD_ALF_IN_PLATFORM            
+EXPORT_C void CAlfLCTTextVisual::SetTextPane(TAknLayoutHierarchyComponentHandle& /*aComponentHandle*/)
+    {
+    }
+#endif // RD_ALF_IN_PLATFORM            
+    
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfLCTTextVisual::RemoveAndDestroyAllD()
+    {
+    CAlfTextVisual::RemoveAndDestroyAllD();
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfLCTTextVisual::UpdateChildrenLayout(TInt aTransitionTime )
+    {
+    CAlfTextVisual::UpdateChildrenLayout( aTransitionTime );
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfVisual* CAlfLCTTextVisual::FindTag(const TDesC8& aTag)
+    {
+    return CAlfTextVisual::FindTag( aTag );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfLCTTextVisual::DoRemoveAndDestroyAllD()
+    {
+    CAlfTextVisual::DoRemoveAndDestroyAllD();
+    }
+    
+
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfLCTTextVisual::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfTextVisual::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
+    }
+    
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alflinevisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,365 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "alf/alflinevisual.h"
+#include "alf/alfcontrol.h"
+#include "alf/alfimage.h"
+#include "alf/alftexture.h"
+#include "alf/alfcurvepath.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfmappingfunctions.h"
+#include "alflogger.h"
+#include "alf/alfconstants.h"
+#include "alfskinnableimage.h"
+#include "alf/alfenv.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+struct CAlfLineVisual::TLineVisualPrivateData
+    {
+    TAlfTimedValue iThickness;
+    TAlfTimedValue iShadowThickness;
+    TAlfTimedValue iStartPos;
+    TAlfTimedValue iEndPos;
+    CAlfCurvePath* iPath;
+    TAlfOwnership iOwnership;
+    CAlfSkinnableImage* iImage;
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+EXPORT_C CAlfLineVisual* CAlfLineVisual::AddNewL(
+    CAlfControl& aOwnerControl,
+    CAlfLayout* aParentLayout )
+    {
+    CAlfLineVisual* text = STATIC_CAST(CAlfLineVisual*,
+        aOwnerControl.AppendVisualL(EAlfVisualTypeLine, aParentLayout));
+    return text;
+    }
+
+EXPORT_C CAlfLineVisual::CAlfLineVisual()
+    {
+    }
+
+EXPORT_C void CAlfLineVisual::ConstructL(CAlfControl& aOwner)
+    {
+    CAlfVisual::ConstructL(aOwner);
+    
+    iLineVisualData = new (ELeave) TLineVisualPrivateData;
+    
+    iLineVisualData->iPath = NULL;
+    iLineVisualData->iImage = NULL;
+    
+    iLineVisualData->iImage = new (ELeave) CAlfSkinnableImage(&aOwner.Env());
+    }
+
+EXPORT_C CAlfLineVisual::~CAlfLineVisual()
+    {
+    if ( iLineVisualData )
+        {
+        delete iLineVisualData->iImage;
+        iLineVisualData->iImage = NULL;
+        
+        if ( iLineVisualData->iOwnership == EAlfHasOwnership )
+            {
+            delete iLineVisualData->iPath;
+            }
+        iLineVisualData->iPath = NULL;
+        }
+    delete iLineVisualData;
+    iLineVisualData = NULL;
+    }
+
+EXPORT_C void CAlfLineVisual::SetPath(CAlfCurvePath* aPath, 
+                                      TAlfOwnership aOwnership)
+    {
+    TInt curvePathHandle = 0;
+    if ( aPath )
+        {
+        MAlfMappingFunction* mappingFunction = aPath;
+        curvePathHandle = mappingFunction->MappingFunctionIdentifier();
+        } 
+
+
+    TInt2 params( curvePathHandle, aOwnership );
+    TPckgC<TInt2> inBuf( params );
+
+    TInt err = Comms()->DoCmdNoReply(EAlfLineVisualSetPath, inBuf );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLineVisual::SetPath panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    // Destroy the old one if owned.
+    if ( iLineVisualData->iOwnership == EAlfHasOwnership )
+        {
+        delete iLineVisualData->iPath;
+        }
+    
+    iLineVisualData->iPath = aPath;
+    iLineVisualData->iOwnership = aOwnership;
+    }
+
+EXPORT_C CAlfCurvePath* CAlfLineVisual::Path()
+    {
+    return iLineVisualData->iPath;
+    }
+
+EXPORT_C void CAlfLineVisual::SetImage(const TAlfImage& aImage)
+    {
+    iLineVisualData->iImage->SetImage(aImage);// This texturizes skin graphics if needed
+    
+    TAlfImageParams params(iLineVisualData->iImage->Image());
+
+    TPckgC<TAlfImageParams> buf(params);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfLineVisualSetImage, buf );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLineVisual::SetImage ignore error %d", err )
+        }
+    }
+    
+EXPORT_C const TAlfImage& CAlfLineVisual::Image() const
+    {
+    return iLineVisualData->iImage->Image();
+    }
+
+EXPORT_C void CAlfLineVisual::SetAlphaFunction(MAlfMappingFunction* aFunction)
+    {
+    TInt mappingFunctionHandle = 0;
+    if ( aFunction )
+        {
+        mappingFunctionHandle = aFunction->MappingFunctionIdentifier();
+        }
+        
+    TPckgC<TInt> inBuf( mappingFunctionHandle );
+    
+    TInt err = Comms()->DoCmdNoReply(EAlfLineVisualSetAlphaFunction, inBuf );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLineVisual::SetAlphaFunction panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+EXPORT_C void CAlfLineVisual::SetWidthFunction(MAlfMappingFunction* aFunction)
+    {
+    TInt mappingFunctionHandle = 0;
+    if ( aFunction )
+        {
+        mappingFunctionHandle = aFunction->MappingFunctionIdentifier();
+        }
+    TPckgC<TInt> inBuf( mappingFunctionHandle );
+    
+    TInt err =Comms()->DoCmdNoReply(EAlfLineVisualSetWidthFunction, inBuf );
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLineVisual::SetWidthFunction panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+EXPORT_C const TAlfTimedValue& CAlfLineVisual::Thickness() const
+    {
+    TPckg<TAlfTimedValue> buf(iLineVisualData->iThickness);
+    TInt err = Comms()->DoSynchronousCmd( EAlfLineVisualGetThickness, buf, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfLineVisual::Thickness panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return iLineVisualData->iThickness;
+    }
+
+EXPORT_C void CAlfLineVisual::SetThickness( const TAlfTimedValue& aThickness )
+    {
+    TPckgC<TAlfTimedValue> buf(aThickness);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfLineVisualSetThickness, buf );
+
+    if ( err == KErrNone )
+        {
+        iLineVisualData->iThickness = aThickness;
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfLineVisual::SetThickness panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+EXPORT_C const TAlfTimedValue& CAlfLineVisual::ShadowThickness() const
+    {
+    TPckg<TAlfTimedValue> buf(iLineVisualData->iShadowThickness);
+    TInt err = Comms()->DoSynchronousCmd( EAlfLineVisualGetShadowThickness, buf, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfLineVisual::ShadowThickness panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return iLineVisualData->iShadowThickness;
+    }
+
+EXPORT_C void CAlfLineVisual::SetShadowThickness( const TAlfTimedValue& aShadowThickness )
+    {
+    TPckgC<TAlfTimedValue> buf(aShadowThickness);
+    
+    TInt err = Comms()->DoCmdNoReply( EAlfLineVisualSetShadowThickness, buf );
+
+    if ( err == KErrNone )
+        {
+        iLineVisualData->iShadowThickness = aShadowThickness;
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfLineVisual::SetShadowThickness panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+EXPORT_C const TAlfTimedValue& CAlfLineVisual::StartPos() const
+    {
+    TPckg<TAlfTimedValue> buf(iLineVisualData->iStartPos);
+    TInt err = Comms()->DoSynchronousCmd( EAlfLineVisualGetStartPos, buf, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfLineVisual::StartPos panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return iLineVisualData->iStartPos;
+    }
+
+EXPORT_C void CAlfLineVisual::SetStartPos( const TAlfTimedValue& aStartPos )
+    {
+    TPckgC<TAlfTimedValue> buf(aStartPos);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfLineVisualSetStartPos, buf );
+
+    if ( err == KErrNone )
+        {
+        iLineVisualData->iStartPos = aStartPos;
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfLineVisual::SetStartPos panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+EXPORT_C const TAlfTimedValue& CAlfLineVisual::EndPos() const
+    {
+    TPckg<TAlfTimedValue> buf(iLineVisualData->iEndPos);
+    TInt err = Comms()->DoSynchronousCmd( EAlfLineVisualGetEndPos, buf, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfLineVisual::EndPos panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return iLineVisualData->iEndPos;
+    }
+
+EXPORT_C void CAlfLineVisual::SetEndPos( const TAlfTimedValue& aEndPos )
+    {
+    TPckgC<TAlfTimedValue> buf(aEndPos);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfLineVisualSetEndPos, buf );
+
+    if ( err == KErrNone )
+        {
+        iLineVisualData->iEndPos = aEndPos;
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfLineVisual::SetEndPos panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+EXPORT_C void CAlfLineVisual::SetColor(const TRgb& aColor)
+    {
+    TPckgC<TRgb> buf(aColor);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfLineVisualSetColor, buf );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLineVisual::SetColor ignore error %d", err )
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfLineVisual::RemoveAndDestroyAllD()
+    {
+    CAlfVisual::RemoveAndDestroyAllD();
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfLineVisual::UpdateChildrenLayout(TInt aTransitionTime )
+    {
+    CAlfVisual::UpdateChildrenLayout( aTransitionTime );
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfVisual* CAlfLineVisual::FindTag(const TDesC8& aTag)
+    {
+    return CAlfVisual::FindTag( aTag );
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfLineVisual::DoRemoveAndDestroyAllD()
+    {
+    CAlfVisual::DoRemoveAndDestroyAllD();
+    }
+    
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfLineVisual::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfVisual::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
+    }
+    
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfm3gmesh.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   M3G 3D Mesh
+*
+*/
+
+
+
+#include "alf/alfm3gmesh.h"
+#include "alf/alfenv.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfconstants.h"
+#include "alflogger.h"
+
+struct CAlfM3GMesh::TM3GMeshPrivateData
+    {
+    CAlfEnv* iEnv; // Not owned
+    CAlfGenComponent* iComms; // Not owned
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Exposed constructor
+// ---------------------------------------------------------------------------
+//
+CAlfM3GMesh* CAlfM3GMesh::NewL( CAlfGenComponent& aComms, CAlfEnv& aEnv )
+    {
+    CAlfM3GMesh* self = new( ELeave ) CAlfM3GMesh;
+    CleanupStack::PushL( self );
+    self->ConstructL( aComms, aEnv );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// First phase constructor
+// ---------------------------------------------------------------------------
+//
+CAlfM3GMesh::CAlfM3GMesh()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CAlfM3GMesh::ConstructL( CAlfGenComponent& aComms, CAlfEnv& aEnv )
+    {
+    // Construct the base class
+    CAlfMesh::ConstructL(aComms, EAlfMeshTypeM3G);
+    
+    // Create object data.
+    iData = new (ELeave) TM3GMeshPrivateData;
+    
+    // Zero all object data
+    iData->iEnv = NULL;
+    iData->iComms = NULL;
+    
+    // Fill data
+    iData->iEnv = &aEnv;
+    iData->iComms = &aComms;
+    
+    // Create input and output buffers for inter-process communication
+    TBuf8<1> outDummy;
+    TInt param = EAlfMeshTypeM3G;
+    TPckgC<TInt> buf(param);
+        
+    // Call a synchronous command to create an associated server-side M3G mesh.
+    TInt err = iData->iComms->DoSynchronousCmd(EAlfMeshVisualCreateMesh, buf, outDummy);
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfM3GMesh::ConstructL leave error %d", err )
+        User::Leave( err );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfM3GMesh::~CAlfM3GMesh()
+    {
+    delete iData;
+    iData = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Loads a new M3G Mesh scene into this M3G mesh
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfM3GMesh::LoadSceneL(const TDesC& aFileName)
+    {
+    ASSERT(iData != NULL);
+    
+    TFileName filename = aFileName;
+    
+    // Prepend the image file path to the filename.
+    iData->iEnv->TextureManager().PrependImagePath(filename);
+    
+    // Create input and output buffers for inter-process communication
+    TBuf8<1> outDummy;
+    TAlfMeshLoadM3GSceneParams params;
+    params.iFilename = filename;
+    
+    TPckg<TAlfMeshLoadM3GSceneParams> paramsPckg(params);
+    
+    // Call a synchronous command to load the M3G scene graph
+    TInt err = iData->iComms->DoSynchronousCmd(EAlfMeshLoadM3GScene, paramsPckg, outDummy);
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfM3GMesh::LoadSceneL leave error %d", err )
+        User::Leave( err );
+        }    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfmappingfunctions.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,733 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Alf mapping functions
+*
+*/
+
+
+
+
+#include "alf/alfmappingfunctions.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfconstants.h"
+#include "alflogger.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+#include <e32math.h>
+#include <e32std.h>
+
+
+// CONSTANT MAPPING FUNCTION
+
+struct CAlfConstantMappingFunction::TPrivateData
+    {
+    CAlfGenComponent* iComms;
+    TReal32 iValue;
+    };
+
+EXPORT_C CAlfConstantMappingFunction* CAlfConstantMappingFunction::NewL( 
+        CAlfEnv& aEnv, 
+        TReal32 aValue  ) __SOFTFP
+    {
+    CAlfConstantMappingFunction* self = new (ELeave) CAlfConstantMappingFunction;
+    CleanupStack::PushL( self );
+    self->ConstructL( aEnv, aValue );
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+CAlfConstantMappingFunction::CAlfConstantMappingFunction()
+    {
+    }
+    
+void CAlfConstantMappingFunction::ConstructL( CAlfEnv& aEnv, TReal32 aValue )
+    {
+    iData = new (ELeave) TPrivateData;
+    
+    iData->iComms = NULL;
+    
+    TPckgC<TReal32> paramsPckg( aValue );    
+    
+    iData->iComms = CAlfGenComponent::NewL(aEnv,
+            EAlfMappingFunctionConstantCreate, 
+            0, 
+            paramsPckg);
+            
+    iData->iValue = aValue;
+    }
+    
+    
+EXPORT_C CAlfConstantMappingFunction::~CAlfConstantMappingFunction()
+    {
+    if ( iData )
+        {
+        delete iData->iComms;
+        iData->iComms = NULL;
+        }
+    delete iData;
+    iData = NULL;
+    }
+    
+TReal32 CAlfConstantMappingFunction::MapValue(TReal32 /*aValue*/, TInt /*aComponent*/) const __SOFTFP
+    {
+    return iData->iValue;
+    }
+    
+TInt CAlfConstantMappingFunction::MappingFunctionIdentifier() const
+    {
+    return iData->iComms->Identifier();
+    }
+    
+EXPORT_C void CAlfConstantMappingFunction::SetValue( TReal32 aValue ) __SOFTFP
+    {
+    TPckgC<TReal32> paramsPckg( aValue );
+    
+    TInt err = iData->iComms->DoCmdNoReply(
+        EAlfConstantMappingFunctionSetValue, 
+        paramsPckg );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfConstantMappingFunction::SetValue panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    iData->iValue = aValue;
+    }
+    
+EXPORT_C TReal32 CAlfConstantMappingFunction::Value() const __SOFTFP
+    {
+    return iData->iValue;
+    }
+    
+// LINEAR MAPPING FUNCTION
+
+struct CAlfLinearMappingFunction::TPrivateData
+    {
+    CAlfGenComponent* iComms;
+    TReal32 iFactor; 
+    TReal32 iOffset;
+    };
+
+EXPORT_C CAlfLinearMappingFunction* CAlfLinearMappingFunction::NewL( 
+        CAlfEnv& aEnv, 
+        TReal32 aFactor,
+        TReal32 aOffset) __SOFTFP
+    {
+    CAlfLinearMappingFunction* self = new (ELeave) CAlfLinearMappingFunction;
+    CleanupStack::PushL( self );
+    self->ConstructL( aEnv, aFactor, aOffset );
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+CAlfLinearMappingFunction::CAlfLinearMappingFunction()
+    {
+    }
+    
+void CAlfLinearMappingFunction::ConstructL( CAlfEnv& aEnv, TReal32 aFactor, TReal32 aOffset )
+    {
+    iData = new (ELeave) TPrivateData;
+    
+    iData->iComms = NULL;
+    
+    TReal2 params( aFactor, aOffset );
+    TPckgC<TReal2> paramsPckg( params );    
+    
+    iData->iComms = CAlfGenComponent::NewL(aEnv,
+            EAlfMappingFunctionLinearCreate, 
+            0, 
+            paramsPckg);
+            
+    iData->iFactor = aFactor;
+    iData->iOffset = aOffset;
+    }
+    
+EXPORT_C CAlfLinearMappingFunction::~CAlfLinearMappingFunction()
+    {
+    if ( iData )
+        {
+        delete iData->iComms;
+        iData->iComms = NULL;
+        }
+    delete iData;
+    iData = NULL;
+    }
+    
+TReal32 CAlfLinearMappingFunction::MapValue(TReal32 aValue, TInt /*aComponent*/) const __SOFTFP
+    {
+    return aValue * iData->iFactor + iData->iOffset;
+    }
+    
+TInt CAlfLinearMappingFunction::MappingFunctionIdentifier() const
+    {
+    return iData->iComms->Identifier();
+    }
+    
+EXPORT_C void CAlfLinearMappingFunction::SetFactor( TReal32 aFactor ) __SOFTFP
+    {
+    TPckgC<TReal32> paramsPckg( aFactor );
+
+    TInt err = iData->iComms->DoCmdNoReply(
+        EAlfLinearMappingFunctionSetFactor, 
+        paramsPckg );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLinearMappingFunction::SetFactor panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    iData->iFactor = aFactor;
+    }
+    
+EXPORT_C TReal32 CAlfLinearMappingFunction::Factor() const __SOFTFP
+    {
+    return iData->iFactor;
+    }
+    
+EXPORT_C void CAlfLinearMappingFunction::SetOffset( TReal32 aOffset ) __SOFTFP
+    {
+    TPckgC<TReal32> paramsPckg( aOffset );
+    
+    TInt err = iData->iComms->DoCmdNoReply(
+        EAlfLinearMappingFunctionSetOffset, 
+        paramsPckg );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfLinearMappingFunction::SetOffset panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    iData->iOffset = aOffset;
+    }
+    
+EXPORT_C TReal32 CAlfLinearMappingFunction::Offset() const __SOFTFP
+    {
+    return iData->iOffset;
+    }
+    
+// SINE MAPPING FUNCTION
+
+struct CAlfSineMappingFunction::TPrivateData
+    {
+    CAlfGenComponent* iComms;
+    TReal32 iFactor; 
+    TReal32 iOffset;
+    };
+
+EXPORT_C CAlfSineMappingFunction* CAlfSineMappingFunction::NewL( 
+        CAlfEnv& aEnv, 
+        TReal32 aFactor,
+        TReal32 aOffset) __SOFTFP
+    {
+    CAlfSineMappingFunction* self = new (ELeave) CAlfSineMappingFunction;
+    CleanupStack::PushL( self );
+    self->ConstructL( aEnv, aFactor,aOffset );
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+CAlfSineMappingFunction::CAlfSineMappingFunction()
+    {
+    }
+    
+void CAlfSineMappingFunction::ConstructL( CAlfEnv& aEnv, TReal32 aFactor, TReal32 aOffset )
+    {
+    iData = new (ELeave) TPrivateData;
+    
+    iData->iComms = NULL;
+    
+    TReal2 params( aFactor, aOffset );
+    TPckgC<TReal2> paramsPckg( params );    
+    
+    iData->iComms = CAlfGenComponent::NewL(aEnv,
+            EAlfMappingFunctionSineCreate, 
+            0, 
+            paramsPckg);
+            
+    iData->iFactor = aFactor;
+    iData->iOffset = aOffset;
+    }
+    
+EXPORT_C CAlfSineMappingFunction::~CAlfSineMappingFunction()
+    {
+    if ( iData )
+        {
+        delete iData->iComms;
+        iData->iComms = NULL;
+        }
+    delete iData;
+    iData = NULL;
+    }
+    
+TReal32 CAlfSineMappingFunction::MapValue(TReal32 aValue, TInt /*aComponent*/) const __SOFTFP
+    {
+    TReal mapped = 0;
+    Math::Sin(mapped, aValue);
+    return mapped * iData->iFactor + iData->iOffset;
+    }
+    
+TInt CAlfSineMappingFunction::MappingFunctionIdentifier() const
+    {
+    return iData->iComms->Identifier();
+    }
+    
+EXPORT_C void CAlfSineMappingFunction::SetFactor( TReal32 aFactor ) __SOFTFP
+    {
+    TPckgC<TReal32> paramsPckg( aFactor );
+
+    TInt err = iData->iComms->DoCmdNoReply(
+        EAlfSineMappingFunctionSetFactor, 
+        paramsPckg );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfSineMappingFunction::SetFactor panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    iData->iFactor = aFactor;
+    }
+    
+EXPORT_C TReal32 CAlfSineMappingFunction::Factor() const __SOFTFP
+    {
+    return iData->iFactor;
+    }
+    
+EXPORT_C void CAlfSineMappingFunction::SetOffset( TReal32 aOffset ) __SOFTFP
+    {
+    TPckgC<TReal32> paramsPckg( aOffset );
+    
+    TInt err = iData->iComms->DoCmdNoReply(
+        EAlfSineMappingFunctionSetOffset, 
+        paramsPckg );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfSineMappingFunction::SetOffset panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    iData->iOffset = aOffset;
+    }
+    
+EXPORT_C TReal32 CAlfSineMappingFunction::Offset() const __SOFTFP
+    {
+    return iData->iOffset;
+    }
+    
+// COSINE MAPPING FUNCTION
+
+struct CAlfCosineMappingFunction::TPrivateData
+    {
+    CAlfGenComponent* iComms;
+    TReal32 iFactor; 
+    TReal32 iOffset;
+    };
+
+EXPORT_C CAlfCosineMappingFunction* CAlfCosineMappingFunction::NewL( 
+        CAlfEnv& aEnv, 
+        TReal32 aFactor,
+        TReal32 aOffset) __SOFTFP
+    {
+    CAlfCosineMappingFunction* self = new (ELeave) CAlfCosineMappingFunction;
+    CleanupStack::PushL( self );
+    self->ConstructL( aEnv, aFactor,aOffset );
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+CAlfCosineMappingFunction::CAlfCosineMappingFunction()
+    {
+    }
+    
+void CAlfCosineMappingFunction::ConstructL( CAlfEnv& aEnv, TReal32 aFactor, TReal32 aOffset )
+    {
+    iData = new (ELeave) TPrivateData;
+    
+    iData->iComms = NULL;
+    
+    TReal2 params( aFactor, aOffset );
+    TPckgC<TReal2> paramsPckg( params );    
+    
+    iData->iComms = CAlfGenComponent::NewL(aEnv,
+            EAlfMappingFunctionCosineCreate, 
+            0, 
+            paramsPckg);
+            
+    iData->iFactor = aFactor;
+    iData->iOffset = aOffset;
+    }
+    
+EXPORT_C CAlfCosineMappingFunction::~CAlfCosineMappingFunction()
+    {
+    if ( iData )
+        {
+        delete iData->iComms;
+        iData->iComms = NULL;
+        }
+    delete iData;
+    iData = NULL;
+    }
+    
+TReal32 CAlfCosineMappingFunction::MapValue(TReal32 aValue, TInt /*aComponent*/) const __SOFTFP
+    {
+    TReal mapped = 0;
+    Math::Cos(mapped, aValue);
+    return mapped * iData->iFactor + iData->iOffset;
+    }
+    
+TInt CAlfCosineMappingFunction::MappingFunctionIdentifier() const
+    {
+    return iData->iComms->Identifier();
+    }
+    
+EXPORT_C void CAlfCosineMappingFunction::SetFactor( TReal32 aFactor ) __SOFTFP
+    {
+    TPckgC<TReal32> paramsPckg( aFactor );
+    
+    TInt err = iData->iComms->DoCmdNoReply(
+        EAlfCosineMappingFunctionSetFactor, 
+        paramsPckg );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfCosineMappingFunction::SetFactor panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    iData->iFactor = aFactor;
+    }
+    
+EXPORT_C TReal32 CAlfCosineMappingFunction::Factor() const __SOFTFP
+    {
+    return iData->iFactor;
+    }
+    
+EXPORT_C void CAlfCosineMappingFunction::SetOffset( TReal32 aOffset ) __SOFTFP
+    {
+    TPckgC<TReal32> paramsPckg( aOffset );
+
+    TInt err = iData->iComms->DoCmdNoReply(
+        EAlfCosineMappingFunctionSetOffset, 
+        paramsPckg );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfCosineMappingFunction::SetOffset panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    iData->iOffset = aOffset;
+    }
+    
+EXPORT_C TReal32 CAlfCosineMappingFunction::Offset() const __SOFTFP
+    {
+    return iData->iOffset;
+    }
+        
+// AVERAGE MAPPING FUNCTION
+
+struct CAlfAverageMappingFunction::TPrivateData
+    {
+    CAlfGenComponent* iComms;
+    };
+    
+
+EXPORT_C CAlfAverageMappingFunction* CAlfAverageMappingFunction::NewL( 
+        CAlfEnv& aEnv,
+        MAlfMappingFunction* aFunc1, 
+        MAlfMappingFunction* aFunc2 )
+    {
+    CAlfAverageMappingFunction* self = new (ELeave)CAlfAverageMappingFunction();
+    CleanupStack::PushL( self );
+    self->ConstructL( aEnv, aFunc1, aFunc2 );
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+CAlfAverageMappingFunction::CAlfAverageMappingFunction()
+    {
+    }
+    
+void CAlfAverageMappingFunction::ConstructL( 
+        CAlfEnv& aEnv,
+        MAlfMappingFunction* aFunc1, 
+        MAlfMappingFunction* aFunc2
+        )
+    {
+    iData = new (ELeave) TPrivateData;
+    
+    iData->iComms = NULL;
+    
+    TInt2 functions( 
+        aFunc1 ? aFunc1->MappingFunctionIdentifier() : 0,
+        aFunc2 ? aFunc2->MappingFunctionIdentifier() : 0 );
+    TPckgC<TInt2> functionsPckg( functions );    
+    
+    iData->iComms = CAlfGenComponent::NewL(aEnv,
+            EAlfMappingFunctionAverageCreate, 
+            0, 
+            functionsPckg);
+    }
+    
+EXPORT_C CAlfAverageMappingFunction::~CAlfAverageMappingFunction()
+    {
+    if ( iData )
+        {
+        delete iData->iComms;
+        iData->iComms = NULL;
+        }
+    delete iData;
+    iData = NULL;
+    }
+
+TReal32 CAlfAverageMappingFunction::MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP
+    {
+    TIntTReal mapValues( aComponent, aValue );
+    TPckgC<TIntTReal> mapValuesPckg( mapValues );
+    
+    TReal32 returnValue = aValue;
+    TPckg<TReal32> returnBuf(returnValue);
+    
+    TInt err = iData->iComms->DoSynchronousCmd(
+        EAlfMappingFunctionMapValue, 
+        mapValuesPckg, 
+        returnBuf );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfAverageMappingFunction::MapValue panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return returnValue;
+    }
+    
+TInt CAlfAverageMappingFunction::MappingFunctionIdentifier() const
+    {
+    return iData->iComms->Identifier();
+    }
+    
+EXPORT_C void CAlfAverageMappingFunction::SetMappingFunction1( MAlfMappingFunction* aFunction1 )
+    {
+    TInt function = aFunction1 ? aFunction1->MappingFunctionIdentifier() : 0;
+    TPckgC<TInt> functionPckg( function );
+
+    TInt err = iData->iComms->DoCmdNoReply(
+        EAlfAverageMappingFunctionSetFunction1, 
+        functionPckg );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfAverageMappingFunction::SetMappingFunction1 panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+    
+EXPORT_C void CAlfAverageMappingFunction::SetMappingFunction2( MAlfMappingFunction* aFunction2 )
+    {
+    TInt function = aFunction2 ? aFunction2->MappingFunctionIdentifier() : 0;
+    TPckgC<TInt> functionPckg( function );
+    TBuf8<1> outDum;
+    
+    TInt err = iData->iComms->DoCmdNoReply(
+        EAlfAverageMappingFunctionSetFunction2, 
+        functionPckg );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfAverageMappingFunction::SetMappingFunction2 panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+    
+EXPORT_C void CAlfAverageMappingFunction::SetMappingFunctions( 
+        MAlfMappingFunction* aFunction1,
+        MAlfMappingFunction* aFunction2 )
+    {
+    TInt2 functions( 
+        aFunction1 ? aFunction1->MappingFunctionIdentifier() : 0,
+        aFunction2 ? aFunction2->MappingFunctionIdentifier() : 0 );
+    TPckgC<TInt2> functionsPckg( functions ); 
+    TBuf8<1> outDum;
+    
+    TInt err = iData->iComms->DoCmdNoReply(
+        EAlfAverageMappingFunctionSetFunctions, 
+        functionsPckg );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfAverageMappingFunction::SetMappingFunctions panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+EXPORT_C void CAlfAverageMappingFunction::SetWeight( 
+    const TAlfTimedValue& aWeight )
+    {
+    TPckgC<TAlfTimedValue> buf(aWeight);
+
+    TInt err = iData->iComms->DoCmdNoReply( 
+        EAlfAverageMappingFunctionSetWeight, 
+        buf);
+
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfAverageMappingFunction::SetWeight panic error %d", err )
+        USER_INVARIANT();
+        }
+    }    
+struct CAlfTableMappingFunction::TPrivateData
+    {
+    CAlfGenComponent* iComms;
+    TAlfTableMappingFunctionParams iParams;
+    MAlfTableMappingFunctionDataProvider* iLastFunction;
+    TReal32 iLastStart;
+    TReal32 iLastEnd;
+    };
+
+    
+
+EXPORT_C CAlfTableMappingFunction* CAlfTableMappingFunction::NewL( 
+        CAlfEnv& aEnv)
+    {
+    CAlfTableMappingFunction* self = new (ELeave)CAlfTableMappingFunction();
+    CleanupStack::PushL( self );
+    self->ConstructL( aEnv );
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+CAlfTableMappingFunction::CAlfTableMappingFunction()
+    {
+    }
+    
+void CAlfTableMappingFunction::ConstructL(CAlfEnv& aEnv)
+    {
+    iData = new (ELeave) TPrivateData;
+    
+    iData->iComms = NULL;
+    Mem::FillZ(&iData->iParams, sizeof(iData->iParams));
+    iData->iLastStart = 0;
+    iData->iLastEnd = 0;
+    iData->iLastFunction = NULL;
+    
+    TReal2 param(0.f, 0.f);    
+    TPckgC<TReal2> paramPckg( param );    
+    iData->iComms = CAlfGenComponent::NewL(aEnv,
+            EAlfMappingFunctionTableCreate, 
+            0, 
+            paramPckg);
+    }
+    
+EXPORT_C CAlfTableMappingFunction::~CAlfTableMappingFunction()
+    {
+    if ( iData )
+        {
+        delete iData->iComms;
+        iData->iComms = NULL;
+        }
+    delete iData;
+    iData = NULL;
+    }
+
+TReal32 CAlfTableMappingFunction::MapValue(TReal32 aValue, TInt /*aComponent*/) const __SOFTFP
+    {
+    // For performance resons, this same function exist both client and serverside
+    TReal32 retVal = aValue;
+    
+    TBool inverted = EFalse;
+    
+    if (iData->iParams.iValues[KAlfTableMappingNumberOfMappedValues - 1] < iData->iParams.iValues[0])
+        {
+        inverted = ETrue;    
+        }
+    
+    TInt i = 0;
+    
+    if (!inverted)
+        {
+        // Find closest pre-calculated value...
+        for (i=0; i<KAlfTableMappingNumberOfMappedValues;i++)
+            {
+            if ((!inverted && aValue < iData->iParams.iValues[i]) ||
+                inverted && (aValue > iData->iParams.iValues[i]))
+                {
+                retVal = iData->iParams.iMappedValues[i];
+                break;                    
+                }
+            retVal = iData->iParams.iMappedValues[i];                   
+            }
+
+        // ...do approximation, real value is between pre-calculated values
+        if (i != 0) 
+            {
+            TReal32 valueDelta = iData->iParams.iValues[i] - aValue;
+            if (inverted)
+                {
+                valueDelta = -valueDelta;    
+                }
+            
+            TReal32 valueStep = iData->iParams.iValues[i] - iData->iParams.iValues[i-1];
+            TReal32 mappedValueStep = iData->iParams.iMappedValues[i] - iData->iParams.iMappedValues[i-1];
+            TReal32 fix = (valueDelta/valueStep) * mappedValueStep;
+            retVal -= fix;                               
+            }     
+        }
+
+    return retVal;   
+    }
+    
+TInt CAlfTableMappingFunction::MappingFunctionIdentifier() const
+    {
+    return iData->iComms->Identifier();
+    }
+    
+EXPORT_C void CAlfTableMappingFunction::SetMappingTableValues(TReal32 aStart, TReal32 aEnd, MAlfTableMappingFunctionDataProvider* aFunction) __SOFTFP
+    {        
+    TBool valuesChanged = (iData->iLastStart != aStart || iData->iLastEnd != aEnd);
+    TBool functionChanged = (aFunction != iData->iLastFunction);
+                    
+    if (aFunction && (valuesChanged || functionChanged))
+        {                           
+        TReal32 step = (aEnd - aStart)/(KAlfTableMappingNumberOfMappedValues - 1);
+        TReal32 value = aStart;
+        for (TInt i=0; i<KAlfTableMappingNumberOfMappedValues;i++)
+            {
+            iData->iParams.iValues[i] = value;
+            iData->iParams.iMappedValues[i] = aFunction->MapValue(value, 0);                
+            value += step;                        
+            }
+        
+        iData->iParams.iValues[KAlfTableMappingNumberOfMappedValues -1] = aEnd;
+        iData->iParams.iMappedValues[KAlfTableMappingNumberOfMappedValues -1] = 
+            aFunction->MapValue(aEnd, 0);                
+
+        TPckgC<TAlfTableMappingFunctionParams> mapValuesPckg( iData->iParams );
+
+        TInt err = iData->iComms->DoCmdNoReply(
+            EAlfMappingFunctionTableSetValues, 
+            mapValuesPckg );
+        __ASSERT_ALWAYS( err == KErrNone, USER_INVARIANT() );
+
+        iData->iLastStart = aStart;
+        iData->iLastEnd = aEnd;
+        iData->iLastFunction = aFunction;
+        }        
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfmesh.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,273 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Mesh base class
+*
+*/
+
+
+
+#include "alf/alfmesh.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfconstants.h"
+#include "alflogger.h"
+#include "alf/alftexture.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+struct CAlfMesh::TMeshPrivateData
+    {
+    CAlfGenComponent* iComms; // not own
+    TInt iMeshType;
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CAlfMesh::CAlfMesh()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+void CAlfMesh::ConstructL( CAlfGenComponent& aComms, TInt aMeshType )
+    {
+    iData = new (ELeave) TMeshPrivateData;
+    iData->iComms = &aComms;
+    
+    iData->iMeshType = aMeshType;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CAlfMesh* CAlfMesh::NewL( CAlfGenComponent& aComms )
+    {
+    CAlfMesh* self = new( ELeave ) CAlfMesh;
+    CleanupStack::PushL( self );
+    self->ConstructL( aComms );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CAlfMesh::~CAlfMesh()
+    {
+    delete iData;
+    iData = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the mesh type definition of this mesh.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfMesh::MeshType() const
+    {
+    return iData->iMeshType;
+    }
+
+// ---------------------------------------------------------------------------
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfMesh::Reset()
+    {
+    TBuf8<1> outDummy;
+    TInt err = iData->iComms->DoSynchronousCmd( EAlfMeshReset, KNullDesC8(), outDummy);
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfMesh::Reset panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+   
+EXPORT_C void CAlfMesh::StretchUniformly(
+        TReal32 aXLimit, 
+        TReal32 aXOffset, 
+        TReal32 aYLimit, 
+        TReal32 aYOffset,
+        TReal32 aZLimit, 
+        TReal32 aZOffset) __SOFTFP
+    {
+    TRAP_IGNORE(StretchUniformlyL(aXLimit, aXOffset,aYLimit, aYOffset, aZLimit, aZOffset))
+    }
+
+void CAlfMesh::StretchUniformlyL(
+        TReal32 aXLimit, 
+        TReal32 aXOffset, 
+        TReal32 aYLimit, 
+        TReal32 aYOffset,
+        TReal32 aZLimit, 
+        TReal32 aZOffset)
+    {
+    RArray<TReal32> array;
+    CleanupClosePushL( array );
+    
+    array.AppendL( aXLimit );
+    array.AppendL( aXOffset );
+    array.AppendL( aYLimit );
+    array.AppendL( aYOffset );
+    array.AppendL( aZLimit );
+    array.AppendL( aZOffset );
+    
+    HBufC8* buffer = ExternalizeLC(array);
+    TBuf8<1> outDummy;
+    
+    TInt err = iData->iComms->DoSynchronousCmd( EAlfMeshStretchUniformly, *buffer, outDummy);
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfMesh::StretchUniformly panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    CleanupStack::PopAndDestroy( buffer );
+    CleanupStack::PopAndDestroy( &array );
+    }
+                                
+EXPORT_C void CAlfMesh::ScaleUniformly(TReal32 aX, TReal32 aY, TReal32 aZ) __SOFTFP
+    {
+    TRAP_IGNORE(ScaleUniformlyL(aX, aY, aZ))
+    }
+
+void CAlfMesh::ScaleUniformlyL(TReal32 aX, TReal32 aY, TReal32 aZ)
+    {
+    RArray<TReal32> array;
+    CleanupClosePushL( array );
+    
+    array.AppendL( aX );
+    array.AppendL( aY );
+    array.AppendL( aZ );
+    
+    HBufC8* buffer = ExternalizeLC(array);
+    TBuf8<1> outDummy;
+    
+    TInt err = iData->iComms->DoSynchronousCmd( EAlfMeshScaleUniformly, *buffer, outDummy);
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfMesh::ScaleUniformly panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    CleanupStack::PopAndDestroy( buffer );
+    CleanupStack::PopAndDestroy( &array );
+    }
+
+
+EXPORT_C TInt CAlfMesh::AnimationControllerCount() const
+    {
+    return DoAnimationControllerCount();
+    }
+
+TInt CAlfMesh::DoAnimationControllerCount() const
+    {
+    TInt result = 0;
+    TPckg<TBool> outBuf( result );
+    
+    TInt err = iData->iComms->DoSynchronousCmd(
+        EAlfMeshAnimationControllerCount, 
+        KNullDesC8(), 
+        outBuf );
+        
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfMesh::AnimationControllerCount panic error %d", err )
+        USER_INVARIANT();
+        }
+        
+    return result;
+    }
+
+EXPORT_C void CAlfMesh::SetAnimationPosition(TInt aControllerId, TReal32 aTarget, TInt aTime) __SOFTFP
+    {
+    TRAP_IGNORE(SetAnimationPositionL(aControllerId, aTarget, aTime))
+    }
+
+void CAlfMesh::SetAnimationPositionL(TInt aControllerId, TReal32 aTarget, TInt aTime)
+    {
+    ASSERT(iData != NULL);
+    
+    // Create input and output buffers for inter-process communication
+    TAlfMeshAnimationPositionParams params;
+    params.iControllerId = aControllerId;    
+	params.iTarget = aTarget;
+	params.iTime = aTime;
+    
+    TPckg<TAlfMeshAnimationPositionParams > paramsPckg(params);
+    
+    // Call a synchronous command
+    TInt err = iData->iComms->DoCmdNoReply(EAlfMeshSetAnimationPosition, paramsPckg );
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfM3GMesh::SetAnimationPosition leave error %d", err )
+        User::Leave( err );
+        }    
+    }
+    
+EXPORT_C void CAlfMesh::StartAnimationController(TInt aControllerId)
+    {
+    TRAP_IGNORE(StartAnimationControllerL(aControllerId))
+    }
+
+void CAlfMesh::StartAnimationControllerL(TInt aControllerId)
+    {
+    ASSERT(iData != NULL);
+        
+    TBuf8<1> outDummy;
+    TInt params = aControllerId;
+    
+    TPckg<TInt> paramsPckg(params);
+    
+    // Call a synchronous command
+    TInt err = iData->iComms->DoSynchronousCmd(EAlfMeshStartAnimationController, paramsPckg, outDummy);
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfM3GMesh::StartAnimationController leave error %d", err )
+        User::Leave( err );
+        }    
+    }    
+    
+EXPORT_C void CAlfMesh::StopAnimationController(TInt aControllerId)
+    {
+    TRAP_IGNORE(StopAnimationControllerL(aControllerId))
+    }
+
+void CAlfMesh::StopAnimationControllerL(TInt aControllerId)
+    {
+    ASSERT(iData != NULL);
+        
+    TBuf8<1> outDummy;
+    TInt params = aControllerId;
+    
+    TPckg<TInt> paramsPckg(params);
+    
+    // Call a synchronous command
+    TInt err = iData->iComms->DoSynchronousCmd(EAlfMeshStopAnimationController, paramsPckg, outDummy);
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfM3GMesh::StopAnimationController leave error %d", err )
+        User::Leave( err );
+        }    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfmeshvisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,375 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Mesh visual
+*
+*/
+
+
+
+#include "alf/alfmeshvisual.h"
+#include "alf/alfproceduralmesh.h"
+#include "alf/alfm3gmesh.h"
+#include "alf/alfcontrol.h"
+#include "alflogger.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfconstants.h"
+#include "alf/alfimage.h"
+#include "alf/alftexture.h"
+#include "alfskinnableimage.h"
+#include "alf/alfenv.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+struct CAlfMeshVisual::TMeshVisualPrivateData
+    {
+    CAlfMesh* iMesh; // own
+    CAlfSkinnableImage* iImage;
+    CAlfSkinnableImage* iSecondaryImage;    
+    CAlfSkinnableImage* iSpecularImage;
+    };
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+
+EXPORT_C CAlfMeshVisual* CAlfMeshVisual::AddNewL(
+    CAlfControl& aOwnerControl,
+    CAlfLayout* aParentLayout )
+    {
+    CAlfMeshVisual* text = STATIC_CAST(CAlfMeshVisual*,
+        aOwnerControl.AppendVisualL(EAlfVisualTypeMesh, aParentLayout));
+    return text;
+    }
+
+EXPORT_C CAlfMeshVisual::CAlfMeshVisual()
+    {
+    }
+
+EXPORT_C void CAlfMeshVisual::ConstructL(CAlfControl& aOwner)
+    {
+    CAlfVisual::ConstructL(aOwner);
+    
+    iMeshVisualData = new (ELeave) TMeshVisualPrivateData;
+    iMeshVisualData->iMesh = NULL;
+    iMeshVisualData->iImage = NULL;
+    iMeshVisualData->iSecondaryImage = NULL;
+    iMeshVisualData->iSpecularImage = NULL;
+    
+    iMeshVisualData->iImage = new (ELeave) CAlfSkinnableImage(&aOwner.Env());
+    iMeshVisualData->iSecondaryImage = new (ELeave) CAlfSkinnableImage(&aOwner.Env());
+    iMeshVisualData->iSpecularImage = new (ELeave) CAlfSkinnableImage(&aOwner.Env());
+    }
+
+EXPORT_C CAlfMeshVisual::~CAlfMeshVisual()
+    {
+    if ( iMeshVisualData )
+        {
+        delete iMeshVisualData->iMesh;
+        iMeshVisualData->iMesh = NULL;
+        
+        delete iMeshVisualData->iImage;
+        iMeshVisualData->iImage = NULL;
+
+        delete iMeshVisualData->iSecondaryImage;
+        iMeshVisualData->iSecondaryImage = NULL;
+
+        delete iMeshVisualData->iSpecularImage;
+        iMeshVisualData->iSpecularImage = NULL;
+        }
+        
+    delete iMeshVisualData;
+    iMeshVisualData = NULL;
+    }
+    
+EXPORT_C void CAlfMeshVisual::CreateMeshL(TInt aMeshType)
+    {
+    // Destroy the old mesh object.
+    if( iMeshVisualData->iMesh )
+        {
+        delete iMeshVisualData->iMesh;
+        iMeshVisualData->iMesh = NULL;
+        }
+    
+    // Create a new mesh object.
+    if ( aMeshType == EAlfMeshTypeProcedural )
+        {
+        iMeshVisualData->iMesh = CAlfProceduralMesh::NewL( *Comms() );
+        }
+    if ( aMeshType == EAlfMeshTypeM3G )
+        {
+        iMeshVisualData->iMesh = CAlfM3GMesh::NewL( *Comms(), Env() );
+        }        
+    }
+    
+EXPORT_C void CAlfMeshVisual::SetImage(const TAlfImage& aImage)
+    {    
+    iMeshVisualData->iImage->SetImage(aImage);// This texturizes skin graphics if needed
+    
+    TAlfImageParams params(iMeshVisualData->iImage->Image());
+
+    TPckgC<TAlfImageParams> buf(params);
+    TInt err = Comms()->DoCmdNoReply(EAlfMeshVisualSetImage, buf );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfMeshVisual::SetImage ignore error %d", err )
+        }
+    }
+    
+EXPORT_C const TAlfImage& CAlfMeshVisual::Image() const
+    {
+    return iMeshVisualData->iImage->Image();
+    }
+
+EXPORT_C void CAlfMeshVisual::SetSecondaryImage(const TAlfImage& aImage)
+    {
+    iMeshVisualData->iSecondaryImage->SetImage(aImage);// This texturizes skin graphics if needed
+    
+    TAlfImageParams params(iMeshVisualData->iSecondaryImage->Image());
+
+    TPckgC<TAlfImageParams> buf(params);
+    TInt err = Comms()->DoCmdNoReply(EAlfMeshVisualSetSecondaryImage, buf );
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfMeshVisual::SetSecondaryImage ignore error %d", err )
+        }
+    }
+    
+EXPORT_C const TAlfImage& CAlfMeshVisual::SecondaryImage() const
+    {
+    return iMeshVisualData->iSecondaryImage->Image();
+    }
+
+EXPORT_C void CAlfMeshVisual::SetSpecularImage(const TAlfImage& aImage)
+    {
+    // This functionality applies to procedural mesh only.
+    if(Mesh().MeshType() == EAlfMeshTypeProcedural)
+        {    
+        CAlfProceduralMesh& mesh = static_cast<CAlfProceduralMesh&>(Mesh());
+        iMeshVisualData->iSpecularImage->SetImage(aImage);// This texturizes skin graphics if needed
+        
+        TAlfImageParams params(iMeshVisualData->iSpecularImage->Image());
+
+        TPckgC<TAlfImageParams> buf(params);
+        TInt err = Comms()->DoCmdNoReply(EAlfMeshVisualSetSpecularImage, buf );
+        
+        if ( err )
+            {
+            __ALFLOGSTRING1( "CAlfMeshVisual::SetSpecularImage ignore error %d", err )
+            }
+            
+        mesh.SetSpecularImage( iMeshVisualData->iSpecularImage->Image() );        
+        }
+    }
+    
+EXPORT_C const TAlfImage& CAlfMeshVisual::SpecularImage() const
+    {
+    return iMeshVisualData->iSpecularImage->Image();
+    }
+
+EXPORT_C CAlfMesh& CAlfMeshVisual::Mesh()
+    {
+    // Create a default mesh
+    if ( !iMeshVisualData->iMesh )
+        {
+        TRAPD( err, CreateMeshL(EAlfMeshTypeProcedural) );
+        if ( err )
+            {
+            __ALFLOGSTRING1( "CAlfMeshVisual::Mesh panic error %d", err )
+            USER_INVARIANT();
+            }
+        }
+    return *iMeshVisualData->iMesh;
+    }
+    
+EXPORT_C CAlfProceduralMesh* CAlfMeshVisual::ProceduralMesh() const
+    {
+    if(iMeshVisualData->iMesh && (iMeshVisualData->iMesh->MeshType() == EAlfMeshTypeProcedural))
+        {
+        return static_cast<CAlfProceduralMesh*>(iMeshVisualData->iMesh);
+        }    
+    return NULL;
+    }
+
+EXPORT_C CAlfM3GMesh* CAlfMeshVisual::M3GMesh() const
+    {
+    if(iMeshVisualData->iMesh && (iMeshVisualData->iMesh->MeshType() == EAlfMeshTypeM3G))
+        {
+        return static_cast<CAlfM3GMesh*>(iMeshVisualData->iMesh);
+        }    
+    return NULL;    
+    }
+    
+EXPORT_C TAlfTimedValue CAlfMeshVisual::SecondaryAlpha() const
+    {
+    TAlfTimedValue result;
+    TPckg<TAlfTimedValue> buf(result);
+    TInt err = Comms()->DoSynchronousCmd( EAlfMeshVisualSecondaryAlpha, KNullDesC8, buf);
+    
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfMeshVisual::SecondaryAlpha panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return result;  
+    }
+    
+EXPORT_C void CAlfMeshVisual::SetSecondaryAlpha( const TAlfTimedValue& aSecondaryAlpha )
+    {
+    TPckgC<TAlfTimedValue> buf(aSecondaryAlpha);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfMeshVisualSetSecondaryAlpha, buf );
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfMeshVisual::SetSecondaryAlpha panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+    
+    
+EXPORT_C TAlfTimedValue CAlfMeshVisual::YawAngle() const
+    {
+    TAlfTimedValue result;
+    TPckg<TAlfTimedValue> buf(result);
+    TInt err = Comms()->DoSynchronousCmd( EAlfMeshVisualYawAngle, KNullDesC8, buf);
+    
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfMeshVisual::YawAngle panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return result;  
+    }
+    
+EXPORT_C void CAlfMeshVisual::SetYawAngle( const TAlfTimedValue& aYawAngle )
+    {
+    TPckgC<TAlfTimedValue> buf(aYawAngle);
+    
+    TInt err = Comms()->DoCmdNoReply( EAlfMeshVisualSetYawAngle, buf );
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfMeshVisual::SetYawAngle panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+    
+    
+EXPORT_C TAlfTimedValue CAlfMeshVisual::PitchAngle() const
+    {
+    TAlfTimedValue result;
+    TPckg<TAlfTimedValue> buf(result);
+    TInt err = Comms()->DoSynchronousCmd( EAlfMeshVisualPitchAngle, KNullDesC8, buf);
+    
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfMeshVisual::PitchAngle panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return result; 
+    }
+    
+EXPORT_C void CAlfMeshVisual::SetPitchAngle( const TAlfTimedValue& aPitchAngle )
+    {
+    TPckgC<TAlfTimedValue> buf(aPitchAngle);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfMeshVisualSetPitchAngle, buf );
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfMeshVisual::SetPitchAngle panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+    
+    
+EXPORT_C TAlfTimedValue CAlfMeshVisual::Scale() const
+    {
+    TAlfTimedValue result;
+    TPckg<TAlfTimedValue> buf(result);
+    TInt err = Comms()->DoSynchronousCmd( EAlfMeshVisualScale, KNullDesC8, buf);
+    
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfMeshVisual::Scale panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return result; 
+    }
+    
+EXPORT_C void CAlfMeshVisual::SetScale( const TAlfTimedValue& aScale )
+    {
+    TPckgC<TAlfTimedValue> buf(aScale);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfMeshVisualSetScale, buf );
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfMeshVisual::SetScale panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfMeshVisual::RemoveAndDestroyAllD()
+    {
+    CAlfVisual::RemoveAndDestroyAllD();
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfMeshVisual::UpdateChildrenLayout(TInt aTransitionTime )
+    {
+    CAlfVisual::UpdateChildrenLayout( aTransitionTime );
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfVisual* CAlfMeshVisual::FindTag(const TDesC8& aTag)
+    {
+    return CAlfVisual::FindTag( aTag );
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfMeshVisual::DoRemoveAndDestroyAllD()
+    {
+    CAlfVisual::DoRemoveAndDestroyAllD();
+    }
+    
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfMeshVisual::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfVisual::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
+    }
+    
+
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfmetric.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "alf/alfmetric.h"  // Class definition
+
+EXPORT_C TAlfMetric::TAlfMetric(TReal32 aMagnitude, TInt aUnit, TInt aReferenceTextStyleId) __SOFTFP
+    :
+    iMagnitude(aMagnitude),
+    iUnit(aUnit),
+    iReferenceTextStyleId(aReferenceTextStyleId)
+    {
+    }
+
+EXPORT_C TAlfMetric::TAlfMetric(TInt aPixels)
+    : 
+    iMagnitude(aPixels),
+    iUnit(EAlfUnitPixel),
+    iReferenceTextStyleId(EAlfTextStyleNormal)
+    {    
+    }
+
+EXPORT_C TAlfXYMetric::TAlfXYMetric()
+    {
+    }
+    
+EXPORT_C TAlfXYMetric::TAlfXYMetric(const TAlfMetric& aMetric)
+    : iX(aMetric),
+      iY(aMetric)
+    {
+    }
+        
+EXPORT_C TAlfXYMetric::TAlfXYMetric(const TAlfMetric& aX,  const TAlfMetric& aY)
+    :
+    iX(aX),
+    iY(aY)
+    {
+    
+    }
+
+EXPORT_C TAlfBoxMetric::TAlfBoxMetric()
+    {
+    }
+
+EXPORT_C TAlfBoxMetric::TAlfBoxMetric(const TAlfMetric& aMetric)
+        : iLeft(aMetric), 
+          iRight(aMetric),
+          iTop(aMetric),
+          iBottom(aMetric)
+    {
+    }
+
+EXPORT_C TAlfBoxMetric::TAlfBoxMetric(const TAlfXYMetric& aMetric)
+        : iLeft(aMetric.iX),
+          iRight(aMetric.iX),
+          iTop(aMetric.iY),
+          iBottom(aMetric.iY)
+    {
+    }
+
+EXPORT_C TAlfBoxMetric::TAlfBoxMetric(const TAlfXYMetric& aTopLeft, 
+        const TAlfXYMetric& aBottomRight)
+        : iLeft(aTopLeft.iX),
+          iRight(aBottomRight.iX),
+          iTop(aTopLeft.iY),
+          iBottom(aBottomRight.iY)
+    {        
+    }
+
+
+EXPORT_C TAlfBoxMetric::TAlfBoxMetric(
+    const TAlfMetric& aLeft, 
+    const TAlfMetric& aRight,
+    const TAlfMetric& aTop, 
+    const TAlfMetric& aBottom)
+    : 
+    iLeft(aLeft), 
+    iRight(aRight), 
+    iTop(aTop), 
+    iBottom(aBottom)
+    {
+    }
+        
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfpanic.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 the alf domain panic
+*
+*/
+
+
+#include <e32std.h>
+#include "alfpanic.h"
+
+GLDEF_C void Panic(TAlfPanic aPanic)
+    {
+     _LIT(KAlfDomainName, "Alf Toolkit" );
+    User::Panic(KAlfDomainName ,aPanic);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfproceduralmesh.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,287 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Procedural 3D Mesh
+*
+*/
+
+
+
+#include "alf/alfproceduralmesh.h"
+#include "alf/alfgencomponent.h"
+#include "alflogger.h"
+#include "alf/alfconstants.h"
+#include "alf/alfenv.h"
+#include "alfskinnableimage.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+struct CAlfProceduralMesh::TProceduralMeshPrivateData
+    {
+    CAlfGenComponent* iComms; // Not owned
+    TAlfMaterial iMaterial;      
+    CAlfSkinnableImage* iMaterialTextureImage;
+    CAlfSkinnableImage* iMaterialSpecularImage;
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfProceduralMesh::CAlfProceduralMesh()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CAlfProceduralMesh::ConstructL( CAlfGenComponent& aComms )
+    {
+    // Construct the base class
+    CAlfMesh::ConstructL(aComms, EAlfMeshTypeProcedural);
+    
+    // Create object data.
+    iData = new (ELeave) TProceduralMeshPrivateData;
+    
+    // Zero all object data
+    iData->iComms = NULL;
+    iData->iMaterialTextureImage = NULL;
+    iData->iMaterialSpecularImage = NULL;
+    
+    // Fill data
+    iData->iComms = &aComms;
+    iData->iMaterial.iPreset = EAlfMaterialChrome;  
+    
+    CAlfEnv* env = CAlfEnv::Static();
+    iData->iMaterialTextureImage = new (ELeave) CAlfSkinnableImage(env);
+    iData->iMaterialSpecularImage = new (ELeave) CAlfSkinnableImage(env);  
+    
+    // Create input and output buffers for inter-process communication
+    TBuf8<1> outDummy;
+    TInt param = EAlfMeshTypeProcedural;
+    TPckgC<TInt> buf(param);
+        
+    // Call a synchronous command to create an associated server-side procedural mesh.
+    TInt err = iData->iComms->DoSynchronousCmd(EAlfMeshVisualCreateMesh, buf, outDummy);
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfProceduralMesh::ConstructL leave error %d", err )
+        User::Leave( err );
+        }   
+    }
+
+
+// ---------------------------------------------------------------------------
+// Exposed constructor
+// ---------------------------------------------------------------------------
+//
+CAlfProceduralMesh* CAlfProceduralMesh::NewL( CAlfGenComponent& aComms )
+    {
+    CAlfProceduralMesh* self = new( ELeave ) CAlfProceduralMesh;
+    CleanupStack::PushL( self );
+    self->ConstructL( aComms );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfProceduralMesh::~CAlfProceduralMesh()
+    {
+    if ( iData )
+        {
+        delete iData->iMaterialTextureImage;
+        iData->iMaterialTextureImage = NULL;
+        
+        delete iData->iMaterialSpecularImage;
+        iData->iMaterialSpecularImage = NULL;
+        }
+    delete iData;
+    iData = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Forms a cube mesh to this procedural mesh.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfProceduralMesh::MakeCubeL(
+        TReal32 aSizeX, 
+        TReal32 aSizeY, 
+        TReal32 aSizeZ, 
+        TReal32 aEdgeRadius) __SOFTFP
+    {
+    RArray<TReal32> array;
+    CleanupClosePushL( array );
+    
+    array.AppendL( aSizeX );
+    array.AppendL( aSizeY );
+    array.AppendL( aSizeZ );
+    array.AppendL( aEdgeRadius );
+    
+    HBufC8* buffer = ExternalizeLC(array);
+    TBuf8<1> outDummy;
+    
+    TInt err = iData->iComms->DoSynchronousCmd( EAlfMeshMakeCube, *buffer, outDummy);
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfProceduralMesh::MakeCubeL leave error %d", err )
+        User::Leave( err );
+        }
+        
+    CleanupStack::PopAndDestroy( buffer );
+    CleanupStack::PopAndDestroy( &array );
+    }
+
+// ---------------------------------------------------------------------------
+// Forms a sphere mesh to this procedural mesh.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfProceduralMesh::MakeSphereL(
+        TReal32 aRadius, 
+        TInt aColumns, 
+        TInt aRows) __SOFTFP
+    {
+    RArray<TReal32> array;
+    CleanupClosePushL( array );
+    
+    array.AppendL( aRadius );
+    array.AppendL( (TReal32)aColumns );
+    array.AppendL( (TReal32)aRows );
+    
+    HBufC8* buffer = ExternalizeLC(array);
+    TBuf8<1> outDummy;
+    
+    TInt err = iData->iComms->DoSynchronousCmd( EAlfMeshMakeSphere, *buffer, outDummy);
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfProceduralMesh::MakeSphereL leave error %d", err )
+        User::Leave( err );
+        }
+        
+    CleanupStack::PopAndDestroy( buffer );
+    CleanupStack::PopAndDestroy( &array );
+    }
+
+// ---------------------------------------------------------------------------
+// Forms a torus mesh to this procedural mesh.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfProceduralMesh::MakeTorusL(
+        TReal32 aMainRadius, 
+        TReal32 aOuterRadius, 
+        TInt aMainSegments, 
+        TInt aOuterSegments,
+        TReal32 aSegmentAngleOffset ) __SOFTFP
+    {
+    RArray<TReal32> array;
+    CleanupClosePushL( array );
+    
+    array.AppendL( aMainRadius );
+    array.AppendL( aOuterRadius );
+    array.AppendL( (TReal32)aMainSegments );
+    array.AppendL( (TReal32)aOuterSegments );
+    array.AppendL( aSegmentAngleOffset );
+    
+    HBufC8* buffer = ExternalizeLC(array);
+    TBuf8<1> outDummy;
+    
+    TInt err = iData->iComms->DoSynchronousCmd( EAlfMeshMakeTorus, *buffer, outDummy);
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfProceduralMesh::MakeTorusL leave error %d", err )
+        User::Leave( err );
+        }
+    
+    CleanupStack::PopAndDestroy( buffer );
+    CleanupStack::PopAndDestroy( &array );
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns the material definition of this mesh.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TAlfMaterial& CAlfProceduralMesh::Material() const
+    {
+    TAlfMaterialParams params; 
+    TPckg<TAlfMaterialParams> buf(params);
+    TInt err = iData->iComms->DoSynchronousCmd( EAlfMeshMaterial, KNullDesC8, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfProceduralMesh::Material panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    iData->iMaterial.iSpecular = params.iSpecular;
+    iData->iMaterial.iTextureImage = iData->iMaterialTextureImage->Image();
+    iData->iMaterial.iSpecularImage = iData->iMaterialSpecularImage->Image();
+    
+    return iData->iMaterial;
+    }
+    
+// ---------------------------------------------------------------------------
+// Sets the material definition used with this mesh.
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfProceduralMesh::SetMaterial( const TAlfMaterial& aMaterial )
+    {
+    iData->iMaterialTextureImage->SetImage( aMaterial.iTextureImage );
+    iData->iMaterialSpecularImage->SetImage( aMaterial.iSpecularImage );
+
+    TAlfMaterialParams params;
+    TPckgC<TAlfMaterialParams> buf(params);
+    
+    params.iPreset = aMaterial.iPreset;
+    params.iColor = aMaterial.iColor;
+    params.iTextureImage.iTextureHandle = 
+        iData->iMaterialTextureImage->Image().HasTexture() ? 
+            iData->iMaterialTextureImage->Image().Texture().ServerHandle() 
+            : 0 ;
+    params.iTextureImage.iTl = iData->iMaterialTextureImage->Image().TimedTopLeft();
+    params.iTextureImage.iBr = iData->iMaterialTextureImage->Image().TimedBottomRight();
+    params.iSpecularImage.iTextureHandle = 
+        iData->iMaterialSpecularImage->Image().HasTexture() ? 
+            iData->iMaterialSpecularImage->Image().Texture().ServerHandle() 
+            : 0 ;
+    params.iSpecularImage.iTl = iData->iMaterialSpecularImage->Image().TimedTopLeft();
+    params.iSpecularImage.iBr = iData->iMaterialSpecularImage->Image().TimedBottomRight();
+    params.iSpecular = aMaterial.iSpecular;
+    
+    TInt err = iData->iComms->DoCmdNoReply( EAlfMeshSetMaterial, buf );
+
+    if ( err == KErrNone )
+        {
+        iData->iMaterial = aMaterial;
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfProceduralMesh::SetMaterial panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Sets specular image of the material.
+// ---------------------------------------------------------------------------
+//     
+void CAlfProceduralMesh::SetSpecularImage(const TAlfImage& aImage)
+    {
+    iData->iMaterial.iSpecularImage = aImage;
+    }    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfproperty.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Property value for Alfred
+*
+*/
+
+
+
+#include "alf/alfproperty.h"
+
+CAlfProperty::CAlfProperty()
+    {
+    
+    }
+
+TInt CAlfProperty::CompareByName(const CAlfProperty& aA, const CAlfProperty& aB)
+    {
+    return aA.Name().CompareC(aB.Name());
+    }
+
+TBool CAlfProperty::Matches(const CAlfProperty& aA, const CAlfProperty& aB)
+    {
+    if (CAlfProperty::CompareByName(aA, aB) == 0)
+        {
+        return ETrue;
+        }
+        
+    return EFalse;
+    }
+
+void CAlfProperty::ConstructL(const TDesC8& aName)
+    {
+    iName = aName.AllocL();        
+    }
+
+const TDesC8& CAlfProperty::Name() const
+    {
+    ASSERT(iName);
+    return *iName;
+    }
+
+TAlfPropertyType CAlfProperty::Type() const
+    {
+    return iType;    
+    }
+
+CAlfProperty::~CAlfProperty()
+    {
+    delete iName;        
+    }
+
+
+// Integer property class
+
+CAlfPropertyInteger::CAlfPropertyInteger()
+    {
+    iType = EAlfPropertyTypeInteger;
+    }
+
+CAlfPropertyInteger::~CAlfPropertyInteger()
+    {
+        
+    }
+
+TRangedValue CAlfPropertyInteger::Data() const
+    {
+    return iValue;    
+    };
+
+void CAlfPropertyInteger::Set(const TRangedValue& aValue)
+    {
+    iValue = aValue;
+    }
+
+
+// Timed value property class
+
+CAlfPropertyTimedValue::CAlfPropertyTimedValue()
+    {
+    iType = EAlfPropertyTypeTimedValue;
+    }
+
+CAlfPropertyTimedValue::~CAlfPropertyTimedValue()
+    {
+    }
+
+TAlfTimedValue& CAlfPropertyTimedValue::Data()
+    {
+    return iTimedValue;    
+    }
+
+void CAlfPropertyTimedValue::Set(TAlfTimedValue& aTimedValue)
+    {
+    iTimedValue = aTimedValue;
+    }
+    
+    
+// String property class
+
+CAlfPropertyString::CAlfPropertyString()
+    {
+    iType = EAlfPropertyTypeString;
+    iString = NULL;
+    }
+
+CAlfPropertyString::~CAlfPropertyString()
+    {
+    delete iString;
+    }
+
+TDesC* CAlfPropertyString::Data() const
+    {
+    ASSERT(iString);
+    
+    return iString;    
+    }
+
+void CAlfPropertyString::SetL(const TDesC& aString)
+    {
+    if (iString)
+        {
+        delete iString;
+        iString = NULL;
+        }
+    
+    iString = aString.AllocL();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfpropertyowner.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,348 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Property object for Alfred
+*
+*/
+
+
+
+#include "alf/alfpropertyowner.h"
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C CAlfPropertyOwner::CAlfPropertyOwner()
+    {
+        
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C CAlfPropertyOwner::~CAlfPropertyOwner()
+    {
+    PropertyClear();    
+    }
+
+// ---------------------------------------------------------------------------
+// Remove property
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C TBool CAlfPropertyOwner::PropertyRemove(const TDesC8& aName)
+    {
+    TInt index;
+    
+    if (!Find(aName, &index))
+        {
+        return EFalse;            
+        }
+    
+    delete iProperties[index];
+    iProperties.Remove(index);
+    iProperties.Compress();
+    
+    return ETrue;
+    }
+    
+// ---------------------------------------------------------------------------
+// Clear property
+// ---------------------------------------------------------------------------
+//         
+EXPORT_C void CAlfPropertyOwner::PropertyClear()
+    {
+    iProperties.ResetAndDestroy();   
+    }
+
+
+// We have a different registration method for each property type.
+
+// ---------------------------------------------------------------------------
+// Set integer property
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C TBool CAlfPropertyOwner::PropertySetIntegerL(const TDesC8& aName, TInt aVal, TInt aMin, TInt aMax)
+    {
+    CAlfPropertyInteger* property;
+    TAlfPropertyType type;
+    TInt index;
+    
+    if (aName.Length() == 0)
+        {
+        // Cannot have zero-length name as an argument.
+        return EFalse;
+        }    
+
+    if (Find(aName, &index, &type))
+        {
+        // Property exists already.
+        if (type != EAlfPropertyTypeInteger)
+            {
+            // Wrong type. We have to exit without doing anything.
+            return EFalse;
+            }
+        
+        // Modify existing property.
+        property = static_cast<CAlfPropertyInteger*>(iProperties[index]);                
+        property->Set(TRangedValue(aVal, aMin, aMax));        
+        }
+    else
+        {
+        // Not found, so add new item to the property list.
+        property = new (ELeave) CAlfPropertyInteger();
+        CleanupStack::PushL(property);
+        property->ConstructL(aName);         
+        CleanupStack::Pop(property);
+        
+        property->Set(TRangedValue(aVal, aMin, aMax));        
+        
+        User::LeaveIfError(iProperties.Append(property));        
+        }
+    
+    return ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// Find integer property
+// ---------------------------------------------------------------------------
+//         
+EXPORT_C TBool CAlfPropertyOwner::PropertyFindInteger(const TDesC8& aName, TInt* aValue) const
+    {   
+    TInt index;
+
+    if (!FindOfType(aName, &index, EAlfPropertyTypeInteger))
+        {
+        return EFalse;            
+        }
+        
+    if (aValue)
+        {
+        // Clamp the value.
+        CAlfPropertyInteger* foundVal = static_cast<CAlfPropertyInteger*>(iProperties[index]);        
+        
+        *aValue = Min(foundVal->Data().iValue, foundVal->Data().iMax);
+        *aValue = Max(*aValue, foundVal->Data().iMin);
+        }
+    
+    return ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// Find complete ranged value
+// ---------------------------------------------------------------------------
+//         
+TBool CAlfPropertyOwner::PropertyFindInteger(const TDesC8& aName, TRangedValue& aValue) const
+    {   
+    TInt index;
+
+    if (FindOfType(aName, &index, EAlfPropertyTypeInteger))
+        {
+        CAlfPropertyInteger* foundVal = static_cast<CAlfPropertyInteger*>(iProperties[index]);        
+        
+        aValue = foundVal->Data();
+        return ETrue;
+        }
+    
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// Set string property
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C TBool CAlfPropertyOwner::PropertySetStringL(const TDesC8& aName, const TDesC& aValue)
+    {
+    CAlfPropertyString* property;
+    TAlfPropertyType type;
+    TInt index;
+    
+    if (aName.Length() == 0)
+        {
+        // Cannot have zero-length name as an argument.
+        return EFalse;
+        }    
+
+    if (Find(aName, &index, &type))
+        {
+        // Property exists already.
+        if (type != EAlfPropertyTypeString)
+            {
+            // Wrong type. We have to exit without doing anything.
+            return EFalse;
+            }
+        
+        // Modify existing property.
+        property = static_cast<CAlfPropertyString*>(iProperties[index]);                
+        property->SetL(aValue);        
+        }
+    else
+        {
+        // Not found, so add new item to the property list.
+        property = new (ELeave) CAlfPropertyString();
+        CleanupStack::PushL(property);
+        property->ConstructL(aName);         
+        CleanupStack::Pop(property);
+        
+        property->SetL(aValue);        
+        
+        User::LeaveIfError(iProperties.Append(property));        
+        }
+    
+    return ETrue;
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// Find string property
+// ---------------------------------------------------------------------------
+//         
+EXPORT_C TBool CAlfPropertyOwner::PropertyFindString(const TDesC8& aName, TDesC** aValue) const
+    {   
+    TInt index;
+
+    if (!FindOfType(aName, &index, EAlfPropertyTypeString))
+        {
+        return EFalse;            
+        }
+    
+    CAlfPropertyString* foundVal = static_cast<CAlfPropertyString*>(iProperties[index]);
+    
+    if (aValue)
+        {
+        *aValue = foundVal->Data();
+        }
+    
+    return ETrue;
+    }    
+    
+    
+// Private methods
+
+// ---------------------------------------------------------------------------
+// Find property
+// ---------------------------------------------------------------------------
+//     
+TBool CAlfPropertyOwner::Find(const TDesC8& aName, TInt* aIndex, TAlfPropertyType* aType) const
+    {
+    TIdentityRelation<CAlfProperty> matchName( CAlfProperty::Matches );
+    
+    if (iProperties.Count() == 0)
+        {
+        // Array is empty, nothing to find.
+        return false;
+        }
+    
+    // Create a temporary property with the name we want to find.
+    CAlfProperty* toFind = new CAlfProperty();
+    if ( !toFind )
+        {
+        return EFalse;
+        }
+        
+    TRAPD( err, toFind->ConstructL(aName) );
+    if ( err != KErrNone )
+        {
+        delete toFind;
+        return EFalse;
+        }
+
+    TInt found = iProperties.Find(toFind, matchName);
+    delete toFind;
+
+    if (found == KErrNotFound)
+        {
+        return EFalse;
+        }
+       
+    CAlfProperty* foundProperty = iProperties[found];       
+       
+    if (aIndex)
+        {
+        *aIndex = found;
+        }
+    
+    if (aType)
+        {
+        *aType = foundProperty->Type();
+        }
+    
+    return ETrue;        
+    }
+
+// ---------------------------------------------------------------------------
+// Find property and check for the correct type
+// ---------------------------------------------------------------------------
+//     
+TBool CAlfPropertyOwner::FindOfType(const TDesC8& aName, TInt* aIndex, TAlfPropertyType aRequiredType) const
+    {
+    TAlfPropertyType foundType;
+    
+    if (!Find(aName, aIndex, &foundType))
+        {
+        return EFalse;            
+        }
+        
+    if (foundType != aRequiredType)
+        {
+        return EFalse;            
+        }
+
+    // Return, with find index stored in return parameter.
+    return ETrue;      
+    }
+
+    
+EXPORT_C TInt CAlfPropertyOwner::CopyProperty(const CAlfPropertyOwner& aOwner, const TDesC8& aPropertyName)
+    {
+    TInt index(0), result(KErrNone);
+    TAlfPropertyType propertyType;
+  
+    if (aOwner.Find(aPropertyName, &index, &propertyType))
+        {
+        switch (propertyType)
+            {
+            case EAlfPropertyTypeInteger:
+                {    
+                TRangedValue value;
+                aOwner.PropertyFindInteger(aPropertyName, value); // we know it exists
+                TRAP(result, PropertySetIntegerL(aPropertyName, value.iValue, value.iMin, value.iMax))
+                break;
+                }
+            case EAlfPropertyTypeString:
+                {
+                TDesC* string = 0;
+                aOwner.PropertyFindString(aPropertyName, &string); // we know it exists
+                TRAP(result, PropertySetStringL(aPropertyName, *string))
+                break;
+                }
+            default:
+                result = KErrNotSupported;
+                break;
+            }
+        }
+    else 
+        {
+        result = KErrNotFound;
+        } 
+        
+    return result;
+    }
+
+EXPORT_C void CAlfPropertyOwner::PropertyOwnerExtension(const TUid& /*aExtensionUid*/, TAny** /*aExtensionParams*/)
+    {
+    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfroster.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,807 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Roster.
+*
+*/
+
+
+
+#include "alf/alfroster.h"
+#include "alf/alfdisplay.h"
+#include "alf/alfcontrolgroup.h"
+#include "alf/alfcontrol.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alf/alfevent.h"
+#include "alflogger.h"
+#include "alfpanic.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+// Private data
+    
+struct CAlfRoster::TPrivateData
+    {
+    CAlfDisplay* iDisplay;                      // Not owned.
+    RPointerArray<CAlfControlGroup> iEntries;    // Not owned. Kept in order.
+    CAlfControl* iInputFocus;                   // Not owned.
+    RPointerArray<MAlfControlGroupOrderChangedObserver> iControlGroupOrderChangedObservers; // Not owned.
+    };
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfRoster::CAlfRoster()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfRoster::ConstructL(CAlfDisplay* aDisplay)
+    {
+    iData = new (ELeave) TPrivateData;
+    iData->iDisplay = aDisplay;
+    iData->iInputFocus = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfRoster::~CAlfRoster()
+    {
+    if ( iData )
+        {
+        iData->iEntries.Close();
+        iData->iControlGroupOrderChangedObservers.Close();
+        }
+    
+    delete iData;
+    iData = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Shows given control group.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfRoster::ShowL(CAlfControlGroup& aGroup, TInt aWhere )
+    {
+    // If the group is already shown on the display, just adjust its 
+    // position according to the parameters.
+    if(Find(aGroup) != KErrNotFound)
+        {
+        // It is already shown. Only adjust position.
+        TInt newPos = aWhere;
+        if(newPos == KAlfRosterShowAtTop)
+            {
+            newPos = Count() - 1;
+            }
+        else if(newPos == KAlfRosterShowAtBottom)
+            {
+            newPos = 0;
+            }
+        else
+            {
+            // for PC lint
+            }
+            
+        // Move the control group to a new position in the roster.
+        const TBool lWasMoved = Move(aGroup, newPos);
+        
+        // Move on the server side
+        iData->iDisplay->Env().Client().RosterShow( 
+              aGroup.Identifier(), 
+                aWhere, 
+                iData->iDisplay->ServerHandle() );                 
+                
+        //fix for bug  "ESMA-7L3H7F". Notification is moved from Move() to here.          
+        // Notify control group order changed observers about changed control group order
+        
+         if(lWasMoved)
+        	{
+        	NotifyControlGroupOrderChangedObservers();		
+        	}
+                              
+        return;
+        }
+
+    if(aWhere == KAlfRosterShowAtTop)
+        {
+        // Put the group on top of the roster.
+        AppendL(aGroup);
+        }
+    else if(aWhere == KAlfRosterShowAtBottom)
+        {
+        InsertL(aGroup, 0);
+        }
+    else
+        {
+        InsertL(aGroup, aWhere);
+        }
+
+
+    // The group will automatically accept input events once shown.
+    aGroup.SetAcceptInput(ETrue);
+
+    // Show all the controls of the group.
+    for(TInt i = 0; i < aGroup.Count(); ++i)
+        {
+        aGroup.Control(i).ShowL(*iData->iDisplay);
+        }
+    
+    // Bind the control group to the correct display.
+    aGroup.BindDisplay(iData->iDisplay);
+        
+    // Show on the server side
+    TInt err = 
+        iData->iDisplay->Env().Client().RosterShow( 
+            aGroup.Identifier(), 
+            aWhere, 
+            iData->iDisplay->ServerHandle() );
+            
+    // hide on error
+    if ( err != KErrNone )
+        {
+        // There is no window group ID if we are not running this from a 
+        // Symbian application. Therefore the roster::show returns an error.
+        // -> only concider this to be an error if the CCoeEnv is present.
+        if ( err == KErrNotFound && !CCoeEnv::Static() )
+            {
+            __ALFLOGSTRING1( "CAlfRoster::ShowL ignore error %d (no CCoeEnv)", err )
+            return;
+            }
+        
+        // Hide all the controls of the group.
+        for(TInt i = 0; i < aGroup.Count(); ++i)
+            {
+            aGroup.Control(i).Hide(*iData->iDisplay);
+            }
+        
+        // Unbind the control group from the display.
+        aGroup.BindDisplay(NULL);
+               
+        __ALFLOGSTRING1( "CAlfRoster::ShowL leave error %d", err )
+        User::Leave( err );
+        }
+        
+    // Notify control group order changed observers about changed control group order
+    NotifyControlGroupOrderChangedObservers();
+    }
+    
+// ---------------------------------------------------------------------------
+// Hides given control group
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfRoster::Hide(CAlfControlGroup& aGroup)
+    {
+    // Hide on the server side
+    TInt err = 
+        iData->iDisplay->Env().Client().RosterHide( 
+            aGroup.Identifier(), 
+            iData->iDisplay->ServerHandle() );
+            
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfRoster::Hide panic error %d", err )
+        USER_INVARIANT();
+        }
+            
+    // Hide all the controls of the group.
+    for(TInt i = 0; i < aGroup.Count(); ++i)
+        {
+        aGroup.Control(i).Hide(*iData->iDisplay);
+        }
+
+    // Unbind the control group from the display.
+    aGroup.BindDisplay(NULL);
+
+    // Investigate whether control group was shown
+    TBool wasShown = (Find(aGroup) == KErrNotFound) ? EFalse : ETrue;
+
+    Remove(&aGroup);
+    
+    // Notify control group order changed observers about changed control group order
+    // if control group was shown before.
+    if(wasShown)
+        {
+        NotifyControlGroupOrderChangedObservers();
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// Returns index of the given group
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfRoster::Find(const CAlfControlGroup& aGroup) const
+    {
+    return iData->iEntries.Find( &aGroup );
+    }
+
+// ---------------------------------------------------------------------------
+// Removes group
+// ---------------------------------------------------------------------------
+//    
+void CAlfRoster::Remove(CAlfControlGroup* aGroup)
+    {
+    if ( aGroup )
+        {
+        TInt index = Find(*aGroup);
+        if(index != KErrNotFound)
+            {
+            iData->iEntries.Remove(index);
+            }
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Number of control groups
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfRoster::Count() const
+    {
+    return iData->iEntries.Count();
+    }
+   
+// ---------------------------------------------------------------------------
+// Moves group.
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfRoster::Move(CAlfControlGroup& aGroup, TInt aPos)
+    {
+    TInt index = Find(aGroup);
+    TInt k = 0;
+    
+    if(index != KErrNotFound && index != aPos)
+        {
+        CAlfControlGroup* moving = iData->iEntries[index];
+        
+        if(aPos > index)
+            {
+            for(k = index; k < aPos; ++k)
+                {
+                iData->iEntries[k] = iData->iEntries[k + 1];
+                }
+            }
+        else 
+            {
+            for(k = index; k > aPos; --k)
+                {
+                iData->iEntries[k] = iData->iEntries[k - 1];
+                }
+            }
+        iData->iEntries[aPos] = moving;
+        return ETrue;
+        }
+    return EFalse;    
+    }
+
+// ---------------------------------------------------------------------------
+// Appends new group
+// ---------------------------------------------------------------------------
+//
+void CAlfRoster::AppendL(CAlfControlGroup& aGroup)
+    {
+    User::LeaveIfError(iData->iEntries.Append(&aGroup));
+    }
+    
+// ---------------------------------------------------------------------------
+// Inserts new group
+// ---------------------------------------------------------------------------
+//
+void CAlfRoster::InsertL(CAlfControlGroup& aGroup, TInt aPos)
+    {
+    if(Find(aGroup) != KErrNotFound)
+        {
+        User::Leave(KErrAlreadyExists);
+        }
+
+    User::LeaveIfError(iData->iEntries.Insert(&aGroup, aPos));
+    }    
+    
+// ---------------------------------------------------------------------------
+// Handles received event
+// ---------------------------------------------------------------------------
+//
+TBool CAlfRoster::HandleEventL(const TAlfEvent& aEvent)
+    {
+    TInt i = 0;
+    TInt k = 0;
+
+    if(iData->iDisplay)
+        {
+        iData->iDisplay->Env().ContinueRefresh();
+        }
+
+    if(aEvent.IsPointerEvent())
+        {
+        // The order pointer events are offered in depends on the visuals.
+
+        for(i = iData->iEntries.Count() - 1; i >= 0; --i)
+            {
+            CAlfControlGroup& group = *iData->iEntries[i];
+            
+            if(!group.AcceptInput())
+                {
+                // The group will not be receiving input events.
+                continue;
+                }
+            
+            for(k = group.Count() - 1; k >= 0; --k)
+                {
+                CAlfControl& control = group.Control(k);
+                if(control.HitTest(aEvent.PointerEvent().iPosition))
+                    {
+                    if(control.OfferEventL(aEvent))
+                        {
+                        // The event was consumed, now it can't be handled by
+                        // anyone else.
+                        return ETrue;
+                        }
+                    }
+                }
+            }
+        }
+    else 
+        {
+        // First offer to the input control.
+        if(aEvent.IsKeyEvent() && iData->iInputFocus && iData->iInputFocus->AcceptInput())
+            {
+            // check if the focus control has a host
+            CAlfControl* focusRoot = iData->iInputFocus;
+            while ( focusRoot->Host() )
+                {
+                focusRoot = focusRoot->Host();
+                }
+                
+            if(focusRoot->OfferEventL(aEvent))
+                {
+                return ETrue;
+                }
+            }
+
+        // Iterate through the groups and controls in priority order.
+        for(i = iData->iEntries.Count() - 1; i >= 0; --i)
+            {
+            CAlfControlGroup& group = *iData->iEntries[i];
+            
+            if(!group.AcceptInput())
+                {
+                // The group will not be receiving input events.
+                continue;
+                }
+            
+            for(k = 0 ; k < group.Count() ; k++ )
+                {
+                CAlfControl& control = group.Control(k);
+                if(control.OfferEventL(aEvent))
+                    {
+                    // The event was consumed, now it can't be handled by
+                    // anyone else.
+                    return ETrue;
+                    }
+                }
+            // Notify observer that group didn't handle event?
+            }
+        }
+
+    return EFalse;
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfControlGroup& CAlfRoster::ControlGroup(TInt aIndex) const
+    {
+    return *iData->iEntries[aIndex];
+    }
+  
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfControl* CAlfRoster::FindControl(TInt aControlId) const
+    {
+    for(TInt i = 0; i < iData->iEntries.Count(); ++i)
+        {
+        CAlfControl* control = 
+            iData->iEntries[i]->FindControl(aControlId);
+        if(control)
+            {
+            return control;
+            }
+        }
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfRoster::SetFocus(CAlfControl& aControl)
+    {
+    TRAP_IGNORE(ShowL( *aControl.ControlGroup(), KAlfRosterShowAtTop))
+        
+    // Something needs to change if these are not the same
+    if ( &aControl != iData->iInputFocus ) 
+        {
+        ChangeInputFocus( &aControl );
+        }
+    }    
+
+// ---------------------------------------------------------------------------
+// Clears the input focus so that no control has focus.
+// No change is implied for the visibility of the control group
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfRoster::ClearFocus()
+    { 
+    // Only do something if not cleared already
+    if ( iData->iInputFocus != NULL ) 
+        {
+        ChangeInputFocus(NULL);
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// The main job of this routine is to change iData->iInputFocus, and perform the 
+// necessary co-ordinated activities.  This should be the only place to change this
+// member datum. 
+// ---------------------------------------------------------------------------
+//      
+void CAlfRoster::ChangeInputFocus( CAlfControl* aControl )
+    {
+    // This method will always do something except when both old value and new are NULL
+    // If they are non-null and identical, then focus will be removed and then re-applied.
+    // That is, any optimizations need to be done by the caller.
+    
+    // The policy of whether focus is altered in the AlfControl is maintained uniformly by storing the cone focus 
+    // state at the beginning of the routine
+    // Current implementation is for one display/roster.  If multiple displays added then this will have to be reconsidered
+    TBool displayIsInitiallyFocused = iData->iDisplay ? iData->iDisplay->IsFocused() : EFalse;
+    
+    // There can be a latent focus only if display is unfocused.
+    TBool latentFocus = ((iData->iInputFocus != NULL) && (!iData->iInputFocus->Focus()));    
+    __ASSERT_DEBUG((latentFocus ? !displayIsInitiallyFocused : ETrue), User::Panic(_L("UIAcceltkClient"), EAlfRosterPanicFocusAnomaly));
+    
+    CAlfControl* oldFocusedControl = iData->iInputFocus;
+    
+    // Remove focus from the currently focused control
+    if ( iData->iInputFocus )
+        {
+        // Remove focus from the control
+        // Only need to change actual focus if the roster is focused
+        if ( displayIsInitiallyFocused )
+            {
+            // This control should be focused at the moment or then there is a latent focus that we are manipulating.
+            __ASSERT_DEBUG( iData->iInputFocus->Focus(), User::Panic(_L("UIAcceltkClient"),EAlfRosterPanicFocusAnomaly ));
+
+            CAlfDisplay* display = iData->iInputFocus->Display();
+            if ( display )
+                {
+               // SetFocus should cause the control to perform any required changes its visuals.
+                iData->iInputFocus->SetFocus( *display, EFalse);
+                }
+            }
+
+        // Still change the iInputFocus even if actual focus has not been removed
+        if ( !aControl )
+            {
+            iData->iInputFocus = NULL;
+            }
+        }
+    
+    if ( aControl )
+        {
+        // Check that the control switched to is in this Roster. Ignore it if not.
+        CAlfControl* control = FindControl(aControl->Id());
+        if( control == aControl )
+            {
+            iData->iInputFocus = aControl;
+            // This control should not be focused at the moment
+            __ASSERT_DEBUG( !(iData->iInputFocus->Focus()), User::Panic(_L("UIAcceltkClient"),EAlfRosterPanicFocusAnomaly ));
+            
+            // Only manipulate actual focus if the roster is focused
+            if ( displayIsInitiallyFocused )
+                {               
+                CAlfDisplay* display2 =  iData->iInputFocus->Display();
+                if ( display2 )
+                    {
+                    iData->iInputFocus->SetFocus( *display2, ETrue);
+                    }
+                }
+            }
+        }
+       
+    ReportHostsAboutChangingInputFocus( oldFocusedControl, aControl );
+    }    
+
+// ---------------------------------------------------------------------------
+// Inform host containers for the change 
+// ---------------------------------------------------------------------------
+//    
+void CAlfRoster::ReportHostsAboutChangingInputFocus( 
+    CAlfControl* aOldFocusControl, 
+    CAlfControl* aNewFocusControl )
+    {
+    // collect new focused control host tree
+    RPointerArray<CAlfControl> gainingHostControls;
+    if ( aNewFocusControl ) 
+        {
+        CAlfControl* hostTmp = aNewFocusControl->Host();
+        while ( hostTmp )
+            {
+            (void)gainingHostControls.Append( hostTmp );
+            hostTmp = hostTmp->Host();
+            }
+        }
+        
+    // Go through the hosts 
+    // 1. starting from the losing leaf host
+    // 2. continue to the losing root or combined host
+    // 3. start from the gaining root or combined host
+    // 4. end to the gaining leaf host
+    
+    TInt combinedIndex = KErrNotFound;
+    // 1
+    if ( aOldFocusControl )
+        {
+        CAlfControl* losingHostTmp = aOldFocusControl->Host();
+        while ( losingHostTmp && (combinedIndex == KErrNotFound ) ) // 2
+            {
+            combinedIndex = gainingHostControls.Find( losingHostTmp );
+            if ( combinedIndex == KErrNotFound )
+                {
+                losingHostTmp->FocusChainChanged( EFalse );
+                losingHostTmp = losingHostTmp->Host();
+                }
+            }
+        }
+        
+    // 3
+    TInt gainingStartIndex = gainingHostControls.Count() - 1;
+    if ( combinedIndex != KErrNotFound )
+        {
+        gainingStartIndex = combinedIndex - 1; // If we want to inform the combined host, remove the '-1'
+        }
+        
+    if ( gainingStartIndex >= 0 )
+        {
+        for ( TInt gainingHostIndex = gainingStartIndex ; gainingHostIndex >= 0 ; gainingHostIndex-- ) // 4
+            {
+            gainingHostControls[gainingHostIndex]->FocusChainChanged( ETrue );
+            }
+        }
+
+    gainingHostControls.Close();
+    }
+    
+// ---------------------------------------------------------------------------
+// Notifies registered control group order changed observers about changed
+// order in control group relative order.
+// ---------------------------------------------------------------------------
+//    
+void CAlfRoster::NotifyControlGroupOrderChangedObservers()
+    {
+    for(TInt i = 0; i < iData->iControlGroupOrderChangedObservers.Count(); i++)
+        {
+        iData->iControlGroupOrderChangedObservers[i]->NotifyControlGroupOrderChanged();
+        }    
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfRoster::ShowVisualL(CAlfVisual& aVisual)
+    {
+    TInt err = 
+        iData->iDisplay->Env().Client().RosterShowVisual( 
+            aVisual.Identifier(), 
+            iData->iDisplay->ServerHandle() );
+            
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfRoster::ShowVisualL leave error %d", err )
+        User::Leave( err );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfRoster::HideVisual(CAlfVisual& aVisual)
+    {
+    TInt err = 
+        iData->iDisplay->Env().Client().RosterHideVisual( 
+            aVisual.Identifier(), 
+            iData->iDisplay->ServerHandle() );
+            
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfRoster::HideVisual ignore error %d", err )
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CAlfRoster::MoveVisualToFront(CAlfVisual& aRootVisual)
+    {
+    TInt err =
+        iData->iDisplay->Env().Client().RosterMoveVisualToFront( 
+            aRootVisual.Identifier(), 
+            iData->iDisplay->ServerHandle() );
+            
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfRoster::MoveVisualToFront ignore error %d", err )
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Adds a pointer event observer
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TInt CAlfRoster::AddPointerEventObserver( 
+        TAlfPointerEventFlags aObserver, 
+        CAlfControl& aControl )
+    {
+    switch ( aObserver )
+        {
+        case EAlfPointerEventReportDrag:
+        case EAlfPointerEventReportLongTap:
+        case EAlfPointerEventReportUnhandled:
+            break;
+        default:
+            USER_INVARIANT();
+            break;
+        }
+    
+    TInt err =
+        iData->iDisplay->Env().Client().RosterAddPointerEventObserver( 
+            aObserver, 
+            aControl.Identifier(), 
+            iData->iDisplay->ServerHandle()  );
+            
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Removes a pointer event observer
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TInt CAlfRoster::RemovePointerEventObserver( 
+        TAlfPointerEventFlags aObserver, 
+        CAlfControl& aControl )
+    {
+    switch ( aObserver )
+        {
+        case EAlfPointerEventReportDrag:
+        case EAlfPointerEventReportLongTap:
+        case EAlfPointerEventReportUnhandled:
+            break;
+        default:
+            USER_INVARIANT();
+            break;
+        }
+        
+    TInt err =
+        iData->iDisplay->Env().Client().RosterRemovePointerEventObserver( 
+            aObserver, 
+            aControl.Identifier(), 
+            iData->iDisplay->ServerHandle()  );
+            
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets pointer event observer flags.
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C TInt CAlfRoster::SetPointerEventObservers( 
+    TUint aPointerEventFlags, 
+    CAlfControl& aControl )
+    {
+    TInt err =
+        iData->iDisplay->Env().Client().RosterSetPointerEventObservers( 
+            aPointerEventFlags, 
+            aControl.Identifier(), 
+            iData->iDisplay->ServerHandle()  );
+            
+     return err;
+    }
+    
+void CAlfRoster::DisplayFocusChanged( CAlfDisplay& aDisplay, TBool aNewFocus )
+    {
+    // This method should only be called during a real transition of display focus. If there is a 
+    // roster focused control then alter it's focus state.
+    if ( iData->iInputFocus )
+        {
+        iData->iInputFocus->SetFocus( aDisplay, aNewFocus );
+        
+        if (aNewFocus)
+            {
+            ReportHostsAboutChangingInputFocus( NULL, iData->iInputFocus );
+            }
+        else
+            {
+            ReportHostsAboutChangingInputFocus( iData->iInputFocus, NULL );
+            }
+            
+        }
+    }
+    
+CAlfControl* CAlfRoster::FocusedControl() const
+    {
+    return iData->iInputFocus;
+    }
+
+EXPORT_C TInt CAlfRoster::SetPointerDragThreshold(const CAlfControl& aControl, const TAlfXYMetric& aXYMetric)
+	{
+    TInt err =
+        iData->iDisplay->Env().Client().RosterSetPointerDragTreshold( 
+            aControl.Identifier(), 
+            aXYMetric,
+            iData->iDisplay->ServerHandle()  );
+            
+    return err;	
+	}
+	
+EXPORT_C TInt CAlfRoster::DisableLongTapEventsWhenDragging(const CAlfControl& aControl, TBool aDisable)
+	{
+    TInt err =
+        iData->iDisplay->Env().Client().RosterDisableLongTapEventsWhenDragging( 
+            aControl.Identifier(), 
+            aDisable,
+            iData->iDisplay->ServerHandle()  );
+            
+    return err;	
+	}
+
+// ---------------------------------------------------------------------------
+// Adds a control group order change observer into the observers array.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfRoster::AddControlGroupOrderChangedObserverL(MAlfControlGroupOrderChangedObserver& aObserver)
+    {
+	if(iData->iControlGroupOrderChangedObservers.Find(&aObserver) != KErrNotFound)
+	    {
+	    return;
+	    }
+	iData->iControlGroupOrderChangedObservers.AppendL(&aObserver);    
+    }
+
+// ---------------------------------------------------------------------------
+// Removes a control group order change observer from the observers array.
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfRoster::RemoveControlGroupOrderChangedObserver(MAlfControlGroupOrderChangedObserver& aObserver)
+    {
+	TInt index = iData->iControlGroupOrderChangedObservers.Find(&aObserver);
+	if(index != KErrNotFound)
+	    {
+	    iData->iControlGroupOrderChangedObservers.Remove(index);
+	    }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfscreenbuffer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,394 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 buffer implementation
+*
+*/
+
+
+
+#include <coemain.h>
+
+#include "alflogger.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alf/alfstatic.h"
+#include "alf/alfconstants.h"
+#include "alfuids.h"
+#include "alf/alfscreenbuffer.h"
+#include "alf/alfsymbiansbdrawer.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+// *** class CAlfScreenBufferEventFetcher
+
+NONSHARABLE_CLASS(CAlfScreenBufferEventFetcher): public CActive
+    {
+public: // Struct
+    
+    struct TScreenBufferInfo
+    	{
+    	MAlfScreenBufferObserver* iObserver; // Observer for this screen buffer. Not owned
+    	TUid iBufferUid; // Uid of the buffer to be observed.
+    	TInt iPriority;  // Priority of the buffer. Not yet used.
+    	TInt iBitmapHandle; // Handle to the shared CFbsBitmap that contains the buffer.
+    	TInt iMaskHandle; // Mask handle
+    	TRect iLastDisplayRect; // Display rect
+    	TRect iLastDirtyRect; // Dirty rect  	
+    	};
+
+    
+public: // New methods
+
+    CAlfScreenBufferEventFetcher(RAlfClient& aClient, MAlfScreenBufferObserver& aScreenBufferObs)
+        :CActive(CActive::EPriorityHigh), iClient(aClient), iEventAsDescriptor(iEvent)        
+        {
+        CAlfScreenBufferEventFetcher::TScreenBufferInfo info = {&aScreenBufferObs, KNullUid, 0, 0, 0, TRect(), TRect()};
+        iBufferInfo = info;
+        CActiveScheduler::Add(this);
+        }
+
+    ~CAlfScreenBufferEventFetcher()
+        {
+        Cancel();
+        }
+
+	// Request a new event
+	void RequestBufferEvent()       
+        {
+        if(!IsActive())
+            {
+            SetActive();
+        	iEvent.iBufferUid = iBufferInfo.iBufferUid;
+        	iEvent.iEventId = 0;
+        	iEvent.iDisplayRect = TRect();
+        	iEvent.iDirtyRect = TRect();
+    		iClient.SendAsyncCmd(EAlfSBufRequestEvent, iEventAsDescriptor, iStatus); 
+            }
+        }
+        
+    // Return buffer info    
+    TScreenBufferInfo& ScreenBufferInfo()
+    	{
+    	return(iBufferInfo);
+    	}
+
+private: // From CActive
+    
+    void RunL()
+        {
+        if(iStatus.Int() != KErrNone)
+           	{ 
+           	USER_INVARIANT();            	
+           	}
+          	
+        // Issue a new event request first             
+        TAlfScreenBufferEvent event = iEvent;
+		RequestBufferEvent();   
+		
+		// Handle event
+		
+		if (event.iEventId == MAlfScreenBufferObserver::ENone) // Buffer complete event    
+			{
+        	if (iBufferInfo.iObserver->BufferComplete(event.iBufferUid, event.iDisplayRect, event.iDirtyRect))
+        		{
+        		// Request next  buffer automatically
+   			    TUid uidEvent = event.iBufferUid; 
+    			TPckg<TUid> eventPckg(uidEvent);
+    			iClient.SendSyncCmd(EAlfSBufRequestNextBuffer, eventPckg);
+        		}
+			}
+		else     
+			{
+			if (event.iEventId == MAlfScreenBufferObserver::ECreated)
+				{
+		   		// Add this buffer observer again to the array in Alf Server to get valid bitmap handles in return. 
+    			TAlfScreenBufferBitmaps addObserverEvent = {iBufferInfo.iBufferUid, iBufferInfo.iPriority, NULL, NULL}; 
+    			TPckg<TAlfScreenBufferBitmaps> eventPckg(addObserverEvent);
+    			iClient.SendSyncCmd(EAlfSBufAddObserver, eventPckg);
+    			
+    			// Update bitmap handles
+    			iBufferInfo.iBitmapHandle = addObserverEvent.iBitmapHandle; 
+    			iBufferInfo.iMaskHandle = addObserverEvent.iMaskHandle;			
+				}
+			else if (event.iEventId == MAlfScreenBufferObserver::EDeleted)
+				{
+    			// Invalidate bitmap handles
+    			iBufferInfo.iBitmapHandle = NULL; 
+    			iBufferInfo.iMaskHandle = NULL;							
+				}
+    			
+        	iBufferInfo.iObserver->HandleScreenBufferEvent(event.iBufferUid, event.iEventId);			
+			}
+        }
+        
+    void DoCancel()
+        {
+    	// Remove this AO from the observer array in Alf Server
+    	TAlfScreenBufferBitmaps event = {iBufferInfo.iBufferUid, 0, 0}; 
+    	TPckg<TAlfScreenBufferBitmaps> eventPckg(event);
+    	iClient.SendSyncCmd(EAlfSBufRemoveObserver, eventPckg);
+        }
+
+    TInt RunError(TInt /*aError*/)
+        {
+        // Ignore error
+        return KErrNone;
+        }
+
+private: // Data
+
+    RAlfClient& iClient;
+    TAlfScreenBufferEvent iEvent; // Event data for pending buffer event. 
+    TPckg<TAlfScreenBufferEvent> iEventAsDescriptor;
+    
+    CAlfScreenBufferEventFetcher::TScreenBufferInfo iBufferInfo; // Buffer information
+    };
+
+
+
+// *** Array item for CAlfScreenBuffer
+
+struct TAlfScreenBufferHandlerItem
+	{
+	TAlfScreenBufferHandlerItem( TInt aId, CAlfScreenBufferEventFetcher* aAoPtr) 
+		:iId( aId ), iAoPtr( aAoPtr )
+		{};
+	TInt iId; // Buffer uid
+	CAlfScreenBufferEventFetcher* iAoPtr; // Pointer to the active object that handles buffer events. Owned.
+	};
+		
+
+// *** Private data for CAlfScreenBuffer
+
+NONSHARABLE_CLASS(CAlfScreenBuffer::CPrivateData):public CBase
+    {
+    public:
+    ~CPrivateData()
+        {
+        iScreenBufferHandlers.Close();
+        if (iIsAlfEnvOwned)
+        	{
+        	delete(iEnv);
+        	}
+        }
+        
+    CAlfEnv* iEnv;   
+    TBool iIsAlfEnvOwned; 
+    RArray<TAlfScreenBufferHandlerItem> iScreenBufferHandlers; // List of all buffer observer Active Objects
+    };
+
+
+// *** class CAlfScreenBuffer
+
+EXPORT_C CAlfScreenBuffer* CAlfScreenBuffer::NewL()
+	{
+	// Create own aAlf env if it does not exist.
+	TBool isAlfEnvOwned = EFalse; 
+	CAlfEnv* env = CAlfEnv::Static();
+	if (!env)
+		{
+		isAlfEnvOwned = ETrue;
+		env = CAlfEnv::NewL();
+		}
+	
+	// Create object	
+    CAlfScreenBuffer* self = new( ELeave ) CAlfScreenBuffer();
+    CleanupStack::PushL( self );        
+    self->ConstructL(env, isAlfEnvOwned);
+    CleanupStack::Pop( self );
+    return self;	
+	};
+
+EXPORT_C CAlfScreenBuffer* CAlfScreenBuffer::NewL(CAlfEnv& aEnv)
+	{
+    CAlfScreenBuffer* self = new( ELeave ) CAlfScreenBuffer();
+    CleanupStack::PushL( self );        
+    self->ConstructL(&aEnv, EFalse);
+    CleanupStack::Pop( self );
+    return self;	
+	};
+
+
+CAlfScreenBuffer::CAlfScreenBuffer()
+	{	
+	}
+
+// @deprecated
+EXPORT_C CAlfScreenBuffer::CAlfScreenBuffer(CAlfEnv& /*aEnv*/) 
+	{	
+	}
+
+
+EXPORT_C CAlfScreenBuffer::~CAlfScreenBuffer()
+	{
+    for (TInt i = iData->iScreenBufferHandlers.Count()-1; i >= 0 ; i--)
+   		{
+        RemoveObserver(iData->iScreenBufferHandlers[i].iAoPtr->ScreenBufferInfo().iBufferUid);
+        }
+
+    delete iData;
+	}
+
+// @deprecated
+EXPORT_C void CAlfScreenBuffer::ConstructL()
+    {
+    // Not used, preserved for BC
+    }
+    
+void CAlfScreenBuffer::ConstructL(CAlfEnv* aEnv, TBool aIsAlfEnvOwned)
+    {
+    //@todo : should I check that only one instance is created per alf client? 
+    // Create private data
+    iData = new (ELeave) CPrivateData; 
+    iData->iEnv = aEnv;
+    iData->iIsAlfEnvOwned = aIsAlfEnvOwned;
+    }
+
+
+EXPORT_C MAlfBufferDrawer* CAlfScreenBuffer::GetDrawingInterface(TUid aInterfaceUid, TUid aBufferUid)
+	{
+	// Symbian IF
+	if (aInterfaceUid == KAlfSymbianBufferDrawerUid)
+	    {
+	    TAlfScreenBufferHandlerItem item( aBufferUid.iUid, NULL );
+	    TInt index;
+	    if ( iData->iScreenBufferHandlers.FindInSignedKeyOrder( item, index ) == KErrNone )
+		    {
+		    if (iData->iScreenBufferHandlers[index].iAoPtr->ScreenBufferInfo().iBitmapHandle)
+		    	{
+       	    	CAlfSymbianBufferDrawer* drawer = NULL;
+       	    	TRAPD(err, drawer = CAlfSymbianBufferDrawer::NewL());
+       	    	if (!err)
+       	    		{
+                	TRAP(err,drawer->SetBufferL(
+                		iData->iScreenBufferHandlers[index].iAoPtr->ScreenBufferInfo().iBitmapHandle,
+                		iData->iScreenBufferHandlers[index].iAoPtr->ScreenBufferInfo().iMaskHandle));
+                	if (err)
+                		{
+                		delete drawer;
+                		return NULL;
+                		}
+                	else
+                		{
+                		return drawer;
+                		}	
+            		}   
+		    	}
+	        }
+	    }
+	return NULL;	            
+	}
+	
+
+EXPORT_C MAlfBufferGc* CAlfScreenBuffer::GetGraphicsContext(TUid /*aInterfaceUid*/, TUid /*aBufferUid*/)  
+	{	
+	return ((MAlfBufferGc*)NULL);
+	}
+      
+        
+EXPORT_C void CAlfScreenBuffer::AddObserverL(TUid aBufferId, MAlfScreenBufferObserver* aObserver, TInt aPriority) 
+	{
+	AddObserverL(aBufferId, CAlfScreenBuffer::EFlagNone, aObserver, aPriority); 
+	}
+
+	
+EXPORT_C void CAlfScreenBuffer::AddObserverL(TUid aBufferId, TUint aFlags, MAlfScreenBufferObserver* aObserver, TInt aPriority) 
+	{    
+    // Add to the observer array in Alf Server, and get bitmap handles in return. 
+    TAlfScreenBufferBitmaps event = {aBufferId, aPriority, aFlags, NULL, NULL}; 
+    TPckg<TAlfScreenBufferBitmaps> eventPckg(event);
+    User::LeaveIfError(iData->iEnv->Client().SendSyncCmd(EAlfSBufAddObserver, eventPckg)); 
+    
+  	// Append the handler to the client list
+   	CAlfScreenBufferEventFetcher* eventFetcher =  new (ELeave) CAlfScreenBufferEventFetcher(iData->iEnv->Client(), *aObserver);
+   	CAlfScreenBufferEventFetcher::TScreenBufferInfo info = {eventFetcher->ScreenBufferInfo().iObserver, event.iBufferUid, aPriority, event.iBitmapHandle, event.iMaskHandle, TRect(), TRect()};
+   	eventFetcher->ScreenBufferInfo() = info;    
+   	// Transfers ownership of eventFetcher
+    TInt err = iData->iScreenBufferHandlers.InsertInUnsignedKeyOrder(TAlfScreenBufferHandlerItem(aBufferId.iUid, eventFetcher)); 
+
+    if (err)
+    	{
+    	delete eventFetcher;
+    	RemoveObserver(aBufferId); 
+    	User::Leave(err);
+    	}
+    else
+    	{
+    	// Start observing any event 
+    	eventFetcher->RequestBufferEvent(); 
+    	}	
+	}
+	
+	
+// Note: This can be also called to already removed observers. In that case it has no effect. 
+EXPORT_C void CAlfScreenBuffer::RemoveObserver(TUid aBufferId) 
+	{	
+    // Remove from the observer array in Alf Server
+    TAlfScreenBufferBitmaps event = {aBufferId, 0, 0}; 
+    TPckg<TAlfScreenBufferBitmaps> eventPckg(event);
+    iData->iEnv->Client().SendSyncCmd(EAlfSBufRemoveObserver, eventPckg); 
+     
+  	// Remove the handler from the client list
+   	TAlfScreenBufferHandlerItem item( aBufferId.iUid, NULL );
+	TInt index;
+	if ( iData->iScreenBufferHandlers.FindInSignedKeyOrder( item, index ) == KErrNone )
+		{
+		delete(iData->iScreenBufferHandlers[index].iAoPtr);
+		iData->iScreenBufferHandlers.Remove(index);
+		}
+	}
+
+
+EXPORT_C void CAlfScreenBuffer::RequestNextBuffer(TUid aBufferId)       
+	{
+   	TAlfScreenBufferHandlerItem item( aBufferId.iUid, NULL );
+	TInt index;
+	if ( iData->iScreenBufferHandlers.FindInSignedKeyOrder( item, index ) == KErrNone )
+		{
+	    TUid event = aBufferId; 
+    	TPckg<TUid> eventPckg(event);
+    	iData->iEnv->Client().SendSyncCmd(EAlfSBufRequestNextBuffer, eventPckg);
+		}
+	else
+		{
+		// I am not a listener for this buffer 
+		__ALFLOGSTRING1( "CAlfScreenBuffer::RequestNextBuffer(). Observer not found for uid %x", aBufferId.iUid );
+		}
+	}
+    
+    
+EXPORT_C void CAlfScreenBuffer::RequestBufferDraw(TUid aBufferId)       
+	{
+   	TAlfScreenBufferHandlerItem item( aBufferId.iUid, NULL );
+	TInt index;
+	if ( iData->iScreenBufferHandlers.FindInSignedKeyOrder( item, index ) == KErrNone )
+		{
+	    TUid event = aBufferId; 
+    	TPckg<TUid> eventPckg(event);
+    	iData->iEnv->Client().SendSyncCmd(EAlfSBufRequestBufferDraw, eventPckg);
+		}
+	else
+		{
+		// I am not a listener for this buffer 
+		__ALFLOGSTRING1( "CAlfScreenBuffer::RequestNextBuffer(). Observer not found for uid %x", aBufferId.iUid );
+		}
+	}
+    
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfscrollerevent.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Scroller event class.
+*
+*/
+
+
+
+#include <alf/alfscrollerevent.h>
+
+// ======== MEMBER FUNCTIONS ========
+   
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfScrollerEvent::TAlfScrollerEvent( TCode aCode, TOrientation aOrientation, TInt aMagnitude )
+    :
+    iCode(aCode),
+    iOrientation(aOrientation),
+    iMagnitude(aMagnitude)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+TAlfScrollerEvent::TAlfScrollerEvent()
+    :
+    iCode(TAlfScrollerEvent::EMoveByItem),
+    iOrientation(TAlfScrollerEvent::EVertical),
+    iMagnitude(0)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Access the event code
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfScrollerEvent::TCode TAlfScrollerEvent::Code() const
+    {
+    return iCode;
+    }
+    
+// ---------------------------------------------------------------------------
+// Access the orientation
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfScrollerEvent::TOrientation TAlfScrollerEvent::Orientation() const
+    {
+    return iOrientation;
+    }
+    
+// ---------------------------------------------------------------------------
+// Access the magnitude
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt TAlfScrollerEvent::Magnitude() const
+    {
+    return iMagnitude;
+    }
+    
+  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfshadowborderbrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,168 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Shadow border brush
+*
+*/
+
+
+
+#include "alf/alfshadowborderbrush.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alfconstants.h"
+#include "alflogger.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+struct CAlfShadowBorderBrush::TShadowBorderPrivateData
+    {
+    TAlfTimedValue iWidth;
+    TAlfMetric iMetricWidth;
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CAlfShadowBorderBrush::CAlfShadowBorderBrush()
+    {
+    }
+    
+void CAlfShadowBorderBrush::ConstructL( CAlfEnv& aEnv, TInt aWidth )
+    {
+    TPckgC<TInt> paramsPckg( aWidth );
+    
+    CAlfBrush::ConstructL(
+        aEnv,
+        EAlfShadowBorderBrushCreate,
+        0,
+        paramsPckg
+        );
+        
+    iShadowBorderData = new (ELeave) TShadowBorderPrivateData;
+    iShadowBorderData->iWidth.SetValueNow( aWidth );
+    }
+    
+EXPORT_C CAlfShadowBorderBrush* CAlfShadowBorderBrush::NewL(
+        CAlfEnv& aEnv,
+        TInt aWidth )
+    {
+    CAlfShadowBorderBrush* self = NewLC( aEnv, aWidth );
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+EXPORT_C CAlfShadowBorderBrush* CAlfShadowBorderBrush::NewLC(
+        CAlfEnv& aEnv,
+        TInt aWidth )
+    {
+    CAlfShadowBorderBrush* self = new (ELeave) CAlfShadowBorderBrush;
+    CleanupStack::PushL( self );
+    self->ConstructL( aEnv, aWidth );
+    return self;
+    }
+
+void CAlfShadowBorderBrush::ConstructL( CAlfEnv& aEnv, const TAlfMetric& aWidth )
+    {
+    TPckgC<TAlfMetric> paramsPckg( aWidth );
+    
+    CAlfBrush::ConstructL(
+        aEnv,
+        EAlfShadowBorderBrushCreateMetric,
+        0,
+        paramsPckg
+        );
+        
+    iShadowBorderData = new (ELeave) TShadowBorderPrivateData;
+    iShadowBorderData->iWidth.SetValueNow( 0 ); // Not used, just set to zero.
+    iShadowBorderData->iMetricWidth = TAlfMetric(aWidth);
+    }
+    
+EXPORT_C CAlfShadowBorderBrush* CAlfShadowBorderBrush::NewL(
+        CAlfEnv& aEnv,
+        const TAlfMetric& aWidth )
+    {
+    CAlfShadowBorderBrush* self = NewLC( aEnv, aWidth );
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+EXPORT_C CAlfShadowBorderBrush* CAlfShadowBorderBrush::NewLC(
+        CAlfEnv& aEnv,
+        const TAlfMetric& aWidth )
+    {
+    CAlfShadowBorderBrush* self = new (ELeave) CAlfShadowBorderBrush;
+    CleanupStack::PushL( self );
+    self->ConstructL( aEnv, aWidth );
+    return self;
+    }
+
+    
+CAlfShadowBorderBrush::~CAlfShadowBorderBrush()
+    {
+    delete iShadowBorderData;
+    }
+    
+EXPORT_C const TAlfTimedValue& CAlfShadowBorderBrush::Width() const
+    {
+    TPckg<TAlfTimedValue> buf(iShadowBorderData->iWidth);
+    TInt err = Comms()->DoSynchronousCmd( EAlfShadowBorderBrushGetWidth, buf, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfShadowBorderBrush::Width panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return iShadowBorderData->iWidth;
+    }
+    
+EXPORT_C void CAlfShadowBorderBrush::SetWidth( const TAlfTimedValue& aWidth )
+    {
+    TPckgC<TAlfTimedValue> buf(aWidth);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfShadowBorderBrushSetWidth, buf );
+
+    if ( err == KErrNone )
+        {
+        iShadowBorderData->iWidth = aWidth;
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfShadowBorderBrush::SetWidth panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+    
+EXPORT_C void CAlfShadowBorderBrush::SetWidth( const TAlfMetric& aWidth )
+    {
+    TPckgC<TAlfMetric> buf(aWidth);
+
+    TInt err = Comms()->DoCmdNoReply( EAlfShadowBorderBrushSetWidthMetric, buf);
+
+    if ( err == KErrNone )
+        {
+        iShadowBorderData->iMetricWidth = aWidth;
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfShadowBorderBrush::SetWidth (TAlfMetric) panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+    
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfskinnableimage.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,238 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Skinnable image
+*
+*/
+
+
+
+#include <alf/alfconstants.h>
+#include "alfskinnableimage.h"
+#include "alf/alfimageloaderutil.h"
+#include "alf/alftexturemanager.h"
+#include "alf/alftexture.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfSkinnableImage::CAlfSkinnableImage(CAlfEnv* aEnv)
+    {
+    iEnv = aEnv;    
+    }
+    
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//    
+CAlfSkinnableImage::~CAlfSkinnableImage()
+    {
+    if (Image().HasTexture())
+        {
+        CAlfTextureManager& oldManager = ImageTextureManager(Image());
+        oldManager.DecRefcount(iId);        
+        }
+    
+    DeleteTexture();
+
+    // Remove size observer if needed
+    if (iSkinnedImageUtil)
+       {
+       CAlfTextureManager& manager = ImageTextureManager(iSkinnedImageTextureManagerId);        
+       manager.RemoveAutoSizeObserver(iSkinnedImageUtil);
+       }
+       
+    delete iSkinnedImageUtil; 
+    }
+        
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//    
+
+void CAlfSkinnableImage::SetImage(const TAlfImage& aImage)
+    {    
+    CAlfTextureManager& oldManager = ImageTextureManager(Image());
+    CAlfTextureManager& newManager = ImageTextureManager(aImage);
+    
+    if (Image().HasTexture())
+        {
+        oldManager.DecRefcount(iId);        
+        }
+        
+    if ( iSkinnedImageUtil )
+        {
+        oldManager.RemoveAutoSizeObserver(iSkinnedImageUtil);   
+        delete iSkinnedImageUtil;
+        iSkinnedImageUtil = NULL;
+        } 
+    
+    iImage = aImage;
+    TRAP_IGNORE(CreateTextureL()); // Creates texture from skin id if needed           
+
+    if (Image().HasTexture())
+        {
+        CAlfTexture* texture = (CAlfTexture*)&Image().Texture();
+        iId = texture->Id();        
+        newManager.IncRefcount(iId);        
+        
+        // If texture does not have content and it has been released because of
+        // ref counting try to restore content.
+        if (!texture->HasContent())        
+            {
+            TInt releaseFlags = texture->ReleaseFlags();  
+            if (releaseFlags & CAlfTexture::EReleaseFromRefCounting)
+                {
+                // Clear release flag 
+                releaseFlags &= ~CAlfTexture::EReleaseFromRefCounting;    
+                texture->SetReleaseFlags(releaseFlags);
+            
+                // If there are no more release flags, try to restore content.
+                if (!releaseFlags)
+                    {                                        
+                     if (texture->BitmapProvider())
+                        {
+                        TRAP_IGNORE(newManager.UpdateTextureFromBitmapL(iId))    
+                        }
+                    else
+                        {
+                        TRAP_IGNORE(newManager.UpdateTextureFromFileL(iId))                        
+                        }    
+                    }
+                }
+            }
+        }
+    else
+        {
+        iId = 0;
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//    
+TAlfImage& CAlfSkinnableImage::Image()
+    {
+    return iImage;    
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//    
+void CAlfSkinnableImage::CreateTextureL()
+    {
+    if (iImage.SkinnableImage())
+        {      
+        // old iSkinnedImageUtil should be freed already
+        __ASSERT_DEBUG( !iSkinnedImageUtil, USER_INVARIANT() );
+        iSkinnedImageUtil = new (ELeave) CAlfAutoSizeImageLoaderUtil;
+        
+        CAlfTextureManager& tm = ImageTextureManager(iImage);
+        
+        // Add size observer if needed
+        if (iImage.TextureFlags() & EAlfTextureFlagAutoSize)
+            {
+            tm.AddAutoSizeObserverL(iSkinnedImageUtil);        
+            }        
+
+        CAlfTexture* texture = NULL;
+        iSkinnedImageUtil->SetSize(iImage.PreferredSize(), iImage.PreferredScaleMode());
+        
+        MAlfBitmapProvider* imageprovider = NULL;
+        if (iImage.AppIconUid() != TUid::Uid(0))
+            {
+            imageprovider = iSkinnedImageUtil->CreateImageLoaderL(iImage.AppIconUid(), 
+                iImage.AppIconType());                
+            }
+        else
+            {
+            imageprovider = iSkinnedImageUtil->CreateImageLoaderL(iImage.SkinID(), 
+                *iImage.FallbackFileName(),
+                iImage.FallbackBitmapId(),
+                iImage.FallbackMaskId());                
+            }    
+        
+        texture = &tm.CreateTextureL(iImage.PreferredTextureId(), imageprovider, iImage.TextureFlags());                     
+        iImage.SetTexture(*texture);
+        
+        // Delete old texture if we managed to create new one 
+        if (texture)
+            {
+            // Check that the new one is really a new one, not just reusing old id.
+            if (texture->Id() != iSkinnedImageTextureId || tm.ManagerUid() != iSkinnedImageTextureManagerId)
+                {
+                DeleteTexture();
+                iSkinnedImageTextureId = texture->Id();
+                iSkinnedImageTextureManagerId = tm.ManagerUid();                    
+                }            
+            }                    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// This function deletes texture associated to image, but does not delete
+// the bitmapprovider (it is left to support release/restore).
+// ---------------------------------------------------------------------------
+//    
+void CAlfSkinnableImage::DeleteTexture()
+    {
+    if (iSkinnedImageTextureId != 0)
+        {
+        CAlfTextureManager& manager = ImageTextureManager(iSkinnedImageTextureManagerId);        
+        const CAlfTexture* oldtexture = manager.Texture(iSkinnedImageTextureId);
+        if (oldtexture && oldtexture->Id() == iSkinnedImageTextureId)
+            {
+            delete oldtexture;    
+            iSkinnedImageTextureId = 0;
+            iSkinnedImageTextureManagerId = TUid::Uid(0);                               
+            }                                        
+        }                
+    }
+    
+// ---------------------------------------------------------------------------
+// Gets the texturemanager for the texture inside given image. Defaults
+// to default texture manager.
+// ---------------------------------------------------------------------------
+//    
+CAlfTextureManager& CAlfSkinnableImage::ImageTextureManager(const TAlfImage& aImage)
+    {
+    CAlfTextureManager* tm = aImage.PreferredTextureManager();
+    if (!tm)
+        {
+        tm = &iEnv->TextureManager();                    
+        }
+    return *tm;        
+    }
+    
+// ---------------------------------------------------------------------------
+// Gets the texturemanager based on texturemanager uid. Defaults
+// to default texture manager.
+// ---------------------------------------------------------------------------
+//    
+CAlfTextureManager& CAlfSkinnableImage::ImageTextureManager(TUid aManagerUid)
+    {
+    CAlfTextureManager* tm = &iEnv->TextureManager();
+    if (iSkinnedImageTextureManagerId != TUid::Uid(0))
+        {
+        tm = iEnv->SharedTextureManager(aManagerUid);
+        }
+    return *tm;             
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfstatic.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Static class.
+*
+*/
+
+
+
+#include "alf/alfstatic.h"
+
+/**
+ * Thread local storage space. Writable static data is not supported in
+ * Symbian, so static data is stored in this struct.
+ */
+
+struct TTlsData
+    {
+    /** Primary environment. */
+    CAlfEnv* iPrimaryEnv;
+    };
+
+EXPORT_C CAlfStatic* CAlfStatic::NewLC(CAlfEnv* aPrimaryEnv)
+    {
+    CAlfStatic* self = new (ELeave) CAlfStatic();
+    CleanupStack::PushL(self);
+    self->ConstructL(aPrimaryEnv);
+    return self;        
+    }
+
+EXPORT_C CAlfStatic* CAlfStatic::NewL(CAlfEnv* aPrimaryEnv)
+    {
+    CAlfStatic* self = NewLC(aPrimaryEnv);
+    CleanupStack::Pop(self);
+    return self;        
+    }
+
+CAlfStatic::~CAlfStatic()
+    {
+    Dll::FreeTls();
+    delete iData;        
+    }
+
+EXPORT_C CAlfEnv& CAlfStatic::Env()
+    {
+    return *Data()->iPrimaryEnv;
+    }
+
+
+CAlfStatic::CAlfStatic()
+    {
+    
+    }
+
+void CAlfStatic::ConstructL(CAlfEnv* aPrimaryEnv)
+    {
+    iData = new (ELeave) TTlsData();
+    Mem::FillZ(iData, sizeof(TTlsData));    
+    
+    iData->iPrimaryEnv = aPrimaryEnv;
+    
+    Dll::SetTls(iData);    
+    }
+
+EXPORT_C struct TTlsData* CAlfStatic::Data()
+    {
+    return static_cast<TTlsData*>(Dll::Tls());        
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfsymbiansbdrawer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Symbian specific screen buffer drawer
+*
+*/
+
+
+
+#include "alf/alfsymbiansbdrawer.h"
+#include "alf/alfscreenbuffer.h"
+#include <uiacceltk/HuiUtil.h>
+#include <fbs.h>
+
+struct CAlfSymbianBufferDrawer::TPrivData
+    {
+    CFbsBitmap* iBitmap;
+    CFbsBitmap* iMask;
+    };
+    
+CAlfSymbianBufferDrawer::CAlfSymbianBufferDrawer()
+    {    
+    }
+
+CAlfSymbianBufferDrawer::~CAlfSymbianBufferDrawer()
+    {
+    if (iPrivData)
+    	{
+    	delete iPrivData->iBitmap;
+    	delete iPrivData->iMask;
+    	delete iPrivData; 	
+    	}
+    }
+
+CAlfSymbianBufferDrawer* CAlfSymbianBufferDrawer::NewL()
+    {
+    CAlfSymbianBufferDrawer* self = new (ELeave) CAlfSymbianBufferDrawer;
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    return self;
+    }
+    
+void CAlfSymbianBufferDrawer::ConstructL()
+    {
+    iPrivData = new (ELeave) TPrivData;
+    Mem::FillZ(iPrivData, sizeof(TPrivData));
+    }
+
+
+EXPORT_C void CAlfSymbianBufferDrawer::ReleaseDrawer()
+    {
+    delete this;
+    }
+
+EXPORT_C void CAlfSymbianBufferDrawer::DrawBuffer(CBitmapContext& aContext, const TPoint& aPos, const TRect& aRect)
+    {
+    if (iPrivData && iPrivData->iBitmap)
+        {
+        aContext.BitBlt(aPos,iPrivData->iBitmap, aRect);
+        }
+    }
+
+EXPORT_C void CAlfSymbianBufferDrawer::DrawBufferMasked(CBitmapContext& aContext, const CFbsBitmap* aMask,const TPoint& aPos, const TRect& aRect)
+    {
+    if (iPrivData && iPrivData->iBitmap && aMask)
+        {
+        aContext.BitBltMasked(aPos,iPrivData->iBitmap, aRect,aMask, EFalse);
+        }
+    else
+        {
+        DrawBuffer(aContext, aPos, aRect);
+        }    
+    }
+    
+EXPORT_C void CAlfSymbianBufferDrawer::GetBufferBitmaps(CFbsBitmap*& aBitmap, CFbsBitmap*& aMask) const
+    {
+    if (iPrivData)
+    	{
+    	if (iPrivData->iBitmap)
+    		{
+    		aBitmap = iPrivData->iBitmap;
+    		}
+    	if (iPrivData->iMask)
+    		{
+    		aMask = iPrivData->iMask;
+    		}
+    	}
+    }        
+    
+void CAlfSymbianBufferDrawer::SetBufferL(TInt aBitmapHandle, TInt aMaskHandle)
+    {
+    __ASSERT_DEBUG(iPrivData, USER_INVARIANT());
+    if (iPrivData && iPrivData->iBitmap)
+        {
+        delete iPrivData->iBitmap;
+        iPrivData->iBitmap = NULL;
+        }
+    if (iPrivData && iPrivData->iMask)
+        {
+        delete iPrivData->iMask;
+        iPrivData->iMask = NULL;
+        }
+ 
+ 
+    if (aBitmapHandle)
+        {
+        iPrivData->iBitmap = new (ELeave) CFbsBitmap;
+        User::LeaveIfError(iPrivData->iBitmap->Duplicate(aBitmapHandle));
+        }
+    if (aMaskHandle)
+        {
+        iPrivData->iMask = new (ELeave) CFbsBitmap;
+        User::LeaveIfError(iPrivData->iMask->Duplicate(aMaskHandle));
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alftextstyle.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1154 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Text style
+*
+*/
+
+
+
+#include <AknFontProvider.h>
+#include "alf/alftextstyle.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alftextstylemanager.h"
+#include "alf/alftexturemanager.h"
+#include "alf/alfbitmapprovider.h"
+#include "alf/alfenv.h"
+#include "alflogger.h"
+#include "alf/alfconstants.h"
+#include "uiacceltk/HuiFont.h"
+
+/**
+ * Constants that are uset to set/reset local definition flags.
+ * Local definition flags describe which text style attributes are set/defined
+ * locally in this particular text style, and which cascade from the parent.
+ */
+const TInt  KTextColorDefined =         0x00000001;
+//const TInt  KBackgroundColorDefined =   0x00000002;
+const TInt  KTextSizeDefined =          0x00000004;
+const TInt  KUnderlineDefined =         0x00000008;
+const TInt  KStrikeThroughDefined =     0x00000010;
+const TInt  KStrokeWeightDefined =      0x00000020;
+const TInt  KPostureDefined =           0x00000040;
+const TInt  KFontDefined =              0x00000080;
+
+#ifndef ALF_RASTER_TEXT
+
+
+// Private data
+struct CAlfTextStyle::TPrivateData
+    {
+    CAlfTextStyleManager* iManager; // Not owned.
+    CAlfGenComponent* iComms;       // Owned.
+    TInt iId; // Owned.
+    TInt iParentId; // Owned.
+    TInt iFontStyleId; // Owned
+    TInt iLocalDefinitionFlags; // Owned.
+    TRgb iTextColor; // Owned.
+    TBool iIsUnderline; // Owned.
+    TBool iIsStrikeThrough; // Owned.
+    TBool iIsPreconfigured; // Owned.
+    TInt iServerHandle; // Serverside id
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfTextStyle::CAlfTextStyle()
+	: iData(NULL)
+	{
+	}
+    
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfTextStyle::~CAlfTextStyle()
+	{
+    if(iData)
+	    {
+    	delete iData->iComms;
+    	iData->iComms = NULL;
+	    }
+	delete iData;
+	iData = NULL;
+	}
+
+// ---------------------------------------------------------------------------
+// Constructs a new CAlfTextStyle object
+// ---------------------------------------------------------------------------
+//
+CAlfTextStyle* CAlfTextStyle::NewL(CAlfEnv& aEnv, TInt aId, TInt aImplementationId, const TDesC8& aConstructionParams)
+	{
+	CAlfTextStyle* self = CAlfTextStyle::NewLC(aEnv, aId, aImplementationId, aConstructionParams);        
+    CleanupStack::Pop(self);
+    return self;			
+	}
+
+// ---------------------------------------------------------------------------
+// Constructs a new CAlfTextStyle object
+// ---------------------------------------------------------------------------
+//
+CAlfTextStyle* CAlfTextStyle::NewLC(CAlfEnv& aEnv, TInt aId, TInt aImplementationId, const TDesC8& aConstructionParams)
+	{
+	CAlfTextStyle* self = new( ELeave ) CAlfTextStyle();
+    CleanupStack::PushL(self);
+    self->ConstructL(aEnv, aId, aImplementationId, aConstructionParams);
+    return self;			
+	}
+
+// ---------------------------------------------------------------------------
+// Return font style id
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTextStyle::FontStyleId() const
+    {
+	return iData->iFontStyleId;
+    }
+    
+// ---------------------------------------------------------------------------
+// Set font style id
+// ---------------------------------------------------------------------------
+//
+void CAlfTextStyle::SetFontStyleId(TInt aFontStyleId)
+    {
+	iData->iFontStyleId = aFontStyleId;
+    
+    // The changes are not reflected in Hitchcockcore because Hitchcockcore
+    // text style object does not store this info        
+    }
+    
+// ---------------------------------------------------------------------------
+// Return parent id
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTextStyle::ParentId() const
+    {
+	return iData->iParentId;
+    }
+    
+// ---------------------------------------------------------------------------
+// Set parent id
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextStyle::SetParentId(TInt aParentId)
+    {
+    if(!iData->iIsPreconfigured)
+        {
+        iData->iParentId = aParentId;
+        
+        // Reflect the changes also in Hitchcockcore        
+        // Convert the parent id from client domain to session domain.
+    	CAlfTextStyle* parentStyle = iData->iManager->TextStyle(aParentId);    	        
+	    TPckgC<TInt> buf(parentStyle->Comms()->Identifier());
+	    TBuf8<1> dum;
+	    
+	    TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleSetParent, buf, dum);
+	
+	    if ( err != KErrNone )
+	        {
+	        __ALFLOGSTRING1( "CAlfTextStyle::SetParentId panic error %d", err )
+	        User::Invariant();
+	        }        
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// Return Id
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTextStyle::Id() const
+    {
+	return iData->iId;
+    }
+    
+// ---------------------------------------------------------------------------
+// Return text color
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TRgb CAlfTextStyle::TextColor() const
+    {
+	if(iData->iIsPreconfigured)
+		{
+	    TBufC8<1> inDum;
+	    TRgb textColor;
+	    TPckg<TRgb> outBuf(textColor);
+	    
+	    TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleTextColor, inDum, outBuf);
+	    
+	    if ( err != KErrNone )
+	        {
+	        __ALFLOGSTRING1( "CAlfTextStyle::TextColor ignore error %d", err )
+	        } 
+	        
+	    return textColor;	
+		}
+    if(iData->iLocalDefinitionFlags & KTextColorDefined)
+        {
+        return iData->iTextColor;
+        }
+    return iData->iManager->TextStyle(iData->iParentId)->TextColor();
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the color of the text rasterized with this style.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextStyle::SetTextColor(const TRgb& aTextColor)
+    {
+    if(!iData->iIsPreconfigured)
+        {
+        iData->iTextColor = aTextColor;
+        iData->iLocalDefinitionFlags |= KTextColorDefined;
+        
+        TPckgC<TRgb> buf(aTextColor);
+        TBuf8<1> dum;
+        
+        TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleSetTextColor, buf, dum);
+
+        if ( err != KErrNone )
+            {
+            __ALFLOGSTRING1( "CAlfTextStyle::SetTextColor panic error %d", err )
+            User::Invariant();
+            }     
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns the text size of this style in screen size independent units (twips).
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTextStyle::TextSizeInTwips(TBool aIsDecoratedSize) const
+    {
+    TInt textSizeInTwips = 0;
+    
+    TPckgC<TInt> buf(aIsDecoratedSize);
+    TPckg<TInt> outBuf(textSizeInTwips);
+    
+    TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleSizeInTwips, buf, outBuf);
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextStyle::TextSizeInTwips ignore error %d", err )
+        } 
+        
+    return textSizeInTwips;
+    }
+    
+// ---------------------------------------------------------------------------
+// Set text size
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextStyle::SetTextSizeInTwips(TInt aTextSizeInTwips, TBool aIsDecoratedSize)
+    {
+    if(!iData->iIsPreconfigured)
+        {
+        TInt2 params(aTextSizeInTwips, aIsDecoratedSize);
+        TPckgC<TInt2> buf(params);       
+        TBuf8<1> dum;
+        
+        TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleSetTextSizeInTwips, buf, dum);
+
+        if ( err != KErrNone )
+            {
+            __ALFLOGSTRING1( "CAlfTextStyle::SetTextSizeInTwips panic error %d", err )
+            User::Invariant();
+            }     
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Get text size
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTextStyle::TextSizeInPixels(TBool aIsDecoratedSize) const
+	{
+	TInt textSizeInPixels = 0;
+
+    TPckgC<TInt> buf(aIsDecoratedSize);
+	TPckg<TInt> outBuf(textSizeInPixels);
+	
+	TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleSizeInPixels, buf, outBuf);
+	
+	if ( err != KErrNone )
+		{
+	    __ALFLOGSTRING1( "CAlfTextStyle::TextSizeInPixels ignore error %d", err )
+		}
+	        
+	return textSizeInPixels;
+	}
+    
+ // ---------------------------------------------------------------------------
+ // Set text size
+ // ---------------------------------------------------------------------------
+ //
+EXPORT_C void CAlfTextStyle::SetTextSizeInPixels(TInt aTextSizeInPixels, TBool aIsDecoratedSize)
+    {
+    if(!iData->iIsPreconfigured)
+        {
+        TInt2 params(aTextSizeInPixels, aIsDecoratedSize);
+        TPckgC<TInt2> buf(params);   
+        TBuf8<1> dum;
+        
+        TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleSetTextSizeInPixels, buf, dum);
+
+        if ( err != KErrNone )
+            {
+            __ALFLOGSTRING1( "CAlfTextStyle::SetTextSizeInPixels panic error %d", err )
+            User::Invariant();
+            }
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Is bold
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfTextStyle::IsBold() const
+    {
+	TBufC8<1> inDum;
+	TBool isBold = EFalse;
+	TPckg<TBool> outBuf(isBold);
+	
+	TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleIsBold, inDum, outBuf);
+	
+	if ( err != KErrNone )
+		{
+	    __ALFLOGSTRING1( "CAlfTextStyle::IsBold ignore error %d", err )
+		}
+	        
+	return isBold;
+    }
+    
+// ---------------------------------------------------------------------------
+// Set bold
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextStyle::SetBold(TBool aIsBold)
+    {
+    if(!iData->iIsPreconfigured)
+        {
+        TPckgC<TInt> buf(aIsBold);
+        TBuf8<1> dum;
+        
+        TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleSetBold, buf, dum);
+
+        if ( err != KErrNone )
+            {
+            __ALFLOGSTRING1( "CAlfTextStyle::SetBold panic error %d", err )
+            User::Invariant();
+            }
+        }    
+    }
+    
+// ---------------------------------------------------------------------------
+// Is italic
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfTextStyle::IsItalic() const
+    {
+	TBufC8<1> inDum;
+	TBool isItalic = EFalse;
+	TPckg<TBool> outBuf(isItalic);
+	
+	TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleIsItalic, inDum, outBuf);
+	
+	if ( err != KErrNone )
+		{
+	    __ALFLOGSTRING1( "CAlfTextStyle::IsItalic ignore error %d", err )
+		}
+	        
+	return isItalic;
+    }
+    
+// ---------------------------------------------------------------------------
+// Set italic
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextStyle::SetItalic(TBool aIsItalic)
+    {
+    if(!iData->iIsPreconfigured)
+	    {
+	    TPckgC<TInt> buf(aIsItalic);
+	    TBuf8<1> dum;
+	    
+	    TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleSetItalic, buf, dum);
+	
+	    if ( err != KErrNone )
+	        {
+	        __ALFLOGSTRING1( "CAlfTextStyle::SetItalic panic error %d", err )
+	        User::Invariant();
+	        }
+	    }    
+    }
+    
+// ---------------------------------------------------------------------------
+// Is underlined
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfTextStyle::IsUnderline() const
+    {
+	if(iData->iIsPreconfigured)
+		{
+	    TBufC8<1> inDum;
+	    TBool isUnderline = EFalse;
+	    TPckg<TBool> outBuf(isUnderline);
+	    
+	    TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleIsUnderline, inDum, outBuf);
+	    
+	    if ( err != KErrNone )
+	        {
+	        __ALFLOGSTRING1( "CAlfTextStyle::IsUnderline ignore error %d", err )
+	        } 
+	        
+	    return isUnderline;
+		}	
+    if(iData->iLocalDefinitionFlags & KUnderlineDefined)
+        {
+        return iData->iIsUnderline;
+        }
+    return iData->iManager->TextStyle(iData->iParentId)->IsUnderline();
+    }
+    
+// ---------------------------------------------------------------------------
+// Set underlined
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextStyle::SetUnderline(TBool aIsUnderline)
+    {
+    if(!iData->iIsPreconfigured)
+        {
+        iData->iIsUnderline = aIsUnderline;
+        iData->iLocalDefinitionFlags |= KUnderlineDefined;
+        
+	    TPckgC<TInt> buf(aIsUnderline);
+	    TBuf8<1> dum;
+	    
+	    TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleSetUnderline, buf, dum);
+	
+	    if ( err != KErrNone )
+	        {
+	        __ALFLOGSTRING1( "CAlfTextStyle::SetUnderline panic error %d", err )
+	        User::Invariant();
+	        }
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Is strike through
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfTextStyle::IsStrikeThrough() const
+    {
+	if(iData->iIsPreconfigured)
+		{
+	    TBufC8<1> inDum;
+	    TBool isStrikeThrough = EFalse;
+	    TPckg<TBool> outBuf(isStrikeThrough);
+	    
+	    TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleIsStrikeThrough, inDum, outBuf);
+	    
+	    if ( err != KErrNone )
+	        {
+	        __ALFLOGSTRING1( "CAlfTextStyle::IsStrikeThrough ignore error %d", err )
+	        } 
+	        
+	    return isStrikeThrough;
+		}	
+    if(iData->iLocalDefinitionFlags & KStrikeThroughDefined)
+        {
+        return iData->iIsStrikeThrough;
+        }
+    return iData->iManager->TextStyle(iData->iParentId)->IsStrikeThrough();
+    }
+    
+// ---------------------------------------------------------------------------
+// Set strike through
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextStyle::SetStrikeThrough(TBool aIsStrikeThrough)
+    {
+    if(!iData->iIsPreconfigured)
+        {
+        iData->iIsStrikeThrough = aIsStrikeThrough;
+        iData->iLocalDefinitionFlags |= KStrikeThroughDefined;
+        
+	    TPckgC<TInt> buf(aIsStrikeThrough);
+	    TBuf8<1> dum;
+	    
+	    TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleSetStrikeThrough, buf, dum);
+	
+	    if ( err != KErrNone )
+	        {
+	        __ALFLOGSTRING1( "CAlfTextStyle::SetStrikeThrough panic error %d", err )
+	        User::Invariant();
+	        }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Get the typeface
+// ---------------------------------------------------------------------------
+//
+void CAlfTextStyle::GetTypeface( TTypeface& aTypeface ) const
+	{
+    TBufC8<1> inDum;
+	TPckg<TTypeface> outBuf( aTypeface );
+	
+	TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleGetTypeface, inDum, outBuf);
+	
+	if ( err != KErrNone )
+		{
+	    __ALFLOGSTRING1( "CAlfTextStyle::GetTypeface ignore error %d", err )
+		}
+	        
+	return;
+	}
+	
+// ---------------------------------------------------------------------------
+// Get the typeface
+// ---------------------------------------------------------------------------
+//
+EXPORT_C HBufC* CAlfTextStyle::TypefaceNameL( ) const
+	{
+       TBufC8<1> inDum;
+       TTypeface aTypeface;
+	TPckg<TTypeface> outBuf( aTypeface );
+	
+	TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleGetTypeface, inDum, outBuf);
+	
+	if ( err != KErrNone )
+		{
+	    __ALFLOGSTRING1( "CAlfTextStyle::TypefaceName ignore error %d", err )
+		}
+        return aTypeface.iName.AllocL();	        
+	}
+	
+ // ---------------------------------------------------------------------------
+ // Set Text Pane Height In Pixels
+ // ---------------------------------------------------------------------------
+ //
+EXPORT_C void CAlfTextStyle::SetTextPaneHeightInPixels(TInt aTextPaneHeight, TBool aIsDecoratedSize)
+    {
+    if(!iData->iIsPreconfigured)
+        {
+        TInt2 params(aTextPaneHeight, aIsDecoratedSize);
+        TPckgC<TInt2> buf(params);   
+        TBuf8<1> dum;
+        
+        TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleSetTextPaneHeightInPixels, buf, dum);
+
+        if ( err != KErrNone )
+            {
+            __ALFLOGSTRING1( "CAlfTextStyle::SetTextPaneHeightInPixels panic error %d", err )
+            User::Invariant();
+            }
+        }
+    }
+	
+	
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfTextStyle::ConstructL(CAlfEnv& aEnv, TInt aId, TInt aImplementationId, const TDesC8& aConstructionParams)
+    {
+	if(!iData)
+		{
+	    iData = new (ELeave) TPrivateData;
+	    iData->iComms = NULL;
+	    iData->iId = 0;
+	    iData->iLocalDefinitionFlags = 0;
+	    iData->iManager = 0;
+	    iData->iParentId = 0;
+	    iData->iFontStyleId = 0;
+	    iData->iIsUnderline = EFalse;
+	    iData->iIsStrikeThrough = EFalse;
+	    iData->iIsPreconfigured = EFalse;
+		}
+	
+    if (!iData->iComms)
+        {
+        iData->iComms = CAlfGenComponent::NewL(
+            aEnv,
+            aImplementationId, 
+            0,
+            aConstructionParams);  
+        }    
+    iData->iId = aId;
+    iData->iManager = &aEnv.TextStyleManager();
+    iData->iIsPreconfigured = (aImplementationId == EAlfPreconfiguredTextStyleCreate) ? ETrue : EFalse;
+    iData->iServerHandle = KErrNotFound;
+    }
+
+// ---------------------------------------------------------------------------
+// Return Alf general component instance
+// ---------------------------------------------------------------------------
+//
+CAlfGenComponent* CAlfTextStyle::Comms() const
+	{
+	return iData->iComms;
+	}
+	
+// ---------------------------------------------------------------------------
+// Return serverside id
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTextStyle::ServerHandle() const
+    {
+    if (iData->iServerHandle != KErrNotFound)
+        {
+        return iData->iServerHandle;    
+        }
+    else
+        {
+        TPckg<TInt> buf(iData->iServerHandle);   
+        TBuf8<1> dum;        
+        TInt err = iData->iComms->DoSynchronousCmd(EAlfTextStyleServerHandle, dum, buf);        
+        if ( err != KErrNone )
+            {
+            __ALFLOGSTRING1( "CAlfTextStyle::ServerHandle panic error %d", err )
+            User::Invariant();
+            }
+        return iData->iServerHandle;
+        }            
+    }
+#else
+NONSHARABLE_CLASS(CTextBitmapProvider):public CBase, public MAlfBitmapProvider
+    {
+    public: 
+    virtual void ProvideBitmapL(TInt /*aId*/, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap)
+        {
+        aBitmap = iColorBitmap;
+        iColorBitmap = 0;
+        aMaskBitmap = iAlphaBitmap;
+        iAlphaBitmap= 0;
+        }
+        
+    ~CTextBitmapProvider()
+        {
+        delete iColorBitmap;
+        delete iAlphaBitmap;
+        }
+        
+    CFbsBitmap* iColorBitmap;
+    CFbsBitmap* iAlphaBitmap;
+    };
+    
+// Private data
+struct CAlfTextStyle::TPrivateData
+    {
+    CAlfTextStyleManager* iManager; // Not owned.
+    TInt iId; // Owned.
+    TInt iParentId; // Owned.
+    TInt iFontStyleId; // Owned
+    TInt iLocalDefinitionFlags; // Owned.
+    TRgb iTextColor; // Owned.
+    TBool iIsUnderline; // Owned.
+    TBool iIsStrikeThrough; // Owned.
+    THuiFont iFont; // cool
+    CTextBitmapProvider* iBitmapProvider;
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfTextStyle::CAlfTextStyle()
+	: iData(NULL)
+	{
+	}
+    
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfTextStyle::~CAlfTextStyle()
+	{
+    if(iData)
+	    {
+    	//delete iData->iComms;
+    	//iData->iComms = NULL;
+	    delete iData->iBitmapProvider;
+	    }
+	delete iData;
+	iData = NULL;
+	}
+
+// ---------------------------------------------------------------------------
+// Constructs a new CAlfTextStyle object
+// ---------------------------------------------------------------------------
+//
+CAlfTextStyle* CAlfTextStyle::NewL(CAlfEnv& aEnv, TInt aId, TInt aImplementationId, const TDesC8& aConstructionParams)
+	{
+	CAlfTextStyle* self = CAlfTextStyle::NewLC(aEnv, aId, aImplementationId, aConstructionParams);        
+    CleanupStack::Pop(self);
+    return self;			
+	}
+
+// ---------------------------------------------------------------------------
+// Constructs a new CAlfTextStyle object
+// ---------------------------------------------------------------------------
+//
+CAlfTextStyle* CAlfTextStyle::NewLC(CAlfEnv& aEnv, TInt aId, TInt aImplementationId, const TDesC8& aConstructionParams)
+	{
+	CAlfTextStyle* self = new( ELeave ) CAlfTextStyle();
+    CleanupStack::PushL(self);
+    self->ConstructL(aEnv, aId, aImplementationId, aConstructionParams);
+    return self;			
+	}
+
+// ---------------------------------------------------------------------------
+// Return font style id
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTextStyle::FontStyleId() const
+    {
+	return iData->iFontStyleId;
+    }
+    
+// ---------------------------------------------------------------------------
+// Set font style id
+// ---------------------------------------------------------------------------
+//
+void CAlfTextStyle::SetFontStyleId(TInt aFontStyleId)
+    {
+	iData->iFontStyleId = aFontStyleId;
+    ReportChanged();
+    }
+    
+// ---------------------------------------------------------------------------
+// Return parent id
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTextStyle::ParentId() const
+    {
+	return iData->iParentId;
+    }
+    
+// ---------------------------------------------------------------------------
+// Set parent id
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextStyle::SetParentId(TInt aParentId)
+    {
+    iData->iParentId = aParentId;
+    ReportChanged();
+    }
+
+// ---------------------------------------------------------------------------
+// Return Id
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTextStyle::Id() const
+    {
+	return iData->iId;
+    }
+    
+// ---------------------------------------------------------------------------
+// Return text color
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TRgb CAlfTextStyle::TextColor() const
+    {
+    if(iData->iLocalDefinitionFlags & KTextColorDefined)
+        {
+        return iData->iTextColor;
+        }
+    return iData->iManager->TextStyle(iData->iParentId)->TextColor();
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the color of the text rasterized with this style.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextStyle::SetTextColor(const TRgb& aTextColor)
+    {
+    iData->iTextColor = aTextColor;
+    iData->iLocalDefinitionFlags |= KTextColorDefined;
+    ReportChanged();
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns the text size of this style in screen size independent units (twips).
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTextStyle::TextSizeInTwips(TBool /*aIsDecoratedSize*/) const
+    {
+    TFontSpec spec = Font()->FontSpec();
+    TInt size = spec.iHeight;
+            
+    return size;
+    }
+    
+// ---------------------------------------------------------------------------
+// Set text size
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextStyle::SetTextSizeInTwips(TInt aTextSizeInTwips, TBool /*aIsDecoratedSize*/)
+    {
+	TFontSpec spec = OwnFont()->FontSpec();
+    
+    spec.iHeight = aTextSizeInTwips;
+    Font()->SetFontSpec(spec);
+    iData->iLocalDefinitionFlags |= KTextSizeDefined;
+    ReportChanged();
+    }
+    
+// ---------------------------------------------------------------------------
+// Get text size
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTextStyle::TextSizeInPixels(TBool /*aIsDecoratedSize*/) const
+	{
+    TFontSpec spec = Font()->FontSpec();
+    CWsScreenDevice* screenDevice = CCoeEnv::Static()->ScreenDevice();
+    TInt textsizeInPix = screenDevice->VerticalTwipsToPixels(spec.iHeight);
+            
+    return textsizeInPix;
+ 	}
+    
+ // ---------------------------------------------------------------------------
+ // Set text size
+ // ---------------------------------------------------------------------------
+ //
+EXPORT_C void CAlfTextStyle::SetTextSizeInPixels(TInt aTextSizeInPixels, TBool /*aIsDecoratedSize*/)
+    {
+    TFontSpec spec = OwnFont()->FontSpec(); 
+    CWsScreenDevice* screenDev = CCoeEnv::Static()->ScreenDevice();
+    
+    TInt textsizeInTwips = screenDev->VerticalPixelsToTwips(aTextSizeInPixels);
+    spec.iHeight = textsizeInTwips;
+    Font()->SetFontSpec(spec);
+    iData->iLocalDefinitionFlags |= KTextSizeDefined;
+    ReportChanged();
+	}
+    
+// ---------------------------------------------------------------------------
+// Is bold
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfTextStyle::IsBold() const
+    {
+    TFontSpec spec = Font()->FontSpec();
+    return spec.iFontStyle.StrokeWeight();
+    }
+    
+// ---------------------------------------------------------------------------
+// Set bold
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextStyle::SetBold(TBool aIsBold)
+    {
+    TFontSpec spec = OwnFont()->FontSpec();
+	spec.iFontStyle.SetStrokeWeight((aIsBold ? EStrokeWeightBold : EStrokeWeightNormal));
+    Font()->SetFontSpec(spec);
+    iData->iLocalDefinitionFlags |= KStrokeWeightDefined;    
+    ReportChanged();
+    }
+    
+// ---------------------------------------------------------------------------
+// Is italic
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfTextStyle::IsItalic() const
+    {
+    TFontSpec spec = Font()->FontSpec();
+    return spec.iFontStyle.Posture();
+    }
+    
+// ---------------------------------------------------------------------------
+// Set italic
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextStyle::SetItalic(TBool aIsItalic)
+    {
+    TFontSpec spec = OwnFont()->FontSpec();
+	spec.iFontStyle.SetPosture((aIsItalic ? EPostureItalic : EPostureUpright));
+    Font()->SetFontSpec(spec);
+    iData->iLocalDefinitionFlags |= KPostureDefined;
+    ReportChanged();
+    }
+    
+// ---------------------------------------------------------------------------
+// Is underlined
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfTextStyle::IsUnderline() const
+    {
+    if(iData->iLocalDefinitionFlags & KUnderlineDefined)
+        {
+        return iData->iIsUnderline;
+        }
+    return iData->iManager->TextStyle(iData->iParentId)->IsUnderline();
+    }
+    
+// ---------------------------------------------------------------------------
+// Set underlined
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextStyle::SetUnderline(TBool aIsUnderline)
+    {
+    iData->iIsUnderline = aIsUnderline;
+    iData->iLocalDefinitionFlags |= KUnderlineDefined;
+    ReportChanged();
+    }
+    
+// ---------------------------------------------------------------------------
+// Is strike through
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfTextStyle::IsStrikeThrough() const
+    {
+    if(iData->iLocalDefinitionFlags & KStrikeThroughDefined)
+        {
+        return iData->iIsStrikeThrough;
+        }
+    return iData->iManager->TextStyle(iData->iParentId)->IsStrikeThrough();
+    }
+    
+// ---------------------------------------------------------------------------
+// Set strike through
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextStyle::SetStrikeThrough(TBool aIsStrikeThrough)
+    {
+    iData->iIsStrikeThrough = aIsStrikeThrough;
+    iData->iLocalDefinitionFlags |= KStrikeThroughDefined;
+    ReportChanged();
+    }
+
+// ---------------------------------------------------------------------------
+// Get the typeface
+// ---------------------------------------------------------------------------
+//
+void CAlfTextStyle::GetTypeface( TTypeface& aTypeface ) const
+	{
+    TFontSpec spec = Font()->FontSpec();
+    aTypeface = spec.iTypeface; // Structure copy
+	}
+	
+// ---------------------------------------------------------------------------
+// Get the typeface
+// ---------------------------------------------------------------------------
+//
+EXPORT_C HBufC* CAlfTextStyle::TypefaceNameL( ) const
+	{
+	return Font()->FontSpec().iTypeface.iName.AllocL();
+	}
+	
+ // ---------------------------------------------------------------------------
+ // Set Text Pane Height In Pixels
+ // ---------------------------------------------------------------------------
+ //
+EXPORT_C void CAlfTextStyle::SetTextPaneHeightInPixels(TInt aTextPaneHeight, TBool /*aIsDecoratedSize*/)
+    {
+    TFontSpec oldFontSpec = Font()->FontSpec(); 
+    
+    // now generate a font with the new text pane height 
+    CWsScreenDevice* screenDev = CCoeEnv::Static()->ScreenDevice();
+    TAknFontSpecification aknFs(Font()->Category(), oldFontSpec, screenDev);
+    aknFs.SetTextPaneHeight(aTextPaneHeight);
+
+    // and get its corresponding spec
+    TFontSpec newFontSpec;
+    TInt foundIndex(KErrNotFound);
+    AknFontProvider::GetFontSpecFromMetrics(*screenDev, 0, aknFs, newFontSpec, foundIndex);
+
+    if(foundIndex != KErrNotFound)
+        {
+        TInt textsizeInTwips = screenDev->VerticalPixelsToTwips(newFontSpec.iHeight);
+        newFontSpec.iHeight = textsizeInTwips;
+        OwnFont()->SetFontSpec(newFontSpec);
+        iData->iLocalDefinitionFlags |= KTextSizeDefined;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfTextStyle::RasterizeLineL
+// Rasterizes the given string on to the target texture using this text style.
+// ---------------------------------------------------------------------------
+//
+void CAlfTextStyle::RasterizeLineL(const TDesC& aTextLine, CAlfTexture** aTargetTexture)
+	{
+	// Calculate the pixel extents of the text line.
+	TSize textureSize = LineExtentsL(aTextLine);
+	
+	//TSize maxTextureSize = (*aTargetTexture)->MaxTextureSize();
+
+    if (!iData->iBitmapProvider)
+        {
+        iData->iBitmapProvider = new (ELeave) CTextBitmapProvider();
+        }
+    
+    if ( !iData->iBitmapProvider->iColorBitmap || textureSize != iData->iBitmapProvider->iColorBitmap->SizeInPixels())  
+        {
+        // could resize existing instead..    
+        delete iData->iBitmapProvider->iColorBitmap;
+        iData->iBitmapProvider->iColorBitmap = 0;
+        // Create target alpha bitmap to rasterize the text onto.
+	    iData->iBitmapProvider->iColorBitmap = new (ELeave) CFbsBitmap();    
+	    User::LeaveIfError(iData->iBitmapProvider->iColorBitmap->Create(textureSize, EGray256));
+        }
+	
+	// Create the bitmap device to be used in rasterization.
+    CFbsBitmapDevice* device = CFbsBitmapDevice::NewL(iData->iBitmapProvider->iColorBitmap);
+	CleanupStack::PushL(device);
+	
+	// Create drawing context.
+	CFbsBitGc* gc = 0;
+	User::LeaveIfError(device->CreateContext(gc));
+	CleanupStack::PushL(gc);
+	
+	// Prepare the bitmap for drawing.
+	gc->SetBrushColor(KRgbBlack);
+	gc->Clear();
+	
+	// Draw the text onto the bitmap.    
+	gc->SetPenColor(KRgbWhite);
+		
+	// Do underlining
+	gc->SetUnderlineStyle(IsUnderline() ? EUnderlineOn : EUnderlineOff);
+	// Do strikethrough
+	gc->SetStrikethroughStyle(IsStrikeThrough() ? EStrikethroughOn : EStrikethroughOff);
+	
+	//if(iClippingEnabled)
+	//{
+    //	gc->SetClippingRect(iClipRect);
+	//}
+    
+	// Rasterize text string using the configured font.
+	Font()->RasterizeLineL(aTextLine, *gc);
+	
+	// Destroy graphics context and drawing device.
+	CleanupStack::PopAndDestroy(gc);
+	CleanupStack::PopAndDestroy(device);
+    
+
+	delete iData->iBitmapProvider->iAlphaBitmap;
+	iData->iBitmapProvider->iAlphaBitmap = NULL;
+	
+    // todo: proper flagging, e.g. use directly        
+    *aTargetTexture = &CAlfEnv::Static()->TextureManager().CreateTextureL(KAlfAutoGeneratedTextureId, 
+                                                                        iData->iBitmapProvider,
+                                                                        EAlfTextureFlagDefault); 
+	}
+
+// ---------------------------------------------------------------------------
+// THuiTextStyle::LineExtentsL
+// Provides dimensions of the rasterization of the given string. 
+// ---------------------------------------------------------------------------
+//
+TSize CAlfTextStyle::LineExtentsL(const TDesC& aTextLine)
+	{    
+	// Retrieve the non-decorated line extents from the used font.
+	return Font()->LineExtentsL(aTextLine);
+	}
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfTextStyle::ConstructL(CAlfEnv& aEnv, TInt aId, TInt aImplementationId, const TDesC8& /*aConstructionParams*/)
+    {
+	if(!iData)
+		{
+	    iData = new (ELeave) TPrivateData;
+	    iData->iId = 0;
+	    iData->iLocalDefinitionFlags = 0;
+	    iData->iManager = 0;
+	    iData->iParentId = 0;
+	    iData->iFontStyleId = aImplementationId;
+	    iData->iIsUnderline = EFalse;
+	    iData->iIsStrikeThrough = EFalse;
+		iData->iBitmapProvider = 0;
+		}
+	
+/*    if (!iData->iComms)
+        {
+        iData->iComms = CAlfGenComponent::NewL(
+            aEnv,
+            aImplementationId, 
+            0,
+            aConstructionParams);  
+        }*/
+           
+    iData->iId = aId;
+    //iData->iManager = &aEnv.TextStyleManager();
+    //iData->iIsPreconfigured = (aImplementationId == EAlfPreconfiguredTextStyleCreate) ? ETrue : EFalse;
+    //iData->iServerHandle = KErrNotFound;
+    iData->iBitmapProvider = new (ELeave) CTextBitmapProvider();
+    }
+
+CAlfGenComponent* CAlfTextStyle::Comms() const
+	{
+    return 0;
+	}
+	
+TInt CAlfTextStyle::ServerHandle() const
+    {
+    return KErrNotFound;
+    }
+	
+THuiFont* CAlfTextStyle::Font() const
+    {
+    if(iData->iLocalDefinitionFlags & KFontDefined)
+        {
+        return &iData->iFont;
+        }
+        
+    return iData->iManager->TextStyle(iData->iParentId)->Font();
+    }
+    
+THuiFont* CAlfTextStyle::OwnFont()
+    {
+    if(!(iData->iLocalDefinitionFlags & KFontDefined))
+        {
+        SetFont(iData->iManager->TextStyle(iData->iParentId)->Font());
+        }
+    
+    return Font();
+    }
+
+void CAlfTextStyle::SetFont(THuiFont* aFont)
+    {
+    if (aFont)
+        {
+        iData->iFont = *aFont;
+        iData->iLocalDefinitionFlags |= KFontDefined;
+        }
+    else    
+        {
+        iData->iLocalDefinitionFlags &= ~KFontDefined;
+        }
+        
+    ReportChanged();
+    }
+
+void CAlfTextStyle::ReportChanged()
+    {
+    if (iData->iManager)
+        { // when creating platform style, manager is not ready yet
+        iData->iManager->RefreshVisuals(iData->iId);    
+        }
+    }
+
+void CAlfTextStyle::SetManager(CAlfTextStyleManager* aManager)
+    {
+    iData->iManager = aManager;
+    }
+#endif	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alftextstylemanager.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,645 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Text style manager
+*
+*/
+
+
+#include <avkon.hrh> // @todo: include proper header file
+#include <AknUtils.h>
+#include <aknappui.h>
+#include <AknLayoutFont.h>
+#include <gdi.h>
+#include <aknlayoutscalable_avkon.cdl.h>
+
+#include "alf/alftextstylemanager.h"
+#include "uiacceltk/HuiFont.h"
+#include "alf/alfbitmapprovider.h"
+#include "alf/alfconstants.h"
+#include "alf/alftextstyle.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alftextvisual.h"
+
+#include <uiacceltk/HuiUtil.h>
+#ifdef ALF_RASTER_TEXT
+
+NONSHARABLE_CLASS(CAlfS60TextStyle): public CAlfTextStyle 
+{
+public:
+    /* Constructors and destructor. */
+
+    /** @beginAPI */
+
+    /**
+     * Default constructor. Create a new S60 specific text style.
+     *
+     * @param aParent   A handle id set into the THuiFont by the Texture manager or skin
+     * @param aFontSpec Symbian OS Font Specification to store
+     */
+    static CAlfS60TextStyle* NewL(CAlfEnv& aEnv, TInt aId, TInt aImplementationId, const TDesC8& aConstructionParams)
+        {
+        CAlfS60TextStyle* me = new (ELeave) CAlfS60TextStyle();
+        CleanupStack::PushL(me);
+        me->ConstructL(aEnv, aId, aImplementationId, aConstructionParams);
+        CleanupStack::Pop();
+        me->Init();
+        return me;
+        }
+
+    void Init()
+        {
+        if (!CCoeEnv::Static())
+            {
+            return;
+            }
+		
+        const CAknLayoutFont* font = AknLayoutUtils::LayoutFontFromId(FontStyleId(), NULL);
+        THuiFont huiFont(FontStyleId(), font->FontSpecInTwips());
+    
+        // transfer the text pane height between the different font specs
+        TAknFontSpecification aknFs = font->FontSpecification();
+        huiFont.SetTextPaneHeight(aknFs.TextPaneHeight());
+        SetUnderline(EFalse);
+        SetStrikeThrough(EFalse);
+        SetTextColor(KRgbBlack);
+        SetFont(&huiFont);
+        }
+    };
+
+NONSHARABLE_CLASS(CAlfTextStyleHolder):public CActive
+    {
+    public:
+    CAlfTextStyleHolder(CAlfTextStyle* aTextStyle)
+        :CActive(EPriorityNormal), iTextStyle(aTextStyle)
+        {
+        CActiveScheduler::Add(this);
+        }
+    
+    ~CAlfTextStyleHolder()
+        {
+        Cancel();
+        delete iTextStyle;
+        iVisuals.Reset();
+        }
+    
+    void RemoveReference(CAlfTextVisual* aUser)
+        {
+        for (TInt i = iVisuals.Count() -1; i >= 0; i--)
+            {
+            if (aUser == iVisuals[i])
+                {
+                iVisuals.Remove(i);
+                }
+            }
+        }
+    
+    void RefreshMesh()
+        {
+        if (!IsActive())
+            {
+            SetActive();
+            TRequestStatus* sptr = &iStatus;
+            User::RequestComplete(sptr, KErrNone);
+            }
+        }
+
+    void DoRefreshMesh()
+        {
+        for (TInt p = iVisuals.Count()-1; p >= 0; p--)
+            {
+            iVisuals[p]->PrepareForUpdateMesh();
+            }
+    
+        for (TInt i = iVisuals.Count()-1; i >= 0; i--)
+            {
+            iVisuals[i]->UpdateMesh(ETrue);
+            }
+        }
+    
+    void ReleaseMesh()
+        {
+        for (TInt i = iVisuals.Count()-1; i >= 0; i--)
+            {
+            iVisuals[i]->ReleaseMesh();
+            }        
+
+        }
+        
+    void RunL()
+        {
+        if( iStatus.Int() != KErrCancel )
+            {
+            DoRefreshMesh();
+            }
+        }
+    
+    void DoCancel()
+        {
+        }
+    
+    TInt AddReference(CAlfTextVisual* aUser)
+        {
+        return iVisuals.InsertInAddressOrder(aUser);
+        }
+    
+    CAlfTextStyle* iTextStyle;
+    RPointerArray<CAlfTextVisual> iVisuals;
+    };
+
+#else
+const TUint KPreconfiguredTextStyleCount = 10;
+#endif
+
+// Private structure
+struct CAlfTextStyleManager::TPrivateData
+    {
+	/** Current Alf environment. */
+    CAlfEnv* iEnv;  // Not owned.
+    /** Array of alf text style objects. */
+#ifdef ALF_RASTER_TEXT
+    RPointerArray<CAlfTextStyleHolder> iTextStyles; // Owned.
+#else	
+    RPointerArray<CAlfTextStyle> iTextStyles; // Owned.
+#endif
+    };
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfTextStyleManager::CAlfTextStyleManager()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfTextStyleManager::~CAlfTextStyleManager()
+    {
+	// Free the alf text styles array.
+	if(iData)
+		{
+		iData->iTextStyles.ResetAndDestroy();
+		}
+	
+	// Delete the private data.
+	delete iData;
+	iData = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// 2-phased constructor.
+// ---------------------------------------------------------------------------
+//
+CAlfTextStyleManager* CAlfTextStyleManager::NewL(CAlfEnv& aEnv)
+    {
+    CAlfTextStyleManager* self = CAlfTextStyleManager::NewLC(aEnv);
+    CleanupStack::Pop( self );
+    return self;    
+    }
+
+// ---------------------------------------------------------------------------
+// 2-phased constructor. Object stays on the stack.
+// ---------------------------------------------------------------------------
+//
+CAlfTextStyleManager* CAlfTextStyleManager::NewLC(CAlfEnv& aEnv)
+    {
+    CAlfTextStyleManager* self = new( ELeave ) CAlfTextStyleManager;
+    CleanupStack::PushL( self );
+    self->ConstructL(aEnv);
+    return self;    
+    }
+
+// ---------------------------------------------------------------------------
+// Creates new platform style
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTextStyleManager::CreatePlatformTextStyleL(
+    TInt aFontStyleId, TInt aParentId)
+    {	
+    return DoCreatePlatformTextStyleL(aFontStyleId, aParentId, EAlfPlatformTextStyleCreate);
+    }
+
+// ---------------------------------------------------------------------------
+// Creates new platform style
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTextStyleManager::CreatePlatformTextStyleL(
+    TInt aParentId)
+    {	
+    CAlfTextStyle* parentStyle = TextStyle(aParentId);
+    TInt parentStyleFontId = parentStyle->FontStyleId();
+    return DoCreatePlatformTextStyleL(parentStyleFontId, aParentId, EAlfPlatformTextStyleCreate);
+    }
+
+// ---------------------------------------------------------------------------
+// Return text style for given ID
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTextStyle* CAlfTextStyleManager::TextStyle(TInt aId)
+    {
+#ifdef ALF_RASTER_TEXT
+    if(aId >= 0 && aId < iData->iTextStyles.Count())
+	    {
+	    __ASSERT_DEBUG( iData->iTextStyles[aId]->iTextStyle, USER_INVARIANT() );
+    	return iData->iTextStyles[aId]->iTextStyle;
+	    }
+
+    return iData->iTextStyles[EAlfTextStyleNormal]->iTextStyle;	
+
+#else
+    if(aId >= 0 && aId < iData->iTextStyles.Count())
+	    {
+	    __ASSERT_DEBUG( iData->iTextStyles[aId], USER_INVARIANT() );
+    	return iData->iTextStyles[aId];
+	    }
+
+    return iData->iTextStyles[EAlfTextStyleNormal];	
+#endif
+    }
+
+CAlfTextStyle* CAlfTextStyleManager::SwitchTextStyle(TInt aStyle, CAlfTextVisual* aVisual)
+    {
+#ifdef ALF_RASTER_TEXT
+    CAlfTextStyle* newStyle = iData->iTextStyles[EAlfTextStyleNormal]->iTextStyle;
+    
+    if(aStyle >= 0 && aStyle < iData->iTextStyles.Count())
+        {
+        newStyle = iData->iTextStyles[aStyle]->iTextStyle;
+        }
+     if (iData->iTextStyles[aStyle]->AddReference(aVisual) == KErrNone)
+         {
+         if(newStyle != iData->iTextStyles[aVisual->TextStyle()]->iTextStyle )
+             {
+             iData->iTextStyles[aVisual->TextStyle()]->RemoveReference(aVisual);                       
+             }
+         }
+    return newStyle;
+#else
+	return 0;
+#endif
+    }
+
+void CAlfTextStyleManager::Unregister(CAlfTextVisual* aVisual)
+    {
+#ifdef ALF_RASTER_TEXT
+    TInt style = aVisual->TextStyle();
+    if(style >= 0 && style < iData->iTextStyles.Count())
+        {
+        iData->iTextStyles[style]->RemoveReference(aVisual);                       
+        }
+
+#else
+    return;
+#endif
+    }
+
+void CAlfTextStyleManager::RefreshVisuals(TInt aStyle)
+    { // called by text style it self so queue request as such
+#ifdef ALF_RASTER_TEXT
+    if (aStyle >= iData->iTextStyles.Count())
+        return;
+    iData->iTextStyles[aStyle]->RefreshMesh();
+#else
+    return;
+#endif    
+    }
+
+
+void CAlfTextStyleManager::ReleaseAllVisuals()
+    { // called by CAlfEnv::Release to get all the text visuals to destroy their textures
+      // Those textures can not recreate themselves because missing bitmapprovider but need 
+      // to be rebuild by AlfTextVisual when client calls CAlfEnv::RestoreL
+#ifdef ALF_RASTER_TEXT
+    for(TInt i = 0 ; i < iData->iTextStyles.Count() ; i++ )
+        {
+        iData->iTextStyles[i]->ReleaseMesh();
+        }
+#else
+    return;
+#endif    
+    }
+
+void CAlfTextStyleManager::RefreshAllVisuals()
+    { // called by CAlfEnv::RestoreL to get all the text visuals to rebuild themselves
+#ifdef ALF_RASTER_TEXT
+    for(TInt i = 0 ; i < iData->iTextStyles.Count() ; i++ )
+        {
+        iData->iTextStyles[i]->RefreshMesh();
+        }
+#else
+    return;
+#endif
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// Creates a new text style object that is identical with the given source
+// text style.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTextStyleManager::CopyTextStyleL(TInt aSourceId)
+    {
+#ifdef ALF_RASTER_TEXT
+    CAlfTextStyle* sourceStyle = TextStyle(aSourceId);
+    const TInt freeSlot = FindFreeSlotIndex();
+        
+    // Create alf text style object.
+    CAlfTextStyle* textStyle = 
+        CAlfTextStyle::NewL(
+            *iData->iEnv, 
+            (freeSlot != KErrNotFound ) ? freeSlot : iData->iTextStyles.Count(), 
+            sourceStyle->FontStyleId(), 
+            KNullDesC8);
+    
+    // Set the parent id of the text style.
+    textStyle->SetParentId(sourceStyle->ParentId());
+
+    // Store the font style id of the text style
+    textStyle->SetFontStyleId(sourceStyle->FontStyleId());
+    
+    CleanupStack::PushL(textStyle);
+    CAlfTextStyleHolder* holder = new (ELeave) CAlfTextStyleHolder(textStyle);
+    CleanupStack::PushL(holder);
+
+    if ( freeSlot != KErrNotFound )
+        {
+        iData->iTextStyles[freeSlot] = holder;
+        }
+    else
+        {
+        // Append the specified text style into the array of styles.
+        iData->iTextStyles.AppendL(holder);  
+        }
+
+    CleanupStack::Pop(2);
+
+#else
+    CAlfTextStyle* sourceStyle = TextStyle(aSourceId);
+    TInt parentId = sourceStyle->ParentId();
+
+	// Create construction parameters for alf text style object.
+    TInt params(sourceStyle->Comms()->Identifier());
+    TPckgC<TInt> paramBuf(params);
+    
+    const TInt freeSlot = FindFreeSlotIndex();
+        
+    // Create alf text style object.
+    CAlfTextStyle* textStyle = 
+        CAlfTextStyle::NewL(
+            *iData->iEnv, 
+            (freeSlot != KErrNotFound ) ? freeSlot : iData->iTextStyles.Count(), 
+            EAlfPlatformTextStyleCopy, 
+            paramBuf);
+    
+    // Set the parent id of the text style.
+    textStyle->SetParentId(parentId);
+
+    if ( freeSlot != KErrNotFound )
+        {
+        iData->iTextStyles[freeSlot] = textStyle;
+        }
+    else
+        {
+        // Append the specified text style into the array of styles.
+        iData->iTextStyles.AppendL(textStyle);	
+        }	
+
+#endif
+    // Return the id of the created text style.
+    return textStyle->Id();
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTextStyleManager::DeleteTextStyle(TInt aId)
+    {
+    if ( aId >= iData->iTextStyles.Count() )
+        {
+        return KErrArgument;
+        }
+    
+    // Cannot delete platform styles from an application.
+#ifdef ALF_RASTER_TEXT
+    CAlfTextStyle* deletedStyle = iData->iTextStyles[aId]->iTextStyle;
+    
+    if (dynamic_cast<CAlfS60TextStyle*>(deletedStyle)) // is platform style
+#else
+    
+    CAlfTextStyle* deletedStyle = iData->iTextStyles[aId];
+
+    if ( aId >= 0 && aId < KPreconfiguredTextStyleCount )
+#endif
+        {
+        return KErrAccessDenied;
+        }
+    
+    if ( deletedStyle )
+        {
+        delete deletedStyle;
+        iData->iTextStyles[aId] = NULL; // NULL the slot for later usage.
+        }
+    else
+        {
+        return KErrArgument;
+        }
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor.
+// ---------------------------------------------------------------------------
+//
+void CAlfTextStyleManager::ConstructL(CAlfEnv& aEnv)
+    {
+    iData = new (ELeave) TPrivateData;
+    
+    // Fill data
+    iData->iEnv = &aEnv;
+    
+    // Construct CAlfTextStyle representations from preconfigured text styles
+    ConstructPreconfiguredStylesL();
+    }
+
+// ---------------------------------------------------------------------------
+// Constructs CAlfTextStyle representations from build in preconfigured
+// text styles
+// ---------------------------------------------------------------------------
+//
+void CAlfTextStyleManager::ConstructPreconfiguredStylesL()
+	{
+#ifdef ALF_RASTER_TEXT
+    // create default parent for all styles for all
+    CreatePlatformTextStyleL( EAknLogicalFontPrimaryFont, -1 );    
+    
+    // initialize platform styles
+    CAlfTextStyle* style = 0;
+
+ 	// ENormalItalicFont / no EAlfTextStyleXxx def
+    TInt normalItalicStyleId = CreatePlatformTextStyleL( EAknLogicalFontPrimaryFont, EAlfTextStyleNormal );
+    style = TextStyle(normalItalicStyleId);
+	style->SetItalic(ETrue);
+	
+ 	// EAlfTextStyleMenuItem
+    CreatePlatformTextStyleL( EAknLogicalFontPrimaryFont, EAlfTextStyleNormal );
+	
+ 	// ESmallFont / EHuiTextStyleSmall
+    TInt smallStyleId = CreatePlatformTextStyleL( EAknLogicalFontSecondaryFont, EAlfTextStyleNormal );
+	
+ 	// ESmallFont EHuiTextStyleMenuSmall
+    CreatePlatformTextStyleL( EAknLogicalFontSecondaryFont, smallStyleId );
+	
+ 	// ENormalBoldFont / EAlfTextStyleMenuTitle 
+    TInt normalBoldStyleId = CreatePlatformTextStyleL( EAknLogicalFontPrimaryFont, EAlfTextStyleNormal );
+    style = TextStyle(normalBoldStyleId);
+	style->SetBold(ETrue);
+	
+ 	// ELargeFont / EAlfTextStyleLarge
+    CreatePlatformTextStyleL( EAknLogicalFontTitleFont, EAlfTextStyleNormal );
+	
+    // ESoftkeyFont / EAlfTextStyleSoftkey
+    /*TInt softkeyStyleId =*/ CreatePlatformTextStyleL( EAknLogicalFontTitleFont, EAlfTextStyleNormal );
+	
+    // EAlfTextStyleSupplement
+    CreatePlatformTextStyleL( EAknLogicalFontPrimaryFont, EAlfTextStyleNormal );
+	
+    // EAlfTextStyleTitle
+    /*iLastBuiltInStyleId =*/ CreatePlatformTextStyleL( EAknLogicalFontTitleFont, EAlfTextStyleNormal );
+
+#else
+	for(TUint i = 0; i < KPreconfiguredTextStyleCount; ++i)
+		{
+		// Create construction parameters for alf text style object.
+	    TPckgC<TInt> paramBuf(iData->iTextStyles.Count());    
+	    
+		// Create the new text style.
+	    CAlfTextStyle* textStyle = 
+	        CAlfTextStyle::NewL(
+	            *iData->iEnv, 
+	            iData->iTextStyles.Count(), 
+	            EAlfPreconfiguredTextStyleCreate, 
+	            paramBuf);
+	    	
+	    // Append the specified text style into the array of styles.
+	    iData->iTextStyles.AppendL(textStyle);		
+		}
+#endif
+	}
+
+// ---------------------------------------------------------------------------
+// Finds a free slot
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTextStyleManager::FindFreeSlotIndex() const
+    {
+    TInt index = KErrNotFound;
+    for ( TInt i = iData->iTextStyles.Count() -1 ; i >= 0; i-- )
+        {
+        if ( !iData->iTextStyles[i] )
+            {
+            index = i;
+            break;
+            }
+        }
+    return index;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Internal implementation to create a platform style.
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTextStyleManager::DoCreatePlatformTextStyleL(TInt aFontStyleId, TInt aParentId, TInt aImplementationId)
+    {
+#ifdef ALF_RASTER_TEXT
+    // Create construction parameters for alf text style object.
+    CAlfTextStyle* parentStyle = 0;
+    if (iData->iTextStyles.Count())
+        {
+        parentStyle = TextStyle(aParentId);
+        }
+    
+    const TInt freeSlot = FindFreeSlotIndex();
+        
+    // Create alf text style object.
+    CAlfS60TextStyle* textStyle = 
+        CAlfS60TextStyle::NewL(
+            *iData->iEnv, 
+            (freeSlot != KErrNotFound ) ? freeSlot : iData->iTextStyles.Count(), 
+            aFontStyleId, 
+            KNullDesC8);
+    
+    if ( parentStyle )
+        {// Set the parent id of the text style.
+        textStyle->SetParentId(parentStyle->Id());
+        }
+    
+    CleanupStack::PushL(textStyle);
+    CAlfTextStyleHolder* holder = new (ELeave) CAlfTextStyleHolder(textStyle);
+    CleanupStack::PushL(holder);
+
+    if ( freeSlot != KErrNotFound )
+        {
+        iData->iTextStyles[freeSlot] = holder;
+        }
+    else
+        {
+        // Append the specified text style into the array of styles.
+        iData->iTextStyles.AppendL(holder);	
+        }
+
+    CleanupStack::Pop(2);
+
+    textStyle->SetManager(this);
+
+#else
+    // Create construction parameters for alf text style object.
+    CAlfTextStyle* parentStyle = TextStyle(aParentId);
+    TInt2 params(aFontStyleId, parentStyle->Comms()->Identifier());
+    TPckgC<TInt2> paramBuf(params);
+    
+    const TInt freeSlot = FindFreeSlotIndex();
+        
+    // Create alf text style object.
+    CAlfTextStyle* textStyle = 
+        CAlfTextStyle::NewL(
+            *iData->iEnv, 
+            (freeSlot != KErrNotFound ) ? freeSlot : iData->iTextStyles.Count(), 
+            aImplementationId, 
+            paramBuf);
+    
+    // Set the parent id of the text style.
+    textStyle->SetParentId(parentStyle->Id());
+    
+    // Store the font style id of the text style
+    textStyle->SetFontStyleId(aFontStyleId);
+    
+    if ( freeSlot != KErrNotFound )
+        {
+        iData->iTextStyles[freeSlot] = textStyle;
+        }
+    else
+        {
+        // Append the specified text style into the array of styles.
+        iData->iTextStyles.AppendL(textStyle);	
+        }
+
+#endif
+    // Return the id of the created text style.
+    return textStyle->Id();            
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alftexture.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,488 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Texture
+*
+*/
+
+
+
+#include "alf/alftexture.h"
+#include "alf/alfenv.h"
+#include "alf/alftexturemanager.h"
+#include "alfclient.h"
+
+struct CAlfTexture::TPrivateData
+    {
+    TInt iServerSideHandle;
+
+    CAlfEnv* iEnv;
+
+    /** Specify upload behavior - how to convert the bitmap
+      to texture. */
+    TAlfTextureFlags iFlags;
+
+    /** Resource location for the texture. */
+    HBufC* iFileName;
+
+    /** Bitmap content provider. Alternative content (re)loading
+     * mechanism to filenames (loading from a file). */
+    MAlfBitmapProvider* iBitmapProvider; 
+
+    /** A flag to tell if texture is ready to be used */
+    TBool iHasContent;
+
+    TSize iTextureMaxSize;
+
+    TSize iSize;
+
+    TInt iId;
+    
+    TUid iManagerId;
+    
+    TBool iAnimated;
+    
+    TInt iPriority;
+    
+    /** Flags to tell that texture has been released by unloading or release */
+    TInt iReleaseFlags;
+    
+    TAlfTextureAutoSizeParams iAutoSizeParams;
+    
+    TBool iRefCounted;
+    
+    TInt iRefCountingAction;
+    };
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfTexture::CAlfTexture()
+	{
+		
+	}
+
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTexture::~CAlfTexture()
+	{
+	if ( iData )
+	    {
+	    iData->iEnv->Client().TextureDelete(iData->iId, iData->iManagerId.iUid);    
+	    delete iData->iFileName;
+	    iData->iFileName = NULL;
+
+    	CAlfTextureManager* manager = NULL;
+    	if (iData->iManagerId == TUid::Uid(0))
+    	    {
+    	    manager = &iData->iEnv->TextureManager();	        
+    	    }
+    	else
+    	    {
+    	    manager = iData->iEnv->SharedTextureManager(iData->iManagerId);	            
+    	    } 	       
+
+    	if (iData->iId != 0)
+    	    {
+        	manager->RemoveTexture(*this);
+    	    }
+	    }
+	delete iData;
+	iData = NULL;
+	}
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+CAlfTexture* CAlfTexture::NewL(CAlfEnv& aEnv, TUid aManagerUid, TInt aId, 
+    TInt aBitmapHandle, TInt aMaskHandle, TAlfTextureFlags aFlags,TBool aAnimated)
+	{
+	CAlfTexture* self = 
+		CAlfTexture::NewLC(aEnv, aManagerUid, aId, aBitmapHandle, aMaskHandle, aFlags,aAnimated);        
+    CleanupStack::Pop( self );
+    return self;		
+	}
+	
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+CAlfTexture* CAlfTexture::NewLC(CAlfEnv& aEnv, TUid aManagerUid, TInt aId, 
+    TInt aBitmapHandle, TInt aMaskHandle, TAlfTextureFlags aFlags,TBool aAnimated)
+	{
+    CAlfTexture* self = new( ELeave ) CAlfTexture();
+    CleanupStack::PushL( self );
+    self->ConstructL(aEnv, aManagerUid, aId, aBitmapHandle, aMaskHandle, aFlags,aAnimated);
+    return self;	
+	}
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+void CAlfTexture::ConstructL(CAlfEnv& aEnv, TUid aManagerUid, TInt aId, 
+    TInt aBitmapHandle, TInt aMaskHandle, TAlfTextureFlags aFlags, TBool aAnimated)
+	{
+    iData = new (ELeave) TPrivateData;
+    iData->iEnv = &aEnv;
+    iData->iId = aId;
+    iData->iFileName = NULL;
+    iData->iBitmapProvider = NULL;
+    iData->iFlags = aFlags;
+    iData->iTextureMaxSize = TSize(0,0);
+    iData->iManagerId = aManagerUid; 
+    iData->iAnimated = aAnimated;
+    iData->iPriority = EAlfTexturePriorityNormal;
+    iData->iReleaseFlags = 0;
+    iData->iAutoSizeParams = TAlfTextureAutoSizeParams();
+    iData->iRefCounted = EFalse;
+    iData->iRefCountingAction = CAlfTexture::ERefCountingActionUnload;
+    if (aAnimated)
+        {
+        iData->iServerSideHandle = NULL;
+        }
+    else
+        {
+        
+        iData->iServerSideHandle = 
+        	iData->iEnv->Client().TextureCreateL( aId, aBitmapHandle, 
+        	aMaskHandle, aFlags, iData->iManagerId.iUid );    	            
+	    }
+    if (aBitmapHandle != 0 || aMaskHandle != 0)
+        {
+        iData->iHasContent = ETrue;	
+        }
+    else
+        {
+        iData->iHasContent = EFalse;	        
+        }    
+	
+	CAlfTextureManager* manager = NULL;
+	if (iData->iManagerId == TUid::Uid(0))
+	    {
+	    manager = &iData->iEnv->TextureManager();	        
+	    }
+	else
+	    {
+	    manager = iData->iEnv->SharedTextureManager(iData->iManagerId);	            
+	    } 
+	    
+	if (iData->iId != 0)
+	    {
+    	manager->AppendTextureL(this);	        
+	    }
+	}
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+void CAlfTexture::SetServerHandle(TInt aHandle)
+    {
+    iData->iServerSideHandle = aHandle;
+    }
+    
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTexture::ServerHandle() const
+    {
+    return iData->iServerSideHandle;
+    }
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+void CAlfTexture::SetBitmapProvider(MAlfBitmapProvider* aBitmapProvider)
+    {
+    iData->iBitmapProvider = aBitmapProvider;
+    }
+    
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+MAlfBitmapProvider* CAlfTexture::BitmapProvider() const
+    {
+    return iData->iBitmapProvider;                
+    }
+    
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+void CAlfTexture::SetFileNameL(const TFileName & aFileName)
+    {
+    delete iData->iFileName;
+    iData->iFileName = NULL;
+    if (aFileName.Length()>0)
+        {
+        iData->iFileName = aFileName.AllocL();
+        if (iData->iAnimated)
+            {
+            iData->iServerSideHandle = 
+        	iData->iEnv->Client().TextureCreateAnimatedL( iData->iId, 
+            iData->iFlags, iData->iManagerId.iUid,*iData->iFileName );    	            
+            }
+        }       
+    }
+    
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C HBufC* CAlfTexture::FileName() const
+    {
+    return iData->iFileName;                        
+    }
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfTexture::HasContent() const
+    {
+    TBool retVal = EFalse;
+    iData->iEnv->Client().TextureHasContent(retVal, 
+        iData->iId, 
+        iData->iManagerId.iUid);
+    return retVal;                                
+    }
+    
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+void CAlfTexture::SetMaxTextureSize(TSize aTextureMaxSize)
+    {
+    iData->iTextureMaxSize = aTextureMaxSize;    
+    }
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TSize CAlfTexture::MaxTextureSize()
+    {
+    return iData->iTextureMaxSize;    
+    }
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTexture::Id() const
+    {
+    return iData->iId;        
+    }
+    
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+TAlfTextureFlags CAlfTexture::Flags() const
+    {
+    return iData->iFlags;                
+    }
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+void CAlfTexture::SetFlags(TAlfTextureFlags aFlags)
+    {
+    iData->iFlags = aFlags;    
+    }
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+void CAlfTexture::SetSize(TSize aSize)
+    {
+    iData->iSize = aSize;
+    }
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfTexture::IsAnimated() const
+    {
+    return iData->iAnimated;
+    }
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTexture::StartAnimation()
+    {
+    if (iData->iAnimated)
+        {
+        iData->iEnv->Client().TextureStartAnimation( iData->iId );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTexture::StopAnimation()
+    {
+    if (iData->iAnimated)
+        {
+        iData->iEnv->Client().TextureStopAnimation( iData->iId );
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// Sets the texture release priority
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C void CAlfTexture::SetPriority( TInt aPriority )
+    {
+    iData->iPriority = aPriority;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the texture release priority
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C TInt CAlfTexture::Priority() const
+    {
+    return iData->iPriority;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TSize CAlfTexture::Size() const
+    {
+    return iData->iSize;
+    }
+    
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTexture::ReleaseFlags() const
+    {
+    return iData->iReleaseFlags;
+    }
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+void CAlfTexture::SetReleaseFlags(TInt aReleaseFlags) 
+    {
+    iData->iReleaseFlags = aReleaseFlags;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets autosize related parameters.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTexture::SetAutoSizeParams
+    (const TAlfTextureAutoSizeParams& aParams)
+    {
+    TInt err = iData->iEnv->Client().TextureSetAutoSizeParams( iData->iId, 
+        iData->iManagerId.iUid, aParams );
+    if (err == KErrNone)
+        {
+        iData->iAutoSizeParams = aParams;            
+        }    
+    }
+    
+// ---------------------------------------------------------------------------
+// Gets autosize related parameters.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfTextureAutoSizeParams CAlfTexture::AutoSizeParams() const
+    {
+    return iData->iAutoSizeParams;        
+    }
+
+
+
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTexture::EnableRefCounting(TBool aEnable)
+    {
+    iData->iRefCounted = aEnable;
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfTexture::RefCountingEnabled()
+    {
+    return iData->iRefCounted;    
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTexture::SetRefCountingAction(TInt aAction)
+    {
+    iData->iRefCountingAction = aAction;                    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTexture::RefCountingAction() const
+    {
+    return iData->iRefCountingAction;            
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CAlfTextureManager* CAlfTexture::TextureManager()
+    {
+	CAlfTextureManager* manager = NULL;
+	if (iData->iManagerId == TUid::Uid(0))
+	    {
+	    manager = &iData->iEnv->TextureManager();	        
+	    }
+	else
+	    {
+	    manager = iData->iEnv->SharedTextureManager(iData->iManagerId);	            
+	    }
+	return manager;     	               
+    }
+    
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alftextureautosizeparams.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Texture autosize params
+*
+*/
+
+
+
+#include "alf/alftextureautosizeparams.h"
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfTextureAutoSizeParams::TAlfTextureAutoSizeParams() : 
+        iSizeLowerThreshold(EMedium),
+        iSizeUpperThreshold(EMedium),
+        iMinSizeChange(EMedium),
+        iDownsizeSettleThreshold(EMedium)
+    {    
+    };        
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt TAlfTextureAutoSizeParams::SizeLowerThreshold() const
+    {
+    return iSizeLowerThreshold;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void TAlfTextureAutoSizeParams::SetSizeLowerThreshold(TInt aSizeLowerThreshold)
+    {
+    iSizeLowerThreshold = aSizeLowerThreshold;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt TAlfTextureAutoSizeParams::SizeUpperThreshold() const
+    {
+    return iSizeUpperThreshold;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void TAlfTextureAutoSizeParams::SetSizeUpperThreshold(TInt aSizeLowerThreshold)
+    {
+    iSizeUpperThreshold = aSizeLowerThreshold;        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt TAlfTextureAutoSizeParams::MinSizeChange() const
+    {
+    return iMinSizeChange;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void TAlfTextureAutoSizeParams::SetMinSizeChange(TInt aMinSizeChange)
+    {
+    iMinSizeChange = aMinSizeChange;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt TAlfTextureAutoSizeParams::DownsizeSettleThreshold() const
+    {
+    return iDownsizeSettleThreshold;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void TAlfTextureAutoSizeParams::SetDownsizeSettleThreshold(TInt aDownsizeSettleThreshold)
+    {
+    iDownsizeSettleThreshold = aDownsizeSettleThreshold;    
+    }  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alftexturegroup.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,444 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Group of textures.
+*
+*/
+
+
+
+
+#include "alf/alftexturegroup.h"
+#include "alf/alfenv.h"
+#include "alf/alftexture.h"
+
+
+NONSHARABLE_CLASS( CAlfInternalTextureLoadObserver ) : public CBase, public MAlfTextureLoadingCompletedObserver
+    {
+public:
+
+    /**
+     * Static factory method. 
+     * @param aEnv Environment
+     */
+    static CAlfInternalTextureLoadObserver* NewL(CAlfTextureGroup& aTextureGroup);
+
+    /**
+     * Static factory method. 
+     * @param aEnv Environment
+     */
+    static CAlfInternalTextureLoadObserver* NewLC(CAlfTextureGroup& aTextureGroup);
+
+   /**
+     * Destructor
+     */
+    virtual ~CAlfInternalTextureLoadObserver();
+
+   /**
+     * From MAlfTextureLoadingCompletedObserver
+     */
+    void TextureLoadingCompleted(CAlfTexture& aTexture,
+                                TInt aTextureId,
+                                TInt aErrorCode);
+
+private:
+
+   /**
+     * Constructor.
+     */
+    CAlfInternalTextureLoadObserver();
+    
+   /**
+     * Constructor.
+     */
+    void ConstructL(CAlfTextureGroup& aTextureGroup);
+
+private:
+        
+    CAlfTextureGroup* iTextureGroup; // Not owned   
+    };
+
+// Private structure
+struct CAlfTextureGroup::TPrivateData
+    {
+    /** Environment */
+    CAlfEnv* iEnv;                	
+
+    /** Queue of texture group loading observers. */
+    RPointerArray<MAlfTextureGroupLoadingCompletedObserver> iLoadObserverQueue;
+
+    /** Queue of textures of this group. Textures are not owned by this class */
+    RPointerArray<CAlfTexture> iTextures;
+    
+    /** Error */ 
+    TInt iError;
+    
+    /** Flag to enable/disable observing notifications */
+    TBool iObservingNotificationsEnabled;
+    
+    /** Observer for texture laodings */
+    CAlfInternalTextureLoadObserver* iTextureLoadObserver;
+    };
+
+
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTextureGroup::CAlfTextureGroup() 
+	{
+		
+	}
+	
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTextureGroup::~CAlfTextureGroup()
+	{
+    while (Count())
+        {
+        RemoveTexture(Texture(Count()-1));
+        }
+
+	if ( iData )
+	    {
+	    iData->iLoadObserverQueue.Close();	
+	    iData->iTextures.Close();		    
+	    
+	    delete iData->iTextureLoadObserver;
+	    iData->iTextureLoadObserver = NULL;
+	    }	
+
+	delete iData;
+	}
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTextureGroup* CAlfTextureGroup::NewL(CAlfEnv& aEnv)
+	{
+	CAlfTextureGroup* self = CAlfTextureGroup::NewLC(aEnv);        
+    CleanupStack::Pop( self );
+    return self;		
+	}
+	
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTextureGroup* CAlfTextureGroup::NewLC(CAlfEnv& aEnv)
+	{
+    CAlfTextureGroup* self = new( ELeave ) CAlfTextureGroup();
+    CleanupStack::PushL( self );
+    self->ConstructL(aEnv);
+    return self;	
+	}
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureGroup::ConstructL(CAlfEnv& aEnv)
+	{
+    iData = new (ELeave) TPrivateData;    
+    // Zero all data
+    iData->iEnv = &aEnv;
+    iData->iError = KErrNone;
+    iData->iObservingNotificationsEnabled = ETrue;
+    iData->iTextureLoadObserver = NULL;
+    
+    iData->iTextureLoadObserver = CAlfInternalTextureLoadObserver::NewL(*this);    
+	}
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureGroup::AddTextureL(CAlfTexture& aTexture)
+    {
+    if (!IsTextureInGroup(aTexture))
+        {            
+        TBool addLoadObserver = ETrue;
+        for(TInt i = 0; i < Count(); i++)
+          	{
+        	if (iData->iTextures[i]->TextureManager() == aTexture.TextureManager())
+        		{
+                addLoadObserver = EFalse;
+        		break;
+        		}								                       
+            }
+
+        iData->iTextures.Append(&aTexture);
+
+        if (addLoadObserver)
+            {
+            RegisterAsTextureLoadObserverL(aTexture.TextureManager());                        
+            }
+        }            
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureGroup::RemoveTexture(CAlfTexture& aTexture)
+    {
+    if (IsTextureInGroup(aTexture))
+        {            
+        for(TInt i = 0; i < Count(); i++)
+          	{
+        	if (iData->iTextures[i] == &aTexture)
+        		{
+        		iData->iTextures.Remove(i);
+        		iData->iTextures.Compress();
+        		break;
+        		}								                       
+            }                
+
+        TBool removeLoadObserver = ETrue;
+        for(TInt i = 0; i < Count(); i++)
+          	{
+        	if (iData->iTextures[i]->TextureManager() == aTexture.TextureManager())
+        		{
+                removeLoadObserver = EFalse;
+        		break;
+        		}								                       
+            }
+        
+        if (removeLoadObserver)
+            {
+            UnRegisterAsTextureLoadObserver(aTexture.TextureManager());    
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfTextureGroup::IsLoadingCompleted() const
+    {
+    for (TInt i=0; i<Count();i++)
+        {
+        if ((Texture(i).Size() == TSize(0,0)) || !Texture(i).HasContent())
+            {
+            return EFalse;    
+            }
+        }
+    
+    if (Count() == 0)
+        {
+        return EFalse;            
+        }
+        
+    return ETrue;   
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTextureGroup::Count() const
+    {
+    return iData->iTextures.Count();    
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTexture& CAlfTextureGroup::Texture( TInt aIndex ) const
+    {
+    return *iData->iTextures[aIndex];    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureGroup::AddLoadObserverL(MAlfTextureGroupLoadingCompletedObserver& aObserver)
+    {
+    iData->iLoadObserverQueue.Append(&aObserver);            
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureGroup::RemoveLoadObserver(MAlfTextureGroupLoadingCompletedObserver& aObserver)
+    {
+    TInt count = iData->iLoadObserverQueue.Count();
+    for(TInt i = 0; i < count; i++)
+      	{
+    	if (iData->iLoadObserverQueue[i] == &aObserver)
+    		{
+    		iData->iLoadObserverQueue.Remove(i);
+    		iData->iLoadObserverQueue.Compress();
+    		break;
+    		}								                       
+        }                
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureGroup::EnableLoadObservers(TBool aEnable)
+    {
+    iData->iObservingNotificationsEnabled = aEnable;    
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureGroup::NotifyTextureAvailability(CAlfTexture& aTexture,
+                                TInt aErrorCode)
+    {
+    if (IsTextureInGroup(aTexture))
+        {
+        if (aErrorCode != KErrNone)
+            {
+            iData->iError = aErrorCode;    
+            }
+        
+        if (IsLoadingCompleted() && iData->iObservingNotificationsEnabled)
+            {
+            NotifyObservers();    
+            }            
+        }            
+    }
+      
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CAlfTextureGroup::IsTextureInGroup(CAlfTexture& aTexture) const
+    {
+    TInt count = iData->iTextures.Count();
+    for(TInt i = 0; i < Count(); i++)
+      	{
+    	if (iData->iTextures[i] == &aTexture)
+    		{
+    		return ETrue;
+    		}								                       
+        }                
+    return EFalse;    
+    }
+    
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureGroup::NotifyObservers()
+    {
+    TInt count = iData->iLoadObserverQueue.Count();
+    for(TInt i = 0; i < count; i++)
+      	{
+    	iData->iLoadObserverQueue[i]->TextureGroupLoadingCompleted(*this,iData->iError);
+        }                        
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureGroup::RegisterAsTextureLoadObserverL(CAlfTextureManager* aManager)
+    {
+    if (aManager)
+        {
+        aManager->AddLoadObserverL(iData->iTextureLoadObserver);    
+        }        
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureGroup::UnRegisterAsTextureLoadObserver(CAlfTextureManager* aManager)
+    {
+    if (aManager)
+        {
+        aManager->RemoveLoadObserver(iData->iTextureLoadObserver);    
+        }                
+    }
+    
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CAlfInternalTextureLoadObserver* CAlfInternalTextureLoadObserver::NewL(CAlfTextureGroup& aTextureGroup)
+    {
+	CAlfInternalTextureLoadObserver* self = CAlfInternalTextureLoadObserver::NewLC(aTextureGroup);        
+    CleanupStack::Pop( self );
+    return self;		        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CAlfInternalTextureLoadObserver* CAlfInternalTextureLoadObserver::NewLC(CAlfTextureGroup& aTextureGroup)
+    {
+    CAlfInternalTextureLoadObserver* self = new( ELeave ) CAlfInternalTextureLoadObserver();
+    CleanupStack::PushL( self );
+    self->ConstructL(aTextureGroup);
+    return self;	            
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CAlfInternalTextureLoadObserver::~CAlfInternalTextureLoadObserver()
+    {        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CAlfInternalTextureLoadObserver::CAlfInternalTextureLoadObserver()
+    {        
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfInternalTextureLoadObserver::ConstructL(CAlfTextureGroup& aTextureGroup)
+    {
+    iTextureGroup = &aTextureGroup;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfInternalTextureLoadObserver::TextureLoadingCompleted(CAlfTexture& aTexture,
+                                TInt /*aTextureId*/,
+                                TInt aErrorCode)
+    {
+    iTextureGroup->NotifyTextureAvailability(aTexture, aErrorCode);        
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alftexturemanager.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,2303 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Loads textures.
+*
+*/
+
+
+
+#include <e32std.h>
+#include <imageconversion.h>
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+
+#include "alf/alftexturemanager.h"
+#include "alf/alftextureprocessor.h"
+#include "alf/alftexture.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alf/alfutil.h"
+#include "alf/alfbitmapprovider.h"
+#include "alflogger.h"
+
+const TInt KFirstAutoGeneratedTextureId = 0x10000000;
+const TInt KAlfDefaultSizeDimension = 4;
+
+/**
+ * Flag to indicate to use the provided bitmap directly for the texture, without conversion or copying. The bitmaps
+ * should be in the correct format and they shall not be compressed or have duplicated handle.
+ * If the direct bitmap cannot be used, this flag is ignored internally.
+ *
+ * NOTE: This flag is not a public since we cannot guarantee that user does not compress
+ * bitmap or otherwise temper with it after providing it to toolkit. 
+ * But internally we can use this in some cases to speed up the texture upload.
+ *
+ */
+enum
+    {
+    EAlfTextureFlagAllowDirectBitmapUsage = 0x20        
+    };
+
+struct TTextureEntry 
+    {
+    public:
+    	~TTextureEntry()
+        {
+        }
+    	TTextureEntry()                      
+                      : iId(0), iTexture(NULL), iRefCount(-1)
+        {                            
+        }
+    	
+    	TTextureEntry(TInt aId,
+                      CAlfTexture* aTexture)                      
+                      : iId(aId), iTexture(aTexture),iRefCount(-1)
+        {
+        }
+
+    /** The texture id. Set to zero for no id. */
+    TInt iId;
+
+    /** The texture entry. */
+    CAlfTexture* iTexture;
+    
+    /** Reference count. */
+    TInt iRefCount;
+    };
+
+struct TLoadQueueEntry
+    {
+    /** The texture entry that is being loaded. */
+    TTextureEntry iLoading;
+
+    /** The image being loaded has an alpha channel. */
+    TBool iHasAlpha;
+
+    /** The original, non-downscaled size of the image. */
+    TSize iOriginalSize;
+
+    /** Image decoder to load bitmap images. */
+    CImageDecoder* iDecoder;
+
+    /** True, if the texture was already unloaded before it finished
+        loading. */
+    TBool iUnloaded;
+    };
+
+
+// Private structure
+struct CAlfTextureManager::TPrivateData
+    {
+    CAlfEnv* iEnv;              // Not owned.  	
+    
+    /**
+     * Registry of all textures within this toolkit.
+     * Accessed by texture ids (iId). 
+     */
+    RArray<TTextureEntry> iTextures;
+
+    /** Queue of loading tasks. */
+    RArray<TLoadQueueEntry> iLoadQueue;
+
+    /** Queue of loading observers. */
+    RPointerArray<MAlfTextureLoadingCompletedObserver> iLoadObserverQueue;
+
+    /** Queue of state observers. */
+    RPointerArray<MAlfTextureManagerStateChangedObserver> iStateObserverQueue;
+
+    /** Blank texture */
+    CAlfTexture* iBlankTexture;
+
+    /** Path where image files are loaded from. */
+    HBufC* iImagePath;
+    
+    /** State of the texture manager. */
+    TState iState;
+
+    /** Bitmap for loading asynchronously into. */
+    CFbsBitmap* iBitmap;
+
+    /** Mask bitmap for loading alpha channels. */
+    CFbsBitmap* iMaskBitmap;
+
+    /** Open file server session for image loading. */
+    RFs iFs;
+    
+    /** Id of this texture manager. */
+    TUid iManagerId;
+
+    /** Texture processor */
+    CAlfTextureProcessor* iProcessor;
+    
+    /** Texture id auto generation */
+    TInt iAutoGeneratedTextureId;
+    TInt iLowestAutoGeneratedTextureId;
+    TInt iHighestAutoGeneratedTextureId;
+    
+    RPointerArray<MAlfTextureAutoSizeObserver> iAutoSizeObserverQueue;
+    
+    // DEBUG
+    TBool iTextureAutoCounterEnabled;
+    TInt iTextureAutoRecreateCounter;
+    TInt iTextureAutoReloadCounter;
+
+    //...add other member variables...
+    CIdle* iDoomBringer;
+    };
+
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfTextureManager::CAlfTextureManager() : CActive(EPriorityHigh)
+	{
+		
+	}
+	
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfTextureManager::~CAlfTextureManager()
+	{
+	Cancel();
+	if ( iData )
+	    {
+        delete iData->iImagePath;
+	    
+	    delete iData->iBlankTexture;
+	    
+	    RArray<TTextureEntry>& textures = (iData->iTextures);	
+        // Remove all texture entries (from last to first -order)
+        while (textures.Count())
+            {
+            TTextureEntry te = textures[textures.Count()-1];
+            
+            delete te.iTexture; 
+            te.iTexture = NULL;                
+            }
+
+        textures.Close();   
+
+	    iData->iLoadQueue.Close();	    
+    
+	    iData->iLoadObserverQueue.Close();	
+
+	    iData->iStateObserverQueue.Close();	
+	    
+	    iData->iAutoSizeObserverQueue.Close();
+
+        delete iData->iBitmap;
+        delete iData->iMaskBitmap;
+
+        iData->iFs.Close();
+        
+        delete iData->iProcessor;        
+        if (iData->iDoomBringer)
+            iData->iDoomBringer->Cancel();
+        delete iData->iDoomBringer;
+	    }	
+
+	delete iData;
+	}
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfTextureManager* CAlfTextureManager::NewL(CAlfEnv& aEnv, TUid aUid)
+	{
+	CAlfTextureManager* self = CAlfTextureManager::NewLC(aEnv, aUid);        
+    CleanupStack::Pop( self );
+    return self;		
+	}
+	
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+CAlfTextureManager* CAlfTextureManager::NewLC(CAlfEnv& aEnv, TUid aUid)
+	{
+    CAlfTextureManager* self = new( ELeave ) CAlfTextureManager();
+    CleanupStack::PushL( self );
+    self->ConstructL(aEnv, aUid);
+    return self;	
+	}
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::ConstructL(CAlfEnv& aEnv, TUid aUid)
+	{
+    iData = new (ELeave) TPrivateData;
+    
+    // Zero all data
+    iData->iEnv = NULL;  	
+    iData->iTextures.Reset();
+    iData->iLoadQueue.Reset();
+    iData->iLoadObserverQueue.Reset();
+    iData->iAutoSizeObserverQueue.Reset();
+    iData->iBlankTexture = NULL;
+    iData->iImagePath = NULL;
+    iData->iState = EIdle;
+    iData->iBitmap = NULL;
+    iData->iMaskBitmap = NULL;
+    iData->iManagerId = TUid::Uid(0);
+    iData->iProcessor = NULL;
+
+    // Fill data
+    iData->iAutoGeneratedTextureId = KFirstAutoGeneratedTextureId;
+    iData->iLowestAutoGeneratedTextureId = KFirstAutoGeneratedTextureId;
+    iData->iHighestAutoGeneratedTextureId = KMaxTInt;
+    iData->iEnv = &aEnv;    
+    iData->iManagerId = aUid;
+    iData->iBlankTexture = CAlfTexture::NewL(aEnv, aUid);
+    iData->iBitmap = new (ELeave) CFbsBitmap();
+    User::LeaveIfError(iData->iBitmap->Create(
+        TSize(KAlfDefaultSizeDimension, KAlfDefaultSizeDimension), EColor64K));
+    iData->iMaskBitmap = new (ELeave) CFbsBitmap();
+    User::LeaveIfError(iData->iMaskBitmap->Create(
+        TSize(KAlfDefaultSizeDimension, KAlfDefaultSizeDimension), EGray256));	
+    iData->iProcessor = CAlfTextureProcessor::NewL(aEnv); 
+    User::LeaveIfError(iData->iFs.Connect());
+    iData->iDoomBringer = CIdle::NewL(CActive::EPriorityIdle);
+    // DEBUG 
+    iData->iTextureAutoCounterEnabled = EFalse;
+    iData->iTextureAutoRecreateCounter = 0;
+    iData->iTextureAutoReloadCounter = 0;
+    
+    SetImagePathL(_L(""));
+	CActiveScheduler::Add(this);
+	}
+
+// ---------------------------------------------------------------------------
+// Returns env
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfEnv& CAlfTextureManager::Env()
+    {
+    return *iData->iEnv;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns texture with given id
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const CAlfTexture* CAlfTextureManager::Texture(TInt aId) const
+    {
+    TInt index = CheckTexture(aId);
+    if(index == KErrNotFound)
+        {
+        return &BlankTexture();
+        }
+        
+    RArray<TTextureEntry>& textures = (iData->iTextures);	
+    CAlfTexture* texture = textures[index].iTexture;
+    if(texture)
+        {
+        return texture;
+        }
+    else
+        {
+        return &BlankTexture();
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// Returns texture with given id
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTexture* CAlfTextureManager::TextureL(TInt aId)
+    {
+    // try to get the index for the texture id
+    TInt index = CheckTexture(aId);
+    if(index != KErrNotFound)
+        {
+        // texture found
+        RArray<TTextureEntry>& textures = (iData->iTextures);	
+        CAlfTexture* texture = textures[index].iTexture;
+        if(texture == NULL)
+            {
+            User::Leave(KErrNotFound);
+            return NULL;                
+            }
+        return texture;
+        }
+
+    User::Leave(KErrNotFound);
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets image path
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureManager::SetImagePathL(const TDesC& aPath)
+    {
+    delete iData->iImagePath;
+    iData->iImagePath = NULL;
+
+    TParsePtrC parse(aPath);
+    CEikonEnv* coe = CEikonEnv::Static();
+    if (aPath.Length() && !parse.DrivePresent() && coe && coe->EikAppUi() && coe->EikAppUi()->Application())
+        {
+        iData->iImagePath = HBufC::NewL(aPath.Size()+2); // two extra characters for drive
+        TPtr ptr = iData->iImagePath->Des();
+        ptr.Append(coe->EikAppUi()->Application()->AppFullName().Left(2));
+        ptr.Append(aPath);
+        }
+    else
+        {
+        iData->iImagePath = aPath.AllocL();        
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Gets image path
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TDesC& CAlfTextureManager::ImagePath() const
+    {
+    return *iData->iImagePath;        
+    }
+
+
+// ---------------------------------------------------------------------------
+// Returns blank texture.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const CAlfTexture& CAlfTextureManager::BlankTexture() const
+    {
+    return *iData->iBlankTexture;            
+    }
+
+// ---------------------------------------------------------------------------
+// Returns blank texture.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTexture& CAlfTextureManager::BlankTexture()
+    {
+    return *iData->iBlankTexture;            
+    }
+
+// ---------------------------------------------------------------------------
+// DEPRECATED! Load the animated texture based on the Skin name
+// ---------------------------------------------------------------------------
+//
+
+EXPORT_C CAlfTexture& CAlfTextureManager::LoadAnimatedTextureL(const TDesC& /*aSkinAnimName*/,
+                                       TSize /*aTextureMaxSize*/,
+                                       TAlfTextureFlags /*aFlags*/,
+                                       TInt /*aId*/)
+    {
+    __ALFLOGSTRING( "CAlfTextureManager::LoadAnimatedTextureL FUNCTIONALITY REMOVED. REFER TO ANTRIKSH PROJECT" );
+    CAlfTexture* tex = NULL;
+    return *tex;
+    }
+
+// Loads texture.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTexture& CAlfTextureManager::LoadTextureL(const TDesC& aImageName,
+                                       TAlfTextureFlags aFlags,
+                                       TInt aId)
+    {
+    return LoadTextureL(aImageName, TSize(0, 0), aFlags, aId);        
+    }
+
+// ---------------------------------------------------------------------------
+// Loads texture.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTexture& CAlfTextureManager::LoadTextureL(const TInt aId,
+                                       TSize aTextureMaxSize,
+                                       TAlfTextureFlags aFlags)
+    {
+    return LoadTextureL(_L(""), aTextureMaxSize, aFlags, aId);
+    }
+
+// ---------------------------------------------------------------------------
+// Loads texture.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTexture& CAlfTextureManager::LoadTextureL(const TDesC& aImageName,
+                                       TSize aTextureMaxSize,
+                                       TAlfTextureFlags aFlags,
+                                       TInt aId)
+    {    
+    // Clients are not allowed to let toolkit use bitmaps directly. 
+    // We could use it internally if we had separate bitmaps
+    // for each entry.
+    RemoveFlags(aFlags, EAlfTextureFlagAllowDirectBitmapUsage);
+        
+    if (aId == KAlfAutoGeneratedTextureId)
+        {
+        aId = GenerateTextureId();    
+        }    
+    
+    CAlfTexture* tex = NULL;
+    TFileName fileName;
+
+    // Provide an already created texture if such exists.
+    TRAPD(err, tex = TextureL(aId));
+    if(err == KErrNone && tex->HasContent())
+        {
+        return *tex;
+        }
+
+    // If shared texture manager, then check the existense of the texture first.
+    if (IsShared())
+        {
+        // AutoSize is not supported (yet) for shared textures
+        RemoveFlags(aFlags, EAlfTextureFlagAutoSize);
+
+        TBool sharedTextureAlreadyExists = EFalse;
+        iData->iEnv->Client().TextureHasContent(sharedTextureAlreadyExists, 
+            aId, 
+            iData->iManagerId.iUid);
+        
+        // If shared texture already exists, we don't even start to load it.
+        if (sharedTextureAlreadyExists)
+            {
+            TInt bitmapHandle = 0;
+            TInt maskHandle = 0;
+        	
+        	if (iData->iBitmap)
+        		{
+        		bitmapHandle = iData->iBitmap->Handle();
+        		}
+        	
+        	if (iData->iMaskBitmap)	
+        		{
+        		maskHandle = iData->iMaskBitmap->Handle();	
+        		}
+            
+            // Create CAlfTexture instance.
+        	tex = CAlfTexture::NewL( Env(), 
+        	    iData->iManagerId,
+        	    aId, 
+        	    bitmapHandle, 
+        	    maskHandle, 
+        	    aFlags);             
+            
+            if(aImageName.Length() > 0)
+                {
+                // assume relative pathname and prepend the image path to get full filename
+                fileName = aImageName;
+                PrependImagePath(fileName);
+                tex->SetFileNameL(fileName);
+                }
+            
+            tex->SetMaxTextureSize(aTextureMaxSize);
+
+            return *tex;    
+            }            
+        }
+
+    // If the name is invalid, and there was no filename available
+    // based on id, return a dummy texture.
+    if((aImageName.Length() == 0) && (aId == 0))
+        {
+        return BlankTexture();
+        }
+
+    // add path to filename if filename has been passed
+    if(aImageName.Length() > 0)
+        {
+        // assume relative pathname and prepend the image path to get full filename
+        fileName = aImageName;
+        PrependImagePath(fileName);
+        }
+
+    // if no name has been passed as a parameter but
+    // there's and nonzero id has been passed, we
+    // can assume that there's a predefined name available
+    RArray<TTextureEntry>& textures = (iData->iTextures);	
+    RArray<TLoadQueueEntry>& loadqueue = (iData->iLoadQueue);	
+
+    if((aImageName.Length() == 0) && (aId != 0))
+       {
+        // search for a texture filename based on the id.
+        TInt index = CheckTexture(aId);
+        if(index >=0)
+            {
+            tex = textures[index].iTexture;
+            fileName = *tex->FileName();
+            }
+        else
+            {
+            User::Leave(KErrNotFound);
+            }
+       }
+
+    // Reuse pre-existing entries:
+    // try first finding an entry based on id
+    if(!tex && aId > 0)
+        {
+        TInt previouslyLoadedIndex = CheckTexture(aId);
+        if (previouslyLoadedIndex >= 0)
+            {
+            tex = textures[previouslyLoadedIndex].iTexture;
+            }
+        }
+
+    if (!tex)
+        {
+        TInt bitmapHandle = 0;
+        TInt maskHandle = 0;
+
+        // If LoadAnimAsImage flag is set, we don't check the framecount with ImageDecoder!
+        //
+        // This is useful especially when loading multiple large image files
+        // as textures that don't have more then 1 frame.
+        //
+        // Some test results creating the ImageDecoder: 
+        // - Large Leafs.mbm (2,7MB) took apporx. 280ms
+        // - Big bmp (~1,8MB) took ~130ms 
+        // - Normal sized (100-800kb) jpgs and gifs took approx. 25-40ms
+        TInt frameCount = 1;
+        TSize animFrameSize = TSize(0,0);
+        if ( !(aFlags & EAlfTextureFlagLoadAnimAsImage) )
+            {
+            CImageDecoder* decoder = CImageDecoder::FileNewL(iData->iFs, fileName);
+            CleanupStack::PushL(decoder);
+            frameCount = decoder->FrameCount();
+            if (frameCount > 1)
+                {
+                const TFrameInfo& fInfo =  decoder->FrameInfo(0);
+                animFrameSize = fInfo.iOverallSizeInPixels;
+                }
+            CleanupStack::PopAndDestroy();
+            }
+        
+        if (frameCount > 1)
+            {
+            tex = CAlfTexture::NewL(Env(), iData->iManagerId, aId, bitmapHandle, maskHandle, aFlags, ETrue);        
+            tex->SetMaxTextureSize(aTextureMaxSize);
+            tex->SetSize(animFrameSize);
+            tex->SetFileNameL(fileName);
+            return *tex;
+            }
+        else
+            {
+        	if (iData->iBitmap)
+        		{
+    	    	bitmapHandle = iData->iBitmap->Handle();
+    		    }
+    	
+        	if (iData->iMaskBitmap)	
+    		    {
+    		    maskHandle = iData->iMaskBitmap->Handle();	
+    		    }
+        	tex = CAlfTexture::NewL(Env(), iData->iManagerId, aId, bitmapHandle, maskHandle, aFlags);        
+            }
+        }
+    else
+        {
+        // we have a pre-existing texture which is non-null,
+        // but check that the texture is loaded ok, we can also
+        // return unloaded textures that are in the load queue
+        if (tex->HasContent() || tex->IsAnimated() || IsInLoadQueue(tex))
+            {
+            return *(tex);
+            }
+        }
+
+    // replace filename
+    // File names are relative to the image path.
+    tex->SetFileNameL(fileName);
+    tex->SetMaxTextureSize(aTextureMaxSize);
+
+    // Set not released 
+    tex->SetReleaseFlags(CAlfTexture::EReleaseNone);
+
+    // If autosize used and size is set to zero, we don't yet load at all.
+    if (aFlags & EAlfTextureFlagAutoSize)
+        {            
+        if (aTextureMaxSize.iHeight == 0 && aTextureMaxSize.iWidth == 0)
+            {
+            return *tex;    
+            }        
+        }
+        
+    // Prepare for loading by creating a load queue entry.
+    TTextureEntry entry;
+    entry.iTexture = tex;
+    entry.iId = aId;
+
+    TLoadQueueEntry loadqentry;
+    loadqentry.iUnloaded = EFalse;
+    loadqentry.iLoading = entry;
+    loadqentry.iDecoder = NULL;
+
+    // Textures are loaded one at a time, in the order they were requested.
+    loadqueue.AppendL(loadqentry);
+
+    // Start the texture load active object if we're not loading
+    if(iData->iState == EIdle)
+        {
+        // Start loading images..
+        StartLoading();
+        // Notify observers.
+        NotifyStateChange();
+        }
+
+    return *tex;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Creates texture.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTexture& CAlfTextureManager::CreateTextureL(TInt aId,
+                                   MAlfBitmapProvider* aBitmapProvider,
+                                   TAlfTextureFlags aFlags)
+    {    
+    // Clients are not allowed to let toolkit use bitmaps directly. It is used only internally.
+    RemoveFlags(aFlags, EAlfTextureFlagAllowDirectBitmapUsage);
+
+    CAlfTexture* tex = NULL;
+    
+    if (aId == KAlfAutoGeneratedTextureId)
+        {
+        aId = GenerateTextureId();    
+        }    
+
+    CFbsBitmap* bitmap = NULL;
+    CFbsBitmap* maskBitmap = NULL;
+
+    if (aId==0)
+        {
+        User::Leave(KErrArgument);
+        }
+
+    // Provide an already created texture if such exists.
+    TRAPD(err, tex = TextureL(aId));
+    if(err == KErrNone && tex->HasContent())
+        {
+        return *tex;
+        }
+
+    // Call the bitmapProvider method to load the bitmaps
+	if (aBitmapProvider)
+		{
+	    aBitmapProvider->ProvideBitmapL(aId, bitmap, maskBitmap);		
+		}
+					
+	if (!bitmap)
+	    { 
+	    // We leave here, otherwise serverside would panic. 
+	    User::Leave(KErrArgument);    
+	    // Bitmap size is checked and handled in serverside, 
+	    // so that we can create empty textures (size = 0,0)
+	    }
+	    	  
+	// "bitmap" pointer should be valid from now on
+    CleanupStack::PushL(bitmap);
+	TInt bitmapHandle = bitmap->Handle();
+	
+	TInt maskHandle = 0;
+	if (maskBitmap)	
+		{
+		maskHandle = maskBitmap->Handle();	
+	    CleanupStack::PushL(maskBitmap);
+		}
+    
+    // Create CAlfTexture instance, this duplicates the bitmaps to server.
+	if (!tex)
+	    {
+    	tex = CAlfTexture::NewL( Env(), 
+    	                         iData->iManagerId,
+    	                         aId, 
+    	                         bitmapHandle, 
+    	                         maskHandle, 
+    	                         aFlags);	        
+	    }
+	else
+	    {
+	    // texture already exists but it does not have content, this creates content.
+      	iData->iEnv->Client().TextureCreateL( aId, bitmapHandle, 
+        	maskHandle, aFlags, iData->iManagerId.iUid );    	            	        
+	    }    
+		
+	tex->SetBitmapProvider(aBitmapProvider);	
+    tex->SetSize(bitmap->SizeInPixels());
+
+    // Set not released 
+    tex->SetReleaseFlags(CAlfTexture::EReleaseNone);
+	
+	// CAlfTexture has at this point duplicated bitmaps, can be deleted here.        
+	if (maskBitmap)	
+		{
+	    CleanupStack::PopAndDestroy( maskBitmap );
+	    maskBitmap = NULL;		
+		}
+    CleanupStack::PopAndDestroy( bitmap ); 
+	bitmap = NULL;		
+
+    // Notify observers
+    NotifyTextureLoaded(*tex, aId, KErrNone);
+
+    return *tex;
+    }
+
+// ---------------------------------------------------------------------------
+//  Unloads texture
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureManager::UnloadTexture(const TDesC& aImageName)
+    {
+    TInt index = CheckTexture(aImageName);
+    if (index >= 0)
+        {
+        RArray<TTextureEntry>& textures = (iData->iTextures);	
+        TTextureEntry entry = textures[index];        
+        CancelLoadingOfTexture(*entry.iTexture);
+        if (!entry.iTexture->IsAnimated())
+            {
+            iData->iEnv->Client().TextureUnload(entry.iId, iData->iManagerId.iUid);
+            }
+        else
+            {
+            entry.iTexture->StopAnimation();      
+            }
+        
+        TInt releaseFlags = entry.iTexture->ReleaseFlags();
+        releaseFlags |= CAlfTexture::EReleaseFromUnload;
+        entry.iTexture->SetReleaseFlags(releaseFlags);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//  Unloads texture
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureManager::UnloadTexture(TInt aId)
+    {
+    TInt index = CheckTexture(aId);
+    if (index >= 0)
+        {
+        RArray<TTextureEntry>& textures = (iData->iTextures);	
+        TTextureEntry entry = textures[index];        
+		CancelLoadingOfTexture(*entry.iTexture);
+        if (!entry.iTexture->IsAnimated())
+            {
+            iData->iEnv->Client().TextureUnload( aId, iData->iManagerId.iUid );    	                
+            }
+        else
+            {
+            entry.iTexture->StopAnimation();        
+            }           
+        
+        TInt releaseFlags = entry.iTexture->ReleaseFlags();
+        releaseFlags |= CAlfTexture::EReleaseFromUnload;
+        entry.iTexture->SetReleaseFlags(releaseFlags);
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+//  Updates texture content
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureManager::UpdateTextureFromFileL(TInt aId, const TDesC* aFileName)
+    {
+   	RArray<TTextureEntry>& textureEntries = (iData->iTextures);	
+    TInt index = CheckTexture(aId);
+    if (index >= 0)
+        {
+    	TTextureEntry entry = textureEntries[index];
+    	
+    	TFileName fileName;
+    	if (aFileName != NULL)
+    		{
+    		fileName = *aFileName;
+    		}
+    	else if (entry.iTexture->FileName() == NULL)
+    		{
+    		User::Leave(KErrArgument);
+    		}	
+        entry.iTexture->SetBitmapProvider(NULL);
+        
+        // Set non released
+        entry.iTexture->SetReleaseFlags(CAlfTexture::EReleaseNone);
+
+        if (!entry.iTexture->IsAnimated())
+            {
+           	ReloadTextureL(fileName, entry.iTexture->MaxTextureSize(), entry.iTexture->Flags(), 
+               	entry.iTexture->Id());
+            }
+        else
+            {
+            entry.iTexture->StartAnimation();    
+            }    
+        } 
+    else
+    	{
+    	User::Leave(KErrNotFound);
+    	}           
+    }
+    
+// ---------------------------------------------------------------------------
+//  Updates texture content
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureManager::UpdateTextureFromBitmapL(TInt aId, MAlfBitmapProvider* aBitmapProvider)
+    {
+   	RArray<TTextureEntry>& textureEntries = (iData->iTextures);	
+    TInt index = CheckTexture(aId);
+    if (index >= 0)
+        {
+    	TTextureEntry entry = textureEntries[index];
+    	
+    	if (!aBitmapProvider)
+    		{
+    		aBitmapProvider = entry.iTexture->BitmapProvider();
+    		}
+    	TBuf<1> empty;	
+        entry.iTexture->SetFileNameL(empty);
+
+        // Set non released
+        entry.iTexture->SetReleaseFlags(CAlfTexture::EReleaseNone);
+
+        if (!entry.iTexture->IsAnimated())
+            {
+           	RecreateTextureL(entry.iTexture->Id(), aBitmapProvider, entry.iTexture->Flags());
+            }
+        else
+            {
+            entry.iTexture->StartAnimation();     
+            }    
+        }        
+    else
+    	{
+    	User::Leave(KErrNotFound);
+    	}           
+    } 
+    
+    
+// ---------------------------------------------------------------------------
+//  Defines filename for given id.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureManager::DefineFileNameL(TInt aId, const TDesC& aFileName)
+    {
+    if (aId==0)
+        {
+        User::Leave(KErrArgument); // can't specify filename for "no id"
+        }
+
+   	RArray<TTextureEntry>& textures = (iData->iTextures);	
+
+    // Look for an existing entry for the id.
+    for(TInt i = 0; i < textures.Count(); ++i)
+        {
+        if(textures[i].iId == aId)
+            {
+            textures[i].iTexture->SetFileNameL(aFileName);
+            return;
+            }
+        }
+
+    // Otherwise just append to the texture list
+	CAlfTexture* tex = CAlfTexture::NewL( Env(), iData->iManagerId, aId );  
+	tex->SetFileNameL(aFileName);
+    }
+    
+// ---------------------------------------------------------------------------
+// Prepends image path
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureManager::PrependImagePath(TDes& aFileName)
+    {
+    TFileName buf;
+
+    //allow app to load textures from different drive with complete path
+    TParse p1;
+    p1.Set(aFileName,0,0);
+
+    if (p1.DrivePresent())
+        {
+        return;
+        }
+
+
+    if(aFileName.Find(*iData->iImagePath) == KErrNotFound)
+        {
+        buf = *iData->iImagePath;
+        buf.Append(aFileName);
+        aFileName = buf;
+        }
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// CheckTexture
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTextureManager::CheckTexture(const TDesC& aImageName) const
+    {
+    if(aImageName.Length()==0)
+        {
+        // name empty, can't check
+        return KErrNotFound;
+        }
+
+    RArray<TTextureEntry>& textures = (iData->iTextures);	
+    for(TInt i = 0; i < textures.Count(); ++i)
+        {
+        TTextureEntry te = textures[i];
+        // compare against texture manager entry filename (iFileName)
+        if((te.iTexture->FileName() != NULL)
+            && (aImageName.Compare(*(te.iTexture->FileName())) == 0))
+            {
+            return i;
+            }
+        }
+    // not found
+    return KErrNotFound;
+    }
+
+	
+// ---------------------------------------------------------------------------
+// CheckTexture
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTextureManager::CheckTexture(TInt aId) const
+    {
+    RArray<TTextureEntry>& textures = (iData->iTextures);	
+    if(aId <= 0)
+        {
+        // id not defined, can't search
+        return KErrNotFound;
+        }
+    for(TInt i = 0; i < textures.Count(); i++)
+        {
+        if(textures[i].iId == aId)
+            {
+            return i;
+            }
+        }
+    // not found:
+    return KErrNotFound;
+    }
+    
+    
+
+// ---------------------------------------------------------------------------
+// RunError from CActive
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTextureManager::RunError(TInt /*aError*/)
+    {
+    return KErrNone;
+    // Should never be called, RunL is responsible for handling all error cases
+    }
+
+
+// ---------------------------------------------------------------------------
+// RunL from CActive
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::RunL()
+    {
+    // remove the loaded entry from the queue
+    TLoadQueueEntry entry = PopLoadedQueueEntry();
+
+    // Image loading has been completed.
+    iData->iState = EIdle;
+
+    // check status
+    if(iStatus == KErrNone)
+        {
+        // ok, we have a loaded image, but
+        // we still need to do texture uploads
+        // and possibly some image conversions
+        TRAPD( err, ImageLoadingCompleteL(entry) );
+
+        if(err != KErrNone)
+            {
+            // Notify observers about the image upload error
+            NotifyTextureLoaded(*entry.iLoading.iTexture, entry.iLoading.iId, err);
+            }
+        }
+    else
+        {
+        // notify sb of failed image load!
+        NotifyTextureLoaded(*entry.iLoading.iTexture, entry.iLoading.iId, iStatus.Int());
+        }
+
+    StartLoading();
+    }
+
+// ---------------------------------------------------------------------------
+// Cancels asyncronous loading
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::DoCancel()
+    {
+    RArray<TLoadQueueEntry>& loadqueue = (iData->iLoadQueue);	
+    if(loadqueue.Count() > 0)
+        {
+        loadqueue[0].iDecoder->Cancel();
+        }
+    iData->iState = EIdle;
+    }
+
+// ---------------------------------------------------------------------------
+// Starts asyncronous loading
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::StartLoading()
+    {
+    // loop that finds next entry to load
+    while (1)
+        {
+        // try to schedule next image for loading..
+        TRAPD( err, DoLoadNextL() );
+
+        // ok?            
+        if(err != KErrNone)
+            {            
+            // remove the entry from the queue
+            TLoadQueueEntry entry = PopLoadedQueueEntry();
+            // Notify observers about the image loading error
+            NotifyTextureLoaded(*entry.iLoading.iTexture, entry.iLoading.iId, err);            
+            // Image loading has been completed.
+            iData->iState = EIdle;
+            continue;
+            }
+        // leave the loop if we had no trouble scheduling the next
+        // image decode
+        break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Loads texture entry from queue. Mostly this code is copied from 
+// CAlfTextureManager::DoLoadNextL but some adjustmets has been made to support
+// better client server paradigm.
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::DoLoadNextL()
+    {
+    RArray<TLoadQueueEntry>& loadqueue = (iData->iLoadQueue);	
+    // Any loading tasks left?
+    if(loadqueue.Count() == 0)
+        {
+        // No? Notify observers and leave.
+        NotifyStateChange();
+        return; // nothing else to be loaded..
+        }
+
+    // Manager is now busy.
+    iData->iState = ELoading;
+
+    // Fetch a load queue entry
+    TLoadQueueEntry& entry = loadqueue[0];
+    CAlfTexture* texture = entry.iLoading.iTexture;
+
+    // Create a new image decoder for loading the image.
+    TFileName imageFileName = *texture->FileName(); // does not include image path
+    PrependImagePath(imageFileName);
+    entry.iDecoder = 0;
+    // We use fast decode because it seems to be a lot faster with jpegs.
+    TRAPD( err,  entry.iDecoder = CImageDecoder::FileNewL(iData->iFs, imageFileName, CImageDecoder::EPreferFastDecode ));
+
+    // check for errors..
+    if(err != KErrNone)
+        {
+        // Try to cancel the decoding (if possible)
+        if(entry.iDecoder)
+            {
+            entry.iDecoder->Cancel();
+            }
+        User::Leave(err); // re-leave with the error
+        }
+        
+    // from decoder's frame info retrieve the framesize
+    TFrameInfo frameInfo(entry.iDecoder->FrameInfo(0));
+
+    // check for alpha channel 
+    if(frameInfo.iFlags & TFrameInfo::ETransparencyPossible )
+        {
+        entry.iHasAlpha = ETrue;
+        }
+    else
+        {
+        entry.iHasAlpha = EFalse;
+        }
+
+    // Get the image original size
+    TRect bitmapSize = frameInfo.iFrameCoordsInPixels;
+    entry.iOriginalSize = bitmapSize.Size();
+
+    // target resolution for texture, initially equal to bitmap size
+    TInt widthResolutionTarget = bitmapSize.Size().iWidth;
+    TInt heightResolutionTarget = bitmapSize.Size().iHeight;
+
+    TSize maxTexSize = entry.iLoading.iTexture->MaxTextureSize();
+
+    // Assign new texture resolution target dimensions
+    // if we have explicitly requested them
+    if( (entry.iLoading.iTexture->Flags() & EAlfTextureFlagDoNotRetainResolution)
+            && maxTexSize.iWidth > 0
+            && maxTexSize.iHeight > 0)
+        {
+        // assign new target resolution for decoder-based scaling
+        if(maxTexSize.iWidth < widthResolutionTarget)
+            {
+            widthResolutionTarget = maxTexSize.iWidth;
+            }
+        if(maxTexSize.iHeight < heightResolutionTarget)
+            {
+            heightResolutionTarget = maxTexSize.iHeight;
+            }
+        }
+
+    // we need to do some downscaling, but can we do arbitrary
+    // scaling as well?
+    if(frameInfo.iFlags & TFrameInfo::EFullyScaleable)
+        {
+        // .. yes, arbitrary scaling is possible
+        // just assign the new size to the bitmap
+        // so that it will be scaled accordingly during
+        // conversion
+        }
+    else
+        {
+        // all decoders should be able to do 1/2, 1/4, 1/8 DCT Scaling
+        // calculate nearest half size for the decoder-downscaled bitmap
+        // halve image width&height to size which is closest larger match
+        // of the bitmap size
+        TInt halvedWidth = bitmapSize.Size().iWidth;
+        TInt halvedHeight = bitmapSize.Size().iHeight;
+        TInt halveFactor = 1; // this limits the halving to 1/8 max
+        while ( ((halvedWidth >> 1) > widthResolutionTarget) &&
+                ((halvedHeight >> 1) > heightResolutionTarget)
+                && (halveFactor << 1) <= 8)
+            {
+            halveFactor <<= 1;
+            }
+        halvedWidth = halvedWidth / halveFactor;
+        halvedHeight = halvedHeight / halveFactor;
+        // .. the bitmap will be downscaled further to the correct
+        // dimensions by the toolkit after the bitmap has been decoded
+        widthResolutionTarget = halvedWidth;
+        heightResolutionTarget = halvedHeight;
+        }
+
+
+    if (!(entry.iLoading.iTexture->Flags() & EAlfTextureFlagRetainColorDepth) && 
+        iData->iBitmap->DisplayMode()!=EColor64K)
+        {
+        // (Re)Create the bitmap in EColor64K (16bit) mode to save memory
+        iData->iBitmap->Create(TSize(widthResolutionTarget, heightResolutionTarget), EColor64K);
+        }
+    else if ((entry.iLoading.iTexture->Flags() & EAlfTextureFlagRetainColorDepth) && 
+        iData->iBitmap->DisplayMode()==EColor64K)
+        {
+        // (Re)Create the bitmap in EColor16MU (24bit) mode retain the color information
+        iData->iBitmap->Create(TSize(widthResolutionTarget, heightResolutionTarget), EColor16MU);
+        }
+    else
+        {
+        // no need to recreate the bitmap, but assign the new size!
+        iData->iBitmap->Resize(TSize(widthResolutionTarget, heightResolutionTarget));
+        }
+
+    if (iData->iBitmap->DisplayMode()==EColor64K)
+        {
+        }
+    // Decode ( and rescale ) to bitmap.
+    if(entry.iHasAlpha)
+        {
+        // set the alpha channel bitmap to the same size than the color bitmap
+        iData->iMaskBitmap->Resize(TSize(widthResolutionTarget, heightResolutionTarget));
+        entry.iDecoder->Convert(&iStatus, *iData->iBitmap, *iData->iMaskBitmap, 0);
+        }
+    else
+        {
+        // We cannot do resize mask to smaller until serverside works differently
+        iData->iMaskBitmap->Resize(TSize(widthResolutionTarget, heightResolutionTarget));
+        entry.iDecoder->Convert(&iStatus, *iData->iBitmap, 0);
+        }
+    // Wait for completion.
+    SetActive();
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// Pops entry from load queue
+// ---------------------------------------------------------------------------
+//
+TLoadQueueEntry CAlfTextureManager::PopLoadedQueueEntry()
+    {
+    RArray<TLoadQueueEntry>& loadqueue = (iData->iLoadQueue);	
+    TLoadQueueEntry entry = loadqueue[0];
+    loadqueue.Remove(0);
+    // Delete the decoder.
+    delete entry.iDecoder;
+    entry.iDecoder = 0;
+    return entry;
+    }
+
+
+// ---------------------------------------------------------------------------
+// This method gets called when image loading has been completed and server
+// side texture needs to be created.
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::ImageLoadingCompleteL(TLoadQueueEntry& aEntry)
+    {                    
+    TSize maxTexSize = aEntry.iLoading.iTexture->MaxTextureSize();    
+    
+    // Calculate new maxsize keeping the aspect ratio if only one max dimension was
+    // specified.
+    if ((maxTexSize.iWidth == 0 && maxTexSize.iHeight != 0) ||
+        (maxTexSize.iWidth != 0 && maxTexSize.iHeight == 0))
+        {
+        TSize sizeInPixels = iData->iBitmap->SizeInPixels();
+        if (sizeInPixels.iWidth != 0 && sizeInPixels.iHeight != 0)
+            {
+            if (maxTexSize.iWidth == 0)
+                {
+                maxTexSize.iWidth = (maxTexSize.iHeight * sizeInPixels.iWidth)/sizeInPixels.iHeight;                    
+                }
+            else if (maxTexSize.iHeight == 0)
+                {
+                maxTexSize.iHeight = (maxTexSize.iWidth * sizeInPixels.iHeight)/sizeInPixels.iWidth;   
+                }                                
+            }            
+        }
+    
+    
+    if( (maxTexSize.iWidth != 0) && 
+        (maxTexSize.iHeight != 0) && 
+        (iData->iBitmap->SizeInPixels() != aEntry.iLoading.iTexture->MaxTextureSize()))
+        {
+        // The decoder failed to constrain the texture dimensions properly, due to its internal limitations.
+        // So we need to scale the texture(s) down further to the correct size.              
+        CFbsBitmap* dest = new (ELeave) CFbsBitmap();   
+        dest->Create(maxTexSize, iData->iBitmap->DisplayMode());     
+        CleanupStack::PushL(dest);
+        AlfUtil::ScaleFbsBitmapL(*iData->iBitmap, *dest);
+        CleanupStack::Pop(); // dest
+        delete iData->iBitmap;
+        iData->iBitmap = dest;
+
+        if(aEntry.iHasAlpha)
+            {
+            // Scale the alpha as well.
+            dest = new (ELeave) CFbsBitmap();   
+            dest->Create(maxTexSize, iData->iMaskBitmap->DisplayMode());     
+            CleanupStack::PushL(dest);
+            AlfUtil::ScaleFbsBitmapL(*iData->iMaskBitmap, *dest);
+            CleanupStack::Pop(); // dest
+            delete iData->iMaskBitmap;
+            iData->iMaskBitmap = dest;
+            }                                      
+        }        
+
+    TInt bitmapHandle = 0;
+    TInt maskHandle = 0;
+	
+	if (iData->iBitmap)
+		{
+		bitmapHandle = iData->iBitmap->Handle();
+		}
+	
+	if (iData->iMaskBitmap && aEntry.iHasAlpha)	
+		{
+		maskHandle = iData->iMaskBitmap->Handle();	
+		}
+
+    TInt handle = iData->iEnv->Client().TextureLoadL( aEntry.iLoading.iTexture->Id(), 
+   	    bitmapHandle, 
+   	    maskHandle, 
+   	    aEntry.iLoading.iTexture->Flags(), 
+   	    iData->iManagerId.iUid);
+
+    aEntry.iLoading.iTexture->SetServerHandle(handle);   	    
+    
+    if (iData->iBitmap)
+        aEntry.iLoading.iTexture->SetSize(iData->iBitmap->SizeInPixels());
+
+    // Notify the observers of loaded texture
+    NotifyTextureLoaded(*aEntry.iLoading.iTexture, aEntry.iLoading.iId, KErrNone);
+
+    // Resize bitmaps to save memory
+    iData->iBitmap->Reset();
+    iData->iMaskBitmap->Reset();
+    iData->iBitmap->Create(
+        TSize(KAlfDefaultSizeDimension, KAlfDefaultSizeDimension), EColor64K);
+    iData->iMaskBitmap->Create(
+        TSize(KAlfDefaultSizeDimension, KAlfDefaultSizeDimension), EGray256);
+
+    // DEBUG 
+    if (iData->iTextureAutoCounterEnabled)
+        {            
+        TBuf<256> numBuf;
+        numBuf.FillZ();
+        numBuf.Append(_L("Reloads:"));
+        numBuf.AppendNum(iData->iTextureAutoReloadCounter);
+        numBuf.Append(_L(" - Recreates:"));
+        numBuf.AppendNum(iData->iTextureAutoRecreateCounter);
+        User::InfoPrint(numBuf);
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::NotifyStateChange() const
+    {
+    __ALFLOGSTRING( "CAlfTextureManager::NotifyStateChange" )
+
+    RPointerArray<MAlfTextureManagerStateChangedObserver>& observers = 
+        (iData->iStateObserverQueue);	
+    TInt count = observers.Count();
+    for(TInt i = 0; i < count; i++)
+     	{
+        observers[i]->TextureManagerStateChanged(*this); 								                       
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::NotifyTextureLoaded(CAlfTexture& aTexture,
+                             TInt aTextureId,
+                             TInt aErrorCode) const
+    {
+// NOTE: Commented out because this will prevent alflogging (aTexture.FileName() = NULL => crash)
+//    __ALFLOGSTRING3( "CAlfTextureManager::NotifyTextureLoaded -- filename: %S, textureId: %d, error: %d",
+//          aTexture.FileName(), aTextureId, aErrorCode )
+
+    RPointerArray<MAlfTextureLoadingCompletedObserver>& observers = 
+        (iData->iLoadObserverQueue);	
+    TInt count = observers.Count();
+    for(TInt i = 0; i < count; i++)
+     	{
+        observers[i]->TextureLoadingCompleted(aTexture, aTextureId, 
+            aErrorCode); 								                       
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureManager::AddLoadObserverL(
+    MAlfTextureLoadingCompletedObserver* aObserver)
+    {
+    iData->iLoadObserverQueue.Append(aObserver);    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureManager::RemoveLoadObserver(
+MAlfTextureLoadingCompletedObserver* aObserver)
+    {
+    RPointerArray<MAlfTextureLoadingCompletedObserver>& observers = 
+            (iData->iLoadObserverQueue);	
+
+    TInt count = observers.Count();
+    for(TInt i = 0; i < count; i++)
+      	{
+    	if (observers[i] == aObserver)
+    		{
+    		observers.Remove(i);
+    		observers.Compress();
+    		break;
+    		}								                       
+        }        
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TUid CAlfTextureManager::ManagerUid()
+    {
+    return iData->iManagerId;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTextureProcessor& CAlfTextureManager::Processor()
+    {
+    return *iData->iProcessor;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::AppendTextureL(CAlfTexture* aTexture)
+    {
+    if (CheckTexture(aTexture->Id()) == KErrNotFound)
+        {
+        // Create a new texture entry
+        TTextureEntry entry(aTexture->Id(), aTexture);
+        
+        // Add the new entry to the list of new textures
+        iData->iTextures.AppendL(entry);                    
+        }
+    else
+        {
+        User::Leave(KErrAlreadyExists);    
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::RemoveTexture(CAlfTexture& aTexture)
+    {
+    // Cancel loading of the texture to be removed.
+    CancelLoadingOfTexture(aTexture);
+    
+    RArray<TTextureEntry>& textures = (iData->iTextures);	
+    for(TInt i = 0; i < textures.Count(); i++)
+        {
+        TTextureEntry te = textures[i];
+        if (&aTexture == te.iTexture)
+            {
+            te.iTexture = NULL;                
+            textures.Remove(i);                
+            break;
+            }
+        }        
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CAlfTextureManager::IsInLoadQueue(const CAlfTexture* texture) const
+    {
+    TBool retVal = EFalse;
+    RArray<TLoadQueueEntry>& loadQueue = iData->iLoadQueue;	
+    for(TInt i = 0; i < loadQueue.Count(); i++)
+        {
+        TLoadQueueEntry loadEntry = loadQueue[i];
+        if (loadEntry.iLoading.iTexture == texture)
+            {
+            retVal = ETrue;
+            break;    
+            }
+        }
+    return retVal;
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CAlfTextureManager::TState CAlfTextureManager::State() const
+    {
+    return iData->iState;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureManager::AddStateObserverL(
+    MAlfTextureManagerStateChangedObserver* aObserver)
+    {
+    iData->iStateObserverQueue.Append(aObserver);            
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureManager::RemoveStateObserver(
+    MAlfTextureManagerStateChangedObserver* aObserver)
+    {
+    RPointerArray<MAlfTextureManagerStateChangedObserver>& observers = 
+            (iData->iStateObserverQueue);	
+
+    TInt count = observers.Count();
+    for(TInt i = 0; i < count; i++)
+      	{
+    	if (observers[i] == aObserver)
+    		{
+    		observers.Remove(i);
+    		observers.Compress();
+    		break;
+    		}								                       
+        }                
+    }
+    
+EXPORT_C TBool CAlfTextureManager::IsLoaded(const CAlfTexture * texture) const
+    {
+    if(texture != NULL && texture->HasContent() && !IsInLoadQueue(texture))
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+
+EXPORT_C TBool CAlfTextureManager::IsLoaded(const TDesC& aImageName) const
+    {
+    TFileName fileName = *iData->iImagePath;
+    fileName.Append(aImageName);
+    TInt index = CheckTexture(fileName);
+    if(index == KErrNotFound)
+        {
+        return EFalse;
+        }
+    return IsLoaded(iData->iTextures[index].iTexture);
+    }
+
+EXPORT_C TInt CAlfTextureManager::TextureId(const TDesC& aImageName) const
+    {
+    TFileName fileName = *iData->iImagePath;
+    fileName.Append(aImageName);
+    TInt index = CheckTexture(fileName);
+    
+    if(index == KErrNotFound)
+        {
+        return KErrNotFound;
+        }
+    return iData->iTextures[index].iId;
+    }
+
+EXPORT_C TBool CAlfTextureManager::IsLoaded(TInt aId) const
+    {
+    ASSERT(aId!=0);
+    TInt index = CheckTexture(aId);
+    if(index == KErrNotFound)
+        {
+        return EFalse;
+        }
+    return IsLoaded(iData->iTextures[index].iTexture);
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// Release all textures with given priority level (or above)
+// ---------------------------------------------------------------------------
+//
+TBool CAlfTextureManager::Release( TInt aReleasePriorityLevel )
+    {
+    TBool allReleased = ETrue;
+    
+    RArray<TTextureEntry>& textures = (iData->iTextures);	
+    for(TInt i = 0; i < textures.Count(); i++)
+        {
+        if (textures[i].iTexture->Id())
+            {
+            if ( textures[i].iTexture->Priority() < aReleasePriorityLevel )
+                {
+                allReleased = EFalse;
+                }
+            else
+                {
+                if (!textures[i].iTexture->IsAnimated())
+                    {
+                    ReleaseEntry(textures[i]);                    
+                    }
+                else
+                    {
+                    textures[i].iTexture->StopAnimation();    
+                    }                    
+                }
+            }
+        }
+    return allReleased;
+    }
+
+// ---------------------------------------------------------------------------
+// Release a specific entry
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::ReleaseEntry(const TTextureEntry& aEntry)
+    {
+    // Id texture has content, it must be released here using unload,
+    // otherwise we can just notify serverside.
+    if (aEntry.iTexture->HasContent())
+        {        
+        UnloadTexture(aEntry.iTexture->Id());                        
+        }
+    else
+        {
+        iData->iEnv->Client().TextureRelease(aEntry.iTexture->Id(), 
+            iData->iManagerId.iUid);            
+        }    
+    
+    TInt releaseFlags = aEntry.iTexture->ReleaseFlags();
+    releaseFlags |= CAlfTexture::EReleaseFromEnv;
+    aEntry.iTexture->SetReleaseFlags(releaseFlags);
+    }
+
+// ---------------------------------------------------------------------------
+// Restore all textures with given priority level (or lover)
+// ---------------------------------------------------------------------------
+//
+TBool CAlfTextureManager::RestoreL( TInt aRestorePriorityLevel )
+    {
+    TBool allRestored = ETrue;
+    
+    RArray<TTextureEntry>& textures = (iData->iTextures);	
+    for(TInt i = 0; i < textures.Count(); i++)
+        {
+        if ( textures[i].iTexture->Priority() <= aRestorePriorityLevel )
+            {
+            if (!textures[i].iTexture->IsAnimated())
+                {
+                RestoreEntryL(textures[i]);    
+                }
+            else
+                {
+                textures[i].iTexture->StartAnimation();                                                
+                }                
+            }
+        else
+            {
+            allRestored = EFalse;
+            }
+        }    
+    
+    return allRestored;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::RestoreEntryL(const TTextureEntry& aEntry)
+    {
+    // Id texture has no content, it must be restored here using create/load
+    // otherwise we can just notify serverside.
+    if (!aEntry.iTexture->HasContent())
+        {
+        // Clear release flags 
+        TInt releaseFlags = aEntry.iTexture->ReleaseFlags();
+        releaseFlags &= ~CAlfTexture::EReleaseFromEnv;    
+        releaseFlags &= ~CAlfTexture::EReleaseFromUnload;                   
+        aEntry.iTexture->SetReleaseFlags(releaseFlags);
+
+        // If there are other release flags, then do not restore.        
+        if (!releaseFlags)
+            {                         
+            // check for provider-based restore               
+            if (aEntry.iTexture->BitmapProvider() != NULL)
+                {
+                CreateTextureL(aEntry.iTexture->Id(),
+                               aEntry.iTexture->BitmapProvider(),
+                               aEntry.iTexture->Flags());
+                }
+            // check for file-based restore
+            else if (aEntry.iTexture->FileName() != NULL)
+                {
+                LoadTextureL(aEntry.iTexture->FileName()->Des(),
+                    aEntry.iTexture->MaxTextureSize(), 
+                    aEntry.iTexture->Flags(), 
+                    aEntry.iTexture->Id());
+                }       
+            else
+                {
+                // for PC lint
+                }
+            }
+        }
+    else
+        {
+        iData->iEnv->Client().TextureRestore(aEntry.iTexture->Id(), 
+            iData->iManagerId.iUid);    
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::CancelLoadingOfTexture(CAlfTexture& aTexture)
+    {
+    RArray<TLoadQueueEntry>& loadQueue = iData->iLoadQueue;    
+    for(TInt i = 0; i < loadQueue.Count(); i++)
+        {
+        if(loadQueue[i].iLoading.iTexture == &aTexture)
+            {
+            // Texture found from the load queue.
+            if(i == 0 && iData->iState == ELoading)
+                {
+                // Texture is currently loading
+                Cancel();
+                PopLoadedQueueEntry();
+                StartLoading();                
+                }
+            else
+                {
+                // Delete the decoder and remove entry.
+                delete loadQueue[i].iDecoder;
+                loadQueue.Remove(i);
+                }
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTextureManager::GenerateTextureId()
+    {
+    TBool done = EFalse;
+
+    TInt start = iData->iAutoGeneratedTextureId;
+    while (!done)
+        {            
+        if(iData->iAutoGeneratedTextureId == iData->iHighestAutoGeneratedTextureId)
+            {
+            iData->iAutoGeneratedTextureId = iData->iLowestAutoGeneratedTextureId;
+            }
+        else
+            {
+            iData->iAutoGeneratedTextureId++;
+            }
+        
+        if (CheckTexture(iData->iAutoGeneratedTextureId) == KErrNotFound)
+            {
+            done = ETrue;    
+            }
+        
+        if (iData->iAutoGeneratedTextureId == start)
+            {
+            // Error! Free id was not found, already existing id will be used.
+            break;    
+            }            
+        }
+
+    return iData->iAutoGeneratedTextureId;        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureManager::SetAutomaticTextureIdRange(TInt aLow, TInt aHigh)
+    {
+    if (aLow < aHigh)
+        {
+        iData->iAutoGeneratedTextureId = aLow;
+        iData->iLowestAutoGeneratedTextureId = aLow;
+        iData->iHighestAutoGeneratedTextureId = aHigh;                    
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::NotifySkinChangedL()
+    {
+    __ALFLOGSTRING( "CAlfTextureManager::NotifySkinChangedL" )
+    
+    RArray<TTextureEntry>& textures = (iData->iTextures);	
+    for(TInt i = 0; i < textures.Count(); i++)
+        {
+        if (textures[i].iTexture->Id() &&
+            textures[i].iTexture->HasContent() &&
+            (textures[i].iTexture->Flags() & EAlfTextureFlagSkinContent))
+            {
+            iData->iEnv->Client().TextureNotifySkinChanged(textures[i].iTexture->Id(),
+                 iData->iManagerId.iUid);    
+            
+            ReleaseEntry(textures[i]);            
+            RestoreEntryL(textures[i]);
+            }
+        }                        
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CAlfTextureManager::IsShared()
+    {
+    return (iData->iManagerId != TUid::Uid(0));        
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::ReportTextureInfoL( 
+        TInt aTextureId, const TSize& aTextureRect )
+    {
+    __ALFLOGSTRING1( "CAlfTextureManager::ReportTextureInfo %d", aTextureId )
+    __ALFLOGSTRING2( "texture size = (%d, %d)", aTextureRect.iWidth, aTextureRect.iHeight )
+
+    TBool accepted = EFalse;
+    CAlfTexture* texture = TextureL(aTextureId);
+    
+    RPointerArray<MAlfTextureAutoSizeObserver>& observers = 
+        (iData->iAutoSizeObserverQueue);	
+    TInt count = observers.Count();
+    for(TInt i = 0; i < count; i++)
+     	{
+        accepted |= observers[i]->PreferredSizeChanged(*texture, aTextureRect);
+        }
+
+    // File based textures are updated automatically without observer acceptance
+    if (texture->FileName())
+        {
+        // Update new max size, but leave undefined (zero) values untouched.
+        TSize maxTextureSize = texture->MaxTextureSize();
+        TSize oldMaxTextureSize = maxTextureSize;
+        
+        if (maxTextureSize.iWidth != 0 && maxTextureSize.iHeight == 0)
+            {
+            maxTextureSize.iWidth = aTextureRect.iWidth;    
+            }
+        else if (maxTextureSize.iHeight != 0 && maxTextureSize.iWidth == 0)
+            {
+            maxTextureSize.iHeight = aTextureRect.iHeight;      
+            }
+        else
+            {
+            maxTextureSize = aTextureRect;   
+            }    
+            
+        texture->SetMaxTextureSize(maxTextureSize);
+               
+        if (!texture->ReleaseFlags() && (oldMaxTextureSize != maxTextureSize))
+            {
+            // Update if texture is not released. 
+            UpdateTextureL(aTextureId, aTextureRect);             
+            }
+        }
+    else
+        {
+        if (accepted && !texture->ReleaseFlags())
+            {
+            // If we did notify someone who accepted it, we assume it may now be able to 
+            // provide new size texture. If it is released it should get updated 
+            // automatically to new size when restore happens.   
+            UpdateTextureL(aTextureId, aTextureRect);             
+            }
+        else
+            {
+            // not accepted by any of observers, no use to update then.    
+            }    
+        }                
+
+    }
+    
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureManager::AddAutoSizeObserverL(MAlfTextureAutoSizeObserver* aObserver)
+    {
+    iData->iAutoSizeObserverQueue.Append(aObserver);     
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureManager::RemoveAutoSizeObserver(MAlfTextureAutoSizeObserver* aObserver)
+    {
+    RPointerArray<MAlfTextureAutoSizeObserver>& observers = 
+            (iData->iAutoSizeObserverQueue);	
+
+    TInt count = observers.Count();
+    for(TInt i = 0; i < count; i++)
+      	{
+    	if (observers[i] == aObserver)
+    		{
+    		observers.Remove(i);
+    		observers.Compress();
+    		break;
+    		}								                       
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::UpdateTextureL(TInt aId, TSize /*aSize*/)
+    {
+    RArray<TTextureEntry>& textures = (iData->iTextures);	
+    for(TInt i = 0; i < textures.Count(); i++)
+        {
+        TTextureEntry te = textures[i];
+        if (te.iTexture && te.iTexture->Id() == aId)
+            {
+            if (te.iTexture->BitmapProvider() != NULL)
+                {
+                UpdateTextureFromBitmapL(aId);
+                break;
+                }
+            else if (te.iTexture->FileName() != NULL)
+                {
+                UpdateTextureFromFileL(aId);
+                break;
+                }       
+            else
+                {
+                // for PC lint
+                break;
+                }
+            }
+        }
+    }
+
+
+void CAlfTextureManager::ReloadTextureL(const TDesC& aImageName,
+                                       TSize aTextureMaxSize,
+                                       TAlfTextureFlags /*aFlags*/,
+                                       TInt aId)
+    {    
+    if (aId == KAlfAutoGeneratedTextureId)
+        {
+        aId = GenerateTextureId();    
+        }    
+    
+    CAlfTexture* tex = NULL;
+    TFileName fileName;
+
+    // Texture must exist.
+    tex = TextureL(aId);
+
+    // add path to filename if filename has been passed
+    if(aImageName.Length() > 0)
+        {
+        // assume relative pathname and prepend the image path to get full filename
+        fileName = aImageName;
+        PrependImagePath(fileName);
+        }
+
+    // if no name has been passed as a parameter but
+    // there's and nonzero id has been passed, we
+    // can assume that there's a predefined name available
+    RArray<TTextureEntry>& textures = (iData->iTextures);	
+    RArray<TLoadQueueEntry>& loadqueue = (iData->iLoadQueue);	
+
+    if((aImageName.Length() == 0) && (aId != 0))
+       {
+        // search for a texture filename based on the id.
+        TInt index = CheckTexture(aId);
+        if(index >=0)
+            {
+            tex = textures[index].iTexture;
+            fileName = *tex->FileName();
+            }
+        else
+            {
+            User::Leave(KErrNotFound);
+            }
+       }
+
+    // return if already in the load queue ??
+   if (IsInLoadQueue(tex))
+       {
+       return;
+       }
+
+    // replace filename
+    // File names are relative to the image path.
+    tex->SetFileNameL(fileName);
+    
+    TSize maxTextureSize = tex->MaxTextureSize();
+    
+    // Update new max size, but leave undefined (zero) values untouched    
+    if (maxTextureSize.iWidth != 0 && maxTextureSize.iHeight == 0)
+        {
+        maxTextureSize.iWidth = aTextureMaxSize.iWidth;    
+        }
+    else if (maxTextureSize.iHeight != 0 && maxTextureSize.iWidth == 0)
+        {
+        maxTextureSize.iHeight = aTextureMaxSize.iHeight;      
+        }
+    else
+        {
+        maxTextureSize = aTextureMaxSize;   
+        }    
+
+    tex->SetMaxTextureSize(maxTextureSize);
+
+    // Prepare for loading by creating a load queue entry.
+    TTextureEntry entry;
+    entry.iTexture = tex;
+    entry.iId = aId;
+
+    TLoadQueueEntry loadqentry;
+    loadqentry.iUnloaded = EFalse;
+    loadqentry.iLoading = entry;
+    loadqentry.iDecoder = NULL;
+
+    // Textures are loaded one at a time, in the order they were requested.
+    loadqueue.AppendL(loadqentry);
+
+    // DEBUG
+    if (iData->iTextureAutoCounterEnabled)
+        {            
+        iData->iTextureAutoReloadCounter++;
+        }
+
+    // Start the texture load active object if we're not loading
+    if(iData->iState == EIdle)
+        {
+        // Start loading images..
+        StartLoading();
+        // Notify observers.
+        NotifyStateChange();
+        }
+    }
+
+void CAlfTextureManager::RecreateTextureL(TInt aId,
+                                          MAlfBitmapProvider* aBitmapProvider,
+                                          TAlfTextureFlags aFlags)
+    {    
+    CAlfTexture* tex = NULL;
+    
+    if (aId == KAlfAutoGeneratedTextureId)
+        {
+        User::Leave(KErrArgument); // texture must already exist !
+        }    
+
+    CFbsBitmap* bitmap = NULL;
+    CFbsBitmap* maskBitmap = NULL;
+
+    // Provide an already created texture if such exists.
+    TRAPD(err, tex = TextureL(aId));
+    if(err != KErrNone)
+        {
+        User::Leave(KErrArgument); // texture must already exist !
+        }
+
+    // Call the bitmapProvider method to load the bitmaps
+	if (aBitmapProvider)
+		{
+	    aBitmapProvider->ProvideBitmapL(aId, bitmap, maskBitmap);		
+		}
+					
+	if (!bitmap)
+	    { 
+	    // We leave here, otherwise serverside would panic. 
+	    User::Leave(KErrArgument);    
+	    // Bitmap size is checked and handled in serverside, 
+	    // so that we can create empty textures (size = 0,0)
+	    }
+	    	  
+	// "bitmap" pointer should be valid from now on
+    CleanupStack::PushL(bitmap);
+	TInt bitmapHandle = bitmap->Handle();
+	
+	TInt maskHandle = 0;
+	if (maskBitmap)	
+		{
+		maskHandle = maskBitmap->Handle();	
+	    CleanupStack::PushL(maskBitmap);
+		}
+    
+    // Create CAlfTexture instance, this duplicates the bitmaps to server.
+    // texture already exists but it does not have content, this creates content.
+   	iData->iEnv->Client().TextureCreateL( aId, bitmapHandle, 
+       	maskHandle, aFlags, iData->iManagerId.iUid );    	            	        
+		
+	tex->SetBitmapProvider(aBitmapProvider);	
+    tex->SetSize(bitmap->SizeInPixels());
+	
+	// CAlfTexture has at this point duplicated bitmaps, can be deleted here.        
+	if (maskBitmap)	
+		{
+	    CleanupStack::PopAndDestroy( maskBitmap );
+	    maskBitmap = NULL;		
+		}
+    CleanupStack::PopAndDestroy( bitmap ); 
+	bitmap = NULL;		
+    
+    // Notify observers
+    NotifyTextureLoaded(*tex, aId, KErrNone);
+    
+    // DEBUG
+    if (iData->iTextureAutoCounterEnabled)
+        {            
+        iData->iTextureAutoRecreateCounter++;
+        TBuf<256> numBuf;
+        numBuf.FillZ();
+        numBuf.Append(_L("Reloads:"));
+        numBuf.AppendNum(iData->iTextureAutoReloadCounter);
+        numBuf.Append(_L(" - Recreates:"));
+        numBuf.AppendNum(iData->iTextureAutoRecreateCounter);
+        User::InfoPrint(numBuf);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::IncRefcount(TInt aId)
+    {
+    // do not refcount blanktextures.
+    if (!aId)
+        {
+        return;
+        }
+
+    TInt index = CheckTexture(aId);
+    ASSERT(index!=KErrNotFound);
+    TTextureEntry& te = iData->iTextures[index];
+    if (te.iRefCount==-1)
+        {
+        te.iRefCount = 1;
+        }
+    else
+        {
+        te.iRefCount++;        
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::DecRefcount(TInt aId)
+    {
+    // do not refcount blanktextures.
+    if (!aId)
+        {
+        return;
+        }
+        
+    TInt index = CheckTexture(aId);
+    if (index == KErrNotFound)
+        {
+        return;
+        }
+    
+    TTextureEntry& te = iData->iTextures[index];
+    if (te.iRefCount >0)
+        {
+        te.iRefCount--;        
+        }
+    if (!te.iRefCount)
+        {
+        // trigger texture cleanup when 
+        // reference count hits zero
+        StartGarbageCollect();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTextureManager::GarbageCollect(TAny* aPtr)
+    {
+    CAlfTextureManager* tm = ((CAlfTextureManager*)(aPtr));
+	RArray<TTextureEntry>& textures = tm->iData->iTextures;	
+    // Cleanup all textures which have refcount 0
+    TInt count = textures.Count()-1;
+    for (int index = count; index >=0; index--)
+        {
+        TTextureEntry& te = textures[index];
+        // delete only textures that have enabled refcounting
+        if (te.iTexture->RefCountingEnabled() && !te.iRefCount)
+            {
+            TInt action = te.iTexture->RefCountingAction();
+            switch (action)
+                {
+                case CAlfTexture::ERefCountingActionUnload:
+                    {
+                    // Unload, but mark as released from ref counting 
+                    TInt releaseFlags = te.iTexture->ReleaseFlags();
+                    tm->UnloadTexture(te.iId);    
+                    releaseFlags |= CAlfTexture::EReleaseFromRefCounting;
+                    te.iTexture->SetReleaseFlags(releaseFlags);
+                    break;
+                    }
+                case CAlfTexture::ERefCountingActionDelete:
+                    {
+                    delete te.iTexture;
+                    te.iTexture = NULL;
+                    break;        
+                    }                    
+                default:
+                    {
+                    // Do nothing
+                    break;    
+                    }                                        
+                }            
+            }
+        }
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::StartGarbageCollect()
+    {
+    CIdle* doombringer = iData->iDoomBringer;
+    // check if garbagecollecting is already in progress
+    // -> if so, just return
+    if (doombringer->IsActive())
+        {
+        return;
+        }
+    doombringer->Start(TCallBack(GarbageCollect, this));
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::RemoveFlags(TAlfTextureFlags& aFlags, TInt aFlagsToBeRemoved)
+    {
+    ((TInt&)aFlags) &= ~aFlagsToBeRemoved;      
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureManager::SetFlags(TAlfTextureFlags& aFlags, TInt aFlagsToBeSet)
+    {
+    ((TInt&)aFlags) |= aFlagsToBeSet;              
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alftextureprocessor.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Texture
+*
+*/
+
+
+
+#include "alf/alftextureprocessor.h"
+#include "alf/alftexture.h"
+#include "alf/alfenv.h"
+#include "alf/alftexturemanager.h"
+#include "alfclient.h"
+
+struct CAlfTextureProcessor::TPrivateData
+    {
+    CAlfEnv* iEnv;
+    };
+
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfTextureProcessor::CAlfTextureProcessor()
+	{
+		
+	}
+
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+CAlfTextureProcessor::~CAlfTextureProcessor()
+	{
+	if ( iData )
+	    {
+	    }
+	delete iData;
+	iData = NULL;
+	}
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+CAlfTextureProcessor* CAlfTextureProcessor::NewL(CAlfEnv& aEnv)
+	{
+	CAlfTextureProcessor* self = 
+		CAlfTextureProcessor::NewLC(aEnv);        
+    CleanupStack::Pop( self );
+    return self;		
+	}
+	
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+CAlfTextureProcessor* CAlfTextureProcessor::NewLC(CAlfEnv& aEnv)
+	{
+    CAlfTextureProcessor* self = new( ELeave ) CAlfTextureProcessor;
+    CleanupStack::PushL( self );
+    self->ConstructL(aEnv);
+    return self;	
+	}
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+void CAlfTextureProcessor::ConstructL(CAlfEnv& aEnv)
+	{
+    iData = new (ELeave) TPrivateData;
+    iData->iEnv = &aEnv;
+	}
+
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureProcessor::BlurL(const CAlfTexture& aSrc, CAlfTexture& aDest,
+    TInt aFilterSize, TInt aFlags)
+    {
+    // By default, use a quarter of the original size.
+    TSize originalSize = aSrc.Size();
+    return BlurL(aSrc, aDest,
+                 TSize(originalSize.iWidth/2, originalSize.iHeight/2),
+                 aFilterSize, aFlags);        
+    }   
+                        
+// ---------------------------------------------------------------------------
+// ?description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextureProcessor::BlurL(const CAlfTexture& aSrc, CAlfTexture& aDest,   
+    const TSize& aPreferredSize, TInt aFilterSize, TInt aFlag)
+    {
+    iData->iEnv->Client().TextureProcessorBlurL( aSrc.ServerHandle(), 
+	    aDest.ServerHandle(), 
+	    0, 
+	    aPreferredSize, 
+	    aFilterSize, 
+	    aFlag );        
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alftextvisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1117 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Text visual
+*
+*/
+
+
+#include <s32mem.h>
+#include "alf/alftextvisual.h"
+#include "alf/alfcontrol.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alf/alfconstants.h"
+#include "alf/alfgencomponent.h"
+#include "alflogger.h"
+#include "alf/alflayoutmetrics.h"
+#include "alf/alftextstyle.h"
+#include "alf/alfdropshadow.h"
+#include <uiacceltk/HuiFont.h>
+
+#include <AknsConstants.h>
+#include <AknBidiTextUtils.h>
+
+#include <utf.h>
+
+#include <aknnotewrappers.h>
+
+#ifdef ALF_RASTER_TEXT
+
+/** Granularity of line wrapping array. */
+const TInt KLineArrayGranularity = 4;
+
+NONSHARABLE_CLASS(CAlfRasterizedTextMesh): public CBase
+    {
+    struct SRasterizedLine
+        {
+        SRasterizedLine()
+            {
+            iTexture = NULL;
+            iGap = 0;
+            }
+        /** Texture that holds the rasterized version of a text line. The
+            size of the texture determines the extents of the line. */
+        CAlfTexture* iTexture;
+        
+        /** Extra gap to the next line in pixels. Not applied to the last
+            line. */
+        TInt iGap;
+        };
+    
+    public:
+    static CAlfRasterizedTextMesh* NewL(CAlfTextVisual* aVisual)
+        {
+        CAlfRasterizedTextMesh* self = new (ELeave) CAlfRasterizedTextMesh(aVisual);
+        return self;
+        }
+
+    CAlfRasterizedTextMesh(CAlfTextVisual* aVisual)
+        :iVisual(aVisual){}
+
+    ~CAlfRasterizedTextMesh()
+        {
+        ResetLines(ETrue);
+        iLines.Close();
+        ReleaseTextures(ETrue);
+        iObsoleteTextures.Close();
+        delete iBuf;
+        }
+    
+    void PrepareForRasterize()
+        {
+        // resolve max width 
+        iMaxWidth = KMaxTInt;
+        if(iVisual->Wrapping() != CAlfTextVisual::ELineWrapManual)
+            {
+            TAlfRealRect content = iVisual->DisplayRectTarget();
+            content.Shrink(iVisual->PaddingInPixels());
+            iMaxWidth = TInt(content.Width()+0.5f);
+            }        
+        }
+    
+    TInt Lines()
+        {
+        return iLines.Count();
+        }
+
+    void ResetLines(TBool aDeleteTexture = EFalse)
+        {
+        for(TInt i = 0; i < iLines.Count(); ++i)
+            {
+            if ( aDeleteTexture )
+                {
+                delete iLines[i].iTexture;
+                }
+            else 
+                {
+                MarkTextureForRemovalL(iLines[i].iTexture);
+                }
+            iLines[i].iTexture = NULL;
+            }
+
+        iLines.Reset();
+        }
+
+    void RasterizeLineL(const TDesC& aTextLine, SRasterizedLine & aLineOut, CAlfTextStyle* aTextStyle)
+        {
+        // Calculate line extents and assign it to texture size.
+        TSize textureSize = aTextStyle->LineExtentsL(aTextLine);
+    
+        if(textureSize.iWidth == 0)
+            {
+            // This is an empty string. We will not rasterize it.
+            // Just add a gap to rows.
+            aLineOut.iTexture = NULL;
+
+            aLineOut.iGap = textureSize.iHeight; // @todo: refacture/rename iGap? iGap is used as a size of an empty line?
+            return;
+            }
+
+        // Rasterize string using the defined text style.
+        aTextStyle->RasterizeLineL(aTextLine, &aLineOut.iTexture);
+        }
+
+    void DoBuildL(CAlfTextStyle* aTextStyle)
+        {
+        ResetLines();
+        
+        TSize extents(0, 0);
+        const TDesC& text = iVisual->Text();
+        
+        // Retrieve the CFont object used when rasterizing this text mesh.
+        CFont* font = aTextStyle->Font()->NearestFontL(1.0);
+
+        // In wrapping mode, let the mesh know how much space there is
+        // for drawing into.
+        TInt maxWidth = iMaxWidth; //KMaxTInt;
+        TInt lineCount = 0;
+
+        // awkward, just to avoid warning
+        CArrayFixFlat<TPtrC>* linePtrs = 0;
+        HBufC* buf = 0;
+
+        switch(iVisual->Wrapping())
+            {
+            case CAlfTextVisual::ELineWrapManual:
+                {
+                lineCount = 1;
+                for (TInt i = text.Length()-2;i>=0;i--) // linebreak as last character is ignored
+                    {
+                    if (text[i]=='\n') // not elegant but keeps the compatibility
+                        lineCount++;
+                    }
+                if (lineCount > 1)
+                    {
+                    TInt lineStart = 0;
+                    TInt breakpos = 0;
+                    TInt remaining = text.Length();                    
+                    while(lineCount)
+                        {
+                        for (TInt i = lineStart; i<remaining ;i++)
+                            {
+                            if (text[i]=='\n') // not elegant but keeps the compatibility
+                                {
+                                breakpos = i;
+                                break;
+                                }
+                            }
+                            if (breakpos < lineStart) // not found
+                                {
+                                breakpos = remaining-1;
+                                }
+                                
+                            HBufC* buf = text.Mid(lineStart,breakpos-lineStart).AllocLC(); // todo.. is extra space required for bidi
+                            lineStart = breakpos+1;
+                            TPtr ptr = buf->Des();
+                            // truncate line
+                            AknBidiTextUtils::ConvertToVisualAndClipL(ptr, *font, maxWidth, maxWidth);
+                            // create the line entry if not already existing
+
+                            SRasterizedLine line;
+                            line.iTexture = NULL;
+                            line.iGap = 0;
+                            iLines.AppendL(line);
+                        
+                            TInt index = iLines.Count()-1;
+                            // rasterize a single line (updates texture in iLines[0].iTexture)
+                            RasterizeLineL(ptr, iLines[index], aTextStyle);                     
+
+                            // Get extents from the texture we just created
+                            CAlfTexture* tex = iLines[index].iTexture;
+                            extents.iHeight += iLines[index].iGap;
+                            if(tex)
+                                {
+                                extents.iWidth = Max(extents.iWidth, tex->Size().iWidth);
+                                extents.iHeight += tex->Size().iHeight;
+                                }                   
+                    
+                            CleanupStack::PopAndDestroy(buf);
+                            lineCount--;
+                            }
+                        break;
+                        }
+                    } // fall through with single line
+            case CAlfTextVisual::ELineWrapTruncate:
+                {
+                lineCount = 1; // there's always one line created per logical line
+                HBufC* buf = text.AllocLC(); // todo.. is extra space required for bidi
+                TPtr ptr = buf->Des();
+                // truncate line
+                AknBidiTextUtils::ConvertToVisualAndClipL(ptr, *font, maxWidth, maxWidth);
+                // create the line entry if not already existing
+
+                SRasterizedLine line;
+                line.iTexture = NULL;
+                line.iGap = 0;
+                iLines.AppendL(line);
+                        
+ 	            // rasterize a single line (updates texture in iLines[0].iTexture)
+        	    RasterizeLineL(ptr, iLines[0], aTextStyle);	                    
+
+   	            // Get extents from the texture we just created
+                CAlfTexture* tex = iLines[0].iTexture;
+                extents.iHeight += iLines[0].iGap;
+                if(tex)
+                    {
+                    extents.iWidth = Max(extents.iWidth, tex->Size().iWidth);
+                    extents.iHeight += tex->Size().iHeight;
+                    }	                
+                	
+        	    CleanupStack::PopAndDestroy(buf);
+                break;
+                }
+
+            case CAlfTextVisual::ELineWrapBreak:
+                {
+                // wrap lines to array
+                linePtrs = new (ELeave) CArrayFixFlat<TPtrC>(KLineArrayGranularity);
+                CleanupStack::PushL(linePtrs);
+        
+                buf = AknBidiTextUtils::ConvertToVisualAndWrapToArrayL(
+                    text, maxWidth, *font, *linePtrs);
+                CleanupStack::PushL(buf);
+
+              	// Do rasterisation
+                for(TInt i = 0; i < linePtrs->Count();i++)
+                    {
+                    SRasterizedLine line;
+                    line.iTexture = NULL;
+                    line.iGap = 0;
+                    iLines.AppendL(line);
+                        
+                    // rasterize a single line (updates texture in iLines[i].iTexture)
+                    RasterizeLineL(linePtrs->At(i), iLines[i], aTextStyle);
+                    CAlfTexture* tex = iLines[i].iTexture;
+                    extents.iHeight += iLines[i].iGap;
+                            
+                    if(tex)
+                        {
+                        extents.iWidth = Max(extents.iWidth, tex->Size().iWidth);
+                        extents.iHeight += tex->Size().iHeight;
+                        }    
+                            	                                                         
+                    if (i == iVisual->MaxLineCount()-1)
+          	            {
+       	                // Maximum number of lines reached.
+       	                break;
+       	                }
+                    }
+                CleanupStack::PopAndDestroy(buf);
+                CleanupStack::PopAndDestroy(linePtrs);
+                break;
+                }
+                
+            default:
+                break;
+            }
+            
+        // Extents needs to be updated in order to make alignment 
+        // work properly.
+        iExtents = extents;
+
+        UpdateDescriptorL();
+        }
+
+    void UpdateDescriptorL()
+        {
+        delete iBuf;
+        iBuf = 0;
+        iBuf = HBufC8::NewL((iLines.Count()+1)*8 + 2*4);
+        RDesWriteStream stream;
+        TPtr8 ptr = iBuf->Des();
+        stream.Open(ptr);
+        CleanupClosePushL(stream);
+        stream.WriteInt32L(iLines.Count());
+        for (TInt i = iLines.Count()-1; i >= 0; i--)
+            {
+            if (iLines[i].iTexture)
+                stream.WriteInt32L(iLines[i].iTexture->ServerHandle());
+            else
+                stream.WriteInt32L(0);                
+            stream.WriteInt32L(iLines[i].iGap);
+            }
+        stream.WriteInt32L(iExtents.iWidth);
+        stream.WriteInt32L(iExtents.iHeight);
+        stream.CommitL();
+        CleanupStack::PopAndDestroy(); // close stream
+        }
+    
+    HBufC8* Buffer()
+        {
+        return iBuf;    
+        }
+    
+    void MarkTextureForRemovalL(CAlfTexture* aTexture)
+        {    
+        if (iObsoleteTextures.Find(aTexture)==KErrNotFound)
+            {
+            iObsoleteTextures.AppendL(aTexture);
+            }
+        }
+        
+    void ReleaseTextures(TBool aObsoleteOnly)
+        {
+        if (!aObsoleteOnly)
+            {        
+            for (TInt i = iLines.Count()-1;i>=0;i--)
+                {
+                delete iLines[i].iTexture;
+                iLines.Remove(0);
+                }
+            }        
+        iObsoleteTextures.ResetAndDestroy();
+        }
+
+    
+    CAlfTextVisual* iVisual;
+    RArray<SRasterizedLine> iLines;
+    RPointerArray<CAlfTexture> iObsoleteTextures;
+    HBufC8* iBuf;
+    TSize iExtents;
+    
+    TInt iMaxWidth;
+    };
+
+#endif // #ifdef ALF_RASTER_TEXT
+
+struct CAlfTextVisual::TTextVisualPrivateData
+    {
+    HBufC* iText; // own
+    TInt iTextStyleId;
+    CAlfTextStyle* iTextStyle;
+#ifdef ALF_RASTER_TEXT
+    CAlfRasterizedTextMesh* iMesh;
+    TInt iWrappingMode;
+    TInt iMaxLineCount;
+    TInt iLineSpacingUnit;
+    TInt iLineSpacing;
+    
+    TBool iMeshUptoDate;   
+#endif // #ifdef ALF_RASTER_TEXT
+    };
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTextVisual::CAlfTextVisual()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextVisual::ConstructL(CAlfControl& aOwner)
+    {
+    CAlfVisual::ConstructL(aOwner);
+    
+    iTextVisualData = new (ELeave) TTextVisualPrivateData;
+    iTextVisualData->iText = NULL;
+    iTextVisualData->iTextStyleId = 0;
+#ifdef ALF_RASTER_TEXT
+    iTextVisualData->iTextStyle = 0;
+    iTextVisualData->iMesh = 0;
+    iTextVisualData->iWrappingMode=0;
+    iTextVisualData->iMaxLineCount=256;
+    iTextVisualData->iLineSpacing=0;
+    iTextVisualData->iLineSpacingUnit=0;
+    iTextVisualData->iMesh = CAlfRasterizedTextMesh::NewL(this);
+    
+    iTextVisualData->iMeshUptoDate = EFalse;
+    
+#endif //#ifdef ALF_RASTER_TEXT
+    
+    // If alflayoutmetrcis is in automatic mode, mark this visual.
+    if (aOwner.Env().LayoutMetricsUtility()->AutoMarking() )
+        {
+        aOwner.Env().LayoutMetricsUtility()->MarkVisual(NULL, this);    
+        }
+    }
+
+void CAlfTextVisual::PrepareForUpdateMesh()
+    {
+    if(!iTextVisualData->iMeshUptoDate)
+        {
+        iTextVisualData->iMesh->PrepareForRasterize();
+        }
+    }
+
+void CAlfTextVisual::UpdateMesh(TBool aSynch)
+    {
+ #ifdef ALF_RASTER_TEXT
+    // update textures
+    CAlfTextStyle* style = iTextVisualData->iTextStyle;
+    if (!style)
+        { // default
+        iTextVisualData->iTextStyle = Env().TextStyleManager().SwitchTextStyle(0,this);//register for updates 
+        style = Env().TextStyleManager().TextStyle(0);
+        }
+    if (aSynch)
+        {
+        if(!iTextVisualData->iMeshUptoDate)
+            {
+            TRAPD(err, iTextVisualData->iMesh->DoBuildL(style))
+            // Inform server
+            if (!err)
+                {
+                TPtr8 ptr = iTextVisualData->iMesh->Buffer()->Des();
+                Comms()->DoCmdNoReply(EAlfTextVisualSetRasterizedMesh, ptr);    
+                }    
+            iTextVisualData->iMesh->ReleaseTextures(ETrue);
+            iTextVisualData->iMeshUptoDate = ETrue;
+            }
+        }
+     else
+        {
+        iTextVisualData->iMeshUptoDate = EFalse;
+        style->ReportChanged();
+        }
+ #endif
+    }
+void CAlfTextVisual::ReleaseMesh()
+    {
+#ifdef ALF_RASTER_TEXT
+    iTextVisualData->iMesh->ResetLines(ETrue);
+#endif
+    }
+	
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTextVisual::~CAlfTextVisual()
+    {
+    if ( iTextVisualData )
+        {
+        delete iTextVisualData->iText;
+#ifdef ALF_RASTER_TEXT
+        Env().TextStyleManager().Unregister(this);
+        delete iTextVisualData->iMesh;
+#endif
+        }
+    delete iTextVisualData;
+    
+    Env().LayoutMetricsUtility()->UnmarkVisual(this);
+    }
+
+
+// ---------------------------------------------------------------------------
+// Creates new CAlfTextVisual
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTextVisual* CAlfTextVisual::AddNewL(
+    CAlfControl& aOwnerControl,
+    CAlfLayout* aParentLayout)
+    {
+    CAlfTextVisual* text = STATIC_CAST(CAlfTextVisual*,
+        aOwnerControl.AppendVisualL(EAlfVisualTypeText, aParentLayout));
+    return text;
+    }
+    
+// ---------------------------------------------------------------------------
+// Sets text.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextVisual::SetTextL(const TDesC& aText)
+    {
+#ifdef ALF_RASTER_TEXT
+    if (!iTextVisualData->iText || aText.Compare(*iTextVisualData->iText))
+        {
+		// Store the text into a temp buffer.
+        HBufC* newBuffer = aText.AllocL();
+        delete iTextVisualData->iText;
+        iTextVisualData->iText = newBuffer;
+        UpdateMesh();
+        }
+#else
+    // Store the text into a temp buffer.
+    HBufC* newBuffer = aText.AllocLC();
+    
+    TPtrC8 ptr(reinterpret_cast<const TUint8 *>(aText.Ptr()), aText.Length()*2);
+    TBuf8<1> dum;
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfTextVisualSetText, ptr, dum);
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::SetTextL leave error %d", err )
+        User::Leave( err );    
+        }
+    
+    // Everything's OK. Switch the internal text buffer.
+    CleanupStack::Pop( newBuffer );
+    delete iTextVisualData->iText;
+    iTextVisualData->iText = newBuffer;
+#endif
+    }
+  
+// ---------------------------------------------------------------------------
+// Gets text.
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C const TDesC& CAlfTextVisual::Text() const
+    {
+    if ( iTextVisualData && iTextVisualData->iText )
+        {
+        return *iTextVisualData->iText;
+        }
+    return KNullDesC();
+    }
+  
+// ---------------------------------------------------------------------------
+// Sets style.
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfTextVisual::SetStyle(
+        TAlfPreconfiguredTextStyle aStyle, 
+        TAlfBackgroundType aBackgroundType )
+    {
+#ifdef ALF_RASTER_TEXT
+    iTextVisualData->iTextStyle = Env().TextStyleManager().SwitchTextStyle(aStyle, this);
+    iTextVisualData->iTextStyleId = aBackgroundType; // zero warnings, right
+    iTextVisualData->iTextStyleId = aStyle;
+    UpdateMesh();
+#else
+    TInt2 params(aStyle, aBackgroundType);
+    TPckgC<TInt2> buf(params);
+    
+    TInt err = Comms()->DoCmdNoReply(EAlfTextVisualSetStyle, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::SetStyle ignore error %d", err )
+        } 
+#endif
+    }
+    
+// ---------------------------------------------------------------------------
+// Sets style.
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfTextVisual::SetTextStyle( TInt aTextStyleId )
+    {   
+#ifdef ALF_RASTER_TEXT
+    if(!iTextVisualData->iTextStyle || iTextVisualData->iTextStyleId != aTextStyleId)
+        {
+        iTextVisualData->iTextStyle = Env().TextStyleManager().SwitchTextStyle(aTextStyleId, this);
+        iTextVisualData->iTextStyleId = aTextStyleId;
+        UpdateMesh();
+        }
+#else
+    // Convert the text style id from client domain to session domain.
+    CAlfTextStyle* textStyle = Env().TextStyleManager().TextStyle(aTextStyleId);
+    TPckgC<TInt> buf(textStyle->Comms()->Identifier());
+    TBuf8<1> dum;	
+	    
+    TInt err = Comms()->DoSynchronousCmd(EAlfTextVisualSetTextStyle, buf, dum);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::SetTextStyle ignore error %d", err )
+        }     
+    else
+        {
+        // once we know that it's been set successfully, we can cache the client-side id 
+        // on the client-side, for later use
+        iTextVisualData->iTextStyleId = aTextStyleId;
+        }
+#endif // #ifdef ALF_RASTER_TEXT
+    }
+    
+// ---------------------------------------------------------------------------
+// Sets alignment.
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C void CAlfTextVisual::SetAlign( TAlfAlignHorizontal aAlignHorizontal,
+                                        TAlfAlignVertical aAlignVertical)
+    {
+    TInt2 params(aAlignHorizontal, aAlignVertical);
+    TPckgC<TInt2> buf(params);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfTextVisualSetAlign, buf );
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::SetAlign ignore error %d", err )
+        }     
+    }
+    
+// ---------------------------------------------------------------------------
+// Sets the line spacing for multiline text visual when the text wraps around.
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C void CAlfTextVisual::SetLineSpacing(TInt aLineSpacing, 
+                                             TLineSpacingUnits aUnits)
+    {
+#ifdef ALF_RASTER_TEXT
+    iTextVisualData->iLineSpacing = aLineSpacing;
+    iTextVisualData->iLineSpacingUnit = aUnits;   
+    if (iTextVisualData->iMesh->Lines() > 1)
+        {
+        UpdateMesh();    
+        }    
+#else
+    TInt2 params(aLineSpacing, aUnits);
+    TPckgC<TInt2> buf(params);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfTextVisualSetLineSpacing, buf );
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::SetAlign ignore error %d", err )
+        }     
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C TSize CAlfTextVisual::TextExtents() const
+    {
+#ifdef ALF_RASTER_TEXT
+    TSize size( 0, 0 );    
+    if( Text().Length() != 0 )
+        {
+        TRAP_IGNORE(size = iTextVisualData->iTextStyle->LineExtentsL(Text()))
+        }
+        
+    return size;
+#else
+    if( Text().Length() == 0 )
+        {
+        return TSize( 0, 0 );
+        }
+
+    TBufC8<1> inDum;
+    TSize size;
+    TPckg<TSize> outBuf(size);
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfTextVisualTextExtents, inDum, outBuf);
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::TextExtents ignore error %d", err )
+        } 
+        
+    return size;
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C TRect CAlfTextVisual::SubstringExtents(TUint aStart, TUint aEnd) const
+    {
+#ifdef ALF_RASTER_TEXT
+    TSize size( 0, 0 );    
+    if( Text().Length() != 0 && aStart < aEnd )
+        {
+        TRAP_IGNORE(size = iTextVisualData->iTextStyle->LineExtentsL(Text().Mid(aStart, aEnd-aStart)))
+        }
+        
+    return size;
+#else
+    if( Text().Length() == 0 )
+        {
+        return TSize( 0, 0 );
+        }
+
+    TInt2 params(aStart, aEnd);
+    TPckgC<TInt2> inBuf(params);
+    TRect size;
+    TPckg<TRect> outBuf(size);
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfTextVisualSubstringExtents, inBuf, outBuf);
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::SubstringExtents ignore error %d", err )
+        } 
+        
+    return size;        
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C TAlfPreconfiguredTextStyle CAlfTextVisual::Style()
+    {
+#ifdef ALF_RASTER_TEXT
+    return (TAlfPreconfiguredTextStyle)TextStyle();        
+
+#else
+    TAlfPreconfiguredTextStyle style = EAlfTextStyleNormal;
+    TAlfBackgroundType backgroundType = EAlfBackgroundTypeLight; 
+    TInt2 params(style, backgroundType);
+    TPckg<TInt2> outBuf(params);
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfTextVisualStyle, KNullDesC8(), outBuf);    
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::Style ignore error %d", err )
+        } 
+        
+    return style;        
+ #endif
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C TInt CAlfTextVisual::TextStyle() const
+    {
+    // use the client-side cache, as this id only makes sense on the client side
+    return iTextVisualData->iTextStyleId;
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C void CAlfTextVisual::SetMaxLineCount(TInt aMaxLineCount)
+    {
+#ifdef ALF_RASTER_TEXT
+    if (aMaxLineCount != iTextVisualData->iMaxLineCount )
+        {
+        iTextVisualData->iMaxLineCount = aMaxLineCount;
+        if (iTextVisualData->iMesh->Lines() > aMaxLineCount)
+            {
+            UpdateMesh();
+            }
+        }
+ 
+#else
+    TPckgC<TInt> inBuf(aMaxLineCount);    
+    TInt err = Comms()->DoCmdNoReply(EAlfTextVisualSetMaxLineCount,  inBuf);     
+        
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::SetMaxLineCount ignore error %d", err )
+        }        
+#endif
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C TInt CAlfTextVisual::MaxLineCount() const
+    {
+#ifdef ALF_RASTER_TEXT
+    return iTextVisualData->iMaxLineCount;
+#else
+    TBufC8<1> inDum;
+    TInt value = 0;
+    TPckg<TInt> outBuf(value);    
+    TInt err = Comms()->DoSynchronousCmd(EAlfTextVisualMaxLineCount, inDum, 
+        outBuf);   
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::MaxLineCount ignore error %d", err )
+        }     
+         
+    return value;                
+#endif
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//      
+
+EXPORT_C CAlfTextVisual::TLineWrap CAlfTextVisual::Wrapping() const
+    {
+#ifdef ALF_RASTER_TEXT
+	return (CAlfTextVisual::TLineWrap)iTextVisualData->iWrappingMode;      
+#else
+    TBufC8<1> inDum;
+    TLineWrap value = ELineWrapTruncate;
+    TPckg<TLineWrap> outBuf(value);    
+    TInt err = Comms()->DoSynchronousCmd(EAlfTextVisualWrapping, inDum, 
+        outBuf);    
+        
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::Wrapping ignore error %d", err )
+        }   
+        
+    return value;                        
+#endif
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C void CAlfTextVisual::SetWrapping(CAlfTextVisual::TLineWrap aWrap)
+    {
+#ifdef ALF_RASTER_TEXT
+    if(iTextVisualData->iWrappingMode != (TInt)aWrap)
+        {
+        iTextVisualData->iWrappingMode = (TInt)aWrap;
+        UpdateMesh();
+        }
+#else
+    TPckg<TLineWrap> inBuf(aWrap);    
+    TInt err = Comms()->DoCmdNoReply(EAlfTextVisualSetWrapping, inBuf ); 
+        
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::SetWrapping ignore error %d", err )
+        }     
+#endif
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C TAlfBackgroundType CAlfTextVisual::BackgroundType()
+    {
+#ifdef ALF_RASTER_TEXT
+    TAlfBackgroundType backgroundType = EAlfBackgroundTypeLight;          
+    return backgroundType;   
+#else
+    TAlfPreconfiguredTextStyle style = EAlfTextStyleNormal;
+    TAlfBackgroundType backgroundType = EAlfBackgroundTypeLight; 
+    TInt2 params(style, backgroundType);
+    TPckg<TInt2> outBuf(params);
+    
+    TInt err = Comms()->DoSynchronousCmd(EAlfTextVisualStyle, KNullDesC8(), outBuf);    
+        
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::BackgroundType ignore error %d", err )
+        }  
+         
+    return backgroundType;                                
+#endif
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C TAlfTimedValue CAlfTextVisual::ShadowOpacity()
+    {
+    if ( DropShadowHandler() )
+        {
+        return 1.f; // not the real value...
+        }   
+        
+    return TAlfTimedValue(0);                                        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C void CAlfTextVisual::SetShadowOpacity(const TAlfTimedValue& aShadowOpacity)
+    {
+    TRAPD( err, EnableDropShadowL() );
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::SetShadowOpacity ignore error %d", err )
+        return;
+        }      
+        
+    DropShadowHandler()->SetOpacity( aShadowOpacity );    
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C void CAlfTextVisual::SetColor(TRgb aColor)
+    {
+    TAlfTextVisualFontColorParams params;
+    params.iColor = aColor;
+    params.iId = KAknsIIDNone; // This will be ignored in the serverside
+    params.iIndex = 0; // This will be ignored in the serverside
+    
+    TPckg<TAlfTextVisualFontColorParams> inBuf(params);    
+    TInt err = Comms()->DoCmdNoReply(EAlfTextVisualSetColor, inBuf);  
+        
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::SetColor1 ignore error %d", err )
+        }            
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C void CAlfTextVisual::SetColor(const TAknsItemID& aId,const TInt aIndex)
+    {
+    TAlfTextVisualFontColorParams params;
+    params.iColor = KRgbBlack; // This will be ignored in the serverside
+    params.iId = aId;
+    params.iIndex = aIndex;
+    
+    TPckg<TAlfTextVisualFontColorParams> inBuf(params);    
+    TInt err = Comms()->DoCmdNoReply(EAlfTextVisualSetColor, inBuf);  
+        
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::SetColor1 ignore error %d", err )
+        }            
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C void CAlfTextVisual::EnableShadow(TBool aDoEnable)
+    {
+    TRAPD( err, EnableDropShadowL( aDoEnable ) );
+        
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::EnableShadow ignore error %d", err )
+        }      
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfTextVisual::RemoveAndDestroyAllD()
+    {
+    CAlfVisual::RemoveAndDestroyAllD();
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfTextVisual::UpdateChildrenLayout(TInt aTransitionTime )
+    {
+    CAlfVisual::UpdateChildrenLayout( aTransitionTime );
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfVisual* CAlfTextVisual::FindTag(const TDesC8& aTag)
+    {
+    return CAlfVisual::FindTag( aTag );
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfTextVisual::DoRemoveAndDestroyAllD()
+    {
+    CAlfVisual::DoRemoveAndDestroyAllD();
+    }
+    
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfTextVisual::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfVisual::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
+    }
+    
+// ---------------------------------------------------------------------------
+// DEPRECATED! Set Color for Visual using String table and Index
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTextVisual::SetColor(const TDesC& /*aTextColorTable*/,const TDesC& /*aColorIndex*/)
+    {   	     		   
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfTextVisual::SetOffset(const TAlfTimedPoint& aOffset)
+    {
+    TPckg<TAlfTimedPoint> inBuf(aOffset);    
+    TInt err = Comms()->DoCmdNoReply(EAlfTextVisualSetOffset, inBuf);  
+        
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::SetOffset ignore error %d", err )
+        }                    
+    }
+     
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TAlfTimedPoint CAlfTextVisual::Offset() const
+    {
+    TBufC8<1> inDum;
+    TAlfTimedPoint value;
+    TPckg<TAlfTimedPoint> outBuf(value);    
+    TInt err = Comms()->DoSynchronousCmd(EAlfTextVisualOffset, inDum, 
+        outBuf);    
+        
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::Offset ignore error %d", err )
+        }  
+        
+    return value;                                                
+    }
+
+#ifdef ALF_RASTER_TEXT
+// for convenience
+void DoLocalHighlightConversionL(TInt aStart, TInt aEnd, HBufC* aText, CAlfTextStyle* aStyle, TSize& aStartPos, TSize& aEndPos)
+    {
+    aStartPos = aStyle->LineExtentsL(aText->Left(aStart));
+    aEndPos = aStyle->LineExtentsL(aText->Left(aEnd));
+    }
+#endif
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C void CAlfTextVisual::SetHighlightRange(TInt aStart, TInt aEnd, TRgb& aHighlightColor, TRgb& aHighlightTextColor)
+    {
+#ifdef ALF_RASTER_TEXT
+    // ToDO: convert to mesh coordinates    
+    CAlfTextStyle* style = iTextVisualData->iTextStyle;
+    if (!style || Text().Length() == 0 || // has not been rasterized ever or text lenght is zero
+        (aStart < 0) || (aStart > Text().Length()) || (aEnd < 0) || (aStart >= aEnd) || (aEnd > Text().Length()))
+                
+        {
+        return;
+        }
+    
+    TSize startPos, endPos;
+    TRAPD(err, DoLocalHighlightConversionL(aStart, aEnd, iTextVisualData->iText, style, startPos, endPos))
+    if (!err)
+        {    
+        TAlfTextVisualSetHighlightRangeParams params;
+        params.iStart = startPos.iWidth;
+        params.iEnd = endPos.iWidth;
+        params.iHighlightColor = aHighlightColor;
+        params.iHighlightTextColor = aHighlightTextColor;
+            
+        TPckg<TAlfTextVisualSetHighlightRangeParams> inBuf(params);    
+        err = Comms()->DoCmdNoReply(EAlfTextVisualSetHighlightRange, inBuf);  
+            
+        if ( err != KErrNone )
+            {
+            __ALFLOGSTRING1( "CAlfTextVisual::SetHighlightRange ignore error %d", err )
+            }            
+        }
+    
+    
+#else
+    TAlfTextVisualSetHighlightRangeParams params;
+    params.iStart = aStart;
+    params.iEnd = aEnd;
+    params.iHighlightColor = aHighlightColor;
+    params.iHighlightTextColor = aHighlightTextColor;
+        
+    TPckg<TAlfTextVisualSetHighlightRangeParams> inBuf(params);    
+    TInt err = Comms()->DoCmdNoReply(EAlfTextVisualSetHighlightRange, inBuf);  
+        
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfTextVisual::SetHighlightRange ignore error %d", err )
+        }            
+#endif
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alftimedvalue.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,202 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Timed value class
+*
+*/
+
+
+#include "alf/alftimedvalue.h"
+#include "alf/alfutil.h"
+
+EXPORT_C TAlfTimedValue::TAlfTimedValue()
+    :iValueNow(0),
+    iValueTarget(0),
+    iTimeToTarget(0),
+    iInterpolationStyle(0),
+    iMappingFunctionIdentifier(0),
+    iSpeed(0),
+    iFlags(EAlfValueFlagsNone)
+    {
+    }
+
+EXPORT_C TAlfTimedValue::TAlfTimedValue(TReal32 aInitialValue) __SOFTFP
+    :iValueNow(aInitialValue),
+    iValueTarget(0),
+    iTimeToTarget(0),
+    iInterpolationStyle(0),
+    iMappingFunctionIdentifier(0),
+    iSpeed(0),
+    iFlags(EAlfValueNowChanged)
+    {
+    }
+
+EXPORT_C TAlfTimedValue::TAlfTimedValue(TReal32 aTargetValue, TInt aTime) __SOFTFP
+    :iValueNow(0),
+    iValueTarget(aTargetValue),
+    iTimeToTarget(aTime),
+    iInterpolationStyle(0),
+    iMappingFunctionIdentifier(0),
+    iSpeed(0),
+    iFlags(EAlfValueTargetChanged)
+    {        
+    }
+    
+    
+EXPORT_C void TAlfTimedValue::SetValueNow(const TReal32& aValueNow)
+    {
+    iFlags |= EAlfValueNowChanged;    
+    iValueNow = aValueNow;
+    }
+    
+EXPORT_C void TAlfTimedValue::SetTarget(const TReal32& aTarget, TInt aTime)
+    {
+    iFlags |= EAlfValueTargetChanged;    
+    iValueTarget = aTarget;
+    iTimeToTarget = aTime;
+    }
+
+EXPORT_C void TAlfTimedValue::SetTargetWithSpeed(TReal32 aValue, TReal32 aUnitsPerSecond) __SOFTFP
+    {
+    iFlags |= EAlfValueTargetChanged;    
+    iFlags |= EAlfSpeedChanged;    
+    iValueTarget = aValue;
+    iSpeed = aUnitsPerSecond;    
+    }
+
+EXPORT_C TReal32 TAlfTimedValue::Speed() const __SOFTFP
+    {
+    return iSpeed;    
+    }
+
+
+EXPORT_C void TAlfTimedValue::SetStyle(TAlfInterpolationStyle aStyle)
+    {
+    iFlags |= EAlfInterpolationStyleChanged;    
+    iInterpolationStyle = aStyle;
+    }
+
+EXPORT_C TAlfInterpolationStyle TAlfTimedValue::Style()
+    {
+    return TAlfInterpolationStyle(iInterpolationStyle);        
+    }
+    
+EXPORT_C void TAlfTimedValue::SetMappingFunctionIdentifier(TInt aIdentifier) 
+    {
+    iFlags |= EAlfMappingFunctionChanged;    
+    iMappingFunctionIdentifier = aIdentifier;
+    }
+
+// Todo: real use case for inline perhaps    
+EXPORT_C TReal32 TAlfTimedValue::ValueNow() const __SOFTFP
+    {
+    return iValueNow;
+    }
+
+// Todo: real use case for inline perhaps        
+EXPORT_C TReal32 TAlfTimedValue::Target() const __SOFTFP
+    {
+    return iValueTarget;    
+    }
+// Todo: real use case for inline perhaps        
+EXPORT_C TInt TAlfTimedValue::TimeToTargetinMilliSeconds() const
+    {
+    return iTimeToTarget;
+    }
+
+EXPORT_C TInt& TAlfTimedValue::Flags()
+    {
+    return iFlags;
+    }
+
+EXPORT_C TInt TAlfTimedValue::MappingFunctionIdentifier() const 
+    {
+    if (iFlags&EAlfMappingFunctionChanged)
+        {
+        return iMappingFunctionIdentifier;
+        }
+        
+    return KErrNotFound;
+    }
+
+
+
+EXPORT_C TAlfTimedPoint::TAlfTimedPoint()
+    {}
+
+EXPORT_C TAlfTimedPoint::TAlfTimedPoint(TReal32 aX, TReal32 aY) __SOFTFP
+    {
+    iX = TAlfTimedValue(aX);
+    iY = TAlfTimedValue(aY);    
+    }
+
+EXPORT_C TAlfTimedPoint::TAlfTimedPoint(TReal32 aXTarget, TReal32 aYTarget, TInt aTransitionTime) __SOFTFP
+    {
+    iX = TAlfTimedValue(aXTarget, aTransitionTime);
+    iY = TAlfTimedValue(aYTarget, aTransitionTime);            
+    }
+    
+
+EXPORT_C void TAlfTimedPoint::SetMappingFunctionIdentifier(TInt aIdentifier)
+    {
+    // Both use the same function, but the components are different.
+    iX.SetMappingFunctionIdentifier(aIdentifier);
+    iY.SetMappingFunctionIdentifier(aIdentifier);        
+    }
+
+EXPORT_C void TAlfTimedPoint::SetStyle(TAlfInterpolationStyle aStyle)
+    {
+    iX.SetStyle(aStyle);
+    iY.SetStyle(aStyle);        
+    }
+
+EXPORT_C void TAlfTimedPoint::SetTarget(const TAlfRealPoint& aPoint, TInt aTransitionTime)
+    {
+    iX.SetTarget(aPoint.iX, aTransitionTime);
+    iY.SetTarget(aPoint.iY, aTransitionTime);                
+    }
+    
+EXPORT_C void TAlfTimedPoint::SetTarget(TReal32 aValue, TInt aTransitionTime) __SOFTFP
+    {
+    iX.SetTarget(aValue, aTransitionTime);
+    iY.SetTarget(aValue, aTransitionTime);                        
+    }
+
+EXPORT_C void TAlfTimedPoint::SetTargetWithSpeed(const TAlfRealPoint& aPoint, TReal32 aUnitsPerSecond) __SOFTFP
+    {
+    iX.SetTargetWithSpeed(aPoint.iX, aUnitsPerSecond);
+    iY.SetTargetWithSpeed(aPoint.iY, aUnitsPerSecond);                        
+    }
+  
+EXPORT_C void TAlfTimedPoint::SetTargetWithSpeed(TReal32 aValue, TReal32 aUnitsPerSecond) __SOFTFP
+    {
+    iX.SetTargetWithSpeed(aValue, aUnitsPerSecond);
+    iY.SetTargetWithSpeed(aValue, aUnitsPerSecond);                                
+    }
+    
+EXPORT_C TPoint TAlfTimedPoint::IntValueNow() const
+    {
+    // Round the float returned by ValueNow to the closest integer.
+    return TPoint(AlfUtil::RoundFloatToInt(iX.ValueNow()), AlfUtil::RoundFloatToInt(iY.ValueNow()));
+    }
+
+EXPORT_C TPoint TAlfTimedPoint::IntTarget() const
+    {
+    // Round the float returned by ValueNow to the closest integer.
+    return TPoint(AlfUtil::RoundFloatToInt(iX.Target()), AlfUtil::RoundFloatToInt(iY.Target()));
+    }
+
+
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alftransformation.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,263 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Transformation class
+*
+*/
+
+
+
+#include "alf/alftransformation.h"
+#include "alftransformationsubsession.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+
+// Provate data
+struct CAlfTransformation::TPrivateData
+    {
+    CAlfEnv* iEnv;              // Not owned.
+    RAlfTransformationSubSession iSubSession;     // Owned
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfTransformation::CAlfTransformation()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfTransformation::ConstructL(CAlfEnv& aEnv)
+    {
+    iData = new (ELeave) TPrivateData;
+    
+    iData->iEnv = &aEnv;
+    User::LeaveIfError( iData->iSubSession.Open( aEnv.Client() ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTransformation* CAlfTransformation::NewL(CAlfEnv& aEnv)
+    {
+    CAlfTransformation* self = CAlfTransformation::NewLC(aEnv);
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTransformation* CAlfTransformation::NewLC(CAlfEnv& aEnv)
+    {
+    CAlfTransformation* self = new( ELeave ) CAlfTransformation;
+    CleanupStack::PushL( self );
+    self->ConstructL(aEnv);
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destrucotr
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTransformation::~CAlfTransformation()
+    {
+    if ( iData )
+        {
+        iData->iSubSession.Close();
+        }
+    delete iData;
+    iData = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Return server handle
+// ---------------------------------------------------------------------------
+//  
+TInt CAlfTransformation::ServerHandle() const
+    {
+    return iData->iSubSession.SubSessionHandle();
+    }
+
+// ---------------------------------------------------------------------------
+// Load identity
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTransformation::LoadIdentity()
+    {
+    iData->iSubSession.LoadIdentity();
+    }
+ 
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTransformation::Count() const
+    {
+    return iData->iSubSession.Count();                            
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfTransformation::NonIdentityCount() const
+    {
+    return iData->iSubSession.NonIdentityCount();                    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfTransformation::TTransform CAlfTransformation::Step(TInt aIndex)
+    {
+    return iData->iSubSession.Step(aIndex);            
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTransformation::ReplaceStep(TInt aIndex, 
+    CAlfTransformation::TTransform aTransformationStep)
+    {
+    iData->iSubSession.ReplaceStep(aIndex,aTransformationStep);    
+    }
+
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTransformation::Rotate(TReal32 aAngle) __SOFTFP
+    {
+    TAlfTimedValue timedAngle;
+    timedAngle.SetTarget(aAngle,0);
+    Rotate(timedAngle);        
+    }
+
+// ---------------------------------------------------------------------------
+// Rotate
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTransformation::Rotate(const TAlfTimedValue& aAngle)
+    {
+    Rotate(aAngle, 0.f, 0.f, -1.f);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTransformation::Rotate(TReal32 aAngle, TReal32 aAxisX, 
+    TReal32 aAxisY, TReal32 aAxisZ) __SOFTFP
+    {
+    TAlfTimedValue timedAngle;
+    timedAngle.SetTarget(aAngle,0);
+    Rotate(timedAngle, aAxisX, aAxisY, aAxisZ);        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTransformation::Rotate(const TAlfTimedValue& aAngle, 
+                         TReal32 aAxisX, TReal32 aAxisY, TReal32 aAxisZ) __SOFTFP
+    {
+    iData->iSubSession.Rotate(aAngle,aAxisX,aAxisY,aAxisZ);            
+    }
+
+    
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTransformation::Translate(const TAlfTimedValue& aX, 
+    const TAlfTimedValue& aY)
+    {
+    iData->iSubSession.Translate(aX, aY);      
+    }
+
+// ---------------------------------------------------------------------------
+// Tramslate
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C void CAlfTransformation::Translate(TReal32 aX, TReal32 aY) __SOFTFP
+    {
+    iData->iSubSession.Translate( aX, aY );
+    }
+    
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTransformation::Scale(TReal32 aX, TReal32 aY) __SOFTFP
+    {
+    Scale(aX, aY, 1.f);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTransformation::Scale(const TAlfTimedValue& aX, 
+    const TAlfTimedValue& aY)
+    {
+    TAlfTimedValue timedZ;
+    timedZ.SetTarget(1.f,0);
+    Scale(aX, aY, timedZ);    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTransformation::Scale(TReal32 aX, TReal32 aY, TReal32 aZ) __SOFTFP
+    {
+    TAlfTimedValue timedX;
+    TAlfTimedValue timedY;
+    TAlfTimedValue timedZ;
+    timedX.SetTarget(aX,0);
+    timedY.SetTarget(aY,0);
+    timedZ.SetTarget(aZ,0);
+    Scale(timedX, timedY, timedZ);                
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfTransformation::Scale(const TAlfTimedValue& aX, 
+    const TAlfTimedValue& aY, const TAlfTimedValue& aZ)
+    {
+    iData->iSubSession.Scale(aX,aY,aZ);
+    }
+    
+    
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alftransformationsubsession.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,236 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Sub-session for transformation
+*
+*/
+
+
+
+#include "alftransformationsubsession.h"
+#include "alf/alfconstants.h"
+#include "alflogger.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Opens subsession
+// ---------------------------------------------------------------------------
+//
+TInt RAlfTransformationSubSession::Open( RAlfClient& aSession )
+    {
+    TAlfImplementationInformation info(EAlfTransformationSubSessionOpen);
+    TPckgC<TAlfImplementationInformation> infoBuf(info);
+
+
+    return CreateSubSession( 
+        aSession,
+        EAlfCreateSubSession,
+        TIpcArgs(&infoBuf) );
+    }
+ 
+// ---------------------------------------------------------------------------
+// Closes subsession
+// ---------------------------------------------------------------------------
+//   
+void RAlfTransformationSubSession::Close()
+    {
+    CloseSubSession( EAlfCloseSubSession );
+    }
+    
+// ---------------------------------------------------------------------------
+// Loads identity matrix i.e. resets.
+// ---------------------------------------------------------------------------
+// 
+void RAlfTransformationSubSession::LoadIdentity()
+    {
+    Send/*Receive*/(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs( EAlfTransformationLoadIdentity ) );
+    __ALFLOGSTRING( "RAlfTransformationSubSession::LoadIdentity sent" )
+    }
+    
+// ---------------------------------------------------------------------------
+// 2D translate.
+// ---------------------------------------------------------------------------
+// 
+void RAlfTransformationSubSession::Translate( 
+    TReal32 aX, 
+    TReal32 aY )
+    {
+    TPckg<TReal32> xRealPckg(aX);
+    TPckg<TReal32> yRealPckg(aY);
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs( EAlfTransformationTranslate, &xRealPckg, &yRealPckg ) );
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "RAlfTransformationSubSession::Translate ignore error %d", err )
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 2D rotation.
+// ---------------------------------------------------------------------------
+// 
+void RAlfTransformationSubSession::Rotate( const TAlfTimedValue& aAngle )
+    {
+    TPckgC<TAlfTimedValue> anglePckg(aAngle);
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfTransformationRotate, &anglePckg ) );
+    if ( err )
+        {
+        __ALFLOGSTRING1( "RAlfTransformationSubSession::Rotate ignore error %d", err )
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+TInt RAlfTransformationSubSession::Count() const
+    {
+    TInt retVal = 0;
+    TPckg<TInt> retValPckg(retVal);
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfTransformationCount, &retValPckg ) );
+    if ( err )
+        {
+        __ALFLOGSTRING1( "RAlfTransformationSubSession::Count ignore error %d", err )
+        }       
+    return retVal;
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+TInt RAlfTransformationSubSession::NonIdentityCount() const
+    {
+    TInt retVal = 0;
+    TPckg<TInt> retValPckg(retVal);
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfTransformationNonIdentityCount, &retValPckg ) );
+    if ( err )
+        {
+        __ALFLOGSTRING1( "RAlfTransformationSubSession::NonIdentityCount ignore error %d", err )
+        }                   
+    return retVal;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+CAlfTransformation::TTransform RAlfTransformationSubSession::Step(TInt aIndex)
+    {
+    CAlfTransformation::TTransform retVal;
+    TPckg<CAlfTransformation::TTransform> retValPckg(retVal);
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfTransformationStep, aIndex, &retValPckg) );
+    if ( err )
+        {
+        __ALFLOGSTRING1( "RAlfTransformationSubSession::Step ignore error %d", err )
+        }                  
+    return retVal;        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+void RAlfTransformationSubSession::ReplaceStep(TInt aIndex, 
+    CAlfTransformation::TTransform aTransformationStep)
+    {
+    TPckg<CAlfTransformation::TTransform> inputValPckg(aTransformationStep);
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfTransformationReplaceStep, aIndex, &inputValPckg ) );
+    if ( err )
+        {
+        __ALFLOGSTRING1( "RAlfTransformationSubSession::ReplaceStep ignore error %d", err )
+        }               
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+void RAlfTransformationSubSession::Rotate(const TAlfTimedValue& aAngle, 
+                         TReal32 aAxisX, TReal32 aAxisY, TReal32 aAxisZ)
+    {
+    TAlfTransformationRotateParams params;
+    params.iAngle = aAngle;
+    params.iAxisX = aAxisX;
+    params.iAxisY = aAxisY;
+    params.iAxisZ = aAxisZ;
+    
+    TPckg<TAlfTransformationRotateParams> inputValPckg(params);
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfTransformationRotate3D, &inputValPckg ) );
+    if ( err )
+        {
+        __ALFLOGSTRING1( "RAlfTransformationSubSession::Rotate ignore error %d", err )
+        }                   
+        
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+void RAlfTransformationSubSession::Translate(const TAlfTimedValue& aX, 
+    const TAlfTimedValue& aY)
+    {
+    TAlfTransformationTimedParams params;
+    params.iX = aX;
+    params.iY = aY;
+    
+    TPckg<TAlfTransformationTimedParams> inputValPckg(params);
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfTransformationTranslate2D, &inputValPckg ) );
+    if ( err )
+        {
+        __ALFLOGSTRING1( "RAlfTransformationSubSession::Translate ignore error %d", err )
+        }                               
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+void RAlfTransformationSubSession::Scale(const TAlfTimedValue& aX, 
+    const TAlfTimedValue& aY, const TAlfTimedValue& aZ)
+    {
+    TAlfTransformationTimedParams params;
+    params.iX = aX;
+    params.iY = aY;
+    params.iZ = aZ;
+    
+    TPckg<TAlfTransformationTimedParams> inputValPckg(params);
+    TInt err = SendReceive(
+        EAlfDoSubSessionCmd, 
+        TIpcArgs(EAlfTransformationScale, &inputValPckg ) );
+    if ( err )
+        {
+        __ALFLOGSTRING1( "RAlfTransformationSubSession::Scale ignore error %d", err )
+        }                   
+        
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfutil.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,571 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Misc. utils
+*
+*/
+
+
+
+//
+// NOTE THAT THIS FILE IS ALMOST IDENTICAL WITH HUIUTIL.CPP !
+//
+// HuiUtil.h functions are not called from this file because we want alfclient.dll
+// to not have unnecessary (any) static dependencies to core toolkit hitchcock.dll 
+// (a.k.a huitk.dll, uiaccel.dll,...). There is no other reason to duplicate 
+// this code.
+//
+
+#include "alf/alfutil.h"
+#include "alf/alftimedvalue.h"
+
+#include <e32math.h>
+#include <hal.h>
+#include <AknUtils.h>
+
+const TReal32 KLengthUnitDivisor = 320.0;
+
+/// Character used for separating tags in a tag descriptor.
+const TInt KTagSeparator = ':';
+
+
+// Calculates the smallest power-of-two that is equal to or greater than
+// a value.
+EXPORT_C TInt AlfUtil::Power2(TInt aValue)
+    {
+    ASSERT(aValue>0);
+    if(aValue<=0)
+        {
+        return 0;
+        }
+
+    TInt i;
+    for(i = 1; i < aValue && i < KMaxTInt/2; i *= 2)
+        {}
+    return i;
+    }
+
+EXPORT_C TInt AlfUtil::Power2RoundDown(TInt aValue)
+    {
+    ASSERT(aValue>0);
+    if(aValue <= 0)
+        {
+        return 0;
+        }
+
+    TInt i = 1;
+    for(; (i * 4 <= aValue) && (i < KMaxTInt/4); i *= 4)
+        {}
+    for(; (i * 2 <= aValue) && (i < KMaxTInt/2); i *= 2)
+        {}
+    return i;
+    }
+
+
+EXPORT_C TReal32 AlfUtil::Interpolate(TReal32 aPos, TReal32 aMin, TReal32 aMax) __SOFTFP
+    {
+    aPos = Max(0.f, aPos);
+    aPos = Min(aPos, 1.f);
+    return (1 - aPos) * aMin + aPos * aMax;
+    }
+
+
+EXPORT_C void AlfUtil::WrapValue(TReal32& aValue, TReal32 aLow, TReal32 aHigh) __SOFTFP
+    {
+    TReal32 segments = 0;
+    TReal32 length = aHigh - aLow;
+
+    if(length <= 0)
+        {
+        aValue = aLow;
+        return;
+        }
+
+    if(aValue < aLow)
+        {
+        // Wrap from below.
+        segments = (aLow - aValue) / length;
+        aValue += (TInt(segments) + 1) * length;
+        }
+    else if(aValue >= aHigh)
+        {
+        // Wrap from above.
+        segments = (aValue - aHigh) / length;
+        aValue -= (TInt(segments) + 1) * length;
+        }
+    else
+        {
+        // for PC lint
+        }
+    }
+
+
+EXPORT_C TInt AlfUtil::RandomInt(TInt aMin, TInt aMax)
+    {
+    TUint32 random = Math::Random();
+    TUint range = aMax - aMin;
+    if(range > 0)
+        {
+        return aMin + (random % (range + 1));
+        }
+    else
+        {
+        return aMin;
+        }
+    }
+
+
+EXPORT_C TReal32 AlfUtil::RandomReal(TReal32 aMin, TReal32 aMax) __SOFTFP
+    {
+    /** @todo  Could use Math::FRand(). */
+    TReal32 random = RandomInt(0, 10000000) / 10000000.0;
+    return aMin + (aMax - aMin) * random;
+    }
+
+
+EXPORT_C TUint AlfUtil::FreeMemory(TUint* aTotalMemory)
+    {
+    TInt total = 0;
+    TInt free = 0;
+
+    HAL::Get(HALData::EMemoryRAM, total);
+    HAL::Get(HALData::EMemoryRAMFree, free);
+    if(aTotalMemory)
+        {
+        *aTotalMemory = total;
+        }
+    return free;
+    }
+
+
+EXPORT_C TSize AlfUtil::ScreenSize()
+    {
+    TSize screenSize(320, 240);
+
+    AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EScreen, screenSize);
+
+    return screenSize;
+    }
+
+
+EXPORT_C CFont* AlfUtil::NearestFontInTwipsL(const TFontSpec& aFontSpec)
+    {
+    /// @todo  Accessing the screen device during a display resizing event may
+    ///        result in a font that is suitable for the display size that
+    ///        was in use prior to the resize. Probably we should use
+    ///        AknLayoutUtils here.
+
+    CFont* font = NULL;
+    CWsScreenDevice* screenDev = CCoeEnv::Static()->ScreenDevice();
+    User::LeaveIfError( screenDev->GetNearestFontInTwips(font, aFontSpec) );
+    return font;
+    }
+
+
+EXPORT_C void AlfUtil::ReleaseFont(CFont* aFont)
+    {
+    CCoeEnv::Static()->ScreenDevice()->ReleaseFont(aFont);
+    }
+
+
+EXPORT_C TReal32 AlfUtil::LengthUnit() __SOFTFP
+    {
+    return Max(ScreenSize().iWidth, ScreenSize().iHeight) / KLengthUnitDivisor;
+    }
+
+
+EXPORT_C TReal32 AlfUtil::QuickLength(TAlfRealPoint& aVector) __SOFTFP
+    {
+    TReal32 dx = Abs(aVector.iX);
+    TReal32 dy = Abs(aVector.iY);
+    if(dx < dy)
+        {
+        return dx + dy - dx/2;
+        }
+    else
+        {
+        return dx + dy - dy/2;
+        }
+    }
+
+
+EXPORT_C TReal32 AlfUtil::QuickLength(TReal32 aDx, TReal32 aDy) __SOFTFP
+    {
+    TReal32 dx = Abs(aDx);
+    TReal32 dy = Abs(aDy);
+    if(dx < dy)
+        {
+        return dx + dy - dx/2;
+        }
+    else
+        {
+        return dx + dy - dy/2;
+        }
+    }
+
+
+EXPORT_C void AlfUtil::QuickNormalize(TAlfRealPoint& aNormal)
+    {
+    TReal32 approxLength = QuickLength(aNormal);
+
+    if(approxLength > 0)
+        {
+        aNormal.iX /= approxLength;
+        aNormal.iY /= approxLength;
+        }
+    }
+
+
+EXPORT_C void AlfUtil::QuickNormalize(TReal32 aVector[3]) __SOFTFP
+    {
+    TReal32 approxLength = QuickLength(QuickLength(aVector[0], aVector[1]), aVector[2]);
+
+    if(approxLength > 0)
+        {
+        aVector[0] /= approxLength;
+        aVector[1] /= approxLength;
+        aVector[2] /= approxLength;
+        }
+    }
+
+
+EXPORT_C void AlfUtil::CrossProduct(const TReal32 aA[3], const TReal32 aB[3],
+                                    TReal32 aProduct[3]) __SOFTFP
+    {
+    aProduct[0] = aA[1] * aB[2] - aB[1] * aA[2];
+    aProduct[1] = aA[2] * aB[0] - aB[2] * aA[0];
+    aProduct[2] = aA[0] * aB[1] - aB[0] * aA[1];
+    }
+
+
+EXPORT_C void AlfUtil::NormalFromPoints(const TReal32 aPoints[3][3], TReal32 aNormal[3]) __SOFTFP
+    {
+    TReal32 vectors[2][3];
+    TInt i;
+
+    for(i = 0; i < 3; ++i)
+        {
+        vectors[0][i] = aPoints[0][i] - aPoints[1][i];
+        vectors[1][i] = aPoints[0][i] - aPoints[2][i];
+        }
+
+    CrossProduct(vectors[0], vectors[1], aNormal);
+    QuickNormalize(aNormal);
+    }
+
+
+EXPORT_C void AlfUtil::ShadowMatrix(const TReal32 aPlanePoint[3],
+                                    const TReal32 aPlaneNormal[3],
+                                    const TReal32 aLightPos[4],
+                                    TReal32 aDestMat[16]) __SOFTFP
+    {
+    TReal32 planeCoeff[4];
+    TReal32 dot;
+
+    // Find the plane equation coefficients
+    // Find the first three coefficients the same way we find a normal.
+    //NormalFromPoints(aPoints, planeCoeff);
+
+    planeCoeff[0] = aPlaneNormal[0];
+    planeCoeff[1] = aPlaneNormal[1];
+    planeCoeff[2] = aPlaneNormal[2];
+
+    // Find the last coefficient by back substitutions
+    planeCoeff[3] = - ((planeCoeff[0] * aPlanePoint[0]) + (planeCoeff[1] * aPlanePoint[1]) +
+                       (planeCoeff[2] * aPlanePoint[2]));
+
+    // Dot product of plane and light position
+    dot = planeCoeff[0] * aLightPos[0] + planeCoeff[1] * aLightPos[1] +
+          planeCoeff[2] * aLightPos[2] + planeCoeff[3] * aLightPos[3];
+
+    // Now do the projection
+    // First column
+    aDestMat[0] = dot - aLightPos[0] * planeCoeff[0];
+    aDestMat[4] = 0.0f - aLightPos[0] * planeCoeff[1];
+    aDestMat[8] = 0.0f - aLightPos[0] * planeCoeff[2];
+    aDestMat[12] = 0.0f - aLightPos[0] * planeCoeff[3];
+
+    // Second column
+    aDestMat[1] = 0.0f - aLightPos[1] * planeCoeff[0];
+    aDestMat[5] = dot - aLightPos[1] * planeCoeff[1];
+    aDestMat[9] = 0.0f - aLightPos[1] * planeCoeff[2];
+    aDestMat[13] = 0.0f - aLightPos[1] * planeCoeff[3];
+
+    // Third Column
+    aDestMat[2] = 0.0f - aLightPos[2] * planeCoeff[0];
+    aDestMat[6] = 0.0f - aLightPos[2] * planeCoeff[1];
+    aDestMat[10] = dot - aLightPos[2] * planeCoeff[2];
+    aDestMat[14] = 0.0f - aLightPos[2] * planeCoeff[3];
+
+    // Fourth Column
+    aDestMat[3] = 0.0f - aLightPos[3] * planeCoeff[0];
+    aDestMat[7] = 0.0f - aLightPos[3] * planeCoeff[1];
+    aDestMat[11] = 0.0f - aLightPos[3] * planeCoeff[2];
+    aDestMat[15] = dot - aLightPos[3] * planeCoeff[3];
+    }
+
+
+EXPORT_C TReal32 AlfUtil::ColorLightness(const TRgb& aColor) __SOFTFP
+    {
+    TReal32 red = aColor.Red() / 255.0f;
+    TReal32 green = aColor.Red() / 255.0f;
+    TReal32 blue = aColor.Red() / 255.0f;
+
+    return (red*2 + green*3 + blue) / 6.f;
+    }
+
+EXPORT_C void AlfUtil::ScaleFbsBitmapL(const CFbsBitmap & aSrcBitmap,
+                                       CFbsBitmap & aScaledBitmap)
+    {
+    CFbsDevice* targetdevice = NULL;
+    CFbsBitGc* gc = NULL;
+    // create device for drawing onto the target cropped bitmap area
+    targetdevice = CFbsBitmapDevice::NewL(&aScaledBitmap);
+    CleanupStack::PushL(targetdevice);
+    // create graphics context for drawing
+    User::LeaveIfError(targetdevice->CreateContext(gc));
+    // Perform downscale using DrawBitmap
+    gc->DrawBitmap(TRect(TPoint(0,0), aScaledBitmap.SizeInPixels()),
+                   (const CFbsBitmap *)&aSrcBitmap);
+    delete gc;
+    CleanupStack::PopAndDestroy(targetdevice);
+    }
+
+EXPORT_C void AlfUtil::CombineMaskFbsBitmapL(const CFbsBitmap & aSrcBitmap,
+                                             const CFbsBitmap & aSrcMaskBitmap,
+                                             CFbsBitmap & aCombinedBitmap)
+    {
+
+    ASSERT(aCombinedBitmap.DisplayMode() == EColor16MA);
+    ASSERT(aSrcMaskBitmap.DisplayMode() == EGray2 || aSrcMaskBitmap.DisplayMode() == EGray256 || aSrcMaskBitmap.DisplayMode() == EGray16 || aSrcMaskBitmap.DisplayMode() == EGray4);
+    // Resize the target bitmap if needed
+    if (aSrcBitmap.SizeInPixels() != aCombinedBitmap.SizeInPixels())
+        {
+        aCombinedBitmap.Resize(aSrcBitmap.SizeInPixels());
+        }
+
+    // Alternative method to blend manually (SLOW!!):
+    // Apply the alpha mask.
+    TBitmapUtil color((CFbsBitmap*)&aSrcBitmap);
+    TBitmapUtil alpha((CFbsBitmap*)&aSrcMaskBitmap);
+    TBitmapUtil target((CFbsBitmap*)&aCombinedBitmap);
+    color.Begin(TPoint(0, 0));
+    alpha.Begin(TPoint(0, 0));
+    target.Begin(TPoint(0, 0));
+    TSize size(aCombinedBitmap.SizeInPixels());
+    for(TInt y = 0; y < size.iHeight; ++y)
+        {
+        alpha.SetPos(TPoint(0, y));
+        color.SetPos(TPoint(0, y));
+        target.SetPos(TPoint(0, y));
+        for(TInt x = 0; x < size.iWidth; ++x)
+            {
+            target.SetPixel((color.GetPixel() & 0xffffff)
+                          | ((alpha.GetPixel() & 0xff) << 24));
+            target.IncXPos();
+            color.IncXPos();
+            alpha.IncXPos();
+            }
+        }
+    target.End();
+    color.End();
+    alpha.End();
+
+    }
+
+EXPORT_C void AlfUtil::CropFbsBitmapL(const CFbsBitmap & aSrcBitmap,
+                                    CFbsBitmap & aCroppedBitmap,
+                                    TPoint aCropPosition)
+    {
+    CFbsDevice* targetdevice;
+    CFbsBitGc* gc;
+    // create device for drawing onto the target cropped bitmap area
+    targetdevice = CFbsBitmapDevice::NewL(&aCroppedBitmap);
+    CleanupStack::PushL(targetdevice);
+    // create graphics context for drawing
+    User::LeaveIfError(targetdevice->CreateContext(gc));
+    // Perform cropping bitblit
+    gc->BitBlt(TPoint(0,0), &aSrcBitmap,
+               TRect(aCropPosition, aCroppedBitmap.SizeInPixels()));
+    delete gc;
+    CleanupStack::PopAndDestroy(targetdevice);
+    }
+
+EXPORT_C void AlfUtil::ScaleImage(TInt aComponents,
+                                  const TSize& aSrcSize,
+                                  const TUint8* aSrcBuffer,
+                                  const TSize& aDestSize,
+                                  TUint8* aDestBuffer)
+    {
+    // TODO: if there is actual use for this routine,
+    // there might be better minification filters than bilinear...
+    // anyway, now this routine produced acceptable results
+    // when magnifying also...
+    ASSERT (aDestBuffer && aSrcBuffer);
+    ASSERT (aSrcSize.iWidth > 0 && aSrcSize.iHeight > 0);
+    ASSERT (aDestSize.iWidth > 0 && aDestSize.iHeight > 0);
+    ASSERT (aComponents > 0 && aComponents < 5);
+
+    TUint32 xScale = ((aSrcSize.iWidth-1) << 16) / aDestSize.iWidth;
+    TUint32 yScale = ((aSrcSize.iHeight-1) << 16) / aDestSize.iHeight;
+    TUint32 height = aDestSize.iHeight;
+    TUint8* srcptr = const_cast<TUint8*>(aSrcBuffer);
+    TUint8* destPtrLimit = aDestBuffer+(aDestSize.iWidth*aComponents);
+    TUint32 y = yScale&0xffff;
+    do 
+        {
+        TUint32 fV = y&0xffff;
+        TUint32 x = xScale&0xffff;
+        while(aDestBuffer < destPtrLimit)
+            {
+
+            TUint32 fU = x&0xffff;
+            for (TInt components = 0; components < aComponents; components++)
+                {
+                TUint32 componenta = srcptr[((x>>16)*aComponents)+components];
+                TUint32 componentb = srcptr[((x>>16)*aComponents)+aComponents+components];
+                TUint32 componentc = srcptr[((x>>16)*aComponents)+(aSrcSize.iWidth*aComponents)+components];
+                TUint32 componentd = srcptr[((x>>16)*aComponents)+(aSrcSize.iWidth*aComponents)+aComponents+components];
+
+                TUint32 componentf1 = (componenta+(((fU*((componentb-componenta)))>>16))) & 0xff;
+                TUint32 componentf2 = (componentc+(((fU*((componentd-componentc)))>>16))) & 0xff;
+                TUint32 finalcomponent = (componentf1+(((fV*((componentf2-componentf1)))>>16))) & 0xff;
+                *aDestBuffer++ = (TUint8)finalcomponent;
+                }
+            x+=xScale;
+            }
+        y+=yScale;
+        srcptr = const_cast<TUint8*>(aSrcBuffer)+((y>>16)*(aSrcSize.iWidth*aComponents));
+        destPtrLimit+=aDestSize.iWidth*aComponents;
+        }
+    while (--height);
+    }
+
+EXPORT_C void AlfUtil::CropImage(TInt aComponents,
+                                const TSize& aSrcBufferSize,
+                                const TUint8* aSrcBuffer,
+                                const TPoint& aCropOffset,
+                                const TSize& aCroppedSize,
+                                TUint8* aDestBuffer)
+    {
+    ASSERT (aDestBuffer && aSrcBuffer);
+    ASSERT (aSrcBufferSize.iWidth > 0 && aSrcBufferSize.iHeight > 0);
+    ASSERT (aCroppedSize.iWidth > 0 && aCroppedSize.iHeight > 0);
+    ASSERT (aCropOffset.iX < aSrcBufferSize.iWidth);
+    ASSERT (aCropOffset.iY < aSrcBufferSize.iHeight);
+    ASSERT (aComponents > 0 && aComponents < 5);
+
+    TInt targetlinesize = aCroppedSize.iWidth*aComponents;
+    TInt sourcelinesize = aSrcBufferSize.iWidth*aComponents;
+    for (TInt y=0; y<aCroppedSize.iHeight; y++)
+        {
+        // copy line at a time..
+        TAny * source = (TAny*)((const TUint8*)aSrcBuffer
+                            + ((y+aCropOffset.iY)*sourcelinesize)
+                            + (aCropOffset.iX * aComponents));
+        TAny * target = (TAny*)((const TUint8*)aDestBuffer + (y*targetlinesize));
+        memcpy(target, source, targetlinesize);
+        }
+
+    }
+
+EXPORT_C CFbsBitmap* AlfUtil::ConvertBitmapToDisplayModeLC( const CFbsBitmap& aBitmap, const TDisplayMode& aDisplaymode )
+    {
+    // Create target bitmap
+    CFbsBitmap* targetBitmap = new CFbsBitmap();
+    CleanupStack::PushL( targetBitmap );
+    targetBitmap->Create( aBitmap.SizeInPixels(), aDisplaymode );
+
+    // Create bitmap device for target rendering
+    CFbsBitmapDevice* targetDevice = CFbsBitmapDevice::NewL( targetBitmap );
+    CleanupStack::PushL( targetDevice );
+
+    // Create bitmap graphics context
+    CFbsBitGc* bitgc = CFbsBitGc::NewL();
+    CleanupStack::PushL( bitgc );
+    bitgc->Activate( targetDevice );
+
+    // BitBlt the given bitmap to target device.
+    bitgc->BitBlt( TPoint( 0, 0 ), &aBitmap );
+
+    CleanupStack::PopAndDestroy( bitgc );
+    CleanupStack::PopAndDestroy( targetDevice );
+
+    return targetBitmap;
+    }
+
+
+EXPORT_C TBool AlfUtil::TagMatches(const TDesC8& aTagsColonSeparated, const TDesC8& aTag)
+    {
+    TPtrC8 region = aTagsColonSeparated;
+    TPtrC8 tag;
+    TInt index = 0;
+
+    if(!aTag.Length())
+        {
+        // No tag specified; doesn't match anything.
+        return EFalse;
+        }
+
+    while(region.Length() > 0)
+        {
+        // Is there a colon in the region?
+        index = region.Locate(TChar(KTagSeparator));
+        if(index != KErrNotFound)
+            {
+            // A separator exists in the region.
+            tag.Set(region.Left(index));
+            region.Set(region.Right(region.Length() - index - 1));
+            }
+        else
+            {
+            tag.Set(region);
+            region.Set(region.Right(0));
+            }
+
+        if(!tag.Compare(aTag))
+            {
+            // Matches.
+            return ETrue;
+            }
+        }
+
+    // No match could be found.
+    return EFalse;
+    }
+
+
+void AlfUtil::Assert(TBool aCondition)
+    {
+    // Assert that the passed condition is true.
+    if (aCondition == EFalse)
+        {
+        // You can breakpoint here to trap asserts.
+        ASSERT(EFalse);           
+        }
+    }
+
+
+TInt AlfUtil::RoundFloatToInt(TReal32 aVal)
+	{
+	return (aVal < 0 ? (TInt)(aVal - 0.5f) : (TInt)(aVal + 0.5f));
+	}
+
+// ---------------------------------------------------------------------------
+// DEPRECATED: Gets the Avkon Skin TAknsItemID based on string version
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAknsItemID AlfUtil::ThemeItemIdL( CAlfEnv& /*aEnv*/, const TDesC& /*aSkinId*/)
+    {
+	return KAknsIIDNone;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfviewportlayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,191 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Viewport layout
+*
+*/
+
+
+
+#include "alf/alfviewportlayout.h"
+#include "alf/alfcontrol.h"
+#include "alf/alfenv.h"
+#include "alfclient.h"
+#include "alf/alfconstants.h"
+#include "alf/alfgencomponent.h"
+#include "alflogger.h"
+
+// ======== LOCAL FUNCTIONS ========
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// 1st phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfViewportLayout::CAlfViewportLayout()
+    : CAlfLayout()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfViewportLayout::ConstructL(CAlfControl& aOwner)
+    {
+    CAlfLayout::ConstructL(aOwner);
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfViewportLayout::~CAlfViewportLayout()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Creates new anchor layout for the control.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfViewportLayout* CAlfViewportLayout::AddNewL(
+    CAlfControl& aOwnerControl,
+    CAlfLayout* aParentLayout )
+    {
+    CAlfViewportLayout* layout = STATIC_CAST(CAlfViewportLayout*,
+        aOwnerControl.AppendLayoutL(EAlfLayoutTypeViewport, aParentLayout));
+    return layout;
+    }
+
+// ---------------------------------------------------------------------------
+// Set virtual size of view area.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfViewportLayout::SetVirtualSize(const TAlfRealSize& aSize, TInt aTransitionTime)
+    {
+    TAlfTimedPoint safeSize(aSize.iWidth, aSize.iHeight, aTransitionTime);
+    safeSize.SetStyle(EAlfTimedValueStyleLinear);
+
+    TPckgC<TAlfTimedPoint> pckg(safeSize);
+    
+    TInt err = Comms()->DoCmdNoReply(EAlfViewportLayoutSetVirtualSize, pckg );                    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfViewportLayout::SetVirtualSize ignore error %d", err )
+        }  
+        
+    // No need to update children. That is done on the server side.
+    }
+
+// ---------------------------------------------------------------------------
+// Sets viewport size in virtual units.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfViewportLayout::SetViewportSize(const TAlfRealSize& aSize, TInt aTransitionTime)
+    {
+    TAlfTimedPoint safeSize(aSize.iWidth, aSize.iHeight, aTransitionTime);
+    safeSize.SetStyle(EAlfTimedValueStyleLinear);
+
+    TPckgC<TAlfTimedPoint> pckg(safeSize);
+
+    TInt err = Comms()->DoCmdNoReply(EAlfViewportLayoutSetViewportSize, pckg );                    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfViewportLayout::SetViewportSize ignore error %d", err )
+        }      
+        
+    // No need to update children. That is done on the server side.
+    }
+
+// ---------------------------------------------------------------------------
+// Sets viewport pos in virtual units.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfViewportLayout::SetViewportPos(const TAlfRealPoint& aPos, TInt aTransitionTime)
+    {
+    TAlfTimedPoint safeSize(aPos.iX, aPos.iY, aTransitionTime);
+    safeSize.SetStyle(EAlfTimedValueStyleLinear);    
+
+    TPckgC<TAlfTimedPoint> pckg(safeSize);
+    
+    TInt err = Comms()->DoCmdNoReply(EAlfViewportLayoutSetViewportPos, pckg );                    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfViewportLayout::SetViewportPos ignore error %d", err )
+        }     
+        
+    // No need to update children. That is done on the server side.
+    }
+
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfViewportLayout::RemoveAndDestroyAllD()
+    {
+    CAlfLayout::RemoveAndDestroyAllD();
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfViewportLayout::UpdateChildrenLayout(TInt aTransitionTime )
+    {
+    CAlfLayout::UpdateChildrenLayout( aTransitionTime );
+    }
+  
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfVisual* CAlfViewportLayout::FindTag(const TDesC8& aTag)
+    {
+    return CAlfLayout::FindTag( aTag );
+    }
+
+// ---------------------------------------------------------------------------
+// Place holder from CAlfVisual
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfViewportLayout::DoRemoveAndDestroyAllD()
+    {
+    CAlfLayout::DoRemoveAndDestroyAllD();
+    }
+    
+// ---------------------------------------------------------------------------
+// Place holder from CAlfLayout
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TAlfXYMetric CAlfViewportLayout::BaseUnit() const
+    {
+    return CAlfLayout::BaseUnit();
+    }
+
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfViewportLayout::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfLayout::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
+    }
+   
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfvisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1661 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Visual base class.
+*
+*/
+
+
+
+#include "alf/alfvisual.h"
+#include "alf/alfenv.h"
+#include "alf/alflayout.h"
+#include "alf/alfcontrol.h"
+#include "alf/alfbrusharray.h"
+#include "alfclient.h"
+#include "alf/alfdisplay.h"
+#include "alf/alfroster.h"
+#include "alf/alfgencomponent.h"
+#include "alf/alftimedvalue.h"
+#include "alf/alfconstants.h"
+#include "alflogger.h"
+#include "alf/alfmappingfunctions.h"
+#include "alf/alftransformation.h"
+#include "alf/alfstatic.h"
+#include "alf/alfutil.h"
+#include "alf/alfdropshadow.h"
+
+#include <uiacceltk/HuiUtil.h>
+
+NONSHARABLE_CLASS(CAlfVisualOwnerNotification) : public CBase, public MAlfAsyncOpObserver
+    {
+public:
+    CAlfVisualOwnerNotification( CAlfVisual& aVisual );
+    ~CAlfVisualOwnerNotification();
+protected:
+    void AlfAsyncOpCompleted(TInt aCommandId, TInt aStatus);
+private:
+    CAlfVisual& iVisual;
+    TInt iCommandId;
+    TBuf8<1> iDumBuffer;
+    };
+    
+CAlfVisualOwnerNotification::CAlfVisualOwnerNotification( CAlfVisual& aVisual )
+ : iVisual( aVisual )
+    {
+    iCommandId = 0;
+    TRAPD( err, iCommandId = iVisual.Comms()->DoAsynchronousCmdL( EAlfVisualLayoutUpdatedNotification, iDumBuffer, iDumBuffer, this ) );
+    __ASSERT_ALWAYS( err == KErrNone, USER_INVARIANT() );
+    }
+    
+CAlfVisualOwnerNotification::~CAlfVisualOwnerNotification()
+    {
+    TBuf8<1> dum;
+    if ( iCommandId )
+        {
+        iVisual.Comms()->DoSynchronousCmd( EAlfVisualLayoutUpdatedNotificationCancel, dum, dum );
+        iVisual.Comms()->CancelAsynchCmd( iCommandId );
+        iCommandId = 0;
+        }
+    }
+        
+void CAlfVisualOwnerNotification::AlfAsyncOpCompleted(TInt /*aCommandId*/, TInt aStatus)
+    {
+    iCommandId = 0;
+    if ( aStatus == KErrNone )
+        {
+        TRAPD( err, iCommandId = iVisual.Comms()->DoAsynchronousCmdL( EAlfVisualLayoutUpdatedNotification, iDumBuffer, iDumBuffer, this ) );
+        __ASSERT_ALWAYS( err == KErrNone, USER_INVARIANT() );
+        iVisual.Owner().VisualLayoutUpdated( iVisual );
+        }
+    }
+
+// Private data
+struct CAlfVisual::TPrivateData
+    {
+    CAlfLayout* iLayout;            // Not owned.
+    CAlfDisplay* iDisplay;          // Not Owned.
+    TAlfTimedValue iOpacity;        // Owned.
+    CAlfControl* iOwner;            // Not owned.
+    HBufC8* iTag;                   // Owned. 
+    CAlfBrushArray* iBrushes;       // Owned.
+    CAlfGenComponent* iComms;       // owned 
+    CAlfTransformation* iTransform;  // Owned.  
+    TAlfBoxMetric iPadding;// Owned
+    CAlfVisualOwnerNotification* iVisualOwnerNotification; // Own
+    CAlfDropShadow* iDropShadowHandler;
+    };
+
+// ======== MACRO DEFINITIONS ========
+
+void AssertPaddingsWereSetUsingDeprecatedPixelAPIs(const TAlfBoxMetric& aMetric)
+    {
+    __ASSERT_DEBUG(
+        (aMetric.iLeft.iMagnitude == aMetric.iRight.iMagnitude) && 
+        (aMetric.iTop.iMagnitude == aMetric.iBottom.iMagnitude) &&
+        (aMetric.iLeft.iUnit == EAlfUnitPixel) &&
+        (aMetric.iRight.iUnit == EAlfUnitPixel) &&
+        (aMetric.iTop.iUnit == EAlfUnitPixel) &&
+        (aMetric.iBottom.iUnit == EAlfUnitPixel)
+        , USER_INVARIANT());
+#ifndef _DEBUG // Remove compile warnings
+    TAlfBoxMetric tmp = aMetric;
+    tmp = tmp;
+#endif        
+    }
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfVisual::CAlfVisual()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfVisual::ConstructL(CAlfControl& aOwner)
+    {
+    iData = new (ELeave) TPrivateData;
+ 
+    iData->iLayout = NULL;
+    iData->iDisplay = NULL;
+    iData->iOwner = &aOwner;
+    iData->iTag = NULL;
+    iData->iBrushes = NULL;
+    iData->iComms = NULL;
+    iData->iTransform = NULL;
+    iData->iPadding = TAlfBoxMetric(TAlfMetric(0));
+    iData->iVisualOwnerNotification = NULL;
+    iData->iDropShadowHandler = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfVisual::ConstructL(CAlfControl& aOwner, TInt aImplementationId, TInt aImplementationUid, const TDesC8& aConstructionParams )
+    {
+
+    ConstructL(aOwner);
+   
+    if (!iData->iComms)
+        {
+        iData->iComms = CAlfGenComponent::NewL(
+            aOwner.Env(),
+            aImplementationId, 
+            aImplementationUid, 
+            aConstructionParams);         
+        }
+    
+    }
+
+
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfVisual::~CAlfVisual()
+    {
+    if ( iData )
+        {
+        delete iData->iDropShadowHandler;
+        iData->iDropShadowHandler = NULL;
+        
+        delete iData->iVisualOwnerNotification;
+        iData->iVisualOwnerNotification = NULL;
+        
+        // If the visual is still attached to a layout, it is time to remove it.
+        if(iData->iLayout)
+            {
+            iData->iLayout->Remove(this);
+            }
+    
+        delete iData->iBrushes;
+        iData->iBrushes = NULL;
+        
+        delete iData->iTransform;
+        iData->iTransform = NULL;
+        
+        delete iData->iTag;
+        iData->iTag = NULL;
+        
+        delete iData->iComms;
+        }
+    delete iData;
+    iData = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Destroys a hierarchy of visuals, along with this visual. The visuals
+// are first removed from their owner.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfVisual::RemoveAndDestroyAllD()
+    {
+    TBuf8<1> dum;
+    // Remove and destory from the server side
+    TInt err = iData->iComms->DoSynchronousCmd( EAlfVisualRemoveAndDestroyAll,KNullDesC8, dum);
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::RemoveAndDestroyAllD ignore error %d", err )
+        }
+            
+    DoRemoveAndDestroyAllD();
+    }
+    
+EXPORT_C void CAlfVisual::DoRemoveAndDestroyAllD()
+    {
+    __ASSERT_ALWAYS( iData->iOwner, USER_INVARIANT() );
+   
+    iData->iOwner->VisualDestroyed(*this);
+    delete this;
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns subsession identifier, 0 by default.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfVisual::Identifier() const
+    {
+    return iData->iComms->Identifier();
+    }
+
+// ---------------------------------------------------------------------------
+// Sets layout for the visual.
+// ---------------------------------------------------------------------------
+//
+void CAlfVisual::SetLayout(CAlfLayout* aLayout)
+    {
+    iData->iLayout = aLayout;
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns current opacity
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C const TAlfTimedValue& CAlfVisual::Opacity() const
+    {
+    TPckg<TAlfTimedValue> buf(iData->iOpacity);
+    TInt err = iData->iComms->DoSynchronousCmd( EAlfVisualGetOpacity, KNullDesC8, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::Opacity panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return iData->iOpacity;
+    }
+        
+// ---------------------------------------------------------------------------
+// Sets opacity.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfVisual::SetOpacity( const TAlfTimedValue& aOpacity )
+    {
+    TPckgC<TAlfTimedValue> buf(aOpacity);
+    TInt err = iData->iComms->DoCmdNoReply( EAlfVisualSetOpacity, buf);
+    
+    if ( err == KErrNone )
+        {
+        iData->iOpacity = aOpacity;
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetOpacity panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns position
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAlfTimedPoint CAlfVisual::Pos() const
+    {
+    TAlfTimedPoint point;
+    TPckg<TAlfTimedPoint> buf(point);
+    TInt err = iData->iComms->DoSynchronousCmd( EAlfVisualPos, KNullDesC8, buf);
+    
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfVisual::Pos panic error %d", err )
+        USER_INVARIANT();
+        }
+
+    return point;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Sets the position of the visual.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfVisual::SetPos(const TAlfRealPoint& aPos, TInt aTransitionTime)
+    {
+    TAlfVisualPos pos = { aPos, aTransitionTime };
+
+    TPckgC<TAlfVisualPos> buf(pos);
+    TInt err = iData->iComms->DoCmdNoReply( EAlfVisualSetPos, buf);
+    
+    if (err) // for now
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetPos panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+  
+// ---------------------------------------------------------------------------
+// Returns the size of the visual. 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TAlfTimedPoint CAlfVisual::Size() const
+    {
+    TAlfTimedPoint size;
+    TPckg<TAlfTimedPoint> buf(size);
+    TInt err = iData->iComms->DoSynchronousCmd( EAlfVisualSize, KNullDesC8, buf);
+    
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfVisual::Size panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return size;    
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the size of the visual.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfVisual::SetSize(const TAlfRealSize& aSize, TInt aTransitionTime)
+    {
+    TAlfVisualSize size = { aSize, aTransitionTime };
+
+    TPckgC<TAlfVisualSize> buf(size);
+    TInt err = iData->iComms->DoCmdNoReply( EAlfVisualSetSize, buf );
+    
+    if (err) // for now
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetSize panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetFlag(TAlfVisualFlags aFlag)
+    {
+    TPckgC<TAlfVisualFlags> inBuf(aFlag);
+    TInt err = iData->iComms->DoCmdNoReply( EAlfVisualSetFlag, inBuf );
+
+    if (err) // for now
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetFlag panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    if ( aFlag == EAlfVisualFlagLayoutUpdateNotification && !iData->iVisualOwnerNotification )
+        {
+        iData->iVisualOwnerNotification = new CAlfVisualOwnerNotification( *this );
+        __ASSERT_ALWAYS( iData->iVisualOwnerNotification , USER_INVARIANT() );
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetFlags(TUint aAnyFlags)
+    {
+    TPckgC<TUint> inBuf(aAnyFlags);
+    TInt err = iData->iComms->DoCmdNoReply( EAlfVisualSetFlags, inBuf );
+
+    if (err) // for now
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetFlags panic error %d", err )
+        USER_INVARIANT();
+        }
+        
+    if ( aAnyFlags & EAlfVisualFlagLayoutUpdateNotification && !iData->iVisualOwnerNotification )
+        {
+        iData->iVisualOwnerNotification = new CAlfVisualOwnerNotification( *this );
+        __ASSERT_ALWAYS( iData->iVisualOwnerNotification , USER_INVARIANT() );
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::ClearFlag(TAlfVisualFlags aFlag)
+    {
+    TPckgC<TAlfVisualFlags> inBuf(aFlag);
+    TInt err = iData->iComms->DoCmdNoReply( EAlfVisualClearFlag, inBuf );
+
+    if (err) // for now
+        {
+        __ALFLOGSTRING1( "CAlfVisual::ClearFlag panic error %d", err )
+        USER_INVARIANT();
+        }
+        
+    if ( aFlag == EAlfVisualFlagLayoutUpdateNotification && iData->iVisualOwnerNotification )
+        {
+        delete iData->iVisualOwnerNotification;
+        iData->iVisualOwnerNotification = NULL;
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::ClearFlags(TUint aAnyFlags)
+    {
+    TPckgC<TUint> inBuf(aAnyFlags);
+    TInt err = iData->iComms->DoCmdNoReply( EAlfVisualClearFlags, inBuf );
+
+    if (err) // for now
+        {
+        __ALFLOGSTRING1( "CAlfVisual::ClearFlags panic error %d", err )
+        USER_INVARIANT();
+        }
+        
+    if ( aAnyFlags & EAlfVisualFlagLayoutUpdateNotification && iData->iVisualOwnerNotification )
+        {
+        delete iData->iVisualOwnerNotification;
+        iData->iVisualOwnerNotification = NULL;
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TUint CAlfVisual::Flags() const
+    {
+    TUint flags = 0;
+    TPckg<TUint> outBuf(flags);
+    TInt err = iData->iComms->DoSynchronousCmd( EAlfVisualFlags, KNullDesC8, outBuf);
+    
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfVisual::Flags panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return flags; 
+    }
+
+// ---------------------------------------------------------------------------
+// Returns layout
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C CAlfLayout* CAlfVisual::Layout() const
+    {
+    return iData->iLayout;
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns env.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfEnv& CAlfVisual::Env() const
+    {
+    if (!iData || !iData->iOwner) // try to save what there's left to save
+        {
+        return CAlfStatic::Env();
+        }
+        
+    return iData->iOwner->Env();
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns tag.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TDesC8& CAlfVisual::Tag() const
+    {
+    if(iData && iData->iTag)
+        {
+        return *iData->iTag;
+        }
+
+    return KNullDesC8;
+    }
+   
+// ---------------------------------------------------------------------------
+// Returns display
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C CAlfDisplay* CAlfVisual::Display() const
+    {
+    const CAlfVisual* iter = this;
+
+    while(iter)
+        {
+        if(iter->iData->iDisplay)
+            {
+            return iter->iData->iDisplay;
+            }
+        iter = iter->Layout();
+        }
+
+    // Not shown on any display.
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Update child layout to the server
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfVisual::UpdateChildrenLayout(TInt aTransitionTime)
+    {
+    TPckgC<TInt> buf(aTransitionTime);
+    TBuf8<1> dum;
+    
+    TInt err = iData->iComms->DoSynchronousCmd( EAlfVisualUpdateChildrenLayout, buf, dum);
+    
+    if (err) // for now
+        {
+        __ALFLOGSTRING1( "CAlfVisual::UpdateChildrenLayout panic error %d", err )
+        USER_INVARIANT();
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Enables brush usage.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfVisual::EnableBrushesL(TBool aEnabled)
+    {
+    if(aEnabled && !iData->iBrushes)
+        {
+        iData->iBrushes = CAlfBrushArray::NewL(*this);
+        }
+    else if(!aEnabled && iData->iBrushes)
+        {
+        delete iData->iBrushes;
+        iData->iBrushes = NULL;
+        }
+    else
+        {
+        // for PC lint
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Returns brush array
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfBrushArray* CAlfVisual::Brushes()
+    {
+    return iData->iBrushes;
+    }
+   
+// ---------------------------------------------------------------------------
+// Converts point.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TPoint CAlfVisual::LocalToDisplay(const TPoint& aPoint) const
+    {
+    const TAlfRealPoint realPoint =  LocalToDisplay(TAlfRealPoint(aPoint));
+    return TPoint( AlfUtil::RoundFloatToInt( realPoint.iX ),AlfUtil::RoundFloatToInt( realPoint.iY ) );
+    }
+
+// ---------------------------------------------------------------------------
+// Converts point.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TAlfRealPoint CAlfVisual::LocalToDisplay(
+    const TAlfRealPoint& aPoint) const
+    {
+    TPckgC<TAlfRealPoint> pointPckg(aPoint);
+    TAlfRealPoint result;
+    TPckg<TAlfRealPoint> resultPckg(result);
+    
+    TInt err = iData->iComms->DoSynchronousCmd(EAlfVisualLocalToDisplay, pointPckg, resultPckg);
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::LocalToDisplay panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    return result;
+    }
+   
+// ---------------------------------------------------------------------------
+// Converts point.
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TPoint CAlfVisual::DisplayToLocal(const TPoint& aPoint) const
+    {
+    const TAlfRealPoint realPoint = DisplayToLocal(TAlfRealPoint(aPoint));
+    return TPoint( AlfUtil::RoundFloatToInt( realPoint.iX ),AlfUtil::RoundFloatToInt( realPoint.iY ) );
+    }
+
+// ---------------------------------------------------------------------------
+// Converts point.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TAlfRealPoint CAlfVisual::DisplayToLocal(const TAlfRealPoint& aPoint) const
+    {
+    TPckgC<TAlfRealPoint> pointPckg(aPoint);
+    TAlfRealPoint result;
+    TPckg<TAlfRealPoint> resultPckg(result);
+    
+    TInt err = iData->iComms->DoSynchronousCmd(EAlfVisualDisplayToLocal, pointPckg, resultPckg);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::DisplayToLocal panic error %d", err )
+        USER_INVARIANT();
+        }
+        
+    return result;
+    }
+ 
+// ---------------------------------------------------------------------------
+// Gets display rect
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C TAlfRealRect CAlfVisual::DisplayRectTarget() const
+    {
+    TAlfRealRect rect;
+    TPckg<TAlfRealRect> rectPckg(rect);
+
+    TInt err = iData->iComms->DoSynchronousCmd(EAlfVisualDisplayRectTarget, KNullDesC8, rectPckg);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::DisplayRectTarget panic error %d", err )
+        USER_INVARIANT();
+        }
+
+    return rect;
+    }
+ 
+// ---------------------------------------------------------------------------
+// Moves visual to front.
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C void CAlfVisual::MoveToFront( TInt aTransitionTime )
+    {
+    if (iData->iLayout)
+        {
+        iData->iLayout->MoveVisualToFront(*this, aTransitionTime);
+        }  
+    }
+    
+// ---------------------------------------------------------------------------
+// Enables transformation.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfVisual::EnableTransformationL(TBool aIsTransformed)
+    {
+    if ( aIsTransformed && iData->iTransform )
+        {
+        // Already enabled
+        return;
+        }
+        
+    if ( !aIsTransformed && !iData->iTransform )
+        {
+        // Already disabled
+        return;
+        }
+    
+    if ( aIsTransformed )
+        {
+        iData->iTransform = CAlfTransformation::NewL( Env() );
+        }
+   
+    // use the server handle from the transformation object if present
+    TInt transformationHandle = 
+        iData->iTransform ? 
+            iData->iTransform->ServerHandle() : 
+            0 ;
+            
+    TInt2 inData(transformationHandle,aIsTransformed);
+    TPckgC<TInt2> inPckg(inData);
+    
+    TBuf8<1> outDum;
+    
+    TInt err = iData->iComms->DoSynchronousCmd(EAlfVisualEnableTransformation, inPckg, outDum);
+     
+    if ( err == KErrNone && !aIsTransformed )
+        {
+        delete iData->iTransform;
+        iData->iTransform = NULL;
+        }
+    
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::EnableTransformationL leave error %d", err )
+        delete iData->iTransform;
+        iData->iTransform = NULL;
+        User::Leave( err );
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns transformation
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C CAlfTransformation& CAlfVisual::Transformation()
+    {
+    __ASSERT_ALWAYS( iData->iTransform, USER_INVARIANT() );
+    return *iData->iTransform;        
+    }
+
+
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetPadding(TInt aPadding)
+    {
+    TPckgC<TInt> inBuf(aPadding);
+    TInt err = iData->iComms->DoCmdNoReply( EAlfVisualSetPaddingInt, inBuf );
+
+    if (err) // for now
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetPadding panic error %d", err )
+        USER_INVARIANT();
+        }
+        
+    iData->iPadding = TAlfBoxMetric(TAlfMetric(aPadding));
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetPadding(const TPoint& aPadding)
+    {
+    TPckgC<TPoint> inBuf(aPadding);
+    TInt err = iData->iComms->DoCmdNoReply( EAlfVisualSetPaddingPoint, inBuf );
+
+    if (err) // for now
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetPadding panic error %d", err )
+        USER_INVARIANT();
+        }
+        
+    iData->iPadding = TAlfBoxMetric(TAlfXYMetric(TAlfMetric(aPadding.iX), TAlfMetric(aPadding.iY)));
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetPadding(const TAlfBoxMetric& aPadding)
+    {
+    TPckgC<TAlfBoxMetric> inBuf(aPadding);
+    TInt err = iData->iComms->DoCmdNoReply( EAlfVisualSetPaddingBox, inBuf );
+
+    if (err) // for now
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetPadding panic error %d", err )
+        USER_INVARIANT();
+        }
+    
+    iData->iPadding = aPadding;
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TAlfRealRect CAlfVisual::PaddingInPixels() const
+    {
+    TBufC8<1> inDum;
+    TAlfRealRect value;
+    TPckg<TAlfRealRect> outBuf(value);    
+    TInt err = Comms()->DoSynchronousCmd(EAlfVisualPaddingInPixels, inDum, outBuf);    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::DisplayRect ignore error %d", err )
+        }
+        
+    return value;            
+    }
+    
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetTagL(const TDesC8& aTag)
+    {
+    ASSERT(iData);
+    
+    delete iData->iTag;
+    iData->iTag = 0;
+    
+    iData->iTag = aTag.AllocL();
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TBool CAlfVisual::IsTagged() const
+    {
+    return (iData && iData->iTag);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfVisual* CAlfVisual::FindTag(const TDesC8& aTag)
+    {
+    // Look for the tag in this visual's tag descriptor.
+    if(iData && iData->iTag && TagMatches(aTag))
+        {
+        return this;
+        }
+    else
+        {
+        // Could not find it.
+        return NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Returns comms module for accessing the client-server APIs.
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfGenComponent* CAlfVisual::Comms() const
+    {
+    ASSERT(iData);
+    return iData->iComms;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+TBool CAlfVisual::TagMatches(const TDesC8& aTag) const
+    {    
+    if(!aTag.Length() || !iData || !iData->iTag )
+        {
+        // No tag specified; doesn't match anything.
+        return EFalse;
+        }
+
+    TPtrC8 region = iData->iTag->Des();
+    TPtrC8 tag;
+    TInt index = 0;
+
+    while(region.Length() > 0)
+        {
+        // Is there a colon in the region?
+        index = region.Locate(KAlfTagSeparator);
+        if(index != KErrNotFound)
+            {
+            // A separator exists in the region.
+            tag.Set(region.Left(index));
+            region.Set(region.Right(region.Length() - index - 1));
+            }
+        else
+            {
+            tag.Set(region);
+            region.Set(region.Right(0));
+            }
+
+        if(!tag.Compare(aTag))
+            {
+            // Matches.
+            return ETrue;
+            }
+        }
+
+    // No match could be found.
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TAlfTimedValue CAlfVisual::DepthOffset() const
+    {
+    TBufC8<1> inDum;
+    TAlfTimedValue value;
+    TPckg<TAlfTimedValue> outBuf(value);    
+    TInt err = Comms()->DoSynchronousCmd(EAlfVisualDepthOffset, inDum, 
+        outBuf);  
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::DepthOffset ignore error %d", err )
+        }
+    return value;                                
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetDepthOffset(const TAlfTimedValue& aDepthOffset)
+    {
+    TPckgC<TAlfTimedValue> inPckg(aDepthOffset);
+    TInt err = Comms()->DoCmdNoReply(EAlfVisualSetDepthOffset, inPckg );            
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetDepthOffset ignore error %d", err )
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfControl& CAlfVisual::Owner() const
+    {
+    return *iData->iOwner;    
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetOwner(CAlfControl& aOwner)
+    {
+    iData->iOwner = &aOwner;    
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetOrigin(TAlfVisualHOrigin aHoriz, 
+    TAlfVisualVOrigin aVert)
+    {
+    ClearFlags(EAlfVisualFlagHOriginCenter | EAlfVisualFlagHOriginRight);
+    switch(aHoriz)
+        {
+        case EAlfVisualHOriginCenter:
+            SetFlag(EAlfVisualFlagHOriginCenter);
+            break;
+
+        case EAlfVisualHOriginRight:
+            SetFlag(EAlfVisualFlagHOriginRight);
+            break;
+
+        default:
+            break;
+        }
+
+    ClearFlags(EAlfVisualFlagVOriginCenter | EAlfVisualFlagVOriginBottom);
+    switch(aVert)
+        {
+        case EAlfVisualVOriginCenter:
+            SetFlag(EAlfVisualFlagVOriginCenter);
+            break;
+
+        case EAlfVisualVOriginBottom:
+            SetFlag(EAlfVisualFlagVOriginBottom);
+            break;
+
+        default:
+            break;
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TAlfVisualHOrigin CAlfVisual::HorizontalOrigin() const
+    {
+    TUint flags = Flags();
+    if(flags & EAlfVisualFlagHOriginCenter)
+        {
+        return EAlfVisualHOriginCenter;
+        }
+    if(flags & EAlfVisualFlagHOriginRight)
+        {
+        return EAlfVisualHOriginRight;
+        }
+    return EAlfVisualHOriginLeft;
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TAlfVisualVOrigin CAlfVisual::VerticalOrigin() const
+    {
+    TUint flags = Flags();
+    if(flags & EAlfVisualFlagVOriginCenter)
+        {
+        return EAlfVisualVOriginCenter;
+        }
+    if(flags & EAlfVisualFlagVOriginBottom)
+        {
+        return EAlfVisualVOriginBottom;
+        }
+    return EAlfVisualVOriginTop;
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::AlignByOrigin(TAlfRealRect& aRect) const
+    {      
+    switch(HorizontalOrigin())
+        {
+        case EAlfVisualHOriginCenter:
+            aRect.Move(-aRect.Width()/2.0, 0.0);
+            break;
+
+        case EAlfVisualHOriginRight:
+            aRect.Move(-aRect.Width(), 0.0);
+            break;
+
+        default:
+            break;
+        }
+
+    switch(VerticalOrigin())
+        {
+        case EAlfVisualVOriginCenter:
+            aRect.Move(0.0, -aRect.Height()/2.0);
+            break;
+
+        case EAlfVisualVOriginBottom:
+            aRect.Move(0.0, -aRect.Height());
+            break;
+
+        default:
+            break;
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// deprecated
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetMinSize(const TSize& aMinSize)
+    {
+    TPckgC<TSize> inPckg(aMinSize);
+    TInt err = Comms()->DoCmdNoReply(EAlfVisualSetMinSize, inPckg );  
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetMinSize ignore error %d", err )
+        }
+    }   
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetMinSize(const TAlfRealSize& aMinSize)
+    {
+    TPckgC<TAlfRealSize> inPckg(aMinSize);
+    TInt err = Comms()->DoCmdNoReply(EAlfVisualSetMinSizeInBaseUnits, inPckg );  
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetMinSize ignore error %d", err )
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// deprecated
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TSize CAlfVisual::MinSize() const
+    {
+    TBufC8<1> inDum;
+    TSize value;
+    TPckg<TSize> outBuf(value);    
+    TInt err = Comms()->DoSynchronousCmd(EAlfVisualGetMinSize, inDum, 
+        outBuf);  
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::MinSize ignore error %d", err )
+        }
+          
+    return value;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TAlfRealSize CAlfVisual::MinSizeInBaseUnits() const
+    {
+    TBufC8<1> inDum;
+    TAlfRealSize value;
+    TPckg<TAlfRealSize> outBuf(value);    
+    TInt err = Comms()->DoSynchronousCmd(EAlfVisualGetMinSizeInBaseUnits, inDum, 
+        outBuf);  
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::MinSizeInBaseUnit ignore error %d", err )
+        }
+          
+    return value;
+    }
+    
+// ---------------------------------------------------------------------------
+// deprecated
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetMaxSize(const TSize& aMaxSize)
+    {
+    TPckgC<TSize> inPckg(aMaxSize);
+    TInt err = Comms()->DoCmdNoReply(EAlfVisualSetMaxSize, inPckg); 
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetMaxSize ignore error %d", err )
+        }
+    }    
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetMaxSize(const TAlfRealSize& aMaxSize)
+    {
+    TPckgC<TAlfRealSize> inPckg(aMaxSize);
+    TInt err = Comms()->DoCmdNoReply(EAlfVisualSetMaxSizeInBaseUnits, inPckg); 
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetMaxSize ignore error %d", err )
+        }
+    }    
+
+// ---------------------------------------------------------------------------
+// deprecated
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TSize CAlfVisual::MaxSize() const
+    {
+    TBufC8<1> inDum;
+    TSize value;
+    TPckg<TSize> outBuf(value);    
+    TInt err = Comms()->DoSynchronousCmd(EAlfVisualGetMaxSize, inDum, 
+        outBuf);  
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::MaxSize ignore error %d", err )
+        }
+          
+    return value;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TAlfRealSize CAlfVisual::MaxSizeInBaseUnits() const
+    {
+    TBufC8<1> inDum;
+    TAlfRealSize value;
+    TPckg<TAlfRealSize> outBuf(value);    
+    TInt err = Comms()->DoSynchronousCmd(EAlfVisualGetMaxSizeInBaseUnits, inDum, 
+        outBuf);  
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::MaxSizeInBaseUnits ignore error %d", err )
+        }
+          
+    return value;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetRect(const TAlfRealRect& aRect, TInt aTransitionTime)
+    {
+    SetPos(aRect.iTl, aTransitionTime);
+    SetSize(TAlfRealSize(aRect.Size().iWidth, aRect.Size().iHeight),
+        aTransitionTime);
+    }
+    
+// ---------------------------------------------------------------------------
+// deprecated
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::Move(const TPoint& aOffset, TInt aTransitionTime)
+    {
+    TAlfTimedPoint pos = Pos();
+    TReal32 xpos = pos.Target().iX + aOffset.iX;
+    TReal32 ypos = pos.Target().iY + aOffset.iY;
+    TAlfRealPoint newPos(xpos, ypos);
+    SetPos(newPos, aTransitionTime);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::Move(const TAlfRealPoint& aOffset, TInt aTransitionTime)
+    {
+    TAlfVisualPos pos = { aOffset, aTransitionTime };
+    
+    TPckgC<TAlfVisualPos> buf(pos);
+    
+    TInt err = iData->iComms->DoCmdNoReply( EAlfVisualMove, buf );
+    
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfVisual::Move ignore error %d", err )
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::Mimic(CAlfVisual& aVisual, TInt aTransitionTime)
+    {
+    SetPos(aVisual.Pos().Target(), aTransitionTime);
+    SetSize(aVisual.Size().Target(), aTransitionTime);        
+    }
+    
+// ---------------------------------------------------------------------------
+// deprecated
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetCenteredPosAndSize(const TPoint& aCenterPoint,
+                                        const TSize& aSize,
+                                        TInt aTransitionTime)
+    {
+    SetPos(TPoint(aCenterPoint.iX - aSize.iWidth/2,
+                  aCenterPoint.iY - aSize.iHeight/2), aTransitionTime);
+    SetSize(aSize, aTransitionTime);        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetCenteredPosAndSize(const TAlfRealPoint& aCenterPoint,
+                                        const TAlfRealSize& aSize,
+                                        TInt aTransitionTime)
+    {
+    TAlfVisualPosSize posSize = { aCenterPoint, aSize, aTransitionTime };
+    
+    TPckgC<TAlfVisualPosSize> buf(posSize);
+    
+    TInt err = iData->iComms->DoCmdNoReply( EAlfVisualSetCenteredPosAndSize, buf);
+    
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetCenteredPosAndSize ignore error %d", err )
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TAlfRealRect CAlfVisual::DisplayRect() const
+    {
+    TBufC8<1> inDum;
+    TAlfRealRect value;
+    TPckg<TAlfRealRect> outBuf(value);    
+    TInt err = Comms()->DoSynchronousCmd(EAlfVisualDisplayRect, inDum, outBuf);    
+    
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::DisplayRect ignore error %d", err )
+        }
+        
+    return value;                                                                
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TReal32 CAlfVisual::EffectiveOpacity() const __SOFTFP
+    {
+    // We could do this locally, but because Opacity()-method calls anyway
+    // server we do one server call here instead of multiple Opacity()-calls.
+    TBufC8<1> inDum;
+    TReal32 value = 1.0;
+    TPckg<TReal32> outBuf(value);    
+    TInt err = Comms()->DoSynchronousCmd(EAlfVisualEffectiveOpacity, inDum, 
+        outBuf);  
+        
+    if ( err )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::EffectiveOpacity ignore error %d", err )
+        }
+          
+    return value;                                                                
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetClipping(TBool aClipping)
+    {
+    if(aClipping)
+        {
+        SetFlag(EAlfVisualFlagClipping);
+        }
+    else
+        {
+        ClearFlag(EAlfVisualFlagClipping);
+        }        
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TBool CAlfVisual::Clipping() const
+    {
+    return (Flags() & EAlfVisualFlagClipping) != 0;
+    }
+    
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TPoint CAlfVisual::Padding() const
+    {
+    AssertPaddingsWereSetUsingDeprecatedPixelAPIs(iData->iPadding);
+    return TPoint(iData->iPadding.iLeft.iMagnitude, iData->iPadding.iTop.iMagnitude);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C const TAlfBoxMetric& CAlfVisual::PaddingAsMetric() const
+    {
+    return iData->iPadding;
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TInt CAlfVisual::HorizontalPadding() const
+    {
+    AssertPaddingsWereSetUsingDeprecatedPixelAPIs(iData->iPadding);
+    return iData->iPadding.iLeft.iMagnitude;
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TInt CAlfVisual::VerticalPadding() const
+    {
+    AssertPaddingsWereSetUsingDeprecatedPixelAPIs(iData->iPadding);
+    return iData->iPadding.iTop.iMagnitude;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+void CAlfVisual::SetDisplay(CAlfDisplay* aDisplay)
+    {
+    iData->iDisplay = aDisplay;
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetPos(const TAlfTimedPoint& aPos)
+    {
+    TPckgC<TAlfTimedPoint> buf(aPos);
+    TInt err = iData->iComms->DoCmdNoReply( EAlfVisualSetPosTimed, buf);
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetPos panic error %d", err )
+        USER_INVARIANT();
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::SetSize(const TAlfTimedPoint& aSize)
+    {
+    TPckgC<TAlfTimedPoint> buf(aSize);
+    TInt err = iData->iComms->DoCmdNoReply( EAlfVisualSetSizeTimed, buf );
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetSize panic error %d", err )
+        USER_INVARIANT();
+        }                
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C TInt CAlfVisual::CopyValues(const CAlfVisual& aVisual, TInt aBitmask, TInt aTransitionTime )
+    {
+    if (aVisual.Identifier())
+        {
+        return KErrArgument;
+        }
+    
+    TInt3 inData(aVisual.Identifier(),aBitmask,aTransitionTime);
+    TPckgC<TInt3> inPckg(inData);
+    TBuf8<1> dum;
+        
+    return iData->iComms->DoSynchronousCmd( EAlfVisualCopyValuesFromOtherVisual, inPckg, dum );    
+    }
+
+// ---------------------------------------------------------------------------
+//  future proofing  
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfVisual::PropertyOwnerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfPropertyOwner::PropertyOwnerExtension(aExtensionUid,aExtensionParams);
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfVisual::SetTactileFeedbackL( TInt aEventType, TInt aFeedbackType )
+    {
+    __ASSERT_ALWAYS( aFeedbackType >= 0, USER_INVARIANT() );
+    __ASSERT_ALWAYS( aEventType >= 0, USER_INVARIANT() );
+    
+    TInt2 inData(aEventType,aFeedbackType);
+    TPckgC<TInt2> inPckg(inData);
+    TBuf8<1> dum;
+        
+    TInt err =  iData->iComms->DoSynchronousCmd( EAlfVisualSetTactileFeedback, inPckg, dum ); 
+
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetTactileFeedbackL leave error %d", err )
+        User::Leave( err );
+        }   
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C TBool CAlfVisual::HasTactileFeedback( TInt aEventType ) const
+    {
+    TInt inData(aEventType);
+    TPckgC<TInt> inPckg(inData);
+    
+    TBool answer = EFalse;
+    TPckg<TBool> outPckg(answer);
+        
+    TInt err =  iData->iComms->DoSynchronousCmd( EAlfVisualHasTactileFeedback, inPckg, outPckg ); 
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::HasTactileFeedback ignore error %d", err )
+        }   
+    return answer;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfVisual::RemoveTactileFeedback( TInt aEventType  )
+    {
+    TInt inData(aEventType);
+    TPckgC<TInt> inPckg(inData);
+        
+    TInt err = iData->iComms->DoCmdNoReply( EAlfVisualRemoveTactileFeedback, inPckg );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::RemoveTactileFeedback ignore error %d", err )
+        }  
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfVisual::Pause(TInt aPropertiesBitmask)
+    {
+    TPckgC<TInt> inPckg(aPropertiesBitmask);
+    TBuf8<1> dum;
+     
+    TInt err =  iData->iComms->DoSynchronousCmd( EAlfVisualPauseProperties, inPckg, dum ); 
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::Pause ignored error %d", err )
+        }   
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfVisual::Resume(TInt aPropertiesBitmask)
+    {
+    TPckgC<TInt> inPckg(aPropertiesBitmask);
+    TBuf8<1> dum;
+     
+    TInt err =  iData->iComms->DoSynchronousCmd( EAlfVisualResumeProperties, inPckg, dum ); 
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING1( "CAlfVisual::Resume ignored error %d", err )
+        }   
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfVisual::EnableDropShadowL( TBool aEnable  )
+    {
+    if ( aEnable && !iData->iDropShadowHandler )
+        {
+        // create instance.
+        CAlfDropShadow* dropShadowHandler = CAlfDropShadow::NewL( *Comms() );
+        
+        TPckgC<TBool> inPckg(aEnable);
+        TBuf8<1> dum;
+        TInt err =  iData->iComms->DoSynchronousCmd( EAlfVisualEnableDropShadow, inPckg, dum ); 
+        
+        if (err!=KErrNone)
+            {
+            __ALFLOGSTRING1( "CAlfVisual::EnableDropShadowL leave error %d", err )
+            delete dropShadowHandler;
+            User::Leave( err );
+            }
+        iData->iDropShadowHandler = dropShadowHandler;
+        }
+    else if ( !aEnable && iData->iDropShadowHandler )
+        {
+        // delete the instance.
+        TPckgC<TBool> inPckg(aEnable);
+        TBuf8<1> dum;
+        TInt err =  iData->iComms->DoSynchronousCmd( EAlfVisualEnableDropShadow, inPckg, dum ); 
+        
+        if (err!=KErrNone)
+            {
+            __ALFLOGSTRING1( "CAlfVisual::EnableDropShadowL leave error %d", err )
+            User::Leave( err );
+            }
+            
+        delete iData->iDropShadowHandler;
+        iData->iDropShadowHandler = NULL;
+        }
+    else
+        {
+        // For PC lint
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfDropShadow* CAlfVisual::DropShadowHandler() const
+    {
+    return iData->iDropShadowHandler;
+    }
+
+EXPORT_C void CAlfVisual::SetEffectL( const TDesC& aEffectFile )
+    {
+    TBuf8<1> dumDum;
+    TAlfVisualEffectParams params;
+    params.iFileName = aEffectFile;
+    
+    TPckg<TAlfVisualEffectParams> paramsPckg(params);
+    
+    TInt err = KErrNone;
+    if ( aEffectFile.Length() == 0 )
+        {
+        err = iData->iComms->DoSynchronousCmd(EAlfVisualRemoveEffect, paramsPckg, dumDum);
+        }
+    else
+        {
+        err = iData->iComms->DoSynchronousCmd(EAlfVisualSetEffect, paramsPckg, dumDum);
+        }
+    if (err)
+        {
+        __ALFLOGSTRING1( "CAlfVisual::SetEffectL leave error %d", err )
+        User::Leave( err );
+        } 
+    }
+
+// ---------------------------------------------------------------------------
+// SetGroupEffectL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfVisual::SetGroupEffectL( const TDesC& aEffectFile, TInt aGroupHandle )
+    {
+	TBuf8<1> dumDum;
+	TAlfVisualEffectParams params;
+	params.iFileName = aEffectFile;
+	params.iGroupHandle = aGroupHandle;
+	
+	TPckg<TAlfVisualEffectParams> paramsPckg(params);
+	
+	TInt err = KErrNone;
+	if ( aEffectFile.Length() == 0 )
+		{
+		err = iData->iComms->DoSynchronousCmd(EAlfVisualRemoveEffect, paramsPckg, dumDum);
+		}
+	else
+		{
+		err = iData->iComms->DoSynchronousCmd(EAlfVisualSetGroupEffect, paramsPckg, dumDum);
+		}
+	if (err)
+		{
+		__ALFLOGSTRING1( "CAlfVisual::SetGroupEffectL leave error %d", err )
+		User::Leave( err );
+		}    
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/Client/src/alfvisualfactory.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,290 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Factory for visuals and layouts.
+*
+*/
+
+
+
+
+#include "alf/alfvisualfactory.h"  // Class definition
+#include "alf/alftextvisual.h"
+#include "alf/alflcttextvisual.h"
+#include "alf/alfanchorlayout.h"
+#include "alf/alfviewportlayout.h"
+#include "alf/alfdecklayout.h"
+#include "alf/alfflowlayout.h"
+#include "alf/alfimagevisual.h"
+#include "alf/alfgridlayout.h"
+#include "alf/alflctgridlayout.h"
+#include "alf/alfcurvepathlayout.h"
+#include "alf/alfconstants.h"
+#include "alf/alflinevisual.h"
+#include "alf/alflctanchorlayout.h"
+#include "alf/alfmeshvisual.h"
+#include "alf/alfcanvasvisual.h"
+#include "alfuids.h"
+#include "alf/alfcontrol.h"
+
+// ---------------------------------------------------------------------------
+// Creates new visual
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfVisual* AlfVisualFactory::NewVisualL(
+        TAlfVisualType aVisualType,
+	    CAlfLayout* aParentLayout,
+	    CAlfControl& aOwner,
+	    CAlfEnv& aEnv,
+	    TInt aImplementationUid)
+    {
+    CAlfVisual* visual = NewVisualLC(aVisualType, aParentLayout, aOwner, aEnv, aImplementationUid);
+    CleanupStack::Pop(visual);
+    return visual;
+    }
+    
+// ---------------------------------------------------------------------------
+// Creates new visual
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C CAlfVisual* AlfVisualFactory::NewVisualLC(
+        TAlfVisualType aVisualType,
+	    CAlfLayout* aParentLayout,
+	    CAlfControl& aOwner,
+	    CAlfEnv& /*aEnv*/,
+	    TInt aImplementationUid)
+	{
+    CAlfVisual* visual = NULL;
+    TInt mappedType = KErrNotFound;
+    
+    switch(aVisualType)
+        {
+        case EAlfVisualTypeVisual:
+            {
+            if (aImplementationUid == 0)
+                mappedType = EAlfVisualCreate;
+            visual = new (ELeave) CAlfVisual();
+            break;
+            }
+            
+        case EAlfVisualTypeLine:
+            if (aImplementationUid == 0)
+                mappedType = EAlfLineVisualCreate;
+
+            visual = new (ELeave) CAlfLineVisual();
+            break;
+
+        /*case EAlfVisualTypeGradient:
+            visual = new (ELeave) CAlfGradientVisual();
+            break;*/
+
+        case EAlfVisualTypeText:
+            {
+            if (aImplementationUid == 0)
+                mappedType = EAlfTextVisualCreate;
+
+            visual = new (ELeave) CAlfTextVisual();
+            break;    
+            }
+
+#ifdef RD_ALF_IN_PLATFORM            
+        case EAlfVisualTypeLCTText:
+            {
+            if (aImplementationUid == 0)
+                mappedType = EAlfLCTTextVisualCreate;
+
+            visual = new (ELeave) CAlfLCTTextVisual();
+            break;    
+            }
+#endif // RD_ALF_IN_PLATFORM
+            
+        case EAlfVisualTypeImage:
+            {
+            if (aImplementationUid == 0)
+                mappedType = EAlfImageVisualCreate;
+            
+            visual = new (ELeave) CAlfImageVisual();
+            break;
+            }
+            
+        case EAlfVisualTypeMesh:
+            if (aImplementationUid == 0)
+                mappedType = EAlfMeshVisualCreate;
+            
+            visual = new (ELeave) CAlfMeshVisual();
+            break;
+        
+        case EAlfVisualTypeCanvas:
+            if (aImplementationUid == 0)
+                mappedType = EAlfCanvasVisualCreate;
+            
+            visual = new (ELeave) CAlfCanvasVisual();
+            break;
+            
+        
+        default: // todo: should we leave or should extensions to be created via here?
+            User::Leave(KErrNotFound);
+        }
+
+    CleanupStack::PushL(visual);
+    
+    ASSERT(aOwner.Identifier());
+    
+    TInt parentlayouthandle = 0;
+    if (aParentLayout)
+        {
+        parentlayouthandle = aParentLayout->Identifier();
+        }
+    
+    TInt2 inputParams(aOwner.Identifier(), parentlayouthandle);
+   
+    TPckg<TInt2> paramBuf(inputParams);
+    
+    visual->ConstructL( aOwner, 
+                        (mappedType==KErrNotFound)?aVisualType:mappedType, 
+                        aImplementationUid, paramBuf );
+
+    return visual;    
+    }
+    
+// ---------------------------------------------------------------------------
+// Creates new layout - TODO: Is this obsolete ?
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C CAlfLayout* AlfVisualFactory::NewLayoutL(
+        TAlfLayoutType aLayoutType,
+	    CAlfLayout* aParentLayout,
+	    CAlfControl& aOwner,
+	    CAlfEnv& aEnv,
+	    TInt aImplementationUid)
+    {
+    CAlfLayout* layout = NewLayoutLC(aLayoutType, aParentLayout, aOwner, aEnv, aImplementationUid);
+    CleanupStack::Pop(layout);
+    return layout;
+    }
+    
+// ---------------------------------------------------------------------------
+// Creates new layout
+// ---------------------------------------------------------------------------
+//      
+EXPORT_C CAlfLayout* AlfVisualFactory::NewLayoutLC(	    
+        TAlfLayoutType aLayoutType,
+	    CAlfLayout* aParentLayout,
+	    CAlfControl& aOwner,
+	    CAlfEnv& /*aEnv*/,
+	    TInt aImplementationUid )
+    {
+    CAlfLayout* layout = NULL;
+    TInt mappedType = KErrNotFound; 
+    
+    switch(aLayoutType)
+        {
+        case EAlfLayoutTypeLayout:
+            if (aImplementationUid == 0)
+                mappedType = EAlfLayoutCreate;
+            layout = new (ELeave) CAlfLayout();
+            break;
+                  
+        case EAlfLayoutTypeGrid:
+            if (aImplementationUid == 0)
+                {
+                mappedType = EAlfGridLayoutCreate;
+                }
+            layout = new (ELeave) CAlfGridLayout();
+            break;
+
+#ifdef RD_ALF_IN_PLATFORM            
+        case EAlfLayoutTypeLCTGrid:
+            if (aImplementationUid == 0)
+                {
+                mappedType = EAlfLCTGridLayoutCreate;
+                }                
+            layout = new (ELeave) CAlfLCTGridLayout();
+            break;
+#endif // RD_ALF_IN_PLATFORM            
+            
+            
+        case EAlfLayoutTypeAnchor:
+            if (aImplementationUid == 0)
+                {
+                mappedType = EAlfAnchorLayoutCreate;
+                }                
+            layout = new (ELeave) CAlfAnchorLayout();
+            break;
+
+#ifdef RD_ALF_IN_PLATFORM            
+        case EAlfLayoutTypeLCTAnchor:
+            if (aImplementationUid == 0)
+                {
+                mappedType = EAlfLCTAnchorLayoutCreate;
+                }                
+            layout = new (ELeave) CAlfLCTAnchorLayout();
+            break;
+#endif // RD_ALF_IN_PLATFORM            
+            
+        case EAlfLayoutTypeDeck:
+            if (aImplementationUid == 0)
+                {
+                mappedType = EAlfDeckLayoutCreate;
+                }                
+            layout = new (ELeave) CAlfDeckLayout();
+            break;
+            
+        case EAlfLayoutTypeFlow:
+            if (aImplementationUid == 0)
+                {
+                mappedType = EAlfFlowLayoutCreate;
+                }                
+            layout = new (ELeave) CAlfFlowLayout();
+            break;
+            
+        case EAlfLayoutTypeCurvePath:
+            if (aImplementationUid == 0)
+                {
+                mappedType = EAlfCurvePathLayoutCreate;
+                }                
+            layout = new (ELeave) CAlfCurvePathLayout();
+            break;
+            
+        case EAlfLayoutTypeViewport:
+            if (aImplementationUid == 0)
+                {
+                mappedType = EAlfViewportLayoutCreate;
+                }                
+            layout = new (ELeave) CAlfViewportLayout();
+            break;            
+            
+        default:
+            User::Leave(KErrNotFound);
+        }
+
+    CleanupStack::PushL(layout);
+
+    ASSERT(aOwner.Identifier());
+    
+    TInt parentlayouthandle = 0;
+    if (aParentLayout)
+        {
+        parentlayouthandle = aParentLayout->Identifier();
+        }
+    
+    TInt2 inputParams(aOwner.Identifier(), parentlayouthandle);
+   
+    TPckg<TInt2> paramBuf(inputParams);
+
+    layout->CAlfVisual::ConstructL( aOwner, 
+                        (mappedType==KErrNotFound)?aLayoutType:mappedType, 
+                        aImplementationUid, paramBuf );
+    return layout;    
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/alfappfwproxyops.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,76 @@
+/*
+* ============================================================================
+*  Name        : alfappfwproxyops.h
+*  Part of     : uiacceltk / uiaccelerator       *** Info from the SWAD
+*  Description : IPC constants for AlfAppFwProxy
+*  Version     : %version: 5.1.1 % << Don't touch! Updated by Synergy at check-out.
+*
+*  Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies).
+*  All rights reserved.
+*  This component and the accompanying materials are made available
+*  under the terms of "Eclipse Public License v1.0"
+*  which accompanies this distribution, and is available
+*  at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+*  Initial Contributors:
+*  Nokia Corporation - initial contribution.
+*
+*  Contributors:
+*  Nokia Corporation
+* ============================================================================
+* Template version: 4.2
+*/
+
+#ifndef ALFAPPFWPROXYOPS_H
+#define ALFAPPFWPROXYOPS_H
+
+#include <AknsItemID.h>
+const TInt KAlfAppFwProxyUid = 0x20022ef7;
+
+enum AlfProxyCommands
+        {
+        EAlfIsMirrorred = 101,
+        EAlfCbaLocation,
+        EAlfLayoutMetricsRect,
+        EAlfGetCachedColor, 
+        EAlfConvertVisualAndClip,
+        EAlfGetSkinBackgroundBitmap,
+        EAlfGetSkinBitmap,
+        EGetCachedSkinItemData,
+        EGetListOfWindowGroups
+        };
+
+struct TAlfCommandParams{
+        TInt iCommand;
+        TInt iInt1;
+        TInt iInt2;
+        TInt iInt3;        
+        };
+
+// oh, so elegant
+struct TAlfCommandParams2{
+        TInt iCommand;
+        TInt iInt1;
+        TInt iInt2;
+        TInt iInt3;        
+        TInt iInt4;        
+        TFileName iFileName;
+        TSize iSize;
+        TScaleMode iScaleMode;        
+        };
+
+
+struct TAlfCachedSkinItemArray
+    {
+    TInt iCount;
+    TAknsItemID iImages[9];
+    };
+        
+struct TInt2
+    {
+    TInt iInt1;
+    TInt iInt2;
+    };
+
+    
+#endif // ALFAPPFWPROXYOPS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/alfbridgecommands.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,87 @@
+/*
+* 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: 
+*
+*/
+/*
+ * alfbridgecommands.h
+ *
+ *  Created on: May 6, 2009
+ *      Author: teroviit
+ */
+
+#ifndef ALFBRIDGECOMMANDS_H_
+#define ALFBRIDGECOMMANDS_H_
+
+enum TAlfDecoderServerBindings
+    {
+    EAlfDSNewWindow = 100,
+    EAlfDSDestroyWindow,    
+    EAlfDSSetWindowPos,
+    EAlfDSSetWindowSize,
+    EAlfDSSetWindowRotation,
+    EAlfDSSetWindowOpacity,
+    EAlfDSRefreshCallback,
+    EAlfDsUpdateTexture,
+    EAlfDSReorder, 
+    EAlfDSSetWindowActive,
+
+    // 110
+    EAlfDSSetWindowFlag,
+    EAlfDSClearWindowFlag,
+    EAlfDSPostCanvasBuffer,
+    EAlfDSSetCursorData,
+    EAlfDSSetSurfaceExtent,
+    EAlfDsLayerUsesAlphaFlagChanged,
+    EAlfDSGroupChained,
+    EAlfDSGroupChainBroken,
+    EAlfDSMoveWindowToNewGroup,
+    EAlfDSCreateNewDisplay,
+
+    // 120
+    EAlfDSDestroyDisplay,
+    EAlfDSRequestCommandsStart,
+    EAlfRequestWrap,
+    EAlfDSSetNodeTracking,
+    EAlfRequestCommitBatch,
+    EAlfRequestCommandReadNotification,
+    EAlfDSRequestCommandsEnd,    
+    
+    EAlfDSGetCommandsStart, // Put all getters between EAlfDSGetCommandsStart and EAlfDSGetCommandsEnd
+    EAlfDSGetAlfNativeWindowData,
+    EAlfDSGetCommandsEnd,   
+    
+    // 130
+    EAlfEffectFx,
+    EAlfStopEffectFx,
+    EAlfControlEffectFx,
+    EAlfRegisterEffectFx,
+    EAlfUnregisterEffectFx,
+    EAlfUnregisterAllFx,
+    EAlfEffectFxBeginSyncronizedGroup,
+    EAlfEffectFxEndSyncronizedGroup,
+    EAlfDSSetCapturingBitmap,
+    EAlfDSSetCoveringBitmap,
+    EAlfDSSetFadeEffect,
+    EAlfReleaseTemporaryChunk,
+
+    // 140
+    EAlfBridgeSetScreenRotation,
+
+    KUnInitialized
+    
+    
+    };
+
+#endif /* ALFBRIDGECOMMANDS_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/alfclientserver.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Inline methods related to client server communication
+*
+*/
+
+
+
+#ifndef ALFCLIENTSERVER_H
+#define ALFCLIENTSERVER_H
+
+
+#include <e32std.h>
+#include "alfpanicreasons.h"
+
+/**
+ * Calculates padded length of descriptor.
+ *
+ * @since S60 5.0
+ * @param aLength length
+ * @return padded length
+ */
+inline TInt AlfPaddedLength( TInt aLength );
+
+/**
+ * Defines to which boundary lengths should be padded.
+ */
+const TInt KAlfClientServerRoundToBoundary = 4;
+
+/**
+ * Size of command batch buffer used in client & server side.
+ */
+const TInt KAlfClientServerDefaultCommandBatchBufferSize = 512;
+
+/**
+ * Panics client with specified reason.
+ * @param aMessage message to panic.
+ * @param aReason reason to use.
+ */
+inline void AlfPanicClient( const RMessage2& aMessage, TAlfPanicSrv aReason );
+
+#include "alfclientserver.inl"
+
+#endif // ALFCLIENTSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/alfclientserver.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Inline methods related to client server communication
+*
+*/
+
+
+
+// -----------------------------------------------------------------------------
+// Calculates padded length of descriptor
+// -----------------------------------------------------------------------------
+//
+inline TInt AlfPaddedLength( TInt aLength )
+    {
+    const TInt remainder = aLength % KAlfClientServerRoundToBoundary;
+    
+    if ( remainder )
+        {
+        // First round to previous multiple of KAlfClientServerRoundToBoundary
+        // and then go to next
+        aLength -= remainder;
+        aLength += KAlfClientServerRoundToBoundary;
+        }
+    
+    return aLength;
+    }
+
+// -----------------------------------------------------------------------------
+// Just panic
+// -----------------------------------------------------------------------------
+//
+inline void AlfPanicClient( const RMessage2& aMessage, TAlfPanicSrv aReason )
+    {
+    _LIT( KAlfPanicClientCategory, "Alf Toolkit" );
+    aMessage.Panic( KAlfPanicClientCategory, aReason );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/alfcommanddebug.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,194 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Help class for debugging/optimizing the command stream. 
+* -----------------------------------------------------------------------------
+* How to use CAlfCommandDebug
+* 
+* - alfred.iby
+*      - enable inclusion of alfcommanddebug.dll and its resource 
+*      alfcommanddescriptions.rsc
+* 
+* What information are you interested in?
+*      - Select the printed debug information in alfcommanddebug.cpp in 
+*      ConstructL method.
+* 
+* Decide, which point do you want to debug. You can select more than one option.
+* 
+* - alfrenderstage - can print all serialized commands 
+*   - enable flag and macro _ALF_PRINT_WS_COMMANDS_ in alfrenderstageplugin.mmp
+*  
+*      
+* - alfhierarcy - can print all hierarchy related commands (creation, destruction, 
+*  posting draw, etc)
+*   - define _ALF_LOGGING and undefine it in alfhierarchy.cpp around #include <alflogger.h> .
+*    
+*   - define MACRO HUI_DEBUG_TRACK_DRAWING and #define HUI_DEBUG_TRACK_DRAWING in 
+*    alfappservercore.mmp    
+*
+*
+* - alfstreamerbridge - can give human readable name for the commands added to 
+* the queue and processed from the queue
+*       
+*    - define _ALF_LOGGING and undefine it in alfstreamerbridge.cpp 
+*   around #include <alflogger.h> .
+*    
+*    - define MACRO HUI_DEBUG_TRACK_DRAWING and #define HUI_DEBUG_TRACK_DRAWING in 
+*   alfappservercore.mmp    
+*
+*
+* - alfbridge - can tag command buffers with the process name that drew the commands.      
+*    - define _ALF_LOGGING and undefine it in alfbridge.cpp 
+*   around #include <alflogger.h> .
+*    
+*  - define MACRO HUI_DEBUG_TRACK_DRAWING and #define HUI_DEBUG_TRACK_DRAWING 
+*  in alfappservercore.mmp    
+*
+* - huicanvaswspainter.cpp - can print the command names and their parameters 
+* and the process name that drew them (you must enable the above alfbridge debugs, 
+* if you want to see process names)
+* 
+*   - define MACRO HUI_DEBUG_TRACK_DRAWING and #define HUI_DEBUG_TRACK_DRAWING in huitk_base.mmp
+*   
+*   - enable wanted prints in alfcommanddebug.cpp ConstructL function.    
+*
+* NOTE, Logging for all __ALFLOGSTRING variants can be enabled in alfloggingconfiguration.h .
+* However, be prepared for massive amount of debug data and even more sluggish performance, 
+* if that is enabled.
+* 
+*/
+
+#ifndef CALFCOMMANDDEBUG_H_
+#define CALFCOMMANDDEBUG_H_
+
+#include <e32std.h> 
+#include <e32base.h>
+#include <s32mem.h>
+#include <s32strm.h>
+#include <e32debug.h>
+#include <e32hashtab.h>
+#include <gdi.h>
+#include <w32std.h>
+#include <alfcommanddescriptions.rsg>
+
+class CAlfScreen;
+class CHuiControlGroup;
+
+NONSHARABLE_CLASS( CAlfCommandDebug ) : public CBase
+    {
+    public:
+
+        IMPORT_C static CAlfCommandDebug* NewL();
+
+        IMPORT_C void StartFrame();
+
+        IMPORT_C void EndFrame();
+
+        IMPORT_C void PrintStatistic();
+        
+        IMPORT_C void SetDescriptionAndSize( const TUint8& aCommand, const TInt& aSize, TInt aDescriptionList = R_ALF_COMMAND_DESCRIPTION_ARRAY  );
+        
+        IMPORT_C void SetDescription( const TUint8& aCommand, TInt aDescriptionList = R_ALF_COMMAND_DESCRIPTION_ARRAY );
+        
+        IMPORT_C void SetHandle( const TInt& aHandle );
+        
+        IMPORT_C void SetPoint( const TPoint& aPoint );
+        
+        IMPORT_C void SetRect( const TRect& aRect );
+        
+        IMPORT_C void SetRegion( const TRegion& aRegion );
+        
+        IMPORT_C void SetColor( TRgb& aColor );
+        
+        IMPORT_C void SetText( TPtr& aText );
+        
+        IMPORT_C void Print();
+        
+        IMPORT_C void AdjustCommand( const TUint8& aCommand, TInt iAdjustment );
+        
+        IMPORT_C void SetPrint( TBool aPrint );
+        
+        IMPORT_C TFileName WServClientFileName(TInt aClientWindowGroupId, RWsSession& aSession );
+            
+        IMPORT_C TBool TrackProcess( HBufC16* aFileName );
+        
+        IMPORT_C ~CAlfCommandDebug();
+        
+        IMPORT_C TDesC16& Text();
+                
+    private:
+
+        void ConstructL();
+
+        class TCommand : public CBase
+            {
+            
+            public:
+
+                TCommand() : iDescription(NULL), iCount(0), iSize(0){};
+                
+                HBufC16* iDescription;
+                TUint iCount;
+                TUint iSize;
+            };
+        
+        void ReadCommandDescriptionsL( RHashMap<TUint32,TCommand>* aDescriptionArray, TInt aId );
+        
+        
+        
+    private:
+        
+
+        
+        RHashMap<TUint32,TCommand>* iCommandDescriptions;
+        RHashMap<TUint32,TCommand>* iBridgeCommandDescriptions;
+        
+        TInt iTotalCmdCount;
+        TInt iTotalCmdSize;
+        
+        TInt iFrameCount;
+        Uint64 iFrameTotalSize;
+        
+        TBuf<1024> iText;
+        
+        // Change run-time the content of this of set it in ConstructL to track 
+        // certain process drawing in device 
+        TFileName iTrackedProcess;
+        
+        enum TLogginMode
+            {
+            EPrintOnlyCommands = 1,
+            EPrintCommandParameters,
+            EPrintStatistics,
+            EPrintStatisticsForLargeBuffers,
+            EPrintSummary
+            };
+            
+        TLogginMode iMode;
+
+public:        
+
+        TInt iPrint;
+        TBool iPrintStatistics;
+        TInt iLargeBufferDefinition; 
+        TBool iPrintColors;
+        TBool iPrintRegions;
+        TBool iPrintRects;
+        TBool iPrintPoints;
+        TBool iPrintHandles;
+        TBool iPrintTexts;
+        TBool iPrintSummary;
+        
+    };
+
+#endif /* CALFCOMMANDDEBUG_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/alfdecoderserverclient.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Interface for granting a permission and for using files from 
+*                apps' private cage. No capabilities required 
+*
+*/
+
+
+
+#ifndef __ALFBRIDGERCLIENT_H__
+#define __ALFBRIDGERCLIENT_H__
+
+#include <e32std.h>
+#include <e32def.h>
+#include <e32base.h>
+
+NONSHARABLE_CLASS(AlfServerStarter)
+	{
+	public:
+	static IMPORT_C void StartL(TRequestStatus& aStatus, TBool aCreateProcess = ETrue);
+	};
+
+
+/**
+* internal client for decoder server
+*/    
+NONSHARABLE_CLASS(RAlfBridgerClient): public RSessionBase
+    {
+public:
+    /**
+	* Connects to server. Assumes that server is up and running
+	*/
+    IMPORT_C TInt Connect();
+    
+    IMPORT_C TInt SendSynch(TInt aOp, const TDesC8& aBuffer);
+    
+    IMPORT_C TInt SendSynch(TInt aOp, const TIpcArgs& aIPCArgs );
+
+    IMPORT_C void SendAsynchronous(TInt aOp, const TIpcArgs& aIPCArgs,TRequestStatus& aStatus );
+
+    IMPORT_C TInt SendBlind(TInt aOp, const TIpcArgs& aIPCArgs );
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+
+NONSHARABLE_CLASS(RAlfTfxClient): public RAlfBridgerClient
+    {
+public:
+    /**
+	* Connects to server. Assumes that server is up and running
+	*/
+    IMPORT_C TInt Open();
+
+    /**
+    * Loads effects plugin with given implementation uid. 
+    * If the plugin was already loaded, returns KErrAlreadyExists, otherwise system wide error codes.	
+    */
+    IMPORT_C TInt LoadTfxPlugin(const TUid& aPluginUid);
+
+    /**
+    * Unloads effects plugin with given implementation uid. If the plugin had created some additional 
+    * windows to scene, those will be closed
+    */
+    IMPORT_C void UnloadTfxPlugin(const TUid& aPluginUid);
+    
+    /**
+    * Sends message for a plugin, synhcronous method
+    */
+    IMPORT_C TInt SendSynchronousData(const TUid& aPluginUid, const TDesC8& aInBuf, TDes8& aOutBuf);
+ 
+    /**
+    * Sends message for a plugin, asynhcronous method. Calling implementation must ensure that buffers exist 
+    * when command is being executed and completed in server.
+    */   
+    IMPORT_C void SendAsynchronousData(const TUid& aPluginUid, const TDesC8& aInBuf, TDes8& aOutBuf, TRequestStatus& aStatus);
+ 
+    /**
+    * Cancels asynchronous command, if the default values are used, all commands specific for this client will be cancelled
+    * Message ids are implementation specific.
+    */   
+    IMPORT_C void CancelAsynchronousData(const TUid& aPluginUid = KNullUid, TInt aCommandId = 0);
+
+    /**
+     * Trigger effects plugins to prepare next frame. Only FW should use this method
+     */
+    IMPORT_C void PrepareFrame(TUint aEstimatedFrameInterval);
+
+private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+    
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/alfhintapi.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 _ALFHINTAPI_H_
+#define _ALFHINTAPI_H_
+
+#include <graphics/wsgraphicdrawerinterface.h>
+#include <alfhintpluginuids.h>
+
+const TInt KAlfHintObjectInterface = 0x200242A5;
+
+class MAlfHintObserver : public MWsObjectProvider
+    {
+public: 
+    DECLARE_WS_TYPE_ID(KAlfHintObjectInterface)
+    
+    virtual void InsertTagL( TInt aTag, TInt32 aParameter = 0 ) = 0;
+    virtual void InsertTagL( TInt aTag, TRect aBoundingRect, TInt aLayerId ) =0;
+    };
+
+#endif // _ALFHINTAPI_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/alfhintpluginuids.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef _ALFHINTPLUGINUIDS_H_
+#define _ALFHINTPLUGINUIDS_H_
+
+const TUid KAlfHintDrawerInstanceUid = { 0x200242A0 };
+const TUid KAlfHintDrawerTypeUid = { 0x200242A1 };
+const TUid KAlfHintDrawerEcomPluginUid = { 0x200242A2 };
+// const TInt KAlfHintObjectInterface = 0x200242A5;
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/alflogger.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*       Macro definition file for logging.
+*
+*/
+
+
+
+
+#ifndef ALFLOGGER_H
+#define ALFLOGGER_H
+
+#include "alfloggingconfiguration.h"
+#include <e32std.h>
+#include <flogger.h>
+#include <e32svr.h>
+
+_LIT( KLogsDir,                  "alf");
+_LIT( KLogFileName,              "alf.log");
+
+/*
+ We have 3 possible logging methods:
+
+ set ALF_LOGGING_METHOD to 0 to get no logging at all
+ set ALF_LOGGING_METHOD to 1 to get logging via RDebug::Print
+ set ALF_LOGGING_METHOD to 2 to get logging to log file
+
+ Switching on/off is done in the Configuration file (AlfLoggingConfiguration.h)
+ */
+
+#if ( defined (_ALF_LOGGING) )
+    #if ( defined (_ALF_LOGGING_TO_FILE))
+        #define ALF_LOGGING_METHOD 2 
+    #else
+        #define ALF_LOGGING_METHOD 1
+    #endif
+#else
+    #define ALF_LOGGING_METHOD 0
+#endif
+
+
+#if (ALF_LOGGING_METHOD==0)
+    #define __ALFLOGSTRING(C)
+    #define __ALFLOGSTRING1(C, X)
+    #define __ALFLOGSTRING2(C, X, Y)
+    #define __ALFLOGSTRING3(C, X, Y, Z)
+#endif
+#if (ALF_LOGGING_METHOD==1)
+    #define __ALFLOGSTRING(C)            RDebug::Print(_L(C));
+    #define __ALFLOGSTRING1(C, X)        RDebug::Print(_L(C),X);
+    #define __ALFLOGSTRING2(C, X, Y)     RDebug::Print(_L(C),X, Y);
+    #define __ALFLOGSTRING3(C, X, Y, Z)  RDebug::Print(_L(C),X, Y, Z);
+#endif
+#if (ALF_LOGGING_METHOD==2)
+    #define __ALFLOGSTRING(C)            {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, tempLogDes());}
+    #define __ALFLOGSTRING1(C, X)        {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X);}
+    #define __ALFLOGSTRING2(C, X, Y)     {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X,Y);}
+    #define __ALFLOGSTRING3(C, X, Y, Z)  {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X,Y,Z);}
+#endif
+
+// Logging for effects components
+#if ( defined (_ALF_FXLOGGING) )
+    #if ( defined (_ALF_LOGGING_TO_FILE))
+        #define ALF_FXLOGGING_METHOD 2 
+    #else
+        #define ALF_FXLOGGING_METHOD 1
+    #endif
+#else
+    #define ALF_FXLOGGING_METHOD 0
+#endif
+
+#if (ALF_FXLOGGING_METHOD==0)
+    #define __ALFFXLOGSTRING(C)
+    #define __ALFFXLOGSTRING1(C, X)
+    #define __ALFFXLOGSTRING2(C, X, Y)
+    #define __ALFFXLOGSTRING3(C, X, Y, Z)
+#endif
+#if (ALF_FXLOGGING_METHOD==1)
+    #define __ALFFXLOGSTRING(C)            RDebug::Print(_L(C));
+    #define __ALFFXLOGSTRING1(C, X)        RDebug::Print(_L(C),X);
+    #define __ALFFXLOGSTRING2(C, X, Y)     RDebug::Print(_L(C),X, Y);
+    #define __ALFFXLOGSTRING3(C, X, Y, Z)  RDebug::Print(_L(C),X, Y, Z);
+#endif
+#if (ALF_FXLOGGING_METHOD==2)
+    #define __ALFFXLOGSTRING(C)            {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, tempLogDes());}
+    #define __ALFFXLOGSTRING1(C, X)        {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X);}
+    #define __ALFFXLOGSTRING2(C, X, Y)     {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X,Y);}
+    #define __ALFFXLOGSTRING3(C, X, Y, Z)  {_LIT(tempLogDes,C);RFileLogger::WriteFormat(KLogsDir(),KLogFileName(), EFileLoggingModeAppend, TRefByValue<const TDesC>(tempLogDes()),X,Y,Z);}
+#endif
+
+#endif // ALFLOGGER_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/alfloggingconfiguration.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*        Macro definition file for logging configuration.
+*       (Note:This file has to be separate from the logging header file 
+*             to be able to include it in mmp file. If not we will get warning about not used 
+*             flogger.lib in other logging cases where flogger.lib is not used.)
+*
+*/
+
+
+
+
+#ifndef ALFLOGGINGCONFIGURATION_H
+#define ALFLOGGINGCONFIGURATION_H
+
+/**
+* - Have this line active if you want to have logging for this component
+* - Comment this line out if you don't want any logging for this component
+*/
+//#define _ALF_LOGGING
+
+/**
+* - Have this lines active if you want to have logging for effects
+* - Comment thess lines out if you don't want any logging for effects
+*/
+//#define _ALF_FXLOGGING
+//#define HUIFX_TRACE
+/**
+* - Have this line active if you want to have logging to file (defined in AlfLogger.h)
+* - Comment this line out if you want to have logging via RDebug::Print 
+*/
+//#define _ALF_LOGGING_TO_FILE
+
+#endif // ALFLOGGINGCONFIGURATION_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/alfpanicreasons.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Panic reasons for Alfred
+*
+*/
+
+
+
+#ifndef C_ALFPANICREASONS_H
+#define C_ALFPANICREASONS_H
+
+#include <e32def.h>
+
+/**
+ * Enumerates client side panic reasons used in @c Panic defined in alfpanic.h.
+ * Values inside this enumeration should not clash with values in TAlfPanicSrv.
+ */
+enum TAlfPanic
+    {
+    // Editor panics
+    EAlfEditorPanicPredictiveTextDoesNotFit = 100,
+    EAlfEditorPanicFormatExtractionFailure,
+    EAlfEditorPanicNullPointersPassedIn,
+    EAlfEditorPanicBadTextRun,
+    EAlfEditorPanicNoVisual,
+    EAlfEditorPanicCursorPositionOutOfRange,
+    EAlfEditorPanicLineMetricsNotInitialized,
+    EAlfEditorPanicParentLayoutAlreadySet,
+    EAlfEditorPanicInlineTextProcessingSequenceError,
+    EAlfEditorPanicInconsistentLengths,
+    EAlfEditorPanicCurrentTextTooLongForNewMaxLength,
+    EAlfEditorPanicLineMetricsCorrupted,
+    EAlfEditorPanicFailedToObtainAFont,
+    // CAlfRoster
+    EAlfRosterPanicFocusAnomaly = 200,
+    // CAlfEnv
+    EAlfEnvPanicMultipleAlfEnvironments = 300
+    };
+
+/**
+ * Enumerates server side panic reasons used in @c AlfPanicClient
+ * defined in alfclientserver.h.
+ * Values inside this enumeration should not clash with values in TAlfPanic.
+ */
+enum TAlfPanicSrv
+    {
+    /**
+     * IPC with @c EAlfTextureUpdateOwnerId command must be issued
+     * before using texture management functions. Note that this is
+     * automatically sent by CAlfEnv.
+     */
+    EAlfSrvTexturePanicTextureOwnerIdNotUpdated = 10000
+    };
+
+#endif // C_ALFPANICREASONS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/alfrenderstageutils.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 _ALFRSUAPI_H_
+#define _ALFRSUAPI_H_
+
+const TInt KAlfCompositionAgnosticWindowTreeObserverInterfaceId(0x2002BCFB);
+    
+class MAlfCompositionAgnosticWindowTreeObserver
+    {
+public:
+	enum TFlags
+		{
+		/** For a window to be drawn, it needs to be activated and visible and have visible parents.
+	 	Making a window invisible, implies that its children should be invisible as well.
+	 	The default value for a window is true. */
+		EVisible = 1,
+		/** Non-fading windows should not be drawn faded regardless of their fade-count.
+		The default value is false. */
+		ENonFading,
+		/** Windows with this attribute enabled uses alpha channel to control its transparency.
+		The default value is false. */
+		EAlphaChannelTransparencyEnabled,
+		/** True if a clipping rect should be applied when drawing a standard text cursor, false otherwise.
+		The default value is false. */
+		ECursorClipRectSet
+		};
+	/**
+	 This enum encapsulates the set of non-boolean attribute changes that can be observed
+	 using the MWsWindowTreeObserver interface. 
+	 @see AttributeChanged */
+	enum TAttributes
+		{
+		/** Cursor type.
+		@see MWsStandardTextCursor::Type()*/
+		ECursorType = 1,
+		/** Cursor clip rect.
+		@see MWsStandardTextCursor::ClipRect()*/
+		ECursorClipRect,
+		/** Cursor flags.
+		@see MWsStandardTextCursor::Flags()*/
+		ECursorFlags,
+		/** Cursor color.
+		@see MWsStandardTextCursor::Color()*/
+		ECursorColor,
+		/** Window shape.
+		@see MWsWindow::WindowArea()*/
+		EWindowShape,
+		/** Window group name
+		@see MWsWindowGroup::Name()*/
+		EWindowGroupName
+      };
+      
+    virtual void NodeCreated(const MWsWindowTreeNode& aWindowTreeNode, const MWsWindowTreeNode* aParent) = 0;
+    virtual void NodeReleased(const MWsWindowTreeNode& aWindowTreeNode) = 0;
+    virtual void NodeActivated(const MWsWindowTreeNode& aWindowTreeNode) = 0;
+    virtual void NodeExtentChanged(const MWsWindowTreeNode& aWindowTreeNode, const TRect& aRect) = 0;
+    virtual void SiblingOrderChanged(const MWsWindowTreeNode& aWindowTreeNode, TInt aNewPos) = 0;
+    virtual void FlagChanged(const MWsWindowTreeNode& aWindowTreeNode, TInt aFlag, TBool aNewValue) = 0;
+    virtual void AttributeChanged(const MWsWindowTreeNode& aWindowTreeNode, TInt aAttribute) = 0;
+    virtual void FadeCountChanged(const MWsWindowTreeNode& aWindowTreeNode, TInt aFadeCount) = 0;
+    virtual void TransparentRegionChanged(const MWsWindowTreeNode& aWindowTreeNode, const TRegion& aNewTransparentRegion, const TRegion* aNewOpaqueRegion) = 0;
+    //virtual void ElementAdded(const MWsWindowTreeNode& aWindowTreeNode, const TRect& aElement) = 0;
+    virtual void MovedToWindowGroup(const MWsWindowTreeNode& aWindowTreeNode, const MWsWindowTreeNode& aNewWindowGroupNode) = 0;
+    virtual void WindowGroupChained(const MWsWindowTreeNode& aParent, const MWsWindowTreeNode& aChild) = 0;
+    virtual void WindowGroupChainBrokenAfter(const MWsWindowTreeNode& aWindowGroupNode) = 0;
+    virtual void FadeAllChildren(const MWsWindowTreeNode& aWindowTreeNode, TBool aFaded) = 0;
+    };
+
+class RAlfBridgerClient;
+
+class MAlfBridge
+    {
+    public:
+    enum TEvent {
+        EAlfBridgeCreated, // data: MAlfBridge
+        EAlfNativeWindowCreated, // data: TAlfNativeWindowData
+        ESetWindowTreeObserver, // data: MAlfCompositionAgnosticWindowTreeObserver*
+        EExternalize, // externalize complete state data: Todo
+        EInternalize  // reset the state from data data: Todo
+        };
+    
+    virtual void CommitL() = 0;
+    virtual void WriteIntsL(TUint8 aCommand, TInt aCount, TInt* aArray) = 0;
+    virtual RAlfBridgerClient* Client() = 0;
+    };
+
+#endif // _ALFRSUAPI_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/alfuids.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   UID definitions
+*
+*/
+
+
+
+#ifndef ALFUIDS_H
+#define ALFUIDS_H
+
+/**
+ * UID3 of the Alfred Server executable
+ */
+#define KAlfAppServerInterfaceUid3  0x10282845
+
+/**
+ * UID3 of the Alfred Server core library
+ */
+#define KAlfAppServerCoreUid3       0x10282848
+
+/**
+ * UID3 of the Alfred Server client library
+ */
+#define KAlfClientUid3              0x10282846
+
+// This must match with TARGET-field in alfredserver.mmp
+#define ALFSERVERNAME "alfredserver"
+
+#endif // ALFUIDS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/alfwindowstructs.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,140 @@
+#ifndef __ALFWINDOWSTRUCTS_H__
+#define __ALFWINDOWSTRUCTS_H__/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <graphics/wsgraphicdrawer.h>
+
+class RMemWriteStream;
+class RMemReadStream;
+
+/**
+ * Set of Integers that can be used to idnetify all window server windows in system
+ */
+NONSHARABLE_STRUCT(TWindowIdentifier)
+    {
+    /** 
+    * Constructor, for convenience 
+    **/
+    //Default constructor
+    TWindowIdentifier() {}
+	
+    TWindowIdentifier(TInt aWindowGroupId, TInt aWindowIdentifer ):
+        iWindowGroupId(aWindowGroupId), iWindowIdentifer(aWindowIdentifer){}
+    
+    TBool IsNull() const
+        {
+        return (!(iWindowGroupId || iWindowIdentifer)); 
+        }
+    
+    TBool Equals(const TWindowIdentifier& aId) const
+        {
+        return ((iWindowGroupId == aId.iWindowGroupId)&&(iWindowIdentifer==aId.iWindowIdentifer)); 
+        }
+    
+    TInt iWindowGroupId;            
+    TInt iWindowIdentifer;          
+    };
+
+enum TAlfWServFlags
+    {
+    EAlfWservFlagNone,
+    EAlfWservFlagDeleted = 0x1      /** Window was already deleted from wserv scene **/
+    };
+
+
+
+enum TAlfWindovEvents
+    {
+    EAlfWindowDestroyed = 0x1,      /** Specific window was destroyed in wserv scene **/
+    EAlfWindowPosChanged = 0x2,     /** Window Position in wserv scene was changed **/
+    EAlfWindowSizeChanged = 0x4,    /** Window Size in wserv scene was changed **/
+    EAlfWindowNewContent = 0x8,     /** New drawing commands to InBuffer()  **/
+    EAlfWindowVisibile = 0x10,      /**  window changed to visible in wserv scene **/ 
+    EAlfWindowNotVisibile = 0x20,   /** window was hidden in wserv scene **/     
+    EAlfWindowIndexChanged = 0x40,  /** z-order of window changed on server **/
+    };
+    
+/**
+ * @struct TAlfWServInfo
+ *
+ * The struct provides encapsulation for specific wserv window data
+ * Usually this data is for reference only, e.g. effects plugin must 
+ * not alter the data
+ **/    
+NONSHARABLE_STRUCT(TAlfWServInfo)
+    {
+    /** 
+    * Constructors, for convenience 
+    **/
+    TAlfWServInfo():
+        iPosition(TPoint(0,0)), 
+        iSize(TSize(0,0)), 
+        iRefId(TWindowIdentifier(0,0)), 
+        iClientSideId(TWindowIdentifier(0,0)), 
+        iFlags(EAlfWservFlagNone),
+        iScreenNumber(0),
+        iParentRefId(TWindowIdentifier(0,0)){}
+
+
+    TAlfWServInfo(const TPoint& aPosition, const TSize& aSize, TInt aWgNodeId, 
+                  TInt aWsNodeId, TInt aWsClientHandle, TInt aWgClientHandle, TUint8 aScreenNumber = 0 ):
+        iPosition(aPosition), 
+        iSize(aSize), 
+        iRefId(TWindowIdentifier(aWgNodeId, aWsNodeId)), 
+        iClientSideId(TWindowIdentifier(aWsClientHandle, aWgClientHandle)), 
+        iFlags(EAlfWservFlagNone),
+        iScreenNumber( aScreenNumber ){}
+
+    TPoint iPosition; /** Window position in WServ scene **/
+    TSize iSize; /** Window Size in WServ scene **/
+    TWindowIdentifier iRefId; /** Unique node ids between wserv and alf **/
+    TWindowIdentifier iClientSideId; /** RWindow::ClientHandle(), RWindowGroup::Identifier() **/
+    TUint iFlags; 
+    MWsWindowTreeNode::TType  iNodeType;
+    TUint8 iScreenNumber;
+    TWindowIdentifier iParentRefId; /** Unique node ids between wserv and alf **/
+    
+#ifdef ALF_DEBUG_TRACK_DRAWING	
+    TBool iTrackWindow;
+#endif
+    
+    /** 
+    * For convenience.
+    * @return Indicates whether the window still exists in WServ scene 
+    **/
+    TBool ExistsInWServ() const
+        {
+        return !((iRefId.IsNull()) ||(iFlags & EAlfWservFlagDeleted));
+        }
+    };
+
+
+NONSHARABLE_STRUCT(TChunkHeader)
+    {
+    TChunkHeader( ):iReadOffset(0), iWriteOffset(0),iMemWriteStream(NULL),iMemWriteStreamUsers(0),iMemReadStream(NULL){};
+        
+    TUint32 iReadOffset;
+    TUint32 iWriteOffset;
+    TUint32 iCommittedWriteOffset;
+    RMemWriteStream* iMemWriteStream;
+    TUint8 iMemWriteStreamUsers;
+    RMemReadStream* iMemReadStream;
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/coretkoptions.mmh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Common compiler options for coretoolkit and renderers
+*
+*/
+
+
+// This file is a collection of options that affect both hitchcock.dll
+// and the different backends.
+// Both coretoolkit.mmp and all renderer backend .mmp files must include
+// this file to make sure the flags are defined in all relevant places
+// and no conflicts arise because some flag has a different value in one place
+// MACRO affects the source files, #define affects .mmp files
+
+
+// Uses glReadPixels instead of glCopyTexSubImage in CHuiGles10TextureProcessor.
+// and CHuiGles20TextureProcessor.
+// If there is a need to control the renderers separately, move this to each
+// .mmp file and turn on for each renderer separately
+// This flag is not used in hitchcock.dll
+// MACRO           HUI_PROCESSOR_READPIXELS
+
+// Use this to compile on software driver. Will disable full screen anti-aliasing.
+// This does not seem to have any effect at the moment
+// MACRO           OPENGLES_SW_DRIVER
+
+// Here is the common control for disabling all default render surface
+// handling in systems that do not support pBuffers.
+// Has no effect on BitGDI.
+// The disabling can be done for all renderers or only for some
+// If disabled, a display must be created before textures can be loaded.
+// If pBuffers are to be disabled for all, remove comments from both #define and MACRO
+
+// #define DISABLE_ALL_DEFAULT_RENDER_SURFACES
+// MACRO DISABLE_ALL_DEFAULT_RENDER_SURFACES
+
+// Do not turn the flags on by hand in .cpp files, they are needed
+// both in HuiDisplay.cpp and in the individual renderers
+
+#ifdef DISABLE_ALL_DEFAULT_RENDER_SURFACES
+// These are always left without comment marks because they are
+// controlled by the common flag.
+MACRO           GLES10_DISABLE_DEFAULT_RENDER_SURFACE
+MACRO           GLES20_DISABLE_DEFAULT_RENDER_SURFACE
+MACRO           VG10_DISABLE_DEFAULT_RENDER_SURFACE
+#else
+// These are the individual definitions to be used to disable 
+// the pBuffer only for some renderers and allow others to use it.
+// If the flag that disables all pBuffers is turned on,
+// setting these individual flags here has no effect.
+// MACRO           GLES10_DISABLE_DEFAULT_RENDER_SURFACE
+MACRO           GLES20_DISABLE_DEFAULT_RENDER_SURFACE
+MACRO           VG10_DISABLE_DEFAULT_RENDER_SURFACE
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/eglext.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,81 @@
+/*
+* 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: 
+*
+*/
+/*
+ * eglext.h
+ *
+ *  Created on: 1.7.2009
+ *      Author: hennailvonen
+ *      For stub purposes until the real thing is available (wk32 release)
+ *      eglexthackedforsymbian.h was made available in wk32 as an example eglext.h
+ */
+
+#ifndef EGLEXT_H_
+#define EGLEXT_H_
+
+// Temp, use local extension definitions instead global
+#define EGLEXT_LOCAL
+
+#ifdef __cplusplus
+extern "C" {
+#endif /*__cplusplus*/
+
+#include <EGL/egl.h>
+#include <EGL/egltypes.h>
+
+
+/* Header file version number */
+/* Current version at http://www.khronos.org/registry/egl/ */
+/* $Revision: 7244 $ on $Date: 2009-01-20 17:06:59 -0800 (Tue, 20 Jan 2009) $ */
+#ifndef EGL_EGLEXT_VERSION
+#define EGL_EGLEXT_VERSION 3
+
+#ifndef EGLAPIENTRYP
+#define EGLAPIENTRYP EGLAPIENTRY *
+#endif
+
+/* We want this */
+#ifndef EGL_EGLEXT_PROTOTYPES
+#define EGL_EGLEXT_PROTOTYPES
+#endif
+
+/*************************************************************/
+
+
+#ifndef EGL_NOK_resource_profiling
+#define EGL_NOK_resource_profiling 1
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryProfilingDataNOK(EGLDisplay dpy, EGLint query_bits, EGLint *data, EGLint data_size, EGLint *data_count);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYPROFILINGDATANOKPROC) (EGLDisplay dpy, EGLint query_bits, EGLint *data, EGLint data_size, EGLint *data_count);
+typedef void *EGLNativeProcessIdTypeNOK;
+#define EGL_PROF_QUERY_GLOBAL_BIT_NOK          0x0001
+#define EGL_PROF_QUERY_MEMORY_USAGE_BIT_NOK    0x0002
+//Returned as attribute identifiers by eglQueryProfilingDataNOK:
+#define EGL_PROF_TOTAL_MEMORY_NOK              0x3070
+#define EGL_PROF_USED_MEMORY_NOK               0x3071
+#define EGL_PROF_PROCESS_ID_NOK                      0x3072
+#define EGL_PROF_PROCESS_USED_PRIVATE_MEMORY_NOK     0x3073
+#define EGL_PROF_PROCESS_USED_SHARED_MEMORY_NOK      0x3074
+#endif /*EGL_NOK_resource_profiling*/
+
+#endif /*EGL_EGLEXT_VERSION*/
+#ifdef __cplusplus
+}
+#endif /*__cplusplus*/
+
+
+#endif /* EGLEXT_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/huicompileroptions.mmh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,23 @@
+/*
+* 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: 
+*
+*/
+ALWAYS_BUILD_AS_ARM
+// When we have "tekemisen meininkiä(tm)" we dont need to treat warnings as errors
+//OPTION CW       -w possible,unused,largeargs,missingreturn,error
+//OPTION ARMCC    --diag_error 111,177,546,940,1299,2874
+//OPTION ARMCC    -O3 -Otime --cpu 6 --fpu vfpv2
+OPTION ARMCC    -O3 -Otime --cpu 6 --fpu vfpv2
+ARMFPU VFPV2
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/huiwscanvascommands.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,173 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIWSCANVASCOMMANDS_H_
+#define HUIWSCANVASCOMMANDS_H_
+
+
+enum TSgcCanvasCommands
+     {
+     EAlfSendSyncDataBlock = 1,
+     EAlfDrawCommandsStart,
+     EAlfCommandEndMarker,
+     EAlfSendEndMarker,
+
+     EAlfBitBlt,
+     EAlfBitBltRect,
+     EAlfBitBltMasked,
+     EAlfBitBltMaskedPoint,
+     EAlfCombinedBitBlitMasked,
+     
+     //10
+     EAlfResetClippingRegion,
+     EAlfClear,
+     EAlfClearRect,
+     EAlfResetBrushPattern,
+     EAlfResetFont,
+     EAlfDrawArc,
+     EAlfDrawPie,
+     EAlfDrawBitmap1,
+     EAlfDrawBitmap2,
+     EAlfDrawBitmap3,
+
+     //20
+     EAlfDrawBitmapMasked,
+     EAlfDrawRoundRect,
+     EAlfDrawPolyLine,
+     EAlfDrawPolyLineNoEndPoint,
+     EAlfDrawPolygon,
+     EAlfDrawEllipse,
+     EAlfDrawLine,
+     EAlfDrawLineTo,
+     EAlfDrawLineBy,
+     EAlfDrawRect,
+
+     //30
+     EAlfDrawText1,
+     EAlfDrawText2,
+     EAlfDrawText3,
+     EAlfDrawText4,
+     EAlfDrawText5,
+     EAlfDrawTextVertical1,
+     EAlfDrawTextVertical2,
+     EAlfDrawTextVertical3,
+     EAlfDrawTextVertical4,
+     EAlfDrawTextVertical5,
+
+     //40
+     EAlfMoveTo,
+     EAlfMoveBy,
+     EAlfPlot,
+     EAlfReset,
+     EAlfSetBrushColor,
+     EAlfSetBrushOrigin,
+     EAlfSetBrushStyle,
+     EAlfSetClippingRegion,
+     EAlfSetDrawMode,
+     EAlfSetOrigin,
+     
+     //50
+     EAlfSetPenColor,
+     EAlfSetPenStyle,
+     EAlfSetPenSize,
+     EAlfSetTextShadowColor,
+     EAlfSetCharJustification,
+     EAlfSetWordJustification,
+     EAlfSetUnderlineStyle,
+     EAlfSetStrikethroughStyle,
+     EAlfSetBrushPattern,
+     EAlfSetBrushPattern2,
+
+     //60
+     EAlfSetFont,
+     EAlfCopyRect,
+     EAlfUpdateJustification,
+     EAlfUpdateJustificationVertical,
+     EAlfSetFontNoDuplicate,
+     EAlfHasBrushPattern,
+     EAlfHasFont,
+     EAlfBrushColor,
+     EAlfPenColor,
+     EAlfTextShadowColor,
+ 
+     //70
+      EAlfCopySettings,
+     EAlfSetClippingRect,
+     EAlfCancelClippingRect,
+     EAlfSetFaded,
+     EAlfSetFadingParameters,
+     EAlfFadeArea,
+     EAlfMapColors,
+     EAlfSetUserDisplayMode,
+     EAlfUseFont,
+     EAlfSetUpdateRegion,
+
+     // 80
+     EAlfSetShapeRegion,
+     
+     EAlfContentTag,
+     EAlfFrameFlags,
+    
+     EAlfPacketReady,
+     EAlfPacketNotReady,
+     EAlfPacketPadding,
+     EAlfDrawCommandsEnd,
+     EAlfSetWindowId,
+     EAlfWindowInactivateWindow,
+     EAlfWrap,
+     EAlfJumpToAnotherChunk,
+	 EAlfDestroyChunk,
+
+     // 90
+     EAlfSetExtent,
+     EAlfNodeCreated,
+     EAlfNodeReleased,
+     EAlfNodeActivated,
+     EAlfNodeExtentChanged,
+     EAlfNodeSiblingOrderChanged,
+     EAlfNodeFlagChanged,
+     EAlfNodeAttributeChanged,
+     EAlfNodeFadeCountChanged,
+     EAlfNodeTransparentRegionChanged,
+
+     // 100
+     EAlfNodeLayerAdded,
+     EAlfNodeMovedToWindowGroup,
+     EAlfNodeWindowGroupChained,
+     EAlfNodeWindowGroupChainBrokenAfter,
+     EAlfCommandNotInitialized,
+     EAlfCommitBatch,
+     EAlfFrameContainsUnsupportedCommands,
+     EAlfDebugTrackNode,
+     EAlfNodeLayerExtentChanged,
+     EAlfNodeLayerUsesAlphaFlagChanged,
+     EAlfNodeFadeAllChildren,
+     EAlfCommandIndexArray,
+     EAlfCommandIndexArrayHeader,
+     // This must be kept as last command!
+     EAlfLastCommand
+     };
+
+enum TAlfSendBufferFrameFlags
+        {
+        EAlfTransparentContent = 0x01,
+        EAlfTransparentContentFlush = 0x02
+        };
+
+#endif /* HUIWSCANVASCOMMANDS_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/mwsgraphicscontexttobitgdimappings.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 MWSGRAPHICSCONTEXTTOBITGDIMAPPINGS_H
+#define MWSGRAPHICSCONTEXTTOBITGDIMAPPINGS_H
+
+#include <gdi.h>
+#include <graphics/wsgraphicscontext.h>
+
+class MWsGraphicsContextToBitGdiMappings
+	{
+public:
+	static CGraphicsContext::TFillRule Convert(MWsGraphicsContext::TFillRule aFillRule) { return (CGraphicsContext::TFillRule)aFillRule; }
+	static CGraphicsContext::TPenStyle Convert(MWsGraphicsContext::TPenStyle aPenStyle) { return (CGraphicsContext::TPenStyle)aPenStyle; }
+	static CGraphicsContext::TBrushStyle Convert(MWsGraphicsContext::TBrushStyle aBrushStyle) { return (CGraphicsContext::TBrushStyle)aBrushStyle; }
+	static CGraphicsContext::TTextAlign Convert(MWsGraphicsContext::TTextAlign aTextAlign) { return (CGraphicsContext::TTextAlign)aTextAlign; }
+	static TFontUnderline Convert(MWsGraphicsContext::TFontUnderline aFontUnderline) { return (TFontUnderline)aFontUnderline; }
+	static TFontStrikethrough Convert(MWsGraphicsContext::TFontStrikethrough aFontStrikethrough) { return (TFontStrikethrough)aFontStrikethrough; }
+	static CGraphicsContext::TDrawMode LossyConvert(MWsGraphicsContext::TDrawMode aDrawMode)
+		{
+		if(aDrawMode == MWsGraphicsContext::EDrawModePEN)
+			return CGraphicsContext::EDrawModePEN;
+		if(aDrawMode == MWsGraphicsContext::EDrawModeWriteAlpha)
+			return CGraphicsContext::EDrawModeWriteAlpha;
+		return CGraphicsContext::EDrawModePEN;
+		}
+	static TInt LossyConvertPenSize(const TSize& aSize) { return aSize.iWidth; }
+	
+	};
+
+
+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 //MWSGRAPHICSCONTEXTTOBITGDIMAPPINGS_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/CommonInc/uiacceltkdomaincrkeys.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   UIAccelTK domain Central Repository keys.
+*
+*/
+
+
+
+
+#ifndef UIACCELERATORTOOLKITDOMAINCRKEYS_H
+#define UIACCELERATORTOOLKITDOMAINCRKEYS_H
+
+//  INCLUDES
+#include <e32std.h>
+
+/** UIAccelTK Settings API */
+/** Provides access to the UI accelerator toolkit settings */
+const TUid KCRUidUIAccelTK = {0x10283344};
+
+/**
+ * Key for default framerate (frames per second).
+ * Possible values: 0 - 999999 fps
+ */
+const TUint32 KUIAccelTKDefaultFrameRate = 0x00000000;
+
+/**
+ * Key for maximum CPU usage for alfredserver.exe in precentage.
+ * Possible values: 0 - 100 % 
+ */	
+const TUint32 KUIAccelTKMaxCpuUsage = 0x00000001;
+
+/**
+ * Key for used renderer. See huirenderer.h for more details.
+ * Possible values: 
+ * 0 = Automatic selection
+ * 1 = Symbian bitgdi 
+ * 2 = OpenVG 1.0 (Not implemented)
+ * 3 = OpenGL ES 1.0 
+ * 4 = OpenGL ES 1.1
+ */	
+const TUint32 KUIAccelTKRenderer = 0x00000002;
+
+/**
+ * Key for maximum cache size (in kilobytes) allocated for resources.
+ * Possible values: 0 - 999999 KB (0 = no limit)
+ */	
+const TUint32 KUIAccelTKMaxResourceCache = 0x00000003;
+
+/**
+ * Key for effect complexity.
+ * Possible values: 1 - 10 (1 = simpliest, 10 = most complex) 
+ *
+ * The lowest 8 bits (decimal 0-255) are reserved for the complexity factor.
+ * The rest are for RnD purposes:
+ * Flag     Purpose
+ * 0x0100   If set, the dirty regoins will be drawn. Not set by default.
+ * 0x0200   If set, draws outline to all visuals
+ * 0x0400   If set, draws outline to the visuals, whose EAlfVisualFlagEnableDebugMode flag is set
+ * 0x0800   If set, enables memory usage calculation by textures. It writes info messages  
+ *          describing memory consumption and total number of textures along with average bit depth
+ */
+const TUint32 KUIAccelTKEffectsComplexityFactor = 0x00000004;
+
+/**
+ * Key for setting up the HW driver.
+ * Possible values: TBD 
+ *
+ * The lowest bit defines Antialising.
+ * 0 = antialiasing off (fast rendering)
+ * 1 = antialiasing on (multisampling etc.)
+ */
+const TUint32 KUIAccelTKHWConfigurationFlags = 0x00000005;
+
+#endif      // UIACCELERATORTOOLKITDOMAINCRKEYS_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/BWINS/alfappservercoreu.DEF	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,311 @@
+EXPORTS
+	??0CAlfAnchorLayoutHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 1 NONAME ; CAlfAnchorLayoutHandler::CAlfAnchorLayoutHandler(class MAlfInterfaceProvider &)
+	?NewAppServerL@CAlfAppServer@@SAPAV1@XZ @ 2 NONAME
+	??0CAlfAppSrvSessionBase@@QAE@PBVCAlfAppServer@@@Z @ 3 NONAME ; CAlfAppSrvSessionBase::CAlfAppSrvSessionBase(class CAlfAppServer const *)
+	??0CAlfAppSrvSessionBase@@QAE@XZ @ 4 NONAME ; CAlfAppSrvSessionBase::CAlfAppSrvSessionBase(void)
+	??0CAlfAppUi@@QAE@XZ @ 5 NONAME ; CAlfAppUi::CAlfAppUi(void)
+	??0CAlfBorderBrushHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 6 NONAME ; CAlfBorderBrushHandler::CAlfBorderBrushHandler(class MAlfInterfaceProvider &)
+	??0CAlfBrushHandler@@IAE@AAVMAlfInterfaceProvider@@@Z @ 7 NONAME ; CAlfBrushHandler::CAlfBrushHandler(class MAlfInterfaceProvider &)
+	??0CAlfCurvePathLayoutHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 8 NONAME ; CAlfCurvePathLayoutHandler::CAlfCurvePathLayoutHandler(class MAlfInterfaceProvider &)
+	??0CAlfDeckLayoutHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 9 NONAME ; CAlfDeckLayoutHandler::CAlfDeckLayoutHandler(class MAlfInterfaceProvider &)
+	??0CAlfDropShadowBrushHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 10 NONAME ; CAlfDropShadowBrushHandler::CAlfDropShadowBrushHandler(class MAlfInterfaceProvider &)
+	??0CAlfFlowLayoutHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 11 NONAME ; CAlfFlowLayoutHandler::CAlfFlowLayoutHandler(class MAlfInterfaceProvider &)
+	??0CAlfFrameBrushHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 12 NONAME ; CAlfFrameBrushHandler::CAlfFrameBrushHandler(class MAlfInterfaceProvider &)
+	??0CAlfGradientBrushHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 13 NONAME ; CAlfGradientBrushHandler::CAlfGradientBrushHandler(class MAlfInterfaceProvider &)
+	??0CAlfGridLayoutHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 14 NONAME ; CAlfGridLayoutHandler::CAlfGridLayoutHandler(class MAlfInterfaceProvider &)
+	??0CAlfImageBrushHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 15 NONAME ; CAlfImageBrushHandler::CAlfImageBrushHandler(class MAlfInterfaceProvider &)
+	??0CAlfImageVisualHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 16 NONAME ; CAlfImageVisualHandler::CAlfImageVisualHandler(class MAlfInterfaceProvider &)
+	??0CAlfLCTAnchorLayoutHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 17 NONAME ; CAlfLCTAnchorLayoutHandler::CAlfLCTAnchorLayoutHandler(class MAlfInterfaceProvider &)
+	??0CAlfLCTGridLayoutHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 18 NONAME ; CAlfLCTGridLayoutHandler::CAlfLCTGridLayoutHandler(class MAlfInterfaceProvider &)
+	??0CAlfLCTTextVisualHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 19 NONAME ; CAlfLCTTextVisualHandler::CAlfLCTTextVisualHandler(class MAlfInterfaceProvider &)
+	??0CAlfLayoutHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 20 NONAME ; CAlfLayoutHandler::CAlfLayoutHandler(class MAlfInterfaceProvider &)
+	??0CAlfLineVisualHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 21 NONAME ; CAlfLineVisualHandler::CAlfLineVisualHandler(class MAlfInterfaceProvider &)
+	??0CAlfMeshVisualHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 22 NONAME ; CAlfMeshVisualHandler::CAlfMeshVisualHandler(class MAlfInterfaceProvider &)
+	??0CAlfShadowBorderBrushHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 23 NONAME ; CAlfShadowBorderBrushHandler::CAlfShadowBorderBrushHandler(class MAlfInterfaceProvider &)
+	??0CAlfTextVisualHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 24 NONAME ; CAlfTextVisualHandler::CAlfTextVisualHandler(class MAlfInterfaceProvider &)
+	??0CAlfViewportLayoutHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 25 NONAME ; CAlfViewportLayoutHandler::CAlfViewportLayoutHandler(class MAlfInterfaceProvider &)
+	??0CAlfVisualHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 26 NONAME ; CAlfVisualHandler::CAlfVisualHandler(class MAlfInterfaceProvider &)
+	??0TAlfTableMappingFunction@@QAE@XZ @ 27 NONAME ABSENT
+	??1CAlfAnchorLayoutHandler@@MAE@XZ @ 28 NONAME ; CAlfAnchorLayoutHandler::~CAlfAnchorLayoutHandler(void)
+	??1CAlfAppSrvSessionBase@@UAE@XZ @ 29 NONAME ; CAlfAppSrvSessionBase::~CAlfAppSrvSessionBase(void)
+	??1CAlfAppUi@@UAE@XZ @ 30 NONAME ; CAlfAppUi::~CAlfAppUi(void)
+	??1CAlfBorderBrushHandler@@MAE@XZ @ 31 NONAME ; CAlfBorderBrushHandler::~CAlfBorderBrushHandler(void)
+	??1CAlfBrushHandler@@MAE@XZ @ 32 NONAME ; CAlfBrushHandler::~CAlfBrushHandler(void)
+	??1CAlfCurvePathLayoutHandler@@MAE@XZ @ 33 NONAME ; CAlfCurvePathLayoutHandler::~CAlfCurvePathLayoutHandler(void)
+	??1CAlfDeckLayoutHandler@@MAE@XZ @ 34 NONAME ; CAlfDeckLayoutHandler::~CAlfDeckLayoutHandler(void)
+	??1CAlfDropShadowBrushHandler@@MAE@XZ @ 35 NONAME ; CAlfDropShadowBrushHandler::~CAlfDropShadowBrushHandler(void)
+	??1CAlfFlowLayoutHandler@@MAE@XZ @ 36 NONAME ; CAlfFlowLayoutHandler::~CAlfFlowLayoutHandler(void)
+	??1CAlfFrameBrushHandler@@MAE@XZ @ 37 NONAME ; CAlfFrameBrushHandler::~CAlfFrameBrushHandler(void)
+	??1CAlfGradientBrushHandler@@MAE@XZ @ 38 NONAME ; CAlfGradientBrushHandler::~CAlfGradientBrushHandler(void)
+	??1CAlfGridLayoutHandler@@MAE@XZ @ 39 NONAME ; CAlfGridLayoutHandler::~CAlfGridLayoutHandler(void)
+	??1CAlfImageBrushHandler@@MAE@XZ @ 40 NONAME ; CAlfImageBrushHandler::~CAlfImageBrushHandler(void)
+	??1CAlfImageVisualHandler@@MAE@XZ @ 41 NONAME ; CAlfImageVisualHandler::~CAlfImageVisualHandler(void)
+	??1CAlfLCTAnchorLayoutHandler@@MAE@XZ @ 42 NONAME ; CAlfLCTAnchorLayoutHandler::~CAlfLCTAnchorLayoutHandler(void)
+	??1CAlfLCTGridLayoutHandler@@MAE@XZ @ 43 NONAME ; CAlfLCTGridLayoutHandler::~CAlfLCTGridLayoutHandler(void)
+	??1CAlfLCTTextVisualHandler@@MAE@XZ @ 44 NONAME ; CAlfLCTTextVisualHandler::~CAlfLCTTextVisualHandler(void)
+	??1CAlfLayoutHandler@@MAE@XZ @ 45 NONAME ; CAlfLayoutHandler::~CAlfLayoutHandler(void)
+	??1CAlfLineVisualHandler@@MAE@XZ @ 46 NONAME ; CAlfLineVisualHandler::~CAlfLineVisualHandler(void)
+	??1CAlfMeshVisualHandler@@MAE@XZ @ 47 NONAME ; CAlfMeshVisualHandler::~CAlfMeshVisualHandler(void)
+	??1CAlfShadowBorderBrushHandler@@MAE@XZ @ 48 NONAME ; CAlfShadowBorderBrushHandler::~CAlfShadowBorderBrushHandler(void)
+	??1CAlfTextVisualHandler@@MAE@XZ @ 49 NONAME ; CAlfTextVisualHandler::~CAlfTextVisualHandler(void)
+	??1CAlfViewportLayoutHandler@@MAE@XZ @ 50 NONAME ; CAlfViewportLayoutHandler::~CAlfViewportLayoutHandler(void)
+	??1CAlfVisualHandler@@MAE@XZ @ 51 NONAME ; CAlfVisualHandler::~CAlfVisualHandler(void)
+	?AdjustWindowGroupPositionL@CAlfAppServer@@QAEXAAVRWindowGroup@@HW4TAlfWGPostion@1@@Z @ 52 NONAME ; void CAlfAppServer::AdjustWindowGroupPositionL(class RWindowGroup &, int, enum CAlfAppServer::TAlfWGPostion)
+	?AlfAppUi@CAlfAppSrvSessionBase@@QAEPAVCAlfAppUi@@XZ @ 53 NONAME ; class CAlfAppUi * CAlfAppSrvSessionBase::AlfAppUi(void)
+	?AlfServer@CAlfAppSrvSessionBase@@QAEPAVCAlfAppServer@@XZ @ 54 NONAME ; class CAlfAppServer * CAlfAppSrvSessionBase::AlfServer(void)
+	?AppUi@CAlfAppServer@@QAEPAVCAlfAppUi@@XZ @ 55 NONAME ; class CAlfAppUi * CAlfAppServer::AppUi(void)
+	?AppendDisplayOnSharedWindowL@CAlfAppUi@@QAEXAAVCHuiDisplay@@@Z @ 56 NONAME ; void CAlfAppUi::AppendDisplayOnSharedWindowL(class CHuiDisplay &)
+	?BaseConstructL@CAlfAppSrvSessionBase@@IAEXXZ @ 57 NONAME ; void CAlfAppSrvSessionBase::BaseConstructL(void)
+	?ClientDrawingArea@CAlfAppSrvSessionBase@@UBE?AVTRect@@XZ @ 58 NONAME ; class TRect CAlfAppSrvSessionBase::ClientDrawingArea(void) const
+	?CompleteCmd@CAlfAppSrvSessionBase@@UAEXHH@Z @ 59 NONAME ; void CAlfAppSrvSessionBase::CompleteCmd(int, int)
+	?ConstructL@CAlfAnchorLayoutHandler@@UAEXPAVCHuiVisual@@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 60 NONAME ; void CAlfAnchorLayoutHandler::ConstructL(class CHuiVisual *, class CHuiControl &, class CHuiLayout *)
+	?ConstructL@CAlfAppUi@@UAEXXZ @ 61 NONAME ; void CAlfAppUi::ConstructL(void)
+	?ConstructL@CAlfBorderBrushHandler@@QAEXPAVCHuiBrush@@HHHH@Z @ 62 NONAME ; void CAlfBorderBrushHandler::ConstructL(class CHuiBrush *, int, int, int, int)
+	?ConstructL@CAlfBrushHandler@@IAEXPAVCHuiBrush@@@Z @ 63 NONAME ; void CAlfBrushHandler::ConstructL(class CHuiBrush *)
+	?ConstructL@CAlfCurvePathLayoutHandler@@UAEXPAVCHuiVisual@@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 64 NONAME ; void CAlfCurvePathLayoutHandler::ConstructL(class CHuiVisual *, class CHuiControl &, class CHuiLayout *)
+	?ConstructL@CAlfDeckLayoutHandler@@UAEXPAVCHuiVisual@@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 65 NONAME ; void CAlfDeckLayoutHandler::ConstructL(class CHuiVisual *, class CHuiControl &, class CHuiLayout *)
+	?ConstructL@CAlfDropShadowBrushHandler@@QAEXPAVCHuiBrush@@H@Z @ 66 NONAME ; void CAlfDropShadowBrushHandler::ConstructL(class CHuiBrush *, int)
+	?ConstructL@CAlfFlowLayoutHandler@@UAEXPAVCHuiVisual@@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 67 NONAME ; void CAlfFlowLayoutHandler::ConstructL(class CHuiVisual *, class CHuiControl &, class CHuiLayout *)
+	?ConstructL@CAlfFrameBrushHandler@@QAEXPAVCHuiBrush@@ABVTAknsItemID@@HH@Z @ 68 NONAME ; void CAlfFrameBrushHandler::ConstructL(class CHuiBrush *, class TAknsItemID const &, int, int)
+	?ConstructL@CAlfGradientBrushHandler@@QAEXPAVCHuiBrush@@@Z @ 69 NONAME ; void CAlfGradientBrushHandler::ConstructL(class CHuiBrush *)
+	?ConstructL@CAlfGridLayoutHandler@@UAEXPAVCHuiVisual@@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 70 NONAME ; void CAlfGridLayoutHandler::ConstructL(class CHuiVisual *, class CHuiControl &, class CHuiLayout *)
+	?ConstructL@CAlfImageBrushHandler@@QAEXPAVCHuiBrush@@VTHuiImage@@@Z @ 71 NONAME ; void CAlfImageBrushHandler::ConstructL(class CHuiBrush *, class THuiImage)
+	?ConstructL@CAlfImageVisualHandler@@UAEXPAVCHuiVisual@@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 72 NONAME ; void CAlfImageVisualHandler::ConstructL(class CHuiVisual *, class CHuiControl &, class CHuiLayout *)
+	?ConstructL@CAlfLCTAnchorLayoutHandler@@UAEXPAVCHuiVisual@@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 73 NONAME ; void CAlfLCTAnchorLayoutHandler::ConstructL(class CHuiVisual *, class CHuiControl &, class CHuiLayout *)
+	?ConstructL@CAlfLCTGridLayoutHandler@@UAEXPAVCHuiVisual@@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 74 NONAME ; void CAlfLCTGridLayoutHandler::ConstructL(class CHuiVisual *, class CHuiControl &, class CHuiLayout *)
+	?ConstructL@CAlfLCTTextVisualHandler@@UAEXPAVCHuiVisual@@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 75 NONAME ; void CAlfLCTTextVisualHandler::ConstructL(class CHuiVisual *, class CHuiControl &, class CHuiLayout *)
+	?ConstructL@CAlfLayoutHandler@@UAEXPAVCHuiVisual@@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 76 NONAME ; void CAlfLayoutHandler::ConstructL(class CHuiVisual *, class CHuiControl &, class CHuiLayout *)
+	?ConstructL@CAlfLineVisualHandler@@UAEXPAVCHuiVisual@@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 77 NONAME ; void CAlfLineVisualHandler::ConstructL(class CHuiVisual *, class CHuiControl &, class CHuiLayout *)
+	?ConstructL@CAlfMeshVisualHandler@@QAEXPAVCHuiVisual@@AAVCHuiControl@@W4THuiMeshType@@PAVCHuiLayout@@@Z @ 78 NONAME ; void CAlfMeshVisualHandler::ConstructL(class CHuiVisual *, class CHuiControl &, enum THuiMeshType, class CHuiLayout *)
+	?ConstructL@CAlfShadowBorderBrushHandler@@QAEXPAVCHuiBrush@@H@Z @ 79 NONAME ; void CAlfShadowBorderBrushHandler::ConstructL(class CHuiBrush *, int)
+	?ConstructL@CAlfTextVisualHandler@@UAEXPAVCHuiVisual@@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 80 NONAME ; void CAlfTextVisualHandler::ConstructL(class CHuiVisual *, class CHuiControl &, class CHuiLayout *)
+	?ConstructL@CAlfViewportLayoutHandler@@UAEXPAVCHuiVisual@@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 81 NONAME ; void CAlfViewportLayoutHandler::ConstructL(class CHuiVisual *, class CHuiControl &, class CHuiLayout *)
+	?ConstructL@CAlfVisualHandler@@UAEXPAVCHuiVisual@@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 82 NONAME ; void CAlfVisualHandler::ConstructL(class CHuiVisual *, class CHuiControl &, class CHuiLayout *)
+	?Container@CAlfAppUi@@QAEPAVCCoeControl@@XZ @ 83 NONAME ; class CCoeControl * CAlfAppUi::Container(void)
+	?ControlGroupCountL@CAlfSrvEffectEnv@@QAEHXZ @ 84 NONAME ; int CAlfSrvEffectEnv::ControlGroupCountL(void)
+	?ControlGroupL@CAlfSrvEffectEnv@@QAEPAVCHuiControlGroup@@H@Z @ 85 NONAME ; class CHuiControlGroup * CAlfSrvEffectEnv::ControlGroupL(int)
+	?CopyTimedPoint@AlfTimedPointUtility@@SAXAAVTAlfTimedPoint@@AAVTHuiTimedPoint@@@Z @ 86 NONAME ; void AlfTimedPointUtility::CopyTimedPoint(class TAlfTimedPoint &, class THuiTimedPoint &)
+	?CopyTimedPoint@AlfTimedPointUtility@@SAXAAVTAlfTimedPoint@@AAVTHuiTimedPoint@@AAVMAlfInterfaceProvider@@@Z @ 87 NONAME ; void AlfTimedPointUtility::CopyTimedPoint(class TAlfTimedPoint &, class THuiTimedPoint &, class MAlfInterfaceProvider &)
+	?CopyTimedPoint@AlfTimedPointUtility@@SAXAAVTHuiTimedPoint@@AAVTAlfTimedPoint@@@Z @ 88 NONAME ; void AlfTimedPointUtility::CopyTimedPoint(class THuiTimedPoint &, class TAlfTimedPoint &)
+	?CopyTimedValue@AlfTimedValueUtility@@SAXAAVTAlfTimedValue@@AAVTHuiTimedValue@@@Z @ 89 NONAME ; void AlfTimedValueUtility::CopyTimedValue(class TAlfTimedValue &, class THuiTimedValue &)
+	?CopyTimedValue@AlfTimedValueUtility@@SAXAAVTAlfTimedValue@@AAVTHuiTimedValue@@AAVMAlfInterfaceProvider@@@Z @ 90 NONAME ; void AlfTimedValueUtility::CopyTimedValue(class TAlfTimedValue &, class THuiTimedValue &, class MAlfInterfaceProvider &)
+	?CopyTimedValue@AlfTimedValueUtility@@SAXAAVTHuiTimedValue@@AAVTAlfTimedValue@@@Z @ 91 NONAME ; void AlfTimedValueUtility::CopyTimedValue(class THuiTimedValue &, class TAlfTimedValue &)
+	?DisplayCountL@CAlfSrvEffectEnv@@QAEHXZ @ 92 NONAME ; int CAlfSrvEffectEnv::DisplayCountL(void)
+	?DisplayL@CAlfSrvEffectEnv@@QAEPAVCHuiDisplay@@H@Z @ 93 NONAME ; class CHuiDisplay * CAlfSrvEffectEnv::DisplayL(int)
+	?ExtensionInterfaceL@CAlfAppSrvSessionBase@@UAEXVTUid@@AAPAX@Z @ 94 NONAME ; void CAlfAppSrvSessionBase::ExtensionInterfaceL(class TUid, void * &)
+	?FactoryDestroyed@CAlfAppSrvSessionBase@@UAEXH@Z @ 95 NONAME ; void CAlfAppSrvSessionBase::FactoryDestroyed(int)
+	?FocusGainedL@CAlfAppSrvSessionBase@@UAEXH@Z @ 96 NONAME ; void CAlfAppSrvSessionBase::FocusGainedL(int)
+	?FocusLostL@CAlfAppSrvSessionBase@@UAEHH@Z @ 97 NONAME ; int CAlfAppSrvSessionBase::FocusLostL(int)
+	?FrameworkCallsRendezvous@CAlfAppUi@@UBEHXZ @ 98 NONAME ; int CAlfAppUi::FrameworkCallsRendezvous(void) const
+	?GetHandleFromInterface@CAlfAppSrvSessionBase@@UAEHABW4THuiInterfaceSupport@@PAX@Z @ 99 NONAME ; int CAlfAppSrvSessionBase::GetHandleFromInterface(enum THuiInterfaceSupport const &, void *)
+	?GetInterface@CAlfAnchorLayoutHandler@@UAEPAXABW4THuiInterfaceSupport@@@Z @ 100 NONAME ; void * CAlfAnchorLayoutHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfBorderBrushHandler@@MAEPAXABW4THuiInterfaceSupport@@@Z @ 101 NONAME ; void * CAlfBorderBrushHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfBrushHandler@@MAEPAXABW4THuiInterfaceSupport@@@Z @ 102 NONAME ; void * CAlfBrushHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfCurvePathLayoutHandler@@UAEPAXABW4THuiInterfaceSupport@@@Z @ 103 NONAME ; void * CAlfCurvePathLayoutHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfDropShadowBrushHandler@@MAEPAXABW4THuiInterfaceSupport@@@Z @ 104 NONAME ; void * CAlfDropShadowBrushHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfFlowLayoutHandler@@UAEPAXABW4THuiInterfaceSupport@@@Z @ 105 NONAME ; void * CAlfFlowLayoutHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfFrameBrushHandler@@MAEPAXABW4THuiInterfaceSupport@@@Z @ 106 NONAME ; void * CAlfFrameBrushHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfGradientBrushHandler@@MAEPAXABW4THuiInterfaceSupport@@@Z @ 107 NONAME ; void * CAlfGradientBrushHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfGridLayoutHandler@@UAEPAXABW4THuiInterfaceSupport@@@Z @ 108 NONAME ; void * CAlfGridLayoutHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfImageBrushHandler@@MAEPAXABW4THuiInterfaceSupport@@@Z @ 109 NONAME ; void * CAlfImageBrushHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfImageVisualHandler@@UAEPAXABW4THuiInterfaceSupport@@@Z @ 110 NONAME ; void * CAlfImageVisualHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfLCTAnchorLayoutHandler@@UAEPAXABW4THuiInterfaceSupport@@@Z @ 111 NONAME ; void * CAlfLCTAnchorLayoutHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfLCTGridLayoutHandler@@UAEPAXABW4THuiInterfaceSupport@@@Z @ 112 NONAME ; void * CAlfLCTGridLayoutHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfLCTTextVisualHandler@@UAEPAXABW4THuiInterfaceSupport@@@Z @ 113 NONAME ; void * CAlfLCTTextVisualHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfLayoutHandler@@UAEPAXABW4THuiInterfaceSupport@@@Z @ 114 NONAME ; void * CAlfLayoutHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfLineVisualHandler@@UAEPAXABW4THuiInterfaceSupport@@@Z @ 115 NONAME ; void * CAlfLineVisualHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfMeshVisualHandler@@UAEPAXABW4THuiInterfaceSupport@@@Z @ 116 NONAME ; void * CAlfMeshVisualHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfShadowBorderBrushHandler@@MAEPAXABW4THuiInterfaceSupport@@@Z @ 117 NONAME ; void * CAlfShadowBorderBrushHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfTextVisualHandler@@UAEPAXABW4THuiInterfaceSupport@@@Z @ 118 NONAME ; void * CAlfTextVisualHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfViewportLayoutHandler@@UAEPAXABW4THuiInterfaceSupport@@@Z @ 119 NONAME ; void * CAlfViewportLayoutHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterface@CAlfVisualHandler@@UAEPAXABW4THuiInterfaceSupport@@@Z @ 120 NONAME ; void * CAlfVisualHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?GetInterfaceL@CAlfAppSrvSessionBase@@UAEPAXABW4THuiInterfaceSupport@@H@Z @ 121 NONAME ; void * CAlfAppSrvSessionBase::GetInterfaceL(enum THuiInterfaceSupport const &, int)
+	?HandleClientExit@CAlfAppServer@@QAEXH@Z @ 122 NONAME ; void CAlfAppServer::HandleClientExit(int)
+	?HandleCmdL@CAlfAnchorLayoutHandler@@UAEXHABVTDesC8@@AAVTDes8@@@Z @ 123 NONAME ; void CAlfAnchorLayoutHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfBorderBrushHandler@@MAEXHABVTDesC8@@AAVTDes8@@@Z @ 124 NONAME ; void CAlfBorderBrushHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfBrushHandler@@MAEXHABVTDesC8@@AAVTDes8@@@Z @ 125 NONAME ; void CAlfBrushHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfCurvePathLayoutHandler@@UAEXHABVTDesC8@@AAVTDes8@@@Z @ 126 NONAME ; void CAlfCurvePathLayoutHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfDropShadowBrushHandler@@MAEXHABVTDesC8@@AAVTDes8@@@Z @ 127 NONAME ; void CAlfDropShadowBrushHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfFlowLayoutHandler@@UAEXHABVTDesC8@@AAVTDes8@@@Z @ 128 NONAME ; void CAlfFlowLayoutHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfFrameBrushHandler@@MAEXHABVTDesC8@@AAVTDes8@@@Z @ 129 NONAME ; void CAlfFrameBrushHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfGradientBrushHandler@@MAEXHABVTDesC8@@AAVTDes8@@@Z @ 130 NONAME ; void CAlfGradientBrushHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfGridLayoutHandler@@UAEXHABVTDesC8@@AAVTDes8@@@Z @ 131 NONAME ; void CAlfGridLayoutHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfImageBrushHandler@@MAEXHABVTDesC8@@AAVTDes8@@@Z @ 132 NONAME ; void CAlfImageBrushHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfImageVisualHandler@@UAEXHABVTDesC8@@AAVTDes8@@@Z @ 133 NONAME ; void CAlfImageVisualHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfLCTAnchorLayoutHandler@@UAEXHABVTDesC8@@AAVTDes8@@@Z @ 134 NONAME ; void CAlfLCTAnchorLayoutHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfLCTGridLayoutHandler@@UAEXHABVTDesC8@@AAVTDes8@@@Z @ 135 NONAME ; void CAlfLCTGridLayoutHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfLCTTextVisualHandler@@UAEXHABVTDesC8@@AAVTDes8@@@Z @ 136 NONAME ; void CAlfLCTTextVisualHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfLayoutHandler@@UAEXHABVTDesC8@@AAVTDes8@@@Z @ 137 NONAME ; void CAlfLayoutHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfLineVisualHandler@@UAEXHABVTDesC8@@AAVTDes8@@@Z @ 138 NONAME ; void CAlfLineVisualHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfMeshVisualHandler@@UAEXHABVTDesC8@@AAVTDes8@@@Z @ 139 NONAME ; void CAlfMeshVisualHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfShadowBorderBrushHandler@@MAEXHABVTDesC8@@AAVTDes8@@@Z @ 140 NONAME ; void CAlfShadowBorderBrushHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfTextVisualHandler@@UAEXHABVTDesC8@@AAVTDes8@@@Z @ 141 NONAME ; void CAlfTextVisualHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfViewportLayoutHandler@@UAEXHABVTDesC8@@AAVTDes8@@@Z @ 142 NONAME ; void CAlfViewportLayoutHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCmdL@CAlfVisualHandler@@UAEXHABVTDesC8@@AAVTDes8@@@Z @ 143 NONAME ; void CAlfVisualHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?HandleCommandL@CAlfAppUi@@UAEXH@Z @ 144 NONAME ; void CAlfAppUi::HandleCommandL(int)
+	?HandleCurrentCommanndAsynch@CAlfAppSrvSessionBase@@UAEHXZ @ 145 NONAME ; int CAlfAppSrvSessionBase::HandleCurrentCommanndAsynch(void)
+	?HandleResourceChangeL@CAlfAppUi@@UAEXH@Z @ 146 NONAME ; void CAlfAppUi::HandleResourceChangeL(int)
+	?HandleSystemEventL@CAlfAppUi@@UAEXABVTWsEvent@@@Z @ 147 NONAME ; void CAlfAppUi::HandleSystemEventL(class TWsEvent const &)
+	?HandleWsEventL@CAlfAppUi@@UAEXABVTWsEvent@@PAVCCoeControl@@@Z @ 148 NONAME ; void CAlfAppUi::HandleWsEventL(class TWsEvent const &, class CCoeControl *)
+	?LayoutManager@CAlfAppSrvSessionBase@@UBEPAVCAlfLayoutManager@@XZ @ 149 NONAME ; class CAlfLayoutManager * CAlfAppSrvSessionBase::LayoutManager(void) const
+	?MapValue@TAlfTableMappingFunction@@UBEMMH@Z @ 150 NONAME ABSENT
+	?MetricsInterface@CAlfAppServer@@QAEPAVMAlfMetricsInterface@@XZ @ 151 NONAME ; class MAlfMetricsInterface * CAlfAppServer::MetricsInterface(void)
+	?MetricsInterface@CAlfAppServer@@QBEPBVMAlfMetricsInterface@@XZ @ 152 NONAME ; class MAlfMetricsInterface const * CAlfAppServer::MetricsInterface(void) const
+	?NewL@CAlfAnchorLayoutHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@PAVCHuiControl@@PAVCHuiLayout@@@Z @ 153 NONAME ; class MAlfExtension * CAlfAnchorLayoutHandler::NewL(class MAlfInterfaceProvider &, class CHuiControl *, class CHuiLayout *)
+	?NewL@CAlfBorderBrushHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@HHHH@Z @ 154 NONAME ; class MAlfExtension * CAlfBorderBrushHandler::NewL(class MAlfInterfaceProvider &, int, int, int, int)
+	?NewL@CAlfCurvePathLayoutHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@PAVCHuiControl@@PAVCHuiLayout@@@Z @ 155 NONAME ; class MAlfExtension * CAlfCurvePathLayoutHandler::NewL(class MAlfInterfaceProvider &, class CHuiControl *, class CHuiLayout *)
+	?NewL@CAlfDeckLayoutHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@PAVCHuiControl@@PAVCHuiLayout@@@Z @ 156 NONAME ; class MAlfExtension * CAlfDeckLayoutHandler::NewL(class MAlfInterfaceProvider &, class CHuiControl *, class CHuiLayout *)
+	?NewL@CAlfDropShadowBrushHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@H@Z @ 157 NONAME ; class MAlfExtension * CAlfDropShadowBrushHandler::NewL(class MAlfInterfaceProvider &, int)
+	?NewL@CAlfFlowLayoutHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@PAVCHuiControl@@PAVCHuiLayout@@@Z @ 158 NONAME ; class MAlfExtension * CAlfFlowLayoutHandler::NewL(class MAlfInterfaceProvider &, class CHuiControl *, class CHuiLayout *)
+	?NewL@CAlfFrameBrushHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@ABVTAknsItemID@@HH@Z @ 159 NONAME ; class MAlfExtension * CAlfFrameBrushHandler::NewL(class MAlfInterfaceProvider &, class TAknsItemID const &, int, int)
+	?NewL@CAlfGradientBrushHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@@Z @ 160 NONAME ; class MAlfExtension * CAlfGradientBrushHandler::NewL(class MAlfInterfaceProvider &)
+	?NewL@CAlfGridLayoutHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@PAVCHuiControl@@PAVCHuiLayout@@@Z @ 161 NONAME ; class MAlfExtension * CAlfGridLayoutHandler::NewL(class MAlfInterfaceProvider &, class CHuiControl *, class CHuiLayout *)
+	?NewL@CAlfImageBrushHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@VTHuiImage@@@Z @ 162 NONAME ; class MAlfExtension * CAlfImageBrushHandler::NewL(class MAlfInterfaceProvider &, class THuiImage)
+	?NewL@CAlfImageVisualHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@PAVCHuiControl@@PAVCHuiLayout@@@Z @ 163 NONAME ; class MAlfExtension * CAlfImageVisualHandler::NewL(class MAlfInterfaceProvider &, class CHuiControl *, class CHuiLayout *)
+	?NewL@CAlfLCTAnchorLayoutHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@PAVCHuiControl@@PAVCHuiLayout@@@Z @ 164 NONAME ; class MAlfExtension * CAlfLCTAnchorLayoutHandler::NewL(class MAlfInterfaceProvider &, class CHuiControl *, class CHuiLayout *)
+	?NewL@CAlfLCTGridLayoutHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@PAVCHuiControl@@PAVCHuiLayout@@@Z @ 165 NONAME ; class MAlfExtension * CAlfLCTGridLayoutHandler::NewL(class MAlfInterfaceProvider &, class CHuiControl *, class CHuiLayout *)
+	?NewL@CAlfLCTTextVisualHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@PAVCHuiControl@@PAVCHuiLayout@@@Z @ 166 NONAME ; class MAlfExtension * CAlfLCTTextVisualHandler::NewL(class MAlfInterfaceProvider &, class CHuiControl *, class CHuiLayout *)
+	?NewL@CAlfLayoutHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@PAVCHuiControl@@PAVCHuiLayout@@@Z @ 167 NONAME ; class MAlfExtension * CAlfLayoutHandler::NewL(class MAlfInterfaceProvider &, class CHuiControl *, class CHuiLayout *)
+	?NewL@CAlfLineVisualHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@PAVCHuiControl@@PAVCHuiLayout@@@Z @ 168 NONAME ; class MAlfExtension * CAlfLineVisualHandler::NewL(class MAlfInterfaceProvider &, class CHuiControl *, class CHuiLayout *)
+	?NewL@CAlfMeshVisualHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@PAVCHuiControl@@W4THuiMeshType@@PAVCHuiLayout@@@Z @ 169 NONAME ; class MAlfExtension * CAlfMeshVisualHandler::NewL(class MAlfInterfaceProvider &, class CHuiControl *, enum THuiMeshType, class CHuiLayout *)
+	?NewL@CAlfShadowBorderBrushHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@H@Z @ 170 NONAME ; class MAlfExtension * CAlfShadowBorderBrushHandler::NewL(class MAlfInterfaceProvider &, int)
+	?NewL@CAlfTextVisualHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@PAVCHuiControl@@PAVCHuiLayout@@@Z @ 171 NONAME ; class MAlfExtension * CAlfTextVisualHandler::NewL(class MAlfInterfaceProvider &, class CHuiControl *, class CHuiLayout *)
+	?NewL@CAlfViewportLayoutHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@PAVCHuiControl@@PAVCHuiLayout@@@Z @ 172 NONAME ; class MAlfExtension * CAlfViewportLayoutHandler::NewL(class MAlfInterfaceProvider &, class CHuiControl *, class CHuiLayout *)
+	?NewL@CAlfVisualHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@PAVCHuiControl@@PAVCHuiLayout@@@Z @ 173 NONAME ; class MAlfExtension * CAlfVisualHandler::NewL(class MAlfInterfaceProvider &, class CHuiControl *, class CHuiLayout *)
+	?OpenFileForTokenL@AlfFileTokenUtility@@SAXAAVRFile@@ABVTDesC8@@@Z @ 174 NONAME ; void AlfFileTokenUtility::OpenFileForTokenL(class RFile &, class TDesC8 const &)
+	?PreferredRefreshMode@CAlfAppSrvSessionBase@@UBE?AW4THuiRefreshMode@@XZ @ 175 NONAME ; enum THuiRefreshMode CAlfAppSrvSessionBase::PreferredRefreshMode(void) const
+	?PreferredWindowGroupPosition@CAlfAppSrvSessionBase@@UBE?AW4TAlfWGPostion@CAlfAppServer@@XZ @ 176 NONAME ; enum CAlfAppServer::TAlfWGPostion CAlfAppSrvSessionBase::PreferredWindowGroupPosition(void) const
+	?Release@CAlfAnchorLayoutHandler@@UAEXXZ @ 177 NONAME ; void CAlfAnchorLayoutHandler::Release(void)
+	?Release@CAlfBorderBrushHandler@@MAEXXZ @ 178 NONAME ; void CAlfBorderBrushHandler::Release(void)
+	?Release@CAlfBrushHandler@@MAEXXZ @ 179 NONAME ; void CAlfBrushHandler::Release(void)
+	?Release@CAlfCurvePathLayoutHandler@@UAEXXZ @ 180 NONAME ; void CAlfCurvePathLayoutHandler::Release(void)
+	?Release@CAlfDropShadowBrushHandler@@MAEXXZ @ 181 NONAME ; void CAlfDropShadowBrushHandler::Release(void)
+	?Release@CAlfFlowLayoutHandler@@UAEXXZ @ 182 NONAME ; void CAlfFlowLayoutHandler::Release(void)
+	?Release@CAlfFrameBrushHandler@@MAEXXZ @ 183 NONAME ; void CAlfFrameBrushHandler::Release(void)
+	?Release@CAlfGradientBrushHandler@@MAEXXZ @ 184 NONAME ; void CAlfGradientBrushHandler::Release(void)
+	?Release@CAlfGridLayoutHandler@@UAEXXZ @ 185 NONAME ; void CAlfGridLayoutHandler::Release(void)
+	?Release@CAlfImageBrushHandler@@MAEXXZ @ 186 NONAME ; void CAlfImageBrushHandler::Release(void)
+	?Release@CAlfImageVisualHandler@@UAEXXZ @ 187 NONAME ; void CAlfImageVisualHandler::Release(void)
+	?Release@CAlfLCTAnchorLayoutHandler@@UAEXXZ @ 188 NONAME ; void CAlfLCTAnchorLayoutHandler::Release(void)
+	?Release@CAlfLCTGridLayoutHandler@@UAEXXZ @ 189 NONAME ; void CAlfLCTGridLayoutHandler::Release(void)
+	?Release@CAlfLCTTextVisualHandler@@UAEXXZ @ 190 NONAME ; void CAlfLCTTextVisualHandler::Release(void)
+	?Release@CAlfLayoutHandler@@UAEXXZ @ 191 NONAME ; void CAlfLayoutHandler::Release(void)
+	?Release@CAlfLineVisualHandler@@UAEXXZ @ 192 NONAME ; void CAlfLineVisualHandler::Release(void)
+	?Release@CAlfMeshVisualHandler@@UAEXXZ @ 193 NONAME ; void CAlfMeshVisualHandler::Release(void)
+	?Release@CAlfShadowBorderBrushHandler@@MAEXXZ @ 194 NONAME ; void CAlfShadowBorderBrushHandler::Release(void)
+	?Release@CAlfTextVisualHandler@@UAEXXZ @ 195 NONAME ; void CAlfTextVisualHandler::Release(void)
+	?Release@CAlfViewportLayoutHandler@@UAEXXZ @ 196 NONAME ; void CAlfViewportLayoutHandler::Release(void)
+	?Release@CAlfVisualHandler@@UAEXXZ @ 197 NONAME ; void CAlfVisualHandler::Release(void)
+	?ServiceL@CAlfAppSrvSessionBase@@EAEXABVRMessage2@@@Z @ 198 NONAME ; void CAlfAppSrvSessionBase::ServiceL(class RMessage2 const &)
+	?SetMetricsInterface@CAlfAppServer@@QAEXPAVMAlfMetricsInterface@@@Z @ 199 NONAME ; void CAlfAppServer::SetMetricsInterface(class MAlfMetricsInterface *)
+	?SetOwnership@CAlfBrushHandler@@QAEXH@Z @ 200 NONAME ; void CAlfBrushHandler::SetOwnership(int)
+	?SetWindowChangeObserverL@CAlfAppServer@@QAEXPAVMWindowVisibilityObserver@@H@Z @ 201 NONAME ; void CAlfAppServer::SetWindowChangeObserverL(class MWindowVisibilityObserver *, int)
+	?SharedEnv@CAlfSrvEffectEnv@@QAEPAVCHuiEnv@@XZ @ 202 NONAME ; class CHuiEnv * CAlfSrvEffectEnv::SharedEnv(void)
+	?SharedHuiEnv@CAlfAppSrvSessionBase@@UBEPAVCHuiEnv@@XZ @ 203 NONAME ; class CHuiEnv * CAlfAppSrvSessionBase::SharedHuiEnv(void) const
+	?VisibleControlGroupCountL@CAlfSrvEffectEnv@@QAEHXZ @ 204 NONAME ; int CAlfSrvEffectEnv::VisibleControlGroupCountL(void)
+	?WsSession@CAlfAppServer@@QBEAAVRWsSession@@XZ @ 205 NONAME ; class RWsSession & CAlfAppServer::WsSession(void) const
+	?SetClientWindowGroupId@CAlfAppSrvSessionBase@@QAEXH@Z @ 206 NONAME ; void CAlfAppSrvSessionBase::SetClientWindowGroupId(int)
+	?BrushHandlerExtension@CAlfBorderBrushHandler@@MAEXABVTUid@@PAPAX@Z @ 207 NONAME ; void CAlfBorderBrushHandler::BrushHandlerExtension(class TUid const &, void * *)
+	?BrushHandlerExtension@CAlfBrushHandler@@MAEXABVTUid@@PAPAX@Z @ 208 NONAME ; void CAlfBrushHandler::BrushHandlerExtension(class TUid const &, void * *)
+	?BrushHandlerExtension@CAlfDropShadowBrushHandler@@MAEXABVTUid@@PAPAX@Z @ 209 NONAME ; void CAlfDropShadowBrushHandler::BrushHandlerExtension(class TUid const &, void * *)
+	?BrushHandlerExtension@CAlfFrameBrushHandler@@MAEXABVTUid@@PAPAX@Z @ 210 NONAME ; void CAlfFrameBrushHandler::BrushHandlerExtension(class TUid const &, void * *)
+	?BrushHandlerExtension@CAlfGradientBrushHandler@@MAEXABVTUid@@PAPAX@Z @ 211 NONAME ; void CAlfGradientBrushHandler::BrushHandlerExtension(class TUid const &, void * *)
+	?BrushHandlerExtension@CAlfImageBrushHandler@@MAEXABVTUid@@PAPAX@Z @ 212 NONAME ; void CAlfImageBrushHandler::BrushHandlerExtension(class TUid const &, void * *)
+	?BrushHandlerExtension@CAlfShadowBorderBrushHandler@@MAEXABVTUid@@PAPAX@Z @ 213 NONAME ; void CAlfShadowBorderBrushHandler::BrushHandlerExtension(class TUid const &, void * *)
+	?GetInterface@CAlfDeckLayoutHandler@@UAEPAXABW4THuiInterfaceSupport@@@Z @ 214 NONAME ; void * CAlfDeckLayoutHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?HandleCmdL@CAlfDeckLayoutHandler@@UAEXHABVTDesC8@@AAVTDes8@@@Z @ 215 NONAME ; void CAlfDeckLayoutHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?Release@CAlfDeckLayoutHandler@@UAEXXZ @ 216 NONAME ; void CAlfDeckLayoutHandler::Release(void)
+	?VisualHandlerExtension@CAlfAnchorLayoutHandler@@MAEXABVTUid@@PAPAX@Z @ 217 NONAME ; void CAlfAnchorLayoutHandler::VisualHandlerExtension(class TUid const &, void * *)
+	?VisualHandlerExtension@CAlfCurvePathLayoutHandler@@MAEXABVTUid@@PAPAX@Z @ 218 NONAME ; void CAlfCurvePathLayoutHandler::VisualHandlerExtension(class TUid const &, void * *)
+	?VisualHandlerExtension@CAlfDeckLayoutHandler@@MAEXABVTUid@@PAPAX@Z @ 219 NONAME ; void CAlfDeckLayoutHandler::VisualHandlerExtension(class TUid const &, void * *)
+	?VisualHandlerExtension@CAlfFlowLayoutHandler@@MAEXABVTUid@@PAPAX@Z @ 220 NONAME ; void CAlfFlowLayoutHandler::VisualHandlerExtension(class TUid const &, void * *)
+	?VisualHandlerExtension@CAlfGridLayoutHandler@@MAEXABVTUid@@PAPAX@Z @ 221 NONAME ; void CAlfGridLayoutHandler::VisualHandlerExtension(class TUid const &, void * *)
+	?VisualHandlerExtension@CAlfImageVisualHandler@@MAEXABVTUid@@PAPAX@Z @ 222 NONAME ; void CAlfImageVisualHandler::VisualHandlerExtension(class TUid const &, void * *)
+	?VisualHandlerExtension@CAlfLCTAnchorLayoutHandler@@MAEXABVTUid@@PAPAX@Z @ 223 NONAME ; void CAlfLCTAnchorLayoutHandler::VisualHandlerExtension(class TUid const &, void * *)
+	?VisualHandlerExtension@CAlfLCTGridLayoutHandler@@MAEXABVTUid@@PAPAX@Z @ 224 NONAME ; void CAlfLCTGridLayoutHandler::VisualHandlerExtension(class TUid const &, void * *)
+	?VisualHandlerExtension@CAlfLCTTextVisualHandler@@MAEXABVTUid@@PAPAX@Z @ 225 NONAME ; void CAlfLCTTextVisualHandler::VisualHandlerExtension(class TUid const &, void * *)
+	?VisualHandlerExtension@CAlfLayoutHandler@@MAEXABVTUid@@PAPAX@Z @ 226 NONAME ; void CAlfLayoutHandler::VisualHandlerExtension(class TUid const &, void * *)
+	?VisualHandlerExtension@CAlfLineVisualHandler@@MAEXABVTUid@@PAPAX@Z @ 227 NONAME ; void CAlfLineVisualHandler::VisualHandlerExtension(class TUid const &, void * *)
+	?VisualHandlerExtension@CAlfMeshVisualHandler@@MAEXABVTUid@@PAPAX@Z @ 228 NONAME ; void CAlfMeshVisualHandler::VisualHandlerExtension(class TUid const &, void * *)
+	?VisualHandlerExtension@CAlfTextVisualHandler@@MAEXABVTUid@@PAPAX@Z @ 229 NONAME ; void CAlfTextVisualHandler::VisualHandlerExtension(class TUid const &, void * *)
+	?VisualHandlerExtension@CAlfViewportLayoutHandler@@MAEXABVTUid@@PAPAX@Z @ 230 NONAME ; void CAlfViewportLayoutHandler::VisualHandlerExtension(class TUid const &, void * *)
+	?VisualHandlerExtension@CAlfVisualHandler@@MAEXABVTUid@@PAPAX@Z @ 231 NONAME ; void CAlfVisualHandler::VisualHandlerExtension(class TUid const &, void * *)
+	?AlfInterfaceProviderExtension@CAlfAppSrvSessionBase@@UAEXABVTUid@@PAPAX@Z @ 232 NONAME ; void CAlfAppSrvSessionBase::AlfInterfaceProviderExtension(class TUid const &, void * *)
+	?CountResources@CAlfAppSrvSessionBase@@MAEHXZ @ 233 NONAME ; int CAlfAppSrvSessionBase::CountResources(void)
+	?Disconnect@CAlfAppSrvSessionBase@@MAEXABVRMessage2@@@Z @ 234 NONAME ; void CAlfAppSrvSessionBase::Disconnect(class RMessage2 const &)
+	?Extension_@CAlfAppSrvSessionBase@@MAEHIAAPAXPAX@Z @ 235 NONAME ; int CAlfAppSrvSessionBase::Extension_(unsigned int, void * &, void *)
+	?ServiceError@CAlfAppSrvSessionBase@@MAEXABVRMessage2@@H@Z @ 236 NONAME ; void CAlfAppSrvSessionBase::ServiceError(class RMessage2 const &, int)
+	?ConstructL@CAlfShadowBorderBrushHandler@@QAEXPAVCHuiBrush@@UTAlfMetric@@@Z @ 237 NONAME ; void CAlfShadowBorderBrushHandler::ConstructL(class CHuiBrush *, struct TAlfMetric)
+	?NewL@CAlfShadowBorderBrushHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@UTAlfMetric@@@Z @ 238 NONAME ; class MAlfExtension * CAlfShadowBorderBrushHandler::NewL(class MAlfInterfaceProvider &, struct TAlfMetric)
+	?ConstructL@CAlfBorderBrushHandler@@QAEXPAVCHuiBrush@@UTAlfXYMetric@@1@Z @ 239 NONAME ; void CAlfBorderBrushHandler::ConstructL(class CHuiBrush *, struct TAlfXYMetric, struct TAlfXYMetric)
+	?NewL@CAlfBorderBrushHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@UTAlfXYMetric@@1@Z @ 240 NONAME ; class MAlfExtension * CAlfBorderBrushHandler::NewL(class MAlfInterfaceProvider &, struct TAlfXYMetric, struct TAlfXYMetric)
+	?ConstructL@CAlfFrameBrushHandler@@QAEXPAVCHuiBrush@@ABVTAknsItemID@@UTAlfXYMetric@@@Z @ 241 NONAME ; void CAlfFrameBrushHandler::ConstructL(class CHuiBrush *, class TAknsItemID const &, struct TAlfXYMetric)
+	?NewL@CAlfFrameBrushHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@ABVTAknsItemID@@UTAlfXYMetric@@@Z @ 242 NONAME ; class MAlfExtension * CAlfFrameBrushHandler::NewL(class MAlfInterfaceProvider &, class TAknsItemID const &, struct TAlfXYMetric)
+	?ConstructL@CAlfDropShadowBrushHandler@@QAEXPAVCHuiBrush@@UTAlfMetric@@@Z @ 243 NONAME ; void CAlfDropShadowBrushHandler::ConstructL(class CHuiBrush *, struct TAlfMetric)
+	?NewL@CAlfDropShadowBrushHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@UTAlfMetric@@@Z @ 244 NONAME ; class MAlfExtension * CAlfDropShadowBrushHandler::NewL(class MAlfInterfaceProvider &, struct TAlfMetric)
+	?VisibleControlGroupL@CAlfSrvEffectEnv@@QAEPAVCHuiControlGroup@@H@Z @ 245 NONAME ; class CHuiControlGroup * CAlfSrvEffectEnv::VisibleControlGroupL(int)
+	?ConstructL@CAlfFrameBrushHandler@@QAEXPAVCHuiBrush@@ABVTHuiImage@@UTAlfXYMetric@@@Z @ 246 NONAME ; void CAlfFrameBrushHandler::ConstructL(class CHuiBrush *, class THuiImage const &, struct TAlfXYMetric)
+	?NewL@CAlfFrameBrushHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@ABVTHuiImage@@UTAlfXYMetric@@@Z @ 247 NONAME ; class MAlfExtension * CAlfFrameBrushHandler::NewL(class MAlfInterfaceProvider &, class THuiImage const &, struct TAlfXYMetric)
+	??0CAlfCanvasVisualHandler@@QAE@AAVMAlfInterfaceProvider@@@Z @ 248 NONAME ; CAlfCanvasVisualHandler::CAlfCanvasVisualHandler(class MAlfInterfaceProvider &)
+	??1CAlfCanvasVisualHandler@@MAE@XZ @ 249 NONAME ; CAlfCanvasVisualHandler::~CAlfCanvasVisualHandler(void)
+	?ConstructL@CAlfCanvasVisualHandler@@UAEXPAVCHuiVisual@@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 250 NONAME ; void CAlfCanvasVisualHandler::ConstructL(class CHuiVisual *, class CHuiControl &, class CHuiLayout *)
+	?GetInterface@CAlfCanvasVisualHandler@@UAEPAXABW4THuiInterfaceSupport@@@Z @ 251 NONAME ; void * CAlfCanvasVisualHandler::GetInterface(enum THuiInterfaceSupport const &)
+	?HandleCmdL@CAlfCanvasVisualHandler@@UAEXHABVTDesC8@@AAVTDes8@@@Z @ 252 NONAME ; void CAlfCanvasVisualHandler::HandleCmdL(int, class TDesC8 const &, class TDes8 &)
+	?NewL@CAlfCanvasVisualHandler@@SAPAVMAlfExtension@@AAVMAlfInterfaceProvider@@PAVCHuiControl@@PAVCHuiLayout@@@Z @ 253 NONAME ; class MAlfExtension * CAlfCanvasVisualHandler::NewL(class MAlfInterfaceProvider &, class CHuiControl *, class CHuiLayout *)
+	?Release@CAlfCanvasVisualHandler@@UAEXXZ @ 254 NONAME ; void CAlfCanvasVisualHandler::Release(void)
+	?VisualHandlerExtension@CAlfCanvasVisualHandler@@MAEXABVTUid@@PAPAX@Z @ 255 NONAME ; void CAlfCanvasVisualHandler::VisualHandlerExtension(class TUid const &, void * *)
+	?Identifier@CAlfWindow@@QBEIXZ @ 256 NONAME ; unsigned int CAlfWindow::Identifier(void) const
+	?Stride@CAlfWindowBuffer@@QBEIXZ @ 257 NONAME ; unsigned int CAlfWindowBuffer::Stride(void) const
+	?NewWindow@CAlfWindowFxPlugin@@UAEXABUTWindowIdentifier@@@Z @ 258 NONAME ; void CAlfWindowFxPlugin::NewWindow(struct TWindowIdentifier const &)
+	?ScreenId@CAlfWindowManager@@QBEHXZ @ 259 NONAME ; int CAlfWindowManager::ScreenId(void) const
+	?Bridge@CAlfWindowManager@@QAEPAVCAlfStreamerBridge@@XZ @ 260 NONAME ; class CAlfStreamerBridge * CAlfWindowManager::Bridge(void)
+	?Index@CAlfWindow@@QBEIXZ @ 261 NONAME ; unsigned int CAlfWindow::Index(void) const
+	?EnableNewWindowNotificationsL@CAlfWindowManager@@QAEXAAVCAlfWindowFxPlugin@@H@Z @ 262 NONAME ; void CAlfWindowManager::EnableNewWindowNotificationsL(class CAlfWindowFxPlugin &, int)
+	?Release@CAlfWindowManager@@QAEXAAVCAlfWindow@@H@Z @ 263 NONAME ; void CAlfWindowManager::Release(class CAlfWindow &, int)
+	?IsActive@CAlfWindow@@QBEHXZ @ 264 NONAME ; int CAlfWindow::IsActive(void) const
+	?CreateNewWindowL@CAlfWindowManager@@QAEPAVCAlfWindow@@IABVTSize@@@Z @ 265 NONAME ; class CAlfWindow * CAlfWindowManager::CreateNewWindowL(unsigned int, class TSize const &)
+	?Format@CAlfWindowBuffer@@QBEHXZ @ 266 NONAME ; int CAlfWindowBuffer::Format(void) const
+	?SetRotation@CAlfWindow@@QAEXMI@Z @ 267 NONAME ; void CAlfWindow::SetRotation(float, unsigned int)
+	??1CAlfWindowFxPlugin@@UAE@XZ @ 268 NONAME ; CAlfWindowFxPlugin::~CAlfWindowFxPlugin(void)
+	?GetWinInfoListL@CAlfWindowManager@@QAEXHHAAV?$RArray@UTAlfWServInfo@@@@@Z @ 269 NONAME ; void CAlfWindowManager::GetWinInfoListL(int, int, class RArray<struct TAlfWServInfo> &)
+	?Position@CAlfWindow@@QBE?AVTPoint@@XZ @ 270 NONAME ; class TPoint CAlfWindow::Position(void) const
+	?SetPos@CAlfWindow@@QAEXVTPoint@@I@Z @ 271 NONAME ; void CAlfWindow::SetPos(class TPoint, unsigned int)
+	?ReserveL@CAlfWindowManager@@QAEPAVCAlfWindow@@ABUTWindowIdentifier@@H@Z @ 272 NONAME ; class CAlfWindow * CAlfWindowManager::ReserveL(struct TWindowIdentifier const &, int)
+	?SetSurfaceExtent@CAlfWindow@@QAEXABVTRect@@@Z @ 273 NONAME ; void CAlfWindow::SetSurfaceExtent(class TRect const &)
+	?Move@CAlfWindow@@QAEXI@Z @ 274 NONAME ; void CAlfWindow::Move(unsigned int)
+	?InBuffer@CAlfWindow@@QAEPAVCAlfWindowBuffer@@XZ @ 275 NONAME ; class CAlfWindowBuffer * CAlfWindow::InBuffer(void)
+	?CancelMessage@CAlfWindowFxPlugin@@UAEXH@Z @ 276 NONAME ; void CAlfWindowFxPlugin::CancelMessage(int)
+	?PostIt@CAlfWindowManager@@QAEHABVTAlfBridgerData@@@Z @ 277 NONAME ; int CAlfWindowManager::PostIt(struct TAlfBridgerData const &)
+	?WindowManager@CAlfWindowFxPlugin@@QAEPAVCAlfWindowManager@@XZ @ 278 NONAME ; class CAlfWindowManager * CAlfWindowFxPlugin::WindowManager(void)
+	?ConstructL@CAlfWindowFxPlugin@@UAEXABVCAlfWindowManager@@H@Z @ 279 NONAME ; void CAlfWindowFxPlugin::ConstructL(class CAlfWindowManager const &, int)
+	?EnableDestroyWindowNotificationsL@CAlfWindowManager@@QAEXAAVCAlfWindowFxPlugin@@H@Z @ 280 NONAME ; void CAlfWindowManager::EnableDestroyWindowNotificationsL(class CAlfWindowFxPlugin &, int)
+	?Size@CAlfWindow@@QBE?AVTSize@@XZ @ 281 NONAME ; class TSize CAlfWindow::Size(void) const
+	?OutBufferL@CAlfWindow@@QAEPAVCAlfWindowBuffer@@H@Z @ 282 NONAME ; class CAlfWindowBuffer * CAlfWindow::OutBufferL(int)
+	?BufferPtr@CAlfWindowBuffer@@QBEPAXXZ @ 283 NONAME ; void * CAlfWindowBuffer::BufferPtr(void) const
+	?DestroyWindow@CAlfWindowFxPlugin@@UAEXABUTWindowIdentifier@@@Z @ 284 NONAME ; void CAlfWindowFxPlugin::DestroyWindow(struct TWindowIdentifier const &)
+	?SurfaceExtent@CAlfWindow@@QBE?AVTRect@@XZ @ 285 NONAME ; class TRect CAlfWindow::SurfaceExtent(void) const
+	?WsInfo@CAlfWindow@@QBEABUTAlfWServInfo@@XZ @ 286 NONAME ; struct TAlfWServInfo const & CAlfWindow::WsInfo(void) const
+	?AppendVarDataL@CAlfStreamerBridge@@QAEPBXHAAH@Z @ 287 NONAME ; void const * CAlfStreamerBridge::AppendVarDataL(int, int &)
+	?DestroyWindow@CAlfWindowManager@@QAEXAAVCAlfWindow@@@Z @ 288 NONAME ; void CAlfWindowManager::DestroyWindow(class CAlfWindow &)
+	?Opacity@CAlfWindow@@QBEMXZ @ 289 NONAME ; float CAlfWindow::Opacity(void) const
+	?EnableIndexChangedNotifications@CAlfWindow@@QAEXH@Z @ 290 NONAME ; void CAlfWindow::EnableIndexChangedNotifications(int)
+	?SetBufferPtr@CAlfWindowBuffer@@QBEXPAX@Z @ 291 NONAME ; void CAlfWindowBuffer::SetBufferPtr(void *) const
+	??1CAlfWindowBuffer@@UAE@XZ @ 292 NONAME ; CAlfWindowBuffer::~CAlfWindowBuffer(void)
+	?Size@CAlfWindowBuffer@@QBE?AVTSize@@XZ @ 293 NONAME ; class TSize CAlfWindowBuffer::Size(void) const
+	?SetActive@CAlfWindow@@QAEXH@Z @ 294 NONAME ; void CAlfWindow::SetActive(int)
+	?Rotation@CAlfWindow@@QBEMXZ @ 295 NONAME ; float CAlfWindow::Rotation(void) const
+	?HandleMessageL@CAlfWindowFxPlugin@@UAEXABVTDesC8@@ABVRMessage2@@@Z @ 296 NONAME ; void CAlfWindowFxPlugin::HandleMessageL(class TDesC8 const &, class RMessage2 const &)
+	?SetFormat@CAlfWindowBuffer@@QAEXH@Z @ 297 NONAME ; void CAlfWindowBuffer::SetFormat(int)
+	?SetSize@CAlfWindowBuffer@@QAEXABVTSize@@@Z @ 298 NONAME ; void CAlfWindowBuffer::SetSize(class TSize const &)
+	?GetWinIdListL@CAlfWindowManager@@QAEXHAAV?$RArray@UTWindowIdentifier@@@@@Z @ 299 NONAME ; void CAlfWindowManager::GetWinIdListL(int, class RArray<struct TWindowIdentifier> &)
+	?HandleMessageL@CAlfWindowFxPlugin@@UAEXABVTDesC8@@AAVTPtr8@@@Z @ 300 NONAME ; void CAlfWindowFxPlugin::HandleMessageL(class TDesC8 const &, class TPtr8 &)
+	?SetOpacity@CAlfWindow@@QAEXMI@Z @ 301 NONAME ; void CAlfWindow::SetOpacity(float, unsigned int)
+	?SetStride@CAlfWindowBuffer@@QAEXI@Z @ 302 NONAME ; void CAlfWindowBuffer::SetStride(unsigned int)
+	?ContentReady@CAlfWindow@@QAEXABVTRegion@@@Z @ 303 NONAME ; void CAlfWindow::ContentReady(class TRegion const &)
+	?NewL@CAlfWindowBuffer@@SAPAV1@ABVTSize@@HIPAX@Z @ 304 NONAME ; class CAlfWindowBuffer * CAlfWindowBuffer::NewL(class TSize const &, int, unsigned int, void *)
+	?SetSize@CAlfWindow@@QAEXVTSize@@I@Z @ 305 NONAME ; void CAlfWindow::SetSize(class TSize, unsigned int)
+	?AppendEffectsDataL@CAlfStreamerBridge@@QAEPBXHAAH@Z @ 306 NONAME ; void const * CAlfStreamerBridge::AppendEffectsDataL(int, int &)
+	?FindWgForAppUid@CAlfStreamerBridge@@QAEHVTUid@@@Z @ 307 NONAME ; int CAlfStreamerBridge::FindWgForAppUid(class TUid)
+	?FindAppUidForWgId@CAlfStreamerBridge@@QAE?AVTUid@@H@Z @ 308 NONAME ; class TUid CAlfStreamerBridge::FindAppUidForWgId(int)
+	?SetLayerUsesAplhaFlag@CAlfWindow@@QAEXH@Z @ 309 NONAME ; void CAlfWindow::SetLayerUsesAplhaFlag(int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfappsrvsession.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,472 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Server session
+*
+*/
+
+
+
+#ifndef C_ALFAPPSRVSESSION_H
+#define C_ALFAPPSRVSESSION_H
+
+#include <e32hashtab.h>
+#include <alf/alfappsrvsessionbase.h>
+#include <uiacceltk/HuiEnv.h>
+#include <uiacceltk/huigifanimationtexture.h>
+#include "malfsrvtexturemanagerclient.h"
+#include "alfframestamp.h"
+
+class CHuiControl;
+class CHuiLayout;
+class CAlfSrvEffectEnv;
+class THuiTexturePreferredProperties;
+class CAlfSrvTextureManager;
+
+/**
+ *  Session/service class in the server side.
+ *
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS(CAlfAppSrvSession)
+    : public CAlfAppSrvSessionBase, 
+      public MWindowVisibilityObserver,
+      private MAlfSrvTextureManagerClient
+    {
+public:
+    
+    /**
+     * Destructor, singals server to free resources specific for this client
+     */
+    ~CAlfAppSrvSession();
+
+    /**
+     * Public, two phased constructor, stores pointer to server instance
+     * 
+     * @param aServer Server which the client has connected.
+     */
+    static CAlfAppSrvSession* NewL(const CAlfAppServer* aServer);
+    
+    
+    /**
+     * Gets the drawing area of the session
+     * 
+     * @return TRect of the drawing area
+     */
+    TRect ClientDrawingArea() const;
+    
+    /**
+     * Sets the drawint area. This is set by the display sub session
+     * 
+     * @param aRect Drawing area rect.
+     */
+    void SetClientDrawingArea( const TRect& aRect );
+
+    /**
+     * Sets the drawint area. This is set by the display sub session
+     * 
+     * @param aRect Drawing area rect.
+     */
+    void SetClientDrawingAreaL( const TRect& aRect );
+    
+    /**
+     * Is client application focused?
+     * 
+     * @return ETrue if client application is focused.
+     */
+    TBool IsFocused() const;
+    
+    /**
+     * Sets session's max fps limiter to half, used if client's window does not have keyboard focus
+     * @param aOnBackground use lowered max fps (ETrue/EFalse)
+     */
+    void SetBackgroundMaxFps( TBool aOnBackground );
+              
+// from CAlfAppSrvSessionBase
+    /**
+     * From CAlfAppSrvSessionBase
+     * Called when a message is received from the client.
+     * 
+     * @param aMessage Message parameters.
+     */
+    void DoHandleCommandL(const RMessage2& aMessage);
+    
+    /**
+     * From CAlfAppSrvSessionBase
+     * Client's window group received focus.
+     * 
+     * @param aDoTransitionEffect Do fade in transision (RnD)
+     */
+    void FocusGainedL( TBool aDoTransitionEffect );
+    
+    /**
+     * From CAlfAppSrvSessionBase
+     * Client's window group lost focus.
+     * 
+     * @param aDoTransitionEffect Do fade out transision (RnD)
+     * @return Did transition? (RnD)
+     */
+    TBool FocusLostL( TBool aDoTransitionEffect );
+    
+    /**
+     * From CAlfAppSrvSessionBase
+     * Returns the preferred window group posistion.
+     * 
+     * @return WG position
+     */
+    CAlfAppServer::TAlfWGPostion PreferredWindowGroupPosition() const;
+    
+    /**
+     * Returns the preferred refresh mode of the session.
+     *
+     * @return Preferred refresh mode.
+     */
+    THuiRefreshMode PreferredRefreshMode() const;
+    
+    void ReOrderControlGroupSessionsL( RPointerArray<CAlfSrvSubSessionBase>& aGroupSessions );
+    
+ 
+// from MWindowVisibilityObserver 
+    /**
+     * From MWindowVisibilityObserver
+     * Called when window becomes fully visible
+     */
+    void WindowFullyVisible();
+    
+    /**
+     * From MWindowVisibilityObserver
+     * Called when window becomes partially visible
+     */
+    void WindowPartiallyVisible();
+    
+    /**
+     * From MWindowVisibilityObserver
+     * Called when window losts visibility.
+     */
+    void WindowNotVisible();
+    
+    /**
+     * From MWindowVisibilityObserver
+     * Returns the control witch creates the window (CHuiDisplayCoeControl)
+     * @return Contorol. NULL if not have one. Ownership not transferred.
+     */
+    CCoeControl* CoeControl();
+    
+private:
+
+    /**
+     * Default constructor, stores pointer to server instance
+     * 
+     * @param aServer Server which the client has connected.
+     */
+    CAlfAppSrvSession(const CAlfAppServer* aServer);
+
+    /**
+     * Second phase constructor
+     */
+    void ConstructL();
+
+    void EnvSetRefreshModeL(const RMessage2& aMessage);
+    void EnvSetMaxFrameRateL(const RMessage2& aMessage);
+    void EnvContinueRefreshL(const RMessage2& aMessage);
+    void EnvPauseRefreshL(const RMessage2& aMessage);
+    void EnvRefreshCallBackL(const RMessage2& aMessage);
+    void EnvSetIdleThresholdL(const RMessage2& aMessage);
+    void EnvRendererL(const RMessage2& aMessage);
+    //void BorderArrayAppendBrushL(const RMessage2& aMessage);
+    void RosterHideL(const RMessage2& aMessage);
+    void RosterShowVisualL(const RMessage2& aMessage);
+    void RosterHideVisualL(const RMessage2& aMessage);
+    void RosterMoveVisualToFrontL(const RMessage2& aMessage);
+    void RosterSetPointerEventFlagsL(const RMessage2& aMessage);
+    void RosterAddPointerEventObserverL(const RMessage2& aMessage);
+    void RosterRemovePointerEventObserverL(const RMessage2& aMessage);
+    void RosterSetPointerDragTresholdL(const RMessage2& aMessage);    
+    void RosterDisableLongTapEventWhenDraggingL(const RMessage2& aMessage);
+    void TextureCreateAnimatedL(const RMessage2& aMessage); 
+    void TextureStartAnimation(const RMessage2& aMessage);
+    void TextureStopAnimation(const RMessage2& aMessage);
+    void TextureCreateL(const RMessage2& aMessage);
+    void TextureLoadL(const RMessage2& aMessage);
+    void TextureUnload(const RMessage2& aMessage);
+    void TextureDelete(const RMessage2& aMessage);
+    void TextureRelease(const RMessage2& aMessage);
+    void TextureRestore(const RMessage2& aMessage);
+    void TextureNotifySkinChanged(const RMessage2& aMessage);
+    void TextureBlurL(const RMessage2& aMessage);
+    void TextureHasContentL(const RMessage2& aMessage);
+    void TextureSetAutoSizeParamsL(const RMessage2& aMessage);    
+    void LayoutMetricsTextStyleDataL(const RMessage2& aMessage);
+
+    void DoFocusLostEffect(TInt aEffect, CHuiVisual& aRootVisual );
+    void DoFocusGainedEffect(TInt aEffect, CHuiVisual& aRootVisual );
+
+    /**
+     * Checks that texture owner id has been updated.
+     * @param aMessage message.
+     * @return ETrue if it's ok to continue, EFalse otherwise.
+     */
+    TBool RequireTextureOwnerId(const RMessage2& aMessage);
+    
+    /**
+     * Updates @c iTextureOwnedId.
+     * This method must be called successfully before @c TextureOwnerId 
+     * method can be called.
+     * @param aMessage message.
+     */
+    void UpdateTextureOwnerIdL(const RMessage2& aMessage);
+    
+    /**
+     * Returns texture owner id.
+     * This method must not be called before @c UpdateTextureOwnerIdL
+     * has been called successfully.
+     * @return texture owner id.
+     */
+    inline TProcessId TextureOwnerId() const;
+    
+    /**
+     * Configure batch commands execution.
+     * This is used by unit tests in order to test all branches.
+     * @param aMessage message containing configuration.
+     */
+    void ConfigureBatchCommandExecutionL( const RMessage2& aMessage );
+    
+    /**
+     * Executes batch commands.
+     * @param aMessage message to be executed.
+     */
+    void ExecuteBatchCommandsL( const RMessage2& aMessage );
+
+    /**
+     * Executes batch commands using dynamic buffer, i.e. common buffer or memory allocated.
+     * @param aMessage message to be executed.
+     * @return ETrue if command was executed, EFalse if not.
+     */
+    TBool ExecuteBatchCommandsUsingDynamicBufferL( const RMessage2& aMessage );
+
+    /**
+     * Executes batch commands using fixed buffer, i.e. common buffer or stack allocated.
+     * @param aMessage message to be executed.
+     */
+    void ExecuteBatchCommandsUsingFixedBufferL( const RMessage2& aMessage );
+
+    /**
+     * Executes commands using specified buffer.
+     * @param aBuffer buffer to be used.
+     * @param aMessageLength message length.
+     * @param aMessage message to be executed.
+     * @return amount of bytes executed commands took.
+     */
+    TInt ExecuteBatchCommandsUsingBufferL( 
+        TDes8& aBuffer, TInt aMessageLength, const RMessage2& aMessage );
+    
+    /**
+     * Execute commands from descriptor.
+     * @param aDescriptor descriptor which contains commands.
+     * @param aSpaceNeeded this will be updated to contain value
+     *        indicating how much space is needed.
+     * @return amount of bytes executed commands took.
+     */
+    TInt ExecuteCommandsFromDescriptorL( 
+        const TDesC8& aSource, 
+        TInt& aSpaceNeeded );
+
+    /**
+     * Checks whether it is allowed to execute using dynamic buffer.
+     * @return ETrue if it's allowed, EFalse otherwise.
+     */
+    inline TBool AllowExecuteUsingDynamicBuffer() const;
+
+    /**
+     * Checks whether it is allowed to execute using common buffer.
+     * @return ETrue if it's allowed, EFalse otherwise.
+     */
+    inline TBool AllowExecuteUsingCommonBuffer() const;
+
+    /**
+     * Returns reference to texture manager.
+     * @return reference to texture manager.
+     */
+    inline CAlfSrvTextureManager& AlfTextureManager();
+
+    /**
+     * Starts waiting for texture information for client.
+     */
+    void NotifyTextureInfo( const RMessage2& aMessage );
+    
+    /**
+     * Checks if this session has pending texture information to be
+     * delivered to client side.
+     */
+    inline TBool HasPendingTextureInfo() const;
+    
+    /**
+     * Tries to deliver texture info to client.
+     */
+    void DeliverTextureInfo();
+   
+    /**
+     * Finds position of next texture info for delivery.
+     * @param aPriority priority to look for (0 or 1).
+     * @return position, or KErrNotFound if not found.
+     */
+    TInt FindNextTextureInfoForDelivery( 
+        TInt aPriority, TInt aStartPos ) const;
+    
+    /**
+     * Finds texture info structure position by texture id.
+     * @param aTextureId texture id to be searched.
+     * @return position, or KErrNotFound if not found.
+     */
+    TInt FindTextureInfoById( TInt aTextureId ) const;    
+
+    /**
+     * Removes texture info based on id.
+     * @param aTextureId texture id
+     */
+    void RemoveTextureInfo( TInt aTextureId );
+    
+    void ShowControlGroupsInOrderL(CHuiDisplay& aDisplay);
+    void StoreControlGroupOrderL(CHuiDisplay& aDisplay, TBool aAlsoHide );
+    
+   /**
+    * Post QT drawing command buffer to CanvasVisual    
+    */
+    void PostQtCommandBufferL( const RMessage2& aMessage );
+    
+    
+    /*
+     *  Frame rate reporting enablers
+     */
+    void ReportFrameRateBegin( const RMessage2& aMessage );
+    
+    void ReportFrameRateEnd( const RMessage2& aMessage );
+    
+// from base class MAlfSrvTextureManagerClient
+    
+    virtual TBool GetTextureSize( 
+        TInt aTextureId, 
+        TSize& aTextureSize,
+        TBool& aHasBeenDelivered );
+    virtual void SetTextureSize(
+        TInt aTextureId,
+        const TSize& aTextureSize,
+        TInt aPriority );
+    virtual void RemoveTextureSize( TInt aTextureId );
+    virtual void TextureSizeChangesCompleted();
+    
+    void EnvEnableLowMemoryState(const RMessage2& aMessage);
+    void EnvForceSwRendering(const RMessage2& aMessage);
+        
+private:
+
+    // Owned items which need to be deleted with the session is terminated.
+    RPointerArray<CBase> iOwnershipItems; 
+    RPointerArray<CHuiTexture> iTextures;
+    RPointerArray<CHuiGifAnimationTexture> iAnimatedTextures;
+    
+    // Is client the focused window group?
+    TBool iFocused;   
+    
+    // Is client partially visible (matters only if iFocused = EFalse )
+    TBool iPartiallyVisible;
+    
+    // Refresh mode
+    THuiRefreshMode iRefreshMode;
+    
+    // Max frame rate
+    TReal32 iMaxFrameRate;
+    
+    // Idle threshold
+    TInt iIdleThreshold;
+    
+    TBool iUsesFullScreen;
+    
+    TRect iClientDisplayRect;
+    
+    CAlfSrvEffectEnv* iEffectEnv;
+
+    /**
+     * ETrue if @c iTextureOwnerId contains valid value.
+     * EFalse otherwise.
+     */
+    TBool iTextureOwnedIdSet;    
+    
+    /**
+     * Texture owner id.
+     * This contains valid value only if @c iTextureOwnedIdSet
+     * is set to true.
+     */
+    TProcessId iTextureOwnerId;
+    
+    enum TAlfExecutionFlags
+        {
+        // Allow execution using dynammic buffer.
+        EAlfExecuteUsingDynamicBuffer = 0x1,
+        // Allow execution using common buffer.
+        EAlfExecuteUsingCommonBuffer = 0x2
+        };
+            
+    // Current execution flags, see TAlfExecutionFlags.
+    TInt iExecutionFlags;
+    
+    /**
+     * Texture info observer event.
+     */
+    RMessagePtr2 iTextureInfoEvent;
+    
+    /**
+     * Structure containing information about a texture.
+     */
+    struct TAlfTextureInfo
+        {
+        enum TAlfTextureInfoFlags
+            {
+            // Indicates that size has been changed
+            // and new size should be (eventually)
+            // be delivered to client.
+            EAlfFlagTextureSizeChanged = 1,
+            // Indicates that texture size has been
+            // delivered to client.
+            EAlfFlagTextureDelivered = 2
+            };
+        
+        // Flags. Sum of subset of TAlfTextureInfoFlags.
+        TInt8 iFlags;
+        // Delivery priority. The smaller the value
+        // the higher the priority.
+        TInt8 iDeliveryPriority;
+        // Client side texture id.
+        TInt iTextureId;
+        // New texture size.
+        TSize iTextureSize;
+        };
+
+    /**
+     * Array of texture information. 
+     * Own.
+     */
+    RArray< TAlfTextureInfo > iTextureInfo;
+    
+    /**
+     * Previous index used for iTextureInfo
+     */
+    mutable TInt iPreviousTextureInfoIndex;
+    
+	// Contains references to all ongoing FPS measurements
+    RHashMap<TUint32,TFrameStamp> iFPSMeasurementArray;
+    
+    RPointerArray<CHuiControlGroup> iControlGroupOrder;
+    };
+
+#endif // C_ALFAPPSRVSESSION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfbridge.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,901 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Server declaration, internal for Nokia
+*
+*/
+
+
+
+#ifndef __ALF_BRIDGE_H__
+#define __ALF_BRIDGE_H__
+
+#include <e32hashtab.h>
+
+#include "alfscreen.h"
+#include "alfstreamerbridge.h"
+#include "alfdecoderserverclient.h"
+
+#include <alf/alfconstants.h>
+
+#include "HuiFxEffect.h"
+#include <alf/AlfTransEffectPlugin.h>
+#include <uiacceltk/HuiDisplay.h>
+
+class CAlfEffectEndTimer;
+class CAlfCommandDebug;
+class CAlfLayoutSwitchEffectCoordinator;
+class RMemReadStream;
+
+const TInt KAlfBridgeRegionGranularity = 10;
+
+NONSHARABLE_CLASS(CAlfBridge): 
+	public CBase, 
+    public MAlfStreamerListener, 
+    public MHuiDisplayRefreshObserver, 
+    public MHuiBitmapProvider,
+    public MAlfGfxEffectObserver,
+    public MHuiRosterObserver
+    {
+	// Helper class for keeping ongoing effects in order. Kept in iEffectCleanupStack
+    private:
+
+        struct TEffectCleanupStruct
+            {
+            public:
+                TEffectCleanupStruct(
+                        TInt aHandle,
+                        CHuiVisual* aEffectedVisual,
+                        CHuiVisual* aTemporaryPresenterVisual,
+                        TBool aIsLayout, 
+                        TBool aHideWhenFinished) 
+                : iHandle(aHandle), 
+                iEffectedVisual(aEffectedVisual),
+                iTemporaryPresenterVisual(aTemporaryPresenterVisual),
+                iIsLayout(aIsLayout),
+                iHideWhenFinished(aHideWhenFinished)
+                        {
+//                        RDebug::Printf("TEffectCleanupStruct - 0x%x 0x%x, %d", iEffectedVisual, iTemporaryPresenterVisual, iIsLayout );
+                        };
+
+                TInt iHandle;
+
+                TBool iIsLayout;
+
+                TBool iHideWhenFinished;
+				
+				// not own, unless iEffectedVisual has EShouldDestroy flag enabled
+                CHuiVisual* iEffectedVisual;
+				// owned
+                CHuiVisual* iTemporaryPresenterVisual;
+            };
+            
+public:
+
+    static CAlfBridge* NewL( CAlfStreamerBridge** aHost, CHuiEnv* aEnv );
+    ~CAlfBridge();
+    
+	void AddNewScreenL(CAlfSharedDisplayCoeControl* aSharedCoeControl);
+	void AddNewScreenFromWindowL(RWindow* aWindow);
+    /**
+     * This method returns the index of first alf controlgroup in the roster.
+     * 
+     */
+    TInt FirstAlfControlGroupIndex( TInt aScreenNumber );
+        
+    /**
+     * This method returns the index of last alf controlgroup in the roster.
+     * 
+     */
+    TInt LastAlfControlGroupIndex( TInt aScreenNumber );        
+    
+    /**
+     * Sets flag to indicated that visual tree has changed (in every screen).
+     * 
+     */
+    void SetVisualTreeVisibilityChanged(TBool aChanged);
+    
+    /**
+     * Solution to reduce active visuals until we handle window tree hierarchy correctly
+     */
+    void HandleVisualVisibility( TInt aScreenNumber );
+
+    /**
+     * Solution to reduce active visuals until we handle window tree hierarchy correctly. 
+	 *  Note: Recursive method
+     */
+    TBool HandleLayoutVisualVisibility(
+            CHuiLayout* aLayout,
+            CHuiControlGroup& aControlGroup,
+            CHuiControl& aControl,
+            TBool& aFullscreenCovered, 
+            TRect& aFullscreen,
+            CAlfScreen* aScreen,
+            TBool& aSubtreeVisible,
+            TBool aChildCanBeOpaque );
+    /**
+     * This method shows the control group in roster, however the aWhere param
+     * is modified so that controlgroup appears at the right position depending on
+     * controlgroup type
+     *
+     */
+    void ShowControlGroupL(
+            CHuiRoster& aRoster, 
+            CHuiControlGroup& aGroup, 
+            TInt aWhere, 
+            TInt aScreenNumber );
+
+    /**
+     * This method sets the windowgroup id for the alf window.
+     * 
+     */
+    void SetAlfWindowGroupId(TInt aAlfWindowGroupId);
+    
+    CHuiDisplay* Display(TInt aScreenNum);
+    
+    /**
+     * AlfAppUi delegates the QT command buffer posting functionality to bridge 
+     * through this function. It identifies the corrcet CHuiCanvasVisual, 
+     * from the RWindow::ClientId(), that it has got from client
+     * and posts the command buffer to that visual. 
+     *
+     * @param params  QTParams containg window information and command buffer
+     * 
+     */
+    void PostQTCommandBufferL( TAlfQtCommandBufferParams params );
+       
+    /**
+     * Set the client window where the visual or layout will be drawn to.
+     * @param aWindowGroupId Window group id.
+     * @param aClientWindowHandle Client side window handle.
+     * @param aVisual Visual or layout.
+     */
+    void SetClientWindowForDrawingL(TInt aWindowGroupId, TInt aClientWindowHandle, CHuiVisual* aVisual);
+
+    // This is the final callback that does the actual work
+    // AlfGfxEffectEndCallBack starts a timer, and when the timer finishes,
+    // it calls this function
+
+    void TransitionFinishedHandlerL( TInt aHandle );
+    
+    // from  MAlfGfxEffectObserver
+    
+  	/**
+ 	 * Function to be called when CHuiFxEffect class effect has ended
+  	 * @param aHandle handle of the effect, given when the effect is started
+  	 */
+    void AlfGfxEffectEndCallBack( TInt aHandle );
+   
+    TInt FindClientWindowGroupId( TInt aScreenNumber, CHuiControlGroup& aControlGroup );
+    
+    void RemoveAllTemporaryPresenterVisuals();
+
+    /**
+     * Helper function to abort fullscreen effect
+     * @param aClientRequest ETrue if requested by client.
+     */
+    void HandleGfxStopEvent( TBool aClientRequest );
+    
+    void EnableSwRenderingL(TBool aEnable = ETrue);
+    void UploadSwRenderingTargetL( CAlfScreen* aScreen );
+    TBool PrepareSwRenderingTarget( CAlfScreen* aScreen );
+
+    /**
+     * Sets memory level.
+     * @param aMemoryLevel memory level.
+     */
+    void SetMemoryLevel(THuiMemoryLevel aMemoryLevel);
+    
+    /**
+     * Sets low memory. This is used by this class.
+     * @param aEnabled ETrue if enabled, EFalse if disabled.
+     */
+    void SetLowMemory(TBool aEnabled);
+    
+    /**
+     * Requests to force SW rendering to be used.
+     * @param aEnabled enabled status.
+     * @return error code.
+     */
+    TInt ForceSwRendering(TBool aEnabled);
+    
+    /**
+     * Chooses appropriate memory level and informs
+     * core toolkit.
+     */
+    void DoUpdateMemoryLevel();
+    
+    /**
+     * Cancels all effects due to low memory.
+     */
+    void LowMemoryCancelAllEffects();
+    
+    // From MHuiRosterObserver
+    void NotifyRosterDrawStart(CHuiDisplay& aDisplay);
+    void NotifyRosterDrawEnd(CHuiDisplay& aDisplay);
+    
+private:    
+    
+    class CFullScreenEffectState;
+    
+    class CControlEffectState;
+    
+    CAlfBridge( CAlfStreamerBridge** aHost );
+    
+    void ConstructL(CHuiEnv* aEnv);
+    
+	/**
+	* RegisterFadeEffectL
+	*
+	* Register existing fade effect from MMC (RND ONLY) or ROM.
+	*/
+    void RegisterFadeEffectL();
+
+    /**
+	* DoSetCachedFadeEffectL
+	*
+	* Resolves the fade effect filename. Speeds up fade effect loading.
+	*/    
+    void DoSetCachedFadeEffectL();
+    
+	void HandleDestroyDisplay( TInt aScreenNumber );
+	
+	void HandleRegisterEffectL( TAlfBridgerData data );
+	
+	/**
+	* DoRegisterEffectL
+	*
+	* Register effect filename to a certain action in HuiFxEngine
+	*/
+	void DoRegisterEffectL(const TDesC& aFilename, TInt aAction);
+	
+	// effect handling
+	void HandleGfxEffectsL( TAlfBridgerData data );
+
+    // remove effect
+    // This is needed if we have to abort an effect
+    void HandleGfxStopEffectsL( TAlfBridgerData data );
+    
+	/**
+	*	RemoveEffectFromApp
+	*
+	*	Removes effects on appui.
+	*/
+    void RemoveEffectFromApp(TInt aAppUid);
+    
+    // component effect handling
+    void HandleGfxControlEffectsL( TAlfBridgerData data );
+    
+    /**
+     * Handles begin and end fullscreen events
+     */
+    TBool HandleGfxEventL(CFullScreenEffectState& aEvent, CHuiLayout* aToLayout, CHuiLayout *aFromLayout);
+    
+	/**
+	*	FreezeLayoutUntilEffectDestroyedL
+	*
+	*	Tries to take screenshot of the layout. If that fails, the layout will not be effected at all.
+	*/
+    void FreezeLayoutUntilEffectDestroyedL(CHuiLayout* aLayout, TInt aHandle);
+
+    /**
+     * Handles control effect events
+     */    
+    void HandleGfxControlEventL(CControlEffectState& aEvent, CHuiCanvasVisual* aCanvasVisual);
+    
+    /*
+     * SetupEffectLayoutContainerL
+     * 
+     * This method creates an own layout into iFullScreenEffectControlGroup. Then it creates
+     * temporary presenter visual visuals for each visual in aSourceLayout and binds them
+     * using SetExternalContentL. Finally the effect entry is added to iEffectCleanupStack, 
+     * thus it can be cleaned after effect completion.
+	 *
+	 *
+	 *	@return	ETrue, 	if layout have been initialized succesfully for the effect
+	 			EFalse,	if any visuals have been removed. Effect should not be applied.
+     */
+    TBool SetupEffectLayoutContainerL(TInt aHandle,CHuiLayout* aSourceLayout, TBool aIsExitEffect);
+
+    /*
+     *	AddEffectItemL
+	 *
+	 *	Prepares visual for the effect. Removes previous effect if necessary. @aItemDestroyed will return EFalse,
+	 *	if the visual has been destroyed during the previous effect.
+	 *	
+	 *	@param	aItemDestroyed	
+     */
+    CHuiCanvasVisual* AddEffectItemL(
+            TInt aEffectHandle,
+            CHuiVisual* aSourceVisual, 
+            CHuiLayout* aTargetLayout, 
+            CHuiControl* aEffectControl,
+            TBool aInsertTemporaryVisual,
+            TBool& aItemDestroyed,
+            TBool aIsExitEffect = EFalse);
+            
+
+    /*
+     *	AddToEffectLayoutContainerL
+     */
+    void AddToEffectLayoutContainerL(
+            TInt aEffectHandle,
+            CHuiLayout* aSourceLayout, 
+            CHuiLayout* aTargetLayout,
+            CHuiControl* aEffectControlGroup,
+            TInt& aItemsDestroyed,
+            TBool aAddLayout = ETrue,
+            TBool aIsExitEffect = EFalse);
+
+    /*
+     *	ListFamilyTreeL
+     */   
+    void ListFamilyTreeL( RPointerArray<CHuiLayout>& aArray, const CHuiLayout* aLayout );
+    /*
+     * SetupEffectLayoutContainerL
+     * 
+     * This method creates an own temporary presenter visual visual and binds it to aSourceVisul
+     * using SetExternalContentL. Finally the effect entry is added to iEffectCleanupStack, 
+     * thus it can be cleaned after effect completion.
+     */
+    void SetupEffectContainerL(TInt aHandle, CHuiCanvasVisual* aSourceVisual, TBool aIsExitEffect);
+
+    /*
+     * RemoveTemporaryPresenterItem
+     * 
+     * Effects are shown indirectly by a another visual, that is in iFullScreenEffect control group. 
+     * This methods unbinds the external content and the removes temporary presenter visual 
+	 * from iFullScreenEffect group and . It does not delete the CHuiFxEffect 
+	 * object associated with the content visual. See also iEffectCleanupStack.  
+     */
+    TBool RemoveTemporaryPresenterItem(TEffectCleanupStruct& aEffectItem);
+
+    /*
+     * FindTemporaryPresenterLayout
+     * 
+     * Finds temporary presenter layout based on a visual.
+     *
+     * @param   aVisual 
+     * 
+     * @return  NULL, if visual does not have temporary presenter visual in the active effect list
+     */
+    CHuiLayout* FindTemporaryPresenterLayout(CHuiVisual* aVisual);
+    
+    /*
+     * FindLayoutByEffectHandle
+     * 
+     * Application exit effect for application that does not stay background is destroyed and removed
+     * from normal control groups. FindLayoutByEffectHandle is used to find the correct group 
+     * in order to apply the exit effect on already "destroyed" application. 
+     *
+     * @param   aHandle     Effect handle.
+     * 
+     * @return  NULL, if visual does not have temporary presenter visual in the active effect list
+     */
+    CHuiLayout* FindLayoutByEffectHandle(TInt aHandle);
+    
+    /*
+     * HasActiveEffect
+     */
+    TBool HasActiveEffect(CHuiVisual* aVisual);
+    
+   /*
+	*	FindEffectHandle
+	*
+	*	@return 	Returns the effect handle number, which is associated with this visual. If none found, then 
+	*               returns KErrNotFound.
+	*/
+    TInt FindEffectHandle(CHuiVisual* aVisual);
+    /*
+     * RemoveTemporaryPresenterVisual
+     * 
+     * Effects are shown indirectly by a another visual, that is in iFullScreenEffect control group. 
+     * This methods unbinds the external content and the removes temporary presenter visual 
+	 * from iFullScreenEffect group and . It does not delete the CHuiFxEffect 
+	 * object associated with the content visual. See also iEffectCleanupStack.  
+     */
+    TBool RemoveTemporaryPresenterVisual(CHuiVisual* aVisual, TInt aHandle = KErrNotFound);
+    
+    /*
+     *	RemoveTemporaryPresenterVisuals
+     *	
+     *	See above. 
+     */
+    TBool RemoveTemporaryPresenterVisuals();
+    
+	void HandleNewWindowL( TAlfBridgerData& aData );
+	
+	void DestroyWindow(CHuiVisual* aVisual, TBool aForce = EFalse);
+	
+	void HandleDestroyWindowL( TAlfBridgerData& aData );
+	
+	void HandleSetWindowPosL( TAlfBridgerData& aData );
+	
+	void HandleSetWindowSizeL( TAlfBridgerData& aData );
+	
+	void HandleSetWindowRotationL( TAlfBridgerData& aData );
+	
+	void HandleSetWindowOpacityL( TAlfBridgerData& aData );
+	
+	void HandleReorderWindowL( TAlfBridgerData& aData );
+	
+	void HandlePostCanvasBufferL( TAlfBridgerData& aData );
+	
+	void HandleSetWindowFlagL( TAlfBridgerData& aData, TInt aOp );
+	
+	void SetWindowActiveL(CHuiVisual* aVisual, TBool aActive);
+	
+	void HandleSetWindowActiveL( TAlfBridgerData& aData );
+	
+	void HandleSetSurfaceExtentL( TAlfBridgerData& aData );
+	
+	void HandleLayerUsesAlphaFlagChanged( TAlfBridgerData& aData );
+	
+	void HandleGetNativeWindowDataL( TAlfBridgerData& aData );
+
+	void HandleSetCoveringBitmapL( TAlfBridgerData& aData );
+	
+	void HandleSetCursorDataL( TAlfBridgerData& aData );
+	
+	void HandleSetNodeTracking( TAlfBridgerData& aData );
+	
+	void HandleSetFadeEffectL( TAlfBridgerData& aData );
+
+    void HandleSetLayoutSwitchEffectL();
+	
+    void ClearCanvasVisualCommandSets(TBool aInactiveOnly);
+    
+    void ClipVisualRect(TRect& aRect, const TRect& aClippingRect);
+
+    TBool IsRectCoveredByRegion(TRect aRect, TRegion& aCoveringRegion);
+
+    void ShowSessionContainerControlGroupL(
+            CHuiRoster& aRoster, 
+            CHuiControlGroup& aGroup, 
+            TInt aWhere, 
+            TInt aScreenNumber );
+
+    void ShowWindowGroupControlGroupL(CHuiRoster& aRoster, CHuiControlGroup& aGroup, TInt aWhere, TInt aScreenNumber );
+    
+private:
+         
+    /**
+     * Provide a bitmap and mask from the given UID.
+     * This method should create a bitmap and its mask, usually by loading it from disk.
+     *
+     * @param aId      TextureManager id of this bitmap, may be used for extracting
+     *                 an icon resource.
+     * @param aBitmap  Output parameter for the provider: On return, has to store 
+     *                 a pointer to the generated bitmap. Ownership transferred to caller.
+	 *                 The support for input CFbsBitmap formats varies between 
+	 *                 different renderers. See \ref cfbsbitmapsupport 
+	 *                 Table describing renderer bitmap support.      
+	 * @param aMaskBitmap  
+	 *                 Output parameter for the provider: On return, has to store 
+     *                 a pointer to the generated alpha mask or <code>NULL</code> 
+     * 				   if there is no mask. Ownership of the bitmap is transferred 
+     *                 to the caller.
+     * 
+     * @see CHuiTextureManager::CreateTextureL()
+     */
+    virtual void ProvideBitmapL(TInt /*aId*/, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap);
+    
+    /**
+     * InsertVisualL
+     *  
+     * @param  aKey    The key object of type K to add to the array.
+     * @param  aVisual  The value object of type V to associate with aKey.
+     * @leave  KErrNoMemory if memory could not be allocated to store the copies of aKey and aValue.
+     */
+    void AddVisual( TInt aKey, TInt aClientSideId, TInt aClientSideGroupId, CHuiCanvasVisual* aVisual );
+    
+    /**
+     * RemoveVisual
+     * 
+     * @param  aKey    The key to be removed.
+     * @return         KErrNone if the key object and corresponding value object were
+     *                 removed successfully. KErrNotFound if the key object was not present in the array.
+     */
+    void RemoveVisual( TInt aWindowNodeId );
+    
+    /**
+     * FindVisual
+     * 
+     * AddVisual and FindVisual set the iPreviouslySearchedVisual, which speeds
+     * up the sequential search of the same visual.
+     * 
+     * @param  aKey    The key to be removed.
+     * @return         NULL if the key object is not found. Otherwise returns 
+     *                 the pointer to visual corresponding the key.
+     */    
+    CHuiCanvasVisual* FindVisual( TInt aKey );
+ 
+     /**
+     * FindVisualByClientSideIds
+     * 
+     * Finds a visual based on the provided client side ids. 
+	 *
+     * @param  aClientSideId    The key to be removed.
+     * @param  aClientSideId    The key to be removed.
+     * @return         NULL if the visual was not not found. Otherwise returns 
+     *                 the pointer to visual corresponding the client side keys.
+     */       
+    CHuiCanvasVisual* FindVisualByClientSideIds(TUint32 aClientSideId, TUint32 aClientSideGroupId );
+
+    /**
+     * This method finds controlgroup which has been assosiated with given window group id. 
+     * Control group may or may not be active in roster.
+     *
+     * @param aWindowGroupNodeId Node id of the window group, internal.
+     */
+    CHuiControlGroup* FindControlGroup(TInt aWindowGroupNodeId, TInt aScreenNumber );
+
+    /**
+     * This method finds controlgroup which has been assosiated with window server window group id. 
+     *
+     * @param aWindowGroupNodeId window server window group id of the window group, internal.
+     * @param aScreenNumber Screen number where to search, if not known KErrNotFound
+     *        at return will contain the screen number where the group was found
+     * @return pointer to the window group if found, NULL if not found.
+     */
+    CHuiControlGroup* FindControlGroupByWindowGroupId( 
+            TInt aWindowGroupId, 
+            TInt& aScreenNumber, 
+            TAlfControlGroupEntry** aAlfGroup = NULL );
+
+    CHuiControlGroup* FindControlGroupByAppId( TInt aAppId );
+    /**
+     * This method deletes controlgroup which has been assosiated with given window group id. 
+     * Control group may or may not be active in roster.
+     *
+     * @param aWindowGroupNodeId Node id of the window group, internal.
+     */
+    void DeleteControlGroupL(TInt aWindowGroupNodeId, TInt aScreenNumber );
+
+    /**
+     * Creates a control group
+     *
+     * @param aWindowGroupNodeId Node id of the window group, internal.
+     * @param aClientWindowGroupId External window group id.
+     */
+    CHuiControlGroup& CreateControlGroupL(
+            TInt aWindowGroupNodeId, 
+            TInt aClientWindowGroupId,
+            TInt aSecureId,
+            TInt aScreenNumber );
+
+    /**
+     * This method prepares cached and HW accelerarted versions of texts & images from
+     * canvas command buffers if those buffers has not yet been handled before. 
+     */
+    void PrepareCanvasVisualCaches( TInt aScreenNumber );
+
+    /**
+     * This method reorders alf controlgroups to just above alf servers
+     * windowgroup.
+     * 
+     */
+
+    void ReorderAlfControlGroupsL( TInt aScreenNumber );
+        
+    /**
+     * Called to notify the observer that a display refresh is about to begin.
+     * The observer should prepare its state for the display.
+     */
+    TInt ResolveScreenNumber( CHuiDisplay& aDisplay );
+    
+    void NotifyDisplayRefreshStarted(CHuiDisplay& aDisplay);
+
+    /**
+     * 
+     */
+    TBool IsVisualOpaque(CHuiVisual& aVisual);
+
+    /**
+     * Enables default transformation steps
+     */
+    void EnableVisualDefaultTransformationsL(CHuiVisual& aVisual);
+
+    /**
+     * 
+     */
+    void HandleCallback(TInt aStatus);
+    
+    /**
+     * 
+     */
+    void DoDispatchL(TInt aStatus);
+
+    void InsertImageBrushL(CHuiVisual& aVisual, TInt aBitmapHandle);
+    void UpdateImageBrushL(CHuiVisual& aVisual, TInt aBitmapHandle);
+    void RemoveImageBrushL(CHuiVisual& aVisual);
+
+    
+    void DebugPrintControlGroupOrder(
+            CAlfScreen& aScreen, 
+            CHuiRoster& aRoster, 
+            CHuiControlGroup& aGroup);
+    
+    void VisualizeControlGroupOrderL(
+            CHuiRoster& aRoster, 
+            CHuiControlGroup& aGroup);
+    
+    void PrintAllocMem();
+
+    // Fading methods
+    TBool SetupFadeEffectL(CHuiCanvasVisual& aVisual);
+    void PrepareFadeEffects( CHuiCanvasVisual& aVisual );    
+    TBool LoadFadeEffectsL( CHuiCanvasVisual& aVisual );        
+
+    // Fading related utility methods
+    static TBool CanFadeChildren( CHuiCanvasVisual& aParent );
+    static TInt RecursiveChildCount( CHuiCanvasVisual& aParent, TInt aCanvasFlags );
+    static TBool IsFadedByParent( CHuiCanvasVisual& aVisual );
+    static TBool IsNearestParentEffectFade( CHuiCanvasVisual& aVisual );
+    static TBool HasActivePaintedAreas( CHuiCanvasVisual& aVisual, TBool aIncludeChildren );
+    static TBool HasActiveFadedChildren( CHuiCanvasVisual& aVisual );
+
+private:
+
+    RPointerArray<CAlfScreen> iAlfScreens;
+    void SetCursorTimerL(TUint aTime = 0, CHuiVisual* aCursor = 0);
+
+NONSHARABLE_CLASS ( TDeadControlGroup )
+    {
+public:
+    TDeadControlGroup():
+        iDeadGroup( 0 ),
+        iScreen( 0 ),
+        iLayout(NULL)
+            {
+            }
+    TInt iDeadGroup;
+    TInt iScreen;
+    CHuiLayout* iLayout;
+    };
+    
+NONSHARABLE_CLASS( TEffectControlGroupEntry )  
+    {
+public:
+    TEffectControlGroupEntry() :    
+        iHandle( KErrNotFound ),
+        iVisual( NULL ),
+        iEffect( NULL ),
+        iAction( 0 ),
+        iWindowGroupNodeId( 0 ),
+        iClientWindowGroupId( 0 ),
+        iScreenNumber( 0 )
+            {
+            }
+
+    /** Handle of the attached effect */
+    TInt iHandle;
+    // Visual to which the effect has been attached */
+    // This controls the case where a new effect replaces an old one.
+    // If a new effect has been added to the same visual, the old one does not need
+    // to be removed as adding the later effect has already removed the previous one.
+    // Pointer not owned, value only saved for reference
+    CHuiVisual* iVisual;
+    // The effect that has been attached to the visual
+    // Pointer not owned, value only saved for reference
+    CHuiFxEffect* iEffect;
+    // The action that is the cause of the effect (control appear or disappear)
+    TInt iAction;
+    /** Window group node id, internal */
+    TInt iWindowGroupNodeId; 
+    /** Window group id, external id seen e.g. by the application using wserv */
+    TInt iClientWindowGroupId;
+    TUint8 iScreenNumber;
+    };
+
+    // Array of window groups that have attached full screen effects
+    RArray<TInt> iEffectWindowGroups;
+    // Array of control groups that should have been deleted,
+    // but have been left alive until the effect has run its course.
+    RArray<TDeadControlGroup> iDeadControlGroups;
+    // Array of individual controls that have attached effects
+    RArray<TEffectControlGroupEntry> iEffectControls;
+    
+    // Array of callback data structures
+    // The structures contain the handle that identifies the initiator of the effect
+    // and a pointer to CAlfBridge instance to allow handling via static functions
+    RArray<TInt> iEffectHandles;
+        
+    // iEffectCleanupStack contains the entries for effects that are currently associated 
+    // with visuals in iFullscreenEffectControlGroup
+    RArray<TEffectCleanupStruct> iEffectCleanupStack;
+    
+    // Effects that have finished by their own, or framework requested to end them
+    RArray<TInt> iFinishedEffects;
+    
+    // Same as iEffectCleanupStack, but only the ones that can be now cleaned away.
+    // See method RemoveTemporaryPresenterVisuals.
+    RArray<TInt> iFinishedCleanupStackEffects;
+    
+	// Effects states are used for effects request that arrive before the effected 
+	// window has been created. This is very common with fullscreen effects and 
+	// occational with control effects.
+	//
+	// NOTE: control effects support currently only one "delayed" effect. This is propably
+	// not sufficient for all sitations.
+    NONSHARABLE_CLASS(CEffectState) : public CBase
+        {
+    public:    
+        
+        CEffectState();
+         ~CEffectState();
+         
+    protected:
+	   /**
+		* ResolveFileNameL
+		*
+		* Reads filename from stream and composes it to iEffectName variable.
+		*/
+         void ResolveFileNameL(RMemReadStream& aStream);
+         
+    public:
+         
+         TInt iAction;
+         TInt iHandle;
+            
+         HBufC* iEffectName;
+         // Handle using which client should be informed of completion.
+         TInt iCompletionHandle;
+         // State information
+         TInt iOperation;
+         
+        };
+    
+    NONSHARABLE_CLASS( CControlEffectState ) : public CEffectState
+        {
+    public:
+
+        TUint32 iClientHandle;
+        TUint32 iClientGroupHandle;
+    
+        void ConstructL(TInt aAction, RMemReadStream& aStream);
+        };
+
+    NONSHARABLE_CLASS( CFullScreenEffectState ) : public CEffectState
+        {
+    public:
+       // CFullScreenEffectState();
+       // ~CFullScreenEffectState();
+        
+        void ConstructL(TInt aAction, RMemReadStream& aStream);
+
+        // Information from BeginFullScreen
+        TInt iType;
+        TInt iWg1;
+        TInt iWg2;
+        TInt iToAppId;
+        TInt iFromAppId;
+        TRect iRect;
+        
+        // ETrue if waiting for window group to appear
+        TBool iWaitingWindowGroup;
+        // ETrue if end fullscreen has been performed
+        TBool iEndFullScreen;
+        // ETrue if setup effect container has been done
+        TBool iSetupDone;
+
+        // used for resolving the iCleanupStackItem that holds the frozen app layout underneath the starting application
+        TInt iAppStartScreenshotItemHandle;
+        };
+
+    /**
+     * Full screen effect state.
+     * Own.
+     */
+    CFullScreenEffectState* iFullScreenEffectData;
+    
+    /**
+     * Control effect state.
+     * Own.
+     */
+    CControlEffectState* iControlEffectData;
+        
+    // these save the current full screen transition data
+    // so that the correct transition can be ended from the callback
+    // when the effect ends
+    TInt iLastFullScreenEffectWindowGroup;
+    TInt iLastFullScreenScreen;
+    TInt iLastAction;
+    TInt iLastEffectHandle;
+    CAlfEffectEndTimer* iEffectEndTimer;
+    TBool iLayoutInitializedForExitEffect;
+    
+    CAlfStreamerBridge** iHost;
+
+    TInt iAlfWindowGroupId;
+    TInt iAlfWindowGroupNodeId;
+
+
+    CFbsBitmap* iHack; // not excactly owned..
+    CFbsBitmap* iDummyMask; // not excactly owned..
+    
+    TBool iActivated;
+    RAlfBridgerClient iBridgerClient;
+    
+    class THashVisualStruct
+        {
+    public:
+        THashVisualStruct( 
+                CHuiCanvasVisual* aVisual, 
+                TUint32 aClientSideId,
+                TUint32 aClientSideGroupId) : 
+            iVisual( aVisual ), 
+            iClientSideId(aClientSideId),
+            iClientSideGroupId(aClientSideGroupId)
+                {};
+        
+    public:
+        CHuiCanvasVisual* iVisual;  // not own
+        TInt32 iClientSideId;
+        TInt32 iClientSideGroupId;
+        };
+    
+    RHashMap<TUint32,THashVisualStruct> iWindowHashArray;
+    class TRegisteredEffectsStruct
+        {
+    public:
+        TRegisteredEffectsStruct()
+            {
+            iAction = 0;
+            iEffectFile = NULL;
+            }
+    public:
+        TInt iAction;
+        HBufC* iEffectFile; 
+        };
+		
+public:
+    
+    RArray<TRegisteredEffectsStruct> iAlfRegisteredEffects;
+    CHuiEnv* iHuiEnv;
+	CAlfAppUi* iAppUi;
+
+private:    
+
+    HBufC16* iFadeEffectFile;
+    
+	CHuiCanvasVisual* iPreviouslySearchedVisual;
+    
+	TInt iPreviouslySearchedVisualId;
+	
+	// For textcursor opacity
+    CPeriodic* iCursorTimer;
+    TUint iCursorInterval;
+    CHuiVisual* iCursorVisual;
+
+#ifdef SYMBIAN_BUILD_GCE    
+    TBool iPrintFPS;
+#endif
+
+    CAlfCommandDebug* iCommandDebug;
+
+    mutable RRegionBuf<KAlfBridgeRegionGranularity> iTempVisualRegion;
+    mutable RRegionBuf<KAlfBridgeRegionGranularity> iTempIntersectingRegion;
+    mutable RRegionBuf<KAlfBridgeRegionGranularity> iTempRegion;
+    TBool iBgSurfaceFound;
+    TBool iInLowMemMode;
+    CAlfLayoutSwitchEffectCoordinator* iLayoutSwitchEffectCoordinator;
+    TInt iAlfSecureId; 	    
+    TBool iSwRenderingEnabled;
+    
+    TBool iForcedSwRendering;
+    TBool iLowMemoryMode;
+    THuiMemoryLevel iCurrentMemoryLevel;
+    };    
+
+#endif // __ALF_BRIDGE_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfframestamp.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,71 @@
+/*
+* 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:   Helper class for frame rate calculation
+*
+*/
+
+
+#ifndef C_ALFFRAMESTAMP_H_
+#define C_ALFFRAMESTAMP_H_
+
+NONSHARABLE_CLASS(TFrameStamp)
+    {
+public:
+    
+    TFrameStamp(){};
+    
+    TFrameStamp( TUint aFrameIndex )
+        { 
+        iFrameIndex = aFrameIndex;
+        iTime.UniversalTime();
+        };
+    
+    /*
+     * FrameRate
+     *
+     * Calculates framerate between this and the given frame
+     * 
+     * @aParam  aStamp  The beginning frame for FPS calculation. 
+     *                  This object represents the end frame.
+     */
+    TReal32 FrameRate(TFrameStamp& aStamp)
+        {
+        TInt64 delta = iTime.MicroSecondsFrom( aStamp.iTime ).Int64();
+
+#ifdef EKA2
+        TReal32 elapsed = delta / 1.0e6;
+#else
+        TReal32 elapsed = delta.GetTReal() / 1.0e6;
+#endif
+        TReal32 elapsedFrames = iFrameIndex - aStamp.iFrameIndex; 
+        TReal32 fps = 0;
+        RDebug::Print(_L("FrameRate - frames %4.2f, elapsed time in microseconds: %4.2f"), elapsedFrames, elapsed);
+        
+        if ( elapsed != 0.0 )
+            {
+            fps = ( elapsedFrames  / elapsed);
+            }
+        return fps;
+        };
+
+private:
+
+    TTime iTime;
+
+    TUint iFrameIndex;
+
+    };
+
+
+#endif /* C_ALFFRAMESTAMP_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfhierarchymodel.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,261 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Mapping function handlers
+*
+*/
+
+
+#ifndef __ALFHIERARCHYMODEL_H__
+#define __ALFHIERARCHYMODEL_H__
+
+#include <s32mem.h>
+#include <e32base.h>
+#include <e32hashtab.h>
+#include <gdi.h>
+#include <alfwindowstructs.h>
+#include "alfstreamerbridge.h"
+#include <uiacceltk/HuiUtil.h>  // USER_INVARIANT
+
+// forward declarations
+class CAlfStreamerServer;
+class CFbsBitmap;
+class TPoint;
+class TRect;
+class CAlfWindow;
+class TRgb;
+class CFbsBitGc;
+class CAlfNodeRoot;
+class CAlfNode;
+
+#include <graphics/wsgraphicdrawer.h>
+#include <graphics/wsgraphicscontext.h>
+
+/*
+ * Helper class for hash array
+ */
+NONSHARABLE_CLASS(CNodeHashStruct)
+        {
+    public:
+        CNodeHashStruct( CAlfNode* aNode ) : iNode( aNode ) { };
+        
+        CAlfNode* iNode;
+        };
+
+NONSHARABLE_CLASS(CAlfHierarchyModel) : public CBase, public MAlfBatchObs
+    {
+
+
+public:
+    static CAlfHierarchyModel* NewL(CAlfStreamerServer& aServer);
+    
+    CAlfStreamerServer& Server()
+        {
+        return iServer;
+        }
+     
+    virtual ~CAlfHierarchyModel();
+
+    void HandleMessageL( const RMessage2& aMessage );
+    
+    void ShareChunkL( const RMessage2& aMessage );
+    
+    void CloseChunk( TInt32 aChunkId );
+    
+    void OpenChunkL( const RMessage2& aMessage );
+
+    // utils
+    void DoReleaseSemaphor();
+    
+    void RequestPacketEndCallback( TInt aOffset );
+    
+    void RequestFrameEndCallback();
+
+    RHashMap<TUint32,CNodeHashStruct> iNodeHashArray;
+    
+    CAlfNode* FindNode( TUint32 aWindowId );
+
+    TInt InsertNode( TUint32 aWindowId, CAlfNode* aNode );
+
+    TBool RemoveNode( TUint32 aWindowId );
+    
+    void RemoveAllNodes();
+    
+private:
+    
+    CAlfHierarchyModel(CAlfStreamerServer& aServer):iServer(aServer){};
+
+    void AppendScreen( TInt aScreenNumber );
+    
+    void RemoveScreen( TInt aScreenNumber );
+    
+    void ConstructL();
+    
+	void ProcessUnknownNodeDrawingL( RMemReadStream& aStream );
+    
+protected:
+
+    void ReadEndMarkerL();
+        
+    
+private:
+    
+    /**
+     * ReadRectL
+     * Convinience function for reading a TRect from stream
+     *
+     * @since S60 ?S60_version
+     * @param TRect
+     */
+public:
+    void ReadRectL(TRect& aRect, RMemReadStream* aStream );
+    
+//    static TInt DoSignal( TAny* aObject );
+    
+private:
+
+    /**
+     * ReadRegionL
+     * Convinience function for reading a RRegion from stream
+     *
+     * @since S60 ?S60_version
+     * @param Region  
+     */
+    void ReadRegionL( RMemReadStream* aStream, RRegion& aRegion, TPoint aWindowPos = TPoint(0,0) );
+     
+    void ExecuteDrawCommandsL( CAlfWindow** aWindow, TAny* aPtr, TInt aSize );
+    /**
+     * ExecuteCommandsL
+     * Internalizes the streamed data.
+     *
+     * @since S60 ?S60_version
+     */
+    void ExecuteCommandsL();
+    
+    // Commands from window tree oberver at renderstage
+    void DoNodeCreatedL();
+    void DoNodeReleasedL();
+    void DoNodeActivatedL();
+    void DoNodeExtentChangedL();
+    void DoNodeSiblingOrderChangedL();
+    void DoNodeFlagChangedL();    
+	void DoNodeFadeCountChangedL();
+	void DoNodeTransparentRegionChangedL();
+	void DoNodeLayerAddedL();
+	void DoNodeLayerExtentChangedL();
+	void DoNodeLayerUsesAlphaFlagChangedL();
+	void DoNodeMovedToWindowGroupL();
+	void DoNodeWindowGroupChainedL();
+	void DoNodeWindowGroupChainBrokenAfterL();
+	void DoNodeAttributeChangedL();
+	void DoNodeDebugTrackL();
+	void DoNodeFadeAllChildrenL();
+private: // from bridge
+    
+    virtual void BridgerCallback( TInt aOp, TInt aInt );
+    virtual void BridgerCanceled()
+        {
+        }
+
+    void SetSynchMessage(const RMessage2* aMsg)
+        {
+        iMessage = *aMsg;
+        }
+public:
+    
+    /*
+     * Shared chunk handle. Owned by CAlfRenderStage's CAlfSendBuffer
+     */
+
+	TUint8* ChunkBase( TUint32 aChunkIndex = 0)
+		{
+		if ( aChunkIndex == 0 )
+		    {
+		    return iChunk.Base() +  sizeof( TChunkHeader);
+		    }
+		else
+		    {
+		    return iCacheChunks.Find( aChunkIndex )->Base() +  sizeof( TChunkHeader);
+		    }
+		
+		}
+    
+	   CAlfNodeRoot* iRootNode;
+    
+private: // variables
+
+    RChunk iChunk;
+    
+    RHashMap<TUint32,RChunk> iCacheChunks;
+    
+    TInt32 iChunkInUse;
+        
+
+    CAlfStreamerServer& iServer;
+
+    /*
+     * Readstream for the above chunk.
+     */
+    RMemReadStream* iStream;
+
+    // Todo: debug only
+    TInt iUsedCommands[100];
+
+    RRegion iUpdateRegion;
+    
+    RMessagePtr2 iMessage;
+    
+    RMessagePtr2 iSpaceNotificationMessage;
+    
+    TBool iWaitingBridgerToComplete;
+    
+    RCriticalSection iSema;
+
+    CAlfNode* iPreviouslySearchedNode;
+    
+    /*
+     * For debugging the amount of drawn frames
+     */
+    TInt iFrame;
+    
+    TChunkHeader* iChunkHeader;
+    
+    CFbsBitGc* iGc;
+    
+    RArray<RMessagePtr2> iPendingAlfWindowDataMessages;
+    
+    TPoint	iWindowPos;
+    
+    friend class CAlfNode;
+    
+    TInt iScreenNumber;
+    
+    CPeriodic*  iPeriodic;
+    
+    TInt iSpaceNotificationCounter;
+    
+    TBool iBatchAlreadyCommited;
+    
+	TBool iSpaceNotificationMessageOrphean;
+	
+	TInt iPreviousCallbackOffset;
+	
+	TInt iSearchNode;
+	
+#ifdef ALF_DEBUG_TRACK_DRAWING 
+	CAlfCommandDebug* iCommandDebugger;
+#endif	
+    TBool iDidForcedComplete;
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfmappingfunctionhandlers.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,211 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Mapping function handlers
+*
+*/
+
+
+
+#ifndef T_ALFMAPPINGFUNCTIONHANDLERS_H
+#define T_ALFMAPPINGFUNCTIONHANDLERS_H
+
+#include "alf/alfextensionfactory.h"
+#include <alf/alfconstants.h>
+#include <uiacceltk/HuiMappingFunctions.h>
+
+class CHuiCurvePath;
+
+/**
+ *  Average mapping function
+ *
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS(TAlfAverageMappingFunctionHandler): public MAlfExtension
+    {
+public:  
+
+    TAlfAverageMappingFunctionHandler(
+        MAlfInterfaceProvider& aResolver, 
+        MHuiMappingFunction* aFunc1 = 0, 
+        MHuiMappingFunction* aFunc2 = 0 );
+
+    void Release();
+    TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);
+
+private:
+    THuiAverageMappingFunction iAverageMappingFunction;
+    MAlfInterfaceProvider& iResolver;
+    };
+    
+/**
+ *  Constant mapping function
+ *
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS(TAlfConstantMappingFunctionHandler): public MAlfExtension
+    {
+public:  
+
+    TAlfConstantMappingFunctionHandler(
+        MAlfInterfaceProvider& aResolver, 
+        TReal32 aValue );
+
+    void Release();
+    TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);
+
+private:
+    THuiConstantMappingFunction iConstantMappingFunction;
+    MAlfInterfaceProvider& iResolver;
+    };
+    
+/**
+ *  Linear mapping function
+ *
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS(TAlfLinearMappingFunctionHandler): public MAlfExtension
+    {
+public:  
+
+    TAlfLinearMappingFunctionHandler(
+        MAlfInterfaceProvider& aResolver, 
+        TReal32 aFactor = 1.0,
+        TReal32 aOffset = 0.0  );
+
+    void Release();
+    TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);
+
+private:
+    THuiLinearMappingFunction iLinearMappingFunction;
+    MAlfInterfaceProvider& iResolver;
+    };
+    
+/**
+ *  Sine mapping function
+ *
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS(TAlfSineMappingFunctionHandler): public MAlfExtension
+    {
+public:  
+
+    TAlfSineMappingFunctionHandler(
+        MAlfInterfaceProvider& aResolver, 
+        TReal32 aFactor = 1.0,
+        TReal32 aOffset = 0.0 );
+
+    void Release();
+    TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);
+
+private:
+    THuiSineMappingFunction iSineMappingFunction;
+    MAlfInterfaceProvider& iResolver;
+    };
+    
+/**
+ *  Cosine mapping function
+ *
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS(TAlfCosineMappingFunctionHandler): public MAlfExtension
+    {
+public:  
+
+    TAlfCosineMappingFunctionHandler(
+        MAlfInterfaceProvider& aResolver, 
+        TReal32 aFactor = 1.0,
+        TReal32 aOffset = 0.0 );
+
+    void Release();
+    TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);
+
+private:
+    THuiCosineMappingFunction iCosineMappingFunction;
+    MAlfInterfaceProvider& iResolver;
+    };
+  
+/**
+ *  Curve path
+ *
+ *  @since S60 v3.2
+ */  
+NONSHARABLE_CLASS(CAlfCurvePathHandler): public CBase, public MAlfExtension
+    {
+public:  
+    
+    static CAlfCurvePathHandler* NewL(  
+        MAlfInterfaceProvider& aResolver,
+        CHuiCurvePath* aCurvePath = 0 );
+    ~CAlfCurvePathHandler();
+
+    void Release();
+    TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);
+
+private:
+    CAlfCurvePathHandler( MAlfInterfaceProvider& aResolver );
+    void ConstructL(CHuiCurvePath* aCurvePath);
+
+private:
+    MAlfInterfaceProvider& iResolver;
+    CHuiCurvePath* iCurvePath;
+    TBool iOwnCurvePath;
+    };
+
+/**
+ *  Table mapping function
+ *
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS(TAlfTableMappingFunction): public MHuiMappingFunction
+    {
+public:
+    
+    /**
+     * Constructor.
+     */
+    TAlfTableMappingFunction();
+
+    /* implements MHuiMappingFunction */
+    TReal32 MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP;
+
+public:
+
+    TAlfTableMappingFunctionParams iParams;
+    };
+
+
+NONSHARABLE_CLASS(TAlfTableMappingFunctionHandler): public MAlfExtension
+    {
+public:  
+
+    TAlfTableMappingFunctionHandler(MAlfInterfaceProvider& aResolver);
+
+    void Release();
+    TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);
+
+private:
+    TAlfTableMappingFunction iMappingFunction;
+    MAlfInterfaceProvider& iResolver;
+    };
+
+
+
+#endif // T_ALFMAPPINGFUNCTIONHANDLERS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfnodes.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,546 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef C_ALFNODES_H
+#define C_ALFNODES_H
+
+#include <e32base.h>
+
+// Define this to get window tree traces. By default, traces are printed only when a new node is created, in DoNodeCreatedL().
+// FYI: you can get similiar window tree traces from WSERV by calling: RWsSession::LogCommand(ELoggingStatusDump).  
+//#define ALF_DEBUG_PRINT_NODE_INFO
+
+
+#include "alfhierarchymodel.h"
+// forward declarations
+class CAlfWindow;
+class CAlfNode;
+
+/**
+ *  Base class for window tree hierarcy items
+ *  Hierarcy will have a single CAlfRootNode. CAlfVisualNode is base for nodes that can receive drawing. 
+ *
+ *  @code
+ *   ?good_class_usage_example(s)
+ *  @endcode
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+
+class CAlfNodeSprite;
+class CAlfNodeAnim;
+class CAlfNodeTextCursor;
+class CAlfNodeVisual;
+
+class CAlfNode : public CBase
+    {
+// ---------------------------------------------------------------------------
+public:
+
+    static CAlfNode* NewL( 
+            CAlfHierarchyModel* aModel, 
+            RMemReadStream* aStream, 
+            MWsWindowTreeNode::TType aType );
+
+protected:
+
+	void ConstructL( 
+	        CAlfHierarchyModel* aModel, 
+	        RMemReadStream* aStream );
+
+protected:
+ 
+    CAlfNode();
+    
+    void RemoveDependencies( CAlfNode* aFirstChildOfMyType );
+	
+    /*
+     * UpdateChildrenOrdinalPositions
+     * 
+     * When ordinal position of a window is updated, it affects also the children
+     * ordinal positions. These must be calculated and sent to alfbridge
+     */
+    void UpdateChildrenOrdinalPositions(CAlfNode* aNode);
+    
+    /*
+     * UpdateOrdinalPosition
+     * 
+     * Creates a flat structure out of the linked tree structure and calculates
+     * node ordinal position in it. Passes ordinal position to alfbridge.
+     */
+    void UpdateOrdinalPosition();
+    
+public:
+    
+    /*
+     * HasChildren
+     * 
+     * Return ETrue, if node has sprite, anim, text cursor or child windows.
+     */
+    TBool HasChildren();
+    
+    void ResolveParent( TUint32 aParentId, TInt aMyId );
+    
+    void SetFirstChild( );
+    
+    void SetFirstAnim();
+    
+    void SetFirstSprite();
+    
+    CAlfNode* OrphonMe();
+    
+    CAlfNode* FindPreviousChild();
+    
+    TUint32 FindParentGroup();
+  
+    class TIter
+        {
+    public:
+        
+        
+    TBool iChildrenProcessed;
+  
+        TIter(CAlfNode* aTopNode);
+    
+        CAlfNode* Current(); 
+    
+        CAlfNode* Next();
+        
+        CAlfNode* iTopNode;
+        
+        CAlfNode* iCurrentNode;
+        
+        CAlfNode* iCurrentSibling;
+        
+        CAlfNode* iCurrentParent;
+        
+        CAlfNode* iMasterNode;
+        
+        
+    private:
+        
+        enum TState
+        {
+        ESearchingSprites,
+        ESearchMoreSprites,
+        ESearchingTextCursor,
+        ESearchingMoreTextCursor,
+        ESearchingAnims,
+        ESearchMoreAnims,
+        ESearchingChildWindows
+        };
+        
+        TState iState;
+        };
+    
+    void GetAllChildrenInGroup( RPointerArray<CAlfNode>& aNodes, TUint32 aParentId );
+    
+    TInt OrdinalPosition();
+    
+    void TraverseNodeTree( CAlfNode* node,  RPointerArray<CAlfNode>& nodes, TBool aTraverseOnlySiblings, TBool aAddMe = ETrue);
+
+#ifdef ALF_DEBUG_PRINT_NODE_INFO    
+public:    
+        
+    static void PrintInfo( 
+            CAlfNode* node, TInt aHighLightNode, TInt aDepth = 0);
+    
+    static void PrintNodeTree(
+            CAlfNodeRoot* aNode,
+            TInt aHighlightNode = 0 );
+    
+    static void PrintSubTree( CAlfNode* aNode, TInt aHighlightNode, TInt& aDepth  );
+    
+    TBool Activated()
+        {
+        return iNodeActivated;
+        }
+    
+    TBool Visible()
+        {
+        return iVisible;
+        }
+
+    TBool Faded()
+        {
+        return iFadeState;
+        }
+
+    TBool NonFading()
+        {
+        return iNonFading;
+        }
+    
+    TInt PrintOrdinalPositions();
+
+#endif    // ALF_DEBUG_PRINT_NODE_INFO
+    
+    void MovedToWindowGroup( RMemReadStream* aStream );
+    
+   /*
+	* ListOffspring
+	* @param	aList, list where children pointers will be added
+	* @param	aListChildren, When EFalse then only sprite, anim and text cursor child will be
+	*			added. No children nodes will be inserted to the list.
+	*/
+    void ListOffspring( RArray<CAlfNode*>& aList, TBool aListChildren = ETrue);
+    
+    virtual void FlagChanged( MWsWindowTreeObserver::TFlags aFlag, TBool aNewValue );
+    
+    void FadeAllChildren( TBool aFaded ); 
+
+    void FadeCountChanged( TInt aFadeCount ); 
+    
+    void SetFaded( TBool aFaded );
+    virtual void ActivateNode(){ iNodeActivated = ETrue;};
+
+    TAny* CreateWindowAttributes(TInt& aIndex, TInt aSize );
+    
+    void SiblingOrderChanged( TInt aNewPos );
+        
+    virtual ~CAlfNode();
+    
+    void SetTracking( TBool aValue );
+       
+    inline TBool Tracking( )
+        {
+        return iTrackNode;
+        }
+    
+    CAlfNode* iParent;
+    
+    CAlfNode* iChild;
+    
+    CAlfNode* iSibling;
+    
+    CAlfNodeSprite* iSpriteChild;
+    
+    CAlfNodeAnim* iAnimChild;
+    
+    CAlfNodeTextCursor* iTextCursor;
+    
+
+    TUint32 iId;
+    
+    TUint32   iGroupId;
+	
+	TInt iScreenNumber;
+	
+	MWsWindowTreeNode::TType Type()
+	    {
+	    return iType;
+	    }
+	
+    
+    CAlfWindow* iWindow;
+    
+    TInt iFadeCount;
+   
+protected:
+
+    /**
+     * ReadInt32L
+     * Convinience function for reading a TInt32 from stream. This function is inlined.
+     *
+     * @since S60 ?S60_version
+     * @param aPoint
+     */
+    inline void ReadInt32L( TInt& aValue, RMemReadStream* aStream  )
+        {
+        TRAPD( err,
+        aValue = aStream->ReadInt32L(););
+        if ( err )
+            {
+            RDebug::Print(_L("Eof in err ReadInt32L %d value %d"), err, aValue);
+            }
+        }
+
+    inline TInt8 ReadInt8L(  RMemReadStream* aStream )
+        {
+
+        TInt8 value;
+        TRAPD( err, value = aStream->ReadInt8L() );
+        if ( err )
+            {
+            RDebug::Print(_L("Eof in err ReadInt8L %d value %d"), err, value);
+            }
+        return value;
+        }
+    
+
+    
+protected:
+ 
+
+
+    CAlfHierarchyModel* iModel;
+
+    /*
+     * Flags
+     */
+    TBool iVisible;
+    
+    TBool iNonFading;
+    
+    TBool iAlphaChannelTransparencyEnabled;
+
+    TBool iNodeActivated;
+
+    MWsWindowTreeNode::TType  iType;
+    
+    TBool iTrackNode;
+    TBool iFadeState;
+    TBool iPostedFadeState;
+    };
+
+// ---------------------------------------------------------------------------
+class CAlfNodeVisual : public CAlfNode
+    {
+protected:
+	
+	  CAlfNodeVisual();
+
+	  
+public:
+	
+	void SetExtent( TRect &aRect );
+	
+    void DrawWindowFrameL( RMemReadStream& aStream );
+    
+    inline CAlfWindow* Window(){return iWindow;}
+    
+    void FlagChanged( MWsWindowTreeObserver::TFlags aFlag, TBool aNewValue );
+
+    void UpdateChildrenFlags( MWsWindowTreeObserver::TFlags aFlag, TBool aNewValue );
+    
+    void ActivateNode();
+    
+    void ReadEndMarkerL( RMemReadStream& aStream );
+    
+    void CommitCommands( TInt aCurrentPos, TInt aFrameSize, TBool aPartial, TBool aLastPart, TInt aChunkInUse );
+
+    void CreateWindowL(TInt aWindowGroupHandle, TInt aWindowHandle, TInt aParentWindowHandle);
+    
+    ~CAlfNodeVisual();
+    
+    TSize iSize;
+        
+    TPoint iOrigin;
+
+protected:
+	
+	void ConstructL( CAlfHierarchyModel* aModel, RMemReadStream* aStream );
+    
+	void UpdateParentPosition(TPoint aPosDelta);
+	    
+	void UpdateChildrenExtents(TPoint aPosDelta);
+	    
+	TBool iReadingPartialBuffer;
+    };
+
+
+class CAlfNodeWindow : public CAlfNodeVisual
+    {
+public:
+	
+    CAlfNodeWindow();
+    
+    ~CAlfNodeWindow();
+        
+    static CAlfNodeWindow* NewL( 
+            CAlfHierarchyModel* aModel, 
+            RMemReadStream* aStream, 
+            TInt aScreenNumber );
+    
+    void MoveToWindowGroup( TUint32 aNewGroupId );
+      
+protected:
+	
+    void ConstructL( CAlfHierarchyModel* aModel, RMemReadStream* aStream  );
+    
+protected:    
+    
+    struct TNodeWindowConstructionStruct
+        {
+        TInt    iOrdinalPriority;
+        TInt32  iParentId;
+        TInt    iWindowGroupHandle;
+        TInt    iWindowHandle;
+        };
+    
+    TNodeWindowConstructionStruct iNodeWindowConstructionStruct;
+    
+    TInt    iOrdinalPriority;
+
+    };
+
+
+// ---------------------------------------------------------------------------
+class CAlfNodeRoot : public CAlfNodeVisual
+    {
+private:
+
+	CAlfNodeRoot();
+
+public:
+  
+	static CAlfNodeRoot* NewL( 
+	        CAlfHierarchyModel* aModel, 
+	        RMemReadStream* aStream , 
+	        TInt aScreenNumber );
+
+    ~CAlfNodeRoot( );
+
+#ifdef ALF_DEBUG_PRINT_NODE_INFO 
+    TBool iLogging;
+#endif // ALF_DEBUG_PRINT_NODE_INFO
+
+protected:
+	
+	void ConstructL( CAlfHierarchyModel* aModel, RMemReadStream* aStream );
+	    
+    };
+
+// ---------------------------------------------------------------------------
+class CAlfNodeGroup : public CAlfNode
+    {
+private:
+	
+	CAlfNodeGroup();
+	 	
+public:
+    
+	static CAlfNodeGroup* NewL( 
+	        CAlfHierarchyModel* aModel, 
+	        RMemReadStream* aStream, 
+	        TInt aScreenNumber );
+	
+	void WindowGroupChained( TUint32 aChainedGroup );
+	
+	void GroupChainBrokenAfter( );
+	
+    ~CAlfNodeGroup();
+
+#ifdef    ALF_DEBUG_PRINT_NODE_INFO
+    const TUint32 SecureId()
+        {
+        return iSecureId;
+        }
+#endif
+    /*
+	 * The node, that this group is chained to.
+	 */
+	CAlfNodeGroup* iChainedFrom;
+	CAlfNodeGroup* iChainedTo;
+	
+protected:
+	
+	void ConstructL( 
+	        CAlfHierarchyModel* aModel, 
+	        RMemReadStream* aStream );
+private:
+    
+    TUint32 iSecureId;
+	
+    };
+
+// ---------------------------------------------------------------------------
+class CAlfNodeAnim: public CAlfNodeVisual
+    {
+private:
+	
+	CAlfNodeAnim();
+    
+	~CAlfNodeAnim( );
+	
+public:
+    
+
+    static CAlfNodeAnim* NewL( 
+            CAlfHierarchyModel* aModel, 
+            RMemReadStream* aStream, 
+            TInt aScreenNumber );
+
+protected:
+
+	void ConstructL( CAlfHierarchyModel* aModel, RMemReadStream* aStream );
+	    
+    TBool iActive;
+    };
+
+
+// ---------------------------------------------------------------------------
+class CAlfNodeSprite: public CAlfNodeVisual
+    {
+private:
+	
+    CAlfNodeSprite();
+
+    ~CAlfNodeSprite( );
+public:
+
+    static CAlfNodeSprite* NewL( 
+            CAlfHierarchyModel* aModel, 
+            RMemReadStream* aStream, 
+            TInt aScreenNumber );
+
+protected:
+	
+	void ConstructL( CAlfHierarchyModel* aModel, RMemReadStream* aStream );
+
+    };
+
+
+class CAlfNodeTextCursor: public CAlfNodeVisual
+    {
+private: 
+    
+    CAlfNodeTextCursor();
+public:
+    
+    static CAlfNodeTextCursor* NewL( 
+            CAlfHierarchyModel* aModel, 
+            RMemReadStream* aStream, 
+            TInt aScreenNumber );
+
+    void AttributeChangedL(  RMemReadStream* aStream );
+    
+    virtual ~CAlfNodeTextCursor();
+protected:
+    
+    void ConstructL( 
+            CAlfHierarchyModel* aModel, 
+            RMemReadStream* aStream );
+    
+private:
+    
+    TRect iRect;
+    
+    TRect iClipRect;
+    
+    TInt iFlags;
+    
+    TInt iColor;
+    
+    TInt iFlashInterval;
+    
+    TInt iCursorType;
+    };
+#endif // C_ALFNODES_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfscreen.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Server declaration, internal for Nokia
+*
+*/
+
+
+
+#ifndef __ALF_SCREEN_H__
+#define __ALF_SCREEN_H__
+
+#include <e32std.h>
+#include <e32base.h>
+#include <uiacceltk/HuiDisplay.h>
+#include <uiacceltk/HuiTextVisual.h>
+#include "alfshareddisplaycoecontrol.h"
+
+enum TAlfControlGroupRole
+    {
+    /** Unknown */
+    EAlfUnknownContainer,
+    
+    /** Alf application control group */
+    EAlfSessionContainer,
+    
+    /** WSERV window group */
+    EAlfWindowGroupContainer,
+    
+    /** WSERV floating sprite group */
+    EAlfWindowFloatingSpriteContainer,
+
+    /** Group for showing effects */
+    EAlfFullScreenEffectContainer,
+    };
+
+NONSHARABLE_CLASS( TAlfControlGroupEntry )  
+    {
+public:
+    TAlfControlGroupEntry() :    
+        iControlGroup(NULL),
+        iWindowGroupNodeId(0),
+        iClientWindowGroupId(0),
+        iScreenNumber(0),
+        iSecureId(0)
+            {
+            }
+
+    /** Control group which represents a window group */
+    CHuiControlGroup* iControlGroup;
+    
+    /** Window group node id, internal */
+    TInt iWindowGroupNodeId; 
+    
+    /** Window group id, external id seen e.g. by the application using wserv */
+    TInt iClientWindowGroupId;
+    
+    TUint8 iScreenNumber;
+    
+    TInt32 iSecureId;
+    };
+
+
+NONSHARABLE_CLASS(CAlfScreen) : public CBase
+	    {
+	public:
+	        
+        /**
+         * Constructor
+         */
+	    CAlfScreen(); 
+
+        /**
+         * 2nd phase construction
+         */
+	    void ConstructL(TInt aScreenNum, MHuiDisplayRefreshObserver& aObserver, CHuiEnv& aHuiEnv, CAlfSharedDisplayCoeControl* aSharedCoeControl);
+        void ConstructL(TInt aScreenNum, MHuiDisplayRefreshObserver& aObserver, CHuiEnv& aHuiEnv, RWindow* aWindow);
+        void CommonConstructL( MHuiDisplayRefreshObserver& aObserver, CHuiEnv& aHuiEnv);
+        /**
+         * Destructor
+         */
+	    ~CAlfScreen(); 
+
+        /**
+         * Returns the size of the screen in pixels
+         * @return Screesize in pixels
+         */
+        TSize Size() const;
+        
+        /**
+         * Sets a flag which causes full visual tree visibility scan to happen later.
+         */
+        void SetVisualTreeVisibilityChanged(TBool aChanged);
+
+        /**
+         * Gets a flag which causes full visual tree visibility scan to happen later.
+         */
+        TBool IsVisualTreeVisibilityChanged();
+
+	public:
+	        	   
+	    RArray<TAlfControlGroupEntry> iControlGroups;
+	  	CAlfSharedDisplayCoeControl* iCoeControl; // owned
+	   
+	   	CHuiDisplay* iDisplay; 
+	    CHuiControlGroup* iFloatingSpriteControlGroup; 
+	    CHuiControlGroup* iFullscreenEffectControlGroup; 
+	    
+	    TBool iVisualTreeVisibilityChanged;
+	    TInt iScreenNum;
+	    CFbsBitmap* iSwRenderingTarget;	    
+#ifdef SYMBIAN_BUILD_GCE	    
+	    CHuiTextVisual* iFPSText;
+#endif
+	    };
+         
+#endif // __ALF_SCREEN_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfshareddisplaycoecontrol.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   AppUi class
+*
+*/
+
+
+
+#ifndef CALFSHAREDDISPLAYCOECONTROL_H_
+#define CALFSHAREDDISPLAYCOECONTROL_H_
+
+#include <coecntrl.h>
+#include <uiacceltk/HuiDisplay.h>
+
+class CAlfAppUi;
+
+// Helper class, which is used only if the server functions with one window.
+NONSHARABLE_CLASS(CAlfSharedDisplayCoeControl): public CCoeControl
+    {
+public:
+   
+    CAlfSharedDisplayCoeControl();
+    
+    ~CAlfSharedDisplayCoeControl();
+    
+    void ConstructL();
+    
+    void Draw(const TRect& aRect) const;
+    
+    void SizeChanged();
+    
+    void HandlePointerEventL(const TPointerEvent& aPointerEvent);
+    
+    RPointerArray<CHuiDisplay> iDisplays;
+
+private:
+    
+    TRect iPrevRect;
+    
+    };
+   
+#endif /*CALFSHAREDWINDOW_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfsrvcontrolgroupsubsession.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Control group sub session.
+*
+*/
+
+
+
+#ifndef C_ALFSRVCONTROLGROUPSUBSESSION_H
+#define C_ALFSRVCONTROLGROUPSUBSESSION_H
+
+#include "alfsrvsubsessionbase.h"
+
+class CAlfAppSrvSessionBase;
+class CHuiControlGroup;
+
+/**
+ *  Control group sub session.
+ *
+ *  @lib alfappservercore.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS(CAlfSrvControlGroupSubSession): public CAlfSrvSubSessionBase
+    {
+
+public:
+
+    /**
+     * Two-phased constructor
+     *
+     * @param aSession Session in which this sub session belongs into.
+     * @param aId Group ID.
+     * @return New object. Ownership transferred.
+     */
+    static CAlfSrvControlGroupSubSession* NewL( CAlfAppSrvSessionBase& aSession, 
+                                                TInt aId );
+
+    /**
+     * Two-phased constructor. Leaves the objenct onto the cleanup stack.
+     *
+     * @param aSession Session in which this sub session belongs into.
+     * @param aId Group ID.
+     * @return New object on stack. Ownership transferred.
+     */
+    static CAlfSrvControlGroupSubSession* NewLC( CAlfAppSrvSessionBase& aSession,
+                                                 TInt aId );
+
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfSrvControlGroupSubSession();
+
+    /**
+     * Returns the used control group.
+     *
+     * @return Used control group.
+     */
+    CHuiControlGroup& ControlGroup();
+    
+    /**
+     * Returns if the control group is shown
+     *
+     * @return ETrue if shown
+     */
+    TBool IsShown() const;
+    
+    /**
+     * Set if the control group is shown
+     *
+     * @param aShown ETrue if shown.
+     */
+    void SetIsShown( TBool aShown );
+    
+    /**
+     * Returns the host control.
+     *
+     * @return Host control. Always on the control group.
+     */
+    CHuiControl& HostControl() const;
+
+// From CAlfSrvSubSessionBase
+
+    /**
+     * From CAlfSrvSubSessionBase
+     * Can process the given message?
+     *
+     * @param aMessage The message.
+     * @return ETrue if can process the message.
+     */
+    TBool CanProcessMessage(const RMessage2& aMessage) const;
+    
+    /**
+     * From CAlfSrvSubSessionBase
+     * Processes the message.
+     *
+     * @param aMessage The message.
+     */
+    void DoProcessMessageL(const RMessage2& aMessage);
+
+    // defines whether group would like go to top or bottom of groups stack
+    TInt& PreferredPos();
+
+private:
+
+    CAlfSrvControlGroupSubSession( CAlfAppSrvSessionBase& aSession,
+                                   TInt aId );
+
+    void ConstructL();
+
+    void AppendL( const RMessage2& aMessage );
+    void RemoveL( const RMessage2& aMessage );
+    void EnableTransformationL( const RMessage2& aMessage );
+    
+    // from subsessionbase
+    CHuiControlGroup* AsHuiControlCroup();
+
+private: // data
+    
+    CHuiControlGroup* iControlGroup;
+    TInt iId;
+    TBool iIsShown;
+    CHuiControl* iHostControl;
+    TInt iPrefrerredPos;
+    };
+
+#endif // C_ALFSRVCONTROLGROUPSUBSESSION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfsrvdisplaysubsession.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,157 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Display sub session.
+*
+*/
+
+
+
+#ifndef C_ALFSRVDISPLAYSUBSESSION_H
+#define C_ALFSRVDISPLAYSUBSESSION_H
+
+#include "alfsrvsubsessionbase.h"
+#include <uiacceltk/huidisplaybackgrounditem.h>
+
+class CAlfAppSrvSessionBase;
+class CHuiDisplay;
+class CHuiDisplayCoeControl;
+
+/**
+ *  Display sub session.
+ *
+ *  @lib alfappservercore.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS(CAlfSrvDisplaySubSession): public CAlfSrvSubSessionBase
+    {
+
+public:
+
+    /**
+     * Two-phased constructor
+     *
+     * @param aSession Session in which this sub session belongs into.
+     * @param aRect Display size.
+     * @param aWindowGroupId Client window group ID.
+     * @return New object. Ownership transferred.
+     */
+    static CAlfSrvDisplaySubSession* NewL( CAlfAppSrvSessionBase& aSession, 
+                                           const TRect& aRect,
+                                           TInt aWindowGroupId,
+                                           TInt aDisplayType,
+                                           const TUid& aBufferUid );
+
+    /**
+     * Two-phased constructor. Leaves the objenct onto the cleanup stack.
+     *
+     * @param aSession Session in which this sub session belongs into.
+     * @param aRect Display size.
+     * @param aWindowGroupId Client window group ID.
+     * @return New object on stack. Ownership transferred.
+     */
+    static CAlfSrvDisplaySubSession* NewLC( CAlfAppSrvSessionBase& aSession,
+                                            const TRect& aRect,
+                                           TInt aWindowGroupId,
+                                           TInt aDisplayType,
+                                           const TUid& aBufferUid );
+
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfSrvDisplaySubSession();
+
+    /**
+     * Returns the used display.
+     *
+     * @return Used display.
+     */
+    CHuiDisplay& Display();
+    
+    /**
+     * Called when session is about to get focus.
+     */
+    void SetSessionFocused(TBool aFocused=ETrue);
+
+// From CAlfSrvSubSessionBase
+
+    /**
+     * From CAlfSrvSubSessionBase
+     * Can process the given message?
+     *
+     * @param aMessage The message.
+     * @return ETrue if can process the message.
+     */
+    TBool CanProcessMessage(const RMessage2& aMessage) const;
+    
+    /**
+     * From CAlfSrvSubSessionBase
+     * Processes the message.
+     *
+     * @param aMessage The message.
+     */
+    void DoProcessMessageL(const RMessage2& aMessage);
+
+    TBool IsTvOut() const;
+
+    TInt DisplayType() const;
+
+private:
+
+    CAlfSrvDisplaySubSession( CAlfAppSrvSessionBase& aSession,
+                              const TRect& aRect,
+                              TInt aWindowGroupId,
+                              TInt aDisplayType,
+                              const TUid& aBufferUid );
+
+    void ConstructL();
+
+    void SetClearBackgroundL( const RMessage2& aMessage );
+    void SetVisibleAreaL( const RMessage2& aMessage, TBool aForce = EFalse );
+    void VisibleAreaL( const RMessage2& aMessage );
+    void SetDirtyL( const RMessage2& aMessage );
+    void SetQualityL( const RMessage2& aMessage );
+    void QualityL( const RMessage2& aMessage );
+    void SetUseDepthL( const RMessage2& aMessage );        
+    void SetUsageL( const RMessage2& aMessage );
+    void SetBackgroundItemsL( const RMessage2& aMessage );
+    void HandlePointerEventL( const RMessage2& aMessage );
+    void SuppressAutomaticFadingL( const RMessage2& aMessage );
+	void SetClientWindowForDrawingL( const RMessage2& aMessage );
+
+    /**
+     * Updates non fading to container.
+     */
+    void UpdateAutomaticFading();
+
+    // from subsessionbase
+    CHuiDisplay* AsHuiDisplay();
+    
+    TBool UseVisualAreaClipping();
+
+private: // data
+    
+    CHuiDisplay* iDisplay;
+    
+    TInt iDisplayType;
+    TUid iScreenBufferUid;
+    TRect iRect;
+    TInt iDisplayClearBackground;
+    TInt iDisplayRenderingQuality;
+    TBool iDisplayUseDepthTest;
+    TUint iDisplayUsage;
+    RArray<THuiDisplayBackgroundItem> iBackgroundItems;
+    TBool iAutomaticFadingSuppressed;
+    };
+
+#endif // C_ALFSRVDISPLAYSUBSESSION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfsrvdropshadowhandler.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Drop shadow handler
+*
+*/
+
+
+
+#ifndef ALFSRVDROPSHADOWHANDLER_H
+#define ALFSRVDROPSHADOWHANDLER_H
+
+#include <e32base.h>
+
+class CHuiDropShadow;
+
+/**
+ *  Drop shadow handler
+ *
+ *  @since S60 v5.0.1
+ */
+NONSHARABLE_CLASS( AlfSrvDropShadowHandler )
+    {
+public:
+
+    /**
+     * Checks if the command can be handled by this class
+     *
+     * @param aCommand Command to check.
+     *
+     * @return ETrue if this class can handle the command.
+     */
+    static TBool CanHandleCommand( TInt aCommand );
+    
+    /**
+     * Handles the command
+     *
+     * @param aDropShadow Drop shadow handler which is controlled by the command.
+     * @param aCommandId Command to execute.
+     * @param aInputBuffer Input parameter buffer for the command.
+     * @param aResponse Response buffer.
+     */
+    static void HandleCommandL( 
+        CHuiDropShadow& aDropShadow,
+        TInt aCommandId, 
+        const TDesC8& aInputBuffer, 
+        TDes8& aResponse );
+
+    };
+
+#endif // ALFSRVDROPSHADOWHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfsrvresourcemanager.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Manager for cross-session resources.
+*
+*/
+
+
+
+#ifndef C_ALFSRVRESOURCEMANAGER_H
+#define C_ALFSRVRESOURCEMANAGER_H
+
+#include <e32base.h>
+#include <hwrmlight.h>
+#include <uiacceltk/HuiEnv.h>
+
+class CAlfAppSrvSessionBase;
+
+/**
+ *  Manager for cross-session resources.
+ *
+ *  Handles the scheduler pausing when the lights go off or the 
+ *  application server goes into the background. 
+ *
+ *  This class is a candidate for adding logic when 
+ *  releasing/restoring textures based on the cache side.
+ *
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS( CAlfSrvResourceManager ): 
+    public CBase, 
+    public MHWRMLightObserver
+    {
+    
+public:
+
+    /**
+     * Two-phased constructor
+     *
+     * @param aEnv Environment.
+     * @return New object. Ownership transfrerred.
+     */
+    static CAlfSrvResourceManager* NewL( CHuiEnv& aEnv );
+    
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfSrvResourceManager();
+
+    /**
+     * Called when the visibility of the appserver window changes.
+     *
+     * @param aVisible ETrue if the window is fully/partially visible
+     *                 EFalse if the window is totally hidden
+     */
+    void SetServerWindowPartiallyVisible( TBool aVisible );
+    
+    /**
+     * Called when the active session changes.
+     *
+     * @param aSession Can be NULL.
+     */
+    void SetActiveSession( CAlfAppSrvSessionBase* aSession );
+
+private:
+
+    /**
+     * Constructor
+     */
+    CAlfSrvResourceManager( CHuiEnv& aEnv );
+    
+    /**
+     * Constructor
+     */
+    void ConstructL();
+    
+    /**
+     * From MHWRMLightObserver
+     *
+     * Called when light status changes.
+     */
+    void LightStatusChanged(TInt aTarget, CHWRMLight::TLightStatus aStatus);
+    
+    /**
+     * Updates the scheduler state based on the current status.
+     */
+    void UpdateSchedulerState();
+    
+    /**
+     * Restarts the scheduler.
+     */
+    void Run();
+    
+    /**
+     * Pauses the scheduler.
+     */
+    void Pause();
+    
+    /**
+     * Return ETrue if any display lights are on
+     * @return ETrue if display lights are ON.
+     */
+    TBool LightsOn() const;
+
+private: // data
+
+    /**
+     * Environment. 
+     * Not own.
+     */
+    CHuiEnv& iEnv;
+    
+    /**
+     * Currently active session. Can be NULL. 
+     * Not own.
+     */
+    CAlfAppSrvSessionBase* iActiveSession;
+        
+    /**
+     * Internal flags.
+     */
+    TUint iFlags;
+    
+    /**
+     * Lights controller/observer.
+     * Own.
+     */
+    CHWRMLight* iLight; 
+    };
+
+#endif // C_ALFSRVRESOURCEMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfsrvscreenbuffermanager.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,187 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Server side screen buffer manager
+*
+*/
+
+
+
+#ifndef C_ALFSRVSCREENBUFFERMANAGER_H
+#define C_ALFSRVSCREENBUFFERMANAGER_H
+
+#include <e32base.h>
+#include <alf/alfconstants.h> 
+#include <uiacceltk/HuiDisplay.h> 
+
+class CAlfAppSrvSessionBase;
+class CAlfAppServer;
+
+/**
+ *  Server side screen buffer manager
+ *
+ *  The class handles off-screen buffer events and observers.
+ *
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS(CAlfSrvScreenBufferManager) : public CBase, public MHuiScreenBufferObserver
+    {   
+    
+public:
+
+    /**
+     * Two-phased constructor.
+     *
+     * @param aAppServer Alf application server instance
+     * @return new instance of CAlfSrvScreenBufferManager.
+     */
+    static CAlfSrvScreenBufferManager* NewL(CAlfAppServer& aAppServer);
+
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfSrvScreenBufferManager();
+    
+    /**
+     * Add a new observer.
+     *
+     * @param aSession Client session.
+     * @param aMessage Client message.
+     */
+	void AddScreenBufferObserver(CAlfAppSrvSessionBase* aSession, const RMessage2& aMessage);
+	
+    /**
+     * Remove an observer.
+     *
+     * @param aSession Client session.
+     * @param aMessage Client message.
+     */
+	void RemoveScreenBufferObserver(CAlfAppSrvSessionBase* aSession, const RMessage2& aMessage);
+	
+    /**
+     * Request a next frame and buffer from Hui display. Unlocks the display.
+     *
+     * @param aSession Client session.
+     * @param aMessage Client message.
+     */
+	void RequestNextBuffer(CAlfAppSrvSessionBase* aSession, const RMessage2& aMessage);
+	
+    /**
+     * Draw an off-screen buffer to the internal window.
+     *
+     * @param aSession Client session.
+     * @param aMessage Client message.
+     */
+	void RequestBufferDraw(CAlfAppSrvSessionBase* aSession, const RMessage2& aMessage);
+	
+    /**
+     * Request a general screen buffer event.
+     *
+     * @param aSession Client session.
+     * @param aMessage Client message.
+     */
+	void RequestScreenBufferEvent(CAlfAppSrvSessionBase* aSession, const RMessage2& aMessage);
+	
+    /**
+     * Remove all observer items related to this client session.
+     *
+     * @param aClientId Client session.
+     */
+	void RemoveScreenBufferObservers(CAlfAppSrvSessionBase* aClientId);
+	
+    /**
+     * Trigger a screen buffer event.
+     *
+     * @param aEvent Event to be triggered.
+     * @return Return true if there is a handler for the event.
+     */
+	TBool TriggerScreenBufferEvent(TAlfScreenBufferEvent& aEvent);
+	
+private: // internals
+
+    CAlfSrvScreenBufferManager(CAlfAppServer& aAppServer);    
+
+    void ConstructL();
+
+	TInt InitScreenBufferDisplay(TAlfScreenBufferBitmaps& aEvent, CHuiDisplay*& aFoundDisplay);
+
+	struct TScreenBufferObserverItem;	
+	
+	TBool TriggerScreenBufferCompleteEvent(TAlfScreenBufferEvent& aEvent);
+		
+	void FindScreenBufferDisplay(TUid aBufferUid, CHuiDisplay** aDisplay);
+
+	TInt RemoveAndReturnScreenBufferObserver(TScreenBufferObserverItem& aItem);
+
+	TBool ScreenBufferObserverExists(const TUid& aScreenBufferUid);
+	
+	TInt FindFromScreenBufferArray(
+	        const CAlfSrvScreenBufferManager::TScreenBufferObserverItem& aItem, 
+	        TInt& aIndex) const;
+
+	static TInt InsertFunc(
+	        const CAlfSrvScreenBufferManager::TScreenBufferObserverItem& aFirst, 
+	        const CAlfSrvScreenBufferManager::TScreenBufferObserverItem& aSecond );
+
+private: // From MHuiScreenBufferObserver
+	
+    TBool ScreenBufferComplete(TUid aUid, TRect& aDisplayRect, TRect& aDirtyRect);
+
+    void HandleScreenBufferEvent(TUid aUid, TInt aEvent);
+
+private:
+
+	/** The array item struct for screen buffer observers */
+   	struct TScreenBufferObserverItem
+        {
+        TScreenBufferObserverItem():
+        	iBufferUid(KNullUid), 
+        	iPriority(0), 
+        	iFlags(0), 
+        	iHuiDisplay(NULL), 
+        	iSession(NULL),  
+        	iNextEventId(0) {};
+        	
+        TScreenBufferObserverItem(TUid aBufferUid, TInt aPriority, TInt aFlags, CHuiDisplay* aHuiDisplay, CAlfAppSrvSessionBase* aSession, TInt aNextEventId):
+        	iBufferUid(aBufferUid), 
+        	iPriority(aPriority), 
+        	iFlags(aFlags), 
+        	iSession(aSession), 
+        	iHuiDisplay(aHuiDisplay), 
+        	iNextEventId(aNextEventId) {};
+        
+        /** Screen buffer uid */
+        TUid iBufferUid; 
+        /** Screen buffer priority */
+        TInt iPriority; 
+        /** Flags */
+        TInt iFlags; 
+        /** Pointer to the hui display */
+        CHuiDisplay* iHuiDisplay; 
+        /** Session */
+        CAlfAppSrvSessionBase* iSession;
+        /** Message */
+        RMessagePtr2 iMessage;
+        /** Id of the next event, if any */
+        TInt iNextEventId;
+       };
+    
+    /** Alf application server object */
+    CAlfAppServer& iAlfAppServer;
+    
+	/** Array of screen buffer observers for all sessions and buffers */
+	RArray<CAlfSrvScreenBufferManager::TScreenBufferObserverItem> iScreenBufferObservers;    
+	
+    };
+
+#endif // C_ALFSRVSCREENBUFFERMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfsrvsettingshandler.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,128 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef C_ALFSRVSETTTINGSHANDLER_H
+#define C_ALFSRVSETTTINGSHANDLER_H
+
+#include <e32base.h>
+#include <uiacceltk/HuiRenderer.h>
+
+class CRepository;
+class MAlfSrvSettingsObserver;
+
+enum TAlfSrvRndFlags
+    {
+    EAlfSrvRndFlagFirst = 0x0100,
+    
+    // For drawing the dirty regions
+    EAlfSrvRndFlagDrawDirtyRegions = EAlfSrvRndFlagFirst,
+    
+    // For drawing visual outline for all visuals
+    EAlfSrvRndFlagDrawAllVisualOutline = EAlfSrvRndFlagFirst << 1, // 0x0200 if first 0x0100
+    // For drawing visual outline for selected visuals and their children
+    EAlfSrvRndFlagDrawSelectedVisualOutline = EAlfSrvRndFlagFirst << 2, // 0x0400 if first 0x0100
+
+    // To enable texture memory usage calculation
+    EAlfSrvRndFlagEnableTextureMemoryCalculation = EAlfSrvRndFlagFirst << 3 // 0x0800 if first 0x0100    
+    };
+
+/**
+ *  ?one_line_short_description
+ *
+ *  ?more_complete_description
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+NONSHARABLE_CLASS( CAlfSrvSettingsHandler ) : public CActive
+    {
+
+public:
+
+    static CAlfSrvSettingsHandler* NewL( MAlfSrvSettingsObserver& aObserver );
+
+    virtual ~CAlfSrvSettingsHandler();
+
+    /**
+     * ?description
+     *
+     * @since S60 ?S60_version
+     * @param ?arg1 ?description
+     * @param ?arg2 ?description
+     * @return ?description
+     */
+    THuiRenderer Renderer();
+    
+    TUint DefaultFramerate();
+    
+    TUint MaxCpuUsage();
+    
+    TUint MaxResourceCacheSize();
+    
+    TUint EffectsComplexityFactor();
+
+    TUint HWDriverConfiguration();
+    
+    TUint RndFlags();
+
+protected:
+
+// from base class CActive
+
+    /**
+     * From CActive
+     * Run loop of active object.
+     */
+    void RunL();
+    
+    /**
+     * From CActive
+     * Cancel execution.
+     */    
+    void DoCancel();
+    
+    /**
+     * From CActive
+     * Called on an error within the RunL loop. Performs any
+     * cleanup operations.
+     * @param aError The error that occured.
+     * @return the error.
+     */        
+    TInt RunError(TInt aError);
+
+private:
+
+    CAlfSrvSettingsHandler( MAlfSrvSettingsObserver& aObserver );
+
+    void ConstructL();
+    
+    void StartObserving();
+
+private: // data
+
+    /**
+     * ?description_of_member
+     */
+    MAlfSrvSettingsObserver& iObserver;
+    CRepository* iCentralRepository;
+    TUint iMaxCpuUsage; // Local cached value
+    };
+
+
+#endif // C_ALFSRVSETTTINGSHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfsrvsubsessionbase.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,177 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Sub session base
+*
+*/
+
+
+
+#ifndef C_ALFSRVSUBSESSIONBASE_H
+#define C_ALFSRVSUBSESSIONBASE_H
+
+#include <e32base.h>
+
+class CAlfAppSrvSessionBase;
+class MHuiVisualOwner;
+class CHuiVisual;
+class CHuiLayout;
+class CHuiBrush;
+class CHuiControl;
+class CHuiControlGroup;
+class MHuiMappingFunction;
+class CAlfBrushHandler;
+class MAlfExtension;
+class CHuiDisplay;
+
+/**
+ *  Sub session base.
+ *
+ *  @lib alfappservercore.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS(CAlfSrvSubSessionBase) : public CObject
+    {
+
+public:
+
+    /**
+    * Public constructor
+    */
+    CAlfSrvSubSessionBase( CAlfAppSrvSessionBase& aSession );
+
+    /**
+    * static c-tor
+    */
+    static CAlfSrvSubSessionBase* NewLC(const RMessage2& aMessage, 
+                                       TInt aImplementationUid,  
+                                       TInt aImplementationId,
+                                       CAlfAppSrvSessionBase& aSession);
+
+    /**
+     * Destructor
+     */
+    ~CAlfSrvSubSessionBase();
+    
+    /**
+     * Processes message.
+     *
+     * @param aMessage
+     */
+    void ProcessMessageL(const RMessage2& aMessage);
+
+    // Interfaces:
+    /**
+     * needed for visual factory, only subsessions having instance implementing the interface 
+     * should implement this virtual 
+     */
+    virtual MHuiVisualOwner* AsVisualOwner();
+
+    /**
+     * needed for visual factory, only subsessions having instance implementing the interface 
+     * should implement this virtual 
+     */
+    virtual CHuiControl* AsHuiControl();
+
+    /**
+     * needed for visual factory, only subsessions having instance implementing the interface 
+     * should implement this virtual 
+     */
+    virtual CHuiVisual* AsHuiVisual();
+
+    /**
+     * needed for visual factory, only subsessions having instance implementing the interface 
+     * should implement this virtual 
+     */
+    virtual CHuiLayout* AsHuiLayout();
+
+    /**
+     * needed for visual factory, only subsessions having instance implementing the interface 
+     * should implement this virtual 
+     */
+    virtual CHuiBrush* AsHuiBrush();
+
+    /**
+     * needed for visual factory, only subsessions having instance implementing the interface 
+     * should implement this virtual 
+     */
+    virtual MHuiMappingFunction* AsMappingFunction();
+
+    /**
+     * needed for visual factory, only subsessions having instance implementing the interface 
+     * should implement this virtual 
+     */
+    virtual CHuiControlGroup* AsHuiControlCroup();
+    
+    /**
+     * needed for visual factory, only subsessions having instance implementing the interface 
+     * should implement this virtual 
+     */
+    virtual CHuiDisplay* AsHuiDisplay();
+ 
+    /**
+     * needed for visual factory, only subsessions having instance implementing the interface 
+     * should implement this virtual 
+     */
+    virtual CAlfBrushHandler* AsBrushHandler();
+
+    /**
+     * Request to complete pending asynchornous request(s)  
+     * Initiated by client
+     */
+    virtual void CancelAsynchRequests();
+
+    virtual MAlfExtension* AsCommandHandler();
+
+    /**
+    * Public member for session to check what factory was used to create this
+    */
+    TInt iFactoryUid;
+
+protected:
+    
+    /**
+     * Processes message. Meant for child class to implement.
+     *
+     * @param aMessage
+     */
+    virtual void DoProcessMessageL(const RMessage2& aMessage);
+    
+    /**
+     * Returns the session this sub session belongs to.
+     *
+     * @return Session.
+     */
+    CAlfAppSrvSessionBase& Session();
+
+    /**
+     * must be base-called from deriving classes to finalize construction
+     */
+    virtual void ConstructL();
+
+private:
+    void ConstructL(const RMessage2& aMessage, 
+                    TInt aImplementationUid,  
+                    TInt aImplementationId );
+
+    
+private: // data
+
+    CAlfAppSrvSessionBase& iSession; 
+
+    class TPrivateData;                          
+    TPrivateData* iData;
+    };
+
+
+#endif // C_ALFSRVSUBSESSIONBASE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfsrvtexturemanager.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,365 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Server side texture manager
+*
+*/
+
+
+
+#ifndef C_ALFSRVTEXTUREMANAGER_H
+#define C_ALFSRVTEXTUREMANAGER_H
+
+#include <e32base.h>
+#include <uiacceltk/HuiTextureManager.h>
+
+class CHuiEnv;
+class CAlfAppSrvSession;
+class MAlfSrvTextureManagerClient;
+
+/**
+ *  Server side texture manager.
+ *
+ *  This texture manager is responsible for managing texture ids and
+ *  handling auto size textures.
+ *  
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CAlfSrvTextureManager ) 
+    : public CBase, 
+      private MHuiTextureAutoSizeObserver
+    {
+public:
+
+    /**
+     * Two-phased constructor.
+     * @return new instance of CAlfSrvTextureManager.
+     */
+    static CAlfSrvTextureManager* NewL();
+   
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfSrvTextureManager();
+
+    /**
+     * This will be called when environment has been created.
+     * @param aEnv reference to environment.
+     */
+    void HandleEnvCreateL( CHuiEnv& aEnv );
+
+    /**
+     * This will be called just before environment is deleted.
+     */
+    void HandleEnvToBeDeleted();
+
+    //
+    // Texture Id management
+    //
+
+    /**
+     * Creates new texture id.
+     * @param aClientOwnerId client owner id.
+     * @param aClientSideId client side id.
+     * @param aClientSideManagerId client side manager id.
+     * @param aReUseAnyDeletedId ETrue if reuse is allowed.
+     * @return texture id.
+     */
+    TInt CreateTextureId(
+        const TProcessId& aClientOwnerId, 
+        TInt aClientSideId, 
+        TInt aClientSideManagerId, 
+        TBool aReUseAnyDeletedId  );
+
+    /**
+     * Finds server side id based in client side id.
+     * @param aClientOwnerId client owner id.
+     * @param aClientSideId client side id.
+     * @param aClientSideManagerId client side manager id.
+     * @param aIgnoreOwnerForSharedTextures ignore owner.
+     * @return texture id.
+     */
+    TInt ExistingTextureId(
+        const TProcessId& aClientOwnerId, 
+        TInt aClientSideId, 
+        TInt aClientSideManagerId, 
+        TBool aIgnoreOwnerForSharedTextures = EFalse );
+
+    /**
+     * Releases texture id.
+     * @param aClientOwnerId client owner id.
+     * @param aClientSideId client side id.
+     * @param aClientSideManagerId client side manager id.
+     * @return reference count.
+     */
+    TInt ReleaseTextureId(
+        const TProcessId& aClientOwnerId,
+        TInt aClientSideId, 
+        TInt aClientSideManagerId );
+
+    /**
+     * Deletes texture id.
+     * @param aClientOwnerId client owner id.
+     * @param aClientSideId client side id.
+     * @param aClientSideManagerId client side manager id.
+     * @return reference count.
+     */
+    TInt DeleteTextureId(
+        const TProcessId& aClientOwnerId,
+        TInt aClientSideId, 
+        TInt aClientSideManagerId );
+
+    /**
+     * Validates skin for texture id.
+     * @param aClientOwnerId client owner id.
+     * @param aClientSideId client side id.
+     * @param aClientSideManagerId client side manager id.
+     * @return 1 if skin change coordinator already set, 0 otherwise.
+     */
+    TInt ValidateSkinForTextureId(
+        const TProcessId& aClientOwnerId,
+        TInt aClientSideId, 
+        TInt aClientSideManagerId );
+    
+    /**
+     * Destroyes deleted texture ids.
+     * @param aClientOwnerId client owner id.
+     * @return 0.
+     */
+    TInt DestroyDeletedTextureIds(const TProcessId& aClientOwnerId); 
+
+    //
+    // Auto size texture
+    //
+
+    /**
+     * Adds client for auto size textures handling.
+     * Note: Clients must remove itself upon destruction using 
+     *       @c RemoveClient method.
+     * @param aClientOwnerId client owner id.
+     * @param aClient reference to client interface.
+     */
+    void AddClientL( 
+        const TProcessId& aClientOwnerId, 
+        MAlfSrvTextureManagerClient& aClient );
+
+    /**
+     * Removes client.
+     * @param aClient client.
+     */    
+    void RemoveClient( MAlfSrvTextureManagerClient& aClient );
+        
+private:
+
+    /**
+     * Constructor.
+     */
+    CAlfSrvTextureManager();
+
+    /**
+     * Finds client side texture id based on server side id.
+     * Note that shared textures are ignored.
+     * 
+     * @param aServerSideId server side id.
+     * @param aClientSideId this is updated to contain client side id.
+     * @param aOwnerUid this is updated to contain owner uid.
+     * @return ETrue if found, EFalse otherwise.
+     */
+    TBool FindByTextureId( 
+        TInt aServerSideId,
+        TInt& aClientSideId,
+        TProcessId& aOwnerId ) const;
+
+    /**
+     * Finds index of client.
+     * @param aClient client to look for.
+     * @return index or KErrNotFound if not found.
+     */
+    TInt FindClient( MAlfSrvTextureManagerClient& aClient ) const;
+    
+    /**
+     * Finds client interface based on owner id. This one also
+     * marks corresponding client so that completion of auto size 
+     * changes is informed.
+     * 
+     * @param aOwnerId owner id.
+     * @return client interface, NULL if not found.
+     */
+    MAlfSrvTextureManagerClient* FindClientAndMark( 
+        const TProcessId& aOwnerId );
+
+    /**
+     * Notifies marked clients of completion of auto size events.
+     * This also clears marks.
+     */
+    void NotifyTextureSizeChangesCompleted();
+
+    /**
+     * Calculates index from value.
+     * @param aValue value from THuiTextureAutoSizeParams.
+     * @return index.
+     */
+    static TInt IndexFromParameter( TInt aValue );
+
+    /**
+     * Checks if resize is needed.
+     * @param aCurrentValue current height/width.
+     * @param aNewValue new height/width.
+     * @param aTexture reference to texture.
+     * @return ETrue if resize is needed, EFalse otherwise.
+     */
+    static TBool CheckIfShouldResize( 
+        TInt aCurrentValue, TInt aNewValue, const CHuiTexture& aTexture );
+
+    /**
+     * Checks if resize is needed.
+     * @param aCurrentSize current size.
+     * @param aNewSize new size.
+     * @param aTexture reference to texture.
+     * @param aDeliveryPriority this will contain delivery priority.
+     * @return ETrue if resize is needed, EFalse otherwise.
+     */
+    static TBool CheckIfResizeNeeded(
+        const TSize& aCurrentSize, const TSize& aNewSize,
+        const CHuiTexture& aTexture, TInt& aDeliveryPriority );
+
+    /**
+     * Rounds real value to integer.
+     * @param aValue value to be rounded.
+     * @return result value.
+     */
+    inline TInt RoundToInteger( const TReal32& aValue ) const;
+    
+    /**
+     * Calculates new size if resize is needed.
+     * @param aTexture reference to texture.
+     * @param aPreferredSize preferred size.
+     * @param aCurrentSize current size.
+     * @param aNewSize this will contain new size.
+     * @param aDeliveryPriority this will contain delivery priority.
+     * @return ETrue upon success, EFalse otherwise.
+     */
+    TBool CalculateNewSizeIfResizeNeeded( 
+        const CHuiTexture& aTexture, 
+        const THuiRealSize& aPreferredSize,
+        const TSize& aCurrentSize,
+        TSize& aNewSize,
+        TInt& aDeliveryPriority ) const;
+
+    /**
+     * This one decides new size for current texture.
+     * @param aClient client interface.
+     * @param aClientSideTextureId client side texture id.
+     * @param aTexture texture.
+     * @param aPreferredSize preferred size.
+     */
+    void HandlePreferredSizeChanged( 
+        MAlfSrvTextureManagerClient& aClient, 
+        TInt aClientSideTextureId, 
+        const CHuiTexture& aTexture, 
+        const THuiRealSize& aPreferredSize );
+
+// from base class MHuiTextureAutoSizeObserver
+
+    /**
+     * Handles preferred texture properties changes.
+     * @param aTexture texture.
+     * @param aServerSideTextureId server side texture id.
+     * @param aPreferredSize preferred size.
+     */
+    virtual TBool PreferredSizeChanged(const CHuiTexture& aTexture, 
+        TInt aServerSideTextureId, 
+        const THuiRealSize& aPreferredSize );
+
+    /**
+     * Handles completion of preferred size changes (for now).
+     */
+    virtual void PreferredSizeReportCompleted();
+
+private: // data
+
+    /**
+     * Pointer to environment.
+     * Not own.
+     */
+    CHuiEnv* iEnv;
+
+    /**
+     * Global value which is used to assign unique texture ids 
+     * in the serverside.
+     */
+    TInt iNextTextureId;
+
+    /**
+     * Structure containing information about a texture.
+     */
+    struct TUsedTexture 
+        {
+        TUsedTexture()
+            :iClientSideId(0), 
+             iClientSideManagerId(0), 
+             iServerSideId(0), 
+             iOwnerId(), 
+             iReleased(EFalse), 
+             iDeleted(EFalse),
+             iSkinChangeCoordinator(EFalse){}
+        
+        /** The client side texture id */
+        TInt   iClientSideId;
+        /** client side texture manager of the texture */
+        TInt32 iClientSideManagerId;                
+        /** The server side texture id */
+        TInt   iServerSideId;
+        /** Owner process of the texture */
+        TProcessId iOwnerId;
+        /** Released */
+        TBool iReleased;
+        /** Deleted */
+        TBool iDeleted;
+        /** Skin change coordinator for shared textures, only one entry with same id has this set to ETrue */
+        TBool iSkinChangeCoordinator;
+        };
+        
+    /** 
+     * Array of used textures. Items are not deleted from this array when 
+     * application exists because hitchcock texture manager does not delete
+     * textures either (only unloads).
+     * This array is used when texture is re-created again.
+     * Own.
+     */
+    RArray<TUsedTexture> iUsedTextures;
+
+    /**
+     * Structure defining mapping from owner id to
+     * client interface used for auto size textures.
+     */
+    struct TClientItem
+        {
+        TProcessId iOwnerId;
+        MAlfSrvTextureManagerClient* iClient;
+        TBool iIsMarked;
+        };
+        
+    /**
+     * Mapping from texture owner id to client interface.
+     * Own.
+     */
+    RArray< TClientItem > iClients;
+
+    /**
+     * Boolean flag indicating if renderer is OpenGL.
+     */
+    TBool iIsRendererHWA;
+    };
+
+#endif // C_CLASSNAME_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfsrvtranseffect.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,180 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Transition effect framework
+*
+*/
+
+
+
+
+#ifndef C_ALFTRANSEFFECT_H
+#define C_ALFTRANSEFFECT_H
+
+#include <uiacceltk/HuiEnv.h>
+#include <uiacceltk/huigifanimationtexture.h>
+
+#include "alf/AlfTransEffectPlugin.h"
+
+class CAlfCenRep;
+ 
+/**
+ * This class implements an effect framework that can be used to integrate 
+ * effects to Alf server. The class will call ECom plugins for actual effect
+ * implementations.
+ *
+ */
+NONSHARABLE_CLASS( CAlfSrvTransEffect ) : public CBase
+    {
+public:
+    
+    /**
+     * Destructor
+     */
+    ~CAlfSrvTransEffect();
+
+    /**
+     * Constructor
+     */
+    static CAlfSrvTransEffect* NewL();
+    
+    /**
+     * Returns the state of the effect system.
+     *
+     * @return Effect system boolean state.
+     */
+    TBool CAlfSrvTransEffect::IsEnabled();
+    
+    /**
+     * Starts a new phase in the effect.
+     *
+     * @param aPhaseId Phase that is started.
+     * @param aContext Effect context.
+     * @param aEffectEnv Effect environment for this session.
+     * @param aUidValue UID which effect is related to (e.g. current application UID).
+     * @param aKey Key which effect is related to (e.g. current application window group).
+     * @param aUidValue2 UID which effect is related to (e.g. previous application UID).
+     * @param aKey2 Key which effect is related to (e.g. previous application window group).
+     * @param aParams Other parameters.
+     * @return System error code.
+     */
+    TInt StartPhase( TInt aPhaseId, 
+    				 TInt aContext, 
+    				 CAlfSrvEffectEnv& aEffectEnv, 
+    				 TInt aUidValue = 0, 
+    				 TInt aKey = 0, 
+    				 TInt aUidValue2 = 0, 
+    				 TInt aKey2 = 0, 
+    				 const TDesC8* aParams = NULL);
+    
+    /**
+     * Returns an available control group based on its index. Zero as a parameter means "all".
+     *
+     * Not yet implemnted
+     *
+     * @param aContext Effect context that will be aborted. 
+     * @param aUidValue UID which effect is related to (e.g. current application UID).
+     * @param aKey Key which effect is related to (e.g. current application window group).
+     * @return System error code.
+     */
+    TInt Abort( TInt aContext = 0, 
+    			TInt aUidValue = 0, 
+    			TInt aKey = 0 );
+    
+    /**
+     * Not yet implemented
+     */
+    TInt SetProperty( TInt aProperty, TInt aValue, TInt aUidValue = 0, TInt aKey = 0 );
+    
+    /**
+     * Not yet implemented
+     */
+    TInt GetProperty( TInt aProperty, TInt& aValue, TInt aUidValue = 0, TInt aKey = 0 );
+    
+    /**
+     * Not yet implemented
+     */
+    TInt AddEventObserver( 
+            MAlfTransEffectObserver* aObserver, 
+            TInt aEvents, 
+            const TDesC8* aParams = NULL );
+    
+    /**
+     * Not yet implemented
+     */
+   	TInt RemoveEventObserver( MAlfTransEffectObserver* aObserver, TInt aEvents );
+    
+    /**
+     * Not yet implemented
+     */
+   	TInt GetEventState( TInt aEvent, TInt* aState, TDes8* aParams = NULL );
+    
+private:
+
+    /**
+     * Not yet implemented
+     */
+	struct TEffectMapItem
+		{
+		TEffectMapItem( TInt aEffectId, MAlfTransEffectPlugin* aPluginPtr) 
+			:iEffectId( aEffectId ), iPluginPtr( aPluginPtr )
+			{};
+		TInt iEffectId;
+		MAlfTransEffectPlugin* iPluginPtr;
+		};
+
+private:
+
+    /**
+     * Constructor
+     */
+    CAlfSrvTransEffect();
+
+    /**
+     * Second phase constructor.
+     */
+    void ConstructL();
+    
+    /**
+     * Fills the effect plugins and effect map arrays.
+     */
+    void PopulateEffectArrayL();
+    
+    /**
+     * Find the correct effect implementations for the context.
+     */
+    TInt FindPlugin( TInt aContext, MAlfTransEffectPlugin** aPlugIn );
+
+
+ private: // Data
+ 
+	// All effect plugins
+	RPointerArray<MAlfTransEffectPlugin> iEffectPlugins;
+	
+	// Map for linking contexts to the effect implementations. 
+	RArray<CAlfSrvTransEffect::TEffectMapItem> iEffectMap;
+	
+	// Listener for Avkon effect state
+	CAlfCenRep* iAvkonTfxStateListener;
+	
+	// Whether the effect system is enabled
+	TBool iIsEnabled;
+	
+	// Current context
+	TInt iCurrContext;
+	
+	// Current phase
+	TInt iCurrPhase;
+  	};
+
+#endif // C_ALFTRANSEFFECT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfsrvtransformationsubsession.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Transformation sub session.
+*
+*/
+
+
+
+#ifndef C_ALFSRVTRANSFORMATIONSUBSESSION_H
+#define C_ALFSRVTRANSFORMATIONSUBSESSION_H
+
+#include "alfsrvsubsessionbase.h"
+
+class CAlfAppSrvSessionBase;
+class CHuiTransformation;
+
+/**
+ *  Transformation sub session.
+ *
+ *  @lib alfappservercore.lib
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS(CAlfSrvTransformationSubSession): public CAlfSrvSubSessionBase
+    {
+
+public:
+
+    /**
+     * Two-phased constructor
+     *
+     * @param aSession Session in which this sub session belongs into.
+     * @return New object. Ownership transferred.
+     */
+    static CAlfSrvTransformationSubSession* NewL( CAlfAppSrvSessionBase& aSession );
+
+    /**
+     * Two-phased constructor. Leaves the objenct onto the cleanup stack.
+     *
+     * @param aSession Session in which this sub session belongs into.
+     * @return New object on stack. Ownership transferred.
+     */
+    static CAlfSrvTransformationSubSession* NewLC( CAlfAppSrvSessionBase& aSession );
+
+    /**
+     * Destructor.
+     */
+    virtual ~CAlfSrvTransformationSubSession();
+
+    /**
+     * Returns the used transformation.
+     *
+     * @return Used transformation.
+     */
+    CHuiTransformation& Transformation();
+    
+    /**
+     * Sets the used transformation.
+     *
+     * @param aTransformation Used transformation.
+     */
+    void SetTransformation( CHuiTransformation* aTransformation );
+    
+    /**
+     * From CAlfSrvSubSessionBase
+     * Processes the message.
+     *
+     * @param aMessage The message.
+     */
+    void DoProcessMessageL(const RMessage2& aMessage);
+
+private:
+
+    CAlfSrvTransformationSubSession( CAlfAppSrvSessionBase& aSession );
+
+    void ConstructL();
+
+    void LoadIdentityL(const RMessage2& aMessage);
+    void TranslateL(const RMessage2& aMessage);
+    void RotateL(const RMessage2& aMessage);
+    void CountL(const RMessage2& aMessage);
+    void NonIdentityCountL(const RMessage2& aMessage);
+    void StepL(const RMessage2& aMessage);
+    void ReplaceStepL(const RMessage2& aMessage);
+    void Rotate3DL(const RMessage2& aMessage);
+    void Scale3DL(const RMessage2& aMessage);
+    void Translate2DL(const RMessage2& aMessage);
+
+private: // data
+    
+    CHuiTransformation* iTransformation;
+    };
+
+#endif // C_ALFSRVTRANSFORMATIONSUBSESSION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfsrvvisualowner.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,83 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Alf server visual owner
+*
+*/
+
+
+
+#ifndef C_ALFSRVVISUALOWNER_H
+#define C_ALFSRVVISUALOWNER_H
+
+#include <uiacceltk/HuiVisual.h>
+
+class CAlfAppSrvSessionBase;
+
+/**
+ *  Alf server visual owner
+ *
+ *  The alfred component that owns an HUI visual.
+ *
+ *  @since S60 v3.2
+ */
+NONSHARABLE_CLASS(CAlfSrvVisualOwner) : public CBase, public MHuiVisualOwner
+    {
+    
+public:
+
+    static CAlfSrvVisualOwner* NewL( 
+        CAlfAppSrvSessionBase& aSession,
+        MHuiVisualOwner* aRealOwner );
+
+    virtual ~CAlfSrvVisualOwner();
+
+    /**
+     * ?description
+     *
+     * @since S60 ?S60_version
+     * @param ?arg1 ?description
+     * @param ?arg2 ?description
+     * @return ?description
+     */
+    MHuiVisualOwner* RealOwner();
+    
+    void SetVisualLayoutUpdatedNotificationId( TInt aNotificationId );
+
+protected:
+
+    CHuiEnv& Env() const;
+    CHuiControlGroup* ControlGroup() const;
+    MHuiEventHandler* EventHandler();
+    void AppendL(CHuiVisual* aVisual);
+    void Remove(CHuiVisual* aVisual);
+    void VisualDestroyed(CHuiVisual& aVisual);
+    void VisualLayoutUpdated(CHuiVisual& aVisual);
+    void VisualPrepareDrawFailed(CHuiVisual& aVisual, TInt aErrorCode);
+
+private:
+
+    CAlfSrvVisualOwner( 
+        CAlfAppSrvSessionBase& aSession,
+        MHuiVisualOwner* aRealOwner );
+
+    void ConstructL();
+
+private: // data
+
+    CAlfAppSrvSessionBase& iSession;
+    MHuiVisualOwner* iRealOwner;
+    TInt iVisualLayoutUpdatedNotificationId;
+    };
+
+#endif // C_ALFSRVVISUALOWNER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfstaticfactory.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   factory for alf built-in hitchcock compenents
+*
+*/
+
+
+
+#ifndef __ALFSTATICFACTORY__
+#define __ALFSTATICFACTORY__
+
+#include <alf/alfextensionfactory.h> 
+
+NONSHARABLE_CLASS(TAlfFixedFactory):public MAlfExtensionFactory
+    {
+    MAlfExtension* CreateExtensionL(
+            const TInt aObjectId, 
+            const TDesC8& aInitialParams, 
+            MAlfInterfaceProvider& aResolver );
+    
+    void Release();
+    };
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerbridge.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,356 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Interthread synchronization object
+*
+*/
+
+
+#ifndef __ALF_STREAMER_BRIDGE__
+#define __ALF_STREAMER_BRIDGE__
+
+#include <e32std.h>
+#include <e32base.h>
+#include <fbs.h>
+#include "alfbridgecommands.h"
+#include "uiacceltk/HuiEnv.h"
+#include "alfstreamerconsts.h"
+
+
+class CAlfStreamerServer;
+class CAlfCommandDebug;
+
+const TInt KInitialVariableBufferSize = 2000;
+
+// basic signalling for frame flow control
+const TInt KRELEASEWINDOWSERVER = 0;
+const TInt KRELEASEDBEFOREQUEUE = 1;
+
+
+//TODO THESE SHOULD USE MWsWindowTreeNode::TType INSTEAD
+enum TAlfWindowNodeType
+    {
+	EAlfWinTreeNodeClient = 0,	
+	EAlfWinTreeNodeRoot = 1,		
+	EAlfWinTreeNodeGroup = 2,		
+	EAlfWinTreeNodeAnim = 16,		
+	EAlfWinTreeNodeSprite = 17,
+	EAlfWinTreeNodeTextCursor = 18,
+	EAlfWinTreeNodeFloatingSprite = 19 // TODO SOLVE THIS. THIS IS VERY MISLEADING ARRANGAMENT!
+	};
+
+enum TAlfWindowNodeFlags
+    {
+    EAlfWinNodeFlagOpaque = 0x1            
+    };
+
+class TAlfWindowAttributes
+    {
+public:
+    TAlfWindowAttributes() :    
+        iWindowNodeType(0),
+        iPosition(0,0),
+        iSize(0,0),
+        iOrdinalPosition(0),
+        iOpacity(1.f),
+        iRotation(0.f),
+        iTransitionTime(0),
+        iActive(ETrue),
+        iSurfaceExtent(0,0,0,0),
+        iLayerUsesAlphaFlagEnabled(EFalse),
+        iClientHandle(0),
+        iClientGroupHandle(0),
+        iWindowNodeFlags(0),
+        iScreenNumber(0),
+        iSecureId(0),
+        iParentNodeId(0)
+#ifdef ALF_DEBUG_TRACK_DRAWING
+        ,iTrackWindow(EFalse)
+#endif
+            {
+            }
+    
+    TInt    iWindowNodeType; // MWsWindowTreeNode::TType
+    TPoint  iPosition;        
+    TSize   iSize;
+    TInt    iOrdinalPosition;
+    TReal32 iOpacity;
+    TReal32 iRotation;
+    TUint   iTransitionTime;
+    TBool   iActive;
+    TRect   iSurfaceExtent;
+    TBool   iLayerUsesAlphaFlagEnabled;
+    TInt    iClientHandle;
+    TInt    iClientGroupHandle;
+    TInt    iWindowNodeFlags;
+    TInt    iScreenNumber;
+    TInt    iBitmapHandle;
+    TInt32  iSecureId;
+    TInt    iParentNodeId;
+#ifdef ALF_DEBUG_TRACK_DRAWING	
+    TBool   iTrackWindow;
+#endif	
+    // TODO: We should refactor this to contain unions or 
+    // different strcuts for different commands, 
+    // every command does not use everything
+    
+    };
+
+class TAlfCursorDataBufferAttributes
+    {
+public:
+    TInt iColor;
+    TInt iFlashInterval;
+    TInt iFlags;
+    TInt iScreenNumber;
+    };
+
+
+class TAlfWindowCommandBufferAttributes
+    {
+
+public:
+    enum TAlfBufferStatus 
+    {
+		EPartComplete,
+		ENotComplete,
+		ELastPart
+    }; 
+
+    TAlfWindowCommandBufferAttributes() :    
+        iBufferLength(0),
+        iBuffer(NULL),
+        iEmptyThisBuffer(ETrue),
+        iPartStatus(EPartComplete),
+        iWindowNodeFlags(0)        
+
+            {
+            }
+    TInt    iBufferLength;
+    TAny*   iBuffer;
+    TBool   iEmptyThisBuffer;
+    TAlfBufferStatus   iPartStatus;
+    TInt    iWindowNodeFlags;
+    TInt    iScreenNumber;
+    };
+
+class MAlfStreamerListener
+    {
+    public:
+    virtual void HandleCallback(TInt aStatus) = 0;
+    };
+
+class MAlfBatchObs
+    {
+    public:
+    virtual void BridgerCallback( TInt aOp = 0, TInt aInt = 0) = 0;
+    virtual void BridgerCanceled() = 0;
+    };
+
+class TAlfBridgerData
+    {
+    private:
+
+    public:
+    TAlfBridgerData()
+        {
+        ResetEntry();
+        }
+    
+    void Set(TAlfDecoderServerBindings aOp,TInt aI1,TInt aI2,TAny* aPtr)
+        {
+        iOp=aOp;
+        iInt1=aI1;
+        iInt2=aI2;
+        iPtr=aPtr;        
+        }
+    
+    void ResetEntry()
+        {
+        Set(KUnInitialized,0,0,0);
+        }    
+    
+    TBool IsEmpty()
+        {
+        return iOp == KUnInitialized;        
+        }
+    
+    TAlfDecoderServerBindings iOp;
+    TInt iInt1;
+    TInt iInt2;
+    TAny* iPtr;
+    };
+
+
+NONSHARABLE_CLASS(CAlfStreamerBridge): public CActive, public CHuiEnv::MHuiSwapObserver
+
+    {
+    public:
+   
+    CAlfStreamerBridge(MAlfStreamerListener* aObserver);
+
+    static CAlfStreamerBridge* NewL( MAlfStreamerListener* aObserver );
+
+private:
+        
+    void ConstructL();
+
+    ~CAlfStreamerBridge();
+    
+public:
+        
+    /**
+     * SetBatchObserver
+     *
+     * @since S60 5.0
+     * @param aWindow
+     */
+    void SetBatchObserver(MAlfBatchObs* aBatchObserver);
+    
+    /**
+     * Activate
+     *
+     * @since S60 5.0
+     * @param aWindow
+     */    
+    void Activate();
+         
+    /**
+     * Trigger
+     *
+     * @since S60 5.0
+     */
+    TInt Trigger(TInt aStatus);
+  
+    /**
+     * AddData
+     *
+     * @since S60 5.0
+     * @param aWindow
+     */
+    TInt AddData( TAlfDecoderServerBindings aOp,TInt aI1 = 0,TInt aI2 = 0,TAny* aPtr =0);
+    
+    /**
+     * GetData
+     *
+     * @since S60 5.0
+     * @param aWindow
+     */
+    TAlfBridgerData GetData(TInt aIndex);
+    
+    /**
+     * StartNewBlock
+     *
+     * @since S60 5.0
+     */
+    void StartNewBlock();
+
+    /**
+     * StartNewBlock
+     *
+     * @since S60 5.0
+     * @param aLastReadOffset
+     */
+    void RequestCommandReadNotification( 
+            TInt aLastReadOffset, 
+            TAlfDecoderServerBindings aCommand = EAlfRequestCommandReadNotification );
+
+    // AppendDataL and GetVarDataL are for keeping the memory allocations inside one thread.    
+    IMPORT_C const TAny* AppendVarDataL( TInt aSize, TInt& aIndex );
+
+    // Effect data is not synchronized to window server data
+    // It can be safely applied only when refresh is not active in hitchcock scene    
+    IMPORT_C const TAny* AppendEffectsDataL( TInt aSize, TInt& aIndex );
+    const TAny* GetEffectsDataL( TInt aIndex );
+
+    
+    /**
+     * GetVarDataL
+     *
+     * @since S60 5.0
+     * @param aIndex Offset to the data struct  (relative to iDataBuf)
+     * @return Pointer to the data struct 
+     */
+    const TAny* GetVarDataL( TInt aIndex );
+
+    
+	/**
+     * SetStreamerServer()
+     *
+     * Sets Streamserver instance. 
+     */
+    void SetStreamerServer( CAlfStreamerServer& aStreamerServer );
+    /**
+     * StreamerServer()
+     *
+     * Gets Streamserver instance set with set functionality.
+	 * @see SetStreamerServer()
+     */
+    CAlfStreamerServer* StreamerServer();
+
+    IMPORT_C TUid FindAppUidForWgId(TInt aWgId);
+    IMPORT_C TInt FindWgForAppUid(TUid aAppUid);
+
+public: // from CActive
+        
+    void RunL();
+    
+    void DoCancel();
+    
+public: // from SwapObserver
+    void PrepareSwap();
+    void SwapComplete();
+    void ReleaseWindowServer(TBool aRelease = ETrue);
+    void SetWgIdArray(TInt* aArray); 
+    
+private:
+        
+    MAlfStreamerListener* iObserver;
+   
+    MAlfBatchObs* iBatchObserver;
+    
+    TThreadId iThread;
+    
+    RArray<TAlfBridgerData> iMessages;
+    
+    RArray<TInt> iQueue;
+    
+    RCriticalSection iQueueSema;
+    
+    RBuf8 iDataBuf;
+   
+    TInt iItemsInBuffer;
+
+    RArray<TAlfBridgerData> iFxMessages;
+    RArray<TInt> iFxQueue;
+    RBuf8 iFxBuf;
+    TInt iFxItemsInBuffer;
+    
+    CAlfStreamerServer* iStreamerServer;
+#ifdef ALF_DEBUG_TRACK_DRAWING    
+    CAlfCommandDebug* iCommandDebugger;
+#endif
+    
+    volatile TBool iSwapActive;
+    volatile TBool iMakeCurrentActive;
+
+    TBool iFxQueueActive;
+    TInt* iWgArray;
+    TBool iVarDataAddedButNotPosted;
+public:
+    TAlfNativeWindowData iAlfWindowData;
+
+    };
+
+
+#endif // __ALF_STREAMER_BRIDGE__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerconsts.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   IPC command ids for server and client 
+*
+*/
+
+
+
+#ifndef __ALFSTREAMERCONSTS_H__
+#define __ALFSTREAMERCONSTS_H__
+
+#include "alfstreameruids.h"
+
+enum 
+    {
+    EAlfDecodSLoadPlugin,
+    EAlfDecodSUnloadPlugin,
+    EAlfDecodSSendSynch,
+    EAlfDecodSSendAsynch,
+    EAlfDecodSCancelAsynch,
+    EAlfDecodSPrepareFrame,
+    EAlfBridgerAsyncronousData,
+    EAlfBridgerSendChunk,
+    EAlfBridgerSendSyncData,
+    EAlfBridgerRequestDataBlock,
+    EDsNotifyNativeWindowData,
+    EAlfBridgerBlindSend,
+    EAlfSetScreenRotation, 
+    EAlfGetNativeWindowHandles
+    };
+
+enum TAlfCompOps{
+    KAlfCompOpCreateSource = 15000,   
+    KAlfCompOpCreateToken,
+    KAlfCompOpBindSourceToToken,
+    KAlfCompOpEnableAlpha,
+    KAlfCompOpSetOpacity,
+    KAlfCompOpSetRotation, 
+    KAlfCompOpSetZOrder,
+    KAlfCompOpSetExtent,
+    KAlfCompOpEnableKb,
+    KAlfCompOpRequestEvent,
+    KAlfCompOpCancelEventRequest,
+    KAlfComOpSetBackgroundAnim,
+    KAlfCompOpSessionClosed,
+    KAlfCompOpSetSRect,
+    
+    KAlfCompositionFrameReady = 16000,
+    KAlfCompositionLowOnGraphicsMemory,
+    KAlfCompositionTargetHidden,
+    KAlfCompositionTargetCreated,
+    KAlfCompositionWServReady,
+    KAlfCompositionWServScreenNumber,
+    KAlfCompositionSourceScreenNumber,
+    KAlfCompositionGoodOnGraphicsMemory,
+    KAlfCompositionTargetVisible
+    
+    };
+
+struct TAlfNativeWindowData
+    {
+    TInt  iScreenNumber;
+    TInt  iAlfWindowGrpId;
+    TUint iAlfWindowHandle;
+    };
+    
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfstreamerserver.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Server declaration, internal for Nokia
+*
+*/
+
+
+
+#ifndef __ALF_STREAMER_SERVER_H__
+#define __ALF_STREAMER_SERVER_H__
+
+#include "graphics/surface.h"
+#include "themerepositorylistener.h"
+
+class CAlfStreamerServerSession;
+class CAlfStreamerBridge;
+class CAlfWindowManager;
+class CAlfHierarchyModel;
+class TSurfaceId;
+
+NONSHARABLE_CLASS(CAlfStreamerServer): public CServer2
+    {
+public:
+    static TInt LaunchServer(TThreadId& aThreadId, CAlfStreamerBridge* aBridge );
+    static void NewLC(CAlfStreamerBridge* aBridge);
+	~CAlfStreamerServer();
+    void HandleClientExit(const CSession2* aClient);
+    CAlfWindowManager* WindowMgr() 
+        {
+        return iWindowMgr;
+        }
+    CAlfStreamerBridge* Bridge()
+        {
+        return iBridge;
+        }
+
+    CAlfHierarchyModel* WindowTree()
+        {
+        return iWindowHierarcy;
+        }
+
+    /** composition control **/
+    void AppendCompositionSessionL(CAlfStreamerServerSession* aSession, TBool aHost = EFalse );
+    void RemoveCompositionSession(CAlfStreamerServerSession* aSession);
+    void HandleCompositionRequestL(CAlfStreamerServerSession* aSession, TInt aOp, const RMessage2& aMessage);
+    void QueueRequestForSessionL(CAlfStreamerServerSession* aSession, const TPtrC8& aPtr, TInt aOp);
+    void QueueRequestAllSessionsL(const TPtrC8& aPtr, TInt aOp, TBool aAlsoWserv = EFalse);   
+    void HandleCompositionEventL(CAlfStreamerServerSession* aSession, TInt aOp, const RMessage2& aMessage);
+
+    TInt CreatePermissionToken(const RMessage2& aMessage, TInt aTarget, CAlfStreamerServerSession* aSession);
+    void ValidateToken(CAlfStreamerServerSession* aSession, const RMessage2& aMessage);
+
+    void FreeCompositionSessionExtents(CAlfStreamerServerSession* aSession);
+    
+private:
+    void ConstructL();
+
+    CAlfStreamerServer( CAlfStreamerBridge* aBridge):
+        CServer2(CActive::EPriorityStandard), iBridge(aBridge){}
+	
+    CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
+
+    CAlfStreamerServerSession* WservSession(TInt aScreenNumber);
+    
+private:
+    CAlfStreamerBridge* iBridge; // not owned
+    mutable TUint iSessions;
+    CAlfWindowManager* iWindowMgr;
+    CAlfHierarchyModel* iWindowHierarcy;
+    CThemeRepositoryListener* iThemesListener;
+    
+    RPointerArray<CAlfStreamerServerSession> iCompositionSessions;
+    RPointerArray<CAlfStreamerServerSession> iCompositionHostSessions;
+    RPointerArray<CAlfStreamerServerSession> iWindowServerSessions;
+    
+    class CCompositionToken : public CBase
+    {   
+    public:
+        
+        /*
+         * CCompositionToken is used by CAlfCompositionSource and CAlfCompositionHost
+         * for maintaining layer sharing permissions.
+         */
+        CCompositionToken( TInt aKey, TInt aSecretKey, TInt aFlags, TInt aTarget, TInt aScreenNumber, TBool aCombinedTarget = EFalse) : 
+            iKey(aKey),
+            iSecretKey(aSecretKey), 
+            iFlags(aFlags),
+            iTarget(aTarget),
+            iScreenNumber(aScreenNumber),
+            iCombinedTarget(aCombinedTarget){};
+        
+            TInt iKey;
+            TInt iSecretKey;
+            TInt iFlags;
+            TInt iTarget;
+            TInt iScreenNumber;
+            TBool iCombinedTarget;
+    };
+    
+    RArray<CCompositionToken> iCompositionTokens;
+    CAsyncCallBack * iRendezvous;
+    };
+
+NONSHARABLE_CLASS(CAlfStreamerServerSession): public CSession2
+    {
+public:
+    CAlfStreamerServerSession();
+    ~CAlfStreamerServerSession();
+    void ServiceL(const RMessage2& aMessage);
+    void HandleCompositionOpL(TInt aOp, const RMessage2& aMessage, CAlfStreamerServer* aServer);
+    RMessagePtr2& MessagePtr()
+        {
+        return iMessagePtr;
+        }
+    TBool CompletedFromQueue(const RMessage2& aMessage);
+    void QueueL(const TPtrC8& aPtr, TInt aCmd);    
+    
+    void SetScreenNumber(TInt aScreennumber);
+    TInt ScreenNumber() const;
+    TSurfaceId& ExtentSurfaceId();
+    
+private:
+    RArray<TInt> iLoadedPlugins;
+    RArray<TInt> iCmds;
+    RPointerArray<HBufC8> iQueue;
+    TBool iIsListeningCompositionEvents;
+    RMessagePtr2 iMessagePtr;
+    
+    // Number of the screen where composition client has its window.
+    // KErrNotFound if composition client does not have a window at all.
+    TInt iScreenNumber;
+    
+    // Surface id of the composition client. If composition client has set extent to some other screen than where its actual window is. 
+    // This is used to identify layers created for this composition client 
+    TSurfaceId iExtentSurfaceId;  
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfstreameruids.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Uid definitions for server and client 
+*
+*/
+
+
+
+#ifndef __ALFSTREAMERUIDS_H__
+#define __ALFSTREAMERUIDS_H__
+
+#define KDLLUID 0xabbadaba
+#define KDLLUID2 0xdabaabba
+
+#define KServerUid3 TUid::Uid(KSERVERUID)
+
+#define ALFSTREAMER_SERVER_NAME _L("alfstreamerserver")
+_LIT(KAlfStreamerServerThreadName,"AlfStreamerServerThread");
+_LIT(KAlfStreamerServerSemaphoreName,"AlfStreamerServerSemaphore");
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alftextstylehandlers.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of alfred server side text style message handlers.
+*
+*/
+
+
+
+#ifndef ALFTEXTSTYLEHANDLERS_H
+#define ALFTEXTSTYLEHANDLERS_H
+
+#include <alf/alfextensionfactory.h>
+
+class THuiTextStyle;
+
+/**
+ * Server - side handler object for CAlfTextStyle. Processes CAlfTextStyle commands
+ * and passes them onwards to Hitchcockcore THuiTextStyle.
+ */
+NONSHARABLE_CLASS(TAlfTextStyleHandler) : public MAlfExtension
+{
+public:
+
+	/**
+	 * Creates a new platform text style handler
+	 *
+	 * @param aResolver 	The alf interface provider.
+	 *
+	 * The meaning of parameters aId1 and aId2 depends on the requested construction type.
+	 *
+	 * When aConstructionType is EAlfPlatformTextStyleCreate:
+	 *
+	 * Creates a new platform text style handler based on passed in font style id and
+	 * parent id.
+	 * 
+	 * @param aId1 	The platform specific font style id to be used to create this platform
+	 * 				text style.
+	 * @param aId2	Id of the parent text style.
+	 *
+	 *
+	 * When aConstructionType is EAlfPreconfiguredTextStyleCreate:
+	 *
+	 * Creates a representation of a preconfigured text style.
+	 * 
+	 * @param aId1	Id of the preconfigured text style to represent with this handler.
+	 *
+	 *
+	 * When aConstructionType is EAlfPlatformTextStyleCopy:
+	 *
+	 * Creates a new platform text style handler for new text style created from an existing
+	 * text style.
+	 * 
+	 * @param aId1	Id of the existing text style to be used to create this text style.
+	 */
+	TAlfTextStyleHandler(MAlfInterfaceProvider& aResolver, TInt aId1, TInt aId2, TInt aConstructionType);
+
+
+	/**
+	 * Releases this text style handler.
+	 */
+    void Release();
+    
+    /**
+     * Returns the associated Hithcockcore interface object.
+     */
+    TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    
+    /**
+     * Handles the incoming commands from the client side associated with this text style.
+     */
+    void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);
+    
+    /**
+     * Returns the text style id of associated THuiTextStyle object.
+     */
+    TInt TextStyleId() const;
+    
+private:
+	
+    MAlfInterfaceProvider& iResolver; // Not owned
+    THuiTextStyle* iTextStyle; // Not owned
+};
+
+#endif // ALFTEXTSTYLEHANDLERS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfwindow.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,370 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __ALFWINDOW_H__
+#define __ALFWINDOW_H__
+
+#include <e32base.h>
+#include <alfwindowstructs.h>
+#include <bitstd.h>
+
+class CAlfWindowManager;
+class TAlfWServInfo;
+class CAlfWindowBuffer;
+class CAlfWindowFxPlugin;
+class TAlfWindowAttributes;
+class TAlfWindowCommandBufferAttributes;
+
+class TAlfWindowData;
+    
+/**
+ *  CAlfWindow
+ *
+ * The class is used for abstracting different pixel data presentations
+ *
+ *  @lib alfappservercore.dll
+ *  @since S60 5.0
+ */
+NONSHARABLE_CLASS(CAlfWindow): public CBase
+    {
+public:
+
+    static CAlfWindow* NewL(TUint aId, CAlfWindowManager& aOwner, const TSize& aSizeInPixels);
+    
+    virtual ~CAlfWindow();
+        
+public: 
+    // getters
+    
+    /**
+     * WsInfo
+     *
+     * @since S60 5.0
+     * @return  Specific wserv window data. For reference only.
+     */
+    IMPORT_C const TAlfWServInfo& WsInfo() const;
+    
+    /**
+     * Position
+     *
+     * @since S60 5.0
+     * @return  Position of the window
+     */
+    IMPORT_C TPoint Position() const;
+    
+    /**
+     * Size
+     *
+     * @since S60 5.0
+     * @return  The size of the window
+     */
+    IMPORT_C TSize Size() const;
+    
+    /**
+     * Opacity
+     *
+     * @since S60 5.0
+     * @return  The opacity of the window
+     */
+    IMPORT_C TReal32 Opacity() const __SOFTFP;
+    
+    /**
+     * Rotation
+     *
+     * @since S60 5.0
+     * @return  The rotation of the window
+     */
+    IMPORT_C TReal32 Rotation() const __SOFTFP;
+    
+    /**
+     * Identifier
+     *
+     * @since S60 5.0
+     * @return  The identifier of the window
+     */
+    IMPORT_C TUint Identifier() const;
+    
+    /**
+     * IsActive
+     *
+     * @since S60 5.0
+     * @return  ETrue, if window is active. Otherwise EFalse.
+     */
+    IMPORT_C TBool IsActive() const;
+    
+    /**
+     * SurfaceExtent
+     *
+     * @since S60 5.0
+     * @return  The extend of the composition surface
+     */
+	IMPORT_C TRect SurfaceExtent() const;
+	
+    /**
+     * Size
+     *
+     * @since S60 5.0
+     * @return  The index of the window. 0 means the topmost window.
+     */
+    IMPORT_C TUint Index() const;
+    
+    /**
+     * InBuffer
+     * This method returns the original buffer from wserv. Plugin must not modify the contents of it
+     * Contents of this buffer is updated before callback CAlfWindowPlugin::WindowUpdated() is called. 
+     *
+     * Ownership of a buffer remains in AlfWindowManager
+     *
+     * @since S60 5.0
+     * @return  CAlfWindowBuffer
+     */
+    IMPORT_C CAlfWindowBuffer* InBuffer();   
+    
+    /**
+     * OutBufferL
+     * This method returns new buffer for transition plugin to modify content that will finally display
+     * on screen. There can't be more than one active outbuffers for a window at a time. Content of an
+     * input buffer from wserv will be copied only upon creation of back buffer. After initialization, 
+     * Fx plugin has solely responsibility to update complete frame.
+     * 
+     * Ownership of a buffer remains in AlfWindowManager
+     *
+     * @since S60 5.0
+     * @param   aCopyInBufContents defines whether current frame should be copied to buffer
+     * @return  CAlfWindowBuffer
+     */
+    IMPORT_C CAlfWindowBuffer* OutBufferL(TBool aCopyContents = EFalse);
+    
+    // Setters
+    /**
+     * Size
+     *
+     * TODO:CHECK COMMENT VALIDITY
+     * Note, that SetACtive and SetOpacity(0) are different things. When window is not active, it is not 
+     * processed at all in the refresh loop unlike a transparent window would be. 
+     * 
+     * @since S60 5.0
+     * @return  The size of the window
+     */
+    IMPORT_C void SetActive(TBool aVisible);
+    
+
+    /**
+     * SetSurfaceExtent
+     *
+     * Set the extent of the related composition surface
+     * To remove extent, give aRect a value (0,0,0,0).
+     * 
+     * @since S60 5.0
+     * 
+     * @param aRect  New extent
+     */
+	IMPORT_C void SetSurfaceExtent(const TRect& aRect);
+
+	
+    /**
+     * SetLayerUsesAplhaFlag
+     *
+     * Set compostion layer's EUsesAlpha flag state
+     * Window that has background surface set, has layer
+     * in composition scene
+     * 
+     * @since S60 5.0
+     * 
+     * @param aEnabled  True/False
+     */	
+	IMPORT_C void SetLayerUsesAplhaFlag(TBool aEnabled);
+	
+    /**
+     * ContentReady
+     *
+     * @since S60 5.0
+     * @param aOutBuffer
+     * @param aUpdatedArea
+     */
+    IMPORT_C void ContentReady(const TRegion& aUpdatedArea);
+    
+    /**
+     * Move
+     * 
+     * Sets to order of the windows. 0 equals the topmost window.
+     *
+     * @since S60 5.0
+     * @param aIndex    New index of the window
+     */
+    IMPORT_C void Move(TUint aIndex);
+    
+    /**
+     * EnableIndexChangedNotifications
+     *
+     * @since S60 5.0
+     * @param aEnable
+     */
+    IMPORT_C void EnableIndexChangedNotifications(TBool aEnable);
+   
+    /**
+     * SetPos
+     *
+     * Set the position of the window
+     * 
+     * @since S60 5.0
+     * 
+     * @param aPos  New position
+     * @param aDuration Duration to new position
+     */
+    IMPORT_C void SetPos(TPoint aPos, TUint aDuration = 0);
+    
+    /**
+     * SetSize
+     *
+     * @since S60 5.0
+     * @param aSize  New size
+     * @param aDuration Duration to new size
+     */
+    IMPORT_C void SetSize(TSize aSize, TUint aDuration = 0);
+    
+    /**
+     * SetRotation
+     *
+     * @since S60 5.0
+     * @param aAngle New rotation angle
+     * @param Duration to new rotation angle
+     */
+    IMPORT_C void SetRotation(TReal32 aAngle, TUint aDuration = 0) __SOFTFP;
+    /**
+     * Size
+     *
+     * @since S60 5.0
+     * @param aOpacity New opacity value
+     * @param Duration to new opacity value
+     */
+    IMPORT_C void SetOpacity(TReal32 aOpacity, TUint aDuration = 0) __SOFTFP;
+    
+    public: // utils
+    
+    /**
+	 * SetFlag
+	 *
+	 * @param flag
+	 */
+	 void SetFlag( TInt aFlag );
+
+    /**
+	 * ClearFlag
+	 *
+	 * @param flag
+	 */    
+    void ClearFlag( TInt aFlag );
+    
+    /**
+     * SetWsInfo
+     *
+     * @since S60 5.0
+     * @param aInfo
+     */
+    void SetWsInfo(const TAlfWServInfo& aInfo);
+    
+    /**
+     * CompareIds
+     *
+     * Compares window id and window group identifier with the given window. 
+     * 
+     * @since S60 5.0
+     * @return ETrue, if ids match. Otherwise EFalse.
+     */
+    static TBool CompareIds( const TWindowIdentifier* aWServId, const CAlfWindow& aWindow )
+        {
+        return aWServId->Equals(aWindow.WsInfo().iClientSideId);
+        }
+
+    /**
+     * IsInsertedToScene
+     * 
+     * @since S60 5.0
+     * @return ETrue, if visual window has been inserted to the scene. (meaning, Set operations will be posted forward)
+     */
+    TBool IsInsertedToScene();
+
+    /**
+     * InsertedToScene
+     * 
+     * @param aInserted New scene state for this window
+     */ 
+    void InsertedToScene(TBool aInserted);
+    
+    /**
+     * Should the window be set inactive when it is released
+     */
+    TBool ShouldBeDeactivated(); 
+
+    /*
+     * PostPartialBuffer
+     * 
+     * Posts partial command buffer towards CHuiCanvas. Buffer is not processed until the final part is delivered.
+     * 
+     * @param aPtr  Pointer to the beginning of the command buffer in the shared junk
+     * @param aSize Length of the commands for this frame of a window
+     */ 
+    void PostPartialBuffer( 
+            TAny* aPtr, 
+            TInt aSize, 
+            TBool aPartial, 
+            TBool aLastPart, 
+            TBool aEmptyBuffers, 
+            TInt aNodeFlags );
+    
+    /*
+     * PostBuffer
+     * 
+     * Posts the command buffer towards CHuiCanvas. Previous buffers are cleared.
+     * 
+     * @param aPtr  Pointer to the beginning of the command buffer in the shared junk
+     * @param aSize Length of the commands for this frame of a window
+     */ 
+    void PostBuffer( TAny* aPtr, TInt aSize, TInt aNodeFlags );
+    
+    // RnD only
+    CFbsBitGc* GetBitGcL();
+    
+    void CommitGc();
+    
+    void SetNodeTracking( TInt aValue );
+
+private:
+    
+    CAlfWindow();
+    
+    void ConstructL(TUint aId, CAlfWindowManager& aOwner, const TSize& aSizeInPixels);
+
+    TAlfWindowAttributes* CreateWindowAttributes(TInt& aIndex);
+
+    TAlfWindowCommandBufferAttributes* CreateWindowCommandBufferAttributes(TInt& aIndex);
+
+    void CreateInBufferL();
+
+private:
+    
+    /**
+     *  Own.
+     */
+    TAlfWindowData* iData;
+    
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfwindowbuffer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,148 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __ALFWINDOWBUFFER_H__
+#define __ALFWINDOWBUFFER_H__
+
+#include <e32base.h>
+
+class CFbsBitmap;
+
+/**
+ *  CAlfWindowBuffer
+ *
+ *  @lib alfappservercore.dll
+ *  @since S60 5.0
+ */
+NONSHARABLE_CLASS(CAlfWindowBuffer): public CBase
+    {
+public:
+    /**
+     * ConstructL
+     *
+     * @since S60 5.0
+     * @param aSize Size of the window
+     * @param aBufferFormat See TDisplayMode for further details
+     * @param aStride   Stride of the window
+     * @param aPtr  Pointer to a buffer
+     */
+    IMPORT_C static CAlfWindowBuffer* NewL( const TSize& aSize, 
+                                        TInt aBufferFormat, 
+                                        TUint aStrideInBytes, 
+                                        TAny* aPtr);
+    IMPORT_C ~CAlfWindowBuffer();
+  
+    /**
+     * Size
+     *
+     * @since S60 5.0
+     * @return  The size of the window
+     */
+    IMPORT_C TSize Size() const;
+    
+    /**
+     * Format
+     *
+     * @since S60 5.0
+     * @return  The format of the window
+     */
+    
+    IMPORT_C TInt Format() const;
+
+    /**
+     * Stride
+     *
+     * @since S60 5.0
+     * @return  The stride of the window
+     */
+    IMPORT_C TUint Stride() const;
+   
+    /**
+     * BufferPtr
+     *
+     * @since S60 5.0
+     * @return pointer to actual presentation
+     **/
+    IMPORT_C TAny* BufferPtr() const;
+    
+    /**
+     * SetSize
+     *
+     * Sets the size of the window
+     * @since S60 5.0
+     * @param  aSize
+     */
+    IMPORT_C void SetSize(const TSize& aSize);
+   
+    /**
+     * SetFormat
+     *
+     * @since S60 5.0
+     * @param  aBufferFormat
+     */
+    IMPORT_C void SetFormat(TInt aBufferFormat);
+   
+    /**
+     * SetStride
+     *
+     * @since S60 5.0
+     * @param  aStrideInBytes   The stride of the window
+     */
+    IMPORT_C void SetStride(TUint aStrideInBytes);
+    
+    /**
+     * SetBufferPtr
+     *
+     * @since S60 5.0
+     * @param   aPtr
+     */
+    IMPORT_C void SetBufferPtr(TAny* aPtr) const;
+    
+    // for RnD only
+    TInt Handle();
+    
+    CFbsBitmap* Bmp();
+    
+    CAlfWindowBuffer* CreateCopyL(TBool aCopyContents = EFalse);
+    
+private:
+    
+    /**
+     * ConstructL
+     *
+     * @since S60 5.0
+     * @param aSize Size of the window
+     * @param aBufferFormat See TDisplayMode for further details
+     * @param aStride   Stride of the window
+     * @param aPtr  Pointer to a buffer
+     */
+    void ConstructL(const TSize& aSize, TInt aBufferFormat, TUint aStride, TAny* aPtr);
+    
+    CAlfWindowBuffer();
+    
+    class TAlfWindowBufferData;
+    
+    /*
+     *  Window data
+     *  Own.
+     */
+    TAlfWindowBufferData* iData;
+    }; 
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfwindowdata.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 ALFWINDOWDATA_H_
+#define ALFWINDOWDATA_H_
+
+// ---------------------------------------------------------------------------
+// TAlfWindowData declaration
+// ---------------------------------------------------------------------------
+//
+class TAlfWindowData
+    {
+    
+    public:
+        enum TFlags
+        {
+        EShouldInactivate = 0x01,
+        EShouldDestroy = 0x20
+        };
+
+
+    CAlfWindowManager* iWindowManager;
+    TPoint iPosition;
+    TSize iSize;
+    TReal32 iOpacity;
+    TReal32 iRotation;
+    TRect iSurfaceExtent;
+    TBool iLayerUsesAlphaFlagEnabled;
+    TUint iIdentifier;
+    TUint iIndex;
+    CAlfWindowBuffer* iInBuffer;
+    CAlfWindowBuffer* iOutBuffer;
+    TAlfWServInfo iOriginalInfo;
+    TBool iHasPlugin; // plugin that has reserved the window for painting
+    CFbsBitmapDevice* iBufferDev;
+    CFbsBitGc* iBufferGc;
+    TBool iIsActive;
+    TBool iIsInScene;
+    // was not set inactive because was reserved,
+    // should be set inactive as soon as is reserved.
+    TInt iFlags;
+    };
+
+
+#endif /* ALFWINDOWDATA_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfwindowfxplugin.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef __ALFWINDOWFXPLUGIN_H__
+#define __ALFWINDOWFXPLUGIN_H__
+
+#include <e32base.h>
+
+class CAlfWindowManager;
+struct TWindowIdentifier;
+
+class CAlfWindowFxPlugin: public CBase
+    {
+    public:
+    /** 
+    * 2nd phase constructor. Called by framework to complete construction of a plugin. 
+    * Must have base call from deriving class to complete construction
+    */
+    IMPORT_C virtual void ConstructL(const CAlfWindowManager& aMgr, TInt aAlfBufferFormat);
+
+    IMPORT_C ~CAlfWindowFxPlugin();
+    // not mandatory to implement
+	IMPORT_C virtual void DestroyWindow(const TWindowIdentifier& aId);
+    IMPORT_C virtual void NewWindow(const TWindowIdentifier& aId);
+    /** Synch message from client */    
+    IMPORT_C virtual void HandleMessageL(const TDesC8& aMessage, TPtr8& aResponse);
+
+    /** Asynch message from client */    
+    IMPORT_C virtual void HandleMessageL(const TDesC8& aMessage, const RMessage2& aClientMessage);
+
+    /** Cancel asynch message(s) from client */    
+    IMPORT_C virtual void CancelMessage(TInt aMessageId);
+
+    /**
+    * Pure Virtuals
+    */
+    virtual void PrepareFrameL(TUint aEstimatedFrameInterval) = 0;
+    virtual void WindowUpdated(TInt aWindowId, TInt aEventType) = 0;
+    
+    // utils
+    IMPORT_C CAlfWindowManager* WindowManager();
+
+    // For FW use
+    TUint Priority(); 
+
+    TUid* Identifier(); 
+
+    private:
+        class TAlfFxPluginData;
+        TAlfFxPluginData* iData;
+    
+    };
+
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfwindowmanager.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,280 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Manages window and plugin life cycles 
+*
+*/
+
+
+#ifndef __ALFWINDOWMANAGER_H__
+#define __ALFWINDOWMANAGER_H__
+
+#include <e32base.h>
+#include <alfwindowstructs.h>
+
+class CAlfHierarchyModel;
+class CAlfWindow;
+class CAlfWindowFxPlugin;
+class CAlfWindowBuffer;
+class CAlfStreamerBridge;
+class TAlfBridgerData;
+class TAlfWindowAttributes;
+class TAlfWindowCommandBufferAttributes;
+
+/**
+ *  CAlfWindowManager
+ *
+ *  @lib alfappservercore.dll
+ *  @since S60 5.0
+ */
+NONSHARABLE_CLASS(CAlfWindowManager): public CBase
+    {
+public:
+    
+    static CAlfWindowManager* NewL(CAlfHierarchyModel* aAlfHierarchy);
+    
+    virtual ~CAlfWindowManager();
+    
+    // Utils
+    /**
+     * CreateNewWindowL
+     *
+     * @since S60 5.0
+     * @param aIndex
+     * @param aSizeInPixels
+     * @return New window
+     */
+    IMPORT_C CAlfWindow* CreateNewWindowL(TUint aIndex, const TSize& aSizeInPixels);
+    
+    /**
+     * DestroyWindow
+     *
+     * @since S60 5.0
+     * @param aWindow
+     */
+    IMPORT_C void DestroyWindow(CAlfWindow& aWindow);
+    
+    /**
+     * EnableNewWindowNotificationsL
+     *
+     * @since S60 5.0
+     * @param aPlugin
+     * @param aEnable   New notification state
+     */
+    IMPORT_C void EnableNewWindowNotificationsL(CAlfWindowFxPlugin& aPlugin, 
+                                                TBool aEnable = ETrue);
+
+    /**
+     * EnableDestroyWindowNotificationsL
+     *
+     * @since S60 5.0
+     * @param aPlugin
+     * @param aEnable   New notification state for window destruction.
+     */
+                                                
+	IMPORT_C void EnableDestroyWindowNotificationsL(CAlfWindowFxPlugin& aPlugin, 
+                                                TBool aEnable = ETrue);                                                
+    /**
+     * ReserveL
+     *
+     * Reserves exclusive right to use the window. 
+     * Leaves with value KErrNotFound, if window is not found. 
+     * Leaves with value KErrInUse, If window is already reserved.
+     *  
+     * @since S60 5.0
+     * @param aId
+     * @param aReserveBuffer reserve data buffer for effects
+     * @return the reserved window
+     */
+    IMPORT_C CAlfWindow* ReserveL( const TWindowIdentifier& aId, TBool aReserveBuffer = ETrue );
+
+    /**
+     * Release
+     *
+     * Releases window
+     * 
+     * @since S60 5.0
+     * @param aWindow
+     * @param aReserveBuffer release the data buffer reserved for effects
+     */
+    IMPORT_C void Release( CAlfWindow& aWindow, TBool aReserveBuffer = ETrue );
+    
+    /**
+     * aWindow
+     *
+     * @since S60 5.0
+
+     * @return screen id
+     */
+    IMPORT_C TInt ScreenId() const;
+
+	#ifdef RND_FXPLUGIN_FIX
+    
+    /**
+     * aWindow
+     *
+     * @since S60 5.0
+
+     * @return screen id
+     */
+    IMPORT_C void GetWinIdListL(RArray<TWindowIdentifier>& aWinIdList);
+    
+	#endif
+
+    /**
+     * Find all windows whose Window Server Group Id matches the one given as input
+     * 
+     * @param aWsGroupId Window server group id
+     * @param aWinIdList list of window info structures whose group id matches the group given
+     * 
+     */
+    IMPORT_C void GetWinIdListL( TInt aWsGroupId, RArray<TWindowIdentifier>& aWinIdList );
+    
+    /**
+     * Find all windows whose Window Server Group Id matches the one given as input
+     * The purpose is to be able to convert from window server identifiers to alf indentifiers
+     * 
+     * @param aWsGroupId Window server group id
+     * @param aClientWindowHandle handle of a single window
+     * @param aWinInfoList list of window info structures whose group id matches the group given
+     *        if aClientWindowHandle != KErrNotFound, it must also match
+     * 
+     */
+    IMPORT_C void GetWinInfoListL( TInt aWsGroupId, TInt aClientWindowHandle, RArray<TAlfWServInfo>& aWinInfoList );
+    
+    // Internal Utils
+    
+    /**
+     * MoveWindow
+     *
+     * @since S60 5.0
+     * @param aWindow
+     * @param aIndex    New index for the window. The topmost is having index 0. 
+     */
+    void MoveWindow(CAlfWindow& aWindow, TInt aIndex);
+
+    /**
+     * SetWindowVisibility
+     *
+     * @since S60 5.0
+     * @param aWindow
+     * @param aVisible  New visibility state
+     */
+    void SetWindowVisibility(CAlfWindow& aWindow, TBool aVisible);
+
+    /**
+     * ContentReady
+     *
+     * Call to ContentReady will trigger update for all textures.
+     * 
+     * @since S60 5.0
+     * @param aWindow   
+     * @param aOutBuffer
+     */
+    void ContentReady(CAlfWindow& aWindow, CAlfWindowBuffer* aOutBuffer);
+
+    /**
+     * LoadPluginL
+     *
+     * @since S60 5.0
+     * @param aPluginUid    Id for the plugin to be created
+     */
+    void LoadPluginL(const TUid& aPluginUid);
+
+    /**
+     * DestroyPlugin
+     *
+     * @since S60 5.0
+     * @param aPluginUid    Id for the plugin to be destroyed
+     */
+    void DestroyPlugin(const TUid& aPluginUid);
+
+    /**
+     * PrepareNewFrame
+     *
+     * @since S60 5.0
+     * @param aEstimatedInterval
+     */
+    void PrepareNewFrame(TUint aEstimatedInterval);
+
+    /**
+     * HandlePluginMsgL
+     *
+     * @since S60 5.0
+     * @param aMessage  Message for message
+     */
+    void HandlePluginMsgL(const RMessage2& aMessage);
+
+    /**
+     * CancelPluginMsg
+     *
+     * @since S60 5.0
+     * @param aPluginUid    Id of the plugin
+     * @param aMessageId    Id for the message to be canceled
+     * @return ?description
+     */
+    void CancelPluginMsg(const TUid& aPluginUid, TInt aMessageId);
+
+    /**
+     * CreateNewWindowL
+     *
+     * @since S60 5.0
+     * @param aIndex    Order of window. Index 0 means the topmost.
+     * @param aInfo     Window info 
+     * @return ?description
+     */
+    CAlfWindow* CreateNewWindowL(TUint aIndex, const TAlfWServInfo& aInfo);
+
+    /**
+     * PostIt
+     *
+     * Posts command for asyncronous processing
+     * 
+     * @since S60 5.0
+     * @param aData Command data
+     * @return KErrNone, if data was succesfully posted. Otherwise an error code.
+     */
+    IMPORT_C TInt PostIt(const TAlfBridgerData& aData);
+    
+    IMPORT_C CAlfStreamerBridge* Bridge();
+    
+private: // utils
+
+    CAlfWindowManager();
+    
+    void ConstructL(CAlfHierarchyModel* aAlfHierarchy);
+    
+    /**
+     * FindPlugin
+     *
+     * @since S60 5.0
+     * @param ?arg1 ?description
+     * @return Pointer to requested plugin. 0 if the requested plugin was not found.
+     */
+    CAlfWindowFxPlugin* FindPlugin(const TUid& aPluginUid);
+
+    void BindWindowToHitchL(CAlfWindow* aWindow, CAlfWindowManager* aMgr);
+
+    TAlfWindowAttributes* CreateWindowAttributes(TInt& aIndex);
+
+    TAlfWindowCommandBufferAttributes* CreateWindowCommandBufferAttributes(TInt& aIndex);
+    
+private: // data
+        
+        class TAlfWindowMgrData;
+        
+        TAlfWindowMgrData* iData;
+    };
+
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/malfsrvtexturemanagerclient.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 for server side texture manager
+*
+*/
+
+
+
+#ifndef M_ALFSRVTEXTUREMANAGERCLIENT_H
+#define M_ALFSRVTEXTUREMANAGERCLIENT_H
+
+#include <e32std.h>
+
+/**
+ *  Client interface for server side texture manager.
+ *
+ *  This interface is used by server side texture manager for 
+ *  auto size textures. @c GetTextureSize is used to query what is
+ *  size of texture is being/has been delivered to client. 
+ *  @c SetTextureSize is used to request new size for texture.
+ *  Once a sequence of @c SetTextureSize calls have finished,
+ *  server side texture manager calls @c HandleAllTextureSizesInformed.
+ *
+ *  @since S60 v5.0
+ */
+class MAlfSrvTextureManagerClient
+    {
+public:
+
+    /**
+     * Gets texture information from client
+     *
+     * @param aTextureId texture id.
+     * @param aTextureSize current texture size being delivered to client.
+     * @param aHasBeenDelivered ETrue if texture size has already been 
+     *        delivered to client, EFalse otherwise.
+     * @return ETrue if information found, EFalse otherwise.
+     */
+    virtual TBool GetTextureSize( 
+        TInt aTextureId, 
+        TSize& aTextureSize,
+        TBool& aHasBeenDelivered ) = 0;
+
+    /**
+     * Sets new size for texture to be delivered to client.
+     * @param aTextureId texture id.
+     * @param aTextureSize new texture size.
+     * @param aPriority priority for texture size to be delivered.
+     *        negative: deliver urgently, 
+     *        0: deliver immediately, 
+     *        positive: deliver as soon as possible.
+     */
+    virtual void SetTextureSize(
+        TInt aTextureId,
+        const TSize& aTextureSize,
+        TInt aPriority ) = 0;
+
+    /**
+     * Informs client that texture size does not need to be delivered
+     * to client side.
+     * @param aTextureId texture id.
+     */
+    virtual void RemoveTextureSize( TInt aTextureId ) = 0;
+    
+    /**
+     * Informs client that all texture size information has been given 
+     * (for now).
+     */
+    virtual void TextureSizeChangesCompleted() = 0;
+
+    };
+
+#endif // M_ALFSRVTEXTUREMANAGERCLIENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Inc/themerepositorylistener.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,39 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef __THEMEREPOSITORYLISTENER_H__
+#define __THEMEREPOSITORYLISTENER_H__
+
+#include <centralrepository.h>
+
+NONSHARABLE_CLASS(CThemeRepositoryListener) : public CActive
+    {
+    public:
+        static CThemeRepositoryListener* NewL();
+        virtual ~CThemeRepositoryListener();
+        void RunL();
+        void DoCancel();
+        void IssueRequest();
+    protected:
+        void ConstructL();
+    private:
+        CThemeRepositoryListener();
+        CRepository* iThemesRepository;
+        TInt iPreviousValue;
+    };
+    
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfappserver.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1450 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Application Sever
+*
+*/
+
+
+
+#include <coemain.h>
+#include <coedef.h>
+#include <apgwgnam.h>
+#include <eiksvdef.h>
+#include <ecom.h>
+#include <uiacceltk/HuiUtil.h>
+#include <f32file.h>
+#include <TfxSrvEcomIds.h>
+#include <mtransitionserver.h>
+#include "alf/alfappserver.h"
+#include "alf/alfappui.h"
+#include "alf/alfconstants.h"
+#include "alfappsrvsession.h"
+#include "alflogger.h"
+#include "alfsrvsubsessionbase.h"
+#include "alf/alfextensionfactory.h"
+#include "alfstaticfactory.h"
+#include "alfsrvtranseffect.h"
+#include "alf/AlfTransEffectPlugin.h"
+#include <uiacceltk/HuiDisplay.h> //@todo::
+#include "alfclientserver.h"
+#include "alfsrvtexturemanager.h"
+#include "alfsrvscreenbuffermanager.h"
+
+// ----------------------------
+
+/**
+ * Common command batch buffer size. This must always be larger than command 
+ * header size. In practice, this should be always larger than 128.
+ */
+const TInt KAlfCommonCommandBatchBufferSize = 
+    KAlfClientServerDefaultCommandBatchBufferSize;
+
+// a kind of cleanup item for ecom info array
+NONSHARABLE_CLASS(CCleanupEcomArray):public CBase
+    {
+    public:
+    ~CCleanupEcomArray()
+        {
+        iArray.ResetAndDestroy();
+        iArray.Close();
+        }
+    RImplInfoPtrArray iArray;
+    };
+
+
+// ECom notify helper.
+NONSHARABLE_CLASS(CAlfEcomUtil): public CActive
+    {
+    public:    
+    
+    CAlfEcomUtil(CAlfAppServer& aServer)
+    :CActive(EActivePriorityDefault), iOwner(aServer)
+	    {
+	    CActiveScheduler::Add(this);
+	    }
+
+    void ConstructL()
+	    {
+	    iEComSession = &REComSession::OpenL();
+    	}
+
+    ~CAlfEcomUtil()
+	    {
+	    Cancel();
+	    if (iEComSession)
+	        {
+	        iEComSession->Close();
+	        }
+	    iEComSession = NULL;
+	    }
+
+    static CAlfEcomUtil* NewL(CAlfAppServer& aServer)
+	    {
+	    CAlfEcomUtil* self = new (ELeave) CAlfEcomUtil(aServer);
+	    CleanupStack::PushL(self);
+	    self->ConstructL();
+	    CleanupStack::Pop(self);
+	    return self;
+	    }
+
+    void Start()
+	    {
+	    if (!IsActive())
+	        {
+    	    iEComSession->NotifyOnChange(iStatus);
+	        SetActive();
+	        }
+	    }
+
+    void RunL()
+	    {
+	    // if there was an error, just breathe a moment, i.e. don't activate new request immediately
+        if (iStatus.Int() == KErrNone )
+            {
+    	    //Check wether plugin was installed or removed
+     	    TRAP_IGNORE(iOwner.CheckForEcomPluginInstallUninstallL())
+    	    Start();
+            }
+        __ALFLOGSTRING1( "CAlfEcomUtil::RunL: status %d", iStatus.Int() )
+	    }
+
+    void DoCancel()
+	    {
+	    iEComSession->CancelNotifyOnChange(iStatus);
+	    }
+	
+	private:    
+        CAlfAppServer& iOwner;
+        REComSession* iEComSession;
+    };
+    
+
+// ======== MEMBER FUNCTIONS ========
+
+
+EXPORT_C CAlfAppServer* CAlfAppServer::NewAppServerL()
+    {
+    return new (ELeave) CAlfAppServer();
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfAppServer::CAlfAppServer():
+      iLastActiveClientWg(KErrNotFound)
+    {
+    CCoeEnv* coe = CCoeEnv::Static();
+    if (coe)
+        {
+        iWs = &coe->WsSession();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CAlfAppServer::ConstructL( const TDesC& aFixedServerName )
+    {
+    CAknAppServer::ConstructL( aFixedServerName );
+
+    iCommonCommandBatchBuffer = HBufC8::NewL( KAlfCommonCommandBatchBufferSize );
+    iTextureManager = CAlfSrvTextureManager::NewL();
+    iScreenBufferManager = CAlfSrvScreenBufferManager::NewL(*this);
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfAppServer::~CAlfAppServer()
+    {
+	#ifdef TFXSERVER_API_V2
+    if (iTfxServer)
+    	{
+        iTfxServer->Disconnect();
+    	delete iTfxServer;
+    	iTfxServer = NULL;
+    	REComSession::DestroyedImplementation( iTfxServerEComDestructorUID );
+    	iTfxServerEComDestructorUID.iUid = 0;	
+    	}
+	#endif
+
+    delete iBackgroundTimer;
+    delete iTransitionEffects;
+    
+    delete iEcomWatcher;
+    
+    iWindowChangeObservers.Close();
+    
+    if (iAsynchOneShot)
+        {
+        iAsynchOneShot->Cancel();
+        }
+    
+    delete iAsynchOneShot;
+    iRemovedArray.Close();
+    
+    delete iObjectConIx;
+
+    for (TInt ii = iCustomSessions.Count()-1; ii >= 0; ii--)
+        {
+        delete iCustomSessions[ii].iImpl;
+        REComSession::DestroyedImplementation(
+                iCustomSessions[ii].iDestructorUid);
+        }
+        
+    iCustomSessions.Close();
+    
+    // Todo: check remaining implementations
+    for (TInt ii = iFactories.Count()-1; ii >= 0; ii--)
+        {
+        iFactories[ii].iImpl->Release();
+        if (iFactories[ii].iDestructorUid.iUid)
+            {
+            REComSession::DestroyedImplementation(
+                iFactories[ii].iDestructorUid);
+            }
+        }
+
+    iFactories.Close();
+        
+    iMetricsInterface = NULL;
+    iAppUi= NULL;
+
+    delete iCommonCommandBatchBuffer;
+	delete iScreenBufferManager;
+    delete iTextureManager;
+    }
+
+// ---------------------------------------------------------------------------
+// Called when client application exist.
+// All allocated resources for that application should be freed.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfAppServer::HandleClientExit(TInt aClientId)
+    {
+	if (MetricsInterface())
+	    {
+		MetricsInterface()->SessionTerminated(aClientId);
+		}
+  
+    SyncEcomImplementations(aClientId);  
+    
+    CAlfAppSrvSessionBase* session = reinterpret_cast<CAlfAppSrvSessionBase*>(aClientId);
+    
+    ScreenBufferManager().RemoveScreenBufferObservers(session);
+    
+    if (session == iOldSession)
+        {
+        iOldSession = 0;
+        }
+    
+    if (iAppUi)
+        {
+        iAppUi->FreeResourcesForClient(aClientId);
+        }
+    else 
+        {
+        return;
+        }
+        
+    for (TInt i = iWindowChangeObservers.Count()-1; i >= 0 ; i--)
+        {
+        if (iWindowChangeObservers[i].iId == aClientId)
+            {
+            iWindowChangeObservers.Remove(i);
+            }
+        }
+        
+    // todo, is it true that we have no other way to check the count than using iterator?
+    TInt count = 0;
+    iSessionIter.SetToFirst();
+    for(;iSessionIter;iSessionIter++)
+        {
+        count++;
+        }
+    
+    // if this was the last client, it is ok to bail out here    
+    if (count == 1)
+        {
+        AppUi()->UpdateActiveSession( 0 );
+        AdjustWindowGroupPositionL(*CHuiStatic::RootWin(0),0,EAbsoluteBackground);
+        return;
+        }
+
+    // Set wg position based in the topmost client app
+    TInt parentWg = KErrNotFound;    
+    CAlfAppSrvSessionBase* dying = reinterpret_cast<CAlfAppSrvSessionBase*>(aClientId);
+
+    if ( dying->ClientWindowGroup() == KErrNotFound )
+        {
+        // debugging trash
+        // just bail out w/o changing the order of window groups
+        return;       
+        }
+    
+    if ( dying->ClientWindowGroup() == iLastActiveClientWg )
+        {
+        iLastActiveClientWg = KErrNotFound;
+        parentWg = dying->ParentWindowGroupId();
+        }
+
+    CAlfAppSrvSessionBase* newFocusSession = 0;
+
+    // if parent of embedded app found, check if it ALF app and set it to focus
+    if (parentWg != KErrNotFound)
+        {
+        iSessionIter.SetToFirst();
+        while (iSessionIter)
+            {
+            CAlfAppSrvSessionBase* session = reinterpret_cast<CAlfAppSrvSessionBase*>(iSessionIter++);
+            if ( session && session->ClientWindowGroup() == parentWg)
+                {
+                newFocusSession = session;
+                break;
+                }
+            }
+        }
+        
+    if (CCoeEnv::Static() && !newFocusSession) // else find topmost app and move us behind that
+        {
+        parentWg = KErrNotFound; // just in case app had parent but that was not ALF app
+        CArrayFixFlat<TInt>* wgs = new CArrayFixFlat<TInt>(4);
+        if ( wgs )
+            {
+            iWs->WindowGroupList(wgs);
+            for ( TInt ordinal = 0 ; ordinal < wgs->Count(); ordinal++ )
+                {
+                iSessionIter.SetToFirst();
+                if( newFocusSession ) // session found from previous ordinal position.
+                    {
+                    break;
+                    }
+                while (iSessionIter)
+                    {
+                    CAlfAppSrvSessionBase* session = reinterpret_cast<CAlfAppSrvSessionBase*>(iSessionIter++);
+                    if ( session && 
+                         session->ClientWindowGroup() == wgs->At( ordinal ) &&
+                         (TInt)session != aClientId )
+                        {
+                        newFocusSession = session;
+                        break;
+                        }
+                    }
+                }
+            }
+        delete wgs;
+        }
+    
+    TRAP_IGNORE(FocusedWindowGroupChangedL(newFocusSession, parentWg))
+    }
+
+
+// ---------------------------------------------------------------------------
+// Static utility used in callback
+// ---------------------------------------------------------------------------
+// 
+TInt SynchEcomImplementations(TAny* aThis)
+    {
+    ((CAlfAppServer*)aThis)->DoSynchEcomImplementations();
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// Check if the exiting client is using ecom based session
+// if so, set asynchronous callback for notifying Ecom FW about the change
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppServer::SyncEcomImplementations(TInt aClientId)  
+    {
+    TBool isEcom(EFalse);
+    for(TInt ii = iCustomSessions.Count()-1; ii >= 0 ; ii--)
+        {
+        if (iCustomSessions[ii] == aClientId)
+            {
+            isEcom = ETrue;
+            iCustomSessions[ii].iImpl = 0; // session is about to terminate, null the pointer
+            break;
+            }
+        }
+    if (isEcom)
+        {
+        iRemovedArray.Append(aClientId);
+        if (iAsynchOneShot && !iAsynchOneShot->IsActive())
+            {
+            iAsynchOneShot->CallBack();
+            }
+        
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Check and notify Ecom FW about removed implementations caused by client exit
+// Called asynchronously after a client usin ecom based session has exited.
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppServer::DoSynchEcomImplementations()
+    {
+    // check if the session was ECOM based and notify FW if so
+    for (TInt i = iRemovedArray.Count()-1; i >= 0; i--)
+        {
+        for(TInt ii = iCustomSessions.Count()-1; ii >= 0 ; ii--)
+            {
+            if (iCustomSessions[ii] == iRemovedArray[i])
+                {
+                REComSession::DestroyedImplementation(
+                    iCustomSessions[ii].iDestructorUid);            
+                iCustomSessions.Remove(ii);
+                }
+            }
+        
+        }
+    iRemovedArray.Reset();
+    User::Heap().Compress();
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CAknAppServer.
+// Called when all clients have existed.
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppServer::HandleAllClientsClosed()
+    {
+    if (iAppUi)
+        iAppUi->AllClientsClosed();
+    }
+        
+// ---------------------------------------------------------------------------
+// From class CAknAppServer.
+// Allocates the session instance
+// ---------------------------------------------------------------------------
+//
+CApaAppServiceBase* CAlfAppServer::CreateServiceL( TUid aServiceType ) const
+    {
+    CApaAppServiceBase* session = 0;
+    if (aServiceType == KAlfServiceUid)   
+		{
+		session = CAlfAppSrvSession::NewL(this);
+		}
+    else
+	    { // nasty const cast
+    	session = ((CAlfAppServer*)this)->LoadServiceExtensionL(aServiceType);		    
+	    }
+	
+	if(session)	
+	    {
+		if (MetricsInterface())
+		    {
+		    const_cast<MAlfMetricsInterface*>(MetricsInterface())->SessionCreated(reinterpret_cast<TInt>(session));
+		    }
+		    
+	    return session;
+	    }
+	else
+		{
+		return CAknAppServer::CreateServiceL(aServiceType);	
+		}
+    }
+    
+// ---------------------------------------------------------------------------
+// Adjusts server's wg according to client's wg.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfAppServer::AdjustWindowGroupPositionL(
+    RWindowGroup& aWindowGroup, 
+    TInt aParentIdentifier, 
+    TAlfWGPostion aPosition)
+    {
+    if (!iAppUi )
+        {
+        return;  
+        }
+
+    // Update the member variable based on the WG the server follows.
+    if (aPosition != EAbsoluteBackground)
+        {
+        iLastActiveClientWg = aParentIdentifier;
+        }
+        
+    if (!CCoeEnv::Static())
+        {
+        iAppUi->AdjustWindowGroupPositionL(
+                    aParentIdentifier, 
+                    aPosition);
+        return;
+        }
+        
+#ifdef _ALF_LOGGING
+    LogWindowGroupsL();
+    switch( aPosition )
+        {
+        case EBehindOfParent:
+            __ALFLOGSTRING1( "CAlfAppServer::AdjWinGrpPosL EBehindOfParent parent id %d", aParentIdentifier )
+            break;
+        case EOnTopOfParent:
+            __ALFLOGSTRING1( "CAlfAppServer::AdjWinGrpPosL EOnTopOfParent parent id %d", aParentIdentifier )
+            break;
+        case EAbsoluteBackground:
+            __ALFLOGSTRING1( "CAlfAppServer::AdjWinGrpPosL EAbsoluteBackground parent id %d", aParentIdentifier )
+            break;
+        default:
+            __ALFLOGSTRING2( "CAlfAppServer::AdjWinGrpPosL UNKNOWN parent id %d pos %d", aParentIdentifier, aPosition )
+            break;
+        }
+#endif
+    
+    if (aPosition == EAbsoluteBackground) // just for convenience
+        {
+        aWindowGroup.SetOrdinalPosition(0,ECoeWinPriorityNeverAtFront);
+        LogWindowGroupsL();
+        return;
+        }
+            
+    TInt parentPriority = iWs->GetWindowGroupOrdinalPriority(aParentIdentifier);
+
+    // perhaps we should maintain wg-list elsewhere
+    CArrayFixFlat<TInt>* wgs = new (ELeave) CArrayFixFlat<TInt>(1); 
+    CleanupStack::PushL(wgs);
+    iWs->WindowGroupList(parentPriority,wgs);
+    
+    TInt pos = KErrNotFound;
+    TInt movingWgOldPos = KErrNotFound;
+    TInt wgCount = wgs->Count();
+    for (TInt i = 0; i < wgCount; i++)
+        {
+        if (aParentIdentifier == wgs->At(i))
+            {
+            if ( aPosition == EOnTopOfParent )
+                {
+                pos = i;
+                }
+            else
+                {
+                pos = i+1;
+                }
+            }
+        if ( aWindowGroup.WindowGroupId() == wgs->At(i))
+            {
+            movingWgOldPos = i;
+            }
+           
+        if ( pos != KErrNotFound && movingWgOldPos != KErrNotFound )
+            {
+            // Both found already.
+            break;
+            }
+        }
+    
+    // If the moving window group has already been before the parent
+    // we need to adjust the new position
+    if ( movingWgOldPos < pos && movingWgOldPos != KErrNotFound )
+        {
+        pos--;
+        }
+
+
+    User::LeaveIfError(pos); // parenty not found, leave
+    
+    // if iBackDropWgIdentifier has been set, status pane is partly drawn to 
+    // back drop window group
+    if (aPosition == EBehindOfParent && 
+        iBackDropWgIdentifier 
+        && parentPriority == ECoeWinPriorityNormal ) // only apps with normal priority should use status pane
+        {
+        for (TInt ii = pos; ii < wgCount; ii++)
+            {
+            if (wgs->At(ii) == iBackDropWgIdentifier)
+                {
+                pos = ii+1; // right behind status pane
+                break;
+                }
+            }    
+        
+        }
+    CleanupStack::PopAndDestroy(wgs);
+    
+    aWindowGroup.SetOrdinalPosition(pos, parentPriority);
+    
+    LogWindowGroupsL();
+    }
+   
+// ---------------------------------------------------------------------------
+// Returns server's window server session.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C RWsSession& CAlfAppServer::WsSession() const
+    {
+    return *iWs;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the metrics interface.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C MAlfMetricsInterface* CAlfAppServer::MetricsInterface()
+    {
+    return iMetricsInterface;
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns the metrics interface.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C const MAlfMetricsInterface* CAlfAppServer::MetricsInterface() const
+    {
+    return iMetricsInterface;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the metrics interface.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfAppServer::SetMetricsInterface(
+    MAlfMetricsInterface* aMetricsInterface)
+    {
+    iMetricsInterface = aMetricsInterface;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets the AppUi.
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppServer::SetAppUi(CAlfAppUi* aAppUi)
+    {
+    iAppUi = aAppUi;
+    iWs = &CHuiStatic::WsSession();
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns the AppUi pointer.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C CAlfAppUi* CAlfAppServer::AppUi()
+    {
+    __ASSERT_DEBUG(iAppUi, USER_INVARIANT());
+    return iAppUi;
+    }
+   
+// ---------------------------------------------------------------------------
+// Called when the focused window group changes.
+// ---------------------------------------------------------------------------
+//     
+void CAlfAppServer::FocusedWindowGroupChangedL( CAlfAppSrvSessionBase* aSession, TInt aWgId)
+    {
+    iOldSession = NULL;
+    CancelBackgroundTimer();
+
+    // Find new and old focused clients
+    CAlfAppSrvSessionBase* newFocusedSession = aSession;
+    CAlfAppSrvSessionBase* oldFocusedSession = NULL;
+    
+    iSessionIter.SetToFirst();
+    while (iSessionIter)
+        {
+        CAlfAppSrvSessionBase* session =
+            reinterpret_cast<CAlfAppSrvSessionBase*>(iSessionIter++);
+
+        if (  session && 
+              !oldFocusedSession && 
+              iLastActiveClientWg != KErrNotFound &&
+              session->ClientWindowGroup() == iLastActiveClientWg )
+            {
+            oldFocusedSession = session;
+            }
+            
+        // If found, stop the search. 
+        if ( oldFocusedSession || iLastActiveClientWg == KErrNotFound )
+            {
+            break;
+            }
+        // Otherwise, keep going...
+        }
+        
+    if ( !newFocusedSession )
+        {
+        // Another application got the focus
+        // let the server follow the previous app wg
+        if ( oldFocusedSession )
+            {
+            oldFocusedSession->ResetRootlayerTransformationsL();
+            oldFocusedSession->FocusLostL( EFalse );
+            AdjustWindowGroupPositionL(
+                        *CHuiStatic::RootWin(),
+                        oldFocusedSession->ClientWindowGroup(), 
+                        oldFocusedSession->PreferredWindowGroupPosition());        
+            }
+        else // this will be the case when there is only direct client connections left
+            {
+            AdjustWindowGroupPositionL(*CHuiStatic::RootWin(0),0,EAbsoluteBackground);
+            }
+        AppUi()->UpdateActiveSession( 0 );
+        AppUi()->SetContainerNonFading( EFalse );
+        }
+    else
+        {
+        // One of our clients got the focus
+        AdjustWindowGroupPositionL( 
+                *CHuiStatic::RootWin(), 
+                newFocusedSession->ClientWindowGroup(), 
+                newFocusedSession->PreferredWindowGroupPosition() );
+#ifdef SYMBIAN_BUILD_GCE    
+        newFocusedSession->ActivateContainerLayoutL(ETrue);
+#endif // #ifdef SYMBIAN_BUILD_GCE    
+
+        TBool didFadeOutTransition = EFalse; // default, just make sure that visual trees are restored
+        if ( oldFocusedSession && newFocusedSession != oldFocusedSession) // switching between apps
+            {
+            if ((oldFocusedSession->ClientWindowGroup() == newFocusedSession->ParentWindowGroupId())
+                || (newFocusedSession->ClientWindowGroup() == oldFocusedSession->ParentWindowGroupId() ))
+                { // swithching into embedded app
+                didFadeOutTransition = oldFocusedSession->FocusLostL( MAlfTransEffectPlugin::EContextEmbeddedExit );
+                if (didFadeOutTransition)
+                    {
+                    didFadeOutTransition = MAlfTransEffectPlugin::EContextEmbeddedStart;
+                    }
+                }
+            else // swithching between separate apps
+                {
+                didFadeOutTransition = oldFocusedSession->FocusLostL( MAlfTransEffectPlugin::EContextFocusLost );
+                }    
+            }
+        else if (!oldFocusedSession ) // New app is being launched
+            {                         // or previous app destroyed  
+            if (aWgId == KErrNotFound)
+                {
+                didFadeOutTransition = MAlfTransEffectPlugin::EContextFocusGained; // enable default effect
+                }
+            else
+                {
+                didFadeOutTransition = MAlfTransEffectPlugin::EContextEmbeddedStart; // enable default effect
+                }
+            }
+        else
+            {
+            // Fot PC-lint
+            }
+        newFocusedSession->FocusGainedL( didFadeOutTransition );
+        }
+#ifdef SYMBIAN_BUILD_GCE
+/*
+#ifdef HUI_FX
+*/
+    // Should test if transition is running
+    // If transitions are disabled, no delay is needed
+    if ( oldFocusedSession && oldFocusedSession != newFocusedSession )
+        {
+        if ( !newFocusedSession )
+            {
+            iOldSession = oldFocusedSession;
+            StartBackgroundTimerL(iLastActiveClientWg);
+            }
+        else
+            {
+            oldFocusedSession->ActivateContainerLayoutL(EFalse);
+            }
+        }
+/*        
+#else  
+    if (oldFocusedSession && oldFocusedSession != newFocusedSession )
+        oldFocusedSession->ActivateContainerLayoutL(EFalse);
+#endif    
+*/
+#endif // #ifdef SYMBIAN_BUILD_GCE    
+    }
+
+
+// ---------------------------------------------------------------------------
+// Notify window visibility observers about change
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppServer::WindowVisiblityChangedL( 
+    TUint aVisibilityFlags, 
+    CCoeControl* aDestination )
+    {
+    for (TInt i = 0; i < iWindowChangeObservers.Count(); i++)
+        {
+        if (iWindowChangeObservers[i].iPtr->CoeControl() == aDestination)
+            {
+            if ( aVisibilityFlags & 
+                 TWsVisibilityChangedEvent::EPartiallyVisible )
+                {
+                iWindowChangeObservers[i].iPtr->WindowPartiallyVisible();
+                }
+            else if ( aVisibilityFlags & 
+                      TWsVisibilityChangedEvent::EFullyVisible )
+                {
+                iWindowChangeObservers[i].iPtr->WindowFullyVisible();
+                }
+            else if ( aVisibilityFlags & 
+                      TWsVisibilityChangedEvent::ENotVisible )
+                {
+                iWindowChangeObservers[i].iPtr->WindowNotVisible();
+                }
+            else
+                {
+                // For PC-lint
+                }
+            
+            break;
+            }
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Loads a session extension.
+// ---------------------------------------------------------------------------
+// 
+CAlfAppSrvSessionBase* CAlfAppServer::LoadServiceExtensionL(TUid aServiceType)
+    {
+    CAlfAppSrvSessionBase* newSession = 0;
+    // check if lib already loaded
+    if (ImplementationExists(aServiceType)) // no need to scan
+        {
+        newSession = NewImplementationL(aServiceType);       
+        }
+    else
+        {
+        // perform plugin scan
+        CCleanupEcomArray* ecomInfoArray = new (ELeave) CCleanupEcomArray;
+        CleanupStack::PushL(ecomInfoArray);
+        REComSession::ListImplementationsL(TUid::Uid(K_ALF_SERVICE_INTERFACE), ecomInfoArray->iArray);
+        // check if plugin with implementation uid matches 
+        TInt count = ecomInfoArray->iArray.Count();
+        for (TInt ii = count-1; ii >= 0; ii-- )
+            {
+            if ((ecomInfoArray->iArray[ii])->ImplementationUid() 
+                    == aServiceType)
+                {
+                newSession = NewImplementationL(aServiceType);       
+                break;
+                }
+            }
+        CleanupStack::PopAndDestroy();    
+        }
+
+    if (newSession && !iAsynchOneShot)
+        { // instantiate remove callback here if it does not exist yet
+        iAsynchOneShot = 
+            new (ELeave) CAsyncCallBack(
+                TCallBack(SynchEcomImplementations, this), 
+                EActivePriorityDefault);
+        }
+
+    
+    return newSession;
+    }
+
+// ---------------------------------------------------------------------------
+// Checks if implementation of this type has been loaded already, 
+// no need to perform scan if this is the case 
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfAppServer::ImplementationExists(TUid aServiceType) const
+    {
+    for(TInt ii = iCustomSessions.Count()-1; ii >= 0; ii--)
+        {
+        if (aServiceType==iCustomSessions[ii].iServiceUid)
+            {
+            return ETrue;
+            }
+        }
+
+    return EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// Loads and instantiates actual implementation using ECOM 
+// ---------------------------------------------------------------------------
+// 
+CAlfAppSrvSessionBase* CAlfAppServer::NewImplementationL(TUid aServiceType)
+    {
+    TServiceExtension ext;
+    ext.iServiceUid = aServiceType;
+    ext.iImpl = 
+        (CAlfAppSrvSessionBase*)REComSession::CreateImplementationL(
+            aServiceType, 
+            ext.iDestructorUid, 
+            this);
+    iCustomSessions.AppendL(ext);
+
+    // set notify for changes in plugins (if it does not exist already) 
+    if (!iEcomWatcher)
+        {
+        iEcomWatcher = CAlfEcomUtil::NewL(*this);
+        iEcomWatcher->Start();
+        }
+  
+    return ext.iImpl;
+    }
+
+// ---------------------------------------------------------------------------
+// Something has changed in ECom, check if we are affected
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppServer::CheckForEcomPluginInstallUninstallL()
+    {
+    // cross-check services loaded
+    TInt csCount = iCustomSessions.Count();
+    if (csCount)
+        {
+        CCleanupEcomArray* ecomInfoArray = new (ELeave) CCleanupEcomArray;
+        CleanupStack::PushL(ecomInfoArray);
+        REComSession::ListImplementationsL(TUid::Uid(K_ALF_SERVICE_INTERFACE), 
+                                            ecomInfoArray->iArray);
+        // check if plugin with implementation uid matches 
+        TInt count = ecomInfoArray->iArray.Count();
+        while (csCount > 0)
+            {
+            csCount--;
+            TUid csUid = iCustomSessions[csCount].iServiceUid;
+            TBool found(EFalse);
+            for (TInt ii = count-1; ii >= 0; ii-- )
+                {
+                if ((ecomInfoArray->iArray[ii])->ImplementationUid() 
+                    == csUid)
+                    {
+                    found = ETrue;       
+                    break;
+                    }
+                }
+            if (!found)
+                { // notifies ECom about destroyed implementation
+                delete iCustomSessions[csCount].iImpl;
+                }
+            }
+            
+        CleanupStack::PopAndDestroy();            
+        }
+
+    TInt factoryCount = iFactories.Count();
+    if (factoryCount)
+        {
+        CCleanupEcomArray* ecomInfoArray = new (ELeave) CCleanupEcomArray;
+        CleanupStack::PushL(ecomInfoArray);
+        REComSession::ListImplementationsL(TUid::Uid( K_ALF_FACTORY_INTERFACE), 
+                                            ecomInfoArray->iArray);
+        // check if plugin with implementation uid matches 
+        TInt count = ecomInfoArray->iArray.Count();
+        while (factoryCount > 0 )
+            {
+            factoryCount--;
+            TUid fUid = iFactories[factoryCount].iUid;
+            if (fUid == KNullUid) // fixed factory
+                {
+                continue;                
+                }
+                
+            TBool found(EFalse);
+            for (TInt ii = count-1; ii >= 0; ii-- )
+                {
+                if ((ecomInfoArray->iArray[ii])->ImplementationUid() 
+                    == fUid)
+                    {
+                    found = ETrue;       
+                    break;
+                    }
+                }
+            if (!found)
+                { // notifies ECom about destroyed implementation
+                NotifySessionsAboutDestroyedImplementation(iFactories[factoryCount].iUid.iUid);
+                iFactories[factoryCount].iImpl->Release();
+                }
+            }
+            
+        CleanupStack::PopAndDestroy();            
+        }
+
+    if (iCustomSessions.Count() == 0 && 
+        (iFactories.Count() == 0 || (iFactories.Count() == 1 && iFactories[0].iUid == KNullUid) ) )
+        { // no active extensions -> cancel notify
+        delete iEcomWatcher;
+        iEcomWatcher = 0;    
+        }
+    
+    }
+
+// ---------------------------------------------------------------------------
+// Appends new window visibility observer
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfAppServer::SetWindowChangeObserverL(
+    MWindowVisibilityObserver* aObserver, TInt aClientId) 
+    {
+    iWindowChangeObservers.AppendL(TWindowChangeObserver(aObserver,aClientId));
+    }
+    
+TBool IsNewStatusPaneArchL()
+    {
+    _LIT(KS60ProductIDFile, "Series60v*.sis");
+    _LIT(KROMInstallDir, "z:\\system\\install\\");
+
+    TFindFile ff( CHuiStatic::FsSession());
+    CDir* result;
+    User::LeaveIfError( ff.FindWildByDir( KS60ProductIDFile, KROMInstallDir, result ) );
+    CleanupStack::PushL( result );
+    User::LeaveIfError( result->Sort( ESortByName|EDescending ) );
+
+    TInt major = (*result)[0].iName[9] - '0';
+    TInt minor = (*result)[0].iName[11] - '0';
+
+    CleanupStack::PopAndDestroy(); // result
+    return ((major>3) || (major == 3 && minor >= 2));
+    }
+
+void ResolveBdWgIdL(TInt& aId, RWsSession& aWs, CAlfAppUi& /*aAppUi*/)
+    {
+    if (!IsNewStatusPaneArchL())
+        {
+        CArrayFixFlat<TInt>* wgs = new (ELeave) CArrayFixFlat<TInt>(1); 
+        CleanupStack::PushL(wgs);
+        aWs.WindowGroupList(ECoeWinPriorityNormal,wgs);
+        TInt wgCount = wgs->Count();
+
+        CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(aWs); 
+        HBufC* buf = HBufC::NewL(CApaWindowGroupName::EMaxLength);
+        wgName->SetWindowGroupName(buf);
+
+        for ( TInt spPos = 0; spPos < wgCount; spPos++)
+            {
+            TPtr des = buf->Des();
+            TInt err = aWs.GetWindowGroupNameFromIdentifier(wgs->At(spPos), des);
+            if (!err)
+                {
+                if ( wgName->Caption().Compare(EIKON_SERVER_BACKDROP_WINDOW_GROUP_NAME) == 0)
+                    {
+                    aId = wgs->At(spPos);
+                    break;
+                    }
+                }
+            }
+        CleanupStack::PopAndDestroy(2); // wgName, wgs
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Creates container for session in which it holds the sub sessions.
+// ---------------------------------------------------------------------------
+// 
+CObjectCon* CAlfAppServer::NewContainerL()
+    {
+    if ( !iObjectConIx )
+        {
+        iObjectConIx = CObjectConIx::NewL();
+        // we don't have ConstructL, so this would be suitable place to do one-shot-only construction 
+        if(CCoeEnv::Static())
+            {
+            ResolveBdWgIdL(iBackDropWgIdentifier, *iWs, *iAppUi);
+            }
+        }
+        
+    return iObjectConIx->CreateL();
+    }
+
+// ======== RnD FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Logs window groups
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppServer::LogWindowGroupsL() const
+    {
+#ifdef _ALF_LOGGING
+    // uncomment block if you want to log the window group order.
+    /*
+    CArrayFixFlat<TInt>* wgs = new (ELeave) CArrayFixFlat<TInt>(4); 
+    CleanupStack::PushL(wgs);
+    iWs->WindowGroupList(wgs);
+    const TInt focusedWg = iWs->GetFocusWindowGroup();
+    
+    for ( TInt i = 0; i < wgs->Count() ; i++ )
+        {
+        TThreadId threadId;
+        iWs->GetWindowGroupClientThreadId(wgs->At(i), threadId);
+        RThread thread;
+        if ( thread.Open(threadId) == KErrNone )
+            {
+            TName name = thread.Name();
+            TPtrC ptr(name);
+            if ( wgs->At(i) == focusedWg )
+                {
+                __ALFLOGSTRING3( " [%d] wg:%d %S FOCUSED",i,wgs->At(i), &ptr );
+                }
+            else
+                {
+                __ALFLOGSTRING3( " [%d] wg:%d %S",i,wgs->At(i), &ptr );
+                }
+            }
+        }
+    
+    CleanupStack::PopAndDestroy( wgs );
+    */
+#endif
+    }
+
+MAlfExtension* CAlfAppServer::CreateExtensionL(TInt aImplementationUid, TInt aImplementationId, const RMessage2 & aMessage )
+    {   
+    TAlfElementFactory* factory = 0;
+
+    if (iFactories.Count() == 0)
+        {
+        TAlfElementFactory ef;
+        ef.iUid = KNullUid;
+        ef.iImpl = new (ELeave) TAlfFixedFactory;
+        ef.iDestructorUid = KNullUid;
+        iFactories.AppendL(ef);
+        }
+
+    // Check if factory already loaded
+    for(TInt ii = iFactories.Count()-1; ii>=0;ii--)
+        {
+        if (iFactories[ii].iUid == TUid::Uid(aImplementationUid))
+            {
+            factory = &iFactories[ii];
+            break;
+            }
+        }
+
+    if (!factory)
+        {        
+        // Todo should actually perform interface based scan and check that possible candidate (if any)
+        // implements correct interface also
+        // K_ALF_FACTORY_INTERFACE
+        
+        TAlfElementFactory ef;
+        ef.iUid = TUid::Uid(aImplementationUid);
+        ef.iImpl = (MAlfExtensionFactory*)REComSession::CreateImplementationL(
+            ef.iUid, 
+            ef.iDestructorUid);
+        User::LeaveIfNull(ef.iImpl);
+        iFactories.AppendL(ef);
+        factory = &iFactories[iFactories.Count()-1];
+
+        if (!iEcomWatcher)
+            {
+            iEcomWatcher = CAlfEcomUtil::NewL(*this);
+            iEcomWatcher->Start();
+            }
+        }
+
+    HBufC8* inBuf = 0;   
+    TInt paramsLenght = aMessage.GetDesLength(1);
+    if (paramsLenght > 0)
+        {
+        inBuf = HBufC8::NewLC(paramsLenght);        
+        TPtr8 ptr = inBuf->Des();
+        aMessage.ReadL(1,ptr);
+        }
+
+    // Create implementation    
+    MAlfExtension* object = 0;
+    if (inBuf)
+        {
+        object = factory->iImpl->CreateExtensionL(aImplementationId, inBuf->Des(), *((CAlfAppSrvSessionBase*)aMessage.Session()));
+        CleanupStack::PopAndDestroy(inBuf);
+        }
+    else
+        {
+        object = factory->iImpl->CreateExtensionL(aImplementationId, KNullDesC8, *((CAlfAppSrvSessionBase*)aMessage.Session()));       
+        }    
+    
+    factory->iAccessCount++;
+
+    if (!object) // actually factory should leave
+        {
+        User::Leave(KErrNotSupported);
+        } 
+
+    return object;
+    }
+        
+
+void CAlfAppServer::DestroyedObject(TInt aFactoryUid)
+    {
+    if (!aFactoryUid)
+        {
+        return;        
+        }
+ 
+    TInt ii = -1;
+    for ( ii = iFactories.Count()-1; ii >= 0; ii--)
+        {
+        if (iFactories[ii] == aFactoryUid)
+            {
+            iFactories[ii].iAccessCount--;
+            if (iFactories[ii].iAccessCount == 0)
+                {
+                iFactories[ii].iImpl->Release();
+                if (iFactories[ii].iDestructorUid.iUid)
+                    {
+                    REComSession::DestroyedImplementation(
+                            iFactories[ii].iDestructorUid);
+                    }
+                iFactories.Remove(ii);
+                User::Heap().Compress();
+                }
+            break;
+            }
+        }
+    }
+
+void CAlfAppServer::NotifySessionsAboutDestroyedImplementation(TInt aFactoryUid)
+    {
+    iSessionIter.SetToFirst();
+    while (iSessionIter)
+        {
+        CAlfAppSrvSessionBase* session =
+            reinterpret_cast<CAlfAppSrvSessionBase*>(iSessionIter++);
+        
+        session->FactoryDestroyed(aFactoryUid);
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Create a transition effect instance for the server if it does not exist
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppServer::CreateTransitionEffectsL()
+	{
+	if ( iTransitionEffects == NULL )
+		{
+		iTransitionEffects = CAlfSrvTransEffect::NewL();
+		}
+	}
+
+
+// ---------------------------------------------------------------------------
+// Return a pointer to the transition effects instance 
+// ---------------------------------------------------------------------------
+// 
+CAlfSrvTransEffect* CAlfAppServer::TransitionEffects()
+	{
+	return( iTransitionEffects );
+	}
+
+// -----------------------------------------------------------------------------
+// Create Tfx Server client plugin and make a connection to Tfx Server
+// -----------------------------------------------------------------------------
+//
+TInt CAlfAppServer::CreateTfxServerPlugin()
+    {
+    TInt err = KErrNone;
+    
+	#ifdef TFXSERVER_API_V2
+    if (iTfxServer == NULL)
+        {
+        TUid implementationUidSrv = { KTfxSrv2EcomImpl };
+        TRAP(err, iTfxServer = (MTransitionServer2*)
+            REComSession::CreateImplementationL( implementationUidSrv, iTfxServerEComDestructorUID,
+            	NULL ));
+        }
+   	if (!err && (iTfxServer != NULL))
+		{
+        if (!iTfxServer->IsConnected())
+    		{
+            err = iTfxServer->Connect();
+            }	
+		}
+	#endif
+		
+	return err;	
+    }
+    
+    
+// -----------------------------------------------------------------------------
+// Return Tfx Server client pointer if possible
+// -----------------------------------------------------------------------------
+//
+MTransitionServer2* CAlfAppServer::TfxServer()
+	{
+	TInt err = KErrNone;
+	#ifdef TFXSERVER_API_V2
+    if (iTfxServer && !iTfxServer->IsConnected())
+  		{
+        err = iTfxServer->Connect();
+        }	
+	#endif
+	return (err ? NULL : iTfxServer);
+	}
+	
+
+// ---------------------------------------------------------------------------
+// Triggers sending a system event to clients
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppServer::TriggerSystemEvent(TInt aEvent)
+    {
+    iSessionIter.SetToFirst();
+    while (iSessionIter)
+        {
+        CAlfAppSrvSessionBase* session =
+            reinterpret_cast<CAlfAppSrvSessionBase*>(iSessionIter++);
+        
+        session->TriggerSystemEvent(aEvent);
+        }        
+    }
+ 
+TBool CrossCheckForeground(TAny* aThis)
+    {
+    CAlfAppServer* me = (CAlfAppServer*)aThis;
+    
+//#ifdef HUI_FX
+    if ( me->iOldSession )
+        {
+        TRAP_IGNORE( me->iOldSession->ActivateContainerLayoutL(EFalse); 
+        me->iOldSession = NULL;
+        me->CancelBackgroundTimer(); );
+        return EFalse;
+        }
+//#endif    
+    TRAP_IGNORE(me->FocusedWindowGroupChangedL(0)) // cancels the timer
+    return EFalse; 
+    }
+
+void CAlfAppServer::StartBackgroundTimerL(TInt aClientWg)
+    {
+    if (aClientWg != iLastActiveClientWg)
+        {
+        CancelBackgroundTimer();
+        return;
+        }
+        
+    if (!iBackgroundTimer)
+        {
+        iBackgroundTimer = CPeriodic::NewL(EPriorityNormal);
+        }
+    CancelBackgroundTimer(); // reset the time in case of active timers
+/*    
+#ifdef HUI_FX    
+*/
+    if ( iOldSession )
+        {
+        // longer delay to allow the application to start properly
+        iBackgroundTimer->Start(1500000,0,TCallBack(CrossCheckForeground, this));
+        }
+    else
+        {
+        iBackgroundTimer->Start(20000,0,TCallBack(CrossCheckForeground, this));
+        }
+/*        
+#else    
+    iBackgroundTimer->Start(20000,0,TCallBack(CrossCheckForeground, this));
+#endif
+*/    
+    }
+    
+void CAlfAppServer::CancelBackgroundTimer()
+    {
+    if(iBackgroundTimer)
+        {
+        iBackgroundTimer->Cancel();
+        }
+    }
+    
+TInt CAlfAppServer::CommonCommandBatchBufferMaxLength() const
+    {
+    return iCommonCommandBatchBuffer->Des().MaxLength();
+    }
+
+TBool CAlfAppServer::AcquireCommonCommandBatchBuffer( TPtr8& aBuffer )
+    {
+    TBool result = EFalse;
+    
+    if ( !iCommonCommandBatchBufferInUse )
+        {
+        // In practice, iCommonCommandBatchBufferInUse might be true only
+        // if MAlfExtension::HandleCmdL starts active scheduler.
+        // (but then ServiceL should not be called again)
+
+        result = ETrue;
+        iCommonCommandBatchBufferInUse = ETrue;
+        aBuffer.Set( iCommonCommandBatchBuffer->Des() );
+        aBuffer.Zero();
+        }
+
+    return result;
+    }
+
+void CAlfAppServer::ReleaseCommonCommandBatchBuffer()
+    {
+    iCommonCommandBatchBufferInUse = EFalse;
+    }
+    
+CAlfSrvTextureManager& CAlfAppServer::TextureManager()
+    {
+    return *iTextureManager;
+    }
+    
+CAlfSrvScreenBufferManager& CAlfAppServer::ScreenBufferManager()
+    {
+    return *iScreenBufferManager;
+    }
+
+TBool CAlfAppServer::AlfClientHasFocus()
+    {
+    TBool result = EFalse;
+    TInt focusWindowGroupId = WsSession().GetFocusWindowGroup();
+
+    iSessionIter.SetToFirst();
+    while (iSessionIter)
+      {
+      CAlfAppSrvSessionBase* session = reinterpret_cast<CAlfAppSrvSessionBase*>(iSessionIter++);
+      if ( session && session->ClientWindowGroup() == focusWindowGroupId )
+          {
+          result = ETrue;
+          break;
+          }
+      }
+    return result;
+    }
+
+CAlfAppSrvSessionBase* CAlfAppServer::UpMostClientAboveWg( TInt aWgId )
+    {
+    if (!iAppUi && !CCoeEnv::Static())
+        return 0;
+            
+    CAlfAppSrvSessionBase* sessionAboveGivenWgId = NULL;
+     
+    CArrayFixFlat<TInt>* wgs = new CArrayFixFlat<TInt>(4);
+    if ( wgs )
+        {
+        iWs->WindowGroupList( 0, wgs);
+        TInt topmostWgId = wgs->At( 0 );
+         for ( TInt ordinal = 0 ; ordinal < wgs->Count(); ordinal++ )
+            {
+            iSessionIter.SetToFirst();
+            if( sessionAboveGivenWgId || aWgId == wgs->At( ordinal ) ) 
+               {
+                // either above client app's wg was found or there wasn't any client app's wg above given aWgId
+                break;
+                }
+            while (iSessionIter)
+                {
+                CAlfAppSrvSessionBase* session = reinterpret_cast<CAlfAppSrvSessionBase*>(iSessionIter++);
+                if ( session && 
+                     session->ClientWindowGroup() == topmostWgId )
+                    {
+                    sessionAboveGivenWgId = session;
+                    break;
+                    }
+                 }
+            }
+        }
+    delete wgs;
+    return sessionAboveGivenWgId;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfappservercore.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project alfappservercore
+*
+*/
+
+
+
+
+#include "../../CommonInc/alfuids.h"
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+
+
+MACRO ALF_USE_CANVAS
+#define ALF_USE_CANVAS
+
+// Enable this to add GetWinIdListL method to CAlfWindowManager API.
+// That is needed by test effect plugin.
+//MACRO RND_FXPLUGIN_FIX 
+
+// Enable or disable to allow huicanvas visual tracking in debugger
+// MACRO ALF_DEBUG_TRACK_DRAWING
+// MACRO HUI_DEBUG_TRACK_DRAWING
+// #define HUI_DEBUG_TRACK_DRAWING
+
+// MACRO ALF_DEBUG_PRINT_NODE_INFO
+
+
+TARGET                  alfappservercore.dll
+TARGETTYPE              dll
+UID                     0x1000008d KAlfAppServerCoreUid3
+VERSION                 10.0
+
+CAPABILITY              CAP_GENERAL_DLL
+VENDORID                VID_DEFAULT
+
+SOURCEPATH              ../Src
+SOURCE                  alfappui.cpp
+SOURCE                  alfappserver.cpp
+SOURCE                  alfappsrvsessionBase.cpp
+SOURCE                  alfappsrvsession.cpp
+SOURCE                  alfsrvsubsessionbase.cpp
+SOURCE                  alfsrvdisplaysubsession.cpp
+SOURCE                  alfsrvcontrolgroupsubsession.cpp
+SOURCE                  alfsrvtransformationsubsession.cpp
+SOURCE                  alfstaticfactory.cpp
+SOURCE                  alfvisualhandlers.cpp
+SOURCE                  alflayouthandlers.cpp
+SOURCE                  alfbrushhandlers.cpp
+SOURCE                  alfmappingfunctionhandlers.cpp
+SOURCE					alftextstylehandlers.cpp
+SOURCE                  alfserverutils.cpp
+SOURCE                  alfsrvvisualowner.cpp
+SOURCE                  alfsrvresourcemanager.cpp
+SOURCE                  alfsrvsettingshandler.cpp
+SOURCE                  alfsrveffectenv.cpp
+SOURCE                  alfsrvtranseffect.cpp
+SOURCE                  alfsrvtexturemanager.cpp
+SOURCE                  alfsrvscreenbuffermanager.cpp
+SOURCE                  alfsrvdropshadowhandler.cpp
+SOURCE                  alfshareddisplaycoecontrol.cpp
+#ifdef SYMBIAN_BUILD_GCE
+SOURCE                  alfstreamerserver.cpp
+SOURCE                  alfwindow.cpp
+SOURCE                  alfwindowbuffer.cpp
+SOURCE                  alfwindowfxplugin.cpp
+SOURCE                  alfwindowmanager.cpp
+SOURCE                  alfhierarchymodel.cpp
+SOURCE                  alfstreamerbridge.cpp
+SOURCE                  alfnodes.cpp
+SOURCE                  alfbridge.cpp
+SOURCE                  alfscreen.cpp
+#endif
+
+USERINCLUDE             ../Inc
+USERINCLUDE				../../coretoolkit/inc
+SYSTEMINCLUDE           ../../CommonInc
+
+#include <platform_paths.hrh>
+MW_LAYER_SYSTEMINCLUDE
+
+
+SYSTEMINCLUDE           /epoc32/include/ecom
+SYSTEMINCLUDE           ../../../../inc
+SYSTEMINCLUDE           /epoc32/include/stdapis
+
+LIBRARY                 apfile.lib 
+LIBRARY                 apgrfx.lib
+LIBRARY                 apparc.lib 
+LIBRARY                 avkon.lib
+LIBRARY                 cone.lib 
+LIBRARY                 ecom.lib
+LIBRARY                 eikcore.lib 
+LIBRARY                 eiksrv.lib
+LIBRARY                 eiksrvc.lib
+LIBRARY                 euser.lib
+LIBRARY                 flogger.lib
+LIBRARY                 hitchcock.lib
+LIBRARY                 ws32.lib 
+LIBRARY                 fbscli.lib
+LIBRARY                 alfclient.lib // for alftimedvalue
+LIBRARY                 ftokenclient.lib 
+LIBRARY                 aknlayout2scalable.lib
+LIBRARY                 hwrmlightclient.lib
+LIBRARY                 centralrepository.lib
+LIBRARY                 gdi.lib
+LIBRARY                 efsrv.lib
+LIBRARY                 aknskins.lib
+LIBRARY                 aknlayout2hierarchy.lib
+LIBRARY                 akntransitionutils.lib
+#ifdef SYMBIAN_BUILD_GCE
+LIBRARY                 alfdecoderserverclient.lib
+LIBRARY                 estor.lib  // used by AlfRenderStage
+LIBRARY                 bitgdi.lib
+LIBRARY                 bafl.lib
+#endif // #ifdef SYMBIAN_BUILD_GCE
+
+#ifdef HUI_DEBUG_TRACK_DRAWING
+LIBRARY					alfcommanddebug.lib
+#endif
+SOURCE themerepositorylistener.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfappsrvsession.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,2837 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Server session
+*
+*/
+
+
+#include <flogger.h>
+#include "alfappsrvsession.h"
+#include "alf/alfappserver.h"
+#include "alf/alfappui.h"
+#include "alf/alfconstants.h"
+#include "alf/alfclientwindow.h"
+#include "alfsrvdisplaysubsession.h"
+#include "alfsrvcontrolgroupsubsession.h"
+#include "alfsrvsettingshandler.h"
+#include "alfsrvtranseffect.h"
+#include "alf/alfsrveffectenv.h"
+#include "alf/alfserverutils.h"
+#include "alflogger.h"
+#include "alfclientserver.h"
+#include "alfsrvtexturemanager.h"
+#include "alfsrvscreenbuffermanager.h"
+
+#include <coemain.h>
+
+#include <alf/alfroster.h>
+#include <alf/alftexture.h>
+
+#include <uiacceltk/HuiControl.h>
+#include <uiacceltk/HuiControlGroup.h>
+#include <uiacceltk/HuiDisplay.h>
+#include <uiacceltk/HuiDisplayCoeControl.h>
+#include <uiacceltk/HuiEnv.h>
+#include <uiacceltk/HuiTextVisual.h>
+#include <uiacceltk/HuiTransformation.h>
+#include <uiacceltk/HuiBorderBrush.h>
+#include <uiacceltk/HuiImageVisual.h>
+#include <uiacceltk/HuiGridLayout.h>
+#include <uiacceltk/HuiTextureProcessor.h>
+#include <uiacceltk/HuiSegmentedTexture.h>
+#include <uiacceltk/huitextstylemanager.h>
+#include <uiacceltk/huitextstyle.h>
+#include <uiacceltk/HuiFont.h>
+#include <uiacceltk/HuiTexture.h>
+#include <uiacceltk/HuiUtil.h>
+
+_LIT( KAlfFPSLogDir, "alf"); // remember to create the c:\logs\alf in order to enable logging
+_LIT( KAlfFPSLogFile, "alffpslog.txt");
+    
+
+const TReal32 KAlfUseDefaultFrameRate = 0.f;
+
+TBool RealCompare( 
+    TReal32 aCompare1, 
+    TReal32 aCompare2, 
+    TReal32 aEpsilon = 0.001f  )
+    {
+    if ( Abs(aCompare1 - aCompare2) < aEpsilon )
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+/**
+ * Size of command batch buffer allocated from stack.
+ * (This is used if all else fails)
+ */
+const TInt KAlfStackBatchBufferSize = 128;
+
+// bitmap provider
+
+NONSHARABLE_CLASS(CSharedBitmapProvider) : public CBase, public MHuiBitmapProvider
+	{
+public:
+	CSharedBitmapProvider();
+	CSharedBitmapProvider(TInt aBitmapHandle, TInt aMaskHandle);
+	~CSharedBitmapProvider();
+	// from MHuiBitmapProvider	
+	void ProvideBitmapL(TInt aId, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap);				
+private:
+	TInt iBitmapHandle;
+	TInt iMaskHandle;
+	};
+
+CSharedBitmapProvider::CSharedBitmapProvider()
+	{
+		
+	}
+
+CSharedBitmapProvider::CSharedBitmapProvider(TInt aBitmapHandle, TInt aMaskHandle)
+	{
+	iBitmapHandle = aBitmapHandle;
+	iMaskHandle = aMaskHandle;	
+	}
+
+CSharedBitmapProvider::~CSharedBitmapProvider()
+	{
+	}
+
+void CSharedBitmapProvider::ProvideBitmapL(TInt /*aId*/, CFbsBitmap*& aBitmap, CFbsBitmap*& aBitmapMask)
+	{
+	CFbsBitmap* bitmap(0);
+	CFbsBitmap* mask(0);
+	
+	if (iBitmapHandle) // mandatory
+	    {
+	    bitmap = new (ELeave) CFbsBitmap;
+	    CleanupStack::PushL(bitmap);
+	    bitmap->Reset();
+	    User::LeaveIfError(bitmap->Duplicate(iBitmapHandle));
+	    }
+	else
+	    {
+	    User::Leave(KErrArgument);
+	    }
+	       
+	if ( iMaskHandle ) // optional
+	    {
+     	mask = new (ELeave) CFbsBitmap;
+	    CleanupStack::PushL(mask);
+	    mask->Reset();
+	    User::LeaveIfError(mask->Duplicate(iMaskHandle));
+	    CleanupStack::Pop(); // mask
+	    }
+	
+    CleanupStack::Pop(); // bitmap
+    aBitmapMask = mask; 	
+    aBitmap = bitmap; 	
+    }
+
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfAppSrvSession::CAlfAppSrvSession(const CAlfAppServer* aServer)
+    : CAlfAppSrvSessionBase(aServer),
+      iExecutionFlags( 
+        EAlfExecuteUsingDynamicBuffer + EAlfExecuteUsingCommonBuffer )
+    {
+    }
+
+CAlfAppSrvSession* CAlfAppSrvSession::NewL(const CAlfAppServer* aServer)
+    {
+    CAlfAppSrvSession* me = new (ELeave) CAlfAppSrvSession(aServer);
+    CleanupStack::PushL(me);
+    me->ConstructL();
+    CleanupStack::Pop();
+    return me;
+    }
+
+void CAlfAppSrvSession::ConstructL()
+    {
+    BaseConstructL();
+    
+    AlfServer()->SetWindowChangeObserverL(this, TInt(this)); 
+    
+    iRefreshMode = EHuiRefreshModeAutomatic;
+    iMaxFrameRate = KAlfUseDefaultFrameRate;
+    iIdleThreshold = 10 * 1000; // 10 from HuiEnv as seconds
+    iEffectEnv = CAlfSrvEffectEnv::NewL(*this);
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfAppSrvSession::~CAlfAppSrvSession()
+    {
+    iOwnershipItems.ResetAndDestroy();    
+    
+    if ( iTextureOwnedIdSet )
+        {
+        CAlfSrvTextureManager& manager = AlfTextureManager();
+        TProcessId ownerId = TextureOwnerId();
+        manager.DestroyDeletedTextureIds( ownerId );
+        manager.RemoveClient( *this );
+        }
+    iTextures.ResetAndDestroy();        
+    iAnimatedTextures.ResetAndDestroy();
+    
+    delete iEffectEnv;
+    iEffectEnv = NULL;
+    
+    iTextureInfo.Close();
+    
+    iControlGroupOrder.Close();
+    }
+
+
+TRect CAlfAppSrvSession::ClientDrawingArea() const
+    {
+    return iClientDisplayRect;
+    }
+    
+void CAlfAppSrvSession::SetClientDrawingArea( const TRect& aRect )
+    {
+    TRAP_IGNORE(SetClientDrawingAreaL(aRect))
+    }
+
+void CAlfAppSrvSession::SetClientDrawingAreaL( const TRect& aRect )
+    {
+    iClientDisplayRect = aRect;
+    
+    // Update all the control groups
+    RPointerArray<CAlfSrvSubSessionBase> groups;
+    CleanupClosePushL( groups );
+    GetSubsessionsByTypeL( groups, EHuiObjectTypeControlGroup );
+    for ( TInt g = 0 ; g < groups.Count() ; g++ )
+        {
+        CHuiControlGroup* group = groups[g]->AsHuiControlCroup();
+        ASSERT( group ); 
+        CHuiLayout* hostContainer = group->Control(0).ContainerLayout( NULL );
+        
+        hostContainer->SetSize( iClientDisplayRect.Size() );
+        hostContainer->SetPos( iClientDisplayRect.iTl );
+        }
+    CleanupStack::PopAndDestroy( &groups ); // groups.Close()
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CAlfAppSrvSessionBase.
+// Called when client receives focus.
+// ---------------------------------------------------------------------------
+//   
+void CAlfAppSrvSession::FocusGainedL( TBool aDoTransitionEffect )
+    {
+    iFocused = ETrue;
+    DeliverTextureInfo();
+    
+    // update frame rate
+    if ( RealCompare( iMaxFrameRate, KAlfUseDefaultFrameRate ) )
+        {
+        SharedHuiEnv()->SetMaxFrameRate( 
+            TReal32(AlfAppUi()->SettingsHandler().DefaultFramerate()) );
+        }
+    else
+        {
+        SharedHuiEnv()->SetMaxFrameRate( iMaxFrameRate );
+        }
+    
+    // update refresh mode
+    if ( SharedHuiEnv()->RefreshMode() != iRefreshMode )
+        {
+        SharedHuiEnv()->SetRefreshMode( iRefreshMode );
+        }
+
+    // update idle threshold
+    SharedHuiEnv()->SetIdleThreshold( iIdleThreshold );
+    
+    // update display attributes for each display
+    CHuiDisplay* display = NULL;
+    RPointerArray<CAlfSrvSubSessionBase> displays;
+    CleanupClosePushL( displays );
+    GetSubsessionsByTypeL( displays, EHuiObjectTypeDisplay );
+    for ( TInt d = 0 ; d < displays.Count() ; d++ )
+        {
+        CAlfSrvDisplaySubSession* displaySubSession = 
+                static_cast<CAlfSrvDisplaySubSession*>( displays[d] );     
+        displaySubSession->SetSessionFocused();
+        if ( !display && !displaySubSession->IsTvOut())
+            {
+            display = &displaySubSession->Display();
+            }
+        }     
+    CleanupStack::PopAndDestroy( &displays ); // displays.Close()
+    
+    if ( !display )
+        {
+        return;
+        }
+    
+    // Enable animated textures for the session
+    for (TInt index = 0; index < iAnimatedTextures.Count(); index++)
+        {
+       	iAnimatedTextures.operator[](index)->EnableAnimation(ETrue);     
+        }
+
+    if ( aDoTransitionEffect && AlfServer()->TransitionEffects()->IsEnabled() &&
+         (display->DisplayType() != CHuiDisplay::EDisplayOffScreenBuffer))        
+        {
+       	ASSERT(AlfServer()->TransitionEffects() != NULL);
+       	AlfServer()->TransitionEffects()->StartPhase( MAlfTransEffectPlugin::EFirstPhase, 
+       	    aDoTransitionEffect, *iEffectEnv );            
+       	
+       	iControlGroupOrder.Reset();
+        }
+    else
+        {
+        ShowControlGroupsInOrderL(*display);
+        }    
+
+	// This is needed for Huitk BitBlit() to succeed 
+    
+#ifdef SYMBIAN_BUILD_GCE
+    SharedHuiEnv()->ContinueRefresh();
+#else
+    AlfAppUi()->Container()->DrawNow();
+#endif
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CAlfAppSrvSessionBase.
+// Called when client loses focus.
+// ---------------------------------------------------------------------------
+//
+TBool CAlfAppSrvSession::FocusLostL( TBool aDoTransitionEffect )
+    {
+    iFocused = EFalse;
+
+    TBool didTransition = EFalse;
+    
+    if ( !SharedHuiEnv()->DisplayCount() )
+        {
+        return EFalse;
+        }
+
+    // Notify displays about losing focus so that tv out can be released
+    CHuiDisplay* display = NULL;
+    RPointerArray<CAlfSrvSubSessionBase> displays;
+    CleanupClosePushL( displays );
+    GetSubsessionsByTypeL( displays, EHuiObjectTypeDisplay );
+    for ( TInt d = 0 ; d < displays.Count() ; d++ )
+        {
+        CAlfSrvDisplaySubSession* displaySubSession = 
+                static_cast<CAlfSrvDisplaySubSession*>( displays[d] );     
+        displaySubSession->SetSessionFocused(EFalse);
+        if ( !display && !displaySubSession->IsTvOut())
+            {
+            display = &displaySubSession->Display();
+            }
+            
+        }     
+    CleanupStack::PopAndDestroy( &displays ); // displays.Close()
+
+    if ( !display )
+        {
+        return didTransition;
+        }
+
+/*        
+#ifdef HUI_FX
+*/
+    if (display->DisplayType() != CHuiDisplay::EDisplayOffScreenBuffer) 
+    	{
+    	// Disable all animated textures for the session
+    	for (TInt index = 0; index < iAnimatedTextures.Count(); index++)
+        	{
+      		iAnimatedTextures.operator[](index)->EnableAnimation(EFalse); 
+        	}
+       	
+      	StoreControlGroupOrderL(*display, EFalse ); // do not hide  
+       	// background must be drawn as long as the effect is displayed 
+       	// as the background will be visible if the effect does not cover full screen
+       	// or is partially transparent.
+    	}
+/*    	
+#else
+    // Do not hide or set transparency if this is off-screen buffer         
+    if (display->DisplayType() != CHuiDisplay::EDisplayOffScreenBuffer) 
+    	{
+    	// Disable all animated textures for the session
+    	for (TInt index = 0; index < iAnimatedTextures.Count(); index++)
+        	{
+      		iAnimatedTextures.operator[](index)->EnableAnimation(EFalse); 
+        	}
+
+     	if ( aDoTransitionEffect && AlfServer()->TransitionEffects()->IsEnabled() )
+        	{
+        	StoreControlGroupOrderL(*display, EFalse ); // do not hide  
+        	ASSERT(AlfServer()->TransitionEffects() != NULL);
+        	AlfServer()->TransitionEffects()->StartPhase( MAlfTransEffectPlugin::EFirstPhase, 
+            	aDoTransitionEffect, *iEffectEnv );            
+        	didTransition = ETrue;
+        	}
+    	// Hide control groups 
+    	else 
+        	{
+        	StoreControlGroupOrderL(*display, ETrue ); // hide as well     
+    		}
+    		
+#ifdef SYMBIAN_BUILD_GCE
+        // When alf application is not focused we dont draw background because it is
+        // not visible as the alf application is not visible either (its controlgroups
+        // were just hidden in the code above).
+   	    display->SetClearBackgroundL(CHuiDisplay::EClearNone);
+#endif
+    	}
+#endif    		
+*/
+    
+    return didTransition;
+    }
+
+void CAlfAppSrvSession::StoreControlGroupOrderL(CHuiDisplay& aDisplay, TBool aAlsoHide )
+    {
+    for ( TInt g = 0 ; g < aDisplay.Roster().Count() ; g++ )
+        {
+        // first append the bottom one
+        CHuiControlGroup& group = aDisplay.Roster().ControlGroup( g );
+        
+        // make sure we only store control groups for this session
+        if ( GetHandleFromInterface(EHuiObjectTypeControlGroup, &group) != KErrNotFound )
+            {
+            iControlGroupOrder.AppendL( &group );
+            }
+        }
+    // at the end the lowest index the bottom most and the biggest index the top most.
+    
+    // hide at the end so it does not affect the order of the group in the roster
+    if ( aAlsoHide )
+        {
+        for ( TInt i = 0 ; i < iControlGroupOrder.Count() ; i++ )
+            {
+            CHuiLayout* hostContainer = iControlGroupOrder[i]->Control(0).ContainerLayout( NULL );
+            hostContainer->iOpacity.Set(0.f); 
+            aDisplay.Roster().Hide( *iControlGroupOrder[i] );
+            }
+        }
+    }
+    
+void CAlfAppSrvSession::ShowControlGroupsInOrderL(CHuiDisplay& aDisplay)
+    {
+    while ( iControlGroupOrder.Count() )
+        {
+        CHuiControlGroup& group = *iControlGroupOrder[iControlGroupOrder.Count()-1];
+        
+        // make sure that the group still exists.
+        if ( GetHandleFromInterface(EHuiObjectTypeControlGroup, &group) != KErrNotFound )
+            {
+            CHuiLayout* hostContainer = group.Control(0).ContainerLayout( NULL );
+            hostContainer->iOpacity.Set(1.f); 
+#ifdef SYMBIAN_BUILD_GCE
+            AlfAppUi()->ShowControlGroupL(aDisplay.Roster(), group, KAlfRosterShowAtBottom, 0); 
+#else    
+            aDisplay.Roster().ShowL( group, KAlfRosterShowAtBottom );
+#endif
+            iControlGroupOrder.Remove(iControlGroupOrder.Count()-1);
+            }
+        }
+    iControlGroupOrder.Reset();
+    }
+    
+void CAlfAppSrvSession::ReOrderControlGroupSessionsL( RPointerArray<CAlfSrvSubSessionBase>& aGroupSessions )
+    {
+    if ( iControlGroupOrder.Count() && aGroupSessions.Count() > 1 )
+        {
+        // go through the items from bottom to top
+        for ( TInt g = iControlGroupOrder.Count() -1 ; g >= 0 ; g-- ) 
+            {
+            CHuiControlGroup* nextGroupFromBottom = iControlGroupOrder[g];
+            
+            // Find the session and move it into first position
+            for ( TInt s = 0 ; s < aGroupSessions.Count() ; s++ )
+                {
+                CAlfSrvControlGroupSubSession* controlGroupSubSession = static_cast<CAlfSrvControlGroupSubSession*>( aGroupSessions[s] );   
+                if ( &controlGroupSubSession->ControlGroup() == nextGroupFromBottom )
+                    {
+                    // move into g:th position
+                    aGroupSessions.Remove( s );
+                    User::LeaveIfError( aGroupSessions.Insert( controlGroupSubSession, 0 ) );
+                    }
+                }
+            }
+        }
+    }
+
+void CAlfAppSrvSession::SetBackgroundMaxFps( TBool aBackground )
+    {
+    
+    TReal32 newMaxFrameRate = 0;
+    
+    // update frame rate
+    if ( RealCompare( iMaxFrameRate, KAlfUseDefaultFrameRate ) )
+        {
+        newMaxFrameRate = TReal32( AlfAppUi()->SettingsHandler().DefaultFramerate() );
+        SharedHuiEnv()->SetMaxFrameRate( 
+            TReal32(AlfAppUi()->SettingsHandler().DefaultFramerate()) );
+        }
+    else
+        {
+        newMaxFrameRate = iMaxFrameRate;
+        }    
+    
+    if( aBackground )
+        {  
+        newMaxFrameRate /= 2;
+        }
+    SharedHuiEnv()->SetMaxFrameRate( newMaxFrameRate );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Is client application focused?
+// ---------------------------------------------------------------------------
+//    
+TBool CAlfAppSrvSession::IsFocused() const
+    {
+    return iFocused;
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// From class MWindowVisibilityObserver.
+// Called when window becomes fully visible.
+// ---------------------------------------------------------------------------
+//
+void CAlfAppSrvSession::WindowFullyVisible()
+    {
+    iPartiallyVisible = ETrue;
+    DeliverTextureInfo();
+    }
+   
+// ---------------------------------------------------------------------------
+// From class MWindowVisibilityObserver.
+// Called when window becomes partially visible.
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppSrvSession::WindowPartiallyVisible()
+    {
+    iPartiallyVisible = ETrue;
+    DeliverTextureInfo();
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MWindowVisibilityObserver.
+// Called when window becomes fully invisible.
+// ---------------------------------------------------------------------------
+//
+void CAlfAppSrvSession::WindowNotVisible()
+    {
+    // already not shown...
+    if ( !iPartiallyVisible )
+        {
+        return;
+        }
+    iPartiallyVisible = EFalse;
+    }
+
+// ---------------------------------------------------------------------------
+// From class MWindowVisibilityObserver.
+// Returns window-owning control.
+// ---------------------------------------------------------------------------
+//
+CCoeControl* CAlfAppSrvSession::CoeControl()
+    {
+    return NULL;//iCoeDisplay;
+    }
+
+CAlfAppServer::TAlfWGPostion CAlfAppSrvSession::PreferredWindowGroupPosition() const
+    {
+    if ( iUsesFullScreen )
+        {
+        return CAlfAppServer::EOnTopOfParent;
+        }
+    else
+        {
+        return CAlfAppServer::EBehindOfParent;
+        }
+    }
+    
+THuiRefreshMode CAlfAppSrvSession::PreferredRefreshMode() const
+    {
+    return iRefreshMode;
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class CAlfAppSrvSessionBase.
+// Called when a message is received from the client.
+// ---------------------------------------------------------------------------
+//
+void CAlfAppSrvSession::DoHandleCommandL(const RMessage2& aMessage)
+    {
+    switch( aMessage.Function() )
+        {
+        case EAlfQtCommandBuffer:
+            {
+            PostQtCommandBufferL( aMessage );
+            break;
+            }
+        
+		case EAlfEnvSetRefreshMode:
+            {
+            EnvSetRefreshModeL( aMessage );
+            break;    
+            }
+            
+        case EAlfEnvSetMaxFrameRate:
+            {
+            EnvSetMaxFrameRateL( aMessage );
+            break;
+            }
+            
+        case EAlfEnvContinueRefresh:
+            {
+            EnvContinueRefreshL( aMessage );
+            break;
+            }
+            
+        case EAlfEnvPauseRefresh:
+            {
+            EnvPauseRefreshL( aMessage );
+            break;
+            }
+            
+        case EAlfEnvRefreshCallBack:
+            {
+            EnvRefreshCallBackL( aMessage );
+            break;
+            }
+            
+        case EAlfEnvRenderer:
+            {
+            EnvRendererL( aMessage );
+            break;
+            }
+        case EAlfEnvSetIdleThreshold:
+            {
+            EnvSetIdleThresholdL( aMessage );
+            break;
+            }
+            
+        case EAlfRosterShow:
+            {
+            
+            // Parse parameters
+            // 0: control group handle (in)
+            const TInt cntrlGroupHandle = aMessage.Int0();
+            CAlfSrvSubSessionBase& subSession1 = SubSession( cntrlGroupHandle );
+            CAlfSrvControlGroupSubSession& controlGroupSubSession = 
+                static_cast<CAlfSrvControlGroupSubSession&>(subSession1);
+            CHuiControlGroup& controlGroup = controlGroupSubSession.ControlGroup();
+                
+            // 1: where (in)
+            const TInt where = aMessage.Int1();
+            // 2: display handle (in)
+            const TInt displayHandle = aMessage.Int2();
+            CAlfSrvSubSessionBase& subSession2 = SubSession( displayHandle );
+            CAlfSrvDisplaySubSession& displaySubSession = 
+                static_cast<CAlfSrvDisplaySubSession&>(subSession2);
+            CHuiDisplay& display = displaySubSession.Display();
+
+            controlGroupSubSession.SetIsShown( ETrue );
+            controlGroupSubSession.PreferredPos() = where;
+            
+            // Show only if session is focused, otherwise delay until focus is gained
+            if (iFocused)
+                {
+#ifdef SYMBIAN_BUILD_GCE
+                AlfAppUi()->ShowControlGroupL(display.Roster(), controlGroup, where, 0); 
+#else    
+                display.Roster().ShowL(controlGroup, where);                                    
+#endif
+                AlfServer()->AdjustWindowGroupPositionL( 
+                    *CHuiStatic::RootWin(), 
+                    ClientWindowGroup(), 
+                    PreferredWindowGroupPosition()  );
+
+                }
+            else
+                {                
+                if (where == KHuiRosterShowAtTop)
+                    {
+                    if (iControlGroupOrder.Count())
+                        {
+                        iControlGroupOrder.InsertL(&controlGroup, 0);            
+                        }
+                    else
+                        {
+                        iControlGroupOrder.AppendL(&controlGroup);                
+                        }    
+                    }
+                else if (where == KHuiRosterShowAtBottom)
+                    {
+                    iControlGroupOrder.AppendL(&controlGroup);                
+                    }
+                else
+                    {
+                    if (iControlGroupOrder.Count() < where)
+                        {
+                        iControlGroupOrder.AppendL(&controlGroup);                        
+                        }
+                    else
+                        {
+                        iControlGroupOrder.InsertL(&controlGroup, where);                                        
+                        }                                                
+                    }                                                        
+                }    
+                        
+            break;
+            }
+            
+        case EAlfRosterHide:
+            {
+            RosterHideL(aMessage);
+            break;
+            }
+            
+        case EAlfRosterShowVisual:
+            {
+            RosterShowVisualL(aMessage);
+            break;
+            }
+            
+        case EAlfRosterHideVisual:
+            {
+            RosterHideVisualL(aMessage);
+            break;
+            }
+        case EAlfRosterMoveVisualToFront:
+            {
+            RosterMoveVisualToFrontL(aMessage);
+            break;
+            }
+        case EAlfRosterSetPointerEventFlags:
+            {
+            RosterSetPointerEventFlagsL(aMessage);
+            break;
+            }
+        case EAlfRosterAddPointerEventObserver:
+            {
+            RosterAddPointerEventObserverL(aMessage);
+            break;
+            }
+        case EAlfRosterRemovePointerEventObserver:
+            {
+            RosterRemovePointerEventObserverL(aMessage);
+            break;
+            }
+        case EAlfRosterSetPointerDragTreshold:
+            {
+            RosterSetPointerDragTresholdL(aMessage);
+            break;
+            }
+        case EAlfRosterDisableLongTapEventsWhenDragging:
+            {
+            RosterDisableLongTapEventWhenDraggingL(aMessage);
+            break;
+            }
+        case EAlfTextureStopAnimation:
+            {
+            if ( RequireTextureOwnerId( aMessage ) )
+                {
+                TextureStopAnimation(aMessage);
+                }
+            break;
+            }
+        case EAlfTextureStartAnimation:
+            {
+            if ( RequireTextureOwnerId( aMessage ) )
+                {
+                TextureStartAnimation(aMessage);
+                }
+            break;
+            }
+        case EAlfTextureCreateAnimated:
+            {
+            if ( RequireTextureOwnerId( aMessage ) )
+                {
+                TextureCreateAnimatedL(aMessage);
+                }
+            break;
+            }
+        case EAlfTextureCreate:
+            {
+            if ( RequireTextureOwnerId( aMessage ) )
+                {
+                TextureCreateL(aMessage);
+                }
+            break;
+            }
+             
+        case EAlfTextureUnload:
+            {
+            if ( RequireTextureOwnerId( aMessage ) )
+                {
+                TextureUnload(aMessage);
+                }
+            break;
+            }
+        case EAlfTextureDelete:
+            {
+            if ( RequireTextureOwnerId( aMessage ) )
+                {
+                TextureDelete(aMessage);
+                }
+            break;
+            }
+        case EAlfTextureRelease:
+            {
+            if ( RequireTextureOwnerId( aMessage ) )
+                {
+                TextureRelease(aMessage);
+                }
+            break;
+            }
+        case EAlfTextureRestore:
+            {
+            if ( RequireTextureOwnerId( aMessage ) )
+                {
+                TextureRestore(aMessage);
+                }
+            break;
+            }
+        case EAlfTextureNotifySkinChanged:
+            {
+        	if ( RequireTextureOwnerId( aMessage ) )
+        	    {
+        	    TextureNotifySkinChanged(aMessage);
+        	    }
+            break;
+            }             
+        case EAlfTextureLoad:
+            {
+            if ( RequireTextureOwnerId( aMessage ) )
+                {
+                TextureLoadL(aMessage);
+                }
+            break;
+            } 
+        case EAlfTextureBlur:
+            {
+            if ( RequireTextureOwnerId( aMessage ) )
+                {
+                TextureBlurL(aMessage);
+                }
+            break;
+            } 
+        case EAlfTextureHasContent:
+            {
+            if ( RequireTextureOwnerId( aMessage ) )
+                {
+                TextureHasContentL(aMessage);
+                }
+            break;
+            } 
+        case EAlfTextureUpdateOwnerId:
+            {
+            UpdateTextureOwnerIdL( aMessage );    
+            break;
+            }
+        case EAlfTextureSetAutoSizeParams:
+            {
+            if ( RequireTextureOwnerId( aMessage ) )
+                {
+                TextureSetAutoSizeParamsL( aMessage );    
+                }
+            break;
+            }
+            
+            
+        case EAlfNotifyAppVisibility:
+            {
+            TBool foreground = aMessage.Int0();
+          	if (ClientWindowGroup() != KErrNotFound) // if Alf client have not set wg, treat it like non-Alf app 
+          		{	
+            	if ( foreground )
+                	{         	
+#ifdef SYMBIAN_BUILD_GCE
+                	ActivateContainerLayoutL(ETrue);         	
+#endif
+                	AlfServer()->FocusedWindowGroupChangedL( this );
+                	AlfServer()->AppUi()->UpdateActiveSession(this);
+                
+                	// Make sure that Env will refresh the screen 
+                	// when we gain focus
+                	AlfServer()->AppUi()->HuiEnv().ContinueRefresh();          			
+                	}
+            	else
+                	{
+                	// check if there is some other alf application on top of this one and set
+                	// that application's session as a activesession
+                	CAlfAppSrvSessionBase* newFocusSession = AlfServer()->UpMostClientAboveWg( ClientWindowGroup() );
+ 
+            	    if( newFocusSession )
+            	        {
+                        AlfServer()->FocusedWindowGroupChangedL( newFocusSession );
+            	        }
+            	    else
+            	        {
+            	        // do the "event window" repositioning immediately
+            	        AlfServer()->FocusedWindowGroupChangedL( NULL );
+            	        }
+            	    
+            	    AlfServer()->AppUi()->UpdateActiveSession( newFocusSession );
+
+                    // The following line removes the flickering (=drawing and empty frame)
+                    // when non-alfred application is exited to appshell.
+#ifndef SYMBIAN_BUILD_GCE
+                	AlfServer()->AppUi()->Container()->DrawDeferred();
+#endif
+                	}    
+          		}
+            break;
+            }
+            
+        case EAlfGetPointerEvent:
+            {
+            TriggerPointerEvent(&aMessage);
+            return; // don't complete message here
+            }
+    
+        case EAlfCancelPtrEvents:
+            {
+            CancelPointerEvents();
+            break;
+            }
+
+        case EAlfGetSystemEvent:
+            {
+            GetSystemEvents(&aMessage);
+            return; // don't complete message here
+            }
+    
+        case EAlfCancelSystemEvents:
+            {
+            CancelSystemEvents();
+            break;
+            }
+            
+        case ESetFullScreenDrawing:
+            {
+            iUsesFullScreen = aMessage.Int0();
+            break;
+            }
+        case EAlfLayoutMetricsTextStyleData:
+            {
+        	LayoutMetricsTextStyleDataL(aMessage);
+            break;
+            } 
+
+        case EAlfSetWgParent:
+            {
+            SetParentWindowGroupId(aMessage.Int0());
+            break;
+            }
+        case EAlfSBufAddObserver:
+            {
+            AlfServer()->ScreenBufferManager().AddScreenBufferObserver(this, aMessage);
+            return; // message is completed in the method above
+            } 
+        case EAlfSBufRemoveObserver:
+            {
+            AlfServer()->ScreenBufferManager().RemoveScreenBufferObserver(this, aMessage);
+            break;
+            } 
+        case EAlfSBufRequestNextBuffer:
+            {
+            AlfServer()->ScreenBufferManager().RequestNextBuffer(this, aMessage);
+            return; // message is completed in the method above
+            } 
+        case EAlfSBufRequestBufferDraw:
+            {
+            AlfServer()->ScreenBufferManager().RequestBufferDraw(this, aMessage);
+            return; // message is completed in the method above
+            } 
+        case EAlfSBufRequestEvent:
+            {
+            AlfServer()->ScreenBufferManager().RequestScreenBufferEvent(this, aMessage);
+            return; // don't complete message here
+            }          
+            
+        case EAlfDoSubSessionBatchCmd:
+            {
+            ExecuteBatchCommandsL(aMessage);
+            break;
+            }   
+      
+        case EAlfConfigureBatchCmd:
+            {
+            ConfigureBatchCommandExecutionL( aMessage );
+            break;
+            }
+
+        case EAlfNotifyTextureInfo:
+            {           
+            NotifyTextureInfo( aMessage );            
+            }
+            return;
+            
+        case EAlfCancelNotifyTextureInfo:
+            {
+            if ( !iTextureInfoEvent.IsNull() )
+                {
+                iTextureInfoEvent.Complete( KErrCancel );
+                }
+            }
+            break;
+        case EAlfDirectClientFPSCounterOn:
+            {
+            ReportFrameRateBegin( aMessage );
+            break;
+            }
+        case EAlfDirectClientFPSCounterOff:
+            {
+            ReportFrameRateEnd( aMessage );
+            break;
+            }
+        case EAlfEnableLowMemoryState:
+            {
+            EnvEnableLowMemoryState( aMessage );
+            break;
+            }    
+            
+        case EAlfForceSwRendering:
+            {
+            EnvForceSwRendering( aMessage );
+            break;    
+            }
+            
+            
+        default:
+            User::Leave( KErrNotSupported );
+        }
+
+    if ( !aMessage.IsNull() )
+        {
+        aMessage.Complete( KErrNone );
+        }
+    }
+  
+// ---------------------------------------------------------------------------
+// class    :   CHuiEnv
+// function :   SetRefreshMode
+// param 0  :   IN refresh mode in THuiRefreshMode
+// ---------------------------------------------------------------------------
+//    
+void CAlfAppSrvSession::EnvSetRefreshModeL(const RMessage2& aMessage)
+    {
+    // 0: refresh mode (in)
+    const THuiRefreshMode newMode = static_cast<THuiRefreshMode>(aMessage.Int0());
+    
+    if ( iRefreshMode != newMode )
+        {
+        iRefreshMode = newMode;
+        
+        if ( iFocused )
+            {
+            SharedHuiEnv()->SetRefreshMode( iRefreshMode );
+            }
+        }
+    }
+  
+// ---------------------------------------------------------------------------
+// class    :   CHuiEnv
+// function :   SetMaxFrameRate
+// param 0  :   IN framerate in Int
+// ---------------------------------------------------------------------------
+//    
+void CAlfAppSrvSession::EnvSetMaxFrameRateL(const RMessage2& aMessage)
+    {
+    // 0: max framerate in TPckgC (in)
+    TReal32 newRate = KAlfUseDefaultFrameRate;
+    TPckg<TReal32> frameRatePckg(newRate);
+    aMessage.Read(0,frameRatePckg);
+    
+    if ( !RealCompare( iMaxFrameRate, newRate ) )
+        {
+        iMaxFrameRate = newRate;
+        
+        if ( iFocused )
+            {
+            if ( RealCompare( iMaxFrameRate, KAlfUseDefaultFrameRate ) )
+                {
+                SharedHuiEnv()->SetMaxFrameRate( 
+                    TReal32(AlfAppUi()->SettingsHandler().DefaultFramerate() ) );
+                }
+            else
+                {
+                SharedHuiEnv()->SetMaxFrameRate( iMaxFrameRate );
+                }
+            }
+        }
+    }
+  
+// ---------------------------------------------------------------------------
+// class    :   CHuiEnv
+// function :   ContinueRefresh
+// ---------------------------------------------------------------------------
+//    
+void CAlfAppSrvSession::EnvContinueRefreshL(const RMessage2& /*aMessage*/)
+    {
+    SharedHuiEnv()->ContinueRefresh();
+    }
+
+// ---------------------------------------------------------------------------
+// class    :   CHuiEnv
+// function :   PauseRefresh
+// ---------------------------------------------------------------------------
+//    
+void CAlfAppSrvSession::EnvPauseRefreshL(const RMessage2& /*aMessage*/)
+    {
+    SharedHuiEnv()->PauseRefresh();
+    }
+   
+// ---------------------------------------------------------------------------
+// class    :   CHuiEnv
+// function :   RefreshCallBack
+// ---------------------------------------------------------------------------
+//   
+void CAlfAppSrvSession::EnvRefreshCallBackL(const RMessage2& /*aMessage*/)
+    {
+    CHuiEnv::RefreshCallBack( SharedHuiEnv() );
+    }
+
+// ---------------------------------------------------------------------------
+// class    :   CHuiEnv
+// function :   SetIdleThreshold
+// param 0  :   IN Idle threshold time in milliseconds
+// ---------------------------------------------------------------------------
+//    
+void CAlfAppSrvSession::EnvSetIdleThresholdL(const RMessage2& aMessage)
+    {
+    // 0: time in milliseconds (in)
+    const TInt time = (TInt)aMessage.Int0();
+    
+    if ( iIdleThreshold != time )
+        {
+        iIdleThreshold = time;
+        
+        if ( iFocused )
+            {
+            SharedHuiEnv()->SetIdleThreshold( iIdleThreshold );
+            }
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// class    : CHuiEnv  
+// function : Renderer  
+// param 0  : IN/OUT renderer 
+// ---------------------------------------------------------------------------
+//  
+void CAlfAppSrvSession::EnvRendererL(const RMessage2& aMessage)
+    {
+    // Parse parameters
+
+    // 0: renderer (in/out)
+    TInt renderer = 0;
+    TPckg<TInt> rendererPckg(renderer);
+    aMessage.Read(0,rendererPckg);
+    renderer = SharedHuiEnv()->Renderer();    
+    aMessage.Write(0,rendererPckg);    
+    }  
+    
+// ---------------------------------------------------------------------------
+// class    :   CHuiRoster
+// function :   Hide
+// param 0  :   IN Handle to CHuiControlGroup object
+// param 1  :   IN Handle to CHuiDisplay object
+// ---------------------------------------------------------------------------
+//    
+void CAlfAppSrvSession::RosterHideL(const RMessage2& aMessage)
+    {
+    // Parse parameters
+    // 0: control group handle (in)
+    const TInt cntrlGroupHandle = aMessage.Int0();
+    CAlfSrvSubSessionBase& subSession1 = SubSession( cntrlGroupHandle );
+    CAlfSrvControlGroupSubSession& controlGroupSubSession = 
+        static_cast<CAlfSrvControlGroupSubSession&>(subSession1);
+    CHuiControlGroup& controlGroup = controlGroupSubSession.ControlGroup();
+                
+    // 1: display handle (in)
+    const TInt displayHandle = aMessage.Int1();
+    CAlfSrvSubSessionBase& subSession2 = SubSession( displayHandle );
+    CAlfSrvDisplaySubSession& displaySubSession = 
+        static_cast<CAlfSrvDisplaySubSession&>(subSession2);
+    CHuiDisplay& display = displaySubSession.Display();
+
+    // hide
+    controlGroupSubSession.SetIsShown( EFalse );
+  
+    // hide from the roster only if session is focused
+    if ( iFocused )
+        {
+        display.Roster().Hide(controlGroup);
+        }
+    else // otherwise remove from the iControlGroupOrder array
+        {
+         TInt index = iControlGroupOrder.Find( &controlGroup );
+         if(  index != KErrNotFound)
+             {
+             iControlGroupOrder.Remove( index );
+             }
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// class    :   CHuiRoster
+// function :   ShowVisualL
+// param 0  :   IN Handle to CHuiVisual object
+// param 1  :   IN Handle to CHuiDisplay object
+// ---------------------------------------------------------------------------
+//     
+void CAlfAppSrvSession::RosterShowVisualL(const RMessage2& aMessage)
+    {
+    // Parse parameters
+    // 0: visual handle (in)
+    TAny* huiVisualAnyPtr = GetInterfaceL( EHuiObjectTypeVisual, aMessage.Int0() );
+    CHuiVisual* huiVisual = static_cast<CHuiVisual*>(huiVisualAnyPtr);
+    
+    // 1: display handle (in)
+    const TInt displayHandle = aMessage.Int1();
+    CAlfSrvSubSessionBase& subSession2 = SubSession( displayHandle );
+    CAlfSrvDisplaySubSession& displaySubSession = 
+        static_cast<CAlfSrvDisplaySubSession&>(subSession2);
+    CHuiDisplay& display = displaySubSession.Display();
+    
+    // show visual
+    display.Roster().ShowVisualL(huiVisual);
+    }
+    
+// ---------------------------------------------------------------------------
+// class    :   CHuiRoster
+// function :   HideVisual
+// param 0  :   IN Handle to CHuiVisual object
+// param 1  :   IN Handle to CHuiDisplay object
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppSrvSession::RosterHideVisualL(const RMessage2& aMessage)
+    {
+    // Parse parameters
+    // 0: visual handle (in)
+    TAny* huiVisualAnyPtr = GetInterfaceL( EHuiObjectTypeVisual, aMessage.Int0() );
+    CHuiVisual* huiVisual = static_cast<CHuiVisual*>(huiVisualAnyPtr);
+    
+    // 1: display handle (in)
+    const TInt displayHandle = aMessage.Int1();
+    CAlfSrvSubSessionBase& subSession2 = SubSession( displayHandle );
+    CAlfSrvDisplaySubSession& displaySubSession = 
+        static_cast<CAlfSrvDisplaySubSession&>(subSession2);
+    CHuiDisplay& display = displaySubSession.Display();
+    
+    // show visual
+    display.Roster().HideVisual(huiVisual);
+    }
+  
+// ---------------------------------------------------------------------------
+// class    :   CHuiRoster
+// function :   MoveVisualToFront
+// param 0  :   IN Handle to CHuiVisual object
+// param 1  :   IN Handle to CHuiDisplay object
+// ---------------------------------------------------------------------------
+//   
+void CAlfAppSrvSession::RosterMoveVisualToFrontL(const RMessage2& aMessage)
+    {
+    // Parse parameters
+    // 0: visual handle (in)
+    TAny* huiVisualAnyPtr = GetInterfaceL( EHuiObjectTypeVisual, aMessage.Int0() );
+    CHuiVisual* huiVisual = static_cast<CHuiVisual*>(huiVisualAnyPtr);
+    
+    // 1: display handle (in)
+    const TInt displayHandle = aMessage.Int1();
+    CAlfSrvSubSessionBase& subSession2 = SubSession( displayHandle );
+    CAlfSrvDisplaySubSession& displaySubSession = 
+        static_cast<CAlfSrvDisplaySubSession&>(subSession2);
+    CHuiDisplay& display = displaySubSession.Display();
+    
+    // move visual to front
+#ifdef SYMBIAN_BUILD_GCE
+    TInt firstAlfPositionInRoster = AlfAppUi()->FirstAlfControlGroupIndex();
+    display.Roster().Move(huiVisual, firstAlfPositionInRoster); 
+
+#else    
+    display.Roster().MoveVisualToFront(huiVisual);
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// class    :   CHuiRoster
+// function :   Observers().AppendIfNotFoundL, Observers.RemoveIfFound
+// param 0  :   IN flags
+// param 1  :   IN Handle to CHuiControl object
+// param 2  :   IN Handle to CHuiDisplay object
+// ---------------------------------------------------------------------------
+//      
+void CAlfAppSrvSession::RosterSetPointerEventFlagsL(const RMessage2& aMessage)
+    {
+    // 0: flags (in)
+    const TInt flags = aMessage.Int0();
+    
+    // 1: control handle (in)
+    TAny* huiControlAnyPtr = GetInterfaceL( EHuiObjectTypeControl, aMessage.Int1() );
+    CHuiControl* huiControl = static_cast<CHuiControl*>(huiControlAnyPtr);
+    
+    // 2: display handle (in)
+    const TInt displayHandle = aMessage.Int2();
+    CAlfSrvSubSessionBase& subSession2 = SubSession( displayHandle );
+    CAlfSrvDisplaySubSession& displaySubSession = 
+        static_cast<CAlfSrvDisplaySubSession&>(subSession2);
+    CHuiDisplay& display = displaySubSession.Display();
+    
+    if ( flags & EAlfPointerEventReportDrag )
+        {
+        display.Roster().Observers(EHuiInputPointerDrag).AppendIfNotFoundL(*huiControl);
+        }
+    else
+        {
+        display.Roster().Observers(EHuiInputPointerDrag).RemoveIfFound(*huiControl);
+        }
+        
+    if ( flags & EAlfPointerEventReportLongTap )
+        {
+        display.Roster().Observers(EHuiInputPointerLongTap).AppendIfNotFoundL(*huiControl);
+        }
+    else
+        {
+        display.Roster().Observers(EHuiInputPointerLongTap).RemoveIfFound(*huiControl);
+        }
+        
+    if ( flags & EAlfPointerEventReportUnhandled  )
+        {
+        display.Roster().Observers(EHuiInputPointerUnhandled).AppendIfNotFoundL(*huiControl);
+        }
+    else
+        {
+        display.Roster().Observers(EHuiInputPointerUnhandled).RemoveIfFound(*huiControl);
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// class    :   CHuiRoster
+// function :   Observers().AppendIfNotFoundL
+// param 0  :   IN TAlfPointerEventFlags
+// param 1  :   IN Handle to CHuiControl object
+// param 2  :   IN Handle to CHuiDisplay object
+// ---------------------------------------------------------------------------
+//      
+void CAlfAppSrvSession::RosterAddPointerEventObserverL(const RMessage2& aMessage)
+    {
+    // 0: observer (in)
+    const TAlfPointerEventFlags observer = (TAlfPointerEventFlags)aMessage.Int0();
+    
+    // 1: control handle (in)
+    TAny* huiControlAnyPtr = GetInterfaceL( EHuiObjectTypeControl, aMessage.Int1() );
+    CHuiControl* huiControl = static_cast<CHuiControl*>(huiControlAnyPtr);
+    
+    // 2: display handle (in)
+    const TInt displayHandle = aMessage.Int2();
+    CAlfSrvSubSessionBase& subSession2 = SubSession( displayHandle );
+    CAlfSrvDisplaySubSession& displaySubSession = 
+        static_cast<CAlfSrvDisplaySubSession&>(subSession2);
+    CHuiDisplay& display = displaySubSession.Display();
+    
+    // add observer
+    THuiInputType huiType = EHuiInputPointerDrag;
+    switch ( observer )
+        {
+        case EAlfPointerEventReportDrag:
+            huiType = EHuiInputPointerDrag;
+            break;
+        case EAlfPointerEventReportLongTap:
+            huiType = EHuiInputPointerLongTap;
+            break;
+        case EAlfPointerEventReportUnhandled:
+            huiType = EHuiInputPointerUnhandled;
+            break;
+        default:
+            User::Leave( KErrNotSupported );
+        }
+        
+    display.Roster().Observers(huiType).AppendIfNotFoundL(*huiControl);
+    }
+    
+ // ---------------------------------------------------------------------------
+// class    :   CHuiRoster
+// function :   Observers.RemoveIfFound
+// param 0  :   IN TAlfPointerEventFlags
+// param 1  :   IN Handle to CHuiControl object
+// param 2  :   IN Handle to CHuiDisplay object
+// ---------------------------------------------------------------------------
+//      
+void CAlfAppSrvSession::RosterRemovePointerEventObserverL(const RMessage2& aMessage)
+    {
+    // 0: observer (in)
+    const TAlfPointerEventFlags observer = (TAlfPointerEventFlags)aMessage.Int0();
+    
+    // 1: control handle (in)
+    TAny* huiControlAnyPtr = GetInterfaceL( EHuiObjectTypeControl, aMessage.Int1() );
+    CHuiControl* huiControl = static_cast<CHuiControl*>(huiControlAnyPtr);
+    
+    // 2: display handle (in)
+    const TInt displayHandle = aMessage.Int2();
+    CAlfSrvSubSessionBase& subSession2 = SubSession( displayHandle );
+    CAlfSrvDisplaySubSession& displaySubSession = 
+        static_cast<CAlfSrvDisplaySubSession&>(subSession2);
+    CHuiDisplay& display = displaySubSession.Display();
+    
+    // remove observer
+    THuiInputType huiType = EHuiInputPointerDrag;
+    switch ( observer )
+        {
+        case EAlfPointerEventReportDrag:
+            huiType = EHuiInputPointerDrag;
+            break;
+        case EAlfPointerEventReportLongTap:
+            huiType = EHuiInputPointerLongTap;
+            break;
+        case EAlfPointerEventReportUnhandled:
+            huiType = EHuiInputPointerUnhandled;
+            break;
+        default:
+            User::Leave( KErrNotSupported );
+        }
+        
+    display.Roster().Observers(huiType).RemoveIfFound(*huiControl);
+    }
+
+// ---------------------------------------------------------------------------
+// class    :   CHuiRoster
+// function :   
+// param 0  :   
+// ---------------------------------------------------------------------------
+//      
+void CAlfAppSrvSession::RosterSetPointerDragTresholdL(const RMessage2& aMessage)
+    {
+	// Parse parameters
+    TAlfPointerEventDragTreshold params;
+    TPckg<TAlfPointerEventDragTreshold> paramsPckg(params);
+    aMessage.Read(0,paramsPckg);
+    
+    // control handle 
+    TAny* huiControlAnyPtr = GetInterfaceL( EHuiObjectTypeControl, params.iControlHandle );
+    CHuiControl* huiControl = static_cast<CHuiControl*>(huiControlAnyPtr);
+    
+	// display handle
+    CAlfSrvSubSessionBase& subSession2 = SubSession( params.iDisplayHandle );
+    CAlfSrvDisplaySubSession& displaySubSession = 
+        static_cast<CAlfSrvDisplaySubSession&>(subSession2);
+    CHuiDisplay& display = displaySubSession.Display();
+    
+	THuiXYMetric huiXYMetric;
+    AlfXYMetricUtility::CopyMetric(params.iXYMetric, huiXYMetric);    
+    
+    display.Roster().SetPointerDragThresholdL(*huiControl, huiXYMetric );
+    
+    }
+
+// ---------------------------------------------------------------------------
+// class    :   CHuiRoster
+// function :   
+// param 0  :   
+// ---------------------------------------------------------------------------
+//      
+void CAlfAppSrvSession::RosterDisableLongTapEventWhenDraggingL(const RMessage2& aMessage)
+    {
+	// Parse parameters
+    // control handle (in)
+    TAny* huiControlAnyPtr = GetInterfaceL( EHuiObjectTypeControl, aMessage.Int0() );
+    CHuiControl* huiControl = static_cast<CHuiControl*>(huiControlAnyPtr);
+
+    // observer (in)
+    const TBool disable = (TBool)aMessage.Int1();
+    
+    // display handle (in)
+    const TInt displayHandle = aMessage.Int2();
+    CAlfSrvSubSessionBase& subSession2 = SubSession( displayHandle );
+    CAlfSrvDisplaySubSession& displaySubSession = 
+        static_cast<CAlfSrvDisplaySubSession&>(subSession2);
+    CHuiDisplay& display = displaySubSession.Display();
+    
+	display.Roster().DisableLongTapEventsWhenDraggingL(*huiControl, disable);
+    }
+
+// ---------------------------------------------------------------------------
+// class    :   
+// function :   
+// param 0  :   
+// param 1  :   
+// ---------------------------------------------------------------------------
+//  
+void CAlfAppSrvSession::TextureCreateL(const RMessage2& aMessage)
+    {
+    // Owner id is stored in UpdateTextureOwnerIdL via IPC command 
+    // EAlfTextureUpdateOwnerId.
+    
+    // Parse parameters
+
+    // 0: handle (in/out)
+    TInt handle;
+    TPckg<TInt> handlePckg(handle);
+    aMessage.Read(0,handlePckg);
+
+    // 1: TAlfTextureCreateParams (in)
+    TAlfCreateTextureParams params;
+    TPckg<TAlfCreateTextureParams> paramsPckg(params);
+    aMessage.Read(1,paramsPckg);
+
+
+    CHuiEnv* env = SharedHuiEnv();
+    if (params.iBitmapHandle && params.iId != 0) 
+        {            
+        const TInt bitmapHandle = params.iBitmapHandle;
+        const TInt maskHandle = params.iMaskBitmapHandle;
+    	const TInt flags = params.iFlags;
+        const TInt managerId = params.iManagerId;
+        const TInt id = 
+            AlfTextureManager().CreateTextureId(
+                TextureOwnerId(),
+                params.iId, 
+                managerId, 
+                ETrue );
+
+    	CSharedBitmapProvider* provider = new (ELeave) CSharedBitmapProvider(bitmapHandle, maskHandle);
+        CleanupStack::PushL(provider);
+    	
+        // Convert the TAlfTextureFlags to THuiTextureUploadFlags
+        TInt inputFlags = flags;
+        inputFlags &= ~EAlfTextureFlagSkinContent;
+        inputFlags &= ~EAlfTextureFlagAutoSize;
+        inputFlags &= ~EAlfTextureFlagLoadAnimAsImage;
+        
+        TBool textureAlreadyExists = (env->TextureManager().Texture(id) != &env->TextureManager().BlankTexture());
+        
+        CHuiTexture& texture = env->TextureManager().CreateTextureL(id,
+                                     provider,
+                                     (THuiTextureUploadFlags)inputFlags);
+
+        // If we are reusing deleted texture, remove it from "deleted" array
+        TInt index = iTextures.Find(&texture);
+        if (index != KErrNotFound)
+           {
+           iTextures.Remove(index);                
+           }                    
+
+
+        // Add texture to skin content
+        texture.SetSkinContent((flags & EAlfTextureFlagSkinContent) != 0);
+
+        // Add texture to automatic dynamic size calculations
+        texture.EnableAutoSizeCalculation((flags & EAlfTextureFlagAutoSize) != 0);
+        
+        // Check if texture already existed, if yes then we need to update its content
+        // because 
+        if (textureAlreadyExists)
+            {
+            CFbsBitmap* bitmap = NULL;
+            CFbsBitmap* mask = NULL;
+            provider->ProvideBitmapL(0, bitmap, mask);
+            CleanupStack::PushL(bitmap);
+            CleanupStack::PushL(mask);
+            texture.EnableShadow((flags & EHuiTextureUploadFlagGenerateShadow) != 0);            
+            TSize bitmapSize = bitmap->SizeInPixels();
+            if (bitmapSize.iWidth != 0 && bitmapSize.iHeight != 0)
+                {
+                // This uses direct upload if possible and specified in the upload flags
+                TRAPD(err, env->TextureManager().UpdateTextureFromBitmapL(id, provider))        
+                
+                if (err != KErrNone)
+                    {
+                    // We do this because texture may be in undetermined state (?)
+                    texture.Reset();    
+                    User::Leave(err);
+                    }
+                }
+            texture.SetSize(bitmap->SizeInPixels());
+            CleanupStack::PopAndDestroy(2); // bitmap, mask
+            }  
+                                     
+        // We delete provider here, because the release/restore
+        // is supported in the client library. There is currently
+        // no need to restore textures in the server.
+        CleanupStack::PopAndDestroy(); // provider;
+
+        // Write parameters
+        handle = TInt((MHuiTexture*)(&texture));
+        aMessage.Write(0,handlePckg);
+        }
+    else
+        {
+        CHuiTexture& texture = env->TextureManager().BlankTexture();    
+        // Write parameters
+        handle = TInt((MHuiTexture*)(&texture));
+        aMessage.Write(0,handlePckg);
+        }    
+    }
+
+void CAlfAppSrvSession::TextureCreateAnimatedL(const RMessage2& aMessage)
+    {
+    // Parse parameters
+
+    // 0: handle (in/out)
+    TInt handle = 0;
+    TPckg<TInt> handlePckg(handle);
+    aMessage.Read(0,handlePckg);
+
+    // 1: TAlfTextureCreateParams (in)
+    TAlfCreateTextureAnimatedParams params;
+    TPckg<TAlfCreateTextureAnimatedParams> paramsPckg(params);
+    aMessage.Read(1,paramsPckg);
+    CHuiEnv* env = SharedHuiEnv();
+    
+    CHuiGifAnimationTexture* animtext = CHuiGifAnimationTexture::NewL(params.iFilename,env->TextureManager(),params.iId, (THuiTextureUploadFlags)(params.iFlags));
+    //MHuiTexture* foo = dynamic_cast<MHuiTexture*>(animtext);
+    iAnimatedTextures.Append(animtext);
+    handle = TInt((MHuiTexture*)(animtext));
+    aMessage.Write(0,handlePckg);
+    }
+
+
+
+
+// ---------------------------------------------------------------------------
+// class    :   
+// function :   
+// param 0  :   
+// param 1  :   
+// ---------------------------------------------------------------------------
+//  
+void CAlfAppSrvSession::TextureLoadL(const RMessage2& aMessage)
+    {
+    // Owner id is stored in UpdateTextureOwnerIdL via IPC command 
+    // EAlfTextureUpdateOwnerId.
+
+    // 0: handle (in/out)
+    TInt handle = 0;
+    TPckg<TInt> handlePckg(handle);
+    aMessage.Read(0,handlePckg);
+
+    // 1: TAlfTextureLoadParams (in)
+    TAlfLoadTextureParams params;
+    TPckg<TAlfLoadTextureParams> paramsPckg(params);
+    aMessage.Read(1,paramsPckg);
+
+    const TInt bitmapHandle = params.iBitmapHandle;
+    const TInt maskHandle = params.iMaskBitmapHandle;
+	const TInt flags = params.iFlags;
+    const TInt managerId = params.iManagerId;
+    const TInt id = 
+        AlfTextureManager().CreateTextureId(
+            TextureOwnerId(),
+            params.iId, 
+            managerId, 
+            ETrue );
+
+    CHuiEnv* env = SharedHuiEnv();
+    if (bitmapHandle && params.iId != 0)
+        {            
+    	CSharedBitmapProvider* provider = 
+    	    new (ELeave) CSharedBitmapProvider(bitmapHandle, maskHandle);
+        CleanupStack::PushL(provider);
+        
+        // Convert the TAlfTextureFlags to THuiTextureUploadFlags
+        TInt inputFlags = (THuiTextureUploadFlags)flags;
+        inputFlags &= ~EAlfTextureFlagSkinContent;
+        inputFlags &= ~EAlfTextureFlagAutoSize;
+        inputFlags &= ~EAlfTextureFlagLoadAnimAsImage;
+        
+        TBool textureAlreadyExists = (env->TextureManager().Texture(id) != &env->TextureManager().BlankTexture());
+
+        // Make sure texture exists
+        CHuiTexture& textureRef = env->TextureManager().CreateTextureL(id, provider, THuiTextureUploadFlags(inputFlags));
+
+        // If we are reusing deleted texture, remove it from "deleted" array
+        TInt index = iTextures.Find(&textureRef);
+        if (index != KErrNotFound)
+           {
+           iTextures.Remove(index);                
+           }                    
+        
+        // Add texture to skin content
+        textureRef.SetSkinContent((flags & EAlfTextureFlagSkinContent) != 0);
+
+        // Add texture to automatic dynamic size calculations
+        textureRef.EnableAutoSizeCalculation((flags & EAlfTextureFlagAutoSize) != 0);
+    	    	
+        // Upload texture, this is needed because CreateTexture does not necessarely do anything if texture
+        // already exists.
+        if (textureAlreadyExists)
+            {                
+            CFbsBitmap* bitmap = NULL;
+            CFbsBitmap* mask = NULL;
+            provider->ProvideBitmapL(id, bitmap, mask);
+            CleanupStack::PushL(bitmap);
+            CleanupStack::PushL(mask);
+            textureRef.EnableShadow((flags & EHuiTextureUploadFlagGenerateShadow) != 0);            
+            TSize bitmapSize = bitmap->SizeInPixels();
+            if (bitmapSize.iWidth != 0 && bitmapSize.iHeight != 0)
+                {
+                // This uses direct upload if possible and specified in the upload flags
+                TRAPD(err, env->TextureManager().UpdateTextureFromBitmapL(id, provider))        
+
+                if (err != KErrNone)
+                    {
+                    // We do this because texture may be in undetermined state (?)
+                    textureRef.Reset();    
+                    User::Leave(err);
+                    }
+                }
+            textureRef.SetSize(bitmap->SizeInPixels());
+            CleanupStack::PopAndDestroy(2); // bitmap, mask
+            }
+        // We delete provider here, because the release/restore
+        // is supported in the client library. There is currently
+        // no need to restore textures in the server.
+        CleanupStack::PopAndDestroy( provider );
+
+
+        // Write parameters
+        handle = TInt((MHuiTexture*)(&textureRef));
+        aMessage.Write(0,handlePckg);        
+        }
+    else
+        {
+        CHuiTexture& texture = env->TextureManager().BlankTexture();    
+        // Write parameters
+        handle = TInt((MHuiTexture*)(&texture));
+        aMessage.Write(0,handlePckg);
+        }    
+        
+    }
+
+// ---------------------------------------------------------------------------
+// class    : CHuiTextureManager  
+// function : UnloadTexture  
+// param 0  : IN Texture id  
+// ---------------------------------------------------------------------------
+//  
+void CAlfAppSrvSession::TextureUnload(const RMessage2& aMessage)
+    {
+    // Parse parameters
+
+    // 0: id (in)
+   	const TInt originalId = aMessage.Int0();
+   	const TInt managerId = aMessage.Int1();
+
+	if (originalId != 0)
+	    {
+        const TInt id = 
+            AlfTextureManager().ExistingTextureId(
+                TextureOwnerId(), originalId, managerId);
+        
+    	if ( id != 0 && 
+    	     AlfTextureManager().ReleaseTextureId( 
+    	        TextureOwnerId(), originalId, managerId ) == 0)
+    	    {
+            if ( !managerId )
+                {
+                RemoveTextureInfo( originalId );
+                }
+
+            CHuiEnv* env = SharedHuiEnv();    	
+           	env->TextureManager().UnloadTexture(id);                                         	            	        
+    	    }
+	    }
+    }
+
+// ---------------------------------------------------------------------------
+// class    : 
+// function : 
+// param 0  : IN Texture id  
+// ---------------------------------------------------------------------------
+//  
+void CAlfAppSrvSession::TextureDelete(const RMessage2& aMessage)
+    {
+    // Parse parameters
+
+    // 0: id (in)
+   	const TInt originalId = aMessage.Int0();
+   	const TInt managerId = aMessage.Int1();
+
+	if (originalId != 0)
+	    {
+        const TInt id = 
+            AlfTextureManager().ExistingTextureId( 
+                TextureOwnerId(), originalId, managerId );
+        
+    	if ( id != 0 && 
+    	     AlfTextureManager().ReleaseTextureId( 
+    	        TextureOwnerId(), originalId, managerId ) == 0)
+    	    {
+            CHuiEnv* env = SharedHuiEnv();
+           	env->TextureManager().UnloadTexture(id);
+           	
+            if ( !managerId )
+                {
+                RemoveTextureInfo( originalId );
+                }
+           	
+            if ( AlfTextureManager().DeleteTextureId(
+                     TextureOwnerId(), originalId, managerId) == 0 )
+                {
+        	    // For now just unload textures, actual deletion happens 
+        	    // when session is closed (for safety reasons).
+                CHuiTexture* texture = env->TextureManager().Texture(id); 
+                if (texture)
+                    {
+                    // We should set texture attributes to default values
+                    // here if we recycle hui-textures during this session.
+                    texture->SetAutoSizeParams(THuiTextureAutoSizeParams());
+                    texture->EnableShadow(EFalse);
+                    texture->SetSkinContent(EFalse);
+                    
+                    if (iTextures.Find(texture) == KErrNotFound)
+                        {
+                        iTextures.Append(texture);                
+                        }                    
+                    }                                
+                }
+    	    }
+	    }
+    }
+
+// ---------------------------------------------------------------------------
+// class    : CHuiTextureManager  
+// function :  
+// param 0  : IN Texture id  
+// ---------------------------------------------------------------------------
+//  
+void CAlfAppSrvSession::TextureRelease(const RMessage2& aMessage)
+    {
+    // Parse parameters
+
+    // 0: id (in)
+   	const TInt originalId = aMessage.Int0();
+   	const TInt managerId = aMessage.Int1();
+
+	if (originalId != 0)
+	    {
+	    // Just release texture id
+        AlfTextureManager().ReleaseTextureId(
+            TextureOwnerId(), originalId, managerId );	    
+	    }
+    }
+
+// ---------------------------------------------------------------------------
+// class    : CHuiTextureManager  
+// function :  
+// param 0  : IN Texture id  
+// ---------------------------------------------------------------------------
+//  
+void CAlfAppSrvSession::TextureRestore(const RMessage2& aMessage)
+    {
+    // Parse parameters
+
+    // 0: id (in)
+   	const TInt originalId = aMessage.Int0();
+   	const TInt managerId = aMessage.Int1();
+
+	if (originalId != 0)
+	    {
+	    // Just restore texture id
+        AlfTextureManager().CreateTextureId(
+            TextureOwnerId(), originalId, managerId, EFalse );
+	    }
+    }
+
+// ---------------------------------------------------------------------------
+// class    : CHuiTextureManager  
+// function :  
+// param 0  : IN Texture id  
+// ---------------------------------------------------------------------------
+//  
+void CAlfAppSrvSession::TextureNotifySkinChanged(const RMessage2& aMessage)
+    {
+    // Parse parameters
+
+    // 0: id (in)
+   	const TInt originalId = aMessage.Int0();
+   	const TInt managerId = aMessage.Int1();
+
+	if (originalId != 0)
+	    {
+        const TInt id = 
+            AlfTextureManager().ExistingTextureId( 
+                TextureOwnerId(), originalId, managerId );
+        
+    	if ( id != 0 && 
+    	     AlfTextureManager().ValidateSkinForTextureId( 
+    	        TextureOwnerId(), originalId, managerId ) == 0)
+    	    {
+            CHuiEnv* env = SharedHuiEnv();    	
+           	env->TextureManager().UnloadTexture(id);                                         	            	        
+    	    }
+	    }
+    }
+
+static CHuiTexture* CastTexture( MHuiTexture* aMHuiTexture )
+    {
+    CHuiTexture* resultCHuiTexture = NULL;
+    if ( aMHuiTexture )
+        {
+        // only CHuiTexture implements the MHuiShadowedTexture interface
+        MHuiShadowedTexture* shadowedTexture = aMHuiTexture->ShadowedTexture();
+        if ( shadowedTexture )
+            {
+            resultCHuiTexture = static_cast<CHuiTexture*>( shadowedTexture );
+            }
+        }
+            
+    return resultCHuiTexture;
+    }
+
+// ---------------------------------------------------------------------------
+// class    :   
+// function :   
+// param 0  :   
+// param 1  :   
+// ---------------------------------------------------------------------------
+//  
+void CAlfAppSrvSession::TextureBlurL(const RMessage2& aMessage)
+    {
+    // Parse parameters
+
+    // 0: TAlfBlurTextureParams (in)
+    TAlfBlurTextureParams params;
+    TPckg<TAlfBlurTextureParams> paramsPckg(params);
+    aMessage.Read(0,paramsPckg);
+
+    CHuiEnv* env = SharedHuiEnv();
+    if (params.iServerSideSrcHandle && params.iServerSideDstHandle)
+        {
+        CHuiTexture* srcTexture = CastTexture(reinterpret_cast<MHuiTexture*>(params.iServerSideSrcHandle));
+        CHuiTexture* dstTexture = CastTexture(reinterpret_cast<MHuiTexture*>(params.iServerSideDstHandle));
+        
+        if (srcTexture && dstTexture)
+            {
+            
+            const THuiTextureHandle srcHandle = srcTexture->Handle();
+            THuiTextureHandle dstHandle = dstTexture->Handle();
+            const TSize size = params.iPreferredSize;
+                
+            env->TextureManager().Processor().BlurL(srcHandle,
+                dstHandle, 
+                size,
+                params.iFilterSize,
+                params.iFlag);            
+            }
+        else
+            {
+            User::Leave(KErrArgument);
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// class    :   
+// function :   
+// param 0  :   
+// param 1  :   
+// ---------------------------------------------------------------------------
+//  
+void CAlfAppSrvSession::TextureHasContentL(const RMessage2& aMessage)
+    {
+
+    // 0: ret val (in/out)
+    TBool retVal = EFalse;
+    TPckg<TBool> retValPckg(retVal);
+    aMessage.Read(0,retValPckg);
+
+    // 1: id (in)
+   	const TInt originalId = aMessage.Int1();
+   	
+    // 2: manager id (in)
+   	const TInt managerId = aMessage.Int2();
+
+	if (originalId != 0)
+	    {
+        const TInt id = 
+            AlfTextureManager().ExistingTextureId( 
+                TextureOwnerId(), originalId, managerId, ETrue);
+        
+        if (id != 0)
+            {
+            CHuiEnv* env = SharedHuiEnv();    	
+            CHuiTexture* tex = env->TextureManager().Texture(id);                                         	            	        
+            if (tex)
+                {
+                retVal = tex->HasContent();               
+                }                
+            }
+	    }
+    aMessage.Write(0,retValPckg);        
+    }
+
+void CAlfAppSrvSession::TextureStartAnimation(const RMessage2& aMessage)
+    {
+    TInt id = aMessage.Int0();
+    CHuiGifAnimationTexture* tex = NULL;
+    for (TInt index = 0; index < iAnimatedTextures.Count(); index++)
+        {
+        tex = iAnimatedTextures.operator[](index);
+        if (tex->Id() == id)
+            {
+            tex->Start();
+            break;
+            }
+        }
+    }
+    
+void CAlfAppSrvSession::TextureStopAnimation(const RMessage2& aMessage)
+    {
+    TInt id = aMessage.Int0();
+    CHuiGifAnimationTexture* tex = NULL;
+    for (TInt index = 0; index < iAnimatedTextures.Count(); index++)
+        {
+        tex = iAnimatedTextures.operator[](index);
+        if (tex->Id() == id)
+            {
+            tex->Stop();
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// class    :   
+// function :   
+// param 0  :   
+// param 1  :   
+// ---------------------------------------------------------------------------
+//  
+void CAlfAppSrvSession::TextureSetAutoSizeParamsL(const RMessage2& aMessage)
+    {
+
+    // 0: id (in)
+   	const TInt originalId = aMessage.Int0();
+   	
+    // 1: manager id (in)
+   	const TInt managerId = aMessage.Int1();
+
+    // 2: params (in)
+    TAlfTextureAutoSizeParams params;
+    TPckg<TAlfTextureAutoSizeParams> paramPckg(params);
+    aMessage.Read(2,paramPckg);
+
+
+	if (originalId != 0)
+	    {
+        const TInt id = 
+            AlfTextureManager().ExistingTextureId( 
+                TextureOwnerId(), originalId, managerId, ETrue);
+        
+        if (id != 0)
+            {
+            CHuiEnv* env = SharedHuiEnv();    	
+            CHuiTexture* tex = env->TextureManager().Texture(id);                                         	            	        
+            if (tex)
+                {
+                THuiTextureAutoSizeParams* huiparams = (THuiTextureAutoSizeParams*) &params;                
+                tex->SetAutoSizeParams(*huiparams);               
+                }                
+            }
+	    }
+    }
+
+void CAlfAppSrvSession::LayoutMetricsTextStyleDataL(const RMessage2& aMessage)
+    {
+    // 0: ret val (in/out)
+    TInt retVal = 0;
+    TPckg<TInt> retValPckg(retVal);
+    aMessage.Read(0,retValPckg);
+
+    // 1: textStyle (in)
+   	const TInt textStyle = aMessage.Int1();
+   	
+    CHuiEnv* env = SharedHuiEnv();
+    retVal = env->TextStyleManager().TextStyle(textStyle)->FontStyleId();    	   	
+    
+    aMessage.Write(0,retValPckg);                
+    }
+    
+TBool CAlfAppSrvSession::RequireTextureOwnerId(const RMessage2& aMessage)
+    {
+    if ( !iTextureOwnedIdSet )
+        {
+        AlfPanicClient( aMessage, EAlfSrvTexturePanicTextureOwnerIdNotUpdated );        
+        }
+        
+    return iTextureOwnedIdSet;
+    }
+    
+void CAlfAppSrvSession::UpdateTextureOwnerIdL(const RMessage2& aMessage)
+    {
+    if ( !iTextureOwnedIdSet )
+        {
+        // Open process, get id and then close.
+        RThread client;
+        User::LeaveIfError( aMessage.Client(client) );
+        CleanupClosePushL( client );
+        RProcess process;
+        User::LeaveIfError( client.Process( process ) );
+        TProcessId id = process.Id();
+        process.Close();
+        CleanupStack::PopAndDestroy( &client );
+        
+        // Register & then store owner id.
+        AlfTextureManager().AddClientL( id, *this );
+        iTextureOwnedIdSet = ETrue;
+        iTextureOwnerId = id;
+        }        
+    }
+    
+inline TProcessId CAlfAppSrvSession::TextureOwnerId() const
+    {
+    __ASSERT_ALWAYS( iTextureOwnedIdSet, USER_INVARIANT() );
+    return iTextureOwnerId;
+    }
+
+void CAlfAppSrvSession::ConfigureBatchCommandExecutionL( 
+        const RMessage2& aMessage )
+    {
+    // This should be called only by unit tests. Anyway,
+    // this has impact on this session only, so it does
+    // not cause any problems.
+    __ALFLOGSTRING1( "ConfigureBatchCommandExecutionL: %x", aMessage.Int0() )
+    iExecutionFlags = aMessage.Int0();
+    }
+
+void CAlfAppSrvSession::ExecuteBatchCommandsL(const RMessage2& aMessage)
+    {
+    // First, let's try to execute using dynamic buffer..
+    if ( !AllowExecuteUsingDynamicBuffer() || 
+         !ExecuteBatchCommandsUsingDynamicBufferL( aMessage ) )
+        {
+        // If that fails, then try with fixed buffer.
+        ExecuteBatchCommandsUsingFixedBufferL( aMessage );
+        }
+    }
+
+TBool CAlfAppSrvSession::ExecuteBatchCommandsUsingDynamicBufferL( 
+        const RMessage2& aMessage )
+    {       
+    TBool result = EFalse;
+
+    CAlfAppServer* server = AlfServer();
+
+    const TInt commonBatchBufferLength = 
+        server->CommonCommandBatchBufferMaxLength();
+
+    const TInt requiredBufferLength = aMessage.GetDesLengthL(0);
+
+    TBool commonBatchBufferAcquired = EFalse;
+
+    // This will finally hold reference to buffer to be used for
+    // reading message from client side.
+    TPtr8 ptrBuffer( 0, 0 );
+
+    // First, try to acquire common command batch buffer
+    // (if it's not in use and it has sufficient space)
+    if ( AllowExecuteUsingCommonBuffer() &&
+         ( commonBatchBufferLength >= requiredBufferLength ) )
+        {
+        commonBatchBufferAcquired = 
+            server->AcquireCommonCommandBatchBuffer( ptrBuffer );
+        }
+
+    // If common command batch buffer were not usable,
+    // let's try to allocate bigger buffer.
+    HBufC8* memoryBuffer = NULL;
+    if ( commonBatchBufferAcquired )
+        {
+        result = ETrue;
+        }
+    else
+        {
+        memoryBuffer = HBufC8::New( requiredBufferLength );
+        if ( memoryBuffer )
+            {
+            result = ETrue;
+            ptrBuffer.Set( memoryBuffer->Des() );
+            }
+        }
+
+    if ( result )
+        {
+        TInt err = aMessage.Read( 0, ptrBuffer );
+
+        if ( err != KErrNone )
+            {
+            // Release and then leave.
+            if ( memoryBuffer )
+                {
+                delete memoryBuffer;
+                memoryBuffer = NULL;
+                }
+            if ( commonBatchBufferAcquired )
+                {
+                server->ReleaseCommonCommandBatchBuffer();
+                }
+            
+            User::Leave( err );
+            }
+
+        TInt dummy;
+        TInt length = 0;
+
+        // Note - this method is implemented so that this works even in OOM, that's
+        // why TRAP is used here intentionally.
+        TRAP( err, length = ExecuteCommandsFromDescriptorL( ptrBuffer, dummy ) );
+        const TInt ptrBufferLength = ptrBuffer.Length();
+
+        // Release - note that buffer length must be fetched before deletion.
+        if ( memoryBuffer )
+            {
+            delete memoryBuffer;
+            memoryBuffer = NULL;
+            }
+        if ( commonBatchBufferAcquired )
+            {
+            server->ReleaseCommonCommandBatchBuffer();
+            }
+
+#ifdef _ALF_LOGGING
+        if ( err != KErrNone )
+            {
+            __ALFLOGSTRING3( 
+                "ExecuteBatchCommandsUsingDynamicBufferL execution failed, err=%d (%d,%d)", 
+                err, length, ptrBufferLength )
+            }
+#endif // _ALF_LOGGING
+
+        if ( !err && ( length != ptrBufferLength ) )
+            {
+            // All commands were not executed!
+            __ALFLOGSTRING2( 
+                "ExecuteBatchCommandsUsingDynamicBufferL corrupted buffer (%d,%d)", 
+                length, ptrBufferLength )
+            err = KErrCorrupt;
+            }
+
+        User::LeaveIfError( err );
+        }
+
+    return result;
+    }
+
+void CAlfAppSrvSession::ExecuteBatchCommandsUsingFixedBufferL( 
+        const RMessage2& aMessage )
+    {
+    CAlfAppServer* server = AlfServer();
+    const TInt messageLength = aMessage.GetDesLengthL(0);
+
+    TBufC8< KAlfStackBatchBufferSize > stackBuffer;
+    TPtr8 ptrBuffer( stackBuffer.Des() );
+
+    TBool commonBatchBufferAcquired = EFalse;
+    if ( AllowExecuteUsingCommonBuffer() )
+        {
+        commonBatchBufferAcquired = 
+            server->AcquireCommonCommandBatchBuffer( ptrBuffer );
+        }
+    
+    TInt length = 0;
+
+    // Note - this method is implemented so that this works even in OOM, that's
+    // why TRAP is used here intentionally.
+    TRAPD( err, length = 
+        ExecuteBatchCommandsUsingBufferL( ptrBuffer, messageLength, aMessage ) );
+
+    if ( commonBatchBufferAcquired )
+        {
+        server->ReleaseCommonCommandBatchBuffer();
+        }
+
+#ifdef _ALF_LOGGING
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING3( 
+            "ExecuteBatchCommandsUsingFixedBufferL execution failed, err=%d (%d,%d)", 
+            err, length, messageLength )
+        }
+#endif // _ALF_LOGGING
+
+    if ( !err && ( length != messageLength ) )
+        {
+        // All commands were not executed!
+        __ALFLOGSTRING2( 
+            "ExecuteBatchCommandsUsingFixedBufferL corrupted buffer (%d,%d)", 
+            length, messageLength )
+
+        err = KErrCorrupt;
+        }
+
+    User::LeaveIfError( err );
+    }
+
+TInt CAlfAppSrvSession::ExecuteBatchCommandsUsingBufferL( 
+        TDes8& aBuffer, 
+        TInt aMessageLength,
+        const RMessage2& aMessage )
+    {
+    const TInt bufferMaxLength = aBuffer.MaxLength();
+    
+    // It is assumed that bufferMaxLength > command header length.
+    // If you check ExecuteBatchCommandsUsingFixedBufferL, you can see
+    // that this assumption holds.
+
+    TInt offset = 0;
+    TBool failed = EFalse;
+
+    while ( !failed && ( offset < aMessageLength ) ) 
+        {
+        aMessage.ReadL( 0, aBuffer, offset );
+
+        TInt spaceNeeded = 0;
+        offset += ExecuteCommandsFromDescriptorL( aBuffer, spaceNeeded );
+
+        if ( spaceNeeded > ( aMessageLength - offset ) )
+            {
+            // More space is needed than there is left in message.
+            failed = ETrue;
+            }
+        else if ( spaceNeeded > bufferMaxLength )
+            {
+            // Too bad, message does not fit to our fixed size buffer.
+            // Let's try to allocate buffer for this.
+
+            HBufC8* buffer = HBufC8::NewLC( spaceNeeded );
+            TPtr8 bufferPtr = buffer->Des();
+
+            aMessage.ReadL( 0, bufferPtr, offset );
+
+            // Maximum length of buffer may be larger than spaceNeeded,
+            // thus bufferPtr may be larger as well. But to keep this
+            // simple, let's constraint to one message.
+            if ( bufferPtr.Length() > spaceNeeded )
+                {
+                bufferPtr.SetLength( spaceNeeded );
+                }
+                
+            if ( bufferPtr.Length() == spaceNeeded )
+                {
+                TInt dummy;
+                TInt offsetDelta = 
+                    ExecuteCommandsFromDescriptorL( bufferPtr, dummy );
+
+                if ( offsetDelta == spaceNeeded )
+                    {
+                    // Move offset forward.
+                    offset += offsetDelta;    
+                    }
+                else
+                    {
+                    // There was supposed to be exactly one message
+                    // in buffer, but now there is not.
+                    failed = ETrue;
+                    }
+                }
+            else
+                {
+                // spaceNeeded amount of bytes were required for 
+                // next message, but somehow we did not get that many bytes.
+                failed = ETrue;
+                }
+
+            CleanupStack::PopAndDestroy( buffer );
+            }
+        else
+            {
+            // Do nothing - we can continue reading next part of buffer.
+            }
+        }
+
+    return offset;
+    }
+
+TInt CAlfAppSrvSession::ExecuteCommandsFromDescriptorL( 
+        const TDesC8& aSource, 
+        TInt& aSpaceNeeded )
+    {
+    TPtrC8 unreadArea( aSource );
+    aSpaceNeeded = 0;
+
+    while ( !aSpaceNeeded && ( unreadArea.Length() > 0 ) )
+        {
+        TInt3 params(0,0,0);
+        TPckg<TInt3> paramsPckg( params );
+
+        // Check if there is complete parameter structure in unreadArea.
+        const TInt paddedParamsPckgMaxLength = 
+            AlfPaddedLength( paramsPckg.MaxLength() );
+        if ( paddedParamsPckgMaxLength > unreadArea.Length() )
+            {
+            // Bail out from while loop.
+            aSpaceNeeded = paddedParamsPckgMaxLength;
+            }
+        else
+            {
+            // Copy to local parameters.
+            paramsPckg.Copy( unreadArea.Left( paramsPckg.MaxLength() ) );
+
+            // Read parameters
+            const TInt operation = params.iInt1;
+            const TInt subSessionHandle = params.iInt2;
+            const TInt inputBufferLength = params.iInt3;
+            
+            if ( inputBufferLength < 0 )
+                {
+                // Input buffer length must not be negative.
+                __ALFLOGSTRING1( 
+                    "ExecuteCommandsFromDescriptorL corrupted: neg. length %d",
+                    inputBufferLength )
+                User::Leave( KErrCorrupt );
+                }
+                
+            const TInt paddedInputBufferLength = 
+                AlfPaddedLength( inputBufferLength );
+            
+            if ( paddedParamsPckgMaxLength + paddedInputBufferLength < 0 )
+                {
+                // There must NOT be overflow.
+                __ALFLOGSTRING1( 
+                    "ExecuteCommandsFromDescriptorL corrupted: length %d",
+                    inputBufferLength )
+                User::Leave( KErrCorrupt );
+                }
+
+            // Check if there is complete input buffer in unreadArea.
+            if ( paddedParamsPckgMaxLength + paddedInputBufferLength > 
+                 unreadArea.Length() )
+                {
+                // Bail out from while loop.
+                aSpaceNeeded = paddedParamsPckgMaxLength + paddedInputBufferLength;
+                }
+            else
+                {                    
+                // Now we know that all data is available. 
+                // It's time to execute command.
+
+                // Skip over parameters (already read above)
+                unreadArea.Set( unreadArea.Mid( paddedParamsPckgMaxLength ) );
+               
+                // Read input buffer
+                TPtrC8 inputbuffer = unreadArea.Left( inputBufferLength );
+                unreadArea.Set( unreadArea.Mid( paddedInputBufferLength ) );
+        
+                if ( !CAlfAppSrvSessionBase::HasSession( subSessionHandle ) )
+                    {
+                    // Subsession handle must exist.
+                    __ALFLOGSTRING1( 
+                        "ExecuteCommandsFromDescriptorL corrupted: handle %d",
+                        subSessionHandle )
+                    User::Leave( KErrCorrupt );
+                    }
+        
+                // Execute command
+                CAlfSrvSubSessionBase& subsession = 
+                    CAlfAppSrvSessionBase::SubSession( subSessionHandle );
+                MAlfExtension* subsessionEx = subsession.AsCommandHandler();
+
+                if ( !subsessionEx )
+                    {
+                    // Instance implementing extension interface must exist.
+                    __ALFLOGSTRING1( 
+                        "ExecuteCommandsFromDescriptorL corrupted: no ext, handle %d",
+                        subSessionHandle )
+                    User::Leave( KErrCorrupt );
+                    }
+
+                TBuf8<1> dummy;
+#ifdef _ALF_LOGGING
+                TRAPD( err,
+                    subsessionEx->HandleCmdL( operation, inputbuffer, dummy ) );
+                if ( err != KErrNone )
+                    {
+                    __ALFLOGSTRING3( 
+                        "ExecuteCommandsFromDescriptorL HandleCmdL fail %d (subsession %d, operation %d)", 
+                        err, subSessionHandle, operation )
+                    }
+                User::LeaveIfError( err );
+#else
+                subsessionEx->HandleCmdL( operation, inputbuffer, dummy );
+#endif // _ALF_LOGGING
+                }
+            }
+        }
+    
+    return aSource.Length() - unreadArea.Length();
+    }
+
+inline TBool CAlfAppSrvSession::AllowExecuteUsingDynamicBuffer() const
+    {
+    return ( iExecutionFlags & EAlfExecuteUsingDynamicBuffer );
+    }
+
+inline TBool CAlfAppSrvSession::AllowExecuteUsingCommonBuffer() const
+    {
+    return ( iExecutionFlags & EAlfExecuteUsingCommonBuffer );
+    }
+
+inline CAlfSrvTextureManager& CAlfAppSrvSession::AlfTextureManager()
+    {
+    return AlfServer()->TextureManager();
+    }
+
+void CAlfAppSrvSession::NotifyTextureInfo( const RMessage2& aMessage )
+    {
+    if ( iTextureInfoEvent.IsNull() )
+        {
+        iTextureInfoEvent = aMessage;
+                
+        // If there has been texture info updates, 
+        // complete immediately.
+        DeliverTextureInfo();
+        }
+    else
+        {
+        aMessage.Complete( KErrInUse );
+        }   
+    }
+
+inline TBool CAlfAppSrvSession::HasPendingTextureInfo() const
+    {
+    TBool found = EFalse;
+    
+    for ( TInt i = 0; i < iTextureInfo.Count(); i++ )
+        {
+        const TAlfTextureInfo& info = iTextureInfo[ i ];
+        if ( info.iFlags & TAlfTextureInfo::EAlfFlagTextureSizeChanged )
+            {
+            found = ETrue;
+            break;
+            }
+        }
+        
+    return found;
+    }
+      
+void CAlfAppSrvSession::DeliverTextureInfo()
+    {
+    if ( !(iFocused || iPartiallyVisible) || 
+         iTextureInfoEvent.IsNull() || !HasPendingTextureInfo() )
+        {
+        // Events are not delivered if
+        // - application does not have focus not partially visible
+        // - there is no pending notification
+        // - there is no texture info events to be delivered.
+        return;
+        }
+        
+    const TInt maxLength = iTextureInfoEvent.GetDesMaxLength( 0 );
+    
+    TAlfTextureInfoEvent event;
+    TPckgC<TAlfTextureInfoEvent> eventPckg( event );
+    const TInt eventPckgLength = eventPckg.Length();
+    
+    if ( maxLength <= eventPckgLength )
+        {
+        // Max length is less than size of one event buffer.
+        // So bail out.
+        iTextureInfoEvent.Complete( KErrBadDescriptor );
+        }
+    else
+        {
+        HBufC8* buffer = HBufC8::New( maxLength );
+        if ( buffer )
+            {
+            TPtr8 ptr = buffer->Des();
+
+            TInt priority = 0;
+            TInt foundTexturePos = 0;
+            
+            const TInt totalTextureInfo = iTextureInfo.Count();
+            
+            while ( ( foundTexturePos != KErrNotFound ) && 
+                    ( maxLength - ptr.Length() >= eventPckgLength ) )
+                {
+                // As long as there is space and another texture, 
+                // append to buffer.
+                
+                // Find using current priority.
+                foundTexturePos = 
+                    FindNextTextureInfoForDelivery( priority, foundTexturePos );
+                if ( ( foundTexturePos == KErrNotFound ) && !priority )
+                    {
+                    // If not found and priority was high, try
+                    // with lower priority.
+                    priority++;
+                    foundTexturePos = 0;
+                    
+                    foundTexturePos = FindNextTextureInfoForDelivery( 
+                        priority, foundTexturePos );
+                    }
+                                
+                if ( foundTexturePos != KErrNotFound )
+                    {
+                    TAlfTextureInfo& current = iTextureInfo[ foundTexturePos ];
+                    current.iFlags |= 
+                        TAlfTextureInfo::EAlfFlagTextureDelivered;
+                    current.iFlags &= 
+                        ~TAlfTextureInfo::EAlfFlagTextureSizeChanged;
+                    
+                    // Append event data
+                    event.iTextureId = current.iTextureId;
+                    event.iTextureSize = current.iTextureSize;
+                    ptr.Append( eventPckg );
+                    
+                    foundTexturePos++; // this has been delivered, skip to next
+                    }
+                }
+        
+            iTextureInfoEvent.Write( 0, ptr );
+            iTextureInfoEvent.Complete( KErrNone );
+            
+            delete buffer;
+            buffer = NULL;
+            }
+        else
+            {
+            // It is expected that maxLength is relatively small value.
+            // So it's better to try again a bit later.
+            }
+        }
+    }
+
+TInt CAlfAppSrvSession::FindNextTextureInfoForDelivery( 
+        TBool aPriority, TInt aStartPos ) const
+    {
+    const TInt count = iTextureInfo.Count();
+    TInt result = KErrNotFound;
+    
+    for ( TInt index = aStartPos; index < count; index++ )
+        {
+        const TAlfTextureInfo& current = iTextureInfo[ index ];
+
+        if ( ( current.iFlags & TAlfTextureInfo::EAlfFlagTextureSizeChanged ) &&
+             ( current.iDeliveryPriority == aPriority ) )
+            {
+            result = index;
+            break;
+            }
+        }
+    
+    return result;    
+    }
+
+TInt CAlfAppSrvSession::FindTextureInfoById( TInt aTextureId ) const
+    {
+    const TInt count = iTextureInfo.Count();
+    
+    // Optimization to handle the case that this method is called
+    // several times using the same texture id.
+    if ( iPreviousTextureInfoIndex < count )
+        {
+        if ( iTextureInfo[ iPreviousTextureInfoIndex ].iTextureId == 
+             aTextureId )
+            {
+            return iPreviousTextureInfoIndex;
+            }
+        }
+         
+    
+    TInt pos = KErrNotFound;
+    
+    for ( TInt i = 0; i < count; i++ )
+        {
+        if ( aTextureId == iTextureInfo[ i ].iTextureId )
+            {
+            pos = i;
+            iPreviousTextureInfoIndex = pos;
+            break;
+            }
+        }
+    
+    return pos;
+    }
+
+void CAlfAppSrvSession::RemoveTextureInfo( TInt aTextureId )
+    {
+    const TInt pos = FindTextureInfoById( aTextureId );
+    if ( pos != KErrNotFound )
+        {
+        iTextureInfo.Remove( pos );
+        }
+    }
+
+TInt CAlfAppSrvSession::GetTextureSize( 
+        TInt aTextureId, 
+        TSize& aTextureSize,
+        TBool& aHasBeenDelivered )
+    {
+    TInt pos = FindTextureInfoById( aTextureId );
+    if ( pos != KErrNotFound )
+        {
+        // TAlfTextureInfo struct was found - pos >= 0
+        aTextureSize = iTextureInfo[ pos ].iTextureSize;
+        aHasBeenDelivered = iTextureInfo[ pos ].iFlags & 
+            TAlfTextureInfo::EAlfFlagTextureDelivered;
+        }
+        
+    return pos != KErrNotFound;
+    }
+    
+void CAlfAppSrvSession::SetTextureSize(
+        TInt aTextureId,
+        const TSize& aTextureSize,
+        TInt aPriority )
+    {
+    const TBool highPriority = ( aPriority < 0 );
+    aPriority = Max( 0, aPriority );
+    aPriority = Min( 1, aPriority );
+
+    TInt pos = FindTextureInfoById( aTextureId );
+    if ( pos != KErrNotFound )
+        {
+        // TAlfTextureInfo struct was found - pos >= 0
+        TAlfTextureInfo& info = iTextureInfo[ pos ];
+        info.iTextureSize = aTextureSize;
+        info.iFlags |= TAlfTextureInfo::EAlfFlagTextureSizeChanged;
+        info.iFlags &= ~TAlfTextureInfo::EAlfFlagTextureDelivered;
+        info.iDeliveryPriority = aPriority;
+        
+        if ( highPriority )
+            {
+            // Move to the beginning. After this, above info
+            // struct is invalid.
+            TAlfTextureInfo tmp = iTextureInfo[ pos ];
+            iTextureInfo.Remove( pos );
+            iTextureInfo.Insert( tmp, 0 );
+            }
+        }
+    else
+        {
+        // TAlfTextureInfo struct was not found - append a new one.
+        TAlfTextureInfo info;
+        info.iFlags = TAlfTextureInfo::EAlfFlagTextureSizeChanged;
+        info.iTextureId = aTextureId;
+        info.iTextureSize = aTextureSize;
+        info.iDeliveryPriority = aPriority;
+        
+        if ( highPriority )
+            {
+            iTextureInfo.Insert( info, 0 );
+            }
+        else
+            {
+            iTextureInfo.Append( info );
+            }
+        }
+    }
+    
+void CAlfAppSrvSession::RemoveTextureSize( TInt aTextureId )
+    {
+    RemoveTextureInfo( aTextureId );
+    }
+    
+void CAlfAppSrvSession::TextureSizeChangesCompleted()
+    {
+    DeliverTextureInfo();
+    }
+
+// ---------------------------------------------------------------------------
+// PostQtCommandBufferL
+// ---------------------------------------------------------------------------
+//
+void CAlfAppSrvSession::PostQtCommandBufferL( const RMessage2& aMessage )
+    {
+  	TAlfQtCommandBufferParams params;
+    TPckg<TAlfQtCommandBufferParams> paramsPckg(params);
+    aMessage.Read(0,paramsPckg);    
+	AlfAppUi()->PostQTCommandBufferL( params );  
+	}
+
+// ---------------------------------------------------------------------------
+// ReportFrameRateBeginL
+// ---------------------------------------------------------------------------
+//
+void CAlfAppSrvSession::ReportFrameRateBegin( const RMessage2& aMessage )
+    {
+    TInt32 id = aMessage.Int0();
+    TFrameStamp* stamp = iFPSMeasurementArray.Find( id );
+    // remove existing id, if any
+    if ( stamp )
+        {
+        iFPSMeasurementArray.Remove(id);
+        }
+    iFPSMeasurementArray.Insert( id, TFrameStamp( CHuiStatic::FrameCount() ));
+    }
+            
+// ---------------------------------------------------------------------------
+// ReportFrameRateEndL
+// ---------------------------------------------------------------------------
+//
+void CAlfAppSrvSession::ReportFrameRateEnd( const RMessage2& aMessage )
+    {
+    TInt32 id = aMessage.Int0();
+    TFrameStamp FPSMeasurementEnd= TFrameStamp( CHuiStatic::FrameCount() );
+    TBuf<40> logText;
+            
+    TFrameStamp* begin = iFPSMeasurementArray.Find( id );
+    if ( begin )
+        {
+        TReal32 fps = FPSMeasurementEnd.FrameRate( *begin );
+        iFPSMeasurementArray.Remove(id);
+        
+        logText.Format( _L("%d\t%4.2f"), id, fps );    
+        RFileLogger::Write( KLogsDir, KAlfFPSLogFile, EFileLoggingModeAppend, logText );
+        }
+    else
+        {
+        logText.Format( _L("Id %d not found"), id );    
+        RFileLogger::Write( KAlfFPSLogDir, KAlfFPSLogFile, EFileLoggingModeAppend, logText );
+        }
+    RDebug::Print(_L("CAlfAppSrvSession::ReportFrameRateL - %S"), &logText );
+    }
+
+
+// ---------------------------------------------------------------------------
+// EnvEnableLowMemoryState
+// ---------------------------------------------------------------------------
+//    
+void CAlfAppSrvSession::EnvEnableLowMemoryState(const RMessage2& aMessage)
+    {
+    TBool mode = aMessage.Int0();
+    AlfAppUi()->NotifyLowMemory(mode);
+    }
+
+// ---------------------------------------------------------------------------
+// EnvForceSwRendering
+// ---------------------------------------------------------------------------
+//    
+void CAlfAppSrvSession::EnvForceSwRendering(const RMessage2& aMessage)
+    {
+    TBool enabled = aMessage.Int0();
+    TInt err = AlfAppUi()->ForceSwRendering( enabled );
+    aMessage.Complete( err );
+    }
+
+// End of file    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfappsrvsessionBase.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1124 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Server session
+*
+*/
+
+
+#include <uiacceltk/HuiEnv.h>
+#include <uiacceltk/HuiRoster.h>
+#include <uiacceltk/HuiDisplay.h>
+#include <uiacceltk/HuiEvent.h>
+#include <uiacceltk/HuiControl.h>
+#include <uiacceltk/HuiControlGroup.h>
+#include <uiacceltk/HuiUtil.h>
+
+#include "alf/alfappsrvsessionbase.h"
+#include "alf/alfappserver.h"
+#include "alf/alfappui.h"
+#include "alf/alfconstants.h"
+#include "alfloggingconfiguration.h"
+#include "alflogger.h"
+#include "alfsrvdisplaysubsession.h"
+#include "alfsrvcontrolgroupsubsession.h"
+#include "alfsrvtransformationsubsession.h"
+#include "alf/alfextensionfactory.h"
+#include "alf/alfversion.h"
+#include "alfsrvsettingshandler.h"
+
+const TUint KAlfMaxCpuUsageDuringPointerEvent = 35; // Percentage
+
+struct TAlfHandleAndImplUid
+    {
+    TAlfHandleAndImplUid(TInt aHandle, TInt aUid):iHandle(aHandle),iUid(aUid){}
+    static TBool Compare(const TInt* aKey, const TAlfHandleAndImplUid& aEntry)
+        {
+        return (*aKey==aEntry.iHandle);
+        }
+    TInt iHandle;
+    TInt iUid;
+    };
+
+struct TAlfTouchEventS: public TAlfTouchEvent
+    {
+    TAlfTouchEventS(const THuiEvent& aEvent) 
+        {
+        iEvent = aEvent.iPointerEvent;
+        Mem::FillZ(iControls, sizeof(iControls));
+        Mem::FillZ(iVisuals, sizeof(iVisuals));
+        }
+        
+    void AppendCtrl(TInt aControlHandle, TInt aVisualHandle)
+        {
+        for (TInt ii = 0; ii < KAlfTouchEventControlCount; ii++)
+            {
+            if (iControls[ii] == 0)
+                {
+                iControls[ii] = aControlHandle;
+                iVisuals[ii] = aVisualHandle;
+                break;
+                }
+            else if ( ii == KAlfTouchEventControlCount-1 )
+                {
+                __ALFLOGSTRING( "TAlfTouchEventS::AppendCtrl: Overflow" )
+                }
+            else
+                {
+                // For PC-lint
+                }
+            }
+        }
+    };
+
+NONSHARABLE_CLASS(CAlfAppSrvSessionBase::TPrivateData)
+    {
+    public:
+    enum TAlfPtrEventState 
+        {
+        ENotInitialized,
+        EStartNewEvent,
+        EUpdateCtrls,
+        ENotFocused
+        };
+    
+    public:
+    TPrivateData():iSharedEnv(0),iContainer(0),iObjectIx(0) {}
+    CHuiEnv* iSharedEnv;
+    TInt iClientWindowGroupId;
+    CObjectCon* iContainer;     // Not own
+    CObjectIx* iObjectIx;       // Own
+    RArray<TAlfHandleAndImplUid> iHandles;    
+    RPointerArray<CAlfClientMessage> iMessages;
+    RArray<TAlfTouchEventS>       iHuiEvents; // now only pointer events are supported
+    TAlfPtrEventState iPtrEventState;
+    RMessagePtr2 iPointerEvent;
+    RMessagePtr2 iSystemEvent;
+    TInt iParentId;
+    TBool iActive;
+    }; 
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Cosntructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfAppSrvSessionBase::CAlfAppSrvSessionBase(const CAlfAppServer* aServer)
+    :iHost(const_cast<CAlfAppServer*>(aServer))
+    {
+    }
+
+EXPORT_C CAlfAppSrvSessionBase::CAlfAppSrvSessionBase()
+    :iHost(static_cast<CAlfAppServer*>(CEikonEnv::Static()->AppServer()))
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfAppSrvSessionBase::~CAlfAppSrvSessionBase()
+    { 
+    iHost->HandleClientExit(reinterpret_cast<TInt>(this));
+    
+    if ( iData )
+        {
+        iData->iHandles.Close();
+        delete iData->iObjectIx;
+    
+        // there shouldn't be orphean messages unless client app has been abnormally terminated...
+        while( iData->iMessages.Count() )
+            {
+            iData->iMessages[0]->CompleteMessageD(KErrCancel);
+            iData->iMessages.Remove(0);
+            }
+
+        iData->iMessages.Close();
+        iData->iHuiEvents.Close();
+        if (!iData->iPointerEvent.IsNull())
+            {
+            iData->iPointerEvent.Complete(KErrCancel);
+            }
+        if (!iData->iSystemEvent.IsNull())
+            {
+            iData->iSystemEvent.Complete(KErrCancel);
+            }
+        delete iData;
+        }
+    iHost = NULL;
+    }
+  
+// ---------------------------------------------------------------------------
+// Called when focus gained.
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfAppSrvSessionBase::FocusGainedL( TBool /*aDoTransitionEffect*/ )
+    {
+    // do some default effect if any
+    }
+  
+// ---------------------------------------------------------------------------
+// Called when focus lost.
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C TBool CAlfAppSrvSessionBase::FocusLostL( TBool /*aDoTransitionEffect*/ )
+    {
+    // do some default effect if any
+    return EFalse;
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns server.
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfAppServer* CAlfAppSrvSessionBase::AlfServer()
+    {
+    return iHost;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns AppUi.
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C CAlfAppUi* CAlfAppSrvSessionBase::AlfAppUi()
+    {
+    return iHost->AppUi(); // there is always AppUi when it is possible to create clients
+    }
+
+// ---------------------------------------------------------------------------
+// From class CAknAppServiceBase.
+// Called when client requests a service.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfAppSrvSessionBase::ServiceL(const RMessage2& aMessage)
+    {
+    if(iHost->MetricsInterface())
+        {
+        iHost->MetricsInterface()->EnterClientMessageL(reinterpret_cast<TInt>(this), aMessage);
+        if (aMessage.IsNull())
+            { // metrics interface completed the message, just abort handling of message 
+            return;
+            }
+        }
+        
+    
+#ifdef _ALF_LOGGING
+    TRAPD( err, 
+        {
+        if (!DoSubSessionCmdL(aMessage))    
+            {
+            DoHandleCommandL(aMessage);
+            }
+        } );
+    if ( err != KErrNone )
+        {
+        __ALFLOGSTRING2( "CAlfAppSrvSessionBase::ServiceL req %d err %d", aMessage.Function(), err )
+        User::Leave( err );
+        }
+        
+#else
+    if (!DoSubSessionCmdL(aMessage))    
+        {
+        DoHandleCommandL(aMessage);
+        }
+#endif
+
+    if(iHost->MetricsInterface())
+        {
+        iHost->MetricsInterface()->ExitClientMessage(reinterpret_cast<TInt>(this), aMessage);
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfAppSrvSessionBase::DoSubSessionCmdL(const RMessage2& aMessage)
+    {
+    TBool handled = ETrue;
+    TInt function = aMessage.Function();
+     // check if we are creating a subsession
+    if ( function == EAlfCreateSubSession )
+        {
+        // Create subsession.
+        CAlfSrvSubSessionBase* subSession = CreateSubSessionLC( aMessage );
+        
+        // Add to container (takes ownership)
+        iData->iContainer->AddL( subSession );
+        CleanupStack::Pop( subSession );
+        
+        const TInt handle = iData->iObjectIx->AddL( subSession );
+        
+        iData->iHandles.AppendL(TAlfHandleAndImplUid(handle,subSession->iFactoryUid));
+        
+        // Inform client of the handle its been allocated
+        TPckg<TInt> handlePckg( handle );
+        aMessage.Write(3,handlePckg);
+        
+        if ( !aMessage.IsNull() )
+            {
+            // Complete the message
+            aMessage.Complete( KErrNone );
+            }
+        }
+        
+    else if ( function == EAlfDoSubSessionCmd ||
+        function == EAlfDoAsyncSubSessionCmd ||
+        function == EAlfSubSCancelAsynchRequest )
+        {
+        // Find an appropriate object and pass the message to it
+        // for processing...
+        //
+        // we don't allow subsessions close each other, but session that sent the 
+        // original request must be used for cancelling  
+        //
+        // We could use subsession information from message queue if anyone 
+        // needs to be able to cancel commands
+        const TInt handle = aMessage.Int3();
+        
+        // Fetch the sub-session by its handle
+        CObject* object = iData->iObjectIx->At( handle );
+        __ASSERT_ALWAYS( object , USER_INVARIANT() );
+         
+        CAlfSrvSubSessionBase* subsession = static_cast<CAlfSrvSubSessionBase*>(object);
+        if (function != EAlfSubSCancelAsynchRequest)
+            {
+            subsession->ProcessMessageL( aMessage );
+            }
+        else
+            {
+            TInt index = iData->iMessages.Find(aMessage.Int0(), CAlfClientMessage::Compare);
+            TInt count = iData->iMessages.Count();
+            
+            if  (index != KErrNotFound)   
+                {
+                TInt2 cancelParams(iData->iMessages[index]->iClientId, iData->iMessages[index]->iDecodedOp);
+                TPckgC<TInt2> inbuf(cancelParams);
+                TBuf8<1> dum;
+                MAlfExtension* cmdHandler =  subsession->AsCommandHandler();
+                if (cmdHandler)
+                    {
+                    cmdHandler->HandleCmdL(EAlfSubSCancelAsynchRequest, inbuf, dum);
+                    }
+                if (count == iData->iMessages.Count()) // message not successfully removed
+                    {
+#ifdef _ALF_LOGGING
+                    RThread thread; 
+                    iData->iMessages[index]->iMessage.ClientL(thread);
+                    const TName threadName = thread.Name();
+                    __ALFLOGSTRING2( "CAlfAppSrvSessionBase::DoSubSessionCmdL: Asynch message from client: %S, op: %d was not cancelled correctly",
+                        &threadName, iData->iMessages[index]->iDecodedOp)
+                    thread.Close();
+#endif // _ALF_LOGGING       
+                    
+                    iData->iMessages[index]->CompleteMessageD(KErrCancel);
+                    iData->iMessages.Remove(index);
+                    }                
+                }
+            aMessage.Complete(KErrNone);
+            }
+        }
+
+    else if (function == EAlfCloseSubSession)
+        {
+        CloseSubSession(aMessage);
+        }
+     else 
+        {
+        handled = EFalse;
+        }    
+    
+    return handled;
+    }
+
+// ---------------------------------------------------------------------------
+// Called on contruction.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfAppSrvSessionBase::BaseConstructL()
+    {
+    // instrument private data etc..
+    __ASSERT_ALWAYS(!iData,USER_INVARIANT());
+    iData = new (ELeave) TPrivateData();
+    iData->iSharedEnv = &AlfAppUi()->HuiEnv();
+    iData->iClientWindowGroupId = KErrNotFound;
+    
+    iData->iContainer = iHost->NewContainerL();
+    iData->iObjectIx = CObjectIx::NewL();  
+    iData->iParentId = KErrNotFound; 
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfAppSrvSessionBase::ExtensionInterfaceL(TUid /*aInterfaceId*/, TAny*& /*aImplementaion*/)
+    {
+    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C CHuiEnv* CAlfAppSrvSessionBase::SharedHuiEnv() const
+    {
+    if (iData)
+        {
+        return iData->iSharedEnv;
+        }
+        
+    return 0;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfAppSrvSessionBase::SetClientWindowGroupId(TInt aId)
+    {
+    __ASSERT_DEBUG(iData, USER_INVARIANT());
+    iData->iClientWindowGroupId = aId;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C TRect CAlfAppSrvSessionBase::ClientDrawingArea() const
+    {
+    return TRect(0,0,0,0);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfAppSrvSessionBase::ClientWindowGroup() const
+    {
+    if (iData)
+        {
+        return iData->iClientWindowGroupId;
+        }
+    else
+        {
+        return KErrNotFound;
+        }
+    }
+  
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//   
+CAlfSrvSubSessionBase* CAlfAppSrvSessionBase::CreateSubSessionLC(const RMessage2& aMessage)
+    {
+    CAlfSrvSubSessionBase* subSession = NULL;
+    
+    TPckgBuf<TAlfImplementationInformation> buf;
+    aMessage.ReadL(0,buf);
+
+    if (buf().iImplementationUid == 0) // built in component requested
+        {
+        switch (buf().iImplementationId)
+            {
+            case EAlfDisplaySubSessionOpen:
+                {
+                TRect rect;
+                TPckg<TRect> rectPckg(rect); 
+                aMessage.Read(1,rectPckg);
+
+                TAlfDisplayCreateParams params;
+                TPckg<TAlfDisplayCreateParams> paramPckg(params); 
+                aMessage.Read(2,paramPckg);
+
+                const TInt windowGroupId = params.iWindowGroupId;
+                const TInt displayType = params.iDisplayType;
+                subSession = CAlfSrvDisplaySubSession::NewLC( *this, rect, windowGroupId, displayType, KHuiUidBackBufferScreen0 );
+                break;
+                }
+            case EAlfDisplaySubSessionOpen2:
+                {
+                TRect rect;
+                TPckg<TRect> rectPckg(rect); 
+                aMessage.Read(1,rectPckg);
+
+                TAlfDisplayCreateParams2 params;
+                TPckg<TAlfDisplayCreateParams2> paramPckg(params); 
+                aMessage.Read(2,paramPckg);
+
+                const TInt windowGroupId = params.iWindowGroupId;
+                const TInt displayType = params.iDisplayType;
+                const TUid bufferUid = params.iBufferUid;
+                subSession = CAlfSrvDisplaySubSession::NewLC( *this, rect, windowGroupId, displayType, bufferUid );
+                break;
+                }
+            case EAlfControlGroupSubSessionOpen:
+                {
+                const TInt id = aMessage.Int1();
+                subSession = CAlfSrvControlGroupSubSession::NewLC( *this, id );
+                break;
+                }
+            
+            case EAlfTransformationSubSessionOpen:
+                {
+                subSession = CAlfSrvTransformationSubSession::NewLC( *this );
+                break;
+                }
+            
+            default:
+                subSession = CAlfSrvSubSessionBase::NewLC( aMessage, 
+                                                   buf().iImplementationUid,
+                                                   buf().iImplementationId, 
+                                                   *this );
+                break;
+            }
+        }
+    else
+        {
+        // Check what API has been used when app has been compiled before
+        // loading extension. If runtime version is no more binary compatible, leave
+        TVersion compiletimeVersion = buf().iVersion;
+        TVersion runtimeVersion = TVersion(ALF_VERSION_MAJOR, ALF_VERSION_MINOR, ALF_VERSION_BUILD);
+        // Major version (AlfClient.dll) has been already checked in the client side at this time.        
+        // Minor version (AlfServercore, coretoolkit) is checked here.
+        if (compiletimeVersion.iMinor != runtimeVersion.iMinor)
+            {
+            User::Leave(KErrNotSupported);    
+            }
+        // For check also build here
+        else if (compiletimeVersion.iBuild > runtimeVersion.iBuild)
+            {                
+            User::Leave(KErrNotSupported);    
+            }    
+        else
+            {                
+            subSession = CAlfSrvSubSessionBase::NewLC( aMessage, 
+                                                       buf().iImplementationUid,
+                                                       buf().iImplementationId,                                                        *this );
+            }
+        }
+         
+    return subSession;
+    }
+
+
+// -----------------------------------------------------------------------------
+// Remove object from object index
+// -----------------------------------------------------------------------------
+//
+void CAlfAppSrvSessionBase::CloseSubSession( const RMessage2& aMessage )
+    {
+    TInt handle = aMessage.Int3();
+    CloseSubSession(handle);
+    
+    TInt err = KErrNone;
+
+#ifdef _DEBUG    
+    for (TInt ii = iData->iMessages.Count()-1; ii >= 0; ii--)
+        {
+        if ((iData->iMessages)[ii]->iSubSession == handle)
+            {
+            iData->iMessages[ii]->CompleteMessageD(KErrCancel);
+            iData->iMessages.Remove(ii);
+            err = KErrCompletion;
+            }
+        }
+#endif
+        
+    aMessage.Complete( err );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppSrvSessionBase::CloseSubSession(TInt aHandle)
+    {
+    CObject* obj = iData->iObjectIx->At( aHandle );  
+    __ASSERT_ALWAYS( obj, USER_INVARIANT() );
+    iData->iObjectIx->Remove( aHandle );
+    
+    TInt index = iData->iHandles.Find(aHandle, TAlfHandleAndImplUid::Compare);
+    if (index != KErrNotFound)
+        {
+        AlfServer()->DestroyedObject( iData->iHandles[index].iUid );
+        iData->iHandles.Remove(index);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfAppSrvSessionBase::HasSession( TInt aSubSessionHandle ) const
+    {
+    CObject* object = iData->iObjectIx->At( aSubSessionHandle );
+    return object != NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+CAlfSrvSubSessionBase& CAlfAppSrvSessionBase::SubSession( TInt aSubSessionHandle )
+    {
+    // Fetch the sub-session by its handle
+    CObject* object = iData->iObjectIx->At( aSubSessionHandle );
+    __ASSERT_ALWAYS( object, USER_INVARIANT() );
+    CAlfSrvSubSessionBase* subSession = static_cast<CAlfSrvSubSessionBase*>(object);
+    return *subSession;
+    }
+ 
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+TAny* FetchInterface(const THuiInterfaceSupport aType, CAlfSrvSubSessionBase* aSubSession )
+	{
+	TAny* result = 0;
+	switch (aType)
+	    {
+	    case EHuiObjectTypeVisual:
+	        result = aSubSession->AsHuiVisual();
+	        break;
+	    
+	    case EHuiObjectTypeLayout:
+	        result = aSubSession->AsHuiLayout();
+	        break;
+	    
+	    case EHuiObjectTypeControl:
+	        result = aSubSession->AsHuiControl();
+	        break;
+	        
+	    case EHuiObjectTypeControlGroup:
+	        result = aSubSession->AsHuiControlCroup();
+	        break;
+	        
+	    case EHuiObjectTypeDisplay:
+	        result = aSubSession->AsHuiDisplay();
+	        break;
+	    
+	    case EHuiObjectTypeBrush:
+	        result = aSubSession->AsHuiBrush();
+	        break;
+	    
+	    case EHuiInterfaceMappingFunction:
+	        result = aSubSession->AsMappingFunction();        
+	        break;
+	
+	    case EHuiInterfaceVisualOwner:
+	        result = aSubSession->AsVisualOwner();        
+	        break;
+	    case EAlfBrushHandler:
+	        result = aSubSession->AsBrushHandler();
+	        break;
+	    default:
+	       {
+	       if ( aSubSession->AsCommandHandler() )    
+	           {
+	           result = aSubSession->AsCommandHandler()->GetInterface(aType);     
+	           }
+	       break;
+	       }
+	   }    
+	return result;
+	}
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TAny* CAlfAppSrvSessionBase::GetInterfaceL(const THuiInterfaceSupport& aType, TInt aHandle)
+    {
+    CObject* obj = iData->iObjectIx->At( aHandle );  
+    if (!obj)
+        {
+        User::Leave(KErrArgument);
+        }
+    
+    CAlfSrvSubSessionBase* subSession = static_cast<CAlfSrvSubSessionBase*>(obj);
+
+    TAny* result = FetchInterface(aType, subSession);
+
+    if (!result)
+        {
+        User::Leave(KErrArgument);
+        }
+    
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TInt CAlfAppSrvSessionBase::GetHandleFromInterface(const THuiInterfaceSupport& aType, TAny* aInterface)
+    {
+    TInt handle = KErrNotFound;
+    for (TInt ii = iData->iHandles.Count()-1; ii >= 0; ii--)
+        {
+        const TInt handleitr = iData->iHandles[ii].iHandle;
+        CAlfSrvSubSessionBase* subSession = &SubSession(handleitr);
+
+        TAny* result = FetchInterface(aType, subSession);    
+        
+        if (result == aInterface)
+            {
+            handle = handleitr;
+            break;
+            }
+        }
+    return handle;
+    }
+ 
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C CAlfLayoutManager* CAlfAppSrvSessionBase::LayoutManager() const
+    {
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Extension method to implement new virtual like methods w/o breakin binary compatibility
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfAppSrvSessionBase::AlfInterfaceProviderExtension(const TUid& /*aExtensionUid*/, TAny** /*aExtensionParams*/)
+    {
+    
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfAppSrvSessionBase::FactoryDestroyed(TInt aFactoryUid)
+    {
+    // Todo: We should rather close the whole application...
+    
+    for (TInt ii = iData->iHandles.Count()-1; ii >= 0; ii--) // destroy in reverse order
+        {
+        if (iData->iHandles[ii].iUid == aFactoryUid)
+            {
+            CloseSubSession(iData->iHandles[ii].iHandle);
+            }
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+CAlfClientMessage* CAlfAppSrvSessionBase::CreateNewMessageHolderL(const RMessage2& aMessage)
+    {
+    CAlfClientMessage* msg = CAlfClientMessage::NewLC(aMessage.Int3(), aMessage);
+    
+    TInt lenght1 = aMessage.GetDesLength(1);
+    TInt lenght2 = aMessage.GetDesMaxLength(2);
+     
+    msg->iInBuf = HBufC8::NewL(lenght1);
+    TPtr8 inBuf = msg->iInBuf->Des();
+    aMessage.ReadL(1,inBuf); 
+        
+    msg->iOutBuf = HBufC8::NewL(lenght2);
+    
+    if (aMessage.Function() == EAlfDoAsyncSubSessionCmd)
+        {
+        TInt2 params(0,0);
+        TPckg<TInt2> pbuf(params);
+        aMessage.ReadL(0,pbuf);
+        msg->SetClientParams(params);
+        }
+    else
+        {
+        msg->iDecodedOp = aMessage.Int0();
+        }
+        
+    iData->iMessages.InsertL(msg, 0);
+    CleanupStack::Pop(msg);
+    return msg;  
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C TInt CAlfAppSrvSessionBase::HandleCurrentCommanndAsynch()
+    {
+    // If your code hits following assert, it is beacuse client side meant the command to be synchronous 
+    // but the extension implementation wants to turn that asynchronous. 
+    // either client side should request the command asynchronously, of server side implementation should complete 
+    // the message synchronously    
+    ASSERT(iData->iMessages[0]->iClientId);
+    
+    if (iData->iMessages.Count() && !iData->iMessages[0]->iIsAsync )
+        {
+        iData->iMessages[0]->iIsAsync = ETrue; 
+        }
+        
+    return iData->iMessages[0]->iClientId;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfAppSrvSessionBase::CompleteCmd(TInt aCommandId, TInt aResult)
+    {
+    if (iData->iMessages.Count() == 0)
+        {
+        return; // we could leave instead..
+        }
+        
+    if (aCommandId == 0) // subsession default 
+        {
+        if (aResult != KErrNone || !iData->iMessages[0]->iIsAsync) 
+            {
+            iData->iMessages[0]->CompleteMessageD(aResult);
+            iData->iMessages.Remove(0);
+            }
+
+        return;
+        }
+
+    TInt index = iData->iMessages.Find(aCommandId, CAlfClientMessage::Compare);
+    
+    if  (index != KErrNotFound)   
+        {
+        iData->iMessages[index]->CompleteMessageD(aResult);
+        iData->iMessages.Remove(index);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppSrvSessionBase::HandleEventL(TAny* aCtrlPtr, TAny* aVisualPtr, const THuiEvent& aEvent)
+    {
+    // resolve ctrl client handle
+    switch(iData->iPtrEventState)
+        {
+        case CAlfAppSrvSessionBase::TPrivateData::EStartNewEvent:
+            {
+            const TAlfTouchEventS touchEvent( aEvent );      
+            
+            // Purge drag events that come in sequence, because the client cannot handle all in time.    
+            if ( touchEvent.iEvent.iType == TPointerEvent::EDrag )
+                {
+                while ( iData->iHuiEvents.Count() && 
+                        iData->iHuiEvents[0].iEvent.iType == TPointerEvent::EDrag )
+                    {
+                    iData->iHuiEvents.Remove(0);
+                    }
+                }
+            
+            iData->iHuiEvents.InsertL(touchEvent,0);            
+            iData->iPtrEventState = CAlfAppSrvSessionBase::TPrivateData::EUpdateCtrls;
+            } // fall through
+        case CAlfAppSrvSessionBase::TPrivateData::EUpdateCtrls:
+            {
+            TInt controlHandle = GetHandleFromInterface(EHuiObjectTypeControl, aCtrlPtr);
+            ASSERT(controlHandle != KErrNotFound); // panic at will
+            
+            TInt visualHandle = 0;
+            if (aVisualPtr)
+                {
+                visualHandle = GetHandleFromInterface(EHuiObjectTypeVisual, aVisualPtr);
+                ASSERT(visualHandle != KErrNotFound);
+                }
+            iData->iHuiEvents[0].AppendCtrl(controlHandle, visualHandle);
+            }
+            break;
+        default: // don't do anything unless focused and initialized
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppSrvSessionBase::StartPointerHandling()
+    {
+    if (iData->iPtrEventState != CAlfAppSrvSessionBase::TPrivateData::ENotInitialized)
+        {
+        iData->iPtrEventState = CAlfAppSrvSessionBase::TPrivateData::EStartNewEvent;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppSrvSessionBase::FlushPointerHandling()
+    {
+    if (iData->iPtrEventState != CAlfAppSrvSessionBase::TPrivateData::ENotInitialized)
+        {
+        iData->iPtrEventState = CAlfAppSrvSessionBase::TPrivateData::ENotFocused;
+        if (iData->iHuiEvents.Count() == 1) // manually trigger the event queue if only one item
+            {
+            TriggerPointerEvent(0);
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppSrvSessionBase::TriggerPointerEvent(const RMessage2* aMessage)
+    {
+    if (aMessage)
+    	{ 	
+     	if (iData->iPointerEvent.IsNull())
+        	{
+        	iData->iPtrEventState = CAlfAppSrvSessionBase::TPrivateData::ENotFocused; // ensure that state machine gets running 
+        	iData->iPointerEvent = *aMessage;
+        
+        	// Reset cpu time to the correct value
+        	TUint maxCpuUsage = AlfAppUi()->SettingsHandler().MaxCpuUsage();
+   			SharedHuiEnv()->SetMaxCpuTime(maxCpuUsage);
+        	}
+        else
+        	{
+        	// There is already message waiting. Complete this with an error, and proceed with existing message.
+        	aMessage->Complete(KErrInUse);
+        	}
+    	}
+    else if (iData->iPointerEvent.IsNull())
+        {
+    	// Server is calling this internally and client is not ready.
+        // Take cpu time from rendering to give more time to event handling, both in server and client.
+   		SharedHuiEnv()->SetMaxCpuTime(KAlfMaxCpuUsageDuringPointerEvent);
+        }
+        
+    if (!iData->iPointerEvent.IsNull() 
+        && (iData->iHuiEvents.Count() > 1 
+            || (iData->iHuiEvents.Count() == 1 && iData->iPtrEventState == CAlfAppSrvSessionBase::TPrivateData::ENotFocused )))
+        {
+        TPckg<TAlfTouchEventS> buf(iData->iHuiEvents[iData->iHuiEvents.Count()-1]);
+        TInt error = iData->iPointerEvent.Write(0,buf);
+        if ( error != KErrNone )
+            {
+            __ALFLOGSTRING1( "CAlfAppSrvSessionBase::TriggerPointerEvent: write error: %d", error )
+            }
+        iData->iPointerEvent.Complete(error);        
+        iData->iHuiEvents.Remove(iData->iHuiEvents.Count()-1);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppSrvSessionBase::CancelPointerEvents()
+    {
+    if (!iData->iPointerEvent.IsNull())
+        {
+        iData->iPointerEvent.Complete(KErrCancel);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppSrvSessionBase::GetSystemEvents(const RMessage2* aMessage)
+    {
+    if (aMessage && iData->iSystemEvent.IsNull())
+        {
+        iData->iSystemEvent = *aMessage;
+        }
+    else 
+        {
+	    __ASSERT_DEBUG(aMessage, USER_INVARIANT());
+        aMessage->Complete(KErrInUse);
+        }
+        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppSrvSessionBase::TriggerSystemEvent(TInt aEvent)
+    {
+    if (!iData->iSystemEvent.IsNull()) 
+        {
+        TPckg<TInt> eventPckg(aEvent);
+        TInt error = iData->iSystemEvent.Write(0,eventPckg);
+        if ( error != KErrNone )
+            {
+            __ALFLOGSTRING1( "CAlfAppSrvSessionBase::TriggerSystemEvent: write error: %d", error )
+            }
+        iData->iSystemEvent.Complete(error);        
+        }        
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfAppSrvSessionBase::CancelSystemEvents()
+    {
+    if (!iData->iSystemEvent.IsNull())
+        {
+        iData->iSystemEvent.Complete(KErrCancel);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+void CAlfAppSrvSessionBase::GetSubsessionsByTypeL( 
+    RPointerArray<CAlfSrvSubSessionBase>& aArray, 
+    const THuiInterfaceSupport& aType )
+    {
+    aArray.Reset();
+    
+    for (TInt ii = iData->iHandles.Count()-1; ii >= 0; ii--)
+        {
+        const TInt handleitr = iData->iHandles[ii].iHandle;
+        CAlfSrvSubSessionBase* subSession = &SubSession(handleitr);
+
+        if ( FetchInterface( aType, subSession ) )
+            {
+            aArray.AppendL(subSession);
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C CAlfAppServer::TAlfWGPostion CAlfAppSrvSessionBase::PreferredWindowGroupPosition() const
+    {
+    return CAlfAppServer::EBehindOfParent;
+    }
+
+  
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C THuiRefreshMode CAlfAppSrvSessionBase::PreferredRefreshMode() const
+    {
+    return EHuiRefreshModeAutomatic;
+    }
+
+// ---------------------------------------------------------------------------
+// Future proofing, just base call for now 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfAppSrvSessionBase::ServiceError(const RMessage2& aMessage,TInt aError)
+    {
+    CAknAppServiceBase::ServiceError(aMessage,aError);
+    }
+
+// ---------------------------------------------------------------------------
+// Future proofing, just base call for now 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C TInt CAlfAppSrvSessionBase::CountResources()
+    {
+    return CAknAppServiceBase::CountResources();
+    }
+
+
+// ---------------------------------------------------------------------------
+// Future proofing, just base call for now 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfAppSrvSessionBase::Disconnect(const RMessage2& aMessage)
+    {
+    CAknAppServiceBase::Disconnect(aMessage);
+    }
+
+// ---------------------------------------------------------------------------
+// From CSession2. Future proofing, just base call for now 
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C TInt CAlfAppSrvSessionBase::Extension_(TUint aExtensionId, TAny*& a0, TAny* a1)
+    {
+    return CAknAppServiceBase::Extension_(aExtensionId,a0,a1);
+    }
+
+void CAlfAppSrvSessionBase::SetParentWindowGroupId(TInt aParentId)
+    {
+    iData->iParentId = aParentId;
+    }
+
+TInt CAlfAppSrvSessionBase::ParentWindowGroupId()
+    {
+    return iData->iParentId;
+    }
+
+void CAlfAppSrvSessionBase::ResetRootlayerTransformationsL()
+    {
+    RPointerArray<CAlfSrvSubSessionBase> groups;
+    CleanupClosePushL( groups );
+    GetSubsessionsByTypeL( groups, EHuiObjectTypeControlGroup );
+    for ( TInt g = 0 ; g < groups.Count() ; g++ )
+        {
+        CHuiControlGroup* group = groups[g]->AsHuiControlCroup();
+        ASSERT( group ); 
+        CHuiLayout* hostContainer = group->Control(0).ContainerLayout( NULL );
+        if (hostContainer)
+            {
+            hostContainer->EnableTransformationL(EFalse);
+            hostContainer->iOpacity.Set(1.f);
+            }
+        }
+    CleanupStack::PopAndDestroy();
+    }
+
+// RnD
+void CAlfAppSrvSessionBase::ActivateContainerLayoutL(TBool aActivate)
+    {
+    if (iData->iActive != aActivate)
+        {
+        iData->iActive = aActivate;
+        RPointerArray<CAlfSrvSubSessionBase> groups;
+        CleanupClosePushL( groups );
+        GetSubsessionsByTypeL( groups, EHuiObjectTypeControlGroup );
+        for ( TInt g = 0 ; g < groups.Count() ; g++ )
+            {
+            CHuiControlGroup* group = groups[g]->AsHuiControlCroup();
+            ASSERT( group ); 
+            CHuiLayout* hostContainer = group->Control(0).ContainerLayout( NULL );
+            if (hostContainer)
+                {
+                if (aActivate)
+                    {
+                    hostContainer->ClearFlag(EHuiVisualFlagInactive);
+                    }
+                else
+                    {
+                    hostContainer->SetFlag(EHuiVisualFlagInactive);
+                    }
+                }
+            }
+        CleanupStack::PopAndDestroy();
+        }
+    }
+   
+// End of file    
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfappui.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1445 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   AppUi class
+*
+*/
+
+   
+#include <apgtask.h>
+#include <AknDoc.h>
+#include "alf/alfappui.h"
+#include "alf/alfappserver.h"
+#include <uiacceltk/HuiEnv.h>
+#include <aknenv.h>
+#include <AknsConstants.h>
+#include <uiacceltk/HuiSkin.h>
+#include <uiacceltk/HuiDisplay.h>
+#include <uiacceltk/HuiControl.h>
+#include <uiacceltk/HuiControlGroup.h>
+#include <uiacceltk/HuiEvent.h>
+#include <uiacceltk/HuiDeckLayout.h>
+#include <uiacceltk/HuiImageVisual.h>
+#include <uiacceltk/HuiTransformation.h>
+#include <uiacceltk/HuiBorderBrush.h>
+#include <uiacceltk/HuiUtil.h>
+#include <uiacceltk/HuiTextVisual.h>
+#include <uiacceltk/HuiGradientBrush.h>
+#include <apgwgnam.h>
+
+#ifdef ALF_USE_CANVAS
+#include <uiacceltk/HuiCanvasVisual.h>
+#endif
+
+#include "alflogger.h"
+#include "alf/alfappsrvsessionbase.h"
+#include "alf/alfappserver.h"
+#include "alfsrvresourcemanager.h"
+#include "alfsrvsettingshandler.h"
+#include <uiacceltk/HuiTextureManager.h>
+#include "alfsrvtexturemanager.h"
+#include "alfshareddisplaycoecontrol.h"
+#include "alfuids.h"
+
+#ifdef SYMBIAN_BUILD_GCE
+#include "alfbridge.h"
+#include "alfstreamerserver.h"
+#include "alfdecoderserverclient.h"
+#include "alfstreamerconsts.h"
+#endif // #ifdef SYMBIAN_BUILD_GCE
+
+// DISABLE this if you want to use the AHDemoApp layout switch. If this is enabled
+// and switch is done through AHDemoApp, the layout will be rotated too much.
+#ifdef __WINSCW__
+// Use this, if you want the VGA layout to show correctly
+#define ALF_USE_EMULATOR_LAYOUT_SWITCH_BUTTON
+#endif
+
+
+_LIT(KAlfEventThreadName,"alfevents");
+NONSHARABLE_CLASS(CAlfEventCatcher): public CActive
+    { // this class does not actually catch the events but moves the wg so that alf can get pointer events
+    public:
+    CAlfEventCatcher(RWsSession& aWsSession, 
+                     RWindowGroup& aWindowGroup, RWindow* aWindow, CWsScreenDevice* aScreenDevice)
+                     :CActive(CActive::EPriorityStandard), 
+                     iWsSession(aWsSession),
+                     iWindowGroup(aWindowGroup),
+                     iWindow(aWindow),
+                     iScreenDevice(aScreenDevice),
+                     iThread(RThread().Id())
+        {
+        CActiveScheduler::Add(this);
+        iSema.CreateLocal();
+        DoActivate();
+        }
+    
+    ~CAlfEventCatcher()
+        {
+        Cancel();
+        iSema.Close();
+        }
+    
+    void DoActivate()
+        {
+        SetActive();
+        iStatus = KRequestPending;        
+        }
+    
+    void AdjustWindowGroupPositionL(TInt aParentIdentifier, TInt aPosition)
+        {
+        iSema.Wait();
+        // ok to update previous values even they were not applied by ao
+        iParentIdentifier = aParentIdentifier;
+        iPosition = aPosition;
+        if (IsActive() && iStatus == KRequestPending)
+            {
+            RThread t;
+            TInt err = t.Open(iThread);
+            if (err)
+                {
+                __ALFLOGSTRING1( "CAlfEventCatcher::Trigger() ignore RThread::Open() error: %d", err );
+                }
+            TRequestStatus* status = &iStatus;
+            __ALFLOGSTRING("CAlfEventCatcher::Trigger - completing  CAlfEventCatcher");
+            t.RequestComplete(status, err);
+            t.Close();
+            }
+        iSema.Signal();
+        }
+    
+    void RunL()
+        {
+        iSema.Wait();
+        if (iStatus.Int() == KErrNone)
+            {
+            TRAPD(err, DoAdjustPositionL());
+            if (err)
+                {
+                __ALFLOGSTRING1("ALF: WG Parent not found, err %d", err);
+                }
+            }
+        DoActivate();
+        iSema.Signal();
+        }
+
+    void DoAdjustPositionL()
+        {
+         __ALFLOGSTRING1("ALF: DoAdjustPositionL() %d", iPosition);
+                  
+        if (iPosition == CAlfAppServer::EAbsoluteBackground) // just for convenience
+            {
+            __ALFLOGSTRING("CAlfEventCatcher::DoAdjustPositionL - CAlfAppServer::EAbsoluteBackground");
+            iWindowGroup.SetOrdinalPosition(-1,ECoeWinPriorityNeverAtFront);
+            iWsSession.Flush();
+            return;
+            }
+        else if (iPosition == CAlfAppServer::EAlfWindowSize ) // just for developer convenience
+            {
+            __ALFLOGSTRING("CAlfEventCatcher::DoAdjustPositionL - CAlfAppServer::EAlfWindowSize");
+             // update window size when layout changes    
+            iScreenDevice->SetAppScreenMode(iScreenDevice->CurrentScreenMode());
+            iWindow->SetSize(iScreenDevice->SizeInPixels());
+            __ALFLOGSTRING2("ALF EventWin: Size(%d,%d)", iWindow->Size().iWidth, iWindow->Size().iHeight );
+            return;
+            }
+     
+            
+        TInt parentPriority = 
+            iWsSession.GetWindowGroupOrdinalPriority(iParentIdentifier);
+
+        // perhaps we should maintain wg-list elsewhere
+        CArrayFixFlat<TInt>* wgs = new (ELeave) CArrayFixFlat<TInt>(1); 
+        CleanupStack::PushL(wgs);
+        iWsSession.WindowGroupList(parentPriority,wgs);
+        
+        TInt pos = KErrNotFound;
+        TInt movingWgOldPos = KErrNotFound;
+        TInt wgCount = wgs->Count();
+        for (TInt i = 0; i < wgCount; i++)
+            {
+            if (iParentIdentifier == wgs->At(i))
+                {
+                if ( iPosition == CAlfAppServer::EOnTopOfParent )
+                    {
+                    pos = i;
+                    }
+                else
+                    {
+                    pos = i+1;
+                    }
+                }
+            if ( iWindowGroup.WindowGroupId() == wgs->At(i))
+                {
+                movingWgOldPos = i;
+                }
+               
+            if ( pos != KErrNotFound && movingWgOldPos != KErrNotFound )
+                {
+                // Both found already.
+                break;
+                }
+            }
+        
+        // If the moving window group has already been before the parent
+        // we need to adjust the new position
+        if ( movingWgOldPos < pos && movingWgOldPos != KErrNotFound )
+            {
+            pos--;
+            }
+
+        User::LeaveIfError(pos); // parent not found, leave
+        CleanupStack::PopAndDestroy(wgs);        
+        iWindowGroup.SetOrdinalPosition(pos, parentPriority);
+        iWsSession.Flush();
+        }
+    
+    void DoCancel()
+        {
+        // do not..
+        }
+    
+    RWsSession& iWsSession;
+    RWindowGroup& iWindowGroup;
+    RWindow* iWindow;
+    CWsScreenDevice* iScreenDevice;
+    TThreadId iThread;
+    RCriticalSection iSema;
+    TInt iPosition;
+    TInt iParentIdentifier;
+    };
+
+NONSHARABLE_CLASS(CAlfEventBridge): public CActive
+    {
+    public:
+    CAlfEventBridge(CAlfAppUi& aAppUi, CHuiDisplay& aDisplay)
+        :CActive(CActive::EPriorityUserInput), 
+        iAppUi(aAppUi), 
+        iDisplay(aDisplay),
+        iThread(RThread().Id())
+        {
+        CActiveScheduler::Add(this);
+        iSema.CreateLocal();
+        TPixelsAndRotation rot;
+        CWsScreenDevice* sd = CHuiStatic::ScreenDevice();
+        sd->GetScreenModeSizeAndRotation(sd->CurrentScreenMode(),rot);
+        iVirtualSize = rot.iPixelSize; // for pointer event re-mapping
+        RequestEventNotification();
+        }
+        
+    ~CAlfEventBridge()
+        {
+        Cancel();
+        iSema.Close();
+        iQueue1.Close();
+        iQueue2.Close();
+        }        
+ 
+    void RequestEventNotification()
+    /** Asks WSERV proxy to give notification when an event is waiting */
+        {
+        iSema.Wait();
+        iQueueSelection++;
+        iQueueSelection%=2;
+        iStatus = KRequestPending;
+        SetActive();
+        iSema.Signal();            
+        }
+    
+    void AdjustWindowGroupPositionL(TInt aParentIdentifier, TInt aPosition)
+        {
+        if (iEventCatcher)
+            {
+            iEventCatcher->AdjustWindowGroupPositionL(aParentIdentifier, aPosition);
+            }
+        }
+    
+    void Trigger(TInt aReason)
+        {
+        if (IsActive() && iStatus == KRequestPending)
+            {
+            RThread t;
+            TInt err = t.Open(iThread);
+            if (err)
+                {
+                __ALFLOGSTRING1( "CAlfEventBridge::Trigger() ignore RThread::Open() error: %d", err );
+                }
+            TRequestStatus* status = &iStatus;
+            __ALFLOGSTRING("CAlfEventBridge::Trigger - completing  CAlfEventBridge")
+            t.RequestComplete(status, err?err:aReason);
+            t.Close();
+            }
+
+        }
+    
+    void AddEventL(TWsEvent& aEvent)
+        {  
+        iSema.Wait();    
+        User::LeaveIfError((!iQueueSelection?iQueue1:iQueue2).Append(aEvent));
+        Trigger(KErrNone);
+        iSema.Signal();
+        }
+    
+    // Todo: Should cache entries
+    TBool GetEvent(TWsEvent& aEvent)
+        {
+        if ((iQueueSelection?iQueue1:iQueue2).Count())    
+            {
+            aEvent = (iQueueSelection?iQueue1:iQueue2)[0];
+            (iQueueSelection?iQueue1:iQueue2).Remove(0);
+            return ETrue;
+            }
+        return EFalse;    
+        }
+        
+    void RunL()
+        {
+        switch (iStatus.Int())
+            {
+        case KErrNone:
+            break;
+        case KErrCancel:
+        case KErrServerTerminated:
+            return;
+        default:
+            // Let bridge object know the event window group so that it is able reorder window groups correctly
+            if (iStatus.Int() > KErrNone)
+                {    
+                iAppUi.SetAlfWindowGroupId(iStatus.Int());
+                }
+            break;
+            }
+				
+        RequestEventNotification();
+
+        TWsEvent event;
+        while (GetEvent(event))
+            {
+            TRAPD(err,DoHandleEventL(event))
+                if (err)
+                {
+                __ALFLOGSTRING2("ALF: Error in handling WSEvent: event: %d err: %d", err, event.Type());    
+                }
+            }    
+        }
+        
+    void DoHandleEventL(TWsEvent& aEvent)
+        {
+        iAppUi.HandleWsEventL(aEvent, 0);
+
+        if (aEvent.Type() >= EEventPointer && aEvent.Type() <=  EEventDragDrop )
+            {
+            // twiddle pointer coordinates
+            THuiEvent huiEvent(&iDisplay, *aEvent.Pointer());
+            // Send events received here only to the associated display    
+            iDisplay.Roster().HandleEventL(huiEvent);        
+            iAppUi.EndPointerEventHandling(); // flush here
+            }
+        }
+        
+    void DoCancel()
+        {
+        }
+    
+    CAlfAppUi& iAppUi;
+    CHuiDisplay& iDisplay; // if we ever need to support touch events from multiple displays, this needs to change
+                           // of course we could have several event fetchers on that scnario..  
+    RArray<TWsEvent> iQueue1;
+    RArray<TWsEvent> iQueue2;
+    TInt iQueueSelection;
+    RCriticalSection iSema;
+    TThreadId iThread;
+    CAlfEventCatcher* iEventCatcher;
+    TSize iVirtualSize;
+    };
+
+// ===========ALF WINDOW THREAD================
+
+
+NONSHARABLE_CLASS(CAlfEventFetcher): public CActive
+    {
+    public:
+    CAlfEventFetcher(RWsSession& aWsSession, 
+                     CAlfEventBridge* aBridge )
+        :CActive(CActive::EPriorityUserInput), 
+        iWsSession(aWsSession),
+        iWindowGroup(aWsSession),
+        iBridge(aBridge)
+        {
+        CActiveScheduler::Add(this);
+        }
+ 
+    ~CAlfEventFetcher()
+        {
+        Cancel();
+        delete iWindowGc;
+        if (iWindow)
+            {
+            iWindow->Close();    
+            delete iWindow;
+            }
+        iWindowGroup.Close();    
+        delete iScreenDevice;
+        }    
+ 
+    static CAlfEventFetcher* NewLC(RWsSession& aWsSession, 
+                     CAlfEventBridge* aBridge )
+        {
+        CAlfEventFetcher* ret = new (ELeave)CAlfEventFetcher(aWsSession,aBridge);
+        CleanupStack::PushL(ret);
+        ret->CreateWindowAndStartL();    
+        return ret;
+        }     
+
+    void CreateWindowAndStartL()
+        {
+        iWsSession.ComputeMode(RWsSession::EPriorityControlDisabled);
+        RThread thread; 
+#if defined(__EPOC32__)
+    thread.SetProcessPriority(EPriorityForeground);    
+#else
+    thread.SetPriority(EPriorityAbsoluteForegroundNormal);    
+#endif
+        iScreenDevice =new(ELeave) CWsScreenDevice(iWsSession);
+        iScreenDevice->Construct(0); // For main display only
+
+        User::LeaveIfError(iWindowGroup.Construct((TUint32)iScreenDevice, EFalse,iScreenDevice));                   
+        iWindowGroup.EnableReceiptOfFocus(EFalse); 
+        // disable pointer events based autoforwarding
+        iWindowGroup.AutoForeground(EFalse);
+        iWindowGroup.EnableScreenChangeEvents();
+
+        CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(iWsSession);
+        wgName->SetHidden(ETrue); // hides us from FSW and protects us from OOM FW etc.
+        wgName->SetSystem(ETrue); // Allow only application with PowerManagement cap to shut us down    
+        wgName->SetCaptionL(_L("ALF Event"));
+        wgName->SetAppUid(KNullUid);
+        wgName->SetWindowGroupName(iWindowGroup);
+        CleanupStack::PopAndDestroy();
+
+        iWindow = new (ELeave) RWindow(iWsSession);
+        iWindow->Construct(iWindowGroup,0x000FAB11); // FYI: multiple display support neglegted atm
+        iWindow->SetExtent(TPoint(0,0),iScreenDevice->SizeInPixels()); // FYI: multiple display support neglegted atm            
+        iWindow->EnableAdvancedPointers();
+        iWindow->PointerFilter(EPointerFilterDrag,0);
+        iWindow->SetPointerGrab(ETrue);
+        iWindow->Activate();
+        iWindow->SetVisible(ETrue);            
+        iWindow->SetTransparencyAlphaChannel();
+        iWindow->SetBackgroundColor(~0);
+        
+        iBridge->iEventCatcher = new (ELeave) CAlfEventCatcher(iWsSession, iWindowGroup, iWindow, iScreenDevice);   
+        iBridge->Trigger(iWindowGroup.Identifier()); // let appui know our wgid
+        
+        //RequestEventNotification();            
+        SetActive();
+        TRequestStatus* sptr = &iStatus;
+        User::RequestComplete(sptr, KErrNone);
+        }    
+    
+ 
+    void RequestEventNotification()
+    /** Asks WSERV to give notification when an event is waiting */
+        {
+        SetActive();
+        iWsSession.EventReady(&iStatus);
+        }
+    
+    void RunL()
+        {
+        if (!iInitializationComplete)
+            { // invalidate window server scene to get the latest drawing commands
+              // now that alf is there  
+            iWindowGc = new CWindowGc(iScreenDevice);
+            if (iWindowGc)
+                {
+                if(iWindowGc->Construct() == KErrNone)
+                    {
+                    iWindowGc->Activate(*iWindow);
+                    iWindowGc->SetBrushColor(0xffffffff);
+                    iWindowGc->Clear();
+                    iWindowGc->Deactivate();
+                    }                
+                }
+
+            iWindowGroup.SetOrdinalPosition(-1,ECoeWinPriorityNeverAtFront);
+            iWsSession.Flush();
+            iInitializationComplete = ETrue;
+            RequestEventNotification(); 
+            return;
+            }
+    
+        switch (iStatus.Int())
+            {
+        case KErrNone:
+            break;
+        case KErrCancel:
+        case KErrServerTerminated:
+        default:
+            return;
+            }
+
+        TWsEvent event;
+        iWsSession.GetEvent(event);
+        
+        if( event.Type() == EEventScreenDeviceChanged  )
+            {
+#ifdef ALF_USE_EMULATOR_LAYOUT_SWITCH_BUTTON
+            // Update window size when layout changes. The ScreenDevice
+            // has to be updated separately, otherwise it will always return the orig resolution.
+            iScreenDevice->SetAppScreenMode(iScreenDevice->CurrentScreenMode());
+            
+            TSize size = iScreenDevice->SizeInPixels();
+            TSize origSize = iWindow->Size();
+            
+            TPixelsAndRotation rotation;
+            iScreenDevice->GetDefaultScreenSizeAndRotation(rotation);
+            
+            // Set the new size to the window, if it wasn't orientation change within same resolution.
+            if (origSize != size && rotation.iRotation == CFbsBitGc::EGraphicsOrientationNormal)
+                {
+                iWindow->SetSize(size);
+                iWindow->Size(); // To populate size cache
+                }
+#else            
+            // update window size when layout changes    
+            iScreenDevice->SetAppScreenMode(iScreenDevice->CurrentScreenMode());
+            iWindow->SetSize(iScreenDevice->SizeInPixels());
+#endif
+            
+			// This is a workaround for possibly missing command buffers at layout switch
+            iWsSession.ClearAllRedrawStores(); 
+            
+            __ALFLOGSTRING2("ALF EventWin: Size(%d,%d)", iWindow->Size().iWidth, iWindow->Size().iHeight );
+            //and fall through
+            }
+    
+        RequestEventNotification();     //Request now so that WSERV has time to respond (on SMP systems) before the return to the Active Scheduler
+        iBridge->AddEventL(event);    
+        }    
+    
+    void DoCancel()
+        {
+        iWsSession.EventReadyCancel();
+        }
+    
+    RWsSession& iWsSession;
+    RWindowGroup iWindowGroup;
+    CWsScreenDevice* iScreenDevice;
+    RWindow* iWindow;
+    CAlfEventBridge* iBridge;  
+    TBool iInitializationComplete;
+    CWindowGc* iWindowGc;
+    };
+
+LOCAL_C void DoAlfEventThreadStartFunctionL(CAlfEventBridge* aBridge)
+    {
+    RWsSession wsSession;
+    wsSession.Connect();
+    CleanupClosePushL(wsSession);
+        
+    CAlfEventFetcher* fetch = CAlfEventFetcher::NewLC(wsSession, aBridge);
+                    
+    CActiveScheduler::Start();
+    CleanupStack::PopAndDestroy(2); // ws, fetcher
+    }
+
+// ---------------------------------------------------------------------------
+// Entry point into the new thread
+// ---------------------------------------------------------------------------
+//   
+GLDEF_C TInt AlfEventThreadStartFunction(TAny* aBridge)
+    {
+    __UHEAP_MARK;
+
+    TInt err = User::RenameThread(KAlfEventThreadName);
+    if (err == KErrNone)
+        {
+        // Set up scheduler and cleanup stack for this thread
+        CActiveScheduler* scheduler = new CActiveScheduler;
+        if (!scheduler)
+            {
+            return KErrNoMemory;
+            }
+        CActiveScheduler::Install(scheduler);
+        CTrapCleanup* trapCleanup = CTrapCleanup::New();
+        if (!trapCleanup)
+            {
+            return KErrNoMemory;
+            }
+
+        TRAP(err,DoAlfEventThreadStartFunctionL((CAlfEventBridge*)aBridge));
+
+        delete CActiveScheduler::Current();
+        delete trapCleanup;
+        }
+    __UHEAP_MARKEND;
+    return err;
+    }
+    
+// ==============END EVENT THREAD=====================
+
+
+
+NONSHARABLE_CLASS(CAlfAppUi::CAlfAppUiData)
+    : public CBase
+    {
+public:
+    // Environment. Owned.
+    CHuiEnv* iHuiEnv;
+    
+    // Pointer to server. Not owned.
+    CAlfAppServer* iServer;
+    
+    // Shared window-owning control. Owned.
+    CAlfSharedDisplayCoeControl* iSharedWindow;
+    CAlfAppSrvSessionBase* iActiveSession;
+    
+    CAlfSrvResourceManager* iResourceManager;
+    CAlfSrvSettingsHandler* iSettingsHandler;
+
+    ~CAlfAppUiData() // for convenience
+        {
+        if ( iServer )
+            {
+            // Infom texture manager that env is deleted.
+            iServer->TextureManager().HandleEnvToBeDeleted();
+            }
+            
+        delete iSettingsHandler;
+        delete iResourceManager;
+        if (iEventAo)
+            {
+            iEventAo->Cancel();
+            }
+        delete iEventAo; // before session is being terminated       
+        delete iHuiEnv;
+        delete iSharedWindow;
+#ifdef SYMBIAN_BUILD_GCE
+        delete iBridgeObj;
+#endif // #ifdef SYMBIAN_BUILD_GCE
+        }
+    TBool iAllClientsClosed;
+
+    // Boolean flag indicating if non-fading of shared window is enabled or disabled.
+    TBool iSharedWindowNonFading;
+#ifdef SYMBIAN_BUILD_GCE
+    CAlfBridge* iBridgeObj;
+    CAlfStreamerBridge* iBridge;
+#endif // #ifdef SYMBIAN_BUILD_GCE
+    RWindow* iPlainWindow;
+    CHuiDisplay* iMainDisplay;
+    CHuiDisplay* iTVDisplay;
+    CAlfEventBridge* iEventAo;
+    RAlfTfxClient iDsServer;
+    TBool iDsActivated;
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfAppUi::CAlfAppUi()
+    {
+    if (CCoeEnv::Static())    
+        {
+        SetFullScreenApp(EFalse); // to avoid getting queued/suspended in case of S60 system events
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfAppUi::~CAlfAppUi()
+    {
+    delete iData;
+    }
+  
+ 
+// ---------------------------------------------------------------------------
+// Returns HuiEnv.
+// ---------------------------------------------------------------------------
+// 
+CHuiEnv& CAlfAppUi::HuiEnv()
+    {
+    return *iData->iHuiEnv;
+    }
+
+
+void AllocTestCreateHuiEnvL(CHuiEnv** aEnv, TInt aRenderer)
+    {
+    // Create as big bitmap as CHuiTextureManager. This will create
+    // a scanline buffer in the "static" RFbsSession.
+    CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
+    CleanupStack::PushL( bitmap );
+    User::LeaveIfError( bitmap->Create(TSize(4, 4), EColor64K) );
+    
+    TUint allocFail(0);
+    for (TInt err = KErrNoMemory; err != KErrNone; allocFail++)
+        {
+        __UHEAP_SETFAIL(RHeap::EDeterministic, allocFail); 
+        __UHEAP_MARK;
+        TRAP(err, *aEnv = CHuiEnv::NewL((THuiRenderer)aRenderer));
+        if ( (err != KErrNoMemory) && (err != KErrNone) )
+            {
+            //User::Panic(_L("HUIEnv Alloc Test"), err);
+            }
+        if (err == KErrNone)
+            {
+            __UHEAP_RESET;
+            }
+        else
+            {
+            __UHEAP_MARKEND;
+            }    
+        }
+    __UHEAP_SETFAIL(RHeap::ENone, 0);
+    
+    // delete the bitmap
+    CleanupStack::PopAndDestroy( bitmap );
+    }
+  
+// ---------------------------------------------------------------------------
+// Allocates HuiEnv.
+// ---------------------------------------------------------------------------
+//
+void CAlfAppUi::CreateHuiEnvL()
+    {
+    ASSERT(!iData->iHuiEnv); // Cannot create the environment twice.
+
+    THuiRenderer renderer =  iData->iSettingsHandler->Renderer();
+    
+    // Note: CHuiEnv::NewL might change renderer internally
+    
+#ifdef _DEBUG
+    if ( renderer == EHuiRendererBitgdi ) // OPEN GL Would fail because of driver probs
+        {
+// Remove memory failure test because it causes problems with ECOM plugins
+//        AllocTestCreateHuiEnvL(&iData->iHuiEnv, renderer);
+        iData->iHuiEnv = CHuiEnv::NewL( renderer );
+        }
+    else
+        {
+        iData->iHuiEnv = CHuiEnv::NewL( renderer );
+        }
+#else
+    iData->iHuiEnv = CHuiEnv::NewL( renderer );
+#endif
+    iData->iHuiEnv->SetMaxCpuTime( iData->iSettingsHandler->MaxCpuUsage() );
+    } 
+    
+// ---------------------------------------------------------------------------
+// Called when all the clients have exited.
+// ---------------------------------------------------------------------------
+//
+void CAlfAppUi::AllClientsClosed()
+    {
+// In NGA master scene graph role, 
+// we must not close the server even there were no hitchcock app clients present
+#ifndef SYMBIAN_BUILD_GCE
+    iData->iAllClientsClosed = ETrue;
+    CAknEnv::Static()->RunAppShutter();
+#endif // #ifdef SYMBIAN_BUILD_GCE
+    }
+
+// ---------------------------------------------------------------------------
+// From class CAknAppUi.
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfAppUi::ConstructL()
+    {
+    __ALFLOGSTRING( "CAlfAppUi::ConstructL start" )
+    TInt flags = EStandardApp|ENoScreenFurniture|ENonStandardResourceFile|EAknEnableSkin;
+    CCoeEnv* coe = CCoeEnv::Static();
+    iData =  new (ELeave) CAlfAppUiData();
+
+    iData->iSettingsHandler = CAlfSrvSettingsHandler::NewL( *this );
+    CreateHuiEnvL();
+    
+    if (coe)
+        {
+        // initialize app basic services
+        CAknAppUi::BaseConstructL(flags);
+
+        // create direct pointer to server so no need to access coestatics whenever server needed
+        iData->iServer = static_cast<CAlfAppServer*>(static_cast<CEikonEnv*>(coe)->AppServer());
+        }
+    else
+        { 
+        iData->iServer = CAlfAppServer::NewAppServerL();
+        }
+
+    iData->iServer->SetAppUi(this);     
+    
+    RWindowGroup& mainWg = *CHuiStatic::RootWin();
+    // to non-focusing
+    mainWg.EnableReceiptOfFocus(EFalse); 
+    // disable pointer events based autoforwarding
+    mainWg.AutoForeground(EFalse);
+    mainWg.SetOrdinalPosition(-1,ECoeWinPriorityNeverAtFront);
+
+
+    if (!coe) // multiple screen support missing, for main display only atm
+        {
+        TUid appUid = TUid::Uid(KAlfAppServerInterfaceUid3);
+        // complete server construction
+        TName serverName;
+        _LIT(KServerNameFormat, "%08x_%08x_AppServer");
+        serverName.Format( 
+                KServerNameFormat, 
+                appUid, 
+                appUid.iUid );
+        
+        iData->iServer->ConstructL(serverName);
+        
+        // parametrize our window group
+        CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(CHuiStatic::WsSession());
+        wgName->SetHidden(ETrue); // hides us from FSW and protects us from OOM FW etc.
+        wgName->SetSystem(ETrue); // Allow only application with PowerManagement cap to shut us down    
+        wgName->SetCaptionL(_L("ALF"));
+        wgName->SetAppUid(appUid);
+        wgName->SetWindowGroupName(mainWg);
+        CleanupStack::PopAndDestroy();
+        }
+    // misc settings for surroundings     
+    if (coe)
+        { // we ndon't need these in NGA
+        mainWg.EnableFocusChangeEvents();
+        }
+        
+    CHuiStatic::WsSession().ComputeMode(RWsSession::EPriorityControlDisabled);
+
+    RThread thread; 
+#if defined(__EPOC32__)
+    thread.SetProcessPriority(EPriorityForeground);    
+#else
+    thread.SetPriority(EPriorityAbsoluteForegroundNormal);    
+#endif
+
+    // delegates..
+    iData->iResourceManager = CAlfSrvResourceManager::NewL( *iData->iHuiEnv );
+
+    if (coe)
+        {
+        iData->iSharedWindow = new (ELeave) CAlfSharedDisplayCoeControl();
+        iData->iSharedWindow->ConstructL();
+        iData->iSharedWindow->DrawableWindow()->EnableVisibilityChangeEvents();
+        }
+    else
+        { 
+        //mainWg.EnableScreenChangeEvents();
+        
+        CHuiStatic::WsSession().EnableWindowSizeCacheL();
+        iData->iPlainWindow = new (ELeave) RWindow(CHuiStatic::WsSession());
+        iData->iPlainWindow->Construct(*CHuiStatic::RootWin(),0x000FAB10); // FYI: multiple display support neglegted atm
+        iData->iPlainWindow->SetExtentErr(TPoint(0,0),CHuiStatic::ScreenDevice()->SizeInPixels()); // FYI: multiple display support neglegted atm            
+        iData->iPlainWindow->Size(); // to populate size cache
+        iData->iPlainWindow->Activate();
+        iData->iPlainWindow->SetVisible(ETrue);
+        iData->iPlainWindow->SetTransparencyAlphaChannel();
+        iData->iPlainWindow->SetBackgroundColor(~0);          
+        }
+
+#ifdef SYMBIAN_BUILD_GCE    
+
+    iData->iBridgeObj = CAlfBridge::NewL( &iData->iBridge, iData->iHuiEnv );
+	iData->iBridgeObj->iAppUi = this;
+		
+    if( !iData->iPlainWindow)
+        {
+        // Create default CAlfScreen already now to be able to show controlgroups early enough... 
+  	    iData->iBridgeObj->AddNewScreenL(iData->iSharedWindow);
+        }
+    else 
+        {
+  	    iData->iBridgeObj->AddNewScreenFromWindowL(iData->iPlainWindow);
+        iData->iEventAo = new (ELeave) CAlfEventBridge(*this, *iData->iBridgeObj->Display(0));
+        
+        RThread eventThread;
+
+        User::LeaveIfError(eventThread.Create(
+            KAlfEventThreadName,
+            AlfEventThreadStartFunction,
+            16384, // magic
+            0, // uses same heap
+            (TAny*)iData->iEventAo, 
+            EOwnerThread));
+
+        eventThread.Resume();
+        eventThread.Close();
+        }
+
+    AppendDisplayOnSharedWindowL(*(iData->iBridgeObj->Display(0)));
+
+    iData->iBridge = CAlfStreamerBridge::NewL(iData->iBridgeObj);
+    iData->iBridge->iAlfWindowData.iAlfWindowGrpId = mainWg.Identifier();
+    iData->iBridge->iAlfWindowData.iAlfWindowHandle =  iData->iPlainWindow->ClientHandle();
+    iData->iBridge->iAlfWindowData.iScreenNumber = 0; // TBD multiple screen support
+        
+    TThreadId threadId;
+  	CAlfStreamerServer::LaunchServer(threadId, iData->iBridge);
+    
+#endif // #ifdef SYMBIAN_BUILD_GCE    
+    // Inform texture manager that env has been created.
+    iData->iServer->TextureManager().HandleEnvCreateL( *iData->iHuiEnv );
+    
+    // Construct transition effect instance if it does not yet exist
+	iData->iServer->CreateTransitionEffectsL();
+	
+	// Load Tfx server client API plugin, if exists
+	iData->iServer->CreateTfxServerPlugin();
+    
+    __ALFLOGSTRING( "CAlfAppUi::ConstructL end" )
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CAknAppUi.
+// Handles system event.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfAppUi::HandleSystemEventL(const TWsEvent& aEvent)
+    {
+    switch (*(TApaSystemEvent*)(aEvent.EventData()))
+		{
+	case EApaSystemEventBroughtToForeground:
+        { // we need to suppress this event as it causes undesired effects on applications underneath
+        break;
+        }
+    default:
+        CAknAppUi::HandleSystemEventL(aEvent);
+        }
+
+    return;
+    }
+
+void CAlfAppUi::StartPointerEventHandling()
+    {
+    if (iData->iActiveSession)
+        {
+        iData->iActiveSession->StartPointerHandling();
+        }
+    }
+
+void CAlfAppUi::EndPointerEventHandling()
+    {
+    if (iData->iActiveSession)
+        {
+        iData->iActiveSession->FlushPointerHandling();
+        }
+    }
+
+void CAlfAppUi::UpdateActiveSession(CAlfAppSrvSessionBase* aSession)
+    {
+    EndPointerEventHandling();
+    iData->iActiveSession = aSession;
+    
+    iData->iResourceManager->SetActiveSession( iData->iActiveSession );
+
+    if (CCoeEnv::Static())
+        {   
+        if( aSession )
+            {
+            CHuiStatic::RootWin()->EnableGroupListChangeEvents();
+            }
+        else
+            {
+            CHuiStatic::RootWin()->DisableGroupListChangeEvents();
+            }
+        }
+    if(!aSession)
+        {
+        if (iData->iMainDisplay) // TBD: multiple display support once again...
+            {
+            iData->iMainDisplay->SetClearBackgroundL(CHuiDisplay::EClearNone);
+            }
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CAknAppUi.
+// Handles window server event.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination)
+    {
+    TBool handlingPtrEvent(EFalse);
+    
+    if (aEvent.Type() >= EEventPointer && aEvent.Type() <= 	EEventDragDrop )
+        {
+        StartPointerEventHandling();
+        handlingPtrEvent = ETrue; // just to play it safe
+        }
+
+    // A Fix for AlfServer not shutting down on power off (ANIA-7EWFV6)
+    if ( aEvent.Type() == EEventPowerMgmt ) 
+        {
+        TApaSystemEvent systemEvent( *(TApaSystemEvent*)(aEvent.EventData()) );
+        if ( systemEvent == EApaSystemEventShutdown || systemEvent == EApaSystemEventSecureShutdown )
+            {
+            // Don't let this event go further to base class' HandleWsEventL,
+            // since it'll start the appShutter, which will be ignored first,
+            // and when it would be really needed (after AllClientsClosed), it's already destroyed. 
+            return;
+            }
+        }
+    
+    if (!iData->iEventAo) // CCoeEnv exists
+        {
+        CAknAppUi::HandleWsEventL(aEvent, aDestination);
+        if (handlingPtrEvent)
+            {
+            EndPointerEventHandling();
+            }
+        }
+    else
+        {
+        if( aEvent.Type() == EEventScreenDeviceChanged  )
+            {
+            HandleResourceChangeL( KEikDynamicLayoutVariantSwitch );
+            }
+        }
+    
+    switch ( aEvent.Type() )
+        {
+        case EEventFocusGroupChanged:
+        case EEventWindowGroupListChanged:
+            {
+            if( iData->iActiveSession )
+                {                
+                if( iData->iServer->AlfClientHasFocus() )
+                    {
+                     iData->iActiveSession->SetBackgroundMaxFps( EFalse );
+                    }
+                else
+                    {
+                    iData->iActiveSession->SetBackgroundMaxFps( ETrue );
+                    }
+                }
+            break;
+            }
+        case EEventWindowVisibilityChanged:
+            {   
+            iData->iResourceManager->SetServerWindowPartiallyVisible( 
+                    !(aEvent.VisibilityChanged()->iFlags&TWsVisibilityChangedEvent::ENotVisible) );
+            break;
+            }
+        default:
+            break;
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Called when client is about to exit.
+// ---------------------------------------------------------------------------
+//
+void CAlfAppUi::FreeResourcesForClient( TInt aClientId )
+    {
+    if (aClientId == TInt(iData->iActiveSession))
+        {
+        iData->iActiveSession = 0;
+        iData->iResourceManager->SetActiveSession( NULL );
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Returns the shared window-owning control.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CCoeControl* CAlfAppUi::Container()
+    {
+    return iData->iSharedWindow;
+    }
+  
+// ---------------------------------------------------------------------------
+// Adds display into the redraw stack.
+// ---------------------------------------------------------------------------
+//  
+EXPORT_C void CAlfAppUi::AppendDisplayOnSharedWindowL( CHuiDisplay& aDisplay )
+    {
+    if (!iData->iMainDisplay) // TBD: multiple display support once again...
+        {
+        iData->iMainDisplay = &aDisplay;
+        }
+    // with one display, one session (then one who creates the display) 
+    // needs to add the display onto the shared window list.
+    if ( !iData->iSharedWindow || iData->iSharedWindow->iDisplays.Count() > 0 )
+        {
+        return; 
+        }
+    User::LeaveIfError( iData->iSharedWindow->iDisplays.Append( &aDisplay ) );
+    }
+
+// ---------------------------------------------------------------------------
+// Adds TV display into the redraw stack.
+// ---------------------------------------------------------------------------
+//  
+void CAlfAppUi::AppendTvDisplayOnSharedWindowL( CHuiDisplay& aDisplay )
+    {
+    if (!iData->iTVDisplay) // TBD: true multiple display support once again...
+        {
+        iData->iTVDisplay = &aDisplay;
+        }
+
+    if ( !iData->iSharedWindow || iData->iSharedWindow->iDisplays.Count() > 1 )
+        {
+        return; 
+        }
+    
+    User::LeaveIfError( iData->iSharedWindow->iDisplays.Append( &aDisplay ) );
+    }
+
+// ---------------------------------------------------------------------------
+// Removes TV display from the redraw stack.
+// ---------------------------------------------------------------------------
+//  
+void CAlfAppUi::RemoveTvDisplayOnSharedWindow( CHuiDisplay& /*aDisplay*/ )
+    {
+    iData->iTVDisplay = 0;
+
+    if ( !iData->iSharedWindow || iData->iSharedWindow->iDisplays.Count() > 1 )
+        {
+        iData->iSharedWindow->iDisplays.Remove(1); 
+        }        
+    }
+
+
+// ---------------------------------------------------------------------------
+// Finds TV display from the redraw stack.
+// ---------------------------------------------------------------------------
+//  
+CHuiDisplay* CAlfAppUi::FindTvDisplayOnSharedWindow()
+    {
+    return iData->iTVDisplay;
+    }
+
+// ---------------------------------------------------------------------------
+// From class CAknAppUi.
+// This is last entry where we can execute code before coe scheduler started
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfAppUi::FrameworkCallsRendezvous() const
+    {
+    // just basecall for now    
+    return CAknAppUi::FrameworkCallsRendezvous();      
+    }
+
+// ---------------------------------------------------------------------------
+// From class CAknAppUi.
+// Called when system resources have changed.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfAppUi::HandleResourceChangeL( TInt aType )
+    {
+    // A piece of code to resizing the surface on emulator.
+#ifdef ALF_USE_EMULATOR_LAYOUT_SWITCH_BUTTON
+    // Re-create the CWsScreenDevice, as the one cached in the HuiStatic doesn't
+    // seem to notice the layout & orientation changes..
+
+    CWsScreenDevice* screenDevice = CHuiStatic::ScreenDevice(0);
+    screenDevice->SetAppScreenMode(screenDevice->CurrentScreenMode());
+    
+    TPixelsAndRotation rotation;
+    screenDevice->GetDefaultScreenSizeAndRotation(rotation);
+    
+    // Get the sizes and set the new size for the main window
+    TSize size = screenDevice->SizeInPixels();
+    TSize origSize = iData->iHuiEnv->Display(0).Size();
+    
+    // No need to touch if just rotating, so skip the plain orientation change
+    if (origSize != size && rotation.iRotation == CFbsBitGc::EGraphicsOrientationNormal)
+        {
+        TInt err = iData->iPlainWindow->SetSizeErr(size);
+        iData->iPlainWindow->Size(); // To populate size cache.
+        
+        iData->iHuiEnv->Display(0).SetSizeL(size);
+        iData->iHuiEnv->Display(0).SetVisibleArea(TRect(size));
+        }
+#endif
+    
+    if ( aType == KEikDynamicLayoutVariantSwitch || aType == KAknsMessageSkinChange && iData->iHuiEnv)
+        {
+        iData->iHuiEnv->Skin().NotifyDisplaySizeChangedL();
+        }
+        
+    // Send notification events to clients here if needed    
+    if (iData->iServer)
+        {
+        // Only KAknsMessageSkinChange is delivered to clients for now        
+        if (aType == KAknsMessageSkinChange)
+            {
+            // We don't deliver wallpapaper change or morphing change
+            // because textures should not depend on those -> no texture reuploads needed.
+            if (CHuiStatic::SkinInstance())
+                {
+                if (AknsUtils::SkinInstance()->SkinChangeReason() == ENormalSkinChange)
+                    {
+                    iData->iServer->TriggerSystemEvent(KAknsMessageSkinChange);                         
+                    }
+                }
+            }        
+        }       
+        
+    // don't base call
+    }
+
+// ---------------------------------------------------------------------------
+// From class CAknAppUi.
+// Called when a command is received.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfAppUi::HandleCommandL(TInt aCommand)
+    {
+    if (aCommand == EEikCmdExit && iData->iAllClientsClosed)
+        {
+        Exit();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Return settings handler
+// ---------------------------------------------------------------------------
+//
+CAlfSrvSettingsHandler& CAlfAppUi::SettingsHandler()
+    {
+    return *iData->iSettingsHandler;
+    }
+
+// ---------------------------------------------------------------------------
+// Updates non-fading setting to window.
+// ---------------------------------------------------------------------------
+//
+void CAlfAppUi::SetContainerNonFading( TBool aNonFading )
+    {
+    const TBool nonFading = iData->iSharedWindowNonFading;
+    if ( ( nonFading && !aNonFading ) ||
+         ( !nonFading && aNonFading ) )
+        {
+        // Update window server setting.
+        iData->iSharedWindowNonFading = aNonFading;
+        iData->iSharedWindow->DrawableWindow()->SetNonFading( aNonFading );
+        
+        // If non-fading is turned off, update fading to correct value.
+        // It's assumed that alfred applications are not shown in a pop up.
+        // If it were possible, we would need to know if alfred pop up is
+        // topmost.
+        if ( !aNonFading )
+            {
+            iData->iSharedWindow->DrawableWindow()->SetFaded( 
+                IsFaded(),
+                RWindowTreeNode::EFadeIncludeChildren );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Called when setting changes.
+// ---------------------------------------------------------------------------
+//
+void CAlfAppUi::MAlfSrvUintSettingChangedL( TAlfSrvSetting aSetting, TUint aNewValue )
+    {
+    switch( aSetting )
+        {
+        case EAlfSrvSettingDefaultFramerate:
+            // No need to update. Session will fetch the 
+            // updated default frame rate when it receives 
+            // focus for the next time. 
+            break;
+        case EAlfSrvSettingMaxCpuUsage:
+            iData->iHuiEnv->SetMaxCpuTime( aNewValue );
+            break;
+        case EAlfSrvSettingMaxResourceCacheSize:
+            // RnD feature. Cache side will not change in the 
+            // final release.
+            break;
+        case EAlfSrvSettingEffectsComplexityFactor:
+            {
+            // Currently this key has no effect, for future expansion.
+            
+            // check RnD flags update
+            const TUint rndFlags = iData->iSettingsHandler->RndFlags();
+            // check dirty region redrawing
+            for ( TInt d = 0; d < iData->iHuiEnv->DisplayCount() ; d++ )
+                {
+                // check dirty region redrawing
+                iData->iHuiEnv->Display( d ).ShowDirtyRegions( 
+                    rndFlags&EAlfSrvRndFlagDrawDirtyRegions );
+                    
+                //check visual outline drawing    
+                if ( rndFlags&EAlfSrvRndFlagDrawAllVisualOutline )
+                    {
+                    iData->iHuiEnv->Display( d ).SetDrawVisualOutline( CHuiDisplay::EDrawVisualOutlineAllVisuals );
+                    }
+                else if ( rndFlags&EAlfSrvRndFlagDrawSelectedVisualOutline )
+                    {
+                    iData->iHuiEnv->Display( d ).SetDrawVisualOutline( CHuiDisplay::EDrawVisualOutlineSelectedVisuals );
+                    }
+                else
+                    {
+                    iData->iHuiEnv->Display( d ).SetDrawVisualOutline( CHuiDisplay::EDrawVisualOutlineNone );
+                    }
+                }
+
+            // Check for Rnd flags
+            // Currently used to enable/disable texture memory calculation but can be used for any Rnd flag in future
+            iData->iHuiEnv->EnableDebugFlag( rndFlags );
+
+            }
+            break;
+        default:
+            User::Leave( KErrNotSupported );
+            break;
+        }
+    }
+
+
+TTypeUid::Ptr CAlfAppUi::MopSupplyObject(TTypeUid aId)
+    {
+    return CAknAppUi::MopSupplyObject(aId);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CAlfAppUi::FirstAlfControlGroupIndex( TInt aScreenNumber )
+    {
+#ifdef SYMBIAN_BUILD_GCE
+    return iData->iBridgeObj->FirstAlfControlGroupIndex( aScreenNumber );
+#endif // #ifdef SYMBIAN_BUILD_GCE
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CAlfAppUi::LastAlfControlGroupIndex( TInt aScreenNumber )
+    {
+#ifdef SYMBIAN_BUILD_GCE
+    return iData->iBridgeObj->LastAlfControlGroupIndex( aScreenNumber );
+#endif // #ifdef SYMBIAN_BUILD_GCE
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfAppUi::ShowControlGroupL(CHuiRoster& aRoster, CHuiControlGroup& aGroup, TInt aWhere, TInt aScreenNumber )
+    {
+#ifdef SYMBIAN_BUILD_GCE
+    iData->iBridgeObj->ShowControlGroupL(aRoster, aGroup, aWhere, aScreenNumber);    
+    iData->iBridgeObj->HandleVisualVisibility( aScreenNumber );    
+#endif // #ifdef SYMBIAN_BUILD_GCE
+
+    }
+
+// ---------------------------------------------------------------------------
+// PostQTCommandBufferL
+// ---------------------------------------------------------------------------
+//
+void CAlfAppUi::PostQTCommandBufferL( TAlfQtCommandBufferParams aParams )
+    {    
+    if ( iData )
+        {
+        if( iData->iBridgeObj )
+            {
+            iData->iBridgeObj->PostQTCommandBufferL( aParams ); 
+            }
+        } 
+    }
+
+    
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CAlfAppUi::SetClientWindowForDrawingL(TInt aWindowGroupId, TInt aClientWindowHandle, CHuiVisual* aVisual)
+	{
+	iData->iBridgeObj->SetClientWindowForDrawingL(aWindowGroupId, aClientWindowHandle, aVisual);
+	}
+    
+
+void CAlfAppUi::AdjustWindowGroupPositionL(TInt aParentIdentifier, TInt aPosition)
+    {
+    iData->iEventAo->AdjustWindowGroupPositionL(aParentIdentifier, aPosition);
+    }
+
+void CAlfAppUi::SetAlfWindowGroupId(TInt aWgId)
+    {
+    iData->iBridgeObj->SetAlfWindowGroupId(aWgId);
+    }
+    
+
+// ---------------------------------------------------------------------------
+// NotifyLowMemory
+// ---------------------------------------------------------------------------
+//
+void CAlfAppUi::NotifyLowMemory(TInt aAmountOfFreeMemRequested)
+    {
+    if (!iData->iDsActivated)            
+        {
+        if (iData->iDsServer.Open() == KErrNone)
+            {
+            iData->iDsActivated = ETrue;            
+            }
+        }
+    
+    if (iData->iDsActivated )
+        {
+        if (!aAmountOfFreeMemRequested)
+            {
+            iData->iDsServer.SendSynch(KAlfCompositionGoodOnGraphicsMemory, TIpcArgs());
+            }
+        else
+            {          
+            iData->iDsServer.SendSynch(KAlfCompositionLowOnGraphicsMemory, TIpcArgs());
+            }
+        }
+
+/*
+	// Toggle between normal & low memory levels
+    if (!aAmountOfFreeMemRequested)
+        {
+        iData->iBridgeObj->SetMemoryLevel(EHuiMemoryLevelNormal);
+        }
+    else
+        {
+        iData->iBridgeObj->SetMemoryLevel(EHuiMemoryLevelLow);        
+        }
+*/
+
+	// Enable "ultra-low" memory mode
+    if (!aAmountOfFreeMemRequested)
+        {
+        iData->iBridgeObj->SetMemoryLevel(EHuiMemoryLevelNormal);
+        }
+    else
+        {
+        iData->iBridgeObj->SetMemoryLevel(EHuiMemoryLevelLowest);        
+        }
+    }    
+    
+// ---------------------------------------------------------------------------
+// ForceSwRendering
+// ---------------------------------------------------------------------------
+//
+TInt CAlfAppUi::ForceSwRendering( TBool aEnabled )
+    {
+    return iData->iBridgeObj->ForceSwRendering( aEnabled );
+    }
+    
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfbridge.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,5513 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   AppUi class
+*
+*/
+
+
+#include <apgtask.h>
+#include <AknDoc.h>
+#include "alf/alfappui.h"
+#include "alf/alfappserver.h"
+#include <uiacceltk/HuiEnv.h>
+#include <aknenv.h>
+#include <AknsConstants.h>
+#include <s32mem.h>
+#include <uiacceltk/HuiSkin.h>
+#include <uiacceltk/HuiDisplay.h>
+#include <uiacceltk/HuiControl.h>
+#include <uiacceltk/HuiControlGroup.h>
+#include <uiacceltk/HuiEvent.h>
+#include <uiacceltk/HuiDeckLayout.h>
+#include <uiacceltk/HuiImageVisual.h>
+#include <uiacceltk/HuiTransformation.h>
+#include <uiacceltk/HuiBorderBrush.h>
+#include <uiacceltk/HuiUtil.h>
+#include <uiacceltk/HuiTextVisual.h>
+#include <uiacceltk/HuiGradientBrush.h>
+#include <uiacceltk/HuiImageBrush.h>
+#include <uiacceltk/HuiRoster.h>
+
+#ifdef ALF_USE_CANVAS
+#include <uiacceltk/HuiCanvasVisual.h>
+#endif
+
+#include "alflogger.h"
+#include "alf/alfappsrvsessionbase.h"
+#include "alfsrvresourcemanager.h"
+#include "alfsrvsettingshandler.h"
+#include <uiacceltk/HuiTextureManager.h>
+#include "alfsrvtexturemanager.h"
+
+#include "alfstreamerserver.h"
+#include "alfshareddisplaycoecontrol.h"
+#include "alfbridge.h"
+#include "alfstreamerconsts.h"
+#include "alfscreen.h"
+#include <akntranseffect.h>
+
+#include "alfwindowmanager.h"
+#include "alfwindowstructs.h"
+#include <e32property.h>
+#include "HuiFxEffect.h"
+#include <akntransitionutils.h>
+#include <alf/AlfTransEffectPlugin.h>
+#include "alfwindowdata.h"
+#include "huieffectable.h"
+#include <akntranseffect.h>
+#include "HuiRenderPlugin.h"
+#include "huicanvasgc.h"
+#include "huicanvasrenderbuffer.h"
+
+#ifdef HUI_DEBUG_TRACK_DRAWING
+#include <alfcommanddebug.h>
+#endif
+
+#ifdef _ALF_FXLOGGING
+#include <alfcommanddebug.h>
+#endif
+
+#ifdef SYMBIAN_BUILD_GCE
+#include <bautils.h>
+#endif
+
+const TInt KVisualTransformationStepRotate    = 0;
+
+const TReal32 KAlfVisualDefaultOpacity = 1.0f;
+//const TReal32 KAlfVisualDefaultOpacity = 0.5f;
+
+_LIT8(KAlfWindowGroupContainerControlTag, "WGROUP");
+const TInt KAlfNumberOfFixedControlGroups = 2;
+
+// This debug option prints window group order with __ALFLOGSTRING
+//#define ALF_DEBUG_PRINT_WINDOWGROUP_ORDER
+
+// This debug option shows window groups in a grid
+//#define ALF_DEBUG_VISUALIZE_WINDOWGROUP_ORDER
+
+
+const TInt KFadeAction = 6000;
+
+const TInt KRosterFreezeEndTimeoutInMs = 400;
+
+// Timer to send finish full screen effect
+// ---------------------------------------------------------
+// CAlfFinishTimer
+// ---------------------------------------------------------
+//
+NONSHARABLE_CLASS( CAlfRosterFreezeEndTimer ):public CTimer
+    {
+    public:  // Constructors and destructor
+        static CAlfRosterFreezeEndTimer* NewL( CAlfBridge& aBridge );
+        virtual ~CAlfRosterFreezeEndTimer();
+
+    public: // New functions
+        void Start( TTimeIntervalMicroSeconds32 aPeriod );
+        
+    protected:  // Functions from base classes
+        void DoCancel();
+
+    private:
+        CAlfRosterFreezeEndTimer( CAlfBridge& aBridge );
+        void ConstructL();
+        void RunL();
+      
+    private:    // Data
+        CAlfBridge& iBridge;
+                
+    };
+
+
+// ---------------------------------------------------------
+// CAlfRosterFreezeEndTimer
+// ---------------------------------------------------------
+//
+CAlfRosterFreezeEndTimer::CAlfRosterFreezeEndTimer( CAlfBridge& aBridge )
+    :CTimer ( EPriorityStandard ),
+    iBridge( aBridge )
+    {   
+    }
+
+void CAlfRosterFreezeEndTimer::ConstructL()
+    {
+    CTimer::ConstructL();
+    CActiveScheduler::Add( this );
+    }
+
+CAlfRosterFreezeEndTimer* CAlfRosterFreezeEndTimer::NewL( CAlfBridge& aBridge )
+    {
+    CAlfRosterFreezeEndTimer* self = new ( ELeave ) CAlfRosterFreezeEndTimer( aBridge );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CAlfRosterFreezeEndTimer::~CAlfRosterFreezeEndTimer()
+    {
+    Cancel();        
+    }
+
+void CAlfRosterFreezeEndTimer::Start( TTimeIntervalMicroSeconds32 aPeriod )
+    {
+    if (!IsActive())
+        {
+        After( aPeriod );
+        }
+    }
+
+void CAlfRosterFreezeEndTimer::RunL()
+    {
+    iBridge.iHuiEnv->Display(0).SetDirty();
+    TRAP_IGNORE(iBridge.iHuiEnv->Display(0).Roster().FreezeVisibleContentL(EFalse));
+    iBridge.SetVisualTreeVisibilityChanged(ETrue);    
+    }
+
+void CAlfRosterFreezeEndTimer::DoCancel()
+    {
+    CTimer::DoCancel();
+    }
+
+// ---------------------------------------------------------
+// CAlfLayoutSwitchEffectcoordinator
+// ---------------------------------------------------------
+//
+NONSHARABLE_CLASS( CAlfLayoutSwitchEffectCoordinator ) : public CBase, public MAlfGfxEffectObserver
+    {
+    public:  // Constructors and destructor
+        CAlfLayoutSwitchEffectCoordinator( CAlfBridge& aBridge );
+        virtual ~CAlfLayoutSwitchEffectCoordinator();
+    
+    public: // MAlfGfxEffectObserver           
+        void AlfGfxEffectEndCallBack( TInt aHandle );
+    
+    public:
+        void BeginLayoutSwitch();
+        void Cancel();
+        
+    private:
+        AknTransEffect::TContext NextLayoutSwitchContext();
+        void SetLayoutSwitchEffect(AknTransEffect::TContext aContext);
+        TBool LayoutSwitchEffectsExist();
+        
+    private: // Data
+        
+        CAlfBridge& iBridge;
+        AknTransEffect::TContext iLayoutSwitchEffectContext;
+        TThreadPriority iOriginalPriority;
+        CAlfRosterFreezeEndTimer* iRosterFreezeEndTimer;
+    };
+
+CAlfLayoutSwitchEffectCoordinator::CAlfLayoutSwitchEffectCoordinator( CAlfBridge& aBridge ) :
+    iBridge( aBridge ),
+    iLayoutSwitchEffectContext(AknTransEffect::ENone)    
+    {
+    RThread me = RThread();
+    iOriginalPriority = me.Priority();    
+    me.Close();
+    }
+
+CAlfLayoutSwitchEffectCoordinator::~CAlfLayoutSwitchEffectCoordinator()
+    {   
+    }
+
+// ---------------------------------------------------------
+// CAlfLayoutSwitchEffectCoordinator::AlfGfxEffectEndCallBack
+//
+// This method is callback which gets called when layout 
+// switch effect has ended.
+// ---------------------------------------------------------
+//
+void CAlfLayoutSwitchEffectCoordinator::AlfGfxEffectEndCallBack( TInt aHandle )
+    {
+    //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::AlfGfxEffectEndCallBack"));
+    if (iLayoutSwitchEffectContext == aHandle)
+        {
+        AknTransEffect::TContext nextContext = NextLayoutSwitchContext();
+
+        // Unfreeze visible content. This reveals real roster content (in new orientation).
+        if (nextContext == AknTransEffect::ELayoutSwitchExit)
+            {
+            #ifdef HUI_DEBUG_TRACK_DRAWING
+            RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::AlfGfxEffectEndCallBack unfreezing roster content"));
+            #endif
+            iBridge.iHuiEnv->Display(0).SetDirty();
+            TRAP_IGNORE(iBridge.iHuiEnv->Display(0).Roster().FreezeVisibleContentL(EFalse));
+            iBridge.SetVisualTreeVisibilityChanged(ETrue);
+            }
+        
+        // Set next effect
+        SetLayoutSwitchEffect(nextContext);
+        
+        if (nextContext == AknTransEffect::ENone)
+            {
+            // Restore normal priority
+            RThread me = RThread();
+            me.SetPriority(iOriginalPriority);    
+            me.Close();
+
+            // Just in case refresh everything
+            iBridge.iHuiEnv->Display(0).SetDirty();
+            }        
+        }
+    else
+        {
+        //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::AlfGfxEffectEndCallBack - got different handle (normal, dont worry...) - %i"), aHandle);        
+        }
+    }
+
+// ---------------------------------------------------------
+// CAlfLayoutSwitchEffectCoordinator::Cancel
+// ---------------------------------------------------------
+//
+void CAlfLayoutSwitchEffectCoordinator::Cancel()
+    {
+    // Disable effect
+    SetLayoutSwitchEffect( AknTransEffect::ENone );
+
+    // Unfreeze visible content
+    if ( iRosterFreezeEndTimer )
+        {
+		iRosterFreezeEndTimer->Cancel();
+    	}
+
+    iBridge.iHuiEnv->Display(0).SetDirty();
+    TRAP_IGNORE(iBridge.iHuiEnv->Display(0).Roster().FreezeVisibleContentL(EFalse));
+    iBridge.SetVisualTreeVisibilityChanged(ETrue);
+    
+    // Restore normal priority
+    RThread me = RThread();
+    me.SetPriority(iOriginalPriority);    
+    me.Close();
+	}
+
+// ---------------------------------------------------------
+// CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch
+//
+// This method starts the layout switch effect procedure.
+// ---------------------------------------------------------
+//
+void CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch()
+    {
+    // Hm. what to do if earlier is already in progress ?
+    //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch"));
+    if ( iBridge.iHuiEnv->MemoryLevel() <= EHuiMemoryLevelLowest )
+        {
+        // No effects in low memory mode
+        return;
+        }
+    
+    if (!iLayoutSwitchEffectContext)
+        {
+        TBool tfxOn = CAknTransitionUtils::TransitionsEnabled(AknTransEffect::ELayoutswitchTransitionsOff );
+        TBool tfxExists = LayoutSwitchEffectsExist();
+        if (tfxOn && tfxExists)
+            {
+            // Boost priority so that we are able to draw more frames for the effect
+            RThread me = RThread();
+            me.SetPriority(EPriorityAbsoluteHigh);    
+            me.Close();
+            
+            // Freeze visual content
+            //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch freezing roster content"));
+            iBridge.iHuiEnv->Display(0).SetDirty();
+            TRAP_IGNORE(iBridge.iHuiEnv->Display(0).Roster().FreezeVisibleContentL(ETrue));
+            
+            // Remove all other effects
+            iBridge.HandleGfxStopEvent( EFalse );
+            iBridge.RemoveAllTemporaryPresenterVisuals();
+            
+            // Set first layout switch effect 
+            SetLayoutSwitchEffect(AknTransEffect::ELayoutSwitchStart);
+            }
+        else
+            {
+            if (!iRosterFreezeEndTimer)
+                {
+                TRAP_IGNORE(iRosterFreezeEndTimer = CAlfRosterFreezeEndTimer::NewL(iBridge));
+                }
+            
+            if (iRosterFreezeEndTimer)
+                {
+                iBridge.iHuiEnv->Display(0).SetDirty();
+                TRAP_IGNORE(iBridge.iHuiEnv->Display(0).Roster().FreezeVisibleContentL(ETrue));
+                
+                // Remove all other effects
+                iBridge.HandleGfxStopEvent( EFalse );
+                iBridge.RemoveAllTemporaryPresenterVisuals();
+
+                // Set remove freeze timer
+                iRosterFreezeEndTimer->Start(KRosterFreezeEndTimeoutInMs*1000); 
+                }            
+            //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch - tfx are set OFF -> I am not starting effect."));                        
+            }
+        }
+    else
+        {
+        //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::BeginLayoutSwitch - old effect exists - %i"), iLayoutSwitchEffectContext);
+        }
+    }
+
+// ---------------------------------------------------------
+// CAlfLayoutSwitchEffectCoordinator::NextLayoutSwitchContext
+//
+// This method automatically selects the next context in the 
+// layout switch procedure.
+//
+// Contextes change in the following order during layout switch:
+//
+// 1. AknTransEffect::ENone
+// 2. AknTransEffect::ELayoutSwitchStart
+// 3. AknTransEffect::ELayoutSwitchExit
+// 4. AknTransEffect::ENone
+//
+// After new context is selected, appropriate effect is set 
+// (and/or removed) from the roster.
+//
+// ---------------------------------------------------------
+//
+AknTransEffect::TContext CAlfLayoutSwitchEffectCoordinator::NextLayoutSwitchContext()
+    {
+    // Resolve next context based on current context
+    AknTransEffect::TContext newContext = AknTransEffect::ENone;    
+    switch (iLayoutSwitchEffectContext)
+        {
+        case AknTransEffect::ENone:
+            {
+            newContext = AknTransEffect::ELayoutSwitchStart;            
+            break;
+            }
+        case AknTransEffect::ELayoutSwitchStart:
+            {
+            newContext = AknTransEffect::ELayoutSwitchExit;                    
+            break;
+            }
+        case AknTransEffect::ELayoutSwitchExit: // fallthrough
+        default:
+            {
+            newContext = AknTransEffect::ENone;            
+            break;
+            }              
+        }
+
+    //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::NextLayoutSwitchEffectL old ctx = %i, new ctx = %i"), iLayoutSwitchEffectContext, newContext);
+    return newContext;
+    }
+
+// ---------------------------------------------------------
+// CAlfLayoutSwitchEffectCoordinator::SetLayoutSwitchEffectL
+//
+// This method sets correct effect based on the given 
+// layout switch context.
+//
+// ---------------------------------------------------------
+//
+void CAlfLayoutSwitchEffectCoordinator::SetLayoutSwitchEffect(AknTransEffect::TContext aContext)
+    {
+    MHuiEffectable* effectable = iBridge.iHuiEnv->Display(0).Roster().Effectable();
+    CHuiFxEffect* effect = NULL;
+    CHuiFxEngine* engine = iBridge.iHuiEnv->EffectsEngine();
+    
+    if (!effectable || !engine)
+        {
+        return;
+        }    
+            
+    // Update current context
+    iLayoutSwitchEffectContext = aContext;           
+    
+    if (aContext == AknTransEffect::ENone)
+        {
+        // Just remove effect
+        //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::NextLayoutSwitchEffectL - removing effect"));
+        effectable->EffectSetEffect(NULL); // This calls AlfGfxEffectEndCallBack         
+        }
+    else
+        {    
+        // Load correct effect
+        for ( TInt i = 0; i<iBridge.iAlfRegisteredEffects.Count(); i++ )
+            {             
+            if ( iBridge.iAlfRegisteredEffects[i].iAction == aContext)
+                {
+                //RDebug::Print(_L("CAlfLayoutSwitchEffectCoordinator::SetLayoutSwitchEffectL - loading effect"));
+                TRAP_IGNORE(engine->LoadEffectL(*iBridge.iAlfRegisteredEffects[i].iEffectFile, effect, effectable, NULL, this, iLayoutSwitchEffectContext, 0 ) );                    
+                break;
+                }
+            }
+        }    
+    }
+
+TBool CAlfLayoutSwitchEffectCoordinator::LayoutSwitchEffectsExist()
+    {
+    TBool appearExists = EFalse;
+    TBool disAppearExists = EFalse;
+    
+    for ( TInt i = 0; i<iBridge.iAlfRegisteredEffects.Count(); i++ )
+        {             
+        if ( iBridge.iAlfRegisteredEffects[i].iAction == AknTransEffect::ELayoutSwitchStart)
+            {
+            disAppearExists = ETrue;
+            break;
+            }
+        else if ( iBridge.iAlfRegisteredEffects[i].iAction == AknTransEffect::ELayoutSwitchExit)
+            {
+            appearExists = ETrue;
+            break;
+            }
+        }
+    
+    return (appearExists || disAppearExists);    
+    }
+
+// Timer to send finish full screen effect
+// ---------------------------------------------------------
+// CAlfFinishTimer
+// ---------------------------------------------------------
+//
+NONSHARABLE_CLASS( CAlfEffectEndTimer ):public CTimer
+    {
+    public:  // Constructors and destructor
+        static CAlfEffectEndTimer* NewL( CAlfBridge& aBridge );
+        virtual ~CAlfEffectEndTimer();
+
+    public: // New functions
+        void Start( TTimeIntervalMicroSeconds32 aPeriod, TInt aHandle );
+        
+    protected:  // Functions from base classes
+        void DoCancel();
+
+    private:
+        CAlfEffectEndTimer( CAlfBridge& aBridge );
+        void ConstructL();
+        void RunL();
+      
+    private:    // Data
+        CAlfBridge& iBridge;
+        TInt iHandle;
+                
+    };
+
+
+// ---------------------------------------------------------
+// CAlfFinishTimer
+// ---------------------------------------------------------
+//
+CAlfEffectEndTimer::CAlfEffectEndTimer( CAlfBridge& aBridge )
+    :CTimer(EPriorityHigh), 
+	iBridge(aBridge)
+    {   
+    }
+
+void CAlfEffectEndTimer::ConstructL()
+    {
+    CTimer::ConstructL();
+    CActiveScheduler::Add( this );
+    }
+
+CAlfEffectEndTimer* CAlfEffectEndTimer::NewL( CAlfBridge& aBridge )
+    {
+    CAlfEffectEndTimer* self = new ( ELeave ) CAlfEffectEndTimer( aBridge );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CAlfEffectEndTimer::~CAlfEffectEndTimer()
+    {
+    Cancel();        
+    }
+
+void CAlfEffectEndTimer::Start( TTimeIntervalMicroSeconds32 aPeriod, TInt aHandle )
+    {
+    iHandle = aHandle;
+    After( aPeriod );
+    }
+
+void CAlfEffectEndTimer::RunL()
+    {
+    //
+    // timer completes and control is returned to caller
+    //
+    iBridge.TransitionFinishedHandlerL( iHandle );
+    // We don't become active unless we are explicitly restarted
+    }
+
+void CAlfEffectEndTimer::DoCancel()
+    {
+    CTimer::DoCancel();
+    }
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+CAlfBridge* CAlfBridge::NewL( CAlfStreamerBridge** aHost, CHuiEnv* aEnv )
+    {
+    CAlfBridge* self = new (ELeave) CAlfBridge( aHost );
+    CleanupStack::PushL( self );
+    self->ConstructL( aEnv );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::ProvideBitmapL(TInt /*aId*/, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap)
+    {
+    aBitmap = iHack;
+    aMaskBitmap = iDummyMask;
+    };
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+CAlfBridge::CAlfBridge(CAlfStreamerBridge** aHost)
+    : iHost(aHost), iCurrentMemoryLevel(EHuiMemoryLevelNormal)
+	{
+	}
+    
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+CAlfBridge::~CAlfBridge()
+	{
+	delete iFadeEffectFile;
+	iWindowHashArray.Close();
+	for( TInt i = 0; i< iAlfRegisteredEffects.Count(); i++ )
+	    {
+	    delete iAlfRegisteredEffects[i].iEffectFile;
+	    }
+	iAlfRegisteredEffects.Close();
+    iFinishedEffects.Close();
+    delete iEffectEndTimer;
+    iDeadControlGroups.Close();
+    iEffectWindowGroups.Close();
+    delete iFullScreenEffectData;
+
+    if (iActivated)
+        {
+        iBridgerClient.Close();        
+        }
+
+#ifdef HUI_DEBUG_TRACK_DRAWING
+    delete iCommandDebug;
+#endif
+    delete iCursorTimer;
+    delete iLayoutSwitchEffectCoordinator;
+	}
+    
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::ConstructL(CHuiEnv* aEnv)
+    {
+    iHuiEnv = aEnv;
+
+#ifdef SYMBIAN_BUILD_GCE
+    iPrintFPS = EFalse;
+#ifndef __WINSCW__
+    _LIT(KRDSupport, "c:\\resource\\errrd" );
+    RFs& fs = CHuiStatic::FsSession();
+    if (fs.Handle() && BaflUtils::FileExists( fs, KRDSupport ))
+        {
+        iPrintFPS = ETrue;
+        }
+#endif
+#endif //SYMBIAN_BUILD_GCE
+    // create the key for indication transition ends
+    // No access restrictions for starters
+    TInt err = RProperty::Define( KPSAlfDomain, KAlfTransitionStatus,
+        RProperty::EInt );
+    if (!err)
+        {
+        // Initialize to no transition    
+        RProperty::Set( KPSAlfDomain, KAlfTransitionStatus, 0 );
+        }
+
+    iEffectEndTimer = CAlfEffectEndTimer::NewL( *this );
+    iWindowHashArray.ReserveL( 500 );
+    iAlfRegisteredEffects.ReserveL(10);
+    
+#ifdef HUI_DEBUG_TRACK_DRAWING
+    iCommandDebug = CAlfCommandDebug::NewL();
+#endif
+    
+    iLayoutSwitchEffectCoordinator = new (ELeave) CAlfLayoutSwitchEffectCoordinator(*this);
+    iAlfSecureId = RThread().SecureId();
+    RegisterFadeEffectL();
+    }
+
+// ---------------------------------------------------------------------------
+//  RegisterFadeEffectL
+//
+//  Note, If theme DOES NOT register its own fade effect, another hardcoded fade 
+//  effect will be used instead. For example, if theme effects are turned off, 
+//  a fade that does not belong to the theme may be in use.
+// ---------------------------------------------------------------------------
+void CAlfBridge::RegisterFadeEffectL()
+    {
+    // TODO: RND, REMOVE MMC DRIVE-F, WHEN NOT REQUIRED FOR TESTING
+    _LIT(KDrivePrefence,"FZC"); 
+    // Force register fade effect. Try first MMC, then ROM.
+    CHuiFxEngine* engine = iHuiEnv->EffectsEngine();
+    RFs& fs = CHuiStatic::FsSession();
+    if (fs.Handle() && engine)
+        {
+        _LIT(KFadeEffectPath, ":\\resource\\effects\\fade_effect.fxml");
+        TBufC<4> drives(KDrivePrefence);
+        HBufC* effectFullName = HBufC::NewLC(KFadeEffectPath().Length() + 1);
+        
+        for(TInt i=0; i< drives.Length(); i++)
+            {
+            effectFullName->Des().Copy(drives.Mid(i,1));
+            effectFullName->Des().Append(KFadeEffectPath);
+    
+            if (BaflUtils::FileExists( fs, *effectFullName ))
+                {
+                DoRegisterEffectL(*effectFullName, KFadeAction);
+                break;
+                }
+            }
+        CleanupStack::PopAndDestroy(effectFullName);
+        DoSetCachedFadeEffectL();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// DoSetCachedFadeEffectL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::DoSetCachedFadeEffectL()
+    {
+    for (TInt i = 0; i < iAlfRegisteredEffects.Count(); i++)
+        {
+        //KFadeAction = 6000, indicating the action corroposnds to fading
+        if (iAlfRegisteredEffects[i].iAction == KFadeAction)
+            {
+            delete iFadeEffectFile;
+            iFadeEffectFile = NULL;
+            iFadeEffectFile = iAlfRegisteredEffects[i].iEffectFile->AllocL();
+            __ALFLOGSTRING1( ">> Setting fade effect file  %S", iFadeEffectFile );
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// AddNewScreenL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::AddNewScreenL(CAlfSharedDisplayCoeControl* aSharedCoeControl)
+    {
+    TInt screenNumber = iAlfScreens.Count(); // \todo this might not be the same as real WServ screen number
+    
+    // We do not yet support drawing winGC draw commands to other than primary screen.
+    // As fully functional and tested implementation is not there, better to panic here.
+    if (screenNumber!=0)
+        {
+        __ALFLOGSTRING("CAlfBridge::AddNewScreenL. Fatal error! Only screen 0 is supported in Alf server!");
+        User::Invariant();
+        }
+         
+    CAlfScreen* screen = new(ELeave) CAlfScreen(); 
+    CleanupStack::PushL(screen);
+    screen->ConstructL(screenNumber, *this, *iHuiEnv, aSharedCoeControl);
+    iAlfScreens.AppendL( screen );
+    CleanupStack::Pop(screen);
+
+	ShowControlGroupL(screen->iDisplay->Roster(), *(screen->iFloatingSpriteControlGroup), KHuiRosterShowAtTop, screenNumber); 
+	ShowControlGroupL(screen->iDisplay->Roster(), *(screen->iFullscreenEffectControlGroup), KHuiRosterShowAtTop, screenNumber); 
+    
+	
+	screen->iFloatingSpriteControlGroup->SetAcceptInput(EFalse);
+	screen->iFullscreenEffectControlGroup->SetAcceptInput(EFalse);
+    }
+
+//------------------------------------------------------------------------------
+// Dumdidumdidum..
+//------------------------------------------------------------------------------
+void CAlfBridge::AddNewScreenFromWindowL(RWindow* aWindow)
+    {
+    TInt screenNumber = iAlfScreens.Count(); // \todo this might not be the same as real WServ screen number
+         
+    CAlfScreen* screen = new(ELeave) CAlfScreen(); 
+    CleanupStack::PushL(screen);
+    screen->ConstructL(screenNumber, *this, *iHuiEnv, aWindow);
+    iAlfScreens.AppendL( screen );
+    CleanupStack::Pop(screen);
+
+	ShowControlGroupL(screen->iDisplay->Roster(), *(screen->iFloatingSpriteControlGroup), KHuiRosterShowAtTop, screenNumber); 
+	ShowControlGroupL(screen->iDisplay->Roster(), *(screen->iFullscreenEffectControlGroup), KHuiRosterShowAtTop, screenNumber); 
+    
+    screen->iFloatingSpriteControlGroup->SetAcceptInput(EFalse);
+    screen->iFullscreenEffectControlGroup->SetAcceptInput(EFalse);
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// AddVisual
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::AddVisual( 
+        TInt aWindowNodeId, 
+        TInt aClientSideId, 
+        TInt aClientSideGroupId,
+        CHuiCanvasVisual* aVisual )
+    {
+    __ALFFXLOGSTRING1("CAlfBridge::AddVisual 0x%x", aWindowNodeId);
+    THashVisualStruct visualStruct( aVisual, aClientSideId, aClientSideGroupId);
+    iWindowHashArray.Insert( aWindowNodeId, visualStruct );
+    iPreviouslySearchedVisualId = aWindowNodeId;
+    iPreviouslySearchedVisual = aVisual;
+    }
+
+// ---------------------------------------------------------------------------
+// RemoveVisual
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::RemoveVisual( TInt aWindowNodeId )
+    {
+    __ALFFXLOGSTRING1("CAlfBridge::RemoveVisual 0x%x", aWindowNodeId);
+    iWindowHashArray.Remove( aWindowNodeId );
+    iPreviouslySearchedVisualId = 0;
+    }
+    
+// ---------------------------------------------------------------------------
+// FindVisual
+// ---------------------------------------------------------------------------
+// 
+CHuiCanvasVisual* CAlfBridge::FindVisual(TInt aWindowNodeId )
+    {
+    if ( iPreviouslySearchedVisualId == aWindowNodeId )
+        {
+        return iPreviouslySearchedVisual;
+        }
+    
+    THashVisualStruct* visualStruct = iWindowHashArray.Find( aWindowNodeId );
+    if ( visualStruct )
+        {
+        iPreviouslySearchedVisualId = aWindowNodeId;
+        iPreviouslySearchedVisual = visualStruct->iVisual;
+        return iPreviouslySearchedVisual; 
+        }
+    __ALFFXLOGSTRING1("CAlfBridge::FindVisual - Visual 0x%x not found", aWindowNodeId);
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// FindVisualByClientSideId
+// ---------------------------------------------------------------------------
+// 
+CHuiCanvasVisual* CAlfBridge::FindVisualByClientSideIds(
+    TUint32 aClientSideId, 
+	TUint32 aClientSideGroupId )
+    {
+    THashMapIter<TUint32, THashVisualStruct> iter(iWindowHashArray);
+    THashVisualStruct const * node = 0;
+    do
+        {
+        node = iter.NextValue();
+        if (node 
+                && (*node).iClientSideId==aClientSideId
+                && (*node).iClientSideGroupId==aClientSideGroupId )
+            {
+            return (*node).iVisual;
+            }
+        }
+    while(node);
+	return NULL;
+    }
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+CHuiControlGroup* CAlfBridge::FindControlGroup(TInt aWindowGroupNodeId, TInt aScreenNumber )
+    {
+    for (TInt i=0; i<iAlfScreens[aScreenNumber]->iControlGroups.Count();i++)
+        {
+        if (iAlfScreens[aScreenNumber]->iControlGroups[i].iWindowGroupNodeId == aWindowGroupNodeId)
+            {
+            return iAlfScreens[aScreenNumber]->iControlGroups[i].iControlGroup;
+            }
+        }        
+    return NULL;       
+    }
+
+// ---------------------------------------------------------------------------
+// FindClientWindowGroupId
+// ---------------------------------------------------------------------------
+//
+TInt CAlfBridge::FindClientWindowGroupId( TInt aScreenNumber, CHuiControlGroup& aControlGroup  )
+    {
+    for (TInt i=0; i<iAlfScreens[aScreenNumber]->iControlGroups.Count();i++)
+        {
+        if( iAlfScreens[aScreenNumber]->iControlGroups[i].iControlGroup == &aControlGroup )
+            {
+            return iAlfScreens[aScreenNumber]->iControlGroups[i].iClientWindowGroupId;
+            }
+        }
+    return KErrNotFound;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CHuiControlGroup* CAlfBridge::FindControlGroupByWindowGroupId( TInt aWindowGroupId, TInt& aScreenNumber, TAlfControlGroupEntry** aAlfGroup )
+    {
+    TInt firstWin = aScreenNumber;
+    TInt lastWin = aScreenNumber;
+    if ( aScreenNumber == KErrNotFound )
+        {
+        firstWin = 0;
+        lastWin = iAlfScreens.Count()-1;
+        }
+    
+    for ( TInt j = firstWin; j <= lastWin; j++ )
+        {
+        for ( TInt i = 0; i < iAlfScreens[j]->iControlGroups.Count(); i++ )
+            {
+            if ( iAlfScreens[j]->iControlGroups[i].iClientWindowGroupId == aWindowGroupId )
+                {
+                aScreenNumber = j;
+                if ( aAlfGroup != NULL )
+                    {
+                    *aAlfGroup = &iAlfScreens[j]->iControlGroups[i];
+                    }
+                return iAlfScreens[j]->iControlGroups[i].iControlGroup;
+                }
+            }        
+        }
+    return NULL;       
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CHuiControlGroup* CAlfBridge::FindControlGroupByAppId( TInt aAppId )
+    {
+    for ( TInt i = 0; i < iAlfScreens[0]->iControlGroups.Count(); i++ )
+        {
+        if ( iAlfScreens[0]->iControlGroups[i].iSecureId == aAppId )
+            {
+            return iAlfScreens[0]->iControlGroups[i].iControlGroup;
+            }
+        }        
+    return NULL;       
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+
+void CAlfBridge::ListFamilyTreeL( RPointerArray<CHuiLayout>& aArray, const CHuiLayout* aLayout )
+    {
+    if (aLayout->Count())
+        {
+        aArray.Append(aLayout);
+        
+        for(TInt i = 0; i< aLayout->Count(); i++)
+            {
+            ListFamilyTreeL(aArray, (CHuiLayout*)&aLayout->Visual(i));
+            }
+        }
+    else
+        {
+        aArray.Append(aLayout);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::DeleteControlGroupL(TInt aWindowGroupNodeId, TInt aScreenNumber )
+    {
+    for (TInt i=0; i<iAlfScreens[aScreenNumber]->iControlGroups.Count();i++)
+        {
+        if (iAlfScreens[aScreenNumber]->iControlGroups[i].iWindowGroupNodeId == aWindowGroupNodeId)
+            {
+            if (iAlfScreens[aScreenNumber]->iDisplay)
+                {
+                CHuiControl& control = iAlfScreens[aScreenNumber]->iControlGroups[i].iControlGroup->Control(0);
+                CHuiLayout* layout = (CHuiLayout*)&control.Visual(0);
+                // wserv has notifed that this control group and its layout should be destroyed. However, we might be
+                // have effect on the layout itself or layout is being drawn as external content. This indicates that
+                // we should not delete the control group at this point, but add it to iDeadControlGroup list, which 
+                // is cleared when effect has finished.
+                RPointerArray<CHuiLayout> familyTree;
+                ListFamilyTreeL(familyTree, layout); // recursively dig the family tree
+                
+                if (HasActiveEffect(layout))
+                    {
+                    __ALFFXLOGSTRING1("Layout 0x%x has external content", layout);
+                    // EHuiVisualFlagShouldDestroy destroy flag should have come for the windows in this layout already
+                    layout->SetFlags(EHuiVisualFlagShouldDestroy);
+                    // move this layout to effect control group, where it can still be shown. this control group may be deleted.
+                    CHuiControl& control = iAlfScreens[aScreenNumber]->iControlGroups[i].iControlGroup->Control(0);
+                    CHuiLayout* layout = (CHuiLayout*)&control.Visual(0);
+                    
+                    for(TInt familyIndex = 0; familyIndex < familyTree.Count();familyIndex++)
+                        {
+                        control.Remove(familyTree[familyIndex]); // remove ownership from original group
+                        }
+                        
+                    control.Remove(layout); // remove ownership from original group
+                    // move visuals to safe place. the original group must be destroyed.
+                    __ALFFXLOGSTRING1("MOVING 0x%x to effect group", layout);
+                    CHuiControl& effectControlGroup = iAlfScreens[0]->iFullscreenEffectControlGroup->Control(0);
+                    CHuiLayout* effectControlGroupLayout = (CHuiLayout*) &effectControlGroup.Visual(0);
+                    // Transfers ownership of visuals. 
+                    effectControlGroup.AppendL(layout, effectControlGroupLayout); // this will remove it from the previous layout
+                    layout->SetOwner(effectControlGroup);
+                    
+                    for(TInt familyIndex = 0; familyIndex < familyTree.Count();familyIndex++)
+                        {
+                        familyTree[familyIndex]->SetOwner(effectControlGroup);
+                        }
+                    }
+                else
+                    {
+                    // check once more, that the windows in this group are not having effects. 
+                    // the layout is not have effect, but some child window might.
+                    // in this case, the child window effects WILL BE REMOVED.
+                     for(TInt familyIndex = 0; familyIndex < familyTree.Count();familyIndex++)
+                         {
+                         RemoveTemporaryPresenterVisual(familyTree[familyIndex]);
+                         }
+                    }
+                familyTree.Close();
+                iAlfScreens[aScreenNumber]->iDisplay->Roster().Hide(*iAlfScreens[aScreenNumber]->iControlGroups[i].iControlGroup);
+                __ALFFXLOGSTRING("CAlfBridge::DeleteControlGroupL - Deleting group");
+                iAlfScreens[aScreenNumber]->iControlGroups.Remove(i);
+                iHuiEnv->DeleteControlGroup(aWindowGroupNodeId);
+                __ALFFXLOGSTRING("CAlfBridge::DeleteControlGroupL - Deleting group done");
+                }
+            break;
+            }
+        }        
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+CHuiControlGroup& CAlfBridge::CreateControlGroupL(
+            TInt aWindowGroupNodeId, 
+            TInt aClientWindowGroupId,
+            TInt aSecureId,
+            TInt aScreenNumber )
+    {
+    CHuiControlGroup* group = FindControlGroup(aWindowGroupNodeId,aScreenNumber);
+    if (!group)
+        {
+        group = &iHuiEnv->NewControlGroupL(aWindowGroupNodeId); 
+        CleanupStack::PushL(group);
+        CHuiControl*  cntrl = new (ELeave) CHuiControl(*iHuiEnv);
+        CleanupStack::PushL(cntrl);
+        CHuiLayout* layout = NULL;
+        
+        cntrl->ConstructL();
+        group->AppendL(cntrl);
+        CleanupStack::Pop(cntrl);
+        cntrl->SetRole(EAlfWindowGroupContainer);
+
+        layout = CHuiCanvasVisual::AddNewL(*cntrl);
+        layout->SetTagL(KAlfWindowGroupContainerControlTag);
+        layout->ClearFlag(EHuiVisualFlagClipping); // No need to clip, should be faster without clipping 
+        // IsVisualOpaque should return true if there is no effect. 
+        // So that's why opaque flag is set to this layout.
+        layout->SetFlag(EHuiVisualFlagOpaqueHint); 
+        
+        TAlfControlGroupEntry entry;
+        entry.iControlGroup = group;
+        entry.iWindowGroupNodeId = aWindowGroupNodeId;
+        entry.iClientWindowGroupId = aClientWindowGroupId;  
+        entry.iSecureId = aSecureId;
+        // we have received start effect for this group, but the group did not exist in alf universe at the time. hide the group.
+        if (iFullScreenEffectData
+                && iFullScreenEffectData->iWaitingWindowGroup
+                && iFullScreenEffectData->iToAppId == aSecureId)
+            {
+            CHuiControlGroup* fromGroup = NULL;
+            CHuiLayout* fromLayout = NULL; 
+            fromGroup = FindControlGroupByAppId(iFullScreenEffectData->iFromAppId);
+            if (fromGroup)
+                {
+                CHuiControl& control2 = fromGroup->Control(0);
+                fromLayout = (CHuiLayout*)&control2.Visual(0);
+                }
+            
+            
+            // First HandleGfxEvent, then clear iWaitingWindowGroup.
+            TBool failed = HandleGfxEventL( *iFullScreenEffectData, layout, fromLayout );
+            if ( iFullScreenEffectData )
+                {
+                iFullScreenEffectData->iWaitingWindowGroup = EFalse;
+                }
+            if ( failed )
+                {
+                // Effect failed, reset state
+                HandleGfxStopEvent( EFalse ); // destroys iFullScreenEffectData
+                }
+            }     
+        entry.iScreenNumber = aScreenNumber;
+//        entry.iRole = EAlfWindowGroupContainer;
+
+        iAlfScreens[aScreenNumber]->iControlGroups.Append(entry);
+        CleanupStack::Pop(group);                
+
+        if (iAlfScreens[aScreenNumber]->iDisplay)
+            ShowControlGroupL(iAlfScreens[aScreenNumber]->iDisplay->Roster(), *group, KHuiRosterShowAtTop, aScreenNumber); 
+        }
+    
+
+    return *group;       
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::ShowControlGroupL(CHuiRoster& aRoster, CHuiControlGroup& aGroup, TInt aWhere, TInt aScreenNumber )
+    {        
+    CAlfScreen* screen = iAlfScreens[aScreenNumber];
+
+#ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER
+        DebugPrintControlGroupOrder(*screen, aRoster, aGroup);
+#endif
+
+#ifdef ALF_DEBUG_VISUALIZE_WINDOWGROUP_ORDER
+    if (!aGroup.IsTransformed())
+        {
+        aGroup.EnableTransformationL();
+        aGroup.Transformation().Translate(0,0);                    
+        aGroup.Transformation().Scale(0.3,0.3);                    
+        }
+#endif
+
+    TInt last = aRoster.Count() - 1;
+    
+    
+// when an application exits, it must be shown on top util the effect has run its course.
+// But this tends to mess up the order of other groups, and application menu softkeys will
+// disappear.
+    if ( aGroup.Control(0).Visual(0).Effect() )
+        {
+        if ( aGroup.Control(0).Role() != EAlfWindowGroupContainer )
+            {
+            // The case where the application control group is deleted by window server
+            // has been solved by deleting the tag when window server wants to delete
+            // the group. Window server no longer has it, but we keep it alive for a while
+            // to show the effect. The group will be deleted when the effect ends.
+            aWhere = aRoster.Count() - KAlfNumberOfFixedControlGroups;
+            }
+        }
+
+    if (aGroup.Control(0).Role() == EAlfWindowGroupContainer)      
+        {
+        // Window group control groups
+        ShowWindowGroupControlGroupL(aRoster, aGroup, aWhere, aScreenNumber);
+        aGroup.SetAcceptInput(EFalse);
+        }
+    else if (aGroup.Control(0).Role() == EAlfSessionContainer)      
+        {
+        // ALF application control groups    
+        ShowSessionContainerControlGroupL(aRoster, aGroup, aWhere, aScreenNumber);
+        }
+    else
+        {
+        aRoster.ShowL(aGroup, aWhere);
+        aGroup.SetAcceptInput(EFalse);
+        }                                    
+
+#ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER        
+        DebugPrintControlGroupOrder(*screen, aRoster, aGroup);
+#endif
+
+#ifdef ALF_DEBUG_VISUALIZE_WINDOWGROUP_ORDER
+        VisualizeControlGroupOrderL(aRoster, aGroup);
+#endif
+    
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::ShowSessionContainerControlGroupL(CHuiRoster& aRoster, CHuiControlGroup& aGroup, TInt aWhere, TInt aScreenNumber )
+    {
+    TInt last = aRoster.Count() - 1;
+
+    CAlfScreen* screen = iAlfScreens[aScreenNumber];
+
+    if (aWhere == KHuiRosterShowAtBottom)
+        {
+        // Most bottom one of alf control groups
+        aRoster.ShowL(aGroup, FirstAlfControlGroupIndex(aScreenNumber));    
+        }
+    else if (aWhere == KHuiRosterShowAtTop)
+        {
+        // Most top one of alf control groups
+        TInt newIndex = LastAlfControlGroupIndex(aScreenNumber);
+    
+        // check if the aGroup is already in a roster
+        for (TInt j=0; j<newIndex;j++)
+                { 
+                if( &aRoster.ControlGroup(j) == &aGroup )
+                    {
+                    // adjust position a bit because this is in fact "move" operation
+                    // move would move alf event window and place this control group
+                    // on top of it if we don't do this adjusment
+                    newIndex--;    
+                    break;
+                    }
+                }               
+        
+        aRoster.ShowL(aGroup, newIndex);    
+        }
+    else
+        {
+        TInt index = 0; // Index for ALF group control groups
+        TBool added = EFalse;
+        TBool move = EFalse; // indicates that controlgroup is already in the roster somewhere below the new index.
+        for (TInt i=FirstAlfControlGroupIndex(aScreenNumber); i<last; i++)
+            {
+            if (index == aWhere)
+                {
+                if( move )
+                    {
+                    // adjust the new index because of ShowL call
+                    // will first remove the controlgroup from original position
+                    index--; 
+                    }
+                aRoster.ShowL(aGroup, i);        
+                added = ETrue;
+                break;
+                }
+
+            if( &aRoster.ControlGroup(i) == &aGroup )
+                {
+                move = ETrue;
+                }
+            
+            if (aRoster.ControlGroup(i).Control(0).Role() == EAlfSessionContainer)
+                {
+                index++;                                                
+                }                    
+            }
+        
+        // Too large index was given, just add it to topmost    
+        if (!added)
+            {
+            // Topmost alf group
+            ShowSessionContainerControlGroupL( aRoster, aGroup, KHuiRosterShowAtTop, aScreenNumber );
+            }        
+        }                        
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::ShowWindowGroupControlGroupL(CHuiRoster& aRoster, CHuiControlGroup& aGroup, TInt aWhere, TInt aScreenNumber )
+    {
+    CAlfScreen* screen = iAlfScreens[aScreenNumber];
+
+    if (aWhere == KHuiRosterShowAtBottom)
+        {
+        // Most bottom one of any control groups
+        aRoster.ShowL(aGroup, KHuiRosterShowAtBottom);    
+        }
+    else if (aWhere == KHuiRosterShowAtTop)
+        {
+        // Topmost
+        aRoster.ShowL(aGroup, aRoster.Count() - KAlfNumberOfFixedControlGroups);
+        }
+    else
+        {
+        TInt index = 0; // Index for Window group control groups
+        TBool added = EFalse;
+        for (TInt i=0; i<aRoster.Count() - KAlfNumberOfFixedControlGroups; i++)
+            {
+            if (index == aWhere)
+                {
+                aRoster.ShowL(aGroup, i);        
+                added = ETrue;
+                break;
+                }
+
+            if (aRoster.ControlGroup(i).Control(0).Role() == EAlfWindowGroupContainer &&
+                &aRoster.ControlGroup(i) != &aGroup)
+                {
+                index++;                                                
+                }                    
+            }
+        
+        // Too large index was given, just add it to topmost    
+        if (!added)
+            {
+            // Topmost
+            for (TInt i=aRoster.Count()-KAlfNumberOfFixedControlGroups; i >= 0; i--)
+                {
+                if (aRoster.ControlGroup(i).Control(0).Role() == EAlfWindowGroupContainer)
+                    {
+                    aRoster.ShowL(aGroup, i); 
+                    break;
+                    }                    
+                }                                                             
+            }
+        }                                            
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::SetAlfWindowGroupId(TInt aAlfWindowGroupId)
+    {
+    iAlfWindowGroupId = aAlfWindowGroupId;        
+    // check if hithcock window group was already there
+    TInt secureId = RThread().SecureId(); 
+    if (iAlfScreens.Count())
+        {
+        for ( TInt i = 0; i < iAlfScreens[0]->iControlGroups.Count(); i++ )
+            {
+            if ( iAlfScreens[0]->iControlGroups[i].iSecureId == secureId && 
+                 iAlfScreens[0]->iControlGroups[i].iClientWindowGroupId != CHuiStatic::RootWin(0)->Identifier())
+                {
+                iAlfWindowGroupNodeId = iAlfScreens[0]->iControlGroups[i].iWindowGroupNodeId;
+                return;
+                }
+            }        
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+CHuiDisplay* CAlfBridge::Display(TInt aScreenNum)
+    {
+    for ( TInt i = 0 ; i < iAlfScreens.Count() ; i++ )
+        {
+        if ( iAlfScreens[i]->iScreenNum == aScreenNum )
+            {
+             return iAlfScreens[i]->iDisplay;
+            }
+        }
+    return NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::ReorderAlfControlGroupsL( TInt aScreenNumber )
+    {
+    if (iAlfScreens[aScreenNumber]->iDisplay)
+        {
+        RPointerArray<CHuiControlGroup> controlGroupOrder;
+        CHuiRoster& roster = iAlfScreens[aScreenNumber]->iDisplay->Roster();
+        for (TInt j=0; j<roster.Count();j++)
+            {
+            CHuiControlGroup& controlGroup = roster.ControlGroup(j);
+            if (controlGroup.Control(0).Role() == EAlfSessionContainer)
+                {
+                controlGroupOrder.Append(&controlGroup);
+                roster.Hide(controlGroup);
+                j--; // roster.Hide does remove controlGroup from the roster 
+                }
+            }
+            
+        for (TInt k=0;k<controlGroupOrder.Count();k++)
+            {
+            ShowControlGroupL(roster, *controlGroupOrder[k], KHuiRosterShowAtTop, aScreenNumber);    
+            }                                                        
+        
+        controlGroupOrder.Close();
+        }
+    }
+        
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfBridge::FirstAlfControlGroupIndex( TInt aScreenNumber )
+    {
+    if (iAlfScreens[aScreenNumber]->iDisplay)
+        {
+        CHuiRoster& roster = iAlfScreens[aScreenNumber]->iDisplay->Roster();
+        for (TInt j=0; j<roster.Count();j++)
+            {
+            if( roster.ControlGroup(j).Control(0).Role() == EAlfSessionContainer 
+                || roster.ControlGroup(j).ResourceId() == iAlfWindowGroupNodeId )
+                {
+                return j; // Alf groups positioned just above alf servers window group   
+                }
+            }                                        
+        }
+    return 0; // Not found      
+    }
+        
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfBridge::LastAlfControlGroupIndex( TInt aScreenNumber )
+    {
+    if (iAlfScreens[aScreenNumber]->iDisplay)
+        {                
+        CHuiRoster& roster = iAlfScreens[aScreenNumber]->iDisplay->Roster();
+        for (TInt j=0; j<roster.Count();j++)
+            { // last is always a index of pointer event window position
+            if( roster.ControlGroup(j).ResourceId() == iAlfWindowGroupNodeId )
+                {
+                return j; // Alf groups positioned just above alf servers window group   
+                }
+            }                
+        }
+    return 0;    
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfBridge::ResolveScreenNumber( CHuiDisplay& aDisplay )
+        {
+        for ( TInt i = 0 ; i < iAlfScreens.Count() ; i++ )
+            {
+            if ( iAlfScreens[i]->iDisplay == &aDisplay )
+                {
+                return iAlfScreens[i]->iScreenNum;
+                }
+            }
+        return KErrNotFound;
+        }
+    
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::NotifyDisplayRefreshStarted(CHuiDisplay& aDisplay)
+    {
+    // Look for the correct display
+    TInt screenNumber = ResolveScreenNumber(aDisplay);
+    RemoveTemporaryPresenterVisuals();
+    if ( screenNumber != KErrNotFound )
+        {
+        // FPS Counter with hitchcock drawing
+#ifdef SYMBIAN_BUILD_GCE
+        if(iPrintFPS)
+            {
+            TReal fps = CHuiStatic::FrameRate();
+            if(fps > 0)
+                {
+                TBuf<8> numBuf;
+                numBuf.AppendNum(fps, TRealFormat(5,1));
+                TRAP_IGNORE(
+                        {
+                        iAlfScreens[screenNumber]->iFPSText->SetTextL( numBuf );
+                        })
+                }
+            }
+#endif
+        
+        if (iAlfScreens[screenNumber]->IsVisualTreeVisibilityChanged())
+            {
+            HandleVisualVisibility( screenNumber );    
+            iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(EFalse);
+            }
+
+        if (!iActivated)            
+            {
+            iBridgerClient.Connect();
+            iActivated = ETrue;            
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Check if there is effect and it's not fade effect.
+// ---------------------------------------------------------------------------
+// 
+static TBool IsNonFadeEffect(CHuiFxEffect* aEffect)
+    {
+    return aEffect && !(aEffect->EffectFlags() & KHuiFadeEffectFlag);
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfBridge::IsVisualOpaque(CHuiVisual& aVisual)
+    {
+    TBool transparent = EFalse;
+    
+    // TODO: We should check transformation too and perhaps parent transformations as well ?
+    //transparent |= aVisual.IsTransformed(); 
+
+    // if the control has an attached effect which is transformed, it must be considered transparent
+    // as it may not cover the full screen
+    if ( IsNonFadeEffect( aVisual.Effect() ) )
+        {
+        return EFalse;
+        }
+    if ( aVisual.Layout() && IsNonFadeEffect( aVisual.Layout()->Effect() ) )
+        {
+        return EFalse;
+        }
+
+    if (aVisual.Flags() & EHuiVisualFlagDrawOnlyAsExternalContent)
+        {
+        return EFalse; // not transparent
+        }
+
+    transparent |= (!((aVisual.Flags() & EHuiVisualFlagOpaqueHint) == EHuiVisualFlagOpaqueHint));
+    transparent |= (aVisual.iOpacity.Now() < KAlfVisualDefaultOpacity);
+    transparent |= (aVisual.iOpacity.Target() < KAlfVisualDefaultOpacity);
+    
+    return  !transparent;            
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::ClipVisualRect(TRect& aRect, const TRect& aClippingRect)
+    {    
+    if (aRect.Intersects(aClippingRect))
+        {
+        // Clip to visible area, there are windows larger than screen for some reason.                
+        aRect.Intersection(aClippingRect);     
+        }
+    else
+        {
+        // no intersection with the clipping rect -> outside of the screen -> not visible
+        aRect = TRect(0,0,0,0);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfBridge::IsRectCoveredByRegion(TRect aRect, TRegion& aCoveringRegion)
+    {
+    TBool isCovered = EFalse;
+
+    // Zero sized rects are considered as covered (although it is a bit philosphical question)
+    if (aRect.Size() == TSize(0,0))
+        {
+        isCovered = ETrue;    
+        }
+            
+    // First check if it is covered by one of the rects in the covering region...
+    if (!isCovered)
+        {            
+        TPoint topLeft = aRect.iTl;
+        TPoint bottomRight = aRect.iBr;
+        bottomRight.iX--;
+        bottomRight.iY--;
+
+        for (TInt i=0; i < aCoveringRegion.Count(); i++)
+            {
+            if (aCoveringRegion[i].Contains(topLeft) && 
+                aCoveringRegion[i].Contains(bottomRight))
+                {
+                isCovered = ETrue;
+                }                                    
+            }
+        }        
+
+    // ...it may still cover it with a combination of several rects
+    if (!isCovered)
+        {            
+        iTempVisualRegion.Clear();
+        iTempIntersectingRegion.Clear();
+
+        iTempVisualRegion.AddRect(aRect);
+        
+        iTempIntersectingRegion.Intersection(aCoveringRegion, iTempVisualRegion);
+        iTempIntersectingRegion.Tidy();
+        
+        if (iTempIntersectingRegion.Count() == 1)
+            {
+            if (iTempIntersectingRegion[0] == aRect)
+                {
+                isCovered = ETrue;    
+                }
+            }        
+        }
+    
+    return isCovered;
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleVisualVisibility( TInt aScreenNumber )
+    {
+    if (!iAlfScreens.Count())
+        return;
+            
+    iTempRegion.Clear();
+    
+    CAlfScreen* screen = iAlfScreens[aScreenNumber];
+    TRect fullscreen = TRect(TPoint(0,0), screen->Size());
+    TBool fadeEffectInScreen = EFalse;
+    
+    
+    // Prepare SW render target (if needed)
+    if (iSwRenderingEnabled)
+        {
+        TBool modified = PrepareSwRenderingTarget( screen );
+        
+        if ( modified )
+            {
+            // To avoid debug panic, we need to reset foreground bitmap.
+            TRAP_IGNORE( screen->iDisplay->SetForegroundBitmapL( 
+                screen->iSwRenderingTarget ) );
+            }
+        }
+    
+    TBool fullscreenCovered = EFalse;
+    //iActiveVisualCount = 0;
+    iBgSurfaceFound = EFalse;
+    //iPaintedArea = 0;  
+    // skip the topmost (effect) layer, start from floating sprite group
+    for (TInt j=screen->iDisplay->Roster().Count() - 2; j>=0; j--)
+        {                
+#ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER
+        TInt activevisualcount = 0;
+        TInt passivevisualcount = 0;
+#endif
+
+        CHuiControlGroup& controlgroup = iAlfScreens[aScreenNumber]->iDisplay->Roster().ControlGroup(j);
+        CHuiControl& control = controlgroup.Control(0);
+        CHuiCanvasVisual* layout = (CHuiCanvasVisual*)&control.Visual(0);
+#ifdef HUI_DEBUG_TRACK_DRAWING	
+        if ( layout->Tracking() )
+            {
+            RDebug::Print(_L("CAlfBridge::HandleVisualVisibility: tracked visual 0x%x"), canvasVisual);
+            }
+#endif            
+
+        // Dont mess with alf control group visuals, alf session handling does it for us
+        // just add the rect to covered region because alf draws solid background.
+        if (control.Role() == EAlfSessionContainer)
+            {
+            iTempRegion.AddRect(fullscreen);
+            iTempRegion.Tidy();                                    
+            continue;
+            }
+        
+        // For optimization reasons, check if all visuals below in Z-order are covered    
+        if (!fullscreenCovered)
+            {
+            fullscreenCovered = IsRectCoveredByRegion(fullscreen, iTempRegion);            
+#ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER
+            if (fullscreenCovered)
+                __ALFLOGSTRING("Full screen covered!");                    
+#endif
+            }
+        
+        if (!fullscreenCovered)
+            {
+            fullscreenCovered = screen->iDisplay->Roster().IsVisibleContentFrozen();
+#ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER
+            if (fullscreenCovered)
+                __ALFLOGSTRING("Full screen covered because of frozen roster content");                    
+#endif
+            }
+        
+        TBool subTreeCovered = EFalse;
+        TBool hasActiveVisualsInVisualTree = HandleLayoutVisualVisibility( layout, controlgroup, control, fullscreenCovered, fullscreen, screen, subTreeCovered, IsVisualOpaque(*layout)  );    
+        TBool hasFadeEffectsInVisualTree = (layout->CanvasFlags() & EHuiCanvasFlagExternalFadeExistsInsideVisualTree);        
+        
+		// If we layout is active setup the fade effects. Also if it is inactive, but has been
+		// flagged as containing fade effect, then run the setup as well so that effects which
+		// are no more needed get removed.
+        if (hasActiveVisualsInVisualTree || (!hasActiveVisualsInVisualTree && hasFadeEffectsInVisualTree))
+            {
+            fadeEffectInScreen = ETrue;
+            
+            // Prepare fade effects to whole visual tree  below layout
+            PrepareFadeEffects( *layout );
+    
+            // Load needed fade effects (or remove them)
+            TBool visualTreeHasFadeEffects = LoadFadeEffectsL( *layout );
+            
+            // Set flag so that next time we can optimize
+            if (visualTreeHasFadeEffects)
+                {
+                layout->SetCanvasFlags(EHuiCanvasFlagExternalFadeExistsInsideVisualTree);
+                }
+            else
+                {
+                layout->ClearCanvasFlags(EHuiCanvasFlagExternalFadeExistsInsideVisualTree);            
+                }
+            }
+        
+        if (!hasActiveVisualsInVisualTree)
+            {
+            // Setting also the root visual (layout) as inactive, if it had none
+			// active children. This is because otherwise the Inactive checks won't
+			// work correctly within RosterImpl ScanDirty & ClearChanged phases.
+            layout->SetFlag(EHuiVisualFlagInactive);
+            }
+        else
+            {
+            layout->ClearFlag(EHuiVisualFlagInactive);
+            }
+        
+#ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER
+        __ALFLOGSTRING1(">>>> HandleVisualVisibility: Control group index: %d", j );
+        __ALFLOGSTRING1(">>>> HandleVisualVisibility: Active visuals : %d", activevisualcount );
+        __ALFLOGSTRING1(">>>> HandleVisualVisibility: Passive visuals: %d", passivevisualcount );
+#endif
+            
+        }
+    if (iBgSurfaceFound)
+        {
+        if (!iInLowMemMode)
+            {
+            SetLowMemory(ETrue);
+            iBridgerClient.SendBlind(KAlfCompositionTargetHidden, TIpcArgs());
+            iInLowMemMode = ETrue;            
+            }
+        }
+    else if (iInLowMemMode)
+        {
+        SetLowMemory(EFalse);
+        iBridgerClient.SendBlind(KAlfCompositionTargetVisible, TIpcArgs());
+        iInLowMemMode = EFalse;
+        }
+
+
+    // Finally, if there are fadeeffects applied to windowgroups, make sure first one does not
+    // blend itself, but other windowgroups do blend. Otherwise windowgrouops above others
+    // would clear the screen areas where they do not really draw.
+    if (fadeEffectInScreen)
+        {
+        TBool firstFadedWindowGroupFound = EFalse;
+        for (TInt j=0; j<screen->iDisplay->Roster().Count() - 2; j++) // skip the topmost (effect) layer 
+            {                
+            CHuiControlGroup& controlgroup = iAlfScreens[aScreenNumber]->iDisplay->Roster().ControlGroup(j);
+            CHuiControl& control = controlgroup.Control(0);
+            CHuiCanvasVisual* layout = (CHuiCanvasVisual*)&control.Visual(0);
+            if (layout->Effect() && (layout->Effect()->EffectFlags() & KHuiFadeEffectFlag))
+                {
+                if (firstFadedWindowGroupFound)
+                    {
+                    TInt flags = layout->Effect()->EffectFlags();
+                    flags |= KHuiFxAlwaysBlend;
+                    layout->Effect()->SetEffectFlags(flags);
+                    }
+                firstFadedWindowGroupFound = ETrue;
+                }
+            }
+        }
+    }
+
+TBool CAlfBridge::HandleLayoutVisualVisibility(
+        CHuiLayout* aLayout, 
+        CHuiControlGroup& aControlGroup,
+        CHuiControl& aControl,
+        TBool& aFullscreenCovered, 
+        TRect& aFullscreen,
+        CAlfScreen* aScreen,
+        TBool& aSubtreeVisible, 
+        TBool aChildCanBeOpaque )
+    {
+    TBool visualTreeActive = EFalse;
+    TRect visualDisplayRect;
+    TBool visualRectIsCovered = EFalse;
+    TBool visualIsOpaque = EFalse;
+    TBool visualIsActive = EFalse;
+    CHuiCanvasVisual* canvasVisual = NULL;
+
+    for (TInt i=aLayout->Count()-1; i >= 0; i--)
+        {
+        visualDisplayRect = TRect(0,0,0,0);
+        visualRectIsCovered = EFalse;
+        visualIsOpaque = EFalse;
+        visualIsActive = EFalse;
+        TBool visualSubtreeVisible = EFalse;
+        
+        // Check first if visual itself is hidden or does hide other visuals below 
+        // in z-order. If it does not hide, then we do not add its displayrect to covering 
+        // region.
+        canvasVisual = (CHuiCanvasVisual*)(&aLayout->Visual(i));
+        
+        // Child can be considered to be opaque only if all parents are opaque and
+        // visual itself is opaque.
+        // For example, parent can have opacity < 1 and that affects children as well.
+        // As another example, parent can have scaling transformation.
+        visualIsOpaque = aChildCanBeOpaque && IsVisualOpaque(*canvasVisual);
+        if (canvasVisual->Count())
+            {
+            visualTreeActive |= HandleLayoutVisualVisibility( canvasVisual, aControlGroup, aControl, aFullscreenCovered, aFullscreen, aScreen, visualSubtreeVisible, visualIsOpaque );
+            }
+    #ifdef HUI_DEBUG_TRACK_DRAWING  
+        if ( canvasVisual->Tracking() )
+            {
+            RDebug::Print(_L("CAlfBridge::HandleVisualVisibility: tracked visual 0x%x"), canvasVisual);
+            }
+    #endif                
+        
+        if (visualSubtreeVisible)
+            {
+            aSubtreeVisible = ETrue;
+            }
+            
+        // Optimization, it is faster to check fullscreen than read visuals displayrect
+        if (aFullscreenCovered)
+            {
+            visualRectIsCovered = ETrue;    
+            }
+        else
+            {
+            // Check where visual is            
+            visualDisplayRect = canvasVisual->DisplayRect();
+    
+            // Make sure we clip visual rect to visible screen area
+            ClipVisualRect(visualDisplayRect, aFullscreen);
+            
+            // Check if this visual is covered by other opaque visuals which rects are in "covered" region           
+            visualRectIsCovered = IsRectCoveredByRegion(visualDisplayRect, iTempRegion);                    
+            }
+    
+    /*            if ( layout->Effect() || canvasVisual->Effect() )
+            {
+            visualRectIsCovered = EFalse;
+            }
+    */
+        TBool wasInactive = canvasVisual->Flags() & 
+            ( EHuiVisualFlagInactive | EHuiVisualFlagUnderOpaqueHint ); 
+        
+        if (visualRectIsCovered)
+            {                                        
+            // We clear texture cache here to avoid running out of texture memory  
+            if (!(canvasVisual->Flags() & EHuiVisualFlagAlwaysDraw)) // The window has been hidden. However it has exit effect and it must stay active until effect has stopped
+                {
+                if (visualSubtreeVisible)
+                    {
+                    canvasVisual->SetFlag(EHuiVisualFlagUnderOpaqueHint);
+                    canvasVisual->ClearFlags(EHuiVisualFlagInactive); 
+                    }
+                else
+                    {
+                    canvasVisual->SetFlag(EHuiVisualFlagInactive);
+                    canvasVisual->ClearFlags(EHuiVisualFlagUnderOpaqueHint); 
+                    }
+                
+                canvasVisual->ClearCache();
+                // For SW rendering, disable capturing buffer
+                canvasVisual->SetCapturingBufferL(NULL);
+                }
+            else
+                { // this should be drawn, but inactivate when effect is done
+                canvasVisual->ClearFlags(
+                    EHuiVisualFlagInactive | EHuiVisualFlagUnderOpaqueHint |
+                    EHuiVisualFlagShouldBeInactive | EHuiVisualFlagShouldBeUnderOpaqueHint );
+                if (visualSubtreeVisible)
+                    {
+                    canvasVisual->SetFlag(EHuiVisualFlagShouldBeUnderOpaqueHint);
+                    }
+                else
+                    {
+                    canvasVisual->SetFlag(EHuiVisualFlagShouldBeInactive);
+                    }
+                canvasVisual->PrepareCache();
+                // For SW rendering, set capturing buffer if it exists)
+                canvasVisual->SetCapturingBufferL(aScreen->iSwRenderingTarget);                
+
+                if (wasInactive)
+                    {
+                    canvasVisual->SetChanged();
+                    }
+                }
+                
+            if (!wasInactive)
+                {
+                aScreen->iDisplay->SetDirty();
+                }                
+            
+    #ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER
+            passivevisualcount++;
+    #endif
+            }
+        else
+            {
+			aSubtreeVisible = ETrue;
+            canvasVisual->ClearFlags( 
+                EHuiVisualFlagInactive | EHuiVisualFlagShouldBeInactive |
+                EHuiVisualFlagUnderOpaqueHint | EHuiVisualFlagShouldBeUnderOpaqueHint );
+            canvasVisual->PrepareCache();
+            canvasVisual->SetCapturingBufferL(aScreen->iSwRenderingTarget);                
+
+            // we've found non-inactive window which has background surface
+            // attached..
+            if (canvasVisual->IsBackgroundDrawingEnabled() &&
+                canvasVisual->LayerExtent() != TRect() &&
+                !canvasVisual->LayerUsesAlphaFlag() )
+                {
+                // if paintedareacount is exactly one, it means that the window
+                // has background surface but no drawing commands
+                if (canvasVisual->PaintedAreaCount() == 1) 
+                    {
+                    THuiCanvasPaintedArea pa = canvasVisual->PaintedArea(0);
+                    TRect r = pa.iPaintedRect.Round();
+                    // if we found a fullscreen surface with no other drawing commands
+                    // we can safely assume that it's about the only thing to be visible
+                    // and we can release memory occupied by other parts of the system
+                    // 
+                    // NOTE: this mechanism keeps the system in low mem state
+                    // if the surface is visible, meaning that for example
+                    // opening an options menu does not instantly trigger normal
+                    // memory state. We want to do it like this as otherwise
+                    // we would be triggering for example background animation
+                    // on / off quite rapidly........
+                    if ( r == Display(0)->VisibleArea())
+                        {
+                        // Final test. Surface must not be ALF surface, but some other surface.                        
+                        CHuiControlGroup* alfControlGroup = FindControlGroupByAppId( iAlfSecureId );
+                        if (alfControlGroup != &aControlGroup)
+                            {                        
+                            iBgSurfaceFound = ETrue;
+                            }
+                        }
+                    }
+                }
+
+            if (wasInactive)
+                {
+                canvasVisual->SetChanged();
+                }
+    #ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER
+            activevisualcount++;
+    #endif
+            }
+            
+        // Finally check the area that this visual covers and add it to covered region
+        visualIsActive = !(canvasVisual->Flags() & EHuiVisualFlagInactive);
+    
+        // Sprites and effects as we consider them always as transparent and also
+        // if controlgroup is transformed somehow    
+        
+        if (aControl.Role() == EAlfFullScreenEffectContainer 
+            || aControl.Role() == EAlfWindowFloatingSpriteContainer ||
+            aControlGroup.IsTransformed())
+            {
+            visualIsOpaque = EFalse;    
+            }
+    
+        if (visualIsActive && visualIsOpaque && !visualRectIsCovered)
+            { 
+    #ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER
+            if (canvasVisual->PaintedAreaCount())
+                __ALFLOGSTRING2("Visual has painted areas: displayrect: iTl: %i, %i", visualDisplayRect.iTl.iX, visualDisplayRect.iTl.iY);                    
+                __ALFLOGSTRING2("Visual has painted areas: displayrect: iBr: %i, %i", visualDisplayRect.iBr.iX,visualDisplayRect.iBr.iY);
+                #endif
+            for (TInt k=0; k < canvasVisual->PaintedAreaCount(); k++)
+                {                                
+                THuiCanvasPaintedArea paintArea = canvasVisual->PaintedArea(k);
+                TRect coveredRect = paintArea.iPaintedRect;
+                                
+                // Clip to visible area, there are windows larger than screen for some reason.                
+                ClipVisualRect(coveredRect, aFullscreen);
+                
+                // Only add to covering region if the painted area is defined as opaque
+                if (paintArea.iPaintType == EHuiCanvasPaintTypeOpaque)
+                    {
+    #ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER
+                    __ALFLOGSTRING2("Covered rect: iTl: %i, %i", coveredRect.iTl.iX, coveredRect.iTl.iY);                    
+                    __ALFLOGSTRING2("Covered rect: iBr: %i, %i", coveredRect.iBr.iX,coveredRect.iBr.iY);
+    #endif
+                    iTempRegion.AddRect(coveredRect);
+                    iTempRegion.Tidy();                                    
+                    }
+                }
+            }                                        
+        }
+    
+    visualTreeActive |= visualIsActive; 
+    return visualTreeActive;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::ClearCanvasVisualCommandSets(TBool aInactiveOnly)
+    {
+    if (!iAlfScreens.Count())
+        return;
+            
+    CAlfScreen* screen = iAlfScreens[0]; // TODO  
+    for (TInt j=screen->iDisplay->Roster().Count() - 2; j>=0; j--) // skip the topmost (effect) layer 
+        {                
+        CHuiControlGroup& controlgroup = iAlfScreens[0]->iDisplay->Roster().ControlGroup(j);
+        CHuiControl& control = controlgroup.Control(0);
+
+        if ( control.Role() == EAlfSessionContainer )
+            {
+            continue;
+            }
+        
+        CHuiLayout* layout = (CHuiLayout*)&control.Visual(0);
+        for (TInt i=layout->Count()-1; i >= 0; i--)
+            {
+            CHuiCanvasVisual* canvasVisual = (CHuiCanvasVisual*)(&layout->Visual(i));
+            if (!aInactiveOnly)
+                {
+                canvasVisual->ClearCommandSet();
+                }
+            else if (aInactiveOnly && (canvasVisual->Flags() & EHuiVisualFlagInactive))
+                {
+                canvasVisual->ClearCommandSet();                        
+                }
+            else
+                {
+                // dont clear
+                }
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::EnableVisualDefaultTransformationsL(CHuiVisual& aVisual)
+    {
+    aVisual.EnableTransformationL();
+    if (!aVisual.Transformation().Count())
+        {
+        aVisual.Transformation().Rotate(0);
+        aVisual.Transformation().Scale(1,1);
+        aVisual.Transformation().Translate(0,0);                                                
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleCallback(TInt aStatus)
+    {
+    TInt err = KErrNone;
+    if (aStatus >= 0)
+        {
+        TRAP(err, DoDispatchL(aStatus))
+        }            
+    
+    if (aStatus < 0 || err)
+        {
+        __ALFLOGSTRING2("CAlfBridge::HandleCallback status: %d error: %d",aStatus,err);
+        
+        CEikonEnv* eikenv = CEikonEnv::Static();
+        if ( eikenv )
+        		{
+        		eikenv->HandleError(err?err:aStatus);
+            }
+        }
+    }
+        
+
+// ---------------------------------------------------------------------------
+// DoDispatchL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::DoDispatchL(TInt aStatus)
+    {
+    if (*iHost)
+        {
+        TAlfBridgerData data = (*iHost)->GetData(aStatus);
+        // dispatch
+        __ALFLOGSTRING1( "CAlfBridge::DoDispatchL: %d",data.iOp );
+
+        switch (data.iOp)
+            {
+            case EAlfDSCreateNewDisplay:
+                {
+                AddNewScreenL(NULL);
+                break;
+                }
+            case EAlfDSDestroyDisplay:
+                {
+                HandleDestroyDisplay( data.iInt1 );
+                break;
+                }
+            case EAlfDSNewWindow:
+                {
+                HandleNewWindowL( data );
+                break;
+                }
+            case EAlfDSDestroyWindow:
+            	{
+                HandleDestroyWindowL( data );
+            	break;
+                }
+            case EAlfDSSetWindowPos:
+                {
+                HandleSetWindowPosL( data );
+                break;
+                }
+            case EAlfDSSetWindowSize:
+                {
+                HandleSetWindowSizeL( data );
+                break;
+                }
+            case EAlfDSSetWindowRotation:
+                {
+                HandleSetWindowRotationL( data );
+                break;
+                }
+            case EAlfDSSetWindowOpacity:
+                {
+                HandleSetWindowOpacityL( data );
+                break;
+                }
+            case EAlfDSRefreshCallback:
+                {
+                iHuiEnv->ContinueRefresh();
+                break;
+                }
+            case EAlfDSReorder:
+                {
+                HandleReorderWindowL( data );
+                break;
+                }                    
+            case EAlfDSPostCanvasBuffer:
+            	{
+                HandlePostCanvasBufferL( data );
+            	break;
+            	}
+            case EAlfDSSetWindowActive:
+                {
+                HandleSetWindowActiveL( data );
+                break;
+                }
+            case EAlfDSSetWindowFlag:
+            case EAlfDSClearWindowFlag:
+                {
+                HandleSetWindowFlagL(data, data.iOp);
+                break;
+                }
+            case EAlfDSSetSurfaceExtent:
+                {
+                HandleSetSurfaceExtentL( data );
+                break;
+                }
+            case EAlfDsLayerUsesAlphaFlagChanged:
+                { 
+                HandleLayerUsesAlphaFlagChanged( data );
+                break;
+                }
+            case EAlfDSGetAlfNativeWindowData:
+                {
+//                HandleGetNativeWindowDataL( data );
+                break;
+                }
+            case EAlfDSGroupChained:
+            	{
+            	__ALFLOGSTRING("CAlfBridge::DoDispatchL, EAlfDSGroupChained");    
+            	// TODO, link groups 
+            	break;
+            	}
+            case EAlfDSGroupChainBroken:
+            	{
+            	__ALFLOGSTRING("CAlfBridge::DoDispatchL, EAlfDSGroupChainBroken");    
+            	// TODO, break link
+            	break;
+            	}
+            case EAlfDSMoveWindowToNewGroup:
+            	{
+            	/*
+            	RDebug::Print(_L("CAlfBridge::DoDispatchL, EAlfDSMoveWindowToNewGroup, THIS METHOD IS UNTESTED. EXPECT TROUBLE!"));
+            	// TODO: TEST!
+            	TInt windowGroupNodeId = data.iInt1;
+            	TInt windowNodeId = data.iInt2;
+            	TInt newGroupId = (TInt)data.iPtr;
+            	CHuiLayout* layout = NULL;
+            	CHuiCanvasVisual* viz = (CHuiCanvasVisual*)FindVisual(windowNodeId, windowGroupNodeId,screenNumber);
+            	if (viz)
+            		{
+            		// #1 remove visual from old group
+            		layout = viz->Layout();
+            		layout->Remove(viz);                           
+            		viz->Owner().Remove(viz);
+            		// #2 insert visual to the beginning of the new group
+            		CHuiControlGroup* controlGroup = FindControlGroup(newGroupId,screenNumber);
+            		if (controlGroup)
+            			{
+            			CHuiControl& control = controlGroup->Control(0);
+            			CHuiLayout* layout = (CHuiLayout*)&control.Visual(0);
+            			layout->AppendL( viz );
+            			}
+            		}*/
+            		break;
+            	}
+            case EAlfEffectFx:
+                {
+                HandleGfxEffectsL( data );
+                break;
+                }
+            case EAlfStopEffectFx:
+                {
+                HandleGfxStopEffectsL( data );
+                break;
+                }
+            case EAlfControlEffectFx:
+                {
+                HandleGfxControlEffectsL( data );
+                break;
+                }
+            // TODO: implement these    
+            case EAlfRegisterEffectFx:
+                {
+                HandleRegisterEffectL( data );
+                break;
+                }
+            case EAlfUnregisterEffectFx:
+                {
+                for (TInt i = 0; i < iAlfRegisteredEffects.Count(); i++)
+                    {
+                    if (iAlfRegisteredEffects[i].iAction == data.iInt1)
+                        {
+                        TRegisteredEffectsStruct removed =
+                                iAlfRegisteredEffects[i];
+                        iAlfRegisteredEffects.Remove(i);
+                        CHuiFxEngine* engine = NULL;
+                        engine = iHuiEnv->EffectsEngine();
+                        if (engine)
+                            {
+                            engine->UnRegisterEffectL(*removed.iEffectFile);
+                            }
+                        delete removed.iEffectFile;
+						// if this happened to be the fade effect, the cached fade effect filename should
+						// be cleared
+                        if ( data.iInt1 == KFadeAction)
+                            {
+                            RegisterFadeEffectL();
+                            }
+                        break;
+                        }
+                    }
+                break;
+                }
+            case EAlfUnregisterAllFx:
+                {
+                while (iAlfRegisteredEffects.Count())
+                    {
+                    TRegisteredEffectsStruct removed =
+                            iAlfRegisteredEffects[0];
+                    iAlfRegisteredEffects.Remove(0);
+                    CHuiFxEngine* engine = NULL;
+                    engine = iHuiEnv->EffectsEngine();
+                    if (engine)
+                        {
+                        engine->UnRegisterEffectL(*removed.iEffectFile);
+                        }
+
+                    delete removed.iEffectFile;
+                    }
+                // fade file might have changed. This will be resolved when next fade effect request arrives.
+                RegisterFadeEffectL();
+                break;
+                }
+            case EAlfDSSetCursorData:
+                {
+                HandleSetCursorDataL( data );
+                break;
+                }
+            case EAlfDSSetFadeEffect:
+                {
+                HandleSetFadeEffectL( data );
+                break;
+                }
+            case EAlfDSSetNodeTracking:
+                {
+                HandleSetNodeTracking( data );
+                break;
+                }
+           case EAlfBridgeSetScreenRotation:
+                {
+                //short cut..  
+                __ALFLOGSTRING1("CAlfBridge::DoDispatchL: EAlfBridgeSetScreenRotation: %d",data.iInt1);  
+                CHuiGc::TOrientation huiOrientation(CHuiGc::EOrientationNormal);
+	            switch(data.iInt1)
+	                {
+	                case 1: // 90    
+                    huiOrientation = CHuiGc::EOrientationCCW90;
+                    break;
+	            case 2: // 180    
+                    huiOrientation = CHuiGc::EOrientation180;
+                    break;
+	            case 3: // 270    
+                    huiOrientation = CHuiGc::EOrientationCW90;
+                    break;
+                default:
+                    break;
+                    }
+	            if (iAlfScreens[0]->iDisplay->Orientation() != huiOrientation)
+	                {
+                    HandleSetLayoutSwitchEffectL();
+	                iAlfScreens[0]->iDisplay->SetOrientation(huiOrientation);
+	                if (iAppUi)
+	                	{
+	                	iAppUi->AdjustWindowGroupPositionL(0,CAlfAppServer::EAlfWindowSize); // hackish, but one way to enforce alf window resizing
+	                	}
+	                __ALFLOGSTRING1("AlfScreens[0]->iDisplay->SetOrientation: %d",huiOrientation);  	                
+	                }
+	            
+                break;         
+                }
+           case EAlfEffectFxBeginSyncronizedGroup:
+        	   {
+        	   CHuiFxEngine* engine = iHuiEnv->EffectsEngine();
+        	   if (engine)
+        		   {
+				   engine->BeginGroupEffect(data.iInt1);
+        		   }
+        	   break;
+        	   }
+           case EAlfEffectFxEndSyncronizedGroup:
+        	   {
+        	   TInt groupId = data.iInt1;
+        	   //TBool forced = data.iInt2;
+        	   __ALFLOGSTRING1("CAlfBridge::DoDispatchL - Ending for group %d requested.", 
+        			   groupId ); 
+        	   CHuiFxEngine* engine = iHuiEnv->EffectsEngine();
+        	   if (engine)
+        		   {
+				   engine->StartGroupEffect(groupId);
+        		   }
+        	   iHuiEnv->ContinueRefresh();
+        	   break;
+        	   }
+           case KUnInitialized:
+               {
+               __ALFLOGSTRING1("CAlfBridge::DoDispatchL: Received KUnInitialized: %d - CRITICAL ERROR!",data.iOp);
+               USER_INVARIANT();
+               }
+            default:
+              {
+              // Should not happen
+              __ALFLOGSTRING1("CAlfBridge::DoDispatchL: Received Unknown op: %d",data.iOp);
+              }
+            }
+        }
+   }
+
+// ---------------------------------------------------------------------------
+// HandleDestroyDisplay
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleDestroyDisplay( TInt aScreenNumber )
+    {
+    iAlfScreens[aScreenNumber]->iDisplay->iRefreshObservers.Remove( *this );
+    // TODO: Following delete iAlfScreens[aScreenNumber] crashes when display is trying to delete roster. 
+    // RosterEntry is trying to refer to display, which is appareantly alrady destroyed. The roster should have no iRootVisual when display is removed. 
+    
+    iAlfScreens[aScreenNumber]->iDisplay->Roster().Hide(*(iAlfScreens[aScreenNumber]->iFloatingSpriteControlGroup)); 
+    iAlfScreens[aScreenNumber]->iDisplay->Roster().Hide(*(iAlfScreens[aScreenNumber]->iFullscreenEffectControlGroup));
+    delete iAlfScreens[aScreenNumber];
+    iAlfScreens.Remove( aScreenNumber );
+    }
+
+// ---------------------------------------------------------------------------
+// HandleNewWindowL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleNewWindowL( TAlfBridgerData& aData )
+	{
+	TInt windowGroupNodeId = aData.iInt1;
+	TInt windowNodeId = aData.iInt2;
+	TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*) (*iHost)->GetVarDataL( (TInt)aData.iPtr );
+	TInt screenNumber = windowAttributes->iScreenNumber; 
+	__ALFLOGSTRING1("CAlfBridge::HandleNewWindowL: new window %d!",windowNodeId);    
+	                
+	switch (windowAttributes->iWindowNodeType)
+		{
+		case EAlfWinTreeNodeGroup:
+			{
+			CHuiControlGroup& controlGroup = CreateControlGroupL(
+			        windowGroupNodeId, 
+			        windowAttributes->iClientHandle, 
+			        windowAttributes->iSecureId,
+			        screenNumber);                            
+
+			// We just received notification for our own window group creation, store its node id for doing
+			// faster lookups later...
+			if (windowAttributes->iClientHandle == iAlfWindowGroupId)
+				{
+				iAlfWindowGroupNodeId = windowGroupNodeId;    
+				}
+			break;    
+			}
+		case EAlfWinTreeNodeClient:
+		case EAlfWinTreeNodeRoot: // TODO: Root window receives drawing commands too
+		case EAlfWinTreeNodeAnim:
+		case EAlfWinTreeNodeSprite:
+		case EAlfWinTreeNodeTextCursor:
+			{
+			CHuiControlGroup* controlGroup = FindControlGroup(windowGroupNodeId,screenNumber);
+			// Floating sprites only require own group. Normal sprites should behave as normal visuals.
+			if (!controlGroup && windowAttributes->iWindowNodeType == EAlfWinTreeNodeSprite )
+				{                            
+				controlGroup = iAlfScreens[screenNumber]->iFloatingSpriteControlGroup;
+				}
+
+			if (controlGroup)
+				{
+				CHuiControl& control = controlGroup->Control(0);
+				CHuiLayout* layout = (CHuiLayout*)&control.Visual(0);
+				CHuiCanvasVisual* viz = NULL;
+				CHuiCanvasVisual* parentViz = NULL;             
+				parentViz = (CHuiCanvasVisual*)FindVisual(windowAttributes->iParentNodeId);             
+				if (parentViz)
+				    {
+                    viz = CHuiCanvasVisual::AddNewL(control, parentViz);
+				    }
+				else
+				    {
+                    viz = CHuiCanvasVisual::AddNewL(control, layout);
+				    }
+				__ALFFXLOGSTRING2("CAlfBridge::HandleNewWindowL visual: 0x%x, id 0x%x", viz, windowNodeId);
+				AddVisual( 
+				    windowNodeId, 
+					windowAttributes->iClientHandle, 
+					windowAttributes->iClientGroupHandle, 
+					viz );
+
+                // check , if a window is having already defined effect.
+                if (iControlEffectData 
+                        && iControlEffectData->iClientHandle == windowAttributes->iClientHandle
+                        && iControlEffectData->iClientGroupHandle == windowAttributes->iClientGroupHandle)
+                    {
+                    HandleGfxControlEventL(*iControlEffectData, viz);
+                    delete iControlEffectData;
+                    iControlEffectData = NULL;
+                    }
+				viz->SetCommandType( CHuiCanvasVisual::ECommandBufferSgc );
+				viz->SetFlags(EHuiVisualFlagManualLayout | EHuiVisualFlagInactive);
+#ifdef HUI_DEBUG_TRACK_DRAWING
+				if ( windowAttributes->iTrackWindow )
+				    {
+				    viz->SetTracking( windowAttributes->iTrackWindow );
+				    }
+#endif
+				// draw sprites and anims the last inside their windowgroup
+				/*if (windowAttributes->iWindowNodeType == EAlfWinTreeNodeSprite || windowAttributes->iWindowNodeType == EAlfWinTreeNodeAnim )
+					{
+					viz->SetFlag(EHuiVisualFlagDrawAfterOthers);
+					}
+*/
+				// Store identifier / tag to get handle of this visual later
+				TBuf8<16> buf;
+				buf.AppendNum(windowNodeId);
+				viz->SetTagL(buf);                    
+				viz->SetPos(windowAttributes->iPosition, windowAttributes->iTransitionTime);
+				viz->SetSize(windowAttributes->iSize, windowAttributes->iTransitionTime);
+
+				// Keep window invisible until activated, for now we use opacity for that.
+				viz->iOpacity.Set(0, 0);
+				
+				// Set up parent link for clipping calculations
+	            if (parentViz)
+	                {
+	                viz->SetCanvasFlags(EHuiCanvasFlagEnableCanvasClipping);
+	                viz->SetParentCanvas(parentViz);	                
+	                }
+	            else
+	                {
+	                __ALFLOGSTRING1("CAlfBridge::HandleNewWindowL: Parent not found for visual %d!",windowNodeId);    
+	                }								
+				}
+			else
+				{
+				__ALFLOGSTRING1("CAlfBridge::HandleNewWindowL: Control group not found for visual %d!",windowNodeId);    
+				}    
+
+			break; 
+			}
+		default:
+			{
+			__ALFLOGSTRING("CAlfBridge::HandleNewWindowL: Unknown window node type received !");
+			}
+		}
+	iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(ETrue);
+	}
+
+// ---------------------------------------------------------------------------
+// HandleDestroyWindow
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::DestroyWindow(CHuiVisual* aVisual, TBool aUseForce)
+    {
+    if ( !aUseForce && HasActiveEffect(aVisual) )
+        {
+        // this visual will be destroyed on the effect call back.
+        __ALFFXLOGSTRING1("CAlfBridge::DestroyWindow - not destroying 0x%x", aVisual);
+        aVisual->SetFlag(EHuiVisualFlagShouldDestroy);
+        // TODO: Revise
+        // move to effect controlgroup
+        //CHuiControl& effectControlGroup = iAlfScreens[0]->iFullscreenEffectControlGroup->Control(0);
+        //CHuiLayout* effectControlGroupLayout = (CHuiLayout*) &effectControlGroup.Visual(0);
+        // Transfers ownership of visuals. 
+        //effectControlGroup.AppendL(aVisual, effectControlGroupLayout); // this will remove it from the previous layout
+        //aVisual->SetOwner(effectControlGroup);
+        return;
+        }
+    __ALFFXLOGSTRING1("CAlfBridge::DestroyWindow 0x%x", aVisual);
+    RemoveImageBrushL(*aVisual);
+    CHuiLayout* layout = aVisual->Layout();
+    if (layout)
+        layout->Remove(aVisual);
+    aVisual->Owner().Remove(aVisual);
+    __ALFLOGSTRING1("CAlfBridge::HandleDestroyWindow - destroying visual 0x%x", aVisual);
+    // check if visual is having an effect at the moment. This could occur, if options menu is exited (with effect) and then 
+    // application is exited. EHuiVisualFlagDrawOnlyAsExternalContent is indication that
+    // there might be effect on this visual. It is not guaranteen.
+
+    delete aVisual;
+    }
+// ---------------------------------------------------------------------------
+// HandleDestroyWindowL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleDestroyWindowL( TAlfBridgerData& aData )
+	{
+	TInt windowGroupNodeId = aData.iInt1;
+	TInt windowNodeId = aData.iInt2;
+
+	TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*) (*iHost)->GetVarDataL( (TInt)aData.iPtr );
+	TInt screenNumber = windowAttributes->iScreenNumber;
+
+	switch (windowAttributes->iWindowNodeType)
+		{
+		case EAlfWinTreeNodeGroup:
+			{
+			DeleteControlGroupL(windowGroupNodeId, screenNumber);                            
+			break;    
+			}
+		case EAlfWinTreeNodeClient:
+		case EAlfWinTreeNodeRoot:
+		case EAlfWinTreeNodeAnim:
+		case EAlfWinTreeNodeSprite:                            
+		case EAlfWinTreeNodeFloatingSprite:  
+		case EAlfWinTreeNodeTextCursor:    
+			{
+            // close cursor timer
+            if (windowAttributes->iWindowNodeType == EAlfWinTreeNodeTextCursor)
+                {
+	            iCursorTimer->Cancel();
+	            }
+
+			//just remove the visual
+			CHuiCanvasVisual* viz;
+			
+			viz = (CHuiCanvasVisual*)FindVisual(windowNodeId);
+			CHuiControlGroup* controlGroup = FindControlGroup( windowGroupNodeId, screenNumber );
+		     // Sprite is in its own group, and can be deleted normally.
+			if ( !controlGroup  && windowAttributes->iWindowNodeType != EAlfWinTreeNodeSprite )
+			    {
+			    __ALFLOGSTRING("CAlfBridge::HandleDestroyWindowL: group containing this visual has been destroyed.!");
+			    // the group containing this visual has been destroyed. Thus the visual itself has been destroyed by 
+			    // the group. Ignore this.
+			    }
+			else
+			    {
+			    // = (CHuiCanvasVisual*)de(windowNodeId, windowGroupNodeId,screenNumber);
+			    if (viz)
+			        {
+#ifdef HUI_DEBUG_TRACK_DRAWING
+        if ( viz->Tracking() )
+            {
+            RDebug::Print(_L("CAlfBridge::HandleDestroyWindowL - Tracked visual"));
+            }
+#endif
+		            DestroyWindow(viz);
+			        }
+			    else
+			        {
+			        __ALFLOGSTRING("CAlfBridge::HandleDestroyWindowL: visual not found!");
+			        }
+			    }
+			RemoveVisual( windowNodeId );
+			break;
+			}                                                     
+		default:
+			{
+			__ALFLOGSTRING("CAlfBridge::HandleDestroyWindowL: Unknown window node type received !");
+			break;
+			}
+		}
+	// TODO: Toolkit does not support recycling (of visuals),
+	// this is not in line with Nokia environmental policy...
+	iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(ETrue);
+	}
+
+// ---------------------------------------------------------------------------
+// HandleSetWindowPosL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleSetWindowPosL( TAlfBridgerData& aData )
+	{
+	TInt windowNodeId = aData.iInt2;
+	TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*) (*iHost)->GetVarDataL( (TInt)aData.iPtr );
+	TInt screenNumber = windowAttributes->iScreenNumber;
+	// fetch visual
+	CHuiVisual* viz = FindVisual(windowNodeId);
+	if (viz)
+		{
+#ifdef HUI_DEBUG_TRACK_DRAWING
+		if ( viz->Tracking() )
+		    {
+		    RDebug::Print(_L("CAlfBridge::HandleSetWindowPosL - Tracked visual"));
+		    }
+#endif
+
+		viz->SetPos(windowAttributes->iPosition, windowAttributes->iTransitionTime);
+		  iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(ETrue); // TODO: Check if really changed   
+		}
+	else
+		{
+		__ALFLOGSTRING("CAlfBridge::HandleSetWindowPosL, EAlfDSSetWindowPos: Visual not found!");    
+		}   
+	}
+
+// ---------------------------------------------------------------------------
+// HandleSetWindowSizeL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleSetWindowSizeL( TAlfBridgerData& aData )
+	{
+	TInt windowNodeId = aData.iInt2;
+	TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*) (*iHost)->GetVarDataL( (TInt)aData.iPtr );
+	TInt screenNumber = windowAttributes->iScreenNumber;
+	// fetch visual
+	CHuiVisual* viz = FindVisual(windowNodeId);
+	if (viz)
+		{
+#ifdef HUI_DEBUG_TRACK_DRAWING
+        if ( viz->Tracking() )
+            {
+            RDebug::Print(_L("CAlfBridge::HandleSetWindowSizeL - Tracked visual"));
+            }
+#endif
+		viz->SetSize(windowAttributes->iSize, windowAttributes->iTransitionTime);
+		}
+	else
+		{
+		__ALFLOGSTRING("CAlfBridge::HandleSetWindowSizeL, EAlfDSSetWindowSize: Visual not found!");    
+		}   
+    iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(ETrue);
+	}
+
+// ---------------------------------------------------------------------------
+// HandleSetWindowRotationL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleSetWindowRotationL( TAlfBridgerData& aData )
+	{
+	TInt windowNodeId = aData.iInt2;
+	TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*) (*iHost)->GetVarDataL( (TInt)aData.iPtr );
+	// fetch visual
+	CHuiVisual* viz = FindVisual(windowNodeId);
+	if (viz)
+		{
+#ifdef HUI_DEBUG_TRACK_DRAWING
+        if ( viz->Tracking() )
+            {
+            RDebug::Print(_L("CAlfBridge::HandleSetWindowRotationL - Tracked visual"));
+            }
+#endif
+		EnableVisualDefaultTransformationsL(*viz);
+		viz->Transformation()[KVisualTransformationStepRotate].iParams[0].Set(windowAttributes->iRotation, 
+				windowAttributes->iTransitionTime);                                                        
+		}
+	else
+		{
+		__ALFLOGSTRING("CAlfBridge::HandleSetWindowRotationL, EAlfDSSetWindowRotation: Visual not found!");                    
+		}    
+	}
+
+// ---------------------------------------------------------------------------
+// HandleSetWindowOpacityL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleSetWindowOpacityL( TAlfBridgerData& aData )
+	{
+	TInt windowNodeId = aData.iInt2;
+	TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*) (*iHost)->GetVarDataL( (TInt)aData.iPtr );
+	TInt screenNumber = windowAttributes->iScreenNumber;
+	// fetch visual
+	CHuiVisual* viz = FindVisual(windowNodeId);
+	if (viz)
+		{
+#ifdef HUI_DEBUG_TRACK_DRAWING
+        if ( viz->Tracking() )
+            {
+            RDebug::Print(_L("CAlfBridge::HandleSetWindowOpacityL - Tracked visual"));
+            }
+#endif
+		viz->iOpacity.Set(windowAttributes->iOpacity, windowAttributes->iTransitionTime);
+		  iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(ETrue);  // TODO: Check if really changed  
+		}
+	else
+		{
+		__ALFLOGSTRING("CAlfBridge::HandleSetWindowOpacityL, EAlfDSSetWindowOpacity: Visual not found!");                                                
+		}  
+	}
+
+// ---------------------------------------------------------------------------
+// HandleReorderWindowL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleReorderWindowL( TAlfBridgerData& aData )
+	{
+	TInt windowGroupNodeId = aData.iInt1;
+	TInt windowNodeId = aData.iInt2;
+	TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*) (*iHost)->GetVarDataL( (TInt)aData.iPtr );
+	TInt screenNumber = windowAttributes->iScreenNumber;
+	TInt ordinalPosition = windowAttributes->iOrdinalPosition;
+
+	switch (windowAttributes->iWindowNodeType)
+		{
+		case EAlfWinTreeNodeGroup:
+			{        
+
+			// HACK !!!!                                                
+			#ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER
+			if (windowGroupNodeId == iAlfWindowGroupNodeId)
+				{
+				__ALFLOGSTRING1("CAlfBridge::HandleReorderWindowL, EAlfDSReorder: Alf window group going to: %d ",windowAttributes->iOrdinalPosition);    
+				}
+			else
+				{
+				__ALFLOGSTRING1("CAlfBridge::HandleReorderWindowL, EAlfDSReorder: WS window group going to: %d ",windowAttributes->iOrdinalPosition);                                        
+				}    
+			#endif
+
+			CHuiControlGroup* controlGroup = FindControlGroup(windowGroupNodeId,screenNumber);
+			
+                        if (!controlGroup)
+                            {
+                            User::Leave(KErrNotFound);
+                            }
+
+			// Window server nodes are in inverted Z-order, we switch it here.
+			iAlfScreens[screenNumber]->iDisplay->Roster().Hide(*controlGroup);                            
+			TInt wsWindowGroupCount = 0;
+			for (TInt i=0; i<iAlfScreens[screenNumber]->iDisplay->Roster().Count();i++)
+				{
+                if (iAlfScreens[screenNumber]->iDisplay->Roster().ControlGroup(i).Control(0).Role()==EAlfWindowGroupContainer)
+					{
+					wsWindowGroupCount++;    
+					}
+				}
+			ordinalPosition = wsWindowGroupCount - windowAttributes->iOrdinalPosition;
+			
+			#ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER
+			__ALFLOGSTRING1("CAlfBridge::HandleReorderWindowL, EAlfDSReorder: wsWindowGroupCount: %d ", wsWindowGroupCount);                                        
+			__ALFLOGSTRING1("CAlfBridge::HandleReorderWindowL, EAlfDSReorder: Wimpautettu: %d ", ordinalPosition);                                        
+			//RDebug::Print(_L("CAlfBridge::HandleReorderWindowL, EAlfDSReorder: Last total pos: %d "), iDisplay->Roster().Count() - 1);                                        
+			#endif
+			
+			if (ordinalPosition < -1)
+				{
+				ordinalPosition = -1; // show at top ?    
+				}
+			
+			if (iAlfScreens[screenNumber]->iDisplay && controlGroup)
+				{
+				ShowControlGroupL(iAlfScreens[screenNumber]->iDisplay->Roster(), *controlGroup, ordinalPosition, screenNumber); 
+				}
+			else
+				{
+				__ALFLOGSTRING2("CAlfBridge::HandleReorderWindowL, EAlfDSReorder: Control group not found! Screen: %d, Id: %d ", screenNumber, windowNodeId );        
+				}
+			
+			ReorderAlfControlGroupsL(screenNumber);                                        
+			break;    
+			}
+		case EAlfWinTreeNodeClient:
+		case EAlfWinTreeNodeRoot:
+		case EAlfWinTreeNodeAnim:
+		case EAlfWinTreeNodeSprite:                            
+		case EAlfWinTreeNodeFloatingSprite:
+		case EAlfWinTreeNodeTextCursor:
+			{
+			
+			// fetch visual
+			CHuiLayout* layout = NULL;
+			CHuiVisual* viz = FindVisual(windowNodeId);
+			if (viz)
+				{
+#ifdef HUI_DEBUG_TRACK_DRAWING
+                                if ( viz->Tracking() )
+                                    {
+                                    __ALFLOGSTRING("CAlfBridge::HandleReorderWindowL - Tracked visual");
+                                    }
+#endif
+				layout = viz->Layout();
+				__ALFLOGSTRING3("CAlfBridge::HandleReorderWindowL, EAlfDSReorder: Id: %d, position %d, layout count %d", windowNodeId, windowAttributes->iOrdinalPosition, layout->Count() );
+				TInt pos = windowAttributes->iOrdinalPosition;
+				TInt layoutCount = layout->Count();
+				
+				if (windowAttributes->iOrdinalPosition > layoutCount - 1 )
+					{
+					__ALFLOGSTRING("CAlfBridge::HandleReorderWindowL, EAlfDSReorder: Illegal visual index !");                                            
+					pos = layoutCount - 1; // FixMe !!!
+					}
+
+				pos = layoutCount - pos - 1;    
+				layout->Reorder(*viz, pos);
+				}
+			else
+				{
+				__ALFLOGSTRING2("CAlfBridge::HandleReorderWindowL, EAlfDSReorder: Visual not found! Screen: %d, Id: %d ", screenNumber, windowNodeId );    
+				}                       
+			break;
+			}
+		default:
+			{
+			__ALFLOGSTRING("CAlfBridge::HandleReorderWindowL: Unknown window node type received !");    
+			break;
+			}
+		}
+  
+	iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(ETrue); // TODO: Check if really changed   
+	}
+
+// ---------------------------------------------------------------------------
+// HandlePostCanvasBufferL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandlePostCanvasBufferL( TAlfBridgerData& aData )
+	{
+	TInt windowGroupNodeId = aData.iInt1;
+	TInt windowNodeId = aData.iInt2;
+	TAlfWindowCommandBufferAttributes* bufferAttributes = (TAlfWindowCommandBufferAttributes*)(*iHost)->GetVarDataL( (TInt)aData.iPtr );
+	TInt screenNumber = bufferAttributes->iScreenNumber;
+
+	CHuiCanvasVisual* viz = (CHuiCanvasVisual*)FindVisual(windowNodeId);
+	
+	// For now we omit drawing commands to ALF window group because in some configurations it causes issues
+	// TODO: Possible viz->Flags() & EHuiVisualFlagDrawAf.. is not needed anymore. To be checked. Currently this enables floating sprites on the "root visual"
+	if (viz && iAlfWindowGroupNodeId != windowGroupNodeId
+	        ||  ( viz && viz->Flags() & EHuiVisualFlagDrawAfterOthers )/* THIS LINE IS HACK FOR DRAWING FLOATING SPRITES */ )
+		{
+#ifdef HUI_DEBUG_TRACK_DRAWING
+        TBool tracking( EFalse );
+	CHuiControlGroup* controlGroup = FindControlGroup( windowGroupNodeId, screenNumber );
+	CAlfScreen* screen = iAlfScreens[screenNumber];
+	
+	//TInt clientWindowGroupId = FindClientWindowGroupId( screenNumber, *controlGroup );
+	// NOTE, THE FOLLOWING WServClientFileName MAY CAUSE DEADLOCK. 
+	// THIS DOES NOT HAPPEN IF HUI_DEBUG_TRACK_DRAWING IS NOT ENABLED (DEFAULT)
+	TFileName processName;/* = iCommandDebug->WServClientFileName( clientWindowGroupId, CHuiStatic::WsSession() );
+	
+	if ( viz->Tracking() || 
+	        ( processName.Length() > 0 && iCommandDebug->TrackProcess( (HBufC16*)processName.Ptr() ) ) )
+            {
+            tracking = ETrue; 
+            }*/
+#endif
+		// Now when we receive actual drawing commands, we can set the window as opaque (unless the flags say it isn't opaque).		
+	    if (bufferAttributes->iWindowNodeFlags & EAlfWinNodeFlagOpaque)
+			{
+			viz->SetFlag(EHuiVisualFlagOpaqueHint); 
+			}
+	    
+	    if (!viz->HasCommandBuffers(EFalse))
+	        {
+            // For performance resons, only set visual tree changed if this 
+            // was the first buffer for the window. 
+	        iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(ETrue);
+	        }
+
+		TPtrC8 commands((TUint8*)bufferAttributes->iBuffer, bufferAttributes->iBufferLength);
+		if ( bufferAttributes->iEmptyThisBuffer )
+			{
+			viz->ClearCommandSet();
+			}
+		// If tracking has been enabled for this CHuiCanvasVisual object, the buffers will be marked for tracking aswell in CHuiCanvasVisual
+		switch( bufferAttributes->iPartStatus )
+			{
+			case TAlfWindowCommandBufferAttributes::EPartComplete:
+				{
+				viz->AddCommandSetL( commands );
+#ifdef HUI_DEBUG_TRACK_DRAWING
+				viz->SetTrackCommandSet( processName, tracking );
+#endif
+				break;
+				}
+			case TAlfWindowCommandBufferAttributes::ENotComplete: // ENotComplete part should be eventually followed by ELastPart
+				{
+				viz->AddPartialCommandSetL( commands, EFalse );
+				break;
+				}
+			case TAlfWindowCommandBufferAttributes::ELastPart:
+				{
+				viz->AddPartialCommandSetL( commands, ETrue );
+#ifdef HUI_DEBUG_TRACK_DRAWING
+                viz->SetTrackCommandSet( processName, tracking );
+#endif
+				break;
+				}
+			default:
+			    __ALFLOGSTRING("CAlfBridge::HandlePostCanvasBufferL, EAlfDSPostCanvasBuffer: Unknown iPartStatus !!!!");                                                         	
+				USER_INVARIANT();
+				break;
+			}
+		}
+	else
+		{
+		__ALFLOGSTRING3("CAlfBridge::HandlePostCanvasBufferL, EAlfDSPostCanvasBuffer: Visual not found! Screen: %d, Id: %d, GroupId: %d ", screenNumber, windowNodeId, windowGroupNodeId );                                 
+		}    
+	}
+
+// ---------------------------------------------------------------------------
+// SetWindowActiveL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::SetWindowActiveL(CHuiVisual* aVisual, TBool aActive)
+    {
+    if (!HasActiveEffect(aVisual))
+        {
+        // Does not have effect
+        if (aActive)
+            {
+            aVisual->ClearFlags(EHuiVisualFlagShouldBeHidden | EHuiVisualFlagShouldBeShown);
+            aVisual->iOpacity.Set(KAlfVisualDefaultOpacity);
+            }
+        else
+            {
+            aVisual->ClearFlags(EHuiVisualFlagShouldBeShown | EHuiVisualFlagShouldBeHidden);
+            aVisual->iOpacity.Set(0.0f);
+            }
+        }
+    else
+        {
+        // Has effect
+		// these flags are put to action in RemoveTemporaryPresenterItem
+        if (aActive)
+            {
+			// this prevents windows appearing before their "effected" time
+            aVisual->SetFlag(EHuiVisualFlagShouldBeShown);
+            aVisual->ClearFlag(EHuiVisualFlagShouldBeHidden);
+            }
+        else
+            {
+			// this prevents windows disappearing before their effect has finished
+            aVisual->SetFlag(EHuiVisualFlagShouldBeHidden);
+            aVisual->ClearFlag(EHuiVisualFlagShouldBeShown);
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// HandleSetWindowActiveL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleSetWindowActiveL( TAlfBridgerData& aData )
+	{
+	TInt windowGroupNodeId = aData.iInt1;
+	TInt windowNodeId = aData.iInt2;
+	TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*)(*iHost)->GetVarDataL( (TInt)aData.iPtr );
+	TInt screenNumber = windowAttributes->iScreenNumber;
+
+    if (windowAttributes->iWindowNodeType == EAlfWinTreeNodeTextCursor && iCursorTimer)
+	    {
+		if (!windowAttributes->iActive)
+		    {
+		    iCursorTimer->Cancel();
+		    }
+        else
+            {
+            SetCursorTimerL(); // continue with set interwal
+            }   
+		}
+
+
+	switch (windowAttributes->iWindowNodeType)
+		{
+		case EAlfWinTreeNodeGroup:
+			{
+			CHuiControlGroup* controlGroup = FindControlGroup(windowGroupNodeId,screenNumber);
+			if (controlGroup)
+				{
+				CHuiControl& control = controlGroup->Control(0);
+				CHuiLayout* layout = (CHuiLayout*)&control.Visual(0);
+                // Uses opacity for now
+                SetWindowActiveL(layout, windowAttributes->iActive);
+                }
+            else
+                {
+				__ALFLOGSTRING("CAlfBridge::HandleSetWindowActiveL, EAlfDSSetWindowActive: EAlfWinTreeNodeGroup not found!");         
+				}    
+			break;    
+			}
+		case EAlfWinTreeNodeClient:
+		case EAlfWinTreeNodeRoot:
+		case EAlfWinTreeNodeAnim:
+		case EAlfWinTreeNodeSprite:                            
+		case EAlfWinTreeNodeFloatingSprite:
+		case EAlfWinTreeNodeTextCursor:
+			{                                                        
+			CHuiVisual* viz = FindVisual(windowNodeId);
+			if (viz)
+				{
+#ifdef HUI_DEBUG_TRACK_DRAWING
+                if ( viz->Tracking() )
+                   {
+                   RDebug::Print(_L("CAlfBridge::HandleSetWindowActiveL - Tracked visual"));
+                   }
+#endif
+				// Uses opacity for now                            
+                SetWindowActiveL(viz, windowAttributes->iActive);
+                }
+			else
+				{
+				__ALFLOGSTRING("CAlfBridge::HandleSetWindowActiveL, EAlfDSSetWindowActive: Visual not found!");     
+				}    
+			break;
+			}
+		default:
+			{
+			__ALFLOGSTRING("CAlfBridge::HandleSetWindowActiveL, EAlfDSSetWindowActive: Unknown iWindowNodeType!");                                                         	
+			USER_INVARIANT();
+			break;                       	        
+			}
+		}
+    iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(ETrue);	// TODO: Check if really changed                       
+	}
+
+
+// ---------------------------------------------------------------------------
+// HandleSetWindowFlagL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleSetWindowFlagL( TAlfBridgerData& aData, TInt aOp )
+    {
+    TInt windowGroupNodeId = aData.iInt1;
+    TInt windowNodeId = aData.iInt2;
+    TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*)(*iHost)->GetVarDataL( (TInt)aData.iPtr );
+    TInt screenNumber = windowAttributes->iScreenNumber;
+    TInt windowFlag = windowAttributes->iActive;
+    THuiVisualFlags visualFlag = (THuiVisualFlags)0;
+    switch(windowFlag)
+        {
+        case TAlfWindowData::EShouldInactivate:
+            {
+            visualFlag = EHuiVisualFlagShouldBeHidden;
+            break;
+            }
+        case TAlfWindowData::EShouldDestroy:
+            {
+            visualFlag = EHuiVisualFlagShouldDestroy;
+            break;
+            }
+        default:;
+        }
+    
+    switch (windowAttributes->iWindowNodeType)
+        {
+        case EAlfWinTreeNodeGroup:
+            {
+            CHuiControlGroup* controlGroup = FindControlGroup(windowGroupNodeId,screenNumber);
+            if (controlGroup)
+                {
+                CHuiControl& control = controlGroup->Control(0);
+                CHuiLayout* layout = (CHuiLayout*)&control.Visual(0);
+                // Uses opacity for now                            
+                if (aOp == EAlfDSSetWindowFlag)
+                    {
+                    layout->SetFlag(visualFlag);
+                    }
+                else
+                    {
+                    layout->ClearFlag(visualFlag);
+                    } 
+                }
+            else
+                {
+                __ALFLOGSTRING("CAlfBridge::HandleSetWindowActiveL, EAlfDSSetWindowActive: EAlfWinTreeNodeGroup not found!");         
+                }    
+            break;    
+            }
+        case EAlfWinTreeNodeClient:
+        case EAlfWinTreeNodeRoot:
+        case EAlfWinTreeNodeAnim:
+        case EAlfWinTreeNodeSprite:                            
+        case EAlfWinTreeNodeFloatingSprite:
+        case EAlfWinTreeNodeTextCursor:
+            {                                                        
+            CHuiVisual* viz = FindVisual(windowNodeId);
+            if (viz)
+                {
+                if (aOp == EAlfDSSetWindowFlag)
+                    {
+                    viz->SetFlag(visualFlag);
+                    if (visualFlag == EHuiVisualFlagShouldDestroy )
+                        {
+                        if (windowAttributes->iWindowNodeType == EAlfWinTreeNodeTextCursor && iCursorTimer)
+                            {
+                            iCursorTimer->Cancel();
+                            }        
+                        RemoveVisual(windowNodeId); // Only the effect will have pointer to this visual from here on
+                        }
+                    }
+                else
+                    {
+                    viz->ClearFlag(visualFlag);
+                    }
+                }
+            else
+                {
+                __ALFLOGSTRING("CAlfBridge::HandleSetWindowFlagL, HandleSetWindowFlagL: Visual not found!");     
+                }    
+            break;
+            }
+        default:
+            {
+            __ALFLOGSTRING("CAlfBridge::HandleSetWindowFlagL, HandleSetWindowFlagL: Unknown iWindowNodeType!");                                                          
+            USER_INVARIANT();
+            break;                                  
+            }
+        }
+    iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(ETrue); // TODO: Check if really changed                       
+    }
+
+// ---------------------------------------------------------------------------
+// InsertImageBrushL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::InsertImageBrushL(CHuiVisual& aVisual, TInt aBitmapHandle)
+    {
+    // NOTE: We wssume that image brush is always the only brush
+    CHuiTexture* texture = CHuiTexture::NewL();
+    CleanupStack::PushL(texture);
+    THuiImage image(*texture);	        				        				    
+    CHuiImageBrush* imageBrush = CHuiImageBrush::NewL(image);				            				        
+    imageBrush->SetLayer(EHuiBrushLayerForeground);
+    CleanupStack::Pop(texture);
+
+    aVisual.EnableBrushesL(ETrue);
+    aVisual.Brushes()->InsertL(0, imageBrush, EHuiHasOwnership);    				        				            
+    
+    UpdateImageBrushL(aVisual, aBitmapHandle);
+    }
+
+// ---------------------------------------------------------------------------
+// UpdateImageBrushL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::UpdateImageBrushL(CHuiVisual& aVisual, TInt aBitmapHandle)
+    {
+    // NOTE: We wssume that image brush is always the only brush with EImageBrush type
+    const TInt KAlfCanvasVisualImageBrushIndex = 0;    
+
+	if (aVisual.Brushes() && aVisual.Brushes()->BrushWithTypeCount(CHuiBrush::EImageBrush))
+	    {    				            
+        CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
+        CleanupStack::PushL(bitmap);
+        bitmap->Duplicate(aBitmapHandle);
+
+	    CHuiImageBrush* imageBrush = (CHuiImageBrush*) aVisual.Brushes()->BrushWithTypeAt(CHuiBrush::EImageBrush, KAlfCanvasVisualImageBrushIndex);    	    	    
+	    CHuiTexture* texture = (CHuiTexture*) &imageBrush->Image().Texture();            
+        
+        // Use of direct upload here would give much better performance, but is
+        // it too risky ? 
+        texture->UploadL(*bitmap, NULL);
+        imageBrush->SetChanged();
+
+        CleanupStack::PopAndDestroy(bitmap);    				                
+	    }
+    }
+
+// ---------------------------------------------------------------------------
+// RemoveImageBrushL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::RemoveImageBrushL(CHuiVisual& aVisual)
+    {
+    // NOTE: We wssume that image brush is always the only brush with EImageBrush type
+    const TInt KAlfCanvasVisualImageBrushIndex = 0;
+    
+    if (aVisual.Brushes() && aVisual.Brushes()->BrushWithTypeCount(CHuiBrush::EImageBrush))
+        {
+	    CHuiImageBrush* imageBrush = (CHuiImageBrush*) aVisual.Brushes()->BrushWithTypeAt(CHuiBrush::EImageBrush, KAlfCanvasVisualImageBrushIndex);    
+        CHuiTexture* texture = (CHuiTexture*) &imageBrush->Image().Texture();
+	    THuiImage image;
+        imageBrush->SetImage(image);
+        delete texture;
+        }
+    
+    if (aVisual.Brushes())
+        {
+        aVisual.EnableBrushesL(EFalse);				                
+        }            
+    }
+
+
+// ---------------------------------------------------------------------------
+// HandleSetSurfaceExtentL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleSetSurfaceExtentL( TAlfBridgerData& aData )
+	{
+	TInt windowGroupNodeId = aData.iInt1;
+	TInt windowNodeId = aData.iInt2;
+	TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*)(*iHost)->GetVarDataL( (TInt)aData.iPtr );
+	TInt screenNumber = windowAttributes->iScreenNumber;
+	// fetch visual
+	CHuiCanvasVisual* viz = FindVisual(windowNodeId);
+
+    // We should not do this for alf window, but renderstage does not know if it is
+    // handling alf window or other window, so we ignore the request here if needed.
+    // TODO: When alf apps work in multiple display, check here for every displays alf groups...
+	if (viz && iAlfWindowGroupNodeId != windowGroupNodeId)
+		{
+        viz->SetLayerExtent(windowAttributes->iSurfaceExtent);
+		// Set surface extend area to be cleared with fully transparent color
+		// Note: does not support extend that is bigger that the visual
+		// if surface extent is (0,0,0,0) then the background item array is reseted 
+		// and surface extent will not be cleared.	
+		if (windowAttributes->iSurfaceExtent != TRect())
+			{
+			// Set surface extend area to be cleared with fully transparent color
+			// Note: does not support extend that is bigger that the visual
+			TRgb fullyTransparentColor(255,0,0,0); // Red but fully transparent. Red color component has been set only for debug purposes, it is not visible.
+			viz->SetClearBackground(CHuiDisplay::EClearWithColor);
+			viz->SetBackgroundColor(fullyTransparentColor);
+			}
+		else
+			{
+			viz->SetClearBackground(CHuiDisplay::EClearNone);
+			}		
+		}
+	else
+		{
+		if (iAlfWindowGroupNodeId != windowGroupNodeId)
+		    __ALFLOGSTRING("CAlfBridge::HandleSetSurfaceExtentL, EAlfDSSetSurfaceExtent: Visual not found!");    
+		}                            
+    iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(ETrue); // TODO: Check if really changed   
+	}
+
+// ---------------------------------------------------------------------------
+// HandleLayerUsesAlphaFlagChanged
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleLayerUsesAlphaFlagChanged( TAlfBridgerData& aData )
+    {
+    TInt windowGroupNodeId = aData.iInt1;
+    TInt windowNodeId = aData.iInt2;
+    TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*)(*iHost)->GetVarDataL( (TInt)aData.iPtr );
+    TInt screenNumber = windowAttributes->iScreenNumber;
+    
+    // fetch visual
+    CHuiCanvasVisual* viz = (CHuiCanvasVisual*)FindVisual(windowNodeId);
+
+    // We should not do this for alf window, but renderstage does not know if it is
+    // handling alf window or other window, so we ignore the request here if needed.
+    // TODO: When alf apps work in multiple display, check here for every displays alf groups...
+    if (viz && iAlfWindowGroupNodeId != windowGroupNodeId)
+        {
+        viz->SetLayerUsesAlphaFlag(windowAttributes->iLayerUsesAlphaFlagEnabled);
+        }
+    else
+        {
+        if (iAlfWindowGroupNodeId != windowGroupNodeId)
+            __ALFLOGSTRING("CAlfBridge::HandleLayerUsesAlphaFlagChanged: Visual not found!");    
+        }                            
+    iAlfScreens[screenNumber]->SetVisualTreeVisibilityChanged(ETrue); // TODO: Check if really changed   
+    }
+
+
+// ---------------------------------------------------------------------------
+// HandleGetNativeWindowDataL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleGetNativeWindowDataL( TAlfBridgerData& aData )
+	{
+	// Get the data from original Render Stage message
+	RMessage2* rsMessage = (RMessage2*)aData.iInt1;
+	TAlfNativeWindowData winData;
+	TPckg<TAlfNativeWindowData> winDataPckg(winData);
+	rsMessage->Read(0, winDataPckg);
+
+	if(winData.iScreenNumber == 0)
+		{
+		// primary screen
+		CHuiDisplay& disp = iHuiEnv->PrimaryDisplay();
+		if (disp.NativeWindow())
+			{
+			winData.iAlfWindowHandle = disp.NativeWindow()->ClientHandle();                    
+			winData.iAlfWindowGrpId = disp.NativeWindow()->WindowGroupId();	
+			}
+		}
+	else
+		{
+		// other than primary screen 
+		for (TInt i = 1; i < iAlfScreens.Count(); i++)
+			{
+			if (iAlfScreens[i]->iScreenNum == winData.iScreenNumber)
+				{
+				RDrawableWindow* win = iAlfScreens[i]->iCoeControl->DrawableWindow();
+				winData.iAlfWindowHandle = win->ClientHandle();
+				winData.iAlfWindowGrpId = win->WindowGroupId();
+				}
+			}
+		}
+
+	// write result	
+	rsMessage->Write(0, winDataPckg);
+
+	if (winData.iAlfWindowHandle == 0)
+		{
+		__ALFLOGSTRING("CAlfBridge::HandleGetNativeWindowDataL, EAlfDSGetAlfNativeWindowData. Error: window data not found!");    
+		}
+	}
+
+
+void CAlfBridge::PrepareFadeEffects( CHuiCanvasVisual& aVisual )
+    {
+    TBool faded = aVisual.CanvasFlags() & EHuiCanvasFlagExternalFade;     
+    if (faded)
+        {
+        if (IsFadedByParent( aVisual ))
+            {            
+            // Faded by parent
+            aVisual.SetCanvasFlags(EHuiCanvasFlagExternalFadeByParent);
+
+            // Faded by parent, include to parent effect
+            aVisual.ClearCanvasFlags(EHuiCanvasFlagExcludeFromParentEffect);            
+
+            // Does not fade own children because parent already does that.
+            aVisual.ClearCanvasFlags(EHuiCanvasFlagExternalFadeToChildren);
+            }
+        else
+            {
+            //  Not faded by parent 
+            aVisual.ClearCanvasFlags(EHuiCanvasFlagExternalFadeByParent);
+
+            // Not faded by parent, exclude from parent effect
+            aVisual.SetCanvasFlags(EHuiCanvasFlagExcludeFromParentEffect);                
+
+            // Does (or does not) fade own children if it can. 
+            if (CanFadeChildren(aVisual))
+                {
+                aVisual.SetCanvasFlags(EHuiCanvasFlagExternalFadeToChildren);
+                }
+            else
+                {
+                aVisual.ClearCanvasFlags(EHuiCanvasFlagExternalFadeToChildren);
+                }
+            }
+        }
+    else
+        {
+        // Not faded 
+        aVisual.ClearCanvasFlags(EHuiCanvasFlagExternalFadeByParent);
+
+        if (IsNearestParentEffectFade( aVisual ))
+            {
+            // Exclude from parent effect to avoid getting faded by parent.
+            aVisual.SetCanvasFlags(EHuiCanvasFlagExcludeFromParentEffect);
+            }
+        else
+            {
+            // By default included into parent effects.  
+            aVisual.ClearCanvasFlags(EHuiCanvasFlagExcludeFromParentEffect);
+            }
+        
+        // Does not fade own children because it is not faded itself. 
+        aVisual.ClearCanvasFlags(EHuiCanvasFlagExternalFadeToChildren);
+        }
+
+    // Handle children
+    TInt count = aVisual.Count();
+    for (TInt i=0; i<count; i++)
+        {
+        CHuiCanvasVisual* child = (CHuiCanvasVisual*) (&aVisual.Visual(i));                        
+        PrepareFadeEffects(*child);        
+        }    
+    }
+
+TBool CAlfBridge::LoadFadeEffectsL( CHuiCanvasVisual& aVisual )
+    {
+    TBool fadeEffectLoadedInsideTree = EFalse;
+    
+    // Load fade effect (or remove existing)
+    fadeEffectLoadedInsideTree |= SetupFadeEffectL(aVisual);
+    
+    // Handle children
+    TInt count = aVisual.Count();
+    for (TInt i=0; i<count; i++)
+        {
+        CHuiCanvasVisual* child = (CHuiCanvasVisual*) (&aVisual.Visual(i));                        
+        fadeEffectLoadedInsideTree |= LoadFadeEffectsL(*child);        
+        }
+    
+    return fadeEffectLoadedInsideTree;
+    }
+
+
+TBool CAlfBridge::CanFadeChildren( CHuiCanvasVisual& aParent )
+    {
+    // NOTE! This function is not yet implemented optimally !!!! 
+    //       Below is some initial description how it could behave, but even that has some downsides. 
+    //       Ultimate solution which would implement legacy symbian fading functionality and
+    //       on the other hand fully effectable solution needs to be developed at some point.
+    //        
+    //
+    // This function shold determine wheter we can fade whole visual tree starting from aParent with just
+    // one fade effect. Even if visual tree has non-fading windows, it is possible to use tree fading
+    // in some cases where children can be excluded from parent visual effects using EHuiCanvasFlagExcludeFromParentEffect
+    // flag. However it changes drawing order of the childern (visuals with EHuiCanvasFlagExcludeFromParentEffect
+    // are drawn after other children) so it cannot be used in those cases without side-effect.
+    //    
+    //
+    //  V1 = Visual 1, parent of Visual 2 etc. Index number refers to order how visuals are drawn.
+    // (f) = Visal is faded 
+    //
+    // Example scenario 1) CanFadeChildren(V1) (YES) 
+    //                     CanFadeChildren(V2) (YES) (Can fade because faded child is drawn first, but no need because parent can fade as well)
+    //
+    //       V4     V3(f)
+    //         \    /
+    //          \  /
+    //   V5(f)   V2(f)
+    //     \    /
+    //      \  /    
+    //       V1(f)
+    //
+    // Example Scenario 2) CanFadeChildren(V1) (NO) (Cant fade because nonfading grandchild draw before faded)
+    //                     CanFadeChildren(V2) (NO) (Can't fade children because non-faded child is drawn first)
+    //               
+    //       V4(f)   V3                     
+    //         \    /                       
+    //          \  /
+    //   V5(f)   V2(f)
+    //     \    /
+    //      \  /    
+    //       V1(f)
+    //
+    // Example scenario 3) CanFadeChildren(V1) (YES) (Can fade because faded child (V2) is drawn first)
+    //                     CanFadeChildren(V2) (YES) (Can fade because all children are faded, but no need because parent can fade as well)
+    //               
+    //       V4(f)   V3(f)
+    //         \    /
+    //          \  /
+    //   V5     V2(f)
+    //     \    /
+    //      \  /    
+    //       V1(f)
+    //
+    // Scenario 4) CanFadeChildren(V1) (NO) (Can't fade because non-faded child is drawn first)
+    //             CanFadeChildren(V2) (NO) (It would be YES, but V2 it self is not faded -> NO)
+    //               
+    //       V4(f)   V3(f)
+    //         \    /
+    //          \  /
+    //   V5(f)   V2
+    //     \    /
+    //      \  /    
+    //       V1(f)
+    //
+    // Scenario 5) CanFadeChildren(V1) (NO) (Can't fade because non-faded child is drawn first)
+    //             CanFadeChildren(V2) (NO) (Can't fade children because it does not have children)
+    //             CanFadeChildren(V3) (YES) (All children are faded)
+    //               
+    //       V4(f)   V4(f)
+    //         \    /
+    //          \  /
+    //           V3(f)  V2
+    //            \    /
+    //             \  /    
+    //             V1(f)
+    //
+    //
+    // TODO: Real implementation for algorithm which takes into account the order of non-fading and
+    //       fading children. Current implentation has side-effect where drawing order of non-fading
+    //       children may get altered. But on the other hand without visual treefader (i.e each visual 
+    //       faded with separate effects) there still exists a potential problem with faded transparent 
+    //       windows above faded windows (double fade)!
+    //
+    
+    // For now this function just checks if there are children to be faded... 
+    return HasActiveFadedChildren( aParent ); 
+    }
+    
+
+TInt CAlfBridge::RecursiveChildCount( CHuiCanvasVisual& aParent, TInt aCanvasFlags )
+    {
+    TInt childCount = 0;
+    TInt count = aParent.Count();
+    for (TInt i=0; i<count; i++)
+        {
+        CHuiCanvasVisual* child = (CHuiCanvasVisual*) (&aParent.Visual(i));        
+        if (aCanvasFlags)
+            {
+            if (child->CanvasFlags() & aCanvasFlags)
+                {
+                childCount++;
+                }
+            }
+        else
+            {            
+            childCount++;
+            }
+        childCount += RecursiveChildCount( *child, aCanvasFlags );        
+        }
+    return childCount;
+    }
+
+TBool CAlfBridge::IsNearestParentEffectFade( CHuiCanvasVisual& aVisual )
+    {
+    TBool nearestParentEffectFade = EFalse;
+    CHuiCanvasVisual* parent = (CHuiCanvasVisual*) (aVisual.Layout()); 
+    while (parent)
+        {
+        if (parent->Effect())
+            {
+            nearestParentEffectFade |= (parent->Effect() && (parent->Effect()->EffectFlags() & KHuiFadeEffectFlag));    
+            return nearestParentEffectFade;            
+            }        
+        parent = (CHuiCanvasVisual*) (parent->Layout());
+        }
+    return EFalse;
+    }
+
+
+TBool CAlfBridge::IsFadedByParent( CHuiCanvasVisual& aVisual )
+    {
+    CHuiCanvasVisual* parent = (CHuiCanvasVisual*) (aVisual.Layout()); 
+    while (parent)
+        {
+        TInt flags = parent->CanvasFlags();
+        if ((flags & EHuiCanvasFlagExternalFade) && (flags & EHuiCanvasFlagExternalFadeToChildren))
+            {
+            return ETrue;
+            }        
+        parent = (CHuiCanvasVisual*) (parent->Layout());
+        }
+    return EFalse;
+    }
+
+TBool CAlfBridge::HasActivePaintedAreas( CHuiCanvasVisual& aVisual, TBool aIncludeChildren )
+    {
+    TBool visualHasPaintedAreas = aVisual.PaintedAreaCount() > 0;         
+    if (!visualHasPaintedAreas && aIncludeChildren)
+        {
+        TInt count = aVisual.Count();        
+        for (TInt i=0; i<count; i++)
+            {
+            CHuiCanvasVisual* child = (CHuiCanvasVisual*) (&aVisual.Visual(i)); 
+            TBool childIsActive = !(child->Flags() & EHuiVisualFlagInactive);            
+            if (childIsActive && child->PaintedAreaCount())
+                {
+                visualHasPaintedAreas = ETrue;
+                break;
+                }        
+            }    
+        }
+    return visualHasPaintedAreas;
+    }
+
+TBool CAlfBridge::HasActiveFadedChildren( CHuiCanvasVisual& aVisual )
+    {
+    TBool has = EFalse;
+    TInt count = aVisual.Count();        
+    for (TInt i=0; i<count; i++)
+        {
+        CHuiCanvasVisual* child = (CHuiCanvasVisual*) (&aVisual.Visual(i)); 
+        TBool active = !(child->Flags() & EHuiVisualFlagInactive);            
+        TBool faded = child->CanvasFlags() & EHuiCanvasFlagExternalFade; 
+        
+        if (active && faded && child->PaintedAreaCount())
+            {
+            has = ETrue;
+            break;
+            }        
+        }    
+    return has;
+    }
+
+
+// ---------------------------------------------------------------------------
+// SetupFadeEffectL
+//
+// NOTE: This method gets called very often, so we should not do anything time
+//       consuming here (unless we really need to).
+//
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfBridge::SetupFadeEffectL( CHuiCanvasVisual& aVisual )
+    {
+    TBool didFadeEffectLoad = EFalse;
+    
+    TBool faded = (aVisual.CanvasFlags() & EHuiCanvasFlagExternalFade);
+
+    // Just in case, check if we are alrady faded to avoid unnecassary effect loadings.
+    TBool alreadyFaded = aVisual.Effect() && (aVisual.Effect()->EffectFlags() & KHuiFadeEffectFlag);
+        
+    TBool fadesChildren = EFalse; 
+    
+    if (faded)
+        {                
+        fadesChildren = (aVisual.CanvasFlags() & EHuiCanvasFlagExternalFadeToChildren);
+        
+        // Inactive visuals are not faded.
+        TBool visualIsActive = !(aVisual.Flags() & EHuiVisualFlagInactive);
+        
+        // Avoid interrupting other effects. 
+        TBool otherEffectActive = aVisual.Effect() && !(aVisual.Effect()->EffectFlags() & KHuiFadeEffectFlag);
+
+        // Check if we really need to fade. Note the order of if-conditions, fastest checks first to optimize performance.
+        if (visualIsActive && !alreadyFaded && !otherEffectActive && !IsFadedByParent(aVisual) && HasActivePaintedAreas(aVisual, fadesChildren))
+        	{        
+        	CHuiFxEffect* effect = NULL;
+        	CHuiFxEngine* engine = iHuiEnv->EffectsEngine();
+
+            if (engine && iFadeEffectFile )
+                {
+                 __ALFLOGSTRING1( ">> Using cached fade effect file name: %S", iFadeEffectFile );
+                TInt err = 0;
+                // CHuiFxParser sets the effect to visual if loading succeeds.
+                TInt effectFlags = 0;
+                effectFlags |= KHuiFadeEffectFlag;
+                effectFlags |= KHuiFxEffectDisableMarginsFlag; // Margins cannot safely be used in fade usecase, artefacts may appear depending on window location in window tree        			                    
+
+                // For top level canvas visuals (window group visuals) disable background for 
+                // performance reasons (in case canvas visual is not opaque).
+                if (!aVisual.Layout())
+                    {
+                    effectFlags |= KHuiFxDisableBackground;
+                    }
+
+                if (fadesChildren)
+                    {
+                    /*
+                     TInt children = RecursiveChildCount( aVisual, 0 );
+                     TInt faded = RecursiveChildCount( aVisual, EHuiCanvasFlagExternalFade );
+                     TInt fadedbyparent = RecursiveChildCount( aVisual, EHuiCanvasFlagExternalFadeByParent );
+                     TInt excludedfromparenteffect = RecursiveChildCount( aVisual, EHuiCanvasFlagExcludeFromParentEffect );
+                     RDebug::Print(_L("CAlfBridge::SetupFadeEffectL - faded parent has %i children"), children);
+                     RDebug::Print(_L("CAlfBridge::SetupFadeEffectL - faded parent has %i faded children"), faded);
+                     RDebug::Print(_L("CAlfBridge::SetupFadeEffectL - faded parent fades %i children"), fadedbyparent);
+                     RDebug::Print(_L("CAlfBridge::SetupFadeEffectL - faded parent has %i children which are excluded from parent fx"), excludedfromparenteffect);
+                     */
+                    }
+                else
+                    {
+                    // All children in the tree are not faded, do not apply effect on children.
+                    effectFlags |= KHuiFxEffectExcludeChildrenFlag;
+                    //RDebug::Print(_L("CAlfBridge::SetupFadeEffectL - no children faded by parent"));
+                    }
+                TRAP( err, engine->LoadEffectL(*iFadeEffectFile, effect, aVisual.Effectable(), NULL, NULL, 0, effectFlags ) );
+                didFadeEffectLoad = ETrue;
+        		}
+        	}
+        }
+    else
+        {
+        // remove only an old fade effect, leave any others intact
+        if (alreadyFaded)
+            {
+            aVisual.SetEffect( NULL );
+            alreadyFaded = EFalse;
+            }
+        }
+    
+    // If we did load and fade children we must re-prepare the flags again
+    // Maybe there is more elegant way to avoid this. 
+    if (didFadeEffectLoad && fadesChildren)
+        {
+        PrepareFadeEffects( aVisual );
+        }
+    
+    return (didFadeEffectLoad || alreadyFaded);
+    }
+
+
+// ---------------------------------------------------------------------------
+// HandleSetFadeEffect
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleSetFadeEffectL( TAlfBridgerData& aData )
+    {
+    TInt windowNodeId = aData.iInt1;  
+    TBool faded = aData.iInt2;
+
+    CHuiVisual* viz = (CHuiVisual*)FindVisual(windowNodeId);    
+    if (!viz)
+        {
+        // Visual not found, it could be window group. It must be searched with other method.
+        CHuiControlGroup* cg = FindControlGroup(windowNodeId, 0); // TODO: Screen            
+        if (cg) 
+            {
+            CHuiControl& control = cg->Control(0);
+            viz = &control.Visual(0);
+            }        
+        }
+    
+    if ( viz )
+        {
+        CHuiCanvasVisual* canvasviz = (CHuiCanvasVisual*)viz;        
+        if (faded)
+            {
+            canvasviz->SetCanvasFlags(EHuiCanvasFlagExternalFade);
+            }
+        else
+            {
+            canvasviz->ClearCanvasFlags(EHuiCanvasFlagExternalFade);
+            }        
+        iAlfScreens[0]->SetVisualTreeVisibilityChanged(ETrue); // TODO: Screen 
+        }
+    }
+
+void CAlfBridge::HandleSetLayoutSwitchEffectL()
+    {
+    ClearCanvasVisualCommandSets(EFalse); 
+    iLayoutSwitchEffectCoordinator->BeginLayoutSwitch();
+    }
+
+TInt Blink(TAny* aVisual)
+    {
+    CHuiVisual* visual = (CHuiVisual*)aVisual;
+    if (visual->iOpacity.Now() > 0.01 ) // kind of an epsilon
+        {
+        visual->iOpacity.Set(0);
+        }
+    else
+        {
+        visual->iOpacity.Set(1);
+        }
+
+    return ETrue; // call me again
+    }                          
+    
+void CAlfBridge::SetCursorTimerL(TUint aTime, CHuiVisual* aCursor)
+    {
+    if (aTime)
+        {
+        iCursorInterval = aTime;
+        }
+        
+    if (aCursor)    
+        {
+        iCursorVisual = aCursor;
+        }   
+         
+    if (iCursorInterval && iCursorVisual)        
+        {
+        if (iCursorTimer)
+            {
+            iCursorTimer->Cancel();
+            }
+    
+        if (!iCursorTimer)
+            {
+            iCursorTimer = CPeriodic::NewL(CActive::EPriorityHigh);
+            }
+    
+        iCursorTimer->Start(iCursorInterval, iCursorInterval, TCallBack(Blink, aCursor));                
+        }
+    }        
+    
+// ---------------------------------------------------------------------------
+// HandleSetCursorDataL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::HandleSetCursorDataL( TAlfBridgerData& aData )
+    {
+    TInt windowNodeId = aData.iInt2;
+    
+    TAlfCursorDataBufferAttributes* windowAttributes = (TAlfCursorDataBufferAttributes*) (*iHost)->GetVarDataL( (TInt)aData.iPtr );
+    CHuiVisual* viz = (CHuiVisual*)FindVisual(windowNodeId);
+    if (viz)
+        {
+        viz->SetFlags(windowAttributes->iFlags);
+        SetCursorTimerL(windowAttributes->iFlashInterval, viz);
+        }
+    else
+        {
+        __ALFLOGSTRING1("CAlfBridge::HandleSetCursorDataL - WARNING! Cursor node 0x%x not found!", windowNodeId);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// HandleSetNodeTracking
+// ---------------------------------------------------------------------------
+// 
+#ifdef HUI_DEBUG_TRACK_DRAWING
+void CAlfBridge::HandleSetNodeTracking( TAlfBridgerData& aData )
+    {
+    TInt windowNodeId = aData.iInt1;
+    CHuiCanvasVisual* viz = (CHuiCanvasVisual*)FindVisual(windowNodeId);
+    if ( aData.iInt2 )
+        {
+        viz->SetTracking( aData.iInt2 );
+        }
+#else
+void CAlfBridge::HandleSetNodeTracking( TAlfBridgerData& )
+    {
+#endif
+    }
+	
+void RecursiveStoreRenderBufferL(CHuiVisual *aVisual)
+    {
+    CHuiCanvasVisual *canvasvisual = dynamic_cast<CHuiCanvasVisual*>(aVisual);
+    if (canvasvisual && canvasvisual->Layout()) 
+        {
+        canvasvisual->StoreRenderBufferL();
+        }
+
+    TInt c = aVisual->Count();
+    for(int i=0;i<c;i++)
+        {
+        CHuiVisual &vis = aVisual->Visual(i);
+        RecursiveStoreRenderBufferL(&vis);
+        }
+    }
+
+void StoreRenderBufferStartL(CHuiLayout *aLayout)
+    {
+    // assumes that the layout takes full screen area.
+    CHuiRenderPlugin& renderplugin = CHuiStatic::Renderer();
+    CHuiCanvasGc *canvasGc = renderplugin.CreateCanvasGcL();
+    CleanupStack::PushL(canvasGc);
+    
+    CHuiCanvasRenderBuffer *renderBuffer;
+    renderBuffer = canvasGc->CreateRenderBufferL(TSize(0,0));
+    CleanupStack::PushL(renderBuffer);
+    renderBuffer->InitializeL(CHuiStatic::Env().Display(0).VisibleArea().Size());
+    renderBuffer->Copy(TPoint(0,0));    
+    CleanupStack::Pop(renderBuffer);
+    aLayout->SetStoredRenderBuffer(renderBuffer); // moves ownership
+
+    CleanupStack::PopAndDestroy();
+    }
+TBool NeedsStoredBuffers(CHuiFxEngine *aEngine, const TDesC &aFileName)
+    {
+    return aEngine->FxmlUsesInput1(aFileName);
+    }
+	
+TBool CAlfBridge::HandleGfxEventL(CFullScreenEffectState& aEvent, CHuiLayout* aToLayout, CHuiLayout *aFromLayout)
+    {
+    TInt err = KErrNone;
+    TBool failed = EFalse;
+    
+    // Check if there is an effects engine in HuiEnv
+    CHuiFxEffect* effect = NULL;
+    // We need to pass the filenamerta from the transeffect plugin that handles the controls
+    // that define which effect is used for the selected skin or the selected application
+    // For full screen effects the skin should determine the effect, or there should be
+    // some default effects.
+    
+    CHuiFxEngine* engine = NULL;
+    // engine is not owned by us, it is a member of HuiEnv
+    engine = iHuiEnv->EffectsEngine();
+
+    if ( engine )
+        { 
+        switch(aEvent.iOperation)
+            {
+            case MAlfGfxEffectPlugin::EBeginFullscreen:
+                {
+                aToLayout->SetStoredRenderBufferModificationsEnabled(ETrue);
+                TBool needStoredBuffers = NeedsStoredBuffers(engine, *aEvent.iEffectName);
+                if (needStoredBuffers)
+                    {
+                    TRAP(err,StoreRenderBufferStartL(aToLayout));
+                    if (err == KErrNone)
+                        {
+                        aToLayout->SetFreezeState(ETrue);
+                        }
+                    else
+                        {
+                        return ETrue; // failed, effect will be canceled
+                        }
+                    }
+
+                switch(aEvent.iAction)
+                    {
+                    case AknTransEffect::EApplicationStart:
+                    case AknTransEffect::EApplicationStartRect:
+                        {
+                        aToLayout->iOpacity.Set(0.0f);    // these are meant for applications that yet dont have anything to show
+                        FreezeLayoutUntilEffectDestroyedL(aFromLayout, aEvent.iHandle);
+                        break;
+                        }
+                    case AknTransEffect::EApplicationStartSwitch:
+                    case AknTransEffect::EApplicationStartSwitchRect:
+                        {
+                        aToLayout->iOpacity.Set(0.0f);    // this is meant for applications that are in the background.
+                        FreezeLayoutUntilEffectDestroyedL(aFromLayout, aEvent.iHandle);
+                        break;
+                        }
+
+                    case AknTransEffect::EApplicationExit:
+                        {
+                        // The effect should start when the new view is ready,
+                        // but we have no signal telling us that, so we just have to do our best
+
+                        // Effect end observer is given to engine in LoadEffectL
+                        // It will be set to effect there and called when the effect ends or is deleted
+
+                        // The layout should be visible at this time. if not, then this is assumed
+                        // as effect to an background application and ignored.
+                        if (aToLayout->Effect())
+                            {
+                            // effect on a layout must be an application start effect. 
+                            // External content visual is not used for that.
+                            __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEventL - Found effect on layout 0x%x. Removing effect 0x%x", aToLayout, aToLayout->Effect());
+                            aToLayout->SetEffect(NULL);
+                            }
+                        if (!(aToLayout->Flags() & EHuiVisualFlagInactive))
+                            {
+                            // this will tag the visual, that they cannot be hidden by HandleVisualVisibility
+                            // Initialize layout for the exit effect  
+                            iLayoutInitializedForExitEffect = SetupEffectLayoutContainerL(aEvent.iHandle, aToLayout, ETrue);
+                            aEvent.iSetupDone = iLayoutInitializedForExitEffect; 
+                            }
+                        else
+                            {
+                            iLayoutInitializedForExitEffect = EFalse;
+                            }
+                         return failed;
+                         }
+                    default:
+                        break;
+                    }
+                break;
+                }
+            case MAlfGfxEffectPlugin::EEndFullscreen:
+                {
+                TBool layoutEffectable(EFalse);
+                if (aEvent.iAction != 5000)
+                    {
+                    if ( aEvent.iAction != AknTransEffect::EApplicationExit && aToLayout->Flags() & EHuiVisualFlagInactive)
+                        {
+                        aToLayout->iOpacity.Set(1.0f);
+                        failed = ETrue;
+                        return failed;
+                        }
+                        
+                    if (aToLayout)
+                        {
+                        aToLayout->iOpacity.Set(1.0f);
+                        __ALFFXLOGSTRING1("HandleGfxEventL - loading effect, handle %d", aEvent.iHandle );
+                        if (aEvent.iAction == AknTransEffect::EApplicationExit)
+                            {
+                        	// Exit effect was initialized earlier with EBeginFullscreen event
+						    layoutEffectable = iLayoutInitializedForExitEffect;
+                            }
+                        else
+                        	{
+                            // add visuals to visual cleanupstack
+                            aToLayout->SetStoredRenderBufferModificationsEnabled(EFalse);
+                            layoutEffectable = SetupEffectLayoutContainerL(aEvent.iHandle,aToLayout, EFalse);
+                            aEvent.iSetupDone = layoutEffectable; 
+                            aToLayout->SetStoredRenderBufferModificationsEnabled(ETrue);
+                            }
+
+                        if (layoutEffectable)
+                            {
+                            if (aEvent.iRect != TRect())
+                                {
+                                TRAP( err, engine->LoadGroupEffectL( *aEvent.iEffectName, effect, aToLayout->Effectable(), engine->ActiveGroupEffect(), &aEvent.iRect, this, aEvent.iHandle ) );
+                                }
+                            else
+                                {
+                                TRAP( err, engine->LoadGroupEffectL( *aEvent.iEffectName, effect, aToLayout->Effectable(), engine->ActiveGroupEffect(), NULL, this, aEvent.iHandle ) );
+                                }
+                            effect = NULL;
+                            // only use the effect if the effect file was correctly parsed
+                            if (err != KErrNone)
+                                {
+                                // visuals added to "active effect visual" stack, but they wont be used, because effect loading has failed. cleanup.
+                                RemoveTemporaryPresenterVisual(NULL, aEvent.iHandle);
+                                aToLayout->SetEffect(NULL);
+                                failed = ETrue;
+                                }
+                            }
+                        else
+                            {
+                            failed = ETrue;                            
+                            __ALFFXLOGSTRING2("CAlfBridge::HandleGfxEventL - Effect layout initialization failed. Skipping effect handle: %d, Visual: 0x%x", aEvent.iHandle, aToLayout);
+                            }
+                        }
+                    }
+                break;
+                }
+            default:
+                {
+                // just in case...
+                break;
+                }
+            }
+        }
+    iLastAction = aEvent.iAction; // TODO: useless?
+    return failed;
+    }
+
+void CAlfBridge::FreezeLayoutUntilEffectDestroyedL(CHuiLayout* aLayout, TInt aHandle)
+    {
+    if (aLayout)
+        {
+		TRAPD(err, StoreRenderBufferStartL(aLayout));
+		if (err == KErrNone)
+			{
+            // Freeze only, if buffer was reserved succesfully 
+            aLayout->SetFreezeState(ETrue);
+        	TBool itemsDestroyed;
+    	    AddEffectItemL(aHandle, aLayout, NULL, NULL, EFalse, itemsDestroyed, EFalse);
+	        iFullScreenEffectData->iAppStartScreenshotItemHandle = aHandle;
+			}
+        }
+    }
+
+void CAlfBridge::HandleGfxStopEvent( TBool aClientRequest )
+    {
+    __ALFFXLOGSTRING("CAlfBridge::HandleGfxStopEvent BEGIN");
+    if (!iFullScreenEffectData)
+        {
+        __ALFFXLOGSTRING("CAlfBridge::HandleGfxStopEvent - END: none");
+        return;
+        }
+    
+    CFullScreenEffectState* fxData = iFullScreenEffectData;
+    iFullScreenEffectData = NULL;
+    CleanupStack::PushL( fxData );
+    
+     __ALFFXLOGSTRING2(" - handle: %d, toAppUid: 0x%x", fxData->iHandle, fxData->iToAppId);
+    
+    // clean effects with this handle       
+    RemoveTemporaryPresenterVisual(NULL, fxData->iHandle);
+    // this was abort, so we might have received earlier event hiding this window. Here we'll bring it 
+    // back
+    if (fxData->iToAppId && fxData->iToAppId != KErrNotFound)
+        {
+        RemoveEffectFromApp(fxData->iToAppId);
+        RemoveEffectFromApp(fxData->iFromAppId);
+        }
+    else
+        {
+        // abort ALL effects
+        RemoveAllTemporaryPresenterVisuals();
+        }
+    
+    iHuiEnv->ContinueRefresh();
+    
+    if ( !aClientRequest )
+        {
+        // Aborted errornously, signal client side
+        RProperty::Set( KPSAlfDomain, KAlfTransitionStatus, fxData->iCompletionHandle );
+        }
+    
+    CleanupStack::PopAndDestroy( fxData );
+    __ALFFXLOGSTRING("CAlfBridge::HandleGfxStopEvent - END");
+    }
+
+void CAlfBridge::RemoveEffectFromApp(TInt aAppUid)
+    {
+    if(aAppUid <= 0)
+        {
+        return;
+        }
+    CHuiControlGroup* group = FindControlGroupByAppId(aAppUid);
+    if (group)
+        {
+        CHuiControl& control = group->Control(0);
+        CHuiLayout* layout = (CHuiLayout*)&control.Visual(0);
+    
+        TInt handle = FindEffectHandle(layout);
+        if (handle != KErrNotFound)
+            {
+            __ALFFXLOGSTRING2("CAlfBridge::HandleGfxStopEvent - layout visual: 0x%x ; handle: %d ", layout, handle);
+            RemoveTemporaryPresenterVisual(NULL, handle);
+            }
+        layout->iOpacity.Set(1.0f); 
+        }
+    }
+
+CAlfBridge::CEffectState::CEffectState()
+    {
+    // CBase clears all variables
+    }
+
+CAlfBridge::CEffectState::~CEffectState()
+    {
+    delete iEffectName;
+    }
+
+void CAlfBridge::CEffectState::ResolveFileNameL(RMemReadStream& aStream)
+    {
+    HBufC* effectDirectory = HBufC::NewLC(aStream, 256);
+    HBufC* effectFile = HBufC::NewLC(aStream, 256);
+
+    // Add one extra because we want to be able to append a number to the filename
+    HBufC* effectFullName = HBufC::NewL(effectDirectory->Des().Length()
+            + effectFile->Des().Length() + 1);
+    CleanupStack::PushL(effectFullName);
+
+    effectFullName->Des().Copy(*(effectDirectory));
+    effectFullName->Des().Append(*(effectFile));
+    delete iEffectName;
+    iEffectName = effectFullName; // ownership transferred
+    CleanupStack::Pop(effectFullName);
+    CleanupStack::PopAndDestroy(2, effectDirectory);
+    }
+
+void CAlfBridge::CFullScreenEffectState::ConstructL(
+        TInt aAction,
+        RMemReadStream& aStream)
+    {
+    iAction = aAction;
+
+    iHandle = aStream.ReadInt32L();
+
+    iType = aStream.ReadInt32L();
+    iWg1 = aStream.ReadInt32L();
+    iWg2 = aStream.ReadInt32L();
+    iToAppId = aStream.ReadInt32L();
+    iFromAppId = aStream.ReadInt32L();
+
+    if (iType == AknTransEffect::EParameterType)
+        {
+        /*screen1 =*/aStream.ReadInt32L();
+        /*screen2 =*/aStream.ReadInt32L();
+        }
+    /*TInt flags =*/
+    aStream.ReadInt32L();
+    iRect.iTl.iX = aStream.ReadInt32L();
+    iRect.iTl.iY = aStream.ReadInt32L();
+    iRect.iBr.iX = aStream.ReadInt32L();
+    iRect.iBr.iY = aStream.ReadInt32L();
+
+    ResolveFileNameL(aStream);
+
+    iCompletionHandle = iHandle;
+    }
+
+void CAlfBridge::CControlEffectState::ConstructL(TInt aAction,
+        RMemReadStream& aStream)
+    {
+    iAction = aAction;
+    TInt operation = aStream.ReadInt32L();
+    iHandle = aStream.ReadInt32L();
+    iClientHandle = aStream.ReadInt32L();
+    iClientGroupHandle = aStream.ReadInt32L();
+    TInt screenNumber = aStream.ReadInt32L(); // this has always value 0 
+    // Are Symbian full filename+directory combinations still max 256 characters long?
+    ResolveFileNameL(aStream);
+    }
+
+// ---------------------------------------------------------------------------
+// HandleGfxEffectsL
+// ---------------------------------------------------------------------------
+//
+
+void CAlfBridge::HandleGfxEffectsL( TAlfBridgerData data )
+    {
+    // This method is called when "Begin fullscreen" and "End fullscreen" are
+    // invoked. Data in "Begin fullscreen" is used, "End fullscreen" and
+    // "Abort fullscreen" (HandleStopGfxEffectsL) are just signals.
+    // As a general limitation, there can be exactly one fullscreen effect
+    // ongoing at once.
+    
+    TInt action = data.iInt1;
+    TInt length = data.iInt2;
+    __ALFFXLOGSTRING1("CAlfBridge::HandleGfxEffectsL - BEGIN (bridge data %d)", (TInt)data.iPtr);
+    void* bridgeBuffer = (void*) (*iHost)->GetEffectsDataL( (TInt)data.iPtr );    
+    RMemReadStream stream( bridgeBuffer, length );
+    
+    // operation tells if this is begin full screen or end full screen
+    TInt operation = stream.ReadInt32L();
+    
+    if ( operation == MAlfGfxEffectPlugin::EBeginFullscreen )
+        {
+        if ( !iFullScreenEffectData || !iFullScreenEffectData->iSetupDone )
+            {
+            // No fullsceen effect ongoing or fullscreen effect hasn't yet been set up, 
+            // so we can initialize iFullScreenEffectData from stream.
+            
+            __ALFFXLOGSTRING("HandleGfxEffectsL - fresh start");
+            
+            CFullScreenEffectState* fxData = new (ELeave) CFullScreenEffectState;
+            CleanupStack::PushL( fxData );
+            fxData->ConstructL( action, stream );
+            CleanupStack::Pop( fxData );
+        	
+			// the effect handle of freezed layout (iAppStartScreenshotItemHandle) must match the actual
+			// effect handle that is run. Only then frozen application can be freed at the end of the effect
+			if (iFullScreenEffectData)
+			{
+            	for (TInt i = 0; i < iEffectCleanupStack.Count(); i++)
+            	{
+               	 TEffectCleanupStruct& effectItem = iEffectCleanupStack[i];
+               	 if (iFullScreenEffectData->iAppStartScreenshotItemHandle == effectItem.iHandle)
+               	     {
+               	     effectItem.iHandle = fxData->iHandle;
+               	     }
+               	}
+			}
+            
+            if (iFullScreenEffectData && iFullScreenEffectData->iToAppId != fxData->iToAppId)
+                {
+				__ALFFXLOGSTRING("CAlfBridge::HandleGfxEffectsL - WARNING - Another fullscreen effect to different app. Deleting the previous ongoing effect"); 
+                RemoveEffectFromApp(iFullScreenEffectData->iToAppId);// Fullscreen effect for another app has arrived, and the previous has not finished and abort effect was not called.
+                RemoveEffectFromApp(iFullScreenEffectData->iFromAppId);
+                // Fullscreen effect for another 
+                }
+            
+            delete iFullScreenEffectData;
+            iFullScreenEffectData = fxData;
+            iFullScreenEffectData->iAppStartScreenshotItemHandle = fxData->iHandle;
+            
+            stream.Release();
+            }
+        else
+            {
+            // Fullscreen effect is ongoing. We could either use new data
+            // and abort the ongoing effect, or just continue ongoing.
+            // For now, we continue ongoing.
+            
+            __ALFFXLOGSTRING("HandleGfxEffectsL - END: ongoing");
+            
+            // Client expects completion to be signalled with this handle.
+            iFullScreenEffectData->iCompletionHandle = stream.ReadInt32L();
+            
+            stream.Release();           
+            return ; 
+            }
+        }
+    else // MAlfGfxEffectPlugin::EEndFullscreen
+        {
+        stream.Release();
+
+        // End fullscreen signal received. We proceed only if there is really
+        // effect ongoing and "end fullscreen" hasn't already been processed.
+        
+        if ( !iFullScreenEffectData || iFullScreenEffectData->iEndFullScreen )
+            {
+            __ALFFXLOGSTRING("CAlfBridge::HandleGfxEffectsL - END: fx ready");
+            return;
+            }
+
+        __ALFFXLOGSTRING("HandleGfxEffectsL - process end");
+        iFullScreenEffectData->iEndFullScreen = ETrue;
+        }
+
+    CFullScreenEffectState* fxData = iFullScreenEffectData;
+    fxData->iOperation = operation;
+    fxData->iWaitingWindowGroup = EFalse;
+
+    __ALFFXLOGSTRING3("Operation: %d, handle: %d, type: %d", operation, fxData->iHandle, fxData->iType);
+    __ALFFXLOGSTRING2("wg1: %d, wg2: %d", fxData->iWg1, fxData->iWg2);
+
+    // find root nodes and attach effects to them
+    // First we need a windowgroup node id. So far we have a list of window ids
+
+    // wg2 is the window group that is supposed to disappear from view
+    // when a new application starts. We don't have any use for it now...
+
+    // This is the group that is disappearing
+    // Currently we don't add an effect to it.
+
+    // TODO: when ids available from wserv...
+    // if ( appUid2 )
+    //{
+    //	 group2 = FindControlGrouAppUId( appUid2, screen2, &alfGroup );
+    // }
+    //if ( toAppId2 )
+    //    {
+    //    group2 = FindControlGroupByAppId(toAppId2);
+    //    }
+    //if ( wg2 && wg2 != KErrNotFound )
+    //    {
+    //        group2 = FindControlGroupByWindowGroupId( wg2, screen2 );
+    //        }
+    //    if ( group2 )
+    //        {
+    //        CHuiControl& control = group2->Control(0);
+    //        layout2 = (CHuiLayout*)&control.Visual(0);
+    //        }
+
+    // This effect is triggered either by BeginFullScreen or by EndFullScreen
+    // depending on if we have an application that is already running or not
+
+    //    TAlfControlGroupEntry* alfGroup = NULL;
+    // TODO: 
+    //wg1 = (*iHost)->FindWgForAppUid(TUid::Uid(toAppId1));
+    //if (!wg1 && action != AknTransEffect::EApplicationExit )
+    // 	{
+    // 	// window group is not available yet, but it will be created in short while.
+    //  	iEffectWaitingWindowgroup.Append(toAppId1);
+    //  	}
+    // TODO: when ids available from wserv...
+    // if ( appUid1 )
+    //{
+    //	 group1 = FindControlGrouAppUId( appUid1, screen1, &alfGroup );
+    // }
+
+    TBool failed = EFalse;
+    if (fxData->iToAppId && fxData->iToAppId != KErrNotFound)
+        {        
+        CHuiControlGroup* toGroup = NULL;
+        CHuiLayout* toLayout = NULL; 
+        toGroup = FindControlGroupByAppId(fxData->iToAppId);
+
+        CHuiControlGroup* fromGroup = NULL;
+        CHuiLayout* fromLayout = NULL; 
+        fromGroup = FindControlGroupByAppId(fxData->iFromAppId);
+
+        if (!toGroup) // group has been destroyed and moved to effectControlGroup for waiting the application exit effect EndFullScreen trigger 
+            {
+            toLayout = FindLayoutByEffectHandle(fxData->iHandle);
+            }
+        else
+            {
+            CHuiControl& control = toGroup->Control(0);
+            toLayout = (CHuiLayout*)&control.Visual(0);
+            }
+        if (fromGroup)
+            {
+            CHuiControl& control2 = fromGroup->Control(0);
+            fromLayout = (CHuiLayout*)&control2.Visual(0);
+            }
+        
+        if (toLayout)
+            {
+            failed = HandleGfxEventL(*fxData, toLayout, fromLayout);
+            }
+        else
+            {
+            __ALFFXLOGSTRING("HandleGfxEffectsL - waiting window group");            
+            fxData->iWaitingWindowGroup = ETrue;
+            }
+        }
+
+    if ( failed )
+        {
+        // Effect failed, reset state
+        HandleGfxStopEvent( EFalse ); // destroys iFullScreenEffectData
+        }
+    
+    for (TInt i = 0; i < iAlfScreens.Count(); i++)
+        {
+        iAlfScreens[i]->iDisplay->SetDirty();
+        }
+    iAlfScreens[0]->iVisualTreeVisibilityChanged = ETrue;
+    iHuiEnv->ContinueRefresh();
+
+    __ALFFXLOGSTRING("CAlfBridge::HandleGfxEffectsL - END");
+    }
+
+// TODO: add effect type to effect struct. remove all fullscreen effects. currently some might hang around
+void CAlfBridge::HandleGfxStopEffectsL(TAlfBridgerData data)
+    {
+    // Fullscreen effect is aborted. Clear the state. 
+    
+    //TInt action = data.iInt1;
+    TInt length = data.iInt2;
+    __ALFFXLOGSTRING1("CAlfBridge::HandleGfxStopEffectsL - Reading bridge data %d", (TInt)data.iPtr);
+    void* bridgeBuffer = (void*) (*iHost)->GetEffectsDataL( (TInt)data.iPtr );    
+    RMemReadStream stream( bridgeBuffer, length );
+    
+    TInt operation = stream.ReadInt32L();
+    TInt handle = stream.ReadInt32L();
+    TInt type = stream.ReadInt32L();
+    TInt wg1 = stream.ReadInt32L();
+    TInt wg2 = stream.ReadInt32L();
+    TInt toAppUi = stream.ReadInt32L();
+    stream.Release();
+
+    // operation tells if this is abort full screen or something else
+    // When this function is used to abort control transitions, all data is 0s
+    if ( iFullScreenEffectData )
+        {
+        __ALFFXLOGSTRING("CAlfBridge::HandleGfxStopEffectsL - kill fullscreen");        
+        HandleGfxStopEvent( ETrue );
+        }
+    
+    if ( !toAppUi )
+        {
+        __ALFFXLOGSTRING("CAlfBridge::HandleGfxStopEffectsL - kill all");
+        RemoveAllTemporaryPresenterVisuals();
+        iHuiEnv->ContinueRefresh();
+        }
+    __ALFFXLOGSTRING("CAlfBridge::HandleGfxStopEffectsL - end");
+    }
+
+void CAlfBridge::HandleRegisterEffectL( TAlfBridgerData data )
+    {     
+    TInt action = data.iInt1;
+    TInt length = data.iInt2;    
+    
+    void* bridgeBuffer = (void*) (*iHost)->GetEffectsDataL( (TInt)data.iPtr );    
+    RMemReadStream stream( bridgeBuffer, length );
+  
+   
+    HBufC* effectDirectory = HBufC::NewL( stream, 256 );
+    CleanupStack::PushL( effectDirectory );
+    HBufC* effectFile = HBufC::NewL( stream, 256 );
+    CleanupStack::PushL( effectFile );
+    HBufC* effectFullName = HBufC::NewL( effectDirectory->Des().Length() + effectFile->Des().Length() );
+    CleanupStack::PushL( effectFullName );
+    effectFullName->Des().Copy( *effectDirectory );
+    effectFullName->Des().Append( *effectFile );  
+    
+    stream.Release();
+    __ALFFXLOGSTRING2("CAlfBridge::HandleRegisterEffectL - dir: %S, file: %S", effectDirectory, effectFile);
+    DoRegisterEffectL(*effectFullName, action);
+    
+    if (action == KFadeAction)
+        {
+        DoSetCachedFadeEffectL();
+        }
+    
+    CleanupStack::PopAndDestroy(effectFullName);
+    CleanupStack::PopAndDestroy(effectFile);
+    CleanupStack::PopAndDestroy(effectDirectory);
+    }
+
+void CAlfBridge::DoRegisterEffectL(const TDesC& aFilename, TInt aAction)
+    {
+    TRegisteredEffectsStruct newEntry;
+    newEntry.iAction = aAction;
+    newEntry.iEffectFile = HBufC::NewL(aFilename.Length());
+    newEntry.iEffectFile->Des().Append(aFilename);
+    iAlfRegisteredEffects.AppendL(newEntry);
+
+    CHuiFxEngine* engine = NULL;
+    engine = iHuiEnv->EffectsEngine();
+    if (engine)
+        {
+        engine->RegisterEffectL(aFilename);
+        }
+    }
+
+CHuiCanvasVisual* CAlfBridge::AddEffectItemL(
+        TInt aEffectHandle, 
+        CHuiVisual* aSourceVisual, 
+        CHuiLayout* aTargetLayout, 
+        CHuiControl* aEffectControl, 
+        TBool aInsertTemporaryVisual,
+        TInt& aItemDestroyed,
+        TBool aIsExitEffect)
+    {
+    CHuiCanvasVisual* temporaryPresenterVisual = NULL;
+    TInt enableEffect = ETrue;
+    
+    aSourceVisual->ClearFlags(EHuiVisualFlagShouldBeInactive | EHuiVisualFlagShouldBeUnderOpaqueHint);
+    if (aIsExitEffect) 
+        {
+        aSourceVisual->SetFlag(EHuiVisualFlagAlwaysDraw);   // forces drawing during exit effect. handlevisualvisibility will set the EShouldbeInactive flag, if visual is determined inactive while this flag is set 
+        }
+    
+    if (HasActiveEffect(aSourceVisual))
+        {
+        // this visual is having effect and we are closing down the layout this visual inhabits.
+        // Propably this is the case, when application is closed while the options menu is 
+        // still having effect animation.
+    
+        // removes the effect, and the visual (if EShouldDestroy flag enabled). Removes from effect
+        // cleanup stack iEffectCleanupStack
+        enableEffect = aSourceVisual->Flags() & EHuiVisualFlagShouldDestroy ? 0 : 1;
+        __ALFFXLOGSTRING2("CAlfBridge::SetupEffectLayoutContainerL - visual 0x%x is having effect. EShouldBeDestroyed flag state %d", &aSourceVisual, enableEffect );
+        RemoveTemporaryPresenterVisual(aSourceVisual);
+        if (!enableEffect)
+            {
+            aItemDestroyed++;
+            }
+        }
+    if ( enableEffect )
+        {
+    // RDebug::Print(_L("CAlfBridge::SetupEffectLayoutContainerL - binding visual 0x%x (source)--> 0x%x (presenter) layout 0x%x (presenter layout)"), &sourceVisual, temporaryPresenterVisual, temporaryPresenterLayout);
+        if (aInsertTemporaryVisual)
+            {
+            temporaryPresenterVisual = CHuiCanvasVisual::AddNewL(*aEffectControl, aTargetLayout);
+        
+            temporaryPresenterVisual->SetExternalContentL(aSourceVisual);
+            temporaryPresenterVisual->SetSize(THuiRealSize(640, 640));
+            temporaryPresenterVisual->SetPos(aSourceVisual->Pos().Target());
+            aSourceVisual->SetFlag(EHuiVisualFlagDrawOnlyAsExternalContent);
+            temporaryPresenterVisual->SetChanged();
+            TEffectCleanupStruct item = TEffectCleanupStruct(
+                    aEffectHandle,
+                    aSourceVisual, 
+                    temporaryPresenterVisual,
+                    ETrue,
+                    EFalse);
+            iEffectCleanupStack.AppendL(item);
+            }
+        else
+            {
+            // this will be a child of another visual, and draw by its parent external content visual
+            // aSourceVisual->SetFlag(EHuiVisualFlagDrawOnlyAsExternalContent);
+            TEffectCleanupStruct item = TEffectCleanupStruct(aEffectHandle,
+                        aSourceVisual, NULL, EFalse,
+                        EFalse);
+            iEffectCleanupStack.AppendL(item);
+            }
+     }
+    return temporaryPresenterVisual;
+    }
+
+void CAlfBridge::AddToEffectLayoutContainerL(
+        TInt aEffectHandle,
+        CHuiLayout* aSourceLayout, 
+        CHuiLayout* aTargetLayout, 
+        CHuiControl* aEffectControl,
+        TInt& aItemsDestroyed,
+        TBool aAddLayout,
+        TBool aIsExitEffect)
+    {
+    __ALFFXLOGSTRING2("CAlfBridge::AddToEffectLayoutContainerL 0x%x is having %d children", aSourceLayout, aSourceLayout->Count());
+    if (aAddLayout)
+        {
+        AddEffectItemL(aEffectHandle, aSourceLayout, aTargetLayout, aEffectControl, EFalse, aItemsDestroyed, aIsExitEffect);
+        }
+        
+    for (TInt i = 0; i < aSourceLayout->Count(); i++)
+           {
+           CHuiCanvasVisual& sourceVisual = static_cast<CHuiCanvasVisual&> (aSourceLayout->Visual(i));
+           
+           if (sourceVisual.Count())
+               {
+               CHuiLayout& layout = static_cast<CHuiLayout&> (aSourceLayout->Visual(i));
+               AddToEffectLayoutContainerL(aEffectHandle, &layout, NULL, aEffectControl, aItemsDestroyed, EFalse,aIsExitEffect );
+               }
+           AddEffectItemL(aEffectHandle, &sourceVisual, aTargetLayout, aEffectControl, EFalse, aItemsDestroyed, aIsExitEffect);
+           }
+    __ALFFXLOGSTRING2("CAlfBridge::AddToEffectLayoutContainerL 0x%x end of children", aSourceLayout, aSourceLayout->Count());
+    }
+
+TBool CAlfBridge::SetupEffectLayoutContainerL(TInt aHandle,CHuiLayout* aSourceLayout, TBool aIsExitEffect)
+    {
+    if (aSourceLayout->Flags() & EHuiVisualFlagDrawOnlyAsExternalContent)
+        {
+        // the requested visual is already having an effect. 
+        __ALFFXLOGSTRING("CAlfBridge::SetupEffectLayoutContainerL - WE ARE ALREADY HAVING EFFECT! WHAT TO DO??");
+        // layout is having already effect. this is tricky. This might be place to panic. Resolve later. 
+        }
+    // duplicate the layout to effect window group
+    CHuiControl& effectControlGroup =  iAlfScreens[0]->iFullscreenEffectControlGroup->Control(0);
+    CHuiLayout& effectControlGroupLayout = (CHuiLayout&) effectControlGroup.Visual(0);
+
+    // CHuiCanvasVisual* temporaryPresenterLayout = CHuiCanvasVisual::AddNewL( effectControlGroup, &effectControlGroupLayout);
+    // create presenter visual and set bindings
+    TInt itemsDestroyed(0);
+    AddToEffectLayoutContainerL(aHandle, aSourceLayout, NULL, &effectControlGroup, itemsDestroyed, EFalse, aIsExitEffect);
+
+    if (aIsExitEffect)
+        {
+        CHuiCanvasVisual* temporaryPresenterVisual = AddEffectItemL(aHandle, aSourceLayout, &effectControlGroupLayout, &effectControlGroup, ETrue, itemsDestroyed, aIsExitEffect);
+        aSourceLayout->SetFlag(EHuiVisualFlagDrawOnlyAsExternalContent);
+        __ALFFXLOGSTRING3("CAlfBridge::SetupEffectLayoutContainerL - adding handle: %d, 0x%x (source layout)-> 0x%x (presenter layout) to iEffectCleanupStack", aHandle, aSourceLayout, temporaryPresenterVisual);
+        }
+    else
+        {
+        AddEffectItemL(aHandle, aSourceLayout, NULL, &effectControlGroup, ETrue, itemsDestroyed, EFalse);
+        __ALFFXLOGSTRING2("CAlfBridge::SetupEffectLayoutContainerL - adding handle: %d, 0x%x (source layout), NO presenter layout) to iEffectCleanupStack", aHandle, aSourceLayout);
+        }
+    iAlfScreens[0]->iVisualTreeVisibilityChanged = ETrue;
+    iAlfScreens[0]->iDisplay->SetDirty();
+    if (itemsDestroyed)
+        {
+        __ALFFXLOGSTRING3("CAlfBridge::SetupEffectLayoutContainerL - trying to put effect on destroyed visuals. Skipping effect visual: 0x%x, handle %d, %d items destroyed", aSourceLayout, aHandle, itemsDestroyed);
+        }
+    __ALFFXLOGSTRING("CAlfBridge::SetupEffectLayoutContainerL");
+    return ETrue; // TBool(!itemsDestroyed);
+    }
+
+void CAlfBridge::SetupEffectContainerL(TInt aHandle,
+        CHuiCanvasVisual* aSourceVisual, TBool aIsExitEffect)
+    {
+    // if the original visual is having an effect, then remove it.
+    if (HasActiveEffect(aSourceVisual))
+        {
+        RemoveTemporaryPresenterVisual(aSourceVisual); 
+        }
+        
+    // Create new temporary presenter visual for the effect
+    CHuiControl& effectControlGroup =
+            iAlfScreens[0]->iFullscreenEffectControlGroup->Control(0);
+    CHuiLayout* layout = (CHuiLayout*) &effectControlGroup.Visual(0);
+    CHuiCanvasVisual* temporaryPresenterVisual = NULL;
+    temporaryPresenterVisual = CHuiCanvasVisual::AddNewL(effectControlGroup, layout);
+    // attach the source to the presenter visual
+    temporaryPresenterVisual->SetExternalContentL(aSourceVisual);
+    aSourceVisual->SetFlag(EHuiVisualFlagDrawOnlyAsExternalContent);
+    temporaryPresenterVisual->ClearFlag(EHuiVisualFlagInactive);
+    aSourceVisual->SetChanged();
+    // append to cleanup stack. this is cleaned in RemoveTemporaryVisuals after effect has finished
+    iEffectCleanupStack.AppendL(TEffectCleanupStruct(aHandle, aSourceVisual, temporaryPresenterVisual, EFalse /*iIsLayout*/, aIsExitEffect));
+    __ALFFXLOGSTRING3("CAlfBridge::SetupEffectContainerL - adding handle: %d, 0x%x (source visual)-> 0x%x (presenter visual)", aHandle, aSourceVisual, temporaryPresenterVisual);
+    }
+
+void CAlfBridge::HandleGfxControlEffectsL( TAlfBridgerData data )
+    {
+    TInt err = KErrNone;
+    TInt action = data.iInt1;
+    TInt length = data.iInt2;
+    __ALFFXLOGSTRING1("HandleGfxControlEffectsL - Reading bridge data %d", (TInt)data.iPtr);
+    void* bridgeBuffer = (void*) (*iHost)->GetEffectsDataL((TInt) data.iPtr);
+    RMemReadStream stream(bridgeBuffer, length);
+    if (iControlEffectData)
+        {
+        delete iControlEffectData;
+        iControlEffectData = NULL;
+        }
+    CControlEffectState* fxData = new (ELeave) CControlEffectState;
+    CleanupStack::PushL(fxData);
+    fxData->ConstructL(action, stream);
+    iControlEffectData = fxData;
+    CleanupStack::Pop(fxData);
+
+    // We now have all the data sent to us.
+    stream.Release();
+
+    // We need to pass the filename from the transeffect plugin that handles the controls
+    // that define which effect is used for the selected skin or the selected application
+    // For full screen effects the skin should determine the effect, or there should be
+    // some default effects.
+
+    CHuiCanvasVisual* visual = FindVisualByClientSideIds(fxData->iClientHandle, fxData->iClientGroupHandle);
+
+    if (visual)
+        {
+        HandleGfxControlEventL(*iControlEffectData, visual);
+        }
+    else
+        {
+        __ALFFXLOGSTRING2("CAlfBridge::HandleGfxControlEffectsL - Control not found. iClientHandle 0x%x, iClientGroupHandle 0x%x", 
+                iControlEffectData->iClientHandle, 
+                iControlEffectData->iClientGroupHandle);
+        return;
+        }
+    iAlfScreens[0]->iDisplay->SetDirty();
+
+    iHuiEnv->ContinueRefresh();
+
+    if (visual && err != KErrNone)
+        {
+        // if the effect loading failed too soon, we must call our callback ourselves
+        //        RDebug::Print(_L("HandleGfxControlEffectsL - effect not set - going directly to callback"));
+        AlfGfxEffectEndCallBack(fxData->iHandle);
+        }
+
+    delete iControlEffectData;
+    iControlEffectData = NULL;
+
+    __ALFFXLOGSTRING("HandleGfxControlEffectsL - end");
+    }
+
+void CAlfBridge::HandleGfxControlEventL(CControlEffectState& aEvent,
+        CHuiCanvasVisual* aCanvasVisual)
+    {
+    TInt err = KErrNone;
+    // Check if there is an effects engine in HuiEnv
+    CHuiFxEffect* effect = NULL;
+    CHuiFxEngine* engine = NULL;
+    // engine is not owned by us, it is a member of HuiEnv
+    engine = iHuiEnv->EffectsEngine();
+    if (NeedsStoredBuffers(engine, *aEvent.iEffectName))
+        {
+        RecursiveStoreRenderBufferL(aCanvasVisual);
+        }
+
+    if (engine)
+        {
+        // clear out old effect if this visual has one
+        __ALFFXLOGSTRING1("HandleGfxControlEffectsL - loading effect %S", &aEvent.iEffectName );
+        __ALFFXLOGSTRING1("HandleGfxControlEffectsL - loading control effect, handle %d", aEvent.iHandle );
+        if (HasActiveEffect(aCanvasVisual))
+            {
+            __ALFFXLOGSTRING1("HandleGfxControlEffectsL - 0x%x has active effect. Requesting removal.", aCanvasVisual);
+            // another effect coming to already effected visual. E.g. close options menu, while opening effect still ongoing
+            RemoveTemporaryPresenterVisual(aCanvasVisual);
+            }
+        TBool layoutEffectable(EFalse);
+        aCanvasVisual->iOpacity.Set(KAlfVisualDefaultOpacity);
+        if (aEvent.iAction == KGfxControlDisappearAction)
+            { // TODO: revise
+            // The control stays visible because the inactive flag is not set
+            // if the window is reserved.
+            /*if (aCanvasVisual->iOpacity.Target() == 0.0f)
+                {
+                // this visual was hidden, before the effect arrived. sounds like trouble.
+                // Lets make it visible again, and ask it to be hidden in the end of the effect
+                // this enables at least the notes disappear effects
+                aCanvasVisual->iOpacity.Set(KAlfVisualDefaultOpacity);
+                // visual->SetFlag(EHuiVisualFlagShouldBeHidden);
+                }*/
+            layoutEffectable = SetupEffectLayoutContainerL(aEvent.iHandle, aCanvasVisual, ETrue);
+            }
+        else
+            {
+            layoutEffectable = SetupEffectLayoutContainerL(aEvent.iHandle, aCanvasVisual, EFalse);
+            }
+        if (layoutEffectable)
+            {
+            TRAP( err, engine->LoadGroupEffectL(*aEvent.iEffectName, effect, aCanvasVisual->Effectable(), engine->ActiveGroupEffect(), NULL, this, aEvent.iHandle ) );
+            }
+        else
+            {
+            err = KErrNotFound;
+            }
+        //            RDebug::Print(_L("HandleGfxControlEffectsL - loading effect returned %d"), err );
+        // only use the effect if the effect file was correctly parsed
+        if (err == KErrNone)
+            {
+            iLastEffectHandle = aEvent.iHandle;
+
+#ifdef HUI_DEBUG_TRACK_DRAWING  
+            visual->SetTracking(ETrue);
+#endif                
+            // HuiVisual takes ownership of the effect, but we save the value for reference
+            // add new visual to iFullscreenEffectControlGroup. This enables multiple effects in the group, and their 
+            // destruction in any order
+            }
+        else
+            {
+            // visuals added to "active effect visual" stack, but they wont be used, because effect loading has failed. cleanup.
+            RemoveTemporaryPresenterVisual(NULL, aEvent.iHandle);
+            }
+        effect = NULL; // HuiVisual has taken ownership
+        }
+    }
+
+TBool CAlfBridge::RemoveTemporaryPresenterItem(TEffectCleanupStruct& aEffectItem)
+    {
+    CHuiVisual* sourceViz = aEffectItem.iEffectedVisual;
+    CHuiCanvasVisual* sourceViz2 = dynamic_cast<CHuiCanvasVisual*> (aEffectItem.iEffectedVisual);
+    // wserv has already hidden this window. Effect has finished, so lets do what 
+    // was asked. Also hide, if this is supposed to be destroyed by now.
+    sourceViz->SetFreezeState(EFalse);    
+    sourceViz->SetStoredRenderBuffer(NULL); // free render buffer from visual
+    if (sourceViz2 && sourceViz2->Layout()) 
+        {
+        sourceViz2->FreeRenderBuffer();
+        }
+    sourceViz->ClearFlag(EHuiVisualFlagDrawOnlyAsExternalContent);
+    TBool hideVisual = sourceViz->Flags() & EHuiVisualFlagShouldBeHidden;
+    TBool showVisual = sourceViz->Flags() & EHuiVisualFlagShouldBeShown;
+    TBool destroyVisual = sourceViz->Flags() & EHuiVisualFlagShouldDestroy;
+    TBool shouldInactivate = sourceViz->Flags() & EHuiVisualFlagShouldBeInactive;
+    TBool shouldBeUnderOpaqueHint = sourceViz->Flags() & EHuiVisualFlagShouldBeUnderOpaqueHint;
+    __ALFFXLOGSTRING3("CAlfBridge::RemoveTemporaryPresenterItem - cleaning handle: %d, 0x%x -> 0x%x", aEffectItem.iHandle, aEffectItem.iEffectedVisual, aEffectItem.iTemporaryPresenterVisual);
+    __ALFFXLOGSTRING3("CAlfBridge::RemoveTemporaryPresenterItem - hide %d, destroy %d, should inactivate: %d", TBool(hideVisual), TBool(destroyVisual), TBool(shouldInactivate));
+    
+    sourceViz->ClearFlag(EHuiVisualFlagAlwaysDraw);
+    if (hideVisual)
+        {
+        // this was exit effect, and window was not really destroyed.
+        sourceViz->iOpacity.Set(0.0f);
+        sourceViz->ClearFlag(EHuiVisualFlagShouldBeHidden); // it is now hidden
+        }
+	else
+		{
+        // visual may be transparent after manipulation of the effect
+	   	sourceViz->iOpacity.Set(KAlfVisualDefaultOpacity); 
+		}
+    if (showVisual)
+        {
+        sourceViz->iOpacity.Set(KAlfVisualDefaultOpacity);
+        sourceViz->ClearFlag(EHuiVisualFlagShouldBeShown); // it is now hidden
+        }
+    
+    if (destroyVisual)
+    	{
+    	sourceViz->iOpacity.Set(0.0f);
+    	}
+    if (shouldInactivate)
+        {
+        sourceViz->SetFlag(EHuiVisualFlagInactive);
+        
+        if (sourceViz2)
+            {
+            sourceViz2->ClearCache();
+            }
+        sourceViz->ClearFlags(EHuiVisualFlagShouldBeInactive);
+        }
+    if (shouldBeUnderOpaqueHint)
+        {
+        sourceViz->SetFlag(EHuiVisualFlagUnderOpaqueHint);
+        if (sourceViz2)
+             {
+             sourceViz2->ClearCache();
+             }
+        sourceViz->ClearFlags(EHuiVisualFlagShouldBeUnderOpaqueHint);
+        }
+    if (sourceViz->Effect())
+        {
+        sourceViz->SetEffect(NULL);
+        }
+
+        // first delete the temporary presenter visual, because this will unbind the external content
+    if (aEffectItem.iTemporaryPresenterVisual)
+        {
+        CHuiVisual* viz = aEffectItem.iTemporaryPresenterVisual;
+        
+        if (viz)
+            {
+            if (viz->Effect())
+                {
+                // temporary presenter visual should not have effect, because the effect is 
+                // applied to the original visual. However, if somebody misuses this API, it
+                // is good to cleap up the effect here.
+                viz->SetEffect(NULL);
+                }
+            if (viz->Layout())
+                {
+                viz->Layout()->Remove(viz);
+                }
+            viz->Owner().Remove(viz);
+            delete viz;
+            aEffectItem.iTemporaryPresenterVisual = NULL;
+            }
+        }
+    // although layout does not support EHuiVisualFlagDrawOnlyAsExternalContent flag, it is being used to indicate a layout that has effect. flag must be cleared, that the layout can be drawn normally after the effect. 
+    if (aEffectItem.iIsLayout)
+    	{
+    	aEffectItem.iEffectedVisual->ClearFlag(EHuiVisualFlagDrawOnlyAsExternalContent);
+    	// sourceViz->iOpacity.Set(1.0f);
+    	}
+    
+    if (destroyVisual)
+        {
+        // window has been destroyed during effect. Kill it once and for all
+        // DeleteControlGroupL and DestroyWindow can do their duty, when this flag is cleared
+        sourceViz->ClearFlags(EHuiVisualFlagShouldDestroy | EHuiVisualFlagDrawOnlyAsExternalContent); 
+        if (aEffectItem.iIsLayout)
+            {
+            if (sourceViz->Layout())
+                {
+                sourceViz->Layout()->Remove(sourceViz);
+                }
+            sourceViz->Owner().Remove(sourceViz);
+             
+            delete sourceViz;
+            __ALFFXLOGSTRING1("CAlfBridge::RemoveTemporaryPresenterItem - Destroying sourceViz: 0x%x", sourceViz);
+            aEffectItem.iEffectedVisual = NULL;
+            }
+        else
+            {
+            TLex8 lex(sourceViz->Tag());
+            TInt nodeId;
+            lex.Val(nodeId);
+            DestroyWindow(sourceViz, ETrue);
+            }
+        }
+    return TBool(destroyVisual);
+    }
+
+// RemoveTemporaryPresenterVisual removes the temporary presenter visual, and unbinds it from the source. 
+TBool CAlfBridge::RemoveTemporaryPresenterVisual(CHuiVisual* aVisual,
+        TInt aHandle)
+    {
+    __ALFFXLOGSTRING2("CAlfBridge::RemoveTemporaryPresenterVisual - cleaning handle: %d, 0x%x", aHandle, aVisual);
+    TInt visualsRemoved = 0;
+    for (TInt i = 0; i < iEffectCleanupStack.Count(); i++)
+        {
+        TEffectCleanupStruct& effectItem = iEffectCleanupStack[i];
+        if (aVisual == effectItem.iEffectedVisual || 
+		    aHandle == effectItem.iHandle)
+            {
+            if (RemoveTemporaryPresenterItem(effectItem))
+                {
+                visualsRemoved++;
+                }
+            // must remove from finished effects to keep it in sync
+            for(TInt k = 0; k < iFinishedCleanupStackEffects.Count(); k++)
+                {
+                if (iFinishedCleanupStackEffects[k] == effectItem.iHandle)
+                    {
+                    iFinishedCleanupStackEffects.Remove(k);
+                    k--;
+                    }
+                }
+            iEffectCleanupStack.Remove(i);
+            i--;
+            }
+        }
+    return TBool(visualsRemoved);
+    }
+	
+CHuiLayout* CAlfBridge::FindTemporaryPresenterLayout(CHuiVisual* aVisual)
+    {
+    for (TInt i = 0; i < iEffectCleanupStack.Count(); i++)
+        {
+        if (aVisual == iEffectCleanupStack[i].iEffectedVisual)
+            {
+            ASSERT(iEffectCleanupStack[i].iIsLayout);
+            return (CHuiLayout*)iEffectCleanupStack[i].iTemporaryPresenterVisual;
+            }
+        }
+    return NULL;
+    }
+
+TBool CAlfBridge::HasActiveEffect(CHuiVisual* aVisual)
+    {
+    for (TInt i = 0; i < iEffectCleanupStack.Count(); i++)
+        {
+        if (aVisual == iEffectCleanupStack[i].iEffectedVisual)
+            {
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+
+TInt CAlfBridge::FindEffectHandle(CHuiVisual* aVisual)
+    {
+    for (TInt i = 0; i < iEffectCleanupStack.Count(); i++)
+        {
+        if (aVisual == iEffectCleanupStack[i].iEffectedVisual)
+            {
+            return iEffectCleanupStack[i].iHandle;
+            }
+        }
+    __ALFFXLOGSTRING1(" CAlfBridge::SetupEffectLayoutContainerL - Could not find handle for 0x%x", aVisual);
+    return KErrNotFound;
+    }
+
+CHuiLayout* CAlfBridge::FindLayoutByEffectHandle(TInt aHandle)
+    {
+    for (TInt i = 0; i < iEffectCleanupStack.Count(); i++)
+        {
+        if (aHandle == iEffectCleanupStack[i].iHandle && iEffectCleanupStack[i].iIsLayout)
+            {
+            return (CHuiLayout*)iEffectCleanupStack[i].iEffectedVisual;
+            }
+        }
+    return NULL;
+    }
+
+
+TBool CAlfBridge::RemoveTemporaryPresenterVisuals()
+    {
+    if (!iFinishedCleanupStackEffects.Count())
+        {
+        return 0;
+        }
+    TInt itemsRemoved(0);
+    CHuiControl& effectControlGroup =  iAlfScreens[0]->iFullscreenEffectControlGroup->Control(0);
+    CHuiLayout* effectControlGroupLayout = (CHuiLayout*) &effectControlGroup.Visual(0);
+    __ALFFXLOGSTRING1("CAlfBridge::RemoveTemporaryPresenterVisuals - BEGIN - effects in layout %d", effectControlGroupLayout->Count());
+
+    while (iFinishedCleanupStackEffects.Count())
+        {
+        for (TInt i = 0; i < iEffectCleanupStack.Count() && iFinishedCleanupStackEffects.Count(); i++)
+            {
+            __ALFFXLOGSTRING2("CAlfBridge::RemoveTemporaryPresenterVisuals - looping, finished count: %d, index in active effecs: %d", iFinishedCleanupStackEffects.Count(), i );
+       
+            TEffectCleanupStruct& effectItem = iEffectCleanupStack[i];
+            if (iFinishedCleanupStackEffects[0] == effectItem.iHandle)
+                {
+                if (RemoveTemporaryPresenterItem(effectItem))
+                    {
+                    itemsRemoved++;
+                    }
+                iEffectCleanupStack.Remove(i);
+                iFinishedCleanupStackEffects.Remove(0);
+                i--;
+                }
+            }
+        }
+    iAlfScreens[0]->iVisualTreeVisibilityChanged = ETrue; // TODO: Check if really changed   
+    iAlfScreens[0]->iDisplay->SetDirty();
+	__ALFFXLOGSTRING1("CAlfBridge::RemoveTemporaryPresenterVisuals - END - effects in layout %d", effectControlGroupLayout->Count());
+    return itemsRemoved;
+    }
+
+void CAlfBridge::RemoveAllTemporaryPresenterVisuals()
+    {
+    CHuiControl& effectControlGroup =  iAlfScreens[0]->iFullscreenEffectControlGroup->Control(0);
+    CHuiLayout* effectControlGroupLayout = (CHuiLayout*) &effectControlGroup.Visual(0);
+    __ALFFXLOGSTRING1("CAlfBridge::RemoveAllTemporaryPresenterVisuals - BEGIN - effects in layout %d", effectControlGroupLayout->Count());
+
+    while(iEffectCleanupStack.Count())
+        {
+        TEffectCleanupStruct& effectItem = iEffectCleanupStack[0];
+        RemoveTemporaryPresenterItem(effectItem);
+        iEffectCleanupStack.Remove(0);
+        }
+    
+    while(iFinishedCleanupStackEffects.Count())
+        {
+        iFinishedCleanupStackEffects.Remove(0);
+        }    
+    }
+
+void CAlfBridge::AlfGfxEffectEndCallBack(TInt aHandle)
+    {
+    // We need a delay to prevent the refresh from being messed up
+    // We try a short delay before clearing everything up.
+    __ALFFXLOGSTRING1("AlfGfxEffectEndCallBack, append handle %d", aHandle );
+    //    RDebug::Print(_L("AlfGfxEffectEndCallBack, append handle %d"), aHandle );
+    // If the handle cannot be appended, the function returns an error.
+    // However, if the memory is low, there is nothing we can do about it.
+    // We try to handle the transition finish anyway.
+    // If there are already other handles in the queue, the handler will not
+    // be called for this handle, but all handles that have been left hanging
+    // around will be cleared when HandleGfxStopEffectsL is called
+  
+    
+    iFinishedEffects.Append(aHandle);
+    	
+    // iFinishedCleanupStackEffects.Append(aHandle);
+    if (!iEffectEndTimer->IsActive())
+        {
+        iEffectEndTimer->Start( 10000, aHandle );
+        }
+
+    // We should do visual visibility scan after effect is ended
+    iAlfScreens[0]->SetVisualTreeVisibilityChanged(ETrue);
+    }
+
+void CAlfBridge::TransitionFinishedHandlerL(TInt aHandle)
+    {
+    for (TInt i=0;i<iEffectCleanupStack.Count();i++)
+    	{
+    	if(aHandle==iEffectCleanupStack[i].iHandle)
+    		{
+    		// effect might have been cleaned even without this callback. e.g. closing of applicaion while option menu disappear 
+    		// effect is running, would cause it. There is no need to request cleaning again.
+    		iFinishedCleanupStackEffects.Append(aHandle);
+    		}
+    	}
+    // If the finish request comes from the plugin, the plugin is not interested
+    // in getting a notification of the transition end.
+    __ALFFXLOGSTRING1("Gfx transition finished, handle %d", aHandle );
+    if ( aHandle == KErrNotFound )
+        {
+        __ALFFXLOGSTRING("invalid handle");
+        }
+    // alftranstion plugin may cancel end timers connected to this effect
+    TBool fsEffectDone = iFullScreenEffectData && aHandle == iFullScreenEffectData->iHandle;
+    if ( fsEffectDone )
+        {
+        aHandle = iFullScreenEffectData->iCompletionHandle;
+        }
+    RProperty::Set( KPSAlfDomain, KAlfTransitionStatus, aHandle );
+
+    // Effect finished
+    if ( fsEffectDone )
+        {
+        delete iFullScreenEffectData;
+        iFullScreenEffectData = NULL;
+        }
+    }
+    
+
+void CAlfBridge::PrintAllocMem()
+    {
+#ifdef _ALF_LOGGING
+    TInt allocCells = 0;
+    TInt allocSpace = 0;
+    TInt freeSpace = 0;
+    TInt largestFreeBlock = 0;
+    allocCells = User::AllocSize( allocSpace );
+    freeSpace = User::Available( largestFreeBlock );
+    __ALFLOGSTRING2("CAlfBridge::PrintAllocMem - alloc cells %d, alloc space %d", allocCells, allocSpace );
+    __ALFLOGSTRING2("CAlfBridge::PrintAllocMem - free space %d, largest free block %d", freeSpace, largestFreeBlock );
+#endif
+    }
+      
+// ---------------------------------------------------------------------------
+// DebugPrintControlGroupOrder
+//
+// Note, that HUI_DEBUG_TRACK_DRAWING must be enabled if you want to see the 
+// real process names
+// ---------------------------------------------------------------------------
+// 
+
+#ifdef ALF_DEBUG_PRINT_WINDOWGROUP_ORDER
+void CAlfBridge::DebugPrintControlGroupOrder(CAlfScreen& aScreen, CHuiRoster& aRoster, CHuiControlGroup& aGroup)
+    {
+    __ALFLOGSTRING(">> ---AFTER-----");    
+    for (TInt i=0; i<aRoster.Count();i++)
+        {
+        CHuiControlGroup& indexedGroup = aRoster.ControlGroup(i);
+        
+        if (&indexedGroup == &aGroup)
+            {
+            __ALFLOGSTRING("<<");                                        
+            }
+#ifdef  HUI_DEBUG_TRACK_DRAWING
+        TInt clientWindowGroupId = FindClientWindowGroupId( aScreen.iScreenNum, indexedGroup );
+
+        TFileName processName = iCommandDebug->WServClientFileName( clientWindowGroupId, CHuiStatic::WsSession() );
+#endif         
+        if (indexedGroup.Control(0).Role() == EAlfWindowGroupContainer)
+            {
+            if (aRoster.ControlGroup(i).ResourceId() == iAlfWindowGroupNodeId)
+                {
+#ifdef  HUI_DEBUG_TRACK_DRAWING
+                __ALFLOGSTRING2(">> %d WINDOW GROUP (ALF), %d", i, clientWindowGroupId);                                    
+#endif         
+                }
+            else
+                {
+#ifdef  HUI_DEBUG_TRACK_DRAWING
+                __ALFLOGSTRING3(">> %d WINDOW GROUP %S, %d", i, &processName, clientWindowGroupId);
+#else
+                __ALFLOGSTRING1(">> %d WINDOW GROUP", i);            
+#endif
+                }                    
+            }
+        else if (indexedGroup.Control(0).Role() == EAlfSessionContainer)
+            {
+#ifdef  HUI_DEBUG_TRACK_DRAWING
+            __ALFLOGSTRING2(">> %d ALF GROUP, %d", i, clientWindowGroupId);                        
+#endif
+            }
+        else if (indexedGroup.Control(0).Role() == EAlfWindowFloatingSpriteContainer)
+            {
+#ifdef  HUI_DEBUG_TRACK_DRAWING			
+            __ALFLOGSTRING3(">> %d FLOATING SPRITE GROUP %S, %d", i, &processName, clientWindowGroupId);                                            
+#else
+            __ALFLOGSTRING1(">> %d FLOATING SPRITE GROUP", i);                                            
+#endif
+            }
+        else if (indexedGroup.Control(0).Role() == EAlfFullScreenEffectContainer)
+            {
+#ifdef  HUI_DEBUG_TRACK_DRAWING
+            __ALFLOGSTRING3(">> %d EFFECT GROUP %S, %d", i, &processName, clientWindowGroupId );                                                                
+#else
+            __ALFLOGSTRING1(">> %d EFFECT GROUP", i);                                                                
+#endif
+            }
+        else 
+            {
+#ifdef  HUI_DEBUG_TRACK_DRAWING
+            __ALFLOGSTRING3(">> %d UNKNOWN GROUP ?!!? %S, %d", i, &processName, clientWindowGroupId );
+#endif
+            }                                                
+
+        if (&indexedGroup == &aGroup)
+            {
+            __ALFLOGSTRING("<<");                                        
+            }            
+        }
+    
+    // Print the group that has keyboard focus
+    TInt focusWindowGroupId = CHuiStatic::WsSession().GetFocusWindowGroup();
+    TFileName processName;
+    TThreadId threadId;
+    TInt error = CHuiStatic::WsSession().GetWindowGroupClientThreadId( focusWindowGroupId, threadId );
+    RThread thread;
+    TInt err = thread.Open( threadId );
+    if( !err )
+        {
+        RProcess process;
+        err = thread.Process( process );
+        if( !err )
+            {
+            processName = process.FileName();
+            __ALFLOGSTRING2( ">> Keyboard focus group: %S, %d", &processName, focusWindowGroupId );
+            }
+        process.Close();
+        thread.Close();
+        }      
+    __ALFLOGSTRING(">> ---------------");                
+    }
+#else
+void CAlfBridge::DebugPrintControlGroupOrder(CAlfScreen& /*aScreen*/, CHuiRoster& /*aRoster*/, CHuiControlGroup& /*aGroup*/)
+    {
+    }
+#endif        
+
+#ifdef ALF_DEBUG_VISUALIZE_WINDOWGROUP_ORDER
+void CAlfBridge::VisualizeControlGroupOrderL(CHuiRoster& aRoster, CHuiControlGroup& /*aGroup*/)
+    {       
+    TInt nbrofcolums = 3;
+    TInt nbrofrows = 3;
+    TInt gridIndex = 0;
+    TBool skipEmpty = EFalse;
+    if (aRoster.Count() > 3)
+        {
+        for (TInt i=aRoster.Count() - 3; i>0; i--)
+            {
+            CHuiControl& control = aRoster.ControlGroup(i).Control(0);
+            if (skipEmpty)
+                {                        
+                TBool empty = ETrue;
+                CHuiLayout* layout = (CHuiLayout*)&control.Visual(0);
+                for (TInt j=layout->Count()-1; j >= 0; j--)
+                    {
+                    CHuiCanvasVisual* canvasVisual = (CHuiCanvasVisual*) &layout->Visual(j);
+                    if (canvasVisual && canvasVisual->DisplayRect().Size().Round() != TSize(0,0) && canvasVisual->PaintedAreaCount())
+                        {
+                        empty = EFalse;        
+                        break;
+                        }                        
+                    }
+                
+                if (empty && skipEmpty)
+                    {
+                    continue;   
+                    }                    
+                }
+            
+            TSize screensize = HuiUtil::ScreenSize();
+            CHuiTransformation::TTransform& step = aRoster.ControlGroup(i).Transformation().Step(0);
+            step.iParams[EHuiTransformParamTranslateX].Set((gridIndex % nbrofcolums) * (screensize.iWidth/nbrofcolums), 500);
+            step.iParams[EHuiTransformParamTranslateY].Set((gridIndex / nbrofrows) * (screensize.iHeight/nbrofrows), 500);
+            gridIndex++;
+            }                        
+        }
+    iAlfScreens[0]->iDisplay->SetClearBackgroundL(CHuiDisplay::EClearWithSkinBackground);            
+    }
+#else
+void CAlfBridge::VisualizeControlGroupOrderL(CHuiRoster& /*aRoster*/, CHuiControlGroup& /*aGroup*/)
+    {       
+    }
+#endif    
+
+// ---------------------------------------------------------------------------
+// PostQTCommandBufferL
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::PostQTCommandBufferL( TAlfQtCommandBufferParams params )
+    {       
+    CHuiCanvasVisual* huiVisual = NULL;       
+    if ((*iHost))
+        {
+        if( (*iHost)->StreamerServer() )
+            { 
+            if ((*iHost)->StreamerServer()->WindowMgr())
+                {
+                RArray<TAlfWServInfo> winInfoList;
+                
+                (*iHost)->StreamerServer()->WindowMgr()->GetWinInfoListL( params.iWsWgId, 
+                        params.iWsClientId, winInfoList );
+                    
+                for ( TInt i= 0; i<winInfoList.Count(); i++ )
+                    {
+                    if( winInfoList[i].iClientSideId.iWindowIdentifer == params.iWsClientId )
+                        {
+						 huiVisual = FindVisual( winInfoList[i].iRefId.iWindowIdentifer );
+						 break;
+	                  }    
+                    }
+				 winInfoList.Close();                                
+                }
+            }
+        }
+    
+    if ( huiVisual )
+       {
+       TPtrC8 commands( (TUint8 *)params.iPtr, params.iLength );
+       TAlfCommandBufferStatus bufferStatus =  params.iBufferStatus;
+       huiVisual->SetCommandType( 1 ); // set to ECommandBufferWs should it be some QT specific?
+       if ( bufferStatus == EComplete )
+           {         
+           huiVisual->ClearCommandSet();
+           huiVisual->AddCommandSetL(commands);
+           }
+       else if ( bufferStatus == EPartial )
+           {
+           huiVisual->AddPartialCommandSetL( commands, EFalse );
+           }
+       else if ( bufferStatus == ELastPart )
+           {
+           huiVisual->AddPartialCommandSetL( commands, ETrue );
+           }
+       }    
+    }
+    
+
+// ---------------------------------------------------------------------------
+// SetClientWindowForDrawingL
+//
+// Note: One external content visual can exist in one canvas visual at the 
+// time. When external content visual is deleted, in destructor, it removes 
+// pointers to it from all canvas visuals. So canvasVisual->ExternalContent() 
+// always returns a valid pointer, or NULL. The parameter aRootVisual can 
+// be NULL, which means that the external content is removed from the canvas 
+// visual
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::SetClientWindowForDrawingL(TInt aWindowGroupId, TInt aClientWindowHandle, 
+	CHuiVisual* aExternalContentVisual)
+	{    	
+    RArray<TAlfWServInfo> winInfoList;
+    CleanupClosePushL(winInfoList);
+
+	// Find canvas visual for the RWindow
+	
+	(*iHost)->StreamerServer()->WindowMgr()->GetWinInfoListL(aWindowGroupId, aClientWindowHandle, winInfoList );
+	if(winInfoList.Count() != 1)
+		{
+		User::Leave(KErrArgument);
+		}
+
+	CHuiCanvasVisual* canvasVisual = (CHuiCanvasVisual*)FindVisual(winInfoList[0].iRefId.iWindowIdentifer);
+	if (!canvasVisual)
+		{
+		User::Leave(KErrNotFound);
+		}
+			
+	// Current external content 
+	CHuiVisual* currentContent = canvasVisual->ExternalContent();
+	
+	if (!aExternalContentVisual)
+		{	
+		// Do not draw external content any more. 
+			
+		// Disable external content for the canvas visual	
+		canvasVisual->SetExternalContentL(NULL);
+		// For the current content, enable drawing it in the original visual tree. 
+		if (currentContent)
+			{
+			currentContent->ClearFlag(EHuiVisualFlagDrawOnlyAsExternalContent);
+			}
+		}
+	else if (!(aExternalContentVisual->Flags() & EHuiVisualFlagDrawOnlyAsExternalContent))
+		{
+		// The visual is not yet used by other canvas visual
+		
+		// Enable external content for the canvas visual	
+		canvasVisual->SetExternalContentL(aExternalContentVisual);
+		// For the current content, enable drawing it in the original visual tree. 
+		if (currentContent)
+			{
+			currentContent->ClearFlag(EHuiVisualFlagDrawOnlyAsExternalContent);
+			}
+		// Disable normal drawing and start using as external content	
+		aExternalContentVisual->SetFlag(EHuiVisualFlagDrawOnlyAsExternalContent);
+		}   
+	else
+		{
+		// aExternalContentVisual is already used as an external content for some visual
+		User::Leave(KErrAlreadyExists);
+		}
+		
+	CleanupStack::PopAndDestroy(); // winInfoList
+	}
+
+void CAlfBridge::SetVisualTreeVisibilityChanged(TBool aChanged)
+    {
+    for (TInt i=0; i<iAlfScreens.Count();i++)
+        {
+        iAlfScreens[i]->iVisualTreeVisibilityChanged = aChanged;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::EnableSwRenderingL(TBool aEnable)
+    {    
+    if (aEnable == iSwRenderingEnabled)
+        {
+        return;
+        }
+    
+    iSwRenderingEnabled = aEnable;    
+    for (TInt i=0; i<iAlfScreens.Count();i++)
+        {
+        PrepareSwRenderingTarget(iAlfScreens[i]);        
+     
+        if (iSwRenderingEnabled)
+            {
+            CHuiTexture* texture = CHuiTexture::NewL();
+            CleanupStack::PushL(texture);
+            iAlfScreens[i]->iDisplay->SetForegroundBitmapL( iAlfScreens[i]->iSwRenderingTarget );
+            CleanupStack::Pop(texture);
+            iAlfScreens[i]->iDisplay->SetForegroundTexture(texture);
+            iAlfScreens[i]->iDisplay->iRosterObservers.AppendL(*this);
+            }
+        else
+            {
+            iAlfScreens[i]->iDisplay->SetForegroundBitmapL(NULL);            
+            iAlfScreens[i]->iDisplay->SetForegroundTexture(NULL);
+            iAlfScreens[i]->iDisplay->iRosterObservers.Remove(*this);            
+            }
+            
+        // SetCapturingBufferL is called from HandleVisualVisibility.
+        iAlfScreens[i]->SetVisualTreeVisibilityChanged(ETrue);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::UploadSwRenderingTargetL(CAlfScreen* aScreen)
+    {
+    if (iSwRenderingEnabled)
+        {
+        CHuiTexture* texture = aScreen->iDisplay->ForegroundTexture();                        
+        if (texture && aScreen->iSwRenderingTarget)
+            {
+            texture->UploadL(*aScreen->iSwRenderingTarget, NULL);                
+            }           
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfBridge::PrepareSwRenderingTarget( CAlfScreen* aScreen )
+    {
+    TBool modified = EFalse;
+    
+    // Check ultra low memory mode here
+    if (iHuiEnv->MemoryLevel() <= EHuiMemoryLevelLowest)
+        {        
+        if (!aScreen->iSwRenderingTarget)
+            {
+            // screen owns this bitmap
+            aScreen->iSwRenderingTarget = new CFbsBitmap;
+            if (aScreen->iSwRenderingTarget)
+                {
+                aScreen->iSwRenderingTarget->Create(aScreen->Size(), EColor16MA);
+                modified = ETrue;
+                }
+            }
+        
+        if (aScreen->iSwRenderingTarget)
+            {
+            if (aScreen->iSwRenderingTarget->SizeInPixels() != aScreen->Size())
+                {
+                aScreen->iSwRenderingTarget->Resize(aScreen->Size());
+                modified = ETrue;
+                }        
+            // For tests
+            //TUint32* data = aScreen->iSwRenderingTarget->DataAddress();
+            }
+        }
+    else
+        {
+        delete aScreen->iSwRenderingTarget;
+        aScreen->iSwRenderingTarget = NULL;
+        modified = ETrue;
+        }
+        
+    return modified;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::SetMemoryLevel(THuiMemoryLevel aMemoryLevel)
+    {
+    iCurrentMemoryLevel = aMemoryLevel;
+    DoUpdateMemoryLevel();    
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::SetLowMemory(TBool aEnabled)
+    {
+    iLowMemoryMode = aEnabled;
+    DoUpdateMemoryLevel();
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfBridge::ForceSwRendering(TBool aEnabled)
+    {
+    iForcedSwRendering = aEnabled;
+    DoUpdateMemoryLevel();
+    return KErrNone;        
+    }
+
+// ---------------------------------------------------------------------------
+// This decides memory level for core toolkit. This should the only place
+// where core toolkit memory level is modified.
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::DoUpdateMemoryLevel()
+    {
+    THuiMemoryLevel memoryLevel = iCurrentMemoryLevel;
+    if ( iLowMemoryMode && ( memoryLevel > EHuiMemoryLevelLow ) )
+        {
+        memoryLevel = EHuiMemoryLevelLow;
+        }
+    if ( iForcedSwRendering && ( memoryLevel > EHuiMemoryLevelLowest ) )
+        {
+        // For now, we use memory level to force SW rendering
+        // to be used.
+        memoryLevel = EHuiMemoryLevelLowest;
+        }
+    
+    if ( memoryLevel != iHuiEnv->MemoryLevel() )
+        {    
+        __ALFLOGSTRING1("CAlfBridge::DoUpdateMemoryLevel -> %d", memoryLevel);
+        if ( memoryLevel <= EHuiMemoryLevelLowest)
+            {
+            LowMemoryCancelAllEffects();
+            }
+            
+        iHuiEnv->NotifyMemoryLevel(memoryLevel);
+        if (memoryLevel <= EHuiMemoryLevelLowest)
+            {
+            TRAP_IGNORE(EnableSwRenderingL(ETrue));
+            }
+        else
+            {
+            TRAP_IGNORE(EnableSwRenderingL(EFalse));        
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::LowMemoryCancelAllEffects()
+    {
+    __ALFLOGSTRING("CAlfBridge::LowMemoryCancelAllEffects");
+    iLayoutSwitchEffectCoordinator->Cancel();
+    HandleGfxStopEvent( EFalse );
+	__ALFLOGSTRING("CAlfBridge::LowMemoryCancelAllEffects done");
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::NotifyRosterDrawStart(CHuiDisplay& /*aDisplay*/)
+    {
+    // Do nothing
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfBridge::NotifyRosterDrawEnd(CHuiDisplay& aDisplay)
+    {
+    TInt screenNumber = ResolveScreenNumber(aDisplay);    
+    TRAP_IGNORE(UploadSwRenderingTargetL(iAlfScreens[screenNumber]));
+    }
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfbrushhandlers.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1293 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   All the built in brush handlers
+*
+*/
+
+
+
+#include "alf/alfbrushhandlers.h"
+#include "alf/alfconstants.h"
+#include "alf/alfserverutils.h"
+#include "alf/alfmetric.h"
+#include <uiacceltk/HuiBrush.h>
+#include <uiacceltk/HuiBorderBrush.h>
+#include <uiacceltk/HuiImageBrush.h>
+#include <uiacceltk/HuiDropShadowBrush.h>
+#include <uiacceltk/HuiShadowBorderBrush.h>
+#include <uiacceltk/HuiGradientBrush.h>
+#include <uiacceltk/huiframebrush.h>
+#include <uiacceltk/HuiUtil.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfBrushHandler::CAlfBrushHandler(MAlfInterfaceProvider& aResolver)
+ : iResolver( aResolver ), iOwnsBrush(ETrue)
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfBrushHandler::ConstructL( CHuiBrush* aBrush )
+    {
+    if (!aBrush)
+        {
+        // the child class needs to provide the brush instance.
+        USER_INVARIANT();        
+        }
+    else 
+        {
+        iBrush = aBrush;    
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfBrushHandler::~CAlfBrushHandler()
+    {
+    if ( iOwnsBrush )
+        {
+        delete iBrush;
+        }
+    iBrush = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// From class ?base_class.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfBrushHandler::Release()
+    {
+    delete this;
+    }
+ 
+// ---------------------------------------------------------------------------
+// From class ?base_class.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C TAny* CAlfBrushHandler::GetInterface(
+    const THuiInterfaceSupport& aInterface)
+    {
+    switch ( aInterface ) 
+        {
+        case EHuiObjectTypeBrush:
+            return iBrush;
+        case EAlfBrushHandler:
+            return this;
+        
+        default:
+            return NULL;          
+        }
+    }
+   
+// ---------------------------------------------------------------------------
+// From class ?base_class.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfBrushHandler::HandleCmdL(
+    TInt aCommandId, 
+    const TDesC8& aInputBuffer, 
+    TDes8& aResponse)
+    {
+    switch (aCommandId)
+        {
+        case EAlfBrushGetOpacity:
+            {
+            TAlfTimedValue opacity;
+            AlfTimedValueUtility::CopyTimedValue(iBrush->iOpacity, opacity);
+            TPckg<TAlfTimedValue> resultPckg(opacity);
+            
+            aResponse = resultPckg; // awkward   
+            break;
+            }
+        case EAlfBrushSetOpacity:
+            {
+            TAlfTimedValue* opacity = (TAlfTimedValue*) aInputBuffer.Ptr() ;
+            AlfTimedValueUtility::CopyTimedValue(*opacity, iBrush->iOpacity, iResolver);            
+            break;
+            }
+            
+        case EAlfBrushSetLayer:
+            {
+            THuiBrushLayer* layer = (THuiBrushLayer*) aInputBuffer.Ptr() ;
+            iBrush->SetLayer( *layer );
+            break;
+            }
+        case EAlfBrushClipToVisual:
+            {
+            TBool clip = iBrush->ClipToVisual();
+            TPckg<TBool> resultPckg(clip);            
+            aResponse = resultPckg; // awkward   
+            break;
+            }
+        case EAlfBrushSetClipToVisual:
+            {
+            TBool* clip = (TBool*) aInputBuffer.Ptr() ;
+            iBrush->SetClipToVisual(*clip);
+            break;
+            }
+            
+        default:
+            User::Leave(KErrNotSupported);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// New method
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//     
+EXPORT_C void CAlfBrushHandler::SetOwnership(TBool aHolderOwnsBrush)
+    {
+    iOwnsBrush = aHolderOwnsBrush;
+    }
+ 
+EXPORT_C void CAlfBrushHandler::BrushHandlerExtension(const TUid& /*aExtensionUid*/, TAny** /*aExtensionParams*/)
+    {
+    
+    }
+ 
+ 
+ 
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfBorderBrushHandler::CAlfBorderBrushHandler(
+    MAlfInterfaceProvider& aResolver)
+: CAlfBrushHandler( aResolver ) 
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfBorderBrushHandler::ConstructL( 
+    CHuiBrush* aBrush,
+    TAlfXYMetric aThickness, 
+    TAlfXYMetric aEdgeOffset)
+    {
+    if (!aBrush)
+        {
+        THuiXYMetric huiThickness;
+        THuiXYMetric huiEdgeOffset;        
+        AlfXYMetricUtility::CopyMetric(aThickness, huiThickness);
+        AlfXYMetricUtility::CopyMetric(aEdgeOffset, huiEdgeOffset);
+        
+        CHuiBorderBrush* borderBrush = CHuiBorderBrush::NewLC( 
+            huiThickness, huiEdgeOffset);
+        CAlfBrushHandler::ConstructL( borderBrush );
+        CleanupStack::Pop( borderBrush );
+        }
+    else 
+        {
+        CAlfBrushHandler::ConstructL( aBrush );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MAlfExtension* CAlfBorderBrushHandler::NewL( 
+    MAlfInterfaceProvider& aResolver,
+    TAlfXYMetric aThickness, 
+    TAlfXYMetric aEdgeOffset)
+    {
+    CAlfBorderBrushHandler* self = new( ELeave ) CAlfBorderBrushHandler( aResolver );
+    CleanupStack::PushL( self );
+    self->ConstructL(
+        NULL,
+        aThickness,
+        aEdgeOffset );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfBorderBrushHandler::ConstructL( 
+    CHuiBrush* aBrush,
+    TInt aThicknessWidth, 
+    TInt aThicknessHeight,
+    TInt aEdgeOffsetX, 
+    TInt aEdgeOffsetY )
+    {
+    if (!aBrush)
+        {
+        CHuiBorderBrush* borderBrush = CHuiBorderBrush::NewLC( 
+            aThicknessWidth,
+            aThicknessHeight,
+            aEdgeOffsetX,
+            aEdgeOffsetY);
+        CAlfBrushHandler::ConstructL( borderBrush );
+        CleanupStack::Pop( borderBrush );
+        }
+    else 
+        {
+        CAlfBrushHandler::ConstructL( aBrush );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MAlfExtension* CAlfBorderBrushHandler::NewL( 
+    MAlfInterfaceProvider& aResolver,
+    TInt aThicknessWidth, 
+    TInt aThicknessHeight,
+    TInt aEdgeOffsetX, 
+    TInt aEdgeOffsetY )
+    {
+    CAlfBorderBrushHandler* self = new( ELeave ) CAlfBorderBrushHandler( aResolver );
+    CleanupStack::PushL( self );
+    self->ConstructL(
+        NULL,
+        aThicknessWidth,
+        aThicknessHeight,
+        aEdgeOffsetX,
+        aEdgeOffsetY );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfBorderBrushHandler::~CAlfBorderBrushHandler()
+    {
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// From class ?base_class.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfBorderBrushHandler::Release()
+    {
+    delete this;
+    }
+ 
+// ---------------------------------------------------------------------------
+// From class ?base_class.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C TAny* CAlfBorderBrushHandler::GetInterface(
+    const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfBrushHandler::GetInterface(aInterface);   
+    }
+   
+// ---------------------------------------------------------------------------
+// From class ?base_class.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfBorderBrushHandler::HandleCmdL(
+    TInt aCommandId, 
+    const TDesC8& aInputBuffer, 
+    TDes8& aResponse)
+    {
+    CHuiBorderBrush* borderBrush = static_cast<CHuiBorderBrush*>(iBrush);
+    
+    switch (aCommandId)
+        {
+        case EAlfBorderBrushSetImage:
+            {
+            TAlfImageParams* params = (TAlfImageParams*) aInputBuffer.Ptr();
+        	
+            // Todo: is is safe enough to handle textures as direct casts..
+        	TInt handle = params->iTextureHandle;
+        	MHuiTexture* texture = reinterpret_cast<MHuiTexture*>(handle);
+   	        THuiImage huiImage;
+   	        if (texture)
+   	            {
+   	            huiImage = THuiImage(*texture, 
+	                params->iTl.iX.ValueNow(),
+	                params->iTl.iY.ValueNow(),
+	                params->iBr.iX.ValueNow(),
+	                params->iBr.iY.ValueNow());    
+   	            
+    	        // We take transition time from one, assuming it is same for everyone.
+    	        TInt transitionTime = params->iBr.iY.TimeToTargetinMilliSeconds();
+    	        
+    	        huiImage.SetTexCoords(params->iTl.iX.Target(),
+    	            params->iTl.iY.Target(),
+    	            params->iBr.iX.Target(),
+    	            params->iBr.iY.Target(),
+    	            transitionTime );
+   	            }
+	            
+	        borderBrush->SetImage( huiImage );
+            break;
+            }
+            
+        case EAlfBorderBrushSetColor:
+            {
+            TRgb* color = (TRgb*) aInputBuffer.Ptr();
+            borderBrush->SetColor( *color );
+            break;
+            }
+            
+        case EAlfBorderBrushSetThickness:
+            {
+            TAlfTimedPoint* value = (TAlfTimedPoint*) aInputBuffer.Ptr();
+            AlfTimedPointUtility::CopyTimedPoint(*value, borderBrush->iThickness, iResolver);            
+            break;
+            }
+        case EAlfBorderBrushSetThicknessMetric:
+            {
+            TAlfXYMetric* value = (TAlfXYMetric*) aInputBuffer.Ptr();
+            THuiXYMetric huivalue;
+            AlfXYMetricUtility::CopyMetric(*value, huivalue);            
+            borderBrush->SetThickness(huivalue);
+            break;
+            }
+            
+        case EAlfBorderBrushGetThickness:
+            {
+            TAlfTimedPoint value;
+            AlfTimedPointUtility::CopyTimedPoint(borderBrush->iThickness, value);
+            TPckg<TAlfTimedPoint> resultPckg(value);            
+            aResponse = resultPckg; 
+            break;
+            }
+            
+        case EAlfBorderBrushSetEdgeOffset:
+            {
+            TAlfTimedPoint* value = (TAlfTimedPoint*) aInputBuffer.Ptr();
+            AlfTimedPointUtility::CopyTimedPoint(*value, borderBrush->iEdgeOffset, iResolver);            
+            break;
+            }
+        case EAlfBorderBrushSetEdgeOffsetMetric:
+            {
+            TAlfXYMetric* value = (TAlfXYMetric*) aInputBuffer.Ptr();
+            THuiXYMetric huivalue;
+            AlfXYMetricUtility::CopyMetric(*value, huivalue);            
+            borderBrush->SetEdgeOffset(huivalue);
+            break;
+            }
+            
+        case EAlfBorderBrushGetEdgeOffset:
+            {
+            TAlfTimedPoint value;
+            AlfTimedPointUtility::CopyTimedPoint(borderBrush->iEdgeOffset, value);
+            TPckg<TAlfTimedPoint> resultPckg(value);            
+            aResponse = resultPckg; 
+            break;
+            }
+            
+        case EAlfBorderBrushSetImageOffset:
+            {
+            TAlfTimedPoint* value = (TAlfTimedPoint*) aInputBuffer.Ptr();
+            AlfTimedPointUtility::CopyTimedPoint(*value, borderBrush->iImageOffset, iResolver);            
+            break;
+            }
+        case EAlfBorderBrushSetImageOffsetMetric:
+            {
+            TAlfXYMetric* value = (TAlfXYMetric*) aInputBuffer.Ptr();
+            THuiXYMetric huivalue;
+            AlfXYMetricUtility::CopyMetric(*value, huivalue);            
+            borderBrush->SetImageOffset(huivalue);
+            break;
+            }
+            
+        case EAlfBorderBrushGetImageOffset:
+            {
+            TAlfTimedPoint value;
+            AlfTimedPointUtility::CopyTimedPoint(borderBrush->iImageOffset, value);
+            TPckg<TAlfTimedPoint> resultPckg(value);            
+            aResponse = resultPckg; 
+            break;
+            }
+            
+        default:
+            CAlfBrushHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+        }
+    }
+
+EXPORT_C void CAlfBorderBrushHandler::BrushHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfBrushHandler::BrushHandlerExtension(aExtensionUid, aExtensionParams);
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfImageBrushHandler::CAlfImageBrushHandler(
+    MAlfInterfaceProvider& aResolver)
+: CAlfBrushHandler( aResolver ) 
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageBrushHandler::ConstructL( 
+    CHuiBrush* aBrush, THuiImage aImage)
+    {
+    if (!aBrush)
+        {
+        CHuiImageBrush* imageBrush = CHuiImageBrush::NewLC(aImage);
+        CAlfBrushHandler::ConstructL( imageBrush );
+        CleanupStack::Pop( imageBrush );
+        }
+    else 
+        {
+        CAlfBrushHandler::ConstructL( aBrush );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MAlfExtension* CAlfImageBrushHandler::NewL( 
+    MAlfInterfaceProvider& aResolver, THuiImage aImage )
+    {
+    CAlfImageBrushHandler* self = new( ELeave ) CAlfImageBrushHandler( aResolver );
+    CleanupStack::PushL( self );
+    self->ConstructL( NULL , aImage );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfImageBrushHandler::~CAlfImageBrushHandler()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// From class ?base_class.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfImageBrushHandler::Release()
+    {
+    delete this;
+    }
+ 
+// ---------------------------------------------------------------------------
+// From class ?base_class.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C TAny* CAlfImageBrushHandler::GetInterface(
+    const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfBrushHandler::GetInterface(aInterface);   
+    }
+   
+// ---------------------------------------------------------------------------
+// From class ?base_class.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfImageBrushHandler::HandleCmdL(
+    TInt aCommandId, 
+    const TDesC8& aInputBuffer, 
+    TDes8& aResponse)
+    {
+    CHuiImageBrush* imageBrush = static_cast<CHuiImageBrush*>(iBrush);
+    
+    switch (aCommandId)
+        {
+        case EAlfImageBrushSetBorders:
+            {
+            TAlfImageBrushParams* params = (TAlfImageBrushParams*) aInputBuffer.Ptr();
+            imageBrush->SetBorders(params->iLeftBorderWidth, 
+                params->iRightBorderWidth, 
+                params->iTopBorderWidth, 
+                params->iBottomBorderWidth);
+            break;
+            }
+        case EAlfImageBrushSetImage:
+            {
+            TAlfImageBrushParams* params = (TAlfImageBrushParams*) aInputBuffer.Ptr();
+            MHuiTexture* texture = reinterpret_cast<MHuiTexture*> (params->iTextureHandle);
+   	        THuiImage huiImage;
+   	        if (texture)
+   	            {
+   	            huiImage.SetTexture(*texture);
+   	            
+   	            huiImage.SetTexCoords(params->iTl.iX.Target(),
+                                   params->iTl.iY.Target(),
+                                   params->iBr.iX.Target(),
+                                   params->iBr.iY.Target());
+   	            }
+
+            imageBrush->SetImage(huiImage);
+            imageBrush->SetBorders(params->iLeftBorderWidth, 
+                    params->iRightBorderWidth, 
+                    params->iTopBorderWidth,
+                    params->iBottomBorderWidth);
+            break;
+            }
+            
+        case EAlfImageBrushSetScaleMode:
+            {
+            CHuiImageVisual::TScaleMode* scale = (CHuiImageVisual::TScaleMode*) aInputBuffer.Ptr() ;
+            imageBrush->SetScaleMode( *scale );
+            break;
+            }
+            
+        case EAlfImageBrushSetScale:
+            {
+            TAlfTimedValue* scale = (TAlfTimedValue*) aInputBuffer.Ptr() ;
+            AlfTimedValueUtility::CopyTimedValue(*scale, imageBrush->iScale, iResolver);  
+            break;
+            }
+            
+        case EAlfImageBrushScale:
+            {
+            TAlfTimedValue scale;
+            AlfTimedValueUtility::CopyTimedValue(imageBrush->iScale, scale);
+            TPckg<TAlfTimedValue> resultPckg(scale);
+            aResponse = resultPckg;
+            break;
+            }
+            
+        case EAlfImageBrushSetOffset:
+            {
+            TAlfTimedPoint* offset = (TAlfTimedPoint*) aInputBuffer.Ptr();
+            AlfTimedPointUtility::CopyTimedPoint(*offset, imageBrush->iImageOffset, iResolver); 
+            break;
+            }
+            
+        case EAlfImageBrushOffset:
+            {
+            TAlfTimedPoint point;
+            AlfTimedPointUtility::CopyTimedPoint(imageBrush->iImageOffset, point);
+            TPckg<TAlfTimedPoint> buf(point);
+            aResponse = buf;
+            break;
+            }
+            
+        default:
+            CAlfBrushHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+        }
+    }
+
+EXPORT_C void CAlfImageBrushHandler::BrushHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfBrushHandler::BrushHandlerExtension(aExtensionUid, aExtensionParams);
+    }
+
+
+
+// SHADOW BORDER BRUSH HANDLER
+
+EXPORT_C MAlfExtension* CAlfShadowBorderBrushHandler::NewL( 
+        MAlfInterfaceProvider& aResolver,
+        TInt aWidth )
+    {
+    CAlfShadowBorderBrushHandler* self = new( ELeave ) CAlfShadowBorderBrushHandler( aResolver );
+    CleanupStack::PushL( self );
+    self->ConstructL(
+        NULL,
+        aWidth );
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+EXPORT_C CAlfShadowBorderBrushHandler::CAlfShadowBorderBrushHandler(
+    MAlfInterfaceProvider& aResolver )
+    : CAlfBrushHandler( aResolver )
+    {
+    }
+    
+EXPORT_C void CAlfShadowBorderBrushHandler::ConstructL( 
+        CHuiBrush* aBrush,
+        TInt aWidth)
+    {
+    if (!aBrush)
+        {
+        CHuiShadowBorderBrush* shadowBorderBrush = CHuiShadowBorderBrush::NewLC( 
+           aWidth );
+        CAlfBrushHandler::ConstructL( shadowBorderBrush );
+        CleanupStack::Pop( shadowBorderBrush );
+        }
+    else 
+        {
+        CAlfBrushHandler::ConstructL( aBrush );
+        }
+    }
+
+EXPORT_C MAlfExtension* CAlfShadowBorderBrushHandler::NewL( 
+        MAlfInterfaceProvider& aResolver,
+        TAlfMetric aWidth )
+    {    
+    CAlfShadowBorderBrushHandler* self = new( ELeave ) CAlfShadowBorderBrushHandler( aResolver );
+    CleanupStack::PushL( self );
+    self->ConstructL(
+        NULL,
+        aWidth );
+    CleanupStack::Pop( self );  
+    return self;
+    }
+        
+EXPORT_C void CAlfShadowBorderBrushHandler::ConstructL( 
+        CHuiBrush* aBrush,
+        TAlfMetric aWidth)
+    {
+    if (!aBrush)
+        {
+        THuiMetric huiWidth;
+        AlfMetricUtility::CopyMetric(aWidth, huiWidth);
+        CHuiShadowBorderBrush* shadowBorderBrush = CHuiShadowBorderBrush::NewLC( 
+           huiWidth );
+        CAlfBrushHandler::ConstructL( shadowBorderBrush );
+        CleanupStack::Pop( shadowBorderBrush );
+        }
+    else 
+        {
+        CAlfBrushHandler::ConstructL( aBrush );
+        }
+    }
+    
+EXPORT_C CAlfShadowBorderBrushHandler::~CAlfShadowBorderBrushHandler()
+    {
+    }
+   
+    
+EXPORT_C void CAlfShadowBorderBrushHandler::Release()
+    {
+    delete this;
+    }
+    
+EXPORT_C TAny* CAlfShadowBorderBrushHandler::GetInterface(
+    const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfBrushHandler::GetInterface( aInterface );
+    }
+    
+EXPORT_C void CAlfShadowBorderBrushHandler::HandleCmdL(
+    TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    CHuiShadowBorderBrush* shadowBorderBrush = static_cast<CHuiShadowBorderBrush*>(iBrush);
+    
+    switch ( aCommandId )
+        {
+        case EAlfShadowBorderBrushGetWidth:
+            {
+            TAlfTimedValue value;
+            AlfTimedValueUtility::CopyTimedValue(shadowBorderBrush->iWidth, value);
+
+            TPckg<TAlfTimedValue> resultPckg(value);
+            aResponse = resultPckg; // awkward  
+            break;
+            }
+            
+        case EAlfShadowBorderBrushSetWidth:
+            {
+            TAlfTimedValue* value = (TAlfTimedValue*) aInputBuffer.Ptr() ;
+            AlfTimedValueUtility::CopyTimedValue(*value, shadowBorderBrush->iWidth, iResolver);            
+            break;
+            }
+
+        case EAlfShadowBorderBrushSetWidthMetric:
+            {
+            TAlfMetric* value = (TAlfMetric*) aInputBuffer.Ptr() ;
+            THuiMetric huivalue;
+            AlfMetricUtility::CopyMetric(*value, huivalue);            
+            shadowBorderBrush->SetWidth(huivalue);
+            break;
+            }            
+        default:
+            CAlfBrushHandler::HandleCmdL( aCommandId, aInputBuffer, aResponse );
+        }
+    }
+
+EXPORT_C void CAlfShadowBorderBrushHandler::BrushHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfBrushHandler::BrushHandlerExtension(aExtensionUid, aExtensionParams);
+    }
+    
+// DROP SHADOW BRUSH HANDLER  
+    
+EXPORT_C MAlfExtension* CAlfDropShadowBrushHandler::NewL( 
+        MAlfInterfaceProvider& aResolver,
+        TInt aDepth )
+    {
+    CAlfDropShadowBrushHandler* self = new( ELeave ) CAlfDropShadowBrushHandler( aResolver );
+    CleanupStack::PushL( self );
+    self->ConstructL(
+        NULL,
+        aDepth );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+EXPORT_C MAlfExtension* CAlfDropShadowBrushHandler::NewL( 
+        MAlfInterfaceProvider& aResolver,
+        TAlfMetric aDepth )
+    {
+    CAlfDropShadowBrushHandler* self = new( ELeave ) CAlfDropShadowBrushHandler( aResolver );
+    CleanupStack::PushL( self );
+    self->ConstructL(
+        NULL,
+        aDepth );
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+EXPORT_C CAlfDropShadowBrushHandler::CAlfDropShadowBrushHandler(
+    MAlfInterfaceProvider& aResolver)
+    : CAlfBrushHandler( aResolver )
+    {
+    }
+    
+EXPORT_C void CAlfDropShadowBrushHandler::ConstructL( 
+        CHuiBrush* aBrush,
+        TAlfMetric aDepth )
+    {
+    if (!aBrush)
+        {
+        THuiMetric huiDepth;
+        AlfMetricUtility::CopyMetric(aDepth, huiDepth);
+        CHuiDropShadowBrush* dropShadowBrush = CHuiDropShadowBrush::NewLC( 
+           huiDepth );
+        CAlfBrushHandler::ConstructL( dropShadowBrush );
+        CleanupStack::Pop( dropShadowBrush );
+        }
+    else 
+        {
+        CAlfBrushHandler::ConstructL( aBrush );
+        }
+    }
+
+EXPORT_C void CAlfDropShadowBrushHandler::ConstructL( 
+        CHuiBrush* aBrush,
+        TInt aDepth )
+    {
+    if (!aBrush)
+        {
+        CHuiDropShadowBrush* dropShadowBrush = CHuiDropShadowBrush::NewLC( 
+           aDepth );
+        CAlfBrushHandler::ConstructL( dropShadowBrush );
+        CleanupStack::Pop( dropShadowBrush );
+        }
+    else 
+        {
+        CAlfBrushHandler::ConstructL( aBrush );
+        }
+    }
+    
+EXPORT_C CAlfDropShadowBrushHandler::~CAlfDropShadowBrushHandler()
+    {
+    }
+
+    
+EXPORT_C void CAlfDropShadowBrushHandler::Release()
+    {
+    delete this;
+    }
+    
+EXPORT_C TAny* CAlfDropShadowBrushHandler::GetInterface(
+    const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfBrushHandler::GetInterface( aInterface );
+    }
+    
+EXPORT_C void CAlfDropShadowBrushHandler::HandleCmdL(
+    TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    CHuiDropShadowBrush* dropShadowBrush = static_cast<CHuiDropShadowBrush*>(iBrush);
+    
+    switch ( aCommandId )
+        {
+        case EAlfDropShadowBrushGetSoftness:
+            {
+            TAlfTimedValue value;
+            AlfTimedValueUtility::CopyTimedValue(dropShadowBrush->iSoftness, value);
+            TPckg<TAlfTimedValue> resultPckg(value);
+            aResponse = resultPckg; // awkward  
+            break;
+            }
+            
+        case EAlfDropShadowBrushSetSoftness:
+            {
+            TAlfTimedValue* value = (TAlfTimedValue*) aInputBuffer.Ptr() ;
+            AlfTimedValueUtility::CopyTimedValue(*value, dropShadowBrush->iSoftness, iResolver);            
+            break;
+            }
+        case EAlfDropShadowBrushSetSoftnessMetric:
+            {
+            TAlfMetric* value = (TAlfMetric*) aInputBuffer.Ptr() ;
+            THuiMetric huivalue;
+            AlfMetricUtility::CopyMetric(*value, huivalue);            
+            dropShadowBrush->SetSoftness(huivalue);
+            break;
+            }
+            
+        case EAlfDropShadowBrushGetDepth:
+            {
+            TAlfTimedValue value;
+            AlfTimedValueUtility::CopyTimedValue(dropShadowBrush->iDepth, value);
+
+            TPckg<TAlfTimedValue> resultPckg(value);
+            aResponse = resultPckg; // awkward  
+            break;
+            }
+            
+        case EAlfDropShadowBrushSetDepth:
+            {
+            TAlfTimedValue* value = (TAlfTimedValue*) aInputBuffer.Ptr() ;
+            AlfTimedValueUtility::CopyTimedValue(*value, dropShadowBrush->iDepth, iResolver);            
+            break;
+            }
+        case EAlfDropShadowBrushSetDepthMetric:
+            {
+            TAlfMetric* value = (TAlfMetric*) aInputBuffer.Ptr() ;
+            THuiMetric huivalue;
+            AlfMetricUtility::CopyMetric(*value, huivalue);            
+            dropShadowBrush->SetDepth(huivalue);
+            break;
+            }
+        case EAlfDropShadowBrushSetColor:
+            {
+            TRgb* value = (TRgb*) aInputBuffer.Ptr() ;
+            dropShadowBrush->SetColor(*value);
+            break;
+            }
+        default:
+            CAlfBrushHandler::HandleCmdL( aCommandId, aInputBuffer, aResponse );
+        }
+    }
+
+EXPORT_C void CAlfDropShadowBrushHandler::BrushHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfBrushHandler::BrushHandlerExtension(aExtensionUid, aExtensionParams);
+    }
+
+
+    
+// GRADIENT BRUSH HANDLER  
+    
+EXPORT_C MAlfExtension* CAlfGradientBrushHandler::NewL( 
+        MAlfInterfaceProvider& aResolver )
+    {
+    CAlfGradientBrushHandler* self = new( ELeave ) CAlfGradientBrushHandler( aResolver );
+    CleanupStack::PushL( self );
+    self->ConstructL( NULL );
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+EXPORT_C CAlfGradientBrushHandler::CAlfGradientBrushHandler(
+    MAlfInterfaceProvider& aResolver)
+    : CAlfBrushHandler( aResolver )
+    {
+    }
+    
+EXPORT_C void CAlfGradientBrushHandler::ConstructL( 
+        CHuiBrush* aBrush )
+    {
+    if (!aBrush)
+        {
+        CHuiGradientBrush* gradientBrush = CHuiGradientBrush::NewLC();
+        CAlfBrushHandler::ConstructL( gradientBrush );
+        CleanupStack::Pop( gradientBrush );
+        }
+    else 
+        {
+        CAlfBrushHandler::ConstructL( aBrush );
+        }
+    }
+    
+EXPORT_C CAlfGradientBrushHandler::~CAlfGradientBrushHandler()
+    {
+    }
+    
+    
+EXPORT_C void CAlfGradientBrushHandler::Release()
+    {
+    delete this;
+    }
+    
+EXPORT_C TAny* CAlfGradientBrushHandler::GetInterface(
+    const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfBrushHandler::GetInterface( aInterface );
+    }
+    
+EXPORT_C void CAlfGradientBrushHandler::HandleCmdL(
+    TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    CHuiGradientBrush* dropShadowBrush = static_cast<CHuiGradientBrush*>(iBrush);
+    
+    switch ( aCommandId )
+        { 
+        case EAlfGradientBrushSetDirection:
+            {
+            CHuiGradientBrush::TDirection* value = (CHuiGradientBrush::TDirection*) aInputBuffer.Ptr();
+            dropShadowBrush->SetDirection( *value );
+            break;
+            }
+            
+        case EAlfGradientBrushSetColor:
+            {
+            TAlfGradientBrushSetColorParams* value = (TAlfGradientBrushSetColorParams*) aInputBuffer.Ptr();
+            dropShadowBrush->SetColor( value->iColor, value->iOpacity );
+            break;
+            }
+            
+        case EAlfGradientBrushSetImage:
+            {
+            TAlfImageParams* params = (TAlfImageParams*) aInputBuffer.Ptr();
+        	
+            // Todo: is is safe enough to handle textures as direct casts..
+        	TInt handle = params->iTextureHandle;
+        	MHuiTexture* texture = reinterpret_cast<MHuiTexture*>(handle);
+   	        THuiImage huiImage;
+   	        if (texture)
+   	            {
+   	            huiImage = THuiImage(*texture, 
+	                params->iTl.iX.ValueNow(),
+	                params->iTl.iY.ValueNow(),
+	                params->iBr.iX.ValueNow(),
+	                params->iBr.iY.ValueNow());    
+   	            
+    	        // We take transition time from one, assuming it is same for everyone.
+    	        TInt transitionTime = params->iBr.iY.TimeToTargetinMilliSeconds();
+    	        
+    	        huiImage.SetTexCoords(params->iTl.iX.Target(),
+    	            params->iTl.iY.Target(),
+    	            params->iBr.iX.Target(),
+    	            params->iBr.iY.Target(),
+    	            transitionTime );
+   	            }
+	            
+	        dropShadowBrush->SetImage( huiImage );
+            break;
+            }
+            
+        case EAlfGradientBrushColor:
+            {
+            TInt* value = (TInt*) aInputBuffer.Ptr();
+            const TRgb result = dropShadowBrush->Color( *value );
+            TPckg<TRgb> resultPckg(result);
+            aResponse = resultPckg; // awkward  
+            break;
+            }
+            
+        case EAlfGradientBrushOpacity:
+            {
+            TInt* value = (TInt*) aInputBuffer.Ptr();
+            const TReal32 result = dropShadowBrush->Opacity( *value );
+            TPckg<TReal32> resultPckg(result);
+            aResponse = resultPckg; // awkward 
+            break;
+            }
+            
+        case EAlfGradientBrushAppendColor:
+            {
+            TAlfGradientBrushAppendColorParams* value = (TAlfGradientBrushAppendColorParams*) aInputBuffer.Ptr();
+            dropShadowBrush->AppendColorL( value->iPosition, value->iColor, value->iOpacity );
+            break;
+            }
+            
+        default:
+            CAlfBrushHandler::HandleCmdL( aCommandId, aInputBuffer, aResponse );
+        }
+    }
+
+EXPORT_C void CAlfGradientBrushHandler::BrushHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfBrushHandler::BrushHandlerExtension(aExtensionUid, aExtensionParams);
+    }
+
+
+// FRAME BRUSH HANDLER
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfFrameBrushHandler::CAlfFrameBrushHandler(
+    MAlfInterfaceProvider& aResolver)
+: CAlfBrushHandler( aResolver ) 
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfFrameBrushHandler::ConstructL( 
+    CHuiBrush* aBrush, const TAknsItemID& aIID, TInt aEdgeOffsetX, TInt aEdgeOffsetY)
+    {
+    if (!aBrush)
+        {
+        CHuiFrameBrush* brush = CHuiFrameBrush::NewLC(aIID,aEdgeOffsetX,aEdgeOffsetY);
+        CAlfBrushHandler::ConstructL( brush );
+        CleanupStack::Pop( brush );
+        }
+    else 
+        {
+        CAlfBrushHandler::ConstructL( aBrush );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfFrameBrushHandler::ConstructL( 
+    CHuiBrush* aBrush, const TAknsItemID& aIID, TAlfXYMetric aEdgeOffset)
+    {
+    if (!aBrush)
+        {
+        THuiXYMetric huiEdgeOffset;
+        AlfXYMetricUtility::CopyMetric(aEdgeOffset, huiEdgeOffset);
+        CHuiFrameBrush* brush = CHuiFrameBrush::NewLC(aIID, huiEdgeOffset);
+        CAlfBrushHandler::ConstructL( brush );
+        CleanupStack::Pop( brush );
+        }
+    else 
+        {
+        CAlfBrushHandler::ConstructL( aBrush );
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfFrameBrushHandler::ConstructL( 
+        CHuiBrush* aBrush, const THuiImage& aImage, TAlfXYMetric aEdgeOffset)
+    {
+    if (!aBrush)
+        {
+        THuiXYMetric huiEdgeOffset;
+        AlfXYMetricUtility::CopyMetric(aEdgeOffset, huiEdgeOffset);
+
+        CHuiFrameBrush* brush = CHuiFrameBrush::NewLC(aImage, huiEdgeOffset);
+        CAlfBrushHandler::ConstructL( brush );
+        CleanupStack::Pop( brush );
+        }
+    else 
+        {
+        CAlfBrushHandler::ConstructL( aBrush );
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MAlfExtension* CAlfFrameBrushHandler::NewL( 
+    MAlfInterfaceProvider& aResolver, const TAknsItemID& aIID, TInt aEdgeOffsetX, TInt aEdgeOffsetY )
+    {
+    CAlfFrameBrushHandler* self = new( ELeave ) CAlfFrameBrushHandler( aResolver );
+    CleanupStack::PushL( self );
+    self->ConstructL( NULL , aIID, aEdgeOffsetX, aEdgeOffsetY );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MAlfExtension* CAlfFrameBrushHandler::NewL( 
+    MAlfInterfaceProvider& aResolver, const TAknsItemID& aIID, TAlfXYMetric aEdgeOffset )
+    {
+    CAlfFrameBrushHandler* self = new( ELeave ) CAlfFrameBrushHandler( aResolver );
+    CleanupStack::PushL( self );
+    self->ConstructL( NULL , aIID, aEdgeOffset );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MAlfExtension* CAlfFrameBrushHandler::NewL( 
+        MAlfInterfaceProvider& aResolver, const THuiImage& aImage, TAlfXYMetric aEdgeOffset)
+    {
+    CAlfFrameBrushHandler* self = new( ELeave ) CAlfFrameBrushHandler( aResolver );
+    CleanupStack::PushL( self );
+    self->ConstructL( NULL , aImage, aEdgeOffset );
+    CleanupStack::Pop( self );
+    return self;        
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfFrameBrushHandler::~CAlfFrameBrushHandler()
+    {
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// From class ?base_class.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfFrameBrushHandler::Release()
+    {
+    delete this;
+    }
+ 
+// ---------------------------------------------------------------------------
+// From class ?base_class.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C TAny* CAlfFrameBrushHandler::GetInterface(
+    const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfBrushHandler::GetInterface(aInterface);   
+    }
+   
+// ---------------------------------------------------------------------------
+// From class ?base_class.
+// ?implementation_description
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C void CAlfFrameBrushHandler::HandleCmdL(
+    TInt aCommandId, 
+    const TDesC8& aInputBuffer, 
+    TDes8& aResponse)
+    {
+    CHuiFrameBrush* frameBrush = static_cast<CHuiFrameBrush*>(iBrush);
+    
+    switch (aCommandId)
+        {
+        case EAlfFrameBrushSetFrameRects:
+            {
+            TAlfFrameBrushParams* params = (TAlfFrameBrushParams*) aInputBuffer.Ptr();
+            frameBrush->SetFrameRectsL(params->iInnerRect, params->iOuterRect);
+            break;
+            }
+        case EAlfFrameBrushSetEdgeOffsetMetric:
+            {
+            TAlfXYMetric* params = (TAlfXYMetric*) aInputBuffer.Ptr();
+            THuiXYMetric huimetric;
+            AlfXYMetricUtility::CopyMetric(*params, huimetric);
+            frameBrush->SetEdgeOffset(huimetric);
+            break;
+            }
+        case EAlfFrameBrushSetImage:
+            {
+            TAlfImageParams* params = (TAlfImageParams*)aInputBuffer.Ptr();
+            // Todo: is is safe enough to handle textures as direct casts..
+        	TInt handle = params->iTextureHandle;
+        	MHuiTexture* texture = reinterpret_cast<MHuiTexture*>(handle);
+            THuiImage huiImage;
+            if (texture)
+                {
+                huiImage = THuiImage(*texture, 
+                    params->iTl.iX.ValueNow(),
+                    params->iTl.iY.ValueNow(),
+                    params->iBr.iX.ValueNow(),
+                    params->iBr.iY.ValueNow());    
+                
+    	        // We take transition time from one, assuming it is same for everyone.
+    	        TInt transitionTime = params->iBr.iY.TimeToTargetinMilliSeconds();
+    	        
+    	        huiImage.SetTexCoords(params->iTl.iX.Target(),
+    	            params->iTl.iY.Target(),
+    	            params->iBr.iX.Target(),
+    	            params->iBr.iY.Target(),
+    	            transitionTime );
+                }
+            
+            frameBrush->SetImage(huiImage);
+
+            break;
+            }
+        case EAlfFrameBrushSetFramePartImage:
+            {
+            TAlfFrameBrushFramePartImageParams* params = (TAlfFrameBrushFramePartImageParams*)aInputBuffer.Ptr();
+            // Todo: is is safe enough to handle textures as direct casts..
+        	TInt handle = params->iImage.iTextureHandle;
+        	MHuiTexture* texture = reinterpret_cast<MHuiTexture*>(handle);
+            THuiImage huiImage;
+            if (texture)
+                {
+                huiImage = THuiImage(*texture, 
+                    params->iImage.iTl.iX.ValueNow(),
+                    params->iImage.iTl.iY.ValueNow(),
+                    params->iImage.iBr.iX.ValueNow(),
+                    params->iImage.iBr.iY.ValueNow());    
+                
+    	        // We take transition time from one, assuming it is same for everyone.
+    	        TInt transitionTime = params->iImage.iBr.iY.TimeToTargetinMilliSeconds();
+    	        
+    	        huiImage.SetTexCoords(params->iImage.iTl.iX.Target(),
+    	            params->iImage.iTl.iY.Target(),
+    	            params->iImage.iBr.iX.Target(),
+    	            params->iImage.iBr.iY.Target(),
+    	            transitionTime );
+                }
+            
+            CHuiFrameBrush::TFrameParts part = CHuiFrameBrush::TFrameParts(params->iFramePart);
+            frameBrush->SetImage(part, huiImage);
+
+            break;
+            }
+        default:
+            CAlfBrushHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+        }
+    }
+
+EXPORT_C void CAlfFrameBrushHandler::BrushHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CAlfBrushHandler::BrushHandlerExtension(aExtensionUid, aExtensionParams);
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfhierarchymodel.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1184 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <graphics/wsgraphicscontext.h>
+#include <graphics/wsgraphicdrawerinterface.h>
+#include <bitstd.h>
+#include <fbs.h>
+#include <gdi.h>
+#include <e32math.h>
+#include <e32hashtab.h>
+#include <uiacceltk/HuiUtil.h>
+
+#include "alfhierarchymodel.h"
+#include "alfstreamerconsts.h"
+#include "alfstreamerserver.h"
+#include "alfwindowmanager.h"
+#include "alfstreamerbridge.h"
+#include "alfwindow.h"
+#include "alflogger.h"
+#ifdef ALF_DEBUG_TRACK_DRAWING 
+#include "alfcommanddebug.h"
+#endif
+#include "alfnodes.h"
+#include "huiwscanvascommands.h"
+
+#include "mwsgraphicscontexttobitgdimappings.h"
+
+const TInt KChunkCommitBatchSize = 10000;
+const TInt KChunkMaxSize = 500000;
+const TInt KFrameOffsetTemplate = 12345678;
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfHierarchyModel* CAlfHierarchyModel::NewL(CAlfStreamerServer& aServer)
+    {
+    CAlfHierarchyModel* self = new(ELeave)CAlfHierarchyModel(aServer);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::ConstructL()
+    {
+    iWindowPos = TPoint(0, 0 );
+    iSema.CreateLocal();
+    if (iServer.Bridge())
+        {
+        iServer.Bridge()->SetBatchObserver(this);
+        }                
+#ifdef ALF_DEBUG_TRACK_DRAWING 
+    iCommandDebugger = CAlfCommandDebug::NewL();
+#endif
+	}
+
+// ---------------------------------------------------------------------------
+// AppendScreenL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::AppendScreen( TInt aScreenNumber )
+    {
+    __ALFLOGSTRING1("CAlfHierarchyModel::AppendScreenL( %d )", aScreenNumber );
+    if ( aScreenNumber > 0 ) // first display comes with the package. only the following are created when requested
+        {
+        iServer.Bridge()->AddData( EAlfDSCreateNewDisplay, aScreenNumber, 0, NULL );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// RemoveScreenL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::RemoveScreen( TInt aScreenNumber )
+    {
+    if ( aScreenNumber < 1 ) 
+		{
+		// The main display cannot be removed.
+		return;
+		}
+	
+    __ALFLOGSTRING1("CAlfHierarchyModel::RemoveDisplayL( %d )", aScreenNumber );
+    // NOTE & TODO: This works fine, if we are removing the last added display. If we happen to remove display in the middle,
+    // then referring to displays by their indeces would be a major problem
+    // TODO: Who destroyes the nodes on this display? wserv?
+    iServer.Bridge()->AddData( EAlfDSDestroyDisplay, aScreenNumber, 0, NULL );
+    }
+
+// ---------------------------------------------------------------------------
+// destructor
+// ---------------------------------------------------------------------------
+//
+CAlfHierarchyModel::~CAlfHierarchyModel()
+    {
+    // we do not complete pending messages 
+	iPendingAlfWindowDataMessages.Close(); 
+	iNodeHashArray.Close();
+    if (iServer.Bridge())
+        {
+        iServer.Bridge()->SetBatchObserver(0);
+        }
+    delete iPeriodic;
+    iSema.Close();
+    if(iStream)
+        {
+        iStream->Close();
+        delete iStream;
+        iStream = NULL;
+        }
+    iChunk.Close();
+#ifdef ALF_DEBUG_TRACK_DRAWING 
+    delete iCommandDebugger;
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// ReleaseSemaphor
+// ---------------------------------------------------------------------------
+//
+void ReleaseSemaphor(TAny* aAlfHierarchyModel)
+    {
+    CAlfHierarchyModel* me = (CAlfHierarchyModel*)aAlfHierarchyModel;
+    me->DoReleaseSemaphor();
+    }
+
+// ---------------------------------------------------------------------------
+// DoReleaseSemaphor
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoReleaseSemaphor()
+    {
+    iSema.Signal();
+    }
+
+// ---------------------------------------------------------------------------
+// RequestPacketEndCallback
+// 
+// This is used to notify when certain offset in the chunk is freed. To avoid 
+// excessive notifications (and callbacks), skip some of the notifications.
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::RequestPacketEndCallback( TInt aOffset )
+    {
+    if ( aOffset > iPreviousCallbackOffset + KChunkCommitBatchSize || aOffset < iPreviousCallbackOffset )
+        {
+        iPreviousCallbackOffset = aOffset;
+        iServer.Bridge()->RequestCommandReadNotification( aOffset );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// RequestFrameEndCallback
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::RequestFrameEndCallback( )
+    {
+    __ALFLOGSTRING( "CAlfHierarchyModel::RequestFrameEndCallback" );
+    iServer.Bridge()->StartNewBlock();
+    }
+// ---------------------------------------------------------------------------
+// HandleMessageL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::HandleMessageL( const RMessage2& aMessage )
+    {
+    iSema.Wait();
+    CleanupStack::PushL(TCleanupItem(ReleaseSemaphor, this));
+    TBool doComplete= EFalse;
+    // __ALFLOGSTRING1( "CAlfHierarchyModel::HandleMessageL %d", aMessage.Function() );
+    switch (aMessage.Function())
+        {
+        case EAlfBridgerRequestDataBlock:
+            {
+            ShareChunkL( aMessage );
+            return;
+            }
+        case EDsNotifyNativeWindowData:
+            {
+            User::Leave(KErrNotSupported);
+            return;
+            }
+        case EAlfBridgerAsyncronousData:
+            {
+            if ( iChunk.Handle() )
+                {
+                ExecuteCommandsL();
+                if ( iBatchAlreadyCommited )
+                    {
+                    // This may happen, if alfstreamerbridge happens to process the commands (containing the EAlfCommitBatch) 
+                    //  before this asyncronous request is received.
+                    __ALFLOGSTRING("Batch already completed. Complete immediately");
+                    aMessage.Complete( EAlfBridgerAsyncronousData );
+                    iBatchAlreadyCommited = EFalse;
+                    }
+                else
+                    {
+                    SetSynchMessage(&aMessage);
+                    }
+                }
+            break;
+            }
+        case EAlfBridgerBlindSend:
+            {
+            ExecuteCommandsL();
+            CleanupStack::PopAndDestroy(); // releases iSema
+            aMessage.Complete( EAlfBridgerBlindSend );
+            return;
+            }
+        case EAlfBridgerSendChunk:
+            {
+            OpenChunkL( aMessage );
+			aMessage.Complete( EAlfBridgerSendChunk );
+            return;
+            }
+        default:
+            {
+            doComplete= ETrue;
+            __ALFLOGSTRING("CAlfHierarchyModel::HandleMessageL, default case reached.");
+            break;
+            }
+        }
+    if (doComplete && !aMessage.IsNull())
+        {
+        aMessage.Complete(KErrNotSupported);
+        }
+           
+    CleanupStack::PopAndDestroy(); // releases iSema
+    }
+
+// ---------------------------------------------------------------------------
+// ShareChunkL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::ShareChunkL( const RMessage2& aMessage )
+    {
+    if ( !iChunk.Handle() )
+        {
+        // For security reasons, alfserver owns the chunk. Because it is nameless, it cannot be accessed
+        // unless a handle to the chunk is given by alfserver
+        //
+        // TODO:CHECK what if somebody else wants to send EAlfBridgerRequestDataBlock. Currently we are giving the chunk
+        // to anybody who connects to the server.
+        iChunk.CreateDisconnectedGlobal( KNullDesC, 0, KChunkMaxSize, KChunkMaxSize ); //CreateDisconnectedGlobal
+        iChunkHeader  = reinterpret_cast<TChunkHeader*>(iChunk.Base());
+        memset( iChunkHeader, 0, sizeof( TChunkHeader ) );
+        }
+    TInt screenNumber = aMessage.Int1();
+    TPckg<TInt> pkgLength( KChunkMaxSize );
+    AppendScreen( screenNumber );
+    aMessage.WriteL(0, pkgLength );
+    aMessage.Complete( iChunk );
+    if ( iStream )
+        {
+        iStream->Close();
+        }
+    else
+        {
+        iStream = new(ELeave)RMemReadStream;
+        }
+    iStream->Open( iChunk.Base() + sizeof( TChunkHeader), KChunkMaxSize );
+    
+    CleanupStack::PopAndDestroy(); // releases iSema
+}
+
+// ---------------------------------------------------------------------------
+// ShareChunkL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::OpenChunkL( const RMessage2& aMessage )
+    {
+    TInt size = aMessage.Int0();
+    TInt32 handle = aMessage.Int1();
+    TBool openForReading = aMessage.Int2();
+    
+    iCacheChunks.Insert( handle, RChunk() );
+    iCacheChunks.Find( handle )->SetHandle( aMessage.Int1() );
+    iCacheChunks.Find( handle )->Open( aMessage, 1, EFalse, EOwnerProcess );
+    
+    if ( openForReading ) 
+        {
+        if (iStream)
+            {
+            iStream->Close();
+            }
+        else
+            {
+            iStream = new(ELeave)RMemReadStream;
+            }
+        
+        TUint8*  base = iCacheChunks.Find( handle )->Base();
+        iStream->Open( base + sizeof( TChunkHeader), size );
+
+        __ALFLOGSTRING1("Chunk in use %d", iChunkInUse );
+        iChunkInUse = handle;    
+        iChunkHeader  = reinterpret_cast<TChunkHeader*>(base);
+        }
+    CleanupStack::PopAndDestroy(); // releases iSema
+  
+}
+
+// ---------------------------------------------------------------------------
+// CloseChunkL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::CloseChunk( TInt32 aChunkHandle )
+    {
+    __ALFLOGSTRING1("CAlfHierarchyModel::CloseChunkL: closing %d", aChunkHandle );
+    RChunk* chunk = iCacheChunks.Find( aChunkHandle );
+    iCacheChunks.Remove( aChunkHandle );
+    if ( chunk )
+        {
+        chunk->Close();
+        }
+    else
+        {
+        __ALFLOGSTRING1( "CAlfHierarchyModel::CloseChunkL - Warning: chunk %d not found!", aChunkHandle );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ReadEndMarkerL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::ReadEndMarkerL()
+    {
+    TUint8 marker = iStream->ReadInt8L();
+    ASSERT( marker == EAlfCommandEndMarker ) ; // endmarker
+    }
+    
+// ---------------------------------------------------------------------------
+// ReadRectL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::ReadRectL( TRect& aRect, RMemReadStream* aStream )
+    {
+    aStream->ReadL( (TUint8*)&(aRect.iTl.iX), sizeof( TRect) );
+    }
+
+// ---------------------------------------------------------------------------
+// ReadRegionL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::ReadRegionL( RMemReadStream* aStream, RRegion& aRegion, TPoint aWindowPos )
+    {
+    aRegion.Clear();
+    TRect rect;
+    TInt count = aStream->ReadInt32L();
+    for (TInt i = 0 ; i < count ; i++ )
+        {
+        ReadRectL( rect, aStream );
+        rect.Move(-aWindowPos);
+        aRegion.AddRect( rect );
+        }
+    }
+	
+
+// ---------------------------------------------------------------------------
+// ExecuteCommandsL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::ExecuteCommandsL(  )
+    {
+    if ( !iStream )
+        {
+        return;
+        }
+    TInt offset = iStream->Source()->TellL( MStreamBuf::ERead ).Offset();
+
+
+#ifdef _ALF_LOGGING
+    TInt commandCount(0);
+    TSgcCanvasCommands previousCommand;
+#endif
+    TSgcCanvasCommands command = EAlfCommandNotInitialized;
+    TTime beginTime;
+    beginTime.HomeTime();
+    
+    __ALFLOGSTRING1( "CAlfHierarchyModel::ExecuteCommandsL - Committed write offset: %d", iChunkHeader->iCommittedWriteOffset );
+    while( iChunkHeader->iCommittedWriteOffset != offset )
+        {
+#ifdef _ALF_LOGGING
+        previousCommand = command;
+#endif
+        TRAPD( err,
+                command = (TSgcCanvasCommands)iStream->ReadUint8L();
+                iScreenNumber = iStream->ReadUint8L();
+            );
+        if ( err != KErrNone )
+	          {
+#ifdef _ALF_LOGGING
+	          __ALFLOGSTRING3("CAlfHierarchyModel::ExecuteCommandsL - Cmd: %d, Previous Cmd: %d, Count: %d..", command, previousCommand, commandCount );
+#endif	          
+	          __ALFLOGSTRING2("..CAlfHierarchyModel::ExecuteCommandsL - Offset: %d, LEAVE WITH ERROR: %d", offset, err  );
+              }
+        
+#ifdef ALF_DEBUG_TRACK_DRAWING 
+        commandCount++;
+        iUsedCommands[command]++;
+
+        iCommandDebugger->SetDescription( command );
+        __ALFLOGSTRING3("CAlfHierarchyModel::ExecuteCommandsL (%d) %S offset: %d,", command, &iCommandDebugger->Text(), offset );
+#endif        
+        switch ( command )
+            {
+        	case EAlfSetWindowId:
+                {
+                TUint32 nodeId = (TUint32)iStream->ReadUint32L();
+                CAlfNodeVisual* node = (CAlfNodeVisual*)FindNode( nodeId );
+
+                if ( node )
+                    {
+#ifdef ALF_DEBUG_TRACK_DRAWING					
+                    if (node->iId == iSearchNode || node->Tracking() )
+                        {
+                        RDebug::Print( _L( "CAlfHierarchyModel::ExecuteCommandsL - Tracking"));
+                        }
+#endif						
+#ifdef ALF_DEBUG_PRINT_NODE_INFO
+                    _LIT( KText, "Drawing");
+                    // node->PrintInfo(0, node, TPtrC(KText) , iSearchNode);
+#endif
+
+                    node->DrawWindowFrameL( *iStream );
+                    }
+                else
+                    {
+                    ProcessUnknownNodeDrawingL( *iStream );
+                    }
+                break;
+                }
+            case EAlfNodeCreated:
+                {
+                DoNodeCreatedL();
+                break;
+                }
+            case EAlfNodeReleased:
+                {
+                DoNodeReleasedL();
+                break;
+                }
+            case EAlfNodeActivated:
+                {
+                DoNodeActivatedL();
+                break;
+                }
+            case EAlfNodeExtentChanged:
+                {
+                DoNodeExtentChangedL();
+                break;
+                }
+            case EAlfNodeSiblingOrderChanged:
+                {
+                DoNodeSiblingOrderChangedL();
+                break;
+                }
+            case EAlfNodeFlagChanged:
+                {
+                DoNodeFlagChangedL();
+                break;
+                }
+            case EAlfNodeFadeCountChanged:
+                {
+                DoNodeFadeCountChangedL();
+                break;
+                }                
+            case EAlfNodeFadeAllChildren:
+                {
+                DoNodeFadeAllChildrenL();
+                break;
+                }                
+            case EAlfNodeTransparentRegionChanged:
+                {
+                DoNodeTransparentRegionChangedL();
+                break;
+                }
+            case EAlfNodeLayerAdded:
+                {
+                DoNodeLayerAddedL();
+                break;
+                }
+            case EAlfNodeLayerExtentChanged:
+                 {
+                 DoNodeLayerExtentChangedL();
+                 break;
+                 }               
+            case EAlfNodeLayerUsesAlphaFlagChanged:
+                 {
+                 DoNodeLayerUsesAlphaFlagChangedL();
+                 break;
+                 }               
+            case EAlfNodeMovedToWindowGroup:
+                {
+                DoNodeMovedToWindowGroupL();
+                break;
+                }
+            case EAlfNodeWindowGroupChained:
+                {
+                DoNodeWindowGroupChainedL();
+                break;
+                }
+            case EAlfNodeWindowGroupChainBrokenAfter:
+                {
+                DoNodeWindowGroupChainBrokenAfterL();
+                break;
+                }
+            case EAlfWrap:
+                {
+                ReadEndMarkerL(); // futile, but just in case somet
+                iStream->Source()->SeekL( MStreamBuf::ERead, TStreamPos(0));
+                iChunkHeader->iReadOffset = 0;
+                break;
+                }
+            case EAlfNodeAttributeChanged: // currently only textcursor may receive these events
+                {
+                DoNodeAttributeChangedL();
+                break;
+                }
+            case EAlfCommitBatch:
+                {
+                RequestFrameEndCallback();
+                break;
+                }
+#ifdef ALF_DEBUG_TRACK_DRAWING              
+            case EAlfDebugTrackNode:
+                {
+                DoNodeDebugTrackL();
+                break;
+                }
+#endif                
+            case EAlfDestroyChunk:
+                { 
+                TInt chunkId = iStream->ReadInt32L();
+                iServer.Bridge()->AddData( EAlfReleaseTemporaryChunk, chunkId );
+                break;
+                }
+            case EAlfJumpToAnotherChunk:
+                {
+                RequestPacketEndCallback( offset );
+                TInt32 readChunkId = iStream->ReadInt32L();
+                TInt size = iStream->ReadInt32L();
+                ReadEndMarkerL();
+                // __ALFLOGSTRING1("Next chunk: %d, size: %d, previous chunk: %d"), readChunkId, size, iChunkInUse );
+       
+                if ( readChunkId == 0 )
+                    {
+                    iChunkHeader  = reinterpret_cast<TChunkHeader*>(iChunk.Base());
+                    iStream->Close();
+                    iStream->Open( iChunk.Base() + sizeof( TChunkHeader), KChunkMaxSize );
+                    iStream->Source()->SeekL( MStreamBuf::ERead, TStreamPos(0)); 
+                    }
+                else
+                    {
+                    iStream->Close();
+                    iStream->Open( iCacheChunks.Find( readChunkId )->Base() + sizeof( TChunkHeader), size );
+                    iChunkHeader  = reinterpret_cast<TChunkHeader*>(iCacheChunks.Find( readChunkId )->Base());
+                    }
+                iChunkInUse = readChunkId;
+                
+                break;
+                }
+            default:
+                {
+                __ALFLOGSTRING("CAlfHierarchyModel::ExecuteCommandsL, off track");
+#ifdef _ALF_LOGGING
+                __ALFLOGSTRING3("CAlfHierarchyModel::ExecuteCommandsL, off track - Cmd: %d, Previous Cmd: %d, Count: %d..", command, previousCommand, commandCount );
+#endif                
+                __ALFLOGSTRING1("..CAlfHierarchyModel::ExecuteCommandsL, unrecoverable error : HALTING at offset: %d", offset );
+                USER_INVARIANT();  
+                break;
+                }
+            }
+        ReadEndMarkerL();
+        offset = iStream->Source()->TellL( MStreamBuf::ERead ).Offset();
+        RequestPacketEndCallback( offset );
+        //__ALFLOGSTRING1("end offset %d  offset %d, command %d"), aEndOffset, offset, command );
+        };
+    iFrame++;
+    }
+
+// ---------------------------------------------------------------------------
+// BridgerCallback
+// This is called by CAlfStreamBridge when EAlfCommitBatch is processed.
+//
+// Note: This call comes from another thread, Alf server thread. Beware that
+//       Alf streamer/decoder server thread might access the class data
+//       concurrently!
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::BridgerCallback( TInt aOp, TInt aInt )
+    {
+    // hackish, just do the panic release for window server
+    // Trying to mimize changes on existing logic
+    if (aOp == KRELEASEWINDOWSERVER)
+        {
+        __ALFLOGSTRING1("CAlfHierarchyModel::BridgerCallback, iMessage is null: %d", iMessage.IsNull());
+
+        if (!iMessage.IsNull()) 
+            {
+            __ALFLOGSTRING("CAlfHierarchyModel::BridgerCallback, emergency releasing of window server");
+            iMessage.Complete(EAlfBridgerAsyncronousData);
+            iDidForcedComplete = ETrue;
+            }
+        else if (aInt == KRELEASEDBEFOREQUEUE)
+            {
+            iBatchAlreadyCommited = ETrue;   
+            }    
+                  
+        return;
+        }        
+        
+    switch( aOp )
+        {
+        case EAlfDSGetAlfNativeWindowData:
+            {                        
+    		iSema.Wait();
+    		// Complete the pending message
+            RMessage2* rsMessage = (RMessage2*)aInt;
+    		for (TInt i = 0; i < iPendingAlfWindowDataMessages.Count(); i++)
+    			{
+    			if (&(iPendingAlfWindowDataMessages[i]) == rsMessage)
+    				{
+    				// Complete the message to RS
+    				rsMessage->Complete(KErrNone);
+    				iPendingAlfWindowDataMessages.Remove(i);
+    				break;
+    				}
+    			}
+		    iSema.Signal();
+            break;
+            }    
+
+        case EAlfRequestCommandReadNotification:
+            {
+    		if (iChunkHeader)
+    			{
+    			iChunkHeader->iReadOffset = aInt; // last read offset
+    			}
+                    
+            // TODO: If you can absolute guaranteen to count the available space correctly, then this can also complete iSpaceNotificationMessage
+            break;
+            }
+        case EAlfRequestCommitBatch:
+            {
+            __ALFLOGSTRING1("CAlfHierarchyModel::BridgerCallback, iMessage.IsNull %d", iMessage.IsNull());
+            if ( iMessage.IsNull())
+                {
+                if (!iDidForcedComplete)
+                    {
+                    __ALFLOGSTRING("request for this message has not arrived. complete on arrival");
+                    iBatchAlreadyCommited = ETrue;
+                    }
+                }
+            else
+                {
+                iBatchAlreadyCommited = EFalse;
+                iMessage.Complete(EAlfBridgerAsyncronousData);
+                }
+            iDidForcedComplete = EFalse;
+            break;
+            }
+        case EAlfReleaseTemporaryChunk:
+            {
+            CloseChunk( aInt );
+            break;
+            }
+        default:
+            {
+            USER_INVARIANT();                
+            }    
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// DoNodeCreatedL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoNodeCreatedL()
+    {
+#ifdef ALF_DEBUG_TRACK_DRAWING 
+    TBool trackThisNode(EFalse);
+#endif
+    CAlfNode* node = NULL;    
+    // Nodes add themself to iNodeStructArray, which "owns" the nodes. Nodes are created and destroyed only if requested by the Wserv
+    MWsWindowTreeNode::TType nodeType = (MWsWindowTreeNode::TType)iStream->ReadInt32L();
+    switch (nodeType)
+        {
+        case MWsWindowTreeNode::EWinTreeNodeClient:
+            {
+            node = CAlfNodeWindow::NewL( this, iStream, iScreenNumber );
+            break;
+            }
+        case MWsWindowTreeNode::EWinTreeNodeRoot:
+            {
+            node = CAlfNodeRoot::NewL( this ,iStream, iScreenNumber );
+            iRootNode = (CAlfNodeRoot*)node;
+            break;
+            }
+        case MWsWindowTreeNode::EWinTreeNodeGroup:
+            {
+            node = CAlfNodeGroup::NewL( this, iStream, iScreenNumber );
+            break;
+            }
+        case MWsWindowTreeNode::EWinTreeNodeAnim:
+            {
+            node = CAlfNodeAnim::NewL(this, iStream, iScreenNumber );
+            break;
+            }
+        case MWsWindowTreeNode::EWinTreeNodeSprite:
+            {
+            node = CAlfNodeSprite::NewL( this, iStream, iScreenNumber );
+            break;
+            }
+        case MWsWindowTreeNode::EWinTreeNodeStandardTextCursor:
+            {
+            node = CAlfNodeTextCursor::NewL( this, iStream, iScreenNumber );
+            break;
+            }
+        default:
+            {
+            __ALFLOGSTRING1("CAlfHierarchyModel::DoNodeCreatedL, unknown node type: %i", nodeType);
+            break;
+            }
+        }
+    // Note to Debuggers
+    // You can track certain type of nodes and their draw buffers by changing the trackThisNode value to 1. 
+    // Then enable breakpoints in 
+    // some places marked in code using the ALF_DEBUG_TRACK_DRAWING and HUI_DEBUG_TRACK_DRAWING . The macro 
+    // must be enabled in 
+    //   alfappservercore.mmp 
+    //   coretoolkit.mmp and
+    //   alfrenderstageplugin.mmp
+    
+#ifdef ALF_DEBUG_TRACK_DRAWING 
+    if ( trackThisNode )
+        {
+        node->SetTracking( trackThisNode );
+        }
+#endif
+    
+#ifdef ALF_DEBUG_PRINT_NODE_INFO    
+    if ( node )
+        {
+        RDebug::Print(_L("DoNodeCreatedL"));
+        iRootNode->iLogging = 1;
+        CAlfNode::PrintNodeTree(iRootNode, node->iId);
+        iRootNode->iLogging = 0;
+        //CAlfNode::PrintInfo( 0, (CAlfNodeVisual*)node, TPtrC(KText) , iSearchNode);
+        }
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// DoNodeReleasedL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoNodeReleasedL()
+    {
+    MWsWindowTreeNode::TType nodeType = (MWsWindowTreeNode::TType)iStream->ReadInt32L();
+    TUint32 nodeId = (TUint32)iStream->ReadUint32L();
+    CAlfNode* node = FindNode( nodeId );
+
+#ifdef ALF_DEBUG_PRINT_NODE_INFO    
+    if ( node )
+        {
+        //_LIT(KText,"DoNodeReleasedL");
+        CAlfNode::PrintNodeTree(iRootNode, node->iId);
+                
+//        CAlfNode::PrintInfo( 0, (CAlfNodeVisual*)node, TPtrC(KText) , iSearchNode);
+        }
+#endif    
+    if ( node )
+        {
+        delete node;
+        }
+    else
+        {
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// DoNodeActivatedL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoNodeActivatedL()
+    {
+    TInt nodeType = iStream->ReadInt32L();
+    TUint32 nodeId = (TUint32)iStream->ReadUint32L();
+    CAlfNode* node = FindNode( nodeId );
+    if ( node )
+        {
+        node->ActivateNode();
+        }
+    else
+        {
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// DoNodeExtentChangedL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoNodeExtentChangedL()
+    {
+    TRect rect;
+    ReadRectL( rect, iStream);
+    TUint32 nodeId = (TUint32)iStream->ReadUint32L();
+
+    CAlfNodeVisual* node = (CAlfNodeVisual*)FindNode( nodeId );
+    if ( node )
+       {
+       node->SetExtent( rect );
+       }
+    else
+        {
+        USER_INVARIANT();
+        }
+#ifdef ALF_DEBUG_PRINT_NODE_INFO    
+    if ( node )
+        {
+        RDebug::Print(_L("Extent changed"));
+        CAlfNode::PrintNodeTree(iRootNode, node->iId);
+        //CAlfNode::PrintInfo( 0, (CAlfNodeVisual*)node, TPtrC(KText), iSearchNode);
+        }
+#endif
+
+    }
+
+// ---------------------------------------------------------------------------
+// DoNodeSiblingOrderChangedL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoNodeSiblingOrderChangedL()
+    {
+    TInt newPos = iStream->ReadInt32L();
+    TUint32 nodeId = (TUint32)iStream->ReadUint32L();
+
+    CAlfNode* node = FindNode( nodeId );
+    if ( node )
+        {
+        node->SiblingOrderChanged( newPos );
+        }
+    else
+        {
+#ifdef _DEBUG
+        RDebug::Print( _L("Missing a node %d"), nodeId );
+#endif
+        // USER_INVARIANT();
+        }
+    
+#ifdef ALF_DEBUG_PRINT_NODE_INFO    
+    if ( node )
+        {
+        RDebug::Print(_L("Sibling order changed"));
+        CAlfNode::PrintNodeTree(iRootNode, node->iId);
+                
+        // CAlfNode::PrintInfo( 0, (CAlfNodeVisual*)node, TPtrC(KText), iSearchNode );
+        }
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// DoNodeFlagChangedL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoNodeFlagChangedL()
+    {
+    MWsWindowTreeObserver::TFlags flag = (MWsWindowTreeObserver::TFlags)iStream->ReadUint32L();
+    TBool newValue = (TBool)iStream->ReadInt32L();
+    TUint32 nodeId = (TUint32)iStream->ReadUint32L();
+
+    CAlfNode* node = FindNode( nodeId );
+    if ( node )
+        {
+        node->FlagChanged( flag, newValue );
+        
+        }
+    else
+        {
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// DoNodeFadeAllChildrenL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoNodeFadeAllChildrenL()
+    {
+    TUint32 nodeId = (TUint32)iStream->ReadUint32L();
+    TBool faded = (TBool)iStream->ReadInt32L();    
+
+    CAlfNode* node = FindNode( nodeId );
+    if ( node )
+        {
+        node->FadeAllChildren( faded );
+        }
+    else
+        {
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// DoNodeFadeCountChangedL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoNodeFadeCountChangedL()
+    {
+    TUint32 nodeId = (TUint32)iStream->ReadUint32L();
+    TInt fadeCount = (TInt)iStream->ReadUint32L();
+
+    CAlfNode* node = FindNode( nodeId );
+    if ( node )
+        {
+        node->FadeCountChanged( fadeCount );
+        }
+    else
+        {
+        USER_INVARIANT();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// DoNodeTransparentRegionChangedL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoNodeTransparentRegionChangedL()
+    {
+    TUint32 nodeId = (TUint32)iStream->ReadUint32L();
+    iStream->ReadInt8L();
+    RRegion newTransparentRegion;
+    RRegion newOpaqueRegion;
+    ReadRegionL( iStream, newTransparentRegion );
+    iStream->ReadInt8L();
+    ReadRegionL( iStream, newOpaqueRegion );
+    // TODO: Implement actions
+    }
+
+// ---------------------------------------------------------------------------
+// DoNodeLayerAddedL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoNodeLayerAddedL()
+    {
+    DoNodeLayerExtentChangedL();
+    }
+
+// ---------------------------------------------------------------------------
+// DoNodeLayerExtentChangedL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoNodeLayerExtentChangedL()
+    {   
+    // Set composition surface extent 
+    TUint32 nodeId = (TUint32)iStream->ReadUint32L();
+    TRect extent = TRect(0,0,0,0);
+    ReadRectL(extent, iStream); 
+    CAlfNodeVisual* node = (CAlfNodeVisual*)FindNode( nodeId );
+    if ( node && node->Window() )
+        {
+        // SetSurfaceExtent is not supported for image visual
+        node->Window()->SetSurfaceExtent( extent );
+        }
+    else if( node ) // this would mean that node has being orphaneded but not yet deleted
+        {
+        __ALFLOGSTRING1("CAlfHierarchyModel::DoNodeLayerExtentChangedL node found but window %d was destroyed", nodeId);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// DoNodeLayerUsesAlphaFlagChangedL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoNodeLayerUsesAlphaFlagChangedL()
+    {   
+    // Set composition surface extent 
+    TUint32 nodeId = (TUint32)iStream->ReadUint32L();
+    TBool enabled = (TBool)iStream->ReadInt32L();
+    CAlfNodeVisual* node = (CAlfNodeVisual*)FindNode( nodeId );
+    if ( node && node->Window() )
+        {
+        // SetLayerUsesAplhaFlag is not supported for image visual
+        node->Window()->SetLayerUsesAplhaFlag( enabled );
+        }
+    else if( node ) // this would mean that node has being orphaneded but not yet deleted
+        {
+        __ALFLOGSTRING1("CAlfHierarchyModel::DoNodeLayerUsesAlphaFlagChangedL node found but window %d was destroyed", nodeId);
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// DoNodeMovedToWindowGroupL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoNodeMovedToWindowGroupL()
+    {
+    TUint32 nodeId = (TUint32)iStream->ReadUint32L();
+    TUint32 newWindowgroupNode = (TUint32)iStream->ReadUint32L();
+    CAlfNodeWindow* node = (CAlfNodeWindow*)FindNode( nodeId );
+    if ( node )
+        {
+        node->MoveToWindowGroup( newWindowgroupNode );
+		} 
+    }
+
+// ---------------------------------------------------------------------------
+// DoNodeWindowGroupChainedL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoNodeWindowGroupChainedL()
+    {
+    TUint32 parentNode = (TUint32)iStream->ReadUint32L();
+    TUint32 childNode = (TUint32)iStream->ReadUint32L();
+    CAlfNodeGroup* node = (CAlfNodeGroup*)FindNode( parentNode );
+    if ( node )
+    	{
+    	node->WindowGroupChained( childNode );
+    	}
+    }
+
+// ---------------------------------------------------------------------------
+// DoNodeWindowGroupChainBrokenAfterL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoNodeWindowGroupChainBrokenAfterL()
+    {
+    TUint32 nodeId = (TUint32)iStream->ReadUint32L();
+    CAlfNodeGroup* node = (CAlfNodeGroup*)FindNode( nodeId );
+    if ( node )
+    	{
+    	node->GroupChainBrokenAfter();
+    	}
+    }
+
+// ---------------------------------------------------------------------------
+// DoNodeAttributeChangedL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::DoNodeAttributeChangedL()
+    {
+    TUint32 nodeId = (TUint32)iStream->ReadUint32L();
+    CAlfNodeTextCursor* node = (CAlfNodeTextCursor*)FindNode( nodeId);
+    if ( node && node->Type() == MWsWindowTreeNode::EWinTreeNodeStandardTextCursor )
+        {
+        node->AttributeChangedL( iStream );
+
+#ifdef ALF_DEBUG_PRINT_NODE_INFO    
+    if ( node )
+        {
+        //_LIT(KText,"Attribute changed");
+        //CAlfNode::PrintInfo( 0, (CAlfNodeVisual*)node, TPtrC(KText) , iSearchNode);
+        //CAlfNode::PrintNodeTree(iRootNode, KText, node->iId);
+                
+        }
+#endif  
+        }
+    else
+        {
+        USER_INVARIANT(); // attribute change for unexpected node type. new code needed!
+        }
+    }
+// ---------------------------------------------------------------------------
+// DoNodeWindowGroupChainBrokenAfterL
+// ---------------------------------------------------------------------------
+//
+#ifdef ALF_DEBUG_TRACK_DRAWING
+void CAlfHierarchyModel::DoNodeDebugTrackL()
+    {
+    TUint32 nodeId = (TUint32)iStream->ReadUint32L();
+    TBool trackingValue = iStream->ReadUint32L();
+    CAlfNodeGroup* node = (CAlfNodeGroup*)FindNode( nodeId );
+    if ( node )
+        {
+        node->SetTracking( trackingValue );
+        }
+    }
+#endif
+// ---------------------------------------------------------------------------
+// FindNode
+// ---------------------------------------------------------------------------
+//
+CAlfNode* CAlfHierarchyModel::FindNode( TUint32 aWindowId )
+    {
+    if ( iPreviouslySearchedNode && iPreviouslySearchedNode->iId == aWindowId )
+        {
+        return iPreviouslySearchedNode;
+        }
+    CNodeHashStruct* nodeHashStruct = iNodeHashArray.Find( aWindowId );
+    if (nodeHashStruct)
+        {
+        iPreviouslySearchedNode = nodeHashStruct->iNode;
+        return iPreviouslySearchedNode;
+        }
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// InsertNode
+// ---------------------------------------------------------------------------
+//
+TInt CAlfHierarchyModel::InsertNode( TUint32 aWindowId, CAlfNode* aNode  )
+    {
+    return iNodeHashArray.Insert( aWindowId, CNodeHashStruct( aNode ));
+    }
+
+// ---------------------------------------------------------------------------
+// RemoveNode
+// ---------------------------------------------------------------------------
+//
+TBool CAlfHierarchyModel::RemoveNode( TUint32 aWindowId )
+	{
+	iPreviouslySearchedNode = NULL;
+	return iNodeHashArray.Remove( aWindowId );
+	}
+
+// ---------------------------------------------------------------------------
+// RemoveAllNodes
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::RemoveAllNodes( )
+    {
+    // TODO: Is this useless? wserv will remove its nodes anyway, if screen is destroyed
+    }
+
+// ---------------------------------------------------------------------------
+// ProcessUnknownNodeDrawingL
+// ---------------------------------------------------------------------------
+//
+void CAlfHierarchyModel::ProcessUnknownNodeDrawingL( RMemReadStream& aStream )
+    {
+    TInt32 chunkInUse = aStream.ReadInt32L();
+    TInt nextFramePos = aStream.ReadInt32L();
+       
+    // jump to the next frame
+    if ( nextFramePos == KFrameOffsetTemplate )
+        {
+        __ALFLOGSTRING("CAlfHierarchyModel::PostBufferL, Address of the frame has not been initialized!");
+        } 
+    TUint8 padding = aStream.ReadInt8L();
+    aStream.ReadInt8L();
+    while( padding--)
+        {
+        aStream.ReadInt8L();
+        }
+    TInt currentPos = aStream.Source()->TellL( MStreamBuf::ERead ).Offset();
+    aStream.Source()->SeekL( MStreamBuf::ERead, TStreamPos(nextFramePos));
+    TSgcCanvasCommands packetState = (TSgcCanvasCommands)aStream.ReadInt8L();
+    switch( packetState )
+        {
+        case EAlfPacketReady: // fall through
+        case EAlfPacketNotReady:
+        default:
+            {
+            __ALFLOGSTRING1("CAlfHierarchyModel::PostBufferL endMarker: %d ", packetState);
+            break;
+            }
+        }
+    }
+    
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alflayouthandlers.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1350 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 of alf built-in visual support
+*
+*/
+
+
+
+#include "alf/alfvisualhandlers.h"
+#include "alf/alflayouthandlers.h"
+
+#include <uiacceltk/HuiGridLayout.h>
+#include <uiacceltk/HuiDeckLayout.h>
+#include <uiacceltk/HuiAnchorLayout.h>
+#include <uiacceltk/HuiFlowLayout.h>
+#include <uiacceltk/huiviewportlayout.h>
+#include <uiacceltk/HuiCurvePathLayout.h>
+#include <uiacceltk/HuiRealPoint.h>
+#include <uiacceltk/HuiUtil.h>
+
+#include "alf/alfconstants.h"
+#include "alf/alfserverutils.h"
+#include "alfmappingfunctionhandlers.h"
+
+#include <aknlayout2hierarchy.h>
+
+//----------------------------
+// Layout base
+//----------------------------
+EXPORT_C MAlfExtension* CAlfLayoutHandler::NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout)
+    {
+    CAlfVisualHandler* me = new (ELeave) CAlfLayoutHandler(aResolver);
+    CleanupStack::PushL(me);
+    me->ConstructL(NULL, *aOwner, aParentLayout);
+    CleanupStack::Pop();
+    return me;
+    }
+
+EXPORT_C CAlfLayoutHandler::CAlfLayoutHandler(MAlfInterfaceProvider& aResolver):CAlfVisualHandler(aResolver)
+    {
+    }
+
+EXPORT_C void CAlfLayoutHandler::ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout)
+    {
+    if (!aVisual)
+        {
+        CHuiLayout* layout = CHuiLayout::AddNewL(aOwner, aParentLayout);     
+        CAlfVisualHandler::ConstructL(layout, aOwner, aParentLayout);
+        }
+    else
+        {
+        CAlfVisualHandler::ConstructL(aVisual, aOwner, aParentLayout);
+        }
+    }
+
+EXPORT_C CAlfLayoutHandler::~CAlfLayoutHandler()
+    {
+    }
+
+EXPORT_C void CAlfLayoutHandler::Release()
+    {
+    delete this;
+    }
+
+
+EXPORT_C TAny* CAlfLayoutHandler::GetInterface(const THuiInterfaceSupport& aInterface)
+    {
+    switch (aInterface)
+        {
+        case EHuiObjectTypeLayout:
+            return static_cast<CHuiLayout*>(iVisual);
+        default:
+            return CAlfVisualHandler::GetInterface(aInterface);
+                    
+        }
+    }
+
+
+EXPORT_C void CAlfLayoutHandler::HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    CHuiLayout* layout = static_cast<CHuiLayout*>(iVisual);
+
+    switch (aCommandId)
+        {
+        case  EAlfLayoutAppendVisual:           
+            {
+            // 1 - visual ID  2 - transition time
+            TInt2* params = (TInt2*) aInputBuffer.Ptr();
+            CHuiVisual* visual = (CHuiVisual*)iResolver.GetInterfaceL(EHuiObjectTypeVisual, params->iInt1);
+            if (layout->FindVisual(visual) == KErrNotFound)
+                {
+                layout->AppendL(visual, params->iInt2);
+                }
+            else
+                {
+                User::Leave(KErrAlreadyExists);
+                } 
+            break;                
+            }
+        
+        case  EAlfLayoutRemoveVisual:
+            {
+            // 1 - visual ID  2 - transition time
+            TInt2* params = (TInt2*) aInputBuffer.Ptr();
+            CHuiVisual* visual = NULL;
+            TRAPD( err, visual = (CHuiVisual*)iResolver.GetInterfaceL(EHuiObjectTypeVisual, params->iInt1) );
+            if ( err != KErrNone )
+                {
+                // Visual has been deleted already
+                return;
+                }
+            layout->Remove(visual, params->iInt2);
+            
+            // todo: we should do the following, but it panic if this is called in RemoveAndDestroyAlld() loop
+            /*
+            // if visual is showing, we should add it under the host container
+            CHuiControlGroup* childGroup = visual->Owner().ControlGroup();
+            if ( childGroup && visual->Display() )
+                {
+                // must be a control
+                CHuiControl* control = static_cast<CHuiControl*>(&visual->Owner());
+                if ( control->Host() ) // showing if host if host is defined.
+                    {
+                    CHuiLayout* containerLayout = control->Host()->ContainerLayout( control );
+                    __ASSERT_DEBUG( containerLayout, USER_INVARIANT() );
+                    if ( containerLayout )
+                        {
+                        // Should we InsertL instead, so we would have the original
+                        // root visual order?
+                        containerLayout->AppendL( visual );
+                        }
+                    }
+                }*/
+            break;    
+            }
+
+        case  EAlfLayoutReorderVisual:
+            {
+            // 1 - visual ID  2 - position  3 - transition time
+            TInt3* params = (TInt3*) aInputBuffer.Ptr();
+            CHuiVisual* visual = (CHuiVisual*)iResolver.GetInterfaceL(EHuiObjectTypeVisual, params->iInt1);
+            layout->Reorder(*visual, params->iInt2, params->iInt3);
+            break;    
+            }
+
+        case EAlfLayoutVisualFromIndex:
+            {
+            TInt* index = (TInt*) aInputBuffer.Ptr();
+            CHuiVisual& visual = layout->Visual(*index);
+            // todo: can handle be negative ?
+            TInt handle = iResolver.GetHandleFromInterface(EHuiObjectTypeVisual, &visual);
+            //User::LeaveIfError(handle);
+
+            TPckg<TInt> pckg(handle);
+            aResponse = pckg;
+            
+            break;
+            }
+
+        case  EAlfLayoutEnableScrolling:           
+            {
+            TBool* enable = (TBool*) aInputBuffer.Ptr();
+            layout->EnableScrollingL(*enable);
+            break;                
+            }
+        
+        case  EAlfLayoutScrollOffset:
+            {
+            TAlfTimedPoint point;
+            AlfTimedPointUtility::CopyTimedPoint(layout->ScrollOffset(), point);
+
+            TPckg<TAlfTimedPoint> buf(point);
+            aResponse = buf;
+            break;    
+            }
+        
+        case EAlfLayoutSetScrollOffset:
+            {
+            TAlfTimedPoint* offset = (TAlfTimedPoint*) aInputBuffer.Ptr();
+            AlfTimedPointUtility::CopyTimedPoint(*offset, layout->ScrollOffset(), iResolver);            
+            break;
+            }
+
+        case  EAlfLayoutChildOrdinal:           
+            { // client should know this as well
+            const TInt* index = (TInt*) aInputBuffer.Ptr();
+            TInt ordinal(0);
+            TPckg<TInt> ordinalPckg(ordinal);
+            ordinal = layout->ChildOrdinal(*index);
+            aResponse = ordinalPckg;
+            break;                
+            }
+        
+        case  EAlfLayoutChildPos:
+            {
+            TAlfPosInt* pos = (TAlfPosInt*) aInputBuffer.Ptr();
+            TAlfPosInt result =
+                {
+                pos->iPoint,
+                EFalse
+                };
+            TPckg<TAlfPosInt> resp(result);
+            result.iInt = layout->ChildPos(pos->iInt, result.iPoint);
+            aResponse = resp;            
+            break;    
+            }
+        
+        case EAlfLayoutChildSize:
+            {
+            TAlfSizeInt* size = (TAlfSizeInt*) aInputBuffer.Ptr();
+            TAlfSizeInt result = 
+                {
+                size->iSize,
+                EFalse
+                };
+            TPckg<TAlfSizeInt> resp(result);
+            result.iInt = layout->ChildSize(size->iInt, result.iSize);
+            aResponse = resp;            
+            break;
+            }
+        case EAlfLayoutSetTransitionTime:
+            {
+            TInt* ttime = (TInt*) aInputBuffer.Ptr();
+            layout->SetTransitionTime(*ttime);
+            break;    
+            }
+        
+        case EAlfLayoutSetInnerPaddingPoint:
+            {            
+            TPoint* padding = (TPoint*) aInputBuffer.Ptr();
+            layout->SetInnerPadding(*padding);
+            break;    
+            }
+        
+        case EAlfLayoutSetInnerPaddingMetric:
+            {            
+            TAlfXYMetric* metric = (TAlfXYMetric*) aInputBuffer.Ptr();
+            THuiMetric newMetricX(metric->iX.iMagnitude, metric->iX.iUnit, metric->iX.iReferenceTextStyleId);
+            THuiMetric newMetricY(metric->iY.iMagnitude, metric->iY.iUnit, metric->iY.iReferenceTextStyleId);
+            THuiXYMetric newMetric(newMetricX, newMetricY);
+            layout->SetInnerPadding(newMetric);
+            break;    
+            }
+        
+        case EAlfLayoutInnerPaddingInBaseUnits:
+            {
+            THuiRealPoint point = layout->InnerPaddingInBaseUnits();
+            TAlfRealPoint result(point.iX, point.iY);
+            TPckg<TAlfRealPoint> resp(result);
+            aResponse = resp;
+            break;
+            }
+            
+        case EAlfLayoutVirtualSize:
+            {
+            TSize virtualSize = layout->VirtualSize();
+            TPckg<TSize> pckg(virtualSize);
+            aResponse = pckg;                        
+            break;    
+            }
+            
+        case EAlfLayoutSetBaseUnit:
+            {            
+            TAlfMetric* metric = (TAlfMetric*) aInputBuffer.Ptr();
+            THuiMetric newMetric(metric->iMagnitude, metric->iUnit, metric->iReferenceTextStyleId);
+            layout->SetBaseUnit(newMetric);
+            break;
+            }
+
+        case EAlfLayoutSetBaseUnitXY:
+            {            
+            TAlfXYMetric* metric = (TAlfXYMetric*) aInputBuffer.Ptr();
+            THuiMetric newMetricX(metric->iX.iMagnitude, metric->iX.iUnit, metric->iX.iReferenceTextStyleId);
+            THuiMetric newMetricY(metric->iY.iMagnitude, metric->iY.iUnit, metric->iY.iReferenceTextStyleId);
+            THuiXYMetric newMetric(newMetricX, newMetricY);
+            layout->SetBaseUnit(newMetric);
+            break;
+            }
+
+        case EAlfLayoutBaseUnit:
+            {            
+            THuiXYMetric metric = layout->BaseUnit();
+            TAlfMetric newMetricX(metric.iX.iMagnitude, metric.iX.iUnit, metric.iX.iReferenceTextStyleId);
+            TAlfMetric newMetricY(metric.iY.iMagnitude, metric.iY.iUnit, metric.iY.iReferenceTextStyleId);
+            TAlfXYMetric newMetric(newMetricX, newMetricY);
+            TPckg<TAlfXYMetric> resp(newMetric);
+            aResponse = resp;
+            break;
+            }
+
+        case EAlfVisualCopyValuesFromOtherVisual:
+        case EAlfVisualPauseProperties:
+        case EAlfVisualResumeProperties:        
+            {
+            if (aCommandId == EAlfVisualCopyValuesFromOtherVisual)
+               {
+               TInt3* inptr =  (TInt3*) aInputBuffer.Ptr();
+               CHuiLayout* sourceLayout = (CHuiLayout*) iResolver.GetInterfaceL( EHuiObjectTypeLayout, inptr->iInt1 );
+               if (inptr->iInt2&AlfVisualProperties::ELayoutScrollOffset)
+                   {
+                   layout->ScrollOffset().Set(sourceLayout->ScrollOffset().Target(), inptr->iInt3 );
+                   }
+               }
+            else if (aCommandId == EAlfVisualPauseProperties)
+               {
+               TInt* inptr =  (TInt*) aInputBuffer.Ptr();
+               if (*inptr&AlfVisualProperties::ELayoutScrollOffset)
+                   {
+                   layout->ScrollOffset().iX.Suspend();
+                   layout->ScrollOffset().iY.Suspend();
+                   }
+               }
+            else // EAlfVisualResumeProperties)
+               {
+               TInt* inptr =  (TInt*) aInputBuffer.Ptr();
+               if (*inptr&AlfVisualProperties::ELayoutScrollOffset)
+                   {
+                   layout->ScrollOffset().iX.Suspend(EFalse);
+                   layout->ScrollOffset().iY.Suspend(EFalse);
+                   }
+               }
+               
+            } // FALL THROUGH !!
+
+        default:
+            CAlfVisualHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+        }
+        
+    }
+
+EXPORT_C void CAlfLayoutHandler::VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+    CAlfVisualHandler::VisualHandlerExtension(aExtensionUid, aExtensionParameters);
+    }
+
+//----------------------------
+// anchor layout
+//----------------------------
+EXPORT_C MAlfExtension* CAlfAnchorLayoutHandler::NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout)
+    {
+    CAlfAnchorLayoutHandler* me = new (ELeave) CAlfAnchorLayoutHandler(aResolver);
+    CleanupStack::PushL(me);
+    me->ConstructL(NULL, *aOwner, aParentLayout);
+    CleanupStack::Pop();
+    return me;
+    }
+
+
+EXPORT_C CAlfAnchorLayoutHandler::CAlfAnchorLayoutHandler(MAlfInterfaceProvider& aResolver):CAlfLayoutHandler(aResolver)
+    {
+    }
+
+
+EXPORT_C void CAlfAnchorLayoutHandler::ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout)
+    {
+    if (!aVisual)
+        {
+        CHuiAnchorLayout* layout = CHuiAnchorLayout::AddNewL(aOwner, aParentLayout);     
+        CAlfLayoutHandler::ConstructL(layout, aOwner, aParentLayout);
+        }
+    else
+        {
+        CAlfLayoutHandler::ConstructL(aVisual, aOwner, aParentLayout);
+        }
+    }
+
+
+EXPORT_C CAlfAnchorLayoutHandler::~CAlfAnchorLayoutHandler()
+    {
+    }
+
+EXPORT_C void CAlfAnchorLayoutHandler::Release()
+    {
+    delete this;
+    }
+
+
+EXPORT_C TAny* CAlfAnchorLayoutHandler::GetInterface(const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfLayoutHandler::GetInterface(aInterface);
+    }
+
+
+EXPORT_C void CAlfAnchorLayoutHandler::HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    CHuiAnchorLayout* anchorLayout = static_cast<CHuiAnchorLayout*>(iVisual); 
+    switch (aCommandId)
+        {
+        case EAlfAnchorLayoutReset:
+            {
+            anchorLayout->Reset();
+            break;
+            }
+            
+        case EAlfAnchorLayoutSetAnchor:
+            {
+            TAlfLayoutSetAnchorParams* params =  (TAlfLayoutSetAnchorParams*) aInputBuffer.Ptr();
+            
+            THuiTimedPoint tpoint;
+            AlfTimedPointUtility::CopyTimedPoint(params->iOffset, tpoint, iResolver);            
+            
+            // Set anchor
+            TInt error = anchorLayout->SetAnchor( 
+                THuiAnchor(params->iAnchor),
+                params->iOrdinal,
+                THuiAnchorOrigin(params->iHorizOrigin),
+                THuiAnchorOrigin(params->iVertOrigin),
+                THuiAnchorMetric(params->iHorizMetric),
+                THuiAnchorMetric(params->iVertMetric),
+                tpoint
+                );
+                
+            User::LeaveIfError( error );
+
+            break;
+            }
+            
+        case EAlfAnchorLayoutSetRelativeAnchorRect:
+            {
+            TAlfLayoutSetRelativeAnchorRectParams* params =  (TAlfLayoutSetRelativeAnchorRectParams*) aInputBuffer.Ptr();
+            
+            TInt error = anchorLayout->SetRelativeAnchorRect
+                (
+                params->iOrdinal,
+                THuiAnchorOrigin(params->iTlHorizOrigin),
+                THuiAnchorOrigin(params->iTlVertOrigin),
+                THuiRealPoint(params->iTopLeftOffset.iX, params->iTopLeftOffset.iY),
+                THuiAnchorOrigin(params->iBrHorizOrigin),
+                THuiAnchorOrigin(params->iBrVertOrigin),
+                THuiRealPoint(params->iBottomRightOffset.iX, params->iBottomRightOffset.iY)
+                );
+                
+            User::LeaveIfError( error );
+            break;
+            }
+            
+        case EAlfAnchorLayoutRemoveAnchor:
+            {
+            TInt2* params =  (TInt2*) aInputBuffer.Ptr();
+            anchorLayout->RemoveAnchor( (THuiAnchor)params->iInt1, params->iInt2 );
+            break;
+            }
+
+        case EAlfAnchorLayoutAttachEdge:
+            {
+            TAlfLayoutAttachEdgeParams* params =  (TAlfLayoutAttachEdgeParams*) aInputBuffer.Ptr();
+            THuiMetric metric(params->iOffset.iMagnitude, params->iOffset.iUnit, params->iOffset.iReferenceTextStyleId);
+            
+            TInt error = anchorLayout->Attach( 
+                params->iOrdinal,
+                THuiAnchorType(params->iType),
+                metric,
+                THuiAnchorAttachmentOrigin(params->iAttachmentOrigin),
+                params->iAttachmentOrdinal);
+                
+            User::LeaveIfError( error );
+
+            break;
+            }
+            
+        case EAlfAnchorLayoutAttachCorner:
+            {
+            TAlfLayoutAttachCornerParams* params =  (TAlfLayoutAttachCornerParams*) aInputBuffer.Ptr();
+
+            THuiMetric metricX(params->iOffset.iX.iMagnitude, params->iOffset.iX.iUnit, params->iOffset.iX.iReferenceTextStyleId);
+            THuiMetric metricY(params->iOffset.iY.iMagnitude, params->iOffset.iY.iUnit, params->iOffset.iY.iReferenceTextStyleId);
+
+            THuiXYMetric metric(metricX, metricY);
+            
+            TInt error = anchorLayout->Attach( 
+                params->iOrdinal,
+                THuiAnchorType(params->iType),
+                metric,
+                THuiAnchorAttachmentOrigin(params->iAttachmentOrigin),
+                params->iAttachmentOrdinal);
+                
+            User::LeaveIfError( error );
+
+            break;
+            }
+
+        case EAlfAnchorLayoutAttachBox:
+            {
+            TAlfLayoutAttachBoxParams* params =  (TAlfLayoutAttachBoxParams*) aInputBuffer.Ptr();
+
+            THuiMetric metricLeft(params->iOffset.iLeft.iMagnitude, params->iOffset.iLeft.iUnit, params->iOffset.iLeft.iReferenceTextStyleId);
+            THuiMetric metricRight(params->iOffset.iRight.iMagnitude, params->iOffset.iRight.iUnit, params->iOffset.iRight.iReferenceTextStyleId);
+            THuiMetric metricTop(params->iOffset.iTop.iMagnitude, params->iOffset.iTop.iUnit, params->iOffset.iTop.iReferenceTextStyleId);
+            THuiMetric metricBottom(params->iOffset.iBottom.iMagnitude, params->iOffset.iBottom.iUnit, params->iOffset.iBottom.iReferenceTextStyleId);
+
+            THuiBoxMetric metric(metricLeft, metricRight, metricTop, metricBottom);
+
+            TInt error = anchorLayout->Attach( 
+                params->iOrdinal,
+                metric,
+                THuiAnchorAttachmentOrigin(params->iAttachmentOrigin),
+                params->iAttachmentOrdinal);
+                
+            User::LeaveIfError( error );
+
+            break;
+            }
+            
+        case EAlfAnchorLayoutDetachAll:
+            {
+            TInt* params =  (TInt*) aInputBuffer.Ptr();
+            anchorLayout->Detach(*params);
+            break;
+            }
+
+        case EAlfAnchorLayoutDetach:
+            {
+            TInt2* params =  (TInt2*) aInputBuffer.Ptr();
+            anchorLayout->Detach( params->iInt1, (THuiAnchorType)params->iInt2 );
+            break;
+            }
+            
+        default:
+            CAlfLayoutHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+        }
+    }
+
+EXPORT_C void CAlfAnchorLayoutHandler::VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+    CAlfLayoutHandler::VisualHandlerExtension(aExtensionUid, aExtensionParameters);
+    }
+
+
+
+//----------------------------
+// LCT Pane layout
+//----------------------------
+EXPORT_C MAlfExtension* CAlfLCTAnchorLayoutHandler::NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout)
+    {
+    CAlfLCTAnchorLayoutHandler* me = new (ELeave) CAlfLCTAnchorLayoutHandler(aResolver);
+    CleanupStack::PushL(me);
+    me->ConstructL(NULL, *aOwner, aParentLayout);
+    CleanupStack::Pop();
+    return me;
+    }
+
+
+EXPORT_C CAlfLCTAnchorLayoutHandler::CAlfLCTAnchorLayoutHandler(MAlfInterfaceProvider& aResolver):CAlfAnchorLayoutHandler(aResolver)
+    {
+    }
+
+
+EXPORT_C void CAlfLCTAnchorLayoutHandler::ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout)
+    {
+    if (!aVisual)
+        {
+        CHuiAnchorLayout* layout = CHuiAnchorLayout::AddNewL(aOwner, aParentLayout);     
+        CAlfLayoutHandler::ConstructL(layout, aOwner, aParentLayout);
+        }
+    else
+        {
+        CAlfLayoutHandler::ConstructL(aVisual, aOwner, aParentLayout);
+        }
+    }
+
+
+EXPORT_C CAlfLCTAnchorLayoutHandler::~CAlfLCTAnchorLayoutHandler()
+    {
+    }
+
+EXPORT_C void CAlfLCTAnchorLayoutHandler::Release()
+    {
+    delete this;
+    }
+
+
+EXPORT_C TAny* CAlfLCTAnchorLayoutHandler::GetInterface(const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfLayoutHandler::GetInterface(aInterface);
+    }
+
+
+EXPORT_C void CAlfLCTAnchorLayoutHandler::HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    switch (aCommandId)
+        {
+        case EAlfLCTAnchorLayoutSetAnchors:
+            {
+#ifdef RD_ALF_IN_PLATFORM
+            CHuiAnchorLayout* anchorLayout = static_cast<CHuiAnchorLayout*>(iVisual); 
+            TAlfLCTAnchorSetAnchorsParams* params = (TAlfLCTAnchorSetAnchorsParams*)aInputBuffer.Ptr();
+
+            TAknLayoutHierarchyComponentHandle handle;
+            handle.SetApiId(params->iApiId);
+            handle.SetComponentId(params->iComponentId);
+            handle.SetVarietyIndex(params->iVarietyIndex);
+            handle.SetColumn(params->iColumn);
+            handle.SetRow(params->iRow);
+
+            THuiTimedPoint tpoint;
+            AlfTimedPointUtility::CopyTimedPoint(params->iOffset, tpoint, iResolver);
+    
+            // we can access the layout data as a window line, whatever type component is specified.
+            TAknWindowLineLayout componentLayout = AknLayout2Hierarchy::GetWindowComponentLayout(handle).LayoutLineNoEmptys();
+            SetAnchors(anchorLayout, params->iOrdinal, componentLayout, tpoint);
+#endif
+
+            break;
+            }
+            
+        default:
+            CAlfAnchorLayoutHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+        }
+    }
+
+EXPORT_C void CAlfLCTAnchorLayoutHandler::VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+    CAlfAnchorLayoutHandler::VisualHandlerExtension(aExtensionUid, aExtensionParameters);
+    }
+
+#ifdef RD_ALF_IN_PLATFORM
+ TBool CAlfLCTAnchorLayoutHandler::IsParentRelative(TInt aVal) const
+    {
+    return aVal > ELayoutP-ELayoutPRange && aVal <= ELayoutP;
+    }
+#else //RD_ALF_IN_PLATFORM
+ TBool CAlfLCTAnchorLayoutHandler::IsParentRelative(TInt /*aVal*/) const
+    {
+    return EFalse;
+    }
+#endif //  RD_ALF_IN_PLATFORM
+
+#ifdef RD_ALF_IN_PLATFORM
+void CAlfLCTAnchorLayoutHandler::SetAnchors(CHuiAnchorLayout* aAnchor, TInt aOrdinal, const TAknWindowLineLayout& aLine, const THuiTimedPoint& aTimedPoint)
+    {
+    DoSetAnchors(aAnchor, aOrdinal, aLine.il, aLine.it, aLine.ir, aLine.ib, aTimedPoint);
+    }
+#else //RD_ALF_IN_PLATFORM
+void CAlfLCTAnchorLayoutHandler::SetAnchors(CHuiAnchorLayout* /*aAnchor*/, TInt /*aOrdinal*/, const TAknWindowLineLayout& /*aLine*/, const THuiTimedPoint& /*aTimedPoint*/)
+    {
+    }
+#endif //  RD_ALF_IN_PLATFORM
+    
+#ifdef RD_ALF_IN_PLATFORM
+void CAlfLCTAnchorLayoutHandler::DoSetAnchors(CHuiAnchorLayout* aLayout, TInt aOrdinal, TInt aLeft, TInt aTop, TInt aRight, TInt aBottom, const THuiTimedPoint& aTimedPoint)
+    {
+    TInt left = aLeft;
+    TInt top = aTop;
+    TInt right = aRight;
+    TInt bottom = aBottom;
+    THuiAnchorOrigin originLeft = EHuiAnchorOriginLeft;
+    THuiAnchorOrigin originTop = EHuiAnchorOriginTop;
+    THuiAnchorOrigin originRight = EHuiAnchorOriginRight;
+    THuiAnchorOrigin originBottom = EHuiAnchorOriginBottom;
+
+    // when measuring from the opposite anchor, have to change sign
+    if(IsParentRelative(left))
+        {
+        left = -(ELayoutP - left);
+        originLeft = EHuiAnchorOriginRight;
+        }
+    if(IsParentRelative(top))
+        {
+        top = -(ELayoutP - top);
+        originTop = EHuiAnchorOriginBottom;
+        }
+    if(IsParentRelative(right))
+        {
+        right = -(ELayoutP - right);
+        originRight = EHuiAnchorOriginLeft;
+        }
+    if(IsParentRelative(bottom))
+        {
+        bottom = -(ELayoutP - bottom);
+        originBottom = EHuiAnchorOriginTop;
+        }
+    THuiTimedPoint point(aTimedPoint);
+
+    point.iX = left;
+    point.iY = top;
+    aLayout->SetAnchor(
+        EHuiAnchorTopLeft, aOrdinal,
+        originLeft, originTop,
+        EHuiAnchorMetricAbsolute, EHuiAnchorMetricAbsolute,
+        point);
+
+    // right and bottom anchors are still measured in positive x and y
+    point.iX = -right;
+    point.iY = -bottom;
+    aLayout->SetAnchor(
+        EHuiAnchorBottomRight, aOrdinal,
+        originRight, originBottom,
+        EHuiAnchorMetricAbsolute, EHuiAnchorMetricAbsolute,
+        point); 
+    }
+#else // RD_ALF_IN_PLATFORM
+void CAlfLCTAnchorLayoutHandler::DoSetAnchors(CHuiAnchorLayout* /*aLayout*/, TInt /*aOrdinal*/, TInt /*aLeft*/, TInt /*aTop*/, TInt /*aRight*/, TInt /*aBottom*/, const THuiTimedPoint& /*aTimedPoint*/)
+    {
+    }
+#endif // RD_ALF_IN_PLATFORM
+
+
+
+//----------------------------
+// grid layout
+//----------------------------
+EXPORT_C MAlfExtension* CAlfGridLayoutHandler::NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout)
+    {
+    CAlfGridLayoutHandler* me = new (ELeave) CAlfGridLayoutHandler(aResolver);
+    CleanupStack::PushL(me);
+    me->ConstructL(NULL, *aOwner, aParentLayout);
+    CleanupStack::Pop();
+    return me;
+    }
+
+
+EXPORT_C CAlfGridLayoutHandler::CAlfGridLayoutHandler(MAlfInterfaceProvider& aResolver):CAlfLayoutHandler(aResolver)
+    {
+    }
+
+
+EXPORT_C void CAlfGridLayoutHandler::ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout)
+    {
+    if (!aVisual)
+        {
+        CHuiGridLayout* layout = CHuiGridLayout::AddNewL(aOwner, 0,0, aParentLayout);     
+        CAlfLayoutHandler::ConstructL(layout, aOwner, aParentLayout);
+        }
+    else
+        {
+        CAlfLayoutHandler::ConstructL(aVisual, aOwner, aParentLayout);
+        }
+    }
+
+
+EXPORT_C CAlfGridLayoutHandler::~CAlfGridLayoutHandler()
+    {
+    }
+
+
+EXPORT_C void CAlfGridLayoutHandler::Release()
+    {
+    delete this;
+    }
+
+
+EXPORT_C TAny* CAlfGridLayoutHandler::GetInterface(const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfLayoutHandler::GetInterface(aInterface);
+    }
+
+
+EXPORT_C void CAlfGridLayoutHandler::HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    CHuiGridLayout* gridLayout = static_cast<CHuiGridLayout*>(iVisual); 
+    switch (aCommandId)
+        {
+        case EAlfGridLayoutSetColumns:
+            {
+            TInt* count = (TInt*) aInputBuffer.Ptr();
+            gridLayout->SetColumnsL(*count);
+            break;
+            }
+
+        case EAlfGridLayoutSetRows:
+            {
+            TInt* count = (TInt*) aInputBuffer.Ptr();
+            gridLayout->SetRowsL(*count);
+            break;
+            }
+            
+        case EAlfGridLayoutSetColumnWeights:
+            {
+            RArray<TInt> array;
+            CleanupClosePushL( array );
+            InternalizeL(aInputBuffer, array);
+            gridLayout->SetColumnsL(array);
+            CleanupStack::PopAndDestroy( &array );
+            break;
+            }
+            
+        case EAlfGridLayoutSetRowsWeights:
+            {
+            RArray<TInt> array;
+            CleanupClosePushL( array );
+            InternalizeL(aInputBuffer, array);
+            gridLayout->SetRowsL(array);
+            CleanupStack::PopAndDestroy( &array );
+            break;
+            }
+
+        case EAlfGridLayoutSetExpanding:
+            {
+            TInt* flags = (TInt*) aInputBuffer.Ptr();
+            gridLayout->SetExpanding(*flags);
+            break;
+            }
+                    
+        case EAlfGridLayoutOrdinalToBlock:
+            {
+            TInt* ordinal = (TInt*) aInputBuffer.Ptr();
+            TPoint pos(0,0);
+            TPckg<TPoint> posPckg(pos);
+            pos = gridLayout->OrdinalToBlock(*ordinal);
+            aResponse = posPckg;
+            break;
+            }
+
+        case EAlfGridLayoutColumnCount:
+            {
+            TInt count(0);
+            TPckg<TInt> countPckg(count);
+            count = gridLayout->DimensionCount(EHuiGridColumn);
+            aResponse = countPckg;
+            break;
+            }
+            
+        case EAlfGridLayoutRowCount:
+            {
+            TInt count(0);
+            TPckg<TInt> countPckg(count);
+            count = gridLayout->DimensionCount(EHuiGridRow);
+            aResponse = countPckg;
+            break;
+            }
+            
+        case EAlfGridLayoutFillWeights:
+            {
+            TAlfGridLayoutFillWeightsParams* params = (TAlfGridLayoutFillWeightsParams*)aInputBuffer.Ptr();
+            THuiGridDimension dim = (THuiGridDimension)params->iDim;
+            THuiMetric metric(params->iWeight.iMagnitude, params->iWeight.iUnit, params->iWeight.iReferenceTextStyleId);
+            gridLayout->FillWeightsL(dim, params->iCount, metric);
+            break;
+            }
+
+        case EAlfGridLayoutAppendWeight:
+            {
+            TAlfGridLayoutAppendWeightParams* params = (TAlfGridLayoutAppendWeightParams*)aInputBuffer.Ptr();
+            THuiGridDimension dim = (THuiGridDimension)params->iDim;
+            THuiMetric metric(params->iWeight.iMagnitude, params->iWeight.iUnit, params->iWeight.iReferenceTextStyleId);
+            gridLayout->AppendWeightL(dim, metric);
+            break;
+            }
+            
+        case EAlfGridLayoutInsertWeight:
+            {
+            TAlfGridLayoutInsertWeightParams* params = (TAlfGridLayoutInsertWeightParams*)aInputBuffer.Ptr();
+            THuiGridDimension dim = (THuiGridDimension)params->iDim;
+            THuiMetric metric(params->iWeight.iMagnitude, params->iWeight.iUnit, params->iWeight.iReferenceTextStyleId);
+            gridLayout->InsertWeightL(dim, metric, params->iPos);
+            break;
+            }
+            
+        case EAlfGridLayoutReplaceWeight:
+            {
+            TAlfGridLayoutReplaceWeightParams* params = (TAlfGridLayoutReplaceWeightParams*)aInputBuffer.Ptr();
+            THuiGridDimension dim = (THuiGridDimension)params->iDim;
+            THuiMetric metric(params->iWeight.iMagnitude, params->iWeight.iUnit, params->iWeight.iReferenceTextStyleId);
+            gridLayout->ReplaceWeightL(dim, metric, params->iPos);
+            break;
+            }
+            
+        case EAlfGridLayoutRemoveWeight:
+            {
+            TAlfGridLayoutRemoveWeightParams* params = (TAlfGridLayoutRemoveWeightParams*)aInputBuffer.Ptr();
+            THuiGridDimension dim = (THuiGridDimension)params->iDim;
+            gridLayout->RemoveWeightL(dim, params->iPos);
+            break;
+            }
+            
+        case EAlfGridLayoutWeight:
+            {
+            TAlfGridLayoutWeightParams* params = (TAlfGridLayoutWeightParams*)aInputBuffer.Ptr();
+            THuiGridDimension dim = (THuiGridDimension)params->iDim;
+            THuiMetric huiWeight = gridLayout->Weight(dim, params->iPos);
+
+            TAlfMetric alfWeight(huiWeight.iMagnitude, huiWeight.iUnit, huiWeight.iReferenceTextStyleId);;
+            TPckg<TAlfMetric> weightPckg(alfWeight);
+            aResponse = weightPckg;
+            break;
+            }
+            
+        case EAlfGridLayoutCount:
+            {
+            THuiGridDimension* dim = (THuiGridDimension*) aInputBuffer.Ptr();
+            TInt count(0);
+            TPckg<TInt> countPckg(count);
+            count = gridLayout->DimensionCount(*dim);
+            aResponse = countPckg;
+            break;
+            }
+            
+        case EAlfGridLayoutSetLayoutModeFlags:
+            {
+            TInt2* params = (TInt2*) aInputBuffer.Ptr();
+            gridLayout->SetLayoutModeFlags((THuiGridDimension)params->iInt1, (TUint)params->iInt2);
+            break;                
+            }
+                    
+        case EAlfGridLayoutLayoutModeFlags:
+            {
+            THuiGridDimension* dim = (THuiGridDimension*) aInputBuffer.Ptr();
+            TInt flags(0);
+            TPckg<TInt> flagsPckg(flags);
+            flags = gridLayout->LayoutModeFlags(*dim);
+            aResponse = flagsPckg;            
+            break;                
+            }
+            
+        case EAlfGridLayoutClearLayoutModeFlags:                
+            {
+            TInt2* params = (TInt2*) aInputBuffer.Ptr();
+            gridLayout->ClearLayoutModeFlags((THuiGridDimension)params->iInt1, (TUint)params->iInt2);         
+            break;                
+            }
+            
+        default:
+            CAlfLayoutHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+        }
+        
+    }
+
+EXPORT_C void CAlfGridLayoutHandler::VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+    CAlfLayoutHandler::VisualHandlerExtension(aExtensionUid, aExtensionParameters);
+    }
+
+//----------------------------
+// LCT grid layout
+//----------------------------
+EXPORT_C MAlfExtension* CAlfLCTGridLayoutHandler::NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout)
+    {
+    CAlfLCTGridLayoutHandler* me = new (ELeave) CAlfLCTGridLayoutHandler(aResolver);
+    CleanupStack::PushL(me);
+    me->ConstructL(NULL, *aOwner, aParentLayout);
+    CleanupStack::Pop();
+    return me;
+    }
+
+
+EXPORT_C CAlfLCTGridLayoutHandler::CAlfLCTGridLayoutHandler(MAlfInterfaceProvider& aResolver):CAlfGridLayoutHandler(aResolver)
+    {
+    }
+
+
+EXPORT_C void CAlfLCTGridLayoutHandler::ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout)
+    {
+    if (!aVisual)
+        {
+        CHuiGridLayout* layout = CHuiGridLayout::AddNewL(aOwner, 1, 1, aParentLayout);     
+        CAlfGridLayoutHandler::ConstructL(layout, aOwner, aParentLayout);
+        }
+    else
+        {
+        CAlfGridLayoutHandler::ConstructL(aVisual, aOwner, aParentLayout);
+        }
+    }
+
+
+EXPORT_C CAlfLCTGridLayoutHandler::~CAlfLCTGridLayoutHandler()
+    {
+    }
+
+
+EXPORT_C void CAlfLCTGridLayoutHandler::Release()
+    {
+    delete this;
+    }
+
+
+EXPORT_C TAny* CAlfLCTGridLayoutHandler::GetInterface(const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfGridLayoutHandler::GetInterface(aInterface);
+    }
+
+
+EXPORT_C void CAlfLCTGridLayoutHandler::HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    switch (aCommandId)
+        {
+        case EAlfLCTGridLayoutSetColsAndRows:
+            {
+#ifdef RD_ALF_IN_PLATFORM
+            CHuiGridLayout* gridLayout = static_cast<CHuiGridLayout*>(iVisual); 
+            TAlfLCTGridSetColsAndRowsParams* params = (TAlfLCTGridSetColsAndRowsParams*)aInputBuffer.Ptr();
+
+            TAknLayoutHierarchyComponentHandle handle;
+            handle.SetApiId(params->iApiId);
+            handle.SetComponentId(params->iComponentId);
+            handle.SetVarietyIndex(params->iVarietyIndex);
+
+            THuiTimedPoint tpoint;
+            AlfTimedPointUtility::CopyTimedPoint(params->iOffset, tpoint, iResolver);
+    
+            // get the cols and rows directly from the param limits
+            // @todo maybe need to use anchors, or set rows and cols by item height?
+            TAknLayoutScalableParameterLimits limits = AknLayout2Hierarchy::GetParamLimits(handle);
+            gridLayout->SetColumnsL(limits.LastColumn()+1);
+            gridLayout->SetRowsL(limits.LastRow()+1);
+#endif
+            break;
+            }
+        default:
+            CAlfGridLayoutHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+        }
+        
+    }
+
+EXPORT_C void CAlfLCTGridLayoutHandler::VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+    CAlfGridLayoutHandler::VisualHandlerExtension(aExtensionUid, aExtensionParameters);
+    }
+ 
+//----------------------------
+// deck layout
+//----------------------------
+EXPORT_C MAlfExtension* CAlfDeckLayoutHandler::NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout)
+    {
+    CAlfDeckLayoutHandler* me = new (ELeave) CAlfDeckLayoutHandler(aResolver);
+    CleanupStack::PushL(me);
+    me->ConstructL(NULL, *aOwner, aParentLayout);
+    CleanupStack::Pop();
+    return me;
+    }
+
+
+EXPORT_C CAlfDeckLayoutHandler::CAlfDeckLayoutHandler(MAlfInterfaceProvider& aResolver):CAlfLayoutHandler(aResolver)
+    {
+    }
+
+
+EXPORT_C void CAlfDeckLayoutHandler::ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout)
+    {
+    if (!aVisual)
+        {
+        CHuiDeckLayout* layout = CHuiDeckLayout::AddNewL(aOwner, aParentLayout);     
+        CAlfLayoutHandler::ConstructL(layout, aOwner, aParentLayout);
+        }
+    else
+        {
+        CAlfLayoutHandler::ConstructL(aVisual, aOwner, aParentLayout);
+        }
+    }
+
+
+EXPORT_C CAlfDeckLayoutHandler::~CAlfDeckLayoutHandler()
+    {
+    }
+
+EXPORT_C TAny* CAlfDeckLayoutHandler::GetInterface(const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfLayoutHandler::GetInterface(aInterface);
+    }
+
+
+EXPORT_C void CAlfDeckLayoutHandler::HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    CAlfLayoutHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+    }
+
+EXPORT_C void CAlfDeckLayoutHandler::Release()
+    {
+    delete this;
+    }
+
+EXPORT_C void CAlfDeckLayoutHandler::VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+    CAlfLayoutHandler::VisualHandlerExtension(aExtensionUid, aExtensionParameters);
+    }
+
+
+//----------------------------
+// flow layout
+//----------------------------
+EXPORT_C MAlfExtension* CAlfFlowLayoutHandler::NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout)
+    {
+    CAlfFlowLayoutHandler* me = new (ELeave) CAlfFlowLayoutHandler(aResolver);
+    CleanupStack::PushL(me);
+    me->ConstructL(NULL, *aOwner, aParentLayout);
+    CleanupStack::Pop();
+    return me;
+    }
+
+
+EXPORT_C CAlfFlowLayoutHandler::CAlfFlowLayoutHandler(MAlfInterfaceProvider& aResolver):CAlfLayoutHandler(aResolver)
+    {
+    }
+
+
+EXPORT_C void CAlfFlowLayoutHandler::ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout)
+    {
+    if (!aVisual)
+        {
+        CHuiFlowLayout* layout = CHuiFlowLayout::AddNewL(aOwner, CHuiFlowLayout::EFlowVertical, aParentLayout);     
+        CAlfLayoutHandler::ConstructL(layout, aOwner, aParentLayout);
+        }
+    else
+        {
+        CAlfLayoutHandler::ConstructL(aVisual, aOwner, aParentLayout);
+        }
+    }
+
+
+EXPORT_C CAlfFlowLayoutHandler::~CAlfFlowLayoutHandler()
+    {
+    }
+
+
+EXPORT_C void CAlfFlowLayoutHandler::Release()
+    {
+    delete this;
+    }
+
+
+EXPORT_C TAny* CAlfFlowLayoutHandler::GetInterface(const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfLayoutHandler::GetInterface(aInterface);
+    }
+
+
+EXPORT_C void CAlfFlowLayoutHandler::HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    CHuiFlowLayout* flowLayout = static_cast<CHuiFlowLayout*>(iVisual); 
+    switch (aCommandId)
+        {
+        case EAlfFlowLayoutSetFlowDirection:
+            {
+            CHuiFlowLayout::TFlowDirection* params =  (CHuiFlowLayout::TFlowDirection*) aInputBuffer.Ptr();
+            flowLayout->SetFlowDirection( *params );
+            break;
+            }
+        case EAlfFlowLayoutSetCentering:
+            {
+            TBool* params =  (TBool*) aInputBuffer.Ptr();
+            flowLayout->SetCentering( *params );
+            break;
+            }
+        case EAlfFlowLayoutSetMode:
+            {
+            TInt* params = (TInt*) aInputBuffer.Ptr();
+            flowLayout->SetMode( *params );
+            break;
+            }
+           
+        default:
+            CAlfLayoutHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+        }
+    }
+
+
+EXPORT_C void CAlfFlowLayoutHandler::VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+    CAlfLayoutHandler::VisualHandlerExtension(aExtensionUid, aExtensionParameters);
+    }
+
+ 
+ // CURVE PATH LAYOUT
+ 
+ 
+struct CAlfCurvePathLayoutHandler::TCurvePathLayoutPrivateData
+    {
+    };
+ 
+EXPORT_C MAlfExtension* CAlfCurvePathLayoutHandler::NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout)
+    {
+    CAlfCurvePathLayoutHandler* me = new (ELeave) CAlfCurvePathLayoutHandler(aResolver);
+    CleanupStack::PushL(me);
+    me->ConstructL(NULL, *aOwner, aParentLayout);
+    CleanupStack::Pop();
+    return me;
+    }
+    
+EXPORT_C CAlfCurvePathLayoutHandler::CAlfCurvePathLayoutHandler(MAlfInterfaceProvider& aResolver)
+:CAlfLayoutHandler(aResolver)
+    {
+    }
+    
+EXPORT_C void CAlfCurvePathLayoutHandler::ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout)
+    {
+    if (!aVisual)
+        {
+        CHuiCurvePathLayout* layout = CHuiCurvePathLayout::AddNewL(aOwner, aParentLayout);     
+        CAlfLayoutHandler::ConstructL(layout, aOwner, aParentLayout);
+        }
+    else
+        {
+        CAlfLayoutHandler::ConstructL(aVisual, aOwner, aParentLayout);
+        }
+        
+    // Not needed currently
+    //iCurvePathLayoutPrivateData = new (ELeave) TCurvePathLayoutPrivateData;
+    }
+    
+EXPORT_C CAlfCurvePathLayoutHandler::~CAlfCurvePathLayoutHandler()
+    {
+    if ( iCurvePathLayoutPrivateData )
+        {
+        // Delete private data (not used currently)
+        }
+    delete iCurvePathLayoutPrivateData;
+    iCurvePathLayoutPrivateData = NULL;
+    }
+
+EXPORT_C void CAlfCurvePathLayoutHandler::Release()
+    {
+    delete this;
+    }
+    
+EXPORT_C TAny* CAlfCurvePathLayoutHandler::GetInterface(const THuiInterfaceSupport& aInterface)
+    {
+    CHuiCurvePathLayout* curvePathLayout = static_cast<CHuiCurvePathLayout*>(iVisual); 
+    
+    switch ( aInterface )
+        {
+        case EHuiInterfaceMappingFunction:
+            return static_cast<MHuiMappingFunction*>(curvePathLayout);
+        case EHuiObjectTypeCurvePathProvider:
+            return &curvePathLayout->CurvePath();
+        default:
+            return CAlfLayoutHandler::GetInterface(aInterface);
+        }
+    }
+    
+EXPORT_C void CAlfCurvePathLayoutHandler::HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    CHuiCurvePathLayout* curvePathLayout = static_cast<CHuiCurvePathLayout*>(iVisual); 
+    
+    switch( aCommandId )
+        {
+        case EAlfCurvePathLayoutMapValue:
+            {
+            TIntTReal* mapValues = (TIntTReal*) aInputBuffer.Ptr();
+            const TReal32 returnValue = curvePathLayout->MapValue( mapValues->iReal, mapValues->iInt );
+            TPckg<TReal32> returnValuePckg(returnValue);
+            aResponse = returnValuePckg; 
+            break;
+            }
+        default:
+            CAlfLayoutHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+            break;
+        }
+    }
+
+EXPORT_C void CAlfCurvePathLayoutHandler::VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+    CAlfLayoutHandler::VisualHandlerExtension(aExtensionUid, aExtensionParameters);
+    }
+
+//----------------------------
+// viewport layout
+//----------------------------
+EXPORT_C MAlfExtension* CAlfViewportLayoutHandler::NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout)
+    {
+    CAlfViewportLayoutHandler* me = new (ELeave) CAlfViewportLayoutHandler(aResolver);
+    CleanupStack::PushL(me);
+    me->ConstructL(NULL, *aOwner, aParentLayout);
+    CleanupStack::Pop();
+    return me;
+    }
+
+
+EXPORT_C CAlfViewportLayoutHandler::CAlfViewportLayoutHandler(MAlfInterfaceProvider& aResolver):CAlfLayoutHandler(aResolver)
+    {
+    }
+
+
+EXPORT_C void CAlfViewportLayoutHandler::ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout)
+    {
+    if (!aVisual)
+        {
+        CHuiViewportLayout* layout = CHuiViewportLayout::AddNewL(aOwner, aParentLayout);     
+        CAlfLayoutHandler::ConstructL(layout, aOwner, aParentLayout);
+        }
+    else
+        {
+        CAlfLayoutHandler::ConstructL(aVisual, aOwner, aParentLayout);
+        }
+    }
+
+
+EXPORT_C CAlfViewportLayoutHandler::~CAlfViewportLayoutHandler()
+    {
+    }
+
+EXPORT_C void CAlfViewportLayoutHandler::Release()
+    {
+    delete this;
+    }
+
+
+EXPORT_C TAny* CAlfViewportLayoutHandler::GetInterface(const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfLayoutHandler::GetInterface(aInterface);
+    }
+
+
+EXPORT_C void CAlfViewportLayoutHandler::HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    CHuiViewportLayout* viewportLayout = static_cast<CHuiViewportLayout*>(iVisual); 
+    switch (aCommandId)
+        {
+        case EAlfViewportLayoutSetVirtualSize:
+            {
+            TAlfTimedPoint* newSize = (TAlfTimedPoint*) aInputBuffer.Ptr();
+
+            THuiTimedPoint tpoint;
+            AlfTimedPointUtility::CopyTimedPoint(*newSize, tpoint, iResolver);                  
+            
+            viewportLayout->SetVirtualSize(tpoint.RealTarget().AsSize(), HUI_ROUND_FLOAT_TO_INT(newSize->TimeToTargetinMilliSeconds().iX));            
+            break;
+            }
+            
+        case EAlfViewportLayoutSetViewportSize:
+            {
+            TAlfTimedPoint* newSize = (TAlfTimedPoint*) aInputBuffer.Ptr();
+
+            THuiTimedPoint tpoint;      
+            AlfTimedPointUtility::CopyTimedPoint(*newSize, tpoint, iResolver);                              
+            viewportLayout->SetViewportSize(tpoint.RealTarget().AsSize(), HUI_ROUND_FLOAT_TO_INT(newSize->TimeToTargetinMilliSeconds().iX));            
+            break;
+            }
+            
+        case EAlfViewportLayoutSetViewportPos:
+            {
+            TAlfTimedPoint* newPos = (TAlfTimedPoint*) aInputBuffer.Ptr();
+
+            THuiTimedPoint tpoint;
+            AlfTimedPointUtility::CopyTimedPoint(*newPos, tpoint, iResolver);                              
+            viewportLayout->SetViewportPos(tpoint.RealTarget(), HUI_ROUND_FLOAT_TO_INT(newPos->TimeToTargetinMilliSeconds().iX));            
+            break;
+            }
+            
+        default:
+            CAlfLayoutHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+        }
+    }
+
+EXPORT_C void CAlfViewportLayoutHandler::VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+    CAlfLayoutHandler::VisualHandlerExtension(aExtensionUid, aExtensionParameters);
+    }
+
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfmappingfunctionhandlers.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,639 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Mapping function handlers
+*
+*/
+
+
+
+#include "alfmappingfunctionhandlers.h"
+#include "alf/alfconstants.h"
+#include "alf/alfserverutils.h"
+
+#include <uiacceltk/HuiCurvePath.h>
+
+// CONSTANT MAPPING FUNCTION
+
+TAlfConstantMappingFunctionHandler::TAlfConstantMappingFunctionHandler( 
+        MAlfInterfaceProvider& aResolver,
+        TReal32 aValue )
+        : iConstantMappingFunction( aValue ) , iResolver(aResolver)
+    {
+    }
+
+void TAlfConstantMappingFunctionHandler::Release()
+    {
+    delete this;
+    }
+    
+TAny* TAlfConstantMappingFunctionHandler::GetInterface(
+    const THuiInterfaceSupport& aInterface)
+    {
+    switch ( aInterface )
+        {
+        case EHuiInterfaceMappingFunction:
+            return &iConstantMappingFunction;
+        default:
+            return NULL;
+        }
+    }
+    
+void TAlfConstantMappingFunctionHandler::HandleCmdL(
+    TInt aCommandId, 
+    const TDesC8& aInputBuffer, 
+    TDes8& /*aResponse*/ )
+    {
+    switch ( aCommandId )
+        {
+        case EAlfConstantMappingFunctionSetValue:
+            {
+            TReal32* mapValues = (TReal32*) aInputBuffer.Ptr();
+            iConstantMappingFunction.iValue = *mapValues;
+            break;
+            }
+ 
+        default:
+            User::Leave( KErrNotSupported );
+        }
+    }
+    
+// LINEAR MAPPING FUNCTION
+
+TAlfLinearMappingFunctionHandler::TAlfLinearMappingFunctionHandler( 
+        MAlfInterfaceProvider& aResolver,
+        TReal32 aFactor,
+        TReal32 aOffset )
+        : iLinearMappingFunction( aFactor,aOffset ) , iResolver(aResolver)
+    {
+    }
+
+void TAlfLinearMappingFunctionHandler::Release()
+    {
+    delete this;
+    }
+    
+TAny* TAlfLinearMappingFunctionHandler::GetInterface(
+    const THuiInterfaceSupport& aInterface)
+    {
+    switch ( aInterface )
+        {
+        case EHuiInterfaceMappingFunction:
+            return &iLinearMappingFunction;
+        default:
+            return NULL;
+        }
+    }
+    
+void TAlfLinearMappingFunctionHandler::HandleCmdL(
+    TInt aCommandId, 
+    const TDesC8& aInputBuffer, 
+    TDes8& /*aResponse*/ )
+    {
+    switch ( aCommandId )
+        {
+        case EAlfLinearMappingFunctionSetFactor:
+            {
+            TReal32* mapValues = (TReal32*) aInputBuffer.Ptr();
+            iLinearMappingFunction.iFactor = *mapValues;
+            break;
+            }
+            
+        case EAlfLinearMappingFunctionSetOffset:
+            {
+            TReal32* mapValues = (TReal32*) aInputBuffer.Ptr();
+            iLinearMappingFunction.iOffset = *mapValues;
+            break;
+            }
+ 
+        default:
+            User::Leave( KErrNotSupported );
+        }
+    }
+
+// SINE MAPPING FUNCTION
+
+TAlfSineMappingFunctionHandler::TAlfSineMappingFunctionHandler( 
+        MAlfInterfaceProvider& aResolver,
+        TReal32 aFactor,
+        TReal32 aOffset )
+        : iSineMappingFunction( aFactor,aOffset ) , iResolver(aResolver)
+    {
+    }
+
+void TAlfSineMappingFunctionHandler::Release()
+    {
+    delete this;
+    }
+    
+TAny* TAlfSineMappingFunctionHandler::GetInterface(
+    const THuiInterfaceSupport& aInterface)
+    {
+    switch ( aInterface )
+        {
+        case EHuiInterfaceMappingFunction:
+            return &iSineMappingFunction;
+        default:
+            return NULL;
+        }
+    }
+    
+void TAlfSineMappingFunctionHandler::HandleCmdL(
+    TInt aCommandId, 
+    const TDesC8& aInputBuffer, 
+    TDes8& /*aResponse*/ )
+    {
+    switch ( aCommandId )
+        {
+        case EAlfSineMappingFunctionSetFactor:
+            {
+            TReal32* mapValues = (TReal32*) aInputBuffer.Ptr();
+            iSineMappingFunction.iFactor = *mapValues;
+            break;
+            }
+            
+        case EAlfSineMappingFunctionSetOffset:
+            {
+            TReal32* mapValues = (TReal32*) aInputBuffer.Ptr();
+            iSineMappingFunction.iOffset = *mapValues;
+            break;
+            }
+ 
+        default:
+            User::Leave( KErrNotSupported );
+        }
+    }
+
+// COSINE MAPPING FUNCTION
+
+TAlfCosineMappingFunctionHandler::TAlfCosineMappingFunctionHandler( 
+        MAlfInterfaceProvider& aResolver,
+        TReal32 aFactor,
+        TReal32 aOffset )
+        : iCosineMappingFunction( aFactor,aOffset ) , iResolver(aResolver)
+    {
+    }
+
+void TAlfCosineMappingFunctionHandler::Release()
+    {
+    delete this;
+    }
+    
+TAny* TAlfCosineMappingFunctionHandler::GetInterface(
+    const THuiInterfaceSupport& aInterface)
+    {
+    switch ( aInterface )
+        {
+        case EHuiInterfaceMappingFunction:
+            return &iCosineMappingFunction;
+        default:
+            return NULL;
+        }
+    }
+    
+void TAlfCosineMappingFunctionHandler::HandleCmdL(
+    TInt aCommandId, 
+    const TDesC8& aInputBuffer, 
+    TDes8& /*aResponse*/ )
+    {
+    switch ( aCommandId )
+        {
+        case EAlfCosineMappingFunctionSetFactor:
+            {
+            TReal32* mapValues = (TReal32*) aInputBuffer.Ptr();
+            iCosineMappingFunction.iFactor = *mapValues;
+            break;
+            }
+            
+        case EAlfCosineMappingFunctionSetOffset:
+            {
+            TReal32* mapValues = (TReal32*) aInputBuffer.Ptr();
+            iCosineMappingFunction.iOffset = *mapValues;
+            break;
+            }
+ 
+        default:
+            User::Leave( KErrNotSupported );
+        }
+    }
+
+// AVERAGE MAPPING FUNCTION
+
+TAlfAverageMappingFunctionHandler::TAlfAverageMappingFunctionHandler( 
+        MAlfInterfaceProvider& aResolver,
+        MHuiMappingFunction* aFunc1, 
+        MHuiMappingFunction* aFunc2 )
+        : iAverageMappingFunction( aFunc1, aFunc2 ) , iResolver(aResolver)
+    {
+    }
+
+void TAlfAverageMappingFunctionHandler::Release()
+    {
+    delete this;
+    }
+    
+TAny* TAlfAverageMappingFunctionHandler::GetInterface(
+    const THuiInterfaceSupport& aInterface)
+    {
+    switch ( aInterface )
+        {
+        case EHuiInterfaceMappingFunction:
+            return &iAverageMappingFunction;
+        default:
+            return NULL;
+        }
+    }
+    
+void TAlfAverageMappingFunctionHandler::HandleCmdL(
+    TInt aCommandId, 
+    const TDesC8& aInputBuffer, 
+    TDes8& aResponse )
+    {
+    switch ( aCommandId )
+        {
+        case EAlfMappingFunctionMapValue:
+            {
+            TIntTReal* mapValues = (TIntTReal*) aInputBuffer.Ptr();
+            
+            const TReal32 returnValue = iAverageMappingFunction.MapValue( mapValues->iReal, mapValues->iInt );
+            
+            TPckg<TReal32> returnValuePckg(returnValue);
+            aResponse = returnValuePckg; 
+            break;
+            }
+        case EAlfAverageMappingFunctionSetFunction1:
+            {
+            TInt* params = (TInt*)aInputBuffer.Ptr();
+            
+            MHuiMappingFunction* func1 = NULL;
+            
+            if ( *params )
+                {
+                func1 = (MHuiMappingFunction*) iResolver.GetInterfaceL(EHuiInterfaceMappingFunction, *params );
+                }
+            
+            iAverageMappingFunction.iFunc1 = func1;
+            break;
+            }
+        case EAlfAverageMappingFunctionSetFunction2:
+            {
+            TInt* params = (TInt*)aInputBuffer.Ptr();
+            
+            MHuiMappingFunction* func2 = NULL;
+            
+            if ( *params )
+                {
+                func2 = (MHuiMappingFunction*) iResolver.GetInterfaceL(EHuiInterfaceMappingFunction, *params );
+                }
+            
+            iAverageMappingFunction.iFunc2 = func2;
+            break;
+            }
+        case EAlfAverageMappingFunctionSetFunctions:
+            {
+            TInt2* params = (TInt2*) aInputBuffer.Ptr();
+            
+            MHuiMappingFunction* func1 = NULL;
+            MHuiMappingFunction* func2 = NULL;
+            
+            if ( params->iInt1 )
+                {
+                func1 = (MHuiMappingFunction*) iResolver.GetInterfaceL(EHuiInterfaceMappingFunction, params->iInt1 );
+                }
+                
+            if ( params->iInt2 )
+                {
+                func2 = (MHuiMappingFunction*) iResolver.GetInterfaceL(EHuiInterfaceMappingFunction, params->iInt2 );
+                }
+                
+                
+            iAverageMappingFunction.iFunc1 = func1;
+            iAverageMappingFunction.iFunc2 = func2; 
+            break;
+            }
+            
+        case EAlfAverageMappingFunctionSetWeight:
+            {
+            TAlfTimedValue* opacity = (TAlfTimedValue*) aInputBuffer.Ptr() ;
+            AlfTimedValueUtility::CopyTimedValue(*opacity, iAverageMappingFunction.iWeight, iResolver);    
+            break;
+            }
+            
+        default:
+            User::Leave( KErrNotSupported );
+        }
+    }
+    
+// CURVE PATH
+
+CAlfCurvePathHandler* CAlfCurvePathHandler::NewL( 
+    MAlfInterfaceProvider& aResolver,
+    CHuiCurvePath* aCurvePath )
+    {
+    CAlfCurvePathHandler* self = new (ELeave) CAlfCurvePathHandler( aResolver );
+    CleanupStack::PushL( self );
+    self->ConstructL( aCurvePath );
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+CAlfCurvePathHandler::CAlfCurvePathHandler( MAlfInterfaceProvider& aResolver )
+ : iResolver( aResolver )
+    {
+    }
+    
+void CAlfCurvePathHandler::ConstructL(CHuiCurvePath* aCurvePath)
+    {
+    if ( aCurvePath )
+        {
+        iCurvePath = aCurvePath;
+        iOwnCurvePath = EFalse;
+        }
+    else
+        {
+        iCurvePath = CHuiCurvePath::NewL();
+        iOwnCurvePath = ETrue;
+        }
+    }
+    
+CAlfCurvePathHandler::~CAlfCurvePathHandler()
+    {
+    if ( iOwnCurvePath )
+        {
+        delete iCurvePath;
+        }
+    iCurvePath = NULL;
+    }
+    
+
+void CAlfCurvePathHandler::Release()
+    {
+    delete this;
+    }
+    
+TAny* CAlfCurvePathHandler::GetInterface(const THuiInterfaceSupport& aInterface)
+    {
+    switch ( aInterface )
+        {
+        case EHuiInterfaceMappingFunction:
+            return static_cast<MHuiMappingFunction*>(iCurvePath);
+        default:
+            return NULL;
+        }
+    }
+    
+void CAlfCurvePathHandler::HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    switch( aCommandId )
+        {
+        case EAlfCurvePathReset:
+            {
+            iCurvePath->Reset();
+            break;
+            }
+            
+        case EAlfCurvePathEnableLoop:
+            {
+            TBool* params = (TBool*) aInputBuffer.Ptr();
+            iCurvePath->EnableLoop( *params );
+            break;
+            }
+            
+        case EAlfCurvePathLoop:
+            {
+            const TBool returnValue = iCurvePath->Loop();
+            
+            TPckg<TBool> returnValuePckg(returnValue);
+            aResponse = returnValuePckg; 
+            break;
+            }
+            
+        case EAlfCurvePathSetOrigin:
+            {
+            TReal32* params = (TReal32*) aInputBuffer.Ptr();
+            iCurvePath->SetOrigin( *params );
+            break;
+            }
+            
+        case EAlfCurvePathAppendLine:
+            {
+            TAlfCurvePathLineParams* params = (TAlfCurvePathLineParams*) aInputBuffer.Ptr();
+            iCurvePath->AppendLineL( 
+                params->iStart,
+                params->iEnd,
+                params->iLength );
+            break;
+            }
+            
+        case EAlfCurvePathAppendLine2:
+            {
+            TAlfCurvePathLineRealParams* params = (TAlfCurvePathLineRealParams*) aInputBuffer.Ptr();
+            THuiRealPoint start(params->iStart.iX, params->iStart.iY);
+            THuiRealPoint end(params->iEnd.iX, params->iEnd.iY);
+            iCurvePath->AppendLineL( 
+                start,
+                end,
+                params->iLength );
+            break;
+            }
+            
+        case EAlfCurvePathAppendArc:
+            {
+            TAlfCurvePathArcParams* params = (TAlfCurvePathArcParams*) aInputBuffer.Ptr();
+            iCurvePath->AppendArcL( 
+                params->iOrigin,
+                params->iSize,
+                params->iStartAngle,
+                params->iEndAngle,
+                params->iLength );
+            break;
+            }
+            
+        case EAlfCurvePathAppendArc2:
+            {
+            TAlfCurvePathArcRealParams* params = (TAlfCurvePathArcRealParams*) aInputBuffer.Ptr();
+            THuiRealPoint origin(params->iOrigin.iX, params->iOrigin.iY);
+            THuiRealSize size2(params->iSize.iWidth, params->iSize.iHeight);
+            iCurvePath->AppendArcL( 
+                origin,
+                size2,
+                params->iStartAngle,
+                params->iEndAngle,
+                params->iLength );
+            break;
+            }
+            
+        case EAlfCurvePathLength:
+            {
+            const TReal32 returnValue = iCurvePath->Length();
+            
+            TPckg<TReal32> returnValuePckg(returnValue);
+            aResponse = returnValuePckg; 
+            break;
+            }
+            
+            
+        case EAlfCurvePathEvaluate:
+            {
+            TReal32* params = (TReal32*) aInputBuffer.Ptr();
+            
+            
+            THuiRealPoint result;
+            iCurvePath->Evaluate( *params, result );
+            
+            TAlfRealPoint returnValue(result.iX, result.iY);
+            TPckg<TAlfRealPoint> returnValuePckg(returnValue);
+            aResponse = returnValuePckg; 
+            break;
+            }
+            
+        case EAlfCurvePathOffset:
+            {
+            TAlfTimedPoint returnValue;
+            AlfTimedPointUtility::CopyTimedPoint(iCurvePath->iOffset, returnValue);
+
+            TPckg<TAlfTimedPoint> returnValuePckg(returnValue);
+            aResponse = returnValuePckg;
+            break;
+            }
+        
+        case EAlfCurvePathSetOffset:
+            {
+            TAlfTimedPoint* params = (TAlfTimedPoint*) aInputBuffer.Ptr();
+            AlfTimedPointUtility::CopyTimedPoint(*params, iCurvePath->iOffset, iResolver);    
+            break;
+            }
+            
+        case EAlfCurvePathMapValue:
+            {
+            TIntTReal* mapValues = (TIntTReal*) aInputBuffer.Ptr();
+            
+            const TReal32 returnValue = iCurvePath->MapValue( mapValues->iReal, mapValues->iInt );
+            
+            TPckg<TReal32> returnValuePckg(returnValue);
+            aResponse = returnValuePckg; 
+            break;
+            }
+            
+        default:
+            User::Leave( KErrNotSupported );
+        }
+    }
+
+    
+    
+// TABLE MAPPING FUNCTION
+
+TAlfTableMappingFunctionHandler::TAlfTableMappingFunctionHandler( 
+        MAlfInterfaceProvider& aResolver) 
+        : iResolver(aResolver)
+    {
+    }
+
+void TAlfTableMappingFunctionHandler::Release()
+    {
+    delete this;
+    }
+    
+TAny* TAlfTableMappingFunctionHandler::GetInterface(
+    const THuiInterfaceSupport& aInterface)
+    {
+    switch ( aInterface )
+        {
+        case EHuiInterfaceMappingFunction:
+            return &iMappingFunction;
+        default:
+            return NULL;
+        }
+    }
+    
+void TAlfTableMappingFunctionHandler::HandleCmdL(
+    TInt aCommandId, 
+    const TDesC8& aInputBuffer, 
+    TDes8& aResponse )
+    {
+    switch ( aCommandId )
+        {   
+        case EAlfMappingFunctionMapValue:
+            {
+            TIntTReal* mapValues = (TIntTReal*) aInputBuffer.Ptr();
+            
+            const TReal32 returnValue = iMappingFunction.MapValue( mapValues->iReal, mapValues->iInt );
+            
+            TPckg<TReal32> returnValuePckg(returnValue);
+            aResponse = returnValuePckg; 
+            break;
+            }            
+        case EAlfMappingFunctionTableSetValues:
+            {
+            TAlfTableMappingFunctionParams* mapValues = (TAlfTableMappingFunctionParams*) aInputBuffer.Ptr();
+            iMappingFunction.iParams = *mapValues;                        
+            break;
+            }            
+        default:
+            User::Leave( KErrNotSupported );
+        }
+    }
+
+TAlfTableMappingFunction::TAlfTableMappingFunction()
+    {
+        
+    }
+    
+TReal32 TAlfTableMappingFunction::MapValue(TReal32 aValue, TInt /*aComponent*/) const __SOFTFP
+    {
+    // For performance resons, this same function exist both client and serverside
+    TReal32 retVal = aValue;
+    
+    TBool inverted = EFalse;
+    
+    if (iParams.iValues[KAlfTableMappingNumberOfMappedValues - 1] < iParams.iValues[0])
+        {
+        inverted = ETrue;    
+        }
+    
+    TInt i = 0;
+    
+    if (!inverted)
+        {
+        // Find closest pre-calculated value...
+        for (i=0; i<KAlfTableMappingNumberOfMappedValues-1;i++)
+            {
+            if ((!inverted && aValue < iParams.iValues[i]) ||
+                inverted && (aValue > iParams.iValues[i]))
+                {
+                retVal = iParams.iMappedValues[i];
+                break;                    
+                }
+            retVal = iParams.iMappedValues[i];                   
+            }
+
+        // ...do approximation, real value is between pre-calculated values
+        if (i != 0) 
+            {
+            TReal32 valueDelta = iParams.iValues[i] - aValue;
+            if (inverted)
+                {
+                valueDelta = -valueDelta;    
+                }
+            
+            TReal32 valueStep = iParams.iValues[i] - iParams.iValues[i-1];
+            TReal32 mappedValueStep = iParams.iMappedValues[i] - iParams.iMappedValues[i-1];
+            TReal32 fix = (valueDelta/valueStep) * mappedValueStep;
+            retVal -= fix;                               
+            }     
+        }
+     
+    return retVal;   
+    }
+            
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfnodes.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,2162 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+#include <uiacceltk/HuiCanvasVisual.h>
+#include <alfwindowstructs.h>
+
+#include "huiwscanvascommands.h"
+#include "alfnodes.h"
+#include "alfhierarchymodel.h"
+#include "alfstreamerserver.h"
+#include "alfwindowmanager.h"
+#include "alfwindow.h"
+#include "alfwindowdata.h"
+
+#ifdef ALF_DEBUG_PRINT_NODE_INFO
+    #define _ALF_LOGGING
+    #include "alflogger.h"
+    #undef _ALF_LOGGING
+#else
+    #include "alflogger.h"
+#endif
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfNode::CAlfNode( ) :  
+    iVisible( ETrue )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfNode::ConstructL( CAlfHierarchyModel* aModel, RMemReadStream* aStream  )
+    {
+    iModel = aModel;
+    iId = aStream->ReadInt32L();
+    }
+
+void CAlfNode::SetTracking( TBool aValue )
+    {
+    iTrackNode = aValue;
+    if ( iWindow )
+        {
+        iWindow->SetNodeTracking( aValue );
+        }
+    }
+// ---------------------------------------------------------------------------
+// OrphonMe
+// ---------------------------------------------------------------------------
+//
+CAlfNode* CAlfNode::OrphonMe()
+    {
+    __ALFLOGSTRING1("CAlfNode::OrphonMe %d", iId);
+	// this window will not be used anymore by wserv and cannot be drawn into. Thus destroying the
+	// visual representing this node is safe.
+    if ( iWindow && iModel )
+        {
+        iModel->Server().WindowMgr()->DestroyWindow( *iWindow );
+        iWindow = NULL;
+        }
+
+    CAlfNode* sibling = iSibling;
+    iSibling = NULL;
+    iParent = NULL;
+    return sibling;
+    }
+
+// ---------------------------------------------------------------------------
+// ResolveParentL
+// ---------------------------------------------------------------------------
+//
+void CAlfNode::ResolveParent( TUint32 aParentId, TInt aMyId )
+    {
+    CAlfNode* tmp = iModel->FindNode( aParentId );
+    if ( tmp )
+        {
+        // 1. set parent, if there is one (root node is the only exception )
+        iParent = tmp;
+        // Possible sprite, textcursor, anim and child windows have different lists on the node
+        switch( iType )
+            {
+            default:
+                {
+                SetFirstChild();
+                break;
+                }
+            case MWsWindowTreeNode::EWinTreeNodeAnim:
+                {
+                SetFirstAnim();
+                break;
+                }
+            case MWsWindowTreeNode::EWinTreeNodeSprite:
+                {
+                SetFirstSprite();
+                break;
+                }
+            case MWsWindowTreeNode::EWinTreeNodeStandardTextCursor:
+                {
+                ASSERT( !iParent->iTextCursor );
+                __ALFLOGSTRING1("parent->iTextCursor %d", iParent->iTextCursor );
+                iParent->iTextCursor = (CAlfNodeTextCursor*)this;
+                __ALFLOGSTRING1("parent->iTextCursor %d", iParent->iTextCursor );
+                break;
+                }
+            }
+        } 
+    iId = aMyId;
+    iModel->InsertNode( iId, this );
+    ASSERT( iParent != NULL || iType == MWsWindowTreeNode::EWinTreeNodeRoot);
+    
+    if ( iType == MWsWindowTreeNode::EWinTreeNodeGroup )
+        {
+        iGroupId = iId;
+        }
+    else
+        {
+        iGroupId = FindParentGroup();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SetFirstChild
+// ---------------------------------------------------------------------------
+//
+void CAlfNode::SetFirstChild()
+    {
+    if ( iParent->iChild )
+        {
+        // pass over the previous first child and make it my sibling
+        iSibling = iParent->iChild;
+        }
+    // jealously make me the first child
+    iParent->iChild = this;
+    }
+// ---------------------------------------------------------------------------
+// SetFirstChild
+// ---------------------------------------------------------------------------
+//
+void CAlfNode::SetFirstAnim()
+    {
+    if ( iParent->iAnimChild )
+        {
+        // pass over the previous first child and make it my sibling
+        iSibling = iParent->iAnimChild;
+        }
+    // jealously make me the first child
+    iParent->iAnimChild = (CAlfNodeAnim*)this;
+    }
+
+// ---------------------------------------------------------------------------
+// SetFirstChild
+// ---------------------------------------------------------------------------
+//
+void CAlfNode::SetFirstSprite()
+    {
+    if ( iParent->iSpriteChild )
+        {
+        // pass over the previous first child and make it my sibling
+        iSibling = iParent->iSpriteChild;
+        }
+    // jealously make me the first child
+    iParent->iSpriteChild = (CAlfNodeSprite*)this;
+    }
+
+// ---------------------------------------------------------------------------
+// FindParentGroup
+// ---------------------------------------------------------------------------
+//
+TUint32 CAlfNode::FindParentGroup()
+    {
+    // go back in parents, until a group node is found. return its id.
+    if ( iType == MWsWindowTreeNode::EWinTreeNodeSprite )
+        {
+        if ( iParent->iType == MWsWindowTreeNode::EWinTreeNodeRoot )
+            {
+            return 0;
+            }
+        else
+            {
+            return iParent->iId; // TODO: THIS IS ROOT, MIGHT NOT BE ALWAYS
+            }
+        }
+    
+    
+    if ( iType == MWsWindowTreeNode::EWinTreeNodeRoot )
+        {
+        return 0;
+        }
+    ASSERT( iParent );
+    CAlfNode* parent = iParent;
+    while( parent->iType != MWsWindowTreeNode::EWinTreeNodeGroup )
+        {
+        parent = parent->iParent;
+        }
+    return parent->iId;
+    }
+
+// ---------------------------------------------------------------------------
+// GetAllChildrenInGroup
+// ---------------------------------------------------------------------------
+//
+void CAlfNode::GetAllChildrenInGroup( RPointerArray<CAlfNode>& aNodes, TUint32 aParentId )
+	{
+	if ( iParent->iType != MWsWindowTreeNode::EWinTreeNodeRoot)
+		{
+		CAlfNode* parentGroupNode = iModel->FindNode( aParentId );
+		for (CAlfNode::TIter iter( parentGroupNode ); iter.Current() != NULL;  iter.Next()) 
+			{ 
+			aNodes.Append(iter.Current()); 
+			}
+		}
+	else
+		{
+		CAlfNode* child = iParent->iChild;
+		do
+			{
+			aNodes.Append( child );
+			child = child->iSibling; 
+			}
+		while( child );
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// OrdinalPosition
+// ---------------------------------------------------------------------------
+//
+TInt CAlfNode::OrdinalPosition()
+    {
+    //_LIT( KText, "OrdinalPosition");
+    __ALFLOGSTRING("CAlfNode::OrdinalPosition");
+    // __ALFLOGSTRING1("CAlfNode::OrdinalPosition - Looking for me %d", iId );
+    RPointerArray<CAlfNode> nodes;
+    TBool hasOrdinalPosition = ETrue;
+    
+    switch(iParent->iType)
+        {
+        case MWsWindowTreeNode::EWinTreeNodeClient:
+            {
+            CAlfNode* parentNode = iModel->FindNode( iParent->iId );
+            __ASSERT_DEBUG(parentNode, USER_INVARIANT());
+            if (parentNode->HasChildren())
+                {
+                // parent node is not added to the list
+                // the anims, cursor and sprites directly in this parent are added to the list
+                // siblings are added to the list, but their anims, cursors and sprites are not added
+                TraverseNodeTree( parentNode, nodes, EFalse /* list all for this node */, EFalse /* dont add me */);
+                }      
+            break;
+            }
+        case MWsWindowTreeNode::EWinTreeNodeGroup:
+            {
+            TUint32 parentId = FindParentGroup();
+            CAlfNode* parentGroupNode = iModel->FindNode( parentId );
+            //__ALFLOGSTRING1("CAlfNode::OrdinalPosition - My parent %d", parentId );        
+            CAlfNode* current;
+            if ( parentGroupNode )
+                {
+                current = parentGroupNode->iChild;
+                TraverseNodeTree( current, nodes, ETrue /* list siblings only */, ETrue /* add me */ );
+                }      
+
+            break;
+            }
+
+
+        case MWsWindowTreeNode::EWinTreeNodeRoot:
+            {
+            // Window group ordinal position calculation (their parent is EWinTreeNodeRoot)
+
+            // Root node can have window groups, sprites and perhaps anims as children.
+            // However, sprites & anims do not have ordinal position concept, but window groups do.
+            // These sprites & anims are placed to floating sprite control group in alfbridge side 
+            // and so they are excluded from ordinal position calculation.
+            CAlfNode* child = iParent->iChild;
+            if ( this == iParent->iTextCursor )
+                {
+                hasOrdinalPosition = EFalse;
+                }
+                
+            if ( hasOrdinalPosition && iParent->iSpriteChild )
+                {
+                CAlfNode* animnode = iParent->iSpriteChild ;
+                while ( animnode )
+                    {
+                    if ( this == animnode )
+                        {
+                        hasOrdinalPosition = EFalse;
+                        break;
+                        }
+                    animnode = animnode->iSibling;
+                    }
+                }
+
+            if( hasOrdinalPosition && iParent->iAnimChild )
+                {
+                CAlfNode* animnode = iParent->iAnimChild ;
+                while ( animnode )
+                    {
+                    if ( this == animnode )
+                        {
+                        hasOrdinalPosition = EFalse;
+                        break;
+                        }                    
+                    animnode = animnode->iSibling;
+                    }
+                }
+
+            if ( child )
+                {
+                do
+                    {
+                    nodes.Append( child );
+                    child = child->iSibling;
+                    }
+                while( child );
+                }
+            break;
+            }
+        }
+        
+    TInt ordinalPosition = -1;
+    if ( hasOrdinalPosition )
+        {        
+        TInt i = nodes.Count();
+        //   __ALFLOGSTRING1("Node count: %d", i );
+        // return my position in the node array
+        while( --i >=0 && nodes[i] != this ) 
+            {
+            }
+        if ( i < 0)
+            {
+            __ALFLOGSTRING1("Node %d not found!", iId);
+            __ASSERT_DEBUG( 0, USER_INVARIANT() );
+            //USER_INVARIANT();
+            }
+        else
+            {
+            __ALFLOGSTRING2("Found %d at ordinal position %d!", nodes[i]->iId, i );
+            }
+        ordinalPosition = i;
+        }
+    
+    nodes.Close();    
+    return ordinalPosition;
+    }
+
+// ---------------------------------------------------------------------------
+// CAlfNode::TraverseNodeTree
+// Traverse through node tree and fill node array 
+// ---------------------------------------------------------------------------
+//
+
+// ---------------------------------------------------------------------------
+// CAlfNode::TraverseNodeTree
+// Traverse through node tree and fill node array 
+// ---------------------------------------------------------------------------
+//
+
+void CAlfNode::TraverseNodeTree( CAlfNode* node,  RPointerArray<CAlfNode>& nodes, TBool aTraverseOnlySiblings, TBool aAddMe)
+    {
+    // Exit if we've already finished walking the tree.
+    if ( node == NULL) 
+        { 
+        __ALFLOGSTRING(" returning NULL");                                  
+        return;
+        }
+    if (!aTraverseOnlySiblings)
+        {
+        if ( node->iSpriteChild ) 
+            {
+        CAlfNode* spritenode = node->iSpriteChild ;
+            while ( spritenode )
+                {
+                nodes.Append( spritenode );                
+                spritenode = spritenode->iSibling;
+                }
+            }
+    
+        if( node->iTextCursor )
+            {
+            nodes.Append(node->iTextCursor );            
+            }
+    
+        if( node->iAnimChild )
+            {
+            CAlfNode* animnode = node->iAnimChild ;
+            while ( animnode )
+                {
+                nodes.Append( animnode );                
+                animnode = animnode->iSibling;
+                }
+            }
+        
+        if ( node->iChild)
+            {                
+            TraverseNodeTree(node->iChild , nodes, EFalse, ETrue);            
+            }
+        } 
+
+    if (aAddMe)
+        {
+        nodes.Append( node );
+        }
+
+    if ( node->iSibling )
+        {                
+        TraverseNodeTree(node->iSibling, nodes, ETrue, ETrue);               
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// OrdinalPosition
+// ---------------------------------------------------------------------------
+//
+#ifdef ALF_DEBUG_PRINT_NODE_INFO
+TInt CAlfNode::PrintOrdinalPositions()
+    {
+    TInt i = 0;
+    __ALFLOGSTRING("CAlfNode::PrintOrdinalPositions - ");
+    
+    RPointerArray<CAlfNode> nodes;
+    if ( iParent->iType != MWsWindowTreeNode::EWinTreeNodeRoot)
+        {
+        TUint32 parentId = FindParentGroup();
+        CAlfNode* parentGroupNode = iModel->FindNode( parentId );
+        for (CAlfNode::TIter iter( parentGroupNode ); iter.Current() != NULL;  iter.Next()) 
+            { 
+            nodes.Append(iter.Current()); 
+            }
+        }
+    else
+        {
+        CAlfNode* child = iParent->iChild;
+        do
+            {
+            nodes.Append( child );
+            }
+        while( ( child = child->iSibling) != NULL );
+        }
+    
+    i = nodes.Count();
+    // return my position in the node arr
+    TInt groupLevel = 0;
+    while( --i >=0  ) 
+    	{
+    	CAlfNodeVisual* node = (CAlfNodeVisual*)nodes[i];
+    	_LIT(KText, "PrintOrdinalPositions");
+    	// PrintInfo( i, node, TPtrC(KText), 0);
+    	}
+    nodes.Close();    
+    return i;
+    }
+
+void CAlfNode::PrintInfo( CAlfNode* aNode, TInt aHighLightNode, TInt aDepth)
+    {
+    HBufC16* buffer = HBufC16::NewL(256);
+    TPtr iDebugText = buffer->Des();
+    iDebugText.Format( _L(""));
+    MWsWindowTreeNode::TType type = aNode->Type();
+
+    for(TInt i = 0; i < aDepth; i++)
+        {
+        iDebugText.AppendFormat(_L(" "));
+        }
+		
+    // Print the parent id in front of every children. For debugging the debugging code...
+    //CAlfNode* parent = aNode->iParent;
+    //if (parent)
+    //	{
+	//	iDebugText.AppendFormat(_L("[0x%x] "), parent->iId);
+    //	}
+    if ( aHighLightNode == aNode->iId )
+        {
+        iDebugText.AppendFormat( _L("\n-- MODIFIED NODE -- \n"));
+        }
+
+    switch ( type )
+        {
+        case MWsWindowTreeNode::EWinTreeNodeRoot:
+            {
+            iDebugText.AppendFormat( _L("Root 0x%x"), aNode->iId);
+            break;
+            }
+        case MWsWindowTreeNode::EWinTreeNodeClient:
+            {
+            CAlfNodeVisual* nodeVisual = (CAlfNodeVisual*)aNode;
+            iDebugText.AppendFormat(_L("Client 0x%x: iTl: (%3d,%3d), size (%3dx%3d)"), nodeVisual->iId, nodeVisual->iOrigin.iX, nodeVisual->iOrigin.iY, nodeVisual->iSize.iWidth, nodeVisual->iSize.iHeight );
+                         
+            break;
+            }
+        case MWsWindowTreeNode::EWinTreeNodeGroup:
+            {
+            CAlfNodeGroup* nodeGroup = (CAlfNodeGroup*)aNode;
+            iDebugText.AppendFormat(_L("Group (%d) 0x%x: SecureId: 0x%x"), nodeGroup->iGroupId, nodeGroup->iId, nodeGroup->SecureId());
+            break;
+            }               
+        case MWsWindowTreeNode::EWinTreeNodeAnim:
+            {
+            CAlfNodeVisual* nodeVisual = (CAlfNodeVisual*)aNode;
+            iDebugText.AppendFormat(_L("Anim 0x%x: iTl: (%3d,%3d), size (%3dx%3d)"), nodeVisual->iId, nodeVisual->iOrigin.iX, nodeVisual->iOrigin.iY,nodeVisual->iSize.iWidth, nodeVisual->iSize.iHeight );
+            break;
+            }               
+        case MWsWindowTreeNode::EWinTreeNodeSprite:
+            {
+            CAlfNodeVisual* nodeVisual = (CAlfNodeVisual*)aNode;
+            iDebugText.AppendFormat(_L("Sprite 0x%x: iTl: (%3d,%3d), size (%3dx%3d)"), nodeVisual->iId, nodeVisual->iOrigin.iX, nodeVisual->iOrigin.iY,nodeVisual->iSize.iWidth, nodeVisual->iSize.iHeight );
+            break;
+            }               
+        case MWsWindowTreeNode::EWinTreeNodeStandardTextCursor:
+            {
+            // TODO, add more cursor info
+            CAlfNodeVisual* nodeVisual = (CAlfNodeVisual*)aNode;
+            iDebugText.AppendFormat(_L("Cursor 0x%x: iTl: (%3d,%3d), size (%3dx%3d)"), nodeVisual->iId, nodeVisual->iOrigin.iX, nodeVisual->iOrigin.iY,nodeVisual->iSize.iWidth, nodeVisual->iSize.iHeight );
+            break;
+            }
+        }
+    switch( type )
+    	{
+    	case MWsWindowTreeNode::EWinTreeNodeStandardTextCursor:
+    	case MWsWindowTreeNode::EWinTreeNodeSprite:
+    	case MWsWindowTreeNode::EWinTreeNodeAnim:
+    	case MWsWindowTreeNode::EWinTreeNodeClient:
+    		{
+    		CAlfNodeVisual* nodeVisual = (CAlfNodeVisual*)aNode;
+    		iDebugText.AppendFormat(_L("\t\t\t"));
+			if (nodeVisual->NonFading())
+				{
+				iDebugText.AppendFormat(_L("(NON FADING)"));
+				}
+
+			if (nodeVisual->Visible())
+				{
+				iDebugText.AppendFormat(_L("(VISIBLE)"));
+				}
+			
+			if (nodeVisual->Faded())
+				{
+				iDebugText.AppendFormat(_L("(FADED)"));
+				}
+			
+			if (nodeVisual->Activated())
+				 {
+				 iDebugText.AppendFormat(_L("(ACTIVATED)"));
+				 }
+    		}
+    	}
+    RDebug::Print(_L("%S"), &iDebugText);
+    delete buffer;
+    }
+
+void CAlfNode::PrintNodeTree(
+        CAlfNodeRoot* aNode,
+        TInt aHighlightNode)
+    {
+    if (!aNode->iLogging) // Change this value during run-time. This produces A LOT of output
+        {
+        return;
+        }
+    TInt depth(0);
+    CAlfNode::PrintSubTree((CAlfNode*)aNode,aHighlightNode, depth);
+    }
+
+void CAlfNode::PrintSubTree( CAlfNode* aNode, TInt aHighlightNode, TInt& aDepth )
+    {
+    aDepth++;
+    CAlfNode::PrintInfo(aNode, aHighlightNode, aDepth);
+   
+    CAlfNode* node = (CAlfNode*)aNode->iSpriteChild;
+       while( node )
+           {
+           CAlfNode::PrintInfo( node, aHighlightNode, aDepth + 1);
+           node = node->iSibling;
+           }
+       node = (CAlfNode*)aNode->iAnimChild;
+       while( node )
+           {
+           CAlfNode::PrintInfo(node, aHighlightNode, aDepth + 1);
+           node = node->iSibling;
+           }
+       if ( aNode->iTextCursor )
+           {
+           CAlfNode::PrintInfo( aNode->iTextCursor, aHighlightNode, aDepth + 1);
+           }
+       node = (CAlfNode*)aNode->iChild;
+       while ( node )        
+           {
+           node->PrintSubTree( node, aHighlightNode, aDepth );
+           node = node->iSibling;
+           }
+       aDepth--;
+    }
+
+ #endif
+// ---------------------------------------------------------------------------
+// TIter::TIter
+// ---------------------------------------------------------------------------
+//
+CAlfNode::TIter::TIter(CAlfNode* aTopNode) 
+        : iTopNode(aTopNode) 
+        , iCurrentNode(aTopNode),
+        iState( ESearchingSprites )
+        { 
+        // Find the first node 
+        while(iCurrentNode->iChild!=NULL) 
+                { 
+                iCurrentNode=iCurrentNode->iChild; 
+                } 
+        
+        iCurrentSibling=iCurrentNode->iSibling;        // De-reference iCurrent so it can be destroyed by caller 
+        iCurrentParent=iCurrentNode->iParent; 
+        } 
+
+// ---------------------------------------------------------------------------
+// TIter::Current
+// ---------------------------------------------------------------------------
+//
+CAlfNode* CAlfNode::TIter::Current() 
+        { 
+        return iCurrentNode; 
+        } 
+
+// ---------------------------------------------------------------------------
+// TIter::Next
+// ---------------------------------------------------------------------------
+//
+CAlfNode* CAlfNode::TIter::Next() 
+        { 
+        // Exit if we've already finished walking the tree. Do not return the group node
+        if (iCurrentNode == iTopNode || iCurrentNode == NULL) 
+                { 
+                __ALFLOGSTRING("Iter returning NULL");
+                iCurrentNode = NULL;
+                iState = ESearchingSprites;
+                return NULL; 
+                }
+        
+//Diagram shows visit order with parent (/) and sibling relationships (>) 
+//  
+//              -  14 - 
+//            /           \ 
+//          6       >       13 
+//         / \           /  |   \ 
+//        3 > 5        10 > 11 > 12 
+//       / \   \     / | \ 
+//      1 > 2   4  7 > 8 > 9 
+//  
+// 
+        // Todo.
+        // Return sprites in order
+        
+      
+        if ( iState == ESearchingSprites )
+            {
+            iMasterNode = iCurrentNode;
+                    
+            if ( iCurrentNode->iSpriteChild )
+                {
+                // TODO: As long as we are putting sprites into their own group, we cannot count their ordinals
+                //iCurrentNode = (CAlfNode*)iCurrentNode->iSpriteChild;
+                //iState = ESearchMoreSprites;
+                //return iCurrentNode;
+                iState = ESearchingTextCursor;
+                }
+            else
+                {
+                iState = ESearchingTextCursor;
+                }
+            }
+        
+        if ( iState == ESearchMoreSprites )
+            {
+            if ( iCurrentNode->iSibling )
+                {
+                iCurrentNode = iCurrentNode->iSibling;
+                return iCurrentNode;
+                
+                }
+            else
+                {
+                iCurrentNode = iMasterNode;
+                iState = ESearchingTextCursor;
+                }
+            }
+        
+        if ( iState == ESearchingTextCursor )
+            {
+            if ( iMasterNode->iTextCursor )
+                {
+                iCurrentNode = iMasterNode->iTextCursor;
+                iState = ESearchingMoreTextCursor;
+                return iCurrentNode;
+                }
+            else
+                {
+                iState = ESearchingAnims;
+                }
+            }
+        
+        if ( iState == ESearchingMoreTextCursor )
+            {
+            iCurrentNode = iMasterNode;
+            iState = ESearchingAnims;        
+            return iCurrentNode;
+        
+            }
+        
+        if ( iState == ESearchingAnims )
+            {
+            if ( iCurrentNode->iAnimChild )
+                {
+                iCurrentNode = (CAlfNode*)iCurrentNode->iAnimChild;
+                iState = ESearchMoreAnims;
+                return iCurrentNode;
+                }
+            else
+                {
+                iState = ESearchingChildWindows;
+                iChildrenProcessed = ETrue;
+                iCurrentSibling = iMasterNode->iSibling;
+                }
+            }
+        
+        if ( iState == ESearchMoreAnims )
+            {
+            if ( iCurrentNode->iSibling ) // anim sibling
+                {
+                iCurrentNode = iCurrentNode->iSibling;
+                return iCurrentNode;
+                
+                }
+            else
+                {
+                iCurrentNode = iMasterNode;
+
+                iState = ESearchingChildWindows;
+                // if this node is having children windows, then we need to go to them
+                if ( iCurrentNode->iChild )
+                    {
+                    iCurrentSibling = iCurrentNode->iChild;
+                    // Look the deepest child
+                    iCurrentNode=iCurrentSibling; 
+                    while(iCurrentNode->iChild!=NULL) 
+                        { 
+                        iCurrentNode=iCurrentNode->iChild; 
+                        } 
+                    
+                    iState = ESearchingSprites;
+                    return iCurrentNode;
+                    }
+                else
+                    {
+                    // if no children windows, then this node is done and it should be returned
+                    return iCurrentNode;
+                    }
+                }
+            }
+            
+            if ( iState == ESearchingChildWindows )
+                {
+                if (iCurrentSibling!=NULL) 
+                    { 
+                    iCurrentNode=iCurrentSibling; 
+                    while(iCurrentNode->iChild!=NULL) 
+                        { 
+                        iCurrentNode=iCurrentNode->iChild; 
+                        } 
+                    } 
+                else 
+                    { 
+                    iCurrentNode = iCurrentParent;
+                    iChildrenProcessed = EFalse;
+                    } 
+    
+                iCurrentSibling=iCurrentNode->iSibling;        // De-reference iCurrent so it can be destroyed by caller 
+                iChildrenProcessed = EFalse;
+                iState = ESearchingSprites;
+                iCurrentParent=iCurrentNode->iParent; 
+                if ( iCurrentNode == iTopNode )
+                    {
+                    iCurrentNode = NULL;
+                    }
+                return iCurrentNode; 
+                }
+        return NULL;
+        } 
+
+// ---------------------------------------------------------------------------
+// FindPreviousChild
+// ---------------------------------------------------------------------------
+//
+CAlfNode* CAlfNode::FindPreviousChild()
+    {
+    CAlfNode* previousSibling = NULL;
+    switch ( iType )
+        {
+        default:
+            {
+            previousSibling = iParent->iChild;
+            break;
+            }
+        case MWsWindowTreeNode::EWinTreeNodeAnim:
+            {
+            previousSibling = iParent->iAnimChild;
+            break;
+            }
+        case MWsWindowTreeNode::EWinTreeNodeSprite:
+            {
+            previousSibling = iParent->iSpriteChild;
+            break;
+            }
+        case MWsWindowTreeNode::EWinTreeNodeStandardTextCursor:
+            {
+            previousSibling = iParent->iTextCursor;
+            break;
+            }
+        }
+     
+    if ( previousSibling == this ) 
+        {
+        return NULL; // return NULL, if I was the first child
+        }
+    // starting from the first child, loop until this one is found.
+    
+    while( previousSibling->iSibling != this)
+        {
+        previousSibling = previousSibling->iSibling;
+        }
+    
+    return previousSibling; // return the previous child. return NULL, if this was the first child
+    }
+
+// ---------------------------------------------------------------------------
+// FadeCountChanged
+// Fade count changes are sent also to Anim, Sprite and text cursor nodes.
+// ---------------------------------------------------------------------------
+//
+void CAlfNode::FadeCountChanged( TInt aFadeCount )
+    {
+	RArray<CAlfNode*> children;
+	ListOffspring(children, EFalse); // EFalse = dont list chilren, only sprites, anims and textcursor
+	TBool fade = aFadeCount ? ETrue : EFalse;
+    
+    for(TInt i=0;i<children.Count(); i++)
+    	{
+		children[i]->SetFaded(fade);        
+    	}
+    children.Close();
+    iFadeCount = aFadeCount;
+    }
+
+// ---------------------------------------------------------------------------
+// SetFaded
+// ---------------------------------------------------------------------------
+//
+void CAlfNode::SetFaded( TBool aFaded )
+    {
+    iFadeState = aFaded && ( !iNonFading );
+    if (Type()== MWsWindowTreeNode::EWinTreeNodeRoot)
+        {
+        // NO need to deliver fades for root
+        return;
+        }
+    if (iFadeState != iPostedFadeState)
+        {
+        iModel->Server().Bridge()->AddData( EAlfDSSetFadeEffect, iId , iFadeState);
+        iPostedFadeState = iFadeState;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// FadeAllChildren
+// ---------------------------------------------------------------------------
+//
+void CAlfNode::FadeAllChildren( TBool aFaded )
+    {
+    SetFaded(aFaded);
+    
+    CAlfNode* node = (CAlfNode*)iSpriteChild;
+    while( node )
+        {
+        node->SetFaded( iFadeState );        
+        node = node->iSibling;
+        }
+    node = (CAlfNode*)iAnimChild;
+    while( node )
+        {
+        node->SetFaded( iFadeState );       
+        node = node->iSibling;
+        }
+    if ( iTextCursor )
+        {
+        iTextCursor->SetFaded( iFadeState );
+        }
+    node = (CAlfNode*)iChild;
+    while ( node )        
+        {
+        node->FadeAllChildren( iFadeState );
+        node = node->iSibling;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ListOffspring
+// ---------------------------------------------------------------------------
+//
+void CAlfNode::ListOffspring( RArray<CAlfNode*>& aList, TBool aListChildren)
+    {
+    aList.Append(this);
+    
+    CAlfNode* node = (CAlfNode*)iSpriteChild;
+    while( node )
+        {
+		aList.Append(node);        
+        node = node->iSibling;
+        }
+    node = (CAlfNode*)iAnimChild;
+    while( node )
+        {
+		aList.Append(node);       
+        node = node->iSibling;
+        }
+    if ( iTextCursor )
+        {
+		aList.Append(iTextCursor);
+        }
+    if (aListChildren)
+    	{
+		node = (CAlfNode*)iChild;
+		while ( node )        
+			{
+			node->ListOffspring( aList );
+			node = node->iSibling;
+			}
+    	}
+    }
+// ---------------------------------------------------------------------------
+// FlagChanged
+// ---------------------------------------------------------------------------
+//
+void CAlfNode::FlagChanged( MWsWindowTreeObserver::TFlags aFlag, TBool aNewValue )
+    {
+    switch( aFlag )
+        {
+        case MWsWindowTreeObserver::EVisible:
+            {
+            // TODO: Do something!!!!
+            iVisible = aNewValue;
+            break;
+            }
+        case MWsWindowTreeObserver::ENonFading:
+            {
+            iNonFading = aNewValue;
+            FadeAllChildren(iFadeState);
+            break;
+            }
+        case MWsWindowTreeObserver::EAlphaChannelTransparencyEnabled:
+            {
+            iAlphaChannelTransparencyEnabled = aNewValue;
+            break;
+            }
+        case MWsWindowTreeObserver::ECursorClipRectSet:
+            {
+            // TODO: take into account with cursor 
+            // ECursorClipRectSet
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CreateWindowAttributes
+// ---------------------------------------------------------------------------
+//
+TAny* CAlfNode::CreateWindowAttributes(TInt& aIndex, TInt aSize )
+    {
+    TAny* attributes = NULL;
+    TRAP_IGNORE(attributes = (TAny*)iModel->Server().Bridge()->AppendVarDataL( aSize, aIndex ))
+    Mem::FillZ( (TUint8*)attributes, aSize ); // Initialize the returned memory area to 0
+    return attributes;
+    }
+
+// ---------------------------------------------------------------------------
+// SiblingOrderChanged
+// ---------------------------------------------------------------------------
+//
+ void CAlfNode::SiblingOrderChanged( TInt aNewPos )
+    {
+    // __ALFLOGSTRING1("CAlfNode::SiblingOrderChanged - Id %d, Old ordinal position: %d"), iId, OrdinalPosition());
+    ASSERT( iType != MWsWindowTreeNode::EWinTreeNodeRoot); 
+    ASSERT( iType != MWsWindowTreeNode::EWinTreeNodeSprite);
+    ASSERT( iType != MWsWindowTreeNode::EWinTreeNodeAnim);
+    ASSERT( iType != MWsWindowTreeNode::EWinTreeNodeStandardTextCursor);
+    ASSERT( iType == MWsWindowTreeNode::EWinTreeNodeGroup || iType == MWsWindowTreeNode::EWinTreeNodeClient );
+    ASSERT(iParent != NULL); 
+    ASSERT(iParent->iChild != NULL); 
+    CAlfNode* previous = FindPreviousChild();
+    ASSERT( previous || this == iParent->iChild );
+        
+    
+    // Need to find the previous node to this node (oldPrevNode) 
+    // and the node previous to aNewPos (newPrevNode) 
+    // Then link oldPrevNode->iSibling to this->iSibling (unlink this node from the chain) 
+    // And  link this->iSibling to newPrevNode->iSibling (link the right hand side of this node back in) 
+    // And  link newPrevNode->iSibling to this                          (link the left hand side of this node back in) 
+
+    // Will point to the prev node for the current/old position 
+    CAlfNode* oldPrevNode = NULL; 
+    // Will point to the prev node for the new position 
+    CAlfNode* newPrevNode = NULL; 
+
+    // parent 
+    //   | 
+    //   |   0   1   2   3   4 
+    //   +-->A ->B ->C ->D ->E ->null 
+    //      ^^^ 
+    // position 0 is a special case... 
+    // if the new position is 0 then newPrevNode is the parent 
+    // if this is the leftmost sibling then oldPrevNode is the parent 
+
+    TInt iterNodePosition=0; 
+    CAlfNode* iterPrevNode = iParent; 
+    CAlfNode* iterNode = iParent->iChild;         
+
+    while (oldPrevNode == NULL || newPrevNode == NULL) 
+        { 
+        // Have we found the current/old position? 
+            if (iterNode == this) 
+                { 
+                oldPrevNode = iterPrevNode; 
+
+                if (newPrevNode == NULL && iterNodePosition != aNewPos) 
+                    { 
+                    // Found the old position first 
+                    // and not at the new position yet 
+                    // so "this" will be moving to the right 
+                    // which will cause the following nodes to move left by one 
+                    // so we need to compensate by adding one to the target position 
+                    // 
+                    //     0   1   2   3   4 
+                    // p ->A ->B ->C ->D ->E ->n  if we are moving B to position 3 then need to find D->E link (iterPrevNode->iterNode) 
+                    // p ->A ->C ->D ->B ->E ->n  but because C and D will be moving left, 
+                    //                            D->E is actually position at 4. 
+                    ++aNewPos; 
+                    }                         
+                } 
+
+            // Have we found the new position? 
+            if (iterNodePosition == aNewPos) 
+                { 
+                newPrevNode = iterPrevNode; 
+                } 
+
+            // Move onto the next node - if there is one 
+            if (iterNode != NULL) 
+                { 
+                // move to next node 
+                iterPrevNode = iterNode; 
+                iterNode = iterNode->iSibling;                 
+                ++iterNodePosition; 
+                } 
+            else 
+                { 
+                // parent 
+                //   | 
+                //   |   0   1   2   3   4 
+                //   +-->A ->B ->C ->D ->E ->null 
+                //                           ^^^ 
+                // if iterNode gets to NULL, then we must have found both matches 
+                // - i.e. either the new or current/old position is the rightmost node   
+                ASSERT(oldPrevNode!=NULL && newPrevNode!=NULL); 
+                } 
+
+            ASSERT(iterPrevNode!=NULL);                 
+        } // end while loop 
+
+    if (newPrevNode == oldPrevNode) 
+        { 
+        // we are being asked to move to our current position 
+        // nothing to do 
+
+        return; 
+        } 
+
+    // In the following example, oldPrevNode is A, this is B and newPrevNode is D - as discussed above 
+    // 
+    // Unlink this node from the chain (A->B becomes A->C, nothing points to B) 
+    //      0    1    2    3    4 
+    // p--->A-¬  B-+->C--->D--->E--->n 
+    //         \--/ 
+    if (oldPrevNode == iParent) 
+        { 
+        iParent->iChild = iSibling; 
+        } 
+    else 
+        { 
+        oldPrevNode->iSibling = iSibling; 
+        } 
+
+    // Link the right hand side of this node back in (B->C becomes B->E, B half at position 3) 
+    //      0         1    2 3  4 
+    // p--->A-------->C--->D-+->E--->n 
+    //                B-----/ 
+    if (newPrevNode == iParent) 
+        { 
+        iSibling = iParent->iChild; 
+        } 
+    else 
+        { 
+        iSibling = newPrevNode->iSibling; 
+        } 
+
+    // Link the left hand side of this node back in (D->E becomes D->B, B fully linked into position 3) 
+    //      0    1    2    3    4 
+    // p--->A--->C--->D¬     +->E--->n 
+    //                  \-B-/ 
+    if (newPrevNode == iParent) 
+        { 
+        iParent->iChild = this; 
+        } 
+    else 
+        { 
+        newPrevNode->iSibling = this; 
+        } 
+    
+    UpdateOrdinalPosition();
+    
+    if (HasChildren())
+        {
+        UpdateChildrenOrdinalPositions(this);
+        }
+    
+    /*
+    TInt ordinal = OrdinalPosition();
+    __ALFLOGSTRING1("New ordinal position: %d"), OrdinalPosition());
+#ifdef _DEBUG    
+    PrintOrdinalPositions();
+#endif    
+    TInt offset;
+    TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*)CreateWindowAttributes(offset, sizeof(TAlfWindowAttributes));
+    windowAttributes->iOrdinalPosition = ordinal; 
+    windowAttributes->iWindowNodeType = iType;
+    windowAttributes->iScreenNumber = iScreenNumber;
+    
+    iModel->Server().Bridge()->AddData( EAlfDSReorder, 
+            iGroupId, 
+            iId, 
+            (TAny*)offset );
+            */
+            
+            
+    }
+
+// ---------------------------------------------------------------------------
+// destructor
+// ---------------------------------------------------------------------------
+// 
+CAlfNode::~CAlfNode()
+    {
+    __ALFLOGSTRING1("CAlfNode::~CAlfNode %d", iId);
+    }
+
+// ---------------------------------------------------------------------------
+// HasChildren
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfNode::HasChildren()
+    {
+    return iSpriteChild || iAnimChild || iTextCursor || iChild;
+    }
+
+// ---------------------------------------------------------------------------
+// RemoveDependencies
+// ---------------------------------------------------------------------------
+// 
+void CAlfNode::RemoveDependencies( CAlfNode* aFirstChildOfMyType )
+    {
+    // if I have siblings, then make my previous sibling's next sibling, that used to be my next sibling
+    /*if ( iParent )
+        {
+        __ALFLOGSTRING1( "%d %d %d %d"), iParent->iChild , iParent->iSpriteChild , iParent->iAnimChild, iParent->iTextCursor );
+        }*/
+
+    if ( iModel && iParent && aFirstChildOfMyType )
+        {
+        CAlfNode* previousSibling = FindPreviousChild();
+        if ( previousSibling )
+            {
+            previousSibling->iSibling = iSibling;
+            }
+        else
+            {
+            // If we do not have previous sibling
+            switch ( iType )
+                {
+                default:
+                    {
+                    iParent->iChild = iSibling; // Parent's child needs to change ONLY IF I was the first one.
+                    break;
+                    }
+                case MWsWindowTreeNode::EWinTreeNodeAnim:
+                    {
+                    iParent->iAnimChild = (CAlfNodeAnim*)iSibling;
+                    break;
+                    }
+                case MWsWindowTreeNode::EWinTreeNodeSprite:
+                    {
+                    iParent->iSpriteChild = (CAlfNodeSprite*)iSibling;
+                    break;
+                    }
+                }
+            
+            }
+        }
+    else
+        {
+        __ALFLOGSTRING1("My parent says, that I'm not his child :..( or no parent %d ", iParent );
+        }
+    
+    // Orphon all the children
+    CAlfNode* child = iChild; 
+    while( child )
+        {
+        child = child->OrphonMe();
+        }
+    iChild = NULL;
+    if ( iModel )
+        {    
+        iModel->RemoveNode( iId );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfNodeVisual::CAlfNodeVisual() 
+    {
+    iWindow =  NULL;
+    };
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+void CAlfNodeVisual::ConstructL( CAlfHierarchyModel* aModel, RMemReadStream* aStream )
+	{
+	CAlfNode::ConstructL( aModel, aStream );
+    aStream->ReadL( (TUint8*)&iOrigin, sizeof(TPoint));
+    aStream->ReadL( (TUint8*)&iSize, sizeof(TSize));
+	}
+
+// ---------------------------------------------------------------------------
+// ReadEndMarkerL
+// ---------------------------------------------------------------------------
+//
+void CAlfNodeVisual::ReadEndMarkerL( RMemReadStream& aStream )
+    {
+    TUint8 marker = aStream.ReadInt8L();
+    ASSERT( marker == EAlfCommandEndMarker ) ; // endmarker
+    }
+ 
+// ---------------------------------------------------------------------------
+// UpdateOrdinalPosition
+// ---------------------------------------------------------------------------
+//
+void CAlfNode::UpdateOrdinalPosition()
+    {
+    TInt ordinal = OrdinalPosition();
+    if ( ordinal >= 0 )
+        {
+        if ( iWindow )
+            {
+            iWindow->Move( ordinal );
+            }
+        else
+            {
+            //!!!! There is no window???
+            // position must be updated, because it not necessary the first drawn.
+            TInt offset;
+            TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*)CreateWindowAttributes(offset, sizeof(TAlfWindowAttributes));
+            windowAttributes->iOrdinalPosition = ordinal; 
+            windowAttributes->iWindowNodeType = iType;
+            windowAttributes->iScreenNumber = iScreenNumber;
+            // for updating window group ordinals
+            iModel->Server().Bridge()->AddData( EAlfDSReorder, 
+                    iGroupId, 
+                    iId, 
+                    (TAny*)offset );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// UpdateChildrenOrdinalPositions
+// ---------------------------------------------------------------------------
+//
+void CAlfNode::UpdateChildrenOrdinalPositions(CAlfNode* aNode)
+    {
+    CAlfNode* node = (CAlfNode*)aNode->iSpriteChild;
+    while( node )
+        {
+        node->UpdateOrdinalPosition();
+        node = node->iSibling;
+        }
+    node = (CAlfNode*)aNode->iAnimChild;
+    while( node )
+        {
+        node->UpdateOrdinalPosition();
+        node = node->iSibling;
+        }
+    if ( aNode->iTextCursor )
+        {
+        (aNode->iTextCursor)->UpdateOrdinalPosition();
+        }
+    node = (CAlfNode*)aNode->iChild;
+    while ( node )        
+        {
+        node->UpdateChildrenOrdinalPositions(node);
+        node->UpdateOrdinalPosition();
+        node = node->iSibling;
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+// CommitCommandsL
+// ---------------------------------------------------------------------------
+//
+void CAlfNodeVisual::CommitCommands( TInt aCurrentPos, TInt aFrameSize, TBool aPartial, TBool aLastPart, TInt aChunkInUse  )
+    {
+    // __ALFLOGSTRING1("CAlfNodeVisual::CommitCommandsL, Id/Group: %d/%d Type: %d, Pos: %d, Size: %d, last part %d"), iId, iGroupId, iType, aCurrentPos, aFrameSize, aLastPart );
+    if ( !iWindow )
+        {
+        __ALFLOGSTRING("CAlfHierarchyModel::CommitCommandsL Discarding window commands");
+        return;
+        }
+
+    if ( !aFrameSize )
+        {
+        __ALFLOGSTRING3("CAlfHierarchyModel::CommitCommandsL empty frame Pos: %d, Size: %d, last part %d ", aCurrentPos, aFrameSize, aLastPart );
+        return;
+        }
+    
+    TBool emptyBuffer = EFalse;
+    
+    TInt nodeFlags = 0;
+
+    // By default nodes are always opaque, unless they are sprites (or anims?) or
+    // transparency has been enabled in the window.    
+    if (iType != MWsWindowTreeNode::EWinTreeNodeSprite && 
+        iType != MWsWindowTreeNode::EWinTreeNodeAnim &&
+       iType != MWsWindowTreeNode::EWinTreeNodeStandardTextCursor &&
+        !iAlphaChannelTransparencyEnabled)
+        {
+        nodeFlags |= EAlfWinNodeFlagOpaque;         
+        }
+        
+    if ( iType == MWsWindowTreeNode::EWinTreeNodeStandardTextCursor )
+        {
+        emptyBuffer = ETrue;
+        }
+       
+    iWindow->PostPartialBuffer( iModel->ChunkBase(aChunkInUse) + aCurrentPos, aFrameSize, aPartial, aLastPart , emptyBuffer, nodeFlags );
+    }
+
+// ---------------------------------------------------------------------------
+// DrawWindowFrameL
+// ---------------------------------------------------------------------------
+void CAlfNodeVisual::DrawWindowFrameL( RMemReadStream& aStream )
+    {
+    TInt32 chunkInUse = aStream.ReadInt32L();
+    TInt nextFramePos = aStream.ReadInt32L();
+       
+    // jump to the next frame
+    if ( nextFramePos == 12345678 )
+        {
+        __ALFLOGSTRING("CAlfHierarchyModel::PostBufferL, Address of the frame has not been initialized!");
+        }
+    // read frame flags. For offscreen content, we'll add the complete packets 
+     // as partial, if they have not been implicitly flushed 
+     
+     TUint8 command = aStream.ReadInt8L();
+     __ASSERT_DEBUG( command == EAlfFrameFlags, USER_INVARIANT() );
+     TInt32 frameFlags = aStream.ReadInt32L();
+
+    TUint8 padding = aStream.ReadInt8L();
+    ReadEndMarkerL( aStream );
+    while( padding--)
+        {
+        aStream.ReadInt8L();
+        }
+        
+    TInt currentPos = aStream.Source()->TellL( MStreamBuf::ERead ).Offset();
+    aStream.Source()->SeekL( MStreamBuf::ERead, TStreamPos(nextFramePos));
+    TSgcCanvasCommands packetState = (TSgcCanvasCommands)aStream.ReadInt8L();
+    TInt frameSize = nextFramePos - currentPos;
+#ifdef _DEBUG
+    ASSERT( currentPos % 8 == 0 );
+#endif
+    
+    //__ALFLOGSTRING1("CAlfHierarchyModel::PostBufferL endMarker: %d partial: %d"), endMarker, iReadingPartialBuffer );
+    switch( packetState )
+        {
+        case EAlfPacketReady:
+            {
+            if ( frameFlags & EAlfTransparentContent )
+                {
+                if ( frameFlags & EAlfTransparentContentFlush  )
+                    {
+                    CommitCommands( currentPos, frameSize, !iReadingPartialBuffer /*partial*/, ETrue /*lastpart*/, chunkInUse );
+                    }
+                else
+                    {
+                    CommitCommands( currentPos, frameSize, ETrue /*partial*/, EFalse/*not lastpart*/, chunkInUse );
+                    }
+                }
+            else
+                {
+                CommitCommands( currentPos, frameSize, iReadingPartialBuffer, ETrue, chunkInUse );
+                }
+            iReadingPartialBuffer = EFalse;
+                            
+            break;
+            }
+        case EAlfPacketNotReady:
+            {
+            __ASSERT_DEBUG( nextFramePos % 8 == 0, USER_INVARIANT() );
+            __ASSERT_DEBUG( frameSize % 8 == 0, USER_INVARIANT() );
+            iReadingPartialBuffer = ETrue;
+            CommitCommands( currentPos, frameSize, iReadingPartialBuffer, EFalse, chunkInUse );
+            break;
+            }
+        default:
+            {
+            __ALFLOGSTRING1("CAlfHierarchyModel::PostBufferL endMarker: %d ", packetState);
+            break;
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// FlagChanged
+// ---------------------------------------------------------------------------
+//
+void CAlfNodeVisual::FlagChanged( MWsWindowTreeObserver::TFlags aFlag, TBool aNewValue )
+    {
+    switch( aFlag )
+        {
+        case MWsWindowTreeObserver::EVisible:
+            {
+            iVisible = aNewValue;
+            if ( iWindow )
+            	{
+            	if ( iVisible && iNodeActivated )
+            		{
+            		iWindow->SetActive( ETrue );
+            		}
+            	else
+            		{
+                    iWindow->SetActive( EFalse );
+            		}
+            	}
+            break;
+            }
+        case MWsWindowTreeObserver::ENonFading:
+            {
+            iNonFading = aNewValue;
+            SetFaded(iFadeState);
+            break;
+            }
+        case MWsWindowTreeObserver::EAlphaChannelTransparencyEnabled:
+            {
+            iAlphaChannelTransparencyEnabled = aNewValue;
+            break;
+            }
+        }
+    if ( aFlag == MWsWindowTreeObserver::ENonFading && HasChildren() )
+        {
+        UpdateChildrenFlags( aFlag, iFadeState );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// UpdateChildrenFlags
+// ---------------------------------------------------------------------------
+//
+void CAlfNodeVisual::UpdateChildrenFlags( MWsWindowTreeObserver::TFlags aFlag, TBool aNewValue )
+    {
+    CAlfNode* node = (CAlfNode*)iSpriteChild;
+    while( node )
+        {
+        node->FlagChanged( aFlag, aNewValue );
+        node = node->iSibling;
+        }
+    node = (CAlfNode*)iAnimChild;
+    while( node )
+        {
+        node->FlagChanged( aFlag, aNewValue );
+        node = node->iSibling;
+        }
+    if ( iTextCursor )
+        {
+        iTextCursor->FlagChanged( aFlag, aNewValue );
+        }
+    node = (CAlfNode*)iChild;
+    while ( node )
+        
+        {
+        node->FlagChanged( aFlag, aNewValue ); // causes recursion on children
+        node = node->iSibling;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SetExtent
+// ---------------------------------------------------------------------------
+//
+void CAlfNodeVisual::SetExtent( TRect& aRect )
+    {
+	// aRect is in screen coordinates whereas iOrigin and iSize are relative.
+    if ( iSize != aRect.Size() )
+    	{
+    	iSize = aRect.Size();
+    	if ( iWindow) 
+    		{
+    		iWindow->SetSize(iSize,0);
+    		}
+    	}
+  	// Recursively, TODO, check this with flash example
+   	TPoint parentPosition; 
+   	CAlfNodeVisual* parent = (CAlfNodeVisual*)iParent;
+   	while(parent)
+   	    {
+        if(parent->Type() != MWsWindowTreeNode::EWinTreeNodeGroup)
+            { // parent 
+            parentPosition += parent->iOrigin;
+            parent = (CAlfNodeVisual*)parent->iParent;
+            }
+        else
+            {
+            break;
+            }
+                
+    	}
+            
+    TPoint newOrigin = aRect.iTl - parentPosition;
+    if ( iOrigin != newOrigin )
+    	{            
+    	iOrigin = newOrigin;
+    	if (iWindow)
+    		{
+    		iWindow->SetPos(iOrigin, 0 );
+    		/*if (HasChildren())
+    		    {
+    		    UpdateChildrenExtents(posDelta);
+    		    }*/
+    		// __ALFLOGSTRING1("CAlfNodeVisual, SetPos %d,%d, iType %d"), iOrigin.iX, iOrigin.iY, iType );
+    		}
+    	}
+    // __ALFLOGSTRING1("CAlfNodeVisual, SetExtent iSize: %d,%d ; iPosition %d,%d "), iSize.iWidth, iSize.iHeight, iOrigin.iX, iOrigin.iY ); 
+    }
+
+void CAlfNodeVisual::UpdateParentPosition(TPoint aPosDelta)
+    {
+    // iParentPosition = aRect.iTl;
+    // iParentSize = aRect.Size();
+    
+    // Todo, size change?
+    if (iWindow)
+        {
+        iOrigin += aPosDelta;
+        iWindow->SetPos( iOrigin, 0 );
+        UpdateChildrenExtents(aPosDelta);
+        // __ALFLOGSTRING1("CAlfNodeVisual, SetPos %d,%d, iType %d"), iOrigin.iX, iOrigin.iY, iType );
+        }
+
+    }
+
+void CAlfNodeVisual::UpdateChildrenExtents(TPoint aPosDelta)
+    {
+        CAlfNode* node = (CAlfNode*)iSpriteChild;
+        while( node )
+            {
+            ((CAlfNodeVisual*)node)->UpdateParentPosition(aPosDelta);
+            node = node->iSibling;
+            }
+        node = (CAlfNodeVisual*)iAnimChild;
+        while( node )
+            {
+            ((CAlfNodeVisual*)node)->UpdateParentPosition(aPosDelta);
+            node = node->iSibling;
+            }
+        if ( iTextCursor )
+            {
+            ((CAlfNodeVisual*)iTextCursor)->UpdateParentPosition(aPosDelta);
+            }
+        node = (CAlfNodeVisual*)iChild;
+        while ( node )        
+            {
+            ((CAlfNodeVisual*)node)->UpdateChildrenExtents(aPosDelta);
+            ((CAlfNodeVisual*)node)->UpdateParentPosition(aPosDelta);
+                        
+            node = node->iSibling;
+            }
+        }
+
+// ---------------------------------------------------------------------------
+// ActivateNodeL
+// ---------------------------------------------------------------------------
+//
+void CAlfNodeVisual::ActivateNode()
+     { 
+     if ( !iNodeActivated)
+         {
+         iNodeActivated = ETrue;
+        
+         if ( iWindow )
+            {
+        	if ( iVisible )
+        		{
+        		iWindow->SetActive( ETrue );
+        		}
+        	}
+         }
+     else
+         {
+         __ALFLOGSTRING("CAlfNodeVisual::ActivateNodeL - Node ALREADY active! ");
+         }
+     }
+
+
+// ---------------------------------------------------------------------------
+// CreateWindowL
+// ---------------------------------------------------------------------------
+void CAlfNodeVisual::CreateWindowL(TInt aWindowGroupHandle, TInt aWindowHandle, TInt aParentWindowHandle)
+    {
+    TWindowIdentifier windowIdentifier( iGroupId, iId );
+    TWindowIdentifier clientSideIdentifier( aWindowGroupHandle, aWindowHandle );
+    TWindowIdentifier parentIdentifier( 0, aParentWindowHandle ); // Group id not used, set to zero.
+    
+    TAlfWServInfo info;     
+    info.iSize = iSize;
+    info.iPosition = iOrigin;    
+    info.iRefId = windowIdentifier; // Node ids   
+    info.iClientSideId = clientSideIdentifier; // Client handles
+    info.iNodeType = iType;
+    info.iScreenNumber = iScreenNumber;    
+    info.iParentRefId = parentIdentifier;
+#ifdef ALF_DEBUG_TRACK_DRAWING    
+    info.iTrackWindow = iTrackNode;
+#endif
+    iWindow = iModel->Server().WindowMgr()->CreateNewWindowL( iId, info );
+    iWindow->CommitGc();
+    }
+
+// ---------------------------------------------------------------------------
+// destructor
+// ---------------------------------------------------------------------------
+//
+CAlfNodeVisual::~CAlfNodeVisual()
+    {
+    if ( iWindow && iModel )
+        {
+        iModel->Server().WindowMgr()->DestroyWindow( *iWindow );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfNodeWindow::CAlfNodeWindow()
+    {
+    iType = MWsWindowTreeNode::EWinTreeNodeClient;
+    };
+
+CAlfNodeWindow::~CAlfNodeWindow()
+    {
+    RemoveDependencies( iParent ? iParent->iChild : NULL );
+    }
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfNodeWindow::ConstructL( CAlfHierarchyModel* aModel, RMemReadStream* aStream  )
+	{
+	CAlfNodeVisual::ConstructL( aModel, aStream );
+	aStream->ReadL( (TUint8*)&iNodeWindowConstructionStruct, sizeof( TNodeWindowConstructionStruct ) );
+    iOrdinalPriority = iNodeWindowConstructionStruct.iOrdinalPriority;
+    ResolveParent( iNodeWindowConstructionStruct.iParentId, iId );
+    CreateWindowL( iNodeWindowConstructionStruct.iWindowGroupHandle, iNodeWindowConstructionStruct.iWindowHandle, iNodeWindowConstructionStruct.iParentId );
+    UpdateOrdinalPosition();
+	}
+
+// ---------------------------------------------------------------------------
+// MoveToWindowGroup
+// !!!! THIS METHOD HAS NOT BEEN TESTED AT ALL!!!!!! EXPECT TROUBLE!!!!
+// ---------------------------------------------------------------------------
+//
+void CAlfNodeWindow::MoveToWindowGroup( TUint32 aNewGroupId )
+	{
+	__ALFLOGSTRING("CAlfNodeWindow::MoveToWindowGroup, THIS METHOD IS UNTESTED. EXPECT TROUBLE!");
+	CAlfNodeGroup* newGroup = (CAlfNodeGroup*)iModel->FindNode( aNewGroupId );
+	if ( newGroup )
+		{
+		// collect my children in my old group
+		RPointerArray<CAlfNode> myChildNodes;
+		GetAllChildrenInGroup( myChildNodes, iId );
+			    
+		// release old relationships
+		CAlfNode* previous = FindPreviousChild();
+		if ( !previous )
+			{
+			iParent->iChild = iSibling; // I was the first and possibly only child
+			}
+		else
+			{
+			previous->iSibling = iSibling; // there was the a previous child. update the link to my next sibling (which might be NULL)
+			}
+		TUint32 oldGroupId = iParent->iId;
+		iParent = newGroup;
+		SetFirstChild();
+		
+		// yippii, new parent, 		
+		// add me as the first child of the new group
+		// TODO: Move the nodes to the new group?
+		TInt i = myChildNodes.Count();
+		while( --i >=0 ) // update groupid and send new location to appui 
+			{
+			iModel->Server().Bridge()->AddData( EAlfDSMoveWindowToNewGroup, 
+					myChildNodes[i]->iId, 
+					oldGroupId, 
+					(TAny*)aNewGroupId );
+			myChildNodes[i]->iGroupId = aNewGroupId;
+			}
+	  
+		myChildNodes.Close();
+		}
+	else
+		{
+		__ALFLOGSTRING("CAlfNodeWindow::MoveToWindowGroupL, new group does not exists");
+		USER_INVARIANT();
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfNodeWindow* CAlfNodeWindow::NewL( CAlfHierarchyModel* aModel, RMemReadStream* aStream, TInt aScreenNumber  )
+    {
+    CAlfNodeWindow* self = new(ELeave)CAlfNodeWindow();
+    CleanupStack::PushL( self );
+    self->iScreenNumber = aScreenNumber;
+    self->ConstructL( aModel, aStream ); 
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Construct
+// ---------------------------------------------------------------------------
+//
+CAlfNodeRoot::CAlfNodeRoot( )
+    {
+    iType = MWsWindowTreeNode::EWinTreeNodeRoot;
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfNodeRoot::ConstructL( CAlfHierarchyModel* aModel, RMemReadStream* aStream  )
+	{
+	CAlfNodeVisual::ConstructL( aModel, aStream );
+	
+	// TODO: 
+	ResolveParent( 0, iId );
+	CreateWindowL(0,0,0); // Currently renderstage does not deliver ws/wg handles
+	}
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfNodeRoot* CAlfNodeRoot::NewL( CAlfHierarchyModel* aModel, RMemReadStream* aStream, TInt aScreenNumber  )
+    {
+    CAlfNodeRoot* self = new(ELeave)CAlfNodeRoot();
+    CleanupStack::PushL( self );
+    self->iScreenNumber = aScreenNumber;
+    self->ConstructL( aModel, aStream ); 
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// destructor
+// ---------------------------------------------------------------------------
+//
+CAlfNodeRoot::~CAlfNodeRoot( )
+    {
+    // TODO: destroy all children nodes?
+    RemoveDependencies( NULL );
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfNodeGroup::CAlfNodeGroup()
+    {
+    iType = MWsWindowTreeNode::EWinTreeNodeGroup;
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfNodeGroup::ConstructL( CAlfHierarchyModel* aModel, RMemReadStream* aStream  )
+	{
+	CAlfNode::ConstructL( aModel, aStream );
+    TInt32 clientHandle = aStream->ReadUint32L();
+    iSecureId = aStream->ReadUint32L();
+    TInt32 parentId = aStream->ReadUint32L();
+    
+    ResolveParent( parentId, iId );
+    
+    TInt offset;
+    TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*)CreateWindowAttributes(offset, sizeof(TAlfWindowAttributes));
+    windowAttributes->iWindowNodeType = iType; 
+    windowAttributes->iClientHandle = clientHandle;
+    windowAttributes->iScreenNumber = iScreenNumber;
+    windowAttributes->iSecureId = iSecureId;
+    windowAttributes->iParentNodeId = parentId;
+	
+    iModel->Server().Bridge()->AddData( EAlfDSNewWindow, 
+            iGroupId, 
+            iId, 
+            (TAny*)offset );
+	}
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfNodeGroup* CAlfNodeGroup::NewL( CAlfHierarchyModel* aModel, RMemReadStream* aStream , TInt aScreenNumber )
+    {
+    CAlfNodeGroup* self = new(ELeave)CAlfNodeGroup();
+    CleanupStack::PushL( self );
+    self->iScreenNumber = aScreenNumber;
+    self->ConstructL( aModel, aStream ); 
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// WindowGroupChainedL
+// ---------------------------------------------------------------------------
+//
+void CAlfNodeGroup::WindowGroupChained( TUint32 aChainedGroup )
+	{
+	iChainedTo = (CAlfNodeGroup*)iModel->FindNode( aChainedGroup );
+	if ( iChainedTo )
+		{
+		iChainedTo->iChainedFrom = this;
+		}
+	else
+		{
+		USER_INVARIANT();
+		}
+	
+    if (iModel)
+        {
+        iModel->Server().Bridge()->AddData( EAlfDSGroupChained, 
+                iId, 
+                aChainedGroup, 
+                (TAny*)iScreenNumber
+                );                
+        }
+	}
+
+// ---------------------------------------------------------------------------
+// GroupChainBrokenAfter
+// ---------------------------------------------------------------------------
+//
+void CAlfNodeGroup::GroupChainBrokenAfter(  )
+	{
+	if ( iChainedTo )
+		{
+		iChainedTo->iChainedFrom = NULL;
+		iChainedTo = NULL;
+		}
+	if (iModel)
+		{
+		iModel->Server().Bridge()->AddData( EAlfDSGroupChainBroken, 
+				iId, 
+				0, 
+				(TAny*)iScreenNumber );                
+		}
+
+	}
+
+
+// ---------------------------------------------------------------------------
+// destructor
+// ---------------------------------------------------------------------------
+//
+CAlfNodeGroup::~CAlfNodeGroup()
+    {
+    if ( iChainedTo )
+    	{
+    	GroupChainBrokenAfter();
+    	}
+    if ( iChainedFrom )
+    	{
+    	iChainedFrom->iChainedTo = NULL;
+    	}
+    
+    if (iModel)
+        {
+        TInt offset;
+        TAlfWindowAttributes* windowAttributes = (TAlfWindowAttributes*)CreateWindowAttributes(offset, sizeof(TAlfWindowAttributes));
+        windowAttributes->iWindowNodeType = iType; 
+        windowAttributes->iScreenNumber = iScreenNumber; 
+
+        iModel->Server().Bridge()->AddData( EAlfDSDestroyWindow, 
+                iGroupId, 
+                iId, 
+                (TAny*)offset );                
+        }
+    RemoveDependencies( iParent->iChild );
+    };
+
+// ---------------------------------------------------------------------------
+// constructor
+// ---------------------------------------------------------------------------
+//
+CAlfNodeAnim::CAlfNodeAnim( )
+    {
+    iType = MWsWindowTreeNode::EWinTreeNodeAnim;
+     }
+
+CAlfNodeAnim::~CAlfNodeAnim( )
+    {
+    if ( iParent )
+        {
+        RemoveDependencies( iParent->iAnimChild );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfNodeAnim::ConstructL( CAlfHierarchyModel* aModel, RMemReadStream* aStream  )
+	{
+	CAlfNodeVisual::ConstructL( aModel, aStream );
+	TInt32 parentId = aStream->ReadUint32L();
+
+	// TODO: 
+	ResolveParent( parentId, iId );
+	CreateWindowL(0,0,iParent->iId); // Currently renderstage does not deliver ws/wg handles
+	UpdateOrdinalPosition();
+	}
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfNodeAnim* CAlfNodeAnim::NewL( CAlfHierarchyModel* aModel, RMemReadStream* aStream, TInt aScreenNumber  )
+    {
+    CAlfNodeAnim* self = new(ELeave)CAlfNodeAnim();
+    CleanupStack::PushL( self );
+    self->iScreenNumber = aScreenNumber;
+    self->ConstructL( aModel, aStream ); 
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// constructor
+// ---------------------------------------------------------------------------
+//
+CAlfNodeSprite::CAlfNodeSprite( )
+    {
+    iType = MWsWindowTreeNode::EWinTreeNodeSprite;
+    }
+
+CAlfNodeSprite::~CAlfNodeSprite( )
+    {
+    if ( iParent )
+        {
+        RemoveDependencies( iParent->iSpriteChild );
+        }
+    }
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfNodeSprite::ConstructL( CAlfHierarchyModel* aModel, RMemReadStream* aStream  )
+	{
+	CAlfNodeVisual::ConstructL( aModel, aStream );
+	TInt32 parentId = aStream->ReadUint32L();
+
+	// TODO: 
+	ResolveParent( parentId, iId );
+	CreateWindowL(0,0,iParent->iId); // Currently renderstage does not deliver ws/wg handles
+	// Sprite may not be first in its group
+	UpdateOrdinalPosition();
+	}
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfNodeSprite* CAlfNodeSprite::NewL( CAlfHierarchyModel* aModel, RMemReadStream* aStream, TInt aScreenNumber  )
+    {
+    CAlfNodeSprite* self = new(ELeave)CAlfNodeSprite();
+    CleanupStack::PushL( self );
+    self->iScreenNumber = aScreenNumber;
+    self->ConstructL( aModel, aStream ); 
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// constructor
+// ---------------------------------------------------------------------------
+//
+CAlfNodeTextCursor::CAlfNodeTextCursor( )
+    {
+    iType = MWsWindowTreeNode::EWinTreeNodeStandardTextCursor;
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfNodeTextCursor::ConstructL( CAlfHierarchyModel* aModel, RMemReadStream* aStream  )
+    {
+    CAlfNode::ConstructL( aModel, aStream );
+    iCursorType = aStream->ReadInt32L();
+    aStream->ReadL( (TUint8*)&iRect, sizeof(TRect));
+    aStream->ReadL( (TUint8*)&iClipRect, sizeof(TRect));
+    iSize = iRect.Size();
+    iOrigin = iRect.iTl;
+    
+    iFlags = aStream->ReadInt32L();
+    iColor = aStream->ReadInt32L();
+    iFlashInterval = aStream->ReadInt32L(); 
+    TInt32 parentId = aStream->ReadUint32L();
+    
+    // TODO: 
+    ResolveParent( parentId, iId );
+    
+    CreateWindowL(0,0,iParent->iId); // Currently renderstage does not deliver ws/wg handles
+    TInt offset;
+    // pass rest of the cursor data
+    TAlfCursorDataBufferAttributes* attributes = (TAlfCursorDataBufferAttributes*)CreateWindowAttributes(offset, sizeof(TAlfCursorDataBufferAttributes));
+    attributes->iColor = iColor;
+    attributes->iFlags = iFlags;
+    attributes->iFlashInterval = iFlashInterval;
+    attributes->iScreenNumber = iScreenNumber;
+    
+    aModel->Server().Bridge()->AddData( EAlfDSSetCursorData, 
+            iGroupId, 
+            iId, 
+            (TAny*)offset );
+    
+    UpdateOrdinalPosition();
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfNodeTextCursor* CAlfNodeTextCursor::NewL( CAlfHierarchyModel* aModel, RMemReadStream* aStream, TInt aScreenNumber  )
+    {
+    CAlfNodeTextCursor* self = new(ELeave)CAlfNodeTextCursor();
+    CleanupStack::PushL( self );
+    self->iScreenNumber = aScreenNumber;
+    self->ConstructL( aModel, aStream ); 
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+void CAlfNodeTextCursor::AttributeChangedL( RMemReadStream* aStream )
+    {
+    // TODO: PASS FORWARD!!!
+    TInt attribute = aStream->ReadInt32L();
+    switch ( attribute )
+        {
+        case MWsWindowTreeObserver::ECursorType:
+            {
+            iCursorType = aStream->ReadInt32L();
+            break;
+            }
+        case MWsWindowTreeObserver::ECursorClipRect:
+            {
+            aStream->ReadL( (TUint8*)&iClipRect, sizeof(TRect));
+            break;
+            }
+
+        case MWsWindowTreeObserver::ECursorFlags:
+            {
+            iFlags = aStream->ReadInt32L();
+            break;
+            }
+
+        case MWsWindowTreeObserver::ECursorColor:
+            {
+            iColor = aStream->ReadInt32L();
+            break;
+            }
+        }
+    TInt offset;
+    TAlfCursorDataBufferAttributes* attributes = (TAlfCursorDataBufferAttributes*)CreateWindowAttributes(offset, sizeof(TAlfCursorDataBufferAttributes));
+       attributes->iColor = iColor;
+       attributes->iFlags = iFlags;
+       attributes->iFlashInterval = iFlashInterval;
+       attributes->iScreenNumber = iScreenNumber;
+       __ALFLOGSTRING("Forwarding cursor data");
+       iModel->Server().Bridge()->AddData( EAlfDSSetCursorData, 
+               iGroupId, 
+               iId, 
+               (TAny*)offset );
+    }
+CAlfNodeTextCursor::~CAlfNodeTextCursor( )
+    {
+    // text cursor is the only text cursor in its parent. No need to check siblings.
+    if(iParent)
+        {
+        iParent->iTextCursor = NULL;
+        }
+    // RemoveNode is called instead of RemoveDependeciesL, because this node has no depencies.
+    if(iModel)
+        {
+        iModel->RemoveNode( iId );
+        }
+    }
+
+// end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfscreen.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,224 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 class
+*
+*/
+
+
+
+#include "alfscreen.h"
+
+#include <aknenv.h>
+#include <AknsConstants.h>
+#include <s32mem.h>
+
+#include <uiacceltk/HuiEnv.h>
+#include <uiacceltk/HuiSkin.h>
+#include <uiacceltk/HuiDisplay.h>
+#include <uiacceltk/HuiControl.h>
+#include <uiacceltk/HuiControlGroup.h>
+#include <uiacceltk/HuiEvent.h>
+#include <uiacceltk/HuiDeckLayout.h>
+#include <uiacceltk/HuiImageVisual.h>
+#include <uiacceltk/HuiTransformation.h>
+#include <uiacceltk/HuiBorderBrush.h>
+#include <uiacceltk/HuiUtil.h>
+#include <uiacceltk/HuiTextVisual.h>
+#include <uiacceltk/HuiGradientBrush.h>
+#include <uiacceltk/HuiImageBrush.h>
+#include <uiacceltk/HuiCanvasVisual.h>
+
+#ifdef SYMBIAN_BUILD_GCE
+#include <bautils.h>
+#endif
+
+//_LIT8(KAlfSessionContainerControlTag, "Session container");
+_LIT8(KAlfWindowFloatingSpriteContainerControlTag, "FSPRITE");
+_LIT8(KAlfFullScreenEffectContainerControlTag, "EFFECT");
+//_LIT8(KAlfWindowGroupTemporaryRemoveControlTag, "WGTEMP");
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+CAlfScreen::CAlfScreen() 
+	{
+	};
+	
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfScreen::ConstructL(TInt aScreenNum, MHuiDisplayRefreshObserver& aObserver, CHuiEnv& aHuiEnv, CAlfSharedDisplayCoeControl* aSharedCoeControl)
+	{
+	iScreenNum = aScreenNum;
+	
+	CAlfSharedDisplayCoeControl* coeControl = aSharedCoeControl;
+	if (!coeControl)
+		{
+		// Create own coe control
+		
+		// \todo: This works only if the screen is created to screen 0. Do *not* work
+		//        for external screens.
+		iCoeControl = new (ELeave) CAlfSharedDisplayCoeControl();
+		iCoeControl->ConstructL();
+		iCoeControl->DrawableWindow()->EnableVisibilityChangeEvents();
+		iCoeControl->DrawableWindow()->SetPosition(TPoint(0, 0)); 
+		
+		// This is not the main ALF native control, put it back
+		iCoeControl->DrawableWindow()->SetOrdinalPosition(-2000);
+		
+		coeControl = iCoeControl;
+		}
+	
+	// Resolve screen buffer uid
+	// \todo currently only screen 0 and 1 are supported 
+	TUid screenBufferUid;
+	switch(iScreenNum)
+		{
+		case 0: 
+			screenBufferUid = KHuiUidBackBufferScreen0;	
+			break;
+		case 1: 
+		default: 
+			screenBufferUid = KHuiUidBackBufferScreen1;	
+			break;		
+		}
+	
+	// create display
+	iDisplay = &aHuiEnv.NewDisplayL(coeControl->Rect(), coeControl, 0, NULL,CHuiDisplay::EDisplayNormal, screenBufferUid);
+	CommonConstructL(aObserver, aHuiEnv);
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfScreen::ConstructL(TInt aScreenNum, MHuiDisplayRefreshObserver& aObserver, CHuiEnv& aHuiEnv, RWindow* aWindow)
+	{
+	iScreenNum = aScreenNum;
+		
+	TUid screenBufferUid;
+	switch(iScreenNum)
+		{
+		case 0: 
+			screenBufferUid = KHuiUidBackBufferScreen0;	
+			break;
+		case 1: 
+		default: 
+			screenBufferUid = KHuiUidBackBufferScreen1;	
+			break;		
+		}
+	
+	// create display
+	iDisplay = &aHuiEnv.NewDisplayL(aWindow, 0, NULL,CHuiDisplay::EDisplayNormal, screenBufferUid);
+	CommonConstructL(aObserver, aHuiEnv);
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfScreen::CommonConstructL( MHuiDisplayRefreshObserver& aObserver, CHuiEnv& aHuiEnv)
+    {	
+	
+	iDisplay->iRefreshObservers.AppendL(aObserver);	
+	
+	// Create special control group for floating sprites
+	iFloatingSpriteControlGroup = &aHuiEnv.NewControlGroupL(0xDEADBEEF + iScreenNum); // TODO
+	CHuiControl* cntrl = new (ELeave) CHuiControl(aHuiEnv);
+	CleanupStack::PushL(cntrl); 
+	cntrl->ConstructL();
+	cntrl->SetRole(EAlfWindowFloatingSpriteContainer);
+	iFloatingSpriteControlGroup->AppendL(cntrl);
+	CleanupStack::Pop(cntrl);
+	CHuiCanvasVisual* layout = CHuiCanvasVisual::AddNewL(*cntrl);            
+	layout->SetTagL(KAlfWindowFloatingSpriteContainerControlTag);	
+
+	// Create special control group for full screen effects
+	iFullscreenEffectControlGroup = &aHuiEnv.NewControlGroupL(0xDEADBEEF + 10 + iScreenNum ); // TODO
+	CHuiControl* effectCntrl = new (ELeave) CHuiControl(aHuiEnv);		    
+	CleanupStack::PushL(effectCntrl); 
+	effectCntrl->ConstructL();
+	effectCntrl->SetRole(EAlfFullScreenEffectContainer);
+	iFullscreenEffectControlGroup->AppendL(effectCntrl);
+	CleanupStack::Pop(effectCntrl);
+	CHuiCanvasVisual* effectLayout = CHuiCanvasVisual::AddNewL(*effectCntrl);            
+	effectLayout->SetTagL(KAlfFullScreenEffectContainerControlTag);
+
+#ifdef SYMBIAN_BUILD_GCE
+#ifndef __WINSCW__
+    _LIT(KRDSupport, "c:\\resource\\errrd" );
+    if (CHuiStatic::FsSession().Handle() && BaflUtils::FileExists( CHuiStatic::FsSession(), KRDSupport ))
+        {
+        // FPS Counter with hitchcock drawing
+        iFPSText = CHuiTextVisual::AddNewL(*effectCntrl, effectLayout);
+        iFPSText->SetColor(KRgbBlue);
+        iFPSText->SetFlag(EHuiVisualFlagManualLayout);
+        iFPSText->SetPos(THuiRealPoint(300,20)); // could be adjusted
+        iFPSText->SetSize(THuiRealSize(50,50));
+        }
+#endif
+#endif
+	}
+	
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+TSize CAlfScreen::Size() const
+    {
+    return iDisplay->VisibleArea().Size();    
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+CAlfScreen::~CAlfScreen() 
+	{
+	// this deletes also control and layout
+	delete iFullscreenEffectControlGroup; 
+	
+	// this deletes also control and layout
+	delete iFloatingSpriteControlGroup;
+	
+	delete iDisplay;
+	iControlGroups.Close();
+	
+	delete iCoeControl;
+	
+	delete iSwRenderingTarget;
+	};
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+void CAlfScreen::SetVisualTreeVisibilityChanged(TBool aChanged)
+    {
+    if (aChanged && iDisplay)
+        {
+        iDisplay->SetDirty();
+        }
+    iVisualTreeVisibilityChanged = aChanged;    
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfScreen::IsVisualTreeVisibilityChanged()
+    {
+    return iVisualTreeVisibilityChanged;    
+    }
+     
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfserverutils.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,236 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Application Sever
+*
+*/
+
+
+#include "alf/alftimedvalue.h"
+#include <uiacceltk/HuiTimedValue.h>
+#include <uiacceltk/HuiTimedPoint.h>
+#include <f32file.h>
+#include <alf/ftokenclient.h>
+#include <uiacceltk/huimetric.h>
+#include <alf/alfmetric.h>
+
+#include "alf/alfserverutils.h"
+#include "alf/alfextensionfactory.h"
+#include "alflogger.h"
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void AlfTimedValueUtility::CopyTimedValue(TAlfTimedValue& aSrc, 
+    THuiTimedValue& aDst, MAlfInterfaceProvider& aResolver )
+    {    
+    if ( aSrc.Flags()&EAlfMappingFunctionChanged )
+        {
+        
+        if (aSrc.MappingFunctionIdentifier() != KErrNotFound && 
+            aSrc.MappingFunctionIdentifier() != 0)
+            {
+            TAny* any = NULL;
+            TRAP_IGNORE(any = aResolver.GetInterfaceL( 
+                    EHuiInterfaceMappingFunction, 
+                    aSrc.MappingFunctionIdentifier() ))
+
+            if (any)
+                {
+                MHuiMappingFunction* mappingFunction = 
+                    static_cast<MHuiMappingFunction*> (any);
+                aDst.SetFunction(mappingFunction);                    
+                }
+            }
+        else
+            {
+            aDst.SetFunction(NULL);    
+            }          
+       
+        }
+        
+    AlfTimedValueUtility::CopyTimedValue(aSrc,aDst);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void AlfTimedValueUtility::CopyTimedValue(TAlfTimedValue& aSrc, 
+    THuiTimedValue& aDst)
+    {
+
+#ifdef _ALF_LOGGING
+    if (aSrc.Flags()==EAlfValueFlagsNone)
+        {
+        __ALFLOGSTRING("AlfTimedValue: No changes (EAlfValueFlagsNone), assignment does not have effect")
+        }
+#endif
+
+    if (aSrc.Flags()&EAlfValueNowChanged)    
+        {
+        aDst.Set(aSrc.ValueNow());        
+        }
+    
+    if (aSrc.Flags()&EAlfValueTargetChanged)
+        {
+        if (aSrc.Flags()&EAlfSpeedChanged && aSrc.Speed() != 0)
+            {
+            aDst.SetWithSpeed(aSrc.Target(), aSrc.Speed());    
+            }
+        else
+            {
+            aDst.Set(aSrc.Target(), aSrc.TimeToTargetinMilliSeconds());                        
+            }
+        }
+         
+    // Currently we assume that interpolationstyle needs no change
+    // if default requested, we further assume that is this safe assumption. 
+    if (aSrc.Flags()&EAlfInterpolationStyleChanged && aSrc.Style())
+        {
+        aDst.SetStyle(static_cast<THuiInterpolationStyle>(aSrc.Style()-EAlfTimedValueStyleNone));
+        }
+    
+    aSrc.Flags() = EAlfValueFlagsNone;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void AlfTimedValueUtility::CopyTimedValue(THuiTimedValue& aSrc, 
+    TAlfTimedValue& aDst)
+    {
+    TAlfTimedValue newValue;    
+    newValue.SetValueNow(aSrc.Now());
+    newValue.SetTarget(aSrc.Target(), aSrc.RemainingTime());
+    newValue.SetStyle(TAlfInterpolationStyle(aSrc.Style() + EAlfTimedValueStyleNone));
+    aDst = newValue;            
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void AlfTimedPointUtility::CopyTimedPoint(TAlfTimedPoint& aSrc, 
+    THuiTimedPoint& aDst, MAlfInterfaceProvider& aResolver)
+    {
+    AlfTimedValueUtility::CopyTimedValue(aSrc.iX, aDst.iX, aResolver);
+    AlfTimedValueUtility::CopyTimedValue(aSrc.iY, aDst.iY, aResolver);        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void AlfTimedPointUtility::CopyTimedPoint(TAlfTimedPoint& aSrc, 
+    THuiTimedPoint& aDst)
+    {
+    AlfTimedValueUtility::CopyTimedValue(aSrc.iX, aDst.iX);
+    AlfTimedValueUtility::CopyTimedValue(aSrc.iY, aDst.iY);                
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void AlfTimedPointUtility::CopyTimedPoint(THuiTimedPoint& aSrc, 
+    TAlfTimedPoint& aDst)
+    {
+    AlfTimedValueUtility::CopyTimedValue(aSrc.iX, aDst.iX);
+    AlfTimedValueUtility::CopyTimedValue(aSrc.iY, aDst.iY);        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void AlfFileTokenUtility::OpenFileForTokenL(RFile& aFile, const TDesC8& aToken)
+    {
+    RFTokenClient client;
+    User::LeaveIfError(client.Connect());
+    
+    CleanupClosePushL(client);
+    User::LeaveIfError(client.OpenFileForToken(aFile, aToken));    
+    CleanupStack::PopAndDestroy();
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void AlfBoxMetricUtility::CopyMetric(TAlfBoxMetric& aSrc, THuiBoxMetric& aDst)
+    {
+    AlfMetricUtility::CopyMetric(aSrc.iTop, aDst.iTop);        
+    AlfMetricUtility::CopyMetric(aSrc.iBottom, aDst.iBottom);        
+    AlfMetricUtility::CopyMetric(aSrc.iLeft, aDst.iLeft);        
+    AlfMetricUtility::CopyMetric(aSrc.iRight, aDst.iRight);                
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void AlfBoxMetricUtility::CopyMetric(THuiBoxMetric& aSrc, TAlfBoxMetric& aDst)
+    {
+    AlfMetricUtility::CopyMetric(aSrc.iTop, aDst.iTop);        
+    AlfMetricUtility::CopyMetric(aSrc.iBottom, aDst.iBottom);        
+    AlfMetricUtility::CopyMetric(aSrc.iLeft, aDst.iLeft);        
+    AlfMetricUtility::CopyMetric(aSrc.iRight, aDst.iRight);                        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void AlfXYMetricUtility::CopyMetric(TAlfXYMetric& aSrc, THuiXYMetric& aDst)
+    {
+    AlfMetricUtility::CopyMetric(aSrc.iX, aDst.iX);        
+    AlfMetricUtility::CopyMetric(aSrc.iY, aDst.iY);                
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void AlfXYMetricUtility::CopyMetric(THuiXYMetric& aSrc, TAlfXYMetric& aDst)
+    {
+    AlfMetricUtility::CopyMetric(aSrc.iX, aDst.iX);        
+    AlfMetricUtility::CopyMetric(aSrc.iY, aDst.iY);                        
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void AlfMetricUtility::CopyMetric(TAlfMetric& aSrc, THuiMetric& aDst)
+    {
+    aDst.iMagnitude = aSrc.iMagnitude;    
+    aDst.iUnit = aSrc.iUnit;        
+    aDst.iReferenceTextStyleId = aSrc.iReferenceTextStyleId;        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void AlfMetricUtility::CopyMetric(THuiMetric& aSrc, TAlfMetric& aDst)
+    {
+    aDst.iMagnitude = aSrc.iMagnitude;    
+    aDst.iUnit = aSrc.iUnit;        
+    aDst.iReferenceTextStyleId = aSrc.iReferenceTextStyleId;                
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfshareddisplaycoecontrol.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   AppUi class
+*
+*/
+
+
+
+#include "alfshareddisplaycoecontrol.h"
+#include <uiacceltk/HuiDisplay.h>
+#include <uiacceltk/HuiEvent.h>
+
+// ---------------------------------------------------------------------------
+// constructor
+// ---------------------------------------------------------------------------
+// 
+CAlfSharedDisplayCoeControl::CAlfSharedDisplayCoeControl(){}
+
+// ---------------------------------------------------------------------------
+// destructor
+// ---------------------------------------------------------------------------
+// 
+CAlfSharedDisplayCoeControl::~CAlfSharedDisplayCoeControl()  { iDisplays.Close(); }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+// 
+void CAlfSharedDisplayCoeControl::ConstructL()
+    {
+    CreateWindowL();
+    SetExtentToWholeScreen();
+
+    // Since display creation went ok, we know that this rectangle size can be handled.
+    iPrevRect = Rect();
+
+    EnableDragEvents();
+    Window().EnableAdvancedPointers();
+    ActivateL();
+
+    // Set pointer grab, so we will get pointer up events also from other´
+    // window groups
+    DrawableWindow()->SetPointerGrab(ETrue);
+    }
+
+// ---------------------------------------------------------------------------
+// Draw
+// ---------------------------------------------------------------------------
+// 
+void CAlfSharedDisplayCoeControl::Draw(const TRect& /*aRect*/) const
+{
+for ( TInt i = 0 ; i <  iDisplays.Count() ; i++ )
+    {
+    iDisplays[i]->SetDirty();
+    }
+}
+
+// ---------------------------------------------------------------------------
+// SizeChanged
+// ---------------------------------------------------------------------------
+// 
+void CAlfSharedDisplayCoeControl::SizeChanged()
+    {
+    TSize size = Rect().Size();
+
+    for ( TInt i = 0 ; i <  iDisplays.Count() ; i++ )
+        {
+        // Change the size of the display.
+        TRAPD(err, iDisplays[i]->SetSizeL(size));
+        if(err != KErrNone)
+            {
+            // Switching to new size failed. Maintain old size.
+            size = iPrevRect.Size();
+            }
+        else
+            {
+            iPrevRect = Rect();
+            }
+
+        // Redefine the portion of the drawing surface that is used by 
+        // the display.
+        iDisplays[i]->SetVisibleArea(TRect(TPoint(0, 0), size));
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// HandlePointerEventL
+// ---------------------------------------------------------------------------
+// 
+void CAlfSharedDisplayCoeControl::HandlePointerEventL(const TPointerEvent& aPointerEvent)
+    {
+    // passing the event to hui
+    THuiEvent event(iDisplays[0], aPointerEvent);
+    // Send events received here only to the primary display    
+    if (iDisplays[0])
+        {
+        iDisplays[0]->Roster().HandleEventL(event);        
+        }    
+    }
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfsrvcontrolgroupsubsession.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,291 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Control group sub session
+*
+*/
+
+
+
+#include "alfsrvcontrolgroupsubsession.h"
+#include "alf/alfconstants.h"
+#include "alf/alfappsrvsessionbase.h"
+#include "alfappsrvsession.h"
+#include "alfscreen.h" // EAlfSessionContainer
+#include "alfsrvtransformationsubsession.h"
+#include <uiacceltk/HuiEnv.h>
+#include <uiacceltk/HuiControl.h>
+#include <uiacceltk/HuiControlGroup.h>
+#include <uiacceltk/HuiDisplay.h>
+#include <uiacceltk/HuiDeckLayout.h>
+
+// host control
+
+NONSHARABLE_CLASS( CAlfSrvHostControl ) : public CHuiControl
+    {
+public:
+    CAlfSrvHostControl(CHuiEnv& aEnv) : CHuiControl(aEnv) {}
+    CHuiLayout* ContainerLayout(const CHuiControl* aConnected) const;
+    };
+    
+   
+CHuiLayout* CAlfSrvHostControl::ContainerLayout(const CHuiControl* /*aConnected*/) const
+    {
+    if ( VisualCount() )
+        {
+        return static_cast<CHuiLayout*>(&Visual(0)); 
+        }
+    return NULL;
+    }
+    
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvControlGroupSubSession::CAlfSrvControlGroupSubSession( 
+    CAlfAppSrvSessionBase& aSession,
+    TInt aId )
+    : CAlfSrvSubSessionBase( aSession ), iId( aId ) 
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phasse constructor
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvControlGroupSubSession::ConstructL()
+    {
+    CAlfSrvSubSessionBase::ConstructL();
+    
+    iControlGroup = &Session().SharedHuiEnv()->NewControlGroupL( 
+        reinterpret_cast<TInt>(this) );
+        
+    iHostControl = new (ELeave) CAlfSrvHostControl( *Session().SharedHuiEnv() );
+    iHostControl->ConstructL();
+    iHostControl->SetRole(EAlfSessionContainer);
+        
+    CHuiLayout* sessionContainer = CHuiDeckLayout::AddNewL( *iHostControl, NULL );
+    sessionContainer->SetFlags( EHuiVisualFlagManualLayout );
+    sessionContainer->SetTagL( _L8("Session container") );
+    sessionContainer->SetSize( Session().ClientDrawingArea().Size() );
+    sessionContainer->SetPos( Session().ClientDrawingArea().iTl );
+        
+    iControlGroup->AppendL( iHostControl );
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfSrvControlGroupSubSession* CAlfSrvControlGroupSubSession::NewL( 
+    CAlfAppSrvSessionBase& aSession,
+    TInt aId )
+    {
+    CAlfSrvControlGroupSubSession* self = 
+        CAlfSrvControlGroupSubSession::NewLC( aSession, aId );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+CAlfSrvControlGroupSubSession* CAlfSrvControlGroupSubSession::NewLC( 
+    CAlfAppSrvSessionBase& aSession,
+    TInt aId )
+    {
+    CAlfSrvControlGroupSubSession* self = 
+        new( ELeave ) CAlfSrvControlGroupSubSession( aSession, aId );
+    CleanupClosePushL( *self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvControlGroupSubSession::~CAlfSrvControlGroupSubSession()
+    {
+    // Hide the control group from the display
+    CHuiDisplay* display = Session().SharedHuiEnv()->DisplayCount() ? 
+                                &Session().SharedHuiEnv()->PrimaryDisplay() : 
+                                NULL ;
+    if ( display )
+        {
+        display->Roster().Hide( ControlGroup() );
+        }
+
+    Session().SharedHuiEnv()->DeleteControlGroup( reinterpret_cast<TInt>(this) );
+    
+    iControlGroup = NULL;
+    iHostControl = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Gets control group
+// ---------------------------------------------------------------------------
+//
+CHuiControlGroup& CAlfSrvControlGroupSubSession::ControlGroup()
+    {
+    return *iControlGroup;
+    }
+
+// ---------------------------------------------------------------------------
+// Is control group shown
+// ---------------------------------------------------------------------------
+//
+TBool CAlfSrvControlGroupSubSession::IsShown() const
+    {
+    return iIsShown;
+    }
+
+// ---------------------------------------------------------------------------
+// Set if the control group is shown
+// ---------------------------------------------------------------------------
+//    
+void CAlfSrvControlGroupSubSession::SetIsShown( TBool aShown )
+    {
+    iIsShown = aShown;
+    }
+    
+// ---------------------------------------------------------------------------
+// Append control
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvControlGroupSubSession::AppendL( 
+    const RMessage2& aMessage )
+    {    
+    // Parse parameters
+
+    CHuiControl* control = static_cast<CHuiControl*>
+        ( Session().GetInterfaceL(EHuiObjectTypeControl, aMessage.Int1()) );
+    
+    // Set host        
+    control->SetHostId( iHostControl->Id() );
+        
+    // Append control
+    ControlGroup().AppendL(control);
+
+    // Complete
+    aMessage.Complete( KErrNone );
+    }
+ 
+ // ---------------------------------------------------------------------------
+// Remove control
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvControlGroupSubSession::RemoveL( 
+    const RMessage2& aMessage )
+    {    
+    // Parse parameters
+
+    CHuiControl* control = static_cast<CHuiControl*>
+        ( Session().GetInterfaceL(EHuiObjectTypeControl, aMessage.Int1()));
+            
+    // Append control
+    TInt err = ControlGroup().Remove(control);
+
+    // Complete
+    aMessage.Complete( err );
+    }
+ 
+// ---------------------------------------------------------------------------
+// Enables transformation
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvControlGroupSubSession::EnableTransformationL( 
+    const RMessage2& aMessage )
+    {
+    // Parser parameters
+    
+    // 1: is transformed (in)
+    const TBool isTransformed = aMessage.Int1();
+    
+    // 2: transformation handle (in)
+    const TInt transHandle = aMessage.Int2();
+    CAlfSrvSubSessionBase& subSession = Session().SubSession( transHandle );
+    CAlfSrvTransformationSubSession& transformationSubSession = 
+        static_cast<CAlfSrvTransformationSubSession&>(subSession);
+    
+    // Enable transformation
+    ControlGroup().EnableTransformationL( isTransformed );
+    CHuiTransformation* transformation = NULL;
+    if ( isTransformed )
+        {
+        transformation = &ControlGroup().Transformation();
+        }
+    transformationSubSession.SetTransformation( transformation );
+    
+    // Complete
+    aMessage.Complete( KErrNone );
+    }
+   
+// ---------------------------------------------------------------------------
+// From CAlfSrvSubSessionBase
+// Process the message.
+// ---------------------------------------------------------------------------
+// 
+void CAlfSrvControlGroupSubSession::DoProcessMessageL(const RMessage2& aMessage)
+    {
+    switch( aMessage.Int0() )
+        {
+        case EAlfControlGroupAppend:
+            {
+            AppendL( aMessage );
+            break;
+            }
+        
+        case EAlfControlGroupRemove:
+            {
+            RemoveL( aMessage );
+            break;
+            }
+            
+        case EAlfControlGroupEnableTransformation:
+            {
+            EnableTransformationL( aMessage );
+            break;
+            }
+        case EAlfControlGroupSubSessionClose: // obsolete
+            {
+            Session().CloseSubSession( aMessage );
+            break;
+            }
+        default:
+            CAlfSrvSubSessionBase::DoProcessMessageL( aMessage );
+            break;
+        }
+    }
+
+
+CHuiControlGroup* CAlfSrvControlGroupSubSession::AsHuiControlCroup()
+    {
+    return iControlGroup;
+    }
+
+TInt& CAlfSrvControlGroupSubSession::PreferredPos()
+    {
+    return iPrefrerredPos;
+    }
+    
+ 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfsrvdisplaysubsession.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,811 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Display sub session
+*
+*/
+
+
+
+#include "alfsrvdisplaysubsession.h"
+#include "alf/alfconstants.h"
+#include "alf/alfappsrvsessionbase.h"
+#include "alfappsrvsession.h"
+#include "alfsrvscreenbuffermanager.h"
+#include "alfsrvtranseffect.h"
+#include <alf/alfdisplaybackgrounditem.h>
+#include <uiacceltk/HuiEnv.h>
+#include <uiacceltk/HuiDisplay.h>
+#include <uiacceltk/HuiDisplayCoeControl.h>
+#include <uiacceltk/HuiControlGroup.h>
+#include <uiacceltk/HuiControl.h>
+#include <uiacceltk/huidisplaybackgrounditem.h>
+#include <uiacceltk/HuiEvent.h>
+#include <mtransitionserver.h>
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvDisplaySubSession::CAlfSrvDisplaySubSession( 
+    CAlfAppSrvSessionBase& aSession,
+    const TRect& aRect,
+    TInt aWindowGroupId,
+    TInt aDisplayType,
+    const TUid& aBufferUid) 
+    : CAlfSrvSubSessionBase( aSession ),
+      iDisplayType(aDisplayType), 
+      iScreenBufferUid(aBufferUid),
+      iRect(aRect), 
+      iDisplayClearBackground(CHuiDisplay::EClearWithSkinBackground),
+      iDisplayRenderingQuality(EHuiQualityAccurate),
+      iDisplayUseDepthTest(EFalse),
+      iDisplayUsage(0)
+      
+    {
+    if (!IsTvOut())
+        {
+        // Note: Might not work if there are multiple displays: the client drawing area is set
+        // according to the last display. Also the new area is left there even if  ConstructL() 
+        // fails(!).
+        static_cast<CAlfAppSrvSession&>(Session()).SetClientDrawingArea( aRect );
+        aSession.SetClientWindowGroupId( aWindowGroupId );            
+        }    
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phasse constructor
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvDisplaySubSession::ConstructL()
+    {
+    CAlfSrvSubSessionBase::ConstructL();
+    
+    // With one display, use the existing one or create one if there aren't any.
+    const TRect& rect = CHuiStatic::ScreenDevice()->SizeInPixels();
+    
+    // when running oldstyle, we may have rect different from whole screen
+    if (Session().AlfAppUi()->Container())
+        {
+        const TRect& rect = Session().AlfAppUi()->Container()->Rect();
+        }
+    
+    // Shared normal screen 0
+    if ((iDisplayType == CHuiDisplay::EDisplayLcd0) || 
+       ((iDisplayType == CHuiDisplay::EDisplayNormal) && (iScreenBufferUid == KHuiUidBackBufferScreen0)))
+        {            
+        iDisplay = 
+            Session().SharedHuiEnv()->DisplayCount() ? 
+                &Session().SharedHuiEnv()->PrimaryDisplay() : 
+                &Session().SharedHuiEnv()->NewDisplayL( rect, Session().AlfAppUi()->Container(), 0,
+                	NULL,  CHuiDisplay::EDisplayNormal, iScreenBufferUid );
+                
+        Session().AlfAppUi()->AppendDisplayOnSharedWindowL(*iDisplay);
+        
+        #ifdef TFXSERVER_API_V2
+		// Register to Tfx Server
+        MTransitionServer2* tfxServer = Session().AlfServer()->TfxServer();
+        if (tfxServer)
+        	{
+        	// Note: if this returns KErrNotFound, it is also send to Tfx server
+        	TInt wgId = Session().ClientWindowGroup();
+       		// Just ignore returned error code. Can this cause trouble? 
+       		tfxServer->RegisterApp(MTransitionServer2::ETypeAlf, wgId, KNullUid, KNullUid);
+        	}
+   		#endif
+        }
+        
+    // Off screen buffer    
+    else if (iDisplayType == CHuiDisplay::EDisplayOffScreenBuffer)
+        {            
+        iDisplay = &Session().SharedHuiEnv()->NewDisplayL( rect, Session().AlfAppUi()->Container(), 0, NULL, iDisplayType, iScreenBufferUid );
+
+        TRect clipped = rect;
+        if (clipped.Intersects(iRect))
+            {
+            clipped.Intersection(iRect);        
+            }
+
+        iDisplay->SetVisibleArea(clipped);        
+        }
+        
+    // Shared TV-out display    
+    else if (IsTvOut())
+        {
+        if (Session().SharedHuiEnv()->DisplayCount() == 0)
+            {
+            // Primary lcd must exist before tv out is created            
+            User::Leave(KErrNotFound);                    
+            }                
+        else
+            {                
+            iDisplay = &Session().SharedHuiEnv()->NewDisplayL( iRect,
+                 Session().AlfAppUi()->Container(),
+                 0, 
+                 &Session().SharedHuiEnv()->PrimaryDisplay(), 
+                 CHuiDisplay::EDisplayNormal, 
+                 KHuiUidBackBufferTvOutNormal
+                 );                  
+            }
+        }  
+     else
+     	{
+     	User::Leave(KErrNotFound); 
+     	} 
+     
+    // If we have screen buffer observers for the new display, add Alf server as an observer 	
+    TAlfScreenBufferEvent event = {iScreenBufferUid, MHuiScreenBufferObserver::ECreated, TRect(), TRect()};
+    if (Session().AlfServer()->ScreenBufferManager().TriggerScreenBufferEvent(event))
+    	{
+    	iDisplay->AddScreenBufferObserverL(&Session().AlfServer()->ScreenBufferManager());
+    	}
+	
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfSrvDisplaySubSession* CAlfSrvDisplaySubSession::NewL( 
+    CAlfAppSrvSessionBase& aSession,
+    const TRect& aRect,
+    TInt aWindowGroupId,
+    TInt aDisplayType,
+    const TUid& aBufferUid )
+    {
+    CAlfSrvDisplaySubSession* self = 
+        CAlfSrvDisplaySubSession::NewLC( aSession, aRect, aWindowGroupId, aDisplayType, aBufferUid );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+CAlfSrvDisplaySubSession* CAlfSrvDisplaySubSession::NewLC( 
+    CAlfAppSrvSessionBase& aSession,
+    const TRect& aRect,
+    TInt aWindowGroupId,
+    TInt aDisplayType,
+    const TUid& aBufferUid )
+    {
+    CAlfSrvDisplaySubSession* self = 
+        new( ELeave ) CAlfSrvDisplaySubSession( aSession, aRect, aWindowGroupId, aDisplayType, aBufferUid);
+    CleanupClosePushL( *self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvDisplaySubSession::~CAlfSrvDisplaySubSession()
+    {
+    if (iDisplay && (IsTvOut() || (iDisplayType == CHuiDisplay::EDisplayOffScreenBuffer)))
+        {
+        if (IsTvOut())
+        	{
+   	        Session().AlfAppUi()->RemoveTvDisplayOnSharedWindow(*iDisplay);
+        	}
+        delete iDisplay;    
+        }
+    iDisplay = NULL;
+    iBackgroundItems.Close();    
+    
+    // If we are deleting shared screen subsession, deregister to Tfx Server
+    if ((iDisplayType == CHuiDisplay::EDisplayLcd0) || 
+    	((iDisplayType == CHuiDisplay::EDisplayNormal) && (iScreenBufferUid == KHuiUidBackBufferScreen0)))
+    	{  
+        #ifdef TFXSERVER_API_V2
+    	MTransitionServer2* tfxServer = Session().AlfServer()->TfxServer();
+    	if (tfxServer)
+    		{
+        	// Note: if this returns KErrNotFound, it is also send to Tfx server
+        	TInt wgId = Session().ClientWindowGroup();
+			tfxServer->UnregisterApp(MTransitionServer2::ETypeAlf, wgId);
+        	}
+    	#endif
+        }
+        
+   
+    }
+
+// ---------------------------------------------------------------------------
+// Gets display
+// ---------------------------------------------------------------------------
+//
+CHuiDisplay& CAlfSrvDisplaySubSession::Display()
+    {
+    return *iDisplay;
+    }
+ 
+// ---------------------------------------------------------------------------
+// Sets background clear mode.
+// ---------------------------------------------------------------------------
+//    
+void CAlfSrvDisplaySubSession::SetClearBackgroundL( const RMessage2& aMessage )
+    {
+    CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());
+    // Parse parameters
+
+    // 1: clear background (in)
+    const TInt clearBackground = aMessage.Int1();
+            
+    if ( session.IsFocused() )
+        {
+        // Clear the background items, those are not used in this case
+        iBackgroundItems.Reset();
+
+        // Set background
+        Display().SetClearBackgroundL( CHuiDisplay::TClearMode( clearBackground ));
+        }
+    
+    // Complete
+    aMessage.Complete( KErrNone );
+    
+    // Store value for this client
+    iDisplayClearBackground = clearBackground;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets visible area.
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvDisplaySubSession::SetVisibleAreaL( const RMessage2& aMessage, TBool aForce )
+    {
+    // Parse parameters
+
+    // 1: area rect (in)
+    TRect rect;
+    TPckg<TRect> rectPckg(rect); 
+    aMessage.Read(1,rectPckg);
+	        
+		CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());	        
+	           
+    // Set clipping rect for display visible area to e.g. avoid unnecesssary 
+    // drawing under Avkon status/control pane areas. TV out does not show
+    // those so no clipping in that case.
+    if (UseVisualAreaClipping())
+       {
+       iRect = rect;
+		
+			if ( session.IsFocused() )
+        		{
+    	      TRect clipped = Session().AlfAppUi()->Container()->Rect();
+#ifndef SYMBIAN_BUILD_GCE
+		       	if (clipped.Intersects(rect))
+		           {
+		           clipped.Intersection(rect);        
+		           }
+#endif           
+		       	iDisplay->SetVisibleAreaClippingRect(clipped);        
+		       	iDisplay->SetDirty();
+	        	}
+	       }           
+	           
+    // Set visible area        
+			if ( session.IsFocused() || aForce )
+        		{
+    		    static_cast<CAlfAppSrvSession&>(Session()).SetClientDrawingArea( rect );
+        		}
+    // Complete
+    aMessage.Complete( KErrNone );
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the visible area.
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvDisplaySubSession::VisibleAreaL( const RMessage2& aMessage )
+    {
+    // Parse parameters
+
+    // 2: area rect (out)
+    TRect rect;
+    TPckg<TRect> rectPckg(rect); 
+    aMessage.Read(2,rectPckg);
+            
+    // Get visible area
+    rect = static_cast<CAlfAppSrvSession&>(Session()).ClientDrawingArea();
+
+    // Write parameters
+    aMessage.Write(2,rectPckg);
+    
+    // Complete
+    aMessage.Complete( KErrNone );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Sets display dirty
+// ---------------------------------------------------------------------------
+//    
+void CAlfSrvDisplaySubSession::SetDirtyL( const RMessage2& aMessage )
+    {
+    CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());
+    
+    if ( session.IsFocused() )
+        {
+        Display().SetDirty();    
+        }
+    
+    // Complete
+    aMessage.Complete( KErrNone );    
+    }
+
+// ---------------------------------------------------------------------------
+// Sets display rendering quality
+// ---------------------------------------------------------------------------
+//    
+void CAlfSrvDisplaySubSession::SetQualityL( const RMessage2& aMessage )
+    {
+    CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());
+    
+    // Parse parameters
+
+    // 1: quality (in)
+    THuiQuality value = EHuiQualityAccurate;
+    TPckg<THuiQuality> valuePckg(value); 
+    aMessage.Read(1,valuePckg);
+
+    if ( session.IsFocused() )
+        {
+        // Set quality
+        Display().SetQuality(value);    
+        }
+    
+    // Complete
+    aMessage.Complete( KErrNone );    
+
+    // Store value for this client
+    iDisplayRenderingQuality = value;
+    }
+
+// ---------------------------------------------------------------------------
+// Gets display rendering quality
+// ---------------------------------------------------------------------------
+//    
+void CAlfSrvDisplaySubSession::QualityL( const RMessage2& aMessage )
+    {
+    CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());
+    
+    // Parse parameters
+
+    // 2: quality (out)
+    THuiQuality value = EHuiQualityAccurate;
+    TPckg<THuiQuality> valuePckg(value); 
+
+    if ( session.IsFocused() )
+        {
+        // Get quality
+        value = Display().Quality();    
+        }
+    else
+        {
+        value = THuiQuality(iDisplayRenderingQuality);
+        }
+    
+    // Write parameters
+    aMessage.Write(2,valuePckg);
+    
+    // Complete
+    aMessage.Complete( KErrNone );    
+    }
+
+// ---------------------------------------------------------------------------
+// Sets display depth test usage
+// ---------------------------------------------------------------------------
+//    
+void CAlfSrvDisplaySubSession::SetUseDepthL( const RMessage2& aMessage )
+    {
+    CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());
+    
+    // Parse parameters
+
+    // 1: bool (in)
+    TBool value = EFalse;
+    TPckg<TBool> valuePckg(value); 
+    aMessage.Read(1,valuePckg);
+
+    // Update value if the client is on focus
+    if ( session.IsFocused() )
+        {
+        // Set use depth
+        Display().SetUseDepth(value);    
+        }
+    
+    // Complete
+    aMessage.Complete( KErrNone );    
+
+    // Store value for this client
+    iDisplayUseDepthTest = value;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets display usage
+// ---------------------------------------------------------------------------
+//    
+void CAlfSrvDisplaySubSession::SetUsageL( const RMessage2& aMessage )
+    {
+    CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());
+    
+    // Parse parameters
+
+    // 1: TUint (in)
+    TUint value = 0;
+    TPckg<TUint> valuePckg(value); 
+    aMessage.Read(1,valuePckg);
+
+    // Update value if the client is on focus
+    if ( session.IsFocused() )
+        {
+        // Set use depth
+        Display().SetUsageL(value);    
+        }
+    
+    // Complete
+    aMessage.Complete( KErrNone );    
+
+    // Store value for this client
+    iDisplayUsage = value;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets visual content for the window
+// ---------------------------------------------------------------------------
+//    
+void CAlfSrvDisplaySubSession::SetClientWindowForDrawingL( const RMessage2& aMessage )
+    {
+    CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());
+    
+    // Parse parameters
+
+    // 1: TUint (in)
+    TInt3 data(0,0,0);
+    TPckg<TInt3> dataPckg(data); 
+    aMessage.Read(1,dataPckg);    
+    
+    // Update value even if the client is not in focus
+    
+    CHuiVisual* visual = NULL;
+    TInt visualHandle = data.iInt3;
+    if (visualHandle)
+    	{
+    	visual = (CHuiVisual*) Session().GetInterfaceL(EHuiObjectTypeVisual, visualHandle);
+    	}
+		Session().AlfAppUi()->SetClientWindowForDrawingL(data.iInt1, data.iInt2, visual);
+    
+    // Complete
+    aMessage.Complete( KErrNone );    
+    }
+
+// ---------------------------------------------------------------------------
+// Sets display bqckground items
+// ---------------------------------------------------------------------------
+//    
+void CAlfSrvDisplaySubSession::SetBackgroundItemsL( const RMessage2& aMessage )
+    {
+    CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());
+    
+    // Parse parameters
+    HBufC8* buffer = HBufC8::NewLC(aMessage.GetDesLength(1));
+    TPtr8 ptr = buffer->Des();
+    aMessage.Read(1, ptr);
+
+    RArray<TAlfDisplayBackgroundItem> array;
+    CleanupClosePushL( array );
+    InternalizeL(*buffer, array);
+
+    // Store value for this client
+    iBackgroundItems.Reset();
+    for(TInt i = 0; i < array.Count(); ++i)
+        {
+        TAlfDisplayBackgroundItem alfItem = array[i];
+        THuiDisplayBackgroundItem* huiItem = (THuiDisplayBackgroundItem*)&alfItem;
+        iBackgroundItems.Append(*huiItem);
+        }
+
+    CleanupStack::PopAndDestroy( &array );
+
+    // Reset full background to none
+    iDisplayClearBackground = CHuiDisplay::EClearNone;
+
+    // Update value if the client is on focus
+    if ( session.IsFocused() )
+        {        
+        // Set use background items
+        Display().SetBackgroundItemsL(iBackgroundItems);    
+        }
+    
+    CleanupStack::PopAndDestroy( buffer );
+    
+    // Complete
+    aMessage.Complete( KErrNone );    
+    }
+
+// ---------------------------------------------------------------------------
+// Sets non fading
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvDisplaySubSession::SuppressAutomaticFadingL( 
+        const RMessage2& aMessage )
+    {
+    CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());
+    
+    // Parse parameters
+
+    // 1: TBool (in)
+    TBool value = EFalse;
+    TPckg<TBool> valuePckg(value); 
+    aMessage.Read(1,valuePckg);
+
+    // Store value for this client
+    iAutomaticFadingSuppressed = value;
+
+    // Update value if the client is on focus and it's shown in a window.
+    if ( session.IsFocused() )
+        {
+        UpdateAutomaticFading();
+        }
+
+    // Complete
+    aMessage.Complete( KErrNone );    
+    }
+
+// ---------------------------------------------------------------------------
+// From CAlfSrvSubSessionBase
+// Process the message.
+// ---------------------------------------------------------------------------
+// 
+void CAlfSrvDisplaySubSession::DoProcessMessageL(const RMessage2& aMessage)
+    {
+    switch( aMessage.Int0() )
+        {
+        case EAlfDisplaySetClearBackground:
+            {
+            SetClearBackgroundL( aMessage );
+            break;
+            }
+        case EAlfDisplaySetVisibleArea:
+            {
+            SetVisibleAreaL( aMessage );
+            break;
+            }
+        case EAlfDisplayForceSetVisibleArea:
+            {
+            SetVisibleAreaL( aMessage, ETrue );
+            break;
+            }
+        case EAlfDisplayVisibleArea:
+            {
+            VisibleAreaL( aMessage );
+            break;
+            }
+        case EAlfDisplaySubSessionClose: // obsolete
+            {
+            Session().CloseSubSession( aMessage );
+            break;
+            }
+        case EAlfDisplaySetDirty:
+            {
+            SetDirtyL( aMessage );
+            break;
+            }
+        case EAlfDisplaySetQuality:
+            {
+            SetQualityL( aMessage );            
+            break;
+            }
+        case EAlfDisplayQuality:
+            {            
+            QualityL( aMessage );
+            break;
+            }
+        case EAlfDisplaySetUseDepth:
+            {
+            SetUseDepthL( aMessage );            
+            break;
+            }
+        case EAlfDisplaySetUsage:
+            {
+            SetUsageL( aMessage );            
+            break;
+            }
+        case EAlfDisplaySetBackgroundItems:
+            {
+            SetBackgroundItemsL( aMessage );            
+            break;
+            }
+        case EAlfDisplayHandlePointerEvent:
+            {
+            HandlePointerEventL( aMessage );            
+            break;
+            }
+
+        case EAlfDisplaySuppressAutomaticFading:
+            {
+            SuppressAutomaticFadingL( aMessage );
+            break;
+            }
+
+        case EAlfDisplaySetClientWindowForDrawing:
+            {
+            SetClientWindowForDrawingL( aMessage );
+            break;
+            }
+
+        default:
+            CAlfSrvSubSessionBase::DoProcessMessageL( aMessage );
+            break;
+        }
+    }
+    
+ 
+CHuiDisplay* CAlfSrvDisplaySubSession::AsHuiDisplay()
+    {
+    return iDisplay;
+    }
+    
+void CAlfSrvDisplaySubSession::SetSessionFocused(TBool aFocused)
+    {
+    if ( iDisplay )
+        {
+        if (aFocused)
+            {
+            // Set clipping rect for display visible area to e.g. avoid unnecesssary 
+            // drawing under Avkon status/control pane areas. TV out does not show
+            // those so no clipping in that case.
+            if (UseVisualAreaClipping())
+                {
+                TRect clipped = Session().AlfAppUi()->Container()->Rect();
+                if (clipped.Intersects(iRect))
+                    {
+                    clipped.Intersection(iRect);        
+                    }
+                iDisplay->SetVisibleAreaClippingRect(clipped);        
+                iDisplay->SetDirty();
+                }
+
+            // If background items are used
+            if (iBackgroundItems.Count() != 0)
+                {
+                TRAP_IGNORE(iDisplay->SetBackgroundItemsL(iBackgroundItems))                        
+                }
+            else
+                {
+                TRAP_IGNORE(iDisplay->SetClearBackgroundL(
+                        CHuiDisplay::TClearMode(iDisplayClearBackground)))                                        
+                }    
+                        
+            iDisplay->SetQuality(THuiQuality(iDisplayRenderingQuality));
+            iDisplay->SetUseDepth(iDisplayUseDepthTest);
+            
+            UpdateAutomaticFading(); // update non-fading to app ui container
+            }
+        else
+            {
+            // Disable clipping rect 
+            if (UseVisualAreaClipping())
+                {
+                iDisplay->SetVisibleAreaClippingRect(TRect(0,0,0,0));        
+                iDisplay->SetDirty();
+                }                
+            }    
+        
+        if (IsTvOut())
+            {
+            if (aFocused)
+                {
+                TRAP_IGNORE(
+                    {
+                    iDisplay->RestoreL();
+                    Session().AlfAppUi()->AppendTvDisplayOnSharedWindowL(*iDisplay);
+                    })
+                }
+            else
+                {
+                Session().AlfAppUi()->RemoveTvDisplayOnSharedWindow(*iDisplay);
+                iDisplay->Release();    
+                }                
+            }
+        }
+    }
+
+TBool CAlfSrvDisplaySubSession::IsTvOut() const
+    {
+    return((iDisplayType == CHuiDisplay::EDisplayTvOut) || 
+           (iDisplayType == CHuiDisplay::EDisplayTvOutWide) ||
+           ((iDisplayType == CHuiDisplay::EDisplayNormal) && 
+           ((iScreenBufferUid == KHuiUidBackBufferTvOutNormal) ||
+           (iScreenBufferUid == KHuiUidBackBufferTvOutWide))));
+    }
+
+TInt CAlfSrvDisplaySubSession::DisplayType() const
+    {
+    return iDisplayType;    
+    }
+
+void CAlfSrvDisplaySubSession::HandlePointerEventL( const RMessage2& aMessage )
+    {
+    // This function handles pointer events that are (optionally) sent from client side
+
+    // Parse parameters
+    CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());
+
+    // 1: TPointerEvent (in)
+    TAdvancedPointerEvent value;
+    TPckg<TAdvancedPointerEvent> valuePckg(value); 
+    aMessage.Read(1,valuePckg);
+
+    // Update value if the client is on focus
+    if ( session.IsFocused() && AsHuiDisplay() )
+        {
+        // iPosition has no meaning as client does not know the location of visuals
+        // Threfore only iParentposition is used, it is assumed to be relative to 
+        // display coordinates.
+        value.iPosition = value.iParentPosition; 
+        session.StartPointerHandling();
+        THuiEvent event(AsHuiDisplay(), value);
+               
+        AsHuiDisplay()->Roster().HandleEventL(event);
+        session.FlushPointerHandling();
+        }
+    
+    // Complete
+    aMessage.Complete( KErrNone );    
+    }
+
+void CAlfSrvDisplaySubSession::UpdateAutomaticFading()
+    {
+    CAlfAppSrvSession& session = static_cast<CAlfAppSrvSession&>(Session());
+
+    if ( ( iDisplayType == CHuiDisplay::EDisplayLcd0 ) || 
+         ( ( iDisplayType == CHuiDisplay::EDisplayNormal ) && 
+           ( iScreenBufferUid == KHuiUidBackBufferScreen0 ) ) )
+        {
+        Session().AlfAppUi()->SetContainerNonFading( iAutomaticFadingSuppressed );
+        }
+    }
+
+TBool CAlfSrvDisplaySubSession::UseVisualAreaClipping()
+    {
+    // This method decides wheter we try to clip drawing to the visible area
+    // and thus avoid unnesessary drawing under status/control
+    // panes and thus gain some perfomance improvement.
+    //
+    // - For TV out visual area is never clipped as there is no Avkon
+    // statuspane/control panes.
+    //
+    // - We dont use clipping if we use Hitchcock transitions between apps
+    // because setting clipping in the middle of transition may look ugly
+    // if clipped areas are different sizes.
+    //
+    // - Clipping is only done for BitGdi renderer.
+    //
+#ifdef SYMBIAN_BUILD_GCE
+    return EFalse;
+#else
+    return (!IsTvOut() && 
+            !Session().AlfServer()->TransitionEffects()->IsEnabled() && 
+            Session().AlfAppUi()->HuiEnv().Renderer() == EHuiRendererBitgdi);
+#endif
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfsrvdropshadowhandler.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Drop shadow handler
+*
+*/
+
+
+
+#include "alfsrvdropshadowhandler.h"
+#include "uiacceltk/huidropshadow.h"
+#include "alf/alfconstants.h"
+#include "alf/alfserverutils.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+// Checks if the command can be handled by this class
+// ---------------------------------------------------------------------------
+//
+TBool AlfSrvDropShadowHandler::CanHandleCommand( TInt aCommand )
+    {
+    switch( aCommand )
+        {
+        case EAlfDropShadowSetOffsetInPolar:
+        case EAlfDropShadowSetOffsetInXY:
+        case EAlfDropShadowSetColorRgb:
+        case EAlfDropShadowSetColorSkin:
+        case EAlfDropShadowSetOpacity:
+        case EAlfDropShadowSetBlurRadius:
+        case EAlfDropShadowSetScale:
+            return ETrue;
+        default:
+            return EFalse;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Handles the command
+// ---------------------------------------------------------------------------
+//    
+void AlfSrvDropShadowHandler::HandleCommandL( 
+        CHuiDropShadow& aDropShadow,
+        TInt aCommandId, 
+        const TDesC8& aInputBuffer, 
+        TDes8& /*aResponse*/ )
+    {
+    switch( aCommandId )
+        {
+        case EAlfDropShadowSetOffsetInPolar:
+            {
+            const TAlfDropShadowOffsetPolarParams* const params = (TAlfDropShadowOffsetPolarParams*)aInputBuffer.Ptr();
+            
+            THuiMetric huiMetric;
+            huiMetric.iMagnitude = params->iDistance.iMagnitude;
+            huiMetric.iReferenceTextStyleId = params->iDistance.iReferenceTextStyleId;
+            huiMetric.iUnit = params->iDistance.iUnit;
+            
+            aDropShadow.SetOffset( params->iAngle, huiMetric, params->iTransitionTime );
+            }
+            break;
+            
+        case EAlfDropShadowSetOffsetInXY:
+            {
+            TAlfDropShadowOffsetXYParams* params = (TAlfDropShadowOffsetXYParams*)aInputBuffer.Ptr();
+            aDropShadow.iOffsetUnit = params->iOffsetUnit;     
+            AlfTimedPointUtility::CopyTimedPoint( params->iOffset, aDropShadow.iOffset );
+            }
+            break;
+            
+        case EAlfDropShadowSetColorRgb:
+            {
+            const TAlfDropShadowColorRgbParams* const params = (TAlfDropShadowColorRgbParams*)aInputBuffer.Ptr();
+            aDropShadow.SetColor( params->iColor, params->iTransitionTime );
+            }
+            break;
+            
+        case EAlfDropShadowSetColorSkin:
+            {
+            const TAlfDropShadowColorSkinParams* const params = (TAlfDropShadowColorSkinParams*)aInputBuffer.Ptr();
+            aDropShadow.SetColor( params->iID,params->iIndex, params->iTransitionTime );
+            }
+            break;
+            
+        case EAlfDropShadowSetOpacity:
+            {
+            TAlfTimedValue* params = (TAlfTimedValue*)aInputBuffer.Ptr();
+            AlfTimedValueUtility::CopyTimedValue( *params, aDropShadow.iOpacity );
+            }
+            break;
+            
+        case EAlfDropShadowSetBlurRadius:
+            {
+            TAlfTimedValue* params = (TAlfTimedValue*)aInputBuffer.Ptr();
+            AlfTimedValueUtility::CopyTimedValue( *params, aDropShadow.iRadius );
+            }
+            break;
+            
+        case EAlfDropShadowSetScale:
+            {
+            TAlfTimedValue* params = (TAlfTimedValue*)aInputBuffer.Ptr();
+            AlfTimedValueUtility::CopyTimedValue( *params, aDropShadow.iScale );
+            }
+            break;
+            
+        default:
+            User::Leave( KErrNotSupported );
+        }
+    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfsrveffectenv.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,210 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Environment
+*
+*/
+
+
+
+#include "alf/alfsrveffectenv.h"
+#include "alfappsrvsession.h"
+#include "alfsrvcontrolgroupsubsession.h"
+#include "alfsrvdisplaysubsession.h"
+#include <uiacceltk/HuiControlGroup.h>
+#include <uiacceltk/HuiEnv.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructors
+// ---------------------------------------------------------------------------
+//
+CAlfSrvEffectEnv::CAlfSrvEffectEnv(CAlfAppSrvSession& aSession)
+    : iSession(&aSession)
+    {
+    }
+
+
+void CAlfSrvEffectEnv::ConstructL()
+    {
+    }
+
+
+CAlfSrvEffectEnv* CAlfSrvEffectEnv::NewL(CAlfAppSrvSession& aSession)
+    {
+    CAlfSrvEffectEnv* self = CAlfSrvEffectEnv::NewLC(aSession);
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+CAlfSrvEffectEnv* CAlfSrvEffectEnv::NewLC(CAlfAppSrvSession& aSession)
+    {
+    CAlfSrvEffectEnv* self = new( ELeave ) CAlfSrvEffectEnv (aSession);
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvEffectEnv::~CAlfSrvEffectEnv()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfSrvEffectEnv::ControlGroupCountL()
+    {
+    TInt count = 0;
+    RPointerArray<CAlfSrvSubSessionBase> groups;
+    CleanupClosePushL( groups );
+    iSession->GetSubsessionsByTypeL( groups, EHuiObjectTypeControlGroup );
+    count = groups.Count();
+    CleanupStack::PopAndDestroy( &groups ); // groups.Close()        
+    return count;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfSrvEffectEnv::VisibleControlGroupCountL()
+    {
+    TInt count = 0;
+    RPointerArray<CAlfSrvSubSessionBase> groups;
+    CleanupClosePushL( groups );
+    iSession->GetSubsessionsByTypeL( groups, EHuiObjectTypeControlGroup );
+    for ( TInt g = 0 ; g < groups.Count() ; g++ )
+        {
+        // Check if the control group is shown (set by the application)
+        CAlfSrvControlGroupSubSession* controlGroupSubSession = 
+                static_cast<CAlfSrvControlGroupSubSession*>( groups[g] );        
+        if ( controlGroupSubSession->IsShown() )
+            {
+            count++;
+            }
+        }
+    CleanupStack::PopAndDestroy( &groups ); // groups.Close()        
+    return count;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CHuiControlGroup* CAlfSrvEffectEnv::ControlGroupL( TInt aIndex )
+    {
+    CHuiControlGroup* retVal = NULL;
+    RPointerArray<CAlfSrvSubSessionBase> groups;
+    CleanupClosePushL( groups );
+    iSession->GetSubsessionsByTypeL( groups, EHuiObjectTypeControlGroup );
+
+    // Sanity check for index
+    if (aIndex < groups.Count() && aIndex >= 0)
+        {
+        CAlfSrvControlGroupSubSession* controlGroupSubSession = 
+            static_cast<CAlfSrvControlGroupSubSession*>( groups[aIndex] );
+            
+        retVal = &controlGroupSubSession->ControlGroup();            
+        }
+        
+    CleanupStack::PopAndDestroy( &groups ); // groups.Close()        
+    return retVal;        
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CHuiControlGroup* CAlfSrvEffectEnv::VisibleControlGroupL( TInt aIndex )
+    {
+    CHuiControlGroup* retVal = NULL;
+    TInt count = 0;
+    RPointerArray<CAlfSrvSubSessionBase> groups;
+    CleanupClosePushL( groups );
+    iSession->GetSubsessionsByTypeL( groups, EHuiObjectTypeControlGroup );
+    
+    iSession->ReOrderControlGroupSessionsL( groups );
+    
+    for ( TInt g = 0 ; g < groups.Count() && !retVal ; g++ )
+        {
+        // Check if the control group is shown (set by the application)
+        CAlfSrvControlGroupSubSession* controlGroupSubSession = 
+                static_cast<CAlfSrvControlGroupSubSession*>( groups[g] );        
+        if ( controlGroupSubSession->IsShown() )
+            {
+            if ( count == aIndex )
+                {
+                retVal = &controlGroupSubSession->ControlGroup();  
+                }
+            else
+                {
+                count++;
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy( &groups ); // groups.Close()        
+    return retVal;       
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfSrvEffectEnv::DisplayCountL()
+    {
+    TInt count = 0;
+    RPointerArray<CAlfSrvSubSessionBase> displays;
+    CleanupClosePushL( displays );
+    iSession->GetSubsessionsByTypeL( displays, EHuiObjectTypeDisplay );
+    count = displays.Count() ; 
+    CleanupStack::PopAndDestroy( &displays ); // displays.Close()
+    return count;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CHuiDisplay* CAlfSrvEffectEnv::DisplayL(TInt aIndex)
+    {
+    // update display attributes for each display
+    CHuiDisplay* display = NULL;
+    RPointerArray<CAlfSrvSubSessionBase> displays;
+    CleanupClosePushL( displays );
+    iSession->GetSubsessionsByTypeL( displays, EHuiObjectTypeDisplay );
+
+    // Sanity check for index
+    if ( aIndex < displays.Count() && aIndex >= 0 )
+        {
+        CAlfSrvDisplaySubSession* displaySubSession = 
+                static_cast<CAlfSrvDisplaySubSession*>( displays[aIndex] );     
+        display = &displaySubSession->Display();
+        }
+    CleanupStack::PopAndDestroy( &displays ); // displays.Close()
+    return display;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CHuiEnv* CAlfSrvEffectEnv::SharedEnv()
+    {
+    return iSession->SharedHuiEnv();    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfsrvresourcemanager.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,252 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Manager for cross-session resources.
+*
+*/
+
+
+
+
+#include "alfsrvresourcemanager.h"
+#include "alflogger.h"
+#include "alf/alfappsrvsessionbase.h"
+#include <uiacceltk/HuiDisplay.h>
+
+// Internal flags
+enum TAlfSchedulerFlags
+    {
+    EAlfSchedulerFlagPrimaryDisplayLightsOn     = 0x01,
+    EAlfSchedulerFlagSecondaryDisplayLightsOn   = 0x02,
+    EAlfSchedulerFlagApplicationForeground      = 0x04
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvResourceManager::CAlfSrvResourceManager( CHuiEnv& aEnv )
+ : iEnv( aEnv )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// Checks the initial flag states.
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvResourceManager::ConstructL()
+    {
+	// TODO: Causes random crash during boot, revise
+    // iLight = CHWRMLight::NewL(this); // Calls LightStatusChanged()
+    
+    iFlags |= EAlfSchedulerFlagApplicationForeground;
+
+    // Workaround for non-working light status reports  
+    iFlags |= EAlfSchedulerFlagPrimaryDisplayLightsOn;
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfSrvResourceManager* CAlfSrvResourceManager::NewL( CHuiEnv& aEnv )
+    {
+    CAlfSrvResourceManager* self = new( ELeave ) CAlfSrvResourceManager( aEnv );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvResourceManager::~CAlfSrvResourceManager()
+    {
+    // delete iLight;
+    iActiveSession = NULL;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Called when the application server's window visibility changes.
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvResourceManager::SetServerWindowPartiallyVisible( TBool aVisible )
+    {
+    __ALFLOGSTRING1( "CAlfSrvResourceManager::SetServerWindowPartiallyVisible %d", aVisible )
+    if ( aVisible )
+        {
+        iFlags |= EAlfSchedulerFlagApplicationForeground;
+        }
+    else
+        {
+        iFlags &= ~EAlfSchedulerFlagApplicationForeground;
+        }
+        
+    UpdateSchedulerState();
+    }
+ 
+// ---------------------------------------------------------------------------
+// Called when active session changes.
+// ---------------------------------------------------------------------------
+//   
+void CAlfSrvResourceManager::SetActiveSession( CAlfAppSrvSessionBase* aSession )
+    {
+    __ALFLOGSTRING1( "CAlfSrvResourceManager::SetActiveSession 0x%x", aSession )
+    iActiveSession = aSession;
+    }
+  
+// ---------------------------------------------------------------------------
+// Checks the flags and restarts/pauses the scheduler accordingly.
+// ---------------------------------------------------------------------------
+//  
+void CAlfSrvResourceManager::UpdateSchedulerState()
+    {
+    if ( LightsOn() && 
+         iFlags&EAlfSchedulerFlagApplicationForeground )
+        {
+        // Run the scheduler
+        Run();
+        }
+    // Run the scheduler if there is observer to Screen Buffer.
+    // refer CAlfScreenBuffer and CAlfScreenBufferEventFetcher classes 
+    else if(LightsOn() && iEnv.DisplayCount() > 0 && iEnv.PrimaryDisplay().ScreenBufferObserver() )
+        {
+        Run();
+        }
+    else
+        {
+        // Pause schduler
+        Pause();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Restarts the scheduler.
+// ---------------------------------------------------------------------------
+//    
+void CAlfSrvResourceManager::Run()
+    {
+    __ALFLOGSTRING( "CAlfSrvResourceManager::Run")
+    if ( iActiveSession )
+        {
+        if ( iEnv.RefreshMode() != iActiveSession->PreferredRefreshMode() )
+            {
+            iEnv.SetRefreshMode( iActiveSession->PreferredRefreshMode() );
+            }
+        }
+    else
+        {
+        iEnv.SetRefreshMode( EHuiRefreshModeAutomatic );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Pauses the scheduler.
+// Current implementation set the refresh mode to manual.
+// ---------------------------------------------------------------------------
+//    
+void CAlfSrvResourceManager::Pause()
+    {
+    if ( iEnv.RefreshMode() == EHuiRefreshModeManual )
+        {
+        return; // Already paused
+        }
+        
+    __ALFLOGSTRING( "CAlfSrvResourceManager::Pause")
+#ifndef SYMBIAN_BUILD_GCE
+    iEnv.SetRefreshMode( EHuiRefreshModeManual );
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// Checks if either of the display lights are on.
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfSrvResourceManager::LightsOn() const
+    {
+    if ( iFlags&EAlfSchedulerFlagPrimaryDisplayLightsOn ||
+         iFlags&EAlfSchedulerFlagSecondaryDisplayLightsOn )
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class MHWRMLightObserver.
+// Called when the lights change.
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvResourceManager::LightStatusChanged(TInt aTarget, CHWRMLight::TLightStatus aStatus)
+    {
+    // If set at the end of the function, the UpdateSchedulerState() is called.
+    TBool updateScheduler = EFalse;
+    
+    // Check the primary display
+    if( aTarget&CHWRMLight::EPrimaryDisplay )
+        {
+        if( aStatus == CHWRMLight::ELightOn ||
+            aStatus == CHWRMLight::ELightStatusUnknown )
+            {
+            iFlags |= EAlfSchedulerFlagPrimaryDisplayLightsOn;
+            __ALFLOGSTRING( "CAlfSrvResourceManager::LightStatusChanged Primary ON")
+            }
+        else if( aStatus == CHWRMLight::ELightOff )
+            {
+            iFlags &= ~EAlfSchedulerFlagPrimaryDisplayLightsOn;
+            __ALFLOGSTRING( "CAlfSrvResourceManager::LightStatusChanged Primary OFF")
+            }
+        else
+            {
+            // for PC lint
+            }
+        updateScheduler = ETrue;
+        }
+    
+    // Check the secondary display
+    if ( aTarget&CHWRMLight::ESecondaryDisplay )
+        {
+        if( aStatus == CHWRMLight::ELightOn ||
+            aStatus == CHWRMLight::ELightStatusUnknown )
+            {
+            iFlags |= EAlfSchedulerFlagSecondaryDisplayLightsOn;
+            __ALFLOGSTRING( "CAlfSrvResourceManager::LightStatusChanged Secondary ON")
+            }
+        else if( aStatus == CHWRMLight::ELightOff )
+            {
+            iFlags &= ~EAlfSchedulerFlagSecondaryDisplayLightsOn;
+            __ALFLOGSTRING( "CAlfSrvResourceManager::LightStatusChanged Secondary OFF")
+            }
+        else
+            {
+            // for PC lint
+            }
+        updateScheduler = ETrue;
+        }
+        
+    // update the scheduler state if the light status has been changed.
+    if ( updateScheduler )
+        {
+        UpdateSchedulerState();
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfsrvscreenbuffermanager.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,680 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Server side screen buffer handling
+*
+*/
+
+
+
+#include "alfsrvscreenbuffermanager.h"
+#include "alflogger.h"
+#include <alf/alfappserver.h> 
+#include <uiacceltk/HuiEnv.h> 
+
+// ----------------------------
+
+// Uid for requesting Hui Screen Buffer GC
+const TUid KHuiInternalFbsBitmapBufferGcUid = {0x2000e5a3}; 
+
+// Screen buffer flags
+enum TAlfServerScreenBufferFlags 
+	{
+	EAlfScreenBufferFlagNone = 0,
+	EAlfScreenBufferFlagDisableDrawToWindow = 1
+	};
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfSrvScreenBufferManager* CAlfSrvScreenBufferManager::NewL(CAlfAppServer& aAppServer)
+    {
+    CAlfSrvScreenBufferManager* self = new( ELeave ) CAlfSrvScreenBufferManager(aAppServer);
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvScreenBufferManager::CAlfSrvScreenBufferManager(CAlfAppServer& aAppServer)
+	: iAlfAppServer(aAppServer)
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvScreenBufferManager::ConstructL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvScreenBufferManager::~CAlfSrvScreenBufferManager()
+    {
+	iScreenBufferObservers.Close();    
+    }
+
+
+// ---------------------------------------------------------------------------
+// Delivers screen buffer complete event.
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfSrvScreenBufferManager::ScreenBufferComplete(TUid aUid, TRect& aDisplayRect, TRect& aDirtyRect)
+	{
+    TAlfScreenBufferEvent event = {aUid, 0, aDisplayRect, aDirtyRect};
+    TriggerScreenBufferCompleteEvent(event);
+    return EFalse;
+	}
+
+
+// ---------------------------------------------------------------------------
+// Delivers screen buffer event.
+// ---------------------------------------------------------------------------
+// 
+void CAlfSrvScreenBufferManager::HandleScreenBufferEvent(TUid aUid, TInt aEventId)
+	{
+    TAlfScreenBufferEvent event = {aUid, aEventId, TRect(), TRect()};
+    TriggerScreenBufferEvent(event);
+	}
+
+
+// ---------------------------------------------------------------------------
+// Complete pending client requests for given screen buffer.
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfSrvScreenBufferManager::TriggerScreenBufferEvent(TAlfScreenBufferEvent& aEvent)
+    {
+	CAlfSrvScreenBufferManager::TScreenBufferObserverItem item(aEvent.iBufferUid, 0, 0, NULL, NULL, 0);
+	TInt index;
+	TBool observerClientFound = EFalse;
+	
+	if (FindFromScreenBufferArray(item, index) != KErrNone)
+		{
+		// Error or no observers. Remove the observer from Hui as we cannot process it.
+       	__ALFLOGSTRING1( "CAlfSrvScreenBufferManager::TriggerScreenBufferEvent. Observer not found for buffer %x ", aEvent.iBufferUid.iUid )
+		CHuiDisplay* display = NULL;
+		FindScreenBufferDisplay(aEvent.iBufferUid, &display);
+		if (display)
+			{
+			display->RemoveScreenBufferObserver();
+			}
+		}
+	else
+		{
+		observerClientFound = ETrue;
+				
+		// Complete pending request for all observers
+		TInt count = iScreenBufferObservers.Count();
+		
+		// Buffer draw complete event is given only the first observer i.e. which has the highest priority
+		if (aEvent.iEventId == MHuiScreenBufferObserver::EBufferDrawComplete)
+			{
+			count = index + 1; // do loop only once
+			}
+		
+		for(; (index < count) && (iScreenBufferObservers[index].iBufferUid == aEvent.iBufferUid); index++)
+			{		
+		    if (aEvent.iEventId == MHuiScreenBufferObserver::ECreated)
+    			{
+    			// Update Hui display pointer in the observer list
+				FindScreenBufferDisplay(iScreenBufferObservers[index].iBufferUid, &iScreenBufferObservers[index].iHuiDisplay);
+    			}
+		    else if (aEvent.iEventId == MHuiScreenBufferObserver::EDeleted)
+    			{
+    			// Remove Hui display pointer from the observer list
+    			iScreenBufferObservers[index].iHuiDisplay = NULL;
+    			}
+    	    else
+    	        {
+    	        // For PC-lint
+    	        }
+			
+			RMessagePtr2* message = &iScreenBufferObservers[index].iMessage;
+	    	if (!message->IsNull())
+	    		{
+    			TPckg<TAlfScreenBufferEvent> eventPckg(aEvent);   	
+        		TInt error = message->Write(0, eventPckg);
+        		if ( error != KErrNone )
+        			{
+            		__ALFLOGSTRING1( "CAlfSrvScreenBufferManager::TriggerScreenBufferEvent: write error: %d", error )
+        			}
+        		message->Complete(error);        	    	
+	    		}
+	    	else
+	    		{
+	    		// Cannot sent a message to the client	    		
+	    		// Store the event, if that cannot yet be sent 
+	    		__ALFLOGSTRING2( "CAlfSrvScreenBufferManager::TriggerScreenBufferEvent: client not ready for buffer %x, pri %d",iScreenBufferObservers[index].iBufferUid.iUid, iScreenBufferObservers[index].iPriority )        		    		
+	    		iScreenBufferObservers[index].iNextEventId = aEvent.iEventId; 
+	    		}
+			}
+        }
+    return observerClientFound;       
+    }
+
+
+// ---------------------------------------------------------------------------
+// Complete pending client requests for given screen buffer
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfSrvScreenBufferManager::TriggerScreenBufferCompleteEvent(TAlfScreenBufferEvent& aEvent)
+    {
+	CAlfSrvScreenBufferManager::TScreenBufferObserverItem item(aEvent.iBufferUid, 0, 0, NULL, NULL, 0);
+	TInt index;
+	TBool observerClientFound = EFalse;
+	CHuiDisplay* display = NULL;
+	
+	if (FindFromScreenBufferArray(item, index) != KErrNone)
+		{
+		// Error or no observers. Remove the observer from Hui as we cannot process it.
+       	__ALFLOGSTRING1( "CAlfSrvScreenBufferManager::TriggerScreenBufferEvent. Observer not found for buffer %x ",
+       		aEvent.iBufferUid.iUid )
+		FindScreenBufferDisplay(aEvent.iBufferUid, &display);
+		if (display)
+			{
+			display->RemoveScreenBufferObserver();
+			}
+		}
+	else
+		{
+		observerClientFound = ETrue;
+		display = iScreenBufferObservers[index].iHuiDisplay;
+		
+		// If needed, draw Screen Buffer automatically to the window when the buffer is complete 
+		if (display && 
+		    !(iScreenBufferObservers[index].iFlags & EAlfScreenBufferFlagDisableDrawToWindow))
+			{
+			display->DrawScreenBuffer();
+ 			} 			
+		
+		// Complete pending request for the first observer only i.e. which has the highest priority
+		RMessagePtr2* message = &iScreenBufferObservers[index].iMessage;
+	    if (!message->IsNull())
+	    	{
+    		TPckg<TAlfScreenBufferEvent> eventPckg(aEvent);   	
+        	TInt error = message->Write(0, eventPckg);
+        	if ( error != KErrNone )
+        		{
+           		__ALFLOGSTRING1( "CAlfSrvScreenBufferManager::TriggerScreenBufferEvent: write error: %d", error )
+        		}
+        	message->Complete(error);        	    	
+	    	}
+	    else
+	    	{
+	    	// Cannot sent a message to the client	    		
+	    	__ALFLOGSTRING2( "CAlfSrvScreenBufferManager::TriggerScreenBufferEvent: client not ready for buffer %x, pri %d",
+	    		iScreenBufferObservers[index].iBufferUid.iUid, iScreenBufferObservers[index].iPriority )        		    		
+	    	if (iScreenBufferObservers[index].iHuiDisplay)
+	    		{
+	    		// Unlock the buffer to get the next callback
+	    		// todo: should we invalidate the whole hui display now as we can loose dirty rects here?
+				iScreenBufferObservers[index].iHuiDisplay->SetScreenBufferLock(EFalse);
+	    		}
+	    	}
+        }
+    return observerClientFound;       
+    }
+
+
+// ---------------------------------------------------------------------------
+// Add the item to the observer array.
+// ---------------------------------------------------------------------------
+// 
+void CAlfSrvScreenBufferManager::AddScreenBufferObserver(CAlfAppSrvSessionBase* aSession, const RMessage2& aMessage)
+    {
+    TAlfScreenBufferBitmaps event = {KNullUid, 0, 0, 0, 0}; 
+    TPckg<TAlfScreenBufferBitmaps> eventPckg(event);
+    aMessage.Read(0, eventPckg);
+    
+    // Check capabilities in main screen buffer case
+    if (event.iBufferUid == KHuiUidBackBufferScreen0)
+    	{
+   		if(!aMessage.HasCapability(ECapabilityWriteDeviceData) && !aMessage.HasCapability(ECapabilitySwEvent))
+   			{
+			aMessage.Complete(KErrAccessDenied); 
+			return;
+   			}
+    	}
+    
+     // Find the related display, if exists
+ 	CHuiDisplay* foundDisplay = NULL;
+	TInt err = InitScreenBufferDisplay(event, foundDisplay);
+    
+    if (!err)
+    	{
+    	// Insert to the observer array
+    	// Can have several observer sessions for one buffer, but do not allow duplicate (buffer,session) items.
+    	// Order by (buffer, priority)
+    	
+    	CAlfSrvScreenBufferManager::TScreenBufferObserverItem removedItem(event.iBufferUid, 0, 0, NULL, aSession, 0);   
+    	TInt count = RemoveAndReturnScreenBufferObserver(removedItem); // remove matching (iBufferUid,aSession) item
+    	// Reinitialize in case RemoveAndGetObserver() has modified item
+    	CAlfSrvScreenBufferManager::TScreenBufferObserverItem item(event.iBufferUid, event.iPriority, event.iFlags, foundDisplay, aSession, 0);  
+    	item.iMessage = removedItem.iMessage; // Preserve message
+
+// NOTE: Commented out because no okDisplay exists => Compilation error
+//		__ALFLOGSTRING3( "CAlfSrvScreenBufferManager::AddScreenBufferObserver: Observer item in server list: uid=%x, pri=%d, disp=%d", event.iBufferUid, event.iPriority, okDisplay)
+//		__ALFLOGSTRING1( "                                                                      session=%d", aSession )
+
+    	err = iScreenBufferObservers.InsertInOrderAllowRepeats(item, CAlfSrvScreenBufferManager::InsertFunc);    	
+    	}
+    
+    TInt msgErr = KErrNone;    
+
+	// Get the index of the first, i.e. highest prioroty, observer
+	CAlfSrvScreenBufferManager::TScreenBufferObserverItem item(event.iBufferUid, 0, 0, NULL, NULL, 0);
+	TInt highestPriorityIndex = KErrNotFound;
+	FindFromScreenBufferArray(item, highestPriorityIndex);
+	
+	if ( err )
+		{
+		// Error recovery. Remove the observer from Hui if there are no observers.		
+   		__ALFLOGSTRING1( "CAlfSrvScreenBufferManager::AddScreenBufferObserver: Not Added, error=%d", err)
+		if ((highestPriorityIndex < KErrNone) && foundDisplay)
+			{
+			foundDisplay->RemoveScreenBufferObserver(); 
+			}
+		msgErr = KErrCancel; // cancel
+		}
+	else	
+		{
+		if ( highestPriorityIndex >= 0 && (iScreenBufferObservers[highestPriorityIndex].iSession == aSession) &&
+			foundDisplay)
+			{
+			// Clear the Hui display lock as the newly added observer is of highest priority
+			foundDisplay->SetScreenBufferLock(EFalse);
+			}
+		
+   		__ALFLOGSTRING( "CAlfSrvScreenBufferManager::AddScreenBufferObserver: Added ok.")
+	    aMessage.Write(0, eventPckg); // update message           	
+		msgErr = KErrNone; // ok!
+		}
+	aMessage.Complete(msgErr); 	
+	}
+
+
+// ---------------------------------------------------------------------------
+// Initialize the aEvent struct with Hui display information 
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfSrvScreenBufferManager::InitScreenBufferDisplay(TAlfScreenBufferBitmaps& aEvent, CHuiDisplay*& aFoundDisplay)
+    {
+	TInt err = KErrNone;
+ 
+	FindScreenBufferDisplay(aEvent.iBufferUid, &aFoundDisplay);	
+		
+	if (aFoundDisplay)
+		{
+		// Display exists already
+		
+		TBool isFirstObserver = !ScreenBufferObserverExists(aEvent.iBufferUid);
+		if (isFirstObserver)
+			{
+			// Add server as an observer to Hui display instance
+			TRAP(err, aFoundDisplay->AddScreenBufferObserverL(this)); 		
+			}
+		
+		if (!err)
+			{
+    		// Get a handle to the buffer of the display
+			MHuiFbsBitmapBufferGc* gc = (MHuiFbsBitmapBufferGc*)aFoundDisplay->GetGraphicsContext(KHuiInternalFbsBitmapBufferGcUid);
+			if (gc)
+				{
+				CFbsBitmap* bitmap = gc->Bitmap();
+				if (bitmap)
+					{
+					aEvent.iBitmapHandle = bitmap->Handle();
+			    	// event.iMaskHandle is not yet implemented	
+					}
+				// Note: Gc can be released for KHuiInternalFbsBitmapBufferGcUid interface *only* as we 
+				// know that it does not own the bitmap. So the bitmap is still valid.
+				gc->ReleaseGc(); 	
+				}
+			}
+		}	
+	return err;	
+    }
+
+// ---------------------------------------------------------------------------
+// remove the item from the observer array.
+// ---------------------------------------------------------------------------
+// 
+void CAlfSrvScreenBufferManager::RemoveScreenBufferObserver(CAlfAppSrvSessionBase* aSession, const RMessage2& aMessage)
+    {
+    TAlfScreenBufferEvent event;
+    TPckg<TAlfScreenBufferEvent> eventPckg(event);
+    aMessage.Read(0, eventPckg);
+    
+	TScreenBufferObserverItem item(event.iBufferUid, 0, 0, NULL, aSession, 0);
+    TInt count = RemoveAndReturnScreenBufferObserver(item); // Remove matching (iBufferUid,aSession) items
+    
+    if (count)
+    	{
+   		__ALFLOGSTRING( "CAlfSrvScreenBufferManager::RemoveScreenBufferObserver: observer removed.")
+
+		// Complete pending message
+		RMessagePtr2* message = &item.iMessage;
+    	if (!message->IsNull())
+        	{
+        	message->Complete(KErrCancel); 
+        	}
+        		
+        // Remove observer from Coretoolkit
+        if (item.iHuiDisplay && !ScreenBufferObserverExists(event.iBufferUid))
+			{
+        	item.iHuiDisplay->RemoveScreenBufferObserver();
+        	}
+        }  
+	}
+
+
+// ---------------------------------------------------------------------------
+// Unlock the buffer in Hui display
+// ---------------------------------------------------------------------------
+// 
+void CAlfSrvScreenBufferManager::RequestNextBuffer(CAlfAppSrvSessionBase* aSession, const RMessage2& aMessage)
+    {
+    TInt err = KErrCancel;
+    
+	TUid uid; 
+    TPckg<TUid> eventPckg(uid);
+    aMessage.Read(0, eventPckg);
+    
+    TInt index;   
+   	TScreenBufferObserverItem item(uid, 0, 0, NULL, NULL, 0);
+   	
+   	// Check if there is an observer for this buffer
+	if (FindFromScreenBufferArray(item, index) != KErrNone)
+		{
+		// Observer not found. Cancel this request.
+   		__ALFLOGSTRING( "CAlfSrvScreenBufferManager::RequestNextScreenBuffer: Observer not found. Cancel this request.")
+		}
+	// Check if the client is the higest priority observer?	
+	else if (iScreenBufferObservers[index].iSession == aSession) 
+		{
+		CAlfSrvScreenBufferManager::TScreenBufferObserverItem* foundItem = &iScreenBufferObservers[index];
+			
+		// Release buffer lock to signal HUI to process the next frame
+		if (foundItem->iHuiDisplay) 
+			{
+			foundItem->iHuiDisplay->SetScreenBufferLock(EFalse);
+       		err = KErrNone;
+ 			}
+       	}
+	else 
+		{
+		// Not the highest priority observer. Just ignore the request.
+		err = KErrNone; 
+		}
+		
+    aMessage.Complete(err);   	            
+	}
+
+
+// ---------------------------------------------------------------------------
+// Draw the screen buffer to the internal window
+// ---------------------------------------------------------------------------
+// 
+void CAlfSrvScreenBufferManager::RequestBufferDraw(CAlfAppSrvSessionBase* aSession, const RMessage2& aMessage)
+    {
+    TInt err = KErrCancel;
+    
+	TUid uid; 
+    TPckg<TUid> eventPckg(uid);
+    aMessage.Read(0, eventPckg);
+    
+    TInt index;   
+   	TScreenBufferObserverItem item(uid, 0, 0, NULL, NULL, 0);
+	if ( FindFromScreenBufferArray(item, index) != KErrNone)
+		{
+		// Observer not found. Cancel this request.
+   		__ALFLOGSTRING( "CAlfSrvScreenBufferManager::RequestNextScreenBuffer: Observer not found. Cancel this request.")
+		}
+	// Is the client the the higest priority observer?	
+	else if (iScreenBufferObservers[index].iSession == aSession) 
+		{
+		CAlfSrvScreenBufferManager::TScreenBufferObserverItem* foundItem = &iScreenBufferObservers[index];
+			
+		// Release buffer lock to signal HUI to process the next frame
+		if (foundItem->iHuiDisplay) 
+			{
+			foundItem->iHuiDisplay->DrawScreenBuffer();
+       		err = KErrNone;
+ 			}
+       	}
+	else 
+		{
+		// Not the highest priority observer. Just ignore the request.
+		err = KErrNone; 
+		}
+		     
+    // Complete this message first 
+    aMessage.Complete(err); 
+      
+    // Send a draw complete event if this is a highes priority observer  	            
+    if (!err && (iScreenBufferObservers[index].iSession == aSession))
+    	{
+    	HandleScreenBufferEvent(uid, MHuiScreenBufferObserver::EBufferDrawComplete);
+    	}   	
+	}
+
+
+// ---------------------------------------------------------------------------
+// Store request message to the array item.
+// ---------------------------------------------------------------------------
+// 
+void CAlfSrvScreenBufferManager::RequestScreenBufferEvent(CAlfAppSrvSessionBase* aSession, const RMessage2& aMessage)
+    {
+    TAlfScreenBufferEvent event;
+    TPckg<TAlfScreenBufferEvent> eventPckg(event);
+    aMessage.Read(0, eventPckg);
+    TInt index;   
+   	TScreenBufferObserverItem item(event.iBufferUid, 0, 0, NULL, aSession, 0);
+	if ( FindFromScreenBufferArray(item, index) != KErrNone)
+		{
+		// Observer not found. Cancel this request.
+   		__ALFLOGSTRING( "CAlfSrvScreenBufferManager::RequestNextScreenBuffer: Observer not found. Cancel this request.")
+       	aMessage.Complete(KErrCancel);
+		}
+	else
+		{
+		CAlfSrvScreenBufferManager::TScreenBufferObserverItem* foundItem = &iScreenBufferObservers[index];
+		if (foundItem->iMessage.IsNull())
+			{
+			foundItem->iMessage = aMessage; // Copy message to the list item
+			}			
+		else
+			{
+			aMessage.Complete(KErrAlreadyExists); 
+			}
+			
+		// Check for pending next event	
+		if (foundItem->iNextEventId != MHuiScreenBufferObserver::ENone)
+			{
+			TInt eventId = foundItem->iNextEventId;
+			foundItem->iNextEventId = MHuiScreenBufferObserver::ENone;
+			HandleScreenBufferEvent(foundItem->iBufferUid, eventId);
+			}
+       	}            
+	}
+
+
+// ---------------------------------------------------------------------------
+// Find Hui display for the buffer.
+// ---------------------------------------------------------------------------
+// 
+void CAlfSrvScreenBufferManager::FindScreenBufferDisplay(TUid aBufferUid, CHuiDisplay** aDisplay)
+	{
+	*aDisplay = NULL;
+	CHuiDisplay* display = NULL;
+	CAlfAppUi* alfAppUi = iAlfAppServer.AppUi();
+	if (alfAppUi)
+		{		
+		TInt count = alfAppUi->HuiEnv().DisplayCount();
+		for(TInt i = 0; i < count; i++)
+			{
+			display = &(alfAppUi->HuiEnv().Display(i));
+			if (display->ScreenBufferUid() == aBufferUid)
+				{
+				*aDisplay = display;
+				break;
+				}
+			}
+		}
+	}
+	
+	
+// ---------------------------------------------------------------------------
+// Remove item from the array. Return a copy of removed item.
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfSrvScreenBufferManager::RemoveAndReturnScreenBufferObserver(TScreenBufferObserverItem& aItem)
+	{
+	TInt removedObserverCount = 0; 
+	TInt index = 0;
+	TInt err = KErrNone;
+	// There should not be more than one item but issue a while loop just in case...
+	while (err == KErrNone)
+		{
+		err = FindFromScreenBufferArray(aItem, index);
+		if (err == KErrNone)
+			{
+			aItem = iScreenBufferObservers[index];
+			iScreenBufferObservers.Remove(index);
+			removedObserverCount++;
+			}	
+		}
+	return removedObserverCount;		
+	}
+	
+
+// ---------------------------------------------------------------------------
+// Remove all remaining observers from the array in case of client panic etc. 
+// ---------------------------------------------------------------------------
+// 
+void CAlfSrvScreenBufferManager::RemoveScreenBufferObservers(CAlfAppSrvSessionBase* aClientId)
+	{
+	// Sequential search is slow but normally this is called on client exit only
+	TInt count = iScreenBufferObservers.Count();
+	for(TInt i = count - 1; i >= 0; i--)
+		{
+		if (iScreenBufferObservers[i].iSession == aClientId)
+			{
+			TUid bufferUid = iScreenBufferObservers[i].iBufferUid;
+			CHuiDisplay* display = iScreenBufferObservers[i].iHuiDisplay;
+			iScreenBufferObservers.Remove(i);
+			if (display && !ScreenBufferObserverExists(bufferUid))
+				{
+        		display->RemoveScreenBufferObserver();
+				}
+			}
+		}
+	}
+
+ 	
+// ---------------------------------------------------------------------------
+// Find screen buffer from the array.
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfSrvScreenBufferManager::ScreenBufferObserverExists(const TUid& aScreenBufferUid)	
+	{
+   	TScreenBufferObserverItem item(aScreenBufferUid, 0, 0, NULL, NULL, 0);
+   	TInt index = 0;
+   	// Finds if there is any item with the specified uid, not necessarily the first such item.
+	return (iScreenBufferObservers.FindInSignedKeyOrder(item, index) == KErrNone);
+	}
+
+	
+// -----------------------------------------------------------------------------------
+// Finds the first screen buffer item from the array based on buffer id and session id
+// -----------------------------------------------------------------------------------
+// 
+
+TInt CAlfSrvScreenBufferManager::FindFromScreenBufferArray(
+	const CAlfSrvScreenBufferManager::TScreenBufferObserverItem& aItem, TInt& aIndex) const
+	{
+	TInt err = KErrNotFound;
+	TInt count = iScreenBufferObservers.Count(); 
+	aIndex = 0;
+	for(; (aIndex < count) && (iScreenBufferObservers[aIndex].iBufferUid.iUid <= aItem.iBufferUid.iUid); 
+		aIndex++)
+		{	
+		if (iScreenBufferObservers[aIndex].iBufferUid == aItem.iBufferUid)
+			{
+			if ((aItem.iSession == NULL) 
+			    || (iScreenBufferObservers[aIndex].iSession == aItem.iSession))
+				{
+				err = KErrNone;
+				break;	
+				}
+			}
+		}
+	return err;
+	}
+	
+	
+// ---------------------------------------------------------------------------
+// Insert function for iScreenBufferObservers array.
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfSrvScreenBufferManager::InsertFunc(const TScreenBufferObserverItem& aFirst, const TScreenBufferObserverItem& aSecond)
+    {
+    // Compare iBufferUid first
+    if (aFirst.iBufferUid.iUid < aSecond.iBufferUid.iUid)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iBufferUid.iUid > aSecond.iBufferUid.iUid)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    // Because iBufferUid is equal, compare iPriority next.
+    // Note that bigger priority should be first in the array!
+    if (aFirst.iPriority > aSecond.iPriority)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iPriority < aSecond.iPriority)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    // Both
+    return 0; // equal
+    }
+ 
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfsrvsettingshandler.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,286 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Settings handler
+*
+*/
+
+
+
+#include "alfsrvsettingshandler.h"
+#include "uiacceltkdomaincrkeys.h"
+#include "alf/alfappui.h"
+
+#include <centralrepository.h>
+
+const TInt KAlfSrvDefaultRenderer = EHuiRendererBitgdi;
+const TInt KAlfSrvDefaultFrameRate = 22;
+const TInt KAlfSrvDefaultCpuUsage = 75;
+const TInt KAlfSrvDefaultResourceCacheSize = 1000;
+const TInt KAlfSrvDefaultComplexityFactor = 7;
+const TInt KAlfSrvDefaultHwConfiguration = 0;
+
+const TUint KAlfSrvRndBitMask = 0x00ff; // the lowest 8 bits are for the complexity factor
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CAlfSrvSettingsHandler::CAlfSrvSettingsHandler( MAlfSrvSettingsObserver& aObserver )
+ : CActive( EPriorityStandard ), iObserver( aObserver )
+    {
+    CActiveScheduler::Add( this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvSettingsHandler::ConstructL()
+    {
+    // TRAP before the cenrep key exists in builds
+    TRAP_IGNORE( iCentralRepository = CRepository::NewL( KCRUidUIAccelTK ) )
+    }
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CAlfSrvSettingsHandler* CAlfSrvSettingsHandler::NewL( MAlfSrvSettingsObserver& aObserver )
+    {
+    CAlfSrvSettingsHandler* self = new( ELeave ) CAlfSrvSettingsHandler( aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CAlfSrvSettingsHandler::~CAlfSrvSettingsHandler()
+    {
+    Cancel();
+    delete iCentralRepository;
+    }
+
+// ---------------------------------------------------------------------------
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvSettingsHandler::StartObserving()
+    {
+    if ( !IsActive() )
+        {
+        // order notification for all keys in repository  
+        iCentralRepository->NotifyRequest(0x00000000, 0x00000000, iStatus);
+        SetActive();
+        }
+    }
+
+THuiRenderer CAlfSrvSettingsHandler::Renderer()
+    {
+    TInt result = KAlfSrvDefaultRenderer;
+    if ( !iCentralRepository ) 
+        {
+        return static_cast<THuiRenderer>(result);
+        }
+        
+    if ( iCentralRepository->Get( KUIAccelTKRenderer,result ) == KErrNone )
+        {
+        StartObserving();
+        }
+    
+    return static_cast<THuiRenderer>(result);
+    }
+    
+TUint CAlfSrvSettingsHandler::DefaultFramerate()
+    {
+    TInt result = KAlfSrvDefaultFrameRate;
+    if ( !iCentralRepository ) 
+        {
+        return result;
+        }
+        
+    if ( iCentralRepository->Get( KUIAccelTKDefaultFrameRate,result ) == KErrNone )
+        {
+        StartObserving();
+        }
+    
+    return result;
+    }
+    
+TUint CAlfSrvSettingsHandler::MaxCpuUsage()
+    {
+    // Update cached value only if it is not initialized
+    TInt result = KAlfSrvDefaultCpuUsage;
+    if (iMaxCpuUsage == 0)
+    	{    	
+    	if ( !iCentralRepository ) 
+        	{
+    		iMaxCpuUsage = result;
+        	return result;
+        	}
+        	
+    	if ( iCentralRepository->Get( KUIAccelTKMaxCpuUsage, result ) == KErrNone )
+        	{
+        	// Store value to cache (iMaxCpuUsage)
+        	iMaxCpuUsage = result;
+        	StartObserving();
+        	}
+    	}
+    else
+        {
+        // Use cached value
+        result = iMaxCpuUsage;    
+        }	
+    	
+    return result;
+    }
+    
+TUint CAlfSrvSettingsHandler::MaxResourceCacheSize()
+    {
+    TInt result = KAlfSrvDefaultResourceCacheSize;
+    if ( !iCentralRepository ) 
+        {
+        return result;
+        }
+        
+    if ( iCentralRepository->Get( KUIAccelTKMaxResourceCache,result ) == KErrNone )
+        {
+        StartObserving();
+        }
+    
+    return result;
+    }
+    
+TUint CAlfSrvSettingsHandler::EffectsComplexityFactor()
+    {
+    TInt result = KAlfSrvDefaultComplexityFactor;
+    if ( !iCentralRepository ) 
+        {
+        return result;
+        }
+        
+    if ( iCentralRepository->Get( KUIAccelTKEffectsComplexityFactor,result ) == KErrNone )
+        {
+        result = result&KAlfSrvRndBitMask; // remove Rnd flags
+        
+        StartObserving();
+        }
+    
+    return result;
+    }
+    
+TUint CAlfSrvSettingsHandler::HWDriverConfiguration()
+    {
+    TInt result = KAlfSrvDefaultHwConfiguration;
+    if ( !iCentralRepository ) 
+        {
+        return result;
+        }
+        
+    if ( iCentralRepository->Get( KUIAccelTKHWConfigurationFlags,result ) == KErrNone )
+        {
+        StartObserving();
+        }
+    
+    return result;
+    }
+    
+TUint CAlfSrvSettingsHandler::RndFlags()
+    {
+    TInt result = 0;
+    if ( !iCentralRepository ) 
+        {
+        return result;
+        }
+        
+    if ( iCentralRepository->Get( KUIAccelTKEffectsComplexityFactor,result ) == KErrNone )
+        {
+        result = result&~KAlfSrvRndBitMask; // remove complexity factor flags.
+        
+        StartObserving();
+        }
+    
+    return result;
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CActive 
+// Active object RunL
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvSettingsHandler::RunL()
+    {
+    TInt newValue = KAlfSrvDefaultComplexityFactor;
+    TAlfSrvSetting settingChanged = EAlfSrvSettingEffectsComplexityFactor;
+    
+    // iStatus should hold the information about the changed key. Get the new value.    
+    switch ( iStatus.Int() )
+        {
+        case KUIAccelTKRenderer: // flow through
+        case KUIAccelTKHWConfigurationFlags:
+            // do not do anything
+            return;
+            
+        case KUIAccelTKDefaultFrameRate:
+            settingChanged = EAlfSrvSettingDefaultFramerate;
+    		User::LeaveIfError( iCentralRepository->Get( iStatus.Int(), newValue ) );
+            break;
+        case KUIAccelTKMaxCpuUsage:
+            settingChanged = EAlfSrvSettingMaxCpuUsage;
+    		User::LeaveIfError( iCentralRepository->Get( iStatus.Int(), newValue ) );
+    		iMaxCpuUsage = (TUint)newValue;
+            break;
+        case KUIAccelTKMaxResourceCache:
+            settingChanged = EAlfSrvSettingMaxResourceCacheSize;
+    		User::LeaveIfError( iCentralRepository->Get( iStatus.Int(), newValue ) );
+            break;
+        case KUIAccelTKEffectsComplexityFactor:
+            settingChanged = EAlfSrvSettingEffectsComplexityFactor;
+    		// get the new value    
+    		User::LeaveIfError( iCentralRepository->Get( iStatus.Int(), newValue ) );
+            newValue = newValue&KAlfSrvRndBitMask; // remove Rnd flags
+            break;
+        
+        default:
+            // Error?
+            User::LeaveIfError( iStatus.Int() );
+            return; 
+        }
+            
+    StartObserving();
+    iObserver.MAlfSrvUintSettingChangedL( settingChanged, newValue );
+    }
+
+    
+void CAlfSrvSettingsHandler::DoCancel()
+    {
+    iCentralRepository->NotifyCancelAll();
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive 
+// Error handler for RunL
+// ---------------------------------------------------------------------------
+//
+TInt CAlfSrvSettingsHandler::RunError(TInt aError)
+    {
+    return aError;    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfsrvsubsessionbase.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,242 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Sub session base.
+*
+*/
+
+
+
+#include "alf/alfappserver.h"
+#include "alf/alfappsrvsessionbase.h"
+#include "alfsrvsubsessionbase.h"
+#include "alflogger.h"
+
+NONSHARABLE_CLASS(CAlfSrvSubSessionBase::TPrivateData)
+    {
+    public: 
+        MAlfExtension* iObject; // owned, use Release() to destroy
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvSubSessionBase::CAlfSrvSubSessionBase( CAlfAppSrvSessionBase& aSession )
+    : iSession( aSession )
+    {
+    }
+
+CAlfSrvSubSessionBase* CAlfSrvSubSessionBase::NewLC( const RMessage2& aMessage, 
+                                                    TInt aImplementationUid,  
+                                                    TInt aImplementationId,
+                                                    CAlfAppSrvSessionBase& aSession) 
+    {
+    CAlfSrvSubSessionBase* me = new (ELeave) CAlfSrvSubSessionBase(aSession);
+    CleanupClosePushL(*me);
+    me->ConstructL(aMessage, aImplementationUid, aImplementationId);
+    return me;
+    }
+
+void CAlfSrvSubSessionBase::ConstructL(const RMessage2& aMessage, 
+                                       TInt aImplementationUid,  
+                                       TInt aImplementationId )
+    {    
+    ConstructL();
+    
+    // leaves if no implementation found   
+    iData->iObject = iSession.AlfServer()->CreateExtensionL(
+                           aImplementationUid, aImplementationId,aMessage);
+
+    iFactoryUid = aImplementationUid;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvSubSessionBase::ConstructL()
+    {
+    iData = new (ELeave) TPrivateData;
+    
+    iData->iObject = 0;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvSubSessionBase::~CAlfSrvSubSessionBase()
+    {
+    if (iData && iData->iObject)
+        {
+        // todo: notify server about implementation removal
+        iData->iObject->Release();
+        }
+        
+    delete iData;
+    }
+  
+// ---------------------------------------------------------------------------
+// Process message
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvSubSessionBase::ProcessMessageL(const RMessage2& aMessage)
+    {
+    // Call the virtual function.
+    DoProcessMessageL( aMessage );
+    }
+  
+// ---------------------------------------------------------------------------
+// Processes the message.
+// ---------------------------------------------------------------------------
+//  
+void CAlfSrvSubSessionBase::DoProcessMessageL(const RMessage2& aMessage)
+    {
+    if (iData && iData->iObject)
+        {
+        // session owns the buffers and everything related to msg handling     
+        CAlfClientMessage* msg = iSession.CreateNewMessageHolderL(aMessage);
+         
+        TRAPD(err, iData->iObject->HandleCmdL(msg->iDecodedOp, 
+                                              *msg->iInBuf, msg->ReplyBufAsTDes8()));
+
+        iSession.CompleteCmd(0, err);  
+        return;
+        }
+
+    User::Leave(KErrNotSupported);
+    }
+  
+// ---------------------------------------------------------------------------
+// Returns the session
+// ---------------------------------------------------------------------------
+//  
+CAlfAppSrvSessionBase& CAlfSrvSubSessionBase::Session()
+    {
+    return iSession;
+    }
+
+
+MHuiVisualOwner* CAlfSrvSubSessionBase::AsVisualOwner()
+    {
+    if (iData && iData->iObject)
+        {
+        return static_cast<MHuiVisualOwner*>(iData->iObject->GetInterface(EHuiInterfaceVisualOwner));
+        }
+
+    return 0;
+    }
+
+CHuiControl* CAlfSrvSubSessionBase::AsHuiControl()
+    {
+    if (iData && iData->iObject)
+        {
+        return static_cast<CHuiControl*>(iData->iObject->GetInterface(EHuiObjectTypeControl));
+        }
+
+    return 0;
+    }
+
+CHuiVisual* CAlfSrvSubSessionBase::AsHuiVisual()
+    {
+    if (iData && iData->iObject)
+        {
+        return static_cast<CHuiVisual*>(iData->iObject->GetInterface(EHuiObjectTypeVisual));
+        }
+
+    return 0;
+    }
+
+CHuiLayout* CAlfSrvSubSessionBase::AsHuiLayout()
+    {
+    if (iData && iData->iObject)
+        {
+        return static_cast<CHuiLayout*>(iData->iObject->GetInterface(EHuiObjectTypeLayout));
+        }
+
+    return 0;
+    }
+
+CHuiBrush* CAlfSrvSubSessionBase::AsHuiBrush()
+    {
+    if (iData && iData->iObject)
+        {
+        return static_cast<CHuiBrush*>(iData->iObject->GetInterface(EHuiObjectTypeBrush));
+        }
+
+    return 0;
+    }
+
+MHuiMappingFunction* CAlfSrvSubSessionBase::AsMappingFunction()
+    {
+    if (iData && iData->iObject)
+        {
+        return static_cast<MHuiMappingFunction*>(iData->iObject->GetInterface(EHuiInterfaceMappingFunction));
+        }
+
+    return 0;
+    }
+
+CHuiControlGroup* CAlfSrvSubSessionBase::AsHuiControlCroup()
+    {
+    if (iData && iData->iObject)
+        {
+        return static_cast<CHuiControlGroup*>(iData->iObject->GetInterface(EHuiObjectTypeControlGroup));
+        }
+
+    return 0;    
+    }
+    
+CHuiDisplay* CAlfSrvSubSessionBase::AsHuiDisplay()
+    {
+    if (iData && iData->iObject)
+        {
+        return static_cast<CHuiDisplay*>(iData->iObject->GetInterface(EHuiObjectTypeDisplay));
+        }
+
+    return 0;    
+    }
+
+CAlfBrushHandler* CAlfSrvSubSessionBase::AsBrushHandler()
+    {
+    if (iData && iData->iObject)
+        {
+        return static_cast<CAlfBrushHandler*>(iData->iObject->GetInterface(EAlfBrushHandler));
+        }
+
+    return 0;    
+    }
+
+MAlfExtension* CAlfSrvSubSessionBase::AsCommandHandler()
+    {
+    if (iData)
+        {
+        return iData->iObject;
+        }
+
+    return 0;    
+    }
+
+// Todo: Currently we don't support trulu asynch operations as 
+// MAlfExtension does not have interfaces to utilize for this purpose
+//
+// It should be evaluated whether there are real use cases for asynchronous command handling
+void CAlfSrvSubSessionBase::CancelAsynchRequests()
+    {
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfsrvtexturemanager.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,922 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Server side texture manager implementation
+*
+*/
+
+
+
+#include <uiacceltk/HuiEnv.h>
+#include <uiacceltk/HuiUtil.h>
+#include "alfsrvtexturemanager.h"
+#include "alfappsrvsession.h"
+
+/**
+ * Granularity of CAlfSrvTextureManager::iClients array.
+ */
+const TInt KAlfSrvClientsGranularity = 4;
+
+/**
+ * Values for auto size min change.
+ */
+const TInt KAlfTextureManagerAutoSizeMinSizeChange[] =
+    {
+    0,
+    4,
+    8,
+    64,
+    128
+    };
+
+/**
+ * Values for auto size lower threshold (256 = 1.0f).
+ */
+const TInt KAlfTetureManagerAutoSizeRelativeThresholdLower[] =
+    {
+    13,     // 0.05f
+    26,     // .10f
+    64,     // .25f
+    128,    // .50f
+    256     // 1.0f
+    };
+
+/**
+ * Values for auto size upper threshold (256 = 1.0f).
+ */
+const TInt KAlfTetureManagerAutoSizeRelativeThresholdUpper[] =
+    {
+    13,     // 0.05f
+    26,     // .10f
+    64,     // .25f
+    256,    // 1.0f
+    25600   // 100.f
+    };
+
+/**
+ * Values for auto size downsize settle threshold.
+ */
+const TInt KAlfTextureManagerAutoSizeDownsizeSettleThreshold[] =
+    {
+    0,
+    8,
+    64,
+    128,
+    256
+    };
+
+/**
+ * If width/height is below this low boundary, then one pixel precision
+ * is used.
+ */
+const TInt KAlfSrvTextureManagerAutoSizeLowBoundary = 48;
+
+/**
+ * If width/height is above low boundary, but below this high boundary,
+ * then KAlfSrvTextureManagerAutoSizeMiddleRoundTo precision is used.
+ */
+const TInt KAlfSrvTextureManagerAutoSizeHighBoundary = 128;
+
+/**
+ * Precision used when width/heigth is above low, but below high 
+ * boundary. This must be power of two.
+ */
+const TInt KAlfSrvTextureManagerAutoSizeMiddleRoundTo = 2;
+
+/**
+ * Precision used when width/height is above high boundary.
+ * This must be power of two.
+ */
+const TInt KAlfSrvTextureManagerAutoSizeHighRoundTo = 4;
+
+// ======== MEMBER FUNCTIONS ========
+
+CAlfSrvTextureManager* CAlfSrvTextureManager::NewL()
+    {
+    CAlfSrvTextureManager* self = new (ELeave) CAlfSrvTextureManager;
+    return self;
+    }
+   
+CAlfSrvTextureManager::~CAlfSrvTextureManager()
+    {
+    iClients.Close();
+    iUsedTextures.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// Starts using CHuiEnv.
+// ---------------------------------------------------------------------------
+// 
+void CAlfSrvTextureManager::HandleEnvCreateL( CHuiEnv& aEnv )
+    {
+    iEnv = &aEnv;
+    
+    iEnv->TextureManager().
+        iTextureAutoSizeObservers.AppendL( *this );
+    iIsRendererHWA = ( iEnv->Renderer() != EHuiRendererBitgdi );
+    }
+
+// ---------------------------------------------------------------------------
+// Stops using CHuiEnv.
+// ---------------------------------------------------------------------------
+// 
+void CAlfSrvTextureManager::HandleEnvToBeDeleted()
+    {
+    if ( iEnv )
+        {
+        iEnv->TextureManager().
+            iTextureAutoSizeObservers.Remove( *this );
+        iEnv = NULL;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// This functions converts texture ID used in the client side into id that
+// can be used in the serverside HuiTextureManager without the textures getting
+// accidentally shared between apps.
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfSrvTextureManager::CreateTextureId(
+        const TProcessId& aClientOwnerId,
+        TInt aClientSideId, 
+        TInt aClientSideManagerId, 
+        TBool aReUseAnyDeletedId )
+    {
+    TInt exisitingSharedTextureId = 0;
+
+    // Look for an existing entry for the id.
+    for(TInt i = 0; i < iUsedTextures.Count(); i++)
+        {
+        if (aClientSideManagerId == 0)
+            {
+            // Normal texture, "private" to client
+            if(iUsedTextures[i].iClientSideId == aClientSideId &&
+               iUsedTextures[i].iOwnerId == aClientOwnerId)
+                {
+                // Re-use old id
+                iUsedTextures[i].iReleased = EFalse;
+                return iUsedTextures[i].iServerSideId;
+                }                
+            }
+        else
+            {
+            // Shared texture
+            if(iUsedTextures[i].iClientSideId == aClientSideId &&
+               iUsedTextures[i].iClientSideManagerId == aClientSideManagerId)
+                {
+                // Re-use old id                
+                if (iUsedTextures[i].iOwnerId == aClientOwnerId)
+                    {
+                    iUsedTextures[i].iReleased = EFalse;
+                    return iUsedTextures[i].iServerSideId;
+                    }
+                else
+                    {
+                    exisitingSharedTextureId = iUsedTextures[i].iServerSideId;
+                    break;    
+                    }    
+                }                                
+            }    
+        }
+
+
+    // Look for an existing deleted entry for the id i.e. recycle deleted texture id.
+    // Only non-shared textures are recycled to keep things more simple and safe.
+    if (aReUseAnyDeletedId && aClientSideManagerId == 0)
+        {            
+        for(TInt i = 0; i < iUsedTextures.Count(); i++)
+            {
+            if (iUsedTextures[i].iOwnerId == aClientOwnerId &&
+                iUsedTextures[i].iDeleted &&
+                iUsedTextures[i].iClientSideManagerId == aClientSideManagerId)
+                {
+                // Re-use old deleted id even if it had different id
+                iUsedTextures[i].iClientSideId = aClientSideId;
+                iUsedTextures[i].iReleased = EFalse;
+                iUsedTextures[i].iDeleted = EFalse;
+                iUsedTextures[i].iSkinChangeCoordinator = EFalse;
+                return iUsedTextures[i].iServerSideId;                    
+                }
+            }
+        }
+        
+
+    // No existing entry found, create new one.
+    TUsedTexture usedTexture;
+    usedTexture.iClientSideId = aClientSideId;
+    usedTexture.iClientSideManagerId = aClientSideManagerId;
+    usedTexture.iOwnerId = aClientOwnerId;
+        
+    if (aClientSideManagerId == 0 || !exisitingSharedTextureId)
+        {
+        // Select new id and make sure it is not used
+        ++iNextTextureId; 
+        TBool alreadyExists = ETrue;
+        while(alreadyExists)
+            {
+            alreadyExists = EFalse;
+            for(TInt i = 0; i < iUsedTextures.Count(); i++)
+                {
+                if (iUsedTextures[i].iServerSideId == iNextTextureId || iNextTextureId == 0)
+                    {
+                    iNextTextureId++;
+                    alreadyExists = ETrue;
+                    break;    
+                    }
+                }            
+            }                            
+        usedTexture.iServerSideId = iNextTextureId; 
+        }
+    else
+        {
+        usedTexture.iServerSideId = exisitingSharedTextureId;                    
+        }        
+    
+    TBool entryAdded = EFalse;
+    for(TInt i = 0; i < iUsedTextures.Count(); i++)
+        {
+        if (iUsedTextures[i].iOwnerId == aClientOwnerId &&
+            iUsedTextures[i].iClientSideId == 0 &&
+            usedTexture.iClientSideManagerId == 0 &&
+            usedTexture.iServerSideId == 0)
+            {
+            entryAdded = ETrue;
+            iUsedTextures[i] = usedTexture;
+            }                                          
+        }
+
+    if (!entryAdded)
+        {
+        iUsedTextures.Append(usedTexture);        
+        }
+    
+    return usedTexture.iServerSideId;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// 
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfSrvTextureManager::ExistingTextureId(
+        const TProcessId& aClientOwnerId,
+        TInt aClientSideId, 
+        TInt aClientSideManagerId,
+        TBool aIgnoreOwnerForSharedTextures )
+    {
+    // Look for an existing entry for the id.
+    for(TInt i = 0; i < iUsedTextures.Count(); i++)
+        {
+        if (aClientSideManagerId == 0)
+            {
+            // Normal texture, "private" to client
+            if(iUsedTextures[i].iClientSideId == aClientSideId &&
+               iUsedTextures[i].iOwnerId == aClientOwnerId &&
+               iUsedTextures[i].iReleased == EFalse)
+                {
+                return iUsedTextures[i].iServerSideId;
+                }                
+            }
+        else
+            {
+            // Shared texture
+            if(iUsedTextures[i].iClientSideId == aClientSideId &&
+               iUsedTextures[i].iClientSideManagerId == aClientSideManagerId &&
+               iUsedTextures[i].iReleased == EFalse)
+                {
+                if (iUsedTextures[i].iOwnerId == aClientOwnerId || 
+                    aIgnoreOwnerForSharedTextures)
+                    {
+                    return iUsedTextures[i].iServerSideId;
+                    }
+                }                                
+            }    
+        }
+
+    // not found
+    return 0;
+    }
+
+// ---------------------------------------------------------------------------
+//
+//
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfSrvTextureManager::ReleaseTextureId(
+        const TProcessId& aClientOwnerId,
+        TInt aClientSideId, 
+        TInt aClientSideManagerId )
+    {    
+    TInt sharedTextureReferenceCount = 0;
+    TInt toBeRemovedIndex = KErrNotFound;
+
+    // Look for an existing entry for the id.
+    for(TInt i = 0; i < iUsedTextures.Count(); i++)
+        {
+        if (aClientSideManagerId == 0)
+            {
+            // Normal texture, "private" to client
+            if(iUsedTextures[i].iClientSideId == aClientSideId &&
+               iUsedTextures[i].iOwnerId == aClientOwnerId &&
+               iUsedTextures[i].iReleased == EFalse)
+                {
+                toBeRemovedIndex = i;
+                break;
+                }
+            }
+        else
+            {
+            // Shared texture
+            if(iUsedTextures[i].iClientSideId == aClientSideId &&
+               iUsedTextures[i].iClientSideManagerId == aClientSideManagerId  &&
+               iUsedTextures[i].iReleased == EFalse)               
+                {
+                if (iUsedTextures[i].iOwnerId == aClientOwnerId)
+                    {
+                    toBeRemovedIndex = i;
+                    }
+                sharedTextureReferenceCount++;    
+                }                                                
+            }    
+        }
+
+    if (toBeRemovedIndex != KErrNotFound)
+        {
+        iUsedTextures[toBeRemovedIndex].iReleased = ETrue;
+        iUsedTextures[toBeRemovedIndex].iSkinChangeCoordinator = EFalse;
+        if (sharedTextureReferenceCount > 0)
+            {
+            sharedTextureReferenceCount--;    
+            }
+        }
+
+    return sharedTextureReferenceCount;    
+    }
+
+// ---------------------------------------------------------------------------
+//
+//
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfSrvTextureManager::DeleteTextureId(
+        const TProcessId& aClientOwnerId,
+        TInt aClientSideId, 
+        TInt aClientSideManagerId )
+    {    
+    TInt sharedTextureReferenceCount = 0;
+    TInt toBeRemovedIndex = KErrNotFound;
+
+    // Look for an existing entry for the id, it has
+    // to be released. 
+    for(TInt i = 0; i < iUsedTextures.Count(); i++)
+        {
+        if (aClientSideManagerId == 0)
+            {
+            // Normal texture, "private" to client
+            if(iUsedTextures[i].iClientSideId == aClientSideId &&
+               iUsedTextures[i].iOwnerId == aClientOwnerId &&
+               iUsedTextures[i].iReleased)
+                {
+                toBeRemovedIndex = i;
+                break;
+                }
+            }
+        else
+            {
+            // Shared texture
+            if(iUsedTextures[i].iClientSideId == aClientSideId &&
+               iUsedTextures[i].iClientSideManagerId == aClientSideManagerId  &&
+               iUsedTextures[i].iReleased)               
+                {
+                if (iUsedTextures[i].iOwnerId == aClientOwnerId)
+                    {
+                    toBeRemovedIndex = i;
+                    }
+                sharedTextureReferenceCount++;
+                }                                                
+            }    
+        }
+
+    if (toBeRemovedIndex != KErrNotFound)
+        {
+        iUsedTextures[toBeRemovedIndex].iDeleted = ETrue;
+        iUsedTextures[toBeRemovedIndex].iSkinChangeCoordinator = EFalse;
+        if (sharedTextureReferenceCount > 0)
+            {
+            sharedTextureReferenceCount--;    
+            }
+        }
+    return sharedTextureReferenceCount;
+    }
+
+// ---------------------------------------------------------------------------
+// After skin change event this function determines if given texture content
+// is valid or not.
+//
+// Return value 0 indicates invalid, other valid.
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfSrvTextureManager::ValidateSkinForTextureId(
+        const TProcessId& aClientOwnerId,
+        TInt aClientSideId, 
+        TInt aClientSideManagerId )
+    {
+    TInt ownEntryIndex = -1;
+    TInt retVal = 0;
+
+    // Look for an existing entry for the id.
+    for(TInt i = 0; i < iUsedTextures.Count(); i++)
+        {
+        if (aClientSideManagerId == 0)
+            {
+            // Normal texture, "private" to client
+            if(iUsedTextures[i].iClientSideId == aClientSideId &&
+               iUsedTextures[i].iOwnerId == aClientOwnerId &&
+               iUsedTextures[i].iReleased == EFalse)
+                {                
+                retVal = 0; // Not shared texture, always invalid.
+                break;
+                }                
+            }
+        else
+            {
+            // Shared texture
+            if(iUsedTextures[i].iClientSideId == aClientSideId &&
+               iUsedTextures[i].iClientSideManagerId == aClientSideManagerId &&
+               iUsedTextures[i].iReleased == EFalse)
+                {
+                if (iUsedTextures[i].iOwnerId == aClientOwnerId)
+                    {
+                    ownEntryIndex = i;
+                    }
+                else
+                    {
+                    if (iUsedTextures[i].iSkinChangeCoordinator)
+                        {
+                        retVal = 1; // For shared textures, only one entry is invalid to avoid multiple reloads.   
+                        break;
+                        }                        
+                    }    
+                }                                
+            }    
+        }
+
+    if (retVal == 0 && ownEntryIndex != -1)
+        {
+        // This index becomes the one that handles skin change
+        iUsedTextures[ownEntryIndex].iSkinChangeCoordinator = ETrue;    
+        }
+
+    return retVal;        
+    }
+
+// ---------------------------------------------------------------------------
+// Destroyes deleted texture ids.
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfSrvTextureManager::DestroyDeletedTextureIds(const TProcessId& aOwnerId)
+    {    
+    // Look for an existing entry for the id.
+    TInt i = 0;
+    for(i = 0; i < iUsedTextures.Count(); i++)
+        {
+        if (iUsedTextures[i].iDeleted &&
+            iUsedTextures[i].iClientSideManagerId == 0 &&
+            iUsedTextures[i].iOwnerId == aOwnerId)
+            {
+            iUsedTextures.Remove(i);
+            i = 0;                
+            }
+        }
+        
+    return 0;    
+    }
+
+// ---------------------------------------------------------------------------
+// Adds client item to iClients array.
+// ---------------------------------------------------------------------------
+// 
+void CAlfSrvTextureManager::AddClientL( 
+        const TProcessId& aClientOwnerId, 
+        MAlfSrvTextureManagerClient& aClient )
+    {
+    if ( FindClient( aClient ) == KErrNotFound )
+        {
+        TClientItem item;
+        item.iOwnerId = aClientOwnerId;
+        item.iClient = &aClient;
+        item.iIsMarked = EFalse;
+        
+        iClients.AppendL( item );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Removes client item from iClients array
+// ---------------------------------------------------------------------------
+// 
+void CAlfSrvTextureManager::RemoveClient( MAlfSrvTextureManagerClient& aClient )
+    {
+    TInt pos = FindClient( aClient );
+    if ( pos != KErrNotFound )
+        {
+        iClients.Remove( pos );
+        }
+    }
+        
+CAlfSrvTextureManager::CAlfSrvTextureManager()
+    : iNextTextureId( 1 ),
+      iUsedTextures( 4 ),
+      iClients( KAlfSrvClientsGranularity )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Finds client side texture id based on server side id. Returns also
+// owner id so that it's possible to find corresponding session instance.
+// ---------------------------------------------------------------------------
+// 
+TBool CAlfSrvTextureManager::FindByTextureId( 
+        TInt aServerSideId,
+        TInt& aClientSideId,
+        TProcessId& aOwnerId ) const
+    {
+    TBool found = EFalse;
+    
+    const TInt count = iUsedTextures.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        const TUsedTexture& current = iUsedTextures[ i ];
+        if ( !current.iClientSideManagerId && 
+             current.iServerSideId == aServerSideId )
+            {
+            found = ETrue;
+            aClientSideId = current.iClientSideId;
+            aOwnerId = current.iOwnerId;
+            break;
+            }
+        }   
+    
+    return found;
+    }
+
+// ---------------------------------------------------------------------------
+// Finds index of aClient from iClients array
+// ---------------------------------------------------------------------------
+//
+TInt CAlfSrvTextureManager::FindClient( 
+        MAlfSrvTextureManagerClient& aClient ) const
+    {
+    TInt pos = KErrNotFound;
+    const TInt count = iClients.Count();
+    
+    for ( TInt i = 0; i < count; i++ )
+        {
+        if ( iClients[ i ].iClient == &aClient )
+            {
+            pos = i;
+            break;
+            }
+        }
+        
+    return pos;
+    }
+    
+// ---------------------------------------------------------------------------
+// Finds client interface corresponding to aOwnerId from iClients array
+// ---------------------------------------------------------------------------
+//
+MAlfSrvTextureManagerClient* CAlfSrvTextureManager::FindClientAndMark( 
+        const TProcessId& aOwnerId )
+    {
+    MAlfSrvTextureManagerClient* result = NULL;
+    const TInt count = iClients.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        if ( iClients[ i ].iOwnerId == aOwnerId )
+            {
+            result = iClients[ i ].iClient;
+            iClients[ i ].iIsMarked = ETrue;
+            break;
+            }
+        }
+    
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// Inform marked clients of completion of texture size changes. Clear marks.
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvTextureManager::NotifyTextureSizeChangesCompleted()
+    {
+    const TInt count = iClients.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        if ( iClients[ i ].iIsMarked )
+            {
+            iClients[ i ].iIsMarked = EFalse;
+            iClients[ i ].iClient->TextureSizeChangesCompleted();
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Calculates index (currently 0 .. 4) from very low .. very high.
+// ---------------------------------------------------------------------------
+//
+TInt CAlfSrvTextureManager::IndexFromParameter( TInt aValue )
+    {
+    // Note: this method makes assumptions about 
+    //       THuiTextureAutoSizeParams.
+
+    // Now make range positive (0 .. 40).
+    TInt result = aValue - THuiTextureAutoSizeParams::EVeryLow;
+    
+    // Transfer to index (0 .. 4).
+    const TInt KAlfTextureStepSize = 10;
+    result /= KAlfTextureStepSize;
+    
+    // Now make sure that value is in specified range (0 .. 4).
+    return Max( 0, Min( result, 4 ) );
+    }
+
+// ---------------------------------------------------------------------------
+// Checks if value (=width/height) should be resized.
+// ---------------------------------------------------------------------------
+//
+TBool CAlfSrvTextureManager::CheckIfShouldResize( 
+        TInt aCurrentValue, TInt aNewValue, const CHuiTexture& aTexture )
+    {
+    const THuiTextureAutoSizeParams params = aTexture.AutoSizeParams();
+
+    const TInt delta = Abs( aNewValue - aCurrentValue ); 
+    TInt minChangeInPixels = 
+        KAlfTextureManagerAutoSizeMinSizeChange[ 
+            IndexFromParameter( params.MinSizeChange() ) ];
+    
+    if ( delta < minChangeInPixels )
+        {
+        // No need to perform complex calculation - no need to resize.
+        return EFalse;
+        }
+    
+    TInt sizeRelativeThreshold = 0;
+    if ( aNewValue < aCurrentValue )
+        {
+        sizeRelativeThreshold = 
+            KAlfTetureManagerAutoSizeRelativeThresholdLower[ 
+                IndexFromParameter( params.SizeLowerThreshold() ) ];
+        }
+    else
+        {
+        sizeRelativeThreshold = 
+            KAlfTetureManagerAutoSizeRelativeThresholdUpper[ 
+                IndexFromParameter( params.SizeUpperThreshold() ) ];
+        }
+
+    TInt downsizeSettleThresholdInPixels = 
+            KAlfTextureManagerAutoSizeDownsizeSettleThreshold[
+                IndexFromParameter( params.DownsizeSettleThreshold() ) ];
+
+    // So if size is becoming smaller and icon is already small,
+    // then resize less aggressively.
+    TInt64 threshold = 0;
+    
+    // Calculate 1 * change
+    threshold = aCurrentValue;
+    threshold *= sizeRelativeThreshold;
+    
+    if ( aCurrentValue <= downsizeSettleThresholdInPixels && 
+         aNewValue < aCurrentValue )
+        {
+        // 2 * specified change
+        threshold *= 2;
+        }
+    
+    // 256 = 1.f, so normalize back to integers.
+    threshold /= 256;
+    
+    // Handle overflow
+    if ( threshold > KMaxTInt )
+        {
+        threshold = KMaxTInt;
+        }
+        
+    const TInt requiredChange = I64INT( threshold );
+    const TBool result = delta >= requiredChange;
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// Checks if resizing is needed.
+// ---------------------------------------------------------------------------
+//
+TBool CAlfSrvTextureManager::CheckIfResizeNeeded(
+        const TSize& aCurrentSize,
+        const TSize& aNewSize,
+        const CHuiTexture& aTexture,
+        TInt& aDeliveryPriority )
+    {
+    // If new size would become zero size, then don't resize.
+    if ( !aNewSize.iWidth || !aNewSize.iHeight )
+        {
+        return EFalse;
+        }
+
+    // Otherwise check if width or height has changed sufficiently.
+    // (also, one possibility would be to check area)
+    const TBool result = 
+        CheckIfShouldResize( aCurrentSize.iWidth, aNewSize.iWidth, 
+            aTexture ) ||
+        CheckIfShouldResize( aCurrentSize.iHeight, aNewSize.iHeight, 
+            aTexture );
+
+    if ( result )
+        {
+        if ( aNewSize.iWidth > aCurrentSize.iWidth ||
+             aNewSize.iHeight > aCurrentSize.iHeight )
+            {
+            // If it's becoming larger, let's change immediately.
+            aDeliveryPriority = 0;
+            }
+        else
+            {
+            // If it's becoming smaller, then it's not so urgent.
+            aDeliveryPriority = 1;
+            }
+        }
+        
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// Rounds real value to integer. Also HWA can be taken into account.
+// ---------------------------------------------------------------------------
+//
+inline TInt CAlfSrvTextureManager::RoundToInteger( const TReal32& aValue ) const
+    {
+    TInt value = HUI_ROUND_FLOAT_TO_INT( aValue );
+    if ( value < 0 )
+        {
+        value = 0;
+        }
+        
+    if ( iIsRendererHWA && 
+         ( value > KAlfSrvTextureManagerAutoSizeLowBoundary ) )
+        {
+        // Select appropriate rounding precision.
+        TInt roundTo = KAlfSrvTextureManagerAutoSizeMiddleRoundTo;
+        if ( value > KAlfSrvTextureManagerAutoSizeHighBoundary )
+            {
+            roundTo = KAlfSrvTextureManagerAutoSizeHighRoundTo;
+            }
+            
+        const TInt remainder = value & ( roundTo - 1 );
+        if ( remainder )
+            {
+            // Round to next multiple of 'roundTo'.
+            value -= remainder;
+            value += roundTo;
+            }
+        }
+    
+    return value;
+    }
+
+// ---------------------------------------------------------------------------
+// Calculates new size if resizing is needed.
+// ---------------------------------------------------------------------------
+//
+TBool CAlfSrvTextureManager::CalculateNewSizeIfResizeNeeded( 
+        const CHuiTexture& aTexture, 
+        const THuiRealSize& aPreferredSize,
+        const TSize& aCurrentSize,
+        TSize& aNewSize,
+        TInt& aDeliveryPriority ) const
+    {
+    // Calculate preferred size.
+    const TSize preferredSize( 
+        RoundToInteger( aPreferredSize.iWidth ),
+        RoundToInteger( aPreferredSize.iHeight ) );
+
+    // First, if texture does not have content, then we must resize and
+    // let's then use highest priority.
+    TInt deliveryPriority = -1;
+    TBool result = !aTexture.HasContent();
+        
+    if ( !result )
+        {
+        result = 
+            CheckIfResizeNeeded( aCurrentSize, preferredSize, aTexture,
+                deliveryPriority );
+        }
+    
+    if ( result )
+        {
+        aNewSize = preferredSize;
+        aDeliveryPriority = deliveryPriority;
+        }
+        
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// Handles a set of texture preferred properties.
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvTextureManager::HandlePreferredSizeChanged( 
+        MAlfSrvTextureManagerClient& aClient, 
+        TInt aClientSideTextureId,
+        const CHuiTexture& aTexture, 
+        const THuiRealSize& aPreferredSize )
+    {    
+    // Get information about current size from client.
+    TSize currentSize;
+    TBool hasDelivered;
+    TBool ok = aClient.GetTextureSize( 
+        aClientSideTextureId, currentSize, hasDelivered );
+    
+    // Determine new size.
+    TSize newSize;
+    
+    TBool currentSizeIsTextureSize = EFalse;
+    if ( !( ok && hasDelivered ) )
+        {
+        currentSizeIsTextureSize = ETrue;
+        currentSize = aTexture.Size();
+        }
+
+    TInt deliveryPriority = 0;
+    
+    if ( CalculateNewSizeIfResizeNeeded( 
+            aTexture, 
+            aPreferredSize, 
+            currentSize, 
+            newSize,
+            deliveryPriority ) )
+        {
+        // Update size to client
+        aClient.SetTextureSize( 
+            aClientSideTextureId, newSize, deliveryPriority );
+        }
+    else        
+        {
+        // If current texture size is acceptable, then 
+        // no need to report new size.
+        if ( currentSizeIsTextureSize )
+            {
+            // Instead, now we can remove the whole texture size.
+            aClient.RemoveTextureSize( aClientSideTextureId );
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Handles one by one texture preferred properties.
+// ---------------------------------------------------------------------------
+//
+TBool CAlfSrvTextureManager::PreferredSizeChanged(
+        const CHuiTexture& aTexture, 
+        TInt aServerSideTextureId, 
+        const THuiRealSize& aPreferredSize )
+    {
+    TInt clientSideId = 0;
+    TProcessId ownerId;
+    TBool result = EFalse;
+
+    // Find corresponding server side texture id
+    if ( FindByTextureId( aServerSideTextureId, clientSideId, ownerId ) )
+        {
+        // Find client interface
+        MAlfSrvTextureManagerClient* client = FindClientAndMark( ownerId );
+        if ( client )
+            {
+            // Decide size
+            HandlePreferredSizeChanged( *client, clientSideId, aTexture, 
+                aPreferredSize );
+            result = ETrue; 
+            }
+        }
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// Inform all clients of completion. This one also clears marks.
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvTextureManager::PreferredSizeReportCompleted()
+    {
+    NotifyTextureSizeChangesCompleted();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfsrvtranseffect.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,446 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Transition effect framework
+*
+*/
+
+
+
+
+
+#include "alflogger.h"
+#include "alf/alfappserver.h"
+#include "alf/alfappui.h"
+#include "alf/alfconstants.h"
+#include "alfsrvdisplaysubsession.h"
+#include "alfsrvcontrolgroupsubsession.h"
+#include "alfsrvsettingshandler.h"
+
+#include <coemain.h>
+#include <mm/mmcleanup.h>
+#include <pslninternalcrkeys.h>
+#include <centralrepository.h>
+#include <akntranseffect.h> 
+
+#include <uiacceltk/HuiControl.h>
+#include <uiacceltk/HuiControlGroup.h>
+#include <uiacceltk/HuiDisplay.h>
+#include <uiacceltk/HuiDisplayCoeControl.h>
+#include <uiacceltk/HuiEnv.h>
+#include <uiacceltk/HuiTextVisual.h>
+#include <uiacceltk/HuiTransformation.h>
+#include <uiacceltk/HuiBorderBrush.h>
+#include <uiacceltk/HuiImageVisual.h>
+#include <uiacceltk/HuiGridLayout.h>
+#include <uiacceltk/HuiTextureProcessor.h>
+#include <uiacceltk/HuiSegmentedTexture.h>
+
+
+#include "alfsrvtranseffect.h"
+
+
+// ============================ LOCAL CLASS ===============================
+
+/**
+ * This helper class implements listener for any CenRep key. 
+ *
+ */
+NONSHARABLE_CLASS( CAlfCenRep ) : public CActive
+    {
+public:  // New  
+    static CAlfCenRep* NewL( TInt aPriority, const TUid& aRepository, TUint32 aKey );
+    ~CAlfCenRep();
+    
+    /**
+     * Gets the current stored value of the key.
+     */
+    TInt GetValue( TInt& aValue );
+    
+private: // From CActive
+    void RunL();
+    void DoCancel();
+    
+private: // New
+    CAlfCenRep( TInt aPriority, const TUid& aRepository, TInt aKey );
+    void ConstructL();
+
+private: // Data
+	CRepository *iCenRep;
+    TUid iRepository;
+    TInt iKey;
+    TInt iValue;
+    TInt iError;
+    };
+
+
+// ============================ LOCAL CLASS MEMBER FUNCTIONS ================
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CAlfCenRep::CAlfCenRep( TInt aPriority, const TUid& aRepository, TInt aKey ) :
+    CActive( aPriority ),
+    iRepository( aRepository ),
+    iKey( aKey )
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CAlfCenRep::ConstructL()
+    {
+    iCenRep = CRepository::NewL( iRepository );
+    CActiveScheduler::Add( this );
+    RunL();
+    }
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CAlfCenRep* CAlfCenRep::NewL( TInt aPriority, const TUid& aRepository, TUint32 aKey )
+    {
+    CAlfCenRep* self = new (ELeave) CAlfCenRep( aPriority, aRepository, aKey );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CAlfCenRep::~CAlfCenRep()
+    {
+    Cancel();
+    delete iCenRep;
+    }
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CAlfCenRep::RunL()
+    {
+    TInt value;
+    iError = iCenRep->Get( iKey, value );
+    if( iError == KErrNone )
+    	{
+    	iValue = value;
+    	}
+    iError = iCenRep->NotifyRequest( iKey, iStatus );
+    
+    if( iError == KErrNone )
+    	{
+    	SetActive();
+    	}
+    }
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfCenRep::GetValue( TInt& aValue )
+	{
+	if(iError != KErrNone) //if we had an error eariler
+		{
+		TInt value;
+		iError = iCenRep->Get( iKey, value ); //try to get the value
+		if(iError == KErrNone)
+			{
+			iValue = value;
+			iError = iCenRep->NotifyRequest( iKey, iStatus ); //try to start request
+			if(iError == KErrNone)
+				{
+				SetActive();
+				}
+			}
+		}
+	aValue = iValue;
+	return iError;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CAlfCenRep::DoCancel()
+    {
+    iCenRep->NotifyCancel( iKey );
+    }
+
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructors
+// ---------------------------------------------------------------------------
+//
+CAlfSrvTransEffect::CAlfSrvTransEffect()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CAlfSrvTransEffect* CAlfSrvTransEffect::NewL()
+    {
+    CAlfSrvTransEffect* me = new (ELeave) CAlfSrvTransEffect();
+    CleanupStack::PushL(me);
+    me->ConstructL();
+    CleanupStack::Pop();
+    return me;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvTransEffect::ConstructL()
+    {    
+    // Load transition effect plugins
+	PopulateEffectArrayL();
+    
+    if (iEffectPlugins.Count() > 0)
+    	{
+    	iIsEnabled = ETrue;
+    	}
+        
+    // Start listening Avkon effect system state 
+    iAvkonTfxStateListener = CAlfCenRep::NewL( 
+    	EPriorityHigh, KCRUidThemes, KThemesTransitionEffects );   
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvTransEffect::~CAlfSrvTransEffect()
+    {
+    delete iAvkonTfxStateListener;
+    
+	iEffectPlugins.ResetAndDestroy();
+	
+	iEffectMap.Close();
+    
+   	REComSession::FinalClose(); 
+    }
+
+
+// -----------------------------------------------------------------------------
+// Get a list of plugin implementations via ECom, construct the plugins and 
+// add them to the array.
+// -----------------------------------------------------------------------------
+//
+void CAlfSrvTransEffect::PopulateEffectArrayL()
+	{
+	// Get a list of all plugins from ECom
+	TEComResolverParams resolverParams;
+	resolverParams.SetDataType ( KAlfTransEffectPluginTypeStringDesc );
+	resolverParams.SetWildcardMatch ( EFalse );
+	RImplInfoPtrArray implInfoArray;
+	REComSession::ListImplementationsL( KAlfTransEffectPluginInterfaceUid, 
+		resolverParams, implInfoArray );
+	CleanupResetAndDestroyPushL( implInfoArray ); // Note: intentionally called only after ListImplementationsL()
+    
+	__ALFLOGSTRING1("ALF: CAlfSrvTransEffect::PopulateExtensionArrayL(): extension count: %d",
+		implInfoArray.Count())
+	
+	// Create each plugin via ECom and add it to the list 
+	for ( TInt i = 0; i < implInfoArray.Count(); i++ )
+		{		
+		MAlfTransEffectPlugin* plugin = NULL;
+		
+		// Trap the construction as if one plugin fails to construct it 
+		// should not stop others from constructing
+		TRAPD( error, plugin = reinterpret_cast <MAlfTransEffectPlugin*> ( REComSession::CreateImplementationL( 
+			implInfoArray[i]->ImplementationUid(), _FOFF (MAlfTransEffectPlugin, iDtor_ID_Key) ) ) );
+	
+		TInt countAddedEffects = 0;
+		if ( !error && ( plugin != NULL ) )
+			{
+			RArray<TInt> effectIds;
+			CleanupClosePushL( effectIds );
+			
+			plugin->GetSupportedEffects( effectIds );
+			TInt count = effectIds.Count();
+			if ( count > 0 )
+				{
+				for ( TInt ii = 0; ii < count; ii++ )
+					{
+					TInt mapError = iEffectMap.InsertInSignedKeyOrder( CAlfSrvTransEffect::TEffectMapItem( effectIds[ii], plugin ) );
+					if ( mapError == KErrNone ) 
+						{
+						countAddedEffects++;
+						}
+					else // You cannot insert duplicate effects (with same effect ID)
+						{
+						__ALFLOGSTRING3("Alf: CAlfSrvTransEffect::PopulateExtensionArrayL. Cannot insert effect id to the map array. Imp.uid=%d, effect id=%d, error=%d", 						
+							implInfoArray[i]->ImplementationUid().iUid, effectIds[ii], error)
+						}
+					}
+				}
+			CleanupStack::PopAndDestroy( &effectIds );
+			}
+		
+		// Add plugin to the array if it has at least one effect that has been
+		// successfully registered.	
+		if ( !error && ( plugin != NULL ) && ( countAddedEffects > 0 ) )
+			{
+			iEffectPlugins.AppendL( plugin );
+			}
+		else
+			{
+			// If the plugin is failing we skip that.
+			__ALFLOGSTRING3("Alf: CAlfSrvTransEffect::PopulateExtensionArrayL. Cannot add plugin, uid=%d, error=%d, plugin=%d", 
+				implInfoArray[i]->ImplementationUid().iUid, error, plugin )
+			__ALFLOGSTRING1("                                                  countAddedEffects=%d", 
+				countAddedEffects )
+			delete( plugin );
+			}		
+		} // for
+
+	CleanupStack::PopAndDestroy( &implInfoArray );
+	}
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CAlfSrvTransEffect::IsEnabled()
+	{
+	TInt value;
+	iAvkonTfxStateListener->GetValue( value );
+	TBool isAvkonEffectsEnabled = ( value != KMaxTInt );
+	return( iIsEnabled &&  !isAvkonEffectsEnabled );
+	}    
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CAlfSrvTransEffect::StartPhase( 
+    TInt aPhaseId, TInt aContext, 
+    CAlfSrvEffectEnv& aEffectEnv, 
+    TInt /*aUidValue*/, 
+    TInt /*aKey*/, 
+    TInt /*aUidValue2*/, 
+    TInt /*aKey2*/, 
+    const TDesC8* aParams)
+	{
+	if ( IsEnabled() )
+		{		
+		// Find the plugin which implements the effect related to this context and call it
+		MAlfTransEffectPlugin* plugin = NULL;
+		if ( FindPlugin( aContext,  &plugin ) == KErrNone )
+			{
+			// Update state
+			iCurrContext = aContext;
+			iCurrPhase = aPhaseId;
+			
+			// Call plugin
+			ASSERT( plugin != NULL );
+			plugin->StartPhase( aPhaseId, aContext, aEffectEnv, aParams );
+			}
+		}
+		
+	return KErrNone;	
+	}    
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CAlfSrvTransEffect::Abort( TInt /*aContext*/, TInt /*aUidValue*/, TInt /*aKey*/ )
+	{
+	return KErrNone;
+	}    
+    
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CAlfSrvTransEffect::SetProperty( TInt /*aProperty*/, TInt /*aValue*/, TInt /*aUidValue*/, TInt /*aKey*/ )
+	{
+	return KErrNone;
+	}    
+    
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CAlfSrvTransEffect::GetProperty( TInt /*aProperty*/, TInt& /*aValue*/, TInt /*aUidValue*/, TInt /*aKey*/ )
+	{
+	return KErrNone;
+	}    
+    
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CAlfSrvTransEffect::AddEventObserver( MAlfTransEffectObserver* /*aObserver*/, TInt /*aEvents*/, const TDesC8* /*aParams*/ )
+	{
+	return KErrNone;
+	}    
+    
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CAlfSrvTransEffect::RemoveEventObserver( MAlfTransEffectObserver* /*aObserver*/, TInt /*aEvents*/ )
+	{
+	return KErrNone;
+	}    
+   
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CAlfSrvTransEffect::GetEventState( TInt /*aEvent*/, TInt* /*aState*/, TDes8* /*aParams*/ )
+	{
+	return KErrNotReady;
+	}    
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CAlfSrvTransEffect::FindPlugin( TInt aContext, MAlfTransEffectPlugin** aPlugin ) 
+	{
+	// Note: Now the context id is the same as effect id, but this can change in the future
+	CAlfSrvTransEffect::TEffectMapItem item( aContext, NULL );
+	TInt index;
+	if ( iEffectMap.FindInSignedKeyOrder( item, index ) == KErrNone )
+		{
+		*aPlugin = iEffectMap[index].iPluginPtr;
+		return KErrNone;
+		}
+	else
+		{
+		return KErrNotFound;
+		}
+	}    
+    
+    
+
+// End of file    
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfsrvtransformationsubsession.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,419 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Transformation sub session
+*
+*/
+
+
+
+#include "alfsrvtransformationsubsession.h"
+#include "alf/alfconstants.h"
+#include "alf/alfappsrvsessionbase.h"
+#include "alfappsrvsession.h"
+#include "alf/alfserverutils.h"
+#include <uiacceltk/HuiEnv.h>
+#include <uiacceltk/HuiTransformation.h>
+#include <uiacceltk/HuiUtil.h>
+#include <alf/alftransformation.h>
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvTransformationSubSession::CAlfSrvTransformationSubSession( 
+    CAlfAppSrvSessionBase& aSession )
+    : CAlfSrvSubSessionBase( aSession )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phasse constructor
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvTransformationSubSession::ConstructL()
+    {
+    CAlfSrvSubSessionBase::ConstructL();
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfSrvTransformationSubSession* CAlfSrvTransformationSubSession::NewL( 
+    CAlfAppSrvSessionBase& aSession )
+    {
+    CAlfSrvTransformationSubSession* self = 
+        CAlfSrvTransformationSubSession::NewLC( aSession );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//
+CAlfSrvTransformationSubSession* CAlfSrvTransformationSubSession::NewLC( 
+    CAlfAppSrvSessionBase& aSession )
+    {
+    CAlfSrvTransformationSubSession* self = 
+        new( ELeave ) CAlfSrvTransformationSubSession( aSession );
+    CleanupClosePushL( *self );
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvTransformationSubSession::~CAlfSrvTransformationSubSession()
+    {
+    iTransformation= NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Gets transformation
+// ---------------------------------------------------------------------------
+//
+CHuiTransformation& CAlfSrvTransformationSubSession::Transformation()
+    {
+    __ASSERT_ALWAYS( iTransformation, USER_INVARIANT() );
+    return *iTransformation;
+    }
+    
+// ---------------------------------------------------------------------------
+// Sets transformation
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvTransformationSubSession::SetTransformation( 
+    CHuiTransformation* aTransformation )
+    {
+    iTransformation = aTransformation;
+    }
+    
+// ---------------------------------------------------------------------------
+// Reset matrix
+// ---------------------------------------------------------------------------
+// 
+void CAlfSrvTransformationSubSession::LoadIdentityL(const RMessage2& aMessage)
+    {
+    // Load identity
+    Transformation().LoadIdentity();
+    
+    // Complete
+    aMessage.Complete( KErrNone );
+    }
+    
+// ---------------------------------------------------------------------------
+// Translate
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvTransformationSubSession::TranslateL(const RMessage2& aMessage)
+    {
+    // Parser parameters
+
+    // 1: x (in)
+    TReal32 x(0.0);
+    TPckg<TReal32> xRealPckg(x);
+    aMessage.Read(1,xRealPckg);
+    // 2: y (in)
+    TReal32 y(0.0);
+    TPckg<TReal32> yRealPckg(y);
+    aMessage.Read(2,yRealPckg);
+    
+    // Translate
+    Transformation().Translate( x, y );
+    
+    // Complete
+    aMessage.Complete( KErrNone );
+    }
+  
+// ---------------------------------------------------------------------------
+// Rotate
+// ---------------------------------------------------------------------------
+//  
+void CAlfSrvTransformationSubSession::RotateL(const RMessage2& aMessage)
+    {
+    // Parser parameters
+
+    // 1: angle (in)
+    TAlfTimedValue alf_angle;
+    TPckg<TAlfTimedValue> anglePckg(alf_angle);
+    aMessage.Read(1,anglePckg);
+    
+    THuiTimedValue angle;
+    AlfTimedValueUtility::CopyTimedValue(alf_angle, angle, Session());    
+    
+    // Rotate
+    Transformation().Rotate( angle );
+    
+    // Complete
+    aMessage.Complete( KErrNone );
+    }
+    
+// ---------------------------------------------------------------------------
+// Count
+// ---------------------------------------------------------------------------
+//  
+void CAlfSrvTransformationSubSession::CountL(const RMessage2& aMessage)
+    {
+    TInt count = 0;
+    TPckg<TInt> outputPckg(count);    
+        
+    // Count
+    count = Transformation().Count();
+    
+    // Write output params
+    aMessage.Write(1,outputPckg);    
+    
+    // Complete
+    aMessage.Complete( KErrNone );
+    }
+
+// ---------------------------------------------------------------------------
+// NonIdentityCount
+// ---------------------------------------------------------------------------
+//  
+void CAlfSrvTransformationSubSession::NonIdentityCountL(const RMessage2& aMessage)
+    {
+    TInt count = 0;
+    TPckg<TInt> outputPckg(count);    
+        
+    // Count
+    count = Transformation().NonIdentityCount();
+    
+    // Write output params
+    aMessage.Write(1,outputPckg);    
+    
+    // Complete
+    aMessage.Complete( KErrNone );
+    }
+
+// ---------------------------------------------------------------------------
+// Step
+// ---------------------------------------------------------------------------
+//  
+void CAlfSrvTransformationSubSession::StepL(const RMessage2& aMessage)
+    {
+    // 1: Index (in) 
+    TInt index = aMessage.Int1();
+    
+    // 2: Transform step (out)
+    CAlfTransformation::TTransform step;
+    TPckg<CAlfTransformation::TTransform> outputPckg(step);    
+               
+    // Step
+    CHuiTransformation::TTransform huiStep = Transformation().Step(index);
+    step.iType = (CAlfTransformation::TType)huiStep.iType;
+    for (TInt i=0; i<KHuiTransformParamCount; i++)
+        {
+        AlfTimedValueUtility::CopyTimedValue(huiStep.iParams[i], step.iParams[i]);    
+        step.iParams[i].Flags() = EAlfValueFlagsNone; // clear flags so client will send only changed values back         
+        }
+    
+    // Write output params
+    aMessage.Write(2,outputPckg);    
+    
+    // Complete
+    aMessage.Complete( KErrNone );
+    }
+
+// ---------------------------------------------------------------------------
+// ReplaceStep
+// ---------------------------------------------------------------------------
+//  
+void CAlfSrvTransformationSubSession::ReplaceStepL(const RMessage2& aMessage)
+    {
+    // 1: Index (in) 
+    TInt index = aMessage.Int1();
+    
+    // 2: Transform step (in)
+    CAlfTransformation::TTransform step;
+    TPckg<CAlfTransformation::TTransform> stepPckg(step);    
+    aMessage.Read(2,stepPckg);               
+    
+    // ReplaceStep
+    CHuiTransformation::TTransform& huiStep = Transformation().Step(index); 
+    huiStep.iType = (CHuiTransformation::TType)step.iType;
+    for (TInt i=0; i<KHuiTransformParamCount; i++)
+        {
+        AlfTimedValueUtility::CopyTimedValue(step.iParams[i], huiStep.iParams[i], Session());    
+        }    
+    
+    // Complete
+    aMessage.Complete( KErrNone );
+    }
+
+// ---------------------------------------------------------------------------
+// Rotate (3D version of the function)
+// ---------------------------------------------------------------------------
+//  
+void CAlfSrvTransformationSubSession::Rotate3DL(const RMessage2& aMessage)
+    {
+    // Parse parameters
+
+    // 1: params (in)
+    TAlfTransformationRotateParams params;
+    TPckg<TAlfTransformationRotateParams> paramPckg(params);
+    aMessage.Read(1,paramPckg);
+    
+    THuiTimedValue angle;
+    AlfTimedValueUtility::CopyTimedValue(params.iAngle, angle, Session());    
+
+    // Rotate
+    Transformation().Rotate( angle, params.iAxisX, params.iAxisY, params.iAxisZ );
+    
+    // Complete
+    aMessage.Complete( KErrNone );
+    }
+
+
+// ---------------------------------------------------------------------------
+// Scale (3D version of the function)
+// ---------------------------------------------------------------------------
+//  
+void CAlfSrvTransformationSubSession::Scale3DL(const RMessage2& aMessage)
+    {
+    // Parse parameters
+
+    // 1: params (in)
+    TAlfTransformationTimedParams params;
+    TPckg<TAlfTransformationTimedParams> paramPckg(params);
+    aMessage.Read(1,paramPckg);
+    
+    THuiTimedValue x;
+    AlfTimedValueUtility::CopyTimedValue(params.iX, x, Session());    
+
+    THuiTimedValue y;
+    AlfTimedValueUtility::CopyTimedValue(params.iY, y, Session());    
+
+    THuiTimedValue z;
+    AlfTimedValueUtility::CopyTimedValue(params.iZ, z, Session());    
+
+    // Rotate
+    Transformation().Scale( x,y,z );
+    
+    // Complete
+    aMessage.Complete( KErrNone );
+    
+    }
+
+// ---------------------------------------------------------------------------
+// Translate  (2D version of the function with timedvalues)
+// ---------------------------------------------------------------------------
+//  
+void CAlfSrvTransformationSubSession::Translate2DL(const RMessage2& aMessage)
+    {
+    // Parse parameters
+
+    // 1: params (in)
+    TAlfTransformationTimedParams params;
+    TPckg<TAlfTransformationTimedParams> paramPckg(params);
+    aMessage.Read(1,paramPckg);
+    
+    THuiTimedValue x;
+    AlfTimedValueUtility::CopyTimedValue(params.iX, x, Session());    
+
+    THuiTimedValue y;
+    AlfTimedValueUtility::CopyTimedValue(params.iY, y, Session());    
+
+    // Rotate
+    Transformation().Translate( x,y );
+    
+    // Complete
+    aMessage.Complete( KErrNone );
+    }
+
+
+// ---------------------------------------------------------------------------
+// From CAlfSrvSubSessionBase
+// Process the message.
+// ---------------------------------------------------------------------------
+// 
+void CAlfSrvTransformationSubSession::DoProcessMessageL(const RMessage2& aMessage)
+    {
+    switch( aMessage.Int0() )
+        {
+        case EAlfTransformationLoadIdentity:
+            {
+            LoadIdentityL( aMessage );
+            break;
+            }
+        case EAlfTransformationTranslate:
+            {
+            TranslateL( aMessage );
+            break;
+            }
+        case EAlfTransformationRotate:
+            {
+            RotateL( aMessage );
+            break;
+            }
+
+        case EAlfTransformationCount:
+            {
+            CountL( aMessage );                
+            break;
+            }
+        case EAlfTransformationNonIdentityCount:
+            {
+            NonIdentityCountL( aMessage );     
+            break;
+            }
+        case EAlfTransformationStep:
+            {
+            StepL( aMessage );                
+            break;
+            }
+        case EAlfTransformationReplaceStep:
+            {
+            ReplaceStepL( aMessage );                                
+            break;
+            }
+        case EAlfTransformationRotate3D:
+            {
+            Rotate3DL( aMessage );                                                
+            break;
+            }
+        case EAlfTransformationTranslate2D:
+            {
+            Translate2DL( aMessage );                                                                
+            break;
+            }
+        case EAlfTransformationScale:
+            {
+            Scale3DL( aMessage );                                                                                
+            break;
+            }
+            
+        case EAlfTransformationSubSessionClose: // obsolete
+            {
+            Session().CloseSubSession( aMessage );
+            break;
+            }            
+        default:
+            CAlfSrvSubSessionBase::DoProcessMessageL( aMessage );
+            break;
+        }
+    }
+    
+ 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfsrvvisualowner.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,204 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Visual owner
+*
+*/
+
+
+
+#include "alfsrvvisualowner.h"
+#include "alf/alfappsrvsessionbase.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvVisualOwner::CAlfSrvVisualOwner( 
+    CAlfAppSrvSessionBase& aSession,
+    MHuiVisualOwner* aRealOwner )
+    : iSession( aSession ), iRealOwner( aRealOwner )
+    {
+    iVisualLayoutUpdatedNotificationId = KErrNotFound;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Second phase constructor
+// ---------------------------------------------------------------------------
+//
+void CAlfSrvVisualOwner::ConstructL()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvVisualOwner* CAlfSrvVisualOwner::NewL( 
+    CAlfAppSrvSessionBase& aSession,
+    MHuiVisualOwner* aRealOwner )
+    {
+    CAlfSrvVisualOwner* self = new( ELeave ) CAlfSrvVisualOwner( aSession, aRealOwner );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CAlfSrvVisualOwner::~CAlfSrvVisualOwner()
+    {
+    if ( iVisualLayoutUpdatedNotificationId != KErrNotFound )
+        {
+        iSession.CompleteCmd( iVisualLayoutUpdatedNotificationId , KErrCancel );
+        }
+    iRealOwner = NULL;
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// Return real owner
+// ---------------------------------------------------------------------------
+//    
+MHuiVisualOwner* CAlfSrvVisualOwner::RealOwner()
+    {
+    return iRealOwner;
+    }
+
+// ---------------------------------------------------------------------------
+// Set layout notification ID
+// ---------------------------------------------------------------------------
+//    
+void CAlfSrvVisualOwner::SetVisualLayoutUpdatedNotificationId( TInt aNotificationId )
+    {
+    ASSERT( iVisualLayoutUpdatedNotificationId == KErrNotFound );
+    if ( iVisualLayoutUpdatedNotificationId != KErrNotFound )
+        {
+        iSession.CompleteCmd( iVisualLayoutUpdatedNotificationId , KErrCancel );
+        }
+        
+    iVisualLayoutUpdatedNotificationId = aNotificationId;
+    }
+    
+// ---------------------------------------------------------------------------
+// Return environment
+// ---------------------------------------------------------------------------
+//
+CHuiEnv& CAlfSrvVisualOwner::Env() const
+    {
+    if ( iRealOwner )
+        {
+        return iRealOwner->Env();
+        }
+    return *iSession.SharedHuiEnv();
+    }
+
+// ---------------------------------------------------------------------------
+// Return control group
+// ---------------------------------------------------------------------------
+//    
+CHuiControlGroup* CAlfSrvVisualOwner::ControlGroup() const
+    {
+    if ( iRealOwner )
+        {
+        return iRealOwner->ControlGroup();
+        }
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// Return event handler of owner
+// ---------------------------------------------------------------------------
+//    
+MHuiEventHandler* CAlfSrvVisualOwner::EventHandler()
+    {
+    if ( iRealOwner )
+        {
+        return iRealOwner->EventHandler();
+        }
+    return NULL;
+    }
+    
+// ---------------------------------------------------------------------------
+// Append visual to owner
+// ---------------------------------------------------------------------------
+//    
+void CAlfSrvVisualOwner::AppendL(CHuiVisual* aVisual)
+    {
+    if ( iRealOwner )
+        {
+        iRealOwner->AppendL(aVisual);
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// Remove visual from owner
+// ---------------------------------------------------------------------------
+//    
+void CAlfSrvVisualOwner::Remove(CHuiVisual* aVisual)
+    {
+    if ( iRealOwner )
+        {
+        iRealOwner->Remove(aVisual);
+        }
+    }
+ 
+// ---------------------------------------------------------------------------
+// Return if visual destroyed
+// ---------------------------------------------------------------------------
+//   
+void CAlfSrvVisualOwner::VisualDestroyed(CHuiVisual& aVisual)
+    {
+    if ( iRealOwner )
+        {
+        iRealOwner->VisualDestroyed(aVisual);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Return if visual layout updated
+// ---------------------------------------------------------------------------
+//    
+void CAlfSrvVisualOwner::VisualLayoutUpdated(CHuiVisual& aVisual)
+    {
+    if ( iVisualLayoutUpdatedNotificationId != KErrNotFound )
+        {
+        iSession.CompleteCmd( iVisualLayoutUpdatedNotificationId , KErrNone );
+        iVisualLayoutUpdatedNotificationId = KErrNotFound;
+        }
+    if ( iRealOwner )
+        {
+        iRealOwner->VisualLayoutUpdated(aVisual);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Return if visual prepare draw failed
+// ---------------------------------------------------------------------------
+//    
+void CAlfSrvVisualOwner::VisualPrepareDrawFailed(CHuiVisual& aVisual, TInt aErrorCode)
+    {
+    if ( iRealOwner )
+        {
+        iRealOwner->VisualPrepareDrawFailed(aVisual,aErrorCode);
+        }
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfstaticfactory.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,523 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   factory for alf built-in hitchcock compenents
+*
+*/
+
+
+#include <e32cmn.h>
+#include <uiacceltk/HuiControl.h>
+#include <uiacceltk/HuiVisual.h>
+#include <uiacceltk/HuiLayout.h>
+#include <uiacceltk/HuiTexture.h>
+#include <uiacceltk/HuiEvent.h>
+#include <uiacceltk/HuiDisplay.h>
+#include <uiacceltk/HuiUtil.h>
+#include "alf/alfvisualhandlers.h"
+#include "alf/alflayouthandlers.h"
+#include "alf/alfbrushhandlers.h"
+#include "alftextstylehandlers.h"
+#include "alf/alfappsrvsessionbase.h"
+#include "alfstaticfactory.h"
+#include "alf/alfconstants.h"
+#include "alfmappingfunctionhandlers.h"
+#include "alf/alfmetric.h"
+
+
+CHuiVisual* FindLastHittingChild( const CHuiVisual& aParentVisual, 
+                                  const TPoint& aDisplayPoint )
+    {
+    // If we want that the pointer event are passed only to the visuals which 
+    // (effective) opacity is greater than 50%, this would be the place to 
+    // implement it.
+    for ( TInt i = aParentVisual.Count() - 1 ; i >= 0 ; i-- )
+        {
+        // DisplayRect() returns the current value of the rectange. If the pointer
+        // hit needs to be compared to the target rect, change this function call
+        // from DisplayRect() into DisplayRectTarget()
+        const TRect rect =  aParentVisual.Visual( i ).DisplayRect();
+        if ( rect.Contains( aDisplayPoint ) )
+            {
+            CHuiVisual* leaf = 
+                FindLastHittingChild( aParentVisual.Visual( i ), aDisplayPoint );
+            return leaf ? leaf : &aParentVisual.Visual( i );
+            }
+        }
+    return NULL;
+    }
+
+//----------------------------
+// Control, private so declaration directly here
+//----------------------------
+
+NONSHARABLE_CLASS(CAlfControl2): public CHuiControl
+    {
+public:
+    CAlfControl2(CHuiEnv& aSharedEnv, CAlfControl2** ptr, CAlfAppSrvSessionBase* aSession):
+        CHuiControl(aSharedEnv),
+        iPtr(ptr),
+        iSession(aSession)
+        {}
+        
+    TBool OfferEventL(const THuiEvent& aEvent)
+        {
+        if ( aEvent.IsPointerEvent() )
+            {
+            // Update event coordinates to match the "client rect" of the application
+            THuiEvent eventWithLocalCoordinates(aEvent); 
+            
+            // Set the iParentPosition coordinates to be ralative to the 
+            // visual aread of the display i.e  the root visuals. 
+            const TPoint clientDrawingAreaTl = iSession->ClientDrawingArea().iTl;
+            eventWithLocalCoordinates.iPointerEvent.iParentPosition -= clientDrawingAreaTl;
+            
+            if ( aEvent.Visual() )
+                {
+                // If visual is found, move the iPosition coordinates to be relative to the
+                // visual area.
+                const THuiRealRect realVisualArea = aEvent.Visual()->DisplayRect();
+                const TPoint intVisualTl( 
+                    HUI_ROUND_FLOAT_TO_INT( realVisualArea.iTl.iX ),
+                    HUI_ROUND_FLOAT_TO_INT( realVisualArea.iTl.iY ) );
+                 
+                eventWithLocalCoordinates.iPointerEvent.iPosition -= intVisualTl;
+                }
+            else
+                {
+                // If there is no accociated visual, set iPosotion coordinates to be relative to
+                // the display visual area.
+                eventWithLocalCoordinates.iPointerEvent.iPosition -= clientDrawingAreaTl;
+                }
+            
+            TBool isLongTap = aEvent.iPointerEvent.iType == TPointerEvent::EButtonRepeat;
+            if ( isLongTap )
+                {
+                iSession->StartPointerHandling();
+                }
+            iSession->HandleEventL(this, aEvent.Visual() , eventWithLocalCoordinates);
+            if ( isLongTap )
+                {
+                iSession->FlushPointerHandling();
+                }
+            }
+        return EFalse; // let env offer event to all ctrls it hits
+        }
+    
+    ~CAlfControl2()
+        {
+        *iPtr = 0;
+        
+        // Remove possbile pointer observers
+        if ( Env().DisplayCount() )
+            {
+            CHuiDisplay& disp = Env().PrimaryDisplay(); // assume one display
+            disp.Roster().Observers(EHuiInputPointerDrag).RemoveIfFound(*this);
+            disp.Roster().Observers(EHuiInputPointerLongTap).RemoveIfFound(*this);
+            disp.Roster().Observers(EHuiInputPointerUnhandled).RemoveIfFound(*this);
+            }
+        }
+    
+private:
+    CAlfControl2** iPtr;
+    CAlfAppSrvSessionBase* iSession;
+    };
+
+
+NONSHARABLE_CLASS(CAlfControlHandler): public CBase, public MAlfExtension
+    {
+public:
+    static MAlfExtension* NewL(const TDesC8& aInputBuffer, CHuiEnv& aSharedEnv, CAlfAppSrvSessionBase* aSession );
+private:    
+    void Release();
+    TAny* GetInterface(const THuiInterfaceSupport& aInterface);
+    void HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse);    
+    CAlfControl2* iControl;
+    ~CAlfControlHandler() 
+        { 
+        if (iControl && !iControl->ControlGroup())
+            {
+            delete iControl; 
+            }
+        }
+    };
+
+MAlfExtension* CAlfControlHandler::NewL(const TDesC8& /*aInputBuffer*/, CHuiEnv& aSharedEnv, CAlfAppSrvSessionBase* aSession)
+    {
+    CAlfControlHandler* me = new (ELeave) CAlfControlHandler();
+    CleanupStack::PushL(me);
+    me->iControl = new (ELeave) CAlfControl2(aSharedEnv, &me->iControl, aSession);
+    CleanupStack::Pop();
+    return me;
+    }
+
+void CAlfControlHandler::Release()
+    {
+    delete this;
+    }
+        
+TAny* CAlfControlHandler::GetInterface(const THuiInterfaceSupport& aInterface)
+    {
+    switch (aInterface)
+        {
+        case EHuiObjectTypeControl:
+            return static_cast<CHuiControl*>(iControl);
+        case EHuiInterfaceVisualOwner:
+            return static_cast<MHuiVisualOwner*>(iControl);
+        default:
+            return 0;
+                    
+        }
+          
+    }
+    
+void CAlfControlHandler::HandleCmdL(TInt /*aCommandId*/, const TDesC8& /*aInputBuffer*/, TDes8& /*aResponse*/)
+    {
+    }
+
+
+MAlfExtension* TAlfFixedFactory::CreateExtensionL(const TInt aObjectId, const TDesC8& aInitialParams, MAlfInterfaceProvider& aResolver )
+    {
+    
+    MAlfExtension* result = 0;
+    switch(aObjectId)
+        {
+        case EAlfCntrlCreate:
+            {
+            result = CAlfControlHandler::NewL(aInitialParams, *aResolver.SharedHuiEnv(), static_cast<CAlfAppSrvSessionBase*>(&aResolver));
+            break;
+            }
+        
+        case EAlfVisualCreate:
+        case EAlfTextVisualCreate:
+        case EAlfLCTTextVisualCreate:
+        case EAlfLayoutCreate:
+        case EAlfAnchorLayoutCreate:
+        case EAlfLCTAnchorLayoutCreate:
+        case EAlfDeckLayoutCreate:
+        case EAlfFlowLayoutCreate:
+        case EAlfCurvePathLayoutCreate:
+        case EAlfGridLayoutCreate:
+        case EAlfLCTGridLayoutCreate:
+        case EAlfViewportLayoutCreate:
+        case EAlfImageVisualCreate:
+        case EAlfLineVisualCreate:
+        case EAlfCanvasVisualCreate:
+            {
+            TInt2* params = (TInt2*)aInitialParams.Ptr();
+            
+            CHuiControl* owner = 0;
+            CHuiLayout* parentLayout = 0;
+            
+            if (!params->iInt1)
+                {
+                User::Leave(KErrArgument);
+                }
+            else
+                { // currently we must use concrete owner as interface does not provide means to 
+                  // transfer ownership
+                owner = (CHuiControl*) aResolver.GetInterfaceL(EHuiObjectTypeControl, params->iInt1 );    
+                } 
+                   
+            if (params->iInt2) // not compulsory
+                {
+                parentLayout = (CHuiLayout*) aResolver.GetInterfaceL(EHuiObjectTypeLayout, params->iInt2 ); 
+                }
+            
+            if (aObjectId == EAlfVisualCreate)
+                result = CAlfVisualHandler::NewL(aResolver, owner, parentLayout);
+            else if (aObjectId == EAlfTextVisualCreate)
+                result = CAlfTextVisualHandler::NewL(aResolver, owner, parentLayout);
+            else if (aObjectId == EAlfLCTTextVisualCreate)
+                result = CAlfLCTTextVisualHandler::NewL(aResolver, owner, parentLayout);
+            else if (aObjectId == EAlfImageVisualCreate)
+                result = CAlfImageVisualHandler::NewL(aResolver, owner, parentLayout);
+            else if (aObjectId ==EAlfLayoutCreate)
+                result = CAlfLayoutHandler::NewL(aResolver, owner, parentLayout);
+            else if (aObjectId ==EAlfAnchorLayoutCreate)
+                result = CAlfAnchorLayoutHandler::NewL(aResolver, owner, parentLayout);            
+            else if (aObjectId ==EAlfLCTAnchorLayoutCreate)
+                result = CAlfLCTAnchorLayoutHandler::NewL(aResolver, owner, parentLayout);            
+            else if (aObjectId ==EAlfGridLayoutCreate)
+                result = CAlfGridLayoutHandler::NewL(aResolver, owner, parentLayout);
+            else if (aObjectId ==EAlfLCTGridLayoutCreate)
+                result = CAlfLCTGridLayoutHandler::NewL(aResolver, owner, parentLayout);
+            else if (aObjectId ==EAlfDeckLayoutCreate)
+                result = CAlfDeckLayoutHandler::NewL(aResolver, owner, parentLayout);
+            else if (aObjectId ==EAlfFlowLayoutCreate)
+                result = CAlfFlowLayoutHandler::NewL(aResolver, owner, parentLayout);
+            else if (aObjectId ==EAlfViewportLayoutCreate)
+                result = CAlfViewportLayoutHandler::NewL(aResolver, owner, parentLayout);                        
+            else if (aObjectId ==EAlfCurvePathLayoutCreate)
+                result = CAlfCurvePathLayoutHandler::NewL(aResolver, owner, parentLayout);
+            else if (aObjectId ==EAlfLineVisualCreate)
+                result = CAlfLineVisualHandler::NewL(aResolver, owner, parentLayout);
+            else if (aObjectId ==EAlfCanvasVisualCreate)
+                result = CAlfCanvasVisualHandler::NewL(aResolver, owner, parentLayout);
+            
+            ASSERT(result); // missing obejct would be clear implementation error
+            break;
+            }
+            
+        case EAlfMeshVisualCreate:
+            {
+            TInt3* params = (TInt3*)aInitialParams.Ptr();
+            
+            CHuiControl* owner = 0;
+            THuiMeshType type = EHuiMeshTypeProcedural;
+            CHuiLayout* parentLayout = 0;
+            
+            if (!params->iInt1)
+                {
+                User::Leave(KErrArgument);
+                }
+            else
+                { // currently we must use concrete owner as interface does not provide means to 
+                  // transfer ownership
+                owner = (CHuiControl*) aResolver.GetInterfaceL(EHuiObjectTypeControl, params->iInt1 );    
+                }
+            
+                   
+            if (params->iInt2) // not compulsory
+                {
+                parentLayout = (CHuiLayout*) aResolver.GetInterfaceL(EHuiObjectTypeLayout, params->iInt2 ); 
+                }
+            
+            result = CAlfMeshVisualHandler::NewL(aResolver, owner, type, parentLayout);  
+            
+            ASSERT(result); // missing obejct would be clear implementation error            
+            break;
+            }
+
+        case EAlfBorderBrushCreate:
+            {
+            TAlfCreateBorderBrushParams* params = (TAlfCreateBorderBrushParams*)aInitialParams.Ptr();
+            
+            result = CAlfBorderBrushHandler::NewL(
+                aResolver,
+                params->iThicknessWidth,
+                params->iThicknessHeight,
+                params->iEdgeOffsetX,
+                params->iEdgeOffsetY );
+            }
+            break;   
+        case EAlfBorderBrushCreateMetric:
+            {
+            TAlfCreateBorderBrushMetricParams* params = (TAlfCreateBorderBrushMetricParams*)aInitialParams.Ptr();
+            
+            result = CAlfBorderBrushHandler::NewL(
+                aResolver,
+                params->iThickness,
+                params->iEdgeOffset );
+            }
+            break;   
+
+        case EAlfImageBrushCreate:
+            {
+            TAlfImageBrushParams* params = (TAlfImageBrushParams*)aInitialParams.Ptr();
+            MHuiTexture* texture = reinterpret_cast<MHuiTexture*> (params->iTextureHandle);            
+            result = CAlfImageBrushHandler::NewL(aResolver, THuiImage(*texture));
+            }
+            break;  
+            
+        case EAlfShadowBorderBrushCreate:
+            {
+            TInt* params = (TInt*)aInitialParams.Ptr();
+            result = CAlfShadowBorderBrushHandler::NewL(aResolver, *params);
+            break;
+            }
+        case EAlfShadowBorderBrushCreateMetric:
+            {
+            TAlfMetric* params = (TAlfMetric*)aInitialParams.Ptr();
+            result = CAlfShadowBorderBrushHandler::NewL(aResolver, *params);
+            break;
+            }
+            
+        case EAlfDropShadowBrushCreate:
+            {
+            TInt* params = (TInt*)aInitialParams.Ptr();
+            result = CAlfDropShadowBrushHandler::NewL(aResolver, *params);
+            break;
+            }
+        case EAlfDropShadowBrushCreateMetric:
+            {
+            TAlfMetric* params = (TAlfMetric*)aInitialParams.Ptr();
+            result = CAlfDropShadowBrushHandler::NewL(aResolver, *params);
+            break;
+            }
+            
+        case EAlfGradientBrushCreate:
+            {
+            result = CAlfGradientBrushHandler::NewL( aResolver );
+            break;
+            }
+        case EAlfFrameBrushCreate:
+            {
+            TAlfFrameBrushParams* params = (TAlfFrameBrushParams*)aInitialParams.Ptr();
+            result = CAlfFrameBrushHandler::NewL(aResolver, params->iFrameIID, params->iEdgeOffsetX, params->iEdgeOffsetY);
+            }
+            break;  
+        case EAlfFrameBrushCreateMetric:
+            {
+            TAlfFrameBrushMetricParams* params = (TAlfFrameBrushMetricParams*)aInitialParams.Ptr();
+            result = CAlfFrameBrushHandler::NewL(aResolver, params->iFrameIID, params->iEdgeOffset);
+            }
+            break;  
+        case EAlfFrameBrushCreateImage:
+            {
+            TAlfFrameBrushImageParams* params = (TAlfFrameBrushImageParams*)aInitialParams.Ptr();
+
+            // Todo: is is safe enough to handle textures as direct casts..
+        	TInt handle = params->iImage.iTextureHandle;
+        	MHuiTexture* texture = reinterpret_cast<MHuiTexture*>(handle);
+            THuiImage huiImage;
+            if (texture)
+                {
+                huiImage = THuiImage(*texture, 
+                    params->iImage.iTl.iX.ValueNow(),
+                    params->iImage.iTl.iY.ValueNow(),
+                    params->iImage.iBr.iX.ValueNow(),
+                    params->iImage.iBr.iY.ValueNow());    
+                
+    	        // We take transition time from one, assuming it is same for everyone.
+    	        TInt transitionTime = params->iImage.iBr.iY.TimeToTargetinMilliSeconds();
+    	        
+    	        huiImage.SetTexCoords(params->iImage.iTl.iX.Target(),
+    	            params->iImage.iTl.iY.Target(),
+    	            params->iImage.iBr.iX.Target(),
+    	            params->iImage.iBr.iY.Target(),
+    	            transitionTime );
+                }
+
+            result = CAlfFrameBrushHandler::NewL(aResolver, huiImage, params->iEdgeOffset);
+            }
+            break;  
+
+        case EAlfMappingFunctionConstantCreate:
+            {
+            TReal32* params = (TReal32*)aInitialParams.Ptr();
+            result = new (ELeave) TAlfConstantMappingFunctionHandler(
+                aResolver,
+                *params );
+            break;
+            }
+            
+        case EAlfMappingFunctionLinearCreate:
+            {
+            TReal2* params = (TReal2*)aInitialParams.Ptr();
+            result = new (ELeave) TAlfLinearMappingFunctionHandler(
+                aResolver,
+                params->iReal1,
+                params->iReal2 );
+            break;
+            }
+            
+        case EAlfMappingFunctionSineCreate:
+            {
+            TReal2* params = (TReal2*)aInitialParams.Ptr();
+            result = new (ELeave) TAlfSineMappingFunctionHandler(
+                aResolver,
+                params->iReal1,
+                params->iReal2 );
+            break;
+            }
+            
+        case EAlfMappingFunctionCosineCreate:
+            {
+            TReal2* params = (TReal2*)aInitialParams.Ptr();
+            result = new (ELeave) TAlfCosineMappingFunctionHandler(
+                aResolver,
+                params->iReal1,
+                params->iReal2 );
+            break;
+            }
+            
+        case EAlfMappingFunctionAverageCreate:
+            {
+            TInt2* params = (TInt2*)aInitialParams.Ptr();
+            
+            MHuiMappingFunction* func1 = NULL;
+            MHuiMappingFunction* func2 = NULL;
+            
+            if ( params->iInt1 )
+                {
+                func1 = (MHuiMappingFunction*) aResolver.GetInterfaceL(EHuiInterfaceMappingFunction, params->iInt1 );
+                }
+                
+            if ( params->iInt2 )
+                {
+                func2 = (MHuiMappingFunction*) aResolver.GetInterfaceL(EHuiInterfaceMappingFunction, params->iInt2 );
+                }
+            
+            
+            result = new (ELeave) TAlfAverageMappingFunctionHandler(
+                aResolver,
+                func1,
+                func2
+                );
+            }
+            break;
+            
+        case EAlfCurvePathCreate:
+            {
+            CHuiCurvePath* curvePath = NULL;
+            TInt* params = (TInt*)aInitialParams.Ptr();
+            if ( *params )
+                {
+                curvePath = (CHuiCurvePath*) aResolver.GetInterfaceL(EHuiObjectTypeCurvePathProvider, *params );
+                }
+            result = CAlfCurvePathHandler::NewL( aResolver,curvePath );      
+            break;
+            }
+        case EAlfMappingFunctionTableCreate:
+            {
+            result = new (ELeave) TAlfTableMappingFunctionHandler(aResolver);            
+            break;
+            }
+            
+        case EAlfPlatformTextStyleCreate:
+	        {
+	        TInt2* params = (TInt2*)aInitialParams.Ptr();
+	        result = new (ELeave) TAlfTextStyleHandler(aResolver, params->iInt1, params->iInt2, EAlfPlatformTextStyleCreate);
+	        break;	
+	        }
+	        
+        case EAlfPreconfiguredTextStyleCreate:
+	        {
+	        TInt* params = (TInt*)aInitialParams.Ptr();
+	        result = new (ELeave) TAlfTextStyleHandler(aResolver, *params, 0, EAlfPreconfiguredTextStyleCreate);
+	        break;
+	        }	         
+	        
+        case EAlfPlatformTextStyleCopy:
+	        {
+	        TInt* params = (TInt*)aInitialParams.Ptr();
+	        result = new (ELeave) TAlfTextStyleHandler(aResolver, *params, 0, EAlfPlatformTextStyleCopy);
+	        break;	
+	        }
+	        
+        default:
+            User::Leave(KErrNotSupported);
+            break;            
+        }
+
+    return result;
+    }
+
+void TAlfFixedFactory::Release()
+    {
+    delete this;
+    }
+
+// end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfstreamerbridge.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,549 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Interthread synchronization object
+*
+*/
+
+
+
+#include <e32debug.h>
+#include <coemain.h>
+#include "alfstreamerbridge.h"
+#include "alfstreamerserver.h"
+#include "alflogger.h"
+
+#ifdef ALF_DEBUG_TRACK_DRAWING
+#include "alfcommanddebug.h"
+#endif
+
+
+// #define EGL_TALKS_TO_WINDOW_SERVER
+
+// ---------------------------------------------------------------------------
+// constructor
+// 
+// ---------------------------------------------------------------------------
+//
+
+// The priority is EActivePriorityWsEvents+1 instead of CActive::EPriorityHigh to prevent a deadlock
+// when AlfredServerThread calling iWsSession.GetEvent(event); from inside CCoeEnv::RunL() while
+// wserv was waiting inside CWindowServer::CDefaultAnimationScheduler::DoRedrawNow for Alf to
+// complete the TRequestStatus passed to CAlfRenderStage::End.
+
+CAlfStreamerBridge::CAlfStreamerBridge(MAlfStreamerListener* aObserver):CActive(EActivePriorityWsEvents+1),iObserver(aObserver), iBatchObserver(0), iThread(RThread().Id())
+    {
+    CActiveScheduler::Add(this);       
+    iStatus = KRequestPending;
+    SetActive();
+    TInt err = iQueueSema.CreateLocal();
+    
+    if (err)
+        {
+        // Device startup ends here.
+        __ALFLOGSTRING("Stop the music, we are running without synchronization");
+        User::Panic(_L("UI Accelerator"), 1);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// 
+// ---------------------------------------------------------------------------
+// 
+CAlfStreamerBridge* CAlfStreamerBridge::NewL( MAlfStreamerListener* aObserver )
+    {
+    CAlfStreamerBridge* self = new(ELeave)CAlfStreamerBridge( aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfStreamerBridge::ConstructL()
+    {
+    iDataBuf.Create( KInitialVariableBufferSize );
+    iDataBuf.SetLength(0);
+    iStreamerServer = NULL;
+#ifdef ALF_DEBUG_TRACK_DRAWING
+    iCommandDebugger = CAlfCommandDebug::NewL();
+#endif
+    CHuiEnv::Static()->iSwapObserver = this;
+    }
+
+// ---------------------------------------------------------------------------
+// destructor
+// 
+// ---------------------------------------------------------------------------
+// 
+CAlfStreamerBridge::~CAlfStreamerBridge()
+    {
+    CHuiEnv::Static()->iSwapObserver = 0;
+    iDataBuf.Close();
+    iQueueSema.Close();
+#ifdef ALF_DEBUG_TRACK_DRAWING
+    delete iCommandDebugger;
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// SetBatchObserver
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfStreamerBridge::SetBatchObserver(MAlfBatchObs* aBatchObserver)
+    {
+    iBatchObserver = aBatchObserver;
+    }
+
+// ---------------------------------------------------------------------------
+// Activate
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfStreamerBridge::Activate()
+    {
+    iStatus = KRequestPending;    
+    SetActive();
+    }
+        
+// ---------------------------------------------------------------------------
+// Trigger
+// 
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfStreamerBridge::Trigger(TInt aStatus)
+    {
+    TInt err = KErrNone;
+    if (!iVarDataAddedButNotPosted)
+        {
+        iQueueSema.Wait();
+        }
+    iVarDataAddedButNotPosted = EFalse; // after this point, data may just be lost if posting fails    
+    __ALFLOGSTRING2("CAlfStreamerBridge::Trigger status %d, own request status %d", aStatus, iStatus.Int() );
+    if (IsActive() && iStatus == KRequestPending)
+        {
+        RThread t;
+        TInt err = t.Open(iThread);
+        if (err)
+            {
+            __ALFLOGSTRING1( "CAlfStreamerBridge::Trigger() ignore RThread::Open() error: %d", err );
+            }
+        TRequestStatus* status = &iStatus;
+        __ALFLOGSTRING("CAlfStreamerBridge::Trigger - completing  CAlfStreamerBridge");
+        t.RequestComplete(status, aStatus);
+        t.Close();
+        }
+    else
+        {
+#ifdef _DEBUG
+        if ( IsActive() )
+            {
+            __ALFLOGSTRING("CAlfStreamerBridge::Trigger - already active");
+            }
+        __ALFLOGSTRING("CAlfStreamerBridge::Trigger - appending data");
+#endif        
+        err = iQueue.Append(aStatus);
+        }
+
+    iQueueSema.Signal();
+    __ALFLOGSTRING1("CAlfStreamerBridge::Trigger request status %d", iStatus.Int() );
+    return err;
+    }
+  
+// ---------------------------------------------------------------------------
+// AddData
+// 
+// ---------------------------------------------------------------------------
+// 
+TInt CAlfStreamerBridge::AddData( TAlfDecoderServerBindings aOp,TInt aI1,TInt aI2 ,TAny* aPtr )
+    {
+    if (iSwapActive && aOp == EAlfRequestCommitBatch)
+        {
+        __ALFLOGSTRING("CAlfStreamerBridge::AddData() just release window server");    
+        iBatchObserver->BridgerCallback(KRELEASEWINDOWSERVER,KRELEASEDBEFOREQUEUE);
+        return KErrNone;
+        }
+    
+    TInt err = KErrNotFound;
+        {    
+#ifdef ALF_DEBUG_TRACK_DRAWING    
+        iCommandDebugger->SetDescription( aOp, R_ALF_BRIDGE_COMMAND_DESCRIPTION_ARRAY );
+        __ALFLOGSTRING2("CAlfStreamerBridge::AddData op %S, iQueue.Length = %d", &iCommandDebugger->Text(), iQueue.Count());
+    #else
+        __ALFLOGSTRING2("CAlfStreamerBridge::AddData op %d, iQueue.Length = %d", aOp, iQueue.Count());    
+    #endif
+        err = KErrNone;
+        for(TInt i = 0; i < iMessages.Count(); i++ )
+            {
+            if (iMessages[i].IsEmpty())
+                {
+                iMessages[i].Set(aOp,aI1,aI2,aPtr);
+                err = Trigger(i);
+                return err;
+                }
+            }
+    
+        // No existing (empty) cell was available for recycling, add new cell to array
+        TAlfBridgerData data;
+        data.Set(aOp,aI1,aI2,aPtr);
+        err = iMessages.Append(data);
+        }
+   if (!err) 
+        {
+        err = Trigger(iMessages.Count()-1);
+        }
+	else
+		{
+		iQueueSema.Signal();
+		}	    
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// GetData
+// 
+// Note, that this method frees the message entry for reuse.
+// ---------------------------------------------------------------------------
+// 
+TAlfBridgerData CAlfStreamerBridge::GetData(TInt aIndex)
+    {
+    TAlfBridgerData data;
+    ASSERT(aIndex <= iMessages.Count()-1);
+    data = iMessages[aIndex];
+    return data;    
+    }
+
+void CAlfStreamerBridge::PrepareSwap()
+    {
+#ifdef EGL_TALKS_TO_WINDOW_SERVER
+    __ALFLOGSTRING("CAlfStreamerBridge:: Prepare swap, flush the queue");    
+    iSwapActive = ETrue;
+    if (iStatus.Int() >=0 && iMessages.Count() > iStatus.Int() )
+        {
+        Cancel(); // remove from scheduler
+        RunL(); // run manually (and activate)
+        }
+    __ALFLOGSTRING("CAlfStreamerBridge:: Prepare swap, the queue emptied");    
+#endif //#ifdef EGL_TALKS_TO_WINDOW_SERVER
+    }
+
+void CAlfStreamerBridge::SwapComplete()
+    {
+#ifdef EGL_TALKS_TO_WINDOW_SERVER
+    __ALFLOGSTRING("CAlfStreamerBridge:: Swap buffers complete");    
+    iSwapActive = EFalse;
+#endif // #ifdef EGL_TALKS_TO_WINDOW_SERVER
+
+    }
+	
+#ifdef EGL_TALKS_TO_WINDOW_SERVER
+void CAlfStreamerBridge::ReleaseWindowServer(TBool aRelease)
+    {
+    __ALFLOGSTRING1("CAlfStreamerBridge::ReleaseWindowServer: %d",aRelease);    
+    if (aRelease)
+        {
+        iMakeCurrentActive = ETrue;    
+        if (iBatchObserver && !iSwapActive)    
+            {
+            iBatchObserver->BridgerCallback(KRELEASEWINDOWSERVER);
+            }
+        }
+    else
+        {
+        iMakeCurrentActive = EFalse;
+        }                
+#else
+void CAlfStreamerBridge::ReleaseWindowServer(TBool)
+	{
+#endif
+    }
+
+void CAlfStreamerBridge::SetWgIdArray(TInt* aArray)
+    {
+    iWgArray = aArray;
+    }
+
+EXPORT_C TUid CAlfStreamerBridge::FindAppUidForWgId(TInt aWgId)
+    {
+    if (iWgArray)    
+        {TInt* ptr = iWgArray;     
+        for (TInt i=0; i<39; i=i+2) // magic
+            {
+            if (ptr[i] == aWgId)
+                {
+                return TUid::Uid(ptr[i+1]);
+                }
+            if (!ptr[i])
+                {
+                break;
+                }    
+            }
+        }
+    return KNullUid; 
+    }        
+
+EXPORT_C TInt CAlfStreamerBridge::FindWgForAppUid(TUid aAppUid)
+    {
+    if (iWgArray)    
+        {TInt* ptr = iWgArray;     
+        for (TInt i=0; i<39; i=i+2) // magic
+            {
+            if (ptr[i+1] == aAppUid.iUid)
+                {
+                return ptr[i];
+                }
+            if (!ptr[i])
+                {
+                break;
+                }    
+            }
+        }
+    return 0; 
+    }        
+    
+// ---------------------------------------------------------------------------
+// RunL
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfStreamerBridge::RunL()
+    {
+    TInt operation = iMessages[iStatus.Int()].iOp;
+    
+#ifdef ALF_DEBUG_TRACK_DRAWING 
+    iCommandDebugger->SetDescription( operation, R_ALF_BRIDGE_COMMAND_DESCRIPTION_ARRAY );
+    __ALFLOGSTRING1("CAlfStreamerBridge::RunL: First op %S", &iCommandDebugger->Text() );
+#else
+    __ALFLOGSTRING1("CAlfStreamerBridge::RunL: First op %d", operation);
+#endif
+    switch ( operation )
+        {
+        // Just call back to Alf decoder thread
+        case EAlfRequestCommitBatch:
+        case EAlfRequestCommandReadNotification:
+        case EAlfReleaseTemporaryChunk:
+            {
+            if (iBatchObserver)
+                {
+                iBatchObserver->BridgerCallback( operation, iMessages[iStatus.Int()].iInt1 );
+                }
+            iMessages[iStatus.Int()].ResetEntry();
+            break;
+            }
+        default:
+            {
+            // Handle command
+            __ALFLOGSTRING("CAlfStreamerBridge:: calling observer callback");
+            iObserver->HandleCallback(iStatus.Int());
+            
+            // For "getters" also call back to Alf decoder thread
+            if ((operation > EAlfDSGetCommandsStart) && (operation < EAlfDSGetCommandsEnd))
+            	{
+            	if (iBatchObserver)
+                	{
+                	iBatchObserver->BridgerCallback( operation, iMessages[iStatus.Int()].iInt1 );
+                	}
+            	}
+            	
+    		iMessages[iStatus.Int()].ResetEntry(); // mark the cell free
+            }
+        }
+    
+    // Todo: is this kind of burst mode ok, it should be..
+    iQueueSema.Wait();
+    while (iQueue.Count())
+        {
+    	TInt operation2 = iMessages[iQueue[0]].iOp;
+#ifdef ALF_DEBUG_TRACK_DRAWING 
+    iCommandDebugger->SetDescription( operation2, R_ALF_BRIDGE_COMMAND_DESCRIPTION_ARRAY );
+    __ALFLOGSTRING1("CAlfStreamerBridge:: Queue op %S", &iCommandDebugger->Text() );
+#else
+    __ALFLOGSTRING1("CAlfStreamerBridge:: Queue op %d", operation2 );
+#endif
+    switch ( operation2 )
+            {
+            case EAlfRequestCommitBatch:
+            case EAlfRequestCommandReadNotification:
+            case EAlfReleaseTemporaryChunk:
+                {
+                if (iBatchObserver)
+                    {
+                    __ALFLOGSTRING("CAlfStreamerBridge:: calling BATCH observer callback");
+                    iBatchObserver->BridgerCallback( operation2, iMessages[iQueue[0]].iInt1 );
+                    }
+                iMessages[iQueue[0]].ResetEntry();
+                break;
+                }
+            default:
+                {
+	            // Handle command
+                __ALFLOGSTRING("CAlfStreamerBridge:: calling observer callback");
+	            iObserver->HandleCallback(iQueue[0]);
+	            
+	            // For "getters" also call back to Alf decoder thread
+	            if ((operation2 > EAlfDSGetCommandsStart) && (operation2 < EAlfDSGetCommandsEnd))
+	            	{
+	            	if (iBatchObserver)
+	                	{
+	                	iBatchObserver->BridgerCallback( operation2, iMessages[iQueue[0]].iInt1 );
+	                	}
+	            	}
+	    		iMessages[iQueue[0]].ResetEntry(); // mark the cell free
+                }
+            }
+        iQueue.Remove(0);
+        }
+    if ( !iItemsInBuffer )
+        {
+        iDataBuf.SetLength(0);
+        }
+        
+    __ALFLOGSTRING1("CAlfStreamerBridge::RunL - activating", iItemsInBuffer);
+    Activate();
+    iQueueSema.Signal();
+    __ALFLOGSTRING1("CAlfStreamerBridge::RunL - really really ending", iItemsInBuffer);
+    }
+
+// ---------------------------------------------------------------------------
+// DoCancel
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfStreamerBridge::DoCancel()
+    {
+    if (iBatchObserver)
+        {
+        iBatchObserver->BridgerCanceled();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// StartNewBlock
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfStreamerBridge::StartNewBlock()
+    {
+    // Queue marker. Basically we could use one new member to assert that there can
+    // be only one marker
+    __ALFLOGSTRING1("CAlfStreamerBridge:: Request command read notification, swap active: %d", iSwapActive );    
+   if ( iSwapActive || iMakeCurrentActive )
+        {
+        __ALFLOGSTRING("CAlfStreamerBridge::StartNewBlock() just release window server");    
+        iBatchObserver->BridgerCallback(KRELEASEWINDOWSERVER,KRELEASEDBEFOREQUEUE);
+        return;
+        }
+    AddData(EAlfRequestCommitBatch,0,0,0);
+    }
+
+// ---------------------------------------------------------------------------
+// RequestCommandReadNotification
+// 
+// ---------------------------------------------------------------------------
+// 
+void CAlfStreamerBridge::RequestCommandReadNotification( TInt aLastReadOffset, TAlfDecoderServerBindings aCommand )
+    {
+    AddData( aCommand, aLastReadOffset, 0, 0);
+    }
+
+// ---------------------------------------------------------------------------
+// AppendVarDataL
+// 
+// Note, that memory allocation is done only if current buffer is not large enough 
+// to add an item.
+// TODO: The buffers added are not the buffer in optimal way.
+// ---------------------------------------------------------------------------
+// 
+EXPORT_C const TAny* CAlfStreamerBridge::AppendVarDataL( TInt aSize, TInt& aIndex )
+    {
+    iQueueSema.Wait();
+    // Make sure the length of the allocated data is always divisible by 8
+    if ( aSize % 8 != 0 )
+        {
+        __ALFLOGSTRING1("CAlfStreamerBridge::AppendVarDataL, size not multiple of 8: %d", aSize );  
+        aSize = aSize + ( 8 - aSize % 8 );
+        }
+    if ( iDataBuf.Length() + aSize >= iDataBuf.MaxLength() )
+        {
+        TRAPD(err, iDataBuf.ReAllocL( iDataBuf.MaxLength() + KInitialVariableBufferSize ));
+        if ( err )
+            {
+            __ALFLOGSTRING("CAlfStreamerBridge::AppendVarDataL, realloc failed");
+		    iQueueSema.Signal();
+            return NULL;
+            }
+        __ALFLOGSTRING1("CAlfStreamerBridge::AppendVarDataL, new max size: %d", iDataBuf.MaxLength() );  
+        }
+    aIndex = iDataBuf.Length();
+    iDataBuf.SetLength( iDataBuf.Length() + aSize);
+    iItemsInBuffer++;
+    __ALFLOGSTRING1("CAlfStreamerBridge::AppendVarDataL: buflength %d", iDataBuf.Length());  
+    iVarDataAddedButNotPosted = ETrue;    
+    return iDataBuf.MidTPtr( aIndex ).Ptr();
+    }
+
+// ---------------------------------------------------------------------------
+// GetVarDataL
+// 
+// Note, that data is not removed at any point. However it should not be accessed again 
+// with this method, because that would confuse iItemsInBuffer counter.
+// ---------------------------------------------------------------------------
+// 
+const TAny* CAlfStreamerBridge::GetVarDataL( TInt aIndex )
+    {
+    ASSERT( aIndex >= 0 && aIndex < iDataBuf.MaxLength() );
+    ASSERT( iItemsInBuffer );
+    iItemsInBuffer--;
+    return iDataBuf.MidTPtr( aIndex ).Ptr();
+    }
+
+EXPORT_C const TAny* CAlfStreamerBridge::AppendEffectsDataL( TInt aSize, TInt& aIndex )
+    {
+	return AppendVarDataL( aSize, aIndex );
+    }
+
+// ---------------------------------------------------------------------------
+// GetVarDataL
+// 
+// Note, that data is not removed at any point. However it should not be accessed again 
+// with this method, because that would confuse iItemsInBuffer counter.
+// ---------------------------------------------------------------------------
+// 
+const TAny* CAlfStreamerBridge::GetEffectsDataL( TInt aIndex )
+    {
+    return GetVarDataL(aIndex);
+    }
+
+// ---------------------------------------------------------------------------
+// SetStreamerServer
+// ---------------------------------------------------------------------------
+// 
+void CAlfStreamerBridge::SetStreamerServer( CAlfStreamerServer& aStreamerServer )
+    {
+    iStreamerServer = &aStreamerServer;   
+    }
+
+// ---------------------------------------------------------------------------
+// StreamerServer
+// ---------------------------------------------------------------------------
+// 
+CAlfStreamerServer* CAlfStreamerBridge::StreamerServer()
+    {
+    return iStreamerServer;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfstreamerserver.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,871 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Server implementation fo share files in application private gage 
+*                with controlled way
+*
+*/
+
+
+
+#include <e32std.h>
+#include <f32file.h>
+#include <e32math.h>
+#include "alfstreamerserver.h"
+#include "alfstreamerconsts.h"
+#include "alfstreamerbridge.h"
+#include "alfwindowmanager.h"
+#include "alfhierarchymodel.h"
+#include <ecom.h>
+#include <alf/AlfTransEffectPlugin.h>
+#include <alf/AlfTransEffectPlugin.hrh>
+
+
+// ==================================
+// Launcher implementation.
+// ==================================   
+
+// ---------------------------------------------------------------------------
+// DoAlfStreamerServerThreadStartFunctionL
+// Construct the server object
+// ---------------------------------------------------------------------------
+//   
+LOCAL_C void DoAlfStreamerServerThreadStartFunctionL(CAlfStreamerBridge* aBridge)
+    {
+    CAlfStreamerServer::NewLC(aBridge);
+    
+    RThread().Rendezvous(KErrNone);
+    CActiveScheduler::Start();
+    CleanupStack::PopAndDestroy(); // server
+    }
+
+// ---------------------------------------------------------------------------
+// Entry point into the new thread
+// ---------------------------------------------------------------------------
+//   
+GLDEF_C TInt AlfStreamerServerThreadStartFunction(TAny* aBridge)
+    {
+    __UHEAP_MARK;
+    RThread thread;
+
+    TInt err = User::RenameThread(KAlfStreamerServerThreadName);
+    if (err == KErrNone)
+        {
+        thread.SetPriority(EPriorityAbsoluteHigh);
+        thread.Close();
+
+        // Set up scheduler and cleanup stack for this thread
+        CActiveScheduler* scheduler = new CActiveScheduler;
+        if (!scheduler)
+            {
+            return KErrNoMemory;
+            }
+        CActiveScheduler::Install(scheduler);
+        CTrapCleanup* trapCleanup = CTrapCleanup::New();
+        if (!trapCleanup)
+            {
+            return KErrNoMemory;
+            }
+
+        // Set initial trap harness, and construct server object
+        TRAP(err,DoAlfStreamerServerThreadStartFunctionL((CAlfStreamerBridge*)aBridge));
+
+        delete CActiveScheduler::Current();
+        delete trapCleanup;
+        }
+    __UHEAP_MARKEND;
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// LaunchServer
+// ---------------------------------------------------------------------------
+//   
+TInt CAlfStreamerServer::LaunchServer(TThreadId& aThreadId, CAlfStreamerBridge* aBridge)
+    {
+    // First, check that ther server isn't already running.
+    TFindServer findServer(ALFSTREAMER_SERVER_NAME);
+    TFullName name;
+    if (findServer.Next(name) == KErrNone)
+        {
+        return KErrAlreadyExists;
+        }
+    RThread serverThread;
+
+    TInt err = serverThread.Create(
+        KAlfStreamerServerThreadName,
+        AlfStreamerServerThreadStartFunction,
+        16384, // magic
+        0, // uses caller thread's heap
+        (TAny*)aBridge, 
+        EOwnerThread);
+
+    aThreadId = serverThread.Id();
+    TRequestStatus status;
+    serverThread.Rendezvous(status);
+    serverThread.Resume();
+    serverThread.Close();
+    User::WaitForRequest(status);
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// NewLC
+// ---------------------------------------------------------------------------
+//   
+void CAlfStreamerServer::NewLC(CAlfStreamerBridge* aBridge)
+    {
+    CAlfStreamerServer* pS = new (ELeave) CAlfStreamerServer(aBridge);
+    CleanupStack::PushL(pS);
+    pS->ConstructL();
+    }
+
+TInt DoRendezvous(TAny* aCallBack)
+    {
+    RThread().Rendezvous(KErrNone);
+    CAsyncCallBack* cb = (CAsyncCallBack*) aCallBack;
+    delete cb;
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//   
+void CAlfStreamerServer::ConstructL()
+    {
+    StartL(ALFSTREAMER_SERVER_NAME);
+    
+    iWindowHierarcy = CAlfHierarchyModel::NewL(*this);
+    iWindowMgr = CAlfWindowManager::NewL(iWindowHierarcy);
+    iBridge->SetStreamerServer( *this );
+    iThemesListener = CThemeRepositoryListener::NewL();
+    iThemesListener->IssueRequest();
+    iRendezvous = new (ELeave) CAsyncCallBack(EPriorityHigh*3);
+    iRendezvous->Set(TCallBack(DoRendezvous, iRendezvous));
+    iRendezvous->CallBack();
+    }
+
+// ---------------------------------------------------------------------------
+// NewSessionL
+// ---------------------------------------------------------------------------
+//   
+CSession2* CAlfStreamerServer::NewSessionL(const TVersion& /*aVersion*/,const RMessage2& /*aMessage*/) const
+    {
+	CSession2* newSession = new(ELeave) CAlfStreamerServerSession();
+    iSessions++;
+    
+    return newSession;   
+    }
+
+CAlfStreamerServerSession* CAlfStreamerServer::WservSession(TInt aScreenNumber)
+    {
+    CAlfStreamerServerSession* windowServerSession = NULL;
+    for(TInt i = 0; i < iWindowServerSessions.Count(); i++ )
+        { 
+        if(aScreenNumber == iWindowServerSessions[i]->ScreenNumber() )
+            {
+            windowServerSession = iWindowServerSessions[i];
+            break;
+            }
+        }
+    return windowServerSession;
+    }
+
+
+// ---------------------------------------------------------------------------
+// HandleClientExit
+// ---------------------------------------------------------------------------
+//   
+void CAlfStreamerServer::HandleClientExit(const CSession2* /*aClient*/)
+    {
+    iSessions--;
+    if (!iSessions)
+        {
+        // CActiveScheduler::Stop(); // TODO: lets not die, if client dies.
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// destructor of CAlfStreamerServer
+// ---------------------------------------------------------------------------
+//   
+CAlfStreamerServer::~CAlfStreamerServer()
+    {
+    delete iThemesListener;
+    delete iWindowMgr;
+    delete iWindowHierarcy;
+    iCompositionSessions.Close();
+    iCompositionHostSessions.Close();
+    iCompositionTokens.Close();
+    iWindowServerSessions.Close();
+    }
+
+void CAlfStreamerServer::AppendCompositionSessionL(CAlfStreamerServerSession* aSession, TBool aHost)
+    {
+    if(!aHost)
+        {
+        TInt index = iCompositionSessions.Find(aSession);    
+        if (index == KErrNotFound)
+            {
+            iCompositionSessions.AppendL(aSession);
+            }
+        }
+    else
+        {
+        TInt index = iCompositionHostSessions.Find(aSession);    
+        if (index == KErrNotFound)
+            {
+            iCompositionHostSessions.AppendL(aSession);
+            }
+        }
+    }
+void CAlfStreamerServer::RemoveCompositionSession(CAlfStreamerServerSession* aSession)    
+    {
+    TInt index = iCompositionSessions.Find(aSession);    
+    if (index != KErrNotFound)
+        {
+        FreeCompositionSessionExtents(aSession);
+        TPckgC<TInt> id(reinterpret_cast<TInt>(aSession));
+        for(TInt u = 0; u < iWindowServerSessions.Count(); u++ )
+            { 
+            if( aSession->ScreenNumber() == iWindowServerSessions[u]->ScreenNumber())
+                {
+                TRAP_IGNORE(QueueRequestForSessionL(iWindowServerSessions[u], id, KAlfCompOpSessionClosed));
+                }
+            }
+            
+        iCompositionSessions.Remove(index);
+        
+        }
+    TInt hostindex = iCompositionHostSessions.Find(aSession);    
+    if (hostindex != KErrNotFound)
+        {
+        HBufC8* message = HBufC8::NewLC(8);
+        TInt session = reinterpret_cast<TInt>(aSession);
+        TPtr8 clientBuf = message->Des();
+        clientBuf.Insert(0, TPtrC8((TUint8*)&session ,sizeof(TInt)));
+        TInt newtarget = 0;
+        clientBuf.Insert(1 * sizeof(TInt), TPtrC8((TUint8*)&newtarget ,sizeof(TInt)));
+        for(TInt i = 0; i < iWindowServerSessions.Count(); i++ )
+            { 
+            if( aSession->ScreenNumber() == iWindowServerSessions[i]->ScreenNumber())
+                {
+                TRAP_IGNORE(QueueRequestForSessionL(iWindowServerSessions[i], *message, KAlfCompOpBindSourceToToken)); // bind to 0 -> remove binding
+                }
+            }
+        CleanupStack::PopAndDestroy();
+        iCompositionHostSessions.Remove(hostindex);
+        }
+
+    // clean possible tokens for this composition source
+    TInt targetSession = reinterpret_cast<TInt>(aSession);
+    for( TInt i = 0; i < iCompositionTokens.Count() ; i++)
+        {
+        if ( targetSession == iCompositionTokens[i].iTarget )
+            {
+            iCompositionTokens.Remove(i);
+            i--;
+            }
+        };
+    }
+
+void CAlfStreamerServer::HandleCompositionRequestL(CAlfStreamerServerSession* aSession, TInt aOp, const RMessage2& aMessage)
+    {
+    CAlfStreamerServerSession* wservsession = WservSession( aSession->ScreenNumber() );
+
+    TInt length = aMessage.GetDesLength(0);
+    User::LeaveIfError(length);
+    HBufC8* message = HBufC8::NewLC(length+4);
+    TPtr8 clientBuf = message->Des();
+    aMessage.ReadL(0,clientBuf);
+
+    if(aOp == KAlfCompOpSetExtent) 
+        {
+        TInt* ptr = (TInt*)clientBuf.Ptr();
+        TInt screennumber = ptr[4];
+        if(screennumber!=aSession->ScreenNumber())
+            {
+            aSession->ExtentSurfaceId().iInternal[0] = ptr[5];
+            aSession->ExtentSurfaceId().iInternal[1] = ptr[6];
+            aSession->ExtentSurfaceId().iInternal[2] = ptr[7];
+            aSession->ExtentSurfaceId().iInternal[3] = ptr[8];
+            wservsession = WservSession( screennumber );
+            }
+        }
+    else if(aOp == KAlfCompOpSessionClosed)
+        {
+        FreeCompositionSessionExtents(aSession);
+        }
+    
+    TInt session = reinterpret_cast<TInt>(aSession);
+    clientBuf.Insert(0, TPtrC8((TUint8*)&session ,sizeof(TInt)));
+    
+    if( wservsession ) // don't send to any wservsession if composition source does not have a window anywhere and this is not SetExtent operation
+        {
+        QueueRequestForSessionL(wservsession, clientBuf, aOp);
+        }
+    
+    CleanupStack::PopAndDestroy(); // unefficient..
+ 
+    if (!wservsession)
+        {
+        aMessage.Complete(KErrNotReady);
+        return;
+        }
+    
+    if( aOp == KAlfCompOpCreateSource )
+        {
+        AppendCompositionSessionL(aSession);
+        aMessage.Complete(reinterpret_cast<TInt>(aSession));
+        }
+    else if ( aOp != KAlfCompOpSetZOrder )
+        {
+        aMessage.Complete(KErrNone);
+        }
+    }
+
+void CAlfStreamerServer::QueueRequestForSessionL(CAlfStreamerServerSession* aSession, const TPtrC8& aPtr, TInt aOp)
+    {
+    aSession->QueueL(aPtr, aOp);
+    }
+
+void CAlfStreamerServer::QueueRequestAllSessionsL(const TPtrC8& aPtr, TInt aOp, TBool aAlsoWServ)
+    {
+    if (aAlsoWServ)
+        {
+        for(TInt i = 0; i < iWindowServerSessions.Count(); i++ )
+            { 
+            iWindowServerSessions[i]->QueueL(aPtr, aOp);
+            }    
+        }
+        
+    for(TInt i = iCompositionSessions.Count()-1; i >= 0; i-- )
+        { 
+        iCompositionSessions[i]->QueueL(aPtr, aOp);
+        }
+    }
+
+TInt CAlfStreamerServer::CreatePermissionToken(const RMessage2& aMessage, TInt aTarget, CAlfStreamerServerSession* aSession)
+    {
+    TInt length = aMessage.GetDesLength(0);
+    User::LeaveIfError(length);
+    HBufC8* message = HBufC8::NewLC(length);
+    TPtr8 clientBuf = message->Des();
+    aMessage.ReadL(0,clientBuf);
+
+    TInt* ptr = (TInt*) clientBuf.Ptr();
+    TInt newkey = Math::Random();
+    
+    TRAPD( err, iCompositionTokens.AppendL( CCompositionToken( newkey, ptr[0] /* customer specified key */,
+                                                                ptr[1] /*flags*/, aTarget,
+                                                                aSession->ScreenNumber() ) ) );
+    if (err)
+        {
+        newkey = 0;
+        }
+    RDebug::Print(_L("CAlfStreamerServer::CreatePermissionToken - newkey %d target: %d, err: %d"), newkey, aTarget, err );
+            
+    CleanupStack::PopAndDestroy(message);
+    return newkey; 
+    }
+
+void CAlfStreamerServer::ValidateToken( CAlfStreamerServerSession* aSession, const RMessage2& aMessage)
+    {
+    TInt length = aMessage.GetDesLength(0);
+    User::LeaveIfError(length);
+    HBufC8* message = HBufC8::NewLC(length + 12);
+    TPtr8 clientBuf = message->Des();
+    aMessage.ReadL(0,clientBuf);
+        
+    TInt* ptr = (TInt*) clientBuf.Ptr();
+    TInt tokenkey  = ptr[1];
+    TInt secret = ptr[2];
+    // only AlfStreamer server knows the tokens. Thus it will pass the existing target and attribs to the client
+    TInt i = 0;
+    while(  i < iCompositionTokens.Count() )
+        {
+        if ( tokenkey == iCompositionTokens[i].iKey && secret == iCompositionTokens[i].iSecretKey )
+            {
+            break;
+            }
+        i++;
+        };
+    
+    if ( i < iCompositionTokens.Count())
+        {
+        CAlfStreamerServerSession* wservsession = WservSession( iCompositionTokens[i].iScreenNumber );
+        if( wservsession )
+            {
+            aSession->SetScreenNumber( wservsession->ScreenNumber() );
+//            CCompositionToken token(iCompositionTokens[i].iKey, iCompositionTokens[i].iSecretKey, iCompositionTokens[i].iFlags, iCompositionTokens[i].iTarget, iCompositionTokens[i].iScreenNumber);
+            TInt session = reinterpret_cast<TInt>(aSession);
+            clientBuf.Insert(0, TPtrC8((TUint8*)&session ,sizeof(TInt)));
+  
+            if( iCompositionTokens[i].iCombinedTarget )
+                {
+                clientBuf.Insert(1 * sizeof(TInt), TPtrC8((TUint8*)&iCompositionTokens[i].iKey ,sizeof(TInt)));
+                clientBuf.Insert(2 * sizeof(TInt), TPtrC8((TUint8*)&iCompositionTokens[i].iFlags ,sizeof(TInt)));
+                }
+            else
+                {
+                clientBuf.Insert(1 * sizeof(TInt), TPtrC8((TUint8*)&iCompositionTokens[i].iTarget ,sizeof(TInt)));
+                clientBuf.Insert(2 * sizeof(TInt), TPtrC8((TUint8*)&iCompositionTokens[i].iFlags ,sizeof(TInt)));
+                }
+            
+            AppendCompositionSessionL(aSession, ETrue);
+            // pass the updated buffer to client    
+            QueueRequestForSessionL(wservsession, clientBuf, KAlfCompOpBindSourceToToken);
+            CleanupStack::PopAndDestroy(); // unefficient..
+            aMessage.Complete(KErrNone);
+            }
+        else
+            {
+            CleanupStack::PopAndDestroy(); // unefficient..
+            aMessage.Complete(KErrNotFound);
+            }
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy(); // unefficient..
+        aMessage.Complete(KErrNotFound); // client will get User::Leave after this.
+        }
+    }
+
+void CAlfStreamerServer::HandleCompositionEventL(CAlfStreamerServerSession* aSession, TInt aOp, const RMessage2& aMessage)
+    {
+    if ( aOp == KAlfCompositionWServReady )
+        {
+        TInt index = iWindowServerSessions.Find(aSession);    
+        if (index == KErrNotFound)
+            {
+            iWindowServerSessions.AppendL(aSession);
+            }
+        aMessage.Complete(KErrNone);
+        return;
+        }
+    
+    if ( aOp == KAlfCompositionLowOnGraphicsMemory ||  aOp == KAlfCompositionGoodOnGraphicsMemory 
+		|| aOp == KAlfCompositionTargetHidden ||aOp == KAlfCompositionTargetVisible)
+        {
+        aMessage.Complete(KErrNone);
+        QueueRequestAllSessionsL(KNullDesC8(), aOp, ETrue);    
+        return;
+        }        
+    
+    TInt length = aMessage.GetDesLength(0);
+    User::LeaveIfError(length);
+    HBufC8* message = HBufC8::NewLC(length);
+    TPtr8 clientBuf = message->Des();
+    aMessage.ReadL(0,clientBuf);
+
+    TInt* ptr = (TInt*) clientBuf.Ptr();
+    CAlfStreamerServerSession* target =  reinterpret_cast<CAlfStreamerServerSession*>(*ptr);
+
+    switch(aOp)
+        {
+        case KAlfCompositionFrameReady:
+            {
+            QueueRequestAllSessionsL(clientBuf.Right(4), aOp);    
+            break;
+            }
+        case KAlfCompositionTargetCreated:
+            {
+            if (!target->MessagePtr().IsNull())
+                {
+                // create a combined target token
+                if(ptr[1] > 0 )
+                    {
+
+                    TRAPD( err, iCompositionTokens.AppendL( 
+                            CCompositionToken(
+                            ptr[1], // new token
+                            ptr[2], // secret key
+                            0,
+                            reinterpret_cast<TInt>(aSession),
+                            aSession->ScreenNumber(),
+                            ETrue // combined target
+                           ) ) );
+                    if (err)
+                        {
+                        ptr[1] = 0;
+                        }
+  
+                    }
+                
+                target->MessagePtr().Complete(ptr[1]);    
+                }
+            break;
+            }
+        default:
+            break;
+        }
+    CleanupStack::PopAndDestroy();
+    aMessage.Complete(KErrNone);
+    }    
+
+
+void CAlfStreamerServer::FreeCompositionSessionExtents(CAlfStreamerServerSession* aSession)
+    {
+    if( !aSession->ExtentSurfaceId().IsNull())
+        {
+        for(TInt i = 0; i < iWindowServerSessions.Count(); i++)
+            { 
+            if( aSession->ScreenNumber() != iWindowServerSessions[i]->ScreenNumber() )
+                {
+                TInt session = reinterpret_cast<TInt>(aSession);
+                TInt array[] = {session, 0,0,0,0, // TRect()
+                                0, // screennumber does not matter
+                                aSession->ExtentSurfaceId().iInternal[0],
+                                aSession->ExtentSurfaceId().iInternal[1],
+                                aSession->ExtentSurfaceId().iInternal[2],
+                                aSession->ExtentSurfaceId().iInternal[3] };  
+                TPtrC8 ptr((TUint8*)&array ,sizeof(array));
+                QueueRequestForSessionL(iWindowServerSessions[i], ptr, KAlfCompOpSetExtent );
+                }
+            }
+        aSession->ExtentSurfaceId().CreateNullId();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// constructor
+// ---------------------------------------------------------------------------
+//   
+CAlfStreamerServerSession::CAlfStreamerServerSession() : iScreenNumber(KErrNotFound)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// destructor of CAlfStreamerServerSession
+// ---------------------------------------------------------------------------
+//   
+CAlfStreamerServerSession::~CAlfStreamerServerSession()
+    {
+    TInt i = 0;
+    RImplInfoPtrArray pluginArray;
+    REComSession::ListImplementationsL( KAlfGfxPluginInterfaceUId, pluginArray );    
+    for ( i = iLoadedPlugins.Count() - 1; i >= 0; i-- )
+        {
+        TInt j = 0;    
+        for ( j= 0; j < pluginArray.Count(); j++ )
+            {
+            TUid loaded = TUid::Uid(iLoadedPlugins[i]);
+            TUid listed = pluginArray[j]->ImplementationUid();
+            TPtrC8 listedopaque = pluginArray[j]->OpaqueData();
+            if ( loaded == listed && ( (listedopaque.CompareF( KAlfDoNotUnloadPlugin )) != 0 ) )
+                {
+                ((CAlfStreamerServer*)(Server()))->WindowMgr()->DestroyPlugin(TUid::Uid(iLoadedPlugins[i]));
+                }
+            }
+        }
+    // Clear the data in plugin array
+    for (TInt i = pluginArray.Count() - 1; i >= 0; i-- )
+        {
+        // destroy 
+        delete pluginArray[i];
+        pluginArray.Remove( i );
+        }
+    pluginArray.Close();
+    iLoadedPlugins.Close();    
+            
+    CAlfStreamerServer* server = dynamic_cast<CAlfStreamerServer*>((CAlfStreamerServer*)Server()); // nice const cast     
+    server->RemoveCompositionSession((CAlfStreamerServerSession*)this); // deja vu   
+    server->HandleClientExit(this);
+    }
+
+
+// ---------------------------------------------------------------------------
+// ServiceL
+// ---------------------------------------------------------------------------
+//   
+void CAlfStreamerServerSession::ServiceL(const RMessage2& aMessage)
+    {
+//    RDebug::Print(_L("CAlfStreamerServerSession::ServiceL %d"), aMessage.Function());
+   CAlfStreamerServer* server = (CAlfStreamerServer*)( Server() );
+   
+   TInt op = aMessage.Function();
+   
+   // handle composition control ops in different function
+   if (op >= KAlfCompOpCreateSource)
+       {
+       HandleCompositionOpL(op, aMessage, server);
+       return;
+       }
+         
+   switch(op)
+        {
+        case EAlfBridgerBlindSend:
+        case EAlfBridgerSendChunk:
+        case EAlfBridgerRequestDataBlock:
+        case EAlfBridgerAsyncronousData:
+        case EDsNotifyNativeWindowData:
+            {
+            server->WindowTree()->HandleMessageL( aMessage );
+            return;
+            }
+        
+        case EAlfDecodSLoadPlugin:
+            {
+            TInt index = iLoadedPlugins.Find(aMessage.Int0());
+            TRAPD( err, server->WindowMgr()->LoadPluginL(TUid::Uid(aMessage.Int0())) );
+            // was successfully loaded, add uid to session's array
+            if ( err == KErrNone || err == KErrAlreadyExists )
+                {
+                if ( index == KErrNotFound )
+                    {
+                    iLoadedPlugins.AppendL(aMessage.Int0());
+                    }
+                }
+            else    
+                {
+                User::Leave( err );
+                }
+            break;
+            }
+        case EAlfDecodSUnloadPlugin:
+            {
+            TInt index = iLoadedPlugins.Find(aMessage.Int0());
+            if  (index != KErrNotFound )
+                {
+                RImplInfoPtrArray pluginArray;
+                REComSession::ListImplementationsL( KAlfGfxPluginInterfaceUId, pluginArray );    
+                TInt i = 0;    
+                for ( i = 0; i < pluginArray.Count(); i++ )
+                    {
+                    TUid loaded = TUid::Uid(aMessage.Int0());
+                    TUid listed = pluginArray[i]->ImplementationUid();
+                    TPtrC8 listedopaque = pluginArray[i]->OpaqueData();
+                    if ( loaded == listed && (listedopaque.CompareF( KAlfDoNotUnloadPlugin )) != 0 ) 
+                        {
+                        iLoadedPlugins.Remove(index);
+                        server->WindowMgr()->DestroyPlugin(TUid::Uid(aMessage.Int0()));
+                        }
+                    }
+                // Clear the data in plugin array, it is not going to be used any more.    
+                for ( i = pluginArray.Count() - 1; i >= 0; i-- )
+                    {
+                    // destroy 
+                    delete pluginArray[i];
+                    pluginArray.Remove( i );
+                    }
+                pluginArray.Close();
+                }        
+            break;
+            }        
+
+        case EAlfDecodSSendSynch:
+        case EAlfDecodSSendAsynch:
+            {
+            server->WindowMgr()->HandlePluginMsgL(aMessage); // will complete synch message immediately       
+            return; // so message won't be completed
+            }        
+
+        case EAlfDecodSCancelAsynch:
+            {
+            server->WindowMgr()->CancelPluginMsg(TUid::Uid(aMessage.Int0()), aMessage.Int1());       
+            break;        
+            }        
+        
+        case EAlfDecodSPrepareFrame:
+            {
+            server->WindowMgr()->PrepareNewFrame(aMessage.Int0());
+            break;
+            } 
+        case EAlfSetScreenRotation:
+            {
+            TInt rotation = aMessage.Int0();
+            aMessage.Complete(KErrNone);    
+            server->Bridge()->AddData( EAlfBridgeSetScreenRotation,rotation);
+            break;
+            } 
+        case EAlfGetNativeWindowHandles:
+            {
+            TPckgC<TAlfNativeWindowData> data(server->Bridge()->iAlfWindowData);
+            aMessage.WriteL(0, data);
+            break;    
+            }
+
+        default:
+            {
+            aMessage.Complete(KErrNotSupported);
+            break;
+            }        
+        }
+    if (!aMessage.IsNull())
+        {
+        aMessage.Complete(KErrNone);
+        }
+//    RDebug::Print(_L("CAlfStreamerServerSession::ServiceL exit"));
+    }
+
+void CAlfStreamerServerSession::HandleCompositionOpL(TInt aOp, const RMessage2& aMessage, CAlfStreamerServer* aServer)
+    {
+    switch (aOp)
+        {
+        case KAlfCompOpRequestEvent:
+            {
+            iIsListeningCompositionEvents = ETrue;    
+            if (!CompletedFromQueue(aMessage))
+                {
+                iMessagePtr = aMessage;
+                }
+            break;   
+            }
+            
+    case KAlfCompOpCancelEventRequest:
+            {
+            if (!iMessagePtr.IsNull())
+                {
+                iMessagePtr.Complete(KErrCancel);
+                }
+            aMessage.Complete(KErrNone);
+            break;   
+            }    
+
+    case KAlfCompositionWServReady:
+    case KAlfCompositionFrameReady:
+    case KAlfCompositionLowOnGraphicsMemory:
+    case KAlfCompositionGoodOnGraphicsMemory:    
+    case KAlfCompositionTargetHidden:
+    case KAlfCompositionTargetVisible:
+    case KAlfCompositionTargetCreated:
+        {
+        aServer->HandleCompositionEventL(this, aOp, aMessage);
+        break;
+        }
+
+    // temp, should go to window server to have more precise control on 
+    // operations    
+    case KAlfCompOpCreateToken:
+        {
+        TInt token = aServer->CreatePermissionToken( aMessage, reinterpret_cast<TInt>(this), this );
+        aMessage.Complete(token);
+        break;
+        }
+    case KAlfCompOpBindSourceToToken:
+        {
+        aServer->ValidateToken(this, aMessage);        // called method will complete aMessage 
+        break;
+        }
+    case KAlfCompOpSetZOrder:
+        iMessagePtr = aMessage; 
+    case KAlfCompOpCreateSource:
+    case KAlfCompOpEnableAlpha:
+    case KAlfCompOpSetOpacity:
+    case KAlfCompOpSetRotation: 
+    case KAlfCompOpSetExtent:
+    case KAlfCompOpEnableKb:
+    case KAlfComOpSetBackgroundAnim:
+    case KAlfCompOpSessionClosed:
+        {
+        aServer->HandleCompositionRequestL(this, aOp, aMessage);
+        break;
+        }
+    case KAlfCompositionWServScreenNumber:
+        {
+        iScreenNumber  = aMessage.Int0();
+        aMessage.Complete(KErrNone);
+        break;
+        }
+    case KAlfCompositionSourceScreenNumber:
+        {
+        TInt length = aMessage.GetDesLength(0);
+        User::LeaveIfError(length);
+        HBufC8* message = HBufC8::NewLC(length);
+        TPtr8 clientBuf = message->Des();
+        aMessage.ReadL(0,clientBuf);
+
+        TInt* ptr = (TInt*) clientBuf.Ptr();
+        iScreenNumber  = ptr[0];
+        
+        CleanupStack::PopAndDestroy(message);
+        aMessage.Complete(KErrNone);
+        break;
+        }
+    default:        
+        // add debug guards or remove
+        RDebug::Print(_L("Oops, unknown composition command: %d "), aOp);
+        User::Invariant();
+        }
+    }
+    
+TBool CAlfStreamerServerSession::CompletedFromQueue(const RMessage2& aMessage)
+    {
+    if (iQueue.Count())
+        {
+        TRAPD(err, aMessage.WriteL(0,*iQueue[0]/*->Des()*/));
+        TInt cmd = iCmds[0];
+        if (!err)
+            {
+            delete iQueue[0];
+            iQueue.Remove(0);
+            iCmds.Remove(0);
+            }
+        else
+            {
+            RDebug::Print(_L("CAlfStreamerServerSession::CompletedFromQueue err: %d"),err);
+            }
+        if( !iMessagePtr.IsNull())
+            {
+            iMessagePtr.Complete(err?err:cmd);
+            }
+        else
+            {
+            aMessage.Complete(err?err:cmd);
+            }
+        return ETrue;
+        }
+    return EFalse;
+    }
+    
+void CAlfStreamerServerSession::QueueL(const TPtrC8& aPtr, TInt aCmd)
+    {
+    if (!iIsListeningCompositionEvents)    
+        {
+        return;
+        }
+            
+    if (!iMessagePtr.IsNull())
+        {
+        TRAPD(err, iMessagePtr.WriteL(0,aPtr));
+        iMessagePtr.Complete(err?err:aCmd);
+        }    
+    else
+        {
+        HBufC8* ptr = aPtr.AllocLC();
+        TInt err = iCmds.Append(aCmd);
+        if (!err)
+            {
+            iQueue.AppendL(ptr);
+            }
+        User::LeaveIfError(err);    
+        CleanupStack::Pop();    
+        }        
+    }
+
+void CAlfStreamerServerSession::SetScreenNumber(TInt aScreennumber)
+    {
+    iScreenNumber = aScreennumber;
+    }
+
+TInt CAlfStreamerServerSession::ScreenNumber() const
+    {
+    return iScreenNumber;
+    }
+
+TSurfaceId& CAlfStreamerServerSession::ExtentSurfaceId()
+    {
+    return iExtentSurfaceId;
+    }
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alftextstylehandlers.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,271 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Text style handlers
+*
+*/
+
+
+
+#include "alftextstylehandlers.h"
+#include "alf/alfconstants.h"
+#include <uiacceltk/HuiEnv.h>
+#include <uiacceltk/huitextstylemanager.h>
+#include <gdi.h>
+
+//-----------------------------------------------------------------------------
+// Create a handler for platform, preconfigured, or cloned text style
+//-----------------------------------------------------------------------------
+TAlfTextStyleHandler::TAlfTextStyleHandler(
+    MAlfInterfaceProvider& aResolver, 
+    TInt aId1, 
+    TInt aId2,
+    TInt aConstructionType)
+	: iResolver(aResolver), iTextStyle( NULL )
+	{
+	// Retrieve the text style manager
+	CHuiTextStyleManager& manager = aResolver.SharedHuiEnv()->TextStyleManager();
+    TInt id = KErrNotFound;
+	
+
+    switch(aConstructionType)
+        {
+        case EAlfPlatformTextStyleCreate:
+        	TRAP_IGNORE(
+                {
+                // Get parent text style handler
+                TAlfTextStyleHandler* parentHandler = 
+                    static_cast<TAlfTextStyleHandler*>(
+                        aResolver.GetInterfaceL(EAlfTextStyleHandler, aId2));
+        	
+                // Create a platform text style
+                id = manager.CreatePlatformTextStyleL(
+                    aId1, 
+                    parentHandler->TextStyleId());
+                })
+                
+            iTextStyle = manager.TextStyle(id);
+        break;
+        
+        case EAlfPreconfiguredTextStyleCreate:
+	        iTextStyle = manager.TextStyle(aId1);
+        break;
+        
+        case EAlfPlatformTextStyleCopy:
+        	TRAP_IGNORE(
+                {
+                // Get parent text style handler
+                TAlfTextStyleHandler* sourceHandler = 
+                    static_cast<TAlfTextStyleHandler*>(
+                        aResolver.GetInterfaceL(EAlfTextStyleHandler, aId1));
+        	
+                // Create a platform text style
+                id = manager.CopyTextStyleL(sourceHandler->TextStyleId());
+                })
+                
+        	iTextStyle = manager.TextStyle(id);
+        break;
+        
+        default:
+        break;
+        }
+	}
+
+//-----------------------------------------------------------------------------
+// 
+//-----------------------------------------------------------------------------
+void TAlfTextStyleHandler::Release()
+	{
+	if ( iTextStyle )
+	    {
+	    CHuiTextStyleManager& manager = iResolver.SharedHuiEnv()->TextStyleManager();
+	    (void)manager.DeleteTextStyle( iTextStyle->Id() ); // ignore error
+	    }
+    delete this;	
+	}
+
+//-----------------------------------------------------------------------------
+// 
+//-----------------------------------------------------------------------------
+TAny* TAlfTextStyleHandler::GetInterface(const THuiInterfaceSupport& aInterface)
+	{
+	if(aInterface == EAlfTextStyleHandler)
+		{
+		return this;
+		}
+	return NULL;
+	}
+
+//-----------------------------------------------------------------------------
+// 
+//-----------------------------------------------------------------------------
+void TAlfTextStyleHandler::HandleCmdL(
+    TInt aCommandId, 
+    const TDesC8& aInputBuffer, 
+    TDes8& aResponse)
+	{
+    switch (aCommandId)
+        {
+		case EAlfTextStyleSetParent:
+		    {
+		    TInt* param = (TInt*) aInputBuffer.Ptr();		    
+			// Get parent text style handler
+			TAlfTextStyleHandler* parentHandler = 
+			    static_cast<TAlfTextStyleHandler*>(
+			        iResolver.GetInterfaceL(EAlfTextStyleHandler, *param));
+			iTextStyle->SetParentId(parentHandler->TextStyleId());
+		    break;		    	
+		    }
+		    
+        case EAlfTextStyleSetTextColor:
+	        {
+	        TRgb* param = (TRgb*) aInputBuffer.Ptr();
+	        iTextStyle->SetTextColor(*param);
+	        break;    
+	        }    
+    
+        case EAlfTextStyleSetTextSizeInTwips:
+	        {
+	        TInt2* params = (TInt2*) aInputBuffer.Ptr();
+	        iTextStyle->SetTextSizeInTwips(params->iInt1, params->iInt2);
+	        break;
+	        }
+
+        case EAlfTextStyleSetTextSizeInPixels:
+	        {
+	        TInt2* params = (TInt2*) aInputBuffer.Ptr();
+	        iTextStyle->SetTextSizeInPixels(params->iInt1, params->iInt2);
+	        break;
+	        }
+		        
+        case EAlfTextStyleSetBold:
+	        {
+	        TInt* param = (TInt*) aInputBuffer.Ptr();
+	        iTextStyle->SetStrokeWeight(*param);
+	        break;
+	        }	        
+	        
+        case EAlfTextStyleSetItalic:
+	        {
+	        TInt* param = (TInt*) aInputBuffer.Ptr();
+	        iTextStyle->SetPosture(*param);
+	        break;	        	
+	        }
+	        
+        case EAlfTextStyleSetUnderline:
+	        {
+	        TInt* param = (TInt*) aInputBuffer.Ptr();
+	        iTextStyle->SetUnderline(*param);
+	        break;	        		        	
+	        }
+	        
+        case EAlfTextStyleSetStrikeThrough:
+	        {
+	        TInt* param = (TInt*) aInputBuffer.Ptr();
+	        iTextStyle->SetStrikeThrough(*param);
+	        break;	
+	        }
+	        
+        case EAlfTextStyleTextColor:
+            {            
+            const TRgb textColor = iTextStyle->TextColor();
+            TPckg<TRgb> resultPckg(textColor);
+            aResponse = resultPckg;
+            break;
+            }
+            
+        case EAlfTextStyleSizeInTwips:
+	        {
+	        TInt* param = (TInt*) aInputBuffer.Ptr();
+            const TInt textSizeInTwips = iTextStyle->TextSizeInTwips(*param);
+            TPckg<TInt> resultPckg(textSizeInTwips);
+            aResponse = resultPckg;
+	        break;	
+	        }
+        	
+        case EAlfTextStyleSizeInPixels:
+	        {
+	        TInt* param = (TInt*) aInputBuffer.Ptr();
+            const TInt textSizeInPixels = iTextStyle->TextSizeInPixels(*param);
+            TPckg<TInt> resultPckg(textSizeInPixels);
+            aResponse = resultPckg;
+	        break;		        	
+	        }
+            
+        case EAlfTextStyleIsBold:
+	        {
+            const TBool isBold = iTextStyle->StrokeWeight();
+            TPckg<TBool> resultPckg(isBold);
+            aResponse = resultPckg;
+            break;	        	
+	        }
+	        
+        case EAlfTextStyleIsItalic:
+	        {
+	        const TBool isItalic = iTextStyle->Posture();
+	        TPckg<TBool> resultPckg(isItalic);
+	        aResponse = resultPckg;
+	        break;
+	        }	        
+	        
+        case EAlfTextStyleIsUnderline:
+	        {	        
+            const TBool isUnderline = iTextStyle->Underline();
+            TPckg<TBool> resultPckg(isUnderline);
+            aResponse = resultPckg;
+            break;
+	        }
+        
+        case EAlfTextStyleIsStrikeThrough:
+	        {
+            const TBool isStrikeThrough = iTextStyle->StrikeThrough();
+            TPckg<TBool> resultPckg(isStrikeThrough);
+            aResponse = resultPckg;
+            break;
+	        }
+
+        case EAlfTextStyleGetTypeface:
+	        {
+	        TTypeface typeface;
+            iTextStyle->GetTypeface( typeface );
+            TPckg<TTypeface> resultPckg(typeface);
+            aResponse = resultPckg;
+            break;
+	        }
+
+        case EAlfTextStyleSetTextPaneHeightInPixels:
+	        {
+	        TInt2* params = (TInt2*) aInputBuffer.Ptr();
+	        iTextStyle->SetTextPaneHeightInPixels(params->iInt1, params->iInt2);
+	        break;
+	        }
+        case EAlfTextStyleServerHandle:
+	        {
+	        TInt id = iTextStyle->Id();
+	        TPckg<TInt> resultPckg(id);
+            aResponse = resultPckg;
+	        break;
+	        }
+            
+        default:
+            User::Leave(KErrNotSupported);
+        }	
+	}
+
+//-----------------------------------------------------------------------------
+// 
+//-----------------------------------------------------------------------------
+TInt TAlfTextStyleHandler::TextStyleId() const
+	{
+	return iTextStyle->Id();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfvisualhandlers.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,2387 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 of alf built-in visual support
+*
+*/
+
+
+
+#include "alf/alfvisualhandlers.h"
+#include "alftextstylehandlers.h"
+#include "alf/alfconstants.h"
+#include <uiacceltk/HuiTextVisual.h>
+#include <uiacceltk/HuiGridLayout.h>
+#include <uiacceltk/HuiImageVisual.h>
+#include "alf/alfbrushhandlers.h"
+#include <alf/alfvisual.h>
+#include <alf/alftextvisual.h>
+#include <uiacceltk/HuiLineVisual.h>
+#include <uiacceltk/HuiMeshVisual.h>
+#include <uiacceltk/huiproceduralmesh.h>
+#include <uiacceltk/huim3gmesh.h>
+#include <uiacceltk/HuiUtil.h>
+#include <alf/alfmaterial.h>
+#include "alf/alfserverutils.h"
+#include "alfsrvvisualowner.h"
+#include <AknsConstants.h>
+#include "alf/alfappui.h"
+#include "alfsrvdropshadowhandler.h"
+#include <AknFontSpecification.h> // @todo mka
+#include <gdi.h> // @todo mka
+#include <uiacceltk/HuiCanvasVisual.h>
+
+// Remove when EAlfVisualEnableTransformation handing is fixed
+#include "alfappsrvsession.h"
+#include "alfsrvsubsessionbase.h"
+#include "alfsrvtransformationsubsession.h"
+
+#ifdef RD_ALF_IN_PLATFORM
+#include <aknlayout2hierarchy.h>
+#endif
+
+#include <avkon.hrh> //     ELayoutAlignNone, etc
+
+#include "HuiFxEngine.h"
+#include "HuiFxEffect.h"
+struct CAlfVisualHandler::TPrivateData
+    {
+    CAlfSrvVisualOwner* iVisualOwner;
+    };
+
+//----------------------------
+// Visual base
+//----------------------------
+EXPORT_C MAlfExtension* CAlfVisualHandler::NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout)
+    {
+    CAlfVisualHandler* me = new (ELeave) CAlfVisualHandler(aResolver);
+    CleanupStack::PushL(me);
+    me->ConstructL(NULL, *aOwner, aParentLayout);
+    CleanupStack::Pop();
+    return me;
+    }
+
+EXPORT_C CAlfVisualHandler::CAlfVisualHandler(MAlfInterfaceProvider& aResolver):iResolver(aResolver)
+    {
+    }
+
+
+EXPORT_C void CAlfVisualHandler::ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout)
+    {
+    if (!aVisual)
+        {
+        iVisual = CHuiVisual::AddNewL(aOwner, aParentLayout);          
+        }
+    else 
+        {
+        iVisual = aVisual;    
+        }
+        
+    iPrivateData = new (ELeave) TPrivateData;
+    iPrivateData->iVisualOwner = NULL;
+    
+    }
+
+
+EXPORT_C CAlfVisualHandler::~CAlfVisualHandler()
+    {
+    if ( iPrivateData )
+        {
+        if ( iPrivateData->iVisualOwner )
+            {
+            if ( iVisual ) // If the visual has not been deleted already
+                {
+                iVisual->SetOwner( *iPrivateData->iVisualOwner->RealOwner() );
+                }
+            delete iPrivateData->iVisualOwner;
+            iPrivateData->iVisualOwner = NULL;
+            }
+        }
+    delete iPrivateData;
+    iPrivateData = NULL;
+    
+    iVisual = NULL;
+    }
+
+EXPORT_C void CAlfVisualHandler::Release()
+    {
+    delete this;
+    }
+
+
+EXPORT_C TAny* CAlfVisualHandler::GetInterface(const THuiInterfaceSupport& aInterface)
+    {
+    switch (aInterface)
+        {
+        case EHuiObjectTypeVisual:
+            return iVisual;
+        case EAlfVisualHandler:
+            return this;
+        default:
+            return 0;
+                    
+        }
+
+    }
+
+void NullChildVisualHandlerPointers(
+    CHuiVisual& iVisual, 
+    const RPointerArray<CAlfSrvSubSessionBase>& aArray)
+    {
+    for(TInt i = iVisual.Count() - 1; i >= 0; --i)
+        {
+        NullChildVisualHandlerPointers( iVisual.Visual(i), aArray );
+        }
+        
+    for ( TInt h = 0 ; h < aArray.Count(); h++ )
+        {
+        if ( aArray[h]->AsHuiVisual() == &iVisual )
+            {
+            CAlfVisualHandler* visualHandler = static_cast<CAlfVisualHandler*>( aArray[h]->AsCommandHandler() );
+            visualHandler->HuiVisualAboutToTerminate();
+            }
+        }
+   
+    }
+
+void CAlfVisualHandler::HuiVisualAboutToTerminate()
+    {
+    iVisual = NULL;
+    }
+
+
+EXPORT_C void CAlfVisualHandler::HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    switch (aCommandId)
+        {
+        case EAlfVisualRemoveAndDestroyAll:
+            {
+            // we need to NULL all the child visual handlers
+            CHuiVisual* tmp = iVisual;
+            
+            CAlfAppSrvSessionBase& session = static_cast<CAlfAppSrvSessionBase&>( iResolver );
+            RPointerArray<CAlfSrvSubSessionBase> array;
+            TRAP_IGNORE( session.GetSubsessionsByTypeL( array, EAlfVisualHandler ) );
+            NullChildVisualHandlerPointers(*iVisual, array);
+            array.Close();
+            
+            tmp->RemoveAndDestroyAllD();
+            tmp = NULL;
+            break;                
+            }
+        
+        case EAlfVisualUpdateChildrenLayout:
+            {
+            TInt* transitionTime = (TInt*) aInputBuffer.Ptr();
+            iVisual->UpdateChildrenLayout( *transitionTime >= 0 ? *transitionTime : CHuiStatic::LayoutTransitionTime() );
+            break;
+            }
+                
+        case  EAlfVisualSetOpacity:
+            {
+            TAlfTimedValue* opacity = (TAlfTimedValue*) aInputBuffer.Ptr() ;
+            AlfTimedValueUtility::CopyTimedValue(*opacity, iVisual->iOpacity, iResolver);
+            break;    
+            }
+        
+        case EAlfVisualGetOpacity:
+            {
+            TAlfTimedValue opacity;
+            AlfTimedValueUtility::CopyTimedValue(iVisual->iOpacity, opacity);
+            TPckg<TAlfTimedValue> resultPckg(opacity);
+            
+            aResponse = resultPckg; // awkward     
+            break;
+            }
+        
+        case  EAlfVisualLocalToDisplay:
+            {
+            TAlfRealPoint* alfPoint = (TAlfRealPoint*) aInputBuffer.Ptr();
+            const THuiRealPoint realPoint( alfPoint->iX, alfPoint->iY );
+            
+            THuiRealPoint result = iVisual->LocalToDisplay( realPoint );
+
+            // if the visual is showing, the container layout rect is included
+            // in the LocalToDisplay calculations
+            if ( iVisual->Display() )
+                {
+                // if not showing, we need to add the display rect offset.
+                CAlfAppSrvSessionBase& session = static_cast<CAlfAppSrvSessionBase&>( iResolver );
+                result -= session.ClientDrawingArea().iTl;
+                }
+            
+            TAlfRealPoint alf_point(result.iX, result.iY);
+            TPckg<TAlfRealPoint> resultPckg(alf_point);            
+            
+            aResponse = resultPckg; // awkward 
+            break;     
+            }
+        
+        case  EAlfVisualDisplayToLocal:
+            {
+            TAlfRealPoint* alfPoint = (TAlfRealPoint*) aInputBuffer.Ptr();
+            THuiRealPoint realPoint( alfPoint->iX, alfPoint->iY );
+            
+            // if the visual is showing, the container layout rect is included
+            // in the DisplayToLocal calculations
+            if ( iVisual->Display() )
+                {
+                // if not showing, we need to reduce the display rect offset
+                // from the comparision value.
+                CAlfAppSrvSessionBase& session = static_cast<CAlfAppSrvSessionBase&>( iResolver );
+                realPoint += session.ClientDrawingArea().iTl;
+                }
+            
+            THuiRealPoint result = iVisual->DisplayToLocal( realPoint );
+                        
+            TAlfRealPoint alf_point(result.iX, result.iY);
+            TPckg<TAlfRealPoint> resultPckg(alf_point);            
+
+            aResponse = resultPckg; // awkward 
+            break;     
+            }
+        
+        case  EAlfVisualDisplayRectTarget:
+            {
+            THuiRealRect huiResult = iVisual->DisplayRectTarget();
+            
+            if ( iVisual->Display() )
+                {
+                CAlfAppSrvSessionBase& session = static_cast<CAlfAppSrvSessionBase&>( iResolver );
+                huiResult.Move( -session.ClientDrawingArea().iTl.iX, -session.ClientDrawingArea().iTl.iY ); 
+                }
+            
+            TAlfRealRect alfResult;
+            alfResult.iTl.iX = huiResult.iTl.iX;
+            alfResult.iTl.iY = huiResult.iTl.iY;
+            alfResult.iBr.iX = huiResult.iBr.iX;
+            alfResult.iBr.iY = huiResult.iBr.iY;
+            TPckg<TAlfRealRect> resultPckg(alfResult);
+            
+            aResponse = resultPckg; // awkward 
+            break;            
+            }
+        
+        case  EAlfVisualPos:
+            {
+            TAlfTimedPoint result;
+            AlfTimedPointUtility::CopyTimedPoint(iVisual->Pos(), result);             
+            
+            TPckg<TAlfTimedPoint> resultPckg(result);
+
+            aResponse = resultPckg; // awkward 
+            break;            
+            }
+        
+        case  EAlfVisualSetPos:
+            {
+            TAlfVisualPos* pos = (TAlfVisualPos*) aInputBuffer.Ptr();
+            
+            THuiRealPoint huiPoint( pos->iPoint.iX, pos->iPoint.iY );
+            
+            iVisual->SetPos(huiPoint, pos->iTime);
+            break;            
+            }
+            
+        
+        case EAlfVisualMoveToFront:
+            { 
+            iVisual->MoveToFront();
+            break;            
+            }
+        
+        case EAlfVisualSize:
+            {
+            TAlfTimedPoint a_size;
+            AlfTimedPointUtility::CopyTimedPoint(iVisual->Size(), a_size);             
+
+            TPckg<TAlfTimedPoint> sizePckg(a_size);
+            
+            aResponse = sizePckg; // awkward 
+            break;            
+            }
+        
+        case EAlfVisualSetSize:
+            {
+            TAlfVisualSize* size = (TAlfVisualSize*) aInputBuffer.Ptr();
+            iVisual->SetSize(THuiRealSize( size->iSize.iWidth,size->iSize.iHeight ) , size->iTime);
+
+            break;            
+            }
+            
+        case EAlfVisualBrushArrayReset:
+            {
+            if ( iVisual ) // during destruction the iVisual is already deleted
+                {
+                iVisual->EnableBrushesL( EFalse );
+                }
+            break;
+            }
+            
+
+        case EAlfVisualBrushArrayAppend:
+            {
+            TInt2* params = (TInt2*) aInputBuffer.Ptr();
+            
+            const THuiOwnership ownership = (THuiOwnership)params->iInt2;
+            
+            CHuiBrush* brush = (CHuiBrush*)iResolver.GetInterfaceL(EHuiObjectTypeBrush, params->iInt1);
+            iVisual->EnableBrushesL();
+            iVisual->Brushes()->AppendL(brush,ownership);
+            CAlfBrushHandler* holder = (CAlfBrushHandler*) iResolver.GetInterfaceL(EAlfBrushHandler, params->iInt1);
+            
+            // If the brush array is taking the ownership...
+            if ( ownership == EHuiHasOwnership )
+                {
+                // ... the brush holder cannot have it anymore
+                holder->SetOwnership(EFalse);
+                }
+            break;
+            }
+        case EAlfVisualBrushArrayInsert:
+            {
+            TInt3* params = (TInt3*) aInputBuffer.Ptr();
+            
+            CHuiBrush* brush = (CHuiBrush*)iResolver.GetInterfaceL(EHuiObjectTypeBrush, params->iInt1);
+            iVisual->EnableBrushesL();
+            iVisual->Brushes()->InsertL(params->iInt3, brush,(THuiOwnership)params->iInt2);
+            CAlfBrushHandler* holder = (CAlfBrushHandler*) iResolver.GetInterfaceL(EAlfBrushHandler, params->iInt1);
+            holder->SetOwnership(!params->iInt2); // THuiOwnership matches boolean 
+            break;
+            }
+        case EAlfVisualBrushArrayRemove:
+            {
+            if ( iVisual ) // iVisual is NULL:led i.e. deleted
+                {
+                TInt* params = (TInt*) aInputBuffer.Ptr();
+                iVisual->EnableBrushesL();
+                iVisual->Brushes()->Remove(*params);
+                }
+            break;
+            }
+            
+        case EAlfVisualSetFlag:
+            {
+            THuiVisualFlags* params = (THuiVisualFlags*) aInputBuffer.Ptr();
+            iVisual->SetFlag( *params );
+            break;
+            }
+            
+        case EAlfVisualSetFlags:
+            {
+            TUint* params = (TUint*) aInputBuffer.Ptr();
+            iVisual->SetFlags( *params );
+            break;
+            }
+            
+        case EAlfVisualClearFlag:
+            {
+            THuiVisualFlags* params = (THuiVisualFlags*) aInputBuffer.Ptr();
+            iVisual->ClearFlag( *params );
+            break;
+            }
+            
+        case EAlfVisualClearFlags:
+            {
+            TUint* params = (TUint*) aInputBuffer.Ptr();
+            iVisual->ClearFlags( *params );
+            break;
+            }
+            
+        case EAlfVisualFlags:
+            {
+            const TUint flags = iVisual->Flags();
+            TPckg<TUint> flagsPckg(flags);
+            aResponse = flagsPckg; // awkward 
+            break;
+            }
+            
+        case EAlfVisualSetPaddingInt:
+            {
+            TInt* params = (TInt*) aInputBuffer.Ptr();
+            iVisual->SetPadding( *params );
+            break;
+            }
+            
+        case EAlfVisualSetPaddingPoint:
+            {
+            TPoint* params = (TPoint*) aInputBuffer.Ptr();
+            iVisual->SetPadding( *params );
+            break;
+            }
+            
+        case EAlfVisualSetPaddingBox:
+            {
+            TAlfBoxMetric* metric = (TAlfBoxMetric*) aInputBuffer.Ptr();
+                    
+            THuiMetric newMetricLeft(metric->iLeft.iMagnitude, metric->iLeft.iUnit, metric->iLeft.iReferenceTextStyleId);
+            THuiMetric newMetricRight(metric->iRight.iMagnitude, metric->iRight.iUnit, metric->iRight.iReferenceTextStyleId);
+            THuiMetric newMetricTop(metric->iTop.iMagnitude, metric->iTop.iUnit, metric->iTop.iReferenceTextStyleId);
+            THuiMetric newMetricBottom(metric->iBottom.iMagnitude, metric->iBottom.iUnit, metric->iBottom.iReferenceTextStyleId);
+            
+            THuiBoxMetric newBoxMetric(newMetricLeft, newMetricRight, newMetricTop, newMetricBottom);
+            iVisual->SetPadding(newBoxMetric);
+            break;
+            }
+            
+        case EAlfVisualPaddingInPixels:
+            {
+            const THuiRealRect huiResult = iVisual->PaddingInPixels();  
+            
+            TAlfRealRect alfResult;
+            alfResult.iTl.iX = huiResult.iTl.iX;
+            alfResult.iTl.iY = huiResult.iTl.iY;
+            alfResult.iBr.iX = huiResult.iBr.iX;
+            alfResult.iBr.iY = huiResult.iBr.iY;
+            
+            TPckg<TAlfRealRect> resultPckg(alfResult);           
+            aResponse = resultPckg; // awkward 
+            break;    
+        }
+        
+        case EAlfVisualEnableTransformation:
+            {
+            TInt2* params = (TInt2*) aInputBuffer.Ptr();
+            
+            const TBool isTransformed = params->iInt2;
+            const TInt transHandle = params->iInt1;
+            
+            
+            // @todo: nasty hack
+            CAlfAppSrvSessionBase& session = static_cast<CAlfAppSrvSessionBase&>( iResolver );
+            CAlfSrvSubSessionBase& transSubSession = session.SubSession( transHandle );
+            CAlfSrvTransformationSubSession& transformationSubSession = 
+                static_cast<CAlfSrvTransformationSubSession&>(transSubSession);
+            
+            // Enable transformation
+            iVisual->EnableTransformationL( isTransformed );
+            CHuiTransformation* transformation = NULL;
+            if ( isTransformed )
+                {
+                transformation = &iVisual->Transformation();
+                }
+                
+            transformationSubSession.SetTransformation( transformation );
+            break;
+            }
+
+        case EAlfVisualDepthOffset:
+            {
+            TAlfTimedValue value;
+            AlfTimedValueUtility::CopyTimedValue(iVisual->iDepthOffset, value);             
+
+            TPckg<TAlfTimedValue> resultPckg(value);            
+            aResponse = resultPckg; // awkward                 
+            break;    
+            }
+
+        case EAlfVisualSetDepthOffset:
+            {
+            TAlfTimedValue* params = (TAlfTimedValue*) aInputBuffer.Ptr();            
+            AlfTimedValueUtility::CopyTimedValue(*params, iVisual->iDepthOffset, iResolver);
+            break;    
+            }
+
+        case EAlfVisualSetMinSize:
+            {
+            TSize* params = (TSize*) aInputBuffer.Ptr();
+            iVisual->SetMinSize( *params );            
+            break;    
+            }
+
+        case EAlfVisualGetMinSize:
+            {
+            TSize result = iVisual->MinSize();            
+            TPckg<TSize> resultPckg(result);
+            aResponse = resultPckg; // awkward 
+            break;    
+            }
+
+        case EAlfVisualSetMinSizeInBaseUnits:
+            {
+            TAlfRealSize* params = (TAlfRealSize*) aInputBuffer.Ptr();
+            const THuiRealSize minSize(params->iWidth, params->iHeight);
+            iVisual->SetMinSize( minSize );            
+            break;    
+            }
+
+        case EAlfVisualGetMinSizeInBaseUnits:
+            {
+            THuiRealSize result = iVisual->MinSizeInBaseUnits(); 
+            TAlfRealSize alfResult(result.iWidth, result.iHeight);  
+            TPckg<TAlfRealSize> resultPckg(alfResult);
+            aResponse = resultPckg; // awkward 
+            break;    
+            }
+
+        case EAlfVisualSetMaxSize:
+            {            
+            TSize* params = (TSize*) aInputBuffer.Ptr();
+            iVisual->SetMaxSize( *params );            
+            break;    
+            }
+
+        case EAlfVisualGetMaxSize:
+            {
+            TSize result = iVisual->MaxSize();            
+            TPckg<TSize> resultPckg(result);
+            aResponse = resultPckg; // awkward 
+            break;    
+            }
+
+        case EAlfVisualSetMaxSizeInBaseUnits:
+            {            
+            TAlfRealSize* params = (TAlfRealSize*) aInputBuffer.Ptr();
+            const THuiRealSize maxSize(params->iWidth, params->iHeight);
+            iVisual->SetMaxSize( maxSize );            
+            break;    
+            }
+
+        case EAlfVisualGetMaxSizeInBaseUnits:
+            {
+            THuiRealSize result = iVisual->MaxSizeInBaseUnits(); 
+            TAlfRealSize alfResult(result.iWidth, result.iHeight);  
+            TPckg<TAlfRealSize> resultPckg(alfResult);
+            aResponse = resultPckg; // awkward 
+            break;    
+            }
+
+        case EAlfVisualMove:
+            {            
+            TAlfVisualPos* pos = (TAlfVisualPos*) aInputBuffer.Ptr();           
+            const THuiRealPoint huiPoint(pos->iPoint.iX, pos->iPoint.iY);
+            iVisual->Move(huiPoint, pos->iTime);
+            break;            
+            }
+
+       case EAlfVisualSetCenteredPosAndSize:
+            {            
+            TAlfVisualPosSize* posAndSize = (TAlfVisualPosSize*) aInputBuffer.Ptr();            
+            const THuiRealPoint huiPoint(posAndSize->iPoint.iX, posAndSize->iPoint.iY);
+            const THuiRealSize huiSize(posAndSize->iSize.iWidth, posAndSize->iSize.iHeight);
+            iVisual->SetCenteredPosAndSize(huiPoint, huiSize, posAndSize->iTime);
+            break;            
+            }
+
+        case EAlfVisualDisplayRect:
+            {          
+            THuiRealRect huiResult = iVisual->DisplayRect();
+            
+            if ( iVisual->Display() )
+                {
+                CAlfAppSrvSessionBase& session = static_cast<CAlfAppSrvSessionBase&>( iResolver );
+                huiResult.Move( -session.ClientDrawingArea().iTl.iX, -session.ClientDrawingArea().iTl.iY );
+                }
+            
+            TAlfRealRect alfResult;
+            alfResult.iTl.iX = huiResult.iTl.iX;
+            alfResult.iTl.iY = huiResult.iTl.iY;
+            alfResult.iBr.iX = huiResult.iBr.iX;
+            alfResult.iBr.iY = huiResult.iBr.iY;
+            
+            TPckg<TAlfRealRect> resultPckg(alfResult);           
+            aResponse = resultPckg; // awkward 
+            break;    
+            }
+
+        case EAlfVisualEffectiveOpacity:
+            {
+            TReal32 value = iVisual->EffectiveOpacity();
+            TPckg<TReal32> resultPckg(value);            
+            aResponse = resultPckg; // awkward                 
+            break;    
+            }
+        case EAlfVisualSetPosTimed:
+            {
+            TAlfTimedPoint* params = (TAlfTimedPoint*) aInputBuffer.Ptr();                        
+            AlfTimedValueUtility::CopyTimedValue(params->iX, iVisual->Pos().iX, iResolver);
+            AlfTimedValueUtility::CopyTimedValue(params->iY, iVisual->Pos().iY, iResolver);
+            break;        
+            }            
+        case EAlfVisualSetSizeTimed:            
+            {
+            TAlfTimedPoint* params = (TAlfTimedPoint*) aInputBuffer.Ptr();                        
+            AlfTimedValueUtility::CopyTimedValue(params->iX, iVisual->Size().iX, iResolver);
+            AlfTimedValueUtility::CopyTimedValue(params->iY, iVisual->Size().iY, iResolver);
+            break;        
+            }
+            
+        case EAlfVisualLayoutUpdatedNotification:
+            {
+            if ( !iPrivateData->iVisualOwner )
+                {
+                // @todo: nasty hack
+                CAlfAppSrvSessionBase& session = static_cast<CAlfAppSrvSessionBase&>( iResolver );
+                iPrivateData->iVisualOwner = CAlfSrvVisualOwner::NewL( session, &iVisual->Owner() );
+                iVisual->SetOwner( *iPrivateData->iVisualOwner );
+                }
+            
+            TInt commandId = iResolver.HandleCurrentCommanndAsynch();
+            iPrivateData->iVisualOwner->SetVisualLayoutUpdatedNotificationId( commandId );
+            break;
+            }
+        case EAlfSubSCancelAsynchRequest:
+            {
+            TInt2* inptr =  (TInt2*) aInputBuffer.Ptr();
+            if (inptr->iInt2 != EAlfVisualLayoutUpdatedNotification )
+                { 
+                // strange one, someone tries to cancel something we don't support
+                // we shouldn't leave on cancel though
+                break;
+                }
+            // else let fall through    
+            }
+        case EAlfVisualLayoutUpdatedNotificationCancel:
+            {
+            if ( iPrivateData->iVisualOwner )
+                {
+                if ( iVisual ) // If the visual has not been deleted already
+                    {
+                    iVisual->SetOwner( *iPrivateData->iVisualOwner->RealOwner() );
+                    }
+                delete iPrivateData->iVisualOwner;
+                iPrivateData->iVisualOwner = NULL;
+                }    
+            break;
+            }
+
+        case EAlfVisualCopyValuesFromOtherVisual:
+            {
+            TInt3* inptr =  (TInt3*) aInputBuffer.Ptr();
+            CHuiVisual* sourceVisual = (CHuiVisual*) iResolver.GetInterfaceL( EHuiObjectTypeVisual, inptr->iInt1 );
+            if (inptr->iInt2&AlfVisualProperties::ESize)
+                {
+                THuiRealPoint gotThePoint = sourceVisual->Size().RealTarget(); 
+                THuiRealSize rs(gotThePoint.iX, gotThePoint.iY);
+                iVisual->SetSize(rs, inptr->iInt3 );
+                }
+            if (inptr->iInt2&AlfVisualProperties::EPosition)
+                { 
+                THuiRealPoint gotThePoint = sourceVisual->Pos().RealTarget(); 
+                THuiRealPoint rPoint(gotThePoint.iX, gotThePoint.iY);
+                iVisual->SetPos(rPoint, inptr->iInt3);
+                }
+            if (inptr->iInt2&AlfVisualProperties::EOpacity)
+                {
+                iVisual->iOpacity.Set(sourceVisual->iOpacity.Target(), inptr->iInt3); 
+                }
+            if (inptr->iInt2&AlfVisualProperties::EDepthOffset)
+                {
+                iVisual->iDepthOffset.Set( sourceVisual->iDepthOffset.Target(), inptr->iInt3);
+                }
+            break;
+            }
+
+        case EAlfVisualPauseProperties:
+            {
+            TInt* inptr =  (TInt*) aInputBuffer.Ptr();
+            if (*inptr&AlfVisualProperties::ESize)
+                {
+                iVisual->Size().iX.Suspend(); 
+                iVisual->Size().iY.Suspend(); 
+                }
+            if (*inptr&AlfVisualProperties::EPosition)
+                { 
+                iVisual->Pos().iX.Suspend(); 
+                iVisual->Pos().iY.Suspend(); 
+                }
+            if (*inptr&AlfVisualProperties::EOpacity)
+                {
+                iVisual->iOpacity.Suspend(); 
+                }
+            if (*inptr&AlfVisualProperties::EDepthOffset)
+                {
+                iVisual->iDepthOffset.Suspend();
+                }
+            break;
+            }
+
+        case EAlfVisualResumeProperties:
+            {
+            TInt* inptr =  (TInt*) aInputBuffer.Ptr();
+            if (*inptr&AlfVisualProperties::ESize)
+                {
+                iVisual->Size().iX.Suspend(EFalse); 
+                iVisual->Size().iY.Suspend(EFalse); 
+                }
+            if (*inptr&AlfVisualProperties::EPosition)
+                { 
+                iVisual->Pos().iX.Suspend(EFalse); 
+                iVisual->Pos().iY.Suspend(EFalse); 
+                }
+            if (*inptr&AlfVisualProperties::EOpacity)
+                {
+                iVisual->iOpacity.Suspend(EFalse); 
+                }
+            if (*inptr&AlfVisualProperties::EDepthOffset)
+                {
+                iVisual->iDepthOffset.Suspend(EFalse);
+                }
+            break;
+            }
+            
+        case EAlfVisualSetTactileFeedback:
+            {
+            TInt2* value = (TInt2*) aInputBuffer.Ptr();
+            iVisual->SetTactileFeedbackL( value->iInt1, value->iInt2 );
+            }
+            break;
+            
+        case EAlfVisualHasTactileFeedback:
+            {
+            TInt* value = (TInt*) aInputBuffer.Ptr();
+            TBool answer = iVisual->HasTactileFeedback( *value );
+            TPckg<TBool> resultPckg(answer);           
+            aResponse = resultPckg;
+            }
+            break;
+            
+        case EAlfVisualRemoveTactileFeedback:
+            {
+            TInt* value = (TInt*) aInputBuffer.Ptr();
+            iVisual->RemoveTactileFeedback( *value );
+            }
+            break;
+            
+        case EAlfVisualEnableDropShadow:
+            {
+            const TBool* const enable = (TBool*) aInputBuffer.Ptr();
+            iVisual->EnableDropShadowL( *enable );
+            }
+            break;
+            
+        case EAlfVisualSetEffect:
+            {
+            // TODO: handle errors more gracefully
+            // TODO: effect merging
+            TAlfVisualEffectParams* params = (TAlfVisualEffectParams*)aInputBuffer.Ptr();
+            CHuiFxEngine* engine = iVisual->Env().EffectsEngine();
+            if (engine)
+                {
+                CHuiFxEffect* effect = NULL;
+                engine->LoadEffectL( params->iFileName, effect, iVisual->Effectable() );
+                // The effect will be automatically set to the visual if parsing succeeds
+                }
+            break;
+            }
+        case EAlfVisualSetGroupEffect:
+            {
+            TAlfVisualEffectParams* params = (TAlfVisualEffectParams*)aInputBuffer.Ptr();
+            TInt groupHandle = params->iGroupHandle;
+            CHuiFxEngine* engine = iVisual->Env().EffectsEngine();
+            if (engine)
+                {
+                CHuiFxEffect* effect = NULL;
+                // this will add the group, if it does not exist already
+                // Begin and End group events are supposed to come through GfxTransEffect API.
+                engine->BeginGroupEffect(groupHandle); 
+                engine->LoadGroupEffectL( params->iFileName, effect, iVisual->Effectable(),groupHandle );
+                // The effect will be automatically set to the visual if parsing succeeds
+                }
+            break;
+            }            
+        case EAlfVisualRemoveEffect:
+            {
+            iVisual->SetEffect(NULL);
+            break;
+            }
+
+        default:
+            
+            if ( AlfSrvDropShadowHandler::CanHandleCommand( aCommandId ) )
+                {
+                CHuiDropShadow* shadow = iVisual->DropShadowHandler();
+                
+                // Drop shadow should be enabled first
+                __ASSERT_DEBUG( shadow , User::Leave( KErrGeneral ) );
+                
+                if ( !shadow )
+                    {
+                    iVisual->EnableDropShadowL( ETrue );
+                    shadow = iVisual->DropShadowHandler();
+                    }
+                
+                AlfSrvDropShadowHandler::HandleCommandL( *shadow, aCommandId, aInputBuffer, aResponse );
+                break;
+                }
+        
+            User::Leave(KErrNotSupported);
+        }
+    }
+
+EXPORT_C void CAlfVisualHandler::VisualHandlerExtension(const TUid& /*aExtensionUid*/, TAny** /*aExtensionParameters*/)
+    {
+    }
+
+//----------------------------
+// TextVisual
+//----------------------------
+EXPORT_C MAlfExtension* CAlfTextVisualHandler::NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout)
+    {
+    CAlfTextVisualHandler* me = new (ELeave) CAlfTextVisualHandler(aResolver);
+    CleanupStack::PushL(me);
+    me->ConstructL(NULL, *aOwner, aParentLayout);
+    CleanupStack::Pop();
+    return me;
+    }
+
+
+EXPORT_C CAlfTextVisualHandler::CAlfTextVisualHandler(MAlfInterfaceProvider& aResolver):CAlfVisualHandler(aResolver)
+    {
+    }
+
+
+EXPORT_C void CAlfTextVisualHandler::ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout)
+    {
+    if (!aVisual)
+        {
+        CHuiTextVisual* textVisual = CHuiTextVisual::AddNewL(aOwner, aParentLayout); 
+        CAlfVisualHandler::ConstructL(textVisual, aOwner, aParentLayout);
+        }
+    else 
+        {
+        CAlfVisualHandler::ConstructL(aVisual, aOwner, aParentLayout);
+        }
+    }
+
+
+EXPORT_C CAlfTextVisualHandler::~CAlfTextVisualHandler()
+    {
+    }
+
+EXPORT_C void CAlfTextVisualHandler::Release()
+    {
+    delete this;
+    }
+
+
+EXPORT_C TAny* CAlfTextVisualHandler::GetInterface(const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfVisualHandler::GetInterface(aInterface);
+    }
+
+
+EXPORT_C void CAlfTextVisualHandler::HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    CHuiTextVisual* visual = static_cast<CHuiTextVisual*>(iVisual);
+    
+    switch (aCommandId)
+        {
+        case  EAlfTextVisualSetText:           
+            {
+            TPtrC text((const TUint16*)aInputBuffer.Ptr(), aInputBuffer.Length()/2);                        
+            visual->SetTextL(text);
+            break;                
+            }
+        
+        case  EAlfTextVisualSetStyle:
+            {      
+            TInt2* params = (TInt2*) aInputBuffer.Ptr();
+            visual->SetStyle( (THuiPreconfiguredTextStyle)params->iInt1,(THuiBackgroundType)params->iInt2 );
+            break;    
+            }
+        
+        case  EAlfTextVisualSetTextStyle:
+            {
+    		// Convert text style id to server domain
+            TInt* value = (TInt*) aInputBuffer.Ptr();            	
+    		TAlfTextStyleHandler* textStyleHandler = static_cast<TAlfTextStyleHandler*>(iResolver.GetInterfaceL(EAlfTextStyleHandler, *value));    		
+            visual->SetTextStyle(textStyleHandler->TextStyleId());
+            break;    
+            }
+        
+        case  EAlfTextVisualSetEffects:
+            {
+            // This is for future expansion, unimplemented.
+            break;    
+            }
+        
+        case EAlfTextVisualSetAlign:
+            {
+            TInt2* params = (TInt2*) aInputBuffer.Ptr();
+            visual->SetAlign( (THuiAlignHorizontal)params->iInt1,(THuiAlignVertical)params->iInt2 );
+            break;
+            }
+            
+        case EAlfTextVisualSetLineSpacing:
+            {
+            TInt2* params = (TInt2*) aInputBuffer.Ptr();
+            visual->SetLineSpacing( params->iInt1, (CHuiTextVisual::TLineSpacingUnits)params->iInt2 );
+            break;
+            }
+            
+        case EAlfTextVisualTextExtents:
+            {
+            const TSize size = visual->TextExtents();
+            TPckg<TSize> resultPckg(size);            
+            aResponse = resultPckg; // awkward 
+            break;
+            }
+            
+        case EAlfTextVisualSubstringExtents:
+            {
+            TInt2* params = (TInt2*) aInputBuffer.Ptr();            
+            const TRect size = visual->SubstringExtents(params->iInt1, params->iInt2);
+            TPckg<TRect> resultPckg(size);            
+            aResponse = resultPckg; // awkward 
+            break;
+            }
+                        
+        case EAlfTextVisualStyle:
+            {
+            const TInt2 result( 
+                visual->Style(),
+                visual->BackgroundType() );
+            
+            
+            TPckg<TInt2> resultPckg(result);            
+            aResponse = resultPckg; // awkward 
+            break;
+            }
+                                            
+        case EAlfTextVisualSetMaxLineCount:
+            {
+            TInt* value = (TInt*) aInputBuffer.Ptr();
+            visual->SetMaxLineCount(*value);
+            break;
+            }
+
+        case EAlfTextVisualMaxLineCount:
+            {
+            const TInt value = visual->MaxLineCount();
+            TPckg<TInt> resultPckg(value);            
+            aResponse = resultPckg; // awkward 
+            break;
+            }
+
+        case EAlfTextVisualWrapping:
+            {
+            // Client side uses CAlfTextVisual::TLineWrap, should be compatible.
+            CHuiTextVisual::TLineWrap value = visual->Wrapping();
+            TPckg<CHuiTextVisual::TLineWrap> resultPckg(value);            
+            aResponse = resultPckg; // awkward 
+            break;
+            }
+
+        case EAlfTextVisualSetWrapping:
+            {
+            CHuiTextVisual::TLineWrap* value = (CHuiTextVisual::TLineWrap*) aInputBuffer.Ptr();
+            visual->SetWrapping(*value);
+            break;
+            }
+
+        /* deprecated
+        case EAlfTextVisualShadowOpacity:
+        case EAlfTextVisualSetShadowOpacity:        
+        */
+            
+        case EAlfTextVisualSetColor:        
+            {
+            TAlfTextVisualFontColorParams* value = (TAlfTextVisualFontColorParams*) aInputBuffer.Ptr();
+            if (value->iId == KAknsIIDNone)
+                {
+                visual->SetColor(value->iColor);                        
+                }
+            else
+                {
+                visual->SetColor(value->iId, value->iIndex);                                            
+                }    
+            break;
+            }
+            
+        case EAlfTextVisualOffset:        
+            {
+            TAlfTimedPoint value;
+            AlfTimedPointUtility::CopyTimedPoint(visual->Offset(), value);
+            TPckg<TAlfTimedPoint> resultPckg(value);            
+            aResponse = resultPckg; // awkward 
+            break;
+            }            
+        case EAlfTextVisualSetOffset:
+            {
+            TAlfTimedPoint* value = (TAlfTimedPoint*) aInputBuffer.Ptr();
+            AlfTimedPointUtility::CopyTimedPoint(*value, visual->Offset(), iResolver);
+            break;
+            }
+        case EAlfTextVisualSetHighlightRange:
+        	{
+			TAlfTextVisualSetHighlightRangeParams* value = (TAlfTextVisualSetHighlightRangeParams*) aInputBuffer.Ptr();        	
+			visual->SetHighlightRange(value->iStart, value->iEnd, value->iHighlightColor, value->iHighlightTextColor);
+			break;
+        	}    
+
+        /* deprecated
+        case EAlfTextVisualEnableShadow:        
+        */       
+        case EAlfTextVisualSetRasterizedMesh:
+            {
+        	visual->UpdateMeshL(aInputBuffer);
+        	break;
+            }
+        	
+        case EAlfVisualCopyValuesFromOtherVisual:
+        case EAlfVisualPauseProperties:
+        case EAlfVisualResumeProperties:        
+            {
+            if (aCommandId == EAlfVisualCopyValuesFromOtherVisual)
+                {
+                TInt3* inptr =  (TInt3*) aInputBuffer.Ptr();
+                CHuiTextVisual* sourceVisual = (CHuiTextVisual*) iResolver.GetInterfaceL( EHuiObjectTypeVisual, inptr->iInt1 );
+                if (inptr->iInt2&AlfVisualProperties::ETextVisShadowOpacity)
+                    {
+                    visual->iShadow.Set(sourceVisual->iShadow.Target(), inptr->iInt3 );
+                    }
+                }
+            else if (aCommandId == EAlfVisualPauseProperties)
+                {
+                TInt* inptr =  (TInt*) aInputBuffer.Ptr();
+                if (*inptr&AlfVisualProperties::ETextVisShadowOpacity)
+                    {
+                    visual->iShadow.Suspend();
+                    }
+                }
+            else  // AlfVisualResumeProperties
+                {
+                TInt* inptr =  (TInt*) aInputBuffer.Ptr();
+                if (*inptr&AlfVisualProperties::ETextVisShadowOpacity)
+                    {
+                    visual->iShadow.Suspend(EFalse);
+                    }
+                }
+            } // FALL THROUGH !!
+        default:
+            CAlfVisualHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+        }
+    }
+
+EXPORT_C void CAlfTextVisualHandler::VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+    CAlfVisualHandler::VisualHandlerExtension(aExtensionUid,aExtensionParameters);
+    }
+
+ 
+//----------------------------
+// LCTTextVisual
+//----------------------------
+EXPORT_C MAlfExtension* CAlfLCTTextVisualHandler::NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout)
+    {
+    CAlfLCTTextVisualHandler* me = new (ELeave) CAlfLCTTextVisualHandler(aResolver);
+    CleanupStack::PushL(me);
+    me->ConstructL(NULL, *aOwner, aParentLayout);
+    CleanupStack::Pop();
+    return me;
+    }
+
+
+EXPORT_C CAlfLCTTextVisualHandler::CAlfLCTTextVisualHandler(MAlfInterfaceProvider& aResolver):CAlfTextVisualHandler(aResolver)
+    {
+    }
+
+
+EXPORT_C void CAlfLCTTextVisualHandler::ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout)
+    {
+    if (!aVisual)
+        {
+        CHuiTextVisual* textVisual = CHuiTextVisual::AddNewL(aOwner, aParentLayout); 
+        CAlfVisualHandler::ConstructL(textVisual, aOwner, aParentLayout);
+        }
+    else 
+        {
+        CAlfVisualHandler::ConstructL(aVisual, aOwner, aParentLayout);
+        }
+    }
+
+
+EXPORT_C CAlfLCTTextVisualHandler::~CAlfLCTTextVisualHandler()
+    {
+    }
+
+
+EXPORT_C void CAlfLCTTextVisualHandler::Release()
+    {
+    delete this;
+    }
+
+
+EXPORT_C TAny* CAlfLCTTextVisualHandler::GetInterface(const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfTextVisualHandler::GetInterface(aInterface);
+    }
+
+
+EXPORT_C void CAlfLCTTextVisualHandler::HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    switch (aCommandId)
+        {
+        case  EAlfLCTTextVisualSetTextPane:
+            {
+#ifdef RD_ALF_IN_PLATFORM
+            CHuiTextVisual* visual = static_cast<CHuiTextVisual*>(iVisual);
+            TAlfLCTTextVisualSetTextPaneParams* params = (TAlfLCTTextVisualSetTextPaneParams*)aInputBuffer.Ptr();
+
+            TAknLayoutHierarchyComponentHandle handle;
+            handle.SetApiId(params->iApiId);
+            handle.SetComponentId(params->iComponentId);
+            handle.SetVarietyIndex(params->iVarietyIndex);
+            handle.SetColumn(params->iColumn);
+            handle.SetRow(params->iRow);
+    
+            // we can access the layout data as a text line, as we are expecting it to be a text pane
+            TAknTextLineLayout componentLayout = AknLayout2Hierarchy::GetTextComponentLayout(handle).LayoutLineNoEmptys();
+            SetTextPaneL(visual, componentLayout);
+#endif // RD_ALF_IN_PLATFORM
+
+            break;                
+            }
+            
+        default:
+            CAlfTextVisualHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+        }
+    }
+
+#ifdef RD_ALF_IN_PLATFORM
+void CAlfLCTTextVisualHandler::SetTextPaneL(CHuiTextVisual* aTextVisual, const TAknTextLineLayout& aLine)
+    {
+    THuiAlignHorizontal alignHorizontal(EHuiAlignHLocale);
+    switch(aLine.iJ)
+        {
+        case ELayoutAlignNone:
+            alignHorizontal = EHuiAlignHLocale;
+            break;
+        case ELayoutAlignCenter:
+            alignHorizontal = EHuiAlignHCenter;
+            break;
+        case ELayoutAlignLeft:
+            alignHorizontal = EHuiAlignHLeft;
+            break;
+        case ELayoutAlignRight:
+            alignHorizontal = EHuiAlignHRight;
+            break;
+        case ELayoutAlignBidi:
+            alignHorizontal = EHuiAlignHBidirectionalText;
+            break;
+        default:
+            alignHorizontal = EHuiAlignHLocale;
+            break;
+        }
+  
+    aTextVisual->SetAlign(alignHorizontal, EHuiAlignVCenter);// always vertical center, as anchor will have been already set to text pane height
+
+    // Create a platform text style
+    CHuiTextStyleManager& manager = iResolver.SharedHuiEnv()->TextStyleManager();
+    TInt textStyleId = manager.CreatePlatformTextStyleL(aLine.iFont);
+    aTextVisual->SetTextStyle(textStyleId);
+    }
+#else // RD_ALF_IN_PLATFORM
+void CAlfLCTTextVisualHandler::SetTextPaneL(CHuiTextVisual* /*aTextVisual*/, const TAknTextLineLayout& /*aLine*/)
+    {
+    
+    }
+#endif // RD_ALF_IN_PLATFORM
+    
+
+EXPORT_C void CAlfLCTTextVisualHandler::VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+    CAlfVisualHandler::VisualHandlerExtension(aExtensionUid,aExtensionParameters);
+    }
+
+
+//----------------------------
+// ImageVisual
+//----------------------------
+
+EXPORT_C MAlfExtension* CAlfImageVisualHandler::NewL(MAlfInterfaceProvider& aResolver, CHuiControl* aOwner, CHuiLayout* aParentLayout)
+    {
+    CAlfImageVisualHandler* me = new (ELeave) CAlfImageVisualHandler(aResolver);
+    CleanupStack::PushL(me);
+    me->ConstructL(NULL, *aOwner, aParentLayout);
+    CleanupStack::Pop();
+    return me;
+    }
+
+
+EXPORT_C CAlfImageVisualHandler::CAlfImageVisualHandler(MAlfInterfaceProvider& aResolver):CAlfVisualHandler(aResolver)
+    {
+    }
+
+
+EXPORT_C void CAlfImageVisualHandler::ConstructL(CHuiVisual* aVisual, CHuiControl& aOwner, CHuiLayout* aParentLayout)
+    {
+    if (!aVisual)
+        {
+        CHuiImageVisual* imageVisual = CHuiImageVisual::AddNewL(aOwner, aParentLayout); 
+        CAlfVisualHandler::ConstructL(imageVisual, aOwner, aParentLayout);
+        }
+    else 
+        {
+        CAlfVisualHandler::ConstructL(aVisual, aOwner, aParentLayout);
+        }
+    }
+
+
+EXPORT_C CAlfImageVisualHandler::~CAlfImageVisualHandler()
+    {
+    }
+
+EXPORT_C void CAlfImageVisualHandler::Release()
+    {
+    delete this;    
+    }
+
+
+EXPORT_C TAny* CAlfImageVisualHandler::GetInterface(const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfVisualHandler::GetInterface(aInterface);    
+    }
+
+
+EXPORT_C void CAlfImageVisualHandler::HandleCmdL(TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse)
+    {
+    CHuiImageVisual* visual = static_cast<CHuiImageVisual*>(iVisual);
+    
+    switch (aCommandId)
+        {        
+        case  EAlfImageVisualSetImage:           
+            {
+        	TAlfImageParams* params = (TAlfImageParams*) aInputBuffer.Ptr();
+        	
+            // Todo: is is safe enough to handle textures as direct casts..
+        	TInt handle = params->iTextureHandle;
+        	MHuiTexture* texture = (MHuiTexture*)handle;
+   	        
+   	        THuiImage huiImage;
+   	        if (texture)
+   	            {
+   	            huiImage = THuiImage(*texture,//*(dynamic_cast<MHuiTexture*>(animgif)), 
+	                params->iTl.iX.ValueNow(),
+	                params->iTl.iY.ValueNow(),
+	                params->iBr.iX.ValueNow(),
+	                params->iBr.iY.ValueNow());    
+   	            
+    	        // We take transition time from one, assuming it is same for everyone.
+    	        TInt transitionTime = params->iBr.iY.TimeToTargetinMilliSeconds();
+    	        
+    	        huiImage.SetTexCoords(params->iTl.iX.Target(),
+    	            params->iTl.iY.Target(),
+    	            params->iBr.iX.Target(),
+    	            params->iBr.iY.Target(),
+    	            transitionTime );
+   	            }
+   	        
+	        visual->SetImage( huiImage );
+            break;                
+            }
+        
+        case  EAlfImageVisualSetScaleMode:           
+            {
+            TInt* mode = (TInt*) aInputBuffer.Ptr();
+        	visual->SetScaleMode(CHuiImageVisual::TScaleMode(*mode));
+            break;                
+            }
+        
+        case  EAlfImageVisualSetSecondaryImage:           
+            {
+        	TAlfImageParams* params = (TAlfImageParams*) aInputBuffer.Ptr();
+        	
+            // Todo: is is safe enough to handle textures as direct casts..
+        	TInt handle = params->iTextureHandle;
+        	MHuiTexture* texture = (MHuiTexture*)(handle);
+   	        
+   	        THuiImage huiImage;
+   	        if (texture)
+   	            {
+   	            huiImage = THuiImage(*texture, 
+	                params->iTl.iX.ValueNow(),
+	                params->iTl.iY.ValueNow(),
+	                params->iBr.iX.ValueNow(),
+	                params->iBr.iY.ValueNow());    
+   	            
+    	        // We take transition time from one, assuming it is same for everyone.
+    	        TInt transitionTime = params->iBr.iY.TimeToTargetinMilliSeconds();
+    	        
+    	        huiImage.SetTexCoords(params->iTl.iX.Target(),
+    	            params->iTl.iY.Target(),
+    	            params->iBr.iX.Target(),
+    	            params->iBr.iY.Target(),
+    	            transitionTime );
+   	            }
+
+	        visual->SetSecondaryImage( huiImage );
+            break;                
+            }
+        
+        case  EAlfImageVisualSetSecondaryAlpha:           
+            {
+            TAlfTimedValue* alpha = (TAlfTimedValue*) aInputBuffer.Ptr();
+            AlfTimedValueUtility::CopyTimedValue(*alpha, visual->iSecondaryAlpha, iResolver);
+            break;                
+            }
+
+        case  EAlfImageVisualSecondaryAlpha:           
+            {
+            TAlfTimedValue value;
+            AlfTimedValueUtility::CopyTimedValue(visual->iSecondaryAlpha, value);             
+
+            TPckg<TAlfTimedValue> resultPckg(value);            
+            aResponse = resultPckg; 
+            break;
+            }
+        
+        case  EAlfImageVisualSetColor:           
+            {
+            TRgb* color = (TRgb*) aInputBuffer.Ptr();
+        	visual->SetColor(*color);
+            break;                
+            }
+        
+        case  EAlfImageVisualSetColorMode:           
+            {
+            TIntTReal* mode = (TIntTReal*) aInputBuffer.Ptr();
+        	visual->SetColorMode(CHuiImageVisual::TColorMode(mode->iInt),mode->iReal);
+            break;                
+            }
+        
+        case  EAlfImageVisualSetStretch:           
+            {
+            TInt2* mode = (TInt2*) aInputBuffer.Ptr();
+        	visual->SetStretch(mode->iInt1,mode->iInt2);
+            break;                
+            }
+        
+        case  EAlfImageVisualSetStretchMode:           
+            {
+            CHuiGc::TStretchMode* mode = (CHuiGc::TStretchMode*) aInputBuffer.Ptr();
+        	visual->SetStretchMode(*mode);
+            break;                
+            }
+        
+        /* deprecated
+        case  EAlfImageVisualSetDropShadow:           
+        case  EAlfImageVisualSetDropShadowMetric:
+        */
+            
+        case EAlfImageVisualSetTurnAngle:
+            {
+            TAlfTimedValue* value = (TAlfTimedValue*) aInputBuffer.Ptr();
+            AlfTimedValueUtility::CopyTimedValue(*value, visual->iTurnAngle, iResolver);
+            break;    
+            }
+        case  EAlfImageVisualTurnAngle:           
+            {
+            TAlfTimedValue value;
+            AlfTimedValueUtility::CopyTimedValue(visual->iTurnAngle, value);             
+            TPckg<TAlfTimedValue> resultPckg(value);            
+            aResponse = resultPckg; 
+            break;
+            }
+        case EAlfImageVisualSetScale:
+            {
+            TAlfTimedValue* value = (TAlfTimedValue*) aInputBuffer.Ptr();
+            AlfTimedValueUtility::CopyTimedValue(*value, visual->iScale, iResolver);
+            break;    
+            }
+        case  EAlfImageVisualScale:           
+            {
+            TAlfTimedValue value;
+            AlfTimedValueUtility::CopyTimedValue(visual->iScale, value);             
+            TPckg<TAlfTimedValue> resultPckg(value);            
+            aResponse = resultPckg; 
+            break;
+            }
+        case EAlfImageVisualSetOffset:
+            {
+            TAlfTimedPoint* value = (TAlfTimedPoint*) aInputBuffer.Ptr();
+            AlfTimedValueUtility::CopyTimedValue(value->iX, visual->iOffset.iX, iResolver);
+            AlfTimedValueUtility::CopyTimedValue(value->iY, visual->iOffset.iY, iResolver);
+            break;    
+            }
+        case  EAlfImageVisualOffset:           
+            {
+            TAlfTimedPoint value;
+            AlfTimedPointUtility::CopyTimedPoint(visual->iOffset, value);             
+            TPckg<TAlfTimedPoint> resultPckg(value);            
+            aResponse = resultPckg; 
+            break;
+            }
+        case EAlfVisualCopyValuesFromOtherVisual:
+        case EAlfVisualPauseProperties:
+        case EAlfVisualResumeProperties:        
+            {
+            if (aCommandId == EAlfVisualCopyValuesFromOtherVisual)
+                {
+                TInt3* inptr =  (TInt3*) aInputBuffer.Ptr();
+                CHuiImageVisual* sourceVisual = (CHuiImageVisual*) iResolver.GetInterfaceL( EHuiObjectTypeVisual, inptr->iInt1 );
+                if (inptr->iInt2&AlfVisualProperties::ESecondaryImageAlpha)
+                    {
+                    visual->iSecondaryAlpha.Set(sourceVisual->iSecondaryAlpha.Target(), inptr->iInt3 );
+                    }
+                if (inptr->iInt2&AlfVisualProperties::EPosOffset)
+                    {
+                    visual->iOffset.iY.Set(sourceVisual->iOffset.iY.Target(), inptr->iInt3); 
+                    visual->iOffset.iX.Set(sourceVisual->iOffset.iX.Target(), inptr->iInt3); 
+                    }
+                if (inptr->iInt2&AlfVisualProperties::EImageVisTurnAngle)
+                    {
+                    visual->iTurnAngle.Set(sourceVisual->iTurnAngle.Target(), inptr->iInt3 );
+                    }
+                if (inptr->iInt2&AlfVisualProperties::EScale)
+                    {
+                    visual->iScale.Set(sourceVisual->iScale.Target(), inptr->iInt3 );
+                    }
+                }
+            else if (aCommandId == EAlfVisualPauseProperties)
+                {
+                TInt* inptr =  (TInt*) aInputBuffer.Ptr();
+                if (*inptr&AlfVisualProperties::ESecondaryImageAlpha)
+                    {
+                    visual->iSecondaryAlpha.Suspend();
+                    }
+                if (*inptr&AlfVisualProperties::EPosOffset)
+                    {
+                    visual->iOffset.iY.Suspend(); 
+                    visual->iOffset.iX.Suspend(); 
+                    }
+                if (*inptr&AlfVisualProperties::EImageVisTurnAngle)
+                    {
+                    visual->iTurnAngle.Suspend();
+                    }
+                if (*inptr&AlfVisualProperties::EScale)
+                    {
+                    visual->iScale.Suspend();
+                    }
+                }
+            else //  EAlfVisualResumeProperties
+                {
+                TInt* inptr =  (TInt*) aInputBuffer.Ptr();
+                if (*inptr&AlfVisualProperties::ESecondaryImageAlpha)
+                    {
+                    visual->iSecondaryAlpha.Suspend(EFalse);
+                    }
+                if (*inptr&AlfVisualProperties::EPosOffset)
+                    {
+                    visual->iOffset.iY.Suspend(EFalse); 
+                    visual->iOffset.iX.Suspend(EFalse); 
+                    }
+                if (*inptr&AlfVisualProperties::EImageVisTurnAngle)
+                    {
+                    visual->iTurnAngle.Suspend(EFalse);
+                    }
+                if (*inptr&AlfVisualProperties::EScale)
+                    {
+                    visual->iScale.Suspend(EFalse);
+                    }
+                }
+            } // FALL THROUGH !!
+        
+        default:
+            CAlfVisualHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+        }
+    }
+
+EXPORT_C void CAlfImageVisualHandler::VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+    CAlfVisualHandler::VisualHandlerExtension(aExtensionUid,aExtensionParameters);
+    }
+
+    
+//----------------------------
+// Line Visual
+//----------------------------
+EXPORT_C MAlfExtension* CAlfLineVisualHandler::NewL(
+    MAlfInterfaceProvider& aResolver, 
+    CHuiControl* aOwner, 
+    CHuiLayout* aParentLayout)
+    {
+    CAlfLineVisualHandler* me = new (ELeave) CAlfLineVisualHandler(aResolver);
+    CleanupStack::PushL(me);
+    me->ConstructL(NULL, *aOwner, aParentLayout);
+    CleanupStack::Pop();
+    return me;
+    }
+
+
+EXPORT_C CAlfLineVisualHandler::CAlfLineVisualHandler(
+    MAlfInterfaceProvider& aResolver)
+    : CAlfVisualHandler(aResolver)
+    {
+    }
+
+
+EXPORT_C void CAlfLineVisualHandler::ConstructL(
+    CHuiVisual* aVisual, 
+    CHuiControl& aOwner, 
+    CHuiLayout* aParentLayout)
+    {
+    if (!aVisual)
+        {
+        CHuiLineVisual* lineVisual = 
+            CHuiLineVisual::AddNewL(aOwner, aParentLayout); 
+        CAlfVisualHandler::ConstructL(lineVisual, aOwner, aParentLayout);
+        }
+    else 
+        {
+        CAlfVisualHandler::ConstructL(aVisual, aOwner, aParentLayout);
+        }
+    }
+
+
+EXPORT_C CAlfLineVisualHandler::~CAlfLineVisualHandler()
+    {
+    }
+
+EXPORT_C void CAlfLineVisualHandler::Release()
+    {
+    delete this;
+    }
+
+
+EXPORT_C TAny* CAlfLineVisualHandler::GetInterface(
+    const THuiInterfaceSupport& aInterface)
+    {
+    CHuiLineVisual* lineVisual = static_cast<CHuiLineVisual*>(iVisual);
+    switch (aInterface)
+        {
+        case EHuiObjectTypeCurvePathProvider:
+            return &lineVisual->Path();
+        default:
+            return CAlfVisualHandler::GetInterface(aInterface);
+        }
+    }
+
+
+EXPORT_C void CAlfLineVisualHandler::HandleCmdL(
+    TInt aCommandId, 
+    const TDesC8& aInputBuffer, 
+    TDes8& aResponse)
+    {
+    CHuiLineVisual* lineVisual = static_cast<CHuiLineVisual*>(iVisual);
+    
+    switch (aCommandId)
+        {
+        case EAlfLineVisualSetPath:
+            {
+            TInt2* params = (TInt2*) aInputBuffer.Ptr();
+            CHuiCurvePath* curvePath = NULL;
+            if ( params->iInt1 )
+                {
+                MHuiMappingFunction* mappingFunction = NULL;
+                mappingFunction = static_cast<MHuiMappingFunction*>
+                    (iResolver.GetInterfaceL( 
+                        EHuiInterfaceMappingFunction, 
+                        params->iInt1 ) );
+                curvePath = static_cast<CHuiCurvePath*>( mappingFunction );
+                }
+            
+            // The CAlfCurvePathHandler owns the CHuiCurveParh instance always
+            lineVisual->SetPath( curvePath , EHuiDoesNotHaveOwnership );
+            
+            break;
+            }
+            
+        case EAlfLineVisualSetImage:
+            {
+            TAlfImageParams* params = (TAlfImageParams*) aInputBuffer.Ptr();
+        	
+            // Todo: is is safe enough to handle textures as direct casts..
+        	TInt handle = params->iTextureHandle;
+        	MHuiTexture* texture = reinterpret_cast<MHuiTexture*>(handle);
+   	        THuiImage huiImage;
+   	        if (texture)
+   	            {
+   	            huiImage = THuiImage(*texture, 
+	                params->iTl.iX.ValueNow(),
+	                params->iTl.iY.ValueNow(),
+	                params->iBr.iX.ValueNow(),
+	                params->iBr.iY.ValueNow());    
+   	            
+    	        // We take transition time from one, assuming it is same for everyone.
+    	        TInt transitionTime = params->iBr.iY.TimeToTargetinMilliSeconds();
+    	        
+    	        huiImage.SetTexCoords(params->iTl.iX.Target(),
+    	            params->iTl.iY.Target(),
+    	            params->iBr.iX.Target(),
+    	            params->iBr.iY.Target(),
+    	            transitionTime );
+   	            }
+	            
+	        lineVisual->SetImage( huiImage );
+            break;
+            }
+            
+        case EAlfLineVisualSetAlphaFunction:
+            {
+            TInt* params = (TInt*) aInputBuffer.Ptr();
+            MHuiMappingFunction* mappingFunction = NULL;
+            if ( *params )
+                {
+                mappingFunction = static_cast<MHuiMappingFunction*>
+                    (iResolver.GetInterfaceL( 
+                        EHuiInterfaceMappingFunction, 
+                        *params ) );
+                }
+                
+            lineVisual->SetAlphaFunction( mappingFunction );
+            break;
+            }
+            
+        case EAlfLineVisualSetWidthFunction:
+            {
+            TInt* params = (TInt*) aInputBuffer.Ptr();
+            MHuiMappingFunction* mappingFunction = NULL;
+            if ( *params )
+                {
+                mappingFunction = static_cast<MHuiMappingFunction*>
+                    (iResolver.GetInterfaceL( 
+                        EHuiInterfaceMappingFunction, 
+                        *params ) );
+                }
+                
+            lineVisual->SetWidthFunction( mappingFunction );
+            break;
+            }
+            
+        case EAlfLineVisualGetThickness:
+            {
+            TAlfTimedValue value;
+            AlfTimedValueUtility::CopyTimedValue(lineVisual->iThickness, value);
+
+            TPckg<TAlfTimedValue> resultPckg(value);
+            aResponse = resultPckg; // awkward   
+            break;
+            }
+            
+        case EAlfLineVisualSetThickness:
+            {
+            TAlfTimedValue* value = (TAlfTimedValue*) aInputBuffer.Ptr() ;
+            AlfTimedValueUtility::CopyTimedValue(*value, lineVisual->iThickness, iResolver);
+            break;
+            }
+            
+        case EAlfLineVisualGetShadowThickness:
+            {
+            TAlfTimedValue value;
+            AlfTimedValueUtility::CopyTimedValue(lineVisual->iShadowThickness, value);
+
+            TPckg<TAlfTimedValue> resultPckg(value);
+            aResponse = resultPckg; // awkward 
+            break;
+            }
+            
+        case EAlfLineVisualSetShadowThickness:
+            {
+            TAlfTimedValue* value = (TAlfTimedValue*) aInputBuffer.Ptr() ;
+            AlfTimedValueUtility::CopyTimedValue(*value, lineVisual->iShadowThickness, iResolver);
+            break;
+            }
+            
+        case EAlfLineVisualGetStartPos:
+            {
+            TAlfTimedValue value;
+            AlfTimedValueUtility::CopyTimedValue(lineVisual->iStartPos, value);
+            TPckg<TAlfTimedValue> resultPckg(value);
+            aResponse = resultPckg; // awkward 
+            break;
+            }
+            
+        case EAlfLineVisualSetStartPos:
+            {
+            TAlfTimedValue* value = (TAlfTimedValue*) aInputBuffer.Ptr() ;
+            AlfTimedValueUtility::CopyTimedValue(*value, lineVisual->iStartPos, iResolver);
+            break;
+            }
+            
+        case EAlfLineVisualGetEndPos:
+            {
+            TAlfTimedValue value;
+            AlfTimedValueUtility::CopyTimedValue(lineVisual->iEndPos, value);
+            TPckg<TAlfTimedValue> resultPckg(value);
+            aResponse = resultPckg; // awkward 
+            break;
+            }
+            
+        case EAlfLineVisualSetEndPos:
+            {
+            TAlfTimedValue* value = (TAlfTimedValue*) aInputBuffer.Ptr() ;
+            AlfTimedValueUtility::CopyTimedValue(*value, lineVisual->iEndPos, iResolver);
+            break;
+            }
+
+        case EAlfLineVisualSetColor:           
+            {
+            TRgb* color = (TRgb*) aInputBuffer.Ptr();
+        	lineVisual->SetColor(*color);
+            break;                
+            }
+        
+        case EAlfVisualCopyValuesFromOtherVisual:
+        case EAlfVisualPauseProperties:
+        case EAlfVisualResumeProperties:        
+            {
+            if (aCommandId == EAlfVisualCopyValuesFromOtherVisual)
+               {
+                TInt3* inptr =  (TInt3*) aInputBuffer.Ptr();
+                CHuiLineVisual* sourceVisual = (CHuiLineVisual*) iResolver.GetInterfaceL( EHuiObjectTypeVisual, inptr->iInt1 );
+                if (inptr->iInt2&AlfVisualProperties::ELineVisThickness)
+                    {
+                    lineVisual->iThickness.Set(sourceVisual->iThickness.Target(), inptr->iInt3 );
+                    }
+                if (inptr->iInt2&AlfVisualProperties::ELineVisShadowThickness)
+                    {
+                    lineVisual->iShadowThickness.Set(sourceVisual->iShadowThickness.Target(), inptr->iInt3); 
+                    }
+                if (inptr->iInt2&AlfVisualProperties::ELineVisStartPos)
+                    {
+                    lineVisual->iStartPos.Set(sourceVisual->iStartPos.Target(), inptr->iInt3 );
+                    }
+                if (inptr->iInt2&AlfVisualProperties::ELineVisEndPos)
+                    {
+                    lineVisual->iEndPos.Set(sourceVisual->iEndPos.Target(), inptr->iInt3 );
+                    }
+               }
+            else if (aCommandId == EAlfVisualPauseProperties)
+               {
+                TInt* inptr =  (TInt*) aInputBuffer.Ptr();
+                if (*inptr&AlfVisualProperties::ELineVisThickness)
+                    {
+                    lineVisual->iThickness.Suspend();
+                    }
+                if (*inptr&AlfVisualProperties::ELineVisShadowThickness)
+                    {
+                    lineVisual->iShadowThickness.Suspend(); 
+                    }
+                if (*inptr&AlfVisualProperties::ELineVisStartPos)
+                    {
+                    lineVisual->iStartPos.Suspend();
+                    }
+                if (*inptr&AlfVisualProperties::ELineVisEndPos)
+                    {
+                    lineVisual->iEndPos.Suspend();
+                    }
+               }
+            else // EAlfVisualPauseProperties
+               {
+                TInt* inptr =  (TInt*) aInputBuffer.Ptr();
+                if (*inptr&AlfVisualProperties::ELineVisThickness)
+                    {
+                    lineVisual->iThickness.Suspend(EFalse);
+                    }
+                if (*inptr&AlfVisualProperties::ELineVisShadowThickness)
+                    {
+                    lineVisual->iShadowThickness.Suspend(EFalse); 
+                    }
+                if (*inptr&AlfVisualProperties::ELineVisStartPos)
+                    {
+                    lineVisual->iStartPos.Suspend(EFalse);
+                    }
+                if (*inptr&AlfVisualProperties::ELineVisEndPos)
+                    {
+                    lineVisual->iEndPos.Suspend(EFalse);
+                    }
+               }
+            
+            
+            } // FALL THROUGH !!
+            
+        default:
+            CAlfVisualHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+        }
+    }
+
+EXPORT_C void CAlfLineVisualHandler::VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+    CAlfVisualHandler::VisualHandlerExtension(aExtensionUid,aExtensionParameters);
+    }
+
+//----------------------------
+// Mesh Visual
+//----------------------------
+EXPORT_C MAlfExtension* CAlfMeshVisualHandler::NewL(
+    MAlfInterfaceProvider& aResolver, 
+    CHuiControl* aOwner, 
+    THuiMeshType aMeshType,
+    CHuiLayout* aParentLayout)
+    {
+    CAlfMeshVisualHandler* me = new (ELeave) CAlfMeshVisualHandler(aResolver);
+    CleanupStack::PushL(me);
+    me->ConstructL(NULL, *aOwner, aMeshType, aParentLayout);
+    CleanupStack::Pop();
+    return me;
+    }
+
+
+EXPORT_C CAlfMeshVisualHandler::CAlfMeshVisualHandler(
+    MAlfInterfaceProvider& aResolver)
+    : CAlfVisualHandler(aResolver)
+    {
+    }
+
+
+EXPORT_C void CAlfMeshVisualHandler::ConstructL(
+    CHuiVisual* aVisual, 
+    CHuiControl& aOwner,
+    THuiMeshType aMeshType, 
+    CHuiLayout* aParentLayout)
+    {
+    if (!aVisual)
+        {
+        CHuiMeshVisual* meshVisual = 
+            CHuiMeshVisual::AddNewL(aOwner, aMeshType, aParentLayout); 
+        CAlfVisualHandler::ConstructL(meshVisual, aOwner, aParentLayout);
+        }
+    else 
+        {
+        CAlfVisualHandler::ConstructL(aVisual, aOwner, aParentLayout);
+        }
+    }
+
+
+EXPORT_C CAlfMeshVisualHandler::~CAlfMeshVisualHandler()
+    {
+    }
+
+EXPORT_C void CAlfMeshVisualHandler::Release()
+    {
+    delete this;
+    }
+
+
+EXPORT_C TAny* CAlfMeshVisualHandler::GetInterface(
+    const THuiInterfaceSupport& aInterface)
+    {
+    return CAlfVisualHandler::GetInterface(aInterface);
+    }
+
+
+EXPORT_C void CAlfMeshVisualHandler::HandleCmdL(
+    TInt aCommandId, 
+    const TDesC8& aInputBuffer, 
+    TDes8& aResponse)
+    {
+    CHuiMeshVisual* meshVisual = static_cast<CHuiMeshVisual*>(iVisual);
+    
+    switch (aCommandId)
+        {
+        case EAlfMeshVisualSetImage:            // flow through
+        case EAlfMeshVisualSetSecondaryImage:   // flow through
+        case EAlfMeshVisualSetSpecularImage:
+            {
+          	TAlfImageParams* params = (TAlfImageParams*) aInputBuffer.Ptr();
+        	
+            // Todo: is is safe enough to handle textures as direct casts..
+        	TInt handle = params->iTextureHandle;
+        	MHuiTexture* texture = reinterpret_cast<MHuiTexture*>(handle);
+   	        THuiImage huiImage;
+   	        if (texture)
+   	            {
+   	            huiImage = THuiImage(*texture, 
+	                params->iTl.iX.ValueNow(),
+	                params->iTl.iY.ValueNow(),
+	                params->iBr.iX.ValueNow(),
+	                params->iBr.iY.ValueNow());    
+   	            
+    	        // We take transition time from one, assuming it is same for everyone.
+    	        TInt transitionTime = params->iBr.iY.TimeToTargetinMilliSeconds();
+    	        
+    	        huiImage.SetTexCoords(params->iTl.iX.Target(),
+    	            params->iTl.iY.Target(),
+    	            params->iBr.iX.Target(),
+    	            params->iBr.iY.Target(),
+    	            transitionTime );
+   	            }
+   	        
+   	        if ( aCommandId == EAlfMeshVisualSetImage )
+   	            {
+   	            meshVisual->SetImage( huiImage );
+   	            }
+   	        else if ( aCommandId == EAlfMeshVisualSetSecondaryImage )
+   	            {
+   	            meshVisual->SetSecondaryImage( huiImage );
+   	            }
+   	        else if ( aCommandId == EAlfMeshVisualSetSpecularImage )
+   	            {
+   	            meshVisual->SetSpecularImage( huiImage );
+   	            }
+   	        else
+   	            {
+   	            // for PC lint
+   	            }
+            break;
+            }
+            
+        case EAlfMeshVisualCreateMesh:
+            {
+            THuiMeshType* meshType = (THuiMeshType*)aInputBuffer.Ptr();
+            
+            // Create mesh for the mesh visual.
+            meshVisual->CreateMeshL(*meshType);
+            break;
+            }
+            
+        case EAlfMeshVisualSecondaryAlpha:
+            {
+            TAlfTimedValue value;
+            AlfTimedValueUtility::CopyTimedValue(meshVisual->iSecondaryAlpha, value);
+
+            TPckg<TAlfTimedValue> resultPckg(value);
+            aResponse = resultPckg; // awkward   
+            break;
+            }
+            
+        case EAlfMeshVisualSetSecondaryAlpha:
+            {
+            TAlfTimedValue* value = (TAlfTimedValue*) aInputBuffer.Ptr() ;
+            AlfTimedValueUtility::CopyTimedValue(*value, meshVisual->iSecondaryAlpha, iResolver);
+            break;
+            }
+            
+        case EAlfMeshVisualYawAngle:
+            {
+            TAlfTimedValue value;
+            AlfTimedValueUtility::CopyTimedValue(meshVisual->iYawAngle, value);
+
+            TPckg<TAlfTimedValue> resultPckg(value);
+            aResponse = resultPckg; // awkward   
+            break;
+            }
+            
+        case EAlfMeshVisualSetYawAngle:
+            {
+            TAlfTimedValue* value = (TAlfTimedValue*) aInputBuffer.Ptr() ;
+            AlfTimedValueUtility::CopyTimedValue(*value, meshVisual->iYawAngle, iResolver);
+            break;
+            }
+            
+        case EAlfMeshVisualPitchAngle:
+            {
+            TAlfTimedValue value;
+            AlfTimedValueUtility::CopyTimedValue(meshVisual->iPitchAngle, value);
+
+            TPckg<TAlfTimedValue> resultPckg(value);
+            aResponse = resultPckg; // awkward   
+            break;
+            }
+            
+        case EAlfMeshVisualSetPitchAngle:
+            {
+            TAlfTimedValue* value = (TAlfTimedValue*) aInputBuffer.Ptr() ;
+            AlfTimedValueUtility::CopyTimedValue(*value, meshVisual->iPitchAngle, iResolver);
+            break;
+            }
+            
+        case EAlfMeshVisualScale:
+            {
+            TAlfTimedValue value;
+            AlfTimedValueUtility::CopyTimedValue(meshVisual->iScale, value);
+
+            TPckg<TAlfTimedValue> resultPckg(value);
+            aResponse = resultPckg; // awkward 
+            break;
+            }
+            
+        case EAlfMeshVisualSetScale:
+            {
+            TAlfTimedValue* value = (TAlfTimedValue*) aInputBuffer.Ptr() ;
+            AlfTimedValueUtility::CopyTimedValue(*value, meshVisual->iScale, iResolver);
+            break;
+            }
+            
+        case EAlfMeshReset:
+            {
+            meshVisual->Mesh().Reset();
+            break;
+            }
+            
+        case EAlfMeshMakeCube:
+            {
+            RArray<TReal32> params;
+            CleanupClosePushL( params );
+            InternalizeL(aInputBuffer, params);
+              
+            CHuiProceduralMesh& mesh = static_cast<CHuiProceduralMesh&>(meshVisual->Mesh());
+            mesh.MakeCubeL(
+                params[0],
+                params[1],
+                params[2],
+                params[3] );
+                
+            CleanupStack::PopAndDestroy( &params );  
+            break;
+            }
+            
+        case EAlfMeshMakeSphere:
+            {
+            RArray<TReal32> params;
+            CleanupClosePushL( params );
+            InternalizeL(aInputBuffer, params);
+              
+            CHuiProceduralMesh& mesh = static_cast<CHuiProceduralMesh&>(meshVisual->Mesh());
+            mesh.MakeSphereL(
+                params[0],
+                HUI_ROUND_FLOAT_TO_INT(params[1]),
+                HUI_ROUND_FLOAT_TO_INT(params[2]) );
+                
+            CleanupStack::PopAndDestroy( &params );
+            break;
+            }
+            
+        case EAlfMeshMakeTorus:
+            {
+            RArray<TReal32> params;
+            CleanupClosePushL( params );
+            InternalizeL(aInputBuffer, params);
+            
+            CHuiProceduralMesh& mesh = static_cast<CHuiProceduralMesh&>(meshVisual->Mesh());
+            mesh.MakeTorusL(
+                params[0],
+                params[1],
+                HUI_ROUND_FLOAT_TO_INT(params[2]),
+                HUI_ROUND_FLOAT_TO_INT(params[3]),
+                params[4] );
+             
+            CleanupStack::PopAndDestroy( &params );   
+            break;
+            }
+            
+        case EAlfMeshStretchUniformly:
+            {
+            RArray<TReal32> params;
+            CleanupClosePushL( params );
+            InternalizeL(aInputBuffer, params);
+            
+            meshVisual->Mesh().StretchUniformly(
+                params[0],
+                params[1],
+                params[2],
+                params[3],
+                params[4],
+                params[5] );
+            
+            CleanupStack::PopAndDestroy( &params );  
+            break;
+            }
+            
+        case EAlfMeshScaleUniformly:
+            {
+            RArray<TReal32> params;
+            CleanupClosePushL( params );
+            InternalizeL(aInputBuffer, params);
+            
+            meshVisual->Mesh().ScaleUniformly(
+                params[0],
+                params[1],
+                params[2] );
+                
+            CleanupStack::PopAndDestroy( &params );  
+            break;
+            }
+            
+        case EAlfMeshMaterial:
+            {
+            TAlfMaterialParams alfMaterial;
+            TPckg<TAlfMaterialParams> outputPckg(alfMaterial); 
+            
+            CHuiProceduralMesh& mesh = static_cast<CHuiProceduralMesh&>(meshVisual->Mesh());            
+            THuiMaterial huiMaterial = mesh.iMaterial;
+            
+            // Update only timed values
+            AlfTimedValueUtility::CopyTimedValue(huiMaterial.iSpecular, alfMaterial.iSpecular);  
+            
+            // The client should know the other values. Or does other components 
+            // modify the material?
+            
+            aResponse = outputPckg;
+            break;
+            }
+            
+        case EAlfMeshSetMaterial:
+            {
+            TAlfMaterialParams* params = (TAlfMaterialParams*) aInputBuffer.Ptr();
+            
+            CHuiProceduralMesh& mesh = static_cast<CHuiProceduralMesh&>(meshVisual->Mesh());
+            THuiMaterial& huiMaterial = mesh.iMaterial;
+            // Preset
+            huiMaterial.iPreset = (THuiMaterialPreset)params->iPreset;
+            // Color
+            huiMaterial.iColor = params->iColor;
+            // Texture image
+            TInt handleImage = params->iTextureImage.iTextureHandle;
+        	MHuiTexture* textureImage = reinterpret_cast<MHuiTexture*>(handleImage);
+   	        if (textureImage)
+   	            {
+   	            huiMaterial.iTextureImage = THuiImage(*textureImage, 
+	                params->iTextureImage.iTl.iX.ValueNow(),
+	                params->iTextureImage.iTl.iY.ValueNow(),
+	                params->iTextureImage.iBr.iX.ValueNow(),
+	                params->iTextureImage.iBr.iY.ValueNow());    
+    	        // We take transition time from one, assuming it is same for everyone.
+    	        TInt transitionTime = params->iTextureImage.iBr.iY.TimeToTargetinMilliSeconds();
+    	        huiMaterial.iTextureImage.SetTexCoords(
+    	            params->iTextureImage.iTl.iX.Target(),
+    	            params->iTextureImage.iTl.iY.Target(),
+    	            params->iTextureImage.iBr.iX.Target(),
+    	            params->iTextureImage.iBr.iY.Target(),
+    	            transitionTime );
+   	            }
+   	            
+   	        // Specular image
+            TInt handleSpecular = params->iSpecularImage.iTextureHandle;
+        	MHuiTexture* textureSpecular = reinterpret_cast<MHuiTexture*>(handleSpecular);
+   	        if (textureSpecular)
+   	            {
+   	            huiMaterial.iSpecularImage = THuiImage(*textureSpecular, 
+	                params->iSpecularImage.iTl.iX.ValueNow(),
+	                params->iSpecularImage.iTl.iY.ValueNow(),
+	                params->iSpecularImage.iBr.iX.ValueNow(),
+	                params->iSpecularImage.iBr.iY.ValueNow());    
+    	        // We take transition time from one, assuming it is same for everyone.
+    	        TInt transitionTime = params->iSpecularImage.iBr.iY.TimeToTargetinMilliSeconds();
+    	        huiMaterial.iSpecularImage.SetTexCoords(
+    	            params->iSpecularImage.iTl.iX.Target(),
+    	            params->iSpecularImage.iTl.iY.Target(),
+    	            params->iSpecularImage.iBr.iX.Target(),
+    	            params->iSpecularImage.iBr.iY.Target(),
+    	            transitionTime );
+   	            }
+   	            
+   	        // Specular
+   	        AlfTimedValueUtility::CopyTimedValue(params->iSpecular, huiMaterial.iSpecular, iResolver );    
+
+            break;
+            }
+            
+        case EAlfMeshLoadM3GScene:
+            {
+            TAlfMeshLoadM3GSceneParams* params = (TAlfMeshLoadM3GSceneParams*) aInputBuffer.Ptr();            
+
+            // Load the M3G scene.                        
+            CHuiM3GMesh& mesh = static_cast<CHuiM3GMesh&>(meshVisual->Mesh());
+            mesh.LoadSceneL(params->iFilename);                
+            break;
+            }            
+
+        case EAlfMeshAnimationControllerCount:
+            {
+            TInt controllerCount = meshVisual->Mesh().AnimationControllerCount();
+            TPckg<TInt> resultPckg(controllerCount);
+            aResponse = resultPckg; // awkward             
+            break;
+            }            
+
+        case EAlfMeshSetAnimationPosition:
+            {
+            TAlfMeshAnimationPositionParams* params = (TAlfMeshAnimationPositionParams*) aInputBuffer.Ptr();            
+            meshVisual->Mesh().SetAnimationPosition(params->iControllerId, params->iTarget, params->iTime);
+            break;
+            }            
+
+        case EAlfMeshStartAnimationController:
+            {
+            TInt* params = (TInt*) aInputBuffer.Ptr();            
+            meshVisual->Mesh().StartAnimationController(*params);
+            break;
+            }            
+
+        case EAlfMeshStopAnimationController:
+            {
+            TInt* params = (TInt*) aInputBuffer.Ptr();            
+            meshVisual->Mesh().StopAnimationController(*params);
+            break;
+            }            
+
+        case EAlfVisualCopyValuesFromOtherVisual:
+        case EAlfVisualPauseProperties:
+        case EAlfVisualResumeProperties:        
+            {
+            if (aCommandId == EAlfVisualCopyValuesFromOtherVisual)
+                {
+                TInt3* inptr =  (TInt3*) aInputBuffer.Ptr();
+                CHuiMeshVisual* sourceVisual = (CHuiMeshVisual*) iResolver.GetInterfaceL( EHuiObjectTypeVisual, inptr->iInt1 );
+                if (inptr->iInt2&AlfVisualProperties::ESecondaryImageAlpha)
+                    {
+                    meshVisual->iSecondaryAlpha.Set(sourceVisual->iSecondaryAlpha.Target(), inptr->iInt3 );
+                    }
+                if (inptr->iInt2&AlfVisualProperties::EMeshVisYawAngle)
+                    {
+                    meshVisual->iYawAngle.Set(sourceVisual->iYawAngle.Target(), inptr->iInt3); 
+                    }
+                if (inptr->iInt2&AlfVisualProperties::EMeshVisPitchAngle)
+                    {
+                    meshVisual->iPitchAngle.Set(sourceVisual->iPitchAngle.Target(), inptr->iInt3 );
+                    }
+                if (inptr->iInt2&AlfVisualProperties::EMeshVisMaterial)
+                    {
+                    CHuiProceduralMesh& mesh = static_cast<CHuiProceduralMesh&>(sourceVisual->Mesh());            
+                    CHuiProceduralMesh& myMesh = static_cast<CHuiProceduralMesh&>(meshVisual->Mesh());            
+                
+                    myMesh.iMaterial.iSpecular.Set(mesh.iMaterial.iSpecular.Target(), inptr->iInt3 );
+                    }
+                if (inptr->iInt2&AlfVisualProperties::EScale)
+                    {
+                    meshVisual->iScale.Set(sourceVisual->iScale.Target(), inptr->iInt3 );
+                    }
+                }
+            else if (aCommandId == EAlfVisualPauseProperties)
+                {
+                TInt* inptr =  (TInt*) aInputBuffer.Ptr();
+                if (*inptr&AlfVisualProperties::ESecondaryImageAlpha)
+                    {
+                    meshVisual->iSecondaryAlpha.Suspend();
+                    }
+                if (*inptr&AlfVisualProperties::EMeshVisYawAngle)
+                    {
+                    meshVisual->iYawAngle.Suspend(); 
+                    }
+                if (*inptr&AlfVisualProperties::EMeshVisPitchAngle)
+                    {
+                    meshVisual->iPitchAngle.Suspend();
+                    }
+                if (*inptr&AlfVisualProperties::EMeshVisMaterial)
+                    {
+                    CHuiProceduralMesh& myMesh = static_cast<CHuiProceduralMesh&>(meshVisual->Mesh());            
+                
+                    myMesh.iMaterial.iSpecular.Suspend();
+                    }
+                if (*inptr&AlfVisualProperties::EScale)
+                    {
+                    meshVisual->iScale.Suspend();
+                    }
+                }
+            else  // EAlfVisualResumeProperties)
+                {
+                TInt* inptr =  (TInt*) aInputBuffer.Ptr();
+                if (*inptr&AlfVisualProperties::ESecondaryImageAlpha)
+                    {
+                    meshVisual->iSecondaryAlpha.Suspend(EFalse);
+                    }
+                if (*inptr&AlfVisualProperties::EMeshVisYawAngle)
+                    {
+                    meshVisual->iYawAngle.Suspend(EFalse); 
+                    }
+                if (*inptr&AlfVisualProperties::EMeshVisPitchAngle)
+                    {
+                    meshVisual->iPitchAngle.Suspend(EFalse);
+                    }
+                if (*inptr&AlfVisualProperties::EMeshVisMaterial)
+                    {
+                    CHuiProceduralMesh& myMesh = static_cast<CHuiProceduralMesh&>(meshVisual->Mesh());            
+                
+                    myMesh.iMaterial.iSpecular.Suspend(EFalse);
+                    }
+                if (*inptr&AlfVisualProperties::EScale)
+                    {
+                    meshVisual->iScale.Suspend(EFalse);
+                    }
+                }
+            } // FALL THROUGH !!
+
+        default:
+            CAlfVisualHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+        }
+    }
+
+EXPORT_C void CAlfMeshVisualHandler::VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+    CAlfVisualHandler::VisualHandlerExtension(aExtensionUid,aExtensionParameters);
+    }
+
+
+
+
+//----------------------------
+// Canvas Visual
+//----------------------------
+EXPORT_C MAlfExtension* CAlfCanvasVisualHandler::NewL(
+    MAlfInterfaceProvider& aResolver, 
+    CHuiControl* aOwner, 
+    CHuiLayout* aParentLayout)
+    {
+    CAlfCanvasVisualHandler* me = new (ELeave) CAlfCanvasVisualHandler(aResolver);
+    CleanupStack::PushL(me);
+    me->ConstructL(NULL, *aOwner, aParentLayout);
+    CleanupStack::Pop();
+    return me;
+    }
+
+
+EXPORT_C CAlfCanvasVisualHandler::CAlfCanvasVisualHandler(
+    MAlfInterfaceProvider& aResolver)
+    : CAlfVisualHandler(aResolver)
+    {
+    }
+
+
+EXPORT_C void CAlfCanvasVisualHandler::ConstructL(
+    CHuiVisual* aVisual, 
+    CHuiControl& aOwner, 
+    CHuiLayout* aParentLayout)
+    {
+    if (!aVisual)
+        {
+        CHuiCanvasVisual* canvasVisual = 
+            CHuiCanvasVisual::AddNewL(aOwner, aParentLayout); 
+        CAlfVisualHandler::ConstructL(canvasVisual, aOwner, aParentLayout);
+        }
+    else 
+        {
+        CAlfVisualHandler::ConstructL(aVisual, aOwner, aParentLayout);
+        }
+    }
+
+
+EXPORT_C CAlfCanvasVisualHandler::~CAlfCanvasVisualHandler()
+    {
+    }
+
+EXPORT_C void CAlfCanvasVisualHandler::Release()
+    {
+    delete this;
+    }
+
+
+EXPORT_C TAny* CAlfCanvasVisualHandler::GetInterface(
+    const THuiInterfaceSupport& aInterface)
+    {
+    switch (aInterface)
+        {
+        default:
+            return CAlfVisualHandler::GetInterface(aInterface);
+        }
+    }
+
+
+EXPORT_C void CAlfCanvasVisualHandler::HandleCmdL(
+    TInt aCommandId, 
+    const TDesC8& aInputBuffer, 
+    TDes8& aResponse)
+    {
+    CHuiCanvasVisual* canvasVisual = static_cast<CHuiCanvasVisual*>(iVisual);
+    
+    switch (aCommandId)
+        {
+        case EAlfCanvasVisualSendbuffer:
+            {
+            canvasVisual->SetCommandType(CHuiCanvasVisual::ECommandBufferAlf);
+            canvasVisual->SetCommandSetL(aInputBuffer);         
+            break;
+            }
+        default:
+            CAlfVisualHandler::HandleCmdL(aCommandId, aInputBuffer, aResponse);
+        }
+    }
+
+EXPORT_C void CAlfCanvasVisualHandler::VisualHandlerExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+    CAlfVisualHandler::VisualHandlerExtension(aExtensionUid,aExtensionParameters);
+    }
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfwindow.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,791 @@
+/*
+* 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: 
+*
+*/
+
+#include "alfwindow.h"
+
+#include "alfwindowmanager.h"
+#include "alfwindowstructs.h"
+#include "alfwindowbuffer.h"
+#include "alfstreamerbridge.h"
+#include "alf/alfconstants.h"
+#include <uiacceltk/HuiUtil.h>
+#include "alfwindowdata.h"
+
+#include <string.h>
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfWindow* CAlfWindow::NewL(TUint aId, CAlfWindowManager& aOwner, const TSize& aSizeInPixels)
+    {
+    CAlfWindow* self = new (ELeave) CAlfWindow;
+    CleanupStack::PushL(self);
+    self->ConstructL(aId, aOwner, aSizeInPixels);
+    CleanupStack::Pop();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// destructor
+// ---------------------------------------------------------------------------
+//
+CAlfWindow::~CAlfWindow()
+    {
+    if (iData)
+        {
+        delete iData->iBufferGc;
+        delete iData->iBufferDev;
+        delete iData->iInBuffer;
+        delete iData->iOutBuffer;
+        
+        delete iData;
+        }
+    }
+        
+// ---------------------------------------------------------------------------
+// WsInfo
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const TAlfWServInfo& CAlfWindow::WsInfo() const
+    {
+    return iData->iOriginalInfo;
+    }
+    
+// ---------------------------------------------------------------------------
+// Position
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TPoint CAlfWindow::Position() const
+    {
+    return iData->iPosition;
+    }
+
+// ---------------------------------------------------------------------------
+// Size
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TSize CAlfWindow::Size() const
+    {
+    return iData->iSize;
+    }
+    
+// ---------------------------------------------------------------------------
+// Opacity
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TReal32 CAlfWindow::Opacity() const __SOFTFP
+    {
+    return iData->iOpacity;
+    }
+    
+// ---------------------------------------------------------------------------
+// Rotation
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TReal32 CAlfWindow::Rotation() const __SOFTFP
+    {
+    return iData->iRotation;
+    }
+    
+// ---------------------------------------------------------------------------
+// Identifier
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TUint CAlfWindow::Identifier() const
+    {
+    return iData->iIdentifier;
+    }
+
+// ---------------------------------------------------------------------------
+// IsActive
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool CAlfWindow::IsActive() const
+    {
+    return iData->iIsActive;
+    }
+    
+// ---------------------------------------------------------------------------
+// SurfaceExtent
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TRect CAlfWindow::SurfaceExtent() const
+    {
+    return iData->iSurfaceExtent;
+    }
+    
+// ---------------------------------------------------------------------------
+// Index
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TUint CAlfWindow::Index() const
+    {
+    return iData->iIndex;
+    }
+    
+// ---------------------------------------------------------------------------
+// InBuffer
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfWindowBuffer* CAlfWindow::InBuffer()
+    { // we currently support only fixed type of buffers
+    if (!iData->iInBuffer)
+        {
+        TRAP_IGNORE(CreateInBufferL());    
+        }
+
+    return iData->iInBuffer;
+    }
+
+// ---------------------------------------------------------------------------
+// OutBuffer
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfWindowBuffer* CAlfWindow::OutBufferL(TBool aCopyContents)
+    { // we currently support only fixed type of buffers
+    if (!iData->iInBuffer)
+        {
+        CreateInBufferL();    
+        }
+
+    if (!iData->iOutBuffer)
+        {
+        iData->iOutBuffer = iData->iInBuffer->CreateCopyL(aCopyContents);
+        }
+    return iData->iOutBuffer;
+    }
+
+
+// ---------------------------------------------------------------------------
+// SetActive
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfWindow::SetActive(TBool aVisible)
+    {
+    if (!IsInsertedToScene())
+     	{
+     	iData->iIsActive = aVisible;
+     	}
+
+    TAlfWServInfo wservInfo = WsInfo();
+
+    TInt offset;
+    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
+    if ( windowAttributes )
+        {
+        windowAttributes->iActive = aVisible; 
+        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
+        
+        TAlfBridgerData d;
+        d.Set(EAlfDSSetWindowActive, 
+            wservInfo.iRefId.iWindowGroupId, 
+            wservInfo.iRefId.iWindowIdentifer, 
+            (TAny*)offset); 
+
+        if (iData->iWindowManager->PostIt(d))
+            {
+            iData->iIsActive = aVisible;
+            }
+        }
+
+    //SetOpacity(aVisible?1.0f:0.0f, 500);
+    }
+    
+// ---------------------------------------------------------------------------
+// SetSurfaceExtent
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfWindow::SetSurfaceExtent(const TRect& aRect)
+    {
+    if (!IsInsertedToScene())
+     	{
+        iData->iSurfaceExtent = aRect;
+     	return;
+     	}
+
+    TAlfWServInfo wservInfo = WsInfo();
+
+    TInt offset;
+    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
+        
+    if (windowAttributes)
+        {
+        // Setting the extent rectangle in one command fails in armv5 if the alignment is not
+        // divisible by 8 (maybe 4 would be enough).
+        // Therefore the corners must be set one by one. That succeeds even if the address
+        // is not aligned.
+//        windowAttributes->iSurfaceExtent = aRect;
+        windowAttributes->iSurfaceExtent.iTl.iX = aRect.iTl.iX;
+        windowAttributes->iSurfaceExtent.iTl.iY = aRect.iTl.iY;
+        windowAttributes->iSurfaceExtent.iBr.iX = aRect.iBr.iX;
+        windowAttributes->iSurfaceExtent.iBr.iY = aRect.iBr.iY;
+        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
+
+        TAlfBridgerData d;
+        d.Set(EAlfDSSetSurfaceExtent, 
+            wservInfo.iRefId.iWindowGroupId, 
+            wservInfo.iRefId.iWindowIdentifer, 
+            (TAny*)offset); 
+
+        if (iData->iWindowManager->PostIt(d))
+            {
+        	iData->iSurfaceExtent = aRect;
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// SetLayerUsesAplhaFlag
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfWindow::SetLayerUsesAplhaFlag( TBool aEnabled )
+    {
+    if (!IsInsertedToScene())
+        {
+        iData->iLayerUsesAlphaFlagEnabled = aEnabled;
+        return;
+        }
+
+    TAlfWServInfo wservInfo = WsInfo();
+
+    TInt offset;
+    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
+        
+    if (windowAttributes)
+        {
+        windowAttributes->iLayerUsesAlphaFlagEnabled = aEnabled;
+        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
+        
+        TAlfBridgerData d;
+        d.Set(EAlfDsLayerUsesAlphaFlagChanged, 
+            wservInfo.iRefId.iWindowGroupId, 
+            wservInfo.iRefId.iWindowIdentifer, 
+            (TAny*)offset); 
+
+        if (iData->iWindowManager->PostIt(d))
+            {
+            iData->iLayerUsesAlphaFlagEnabled = aEnabled;
+            }
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// ContentReady
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfWindow::ContentReady(const TRegion& /*aUpdatedArea*/)
+    {
+    // Todo: Should check whether window is active
+    __ASSERT_ALWAYS( iData, USER_INVARIANT() );
+    
+    CAlfWindowBuffer* buffer = iData->iOutBuffer ? iData->iOutBuffer : iData->iInBuffer;
+        
+    iData->iWindowManager->ContentReady(*this, buffer); // Todo: add region;            
+    }
+
+// ---------------------------------------------------------------------------
+// Move
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfWindow::Move(TUint aIndex)
+    {
+    if (!IsInsertedToScene())
+     	{
+     	return;
+     	}
+
+    TAlfWServInfo wservInfo = WsInfo();
+
+    TInt offset;
+    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
+    if ( windowAttributes )
+        {
+        windowAttributes->iOrdinalPosition = aIndex; 
+        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
+        
+        TAlfBridgerData d;
+        d.Set(EAlfDSReorder, 
+            wservInfo.iRefId.iWindowGroupId, 
+            wservInfo.iRefId.iWindowIdentifer, 
+            (TAny*)offset ); 
+        
+        if (iData->iWindowManager->PostIt(d) == KErrNone)
+            {
+            iData->iIndex = aIndex; // ToDo: if app gives out of bounds val, it is modified in 
+                                    // alf scene and this member is set to wrong value
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// EnableIndexChangedNotifications
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfWindow::EnableIndexChangedNotifications(TBool /*aEnable*/)
+    {
+    // Todo
+    //iData->iWindowManager->
+    }
+
+// ---------------------------------------------------------------------------
+// SetPos
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfWindow::SetPos(TPoint aPos, TUint aDuration)
+    {
+    if (!IsInsertedToScene())
+     	{
+        iData->iPosition = aPos;
+     	return;
+     	}
+
+    TAlfWServInfo wservInfo = WsInfo();
+    TInt offset;
+    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
+    if (windowAttributes)
+        {
+        windowAttributes->iPosition = aPos;
+        windowAttributes->iTransitionTime = aDuration; 
+        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
+
+        TAlfBridgerData d;
+        d.Set(EAlfDSSetWindowPos, 
+            wservInfo.iRefId.iWindowGroupId, 
+            wservInfo.iRefId.iWindowIdentifer, 
+            (TAny*)offset ); 
+
+        if (iData->iWindowManager->PostIt(d))
+            {
+            iData->iPosition = aPos;
+            }
+        }
+    iData->iPosition = aPos; // TODO: This breaks the animation loop
+    }
+
+// ---------------------------------------------------------------------------
+// SetSize
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfWindow::SetSize(TSize aSize, TUint aDuration)
+    {
+    if (!IsInsertedToScene())
+    	{
+        iData->iSize = aSize;
+    	return;
+    	}
+
+    if ( aSize != iData->iSize )
+    	{
+    	// TODO: Only texture size should be changed. not the window size at this point.
+    	iData->iSize = aSize;
+    	if (iData->iBufferDev)
+    		{
+    		iData->iBufferDev->Resize( aSize );
+    		}
+    	}
+
+    TAlfWServInfo wservInfo = WsInfo();
+    TInt offset;
+    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
+    
+    if (windowAttributes)
+        {
+        windowAttributes->iSize = aSize;
+        windowAttributes->iTransitionTime = aDuration; 
+        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
+
+        TAlfBridgerData d;
+        d.Set(EAlfDSSetWindowSize, 
+            wservInfo.iRefId.iWindowGroupId, 
+            wservInfo.iRefId.iWindowIdentifer, 
+            (TAny*)offset); 
+
+        if (iData->iWindowManager->PostIt(d))
+            {
+            iData->iSize = aSize;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SetRotation
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfWindow::SetRotation(TReal32 aAngle, TUint aDuration) __SOFTFP
+    {
+    if (!IsInsertedToScene())
+     	{
+        iData->iRotation = aAngle;
+     	return;
+     	}
+
+    TAlfWServInfo wservInfo = WsInfo();
+
+    TInt offset;
+    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
+
+    if (windowAttributes)
+        {
+        windowAttributes->iRotation = aAngle;
+        windowAttributes->iTransitionTime = aDuration; 
+        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
+        
+        TAlfBridgerData d;
+        d.Set(EAlfDSSetWindowRotation, 
+            wservInfo.iRefId.iWindowGroupId, 
+            wservInfo.iRefId.iWindowIdentifer, 
+            (TAny*)offset ); 
+
+        if (iData->iWindowManager->PostIt(d))
+            {
+            iData->iRotation = aAngle;
+            }
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+// SetOpacity
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfWindow::SetOpacity(TReal32 aOpacity, TUint aDuration) __SOFTFP
+    {
+    if (!IsInsertedToScene())
+     	{
+        iData->iOpacity = aOpacity;
+     	return;
+     	}
+
+    TAlfWServInfo wservInfo = WsInfo();
+    TInt offset;
+    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
+    if (windowAttributes)
+        {
+        windowAttributes->iOpacity = aOpacity;
+        windowAttributes->iTransitionTime = aDuration;
+        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
+        
+        TAlfBridgerData d;
+        d.Set(EAlfDSSetWindowOpacity, 
+            wservInfo.iRefId.iWindowGroupId, 
+            wservInfo.iRefId.iWindowIdentifer, 
+            (TAny*)offset); 
+
+        if (iData->iWindowManager->PostIt(d))
+            {
+            iData->iOpacity = aOpacity;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SetWsInfo
+// ---------------------------------------------------------------------------
+//
+void CAlfWindow::SetWsInfo(const TAlfWServInfo& aInfo)
+    {
+    iData->iOriginalInfo = aInfo;    
+    SetPos(aInfo.iPosition);
+    SetSize(aInfo.iSize);
+    }
+
+// ---------------------------------------------------------------------------
+// constructor
+// ---------------------------------------------------------------------------
+//
+CAlfWindow::CAlfWindow()
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfWindow::ConstructL(TUint aId, CAlfWindowManager& aOwner, const TSize& aSizeInPixels)
+    {
+    iData = new (ELeave) TAlfWindowData;
+    memset(iData, 0, sizeof(TAlfWindowData)); // initialize all values to zero
+    iData->iWindowManager = &aOwner;
+    iData->iIdentifier = aId;
+    iData->iIsActive = ETrue;
+    iData->iOpacity = 1.0f;    
+    SetSize(aSizeInPixels);
+    }
+    
+// ---------------------------------------------------------------------------
+// CreateInBufferL
+// ---------------------------------------------------------------------------
+//
+void CAlfWindow::CreateInBufferL()
+    {
+    if (!iData->iInBuffer)
+        {
+        iData->iInBuffer = CAlfWindowBuffer::NewL(TSize(0,0),0,0,0);            
+        }    
+    }
+    
+// ---------------------------------------------------------------------------
+// SetFlag
+// ---------------------------------------------------------------------------
+//
+void CAlfWindow::SetFlag( TInt aFlag )
+    {
+    iData->iFlags |= aFlag;
+    
+    TAlfWServInfo wservInfo = WsInfo();
+
+    TInt offset;
+    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
+    if ( windowAttributes )
+        {
+        windowAttributes->iActive = aFlag;  // transporting this in iActive field
+        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
+        
+        TAlfBridgerData d;
+        d.Set(EAlfDSSetWindowFlag, 
+            wservInfo.iRefId.iWindowGroupId, 
+            wservInfo.iRefId.iWindowIdentifer, 
+            (TAny*)offset); 
+
+        iData->iWindowManager->PostIt(d);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ClearFlag
+// ---------------------------------------------------------------------------
+//
+void CAlfWindow::ClearFlag( TInt aFlag )
+    {
+    iData->iFlags &= ~aFlag;
+    
+    TAlfWServInfo wservInfo = WsInfo();
+
+    TInt offset;
+    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
+    if ( windowAttributes )
+        {
+        windowAttributes->iActive = aFlag;  // transporting this in iActive field
+        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
+        
+        TAlfBridgerData d;
+        d.Set(EAlfDSClearWindowFlag, 
+            wservInfo.iRefId.iWindowGroupId, 
+            wservInfo.iRefId.iWindowIdentifer, 
+            (TAny*)offset); 
+
+        iData->iWindowManager->PostIt(d);
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// GetBitGcL
+// ---------------------------------------------------------------------------
+//
+CFbsBitGc* CAlfWindow::GetBitGcL()
+    {
+    if (!iData->iBufferDev)
+        {
+        if (!iData->iInBuffer)
+            {
+            CreateInBufferL();    
+            }
+        
+        iData->iBufferDev = CFbsBitmapDevice::NewL( iData->iInBuffer->Bmp() );
+        TInt err = iData->iBufferDev->CreateContext( iData->iBufferGc );
+        if ( err != KErrNone)
+            {
+            delete iData->iBufferDev;
+            iData->iBufferDev = 0;
+            User::Leave(err);
+            }
+        }
+         
+    return iData->iBufferGc;
+    }    
+
+// ---------------------------------------------------------------------------
+// CommitGc
+// ---------------------------------------------------------------------------
+//
+void CAlfWindow::CommitGc()
+    {
+    delete iData->iBufferGc;
+    iData->iBufferGc = 0;
+    delete iData->iBufferDev;
+    iData->iBufferDev = 0;
+    if(!iData->iOutBuffer) // Todo: Should we update textures even if window not active?
+        {
+        iData->iWindowManager->ContentReady(*this, iData->iInBuffer);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// IsInsertedToScene
+// ---------------------------------------------------------------------------
+//
+TBool CAlfWindow::IsInsertedToScene()
+    {
+    __ASSERT_ALWAYS( iData, USER_INVARIANT() );
+    return iData->iIsInScene;
+    }
+
+
+// ---------------------------------------------------------------------------
+// InsertedToScene
+// ---------------------------------------------------------------------------
+//
+void CAlfWindow::InsertedToScene(TBool aInserted)
+    {
+    __ASSERT_ALWAYS( iData, USER_INVARIANT() );
+    iData->iIsInScene = aInserted;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TBool CAlfWindow::ShouldBeDeactivated()
+    {
+    __ASSERT_ALWAYS( iData, USER_INVARIANT() );
+    return iData->iFlags & TAlfWindowData::EShouldInactivate;
+    }
+
+// ---------------------------------------------------------------------------
+// PostBuffer
+// ---------------------------------------------------------------------------
+//
+void CAlfWindow::PostPartialBuffer( TAny* aPtr, TInt aSize, TBool aPartial, TBool aLastPart, TBool aEmptyBuffers, TInt aNodeFlags )
+    {
+    TAlfWServInfo wservInfo = WsInfo();
+    TInt offset;
+    TAlfWindowCommandBufferAttributes* windowCommandBuffer = CreateWindowCommandBufferAttributes(offset);
+    if (windowCommandBuffer)
+        {
+        windowCommandBuffer->iBufferLength = aSize;
+        windowCommandBuffer->iBuffer = aPtr;
+        windowCommandBuffer->iEmptyThisBuffer = aEmptyBuffers;
+        windowCommandBuffer->iWindowNodeFlags = aNodeFlags;
+        windowCommandBuffer->iScreenNumber = wservInfo.iScreenNumber;
+        if ( aLastPart && aPartial )
+        	{
+        	windowCommandBuffer->iPartStatus = TAlfWindowCommandBufferAttributes::ELastPart;
+        	}
+        else if ( aPartial )
+        	{
+        	windowCommandBuffer->iPartStatus = TAlfWindowCommandBufferAttributes::ENotComplete;
+        	}
+        else if (!aPartial)
+        	{
+        	windowCommandBuffer->iPartStatus = TAlfWindowCommandBufferAttributes::EPartComplete;
+        	}
+        
+        TAlfBridgerData d;
+        d.Set(EAlfDSPostCanvasBuffer, 
+        		wservInfo.iRefId.iWindowGroupId, 
+        		wservInfo.iRefId.iWindowIdentifer, 
+        		(TAny*)offset ); 
+
+        if (iData->iWindowManager->PostIt(d))
+            {
+            // ???
+            }
+        }
+    
+    }
+
+// ---------------------------------------------------------------------------
+// PostBuffer
+// ---------------------------------------------------------------------------
+//
+void CAlfWindow::PostBuffer( TAny* aPtr, TInt aSize, TInt aNodeFlags )
+    {
+    TAlfWServInfo wservInfo = WsInfo();
+    TInt offset;
+    TAlfWindowCommandBufferAttributes* windowCommandBuffer = CreateWindowCommandBufferAttributes(offset);
+           
+    if (windowCommandBuffer)
+        {
+        windowCommandBuffer->iBufferLength = aSize;
+        windowCommandBuffer->iBuffer = aPtr;
+        windowCommandBuffer->iEmptyThisBuffer = ETrue;
+        windowCommandBuffer->iPartStatus = TAlfWindowCommandBufferAttributes::EPartComplete;
+        windowCommandBuffer->iWindowNodeFlags = aNodeFlags;
+        
+
+        TAlfBridgerData d;
+        d.Set(EAlfDSPostCanvasBuffer, 
+            wservInfo.iRefId.iWindowGroupId, 
+            wservInfo.iRefId.iWindowIdentifer, 
+            (TAny*)offset); 
+
+        if (iData->iWindowManager->PostIt(d))
+            {
+            // ???
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// SetNodeTracking
+// ---------------------------------------------------------------------------
+//
+void CAlfWindow::SetNodeTracking( TInt aValue )
+    {
+    TAlfBridgerData d;
+    TAlfWServInfo wservInfo = WsInfo();
+      
+    d.Set(EAlfDSSetNodeTracking, 
+        wservInfo.iRefId.iWindowIdentifer,
+        aValue,
+        NULL);
+    iData->iWindowManager->PostIt(d);
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TAlfWindowAttributes* CAlfWindow::CreateWindowAttributes(TInt& aIndex)
+    {
+    TAlfWindowAttributes empty;
+    TAlfWindowAttributes* attributes = NULL;
+    TRAP_IGNORE(attributes = (TAlfWindowAttributes*)iData->iWindowManager->Bridge()->AppendVarDataL( sizeof(TAlfWindowAttributes), aIndex ))
+    if ( attributes )
+        {
+        *attributes = empty;
+        }
+    return attributes;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TAlfWindowCommandBufferAttributes* CAlfWindow::CreateWindowCommandBufferAttributes(TInt& aIndex)
+    {
+    TAlfWindowCommandBufferAttributes empty;    
+    TAlfWindowCommandBufferAttributes* windowCommandBuffer = NULL;    
+    TRAP_IGNORE(windowCommandBuffer = (TAlfWindowCommandBufferAttributes*)iData->iWindowManager->Bridge()->AppendVarDataL( sizeof(TAlfWindowCommandBufferAttributes), aIndex ))    
+    if ( windowCommandBuffer )
+        {
+        *windowCommandBuffer = empty;
+        }
+    return windowCommandBuffer;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfwindowbuffer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,244 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include <fbs.h>
+#include <bitdev.h>
+#include "alfwindowbuffer.h"
+
+// ---------------------------------------------------------------------------
+// TAlfWindowBufferData class declaration
+// ---------------------------------------------------------------------------
+//
+class CAlfWindowBuffer::TAlfWindowBufferData
+    {
+    public:   
+    TSize iSize;
+    TInt iFormat;
+    TUint iStride;
+    TAny* iBufferPtr;
+    CFbsBitmap* iTemp; // RnD enablers
+    };
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfWindowBuffer* CAlfWindowBuffer::NewL( const TSize& aSize, 
+                                            TInt aBufferFormat, 
+                                            TUint aStrideInBytes, 
+                                            TAny* aPtr)
+    {
+    CAlfWindowBuffer* self = new (ELeave) CAlfWindowBuffer;
+    CleanupStack::PushL(self);
+    self->ConstructL(aSize, aBufferFormat, aStrideInBytes, aPtr);
+    CleanupStack::Pop();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// destructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfWindowBuffer::~CAlfWindowBuffer()
+    {
+    if (iData)
+        {
+        delete iData->iTemp;
+        delete iData;
+        }
+    }
+        
+// ---------------------------------------------------------------------------
+// Size
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TSize CAlfWindowBuffer::Size() const
+    {
+    if (iData)
+        {
+        return iData->iSize;
+        }
+    return TSize(0,0);
+    }
+    
+// ---------------------------------------------------------------------------
+// Format
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CAlfWindowBuffer::Format() const
+    {
+    if (iData)
+        {
+        return EColor16MA;
+        //return iData->iFormat;
+        }
+    return 0;
+    }
+
+// ---------------------------------------------------------------------------
+// Stride
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TUint CAlfWindowBuffer::Stride() const
+    {
+    if (iData)
+        {
+        return iData->iTemp->DataStride();
+        //return iData->iStride;
+        }
+    return 0;
+    }
+
+// ---------------------------------------------------------------------------
+// BufferPtr
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TAny* CAlfWindowBuffer::BufferPtr() const
+    {
+    if (iData)
+        {
+        return iData->iTemp->DataAddress(); // currently safe...
+        //return iData->iBufferPtr;
+        }
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// SetSize
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfWindowBuffer::SetSize(const TSize& aSize)
+    {
+    iData->iSize = aSize;
+    //RnD
+    iData->iTemp->Resize(aSize);
+    }
+
+// ---------------------------------------------------------------------------
+// SetFormat
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfWindowBuffer::SetFormat(TInt aBufferFormat)   
+    {
+    iData->iFormat = aBufferFormat;
+    }
+
+// ---------------------------------------------------------------------------
+// SetStride
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfWindowBuffer::SetStride(TUint aStrideInBytes)
+    {
+    iData->iStride = aStrideInBytes;
+    }
+    
+// ---------------------------------------------------------------------------
+// SetBufferPtr
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CAlfWindowBuffer::SetBufferPtr(TAny* aPtr) const
+    {
+    iData->iBufferPtr = aPtr;
+    }
+
+// ---------------------------------------------------------------------------
+// constructor
+// ---------------------------------------------------------------------------
+//
+CAlfWindowBuffer::CAlfWindowBuffer()
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+void CAlfWindowBuffer::ConstructL(const TSize& aSize, TInt aBufferFormat, TUint aStride, TAny* aPtr)
+    {
+    iData = new (ELeave)TAlfWindowBufferData;
+    memset(iData,0,sizeof(TAlfWindowBufferData));
+    iData->iBufferPtr = aPtr;
+    iData->iFormat = aBufferFormat;
+    iData->iSize = aSize;
+    iData->iStride = aStride;    
+    // RnD
+    iData->iTemp = new (ELeave) CFbsBitmap();
+    User::LeaveIfError(iData->iTemp->Create(aSize, EColor16MA));
+    }
+
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//
+CAlfWindowBuffer* CAlfWindowBuffer::CreateCopyL(TBool aCopyContents )
+    {
+    CAlfWindowBuffer* copy = CAlfWindowBuffer::NewL( iData->iSize, 
+                                            iData->iFormat, 
+                                            iData->iStride, 
+                                            iData->iBufferPtr);
+    
+    
+    if (aCopyContents)
+        {
+        // Todo: memcopy would be likely faster and this works for bmp only..
+        CleanupStack::PushL(copy);
+        CFbsBitmapDevice* bd = CFbsBitmapDevice::NewL( copy->Bmp() );
+        CleanupStack::PushL(bd);
+        CFbsBitGc * gc = 0; 
+        User::LeaveIfError(bd->CreateContext( gc ));
+        gc->BitBlt(TPoint(0,0), Bmp());
+        delete gc;
+        CleanupStack::PopAndDestroy(2);
+        }
+       
+
+    
+    return copy;
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// Handle
+// ---------------------------------------------------------------------------
+//
+TInt CAlfWindowBuffer::Handle()
+    {
+    if (iData && iData->iTemp)
+        {
+        return iData->iTemp->Handle();
+        }
+    
+    return 0;
+    }
+    
+// ---------------------------------------------------------------------------
+// Bmp
+// ---------------------------------------------------------------------------
+//
+CFbsBitmap* CAlfWindowBuffer::Bmp()
+    {
+    if (iData && iData->iTemp)
+        {
+        return iData->iTemp;
+        }
+    
+    return 0;
+    }    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfwindowfxplugin.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* 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: 
+*
+*/
+
+#include "alfwindowfxplugin.h"
+
+#include <e32base.h>
+
+#include "alfwindowmanager.h"
+#include "alfwindowstructs.h"
+
+class CAlfWindowFxPlugin::TAlfFxPluginData
+    {
+    public:
+        TUint iPriority;
+        TUint iBufferFormat;
+        CAlfWindowManager* iWindowMgr;
+        TUid iIdentifier;
+    };
+
+EXPORT_C void CAlfWindowFxPlugin::ConstructL(const CAlfWindowManager& aMgr, TInt aAlfBufferFormat)
+    {
+    if (!iData)
+        {
+        iData = new (ELeave) TAlfFxPluginData;
+        }
+    iData->iBufferFormat = aAlfBufferFormat;
+    iData->iWindowMgr = (CAlfWindowManager*)&aMgr;
+    }
+
+EXPORT_C CAlfWindowFxPlugin::~CAlfWindowFxPlugin()
+    {
+    if (iData)
+        {
+        delete iData;
+        }
+    }
+
+
+EXPORT_C void CAlfWindowFxPlugin::NewWindow(const TWindowIdentifier& /*aId*/)
+    {
+    }
+
+EXPORT_C void CAlfWindowFxPlugin::DestroyWindow(const TWindowIdentifier& /*aId*/)
+    {
+    }
+    
+EXPORT_C CAlfWindowManager* CAlfWindowFxPlugin::WindowManager()
+    {
+    if (!iData)
+        {
+        return NULL;
+        }
+    return iData->iWindowMgr;
+    }
+
+EXPORT_C void CAlfWindowFxPlugin::HandleMessageL(const TDesC8& /*inBuf*/, TPtr8& /*outBuf*/ )
+    {
+    // synchronous messages are completed by server 
+    }
+
+EXPORT_C void CAlfWindowFxPlugin::HandleMessageL(const TDesC8& /*inBuf*/, const RMessage2& aClientMessage )
+    {
+    // make sure that there are no pending aynch calls left here
+    aClientMessage.Complete(KErrNotSupported);
+    }
+
+
+EXPORT_C void CAlfWindowFxPlugin::CancelMessage(TInt /*aMessageId*/)
+    {
+    // default implementation does not have pending messages
+    }
+    
+TUint CAlfWindowFxPlugin::Priority()
+    {
+    if (iData)
+        {
+        return iData->iPriority;
+        }
+    return 0;
+    }
+
+TUid* CAlfWindowFxPlugin::Identifier()
+    {
+    if (iData)
+        {
+        return &iData->iIdentifier;
+        }
+    return 0;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/alfwindowmanager.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,681 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include <fbs.h>
+
+#include "alfwindowmanager.h"
+#include "alfhierarchymodel.h"
+#include "alfstreamerserver.h"
+#include "alfstreamerbridge.h"
+#include "alfwindow.h"
+#include "alfwindowfxplugin.h"
+#include "alfwindowbuffer.h"
+#include "alfstreamerconsts.h"
+#include "alflogger.h"
+#include "alfwindowdata.h"
+
+#include <ecom.h>
+
+
+struct TPluginInfo
+    {
+    TPluginInfo():iPlugin(0),iDtor(TUid::Uid(0)), iPluginUid(TUid::Uid(0)), iNotifyEnabled(EFalse), iWindowDestroyNotifyEnabled(EFalse)
+        {}
+        
+    CAlfWindowFxPlugin* iPlugin;
+    TUid iDtor;
+    TUid iPluginUid;
+    TBool iNotifyEnabled; // flags would be more sophisticated way..
+    TBool iWindowDestroyNotifyEnabled; 
+    
+    void EnableNotifications(TBool aEnable)
+        {
+        iNotifyEnabled = aEnable;
+        }
+    
+    void NotifyNewWindow(const TWindowIdentifier& aId)
+        {
+        if (iNotifyEnabled)
+            iPlugin->NewWindow(aId);
+        }
+    void EnableWindowDestroyNotifications(TBool aEnable)
+        {
+        iWindowDestroyNotifyEnabled = aEnable;
+        }
+            
+    void NotifyDestroyWindow(const TWindowIdentifier& aId)
+        {
+        if (iWindowDestroyNotifyEnabled)
+            iPlugin->DestroyWindow(aId);
+        }    
+    };
+
+class CAlfWindowManager::TAlfWindowMgrData
+    {
+    public:
+    TInt iScreenId;
+    
+    RPointerArray<CAlfWindow> iWindows;
+    RArray<TPluginInfo> iPlugins;
+    CAlfHierarchyModel* iTree;
+    
+    RPointerArray<CAlfWindow> iChangedWindows;    
+    };
+
+// ---------------------------------------------------------------------------
+// FindPlugin
+// ---------------------------------------------------------------------------
+//
+CAlfWindowFxPlugin* CAlfWindowManager::FindPlugin(const TUid& aPluginUid)
+    {
+    for (TInt i = 0; i <= iData->iPlugins.Count()-1; i++)
+        {
+        if (iData->iPlugins[i].iPluginUid == aPluginUid )
+            {
+            return iData->iPlugins[i].iPlugin;
+            }
+        }
+    return 0;
+    }
+
+// ---------------------------------------------------------------------------
+// NewL
+// ---------------------------------------------------------------------------
+//
+CAlfWindowManager* CAlfWindowManager::NewL(CAlfHierarchyModel* aAlfHierarchy)
+    {
+    CAlfWindowManager* self = new (ELeave) CAlfWindowManager;
+    CleanupStack::PushL(self);
+    self->ConstructL(aAlfHierarchy);
+    CleanupStack::Pop();
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// destructor
+// ---------------------------------------------------------------------------
+//   
+CAlfWindowManager::~CAlfWindowManager()
+    {
+    if (iData)
+        {
+        iData->iWindows.ResetAndDestroy();
+        delete iData;
+        }
+    REComSession::FinalClose();
+    RFbsSession::Disconnect();
+    }
+
+
+// ---------------------------------------------------------------------------
+// CreateNewWindowL
+// For Fx plugins   
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C CAlfWindow* CAlfWindowManager::CreateNewWindowL(TUint aIndex, const TSize& aSizeInPixels )
+    {
+    if(!RFbsSession::GetSession())  
+        {
+        User::LeaveIfError(RFbsSession::Connect());
+        }
+
+    CAlfWindow* window = CAlfWindow::NewL(aIndex,*this, aSizeInPixels);
+    CleanupStack::PushL(window);
+    iData->iWindows.AppendL(window);
+    CleanupStack::Pop();
+      
+    TAlfWServInfo wservInfo = window->WsInfo();
+
+    TInt offset;
+    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes( offset );
+    if (windowAttributes)
+        {
+        windowAttributes->iSize = aSizeInPixels; 
+        windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
+        windowAttributes->iParentNodeId = wservInfo.iParentRefId.iWindowIdentifer;
+        
+        TAlfBridgerData data;
+        data.Set(EAlfDSNewWindow, 
+            wservInfo.iRefId.iWindowGroupId, 
+            wservInfo.iRefId.iWindowIdentifer, 
+            (TAny*)offset); 
+        
+        User::LeaveIfError(PostIt(data));            
+        }
+    
+    return window;
+    }
+
+// ---------------------------------------------------------------------------
+// BindWindowToHitch
+// 
+// ---------------------------------------------------------------------------
+//
+void CAlfWindowManager::BindWindowToHitchL(CAlfWindow* aWindow, CAlfWindowManager* aMgr)
+	{
+    TAlfWServInfo wservInfo = aWindow->WsInfo();
+
+    TInt offset;
+    TAlfWindowAttributes* windowAttributes = CreateWindowAttributes( offset );
+    if ( !windowAttributes )
+        {
+        return;
+        }
+    windowAttributes->iSize = aWindow->Size(); 
+    windowAttributes->iPosition = aWindow->Position();
+    windowAttributes->iWindowNodeType = wservInfo.iNodeType; 
+    windowAttributes->iScreenNumber = wservInfo.iScreenNumber;
+    windowAttributes->iParentNodeId = wservInfo.iParentRefId.iWindowIdentifer;
+    windowAttributes->iClientHandle = wservInfo.iClientSideId.iWindowIdentifer;
+    windowAttributes->iClientGroupHandle = wservInfo.iClientSideId.iWindowGroupId;
+    
+#ifdef ALF_DEBUG_TRACK_DRAWING
+    windowAttributes->iTrackWindow = wservInfo.iTrackWindow;
+#endif
+	TAlfBridgerData data;
+    data.Set(EAlfDSNewWindow, 
+        wservInfo.iRefId.iWindowGroupId, 
+        wservInfo.iRefId.iWindowIdentifer, 
+        (TAny*)offset); 
+
+	User::LeaveIfError(aMgr->PostIt(data));
+
+	aWindow->InsertedToScene(ETrue);
+	aWindow->SetPos(aWindow->Position());
+	if (aWindow->Rotation())
+	    {
+	    aWindow->SetRotation(aWindow->Rotation());
+	    }
+
+    if ( aWindow->Opacity() != 1.0f) // different from default
+        {
+        aWindow->SetOpacity(aWindow->Opacity());
+        }
+	aWindow->SetSurfaceExtent(aWindow->SurfaceExtent());
+        
+	aWindow->SetActive(aWindow->IsActive());
+	}
+
+// ---------------------------------------------------------------------------
+// CreateNewWindowL
+// for hierarchy model
+// ---------------------------------------------------------------------------
+//   
+CAlfWindow* CAlfWindowManager::CreateNewWindowL(TUint aIndex, const TAlfWServInfo& aInfo)
+    {
+    if(!RFbsSession::GetSession())
+         {
+         User::LeaveIfError(RFbsSession::Connect());
+         }
+
+     CAlfWindow* window = CAlfWindow::NewL(aIndex,*this, aInfo.iSize );
+     CleanupStack::PushL(window);
+     iData->iWindows.AppendL(window);
+     CleanupStack::Pop();
+
+     window->SetWsInfo(aInfo);
+
+    // provide notification for plugins that have enabled it
+    for (TInt i = 0; i <= iData->iPlugins.Count()-1; i++)
+        {
+        iData->iPlugins[i].NotifyNewWindow(aInfo.iClientSideId);
+        }
+
+    return window;
+    }
+    
+// ---------------------------------------------------------------------------
+// DestroyWindow
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C void CAlfWindowManager::DestroyWindow(CAlfWindow& aWindow)
+    {
+    TInt i = iData->iWindows.Find(&aWindow);
+    if (i >= 0)
+        {
+        TAlfWServInfo wservInfo = aWindow.WsInfo();
+
+        TInt offset;
+        TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
+        windowAttributes->iWindowNodeType = wservInfo.iNodeType; 
+        windowAttributes->iScreenNumber = wservInfo.iScreenNumber; 
+
+    	TAlfBridgerData data;
+        data.Set(EAlfDSDestroyWindow, 
+            wservInfo.iRefId.iWindowGroupId, 
+            wservInfo.iRefId.iWindowIdentifer, 
+            (TAny*)offset); 
+
+        PostIt(data);
+
+        iData->iWindows.Remove(i);
+        delete &aWindow;
+        
+         // provide notification for plugins that have enabled it
+    	for (TInt i = 0; i <= iData->iPlugins.Count()-1; i++)
+        {
+        iData->iPlugins[i].NotifyDestroyWindow(wservInfo.iClientSideId);
+        }
+        
+       }
+    }
+    
+// ---------------------------------------------------------------------------
+// EnableNewWindowNotificationsL
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C void CAlfWindowManager::EnableNewWindowNotificationsL(CAlfWindowFxPlugin& aPlugin, 
+                                                TBool aEnable)
+    {
+    // Assuming the amount of plugins to remain very limited
+    for (TInt i = 0; i <= iData->iPlugins.Count()-1; i++)
+        {
+        if (iData->iPlugins[i].iPluginUid == *aPlugin.Identifier() )
+            {
+            iData->iPlugins[i].EnableNotifications(aEnable);
+            }
+        }
+    }
+    
+
+// ---------------------------------------------------------------------------
+// EnableDestroyWindowNotificationsL
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C void CAlfWindowManager::EnableDestroyWindowNotificationsL(CAlfWindowFxPlugin& aPlugin, 
+                                                TBool aEnable )
+	{
+	 // Assuming the amount of plugins to remain very limited
+    for (TInt i = 0; i <= iData->iPlugins.Count()-1; i++)
+        {
+        if (iData->iPlugins[i].iPluginUid == *aPlugin.Identifier() )
+            {
+            iData->iPlugins[i].EnableWindowDestroyNotifications(aEnable);
+            }
+        }
+	}
+
+// ---------------------------------------------------------------------------
+// ReserveL
+// Decaprecated
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C CAlfWindow* CAlfWindowManager::ReserveL( const TWindowIdentifier& /*aId*/, TBool aReserveBuffer /*= ETrue*/ )
+    {
+    return 0; // we never get here 
+    }
+    
+
+// ---------------------------------------------------------------------------
+// Release
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C void CAlfWindowManager::Release( CAlfWindow& /*aWindow*/, TBool /*aReserveBuffer = ETrue*/ )
+    {
+    /*TInt i = iData->iWindows.Find(&aWindow);
+    if (i >= 0)
+        {
+        CAlfWindow* window = iData->iWindows[i]; 
+        window->SetReserved( EFalse, aReserveBuffer );
+        if (!window->WsInfo().ExistsInWServ())
+            {
+            __ALFFXLOGSTRING1("CAlfWindowManager::Released, 0x%x", window->Identifier());
+            DestroyWindow( *window, EFalse );
+            }
+        }*/
+    }
+
+// ---------------------------------------------------------------------------
+// ScreenId
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C TInt CAlfWindowManager::ScreenId() const
+    {
+    if (iData)
+        {
+        return iData->iScreenId;          
+        }
+    return 0;
+    }
+
+
+#ifdef RND_FXPLUGIN_FIX
+// ---------------------------------------------------------------------------
+// GetWinIdListL
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C void CAlfWindowManager::GetWinIdListL(RArray<TWindowIdentifier>& aWinIdList)
+    {
+    // Create list 
+    aWinIdList.Reset();
+    for (TInt i=0; i < iData->iWindows.Count(); i++)
+    	{
+   		if (iData->iWindows[i]->IsActive() && iData->iWindows[i]->IsReserved() == EFalse )
+	    	{
+	    	aWinIdList.AppendL( iData->iWindows[i]->WsInfo().iClientSideId ); //\todo shoud this be ordered list?	
+	    	}
+    	}
+    }
+#endif    
+
+// ---------------------------------------------------------------------------
+// GetWinIdListL
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C void CAlfWindowManager::GetWinIdListL( TInt aWsGroupId, RArray<TWindowIdentifier>& aWinIdList)
+    {
+    // Get list of windows which belong to the window server group specified
+    aWinIdList.Reset();
+    for ( TInt i=0; i < iData->iWindows.Count(); i++ )
+    	{
+   	    if ( iData->iWindows[i]->WsInfo().iClientSideId.iWindowGroupId == aWsGroupId )
+   	        {
+        	aWinIdList.AppendL( iData->iWindows[i]->WsInfo().iClientSideId );
+        	}
+    	}
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C void CAlfWindowManager::GetWinInfoListL( TInt aWsGroupId, TInt aClientWindowHandle, RArray<TAlfWServInfo>& aWinInfoList )
+    {
+    aWinInfoList.Reset();
+    for ( TInt i = 0; i < iData->iWindows.Count(); i++ )
+        {
+   	    if ( iData->iWindows[i]->WsInfo().iClientSideId.iWindowGroupId == aWsGroupId )
+   	        {
+            if ( aClientWindowHandle == KErrNotFound ||
+                iData->iWindows[i]->WsInfo().iClientSideId.iWindowIdentifer == aClientWindowHandle )
+                {
+                aWinInfoList.AppendL( iData->iWindows[i]->WsInfo() );
+                }
+   	        }
+        }
+    }
+    
+
+// ---------------------------------------------------------------------------
+// MoveWindow
+// ---------------------------------------------------------------------------
+//   
+void CAlfWindowManager::MoveWindow(CAlfWindow& aWindow, TInt aIndex)
+    {
+    aWindow.Move(aIndex);    
+    }
+    
+
+// ---------------------------------------------------------------------------
+// SetWindowVisibility
+// ---------------------------------------------------------------------------
+//   
+void CAlfWindowManager::SetWindowVisibility(CAlfWindow& /*aWindow*/, TBool /*aVisible*/)
+    {
+        
+    }
+    
+
+// ---------------------------------------------------------------------------
+// ContentReady
+// ---------------------------------------------------------------------------
+//
+void CAlfWindowManager::ContentReady(CAlfWindow& aWindow, CAlfWindowBuffer* aOutBuffer)
+    {
+    //ASSERT(iData->iChangedWindows.Find(&aWindow) == KErrNotFound); // no plugin should produce more frames
+                                                            // than actually bound to scene
+    iData->iChangedWindows.Append(&aWindow);
+
+    if(!aWindow.IsInsertedToScene())
+    	{
+    	TRAPD( err, BindWindowToHitchL(&aWindow, this) );
+    	if (err)
+    	    {
+    	    __ALFLOGSTRING1( "CAlfWindowManager::ContentReady() ignore error: %d", err )
+    	    }
+    	}
+    else
+    	{
+        TAlfWServInfo wservInfo = aWindow.WsInfo();
+
+        TInt offset;
+        TAlfWindowAttributes* windowAttributes = CreateWindowAttributes(offset);
+
+        if (windowAttributes)
+            {
+            windowAttributes->iBitmapHandle = aOutBuffer->Handle();
+            TAlfBridgerData d;
+            d.Set(EAlfDSSetCoveringBitmap, 
+                wservInfo.iRefId.iWindowGroupId, 
+                wservInfo.iRefId.iWindowIdentifer, 
+                (TAny*)offset); 
+
+            PostIt(d);
+            }
+    	}
+    }
+    
+
+// ---------------------------------------------------------------------------
+// constructor
+// ---------------------------------------------------------------------------
+//   
+CAlfWindowManager::CAlfWindowManager()
+    {
+        
+    }
+    
+
+// ---------------------------------------------------------------------------
+// ConstructL
+// ---------------------------------------------------------------------------
+//   
+void CAlfWindowManager::ConstructL(CAlfHierarchyModel* aAlfHierarchy)
+    {
+    iData = new (ELeave) TAlfWindowMgrData;
+    iData->iTree = aAlfHierarchy;
+    }
+        
+
+// ---------------------------------------------------------------------------
+// LoadPluginL
+// ---------------------------------------------------------------------------
+//   
+void CAlfWindowManager::LoadPluginL(const TUid& aPluginUid)
+    {
+    ASSERT(iData);
+    if ( FindPlugin(aPluginUid) )
+        {
+        User::Leave(KErrAlreadyExists);
+        }
+        
+    TUid dtoridkey;
+    CAlfWindowFxPlugin* fxplugin = (CAlfWindowFxPlugin*)REComSession::CreateImplementationL(aPluginUid, dtoridkey);    
+    CleanupStack::PushL(fxplugin);
+    fxplugin->ConstructL(*this, EColor16MAP); // TODO: decide buffer format
+    TUid* pluginUid = fxplugin->Identifier();
+    
+    ASSERT(pluginUid); // construction was not complete i.e. basecall missing in plugin implementation
+    
+    *pluginUid = aPluginUid;
+    
+    TPluginInfo info;
+    info.iPlugin = fxplugin;
+    info.iDtor = dtoridkey;
+    info.iPluginUid = aPluginUid;
+    iData->iPlugins.AppendL(info);
+    CleanupStack::Pop();
+    }
+
+
+// ---------------------------------------------------------------------------
+// DestroyPlugin
+// ---------------------------------------------------------------------------
+//   
+void CAlfWindowManager::DestroyPlugin(const TUid& aPluginUid)
+    {
+    ASSERT(iData);
+    TPluginInfo info;
+    TInt pluginCount = iData->iPlugins.Count();
+    for (int index = 0; index < pluginCount; index++)
+        {
+        info = iData->iPlugins[index];
+        if (info.iPluginUid == aPluginUid)
+            {
+            delete info.iPlugin;
+            REComSession::DestroyedImplementation(info.iDtor);
+            iData->iPlugins.Remove(index);
+            break;    
+            }
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// HandlePluginMsgL
+// ---------------------------------------------------------------------------
+//   
+void CAlfWindowManager::HandlePluginMsgL(const RMessage2& aMessage)
+    {
+    ASSERT(iData);
+    CAlfWindowFxPlugin* fxplugin = FindPlugin(TUid::Uid(aMessage.Int0()));
+    if (fxplugin)
+        {
+        TInt lenght1 = aMessage.GetDesLength(1);
+        TInt lenght2 = aMessage.GetDesMaxLength(2);
+     
+        HBufC8* inHBuf = HBufC8::NewLC(lenght1);
+        TPtr8 inBuf = inHBuf->Des();
+        aMessage.ReadL(1,inBuf); 
+        
+        if ( aMessage.Function() == EAlfDecodSSendSynch )
+            {
+            HBufC8* outBuf = HBufC8::NewLC(lenght2);
+            TPtr8 outptr = outBuf->Des();
+            fxplugin->HandleMessageL(inBuf, outptr);
+            
+            if(!aMessage.IsNull())
+                {
+                aMessage.WriteL(2,*outBuf);
+                aMessage.Complete(KErrNone);
+                }   
+            
+            CleanupStack::PopAndDestroy();
+            }
+        else
+            {
+            fxplugin->HandleMessageL(inBuf, aMessage);
+            }
+    
+        CleanupStack::PopAndDestroy();
+        }
+    else
+        {
+        aMessage.Complete(KErrNotFound);
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// CancelPluginMsg
+// ---------------------------------------------------------------------------
+//   
+void CAlfWindowManager::CancelPluginMsg(const TUid& aPluginUid, TInt aMessageId)
+    {
+    if (!iData)
+        {
+        return;
+        }
+        
+    if (aPluginUid == KNullUid)
+        {
+        for (TInt i = iData->iPlugins.Count()-1; i >= 0 ; i--)
+            {
+            iData->iPlugins[i].iPlugin->CancelMessage(aMessageId);
+            }
+        }
+    else
+        {
+        CAlfWindowFxPlugin* fxplugin = FindPlugin(aPluginUid);
+        if (fxplugin)
+            {
+            fxplugin->CancelMessage(aMessageId);
+            }
+        }    
+    }
+
+
+// ---------------------------------------------------------------------------
+// PostIt
+// ---------------------------------------------------------------------------
+//   
+EXPORT_C TInt CAlfWindowManager::PostIt(const TAlfBridgerData& aData)
+    {
+//    RDebug::Print(_L("CAlfWindowManager::PostIt") );
+    return iData->iTree->Server().Bridge()->AddData(aData.iOp, aData.iInt1, aData.iInt2, aData.iPtr);
+    }
+
+// ---------------------------------------------------------------------------
+// Bridge
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CAlfStreamerBridge* CAlfWindowManager::Bridge()
+    {
+    return iData->iTree->Server().Bridge();
+    }
+
+// ---------------------------------------------------------------------------
+// PrepareNewFrame
+// ---------------------------------------------------------------------------
+//   
+void CAlfWindowManager::PrepareNewFrame(TUint aEstimatedInterval)
+    {
+    iData->iChangedWindows.Reset();
+    for (TInt i = iData->iPlugins.Count()-1; i >= 0 ; i--)
+        {
+        TRAP_IGNORE(iData->iPlugins[i].iPlugin->PrepareFrameL(aEstimatedInterval));
+        // for now, just ignore error. When collecting complete frames, we could use this info though
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TAlfWindowAttributes* CAlfWindowManager::CreateWindowAttributes(TInt& aIndex)
+    {
+    TAlfWindowAttributes empty;
+    TAlfWindowAttributes* attributes = NULL;
+    TRAP_IGNORE(attributes = (TAlfWindowAttributes*)Bridge()->AppendVarDataL( sizeof(TAlfWindowAttributes), aIndex ))
+    *attributes = empty;
+    return attributes;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TAlfWindowCommandBufferAttributes* CAlfWindowManager::CreateWindowCommandBufferAttributes(TInt& aIndex)
+    {
+    TAlfWindowCommandBufferAttributes empty;    
+    TAlfWindowCommandBufferAttributes* windowCommandBuffer = NULL;    
+    TRAP_IGNORE(windowCommandBuffer = (TAlfWindowCommandBufferAttributes*)Bridge()->AppendVarDataL( sizeof(TAlfWindowCommandBufferAttributes), aIndex ))    
+    *windowCommandBuffer = empty;
+    return windowCommandBuffer;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/Src/themerepositorylistener.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* 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: 
+*
+*/
+#include "themerepositorylistener.h"
+
+#include <platform/mw/pslninternalcrkeys.h>
+_LIT(KBgAnimExeName, "z:\\sys\\bin\\backgroundanimhost.exe");
+
+CThemeRepositoryListener::CThemeRepositoryListener() : CActive(EPriorityStandard)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+CThemeRepositoryListener::~CThemeRepositoryListener()
+    {
+    Cancel();
+    delete iThemesRepository;
+    }
+
+CThemeRepositoryListener* CThemeRepositoryListener::NewL()
+    {
+    CThemeRepositoryListener* me = new (ELeave)CThemeRepositoryListener;
+    CleanupStack::PushL(me);
+    me->ConstructL();
+    CleanupStack::Pop();
+    return me;
+    }
+
+void DoStartBgAnim()
+    {
+    // start the app
+    RProcess image;
+    TInt err = image.Create(KBgAnimExeName,KNullDesC);
+    if (!err)
+        {
+        image.Resume();
+        }
+    image.Close();
+    }
+
+void CThemeRepositoryListener::ConstructL()
+    {
+    iThemesRepository = CRepository::NewL(KCRUidThemes);
+    User::LeaveIfError(iThemesRepository->Get(KThemesAnimBackgroundSupport, iPreviousValue));
+    }
+
+
+void CThemeRepositoryListener::RunL()
+    {
+    TInt value = 0;
+    iThemesRepository->Get(KThemesAnimBackgroundSupport, value);
+#if !defined(__WINS__)
+    if (!value && value != iPreviousValue)
+        {
+        DoStartBgAnim();
+        }
+#endif
+    iPreviousValue = value;
+    
+    if (iStatus.Int() != KErrCancel)
+        {
+        IssueRequest();
+        }
+    }
+
+void CThemeRepositoryListener::DoCancel()
+    {
+    iThemesRepository->NotifyCancelAll();    
+    }
+
+void CThemeRepositoryListener::IssueRequest()
+    {
+    TInt err = iThemesRepository->NotifyRequest(KThemesAnimBackgroundSupport,iStatus);
+    if (!err)
+        {
+        SetActive();
+        }
+    }
+
+    
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/eabi/alfappservercoreu.DEF	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,550 @@
+EXPORTS
+	_ZN13CAlfAppServer16HandleClientExitEi @ 1 NONAME
+	_ZN13CAlfAppServer16MetricsInterfaceEv @ 2 NONAME
+	_ZN13CAlfAppServer19SetMetricsInterfaceEP20MAlfMetricsInterface @ 3 NONAME
+	_ZN13CAlfAppServer24SetWindowChangeObserverLEP25MWindowVisibilityObserveri @ 4 NONAME
+	_ZN13CAlfAppServer26AdjustWindowGroupPositionLER12RWindowGroupiNS_13TAlfWGPostionE @ 5 NONAME
+	_ZN13CAlfAppServer5AppUiEv @ 6 NONAME
+	_ZN13CAlfAppServerC1Ev @ 7 NONAME ABSENT
+	_ZN13CAlfAppServer13NewAppServerLEv @ 8 NONAME
+	_ZN16CAlfBrushHandler10ConstructLEP9CHuiBrush @ 9 NONAME
+	_ZN16CAlfBrushHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 10 NONAME
+	_ZN16CAlfBrushHandler12GetInterfaceERK20THuiInterfaceSupport @ 11 NONAME
+	_ZN16CAlfBrushHandler12SetOwnershipEi @ 12 NONAME
+	_ZN16CAlfBrushHandler7ReleaseEv @ 13 NONAME
+	_ZN16CAlfBrushHandlerC1ER21MAlfInterfaceProvider @ 14 NONAME
+	_ZN16CAlfBrushHandlerC2ER21MAlfInterfaceProvider @ 15 NONAME
+	_ZN16CAlfBrushHandlerD0Ev @ 16 NONAME
+	_ZN16CAlfBrushHandlerD1Ev @ 17 NONAME
+	_ZN16CAlfBrushHandlerD2Ev @ 18 NONAME
+	_ZN16CAlfSrvEffectEnv13ControlGroupLEi @ 19 NONAME
+	_ZN16CAlfSrvEffectEnv13DisplayCountLEv @ 20 NONAME
+	_ZN16CAlfSrvEffectEnv18ControlGroupCountLEv @ 21 NONAME
+	_ZN16CAlfSrvEffectEnv25VisibleControlGroupCountLEv @ 22 NONAME
+	_ZN16CAlfSrvEffectEnv8DisplayLEi @ 23 NONAME
+	_ZN16CAlfSrvEffectEnv9SharedEnvEv @ 24 NONAME
+	_ZN17CAlfLayoutHandler10ConstructLEP10CHuiVisualR11CHuiControlP10CHuiLayout @ 25 NONAME
+	_ZN17CAlfLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 26 NONAME
+	_ZN17CAlfLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 27 NONAME
+	_ZN17CAlfLayoutHandler4NewLER21MAlfInterfaceProviderP11CHuiControlP10CHuiLayout @ 28 NONAME
+	_ZN17CAlfLayoutHandler7ReleaseEv @ 29 NONAME
+	_ZN17CAlfLayoutHandlerC1ER21MAlfInterfaceProvider @ 30 NONAME
+	_ZN17CAlfLayoutHandlerC2ER21MAlfInterfaceProvider @ 31 NONAME
+	_ZN17CAlfLayoutHandlerD0Ev @ 32 NONAME
+	_ZN17CAlfLayoutHandlerD1Ev @ 33 NONAME
+	_ZN17CAlfLayoutHandlerD2Ev @ 34 NONAME
+	_ZN17CAlfVisualHandler10ConstructLEP10CHuiVisualR11CHuiControlP10CHuiLayout @ 35 NONAME
+	_ZN17CAlfVisualHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 36 NONAME
+	_ZN17CAlfVisualHandler12GetInterfaceERK20THuiInterfaceSupport @ 37 NONAME
+	_ZN17CAlfVisualHandler4NewLER21MAlfInterfaceProviderP11CHuiControlP10CHuiLayout @ 38 NONAME
+	_ZN17CAlfVisualHandler7ReleaseEv @ 39 NONAME
+	_ZN17CAlfVisualHandlerC1ER21MAlfInterfaceProvider @ 40 NONAME
+	_ZN17CAlfVisualHandlerC2ER21MAlfInterfaceProvider @ 41 NONAME
+	_ZN17CAlfVisualHandlerD0Ev @ 42 NONAME
+	_ZN17CAlfVisualHandlerD1Ev @ 43 NONAME
+	_ZN17CAlfVisualHandlerD2Ev @ 44 NONAME
+	_ZN19AlfFileTokenUtility17OpenFileForTokenLER5RFileRK6TDesC8 @ 45 NONAME
+	_ZN20AlfTimedPointUtility14CopyTimedPointER14TAlfTimedPointR14THuiTimedPoint @ 46 NONAME
+	_ZN20AlfTimedPointUtility14CopyTimedPointER14TAlfTimedPointR14THuiTimedPointR21MAlfInterfaceProvider @ 47 NONAME
+	_ZN20AlfTimedPointUtility14CopyTimedPointER14THuiTimedPointR14TAlfTimedPoint @ 48 NONAME
+	_ZN20AlfTimedValueUtility14CopyTimedValueER14TAlfTimedValueR14THuiTimedValue @ 49 NONAME
+	_ZN20AlfTimedValueUtility14CopyTimedValueER14TAlfTimedValueR14THuiTimedValueR21MAlfInterfaceProvider @ 50 NONAME
+	_ZN20AlfTimedValueUtility14CopyTimedValueER14THuiTimedValueR14TAlfTimedValue @ 51 NONAME
+	_ZN21CAlfAppSrvSessionBase10FocusLostLEi @ 52 NONAME
+	_ZN21CAlfAppSrvSessionBase11CompleteCmdEii @ 53 NONAME
+	_ZN21CAlfAppSrvSessionBase12FocusGainedLEi @ 54 NONAME
+	_ZN21CAlfAppSrvSessionBase13GetInterfaceLERK20THuiInterfaceSupporti @ 55 NONAME
+	_ZN21CAlfAppSrvSessionBase14BaseConstructLEv @ 56 NONAME
+	_ZN21CAlfAppSrvSessionBase16FactoryDestroyedEi @ 57 NONAME
+	_ZN21CAlfAppSrvSessionBase19ExtensionInterfaceLE4TUidRPv @ 58 NONAME
+	_ZN21CAlfAppSrvSessionBase22GetHandleFromInterfaceERK20THuiInterfaceSupportPv @ 59 NONAME
+	_ZN21CAlfAppSrvSessionBase27HandleCurrentCommanndAsynchEv @ 60 NONAME
+	_ZN21CAlfAppSrvSessionBase8AlfAppUiEv @ 61 NONAME
+	_ZN21CAlfAppSrvSessionBase8ServiceLERK9RMessage2 @ 62 NONAME
+	_ZN21CAlfAppSrvSessionBase9AlfServerEv @ 63 NONAME
+	_ZN21CAlfAppSrvSessionBaseC2EPK13CAlfAppServer @ 64 NONAME
+	_ZN21CAlfAppSrvSessionBaseC2Ev @ 65 NONAME
+	_ZN21CAlfAppSrvSessionBaseD0Ev @ 66 NONAME
+	_ZN21CAlfAppSrvSessionBaseD1Ev @ 67 NONAME
+	_ZN21CAlfAppSrvSessionBaseD2Ev @ 68 NONAME
+	_ZN21CAlfDeckLayoutHandler10ConstructLEP10CHuiVisualR11CHuiControlP10CHuiLayout @ 69 NONAME
+	_ZN21CAlfDeckLayoutHandler4NewLER21MAlfInterfaceProviderP11CHuiControlP10CHuiLayout @ 70 NONAME
+	_ZN21CAlfDeckLayoutHandlerC1ER21MAlfInterfaceProvider @ 71 NONAME
+	_ZN21CAlfDeckLayoutHandlerC2ER21MAlfInterfaceProvider @ 72 NONAME
+	_ZN21CAlfDeckLayoutHandlerD0Ev @ 73 NONAME
+	_ZN21CAlfDeckLayoutHandlerD1Ev @ 74 NONAME
+	_ZN21CAlfDeckLayoutHandlerD2Ev @ 75 NONAME
+	_ZN21CAlfFlowLayoutHandler10ConstructLEP10CHuiVisualR11CHuiControlP10CHuiLayout @ 76 NONAME
+	_ZN21CAlfFlowLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 77 NONAME
+	_ZN21CAlfFlowLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 78 NONAME
+	_ZN21CAlfFlowLayoutHandler4NewLER21MAlfInterfaceProviderP11CHuiControlP10CHuiLayout @ 79 NONAME
+	_ZN21CAlfFlowLayoutHandler7ReleaseEv @ 80 NONAME
+	_ZN21CAlfFlowLayoutHandlerC1ER21MAlfInterfaceProvider @ 81 NONAME
+	_ZN21CAlfFlowLayoutHandlerC2ER21MAlfInterfaceProvider @ 82 NONAME
+	_ZN21CAlfFlowLayoutHandlerD0Ev @ 83 NONAME
+	_ZN21CAlfFlowLayoutHandlerD1Ev @ 84 NONAME
+	_ZN21CAlfFlowLayoutHandlerD2Ev @ 85 NONAME
+	_ZN21CAlfFrameBrushHandler10ConstructLEP9CHuiBrushRK11TAknsItemIDii @ 86 NONAME
+	_ZN21CAlfFrameBrushHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 87 NONAME
+	_ZN21CAlfFrameBrushHandler12GetInterfaceERK20THuiInterfaceSupport @ 88 NONAME
+	_ZN21CAlfFrameBrushHandler4NewLER21MAlfInterfaceProviderRK11TAknsItemIDii @ 89 NONAME
+	_ZN21CAlfFrameBrushHandler7ReleaseEv @ 90 NONAME
+	_ZN21CAlfFrameBrushHandlerC1ER21MAlfInterfaceProvider @ 91 NONAME
+	_ZN21CAlfFrameBrushHandlerC2ER21MAlfInterfaceProvider @ 92 NONAME
+	_ZN21CAlfFrameBrushHandlerD0Ev @ 93 NONAME
+	_ZN21CAlfFrameBrushHandlerD1Ev @ 94 NONAME
+	_ZN21CAlfFrameBrushHandlerD2Ev @ 95 NONAME
+	_ZN21CAlfGridLayoutHandler10ConstructLEP10CHuiVisualR11CHuiControlP10CHuiLayout @ 96 NONAME
+	_ZN21CAlfGridLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 97 NONAME
+	_ZN21CAlfGridLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 98 NONAME
+	_ZN21CAlfGridLayoutHandler4NewLER21MAlfInterfaceProviderP11CHuiControlP10CHuiLayout @ 99 NONAME
+	_ZN21CAlfGridLayoutHandler7ReleaseEv @ 100 NONAME
+	_ZN21CAlfGridLayoutHandlerC1ER21MAlfInterfaceProvider @ 101 NONAME
+	_ZN21CAlfGridLayoutHandlerC2ER21MAlfInterfaceProvider @ 102 NONAME
+	_ZN21CAlfGridLayoutHandlerD0Ev @ 103 NONAME
+	_ZN21CAlfGridLayoutHandlerD1Ev @ 104 NONAME
+	_ZN21CAlfGridLayoutHandlerD2Ev @ 105 NONAME
+	_ZN21CAlfImageBrushHandler10ConstructLEP9CHuiBrush9THuiImage @ 106 NONAME
+	_ZN21CAlfImageBrushHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 107 NONAME
+	_ZN21CAlfImageBrushHandler12GetInterfaceERK20THuiInterfaceSupport @ 108 NONAME
+	_ZN21CAlfImageBrushHandler4NewLER21MAlfInterfaceProvider9THuiImage @ 109 NONAME
+	_ZN21CAlfImageBrushHandler7ReleaseEv @ 110 NONAME
+	_ZN21CAlfImageBrushHandlerC1ER21MAlfInterfaceProvider @ 111 NONAME
+	_ZN21CAlfImageBrushHandlerC2ER21MAlfInterfaceProvider @ 112 NONAME
+	_ZN21CAlfImageBrushHandlerD0Ev @ 113 NONAME
+	_ZN21CAlfImageBrushHandlerD1Ev @ 114 NONAME
+	_ZN21CAlfImageBrushHandlerD2Ev @ 115 NONAME
+	_ZN21CAlfLineVisualHandler10ConstructLEP10CHuiVisualR11CHuiControlP10CHuiLayout @ 116 NONAME
+	_ZN21CAlfLineVisualHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 117 NONAME
+	_ZN21CAlfLineVisualHandler12GetInterfaceERK20THuiInterfaceSupport @ 118 NONAME
+	_ZN21CAlfLineVisualHandler4NewLER21MAlfInterfaceProviderP11CHuiControlP10CHuiLayout @ 119 NONAME
+	_ZN21CAlfLineVisualHandler7ReleaseEv @ 120 NONAME
+	_ZN21CAlfLineVisualHandlerC1ER21MAlfInterfaceProvider @ 121 NONAME
+	_ZN21CAlfLineVisualHandlerC2ER21MAlfInterfaceProvider @ 122 NONAME
+	_ZN21CAlfLineVisualHandlerD0Ev @ 123 NONAME
+	_ZN21CAlfLineVisualHandlerD1Ev @ 124 NONAME
+	_ZN21CAlfLineVisualHandlerD2Ev @ 125 NONAME
+	_ZN21CAlfMeshVisualHandler10ConstructLEP10CHuiVisualR11CHuiControl12THuiMeshTypeP10CHuiLayout @ 126 NONAME
+	_ZN21CAlfMeshVisualHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 127 NONAME
+	_ZN21CAlfMeshVisualHandler12GetInterfaceERK20THuiInterfaceSupport @ 128 NONAME
+	_ZN21CAlfMeshVisualHandler4NewLER21MAlfInterfaceProviderP11CHuiControl12THuiMeshTypeP10CHuiLayout @ 129 NONAME
+	_ZN21CAlfMeshVisualHandler7ReleaseEv @ 130 NONAME
+	_ZN21CAlfMeshVisualHandlerC1ER21MAlfInterfaceProvider @ 131 NONAME
+	_ZN21CAlfMeshVisualHandlerC2ER21MAlfInterfaceProvider @ 132 NONAME
+	_ZN21CAlfMeshVisualHandlerD0Ev @ 133 NONAME
+	_ZN21CAlfMeshVisualHandlerD1Ev @ 134 NONAME
+	_ZN21CAlfMeshVisualHandlerD2Ev @ 135 NONAME
+	_ZN21CAlfTextVisualHandler10ConstructLEP10CHuiVisualR11CHuiControlP10CHuiLayout @ 136 NONAME
+	_ZN21CAlfTextVisualHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 137 NONAME
+	_ZN21CAlfTextVisualHandler12GetInterfaceERK20THuiInterfaceSupport @ 138 NONAME
+	_ZN21CAlfTextVisualHandler4NewLER21MAlfInterfaceProviderP11CHuiControlP10CHuiLayout @ 139 NONAME
+	_ZN21CAlfTextVisualHandler7ReleaseEv @ 140 NONAME
+	_ZN21CAlfTextVisualHandlerC1ER21MAlfInterfaceProvider @ 141 NONAME
+	_ZN21CAlfTextVisualHandlerC2ER21MAlfInterfaceProvider @ 142 NONAME
+	_ZN21CAlfTextVisualHandlerD0Ev @ 143 NONAME
+	_ZN21CAlfTextVisualHandlerD1Ev @ 144 NONAME
+	_ZN21CAlfTextVisualHandlerD2Ev @ 145 NONAME
+	_ZN22CAlfBorderBrushHandler10ConstructLEP9CHuiBrushiiii @ 146 NONAME
+	_ZN22CAlfBorderBrushHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 147 NONAME
+	_ZN22CAlfBorderBrushHandler12GetInterfaceERK20THuiInterfaceSupport @ 148 NONAME
+	_ZN22CAlfBorderBrushHandler4NewLER21MAlfInterfaceProvideriiii @ 149 NONAME
+	_ZN22CAlfBorderBrushHandler7ReleaseEv @ 150 NONAME
+	_ZN22CAlfBorderBrushHandlerC1ER21MAlfInterfaceProvider @ 151 NONAME
+	_ZN22CAlfBorderBrushHandlerC2ER21MAlfInterfaceProvider @ 152 NONAME
+	_ZN22CAlfBorderBrushHandlerD0Ev @ 153 NONAME
+	_ZN22CAlfBorderBrushHandlerD1Ev @ 154 NONAME
+	_ZN22CAlfBorderBrushHandlerD2Ev @ 155 NONAME
+	_ZN22CAlfImageVisualHandler10ConstructLEP10CHuiVisualR11CHuiControlP10CHuiLayout @ 156 NONAME
+	_ZN22CAlfImageVisualHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 157 NONAME
+	_ZN22CAlfImageVisualHandler12GetInterfaceERK20THuiInterfaceSupport @ 158 NONAME
+	_ZN22CAlfImageVisualHandler4NewLER21MAlfInterfaceProviderP11CHuiControlP10CHuiLayout @ 159 NONAME
+	_ZN22CAlfImageVisualHandler7ReleaseEv @ 160 NONAME
+	_ZN22CAlfImageVisualHandlerC1ER21MAlfInterfaceProvider @ 161 NONAME
+	_ZN22CAlfImageVisualHandlerC2ER21MAlfInterfaceProvider @ 162 NONAME
+	_ZN22CAlfImageVisualHandlerD0Ev @ 163 NONAME
+	_ZN22CAlfImageVisualHandlerD1Ev @ 164 NONAME
+	_ZN22CAlfImageVisualHandlerD2Ev @ 165 NONAME
+	_ZN23CAlfAnchorLayoutHandler10ConstructLEP10CHuiVisualR11CHuiControlP10CHuiLayout @ 166 NONAME
+	_ZN23CAlfAnchorLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 167 NONAME
+	_ZN23CAlfAnchorLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 168 NONAME
+	_ZN23CAlfAnchorLayoutHandler4NewLER21MAlfInterfaceProviderP11CHuiControlP10CHuiLayout @ 169 NONAME
+	_ZN23CAlfAnchorLayoutHandler7ReleaseEv @ 170 NONAME
+	_ZN23CAlfAnchorLayoutHandlerC1ER21MAlfInterfaceProvider @ 171 NONAME
+	_ZN23CAlfAnchorLayoutHandlerC2ER21MAlfInterfaceProvider @ 172 NONAME
+	_ZN23CAlfAnchorLayoutHandlerD0Ev @ 173 NONAME
+	_ZN23CAlfAnchorLayoutHandlerD1Ev @ 174 NONAME
+	_ZN23CAlfAnchorLayoutHandlerD2Ev @ 175 NONAME
+	_ZN24CAlfGradientBrushHandler10ConstructLEP9CHuiBrush @ 176 NONAME
+	_ZN24CAlfGradientBrushHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 177 NONAME
+	_ZN24CAlfGradientBrushHandler12GetInterfaceERK20THuiInterfaceSupport @ 178 NONAME
+	_ZN24CAlfGradientBrushHandler4NewLER21MAlfInterfaceProvider @ 179 NONAME
+	_ZN24CAlfGradientBrushHandler7ReleaseEv @ 180 NONAME
+	_ZN24CAlfGradientBrushHandlerC1ER21MAlfInterfaceProvider @ 181 NONAME
+	_ZN24CAlfGradientBrushHandlerC2ER21MAlfInterfaceProvider @ 182 NONAME
+	_ZN24CAlfGradientBrushHandlerD0Ev @ 183 NONAME
+	_ZN24CAlfGradientBrushHandlerD1Ev @ 184 NONAME
+	_ZN24CAlfGradientBrushHandlerD2Ev @ 185 NONAME
+	_ZN24CAlfLCTGridLayoutHandler10ConstructLEP10CHuiVisualR11CHuiControlP10CHuiLayout @ 186 NONAME
+	_ZN24CAlfLCTGridLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 187 NONAME
+	_ZN24CAlfLCTGridLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 188 NONAME
+	_ZN24CAlfLCTGridLayoutHandler4NewLER21MAlfInterfaceProviderP11CHuiControlP10CHuiLayout @ 189 NONAME
+	_ZN24CAlfLCTGridLayoutHandler7ReleaseEv @ 190 NONAME
+	_ZN24CAlfLCTGridLayoutHandlerC1ER21MAlfInterfaceProvider @ 191 NONAME
+	_ZN24CAlfLCTGridLayoutHandlerC2ER21MAlfInterfaceProvider @ 192 NONAME
+	_ZN24CAlfLCTGridLayoutHandlerD0Ev @ 193 NONAME
+	_ZN24CAlfLCTGridLayoutHandlerD1Ev @ 194 NONAME
+	_ZN24CAlfLCTGridLayoutHandlerD2Ev @ 195 NONAME
+	_ZN24CAlfLCTTextVisualHandler10ConstructLEP10CHuiVisualR11CHuiControlP10CHuiLayout @ 196 NONAME
+	_ZN24CAlfLCTTextVisualHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 197 NONAME
+	_ZN24CAlfLCTTextVisualHandler12GetInterfaceERK20THuiInterfaceSupport @ 198 NONAME
+	_ZN24CAlfLCTTextVisualHandler4NewLER21MAlfInterfaceProviderP11CHuiControlP10CHuiLayout @ 199 NONAME
+	_ZN24CAlfLCTTextVisualHandler7ReleaseEv @ 200 NONAME
+	_ZN24CAlfLCTTextVisualHandlerC1ER21MAlfInterfaceProvider @ 201 NONAME
+	_ZN24CAlfLCTTextVisualHandlerC2ER21MAlfInterfaceProvider @ 202 NONAME
+	_ZN24CAlfLCTTextVisualHandlerD0Ev @ 203 NONAME
+	_ZN24CAlfLCTTextVisualHandlerD1Ev @ 204 NONAME
+	_ZN24CAlfLCTTextVisualHandlerD2Ev @ 205 NONAME
+	_ZN25CAlfViewportLayoutHandler10ConstructLEP10CHuiVisualR11CHuiControlP10CHuiLayout @ 206 NONAME
+	_ZN25CAlfViewportLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 207 NONAME
+	_ZN25CAlfViewportLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 208 NONAME
+	_ZN25CAlfViewportLayoutHandler4NewLER21MAlfInterfaceProviderP11CHuiControlP10CHuiLayout @ 209 NONAME
+	_ZN25CAlfViewportLayoutHandler7ReleaseEv @ 210 NONAME
+	_ZN25CAlfViewportLayoutHandlerC1ER21MAlfInterfaceProvider @ 211 NONAME
+	_ZN25CAlfViewportLayoutHandlerC2ER21MAlfInterfaceProvider @ 212 NONAME
+	_ZN25CAlfViewportLayoutHandlerD0Ev @ 213 NONAME
+	_ZN25CAlfViewportLayoutHandlerD1Ev @ 214 NONAME
+	_ZN25CAlfViewportLayoutHandlerD2Ev @ 215 NONAME
+	_ZN26CAlfCurvePathLayoutHandler10ConstructLEP10CHuiVisualR11CHuiControlP10CHuiLayout @ 216 NONAME
+	_ZN26CAlfCurvePathLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 217 NONAME
+	_ZN26CAlfCurvePathLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 218 NONAME
+	_ZN26CAlfCurvePathLayoutHandler4NewLER21MAlfInterfaceProviderP11CHuiControlP10CHuiLayout @ 219 NONAME
+	_ZN26CAlfCurvePathLayoutHandler7ReleaseEv @ 220 NONAME
+	_ZN26CAlfCurvePathLayoutHandlerC1ER21MAlfInterfaceProvider @ 221 NONAME
+	_ZN26CAlfCurvePathLayoutHandlerC2ER21MAlfInterfaceProvider @ 222 NONAME
+	_ZN26CAlfCurvePathLayoutHandlerD0Ev @ 223 NONAME
+	_ZN26CAlfCurvePathLayoutHandlerD1Ev @ 224 NONAME
+	_ZN26CAlfCurvePathLayoutHandlerD2Ev @ 225 NONAME
+	_ZN26CAlfDropShadowBrushHandler10ConstructLEP9CHuiBrushi @ 226 NONAME
+	_ZN26CAlfDropShadowBrushHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 227 NONAME
+	_ZN26CAlfDropShadowBrushHandler12GetInterfaceERK20THuiInterfaceSupport @ 228 NONAME
+	_ZN26CAlfDropShadowBrushHandler4NewLER21MAlfInterfaceProvideri @ 229 NONAME
+	_ZN26CAlfDropShadowBrushHandler7ReleaseEv @ 230 NONAME
+	_ZN26CAlfDropShadowBrushHandlerC1ER21MAlfInterfaceProvider @ 231 NONAME
+	_ZN26CAlfDropShadowBrushHandlerC2ER21MAlfInterfaceProvider @ 232 NONAME
+	_ZN26CAlfDropShadowBrushHandlerD0Ev @ 233 NONAME
+	_ZN26CAlfDropShadowBrushHandlerD1Ev @ 234 NONAME
+	_ZN26CAlfDropShadowBrushHandlerD2Ev @ 235 NONAME
+	_ZN26CAlfLCTAnchorLayoutHandler10ConstructLEP10CHuiVisualR11CHuiControlP10CHuiLayout @ 236 NONAME
+	_ZN26CAlfLCTAnchorLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 237 NONAME
+	_ZN26CAlfLCTAnchorLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 238 NONAME
+	_ZN26CAlfLCTAnchorLayoutHandler4NewLER21MAlfInterfaceProviderP11CHuiControlP10CHuiLayout @ 239 NONAME
+	_ZN26CAlfLCTAnchorLayoutHandler7ReleaseEv @ 240 NONAME
+	_ZN26CAlfLCTAnchorLayoutHandlerC1ER21MAlfInterfaceProvider @ 241 NONAME
+	_ZN26CAlfLCTAnchorLayoutHandlerC2ER21MAlfInterfaceProvider @ 242 NONAME
+	_ZN26CAlfLCTAnchorLayoutHandlerD0Ev @ 243 NONAME
+	_ZN26CAlfLCTAnchorLayoutHandlerD1Ev @ 244 NONAME
+	_ZN26CAlfLCTAnchorLayoutHandlerD2Ev @ 245 NONAME
+	_ZN28CAlfShadowBorderBrushHandler10ConstructLEP9CHuiBrushi @ 246 NONAME
+	_ZN28CAlfShadowBorderBrushHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 247 NONAME
+	_ZN28CAlfShadowBorderBrushHandler12GetInterfaceERK20THuiInterfaceSupport @ 248 NONAME
+	_ZN28CAlfShadowBorderBrushHandler4NewLER21MAlfInterfaceProvideri @ 249 NONAME
+	_ZN28CAlfShadowBorderBrushHandler7ReleaseEv @ 250 NONAME
+	_ZN28CAlfShadowBorderBrushHandlerC1ER21MAlfInterfaceProvider @ 251 NONAME
+	_ZN28CAlfShadowBorderBrushHandlerC2ER21MAlfInterfaceProvider @ 252 NONAME
+	_ZN28CAlfShadowBorderBrushHandlerD0Ev @ 253 NONAME
+	_ZN28CAlfShadowBorderBrushHandlerD1Ev @ 254 NONAME
+	_ZN28CAlfShadowBorderBrushHandlerD2Ev @ 255 NONAME
+	_ZN9CAlfAppUi10ConstructLEv @ 256 NONAME
+	_ZN9CAlfAppUi14HandleCommandLEi @ 257 NONAME
+	_ZN9CAlfAppUi14HandleWsEventLERK8TWsEventP11CCoeControl @ 258 NONAME
+	_ZN9CAlfAppUi18HandleSystemEventLERK8TWsEvent @ 259 NONAME
+	_ZN9CAlfAppUi21HandleResourceChangeLEi @ 260 NONAME
+	_ZN9CAlfAppUi28AppendDisplayOnSharedWindowLER11CHuiDisplay @ 261 NONAME
+	_ZN9CAlfAppUi9ContainerEv @ 262 NONAME
+	_ZN9CAlfAppUiC1Ev @ 263 NONAME
+	_ZN9CAlfAppUiC2Ev @ 264 NONAME
+	_ZN9CAlfAppUiD0Ev @ 265 NONAME
+	_ZN9CAlfAppUiD1Ev @ 266 NONAME
+	_ZN9CAlfAppUiD2Ev @ 267 NONAME
+	_ZNK13CAlfAppServer16MetricsInterfaceEv @ 268 NONAME
+	_ZNK13CAlfAppServer9WsSessionEv @ 269 NONAME
+	_ZNK21CAlfAppSrvSessionBase12SharedHuiEnvEv @ 270 NONAME
+	_ZNK21CAlfAppSrvSessionBase13LayoutManagerEv @ 271 NONAME
+	_ZNK21CAlfAppSrvSessionBase17ClientDrawingAreaEv @ 272 NONAME
+	_ZNK21CAlfAppSrvSessionBase20PreferredRefreshModeEv @ 273 NONAME
+	_ZNK21CAlfAppSrvSessionBase28PreferredWindowGroupPositionEv @ 274 NONAME
+	_ZNK9CAlfAppUi24FrameworkCallsRendezvousEv @ 275 NONAME
+	_ZTI13CAlfAppServer @ 276 NONAME ABSENT
+	_ZTI16CAlfBrushHandler @ 277 NONAME ; #<TI>#
+	_ZTI16CAlfSrvEffectEnv @ 278 NONAME ABSENT
+	_ZTI17CAlfAppSrvSession @ 279 NONAME ABSENT
+	_ZTI17CAlfLayoutHandler @ 280 NONAME ; #<TI>#
+	_ZTI17CAlfVisualHandler @ 281 NONAME ; #<TI>#
+	_ZTI20TAlfTextStyleHandler @ 282 NONAME ABSENT
+	_ZTI21CAlfAppSrvSessionBase @ 283 NONAME ; #<TI>#
+	_ZTI21CAlfDeckLayoutHandler @ 284 NONAME ; #<TI>#
+	_ZTI21CAlfFlowLayoutHandler @ 285 NONAME ; #<TI>#
+	_ZTI21CAlfFrameBrushHandler @ 286 NONAME ; #<TI>#
+	_ZTI21CAlfGridLayoutHandler @ 287 NONAME ; #<TI>#
+	_ZTI21CAlfImageBrushHandler @ 288 NONAME ; #<TI>#
+	_ZTI21CAlfLineVisualHandler @ 289 NONAME ; #<TI>#
+	_ZTI21CAlfMeshVisualHandler @ 290 NONAME ; #<TI>#
+	_ZTI21CAlfSrvSubSessionBase @ 291 NONAME ABSENT
+	_ZTI21CAlfTextVisualHandler @ 292 NONAME ; #<TI>#
+	_ZTI22CAlfBorderBrushHandler @ 293 NONAME ; #<TI>#
+	_ZTI22CAlfImageVisualHandler @ 294 NONAME ; #<TI>#
+	_ZTI23CAlfAnchorLayoutHandler @ 295 NONAME ; #<TI>#
+	_ZTI24CAlfGradientBrushHandler @ 296 NONAME ; #<TI>#
+	_ZTI24CAlfLCTGridLayoutHandler @ 297 NONAME ; #<TI>#
+	_ZTI24CAlfLCTTextVisualHandler @ 298 NONAME ; #<TI>#
+	_ZTI24CAlfSrvDisplaySubSession @ 299 NONAME ABSENT
+	_ZTI24TAlfTableMappingFunction @ 300 NONAME ABSENT
+	_ZTI25CAlfViewportLayoutHandler @ 301 NONAME ; #<TI>#
+	_ZTI26CAlfCurvePathLayoutHandler @ 302 NONAME ; #<TI>#
+	_ZTI26CAlfDropShadowBrushHandler @ 303 NONAME ; #<TI>#
+	_ZTI26CAlfLCTAnchorLayoutHandler @ 304 NONAME ; #<TI>#
+	_ZTI28CAlfShadowBorderBrushHandler @ 305 NONAME ; #<TI>#
+	_ZTI29CAlfSrvControlGroupSubSession @ 306 NONAME ABSENT
+	_ZTI31CAlfSrvTransformationSubSession @ 307 NONAME ABSENT
+	_ZTI9CAlfAppUi @ 308 NONAME ABSENT
+	_ZTV13CAlfAppServer @ 309 NONAME ABSENT
+	_ZTV16CAlfBrushHandler @ 310 NONAME ; #<VT>#
+	_ZTV16CAlfSrvEffectEnv @ 311 NONAME ABSENT
+	_ZTV17CAlfAppSrvSession @ 312 NONAME ABSENT
+	_ZTV17CAlfLayoutHandler @ 313 NONAME ; #<VT>#
+	_ZTV17CAlfVisualHandler @ 314 NONAME ; #<VT>#
+	_ZTV20TAlfTextStyleHandler @ 315 NONAME ABSENT
+	_ZTV21CAlfAppSrvSessionBase @ 316 NONAME ; #<VT>#
+	_ZTV21CAlfDeckLayoutHandler @ 317 NONAME ; #<VT>#
+	_ZTV21CAlfFlowLayoutHandler @ 318 NONAME ; #<VT>#
+	_ZTV21CAlfFrameBrushHandler @ 319 NONAME ; #<VT>#
+	_ZTV21CAlfGridLayoutHandler @ 320 NONAME ; #<VT>#
+	_ZTV21CAlfImageBrushHandler @ 321 NONAME ; #<VT>#
+	_ZTV21CAlfLineVisualHandler @ 322 NONAME ; #<VT>#
+	_ZTV21CAlfMeshVisualHandler @ 323 NONAME ; #<VT>#
+	_ZTV21CAlfSrvSubSessionBase @ 324 NONAME ABSENT
+	_ZTV21CAlfTextVisualHandler @ 325 NONAME ; #<VT>#
+	_ZTV22CAlfBorderBrushHandler @ 326 NONAME ; #<VT>#
+	_ZTV22CAlfImageVisualHandler @ 327 NONAME ; #<VT>#
+	_ZTV23CAlfAnchorLayoutHandler @ 328 NONAME ; #<VT>#
+	_ZTV24CAlfGradientBrushHandler @ 329 NONAME ; #<VT>#
+	_ZTV24CAlfLCTGridLayoutHandler @ 330 NONAME ; #<VT>#
+	_ZTV24CAlfLCTTextVisualHandler @ 331 NONAME ; #<VT>#
+	_ZTV24CAlfSrvDisplaySubSession @ 332 NONAME ABSENT
+	_ZTV24TAlfTableMappingFunction @ 333 NONAME ABSENT
+	_ZTV25CAlfViewportLayoutHandler @ 334 NONAME ; #<VT>#
+	_ZTV26CAlfCurvePathLayoutHandler @ 335 NONAME ; #<VT>#
+	_ZTV26CAlfDropShadowBrushHandler @ 336 NONAME ; #<VT>#
+	_ZTV26CAlfLCTAnchorLayoutHandler @ 337 NONAME ; #<VT>#
+	_ZTV28CAlfShadowBorderBrushHandler @ 338 NONAME ; #<VT>#
+	_ZTV29CAlfSrvControlGroupSubSession @ 339 NONAME ABSENT
+	_ZTV31CAlfSrvTransformationSubSession @ 340 NONAME ABSENT
+	_ZTV9CAlfAppUi @ 341 NONAME ABSENT
+	_ZThn36_N21CAlfAppSrvSessionBase11CompleteCmdEii @ 342 NONAME ; #<thunk>#
+	_ZThn36_N21CAlfAppSrvSessionBase13GetInterfaceLERK20THuiInterfaceSupporti @ 343 NONAME ; #<thunk>#
+	_ZThn36_N21CAlfAppSrvSessionBase22GetHandleFromInterfaceERK20THuiInterfaceSupportPv @ 344 NONAME ; #<thunk>#
+	_ZThn36_N21CAlfAppSrvSessionBase27HandleCurrentCommanndAsynchEv @ 345 NONAME ; #<thunk>#
+	_ZThn36_NK21CAlfAppSrvSessionBase12SharedHuiEnvEv @ 346 NONAME ; #<thunk>#
+	_ZThn36_NK21CAlfAppSrvSessionBase13LayoutManagerEv @ 347 NONAME ; #<thunk>#
+	_ZThn4_N16CAlfBrushHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 348 NONAME ; #<thunk>#
+	_ZThn4_N16CAlfBrushHandler12GetInterfaceERK20THuiInterfaceSupport @ 349 NONAME ; #<thunk>#
+	_ZThn4_N16CAlfBrushHandler7ReleaseEv @ 350 NONAME ; #<thunk>#
+	_ZThn4_N17CAlfLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 351 NONAME ; #<thunk>#
+	_ZThn4_N17CAlfLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 352 NONAME ; #<thunk>#
+	_ZThn4_N17CAlfLayoutHandler7ReleaseEv @ 353 NONAME ; #<thunk>#
+	_ZThn4_N17CAlfVisualHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 354 NONAME ; #<thunk>#
+	_ZThn4_N17CAlfVisualHandler12GetInterfaceERK20THuiInterfaceSupport @ 355 NONAME ; #<thunk>#
+	_ZThn4_N17CAlfVisualHandler7ReleaseEv @ 356 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfFlowLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 357 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfFlowLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 358 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfFlowLayoutHandler7ReleaseEv @ 359 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfFrameBrushHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 360 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfFrameBrushHandler12GetInterfaceERK20THuiInterfaceSupport @ 361 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfFrameBrushHandler7ReleaseEv @ 362 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfGridLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 363 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfGridLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 364 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfGridLayoutHandler7ReleaseEv @ 365 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfImageBrushHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 366 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfImageBrushHandler12GetInterfaceERK20THuiInterfaceSupport @ 367 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfImageBrushHandler7ReleaseEv @ 368 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfLineVisualHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 369 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfLineVisualHandler12GetInterfaceERK20THuiInterfaceSupport @ 370 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfLineVisualHandler7ReleaseEv @ 371 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfMeshVisualHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 372 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfMeshVisualHandler12GetInterfaceERK20THuiInterfaceSupport @ 373 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfMeshVisualHandler7ReleaseEv @ 374 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfTextVisualHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 375 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfTextVisualHandler12GetInterfaceERK20THuiInterfaceSupport @ 376 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfTextVisualHandler7ReleaseEv @ 377 NONAME ; #<thunk>#
+	_ZThn4_N22CAlfBorderBrushHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 378 NONAME ; #<thunk>#
+	_ZThn4_N22CAlfBorderBrushHandler12GetInterfaceERK20THuiInterfaceSupport @ 379 NONAME ; #<thunk>#
+	_ZThn4_N22CAlfBorderBrushHandler7ReleaseEv @ 380 NONAME ; #<thunk>#
+	_ZThn4_N22CAlfImageVisualHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 381 NONAME ; #<thunk>#
+	_ZThn4_N22CAlfImageVisualHandler12GetInterfaceERK20THuiInterfaceSupport @ 382 NONAME ; #<thunk>#
+	_ZThn4_N22CAlfImageVisualHandler7ReleaseEv @ 383 NONAME ; #<thunk>#
+	_ZThn4_N23CAlfAnchorLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 384 NONAME ; #<thunk>#
+	_ZThn4_N23CAlfAnchorLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 385 NONAME ; #<thunk>#
+	_ZThn4_N23CAlfAnchorLayoutHandler7ReleaseEv @ 386 NONAME ; #<thunk>#
+	_ZThn4_N24CAlfGradientBrushHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 387 NONAME ; #<thunk>#
+	_ZThn4_N24CAlfGradientBrushHandler12GetInterfaceERK20THuiInterfaceSupport @ 388 NONAME ; #<thunk>#
+	_ZThn4_N24CAlfGradientBrushHandler7ReleaseEv @ 389 NONAME ; #<thunk>#
+	_ZThn4_N24CAlfLCTGridLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 390 NONAME ; #<thunk>#
+	_ZThn4_N24CAlfLCTGridLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 391 NONAME ; #<thunk>#
+	_ZThn4_N24CAlfLCTGridLayoutHandler7ReleaseEv @ 392 NONAME ; #<thunk>#
+	_ZThn4_N24CAlfLCTTextVisualHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 393 NONAME ; #<thunk>#
+	_ZThn4_N24CAlfLCTTextVisualHandler12GetInterfaceERK20THuiInterfaceSupport @ 394 NONAME ; #<thunk>#
+	_ZThn4_N24CAlfLCTTextVisualHandler7ReleaseEv @ 395 NONAME ; #<thunk>#
+	_ZThn4_N25CAlfViewportLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 396 NONAME ; #<thunk>#
+	_ZThn4_N25CAlfViewportLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 397 NONAME ; #<thunk>#
+	_ZThn4_N25CAlfViewportLayoutHandler7ReleaseEv @ 398 NONAME ; #<thunk>#
+	_ZThn4_N26CAlfCurvePathLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 399 NONAME ; #<thunk>#
+	_ZThn4_N26CAlfCurvePathLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 400 NONAME ; #<thunk>#
+	_ZThn4_N26CAlfCurvePathLayoutHandler7ReleaseEv @ 401 NONAME ; #<thunk>#
+	_ZThn4_N26CAlfDropShadowBrushHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 402 NONAME ; #<thunk>#
+	_ZThn4_N26CAlfDropShadowBrushHandler12GetInterfaceERK20THuiInterfaceSupport @ 403 NONAME ; #<thunk>#
+	_ZThn4_N26CAlfDropShadowBrushHandler7ReleaseEv @ 404 NONAME ; #<thunk>#
+	_ZThn4_N26CAlfLCTAnchorLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 405 NONAME ; #<thunk>#
+	_ZThn4_N26CAlfLCTAnchorLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 406 NONAME ; #<thunk>#
+	_ZThn4_N26CAlfLCTAnchorLayoutHandler7ReleaseEv @ 407 NONAME ; #<thunk>#
+	_ZThn4_N28CAlfShadowBorderBrushHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 408 NONAME ; #<thunk>#
+	_ZThn4_N28CAlfShadowBorderBrushHandler12GetInterfaceERK20THuiInterfaceSupport @ 409 NONAME ; #<thunk>#
+	_ZThn4_N28CAlfShadowBorderBrushHandler7ReleaseEv @ 410 NONAME ; #<thunk>#
+	_ZN21CAlfAppSrvSessionBase22SetClientWindowGroupIdEi @ 411 NONAME
+	_ZN16CAlfBrushHandler21BrushHandlerExtensionERK4TUidPPv @ 412 NONAME
+	_ZN21CAlfFrameBrushHandler21BrushHandlerExtensionERK4TUidPPv @ 413 NONAME
+	_ZN21CAlfImageBrushHandler21BrushHandlerExtensionERK4TUidPPv @ 414 NONAME
+	_ZN22CAlfBorderBrushHandler21BrushHandlerExtensionERK4TUidPPv @ 415 NONAME
+	_ZN24CAlfGradientBrushHandler21BrushHandlerExtensionERK4TUidPPv @ 416 NONAME
+	_ZN26CAlfDropShadowBrushHandler21BrushHandlerExtensionERK4TUidPPv @ 417 NONAME
+	_ZN28CAlfShadowBorderBrushHandler21BrushHandlerExtensionERK4TUidPPv @ 418 NONAME
+	_ZN17CAlfLayoutHandler22VisualHandlerExtensionERK4TUidPPv @ 419 NONAME
+	_ZN17CAlfVisualHandler22VisualHandlerExtensionERK4TUidPPv @ 420 NONAME
+	_ZN21CAlfDeckLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 421 NONAME
+	_ZN21CAlfDeckLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 422 NONAME
+	_ZN21CAlfDeckLayoutHandler22VisualHandlerExtensionERK4TUidPPv @ 423 NONAME
+	_ZN21CAlfDeckLayoutHandler7ReleaseEv @ 424 NONAME
+	_ZN21CAlfFlowLayoutHandler22VisualHandlerExtensionERK4TUidPPv @ 425 NONAME
+	_ZN21CAlfGridLayoutHandler22VisualHandlerExtensionERK4TUidPPv @ 426 NONAME
+	_ZN21CAlfLineVisualHandler22VisualHandlerExtensionERK4TUidPPv @ 427 NONAME
+	_ZN21CAlfMeshVisualHandler22VisualHandlerExtensionERK4TUidPPv @ 428 NONAME
+	_ZN21CAlfTextVisualHandler22VisualHandlerExtensionERK4TUidPPv @ 429 NONAME
+	_ZN22CAlfImageVisualHandler22VisualHandlerExtensionERK4TUidPPv @ 430 NONAME
+	_ZN23CAlfAnchorLayoutHandler22VisualHandlerExtensionERK4TUidPPv @ 431 NONAME
+	_ZN24CAlfLCTGridLayoutHandler22VisualHandlerExtensionERK4TUidPPv @ 432 NONAME
+	_ZN24CAlfLCTTextVisualHandler22VisualHandlerExtensionERK4TUidPPv @ 433 NONAME
+	_ZN25CAlfViewportLayoutHandler22VisualHandlerExtensionERK4TUidPPv @ 434 NONAME
+	_ZN26CAlfCurvePathLayoutHandler22VisualHandlerExtensionERK4TUidPPv @ 435 NONAME
+	_ZN26CAlfLCTAnchorLayoutHandler22VisualHandlerExtensionERK4TUidPPv @ 436 NONAME
+	_ZThn4_N21CAlfDeckLayoutHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 437 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfDeckLayoutHandler12GetInterfaceERK20THuiInterfaceSupport @ 438 NONAME ; #<thunk>#
+	_ZThn4_N21CAlfDeckLayoutHandler7ReleaseEv @ 439 NONAME ; #<thunk>#
+	_ZN21CAlfAppSrvSessionBase10DisconnectERK9RMessage2 @ 440 NONAME
+	_ZN21CAlfAppSrvSessionBase10Extension_EjRPvS0_ @ 441 NONAME
+	_ZN21CAlfAppSrvSessionBase12ServiceErrorERK9RMessage2i @ 442 NONAME
+	_ZN21CAlfAppSrvSessionBase14CountResourcesEv @ 443 NONAME
+	_ZN21CAlfAppSrvSessionBase29AlfInterfaceProviderExtensionERK4TUidPPv @ 444 NONAME
+	_ZThn36_N21CAlfAppSrvSessionBase29AlfInterfaceProviderExtensionERK4TUidPPv @ 445 NONAME ; #<thunk>#
+	_ZN21CAlfFrameBrushHandler10ConstructLEP9CHuiBrushRK11TAknsItemID12TAlfXYMetric @ 446 NONAME
+	_ZN21CAlfFrameBrushHandler4NewLER21MAlfInterfaceProviderRK11TAknsItemID12TAlfXYMetric @ 447 NONAME
+	_ZN22CAlfBorderBrushHandler10ConstructLEP9CHuiBrush12TAlfXYMetricS2_ @ 448 NONAME
+	_ZN22CAlfBorderBrushHandler4NewLER21MAlfInterfaceProvider12TAlfXYMetricS2_ @ 449 NONAME
+	_ZN26CAlfDropShadowBrushHandler10ConstructLEP9CHuiBrush10TAlfMetric @ 450 NONAME
+	_ZN26CAlfDropShadowBrushHandler4NewLER21MAlfInterfaceProvider10TAlfMetric @ 451 NONAME
+	_ZN28CAlfShadowBorderBrushHandler10ConstructLEP9CHuiBrush10TAlfMetric @ 452 NONAME
+	_ZN28CAlfShadowBorderBrushHandler4NewLER21MAlfInterfaceProvider10TAlfMetric @ 453 NONAME
+	_ZN16CAlfSrvEffectEnv20VisibleControlGroupLEi @ 454 NONAME
+	_ZN21CAlfFrameBrushHandler10ConstructLEP9CHuiBrushRK9THuiImage12TAlfXYMetric @ 455 NONAME
+	_ZN21CAlfFrameBrushHandler4NewLER21MAlfInterfaceProviderRK9THuiImage12TAlfXYMetric @ 456 NONAME
+	_ZN23CAlfCanvasVisualHandler10ConstructLEP10CHuiVisualR11CHuiControlP10CHuiLayout @ 457 NONAME
+	_ZN23CAlfCanvasVisualHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 458 NONAME
+	_ZN23CAlfCanvasVisualHandler12GetInterfaceERK20THuiInterfaceSupport @ 459 NONAME
+	_ZN23CAlfCanvasVisualHandler22VisualHandlerExtensionERK4TUidPPv @ 460 NONAME
+	_ZN23CAlfCanvasVisualHandler4NewLER21MAlfInterfaceProviderP11CHuiControlP10CHuiLayout @ 461 NONAME
+	_ZN23CAlfCanvasVisualHandler7ReleaseEv @ 462 NONAME
+	_ZN23CAlfCanvasVisualHandlerC1ER21MAlfInterfaceProvider @ 463 NONAME
+	_ZN23CAlfCanvasVisualHandlerC2ER21MAlfInterfaceProvider @ 464 NONAME
+	_ZN23CAlfCanvasVisualHandlerD0Ev @ 465 NONAME
+	_ZN23CAlfCanvasVisualHandlerD1Ev @ 466 NONAME
+	_ZN23CAlfCanvasVisualHandlerD2Ev @ 467 NONAME
+	_ZTI23CAlfCanvasVisualHandler @ 468 NONAME ; #<TI>#
+	_ZTV23CAlfCanvasVisualHandler @ 469 NONAME ; #<VT>#
+	_ZThn4_N23CAlfCanvasVisualHandler10HandleCmdLEiRK6TDesC8R5TDes8 @ 470 NONAME ; #<thunk>#
+	_ZThn4_N23CAlfCanvasVisualHandler12GetInterfaceERK20THuiInterfaceSupport @ 471 NONAME ; #<thunk>#
+	_ZThn4_N23CAlfCanvasVisualHandler7ReleaseEv @ 472 NONAME ; #<thunk>#
+	_ZN10CAlfWindow10OutBufferLEi @ 473 NONAME
+	_ZN10CAlfWindow10SetOpacityEfj @ 474 NONAME
+	_ZN10CAlfWindow11SetRotationEfj @ 475 NONAME
+	_ZN10CAlfWindow12ContentReadyERK7TRegion @ 476 NONAME
+	_ZN10CAlfWindow16SetSurfaceExtentERK5TRect @ 477 NONAME
+	_ZN10CAlfWindow31EnableIndexChangedNotificationsEi @ 478 NONAME
+	_ZN10CAlfWindow4MoveEj @ 479 NONAME
+	_ZN10CAlfWindow6SetPosE6TPointj @ 480 NONAME
+	_ZN10CAlfWindow7SetSizeE5TSizej @ 481 NONAME
+	_ZN10CAlfWindow8InBufferEv @ 482 NONAME
+	_ZN10CAlfWindow9SetActiveEi @ 483 NONAME
+	_ZN16CAlfWindowBuffer4NewLERK5TSizeijPv @ 484 NONAME
+	_ZN16CAlfWindowBuffer7SetSizeERK5TSize @ 485 NONAME
+	_ZN16CAlfWindowBuffer9SetFormatEi @ 486 NONAME
+	_ZN16CAlfWindowBuffer9SetStrideEj @ 487 NONAME
+	_ZN16CAlfWindowBufferD0Ev @ 488 NONAME
+	_ZN16CAlfWindowBufferD1Ev @ 489 NONAME
+	_ZN16CAlfWindowBufferD2Ev @ 490 NONAME
+	_ZN17CAlfWindowManager13DestroyWindowER10CAlfWindow @ 491 NONAME
+	_ZN17CAlfWindowManager13GetWinIdListLEiR6RArrayI17TWindowIdentifierE @ 492 NONAME
+	_ZN17CAlfWindowManager15GetWinInfoListLEiiR6RArrayI13TAlfWServInfoE @ 493 NONAME
+	_ZN17CAlfWindowManager16CreateNewWindowLEjRK5TSize @ 494 NONAME
+	_ZN17CAlfWindowManager29EnableNewWindowNotificationsLER18CAlfWindowFxPlugini @ 495 NONAME
+	_ZN17CAlfWindowManager33EnableDestroyWindowNotificationsLER18CAlfWindowFxPlugini @ 496 NONAME
+	_ZN17CAlfWindowManager6BridgeEv @ 497 NONAME
+	_ZN17CAlfWindowManager6PostItERK15TAlfBridgerData @ 498 NONAME
+	_ZN17CAlfWindowManager7ReleaseER10CAlfWindowi @ 499 NONAME
+	_ZN17CAlfWindowManager8ReserveLERK17TWindowIdentifieri @ 500 NONAME
+	_ZN18CAlfStreamerBridge14AppendVarDataLEiRi @ 501 NONAME
+	_ZN18CAlfWindowFxPlugin10ConstructLERK17CAlfWindowManageri @ 502 NONAME
+	_ZN18CAlfWindowFxPlugin13CancelMessageEi @ 503 NONAME
+	_ZN18CAlfWindowFxPlugin13DestroyWindowERK17TWindowIdentifier @ 504 NONAME
+	_ZN18CAlfWindowFxPlugin13WindowManagerEv @ 505 NONAME
+	_ZN18CAlfWindowFxPlugin14HandleMessageLERK6TDesC8R5TPtr8 @ 506 NONAME
+	_ZN18CAlfWindowFxPlugin14HandleMessageLERK6TDesC8RK9RMessage2 @ 507 NONAME
+	_ZN18CAlfWindowFxPlugin9NewWindowERK17TWindowIdentifier @ 508 NONAME
+	_ZN18CAlfWindowFxPluginD0Ev @ 509 NONAME
+	_ZN18CAlfWindowFxPluginD1Ev @ 510 NONAME
+	_ZN18CAlfWindowFxPluginD2Ev @ 511 NONAME
+	_ZNK10CAlfWindow10IdentifierEv @ 512 NONAME
+	_ZNK10CAlfWindow13SurfaceExtentEv @ 513 NONAME
+	_ZNK10CAlfWindow4SizeEv @ 514 NONAME
+	_ZNK10CAlfWindow5IndexEv @ 515 NONAME
+	_ZNK10CAlfWindow6WsInfoEv @ 516 NONAME
+	_ZNK10CAlfWindow7OpacityEv @ 517 NONAME
+	_ZNK10CAlfWindow8IsActiveEv @ 518 NONAME
+	_ZNK10CAlfWindow8PositionEv @ 519 NONAME
+	_ZNK10CAlfWindow8RotationEv @ 520 NONAME
+	_ZNK16CAlfWindowBuffer12SetBufferPtrEPv @ 521 NONAME
+	_ZNK16CAlfWindowBuffer4SizeEv @ 522 NONAME
+	_ZNK16CAlfWindowBuffer6FormatEv @ 523 NONAME
+	_ZNK16CAlfWindowBuffer6StrideEv @ 524 NONAME
+	_ZNK16CAlfWindowBuffer9BufferPtrEv @ 525 NONAME
+	_ZNK17CAlfWindowManager8ScreenIdEv @ 526 NONAME
+	_ZTI12CAlfNodeAnim @ 527 NONAME ; #<TI>#
+	_ZTI12CAlfNodeRoot @ 528 NONAME ; #<TI>#
+	_ZTI13CAlfNodeGroup @ 529 NONAME ; #<TI>#
+	_ZTI14CAlfNodeSprite @ 530 NONAME ; #<TI>#
+	_ZTI14CAlfNodeVisual @ 531 NONAME ; #<TI>#
+	_ZTI14CAlfNodeWindow @ 532 NONAME ; #<TI>#
+	_ZTI18CAlfNodeTextCursor @ 533 NONAME ; #<TI>#
+	_ZTI18CAlfWindowFxPlugin @ 534 NONAME ; #<TI>#
+	_ZTI8CAlfNode @ 535 NONAME ; #<TI>#
+	_ZTV12CAlfNodeAnim @ 536 NONAME ; #<VT>#
+	_ZTV12CAlfNodeRoot @ 537 NONAME ; #<VT>#
+	_ZTV13CAlfNodeGroup @ 538 NONAME ; #<VT>#
+	_ZTV14CAlfNodeSprite @ 539 NONAME ; #<VT>#
+	_ZTV14CAlfNodeVisual @ 540 NONAME ; #<VT>#
+	_ZTV14CAlfNodeWindow @ 541 NONAME ; #<VT>#
+	_ZTV18CAlfNodeTextCursor @ 542 NONAME ; #<VT>#
+	_ZTV18CAlfWindowFxPlugin @ 543 NONAME ; #<VT>#
+	_ZTV8CAlfNode @ 544 NONAME ; #<VT>#
+	_ZN18CAlfStreamerBridge18AppendEffectsDataLEiRi @ 545 NONAME
+	_ZN18CAlfStreamerBridge15FindWgForAppUidE4TUid @ 546 NONAME
+	_ZN18CAlfStreamerBridge17FindAppUidForWgIdEi @ 547 NONAME
+	_ZN10CAlfWindow21SetLayerUsesAplhaFlagEi @ 548 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerCore/sis/ServerCore.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,47 @@
+;
+; 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: 
+;
+
+; ============================================================================
+;  Name        : servercore.pkg
+;  Part of     : alfappservercore.dll / Alfred
+;  Description : Package file for project hitchcock
+;  Version     : %version: 1.1.1.1.1 % << Don't touch! Updated by Synergy at check-out.
+;
+;  Copyright © 2006-2007 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.1
+
+; standard SIS file header
+#{"Hitchcock Server Core"},(0x10282848),1,0,0
+
+;Supports Series 60 v 3.0
+(0x101F7961), 0, 0, 0, {"Series60ProductID"}
+
+;Localized Vendor Name
+%{"Nokia-EN"}
+
+;Unique Vendor name
+:"Nokia"
+
+; Files to copy
+"\epoc32\release\armv5\urel\alfappservercore.dll"-"!:\sys\bin\alfappservercore.dll"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerInterface/inc/alfapplication.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Application definition
+*
+*/
+
+
+
+#ifndef C_ALFAPPLICATION_H
+#define C_ALFAPPLICATION_H
+
+#include <aknapp.h>
+
+/**
+ *  Application class for Alfred app server.
+ *
+ *  @since S60 v3.2
+ */
+class CAlfApplication : public CAknApplication
+    {
+public:
+
+// from base class CAknApplication
+
+    /**
+     * From CAknApplication.
+     * Called by the framework when new server is launched.
+     *
+     * @param aAppServer Pointer to the server class which this 
+     *                   implementation allocates and returns the
+     *                   ownership.
+     */
+    void NewAppServerL(CApaAppServer*& aAppServer);
+    
+    /**
+     * From CAknApplication.
+     * Called by the system when a document is created.
+     *
+     * @return New document instance. Ownership transferred.
+     */
+    CApaDocument* CreateDocumentL(); 
+    
+    /**
+     * From CAknApplication.
+     * Returns the component UID.
+     *
+     * @return UID3 of the app server.
+     */
+    TUid AppDllUid() const;
+
+    };
+
+#endif // C_ALFAPPLICATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerInterface/inc/alfdocument.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Document definition
+*
+*/
+
+
+
+#ifndef C_ALFDOCUMENT_H
+#define C_ALFDOCUMENT_H
+
+#include <AknDoc.h>
+
+class CAlfApplication;
+
+/**
+ *  Alfred Server document class.
+ *
+ *  @since S60 v3.2
+ */
+class CAlfDocument : public CAknDocument
+    {
+    
+public:
+    
+    /**
+     * Constructor
+     */
+    CAlfDocument( CAlfApplication& aApplication );
+
+// from base class CAknDocument
+
+    /**
+     * From CAknDocument.
+     * Called by the framework when an appui is created.
+     *
+     * @return New appui instannce. Ownership transferred.
+     */
+    CEikAppUi* CreateAppUiL();
+
+    // from CEikDocument
+    void UpdateTaskNameL(CApaWindowGroupName* aWgName);
+
+    };
+
+#endif // C_ALFDOCUMENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerInterface/sis/serverinterface.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,49 @@
+;
+; 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: 
+;
+
+;  Name        : serverinterface.pkg
+;  Part of     : alfredserver.exe / Alfred
+;  Description : Package file for project hitchcock
+;  Version     : %version: 1.1.1.1.1 % << Don't touch! Updated by Synergy at check-out.
+;
+;  Copyright © 2006-2007 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.1
+
+; standard SIS file header
+#{"Hitchcock Server Interface"},(0x10282845),1,0,0
+
+;Supports Series 60 v 3.0
+(0x101F7961), 0, 0, 0, {"Series60ProductID"}
+
+;Localized Vendor Name
+%{"Nokia-EN"}
+
+;Unique Vendor name
+:"Nokia"
+
+; Files to copy
+"\epoc32\release\armv5\urel\alfredserver.exe"-"!:\sys\bin\alfredserver.exe"
+"\epoc32\data\z\private\10003a3f\apps\alfredserver_reg.rsc"-"!:\private\10003a3f\import\apps\alfredserver_reg.rsc"
+; "\epoc32\data\z\resource\apps\alfredserver_loc.Rsc"-"!:\resource\apps\alfredserver_loc.Rsc"
+; "\epoc32\data\z\resource\apps\alfredserver.Rsc"-"!:\resource\apps\alfredserver.Rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerInterface/src/alfapplication.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Application definition.
+*
+*/
+
+
+
+#include "alfapplication.h"
+#include "alfuids.h"
+#include "alf/alfappserver.h"
+#include "alfdocument.h"
+
+#include <eikstart.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// From class CAknApplication.
+// Allocates the server instance.
+// ---------------------------------------------------------------------------
+//
+void CAlfApplication::NewAppServerL(CApaAppServer*& aAppServer)
+    {
+    aAppServer = CAlfAppServer::NewAppServerL();
+    aAppServer->SetPriority(EActivePriorityIpcEventsHigh);
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CAknApplication.
+// Allocates the ducument instance.
+// ---------------------------------------------------------------------------
+//
+CApaDocument* CAlfApplication::CreateDocumentL()
+    {
+    return new (ELeave) CAlfDocument( *this );
+    }
+    
+// ---------------------------------------------------------------------------
+// From class CAknApplication.
+// Returns the application UID.
+// ---------------------------------------------------------------------------
+//
+TUid CAlfApplication::AppDllUid() const
+    {
+    return TUid::Uid(KAlfAppServerInterfaceUid3);
+    }
+
+// ======== GLOBAL FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+// NewApplication
+// ---------------------------------------------------------------------------
+//
+LOCAL_C CApaApplication* NewApplication()
+	{
+	return new CAlfApplication();
+	}
+
+// ---------------------------------------------------------------------------
+// E32Main
+// ---------------------------------------------------------------------------
+//
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication(NewApplication);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerInterface/src/alfdocument.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Document definition
+*
+*/
+
+
+
+#include <apgwgnam.h>
+#include "alfdocument.h"
+#include "alfapplication.h"
+#include "alf/alfappui.h"
+
+
+_LIT(KSERVERNAME, "ALF");
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CAlfDocument::CAlfDocument( CAlfApplication& aApplication )
+: CAknDocument( aApplication )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// From class CAknDocument.
+// Allocates the appui instance.
+// ---------------------------------------------------------------------------
+//
+CEikAppUi* CAlfDocument::CreateAppUiL()
+    {
+    return new (ELeave) CAlfAppUi;
+    }
+
+
+// This is currently only place where we can modify CEikonEnv's instance of wgname
+// that would override our custom settings in AppReady
+void CAlfDocument::UpdateTaskNameL(CApaWindowGroupName* aWgName)
+    {
+    aWgName->SetHidden(ETrue); // hides us from FSW and protects us from OOM FW etc.
+    aWgName->SetSystem(ETrue); // Allow only application with PowerManagement cap to shut us down    
+    aWgName->SetCaptionL(KSERVERNAME); // user friendly name of server
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerInterface/src/alfredserver.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project alfappserver
+*
+*/
+
+
+
+
+#include "../../CommonInc/alfuids.h"
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+
+EPOCSTACKSIZE 0x5000
+EPOCHEAPSIZE 0x1000 0x989680
+
+TARGET                  alfredserver.exe
+TARGETTYPE              exe
+UID                     0x100039CE KAlfAppServerInterfaceUid3
+VERSION                 10.0
+
+CAPABILITY              SwEvent
+VENDORID                VID_DEFAULT
+
+SOURCEPATH              ../src
+SOURCE                  alfapplication.cpp
+SOURCE                  alfdocument.cpp
+
+USERINCLUDE             ../inc
+USERINCLUDE             ../../CommonInc
+USERINCLUDE             ../../ServerCore/Inc // export the files?
+
+#include <platform_paths.hrh>
+MW_LAYER_SYSTEMINCLUDE
+
+
+SYSTEMINCLUDE           ../../../../inc
+
+
+LIBRARY                 alfappservercore.lib
+LIBRARY                 apfile.lib 
+LIBRARY                 apgrfx.lib
+LIBRARY                 apparc.lib 
+LIBRARY                 avkon.lib
+LIBRARY                 cone.lib
+LIBRARY                 eikcore.lib 
+LIBRARY                 eiksrv.lib
+LIBRARY                 eiksrvc.lib
+LIBRARY                 euser.lib
+     
+    
+          
+START RESOURCE ../src/alfredserver.rss
+HEADER
+	TARGETPATH APP_RESOURCE_DIR
+LANG    sc
+END          
+          
+START RESOURCE ../src/alfredserver_reg.rss
+DEPENDS alfredserver.rsg
+// Do not change the UID below.
+TARGETPATH /private/10003a3f/apps
+END
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerInterface/src/alfredserver.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Resource file
+*
+*/
+
+
+
+//  RESOURCE IDENTIFIER
+NAME    ALAS // 4 letter ID
+
+//  INCLUDES
+#include <data_caging_paths_strings.hrh>
+#include <eikon.rh>
+#include <uikon.rh>
+#include <avkon.rh>
+#include <appinfo.rh>
+#include "../../CommonInc/alfuids.h"
+
+//  CONSTANTS  
+
+//  RESOURCE DEFINITIONS 
+
+RESOURCE RSS_SIGNATURE { }
+RESOURCE TBUF { buf = ALFSERVERNAME; }
+
+
+RESOURCE EIK_APP_INFO
+	{
+	}
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerInterface/src/alfredserver_reg.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Registration file
+*
+*/
+
+
+
+#include <appinfo.rh>
+#include <alfredserver.rsg>
+#include <data_caging_paths_strings.hrh>
+#include "../../CommonInc/alfuids.h"
+
+UID2 KUidAppRegistrationResourceFile
+UID3 KAlfAppServerInterfaceUid3
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file                = ALFSERVERNAME;
+    hidden                  = KAppIsHidden;
+    newfile                 = KAppSupportsNewFile;
+    launch                  = KAppLaunchInBackground;
+    }
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerStub/Proxy_src/AlfAppFwProxy.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,420 @@
+// 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:
+
+#include <eiknotapi.h>
+#include <AknUtils.h>
+#include <AknLayoutFont.h>
+#include <AknBidiTextUtils.h>
+#include <AknsUtils.h>
+#include <AknsDrawUtils.h>
+#include <ecom/implementationproxy.h>
+#include <AknsBasicBackgroundControlContext.h>
+#include <AknWsEventObserver.h>
+#include <apgwgnam.h> 
+//#include <aknappui.h> 
+#include "alfappfwproxyops.h"
+#include "huiskinbackroundlayout.h"
+
+// hollow notifier implementation to get access on AppFw inside eikon server
+class CAlfAppFwNotifier : public CBase, public MEikSrvNotifierBase2, public MCoeMessageMonitorObserver	
+    {
+public:    
+    ~CAlfAppFwNotifier()
+        {
+        delete iBitmap;
+        delete iTempSkinBmp;
+        delete iTempMaskBmp;
+        delete iSkinControlContext;
+        }
+    
+    void MonitorWsMessage(const TWsEvent& aEvent)
+        {
+        if (aEvent.Type() == EEventWindowGroupListChanged)
+            {
+            UpdateWgListL();
+            }
+       else if (aEvent.Type() == KEikDynamicLayoutVariantSwitch ||
+                aEvent.Type() == KEikInputLanguageChange)
+           {
+           if (iLayoutMirrored != AknLayoutUtils::LayoutMirrored())
+               {
+               iLayoutMirrored  = AknLayoutUtils::LayoutMirrored();
+               if (iLayoutMirroredMessage.IsNull())
+                    { 
+                    iLayoutMirroredUpdated = ETrue;
+                    }
+               else
+                    {
+                    iLayoutMirroredMessage.Complete(iLayoutMirrored);
+                    iLayoutMirroredUpdated = EFalse;
+                    }      
+                } 
+            }
+        }        
+    
+    CAlfAppFwNotifier(
+        TUid aNotifierUid, 
+        TUid aChannel, 
+        TInt aPriority )
+        : iWsSession(CCoeEnv::Static()->WsSession())
+        {
+        iInfo.iUid = aNotifierUid;
+        iInfo.iChannel= aChannel;
+        iInfo.iPriority = aPriority;
+        *iWgIdArray = -1; // indicates array uninitialized
+        iLayoutMirrored  = AknLayoutUtils::LayoutMirrored();
+        iLayoutMirroredUpdated = ETrue;    
+        CCoeEnv::Static()->AddMessageMonitorObserverL(*this);
+        CCoeEnv::Static()->RootWin().EnableScreenChangeEvents();
+        }        
+   
+public:
+    // from MEikSrvNotifierBase2
+    TPtrC8 UpdateL(const TDesC8&)
+        {
+        return KNullDesC8();
+        }
+   
+   void Cancel()
+        {
+        }
+        
+    void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage)
+        {
+        TInt err = KErrNone;
+        TAlfCommandParams* params =  (TAlfCommandParams*) aBuffer.Ptr();
+        switch (params->iCommand)
+            {
+            case EAlfIsMirrorred:
+                {
+                if (iLayoutMirroredUpdated)
+                    {
+                    aMessage.Complete(iLayoutMirrored);
+                    iLayoutMirroredUpdated = EFalse;
+                    }    
+                else
+                    {            
+                    iLayoutMirroredMessage = aMessage;
+                    }
+                return;    
+                }            
+            case EAlfCbaLocation:
+                {
+                err = AknLayoutUtils::CbaLocation();
+                break;
+                }            
+            case EAlfLayoutMetricsRect:
+                {
+                TRect rect(0,0,0,0);
+                AknLayoutUtils::LayoutMetricsRect((AknLayoutUtils::TAknLayoutMetrics)params->iInt1, rect);
+                TPckgC<TRect> response(rect);
+                err = aMessage.Write(aReplySlot, response);
+                break;
+                }            
+            case EAlfGetCachedColor:
+                {
+                TAknsItemID id;
+                id.iMajor = params->iInt1;
+                id.iMinor = params->iInt2;
+                MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+                TRgb color = KRgbBlack;
+                err = AknsUtils::GetCachedColor(skin, color, id, params->iInt3 );
+                if (!err)
+                    {
+                    TPckgC<TRgb> ret(color);
+                    err = aMessage.Write(aReplySlot, ret);
+                    }
+                break;
+                }
+            case EAlfConvertVisualAndClip:
+                {
+                TUint desLength = aMessage.GetDesMaxLength(aReplySlot);
+                HBufC* replyDes = HBufC::NewLC(desLength/2+1);
+                TPtr ptr = replyDes->Des();                
+                aMessage.Read(aReplySlot, ptr);
+                // ToDo: Wo to get font from client..
+                //CFont font = Use Font spec to get the font??
+                //AknBidiTextUtils::ConvertToVisualAndClipL(ptr, font, params->iInt2, params->iInt3);
+                err = aMessage.Write(aReplySlot, ptr);
+                CleanupStack::PopAndDestroy();
+                break;
+                }
+            case EAlfGetSkinBackgroundBitmap:
+                {
+                TRect dummy;
+                TRect skinRect;
+                TAknsItemID id;
+                
+                id.iMajor = params->iInt1;
+                id.iMinor = params->iInt2;
+                
+                GetRectForItem(id, dummy, skinRect);
+
+                if (!iBitmap)
+                    {
+                    iBitmap = new (ELeave) CFbsBitmap();
+                    User::LeaveIfError( iBitmap->Create(skinRect.Size(), EColor64K) ); // is 64k still valid?        
+                    }
+                
+                User::LeaveIfError(iBitmap->Resize(skinRect.Size()));
+                
+                if (!iSkinControlContext)
+                    {
+                    iSkinControlContext = CAknsBasicBackgroundControlContext::NewL(
+                    KAknsIIDQsnBgScreen, TRect(TPoint(0, 0), CCoeEnv::Static()->ScreenDevice()->SizeInPixels()), ETrue);
+                    }
+                
+                CFbsBitmapDevice* device = CFbsBitmapDevice::NewL(iBitmap);
+                CleanupStack::PushL(device);
+
+                CFbsBitGc* gc = 0;
+                User::LeaveIfError( device->CreateContext(gc) );
+                CleanupStack::PushL(gc);
+                iSkinControlContext->SetRect(skinRect);
+                iSkinControlContext->SetBitmap(id);
+
+                AknsDrawUtils::DrawBackground(AknsUtils::SkinInstance(), iSkinControlContext, NULL, *gc, TPoint(0,0), skinRect,
+                                  KAknsDrawParamDefault);
+
+                CleanupStack::PopAndDestroy(gc);
+                CleanupStack::PopAndDestroy(device);
+                TPckg<TInt> ret(iBitmap->Handle());
+                err = aMessage.Write(aReplySlot, ret);
+                break;
+                }
+            case EAlfGetSkinBitmap:
+                {
+                // local override input params
+                TAlfCommandParams2* params =  (TAlfCommandParams2*) aBuffer.Ptr();                
+                TAknsItemID id;
+                
+                id.iMajor = params->iInt1;
+                id.iMinor = params->iInt2;
+                
+                // recycle ownership through these, assuming synchronized client implementation !!
+                delete iTempSkinBmp;
+                iTempSkinBmp = 0;
+                delete iTempMaskBmp;
+                iTempMaskBmp = 0;
+                
+                TRAP(err, AknsUtils::CreateIconL(	AknsUtils::SkinInstance(), id,
+					                    iTempSkinBmp, iTempMaskBmp, 
+					                    params->iFileName, params->iInt3,params->iInt4));
+
+                if (err == KErrNotFound) // lets retry without mask
+                    { 
+                    delete iTempSkinBmp;
+                    iTempSkinBmp = 0;
+                    delete iTempMaskBmp;
+                    iTempMaskBmp = 0;
+                    // try if we have better luck without mask
+                    AknsUtils::CreateIconL(	AknsUtils::SkinInstance(), id,
+					                    iTempSkinBmp, params->iFileName, params->iInt3);
+
+                    }
+                
+                if (iTempSkinBmp)
+                    {
+                    AknIconUtils::DisableCompression(iTempSkinBmp);
+                    AknIconUtils::SetSize( iTempSkinBmp, params->iSize, params->iScaleMode );    
+                    }
+                
+                if (iTempMaskBmp)
+                    {
+                    AknIconUtils::DisableCompression(iTempSkinBmp);
+                    AknIconUtils::SetSize( iTempMaskBmp, params->iSize, params->iScaleMode );    
+                    }
+                        
+                TInt2 ret;
+                ret.iInt1 = iTempSkinBmp->Handle();
+                ret.iInt2 = iTempMaskBmp?iTempMaskBmp->Handle():0;
+                TPckg<TInt2> retp = ret;
+                err = aMessage.Write(aReplySlot, retp);
+                break;
+                }
+            case EGetCachedSkinItemData:
+                {
+                TAknsItemID id;
+                
+                id.iMajor = params->iInt1;
+                id.iMinor = params->iInt2;
+                
+                TAlfCachedSkinItemArray array;
+                array.iCount = 0;
+                CAknsItemData* data = AknsUtils::SkinInstance()->CreateUncachedItemDataL( id, (TAknsItemType)params->iInt3 );
+                
+                if (data)
+                    {
+                    CAknsImageTableItemData* itdata = static_cast<CAknsImageTableItemData*>(data);    
+                    array.iCount = Min(9, itdata->NumberOfImages());   
+                    for(TInt i = 0; i<array.iCount;i++)
+                        {
+                        array.iImages[i] = itdata->ImageIID(i);
+                        } 
+                    delete data;        
+                    }
+                TPckgC<TAlfCachedSkinItemArray> retp(array);
+                err = aMessage.Write(aReplySlot, retp);
+                break;
+                }
+            
+            case EGetListOfWindowGroups:
+                {
+                if (*iWgIdArray == -1) // uninitialized  
+                    {
+                    CCoeEnv::Static()->RootWin().EnableGroupListChangeEvents();
+                    UpdateWgListL();
+                    }
+                
+                if (*iWgIdArray != 0)
+                    { // updated array exists, return it
+                    CompleteWgListMessage(aMessage, aReplySlot);
+                    }
+                else
+                    { // let messages wait for updates
+                    iWgMessage = aMessage;
+                    iWgReplySlot = aReplySlot;            
+                    }
+                
+                return; // message completed asynchronously
+                }    
+                
+
+            default:
+                {
+                err = KErrNotSupported;
+                break;
+                }
+            }
+        aMessage.Complete(err);
+        }
+            
+    TPtrC8 StartL(const TDesC8&)
+        { 
+        return KNullDesC8();
+        }
+        
+   MEikSrvNotifierBase2::TNotifierInfo Info() const        
+        {
+        return iInfo;
+        }
+        
+   MEikSrvNotifierBase2::TNotifierInfo RegisterL()
+        {
+        return iInfo;
+        }
+
+   void Release()
+        {
+        delete this;
+        }    
+
+    void UpdateWgListL()
+        {
+        TInt wgId=0;
+        const TInt count=iWsSession.NumWindowGroups();
+        if (count)
+            {
+            TInt* ptr = iWgIdArray;    
+            Mem::FillZ(iWgIdArray,160);
+            CArrayFixFlat<TInt>* wgIdArray=new(ELeave) CArrayFixFlat<TInt>(count);
+            CleanupStack::PushL(wgIdArray);
+            CApaWindowGroupName* wgName=CApaWindowGroupName::NewL(iWsSession);
+            CleanupStack::PushL(wgName);
+            User::LeaveIfError(iWsSession.WindowGroupList(wgIdArray)); // all groups
+            iWgEntriesWritten = 0;
+            for (TInt ii=0; ii < count-1; ii++)
+                { 
+                wgId=(*wgIdArray)[ii];
+                wgName->ConstructFromWgIdL(wgId);
+                if(!wgName->Hidden() && wgName->AppUid().iUid) // lets skip the hidden groups  and groups w/o AppUid at the time being
+                    {
+                    *ptr = wgId;
+                    ptr++;
+                    *ptr = wgName->AppUid().iUid;
+                    ptr++;                           
+                    iWgEntriesWritten++;
+                    }
+                if (iWgEntriesWritten == 20) // magic, interim patch until we have better way to pair wg ids & clien app uids
+                    {
+                    break;
+                    }    
+                }
+            CleanupStack::PopAndDestroy(2); // wgIdArray, wgName
+            if (iWgIdArray[0] && !iWgMessage.IsNull())
+                {
+                CompleteWgListMessage(iWgMessage, iWgReplySlot);
+                }
+            }
+        }
+    
+    void CompleteWgListMessage(const RMessagePtr2& aMessage, TInt aReplySlot)
+        {
+        if (Mem::Compare((TUint8*)iWgIdArray, 8*iWgEntriesWritten, (TUint8*)iWgIdArray2,8*iWgEntriesWritten))
+            {
+            TPtrC8 ret((TUint8*)iWgIdArray, 160);   
+            if (!aMessage.IsNull())
+                {
+                TInt err = aMessage.Write(aReplySlot, ret);
+                aMessage.Complete(err);
+                }
+            Mem::Copy((TUint8*)iWgIdArray2, (TUint8*)iWgIdArray,160);
+            }
+        Mem::FillZ(iWgIdArray, 160);
+        }
+        
+private:
+    MEikSrvNotifierBase2::TNotifierInfo iInfo;
+    CFbsBitmap* iBitmap;
+    CFbsBitmap* iTempSkinBmp;
+    CFbsBitmap* iTempMaskBmp;
+    CAknsBasicBackgroundControlContext* iSkinControlContext;
+    TInt iWgIdArray[40]; // magic, cool
+    TInt iWgIdArray2[40]; // magic, cool
+    RMessagePtr2 iWgMessage;
+    TInt iWgReplySlot;
+    RWsSession& iWsSession;
+    TUint iWgEntriesWritten;
+    RMessagePtr2 iLayoutMirroredMessage;
+    TBool iLayoutMirrored;
+    TBool iLayoutMirroredUpdated;
+    };
+
+CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
+    {
+    CArrayPtrFlat<MEikSrvNotifierBase2>* array = new CArrayPtrFlat<MEikSrvNotifierBase2>(1);
+    if ( array )
+        {
+        CAlfAppFwNotifier* notif = new CAlfAppFwNotifier(TUid::Uid(KAlfAppFwProxyUid),TUid::Uid(KAlfAppFwProxyUid), MEikSrvNotifierBase2::ENotifierPriorityHigh); 
+        if ( notif )
+            {
+            TRAP_IGNORE(array->AppendL(notif));  // we have reserver granularity of one already
+            }
+        }
+    return array;
+    }
+    
+
+const TImplementationProxy ImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY(KAlfAppFwProxyUid,NotifierArray)
+    };
+ 
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy) ;
+    return ImplementationTable;
+    }
+    
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerStub/Proxy_src/alfappfwproxy.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,41 @@
+// 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:
+//
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+#include <bldvariant.hrh>
+
+#include "alfappfwproxy_defs.h"
+ 
+TARGET                  alfappfwproxy.dll
+TARGETTYPE              plugin
+UID                     0x10009D8D KAlfAppFwProxyUid
+
+CAPABILITY      CAP_ECOM_PLUGIN
+VENDORID        VID_DEFAULT 
+
+USERINCLUDE     .  ../../CommonInc ../../coretoolkit/inc
+SOURCEPATH      .
+SOURCE 			AlfAppFwProxy.cpp
+
+MW_LAYER_SYSTEMINCLUDE
+
+
+START RESOURCE  alfappfwproxy.rss
+  TARGET          alfappfwproxy.rsc
+END
+
+LIBRARY         euser.lib avkon.lib eiksrv.lib aknskins.lib hitchcock.lib cone.lib  ws32.lib
+LIBRARY         fbscli.lib bitgdi.lib aknicon.lib apgrfx.lib 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerStub/Proxy_src/alfappfwproxy.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,41 @@
+// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+// All rights reserved.
+// This component and the accompanying materials are made available
+// under the terms of "Eclipse Public License v1.0"
+// which accompanies 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 <ecom/registryinfo.rh>
+#include <uikon.rh>
+#include "alfappfwproxy_defs.h" 
+ 
+RESOURCE REGISTRY_INFO theInfo
+    {
+    dll_uid = KAlfAppFwProxyUid;
+    interfaces =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KUikonUidPluginInterfaceNotifiers;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = KAlfAppFwProxyUid;
+                    version_no = 1;
+                    display_name = "TTNOTIFY2V2 Plugin 1";
+                    default_data = "TTNOTIFY2V2";
+                    opaque_data  = "0";
+                    }
+                };
+            }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerStub/Proxy_src/alfappfwproxy_defs.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,20 @@
+// 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:
+//
+#ifndef __ALFAPPFWPROXY_DEFS_
+#define __ALFAPPFWPROXY_DEFS_
+
+#define KAlfAppFwProxyUid 0x20022ef7
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerStub/src/alfserver.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Application definition.
+*
+*/
+
+#include <alf/alfappui.h>
+#include "alfuids.h"
+
+_LIT(KAlfServerName, "alfredserver");
+
+
+static void RunServerL()
+	{
+    CActiveScheduler* s=new(ELeave) CActiveScheduler;
+    CleanupStack::PushL(s);
+    CActiveScheduler::Install(s);
+
+    CAlfAppUi* appUiStub = new (ELeave) CAlfAppUi();
+    CleanupStack::PushL(appUiStub);
+    appUiStub->ConstructL(); 
+ 
+    RProcess::Rendezvous(KErrNone);
+    
+	CActiveScheduler::Start();
+	
+	CleanupStack::PopAndDestroy(2);	
+	}
+
+
+TInt E32Main()
+	{
+	TInt err = User::RenameThread(KAlfServerName);
+    if ( err != KErrNone )
+        {
+        return err;
+        }
+    
+    // create CCleanup
+    CTrapCleanup * cleanup = CTrapCleanup::New();
+    if (cleanup)
+        {
+        TRAP(err, RunServerL());
+        delete cleanup;
+        }
+
+	return err;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/ServerStub/src/alfserver.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project alfappserver
+*
+*/
+
+
+
+
+#include "../../commoninc/alfuids.h"
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+
+EPOCSTACKSIZE 0x5000
+EPOCHEAPSIZE 0x1000 0x989680
+
+TARGET                  alfserver.exe
+TARGETTYPE              exe
+UID 0x100039CE  0xdabadaba
+VERSION                 10.0
+
+CAPABILITY              SwEvent
+VENDORID                VID_DEFAULT
+
+SOURCEPATH              ../src
+SOURCE                  alfserver.cpp
+
+USERINCLUDE             ../../commoninc
+
+#include <platform_paths.hrh>
+MW_LAYER_SYSTEMINCLUDE
+
+
+SYSTEMINCLUDE           ../../../../inc
+
+
+LIBRARY                 alfappservercore.lib
+LIBRARY                 euser.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/TokenServer/ClientSrc/ftokenclient.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 for granting other processes to token to access
+*                particular files in app directory 
+*
+*/
+
+
+
+#include "alf/ftokenclient.h"
+#include "ftokenconsts.h"
+
+EXPORT_C TInt RFTokenClient::Connect()
+    {
+    TInt err = KErrNone;
+    TFindServer serveFinder(FTOKEN_SERVER_NAME);
+    TFullName fullName;
+    if (serveFinder.Next(fullName) != KErrNone)
+        {
+ 	    const TUidType serverUid(KNullUid,KNullUid,KServerUid3);
+
+	    RProcess server;
+	    err = server.Create(_L("Z:\\sys\\bin\\!ftokenserver.exe"),FTOKEN_SERVER_NAME,serverUid);
+	    if (!err)
+	        {
+        	TRequestStatus stat;
+	        server.Rendezvous(stat);
+	        if (stat!=KRequestPending)
+	            {
+		        server.Kill(0);         // abort startup
+	            }
+	        else
+	            {
+		        server.Resume();        // logon OK - start the server
+	            }
+	        User::WaitForRequest(stat);             // wait for start or death
+	        err = stat.Int();
+	        }
+        }
+
+    if ( !err )
+        {
+        err = CreateSession(FTOKEN_SERVER_NAME,TVersion(1,1,1)); 
+        }
+
+	return err;
+    }
+
+EXPORT_C TInt RFTokenClient::GenerateToken(const TDesC& aFileName, const TUid& aConsumerUid, TDes8& aToken) const
+    {
+    TSecureId consumerUid(aConsumerUid);
+    return GenerateToken(aFileName, TSecurityPolicy(consumerUid), aToken);
+    }
+    
+EXPORT_C TInt RFTokenClient::GenerateToken(const TDesC& aFileName, const TSecurityPolicy& aSecurityPolicy, TDes8& aToken) const
+    {
+    // unefficient, but this way we can make _easily_ sure that client is actually allowed to open a file
+    // Not sure if we were allowed to just change CEikonEnv's file server session to shared, so we could acutally save
+    // this extra session..
+    RFs fs;
+    TInt err = fs.Connect();
+    if (!err) 
+        {
+        err = fs.ShareProtected();
+        if (!err) 
+            {
+            RFile file;
+            err = file.Open(fs, aFileName, EFileShareReadersOnly); // Todo: check the correct mode
+            if (!err)
+                {
+                err = GenerateToken(file, aSecurityPolicy, aToken);
+                }
+            file.Close();
+            }
+        fs.Close();
+        }
+    
+    return err;
+    //return SendReceive(EGenerateTokenBasedOnName, TIpcArgs(&aFileName, aAllowedProcessUid.iUid, &aToken));
+    }
+    
+EXPORT_C TInt RFTokenClient::GenerateToken(const RFile& aOpenFile, const TUid& aConsumerUid,TDes8& aToken) const
+    {
+    TSecureId consumerUid(aConsumerUid);
+    return GenerateToken(aOpenFile, TSecurityPolicy(consumerUid), aToken);
+    }
+
+EXPORT_C TInt RFTokenClient::GenerateToken(const RFile& aOpenFile, const TSecurityPolicy& aSecurityPolicy,TDes8& aToken) const
+    {
+    TPtrC8 ptr = aSecurityPolicy.Package();
+    TIpcArgs ipcArgs(&ptr, &aToken, 0, 0);
+    TInt ret = aOpenFile.TransferToServer(ipcArgs, 2, 3);
+    if (ret == KErrNone)
+        {
+        ret = SendReceive(EGenerateTokenBasedOnOpenHandle, ipcArgs);
+        }
+    return ret;
+    }
+
+EXPORT_C TInt RFTokenClient::GenerateToken(const TDesC8& aExistingToken, const TUid& aConsumerUid,TDes8& aToken) const
+    {
+    TSecureId consumerUid(aConsumerUid);
+    return GenerateToken(aExistingToken, TSecurityPolicy(consumerUid), aToken);
+    }
+
+EXPORT_C TInt RFTokenClient::GenerateToken(const TDesC8& aExistingToken, const TSecurityPolicy& aSecurityPolicy,TDes8& aToken) const
+    {
+    TPtrC8 ptr = aSecurityPolicy.Package();
+    return SendReceive(EGenerateTokenBasedOnAnotherToken, TIpcArgs(&ptr, &aExistingToken, &aToken));
+    }
+
+EXPORT_C TInt RFTokenClient::OpenFileForToken(RFile& aHandle, const TDesC8& aToken) const
+    {
+    TInt serverhandle = 0;
+    TPckg<TInt> buf(serverhandle);
+    TInt rfsHandle = SendReceive(EOpenHandleForToken, TIpcArgs(&buf, &aToken));
+    return aHandle.AdoptFromServer(rfsHandle, serverhandle);
+    }
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/TokenServer/ClientSrc/ftokenclient.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project alfclient
+*
+*/
+
+
+
+#include <data_caging_paths.hrh>
+#include "../Inc/ftokenuids.h"
+#include <bldvariant.hrh>
+
+TARGET                  ftokenclient.dll
+TARGETTYPE              dll
+UID                     0x1000008d KDLLUID
+VERSION                 10.0
+
+CAPABILITY              CAP_CLIENT_DLL
+VENDORID                VID_DEFAULT
+
+SOURCEPATH              ../ClientSrc
+SOURCE                  ftokenclient.cpp
+
+
+USERINCLUDE             ../Inc
+
+#include <platform_paths.hrh>
+MW_LAYER_SYSTEMINCLUDE
+
+
+SYSTEMINCLUDE           ../../../../inc
+
+
+LIBRARY                 euser.lib
+LIBRARY                 efsrv.lib
+
+
+             
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/TokenServer/Inc/ftokeconsts.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* 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: 
+*
+*/
+
+
+#ifndef __FTOKENCONSTS_H__
+#define __FTOKENCONSTS_H__
+
+const TUid KServerUid3 = 
+    {
+    0xdabadaba
+    };
+
+enum 
+    {
+    EGenerateTokenBasedOnName,
+    EGenerateTokenBasedOnOpenHandle,
+    EGenerateTokenBasedOnAnotherToken
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/TokenServer/Inc/ftokenconsts.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   IPC command ids for server and client 
+*
+*/
+
+
+
+#ifndef __FTOKENCONSTS_H__
+#define __FTOKENCONSTS_H__
+
+#include "ftokenuids.h"
+
+enum 
+    {
+    EGenerateTokenBasedOnName,
+    EGenerateTokenBasedOnOpenHandle,
+    EGenerateTokenBasedOnAnotherToken,
+    EOpenHandleForToken
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/TokenServer/Inc/ftokenserver.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Server declaration, internal for Nokia
+*
+*/
+
+
+
+#ifndef __F_TOKEN_SERVER_H__
+#define __F_TOKEN_SERVER_H__
+
+class CFsTokenServerSession;
+
+NONSHARABLE_CLASS(CFsTokenServer): public CServer2
+    {
+public:
+    static void NewLC();
+	~CFsTokenServer();
+	void AddTokenL(const RMessage2& aMessage);
+	void OpenFileL(const RMessage2& aMessage);
+    void HandleClientExit(const CSession2* aClient);
+
+private:
+    void ConstructL();
+    CFsTokenServer():CServer2(CActive::EPriorityStandard){}
+	CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
+
+private:
+    RFs iFs;
+
+    struct TToken
+        {
+        TToken()
+            {
+            Mem::FillZ(this, sizeof(TToken));
+            }
+        TInt64 iToken;
+        TSecurityPolicy iPolicy; 
+        HBufC* iFileName;
+
+       static TBool CompareToken(const TInt64* aTokenKey, const TToken& aToken)
+            {
+            return *aTokenKey == aToken.iToken;
+            }
+         
+        static TBool CompareOwner(const CSession2* aSession, const TToken& aToken)
+            {
+            return aSession == aToken.iOwner;
+            }
+            
+        CSession2* iOwner;
+        TBool iHasSubToken;        
+        };
+        
+    // ToDo: should use sorted array
+    RArray<TToken> iTokens;
+    };
+
+NONSHARABLE_CLASS(CFsTokenServerSession): public CSession2
+    {
+    public:
+    CFsTokenServerSession();
+    ~CFsTokenServerSession();
+    void ServiceL(const RMessage2& aMessage);
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/TokenServer/Inc/ftokenuids.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Uid definitions for server and client 
+*
+*/
+
+
+
+#ifndef __FTOKENSERVERUIDS_H__
+#define __FTOKENSERVERUIDS_H__
+
+#define KDLLUID 0x102830B4
+#define KSERVERUID 0x102830B3
+
+#define KServerUid3 TUid::Uid(KSERVERUID)
+
+#define FTOKEN_SERVER_NAME _L("!ftokenserver")
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/TokenServer/SrvSrc/ftokenserver.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,288 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Server implementation fo share files in application private gage 
+*                with controlled way
+*
+*/
+
+
+
+#include <e32std.h>
+#include <f32file.h>
+#include <e32math.h>
+#include "ftokenserver.h"
+#include "ftokenconsts.h"
+
+void CFsTokenServer::NewLC()
+    {
+    CFsTokenServer* pS = new (ELeave) CFsTokenServer;
+    CleanupStack::PushL(pS);
+    pS->ConstructL();
+    }
+
+void CFsTokenServer::ConstructL()
+    {
+    User::LeaveIfError( iFs.Connect() );
+    User::LeaveIfError( iFs.ShareProtected() );
+    StartL(FTOKEN_SERVER_NAME);
+    }
+
+CSession2* CFsTokenServer::NewSessionL(const TVersion& /*aVersion*/,const RMessage2& /*aMessage*/) const
+    {
+	return new(ELeave) CFsTokenServerSession();   
+    }
+
+void CFsTokenServer::HandleClientExit(const CSession2* aClient)
+    { // Todo: We could invent somekind notify here to notify 
+      // possible user of a file to release its handle as well..
+    for(TInt index = iTokens.Find(*aClient, TToken::CompareOwner); 
+        index != KErrNotFound; 
+        index = iTokens.Find(*aClient, TToken::CompareOwner) )
+        {
+        if (iTokens[index].iHasSubToken == 0)
+            {
+            delete iTokens[index].iFileName;
+            }
+        iTokens.Remove(index);
+        }
+    }
+
+CFsTokenServer::~CFsTokenServer()
+    {
+    for(TInt count = iTokens.Count(); count > 0; count-- )
+        {
+        if (iTokens[0].iHasSubToken == 0)
+            {
+            delete iTokens[0].iFileName;
+            }
+        iTokens.Remove(0);
+        }
+        
+    iFs.Close();
+	iTokens.Close();
+    }
+	    
+void CFsTokenServer::AddTokenL(const RMessage2& aMessage)
+    {
+	HBufC* fileName = 0;
+    TKeyArrayFix tokenKey(_FOFF(TToken, iToken), ECmpTInt64);	  	    
+	
+	TInt function = aMessage.Function();
+	switch(aMessage.Function())
+        {
+        case EGenerateTokenBasedOnName:
+        //==================================================
+        // 1) filename
+        //===================================================
+           {
+           User::Leave(KErrNotSupported);
+/*                TInt msgLenght = aMessage.GetDesLength(1);
+                if (length > 0)
+                    {
+                    fileName = HBufC::NewLC(length);
+                    TPtr ptr = fileName->Des();
+                    aMessage.Read(1,ptr);
+                    if (iFs.IsValidName(ptr))
+                        {
+
+                        }
+                    else
+                        {
+                        User::Leave(KErrArgument);
+                        }
+                    }
+                else 
+                    {
+                    User::Leave(KErrArgument);
+                    }    
+*/	    
+            break;
+            }
+        case EGenerateTokenBasedOnOpenHandle:
+        //===================================================
+        // 2) handle
+        //===================================================
+            {
+            // 2.1) check that we are able to open the file	
+            RFile file;
+            User::LeaveIfError(file.AdoptFromClient(aMessage,2,3));
+            // 2.2) resolve full filename
+            TFileName fn;
+            file.FullName(fn);
+            file.Close();
+               
+            fileName = fn.AllocLC();
+            break;
+            }
+        case EGenerateTokenBasedOnAnotherToken:
+        // ==================================================        
+        // 3) token
+        //===================================================
+            {
+            TInt64 token = 0;
+            TPckg<TInt64> buf(token); 
+    
+            // 3.1) just check that client uid and token match     
+            aMessage.ReadL(1,buf);
+            TInt index = iTokens.Find(token, TToken::CompareToken);
+            User::LeaveIfError( index );
+    
+	        if (iTokens[index].iPolicy.CheckPolicy(aMessage))
+	            {
+	            // set a pointer to existing buffer, when deleting
+	            // this must be handled slightly different way
+                // but theres no need to spend lots of mem 
+                // for duplicate filenames
+                fileName = iTokens[index].iFileName;
+                
+                // there shouldn't be more than one subtoken per token ever 
+                ASSERT(iTokens[index].iHasSubToken==EFalse);
+                iTokens[index].iHasSubToken = ETrue;
+                }
+            else 
+                {
+                User::Leave(KErrPermissionDenied);
+                }    
+ 
+            break;
+            }
+        default:
+            break;
+        }
+    // add token to array
+    TInt64 newToken = User::NTickCount();
+
+    for(newToken = Math::FRand(newToken);
+        iTokens.Find(newToken, TToken::CompareToken) != KErrNotFound;
+        newToken = User::NTickCount())
+        {
+        newToken = Math::FRand(newToken);
+        }
+    
+    TToken entry;
+    entry.iToken = newToken; 
+    entry.iFileName = fileName;
+    entry.iOwner = aMessage.Session();
+
+    TPckg<TSecurityPolicy> policyBuf(entry.iPolicy);
+    aMessage.ReadL(0, policyBuf);
+
+    User::LeaveIfError(iTokens.Append(entry));
+    if (function == EGenerateTokenBasedOnOpenHandle)
+        {
+        CleanupStack::Pop(); // filename
+        }
+    }
+	
+void CFsTokenServer::OpenFileL(const RMessage2& aMessage)
+    {
+	// find token based on client uid and given token 
+    TInt64 token = 0;
+    TPckg<TInt64> buf(token); 
+    aMessage.ReadL(1,buf);
+    
+    TInt index = iTokens.Find(token, TToken::CompareToken);
+	User::LeaveIfError(index);
+	
+	if (iTokens[index].iPolicy.CheckPolicy(aMessage))        
+	    { // authorized client requests file 
+        RFile file;
+	    // Todo: what should the mode be ??
+	    User::LeaveIfError(file.Open(iFs, *(iTokens[index].iFileName), EFileShareReadersOnly)); 
+        CleanupClosePushL(file);
+        User::LeaveIfError(file.TransferToClient(aMessage, 0));
+        CleanupStack::PopAndDestroy(); //file
+        }
+    else 
+        {
+        User::Leave(KErrPermissionDenied);    
+        } 
+    }
+
+
+CFsTokenServerSession::CFsTokenServerSession()
+    {
+    }
+
+CFsTokenServerSession::~CFsTokenServerSession()
+    {
+    ((CFsTokenServer*)(Server()))->HandleClientExit(this);
+    }
+
+void CFsTokenServerSession::ServiceL(const RMessage2& aMessage)
+    {
+    CFsTokenServer* server = (CFsTokenServer*)( Server() );
+    switch(aMessage.Function())
+        {
+        case EGenerateTokenBasedOnName:
+        case EGenerateTokenBasedOnOpenHandle:
+        case EGenerateTokenBasedOnAnotherToken:
+            {
+            server->AddTokenL(aMessage);
+            break;
+            }
+        case EOpenHandleForToken:
+            {
+            server->OpenFileL(aMessage);
+            // Todo: We could set somekind penalty to client that continuously
+            // passes wrong tokens (i.e. seems to be guessing), e.g. panic it...
+            break;
+            }
+
+        default:
+            aMessage.Complete(KErrNotSupported);
+            break;
+        }
+    if (!aMessage.IsNull())
+        {
+        aMessage.Complete(KErrNone);
+        }
+    }
+
+static void RunServerL()
+	{
+    // Create Scheduler, obsolete nowdays ?
+    CActiveScheduler* s=new(ELeave) CActiveScheduler;
+    CleanupStack::PushL(s);
+    CActiveScheduler::Install(s);
+
+    CFsTokenServer::NewLC(); 
+ 
+    RProcess::Rendezvous(KErrNone);
+    
+	CActiveScheduler::Start();
+	
+	CleanupStack::PopAndDestroy(2);	
+	}
+
+
+TInt E32Main()
+	{
+	TInt err = User::RenameThread(FTOKEN_SERVER_NAME);
+    if ( err != KErrNone )
+        {
+        return err;
+        }
+    
+    // create CCleanup
+    CTrapCleanup * cleanup = CTrapCleanup::New();
+    if (cleanup)
+        {
+        TRAP(err, RunServerL());
+        delete cleanup;
+        }
+
+	return err;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/TokenServer/SrvSrc/ftokenserver.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project alfappserver
+*
+*/
+
+
+
+
+#include <data_caging_paths.hrh>
+#include "../Inc/ftokenuids.h"
+#include <bldvariant.hrh>
+
+TARGET                  !ftokenserver.exe
+TARGETTYPE              exe
+UID                     0x100039CE KSERVERUID
+VERSION                 10.0
+
+CAPABILITY              ProtServ AllFiles
+VENDORID                VID_DEFAULT
+
+SOURCEPATH              ../SrvSrc
+SOURCE                  ftokenserver.cpp
+
+USERINCLUDE             ../Inc
+
+#include <platform_paths.hrh>
+MW_LAYER_SYSTEMINCLUDE
+
+
+SYSTEMINCLUDE           ../../../../inc
+
+
+LIBRARY                 euser.lib
+LIBRARY                 efsrv.lib
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/TokenServer/bwins/ftokenclientu.def	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,10 @@
+EXPORTS
+	?Connect@RFTokenClient@@QAEHXZ @ 1 NONAME ; int RFTokenClient::Connect(void)
+	?GenerateToken@RFTokenClient@@QBEHABVRFile@@ABVTSecurityPolicy@@AAVTDes8@@@Z @ 2 NONAME ; int RFTokenClient::GenerateToken(class RFile const &, class TSecurityPolicy const &, class TDes8 &) const
+	?GenerateToken@RFTokenClient@@QBEHABVRFile@@ABVTUid@@AAVTDes8@@@Z @ 3 NONAME ; int RFTokenClient::GenerateToken(class RFile const &, class TUid const &, class TDes8 &) const
+	?GenerateToken@RFTokenClient@@QBEHABVTDesC16@@ABVTSecurityPolicy@@AAVTDes8@@@Z @ 4 NONAME ; int RFTokenClient::GenerateToken(class TDesC16 const &, class TSecurityPolicy const &, class TDes8 &) const
+	?GenerateToken@RFTokenClient@@QBEHABVTDesC16@@ABVTUid@@AAVTDes8@@@Z @ 5 NONAME ; int RFTokenClient::GenerateToken(class TDesC16 const &, class TUid const &, class TDes8 &) const
+	?GenerateToken@RFTokenClient@@QBEHABVTDesC8@@ABVTSecurityPolicy@@AAVTDes8@@@Z @ 6 NONAME ; int RFTokenClient::GenerateToken(class TDesC8 const &, class TSecurityPolicy const &, class TDes8 &) const
+	?GenerateToken@RFTokenClient@@QBEHABVTDesC8@@ABVTUid@@AAVTDes8@@@Z @ 7 NONAME ; int RFTokenClient::GenerateToken(class TDesC8 const &, class TUid const &, class TDes8 &) const
+	?OpenFileForToken@RFTokenClient@@QBEHAAVRFile@@ABVTDesC8@@@Z @ 8 NONAME ; int RFTokenClient::OpenFileForToken(class RFile &, class TDesC8 const &) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/TokenServer/eabi/ftokenclientu.def	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,10 @@
+EXPORTS
+	_ZN13RFTokenClient7ConnectEv @ 1 NONAME
+	_ZNK13RFTokenClient13GenerateTokenERK5RFileRK15TSecurityPolicyR5TDes8 @ 2 NONAME
+	_ZNK13RFTokenClient13GenerateTokenERK5RFileRK4TUidR5TDes8 @ 3 NONAME
+	_ZNK13RFTokenClient13GenerateTokenERK6TDesC8RK15TSecurityPolicyR5TDes8 @ 4 NONAME
+	_ZNK13RFTokenClient13GenerateTokenERK6TDesC8RK4TUidR5TDes8 @ 5 NONAME
+	_ZNK13RFTokenClient13GenerateTokenERK7TDesC16RK15TSecurityPolicyR5TDes8 @ 6 NONAME
+	_ZNK13RFTokenClient13GenerateTokenERK7TDesC16RK4TUidR5TDes8 @ 7 NONAME
+	_ZNK13RFTokenClient16OpenFileForTokenER5RFileRK6TDesC8 @ 8 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/group/bganimhost.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,68 @@
+/*
+* 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: 
+*
+*/
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+CAPABILITY              CAP_APPLICATION
+
+TARGETPATH              /sys/bin
+TARGET                  backgroundanimhost.exe
+TARGETTYPE              exe
+EPOCPROCESSPRIORITY     realtimeserver
+
+ALWAYS_BUILD_AS_ARM
+OPTION ARMCC            -O3 -Otime --cpu 6 --fpmode fast
+ARMFPU VFPV2
+
+UID                     0x100039CE 0x200286D3
+VENDORID		VID_DEFAULT
+
+LANG                    SC
+
+#include <platform_paths.hrh>
+MW_LAYER_SYSTEMINCLUDE
+OS_LAYER_LIBC_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE
+
+//SYSTEMINCLUDE           /epoc32/include
+//SYSTEMINCLUDE           /epoc32/include/stdapis
+
+
+USERINCLUDE             .
+USERINCLUDE             ../inc
+
+SOURCEPATH              ../src
+
+SOURCE                  main.cpp
+SOURCE                  bganimhost.cpp
+SOURCE                  highrestimer.cpp 
+SOURCE                  themerepositorylistener.cpp
+SOURCE                  screensaverpropertylistener.cpp
+SOURCE                  sensor.cpp
+
+STATICLIBRARY           libcrt0.lib
+LIBRARY                 libc.lib
+LIBRARY                 euser.lib
+LIBRARY                 ws32.lib
+LIBRARY                 apgrfx.lib 
+LIBRARY                 libegl.lib
+LIBRARY                 alfdecoderserverclient.lib
+LIBRARY                 centralrepository.lib
+LIBRARY                 aknskinsrv.lib
+LIBRARY                 aknskins.lib
+LIBRARY                 sensrvclient.lib
+LIBRARY                 sensrvutil.lib
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,25 @@
+/*
+* 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: 
+*
+*/
+
+PRJ_EXPORTS
+../refplugin/data/reffragmentshader.fsh /epoc32/data/z/private/200286D3/reffragmentshader.fsh
+../refplugin/data/refvertexshader.vsh /epoc32/data/z/private/200286D3/refvertexshader.vsh
+
+PRJ_MMPFILES
+
+bganimhost.mmp
+../refplugin/group/refplugin.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/inc/bganimhost.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,104 @@
+/*
+* 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: 
+*
+*/
+#include <e32base.h>
+#include <w32std.h>
+#include <apgwgnam.h> 
+#include <sensrvdatalistener.h>
+
+
+#include <EGL/egl.h>
+
+#include "highrestimer.h"
+#include "plugininterface.h"
+#include "themerepositorylistener.h"
+#include "screensaverpropertylistener.h"
+#include "sensor.h"
+
+#include "../../../../uiaccelerator_plat/alf_visual_api/inc/alf/alfcompositionutility.h"
+
+class CBgAnimHost : public CBase, public MAlfCompositionObserver, public MSensrvDataListener
+    {
+    public:
+        void ConstructL();
+        CBgAnimHost();
+        ~CBgAnimHost();
+        void ExecuteL();
+        
+        static TInt TimerFunc(TAny* aPtr);
+        
+        // from MAlfCompositionObserver
+        void FrameReady(TInt aScreenNumber);
+        void RunningLowOnGraphicsMemory();
+        void GraphicsMemoryGood(); 
+        void CompositionTargetHidden();
+        void CompositionTargetVisible();
+        
+        // from MSensrvDataListener
+        void DataReceived( CSensrvChannel& aChannel, TInt aCount, TInt aDataLost );
+        void DataError( CSensrvChannel& aChannel, TSensrvErrorSeverity aError );
+        void GetDataListenerInterfaceL( TUid aInterfaceUid, TAny*& aInterface);
+        
+        
+    protected:
+        void CreateWindowL();
+        void DestroyWindow();
+        void InitEGLL();
+        void ReleaseEGL();
+        void CreateWindowSurfaceL();
+        void ReleaseWindowSurface(TBool aReleaseObserver = ETrue);
+        void LoadPluginL();
+        void NewFrame();
+        void HandleScreenSaverEvent();
+        static TInt ScreenSaverCallback(TAny* aPtr);
+    private:
+        // windowing stuff
+        RWsSession iWsSession;
+        RWindowGroup iWindowGroup;
+        RWindow iWindow;
+        CApaWindowGroupName* iWindGroupName;
+        CWsScreenDevice* iScreenDevice;
+        TSize iDisplaySize;
+        TSize iRealDisplaySize;
+        
+        // EGL stuff
+        EGLDisplay iEGLDisplay;
+        EGLConfig  iEGLConfig;
+        EGLContext iEGLContext;
+        EGLSurface iEGLSurface;
+        
+        // plugin
+        RLibrary iPluginLibrary;
+        plugin_export_v1_t* iPlugin;
+
+        // timer
+        CHighResTimer* iTimer;
+        TBool iTimerRunning;
+        
+        TBool iEGLInitialized;
+        TBool iSurfaceInitialized;
+        
+        // composition API
+        CAlfCompositionSource* iCompSource;
+        
+        TBool iRunning;
+    
+        CThemeRepositoryListener* iThemeRepositoryListener;
+        CScreenSaverPropertyListener* iSCPropertyListener;
+
+        RPointerArray<CSensorListener> iSensorListeners;
+
+    };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/inc/highrestimer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef __HIGHRESTIMER_H__
+#define __HIGHRESTIMER_H__
+
+#include <e32base.h>
+
+class CHighResTimer : public CTimer
+	{
+public:
+	static CHighResTimer* NewL(TCallBack aCallBack, TInt aPriority);
+	~CHighResTimer();
+	void CallBack(const TInt aWaitInMilliSecs);
+	
+private:
+	CHighResTimer(TCallBack aCallBack, TInt aPriority);
+	void RunL();
+	
+	TCallBack iCallBack;
+	};
+
+
+
+#endif
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/inc/plugininterface.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,79 @@
+/*
+* 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: 
+*
+*/
+#ifndef __PLUGININTERFACE_H__
+#define __PLUGININTERFACE_H__
+
+#include <EGL/egl.h>
+
+
+typedef struct
+    {
+    // the returned egl config that the plugin would preferably use
+    // the config actually chosen may differ from what the plugin prefers.
+    // The API selection is done according to the value specified by EGL_RENDERABLE_TYPE field in the given config.
+    // If given config does not specify EGL_RENDERABLE_TYPE, opengl 2 is assumed by default
+    const EGLint* (*getpreferredconfig)(void);
+
+    // sets the display dimensions for the plugin, can be called at any point of time.
+    // guaranteed to be once called rigth after initialize
+    void (*setdisplaydimensions)(int, int);
+
+    // produces the next frame, eglSwapbuffers will be called immediately after this function by the host.
+    void (*produceframe)(void);
+
+    // informs the plugin when it can have gpu resources allocated or not. the plugin is not allowed to make any gpu allocations
+    // before this function has been called. also it should release all gpu resources when the parameter is false.
+    // return 0 if resource (re)allocation was succesfull. The surface/context can be assumed to be created when this function is called with true
+    // if this function is called with false, the surface/context will be destroyed immediately after this call by the host
+    int (*gpuresourcesavailable)(int);
+
+    // initializes the plugin, allocated all non gpu related resources
+    // should return 0 if initialization was successfull. the full path to the directory where the external data for this plugin resides
+    // can assume that EGL is initialized(but the context/surface is not)
+    // the second parameter is the maximum amount of graphics memory the plugin is allowed to use (excluding surface)
+    int (*initialize)(const char*, unsigned int);
+   
+
+    // destroys the plugin instance, plugin should free all resources it has reserved
+    void (*destroy)(void);  
+
+    // reports the desired sensor id:s to the host, the host will listen to the specified sensors and sensor data via
+    // receivesensordata function. The return value is an array of unsigned ints (sensor id:s). The list must be terminated with a value 0
+    // If plugin does not want to use sensors, the function pointer must to be initialized to NULL
+    const unsigned int* (*desiredsensors)(void);
+    
+    // Function for receiving the sensor data. The funtion is essentially the same as MSensrvDataListener::DataReceived( CSensrvChannel& aChannel, TInt aCount, TInt aDataLost ) with different parameter types
+    // the function should cast the first void ptr to CSensrvChannel* in order to figure out what kind of data is sent. The 2 int parameters are aDataCount and aDataLost (same as inSensrvDataListener::DataReceived)
+    // If plugin does not want to use sensors, the function pointer must to be initialized to NULL
+    void (*receivesensordata)(void*, int, int);
+
+    // this function can be used to convey any additional data from/to the plugin.
+    int (*extension)(int, void*);
+    } plugin_export_v1_t;
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+// returns the plugin interface. the return parameter should be cast to <plugin_export_vX_t*> where X should match the version given as a parameter to this function
+IMPORT_C void* getinterface(int version);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/inc/screensaverpropertylistener.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef __SCREENSAVERPROPERTYLISTENER_H__
+#define __SCREENSAVERPROPERTYLISTENER_H__
+
+#include <e32std.h>
+#include <e32base.h>
+#include <e32property.h>
+
+class CScreenSaverPropertyListener : public CActive
+    {
+    public:
+        static CScreenSaverPropertyListener* NewL(TCallBack aCallback);
+        virtual ~CScreenSaverPropertyListener();
+        void RunL();
+        void DoCancel();
+        void IssueRequest();
+        TInt GetScreenSaverStatus();
+    protected:
+        void ConstructL();
+    private:
+        CScreenSaverPropertyListener(TCallBack aCallback);
+    
+        RProperty iSCProperty;
+        TCallBack iCallback;
+        TInt iSCStatus;
+    };
+    
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/inc/sensor.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,21 @@
+#ifndef __SENSOR_H__
+#define __SENSOR_H__
+
+#include <sensrvchannelfinder.h> 
+#include <sensrvchannel.h> 
+#include <sensrvdatalistener.h>
+
+NONSHARABLE_CLASS(CSensorListener) : public CBase
+    {
+    public:
+        static CSensorListener* NewL(MSensrvDataListener* aDataListener, TUint32 aSensorType);
+        virtual ~CSensorListener();
+    protected:
+        void ConstructL(TUint32 aSensorType);
+        CSensorListener(MSensrvDataListener* aDataListener);
+    private:
+        MSensrvDataListener* iDataListener;
+        CSensrvChannel* iSensrvChannel;
+    };
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/inc/themerepositorylistener.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,42 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef __THEMEREPOSITORYLISTENER_H__
+#define __THEMEREPOSITORYLISTENER_H__
+
+#include <centralrepository.h>
+
+class CThemeRepositoryListener : public CActive
+    {
+    public:
+        static CThemeRepositoryListener* NewL(TBool* aValueToChange);
+        virtual ~CThemeRepositoryListener();
+        void RunL();
+        void DoCancel();
+        void IssueRequest();
+        void GPuMemLow(TBool aLow);
+    protected:
+        void ConstructL();
+    private:
+        CThemeRepositoryListener(TBool* aValueToChange);
+    
+        CRepository* iThemesRepository;
+        TBool* iValueToChange;
+        TInt iPreviousValue;
+    };
+    
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/install/bganim.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,30 @@
+;
+; 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: 
+;
+
+&EN
+
+#{"bganimhost+refplugin"},(0x200286D3),1,0,0,TYPE=SA
+;
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+"\epoc32\release\armv5\urel\backgroundanimhost.exe"-"!:\sys\bin\backgroundanimhost.exe"
+"\epoc32\release\armv5\urel\bga_reference_plugin.dll"-"!:\sys\bin\bga_reference_plugin.dll"
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/refplugin/bwins/bga_reference_pluginu.def	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	getinterface @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/refplugin/data/reffragmentshader.fsh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,35 @@
+precision mediump float;
+
+uniform vec3 blob1;
+uniform vec3 blob2;
+uniform vec3 blob3;
+
+
+uniform float offset;
+uniform float threshold;
+varying vec2  texCoord;
+
+void main()
+    {
+    vec2  fp = texCoord;//vec2(gl_FragCoord[0], gl_FragCoord[1]);
+
+    vec2  p1 = vec2(blob1[0], blob1[1]);
+    float d1 = distance(fp,p1);
+    float acc = blob1[2]/(d1*d1);
+
+    vec2  p2 = vec2(blob2[0], blob2[1]);
+    float d2 = distance(fp,p2);
+    acc += blob2[2]/(d2*d2);
+
+    vec2  p3 = vec2(blob3[0], blob3[1]);
+    float d3 = distance(fp,p3);
+    acc += blob3[2]/(d3*d3);
+
+    float col = 1.0-((acc/threshold)-offset);
+    if (col < 0.35)
+       {
+       col = 0.35;
+       }
+
+    gl_FragColor = vec4(col*0.6,col*0.72,col*0.77,1.0);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/refplugin/data/refvertexshader.vsh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,9 @@
+varying vec2  texCoord;
+attribute vec4 vPosition;
+uniform float aspect;
+
+void main(void)
+    {
+    gl_Position = vPosition;
+    texCoord = (vec2( gl_Position.x*aspect, - gl_Position.y ) + vec2( 1.0 ) ) / vec2( 2.0 );   
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/refplugin/eabi/bga_reference_pluginu.def	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	getinterface @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/refplugin/group/refplugin.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* 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: 
+*
+*/
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+#ifdef             VSW_IVE3_ENABLED
+TARGET              bga_reference_plugin.dll
+TARGETTYPE          dll
+UID                 0x1000008D 0x200286D4
+                                 
+EPOCALLOWDLLDATA
+
+ALWAYS_BUILD_AS_ARM
+OPTION ARMCC        -O3 -Otime --cpu 6 --fpmode fast
+ARMFPU VFPV2
+
+CAPABILITY          CAP_GENERAL_DLL
+VENDORID	    VID_DEFAULT
+LANG                SC
+
+USERINCLUDE         .
+USERINCLUDE         ../inc
+USERINCLUDE         ../../inc // for plugin interface definition
+#include <platform_paths.hrh>
+MW_LAYER_SYSTEMINCLUDE
+OS_LAYER_LIBC_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE 					/epoc32/include/platform/GLES2
+
+SOURCEPATH          ../src
+SOURCE              plugin.c
+SOURCE              shader.c
+
+LIBRARY             libc.lib
+LIBRARY             libm.lib
+LIBRARY             libglesv2.lib
+#else
+TARGETTYPE          none
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/refplugin/inc/shader.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,23 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef __SHADER_H__
+#define __SHADER_H__
+
+GLuint LoadAndCompileShader(char* shaderpath, char* shadername, GLenum type);
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/refplugin/src/plugin.c	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,204 @@
+/*
+* 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: 
+*
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <GLES2/gl2.h>
+#include <math.h>
+#include <string.h>
+
+#include "plugininterface.h"
+#include "shader.h"
+
+
+static char* plugindir = 0;
+
+static GLuint vertexShader = 0;
+static GLuint fragmentShader = 0;
+static GLuint program = 0;
+
+static GLuint vbo = 0;
+static GLuint ibo = 0;
+
+static GLint blob1;
+static GLint blob2;
+static GLint blob3;
+                  
+static GLint offset;
+static GLint threshold;
+static GLint aspect;
+
+static float time = 0.0f;
+
+static int display_w = 0;
+static int display_h = 0;
+
+static const GLushort indices[6] = 
+    {
+    0,1,2,0,2,3
+    };
+    
+static const GLfloat vertexattribs[] = 
+    {
+    -1.0f,1.0f,0.0f,
+    -1.0f,-1.0f,0.0f,
+    1.0f,-1.0f,0.0f,
+    1.0f,1.0f,0.0f,
+    };
+
+
+const EGLint attrib_list[] =
+        {
+        EGL_BUFFER_SIZE,     32,
+        EGL_DEPTH_SIZE,      16,
+        EGL_STENCIL_SIZE,    0,
+        EGL_SAMPLE_BUFFERS,  0,
+        EGL_SAMPLES,         0,
+        EGL_SURFACE_TYPE,    EGL_WINDOW_BIT,
+        EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
+        EGL_NONE
+        };
+
+const EGLint* getpreferredconfig (void)
+    {
+    return attrib_list;
+    }
+    
+void setdisplaydimensions(int width, int height)
+    {
+    display_w = width;
+    display_h = height;
+    }
+
+void produceframe(void)
+    {
+    glUniform3f(blob1,0.76000f+((sin(time))/2.0f),0.30000f+((cos(time*0.4f))/2.0f),4.34000f);
+    glUniform3f(blob2,0.44000f+((sin(0.4f*time))/2.0f),0.64000f+((cos(time))/2.0f),2.26000f);
+    glUniform3f(blob3,0.30000f+((sin(0.7f*time))/2.0f),0.34000f+((cos(time*0.9f))/2.0f),1.84000f);
+
+    time+=0.02f;
+    glDrawElements(GL_TRIANGLES,6,GL_UNSIGNED_SHORT,0);
+    }
+
+
+int gpuresourcesavailable(int available)
+    {
+    GLint linkStatus = 0;
+    float aspectratio = 0.0f;
+    if (available)
+        {
+
+        vertexShader = LoadAndCompileShader(plugindir, "refvertexshader.vsh",GL_VERTEX_SHADER);
+        fragmentShader = LoadAndCompileShader(plugindir, "reffragmentshader.fsh",GL_FRAGMENT_SHADER);
+        if (!vertexShader || !fragmentShader)
+            {
+            return -1;
+            }
+
+        program = glCreateProgram();
+        glAttachShader(program, vertexShader);
+        glAttachShader(program, fragmentShader);
+        glBindAttribLocation(program, 0, "vPosition");
+
+        glLinkProgram(program);
+        glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
+        if (!linkStatus)
+            {
+            glDeleteProgram(program);           
+
+            return -1;
+            }
+        
+        glClearColor(0,0,0,0);
+        glViewport (0, 0, display_w, display_h);
+
+        
+        glGenBuffers( 1, &vbo);
+        glGenBuffers( 1, &ibo);
+        glBindBuffer(GL_ARRAY_BUFFER, vbo);
+        glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo);
+        
+        glBufferData(GL_ARRAY_BUFFER,3*4*sizeof(GLfloat),vertexattribs,GL_STATIC_DRAW);
+        glBufferData(GL_ELEMENT_ARRAY_BUFFER, 6*sizeof(GLushort),indices,GL_STATIC_DRAW);
+    
+        glVertexAttribPointer(	0, 3, GL_FLOAT, GL_FALSE, 0, 0); 
+        
+        glEnableVertexAttribArray(0);
+      
+        glUseProgram(program);
+        glEnableVertexAttribArray(0);
+        
+        blob1 = glGetUniformLocation(program, "blob1");
+        blob2 = glGetUniformLocation(program, "blob2");
+        blob3 = glGetUniformLocation(program, "blob3");
+        aspect = glGetUniformLocation(program, "aspect");
+    
+        offset = glGetUniformLocation(program, "offset");
+        threshold = glGetUniformLocation(program, "threshold");
+    
+        aspectratio = ((float)display_w)/((float)display_h);
+    
+        glUniform1f(offset,34.78935f);
+        glUniform1f(threshold,2.49860f);
+        glUniform1f(aspect,aspectratio);
+        }
+    else
+        {
+        // TODO: free resources...
+        }
+    return 0;
+    }
+
+int initialize(const char* path, unsigned int maxgpumemusage)
+    {
+    plugindir = strdup(path);
+    return 0;
+    }
+    
+void destroy()
+    {
+    free(plugindir);
+    }     
+
+int extension(int value, void* ptr)
+    {
+    return 0;
+    }
+
+EXPORT_C void* getinterface(int version)
+    {
+    plugin_export_v1_t* interface = NULL;
+    if (version == 1)
+        {
+        interface = (plugin_export_v1_t*)malloc(sizeof(plugin_export_v1_t));
+        if (interface)
+            {
+            memset(interface, 0, sizeof(plugin_export_v1_t));
+            
+            // bind our functions to the interface
+            interface->getpreferredconfig = getpreferredconfig;
+            interface->setdisplaydimensions = setdisplaydimensions;
+            interface->produceframe = produceframe;
+            interface->gpuresourcesavailable = gpuresourcesavailable;
+            interface->initialize = initialize;
+            interface->destroy = destroy;
+            interface->desiredsensors = 0;
+            interface->receivesensordata = 0;
+            interface->extension = extension;
+            }
+        }
+    return interface;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/refplugin/src/shader.c	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,78 @@
+/*
+* 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: 
+*
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <GLES2/gl2.h>
+#include <sys/syslimits.h>
+
+#include "shader.h"
+
+
+GLuint LoadAndCompileShader(char* path, char* shadername, GLenum type)
+    {
+    char filename[PATH_MAX];
+    int len = 0;
+    GLuint shader = 0;
+    GLint compiled = 0;
+    char* shaderdata = NULL;
+    FILE* file;
+    
+    strcpy(filename,path);
+    strcat(filename,"\\");
+    strcat(filename,shadername);
+    file = fopen(filename,"rb");
+    if (!file)
+        {
+        return 0;
+        }
+        
+
+    fseek (file, 0, SEEK_END);
+    len = ftell (file);
+    fseek(file, 0, SEEK_SET);
+
+    shaderdata = (char*)malloc(len+1);
+    if (!shaderdata)
+        {
+        fclose(file);
+        return 0;
+        }
+    
+    fread(shaderdata, 1, len, file);
+    fclose(file);
+    shaderdata[len] = 0;
+
+    
+    shader = glCreateShader(type);
+    glShaderSource(shader, 1, (const char**)&shaderdata,NULL);
+    glCompileShader(shader);
+    glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);    
+    
+    if (!compiled)
+        {
+        char infobuf[ 256 ];
+
+        glGetShaderInfoLog( shader, 256, NULL, infobuf );
+
+        glDeleteShader(shader);
+        shader = 0;
+        }
+    free(shaderdata);
+    return shader;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/rom/bganimhost.iby	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,24 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef __BGANIMHOST_IBY__
+#define __BGANIMHOST_IBY__
+
+file=\epoc32\release\armv5\urel\backgroundanimhost.exe sys\bin\backgroundanimhost.exe
+file=\epoc32\release\armv5\urel\bga_reference_plugin.dll sys\bin\bga_reference_plugin.dll
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/src/bganimhost.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,626 @@
+/*
+* 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: 
+*
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <AknsSrvClient.h>
+#include <AknsSrvChunkLookup.h>
+#include <AknsConstants.h>
+#include <AknsItemDef.h>
+
+#include "bganimhost.h"
+
+
+typedef void* (*plugingetinterfacefunc)(int);
+
+const TInt KRefreshTarget = 15;
+_LIT(KExeCaption,"BG anim host");
+
+static const TUint KMaxGPUMemUsage = 1024*1024*4;
+
+
+CBgAnimHost::CBgAnimHost() 
+    {
+    }
+    
+CBgAnimHost::~CBgAnimHost() 
+    {
+    delete iTimer;
+    if (iPlugin)
+        {
+        iPlugin->destroy();
+        free(iPlugin);
+        }
+    iPluginLibrary.Close();
+    delete iSCPropertyListener;
+    delete iThemeRepositoryListener;
+    while (iSensorListeners.Count())
+        {
+        delete iSensorListeners[0];
+        iSensorListeners.Remove(0);
+        }
+    iSensorListeners.Close();
+    delete CActiveScheduler::Current();
+    CActiveScheduler::Install(NULL);
+    ReleaseWindowSurface();
+    ReleaseEGL();
+    DestroyWindow();
+    }
+
+void CBgAnimHost::ConstructL() 
+    {
+    User::LeaveIfError(iWsSession.Connect());
+    TUid wgUid;
+    wgUid.iUid = 0x200286D3;
+    TInt id = 0;
+    CApaWindowGroupName::FindByAppUid(wgUid, iWsSession, id);
+    if (id != KErrNotFound)
+        {
+        User::Leave(KErrAlreadyExists);
+        }
+
+    iWsSession.ComputeMode(RWsSession::EPriorityControlDisabled);
+    iWsSession.EnableWindowSizeCacheL();
+        
+    CActiveScheduler *ac = new (ELeave) CActiveScheduler;
+    CActiveScheduler::Install(ac);
+    iTimer = CHighResTimer::NewL(TCallBack(TimerFunc, this),CActive::EPriorityStandard);
+    iThemeRepositoryListener = CThemeRepositoryListener::NewL(&iRunning);
+    iSCPropertyListener = CScreenSaverPropertyListener::NewL(TCallBack(ScreenSaverCallback, this));
+    
+    CreateWindowL();
+
+    // load the initial plugin
+    LoadPluginL();
+    InitEGLL();
+    CreateWindowSurfaceL();
+    
+    User::LeaveIfError(iPlugin->gpuresourcesavailable(1));
+    iThemeRepositoryListener->IssueRequest();
+    iSCPropertyListener->IssueRequest();
+    }
+    
+void CBgAnimHost::CreateWindowL()
+    {
+    iScreenDevice = new (ELeave) CWsScreenDevice(iWsSession);
+    User::LeaveIfError(iScreenDevice->Construct(0));
+    
+    TPixelsAndRotation rot;
+    TInt screenmode = iScreenDevice->CurrentScreenMode(); 
+    iScreenDevice->GetScreenModeSizeAndRotation(screenmode, rot);
+    if (rot.iRotation == CFbsBitGc::EGraphicsOrientationNormal)
+        {
+        iDisplaySize = rot.iPixelSize;
+        }
+    else
+        {
+        iDisplaySize.iWidth = rot.iPixelSize.iHeight;
+        iDisplaySize.iHeight = rot.iPixelSize.iWidth;
+        }
+    
+    iRealDisplaySize = iDisplaySize;
+    iDisplaySize.iWidth/=2;
+    iDisplaySize.iHeight/=2;
+    
+    iWindowGroup=RWindowGroup(iWsSession);
+    User::LeaveIfError(iWindowGroup.Construct((TUint32)&iWindowGroup));
+	iWindowGroup.SetOrdinalPosition(-1,-1000);
+	
+	iWindow=RWindow(iWsSession);
+	User::LeaveIfError(iWindow.Construct(iWindowGroup, (TUint32)&iWindow));
+	User::LeaveIfError(iWindow.SetExtentErr(TPoint(0,0),iDisplaySize));
+    iWindow.SetVisible(ETrue);
+	iWindow.Activate();
+
+    iWindGroupName = CApaWindowGroupName::NewL(iWsSession, iWindowGroup.Identifier());
+
+    TUid wgUid;
+    wgUid.iUid = 0x200286D3;
+    
+    iWindGroupName->SetAppUid(wgUid);
+    iWindGroupName->SetCaptionL(KExeCaption);
+    iWindGroupName->SetHidden(ETrue);
+    iWindGroupName->SetAppReady(ETrue);
+    iWindGroupName->SetSystem(ETrue);
+    iWindGroupName->SetWindowGroupName(iWindowGroup);
+
+	iWsSession.Flush();
+    }
+    
+void CBgAnimHost::DestroyWindow()
+    {
+    delete iWindGroupName;
+    iWindow.Close();
+    iWindowGroup.Close();
+    delete iScreenDevice;
+    iWsSession.Close();
+    }
+    
+void CBgAnimHost::InitEGLL()
+    {
+    iEGLDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+    TInt minorVersion;
+    TInt majorVersion;
+    if (!iEGLDisplay)
+        {
+        User::Leave(KErrHardwareNotAvailable);
+        }
+  	if( !eglInitialize( iEGLDisplay, &majorVersion, &minorVersion ) ) 
+  	    {
+        User::Leave(KErrHardwareNotAvailable);
+  	    }
+  	iEGLInitialized = ETrue;
+    }
+
+void CBgAnimHost::ReleaseEGL()
+    {
+    if (iEGLInitialized)
+        {
+        eglTerminate( iEGLDisplay );   
+        iEGLInitialized = EFalse;
+        }
+    }
+    
+void CBgAnimHost::ReleaseWindowSurface(TBool aReleaseObserver)
+    {
+    if (iEGLInitialized && iSurfaceInitialized)
+        {
+        eglDestroyContext( iEGLDisplay, iEGLContext );
+        eglDestroySurface( iEGLDisplay, iEGLSurface );
+        eglMakeCurrent( iEGLDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT );
+        iWsSession.Flush();
+        
+        iSurfaceInitialized = EFalse;
+        
+        if (aReleaseObserver)
+            {
+            iCompSource->RemoveObserver(*this);
+            delete iCompSource;
+            iCompSource = NULL;
+            }
+        }
+    }
+
+const EGLint openvg_surface_attrs[] = 
+        { 
+        EGL_VG_ALPHA_FORMAT, EGL_VG_ALPHA_FORMAT_PRE,
+        EGL_NONE
+        };
+
+const EGLint opengl_es2_context_attrs[] = 
+        {
+        EGL_CONTEXT_CLIENT_VERSION, 2,
+        EGL_NONE
+        };
+
+    
+void CBgAnimHost::CreateWindowSurfaceL()
+    {
+    const EGLint* conf = iPlugin->getpreferredconfig();
+   
+    TInt numItems = 1;
+    while (conf[numItems-1] != EGL_NONE)
+        {
+        numItems++;
+        }
+
+    EGLint* preferredConfig = (EGLint*)malloc(sizeof(EGLint)*numItems);
+    for (TInt count = 0; count < numItems;count++)
+        {
+        EGLint val = conf[count];
+        preferredConfig[count] = val;
+        switch (val)
+            {
+            case EGL_BUFFER_SIZE:
+                if (conf[count+1] != 16)
+                    {
+                    preferredConfig[count+1] = 16;
+                    count++;
+                    }
+                break;
+            case EGL_ALPHA_SIZE:
+                if (conf[count+1] != 0)
+                    {
+                    preferredConfig[count+1] = 0;
+                    count++;
+                    }
+
+                break;
+            case EGL_RED_SIZE:
+                if (conf[count+1] != 5)
+                    {
+                    preferredConfig[count+1] = 5;
+                    count++;
+                    }
+
+                break;
+            case EGL_GREEN_SIZE:
+                if (conf[count+1] != 6)
+                    {
+                    preferredConfig[count+1] = 6;
+                    count++;
+                    }
+
+                break;
+            case EGL_BLUE_SIZE:
+                if (conf[count+1] != 5)
+                    {
+                    preferredConfig[count+1] = 5;
+                    count++;
+                    }
+                break;
+            default:
+                break;
+            }
+        }
+    
+    TInt index = 0;
+    
+    // figure out what API was requested
+    EGLint api = EGL_NONE;
+    while (conf[index] != EGL_NONE)
+        {
+        if (conf[index] == EGL_RENDERABLE_TYPE)
+            {
+            if (conf[index+1]&EGL_OPENVG_BIT)
+                {
+                api = EGL_OPENVG_BIT;
+                if (!eglBindAPI(EGL_OPENVG_API))
+                    {
+                    User::Leave(KErrAbort);
+                    }
+                }
+            else if ( (conf[index+1]&EGL_OPENGL_ES_BIT) ||
+                      (conf[index+1]&EGL_OPENGL_ES2_BIT) )
+                {
+                api = conf[index+1];
+                if (!eglBindAPI(EGL_OPENGL_ES_API))                
+                    {
+                    User::Leave(KErrAbort);
+                    }
+                }
+            index++;
+            }
+        index++;
+        }         
+    EGLConfig *configList = NULL;
+    EGLint numConfigs = 0;
+    EGLint configSize   = 0;
+
+    // Get the number of possible EGLConfigs
+    if ( !eglGetConfigs( iEGLDisplay, configList, configSize, &numConfigs ) )
+       {
+       User::Leave(KErrAbort);
+
+       }
+    configSize = numConfigs;
+    
+    configList = (EGLConfig*)malloc(sizeof(EGLConfig)*configSize);
+    if (!configList)
+        {
+        User::Leave(KErrNoMemory);
+        }
+    
+	if( !eglChooseConfig( iEGLDisplay, preferredConfig, configList, configSize, &numConfigs ) )
+		{
+        User::Leave(KErrAbort);
+		}
+
+	TInt confIndex = 0;
+	// we should now have a list of configs matching our preferred attributes
+    for (TInt count = 0;count<numConfigs;count++)
+        {
+        EGLint buffer_size;
+        EGLint red_size;
+        EGLint green_size;
+        EGLint blue_size;
+        EGLint alpha_size;
+        
+        eglGetConfigAttrib(iEGLDisplay, configList[count],EGL_BUFFER_SIZE,&buffer_size);
+        eglGetConfigAttrib(iEGLDisplay, configList[count],EGL_RED_SIZE,&red_size);
+        eglGetConfigAttrib(iEGLDisplay, configList[count],EGL_GREEN_SIZE,&green_size);
+        eglGetConfigAttrib(iEGLDisplay, configList[count],EGL_BLUE_SIZE,&blue_size);
+        eglGetConfigAttrib(iEGLDisplay, configList[count],EGL_ALPHA_SIZE,&alpha_size);
+
+        if (buffer_size == 16 && red_size == 5 && green_size == 6 && blue_size == 5 && alpha_size == 0)
+            {
+            confIndex = count;
+            break;
+            }
+        }
+        
+    EGLint* context_attrs = NULL;
+    if (api == EGL_OPENGL_ES2_BIT)
+        {
+        context_attrs = (EGLint*)opengl_es2_context_attrs;
+        }
+
+	iEGLContext = eglCreateContext( iEGLDisplay, configList[confIndex], NULL, context_attrs );
+	if( !iEGLContext )
+        {
+        User::Leave(KErrAbort);
+        }
+
+    EGLint* surface_attrs = NULL;
+#if !defined(__WINS__) // no pre multiplied surfaces on wins (yet)
+    if (api == EGL_OPENVG_BIT)
+        {
+        surface_attrs = (EGLint*)openvg_surface_attrs;
+        }
+#endif
+        
+	iEGLSurface = eglCreateWindowSurface( iEGLDisplay, configList[confIndex], &iWindow, surface_attrs );
+	if( !iEGLSurface )
+        {
+        User::Leave(KErrAbort);
+        }
+	
+	eglMakeCurrent( iEGLDisplay, iEGLSurface, iEGLSurface, iEGLContext );        
+
+
+    free(configList);
+    free(preferredConfig);
+	
+    FOREVER
+        {
+        TRAPD(cerr, iCompSource = CAlfCompositionSource::NewL(iWindow));
+        if (!cerr)
+            {
+            iCompSource->AddCompositionObserverL(*this);
+            iCompSource->SetIsBackgroundAnim(ETrue);
+            iCompSource->SetExtent(TRect(TPoint(0,0),iRealDisplaySize),0);
+            break;
+            }
+        else
+            {
+            User::After(5000000);
+            }
+        }
+
+    iSurfaceInitialized = ETrue;
+    
+    }
+    
+void CBgAnimHost::LoadPluginL()
+    {
+    // dig out the skin config from skin server
+    HBufC* configstr = NULL;
+    RAknsSrvSession skinsrv;
+    User::LeaveIfError(skinsrv.Connect());
+    CleanupClosePushL(skinsrv);
+    CAknsSrvChunkLookup* cl = skinsrv.CreateChunkLookupL();
+    CleanupStack::PushL(cl);
+    CAknsStringItemDef* configitem = static_cast<CAknsStringItemDef*>(cl->LookupAndCreateDefL( KAknsIIDPropertyAnimBgParam )); 
+    User::LeaveIfNull(configitem);
+    CleanupStack::PushL(configitem);
+    configstr = configitem->String().AllocL();
+    CleanupStack::PopAndDestroy(3); // skinsrv, cl, configitem
+    CleanupStack::PushL(configstr);
+    RDebug::Print(_L("----------------------"));
+    RDebug::Print(_L("backgroundhost config:"));
+    RDebug::Print(*configstr);
+    RDebug::Print(_L("----------------------"));
+    
+    TLex lex(*configstr);
+    TPtrC dllname = lex.NextToken();
+    if (!dllname.Length())
+        {
+        User::Leave(KErrNotFound);
+        }
+    
+    User::LeaveIfError(iPluginLibrary.Load(dllname));
+    plugingetinterfacefunc getif = (plugingetinterfacefunc)iPluginLibrary.Lookup(1);
+    if (!getif)
+        {
+        iPluginLibrary.Close();
+        User::Leave(KErrNotFound);
+        }
+    
+    iPlugin = (plugin_export_v1_t*) getif(1);
+
+    TPtrC configpath = lex.NextToken();
+    if (!configpath.Length())
+        {
+        User::Leave(KErrNotFound);
+        }
+    TBuf8<256> pluginpath;
+    pluginpath.Copy(configpath);
+    User::LeaveIfError(iPlugin->initialize((const char*)pluginpath.PtrZ(), KMaxGPUMemUsage));
+
+//        }
+//    else
+//        {
+//        User::LeaveIfError(iPlugin->initialize("z:\\private\\200286D3", KMaxGPUMemUsage));
+//        }
+
+    CleanupStack::PopAndDestroy(); // configstr
+    
+    iPlugin->setdisplaydimensions(iDisplaySize.iWidth, iDisplaySize.iHeight);
+    if (iPlugin->desiredsensors && iPlugin->receivesensordata)
+        {
+        const unsigned int* sensors = iPlugin->desiredsensors();
+        while (*sensors)
+            {
+            CSensorListener* listener = NULL;
+            TRAPD(serr, listener = CSensorListener::NewL(this, *sensors++));
+            if (!serr)
+                {
+                iSensorListeners.Append(listener);
+                }
+            }
+        }
+    }
+    
+void CBgAnimHost::NewFrame()
+    {
+    if (!iRunning)
+        {
+        // Stop and exit
+        CActiveScheduler::Stop();
+        return;
+        }
+    if (!iSurfaceInitialized)
+        {
+        return;
+        }
+    TTime start;
+    start.UniversalTime();
+    iPlugin->produceframe();
+    eglSwapBuffers(iEGLDisplay, iEGLSurface);
+    TTime end;
+    end.UniversalTime();
+    TInt64 elapsed = end.MicroSecondsFrom(start).Int64();
+    elapsed/=1000; // convert to milliseconds
+    
+    TInt nextcallback = KRefreshTarget-(TInt)elapsed;
+    if (nextcallback < 1)
+        nextcallback = 1;
+    
+    iTimer->CallBack(nextcallback);
+    }
+    
+    
+TInt CBgAnimHost::TimerFunc(TAny* aPtr)
+    {
+    CBgAnimHost* me = (CBgAnimHost*)(aPtr);
+    me->NewFrame();
+    return ETrue;
+    }
+
+    
+void CBgAnimHost::ExecuteL() 
+    {
+    // finally start our timer and scheduler...
+    iTimer->CallBack(100);
+    iTimerRunning = ETrue;
+    iRunning = ETrue;
+    CActiveScheduler::Start();
+    }
+
+void CBgAnimHost::FrameReady(TInt /*aScreenNumber*/)
+    {
+    }
+    
+void CBgAnimHost::RunningLowOnGraphicsMemory()
+    {
+/*    iThemeRepositoryListener->GPuMemLow(ETrue);
+    CompositionTargetHidden();*/
+    }
+
+
+void CBgAnimHost::GraphicsMemoryGood()
+    {
+/*    CompositionTargetVisible();
+    iThemeRepositoryListener->GPuMemLow(EFalse);*/
+    }
+    
+void CBgAnimHost::CompositionTargetHidden()
+    {
+    if (!iSurfaceInitialized)
+        {
+        // don't bother if we are already in
+        // a correct state..
+        return;
+        }
+
+    RDebug::Print(_L("!!! - HIDDEN - !!!"));
+    // release gpu resources...
+    iTimer->Cancel();
+    iTimerRunning = EFalse;
+    iPlugin->gpuresourcesavailable(0);
+    ReleaseWindowSurface(EFalse);
+    }
+
+void CBgAnimHost::CompositionTargetVisible()
+    {
+    if (iSurfaceInitialized)
+        {
+        // don't bother if we are already in
+        // a correct state..
+        return;
+        }
+
+    RDebug::Print(_L("!!! - VISIBLE - !!!"));
+
+    if (!iSurfaceInitialized && iCompSource)
+        {
+        iCompSource->RemoveObserver(*this);
+        delete iCompSource;
+        iCompSource = NULL;            
+        }
+        
+    TRAPD(err,CreateWindowSurfaceL());
+    // reclaim gpu resources
+    if (!err)
+        {
+        iPlugin->gpuresourcesavailable(1);
+        iTimer->CallBack(1);
+        iTimerRunning = ETrue;
+        }
+    }
+
+void CBgAnimHost::HandleScreenSaverEvent()
+    {
+    RDebug::Print(_L("-----------------------------------"));
+    RDebug::Print(_L("CBgAnimHost::HandleScreenSaverEvent"));
+    TInt scStatus = iSCPropertyListener->GetScreenSaverStatus();
+    RDebug::Print(_L("status: %d, timerrunning %d, surfacecreated %d"),scStatus, iTimerRunning, iSurfaceInitialized);
+    RDebug::Print(_L("-----------------------------------"));
+    if (scStatus)
+        {
+        // screensaver is ON
+        if (iTimerRunning)
+            {
+            RDebug::Print(_L("--- screensaver on, stopping timer ---"));
+            iTimer->Cancel();
+            iTimerRunning = EFalse;
+            }
+        }
+    else
+        {
+        // screensaver is OFF
+        if (!iTimerRunning && iSurfaceInitialized)
+            {
+            RDebug::Print(_L("--- screensaver off, starting timer ---"));
+    
+            iTimerRunning = ETrue;
+            iTimer->CallBack(1);
+            }
+        }
+    }
+
+TInt CBgAnimHost::ScreenSaverCallback(TAny* aPtr)
+    {
+    CBgAnimHost* me = (CBgAnimHost*) aPtr;
+    me->HandleScreenSaverEvent();
+    return EFalse;
+    }
+
+void CBgAnimHost::DataReceived( CSensrvChannel& aChannel, TInt aCount, TInt aDataLost )
+    {
+    if (iPlugin && iPlugin->receivesensordata);
+        {
+        iPlugin->receivesensordata((void*)&aChannel, aCount, aDataLost);
+        }
+    }
+    
+void CBgAnimHost::DataError( CSensrvChannel& aChannel, TSensrvErrorSeverity aError )
+    {
+    }
+
+void CBgAnimHost::GetDataListenerInterfaceL( TUid aInterfaceUid, TAny*& aInterface)
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/src/highrestimer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* 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: 
+*
+*/
+
+#include "highrestimer.h"
+
+
+CHighResTimer* CHighResTimer::NewL(TCallBack aCallBack, TInt aPriority)
+	{
+	CHighResTimer* self = new(ELeave) CHighResTimer(aCallBack, aPriority);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+CHighResTimer::~CHighResTimer()
+	{
+	Cancel();
+	}
+
+void CHighResTimer::CallBack(const TInt aWaitInMilliSecs)
+	{
+	TInt wait = aWaitInMilliSecs*1000;
+	if (wait < 1000)
+	    {
+	    wait = 1000;
+	    }
+	if (wait > 15000)
+	    {
+	    wait = 15000;
+	    }
+            
+    HighRes( TTimeIntervalMicroSeconds32( wait ) );
+	}
+	
+CHighResTimer::CHighResTimer(TCallBack aCallBack, TInt aPriority) 
+	: CTimer(aPriority), iCallBack(aCallBack)
+		{
+		CActiveScheduler::Add(this);
+		}
+
+void CHighResTimer::RunL()
+	{
+	if (iStatus.Int() != KErrCancel)
+	    {
+	    iCallBack.CallBack();
+	    }
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/src/main.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* 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: 
+*
+*/
+
+#include <stdio.h>
+#include <e32def.h>
+
+#include "bganimhost.h"
+
+int main(int /*argc*/, char** /*argv*/)
+    {
+    __UHEAP_MARK;
+    TBool fail = EFalse;
+    CBgAnimHost* host = new CBgAnimHost();
+    if (host)
+        {
+        TRAPD(err, host->ConstructL());
+        if (!err)
+            {
+            TRAP_IGNORE(host->ExecuteL());
+            }
+        else
+            {
+            fail = ETrue;
+            }
+        delete host;
+        }
+    else
+        {
+        fail = ETrue;
+        }
+        
+    if (fail)
+        {
+        // failed to construct the animation properly
+        // restore skin state
+        // TODO: implement actual restore on failure
+        }
+     
+    __UHEAP_MARKEND;
+    return 0;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/src/screensaverpropertylistener.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,78 @@
+/*
+* 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: 
+*
+*/
+#include <e32debug.h>
+#include "screensaverpropertylistener.h"
+
+#include <platform/mw/ScreensaverInternalPSKeys.h>
+
+
+CScreenSaverPropertyListener::CScreenSaverPropertyListener(TCallBack aCallback) : CActive(EPriorityStandard), iCallback(aCallback)     
+    {
+    CActiveScheduler::Add(this);
+    }
+
+CScreenSaverPropertyListener::~CScreenSaverPropertyListener()
+    {
+    Cancel();
+    iSCProperty.Close();
+    }
+
+CScreenSaverPropertyListener* CScreenSaverPropertyListener::NewL(TCallBack aCallback)
+    {
+    CScreenSaverPropertyListener* me = new (ELeave)CScreenSaverPropertyListener(aCallback);
+    CleanupStack::PushL(me);
+    me->ConstructL();
+    CleanupStack::Pop();
+    RDebug::Print(_L("screensaverlistener constructed"));
+    return me;
+    }
+
+void CScreenSaverPropertyListener::ConstructL()
+    {
+    User::LeaveIfError(iSCProperty.Attach(KPSUidScreenSaver, KScreenSaverOn));
+    }
+
+void CScreenSaverPropertyListener::RunL()
+    {
+    RDebug::Print(_L("screensaverlistener - runl"));
+    if (iStatus.Int() != KErrCancel)
+        {
+        IssueRequest();
+        iSCProperty.Get(iSCStatus);
+        iCallback.CallBack();
+        }
+    }
+
+void CScreenSaverPropertyListener::DoCancel()
+    {
+    iSCProperty.Cancel();
+    }
+
+void CScreenSaverPropertyListener::IssueRequest()
+    {
+    RDebug::Print(_L("screensaverlistener issuereq"));
+    iSCProperty.Subscribe(iStatus);
+    SetActive();
+    }
+
+TInt CScreenSaverPropertyListener::GetScreenSaverStatus()
+    {
+    return iSCStatus;
+    }
+    
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/src/sensor.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,56 @@
+#include <sensrvaccelerometersensor.h>
+
+#include "sensor.h"
+
+
+CSensorListener* CSensorListener::NewL(MSensrvDataListener* aDataListener, TUint32 aSensorType)
+    {
+    CSensorListener* self = new (ELeave) CSensorListener(aDataListener);
+    CleanupStack::PushL(self);
+    self->ConstructL(aSensorType);
+    CleanupStack::Pop();
+    return self;    
+    }
+    
+void CSensorListener::ConstructL(TUint32 aSensorType)
+    {
+    CSensrvChannelFinder* sensrvChannelFinder = CSensrvChannelFinder::NewLC();
+ 
+    RSensrvChannelInfoList channelInfoList;
+    CleanupClosePushL(channelInfoList);
+ 
+    TSensrvChannelInfo mySearchConditions;
+ 
+    mySearchConditions.iChannelType = aSensorType;
+    
+    sensrvChannelFinder->FindChannelsL(channelInfoList,mySearchConditions);
+ 
+    if (channelInfoList.Count())
+        {
+        iSensrvChannel = CSensrvChannel::NewL(channelInfoList[0]);
+        iSensrvChannel->OpenChannelL();
+        iSensrvChannel->StartDataListeningL( iDataListener, 1,1,0);
+        }
+ 
+    channelInfoList.Close();
+    CleanupStack::Pop( &channelInfoList );
+    CleanupStack::PopAndDestroy( sensrvChannelFinder );
+    }
+    
+CSensorListener::CSensorListener(MSensrvDataListener* aDataListener) : iDataListener(aDataListener)
+    {
+    }
+    
+CSensorListener::~CSensorListener()
+    {
+    if (iSensrvChannel)
+        {
+        iSensrvChannel->StopDataListening(); 
+        iSensrvChannel->CloseChannel();
+        }
+        
+    delete iSensrvChannel;
+    }
+        
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/backgroundanim/src/themerepositorylistener.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,90 @@
+/*
+* 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: 
+*
+*/
+#include "themerepositorylistener.h"
+
+#include <platform/mw/pslninternalcrkeys.h>
+
+
+CThemeRepositoryListener::CThemeRepositoryListener(TBool* aValueToChange) : CActive(EPriorityStandard),     
+    iValueToChange(aValueToChange)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+CThemeRepositoryListener::~CThemeRepositoryListener()
+    {
+    Cancel();
+    delete iThemesRepository;
+    }
+
+CThemeRepositoryListener* CThemeRepositoryListener::NewL(TBool* aValueToChange)
+    {
+    CThemeRepositoryListener* me = new (ELeave)CThemeRepositoryListener(aValueToChange);
+    CleanupStack::PushL(me);
+    me->ConstructL();
+    CleanupStack::Pop();
+    return me;
+    }
+
+void CThemeRepositoryListener::ConstructL()
+    {
+    iThemesRepository = CRepository::NewL(KCRUidThemes);
+    iThemesRepository->Get(KThemesAnimBackgroundSupport, iPreviousValue);
+    }
+
+void CThemeRepositoryListener::RunL()
+    {
+    TInt value = 0;
+    iThemesRepository->Get(KThemesAnimBackgroundSupport, value);
+    // we are only interested in the value if it
+    // is something else than 0
+    // as it means that we should stop...
+    if (value && value != iPreviousValue)
+        {
+        *iValueToChange = EFalse;
+        }
+
+    iPreviousValue = value;
+    
+    if (iStatus.Int() != KErrCancel)
+        {
+        IssueRequest();
+        }
+    }
+
+void CThemeRepositoryListener::DoCancel()
+    {
+    iThemesRepository->NotifyCancelAll();    
+    }
+
+void CThemeRepositoryListener::IssueRequest()
+    {
+    TInt err = iThemesRepository->NotifyRequest(KThemesAnimBackgroundSupport,iStatus);
+    if (!err)
+        {
+        SetActive();
+        }
+    }
+
+void CThemeRepositoryListener::GPuMemLow(TBool aLow)
+    {
+    iPreviousValue = aLow ? KMaxTInt : 0;
+    iThemesRepository->Set(KThemesAnimBackgroundSupport, iPreviousValue );
+    }
+    
+
+
Binary file uiacceltk/hitchcock/cenrep/keys_s60uiacceltk.xls has changed
Binary file uiacceltk/hitchcock/conf/s60uiacceltk.confml has changed
Binary file uiacceltk/hitchcock/conf/s60uiacceltk_10283344.crml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/BWINS/hitchcocku.DEF	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1584 @@
+EXPORTS
+	??0CHuiAnimatedTexture@@IAE@AAVCHuiTextureManager@@@Z @ 1 NONAME ; CHuiAnimatedTexture::CHuiAnimatedTexture(class CHuiTextureManager &)
+	??0CHuiBrush@@IAE@XZ @ 2 NONAME ; CHuiBrush::CHuiBrush(void)
+	??0CHuiControl@@QAE@AAVCHuiEnv@@@Z @ 3 NONAME ; CHuiControl::CHuiControl(class CHuiEnv &)
+	??0CHuiDisplayCoeControl@@IAE@AAVCHuiEnv@@@Z @ 4 NONAME ; CHuiDisplayCoeControl::CHuiDisplayCoeControl(class CHuiEnv &)
+	??0CHuiGridLayout@@QAE@AAVMHuiVisualOwner@@@Z @ 5 NONAME ; CHuiGridLayout::CHuiGridLayout(class MHuiVisualOwner &)
+	??0CHuiImageLoaderUtil@@QAE@XZ @ 6 NONAME ; CHuiImageLoaderUtil::CHuiImageLoaderUtil(void)
+	??0CHuiLayout@@QAE@AAVMHuiVisualOwner@@@Z @ 7 NONAME ; CHuiLayout::CHuiLayout(class MHuiVisualOwner &)
+	??0CHuiS60Skin@@QAE@AAVCHuiEnv@@@Z @ 8 NONAME ; CHuiS60Skin::CHuiS60Skin(class CHuiEnv &)
+	??0CHuiVisual@@QAE@AAVMHuiVisualOwner@@@Z @ 9 NONAME ; CHuiVisual::CHuiVisual(class MHuiVisualOwner &)
+	??0THuiActionCommand@@QAE@H@Z @ 10 NONAME ; THuiActionCommand::THuiActionCommand(int)
+	??0THuiAverageMappingFunction@@QAE@PAVMHuiMappingFunction@@0@Z @ 11 NONAME ; THuiAverageMappingFunction::THuiAverageMappingFunction(class MHuiMappingFunction *, class MHuiMappingFunction *)
+	??0THuiBoxMetric@@QAE@ABUTHuiMetric@@000@Z @ 12 NONAME ; THuiBoxMetric::THuiBoxMetric(struct THuiMetric const &, struct THuiMetric const &, struct THuiMetric const &, struct THuiMetric const &)
+	??0THuiBoxMetric@@QAE@ABUTHuiMetric@@@Z @ 13 NONAME ; THuiBoxMetric::THuiBoxMetric(struct THuiMetric const &)
+	??0THuiBoxMetric@@QAE@ABUTHuiXYMetric@@0@Z @ 14 NONAME ; THuiBoxMetric::THuiBoxMetric(struct THuiXYMetric const &, struct THuiXYMetric const &)
+	??0THuiBoxMetric@@QAE@ABUTHuiXYMetric@@@Z @ 15 NONAME ; THuiBoxMetric::THuiBoxMetric(struct THuiXYMetric const &)
+	??0THuiBoxMetric@@QAE@XZ @ 16 NONAME ; THuiBoxMetric::THuiBoxMetric(void)
+	??0THuiCommand@@IAE@W4THuiCommandType@@@Z @ 17 NONAME ; THuiCommand::THuiCommand(enum THuiCommandType)
+	??0THuiConstantMappingFunction@@QAE@M@Z @ 18 NONAME ; THuiConstantMappingFunction::THuiConstantMappingFunction(float)
+	??0THuiControlCommand@@QAE@AAVCHuiControl@@W4THuiOp@@@Z @ 19 NONAME ; THuiControlCommand::THuiControlCommand(class CHuiControl &, enum THuiOp)
+	??0THuiCosineMappingFunction@@QAE@MM@Z @ 20 NONAME ; THuiCosineMappingFunction::THuiCosineMappingFunction(float, float)
+	??0THuiCustomEventCommand@@QAE@HPAVMHuiEventHandler@@@Z @ 21 NONAME ; THuiCustomEventCommand::THuiCustomEventCommand(int, class MHuiEventHandler *)
+	??0THuiEvent@@QAE@H@Z @ 22 NONAME ; THuiEvent::THuiEvent(int)
+	??0THuiEvent@@QAE@PAVCHuiDisplay@@ABUTPointerEvent@@@Z @ 23 NONAME ; THuiEvent::THuiEvent(class CHuiDisplay *, struct TPointerEvent const &)
+	??0THuiFont@@QAE@HABVTFontSpec@@@Z @ 24 NONAME ; THuiFont::THuiFont(int, class TFontSpec const &)
+	??0THuiFont@@QAE@XZ @ 25 NONAME ; THuiFont::THuiFont(void)
+	??0THuiGroupCommand@@QAE@AAVCHuiControlGroup@@W4THuiOp@@PAVCHuiDisplay@@@Z @ 26 NONAME ; THuiGroupCommand::THuiGroupCommand(class CHuiControlGroup &, enum THuiOp, class CHuiDisplay *)
+	??0THuiImage@@QAE@ABVMHuiTexture@@MMMM@Z @ 27 NONAME ; THuiImage::THuiImage(class MHuiTexture const &, float, float, float, float)
+	??0THuiImage@@QAE@XZ @ 28 NONAME ; THuiImage::THuiImage(void)
+	??0THuiImageCommand@@QAE@AAVCHuiImageVisual@@ABVTHuiImage@@W4THuiOp@@@Z @ 29 NONAME ; THuiImageCommand::THuiImageCommand(class CHuiImageVisual &, class THuiImage const &, enum THuiOp)
+	??0THuiInteractionInterval@@QAE@M@Z @ 30 NONAME ; THuiInteractionInterval::THuiInteractionInterval(float)
+	??0THuiLinearMappingFunction@@QAE@MM@Z @ 31 NONAME ; THuiLinearMappingFunction::THuiLinearMappingFunction(float, float)
+	??0THuiMarkerCommand@@QAE@H@Z @ 32 NONAME ; THuiMarkerCommand::THuiMarkerCommand(int)
+	??0THuiMaterial@@QAE@XZ @ 33 NONAME ; THuiMaterial::THuiMaterial(void)
+	??0THuiMetric@@QAE@H@Z @ 34 NONAME ; THuiMetric::THuiMetric(int)
+	??0THuiMetric@@QAE@MHH@Z @ 35 NONAME ; THuiMetric::THuiMetric(float, int, int)
+	??0THuiObjectCommand@@IAE@W4THuiCommandType@@PAXW4THuiOp@@@Z @ 36 NONAME ; THuiObjectCommand::THuiObjectCommand(enum THuiCommandType, void *, enum THuiOp)
+	??0THuiPointCommand@@QAE@PAXAAVTHuiTimedPoint@@VTHuiRealPoint@@H@Z @ 37 NONAME ; THuiPointCommand::THuiPointCommand(void *, class THuiTimedPoint &, class THuiRealPoint, int)
+	??0THuiPointCommand@@QAE@PAXAAVTHuiTimedPoint@@W4THuiOp@@@Z @ 38 NONAME ; THuiPointCommand::THuiPointCommand(void *, class THuiTimedPoint &, enum THuiOp)
+	??0THuiPointCommand@@QAE@PAXAAVTHuiTimedPoint@@W4THuiOp@@VTHuiRealPoint@@M@Z @ 39 NONAME ; THuiPointCommand::THuiPointCommand(void *, class THuiTimedPoint &, enum THuiOp, class THuiRealPoint, float)
+	??0THuiS60TextStyle@@QAE@HH@Z @ 40 NONAME ; THuiS60TextStyle::THuiS60TextStyle(int, int)
+	??0THuiSineMappingFunction@@QAE@MM@Z @ 41 NONAME ; THuiSineMappingFunction::THuiSineMappingFunction(float, float)
+	??0THuiTextCommand@@QAE@AAVCHuiTextVisual@@ABVTDesC16@@W4THuiOp@@@Z @ 42 NONAME ; THuiTextCommand::THuiTextCommand(class CHuiTextVisual &, class TDesC16 const &, enum THuiOp)
+	??0THuiTextStyle@@QAE@ABV0@@Z @ 43 NONAME ; THuiTextStyle::THuiTextStyle(class THuiTextStyle const &)
+	??0THuiTextureHandle@@QAE@IABVTSize@@0@Z @ 44 NONAME ; THuiTextureHandle::THuiTextureHandle(unsigned int, class TSize const &, class TSize const &)
+	??0THuiTextureHandle@@QAE@XZ @ 45 NONAME ; THuiTextureHandle::THuiTextureHandle(void)
+	??0THuiTimedPoint@@QAE@MM@Z @ 46 NONAME ; THuiTimedPoint::THuiTimedPoint(float, float)
+	??0THuiTimedPoint@@QAE@XZ @ 47 NONAME ; THuiTimedPoint::THuiTimedPoint(void)
+	??0THuiTimedValue@@QAE@MW4THuiInterpolationStyle@@@Z @ 48 NONAME ; THuiTimedValue::THuiTimedValue(float, enum THuiInterpolationStyle)
+	??0THuiTimedValue@@QAE@W4THuiInterpolationStyle@@@Z @ 49 NONAME ; THuiTimedValue::THuiTimedValue(enum THuiInterpolationStyle)
+	??0THuiTransformationCommand@@QAE@PAXAAVCHuiTransformation@@W4THuiOp@@H@Z @ 50 NONAME ; THuiTransformationCommand::THuiTransformationCommand(void *, class CHuiTransformation &, enum THuiOp, int)
+	??0THuiValueCommand@@QAE@PAXAAVTHuiTimedValue@@MH@Z @ 51 NONAME ; THuiValueCommand::THuiValueCommand(void *, class THuiTimedValue &, float, int)
+	??0THuiValueCommand@@QAE@PAXAAVTHuiTimedValue@@W4THuiOp@@MM@Z @ 52 NONAME ; THuiValueCommand::THuiValueCommand(void *, class THuiTimedValue &, enum THuiOp, float, float)
+	??0THuiVisualCommand@@QAE@AAVCHuiVisual@@W4THuiOp@@HH@Z @ 53 NONAME ; THuiVisualCommand::THuiVisualCommand(class CHuiVisual &, enum THuiOp, int, int)
+	??0THuiXYMetric@@QAE@ABUTHuiMetric@@0@Z @ 54 NONAME ; THuiXYMetric::THuiXYMetric(struct THuiMetric const &, struct THuiMetric const &)
+	??0THuiXYMetric@@QAE@ABUTHuiMetric@@@Z @ 55 NONAME ; THuiXYMetric::THuiXYMetric(struct THuiMetric const &)
+	??0THuiXYMetric@@QAE@XZ @ 56 NONAME ; THuiXYMetric::THuiXYMetric(void)
+	??1CHuiAnchorLayout@@UAE@XZ @ 57 NONAME ; CHuiAnchorLayout::~CHuiAnchorLayout(void)
+	??1CHuiAnimatedTexture@@UAE@XZ @ 58 NONAME ; CHuiAnimatedTexture::~CHuiAnimatedTexture(void)
+	??1CHuiBrush@@UAE@XZ @ 59 NONAME ; CHuiBrush::~CHuiBrush(void)
+	??1CHuiBrushArray@@UAE@XZ @ 60 NONAME ; CHuiBrushArray::~CHuiBrushArray(void)
+	??1CHuiControl@@UAE@XZ @ 61 NONAME ; CHuiControl::~CHuiControl(void)
+	??1CHuiCurvePath@@UAE@XZ @ 62 NONAME ; CHuiCurvePath::~CHuiCurvePath(void)
+	??1CHuiDeckLayout@@UAE@XZ @ 63 NONAME ; CHuiDeckLayout::~CHuiDeckLayout(void)
+	??1CHuiDisplay@@UAE@XZ @ 64 NONAME ; CHuiDisplay::~CHuiDisplay(void)
+	??1CHuiDisplayCoeControl@@UAE@XZ @ 65 NONAME ; CHuiDisplayCoeControl::~CHuiDisplayCoeControl(void)
+	??1CHuiFlowLayout@@UAE@XZ @ 66 NONAME ; CHuiFlowLayout::~CHuiFlowLayout(void)
+	??1CHuiGifAnimationTexture@@UAE@XZ @ 67 NONAME ; CHuiGifAnimationTexture::~CHuiGifAnimationTexture(void)
+	??1CHuiGridLayout@@UAE@XZ @ 68 NONAME ; CHuiGridLayout::~CHuiGridLayout(void)
+	??1CHuiImageBrush@@UAE@XZ @ 69 NONAME ; CHuiImageBrush::~CHuiImageBrush(void)
+	??1CHuiImageLoaderUtil@@UAE@XZ @ 70 NONAME ; CHuiImageLoaderUtil::~CHuiImageLoaderUtil(void)
+	??1CHuiLayout@@UAE@XZ @ 71 NONAME ; CHuiLayout::~CHuiLayout(void)
+	??1CHuiMesh@@UAE@XZ @ 72 NONAME ; CHuiMesh::~CHuiMesh(void)
+	??1CHuiProceduralMesh@@UAE@XZ @ 73 NONAME ; CHuiProceduralMesh::~CHuiProceduralMesh(void)
+	??1CHuiS60Skin@@UAE@XZ @ 74 NONAME ; CHuiS60Skin::~CHuiS60Skin(void)
+	??1CHuiSoftKeyControl@@UAE@XZ @ 75 NONAME ; CHuiSoftKeyControl::~CHuiSoftKeyControl(void)
+	??1CHuiTexture@@UAE@XZ @ 76 NONAME ; CHuiTexture::~CHuiTexture(void)
+	??1CHuiTransformation@@UAE@XZ @ 77 NONAME ; CHuiTransformation::~CHuiTransformation(void)
+	??1CHuiVisual@@UAE@XZ @ 78 NONAME ; CHuiVisual::~CHuiVisual(void)
+	??1MHuiBitmapProvider@@UAE@XZ @ 79 NONAME ; MHuiBitmapProvider::~MHuiBitmapProvider(void)
+	??1MHuiEventHandler@@UAE@XZ @ 80 NONAME ; MHuiEventHandler::~MHuiEventHandler(void)
+	??1MHuiSegmentedTexture@@UAE@XZ @ 81 NONAME ; MHuiSegmentedTexture::~MHuiSegmentedTexture(void)
+	??1MHuiTexture@@UAE@XZ @ 82 NONAME ; MHuiTexture::~MHuiTexture(void)
+	??1MHuiVisualOwner@@UAE@XZ @ 83 NONAME ; MHuiVisualOwner::~MHuiVisualOwner(void)
+	??1THuiCommand@@UAE@XZ @ 84 NONAME ; THuiCommand::~THuiCommand(void)
+	??1THuiFont@@QAE@XZ @ 85 NONAME ; THuiFont::~THuiFont(void)
+	??4THuiTimedValue@@QAEAAV0@ABV0@@Z @ 86 NONAME ; class THuiTimedValue & THuiTimedValue::operator=(class THuiTimedValue const &)
+	??ACHuiBrushArray@@QAEAAVCHuiBrush@@H@Z @ 87 NONAME ; class CHuiBrush & CHuiBrushArray::operator[](int)
+	??ACHuiTransformation@@QAEAAUTTransform@0@H@Z @ 88 NONAME ; struct CHuiTransformation::TTransform & CHuiTransformation::operator[](int)
+	?AcceptInput@CHuiControl@@QBEHXZ @ 89 NONAME ; int CHuiControl::AcceptInput(void) const
+	?AcceptInput@CHuiControlGroup@@QBEHXZ @ 90 NONAME ; int CHuiControlGroup::AcceptInput(void) const
+	?AcquireFocus@CHuiControl@@QAEXXZ @ 91 NONAME ; void CHuiControl::AcquireFocus(void)
+	?Activate@CHuiDisplay@@QAEXH@Z @ 92 NONAME ; void CHuiDisplay::Activate(int)
+	?ActivateL@CHuiDisplayCoeControl@@EAEXXZ @ 93 NONAME ; void CHuiDisplayCoeControl::ActivateL(void)
+	?Active@CHuiDisplay@@QBEHXZ @ 94 NONAME ; int CHuiDisplay::Active(void) const
+	?AddConnectionL@CHuiControl@@UAEXPAV1@H@Z @ 95 NONAME ; void CHuiControl::AddConnectionL(class CHuiControl *, int)
+	?AddNewL@CHuiAnchorLayout@@SAPAV1@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 96 NONAME ; class CHuiAnchorLayout * CHuiAnchorLayout::AddNewL(class CHuiControl &, class CHuiLayout *)
+	?AddNewL@CHuiCurvePathLayout@@SAPAV1@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 97 NONAME ; class CHuiCurvePathLayout * CHuiCurvePathLayout::AddNewL(class CHuiControl &, class CHuiLayout *)
+	?AddNewL@CHuiDeckLayout@@SAPAV1@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 98 NONAME ; class CHuiDeckLayout * CHuiDeckLayout::AddNewL(class CHuiControl &, class CHuiLayout *)
+	?AddNewL@CHuiFlowLayout@@SAPAV1@AAVCHuiControl@@W4TFlowDirection@1@PAVCHuiLayout@@@Z @ 99 NONAME ; class CHuiFlowLayout * CHuiFlowLayout::AddNewL(class CHuiControl &, enum CHuiFlowLayout::TFlowDirection, class CHuiLayout *)
+	?AddNewL@CHuiGridLayout@@SAPAV1@AAVCHuiControl@@HHPAVCHuiLayout@@@Z @ 100 NONAME ; class CHuiGridLayout * CHuiGridLayout::AddNewL(class CHuiControl &, int, int, class CHuiLayout *)
+	?AddNewL@CHuiImageVisual@@SAPAV1@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 101 NONAME ; class CHuiImageVisual * CHuiImageVisual::AddNewL(class CHuiControl &, class CHuiLayout *)
+	?AddNewL@CHuiLayout@@SAPAV1@AAVCHuiControl@@PAV1@@Z @ 102 NONAME ; class CHuiLayout * CHuiLayout::AddNewL(class CHuiControl &, class CHuiLayout *)
+	?AddNewL@CHuiLineVisual@@SAPAV1@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 103 NONAME ; class CHuiLineVisual * CHuiLineVisual::AddNewL(class CHuiControl &, class CHuiLayout *)
+	?AddNewL@CHuiMeshVisual@@SAPAV1@AAVCHuiControl@@W4THuiMeshType@@PAVCHuiLayout@@@Z @ 104 NONAME ; class CHuiMeshVisual * CHuiMeshVisual::AddNewL(class CHuiControl &, enum THuiMeshType, class CHuiLayout *)
+	?AddNewL@CHuiTextVisual@@SAPAV1@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 105 NONAME ; class CHuiTextVisual * CHuiTextVisual::AddNewL(class CHuiControl &, class CHuiLayout *)
+	?AddNewL@CHuiViewportLayout@@SAPAV1@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 106 NONAME ; class CHuiViewportLayout * CHuiViewportLayout::AddNewL(class CHuiControl &, class CHuiLayout *)
+	?AddNewL@CHuiVisual@@SAPAV1@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 107 NONAME ; class CHuiVisual * CHuiVisual::AddNewL(class CHuiControl &, class CHuiLayout *)
+	?AlignByOrigin@CHuiVisual@@QBEXAAVTHuiRealPoint@@H@Z @ 108 NONAME ; void CHuiVisual::AlignByOrigin(class THuiRealPoint &, int) const
+	?AnimationControllerCount@CHuiMesh@@UBEHXZ @ 109 NONAME ; int CHuiMesh::AnimationControllerCount(void) const
+	?AppendAndPopL@CHuiControlGroup@@QAEXPAVCHuiControl@@@Z @ 110 NONAME ; void CHuiControlGroup::AppendAndPopL(class CHuiControl *)
+	?AppendArcL@CHuiCurvePath@@QAEXABVTPoint@@ABVTSize@@MMM@Z @ 111 NONAME ; void CHuiCurvePath::AppendArcL(class TPoint const &, class TSize const &, float, float, float)
+	?AppendColorL@CHuiGradientBrush@@UAEXMABVTRgb@@M@Z @ 112 NONAME ; void CHuiGradientBrush::AppendColorL(float, class TRgb const &, float)
+	?AppendL@CHuiBrushArray@@QAEXPAVCHuiBrush@@W4THuiOwnership@@@Z @ 113 NONAME ; void CHuiBrushArray::AppendL(class CHuiBrush *, enum THuiOwnership)
+	?AppendL@CHuiControl@@QAEXPAVCHuiVisual@@PAVCHuiLayout@@@Z @ 114 NONAME ; void CHuiControl::AppendL(class CHuiVisual *, class CHuiLayout *)
+	?AppendL@CHuiControl@@UAEXPAVCHuiVisual@@@Z @ 115 NONAME ; void CHuiControl::AppendL(class CHuiVisual *)
+	?AppendL@CHuiControlGroup@@QAEXPAVCHuiControl@@@Z @ 116 NONAME ; void CHuiControlGroup::AppendL(class CHuiControl *)
+	?AppendL@CHuiLayout@@QAEXPAVCHuiVisual@@H@Z @ 117 NONAME ; void CHuiLayout::AppendL(class CHuiVisual *, int)
+	?AppendLayoutL@CHuiControl@@QAEPAVCHuiLayout@@W4THuiLayoutType@@PAV2@@Z @ 118 NONAME ; class CHuiLayout * CHuiControl::AppendLayoutL(enum THuiLayoutType, class CHuiLayout *)
+	?AppendLineL@CHuiCurvePath@@QAEXABVTPoint@@0M@Z @ 119 NONAME ; void CHuiCurvePath::AppendLineL(class TPoint const &, class TPoint const &, float)
+	?AppendVisualL@CHuiControl@@QAEPAVCHuiVisual@@W4THuiVisualType@@PAVCHuiLayout@@@Z @ 120 NONAME ; class CHuiVisual * CHuiControl::AppendVisualL(enum THuiVisualType, class CHuiLayout *)
+	?AppendWeightL@CHuiGridLayout@@QAEXW4THuiGridDimension@@ABUTHuiMetric@@@Z @ 121 NONAME ; void CHuiGridLayout::AppendWeightL(enum THuiGridDimension, struct THuiMetric const &)
+	?At@CHuiBrushArray@@QAEAAVCHuiBrush@@H@Z @ 122 NONAME ; class CHuiBrush & CHuiBrushArray::At(int)
+	?Attach@CHuiAnchorLayout@@QAEHHABUTHuiBoxMetric@@W4THuiAnchorAttachmentOrigin@@H@Z @ 123 NONAME ; int CHuiAnchorLayout::Attach(int, struct THuiBoxMetric const &, enum THuiAnchorAttachmentOrigin, int)
+	?Attach@CHuiAnchorLayout@@QAEHHW4THuiAnchorType@@ABUTHuiMetric@@W4THuiAnchorAttachmentOrigin@@H@Z @ 124 NONAME ; int CHuiAnchorLayout::Attach(int, enum THuiAnchorType, struct THuiMetric const &, enum THuiAnchorAttachmentOrigin, int)
+	?Attach@CHuiAnchorLayout@@QAEHHW4THuiAnchorType@@ABUTHuiXYMetric@@W4THuiAnchorAttachmentOrigin@@H@Z @ 125 NONAME ; int CHuiAnchorLayout::Attach(int, enum THuiAnchorType, struct THuiXYMetric const &, enum THuiAnchorAttachmentOrigin, int)
+	?AverageFrameRate@CHuiStatic@@SAMXZ @ 126 NONAME ; float CHuiStatic::AverageFrameRate(void)
+	?BackgroundColor@THuiTextStyle@@QBE?AVTRgb@@XZ @ 127 NONAME ; class TRgb THuiTextStyle::BackgroundColor(void) const
+	?BackgroundType@CHuiTextVisual@@QBE?AW4THuiBackgroundType@@XZ @ 128 NONAME ; enum THuiBackgroundType CHuiTextVisual::BackgroundType(void) const
+	?BaseConstructL@CHuiAnimatedTexture@@IAEXXZ @ 129 NONAME ; void CHuiAnimatedTexture::BaseConstructL(void)
+	?BaseConstructL@CHuiControl@@MAEXXZ @ 130 NONAME ; void CHuiControl::BaseConstructL(void)
+	?BaseUnit@CHuiGridLayout@@UBE?AUTHuiXYMetric@@XZ @ 131 NONAME ; struct THuiXYMetric CHuiGridLayout::BaseUnit(void) const
+	?BaseUnit@CHuiLayout@@UBE?AUTHuiXYMetric@@XZ @ 132 NONAME ; struct THuiXYMetric CHuiLayout::BaseUnit(void) const
+	?BeginDraw@CHuiBrush@@UBEXAAVCHuiGc@@ABVMHuiBrushGuide@@@Z @ 133 NONAME ; void CHuiBrush::BeginDraw(class CHuiGc &, class MHuiBrushGuide const &) const
+	?Bind@MHuiSegmentedTexture@@QBEXHH@Z @ 134 NONAME ; void MHuiSegmentedTexture::Bind(int, int) const
+	?BindDisplay@CHuiControl@@QAEXAAVCHuiDisplay@@@Z @ 135 NONAME ; void CHuiControl::BindDisplay(class CHuiDisplay &)
+	?BlankTexture@CHuiTextureManager@@QAEAAVCHuiTexture@@XZ @ 136 NONAME ; class CHuiTexture & CHuiTextureManager::BlankTexture(void)
+	?BlankTexture@CHuiTextureManager@@QBEABVCHuiTexture@@XZ @ 137 NONAME ; class CHuiTexture const & CHuiTextureManager::BlankTexture(void) const
+	?BorderDrawingEnabled@CHuiImageBrush@@QBEHXZ @ 138 NONAME ; int CHuiImageBrush::BorderDrawingEnabled(void) const
+	?BottomRight@THuiImage@@QBE?AVTHuiRealPoint@@XZ @ 139 NONAME ; class THuiRealPoint THuiImage::BottomRight(void) const
+	?Bounds@CHuiControl@@QBE?AVTRect@@XZ @ 140 NONAME ; class TRect CHuiControl::Bounds(void) const
+	?BoxMetricToPixelRect@CHuiVisual@@QBEXABUTHuiBoxMetric@@AAVTHuiRealRect@@@Z @ 141 NONAME ; void CHuiVisual::BoxMetricToPixelRect(struct THuiBoxMetric const &, class THuiRealRect &) const
+	?BroadcastEventL@CHuiEnv@@QAEXABVTHuiEvent@@@Z @ 142 NONAME ; void CHuiEnv::BroadcastEventL(class THuiEvent const &)
+	?BrushExtension@CHuiBrush@@MAEXABVTUid@@PAPAX@Z @ 143 NONAME ; void CHuiBrush::BrushExtension(class TUid const &, void * *)
+	?BrushOpacity@CHuiLayout@@UBEMXZ @ 144 NONAME ; float CHuiLayout::BrushOpacity(void) const
+	?BrushOpacity@CHuiVisual@@UBEMXZ @ 145 NONAME ; float CHuiVisual::BrushOpacity(void) const
+	?BrushRect@CHuiLayout@@UBE?AVTHuiRealRect@@XZ @ 146 NONAME ; class THuiRealRect CHuiLayout::BrushRect(void) const
+	?BrushRect@CHuiVisual@@UBE?AVTHuiRealRect@@XZ @ 147 NONAME ; class THuiRealRect CHuiVisual::BrushRect(void) const
+	?BrushSkin@CHuiLayout@@UBEAAVCHuiSkin@@XZ @ 148 NONAME ; class CHuiSkin & CHuiLayout::BrushSkin(void) const
+	?BrushSkin@CHuiVisual@@UBEAAVCHuiSkin@@XZ @ 149 NONAME ; class CHuiSkin & CHuiVisual::BrushSkin(void) const
+	?Brushes@CHuiVisual@@QAEPAVCHuiBrushArray@@XZ @ 150 NONAME ; class CHuiBrushArray * CHuiVisual::Brushes(void)
+	?CancelAllCommands@CHuiControl@@QAEXXZ @ 151 NONAME ; void CHuiControl::CancelAllCommands(void)
+	?CancelCommands@CHuiEnv@@QAEXPAVMHuiEventHandler@@@Z @ 152 NONAME ; void CHuiEnv::CancelCommands(class MHuiEventHandler *)
+	?CancelCommands@CHuiEnv@@QAEXPAX@Z @ 153 NONAME ; void CHuiEnv::CancelCommands(void *)
+	?CancelCommands@CHuiEnv@@QAEXPAXW4THuiCommandType@@H@Z @ 154 NONAME ; void CHuiEnv::CancelCommands(void *, enum THuiCommandType, int)
+	?CancelCommands@CHuiEnv@@QAEXPAXW4THuiOp@@@Z @ 155 NONAME ; void CHuiEnv::CancelCommands(void *, enum THuiOp)
+	?CaptureLC@CHuiDisplay@@QBEPAEAAVTSize@@@Z @ 156 NONAME ; unsigned char * CHuiDisplay::CaptureLC(class TSize &) const
+	?Category@THuiFont@@QBE?AW4TAknFontCategory@@XZ @ 157 NONAME ; enum TAknFontCategory THuiFont::Category(void) const
+	?CenterDrawingEnabled@CHuiImageBrush@@QBEHXZ @ 158 NONAME ; int CHuiImageBrush::CenterDrawingEnabled(void) const
+	?Changed@CHuiBrush@@UBEHXZ @ 159 NONAME ; int CHuiBrush::Changed(void) const
+	?Changed@CHuiGridLayout@@UBEHXZ @ 160 NONAME ; int CHuiGridLayout::Changed(void) const
+	?Changed@CHuiLayout@@UBEHXZ @ 161 NONAME ; int CHuiLayout::Changed(void) const
+	?Changed@CHuiVisual@@UBEHXZ @ 162 NONAME ; int CHuiVisual::Changed(void) const
+	?Changed@THuiImage@@QBEHXZ @ 163 NONAME ; int THuiImage::Changed(void) const
+	?ChildOrdinal@CHuiGridLayout@@UAEHH@Z @ 164 NONAME ; int CHuiGridLayout::ChildOrdinal(int)
+	?ChildOrdinal@CHuiLayout@@UAEHH@Z @ 165 NONAME ; int CHuiLayout::ChildOrdinal(int)
+	?ChildPos@CHuiAnchorLayout@@UAEHHAAVTPoint@@@Z @ 166 NONAME ; int CHuiAnchorLayout::ChildPos(int, class TPoint &)
+	?ChildPos@CHuiFlowLayout@@UAEHHAAVTPoint@@@Z @ 167 NONAME ; int CHuiFlowLayout::ChildPos(int, class TPoint &)
+	?ChildPos@CHuiGridLayout@@UAEHHAAVTPoint@@@Z @ 168 NONAME ; int CHuiGridLayout::ChildPos(int, class TPoint &)
+	?ChildPos@CHuiLayout@@UAEHHAAVTPoint@@@Z @ 169 NONAME ; int CHuiLayout::ChildPos(int, class TPoint &)
+	?ChildRect@CHuiAnchorLayout@@UAEHHAAVTHuiRealRect@@@Z @ 170 NONAME ; int CHuiAnchorLayout::ChildRect(int, class THuiRealRect &)
+	?ChildRect@CHuiCurvePathLayout@@UAEHHAAVTHuiRealRect@@@Z @ 171 NONAME ; int CHuiCurvePathLayout::ChildRect(int, class THuiRealRect &)
+	?ChildRect@CHuiFlowLayout@@UAEHHAAVTHuiRealRect@@@Z @ 172 NONAME ; int CHuiFlowLayout::ChildRect(int, class THuiRealRect &)
+	?ChildRect@CHuiGridLayout@@UAEHHAAVTHuiRealRect@@@Z @ 173 NONAME ; int CHuiGridLayout::ChildRect(int, class THuiRealRect &)
+	?ChildRect@CHuiLayout@@UAEHHAAVTHuiRealRect@@@Z @ 174 NONAME ; int CHuiLayout::ChildRect(int, class THuiRealRect &)
+	?ChildRect@CHuiViewportLayout@@UAEHHAAVTHuiRealRect@@@Z @ 175 NONAME ; int CHuiViewportLayout::ChildRect(int, class THuiRealRect &)
+	?ChildSize@CHuiAnchorLayout@@UAEHHAAVTSize@@@Z @ 176 NONAME ; int CHuiAnchorLayout::ChildSize(int, class TSize &)
+	?ChildSize@CHuiFlowLayout@@UAEHHAAVTSize@@@Z @ 177 NONAME ; int CHuiFlowLayout::ChildSize(int, class TSize &)
+	?ChildSize@CHuiGridLayout@@UAEHHAAVTSize@@@Z @ 178 NONAME ; int CHuiGridLayout::ChildSize(int, class TSize &)
+	?ChildSize@CHuiLayout@@UAEHHAAVTSize@@@Z @ 179 NONAME ; int CHuiLayout::ChildSize(int, class TSize &)
+	?ClearChanged@CHuiBrush@@UAEXXZ @ 180 NONAME ; void CHuiBrush::ClearChanged(void)
+	?ClearChanged@CHuiGridLayout@@UAEXXZ @ 181 NONAME ; void CHuiGridLayout::ClearChanged(void)
+	?ClearChanged@CHuiLayout@@UAEXXZ @ 182 NONAME ; void CHuiLayout::ClearChanged(void)
+	?ClearChanged@CHuiVisual@@UAEXXZ @ 183 NONAME ; void CHuiVisual::ClearChanged(void)
+	?ClearChanged@THuiImage@@QAEXXZ @ 184 NONAME ; void THuiImage::ClearChanged(void)
+	?ClearChanged@THuiTimedValue@@QAEXXZ @ 185 NONAME ; void THuiTimedValue::ClearChanged(void)
+	?ClearFlag@CHuiVisual@@QAEXW4THuiVisualFlags@@@Z @ 186 NONAME ; void CHuiVisual::ClearFlag(enum THuiVisualFlags)
+	?ClearFlags@CHuiVisual@@QAEXH@Z @ 187 NONAME ; void CHuiVisual::ClearFlags(int)
+	?ClearL@CHuiTexture@@QAEHABVTSize@@ABVTRgb@@@Z @ 188 NONAME ; int CHuiTexture::ClearL(class TSize const &, class TRgb const &)
+	?ClearWithAlphaL@CHuiTexture@@QAEHABVTSize@@ABVTRgb@@E@Z @ 189 NONAME ; int CHuiTexture::ClearWithAlphaL(class TSize const &, class TRgb const &, unsigned char)
+	?ClipToVisual@CHuiBrush@@QBEHXZ @ 190 NONAME ; int CHuiBrush::ClipToVisual(void) const
+	?Clipping@CHuiVisual@@QBEHXZ @ 191 NONAME ; int CHuiVisual::Clipping(void) const
+	?Color@CHuiGradientBrush@@UBE?AVTRgb@@H@Z @ 192 NONAME ; class TRgb CHuiGradientBrush::Color(int) const
+	?ColorLightness@HuiUtil@@SAMABVTRgb@@@Z @ 193 NONAME ; float HuiUtil::ColorLightness(class TRgb const &)
+	?ColumnCount@CHuiGridLayout@@QBEHXZ @ 194 NONAME ; int CHuiGridLayout::ColumnCount(void) const
+	?CombineMaskFbsBitmapL@HuiUtil@@SAXABVCFbsBitmap@@0AAV2@@Z @ 195 NONAME ; void HuiUtil::CombineMaskFbsBitmapL(class CFbsBitmap const &, class CFbsBitmap const &, class CFbsBitmap &)
+	?CommandExtension@THuiActionCommand@@MAEXABVTUid@@PAPAX@Z @ 196 NONAME ; void THuiActionCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@THuiCommand@@MAEXABVTUid@@PAPAX@Z @ 197 NONAME ; void THuiCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@THuiControlCommand@@MAEXABVTUid@@PAPAX@Z @ 198 NONAME ; void THuiControlCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@THuiCustomEventCommand@@MAEXABVTUid@@PAPAX@Z @ 199 NONAME ; void THuiCustomEventCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@THuiGroupCommand@@MAEXABVTUid@@PAPAX@Z @ 200 NONAME ; void THuiGroupCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@THuiImageCommand@@MAEXABVTUid@@PAPAX@Z @ 201 NONAME ; void THuiImageCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@THuiMarkerCommand@@MAEXABVTUid@@PAPAX@Z @ 202 NONAME ; void THuiMarkerCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@THuiObjectCommand@@MAEXABVTUid@@PAPAX@Z @ 203 NONAME ; void THuiObjectCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@THuiPointCommand@@MAEXABVTUid@@PAPAX@Z @ 204 NONAME ; void THuiPointCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@THuiTextCommand@@MAEXABVTUid@@PAPAX@Z @ 205 NONAME ; void THuiTextCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@THuiTransformationCommand@@MAEXABVTUid@@PAPAX@Z @ 206 NONAME ; void THuiTransformationCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@THuiValueCommand@@MAEXABVTUid@@PAPAX@Z @ 207 NONAME ; void THuiValueCommand::CommandExtension(class TUid const &, void * *)
+	?CommandExtension@THuiVisualCommand@@MAEXABVTUid@@PAPAX@Z @ 208 NONAME ; void THuiVisualCommand::CommandExtension(class TUid const &, void * *)
+	?ComponentControl@CHuiDisplayCoeControl@@EBEPAVCCoeControl@@H@Z @ 209 NONAME ; class CCoeControl * CHuiDisplayCoeControl::ComponentControl(int) const
+	?Connection@CHuiControl@@QBEAAV1@H@Z @ 210 NONAME ; class CHuiControl & CHuiControl::Connection(int) const
+	?ConnectionAddedL@CHuiControl@@MAEXPAV1@H@Z @ 211 NONAME ; void CHuiControl::ConnectionAddedL(class CHuiControl *, int)
+	?ConnectionByOrdinal@CHuiControl@@QBEAAV1@H@Z @ 212 NONAME ; class CHuiControl & CHuiControl::ConnectionByOrdinal(int) const
+	?ConnectionCount@CHuiControl@@QBEHXZ @ 213 NONAME ; int CHuiControl::ConnectionCount(void) const
+	?ConnectionOrdinal@CHuiControl@@QBEHH@Z @ 214 NONAME ; int CHuiControl::ConnectionOrdinal(int) const
+	?ConnectionRemoved@CHuiControl@@MAEXPAV1@H@Z @ 215 NONAME ; void CHuiControl::ConnectionRemoved(class CHuiControl *, int)
+	?ConnectionRole@CHuiControl@@QBEHH@Z @ 216 NONAME ; int CHuiControl::ConnectionRole(int) const
+	?ConstructFromResourceL@CHuiDisplayCoeControl@@EAEXAAVTResourceReader@@@Z @ 217 NONAME ; void CHuiDisplayCoeControl::ConstructFromResourceL(class TResourceReader &)
+	?ConstructL@CHuiDisplayCoeControl@@MAEXABVTRect@@H@Z @ 218 NONAME ; void CHuiDisplayCoeControl::ConstructL(class TRect const &, int)
+	?ConstructL@CHuiGridLayout@@UAEXXZ @ 219 NONAME ; void CHuiGridLayout::ConstructL(void)
+	?ConstructL@CHuiLayout@@UAEXXZ @ 220 NONAME ; void CHuiLayout::ConstructL(void)
+	?ConstructL@CHuiS60Skin@@UAEXXZ @ 221 NONAME ; void CHuiS60Skin::ConstructL(void)
+	?ConstructL@CHuiVisual@@UAEXXZ @ 222 NONAME ; void CHuiVisual::ConstructL(void)
+	?ContainerLayout@CHuiControl@@UBEPAVCHuiLayout@@PBV1@@Z @ 223 NONAME ; class CHuiLayout * CHuiControl::ContainerLayout(class CHuiControl const *) const
+	?Context@CHuiS60Skin@@UBEAAVCHuiGc@@XZ @ 224 NONAME ; class CHuiGc & CHuiS60Skin::Context(void) const
+	?Context@CHuiSkin@@UBEAAVCHuiGc@@XZ @ 225 NONAME ; class CHuiGc & CHuiSkin::Context(void) const
+	?ContinueRefresh@CHuiEnv@@QAEXXZ @ 226 NONAME ; void CHuiEnv::ContinueRefresh(void)
+	?ContinueTime@CHuiStatic@@SAXXZ @ 227 NONAME ; void CHuiStatic::ContinueTime(void)
+	?Control@CHuiControlGroup@@QBEAAVCHuiControl@@H@Z @ 228 NONAME ; class CHuiControl & CHuiControlGroup::Control(int) const
+	?Control@THuiControlCommand@@QBEAAVCHuiControl@@XZ @ 229 NONAME ; class CHuiControl & THuiControlCommand::Control(void) const
+	?ControlExtension@CHuiControl@@MAEXABVTUid@@PAPAX@Z @ 230 NONAME ; void CHuiControl::ControlExtension(class TUid const &, void * *)
+	?ControlGroup@CHuiControl@@UBEPAVCHuiControlGroup@@XZ @ 231 NONAME ; class CHuiControlGroup * CHuiControl::ControlGroup(void) const
+	?ControlGroup@CHuiEnv@@QAEAAVCHuiControlGroup@@H@Z @ 232 NONAME ; class CHuiControlGroup & CHuiEnv::ControlGroup(int)
+	?ControlGroup@THuiGroupCommand@@QBEAAVCHuiControlGroup@@XZ @ 233 NONAME ; class CHuiControlGroup & THuiGroupCommand::ControlGroup(void) const
+	?ConvertBitmapToDisplayModeLC@HuiUtil@@SAPAVCFbsBitmap@@ABV2@ABW4TDisplayMode@@@Z @ 234 NONAME ; class CFbsBitmap * HuiUtil::ConvertBitmapToDisplayModeLC(class CFbsBitmap const &, enum TDisplayMode const &)
+	?CopyTextStyleL@CHuiTextStyleManager@@QAEHH@Z @ 235 NONAME ; int CHuiTextStyleManager::CopyTextStyleL(int)
+	?Count@CHuiBrushArray@@QBEHXZ @ 236 NONAME ; int CHuiBrushArray::Count(void) const
+	?Count@CHuiControlGroup@@QBEHXZ @ 237 NONAME ; int CHuiControlGroup::Count(void) const
+	?Count@CHuiGridLayout@@UBEHXZ @ 238 NONAME ; int CHuiGridLayout::Count(void) const
+	?Count@CHuiLayout@@UBEHXZ @ 239 NONAME ; int CHuiLayout::Count(void) const
+	?Count@CHuiTransformation@@QBEHXZ @ 240 NONAME ; int CHuiTransformation::Count(void) const
+	?Count@CHuiVisual@@UBEHXZ @ 241 NONAME ; int CHuiVisual::Count(void) const
+	?CountComponentControls@CHuiDisplayCoeControl@@EBEHXZ @ 242 NONAME ; int CHuiDisplayCoeControl::CountComponentControls(void) const
+	?CreateFontL@THuiFontManager@@QAEHABVTHuiFontSpecification@@@Z @ 243 NONAME ; int THuiFontManager::CreateFontL(class THuiFontSpecification const &)
+	?CreateImageLoaderL@CHuiImageLoaderUtil@@QAEPAVMHuiBitmapProvider@@ABVTAknsItemID@@ABVTDesC16@@HH@Z @ 244 NONAME ; class MHuiBitmapProvider * CHuiImageLoaderUtil::CreateImageLoaderL(class TAknsItemID const &, class TDesC16 const &, int, int)
+	?CreateImageLoaderL@CHuiImageLoaderUtil@@QAEPAVMHuiBitmapProvider@@VTUid@@W4TAknsAppIconType@@@Z @ 245 NONAME ; class MHuiBitmapProvider * CHuiImageLoaderUtil::CreateImageLoaderL(class TUid, enum TAknsAppIconType)
+	?CreateMeshL@CHuiMeshVisual@@QAEXW4THuiMeshType@@@Z @ 246 NONAME ; void CHuiMeshVisual::CreateMeshL(enum THuiMeshType)
+	?CreatePlatformTextStyleL@CHuiTextStyleManager@@QAEHHH@Z @ 247 NONAME ; int CHuiTextStyleManager::CreatePlatformTextStyleL(int, int)
+	?CreateTextureL@CHuiTextureManager@@QAEAAVCHuiTexture@@HPAVMHuiBitmapProvider@@W4THuiTextureUploadFlags@@@Z @ 248 NONAME ; class CHuiTexture & CHuiTextureManager::CreateTextureL(int, class MHuiBitmapProvider *, enum THuiTextureUploadFlags)
+	?CropFbsBitmapL@HuiUtil@@SAXABVCFbsBitmap@@AAV2@VTPoint@@@Z @ 249 NONAME ; void HuiUtil::CropFbsBitmapL(class CFbsBitmap const &, class CFbsBitmap &, class TPoint)
+	?CropImage@HuiUtil@@SAXHABVTSize@@PBEABVTPoint@@0PAE@Z @ 250 NONAME ; void HuiUtil::CropImage(int, class TSize const &, unsigned char const *, class TPoint const &, class TSize const &, unsigned char *)
+	?CrossProduct@HuiUtil@@SAXQBM0QAM@Z @ 251 NONAME ; void HuiUtil::CrossProduct(float const * const, float const * const, float * const)
+	?CurvePath@CHuiCurvePathLayout@@QAEAAVCHuiCurvePath@@XZ @ 252 NONAME ; class CHuiCurvePath & CHuiCurvePathLayout::CurvePath(void)
+	?Data@CHuiStatic@@CAPAUTTlsData@@XZ @ 253 NONAME ; struct TTlsData * CHuiStatic::Data(void)
+	?DefineFileNameL@CHuiTextureManager@@QAEXHABVTDesC16@@@Z @ 254 NONAME ; void CHuiTextureManager::DefineFileNameL(int, class TDesC16 const &)
+	?DeleteControlGroup@CHuiEnv@@QAEHH@Z @ 255 NONAME ; int CHuiEnv::DeleteControlGroup(int)
+	?Detach@CHuiAnchorLayout@@QAEXH@Z @ 256 NONAME ; void CHuiAnchorLayout::Detach(int)
+	?Detach@CHuiAnchorLayout@@QAEXHW4THuiAnchorType@@@Z @ 257 NONAME ; void CHuiAnchorLayout::Detach(int, enum THuiAnchorType)
+	?DimensionCount@CHuiGridLayout@@QBEHW4THuiGridDimension@@@Z @ 258 NONAME ; int CHuiGridLayout::DimensionCount(enum THuiGridDimension) const
+	?Display@CHuiControl@@QBEPAVCHuiDisplay@@XZ @ 259 NONAME ; class CHuiDisplay * CHuiControl::Display(void) const
+	?Display@CHuiDisplayCoeControl@@QAEAAVCHuiDisplay@@XZ @ 260 NONAME ; class CHuiDisplay & CHuiDisplayCoeControl::Display(void)
+	?Display@CHuiVisual@@QBEPAVCHuiDisplay@@XZ @ 261 NONAME ; class CHuiDisplay * CHuiVisual::Display(void) const
+	?Display@THuiEvent@@QBEAAVCHuiDisplay@@XZ @ 262 NONAME ; class CHuiDisplay & THuiEvent::Display(void) const
+	?Display@THuiGroupCommand@@QBEPAVCHuiDisplay@@XZ @ 263 NONAME ; class CHuiDisplay * THuiGroupCommand::Display(void) const
+	?DisplayArea@CHuiControl@@QBE?AVTRect@@XZ @ 264 NONAME ; class TRect CHuiControl::DisplayArea(void) const
+	?DisplayCenter@CHuiControl@@QBE?AVTHuiRealPoint@@XZ @ 265 NONAME ; class THuiRealPoint CHuiControl::DisplayCenter(void) const
+	?DisplayCoeCntrlExtension@CHuiDisplayCoeControl@@MAEXABVTUid@@PAPAX@Z @ 266 NONAME ; void CHuiDisplayCoeControl::DisplayCoeCntrlExtension(class TUid const &, void * *)
+	?DisplayCount@CHuiEnv@@QBEHXZ @ 267 NONAME ; int CHuiEnv::DisplayCount(void) const
+	?DisplayRect@CHuiVisual@@QBE?AVTHuiRealRect@@XZ @ 268 NONAME ; class THuiRealRect CHuiVisual::DisplayRect(void) const
+	?DisplayRectTarget@CHuiVisual@@QBE?AVTHuiRealRect@@XZ @ 269 NONAME ; class THuiRealRect CHuiVisual::DisplayRectTarget(void) const
+	?DisplayToHost@CHuiControl@@QBE?AVTPoint@@ABV2@@Z @ 270 NONAME ; class TPoint CHuiControl::DisplayToHost(class TPoint const &) const
+	?DisplayToLocal@CHuiVisual@@QBE?AVTHuiRealPoint@@ABV2@@Z @ 271 NONAME ; class THuiRealPoint CHuiVisual::DisplayToLocal(class THuiRealPoint const &) const
+	?DisplayToLocal@CHuiVisual@@QBE?AVTPoint@@ABV2@@Z @ 272 NONAME ; class TPoint CHuiVisual::DisplayToLocal(class TPoint const &) const
+	?Draw@CHuiBrush@@UBEXAAVCHuiGc@@ABVMHuiBrushGuide@@@Z @ 273 NONAME ; void CHuiBrush::Draw(class CHuiGc &, class MHuiBrushGuide const &) const
+	?Draw@CHuiBrushArray@@QBEXW4THuiBrushLayer@@AAVCHuiGc@@ABVMHuiBrushGuide@@@Z @ 274 NONAME ; void CHuiBrushArray::Draw(enum THuiBrushLayer, class CHuiGc &, class MHuiBrushGuide const &) const
+	?Draw@CHuiDisplayCoeControl@@EBEXABVTRect@@@Z @ 275 NONAME ; void CHuiDisplayCoeControl::Draw(class TRect const &) const
+	?Draw@CHuiGridLayout@@UBEXAAVCHuiGc@@@Z @ 276 NONAME ; void CHuiGridLayout::Draw(class CHuiGc &) const
+	?Draw@CHuiImageBrush@@UBEXAAVCHuiGc@@ABVMHuiBrushGuide@@@Z @ 277 NONAME ; void CHuiImageBrush::Draw(class CHuiGc &, class MHuiBrushGuide const &) const
+	?Draw@CHuiLayout@@UBEXAAVCHuiGc@@@Z @ 278 NONAME ; void CHuiLayout::Draw(class CHuiGc &) const
+	?Draw@CHuiVisual@@UBEXAAVCHuiGc@@@Z @ 279 NONAME ; void CHuiVisual::Draw(class CHuiGc &) const
+	?DrawBrushes@CHuiVisual@@QBEXAAVCHuiGc@@W4THuiBrushLayer@@@Z @ 280 NONAME ; void CHuiVisual::DrawBrushes(class CHuiGc &, enum THuiBrushLayer) const
+	?DrawImage@CHuiGc@@UAEXABVTHuiImage@@ABVTHuiRealPoint@@ABVTHuiRealSize@@@Z @ 281 NONAME ; void CHuiGc::DrawImage(class THuiImage const &, class THuiRealPoint const &, class THuiRealSize const &)
+	?DrawImage@CHuiGc@@UAEXABVTHuiImage@@ABVTHuiRealRect@@@Z @ 282 NONAME ; void CHuiGc::DrawImage(class THuiImage const &, class THuiRealRect const &)
+	?DrawImage@CHuiGc@@UAEXABVTHuiImage@@ABVTHuiRealSize@@ABVTHuiRealRect@@@Z @ 283 NONAME ; void CHuiGc::DrawImage(class THuiImage const &, class THuiRealSize const &, class THuiRealRect const &)
+	?DrawImages@CHuiGc@@UAEXABVTHuiImage@@0ABVTHuiRealPoint@@ABVTHuiRealSize@@@Z @ 284 NONAME ; void CHuiGc::DrawImages(class THuiImage const &, class THuiImage const &, class THuiRealPoint const &, class THuiRealSize const &)
+	?DrawImages@CHuiGc@@UAEXABVTHuiImage@@0ABVTHuiRealSize@@ABVTHuiRealRect@@@Z @ 285 NONAME ; void CHuiGc::DrawImages(class THuiImage const &, class THuiImage const &, class THuiRealSize const &, class THuiRealRect const &)
+	?DrawSelf@CHuiGridLayout@@UBEXAAVCHuiGc@@ABVTRect@@@Z @ 286 NONAME ; void CHuiGridLayout::DrawSelf(class CHuiGc &, class TRect const &) const
+	?DrawSelf@CHuiLayout@@MBEXAAVCHuiGc@@ABVTRect@@@Z @ 287 NONAME ; void CHuiLayout::DrawSelf(class CHuiGc &, class TRect const &) const
+	?DrawSelf@CHuiVisual@@UBEXAAVCHuiGc@@ABVTRect@@@Z @ 288 NONAME ; void CHuiVisual::DrawSelf(class CHuiGc &, class TRect const &) const
+	?DumpTree@CHuiGridLayout@@UBEXXZ @ 289 NONAME ; void CHuiGridLayout::DumpTree(void) const
+	?DumpTree@CHuiLayout@@UBEXXZ @ 290 NONAME ; void CHuiLayout::DumpTree(void) const
+	?DumpTree@CHuiVisual@@UBEXXZ @ 291 NONAME ; void CHuiVisual::DumpTree(void) const
+	?EffectiveLayoutOrdinal@CHuiLayout@@QBEHABVCHuiVisual@@@Z @ 292 NONAME ; int CHuiLayout::EffectiveLayoutOrdinal(class CHuiVisual const &) const
+	?EffectiveOpacity@CHuiVisual@@QBEMXZ @ 293 NONAME ; float CHuiVisual::EffectiveOpacity(void) const
+	?ElapsedSeconds@CHuiStatic@@SAMXZ @ 294 NONAME ; float CHuiStatic::ElapsedSeconds(void)
+	?EnableBrushesL@CHuiVisual@@QAEXH@Z @ 295 NONAME ; void CHuiVisual::EnableBrushesL(int)
+	?EnableClock@THuiTimedValue@@QAEXH@Z @ 296 NONAME ; void THuiTimedValue::EnableClock(int)
+	?EnableLogging@CHuiStatic@@SAXH@Z @ 297 NONAME ; void CHuiStatic::EnableLogging(int)
+	?EnableLoop@CHuiCurvePath@@QAEXH@Z @ 298 NONAME ; void CHuiCurvePath::EnableLoop(int)
+	?EnableScrollingL@CHuiLayout@@QAEXH@Z @ 299 NONAME ; void CHuiLayout::EnableScrollingL(int)
+	?EnableShadow@CHuiTextVisual@@QAEXH@Z @ 300 NONAME ; void CHuiTextVisual::EnableShadow(int)
+	?EnableShadow@CHuiTexture@@UAEXH@Z @ 301 NONAME ; void CHuiTexture::EnableShadow(int)
+	?EnableTransformationL@CHuiControlGroup@@QAEXH@Z @ 302 NONAME ; void CHuiControlGroup::EnableTransformationL(int)
+	?EnableTransformationL@CHuiVisual@@QAEXH@Z @ 303 NONAME ; void CHuiVisual::EnableTransformationL(int)
+	?EndDraw@CHuiBrush@@UBEXAAVCHuiGc@@ABVMHuiBrushGuide@@@Z @ 304 NONAME ; void CHuiBrush::EndDraw(class CHuiGc &, class MHuiBrushGuide const &) const
+	?EnterLocalProjection@CHuiVisual@@QBEXAAVCHuiGc@@HMPBVTHuiRealRect@@@Z @ 305 NONAME ; void CHuiVisual::EnterLocalProjection(class CHuiGc &, int, float, class THuiRealRect const *) const
+	?EnterView@CHuiSoftKeyControl@@QAEXI@Z @ 306 NONAME ; void CHuiSoftKeyControl::EnterView(unsigned int)
+	?EnumerateFontsL@THuiFontManager@@QBEXAAV?$RArray@VTHuiFontSpecification@@@@@Z @ 307 NONAME ; void THuiFontManager::EnumerateFontsL(class RArray<class THuiFontSpecification> &) const
+	?Env@CHuiControl@@UBEAAVCHuiEnv@@XZ @ 308 NONAME ; class CHuiEnv & CHuiControl::Env(void) const
+	?Env@CHuiDisplay@@QAEAAVCHuiEnv@@XZ @ 309 NONAME ; class CHuiEnv & CHuiDisplay::Env(void)
+	?Env@CHuiDisplayCoeControl@@QAEAAVCHuiEnv@@XZ @ 310 NONAME ; class CHuiEnv & CHuiDisplayCoeControl::Env(void)
+	?Env@CHuiStatic@@SAAAVCHuiEnv@@XZ @ 311 NONAME ; class CHuiEnv & CHuiStatic::Env(void)
+	?Env@CHuiTextureManager@@QAEAAVCHuiEnv@@XZ @ 312 NONAME ; class CHuiEnv & CHuiTextureManager::Env(void)
+	?Env@CHuiVisual@@QBEAAVCHuiEnv@@XZ @ 313 NONAME ; class CHuiEnv & CHuiVisual::Env(void) const
+	?Evaluate@CHuiCurvePath@@QBEXMAAVTHuiRealPoint@@@Z @ 314 NONAME ; void CHuiCurvePath::Evaluate(float, class THuiRealPoint &) const
+	?EventHandler@CHuiControl@@UAEPAVMHuiEventHandler@@XZ @ 315 NONAME ; class MHuiEventHandler * CHuiControl::EventHandler(void)
+	?Execute@CHuiTransformation@@QBEXW4THuiGcMatrix@@AAVCHuiGc@@@Z @ 316 NONAME ; void CHuiTransformation::Execute(enum THuiGcMatrix, class CHuiGc &) const
+	?ExecuteL@THuiActionCommand@@UBEXAAVCHuiEnv@@@Z @ 317 NONAME ; void THuiActionCommand::ExecuteL(class CHuiEnv &) const
+	?ExecuteL@THuiControlCommand@@UBEXAAVCHuiEnv@@@Z @ 318 NONAME ; void THuiControlCommand::ExecuteL(class CHuiEnv &) const
+	?ExecuteL@THuiCustomEventCommand@@UBEXAAVCHuiEnv@@@Z @ 319 NONAME ; void THuiCustomEventCommand::ExecuteL(class CHuiEnv &) const
+	?ExecuteL@THuiGroupCommand@@UBEXAAVCHuiEnv@@@Z @ 320 NONAME ; void THuiGroupCommand::ExecuteL(class CHuiEnv &) const
+	?ExecuteL@THuiImageCommand@@UBEXAAVCHuiEnv@@@Z @ 321 NONAME ; void THuiImageCommand::ExecuteL(class CHuiEnv &) const
+	?ExecuteL@THuiMarkerCommand@@UBEXAAVCHuiEnv@@@Z @ 322 NONAME ; void THuiMarkerCommand::ExecuteL(class CHuiEnv &) const
+	?ExecuteL@THuiObjectCommand@@UBEXAAVCHuiEnv@@@Z @ 323 NONAME ; void THuiObjectCommand::ExecuteL(class CHuiEnv &) const
+	?ExecuteL@THuiPointCommand@@UBEXAAVCHuiEnv@@@Z @ 324 NONAME ; void THuiPointCommand::ExecuteL(class CHuiEnv &) const
+	?ExecuteL@THuiTextCommand@@UBEXAAVCHuiEnv@@@Z @ 325 NONAME ; void THuiTextCommand::ExecuteL(class CHuiEnv &) const
+	?ExecuteL@THuiTransformationCommand@@UBEXAAVCHuiEnv@@@Z @ 326 NONAME ; void THuiTransformationCommand::ExecuteL(class CHuiEnv &) const
+	?ExecuteL@THuiValueCommand@@UBEXAAVCHuiEnv@@@Z @ 327 NONAME ; void THuiValueCommand::ExecuteL(class CHuiEnv &) const
+	?ExecuteL@THuiVisualCommand@@UBEXAAVCHuiEnv@@@Z @ 328 NONAME ; void THuiVisualCommand::ExecuteL(class CHuiEnv &) const
+	?ExitView@CHuiSoftKeyControl@@QAEXI@Z @ 329 NONAME ; void CHuiSoftKeyControl::ExitView(unsigned int)
+	?ExpandRectWithContent@CHuiGridLayout@@UBEXAAVTRect@@@Z @ 330 NONAME ; void CHuiGridLayout::ExpandRectWithContent(class TRect &) const
+	?ExpandRectWithContent@CHuiLayout@@MBEXAAVTRect@@@Z @ 331 NONAME ; void CHuiLayout::ExpandRectWithContent(class TRect &) const
+	?ExpandRectWithContent@CHuiVisual@@MBEXAAVTRect@@@Z @ 332 NONAME ; void CHuiVisual::ExpandRectWithContent(class TRect &) const
+	?ExpandVisualRect@CHuiBrush@@UBEXAAVTRect@@@Z @ 333 NONAME ; void CHuiBrush::ExpandVisualRect(class TRect &) const
+	?ExpandVisualRect@CHuiImageBrush@@UBEXAAVTRect@@@Z @ 334 NONAME ; void CHuiImageBrush::ExpandVisualRect(class TRect &) const
+	?FarClipDistance@CHuiGc@@QBEMXZ @ 335 NONAME ; float CHuiGc::FarClipDistance(void) const
+	?FillWeightsL@CHuiGridLayout@@QAEXW4THuiGridDimension@@HABUTHuiMetric@@@Z @ 336 NONAME ; void CHuiGridLayout::FillWeightsL(enum THuiGridDimension, int, struct THuiMetric const &)
+	?FindConnection@CHuiControl@@QBEHPBV1@@Z @ 337 NONAME ; int CHuiControl::FindConnection(class CHuiControl const *) const
+	?FindControl@CHuiControlGroup@@QBEPAVCHuiControl@@H@Z @ 338 NONAME ; class CHuiControl * CHuiControlGroup::FindControl(int) const
+	?FindControl@CHuiEnv@@QBEPAVCHuiControl@@H@Z @ 339 NONAME ; class CHuiControl * CHuiEnv::FindControl(int) const
+	?FindTag@CHuiControl@@QBEPAVCHuiVisual@@ABVTDesC8@@@Z @ 340 NONAME ; class CHuiVisual * CHuiControl::FindTag(class TDesC8 const &) const
+	?FindTag@CHuiGridLayout@@UAEPAVCHuiVisual@@ABVTDesC8@@@Z @ 341 NONAME ; class CHuiVisual * CHuiGridLayout::FindTag(class TDesC8 const &)
+	?FindTag@CHuiLayout@@UAEPAVCHuiVisual@@ABVTDesC8@@@Z @ 342 NONAME ; class CHuiVisual * CHuiLayout::FindTag(class TDesC8 const &)
+	?FindTag@CHuiVisual@@UAEPAV1@ABVTDesC8@@@Z @ 343 NONAME ; class CHuiVisual * CHuiVisual::FindTag(class TDesC8 const &)
+	?FindVisual@CHuiLayout@@QBEHPBVCHuiVisual@@@Z @ 344 NONAME ; int CHuiLayout::FindVisual(class CHuiVisual const *) const
+	?Finish@THuiTimedPoint@@QAEXXZ @ 345 NONAME ; void THuiTimedPoint::Finish(void)
+	?Finish@THuiTimedValue@@QAEXXZ @ 346 NONAME ; void THuiTimedValue::Finish(void)
+	?FixCos@HuiFixMath@@SAHH@Z @ 347 NONAME ; int HuiFixMath::FixCos(int)
+	?FixHypot@HuiFixMath@@SAIHH@Z @ 348 NONAME ; unsigned int HuiFixMath::FixHypot(int, int)
+	?FixSin@HuiFixMath@@SAHH@Z @ 349 NONAME ; int HuiFixMath::FixSin(int)
+	?FlagsToClear@THuiVisualCommand@@QBEHXZ @ 350 NONAME ; int THuiVisualCommand::FlagsToClear(void) const
+	?FlagsToSet@THuiVisualCommand@@QBEHXZ @ 351 NONAME ; int THuiVisualCommand::FlagsToSet(void) const
+	?Focus@CHuiControl@@QBEHXZ @ 352 NONAME ; int CHuiControl::Focus(void) const
+	?FocusChanged@CHuiControl@@UAEXAAVCHuiDisplay@@H@Z @ 353 NONAME ; void CHuiControl::FocusChanged(class CHuiDisplay &, int)
+	?FocusChanged@CHuiDisplayCoeControl@@EAEXW4TDrawNow@@@Z @ 354 NONAME ; void CHuiDisplayCoeControl::FocusChanged(enum TDrawNow)
+	?Font@CHuiGc@@QAEPAVTHuiFont@@XZ @ 355 NONAME ; class THuiFont * CHuiGc::Font(void)
+	?Font@THuiTextStyle@@QAEAAVTHuiFont@@XZ @ 356 NONAME ; class THuiFont & THuiTextStyle::Font(void)
+	?Font@THuiTextStyle@@QBEABVTHuiFont@@XZ @ 357 NONAME ; class THuiFont const & THuiTextStyle::Font(void) const
+	?FontManager@CHuiEnv@@QBEAAVTHuiFontManager@@XZ @ 358 NONAME ; class THuiFontManager & CHuiEnv::FontManager(void) const
+	?FontSpec@THuiFont@@QBE?AVTFontSpec@@PAVMGraphicsDeviceMap@@@Z @ 359 NONAME ; class TFontSpec THuiFont::FontSpec(class MGraphicsDeviceMap *) const
+	?FontStyleId@THuiTextStyle@@QBEHXZ @ 360 NONAME ; int THuiTextStyle::FontStyleId(void) const
+	?FovFactor@CHuiGc@@QBEMXZ @ 361 NONAME ; float CHuiGc::FovFactor(void) const
+	?FrameCount@CHuiStatic@@SAIXZ @ 362 NONAME ; unsigned int CHuiStatic::FrameCount(void)
+	?FrameRate@CHuiStatic@@SAMXZ @ 363 NONAME ; float CHuiStatic::FrameRate(void)
+	?FreeMemory@HuiUtil@@SAIPAI@Z @ 364 NONAME ; unsigned int HuiUtil::FreeMemory(unsigned int *)
+	?FsSession@CHuiStatic@@SAAAVRFs@@XZ @ 365 NONAME ; class RFs & CHuiStatic::FsSession(void)
+	?GetClassName@CHuiGridLayout@@UBEXAAVTDes16@@@Z @ 366 NONAME ; void CHuiGridLayout::GetClassName(class TDes16 &) const
+	?GetClassName@CHuiLayout@@UBEXAAVTDes16@@@Z @ 367 NONAME ; void CHuiLayout::GetClassName(class TDes16 &) const
+	?GetClassName@CHuiVisual@@UBEXAAVTDes16@@@Z @ 368 NONAME ; void CHuiVisual::GetClassName(class TDes16 &) const
+	?GetInstanceName@CHuiGridLayout@@UBEXAAVTDes16@@@Z @ 369 NONAME ; void CHuiGridLayout::GetInstanceName(class TDes16 &) const
+	?GetInstanceName@CHuiLayout@@UBEXAAVTDes16@@@Z @ 370 NONAME ; void CHuiLayout::GetInstanceName(class TDes16 &) const
+	?GetInstanceName@CHuiVisual@@UBEXAAVTDes16@@@Z @ 371 NONAME ; void CHuiVisual::GetInstanceName(class TDes16 &) const
+	?GetTexCoords@THuiImage@@QBEXPAMH@Z @ 372 NONAME ; void THuiImage::GetTexCoords(float *, int) const
+	?GetTexture@CHuiS60Skin@@UAEHHAAPBVCHuiTexture@@@Z @ 373 NONAME ; int CHuiS60Skin::GetTexture(int, class CHuiTexture const * &)
+	?GetTexture@CHuiSkin@@UAEHHAAPBVCHuiTexture@@@Z @ 374 NONAME ; int CHuiSkin::GetTexture(int, class CHuiTexture const * &)
+	?GetTypeface@THuiTextStyle@@QBEXAAVTTypeface@@@Z @ 375 NONAME ; void THuiTextStyle::GetTypeface(class TTypeface &) const
+	?GetVertexCoords@THuiImage@@QBEXPAFH@Z @ 376 NONAME ; void THuiImage::GetVertexCoords(short *, int) const
+	?Handle@MHuiSegmentedTexture@@QBE?AVTHuiTextureHandle@@H@Z @ 377 NONAME ; class THuiTextureHandle MHuiSegmentedTexture::Handle(int) const
+	?HandleControlEventL@CHuiDisplayCoeControl@@EAEXPAVCCoeControl@@W4TCoeEvent@MCoeControlObserver@@@Z @ 378 NONAME ; void CHuiDisplayCoeControl::HandleControlEventL(class CCoeControl *, enum MCoeControlObserver::TCoeEvent)
+	?HandleKeyEventL@CHuiEnv@@QAEHABUTKeyEvent@@W4TEventCode@@PAVCHuiDisplay@@@Z @ 379 NONAME ; int CHuiEnv::HandleKeyEventL(struct TKeyEvent const &, enum TEventCode, class CHuiDisplay *)
+	?HandlePointerEventL@CHuiDisplayCoeControl@@MAEXABUTPointerEvent@@@Z @ 380 NONAME ; void CHuiDisplayCoeControl::HandlePointerEventL(struct TPointerEvent const &)
+	?HandleResourceChange@CHuiDisplayCoeControl@@EAEXH@Z @ 381 NONAME ; void CHuiDisplayCoeControl::HandleResourceChange(int)
+	?HasContent@CHuiAnimatedTexture@@UBEHXZ @ 382 NONAME ; int CHuiAnimatedTexture::HasContent(void) const
+	?HasContent@CHuiTexture@@UBEHXZ @ 383 NONAME ; int CHuiTexture::HasContent(void) const
+	?HasContent@THuiTextureHandle@@UBEHXZ @ 384 NONAME ; int THuiTextureHandle::HasContent(void) const
+	?HasShadow@THuiImage@@QBEHXZ @ 385 NONAME ; int THuiImage::HasShadow(void) const
+	?HasTexture@THuiImage@@QBEHXZ @ 386 NONAME ; int THuiImage::HasTexture(void) const
+	?HitTest@CHuiControl@@QBEHABVTPoint@@@Z @ 387 NONAME ; int CHuiControl::HitTest(class TPoint const &) const
+	?HorizontalInnerPadding@CHuiLayout@@QBEHXZ @ 388 NONAME ; int CHuiLayout::HorizontalInnerPadding(void) const
+	?HorizontalOrigin@CHuiVisual@@QBE?AW4THuiVisualHOrigin@@XZ @ 389 NONAME ; enum THuiVisualHOrigin CHuiVisual::HorizontalOrigin(void) const
+	?Host@CHuiControl@@QBEPAV1@XZ @ 390 NONAME ; class CHuiControl * CHuiControl::Host(void) const
+	?HostChangingL@CHuiControl@@MAEXPAV1@@Z @ 391 NONAME ; void CHuiControl::HostChangingL(class CHuiControl *)
+	?HostId@CHuiControl@@QBEHXZ @ 392 NONAME ; int CHuiControl::HostId(void) const
+	?HostToDisplay@CHuiControl@@QBE?AVTPoint@@ABV2@@Z @ 393 NONAME ; class TPoint CHuiControl::HostToDisplay(class TPoint const &) const
+	?Id@CHuiControl@@QBEHXZ @ 394 NONAME ; int CHuiControl::Id(void) const
+	?Id@CHuiGifAnimationTexture@@QAEHXZ @ 395 NONAME ; int CHuiGifAnimationTexture::Id(void)
+	?Id@THuiActionCommand@@QBEHXZ @ 396 NONAME ; int THuiActionCommand::Id(void) const
+	?Id@THuiFont@@QBEHXZ @ 397 NONAME ; int THuiFont::Id(void) const
+	?Id@THuiMarkerCommand@@QBEHXZ @ 398 NONAME ; int THuiMarkerCommand::Id(void) const
+	?Id@THuiTextStyle@@QBEHXZ @ 399 NONAME ; int THuiTextStyle::Id(void) const
+	?Image@CHuiGradientBrush@@UBEABVTHuiImage@@XZ @ 400 NONAME ; class THuiImage const & CHuiGradientBrush::Image(void) const
+	?Image@CHuiImageVisual@@QBEABVTHuiImage@@XZ @ 401 NONAME ; class THuiImage const & CHuiImageVisual::Image(void) const
+	?Image@THuiImageCommand@@QBEABVTHuiImage@@XZ @ 402 NONAME ; class THuiImage const & THuiImageCommand::Image(void) const
+	?ImageFileName@CHuiTexture@@QBEABVTDesC16@@XZ @ 403 NONAME ; class TDesC16 const & CHuiTexture::ImageFileName(void) const
+	?ImageLoaderExtension@CHuiImageLoaderUtil@@UAEXABVTUid@@PAPAX@Z @ 404 NONAME ; void CHuiImageLoaderUtil::ImageLoaderExtension(class TUid const &, void * *)
+	?ImagePath@CHuiTextureManager@@QBEABVTDesC16@@XZ @ 405 NONAME ; class TDesC16 const & CHuiTextureManager::ImagePath(void) const
+	?ImageVisual@THuiImageCommand@@QBEAAVCHuiImageVisual@@XZ @ 406 NONAME ; class CHuiImageVisual & THuiImageCommand::ImageVisual(void) const
+	?InnerPadding@CHuiLayout@@QBEABUTHuiXYMetric@@XZ @ 407 NONAME ; struct THuiXYMetric const & CHuiLayout::InnerPadding(void) const
+	?InnerPaddingInBaseUnits@CHuiLayout@@QBE?AVTHuiRealPoint@@XZ @ 408 NONAME ; class THuiRealPoint CHuiLayout::InnerPaddingInBaseUnits(void) const
+	?InnerSize@CHuiLayout@@QBE?AVTHuiRealSize@@XZ @ 409 NONAME ; class THuiRealSize CHuiLayout::InnerSize(void) const
+	?InnerTopLeft@CHuiLayout@@QBE?AVTHuiRealPoint@@XZ @ 410 NONAME ; class THuiRealPoint CHuiLayout::InnerTopLeft(void) const
+	?InputCapabilities@CHuiDisplayCoeControl@@EBE?AVTCoeInputCapabilities@@XZ @ 411 NONAME ; class TCoeInputCapabilities CHuiDisplayCoeControl::InputCapabilities(void) const
+	?InsertL@CHuiBrushArray@@QAEXHPAVCHuiBrush@@W4THuiOwnership@@@Z @ 412 NONAME ; void CHuiBrushArray::InsertL(int, class CHuiBrush *, enum THuiOwnership)
+	?InsertL@CHuiLayout@@QAEXPAVCHuiVisual@@HH@Z @ 413 NONAME ; void CHuiLayout::InsertL(class CHuiVisual *, int, int)
+	?InsertWeightL@CHuiGridLayout@@QAEXW4THuiGridDimension@@ABUTHuiMetric@@H@Z @ 414 NONAME ; void CHuiGridLayout::InsertWeightL(enum THuiGridDimension, struct THuiMetric const &, int)
+	?Interpolate@HuiUtil@@SAMMMM@Z @ 415 NONAME ; float HuiUtil::Interpolate(float, float, float)
+	?Interval@THuiInteractionInterval@@QAEHH@Z @ 416 NONAME ; int THuiInteractionInterval::Interval(int)
+	?IsCustomEvent@THuiEvent@@QBEHXZ @ 417 NONAME ; int THuiEvent::IsCustomEvent(void) const
+	?IsFocusing@CHuiControl@@UBEHXZ @ 418 NONAME ; int CHuiControl::IsFocusing(void) const
+	?IsKeyEvent@THuiEvent@@QBEHXZ @ 419 NONAME ; int THuiEvent::IsKeyEvent(void) const
+	?IsLoaded@CHuiTextureManager@@QBEHABVTDesC16@@H@Z @ 420 NONAME ; int CHuiTextureManager::IsLoaded(class TDesC16 const &, int) const
+	?IsLoaded@CHuiTextureManager@@QBEHH@Z @ 421 NONAME ; int CHuiTextureManager::IsLoaded(int) const
+	?IsLoaded@CHuiTextureManager@@QBEHPBVCHuiTexture@@@Z @ 422 NONAME ; int CHuiTextureManager::IsLoaded(class CHuiTexture const *) const
+	?IsNull@THuiTextureHandle@@QBEHXZ @ 423 NONAME ; int THuiTextureHandle::IsNull(void) const
+	?IsPointerEvent@THuiEvent@@QBEHXZ @ 424 NONAME ; int THuiEvent::IsPointerEvent(void) const
+	?IsShadowEnabled@CHuiTexture@@UBEHXZ @ 425 NONAME ; int CHuiTexture::IsShadowEnabled(void) const
+	?IsSkinContent@CHuiTexture@@UBEHXZ @ 426 NONAME ; int CHuiTexture::IsSkinContent(void) const
+	?IsTagged@CHuiVisual@@QBEHXZ @ 427 NONAME ; int CHuiVisual::IsTagged(void) const
+	?IsTransformed@CHuiControlGroup@@QBEHXZ @ 428 NONAME ; int CHuiControlGroup::IsTransformed(void) const
+	?Layer@CHuiBrush@@QBE?AW4THuiBrushLayer@@XZ @ 429 NONAME ; enum THuiBrushLayer CHuiBrush::Layer(void) const
+	?LayerBrushCount@CHuiBrushArray@@QBEHW4THuiBrushLayer@@@Z @ 430 NONAME ; int CHuiBrushArray::LayerBrushCount(enum THuiBrushLayer) const
+	?Layout@CHuiVisual@@QBEPAVCHuiLayout@@XZ @ 431 NONAME ; class CHuiLayout * CHuiVisual::Layout(void) const
+	?LayoutTransitionTime@CHuiStatic@@SAHXZ @ 432 NONAME ; int CHuiStatic::LayoutTransitionTime(void)
+	?Length@CHuiCurvePath@@QBEMXZ @ 433 NONAME ; float CHuiCurvePath::Length(void) const
+	?LengthUnit@HuiUtil@@SAMXZ @ 434 NONAME ; float HuiUtil::LengthUnit(void)
+	?LoadBitmapsL@CHuiEnv@@QAEXH@Z @ 435 NONAME ; void CHuiEnv::LoadBitmapsL(int)
+	?LoadControlGroupL@CHuiEnv@@QAEAAVCHuiControlGroup@@H@Z @ 436 NONAME ; class CHuiControlGroup & CHuiEnv::LoadControlGroupL(int)
+	?LoadIdentity@CHuiTransformation@@QAEXXZ @ 437 NONAME ; void CHuiTransformation::LoadIdentity(void)
+	?LoadQueueCount@CHuiTextureManager@@QBEHXZ @ 438 NONAME ; int CHuiTextureManager::LoadQueueCount(void) const
+	?LoadSceneL@CHuiM3GMesh@@UAEXABVTDesC16@@@Z @ 439 NONAME ; void CHuiM3GMesh::LoadSceneL(class TDesC16 const &)
+	?LoadTextureL@CHuiTextureManager@@QAEAAVCHuiTexture@@ABVTDesC16@@ABVTSize@@W4THuiTextureUploadFlags@@HH@Z @ 440 NONAME ; class CHuiTexture & CHuiTextureManager::LoadTextureL(class TDesC16 const &, class TSize const &, enum THuiTextureUploadFlags, int, int)
+	?LoadTextureL@CHuiTextureManager@@QAEAAVCHuiTexture@@ABVTDesC16@@W4THuiTextureUploadFlags@@HH@Z @ 441 NONAME ; class CHuiTexture & CHuiTextureManager::LoadTextureL(class TDesC16 const &, enum THuiTextureUploadFlags, int, int)
+	?LoadTextureL@CHuiTextureManager@@QAEAAVCHuiTexture@@HABVTSize@@W4THuiTextureUploadFlags@@@Z @ 442 NONAME ; class CHuiTexture & CHuiTextureManager::LoadTextureL(int, class TSize const &, enum THuiTextureUploadFlags)
+	?LocalBaseUnit@CHuiVisual@@QBE?AUTHuiXYMetric@@XZ @ 443 NONAME ; struct THuiXYMetric CHuiVisual::LocalBaseUnit(void) const
+	?LocalPointInPixels@CHuiVisual@@QBE?AVTHuiRealPoint@@ABV2@@Z @ 444 NONAME ; class THuiRealPoint CHuiVisual::LocalPointInPixels(class THuiRealPoint const &) const
+	?LocalToDisplay@CHuiVisual@@QBE?AVTHuiRealPoint@@ABV2@@Z @ 445 NONAME ; class THuiRealPoint CHuiVisual::LocalToDisplay(class THuiRealPoint const &) const
+	?LocalToDisplay@CHuiVisual@@QBE?AVTPoint@@ABV2@@Z @ 446 NONAME ; class TPoint CHuiVisual::LocalToDisplay(class TPoint const &) const
+	?LocaleTextAlignment@CHuiGc@@SA?AW4THuiAlignHorizontal@@XZ @ 447 NONAME ; enum THuiAlignHorizontal CHuiGc::LocaleTextAlignment(void)
+	?Location@CHuiS60Skin@@UAE?AW4THuiSkinLocation@@W4THuiSkinElement@@@Z @ 448 NONAME ; enum THuiSkinLocation CHuiS60Skin::Location(enum THuiSkinElement)
+	?Location@CHuiSkin@@UAE?AW4THuiSkinLocation@@W4THuiSkinElement@@@Z @ 449 NONAME ; enum THuiSkinLocation CHuiSkin::Location(enum THuiSkinElement)
+	?Logging@CHuiStatic@@SAHXZ @ 450 NONAME ; int CHuiStatic::Logging(void)
+	?Loop@CHuiCurvePath@@QBEHXZ @ 451 NONAME ; int CHuiCurvePath::Loop(void) const
+	?M3GMesh@CHuiMeshVisual@@QBEPAVCHuiM3GMesh@@XZ @ 452 NONAME ; class CHuiM3GMesh * CHuiMeshVisual::M3GMesh(void) const
+	?MakeCubeL@CHuiProceduralMesh@@UAEXMMMM@Z @ 453 NONAME ; void CHuiProceduralMesh::MakeCubeL(float, float, float, float)
+	?MakeSphereL@CHuiProceduralMesh@@UAEXMHH@Z @ 454 NONAME ; void CHuiProceduralMesh::MakeSphereL(float, int, int)
+	?MakeTorusL@CHuiProceduralMesh@@UAEXMMHHM@Z @ 455 NONAME ; void CHuiProceduralMesh::MakeTorusL(float, float, int, int, float)
+	?MakeVisible@CHuiDisplayCoeControl@@EAEXH@Z @ 456 NONAME ; void CHuiDisplayCoeControl::MakeVisible(int)
+	?MapValue@THuiAverageMappingFunction@@UBEMMH@Z @ 457 NONAME ; float THuiAverageMappingFunction::MapValue(float, int) const
+	?MapValue@THuiConstantMappingFunction@@UBEMMH@Z @ 458 NONAME ; float THuiConstantMappingFunction::MapValue(float, int) const
+	?MapValue@THuiCosineMappingFunction@@UBEMMH@Z @ 459 NONAME ; float THuiCosineMappingFunction::MapValue(float, int) const
+	?MapValue@THuiLinearMappingFunction@@UBEMMH@Z @ 460 NONAME ; float THuiLinearMappingFunction::MapValue(float, int) const
+	?MapValue@THuiSineMappingFunction@@UBEMMH@Z @ 461 NONAME ; float THuiSineMappingFunction::MapValue(float, int) const
+	?MappingFunctionChanged@MHuiMappingFunction@@UBEHXZ @ 462 NONAME ; int MHuiMappingFunction::MappingFunctionChanged(void) const
+	?MappingFunctionChanged@THuiAverageMappingFunction@@UBEHXZ @ 463 NONAME ; int THuiAverageMappingFunction::MappingFunctionChanged(void) const
+	?MappingFunctionClearChanged@MHuiMappingFunction@@UAEXXZ @ 464 NONAME ; void MHuiMappingFunction::MappingFunctionClearChanged(void)
+	?MappingFunctionClearChanged@THuiAverageMappingFunction@@UAEXXZ @ 465 NONAME ; void THuiAverageMappingFunction::MappingFunctionClearChanged(void)
+	?MaxLineCount@CHuiTextVisual@@QBEHXZ @ 466 NONAME ; int CHuiTextVisual::MaxLineCount(void) const
+	?MaxSize@CHuiVisual@@QBE?AVTSize@@XZ @ 467 NONAME ; class TSize CHuiVisual::MaxSize(void) const
+	?Mesh@CHuiMeshVisual@@QAEAAVCHuiMesh@@XZ @ 468 NONAME ; class CHuiMesh & CHuiMeshVisual::Mesh(void)
+	?MeshType@CHuiMesh@@QBE?AW4THuiMeshType@@XZ @ 469 NONAME ; enum THuiMeshType CHuiMesh::MeshType(void) const
+	?MetricReferenceForLayoutInPixels@CHuiLayout@@IBE?AVTHuiRealPoint@@PBV1@ABUTHuiXYMetric@@@Z @ 470 NONAME ; class THuiRealPoint CHuiLayout::MetricReferenceForLayoutInPixels(class CHuiLayout const *, struct THuiXYMetric const &) const
+	?MetricReferenceInPixels@CHuiVisual@@QBE?AVTHuiRealPoint@@ABUTHuiXYMetric@@@Z @ 471 NONAME ; class THuiRealPoint CHuiVisual::MetricReferenceInPixels(struct THuiXYMetric const &) const
+	?MetricToPixels@CHuiVisual@@QBE?AVTHuiRealPoint@@ABUTHuiXYMetric@@@Z @ 472 NONAME ; class THuiRealPoint CHuiVisual::MetricToPixels(struct THuiXYMetric const &) const
+	?MilliSecondsSinceStart@CHuiStatic@@SAKXZ @ 473 NONAME ; unsigned long CHuiStatic::MilliSecondsSinceStart(void)
+	?Mimic@CHuiVisual@@QAEXABV1@H@Z @ 474 NONAME ; void CHuiVisual::Mimic(class CHuiVisual const &, int)
+	?MinSize@CHuiVisual@@QBE?AVTSize@@XZ @ 475 NONAME ; class TSize CHuiVisual::MinSize(void) const
+	?Mode@CHuiFlowLayout@@QBEHXZ @ 476 NONAME ; int CHuiFlowLayout::Mode(void) const
+	?Move@CHuiVisual@@QAEXABVTPoint@@H@Z @ 477 NONAME ; void CHuiVisual::Move(class TPoint const &, int)
+	?MoveToFront@CHuiVisual@@QAEXH@Z @ 478 NONAME ; void CHuiVisual::MoveToFront(int)
+	?MoveVisualToBack@CHuiLayout@@QAEXAAVCHuiVisual@@H@Z @ 479 NONAME ; void CHuiLayout::MoveVisualToBack(class CHuiVisual &, int)
+	?MoveVisualToFront@CHuiLayout@@QAEXAAVCHuiVisual@@H@Z @ 480 NONAME ; void CHuiLayout::MoveVisualToFront(class CHuiVisual &, int)
+	?Name@THuiTextureHandle@@QBEIXZ @ 481 NONAME ; unsigned int THuiTextureHandle::Name(void) const
+	?NearClipDistance@CHuiGc@@QBEMXZ @ 482 NONAME ; float CHuiGc::NearClipDistance(void) const
+	?NewControlGroupL@CHuiEnv@@QAEAAVCHuiControlGroup@@H@Z @ 483 NONAME ; class CHuiControlGroup & CHuiEnv::NewControlGroupL(int)
+	?NewDisplayL@CHuiEnv@@QAEAAVCHuiDisplay@@ABVTRect@@PAVCCoeControl@@HPAV2@H@Z @ 484 NONAME ; class CHuiDisplay & CHuiEnv::NewDisplayL(class TRect const &, class CCoeControl *, int, class CHuiDisplay *, int)
+	?NewL@CHuiBorderBrush@@SAPAV1@HHHH@Z @ 485 NONAME ; class CHuiBorderBrush * CHuiBorderBrush::NewL(int, int, int, int)
+	?NewL@CHuiBrushArray@@SAPAV1@XZ @ 486 NONAME ; class CHuiBrushArray * CHuiBrushArray::NewL(void)
+	?NewL@CHuiCurvePath@@SAPAV1@XZ @ 487 NONAME ; class CHuiCurvePath * CHuiCurvePath::NewL(void)
+	?NewL@CHuiDisplayCoeControl@@SAPAV1@AAVCHuiEnv@@ABVTRect@@H@Z @ 488 NONAME ; class CHuiDisplayCoeControl * CHuiDisplayCoeControl::NewL(class CHuiEnv &, class TRect const &, int)
+	?NewL@CHuiDropShadowBrush@@SAPAV1@H@Z @ 489 NONAME ; class CHuiDropShadowBrush * CHuiDropShadowBrush::NewL(int)
+	?NewL@CHuiEnv@@SAPAV1@W4THuiRenderer@@PAVMHuiEnvObserver@@@Z @ 490 NONAME ; class CHuiEnv * CHuiEnv::NewL(enum THuiRenderer, class MHuiEnvObserver *)
+	?NewL@CHuiFrameBrush@@SAPAV1@ABVTAknsItemID@@HH@Z @ 491 NONAME ; class CHuiFrameBrush * CHuiFrameBrush::NewL(class TAknsItemID const &, int, int)
+	?NewL@CHuiGifAnimationTexture@@SAPAV1@ABVTDesC16@@AAVCHuiTextureManager@@HW4THuiTextureUploadFlags@@@Z @ 492 NONAME ; class CHuiGifAnimationTexture * CHuiGifAnimationTexture::NewL(class TDesC16 const &, class CHuiTextureManager &, int, enum THuiTextureUploadFlags)
+	?NewL@CHuiGradientBrush@@SAPAV1@XZ @ 493 NONAME ; class CHuiGradientBrush * CHuiGradientBrush::NewL(void)
+	?NewL@CHuiImageBrush@@SAPAV1@ABVTHuiImage@@@Z @ 494 NONAME ; class CHuiImageBrush * CHuiImageBrush::NewL(class THuiImage const &)
+	?NewL@CHuiMesh@@SAPAV1@W4THuiMeshType@@@Z @ 495 NONAME ; class CHuiMesh * CHuiMesh::NewL(enum THuiMeshType)
+	?NewL@CHuiShadowBorderBrush@@SAPAV1@H@Z @ 496 NONAME ; class CHuiShadowBorderBrush * CHuiShadowBorderBrush::NewL(int)
+	?NewL@CHuiSoftKeyControl@@SAPAV1@AAVCHuiEnv@@@Z @ 497 NONAME ; class CHuiSoftKeyControl * CHuiSoftKeyControl::NewL(class CHuiEnv &)
+	?NewL@CHuiTexture@@SAPAV1@PBVTHuiTextureHandle@@@Z @ 498 NONAME ; class CHuiTexture * CHuiTexture::NewL(class THuiTextureHandle const *)
+	?NewL@CHuiTransformation@@SAPAV1@XZ @ 499 NONAME ; class CHuiTransformation * CHuiTransformation::NewL(void)
+	?NewLC@CHuiBorderBrush@@SAPAV1@HHHH@Z @ 500 NONAME ; class CHuiBorderBrush * CHuiBorderBrush::NewLC(int, int, int, int)
+	?NewLC@CHuiBrushArray@@SAPAV1@XZ @ 501 NONAME ; class CHuiBrushArray * CHuiBrushArray::NewLC(void)
+	?NewLC@CHuiCurvePath@@SAPAV1@XZ @ 502 NONAME ; class CHuiCurvePath * CHuiCurvePath::NewLC(void)
+	?NewLC@CHuiDisplayCoeControl@@SAPAV1@AAVCHuiEnv@@ABVTRect@@H@Z @ 503 NONAME ; class CHuiDisplayCoeControl * CHuiDisplayCoeControl::NewLC(class CHuiEnv &, class TRect const &, int)
+	?NewLC@CHuiDropShadowBrush@@SAPAV1@H@Z @ 504 NONAME ; class CHuiDropShadowBrush * CHuiDropShadowBrush::NewLC(int)
+	?NewLC@CHuiEnv@@SAPAV1@W4THuiRenderer@@PAVMHuiEnvObserver@@@Z @ 505 NONAME ; class CHuiEnv * CHuiEnv::NewLC(enum THuiRenderer, class MHuiEnvObserver *)
+	?NewLC@CHuiFrameBrush@@SAPAV1@ABVTAknsItemID@@HH@Z @ 506 NONAME ; class CHuiFrameBrush * CHuiFrameBrush::NewLC(class TAknsItemID const &, int, int)
+	?NewLC@CHuiGradientBrush@@SAPAV1@XZ @ 507 NONAME ; class CHuiGradientBrush * CHuiGradientBrush::NewLC(void)
+	?NewLC@CHuiImageBrush@@SAPAV1@ABVTHuiImage@@@Z @ 508 NONAME ; class CHuiImageBrush * CHuiImageBrush::NewLC(class THuiImage const &)
+	?NewLC@CHuiMesh@@SAPAV1@W4THuiMeshType@@@Z @ 509 NONAME ; class CHuiMesh * CHuiMesh::NewLC(enum THuiMeshType)
+	?NewLC@CHuiShadowBorderBrush@@SAPAV1@H@Z @ 510 NONAME ; class CHuiShadowBorderBrush * CHuiShadowBorderBrush::NewLC(int)
+	?NewLC@CHuiSoftKeyControl@@SAPAV1@AAVCHuiEnv@@@Z @ 511 NONAME ; class CHuiSoftKeyControl * CHuiSoftKeyControl::NewLC(class CHuiEnv &)
+	?NewLC@CHuiTexture@@SAPAV1@PBVTHuiTextureHandle@@@Z @ 512 NONAME ; class CHuiTexture * CHuiTexture::NewLC(class THuiTextureHandle const *)
+	?NewLC@CHuiTransformation@@SAPAV1@XZ @ 513 NONAME ; class CHuiTransformation * CHuiTransformation::NewLC(void)
+	?NonIdentityCount@CHuiTransformation@@QBEHXZ @ 514 NONAME ; int CHuiTransformation::NonIdentityCount(void) const
+	?NormalFromPoints@HuiUtil@@SAXQAY02MQAM@Z @ 515 NONAME ; void HuiUtil::NormalFromPoints(float [3] * const, float * const)
+	?NotifyControlVisibility@CHuiControl@@MAEXHAAVCHuiDisplay@@@Z @ 516 NONAME ; void CHuiControl::NotifyControlVisibility(int, class CHuiDisplay &)
+	?NotifyDisplaySizeChangedL@CHuiS60Skin@@UAEXXZ @ 517 NONAME ; void CHuiS60Skin::NotifyDisplaySizeChangedL(void)
+	?NotifyDisplaySizeChangedL@CHuiSkin@@UAEXXZ @ 518 NONAME ; void CHuiSkin::NotifyDisplaySizeChangedL(void)
+	?NotifySkinChangedL@CHuiEnv@@QAEXXZ @ 519 NONAME ; void CHuiEnv::NotifySkinChangedL(void)
+	?NotifySkinChangedL@CHuiGridLayout@@UAEXXZ @ 520 NONAME ; void CHuiGridLayout::NotifySkinChangedL(void)
+	?NotifySkinChangedL@CHuiLayout@@UAEXXZ @ 521 NONAME ; void CHuiLayout::NotifySkinChangedL(void)
+	?NotifySkinChangedL@CHuiVisual@@UAEXXZ @ 522 NONAME ; void CHuiVisual::NotifySkinChangedL(void)
+	?Now@THuiTimedPoint@@QBE?AVTPoint@@XZ @ 523 NONAME ; class TPoint THuiTimedPoint::Now(void) const
+	?Now@THuiTimedValue@@QBEMXZ @ 524 NONAME ; float THuiTimedValue::Now(void) const
+	?Object@THuiObjectCommand@@QBEPAXXZ @ 525 NONAME ; void * THuiObjectCommand::Object(void) const
+	?ObjectCommand@THuiCommand@@UBEPBVTHuiObjectCommand@@XZ @ 526 NONAME ; class THuiObjectCommand const * THuiCommand::ObjectCommand(void) const
+	?ObjectCommand@THuiObjectCommand@@UBEPBV1@XZ @ 527 NONAME ; class THuiObjectCommand const * THuiObjectCommand::ObjectCommand(void) const
+	?OfferEventL@CHuiControl@@UAEHABVTHuiEvent@@@Z @ 528 NONAME ; int CHuiControl::OfferEventL(class THuiEvent const &)
+	?OfferKeyEventL@CHuiDisplayCoeControl@@EAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 529 NONAME ; enum TKeyResponse CHuiDisplayCoeControl::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode)
+	?Offset2D@CHuiGc@@QBEMXZ @ 530 NONAME ; float CHuiGc::Offset2D(void) const
+	?Opacity@CHuiGradientBrush@@UBEMH@Z @ 531 NONAME ; float CHuiGradientBrush::Opacity(int) const
+	?Operation@THuiObjectCommand@@QBE?AW4THuiOp@@XZ @ 532 NONAME ; enum THuiOp THuiObjectCommand::Operation(void) const
+	?OrdinalToBlock@CHuiGridLayout@@QBE?AVTPoint@@H@Z @ 533 NONAME ; class TPoint CHuiGridLayout::OrdinalToBlock(int) const
+	?Orientation@CHuiDisplay@@QBE?AW4TOrientation@CHuiGc@@XZ @ 534 NONAME ; enum CHuiGc::TOrientation CHuiDisplay::Orientation(void) const
+	?Orientation@CHuiS60Skin@@UBE?AW4THuiSkinOrientation@@XZ @ 535 NONAME ; enum THuiSkinOrientation CHuiS60Skin::Orientation(void) const
+	?Orientation@CHuiSkin@@UBE?AW4THuiSkinOrientation@@XZ @ 536 NONAME ; enum THuiSkinOrientation CHuiSkin::Orientation(void) const
+	?Owner@CHuiVisual@@QBEAAVMHuiVisualOwner@@XZ @ 537 NONAME ; class MHuiVisualOwner & CHuiVisual::Owner(void) const
+	?Padding@CHuiVisual@@QBEABUTHuiBoxMetric@@XZ @ 538 NONAME ; struct THuiBoxMetric const & CHuiVisual::Padding(void) const
+	?PaddingInPixels@CHuiVisual@@QBE?AVTHuiRealRect@@XZ @ 539 NONAME ; class THuiRealRect CHuiVisual::PaddingInPixels(void) const
+	?Panic@THuiPanic@@SAXW4TReason@1@@Z @ 540 NONAME ; void THuiPanic::Panic(enum THuiPanic::TReason)
+	?Param@THuiCustomEventCommand@@QBEHXZ @ 541 NONAME ; int THuiCustomEventCommand::Param(void) const
+	?ParentId@THuiTextStyle@@QBEHXZ @ 542 NONAME ; int THuiTextStyle::ParentId(void) const
+	?Path@CHuiLineVisual@@QAEAAVCHuiCurvePath@@XZ @ 543 NONAME ; class CHuiCurvePath & CHuiLineVisual::Path(void)
+	?PauseRefresh@CHuiEnv@@QAEXXZ @ 544 NONAME ; void CHuiEnv::PauseRefresh(void)
+	?PauseTime@CHuiStatic@@SAXXZ @ 545 NONAME ; void CHuiStatic::PauseTime(void)
+	?PixelPointInLocal@CHuiVisual@@QBE?AVTHuiRealPoint@@ABV2@@Z @ 546 NONAME ; class THuiRealPoint CHuiVisual::PixelPointInLocal(class THuiRealPoint const &) const
+	?PixelsToMetric@CHuiVisual@@QBEXABVTHuiRealPoint@@AAUTHuiXYMetric@@@Z @ 547 NONAME ; void CHuiVisual::PixelsToMetric(class THuiRealPoint const &, struct THuiXYMetric &) const
+	?PointerDown@THuiEvent@@QBEHXZ @ 548 NONAME ; int THuiEvent::PointerDown(void) const
+	?PointerLongTap@THuiEvent@@QBEHXZ @ 549 NONAME ; int THuiEvent::PointerLongTap(void) const
+	?PointerUp@THuiEvent@@QBEHXZ @ 550 NONAME ; int THuiEvent::PointerUp(void) const
+	?Pos@CHuiVisual@@QBEABVTHuiTimedPoint@@XZ @ 551 NONAME ; class THuiTimedPoint const & CHuiVisual::Pos(void) const
+	?PositionChanged@CHuiDisplayCoeControl@@EAEXXZ @ 552 NONAME ; void CHuiDisplayCoeControl::PositionChanged(void)
+	?Posture@THuiTextStyle@@QAEHXZ @ 553 NONAME ; int THuiTextStyle::Posture(void)
+	?Power2@HuiUtil@@SAHH@Z @ 554 NONAME ; int HuiUtil::Power2(int)
+	?Power2RoundDown@HuiUtil@@SAHH@Z @ 555 NONAME ; int HuiUtil::Power2RoundDown(int)
+	?PrepareDrawL@CHuiGridLayout@@UAEHXZ @ 556 NONAME ; int CHuiGridLayout::PrepareDrawL(void)
+	?PrepareDrawL@CHuiLayout@@UAEHXZ @ 557 NONAME ; int CHuiLayout::PrepareDrawL(void)
+	?PrepareDrawL@CHuiTextVisual@@UAEHXZ @ 558 NONAME ; int CHuiTextVisual::PrepareDrawL(void)
+	?PrepareDrawL@CHuiVisual@@UAEHXZ @ 559 NONAME ; int CHuiVisual::PrepareDrawL(void)
+	?PrepareForFocusGainL@CHuiDisplayCoeControl@@EAEXXZ @ 560 NONAME ; void CHuiDisplayCoeControl::PrepareForFocusGainL(void)
+	?PrepareForFocusLossL@CHuiDisplayCoeControl@@EAEXXZ @ 561 NONAME ; void CHuiDisplayCoeControl::PrepareForFocusLossL(void)
+	?PrependImagePath@CHuiTextureManager@@QBEXAAVTDes16@@@Z @ 562 NONAME ; void CHuiTextureManager::PrependImagePath(class TDes16 &) const
+	?PrimaryDisplay@CHuiEnv@@QBEAAVCHuiDisplay@@XZ @ 563 NONAME ; class CHuiDisplay & CHuiEnv::PrimaryDisplay(void) const
+	?Printf@CHuiStatic@@SAXV?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 564 NONAME ; void CHuiStatic::Printf(class TRefByValue<class TDesC16 const >, ...)
+	?Printf@CHuiStatic@@SAXV?$TRefByValue@$$CBVTDesC8@@@@ZZ @ 565 NONAME ; void CHuiStatic::Printf(class TRefByValue<class TDesC8 const >, ...)
+	?Priority@CHuiTexture@@QBEHXZ @ 566 NONAME ; int CHuiTexture::Priority(void) const
+	?ProceduralMesh@CHuiMeshVisual@@QBEPAVCHuiProceduralMesh@@XZ @ 567 NONAME ; class CHuiProceduralMesh * CHuiMeshVisual::ProceduralMesh(void) const
+	?Processor@CHuiTextureManager@@QAEAAVCHuiTextureProcessor@@XZ @ 568 NONAME ; class CHuiTextureProcessor & CHuiTextureManager::Processor(void)
+	?Quality@CHuiDisplay@@QBE?AW4THuiQuality@@XZ @ 569 NONAME ; enum THuiQuality CHuiDisplay::Quality(void) const
+	?QuickLength@HuiUtil@@SAMAAVTHuiRealPoint@@@Z @ 570 NONAME ; float HuiUtil::QuickLength(class THuiRealPoint &)
+	?QuickLength@HuiUtil@@SAMMM@Z @ 571 NONAME ; float HuiUtil::QuickLength(float, float)
+	?QuickNormalize@HuiUtil@@SAXAAVTHuiRealPoint@@@Z @ 572 NONAME ; void HuiUtil::QuickNormalize(class THuiRealPoint &)
+	?QuickNormalize@HuiUtil@@SAXQAM@Z @ 573 NONAME ; void HuiUtil::QuickNormalize(float * const)
+	?RandomInt@HuiUtil@@SAHHH@Z @ 574 NONAME ; int HuiUtil::RandomInt(int, int)
+	?RandomReal@HuiUtil@@SAMMM@Z @ 575 NONAME ; float HuiUtil::RandomReal(float, float)
+	?RealNow@THuiTimedPoint@@QBE?AVTHuiRealPoint@@XZ @ 576 NONAME ; class THuiRealPoint THuiTimedPoint::RealNow(void) const
+	?RealTarget@THuiTimedPoint@@QBE?AVTHuiRealPoint@@XZ @ 577 NONAME ; class THuiRealPoint THuiTimedPoint::RealTarget(void) const
+	?Recipient@THuiCustomEventCommand@@QBEPAVMHuiEventHandler@@XZ @ 578 NONAME ; class MHuiEventHandler * THuiCustomEventCommand::Recipient(void) const
+	?RefreshCallBack@CHuiEnv@@SAHPAX@Z @ 579 NONAME ; int CHuiEnv::RefreshCallBack(void *)
+	?RefreshMode@CHuiEnv@@QBE?AW4THuiRefreshMode@@XZ @ 580 NONAME ; enum THuiRefreshMode CHuiEnv::RefreshMode(void) const
+	?Release@CHuiDisplay@@QAEXXZ @ 581 NONAME ; void CHuiDisplay::Release(void)
+	?Release@CHuiEnv@@QAEXXZ @ 582 NONAME ; void CHuiEnv::Release(void)
+	?Release@THuiTextureHandle@@QAEXXZ @ 583 NONAME ; void THuiTextureHandle::Release(void)
+	?ReleaseTexture@CHuiS60Skin@@UAEXH@Z @ 584 NONAME ; void CHuiS60Skin::ReleaseTexture(int)
+	?ReleaseTexture@CHuiSkin@@UAEXH@Z @ 585 NONAME ; void CHuiSkin::ReleaseTexture(int)
+	?RemainingTime@THuiTimedValue@@QBEHXZ @ 586 NONAME ; int THuiTimedValue::RemainingTime(void) const
+	?Remove@CHuiBrushArray@@QAEXH@Z @ 587 NONAME ; void CHuiBrushArray::Remove(int)
+	?Remove@CHuiControl@@UAEXPAVCHuiVisual@@@Z @ 588 NONAME ; void CHuiControl::Remove(class CHuiVisual *)
+	?Remove@CHuiControlGroup@@QAEHPAVCHuiControl@@@Z @ 589 NONAME ; int CHuiControlGroup::Remove(class CHuiControl *)
+	?Remove@CHuiLayout@@QAEXPAVCHuiVisual@@H@Z @ 590 NONAME ; void CHuiLayout::Remove(class CHuiVisual *, int)
+	?RemoveAnchor@CHuiAnchorLayout@@QAEXW4THuiAnchor@@H@Z @ 591 NONAME ; void CHuiAnchorLayout::RemoveAnchor(enum THuiAnchor, int)
+	?RemoveAndDestroyAllD@CHuiGridLayout@@UAEXXZ @ 592 NONAME ; void CHuiGridLayout::RemoveAndDestroyAllD(void)
+	?RemoveAndDestroyAllD@CHuiLayout@@UAEXXZ @ 593 NONAME ; void CHuiLayout::RemoveAndDestroyAllD(void)
+	?RemoveAndDestroyAllD@CHuiVisual@@UAEXXZ @ 594 NONAME ; void CHuiVisual::RemoveAndDestroyAllD(void)
+	?RemoveConnection@CHuiControl@@QAEXPAV1@@Z @ 595 NONAME ; void CHuiControl::RemoveConnection(class CHuiControl *)
+	?RemoveWeightL@CHuiGridLayout@@QAEXW4THuiGridDimension@@H@Z @ 596 NONAME ; void CHuiGridLayout::RemoveWeightL(enum THuiGridDimension, int)
+	?Renderer@CHuiEnv@@QBE?AW4THuiRenderer@@XZ @ 597 NONAME ; enum THuiRenderer CHuiEnv::Renderer(void) const
+	?Reorder@CHuiLayout@@QAEXAAVCHuiVisual@@HH@Z @ 598 NONAME ; void CHuiLayout::Reorder(class CHuiVisual &, int, int)
+	?ReplaceWeightL@CHuiGridLayout@@QAEXW4THuiGridDimension@@ABUTHuiMetric@@H@Z @ 599 NONAME ; void CHuiGridLayout::ReplaceWeightL(enum THuiGridDimension, struct THuiMetric const &, int)
+	?ReportChanged@CHuiGridLayout@@UAEXXZ @ 600 NONAME ; void CHuiGridLayout::ReportChanged(void)
+	?ReportChanged@CHuiLayout@@UAEXXZ @ 601 NONAME ; void CHuiLayout::ReportChanged(void)
+	?ReportChanged@CHuiVisual@@UAEXXZ @ 602 NONAME ; void CHuiVisual::ReportChanged(void)
+	?Reset@CHuiAnchorLayout@@QAEXXZ @ 603 NONAME ; void CHuiAnchorLayout::Reset(void)
+	?Reset@CHuiBrushArray@@QAEXXZ @ 604 NONAME ; void CHuiBrushArray::Reset(void)
+	?Reset@CHuiCurvePath@@UAEXXZ @ 605 NONAME ; void CHuiCurvePath::Reset(void)
+	?Reset@CHuiMesh@@UAEXXZ @ 606 NONAME ; void CHuiMesh::Reset(void)
+	?Reset@CHuiProceduralMesh@@UAEXXZ @ 607 NONAME ; void CHuiProceduralMesh::Reset(void)
+	?RestoreL@CHuiDisplay@@QAEXXZ @ 608 NONAME ; void CHuiDisplay::RestoreL(void)
+	?RestoreL@CHuiEnv@@QAEXXZ @ 609 NONAME ; void CHuiEnv::RestoreL(void)
+	?RestoreTextureContentL@CHuiS60Skin@@UAEXAAVCHuiTexture@@@Z @ 610 NONAME ; void CHuiS60Skin::RestoreTextureContentL(class CHuiTexture &)
+	?RestoreTextureContentL@CHuiSkin@@UAEXAAVCHuiTexture@@@Z @ 611 NONAME ; void CHuiSkin::RestoreTextureContentL(class CHuiTexture &)
+	?Role@CHuiControl@@QBEHXZ @ 612 NONAME ; int CHuiControl::Role(void) const
+	?Roster@CHuiDisplay@@QAEAAVCHuiRoster@@XZ @ 613 NONAME ; class CHuiRoster & CHuiDisplay::Roster(void)
+	?Roster@CHuiDisplay@@QBEABVCHuiRoster@@XZ @ 614 NONAME ; class CHuiRoster const & CHuiDisplay::Roster(void) const
+	?Rotate@CHuiTransformation@@QAEXABVTHuiTimedValue@@@Z @ 615 NONAME ; void CHuiTransformation::Rotate(class THuiTimedValue const &)
+	?Rotate@CHuiTransformation@@QAEXABVTHuiTimedValue@@MMM@Z @ 616 NONAME ; void CHuiTransformation::Rotate(class THuiTimedValue const &, float, float, float)
+	?Rotate@CHuiTransformation@@QAEXM@Z @ 617 NONAME ; void CHuiTransformation::Rotate(float)
+	?Rotate@CHuiTransformation@@QAEXMMMM@Z @ 618 NONAME ; void CHuiTransformation::Rotate(float, float, float, float)
+	?RowCount@CHuiGridLayout@@QBEHXZ @ 619 NONAME ; int CHuiGridLayout::RowCount(void) const
+	?Scalar@THuiInteractionInterval@@QBEMXZ @ 620 NONAME ; float THuiInteractionInterval::Scalar(void) const
+	?Scale@CHuiTransformation@@QAEXABVTHuiTimedValue@@00@Z @ 621 NONAME ; void CHuiTransformation::Scale(class THuiTimedValue const &, class THuiTimedValue const &, class THuiTimedValue const &)
+	?Scale@CHuiTransformation@@QAEXABVTHuiTimedValue@@0@Z @ 622 NONAME ; void CHuiTransformation::Scale(class THuiTimedValue const &, class THuiTimedValue const &)
+	?Scale@CHuiTransformation@@QAEXMM@Z @ 623 NONAME ; void CHuiTransformation::Scale(float, float)
+	?Scale@CHuiTransformation@@QAEXMMM@Z @ 624 NONAME ; void CHuiTransformation::Scale(float, float, float)
+	?Scale@THuiImage@@QAEXMMH@Z @ 625 NONAME ; void THuiImage::Scale(float, float, int)
+	?ScaleFbsBitmapL@HuiUtil@@SAXABVCFbsBitmap@@AAV2@@Z @ 626 NONAME ; void HuiUtil::ScaleFbsBitmapL(class CFbsBitmap const &, class CFbsBitmap &)
+	?ScaleImage@HuiUtil@@SAXHABVTSize@@PBE0PAE@Z @ 627 NONAME ; void HuiUtil::ScaleImage(int, class TSize const &, unsigned char const *, class TSize const &, unsigned char *)
+	?ScaleUniformly@CHuiMesh@@UAEXMMM@Z @ 628 NONAME ; void CHuiMesh::ScaleUniformly(float, float, float)
+	?ScaleUniformly@CHuiProceduralMesh@@UAEXMMM@Z @ 629 NONAME ; void CHuiProceduralMesh::ScaleUniformly(float, float, float)
+	?ScreenSize@HuiUtil@@SA?AVTSize@@XZ @ 630 NONAME ; class TSize HuiUtil::ScreenSize(void)
+	?ScrollOffset@CHuiLayout@@QAEAAVTHuiTimedPoint@@XZ @ 631 NONAME ; class THuiTimedPoint & CHuiLayout::ScrollOffset(void)
+	?ScrollOffset@CHuiLayout@@QBEABVTHuiTimedPoint@@XZ @ 632 NONAME ; class THuiTimedPoint const & CHuiLayout::ScrollOffset(void) const
+	?Scrolling@CHuiLayout@@QBEHXZ @ 633 NONAME ; int CHuiLayout::Scrolling(void) const
+	?SecondsSinceStart@CHuiStatic@@SAMXZ @ 634 NONAME ; float CHuiStatic::SecondsSinceStart(void)
+	?SegmentCount@CHuiAnimatedTexture@@UBEHXZ @ 635 NONAME ; int CHuiAnimatedTexture::SegmentCount(void) const
+	?SegmentCount@CHuiTexture@@UBEHXZ @ 636 NONAME ; int CHuiTexture::SegmentCount(void) const
+	?SegmentCount@THuiImage@@QBEHXZ @ 637 NONAME ; int THuiImage::SegmentCount(void) const
+	?SegmentCount@THuiTextureHandle@@UBEHXZ @ 638 NONAME ; int THuiTextureHandle::SegmentCount(void) const
+	?SegmentName@CHuiAnimatedTexture@@UBEIH@Z @ 639 NONAME ; unsigned int CHuiAnimatedTexture::SegmentName(int) const
+	?SegmentName@CHuiTexture@@UBEIH@Z @ 640 NONAME ; unsigned int CHuiTexture::SegmentName(int) const
+	?SegmentName@THuiTextureHandle@@UBEIH@Z @ 641 NONAME ; unsigned int THuiTextureHandle::SegmentName(int) const
+	?SegmentOffset@CHuiAnimatedTexture@@UBE?AVTPoint@@H@Z @ 642 NONAME ; class TPoint CHuiAnimatedTexture::SegmentOffset(int) const
+	?SegmentOffset@CHuiTexture@@UBE?AVTPoint@@H@Z @ 643 NONAME ; class TPoint CHuiTexture::SegmentOffset(int) const
+	?SegmentOffset@THuiTextureHandle@@UBE?AVTPoint@@H@Z @ 644 NONAME ; class TPoint THuiTextureHandle::SegmentOffset(int) const
+	?SegmentSize@CHuiAnimatedTexture@@UBE?AVTSize@@H@Z @ 645 NONAME ; class TSize CHuiAnimatedTexture::SegmentSize(int) const
+	?SegmentSize@CHuiTexture@@UBE?AVTSize@@H@Z @ 646 NONAME ; class TSize CHuiTexture::SegmentSize(int) const
+	?SegmentSize@THuiTextureHandle@@UBE?AVTSize@@H@Z @ 647 NONAME ; class TSize THuiTextureHandle::SegmentSize(int) const
+	?SegmentTextureSize@CHuiAnimatedTexture@@UBE?AVTSize@@H@Z @ 648 NONAME ; class TSize CHuiAnimatedTexture::SegmentTextureSize(int) const
+	?SegmentTextureSize@CHuiTexture@@UBE?AVTSize@@H@Z @ 649 NONAME ; class TSize CHuiTexture::SegmentTextureSize(int) const
+	?SegmentTextureSize@THuiTextureHandle@@UBE?AVTSize@@H@Z @ 650 NONAME ; class TSize THuiTextureHandle::SegmentTextureSize(int) const
+	?SegmentedTexture@CHuiAnimatedTexture@@UAEPAVMHuiSegmentedTexture@@XZ @ 651 NONAME ; class MHuiSegmentedTexture * CHuiAnimatedTexture::SegmentedTexture(void)
+	?SegmentedTexture@CHuiAnimatedTexture@@UBEPBVMHuiSegmentedTexture@@XZ @ 652 NONAME ; class MHuiSegmentedTexture const * CHuiAnimatedTexture::SegmentedTexture(void) const
+	?SegmentedTexture@CHuiTexture@@UAEPAVMHuiSegmentedTexture@@XZ @ 653 NONAME ; class MHuiSegmentedTexture * CHuiTexture::SegmentedTexture(void)
+	?SegmentedTexture@CHuiTexture@@UBEPBVMHuiSegmentedTexture@@XZ @ 654 NONAME ; class MHuiSegmentedTexture const * CHuiTexture::SegmentedTexture(void) const
+	?SegmentedTexture@THuiTextureHandle@@UAEPAVMHuiSegmentedTexture@@XZ @ 655 NONAME ; class MHuiSegmentedTexture * THuiTextureHandle::SegmentedTexture(void)
+	?SegmentedTexture@THuiTextureHandle@@UBEPBVMHuiSegmentedTexture@@XZ @ 656 NONAME ; class MHuiSegmentedTexture const * THuiTextureHandle::SegmentedTexture(void) const
+	?Send@CHuiEnv@@QAEHABVTHuiCommand@@H@Z @ 657 NONAME ; int CHuiEnv::Send(class THuiCommand const &, int)
+	?SendL@CHuiEnv@@QAEXABVTHuiCommand@@H@Z @ 658 NONAME ; void CHuiEnv::SendL(class THuiCommand const &, int)
+	?Sender@THuiCommand@@QBEPAXXZ @ 659 NONAME ; void * THuiCommand::Sender(void) const
+	?SenderControl@THuiCommand@@QBEPAVCHuiControl@@XZ @ 660 NONAME ; class CHuiControl * THuiCommand::SenderControl(void) const
+	?SenderControlGroup@THuiCommand@@QBEPAVCHuiControlGroup@@XZ @ 661 NONAME ; class CHuiControlGroup * THuiCommand::SenderControlGroup(void) const
+	?SenderType@THuiCommand@@QBE?AW4THuiCommandObjectType@@XZ @ 662 NONAME ; enum THuiCommandObjectType THuiCommand::SenderType(void) const
+	?SenderVisual@THuiCommand@@QBEPAVCHuiVisual@@XZ @ 663 NONAME ; class CHuiVisual * THuiCommand::SenderVisual(void) const
+	?SessionId@CHuiBrush@@UBEHXZ @ 664 NONAME ; int CHuiBrush::SessionId(void) const
+	?SessionId@CHuiControl@@MBEHXZ @ 665 NONAME ; int CHuiControl::SessionId(void) const
+	?SessionId@CHuiControlGroup@@UBEHXZ @ 666 NONAME ; int CHuiControlGroup::SessionId(void) const
+	?SessionId@CHuiGridLayout@@UBEHXZ @ 667 NONAME ; int CHuiGridLayout::SessionId(void) const
+	?SessionId@CHuiLayout@@UBEHXZ @ 668 NONAME ; int CHuiLayout::SessionId(void) const
+	?SessionId@CHuiMesh@@UBEHXZ @ 669 NONAME ; int CHuiMesh::SessionId(void) const
+	?SessionId@CHuiTexture@@UBEHXZ @ 670 NONAME ; int CHuiTexture::SessionId(void) const
+	?SessionId@CHuiVisual@@UBEHXZ @ 671 NONAME ; int CHuiVisual::SessionId(void) const
+	?Set@THuiTextureHandle@@QAEXIABVTSize@@0@Z @ 672 NONAME ; void THuiTextureHandle::Set(unsigned int, class TSize const &, class TSize const &)
+	?Set@THuiTimedPoint@@QAEXABVTHuiRealPoint@@H@Z @ 673 NONAME ; void THuiTimedPoint::Set(class THuiRealPoint const &, int)
+	?Set@THuiTimedPoint@@QAEXMH@Z @ 674 NONAME ; void THuiTimedPoint::Set(float, int)
+	?Set@THuiTimedValue@@QAEXM@Z @ 675 NONAME ; void THuiTimedValue::Set(float)
+	?Set@THuiTimedValue@@QAEXMH@Z @ 676 NONAME ; void THuiTimedValue::Set(float, int)
+	?SetAcceptInput@CHuiControlGroup@@QAEXH@Z @ 677 NONAME ; void CHuiControlGroup::SetAcceptInput(int)
+	?SetAlign@CHuiTextVisual@@QAEXW4THuiAlignHorizontal@@W4THuiAlignVertical@@@Z @ 678 NONAME ; void CHuiTextVisual::SetAlign(enum THuiAlignHorizontal, enum THuiAlignVertical)
+	?SetAlphaFunction@CHuiLineVisual@@QAEXPAVMHuiMappingFunction@@@Z @ 679 NONAME ; void CHuiLineVisual::SetAlphaFunction(class MHuiMappingFunction *)
+	?SetAnchor@CHuiAnchorLayout@@QAEHW4THuiAnchor@@HW4THuiAnchorOrigin@@1W4THuiAnchorMetric@@2ABVTHuiTimedPoint@@@Z @ 680 NONAME ; int CHuiAnchorLayout::SetAnchor(enum THuiAnchor, int, enum THuiAnchorOrigin, enum THuiAnchorOrigin, enum THuiAnchorMetric, enum THuiAnchorMetric, class THuiTimedPoint const &)
+	?SetAngle@THuiTransformationCommand@@QAEXABVTHuiTimedValue@@@Z @ 681 NONAME ; void THuiTransformationCommand::SetAngle(class THuiTimedValue const &)
+	?SetAnimationPosition@CHuiM3GMesh@@UAEXHMH@Z @ 682 NONAME ; void CHuiM3GMesh::SetAnimationPosition(int, float, int)
+	?SetAnimationPosition@CHuiMesh@@UAEXHMH@Z @ 683 NONAME ; void CHuiMesh::SetAnimationPosition(int, float, int)
+	?SetAnimationTimes@CHuiSoftKeyControl@@QAEXII@Z @ 684 NONAME ; void CHuiSoftKeyControl::SetAnimationTimes(unsigned int, unsigned int)
+	?SetBackgroundColor@CHuiDisplay@@QAEXABVTRgb@@@Z @ 685 NONAME ; void CHuiDisplay::SetBackgroundColor(class TRgb const &)
+	?SetBackgroundColor@THuiTextStyle@@QAEXABVTRgb@@@Z @ 686 NONAME ; void THuiTextStyle::SetBackgroundColor(class TRgb const &)
+	?SetBackgroundL@CHuiSoftKeyControl@@QAEXVTHuiImage@@HH@Z @ 687 NONAME ; void CHuiSoftKeyControl::SetBackgroundL(class THuiImage, int, int)
+	?SetBackgroundType@CHuiSoftKeyControl@@QAEXW4THuiBackgroundType@@@Z @ 688 NONAME ; void CHuiSoftKeyControl::SetBackgroundType(enum THuiBackgroundType)
+	?SetBaseUnit@CHuiLayout@@QAEXABUTHuiMetric@@@Z @ 689 NONAME ; void CHuiLayout::SetBaseUnit(struct THuiMetric const &)
+	?SetBaseUnit@CHuiLayout@@QAEXABUTHuiXYMetric@@@Z @ 690 NONAME ; void CHuiLayout::SetBaseUnit(struct THuiXYMetric const &)
+	?SetBorders@CHuiImageBrush@@QAEXHHHH@Z @ 691 NONAME ; void CHuiImageBrush::SetBorders(int, int, int, int)
+	?SetCenteredPosAndSize@CHuiVisual@@QAEXABVTPoint@@ABVTSize@@H@Z @ 692 NONAME ; void CHuiVisual::SetCenteredPosAndSize(class TPoint const &, class TSize const &, int)
+	?SetCentering@CHuiFlowLayout@@QAEXH@Z @ 693 NONAME ; void CHuiFlowLayout::SetCentering(int)
+	?SetChanged@CHuiBrush@@QAEXXZ @ 694 NONAME ; void CHuiBrush::SetChanged(void)
+	?SetChanged@CHuiVisual@@UAEXXZ @ 695 NONAME ; void CHuiVisual::SetChanged(void)
+	?SetClearBackgroundL@CHuiDisplay@@QAEXW4TClearMode@1@@Z @ 696 NONAME ; void CHuiDisplay::SetClearBackgroundL(enum CHuiDisplay::TClearMode)
+	?SetClipToVisual@CHuiBrush@@QAEXH@Z @ 697 NONAME ; void CHuiBrush::SetClipToVisual(int)
+	?SetClipping@CHuiVisual@@QAEXH@Z @ 698 NONAME ; void CHuiVisual::SetClipping(int)
+	?SetColor@CHuiBorderBrush@@QAEXABVTRgb@@@Z @ 699 NONAME ; void CHuiBorderBrush::SetColor(class TRgb const &)
+	?SetColor@CHuiGradientBrush@@UAEXABVTRgb@@M@Z @ 700 NONAME ; void CHuiGradientBrush::SetColor(class TRgb const &, float)
+	?SetColor@CHuiImageVisual@@QAEXABVTRgb@@@Z @ 701 NONAME ; void CHuiImageVisual::SetColor(class TRgb const &)
+	?SetColor@CHuiTextVisual@@QAEXABVTAknsItemID@@H@Z @ 702 NONAME ; void CHuiTextVisual::SetColor(class TAknsItemID const &, int)
+	?SetColor@CHuiTextVisual@@QAEXABVTRgb@@@Z @ 703 NONAME ; void CHuiTextVisual::SetColor(class TRgb const &)
+	?SetColorMode@CHuiImageVisual@@QAEXW4TColorMode@1@M@Z @ 704 NONAME ; void CHuiImageVisual::SetColorMode(enum CHuiImageVisual::TColorMode, float)
+	?SetColumnsL@CHuiGridLayout@@QAEXABV?$RArray@H@@@Z @ 705 NONAME ; void CHuiGridLayout::SetColumnsL(class RArray<int> const &)
+	?SetColumnsL@CHuiGridLayout@@QAEXH@Z @ 706 NONAME ; void CHuiGridLayout::SetColumnsL(int)
+	?SetContainerWindowL@CHuiDisplayCoeControl@@EAEXABVCCoeControl@@@Z @ 707 NONAME ; void CHuiDisplayCoeControl::SetContainerWindowL(class CCoeControl const &)
+	?SetContext@CHuiS60Skin@@UAEXAAVCHuiGc@@@Z @ 708 NONAME ; void CHuiS60Skin::SetContext(class CHuiGc &)
+	?SetContext@CHuiSkin@@UAEXAAVCHuiGc@@@Z @ 709 NONAME ; void CHuiSkin::SetContext(class CHuiGc &)
+	?SetDimmed@CHuiDisplayCoeControl@@EAEXH@Z @ 710 NONAME ; void CHuiDisplayCoeControl::SetDimmed(int)
+	?SetDirection@CHuiGradientBrush@@QAEXW4TDirection@1@@Z @ 711 NONAME ; void CHuiGradientBrush::SetDirection(enum CHuiGradientBrush::TDirection)
+	?SetDirty@CHuiDisplay@@QAEXXZ @ 712 NONAME ; void CHuiDisplay::SetDirty(void)
+	?SetDropShadow@CHuiImageVisual@@QAEXH@Z @ 713 NONAME ; void CHuiImageVisual::SetDropShadow(int)
+	?SetExpanding@CHuiGridLayout@@QAEXH@Z @ 714 NONAME ; void CHuiGridLayout::SetExpanding(int)
+	?SetFlag@CHuiVisual@@QAEXW4THuiVisualFlags@@@Z @ 715 NONAME ; void CHuiVisual::SetFlag(enum THuiVisualFlags)
+	?SetFlags@CHuiVisual@@QAEXH@Z @ 716 NONAME ; void CHuiVisual::SetFlags(int)
+	?SetFlowDirection@CHuiFlowLayout@@QAEXW4TFlowDirection@1@@Z @ 717 NONAME ; void CHuiFlowLayout::SetFlowDirection(enum CHuiFlowLayout::TFlowDirection)
+	?SetFont@THuiTextStyle@@UAEXVTHuiFont@@@Z @ 718 NONAME ; void THuiTextStyle::SetFont(class THuiFont)
+	?SetFrameRectsL@CHuiFrameBrush@@QAEXABVTRect@@0@Z @ 719 NONAME ; void CHuiFrameBrush::SetFrameRectsL(class TRect const &, class TRect const &)
+	?SetFunction@THuiTimedPoint@@QAEXPAVMHuiMappingFunction@@@Z @ 720 NONAME ; void THuiTimedPoint::SetFunction(class MHuiMappingFunction *)
+	?SetFunction@THuiTimedValue@@QAEXPAVMHuiMappingFunction@@@Z @ 721 NONAME ; void THuiTimedValue::SetFunction(class MHuiMappingFunction *)
+	?SetHost@CHuiControl@@QAEXPAV1@@Z @ 722 NONAME ; void CHuiControl::SetHost(class CHuiControl *)
+	?SetHostId@CHuiControl@@QAEXH@Z @ 723 NONAME ; void CHuiControl::SetHostId(int)
+	?SetId@CHuiControl@@QAEXH@Z @ 724 NONAME ; void CHuiControl::SetId(int)
+	?SetIdleThreshold@CHuiEnv@@QAEXH@Z @ 725 NONAME ; void CHuiEnv::SetIdleThreshold(int)
+	?SetImage@CHuiBorderBrush@@QAEXABVTHuiImage@@@Z @ 726 NONAME ; void CHuiBorderBrush::SetImage(class THuiImage const &)
+	?SetImage@CHuiGradientBrush@@UAEXABVTHuiImage@@@Z @ 727 NONAME ; void CHuiGradientBrush::SetImage(class THuiImage const &)
+	?SetImage@CHuiImageBrush@@QAEXABVTHuiImage@@@Z @ 728 NONAME ; void CHuiImageBrush::SetImage(class THuiImage const &)
+	?SetImage@CHuiImageVisual@@QAEXABVTHuiImage@@@Z @ 729 NONAME ; void CHuiImageVisual::SetImage(class THuiImage const &)
+	?SetImage@CHuiLineVisual@@QAEXABVTHuiImage@@@Z @ 730 NONAME ; void CHuiLineVisual::SetImage(class THuiImage const &)
+	?SetImage@CHuiMeshVisual@@QAEXABVTHuiImage@@@Z @ 731 NONAME ; void CHuiMeshVisual::SetImage(class THuiImage const &)
+	?SetImagePathL@CHuiTextureManager@@QAEXABVTDesC16@@@Z @ 732 NONAME ; void CHuiTextureManager::SetImagePathL(class TDesC16 const &)
+	?SetInnerPadding@CHuiLayout@@QAEXABUTHuiXYMetric@@@Z @ 733 NONAME ; void CHuiLayout::SetInnerPadding(struct THuiXYMetric const &)
+	?SetInnerPadding@CHuiLayout@@QAEXABVTPoint@@@Z @ 734 NONAME ; void CHuiLayout::SetInnerPadding(class TPoint const &)
+	?SetLabelL@CHuiSoftKeyControl@@QAEXW4THuiSoftKeyPosition@@ABVTDesC16@@H@Z @ 735 NONAME ; void CHuiSoftKeyControl::SetLabelL(enum THuiSoftKeyPosition, class TDesC16 const &, int)
+	?SetLayer@CHuiBrush@@QAEXW4THuiBrushLayer@@@Z @ 736 NONAME ; void CHuiBrush::SetLayer(enum THuiBrushLayer)
+	?SetLayoutTransitionTime@CHuiStatic@@SAXH@Z @ 737 NONAME ; void CHuiStatic::SetLayoutTransitionTime(int)
+	?SetLineSpacing@CHuiTextVisual@@QAEXHW4TLineSpacingUnits@1@@Z @ 738 NONAME ; void CHuiTextVisual::SetLineSpacing(int, enum CHuiTextVisual::TLineSpacingUnits)
+	?SetMappingMode@THuiTimedValue@@QAEXH@Z @ 739 NONAME ; void THuiTimedValue::SetMappingMode(int)
+	?SetMaxCpuTime@CHuiEnv@@QAEXI@Z @ 740 NONAME ; void CHuiEnv::SetMaxCpuTime(unsigned int)
+	?SetMaxFrameRate@CHuiEnv@@QAEXM@Z @ 741 NONAME ; void CHuiEnv::SetMaxFrameRate(float)
+	?SetMaxLineCount@CHuiTextVisual@@QAEXH@Z @ 742 NONAME ; void CHuiTextVisual::SetMaxLineCount(int)
+	?SetMaxSize@CHuiVisual@@QAEXABVTSize@@@Z @ 743 NONAME ; void CHuiVisual::SetMaxSize(class TSize const &)
+	?SetMinSize@CHuiVisual@@QAEXABVTSize@@@Z @ 744 NONAME ; void CHuiVisual::SetMinSize(class TSize const &)
+	?SetMode@CHuiFlowLayout@@QAEXH@Z @ 745 NONAME ; void CHuiFlowLayout::SetMode(int)
+	?SetName@THuiTextureHandle@@QAEXI@Z @ 746 NONAME ; void THuiTextureHandle::SetName(unsigned int)
+	?SetOrientation@CHuiDisplay@@QAEXW4TOrientation@CHuiGc@@@Z @ 747 NONAME ; void CHuiDisplay::SetOrientation(enum CHuiGc::TOrientation)
+	?SetOrigin@CHuiCurvePath@@QAEXM@Z @ 748 NONAME ; void CHuiCurvePath::SetOrigin(float)
+	?SetOrigin@CHuiVisual@@QAEXW4THuiVisualHOrigin@@W4THuiVisualVOrigin@@@Z @ 749 NONAME ; void CHuiVisual::SetOrigin(enum THuiVisualHOrigin, enum THuiVisualVOrigin)
+	?SetOwner@CHuiVisual@@QAEXAAVMHuiVisualOwner@@@Z @ 750 NONAME ; void CHuiVisual::SetOwner(class MHuiVisualOwner &)
+	?SetPadding@CHuiVisual@@QAEXABUTHuiBoxMetric@@@Z @ 751 NONAME ; void CHuiVisual::SetPadding(struct THuiBoxMetric const &)
+	?SetPadding@CHuiVisual@@QAEXABVTPoint@@@Z @ 752 NONAME ; void CHuiVisual::SetPadding(class TPoint const &)
+	?SetPadding@CHuiVisual@@QAEXH@Z @ 753 NONAME ; void CHuiVisual::SetPadding(int)
+	?SetParentId@THuiTextStyle@@QAEXH@Z @ 754 NONAME ; void THuiTextStyle::SetParentId(int)
+	?SetPath@CHuiLineVisual@@QAEXPAVCHuiCurvePath@@W4THuiOwnership@@@Z @ 755 NONAME ; void CHuiLineVisual::SetPath(class CHuiCurvePath *, enum THuiOwnership)
+	?SetPos@CHuiGridLayout@@UAEXABVTHuiRealPoint@@H@Z @ 756 NONAME ; void CHuiGridLayout::SetPos(class THuiRealPoint const &, int)
+	?SetPos@CHuiLayout@@UAEXABVTHuiRealPoint@@H@Z @ 757 NONAME ; void CHuiLayout::SetPos(class THuiRealPoint const &, int)
+	?SetPos@CHuiVisual@@UAEXABVTHuiRealPoint@@H@Z @ 758 NONAME ; void CHuiVisual::SetPos(class THuiRealPoint const &, int)
+	?SetPosture@THuiTextStyle@@QAEXH@Z @ 759 NONAME ; void THuiTextStyle::SetPosture(int)
+	?SetPriority@CHuiTexture@@QAEXH@Z @ 760 NONAME ; void CHuiTexture::SetPriority(int)
+	?SetProbe@CHuiStatic@@SAXPAVMHuiProbe@@@Z @ 761 NONAME ; void CHuiStatic::SetProbe(class MHuiProbe *)
+	?SetQuality@CHuiDisplay@@QAEXW4THuiQuality@@@Z @ 762 NONAME ; void CHuiDisplay::SetQuality(enum THuiQuality)
+	?SetRect@CHuiVisual@@QAEXABVTHuiRealRect@@H@Z @ 763 NONAME ; void CHuiVisual::SetRect(class THuiRealRect const &, int)
+	?SetRefreshMode@CHuiEnv@@QAEXW4THuiRefreshMode@@@Z @ 764 NONAME ; void CHuiEnv::SetRefreshMode(enum THuiRefreshMode)
+	?SetRelativeAnchorRect@CHuiAnchorLayout@@QAEHHW4THuiAnchorOrigin@@0ABVTHuiRealPoint@@001@Z @ 765 NONAME ; int CHuiAnchorLayout::SetRelativeAnchorRect(int, enum THuiAnchorOrigin, enum THuiAnchorOrigin, class THuiRealPoint const &, enum THuiAnchorOrigin, enum THuiAnchorOrigin, class THuiRealPoint const &)
+	?SetRole@CHuiControl@@QAEXH@Z @ 766 NONAME ; void CHuiControl::SetRole(int)
+	?SetRowsL@CHuiGridLayout@@QAEXABV?$RArray@H@@@Z @ 767 NONAME ; void CHuiGridLayout::SetRowsL(class RArray<int> const &)
+	?SetRowsL@CHuiGridLayout@@QAEXH@Z @ 768 NONAME ; void CHuiGridLayout::SetRowsL(int)
+	?SetScalar@THuiInteractionInterval@@QAEXM@Z @ 769 NONAME ; void THuiInteractionInterval::SetScalar(float)
+	?SetScaleMode@CHuiImageBrush@@QAEXW4TScaleMode@CHuiImageVisual@@@Z @ 770 NONAME ; void CHuiImageBrush::SetScaleMode(enum CHuiImageVisual::TScaleMode)
+	?SetScaleMode@CHuiImageVisual@@QAEXW4TScaleMode@1@@Z @ 771 NONAME ; void CHuiImageVisual::SetScaleMode(enum CHuiImageVisual::TScaleMode)
+	?SetSecondaryImage@CHuiImageVisual@@QAEXABVTHuiImage@@@Z @ 772 NONAME ; void CHuiImageVisual::SetSecondaryImage(class THuiImage const &)
+	?SetSecondaryImage@CHuiMeshVisual@@QAEXABVTHuiImage@@@Z @ 773 NONAME ; void CHuiMeshVisual::SetSecondaryImage(class THuiImage const &)
+	?SetSegmentCountL@CHuiTexture@@UAEXH@Z @ 774 NONAME ; void CHuiTexture::SetSegmentCountL(int)
+	?SetSegmentName@CHuiTexture@@UAEXHI@Z @ 775 NONAME ; void CHuiTexture::SetSegmentName(int, unsigned int)
+	?SetSegmentOffset@CHuiTexture@@UAEXHABVTPoint@@@Z @ 776 NONAME ; void CHuiTexture::SetSegmentOffset(int, class TPoint const &)
+	?SetSegmentSize@CHuiTexture@@UAEXHABVTSize@@@Z @ 777 NONAME ; void CHuiTexture::SetSegmentSize(int, class TSize const &)
+	?SetSegmentTextureSize@CHuiTexture@@UAEXHABVTSize@@@Z @ 778 NONAME ; void CHuiTexture::SetSegmentTextureSize(int, class TSize const &)
+	?SetSender@THuiCommand@@QAEXW4THuiCommandObjectType@@PAX@Z @ 779 NONAME ; void THuiCommand::SetSender(enum THuiCommandObjectType, void *)
+	?SetSessionId@CHuiBrush@@UAEXH@Z @ 780 NONAME ; void CHuiBrush::SetSessionId(int)
+	?SetSessionId@CHuiControl@@MAEXH@Z @ 781 NONAME ; void CHuiControl::SetSessionId(int)
+	?SetSessionId@CHuiControlGroup@@UAEXH@Z @ 782 NONAME ; void CHuiControlGroup::SetSessionId(int)
+	?SetSessionId@CHuiGridLayout@@UAEXH@Z @ 783 NONAME ; void CHuiGridLayout::SetSessionId(int)
+	?SetSessionId@CHuiLayout@@UAEXH@Z @ 784 NONAME ; void CHuiLayout::SetSessionId(int)
+	?SetSessionId@CHuiMesh@@UAEXH@Z @ 785 NONAME ; void CHuiMesh::SetSessionId(int)
+	?SetSessionId@CHuiTexture@@UAEXH@Z @ 786 NONAME ; void CHuiTexture::SetSessionId(int)
+	?SetSessionId@CHuiVisual@@UAEXH@Z @ 787 NONAME ; void CHuiVisual::SetSessionId(int)
+	?SetShadowStyle@CHuiTexture@@UAEXW4THuiShadowStyle@@@Z @ 788 NONAME ; void CHuiTexture::SetShadowStyle(enum THuiShadowStyle)
+	?SetSize@CHuiAnchorLayout@@UAEXABVTHuiRealSize@@H@Z @ 789 NONAME ; void CHuiAnchorLayout::SetSize(class THuiRealSize const &, int)
+	?SetSize@CHuiFlowLayout@@UAEXABVTHuiRealSize@@H@Z @ 790 NONAME ; void CHuiFlowLayout::SetSize(class THuiRealSize const &, int)
+	?SetSize@CHuiGridLayout@@UAEXABVTHuiRealSize@@H@Z @ 791 NONAME ; void CHuiGridLayout::SetSize(class THuiRealSize const &, int)
+	?SetSize@CHuiImageLoaderUtil@@QAEXVTSize@@W4TScaleMode@@@Z @ 792 NONAME ; void CHuiImageLoaderUtil::SetSize(class TSize, enum TScaleMode)
+	?SetSize@CHuiLayout@@UAEXABVTHuiRealSize@@H@Z @ 793 NONAME ; void CHuiLayout::SetSize(class THuiRealSize const &, int)
+	?SetSize@CHuiTexture@@UAEXABVTSize@@@Z @ 794 NONAME ; void CHuiTexture::SetSize(class TSize const &)
+	?SetSize@CHuiVisual@@UAEXABVTHuiRealSize@@H@Z @ 795 NONAME ; void CHuiVisual::SetSize(class THuiRealSize const &, int)
+	?SetSize@THuiTextureHandle@@QAEXABVTSize@@@Z @ 796 NONAME ; void THuiTextureHandle::SetSize(class TSize const &)
+	?SetSizeL@CHuiDisplay@@QAEXABVTSize@@@Z @ 797 NONAME ; void CHuiDisplay::SetSizeL(class TSize const &)
+	?SetSkinContent@CHuiTexture@@UAEXH@Z @ 798 NONAME ; void CHuiTexture::SetSkinContent(int)
+	?SetSkinInstance@CHuiImageLoaderUtil@@QAEXPAVMAknsSkinInstance@@@Z @ 799 NONAME ; void CHuiImageLoaderUtil::SetSkinInstance(class MAknsSkinInstance *)
+	?SetSpecularImage@CHuiMeshVisual@@QAEXABVTHuiImage@@@Z @ 800 NONAME ; void CHuiMeshVisual::SetSpecularImage(class THuiImage const &)
+	?SetStretch@CHuiImageVisual@@QAEXHH@Z @ 801 NONAME ; void CHuiImageVisual::SetStretch(int, int)
+	?SetStretchMode@CHuiImageVisual@@QAEXW4TStretchMode@CHuiGc@@@Z @ 802 NONAME ; void CHuiImageVisual::SetStretchMode(enum CHuiGc::TStretchMode)
+	?SetStrikeThrough@THuiTextStyle@@QAEXH@Z @ 803 NONAME ; void THuiTextStyle::SetStrikeThrough(int)
+	?SetStrokeWeight@THuiTextStyle@@QAEXH@Z @ 804 NONAME ; void THuiTextStyle::SetStrokeWeight(int)
+	?SetStyle@CHuiTextVisual@@QAEXW4THuiPreconfiguredTextStyle@@W4THuiBackgroundType@@@Z @ 805 NONAME ; void CHuiTextVisual::SetStyle(enum THuiPreconfiguredTextStyle, enum THuiBackgroundType)
+	?SetStyle@THuiTimedPoint@@QAEXW4THuiInterpolationStyle@@@Z @ 806 NONAME ; void THuiTimedPoint::SetStyle(enum THuiInterpolationStyle)
+	?SetStyle@THuiTimedValue@@QAEXW4THuiInterpolationStyle@@@Z @ 807 NONAME ; void THuiTimedValue::SetStyle(enum THuiInterpolationStyle)
+	?SetTagL@CHuiVisual@@QAEXABVTDesC8@@@Z @ 808 NONAME ; void CHuiVisual::SetTagL(class TDesC8 const &)
+	?SetTexCoords@THuiImage@@QAEXMMMMH@Z @ 809 NONAME ; void THuiImage::SetTexCoords(float, float, float, float, int)
+	?SetTextColor@THuiTextStyle@@QAEXABVTRgb@@@Z @ 810 NONAME ; void THuiTextStyle::SetTextColor(class TRgb const &)
+	?SetTextL@CHuiTextVisual@@QAEXABVTDesC16@@@Z @ 811 NONAME ; void CHuiTextVisual::SetTextL(class TDesC16 const &)
+	?SetTextSizeInPixels@THuiTextStyle@@QAEXHH@Z @ 812 NONAME ; void THuiTextStyle::SetTextSizeInPixels(int, int)
+	?SetTextSizeInTwips@THuiTextStyle@@QAEXHH@Z @ 813 NONAME ; void THuiTextStyle::SetTextSizeInTwips(int, int)
+	?SetTextStyle@CHuiTextVisual@@QAEXH@Z @ 814 NONAME ; void CHuiTextVisual::SetTextStyle(int)
+	?SetTexture@THuiImage@@QAEXABVMHuiTexture@@@Z @ 815 NONAME ; void THuiImage::SetTexture(class MHuiTexture const &)
+	?SetTextureId@CHuiTextureManager@@QAEHPAVCHuiTexture@@H@Z @ 816 NONAME ; int CHuiTextureManager::SetTextureId(class CHuiTexture *, int)
+	?SetTextureSize@THuiTextureHandle@@QAEXABVTSize@@@Z @ 817 NONAME ; void THuiTextureHandle::SetTextureSize(class TSize const &)
+	?SetTimeFactor@CHuiStatic@@SAXM@Z @ 818 NONAME ; void CHuiStatic::SetTimeFactor(float)
+	?SetTransitionTime@CHuiLayout@@QAEXH@Z @ 819 NONAME ; void CHuiLayout::SetTransitionTime(int)
+	?SetUnderline@THuiTextStyle@@QAEXH@Z @ 820 NONAME ; void THuiTextStyle::SetUnderline(int)
+	?SetUsageL@CHuiDisplay@@QAEXI@Z @ 821 NONAME ; void CHuiDisplay::SetUsageL(unsigned int)
+	?SetUseDepth@CHuiDisplay@@QAEXH@Z @ 822 NONAME ; void CHuiDisplay::SetUseDepth(int)
+	?SetViewportPos@CHuiViewportLayout@@QAEXABVTHuiRealPoint@@H@Z @ 823 NONAME ; void CHuiViewportLayout::SetViewportPos(class THuiRealPoint const &, int)
+	?SetViewportSize@CHuiViewportLayout@@QAEXABVTHuiRealSize@@H@Z @ 824 NONAME ; void CHuiViewportLayout::SetViewportSize(class THuiRealSize const &, int)
+	?SetVirtualSize@CHuiViewportLayout@@QAEXABVTHuiRealSize@@H@Z @ 825 NONAME ; void CHuiViewportLayout::SetVirtualSize(class THuiRealSize const &, int)
+	?SetVisibleArea@CHuiDisplay@@QAEXABVTRect@@@Z @ 826 NONAME ; void CHuiDisplay::SetVisibleArea(class TRect const &)
+	?SetVisual@THuiEvent@@QAEXPAVCHuiVisual@@@Z @ 827 NONAME ; void THuiEvent::SetVisual(class CHuiVisual *)
+	?SetWidthFunction@CHuiLineVisual@@QAEXPAVMHuiMappingFunction@@@Z @ 828 NONAME ; void CHuiLineVisual::SetWidthFunction(class MHuiMappingFunction *)
+	?SetWindowTransformation@CHuiGc@@QAEXPAVCHuiTransformation@@@Z @ 829 NONAME ; void CHuiGc::SetWindowTransformation(class CHuiTransformation *)
+	?SetWithSpeed@THuiTimedPoint@@QAEXABVTHuiRealPoint@@M@Z @ 830 NONAME ; void THuiTimedPoint::SetWithSpeed(class THuiRealPoint const &, float)
+	?SetWithSpeed@THuiTimedPoint@@QAEXMM@Z @ 831 NONAME ; void THuiTimedPoint::SetWithSpeed(float, float)
+	?SetWithSpeed@THuiTimedValue@@QAEXMM@Z @ 832 NONAME ; void THuiTimedValue::SetWithSpeed(float, float)
+	?SetWrapping@CHuiTextVisual@@QAEXW4TLineWrap@1@@Z @ 833 NONAME ; void CHuiTextVisual::SetWrapping(enum CHuiTextVisual::TLineWrap)
+	?SetX@THuiTransformationCommand@@QAEXABVTHuiTimedValue@@@Z @ 834 NONAME ; void THuiTransformationCommand::SetX(class THuiTimedValue const &)
+	?SetY@THuiTransformationCommand@@QAEXABVTHuiTimedValue@@@Z @ 835 NONAME ; void THuiTransformationCommand::SetY(class THuiTimedValue const &)
+	?SetZ@THuiTransformationCommand@@QAEXABVTHuiTimedValue@@@Z @ 836 NONAME ; void THuiTransformationCommand::SetZ(class THuiTimedValue const &)
+	?ShadowMatrix@HuiUtil@@SAXQBM00QAM@Z @ 837 NONAME ; void HuiUtil::ShadowMatrix(float const * const, float const * const, float const * const, float * const)
+	?ShadowStyle@CHuiTexture@@QBE?AW4THuiShadowStyle@@XZ @ 838 NONAME ; enum THuiShadowStyle CHuiTexture::ShadowStyle(void) const
+	?ShadowTexture@THuiImage@@QBE?AVTHuiTextureHandle@@XZ @ 839 NONAME ; class THuiTextureHandle THuiImage::ShadowTexture(void) const
+	?ShadowedTexture@CHuiAnimatedTexture@@UAEPAVMHuiShadowedTexture@@XZ @ 840 NONAME ; class MHuiShadowedTexture * CHuiAnimatedTexture::ShadowedTexture(void)
+	?ShadowedTexture@CHuiAnimatedTexture@@UBEPBVMHuiShadowedTexture@@XZ @ 841 NONAME ; class MHuiShadowedTexture const * CHuiAnimatedTexture::ShadowedTexture(void) const
+	?ShadowedTexture@CHuiTexture@@UAEPAVMHuiShadowedTexture@@XZ @ 842 NONAME ; class MHuiShadowedTexture * CHuiTexture::ShadowedTexture(void)
+	?ShadowedTexture@CHuiTexture@@UBEPBVMHuiShadowedTexture@@XZ @ 843 NONAME ; class MHuiShadowedTexture const * CHuiTexture::ShadowedTexture(void) const
+	?ShadowedTexture@THuiTextureHandle@@UAEPAVMHuiShadowedTexture@@XZ @ 844 NONAME ; class MHuiShadowedTexture * THuiTextureHandle::ShadowedTexture(void)
+	?ShadowedTexture@THuiTextureHandle@@UBEPBVMHuiShadowedTexture@@XZ @ 845 NONAME ; class MHuiShadowedTexture const * THuiTextureHandle::ShadowedTexture(void) const
+	?Show@CHuiDisplay@@QAEXH@Z @ 846 NONAME ; void CHuiDisplay::Show(int)
+	?Size@CHuiAnimatedTexture@@UBE?AVTSize@@XZ @ 847 NONAME ; class TSize CHuiAnimatedTexture::Size(void) const
+	?Size@CHuiDisplay@@QBE?AVTSize@@XZ @ 848 NONAME ; class TSize CHuiDisplay::Size(void) const
+	?Size@CHuiTexture@@UBE?AVTSize@@XZ @ 849 NONAME ; class TSize CHuiTexture::Size(void) const
+	?Size@CHuiVisual@@QBEABVTHuiTimedPoint@@XZ @ 850 NONAME ; class THuiTimedPoint const & CHuiVisual::Size(void) const
+	?Size@THuiActionCommand@@UBEHXZ @ 851 NONAME ; int THuiActionCommand::Size(void) const
+	?Size@THuiControlCommand@@UBEHXZ @ 852 NONAME ; int THuiControlCommand::Size(void) const
+	?Size@THuiCustomEventCommand@@UBEHXZ @ 853 NONAME ; int THuiCustomEventCommand::Size(void) const
+	?Size@THuiGroupCommand@@UBEHXZ @ 854 NONAME ; int THuiGroupCommand::Size(void) const
+	?Size@THuiImageCommand@@UBEHXZ @ 855 NONAME ; int THuiImageCommand::Size(void) const
+	?Size@THuiMarkerCommand@@UBEHXZ @ 856 NONAME ; int THuiMarkerCommand::Size(void) const
+	?Size@THuiObjectCommand@@UBEHXZ @ 857 NONAME ; int THuiObjectCommand::Size(void) const
+	?Size@THuiPointCommand@@UBEHXZ @ 858 NONAME ; int THuiPointCommand::Size(void) const
+	?Size@THuiTextCommand@@UBEHXZ @ 859 NONAME ; int THuiTextCommand::Size(void) const
+	?Size@THuiTextureHandle@@UBE?AVTSize@@XZ @ 860 NONAME ; class TSize THuiTextureHandle::Size(void) const
+	?Size@THuiTransformationCommand@@UBEHXZ @ 861 NONAME ; int THuiTransformationCommand::Size(void) const
+	?Size@THuiValueCommand@@UBEHXZ @ 862 NONAME ; int THuiValueCommand::Size(void) const
+	?Size@THuiVisualCommand@@UBEHXZ @ 863 NONAME ; int THuiVisualCommand::Size(void) const
+	?SizeChanged@CHuiDisplayCoeControl@@EAEXXZ @ 864 NONAME ; void CHuiDisplayCoeControl::SizeChanged(void)
+	?Skin@CHuiEnv@@QBEAAVCHuiSkin@@XZ @ 865 NONAME ; class CHuiSkin & CHuiEnv::Skin(void) const
+	?Skin@CHuiVisual@@QBEAAVCHuiSkin@@XZ @ 866 NONAME ; class CHuiSkin & CHuiVisual::Skin(void) const
+	?SkinExtension@CHuiS60Skin@@MAEXABVTUid@@PAPAX@Z @ 867 NONAME ; void CHuiS60Skin::SkinExtension(class TUid const &, void * *)
+	?Speed@THuiPointCommand@@QBEMXZ @ 868 NONAME ; float THuiPointCommand::Speed(void) const
+	?Speed@THuiValueCommand@@QBEMXZ @ 869 NONAME ; float THuiValueCommand::Speed(void) const
+	?Start@CHuiGifAnimationTexture@@QAEXXZ @ 870 NONAME ; void CHuiGifAnimationTexture::Start(void)
+	?StartAnimationController@CHuiM3GMesh@@UAEXH@Z @ 871 NONAME ; void CHuiM3GMesh::StartAnimationController(int)
+	?StartAnimationController@CHuiMesh@@UAEXH@Z @ 872 NONAME ; void CHuiMesh::StartAnimationController(int)
+	?StartRefresh@CHuiEnv@@QAEXH@Z @ 873 NONAME ; void CHuiEnv::StartRefresh(int)
+	?Static@CHuiEnv@@SAPAV1@XZ @ 874 NONAME ; class CHuiEnv * CHuiEnv::Static(void)
+	?Step@CHuiTransformation@@QAEAAUTTransform@1@H@Z @ 875 NONAME ; struct CHuiTransformation::TTransform & CHuiTransformation::Step(int)
+	?Step@THuiTransformationCommand@@QBEHXZ @ 876 NONAME ; int THuiTransformationCommand::Step(void) const
+	?Stop@CHuiGifAnimationTexture@@QAEXXZ @ 877 NONAME ; void CHuiGifAnimationTexture::Stop(void)
+	?StopAnimationController@CHuiM3GMesh@@UAEXH@Z @ 878 NONAME ; void CHuiM3GMesh::StopAnimationController(int)
+	?StopAnimationController@CHuiMesh@@UAEXH@Z @ 879 NONAME ; void CHuiMesh::StopAnimationController(int)
+	?StretchUniformly@CHuiMesh@@UAEXMMMMMM@Z @ 880 NONAME ; void CHuiMesh::StretchUniformly(float, float, float, float, float, float)
+	?StretchUniformly@CHuiProceduralMesh@@UAEXMMMMMM@Z @ 881 NONAME ; void CHuiProceduralMesh::StretchUniformly(float, float, float, float, float, float)
+	?StrikeThrough@THuiTextStyle@@QBEHXZ @ 882 NONAME ; int THuiTextStyle::StrikeThrough(void) const
+	?StrokeWeight@THuiTextStyle@@QAEHXZ @ 883 NONAME ; int THuiTextStyle::StrokeWeight(void)
+	?Style@CHuiTextVisual@@QBE?AW4THuiPreconfiguredTextStyle@@XZ @ 884 NONAME ; enum THuiPreconfiguredTextStyle CHuiTextVisual::Style(void) const
+	?Style@THuiTimedValue@@QBE?AW4THuiInterpolationStyle@@XZ @ 885 NONAME ; enum THuiInterpolationStyle THuiTimedValue::Style(void) const
+	?StyleTextColor@CHuiS60Skin@@UBE?AVTRgb@@W4THuiPreconfiguredTextStyle@@W4THuiBackgroundType@@@Z @ 886 NONAME ; class TRgb CHuiS60Skin::StyleTextColor(enum THuiPreconfiguredTextStyle, enum THuiBackgroundType) const
+	?SubstringExtents@CHuiTextVisual@@QBE?AVTRect@@II@Z @ 887 NONAME ; class TRect CHuiTextVisual::SubstringExtents(unsigned int, unsigned int) const
+	?Suspend@THuiTimedValue@@QAEXH@Z @ 888 NONAME ; void THuiTimedValue::Suspend(int)
+	?Tag@CHuiVisual@@QBEABVTDesC8@@XZ @ 889 NONAME ; class TDesC8 const & CHuiVisual::Tag(void) const
+	?TagMatches@HuiUtil@@SAHABVTDesC8@@0@Z @ 890 NONAME ; int HuiUtil::TagMatches(class TDesC8 const &, class TDesC8 const &)
+	?Target@THuiPointCommand@@QBE?AVTHuiRealPoint@@XZ @ 891 NONAME ; class THuiRealPoint THuiPointCommand::Target(void) const
+	?Target@THuiTimedPoint@@QBE?AVTPoint@@XZ @ 892 NONAME ; class TPoint THuiTimedPoint::Target(void) const
+	?Target@THuiTimedValue@@QBEMXZ @ 893 NONAME ; float THuiTimedValue::Target(void) const
+	?Target@THuiValueCommand@@QBEMXZ @ 894 NONAME ; float THuiValueCommand::Target(void) const
+	?Text@CHuiTextVisual@@QBEABVTDesC16@@XZ @ 895 NONAME ; class TDesC16 const & CHuiTextVisual::Text(void) const
+	?Text@THuiTextCommand@@QBEABVTDesC16@@XZ @ 896 NONAME ; class TDesC16 const & THuiTextCommand::Text(void) const
+	?TextColor@THuiTextStyle@@QBE?AVTRgb@@XZ @ 897 NONAME ; class TRgb THuiTextStyle::TextColor(void) const
+	?TextExtents@CHuiTextVisual@@QBE?AVTSize@@XZ @ 898 NONAME ; class TSize CHuiTextVisual::TextExtents(void) const
+	?TextSizeInPixels@THuiTextStyle@@QAEHH@Z @ 899 NONAME ; int THuiTextStyle::TextSizeInPixels(int)
+	?TextSizeInTwips@THuiTextStyle@@QAEHH@Z @ 900 NONAME ; int THuiTextStyle::TextSizeInTwips(int)
+	?TextStyle@CHuiTextStyleManager@@QAEPAVTHuiTextStyle@@H@Z @ 901 NONAME ; class THuiTextStyle * CHuiTextStyleManager::TextStyle(int)
+	?TextStyleManager@CHuiEnv@@QBEAAVCHuiTextStyleManager@@XZ @ 902 NONAME ; class CHuiTextStyleManager & CHuiEnv::TextStyleManager(void) const
+	?TextVisual@THuiTextCommand@@QBEAAVCHuiTextVisual@@XZ @ 903 NONAME ; class CHuiTextVisual & THuiTextCommand::TextVisual(void) const
+	?Texture@CHuiAnimatedTexture@@QAEAAVCHuiTexture@@XZ @ 904 NONAME ; class CHuiTexture & CHuiAnimatedTexture::Texture(void)
+	?Texture@CHuiTextureManager@@QAEPAVCHuiTexture@@H@Z @ 905 NONAME ; class CHuiTexture * CHuiTextureManager::Texture(int)
+	?Texture@CHuiTextureManager@@QBEPBVCHuiTexture@@H@Z @ 906 NONAME ; class CHuiTexture const * CHuiTextureManager::Texture(int) const
+	?Texture@THuiImage@@QBEABVMHuiSegmentedTexture@@XZ @ 907 NONAME ; class MHuiSegmentedTexture const & THuiImage::Texture(void) const
+	?TextureChanged@CHuiAnimatedTexture@@UBEHXZ @ 908 NONAME ; int CHuiAnimatedTexture::TextureChanged(void) const
+	?TextureChanged@CHuiTexture@@UBEHXZ @ 909 NONAME ; int CHuiTexture::TextureChanged(void) const
+	?TextureChanged@THuiTextureHandle@@UBEHXZ @ 910 NONAME ; int THuiTextureHandle::TextureChanged(void) const
+	?TextureClearChanged@CHuiAnimatedTexture@@UBEXXZ @ 911 NONAME ; void CHuiAnimatedTexture::TextureClearChanged(void) const
+	?TextureClearChanged@CHuiTexture@@UBEXXZ @ 912 NONAME ; void CHuiTexture::TextureClearChanged(void) const
+	?TextureClearChanged@THuiTextureHandle@@UBEXXZ @ 913 NONAME ; void THuiTextureHandle::TextureClearChanged(void) const
+	?TextureContentReleased@CHuiSkin@@UAEXAAVCHuiTexture@@@Z @ 914 NONAME ; void CHuiSkin::TextureContentReleased(class CHuiTexture &)
+	?TextureContentUploaded@CHuiSkin@@UAEXAAVCHuiTexture@@@Z @ 915 NONAME ; void CHuiSkin::TextureContentUploaded(class CHuiTexture &)
+	?TextureExtension@CHuiAnimatedTexture@@MAEXABVTUid@@PAPAX@Z @ 916 NONAME ; void CHuiAnimatedTexture::TextureExtension(class TUid const &, void * *)
+	?TextureExtension@THuiTextureHandle@@MAEXABVTUid@@PAPAX@Z @ 917 NONAME ; void THuiTextureHandle::TextureExtension(class TUid const &, void * *)
+	?TextureIf@THuiImage@@QBEABVMHuiTexture@@XZ @ 918 NONAME ; class MHuiTexture const & THuiImage::TextureIf(void) const
+	?TextureL@CHuiS60Skin@@UAEABVCHuiTexture@@H@Z @ 919 NONAME ; class CHuiTexture const & CHuiS60Skin::TextureL(int)
+	?TextureL@CHuiSkin@@UAEABVCHuiTexture@@H@Z @ 920 NONAME ; class CHuiTexture const & CHuiSkin::TextureL(int)
+	?TextureL@CHuiTextureManager@@QAEPAVCHuiTexture@@H@Z @ 921 NONAME ; class CHuiTexture * CHuiTextureManager::TextureL(int)
+	?TextureManager@CHuiControl@@QBEAAVCHuiTextureManager@@XZ @ 922 NONAME ; class CHuiTextureManager & CHuiControl::TextureManager(void) const
+	?TextureManager@CHuiEnv@@QBEAAVCHuiTextureManager@@XZ @ 923 NONAME ; class CHuiTextureManager & CHuiEnv::TextureManager(void) const
+	?Tic@CHuiStatic@@SAXH@Z @ 924 NONAME ; void CHuiStatic::Tic(int)
+	?Time@CHuiStatic@@SAABVTTime@@XZ @ 925 NONAME ; class TTime const & CHuiStatic::Time(void)
+	?TimeFactor@CHuiStatic@@SAMXZ @ 926 NONAME ; float CHuiStatic::TimeFactor(void)
+	?TimePaused@CHuiStatic@@SAHXZ @ 927 NONAME ; int CHuiStatic::TimePaused(void)
+	?TimeUntilCommand@CHuiEnv@@QAEHPAXW4THuiCommandType@@@Z @ 928 NONAME ; int CHuiEnv::TimeUntilCommand(void *, enum THuiCommandType)
+	?TimedPoint@THuiPointCommand@@QBEAAVTHuiTimedPoint@@XZ @ 929 NONAME ; class THuiTimedPoint & THuiPointCommand::TimedPoint(void) const
+	?TimedValue@THuiValueCommand@@QBEAAVTHuiTimedValue@@XZ @ 930 NONAME ; class THuiTimedValue & THuiValueCommand::TimedValue(void) const
+	?Toc@CHuiStatic@@SAMH@Z @ 931 NONAME ; float CHuiStatic::Toc(int)
+	?TopLeft@THuiImage@@QBE?AVTHuiRealPoint@@XZ @ 932 NONAME ; class THuiRealPoint THuiImage::TopLeft(void) const
+	?Transform@CHuiVisual@@IBEXAAVCHuiGc@@HPBVTHuiRealRect@@@Z @ 933 NONAME ; void CHuiVisual::Transform(class CHuiGc &, int, class THuiRealRect const *) const
+	?Transformation@CHuiControlGroup@@QAEAAVCHuiTransformation@@XZ @ 934 NONAME ; class CHuiTransformation & CHuiControlGroup::Transformation(void)
+	?Transformation@CHuiDisplay@@QBEAAVCHuiTransformation@@XZ @ 935 NONAME ; class CHuiTransformation & CHuiDisplay::Transformation(void) const
+	?Transformation@CHuiVisual@@QAEAAVCHuiTransformation@@XZ @ 936 NONAME ; class CHuiTransformation & CHuiVisual::Transformation(void)
+	?Transformation@THuiTransformationCommand@@QBEAAVCHuiTransformation@@XZ @ 937 NONAME ; class CHuiTransformation & THuiTransformationCommand::Transformation(void) const
+	?TransitionTime@CHuiLayout@@QBEHXZ @ 938 NONAME ; int CHuiLayout::TransitionTime(void) const
+	?TransitionTime@THuiPointCommand@@QBEHXZ @ 939 NONAME ; int THuiPointCommand::TransitionTime(void) const
+	?TransitionTime@THuiValueCommand@@QBEHXZ @ 940 NONAME ; int THuiValueCommand::TransitionTime(void) const
+	?Translate@CHuiTransformation@@QAEXABVTHuiTimedValue@@0@Z @ 941 NONAME ; void CHuiTransformation::Translate(class THuiTimedValue const &, class THuiTimedValue const &)
+	?Translate@CHuiTransformation@@QAEXMM@Z @ 942 NONAME ; void CHuiTransformation::Translate(float, float)
+	?Translate@THuiImage@@QAEXMMH@Z @ 943 NONAME ; void THuiImage::Translate(float, float, int)
+	?Type@CHuiBrush@@UBE?AW4TType@MHuiSessionObject@@XZ @ 944 NONAME ; enum MHuiSessionObject::TType CHuiBrush::Type(void) const
+	?Type@CHuiControl@@MBE?AW4TType@MHuiSessionObject@@XZ @ 945 NONAME ; enum MHuiSessionObject::TType CHuiControl::Type(void) const
+	?Type@CHuiControlGroup@@UBE?AW4TType@MHuiSessionObject@@XZ @ 946 NONAME ; enum MHuiSessionObject::TType CHuiControlGroup::Type(void) const
+	?Type@CHuiGridLayout@@UBE?AW4TType@MHuiSessionObject@@XZ @ 947 NONAME ; enum MHuiSessionObject::TType CHuiGridLayout::Type(void) const
+	?Type@CHuiLayout@@UBE?AW4TType@MHuiSessionObject@@XZ @ 948 NONAME ; enum MHuiSessionObject::TType CHuiLayout::Type(void) const
+	?Type@CHuiMesh@@UBE?AW4TType@MHuiSessionObject@@XZ @ 949 NONAME ; enum MHuiSessionObject::TType CHuiMesh::Type(void) const
+	?Type@CHuiTexture@@UBE?AW4TType@MHuiSessionObject@@XZ @ 950 NONAME ; enum MHuiSessionObject::TType CHuiTexture::Type(void) const
+	?Type@CHuiVisual@@UBE?AW4TType@MHuiSessionObject@@XZ @ 951 NONAME ; enum MHuiSessionObject::TType CHuiVisual::Type(void) const
+	?Type@THuiCommand@@QBE?AW4THuiCommandType@@XZ @ 952 NONAME ; enum THuiCommandType THuiCommand::Type(void) const
+	?Type@THuiEvent@@QBE?AW4TType@1@XZ @ 953 NONAME ; enum THuiEvent::TType THuiEvent::Type(void) const
+	?Underline@THuiTextStyle@@QBEHXZ @ 954 NONAME ; int THuiTextStyle::Underline(void) const
+	?UnloadTexture@CHuiTextureManager@@QAEXABVTDesC16@@H@Z @ 955 NONAME ; void CHuiTextureManager::UnloadTexture(class TDesC16 const &, int)
+	?UnloadTexture@CHuiTextureManager@@QAEXH@Z @ 956 NONAME ; void CHuiTextureManager::UnloadTexture(int)
+	?UnmappedNow@THuiTimedValue@@QBEMXZ @ 957 NONAME ; float THuiTimedValue::UnmappedNow(void) const
+	?UpdateChildLayout@CHuiLayout@@UAEXHH@Z @ 958 NONAME ; void CHuiLayout::UpdateChildLayout(int, int)
+	?UpdateChildrenLayout@CHuiGridLayout@@UAEXH@Z @ 959 NONAME ; void CHuiGridLayout::UpdateChildrenLayout(int)
+	?UpdateChildrenLayout@CHuiLayout@@UAEXH@Z @ 960 NONAME ; void CHuiLayout::UpdateChildrenLayout(int)
+	?UpdateChildrenLayout@CHuiVisual@@UAEXH@Z @ 961 NONAME ; void CHuiVisual::UpdateChildrenLayout(int)
+	?VerticalInnerPadding@CHuiLayout@@QBEHXZ @ 962 NONAME ; int CHuiLayout::VerticalInnerPadding(void) const
+	?VerticalOrigin@CHuiVisual@@QBE?AW4THuiVisualVOrigin@@XZ @ 963 NONAME ; enum THuiVisualVOrigin CHuiVisual::VerticalOrigin(void) const
+	?VirtualSize@CHuiLayout@@QBE?AVTSize@@XZ @ 964 NONAME ; class TSize CHuiLayout::VirtualSize(void) const
+	?VisibleArea@CHuiDisplay@@QBE?AVTRect@@XZ @ 965 NONAME ; class TRect CHuiDisplay::VisibleArea(void) const
+	?Visual@CHuiControl@@QBEAAVCHuiVisual@@H@Z @ 966 NONAME ; class CHuiVisual & CHuiControl::Visual(int) const
+	?Visual@CHuiGridLayout@@UBEAAVCHuiVisual@@H@Z @ 967 NONAME ; class CHuiVisual & CHuiGridLayout::Visual(int) const
+	?Visual@CHuiLayout@@UBEAAVCHuiVisual@@H@Z @ 968 NONAME ; class CHuiVisual & CHuiLayout::Visual(int) const
+	?Visual@CHuiVisual@@UBEAAV1@H@Z @ 969 NONAME ; class CHuiVisual & CHuiVisual::Visual(int) const
+	?Visual@THuiEvent@@QBEPAVCHuiVisual@@XZ @ 970 NONAME ; class CHuiVisual * THuiEvent::Visual(void) const
+	?Visual@THuiVisualCommand@@QBEAAVCHuiVisual@@XZ @ 971 NONAME ; class CHuiVisual & THuiVisualCommand::Visual(void) const
+	?VisualAddedL@CHuiControl@@MAEXPAVCHuiVisual@@@Z @ 972 NONAME ; void CHuiControl::VisualAddedL(class CHuiVisual *)
+	?VisualCount@CHuiControl@@QBEHXZ @ 973 NONAME ; int CHuiControl::VisualCount(void) const
+	?VisualDestroyed@CHuiControl@@UAEXAAVCHuiVisual@@@Z @ 974 NONAME ; void CHuiControl::VisualDestroyed(class CHuiVisual &)
+	?VisualExtension@CHuiGridLayout@@UAEXABVTUid@@PAPAX@Z @ 975 NONAME ; void CHuiGridLayout::VisualExtension(class TUid const &, void * *)
+	?VisualExtension@CHuiLayout@@MAEXABVTUid@@PAPAX@Z @ 976 NONAME ; void CHuiLayout::VisualExtension(class TUid const &, void * *)
+	?VisualExtension@CHuiVisual@@MAEXABVTUid@@PAPAX@Z @ 977 NONAME ; void CHuiVisual::VisualExtension(class TUid const &, void * *)
+	?VisualFactory@CHuiEnv@@QBEAAVCHuiVisualFactory@@XZ @ 978 NONAME ; class CHuiVisualFactory & CHuiEnv::VisualFactory(void) const
+	?VisualLayoutUpdated@CHuiControl@@UAEXAAVCHuiVisual@@@Z @ 979 NONAME ; void CHuiControl::VisualLayoutUpdated(class CHuiVisual &)
+	?VisualPrepareDrawFailed@CHuiControl@@UAEXAAVCHuiVisual@@H@Z @ 980 NONAME ; void CHuiControl::VisualPrepareDrawFailed(class CHuiVisual &, int)
+	?VisualRemoved@CHuiControl@@MAEXPAVCHuiVisual@@@Z @ 981 NONAME ; void CHuiControl::VisualRemoved(class CHuiVisual *)
+	?Weight@CHuiGridLayout@@QBE?AUTHuiMetric@@W4THuiGridDimension@@H@Z @ 982 NONAME ; struct THuiMetric CHuiGridLayout::Weight(enum THuiGridDimension, int) const
+	?WrapValue@HuiUtil@@SAXAAMMM@Z @ 983 NONAME ; void HuiUtil::WrapValue(float &, float, float)
+	?Wrapping@CHuiTextVisual@@QBE?AW4TLineWrap@1@XZ @ 984 NONAME ; enum CHuiTextVisual::TLineWrap CHuiTextVisual::Wrapping(void) const
+	?BoxMetricToPixelRect@CHuiVisual@@QBEXABUTHuiBoxMetric@@AAVTHuiRealRect@@W4THuiReferenceState@@@Z @ 985 NONAME ; void CHuiVisual::BoxMetricToPixelRect(struct THuiBoxMetric const &, class THuiRealRect &, enum THuiReferenceState) const
+	?LocalPointInPixels@CHuiVisual@@QBE?AVTHuiRealPoint@@ABV2@W4THuiReferenceState@@@Z @ 986 NONAME ; class THuiRealPoint CHuiVisual::LocalPointInPixels(class THuiRealPoint const &, enum THuiReferenceState) const
+	?MetricReferenceInPixels@CHuiVisual@@QBE?AVTHuiRealPoint@@ABUTHuiXYMetric@@W4THuiReferenceState@@@Z @ 987 NONAME ; class THuiRealPoint CHuiVisual::MetricReferenceInPixels(struct THuiXYMetric const &, enum THuiReferenceState) const
+	?MetricToPixels@CHuiVisual@@QBE?AVTHuiRealPoint@@ABUTHuiXYMetric@@W4THuiReferenceState@@@Z @ 988 NONAME ; class THuiRealPoint CHuiVisual::MetricToPixels(struct THuiXYMetric const &, enum THuiReferenceState) const
+	?PaddingInPixels@CHuiVisual@@QBE?AVTHuiRealRect@@W4THuiReferenceState@@@Z @ 989 NONAME ; class THuiRealRect CHuiVisual::PaddingInPixels(enum THuiReferenceState) const
+	?PixelPointInLocal@CHuiVisual@@QBE?AVTHuiRealPoint@@ABV2@W4THuiReferenceState@@@Z @ 990 NONAME ; class THuiRealPoint CHuiVisual::PixelPointInLocal(class THuiRealPoint const &, enum THuiReferenceState) const
+	?PixelsToMetric@CHuiVisual@@QBEXABVTHuiRealPoint@@AAUTHuiXYMetric@@W4THuiReferenceState@@@Z @ 991 NONAME ; void CHuiVisual::PixelsToMetric(class THuiRealPoint const &, struct THuiXYMetric &, enum THuiReferenceState) const
+	?UpdateSiblingLayout@CHuiVisual@@QAEXH@Z @ 992 NONAME ; void CHuiVisual::UpdateSiblingLayout(int)
+	?SetColor@CHuiLineVisual@@QAEXABVTRgb@@@Z @ 993 NONAME ; void CHuiLineVisual::SetColor(class TRgb const &)
+	?MetricReferenceForLayoutInPixels@CHuiLayout@@IBE?AVTHuiRealPoint@@ABUTHuiXYMetric@@@Z @ 994 NONAME ; class THuiRealPoint CHuiLayout::MetricReferenceForLayoutInPixels(struct THuiXYMetric const &) const
+	?AppendArcL@CHuiCurvePath@@QAEXABVTHuiRealPoint@@ABVTHuiRealSize@@MMM@Z @ 995 NONAME ; void CHuiCurvePath::AppendArcL(class THuiRealPoint const &, class THuiRealSize const &, float, float, float)
+	?AppendLineL@CHuiCurvePath@@QAEXABVTHuiRealPoint@@0M@Z @ 996 NONAME ; void CHuiCurvePath::AppendLineL(class THuiRealPoint const &, class THuiRealPoint const &, float)
+	?SetDropShadow@CHuiImageVisual@@QAEXABUTHuiMetric@@@Z @ 997 NONAME ; void CHuiImageVisual::SetDropShadow(struct THuiMetric const &)
+	?SetDropShadow@CHuiImageVisual@@QAEXABUTHuiXYMetric@@@Z @ 998 NONAME ; void CHuiImageVisual::SetDropShadow(struct THuiXYMetric const &)
+	?NewL@CHuiBorderBrush@@SAPAV1@ABUTHuiXYMetric@@0@Z @ 999 NONAME ; class CHuiBorderBrush * CHuiBorderBrush::NewL(struct THuiXYMetric const &, struct THuiXYMetric const &)
+	?NewL@CHuiDropShadowBrush@@SAPAV1@ABUTHuiMetric@@@Z @ 1000 NONAME ; class CHuiDropShadowBrush * CHuiDropShadowBrush::NewL(struct THuiMetric const &)
+	?NewL@CHuiFrameBrush@@SAPAV1@ABVTAknsItemID@@ABUTHuiXYMetric@@@Z @ 1001 NONAME ; class CHuiFrameBrush * CHuiFrameBrush::NewL(class TAknsItemID const &, struct THuiXYMetric const &)
+	?NewL@CHuiShadowBorderBrush@@SAPAV1@ABUTHuiMetric@@@Z @ 1002 NONAME ; class CHuiShadowBorderBrush * CHuiShadowBorderBrush::NewL(struct THuiMetric const &)
+	?NewLC@CHuiBorderBrush@@SAPAV1@ABUTHuiXYMetric@@0@Z @ 1003 NONAME ; class CHuiBorderBrush * CHuiBorderBrush::NewLC(struct THuiXYMetric const &, struct THuiXYMetric const &)
+	?NewLC@CHuiDropShadowBrush@@SAPAV1@ABUTHuiMetric@@@Z @ 1004 NONAME ; class CHuiDropShadowBrush * CHuiDropShadowBrush::NewLC(struct THuiMetric const &)
+	?NewLC@CHuiFrameBrush@@SAPAV1@ABVTAknsItemID@@ABUTHuiXYMetric@@@Z @ 1005 NONAME ; class CHuiFrameBrush * CHuiFrameBrush::NewLC(class TAknsItemID const &, struct THuiXYMetric const &)
+	?NewLC@CHuiShadowBorderBrush@@SAPAV1@ABUTHuiMetric@@@Z @ 1006 NONAME ; class CHuiShadowBorderBrush * CHuiShadowBorderBrush::NewLC(struct THuiMetric const &)
+	?SetColor@CHuiDropShadowBrush@@QAEXABVTRgb@@@Z @ 1007 NONAME ; void CHuiDropShadowBrush::SetColor(class TRgb const &)
+	?SetDepth@CHuiDropShadowBrush@@QAEXABUTHuiMetric@@@Z @ 1008 NONAME ; void CHuiDropShadowBrush::SetDepth(struct THuiMetric const &)
+	?SetEdgeOffset@CHuiBorderBrush@@QAEXABUTHuiXYMetric@@@Z @ 1009 NONAME ; void CHuiBorderBrush::SetEdgeOffset(struct THuiXYMetric const &)
+	?SetEdgeOffset@CHuiFrameBrush@@QAEXABUTHuiXYMetric@@@Z @ 1010 NONAME ; void CHuiFrameBrush::SetEdgeOffset(struct THuiXYMetric const &)
+	?SetImageOffset@CHuiBorderBrush@@QAEXABUTHuiXYMetric@@@Z @ 1011 NONAME ; void CHuiBorderBrush::SetImageOffset(struct THuiXYMetric const &)
+	?SetSoftness@CHuiDropShadowBrush@@QAEXABUTHuiMetric@@@Z @ 1012 NONAME ; void CHuiDropShadowBrush::SetSoftness(struct THuiMetric const &)
+	?SetThickness@CHuiBorderBrush@@QAEXABUTHuiXYMetric@@@Z @ 1013 NONAME ; void CHuiBorderBrush::SetThickness(struct THuiXYMetric const &)
+	?SetWidth@CHuiShadowBorderBrush@@QAEXABUTHuiMetric@@@Z @ 1014 NONAME ; void CHuiShadowBorderBrush::SetWidth(struct THuiMetric const &)
+	??1CHuiSkinAnimationTexture@@UAE@XZ @ 1015 NONAME ; CHuiSkinAnimationTexture::~CHuiSkinAnimationTexture(void)
+	?Id@CHuiSkinAnimationTexture@@QAEHXZ @ 1016 NONAME ; int CHuiSkinAnimationTexture::Id(void)
+	?NewL@CHuiSkinAnimationTexture@@SAPAV1@ABVTDesC16@@AAVCHuiTextureManager@@HW4THuiTextureUploadFlags@@@Z @ 1017 NONAME ; class CHuiSkinAnimationTexture * CHuiSkinAnimationTexture::NewL(class TDesC16 const &, class CHuiTextureManager &, int, enum THuiTextureUploadFlags)
+	?Start@CHuiSkinAnimationTexture@@QAEXXZ @ 1018 NONAME ; void CHuiSkinAnimationTexture::Start(void)
+	?Stop@CHuiSkinAnimationTexture@@QAEXXZ @ 1019 NONAME ; void CHuiSkinAnimationTexture::Stop(void)
+	?SetScrollOffsetInBaseUnits@CHuiLayout@@QAEXABVTHuiRealPoint@@H@Z @ 1020 NONAME ; void CHuiLayout::SetScrollOffsetInBaseUnits(class THuiRealPoint const &, int)
+	?MaxSizeInBaseUnits@CHuiVisual@@QBE?AVTHuiRealSize@@XZ @ 1021 NONAME ; class THuiRealSize CHuiVisual::MaxSizeInBaseUnits(void) const
+	?MinSizeInBaseUnits@CHuiVisual@@QBE?AVTHuiRealSize@@XZ @ 1022 NONAME ; class THuiRealSize CHuiVisual::MinSizeInBaseUnits(void) const
+	?Move@CHuiVisual@@QAEXABVTHuiRealPoint@@H@Z @ 1023 NONAME ; void CHuiVisual::Move(class THuiRealPoint const &, int)
+	?SetCenteredPosAndSize@CHuiVisual@@QAEXABVTHuiRealPoint@@ABVTHuiRealSize@@H@Z @ 1024 NONAME ; void CHuiVisual::SetCenteredPosAndSize(class THuiRealPoint const &, class THuiRealSize const &, int)
+	?SetMaxSize@CHuiVisual@@QAEXABVTHuiRealSize@@@Z @ 1025 NONAME ; void CHuiVisual::SetMaxSize(class THuiRealSize const &)
+	?SetMinSize@CHuiVisual@@QAEXABVTHuiRealSize@@@Z @ 1026 NONAME ; void CHuiVisual::SetMinSize(class THuiRealSize const &)
+	?HasTactileFeedback@CHuiVisual@@QBEHH@Z @ 1027 NONAME ; int CHuiVisual::HasTactileFeedback(int) const
+	?RemoveTactileFeedback@CHuiVisual@@QAEXH@Z @ 1028 NONAME ; void CHuiVisual::RemoveTactileFeedback(int)
+	?SetTactileFeedbackL@CHuiVisual@@QAEXHH@Z @ 1029 NONAME ; void CHuiVisual::SetTactileFeedbackL(int, int)
+	?ClearLayoutModeFlags@CHuiGridLayout@@QAEXW4THuiGridDimension@@I@Z @ 1030 NONAME ; void CHuiGridLayout::ClearLayoutModeFlags(enum THuiGridDimension, unsigned int)
+	?LayoutModeFlags@CHuiGridLayout@@QAEIW4THuiGridDimension@@@Z @ 1031 NONAME ; unsigned int CHuiGridLayout::LayoutModeFlags(enum THuiGridDimension)
+	?SetLayoutModeFlags@CHuiGridLayout@@QAEXW4THuiGridDimension@@I@Z @ 1032 NONAME ; void CHuiGridLayout::SetLayoutModeFlags(enum THuiGridDimension, unsigned int)
+	?ConstructL@CHuiThemeManager@@QAEXXZ @ 1033 NONAME ; void CHuiThemeManager::ConstructL(void)
+	?GetItemID@CHuiThemeManager@@QAEXABVTDesC16@@AAVTAknsItemID@@@Z @ 1034 NONAME ; void CHuiThemeManager::GetItemID(class TDesC16 const &, class TAknsItemID &)
+	?GetSkinImageParams@CHuiThemeManager@@QAE?AUTHuiThemeImageparams@@ABVTDesC16@@@Z @ 1035 NONAME ; struct THuiThemeImageparams CHuiThemeManager::GetSkinImageParams(class TDesC16 const &)
+	?ThemeManager@CHuiEnv@@QBEAAVCHuiThemeManager@@XZ @ 1036 NONAME ; class CHuiThemeManager & CHuiEnv::ThemeManager(void) const
+	?AddScreenBufferObserverL@CHuiDisplay@@QAEXPAVMHuiScreenBufferObserver@@@Z @ 1037 NONAME ; void CHuiDisplay::AddScreenBufferObserverL(class MHuiScreenBufferObserver *)
+	?Display@CHuiEnv@@QBEAAVCHuiDisplay@@H@Z @ 1038 NONAME ; class CHuiDisplay & CHuiEnv::Display(int) const
+	?DisplayType@CHuiDisplay@@QAEHXZ @ 1039 NONAME ; int CHuiDisplay::DisplayType(void)
+	?GetDrawingInterface@CHuiDisplay@@QAEPAVMHuiBufferDrawer@@ABVTUid@@@Z @ 1040 NONAME ; class MHuiBufferDrawer * CHuiDisplay::GetDrawingInterface(class TUid const &)
+	?GetGraphicsContext@CHuiDisplay@@QAEPAVMHuiGc@@ABVTUid@@@Z @ 1041 NONAME ; class MHuiGc * CHuiDisplay::GetGraphicsContext(class TUid const &)
+	?IsScreenBufferLocked@CHuiDisplay@@QBEHXZ @ 1042 NONAME ; int CHuiDisplay::IsScreenBufferLocked(void) const
+	?NewDisplayL@CHuiEnv@@QAEAAVCHuiDisplay@@ABVTRect@@PAVCCoeControl@@HPAV2@HVTUid@@@Z @ 1043 NONAME ; class CHuiDisplay & CHuiEnv::NewDisplayL(class TRect const &, class CCoeControl *, int, class CHuiDisplay *, int, class TUid)
+	?RemoveScreenBufferObserver@CHuiDisplay@@QAEXXZ @ 1044 NONAME ; void CHuiDisplay::RemoveScreenBufferObserver(void)
+	?ScreenBufferUid@CHuiDisplay@@QAE?AVTUid@@XZ @ 1045 NONAME ; class TUid CHuiDisplay::ScreenBufferUid(void)
+	?SetScreenBufferLock@CHuiDisplay@@QAEXH@Z @ 1046 NONAME ; void CHuiDisplay::SetScreenBufferLock(int)
+	?GetItemIdL@CHuiThemeManager@@QAEXABVTDesC16@@AAVTAknsItemID@@@Z @ 1047 NONAME ; void CHuiThemeManager::GetItemIdL(class TDesC16 const &, class TAknsItemID &)
+	?GetSkinImageParamsL@CHuiThemeManager@@QAE?AUTHuiThemeImageparams@@ABVTDesC16@@@Z @ 1048 NONAME ; struct THuiThemeImageparams CHuiThemeManager::GetSkinImageParamsL(class TDesC16 const &)
+	?DeleteTextStyle@CHuiTextStyleManager@@QAEHH@Z @ 1049 NONAME ; int CHuiTextStyleManager::DeleteTextStyle(int)
+	?SetFPSCounterThreshold@CHuiEnv@@QAEXI@Z @ 1050 NONAME ; void CHuiEnv::SetFPSCounterThreshold(unsigned int)
+	?ShowDirtyRegions@CHuiDisplay@@QAEXH@Z @ 1051 NONAME ; void CHuiDisplay::ShowDirtyRegions(int)
+	??0THuiDisplayBackgroundItem@@QAE@ABVTRect@@@Z @ 1052 NONAME ; THuiDisplayBackgroundItem::THuiDisplayBackgroundItem(class TRect const &)
+	??0THuiDisplayBackgroundItem@@QAE@ABVTRect@@ABVTAknsItemID@@@Z @ 1053 NONAME ; THuiDisplayBackgroundItem::THuiDisplayBackgroundItem(class TRect const &, class TAknsItemID const &)
+	??0THuiDisplayBackgroundItem@@QAE@ABVTRect@@ABVTAknsItemID@@H@Z @ 1054 NONAME ; THuiDisplayBackgroundItem::THuiDisplayBackgroundItem(class TRect const &, class TAknsItemID const &, int)
+	??0THuiDisplayBackgroundItem@@QAE@ABVTRect@@ABVTRgb@@@Z @ 1055 NONAME ; THuiDisplayBackgroundItem::THuiDisplayBackgroundItem(class TRect const &, class TRgb const &)
+	??0THuiDisplayBackgroundItem@@QAE@XZ @ 1056 NONAME ; THuiDisplayBackgroundItem::THuiDisplayBackgroundItem(void)
+	?SetBackgroundItemsL@CHuiDisplay@@QAEXABV?$RArray@VTHuiDisplayBackgroundItem@@@@@Z @ 1057 NONAME ; void CHuiDisplay::SetBackgroundItemsL(class RArray<class THuiDisplayBackgroundItem> const &)
+	?SetColor@THuiDisplayBackgroundItem@@QAEXABVTAknsItemID@@H@Z @ 1058 NONAME ; void THuiDisplayBackgroundItem::SetColor(class TAknsItemID const &, int)
+	?SetColor@THuiDisplayBackgroundItem@@QAEXABVTRgb@@@Z @ 1059 NONAME ; void THuiDisplayBackgroundItem::SetColor(class TRgb const &)
+	?SetRect@THuiDisplayBackgroundItem@@QAEXABVTRect@@@Z @ 1060 NONAME ; void THuiDisplayBackgroundItem::SetRect(class TRect const &)
+	?SetSkinBackground@THuiDisplayBackgroundItem@@QAEXABVTAknsItemID@@@Z @ 1061 NONAME ; void THuiDisplayBackgroundItem::SetSkinBackground(class TAknsItemID const &)
+	?GetPreferredTextureFormats@CHuiDisplay@@QAEHAAV?$RPointerArray@VCTextureBitmapFormat@CHuiDisplay@@@@@Z @ 1062 NONAME ; int CHuiDisplay::GetPreferredTextureFormats(class RPointerArray<class CHuiDisplay::CTextureBitmapFormat> &)
+	?UpdateTextureFromBitmapL@CHuiTextureManager@@QAEXHPAVMHuiBitmapProvider@@@Z @ 1063 NONAME ; void CHuiTextureManager::UpdateTextureFromBitmapL(int, class MHuiBitmapProvider *)
+	?SetTextPaneHeightInPixels@THuiTextStyle@@QAEXHH@Z @ 1064 NONAME ; void THuiTextStyle::SetTextPaneHeightInPixels(int, int)
+	?TextStyle@CHuiTextVisual@@QBEHXZ @ 1065 NONAME ; int CHuiTextVisual::TextStyle(void) const
+	??0THuiFont@@QAE@ABV0@@Z @ 1066 NONAME ; THuiFont::THuiFont(class THuiFont const &)
+	??4THuiFont@@QAEAAV0@ABV0@@Z @ 1067 NONAME ; class THuiFont & THuiFont::operator=(class THuiFont const &)
+	??0THuiTextureAutoSizeParams@@QAE@XZ @ 1068 NONAME ; THuiTextureAutoSizeParams::THuiTextureAutoSizeParams(void)
+	?AutoSizeParams@CHuiTexture@@QBE?AVTHuiTextureAutoSizeParams@@XZ @ 1069 NONAME ; class THuiTextureAutoSizeParams CHuiTexture::AutoSizeParams(void) const
+	?DownsizeSettleThreshold@THuiTextureAutoSizeParams@@QBEHXZ @ 1070 NONAME ; int THuiTextureAutoSizeParams::DownsizeSettleThreshold(void) const
+	?EnableAutoSizeCalculation@CHuiTexture@@QAEXH@Z @ 1071 NONAME ; void CHuiTexture::EnableAutoSizeCalculation(int)
+	?MinSizeChange@THuiTextureAutoSizeParams@@QBEHXZ @ 1072 NONAME ; int THuiTextureAutoSizeParams::MinSizeChange(void) const
+	?PreferredSizeChanged@CHuiAutoSizeImageLoaderUtil@@EAEHABVCHuiTexture@@HABVTHuiRealSize@@@Z @ 1073 NONAME ; int CHuiAutoSizeImageLoaderUtil::PreferredSizeChanged(class CHuiTexture const &, int, class THuiRealSize const &)
+	?PreferredSizeReportCompleted@CHuiAutoSizeImageLoaderUtil@@EAEXXZ @ 1074 NONAME ; void CHuiAutoSizeImageLoaderUtil::PreferredSizeReportCompleted(void)
+	?SetAutoSizeParams@CHuiTexture@@QAEXABVTHuiTextureAutoSizeParams@@@Z @ 1075 NONAME ; void CHuiTexture::SetAutoSizeParams(class THuiTextureAutoSizeParams const &)
+	?SetDownsizeSettleThreshold@THuiTextureAutoSizeParams@@QAEXH@Z @ 1076 NONAME ; void THuiTextureAutoSizeParams::SetDownsizeSettleThreshold(int)
+	?SetMinSizeChange@THuiTextureAutoSizeParams@@QAEXH@Z @ 1077 NONAME ; void THuiTextureAutoSizeParams::SetMinSizeChange(int)
+	?SetSizeLowerThreshold@THuiTextureAutoSizeParams@@QAEXH@Z @ 1078 NONAME ; void THuiTextureAutoSizeParams::SetSizeLowerThreshold(int)
+	?SetSizeUpperThreshold@THuiTextureAutoSizeParams@@QAEXH@Z @ 1079 NONAME ; void THuiTextureAutoSizeParams::SetSizeUpperThreshold(int)
+	?SizeLowerThreshold@THuiTextureAutoSizeParams@@QBEHXZ @ 1080 NONAME ; int THuiTextureAutoSizeParams::SizeLowerThreshold(void) const
+	?SizeUpperThreshold@THuiTextureAutoSizeParams@@QBEHXZ @ 1081 NONAME ; int THuiTextureAutoSizeParams::SizeUpperThreshold(void) const
+	?ScreenBufferObserver@CHuiDisplay@@QAEPAVMHuiScreenBufferObserver@@XZ @ 1082 NONAME ; class MHuiScreenBufferObserver * CHuiDisplay::ScreenBufferObserver(void)
+	?ChangeRefreshLoopPriority@CHuiEnv@@QAEXW4TPriority@CActive@@@Z @ 1083 NONAME ; void CHuiEnv::ChangeRefreshLoopPriority(enum CActive::TPriority)
+	?NewL@CHuiFrameBrush@@SAPAV1@ABVTHuiImage@@ABUTHuiXYMetric@@@Z @ 1084 NONAME ; class CHuiFrameBrush * CHuiFrameBrush::NewL(class THuiImage const &, struct THuiXYMetric const &)
+	?NewLC@CHuiFrameBrush@@SAPAV1@ABVTHuiImage@@ABUTHuiXYMetric@@@Z @ 1085 NONAME ; class CHuiFrameBrush * CHuiFrameBrush::NewLC(class THuiImage const &, struct THuiXYMetric const &)
+	?SetImage@CHuiFrameBrush@@QAEXABVTHuiImage@@@Z @ 1086 NONAME ; void CHuiFrameBrush::SetImage(class THuiImage const &)
+	?SetImage@CHuiFrameBrush@@QAEXW4TFrameParts@1@ABVTHuiImage@@@Z @ 1087 NONAME ; void CHuiFrameBrush::SetImage(enum CHuiFrameBrush::TFrameParts, class THuiImage const &)
+	?DrawScreenBuffer@CHuiDisplay@@QAEXXZ @ 1088 NONAME ; void CHuiDisplay::DrawScreenBuffer(void)
+	?DropShadowHandler@CHuiVisual@@QBEPAVCHuiDropShadow@@XZ @ 1089 NONAME ; class CHuiDropShadow * CHuiVisual::DropShadowHandler(void) const
+	?EnableDropShadowL@CHuiVisual@@QAEXH@Z @ 1090 NONAME ; void CHuiVisual::EnableDropShadowL(int)
+	?SetColor@CHuiDropShadow@@QAEXABVTAknsItemID@@HH@Z @ 1091 NONAME ; void CHuiDropShadow::SetColor(class TAknsItemID const &, int, int)
+	?SetColor@CHuiDropShadow@@QAEXABVTRgb@@H@Z @ 1092 NONAME ; void CHuiDropShadow::SetColor(class TRgb const &, int)
+	?SetOffset@CHuiDropShadow@@QAEXMUTHuiMetric@@H@Z @ 1093 NONAME ; void CHuiDropShadow::SetOffset(float, struct THuiMetric, int)
+	?EnableAnimation@CHuiGifAnimationTexture@@QAEXH@Z @ 1094 NONAME ; void CHuiGifAnimationTexture::EnableAnimation(int)
+	?SetVisibleAreaClippingRect@CHuiDisplay@@QAEXABVTRect@@@Z @ 1095 NONAME ; void CHuiDisplay::SetVisibleAreaClippingRect(class TRect const &)
+	?SetDrawVisualOutline@CHuiDisplay@@QAEXI@Z @ 1096 NONAME ; void CHuiDisplay::SetDrawVisualOutline(unsigned int)
+	?SetHighlightRange@CHuiTextVisual@@QAEXHHAAVTRgb@@0@Z @ 1097 NONAME ; void CHuiTextVisual::SetHighlightRange(int, int, class TRgb &, class TRgb &)
+	??0CHuiGc@@IAE@XZ @ 1098 NONAME ; CHuiGc::CHuiGc(void)
+	??0CHuiM3GMesh@@QAE@XZ @ 1099 NONAME ; CHuiM3GMesh::CHuiM3GMesh(void)
+	??0CHuiProceduralMesh@@QAE@XZ @ 1100 NONAME ; CHuiProceduralMesh::CHuiProceduralMesh(void)
+	??0CHuiTexture@@IAE@XZ @ 1101 NONAME ; CHuiTexture::CHuiTexture(void)
+	??0CHuiTextureManager@@IAE@AAVCHuiEnv@@@Z @ 1102 NONAME ; CHuiTextureManager::CHuiTextureManager(class CHuiEnv &)
+	??0CHuiTextureProcessor@@IAE@AAVCHuiEnv@@@Z @ 1103 NONAME ; CHuiTextureProcessor::CHuiTextureProcessor(class CHuiEnv &)
+	??0THuiFontManager@@QAE@XZ @ 1104 NONAME ; THuiFontManager::THuiFontManager(void)
+	??0TMatrix@CHuiMatrixStack@@QAE@XZ @ 1105 NONAME ; CHuiMatrixStack::TMatrix::TMatrix(void)
+	??1CHuiGc@@UAE@XZ @ 1106 NONAME ; CHuiGc::~CHuiGc(void)
+	??1CHuiM3GMesh@@UAE@XZ @ 1107 NONAME ; CHuiM3GMesh::~CHuiM3GMesh(void)
+	??1CHuiTextureManager@@UAE@XZ @ 1108 NONAME ; CHuiTextureManager::~CHuiTextureManager(void)
+	??1CHuiTextureProcessor@@UAE@XZ @ 1109 NONAME ; CHuiTextureProcessor::~CHuiTextureProcessor(void)
+	??1MHuiRenderSurface@@UAE@XZ @ 1110 NONAME ; MHuiRenderSurface::~MHuiRenderSurface(void)
+	??1THuiFontManager@@UAE@XZ @ 1111 NONAME ; THuiFontManager::~THuiFontManager(void)
+	?AnimateControllers@CHuiM3GMesh@@UAEXXZ @ 1112 NONAME ; void CHuiM3GMesh::AnimateControllers(void)
+	?AnimationControllerCount@CHuiM3GMesh@@UBEHXZ @ 1113 NONAME ; int CHuiM3GMesh::AnimationControllerCount(void) const
+	?AppendTextureL@CHuiTextureManager@@UAEXPAVCHuiTexture@@H@Z @ 1114 NONAME ; void CHuiTextureManager::AppendTextureL(class CHuiTexture *, int)
+	?Assert@HuiUtil@@SAXH@Z @ 1115 NONAME ; void HuiUtil::Assert(int)
+	?BaseConstructL@CHuiTexture@@IAEXXZ @ 1116 NONAME ; void CHuiTexture::BaseConstructL(void)
+	?BaseConstructL@CHuiTextureManager@@IAEXXZ @ 1117 NONAME ; void CHuiTextureManager::BaseConstructL(void)
+	?BitgdiRenderer@CHuiStatic@@SAAAVCHuiBitgdiRenderPlugin@@XZ @ 1118 NONAME ; class CHuiBitgdiRenderPlugin & CHuiStatic::BitgdiRenderer(void)
+	?Clip@CHuiGc@@UAEXABVTRect@@@Z @ 1119 NONAME ; void CHuiGc::Clip(class TRect const &)
+	?ClipRect@CHuiGc@@QBE?AVTRect@@XZ @ 1120 NONAME ; class TRect CHuiGc::ClipRect(void) const
+	?ConstructL@CHuiM3GMesh@@MAEXXZ @ 1121 NONAME ; void CHuiM3GMesh::ConstructL(void)
+	?ContinueRefresh@CHuiStatic@@SAXXZ @ 1122 NONAME ; void CHuiStatic::ContinueRefresh(void)
+	?CopyBitmapL@HuiUtil@@SAPAVCFbsBitmap@@ABV2@@Z @ 1123 NONAME ; class CFbsBitmap * HuiUtil::CopyBitmapL(class CFbsBitmap const &)
+	?CreateTextureL@CHuiTextureManager@@EAEAAVCHuiTexture@@AAVCFbsBitmap@@PBV3@W4THuiTextureUploadFlags@@H@Z @ 1124 NONAME ; class CHuiTexture & CHuiTextureManager::CreateTextureL(class CFbsBitmap &, class CFbsBitmap const *, enum THuiTextureUploadFlags, int)
+	?Current@CHuiMatrixStack@@QAEAAUTMatrix@1@XZ @ 1125 NONAME ; struct CHuiMatrixStack::TMatrix & CHuiMatrixStack::Current(void)
+	?CurrentRenderSurface@CHuiStatic@@SAPAVMHuiRenderSurface@@XZ @ 1126 NONAME ; class MHuiRenderSurface * CHuiStatic::CurrentRenderSurface(void)
+	?Disable@CHuiGc@@UAEXW4TFeature@1@@Z @ 1127 NONAME ; void CHuiGc::Disable(enum CHuiGc::TFeature)
+	?DisplayArea@CHuiGc@@QBE?AVTRect@@XZ @ 1128 NONAME ; class TRect CHuiGc::DisplayArea(void) const
+	?DoCancel@CHuiTextureManager@@EAEXXZ @ 1129 NONAME ; void CHuiTextureManager::DoCancel(void)
+	?DrawStretchImage@CHuiGc@@UAEXW4TStretchMode@1@ABVTHuiImage@@ABVTHuiRealRect@@HH@Z @ 1130 NONAME ; void CHuiGc::DrawStretchImage(enum CHuiGc::TStretchMode, class THuiImage const &, class THuiRealRect const &, int, int)
+	?DrawText@CHuiGc@@UAEXABVCHuiTextMesh@@ABVTHuiRealRect@@M@Z @ 1131 NONAME ; void CHuiGc::DrawText(class CHuiTextMesh const &, class THuiRealRect const &, float)
+	?DrawTextL@CHuiGc@@UAEXABVTDesC16@@ABVTHuiRealRect@@M@Z @ 1132 NONAME ; void CHuiGc::DrawTextL(class TDesC16 const &, class THuiRealRect const &, float)
+	?EvaluateSegment@CHuiCurvePath@@IBEXMABUTSegment@1@AAVTHuiRealPoint@@PAV3@@Z @ 1133 NONAME ; void CHuiCurvePath::EvaluateSegment(float, struct CHuiCurvePath::TSegment const &, class THuiRealPoint &, class THuiRealPoint *) const
+	?FrustumOffset@CHuiGc@@QBE?AVTHuiRealPoint@@XZ @ 1134 NONAME ; class THuiRealPoint CHuiGc::FrustumOffset(void) const
+	?GetDualAlpha@CHuiVisual@@SAXMMAAH0@Z @ 1135 NONAME ; void CHuiVisual::GetDualAlpha(float, float, int &, int &)
+	?GetShadowTexture@CHuiTexture@@UBEHAAVTHuiTextureHandle@@@Z @ 1136 NONAME ; int CHuiTexture::GetShadowTexture(class THuiTextureHandle &) const
+	?GetVisual@CHuiCurvePath@@QBEPBVCHuiVisual@@XZ @ 1137 NONAME ; class CHuiVisual const * CHuiCurvePath::GetVisual(void) const
+	?Gles10Renderer@CHuiStatic@@SAAAVCHuiGles10RenderPlugin@@XZ @ 1138 NONAME ; class CHuiGles10RenderPlugin & CHuiStatic::Gles10Renderer(void)
+	?GlesRefCounter@CHuiEnv@@QAEAAHXZ @ 1139 NONAME ; int & CHuiEnv::GlesRefCounter(void)
+	?IsDisplayTypeTvOut@CHuiDisplay@@QBEHXZ @ 1140 NONAME ; int CHuiDisplay::IsDisplayTypeTvOut(void) const
+	?LoadIdentity@CHuiMatrixStack@@QAEXXZ @ 1141 NONAME ; void CHuiMatrixStack::LoadIdentity(void)
+	?LoadSceneL@CHuiM3GMesh@@IAEXABVTDesC16@@PAUM3GInterfaceImpl@@@Z @ 1142 NONAME ; void CHuiM3GMesh::LoadSceneL(class TDesC16 const &, struct M3GInterfaceImpl *)
+	?MapValue@CHuiCurvePath@@UBEMMH@Z @ 1143 NONAME ; float CHuiCurvePath::MapValue(float, int) const
+	?MappingFunctionChanged@CHuiCurvePath@@UBEHXZ @ 1144 NONAME ; int CHuiCurvePath::MappingFunctionChanged(void) const
+	?MappingFunctionClearChanged@CHuiCurvePath@@UAEXXZ @ 1145 NONAME ; void CHuiCurvePath::MappingFunctionClearChanged(void)
+	?Multiply@CHuiMatrixStack@@QAEXABUTMatrix@1@@Z @ 1146 NONAME ; void CHuiMatrixStack::Multiply(struct CHuiMatrixStack::TMatrix const &)
+	?Multiply@TMatrix@CHuiMatrixStack@@QBEXAAVTHuiRealPoint@@@Z @ 1147 NONAME ; void CHuiMatrixStack::TMatrix::Multiply(class THuiRealPoint &) const
+	?NativeControl@CHuiDisplay@@QAEPAVCCoeControl@@XZ @ 1148 NONAME ; class CCoeControl * CHuiDisplay::NativeControl(void)
+	?NativeWindow@CHuiDisplay@@QAEPAVRDrawableWindow@@XZ @ 1149 NONAME ; class RDrawableWindow * CHuiDisplay::NativeWindow(void)
+	?NeedUpdate@CHuiCurvePath@@QBEHXZ @ 1150 NONAME ; int CHuiCurvePath::NeedUpdate(void) const
+	?NewL@CHuiMatrixStack@@SAPAV1@XZ @ 1151 NONAME ; class CHuiMatrixStack * CHuiMatrixStack::NewL(void)
+	?NewL@CHuiRasterizedTextMesh@@SAPAV1@XZ @ 1152 NONAME ; class CHuiRasterizedTextMesh * CHuiRasterizedTextMesh::NewL(void)
+	?Orientation@CHuiGc@@QBE?AW4TOrientation@1@XZ @ 1153 NONAME ; enum CHuiGc::TOrientation CHuiGc::Orientation(void) const
+	?PenAlpha@CHuiGc@@QBEHXZ @ 1154 NONAME ; int CHuiGc::PenAlpha(void) const
+	?PenColor@CHuiGc@@QBE?AVTRgb@@XZ @ 1155 NONAME ; class TRgb CHuiGc::PenColor(void) const
+	?PenColorAlpha@CHuiGc@@QBE?AVTRgb@@XZ @ 1156 NONAME ; class TRgb CHuiGc::PenColorAlpha(void) const
+	?Pop@CHuiMatrixStack@@QAEXXZ @ 1157 NONAME ; void CHuiMatrixStack::Pop(void)
+	?PopClip@CHuiGc@@UAEXXZ @ 1158 NONAME ; void CHuiGc::PopClip(void)
+	?Projection@CHuiGc@@QBE?AW4TProjection@1@XZ @ 1159 NONAME ; enum CHuiGc::TProjection CHuiGc::Projection(void) const
+	?ProjectionViewport@CHuiGc@@IBE?AVTRect@@XZ @ 1160 NONAME ; class TRect CHuiGc::ProjectionViewport(void) const
+	?Push@CHuiMatrixStack@@QAEHXZ @ 1161 NONAME ; int CHuiMatrixStack::Push(void)
+	?PushClip@CHuiGc@@UAEXXZ @ 1162 NONAME ; void CHuiGc::PushClip(void)
+	?Quality@CHuiGc@@QBE?AW4THuiQuality@@XZ @ 1163 NONAME ; enum THuiQuality CHuiGc::Quality(void) const
+	?RawDisplayArea@CHuiGc@@IBE?AVTRect@@XZ @ 1164 NONAME ; class TRect CHuiGc::RawDisplayArea(void) const
+	?RealCompare@HuiUtil@@SAHMMM@Z @ 1165 NONAME ; int HuiUtil::RealCompare(float, float, float)
+	?Release@CHuiTexture@@UAEXXZ @ 1166 NONAME ; void CHuiTexture::Release(void)
+	?Release@CHuiTextureManager@@UAEHXZ @ 1167 NONAME ; int CHuiTextureManager::Release(void)
+	?Release@CHuiTextureProcessor@@UAEXXZ @ 1168 NONAME ; void CHuiTextureProcessor::Release(void)
+	?ReleaseScene@CHuiM3GMesh@@MAEXXZ @ 1169 NONAME ; void CHuiM3GMesh::ReleaseScene(void)
+	?RemoveTexture@CHuiTextureManager@@UAEXAAVCHuiTexture@@@Z @ 1170 NONAME ; void CHuiTextureManager::RemoveTexture(class CHuiTexture &)
+	?RenderSurface@CHuiDisplay@@QBEAAVMHuiRenderSurface@@XZ @ 1171 NONAME ; class MHuiRenderSurface & CHuiDisplay::RenderSurface(void) const
+	?Renderer@CHuiStatic@@SAAAVCHuiRenderPlugin@@XZ @ 1172 NONAME ; class CHuiRenderPlugin & CHuiStatic::Renderer(void)
+	?Reset@CHuiTexture@@UAEXXZ @ 1173 NONAME ; void CHuiTexture::Reset(void)
+	?ResetShadows@CHuiTexture@@QAEXXZ @ 1174 NONAME ; void CHuiTexture::ResetShadows(void)
+	?RestoreCamera@CHuiM3GMesh@@UAEXXZ @ 1175 NONAME ; void CHuiM3GMesh::RestoreCamera(void)
+	?RestoreL@CHuiTexture@@UAEXXZ @ 1176 NONAME ; void CHuiTexture::RestoreL(void)
+	?RestoreL@CHuiTextureManager@@UAEXXZ @ 1177 NONAME ; void CHuiTextureManager::RestoreL(void)
+	?RestoreL@CHuiTextureProcessor@@UAEXXZ @ 1178 NONAME ; void CHuiTextureProcessor::RestoreL(void)
+	?RotatePitch@CHuiM3GMesh@@UAEXM@Z @ 1179 NONAME ; void CHuiM3GMesh::RotatePitch(float)
+	?RotateYaw@CHuiM3GMesh@@UAEXM@Z @ 1180 NONAME ; void CHuiM3GMesh::RotateYaw(float)
+	?RunError@CHuiTextureManager@@EAEHH@Z @ 1181 NONAME ; int CHuiTextureManager::RunError(int)
+	?RunL@CHuiTextureManager@@EAEXXZ @ 1182 NONAME ; void CHuiTextureManager::RunL(void)
+	?Segment@CHuiCurvePath@@IBE?AUTSegment@1@H@Z @ 1183 NONAME ; struct CHuiCurvePath::TSegment CHuiCurvePath::Segment(int) const
+	?SegmentCount@CHuiCurvePath@@IBEHXZ @ 1184 NONAME ; int CHuiCurvePath::SegmentCount(void) const
+	?SetClip@CHuiGc@@UAEXABVTRect@@@Z @ 1185 NONAME ; void CHuiGc::SetClip(class TRect const &)
+	?SetCurrentRenderSurface@CHuiStatic@@SAXPAVMHuiRenderSurface@@@Z @ 1186 NONAME ; void CHuiStatic::SetCurrentRenderSurface(class MHuiRenderSurface *)
+	?SetPenColor@CHuiGc@@QAEXABVTRgb@@@Z @ 1187 NONAME ; void CHuiGc::SetPenColor(class TRgb const &)
+	?SetProcessor@CHuiTextureManager@@IAEXPAVCHuiTextureProcessor@@@Z @ 1188 NONAME ; void CHuiTextureManager::SetProcessor(class CHuiTextureProcessor *)
+	?SetQuality@CHuiGc@@UAEXW4THuiQuality@@@Z @ 1189 NONAME ; void CHuiGc::SetQuality(enum THuiQuality)
+	?SetSegment@CHuiTexture@@MAEXHABVTSize@@ABVTPoint@@0@Z @ 1190 NONAME ; void CHuiTexture::SetSegment(int, class TSize const &, class TPoint const &, class TSize const &)
+	?SetTextureChanged@CHuiTexture@@QAEXH@Z @ 1191 NONAME ; void CHuiTexture::SetTextureChanged(int)
+	?SetViewportRect@CHuiM3GMesh@@UAEXABVTHuiRealRect@@@Z @ 1192 NONAME ; void CHuiM3GMesh::SetViewportRect(class THuiRealRect const &)
+	?StoreCamera@CHuiM3GMesh@@UAEXXZ @ 1193 NONAME ; void CHuiM3GMesh::StoreCamera(void)
+	?TextureExtension@CHuiTexture@@MAEXABVTUid@@PAPAX@Z @ 1194 NONAME ; void CHuiTexture::TextureExtension(class TUid const &, void * *)
+	?UnOrientRect@CHuiGc@@IBE?AVTRect@@ABV2@@Z @ 1195 NONAME ; class TRect CHuiGc::UnOrientRect(class TRect const &) const
+	?Update@CHuiCurvePath@@UAEXMMMPAVMHuiMappingFunction@@0@Z @ 1196 NONAME ; void CHuiCurvePath::Update(float, float, float, class MHuiMappingFunction *, class MHuiMappingFunction *)
+	?WindowTransformation@CHuiGc@@IBEPBVCHuiTransformation@@XZ @ 1197 NONAME ; class CHuiTransformation const * CHuiGc::WindowTransformation(void) const
+	?Gles20Renderer@CHuiStatic@@SAAAVCHuiGles20RenderPlugin@@XZ @ 1198 NONAME ; class CHuiGles20RenderPlugin & CHuiStatic::Gles20Renderer(void)
+	?Gles11Renderer@CHuiStatic@@SAAAVCHuiGles11RenderPlugin@@XZ @ 1199 NONAME ; class CHuiGles11RenderPlugin & CHuiStatic::Gles11Renderer(void)
+	?Usage@CHuiDisplay@@QBEIXZ @ 1200 NONAME ; unsigned int CHuiDisplay::Usage(void) const
+	?Vg10Renderer@CHuiStatic@@SAAAVCHuiVg10RenderPlugin@@XZ @ 1201 NONAME ; class CHuiVg10RenderPlugin & CHuiStatic::Vg10Renderer(void)
+	?EnableDebugFlag@CHuiEnv@@QAEXI@Z @ 1202 NONAME ; void CHuiEnv::EnableDebugFlag(unsigned int)
+	??1CTextureEntry@CHuiTextureManager@@UAE@XZ @ 1203 NONAME ; CHuiTextureManager::CTextureEntry::~CTextureEntry(void)
+	?AddAnimatedTextureGroupL@CHuiTextureManager@@QAEHABV?$RArray@H@@@Z @ 1204 NONAME ; int CHuiTextureManager::AddAnimatedTextureGroupL(class RArray<int> const &)
+	?AdvanceTime@CHuiTextureManager@@QBEXM@Z @ 1205 NONAME ; void CHuiTextureManager::AdvanceTime(float) const
+	?AlignHorizontal@CHuiGc@@QBE?AW4THuiAlignHorizontal@@XZ @ 1206 NONAME ; enum THuiAlignHorizontal CHuiGc::AlignHorizontal(void) const
+	?AlignOffset@CHuiGc@@IBE?AVTPoint@@ABVTSize@@@Z @ 1207 NONAME ; class TPoint CHuiGc::AlignOffset(class TSize const &) const
+	?AlignVertical@CHuiGc@@QBE?AW4THuiAlignVertical@@XZ @ 1208 NONAME ; enum THuiAlignVertical CHuiGc::AlignVertical(void) const
+	?CalculateLength@CHuiCurvePath@@IBEMXZ @ 1209 NONAME ; float CHuiCurvePath::CalculateLength(void) const
+	?CheckTexture@CHuiTextureManager@@IBEHABVTDesC16@@H@Z @ 1210 NONAME ; int CHuiTextureManager::CheckTexture(class TDesC16 const &, int) const
+	?CheckTexture@CHuiTextureManager@@IBEHH@Z @ 1211 NONAME ; int CHuiTextureManager::CheckTexture(int) const
+	?ClearChangedTextures@CHuiTextureManager@@QAEXXZ @ 1212 NONAME ; void CHuiTextureManager::ClearChangedTextures(void)
+	?ClipStackCount@CHuiGc@@QBEHXZ @ 1213 NONAME ; int CHuiGc::ClipStackCount(void) const
+	?Draw@CHuiCurvePath@@UBEXABVTPoint@@PAVCHuiGc@@@Z @ 1214 NONAME ; void CHuiCurvePath::Draw(class TPoint const &, class CHuiGc *) const
+	?Draw@CHuiM3GMesh@@UBEXAAVCHuiGc@@PBVTHuiImage@@1M@Z @ 1215 NONAME ; void CHuiM3GMesh::Draw(class CHuiGc &, class THuiImage const *, class THuiImage const *, float) const
+	?Draw@CHuiProceduralMesh@@UBEXAAVCHuiGc@@PBVTHuiImage@@1M@Z @ 1216 NONAME ; void CHuiProceduralMesh::Draw(class CHuiGc &, class THuiImage const *, class THuiImage const *, float) const
+	?EnableTexMemoryCalculation@CHuiTextureManager@@QAEXH@Z @ 1217 NONAME ; void CHuiTextureManager::EnableTexMemoryCalculation(int)
+	?Env@CHuiTextureProcessor@@QAEAAVCHuiEnv@@XZ @ 1218 NONAME ; class CHuiEnv & CHuiTextureProcessor::Env(void)
+	?IsLegacyApiUsed@CHuiCurvePath@@QBEHXZ @ 1219 NONAME ; int CHuiCurvePath::IsLegacyApiUsed(void) const
+	?NotifyImagePreferredSize@CHuiGc@@QAEXABVTHuiImage@@VTHuiRealRect@@@Z @ 1220 NONAME ; void CHuiGc::NotifyImagePreferredSize(class THuiImage const &, class THuiRealRect)
+	?NotifySkinChangedL@CHuiTextureManager@@QAEXXZ @ 1221 NONAME ; void CHuiTextureManager::NotifySkinChangedL(void)
+	?NotifyTextureLoaded@CHuiTextureManager@@IBEXAAVCHuiTexture@@HH@Z @ 1222 NONAME ; void CHuiTextureManager::NotifyTextureLoaded(class CHuiTexture &, int, int) const
+	?RemoveAnimatedTextureGroup@CHuiTextureManager@@QAEXH@Z @ 1223 NONAME ; void CHuiTextureManager::RemoveAnimatedTextureGroup(int)
+	?SetAlign@CHuiGc@@QAEXW4THuiAlignHorizontal@@W4THuiAlignVertical@@@Z @ 1224 NONAME ; void CHuiGc::SetAlign(enum THuiAlignHorizontal, enum THuiAlignVertical)
+	?SetDisplayArea@CHuiGc@@QAEXABVTRect@@@Z @ 1225 NONAME ; void CHuiGc::SetDisplayArea(class TRect const &)
+	?SetFont@CHuiGc@@QAEXAAVTHuiFont@@@Z @ 1226 NONAME ; void CHuiGc::SetFont(class THuiFont &)
+	?SetFrustumOffset@CHuiGc@@QAEXABVTHuiRealPoint@@@Z @ 1227 NONAME ; void CHuiGc::SetFrustumOffset(class THuiRealPoint const &)
+	?SetHasChangedTextures@CHuiTextureManager@@QAEXXZ @ 1228 NONAME ; void CHuiTextureManager::SetHasChangedTextures(void)
+	?SetNeedsUpdate@CHuiCurvePath@@QAEXXZ @ 1229 NONAME ; void CHuiCurvePath::SetNeedsUpdate(void)
+	?SetOrientation@CHuiGc@@QAEXW4TOrientation@1@@Z @ 1230 NONAME ; void CHuiGc::SetOrientation(enum CHuiGc::TOrientation)
+	?SetPenAlpha@CHuiGc@@QAEXH@Z @ 1231 NONAME ; void CHuiGc::SetPenAlpha(int)
+	?SetPenColorAlpha@CHuiGc@@QAEXABVTRgb@@@Z @ 1232 NONAME ; void CHuiGc::SetPenColorAlpha(class TRgb const &)
+	?SetProjection@CHuiGc@@QAEXW4TProjection@1@@Z @ 1233 NONAME ; void CHuiGc::SetProjection(enum CHuiGc::TProjection)
+	?SetProjection@CHuiGc@@QAEXW4TProjection@1@ABVTRect@@@Z @ 1234 NONAME ; void CHuiGc::SetProjection(enum CHuiGc::TProjection, class TRect const &)
+	?SetVisual@CHuiCurvePath@@QBEXPBVCHuiVisual@@@Z @ 1235 NONAME ; void CHuiCurvePath::SetVisual(class CHuiVisual const *) const
+	?TextureEntry@CHuiTextureManager@@IAEPAVCTextureEntry@1@H@Z @ 1236 NONAME ; class CHuiTextureManager::CTextureEntry * CHuiTextureManager::TextureEntry(int)
+	?TextureEntryCount@CHuiTextureManager@@IBEHXZ @ 1237 NONAME ; int CHuiTextureManager::TextureEntryCount(void) const
+	?UpdateSurface@CHuiProceduralMesh@@UAEXMM@Z @ 1238 NONAME ; void CHuiProceduralMesh::UpdateSurface(float, float)
+	??0CHuiRenderPlugin@@IAE@W4THuiRenderPluginId@@@Z @ 1239 NONAME ; CHuiRenderPlugin::CHuiRenderPlugin(enum THuiRenderPluginId)
+	??1CHuiRenderPlugin@@UAE@XZ @ 1240 NONAME ; CHuiRenderPlugin::~CHuiRenderPlugin(void)
+	?Allows@CHuiRenderPlugin@@UBEHW4THuiRenderPluginAllow@@@Z @ 1241 NONAME ; int CHuiRenderPlugin::Allows(enum THuiRenderPluginAllow) const
+	?CreateCurvePathL@CHuiRenderPlugin@@UAEPAVCHuiCurvePath@@XZ @ 1242 NONAME ; class CHuiCurvePath * CHuiRenderPlugin::CreateCurvePathL(void)
+	?CreateFontManagerL@CHuiRenderPlugin@@UBEPAVTHuiFontManager@@XZ @ 1243 NONAME ; class THuiFontManager * CHuiRenderPlugin::CreateFontManagerL(void) const
+	?CreateGcL@CHuiRenderPlugin@@UAEPAVCHuiGc@@XZ @ 1244 NONAME ; class CHuiGc * CHuiRenderPlugin::CreateGcL(void)
+	?CreateMeshL@CHuiRenderPlugin@@UAEPAVCHuiMesh@@W4THuiMeshType@@@Z @ 1245 NONAME ; class CHuiMesh * CHuiRenderPlugin::CreateMeshL(enum THuiMeshType)
+	?CreateRenderSurfaceL@CHuiRenderPlugin@@UAEPAVMHuiRenderSurface@@AAVCHuiDisplay@@@Z @ 1246 NONAME ; class MHuiRenderSurface * CHuiRenderPlugin::CreateRenderSurfaceL(class CHuiDisplay &)
+	?CreateTextureL@CHuiRenderPlugin@@UAEPAVCHuiTexture@@PBVTHuiTextureHandle@@@Z @ 1247 NONAME ; class CHuiTexture * CHuiRenderPlugin::CreateTextureL(class THuiTextureHandle const *)
+	?CreateTextureLC@CHuiRenderPlugin@@UAEPAVCHuiTexture@@PBVTHuiTextureHandle@@@Z @ 1248 NONAME ; class CHuiTexture * CHuiRenderPlugin::CreateTextureLC(class THuiTextureHandle const *)
+	?CreateTextureManagerL@CHuiRenderPlugin@@UAEPAVCHuiTextureManager@@AAVCHuiEnv@@@Z @ 1249 NONAME ; class CHuiTextureManager * CHuiRenderPlugin::CreateTextureManagerL(class CHuiEnv &)
+	?DeleteNamedTexture@CHuiRenderPlugin@@UAEXI@Z @ 1250 NONAME ; void CHuiRenderPlugin::DeleteNamedTexture(unsigned int)
+	?DisableOffScreenBitmap@CHuiRenderPlugin@@UAEXXZ @ 1251 NONAME ; void CHuiRenderPlugin::DisableOffScreenBitmap(void)
+	?DrawOffScreenBitmapToWindowL@CHuiRenderPlugin@@UAEXAAVCHuiDisplay@@@Z @ 1252 NONAME ; void CHuiRenderPlugin::DrawOffScreenBitmapToWindowL(class CHuiDisplay &)
+	?EnableOffScreenBitmapL@CHuiRenderPlugin@@UAEXH@Z @ 1253 NONAME ; void CHuiRenderPlugin::EnableOffScreenBitmapL(int)
+	?Id@CHuiRenderPlugin@@QBE?AW4THuiRenderPluginId@@XZ @ 1254 NONAME ; enum THuiRenderPluginId CHuiRenderPlugin::Id(void) const
+	?NotifyDisplayCountL@CHuiRenderPlugin@@UAEXI@Z @ 1255 NONAME ; void CHuiRenderPlugin::NotifyDisplayCountL(unsigned int)
+	?OffScreenBitmap@CHuiRenderPlugin@@UBEPAVCFbsBitmap@@XZ @ 1256 NONAME ; class CFbsBitmap * CHuiRenderPlugin::OffScreenBitmap(void) const
+	?Release@CHuiRenderPlugin@@UAEXXZ @ 1257 NONAME ; void CHuiRenderPlugin::Release(void)
+	?RestoreL@CHuiRenderPlugin@@UAEXXZ @ 1258 NONAME ; void CHuiRenderPlugin::RestoreL(void)
+	?UpdateOffScreenBitmapL@CHuiRenderPlugin@@UAEXAAVCHuiDisplay@@@Z @ 1259 NONAME ; void CHuiRenderPlugin::UpdateOffScreenBitmapL(class CHuiDisplay &)
+	?EnableTransformedClippingRects@CHuiGc@@UAEXH@Z @ 1260 NONAME ; void CHuiGc::EnableTransformedClippingRects(int)
+	?SetClip@CHuiGc@@UAEXABVTRect@@H@Z @ 1261 NONAME ; void CHuiGc::SetClip(class TRect const &, int)
+	?TransformDirtyRect@CHuiGc@@UAEXAAVTHuiRealRect@@@Z @ 1262 NONAME ; void CHuiGc::TransformDirtyRect(class THuiRealRect &)
+	?CurvePathExtension@CHuiCurvePath@@MAEXABVTUid@@PAPAX@Z @ 1263 NONAME ; void CHuiCurvePath::CurvePathExtension(class TUid const &, void * *)
+	?GcExtension@CHuiGc@@MAEXABVTUid@@PAPAX@Z @ 1264 NONAME ; void CHuiGc::GcExtension(class TUid const &, void * *)
+	?M3GMeshExtension@CHuiM3GMesh@@MAEXABVTUid@@PAPAX@Z @ 1265 NONAME ; void CHuiM3GMesh::M3GMeshExtension(class TUid const &, void * *)
+	?ProceduralMeshExtension@CHuiProceduralMesh@@MAEXABVTUid@@PAPAX@Z @ 1266 NONAME ; void CHuiProceduralMesh::ProceduralMeshExtension(class TUid const &, void * *)
+	?TextureManagerExtension@CHuiTextureManager@@MAEXABVTUid@@PAPAX@Z @ 1267 NONAME ; void CHuiTextureManager::TextureManagerExtension(class TUid const &, void * *)
+	?TextureProcessorExtension@CHuiTextureProcessor@@MAEXABVTUid@@PAPAX@Z @ 1268 NONAME ; void CHuiTextureProcessor::TextureProcessorExtension(class TUid const &, void * *)
+	?RenderPluginExtension@CHuiRenderPlugin@@MAEXABVTUid@@PAPAX@Z @ 1269 NONAME ; void CHuiRenderPlugin::RenderPluginExtension(class TUid const &, void * *)
+	?Count@CHuiMatrixStack@@QBEHXZ @ 1270 NONAME ; int CHuiMatrixStack::Count(void) const
+	??0CHuiCanvasGc@@QAE@XZ @ 1271 NONAME ; CHuiCanvasGc::CHuiCanvasGc(void)
+	??1CHuiCanvasGc@@UAE@XZ @ 1272 NONAME ; CHuiCanvasGc::~CHuiCanvasGc(void)
+	?AddNewL@CHuiCanvasVisual@@SAPAV1@AAVCHuiControl@@PAVCHuiLayout@@@Z @ 1273 NONAME ; class CHuiCanvasVisual * CHuiCanvasVisual::AddNewL(class CHuiControl &, class CHuiLayout *)
+	?CreateCanvasGcL@CHuiRenderPlugin@@UAEPAVCHuiCanvasGc@@XZ @ 1274 NONAME ; class CHuiCanvasGc * CHuiRenderPlugin::CreateCanvasGcL(void)
+	?DrawEllipse@CHuiCanvasGc@@UAEXABVTHuiRealRect@@@Z @ 1275 NONAME ; void CHuiCanvasGc::DrawEllipse(class THuiRealRect const &)
+	?DrawImage@CHuiCanvasGc@@UAEXABVCHuiTexture@@ABVTHuiRealRect@@1@Z @ 1276 NONAME ; void CHuiCanvasGc::DrawImage(class CHuiTexture const &, class THuiRealRect const &)
+	?DrawLines@CHuiCanvasGc@@UAEXAAV?$RArray@UTHuiRealLine@@@@@Z @ 1277 NONAME ; void CHuiCanvasGc::DrawLines(class RArray<struct THuiRealLine>)
+	?DrawPoints@CHuiCanvasGc@@UAEXAAV?$RArray@VTHuiRealPoint@@@@@Z @ 1278 NONAME ; void CHuiCanvasGc::DrawPoints(class RArray<class THuiRealPoint>)
+	?DrawPolygon@CHuiCanvasGc@@UAEXAAV?$RArray@VTHuiRealPoint@@@@@Z @ 1279 NONAME ; void CHuiCanvasGc::DrawPolygon(class RArray<class THuiRealPoint>)
+	?DrawRects@CHuiCanvasGc@@UAEXAAV?$RArray@VTHuiRealRect@@@@@Z @ 1280 NONAME ; void CHuiCanvasGc::DrawRects(class RArray<class THuiRealRect>)
+	?DrawText@CHuiCanvasGc@@UAEXABVCHuiTextMesh@@ABVTHuiRealRect@@@Z @ 1281 NONAME ; void CHuiCanvasGc::DrawText(class CHuiTextMesh const &, class THuiRealRect const &)
+	?LoadIdentity@CHuiCanvasGc@@UAEXXZ @ 1282 NONAME ; void CHuiCanvasGc::LoadIdentity(void)
+	?PenWidth@CHuiCanvasGc@@UBEMXZ @ 1283 NONAME ; float CHuiCanvasGc::PenWidth(void) const
+	?Rotate@CHuiCanvasGc@@UAEXABM000@Z @ 1284 NONAME ; void CHuiCanvasGc::Rotate(float const &, float const &, float const &, float const &)
+	?Scale@CHuiCanvasGc@@UAEXABM00@Z @ 1285 NONAME ; void CHuiCanvasGc::Scale(float const &, float const &, float const &)
+	?SetCommandSetL@CHuiCanvasVisual@@QAEXABVTDesC8@@@Z @ 1286 NONAME ; void CHuiCanvasVisual::SetCommandSetL(class TDesC8 const &)
+	?SetDefaults@CHuiCanvasGc@@UAEXXZ @ 1287 NONAME ; void CHuiCanvasGc::SetDefaults(void)
+	?SetGc@CHuiCanvasGc@@UAEXAAVCHuiGc@@@Z @ 1288 NONAME ; void CHuiCanvasGc::SetGc(class CHuiGc &)
+	?SetOpacity@CHuiCanvasGc@@UAEXABM@Z @ 1289 NONAME ; void CHuiCanvasGc::SetOpacity(float const &)
+	?SetPenColor@CHuiCanvasGc@@UAEXABVTRgb@@@Z @ 1290 NONAME ; void CHuiCanvasGc::SetPenColor(class TRgb const &)
+	?SetPenWidth@CHuiCanvasGc@@UAEXABM@Z @ 1291 NONAME ; void CHuiCanvasGc::SetPenWidth(float const &)
+	?SetPolygonDrawMode@CHuiCanvasGc@@UAEXW4THuiFillMode@@@Z @ 1292 NONAME ; void CHuiCanvasGc::SetPolygonDrawMode(enum THuiFillMode)
+	?SetTextAlign@CHuiCanvasGc@@UAEXW4THuiAlignHorizontal@@W4THuiAlignVertical@@@Z @ 1293 NONAME ; void CHuiCanvasGc::SetTextAlign(enum THuiAlignHorizontal, enum THuiAlignVertical)
+	?SetTextStyle@CHuiCanvasGc@@UAEXH@Z @ 1294 NONAME ; void CHuiCanvasGc::SetTextStyle(int)
+	?SetVisual@CHuiCanvasGc@@UAEXABVCHuiCanvasVisual@@@Z @ 1295 NONAME ; void CHuiCanvasGc::SetVisual(class CHuiCanvasVisual const &)
+	?TextHorizontalAlign@CHuiCanvasGc@@UBEHXZ @ 1296 NONAME ; int CHuiCanvasGc::TextHorizontalAlign(void) const
+	?TextStyle@CHuiCanvasGc@@UBEHXZ @ 1297 NONAME ; int CHuiCanvasGc::TextStyle(void) const
+	?TextVerticalAlign@CHuiCanvasGc@@UBEHXZ @ 1298 NONAME ; int CHuiCanvasGc::TextVerticalAlign(void) const
+	?Translate@CHuiCanvasGc@@UAEXABM00@Z @ 1299 NONAME ; void CHuiCanvasGc::Translate(float const &, float const &, float const &)
+	??0CHuiCurvePath@@QAE@XZ @ 1300 NONAME ; CHuiCurvePath::CHuiCurvePath(void)
+	?AddCommandSetL@CHuiCanvasVisual@@QAEXABVTDesC8@@@Z @ 1301 NONAME ; void CHuiCanvasVisual::AddCommandSetL(class TDesC8 const &)
+	?ClearCache@CHuiCanvasVisual@@QAEXXZ @ 1302 NONAME ; void CHuiCanvasVisual::ClearCache(void)
+	?ClearCommandSet@CHuiCanvasVisual@@QAEXXZ @ 1303 NONAME ; void CHuiCanvasVisual::ClearCommandSet(void)
+	?DrawImage@CHuiCanvasGc@@UAEXABVCHuiTexture@@ABVTHuiRealRect@@1W4TStretchMode@CHuiGc@@@Z @ 1304 NONAME ; void CHuiCanvasGc::DrawImage(class CHuiTexture const &, class THuiRealRect const &, class THuiRealRect const &)
+	?PolygonDrawMode@CHuiCanvasGc@@UBE?AW4THuiFillMode@@XZ @ 1305 NONAME ; enum THuiFillMode CHuiCanvasGc::PolygonDrawMode(void) const
+	?SetCommandType@CHuiCanvasVisual@@QAEXH@Z @ 1306 NONAME ; void CHuiCanvasVisual::SetCommandType(int)
+	?DrawImage@CHuiCanvasGc@@UAEXABVCHuiTexture@@ABVTHuiRealRect@@@Z @ 1307 NONAME ; void CHuiCanvasGc::DrawImage(class CHuiTexture const &, class THuiRealRect const &, class THuiRealRect const &, enum CHuiGc::TStretchMode)
+	?GetValueFromCentralRepository@HuiUtil@@SAHKAAH@Z @ 1308 NONAME ; int HuiUtil::GetValueFromCentralRepository(unsigned long, int &)
+	?AddPartialCommandSetL@CHuiCanvasVisual@@QAEXABVTDesC8@@H@Z @ 1309 NONAME ; void CHuiCanvasVisual::AddPartialCommandSetL(class TDesC8 const &, int)
+	?Clip@CHuiCanvasGc@@QAEXABVTRect@@@Z @ 1310 NONAME ; void CHuiCanvasGc::Clip(class TRect const &)
+	?Clear@CHuiCanvasGc@@UAEXABVTHuiRealRect@@@Z @ 1311 NONAME ; void CHuiCanvasGc::Clear(class THuiRealRect const &)
+	?ClearWithBackgroundItems@CHuiCanvasGc@@UAEXABVTHuiRealRect@@ABV?$RArray@VTHuiDisplayBackgroundItem@@@@@Z @ 1312 NONAME ; void CHuiCanvasGc::ClearWithBackgroundItems(class THuiRealRect const &, class RArray<class THuiDisplayBackgroundItem> const &)
+	?ClearWithSkinBackground@CHuiCanvasGc@@UAEXABVTHuiRealRect@@@Z @ 1313 NONAME ; void CHuiCanvasGc::ClearWithSkinBackground(class THuiRealRect const &)
+	?SetBackgroundColor@CHuiCanvasVisual@@QAEXABVTRgb@@@Z @ 1314 NONAME ; void CHuiCanvasVisual::SetBackgroundColor(class TRgb const &)
+	?SetClearBackground@CHuiCanvasVisual@@QAEXW4TClearMode@CHuiDisplay@@@Z @ 1315 NONAME ; void CHuiCanvasVisual::SetClearBackground(enum CHuiDisplay::TClearMode)
+	?EnableBlendingIfNeeded@CHuiCanvasGc@@QAEXPBVCHuiTexture@@@Z @ 1316 NONAME ; void CHuiCanvasGc::EnableBlendingIfNeeded(class CHuiTexture const *)
+	?SetBackgroundItems@CHuiCanvasVisual@@QAEXABV?$RArray@VTHuiDisplayBackgroundItem@@@@@Z @ 1317 NONAME ; void CHuiCanvasVisual::SetBackgroundItems(class RArray<class THuiDisplayBackgroundItem> const &)
+	?ClearMode@THuiDisplayBackgroundItem@@QBEHXZ @ 1318 NONAME ; int THuiDisplayBackgroundItem::ClearMode(void) const
+	?Color@THuiDisplayBackgroundItem@@QBE?AVTRgb@@XZ @ 1319 NONAME ; class TRgb THuiDisplayBackgroundItem::Color(void) const
+	?Rect@THuiDisplayBackgroundItem@@QBE?AVTRect@@XZ @ 1320 NONAME ; class TRect THuiDisplayBackgroundItem::Rect(void) const
+	?SkinBackground@THuiDisplayBackgroundItem@@QBE?AVTAknsItemID@@XZ @ 1321 NONAME ; class TAknsItemID THuiDisplayBackgroundItem::SkinBackground(void) const
+	?GetRectForItem@@YAXABVTAknsItemID@@AAVTRect@@1@Z @ 1322 NONAME ; void GetRectForItem(class TAknsItemID const &, class TRect &, class TRect &)
+	?BackgroundTexture@CHuiS60Skin@@QAEPAVCHuiTexture@@ABVTAknsItemID@@@Z @ 1323 NONAME ; class CHuiTexture * CHuiS60Skin::BackgroundTexture(class TAknsItemID const &)
+	?PrepareCache@CHuiCanvasVisual@@QAEXXZ @ 1324 NONAME ; void CHuiCanvasVisual::PrepareCache(void)
+	?ResourceId@CHuiControlGroup@@QBEHXZ @ 1325 NONAME ; int CHuiControlGroup::ResourceId(void) const
+	?DrawArc@CHuiCanvasGc@@UAEXABVTHuiRealRect@@ABVTHuiRealPoint@@1@Z @ 1326 NONAME ; void CHuiCanvasGc::DrawArc(class THuiRealRect const &, class THuiRealPoint const &, class THuiRealPoint const &)
+	?DrawPie@CHuiCanvasGc@@UAEXABVTHuiRealRect@@ABVTHuiRealPoint@@1@Z @ 1327 NONAME ; void CHuiCanvasGc::DrawPie(class THuiRealRect const &, class THuiRealPoint const &, class THuiRealPoint const &)
+	?DrawRoundRect@CHuiCanvasGc@@UAEXABVTHuiRealRect@@ABVTHuiRealSize@@@Z @ 1328 NONAME ; void CHuiCanvasGc::DrawRoundRect(class THuiRealRect const &, class THuiRealSize const &)
+	?CreateEffectsEngineL@CHuiRenderPlugin@@UAEPAVCHuiFxEngine@@XZ @ 1329 NONAME ; class CHuiFxEngine * CHuiRenderPlugin::CreateEffectsEngineL(void)
+	?CancelClipping@CHuiGc@@UAEXXZ @ 1330 NONAME ; void CHuiGc::CancelClipping(void)
+	?ClipRegion@CHuiCanvasGc@@QAEXABVTRegion@@@Z @ 1331 NONAME ; void CHuiCanvasGc::ClipRegion(class TRegion const &)
+	?SetClipRegion@CHuiGc@@UAEXABVTRegion@@@Z @ 1332 NONAME ; void CHuiGc::SetClipRegion(class TRegion const &)
+	?CancelClipping@CHuiCanvasGc@@QAEXXZ @ 1333 NONAME ; void CHuiCanvasGc::CancelClipping(void)
+	?PaintedArea@CHuiCanvasVisual@@QAE?AUTHuiCanvasPaintedArea@@H@Z @ 1334 NONAME ; struct THuiCanvasPaintedArea CHuiCanvasVisual::PaintedArea(int)
+	?PaintedAreaCount@CHuiCanvasVisual@@QBEHXZ @ 1335 NONAME ; int CHuiCanvasVisual::PaintedAreaCount(void) const
+	?Image@CHuiImageBrush@@QBEABVTHuiImage@@XZ @ 1336 NONAME ; class THuiImage const & CHuiImageBrush::Image(void) const
+	?SetCanvasFlags@CHuiCanvasVisual@@QAEXH@Z @ 1337 NONAME ; void CHuiCanvasVisual::SetCanvasFlags(int)
+	?SetCapturingBufferL@CHuiCanvasVisual@@QAEHPAVCFbsBitmap@@@Z @ 1338 NONAME ; int CHuiCanvasVisual::SetCapturingBufferL(class CFbsBitmap *)
+	?ClearCanvasFlags@CHuiCanvasVisual@@QAEXH@Z @ 1339 NONAME ; void CHuiCanvasVisual::ClearCanvasFlags(int)
+	?Cleanup@CHuiCanvasGc@@IAEXXZ @ 1340 NONAME ; void CHuiCanvasGc::Cleanup(void)
+	?ClipNext@CHuiCanvasGc@@IAEHXZ @ 1341 NONAME ; int CHuiCanvasGc::ClipNext(void)
+	?DisableDelayedClippingIfNeeded@CHuiCanvasGc@@IAEXXZ @ 1342 NONAME ; void CHuiCanvasGc::DisableDelayedClippingIfNeeded(void)
+	?EnableDelayedClippingIfNeeded@CHuiCanvasGc@@IAE?AW4TClipRectVisibility@1@ABV?$RArray@UTHuiRealLine@@@@@Z @ 1343 NONAME ; enum CHuiCanvasGc::TClipRectVisibility CHuiCanvasGc::EnableDelayedClippingIfNeeded(class RArray<struct THuiRealLine> const &)
+	?EnableDelayedClippingIfNeeded@CHuiCanvasGc@@IAE?AW4TClipRectVisibility@1@ABV?$RArray@VTHuiRealPoint@@@@@Z @ 1344 NONAME ; enum CHuiCanvasGc::TClipRectVisibility CHuiCanvasGc::EnableDelayedClippingIfNeeded(class RArray<class THuiRealPoint> const &)
+	?EnableDelayedClippingIfNeeded@CHuiCanvasGc@@IAE?AW4TClipRectVisibility@1@ABV?$RArray@VTHuiRealRect@@@@@Z @ 1345 NONAME ; enum CHuiCanvasGc::TClipRectVisibility CHuiCanvasGc::EnableDelayedClippingIfNeeded(class RArray<class THuiRealRect> const &)
+	?EnableDelayedClippingIfNeeded@CHuiCanvasGc@@IAE?AW4TClipRectVisibility@1@ABVTHuiRealRect@@@Z @ 1346 NONAME ; enum CHuiCanvasGc::TClipRectVisibility CHuiCanvasGc::EnableDelayedClippingIfNeeded(class THuiRealRect const &)
+	?SetClippingMode@CHuiCanvasGc@@QAEXW4THuiCanvasClipMode@@@Z @ 1347 NONAME ; void CHuiCanvasGc::SetClippingMode(enum THuiCanvasClipMode)
+	?Setup@CHuiCanvasGc@@IAEXXZ @ 1348 NONAME ; void CHuiCanvasGc::Setup(void)
+	?MaxNumberOfClipRects@CHuiCanvasGc@@MBEHXZ @ 1349 NONAME ; int CHuiCanvasGc::MaxNumberOfClipRects(void) const
+	?Clip@CHuiGc@@UAEXABVTRegion@@@Z @ 1350 NONAME ; void CHuiGc::Clip(class TRegion const &)
+	?IsClipped@CHuiCanvasGc@@IBE?AW4TClipRectVisibility@1@ABVTPoint@@@Z @ 1351 NONAME ; enum CHuiCanvasGc::TClipRectVisibility CHuiCanvasGc::IsClipped(class TPoint const &) const
+	?IsClipped@CHuiCanvasGc@@IBE?AW4TClipRectVisibility@1@ABVTRect@@@Z @ 1352 NONAME ; enum CHuiCanvasGc::TClipRectVisibility CHuiCanvasGc::IsClipped(class TRect const &) const
+	?DoDrawArc@CHuiCanvasGc@@MAEXABVTHuiRealRect@@ABVTHuiRealPoint@@1@Z @ 1353 NONAME ; void CHuiCanvasGc::DoDrawArc(class THuiRealRect const &, class THuiRealPoint const &, class THuiRealPoint const &)
+	?DoDrawLines@CHuiCanvasGc@@MAEXAAV?$RArray@UTHuiRealLine@@@@@Z @ 1354 NONAME ; void CHuiCanvasGc::DoDrawLines(class RArray<struct THuiRealLine> &)
+	?DoDrawPoints@CHuiCanvasGc@@MAEXAAV?$RArray@VTHuiRealPoint@@@@@Z @ 1355 NONAME ; void CHuiCanvasGc::DoDrawPoints(class RArray<class THuiRealPoint> &)
+	?DoDrawPolygon@CHuiCanvasGc@@MAEXAAV?$RArray@VTHuiRealPoint@@@@@Z @ 1356 NONAME ; void CHuiCanvasGc::DoDrawPolygon(class RArray<class THuiRealPoint> &)
+	?DoDrawRects@CHuiCanvasGc@@MAEXAAV?$RArray@VTHuiRealRect@@@@@Z @ 1357 NONAME ; void CHuiCanvasGc::DoDrawRects(class RArray<class THuiRealRect> &)
+	?DoDrawRoundRect@CHuiCanvasGc@@MAEXABVTHuiRealRect@@ABVTHuiRealSize@@@Z @ 1358 NONAME ; void CHuiCanvasGc::DoDrawRoundRect(class THuiRealRect const &, class THuiRealSize const &)
+	?DoDrawPie@CHuiCanvasGc@@MAEXABVTHuiRealRect@@ABVTHuiRealPoint@@1@Z @ 1359 NONAME ; void CHuiCanvasGc::DoDrawPie(class THuiRealRect const &, class THuiRealPoint const &, class THuiRealPoint const &)
+	?UnOrientRegion@CHuiGc@@IBEXAAVTRegion@@@Z @ 1360 NONAME ; void CHuiGc::UnOrientRegion(class TRegion &) const
+	?IsNvgContent@CHuiTexture@@QBEHXZ @ 1361 NONAME ; int CHuiTexture::IsNvgContent(void) const
+	?SetNvgContent@CHuiTexture@@QAEXH@Z @ 1362 NONAME ; void CHuiTexture::SetNvgContent(int)
+	??0THuiImage@@QAE@ABVCHuiTexture@@MMMM@Z @ 1363 NONAME ; THuiImage::THuiImage(class CHuiTexture const &, float, float, float, float)
+	?SetTexture@THuiImage@@QAEXABVCHuiTexture@@@Z @ 1364 NONAME ; void THuiImage::SetTexture(class CHuiTexture const &)
+	?SetExternalContentL@CHuiCanvasVisual@@QAEXPAVCHuiVisual@@@Z @ 1365 NONAME ; void CHuiCanvasVisual::SetExternalContentL(class CHuiVisual *)
+	?ExternalContent@CHuiCanvasVisual@@QAEPAVCHuiVisual@@XZ @ 1366 NONAME ; class CHuiVisual * CHuiCanvasVisual::ExternalContent(void)
+	?WsSession@CHuiStatic@@SAAAVRWsSession@@XZ @ 1367 NONAME ; class RWsSession & CHuiStatic::WsSession(void)
+	?ScreenDevice@CHuiStatic@@SAPAVCWsScreenDevice@@H@Z @ 1368 NONAME ; class CWsScreenDevice * CHuiStatic::ScreenDevice(int)
+	?RootWin@CHuiStatic@@SAPAVRWindowGroup@@H@Z @ 1369 NONAME ; class RWindowGroup * CHuiStatic::RootWin(int)
+	?NewDisplayL@CHuiEnv@@QAEAAVCHuiDisplay@@PAVRWindow@@HPAV2@HVTUid@@@Z @ 1370 NONAME ; class CHuiDisplay & CHuiEnv::NewDisplayL(class RWindow *, int, class CHuiDisplay *, int, class TUid)
+	?SetChanged@CHuiCanvasVisual@@UAEXXZ @ 1371 NONAME ; void CHuiCanvasVisual::SetChanged(void)
+	?ClearChanged@CHuiCanvasVisual@@UAEXXZ @ 1372 NONAME ; void CHuiCanvasVisual::ClearChanged(void)
+	?SetFreeForm@CHuiFxFilter@@QAEXH@Z @ 1373 NONAME ; void CHuiFxFilter::SetFreeForm(int)
+	?Changed@CHuiFxVisualLayer@@UBEHXZ @ 1374 NONAME ; int CHuiFxVisualLayer::Changed(void) const
+	?PrepareDrawL@CHuiFxLayer@@UAEHAAVCHuiFxEngine@@@Z @ 1375 NONAME ; int CHuiFxLayer::PrepareDrawL(class CHuiFxEngine &)
+	?Margin@CHuiFxFilter@@QBEABVTSize@@XZ @ 1376 NONAME ; class TSize const & CHuiFxFilter::Margin(void) const
+	?EngineType@CHuiFxEngine@@QAE?AW4THuiFxEngineType@@XZ @ 1377 NONAME ; enum THuiFxEngineType CHuiFxEngine::EngineType(void)
+	??1CHuiFxFilterLayer@@UAE@XZ @ 1378 NONAME ; CHuiFxFilterLayer::~CHuiFxFilterLayer(void)
+	?AdvanceTime@CHuiFxFilterLayer@@UAEXM@Z @ 1379 NONAME ; void CHuiFxFilterLayer::AdvanceTime(float)
+	?VisualArea@CHuiFxVisualLayer@@UAEHAAVTRect@@@Z @ 1380 NONAME ; int CHuiFxVisualLayer::VisualArea(class TRect &)
+	?Release@CHuiFxEngine@@UAEXXZ @ 1381 NONAME ; void CHuiFxEngine::Release(void)
+	?AdvanceTime@CHuiFxFilter@@QAEXM@Z @ 1382 NONAME ; void CHuiFxFilter::AdvanceTime(float)
+	?Changed@CHuiFxEffect@@QAEHXZ @ 1383 NONAME ; int CHuiFxEffect::Changed(void)
+	?ConstructL@CHuiFxEngine@@IAEXW4THuiFxEngineType@@@Z @ 1384 NONAME ; void CHuiFxEngine::ConstructL(enum THuiFxEngineType)
+	?NewL@CHuiFxFilterLayer@@SAPAV1@PAVCHuiFxFilter@@@Z @ 1385 NONAME ; class CHuiFxFilterLayer * CHuiFxFilterLayer::NewL(class CHuiFxFilter *)
+	?Type@CHuiFxLayer@@QAE?AW4THuiFxLayerType@@XZ @ 1386 NONAME ; enum THuiFxLayerType CHuiFxLayer::Type(void)
+	?VisualArea@CHuiFxLayer@@UAEHAAVTRect@@@Z @ 1387 NONAME ; int CHuiFxLayer::VisualArea(class TRect &)
+	?Size@CHuiFxRenderbuffer@@QBEABVTSize@@XZ @ 1388 NONAME ; class TSize const & CHuiFxRenderbuffer::Size(void) const
+	??1CHuiFxEngine@@UAE@XZ @ 1389 NONAME ; CHuiFxEngine::~CHuiFxEngine(void)
+	?RegisterParameterL@CHuiFxVisualLayer@@IAEXABVTDesC16@@PAM@Z @ 1390 NONAME ; void CHuiFxVisualLayer::RegisterParameterL(class TDesC16 const &, float *)
+	?NewL@CHuiFxEffect@@SAPAV1@AAVCHuiFxEngine@@@Z @ 1391 NONAME ; class CHuiFxEffect * CHuiFxEffect::NewL(class CHuiFxEngine &)
+	?ConstructL@CHuiFxVisualLayer@@IAEXAAVMHuiEffectable@@@Z @ 1392 NONAME ; void CHuiFxVisualLayer::ConstructL(class CHuiVisual &)
+	?Draw@CHuiFxEffect@@QAEHAAVCHuiGc@@ABVTRect@@@Z @ 1393 NONAME ; int CHuiFxEffect::Draw(class CHuiGc &, class TRect const &)
+	?TargetRect@CHuiFxLayer@@QBEABVTRect@@XZ @ 1394 NONAME ; class TRect const & CHuiFxLayer::TargetRect(void) const
+	?AdvanceTime@CHuiFxVisualLayer@@UAEXM@Z @ 1395 NONAME ; void CHuiFxVisualLayer::AdvanceTime(float)
+	?Filter@CHuiFxFilterLayer@@QBEAAVCHuiFxFilter@@XZ @ 1396 NONAME ; class CHuiFxFilter & CHuiFxFilterLayer::Filter(void) const
+	?IsFreeForm@CHuiFxFilter@@QBEHXZ @ 1397 NONAME ; int CHuiFxFilter::IsFreeForm(void) const
+	?Draw@CHuiFxFilterLayer@@UAEXAAVCHuiFxEngine@@AAVCHuiGc@@AAVCHuiFxRenderbuffer@@2@Z @ 1398 NONAME ; void CHuiFxFilterLayer::Draw(class CHuiFxEngine &, class CHuiGc &, class CHuiFxRenderbuffer &, class CHuiFxRenderbuffer &)
+	?SetSourceRect@CHuiFxLayer@@QAEXABVTRect@@@Z @ 1399 NONAME ; void CHuiFxLayer::SetSourceRect(class TRect const &)
+	??1CHuiFxRenderbuffer@@UAE@XZ @ 1400 NONAME ; CHuiFxRenderbuffer::~CHuiFxRenderbuffer(void)
+	?SetBlendingMode@CHuiFxLayer@@QAEXW4THuiFxBlendingMode@@@Z @ 1401 NONAME ; void CHuiFxLayer::SetBlendingMode(enum THuiFxBlendingMode)
+	?Changed@CHuiFxFilter@@QBEHXZ @ 1402 NONAME ; int CHuiFxFilter::Changed(void) const
+	?ConstructL@CHuiFxFilterLayer@@IAEXPAVCHuiFxFilter@@@Z @ 1403 NONAME ; void CHuiFxFilterLayer::ConstructL(class CHuiFxFilter *)
+	??1CHuiFxGroupLayer@@UAE@XZ @ 1404 NONAME ; CHuiFxGroupLayer::~CHuiFxGroupLayer(void)
+	?AcquireRenderbuffer@CHuiFxEngine@@UAEPAVCHuiFxRenderbuffer@@ABVTSize@@@Z @ 1405 NONAME ; class CHuiFxRenderbuffer * CHuiFxEngine::AcquireRenderbuffer(class TSize const &)
+	?GetReferenceValue@CHuiFxEngine@@QAEMW4THuiFxReferencePoint@@@Z @ 1406 NONAME ; float CHuiFxEngine::GetReferenceValue(enum THuiFxReferencePoint)
+	?VisualArea@CHuiFxEffect@@QBEHAAVTRect@@@Z @ 1407 NONAME ; int CHuiFxEffect::VisualArea(class TRect &) const
+	?PrepareDrawL@CHuiFxGroupLayer@@UAEHAAVCHuiFxEngine@@@Z @ 1408 NONAME ; int CHuiFxGroupLayer::PrepareDrawL(class CHuiFxEngine &)
+	?ConstructL@CHuiFxRenderbuffer@@IAEXABVTSize@@W4TRenderBufferType@@@Z @ 1409 NONAME ; void CHuiFxRenderbuffer::ConstructL(class TSize const &, enum TRenderBufferType)
+	?VisualRect@CHuiFxLayer@@QBEABVTRect@@XZ @ 1410 NONAME ; class TRect const & CHuiFxLayer::VisualRect(void) const
+	?SetTargetRect@CHuiFxLayer@@QAEXABVTRect@@@Z @ 1411 NONAME ; void CHuiFxLayer::SetTargetRect(class TRect const &)
+	??1CHuiFxLayer@@UAE@XZ @ 1412 NONAME ; CHuiFxLayer::~CHuiFxLayer(void)
+	?AdvanceTime@CHuiFxEffect@@QAEXM@Z @ 1413 NONAME ; void CHuiFxEffect::AdvanceTime(float)
+	?PrepareDrawL@CHuiFxFilter@@UAEHAAVCHuiFxEngine@@@Z @ 1414 NONAME ; int CHuiFxFilter::PrepareDrawL(class CHuiFxEngine &)
+	?Changed@CHuiFxFilterLayer@@UBEHXZ @ 1415 NONAME ; int CHuiFxFilterLayer::Changed(void) const
+	?AddLayerL@CHuiFxEffect@@QAEXPBVCHuiFxLayer@@@Z @ 1416 NONAME ; void CHuiFxEffect::AddLayerL(class CHuiFxLayer const *)
+	?EffectsEngine@CHuiEnv@@QBEPAVCHuiFxEngine@@XZ @ 1417 NONAME ; class CHuiFxEngine * CHuiEnv::EffectsEngine(void) const
+	?Draw@CHuiFxGroupLayer@@UAEXAAVCHuiFxEngine@@AAVCHuiGc@@AAVCHuiFxRenderbuffer@@2@Z @ 1418 NONAME ; void CHuiFxGroupLayer::Draw(class CHuiFxEngine &, class CHuiGc &, class CHuiFxRenderbuffer &, class CHuiFxRenderbuffer &)
+	??0CHuiFxRenderbuffer@@IAE@XZ @ 1419 NONAME ; CHuiFxRenderbuffer::CHuiFxRenderbuffer(void)
+	?AddEffectL@CHuiFxEngine@@IAEXPAVCHuiFxEffect@@@Z @ 1420 NONAME ; void CHuiFxEngine::AddEffectL(class CHuiFxEffect *)
+	?Engine@CHuiFxEffect@@QBEAAVCHuiFxEngine@@XZ @ 1421 NONAME ; class CHuiFxEngine & CHuiFxEffect::Engine(void) const
+	?BlendingMode@CHuiFxLayer@@QBE?AW4THuiFxBlendingMode@@XZ @ 1422 NONAME ; enum THuiFxBlendingMode CHuiFxLayer::BlendingMode(void) const
+	?ReleaseRenderbuffer@CHuiFxEngine@@UAEXPAVCHuiFxRenderbuffer@@@Z @ 1423 NONAME ; void CHuiFxEngine::ReleaseRenderbuffer(class CHuiFxRenderbuffer *)
+	?SourceRect@CHuiFxLayer@@QBEABVTRect@@XZ @ 1424 NONAME ; class TRect const & CHuiFxLayer::SourceRect(void) const
+	?AddLayerL@CHuiFxGroupLayer@@QAEXPBVCHuiFxLayer@@@Z @ 1425 NONAME ; void CHuiFxGroupLayer::AddLayerL(class CHuiFxLayer const *)
+	?ConstructL@CHuiFxGroupLayer@@IAEXH@Z @ 1426 NONAME ; void CHuiFxGroupLayer::ConstructL(int)
+	?AdvanceTime@CHuiFxLayer@@UAEXM@Z @ 1427 NONAME ; void CHuiFxLayer::AdvanceTime(float)
+	?SetEffectEndObserver@CHuiFxEffect@@QAEXPAVMAlfGfxEffectObserver@@H@Z @ 1428 NONAME ; void CHuiFxEffect::SetEffectEndObserver(class MAlfGfxEffectObserver *, int)
+	?BufferType@CHuiFxRenderbuffer@@QBEABW4TRenderBufferType@@XZ @ 1429 NONAME ; enum TRenderBufferType const & CHuiFxRenderbuffer::BufferType(void) const
+	?NewL@CHuiFxVisualLayer@@SAPAV1@AAVMHuiEffectable@@@Z @ 1430 NONAME ; class CHuiFxVisualLayer * CHuiFxVisualLayer::NewL(class CHuiVisual &)
+	?RegisterParameterL@CHuiFxVisualLayer@@IAEXABVTDesC16@@PAVTRgb@@@Z @ 1431 NONAME ; void CHuiFxVisualLayer::RegisterParameterL(class TDesC16 const &, class TRgb *)
+	?SetVisualRect@CHuiFxLayer@@QAEXABVTRect@@@Z @ 1432 NONAME ; void CHuiFxLayer::SetVisualRect(class TRect const &)
+	?SetVisualRect@CHuiFxFilter@@QAEXABVTRect@@@Z @ 1433 NONAME ; void CHuiFxFilter::SetVisualRect(class TRect const &)
+	??1CHuiFxEffect@@UAE@XZ @ 1434 NONAME ; CHuiFxEffect::~CHuiFxEffect(void)
+	??0CHuiFxLayer@@IAE@XZ @ 1435 NONAME ; CHuiFxLayer::CHuiFxLayer(void)
+	?VisualRect@CHuiFxFilter@@QBEABVTRect@@XZ @ 1436 NONAME ; class TRect const & CHuiFxFilter::VisualRect(void) const
+	??1CHuiFxVisualLayer@@UAE@XZ @ 1437 NONAME ; CHuiFxVisualLayer::~CHuiFxVisualLayer(void)
+	?Effect@CHuiVisual@@QBEPAVCHuiFxEffect@@XZ @ 1438 NONAME ; class CHuiFxEffect * CHuiVisual::Effect(void) const
+	?Changed@CHuiFxLayer@@UBEHXZ @ 1439 NONAME ; int CHuiFxLayer::Changed(void) const
+	?LoadEffectL@CHuiFxEngine@@QAEXABVTDesC16@@AAPAVCHuiFxEffect@@PAVMHuiEffectable@@PAVTRect@@PAVMAlfGfxEffectObserver@@HH@Z @ 1440 NONAME ; void CHuiFxEngine::LoadEffectL(class TDesC16 const &, class CHuiFxEffect * &, class CHuiVisual *, class TRect *, class MAlfGfxEffectObserver *, int, int)		
+	?AdvanceTime@CHuiFxGroupLayer@@UAEXM@Z @ 1441 NONAME ; void CHuiFxGroupLayer::AdvanceTime(float)
+	?RemoveEffect@CHuiFxEngine@@IAEXPAVCHuiFxEffect@@@Z @ 1442 NONAME ; void CHuiFxEngine::RemoveEffect(class CHuiFxEffect *)
+	?AdvanceTime@CHuiFxEngine@@QAEXM@Z @ 1443 NONAME ; void CHuiFxEngine::AdvanceTime(float)
+	?RegisterParameterL@CHuiFxFilter@@IAEXABVTDesC16@@PAM@Z @ 1444 NONAME ; void CHuiFxFilter::RegisterParameterL(class TDesC16 const &, float *)
+	?PrepareDrawL@CHuiFxVisualLayer@@UAEHAAVCHuiFxEngine@@@Z @ 1445 NONAME ; int CHuiFxVisualLayer::PrepareDrawL(class CHuiFxEngine &)
+	?ConstructL@CHuiFxLayer@@IAEXW4THuiFxLayerType@@@Z @ 1446 NONAME ; void CHuiFxLayer::ConstructL(enum THuiFxLayerType)
+	??1CHuiFxFilter@@UAE@XZ @ 1447 NONAME ; CHuiFxFilter::~CHuiFxFilter(void)
+	?RestoreL@CHuiFxEngine@@UAEXXZ @ 1448 NONAME ; void CHuiFxEngine::RestoreL(void)
+	?Parameter@CHuiFxFilter@@UAEPAVMHuiFxParameter@@ABVTDesC16@@@Z @ 1449 NONAME ; class MHuiFxParameter * CHuiFxFilter::Parameter(class TDesC16 const &)
+	?ParameterChanged@CHuiFxFilter@@IAEHXZ @ 1450 NONAME ; int CHuiFxFilter::ParameterChanged(void)
+	?Changed@CHuiFxGroupLayer@@UBEHXZ @ 1451 NONAME ; int CHuiFxGroupLayer::Changed(void) const
+	?ConstructL@CHuiFxEffect@@IAEXXZ @ 1452 NONAME ; void CHuiFxEffect::ConstructL(void)
+	?RegisterParameterL@CHuiFxFilter@@IAEXABVTDesC16@@PAVTRgb@@@Z @ 1453 NONAME ; void CHuiFxFilter::RegisterParameterL(class TDesC16 const &, class TRgb *)
+	?NewL@CHuiFxGroupLayer@@SAPAV1@H@Z @ 1454 NONAME ; class CHuiFxGroupLayer * CHuiFxGroupLayer::NewL(int)
+	??0CHuiFxGroupLayer@@IAE@XZ @ 1455 NONAME ; CHuiFxGroupLayer::CHuiFxGroupLayer(void)
+	?Parameter@CHuiFxVisualLayer@@QAEPAVMHuiFxParameter@@ABVTDesC16@@@Z @ 1456 NONAME ; class MHuiFxParameter * CHuiFxVisualLayer::Parameter(class TDesC16 const &)
+	?VisualArea@CHuiFxGroupLayer@@UAEHAAVTRect@@@Z @ 1457 NONAME ; int CHuiFxGroupLayer::VisualArea(class TRect &)
+	?ConstructL@CHuiFxFilter@@IAEXXZ @ 1458 NONAME ; void CHuiFxFilter::ConstructL(void)
+	?SetEffect@CHuiVisual@@QAEXPAVCHuiFxEffect@@@Z @ 1459 NONAME ; void CHuiVisual::SetEffect(class CHuiFxEffect *)
+	?SetMargin@CHuiFxFilter@@QAEXABVTSize@@@Z @ 1460 NONAME ; void CHuiFxFilter::SetMargin(class TSize const &)
+	?PrepareDrawL@CHuiFxFilterLayer@@UAEHAAVCHuiFxEngine@@@Z @ 1461 NONAME ; int CHuiFxFilterLayer::PrepareDrawL(class CHuiFxEngine &)
+	?Draw@CHuiFxVisualLayer@@UAEXAAVCHuiFxEngine@@AAVCHuiGc@@AAVCHuiFxRenderbuffer@@2@Z @ 1462 NONAME ; void CHuiFxVisualLayer::Draw(class CHuiFxEngine &, class CHuiGc &, class CHuiFxRenderbuffer &, class CHuiFxRenderbuffer &)
+	?SkinInstance@CHuiStatic@@SAPAVMAknsSkinInstance@@XZ @ 1463 NONAME ; class MAknsSkinInstance * CHuiStatic::SkinInstance(void)
+	?SetTrackCommandSet@CHuiCanvasVisual@@QAEXAAV?$TBuf@$0BAA@@@H@Z @ 1464 NONAME ; void CHuiCanvasVisual::SetTrackCommandSet(class TBuf<256> &, int)
+	?PopTransformationMatrix@CHuiCanvasGc@@UAEXXZ @ 1465 NONAME ; void CHuiCanvasGc::PopTransformationMatrix(void)
+	?PushTransformationMatrix@CHuiCanvasGc@@UAEXXZ @ 1466 NONAME ; void CHuiCanvasGc::PushTransformationMatrix(void)
+	?UnBind@CHuiCanvasRenderBuffer@@UAEXXZ @ 1467 NONAME ; void CHuiCanvasRenderBuffer::UnBind(void)
+	?DrawImage@CHuiCanvasGc@@UAEXABVCHuiCanvasRenderBuffer@@ABVTHuiRealPoint@@@Z @ 1468 NONAME ; void CHuiCanvasGc::DrawImage(class CHuiCanvasRenderBuffer const &, class THuiRealPoint const &)
+	?Bind@CHuiCanvasRenderBuffer@@UAEXXZ @ 1469 NONAME ; void CHuiCanvasRenderBuffer::Bind(void)
+	??1CHuiCanvasRenderBuffer@@UAE@XZ @ 1470 NONAME ; CHuiCanvasRenderBuffer::~CHuiCanvasRenderBuffer(void)
+	?CreateRenderBufferL@CHuiCanvasGc@@UAEPAVCHuiCanvasRenderBuffer@@ABVTSize@@@Z @ 1471 NONAME ; class CHuiCanvasRenderBuffer * CHuiCanvasGc::CreateRenderBufferL(class TSize const &)
+	?DoDrawRenderBuffer@CHuiCanvasGc@@MAEXABVCHuiCanvasRenderBuffer@@ABVTHuiRealPoint@@@Z @ 1472 NONAME ; void CHuiCanvasGc::DoDrawRenderBuffer(class CHuiCanvasRenderBuffer const &, class THuiRealPoint const &)
+	?UnInitialize@CHuiCanvasRenderBuffer@@UAEXXZ @ 1473 NONAME ; void CHuiCanvasRenderBuffer::UnInitialize(void)
+	??0CHuiCanvasRenderBuffer@@QAE@XZ @ 1474 NONAME ; CHuiCanvasRenderBuffer::CHuiCanvasRenderBuffer(void)
+	?InitializeL@CHuiCanvasRenderBuffer@@UAEXABVTSize@@@Z @ 1475 NONAME ; void CHuiCanvasRenderBuffer::InitializeL(class TSize const &)
+	?SetDrawMode@CHuiCanvasGc@@UAEXW4THuiCanvasDrawMode@@@Z @ 1476 NONAME ; void CHuiCanvasGc::SetDrawMode(enum THuiCanvasDrawMode)
+	?SetTextPaneHeight@THuiFont@@QAEXH@Z @ 1477 NONAME ; void THuiFont::SetTextPaneHeight(int)
+	?TextPaneHeight@THuiFont@@QBEHXZ @ 1478 NONAME ; int THuiFont::TextPaneHeight(void) const
+	?LineExtentsL@THuiFont@@QAE?AVTSize@@ABVTDesC16@@@Z @ 1479 NONAME ; class TSize THuiFont::LineExtentsL(class TDesC16 const &)
+	?SetCategory@THuiFont@@QAEXW4TAknFontCategory@@@Z @ 1480 NONAME ; void THuiFont::SetCategory(enum TAknFontCategory)
+	?ReleaseFont@THuiFont@@QAEXXZ @ 1481 NONAME ; void THuiFont::ReleaseFont(void)
+	?NearestFontL@THuiFont@@QAEPAVCFont@@M@Z @ 1482 NONAME ; class CFont * THuiFont::NearestFontL(float)
+	?RasterizeLineL@THuiFont@@QAEXABVTDesC16@@AAVCFbsBitGc@@@Z @ 1483 NONAME ; void THuiFont::RasterizeLineL(class TDesC16 const &, class CFbsBitGc &)
+	?SetFontSpec@THuiFont@@QAEXABVTFontSpec@@@Z @ 1484 NONAME ; void THuiFont::SetFontSpec(class TFontSpec const &)
+	?UpdateMeshL@CHuiTextVisual@@QAEXABVTDesC8@@@Z @ 1485 NONAME ; void CHuiTextVisual::UpdateMeshL(class TDesC8 const &)
+	?AddRestoreStateFlags@CHuiRenderPlugin@@UAEXH@Z @ 1486 NONAME ; void CHuiRenderPlugin::AddRestoreStateFlags(int)
+	?GetRestoreStateFlags@CHuiRenderPlugin@@UAEHXZ @ 1487 NONAME ; int CHuiRenderPlugin::GetRestoreStateFlags(void)
+	?ClearRestoreStateFlags@CHuiRenderPlugin@@UAEXXZ @ 1488 NONAME ; void CHuiRenderPlugin::ClearRestoreStateFlags(void)
+	?EffectFlags@CHuiFxEffect@@QAEHXZ @ 1489 NONAME ; int CHuiFxEffect::EffectFlags(void)
+	?SetEffectFlags@CHuiFxEffect@@QAEXH@Z @ 1490 NONAME ; void CHuiFxEffect::SetEffectFlags(int)
+	?AddLowMemoryObserver@CHuiEnv@@QAEXPAVMHuiLowMemoryObserver@@@Z @ 1491 NONAME ; void CHuiEnv::AddLowMemoryObserver(class MHuiLowMemoryObserver *)
+	?NotifyLowMemory@CHuiEnv@@QAEXH@Z @ 1492 NONAME ; void CHuiEnv::NotifyLowMemory(int)
+	?RemoveLowMemoryObserver@CHuiEnv@@QAEXPAVMHuiLowMemoryObserver@@@Z @ 1493 NONAME ; void CHuiEnv::RemoveLowMemoryObserver(class MHuiLowMemoryObserver *)
+	?EnableLowMemoryState@CHuiFxEngine@@UAEXH@Z @ 1494 NONAME ; void CHuiFxEngine::EnableLowMemoryState(int)
+	?Margin@CHuiFxLayer@@UAEHAAVTMargins@@@Z @ 1495 NONAME ; int CHuiFxLayer::Margin(class TMargins &)
+	?Margin@CHuiFxGroupLayer@@UAEHAAVTMargins@@@Z @ 1496 NONAME ; int CHuiFxGroupLayer::Margin(class TMargins &)
+	?CalculateMargin@CHuiFxFilter@@UBEXAAVTMargins@@@Z @ 1497 NONAME ; void CHuiFxFilter::CalculateMargin(class TMargins &) const
+	?Margin2@CHuiFxFilter@@QBEABVTMargins@@XZ @ 1498 NONAME ; class TMargins const & CHuiFxFilter::Margin2(void) const
+	?Margin@CHuiFxFilterLayer@@UAEHAAVTMargins@@@Z @ 1499 NONAME ; int CHuiFxFilterLayer::Margin(class TMargins &)
+	?ApplyMargin@CHuiFxGroupLayer@@QAEXAAVTRect@@@Z @ 1500 NONAME ; void CHuiFxGroupLayer::ApplyMargin(class TRect &)
+	?Margin@CHuiFxVisualLayer@@UAEHAAVTMargins@@@Z @ 1501 NONAME ; int CHuiFxVisualLayer::Margin(class TMargins &)
+	?SetVisual@CHuiFxGroupLayer@@UAEXPAVCHuiVisual@@@Z @ 1502 NONAME ; void CHuiFxGroupLayer::SetVisual(class CHuiVisual *)
+	?SetVisual@CHuiFxVisualLayer@@UAEXPAVCHuiVisual@@@Z @ 1503 NONAME ; void CHuiFxVisualLayer::SetVisual(class CHuiVisual *)
+	?SetVisual@CHuiFxEffect@@QAEXPAVCHuiVisual@@@Z @ 1504 NONAME ; void CHuiFxEffect::SetVisual(class CHuiVisual *)
+	?SetExtRect@CHuiFxFilterLayer@@UAEXPAVTRect@@@Z @ 1505 NONAME ; void CHuiFxFilterLayer::SetExtRect(class TRect *)
+	?CloneL@CHuiFxFilterLayer@@UBEPAV1@XZ @ 1506 NONAME ; class CHuiFxFilterLayer * CHuiFxFilterLayer::CloneL(void) const
+	?SetEngine@CHuiFxEffect@@QAEXPAVCHuiFxEngine@@@Z @ 1507 NONAME ; void CHuiFxEffect::SetEngine(class CHuiFxEngine *)
+	?SetExtRect@CHuiFxVisualLayer@@UAEXPAVTRect@@@Z @ 1508 NONAME ; void CHuiFxVisualLayer::SetExtRect(class TRect *)
+	?SetExtRect@CHuiFxGroupLayer@@UAEXPAVTRect@@@Z @ 1509 NONAME ; void CHuiFxGroupLayer::SetExtRect(class TRect *)
+	??0CHuiFxEffectCacheEffectNode@@QAE@ABVTDesC16@@AAPAVCHuiFxEffect@@PAVMHuiEffectable@@PAVTRect@@PAVCHuiFxEngine@@@Z @ 1510 NONAME ; CHuiFxEffectCacheEffectNode::CHuiFxEffectCacheEffectNode(class TDesC16 const &, class CHuiFxEffect * &, class CHuiVisual *, class TRect *, class CHuiFxEngine *)
+	?SetExtRect@CHuiFxEffect@@QAEXPAVTRect@@@Z @ 1511 NONAME ; void CHuiFxEffect::SetExtRect(class TRect *)
+	?CopyParameterL@CHuiFxFilter@@IAEXABVTDesC16@@PAMPBV1@@Z @ 1512 NONAME ; void CHuiFxFilter::CopyParameterL(class TDesC16 const &, float *, class CHuiFxFilter const *)
+	?CopyParameterL@CHuiFxFilter@@IAEXABVTDesC16@@PAVTRgb@@PBV1@@Z @ 1513 NONAME ; void CHuiFxFilter::CopyParameterL(class TDesC16 const &, class TRgb *, class CHuiFxFilter const *)
+	?CloneL@CHuiFxVisualLayer@@UBEPAV1@XZ @ 1514 NONAME ; class CHuiFxVisualLayer * CHuiFxVisualLayer::CloneL(void) const
+	?CloneL@CHuiFxGroupLayer@@UBEPAV1@XZ @ 1515 NONAME ; class CHuiFxGroupLayer * CHuiFxGroupLayer::CloneL(void) const
+	?FindOrCreateL@CHuiFxEffectCache@@QAEXPAVMHuiFxEffectCacheNode@@@Z @ 1516 NONAME ; void CHuiFxEffectCache::FindOrCreateL(class MHuiFxEffectCacheNode *)
+	?CloneL@CHuiFxEffect@@QBEPAV1@XZ @ 1517 NONAME ; class CHuiFxEffect * CHuiFxEffect::CloneL(void) const
+	?CopyFromL@CHuiFxFilter@@IAEXPBV1@@Z @ 1518 NONAME ; void CHuiFxFilter::CopyFromL(class CHuiFxFilter const *)
+	?SetVisual@CHuiFxFilterLayer@@UAEXPAVCHuiVisual@@@Z @ 1519 NONAME ; void CHuiFxFilterLayer::SetVisual(class CHuiVisual *)
+	?NewL@CHuiFxEffectCache@@SAPAV1@XZ @ 1520 NONAME ; class CHuiFxEffectCache * CHuiFxEffectCache::NewL(void)
+	?UnUse@CHuiFxEffectCache@@QAEXPAVMHuiFxEffectCacheNode@@@Z @ 1521 NONAME ; void CHuiFxEffectCache::UnUse(class MHuiFxEffectCacheNode *)
+	??1CHuiFxEffectCache@@UAE@XZ @ 1522 NONAME ; CHuiFxEffectCache::~CHuiFxEffectCache(void)
+	??1CHuiFxEffectCacheEffectNode@@UAE@XZ @ 1523 NONAME ; CHuiFxEffectCacheEffectNode::~CHuiFxEffectCacheEffectNode(void)
+	?CopyFromL@CHuiFxLayer@@QAEXPBV1@@Z @ 1524 NONAME ; void CHuiFxLayer::CopyFromL(class CHuiFxLayer const *)
+	?UnRegisterEffectL@CHuiFxEngine@@QAEXABVTDesC16@@@Z @ 1525 NONAME ; void CHuiFxEngine::UnRegisterEffectL(class TDesC16 const &)
+	?RegisterEffectL@CHuiFxEngine@@QAEXABVTDesC16@@@Z @ 1526 NONAME ; void CHuiFxEngine::RegisterEffectL(class TDesC16 const &)
+	?SetDisplayArea@CHuiFxLayer@@QAEXABVTRect@@@Z @ 1527 NONAME ; void CHuiFxLayer::SetDisplayArea(class TRect const &)
+	?Composite@CHuiFxEngine@@UAEXAAVCHuiGc@@AAVCHuiFxRenderbuffer@@ABVTPoint@@HH@Z @ 1528 NONAME ; void CHuiFxEngine::Composite(class CHuiGc &, class CHuiFxRenderbuffer &, class TPoint const &, int, int)
+	?Position@CHuiFxRenderbuffer@@QBEABVTPoint@@XZ @ 1529 NONAME ; class TPoint const & CHuiFxRenderbuffer::Position(void) const
+	?SetPosition@CHuiFxRenderbuffer@@QAEXVTPoint@@@Z @ 1530 NONAME ; void CHuiFxRenderbuffer::SetPosition(class TPoint)
+	?IsTransformed@CHuiFxEffect@@QBEHXZ @ 1531 NONAME ; int CHuiFxEffect::IsTransformed(void) const
+	?IsAnimated@CHuiFxEffect@@QBEHXZ @ 1532 NONAME ; int CHuiFxEffect::IsAnimated(void) const
+	?CanvasFlags@CHuiCanvasVisual@@QAEHXZ @ 1533 NONAME ; int CHuiCanvasVisual::CanvasFlags(void)
+	?RestoreFlaggedState@CHuiCanvasGc@@UBEXXZ @ 1534 NONAME ; void CHuiCanvasGc::RestoreFlaggedState(void) const
+	?SetParentCanvas@CHuiCanvasVisual@@QAEXPAV1@@Z @ 1535 NONAME ; void CHuiCanvasVisual::SetParentCanvas(class CHuiCanvasVisual *)
+	?EnableBackground@CHuiFxRenderbuffer@@QAEXH@Z @ 1536 NONAME ; void CHuiFxRenderbuffer::EnableBackground(int)
+	?ClearRenderBuffer@CHuiCanvasGc@@UAEXAAVCHuiCanvasRenderBuffer@@ABVTRect@@@Z @ 1537 NONAME ; void CHuiCanvasGc::ClearRenderBuffer(class CHuiCanvasRenderBuffer &, class TRect const &)
+	?DoClearRenderBuffer@CHuiCanvasGc@@MAEXAAVCHuiCanvasRenderBuffer@@ABVTRect@@@Z @ 1538 NONAME ; void CHuiCanvasGc::DoClearRenderBuffer(class CHuiCanvasRenderBuffer &, class TRect const &)
+	?BrushWithTypeAt@CHuiBrushArray@@QAEPAVCHuiBrush@@HH@Z @ 1539 NONAME ; class CHuiBrush * CHuiBrushArray::BrushWithTypeAt(int, int)
+	?BrushWithTypeCount@CHuiBrushArray@@QBEHH@Z @ 1540 NONAME ; int CHuiBrushArray::BrushWithTypeCount(int) const
+	?Effectable@CHuiVisual@@QBEPAVMHuiEffectable@@XZ @ 1541 NONAME ; class MHuiEffectable * CHuiVisual::Effectable(void) const
+	?SetVisual@CHuiFxEffect@@QAEXPAVMHuiEffectable@@@Z @ 1542 NONAME ; void CHuiFxEffect::SetVisual(class MHuiEffectable *)
+	?SetVisual@CHuiFxFilterLayer@@UAEXPAVMHuiEffectable@@@Z @ 1543 NONAME ; void CHuiFxFilterLayer::SetVisual(class MHuiEffectable *)
+	?SetVisual@CHuiFxGroupLayer@@UAEXPAVMHuiEffectable@@@Z @ 1544 NONAME ; void CHuiFxGroupLayer::SetVisual(class MHuiEffectable *)
+	?SetVisual@CHuiFxVisualLayer@@UAEXPAVMHuiEffectable@@@Z @ 1545 NONAME ; void CHuiFxVisualLayer::SetVisual(class MHuiEffectable *)
+	?IsBackgroundDrawingEnabled@CHuiCanvasVisual@@QBEHXZ @ 1546 NONAME ; int CHuiCanvasVisual::IsBackgroundDrawingEnabled(void) const
+	?Size@CHuiCanvasRenderBuffer@@QBE?AVTSize@@XZ @ 1547 NONAME ; class TSize CHuiCanvasRenderBuffer::Size(void) const
+	?Copy@CHuiCanvasRenderBuffer@@UAEXABV1@@Z @ 1548 NONAME ; void CHuiCanvasRenderBuffer::Copy(class CHuiCanvasRenderBuffer const &)
+	?IsInitialized@CHuiCanvasRenderBuffer@@QBEHXZ @ 1549 NONAME ; int CHuiCanvasRenderBuffer::IsInitialized(void) const
+	?StoreRenderBufferL@CHuiCanvasVisual@@QAEXXZ @ 1550 NONAME ; void CHuiCanvasVisual::StoreRenderBufferL(void)
+	?FreeRenderBuffer@CHuiCanvasVisual@@QAEXXZ @ 1551 NONAME ; void CHuiCanvasVisual::FreeRenderBuffer(void)
+	?FxmlUsesInput1@CHuiFxEngine@@QAEHABVTDesC16@@@Z @ 1552 NONAME ; int CHuiFxEngine::FxmlUsesInput1(class TDesC16 const &)
+	?LayerUsesAlphaFlag@CHuiCanvasVisual@@QAEHXZ @ 1553 NONAME ; int CHuiCanvasVisual::LayerUsesAlphaFlag(void)
+	?SetLayerExtent@CHuiCanvasVisual@@QAEXAAVTRect@@@Z @ 1554 NONAME ; void CHuiCanvasVisual::SetLayerExtent(class TRect &)
+	?LayerExtent@CHuiCanvasVisual@@QAEAAVTRect@@XZ @ 1555 NONAME ; class TRect & CHuiCanvasVisual::LayerExtent(void)
+	?SetLayerUsesAlphaFlag@CHuiCanvasVisual@@QAEXH@Z @ 1556 NONAME ; void CHuiCanvasVisual::SetLayerUsesAlphaFlag(int)
+	?SetStoredRenderBuffer@CHuiVisual@@QAEXPAVCHuiCanvasRenderBuffer@@@Z @ 1557 NONAME ; void CHuiVisual::SetStoredRenderBuffer(class CHuiCanvasRenderBuffer *)
+	?StoredRenderBuffer@CHuiVisual@@QBEPAVCHuiCanvasRenderBuffer@@XZ @ 1558 NONAME ; class CHuiCanvasRenderBuffer * CHuiVisual::StoredRenderBuffer(void) const
+	?Copy@CHuiCanvasRenderBuffer@@UAEXVTPoint@@@Z @ 1559 NONAME ; void CHuiCanvasRenderBuffer::Copy(class TPoint)
+	?SetStoredRenderBufferModificationsEnabled@CHuiVisual@@QAEXH@Z @ 1560 NONAME ; void CHuiVisual::SetStoredRenderBufferModificationsEnabled(int)
+	?SetFreezeState@CHuiVisual@@QAEXH@Z @ 1561 NONAME ; void CHuiVisual::SetFreezeState(int)
+	?Freezed@CHuiVisual@@QBEHXZ @ 1562 NONAME ; int CHuiVisual::Freezed(void) const
+	?SetPolygonFillTexture@CHuiCanvasGc@@UAEXPAVCHuiTexture@@@Z @ 1563 NONAME ; void CHuiCanvasGc::SetPolygonFillTexture(class CHuiTexture *)
+	?PolygonFillTexture@CHuiCanvasGc@@UBEPAVCHuiTexture@@XZ @ 1564 NONAME ; class CHuiTexture * CHuiCanvasGc::PolygonFillTexture(void) const
+	?SetPolygonFillTextureOrigin@CHuiCanvasGc@@UAEXABVTPoint@@@Z @ 1565 NONAME ; void CHuiCanvasGc::SetPolygonFillTextureOrigin(class TPoint const &)
+	?PolygonFillTextureOrigin@CHuiCanvasGc@@UBE?AVTPoint@@XZ @ 1566 NONAME ; class TPoint CHuiCanvasGc::PolygonFillTextureOrigin(void) const
+	?NotifyMemoryLevel@CHuiEnv@@QAEXW4THuiMemoryLevel@@@Z @ 1567 NONAME ; void CHuiEnv::NotifyMemoryLevel(enum THuiMemoryLevel)
+	?AddMemoryLevelObserver@CHuiEnv@@QAEXPAVMHuiMemoryLevelObserver@@@Z @ 1568 NONAME ; void CHuiEnv::AddMemoryLevelObserver(class MHuiMemoryLevelObserver *)
+	?RemoveMemoryLevelObserver@CHuiEnv@@QAEXPAVMHuiMemoryLevelObserver@@@Z @ 1569 NONAME ; void CHuiEnv::RemoveMemoryLevelObserver(class MHuiMemoryLevelObserver *)
+	?MemoryLevel@CHuiEnv@@QAE?AW4THuiMemoryLevel@@XZ @ 1570 NONAME ; enum THuiMemoryLevel CHuiEnv::MemoryLevel(void)
+	?SetForegroundTexture@CHuiDisplay@@QAEXPAVCHuiTexture@@@Z @ 1571 NONAME ; void CHuiDisplay::SetForegroundTexture(class CHuiTexture *)
+	?ForegroundTexture@CHuiDisplay@@QBEPAVCHuiTexture@@XZ @ 1572 NONAME ; class CHuiTexture * CHuiDisplay::ForegroundTexture(void) const
+	?ActiveGroupEffect@CHuiFxEngine@@QAEHXZ @ 1573 NONAME ; int CHuiFxEngine::ActiveGroupEffect(void)
+	?StartGroupEffect@CHuiFxEngine@@QAEXH@Z @ 1574 NONAME ; void CHuiFxEngine::StartGroupEffect(int)
+	?SetEffectGroup@CHuiFxEffect@@QAEXH@Z @ 1575 NONAME ; void CHuiFxEffect::SetEffectGroup(int)
+	?LoadGroupEffectL@CHuiFxEngine@@QAEXABVTDesC16@@AAPAVCHuiFxEffect@@PAVMHuiEffectable@@HPAVTRect@@PAVMAlfGfxEffectObserver@@HH@Z @ 1576 NONAME ; void CHuiFxEngine::LoadGroupEffectL(class TDesC16 const &, class CHuiFxEffect * &, class MHuiEffectable *, int, class TRect *, class MAlfGfxEffectObserver *, int, int)
+	?BeginGroupEffect@CHuiFxEngine@@QAEXH@Z @ 1577 NONAME ; void CHuiFxEngine::BeginGroupEffect(int)
+	?GroupId@CHuiFxEffect@@QAEHXZ @ 1578 NONAME ; int CHuiFxEffect::GroupId(void)
+	?SetMemoryLevel@CHuiFxEngine@@UAEXW4THuiMemoryLevel@@@Z @ 1579 NONAME ; void CHuiFxEngine::SetMemoryLevel(enum THuiMemoryLevel)
+	?SetForegroundBitmapL@CHuiDisplay@@QAEXPAVCFbsBitmap@@@Z @ 1580 NONAME ; void CHuiDisplay::SetForegroundBitmapL(class CFbsBitmap *)
+	?ForegroundBitmap@CHuiDisplay@@QBEPAVCFbsBitmap@@XZ @ 1581 NONAME ; class CFbsBitmap * CHuiDisplay::ForegroundBitmap(void) const
+	?HasCommandBuffers@CHuiCanvasVisual@@QBEHH@Z @ 1582 NONAME ; int CHuiCanvasVisual::HasCommandBuffers(int) const
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/eabi/hitchcocku.DEF	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1982 @@
+EXPORTS
+	_ZN10CHuiLayout10ConstructLEv @ 1 NONAME
+	_ZN10CHuiLayout11SetBaseUnitERK10THuiMetric @ 2 NONAME
+	_ZN10CHuiLayout11SetBaseUnitERK12THuiXYMetric @ 3 NONAME
+	_ZN10CHuiLayout12ChildOrdinalEi @ 4 NONAME
+	_ZN10CHuiLayout12ClearChangedEv @ 5 NONAME
+	_ZN10CHuiLayout12PrepareDrawLEv @ 6 NONAME
+	_ZN10CHuiLayout12ScrollOffsetEv @ 7 NONAME
+	_ZN10CHuiLayout12SetSessionIdEi @ 8 NONAME
+	_ZN10CHuiLayout13ReportChangedEv @ 9 NONAME
+	_ZN10CHuiLayout15SetInnerPaddingERK12THuiXYMetric @ 10 NONAME
+	_ZN10CHuiLayout15SetInnerPaddingERK6TPoint @ 11 NONAME
+	_ZN10CHuiLayout15VisualExtensionERK4TUidPPv @ 12 NONAME
+	_ZN10CHuiLayout16EnableScrollingLEi @ 13 NONAME
+	_ZN10CHuiLayout16MoveVisualToBackER10CHuiVisuali @ 14 NONAME
+	_ZN10CHuiLayout17MoveVisualToFrontER10CHuiVisuali @ 15 NONAME
+	_ZN10CHuiLayout17SetTransitionTimeEi @ 16 NONAME
+	_ZN10CHuiLayout17UpdateChildLayoutEii @ 17 NONAME
+	_ZN10CHuiLayout18NotifySkinChangedLEv @ 18 NONAME
+	_ZN10CHuiLayout20RemoveAndDestroyAllDEv @ 19 NONAME
+	_ZN10CHuiLayout20UpdateChildrenLayoutEi @ 20 NONAME
+	_ZN10CHuiLayout6RemoveEP10CHuiVisuali @ 21 NONAME
+	_ZN10CHuiLayout6SetPosERK13THuiRealPointi @ 22 NONAME
+	_ZN10CHuiLayout7AddNewLER11CHuiControlPS_ @ 23 NONAME
+	_ZN10CHuiLayout7AppendLEP10CHuiVisuali @ 24 NONAME
+	_ZN10CHuiLayout7FindTagERK6TDesC8 @ 25 NONAME
+	_ZN10CHuiLayout7InsertLEP10CHuiVisualii @ 26 NONAME
+	_ZN10CHuiLayout7ReorderER10CHuiVisualii @ 27 NONAME
+	_ZN10CHuiLayout7SetSizeERK12THuiRealSizei @ 28 NONAME
+	_ZN10CHuiLayout8ChildPosEiR6TPoint @ 29 NONAME
+	_ZN10CHuiLayout9ChildRectEiR12THuiRealRect @ 30 NONAME
+	_ZN10CHuiLayout9ChildSizeEiR5TSize @ 31 NONAME
+	_ZN10CHuiLayoutC1ER15MHuiVisualOwner @ 32 NONAME
+	_ZN10CHuiLayoutC2ER15MHuiVisualOwner @ 33 NONAME
+	_ZN10CHuiLayoutD0Ev @ 34 NONAME
+	_ZN10CHuiLayoutD1Ev @ 35 NONAME
+	_ZN10CHuiLayoutD2Ev @ 36 NONAME
+	_ZN10CHuiStatic10FrameCountEv @ 37 NONAME
+	_ZN10CHuiStatic10TimeFactorEv @ 38 NONAME
+	_ZN10CHuiStatic10TimePausedEv @ 39 NONAME
+	_ZN10CHuiStatic12ContinueTimeEv @ 40 NONAME
+	_ZN10CHuiStatic13EnableLoggingEi @ 41 NONAME
+	_ZN10CHuiStatic13SetTimeFactorEf @ 42 NONAME
+	_ZN10CHuiStatic14ElapsedSecondsEv @ 43 NONAME
+	_ZN10CHuiStatic16AverageFrameRateEv @ 44 NONAME
+	_ZN10CHuiStatic17SecondsSinceStartEv @ 45 NONAME
+	_ZN10CHuiStatic20LayoutTransitionTimeEv @ 46 NONAME
+	_ZN10CHuiStatic22MilliSecondsSinceStartEv @ 47 NONAME
+	_ZN10CHuiStatic23SetLayoutTransitionTimeEi @ 48 NONAME
+	_ZN10CHuiStatic3EnvEv @ 49 NONAME
+	_ZN10CHuiStatic3TicEi @ 50 NONAME
+	_ZN10CHuiStatic3TocEi @ 51 NONAME
+	_ZN10CHuiStatic4DataEv @ 52 NONAME
+	_ZN10CHuiStatic4TimeEv @ 53 NONAME
+	_ZN10CHuiStatic6PrintfE11TRefByValueIK6TDesC8Ez @ 54 NONAME
+	_ZN10CHuiStatic6PrintfE11TRefByValueIK7TDesC16Ez @ 55 NONAME
+	_ZN10CHuiStatic7LoggingEv @ 56 NONAME
+	_ZN10CHuiStatic8SetProbeEP9MHuiProbe @ 57 NONAME
+	_ZN10CHuiStatic9FrameRateEv @ 58 NONAME
+	_ZN10CHuiStatic9FsSessionEv @ 59 NONAME
+	_ZN10CHuiStatic9PauseTimeEv @ 60 NONAME
+	_ZN10CHuiVisual10ClearFlagsEi @ 61 NONAME
+	_ZN10CHuiVisual10ConstructLEv @ 62 NONAME
+	_ZN10CHuiVisual10SetChangedEv @ 63 NONAME
+	_ZN10CHuiVisual10SetMaxSizeERK5TSize @ 64 NONAME
+	_ZN10CHuiVisual10SetMinSizeERK5TSize @ 65 NONAME
+	_ZN10CHuiVisual10SetPaddingERK13THuiBoxMetric @ 66 NONAME
+	_ZN10CHuiVisual10SetPaddingERK6TPoint @ 67 NONAME
+	_ZN10CHuiVisual10SetPaddingEi @ 68 NONAME
+	_ZN10CHuiVisual11MoveToFrontEi @ 69 NONAME
+	_ZN10CHuiVisual11SetClippingEi @ 70 NONAME
+	_ZN10CHuiVisual12ClearChangedEv @ 71 NONAME
+	_ZN10CHuiVisual12PrepareDrawLEv @ 72 NONAME
+	_ZN10CHuiVisual12SetSessionIdEi @ 73 NONAME
+	_ZN10CHuiVisual13ReportChangedEv @ 74 NONAME
+	_ZN10CHuiVisual14EnableBrushesLEi @ 75 NONAME
+	_ZN10CHuiVisual14TransformationEv @ 76 NONAME
+	_ZN10CHuiVisual15VisualExtensionERK4TUidPPv @ 77 NONAME
+	_ZN10CHuiVisual18NotifySkinChangedLEv @ 78 NONAME
+	_ZN10CHuiVisual20RemoveAndDestroyAllDEv @ 79 NONAME
+	_ZN10CHuiVisual20UpdateChildrenLayoutEi @ 80 NONAME
+	_ZN10CHuiVisual21EnableTransformationLEi @ 81 NONAME
+	_ZN10CHuiVisual21SetCenteredPosAndSizeERK6TPointRK5TSizei @ 82 NONAME
+	_ZN10CHuiVisual4MoveERK6TPointi @ 83 NONAME
+	_ZN10CHuiVisual5MimicERKS_i @ 84 NONAME
+	_ZN10CHuiVisual6SetPosERK13THuiRealPointi @ 85 NONAME
+	_ZN10CHuiVisual7AddNewLER11CHuiControlP10CHuiLayout @ 86 NONAME
+	_ZN10CHuiVisual7BrushesEv @ 87 NONAME
+	_ZN10CHuiVisual7FindTagERK6TDesC8 @ 88 NONAME
+	_ZN10CHuiVisual7SetFlagE15THuiVisualFlags @ 89 NONAME
+	_ZN10CHuiVisual7SetRectERK12THuiRealRecti @ 90 NONAME
+	_ZN10CHuiVisual7SetSizeERK12THuiRealSizei @ 91 NONAME
+	_ZN10CHuiVisual7SetTagLERK6TDesC8 @ 92 NONAME
+	_ZN10CHuiVisual8SetFlagsEi @ 93 NONAME
+	_ZN10CHuiVisual8SetOwnerER15MHuiVisualOwner @ 94 NONAME
+	_ZN10CHuiVisual9ClearFlagE15THuiVisualFlags @ 95 NONAME
+	_ZN10CHuiVisual9SetOriginE17THuiVisualHOrigin17THuiVisualVOrigin @ 96 NONAME
+	_ZN10CHuiVisualC1ER15MHuiVisualOwner @ 97 NONAME
+	_ZN10CHuiVisualC2ER15MHuiVisualOwner @ 98 NONAME
+	_ZN10CHuiVisualD0Ev @ 99 NONAME
+	_ZN10CHuiVisualD1Ev @ 100 NONAME
+	_ZN10CHuiVisualD2Ev @ 101 NONAME
+	_ZN10HuiFixMath6FixCosEi @ 102 NONAME
+	_ZN10HuiFixMath6FixSinEi @ 103 NONAME
+	_ZN10HuiFixMath8FixHypotEii @ 104 NONAME
+	_ZN10THuiMetricC1Efii @ 105 NONAME
+	_ZN10THuiMetricC1Ei @ 106 NONAME
+	_ZN10THuiMetricC2Efii @ 107 NONAME
+	_ZN10THuiMetricC2Ei @ 108 NONAME
+	_ZN11CHuiControl11BindDisplayER11CHuiDisplay @ 109 NONAME
+	_ZN11CHuiControl11OfferEventLERK9THuiEvent @ 110 NONAME
+	_ZN11CHuiControl12AcquireFocusEv @ 111 NONAME
+	_ZN11CHuiControl12EventHandlerEv @ 112 NONAME
+	_ZN11CHuiControl12FocusChangedER11CHuiDisplayi @ 113 NONAME
+	_ZN11CHuiControl12SetSessionIdEi @ 114 NONAME
+	_ZN11CHuiControl12VisualAddedLEP10CHuiVisual @ 115 NONAME
+	_ZN11CHuiControl13AppendLayoutLE14THuiLayoutTypeP10CHuiLayout @ 116 NONAME
+	_ZN11CHuiControl13AppendVisualLE14THuiVisualTypeP10CHuiLayout @ 117 NONAME
+	_ZN11CHuiControl13HostChangingLEPS_ @ 118 NONAME
+	_ZN11CHuiControl13VisualRemovedEP10CHuiVisual @ 119 NONAME
+	_ZN11CHuiControl14AddConnectionLEPS_i @ 120 NONAME
+	_ZN11CHuiControl14BaseConstructLEv @ 121 NONAME
+	_ZN11CHuiControl15VisualDestroyedER10CHuiVisual @ 122 NONAME
+	_ZN11CHuiControl16ConnectionAddedLEPS_i @ 123 NONAME
+	_ZN11CHuiControl16ControlExtensionERK4TUidPPv @ 124 NONAME
+	_ZN11CHuiControl16RemoveConnectionEPS_ @ 125 NONAME
+	_ZN11CHuiControl17CancelAllCommandsEv @ 126 NONAME
+	_ZN11CHuiControl17ConnectionRemovedEPS_i @ 127 NONAME
+	_ZN11CHuiControl19VisualLayoutUpdatedER10CHuiVisual @ 128 NONAME
+	_ZN11CHuiControl23NotifyControlVisibilityEiR11CHuiDisplay @ 129 NONAME
+	_ZN11CHuiControl23VisualPrepareDrawFailedER10CHuiVisuali @ 130 NONAME
+	_ZN11CHuiControl5SetIdEi @ 131 NONAME
+	_ZN11CHuiControl6RemoveEP10CHuiVisual @ 132 NONAME
+	_ZN11CHuiControl7AppendLEP10CHuiVisual @ 133 NONAME
+	_ZN11CHuiControl7AppendLEP10CHuiVisualP10CHuiLayout @ 134 NONAME
+	_ZN11CHuiControl7SetHostEPS_ @ 135 NONAME
+	_ZN11CHuiControl7SetRoleEi @ 136 NONAME
+	_ZN11CHuiControl9SetHostIdEi @ 137 NONAME
+	_ZN11CHuiControlC1ER7CHuiEnv @ 138 NONAME
+	_ZN11CHuiControlC2ER7CHuiEnv @ 139 NONAME
+	_ZN11CHuiControlD0Ev @ 140 NONAME
+	_ZN11CHuiControlD1Ev @ 141 NONAME
+	_ZN11CHuiControlD2Ev @ 142 NONAME
+	_ZN11CHuiDisplay10SetQualityE11THuiQuality @ 143 NONAME
+	_ZN11CHuiDisplay11SetUseDepthEi @ 144 NONAME
+	_ZN11CHuiDisplay14SetOrientationEN6CHuiGc12TOrientationE @ 145 NONAME
+	_ZN11CHuiDisplay14SetVisibleAreaERK5TRect @ 146 NONAME
+	_ZN11CHuiDisplay18SetBackgroundColorERK4TRgb @ 147 NONAME
+	_ZN11CHuiDisplay19SetClearBackgroundLENS_10TClearModeE @ 148 NONAME
+	_ZN11CHuiDisplay3EnvEv @ 149 NONAME
+	_ZN11CHuiDisplay4ShowEi @ 150 NONAME
+	_ZN11CHuiDisplay6RosterEv @ 151 NONAME
+	_ZN11CHuiDisplay7ReleaseEv @ 152 NONAME
+	_ZN11CHuiDisplay8ActivateEi @ 153 NONAME
+	_ZN11CHuiDisplay8RestoreLEv @ 154 NONAME
+	_ZN11CHuiDisplay8SetDirtyEv @ 155 NONAME
+	_ZN11CHuiDisplay8SetSizeLERK5TSize @ 156 NONAME
+	_ZN11CHuiDisplay9SetUsageLEj @ 157 NONAME
+	_ZN11CHuiDisplayD0Ev @ 158 NONAME
+	_ZN11CHuiDisplayD1Ev @ 159 NONAME
+	_ZN11CHuiDisplayD2Ev @ 160 NONAME
+	_ZN11CHuiS60Skin10ConstructLEv @ 161 NONAME
+	_ZN11CHuiS60Skin10GetTextureEiRPK11CHuiTexture @ 162 NONAME
+	_ZN11CHuiS60Skin10SetContextER6CHuiGc @ 163 NONAME
+	_ZN11CHuiS60Skin13SkinExtensionERK4TUidPPv @ 164 NONAME
+	_ZN11CHuiS60Skin14ReleaseTextureEi @ 165 NONAME
+	_ZN11CHuiS60Skin22RestoreTextureContentLER11CHuiTexture @ 166 NONAME
+	_ZN11CHuiS60Skin25NotifyDisplaySizeChangedLEv @ 167 NONAME
+	_ZN11CHuiS60Skin8LocationE15THuiSkinElement @ 168 NONAME
+	_ZN11CHuiS60Skin8TextureLEi @ 169 NONAME
+	_ZN11CHuiS60SkinC1ER7CHuiEnv @ 170 NONAME
+	_ZN11CHuiS60SkinC2ER7CHuiEnv @ 171 NONAME
+	_ZN11CHuiS60SkinD0Ev @ 172 NONAME
+	_ZN11CHuiS60SkinD1Ev @ 173 NONAME
+	_ZN11CHuiS60SkinD2Ev @ 174 NONAME
+	_ZN11CHuiTexture11SetPriorityEi @ 175 NONAME
+	_ZN11CHuiTexture12EnableShadowEi @ 176 NONAME
+	_ZN11CHuiTexture12SetSessionIdEi @ 177 NONAME
+	_ZN11CHuiTexture14SetSegmentNameEij @ 178 NONAME
+	_ZN11CHuiTexture14SetSegmentSizeEiRK5TSize @ 179 NONAME
+	_ZN11CHuiTexture14SetShadowStyleE15THuiShadowStyle @ 180 NONAME
+	_ZN11CHuiTexture14SetSkinContentEi @ 181 NONAME
+	_ZN11CHuiTexture15ClearWithAlphaLERK5TSizeRK4TRgbh @ 182 NONAME
+	_ZN11CHuiTexture15ShadowedTextureEv @ 183 NONAME
+	_ZN11CHuiTexture16SegmentedTextureEv @ 184 NONAME
+	_ZN11CHuiTexture16SetSegmentCountLEi @ 185 NONAME
+	_ZN11CHuiTexture16SetSegmentOffsetEiRK6TPoint @ 186 NONAME
+	_ZN11CHuiTexture21SetSegmentTextureSizeEiRK5TSize @ 187 NONAME
+	_ZN11CHuiTexture4NewLEPK17THuiTextureHandle @ 188 NONAME
+	_ZN11CHuiTexture5NewLCEPK17THuiTextureHandle @ 189 NONAME
+	_ZN11CHuiTexture6ClearLERK5TSizeRK4TRgb @ 190 NONAME
+	_ZN11CHuiTexture7SetSizeERK5TSize @ 191 NONAME
+	_ZN11CHuiTextureD0Ev @ 192 NONAME
+	_ZN11CHuiTextureD1Ev @ 193 NONAME
+	_ZN11CHuiTextureD2Ev @ 194 NONAME
+	_ZN11MHuiTextureD0Ev @ 195 NONAME
+	_ZN11MHuiTextureD1Ev @ 196 NONAME
+	_ZN11MHuiTextureD2Ev @ 197 NONAME
+	_ZN11THuiCommand16CommandExtensionERK4TUidPPv @ 198 NONAME
+	_ZN11THuiCommand9SetSenderE21THuiCommandObjectTypePv @ 199 NONAME
+	_ZN11THuiCommandD0Ev @ 200 NONAME
+	_ZN11THuiCommandD1Ev @ 201 NONAME
+	_ZN11THuiCommandD2Ev @ 202 NONAME
+	_ZN12THuiMaterialC1Ev @ 203 NONAME
+	_ZN12THuiMaterialC2Ev @ 204 NONAME
+	_ZN12THuiXYMetricC1ERK10THuiMetric @ 205 NONAME
+	_ZN12THuiXYMetricC1ERK10THuiMetricS2_ @ 206 NONAME
+	_ZN12THuiXYMetricC1Ev @ 207 NONAME
+	_ZN12THuiXYMetricC2ERK10THuiMetric @ 208 NONAME
+	_ZN12THuiXYMetricC2ERK10THuiMetricS2_ @ 209 NONAME
+	_ZN12THuiXYMetricC2Ev @ 210 NONAME
+	_ZN13CHuiCurvePath10AppendArcLERK6TPointRK5TSizefff @ 211 NONAME
+	_ZN13CHuiCurvePath10EnableLoopEi @ 212 NONAME
+	_ZN13CHuiCurvePath11AppendLineLERK6TPointS2_f @ 213 NONAME
+	_ZN13CHuiCurvePath4NewLEv @ 214 NONAME
+	_ZN13CHuiCurvePath5NewLCEv @ 215 NONAME
+	_ZN13CHuiCurvePath5ResetEv @ 216 NONAME
+	_ZN13CHuiCurvePath9SetOriginEf @ 217 NONAME
+	_ZN13CHuiCurvePathD0Ev @ 218 NONAME
+	_ZN13CHuiCurvePathD1Ev @ 219 NONAME
+	_ZN13CHuiCurvePathD2Ev @ 220 NONAME
+	_ZN13THuiBoxMetricC1ERK10THuiMetric @ 221 NONAME
+	_ZN13THuiBoxMetricC1ERK10THuiMetricS2_S2_S2_ @ 222 NONAME
+	_ZN13THuiBoxMetricC1ERK12THuiXYMetric @ 223 NONAME
+	_ZN13THuiBoxMetricC1ERK12THuiXYMetricS2_ @ 224 NONAME
+	_ZN13THuiBoxMetricC1Ev @ 225 NONAME
+	_ZN13THuiBoxMetricC2ERK10THuiMetric @ 226 NONAME
+	_ZN13THuiBoxMetricC2ERK10THuiMetricS2_S2_S2_ @ 227 NONAME
+	_ZN13THuiBoxMetricC2ERK12THuiXYMetric @ 228 NONAME
+	_ZN13THuiBoxMetricC2ERK12THuiXYMetricS2_ @ 229 NONAME
+	_ZN13THuiBoxMetricC2Ev @ 230 NONAME
+	_ZN13THuiTextStyle10SetPostureEi @ 231 NONAME
+	_ZN13THuiTextStyle11SetParentIdEi @ 232 NONAME
+	_ZN13THuiTextStyle12SetTextColorERK4TRgb @ 233 NONAME
+	_ZN13THuiTextStyle12SetUnderlineEi @ 234 NONAME
+	_ZN13THuiTextStyle12StrokeWeightEv @ 235 NONAME
+	_ZN13THuiTextStyle15SetStrokeWeightEi @ 236 NONAME
+	_ZN13THuiTextStyle15TextSizeInTwipsEi @ 237 NONAME
+	_ZN13THuiTextStyle16SetStrikeThroughEi @ 238 NONAME
+	_ZN13THuiTextStyle16TextSizeInPixelsEi @ 239 NONAME
+	_ZN13THuiTextStyle18SetBackgroundColorERK4TRgb @ 240 NONAME
+	_ZN13THuiTextStyle18SetTextSizeInTwipsEii @ 241 NONAME
+	_ZN13THuiTextStyle19SetTextSizeInPixelsEii @ 242 NONAME
+	_ZN13THuiTextStyle4FontEv @ 243 NONAME
+	_ZN13THuiTextStyle7PostureEv @ 244 NONAME
+	_ZN13THuiTextStyle7SetFontE8THuiFont @ 245 NONAME
+	_ZN13THuiTextStyleC1ERKS_ @ 246 NONAME
+	_ZN13THuiTextStyleC2ERKS_ @ 247 NONAME
+	_ZN14CHuiBrushArray2AtEi @ 248 NONAME
+	_ZN14CHuiBrushArray4NewLEv @ 249 NONAME
+	_ZN14CHuiBrushArray5NewLCEv @ 250 NONAME
+	_ZN14CHuiBrushArray5ResetEv @ 251 NONAME
+	_ZN14CHuiBrushArray6RemoveEi @ 252 NONAME
+	_ZN14CHuiBrushArray7AppendLEP9CHuiBrush13THuiOwnership @ 253 NONAME
+	_ZN14CHuiBrushArray7InsertLEiP9CHuiBrush13THuiOwnership @ 254 NONAME
+	_ZN14CHuiBrushArrayD0Ev @ 255 NONAME
+	_ZN14CHuiBrushArrayD1Ev @ 256 NONAME
+	_ZN14CHuiBrushArrayD2Ev @ 257 NONAME
+	_ZN14CHuiBrushArrayixEi @ 258 NONAME
+	_ZN14CHuiDeckLayout7AddNewLER11CHuiControlP10CHuiLayout @ 259 NONAME
+	_ZN14CHuiDeckLayoutD0Ev @ 260 NONAME
+	_ZN14CHuiDeckLayoutD1Ev @ 261 NONAME
+	_ZN14CHuiDeckLayoutD2Ev @ 262 NONAME
+	_ZN14CHuiFlowLayout12SetCenteringEi @ 263 NONAME
+	_ZN14CHuiFlowLayout16SetFlowDirectionENS_14TFlowDirectionE @ 264 NONAME
+	_ZN14CHuiFlowLayout7AddNewLER11CHuiControlNS_14TFlowDirectionEP10CHuiLayout @ 265 NONAME
+	_ZN14CHuiFlowLayout7SetModeEi @ 266 NONAME
+	_ZN14CHuiFlowLayout7SetSizeERK12THuiRealSizei @ 267 NONAME
+	_ZN14CHuiFlowLayout8ChildPosEiR6TPoint @ 268 NONAME
+	_ZN14CHuiFlowLayout9ChildRectEiR12THuiRealRect @ 269 NONAME
+	_ZN14CHuiFlowLayout9ChildSizeEiR5TSize @ 270 NONAME
+	_ZN14CHuiFlowLayoutD0Ev @ 271 NONAME
+	_ZN14CHuiFlowLayoutD1Ev @ 272 NONAME
+	_ZN14CHuiFlowLayoutD2Ev @ 273 NONAME
+	_ZN14CHuiFrameBrush14SetFrameRectsLERK5TRectS2_ @ 274 NONAME
+	_ZN14CHuiFrameBrush4NewLERK11TAknsItemIDii @ 275 NONAME
+	_ZN14CHuiFrameBrush5NewLCERK11TAknsItemIDii @ 276 NONAME
+	_ZN14CHuiGridLayout10ConstructLEv @ 277 NONAME
+	_ZN14CHuiGridLayout11SetColumnsLERK6RArrayIiE @ 278 NONAME
+	_ZN14CHuiGridLayout11SetColumnsLEi @ 279 NONAME
+	_ZN14CHuiGridLayout12ChildOrdinalEi @ 280 NONAME
+	_ZN14CHuiGridLayout12ClearChangedEv @ 281 NONAME
+	_ZN14CHuiGridLayout12FillWeightsLE17THuiGridDimensioniRK10THuiMetric @ 282 NONAME
+	_ZN14CHuiGridLayout12PrepareDrawLEv @ 283 NONAME
+	_ZN14CHuiGridLayout12SetExpandingEi @ 284 NONAME
+	_ZN14CHuiGridLayout12SetSessionIdEi @ 285 NONAME
+	_ZN14CHuiGridLayout13AppendWeightLE17THuiGridDimensionRK10THuiMetric @ 286 NONAME
+	_ZN14CHuiGridLayout13InsertWeightLE17THuiGridDimensionRK10THuiMetrici @ 287 NONAME
+	_ZN14CHuiGridLayout13RemoveWeightLE17THuiGridDimensioni @ 288 NONAME
+	_ZN14CHuiGridLayout13ReportChangedEv @ 289 NONAME
+	_ZN14CHuiGridLayout14ReplaceWeightLE17THuiGridDimensionRK10THuiMetrici @ 290 NONAME
+	_ZN14CHuiGridLayout15VisualExtensionERK4TUidPPv @ 291 NONAME
+	_ZN14CHuiGridLayout18NotifySkinChangedLEv @ 292 NONAME
+	_ZN14CHuiGridLayout20RemoveAndDestroyAllDEv @ 293 NONAME
+	_ZN14CHuiGridLayout20UpdateChildrenLayoutEi @ 294 NONAME
+	_ZN14CHuiGridLayout6SetPosERK13THuiRealPointi @ 295 NONAME
+	_ZN14CHuiGridLayout7AddNewLER11CHuiControliiP10CHuiLayout @ 296 NONAME
+	_ZN14CHuiGridLayout7FindTagERK6TDesC8 @ 297 NONAME
+	_ZN14CHuiGridLayout7SetSizeERK12THuiRealSizei @ 298 NONAME
+	_ZN14CHuiGridLayout8ChildPosEiR6TPoint @ 299 NONAME
+	_ZN14CHuiGridLayout8SetRowsLERK6RArrayIiE @ 300 NONAME
+	_ZN14CHuiGridLayout8SetRowsLEi @ 301 NONAME
+	_ZN14CHuiGridLayout9ChildRectEiR12THuiRealRect @ 302 NONAME
+	_ZN14CHuiGridLayout9ChildSizeEiR5TSize @ 303 NONAME
+	_ZN14CHuiGridLayoutC1ER15MHuiVisualOwner @ 304 NONAME
+	_ZN14CHuiGridLayoutC2ER15MHuiVisualOwner @ 305 NONAME
+	_ZN14CHuiGridLayoutD0Ev @ 306 NONAME
+	_ZN14CHuiGridLayoutD1Ev @ 307 NONAME
+	_ZN14CHuiGridLayoutD2Ev @ 308 NONAME
+	_ZN14CHuiImageBrush10SetBordersEiiii @ 309 NONAME
+	_ZN14CHuiImageBrush12SetScaleModeEN15CHuiImageVisual10TScaleModeE @ 310 NONAME
+	_ZN14CHuiImageBrush4NewLERK9THuiImage @ 311 NONAME
+	_ZN14CHuiImageBrush5NewLCERK9THuiImage @ 312 NONAME
+	_ZN14CHuiImageBrush8SetImageERK9THuiImage @ 313 NONAME
+	_ZN14CHuiImageBrushD0Ev @ 314 NONAME
+	_ZN14CHuiImageBrushD1Ev @ 315 NONAME
+	_ZN14CHuiImageBrushD2Ev @ 316 NONAME
+	_ZN14CHuiLineVisual16SetAlphaFunctionEP19MHuiMappingFunction @ 317 NONAME
+	_ZN14CHuiLineVisual16SetWidthFunctionEP19MHuiMappingFunction @ 318 NONAME
+	_ZN14CHuiLineVisual4PathEv @ 319 NONAME
+	_ZN14CHuiLineVisual7AddNewLER11CHuiControlP10CHuiLayout @ 320 NONAME
+	_ZN14CHuiLineVisual7SetPathEP13CHuiCurvePath13THuiOwnership @ 321 NONAME
+	_ZN14CHuiLineVisual8SetImageERK9THuiImage @ 322 NONAME
+	_ZN14CHuiMeshVisual11CreateMeshLE12THuiMeshType @ 323 NONAME
+	_ZN14CHuiMeshVisual16SetSpecularImageERK9THuiImage @ 324 NONAME
+	_ZN14CHuiMeshVisual17SetSecondaryImageERK9THuiImage @ 325 NONAME
+	_ZN14CHuiMeshVisual4MeshEv @ 326 NONAME
+	_ZN14CHuiMeshVisual7AddNewLER11CHuiControl12THuiMeshTypeP10CHuiLayout @ 327 NONAME
+	_ZN14CHuiMeshVisual8SetImageERK9THuiImage @ 328 NONAME
+	_ZN14CHuiTextVisual11SetWrappingENS_9TLineWrapE @ 329 NONAME
+	_ZN14CHuiTextVisual12EnableShadowEi @ 330 NONAME
+	_ZN14CHuiTextVisual12SetTextStyleEi @ 331 NONAME
+	_ZN14CHuiTextVisual14SetLineSpacingEiNS_17TLineSpacingUnitsE @ 332 NONAME
+	_ZN14CHuiTextVisual15SetMaxLineCountEi @ 333 NONAME
+	_ZN14CHuiTextVisual7AddNewLER11CHuiControlP10CHuiLayout @ 334 NONAME
+	_ZN14CHuiTextVisual8SetAlignE19THuiAlignHorizontal17THuiAlignVertical @ 335 NONAME
+	_ZN14CHuiTextVisual8SetColorERK11TAknsItemIDi @ 336 NONAME
+	_ZN14CHuiTextVisual8SetColorERK4TRgb @ 337 NONAME
+	_ZN14CHuiTextVisual8SetStyleE26THuiPreconfiguredTextStyle18THuiBackgroundType @ 338 NONAME
+	_ZN14CHuiTextVisual8SetTextLERK7TDesC16 @ 339 NONAME
+	_ZN14THuiTimedPoint11SetFunctionEP19MHuiMappingFunction @ 340 NONAME
+	_ZN14THuiTimedPoint12SetWithSpeedERK13THuiRealPointf @ 341 NONAME
+	_ZN14THuiTimedPoint12SetWithSpeedEff @ 342 NONAME
+	_ZN14THuiTimedPoint3SetERK13THuiRealPointi @ 343 NONAME
+	_ZN14THuiTimedPoint3SetEfi @ 344 NONAME
+	_ZN14THuiTimedPoint6FinishEv @ 345 NONAME
+	_ZN14THuiTimedPoint8SetStyleE22THuiInterpolationStyle @ 346 NONAME
+	_ZN14THuiTimedPointC1Eff @ 347 NONAME
+	_ZN14THuiTimedPointC1Ev @ 348 NONAME
+	_ZN14THuiTimedPointC2Eff @ 349 NONAME
+	_ZN14THuiTimedPointC2Ev @ 350 NONAME
+	_ZN14THuiTimedValue11EnableClockEi @ 351 NONAME
+	_ZN14THuiTimedValue11SetFunctionEP19MHuiMappingFunction @ 352 NONAME
+	_ZN14THuiTimedValue12ClearChangedEv @ 353 NONAME
+	_ZN14THuiTimedValue12SetWithSpeedEff @ 354 NONAME
+	_ZN14THuiTimedValue14SetMappingModeEi @ 355 NONAME
+	_ZN14THuiTimedValue3SetEf @ 356 NONAME
+	_ZN14THuiTimedValue3SetEfi @ 357 NONAME
+	_ZN14THuiTimedValue6FinishEv @ 358 NONAME
+	_ZN14THuiTimedValue7SuspendEi @ 359 NONAME
+	_ZN14THuiTimedValue8SetStyleE22THuiInterpolationStyle @ 360 NONAME
+	_ZN14THuiTimedValueC1E22THuiInterpolationStyle @ 361 NONAME
+	_ZN14THuiTimedValueC1Ef22THuiInterpolationStyle @ 362 NONAME
+	_ZN14THuiTimedValueC2E22THuiInterpolationStyle @ 363 NONAME
+	_ZN14THuiTimedValueC2Ef22THuiInterpolationStyle @ 364 NONAME
+	_ZN14THuiTimedValueaSERKS_ @ 365 NONAME
+	_ZN15CHuiBorderBrush4NewLEiiii @ 366 NONAME
+	_ZN15CHuiBorderBrush5NewLCEiiii @ 367 NONAME
+	_ZN15CHuiBorderBrush8SetColorERK4TRgb @ 368 NONAME
+	_ZN15CHuiBorderBrush8SetImageERK9THuiImage @ 369 NONAME
+	_ZN15CHuiImageVisual10SetStretchEii @ 370 NONAME
+	_ZN15CHuiImageVisual12SetColorModeENS_10TColorModeEf @ 371 NONAME
+	_ZN15CHuiImageVisual12SetScaleModeENS_10TScaleModeE @ 372 NONAME
+	_ZN15CHuiImageVisual13SetDropShadowEi @ 373 NONAME
+	_ZN15CHuiImageVisual14SetStretchModeEN6CHuiGc12TStretchModeE @ 374 NONAME
+	_ZN15CHuiImageVisual17SetSecondaryImageERK9THuiImage @ 375 NONAME
+	_ZN15CHuiImageVisual7AddNewLER11CHuiControlP10CHuiLayout @ 376 NONAME
+	_ZN15CHuiImageVisual8SetColorERK4TRgb @ 377 NONAME
+	_ZN15CHuiImageVisual8SetImageERK9THuiImage @ 378 NONAME
+	_ZN15MHuiVisualOwnerD0Ev @ 379 NONAME
+	_ZN15MHuiVisualOwnerD1Ev @ 380 NONAME
+	_ZN15MHuiVisualOwnerD2Ev @ 381 NONAME
+	_ZN15THuiFontManager11CreateFontLERK21THuiFontSpecification @ 382 NONAME
+	_ZN15THuiTextCommand16CommandExtensionERK4TUidPPv @ 383 NONAME
+	_ZN15THuiTextCommandC1ER14CHuiTextVisualRK7TDesC166THuiOp @ 384 NONAME
+	_ZN15THuiTextCommandC2ER14CHuiTextVisualRK7TDesC166THuiOp @ 385 NONAME
+	_ZN16CHuiAnchorLayout12RemoveAnchorE10THuiAnchori @ 386 NONAME
+	_ZN16CHuiAnchorLayout21SetRelativeAnchorRectEi16THuiAnchorOriginS0_RK13THuiRealPointS0_S0_S3_ @ 387 NONAME
+	_ZN16CHuiAnchorLayout5ResetEv @ 388 NONAME
+	_ZN16CHuiAnchorLayout6AttachEi14THuiAnchorTypeRK10THuiMetric26THuiAnchorAttachmentOrigini @ 389 NONAME
+	_ZN16CHuiAnchorLayout6AttachEi14THuiAnchorTypeRK12THuiXYMetric26THuiAnchorAttachmentOrigini @ 390 NONAME
+	_ZN16CHuiAnchorLayout6AttachEiRK13THuiBoxMetric26THuiAnchorAttachmentOrigini @ 391 NONAME
+	_ZN16CHuiAnchorLayout6DetachEi @ 392 NONAME
+	_ZN16CHuiAnchorLayout6DetachEi14THuiAnchorType @ 393 NONAME
+	_ZN16CHuiAnchorLayout7AddNewLER11CHuiControlP10CHuiLayout @ 394 NONAME
+	_ZN16CHuiAnchorLayout7SetSizeERK12THuiRealSizei @ 395 NONAME
+	_ZN16CHuiAnchorLayout8ChildPosEiR6TPoint @ 396 NONAME
+	_ZN16CHuiAnchorLayout9ChildRectEiR12THuiRealRect @ 397 NONAME
+	_ZN16CHuiAnchorLayout9ChildSizeEiR5TSize @ 398 NONAME
+	_ZN16CHuiAnchorLayout9SetAnchorE10THuiAnchori16THuiAnchorOriginS1_16THuiAnchorMetricS2_RK14THuiTimedPoint @ 399 NONAME
+	_ZN16CHuiAnchorLayoutD0Ev @ 400 NONAME
+	_ZN16CHuiAnchorLayoutD1Ev @ 401 NONAME
+	_ZN16CHuiAnchorLayoutD2Ev @ 402 NONAME
+	_ZN16CHuiControlGroup12SetSessionIdEi @ 403 NONAME
+	_ZN16CHuiControlGroup13AppendAndPopLEP11CHuiControl @ 404 NONAME
+	_ZN16CHuiControlGroup14SetAcceptInputEi @ 405 NONAME
+	_ZN16CHuiControlGroup14TransformationEv @ 406 NONAME
+	_ZN16CHuiControlGroup21EnableTransformationLEi @ 407 NONAME
+	_ZN16CHuiControlGroup6RemoveEP11CHuiControl @ 408 NONAME
+	_ZN16CHuiControlGroup7AppendLEP11CHuiControl @ 409 NONAME
+	_ZN16MHuiEventHandlerD0Ev @ 410 NONAME
+	_ZN16MHuiEventHandlerD1Ev @ 411 NONAME
+	_ZN16MHuiEventHandlerD2Ev @ 412 NONAME
+	_ZN16THuiGroupCommand16CommandExtensionERK4TUidPPv @ 413 NONAME
+	_ZN16THuiGroupCommandC1ER16CHuiControlGroup6THuiOpP11CHuiDisplay @ 414 NONAME
+	_ZN16THuiGroupCommandC2ER16CHuiControlGroup6THuiOpP11CHuiDisplay @ 415 NONAME
+	_ZN16THuiImageCommand16CommandExtensionERK4TUidPPv @ 416 NONAME
+	_ZN16THuiImageCommandC1ER15CHuiImageVisualRK9THuiImage6THuiOp @ 417 NONAME
+	_ZN16THuiImageCommandC2ER15CHuiImageVisualRK9THuiImage6THuiOp @ 418 NONAME
+	_ZN16THuiPointCommand16CommandExtensionERK4TUidPPv @ 419 NONAME
+	_ZN16THuiPointCommandC1EPvR14THuiTimedPoint13THuiRealPointi @ 420 NONAME
+	_ZN16THuiPointCommandC1EPvR14THuiTimedPoint6THuiOp @ 421 NONAME
+	_ZN16THuiPointCommandC1EPvR14THuiTimedPoint6THuiOp13THuiRealPointf @ 422 NONAME
+	_ZN16THuiPointCommandC2EPvR14THuiTimedPoint13THuiRealPointi @ 423 NONAME
+	_ZN16THuiPointCommandC2EPvR14THuiTimedPoint6THuiOp @ 424 NONAME
+	_ZN16THuiPointCommandC2EPvR14THuiTimedPoint6THuiOp13THuiRealPointf @ 425 NONAME
+	_ZN16THuiS60TextStyleC1Eii @ 426 NONAME
+	_ZN16THuiS60TextStyleC2Eii @ 427 NONAME
+	_ZN16THuiValueCommand16CommandExtensionERK4TUidPPv @ 428 NONAME
+	_ZN16THuiValueCommandC1EPvR14THuiTimedValue6THuiOpff @ 429 NONAME
+	_ZN16THuiValueCommandC1EPvR14THuiTimedValuefi @ 430 NONAME
+	_ZN16THuiValueCommandC2EPvR14THuiTimedValue6THuiOpff @ 431 NONAME
+	_ZN16THuiValueCommandC2EPvR14THuiTimedValuefi @ 432 NONAME
+	_ZN17CHuiGradientBrush12AppendColorLEfRK4TRgbf @ 433 NONAME
+	_ZN17CHuiGradientBrush12SetDirectionENS_10TDirectionE @ 434 NONAME
+	_ZN17CHuiGradientBrush4NewLEv @ 435 NONAME
+	_ZN17CHuiGradientBrush5NewLCEv @ 436 NONAME
+	_ZN17CHuiGradientBrush8SetColorERK4TRgbf @ 437 NONAME
+	_ZN17CHuiGradientBrush8SetImageERK9THuiImage @ 438 NONAME
+	_ZN17THuiActionCommand16CommandExtensionERK4TUidPPv @ 439 NONAME
+	_ZN17THuiActionCommandC1Ei @ 440 NONAME
+	_ZN17THuiActionCommandC2Ei @ 441 NONAME
+	_ZN17THuiMarkerCommand16CommandExtensionERK4TUidPPv @ 442 NONAME
+	_ZN17THuiMarkerCommandC1Ei @ 443 NONAME
+	_ZN17THuiMarkerCommandC2Ei @ 444 NONAME
+	_ZN17THuiObjectCommand16CommandExtensionERK4TUidPPv @ 445 NONAME
+	_ZN17THuiTextureHandle14SetTextureSizeERK5TSize @ 446 NONAME
+	_ZN17THuiTextureHandle15ShadowedTextureEv @ 447 NONAME
+	_ZN17THuiTextureHandle16SegmentedTextureEv @ 448 NONAME
+	_ZN17THuiTextureHandle16TextureExtensionERK4TUidPPv @ 449 NONAME
+	_ZN17THuiTextureHandle3SetEjRK5TSizeS2_ @ 450 NONAME
+	_ZN17THuiTextureHandle7ReleaseEv @ 451 NONAME
+	_ZN17THuiTextureHandle7SetNameEj @ 452 NONAME
+	_ZN17THuiTextureHandle7SetSizeERK5TSize @ 453 NONAME
+	_ZN17THuiTextureHandleC1EjRK5TSizeS2_ @ 454 NONAME
+	_ZN17THuiTextureHandleC1Ev @ 455 NONAME
+	_ZN17THuiTextureHandleC2EjRK5TSizeS2_ @ 456 NONAME
+	_ZN17THuiTextureHandleC2Ev @ 457 NONAME
+	_ZN17THuiVisualCommand16CommandExtensionERK4TUidPPv @ 458 NONAME
+	_ZN17THuiVisualCommandC1ER10CHuiVisual6THuiOpii @ 459 NONAME
+	_ZN17THuiVisualCommandC2ER10CHuiVisual6THuiOpii @ 460 NONAME
+	_ZN18CHuiProceduralMesh10MakeTorusLEffiif @ 461 NONAME
+	_ZN18CHuiProceduralMesh11MakeSphereLEfii @ 462 NONAME
+	_ZN18CHuiProceduralMesh14ScaleUniformlyEfff @ 463 NONAME
+	_ZN18CHuiProceduralMesh16StretchUniformlyEffffff @ 464 NONAME
+	_ZN18CHuiProceduralMesh5ResetEv @ 465 NONAME
+	_ZN18CHuiProceduralMesh9MakeCubeLEffff @ 466 NONAME
+	_ZN18CHuiProceduralMeshD0Ev @ 467 NONAME
+	_ZN18CHuiProceduralMeshD1Ev @ 468 NONAME
+	_ZN18CHuiProceduralMeshD2Ev @ 469 NONAME
+	_ZN18CHuiSoftKeyControl14SetBackgroundLE9THuiImageii @ 470 NONAME
+	_ZN18CHuiSoftKeyControl17SetAnimationTimesEjj @ 471 NONAME
+	_ZN18CHuiSoftKeyControl17SetBackgroundTypeE18THuiBackgroundType @ 472 NONAME
+	_ZN18CHuiSoftKeyControl4NewLER7CHuiEnv @ 473 NONAME
+	_ZN18CHuiSoftKeyControl5NewLCER7CHuiEnv @ 474 NONAME
+	_ZN18CHuiSoftKeyControl8ExitViewEj @ 475 NONAME
+	_ZN18CHuiSoftKeyControl9EnterViewEj @ 476 NONAME
+	_ZN18CHuiSoftKeyControl9SetLabelLE19THuiSoftKeyPositionRK7TDesC16i @ 477 NONAME
+	_ZN18CHuiTextureManager12BlankTextureEv @ 478 NONAME
+	_ZN18CHuiTextureManager12LoadTextureLERK7TDesC1622THuiTextureUploadFlagsii @ 479 NONAME
+	_ZN18CHuiTextureManager12LoadTextureLERK7TDesC16RK5TSize22THuiTextureUploadFlagsii @ 480 NONAME
+	_ZN18CHuiTextureManager12LoadTextureLEiRK5TSize22THuiTextureUploadFlags @ 481 NONAME
+	_ZN18CHuiTextureManager12SetTextureIdEP11CHuiTexturei @ 482 NONAME
+	_ZN18CHuiTextureManager13SetImagePathLERK7TDesC16 @ 483 NONAME
+	_ZN18CHuiTextureManager13UnloadTextureERK7TDesC16i @ 484 NONAME
+	_ZN18CHuiTextureManager13UnloadTextureEi @ 485 NONAME
+	_ZN18CHuiTextureManager14CreateTextureLEiP18MHuiBitmapProvider22THuiTextureUploadFlags @ 486 NONAME
+	_ZN18CHuiTextureManager15DefineFileNameLEiRK7TDesC16 @ 487 NONAME
+	_ZN18CHuiTextureManager3EnvEv @ 488 NONAME
+	_ZN18CHuiTextureManager7TextureEi @ 489 NONAME
+	_ZN18CHuiTextureManager8TextureLEi @ 490 NONAME
+	_ZN18CHuiTextureManager9ProcessorEv @ 491 NONAME
+	_ZN18CHuiTransformation12LoadIdentityEv @ 492 NONAME
+	_ZN18CHuiTransformation4NewLEv @ 493 NONAME
+	_ZN18CHuiTransformation4StepEi @ 494 NONAME
+	_ZN18CHuiTransformation5NewLCEv @ 495 NONAME
+	_ZN18CHuiTransformation5ScaleERK14THuiTimedValueS2_ @ 496 NONAME
+	_ZN18CHuiTransformation5ScaleERK14THuiTimedValueS2_S2_ @ 497 NONAME
+	_ZN18CHuiTransformation5ScaleEff @ 498 NONAME
+	_ZN18CHuiTransformation5ScaleEfff @ 499 NONAME
+	_ZN18CHuiTransformation6RotateERK14THuiTimedValue @ 500 NONAME
+	_ZN18CHuiTransformation6RotateERK14THuiTimedValuefff @ 501 NONAME
+	_ZN18CHuiTransformation6RotateEf @ 502 NONAME
+	_ZN18CHuiTransformation6RotateEffff @ 503 NONAME
+	_ZN18CHuiTransformation9TranslateERK14THuiTimedValueS2_ @ 504 NONAME
+	_ZN18CHuiTransformation9TranslateEff @ 505 NONAME
+	_ZN18CHuiTransformationD0Ev @ 506 NONAME
+	_ZN18CHuiTransformationD1Ev @ 507 NONAME
+	_ZN18CHuiTransformationD2Ev @ 508 NONAME
+	_ZN18CHuiTransformationixEi @ 509 NONAME
+	_ZN18CHuiViewportLayout14SetViewportPosERK13THuiRealPointi @ 510 NONAME
+	_ZN18CHuiViewportLayout14SetVirtualSizeERK12THuiRealSizei @ 511 NONAME
+	_ZN18CHuiViewportLayout15SetViewportSizeERK12THuiRealSizei @ 512 NONAME
+	_ZN18CHuiViewportLayout7AddNewLER11CHuiControlP10CHuiLayout @ 513 NONAME
+	_ZN18CHuiViewportLayout9ChildRectEiR12THuiRealRect @ 514 NONAME
+	_ZN18MHuiBitmapProviderD0Ev @ 515 NONAME
+	_ZN18MHuiBitmapProviderD1Ev @ 516 NONAME
+	_ZN18MHuiBitmapProviderD2Ev @ 517 NONAME
+	_ZN18THuiControlCommand16CommandExtensionERK4TUidPPv @ 518 NONAME
+	_ZN18THuiControlCommandC1ER11CHuiControl6THuiOp @ 519 NONAME
+	_ZN18THuiControlCommandC2ER11CHuiControl6THuiOp @ 520 NONAME
+	_ZN19CHuiAnimatedTexture14BaseConstructLEv @ 521 NONAME
+	_ZN19CHuiAnimatedTexture15ShadowedTextureEv @ 522 NONAME
+	_ZN19CHuiAnimatedTexture16SegmentedTextureEv @ 523 NONAME
+	_ZN19CHuiAnimatedTexture16TextureExtensionERK4TUidPPv @ 524 NONAME
+	_ZN19CHuiAnimatedTexture7TextureEv @ 525 NONAME
+	_ZN19CHuiAnimatedTextureC2ER18CHuiTextureManager @ 526 NONAME
+	_ZN19CHuiAnimatedTextureD0Ev @ 527 NONAME
+	_ZN19CHuiAnimatedTextureD1Ev @ 528 NONAME
+	_ZN19CHuiAnimatedTextureD2Ev @ 529 NONAME
+	_ZN19CHuiCurvePathLayout7AddNewLER11CHuiControlP10CHuiLayout @ 530 NONAME
+	_ZN19CHuiCurvePathLayout9ChildRectEiR12THuiRealRect @ 531 NONAME
+	_ZN19CHuiCurvePathLayout9CurvePathEv @ 532 NONAME
+	_ZN19CHuiDropShadowBrush4NewLEi @ 533 NONAME
+	_ZN19CHuiDropShadowBrush5NewLCEi @ 534 NONAME
+	_ZN19CHuiImageLoaderUtil15SetSkinInstanceEP17MAknsSkinInstance @ 535 NONAME
+	_ZN19CHuiImageLoaderUtil18CreateImageLoaderLE4TUid16TAknsAppIconType @ 536 NONAME
+	_ZN19CHuiImageLoaderUtil18CreateImageLoaderLERK11TAknsItemIDRK7TDesC16ii @ 537 NONAME
+	_ZN19CHuiImageLoaderUtil20ImageLoaderExtensionERK4TUidPPv @ 538 NONAME
+	_ZN19CHuiImageLoaderUtil7SetSizeE5TSize10TScaleMode @ 539 NONAME
+	_ZN19CHuiImageLoaderUtilC1Ev @ 540 NONAME
+	_ZN19CHuiImageLoaderUtilC2Ev @ 541 NONAME
+	_ZN19CHuiImageLoaderUtilD0Ev @ 542 NONAME
+	_ZN19CHuiImageLoaderUtilD1Ev @ 543 NONAME
+	_ZN19CHuiImageLoaderUtilD2Ev @ 544 NONAME
+	_ZN19MHuiMappingFunction27MappingFunctionClearChangedEv @ 545 NONAME
+	_ZN20CHuiTextStyleManager14CopyTextStyleLEi @ 546 NONAME
+	_ZN20CHuiTextStyleManager24CreatePlatformTextStyleLEii @ 547 NONAME
+	_ZN20CHuiTextStyleManager9TextStyleEi @ 548 NONAME
+	_ZN20MHuiSegmentedTextureD0Ev @ 549 NONAME
+	_ZN20MHuiSegmentedTextureD1Ev @ 550 NONAME
+	_ZN20MHuiSegmentedTextureD2Ev @ 551 NONAME
+	_ZN21CHuiDisplayCoeControl10ConstructLERK5TRecti @ 552 NONAME
+	_ZN21CHuiDisplayCoeControl11MakeVisibleEi @ 553 NONAME
+	_ZN21CHuiDisplayCoeControl11SizeChangedEv @ 554 NONAME
+	_ZN21CHuiDisplayCoeControl12FocusChangedE8TDrawNow @ 555 NONAME
+	_ZN21CHuiDisplayCoeControl14OfferKeyEventLERK9TKeyEvent10TEventCode @ 556 NONAME
+	_ZN21CHuiDisplayCoeControl15PositionChangedEv @ 557 NONAME
+	_ZN21CHuiDisplayCoeControl19HandleControlEventLEP11CCoeControlN19MCoeControlObserver9TCoeEventE @ 558 NONAME
+	_ZN21CHuiDisplayCoeControl19HandlePointerEventLERK13TPointerEvent @ 559 NONAME
+	_ZN21CHuiDisplayCoeControl19SetContainerWindowLERK11CCoeControl @ 560 NONAME
+	_ZN21CHuiDisplayCoeControl20HandleResourceChangeEi @ 561 NONAME
+	_ZN21CHuiDisplayCoeControl20PrepareForFocusGainLEv @ 562 NONAME
+	_ZN21CHuiDisplayCoeControl20PrepareForFocusLossLEv @ 563 NONAME
+	_ZN21CHuiDisplayCoeControl22ConstructFromResourceLER15TResourceReader @ 564 NONAME
+	_ZN21CHuiDisplayCoeControl24DisplayCoeCntrlExtensionERK4TUidPPv @ 565 NONAME
+	_ZN21CHuiDisplayCoeControl3EnvEv @ 566 NONAME
+	_ZN21CHuiDisplayCoeControl4NewLER7CHuiEnvRK5TRecti @ 567 NONAME
+	_ZN21CHuiDisplayCoeControl5NewLCER7CHuiEnvRK5TRecti @ 568 NONAME
+	_ZN21CHuiDisplayCoeControl7DisplayEv @ 569 NONAME
+	_ZN21CHuiDisplayCoeControl9ActivateLEv @ 570 NONAME
+	_ZN21CHuiDisplayCoeControl9SetDimmedEi @ 571 NONAME
+	_ZN21CHuiDisplayCoeControlC1ER7CHuiEnv @ 572 NONAME
+	_ZN21CHuiDisplayCoeControlC2ER7CHuiEnv @ 573 NONAME
+	_ZN21CHuiDisplayCoeControlD0Ev @ 574 NONAME
+	_ZN21CHuiDisplayCoeControlD1Ev @ 575 NONAME
+	_ZN21CHuiDisplayCoeControlD2Ev @ 576 NONAME
+	_ZN21CHuiShadowBorderBrush4NewLEi @ 577 NONAME
+	_ZN21CHuiShadowBorderBrush5NewLCEi @ 578 NONAME
+	_ZN22THuiCustomEventCommand16CommandExtensionERK4TUidPPv @ 579 NONAME
+	_ZN22THuiCustomEventCommandC1EiP16MHuiEventHandler @ 580 NONAME
+	_ZN22THuiCustomEventCommandC2EiP16MHuiEventHandler @ 581 NONAME
+	_ZN23CHuiGifAnimationTexture2IdEv @ 582 NONAME
+	_ZN23CHuiGifAnimationTexture4NewLERK7TDesC16R18CHuiTextureManageri22THuiTextureUploadFlags @ 583 NONAME
+	_ZN23CHuiGifAnimationTexture4StopEv @ 584 NONAME
+	_ZN23CHuiGifAnimationTexture5StartEv @ 585 NONAME
+	_ZN23CHuiGifAnimationTextureD0Ev @ 586 NONAME
+	_ZN23CHuiGifAnimationTextureD1Ev @ 587 NONAME
+	_ZN23CHuiGifAnimationTextureD2Ev @ 588 NONAME
+	_ZN23THuiInteractionInterval8IntervalEi @ 589 NONAME
+	_ZN23THuiInteractionInterval9SetScalarEf @ 590 NONAME
+	_ZN23THuiInteractionIntervalC1Ef @ 591 NONAME
+	_ZN23THuiInteractionIntervalC2Ef @ 592 NONAME
+	_ZN23THuiSineMappingFunctionC1Eff @ 593 NONAME
+	_ZN23THuiSineMappingFunctionC2Eff @ 594 NONAME
+	_ZN25THuiCosineMappingFunctionC1Eff @ 595 NONAME
+	_ZN25THuiCosineMappingFunctionC2Eff @ 596 NONAME
+	_ZN25THuiLinearMappingFunctionC1Eff @ 597 NONAME
+	_ZN25THuiLinearMappingFunctionC2Eff @ 598 NONAME
+	_ZN25THuiTransformationCommand16CommandExtensionERK4TUidPPv @ 599 NONAME
+	_ZN25THuiTransformationCommand4SetXERK14THuiTimedValue @ 600 NONAME
+	_ZN25THuiTransformationCommand4SetYERK14THuiTimedValue @ 601 NONAME
+	_ZN25THuiTransformationCommand4SetZERK14THuiTimedValue @ 602 NONAME
+	_ZN25THuiTransformationCommand8SetAngleERK14THuiTimedValue @ 603 NONAME
+	_ZN25THuiTransformationCommandC1EPvR18CHuiTransformation6THuiOpi @ 604 NONAME
+	_ZN25THuiTransformationCommandC2EPvR18CHuiTransformation6THuiOpi @ 605 NONAME
+	_ZN26THuiAverageMappingFunction27MappingFunctionClearChangedEv @ 606 NONAME
+	_ZN26THuiAverageMappingFunctionC1EP19MHuiMappingFunctionS1_ @ 607 NONAME
+	_ZN26THuiAverageMappingFunctionC2EP19MHuiMappingFunctionS1_ @ 608 NONAME
+	_ZN27THuiConstantMappingFunctionC1Ef @ 609 NONAME
+	_ZN27THuiConstantMappingFunctionC2Ef @ 610 NONAME
+	_ZN7CHuiEnv11NewDisplayLERK5TRectP11CCoeControliP11CHuiDisplayi @ 611 NONAME
+	_ZN7CHuiEnv12ControlGroupEi @ 612 NONAME
+	_ZN7CHuiEnv12LoadBitmapsLEi @ 613 NONAME
+	_ZN7CHuiEnv12PauseRefreshEv @ 614 NONAME
+	_ZN7CHuiEnv12StartRefreshEi @ 615 NONAME
+	_ZN7CHuiEnv13SetMaxCpuTimeEj @ 616 NONAME
+	_ZN7CHuiEnv14CancelCommandsEP16MHuiEventHandler @ 617 NONAME
+	_ZN7CHuiEnv14CancelCommandsEPv @ 618 NONAME
+	_ZN7CHuiEnv14CancelCommandsEPv15THuiCommandTypei @ 619 NONAME
+	_ZN7CHuiEnv14CancelCommandsEPv6THuiOp @ 620 NONAME
+	_ZN7CHuiEnv14SetRefreshModeE15THuiRefreshMode @ 621 NONAME
+	_ZN7CHuiEnv15BroadcastEventLERK9THuiEvent @ 622 NONAME
+	_ZN7CHuiEnv15ContinueRefreshEv @ 623 NONAME
+	_ZN7CHuiEnv15HandleKeyEventLERK9TKeyEvent10TEventCodeP11CHuiDisplay @ 624 NONAME
+	_ZN7CHuiEnv15RefreshCallBackEPv @ 625 NONAME
+	_ZN7CHuiEnv15SetMaxFrameRateEf @ 626 NONAME
+	_ZN7CHuiEnv16NewControlGroupLEi @ 627 NONAME
+	_ZN7CHuiEnv16SetIdleThresholdEi @ 628 NONAME
+	_ZN7CHuiEnv16TimeUntilCommandEPv15THuiCommandType @ 629 NONAME
+	_ZN7CHuiEnv17LoadControlGroupLEi @ 630 NONAME
+	_ZN7CHuiEnv18DeleteControlGroupEi @ 631 NONAME
+	_ZN7CHuiEnv18NotifySkinChangedLEv @ 632 NONAME
+	_ZN7CHuiEnv4NewLE12THuiRendererP15MHuiEnvObserver @ 633 NONAME
+	_ZN7CHuiEnv4SendERK11THuiCommandi @ 634 NONAME
+	_ZN7CHuiEnv5NewLCE12THuiRendererP15MHuiEnvObserver @ 635 NONAME
+	_ZN7CHuiEnv5SendLERK11THuiCommandi @ 636 NONAME
+	_ZN7CHuiEnv6StaticEv @ 637 NONAME
+	_ZN7CHuiEnv7ReleaseEv @ 638 NONAME
+	_ZN7CHuiEnv8RestoreLEv @ 639 NONAME
+	_ZN7HuiUtil10FreeMemoryEPj @ 640 NONAME
+	_ZN7HuiUtil10LengthUnitEv @ 641 NONAME
+	_ZN7HuiUtil10RandomRealEff @ 642 NONAME
+	_ZN7HuiUtil10ScaleImageEiRK5TSizePKhS2_Ph @ 643 NONAME
+	_ZN7HuiUtil10ScreenSizeEv @ 644 NONAME
+	_ZN7HuiUtil10TagMatchesERK6TDesC8S2_ @ 645 NONAME
+	_ZN7HuiUtil11InterpolateEfff @ 646 NONAME
+	_ZN7HuiUtil11QuickLengthER13THuiRealPoint @ 647 NONAME
+	_ZN7HuiUtil11QuickLengthEff @ 648 NONAME
+	_ZN7HuiUtil12CrossProductEPKfS1_Pf @ 649 NONAME
+	_ZN7HuiUtil12ShadowMatrixEPKfS1_S1_Pf @ 650 NONAME
+	_ZN7HuiUtil14ColorLightnessERK4TRgb @ 651 NONAME
+	_ZN7HuiUtil14CropFbsBitmapLERK10CFbsBitmapRS0_6TPoint @ 652 NONAME
+	_ZN7HuiUtil14QuickNormalizeEPf @ 653 NONAME
+	_ZN7HuiUtil14QuickNormalizeER13THuiRealPoint @ 654 NONAME
+	_ZN7HuiUtil15Power2RoundDownEi @ 655 NONAME
+	_ZN7HuiUtil15ScaleFbsBitmapLERK10CFbsBitmapRS0_ @ 656 NONAME
+	_ZN7HuiUtil16NormalFromPointsEPA3_KfPf @ 657 NONAME
+	_ZN7HuiUtil21CombineMaskFbsBitmapLERK10CFbsBitmapS2_RS0_ @ 658 NONAME
+	_ZN7HuiUtil28ConvertBitmapToDisplayModeLCERK10CFbsBitmapRK12TDisplayMode @ 659 NONAME
+	_ZN7HuiUtil6Power2Ei @ 660 NONAME
+	_ZN7HuiUtil9CropImageEiRK5TSizePKhRK6TPointS2_Ph @ 661 NONAME
+	_ZN7HuiUtil9RandomIntEii @ 662 NONAME
+	_ZN7HuiUtil9WrapValueERfff @ 663 NONAME
+	_ZN8CHuiMesh12SetSessionIdEi @ 664 NONAME
+	_ZN8CHuiMesh14ScaleUniformlyEfff @ 665 NONAME
+	_ZN8CHuiMesh16StretchUniformlyEffffff @ 666 NONAME
+	_ZN8CHuiMesh20SetAnimationPositionEifi @ 667 NONAME
+	_ZN8CHuiMesh4NewLE12THuiMeshType @ 668 NONAME
+	_ZN8CHuiMesh5NewLCE12THuiMeshType @ 669 NONAME
+	_ZN8CHuiMesh5ResetEv @ 670 NONAME
+	_ZN8CHuiMeshD0Ev @ 671 NONAME
+	_ZN8CHuiMeshD1Ev @ 672 NONAME
+	_ZN8CHuiMeshD2Ev @ 673 NONAME
+	_ZN8CHuiSkin10GetTextureEiRPK11CHuiTexture @ 674 NONAME
+	_ZN8CHuiSkin10SetContextER6CHuiGc @ 675 NONAME
+	_ZN8CHuiSkin14ReleaseTextureEi @ 676 NONAME
+	_ZN8CHuiSkin22RestoreTextureContentLER11CHuiTexture @ 677 NONAME
+	_ZN8CHuiSkin22TextureContentReleasedER11CHuiTexture @ 678 NONAME
+	_ZN8CHuiSkin22TextureContentUploadedER11CHuiTexture @ 679 NONAME
+	_ZN8CHuiSkin25NotifyDisplaySizeChangedLEv @ 680 NONAME
+	_ZN8CHuiSkin8LocationE15THuiSkinElement @ 681 NONAME
+	_ZN8CHuiSkin8TextureLEi @ 682 NONAME
+	_ZN8THuiFontC1EiRK9TFontSpec @ 683 NONAME
+	_ZN8THuiFontC1Ev @ 684 NONAME
+	_ZN8THuiFontC2EiRK9TFontSpec @ 685 NONAME
+	_ZN8THuiFontC2Ev @ 686 NONAME
+	_ZN8THuiFontD1Ev @ 687 NONAME
+	_ZN8THuiFontD2Ev @ 688 NONAME
+	_ZN9CHuiBrush10SetChangedEv @ 689 NONAME
+	_ZN9CHuiBrush12ClearChangedEv @ 690 NONAME
+	_ZN9CHuiBrush12SetSessionIdEi @ 691 NONAME
+	_ZN9CHuiBrush14BrushExtensionERK4TUidPPv @ 692 NONAME
+	_ZN9CHuiBrush15SetClipToVisualEi @ 693 NONAME
+	_ZN9CHuiBrush8SetLayerE14THuiBrushLayer @ 694 NONAME
+	_ZN9CHuiBrushC1Ev @ 695 NONAME
+	_ZN9CHuiBrushC2Ev @ 696 NONAME
+	_ZN9CHuiBrushD0Ev @ 697 NONAME
+	_ZN9CHuiBrushD1Ev @ 698 NONAME
+	_ZN9CHuiBrushD2Ev @ 699 NONAME
+	_ZN9THuiEvent9SetVisualEP10CHuiVisual @ 700 NONAME
+	_ZN9THuiEventC1EP11CHuiDisplayRK13TPointerEvent @ 701 NONAME
+	_ZN9THuiEventC1Ei @ 702 NONAME
+	_ZN9THuiEventC2EP11CHuiDisplayRK13TPointerEvent @ 703 NONAME
+	_ZN9THuiEventC2Ei @ 704 NONAME
+	_ZN9THuiImage10SetTextureERK11MHuiTexture @ 705 NONAME
+	_ZN9THuiImage12SetTexCoordsEffffi @ 706 NONAME
+	_ZN9THuiImage5ScaleEffi @ 707 NONAME
+	_ZN9THuiImage9TranslateEffi @ 708 NONAME
+	_ZN9THuiImageC1ERK11MHuiTextureffff @ 709 NONAME
+	_ZN9THuiImageC1Ev @ 710 NONAME
+	_ZN9THuiImageC2ERK11MHuiTextureffff @ 711 NONAME
+	_ZN9THuiImageC2Ev @ 712 NONAME
+	_ZN9THuiPanic5PanicENS_7TReasonE @ 713 NONAME
+	_ZNK10CHuiLayout10FindVisualEPK10CHuiVisual @ 714 NONAME
+	_ZNK10CHuiLayout11VirtualSizeEv @ 715 NONAME
+	_ZNK10CHuiLayout12BrushOpacityEv @ 716 NONAME
+	_ZNK10CHuiLayout12GetClassNameER6TDes16 @ 717 NONAME
+	_ZNK10CHuiLayout12InnerPaddingEv @ 718 NONAME
+	_ZNK10CHuiLayout12InnerTopLeftEv @ 719 NONAME
+	_ZNK10CHuiLayout12ScrollOffsetEv @ 720 NONAME
+	_ZNK10CHuiLayout14TransitionTimeEv @ 721 NONAME
+	_ZNK10CHuiLayout15GetInstanceNameER6TDes16 @ 722 NONAME
+	_ZNK10CHuiLayout20VerticalInnerPaddingEv @ 723 NONAME
+	_ZNK10CHuiLayout21ExpandRectWithContentER5TRect @ 724 NONAME
+	_ZNK10CHuiLayout22EffectiveLayoutOrdinalERK10CHuiVisual @ 725 NONAME
+	_ZNK10CHuiLayout22HorizontalInnerPaddingEv @ 726 NONAME
+	_ZNK10CHuiLayout23InnerPaddingInBaseUnitsEv @ 727 NONAME
+	_ZNK10CHuiLayout32MetricReferenceForLayoutInPixelsEPKS_RK12THuiXYMetric @ 728 NONAME
+	_ZNK10CHuiLayout4DrawER6CHuiGc @ 729 NONAME
+	_ZNK10CHuiLayout4TypeEv @ 730 NONAME
+	_ZNK10CHuiLayout5CountEv @ 731 NONAME
+	_ZNK10CHuiLayout6VisualEi @ 732 NONAME
+	_ZNK10CHuiLayout7ChangedEv @ 733 NONAME
+	_ZNK10CHuiLayout8BaseUnitEv @ 734 NONAME
+	_ZNK10CHuiLayout8DrawSelfER6CHuiGcRK5TRect @ 735 NONAME
+	_ZNK10CHuiLayout8DumpTreeEv @ 736 NONAME
+	_ZNK10CHuiLayout9BrushRectEv @ 737 NONAME
+	_ZNK10CHuiLayout9BrushSkinEv @ 738 NONAME
+	_ZNK10CHuiLayout9InnerSizeEv @ 739 NONAME
+	_ZNK10CHuiLayout9ScrollingEv @ 740 NONAME
+	_ZNK10CHuiLayout9SessionIdEv @ 741 NONAME
+	_ZNK10CHuiVisual11DisplayRectEv @ 742 NONAME
+	_ZNK10CHuiVisual11DrawBrushesER6CHuiGc14THuiBrushLayer @ 743 NONAME
+	_ZNK10CHuiVisual12BrushOpacityEv @ 744 NONAME
+	_ZNK10CHuiVisual12GetClassNameER6TDes16 @ 745 NONAME
+	_ZNK10CHuiVisual13AlignByOriginER13THuiRealPointi @ 746 NONAME
+	_ZNK10CHuiVisual13LocalBaseUnitEv @ 747 NONAME
+	_ZNK10CHuiVisual14DisplayToLocalERK13THuiRealPoint @ 748 NONAME
+	_ZNK10CHuiVisual14DisplayToLocalERK6TPoint @ 749 NONAME
+	_ZNK10CHuiVisual14LocalToDisplayERK13THuiRealPoint @ 750 NONAME
+	_ZNK10CHuiVisual14LocalToDisplayERK6TPoint @ 751 NONAME
+	_ZNK10CHuiVisual14MetricToPixelsERK12THuiXYMetric @ 752 NONAME
+	_ZNK10CHuiVisual14PixelsToMetricERK13THuiRealPointR12THuiXYMetric @ 753 NONAME
+	_ZNK10CHuiVisual14VerticalOriginEv @ 754 NONAME
+	_ZNK10CHuiVisual15GetInstanceNameER6TDes16 @ 755 NONAME
+	_ZNK10CHuiVisual15PaddingInPixelsEv @ 756 NONAME
+	_ZNK10CHuiVisual16EffectiveOpacityEv @ 757 NONAME
+	_ZNK10CHuiVisual16HorizontalOriginEv @ 758 NONAME
+	_ZNK10CHuiVisual17DisplayRectTargetEv @ 759 NONAME
+	_ZNK10CHuiVisual17PixelPointInLocalERK13THuiRealPoint @ 760 NONAME
+	_ZNK10CHuiVisual18LocalPointInPixelsERK13THuiRealPoint @ 761 NONAME
+	_ZNK10CHuiVisual20BoxMetricToPixelRectERK13THuiBoxMetricR12THuiRealRect @ 762 NONAME
+	_ZNK10CHuiVisual20EnterLocalProjectionER6CHuiGcifPK12THuiRealRect @ 763 NONAME
+	_ZNK10CHuiVisual21ExpandRectWithContentER5TRect @ 764 NONAME
+	_ZNK10CHuiVisual23MetricReferenceInPixelsERK12THuiXYMetric @ 765 NONAME
+	_ZNK10CHuiVisual3EnvEv @ 766 NONAME
+	_ZNK10CHuiVisual3PosEv @ 767 NONAME
+	_ZNK10CHuiVisual3TagEv @ 768 NONAME
+	_ZNK10CHuiVisual4DrawER6CHuiGc @ 769 NONAME
+	_ZNK10CHuiVisual4SizeEv @ 770 NONAME
+	_ZNK10CHuiVisual4SkinEv @ 771 NONAME
+	_ZNK10CHuiVisual4TypeEv @ 772 NONAME
+	_ZNK10CHuiVisual5CountEv @ 773 NONAME
+	_ZNK10CHuiVisual5OwnerEv @ 774 NONAME
+	_ZNK10CHuiVisual6LayoutEv @ 775 NONAME
+	_ZNK10CHuiVisual6VisualEi @ 776 NONAME
+	_ZNK10CHuiVisual7ChangedEv @ 777 NONAME
+	_ZNK10CHuiVisual7DisplayEv @ 778 NONAME
+	_ZNK10CHuiVisual7MaxSizeEv @ 779 NONAME
+	_ZNK10CHuiVisual7MinSizeEv @ 780 NONAME
+	_ZNK10CHuiVisual7PaddingEv @ 781 NONAME
+	_ZNK10CHuiVisual8ClippingEv @ 782 NONAME
+	_ZNK10CHuiVisual8DrawSelfER6CHuiGcRK5TRect @ 783 NONAME
+	_ZNK10CHuiVisual8DumpTreeEv @ 784 NONAME
+	_ZNK10CHuiVisual8IsTaggedEv @ 785 NONAME
+	_ZNK10CHuiVisual9BrushRectEv @ 786 NONAME
+	_ZNK10CHuiVisual9BrushSkinEv @ 787 NONAME
+	_ZNK10CHuiVisual9SessionIdEv @ 788 NONAME
+	_ZNK10CHuiVisual9TransformER6CHuiGciPK12THuiRealRect @ 789 NONAME
+	_ZNK11CHuiControl10ConnectionEi @ 790 NONAME
+	_ZNK11CHuiControl10IsFocusingEv @ 791 NONAME
+	_ZNK11CHuiControl11AcceptInputEv @ 792 NONAME
+	_ZNK11CHuiControl11DisplayAreaEv @ 793 NONAME
+	_ZNK11CHuiControl11VisualCountEv @ 794 NONAME
+	_ZNK11CHuiControl12ControlGroupEv @ 795 NONAME
+	_ZNK11CHuiControl13DisplayCenterEv @ 796 NONAME
+	_ZNK11CHuiControl13DisplayToHostERK6TPoint @ 797 NONAME
+	_ZNK11CHuiControl13HostToDisplayERK6TPoint @ 798 NONAME
+	_ZNK11CHuiControl14ConnectionRoleEi @ 799 NONAME
+	_ZNK11CHuiControl14FindConnectionEPKS_ @ 800 NONAME
+	_ZNK11CHuiControl14TextureManagerEv @ 801 NONAME
+	_ZNK11CHuiControl15ConnectionCountEv @ 802 NONAME
+	_ZNK11CHuiControl15ContainerLayoutEPKS_ @ 803 NONAME
+	_ZNK11CHuiControl17ConnectionOrdinalEi @ 804 NONAME
+	_ZNK11CHuiControl19ConnectionByOrdinalEi @ 805 NONAME
+	_ZNK11CHuiControl2IdEv @ 806 NONAME
+	_ZNK11CHuiControl3EnvEv @ 807 NONAME
+	_ZNK11CHuiControl4HostEv @ 808 NONAME
+	_ZNK11CHuiControl4RoleEv @ 809 NONAME
+	_ZNK11CHuiControl4TypeEv @ 810 NONAME
+	_ZNK11CHuiControl5FocusEv @ 811 NONAME
+	_ZNK11CHuiControl6BoundsEv @ 812 NONAME
+	_ZNK11CHuiControl6HostIdEv @ 813 NONAME
+	_ZNK11CHuiControl6VisualEi @ 814 NONAME
+	_ZNK11CHuiControl7DisplayEv @ 815 NONAME
+	_ZNK11CHuiControl7FindTagERK6TDesC8 @ 816 NONAME
+	_ZNK11CHuiControl7HitTestERK6TPoint @ 817 NONAME
+	_ZNK11CHuiControl9SessionIdEv @ 818 NONAME
+	_ZNK11CHuiDisplay11OrientationEv @ 819 NONAME
+	_ZNK11CHuiDisplay11VisibleAreaEv @ 820 NONAME
+	_ZNK11CHuiDisplay14TransformationEv @ 821 NONAME
+	_ZNK11CHuiDisplay4SizeEv @ 822 NONAME
+	_ZNK11CHuiDisplay6ActiveEv @ 823 NONAME
+	_ZNK11CHuiDisplay6RosterEv @ 824 NONAME
+	_ZNK11CHuiDisplay7QualityEv @ 825 NONAME
+	_ZNK11CHuiDisplay9CaptureLCER5TSize @ 826 NONAME
+	_ZNK11CHuiS60Skin11OrientationEv @ 827 NONAME
+	_ZNK11CHuiS60Skin14StyleTextColorE26THuiPreconfiguredTextStyle18THuiBackgroundType @ 828 NONAME
+	_ZNK11CHuiS60Skin7ContextEv @ 829 NONAME
+	_ZNK11CHuiTexture10HasContentEv @ 830 NONAME
+	_ZNK11CHuiTexture11SegmentNameEi @ 831 NONAME
+	_ZNK11CHuiTexture11SegmentSizeEi @ 832 NONAME
+	_ZNK11CHuiTexture11ShadowStyleEv @ 833 NONAME
+	_ZNK11CHuiTexture12SegmentCountEv @ 834 NONAME
+	_ZNK11CHuiTexture13ImageFileNameEv @ 835 NONAME
+	_ZNK11CHuiTexture13IsSkinContentEv @ 836 NONAME
+	_ZNK11CHuiTexture14TextureChangedEv @ 837 NONAME
+	_ZNK11CHuiTexture15IsShadowEnabledEv @ 838 NONAME
+	_ZNK11CHuiTexture15ShadowedTextureEv @ 839 NONAME
+	_ZNK11CHuiTexture16SegmentedTextureEv @ 840 NONAME
+	_ZNK11CHuiTexture18SegmentTextureSizeEi @ 841 NONAME
+	_ZNK11CHuiTexture19TextureClearChangedEv @ 842 NONAME
+	_ZNK11CHuiTexture4SizeEv @ 843 NONAME
+	_ZNK11CHuiTexture4TypeEv @ 844 NONAME
+	_ZNK11CHuiTexture8PriorityEv @ 845 NONAME
+	_ZNK11CHuiTexture9SessionIdEv @ 846 NONAME
+	_ZNK11THuiCommand10SenderTypeEv @ 847 NONAME
+	_ZNK11THuiCommand12SenderVisualEv @ 848 NONAME
+	_ZNK11THuiCommand13ObjectCommandEv @ 849 NONAME
+	_ZNK11THuiCommand13SenderControlEv @ 850 NONAME
+	_ZNK11THuiCommand18SenderControlGroupEv @ 851 NONAME
+	_ZNK11THuiCommand4TypeEv @ 852 NONAME
+	_ZNK11THuiCommand6SenderEv @ 853 NONAME
+	_ZNK13CHuiCurvePath4LoopEv @ 854 NONAME
+	_ZNK13CHuiCurvePath6LengthEv @ 855 NONAME
+	_ZNK13CHuiCurvePath8EvaluateEfR13THuiRealPoint @ 856 NONAME
+	_ZNK13THuiTextStyle11FontStyleIdEv @ 857 NONAME
+	_ZNK13THuiTextStyle11GetTypefaceER9TTypeface @ 858 NONAME
+	_ZNK13THuiTextStyle13StrikeThroughEv @ 859 NONAME
+	_ZNK13THuiTextStyle15BackgroundColorEv @ 860 NONAME
+	_ZNK13THuiTextStyle2IdEv @ 861 NONAME
+	_ZNK13THuiTextStyle4FontEv @ 862 NONAME
+	_ZNK13THuiTextStyle8ParentIdEv @ 863 NONAME
+	_ZNK13THuiTextStyle9TextColorEv @ 864 NONAME
+	_ZNK13THuiTextStyle9UnderlineEv @ 865 NONAME
+	_ZNK14CHuiBrushArray15LayerBrushCountE14THuiBrushLayer @ 866 NONAME
+	_ZNK14CHuiBrushArray4DrawE14THuiBrushLayerR6CHuiGcRK14MHuiBrushGuide @ 867 NONAME
+	_ZNK14CHuiBrushArray5CountEv @ 868 NONAME
+	_ZNK14CHuiFlowLayout4ModeEv @ 869 NONAME
+	_ZNK14CHuiGridLayout11ColumnCountEv @ 870 NONAME
+	_ZNK14CHuiGridLayout12GetClassNameER6TDes16 @ 871 NONAME
+	_ZNK14CHuiGridLayout14DimensionCountE17THuiGridDimension @ 872 NONAME
+	_ZNK14CHuiGridLayout14OrdinalToBlockEi @ 873 NONAME
+	_ZNK14CHuiGridLayout15GetInstanceNameER6TDes16 @ 874 NONAME
+	_ZNK14CHuiGridLayout21ExpandRectWithContentER5TRect @ 875 NONAME
+	_ZNK14CHuiGridLayout4DrawER6CHuiGc @ 876 NONAME
+	_ZNK14CHuiGridLayout4TypeEv @ 877 NONAME
+	_ZNK14CHuiGridLayout5CountEv @ 878 NONAME
+	_ZNK14CHuiGridLayout6VisualEi @ 879 NONAME
+	_ZNK14CHuiGridLayout6WeightE17THuiGridDimensioni @ 880 NONAME
+	_ZNK14CHuiGridLayout7ChangedEv @ 881 NONAME
+	_ZNK14CHuiGridLayout8BaseUnitEv @ 882 NONAME
+	_ZNK14CHuiGridLayout8DrawSelfER6CHuiGcRK5TRect @ 883 NONAME
+	_ZNK14CHuiGridLayout8DumpTreeEv @ 884 NONAME
+	_ZNK14CHuiGridLayout8RowCountEv @ 885 NONAME
+	_ZNK14CHuiGridLayout9SessionIdEv @ 886 NONAME
+	_ZNK14CHuiImageBrush16ExpandVisualRectER5TRect @ 887 NONAME
+	_ZNK14CHuiImageBrush20BorderDrawingEnabledEv @ 888 NONAME
+	_ZNK14CHuiImageBrush20CenterDrawingEnabledEv @ 889 NONAME
+	_ZNK14CHuiImageBrush4DrawER6CHuiGcRK14MHuiBrushGuide @ 890 NONAME
+	_ZNK14CHuiMeshVisual14ProceduralMeshEv @ 891 NONAME
+	_ZNK14CHuiMeshVisual7M3GMeshEv @ 892 NONAME
+	_ZNK14CHuiTextVisual11TextExtentsEv @ 893 NONAME
+	_ZNK14CHuiTextVisual12MaxLineCountEv @ 894 NONAME
+	_ZNK14CHuiTextVisual14BackgroundTypeEv @ 895 NONAME
+	_ZNK14CHuiTextVisual16SubstringExtentsEjj @ 896 NONAME
+	_ZNK14CHuiTextVisual4TextEv @ 897 NONAME
+	_ZNK14CHuiTextVisual5StyleEv @ 898 NONAME
+	_ZNK14CHuiTextVisual8WrappingEv @ 899 NONAME
+	_ZNK14THuiTimedPoint10RealTargetEv @ 900 NONAME
+	_ZNK14THuiTimedPoint3NowEv @ 901 NONAME
+	_ZNK14THuiTimedPoint6TargetEv @ 902 NONAME
+	_ZNK14THuiTimedPoint7RealNowEv @ 903 NONAME
+	_ZNK14THuiTimedValue11UnmappedNowEv @ 904 NONAME
+	_ZNK14THuiTimedValue13RemainingTimeEv @ 905 NONAME
+	_ZNK14THuiTimedValue3NowEv @ 906 NONAME
+	_ZNK14THuiTimedValue5StyleEv @ 907 NONAME
+	_ZNK14THuiTimedValue6TargetEv @ 908 NONAME
+	_ZNK15CHuiImageVisual5ImageEv @ 909 NONAME
+	_ZNK15THuiFontManager15EnumerateFontsLER6RArrayI21THuiFontSpecificationE @ 910 NONAME
+	_ZNK15THuiTextCommand10TextVisualEv @ 911 NONAME
+	_ZNK15THuiTextCommand4SizeEv @ 912 NONAME
+	_ZNK15THuiTextCommand4TextEv @ 913 NONAME
+	_ZNK15THuiTextCommand8ExecuteLER7CHuiEnv @ 914 NONAME
+	_ZNK16CHuiControlGroup11AcceptInputEv @ 915 NONAME
+	_ZNK16CHuiControlGroup11FindControlEi @ 916 NONAME
+	_ZNK16CHuiControlGroup13IsTransformedEv @ 917 NONAME
+	_ZNK16CHuiControlGroup4TypeEv @ 918 NONAME
+	_ZNK16CHuiControlGroup5CountEv @ 919 NONAME
+	_ZNK16CHuiControlGroup7ControlEi @ 920 NONAME
+	_ZNK16CHuiControlGroup9SessionIdEv @ 921 NONAME
+	_ZNK16THuiGroupCommand12ControlGroupEv @ 922 NONAME
+	_ZNK16THuiGroupCommand4SizeEv @ 923 NONAME
+	_ZNK16THuiGroupCommand7DisplayEv @ 924 NONAME
+	_ZNK16THuiGroupCommand8ExecuteLER7CHuiEnv @ 925 NONAME
+	_ZNK16THuiImageCommand11ImageVisualEv @ 926 NONAME
+	_ZNK16THuiImageCommand4SizeEv @ 927 NONAME
+	_ZNK16THuiImageCommand5ImageEv @ 928 NONAME
+	_ZNK16THuiImageCommand8ExecuteLER7CHuiEnv @ 929 NONAME
+	_ZNK16THuiPointCommand10TimedPointEv @ 930 NONAME
+	_ZNK16THuiPointCommand14TransitionTimeEv @ 931 NONAME
+	_ZNK16THuiPointCommand4SizeEv @ 932 NONAME
+	_ZNK16THuiPointCommand5SpeedEv @ 933 NONAME
+	_ZNK16THuiPointCommand6TargetEv @ 934 NONAME
+	_ZNK16THuiPointCommand8ExecuteLER7CHuiEnv @ 935 NONAME
+	_ZNK16THuiValueCommand10TimedValueEv @ 936 NONAME
+	_ZNK16THuiValueCommand14TransitionTimeEv @ 937 NONAME
+	_ZNK16THuiValueCommand4SizeEv @ 938 NONAME
+	_ZNK16THuiValueCommand5SpeedEv @ 939 NONAME
+	_ZNK16THuiValueCommand6TargetEv @ 940 NONAME
+	_ZNK16THuiValueCommand8ExecuteLER7CHuiEnv @ 941 NONAME
+	_ZNK17CHuiGradientBrush5ColorEi @ 942 NONAME
+	_ZNK17CHuiGradientBrush5ImageEv @ 943 NONAME
+	_ZNK17CHuiGradientBrush7OpacityEi @ 944 NONAME
+	_ZNK17THuiActionCommand2IdEv @ 945 NONAME
+	_ZNK17THuiActionCommand4SizeEv @ 946 NONAME
+	_ZNK17THuiActionCommand8ExecuteLER7CHuiEnv @ 947 NONAME
+	_ZNK17THuiMarkerCommand2IdEv @ 948 NONAME
+	_ZNK17THuiMarkerCommand4SizeEv @ 949 NONAME
+	_ZNK17THuiMarkerCommand8ExecuteLER7CHuiEnv @ 950 NONAME
+	_ZNK17THuiObjectCommand13ObjectCommandEv @ 951 NONAME
+	_ZNK17THuiObjectCommand4SizeEv @ 952 NONAME
+	_ZNK17THuiObjectCommand6ObjectEv @ 953 NONAME
+	_ZNK17THuiObjectCommand8ExecuteLER7CHuiEnv @ 954 NONAME
+	_ZNK17THuiObjectCommand9OperationEv @ 955 NONAME
+	_ZNK17THuiTextureHandle10HasContentEv @ 956 NONAME
+	_ZNK17THuiTextureHandle11SegmentNameEi @ 957 NONAME
+	_ZNK17THuiTextureHandle11SegmentSizeEi @ 958 NONAME
+	_ZNK17THuiTextureHandle12SegmentCountEv @ 959 NONAME
+	_ZNK17THuiTextureHandle13SegmentOffsetEi @ 960 NONAME
+	_ZNK17THuiTextureHandle14TextureChangedEv @ 961 NONAME
+	_ZNK17THuiTextureHandle15ShadowedTextureEv @ 962 NONAME
+	_ZNK17THuiTextureHandle16SegmentedTextureEv @ 963 NONAME
+	_ZNK17THuiTextureHandle18SegmentTextureSizeEi @ 964 NONAME
+	_ZNK17THuiTextureHandle19TextureClearChangedEv @ 965 NONAME
+	_ZNK17THuiTextureHandle4NameEv @ 966 NONAME
+	_ZNK17THuiTextureHandle4SizeEv @ 967 NONAME
+	_ZNK17THuiTextureHandle6IsNullEv @ 968 NONAME
+	_ZNK17THuiVisualCommand10FlagsToSetEv @ 969 NONAME
+	_ZNK17THuiVisualCommand12FlagsToClearEv @ 970 NONAME
+	_ZNK17THuiVisualCommand4SizeEv @ 971 NONAME
+	_ZNK17THuiVisualCommand6VisualEv @ 972 NONAME
+	_ZNK17THuiVisualCommand8ExecuteLER7CHuiEnv @ 973 NONAME
+	_ZNK18CHuiTextureManager12BlankTextureEv @ 974 NONAME
+	_ZNK18CHuiTextureManager14LoadQueueCountEv @ 975 NONAME
+	_ZNK18CHuiTextureManager16PrependImagePathER6TDes16 @ 976 NONAME
+	_ZNK18CHuiTextureManager7TextureEi @ 977 NONAME
+	_ZNK18CHuiTextureManager8IsLoadedEPK11CHuiTexture @ 978 NONAME
+	_ZNK18CHuiTextureManager8IsLoadedERK7TDesC16i @ 979 NONAME
+	_ZNK18CHuiTextureManager8IsLoadedEi @ 980 NONAME
+	_ZNK18CHuiTextureManager9ImagePathEv @ 981 NONAME
+	_ZNK18CHuiTransformation16NonIdentityCountEv @ 982 NONAME
+	_ZNK18CHuiTransformation5CountEv @ 983 NONAME
+	_ZNK18CHuiTransformation7ExecuteE12THuiGcMatrixR6CHuiGc @ 984 NONAME
+	_ZNK18THuiControlCommand4SizeEv @ 985 NONAME
+	_ZNK18THuiControlCommand7ControlEv @ 986 NONAME
+	_ZNK18THuiControlCommand8ExecuteLER7CHuiEnv @ 987 NONAME
+	_ZNK19CHuiAnimatedTexture10HasContentEv @ 988 NONAME
+	_ZNK19CHuiAnimatedTexture11SegmentNameEi @ 989 NONAME
+	_ZNK19CHuiAnimatedTexture11SegmentSizeEi @ 990 NONAME
+	_ZNK19CHuiAnimatedTexture12SegmentCountEv @ 991 NONAME
+	_ZNK19CHuiAnimatedTexture13SegmentOffsetEi @ 992 NONAME
+	_ZNK19CHuiAnimatedTexture14TextureChangedEv @ 993 NONAME
+	_ZNK19CHuiAnimatedTexture15ShadowedTextureEv @ 994 NONAME
+	_ZNK19CHuiAnimatedTexture16SegmentedTextureEv @ 995 NONAME
+	_ZNK19CHuiAnimatedTexture18SegmentTextureSizeEi @ 996 NONAME
+	_ZNK19CHuiAnimatedTexture19TextureClearChangedEv @ 997 NONAME
+	_ZNK19CHuiAnimatedTexture4SizeEv @ 998 NONAME
+	_ZNK19MHuiMappingFunction22MappingFunctionChangedEv @ 999 NONAME
+	_ZNK20MHuiSegmentedTexture4BindEii @ 1000 NONAME
+	_ZNK20MHuiSegmentedTexture6HandleEi @ 1001 NONAME
+	_ZNK21CHuiDisplayCoeControl16ComponentControlEi @ 1002 NONAME
+	_ZNK21CHuiDisplayCoeControl17InputCapabilitiesEv @ 1003 NONAME
+	_ZNK21CHuiDisplayCoeControl22CountComponentControlsEv @ 1004 NONAME
+	_ZNK21CHuiDisplayCoeControl4DrawERK5TRect @ 1005 NONAME
+	_ZNK22THuiCustomEventCommand4SizeEv @ 1006 NONAME
+	_ZNK22THuiCustomEventCommand5ParamEv @ 1007 NONAME
+	_ZNK22THuiCustomEventCommand8ExecuteLER7CHuiEnv @ 1008 NONAME
+	_ZNK22THuiCustomEventCommand9RecipientEv @ 1009 NONAME
+	_ZNK23THuiInteractionInterval6ScalarEv @ 1010 NONAME
+	_ZNK23THuiSineMappingFunction8MapValueEfi @ 1011 NONAME
+	_ZNK25THuiCosineMappingFunction8MapValueEfi @ 1012 NONAME
+	_ZNK25THuiLinearMappingFunction8MapValueEfi @ 1013 NONAME
+	_ZNK25THuiTransformationCommand14TransformationEv @ 1014 NONAME
+	_ZNK25THuiTransformationCommand4SizeEv @ 1015 NONAME
+	_ZNK25THuiTransformationCommand4StepEv @ 1016 NONAME
+	_ZNK25THuiTransformationCommand8ExecuteLER7CHuiEnv @ 1017 NONAME
+	_ZNK26THuiAverageMappingFunction22MappingFunctionChangedEv @ 1018 NONAME
+	_ZNK26THuiAverageMappingFunction8MapValueEfi @ 1019 NONAME
+	_ZNK27THuiConstantMappingFunction8MapValueEfi @ 1020 NONAME
+	_ZNK7CHuiEnv11FindControlEi @ 1021 NONAME
+	_ZNK7CHuiEnv11FontManagerEv @ 1022 NONAME
+	_ZNK7CHuiEnv11RefreshModeEv @ 1023 NONAME
+	_ZNK7CHuiEnv12DisplayCountEv @ 1024 NONAME
+	_ZNK7CHuiEnv13VisualFactoryEv @ 1025 NONAME
+	_ZNK7CHuiEnv14PrimaryDisplayEv @ 1026 NONAME
+	_ZNK7CHuiEnv14TextureManagerEv @ 1027 NONAME
+	_ZNK7CHuiEnv16TextStyleManagerEv @ 1028 NONAME
+	_ZNK7CHuiEnv4SkinEv @ 1029 NONAME
+	_ZNK7CHuiEnv8RendererEv @ 1030 NONAME
+	_ZNK8CHuiMesh24AnimationControllerCountEv @ 1031 NONAME
+	_ZNK8CHuiMesh4TypeEv @ 1032 NONAME
+	_ZNK8CHuiMesh8MeshTypeEv @ 1033 NONAME
+	_ZNK8CHuiMesh9SessionIdEv @ 1034 NONAME
+	_ZNK8CHuiSkin11OrientationEv @ 1035 NONAME
+	_ZNK8CHuiSkin7ContextEv @ 1036 NONAME
+	_ZNK8THuiFont2IdEv @ 1037 NONAME
+	_ZNK8THuiFont8CategoryEv @ 1038 NONAME
+	_ZNK8THuiFont8FontSpecEP18MGraphicsDeviceMap @ 1039 NONAME
+	_ZNK9CHuiBrush12ClipToVisualEv @ 1040 NONAME
+	_ZNK9CHuiBrush16ExpandVisualRectER5TRect @ 1041 NONAME
+	_ZNK9CHuiBrush4DrawER6CHuiGcRK14MHuiBrushGuide @ 1042 NONAME
+	_ZNK9CHuiBrush4TypeEv @ 1043 NONAME
+	_ZNK9CHuiBrush5LayerEv @ 1044 NONAME
+	_ZNK9CHuiBrush7ChangedEv @ 1045 NONAME
+	_ZNK9CHuiBrush7EndDrawER6CHuiGcRK14MHuiBrushGuide @ 1046 NONAME
+	_ZNK9CHuiBrush9BeginDrawER6CHuiGcRK14MHuiBrushGuide @ 1047 NONAME
+	_ZNK9CHuiBrush9SessionIdEv @ 1048 NONAME
+	_ZNK9THuiEvent10IsKeyEventEv @ 1049 NONAME
+	_ZNK9THuiEvent11PointerDownEv @ 1050 NONAME
+	_ZNK9THuiEvent13IsCustomEventEv @ 1051 NONAME
+	_ZNK9THuiEvent14IsPointerEventEv @ 1052 NONAME
+	_ZNK9THuiEvent14PointerLongTapEv @ 1053 NONAME
+	_ZNK9THuiEvent4TypeEv @ 1054 NONAME
+	_ZNK9THuiEvent6VisualEv @ 1055 NONAME
+	_ZNK9THuiEvent7DisplayEv @ 1056 NONAME
+	_ZNK9THuiEvent9PointerUpEv @ 1057 NONAME
+	_ZNK9THuiImage10HasTextureEv @ 1058 NONAME
+	_ZNK9THuiImage11BottomRightEv @ 1059 NONAME
+	_ZNK9THuiImage12GetTexCoordsEPfi @ 1060 NONAME
+	_ZNK9THuiImage12SegmentCountEv @ 1061 NONAME
+	_ZNK9THuiImage13ShadowTextureEv @ 1062 NONAME
+	_ZNK9THuiImage15GetVertexCoordsEPsi @ 1063 NONAME
+	_ZNK9THuiImage7TextureEv @ 1064 NONAME
+	_ZNK9THuiImage7TopLeftEv @ 1065 NONAME
+	_ZNK9THuiImage9HasShadowEv @ 1066 NONAME
+	_ZNK9THuiImage9TextureIfEv @ 1067 NONAME
+	_ZTI10CHuiLayout @ 1068 NONAME ; #<TI>#
+	_ZTI10CHuiVisual @ 1069 NONAME ; #<TI>#
+	_ZTI11CHuiControl @ 1070 NONAME ; #<TI>#
+	_ZTI11CHuiS60Skin @ 1071 NONAME ; #<TI>#
+	_ZTI11CHuiTexture @ 1072 NONAME ; #<TI>#
+	_ZTI11MHuiTexture @ 1073 NONAME ; #<TI>#
+	_ZTI11THuiCommand @ 1074 NONAME ; #<TI>#
+	_ZTI13THuiTextStyle @ 1075 NONAME ; #<TI>#
+	_ZTI14CHuiGridLayout @ 1076 NONAME ; #<TI>#
+	_ZTI15MHuiVisualOwner @ 1077 NONAME ; #<TI>#
+	_ZTI15THuiTextCommand @ 1078 NONAME ; #<TI>#
+	_ZTI16MHuiEventHandler @ 1079 NONAME ; #<TI>#
+	_ZTI16THuiGroupCommand @ 1080 NONAME ; #<TI>#
+	_ZTI16THuiImageCommand @ 1081 NONAME ; #<TI>#
+	_ZTI16THuiPointCommand @ 1082 NONAME ; #<TI>#
+	_ZTI16THuiValueCommand @ 1083 NONAME ; #<TI>#
+	_ZTI17THuiActionCommand @ 1084 NONAME ; #<TI>#
+	_ZTI17THuiMarkerCommand @ 1085 NONAME ; #<TI>#
+	_ZTI17THuiObjectCommand @ 1086 NONAME ; #<TI>#
+	_ZTI17THuiVisualCommand @ 1087 NONAME ; #<TI>#
+	_ZTI18MHuiBitmapProvider @ 1088 NONAME ; #<TI>#
+	_ZTI18THuiControlCommand @ 1089 NONAME ; #<TI>#
+	_ZTI19CHuiAnimatedTexture @ 1090 NONAME ; #<TI>#
+	_ZTI19CHuiImageLoaderUtil @ 1091 NONAME ; #<TI>#
+	_ZTI19MHuiMappingFunction @ 1092 NONAME ; #<TI>#
+	_ZTI20MHuiSegmentedTexture @ 1093 NONAME ; #<TI>#
+	_ZTI21CHuiDisplayCoeControl @ 1094 NONAME ; #<TI>#
+	_ZTI22THuiCustomEventCommand @ 1095 NONAME ; #<TI>#
+	_ZTI23THuiSineMappingFunction @ 1096 NONAME ; #<TI>#
+	_ZTI25THuiCosineMappingFunction @ 1097 NONAME ; #<TI>#
+	_ZTI25THuiLinearMappingFunction @ 1098 NONAME ; #<TI>#
+	_ZTI25THuiTransformationCommand @ 1099 NONAME ; #<TI>#
+	_ZTI26THuiAverageMappingFunction @ 1100 NONAME ; #<TI>#
+	_ZTI27THuiConstantMappingFunction @ 1101 NONAME ; #<TI>#
+	_ZTI9CHuiBrush @ 1102 NONAME ; #<TI>#
+	_ZTV10CHuiLayout @ 1103 NONAME ; #<VT>#
+	_ZTV10CHuiVisual @ 1104 NONAME ; #<VT>#
+	_ZTV11CHuiControl @ 1105 NONAME ; #<VT>#
+	_ZTV11CHuiS60Skin @ 1106 NONAME ; #<VT>#
+	_ZTV11CHuiTexture @ 1107 NONAME ; #<VT>#
+	_ZTV11MHuiTexture @ 1108 NONAME ; #<VT>#
+	_ZTV11THuiCommand @ 1109 NONAME ; #<VT>#
+	_ZTV13THuiTextStyle @ 1110 NONAME ; #<VT>#
+	_ZTV14CHuiGridLayout @ 1111 NONAME ; #<VT>#
+	_ZTV15MHuiVisualOwner @ 1112 NONAME ; #<VT>#
+	_ZTV15THuiTextCommand @ 1113 NONAME ; #<VT>#
+	_ZTV16MHuiEventHandler @ 1114 NONAME ; #<VT>#
+	_ZTV16THuiGroupCommand @ 1115 NONAME ; #<VT>#
+	_ZTV16THuiImageCommand @ 1116 NONAME ; #<VT>#
+	_ZTV16THuiPointCommand @ 1117 NONAME ; #<VT>#
+	_ZTV16THuiValueCommand @ 1118 NONAME ; #<VT>#
+	_ZTV17THuiActionCommand @ 1119 NONAME ; #<VT>#
+	_ZTV17THuiMarkerCommand @ 1120 NONAME ; #<VT>#
+	_ZTV17THuiObjectCommand @ 1121 NONAME ; #<VT>#
+	_ZTV17THuiVisualCommand @ 1122 NONAME ; #<VT>#
+	_ZTV18MHuiBitmapProvider @ 1123 NONAME ; #<VT>#
+	_ZTV18THuiControlCommand @ 1124 NONAME ; #<VT>#
+	_ZTV19CHuiAnimatedTexture @ 1125 NONAME ; #<VT>#
+	_ZTV19CHuiImageLoaderUtil @ 1126 NONAME ; #<VT>#
+	_ZTV19MHuiMappingFunction @ 1127 NONAME ; #<VT>#
+	_ZTV20MHuiSegmentedTexture @ 1128 NONAME ; #<VT>#
+	_ZTV21CHuiDisplayCoeControl @ 1129 NONAME ; #<VT>#
+	_ZTV22THuiCustomEventCommand @ 1130 NONAME ; #<VT>#
+	_ZTV23THuiSineMappingFunction @ 1131 NONAME ; #<VT>#
+	_ZTV25THuiCosineMappingFunction @ 1132 NONAME ; #<VT>#
+	_ZTV25THuiLinearMappingFunction @ 1133 NONAME ; #<VT>#
+	_ZTV25THuiTransformationCommand @ 1134 NONAME ; #<VT>#
+	_ZTV26THuiAverageMappingFunction @ 1135 NONAME ; #<VT>#
+	_ZTV27THuiConstantMappingFunction @ 1136 NONAME ; #<VT>#
+	_ZTV9CHuiBrush @ 1137 NONAME ; #<VT>#
+	_ZThn12_N11CHuiControl12SetSessionIdEi @ 1138 NONAME ; #<thunk>#
+	_ZThn12_N11CHuiTexture12EnableShadowEi @ 1139 NONAME ; #<thunk>#
+	_ZThn12_N11CHuiTextureD0Ev @ 1140 NONAME ; #<thunk>#
+	_ZThn12_N11CHuiTextureD1Ev @ 1141 NONAME ; #<thunk>#
+	_ZThn12_NK11CHuiControl4TypeEv @ 1142 NONAME ; #<thunk>#
+	_ZThn12_NK11CHuiControl9SessionIdEv @ 1143 NONAME ; #<thunk>#
+	_ZThn12_NK11CHuiTexture15IsShadowEnabledEv @ 1144 NONAME ; #<thunk>#
+	_ZThn16_N11CHuiTexture12SetSessionIdEi @ 1145 NONAME ; #<thunk>#
+	_ZThn16_NK11CHuiTexture4TypeEv @ 1146 NONAME ; #<thunk>#
+	_ZThn16_NK11CHuiTexture9SessionIdEv @ 1147 NONAME ; #<thunk>#
+	_ZThn4_N11CHuiControl12EventHandlerEv @ 1148 NONAME ; #<thunk>#
+	_ZThn4_N11CHuiControl15VisualDestroyedER10CHuiVisual @ 1149 NONAME ; #<thunk>#
+	_ZThn4_N11CHuiControl19VisualLayoutUpdatedER10CHuiVisual @ 1150 NONAME ; #<thunk>#
+	_ZThn4_N11CHuiControl23VisualPrepareDrawFailedER10CHuiVisuali @ 1151 NONAME ; #<thunk>#
+	_ZThn4_N11CHuiControl6RemoveEP10CHuiVisual @ 1152 NONAME ; #<thunk>#
+	_ZThn4_N11CHuiControl7AppendLEP10CHuiVisual @ 1153 NONAME ; #<thunk>#
+	_ZThn4_N11CHuiControlD0Ev @ 1154 NONAME ; #<thunk>#
+	_ZThn4_N11CHuiControlD1Ev @ 1155 NONAME ; #<thunk>#
+	_ZThn4_N11CHuiS60Skin22RestoreTextureContentLER11CHuiTexture @ 1156 NONAME ; #<thunk>#
+	_ZThn4_N11CHuiS60SkinD0Ev @ 1157 NONAME ; #<thunk>#
+	_ZThn4_N11CHuiS60SkinD1Ev @ 1158 NONAME ; #<thunk>#
+	_ZThn4_N11CHuiTexture15ShadowedTextureEv @ 1159 NONAME ; #<thunk>#
+	_ZThn4_N11CHuiTexture16SegmentedTextureEv @ 1160 NONAME ; #<thunk>#
+	_ZThn4_N11CHuiTextureD0Ev @ 1161 NONAME ; #<thunk>#
+	_ZThn4_N11CHuiTextureD1Ev @ 1162 NONAME ; #<thunk>#
+	_ZThn4_N13CHuiCurvePathD0Ev @ 1163 NONAME ; #<thunk>#
+	_ZThn4_N13CHuiCurvePathD1Ev @ 1164 NONAME ; #<thunk>#
+	_ZThn4_N16CHuiControlGroup12SetSessionIdEi @ 1165 NONAME ; #<thunk>#
+	_ZThn4_N19CHuiAnimatedTexture15ShadowedTextureEv @ 1166 NONAME ; #<thunk>#
+	_ZThn4_N19CHuiAnimatedTexture16SegmentedTextureEv @ 1167 NONAME ; #<thunk>#
+	_ZThn4_N19CHuiAnimatedTexture16TextureExtensionERK4TUidPPv @ 1168 NONAME ; #<thunk>#
+	_ZThn4_N19CHuiAnimatedTextureD0Ev @ 1169 NONAME ; #<thunk>#
+	_ZThn4_N19CHuiAnimatedTextureD1Ev @ 1170 NONAME ; #<thunk>#
+	_ZThn4_N23CHuiGifAnimationTextureD0Ev @ 1171 NONAME ; #<thunk>#
+	_ZThn4_N23CHuiGifAnimationTextureD1Ev @ 1172 NONAME ; #<thunk>#
+	_ZThn4_N8CHuiMesh12SetSessionIdEi @ 1173 NONAME ; #<thunk>#
+	_ZThn4_N8CHuiSkin22RestoreTextureContentLER11CHuiTexture @ 1174 NONAME ; #<thunk>#
+	_ZThn4_N8CHuiSkin22TextureContentReleasedER11CHuiTexture @ 1175 NONAME ; #<thunk>#
+	_ZThn4_N8CHuiSkin22TextureContentUploadedER11CHuiTexture @ 1176 NONAME ; #<thunk>#
+	_ZThn4_N9CHuiBrush12SetSessionIdEi @ 1177 NONAME ; #<thunk>#
+	_ZThn4_NK10CHuiLayout12BrushOpacityEv @ 1178 NONAME ; #<thunk>#
+	_ZThn4_NK10CHuiLayout9BrushRectEv @ 1179 NONAME ; #<thunk>#
+	_ZThn4_NK10CHuiLayout9BrushSkinEv @ 1180 NONAME ; #<thunk>#
+	_ZThn4_NK10CHuiVisual12BrushOpacityEv @ 1181 NONAME ; #<thunk>#
+	_ZThn4_NK10CHuiVisual9BrushRectEv @ 1182 NONAME ; #<thunk>#
+	_ZThn4_NK10CHuiVisual9BrushSkinEv @ 1183 NONAME ; #<thunk>#
+	_ZThn4_NK11CHuiControl12ControlGroupEv @ 1184 NONAME ; #<thunk>#
+	_ZThn4_NK11CHuiControl3EnvEv @ 1185 NONAME ; #<thunk>#
+	_ZThn4_NK11CHuiTexture10HasContentEv @ 1186 NONAME ; #<thunk>#
+	_ZThn4_NK11CHuiTexture14TextureChangedEv @ 1187 NONAME ; #<thunk>#
+	_ZThn4_NK11CHuiTexture15ShadowedTextureEv @ 1188 NONAME ; #<thunk>#
+	_ZThn4_NK11CHuiTexture16SegmentedTextureEv @ 1189 NONAME ; #<thunk>#
+	_ZThn4_NK11CHuiTexture19TextureClearChangedEv @ 1190 NONAME ; #<thunk>#
+	_ZThn4_NK16CHuiControlGroup4TypeEv @ 1191 NONAME ; #<thunk>#
+	_ZThn4_NK16CHuiControlGroup9SessionIdEv @ 1192 NONAME ; #<thunk>#
+	_ZThn4_NK17THuiTextureHandle11SegmentNameEi @ 1193 NONAME ; #<thunk>#
+	_ZThn4_NK17THuiTextureHandle11SegmentSizeEi @ 1194 NONAME ; #<thunk>#
+	_ZThn4_NK17THuiTextureHandle12SegmentCountEv @ 1195 NONAME ; #<thunk>#
+	_ZThn4_NK17THuiTextureHandle13SegmentOffsetEi @ 1196 NONAME ; #<thunk>#
+	_ZThn4_NK17THuiTextureHandle18SegmentTextureSizeEi @ 1197 NONAME ; #<thunk>#
+	_ZThn4_NK17THuiTextureHandle4SizeEv @ 1198 NONAME ; #<thunk>#
+	_ZThn4_NK19CHuiAnimatedTexture10HasContentEv @ 1199 NONAME ; #<thunk>#
+	_ZThn4_NK19CHuiAnimatedTexture14TextureChangedEv @ 1200 NONAME ; #<thunk>#
+	_ZThn4_NK19CHuiAnimatedTexture15ShadowedTextureEv @ 1201 NONAME ; #<thunk>#
+	_ZThn4_NK19CHuiAnimatedTexture16SegmentedTextureEv @ 1202 NONAME ; #<thunk>#
+	_ZThn4_NK19CHuiAnimatedTexture19TextureClearChangedEv @ 1203 NONAME ; #<thunk>#
+	_ZThn4_NK8CHuiMesh4TypeEv @ 1204 NONAME ; #<thunk>#
+	_ZThn4_NK8CHuiMesh9SessionIdEv @ 1205 NONAME ; #<thunk>#
+	_ZThn4_NK9CHuiBrush4TypeEv @ 1206 NONAME ; #<thunk>#
+	_ZThn4_NK9CHuiBrush9SessionIdEv @ 1207 NONAME ; #<thunk>#
+	_ZThn52_N21CHuiDisplayCoeControl19HandleControlEventLEP11CCoeControlN19MCoeControlObserver9TCoeEventE @ 1208 NONAME ; #<thunk>#
+	_ZThn8_N10CHuiLayout12SetSessionIdEi @ 1209 NONAME ; #<thunk>#
+	_ZThn8_N10CHuiVisual12SetSessionIdEi @ 1210 NONAME ; #<thunk>#
+	_ZThn8_N11CHuiControl11OfferEventLERK9THuiEvent @ 1211 NONAME ; #<thunk>#
+	_ZThn8_N11CHuiControlD0Ev @ 1212 NONAME ; #<thunk>#
+	_ZThn8_N11CHuiControlD1Ev @ 1213 NONAME ; #<thunk>#
+	_ZThn8_N11CHuiTextureD0Ev @ 1214 NONAME ; #<thunk>#
+	_ZThn8_N11CHuiTextureD1Ev @ 1215 NONAME ; #<thunk>#
+	_ZThn8_N14CHuiGridLayout12SetSessionIdEi @ 1216 NONAME ; #<thunk>#
+	_ZThn8_N19CHuiAnimatedTextureD0Ev @ 1217 NONAME ; #<thunk>#
+	_ZThn8_N19CHuiAnimatedTextureD1Ev @ 1218 NONAME ; #<thunk>#
+	_ZThn8_N23CHuiGifAnimationTextureD0Ev @ 1219 NONAME ; #<thunk>#
+	_ZThn8_N23CHuiGifAnimationTextureD1Ev @ 1220 NONAME ; #<thunk>#
+	_ZThn8_NK10CHuiLayout4TypeEv @ 1221 NONAME ; #<thunk>#
+	_ZThn8_NK10CHuiLayout9SessionIdEv @ 1222 NONAME ; #<thunk>#
+	_ZThn8_NK10CHuiVisual4TypeEv @ 1223 NONAME ; #<thunk>#
+	_ZThn8_NK10CHuiVisual9SessionIdEv @ 1224 NONAME ; #<thunk>#
+	_ZThn8_NK11CHuiTexture11SegmentNameEi @ 1225 NONAME ; #<thunk>#
+	_ZThn8_NK11CHuiTexture11SegmentSizeEi @ 1226 NONAME ; #<thunk>#
+	_ZThn8_NK11CHuiTexture12SegmentCountEv @ 1227 NONAME ; #<thunk>#
+	_ZThn8_NK11CHuiTexture18SegmentTextureSizeEi @ 1228 NONAME ; #<thunk>#
+	_ZThn8_NK11CHuiTexture4SizeEv @ 1229 NONAME ; #<thunk>#
+	_ZThn8_NK14CHuiGridLayout4TypeEv @ 1230 NONAME ; #<thunk>#
+	_ZThn8_NK14CHuiGridLayout9SessionIdEv @ 1231 NONAME ; #<thunk>#
+	_ZThn8_NK19CHuiAnimatedTexture11SegmentNameEi @ 1232 NONAME ; #<thunk>#
+	_ZThn8_NK19CHuiAnimatedTexture11SegmentSizeEi @ 1233 NONAME ; #<thunk>#
+	_ZThn8_NK19CHuiAnimatedTexture12SegmentCountEv @ 1234 NONAME ; #<thunk>#
+	_ZThn8_NK19CHuiAnimatedTexture13SegmentOffsetEi @ 1235 NONAME ; #<thunk>#
+	_ZThn8_NK19CHuiAnimatedTexture18SegmentTextureSizeEi @ 1236 NONAME ; #<thunk>#
+	_ZThn8_NK19CHuiAnimatedTexture4SizeEv @ 1237 NONAME ; #<thunk>#
+	_ZN10CHuiVisual19UpdateSiblingLayoutEi @ 1238 NONAME
+	_ZNK10CHuiVisual14PixelsToMetricERK13THuiRealPointR12THuiXYMetric18THuiReferenceState @ 1239 NONAME
+	_ZNK10CHuiVisual15PaddingInPixelsE18THuiReferenceState @ 1240 NONAME
+	_ZNK10CHuiVisual17PixelPointInLocalERK13THuiRealPoint18THuiReferenceState @ 1241 NONAME
+	_ZNK10CHuiVisual18LocalPointInPixelsERK13THuiRealPoint18THuiReferenceState @ 1242 NONAME
+	_ZNK10CHuiVisual20BoxMetricToPixelRectERK13THuiBoxMetricR12THuiRealRect18THuiReferenceState @ 1243 NONAME
+	_ZNK10CHuiVisual23MetricReferenceInPixelsERK12THuiXYMetric18THuiReferenceState @ 1244 NONAME
+	_ZNK10CHuiVisual14MetricToPixelsERK12THuiXYMetric18THuiReferenceState @ 1245 NONAME
+	_ZN14CHuiLineVisual8SetColorERK4TRgb @ 1246 NONAME
+	_ZNK10CHuiLayout32MetricReferenceForLayoutInPixelsERK12THuiXYMetric @ 1247 NONAME
+	_ZN13CHuiCurvePath10AppendArcLERK13THuiRealPointRK12THuiRealSizefff @ 1248 NONAME
+	_ZN13CHuiCurvePath11AppendLineLERK13THuiRealPointS2_f @ 1249 NONAME
+	_ZN15CHuiImageVisual13SetDropShadowERK10THuiMetric @ 1250 NONAME
+	_ZN15CHuiImageVisual13SetDropShadowERK12THuiXYMetric @ 1251 NONAME
+	_ZN14CHuiFrameBrush13SetEdgeOffsetERK12THuiXYMetric @ 1252 NONAME
+	_ZN14CHuiFrameBrush4NewLERK11TAknsItemIDRK12THuiXYMetric @ 1253 NONAME
+	_ZN14CHuiFrameBrush5NewLCERK11TAknsItemIDRK12THuiXYMetric @ 1254 NONAME
+	_ZN15CHuiBorderBrush12SetThicknessERK12THuiXYMetric @ 1255 NONAME
+	_ZN15CHuiBorderBrush13SetEdgeOffsetERK12THuiXYMetric @ 1256 NONAME
+	_ZN15CHuiBorderBrush14SetImageOffsetERK12THuiXYMetric @ 1257 NONAME
+	_ZN15CHuiBorderBrush4NewLERK12THuiXYMetricS2_ @ 1258 NONAME
+	_ZN15CHuiBorderBrush5NewLCERK12THuiXYMetricS2_ @ 1259 NONAME
+	_ZN19CHuiDropShadowBrush11SetSoftnessERK10THuiMetric @ 1260 NONAME
+	_ZN19CHuiDropShadowBrush4NewLERK10THuiMetric @ 1261 NONAME
+	_ZN19CHuiDropShadowBrush5NewLCERK10THuiMetric @ 1262 NONAME
+	_ZN19CHuiDropShadowBrush8SetColorERK4TRgb @ 1263 NONAME
+	_ZN19CHuiDropShadowBrush8SetDepthERK10THuiMetric @ 1264 NONAME
+	_ZN21CHuiShadowBorderBrush4NewLERK10THuiMetric @ 1265 NONAME
+	_ZN21CHuiShadowBorderBrush5NewLCERK10THuiMetric @ 1266 NONAME
+	_ZN21CHuiShadowBorderBrush8SetWidthERK10THuiMetric @ 1267 NONAME
+	_ZN24CHuiSkinAnimationTexture2IdEv @ 1268 NONAME
+	_ZN24CHuiSkinAnimationTexture4NewLERK7TDesC16R18CHuiTextureManageri22THuiTextureUploadFlags @ 1269 NONAME
+	_ZN24CHuiSkinAnimationTexture4StopEv @ 1270 NONAME
+	_ZN24CHuiSkinAnimationTexture5StartEv @ 1271 NONAME
+	_ZN24CHuiSkinAnimationTextureD0Ev @ 1272 NONAME
+	_ZN24CHuiSkinAnimationTextureD1Ev @ 1273 NONAME
+	_ZN24CHuiSkinAnimationTextureD2Ev @ 1274 NONAME
+	_ZThn4_N24CHuiSkinAnimationTextureD0Ev @ 1275 NONAME ; #<thunk>#
+	_ZThn4_N24CHuiSkinAnimationTextureD1Ev @ 1276 NONAME ; #<thunk>#
+	_ZThn8_N24CHuiSkinAnimationTextureD0Ev @ 1277 NONAME ; #<thunk>#
+	_ZThn8_N24CHuiSkinAnimationTextureD1Ev @ 1278 NONAME ; #<thunk>#
+	_ZN10CHuiLayout26SetScrollOffsetInBaseUnitsERK13THuiRealPointi @ 1279 NONAME
+	_ZN10CHuiVisual10SetMaxSizeERK12THuiRealSize @ 1280 NONAME
+	_ZN10CHuiVisual10SetMinSizeERK12THuiRealSize @ 1281 NONAME
+	_ZN10CHuiVisual21SetCenteredPosAndSizeERK13THuiRealPointRK12THuiRealSizei @ 1282 NONAME
+	_ZN10CHuiVisual4MoveERK13THuiRealPointi @ 1283 NONAME
+	_ZNK10CHuiVisual18MaxSizeInBaseUnitsEv @ 1284 NONAME
+	_ZNK10CHuiVisual18MinSizeInBaseUnitsEv @ 1285 NONAME
+	_ZN10CHuiVisual19SetTactileFeedbackLEii @ 1286 NONAME
+	_ZN10CHuiVisual21RemoveTactileFeedbackEi @ 1287 NONAME
+	_ZNK10CHuiVisual18HasTactileFeedbackEi @ 1288 NONAME
+	_ZN14CHuiGridLayout15LayoutModeFlagsE17THuiGridDimension @ 1289 NONAME
+	_ZN14CHuiGridLayout18SetLayoutModeFlagsE17THuiGridDimensionj @ 1290 NONAME
+	_ZN14CHuiGridLayout20ClearLayoutModeFlagsE17THuiGridDimensionj @ 1291 NONAME
+	_ZN16CHuiThemeManager18GetSkinImageParamsERK7TDesC16 @ 1292 NONAME
+	_ZN16CHuiThemeManager9GetItemIDERK7TDesC16R11TAknsItemID @ 1293 NONAME
+	_ZNK7CHuiEnv12ThemeManagerEv @ 1294 NONAME
+	_ZN11CHuiDisplay11DisplayTypeEv @ 1295 NONAME
+	_ZN11CHuiDisplay15ScreenBufferUidEv @ 1296 NONAME
+	_ZN11CHuiDisplay18GetGraphicsContextERK4TUid @ 1297 NONAME
+	_ZN11CHuiDisplay19GetDrawingInterfaceERK4TUid @ 1298 NONAME
+	_ZN11CHuiDisplay19SetScreenBufferLockEi @ 1299 NONAME
+	_ZN11CHuiDisplay24AddScreenBufferObserverLEP24MHuiScreenBufferObserver @ 1300 NONAME
+	_ZN11CHuiDisplay26RemoveScreenBufferObserverEv @ 1301 NONAME
+	_ZN7CHuiEnv11NewDisplayLERK5TRectP11CCoeControliP11CHuiDisplayi4TUid @ 1302 NONAME
+	_ZNK11CHuiDisplay20IsScreenBufferLockedEv @ 1303 NONAME
+	_ZNK7CHuiEnv7DisplayEi @ 1304 NONAME
+	_ZTI21CHuiFbsBitmapBufferGc @ 1305 NONAME ; #<TI>#
+	_ZTV21CHuiFbsBitmapBufferGc @ 1306 NONAME ; #<VT>#
+	_ZN16CHuiThemeManager10GetItemIdLERK7TDesC16R11TAknsItemID @ 1307 NONAME
+	_ZN16CHuiThemeManager19GetSkinImageParamsLERK7TDesC16 @ 1308 NONAME
+	_ZN20CHuiTextStyleManager15DeleteTextStyleEi @ 1309 NONAME
+	_ZN7CHuiEnv22SetFPSCounterThresholdEj @ 1310 NONAME
+	_ZN11CHuiDisplay16ShowDirtyRegionsEi @ 1311 NONAME
+	_ZN11CHuiDisplay19SetBackgroundItemsLERK6RArrayI25THuiDisplayBackgroundItemE @ 1312 NONAME
+	_ZN25THuiDisplayBackgroundItem17SetSkinBackgroundERK11TAknsItemID @ 1313 NONAME
+	_ZN25THuiDisplayBackgroundItem7SetRectERK5TRect @ 1314 NONAME
+	_ZN25THuiDisplayBackgroundItem8SetColorERK11TAknsItemIDi @ 1315 NONAME
+	_ZN25THuiDisplayBackgroundItem8SetColorERK4TRgb @ 1316 NONAME
+	_ZN25THuiDisplayBackgroundItemC1ERK5TRect @ 1317 NONAME
+	_ZN25THuiDisplayBackgroundItemC1ERK5TRectRK11TAknsItemID @ 1318 NONAME
+	_ZN25THuiDisplayBackgroundItemC1ERK5TRectRK11TAknsItemIDi @ 1319 NONAME
+	_ZN25THuiDisplayBackgroundItemC1ERK5TRectRK4TRgb @ 1320 NONAME
+	_ZN25THuiDisplayBackgroundItemC1Ev @ 1321 NONAME
+	_ZN25THuiDisplayBackgroundItemC2ERK5TRect @ 1322 NONAME
+	_ZN25THuiDisplayBackgroundItemC2ERK5TRectRK11TAknsItemID @ 1323 NONAME
+	_ZN25THuiDisplayBackgroundItemC2ERK5TRectRK11TAknsItemIDi @ 1324 NONAME
+	_ZN25THuiDisplayBackgroundItemC2ERK5TRectRK4TRgb @ 1325 NONAME
+	_ZN25THuiDisplayBackgroundItemC2Ev @ 1326 NONAME
+	_ZN11CHuiDisplay26GetPreferredTextureFormatsER13RPointerArrayINS_20CTextureBitmapFormatEE @ 1327 NONAME
+	_ZN18CHuiTextureManager24UpdateTextureFromBitmapLEiP18MHuiBitmapProvider @ 1328 NONAME
+	_ZN13THuiTextStyle25SetTextPaneHeightInPixelsEii @ 1329 NONAME
+	_ZNK14CHuiTextVisual9TextStyleEv @ 1330 NONAME
+	_ZN8THuiFontC1ERKS_ @ 1331 NONAME
+	_ZN8THuiFontC2ERKS_ @ 1332 NONAME
+	_ZN8THuiFontaSERKS_ @ 1333 NONAME
+	_ZN11CHuiTexture17SetAutoSizeParamsERK25THuiTextureAutoSizeParams @ 1334 NONAME
+	_ZN11CHuiTexture25EnableAutoSizeCalculationEi @ 1335 NONAME
+	_ZN25THuiTextureAutoSizeParams16SetMinSizeChangeEi @ 1336 NONAME
+	_ZN25THuiTextureAutoSizeParams21SetSizeLowerThresholdEi @ 1337 NONAME
+	_ZN25THuiTextureAutoSizeParams21SetSizeUpperThresholdEi @ 1338 NONAME
+	_ZN25THuiTextureAutoSizeParams26SetDownsizeSettleThresholdEi @ 1339 NONAME
+	_ZN25THuiTextureAutoSizeParamsC1Ev @ 1340 NONAME
+	_ZN25THuiTextureAutoSizeParamsC2Ev @ 1341 NONAME
+	_ZN27CHuiAutoSizeImageLoaderUtil20PreferredSizeChangedERK11CHuiTextureiRK12THuiRealSize @ 1342 NONAME
+	_ZN27CHuiAutoSizeImageLoaderUtil28PreferredSizeReportCompletedEv @ 1343 NONAME
+	_ZNK11CHuiTexture14AutoSizeParamsEv @ 1344 NONAME
+	_ZNK25THuiTextureAutoSizeParams13MinSizeChangeEv @ 1345 NONAME
+	_ZNK25THuiTextureAutoSizeParams18SizeLowerThresholdEv @ 1346 NONAME
+	_ZNK25THuiTextureAutoSizeParams18SizeUpperThresholdEv @ 1347 NONAME
+	_ZNK25THuiTextureAutoSizeParams23DownsizeSettleThresholdEv @ 1348 NONAME
+	_ZTI27CHuiAutoSizeImageLoaderUtil @ 1349 NONAME ; #<TI>#
+	_ZTV27CHuiAutoSizeImageLoaderUtil @ 1350 NONAME ; #<VT>#
+	_ZThn48_N27CHuiAutoSizeImageLoaderUtil20PreferredSizeChangedERK11CHuiTextureiRK12THuiRealSize @ 1351 NONAME ; #<thunk>#
+	_ZThn48_N27CHuiAutoSizeImageLoaderUtil28PreferredSizeReportCompletedEv @ 1352 NONAME ; #<thunk>#
+	_ZN11CHuiDisplay20ScreenBufferObserverEv @ 1353 NONAME
+	_ZN7CHuiEnv25ChangeRefreshLoopPriorityEN7CActive9TPriorityE @ 1354 NONAME
+	_ZN14CHuiFrameBrush4NewLERK9THuiImageRK12THuiXYMetric @ 1355 NONAME
+	_ZN14CHuiFrameBrush5NewLCERK9THuiImageRK12THuiXYMetric @ 1356 NONAME
+	_ZN14CHuiFrameBrush8SetImageENS_11TFramePartsERK9THuiImage @ 1357 NONAME
+	_ZN14CHuiFrameBrush8SetImageERK9THuiImage @ 1358 NONAME
+	_ZN11CHuiDisplay16DrawScreenBufferEv @ 1359 NONAME
+	_ZN10CHuiVisual17EnableDropShadowLEi @ 1360 NONAME
+	_ZN14CHuiDropShadow8SetColorERK11TAknsItemIDii @ 1361 NONAME
+	_ZN14CHuiDropShadow8SetColorERK4TRgbi @ 1362 NONAME
+	_ZN14CHuiDropShadow9SetOffsetEf10THuiMetrici @ 1363 NONAME
+	_ZNK10CHuiVisual17DropShadowHandlerEv @ 1364 NONAME
+	_ZN23CHuiGifAnimationTexture15EnableAnimationEi @ 1365 NONAME
+	_ZN11CHuiDisplay26SetVisibleAreaClippingRectERK5TRect @ 1366 NONAME
+	_ZN11CHuiDisplay20SetDrawVisualOutlineEj @ 1367 NONAME
+	_ZN14CHuiTextVisual17SetHighlightRangeEiiR4TRgbS1_ @ 1368 NONAME
+	_ZN10CHuiStatic14Gles10RendererEv @ 1369 NONAME
+	_ZN10CHuiStatic15ContinueRefreshEv @ 1370 NONAME
+	_ZN10CHuiStatic20CurrentRenderSurfaceEv @ 1371 NONAME
+	_ZN10CHuiStatic23SetCurrentRenderSurfaceEP17MHuiRenderSurface @ 1372 NONAME
+	_ZN10CHuiStatic8RendererEv @ 1373 NONAME
+	_ZN10CHuiVisual12GetDualAlphaEffRiS0_ @ 1374 NONAME
+	_ZN11CHuiDisplay12NativeWindowEv @ 1375 NONAME
+	_ZN11CHuiDisplay13NativeControlEv @ 1376 NONAME
+	_ZN11CHuiM3GMesh10ConstructLEv @ 1377 NONAME
+	_ZN11CHuiM3GMesh10LoadSceneLERK7TDesC16P16M3GInterfaceImpl @ 1378 NONAME
+	_ZN11CHuiM3GMesh11RotatePitchEf @ 1379 NONAME
+	_ZN11CHuiM3GMesh11StoreCameraEv @ 1380 NONAME
+	_ZN11CHuiM3GMesh12ReleaseSceneEv @ 1381 NONAME
+	_ZN11CHuiM3GMesh13RestoreCameraEv @ 1382 NONAME
+	_ZN11CHuiM3GMesh15SetViewportRectERK12THuiRealRect @ 1383 NONAME
+	_ZN11CHuiM3GMesh18AnimateControllersEv @ 1384 NONAME
+	_ZN11CHuiM3GMesh9RotateYawEf @ 1385 NONAME
+	_ZN11CHuiM3GMeshC1Ev @ 1386 NONAME
+	_ZN11CHuiM3GMeshC2Ev @ 1387 NONAME
+	_ZN11CHuiM3GMeshD0Ev @ 1388 NONAME
+	_ZN11CHuiM3GMeshD1Ev @ 1389 NONAME
+	_ZN11CHuiM3GMeshD2Ev @ 1390 NONAME
+	_ZN11CHuiTexture10SetSegmentEiRK5TSizeRK6TPointS2_ @ 1391 NONAME
+	_ZN11CHuiTexture12ResetShadowsEv @ 1392 NONAME
+	_ZN11CHuiTexture14BaseConstructLEv @ 1393 NONAME
+	_ZN11CHuiTexture16TextureExtensionERK4TUidPPv @ 1394 NONAME
+	_ZN11CHuiTexture17SetTextureChangedEi @ 1395 NONAME
+	_ZN11CHuiTexture5ResetEv @ 1396 NONAME
+	_ZN11CHuiTexture7ReleaseEv @ 1397 NONAME
+	_ZN11CHuiTexture8RestoreLEv @ 1398 NONAME
+	_ZN11CHuiTextureC2Ev @ 1399 NONAME
+	_ZN13CHuiCurvePath27MappingFunctionClearChangedEv @ 1400 NONAME
+	_ZN13CHuiCurvePath6UpdateEfffP19MHuiMappingFunctionS1_ @ 1401 NONAME
+	_ZN13CHuiCurvePathC1Ev @ 1402 NONAME
+	_ZN13CHuiCurvePathC2Ev @ 1403 NONAME
+	_ZN15CHuiMatrixStack12LoadIdentityEv @ 1404 NONAME
+	_ZN15CHuiMatrixStack3PopEv @ 1405 NONAME
+	_ZN15CHuiMatrixStack4NewLEv @ 1406 NONAME
+	_ZN15CHuiMatrixStack4PushEv @ 1407 NONAME
+	_ZN15CHuiMatrixStack7CurrentEv @ 1408 NONAME
+	_ZN15CHuiMatrixStack7TMatrixC1Ev @ 1409 NONAME
+	_ZN15CHuiMatrixStack7TMatrixC2Ev @ 1410 NONAME
+	_ZN15CHuiMatrixStack8MultiplyERKNS_7TMatrixE @ 1411 NONAME
+	_ZN15THuiFontManagerC1Ev @ 1412 NONAME
+	_ZN15THuiFontManagerC2Ev @ 1413 NONAME
+	_ZN15THuiFontManagerD0Ev @ 1414 NONAME
+	_ZN15THuiFontManagerD1Ev @ 1415 NONAME
+	_ZN15THuiFontManagerD2Ev @ 1416 NONAME
+	_ZN17MHuiRenderSurfaceD0Ev @ 1417 NONAME
+	_ZN17MHuiRenderSurfaceD1Ev @ 1418 NONAME
+	_ZN17MHuiRenderSurfaceD2Ev @ 1419 NONAME
+	_ZN18CHuiProceduralMeshC1Ev @ 1420 NONAME
+	_ZN18CHuiProceduralMeshC2Ev @ 1421 NONAME
+	_ZN18CHuiTextureManager12SetProcessorEP20CHuiTextureProcessor @ 1422 NONAME
+	_ZN18CHuiTextureManager13RemoveTextureER11CHuiTexture @ 1423 NONAME
+	_ZN18CHuiTextureManager14AppendTextureLEP11CHuiTexturei @ 1424 NONAME
+	_ZN18CHuiTextureManager14BaseConstructLEv @ 1425 NONAME
+	_ZN18CHuiTextureManager14CreateTextureLER10CFbsBitmapPKS0_22THuiTextureUploadFlagsi @ 1426 NONAME
+	_ZN18CHuiTextureManager4RunLEv @ 1427 NONAME
+	_ZN18CHuiTextureManager7ReleaseEv @ 1428 NONAME
+	_ZN18CHuiTextureManager8DoCancelEv @ 1429 NONAME
+	_ZN18CHuiTextureManager8RestoreLEv @ 1430 NONAME
+	_ZN18CHuiTextureManager8RunErrorEi @ 1431 NONAME
+	_ZN18CHuiTextureManagerC1ER7CHuiEnv @ 1432 NONAME
+	_ZN18CHuiTextureManagerC2ER7CHuiEnv @ 1433 NONAME
+	_ZN18CHuiTextureManagerD0Ev @ 1434 NONAME
+	_ZN18CHuiTextureManagerD1Ev @ 1435 NONAME
+	_ZN18CHuiTextureManagerD2Ev @ 1436 NONAME
+	_ZN20CHuiTextureProcessor7ReleaseEv @ 1437 NONAME
+	_ZN20CHuiTextureProcessor8RestoreLEv @ 1438 NONAME
+	_ZN20CHuiTextureProcessorC2ER7CHuiEnv @ 1439 NONAME
+	_ZN20CHuiTextureProcessorD0Ev @ 1440 NONAME
+	_ZN20CHuiTextureProcessorD1Ev @ 1441 NONAME
+	_ZN20CHuiTextureProcessorD2Ev @ 1442 NONAME
+	_ZN22CHuiRasterizedTextMesh4NewLEv @ 1443 NONAME
+	_ZN6CHuiGc10SetQualityE11THuiQuality @ 1444 NONAME
+	_ZN6CHuiGc11SetPenColorERK4TRgb @ 1445 NONAME
+	_ZN6CHuiGc16DrawStretchImageENS_12TStretchModeERK9THuiImageRK12THuiRealRectii @ 1446 NONAME
+	_ZN6CHuiGc4ClipERK5TRect @ 1447 NONAME
+	_ZN6CHuiGc7DisableENS_8TFeatureE @ 1448 NONAME
+	_ZN6CHuiGc7PopClipEv @ 1449 NONAME
+	_ZN6CHuiGc7SetClipERK5TRect @ 1450 NONAME
+	_ZN6CHuiGc8DrawTextERK12CHuiTextMeshRK12THuiRealRectf @ 1451 NONAME
+	_ZN6CHuiGc8PushClipEv @ 1452 NONAME
+	_ZN6CHuiGc9DrawTextLERK7TDesC16RK12THuiRealRectf @ 1453 NONAME
+	_ZN6CHuiGcC2Ev @ 1454 NONAME
+	_ZN6CHuiGcD0Ev @ 1455 NONAME
+	_ZN6CHuiGcD1Ev @ 1456 NONAME
+	_ZN6CHuiGcD2Ev @ 1457 NONAME
+	_ZN7CHuiEnv14GlesRefCounterEv @ 1458 NONAME
+	_ZN7HuiUtil11CopyBitmapLERK10CFbsBitmap @ 1459 NONAME
+	_ZN7HuiUtil11RealCompareEfff @ 1460 NONAME
+	_ZN7HuiUtil6AssertEi @ 1461 NONAME
+	_ZNK11CHuiDisplay13RenderSurfaceEv @ 1462 NONAME
+	_ZNK11CHuiDisplay18IsDisplayTypeTvOutEv @ 1463 NONAME
+	_ZNK11CHuiM3GMesh24AnimationControllerCountEv @ 1464 NONAME
+	_ZNK11CHuiTexture16GetShadowTextureER17THuiTextureHandle @ 1465 NONAME
+	_ZNK13CHuiCurvePath10NeedUpdateEv @ 1466 NONAME
+	_ZNK13CHuiCurvePath12SegmentCountEv @ 1467 NONAME
+	_ZNK13CHuiCurvePath15EvaluateSegmentEfRKNS_8TSegmentER13THuiRealPointPS3_ @ 1468 NONAME
+	_ZNK13CHuiCurvePath22MappingFunctionChangedEv @ 1469 NONAME
+	_ZNK13CHuiCurvePath7SegmentEi @ 1470 NONAME
+	_ZNK13CHuiCurvePath8MapValueEfi @ 1471 NONAME
+	_ZNK13CHuiCurvePath9GetVisualEv @ 1472 NONAME
+	_ZNK15CHuiMatrixStack7TMatrix8MultiplyER13THuiRealPoint @ 1473 NONAME
+	_ZNK6CHuiGc10ProjectionEv @ 1474 NONAME
+	_ZNK6CHuiGc11DisplayAreaEv @ 1475 NONAME
+	_ZNK6CHuiGc11OrientationEv @ 1476 NONAME
+	_ZNK6CHuiGc12UnOrientRectERK5TRect @ 1477 NONAME
+	_ZNK6CHuiGc13FrustumOffsetEv @ 1478 NONAME
+	_ZNK6CHuiGc13PenColorAlphaEv @ 1479 NONAME
+	_ZNK6CHuiGc14RawDisplayAreaEv @ 1480 NONAME
+	_ZNK6CHuiGc18ProjectionViewportEv @ 1481 NONAME
+	_ZNK6CHuiGc20WindowTransformationEv @ 1482 NONAME
+	_ZNK6CHuiGc7QualityEv @ 1483 NONAME
+	_ZNK6CHuiGc8ClipRectEv @ 1484 NONAME
+	_ZNK6CHuiGc8PenAlphaEv @ 1485 NONAME
+	_ZNK6CHuiGc8PenColorEv @ 1486 NONAME
+	_ZThn12_NK11CHuiTexture16GetShadowTextureER17THuiTextureHandle @ 1487 NONAME ; #<thunk>#
+	_ZThn4_N11CHuiTexture16TextureExtensionERK4TUidPPv @ 1488 NONAME ; #<thunk>#
+	_ZThn4_N13CHuiCurvePath27MappingFunctionClearChangedEv @ 1489 NONAME ; #<thunk>#
+	_ZThn4_NK13CHuiCurvePath22MappingFunctionChangedEv @ 1490 NONAME ; #<thunk>#
+	_ZThn4_NK13CHuiCurvePath8MapValueEfi @ 1491 NONAME ; #<thunk>#
+	_ZN10CHuiStatic14Gles20RendererEv @ 1492 NONAME
+	_ZN10CHuiStatic12Vg10RendererEv @ 1493 NONAME
+	_ZN10CHuiStatic14Gles11RendererEv @ 1494 NONAME
+	_ZN11CHuiM3GMesh20SetAnimationPositionEifi @ 1495 NONAME
+	_ZN11CHuiM3GMesh23StopAnimationControllerEi @ 1496 NONAME
+	_ZN11CHuiM3GMesh24StartAnimationControllerEi @ 1497 NONAME
+	_ZN6CHuiGc10DrawImagesERK9THuiImageS2_RK12THuiRealSizeRK12THuiRealRect @ 1498 NONAME
+	_ZN6CHuiGc10DrawImagesERK9THuiImageS2_RK13THuiRealPointRK12THuiRealSize @ 1499 NONAME
+	_ZN6CHuiGc9DrawImageERK9THuiImageRK12THuiRealRect @ 1500 NONAME
+	_ZN6CHuiGc9DrawImageERK9THuiImageRK12THuiRealSizeRK12THuiRealRect @ 1501 NONAME
+	_ZN6CHuiGc9DrawImageERK9THuiImageRK13THuiRealPointRK12THuiRealSize @ 1502 NONAME
+	_ZN8CHuiMesh23StopAnimationControllerEi @ 1503 NONAME
+	_ZN8CHuiMesh24StartAnimationControllerEi @ 1504 NONAME
+	_ZNK11CHuiDisplay5UsageEv @ 1505 NONAME
+	_ZNK11CHuiTexture13SegmentOffsetEi @ 1506 NONAME
+	_ZNK6CHuiGc15FarClipDistanceEv @ 1507 NONAME
+	_ZNK6CHuiGc16NearClipDistanceEv @ 1508 NONAME
+	_ZTI11CHuiM3GMesh @ 1509 NONAME ; #<TI>#
+	_ZTI13CHuiCurvePath @ 1510 NONAME ; #<TI>#
+	_ZTI17MHuiRenderSurface @ 1511 NONAME ; #<TI>#
+	_ZTI18CHuiProceduralMesh @ 1512 NONAME ; #<TI>#
+	_ZTI18CHuiTextureManager @ 1513 NONAME ; #<TI>#
+	_ZTI20CHuiTextureProcessor @ 1514 NONAME ; #<TI>#
+	_ZTI6CHuiGc @ 1515 NONAME ; #<TI>#
+	_ZTV11CHuiM3GMesh @ 1516 NONAME ; #<VT>#
+	_ZTV13CHuiCurvePath @ 1517 NONAME ; #<VT>#
+	_ZTV17MHuiRenderSurface @ 1518 NONAME ; #<VT>#
+	_ZTV18CHuiProceduralMesh @ 1519 NONAME ; #<VT>#
+	_ZTV18CHuiTextureManager @ 1520 NONAME ; #<VT>#
+	_ZTV20CHuiTextureProcessor @ 1521 NONAME ; #<VT>#
+	_ZTV6CHuiGc @ 1522 NONAME ; #<VT>#
+	_ZThn8_NK11CHuiTexture13SegmentOffsetEi @ 1523 NONAME ; #<thunk>#
+	_ZN7CHuiEnv15EnableDebugFlagEj @ 1524 NONAME
+	_ZN11CHuiM3GMesh10LoadSceneLERK7TDesC16 @ 1525 NONAME
+	_ZN13CHuiCurvePath14SetNeedsUpdateEv @ 1526 NONAME
+	_ZN18CHuiProceduralMesh13UpdateSurfaceEff @ 1527 NONAME
+	_ZN18CHuiTextureManager12TextureEntryEi @ 1528 NONAME
+	_ZN18CHuiTextureManager13CTextureEntryD0Ev @ 1529 NONAME
+	_ZN18CHuiTextureManager13CTextureEntryD1Ev @ 1530 NONAME
+	_ZN18CHuiTextureManager13CTextureEntryD2Ev @ 1531 NONAME
+	_ZN18CHuiTextureManager18NotifySkinChangedLEv @ 1532 NONAME
+	_ZN18CHuiTextureManager20ClearChangedTexturesEv @ 1533 NONAME
+	_ZN18CHuiTextureManager21SetHasChangedTexturesEv @ 1534 NONAME
+	_ZN18CHuiTextureManager24AddAnimatedTextureGroupLERK6RArrayIiE @ 1535 NONAME
+	_ZN18CHuiTextureManager26EnableTexMemoryCalculationEi @ 1536 NONAME
+	_ZN18CHuiTextureManager26RemoveAnimatedTextureGroupEi @ 1537 NONAME
+	_ZN20CHuiTextureProcessor3EnvEv @ 1538 NONAME
+	_ZN6CHuiGc11SetPenAlphaEi @ 1539 NONAME
+	_ZN6CHuiGc13SetProjectionENS_11TProjectionE @ 1540 NONAME
+	_ZN6CHuiGc13SetProjectionENS_11TProjectionERK5TRect @ 1541 NONAME
+	_ZN6CHuiGc14SetDisplayAreaERK5TRect @ 1542 NONAME
+	_ZN6CHuiGc14SetOrientationENS_12TOrientationE @ 1543 NONAME
+	_ZN6CHuiGc16SetFrustumOffsetERK13THuiRealPoint @ 1544 NONAME
+	_ZN6CHuiGc16SetPenColorAlphaERK4TRgb @ 1545 NONAME
+	_ZN6CHuiGc19LocaleTextAlignmentEv @ 1546 NONAME
+	_ZN6CHuiGc23SetWindowTransformationEP18CHuiTransformation @ 1547 NONAME
+	_ZN6CHuiGc24NotifyImagePreferredSizeERK9THuiImage12THuiRealRect @ 1548 NONAME
+	_ZN6CHuiGc4FontEv @ 1549 NONAME
+	_ZN6CHuiGc7SetFontER8THuiFont @ 1550 NONAME
+	_ZN6CHuiGc8SetAlignE19THuiAlignHorizontal17THuiAlignVertical @ 1551 NONAME
+	_ZNK11CHuiM3GMesh4DrawER6CHuiGcPK9THuiImageS4_f @ 1552 NONAME
+	_ZNK13CHuiCurvePath15CalculateLengthEv @ 1553 NONAME
+	_ZNK13CHuiCurvePath15IsLegacyApiUsedEv @ 1554 NONAME
+	_ZNK13CHuiCurvePath4DrawERK6TPointP6CHuiGc @ 1555 NONAME
+	_ZNK13CHuiCurvePath9SetVisualEPK10CHuiVisual @ 1556 NONAME
+	_ZNK18CHuiProceduralMesh4DrawER6CHuiGcPK9THuiImageS4_f @ 1557 NONAME
+	_ZNK18CHuiTextureManager11AdvanceTimeEf @ 1558 NONAME
+	_ZNK18CHuiTextureManager12CheckTextureERK7TDesC16i @ 1559 NONAME
+	_ZNK18CHuiTextureManager12CheckTextureEi @ 1560 NONAME
+	_ZNK18CHuiTextureManager17TextureEntryCountEv @ 1561 NONAME
+	_ZNK18CHuiTextureManager19NotifyTextureLoadedER11CHuiTextureii @ 1562 NONAME
+	_ZNK6CHuiGc11AlignOffsetERK5TSize @ 1563 NONAME
+	_ZNK6CHuiGc13AlignVerticalEv @ 1564 NONAME
+	_ZNK6CHuiGc14ClipStackCountEv @ 1565 NONAME
+	_ZNK6CHuiGc15AlignHorizontalEv @ 1566 NONAME
+	_ZNK6CHuiGc8Offset2DEv @ 1567 NONAME
+	_ZNK6CHuiGc9FovFactorEv @ 1568 NONAME
+	_ZThn4_N18CHuiTextureManager13CTextureEntryD1Ev @ 1569 NONAME ; #<thunk>#
+	_ZN16CHuiRenderPlugin11CreateMeshLE12THuiMeshType @ 1570 NONAME
+	_ZN16CHuiRenderPlugin14CreateTextureLEPK17THuiTextureHandle @ 1571 NONAME
+	_ZN16CHuiRenderPlugin15CreateTextureLCEPK17THuiTextureHandle @ 1572 NONAME
+	_ZN16CHuiRenderPlugin16CreateCurvePathLEv @ 1573 NONAME
+	_ZN16CHuiRenderPlugin18DeleteNamedTextureEj @ 1574 NONAME
+	_ZN16CHuiRenderPlugin19NotifyDisplayCountLEj @ 1575 NONAME
+	_ZN16CHuiRenderPlugin20CreateRenderSurfaceLER11CHuiDisplay @ 1576 NONAME
+	_ZN16CHuiRenderPlugin21CreateTextureManagerLER7CHuiEnv @ 1577 NONAME
+	_ZN16CHuiRenderPlugin22DisableOffScreenBitmapEv @ 1578 NONAME
+	_ZN16CHuiRenderPlugin22EnableOffScreenBitmapLEi @ 1579 NONAME
+	_ZN16CHuiRenderPlugin22UpdateOffScreenBitmapLER11CHuiDisplay @ 1580 NONAME
+	_ZN16CHuiRenderPlugin28DrawOffScreenBitmapToWindowLER11CHuiDisplay @ 1581 NONAME
+	_ZN16CHuiRenderPlugin7ReleaseEv @ 1582 NONAME
+	_ZN16CHuiRenderPlugin8RestoreLEv @ 1583 NONAME
+	_ZN16CHuiRenderPlugin9CreateGcLEv @ 1584 NONAME
+	_ZN16CHuiRenderPluginC2E18THuiRenderPluginId @ 1585 NONAME
+	_ZN16CHuiRenderPluginD0Ev @ 1586 NONAME
+	_ZN16CHuiRenderPluginD1Ev @ 1587 NONAME
+	_ZN16CHuiRenderPluginD2Ev @ 1588 NONAME
+	_ZNK16CHuiRenderPlugin15OffScreenBitmapEv @ 1589 NONAME
+	_ZNK16CHuiRenderPlugin18CreateFontManagerLEv @ 1590 NONAME
+	_ZNK16CHuiRenderPlugin2IdEv @ 1591 NONAME
+	_ZNK16CHuiRenderPlugin6AllowsE21THuiRenderPluginAllow @ 1592 NONAME
+	_ZTI16CHuiRenderPlugin @ 1593 NONAME ; #<TI>#
+	_ZTV16CHuiRenderPlugin @ 1594 NONAME ; #<VT>#
+	_ZN6CHuiGc30EnableTransformedClippingRectsEi @ 1595 NONAME
+	_ZN6CHuiGc7SetClipERK5TRecti @ 1596 NONAME
+	_ZN6CHuiGc18TransformDirtyRectER12THuiRealRect @ 1597 NONAME
+	_ZN11CHuiM3GMesh16M3GMeshExtensionERK4TUidPPv @ 1598 NONAME
+	_ZN13CHuiCurvePath18CurvePathExtensionERK4TUidPPv @ 1599 NONAME
+	_ZN18CHuiProceduralMesh23ProceduralMeshExtensionERK4TUidPPv @ 1600 NONAME
+	_ZN18CHuiTextureManager23TextureManagerExtensionERK4TUidPPv @ 1601 NONAME
+	_ZN20CHuiTextureProcessor25TextureProcessorExtensionERK4TUidPPv @ 1602 NONAME
+	_ZN6CHuiGc11GcExtensionERK4TUidPPv @ 1603 NONAME
+	_ZN16CHuiRenderPlugin21RenderPluginExtensionERK4TUidPPv @ 1604 NONAME
+	_ZNK15CHuiMatrixStack5CountEv @ 1605 NONAME
+	_ZN12CHuiCanvasGc10DrawPointsER6RArrayI13THuiRealPointE @ 1606 NONAME
+	_ZN12CHuiCanvasGc10SetOpacityERKf @ 1607 NONAME
+	_ZN12CHuiCanvasGc11DrawEllipseERK12THuiRealRect @ 1608 NONAME
+	_ZN12CHuiCanvasGc11DrawPolygonER6RArrayI13THuiRealPointE @ 1609 NONAME
+	_ZN12CHuiCanvasGc11SetDefaultsEv @ 1610 NONAME
+	_ZN12CHuiCanvasGc11SetPenColorERK4TRgb @ 1611 NONAME
+	_ZN12CHuiCanvasGc11SetPenWidthERKf @ 1612 NONAME
+	_ZN12CHuiCanvasGc12LoadIdentityEv @ 1613 NONAME
+	_ZN12CHuiCanvasGc12SetTextAlignE19THuiAlignHorizontal17THuiAlignVertical @ 1614 NONAME
+	_ZN12CHuiCanvasGc12SetTextStyleEi @ 1615 NONAME
+	_ZN12CHuiCanvasGc18SetPolygonDrawModeE12THuiFillMode @ 1616 NONAME
+	_ZN12CHuiCanvasGc5ScaleERKfS1_S1_ @ 1617 NONAME
+	_ZN12CHuiCanvasGc5SetGcER6CHuiGc @ 1618 NONAME
+	_ZN12CHuiCanvasGc6RotateERKfS1_S1_S1_ @ 1619 NONAME
+	_ZN12CHuiCanvasGc8DrawTextERK12CHuiTextMeshRK12THuiRealRect @ 1620 NONAME
+	_ZN12CHuiCanvasGc9DrawImageERK11CHuiTextureRK12THuiRealRect @ 1621 NONAME
+	_ZN12CHuiCanvasGc9DrawLinesER6RArrayI12THuiRealLineE @ 1622 NONAME
+	_ZN12CHuiCanvasGc9DrawRectsER6RArrayI12THuiRealRectE @ 1623 NONAME
+	_ZN12CHuiCanvasGc9SetVisualERK16CHuiCanvasVisual @ 1624 NONAME
+	_ZN12CHuiCanvasGc9TranslateERKfS1_S1_ @ 1625 NONAME
+	_ZN12CHuiCanvasGcC1Ev @ 1626 NONAME
+	_ZN12CHuiCanvasGcC2Ev @ 1627 NONAME
+	_ZN12CHuiCanvasGcD0Ev @ 1628 NONAME
+	_ZN12CHuiCanvasGcD1Ev @ 1629 NONAME
+	_ZN12CHuiCanvasGcD2Ev @ 1630 NONAME
+	_ZN16CHuiCanvasVisual14SetCommandSetLERK6TDesC8 @ 1631 NONAME
+	_ZN16CHuiCanvasVisual7AddNewLER11CHuiControlP10CHuiLayout @ 1632 NONAME
+	_ZN16CHuiRenderPlugin15CreateCanvasGcLEv @ 1633 NONAME
+	_ZNK12CHuiCanvasGc17TextVerticalAlignEv @ 1634 NONAME
+	_ZNK12CHuiCanvasGc19TextHorizontalAlignEv @ 1635 NONAME
+	_ZNK12CHuiCanvasGc8PenWidthEv @ 1636 NONAME
+	_ZNK12CHuiCanvasGc9TextStyleEv @ 1637 NONAME
+	_ZTI12CHuiCanvasGc @ 1638 NONAME ; #<TI>#
+	_ZTV12CHuiCanvasGc @ 1639 NONAME ; #<VT>#
+	_ZN10CHuiStatic14BitgdiRendererEv @ 1640 NONAME
+	_ZN12CHuiCanvasGc9DrawImageERK11CHuiTextureRK12THuiRealRectS5_ @ 1641 NONAME
+	_ZN16CHuiCanvasVisual10ClearCacheEv @ 1642 NONAME
+	_ZN16CHuiCanvasVisual14AddCommandSetLERK6TDesC8 @ 1643 NONAME
+	_ZN16CHuiCanvasVisual14SetCommandTypeEi @ 1644 NONAME
+	_ZN16CHuiCanvasVisual15ClearCommandSetEv @ 1645 NONAME
+	_ZNK12CHuiCanvasGc15PolygonDrawModeEv @ 1646 NONAME
+	_ZTI25CHuiCanvasCmdBufferReader @ 1647 NONAME ; #<TI>#
+	_ZTV25CHuiCanvasCmdBufferReader @ 1648 NONAME ; #<VT>#
+	_ZN12CHuiCanvasGc9DrawImageERK11CHuiTextureRK12THuiRealRectS5_N6CHuiGc12TStretchModeE @ 1649 NONAME
+	_ZN7HuiUtil29GetValueFromCentralRepositoryEmRi @ 1650 NONAME
+	_ZN16CHuiCanvasVisual21AddPartialCommandSetLERK6TDesC8i @ 1651 NONAME
+	_ZTI22CHuiCanvasTextureCache @ 1652 NONAME ; #<TI>#
+	_ZTV22CHuiCanvasTextureCache @ 1653 NONAME ; #<VT>#
+	_ZN12CHuiCanvasGc4ClipERK5TRect @ 1654 NONAME
+	_ZN12CHuiCanvasGc23ClearWithSkinBackgroundERK12THuiRealRect @ 1655 NONAME
+	_ZN12CHuiCanvasGc24ClearWithBackgroundItemsERK12THuiRealRectRK6RArrayI25THuiDisplayBackgroundItemE @ 1656 NONAME
+	_ZN12CHuiCanvasGc5ClearERK12THuiRealRect @ 1657 NONAME
+	_ZN16CHuiCanvasVisual18SetBackgroundColorERK4TRgb @ 1658 NONAME
+	_ZN16CHuiCanvasVisual18SetClearBackgroundEN11CHuiDisplay10TClearModeE @ 1659 NONAME
+	_ZTI20CHuiCanvasBackground @ 1660 NONAME ; #<TI>#
+	_ZTV20CHuiCanvasBackground @ 1661 NONAME ; #<VT>#
+	_ZN12CHuiCanvasGc22EnableBlendingIfNeededEPK11CHuiTexture @ 1662 NONAME
+	_ZN16CHuiCanvasVisual18SetBackgroundItemsERK6RArrayI25THuiDisplayBackgroundItemE @ 1663 NONAME
+	_ZNK25THuiDisplayBackgroundItem14SkinBackgroundEv @ 1664 NONAME
+	_ZNK25THuiDisplayBackgroundItem4RectEv @ 1665 NONAME
+	_ZNK25THuiDisplayBackgroundItem5ColorEv @ 1666 NONAME
+	_ZNK25THuiDisplayBackgroundItem9ClearModeEv @ 1667 NONAME
+	_Z14GetRectForItemRK11TAknsItemIDR5TRectS3_ @ 1668 NONAME
+	_ZN11CHuiS60Skin17BackgroundTextureERK11TAknsItemID @ 1669 NONAME
+	_ZN16CHuiCanvasVisual12PrepareCacheEv @ 1670 NONAME
+	_ZNK16CHuiControlGroup10ResourceIdEv @ 1671 NONAME
+	_ZN12CHuiCanvasGc13DrawRoundRectERK12THuiRealRectRK12THuiRealSize @ 1672 NONAME
+	_ZN12CHuiCanvasGc7DrawArcERK12THuiRealRectRK13THuiRealPointS5_ @ 1673 NONAME
+	_ZN12CHuiCanvasGc7DrawPieERK12THuiRealRectRK13THuiRealPointS5_ @ 1674 NONAME
+	_ZN16CHuiRenderPlugin20CreateEffectsEngineLEv @ 1675 NONAME
+	_ZN12CHuiCanvasGc10ClipRegionERK7TRegion @ 1676 NONAME
+	_ZN12CHuiCanvasGc14CancelClippingEv @ 1677 NONAME
+	_ZN6CHuiGc13SetClipRegionERK7TRegion @ 1678 NONAME
+	_ZN6CHuiGc14CancelClippingEv @ 1679 NONAME
+	_ZN16CHuiCanvasVisual11PaintedAreaEi @ 1680 NONAME
+	_ZNK16CHuiCanvasVisual16PaintedAreaCountEv @ 1681 NONAME
+	_ZN16CHuiCanvasVisual14SetCanvasFlagsEi @ 1682 NONAME
+	_ZN16CHuiCanvasVisual16ClearCanvasFlagsEi @ 1683 NONAME
+	_ZN16CHuiCanvasVisual19SetCapturingBufferLEP10CFbsBitmap @ 1684 NONAME
+	_ZNK14CHuiImageBrush5ImageEv @ 1685 NONAME
+	_ZN12CHuiCanvasGc15SetClippingModeE18THuiCanvasClipMode @ 1686 NONAME
+	_ZN12CHuiCanvasGc29EnableDelayedClippingIfNeededERK12THuiRealRect @ 1687 NONAME
+	_ZN12CHuiCanvasGc29EnableDelayedClippingIfNeededERK6RArrayI12THuiRealLineE @ 1688 NONAME
+	_ZN12CHuiCanvasGc29EnableDelayedClippingIfNeededERK6RArrayI12THuiRealRectE @ 1689 NONAME
+	_ZN12CHuiCanvasGc29EnableDelayedClippingIfNeededERK6RArrayI13THuiRealPointE @ 1690 NONAME
+	_ZN12CHuiCanvasGc30DisableDelayedClippingIfNeededEv @ 1691 NONAME
+	_ZN12CHuiCanvasGc5SetupEv @ 1692 NONAME
+	_ZN12CHuiCanvasGc7CleanupEv @ 1693 NONAME
+	_ZN12CHuiCanvasGc8ClipNextEv @ 1694 NONAME
+	_ZNK12CHuiCanvasGc20MaxNumberOfClipRectsEv @ 1695 NONAME
+	_ZNK12CHuiCanvasGc9IsClippedERK5TRect @ 1696 NONAME
+	_ZNK12CHuiCanvasGc9IsClippedERK6TPoint @ 1697 NONAME
+	_ZN6CHuiGc4ClipERK7TRegion @ 1698 NONAME
+	_ZN12CHuiCanvasGc11DoDrawLinesER6RArrayI12THuiRealLineE @ 1699 NONAME
+	_ZN12CHuiCanvasGc11DoDrawRectsER6RArrayI12THuiRealRectE @ 1700 NONAME
+	_ZN12CHuiCanvasGc12DoDrawPointsER6RArrayI13THuiRealPointE @ 1701 NONAME
+	_ZN12CHuiCanvasGc13DoDrawPolygonER6RArrayI13THuiRealPointE @ 1702 NONAME
+	_ZN12CHuiCanvasGc15DoDrawRoundRectERK12THuiRealRectRK12THuiRealSize @ 1703 NONAME
+	_ZN12CHuiCanvasGc9DoDrawArcERK12THuiRealRectRK13THuiRealPointS5_ @ 1704 NONAME
+	_ZN12CHuiCanvasGc9DoDrawPieERK12THuiRealRectRK13THuiRealPointS5_ @ 1705 NONAME
+	_ZNK6CHuiGc14UnOrientRegionER7TRegion @ 1706 NONAME
+	_ZN11CHuiTexture13SetNvgContentEi @ 1707 NONAME
+	_ZNK11CHuiTexture12IsNvgContentEv @ 1708 NONAME
+	_ZN9THuiImage10SetTextureERK11CHuiTexture @ 1709 NONAME
+	_ZN9THuiImageC1ERK11CHuiTextureffff @ 1710 NONAME
+	_ZN9THuiImageC2ERK11CHuiTextureffff @ 1711 NONAME
+	_ZN16CHuiCanvasVisual15ExternalContentEv @ 1712 NONAME
+	_ZN16CHuiCanvasVisual19SetExternalContentLEP10CHuiVisual @ 1713 NONAME
+	_ZN10CHuiStatic12ScreenDeviceEi @ 1714 NONAME
+	_ZN10CHuiStatic9WsSessionEv @ 1715 NONAME
+	_ZN10CHuiStatic7RootWinEi @ 1716 NONAME
+	_ZN7CHuiEnv11NewDisplayLEP7RWindowiP11CHuiDisplayi4TUid @ 1717 NONAME
+	_ZN10CHuiVisual9SetEffectEP12CHuiFxEffect @ 1718 NONAME
+	_ZN11CHuiFxLayer10ConstructLE15THuiFxLayerType @ 1719 NONAME
+	_ZN11CHuiFxLayer10VisualAreaER5TRect @ 1720 NONAME
+	_ZN11CHuiFxLayer11AdvanceTimeEf @ 1721 NONAME
+	_ZN11CHuiFxLayer12PrepareDrawLER12CHuiFxEngine @ 1722 NONAME
+	_ZN11CHuiFxLayer13SetSourceRectERK5TRect @ 1723 NONAME
+	_ZN11CHuiFxLayer13SetTargetRectERK5TRect @ 1724 NONAME
+	_ZN11CHuiFxLayer13SetVisualRectERK5TRect @ 1725 NONAME
+	_ZN11CHuiFxLayer15SetBlendingModeE18THuiFxBlendingMode @ 1726 NONAME
+	_ZN11CHuiFxLayer4TypeEv @ 1727 NONAME
+	_ZN11CHuiFxLayerC2Ev @ 1728 NONAME
+	_ZN11CHuiFxLayerD0Ev @ 1729 NONAME
+	_ZN11CHuiFxLayerD1Ev @ 1730 NONAME
+	_ZN11CHuiFxLayerD2Ev @ 1731 NONAME
+	_ZN12CHuiFxEffect10ConstructLEv @ 1732 NONAME
+	_ZN12CHuiFxEffect11AdvanceTimeEf @ 1733 NONAME
+	_ZN12CHuiFxEffect20SetEffectEndObserverEP21MAlfGfxEffectObserveri @ 1734 NONAME
+	_ZN12CHuiFxEffect4DrawER6CHuiGcRK5TRect @ 1735 NONAME
+	_ZN12CHuiFxEffect4NewLER12CHuiFxEngine @ 1736 NONAME
+	_ZN12CHuiFxEffect7ChangedEv @ 1737 NONAME
+	_ZN12CHuiFxEffect9AddLayerLEPK11CHuiFxLayer @ 1738 NONAME
+	_ZN12CHuiFxEffectD0Ev @ 1739 NONAME
+	_ZN12CHuiFxEffectD1Ev @ 1740 NONAME
+	_ZN12CHuiFxEffectD2Ev @ 1741 NONAME
+	_ZN12CHuiFxEngine10AddEffectLEP12CHuiFxEffect @ 1742 NONAME
+	_ZN12CHuiFxEngine10ConstructLE16THuiFxEngineType @ 1743 NONAME
+	_ZN12CHuiFxEngine10EngineTypeEv @ 1744 NONAME
+	_ZN12CHuiFxEngine11AdvanceTimeEf @ 1745 NONAME  	
+	_ZN12CHuiFxEngine11LoadEffectLERK7TDesC16RP12CHuiFxEffectP14MHuiEffectableP5TRectP21MAlfGfxEffectObserverii @ 1746 NONAME
+	_ZN12CHuiFxEngine12RemoveEffectEP12CHuiFxEffect @ 1747 NONAME
+	_ZN12CHuiFxEngine17GetReferenceValueE20THuiFxReferencePoint @ 1748 NONAME
+	_ZN12CHuiFxEngine19AcquireRenderbufferERK5TSize @ 1749 NONAME
+	_ZN12CHuiFxEngine19ReleaseRenderbufferEP18CHuiFxRenderbuffer @ 1750 NONAME
+	_ZN12CHuiFxEngine7ReleaseEv @ 1751 NONAME
+	_ZN12CHuiFxEngine8RestoreLEv @ 1752 NONAME
+	_ZN12CHuiFxEngineD0Ev @ 1753 NONAME
+	_ZN12CHuiFxEngineD1Ev @ 1754 NONAME
+	_ZN12CHuiFxEngineD2Ev @ 1755 NONAME
+	_ZN12CHuiFxFilter10ConstructLEv @ 1756 NONAME
+	_ZN12CHuiFxFilter11AdvanceTimeEf @ 1757 NONAME
+	_ZN12CHuiFxFilter11SetFreeFormEi @ 1758 NONAME
+	_ZN12CHuiFxFilter12PrepareDrawLER12CHuiFxEngine @ 1759 NONAME
+	_ZN12CHuiFxFilter13SetVisualRectERK5TRect @ 1760 NONAME
+	_ZN12CHuiFxFilter16ParameterChangedEv @ 1761 NONAME
+	_ZN12CHuiFxFilter18RegisterParameterLERK7TDesC16P4TRgb @ 1762 NONAME
+	_ZN12CHuiFxFilter18RegisterParameterLERK7TDesC16Pf @ 1763 NONAME
+	_ZN12CHuiFxFilter9ParameterERK7TDesC16 @ 1764 NONAME
+	_ZN12CHuiFxFilter9SetMarginERK5TSize @ 1765 NONAME
+	_ZN12CHuiFxFilterD0Ev @ 1766 NONAME
+	_ZN12CHuiFxFilterD1Ev @ 1767 NONAME
+	_ZN12CHuiFxFilterD2Ev @ 1768 NONAME
+	_ZN16CHuiCanvasVisual10SetChangedEv @ 1769 NONAME
+	_ZN16CHuiCanvasVisual12ClearChangedEv @ 1770 NONAME
+	_ZN16CHuiFxGroupLayer10ConstructLEi @ 1771 NONAME
+	_ZN16CHuiFxGroupLayer10VisualAreaER5TRect @ 1772 NONAME
+	_ZN16CHuiFxGroupLayer11AdvanceTimeEf @ 1773 NONAME
+	_ZN16CHuiFxGroupLayer12PrepareDrawLER12CHuiFxEngine @ 1774 NONAME
+	_ZN16CHuiFxGroupLayer4DrawER12CHuiFxEngineR6CHuiGcR18CHuiFxRenderbufferS5_ @ 1775 NONAME
+	_ZN16CHuiFxGroupLayer4NewLEi @ 1776 NONAME
+	_ZN16CHuiFxGroupLayer9AddLayerLEPK11CHuiFxLayer @ 1777 NONAME
+	_ZN16CHuiFxGroupLayerC1Ev @ 1778 NONAME
+	_ZN16CHuiFxGroupLayerC2Ev @ 1779 NONAME
+	_ZN16CHuiFxGroupLayerD0Ev @ 1780 NONAME
+	_ZN16CHuiFxGroupLayerD1Ev @ 1781 NONAME
+	_ZN16CHuiFxGroupLayerD2Ev @ 1782 NONAME
+	_ZN17CHuiFxFilterLayer10ConstructLEP12CHuiFxFilter @ 1783 NONAME
+	_ZN17CHuiFxFilterLayer11AdvanceTimeEf @ 1784 NONAME
+	_ZN17CHuiFxFilterLayer12PrepareDrawLER12CHuiFxEngine @ 1785 NONAME
+	_ZN17CHuiFxFilterLayer4DrawER12CHuiFxEngineR6CHuiGcR18CHuiFxRenderbufferS5_ @ 1786 NONAME
+	_ZN17CHuiFxVisualLayer10ConstructLER14MHuiEffectable @ 1787 NONAME
+	_ZN17CHuiFxVisualLayer10VisualAreaER5TRect @ 1788 NONAME
+	_ZN17CHuiFxVisualLayer11AdvanceTimeEf @ 1789 NONAME
+	_ZN17CHuiFxVisualLayer12PrepareDrawLER12CHuiFxEngine @ 1790 NONAME
+	_ZN17CHuiFxVisualLayer18RegisterParameterLERK7TDesC16P4TRgb @ 1791 NONAME
+	_ZN17CHuiFxVisualLayer18RegisterParameterLERK7TDesC16Pf @ 1792 NONAME
+	_ZN17CHuiFxVisualLayer4DrawER12CHuiFxEngineR6CHuiGcR18CHuiFxRenderbufferS5_ @ 1793 NONAME
+	_ZN17CHuiFxVisualLayer4NewLER14MHuiEffectable @ 1794 NONAME
+	_ZN17CHuiFxVisualLayer9ParameterERK7TDesC16 @ 1795 NONAME
+	_ZN17CHuiFxVisualLayerD0Ev @ 1796 NONAME
+	_ZN17CHuiFxVisualLayerD1Ev @ 1797 NONAME
+	_ZN17CHuiFxVisualLayerD2Ev @ 1798 NONAME
+	_ZN18CHuiFxRenderbuffer10ConstructLERK5TSize17TRenderBufferType @ 1799 NONAME
+	_ZN18CHuiFxRenderbufferC2Ev @ 1800 NONAME
+	_ZN18CHuiFxRenderbufferD0Ev @ 1801 NONAME
+	_ZN18CHuiFxRenderbufferD1Ev @ 1802 NONAME
+	_ZN18CHuiFxRenderbufferD2Ev @ 1803 NONAME
+	_ZNK10CHuiVisual6EffectEv @ 1804 NONAME
+	_ZNK11CHuiFxLayer10SourceRectEv @ 1805 NONAME
+	_ZNK11CHuiFxLayer10TargetRectEv @ 1806 NONAME
+	_ZNK11CHuiFxLayer10VisualRectEv @ 1807 NONAME
+	_ZNK11CHuiFxLayer12BlendingModeEv @ 1808 NONAME
+	_ZNK11CHuiFxLayer7ChangedEv @ 1809 NONAME
+	_ZNK12CHuiFxEffect10VisualAreaER5TRect @ 1810 NONAME
+	_ZNK12CHuiFxEffect6EngineEv @ 1811 NONAME
+	_ZNK12CHuiFxFilter10IsFreeFormEv @ 1812 NONAME
+	_ZNK12CHuiFxFilter10VisualRectEv @ 1813 NONAME
+	_ZNK12CHuiFxFilter6MarginEv @ 1814 NONAME
+	_ZNK12CHuiFxFilter7ChangedEv @ 1815 NONAME
+	_ZNK16CHuiFxGroupLayer7ChangedEv @ 1816 NONAME
+	_ZNK17CHuiFxFilterLayer6FilterEv @ 1817 NONAME
+	_ZNK17CHuiFxFilterLayer7ChangedEv @ 1818 NONAME
+	_ZNK17CHuiFxVisualLayer7ChangedEv @ 1819 NONAME
+	_ZNK18CHuiFxRenderbuffer10BufferTypeEv @ 1820 NONAME
+	_ZNK18CHuiFxRenderbuffer4SizeEv @ 1821 NONAME
+	_ZNK7CHuiEnv13EffectsEngineEv @ 1822 NONAME
+	_ZTI11CHuiFxLayer @ 1823 NONAME ; #<TI>#
+	_ZTI12CHuiFxEffect @ 1824 NONAME ; #<TI>#
+	_ZTI12CHuiFxEngine @ 1825 NONAME ; #<TI>#
+	_ZTI12CHuiFxFilter @ 1826 NONAME ; #<TI>#
+	_ZTI16CHuiFxGroupLayer @ 1827 NONAME ; #<TI>#
+	_ZTI17CHuiFxFilterLayer @ 1828 NONAME ; #<TI>#
+	_ZTI17CHuiFxVisualLayer @ 1829 NONAME ; #<TI>#
+	_ZTI18CHuiFxEffectParser @ 1830 NONAME ; #<TI>#
+	_ZTI18CHuiFxRenderbuffer @ 1831 NONAME ; #<TI>#
+	_ZTI22CHuiFxGenericParameterI4TRgb14RHuiFxTimeLineIS0_mEL19THuiFxParameterType1EE @ 1832 NONAME ; #<TI>#
+	_ZTI22CHuiFxGenericParameterIf14RHuiFxTimeLineIflEL19THuiFxParameterType0EE @ 1833 NONAME ; #<TI>#
+	_ZTI22CHuiFxParameterManager @ 1834 NONAME ; #<TI>#
+	_ZTV11CHuiFxLayer @ 1835 NONAME ; #<VT>#
+	_ZTV12CHuiFxEffect @ 1836 NONAME ; #<VT>#
+	_ZTV12CHuiFxEngine @ 1837 NONAME ; #<VT>#
+	_ZTV12CHuiFxFilter @ 1838 NONAME ; #<VT>#
+	_ZTV16CHuiFxGroupLayer @ 1839 NONAME ; #<VT>#
+	_ZTV17CHuiFxFilterLayer @ 1840 NONAME ; #<VT>#
+	_ZTV17CHuiFxVisualLayer @ 1841 NONAME ; #<VT>#
+	_ZTV18CHuiFxEffectParser @ 1842 NONAME ; #<VT>#
+	_ZTV18CHuiFxRenderbuffer @ 1843 NONAME ; #<VT>#
+	_ZTV22CHuiFxGenericParameterI4TRgb14RHuiFxTimeLineIS0_mEL19THuiFxParameterType1EE @ 1844 NONAME ; #<VT>#
+	_ZTV22CHuiFxGenericParameterIf14RHuiFxTimeLineIflEL19THuiFxParameterType0EE @ 1845 NONAME ; #<VT>#
+	_ZTV22CHuiFxParameterManager @ 1846 NONAME ; #<VT>#
+	_ZThn4_N12CHuiFxFilter9ParameterERK7TDesC16 @ 1847 NONAME ; #<thunk>#
+	_ZN10CHuiStatic12SkinInstanceEv @ 1848 NONAME
+	_ZN16CHuiCanvasVisual18SetTrackCommandSetER4TBufILi256EEi @ 1849 NONAME
+	_ZN12CHuiCanvasGc18DoDrawRenderBufferERK22CHuiCanvasRenderBufferRK13THuiRealPoint @ 1850 NONAME
+	_ZN12CHuiCanvasGc19CreateRenderBufferLERK5TSize @ 1851 NONAME
+	_ZN12CHuiCanvasGc23PopTransformationMatrixEv @ 1852 NONAME
+	_ZN12CHuiCanvasGc24PushTransformationMatrixEv @ 1853 NONAME
+	_ZN12CHuiCanvasGc9DrawImageERK22CHuiCanvasRenderBufferRK13THuiRealPoint @ 1854 NONAME
+	_ZN22CHuiCanvasRenderBuffer11InitializeLERK5TSize @ 1855 NONAME
+	_ZN22CHuiCanvasRenderBuffer12UnInitializeEv @ 1856 NONAME
+	_ZN22CHuiCanvasRenderBuffer4BindEv @ 1857 NONAME
+	_ZN22CHuiCanvasRenderBuffer6UnBindEv @ 1858 NONAME
+	_ZN22CHuiCanvasRenderBufferC1Ev @ 1859 NONAME
+	_ZN22CHuiCanvasRenderBufferC2Ev @ 1860 NONAME
+	_ZN22CHuiCanvasRenderBufferD0Ev @ 1861 NONAME
+	_ZN22CHuiCanvasRenderBufferD1Ev @ 1862 NONAME
+	_ZN22CHuiCanvasRenderBufferD2Ev @ 1863 NONAME
+	_ZTI22CHuiCanvasRenderBuffer @ 1864 NONAME ; #<TI>#
+	_ZTV22CHuiCanvasRenderBuffer @ 1865 NONAME ; #<VT>#
+	_ZN12CHuiCanvasGc11SetDrawModeE18THuiCanvasDrawMode @ 1866 NONAME
+	_ZN8THuiFont11ReleaseFontEv @ 1867 NONAME
+	_ZN8THuiFont11SetCategoryE16TAknFontCategory @ 1868 NONAME
+	_ZN8THuiFont11SetFontSpecERK9TFontSpec @ 1869 NONAME
+	_ZN8THuiFont12LineExtentsLERK7TDesC16 @ 1870 NONAME
+	_ZN8THuiFont12NearestFontLEf @ 1871 NONAME
+	_ZN8THuiFont14RasterizeLineLERK7TDesC16R9CFbsBitGc @ 1872 NONAME
+	_ZN8THuiFont17SetTextPaneHeightEi @ 1873 NONAME
+	_ZNK8THuiFont14TextPaneHeightEv @ 1874 NONAME
+	_ZN14CHuiTextVisual11UpdateMeshLERK6TDesC8 @ 1875 NONAME
+	_ZN16CHuiRenderPlugin20AddRestoreStateFlagsEi @ 1876 NONAME
+	_ZN16CHuiRenderPlugin20GetRestoreStateFlagsEv @ 1877 NONAME
+	_ZN16CHuiRenderPlugin22ClearRestoreStateFlagsEv @ 1878 NONAME
+	_ZN12CHuiFxEffect11EffectFlagsEv @ 1879 NONAME
+	_ZN12CHuiFxEffect14SetEffectFlagsEi @ 1880 NONAME
+	_ZN7CHuiEnv15NotifyLowMemoryEi @ 1881 NONAME
+	_ZN7CHuiEnv20AddLowMemoryObserverEP21MHuiLowMemoryObserver @ 1882 NONAME
+	_ZN7CHuiEnv23RemoveLowMemoryObserverEP21MHuiLowMemoryObserver @ 1883 NONAME
+	_ZN12CHuiFxEngine20EnableLowMemoryStateEi @ 1884 NONAME
+	_ZThn4_N12CHuiFxEngine20EnableLowMemoryStateEi @ 1885 NONAME ; #<thunk>#
+	_ZN11CHuiFxLayer6MarginER8TMargins @ 1886 NONAME
+	_ZN16CHuiFxGroupLayer11ApplyMarginER5TRect @ 1887 NONAME
+	_ZN16CHuiFxGroupLayer6MarginER8TMargins @ 1888 NONAME
+	_ZN17CHuiFxFilterLayer6MarginER8TMargins @ 1889 NONAME
+	_ZN17CHuiFxVisualLayer6MarginER8TMargins @ 1890 NONAME
+	_ZNK12CHuiFxFilter15CalculateMarginER8TMargins @ 1891 NONAME
+	_ZNK12CHuiFxFilter7Margin2Ev @ 1892 NONAME
+	_ZN11CHuiFxLayer9CopyFromLEPKS_ @ 1893 NONAME
+	_ZN12CHuiFxEffect10SetExtRectEP5TRect @ 1894 NONAME
+	_ZN12CHuiFxEffect9SetEngineEP12CHuiFxEngine @ 1895 NONAME
+	_ZN12CHuiFxEffect9SetVisualEP10CHuiVisual @ 1896 NONAME
+	_ZN12CHuiFxFilter14CopyParameterLERK7TDesC16P4TRgbPKS_ @ 1897 NONAME
+	_ZN12CHuiFxFilter14CopyParameterLERK7TDesC16PfPKS_ @ 1898 NONAME
+	_ZN12CHuiFxFilter9CopyFromLEPKS_ @ 1899 NONAME
+	_ZN16CHuiFxGroupLayer10SetExtRectEP5TRect @ 1900 NONAME
+	_ZN16CHuiFxGroupLayer9SetVisualEP10CHuiVisual @ 1901 NONAME
+	_ZN17CHuiFxFilterLayer10SetExtRectEP5TRect @ 1902 NONAME
+	_ZN17CHuiFxFilterLayer9SetVisualEP10CHuiVisual @ 1903 NONAME
+	_ZN17CHuiFxVisualLayer10SetExtRectEP5TRect @ 1904 NONAME
+	_ZN17CHuiFxVisualLayer9SetVisualEP10CHuiVisual @ 1905 NONAME
+	_ZNK12CHuiFxEffect6CloneLEv @ 1906 NONAME
+	_ZNK16CHuiFxGroupLayer6CloneLEv @ 1907 NONAME
+	_ZNK17CHuiFxFilterLayer6CloneLEv @ 1908 NONAME
+	_ZNK17CHuiFxVisualLayer6CloneLEv @ 1909 NONAME
+	_ZTI17CHuiFxEffectCache @ 1910 NONAME ; #<TI>#
+	_ZTI27CHuiFxEffectCacheEffectNode @ 1911 NONAME ; #<TI>#
+	_ZTV17CHuiFxEffectCache @ 1912 NONAME ; #<VT>#
+	_ZTV27CHuiFxEffectCacheEffectNode @ 1913 NONAME ; #<VT>#
+	_ZN12CHuiFxEngine15RegisterEffectLERK7TDesC16 @ 1914 NONAME
+	_ZN12CHuiFxEngine17UnRegisterEffectLERK7TDesC16 @ 1915 NONAME
+	_ZN11CHuiFxLayer14SetDisplayAreaERK5TRect @ 1916 NONAME
+	_ZN12CHuiFxEngine9CompositeER6CHuiGcR18CHuiFxRenderbufferRK6TPointii @ 1917 NONAME
+	_ZN18CHuiFxRenderbuffer11SetPositionE6TPoint @ 1918 NONAME
+	_ZNK18CHuiFxRenderbuffer8PositionEv @ 1919 NONAME
+	_ZNK12CHuiFxEffect10IsAnimatedEv @ 1920 NONAME
+	_ZNK12CHuiFxEffect13IsTransformedEv @ 1921 NONAME
+	_ZN16CHuiCanvasVisual11CanvasFlagsEv @ 1922 NONAME
+	_ZN17CHuiFxEffectCache13FindOrCreateLEP21MHuiFxEffectCacheNode @ 1923 NONAME
+	_ZNK12CHuiCanvasGc19RestoreFlaggedStateEv @ 1924 NONAME
+	_ZN16CHuiCanvasVisual15SetParentCanvasEPS_ @ 1925 NONAME
+	_ZTI18CHuiCmdBufferBrush @ 1926 NONAME
+	_ZTV18CHuiCmdBufferBrush @ 1927 NONAME
+	_ZN18CHuiFxRenderbuffer16EnableBackgroundEi @ 1928 NONAME
+	_ZN12CHuiCanvasGc17ClearRenderBufferER22CHuiCanvasRenderBufferRK5TRect @ 1929 NONAME
+	_ZN12CHuiCanvasGc19DoClearRenderBufferER22CHuiCanvasRenderBufferRK5TRect @ 1930 NONAME
+	_ZN14CHuiBrushArray15BrushWithTypeAtEii @ 1931 NONAME
+	_ZNK14CHuiBrushArray18BrushWithTypeCountEi @ 1932 NONAME
+	_ZN12CHuiFxEffect9SetVisualEP14MHuiEffectable @ 1933 NONAME
+	_ZN16CHuiFxGroupLayer9SetVisualEP14MHuiEffectable @ 1934 NONAME
+	_ZN17CHuiFxFilterLayer9SetVisualEP14MHuiEffectable @ 1935 NONAME
+	_ZN17CHuiFxVisualLayer9SetVisualEP14MHuiEffectable @ 1936 NONAME
+	_ZNK10CHuiVisual10EffectableEv @ 1937 NONAME
+	_ZTI14CHuiEffectable @ 1938 NONAME
+	_ZTV14CHuiEffectable @ 1939 NONAME
+	_ZNK16CHuiCanvasVisual26IsBackgroundDrawingEnabledEv @ 1940 NONAME
+	_ZNK22CHuiCanvasRenderBuffer4SizeEv @ 1941 NONAME
+	_ZN22CHuiCanvasRenderBuffer4CopyERKS_ @ 1942 NONAME
+	_ZNK22CHuiCanvasRenderBuffer13IsInitializedEv @ 1943 NONAME
+	_ZN16CHuiCanvasVisual16FreeRenderBufferEv @ 1944 NONAME
+	_ZN16CHuiCanvasVisual18StoreRenderBufferLEv @ 1945 NONAME
+	_ZTI16CHuiCanvasVisual @ 1946 NONAME
+	_ZTV16CHuiCanvasVisual @ 1947 NONAME
+	_ZN12CHuiFxEngine14FxmlUsesInput1ERK7TDesC16 @ 1948 NONAME
+	_ZN16CHuiCanvasVisual11LayerExtentEv @ 1949 NONAME
+	_ZN16CHuiCanvasVisual14SetLayerExtentER5TRect @ 1950 NONAME
+	_ZN16CHuiCanvasVisual18LayerUsesAlphaFlagEv @ 1951 NONAME
+	_ZN16CHuiCanvasVisual21SetLayerUsesAlphaFlagEi @ 1952 NONAME
+	_ZN10CHuiVisual21SetStoredRenderBufferEP22CHuiCanvasRenderBuffer @ 1953 NONAME
+	_ZN22CHuiCanvasRenderBuffer4CopyE6TPoint @ 1954 NONAME
+	_ZNK10CHuiVisual18StoredRenderBufferEv @ 1955 NONAME
+	_ZN10CHuiVisual14SetFreezeStateEi @ 1956 NONAME
+	_ZN10CHuiVisual41SetStoredRenderBufferModificationsEnabledEi @ 1957 NONAME
+	_ZN12CHuiCanvasGc21SetPolygonFillTextureEP11CHuiTexture @ 1958 NONAME
+	_ZNK12CHuiCanvasGc18PolygonFillTextureEv @ 1959 NONAME
+	_ZN12CHuiCanvasGc27SetPolygonFillTextureOriginERK6TPoint @ 1960 NONAME
+	_ZNK12CHuiCanvasGc24PolygonFillTextureOriginEv @ 1961 NONAME
+	_ZN7CHuiEnv11MemoryLevelEv @ 1962 NONAME
+	_ZN7CHuiEnv17NotifyMemoryLevelE15THuiMemoryLevel @ 1963 NONAME
+	_ZN7CHuiEnv22AddMemoryLevelObserverEP23MHuiMemoryLevelObserver @ 1964 NONAME
+	_ZN7CHuiEnv25RemoveMemoryLevelObserverEP23MHuiMemoryLevelObserver @ 1965 NONAME
+	_ZN11CHuiDisplay20SetForegroundTextureEP11CHuiTexture @ 1966 NONAME
+	_ZNK11CHuiDisplay17ForegroundTextureEv @ 1967 NONAME
+	_ZN12CHuiFxEffect14SetEffectGroupEi @ 1968 NONAME
+	_ZN12CHuiFxEffect7GroupIdEv @ 1969 NONAME
+	_ZN12CHuiFxEngine16BeginGroupEffectEi @ 1970 NONAME
+	_ZN12CHuiFxEngine16LoadGroupEffectLERK7TDesC16RP12CHuiFxEffectP14MHuiEffectableiP5TRectP21MAlfGfxEffectObserverii @ 1971 NONAME
+	_ZN12CHuiFxEngine16StartGroupEffectEi @ 1972 NONAME
+	_ZN12CHuiFxEngine17ActiveGroupEffectEv @ 1973 NONAME
+	_ZN12CHuiFxEngine14SetMemoryLevelE15THuiMemoryLevel @ 1974 NONAME
+	_ZThn8_N12CHuiFxEngine14SetMemoryLevelE15THuiMemoryLevel @ 1975 NONAME
+	_ZN11CHuiDisplay20SetForegroundBitmapLEP10CFbsBitmap @ 1976 NONAME
+	_ZNK11CHuiDisplay16ForegroundBitmapEv @ 1977 NONAME
+	_ZTI15MHuiFxParameter @ 1978 NONAME
+	_ZTV15MHuiFxParameter @ 1979 NONAME
+	_ZNK16CHuiCanvasVisual17HasCommandBuffersEi @ 1980 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/group/Doxyfile.txt	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,279 @@
+# Doxyfile 1.5.1-p1
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME           = "Hitchcock User Interface Toolkit"
+PROJECT_NUMBER         = 
+OUTPUT_DIRECTORY       = ../doc/api
+CREATE_SUBDIRS         = NO
+OUTPUT_LANGUAGE        = English
+USE_WINDOWS_ENCODING   = NO
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+ALWAYS_DETAILED_SEC    = NO
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        = 
+STRIP_FROM_INC_PATH    = 
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = YES
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = YES
+INHERIT_DOCS           = YES
+SEPARATE_MEMBER_PAGES  = NO
+TAB_SIZE               = 4
+ALIASES                = panic=@exception \
+                         leave=@exception \
+                         "internalTechnology=@par Internal technology" \
+                         "internalComponent=@par Internal component" \
+                         "internalAll=@par Internal all" \
+                         "publishedPartner=@par Published-partner" \
+                         "publishedAll=@par Published-all" \
+                         "prototype=@par Prototype" \
+                         "interim=@par Interim" \
+                         "released=@par Released" \
+                         "removed=@par Removed" \
+                         "test=@par Test" \
+                         "realtime=@par Realtime" \
+                         "beginAPI=@name Exported API\n @{" \
+                         endAPI=@}
+OPTIMIZE_OUTPUT_FOR_C  = NO
+OPTIMIZE_OUTPUT_JAVA   = NO
+BUILTIN_STL_SUPPORT    = NO
+DISTRIBUTE_GROUP_DOC   = NO
+SUBGROUPING            = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL            = YES
+EXTRACT_PRIVATE        = YES
+EXTRACT_STATIC         = YES
+EXTRACT_LOCAL_CLASSES  = YES
+EXTRACT_LOCAL_METHODS  = YES
+HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_CLASSES     = NO
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+INTERNAL_DOCS          = NO
+CASE_SENSE_NAMES       = NO
+HIDE_SCOPE_NAMES       = NO
+SHOW_INCLUDE_FILES     = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+SORT_BRIEF_DOCS        = YES
+SORT_BY_SCOPE_NAME     = NO
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+SHOW_USED_FILES        = YES
+SHOW_DIRECTORIES       = YES
+FILE_VERSION_FILTER    = 
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_NO_PARAMDOC       = NO
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           = 
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = ../inc \
+                         ../src \
+                         ../../client/inc \
+                         ../../client/src \
+                         /s60/mw/uiaccelerator/uiaccelerator_dom/alf_visual_api/inc/alf \
+                         /s60/mw/uiaccelerator/uiaccelerator_dom/alf_client_server_api/inc/alf \
+                         /s60/mw/uiaccelerator/uiaccelerator_dom/alf_core_toolkit_api/inc/uiacceltk \
+                         /s60/mw/uiaccelerator/uiaccelerator_dom/alf_extended_visual_api/inc/alf \
+                         /s60/mw/uiaccelerator/uiaccelerator_dom/alf_extension_api/inc/alf \
+                         /s60/mw/uiaccelerator/uiaccelerator_dom/alf_scrollbarwidget_api/inc/alf \
+                         /s60/mw/uiaccelerator/uiaccelerator_dom/alf_tracing_api/inc/alf \
+                         /s60/mw/uiaccelerator/uiaccelerator_dom/alf_tracing_api/inc/uiacceltk
+FILE_PATTERNS          = *.c \
+                         *.cc \
+                         *.cpp \
+                         *.h \
+                         *.hh \
+                         *.hrh \
+                         *.dox
+RECURSIVE              = YES
+EXCLUDE                = 
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = *Bitgdi* \
+                         *Gles10* \
+                         *Gles11* \
+                         *MatrixStack* \
+                         *blitter*
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = 
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_PATTERNS        = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = YES
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION    = YES
+REFERENCES_LINK_SOURCE = YES
+USE_HTAGS              = NO
+VERBATIM_HEADERS       = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = YES
+COLS_IN_ALPHA_INDEX    = 3
+IGNORE_PREFIX          = THui \
+                         SHui \
+                         CHui \
+                         RHui \
+                         MHui \
+                         CAlf \
+                         TAlf \
+                         MAlf \
+                         RAlf
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = 
+HTML_FOOTER            = 
+HTML_STYLESHEET        = 
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = YES
+CHM_FILE               = 
+HHC_LOCATION           = 
+GENERATE_CHI           = NO
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+DISABLE_INDEX          = NO
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = NO
+TREEVIEW_WIDTH         = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = NO
+USE_PDFLATEX           = NO
+LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = NO
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_OUTPUT             = xml
+XML_SCHEMA             = 
+XML_DTD                = 
+XML_PROGRAMLISTING     = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = YES
+EXPAND_ONLY_PREDEF     = YES
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = "NONSHARABLE_CLASS(name)=class name" \
+                         "_LIT(name,string)=const static TLitC<sizeof(L##string)/2> name={sizeof(L##string)/2-1,L##string}"
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = YES
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = NO
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = NO
+GROUP_GRAPHS           = YES
+UML_LOOK               = YES
+TEMPLATE_RELATIONS     = NO
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+CALL_GRAPH             = NO
+CALLER_GRAPH           = NO
+GRAPHICAL_HIERARCHY    = YES
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+MAX_DOT_GRAPH_WIDTH    = 1024
+MAX_DOT_GRAPH_HEIGHT   = 1024
+MAX_DOT_GRAPH_DEPTH    = 0
+DOT_TRANSPARENT        = NO
+DOT_MULTI_TARGETS      = NO
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/group/Doxyfile_internal.txt	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,269 @@
+#
+# Doxygen 1.3.6 configuration file for ?ComponentDescription
+# 
+# Copyright (C) 2005 Nokia. All rights reserved.
+# Nokia is a registered trademark of Nokia Corporation.
+#
+# $Id: Doxyfile,v 1.4 2006/01/25 13:02:23 jaakeran Exp $
+#
+
+# 
+# INSTRUCTIONS: How to Customize the Doxyfile for Your Component
+#
+# The following settings need to be customized:
+# - PROJECT_NAME (name of your component)
+# - PROJECT_NUMBER (if a version number has been assigned for the component)
+#
+# Other useful settings:
+# - IGNORE_PREFIX (prefixes ignored in the alphabetical index)
+#
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME           = "Hitchcock User Interface Toolkit"
+PROJECT_NUMBER         = 
+OUTPUT_DIRECTORY       = "../doc/api/internal"
+OUTPUT_LANGUAGE        = English
+USE_WINDOWS_ENCODING   = NO
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+ALWAYS_DETAILED_SEC    = NO
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        = 
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = YES
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = YES
+INHERIT_DOCS           = YES
+DISTRIBUTE_GROUP_DOC   = NO
+TAB_SIZE               = 4
+ALIASES                = panic=@exception \ 
+			 leave=@exception \ 
+			 "internalTechnology=@par Internal technology" \ 
+			 "internalComponent=@par Internal component" \ 
+			 "internalAll=@par Internal all" \ 
+			 "publishedPartner=@par Published-partner" \ 
+			 "publishedAll=@par Published-all" \ 
+			 "prototype=@par Prototype" \ 
+			 "interim=@par Interim" \ 
+			 "released=@par Released" \ 
+			 "removed=@par Removed" \ 
+			 "test=@par Test" \ 
+			 "realtime=@par Realtime" \
+			 "beginAPI=@name Exported API\n @{" \
+			 "endAPI=@}" 
+OPTIMIZE_OUTPUT_FOR_C  = NO
+OPTIMIZE_OUTPUT_JAVA   = NO
+SUBGROUPING            = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL            = YES
+EXTRACT_PRIVATE        = YES
+EXTRACT_STATIC         = YES
+EXTRACT_LOCAL_CLASSES  = YES
+EXTRACT_LOCAL_METHODS  = YES
+HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_CLASSES     = NO
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+INTERNAL_DOCS          = NO
+CASE_SENSE_NAMES       = NO
+HIDE_SCOPE_NAMES       = NO
+SHOW_INCLUDE_FILES     = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+SORT_BRIEF_DOCS        = YES
+SORT_BY_SCOPE_NAME     = NO
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+SHOW_USED_FILES        = YES
+SHOW_DIRECTORIES       = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           = 
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = ../inc ../src
+                         Z:/projects/uiaccelerator-clean/uiaccelerator/uiaccelerator_dom/alf_visual_api/inc/alf \
+                         Z:/projects/uiaccelerator-clean/uiaccelerator/uiaccelerator_dom/alf_client_server_api/inc/alf \
+                         Z:/projects/uiaccelerator-clean/uiaccelerator/uiaccelerator_dom/alf_core_toolkit_api/inc/uiacceltk \
+                         Z:/projects/uiaccelerator-clean/uiaccelerator/uiaccelerator_dom/alf_extended_visual_api/inc/alf \
+                         Z:/projects/uiaccelerator-clean/uiaccelerator/uiaccelerator_dom/alf_extension_api/inc/alf \
+                         Z:/projects/uiaccelerator-clean/uiaccelerator/uiaccelerator_dom/alf_scrollbarwidget_api/inc/alf \
+                         Z:/projects/uiaccelerator-clean/uiaccelerator/uiaccelerator_dom/alf_tracing_api/inc/alf \
+                         Z:/projects/uiaccelerator-clean/uiaccelerator/uiaccelerator_dom/alf_tracing_api/inc/uiacceltk
+FILE_PATTERNS          = *.c \
+                         *.cc \
+                         *.cpp \
+                         *.h \
+                         *.hh \
+                         *.hrh \
+                         *.dox
+RECURSIVE              = YES
+EXCLUDE                = 
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = 
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = YES
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION    = YES
+VERBATIM_HEADERS       = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = YES
+COLS_IN_ALPHA_INDEX    = 3
+IGNORE_PREFIX          = "THui" "SHui" "CHui" "RHui" "MHui"
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = 
+HTML_FOOTER            = 
+HTML_STYLESHEET        = 
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = YES
+CHM_FILE               = 
+HHC_LOCATION           = 
+GENERATE_CHI           = NO
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+DISABLE_INDEX          = NO
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = NO
+TREEVIEW_WIDTH         = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = NO
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = NO
+USE_PDFLATEX           = NO
+LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = NO
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_OUTPUT             = xml
+XML_SCHEMA             = 
+XML_DTD                = 
+XML_PROGRAMLISTING     = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION      = YES
+EXPAND_ONLY_PREDEF   = YES
+PREDEFINED           = "NONSHARABLE_CLASS(name)=class name" \
+                       "_LIT(name,string)=const static TLitC<sizeof(L##string)/2> name={sizeof(L##string)/2-1,L##string}"
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = YES
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = NO
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = NO
+UML_LOOK               = YES
+TEMPLATE_RELATIONS     = NO
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+CALL_GRAPH             = NO
+GRAPHICAL_HIERARCHY    = YES
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+MAX_DOT_GRAPH_WIDTH    = 1024
+MAX_DOT_GRAPH_HEIGHT   = 1024
+MAX_DOT_GRAPH_DEPTH    = 0
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Build information file for project Hitchcock Core DLL
+*
+*/
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+
+#ifndef MW_LAYER_PLATFORM_EXPORT_PATH_ACCTK
+#define MW_LAYER_PLATFORM_EXPORT_PATH_ACCTK(exported) /epoc32/include/uiacceltk/##exported
+#endif
+
+PRJ_EXPORTS
+// coretoolkit exported API headers
+#include "../../group/core_exports.inc"
+
+PRJ_MMPFILES
+// This is the mmp for internal SDKs
+coretoolkit.mmp
+../renderbitgdi/group/huirenderbitgdi.mmp
+../rendergles/group/huirendergles.mmp
+../rendervg10/group/huirendervg10.mmp
+// the next two are new plugins, not in official builds yet
+// as some needed libraries and headers may be missing.
+// Before you uncomment these you must extract the libraries and headers
+// 
+// Emulator versions shoul compile but will not work because of lack of
+// proper libraries.
+#ifdef MARM
+//../rendergles20/group/huirendergles20.mmp
+../rendervg10/group/huirendervg10.mmp
+#endif
+
+// Tests & Test resources
+// @todo Migrated code no longer contains tests.
+//#include "bld_testfiles.inc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/group/bld_publicsdk.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Build information file for project Hitchcock Core DLL
+*
+*/
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+// HUITK exported API headers
+#include "../inc/exports.inc"
+
+PRJ_MMPFILES
+// This is the mmp for public SDKs
+huitk_publicsdk.mmp
+
+// Tests & Test resources
+#include "bld_testfiles.inc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/group/coretoolkit.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project Hitchcock Core
+*
+*/
+
+
+
+// There is a bug that CScreen::DisplayMode() returns non-alpha display mode (TSW error: ??)
+// That is why WServ clears the window with the color that is opaque (0xFF000400) instead of transparent (0x00000000) 
+#if !defined(WINS)
+MACRO __ALF_SYMBIAN_RWINDOW_CLEARING_BUG_WORKAROUND__
+#endif
+
+// Canvas clipping should be disbaled until MNIA-7VYJLU is fixed. After fix, this macro should be removed. 
+//MACRO HUI_DISABLE_CANVAS_VISUAL_CLIPPING
+
+// Compile for Series 60. (This is the default)
+MACRO           SERIES_60
+
+// Compile for Series 80.
+// Note: not tested, most probably will not work any more...
+// MACRO           SERIES_80
+
+// The DLL will use CAPABILITY NONE if this is defined. This allows installing
+// it in all devices using a SIS package.
+//
+// Should not be used in platformised environments
+//
+//MACRO           HUI_NO_CAPABILITIES
+//#define HUI_NO_CAPABILITIES
+
+// Print debug messages using CHuiStatic::Printf(). This affects only debug
+// builds - there is no debug output for release builds. To make release
+// builds to generate debug output with CHuiStatic::Printf(), you have to
+// manually tune HuiUtil.h header and recompile everything. You have to
+// know what you're doing there! ;)
+// MACRO           HUI_DEBUG_WITH_PRINTF
+
+// Print debug messages from the frame draw code, using RDebug
+// Be aware that this creates A LOT of debug output.-
+// MACRO           HUI_DEBUG_FRAMEDRAW
+
+// Print debug messages from the frame drawing code, using CHuiStatic::Printf()
+// This is an alternative for HUI_DEBUG_FRAMEDRAW
+// MACRO           HUI_DEBUG_FRAMEDRAW_WITH_PRINTF
+
+// These  will constrain the used APIs to ones that are available in public SDK.
+// Enable these, if using a public SDK!
+// MACRO           PUBLIC_SDK
+// #define PUBLIC_SDK
+
+// Enable or disable the HUITK probing with HUI_PROBE_ENABLED
+// MACRO           HUI_PROBE_ENABLED
+
+// Enable or disable drawing tracking in debugger for coretoolkit
+//  MACRO HUI_DEBUG_TRACK_DRAWING
+
+// Enable NVG in coretoolkit
+MACRO __NVG
+
+// Enable subwindow effects
+//MACRO HUI_ENABLE_SUBWINDOW_FX 
+
+#include "../../CommonInc/coretkoptions.mmh"
+
+#include "huitk_base.mmp"
+
+// M3G support:
+
+// M3G Libraries needed
+LIBRARY         m3gcore.lib // M3G Core library
+LIBRARY         estor.lib // RFileWriteStream, RFileReadStream
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/group/huitk_base.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,241 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project Hitchcock Core
+*                Do not try to build this directly, this is included
+*                as a part of huitk.mmp and huitk_publicsdk.mmp.
+*
+*/
+
+
+
+#include <bldvariant.hrh>
+#include "../../CommonInc/huicompileroptions.mmh"
+
+TARGET          hitchcock.dll
+TARGETTYPE      dll
+UID             0x1000008d 0xA48A362E
+VERSION         10.0
+
+#ifndef WINS
+EPOCALLOWDLLDATA
+#endif
+
+#ifdef EKA2
+#ifndef HUI_NO_CAPABILITIES
+CAPABILITY      ALL -TCB
+#else
+// No capabilities to make it possible to install on all devices using a SIS package.
+CAPABILITY      None
+#endif
+#endif
+
+// MACRO HUI_DEBUG_TRACK_DRAWING
+// #define HUI_DEBUG_TRACK_DRAWING
+
+#include <platform_paths.hrh>
+MW_LAYER_SYSTEMINCLUDE
+APP_LAYER_SYSTEMINCLUDE
+
+SYSTEMINCLUDE   ../inc
+USERINCLUDE     ../inc ../../CommonInc
+
+#ifdef __SERIES60_30__
+USERINCLUDE     ../../../../uiaccelerator_dom/alf_core_toolkit_api/inc
+USERINCLUDE     ../../../../uiaccelerator_dom/alf_visual_api/inc
+USERINCLUDE     ../../../../uiaccelerator_dom/alf_tracing_api/inc
+USERINCLUDE     ../../../../uiaccelerator_dom/alf_extension_api/inc
+SYSTEMINCLUDE     ../../../../uiaccelerator_dom/alf_visual_api/inc
+SYSTEMINCLUDE /epoc32/include/m3g
+#endif
+
+SYSTEMINCLUDE           ../../../../inc
+
+//Added as part of break team support changes.
+#include "../../../../group/stdinc.mmh"
+
+SOURCEPATH      ../src
+
+// Utilities
+SOURCE          HuiUtil.cpp
+SOURCE          HuiStatic.cpp
+SOURCE          HuiPanic.cpp
+SOURCE          HuiMappingFunctions.cpp
+SOURCE          HuiDisplayCoeControl.cpp
+SOURCE          HuiInteractionInterval.cpp
+SOURCE          HuiImageLoaderUtil.cpp
+SOURCE          huifixmath.cpp
+
+// Toolkit Core
+SOURCE          HuiTimedValue.cpp
+SOURCE          HuiTimedPoint.cpp
+SOURCE          HuiEnv.cpp
+SOURCE          HuiDisplay.cpp
+SOURCE          HuiEvent.cpp
+SOURCE          HuiCommand.cpp
+SOURCE          HuiScheduler.cpp
+SOURCE          HuiRoster.cpp
+SOURCE          HuiRosterImpl.cpp
+SOURCE          HuiRosterEntry.cpp
+SOURCE			huieventhandler.cpp
+SOURCE			huifontmanager.cpp
+SOURCE			huifontspecification.cpp
+SOURCE			HuiTextStyleManager.cpp
+SOURCE			HuiTextStyle.cpp
+SOURCE			HuiS60TextStyle.cpp
+SOURCE          huilongtapdetector.cpp
+SOURCE			huimetric.cpp
+SOURCE          huiskinbackgroundlayout.cpp
+SOURCE          huidisplaybackgrounditem.cpp
+
+// Renderer Core
+SOURCE          HuiRenderPlugin.cpp
+SOURCE          HuiRenderSurface.cpp
+SOURCE          HuiGc.cpp
+SOURCE          HuiMatrixStack.cpp
+SOURCE          HuiTextureManager.cpp
+SOURCE          huitextureanimationstate.cpp
+SOURCE          HuiTextureProcessor.cpp
+SOURCE          HuiSegmentedTexture.cpp
+SOURCE          HuiTextureHandle.cpp
+SOURCE          HuiTexture.cpp
+SOURCE          HuiAnimatedTexture.cpp
+SOURCE          huigifanimationtexture.cpp
+SOURCE          huiskinanimationtexture.cpp
+SOURCE          HuiFont.cpp
+SOURCE          HuiTextMesh.cpp
+SOURCE          HuiRasterizedTextMesh.cpp
+SOURCE          HuiMaterial.cpp
+SOURCE          HuiMesh.cpp
+SOURCE          huiproceduralmesh.cpp
+SOURCE          huim3gmesh.cpp
+SOURCE          HuiImage.cpp
+SOURCE          HuiCurvePath.cpp
+SOURCE          HuiSkin.cpp
+SOURCE          HuiS60Skin.cpp
+SOURCE          huitextureautosizeparams.cpp
+SOURCE          huidropshadow.cpp
+
+// Visuals
+SOURCE          HuiTransformation.cpp
+SOURCE          HuiVisualFactory.cpp
+SOURCE          HuiVisual.cpp
+SOURCE          HuiImageVisual.cpp
+SOURCE          HuiTextVisual.cpp
+SOURCE          HuiLineVisual.cpp
+SOURCE          HuiMeshVisual.cpp
+SOURCE          HuiLayout.cpp
+SOURCE          HuiDeckLayout.cpp
+SOURCE          HuiFlowLayout.cpp
+SOURCE          HuiGridLayout.cpp
+SOURCE          HuiAnchorLayout.cpp
+SOURCE          HuiCurvePathLayout.cpp
+SOURCE          huiviewportlayout.cpp
+SOURCE          HuiBrush.cpp
+SOURCE          HuiImageBrush.cpp
+SOURCE          HuiGradientBrush.cpp
+SOURCE          HuiBorderBrush.cpp
+SOURCE          huiframebrush.cpp
+SOURCE          HuiShadowBorderBrush.cpp
+SOURCE          HuiDropShadowBrush.cpp
+SOURCE          HuiBrushArray.cpp
+
+// Controls
+SOURCE          HuiControl.cpp
+SOURCE          HuiControlGroup.cpp
+
+// Common Controls
+SOURCE          HuiSoftKeyControl.cpp
+
+// Theme Interface
+SOURCE          HuiThemeManager.cpp
+// Canvas
+SOURCE					HuiCanvasVisual.cpp
+SOURCE					huicanvasgc.cpp
+SOURCE					HuiCanvasCmdBufferReader.cpp
+SOURCE					HuiCanvasTextureCache.cpp
+SOURCE					huicanvasbackground.cpp
+SOURCE 					huicanvasalfpainter.cpp
+SOURCE					huicanvaswspainter.cpp
+SOURCE					huicanvaspainter.cpp
+SOURCE					huicanvaswshwgc.cpp
+SOURCE					huicanvaswsswgc.cpp
+SOURCE					huicanvasrenderbuffer.cpp
+SOURCE					huicanvaswsbitgc.cpp
+
+// Effects
+SOURCE          HuiFxColorParameter.cpp
+SOURCE          HuiFxEffect.cpp
+SOURCE		    HuiFxEffectCache.cpp
+SOURCE          HuiFxEffectParser.cpp
+SOURCE          HuiFxEngine.cpp
+SOURCE          HuiFxFilter.cpp
+SOURCE          HuiFxFilterLayer.cpp
+SOURCE          HuiFxGroupLayer.cpp
+SOURCE          HuiFxLayer.cpp
+SOURCE          HuiFxParameter.cpp
+SOURCE          HuiFxRenderbuffer.cpp
+SOURCE          HuiFxScalarParameter.cpp
+SOURCE          HuiFxVisualLayer.cpp
+SOURCE          HuiFxParameterManager.cpp
+#ifdef HUI_DEBUG_TRACK_DRAWING
+SOURCE          huicanvasdebugwsgc.cpp
+#endif
+SOURCE		HuiCmdBufferBrush.cpp
+
+LIBRARY         euser.lib
+LIBRARY         efsrv.lib
+LIBRARY         apparc.lib
+LIBRARY         cone.lib
+LIBRARY         bafl.lib
+LIBRARY         eikcore.lib
+LIBRARY         ws32.lib
+LIBRARY         fbscli.lib
+LIBRARY         gdi.lib
+LIBRARY         bitgdi.lib
+LIBRARY         libGLES_CM.lib
+LIBRARY         imageconversion.lib
+LIBRARY         charconv.lib
+LIBRARY         hal.lib
+LIBRARY         scdv.lib
+LIBRARY         flogger.lib
+LIBRARY         avkon.lib
+LIBRARY         aknskins.lib
+LIBRARY         aknskinsrv.lib
+LIBRARY     	aknicon.lib
+LIBRARY         fontutils.lib
+LIBRARY         aknpictograph.lib
+LIBRARY         cdlengine.lib
+LIBRARY         aknlayout2scalable.lib
+LIBRARY         aknlayout2.lib
+LIBRARY         centralrepository.lib
+
+LIBRARY	        xmlparser.lib
+LIBRARY	        xmldom.lib
+LIBRARY         libc.lib
+LIBRARY         libm.lib
+
+#ifdef RD_TACTILE_FEEDBACK
+LIBRARY         touchfeedback.lib 
+#endif
+LIBRARY         fontprovider.lib
+
+// Needed because the renderers have become ecom plugins....
+LIBRARY         ecom.lib
+LIBRARY         lookuptable.lib // for fader in canvaswspainter
+
+#ifdef HUI_DEBUG_TRACK_DRAWING
+LIBRARY 	    alfcommanddebug.lib
+#endif 
+
+LIBRARY			platformenv.lib
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/group/huitk_publicsdk.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project Hitchcock Core
+*                intended for building the Hitchcock UI Toolkit using
+*                a public S60 3.0 SDK.
+*
+*/
+
+
+
+// Compile for Series 60. (This is the default)
+MACRO           SERIES_60
+
+// Compile for Series 80.
+// Note: not tested, most probably will not work..
+//MACRO           SERIES_80
+
+// Uses glReadPixels instead of glCopyTexSubImage in CHuiGles10TextureProcessor.
+//MACRO           HUI_PROCESSOR_READPIXELS
+
+// Use this to compile on software driver. Will disable full screen anti-aliasing.
+//MACRO           OPENGLES_SW_DRIVER
+
+// Print debug messages using CHuiStatic::Printf(). This affects only debug
+// builds - there is no debug output for release builds. To make release
+// builds to generate debug output with CHuiStatic::Printf(), you have to
+// manually tune HuiUtil.h header and recompile everything. You have to
+// know what you're doing there! ;)
+// MACRO           HUI_DEBUG_WITH_PRINTF
+
+// Print debug messages from the frame draw code, using RDebug
+// Be aware that this creates A LOT of debug output.-
+// MACRO 			HUI_DEBUG_FRAMEDRAW
+
+// Print debug messages from the frame drawing code, using CHuiStatic::Printf()
+// This is an alternative for HUI_DEBUG_FRAMEDRAW
+// MACRO 			HUI_DEBUG_FRAMEDRAW_WITH_PRINTF
+
+// Disable the default render surface. If disabled, a display must be
+// created before textures can be loaded.
+//MACRO         GLES10_DISABLE_DEFAULT_RENDER_SURFACE
+
+// These  will constrain the used APIs to ones that are available in public SDK.
+// Enable these, if using a public SDK!
+MACRO           PUBLIC_SDK
+#define PUBLIC_SDK
+
+#include "huitk_base.mmp"
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiCmdBufferBrush.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,115 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUICMDBUFFERBRUSH_H_
+#define HUICMDBUFFERBRUSH_H_
+
+#include <uiacceltk/HuiBrush.h>
+#include "huicanvaspainter.h"
+#include "huieffectable.h"
+
+// TASK: 1) Avkon provides markers in buffers to mark highlight
+// TASK: 2) fxml provides names for visual buffers -- snapshot of buffers in different times
+// TASK: 3) 
+
+// TODO: Support for effects in the brush
+// TODO: Support for parsing buffers in visual and passing it to cmdbufferbrushes
+// TODO: Support for drawing CmdBufferBrush
+// TODO: HuiCanvasPainter stores commandbuffers -- create links to those buffers.
+// 
+class CHuiFxEffect;
+class CHuiBrushArray;
+class CHuiCanvasGc;
+class CHuiCanvasWsGc;
+class CHuiCanvasVisual;
+class CHuiCanvasPainter;
+class CHuiGc;
+
+
+class CHuiCmdBufferBrush : public CHuiBrush, public MHuiEffectable, public MHuiCmdBufDestroyObserver
+{
+public:
+   struct TLayeredBuffer
+       {
+       //TInt iBufferId; // which visual's buffer this is.
+       TRect iBoundingRectangle;
+       //TRegion iUpdateRegion;
+       TPtrC8 iBufferPart; // range from huicanvaspainter's buffer
+       CHuiCanvasCommandBuffer *iCommandBuffer; // reference to painter's command buffer
+       TLayeredBuffer &operator=(const TLayeredBuffer &aVal)
+           {
+           //iBufferId = aVal.iBufferId;
+           iBoundingRectangle = aVal.iBoundingRectangle;
+           // iUpdateRegion = aVal.iUpdateRegion;
+           iBufferPart.Set(aVal.iBufferPart);
+           iCommandBuffer = aVal.iCommandBuffer;
+           return *this;
+           }
+       };
+
+public: // construction
+    static CHuiCmdBufferBrush *NewL(TInt aLayerId, CHuiCanvasGc &aGc, CHuiCanvasWsGc &aWsGc, CHuiCanvasVisual &aVisual, CHuiCanvasPainter &aPainter);
+    ~CHuiCmdBufferBrush();
+public: // modifying buffers
+   void AddBufferL(TLayeredBuffer aBuffer);
+
+public: // Accessors
+    TInt LayerId() const { return iLayerId; }
+
+public: // from CHuiBrush
+    virtual void Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const;
+    void DrawSelf(CHuiGc &aGc, THuiRealRect aRect) const;
+    virtual TInt Type2() const;
+    void Flush() const;
+    void ClearBackground(CHuiGc &aGc, TRect aRectangle) const;
+    void DrawDrawingCommands(TInt aAction, CHuiGc &aGc, TRect aClippingRectangle, 
+                             TPtrC8 aCommands, CHuiCanvasCommandBuffer *buf, const TRegion &aRegion) const;
+    void CopyBuffer(CHuiGc &aGc, TRect aRectangle) const;
+
+
+public: // from MHuiEffectable
+   //void SetEffect(CHuiFxEffect* aEffect);
+   void EffectSetEffect(CHuiFxEffect* aEffect);
+   TReal32 EffectOpacityTarget() const;
+   void EffectSetOpacity(TReal32 aOpacity);
+   void EffectDrawSelf( CHuiGc &aGc, const TRect & aDisplayRect) const;
+   THuiRealRect EffectDisplayRect() const __SOFTFP;
+   void SetLoadingEffect(TBool aLoading);
+   void EffectSetSource( TBool aIsInput1 );
+   TBool EffectGetSource() const;
+
+   
+public: // from MHuiCmdBufDestroyObserver
+    void DestroyBuffer(CHuiCanvasCommandBuffer *aBuffer);
+private:
+    void ConstructL(TInt aLayerId, CHuiCanvasVisual &aVisual, CHuiCanvasPainter &aPainter);
+    CHuiCmdBufferBrush( CHuiCanvasGc &aGc, CHuiCanvasWsGc &aWsGc);
+private:
+    TInt iLayerId; // layer id of this brush
+    RArray<TLayeredBuffer> iBuffers; // pointers to buffer subareas
+private:
+    CHuiFxEffect *iEffect;
+    CHuiCanvasGc &iCanvasGc;
+    CHuiCanvasWsGc &iCanvasWsGc;
+    CHuiCanvasVisual *iVisual;
+    CHuiCanvasPainter *iCanvasPainter;
+    friend void ParseCmdBufferL(CHuiBrushArray &aBrushes, TPtrC8 aBuffer, TPtrC8 aIndexTable, CHuiCanvasGc &aGc, CHuiCanvasWsGc &aWsGc, CHuiCanvasVisual &aVisual,CHuiCanvasPainter &aPainter);
+
+};
+void ParseCmdBufferL(CHuiBrushArray &aBrushes, TPtrC8 aBuffer, TPtrC8 aIndexTable, CHuiCanvasGc &aGc, CHuiCanvasWsGc &aWsGc, CHuiCanvasVisual &aVisual, CHuiCanvasPainter &aPainter);
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxColorParameter.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXCOLORPARAMETER_H_
+#define HUIFXCOLORPARAMETER_H_
+
+#include "HuiFxParameter.h"
+#include "HuiFxTimeLine.h"
+
+//FORWARD DECLARATIONS
+class TRgb;
+
+/**
+ *  Animation timeline for color values
+ */
+typedef RHuiFxTimeLine<TRgb, TUint32> RHuiFxColorTimeLine;
+
+/*
+ *  Color parameter
+ */
+typedef CHuiFxGenericParameter<TRgb, RHuiFxColorTimeLine, EParameterTypeColor> CHuiFxColorParameter;
+
+#endif /*HUIFXCOLORPARAMETER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxConstants.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,234 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXCONSTANTS_H_
+#define HUIFXCONSTANTS_H_
+
+#include <e32cmn.h>
+
+enum THuiFxVisualSrcType
+    {
+    EVisualSrcVisual, // default
+    EVisualSrcBitmap, // external bitmap
+    // the external inputs are not supported yet.
+    EVisualSrcInput1, // first participant in an effect between two visuals
+    EVisualSrcInput2, // second participant in an effect between two visuals
+    };
+
+enum THuiFxBlendingMode
+    {
+    EBlendingModeReplace,
+    EBlendingModeOver,
+    EBlendingModeMultiply,
+    EBlendingModeAdditive,
+    EBlendingModeDarken,
+    EBlendingModeLighten,
+    };
+
+enum THuiFxLayerType 
+    {
+    ELayerTypeUnknown,
+    ELayerTypeGroup,
+    ELayerTypeFilter,
+    ELayerTypeVisual,
+    };
+
+enum THuiFxFilterType
+    {
+    EFilterTypeUnknown,
+    EFilterTypeDesaturate,
+    EFilterTypeBlur,
+    EFilterTypeGlow,
+    EFilterTypeBrightnessContrast,
+    EFilterTypeHSL, 
+    EFilterTypeColorize,
+    EFilterTypeOutline,
+    EFilterTypeBevel,
+    EFilterTypeTransform,
+    // etc.
+    };
+
+enum TRenderBufferType
+    {
+    EBufferTypeOnscreen = 0,
+    EBufferTypeOffscreen
+    };
+
+enum THuiFxRenderbufferUsage
+    {
+    ERenderbufferUsageReadWrite,
+    ERenderbufferUsageReadOnly,
+    ERenderbufferUsageWriteOnly,
+    };
+
+enum THuiFxEngineType
+    {
+    EHuiFxEngineVg10 = 0,
+    EHuiFxEngineGles20
+    };
+
+// All literals needed in the parsing are collecter here because it is difficult
+// to find them in several different files.
+// Some literals were even defined twice in different .cpp files
+
+_LIT(KLitLayers, "layers" );
+_LIT(KLitLayerGroup, "layergroup" );
+_LIT(KLitFilter, "filter" );
+_LIT(KLitVisual, "visual" );
+
+// parameter for visual
+_LIT(KLitSrc, "src" ); // source for the effect
+
+_LIT(KLitBlending, "blending" );
+_LIT(KLitParam, "param" );
+_LIT(KLitReplace, "replace" );
+_LIT(KLitOver, "over" );
+_LIT(KLitMultiply, "multiply" );
+_LIT(KLitAdditive, "additive" );
+_LIT(KLitDarken, "darken" );
+_LIT(KLitLighten, "lighten" );
+
+_LIT(KLitType, "type" );
+_LIT(KLitName, "name" );
+_LIT(KLitRef, "ref" );
+_LIT(KLitAnim, "anim" );
+_LIT(KLitDuration, "duration" );
+
+_LIT(KLitStyle, "style" );
+_LIT(KLitKeyFrame, "keyframe" );
+_LIT(KLitHold, "hold" );
+_LIT(KLitLinear, "linear" );
+_LIT(KLitQuadraticBezier, "quadratic_bezier" );
+_LIT(KLitCubicBezier, "cubic_bezier" );
+_LIT(KLitInQuad, "inquad" );
+_LIT(KLitOutQuad, "outquad" );
+_LIT(KLitInOutQuad, "inoutquad" );
+_LIT(KLitOutInQuad, "outinquad" );
+_LIT(KLitInBack, "inback" );
+_LIT(KLitOutBack, "outback" );
+_LIT(KLitInOutBack, "inoutback" );
+_LIT(KLitOutInBack, "outinback" );
+/*
+_LIT(KLitDeclerate, "declerate");
+_LIT(KLitAccelerate, "accelerate");
+_LIT(KLitImpulse, "impulse");
+*/
+_LIT(KLitAt, "at" );
+_LIT(KLitMarker, "marker" );
+_LIT(KLitLoopStart, "loop_start" );
+_LIT(KLitLoopEnd, "loop_end" );
+_LIT(KLitAux1, "aux1" );
+_LIT(KLitAux2, "aux2" );
+_LIT(KLitVisualWidth1, "visual_width" ); // deprecated
+_LIT(KLitVisualHeight1, "visual_height" ); // deprecated
+_LIT(KLitDisplayWidth1, "display_width" ); // deprecated
+_LIT(KLitDisplayHeight1, "display_height" ); // deprecated
+
+_LIT(KLitVisualWidth, "visual.width" );
+_LIT(KLitVisualHeight, "visual.height" );
+_LIT(KLitVisualTop, "visual.top" ); // top y coordinate
+_LIT(KLitVisualBottom, "visual.bottom" ); // bottom y coordinate
+_LIT(KLitVisualLeft, "visual.left" ); // left x coordinate
+_LIT(KLitVisualRight, "visual.right" ); // right x coordinate
+
+_LIT(KLitDisplayWidth, "screen.width" );
+_LIT(KLitDisplayHeight, "screen.height" );
+_LIT(KLitDisplayTop, "screen.top" );
+_LIT(KLitDisplayBottom, "screen.bottom" );
+_LIT(KLitDisplayLeft, "screen.left" );
+_LIT(KLitDisplayRight, "screen.right" );
+
+_LIT(KLitExtRectWidth, "extrect.width" );
+_LIT(KLitExtRectHeight, "extrect.height" );
+_LIT(KLitExtRectTop, "extrect.top" );
+_LIT(KLitExtRectBottom, "extrect.bottom" );
+_LIT(KLitExtRectLeft, "extrect.left" );
+_LIT(KLitExtRectRight, "extrect.right" );
+
+
+_LIT(KLitDesaturate, "desaturate" );
+_LIT(KLitBlur, "blur" );
+_LIT(KLitGlow, "glow" );
+_LIT(KLitBrightnessContrast, "brightness_contrast" );
+_LIT(KlitHSL, "hsl");
+_LIT(KlitColorize, "colorize");
+_LIT(KlitOutline, "outline");
+_LIT(KlitBevel, "bevel");
+_LIT(KlitTransform, "transform");
+_LIT(KLitDropShadow, "drop_shadow");
+
+_LIT(KLitItem, "item" ); // the visual itself, default if src has not been defined
+_LIT(KLitInput1, "input1" );
+_LIT(KLitInput2, "input2" );
+
+_LIT(KLitBlurX, "blur_x" );
+_LIT(KLitBlurY, "blur_y" );
+
+_LIT(KLitHue, "hue" );
+_LIT(KLitSaturation, "saturation" );
+_LIT(KLitLightness, "lightness" );
+
+_LIT(KLitOutlineX, "outline_x" );
+_LIT(KLitOutlineY, "outline_y" );
+_LIT(KLitSteepness, "steepness" );
+/*_LIT(KLitRed, "red" );
+_LIT(KLitGreen, "green" );
+_LIT(KLitBlue, "blue" );
+*/
+
+_LIT(KLitBrightness, "brightness" );
+_LIT(KLitContrast, "contrast" );
+ 
+_LIT(KLitColor, "color" );
+
+_LIT(KLitOpacityParameter, "opacity" );
+
+_LIT(KLitStart, "start" );
+_LIT(KLitEnd, "end" );
+
+// Definitions common to visual layer and transform filter  
+_LIT(KLitTranslationX, "translation_x");
+_LIT(KLitTranslationY, "translation_y");
+_LIT(KLitTranslationZ, "translation_z");
+
+_LIT(KLitScaleX, "scale_x");
+_LIT(KLitScaleY, "scale_y");
+_LIT(KLitScaleZ, "scale_z");
+_LIT(KLitScaleOriginX, "scale_origin_x");
+_LIT(KLitScaleOriginY, "scale_origin_y");
+_LIT(KLitScaleOriginZ, "scale_origin_z");
+
+_LIT(KLitRotationOriginX, "rotation_origin_x");
+_LIT(KLitRotationOriginY, "rotation_origin_y");
+_LIT(KLitRotationOriginZ, "rotation_origin_z");
+_LIT(KLitRotationAngle, "rotation_angle");
+_LIT(KLitRotationAxisX, "rotation_axis_x");
+_LIT(KLitRotationAxisY, "rotation_axis_y");
+_LIT(KLitRotationAxisZ, "rotation_axis_z");
+
+_LIT(KLitSkewAngleX, "skew_angle_x");
+_LIT(KLitSkewAngleY, "skew_angle_y");
+_LIT(KLitSkewAngleZ, "skew_angle_z");
+_LIT(KLitSkewOriginX, "skew_origin_x");
+_LIT(KLitSkewOriginY, "skew_origin_y");
+_LIT(KLitSkewOriginZ, "skew_origin_z");
+
+
+    
+#endif /*HUIFXCONSTANTS_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffect.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXEFFECT_H_
+#define HUIFXEFFECT_H_
+
+#include "HuiFxEngine.h"
+#include <uiacceltk/HuiGc.h>
+
+//FORWARD DECLARATIONS
+class CHuiFxLayer;
+class CHuiFxGroupLayer;
+class MHuiEffectable;
+// Hui Effect Flags
+// The flags must be 1 bit flags to allow several to be set simultaneously (if needed)
+const TInt KHuiFlagsNone = 0x00000000;
+const TInt KHuiFadeEffectFlag = 0x00000001;
+const TInt KHuiFxEffectDisableMarginsFlag = 0x2;
+const TInt KHuiFxEffectExcludeChildrenFlag = 0x4;
+const TInt KHuiFxWaitGroupSyncronization = 0x8;
+const TInt KHuiFxDelayRunUntilFirstFrameHasBeenDrawn = 0x10;
+const TInt KHuiFxDisableBackground = 0x20;
+const TInt KHuiFxAlwaysBlend = 0x40;
+
+class MAlfGfxEffectObserver
+    {
+    public:
+    	/**
+     	 * Function to be called when CHuiFxEffect class effect has ended
+     	 * @param aHandle handle of the effect, given when the effect is started
+     	 */
+        virtual void AlfGfxEffectEndCallBack( TInt aHandle ) = 0;
+    };
+
+class CHuiFxEffect : public CBase
+    {
+public:
+    IMPORT_C virtual ~CHuiFxEffect();
+    IMPORT_C static CHuiFxEffect* NewL(CHuiFxEngine& aEngine);
+    IMPORT_C void AddLayerL(const CHuiFxLayer* aLayer); // takes ownership
+    IMPORT_C void AdvanceTime(TReal32 aElapsedTime);
+    IMPORT_C TBool Draw(CHuiGc& aGc, const TRect& aDisplayRect);
+    IMPORT_C CHuiFxEngine& Engine() const;
+    IMPORT_C TBool VisualArea(TRect& aRect) const;
+    IMPORT_C TBool Changed();
+    IMPORT_C void SetEffectEndObserver( MAlfGfxEffectObserver* aEffectEndObserver, TInt aHandle );
+    void NotifyEffectEndObserver();
+
+    IMPORT_C TBool IsAnimated() const;
+    IMPORT_C TBool IsTransformed() const;
+    TBool IsSemitransparent() const;
+    
+
+public: // effect cache methods
+    IMPORT_C CHuiFxEffect *CloneL() const;
+    IMPORT_C void SetExtRect( TRect *aExtRect );
+    IMPORT_C void SetVisual( CHuiVisual *aVisual );
+    IMPORT_C void SetVisual( MHuiEffectable *aVisual );
+    IMPORT_C void SetEngine( CHuiFxEngine *aEngine );
+
+    IMPORT_C void SetEffectFlags( TInt aFlags );
+    IMPORT_C void SetEffectGroup(TInt aGroupId);
+    IMPORT_C TInt EffectFlags();
+    IMPORT_C TInt GroupId();
+
+    // Effect cached render target methods    
+    TBool IsCachedRenderTargetSupported() const;
+    TBool IsCachedRenderTargetPreferred() const;
+    
+    void ForceCachedRenderTargetUsage(TBool aUseCachedRenderTarget);
+    
+    void PrepareCachedRenderTarget(const TPoint& aPosition, const TSize& aSize, TBool aClear, TBool aEnableBackground);
+    void ReleaseCachedRenderTarget();
+    
+    /*
+     * CachedDraw is typically much faster than normal draw as it keeps effect result in pre-rendered format
+     * instead of doing it on-the-fly as normal draw. There are however few issues that must be noted:
+     * 
+     * - If visual content has changed, caller is then responsible for setting param aRefreshCachedRenderTarget=ETrue
+     *   so that effect gets refreshed.
+     * - Caching does not make sense for animated effects, this method automatically defaults to normal
+     *   drawing if the effect is animated
+     * - All renderers do not (yet) support cached drawing
+     * - If memory is low, cached drawing may not succed.    
+     *   
+     *  @param aGc
+     *  @param aDisplayRect
+     *  @param aRefreshCachedRenderTarget ETrue makes sure that effect is rendered, EFalse may use cached
+     *         result if it is otherwise possible.
+     *  @param  aOpaque, can be used for optimization so that when set to ETrue content behind visual is 
+     *          not read from drawing surface.
+     *  @param  aClipRegion If region contains rects, final composition to display is clipped according to
+     *          defined region.          
+     *                   
+     *  @return ETrue if drawing was done, otherwise EFalse   
+     */
+    TBool CachedDraw(CHuiGc& aGc, const TRect& aDisplayRect, TBool aRefreshCachedRenderTarget, TBool aOpaque, const TRegion& aClipRegion, TInt aAlpha = 255);
+    TBool CachedDraw(CHuiGc& aGc, const TRect& aDisplayRect, TBool aRefreshCachedRenderTarget, TBool aOpaque);
+
+    void FxmlVisualInputs(RArray<THuiFxVisualSrcType> &aArray);
+private:
+
+    TBool IsAppliedToBackground();
+    TBool IsFiltered() const;
+    
+    
+protected:
+    CHuiFxEffect( CHuiFxEngine& aEngine );
+    void ConstructL();
+        
+    CHuiFxGroupLayer*        iRoot;
+    CHuiFxEngine*            iEngine;
+    // The observer that wants to be called when the effect finishes
+    // If no observer has been set, the pointer is NULL
+    // This pointer is not owned, so it must not be deleted
+    MAlfGfxEffectObserver*   iEffectEndObserver;
+    // The effect handle that will be returned to the observer when effect finishes
+    TInt                     iHandle;
+    // The flags will indicate special cases that will need special handling (like fade)
+    TInt                     iFlags;
+    // Cached render target which holds the effect result in pre-rendered format
+    CHuiFxRenderbuffer* iCachedRenderTarget;
+    
+    TBool iForcedUseCachedRenderTarget;
+    
+    // Used for syncronizing effect start of effects with same group id. 
+    // See also KHuiFxWaitGroupSyncronization
+    TInt iGroupId;
+	
+    TInt iFramesDrawn;
+    };
+
+#endif /*HUIFXEFFECT_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffectCache.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXEFFECTCACHE_H_
+#define HUIFXEFFECTCACHE_H_
+
+#include <e32cmn.h>
+#include <e32base.h>
+#include <e32hashtab.h>
+#include "HuiFxEffectParser.h"
+#include "huieffectable.h"
+
+class MHuiFxParsingEndedObserver;
+class MAlfGfxEffectObserver;
+
+
+class MHuiFxEffectCacheNode
+{
+public:
+    virtual ~MHuiFxEffectCacheNode() { }
+    virtual TPtrC Id()=0; // how to regognize this instance
+    virtual MHuiFxEffectCacheNode *CloneL()=0; // from this instance to cache
+    virtual void LightOperationL(MHuiFxEffectCacheNode *aCached)=0; // from cache to this instance
+    virtual void HeavyOperationL(MHuiFxParsingEndedObserver *aObserver, TInt aIndex)=0;    // from nothing to this instance
+    virtual TInt Ref(TInt aCount)=0; // increase count by aCount and return count.
+    virtual void ParsingEndedBefore()=0;
+    virtual void ParsingEndedAfter(MHuiFxEffectCacheNode *aCached)=0;
+    virtual TBool FxmlUsesInput1()=0;
+};
+
+class CHuiFxEffectCache : public CBase, public MHuiFxParsingEndedObserver
+{
+public:
+    IMPORT_C static CHuiFxEffectCache* NewL();
+    void CreateL(MHuiFxEffectCacheNode *aNode); // moves ownership
+    IMPORT_C void FindOrCreateL(MHuiFxEffectCacheNode *aNode); // moves ownership
+    MHuiFxEffectCacheNode *FindDup(const TDesC &aId);
+    IMPORT_C void UnUse(MHuiFxEffectCacheNode *aNode);
+    IMPORT_C ~CHuiFxEffectCache();
+    void ParsingEnded(TInt aHandle);
+    MHuiFxEffectCacheNode *FindCached(const TDesC &aId);
+    TBool FxmlUsesInput1(const TDesC &aFileName);
+private:
+    struct IDNode
+        {
+        TInt iId;
+        MHuiFxEffectCacheNode *iNode;
+        };
+    
+    MHuiFxEffectCacheNode *Find(MHuiFxEffectCacheNode *aNode);
+    static bool Compare(MHuiFxEffectCacheNode *aNode1, MHuiFxEffectCacheNode *aNode2);
+    void Remove(RPointerArray<MHuiFxEffectCacheNode> &aEffects, MHuiFxEffectCacheNode *aNode);
+    void Remove(RHashMap<TInt, MHuiFxEffectCacheNode*> &aMap, MHuiFxEffectCacheNode *aNode);
+    void Remove(RArray<IDNode> &aMap, MHuiFxEffectCacheNode *aNode);
+    TInt FindById(TInt aId);
+    TInt UniqueId();
+private:
+   RPointerArray<MHuiFxEffectCacheNode> iCachedEffects;
+   //RPointerArray<MHuiFxEffectCacheNode> iDuplicateEffects; // array can have null pointers in it
+   //RHashMap<TInt, MHuiFxEffectCacheNode*> iDuplicateEffects;
+   RArray<IDNode> iDuplicateEffects;
+   TInt iUniqueId;
+};
+
+class CHuiFxEffect;
+class TRect;
+class CHuiVisual;
+class CHuiFxEngine;
+
+// This class has all dependencies to outside objects.
+class CHuiFxEffectCacheEffectNode : public CBase, public MHuiFxEffectCacheNode
+{
+public:
+     IMPORT_C CHuiFxEffectCacheEffectNode(const TDesC &aFileName, CHuiFxEffect *&aEffect, MHuiEffectable *aVisual, TRect *extRect, CHuiFxEngine *aEngine) 
+	: iFileName(aFileName.AllocL()), iEffect(aEffect), iVisual(aVisual), iExtRect(extRect), iEffectCached(0), iEngine(aEngine), iRefCount(0), iParser(0) { }
+     IMPORT_C ~CHuiFxEffectCacheEffectNode();
+     void SetEffectEndObserver( MAlfGfxEffectObserver* aEffectEndObserver, TInt aHandle );
+     void SetEffectFlags( TInt aFlags );
+     void SetEffectGroup( TInt aGroup);
+private:
+     CHuiFxEffectCacheEffectNode(const TDesC &aFileName, CHuiFxEffect *aEffect) : iFileName(aFileName.AllocL()), iEffect(iEffectCached), iVisual(0), iExtRect(0), iEffectCached(aEffect), iRefCount(0), iParser(0), iEffectEndObserver(0), iHandle(0) { }
+public: // from MHuiFxEffectCacheNode
+     TPtrC Id();
+     MHuiFxEffectCacheNode *CloneL();
+     void LightOperationL(MHuiFxEffectCacheNode *aCached);
+     void HeavyOperationL(MHuiFxParsingEndedObserver *aObserver, TInt aIndex);
+     TInt Ref(TInt aCount);
+     void ParsingEndedBefore();
+     void ParsingEndedAfter(MHuiFxEffectCacheNode *aCached);
+     TBool FxmlUsesInput1();
+
+private:
+     const TDesC *iFileName;
+     CHuiFxEffect *iEffect;
+     MHuiEffectable *iVisual;
+     TRect *iExtRect;
+     CHuiFxEffect *iEffectCached;
+     CHuiFxEngine *iEngine;
+     TInt iRefCount;
+     CHuiFxEffectParser *iParser;
+     MAlfGfxEffectObserver* iEffectEndObserver;
+     TInt iHandle;
+     TInt iFlags;
+     TInt iGroup;
+};
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEffectParser.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXEFFECTPARSER_H_
+#define HUIFXEFFECTPARSER_H_
+
+#include <f32file.h>
+#include <gmxmlparser.h>
+#include "HuiFxEngine.h"
+#include "HuiFxFilter.h"
+
+//FORWARD DECLARATIONS
+class CMDXMLNode;
+class CMDXMLDocument;
+class CMDXMLParser;
+class CHuiVisual;
+class CHuiFxLayer;
+class MAlfGfxEffectObserver;
+
+class MHuiFxParsingEndedObserver
+    {
+public:
+    virtual void ParsingEnded(TInt aHandle) =0;
+    };
+
+
+class CHuiFxEffectParser : public CActive, public MMDXMLParserObserver
+    {
+public: // construction/destruction
+    static CHuiFxEffectParser* NewL(CHuiFxEngine& aEngine, MHuiEffectable* aVisual = 0);
+    static CHuiFxEffectParser* NewLC(CHuiFxEngine& aEngine, MHuiEffectable* aVisual = 0);
+    virtual ~CHuiFxEffectParser();
+
+public: // from MMDXMLParserObserver
+    void ParseFileCompleteL();
+    
+public: // from CActive
+    void RunL();
+    TInt RunError( TInt aError );
+    void DoCancel();
+    
+public:
+    void ParseL( const TDesC& aFile, TRect aExtRect );
+    void Effect( CHuiFxEffect*& aEffect ); // effect ownership transferred to caller
+    
+    void SetEffectEndObserver( MAlfGfxEffectObserver* aEffectEndObserver, TInt aHandle );
+    void SetEffectFlags( TInt aFlags );
+public:
+    void SetParsingEndedObserver( MHuiFxParsingEndedObserver *aObserver, TInt aHandle );
+    
+protected:
+    CHuiFxEffectParser(CHuiFxEngine& aEngine, MHuiEffectable* aVisual);
+    
+private:
+    enum TNodeType
+        {
+        ENodeTypeUnknown,
+        ENodeTypeVisual,
+        ENodeTypeGroup,
+        ENodeTypeFilter,
+        ENodeTypeBlending,
+        ENodeTypeParam,
+        ENodeTypeKeyFrame,
+        ENodeTypeDuration,
+        ENodeTypeStyle,
+        ENodeTypeMarker,
+        ENodeTypeStart,
+        ENodeTypeEnd,
+        };
+        
+    void ConstructL();
+    void BuildEffectL();
+    void ParseNodeL( CMDXMLNode* aNode, CHuiFxLayer* aLayer = NULL );
+    CHuiFxEffectParser::TNodeType ResolveNode( CMDXMLNode* aNode );
+    void ResolveParamL( CMDXMLNode* aNode, CHuiFxLayer* aLayer );
+    THuiFxFilterType GetFilterTypeL( CMDXMLNode* aNode );
+    THuiFxReferencePoint GetReferencePointL( CMDXMLNode* aNode, TReal32& aRefValue, TBool& aNeedRefValue );
+    THuiFxVisualSrcType GetSrcTypeL( CMDXMLNode* aNode, TPtrC16& aBitmap );
+    TReal32 ParseFloatValueL(CMDXMLNode* aNode);
+    TRgb ParseColorValueL(CMDXMLNode* aNode);
+    TReal32 ParseFloatAttributeL(CMDXMLNode* aNode, const TDesC& aName, TBool aMustExist = ETrue);
+
+    template <typename PARAM_TYPE, typename TIMELINE_TYPE, typename VALUE_TYPE>
+    void ParseAnimationNodeL(CMDXMLNode* aNode, PARAM_TYPE& aParam, TIMELINE_TYPE& aTimeLine);
+
+    template <typename VALUE_TYPE, typename TIMELINE_TYPE>
+    VALUE_TYPE ParseAnimationKeyFrameValueL(CMDXMLNode* aNode, TIMELINE_TYPE& aTimeLine);
+    
+    void FailL(TInt aCode, TRefByValue<const TDesC> aFormat, ...);
+    
+private: // members
+    CHuiFxEffect*           iEffect;
+    CHuiFxEngine&           iEngine;
+    CMDXMLParser*           iParser;
+    CMDXMLDocument*         iDoc;
+    RFs                     iFs;
+    MHuiEffectable*             iVisual;
+    TRect                   iExtRect;
+    MAlfGfxEffectObserver*  iEffectEndObserver;
+    TInt                    iHandle; // handle for effect end observer
+    TInt                    iFlags; // flags from caller that will go into the effect
+    TBool                   iIsCancelled;
+    MHuiFxParsingEndedObserver *iParsingEndedObserver;
+    TInt iParsingEndedHandle;
+public:
+    /*void LoadEffect(const TDesC& aFileName, Effect* aTemplateEffect);*/
+private:
+    };
+
+#endif /*HUIFXEFFECTPARSER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxEngine.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,191 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXENGINE_H_
+#define HUIFXENGINE_H_
+
+#include "HuiFxConstants.h"
+#include "HuiFxParameter.h"
+#include "huieffectable.h"
+#include <uiacceltk/huilowmemoryobserver.h>
+#include <e32std.h>
+
+
+#define HUIFX_RBCACHE_ENABLED
+#define HUIFX_EFFECTCACHE_ENABLED
+
+//FORWARD DECLARATIONS
+class CHuiFxRenderbuffer;
+class CHuiFxFilter;
+class CHuiFxEffect;
+class CHuiVisual;
+class CHuiFxEffectCache;
+class MAlfGfxEffectObserver;
+class CHuiGc;
+
+class CHuiFxEngine : public CBase, public MHuiLowMemoryObserver, public MHuiMemoryLevelObserver
+    {
+    // important constant! Affects memory fragmentation in backend too small 
+    // number forces lots of acquires/releases resulting in fragmented memory 
+    // and finally panic.
+
+    // CACHE_SIZE set to 20 to avoid buffer creation at worst case scenario (fading).
+    // Emulator cannot currently handle that much (out of memory) 
+#ifdef __WINS__ 
+    static const TInt CACHE_SIZE = 1;
+#else
+    static const TInt CACHE_SIZE = 20;
+#endif    
+    friend class CHuiFxEffect;
+protected:
+    IMPORT_C void ConstructL(THuiFxEngineType aEngineType);
+public:
+    IMPORT_C virtual ~CHuiFxEngine();
+    // Engine management
+    IMPORT_C virtual void Release();
+    IMPORT_C virtual void RestoreL();
+
+    // Render buffer management
+    IMPORT_C virtual CHuiFxRenderbuffer* AcquireRenderbuffer(const TSize& aDesiredSize);
+    CHuiFxRenderbuffer* AcquireRenderbuffer(const TSize& aDesiredSize, TBool aAlllowLarger);
+
+    IMPORT_C virtual void ReleaseRenderbuffer(CHuiFxRenderbuffer* aBuffer);
+    virtual CHuiFxRenderbuffer* DefaultRenderbuffer() = 0;
+
+    // Filter construction
+    virtual CHuiFxFilter* CreateFilterL(THuiFxFilterType aType) = 0;
+
+    // Composition
+    // TODO: Coordinates
+    virtual void Composite(CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource,
+                                    const TRect& aTargetRect, const TRect& aSourceRect,
+                                    THuiFxBlendingMode aMode, TInt aAlpha) = 0;
+
+    // Composition variant to compose directly to the screen. Uses always over blending with constant alpha.
+    IMPORT_C virtual void Composite(CHuiGc& aGc, CHuiFxRenderbuffer& aSource, const TPoint& aTargetPoint, TBool aOpaque, TInt aAlpha);
+    
+    // Effect construction
+    // TODO: Other needed effect parameters?
+    // Demarcation rectangele added.
+    
+    // Effect end observer and handle added
+    IMPORT_C void RegisterEffectL(const TDesC &aFileName);
+    IMPORT_C void UnRegisterEffectL(const TDesC &aFileName);
+    IMPORT_C void LoadEffectL(
+        const TDesC& aFileName,
+        CHuiFxEffect*& aEffect,
+        MHuiEffectable* aVisual = 0,
+        TRect* extRect = 0,
+        MAlfGfxEffectObserver* aEffectEndObserver = 0,
+        TInt aHandle = 0, 
+        TInt aFlags = 0 );
+    
+    IMPORT_C void LoadGroupEffectL(
+            const TDesC& aFileName,
+            CHuiFxEffect*& aEffect,
+            MHuiEffectable* aVisual = 0,
+            TInt aGroupHandle = 0,
+            TRect* extRect = 0,
+            MAlfGfxEffectObserver* aEffectEndObserver = 0,
+            TInt aHandle = 0,
+            TInt aFlags = 0 );
+    
+    IMPORT_C TBool FxmlUsesInput1(const TDesC &aFileName);
+
+    
+    IMPORT_C void AdvanceTime(TReal32 aElapsedTime);
+    
+    IMPORT_C TReal32 GetReferenceValue(THuiFxReferencePoint aPoint);
+    
+    IMPORT_C THuiFxEngineType EngineType();
+    
+    //from MHuiLowMemoryObserver
+    // deprecated
+    IMPORT_C void EnableLowMemoryState(TBool aEnable);
+    
+    /*
+	 * BeginGroupEffect
+	 *
+	 * Begins new group. start collecting effects, that should be set to motion at the same 
+	 * time.
+	 */
+	IMPORT_C void BeginGroupEffect(TInt aGroup);
+
+    
+    IMPORT_C TInt ActiveGroupEffect();
+    
+    /*
+	 * StartGroupEffect
+	 *
+	 * Starts syncronously group of effects that have the same aGroup id. 
+	 */
+    IMPORT_C void StartGroupEffect(TInt aGroup);
+    
+    TInt LowMemoryState();
+    
+    TBool HasActiveEffects() const;
+    
+    void ClearCache();
+    
+    void NotifyEffectEndObservers();
+    
+    IMPORT_C void SetMemoryLevel(THuiMemoryLevel aLevel);
+    
+protected:
+    IMPORT_C void AddEffectL(CHuiFxEffect* aEffect);
+    IMPORT_C void RemoveEffect(CHuiFxEffect* aEffect);
+    
+    TRequestStatus   iParserStatus;
+    TInt             iBuffersInUse;
+    
+private:
+    // Render buffer management --- native implementations
+    virtual CHuiFxRenderbuffer* AcquireNativeRenderbuffer(const TSize& aDesiredSize) = 0;
+    virtual void ReleaseNativeRenderbuffer(CHuiFxRenderbuffer* aBuffer) = 0;
+
+    // Render buffer cache
+#ifdef HUIFX_RBCACHE_ENABLED
+    CHuiFxRenderbuffer* LookupFreeRenderbuffer(const TSize& aDesiredSize, TBool aAlllowLarger);
+    void InsertFreeRenderbuffer(CHuiFxRenderbuffer *aBuffer);
+    inline TBool IsCacheEmpty() const;
+    inline TBool IsCacheFull() const;
+
+    // simple general renderbuffer cache
+    TInt                iBuffersInCache;
+    CHuiFxRenderbuffer* iBufferCache[CACHE_SIZE];
+#endif
+    
+#ifdef HUIFX_PERF_COUNTERS
+    // TODO! counters for performance evaluation?!
+    TInt iMaxAcquiredBuffers;
+    TInt iMaxFreeBuffers;
+    TSize iMaxBufferSize;
+    TInt iHit;
+    TInt iMiss;
+#endif
+
+    RPointerArray<CHuiFxEffect>  iActiveEffects;
+    THuiFxEngineType             iType;
+    TRect                        iExtRect;
+    CHuiFxEffectCache *iCache;
+    TInt iLowGraphicsMemoryMode;
+    RArray<TInt> iActiveEffectGroups;
+    };
+
+#endif /*HUIFXENGINE_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxFilter.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXFILTER_H_
+#define HUIFXFILTER_H_
+
+class CHuiFxParameterManager;
+
+#include "HuiFxEngine.h"
+#include "HuiFxRenderbuffer.h"
+#include "HuiFxParameter.h"
+#include "HuiFxConstants.h"
+#include "HuiFxParameterCollection.h"
+
+class CHuiFxFilter: public CBase, public MHuiFxParameterCollection
+    {
+public:
+    IMPORT_C virtual ~CHuiFxFilter();
+    IMPORT_C virtual TBool PrepareDrawL(CHuiFxEngine& aEngine);
+    IMPORT_C virtual TBool Draw(CHuiFxEngine& aEngine, CHuiGc& aGc, CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource,
+                               const TRect& aTargetRect, const TRect& aSourceRect) = 0;
+    // CalculateMargin will be called before PrepareDrawL(), so 
+    // parameters are not ready, so margin calculation need to use 
+    // either previous frame parameter values, or should be independent 
+    // of parameters. Should do nothing else than set value for aMargin.
+    IMPORT_C virtual void CalculateMargin(TMargins &aMargin) const;
+
+    // TODO: which of these are really needed?
+    IMPORT_C void SetMargin(const TSize& aMargin);
+    IMPORT_C const TSize& Margin() const;
+    IMPORT_C const TMargins &Margin2() const;
+    IMPORT_C void SetFreeForm(TBool aEnable);
+    IMPORT_C TBool IsFreeForm() const;
+    IMPORT_C void AdvanceTime(TReal32 aElapsedTime);
+    IMPORT_C TBool Changed() const;
+    IMPORT_C void SetVisualRect(const TRect& aVisualRect);
+    IMPORT_C const TRect& VisualRect() const;
+
+    IMPORT_C MHuiFxParameter* Parameter(const TDesC& aName);
+    IMPORT_C virtual CHuiFxFilter *CloneL() const=0;
+
+protected:
+    IMPORT_C void ConstructL();
+    IMPORT_C void RegisterParameterL(const TDesC& aName, TRgb* aValue);
+    IMPORT_C void RegisterParameterL(const TDesC& aName, TReal32* aValue);
+    IMPORT_C void CopyParameterL(const TDesC& aName, TRgb* aValue, const CHuiFxFilter *aOldFilter);
+    IMPORT_C void CopyParameterL(const TDesC& aName, TReal32* aValue, const CHuiFxFilter *aOldFilter);
+    IMPORT_C void CopyFromL(const CHuiFxFilter *aOldFilter); // copies all baseclass CHuiFxFilter parameters
+    IMPORT_C TBool ParameterChanged();
+    
+    TReal32 iOpacity;
+
+private:
+    CHuiFxParameterManager* iParameterManager;
+    TSize               iMargin; // not used
+    TBool               iIsFreeForm;
+    TBool               iParameterChanged;
+    TBool               iFirstParameterCheck;
+    TBool               iFrameCount;
+    TRect               iVisualRect;
+    mutable TMargins            iMargin2;
+    };
+
+#endif /*HUIFXFILTER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxFilterLayer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXFILTERLAYER_H_
+#define HUIFXFILTERLAYER_H_
+
+#include "HuiFxLayer.h"
+
+//FORWARD DECLARATIONS
+class CHuiFxFilter;
+
+class CHuiFxFilterLayer: public CHuiFxLayer
+    {
+public:
+    IMPORT_C ~CHuiFxFilterLayer();
+    IMPORT_C static CHuiFxFilterLayer* NewL(CHuiFxFilter* aFilter); // takes ownership
+    IMPORT_C TBool PrepareDrawL(CHuiFxEngine& aEngine);
+    IMPORT_C void Draw(CHuiFxEngine& aEngine, CHuiGc& aGc, CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource);
+    IMPORT_C CHuiFxFilter& Filter() const;
+    IMPORT_C TBool Changed() const;
+    IMPORT_C void AdvanceTime(TReal32 aElapsedTime);
+    IMPORT_C TBool Margin(TMargins &m);
+public: // effect cache
+    IMPORT_C CHuiFxFilterLayer *CloneL() const;
+    IMPORT_C void SetExtRect( TRect *aExtRect );
+    IMPORT_C void SetVisual( CHuiVisual *aVisual );
+    IMPORT_C void SetVisual( MHuiEffectable *aVisual );
+
+    TBool IsFiltered() const; 
+    
+protected:
+    CHuiFxFilterLayer();
+    void ConstructL(CHuiFxFilter* aFilter);
+
+private:
+    CHuiFxFilter*             iFilter;
+    };
+
+#endif /*HUIFXFILTERLAYER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxGroupLayer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXGROUPLAYER_H_
+#define HUIFXGROUPLAYER_H_
+
+#include "HuiFxLayer.h"
+
+class CHuiFxGroupLayer: public CHuiFxLayer
+    {
+public:
+    IMPORT_C ~CHuiFxGroupLayer();
+    IMPORT_C static CHuiFxGroupLayer* NewL(TBool aIsRoot = EFalse);
+    IMPORT_C TBool PrepareDrawL(CHuiFxEngine& aEngine);
+    IMPORT_C void Draw(CHuiFxEngine& aEngine, CHuiGc& aGc, CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource);
+    IMPORT_C void AddLayerL(const CHuiFxLayer* aLayer); // takes ownership
+    IMPORT_C void AdvanceTime(TReal32 aElapsedTime);
+    IMPORT_C TBool Changed() const;
+    
+    IMPORT_C TBool VisualArea( TRect& aRect );
+    IMPORT_C TBool Margin( TMargins &aMargin ); 
+    IMPORT_C void ApplyMargin( TRect &aRect );   
+    
+    // effect cache methods
+    IMPORT_C CHuiFxGroupLayer *CloneL() const;
+    IMPORT_C void SetExtRect( TRect *aExtRect );
+    IMPORT_C void SetVisual( CHuiVisual *aVisual );
+    IMPORT_C void SetVisual( MHuiEffectable *aVisual );
+
+    TBool IsAnimated() const;
+    TBool IsTransformed() const; 
+    TBool IsFiltered() const; 
+    TBool IsSemitransparent() const;
+    
+    TInt LayerCount() const;
+    CHuiFxLayer& Layer(TInt aIndex) const;
+    void FxmlVisualInputs(RArray<THuiFxVisualSrcType> &aArray);
+    virtual void EnableMarginApplyChildren(TBool aEnable);
+protected:
+    IMPORT_C CHuiFxGroupLayer();
+    IMPORT_C void ConstructL(TBool aIsRoot);
+private:
+    RPointerArray<CHuiFxLayer> iLayers;
+    TBool                   iIsRoot;
+    TRect                   iBackbufferRect;
+    };
+
+#endif /*HUIFXGROUPLAYER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxLayer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,100 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXLAYER_
+#define HUIFXLAYER_
+
+#include "HuiFxEngine.h"
+#include "HuiFxRenderbuffer.h"
+
+//FORWARD DECLARATIONS
+class MHuiEffectable;
+
+class CHuiFxLayer: public CBase
+    {
+public:
+    IMPORT_C virtual ~CHuiFxLayer();
+
+    IMPORT_C virtual TBool PrepareDrawL(CHuiFxEngine& aEngine);
+    virtual void Draw(CHuiFxEngine& aEngine, CHuiGc& aGc, CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource) = 0;
+    IMPORT_C virtual TBool VisualArea(TRect& aRect);
+    IMPORT_C virtual TBool Margin( TMargins &m );
+    IMPORT_C virtual void AdvanceTime(TReal32 aElapsedTime);
+    IMPORT_C virtual TBool Changed() const;
+    
+    IMPORT_C THuiFxLayerType Type();
+    
+    IMPORT_C void SetBlendingMode(THuiFxBlendingMode aOp);
+    IMPORT_C THuiFxBlendingMode BlendingMode() const;
+
+    IMPORT_C void SetDisplayArea(const TRect& aRect);
+    IMPORT_C void SetSourceRect(const TRect& aRect);
+    IMPORT_C void SetTargetRect(const TRect& aRect);
+    IMPORT_C void SetVisualRect(const TRect& aRect);
+
+    IMPORT_C const TRect& SourceRect() const;
+    IMPORT_C const TRect& TargetRect() const;
+    IMPORT_C const TRect& VisualRect() const;
+public: // effect cache
+    IMPORT_C virtual CHuiFxLayer *CloneL() const=0;
+    IMPORT_C virtual void SetExtRect( TRect *aExtRect )=0;
+    IMPORT_C virtual void SetVisual( CHuiVisual *aVisual )=0;
+    IMPORT_C virtual void SetVisual( MHuiEffectable *aVisual )=0;
+    IMPORT_C void CopyFromL(const CHuiFxLayer *aOldLayer);
+
+
+    // Internal flag to tell wheter layer is animated
+    virtual TBool IsAnimated() const;
+    void SetAnimated(TBool aAnimated);
+
+    // Internal flag to tell wheter layer is transformed
+    virtual TBool IsTransformed() const; 
+    void SetTransformed(TBool aTransformed);
+
+    // Internal flag to tell wheter layer is filtered
+    virtual TBool IsFiltered() const; 
+
+    // Internal flag to tell wheter margin is enabled
+    void EnableMargin(TBool aEnable);
+    virtual void EnableMarginApplyChildren(TBool aEnable);
+    TBool IsMarginEnabled() const;
+    
+    // Internal flag to tell wheter transparency is enabled
+    virtual TBool IsSemitransparent() const;
+    
+    virtual void FxmlVisualInputs(RArray<THuiFxVisualSrcType> &aArray) { }
+protected:
+    IMPORT_C CHuiFxLayer();
+    IMPORT_C void ConstructL( THuiFxLayerType aType );
+
+protected:
+    TRect               iDisplayArea; // used for clipping the effects to the real display area
+    
+private:
+    THuiFxBlendingMode  iBlendingOp;
+    THuiFxLayerType     iLayerType;
+    TRect               iSourceRect;
+    TRect               iTargetRect;
+    TRect               iVisualRect;
+    TBool               iAnimated;
+    TBool               iTransformed;
+    TBool               iMarginEnabled;
+    };
+
+#endif /*HUIFXLAYER_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxParameter.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,150 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXPARAMETER_H_
+#define HUIFXPARAMETER_H_
+
+#include <e32std.h>
+#include <gdi.h>
+
+enum THuiFxParameterType
+    {
+    EParameterTypeScalar,
+    EParameterTypeColor,
+    };
+
+enum THuiFxReferencePoint
+    {
+    EReferencePointIdentity,
+    EReferencePointUndefined,
+    EReferencePointVisualWidth,
+    EReferencePointVisualHeight,
+    EReferencePointVisualTop,
+    EReferencePointVisualBottom,
+    EReferencePointVisualLeft,
+    EReferencePointVisualRight,
+    EReferencePointDisplayWidth,
+    EReferencePointDisplayHeight,
+    EReferencePointDisplayTop,
+    EReferencePointDisplayBottom,
+    EReferencePointDisplayLeft,
+    EReferencePointDisplayRight,
+    EReferencePointExtRectWidth,
+    EReferencePointExtRectHeight,
+    EReferencePointExtRectTop,
+    EReferencePointExtRectBottom,
+    EReferencePointExtRectLeft,
+    EReferencePointExtRectRight,
+   
+    };
+
+class MHuiFxParameter
+    {
+public:
+    virtual ~MHuiFxParameter();
+    virtual void AdvanceTime(TReal32 aElapsedTime) = 0;
+    virtual THuiFxParameterType Type() const = 0;
+    virtual TBool IsAnimated() const = 0;
+    virtual void Update() = 0;
+    
+    virtual void SetReferencePoint(THuiFxReferencePoint aRef) = 0;
+    virtual THuiFxReferencePoint ReferencePoint() const = 0;
+    virtual void SetReferenceValue(TReal32 aValue) = 0;
+    virtual TReal32 ReferenceValue() const = 0;
+    
+    virtual void SetStartReference( THuiFxReferencePoint aRef ) = 0; 
+    virtual THuiFxReferencePoint StartReference() const = 0;
+    virtual void SetStartValue( TReal32 aValue ) = 0;
+    virtual TReal32 StartValue() const = 0;
+    virtual void SetStartMultiplier( TReal32 aValue ) = 0;
+    
+    virtual void SetEndReference( THuiFxReferencePoint aRef ) = 0; 
+    virtual THuiFxReferencePoint EndReference() const = 0;
+    virtual void SetEndValue( TReal32 aValue ) = 0;
+    virtual TReal32 EndValue() const = 0;
+    virtual void SetEndMultiplier( TReal32 aValue ) = 0;
+
+    virtual MHuiFxParameter *CloneL() const=0;
+    virtual void ReRef(TReal32 *aValue)=0;
+    virtual void ReRef(TRgb *aValue)=0;
+    };
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+// This class is not derived from CBase because it is a template class + a mixin class.
+// If the class is derived from CBase, the static_cast to actual class points to a wrong place
+// All members are zeroed or set to default values in the constructor, so deriving from
+// CBase does not really provide any additional functionality.
+class CHuiFxGenericParameter: /*public CBase,*/ public MHuiFxParameter
+    {
+public:
+    typedef TYPE ValueType;
+    
+    CHuiFxGenericParameter(TYPE* aValue);
+    ~CHuiFxGenericParameter();
+    void SetTimeLine(TIMELINE_TYPE* aTimeLine); // takes ownership
+    void AdvanceTime(TReal32 aElapsedTime);
+    TBool IsAnimated() const;
+    THuiFxParameterType Type() const;
+    void SetValue(TYPE aValue);
+    void Update();
+
+    void SetReferencePoint(THuiFxReferencePoint aRef);
+    THuiFxReferencePoint ReferencePoint() const;
+    void SetReferenceValue(TReal32 aValue);
+    TReal32 ReferenceValue() const;
+    
+    void SetStartReference( THuiFxReferencePoint aRef ); 
+    THuiFxReferencePoint StartReference() const;
+    void SetStartValue( TReal32 aValue );
+    TReal32 StartValue() const;
+    void SetStartMultiplier( TReal32 aValue );
+    void SetEndReference( THuiFxReferencePoint aRef ); 
+    THuiFxReferencePoint EndReference() const;
+    void SetEndValue( TReal32 aValue );
+    TReal32 EndValue() const;
+    void SetEndMultiplier( TReal32 aValue );
+    CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE> *CloneL() const;
+    void ReRef(TReal32 *aValue);
+    void ReRef(TRgb *aValue);
+
+private:
+    // Not implemented, not supported
+    CHuiFxGenericParameter(const CHuiFxGenericParameter&);
+    CHuiFxGenericParameter& operator=(const CHuiFxGenericParameter&);
+
+private:
+    TIMELINE_TYPE*              iTimeLine;
+    TYPE                        iRelValue;
+    TYPE*                       iValue;
+    TReal32                     iTime;
+    TBool                       iAnimationFinished;
+    TBool                       iLastFrameDrawn;
+    THuiFxReferencePoint        iRefPoint;
+    TReal32                     iRefValue;
+    THuiFxReferencePoint        iStartRef;
+    TReal32                     iStartValue;
+    TReal32                     iStartMultiplier;
+    THuiFxReferencePoint        iEndRef;
+    TReal32                     iEndValue;
+    TReal32                     iEndMultiplier;
+    };
+
+#include "HuiFxParameter.inl"
+
+#endif /*HUIFXPARAMETER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxParameter.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,321 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef HUIFXPARAMETER_INL
+#define HUIFXPARAMETER_INL
+
+#include <e32debug.h>
+
+#include "HuiFxTimeLine.h"
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::CHuiFxGenericParameter(TYPE* aValue):
+    iValue(aValue),
+    iRelValue(*aValue),
+    iTimeLine(NULL),
+    iTime(0.0f),
+    iAnimationFinished(EFalse),
+    iLastFrameDrawn(EFalse),
+    iRefPoint(EReferencePointIdentity),
+    iRefValue(0.0f),
+    iStartRef(EReferencePointUndefined),
+    iStartValue(0.0f),
+    iStartMultiplier(1.0f),
+    iEndRef(EReferencePointUndefined),
+    iEndValue(0.0f),
+    iEndMultiplier(1.0f)
+      {
+      }
+
+void CleanupFxParameterL(MHuiFxParameter* aParameter);
+
+template<typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE> *CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::CloneL() const
+{
+    CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE> *p = new (ELeave) CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>(iValue);
+    p->iRelValue = iRelValue;
+    if (iTimeLine)
+        {
+        CleanupFxParameterL(p);
+        p->iTimeLine = iTimeLine->CloneL();
+        CleanupStack::Pop();
+        }
+    else
+        {
+        p->iTimeLine = NULL;
+        }
+    p->iTime = iTime;
+    p->iAnimationFinished = iAnimationFinished;
+    p->iLastFrameDrawn = iLastFrameDrawn;
+    p->iRefPoint = iRefPoint;
+    p->iRefValue = iRefValue;
+    p->iStartRef = iStartRef;
+    p->iStartValue = iStartValue;
+    p->iStartMultiplier = iStartMultiplier;
+    p->iEndRef = iEndRef;
+    p->iEndValue = iEndValue;
+    p->iEndMultiplier = iEndMultiplier;
+    p->iValue = iValue;
+    return p;
+}
+void ReRefInternal(TReal32 *aValue, TReal32 **aValue2);
+void ReRefInternal(TRgb *aValue, TRgb **aValue2);
+void ReRefInternal(TReal32 *aValue, TRgb **aValue2);
+void ReRefInternal(TRgb *aValue, TReal32 **aValue2);
+
+template<typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+void CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::ReRef(TReal32 *aValue)
+    {
+    ReRefInternal(aValue, &iValue);
+    }
+template<typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+void CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::ReRef(TRgb *aValue)
+    {
+    ReRefInternal(aValue, &iValue);
+    }
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::~CHuiFxGenericParameter()
+    {
+    delete iTimeLine;
+    iTimeLine = NULL;
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+void CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::SetTimeLine(TIMELINE_TYPE* aTimeLine)
+    {
+    if (iTimeLine != aTimeLine)
+        {
+        delete iTimeLine;
+        iTimeLine = aTimeLine;
+        iAnimationFinished = EFalse;
+        iLastFrameDrawn = EFalse;
+        }
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+void CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::SetValue(TYPE aValue)
+    {
+    iRelValue = *iValue = aValue;
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+THuiFxParameterType CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::Type() const
+    {
+    return TYPE_CODE;
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+TBool CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::IsAnimated() const
+    {
+    if (!iTimeLine)
+        {
+        return EFalse;
+        }
+    return !iAnimationFinished;
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+void CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::SetReferencePoint(THuiFxReferencePoint aRef)
+    {
+    iRefPoint = aRef;
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+THuiFxReferencePoint CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::ReferencePoint() const
+    {
+    return iRefPoint;
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+void CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::SetReferenceValue(TReal32 aValue)
+    {
+    iRefValue = aValue;
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+TReal32 CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::ReferenceValue() const
+    {
+    return iRefValue;
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+void CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::SetStartReference(THuiFxReferencePoint aRef)
+    {
+    iStartRef = aRef;
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+THuiFxReferencePoint CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::StartReference() const
+    {
+    return iStartRef;
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+void CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::SetStartValue(TReal32 aValue)
+    {
+    iStartValue = aValue;
+//    RDebug::Print(_L("parameter iStartValue = %f"), iStartValue );
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+void CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::SetStartMultiplier(TReal32 aValue)
+    {
+    iStartMultiplier = aValue;
+//    RDebug::Print(_L("parameter iStartValue = %f"), iStartValue );
+    }
+
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+TReal32 CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::StartValue() const
+    {
+    return iStartValue;
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+void CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::SetEndReference(THuiFxReferencePoint aRef)
+    {
+    iEndRef = aRef;
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+THuiFxReferencePoint CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::EndReference() const
+    {
+    return iEndRef;
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+void CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::SetEndValue(TReal32 aValue)
+    {
+    iEndValue = aValue;
+//    RDebug::Print(_L("parameter iEndValue = %f"), iEndValue );
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+TReal32 CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::EndValue() const
+    {
+    return iEndValue;
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+void CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::SetEndMultiplier(TReal32 aValue)
+    {
+    iEndMultiplier = aValue;
+//    RDebug::Print(_L("parameter iStartValue = %f"), iStartValue );
+    }
+
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+void CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::AdvanceTime(TReal32 aElapsedTime)
+    {
+    if (!iTimeLine)
+        {
+        return;
+        }
+
+    iTime += aElapsedTime;
+
+    switch (iTimeLine->LoopingMode())
+        {
+        case ELoopingModeRepeat:
+            {
+            // TODO: precalc
+            // TODO: keep everything in fixed point
+            TInt fpLoopStart = (TInt)(iTimeLine->LoopStart() * iTimeLine->Duration() * 0x10000);
+            TInt fpLoopEnd = (TInt)(iTimeLine->LoopEnd() * iTimeLine->Duration() * 0x10000);
+            TInt fpTime = (TInt)(iTime * 0x10000);
+            
+            if (fpLoopEnd - fpLoopStart > 0)
+                {
+                fpTime = fpLoopStart + ((fpTime - fpLoopStart) % (fpLoopEnd - fpLoopStart));
+                }
+            else
+                {
+                fpTime = fpLoopEnd;
+                }
+            iTime = fpTime / (TReal32)0x10000;
+            break;
+            }
+        case ELoopingModeNone:
+            if (iTime > iTimeLine->Duration())
+                {
+                if ( iLastFrameDrawn )
+                    {
+                    iAnimationFinished = ETrue;
+                    }
+                else
+                    {
+                    iLastFrameDrawn = ETrue;
+                    }
+                }
+            break;
+        }
+    }
+
+template <typename TYPE, typename TIMELINE_TYPE, THuiFxParameterType TYPE_CODE>
+void CHuiFxGenericParameter<TYPE, TIMELINE_TYPE, TYPE_CODE>::Update()
+    {
+    // Calculate the current value
+    if (iTimeLine)
+        {
+        iRelValue = iTimeLine->ValueAt(iTime);
+//        RDebug::Print(_L("parameter rel value = %f at time %f"), iRelValue, iTime );
+        }
+        
+    TBool extRefUsed = ( iStartRef != EReferencePointUndefined && iEndRef != EReferencePointUndefined );    
+        
+    if ( extRefUsed )
+        {
+        // mix start and end values
+        // Note: this will break horribly for anything other than scalar values
+        ASSERT(TYPE_CODE == EParameterTypeScalar);
+//        *iValue = ( 1 - (*reinterpret_cast<TReal32*>(&iRelValue)) ) * iStartValue + (*reinterpret_cast<TReal32*>(&iRelValue)) * iEndValue;
+        iRelValue = ( 1 - (*reinterpret_cast<TReal32*>(&iRelValue)) ) * iStartValue * iStartMultiplier  + (*reinterpret_cast<TReal32*>(&iRelValue)) * iEndValue * iEndMultiplier;
+//        RDebug::Print(_L("parameter with extrect %f at time %f"), iRelValue, iTime);
+        }
+    
+    // Transform by the reference point
+    switch (iRefPoint)
+        {
+        case EReferencePointIdentity:
+        case EReferencePointUndefined:
+            *iValue = iRelValue;
+            break;
+        default:
+            // Note: this will break horribly for anything other than scalar values
+            ASSERT(TYPE_CODE == EParameterTypeScalar);
+            if ( extRefUsed )
+                {
+                if ( iRefValue != 0 )
+                    {
+                    *iValue = (*reinterpret_cast<TReal32*>(&iRelValue)) / iRefValue;
+                    }
+                else
+                    {
+                    // If the reference value is 0, no calculations make sense.
+                    *iValue = iRefValue;
+                    }
+//                RDebug::Print(_L("scaled parameter with extrect %f at time %f"), *iValue, iTime);
+                }
+            else
+                {
+                *iValue = (*reinterpret_cast<TReal32*>(&iRelValue)) * iRefValue;
+                }
+            break;
+        }
+    }
+
+#endif // HUIFXPARAMETER_INL
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxParameterCollection.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXPARAMETERCOLLECTION_H_
+#define HUIFXPARAMETERCOLLECTION_H_
+
+#include <e32std.h>
+
+class MHuiFxParameter;
+
+class MHuiFxParameterCollection
+    {
+public:
+    // virtual RParameterMap* Parameters() = 0 const;
+    virtual MHuiFxParameter* Parameter(const TDesC& aName) = 0;
+    // does not take ownership
+    //virtual void RegisterParameterL(const TDesC& aName, TRgb* aColor) = 0;
+    //virtual void RegisterParameterL(const TDesC& aName, TReal32* aScalar) = 0;
+    };
+
+#endif /*HUIFXPARAMETERCOLLECTION_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxParameterManager.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXPARAMETERMANAGER_H_
+#define HUIFXPARAMETERMANAGER_H_
+
+#include "HuiFxParameter.h"
+#include "HuiFxParameterCollection.h"
+#include <e32std.h>
+#include <e32hashtab.h>
+
+class CHuiFxEngine;
+class TRgb;
+
+/**
+ *  A hash map containing named layer and filter parameters
+ */
+typedef RPtrHashMap<TDesC, MHuiFxParameter> RHuiFxParameterMap;
+
+class CHuiFxParameterManager: public CBase, public MHuiFxParameterCollection
+    {
+public:
+    static CHuiFxParameterManager* NewL();
+    ~CHuiFxParameterManager();
+
+    MHuiFxParameter* Parameter(const TDesC& aName);
+
+    // does not take ownership
+    void RegisterParameterL(const TDesC& aName, TRgb* aColor);
+    void RegisterParameterL(const TDesC& aName, TReal32* aScalar);
+    
+    TBool HasAnimatedParameters() const;
+    void AdvanceTime(TReal32 aElapsedTime);
+    TBool Update(CHuiFxEngine& aEngine, const TRect& aVisualRect);
+public: // effect cache
+    CHuiFxParameterManager* CloneL() const;
+    void CopyParameterL(const TDesC &aName, TReal32 *aValue, const CHuiFxParameterManager *aOldValues);
+    void CopyParameterL(const TDesC &aName, TRgb *aValue, const CHuiFxParameterManager *aOldValues);
+private:
+    CHuiFxParameterManager();
+    void ConstructL();
+    void ResolveReference( TReal32& aDefaultValue, THuiFxReferencePoint aRef, CHuiFxEngine& aEngine, const TRect& aVisualRec );
+
+    RHuiFxParameterMap      iParameters;
+    };
+
+#endif /* HUIFXPARAMETERMANAGER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxRenderbuffer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXRENDERBUFFER_H_
+#define HUIFXRENDERBUFFER_H_
+
+#include "HuiFxConstants.h"
+#include <uiacceltk/HuiGc.h>
+
+class CHuiFxRenderbuffer: public CBase
+    {
+protected:
+    IMPORT_C CHuiFxRenderbuffer();
+    // TODO: luminance-only render buffers
+    // TODO: optional alpha channel?
+    IMPORT_C void ConstructL(const TSize& aSize, TRenderBufferType aBufferType);
+public:
+    IMPORT_C virtual ~CHuiFxRenderbuffer();
+
+    virtual CHuiGc& BindAsRenderTarget() = 0;
+    virtual void BindAsTexture(THuiFxRenderbufferUsage aUsage) = 0;
+    virtual void UnbindAsRenderTarget() = 0;
+    virtual void UnbindAsTexture() = 0;
+    
+    virtual void PrepareForReuse(const TSize& aReusedSize) = 0;
+
+    IMPORT_C const TSize& Size() const;
+    IMPORT_C const TRenderBufferType& BufferType() const;
+    
+    // Position relative to screen coordinates
+    IMPORT_C void SetPosition(TPoint aPosition);
+    IMPORT_C const TPoint& Position() const;
+    
+    // Background is read (or not) from current surface when PrepareForReuse is called.
+    IMPORT_C void EnableBackground(TBool aEnable); 
+        
+protected:    
+    TSize                iSize;
+    TRenderBufferType    iType;
+    TPoint               iPosition;
+    TBool                iBackgroundEnabled;
+    };
+
+#endif /*HUIFXRENDERBUFFER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxScalarParameter.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXSCALARPARAMETER_H_
+#define HUIFXSCALARPARAMETER_H_
+
+#include "HuiFxParameter.h"
+#include "HuiFxTimeLine.h"
+
+/**
+ *  Animation timeline for scalar values
+ */
+typedef RHuiFxTimeLine<TReal32, TInt32> RHuiFxScalarTimeLine;
+
+/*
+ *  Scalar parameter
+ */
+typedef CHuiFxGenericParameter<TReal32, RHuiFxScalarTimeLine, EParameterTypeScalar> CHuiFxScalarParameter;
+
+#endif /*HUIFXSCALARPARAMETER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxTimeLine.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,123 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXTIMELINE_H_
+#define HUIFXTIMELINE_H_
+
+enum THuiFxLoopingMode
+    {
+    ELoopingModeNone,
+    ELoopingModeRepeat,
+    };
+
+enum THuiFxInterpolationMode
+    {
+    EInterpolationModeHold,
+    EInterpolationModeLinear,
+    EInterpolationModeQuadraticBezier,
+    EInterpolationModeCubicBezier,
+    EInterpolationModeInQuad,
+    EInterpolationModeOutQuad,
+    EInterpolationModeInOutQuad,
+    EInterpolationModeOutInQuad,
+    EInterpolationModeInBack,
+    EInterpolationModeOutBack,
+    EInterpolationModeInOutBack,
+    EInterpolationModeOutInBack,
+/*    
+    EInterpolationModeDecelerate,
+    EInterpolationModeAccelerate,
+    EInterpolationModeImpulse,
+    EInterpolationModeSineWave
+*/    
+    };
+
+template <typename TYPE, typename FPTYPE>
+class RHuiFxTimeLine
+    {
+public:
+    RHuiFxTimeLine();
+    ~RHuiFxTimeLine();
+
+    // TODO: tangent control, ease in/out
+    void AppendKeyFrameL(TReal32 aTime, TYPE aValue);
+    void AppendKeyFrameL(TReal32 aTime, TYPE aValue, TYPE aAuxValue1);
+    void AppendKeyFrameL(TReal32 aTime, TYPE aValue, TYPE aAuxValue1, TYPE aAuxValue2);
+     void SetLoopStart(TReal32 aTime);
+    TReal32 LoopStart() const;
+    void SetLoopEnd(TReal32 aTime);
+    TReal32 LoopEnd() const;
+    TReal32 Duration() const;
+    void SetDuration(TReal32 aDuration);
+    void SetInterpolationMode(THuiFxInterpolationMode aMode);
+    THuiFxInterpolationMode InterpolationMode() const;
+    void SetLoopingMode(THuiFxLoopingMode aMode);
+    THuiFxLoopingMode LoopingMode() const;
+    TYPE ValueAt(TReal32 aTime);
+    
+    RHuiFxTimeLine* CloneL();
+protected:
+    FPTYPE ToFixedPoint(const TYPE& aValue);
+    TYPE FromFixedPoint(const FPTYPE& aValue);
+    FPTYPE Blend(const FPTYPE& aValue1, const FPTYPE& aValue2, TInt32 aAlpha);
+    FPTYPE WeightedSum4(const FPTYPE& aValue1, const FPTYPE& aValue2, const FPTYPE& aValue3, const FPTYPE& aValue4,
+                        TInt32 aWeight1, TInt32 aWeight2, TInt32 aWeight3, TInt32 aWeight4);
+    TReal32 LocalTime(TReal32 aTime) const;
+
+private:
+    // Not implemented
+    RHuiFxTimeLine(const RHuiFxTimeLine& aTimeLine);
+    RHuiFxTimeLine& operator=(const RHuiFxTimeLine& aTimeLine);
+    
+private:
+    class TKeyFrame
+        {
+    public:
+        /** Time */
+        TReal32             iTime;
+        
+        /** Fixed point time */
+        TInt32              iFpTime;
+        
+        /** Value */
+        TYPE                iValue;
+
+        /** Fixed point value */
+        FPTYPE              iFpValue;
+        
+        /** Auxiliary values for bezier interpolation */
+        TYPE                iAuxValue[2];
+        FPTYPE              iFpAuxValue[2];
+        };
+    
+    typedef RArray<TKeyFrame> TKeyFrames;
+
+    TReal32                 iTime;
+    TReal32                 iDuration;
+    TKeyFrames              iKeyFrames;
+    TInt                    iLastIndex;
+    TReal32                 iLoopStart;
+    TReal32                 iLoopEnd;
+    THuiFxLoopingMode       iLoopingMode;
+    THuiFxInterpolationMode iInterpolationMode;
+    };
+
+#include "HuiFxTimeLine.inl"
+
+#endif /*HUIFXTIMELINE_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxTimeLine.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,493 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXTIMELINE_INL_
+#define HUIFXTIMELINE_INL_
+
+#include <e32def.h>
+#include "uiacceltk/huifixmath.h"
+
+template <typename TYPE, typename FPTYPE>
+RHuiFxTimeLine<TYPE, FPTYPE>::RHuiFxTimeLine():
+    iLastIndex(0),
+    iDuration(5.0f),
+    iLoopStart(0.0f),
+    iLoopEnd(0.0f),
+    iLoopingMode(ELoopingModeNone),
+    iInterpolationMode(EInterpolationModeHold)
+    {
+    }
+
+template <typename TYPE, typename FPTYPE>
+RHuiFxTimeLine<TYPE, FPTYPE>::~RHuiFxTimeLine()
+    {
+    iKeyFrames.Close();
+    }
+
+template <typename TYPE, typename FPTYPE>
+void RHuiFxTimeLine<TYPE, FPTYPE>::SetLoopStart(TReal32 aTime)
+    {
+    iLoopStart = aTime;
+    }
+
+template <typename TYPE, typename FPTYPE>
+TReal32 RHuiFxTimeLine<TYPE, FPTYPE>::LoopStart() const
+    {
+    return iLoopStart;
+    }
+
+template <typename TYPE, typename FPTYPE>
+void RHuiFxTimeLine<TYPE, FPTYPE>::SetLoopEnd(TReal32 aTime)
+    {
+    iLoopEnd = aTime;
+    }
+
+template <typename TYPE, typename FPTYPE>
+TReal32 RHuiFxTimeLine<TYPE, FPTYPE>::LoopEnd() const
+    {
+    return iLoopEnd;
+    }
+
+template <typename TYPE, typename FPTYPE>
+void RHuiFxTimeLine<TYPE, FPTYPE>::SetDuration(TReal32 aDuration)
+    {
+    // Can't change this when keyframes have been defined
+    __ASSERT_DEBUG(iKeyFrames.Count() == 0, User::Invariant());
+    iDuration = aDuration;
+    }
+
+template <typename TYPE, typename FPTYPE>
+TReal32 RHuiFxTimeLine<TYPE, FPTYPE>::Duration() const
+    {
+    return iDuration;
+    }
+
+template <typename TYPE, typename FPTYPE>
+void RHuiFxTimeLine<TYPE, FPTYPE>::SetInterpolationMode(THuiFxInterpolationMode aMode)
+    {
+    iInterpolationMode = aMode;
+    }
+
+template <typename TYPE, typename FPTYPE>
+THuiFxInterpolationMode RHuiFxTimeLine<TYPE, FPTYPE>::InterpolationMode() const
+    {
+    return iInterpolationMode;
+    }
+
+template <typename TYPE, typename FPTYPE>
+void RHuiFxTimeLine<TYPE, FPTYPE>::SetLoopingMode(THuiFxLoopingMode aMode)
+    {
+    iLoopingMode = aMode;
+    }
+
+template <typename TYPE, typename FPTYPE>
+THuiFxLoopingMode RHuiFxTimeLine<TYPE, FPTYPE>::LoopingMode() const
+    {
+    return iLoopingMode;
+    }
+
+template <typename TYPE, typename FPTYPE>
+void RHuiFxTimeLine<TYPE, FPTYPE>::AppendKeyFrameL(TReal32 aTime, TYPE aValue)
+    {
+    // The aux values don't matter (non-bezier), just pass aValue
+    AppendKeyFrameL(aTime, aValue, aValue, aValue);
+    }
+
+template <typename TYPE, typename FPTYPE>
+void RHuiFxTimeLine<TYPE, FPTYPE>::AppendKeyFrameL(TReal32 aTime, TYPE aValue, TYPE aAuxValue1)
+    {
+    // The second aux value doesn't matter (quad bezier), just pass aValue
+    AppendKeyFrameL(aTime, aValue, aAuxValue1, aValue);
+    }
+
+template <typename TYPE, typename FPTYPE>
+void RHuiFxTimeLine<TYPE, FPTYPE>::AppendKeyFrameL(TReal32 aTime, TYPE aValue, TYPE aAuxValue1, TYPE aAuxValue2)
+    {
+    aTime *= iDuration;
+    
+    // Don't allow out of order keyframes
+    if (iKeyFrames.Count() &&
+        iKeyFrames[iKeyFrames.Count() - 1].iTime >= aTime)
+        {
+        User::Leave(KErrArgument);
+        }
+    
+    TKeyFrame k;
+    k.iTime = aTime;
+    k.iFpTime = (TInt)(k.iTime * 0x10000);
+    k.iValue = aValue;
+    k.iFpValue = ToFixedPoint(aValue);
+    k.iAuxValue[0] = aAuxValue1;
+    k.iAuxValue[1] = aAuxValue2;
+    k.iFpAuxValue[0] = ToFixedPoint(aAuxValue1);
+    k.iFpAuxValue[1] = ToFixedPoint(aAuxValue2);
+    iKeyFrames.AppendL(k);
+    }
+
+template <typename TYPE, typename FPTYPE>
+TYPE RHuiFxTimeLine<TYPE, FPTYPE>::ValueAt(TReal32 aTime)
+    {
+    TInt i;
+    
+    if (!iKeyFrames.Count())
+        {
+        return 0;
+        }
+    
+    // Can we use the last index?
+    if (iLastIndex < iKeyFrames.Count() - 1 &&
+        iKeyFrames[iLastIndex].iTime <= aTime)
+        {
+        i = iLastIndex;
+        }
+    else
+        {
+        i = 0;
+        }
+    
+    for (; i < iKeyFrames.Count() - 1; i++)
+        {
+        if (iKeyFrames[i + 1].iTime > aTime)
+            {
+            break;
+            }
+        }
+    
+    iLastIndex = i;
+    
+    if (iInterpolationMode == EInterpolationModeHold ||
+        i == iKeyFrames.Count() - 1)
+        {
+        return iKeyFrames[i].iValue;
+        }
+    
+    ASSERT(i < iKeyFrames.Count() - 1);
+    TInt dt = iKeyFrames[i + 1].iFpTime - iKeyFrames[i].iFpTime;
+    TInt t = (TInt)(aTime * 0x10000); 
+
+    ASSERT(dt > 0);
+    t -= iKeyFrames[i].iFpTime;
+    TInt64 t2 = t;
+    t = (TInt)((t2 << 16) / dt);
+    ASSERT(t >= 0 && t <= 0x10000);
+
+    FPTYPE a = iKeyFrames[i].iFpValue;
+    FPTYPE b = iKeyFrames[i + 1].iFpValue;
+    FPTYPE c = 0; // only used for Bezier
+    TInt64 t64 = t; // time as 64bit integer
+//    TInt angle = 0; // used for sine curves
+//    TInt anglePos = 0; // used for sine curves
+    
+    switch (iInterpolationMode)
+        {
+        case EInterpolationModeLinear:
+            { 
+            return FromFixedPoint(Blend(a, b, t));
+            break;
+            }
+            
+        case EInterpolationModeQuadraticBezier:
+            {
+            // a has been set outside the switch to iKeyFrames[i].iFpValue
+            b = iKeyFrames[i].iFpAuxValue[0];
+            c = iKeyFrames[i + 1].iFpValue;
+            TInt64 oneminust = 0x10000 - t;
+
+            ASSERT(0 <= oneminust && oneminust <= 0x10000);
+            
+            TInt64 wa = ((oneminust * oneminust) >> 16);            // (1 - t)^2
+            TInt64 wb = (t64 * oneminust) >> 15;                    // 2t(1 - t)
+            TInt64 wc = (t64 * t64) >> 16; wc = (wc * t64) >> 16;   // t^2
+            
+            // All weights [0,1]
+            ASSERT(0 <= wa && wa <= 0x10000);
+            ASSERT(0 <= wb && wb <= 0x10000);
+            ASSERT(0 <= wc && wc <= 0x10000);
+            return FromFixedPoint(WeightedSum4(a, b, c, a, (TInt)wa, (TInt)wb, (TInt)wc, 0));
+            }
+            break;
+            
+        case EInterpolationModeCubicBezier:
+            {
+            // a has been set outside the switch to iKeyFrames[i].iFpValue
+            b = iKeyFrames[i].iFpAuxValue[0];
+            c = iKeyFrames[i].iFpAuxValue[1];
+            FPTYPE d = iKeyFrames[i + 1].iFpValue;
+            TInt64 oneminust = 0x10000 - t;
+            
+            ASSERT(0 <= oneminust && oneminust <= 0x10000);
+
+            TInt64 tsq = t64 * t64;
+            TInt64 oneminustsq = oneminust * oneminust;
+            
+            // (1 - t)^3 (48 bits if t = 0)
+            TInt64 wa = (oneminust * oneminustsq) >> 32;
+            // 3t(1 - t)^2
+            TInt64 wb = (3 * t64 * oneminustsq) >> 32;
+            // 3t^2(1 - t)
+            TInt64 wc = (3 * tsq * oneminust) >> 32;
+            // t^3
+            TInt64 wd = (t64 * tsq) >> 32;
+            
+            // All weights [0,1]
+            ASSERT(0 <= wa && wa <= 0x10000);
+            ASSERT(0 <= wb && wb <= 0x10000);
+            ASSERT(0 <= wc && wc <= 0x10000);
+            ASSERT(0 <= wd && wd <= 0x10000);
+            return FromFixedPoint(WeightedSum4(a, b, c, d, wa, wb, wc, wd));
+            }
+            break;
+            
+        case EInterpolationModeInQuad:
+            {
+            // definition: c*(t/=d)*t + b
+            TInt quadt = (t64 * t64) >> 16;
+            return FromFixedPoint(Blend(a, b, quadt));
+            break;
+            }
+        case EInterpolationModeOutQuad:
+            {
+            // definition: -c *(t/=d)*(t-2) + b
+            // our t is aldready divided by d, so the coefficient becomes
+            // (2 - t)*t = 2*t - t*t
+            TInt quadt = (t64 * t64) >> 16;
+            TInt twot = t << 1; // t*2
+            twot = twot - quadt;
+            return FromFixedPoint(Blend(a, b, twot));
+            }
+            break;
+        case EInterpolationModeInOutQuad:
+            {
+            // acceleration until halfway, then deceleration
+            // if((t/=d/2) < 1 c/2*t*t + b
+            // else -c/2 *((--t)*(t-2) - 1) + b
+            // Out t has been divided by d, but it must be multiplied by 2 to get t/=d/2
+            TInt64 twot = t64 << 1; // t*2 (t/=d/2), this is what is used instead of t in the following equations
+            
+            TInt64 quadt = (twot * twot) >> 17; // (t*t)/2;
+            if ( twot < 0x10000 )
+                {
+                return FromFixedPoint(Blend(a, b, quadt));
+                }
+            else
+                {
+                // -((t-1)*(t-1-2)-1)/2 = -((t-1)*(t-3)-1)/2 = -((t*t-4*t+3)-1)/2
+                // = -(t*t-4*t+2)/2 = 2*t-t*t/2-1
+                twot = (twot << 1) - quadt - 0x10000; 
+                return FromFixedPoint(Blend(a, b, (TInt)twot));
+                }
+            }
+            break;
+        case EInterpolationModeOutInQuad:
+            {
+            // decleration until halfway, then acceleration
+            // Out t has been divided by d, but it must be multiplied by 2 to get t/=d/2
+            
+            TInt64 twot = t64 << 1; // t*2 (t/=d/2), this is what is used instead of t in the following equations
+
+            if ( twot < 0x10000 )
+                {
+                TInt64 quadt = (twot * twot) >> 16;
+                twot = twot << 1; // t*2
+                twot = twot - quadt;
+                b = ( a + b ) / 2;
+                return FromFixedPoint(Blend(a, b, (TInt)twot));
+                }
+            else
+                {
+                twot = twot - 0x10000;
+                TInt64 quadt = (twot * twot) >> 16;
+                a = ( a + b ) / 2;
+                return FromFixedPoint(Blend(a, b, (TInt)quadt));
+                }
+            }
+            break;
+        case EInterpolationModeInBack:
+            {
+            // Easing equation function for a back (overshooting cubic easing:
+            // (s+1)*t^3 - s*t^2 easing in: accelerating from zero velocity.
+            c = iKeyFrames[i].iFpAuxValue[0];  // This is already scaled to the same fixed scale as time
+            TInt64 quadt = (t64 * t64) >> 16;
+            TInt64 cubict = (quadt * t64) >> 16;
+            TInt64 splusone = c + 0x10000;
+            c = (splusone * cubict + c * quadt) >> 16;
+            
+            return FromFixedPoint(Blend(a, b, c));
+            }
+            break;
+        case EInterpolationModeOutBack:
+            {
+            // Easing equation function for a back (overshooting cubic easing:
+            // (s+1)*t^3 - s*t^2 easing out: decelerating from zero velocity.
+            
+            // definition: c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b (note variable names not ours)
+            // this becomes (s+1)*(t-1)^3 + s*(t-1)^2 + 1
+            c = iKeyFrames[i].iFpAuxValue[0]; // this is s
+            
+            TInt64 tminusone = t - 0x10000;
+            TInt64 quadt = (tminusone * tminusone) >> 16;
+            TInt64 cubict = (quadt * tminusone) >> 16;
+            TInt64 splusone = c + 0x10000;
+            c = ((splusone * cubict + c * quadt) >> 16) + 0x10000; // TP 1 => 0x10000
+            
+            return FromFixedPoint(Blend(a, b, c));
+            }
+            break;
+        case EInterpolationModeInOutBack:
+            {
+            // Easing equation function for a back (overshooting cubic easing:
+            // (s+1)*t^3 - s*t^2) easing in/out: acceleration until halfway, then deceleration.
+            
+            // definition (note variable names not ours):
+            // if((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b
+            // else return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b
+
+            // Out t has been divided by d, but it must be multiplied by 2 to get t/=d/2
+            TInt64 twot = t64 << 1; // t*2 (t/=d/2), this is what is used instead of t in the following equations
+
+            c = iKeyFrames[i].iFpAuxValue[0];
+            TInt64 magic1 = ToFixedPoint( 1.525 );
+            c = ( magic1 * c ) >> 16;
+            
+            if ( twot < 0x10000 )
+                {
+                // ((s+1)*t^3 - s*t^2)/2
+                TInt64 quadt = (twot * twot) >> 16;
+                TInt64 cubict = (quadt * twot) >> 16;
+                quadt = (c * quadt) >> 16;
+                cubict = ((c + 0x10000) * cubict) >> 16;
+                c = (cubict - quadt) >> 1;
+                return FromFixedPoint(Blend(a, b, c));
+                }
+            else
+                {
+                twot = twot - 0x20000; // t-=2
+                // ((s+1)*t^3 - s*t^2 + 2)/2
+                TInt64 quadt = (twot * twot) >> 16;
+                TInt64 cubict = (quadt * twot) >> 16;
+                quadt = (c * quadt) >> 16;
+                cubict = ((c + 0x10000) * cubict) >> 16;
+                c = (cubict - quadt + 0x20000) >> 1;
+                return FromFixedPoint(Blend(a, b, c));
+                }
+            }
+            break;
+        case EInterpolationModeOutInBack:
+            {
+            // Easing equation function for a back (overshooting cubic easing:
+            // (s+1)*t^3 - s*t^2 easing out/in: deceleration until halfway, then acceleration.
+            c = iKeyFrames[i].iFpAuxValue[0];
+            TInt64 twot = t64 << 1; // t*2
+            
+            if ( twot < 0x10000 ) // TP t => twot (NOTE, THIS CHANGE IS STILL UNCERTAIN IF IT IS VALID!)
+                {
+                // outback
+                // (s+1)*(t-1)^3 + s*(t-1)^2 + 1
+                TInt64 tminusone = twot - 0x10000;
+                TInt64 quadt = (tminusone * tminusone) >> 16;
+                TInt64 cubict = (quadt * tminusone) >> 16;
+                TInt64 splusone = c + 0x10000;
+                c = ((splusone * cubict + c * quadt) >> 16) + 0x10000; // TP 1 => 0x10000
+                b = ( a + b ) / 2;
+                return FromFixedPoint(Blend(a, b, c));
+                }
+            else
+                {
+                // inback
+                //["inback"]((t*2)-d, b+c/2, c/2, d, s)
+                // (s+1)*t^3 - s*t^2
+                twot = twot - 0x10000;
+                TInt64 quadt = (twot * twot) >> 16;
+                TInt64 cubict = (quadt * twot) >> 16;
+                TInt64 splusone = c + 0x10000;
+                c = (splusone * cubict + c * quadt) >> 16;
+                a = ( a + b ) / 2;
+                return FromFixedPoint(Blend(a, b, c));
+                }
+            break;
+            }
+/*            
+        case EInterpolationModeDecelerate:
+            {
+            // Decelerating quarter of a sine wave.
+            angle = HuiFixMath::FixMul((t/2)+32768,KFixPi);
+            anglePos = HuiFixMath::FixCos(angle);
+            t = (((65536 - anglePos) / 2) - 32768) * 2;
+            return FromFixedPoint(Blend(a, b, t));
+            }
+            break;
+        case EInterpolationModeAccelerate:
+            {
+            // Accelerating quarter of a sine wave.
+            angle = HuiFixMath::FixMul( ( t / 2 ), KFixPi );
+            anglePos = HuiFixMath::FixCos( angle );
+            t = 65536 - anglePos;
+            return FromFixedPoint( Blend( a, b, t ) );
+            }
+            break;
+        case EInterpolationModeImpulse:
+            {
+            // Sine wave curve.
+            angle = HuiFixMath::FixMul( t, KFixPi );
+            anglePos = HuiFixMath::FixCos( angle );
+            t = ( 65536 - anglePos ) / 2;
+            return FromFixedPoint( Blend( a, b, t ) );
+            }
+            break;
+*/            
+        default:
+            {
+            // Unsupported interpolation modes default to linear
+            return FromFixedPoint(Blend(a, b, t));
+            }
+            break;
+        }
+    // not reached
+    return 0;
+    }
+
+template <typename TYPE, typename FPTYPE>
+RHuiFxTimeLine<TYPE, FPTYPE>* RHuiFxTimeLine<TYPE, FPTYPE>::CloneL()
+    {
+    RHuiFxTimeLine* dup = new (ELeave) RHuiFxTimeLine;
+    
+    dup->iTime = iTime;
+    dup->iDuration = iDuration;
+    
+    TInt err = KErrNone;
+    for (TInt i = 0; i < iKeyFrames.Count() && err == KErrNone; ++i)
+        {
+        err = dup->iKeyFrames.Append(iKeyFrames[i]);
+        }
+    if ( err != KErrNone )
+        {
+        delete dup;
+        User::Leave( err );
+        }
+    
+    dup->iLastIndex = iLastIndex;
+    dup->iLoopStart = iLoopStart;
+    dup->iLoopEnd = iLoopEnd;
+    dup->iLoopingMode = iLoopingMode;
+    dup->iInterpolationMode = iInterpolationMode;
+    
+    return dup;
+    }
+
+#endif /*HUIFXTIMELINE_INL_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiFxVisualLayer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXVISUALLAYER_
+#define HUIFXVISUALLAYER_
+
+class CHuiFxParameterManager;
+
+#include "HuiFxLayer.h"
+#include "HuiFxParameter.h"
+#include "HuiCmdBufferBrush.h" // MHuiEffectable
+
+class CHuiFxVisualLayer: public CHuiFxLayer
+    {
+public:
+    IMPORT_C static CHuiFxVisualLayer* NewL(MHuiEffectable& aVisual);
+    IMPORT_C ~CHuiFxVisualLayer();
+    IMPORT_C TBool PrepareDrawL(CHuiFxEngine& aEngine);
+    IMPORT_C void Draw(CHuiFxEngine& aEngine, CHuiGc& aGc, CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource);
+    IMPORT_C TBool VisualArea( TRect& aRect );
+    IMPORT_C void AdvanceTime(TReal32 aElapsedTime);
+    IMPORT_C TBool Changed() const;
+    IMPORT_C TBool Margin(TMargins &m);
+
+    IMPORT_C MHuiFxParameter* Parameter(const TDesC& aName);
+    void SetSourceType( const THuiFxVisualSrcType aSrcType );
+    THuiFxVisualSrcType SourceType() const;
+    void SetExtBitmapFileL( TDesC& aFilename );
+    TBool IsSemitransparent() const;
+    
+public: // effect cache
+    IMPORT_C CHuiFxVisualLayer *CloneL() const;
+    IMPORT_C void SetExtRect( TRect *aExtRect );
+    IMPORT_C void SetVisual( CHuiVisual *aVisual );
+    IMPORT_C void SetVisual( MHuiEffectable *aVisual );
+
+    void FxmlVisualInputs(RArray<THuiFxVisualSrcType> &aArray);
+protected:
+    IMPORT_C void ConstructL(MHuiEffectable& aVisual);
+    
+    void RegisterParameterL(const TDesC& aName, TRgb* aValue);
+    void RegisterParameterL(const TDesC& aName, TReal32* aValue);
+    
+private:
+    void ApplyTransformations(CHuiGc& aGc);
+    
+    //CHuiVisual*         iVisual;
+    MHuiEffectable *    iVisual;
+    CHuiFxParameterManager* iParameterManager;
+    THuiFxVisualSrcType iSrcType; // default is the visual itself
+    
+    TReal32             iTranslationX;
+    TReal32             iTranslationY;
+    TReal32             iTranslationZ;
+    
+    TReal32             iScaleX;
+    TReal32             iScaleY;
+    TReal32             iScaleZ;
+    TReal32             iScaleOriginX;
+    TReal32             iScaleOriginY;
+    TReal32             iScaleOriginZ;
+    
+    TReal32             iRotationOriginX;
+    TReal32             iRotationOriginY;
+    TReal32             iRotationOriginZ;
+    TReal32             iRotationAngle;
+    TReal32             iRotationAxisX;
+    TReal32             iRotationAxisY;
+    TReal32             iRotationAxisZ;
+    
+    TReal32             iSkewAngleX;
+    TReal32             iSkewAngleY;
+    TReal32             iSkewAngleZ;
+    TReal32             iSkewOriginX;
+    TReal32             iSkewOriginY;
+    TReal32             iSkewOriginZ;
+    
+    HBufC* iExtBitmapFile;
+    TReal32 iOpacity;
+
+    };
+
+#endif /*HUIFXVISUALLAYER_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiMatrixStack.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiMatrixStack. CHuiMatrixStack is a stack of 
+*                2D transformation matrices.
+*
+*/
+
+
+
+#ifndef __HUIMATRIXSTACK_H__
+#define __HUIMATRIXSTACK_H__
+
+
+#include <e32base.h>
+#include "uiacceltk/HuiRealPoint.h"
+
+
+/**
+ * Stack of 2D transformation matrices.
+ */
+NONSHARABLE_CLASS(CHuiMatrixStack) : public CBase
+    {
+public:
+
+    /** 2D transformation matrix. */
+    struct TMatrix
+        {   
+    public:        
+        TReal32 iMatrix[9];       
+
+        /** Matrix is an identity matrix. Multiplication can be skipped. */
+        TBool iIsIdentity;
+
+    public:
+        /** Constructor that initializes the matrix as an identity matrix. */
+        IMPORT_C TMatrix();
+
+        /**
+         * Multiplies this matrix with another one. Result is stored in this
+         * matrix.
+         *
+         * @param aOther  Matrix to multiply with.
+         */
+        void Multiply(const TMatrix& aOther);
+
+        /**
+         * Multiplies a point with the matrix.
+         *
+         * @param aPoint  2D point. Modified.
+         */
+        IMPORT_C void Multiply(THuiRealPoint& aPoint) const;
+        };
+    
+    
+public:
+
+    /* Constructors and destructor. */
+    
+    IMPORT_C static CHuiMatrixStack* NewL();
+    
+    static CHuiMatrixStack* NewLC();
+    
+    
+    /**
+     * Destructor.
+     */
+    virtual ~CHuiMatrixStack();
+    
+    
+    /* Methods. */
+    
+    IMPORT_C TInt Count() const;
+
+    IMPORT_C TMatrix& Current();
+
+    /**
+     * @return  Error code.
+     */
+    IMPORT_C TInt Push();
+
+    IMPORT_C void Pop();
+    
+    IMPORT_C void LoadIdentity();
+    
+    IMPORT_C void Multiply(const TMatrix& aMatrix);    
+    
+    
+protected:
+
+    /* Constructors. */
+    
+    CHuiMatrixStack();
+    
+    void ConstructL();    
+        
+    
+private:
+
+    // Typedef for convenience.
+    typedef RArray<TMatrix> RMatrixStack;
+            
+    RMatrixStack iStack;            
+    };
+
+
+#endif // __HUIMATRIXSTACK_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiRasterizedTextMesh.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,222 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of HuiRasterizedTextMesh. CHuiRasterizedTextMesh 
+*                stores a rasterized bitmap version of a text string.
+*
+*/
+
+
+
+#ifndef __HUIRASTERIZEDTEXTMESH_H__
+#define __HUIRASTERIZEDTEXTMESH_H__
+
+#include <e32cmn.h>
+#include <AknPictographDrawerInterface.h>
+
+#include "uiacceltk/HuiTextMesh.h"
+#include "uiacceltk/HuiRealPoint.h"
+#include "uiacceltk/HuiImage.h"
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiTexture.h"
+
+class CFont;
+class CFbsBitmap;
+class CAknPictographInterface;
+
+/**
+ * CHuiRasterizedTextMesh is a concrete implementation of a CHuiTextMesh.
+ * CHuiRasterizedTextMesh uses Symbian's BITGDI text drawing routines and Avkon
+ * BiDi text utilities to draw text onto a bitmap. The bitmap is then copied
+ * onto a CHuiTexture and drawn with CHuiGc. This makes CHuiRasterizedTextMesh
+ * independent of the underlying rendering plugin. Multiple lines of text are
+ * supported.
+ */
+NONSHARABLE_CLASS(CHuiRasterizedTextMesh) : public CHuiTextMesh, public MHuiTextureContentObserver
+    {
+public:
+
+    /* Constructors and destructors. */
+
+    /**
+     * Constructs a new rasterized text mesh.
+     */
+    IMPORT_C static CHuiRasterizedTextMesh* NewL();
+
+    /**
+     * Constructs a new rasterized text mesh and leaves it on the cleanup stack.
+     */
+    static CHuiRasterizedTextMesh* NewLC();
+
+    /**
+     * Destructor.
+     */
+    virtual ~CHuiRasterizedTextMesh();
+
+
+    /* Methods. */
+
+    /**
+     * Resets the contents of the text mesh.
+     */
+    virtual void Reset();
+
+    /**
+     * Draws the text mesh.
+     *
+     * @param aGc             Graphics context.
+     * @param aShadowOpacity  Opacity of shadows.
+     */
+    virtual void Draw(CHuiGc& aGc, TReal32 aShadowOpacity = 1.0) const __SOFTFP;
+
+    void BuildPictographsL();
+
+    virtual void ExpandRectWithShadow(TRect& aRect) const;
+
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Default constructor.
+     */
+    CHuiRasterizedTextMesh();
+
+    /* Methods. */
+
+    void ResetLines();
+    void ResetPictographLines();
+
+    TBool IsMaxLineCountReached() const;
+
+    /**
+     * Updates the mesh and the extents. Both text and font must be set
+     * when this is called.
+     * 
+     * @param aRasterize Set this to ETrue if text is to be rendered. Set to
+     *                   EFalse if you only need to calculate text extents.
+     */
+    virtual void BuildL(TBool aRasterize);
+
+    /**
+     * Draws the lines of the text mesh.
+     */
+    void DrawLines(CHuiGc& aGc, const THuiRealPoint& aOffset,
+                   THuiAlignHorizontal aLineAlignment, TReal32 aShadowOpacity) const;
+
+
+    /**
+     * Draws the pictographlines of the text mesh.
+     */
+    void DrawPictographLines(CHuiGc& aGc, const THuiRealPoint& aOffset,
+                   THuiAlignHorizontal aLineAlignment) const;
+
+
+    /* Implementation of MHuiTextureContentObserver. */
+
+    void TextureContentUploaded(CHuiTexture& aTexture);
+
+    void TextureContentReleased(CHuiTexture& aTexture);
+
+    void RestoreTextureContentL(CHuiTexture& aTexture);
+
+
+private:
+
+    /** Each line of rasterized text is stored in an SLine. */
+    struct SRasterizedLine
+        {
+        SRasterizedLine()
+            {
+            iTexture = NULL;
+            iGap = 0;
+            }
+        /** Texture that holds the rasterized version of a text line. The
+            size of the texture determines the extents of the line. */
+        CHuiTexture* iTexture;
+        
+        /** Extra gap to the next line in pixels. Not applied to the last
+            line. */
+        TInt iGap;
+        };
+
+protected:
+
+    /**
+     * Rasterizes a single line of text using the defined text style.
+     * The result is a new line texture.
+     *
+     * @param aTextLine  The line of text to rasterize.
+     * @param aLine		 SRasterizedLine entry that will
+     *                   store the rasterized line content.
+     *
+     * @return  <code>ETrue</code>, if the maximum number of lines has
+     *          not been reached (rasterization was successful);
+     *          otherwise <code>EFalse</code>. BuildL() is stopped
+     *          when this method returns EFalse.
+     */
+    TBool RasterizeLineL(const TDesC& aTextLine, SRasterizedLine & aLine);
+
+    /**
+     * Rasterizes a single line of pictographs using the specified font.
+     * The result is a new line texture.
+     *
+     * @param aTextLine  The line of text to rasterize.
+     * @param aFont      Font to be used in rasterization.
+     * @param aLine		 SRasterizedLine entry that will
+     *                   store the rasterized line content.
+     *
+     * @return  <code>ETrue</code>, if the maximum number of lines has
+     *          not been reached (rasterization was successful);
+     *          otherwise <code>EFalse</code>. BuildL() is stopped
+     *          when this method returns EFalse.
+     */
+    TBool RasterizePictographLineL(const TDesC& aTextLine, CFont* aFont, SRasterizedLine & aLine);
+
+    /** 
+     * Sets the pictograph interface, ownership is NOT transferred.
+     *
+     * @param aExtents  Width and height of the text mesh.
+     */
+    virtual void InitPictographsL(CAknPictographInterface* aInterface);
+
+    /**
+     * Internal utility for using pre-rasterized mesh
+     */
+    virtual void UpdateMeshL(const TDesC8& aBuffer);
+    
+private:
+    
+    void DoBuildL(TInt aRasterizeFlags);    
+
+private:
+
+    /** Rasterized lines. 
+     * @see SRasterizedLine.
+     */
+    RArray<SRasterizedLine> iLines;
+    
+    /** Rasterized line pictographs.
+     * @see SRasterizedLine.
+     */
+    RArray<SRasterizedLine> iPictographLines;
+
+    /** Bitmap onto which Symbian BITGDI draws pictographs. */
+    CFbsBitmap* iPictographBitmap;
+
+    TBool iUsingPreRasterizedMesh;
+    };
+
+
+#endif // __HUIRASTERIZEDTEXTMESH_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiRenderPlugin.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,307 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiRenderPlugin, a base class for
+*                all rendering plugins / renderers.
+*
+*/
+
+
+
+
+#ifndef __HUIRENDERPLUGIN_H__
+#define __HUIRENDERPLUGIN_H__
+
+
+#include <e32base.h>
+#include <bitdev.h>
+#include <uiacceltk/HuiMesh.h>
+
+#include "HuiRenderPluginBase.h"
+
+
+/* Forward declarations. */
+class MHuiRenderSurface;
+class CHuiEnv;
+class CHuiDisplay;
+class CHuiGc;
+class CHuiTexture;
+class THuiTextureHandle;
+class CHuiTextureManager;
+class THuiFontManager;
+class CHuiTextMesh;
+class CHuiCurvePath;
+class CHuiCanvasGc;
+
+class CHuiFxEngine;
+
+/**
+ * Rendering plugin identifiers.
+ */
+enum THuiRenderPluginId
+    {
+    /** BitGdi renderer for legacy systems. */
+    EHuiRenderPluginBitgdi,
+
+    /** OpenVG 1.0 renderer. */
+    EHuiRenderPluginVg10,
+
+    /** OpenGL ES 1.0 renderer. */
+    EHuiRenderPluginGles10,
+
+    /** OpenGL ES 1.1 renderer. */
+    EHuiRenderPluginGles11,
+
+    /** OpenGL ES 2.0 renderer. */
+    EHuiRenderPluginGles20
+    };
+
+
+/**
+ * Specific rendering features allowed by a plugin.
+ */
+enum THuiRenderPluginAllow
+    {
+    /** The rendering plugin supports 3D projection and allows visuals to use
+        the 3D projection mode. */
+    EHuiRenderPluginAllow3DProjection,
+
+    /** The rendering plugin supports bilinear filtering without considerable
+        performance penalty. */
+    EHuiRenderPluginAllowBilinearFilter,
+
+    /** The rendering plugin supports a multitexturing mode where two textures
+        are interpolated by an arbitrary factor. */
+    EHuiRenderPluginAllowTextureModeInterpolate,
+    
+    /** The rendering plugin allows using pBuffer surfaces for texture preloading */
+    EHuiRenderPluginAllowPBufferSurfaces,
+    
+    /** The rendering plugin allows to preserve buffer content after 
+        eglswapbuffers has been called */
+    EHuiRenderPluginAllowSwapBufferPreserve,
+    
+    /** The rendering plugin allows using pBuffer surfaces for cached visual drawing */
+    EHuiRenderPluginAllowVisualPBufferSurfaces
+    };
+
+
+/**
+ * The common base class for all Hitchcock rendering plugins (renderers).
+ *
+ * For example defines factory methods for creating render specific
+ * implementations for toolkit's resources, such as meshes, graphics
+ * context, textures and the texture manager.
+ *
+ * Rendering plugins are internal to the toolkit.
+ */
+class CHuiRenderPlugin : public CHuiRenderPluginBase
+    {
+public:
+
+    /**
+     * Destructor.
+     */
+    IMPORT_C virtual ~CHuiRenderPlugin();
+
+
+    /* Methods. */
+
+    /**
+     * Determines the identifier of the renderer.
+     */
+    IMPORT_C THuiRenderPluginId Id() const;
+
+    /**
+     * Determines if the renderer allows the usage of a specific
+     * rendering feature or technique.
+     *
+     * @param aAllow  Feature to check.
+     *
+     * @return True, if allowed.
+     */
+    IMPORT_C virtual TBool Allows(THuiRenderPluginAllow aAllow) const;
+
+    /**
+     * Creates a new rendering surface for a HUITK display.
+     *
+     * @param aDisplay  Display.
+     */
+    IMPORT_C virtual MHuiRenderSurface* CreateRenderSurfaceL(CHuiDisplay& aDisplay);
+
+    /**
+     * Creates a new instance of a HUITK graphics context.
+     */
+    IMPORT_C virtual CHuiGc* CreateGcL();
+
+    /**
+     * Creates a new instance of a texture manager.
+     */
+    IMPORT_C virtual CHuiTextureManager* CreateTextureManagerL(CHuiEnv& aEnv);
+
+    /**
+     * Creates a new instance of an effects engine.
+     */
+    IMPORT_C virtual CHuiFxEngine* CreateEffectsEngineL();
+
+    /**
+     * Creates a new instance of font manager. The created font manager instance has
+     * to be freed by the caller. This is used to manage all font instances in Hitchcock UI Toolkit.
+     */
+    IMPORT_C virtual THuiFontManager* CreateFontManagerL() const;
+    
+    /**
+     * Creates a new instance of a texture.
+     *
+     * @param aExistingTexture  Handle to an existing named texture object.
+     *                          The returned CHuiTexture will take ownership
+     *                          of the handle's texture object.
+     */
+    IMPORT_C virtual CHuiTexture* CreateTextureL(const THuiTextureHandle* aExistingTexture = 0);
+
+    /**
+     * Creates a new instance of a texture, and pushes it on the cleanup stack.
+     */
+    IMPORT_C virtual CHuiTexture* CreateTextureLC(const THuiTextureHandle* aExistingTexture = 0);
+
+    /**
+     * Creates a new instance of a mesh.
+     *
+     * @param aMeshType  CHuiMesh derived concrete mesh type.
+     *
+     * @return  Concrete implementation of CHuiMesh.
+     */
+    IMPORT_C virtual CHuiMesh* CreateMeshL(THuiMeshType aMeshType);
+
+    /**
+     * Creates a new instance of a text mesh.
+     */
+    IMPORT_C virtual CHuiTextMesh* CreateTextMeshL() = 0;
+
+    /**
+     * Creates a new instance of a curve path.
+     */
+    IMPORT_C virtual CHuiCurvePath* CreateCurvePathL();
+
+    /**
+     * Deletes a named texture object. Named texture objects are owned
+     * by the graphics API itself.
+     */
+    IMPORT_C virtual void DeleteNamedTexture(TUint aName);
+
+    /**
+     * Notifies this render plugin of a change in current display count.
+     *
+     * @param aCount The current count of displays existing in the HuiToolkit environment.
+     */
+    IMPORT_C virtual void NotifyDisplayCountL(TUint aCount);
+
+    /**
+     * Releases render plugin resources. Release all resources that can restored
+     * later independently by render plugin. Might release for example render surfaces.
+     *
+     * The actual behaviour depends on the inherited class.
+     *
+     * @see RestoreL()
+     */
+    IMPORT_C virtual void Release();
+
+    /**
+     * Restores render plugin resources. Restores all resources released in Release().
+     *
+     * The actual behaviour depends on the inherited class.
+     *
+     * @see Release()
+     */
+    IMPORT_C virtual void RestoreL();
+    
+    /**
+     * Enables off screen bitmap mode 
+     */
+    IMPORT_C virtual void EnableOffScreenBitmapL(TInt aFlags);
+
+    /**
+     * Disables off screen bitmap mode 
+     */
+    IMPORT_C virtual void DisableOffScreenBitmap();
+
+    /**
+     * Gets the pointer to off screen bitmap 
+     */
+    IMPORT_C virtual CFbsBitmap* OffScreenBitmap() const;
+	
+    /**
+     * Updates the latest frame to the off screen bitmap
+     */
+    IMPORT_C virtual void UpdateOffScreenBitmapL(CHuiDisplay& aDisplay);
+
+    /**
+     * Draws the off screen bitmap to the window
+     */
+    IMPORT_C virtual void DrawOffScreenBitmapToWindowL(CHuiDisplay& aDisplay);
+
+    /**
+     * Creates a new instance of a canvas graphics context.
+     */
+    IMPORT_C virtual CHuiCanvasGc* CreateCanvasGcL();
+    
+    /**
+     * Adds flags to render plugin, which can be used e.g. in GC to determine
+     * if the state has to be restored somehow. Each renderer has it's own flags 
+     */
+    IMPORT_C virtual void AddRestoreStateFlags(TInt aFlags);
+    
+    /**
+     * Returns the changed state flags
+     */
+    IMPORT_C virtual TInt GetRestoreStateFlags();
+    
+    /**
+     * Clears the state flags
+     */
+    IMPORT_C virtual void ClearRestoreStateFlags();
+    
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Default constructor.
+     */
+    IMPORT_C CHuiRenderPlugin(THuiRenderPluginId aId);
+
+protected: // New methods
+    
+    /**
+     * Provides expandability, helps keeping the binary compatibility. Since virtual
+     * table is now exported and this class is dll derivable and the implementation
+     * is more difficult to change, hence this method, which can provide additional
+     * extension APIs.
+     * 
+     * @param aExtensionUid     UID, which is being used for recognizing the extension
+     * @param aExtensionParams  Return pointer to the extension API, once recognized from the extension uid
+     */
+    IMPORT_C virtual void RenderPluginExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+    
+private:
+
+    /** Identifier of the plugin. */
+    THuiRenderPluginId iId;
+
+    /** Spare member to help keeping binary compatibility, since HuiRenderPlugin
+        is now dll derivable **/
+    TInt iSpare;
+    };
+
+
+#endif // __HUIENV_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiRenderPluginBase.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Abstract base class for renderer plugins
+*
+*/
+
+
+
+#ifndef HUIRENDERERPLUGINBASE_H
+#define HUIRENDERERPLUGINBASE_H
+
+#include <e32base.h>
+
+const TUid KUidHuiRenderPluginBase = { 0x200113D4 };
+
+/**
+ *  Abstract base class for renderer plugins
+ *  Renderer plugins are implemented as ECom plug-ins derived from this interface.
+ *  Each plugin specifies in its ECom IMPLEMENTATION_INFO default_data field the
+ *  API type it handles. For Excample OpenGLES11
+ *
+ *  @lib //?library
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CHuiRenderPluginBase ) : public CBase
+    {
+
+public:
+
+    /**
+     * Two-phased constructor.
+     * @param aMatchData The type of the renderer plugin for example OpenGLES11
+     */
+    inline static CHuiRenderPluginBase* NewL( const TDesC& aMatchData );
+    
+    /**
+    * Destructor.
+    */
+    inline virtual ~CHuiRenderPluginBase();
+
+protected:
+
+    CHuiRenderPluginBase();
+
+private: // data
+
+    /**
+     * A unique UID used in interface destruction
+     */
+	TUid	iDtor_ID_Key;
+
+    };
+
+#include "HuiRenderPluginBase.inl"
+
+#endif // HUIRENDERERPLUGINBASE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiRenderPluginBase.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Abstract base class for renderer plugins
+*
+*/
+
+
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+inline CHuiRenderPluginBase::CHuiRenderPluginBase()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+inline CHuiRenderPluginBase::~CHuiRenderPluginBase()
+    {
+	REComSession::DestroyedImplementation(iDtor_ID_Key);
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+//
+inline CHuiRenderPluginBase* CHuiRenderPluginBase::NewL(const TDesC& aMatchData)
+	{
+	// Convert match data to 8-bits
+	HBufC8* buf = HBufC8::NewLC(aMatchData.Length());
+	TPtr8 data = buf->Des();
+	data.Copy(aMatchData);
+	data.LowerCase();	// change to lower case
+
+	// Set resolving parameters
+	TEComResolverParams resolverParams;
+	resolverParams.SetDataType(data);
+
+	// Get the instantiation
+	CHuiRenderPluginBase* renderPlugin = REINTERPRET_CAST(CHuiRenderPluginBase*,
+									REComSession::CreateImplementationL(KUidHuiRenderPluginBase,
+																		_FOFF(CHuiRenderPluginBase, iDtor_ID_Key),
+																		resolverParams));
+	CleanupStack::PopAndDestroy(buf);
+	return renderPlugin;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiRenderSurface.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,189 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines interface for HUITK render surfaces. The rendering 
+*                surface is a destination where rendered graphics will 
+*                ultimately end up.
+*
+*/
+
+
+
+#ifndef __HUIRENDERSURFACE_H__
+#define __HUIRENDERSURFACE_H__
+
+
+#include <e32base.h>
+
+
+/* Forward declarations. */
+class MHuiSegmentedTexture;
+class MHuiTargetBitmap;
+class CFbsBitGc;
+
+
+/**
+ * The render surface is a destination where rendered graphics will ultimately
+ * end up. This may be, e.g., the display frame buffer or a bitmap in memory.
+ */
+class MHuiRenderSurface
+    {
+public:
+
+	/** Render surface flags */
+	enum TFlags
+    	{
+    	EFlagNone =                            0x0,
+		/** Surface uses double buffering. */    	
+		EFlagUseDoubleBuffering =              0x1,
+		/** Surface uses dirty rects. */    	
+    	EFlagUseDirtyRects =                   0x2,
+    	/** Surface uses transformed clipping rects. */
+    	EFlagUsetransformedClippingRects =     0x4,
+    	/** Surface uses Symbian graphics context rects. */
+    	EFlagUseSymbianGC =                    0x8
+    	};
+
+public:
+
+    /**
+     * Virtual destructor.
+     */
+    IMPORT_C virtual ~MHuiRenderSurface();
+    
+    /**
+     * Returns the flags of the render surface.
+     * @return Flags.
+     */
+    virtual TUint Flags() const = 0;
+    
+    /**
+     * Determines the location of the rendering surface on the screen.
+     *
+     * @param aOrigin  Top left corner coordinates returned here, in absolute screen
+     *                 coordinates. The top left corner of the screen is (0, 0).
+     *
+     * @return  If location successfully determined, returns <code>ETrue</code>.
+     *          If the surface is an off-screen surface, returns <code>EFalse</code>.
+     */
+    virtual TBool GetScreenOrigin(TPoint& aOrigin) const = 0;
+
+    /**
+     * Determines the size of the surface.
+     *
+     * @return  Size of the surface in pixels.
+     */
+    virtual TSize Size() const = 0;
+
+    /**
+     * Changes the size of the surface.
+     *
+     * @param aSize  Size of surface in pixels.
+     */
+    virtual void SetSizeL(const TSize& aSize) = 0;
+
+    /**
+     * Makes this the current rendering surface for any drawing operations.
+     * Call CHuiStatic::SetCurrentRenderSurface().
+     */
+    virtual void MakeCurrent() = 0;
+
+    /**
+     * Swaps the back buffer to the front.
+     */
+    virtual void SwapBuffers() = 0;
+
+    /**
+     * Binds a texture to the surface to be used during subsequent drawing
+     * operations.
+     *
+     * In practice, the texture is bound to the rendering context
+     * of this render surface. When something is drawn in the surface's 
+     * rendering context, the texture specified here is used.
+     *
+     * @param aTextureUnit Texture unit number to bind the texture to. Binding
+     * to different units enables multitexturing, but using multiple texture
+     * units (multitexturing) may not be supported.
+     * @param aTexture The texture to be bound.
+     * @param activeTextureSegment Index of the texture segment to be bound.
+     * operations. 
+     */
+    virtual void BindTexture(TInt aTextureUnit,
+                             const MHuiSegmentedTexture& aTexture,
+                             TInt activeTextureSegment) = 0;
+
+    /**
+     * Handles change in surface visibility. This method is called if surface is either
+     * hidden or shown.
+     *
+     * @param aIsVisible ETrue if surface becomes visible. EFalse if surface is hidden.
+     */
+    virtual void HandleVisibilityEvent(TBool aIsVisible) = 0;
+
+    /**
+    * Temporarily release the resources of this rendering surface. You
+    * can call this method to free up resources related to the rendering surface,
+    * for example when the display goes to background (ie. render surface is not needed).
+    * @see RestoreL() 
+    */
+    virtual void Release() = 0;
+    
+    /**
+    * Recreate any released resources of this rendering surface. You
+    * can call this method to recreate resources related to rendering surface,
+    * for example, when the display comes back to foreground (ie. becomes visible).
+    * @see Release() 
+    */
+    virtual void RestoreL() = 0;
+
+    /**
+    * Handles change in the intended usage of display. Most render surfaces do not
+    * have any special functionality for different display usage scenarios.
+    */
+    virtual void HandleDisplayUsageChangeL() = 0;
+
+
+    /**
+    * Sets the dirty region i.e. the rectangular area that needs to be updated.
+    * 
+    * Writing a real implementation for this might not be needed if the renderer
+    * does not support dirty region handling.
+    * 
+    * @param aRect The rectangular area that is dirty
+    */
+    virtual void SetDirtyRect(const TRect& aRect) = 0;
+    
+    /**
+     * Returns the back buffer bitmap.
+     * 
+     * Writing a real implementation for this might not be needed if the renderer
+     * does not support symbian graphics context.
+     *
+     * @return  Back buffer bitmap.
+     */
+    virtual MHuiTargetBitmap* BackBuffer() = 0;
+
+    /**
+     * Provides expandability, helps keeping the binary compatibility. Since virtual
+     * table is now exported and this class is dll derivable and the implementation
+     * is more difficult to change, hence this method, which can provide additional
+     * extension APIs.
+     * 
+     * @param aExtensionUid     UID, which is being used for recognizing the extension
+     * @param aExtensionParams  Return pointer to the extension API, once recognized from the extension uid
+     */
+    virtual void RenderSurfaceExtension(const TUid& aExtensionUid, TAny** aExtensionParams) = 0;
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiRosterEntry.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIROSTERENTRY_H__
+#define __HUIROSTERENTRY_H__
+
+
+#include <e32base.h>
+
+
+/* Forward declarations. */
+class CHuiControlGroup;
+class CHuiVisual;
+
+
+/**
+ * Control group reference in the roster. Each entry has a list of root 
+ * visuals.
+ */
+NONSHARABLE_CLASS(CHuiRosterEntry) : public CBase
+	{
+public:
+    
+    /* Constructors and destructors. */
+    
+    /**
+     * Constructor.
+     */
+    CHuiRosterEntry(CHuiControlGroup& aGroup);
+    
+    /**
+     * Destructor. 
+     */
+    ~CHuiRosterEntry();
+    
+    /* Methods. */
+    
+    /**
+     * Determines the control group of the entry.
+     */
+    CHuiControlGroup& ControlGroup() const;
+    
+
+private:
+
+    /** Control group of the entry. */
+    CHuiControlGroup& iGroup;
+    
+    
+public:
+
+    /* Public data. */    
+    
+    /** Array of root visuals. */
+    RPointerArray<CHuiVisual> iRootVisuals;
+
+	};
+	
+#endif // __HUIROSTERENTRY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiRosterImpl.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,503 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiRosterImpl. CHuiRosterImpl implements the interface
+*                defined by CHuiRoster.
+*
+*/
+
+
+
+#ifndef __HUIROSTERIMPL_H__
+#define __HUIROSTERIMPL_H__
+
+
+#include "uiacceltk/HuiRoster.h"
+#include "uiacceltk/huieventhandler.h"
+#include "uiacceltk/HuiEvent.h"
+#include "uiacceltk/HuiRealPoint.h"
+#include "uiacceltk/HuiRealPoint.h"
+#include "uiacceltk/HuiGc.h"
+#include "huieffectable.h"
+
+/* Forward declarations. */
+class CHuiDisplay;
+class CHuiLongTapDetector;
+class CHuiLayout;
+struct THuiPointerEventDetails;
+
+class CHuiFxEngine;
+class CHuiFxEffect;
+
+class CHuiCanvasGc;
+class CHuiCanvasRenderBuffer;
+
+const TReal32 KDefaultDragTresholdInPixelsX = 4.0;
+const TReal32 KDefaultDragTresholdInPixelsY = 4.0;
+
+/**
+ * Roster defines a priority order of control groups shown an a display.
+ * The roster also offers input events to the groups, and handles the
+ * drawing of the groups' root visuals.
+ * Implements the CHuiRoster abstract base class.
+ *
+ * @see CHuiRoster
+ */
+NONSHARABLE_CLASS(CHuiRosterImpl) : public CHuiRoster, MHuiEffectable
+	{
+public:
+
+	/* Constructors and destructor. */
+
+	/**
+	 * Constructor.
+	 *
+	 * @param aDisplay  Initial display associated with the roster.
+	 */
+	CHuiRosterImpl(CHuiDisplay* aDisplay);
+
+	/**
+	 * Second-phase constructor.
+	 */
+	void ConstructL();
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~CHuiRosterImpl();
+
+
+	/* Methods. */
+	
+	/**
+	 * Sets the current display that is using the roster. Multiple displays 
+	 * may share a roster, but only one of the them uses it at a time.
+	 *
+	 * @param aDisplay  Display. Can be <code>NULL</code>.
+	 */
+	void SetDisplay(CHuiDisplay* aDisplay);
+	
+    /**
+     * Recalculates layout starting from root visuals.
+     */
+    void SetRect(const TRect& aRect);	
+
+    TRect Rect() const;	
+
+    void ShowL(CHuiControlGroup& aGroup, TInt aWhere = KHuiRosterShowAtTop);
+	
+	void Hide(CHuiControlGroup& aGroup);
+	    
+    TInt Find(CHuiControlGroup* aGroup) const;
+    
+    /**
+     * Returns the number of control groups.
+     */
+    TInt Count() const;    
+    
+    /**
+     * Returns a control group.
+     */
+    CHuiControlGroup& ControlGroup(TInt aIndex) const;
+    
+    /**
+     * Finds a control inside the roster.
+     *
+     * @param aControlId  Identifier of the control to find.
+     *
+     * @return  Pointer to the control.  <code>NULL</code>, if not found.
+     */
+    CHuiControl* FindControl(TInt aControlId) const;
+
+    /**
+     * Prepares the visuals for drawing. All visuals
+     * are prepared before the actual drawing begins.
+     * 
+     * The visuals are prepared in the same
+     * order than they get drawn.
+     * 
+     * @see Draw()
+     * 
+	 * This default implementation is not
+	 * leaving, since it traps the prepare errors
+	 * inside and handles the errors by calling
+	 * the visual owner prepare draw failed callback.
+	 * 
+	 * @see MHuiVisualOwner::VisualPrepareDrawFailed()
+	 * 
+	 * @return ETrue if the prepare succeeded, or EFail if 
+	 * the prepare failed. Failing to prepare a draw 
+	 * terminates the screen refresh and drawing 
+	 * for the current frame.
+	 * 
+     */
+	TBool PrepareDraw() const;
+    
+    /**
+     * Draw the visuals tree. This is done by
+     * recursively drawing the root visuals
+     * in the order they have been added.
+     * 
+     * Note that you can affect the drawing order
+     * by calling the MoveVisualToFront - methods.
+     *
+     * @param aGc           Graphics context to draw into.
+     */
+    void Draw(CHuiGc& aGc) const;
+
+    /**
+     * Draw the visuals tree. This is done by
+     * recursively drawing the root visuals
+     * in the order they have been added.
+     * 
+     * Note that you can affect the drawing order
+     * by calling the MoveVisualToFront - methods.
+     *
+     * @param aGc           Graphics context to draw into.
+     * @param aDisplay Alterative display where visual tree 
+     * is to be drawn.
+     */
+    void Draw(CHuiGc& aGc, CHuiDisplay* aDisplay) const;
+    void DrawSelf(CHuiGc& aGc, CHuiDisplay* aDisplay) const;
+    void DrawSelfFrozen(CHuiGc& aGc, CHuiDisplay* aDisplay) const;
+    
+    /**
+     * Assigns the visual as a root visual and makes
+     * the area of the visual to cover the entire
+     * display.
+     * 
+     * Also, associates Rosters display with the visual.
+     * @see HideVisual()
+     * @see SetVisualToFullArea()
+     */
+    void ShowVisualL(CHuiVisual* aVisual);
+
+    /**
+     * Adds the visual to the list of root visuals. Also
+     * also sets the visual to the full area.
+     * 
+     * @see ShowVisualL()
+     */
+    void HideVisual(CHuiVisual* aVisual);
+   
+    /**
+     * Gives input focus to a control.
+     */
+    void SetFocus(CHuiControl& aControl);
+    
+    /**
+     * Clears the input focus so that no control has focus.
+     */
+    void ClearFocus();
+                
+    /**
+     * Called when a key event occurs. The input event is offered to the 
+     * controls in the order defined by the groups.
+     */    
+    TBool HandleEventL(const THuiEvent& aEvent);
+    
+    /**
+     * Tell all visuals to post their change notifications.
+     */
+    void ScanDirty();
+
+    /**
+     * Tell all visuals to post their change notifications.
+     */
+    void ScanTransformedDirty(CHuiGc& aGc, CHuiDisplay* aDisplay);
+
+    /**
+     * Moves a root visual to the front inside its roster entry.
+     *
+     * @param aRootVisual  Visual to move.
+     */
+    void MoveVisualToFront(CHuiVisual* aRootVisual);
+
+    /**
+     * Moves a root visual to the front inside its roster entry.
+     *
+     * @param aRootVisual  Visual to move.
+     */
+    void MoveVisualToFront(const CHuiVisual& aRootVisual);
+
+    /**
+     * Moves a root visual to the given position.
+     *
+     * @param aRootVisual  Visual to move.
+     */
+    void Move(CHuiVisual* aVisual, TInt aPos);
+    
+    /**
+     * Updates the layout positions of all the root visuals in this roster.
+     * Typically called on a resolution change.
+     */
+    void UpdateLayout();
+    
+    /**
+     * Notifies all visuals of a change in the environment's skin.
+     */
+    void NotifySkinChangedL();
+    
+    /**
+     * Debug help for dumping the visual trees to the console.
+     */
+    void DumpRootLevelTrees() const;
+    /**
+     * Clear change flags of the visuals in the roster. This is called by the
+     * refresh loop after the frame has been fully drawn.
+     */    
+    void ClearChanged();
+    
+    RHuiObserverArray<MHuiEventHandler>& Observers(THuiInputType aInputType);
+    
+    /**
+     * Sets treshold which pointer needs to be moved before starting to send 
+     * drag events.Default treshold is zero pixels, so any movement will 
+     * trigger drag events.
+     *
+     * NOTE: Not every unit type is feasible. Use only types like:
+     * EHuiUnitPixel, EHuiUnitRelativeToDisplay, EHuiUnitS60
+     *
+     * @param aEventHandler  Event handler to which treshold affects.
+     * @param aXYMetric  Treshold in metric units.
+     */
+    void SetPointerDragThresholdL(const MHuiEventHandler& aEventHandler, const THuiXYMetric& aXYMetric);
+
+    /**
+     * Disables long tap events when dragging is going on. Default 
+     * functionality is that long tap event will be delivered simultaneously
+     * with drag events. 
+     *
+     * @param aEventHandler  Event handler to which disabling goes.
+     * @param aDisable  Boolean to indicate whether feature is disabled or not.
+     */
+    void  DisableLongTapEventsWhenDraggingL(const MHuiEventHandler& aEventHandler, TBool aDisable = ETrue);
+	
+    /**
+     * Tells if this roster has control groups which have transformations to be applied.
+     * @return ETrue if transformations exist for any control group, otherwise EFalse
+     */
+	TBool HasTransformedControlGroups() const;
+	
+    /**
+     * Enables or disbles drawing external content to canvas visuals. This can be set during drawing the visual hierarchy.
+     *
+     * @param aEnable Enable or disable external content. 
+     */
+	void SetDrawingExternalContent(TBool aEnable);
+	
+    /**
+     * Returns whether external content can be drawn to canvas visuals.
+     *
+     * @return Content drawing state. 
+     */
+	TBool IsDrawingExternalContent() const;
+
+    /**
+     * Removes the external content visual from canvas visuals.
+     *
+     * @param aExternalContentVisual External content visual.
+     */
+	void RemoveExternalContentVisualFromParentL(CHuiVisual* aExternalContentVisual);
+
+	/**
+	 * Removes the external content visual from canvas visuals. Recursive method.
+	 *
+	 * @param aExternalContentVisual External content visual.
+	 */
+	void RemoveExternalContentVisualFromParentL(CHuiVisual* aExternalContentVisual, CHuiLayout* aLayout);
+	
+	void FreezeVisibleContentL(TBool aFreeze = ETrue);
+	
+	TBool IsVisibleContentFrozen() const;
+	
+	// From MHuiEffectable
+    void EffectSetEffect(CHuiFxEffect* aEffect);
+    TReal32 EffectOpacityTarget() const;
+    void EffectSetOpacity(TReal32 aOpacity);
+    void EffectDrawSelf( CHuiGc &aGc, const TRect & aDisplayRect) const;
+    THuiRealRect EffectDisplayRect() const __SOFTFP;
+    void SetLoadingEffect(TBool aLoading);
+    void EffectSetSource( TBool aIsInput1 );
+    TBool EffectGetSource() const;	
+protected:
+
+    /* Methods. */
+
+	/**
+	 * Appends a new control group on top of the roster.
+	 *
+	 * @param aGroup  Control group to add.
+	 */
+	void AppendL(CHuiControlGroup* aGroup);
+	
+	/** 
+	 * Inserts a control group into a specific position in the roster.
+	 *
+	 * @param aGroup  Control group.
+	 * @param aPos    Position to insert into.
+	 *
+	 * @leave KErrAlreadyExists  The control group is already in the roster.
+	 */
+    void InsertL(CHuiControlGroup* aGroup, TInt aPos);
+
+    /**
+     * Moves an existing control group into a new position in the roster.
+     *
+     * @param aPos  Position to move into.
+     */
+    void Move(CHuiControlGroup* aGroup, TInt aPos);
+
+	/**
+	 * Removes a control group from the roster.
+	 * 
+	 * @param aGroup  Control group to remove.
+	 */
+	void Remove(CHuiControlGroup* aGroup);
+
+    /**
+     * Update positions of root visuals to fit the entire display area.
+     */
+    void SetVisualToFullArea(CHuiVisual* aVisual);
+    
+    TBool OfferPointerEventWithinTreeL(CHuiVisual& aVisual, const THuiEvent& aEvent, TBool aUseDispRect = EFalse);
+	
+    MHuiEffectable* Effectable();
+
+private:
+
+    /* Private data structures. */
+
+
+private:
+    
+    /* Private methods. */
+
+    /**
+     * Finds the entry for the visual's control group.
+     *
+     * @return  Reference to roster entry.
+     *
+     * @panic  
+     */
+    CHuiRosterEntry* EntryForVisual(const CHuiVisual* aVisual);
+
+    /**
+     * Changes the control that has input focus.
+     */
+    void ChangeInputFocus(CHuiControl* aControl);
+ 
+    /**
+     * Determines if the roster has changed so much that everything needs to
+     * be redrawn when the next refresh occurs.
+     */
+    TBool Changed() const;
+    
+    /**
+     * Flags the roster as changed or not changed.
+     *
+     * @param aIsChanged  ETrue, if the roster should be marked as changed.
+     */
+    void SetChanged(TBool aIsChanged = ETrue);
+    
+    /**
+     * Utilizes tactile feedbacks. Called on the pointer event.
+     *
+     * @param aEvent Pointer event.
+     */
+    void HandleTactileFeedback( const THuiEvent& aEvent );
+
+
+
+	/**
+	 * Adds new event detail struct to the iPointerEventDetails
+	 */
+	void AddEventDetailsL(MHuiEventHandler* aEventHandler, const THuiXYMetric& aXYMetric, TBool aDisable);
+
+	/**
+	 * Cleans iPointerEventDetails from details that are not used by
+	 * any observer
+	 */
+	void CleanEventDetails();
+	
+	/**
+	 * Checks if event handler is within threshold range.
+	 */
+	TBool DragEventOutOfRangeL(MHuiEventHandler* aEventHandler, const THuiEvent& aEvent);
+	
+	/**
+	 * Checks if long tap event allowed in current state. Checks if there is already
+	 * drag events sent and if long tap event are disabled during dragging.
+	 */
+	TBool IsLongTapEventAllowed(MHuiEventHandler* aEventHandler);
+	
+	/**
+	 * Cleans dragging flags from iPointerEventDetails
+	 */
+	void CleanDraggingFlags();
+	
+    /**
+     * Traverses through visual tree and draws outline for visual
+     */
+	void DrawBoundaries( CHuiGc& aGc, CHuiVisual* aVisual, TBool aDrawOutline ) const;
+
+private:
+
+    /** Area occupied by the roster. */
+    TRect iRect;
+
+    CHuiDisplay* iDisplay;
+
+    /** List of control groups. None of the groups is owned by the roster. */
+    //RPointerArray<CHuiControlGroup> iGroups;
+    
+    RPointerArray<CHuiRosterEntry> iEntries;
+    
+    /** One of the controls in the roster may have input focus. */
+    CHuiControl* iInputFocus;
+    
+    /** Array of root visuals. All the visuals of the visible controls 
+        are added here (as direct children or indirect descendants). */
+    //RPointerArray<CHuiVisual> iRootVisuals;
+
+    /** Changed flag for the roster itself. */
+    TBool iChanged;
+    
+    RHuiObserverArray<MHuiEventHandler> iPointerDragObservers;
+    RHuiObserverArray<MHuiEventHandler> iUnhandledPointerObservers;
+    RHuiObserverArray<MHuiEventHandler> iLongTapObservers;
+    
+    /** For detecting long pointer events. */
+    CHuiLongTapDetector* iLongTapDetector;
+    
+    TBool iTactileFeedbackHandled;
+
+    /** List of event details how to handle events */
+    RPointerArray<THuiPointerEventDetails> iPointerEventDetails;
+    /** Initial event when starting dragging */    
+    THuiEvent iInitialDownEvent;    
+    
+    TBool iDrawEvenIfDisabledDrawInRoster; 
+
+    /** Effect */
+    CHuiFxEffect* iEffect;
+    TReal32 iEffectOpacity;
+    TBool iIsInput1;
+
+	/** Render buffer */
+    CHuiCanvasGc* iCanvasGc;
+    CHuiCanvasRenderBuffer* iCanvasRenderBuffer;
+    CHuiGc::TOrientation iCanvasRenderBufferOrientation;
+	};
+
+#endif  // __HUIROSTERIMPL_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiS60TextStyle.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   S60 text style encapsulates a S60 - specific unique text style 
+*                in Hitchcock UI Toolkit usage.
+*
+*/
+
+
+
+#ifndef __THUIS60TEXTSTYLE_H__
+#define __THUIS60TEXTSTYLE_H__
+
+#include <e32base.h>
+#include <uiacceltk/HuiFont.h>
+#include <uiacceltk/huitextstyle.h>
+
+/**
+ * THuis60TextStyle presents a S60 specific text style. It implements handling and
+ * rendering of Series 60 specific text styles.
+ */
+class THuiS60TextStyle: public THuiTextStyle 
+{
+public:
+    /* Constructors and destructor. */
+
+    /** @beginAPI */
+
+    /**
+     * Default constructor. Create a new S60 specific text style.
+     *
+     * @param aParent   A handle id set into the THuiFont by the Texture manager or skin
+     * @param aFontSpec Symbian OS Font Specification to store
+     */
+    IMPORT_C THuiS60TextStyle(TInt aFontStyleId, TInt aParentId);
+
+    /** @endAPI */
+    
+    void Init();
+    
+private:
+
+};
+
+#endif  //__THUIS60TEXTSTYLE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiTargetBitmap.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,150 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Declares the MHuiTargetBitmap interface. MHuiTargetBitmap is 
+*                an interface for a writable bitmap in raw format.
+*
+*/
+
+
+
+#ifndef __HUITARGETBITMAP_H__
+#define __HUITARGETBITMAP_H__
+
+
+#include <e32base.h>
+
+
+/**
+ * Interface for a bitmap that can be drawn on as a raw bitmap. CHuiBitgdiGc
+ * uses this interface for accessing the target bitmap where drawing is 
+ * being done.
+ */
+class MHuiTargetBitmap
+    {
+public:
+
+    virtual ~MHuiTargetBitmap() {}
+
+    /**
+     * Determines the size of the bitmap.
+     * 
+     * @return  Size of the bitmap in pixels.
+     */
+    virtual TSize Size() const = 0;
+    
+    /**
+     * Determines the pixel format of the bitmap.
+     *
+     * @return  Format of the bitmap as a TDisplayMode.
+     *
+     * @see TDisplayMode in the platform documentation.
+     */
+    virtual TDisplayMode DisplayMode() const = 0;
+
+    /**
+     * Locks the heap so that the memory buffer of the bitmap can be 
+     * accessed directly. Prevents heap compression done by other threads.
+     * The heap must be unlocked with UnlockHeap() after the buffer
+     * processing has been completed.
+     *
+     * @see CFbsBitmap::LockHeap()
+     */
+    virtual void LockHeap() = 0;
+
+    /**
+     * Unlocks the heap. Must be called after the heap has been locked 
+     * and operated on.
+     */    
+    virtual void UnlockHeap() = 0;
+
+    /** 
+     * Provides access to the memory buffer of the bitmap.
+     *
+     * @return  Pointer to the beginning of the pixel data.
+     *
+     * @see LockHeap()
+     * @see UnlockHeap()
+     */     
+    virtual TAny* DataAddress() = 0;
+
+    /** 
+     * Sets the clipping rectangle for the bitmap. All drawing operations
+     * (FillRect(), BitBlt(), BitBltMasked()) are confined into this
+     * rectangle when drawn.
+     *
+     * @param aRect  Clipping rectangle.
+     */
+    virtual void SetClippingRect(const TRect& aRect) = 0;
+    
+    /** 
+     * Sets the clipping region for the bitmap. All drawing operations
+     * (FillRect(), BitBlt(), BitBltMasked()) are confined into this
+     * region when drawn.
+     *
+     * @param aRegion  Region containing clipping rectangles.
+     */
+    virtual void SetClippingRegion(const TRegion& aRegion) = 0;
+    
+    /** 
+     * Draws a solid-colored rectangle. Affected by the clipping rectangle.
+     *
+     * @param aRect  Rectangle to fill with a solid color.
+     * @param aColor  RGBA color to use for filling. Note that the alpha
+     *                component of the TRgb is also valid.
+     */
+    virtual void FillRect(const TRect& aRect, const TRgb& aColor) = 0;
+    
+    /** 
+     * Draws a bitmap. Affected by the clipping rectangle. Analogous to
+     * the corresponding CFbsBitGc::BitBlt() method.
+     *
+     * @param aPoint  Position where to draw.
+     * @param aBitmap  Bitmap to draw.
+     * @param aSourceRect  Rectangle within the source bitmap where to draw from.
+     */
+    virtual void BitBlt(const TPoint& aPoint, const CFbsBitmap *aBitmap, const TRect &aSourceRect) = 0;
+    
+    /** 
+     * Draws a masked bitmap. Affected by the clipping rectangle.
+     * Analogous to the corresponding CFbsBitGc::BitBltMasked() method.
+     *
+     * @param aPoint  Position where to draw.
+     * @param aBitmap  Bitmap to draw.
+     * @param aSourceRect  Rectangle within the source bitmap where to draw from.
+     * @param aMaskBitmap  Mask bitmap.
+     * @param aInvertMask  ETrue if the mask should be inverted.
+     */
+    virtual void BitBltMasked(const TPoint &aPoint, const CFbsBitmap *aBitmap, const TRect &aSourceRect, const CFbsBitmap *aMaskBitmap, TBool aInvertMask) = 0;
+    
+    /**
+     * Returns pointer to the bitmap. If the class do not have CFbsBitmap this methdod returns NULL.
+     * 
+     * @return  Pointer to the bitmap.
+     */
+    virtual CFbsBitmap* FbsBitmap() = 0;
+    
+    /**
+     * Returns the BITGDI graphics context that is used for drawing in
+     * the back buffer.
+     * 
+     * Writing a real implementation for this might not be needed if the renderer
+     * does not support symbian graphics context.
+     *
+     * @return  BITGDI graphics context.
+     */
+    virtual CFbsBitGc* Gc() = 0;
+    };
+
+
+#endif // __HUITARGETBITMAP_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/HuiVisualFactory.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIVISUALFACTORY_H__
+#define __HUIVISUALFACTORY_H__
+
+
+#include <e32base.h>
+#include "uiacceltk/HuiVisual.h"
+#include "uiacceltk/HuiLayout.h"
+
+
+/**
+ * Factory class for creating visuals.
+ * This class can create new instances of visuals. The desired
+ * type is passed in, and a new visual is returned.
+ */
+NONSHARABLE_CLASS(CHuiVisualFactory) : public CBase
+	{
+public:
+
+	/* Constructors and destructor. */
+
+	/**
+	 * Constructor.
+	 */
+	CHuiVisualFactory(CHuiEnv& aEnv);
+
+	/**
+	 * Destructor.
+	 */
+	virtual ~CHuiVisualFactory();
+
+
+	/* Methods. */
+
+	/**
+	 * Create a new layout visual.
+	 *
+	 * @param aLayoutType  Type of the layout.
+	 * 
+	 * @leave KErrNotFound  The layout type was not registered.
+	 */
+	CHuiLayout* NewLayoutL(THuiLayoutType aLayoutType,
+	                       CHuiControl& aOwner) const;
+	
+	/**
+	 * Create a new layout visual, leaving it on the cleanup stack.
+	 *
+	 * @param aLayoutType  Type of the layout.
+	 *
+	 * @leave KErrNotFound  The layout type was not registered.
+	 */
+	CHuiLayout* NewLayoutLC(THuiLayoutType aLayoutType,
+	                        CHuiControl& aOwner) const;
+	                                 
+	/**
+	 * Create a new visual.
+	 *
+	 * @param aVisualType  Type of the visual.
+	 * 
+	 * @leave KErrNotFound  The visual type was not registered.
+	 */
+    CHuiVisual* NewVisualL(THuiVisualType aVisualType,
+                           CHuiControl& aOwner) const;
+                                    
+	/**
+	 * Create a new visual, leaving it on the cleanup stack.
+	 *
+	 * @param aVisualType  Type of the visual.
+	 *
+	 * @leave KErrNotFound  The visual type was not registered.
+	 */
+    CHuiVisual* NewVisualLC(THuiVisualType aVisualType,
+                            CHuiControl& aOwner) const;	                                 
+
+
+private:
+    
+    /* Private methods */
+
+
+private:
+
+    /** Environment where the factory belongs to. */
+    CHuiEnv& iEnv;
+    
+	};
+
+#endif  // __HUIVISUALFACTORY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/Matrix.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,371 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef MATRIX_H
+#define MATRIX_H
+
+#include "Util.h"
+#include <string.h>
+#define _USE_MATH_DEFINES
+#include <math.h>
+
+namespace shadergen
+{
+
+static const float s_identityMatrix[16] =
+{
+	1.f, 0.f, 0.f, 0.f,
+	0.f, 1.f, 0.f, 0.f,
+	0.f, 0.f, 1.f, 0.f,
+	0.f, 0.f, 0.f, 1.f
+};
+
+#define EPSILON (.01f)
+
+/*!
+ * \brief
+ * Simple class for simulating OpenGL's matrix operations.
+ */
+class Matrix
+{
+
+public:
+
+	/*!
+	 * \brief
+	 * Default constructor.
+	 *
+	 * \remarks
+	 * Does nothing. Could initialize the matrix to identity, but then
+	 * again, why would it? It only hides errors.
+	 */
+	Matrix (void)
+	{
+	}
+
+	Matrix (const Matrix& mat)
+	{
+		(*this) = mat;
+	}
+
+	const Matrix& operator= (const Matrix& mat)
+	{
+		memcpy(m, mat.m, 16 * sizeof(float));
+		return *this;
+	}
+
+	/*!
+	 * \brief
+	 * glLoadMatrix() implementation.
+	 * 
+	 * \param nm
+	 * Array of 16 floats.
+	 */
+	void loadMatrix (const float* nm)
+	{
+		memcpy(m, nm, 16 * sizeof(float));
+	}
+
+	/*!
+	 * \brief
+	 * glLoadIdentity() implementation
+	 */
+	void loadIdentity (void)
+	{
+		memcpy(m, s_identityMatrix, 16 * sizeof(float));
+	}
+
+	/*!
+	 * \brief
+	 * Check if the matrix is identity or not.
+	 * 
+	 * \returns
+	 * Returns true if the matrix is the identity matrix, false otherwise.
+	 */
+	bool isIdentity (void) const
+	{
+		return !memcmp(m, s_identityMatrix, 16 * sizeof(float));
+	}
+
+	/*!
+	 * \brief
+	 * glMultMatrix() implementation.
+	 * 
+	 * \param b
+	 * The other matrix, as floats.
+	 */
+	void multiply (const float* b)
+	{
+		float dst[16];
+		for (int i = 0; i < 4; i++)
+		{
+			for (int j = 0; j < 4; j++)
+			{
+				float sum = 0.f;
+				for (int k = 0; k < 4; k++)
+					sum += m[i + 4 * k] * b[k + 4 * j];
+
+				dst[i + 4 * j] = sum;
+			}
+		}
+
+		memcpy(m, dst, 16 * sizeof(float));
+	}
+
+	/*!
+	 * \brief
+	 * Sums given matrix (4x4) to this matrix (4x4).
+	 * 
+	 * \param b
+	 * The other matrix, as floats.
+	 */
+	void plus (const float* b)
+	{
+	    for (int i = 0; i < 4; i++)
+	    {
+	        for (int j = 0; j < 4; j++)
+	        {
+	            m[i + 4 * j] += b[i + 4 * j];
+	        }
+	    }
+	}
+
+	/*!
+	 * \brief
+	 * glScalef() implementation.
+	 * 
+	 * \param sx
+	 * X scale
+	 * 
+	 * \param sy
+	 * Y scale
+	 * 
+	 * \param sz
+	 * Z scale
+	 */
+	void scale (const float sx, const float sy, const float sz)
+	{
+		const float sm[16] =
+		{
+			sx, 0.f, 0.f, 0.f,
+			0.f,  sy, 0.f, 0.f,
+			0.f, 0.f,  sz, 0.f,
+			0.f, 0.f, 0.f, 1.f
+		};
+
+		multiply(sm);
+	}
+
+	/*!
+	 * \brief
+	 * glTranslatef() implementation.
+	 * 
+	 * \param tx
+	 * X component of the translation vector
+	 * 
+	 * \param ty
+	 * Y component of the translation vector
+	 * 
+	 * \param tz
+	 * Z component of the translation vector
+	 */
+	void translate (const float tx, const float ty, const float tz)
+	{
+		const float tm[16] =
+		{
+			1.f, 0.f, 0.f, 0.f,
+			0.f, 1.f, 0.f, 0.f,
+			0.f, 0.f, 1.f, 0.f,
+			tx,  ty,  tz,  1.f
+		};
+
+		multiply(tm);
+	}
+
+	/*!
+	 * \brief
+	 * glRotatef() implementation
+	 * 
+	 * \param angle
+	 * The amount of rotation
+	 * 
+	 * \param x
+	 * X component of the axis about which to rotate
+	 * 
+	 * \param y
+	 * Y component of the axis about which to rotate
+	 * 
+	 * \param z
+	 * Z component of the axis about which to rotate
+	 */
+	void rotate (const float angle, const float x, const float y, const float z)
+	{
+		static const float deg_to_rad = 2.f * (float)M_PI / 360.f;
+		// normalised vector components
+		float x_n;
+		float y_n;
+		float z_n;
+		float angle_rad = angle * deg_to_rad;
+
+		// normalise if needed
+		const float length = (float)sqrt(double(x * x) + 
+					  double(y * y) + 
+					  double(z * z));
+		if(fabs(length - 1.0f) > EPSILON) {
+			// in fp calculations, division by zero -> (+/-)inf
+			// can't really help if it's the case.
+			const float inv_length = 1.f / length;
+			x_n = x * inv_length;
+			y_n = y * inv_length;
+			z_n = z * inv_length;
+		} else {
+			x_n = x;
+			y_n = y;
+			z_n = z;
+		}
+
+		const float c = cos(angle_rad);
+		const float s = sin(angle_rad);
+		const float c_1 = 1.f - c;
+
+		const float rm[16] =
+		{
+	x_n * x_n * c_1 + c,	   y_n * x_n * c_1 + z_n * s, x_n * z_n * c_1 - y_n * s, 0.f,
+	x_n * y_n * c_1 - z_n * s, y_n * y_n * c_1 + c,	      y_n * z_n * c_1 + x_n * s, 0.f,
+	x_n * z_n * c_1 + y_n * s, y_n * z_n * c_1 - x_n * s, z_n * z_n * c_1 + c,	 0.f,
+	0.f, 			   0.f,			      0.f,		   	 1.f
+
+		};
+
+		multiply(rm);
+	}
+
+	/*!
+	 * \brief
+	 * glFrustumf() implementation
+	 * 
+	 * \param l
+	 * Left
+	 * 
+	 * \param r
+	 * Right
+	 * 
+	 * \param b
+	 * Bottom
+	 * 
+	 * \param t
+	 * Top
+	 * 
+	 * \param n
+	 * Near
+	 * 
+	 * \param f
+	 * Far
+	 */
+	void frustum (const float l, const float r, const float b, const float t, const float n, const float f)
+	{
+		SG_ASSERT(r != l);
+		SG_ASSERT(t != b);
+		SG_ASSERT(n != f);
+
+		const float rl = 1.f / (r - l);
+		const float tb = 1.f / (t - b);
+		const float fn = 1.f / (f - n);
+
+		const float A = (r + l) * rl;
+		const float B = (t + b) * tb;
+		const float C = -(f + n) * fn; 
+		const float D = -2.f * f * n * fn;
+
+		const float fm[16] =
+		{
+			2.f * n * rl,	0.f, 		0.f,	0.f,
+			0.f,		2.f * n * tb,	0.f,	0.f,
+			A,		B,		C,	-1.f,
+			0.f,		0.f,		D,	0.f
+		};
+		
+		multiply(fm);
+	}
+
+	/*!
+	 * \brief
+	 * glOrthof() implementation
+	 * 
+	 * \param l
+	 * Left
+	 * 
+	 * \param r
+	 * Right
+	 * 
+	 * \param b
+	 * Bottom
+	 * 
+	 * \param t
+	 * Top
+	 * 
+	 * \param n
+	 * Near
+	 * 
+	 * \param f
+	 * Far
+	 */
+	void ortho (const float l, const float r, const float b, const float t, const float n, const float f)
+	{
+		SG_ASSERT(r != l);
+		SG_ASSERT(t != b);
+		SG_ASSERT(n != f);
+
+		const float rl = 1.f / (r - l);
+		const float tb = 1.f / (t - b);
+		const float fn = 1.f / (f - n);
+
+		const float tx = -(r + l) * rl;
+		const float ty = -(t + b) * tb;
+		const float tz = -(f + n) * fn;
+
+		const float om[16] = 
+		{
+			2.f * rl,	0.f,		0.f,		0.f,
+			0.f,		2.f * tb,	0.f,		0.f,
+			0.f,		0.f,		-2.f * fn,	0.f,
+			tx,		ty,		tz,		1.f
+		};
+
+		multiply(om);
+	}
+
+
+	/*!
+	 * \brief
+	 * Returns pointer to floats making up the matrix. Suitable for 
+	 * glLoadMatrix().
+	 */
+	const float *getMatrix(void) const {
+		return m;
+	}
+
+
+private:
+	
+	float m[16];
+};
+
+
+} /* namespace shadergen */
+
+#endif /* MATRIX_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/MatrixStack.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,83 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef MATRIX_STACK_H
+#define MATRIX_STACK_H
+
+#include "Matrix.h"
+
+namespace shadergen
+{
+
+
+class MatrixStack
+{
+public:
+	static const int MATRIX_STACK_DEPTH = 16;
+
+	/*!
+	 * \brief
+	 * Default constructor. Initializes sp to 0.
+	 */
+	MatrixStack (void)
+	{
+		m_currDepth = 0;
+	}
+
+	/*!
+	 * \brief
+	 * glPushMatrix() implementation.
+	 */
+	void push (void)
+	{
+		SG_ASSERT(SG_IN_RANGE<int>(m_currDepth, 0, MATRIX_STACK_DEPTH - 1));
+		memcpy(&m_data[m_currDepth + 1], &m_data[m_currDepth], sizeof(Matrix));
+		m_currDepth++;
+	}
+
+	/*!
+	 * \brief
+	 * glPopMatrix() implementation
+	 */
+	void pop (void)
+	{
+		SG_ASSERT(SG_IN_RANGE<int>(m_currDepth, 1, MATRIX_STACK_DEPTH - 0));
+		m_currDepth--;
+	}
+
+	/*!
+	 * \brief
+	 * Get the topmost matrix in the stack.
+	 * 
+	 * \returns
+	 * Returns the topmost matrix in the stack.
+	 */
+	Matrix& top (void)
+	{
+		SG_ASSERT(SG_IN_RANGE<int>(m_currDepth, 0, MATRIX_STACK_DEPTH - 1));
+		return m_data[m_currDepth];
+	}
+
+private:
+
+	int		m_currDepth;
+	Matrix	m_data[MATRIX_STACK_DEPTH];
+};
+
+} /* namespace shadergen */
+
+#endif /* MATRIX_STACK_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/Util.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,88 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef UTIL_H
+#define UTIL_H
+
+
+
+//#define ENABLE_TRACE
+#undef ENABLE_TRACE
+
+#if (defined ENABLE_TRACE) && (!defined __SYMBIAN32__)
+	#include <iostream>
+#endif
+
+#if (defined ENABLE_TRACE) && (defined __SYMBIAN32__)
+#include <e32def.h>
+#include <e32debug.h>
+#endif
+
+#ifndef SG_ASSERT
+	#include <assert.h>
+	#define SG_ASSERT assert
+#endif
+
+namespace shadergen
+{
+
+#ifdef _DEBUG
+	#define DEBUG
+#endif
+
+/* Compile-time assertion */
+#define SG_CT_MAKE_NAME(f, l) sg_ct_assert_failure_##f##l
+#define SG_CT_UNIQUE_NAME SG_CT_MAKE_NAME(__FILE__, __LINE__)
+
+#define SG_CT_ASSERT(cond) typedef char SG_CT_UNIQUE_NAME[(cond) ? 1 : -1]
+
+#define SG_LENGTH_OF_ARRAY(arr) (sizeof(arr) / sizeof((arr)[0]))
+
+
+#if (defined ENABLE_TRACE) && (defined __SYMBIAN32__)
+
+	#define MY_TRACE(str) RDebug::Print(_L(str))
+	#define RAW_TRACE(str) RDebug::Printf(str)
+	#define TRACE_FUNC_ENTRY() (RAW_TRACE(__FUNCTION__))
+#elif (defined ENABLE_TRACE) && (!defined __SYMBIAN32__)
+	#define MY_TRACE(str)  std::cout << (str) << '\n'
+	#define RAW_TRACE(str) std::cout << (str) << '\n'
+	#define TRACE_FUNC_ENTRY() (MY_TRACE(__FUNCTION__))
+#elif !defined ENABLE_TRACE
+	#define MY_TRACE(str)
+	#define RAW_TRACE(str)
+	#define TRACE_FUNC_ENTRY()
+#endif
+
+
+
+template<class T> inline bool SG_IN_RANGE (const T& x, const T& mn, const T& mx)
+{
+	return x <= mx && x >= mn;
+}
+
+
+typedef struct _Vec4
+{
+	float x, y, z, w;
+} Vec4;
+
+SG_CT_ASSERT(sizeof(Vec4) == 4 * sizeof(float));
+
+} /* namespace shadergen */
+
+#endif /* UTIL_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/Variable.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,335 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef VARIABLE_H
+#define VARIABLE_H
+
+#include <string>
+#include "Util.h"
+#include "GLState.h"
+
+using namespace std;
+
+namespace shadergen
+{
+
+
+
+
+class Variable
+{
+public:
+
+	/* Variable class */
+	typedef enum Class
+	    {
+		CLASS_UNIFORM = 0,
+		CLASS_ATTRIBUTE,
+		CLASS_VARYING,
+
+		CLASS_MAX
+	    } Class;
+
+	/* Variable precision */
+	typedef enum Precision
+	    {
+		PRECISION_LOW = 0,
+		PRECISION_MEDIUM,
+		PRECISION_HIGH,
+
+		PRECISION_MAX
+	    } Precision;
+
+	/* Variable type */
+	typedef enum Type
+	    {
+		TYPE_FLOAT = 0,
+		TYPE_VEC2,
+		TYPE_VEC3,
+		TYPE_VEC4,
+
+		TYPE_INT,
+		TYPE_IVEC2,
+		TYPE_IVEC3,
+		TYPE_IVEC4,
+
+		TYPE_MAT2,
+		TYPE_MAT3,
+		TYPE_MAT4,
+
+		TYPE_SAMPLER,
+
+		TYPE_MAX
+	    } Type;
+
+	/* variable data's type tag --- an ugly hack for now */
+	typedef enum Tag
+	    {
+		DATAPTR = 0,
+		DATAPTRPTR,
+		TEXTUREUNIT
+	    } Tag;
+
+	union variableData 
+	    {
+		const void *		dataPtr;
+		const void * const *	dataPtrPtr;
+		int			textureUnit;
+
+		variableData(const void *dataPointer) 
+		    {
+			dataPtr = dataPointer;
+		    }
+
+		variableData(const void * const *dataPointerPointer) 
+		    {
+			dataPtrPtr = dataPointerPointer;
+		    }
+
+		variableData(int unit) 
+		    { 
+		    textureUnit = unit; 
+		    }
+	};
+
+
+
+	Variable (const Class vclass,
+		const char* name,
+		const Type type,
+		const GLenum format,
+		int dim,
+		const Precision precision,
+		const void* dataPtr)
+		: m_class(vclass),
+		m_name(name),
+		m_type(type),
+		m_format(format),
+		m_dimension(dim),
+		m_precision(precision),
+		m_tag(DATAPTR),
+		m_variableData(dataPtr),
+		m_location(0)
+	{
+		SG_ASSERT(type != TYPE_SAMPLER);
+		SG_ASSERT(format == GL_BYTE			||
+			      format == GL_UNSIGNED_BYTE	||
+			      format == GL_SHORT			||
+			      format == GL_UNSIGNED_SHORT	||
+			      format == GL_INT		||
+			      format == GL_FLOAT			||
+			      format == GL_FIXED);
+//		SG_ASSERT((vclass != CLASS_VARYING) == (funcPtr != NULL));
+	}
+
+
+	Variable (const Class vclass,
+		const char* name,
+		const Type type,
+		const GLenum format,
+		int dim,
+		const Precision precision,
+		const void* const* dataPtrPtr)
+		: m_class(vclass),
+		m_name(name),
+		m_type(type),
+		m_format(format),
+		m_dimension(dim),
+		m_precision(precision),
+		m_tag(DATAPTRPTR),
+		m_variableData(dataPtrPtr),
+		m_location(0)
+	{
+		SG_ASSERT(type != TYPE_SAMPLER);
+		SG_ASSERT(format == GL_BYTE			||
+			   format == GL_UNSIGNED_BYTE	||
+			   format == GL_SHORT			||
+			   format == GL_UNSIGNED_SHORT	||
+			   format == GL_INT		||
+			   format == GL_FLOAT			||
+			   format == GL_FIXED);
+//		SG_ASSERT((vclass != CLASS_VARYING) == (funcPtr != NULL));
+	}
+
+
+
+	Variable (const Class vclass,
+		const char* name,
+		const Type type,
+		const GLenum format,
+		int dim,
+		const Precision precision,
+		int textureUnit)
+		: m_class(vclass),
+		m_name(name),
+		m_type(type),
+		m_format(format),
+		m_dimension(dim),
+		m_precision(precision),
+		m_tag(TEXTUREUNIT),
+		m_variableData(textureUnit),
+		m_location(0)
+	{
+		SG_ASSERT((type == TYPE_SAMPLER) && (format == GL_INT) ||
+		          (vclass == CLASS_VARYING && textureUnit == 0));
+	}
+
+
+
+	string getDeclaration (void) const
+	{
+		string decl = classToStr() + " " + precisionToStr() + " " + typeToStr() + " " + m_name;
+
+		if (m_dimension != 1)
+		{
+			SG_ASSERT(SG_IN_RANGE<int>(m_dimension, 1, 9));
+			decl += "[";
+			decl += (char)('0' + m_dimension);
+			decl += "]";
+		}
+
+		decl += ";\n";
+		return decl;
+	}
+
+	const string& getName (void) const
+	{
+		return m_name;
+	}
+
+	Class getClass (void) const
+	{
+		return m_class;
+	}
+
+	Type getType (void) const
+	{
+		return m_type;
+	}
+
+	GLenum getFormat (void) const
+	{
+		return m_format;
+	}
+
+	int getDimension (void) const
+	{
+		return m_dimension;
+	}
+
+	Precision getPrecision (void) const
+	{
+		return m_precision;
+	}
+
+	const void* getPtr(void) const
+	{
+		switch(m_tag) {
+			case DATAPTR : 
+				return m_variableData.dataPtr;
+
+			case DATAPTRPTR :
+				return *m_variableData.dataPtrPtr;
+
+			case TEXTUREUNIT : 
+				return (void *)(&m_variableData.textureUnit);
+
+			default : 
+				SG_ASSERT(0);
+		}
+		return NULL;
+	}
+
+    void setLocation(int location)
+        {
+        m_location = location;
+        }
+
+    int location(void) const
+        {
+        return m_location;
+        }
+
+private:
+
+	string typeToStr (void) const
+	{
+		const char* s_typeStr[] =
+		{
+			"float",	// TYPE_FLOAT = 0,
+			"vec2",		// TYPE_VEC2,
+			"vec3",		// TYPE_VEC3,
+			"vec4",		// TYPE_VEC4,
+
+			"int",		// TYPE_INT,
+			"ivec2",	// TYPE_IVEC2,
+			"ivec3",	// TYPE_IVEC3,
+			"ivec4",	// TYPE_IVEC4,
+
+			"mat2",		// TYPE_MAT2,
+			"mat3",		// TYPE_MAT3,
+			"mat4",		// TYPE_MAT4,
+
+			"sampler2D"	// TYPE_SAMPLER
+		};
+
+		SG_CT_ASSERT(SG_LENGTH_OF_ARRAY(s_typeStr) == TYPE_MAX);
+		return s_typeStr[m_type];
+	}
+
+	string classToStr (void) const
+	{
+		const char* s_classStr[] =
+		{
+			"uniform",		// CLASS_UNIFORM = 0
+			"attribute",		// CLASS_ATTRIBUTE,
+			"varying"		// CLASS_VARYING,
+		};
+
+		SG_CT_ASSERT(SG_LENGTH_OF_ARRAY(s_classStr) == CLASS_MAX);
+		return s_classStr[m_class];
+	}
+
+	string precisionToStr (void) const
+	{
+		const char* s_precStr[] =
+		{
+			"lowp",		// PRECISION_LOW = 0
+			"mediump",	// PRECISION_MEDIUM,
+			"highp"		// PRECISION_HIGH,
+		};
+
+		SG_CT_ASSERT(SG_LENGTH_OF_ARRAY(s_precStr) == PRECISION_MAX);
+		return s_precStr[m_precision];
+	}
+
+   
+
+	Class		m_class;
+	string		m_name;
+	Type		m_type;
+	GLenum		m_format;
+	int		m_dimension;
+	Precision	m_precision;
+	Tag		m_tag;
+	variableData	m_variableData;
+    int m_location;
+};
+
+}
+
+#endif /* VARIABLE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huicanvasalfpainter.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,281 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiCanvasAlfPainter.
+*
+*/
+
+
+
+#ifndef __HUICANVASALFPAINTER_H__
+#define __HUICANVASALFPAINTER_H__
+
+#include <uiacceltk/HuiVisual.h>
+#include "uiacceltk/HuiTextMesh.h"
+//#include <uiacceltk/HuiCanvasPainter.h>
+#include "huicanvaspainter.h"
+
+enum THuiCanvasCommands
+    {
+    // Draw ops
+    EHuiCanvasDrawImage,
+    EHuiCanvasDrawText,
+    EHuiCanvasDrawLines,
+	  EHuiCanvasDrawEllipse,
+		EHuiCanvasDrawPoints,
+		EHuiCanvasDrawPolygon,
+		EHuiCanvasDrawRects,
+
+		// Setters
+		EHuiCanvasSetTextStyle,
+    EHuiCanvasSetPenColor,
+		EHuiCanvasSetPenWidth,
+		EHuiCanvasSetOpacity,
+		EHuiCanvasSetPolygonDrawMode,
+		EHuiCanvasSetTextAlign,
+
+    // Transformations
+		EHuiCanvasLoadIdentity,
+		EHuiCanvasTranslate,
+		EHuiCanvasScale,
+		EHuiCanvasRotate,
+	
+		// Misc
+		EHuiCanvasPrepareDrawText
+    };
+
+NONSHARABLE_STRUCT( THuiCanvasDrawImageParams )
+    {
+    TInt    iTexture;
+    TReal32 iDestinationRectTopLeftX;
+    TReal32 iDestinationRectTopLeftY;
+    TReal32 iDestinationRectBottomRightX;
+    TReal32 iDestinationRectBottomRightY;
+    };
+    
+NONSHARABLE_STRUCT( THuiCanvasDrawTextParams )
+    {
+    TReal32 iDestinationRectTopLeftX;
+    TReal32 iDestinationRectTopLeftY;
+    TReal32 iDestinationRectBottomRightX;
+    TReal32 iDestinationRectBottomRightY;
+    };
+
+	
+NONSHARABLE_STRUCT( THuiCanvasDrawEllipseParams )
+	{
+    TReal32 iDestinationRectTopLeftX;
+    TReal32 iDestinationRectTopLeftY;
+    TReal32 iDestinationRectBottomRightX;
+    TReal32 iDestinationRectBottomRightY;
+    };
+
+NONSHARABLE_STRUCT( THuiCanvasSetTextStyleParams )
+    {
+    TInt  iTextStyleId;
+    };
+    
+NONSHARABLE_STRUCT( THuiCanvasDrawTextCachedTextEntry )
+    {
+    TInt iId;
+    CHuiTextMesh* iTextMesh;        
+    };
+
+NONSHARABLE_STRUCT( THuiCanvasSetPenColorParams )
+	{
+    TRgb  iPenColor;
+    };
+NONSHARABLE_STRUCT( THuiCanvasSetPenWidthParams )
+	{
+    TReal32  iPenWidth;
+    };
+NONSHARABLE_STRUCT( THuiCanvasSetOpacityParams )
+	{
+    TReal32  iOpacity;
+    };
+NONSHARABLE_STRUCT( THuiCanvasSetPolygonDrawModeParams )
+	{
+	THuiFillMode  iPolygonDrawMode;
+    };
+NONSHARABLE_STRUCT( THuiCanvasSetTextAlignParams )
+	{
+    TInt  iTextAlignHorizontal;
+    TInt  iTextAlignVertical;
+    };
+
+
+   // Transformations
+NONSHARABLE_STRUCT( THuiCanvasLoadIdentityParams )
+	{
+	TInt iDummy;
+	};
+	
+NONSHARABLE_STRUCT( THuiCanvasTranslateParams )
+	{
+	TReal32 iX; 
+	TReal32 iY; 
+	TReal32 iZ;
+	};
+
+NONSHARABLE_STRUCT( THuiCanvasScaleParams )
+	{
+	TReal32 iX; 
+	TReal32 iY; 
+	TReal32 iZ;
+	};
+
+NONSHARABLE_STRUCT( THuiCanvasRotateParams )
+	{
+	TReal32 iAngle;
+	TReal32 iX; 
+	TReal32 iY; 
+	TReal32 iZ;
+	};
+
+
+
+/**
+ * This class is used internally by the toolkit and thus should
+ * not be used by the applications directly.
+ */
+NONSHARABLE_CLASS(CHuiCanvasAlfPainter) : public CHuiCanvasPainter
+    {
+		
+		private:
+		/**
+     * Constructor.
+     */
+    CHuiCanvasAlfPainter();
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+
+		public:
+    /**
+     * Constructor.
+     */
+    static CHuiCanvasAlfPainter* NewL();
+
+    /**
+     * Destructor.
+     */
+    ~CHuiCanvasAlfPainter();
+
+
+		public: // From CHuiCanvasPainter
+		
+		/**
+     * Sets buffer that contains canvas drawing commands. This
+     * method clears previous buffer(s).
+     *
+     * @param aCommands Commanbuffer
+     */
+    virtual void SetCommandSetL( const TDesC8& aCommands );
+
+    /**
+     * Clears buffer(s) that contains canvas drawing commands. 
+     */
+    virtual void ClearCommandSet();
+
+    /**
+     * Adds buffer that contains more canvas drawing commands,
+     * those will be executed after the buffers that has been
+     * added previously.
+     * @param aMoreCommands Commanbuffer
+     */
+    virtual void AddCommandSetL( const TDesC8& aMoreCommands );
+
+    /**
+     * Adds partial buffer that contains more canvas drawing commands. These
+     * commands are appended to the commands set previously with this method
+     * until param aLastPart has value ETrue. After that whole command set
+     * will be added among possibly already existing command sets and
+     * it will be drawable.
+     * 
+     * @param aMoreCommands Commanbuffer
+     * @param aLastPart EFalse if there are more commands to be added into this
+     * command set before it is wanted to be available for drawing. ETrue if
+     * command set is ready and no more parts are expected.
+     */
+    virtual void AddPartialCommandSetL( const TDesC8& aMoreCommands, TBool aLastPart );
+
+#ifdef HUI_DEBUG_TRACK_DRAWING
+	virtual void SetTrackCommandSet( TFileName& aFileName, TBool aTrack );
+#endif
+	
+    /**
+     * Clears internal cached texts and images.
+     */
+    virtual void ClearCache();
+
+    /**
+     * Handles the command buffer(s), either draws or performs a scan.
+     */
+    virtual void HandleBufferL(TRect& aDisplayRect, TInt aAction, const CHuiCanvasVisual& aUser, CHuiGc* aGc, TPoint aPos ) ;
+    virtual void HandleBufferL(TRect& aDisplayRect, TInt aAction, const CHuiCanvasVisual& aUser, CHuiGc* aGc, TPoint aPos, TPtrC8 aCommands, CHuiCanvasCommandBuffer *buf) { }
+
+    /**
+     * Returns the number of rectangular areas which contain something that is
+     * drawn by the painter.
+     *
+     * @return number of painted areas.
+     * @see PaintedArea()
+     */
+    virtual TInt PaintedAreaCount() const;
+    
+    /**
+     * Returns information of the painted area at given index. 
+     *
+     * @aIndex Index of the painted area.
+     * @return Painted area info.
+     * @see PaintedAreaCount()
+     */
+    virtual THuiCanvasPaintedArea PaintedArea(TInt aIndex);
+
+    /**
+     * Draws content of the window in pixel format to the given bitmap. 
+     * This method may not be supported in all commanbuffertype/renderer combinations.
+     *
+     * @param aTargetBuffer where content of the window is to be drawn. NULL if the drawing
+     * is to be stopped.
+     *
+     * @return KErrNotSupported if the current renderer/painter does not support the
+     * feature. Leave happens in other unexpected error situtations. 
+     *         
+     */
+    virtual TInt SetCapturingBufferL(CFbsBitmap* /*aTarget*/);
+
+    /**
+     * Tells painter to enable/disable render buffer (if it is supported by the
+     * painter implementation) 
+     *
+     * @return KErrNotSupported if the current renderer/painter does not support the
+     */
+    virtual TInt EnableRenderBuffer(TBool aEnable = ETrue);
+    
+	virtual CHuiCanvasGc& CanvasGc() const;
+
+private:
+    void ClearHuiTextCache();
+       
+private:
+      // Hui command buffer handling
+    RArray<THuiCanvasDrawTextCachedTextEntry> iCachedTexts;
+    RArray<TReal32> iPointCords;
+    CHuiCanvasGc* iCanvasGc;
+    THuiRealRect iPaintedRect;
+};    
+#endif  // __HUICANVASALFPAINTER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huicanvasbackground.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __HUICANVASBACKGROUND_H__
+#define __HUICANVASBACKGROUND_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiDisplay.h>
+
+class CHuiCanvasGc;
+class CHuiCanvasVisual;
+    
+	
+class CHuiCanvasBackground : public CBase
+    {
+public:
+
+	/**
+	 * Constructor.
+	 */
+	CHuiCanvasBackground();
+
+
+	/**
+	 * Destructor.
+	 */ 
+	~CHuiCanvasBackground();
+
+	/**
+	 * Constructor.
+	 */
+	static CHuiCanvasBackground* NewL();
+
+	/**
+	 * Constructor.
+	 */
+    static CHuiCanvasBackground* NewLC();
+    
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+    
+    /**
+     * Sets visual which is using this background.
+     */
+    void SetVisual(CHuiCanvasVisual* aVisual);    
+    
+    /**
+     * Drawing.
+     */
+    void DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect);
+
+    /**
+     * Sets the flag that tells the canvas to clear the background before
+     * doing a refresh. 
+     *
+     * @param aClearBackground  Background clearing mode.
+     * @see SetBackgroundColor()
+     */
+    void SetClearBackground(CHuiDisplay::TClearMode aClearBackground);
+
+    /**
+     * Gets the flag that tells the canvas to clear the background before
+     * doing a refresh. 
+     *
+     * @return  Background clearing mode.
+     */
+    TInt ClearBackground();
+
+    /**
+     * Sets the background color of the display, if background clearing has
+     * been enabled.
+     *
+     * @param aBackgroundColor  The color to set the background to.
+     * @see SetClearBackgroundL()
+     */
+    void SetBackgroundColor(const TRgb& aBackgroundColor);
+    
+    /**
+    * Sets the items that specify how to clear display before display refresh.
+    * Items may have overlapping rectangles, drawing order is same as item order
+    * in the parameter array. But having lots of overlapping drawing 
+    * causes negative performance impact.
+    * 
+    * This method is alternative to SetClearBackgroundL and SetBackgroundColor
+    * methods.
+    * 
+    * @see SetBackgroundColor()
+    * @see SetClearBackgroundL()
+    * @param aItems Array of items that specify how to clear the background.
+    */
+    void SetBackgroundItems(const RArray<THuiDisplayBackgroundItem>& aItems);
+    
+    /**
+     * Gets the number of THuiDisplayBackground items set, for the canvas visual
+     *
+     * @return  Number of background items
+     */
+    TInt BackgroundItemsCount();
+
+    /**
+    * Gets the items that specify how to clear display before display refresh.
+    * @param aItems Returned items are written into the array.
+    */
+    void GetBackgroundItems(RArray<THuiDisplayBackgroundItem>& aItems);
+
+    /**
+     * Gets the background color of the display, if background clearing has
+     * been enabled.
+     *
+     * @return The color to set the background to.
+     */
+    TRgb BackgroundColor() const;
+    
+private:
+
+    void ClearWithColor(CHuiGc& aGc, const TRect& aDisplayRect);
+
+    void ClearWithSkinBackground(const TRect& aDisplayRect);
+
+    void ClearWithBackgroundItems(const TRect& aDisplayRect);
+    
+private:
+    
+    /** Canavas visual which uses this background */
+    CHuiCanvasVisual* iCanvasVisual;
+
+    /** Determines if the background should be cleared before drawing. */
+    TInt iClearBackground;
+
+    /** Background color for the display, if clearing enabled. */
+    TRgb iBackgroundColor;
+
+    /** Array of background items */
+    RArray<THuiDisplayBackgroundItem> iBackgroundItems;
+          
+    };
+
+#endif        
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huicanvasdebugwsgc.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,153 @@
+/*
+* 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:   Definition of CHuiCanvasDebugWsGc.
+*
+*/
+
+
+
+#ifndef __HUICANVASDEBUGWSGC_H__
+#define __HUICANVASDEBUGWSGC_H__
+
+#include <e32base.h>
+#include "uiacceltk/HuiCanvasCmdBufferReader.h"
+
+#include <uiacceltk/HuiOwnedPointer.h>
+#include <uiacceltk/HuiVisual.h>    
+#include <uiacceltk/HuiDisplay.h>    
+#include "huicanvaswshwgc.h"
+
+class CAlfCommandDebug;
+
+/**
+ * This class is used internally by the toolkit and thus should
+ * not be used by the applications directly.
+ */
+
+class CHuiCanvasDebugWsGc : public CHuiCanvasWsGc
+    {
+
+public:
+
+	virtual void WsBitBltL(TInt aBitmapHandle, TPoint aPoint);
+	virtual void WsBitBltRectL(TInt aBitmapHandle, TPoint aPoint, TRect aRect) ;
+	virtual void WsBitBltMaskedL(TInt aBitmapHandle, TInt aMaskHandle, TInt aInvertMask, TPoint aPoint, TRect aRect) ;
+	virtual void WsBitBltMaskedPointL(TInt aBitmapHandle, TInt aMaskHandle, TPoint aPoint1, TPoint aPoint2, TRect aRect) ;
+	
+	virtual void WsResetClippingRegionL() ;
+	virtual void WsClearL();
+	virtual void WsClearRectL(TRect& aRect);
+	virtual void WsResetBrushPatternL() ;
+	virtual void WsResetFontL() ;
+	virtual void WsDrawArcL(TPoint aPoint1, TPoint aPoint2, TRect aRect) ;
+	virtual void WsDrawPieL(TPoint aPoint1, TPoint aPoint2, TRect aRect) ;
+	virtual void WsDrawBitmap1L(TInt aBitmapHandle, TRect aRect) ;
+	virtual void WsDrawBitmap2L(TInt aBitmapHandle, TRect aRect1, TRect aRect2) ;
+	virtual void WsDrawBitmap3L(TInt aBitmapHandle, TPoint aPoint) ; //XXX_CFbsBitGc_Hack Remove!!!
+	virtual void WsDrawBitmapMaskedL(TInt aBitmapHandle, TInt aMaskHandle, TInt aInvertMask, TRect& aRect1, TRect& aRect2) ;
+	virtual void WsDrawRoundRectL(TPoint aPoint, TRect& aRect) ;
+	virtual void WsDrawPolyLineL(CArrayFix<TPoint>* aPointerArray) ;
+	virtual void WsDrawPolyLineNoEndPointL(TPoint* aPointerArray, TInt aCount);
+	virtual void WsDrawPolygonL(CArrayFix<TPoint>* aPointerArray, TInt aFillRule ) ;
+	virtual void WsDrawEllipseL(TRect& aRect) ;
+	virtual void WsDrawLineL(TPoint& aStart, TPoint& aEnd) ;
+	virtual void WsDrawLineToL(TPoint& aPoint) ;
+	virtual void WsDrawLineByL(TPoint& aPoint) ;
+	virtual void WsDrawRectL(TRect& aRect) ;
+	virtual void WsDrawText1L(TPtr& aTextValue, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawText2L(TPtr& aTextValue, TPoint& aPoint,THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawText3L(TPtr& aTextValue, TRect& aRect, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawText4L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextAlign , TInt aTextMargin ,THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawText5L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextAlign , TInt aTextMargin ,TInt aTextWidth, THuiCanvasTextParameters& aTextParameters) ; //XXX_CFbsBitGc_Hack Remove!!!
+	virtual void WsDrawTextVertical1L(TPtr& aTextValue, TInt aTextUp, THuiCanvasTextParameters& aTextParameters)	;
+	virtual void WsDrawTextVertical2L(TPtr& aTextValue, TInt aTextUp,TPoint& aPoint, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawTextVertical3L(TPtr& aTextValue, TInt aTextUp, TRect& aRect, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawTextVertical4L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextUp, TInt aTextAlign, TInt aTextMargin, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawTextVertical5L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextUp, TInt aTextAlign, TInt aTextMargin, TInt aTextWidth, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsMoveToL(TPoint& aPoint) ;
+	virtual void WsMoveByL(TPoint& aPoint) ;
+	virtual void WsPlotL(TPoint& aPoint) ;
+	virtual void WsResetL() ;
+	virtual void WsSetBrushColorL(TRgb aColor) ;
+	virtual void WsSetBrushOriginL(TPoint& aPoint) ;
+	virtual void WsSetBrushStyleL(TInt aStyle) ;
+	virtual void WsSetClippingRegionL(RRegion& aRegion) ;
+	virtual void WsSetDrawModeL(TInt aDrawModew) ;
+	virtual void WsSetOriginL(TPoint& aOrigin);
+	virtual void WsSetPenColorL(TRgb aColor) ;
+	virtual void WsSetPenStyleL(TInt aStyle) ;
+	virtual void WsSetPenSizeL(TInt aWidth, TInt aHeight) ;
+	virtual void WsSetTextShadowColorL(TRgb aColor) ;
+	virtual void WsSetCharJustificationL(TInt aExcessiveWidth, TInt aNumGap) ;
+	virtual void WsSetWordJustificationL(TInt aExcessiveWidth, TInt aNumGap) ;
+	virtual void WsSetUnderlineStyleL(TInt aValue) ;
+	virtual void WsSetBrushPatternL(TInt aValue) ;
+//	virtual void SetBrushPattern(TInt aFbsBitmapHandle) ;
+	virtual void WsSetFontL(TInt aFontId) ;
+
+	// CFbsBitGc functionality used by Wserv for its internal operations
+	virtual void WsCopyRectL(TPoint& aPoint, TRect& aRect) ;
+	virtual void WsCopySettingsL() ;
+	virtual void WsUpdateJustificationL(TPtr&  aTextValue) ;
+	virtual void WsUpdateJustificationVerticalL(TInt aValue, TPtr& aTextValue) ;
+	virtual void WsSetFontNoDuplicateL(TInt aCurrentFont) ;
+		
+	virtual void WsSetClippingRectL(TRect& aRect) ; 
+	virtual void WsCancelClippingRectL() ; 
+	virtual void WsSetFadedL(TInt& aFaded) ; 
+	virtual void WsSetFadingParametersL(TInt aFaded1, TInt aFaded2) ; 
+	virtual void WsFadeAreaL(RRegion& aRegion) ; 
+	virtual void WsMapColorsL() ; 
+	virtual void WsSetUserDisplayModeL(TInt aMode) ; 
+	virtual void WsUseFontL(TInt aCurrentFont) ;
+	
+    virtual void WsCombinedBitBltMaskedL(TRect aDestinationRect, const RArray<THuiCachedCombinedImageParams>& aBlits) ;	 
+
+    // Canvas functionality
+    virtual void BeginActionL(TInt aAction, TRect aDisplayRect,const CHuiCanvasVisual& aUser, TBool aIsCachePrepared, const TRegion& aUpdateRegion);
+    virtual void EndActionL(const TRegion& aUpdateRegion, TBool aUpdateDisplay);
+    virtual TInt SetCapturingBufferL(CFbsBitmap* aTarget);
+    virtual CHuiCanvasGc& CanvasGc() const;     
+    virtual void SetPositionDelta( TPoint& aPoint );
+    virtual void ClearCache();
+    
+    virtual void SetRelativeOrientation(CHuiGc::TOrientation aOrientation);
+
+    virtual TBool IsRenderBufferEnabled() const;
+    virtual TBool IsRenderBufferPrepared() const;
+    virtual TBool IsRenderBufferInitialized() const;
+    virtual TInt EnableRenderbuffer(TBool aEnable = ETrue);
+    
+    virtual THuiCanvasWsGcType Type() const;
+    
+    virtual void EnableUpdateRegion(const TRegion& aUpdateRegion, TBool aClear);
+    virtual void DisableUpdateRegion();
+    
+  ~CHuiCanvasDebugWsGc();
+  
+  static CHuiCanvasDebugWsGc* NewL( CHuiCanvasWsGc* aHuiCanvasGc, CAlfCommandDebug& aCommandDebugger ); 
+  
+private:
+    
+    CHuiCanvasDebugWsGc( CAlfCommandDebug& aCommandDebugger );
+    
+  	void ConstructL( CHuiCanvasWsGc* aHuiCanvasGc ); 
+  
+  	private:
+  	    
+  	CHuiCanvasWsGc* iCanvasWsGc;
+  	CAlfCommandDebug& iCommandDebugger;
+    };
+    
+#endif  // __HUICANVASDEBUGWSGC_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huicanvasgc.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,257 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiCanvasGc
+*
+*/
+
+
+
+#ifndef __HUICANVASGC_H__
+#define __HUICANVASGC_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiVisual.h>
+#include <uiacceltk/HuiGc.h>
+#include <uiacceltk/HuiDisplay.h>
+#include <uiacceltk/HuiTexture.h>
+
+const TInt KHuiCanvasGcRegionGranularity = 10;
+
+struct THuiRealLine
+    {
+    THuiRealLine(){}
+    THuiRealLine(const THuiRealPoint& aStart, const THuiRealPoint& aEnd):iStart(aStart),iEnd(aEnd){}
+
+    THuiRealPoint iStart;
+    THuiRealPoint iEnd;    
+
+	private:
+    TInt iSpare1;
+    TInt iSpare2;
+    };
+
+enum THuiCanvasClipMode
+    {
+    /** Clipping is disabled */
+    EHuiCanvasClipModeNone,
+    
+    /** Normal clipping, clipping is set immediately when clip methods are called */
+    EHuiCanvasClipModeNormal,
+    
+    /** Delayed clipping, clipping is actually set just before every CHuiCanvasGc draw operation and only if really needed */
+    EHuiCanvasClipModeDelayed            
+    };
+
+enum THuiCanvasDrawMode
+    {
+    /** Drawing is done by blending */
+    EHuiCanvasDrawModeBlend,
+
+    /** Drawing is done by writing alpha values directly without blending */
+    EHuiCanvasDrawModeNormal            
+    };
+
+/* Forward declarations. */    
+class CHuiCanvasRenderBuffer;
+class CHuiCanvasVisual;
+class MHuiTexture;
+class CHuiTexture;
+
+class CHuiCanvasGc : public CBase
+    {
+public:
+    enum TClipRectVisibility
+        {
+        EFullyOutside,
+        EFullyInside,
+        EPartialOverlap,
+        EUnknown
+        };
+
+	/**
+	 * Constructor.
+	 */
+	IMPORT_C CHuiCanvasGc();
+
+	/**
+	 * Destructor.
+	 */ 
+	IMPORT_C ~CHuiCanvasGc();
+
+    /** General */
+    IMPORT_C virtual void SetGc( CHuiGc& aGc );
+    IMPORT_C virtual void SetVisual(const CHuiCanvasVisual& aVisual);
+
+    /** Clipping ops */
+    IMPORT_C void SetClippingMode(THuiCanvasClipMode aClipMode);
+	IMPORT_C void Clip(const TRect& aClipRect);
+	IMPORT_C void ClipRegion(const TRegion& aClipRegion);
+	IMPORT_C void CancelClipping();
+
+    /** Drawing ops. Although these are virtual, render specific code is typically at DoDrawXXX method overrides */
+    IMPORT_C virtual void DrawImage(const CHuiTexture& aImage, const THuiRealRect& aDestinationRect);
+    IMPORT_C virtual void DrawImage(const CHuiTexture& aImage, const THuiRealRect& aDestinationRect, const THuiRealRect& aSourceRect);
+    IMPORT_C virtual void DrawImage(const CHuiTexture& aImage, const THuiRealRect& aDestinationRect, const THuiRealRect& aSourceRect, CHuiGc::TStretchMode aStretchMode);
+    IMPORT_C virtual void DrawImage(const CHuiCanvasRenderBuffer& aImage, const THuiRealPoint& aDestinationPoint);
+    IMPORT_C virtual void DrawText(const CHuiTextMesh& aTextMesh, const THuiRealRect& aDestinationRect);    
+    IMPORT_C virtual void DrawLines(RArray<THuiRealLine>& aLines);    
+    IMPORT_C virtual void DrawEllipse(const THuiRealRect& aDestinationRect);
+	IMPORT_C virtual void DrawPoints(RArray<THuiRealPoint>& aPoints);
+	IMPORT_C virtual void DrawPolygon(RArray<THuiRealPoint>& aPoints);
+	IMPORT_C virtual void DrawRects(RArray<THuiRealRect>& aRects);
+	IMPORT_C virtual void DrawPie(const THuiRealRect& aDestinationRect, const THuiRealPoint& aStart, const THuiRealPoint& aEnd);
+	IMPORT_C virtual void DrawArc(const THuiRealRect& aDestinationRect, const THuiRealPoint& aStart, const THuiRealPoint& aEnd);
+	IMPORT_C virtual void DrawRoundRect(const THuiRealRect& aDestinationRect, const THuiRealSize& aSize);
+
+    /** Setters */
+    IMPORT_C virtual void SetTextStyle(TInt aStyleId);
+    IMPORT_C virtual void SetPenColor(const TRgb& aColor);
+  	IMPORT_C virtual void SetPenWidth(const TReal32& aWidth);
+  	IMPORT_C virtual void SetOpacity(const TReal32& aOpacity);
+  	IMPORT_C virtual void SetPolygonDrawMode(THuiFillMode aPolygonDrawMode);
+    IMPORT_C virtual void SetPolygonFillTexture(CHuiTexture* aTexture);
+    IMPORT_C virtual void SetPolygonFillTextureOrigin(const TPoint& aOrigin);
+	IMPORT_C virtual void SetTextAlign(THuiAlignHorizontal aAlignHorizontal, THuiAlignVertical aAlignVertical);
+	IMPORT_C virtual void SetDefaults();
+    IMPORT_C virtual void SetDrawMode(THuiCanvasDrawMode aDrawMode);
+	    
+    /** Transformations */
+    IMPORT_C virtual void LoadIdentity();
+	IMPORT_C virtual void Translate(const TReal32& aX, const TReal32& aY, const TReal32& aZ);
+	IMPORT_C virtual void Scale(const TReal32& aX, const TReal32& aY, const TReal32& aZ);
+	IMPORT_C virtual void Rotate(const TReal32& aAngle, const TReal32& aX, const TReal32& aY, const TReal32& aZ);
+    IMPORT_C virtual void PushTransformationMatrix();
+    IMPORT_C virtual void PopTransformationMatrix();
+
+    /** Getters */
+    IMPORT_C virtual TInt TextStyle() const;
+    IMPORT_C virtual TInt TextVerticalAlign() const;
+    IMPORT_C virtual TInt TextHorizontalAlign() const;
+    IMPORT_C virtual TReal32 PenWidth() const;
+  	IMPORT_C virtual THuiFillMode PolygonDrawMode() const;
+    IMPORT_C virtual CHuiTexture* PolygonFillTexture() const;
+    IMPORT_C virtual TPoint PolygonFillTextureOrigin() const;
+  	
+  	/** Background drawing */
+  	IMPORT_C virtual void Clear(const THuiRealRect& aRect);
+  	IMPORT_C virtual void ClearWithSkinBackground(const THuiRealRect& aRect);
+  	IMPORT_C virtual void ClearWithBackgroundItems(const THuiRealRect& aRect, const RArray<THuiDisplayBackgroundItem>& aItems);
+
+  	/** Render buffer handling */
+    IMPORT_C virtual CHuiCanvasRenderBuffer* CreateRenderBufferL(const TSize& aSize);
+    IMPORT_C virtual void ClearRenderBuffer( CHuiCanvasRenderBuffer& aImage, const TRect & aRect );
+
+    /** Misc */
+    IMPORT_C void EnableBlendingIfNeeded(const CHuiTexture* aTexture = NULL);
+    
+    /** Misc getters */
+    CHuiCanvasVisual* Visual() const;
+    TRgb PenColor() const;
+    TReal32 Opacity() const;
+    CHuiGc* Gc() const;
+    THuiCanvasDrawMode DrawMode() const;
+
+    /** Clipping helpers */
+    TClipRectVisibility IsClipped(const TRegion& aTestedRegion, const TRegion& aClippingRegion) const;
+
+    /** Restores gc state (partially) */
+    void RestoreState() const;
+    
+    /** Restores gc state (uses gc state dirty flags (if renderer supports) to avoid unnecessary restore ops */
+    IMPORT_C virtual void RestoreFlaggedState() const;
+    
+    /** 
+     * Enables (or disables) effective opacity, which means that visuals effective opacity is 
+     * used to calculate real pen opacity. By default effective opacity is enabled.
+     * */
+    void EnableEffectiveOpacity(TBool aEnable);
+
+protected:
+
+    /** Misc clipping related methods */
+    IMPORT_C virtual TInt MaxNumberOfClipRects() const;
+    IMPORT_C TClipRectVisibility EnableDelayedClippingIfNeeded(const THuiRealRect& aUpdatedRect);
+    IMPORT_C TClipRectVisibility EnableDelayedClippingIfNeeded(const RArray<THuiRealPoint>& aUpdatedPoints);
+    IMPORT_C TClipRectVisibility EnableDelayedClippingIfNeeded(const RArray<THuiRealLine>& aUpdatedLines);
+    IMPORT_C TClipRectVisibility EnableDelayedClippingIfNeeded(const RArray<THuiRealRect>& aUpdatedRects);    
+    IMPORT_C void DisableDelayedClippingIfNeeded();
+    IMPORT_C TBool ClipNext();
+
+    /** Drawing ops steup/cleanup helpers */
+    IMPORT_C void Setup();
+    IMPORT_C void Cleanup();
+
+    /** Clipping helpers */
+    TClipRectVisibility IsClipped(const TRect& aRect) const;
+    TClipRectVisibility IsClipped(const TPoint& aPoint) const;
+
+    TClipRectVisibility IsClipped(const TRect& aRect, const TRegion& aClippingRegion) const;
+    TClipRectVisibility IsClipped(const TPoint& aPoint, const TRegion& aClippingRegion) const;
+    
+    /** Drawing ops implementations, render specific code typically overrides these */
+    IMPORT_C virtual void DoDrawRects(RArray<THuiRealRect>& aRects);
+    IMPORT_C virtual void DoDrawLines(RArray<THuiRealLine>& aLines);
+    IMPORT_C virtual void DoDrawArc(const THuiRealRect& aDestinationRect, const THuiRealPoint& aStart, const THuiRealPoint& aEnd);
+    IMPORT_C virtual void DoDrawRoundRect(const THuiRealRect& aDestinationRect, const THuiRealSize& aSize);
+    IMPORT_C virtual void DoDrawPolygon(RArray<THuiRealPoint>& aPoints);        
+	IMPORT_C virtual void DoDrawPoints(RArray<THuiRealPoint>& aPoints);
+    IMPORT_C virtual void DoDrawPie(const THuiRealRect& aDestinationRect, const THuiRealPoint& aStart, const THuiRealPoint& aEnd);    
+    IMPORT_C virtual void DoDrawRenderBuffer(const CHuiCanvasRenderBuffer& aImage, const THuiRealPoint& aDestinationPoint);
+    IMPORT_C virtual void DoClearRenderBuffer( CHuiCanvasRenderBuffer& aImage, const TRect & aRect );
+    
+protected:
+ 
+    /** General attributes */    
+    CHuiGc* iGc;
+    CHuiCanvasVisual* iVisual;
+
+    /** Drawing attributes */    
+    TRgb    iPenColor;
+    TReal32 iPenWidth;
+    TReal32 iOpacity;
+    THuiFillMode    iPolygonDrawMode;
+    THuiAlignVertical iVerticalTextAlign;
+    THuiAlignHorizontal iHorizontalTextAlign;
+    TInt iTextStyleId;
+    THuiCanvasDrawMode iDrawMode;
+    
+    /** Clipping attributes */    
+    RRegionBuf<KHuiCanvasGcRegionGranularity> iClippingRegion;
+    THuiCanvasClipMode iClipMode;
+
+    /** Delayed clipping attributes */    
+    RRegionBuf<KHuiCanvasGcRegionGranularity> iDelayedClipRegion;
+    TInt  iDelayedClipCount;
+    TBool iDelayedClipRectPushed;
+    TClipRectVisibility iDelayedClipVisibility;
+    
+    /** Setup/cleanup attributes */    
+    TRgb iOldPencolor;
+    TInt iOldPenAlpha;    
+
+    /** Temp region */    
+    mutable RRegionBuf<KHuiCanvasGcRegionGranularity> iTempRegion;
+    mutable RRegionBuf<KHuiCanvasGcRegionGranularity> iTempRegion2;
+    
+    /** Flag to decide wheter pen alpha is to be multiplied with visual effective opacity */    
+    TBool iEffectiveOpacityEnabled;
+    
+    /** Polygon fill texture, NOT owned */
+    CHuiTexture* iPolygonFillTexture;
+    TPoint iPolygonFillTextureOrigin;
+    };
+
+#endif        
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huicanvaspainter.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,370 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiCanvasPainter.
+*
+*/
+
+
+
+#ifndef __HUICANVASPAINTER_H__
+#define __HUICANVASPAINTER_H__
+
+
+#include <e32cmn.h>
+#include <e32std.h>
+#include <e32base.h>
+#include <e32def.h>
+#include "huicanvastexturecache.h"
+
+
+/* Forward declarations. */
+class CHuiControl;
+class THuiCanvasDrawImageParams;
+class THuiCanvasTextParameters;
+class CHuiCanvasGc ;
+class CHuiGc;
+class CHuiCanvasCommandBuffer;
+
+const TInt KHuiCanvasCommandBufferRegionGranularity = 5;
+
+enum THuiCanvasBufferStatusFlags
+    {
+    /** Buffer is new */
+    EHuiCanvasBufferStatusNew = 0x1,
+    /** Buffer has been scanned */
+    EHuiCanvasBufferStatusScanned = 0x2,        
+    /** Buffer has been drawn */
+    EHuiCanvasBufferStatusDrawn = 0x4,    
+    
+    /** Flag to say wheter buffer really contains somethign that really draws something */
+    EHuiCanvasBufferContainsDrawing = 0x8000,
+    /** All flags, can be used for clearing all flags */
+    EHuiCanvasBufferStatusAll = 0xFFFFFFFF
+    };
+
+
+NONSHARABLE_CLASS( MHuiCmdBufDestroyObserver )
+    {
+    public:
+        virtual void DestroyBuffer(CHuiCanvasCommandBuffer *aBuffer)=0;
+    };
+
+NONSHARABLE_CLASS( CHuiCanvasCommandBuffer ) : public CBase
+    {
+ public:
+    CHuiCanvasCommandBuffer() :    
+        iChanged(ETrue),
+        iStatusFlags(EHuiCanvasBufferStatusNew)
+            {
+            iCreationTime.UniversalTime();
+            }
+    ~CHuiCanvasCommandBuffer()
+        {
+        TInt count = iObservers.Count();
+        for(int i=0;i<count;i++)
+            {
+            iObservers[i]->DestroyBuffer(this);
+            }
+        iObservers.Close();
+        delete iCommands;
+        iUpdateRegion.Close();
+        iOriginalUpdateRegion.Close();
+#ifdef HUI_DEBUG_TRACK_DRAWING   
+        delete iProcessName;
+#endif
+        }
+    
+    void SetStatusFlags(THuiCanvasBufferStatusFlags aStatusFlags)
+        {
+        iStatusFlags |= aStatusFlags;        
+        }
+
+    void ClearStatusFlags(THuiCanvasBufferStatusFlags aStatusFlags)
+        {
+        iStatusFlags &= ~aStatusFlags;
+        }
+    void AddDestroyObserver(MHuiCmdBufDestroyObserver *aObserver )
+        {
+        iObservers.AppendL(aObserver);
+        }
+    void RemoveDestroyObserver(MHuiCmdBufDestroyObserver *aObserver)
+        {
+        TInt count = iObservers.Count();
+        for(int i=count-1;i>=0;i--)
+            {
+            if (iObservers[i]==aObserver)
+                {
+                iObservers.Remove(i);
+                }
+            }
+        }
+public:
+    /** Buffer containing the drawing commands */            
+	HBufC8* iCommands;
+	
+    /** Optional region which specifies the area where commands are to be drawn */
+    RRegionBuf<KHuiCanvasCommandBufferRegionGranularity> iUpdateRegion;
+    
+    /** The original iUpdateRegion before any intersection with the shape region  */
+    RRegionBuf<KHuiCanvasCommandBufferRegionGranularity> iOriginalUpdateRegion;
+    
+    /** Rect of the visual when command buffer was set/added */
+    THuiRealRect iOriginalDisplayRect;
+    
+	/** The position of the visual, when the update region was last modfied */
+    TPoint iPositionForUpdateRegion;
+    
+    /** Internal flag that can be used to track changes. This is similar to visual changed flag. */
+    TBool iChanged;
+
+    /** Internal flag that can be used to track buffer status. This is mainly used for optimizing drawing. */
+    TInt iStatusFlags;
+    
+    /** Time when this buffer has been created */
+    TTime iCreationTime;
+    
+    /** Display orientation when this buffer has been created */
+    CHuiGc::TOrientation iOrientation;
+    
+    /** Flag to tell if buffer has unsupported commands (fallback mode is needed) */
+    TBool iContainsUnsupportedCommands;
+    
+#ifdef HUI_DEBUG_TRACK_DRAWING	   
+    TBool iTrackedBuffer;
+    
+    HBufC16* iProcessName;
+#endif    
+    
+    RPointerArray<MHuiCmdBufDestroyObserver> iObservers;
+    };
+
+enum THuiCanvasBufferAction
+    {
+    /** Draw buffer content to the canvas */
+    EDrawBuffer,
+    
+    /** Scan buffer content */
+    EScanBuffer        
+    };
+
+/**
+ * This class is used internally by the toolkit and thus should
+ * not be used by the applications directly.
+ */
+NONSHARABLE_CLASS (CHuiCanvasPainter) : public CBase
+    {
+
+public:
+
+    /**
+     * Sets buffer that contains canvas drawing commands. This
+     * method clears previous buffer(s), so this is eqvivalent
+     * to calling both ClearCommandSet and AddCommandSetL.
+     *
+     * @param aCommands Commanbuffer
+     */
+    virtual void SetCommandSetL( const TDesC8& aCommands );
+    
+    /**
+     * Clears buffer(s) that contains canvas drawing commands. 
+     */
+    virtual void ClearCommandSet();
+    
+    /**
+     * Adds buffer that contains more canvas drawing commands,
+     * those will be executed after the buffers that has been
+     * added previously.
+     * @param aMoreCommands Commanbuffer
+     */
+    virtual void AddCommandSetL( const TDesC8& aMoreCommands );
+    
+    /**
+     * Adds partial buffer that contains more canvas drawing commands. These
+     * commands are appended to the commands set previously with this method
+     * until param aLastPart has value ETrue. After that whole command set
+     * will be added among possibly already existing command sets and
+     * it will be drawable.
+     * 
+     * @param aMoreCommands Commanbuffer
+     * @param aLastPart EFalse if there are more commands to be added into this
+     * command set before it is wanted to be available for drawing. ETrue if
+     * command set is ready and no more parts are expected.
+     */
+    virtual void AddPartialCommandSetL( const TDesC8& aMoreCommands, TBool aLastPart );
+
+#ifdef HUI_DEBUG_TRACK_DRAWING
+	virtual void SetTrackCommandSet( TFileName& aFileName, TBool aTrack );
+#endif
+    /**
+     * Clears internal cached texts and images.
+     */
+    virtual void ClearCache()= 0;
+  
+    /**
+     * Handles the command buffer(s), either draws or performs a scan.
+     *
+     * @param aDisplayRect Area in screen coordinates where painter is supposed to draw,
+     *        method implementation should modify the given rect to contain the real (smaller) 
+     *        area where drawing happens.
+     *
+     * @param aAction Action that painter is supposed to do with the buffer.
+     *
+     *        Possible values are:
+     *
+     *        EScanBuffer - Painter is supposed to scan the buffer and
+     *          1) Prepare its internal caches (if it uses such) and other
+     *             similar opearations which may take relatively long time to complete. 
+     *          2) Prepare PaintedAreaCount() and PaintedArea() to contain the 
+     *             real rectangles where drawing is going to happen.
+     *
+     *        EDrawBuffer - Painter is supposed to draw the content of the
+     *          buffer to the given display rect. This action is supposed to
+     *          be as fast as possible.
+     *
+     * @param aUser Canvas visual using this painter
+     * @param aGc Toolkit graphics context
+	 * @param @aPos The current position of the visual. This is used for drawing 
+	 *        the buffers on correct location, if the visual position changes
+     */
+    virtual void HandleBufferL(TRect& aDisplayRect, TInt aAction, const CHuiCanvasVisual& aUser, CHuiGc* aGc, TPoint aPos ) = 0;
+
+    /** Same as the other handlebuffer, except it allows external command buffers to be provided
+     *  
+     */
+    virtual void HandleBufferL(TRect& aDisplayRect, TInt aAction, const CHuiCanvasVisual& aUser, CHuiGc* aGc, TPoint aPos, TPtrC8 aCommands, CHuiCanvasCommandBuffer *buf) =0;
+    /**
+     * Returns the number of rectangular areas which contain something that is
+     * drawn by the painter.
+     *
+     * @return number of painted areas.
+     * @see PaintedArea()
+     */
+    virtual TInt PaintedAreaCount() const = 0;
+    
+    /**
+     * Returns information of the painted area at given index. 
+     *
+     * @aIndex Index of the painted area.
+     * @return Painted area info.
+     * @see PaintedAreaCount()
+     */
+    virtual THuiCanvasPaintedArea PaintedArea(TInt aIndex) = 0;
+    
+    /**
+     * Draws content of the window in pixel format to the given bitmap. 
+     * This method may not be supported in all commanbuffertype/renderer combinations.
+     *
+     * @param aTargetBuffer where content of the window is to be drawn. NULL if the drawing
+     * is to be stopped.
+     *
+     * @return KErrNotSupported if the current renderer/painter does not support the
+     * feature. Leave happens in other unexpected error situtations. 
+     *         
+     */
+    virtual TInt SetCapturingBufferL(CFbsBitmap* /*aTarget*/) = 0;
+
+    /**
+     * Tells painter to enable/disable render buffer (if it is supported by the
+     * painter implementation)
+     *  
+     * @return KErrNotSupported if the current renderer/painter does not support the
+     * feature.     *
+     */
+    virtual TInt EnableRenderBuffer(TBool aEnable = ETrue) = 0;
+    
+    /**
+     * Destructor        
+     */
+    virtual ~CHuiCanvasPainter();
+
+    /**
+     * Returns reference to used canvas gc
+     */
+    virtual CHuiCanvasGc& CanvasGc() const = 0;
+    
+    /**
+     * Sets canvas visual that this painter draws into
+     */
+    void SetVisual(CHuiCanvasVisual* aVisual);
+
+    /**
+     * Gets canvas visual that this painter is drawing into.
+     */
+    CHuiCanvasVisual* Visual();
+    
+    /**
+     * Does this painter have command buffers
+     */
+    TBool HasCommandBuffers();
+    
+    /**
+     * Is any of the buffers changed
+     */
+    TBool BuffersChanged() const;
+
+    /**
+     * Clear every buffers changed flag.
+     */
+    void ClearAllBuffersChanged();    
+
+    /**
+     * Sets every buffers changed flag to the given value.
+     * @param aChange flag value
+     */
+    void SetAllBuffersChanged(TBool aChanged);    
+
+    /**
+     * Requests env to start refresh of whole visual tree
+     */
+    void RequestContinueRefresh();
+    
+    /**
+     * Sets given status for every buffer.
+     */
+    void SetAllBufferStatusFlags(THuiCanvasBufferStatusFlags aStatus);
+
+    /**
+     * Clears given status for every buffer.
+     */
+    void ClearAllBufferStatusFlags(THuiCanvasBufferStatusFlags aStatus);
+
+    /**
+     * Does this painter have command buffers with given statusflags.
+     */
+    TBool HasCommandBuffers(THuiCanvasBufferStatusFlags aStatusFlags);
+
+    /**
+     * Does this painter have command buffers without given statusflags.
+     */
+    TBool HasCommandBuffersWithoutFlags(THuiCanvasBufferStatusFlags aStatusFlags);
+
+    /**
+     * Does this painter have command buffers older than given time.
+     */
+    TBool HasOldCommandBuffers(TInt aLifeTimeInMs);
+
+    TInt NumBuffers() const { return iCommandBuffers.Count(); }
+    CHuiCanvasCommandBuffer *At(TInt aIndex) const { return iCommandBuffers[aIndex]; }
+protected:
+	
+    /** Command buffers */
+	RPointerArray<CHuiCanvasCommandBuffer> iCommandBuffers;
+    
+    /** Partial command buffer which will be updated with more commands soon. This buffer is not yet ready for drawing */
+    HBufC8* iPartialCommandBuffer;    
+    
+    /** Canvas visual which uses this background */
+    CHuiCanvasVisual* iCanvasVisual;    
+    }; 
+#endif  // __HUICANVASPAINTER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huicanvasrenderbuffer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiCanvasRenderBuffer
+*
+*/
+
+
+
+#ifndef __HUICANVASRENDERBUFFER_H__
+#define __HUICANVASRENDERBUFFER_H__
+
+
+#include <e32base.h>
+    
+/* Forward declarations. */    
+class CHuiRenderPlugin;
+
+class CHuiCanvasRenderBuffer : public CBase
+    {
+public:
+
+	/**
+	 * Constructor.
+	 */
+	IMPORT_C CHuiCanvasRenderBuffer();
+
+	/**
+	 * Destructor.
+	 */ 
+	IMPORT_C ~CHuiCanvasRenderBuffer();
+    
+    /**
+     * Initializes render buffer.
+     */
+	IMPORT_C virtual void InitializeL(const TSize& aSize);
+    
+    /**
+     * Releases render buffer resources.
+     */
+	IMPORT_C virtual void UnInitialize();
+	
+    /**
+     * Binds as render target.
+     */ 
+	IMPORT_C virtual void Bind();
+
+    /**
+     * Unbinds as from being the active render target.
+     */ 
+    IMPORT_C virtual void UnBind();
+
+    /**
+     * Returns size in pixels.
+     */ 
+    IMPORT_C TSize Size() const;
+    
+    /**
+     * Is buffer initilized or not
+     */ 
+    IMPORT_C TBool IsInitialized() const;
+    
+    /**
+     * Copies content from the given buffer
+     */ 
+    IMPORT_C virtual void Copy(const CHuiCanvasRenderBuffer& aSourceBuffer);
+    
+    /**
+     * Copies content from the active surface.
+     */ 
+    IMPORT_C virtual void Copy(TPoint aPoint);    
+    
+protected:
+    
+    TSize iSize;
+    TBool iInitialized;
+ 
+    };
+
+#endif        
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huicanvastexturecache.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,474 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __HUICANVASTEXTURECACHE_H__
+#define __HUICANVASTEXTURECACHE_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiCanvasCmdBufferReader.h>
+#include <uiacceltk/HuiImage.h>
+#include <uiacceltk/HuiTexture.h>
+#include <uiacceltk/HuiCanvasVisual.h>
+#include <uiacceltk/huilowmemoryobserver.h>
+
+class CHuiTexture;
+class CHuiCanvasVisual;
+class CHuiCanvasRenderBuffer;
+class CHuiCanvasTextImage;
+class CHuiCanvasGraphicImage;
+class CHuiCanvasRenderBufferImage;
+class CHuiCanvasTextImageRasterizer;
+class CHuiCanvasGraphicImageRasterizer;
+class CHuiCanvasCombinedGraphicImageRasterizer;
+class CHuiCanvasTextureCache;
+
+NONSHARABLE_CLASS( THuiCachedGcParams )  
+    {
+public:
+    THuiCachedGcParams() :    
+        iPenColor(KHuiWsDefaultPenColor),
+        iPenStyle(KHuiWsDefaultPenStyle),
+        iDrawMode(KHuiWsDefaultDrawMode),
+        iBrushColor(KHuiWsDefaultBrushColor),
+        iBrushStyle(KHuiWsDefaultBrushStyle),
+        iShadowMode(KHuiWsDefaultShadowMode),
+        iStrikethrough(KHuiWsDefaultStrikethrough),
+        iUnderline(KHuiWsDefaultUnderline),
+        iUserDisplayMode(KHuiWsDefaultUserDisplayMode),
+        iShadowColor(KHuiWsDefaultShadowColor)
+            {
+            }
+
+    TRgb  iPenColor;
+    TInt  iPenStyle;
+    TInt  iDrawMode;
+    TRgb  iBrushColor;
+    TInt  iBrushStyle;
+    TInt  iShadowMode;
+    TInt  iStrikethrough;
+    TInt  iUnderline;
+    TInt  iUserDisplayMode;
+    TRgb  iShadowColor;        
+    };
+
+
+NONSHARABLE_CLASS( THuiCachedImageParams )  
+    {
+public:
+    THuiCachedImageParams() :    
+        iBitmapHandle(0),
+        iMaskHandle(0),
+        iInvertedMask(EFalse),
+        iMaskOriginPoint(TPoint(0,0))
+            {
+            }
+
+    TInt iBitmapHandle;
+    TInt iMaskHandle;
+    TBool iInvertedMask;
+    TPoint iMaskOriginPoint;
+    THuiCachedGcParams iGcParams;
+    };
+
+NONSHARABLE_CLASS( THuiCachedCombinedImageParams )  
+    {
+public:
+    THuiCachedCombinedImageParams() :    
+        iBitmapHandle(0),
+        iMaskHandle(0),
+        iCombinedBitmapPoint(TPoint(0,0))
+            {
+            }
+
+    TInt iBitmapHandle;
+    TInt iMaskHandle;
+    TPoint iCombinedBitmapPoint;
+    };
+
+NONSHARABLE_CLASS( THuiCachedTextParams )
+    {      
+public:
+    THuiCachedTextParams() :
+        iText(NULL),
+        iFontHandle(0),
+        iRasterizationOffset(TPoint(0,0)),
+        iTextParams(THuiCanvasTextParameters()),
+        iTextBoxMaxSize(TSize(KMinTInt,KMinTInt)),
+        iTextWidth(KMinTInt),
+        iBaseLineOffset(KMinTInt),
+        iTextAlign(CGraphicsContext::ELeft),
+        iMargin(0),
+        iAngle(0)
+            {
+            }
+    
+    HBufC* iText;
+    TPtr* iFindTextPtr;
+    TInt iFontHandle;
+    TPoint iRasterizationOffset;
+    THuiCanvasTextParameters iTextParams;
+    TSize iTextBoxMaxSize;        
+    TInt iTextWidth;
+    TInt iBaseLineOffset;
+    TInt iTextAlign;
+    TInt iMargin;
+    TInt iAngle;
+    THuiCachedGcParams iGcParams;
+    };
+
+NONSHARABLE_CLASS( THuiCachedBitmap )  
+    {
+public:
+    THuiCachedBitmap() :    
+        iBitmapHandle(0),
+        iMaskHandle(0),
+        iBitmap(0),
+        iMask(0),
+        iBitmapTouchCount(-1),
+        iMaskTouchCount(-1),
+        iInvertedMask(EFalse),
+        iMaskOriginPoint(TPoint(0,0)),
+        iCombinedBitmapPoint(TPoint(0,0))       
+            {
+            }
+
+    TInt iBitmapHandle;
+    TInt iMaskHandle;
+    CFbsBitmap* iBitmap;
+    CFbsBitmap* iMask;    
+    TInt iBitmapTouchCount;
+    TInt iMaskTouchCount;
+    TBool iInvertedMask;
+    TPoint iMaskOriginPoint;
+    TPoint iCombinedBitmapPoint;
+    };
+
+
+NONSHARABLE_CLASS( CHuiCanvasImage ) : public CBase
+    {
+public:
+    
+    CHuiCanvasImage();
+
+    ~CHuiCanvasImage();
+
+    void RefreshUser(const CHuiCanvasVisual& aUser);
+
+    void RemoveUser(const CHuiCanvasVisual& aUser);
+
+    TBool IsUser(const CHuiCanvasVisual& aUser) const;
+
+    TBool IsAnyUser() const;
+        
+    CHuiTexture* Texture() const;
+        
+    virtual void CopyAttributes(CHuiCanvasImage& aSrc);
+
+    virtual void Reset();
+
+public:
+
+    CHuiTexture* iTexture;
+    THuiCachedGcParams iGcParams;
+    RPointerArray<CHuiCanvasVisual> iActiveUsers;
+    TTime iLastUsed;
+    CHuiCanvasTextureCache* iCache;
+    };
+
+
+NONSHARABLE_CLASS( CHuiCanvasGraphicImage ) : public CHuiCanvasImage
+    {
+public:
+    
+    CHuiCanvasGraphicImage();
+
+    ~CHuiCanvasGraphicImage();
+
+    virtual void CopyAttributes(CHuiCanvasGraphicImage& aSrc);
+
+    virtual void Reset();
+
+public:
+
+    TInt iBitmapHandle;
+    TInt iMaskHandle;
+    CFbsBitmap* iBitmap;
+    CFbsBitmap* iMask;    
+    TBool iInvertedMask;
+    TPoint iMaskOriginPoint;
+    TInt iBitmapTouchCount;        
+    TInt iMaskTouchCount;
+    
+    // Combined image
+    RArray<THuiCachedBitmap> iSubImages;
+    TSize iImageSize; 
+    };
+
+
+NONSHARABLE_CLASS( CHuiCanvasTextImage ) : public CHuiCanvasImage
+    {
+public:
+    
+    CHuiCanvasTextImage();
+
+    ~CHuiCanvasTextImage();
+
+    TBool UseColorModulation() const;
+    
+    virtual void CopyAttributes(CHuiCanvasTextImage& aSrc);
+
+    virtual void Reset();
+
+public:
+
+    HBufC* iText;
+    TPtr* iFindTextPtr;
+    TInt iFontHandle;
+    TPoint iRasterizationOffset;
+    THuiCanvasTextParameters iTextParams;
+    TSize iTextBoxMaxSize;        
+    TInt iTextWidth;
+    TInt iBaseLineOffset;
+    TInt iTextAlign;
+    TInt iMargin;
+    TInt iAngle;
+    TBool iUseColorModulation;
+    // not owned
+    CFbsBitGcFont* iFont;
+    };
+
+
+class CHuiCanvasTextureCache : public CBase, public MHuiLowMemoryObserver, public MHuiMemoryLevelObserver
+    {
+public:
+
+	/**
+	 * Constructor.
+	 */
+	CHuiCanvasTextureCache();
+
+
+	/**
+	 * Destructor.
+	 */ 
+	~CHuiCanvasTextureCache();
+
+	/**
+	 * Constructor.
+	 */
+	static CHuiCanvasTextureCache* NewL();
+
+	/**
+	 * Constructor.
+	 */
+    static CHuiCanvasTextureCache* NewLC();
+    
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+    /**
+     * Enables (disables) low memory state.
+     * Deprecated
+     */
+    void EnableLowMemoryState(TBool aEnable);
+
+    /**
+     * Sets memory level. Alternative for EnableLowMemoryState().
+     */
+    void SetMemoryLevel(THuiMemoryLevel aLevel);
+
+    /**
+     * Gets memory level.
+     */
+    THuiMemoryLevel MemoryLevel();
+    
+	/**
+	 * Finds cached combined image and updates it if needed. If not found creates new one into cache.
+	 */ 
+    const CHuiCanvasGraphicImage* CreateCombinedCachedImageL(const RArray<THuiCachedCombinedImageParams>& aCachedImageParams, 
+        const THuiCachedGcParams& aGcParams,
+        const TSize& aImageSize, 
+        const CHuiCanvasVisual& aUser);
+
+	/**
+	 * Finds cached image and updates it if needed. If not found creates new one into cache.
+	 */ 
+    const CHuiCanvasGraphicImage* CreateCachedImageL(const THuiCachedImageParams& aCachedImageParams, const CHuiCanvasVisual& aUser);
+
+	/**
+	 * Finds cached image, but does not update it. If not found, leave happens.
+	 */ 
+    const CHuiCanvasGraphicImage* FindCachedImageL(const THuiCachedImageParams& aCachedImageParams, const CHuiCanvasVisual& aUser);
+
+	/**
+	 * Finds cached text and updates it if needed. If not found creates new one into cache.
+	 */ 
+    const CHuiCanvasTextImage* CreateCachedTextL(const THuiCachedTextParams& aCachedTextParams, const CHuiCanvasVisual& aUser);
+    
+    /**
+     * Finds cached render buffer, if not found it is created. Ownership is not transferred to the caller.  
+     * 
+     * If current renderer does not support canvas render buffers, NULL is returned. 
+     * In unexpected error situations leave happens. 
+     */ 
+    CHuiCanvasRenderBuffer* CreateCachedRenderBufferL(const CHuiCanvasVisual& aUser, TSize aSizeHint = TSize(0,0));
+
+    /**
+     * Finds cached render buffer. Ownership is not transferred to the caller.  
+     */ 
+    CHuiCanvasRenderBuffer* FindCachedRenderBuffer(const CHuiCanvasVisual& aUser);
+
+    /**
+     * Releases render buffer of the given user. Render buffer is not
+     * neccessarely deleted immediately, thus it may continue to be available in the cache.
+     */ 
+    void ReleaseCachedRenderBuffer(const CHuiCanvasVisual& aUser);
+    
+	/**
+	 * This method releases all images and texts that are used by the given user. Images are not
+	 * neccessarely deleted immediately,thus they may continue to be available in the cache.
+	 */ 
+    void ReleaseAllCachedEntries(const CHuiCanvasVisual& aUser);
+
+	/**
+	 * Called by the env when frame has been completed. 
+	 */ 
+    void AdvanceTime();
+
+	/**
+	 * Called when texture memory has run out. This method tries to release more texture memory.
+	 */ 
+    void HandleOutOfTextureMemory();
+
+	/**
+	 * Utility to create new (or reuse recylced) texture.
+	 */ 
+    CHuiTexture* CreateRecycledTextureL();
+
+	/**
+	 * Deletes (or moves to recycling) given texture.
+	 */ 
+    void DeleteRecycledTexture(CHuiTexture* aTexture);
+
+    void EnableTouchCountCheck(TBool aEnable = ETrue);
+    TBool IsTouchCountCheckEnabled();
+
+private:
+    
+    void DeleteAllReleasedEntries(TBool aAllowKeepCached);        
+    
+    void FindUnusedImageEntries(RPointerArray<CHuiCanvasGraphicImage>& aIndexEntries);    
+    void FindUnusedTextEntries(RPointerArray<CHuiCanvasTextImage>& aIndexEntries);
+    void FindUnusedRenderBufferEntries(RPointerArray<CHuiCanvasRenderBufferImage>& aIndexEntries);
+    
+    void SelectPreservedUnusedImageEntries(RPointerArray<CHuiCanvasGraphicImage>& aIndexEntries);    
+    void SelectPreservedUnusedTextEntries(RPointerArray<CHuiCanvasTextImage>& aIndexEntries);
+    void SelectPreservedUnusedRenderBufferEntries(RPointerArray<CHuiCanvasRenderBufferImage>& aIndexEntries);
+    
+    void DeleteUnusedImageEntries(RPointerArray<CHuiCanvasGraphicImage>& aIndexEntries);
+    void DeleteUnusedTextEntries(RPointerArray<CHuiCanvasTextImage>& aIndexEntries);
+    void DeleteUnusedRenderBufferEntries(RPointerArray<CHuiCanvasRenderBufferImage>& aIndexEntries);
+    
+    void CalculateGraphicsMemoryUsage();    
+
+    TInt CalculateUnusedCanvasTextureUsageInKbytes();
+    TInt CalculateUnusedCanvasRenderBufferUsageInKbytes();
+
+    TInt CalculateTotalCanvasRenderBufferUsageInKbytes();
+    
+    CHuiCanvasRenderBufferImage* ReUseReleasedRenderBuffer(TSize aSizehint);
+    
+    TBool IsLowMemoryStateEnabled() const;
+    
+private:
+
+    /** Temp entry for doing quick search op */
+    CHuiCanvasTextImage* iSearchedTextImageEntry;
+
+    /** Temp entry for doing quick search op */
+    CHuiCanvasGraphicImage* iSearchedGraphicImageEntry;
+
+    /** Temp entry for doing quick search op */
+    CHuiCanvasRenderBufferImage* iSearchedRenderBufferImageEntry;
+    
+    /** Cached images */
+    RPointerArray<CHuiCanvasGraphicImage> iCachedImages;
+
+    /** Cached texts */
+    RPointerArray<CHuiCanvasTextImage>  iCachedTexts;
+
+    /** Cached render buffers */
+    RPointerArray<CHuiCanvasRenderBufferImage>  iCachedRenderBuffers;
+    
+    /** Flag to tell that there are unused images which should be possibly deleted */
+    TBool iHasReleasedImages;
+
+    /** Flag to tell that there are unused texts which should be possibly deleted */
+    TBool iHasReleasedTexts;
+
+    /** Flag to tell that there are unused render buffers which should be possibly deleted */
+    TBool iHasReleasedRenderBuffers;
+    
+    /** Amount of texture memory reserved for unused texts */
+    TInt iUnusedCanvasTextTextureCacheSizeInKBytes;
+    
+    /** Amount of texture memory reserved for unused images */
+    TInt iUnusedCanvasImageTextureCacheSizeInKBytes;
+
+    /** Amount of texture memory reserved for unused render buffers */
+    TInt iUnusedCanvasRenderBufferCacheSizeInKBytes;
+    
+    /** Total amount of all hui textures are attempted (but not promised) to keep below this limit */
+    TInt iMaxTextureMemoryInKBytes;
+    
+    /** Total amount of all render buffers are attempted (but not promised) to keep below this limit */
+    TInt iMaxRenderBufferMemoryInKBytes;
+
+    /** Texture recycling array */
+    RPointerArray<CHuiTexture> iRecycledTextures;
+
+    /** Rasterizer for texts */
+    CHuiCanvasTextImageRasterizer* iTextImageRasterizer;
+
+    /** Rasterizer for outline texts */
+    CHuiCanvasTextImageRasterizer* iOutLineTextImageRasterizer;
+
+    /** Rasterizer for image */
+    CHuiCanvasGraphicImageRasterizer* iGraphicImageRasterizer;
+
+    /** Rasterizer for combined image */
+    CHuiCanvasCombinedGraphicImageRasterizer* iCombinedGraphicImageRasterizer;
+
+    /** Canvas gc instance for internal use */
+    CHuiCanvasGc* iCanvasGc;
+    
+    /** This controls the amount of cached textures, buffers, etc. */
+    THuiMemoryLevel iMemoryLevel;
+    
+    /** RnD utils */
+    TInt iEglProfiling;
+	
+	TBool iTouchCountCheckEnabled;
+    };
+
+#endif        
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huicanvaswsbitgc.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,70 @@
+/*
+* 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:   Definition of CHuiCanvasWsBitGc.
+*
+*/
+
+
+
+#ifndef __HUICANVASWSBITGC_H__
+#define __HUICANVASWSBITGC_H__
+
+#include <uiacceltk/HuiVisual.h>
+#include "huicanvaswsgc.h"
+#include "huicanvaswsswgc.h"
+#include "huicanvaspainter.h"
+#include <bitstd.h>
+
+const TInt KHuiCanvasWsBitGcRegionGranularity = 10;
+
+/**
+ * This class is used internally by the toolkit and thus should
+ * not be used by the applications directly.
+ */
+NONSHARABLE_CLASS(CHuiCanvasWsBitGc) : public CHuiCanvasWsSwGc
+{
+private:
+    /**
+     * Constructor.
+     */
+    CHuiCanvasWsBitGc();
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+public:
+    /**
+     * Constructor.
+     */
+    static CHuiCanvasWsBitGc* NewL();
+    
+    /**
+     * Destructor.
+     */
+    ~CHuiCanvasWsBitGc();
+
+public:
+
+    // Canvas functionality
+	virtual void BeginActionL(TInt aAction, TRect aDisplayRect,const CHuiCanvasVisual& aUser, TBool aIsCachePrepared, const TRegion& aUpdateRegion);
+	virtual void EndActionL(const TRegion& aUpdateRegion, TBool aUpdateDisplay);
+    virtual THuiCanvasWsGcType Type() const;
+    virtual void ClearCache();
+    
+    virtual TBool IsRenderBufferEnabled() const;
+	
+};    
+#endif  // __HUICANVASWSBITGC_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huicanvaswsgc.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,163 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of MHuiCanvasWsGc.
+*
+*/
+
+
+
+#ifndef __HUICANVASWSGC_H__
+#define __HUICANVASWSGC_H__
+
+
+#include <e32cmn.h>
+#include <e32std.h>
+#include <e32base.h>
+#include <e32def.h>
+#include "huicanvastexturecache.h"
+#include "uiacceltk/HuiCanvasVisual.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiVisual.h"
+#include "uiacceltk/HuiTextMesh.h"
+#include "uiacceltk/HuiCanvasCmdBufferReader.h"
+#include "huicanvasgc.h"
+#include "HuiRenderSurface.h"
+#include "huicanvastexturecache.h"
+#include "huicanvasbackground.h"
+#include <graphics/wsgraphicscontext.h>
+#include <e32cmn.h>
+#include <AknLayoutFont.h>
+
+enum THuiCanvasWsGcType
+    {
+    /** HW accelerated. All window drawing utilizes HW acceleration. */
+    EHuiCanvasWsHw,    
+    /** SW/HW accelerated. Window internal drawing is done with SW, window "composition" with HW */
+    EHuiCanvasWsSw,    
+    /** Not accelerated. Drawing is done to internal bitmaps, use SetCapturingBufferL() to get window content */
+    EHuiCanvasWsBit
+    };
+
+/**
+ * This class is used internally by the toolkit and thus should
+ * not be used by the applications directly.
+ */
+class CHuiCanvasWsGc : public CBase
+    {
+
+public:
+	virtual void WsBitBltL(TInt aBitmapHandle, TPoint aPoint)= 0;
+	virtual void WsBitBltRectL(TInt aBitmapHandle, TPoint aPoint, TRect aRect) = 0;
+	virtual void WsBitBltMaskedL(TInt aBitmapHandle, TInt aMaskHandle, TInt aInvertMask, TPoint aPoint, TRect aRect) = 0;
+	virtual void WsBitBltMaskedPointL(TInt aBitmapHandle, TInt aMaskHandle, TPoint aPoint1, TPoint aPoint2, TRect aRect) = 0;
+	
+	virtual void WsResetClippingRegionL() = 0;
+	virtual void WsClearL()=0;
+	virtual void WsClearRectL(TRect& aRect) =0 ;
+	virtual void WsResetBrushPatternL() = 0;
+	virtual void WsResetFontL() = 0;
+	virtual void WsDrawArcL(TPoint aPoint1, TPoint aPoint2, TRect aRect) = 0;
+	virtual void WsDrawPieL(TPoint aPoint1, TPoint aPoint2, TRect aRect) = 0;
+	virtual void WsDrawBitmap1L(TInt aBitmapHandle, TRect aRect) = 0;
+	virtual void WsDrawBitmap2L(TInt aBitmapHandle, TRect aRect1, TRect aRect2) = 0;
+	virtual void WsDrawBitmap3L(TInt aBitmapHandle, TPoint aPoint) = 0; //XXX_CFbsBitGc_Hack Remove!!!
+	virtual void WsDrawBitmapMaskedL(TInt aBitmapHandle, TInt aMaskHandle, TInt aInvertMask, TRect& aRect1, TRect& aRect2) = 0;
+	virtual void WsDrawRoundRectL(TPoint aPoint, TRect& aRect) = 0;
+	virtual void WsDrawPolyLineL(CArrayFix<TPoint>* aPointerArray) = 0;
+	virtual void WsDrawPolyLineNoEndPointL(TPoint* aPointerArray, TInt aCount)= 0;
+	virtual void WsDrawPolygonL(CArrayFix<TPoint>* aPointerArray, TInt aFillRule ) = 0;
+	virtual void WsDrawEllipseL(TRect& aRect) = 0;
+	virtual void WsDrawLineL(TPoint& aStart, TPoint& aEnd) = 0;
+	virtual void WsDrawLineToL(TPoint& aPoint) = 0;
+	virtual void WsDrawLineByL(TPoint& aPoint) = 0;
+	virtual void WsDrawRectL(TRect& aRect) = 0;
+	virtual void WsDrawText1L(TPtr& aTextValue, THuiCanvasTextParameters& aTextParameters) = 0;
+	virtual void WsDrawText2L(TPtr& aTextValue, TPoint& aPoint,THuiCanvasTextParameters& aTextParameters) = 0;
+	virtual void WsDrawText3L(TPtr& aTextValue, TRect& aRect, THuiCanvasTextParameters& aTextParameters) = 0;
+	virtual void WsDrawText4L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextAlign , TInt aTextMargin ,THuiCanvasTextParameters& aTextParameters) = 0;
+	virtual void WsDrawText5L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextAlign , TInt aTextMargin ,TInt aTextWidth, THuiCanvasTextParameters& aTextParameters) = 0; //XXX_CFbsBitGc_Hack Remove!!!
+	virtual void WsDrawTextVertical1L(TPtr& aTextValue, TInt aTextUp, THuiCanvasTextParameters& aTextParameters)	= 0;
+	virtual void WsDrawTextVertical2L(TPtr& aTextValue, TInt aTextUp,TPoint& aPoint, THuiCanvasTextParameters& aTextParameters) = 0;
+	virtual void WsDrawTextVertical3L(TPtr& aTextValue, TInt aTextUp, TRect& aRect, THuiCanvasTextParameters& aTextParameters) = 0;
+	virtual void WsDrawTextVertical4L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextUp, TInt aTextAlign, TInt aTextMargin, THuiCanvasTextParameters& aTextParameters) = 0;
+	virtual void WsDrawTextVertical5L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextUp, TInt aTextAlign, TInt aTextMargin, TInt aTextWidth, THuiCanvasTextParameters& aTextParameters) = 0;
+	virtual void WsMoveToL(TPoint& aPoint) = 0;
+	virtual void WsMoveByL(TPoint& aPoint) = 0;
+	virtual void WsPlotL(TPoint& aPoint) = 0;
+	virtual void WsResetL() = 0;
+	virtual void WsSetBrushColorL(TRgb aColor) = 0;
+	virtual void WsSetBrushOriginL(TPoint& aPoint) = 0;
+	virtual void WsSetBrushStyleL(TInt aStyle) = 0;
+	virtual void WsSetClippingRegionL(RRegion& aRegion) = 0;
+	virtual void WsSetDrawModeL(TInt aDrawModew) = 0;
+	virtual void WsSetOriginL(TPoint& aOrigin)= 0;
+	virtual void WsSetPenColorL(TRgb aColor) = 0;
+	virtual void WsSetPenStyleL(TInt aStyle) = 0;
+	virtual void WsSetPenSizeL(TInt aWidth, TInt aHeight) = 0;
+	virtual void WsSetTextShadowColorL(TRgb aColor) = 0;
+	virtual void WsSetCharJustificationL(TInt aExcessiveWidth, TInt aNumGap) = 0;
+	virtual void WsSetWordJustificationL(TInt aExcessiveWidth, TInt aNumGap) = 0;
+	virtual void WsSetUnderlineStyleL(TInt aValue) = 0;
+	virtual void WsSetBrushPatternL(TInt aValue) = 0;
+//	virtual void SetBrushPattern(TInt aFbsBitmapHandle) = 0;
+	virtual void WsSetFontL(TInt aFontId) = 0;
+
+	// CFbsBitGc functionality used by Wserv for its internal operations
+	virtual void WsCopyRectL(TPoint& aPoint, TRect& aRect) = 0;
+	virtual void WsCopySettingsL() = 0;
+	virtual void WsUpdateJustificationL(TPtr&  aTextValue) = 0;
+	virtual void WsUpdateJustificationVerticalL(TInt aValue, TPtr& aTextValue) = 0;
+	virtual void WsSetFontNoDuplicateL(TInt aCurrentFont) = 0;
+		
+	virtual void WsSetClippingRectL(TRect& aRect) = 0; 
+	virtual void WsCancelClippingRectL() = 0; 
+	virtual void WsSetFadedL(TInt& aFaded) = 0; 
+	virtual void WsSetFadingParametersL(TInt aFaded1, TInt aFaded2) = 0; 
+	virtual void WsFadeAreaL(RRegion& aRegion) = 0; 
+	virtual void WsMapColorsL() = 0; 
+	virtual void WsSetUserDisplayModeL(TInt aMode) = 0; 
+	virtual void WsUseFontL(TInt aCurrentFont) = 0;
+
+	// Custom gc commands
+    virtual void WsCombinedBitBltMaskedL(TRect aDestinationRect, const RArray<THuiCachedCombinedImageParams>& aBlits) = 0;	 
+
+    // WS painter functionality
+  	virtual void BeginActionL(TInt aAction, TRect aDisplayRect,const CHuiCanvasVisual& aUser, TBool aIsCachePrepared, const TRegion& aUpdateRegion)= 0;
+    virtual void EnableUpdateRegion(const TRegion& aUpdateRegion, TBool aClear)=0;
+    virtual void DisableUpdateRegion() = 0;
+    virtual void EndActionL(const TRegion& aUpdateRegion, TBool aUpdateDisplay)= 0;    
+  	virtual TInt SetCapturingBufferL(CFbsBitmap* aTarget) = 0;
+    virtual CHuiCanvasGc& CanvasGc() const = 0;    
+    virtual void SetPositionDelta( TPoint& aPoint ) = 0;
+    virtual void ClearCache() = 0;
+
+    virtual void SetRelativeOrientation(CHuiGc::TOrientation aOrientation) = 0;
+    
+    virtual TBool IsRenderBufferEnabled() const = 0;
+    virtual TBool IsRenderBufferPrepared() const = 0;
+    virtual TBool IsRenderBufferInitialized() const = 0;
+    
+    virtual TInt EnableRenderbuffer(TBool aEnable = ETrue) = 0;
+    virtual THuiCanvasWsGcType Type() const = 0;
+    
+    	
+    ~CHuiCanvasWsGc(){}         
+    };
+#endif  // __HUICANVASWSGC_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huicanvaswshwgc.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,290 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiCanvasWsHwGc.
+*
+*/
+
+
+
+#ifndef __HUICANVASWSHWGC_H__
+#define __HUICANVASWSHWGC_H__
+
+#include <uiacceltk/HuiVisual.h>
+#include "uiacceltk/HuiTextMesh.h"
+#include "huicanvaswsgc.h"
+#include "huicanvaspainter.h"
+#include "huicanvasrenderbuffer.h"
+
+const TInt KHuiCanvasWsHwGcRegionGranularity = 10;
+
+/**
+ * This class is used internally by the toolkit and thus should
+ * not be used by the applications directly.
+ */
+NONSHARABLE_CLASS(CHuiCanvasWsHwGc) : public CHuiCanvasWsGc
+{
+
+public:
+
+	/**
+     * Constructor.
+     */
+    static CHuiCanvasWsHwGc* NewL();
+    
+    /**
+     * Destructor.
+     */
+    ~CHuiCanvasWsHwGc();
+
+public:
+
+	// CFbsBitGc functionality 
+	virtual void WsBitBltL(TInt aBitmapHandle, TPoint aPoint);
+	virtual void WsBitBltRectL(TInt aBitmapHandle, TPoint aPoint, TRect aRect) ;
+	virtual void WsBitBltMaskedL(TInt aBitmapHandle, TInt aMaskHandle, TInt aInvertMask, TPoint aPoint, TRect aRect) ;
+	virtual void WsBitBltMaskedPointL(TInt aBitmapHandle, TInt aMaskHandle, TPoint aPoint1, TPoint aPoint2, TRect aRect) ;
+	virtual void WsResetClippingRegionL() ;
+	virtual void WsClearL();
+	virtual void WsClearRectL(TRect& aRect) ;
+	virtual void WsResetBrushPatternL() ;
+	virtual void WsResetFontL() ;
+	virtual void WsDrawArcL(TPoint aPoint1, TPoint aPoint2, TRect aRect) ;
+	virtual void WsDrawPieL(TPoint aPoint1, TPoint aPoint2, TRect aRect) ;
+	virtual void WsDrawBitmap1L(TInt aBitmapHandle, TRect aRect) ;
+	virtual void WsDrawBitmap2L(TInt aBitmapHandle, TRect aRect1, TRect aRect2) ;
+	virtual void WsDrawBitmap3L(TInt aBitmapHandle, TPoint aPoint) ; 
+	virtual void WsDrawBitmapMaskedL(TInt aBitmapHandle, TInt aMaskHandle, TInt aInvertMask, TRect& aRect1, TRect& aRect2) ;
+	virtual void WsDrawRoundRectL(TPoint aPoint, TRect& aRect) ;
+	virtual void WsDrawPolyLineL(CArrayFix<TPoint>* aPointerArray) ;
+	virtual void WsDrawPolyLineNoEndPointL(TPoint* aPointerArray, TInt aCount);
+	virtual void WsDrawPolygonL(CArrayFix<TPoint>* aPointerArray, TInt aFillRule ) ;
+	virtual void WsDrawEllipseL(TRect& aRect) ;
+	virtual void WsDrawLineL(TPoint& aStart, TPoint& aEnd) ;
+	virtual void WsDrawLineToL(TPoint& aPoint);
+	virtual void WsDrawLineByL(TPoint& aPoint) ;
+	virtual void WsDrawRectL(TRect& aRect) ;
+	virtual void WsDrawText1L(TPtr& aTextValue, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawText2L(TPtr& aTextValue, TPoint& aPoint,THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawText3L(TPtr& aTextValue, TRect& aRect, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawText4L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextAlign, TInt aTextMargin,THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawText5L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextAlign, TInt aTextMargin,TInt aTextWidth, THuiCanvasTextParameters& aTextParameters) ; 
+	virtual void WsDrawTextVertical1L(TPtr& aTextValue, TInt aTextUp, THuiCanvasTextParameters& aTextParameters)	;
+	virtual void WsDrawTextVertical2L(TPtr& aTextValue, TInt aTextUp,TPoint& aPoint, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawTextVertical3L(TPtr& aTextValue, TInt aTextUp, TRect& aRect, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawTextVertical4L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextUp, TInt aTextAlign, TInt aTextMargin, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawTextVertical5L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextUp, TInt aTextAlign, TInt aTextMargin, TInt aTextWidth, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsMoveToL( TPoint& aPoint) ;
+	virtual void WsMoveByL( TPoint& aPoint) ;
+	virtual void WsPlotL(TPoint& aPoint) ;
+	virtual void WsResetL() ;
+	virtual void WsSetBrushColorL( TRgb aColor) ;
+	virtual void WsSetBrushOriginL( TPoint& aPoint) ;
+	virtual void WsSetBrushStyleL( TInt aStyle) ;
+	virtual void WsSetClippingRegionL( RRegion& aRegion) ;
+	virtual void WsSetDrawModeL( TInt aDrawModew) ;
+	virtual void WsSetOriginL( TPoint& aOrigin);
+	virtual void WsSetPenColorL( TRgb aColor) ;
+	virtual void WsSetPenStyleL( TInt aStyle) ;
+	virtual void WsSetPenSizeL( TInt aWidth, TInt aHeight) ;
+	virtual void WsSetTextShadowColorL( TRgb aColor) ;
+	virtual void WsSetCharJustificationL( TInt aExcessiveWidth, TInt aNumGap) ;
+	virtual void WsSetWordJustificationL( TInt aExcessiveWidth, TInt aNumGap) ;
+	virtual void WsSetUnderlineStyleL( TInt aValue) ;
+	virtual void WsSetBrushPatternL( TInt aValue) ;
+	virtual void WsSetFontL( TInt aFontId) ;
+	virtual void WsCopyRectL( TPoint& aPoint, TRect& aRect) ;
+	virtual void WsCopySettingsL() ;
+	virtual void WsUpdateJustificationL( TPtr& aTextValue) ;
+	virtual void WsUpdateJustificationVerticalL( TInt aValue, TPtr& aTextValue) ;
+	virtual void WsSetFontNoDuplicateL( TInt aCurrentFont) ;		
+	virtual void WsSetClippingRectL( TRect& aRect) ; 
+	virtual void WsCancelClippingRectL() ; 
+	virtual void WsSetFadedL( TInt& aFaded) ; 
+	virtual void WsSetFadingParametersL( TInt aFaded1, TInt aFaded2) ; 
+	virtual void WsFadeAreaL( RRegion& aRegion) ; 
+	virtual void WsMapColorsL() ; 
+	virtual void WsSetUserDisplayModeL( TInt aMode) ; 
+	virtual void WsUseFontL(TInt aCurrentFont) ; 
+
+	// Extended CFbsBitGc functionality     
+    virtual void WsCombinedBitBltMaskedL(TRect aDestinationRect, const RArray<THuiCachedCombinedImageParams>& aBlits);	 
+
+    // Canvas functionality
+    
+	virtual void BeginActionL(TInt aAction, TRect aDisplayRect,const CHuiCanvasVisual& aUser, TBool aIsCachePrepared, const TRegion& aUpdateRegion);
+    virtual void EnableUpdateRegion(const TRegion& aUpdateRegion, TBool aClear);
+    virtual void DisableUpdateRegion();
+    virtual void EndActionL(const TRegion& aUpdateRegion, TBool aUpdateDisplay);
+    virtual TInt SetCapturingBufferL(CFbsBitmap* aTarget);
+    virtual CHuiCanvasGc& CanvasGc() const;  	
+    virtual void SetPositionDelta( TPoint& aPoint );
+    virtual void ClearCache();
+
+    virtual void SetRelativeOrientation(CHuiGc::TOrientation aOrientation);
+    
+    virtual TBool IsRenderBufferEnabled() const;
+    virtual TBool IsRenderBufferPrepared() const;
+    virtual TBool IsRenderBufferInitialized() const;
+    
+    virtual TInt EnableRenderbuffer(TBool aEnable = ETrue);    
+    virtual THuiCanvasWsGcType Type() const;
+
+    void BeginDrawL(TRect aDisplayRect,const CHuiCanvasVisual& aUser, TBool aIsCachePrepared, const TRegion& aUpdateRegion);
+    void EndDrawL(const TRegion& aUpdateRegion, TBool aUpdateDisplay);
+    void BeginScanL(TRect aDisplayRect,const CHuiCanvasVisual& aUser, TBool aIsCachePrepared, const TRegion& aUpdateRegion);
+    void EndScanL(const TRegion& aUpdateRegion, TBool aUpdateDisplay);
+
+public:
+
+	void DoWsClearRectL(const THuiRealRect& aRect );  
+
+private:
+
+    /**
+     * Constructor.
+     */
+    CHuiCanvasWsHwGc();
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+	    
+    THuiCachedGcParams CachedGcParams();
+	
+	void ExpandDirtyRegion(TRect aNewRect);
+	
+    void AdjustCoordinates(TRect& aRect, TBool aUseWsOrigin = ETrue );
+    
+    void AdjustCoordinates(TPoint& aPoint , TBool aUseWsOrigin = ETrue );
+
+    void DrawTextBrush( THuiRealRect& aRect );
+
+    TRect RoundedDisplayRect();
+    
+    TBool IsRenderingEnabled() const;
+    
+    TBool IsRenderBufferUpdateOngoing() const;
+    
+    THuiCanvasDrawMode SelectCanvasDrawMode(TInt aWsDrawMode);
+    
+    void BindRenderBuffer(CHuiCanvasRenderBuffer* aRenderbuffer, const TRegion& aUpdateRegion);
+
+    void UnBindRenderBuffer(CHuiCanvasRenderBuffer* aRenderbuffer);
+    
+    void UseBrushPattern();
+    
+    void DiscardBrushPattern();
+    
+    TBool IsDifferent(const TRgb& aFirst, const TRgb& aSecond, TBool aIgnoreAlpha);
+
+    /**
+	 * UseCanvasState
+	 *
+	 *	Saves canvas state for color, opacity, drawmode, pen width and polygon drawmode            
+	 */
+    void UseCanvasState();
+
+    /**
+	 * UseWsState
+	 *
+	 *	Restores canvas state (stored by the call of  UseCanvasState) for color,
+	 *  opacity, drawmode, pen width and polygon drawmode            
+	 */
+    void UseWsState();
+    
+private:
+  
+ /**
+  * CFbsBitGc attributes
+  */
+  TInt iWsCurrentFont;
+  TPoint iWsPenPosition;
+  TPoint iWsOrigin;
+  TRgb iWsFadeColor;
+  TRgb iWsPenColor;
+  TRgb iWsBrushColor;
+  TInt iWsPenStyle;
+  TInt iWsDrawMode;
+  TInt iWsBrushStyle;
+  TInt iWsShadowMode;
+  TInt iWsStrikethrough;
+  TInt iWsUnderline;
+  TInt iWsUserDisplayMode;
+  TRgb iWsShadowColor;
+  TSize iWsPenSize;
+  TInt iWsBrushPattern;
+  TPoint iWsBrushOrigin;
+  
+ /**
+  * RRegionBuf is used instead of RRegion for better performance.
+  */
+  RRegionBuf<KHuiCanvasWsHwGcRegionGranularity> iWsClipRegion; 
+  RRegionBuf<KHuiCanvasWsHwGcRegionGranularity> iTempRegion;  
+
+ /**
+  * Canvas internal misc attributes
+  */
+  TInt iAction;
+  CHuiCanvasGc* iCanvasGc;
+  CHuiCanvasVisual* iVisual;
+  TBool iAllCommandsSupported;
+  
+ /**
+  * The difference between the original position (when first drawn) of the 
+  * window and the current position after visual position has been changed
+  */
+  TPoint iPosDelta;
+  
+  /**
+   * Render buffer is (or is not) ready to be drawn into display 
+   */
+  TBool iRenderBufferPrepared; 
+
+  /**
+   * Render buffer is (or is not) used when drawing 
+   */
+  TBool iRenderBufferEnabled;
+    
+  /**
+   * Render buffer is (or is not) available when drawing. It may be unavailable for
+   * various reasons, e.g. when memory is low. 
+   */
+  TBool iRenderBufferAvailable;
+  
+  /**
+   * Render buffer is (or is not) initalized. It has just been created, resized or recycled. 
+   */
+  TBool iRenderBufferInitialized;
+  
+  /**
+   * Relative orientation to display orientation. E.g. after layout switch display is in
+   * EOrientationCCW90 but stored old drawing commands have orientation EOrientationNormal. In that
+   * case setting iRelativeOrientation to EOrientationCW90 causes drawing commands to appear
+   * at their original orientation in the physical screen.
+   * 
+   */  
+  CHuiGc::TOrientation iRelativeOrientation;
+  
+  TRgb iOldColor;            
+  TReal32 iOldOpacity;
+  THuiCanvasDrawMode iOldDrawMode;
+  TInt iOldPenWidth;
+  THuiFillMode iOldPolygonDrawMode;
+#ifdef __WINS__
+  TInt iPushCount;
+#endif
+};    
+#endif  // __HUICANVASWSHWGC_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huicanvaswspainter.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,384 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiCanvasWsPainter.
+*
+*/
+
+
+
+#ifndef __HUICANVASWSPAINTER_H__
+#define __HUICANVASWSPAINTER_H__
+
+#include "huicanvaspainter.h"
+#include "uiacceltk/HuiCanvasCmdBufferReader.h"
+
+#include <e32base.h>
+#include <uiacceltk/HuiOwnedPointer.h>
+#include <uiacceltk/HuiVisual.h>    
+#include <uiacceltk/HuiDisplay.h>    
+#include <uiacceltk/huilowmemoryobserver.h>
+#include "huicanvaswshwgc.h"
+
+const TInt KHuiCanvasWsPainterRegionGranularity = 10;
+
+class CHuiCanvasWsSwGc;
+class CHuiCanvasWsHwGc;
+class CAlfCommandDebug;
+class CHuiCanvasWsBitGc;
+
+/**
+ * This class is used internally by the toolkit and thus should
+ * not be used by the applications directly.
+ */
+NONSHARABLE_CLASS(CHuiCanvasWsPainter) : public CHuiCanvasPainter, public MHuiMemoryLevelObserver
+    {    
+public:
+
+	/**
+     * Constructor.
+     */
+    static CHuiCanvasWsPainter* NewL();
+    
+    /**
+     * Destructor.
+     */
+    ~CHuiCanvasWsPainter();
+
+public: // From CHuiCanvasPainter
+
+    /**
+     * Sets buffer that contains canvas drawing commands. This
+     * method clears previous buffer(s), so this is eqvivalent
+     * to calling both ClearCommandSet and AddCommandSetL.
+     *
+     * @param aCommands Commanbuffer
+     */
+    virtual void SetCommandSetL( const TDesC8& aCommands );
+
+    /**
+     * Clears buffer(s) that contains canvas drawing commands. 
+     */
+    virtual void ClearCommandSet();
+
+    /**
+     * Adds buffer that contains more canvas drawing commands,
+     * those will be executed after the buffers that has been
+     * added previously.
+     * @param aMoreCommands Commanbuffer
+     */
+    virtual void AddCommandSetL( const TDesC8& aMoreCommands );
+
+    /**
+     * Adds partial buffer that contains more canvas drawing commands. These
+     * commands are appended to the commands set previously with this method
+     * until param aLastPart has value ETrue. After that whole command set
+     * will be added among possibly already existing command sets and
+     * it will be drawable.
+     * 
+     * @param aMoreCommands Commanbuffer
+     * @param aLastPart EFalse if there are more commands to be added into this
+     * command set before it is wanted to be available for drawing. ETrue if
+     * command set is ready and no more parts are expected.
+     */
+    virtual void AddPartialCommandSetL( const TDesC8& aMoreCommands, TBool aLastPart );
+
+#ifdef HUI_DEBUG_TRACK_DRAWING
+	virtual void SetTrackCommandSet( TFileName& aFileName, TBool aTrack );
+#endif
+	
+    /**
+     * Clears internal cached texts and images.
+     */
+    virtual void ClearCache();
+  
+    /**
+     * Handles the command buffer(s), either draws or performs a scan.
+     *
+     * @param aDisplayRect Area where painter is supposed to draw
+     * @param aAction Action that painter is supposed to do with the buffer.
+     * @param aUser Canvas visual using this painter
+     * @param aGc Toolkit graphics context
+     */
+    virtual void HandleBufferL(TRect& aDisplayRect, TInt aAction, const CHuiCanvasVisual& aUser, CHuiGc* aGc, TPoint aPos ) ;
+    virtual void HandleBufferL(TRect& aDisplayRect, TInt aAction, const CHuiCanvasVisual& aUser, CHuiGc* aGc, TPoint aPos, TPtrC8 aCommands, CHuiCanvasCommandBuffer *buf);
+
+    /**
+     * Returns the number of rectangular areas which contain something that is
+     * drawn by the painter.
+     *
+     * @return number of painted areas.
+     * @see PaintedArea()
+     */
+    virtual TInt PaintedAreaCount() const;
+    
+    /**
+     * Returns information of the painted area at given index. 
+     *
+     * @aIndex Index of the painted area.
+     * @return Painted area info.
+     * @see PaintedAreaCount()
+     */
+    virtual THuiCanvasPaintedArea PaintedArea(TInt aIndex);
+    
+    /**
+     * Draws content of the window in pixel format to the given bitmap. 
+     * This method may not be supported in all commanbuffertype/renderer combinations.
+     *
+     * @param aTargetBuffer where content of the window is to be drawn. NULL if the drawing
+     * is to be stopped.
+     *
+     * @return KErrNotSupported if the current renderer/painter does not support the
+     * feature. Leave happens in other unexpected error situtations. 
+     *         
+     */
+    virtual TInt SetCapturingBufferL(CFbsBitmap* aTarget);
+    
+    /**
+     * Tells painter to enable/disable render buffer (if it is supported by the
+     * painter implementation)
+     *  
+     * @return KErrNotSupported if the current renderer/painter does not support the
+     * feature.     
+     */
+    virtual TInt EnableRenderBuffer(TBool aEnable = ETrue);
+    
+    /**
+     * Returns reference to canvas gc which is used by this painter.
+     */
+    virtual CHuiCanvasGc& CanvasGc() const;
+    CHuiCanvasWsGc *CanvasWsGc() const { return iCanvasWsGc; }
+private:
+
+    /**
+	 * From MHuiMemoryLevelObserver
+	 */
+    void SetMemoryLevel(THuiMemoryLevel aLevel);
+
+    /**
+     * Constructor.
+     */
+    CHuiCanvasWsPainter();
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+    
+private:
+
+    void DoHandleAllBuffersL(TRect& aDisplayRect, TInt aAction, const CHuiCanvasVisual& aUser, CHuiGc* aGc, TPoint& aPos, 
+            TBool aIgnoreUnChangedBuffers, 
+            TBool aIgnoreClippedBuffers, 
+            TBool aIgnoreHandledBuffers,
+            TBool aClearBeforeHandlingBuffers);
+    void DoHandleBufferL(TInt aIndex, TRect& aDisplayRect, TInt aAction, const CHuiCanvasVisual& aUser, CHuiGc* aGc, TPoint& aPos); 
+    void DoHandleBufferStringL(TInt aIndex, TRect& aDisplayRect, TInt aAction, const CHuiCanvasVisual& aUser, CHuiGc* aGc, TPoint& aPos, TPtr8 aCommandBuffer, CHuiCanvasCommandBuffer *aBuffer);
+
+    void DoPeekBufferL(TInt aIndex);     
+    void DoDigestPaddingL();
+
+    TBool RemoveRedundantBuffers();    
+    void RemoveBuffersWithOldDisplayRect();
+    void RemoveBuffersWithEmptyUpdateRegion();
+    void RemoveBuffersWithOverlappingUpdateRegion();        
+    void RemoveBuffersWithoutRealDrawing();
+    void DestroyBuffer(TInt aIndex);
+    void UpdateBufferUpdateRegions(TPoint aPos);
+    
+public:    
+    void EnableRenderBufferIfNeeded(TBool aEnable);
+private:
+    
+    void SelectGcL();
+    CHuiGc::TOrientation CalculateRelativeOrientation();    
+    TRect DirtyRect()const;
+    TBool IsBufferCompletelyOutisideClippingRegion(const CHuiCanvasCommandBuffer& aCommandbuffer) const;
+    void RenewAllBuffers();    
+    
+    void WsSetUpdateRegionL(TInt aIndex);
+    void WsBitBltL() ;
+    void WsBitBltRectL() ;
+    void WsBitBltMaskedL() ;
+    void WsCombinedBitBlitMaskedL();
+    void WsBitBltMaskedPointL() ;
+    void WsResetClippingRegionL() ;
+    void WsClearL() ;
+    void WsClearRectL() ;    
+    void WsResetBrushPatternL() ;
+    void WsResetFontL() ;
+    void WsDrawArcL() ;
+    void WsDrawPieL() ;
+    void WsDrawBitmap1L() ;
+    void WsDrawBitmap2L() ;
+    void WsDrawBitmap3L() ;
+    void WsDrawBitmapMaskedL() ;
+    void WsDrawRoundRectL() ;
+    void WsDrawPolyLineL();
+    void WsDrawPolyLineNoEndPointL() ;
+    void WsDrawPolygonL() ;
+    void WsDrawEllipseL() ;
+    void WsDrawLineL() ;
+    void WsDrawLineToL() ;
+    void WsDrawLineByL() ;
+    void WsDrawRectL() ;
+    void WsDrawText1L() ;
+    void WsDrawText2L() ;
+    void WsDrawText3L() ;
+    void WsDrawText4L() ;
+    void WsDrawText5L() ;
+    void WsDrawTextVertical1L() ;
+    void WsDrawTextVertical2L() ;
+    void WsDrawTextVertical3L() ;
+    void WsDrawTextVertical4L() ;
+    void WsDrawTextVertical5L() ;
+    void WsMoveToL() ;
+    void WsMoveByL() ;
+    void WsPlotL() ;
+    void WsResetL() ;
+    void WsSetBrushColorL() ;
+    void WsSetBrushOriginL() ;
+    void WsSetBrushStyleL() ;
+    void WsSetClippingRegionL() ;
+    void WsSetDrawModeL() ;
+    void WsSetOriginL() ;
+    void WsSetPenColorL() ;
+    void WsSetPenStyleL() ;
+    void WsSetPenSizeL() ;
+    void WsSetTextShadowColorL() ;
+    void WsSetCharJustificationL() ;
+    void WsSetWordJustificationL() ;
+    void WsSetUnderlineStyleL() ;
+    void WsSetStrikethroughStyleL() ;
+    void WsSetBrushPatternL() ;
+    void WsSetFontL() ;
+    void WsContentTagL();
+    void WsCopyRectL() ;
+    void WsUpdateJustificationL() ;
+    void WsUpdateJustificationVerticalL() ;
+    void WsSetFontNoDuplicateL() ;
+    void WsCopySettingsL() ;
+    void WsSetClippingRectL() ;
+    void WsCancelClippingRectL() ;
+    void WsSetFadedL() ;
+    void WsSetFadingParametersL() ;
+    void WsFadeAreaL() ;
+    void WsMapColorsL() ;
+    void WsSetUserDisplayModeL() ;
+    void WsUseFontL() ;
+	void WsSetShapeRegionL( TInt aIndex );
+    
+private:
+    
+    /** Region which this painter updates with current command buffers */
+    RRegionBuf<KHuiCanvasWsPainterRegionGranularity> iFullUpdateRegion;
+	
+    /** Window shape region */
+    RRegionBuf<KHuiCanvasCommandBufferRegionGranularity> iShapeRegion;
+    
+    /** Command buffer reader instance */
+    CHuiCanvasCmdBufferReader* iWsCommandBufferReader;    
+ 
+    /** Pointer to active canvaswsgc instance */
+    CHuiCanvasWsGc *iCanvasWsGc;
+    
+    /** Fully bitgdi based version of canvaswsgc */
+    CHuiCanvasWsBitGc *iCanvasWsBitGc;
+
+    /** Partially SW/HW based version of canvaswsgc */
+    CHuiCanvasWsSwGc *iCanvasWsSwGc;
+    
+    /** Fully HW accelerated canvaswsgc */
+    CHuiCanvasWsHwGc *iCanvasWsHwGc;
+
+    /** Flag to tell whether cache has been cleared */
+    TBool iCacheCleared;
+    
+    /** Use of render buffer has been disabled/enabled automatically */
+    TBool iAutomaticRenderBufferUsage;
+    
+    /** Flags to tell whether the window shape region has been changed  */
+    TBool iShapeRegionClearingPending;
+    TBool iShapeRegionClippingPending;
+    
+	#ifdef __ALF_SYMBIAN_RWINDOW_CLEARING_BUG_WORKAROUND__
+    TRgb iTestBrushColor;
+    TRect iTestFullDisplayRect;
+    #endif
+	
+	// Stream read optimizations
+    struct TStructBitBlitRect
+        {
+        TPoint iPoint;
+        TInt iBitmapHandle;
+        TRect iRect;
+        };
+
+    struct TStructBitBlitMasked
+        {
+        TPoint iPoint;
+        TInt iBitmapHandle;
+        TRect iRect;
+        TInt iMaskHandle;
+        TInt iInvertMask;
+        };
+
+    struct TStructDrawBitmapMasked
+        {
+        TRect iRect1;
+        TInt iBitmapHandle;
+        TRect iRect2;
+        TInt iMaskHandle;
+        TInt iInvertMask;
+        };
+    
+    struct TStructDrawTextGeneral
+        {
+        TRect iRect;
+        TInt iValue1;
+        TInt iValue2;
+        TInt iValue3;
+        TInt iValue4;
+        
+        };
+    
+    class TBlitStruct
+        {
+    public:
+        TBlitStruct( TInt aHandle, TInt aMaskHandle, TPoint aTl ) : iHandle( aHandle ), iMaskHandle( aMaskHandle ), iTl( aTl ){};
+        TInt iHandle;
+        TInt iMaskHandle;
+        TPoint iTl;
+        };
+    
+	TStructBitBlitMasked    iStructBitBlitMasked;
+    
+	TStructBitBlitRect      iStructBitBlitRect;
+    
+	TStructDrawBitmapMasked iStructDrawBitmapMasked;
+    
+	TStructDrawTextGeneral  iStructDrawTextGeneral;
+	
+	THuiCanvasTextParameters iTextParametersGeneral;
+  
+    /** Private temp region for general purpose, used to avoid excessive allocations of RRegion heap objects */
+    mutable RRegionBuf<KHuiCanvasWsPainterRegionGranularity> iTempRegion;
+    mutable RRegionBuf<KHuiCanvasWsPainterRegionGranularity> iTempCurrentSubRegion;
+    mutable RRegionBuf<KHuiCanvasWsPainterRegionGranularity> iTempIntersectingRegion;
+
+#ifdef HUI_DEBUG_TRACK_DRAWING
+    CAlfCommandDebug* iCommandDebugger;
+#endif
+  };
+    
+#endif  // __HUICANVASWSPAINTER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huicanvaswsswgc.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,223 @@
+/*
+* 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:   Definition of CHuiCanvasWsSwGc.
+*
+*/
+
+
+
+#ifndef __HUICANVASWSSWGC_H__
+#define __HUICANVASWSSWGC_H__
+
+#include <uiacceltk/HuiVisual.h>
+#include "huicanvaswsgc.h"
+#include "huicanvaspainter.h"
+#include <bitstd.h>
+
+const TInt KHuiCanvasWsSwGcRegionGranularity = 10;
+
+/**
+ * This class is used internally by the toolkit and thus should
+ * not be used by the applications directly.
+ */
+NONSHARABLE_CLASS(CHuiCanvasWsSwGc) : public CHuiCanvasWsGc
+{
+
+protected:
+    /**
+     * Constructor.
+     */
+    CHuiCanvasWsSwGc();
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+public:
+		/**
+     * Constructor.
+     */
+    static CHuiCanvasWsSwGc* NewL();
+    
+    /**
+     * Destructor.
+     */
+    ~CHuiCanvasWsSwGc();
+
+public:
+
+    // CFbsBitGc functionality 
+	virtual void WsBitBltL(TInt aBitmapHandle, TPoint aPoint);
+	virtual void WsBitBltRectL(TInt aBitmapHandle, TPoint aPoint, TRect aRect) ;
+	virtual void WsBitBltMaskedL(TInt aBitmapHandle, TInt aMaskHandle, TInt aInvertMask, TPoint aPoint, TRect aRect) ;
+	virtual void WsBitBltMaskedPointL(TInt aBitmapHandle, TInt aMaskHandle, TPoint aPoint1, TPoint aPoint2, TRect aRect) ;
+	virtual void WsResetClippingRegionL() ;
+	virtual void WsClearL();
+	virtual void WsClearRectL(TRect& aRect) ;
+	virtual void WsResetBrushPatternL() ;
+	virtual void WsResetFontL() ;
+	virtual void WsDrawArcL(TPoint aPoint1, TPoint aPoint2, TRect aRect) ;
+	virtual void WsDrawPieL(TPoint aPoint1, TPoint aPoint2, TRect aRect) ;
+	virtual void WsDrawBitmap1L(TInt aBitmapHandle, TRect aRect) ;
+	virtual void WsDrawBitmap2L(TInt aBitmapHandle, TRect aRect1, TRect aRect2) ;
+	virtual void WsDrawBitmap3L(TInt aBitmapHandle, TPoint aPoint) ; 
+	virtual void WsDrawBitmapMaskedL(TInt aBitmapHandle, TInt aMaskHandle, TInt aInvertMask, TRect& aRect1, TRect& aRect2) ;
+	virtual void WsDrawRoundRectL(TPoint aPoint, TRect& aRect) ;
+	virtual void WsDrawPolyLineL(CArrayFix<TPoint>* aPointerArray) ;
+	virtual void WsDrawPolyLineNoEndPointL(TPoint* aPointerArray, TInt aCount);
+	virtual void WsDrawPolygonL(CArrayFix<TPoint>* aPointerArray, TInt aFillRule ) ;
+	virtual void WsDrawEllipseL(TRect& aRect) ;
+	virtual void WsDrawLineL(TPoint& aStart, TPoint& aEnd) ;
+	virtual void WsDrawLineToL(TPoint& aPoint);
+	virtual void WsDrawLineByL(TPoint& aPoint) ;
+	virtual void WsDrawRectL(TRect& aRect) ;
+	virtual void WsDrawText1L(TPtr& aTextValue, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawText2L(TPtr& aTextValue, TPoint& aPoint,THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawText3L(TPtr& aTextValue, TRect& aRect, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawText4L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextAlign, TInt aTextMargin,THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawText5L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextAlign, TInt aTextMargin,TInt aTextWidth, THuiCanvasTextParameters& aTextParameters) ; 
+	virtual void WsDrawTextVertical1L(TPtr& aTextValue, TInt aTextUp, THuiCanvasTextParameters& aTextParameters)	;
+	virtual void WsDrawTextVertical2L(TPtr& aTextValue, TInt aTextUp,TPoint& aPoint, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawTextVertical3L(TPtr& aTextValue, TInt aTextUp, TRect& aRect, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawTextVertical4L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextUp, TInt aTextAlign, TInt aTextMargin, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsDrawTextVertical5L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextUp, TInt aTextAlign, TInt aTextMargin, TInt aTextWidth, THuiCanvasTextParameters& aTextParameters) ;
+	virtual void WsMoveToL( TPoint& aPoint) ;
+	virtual void WsMoveByL( TPoint& aPoint) ;
+	virtual void WsPlotL(TPoint& aPoint) ;
+	virtual void WsResetL() ;
+	virtual void WsSetBrushColorL( TRgb aColor) ;
+	virtual void WsSetBrushOriginL( TPoint& aPoint) ;
+	virtual void WsSetBrushStyleL( TInt aStyle) ;
+	virtual void WsSetClippingRegionL( RRegion& aRegion) ;
+	virtual void WsSetDrawModeL( TInt aDrawModew) ;
+	virtual void WsSetOriginL( TPoint& aOrigin);
+	virtual void WsSetPenColorL( TRgb aColor) ;
+	virtual void WsSetPenStyleL( TInt aStyle) ;
+	virtual void WsSetPenSizeL( TInt aWidth, TInt aHeight) ;
+	virtual void WsSetTextShadowColorL( TRgb aColor) ;
+	virtual void WsSetCharJustificationL( TInt aExcessiveWidth, TInt aNumGap) ;
+	virtual void WsSetWordJustificationL( TInt aExcessiveWidth, TInt aNumGap) ;
+	virtual void WsSetUnderlineStyleL( TInt aValue) ;
+	virtual void WsSetBrushPatternL( TInt aValue) ;
+	virtual void WsSetFontL( TInt aFontId) ;
+	virtual void WsCopyRectL( TPoint& aPoint, TRect& aRect) ;
+	virtual void WsCopySettingsL() ;
+	virtual void WsUpdateJustificationL( TPtr& aTextValue) ;
+	virtual void WsUpdateJustificationVerticalL( TInt aValue, TPtr&  aTextValue) ;
+	virtual void WsSetFontNoDuplicateL( TInt aCurrentFont) ;
+	virtual void WsSetClippingRectL( TRect& aRect) ; 
+	virtual void WsCancelClippingRectL() ; 
+	virtual void WsSetFadedL( TInt& aFaded) ; 
+	virtual void WsSetFadingParametersL( TInt aFaded1, TInt aFaded2) ; 
+	virtual void WsFadeAreaL( RRegion& aRegion) ; 
+	virtual void WsMapColorsL() ; 
+	virtual void WsSetUserDisplayModeL( TInt aMode) ; 
+	virtual void WsUseFontL(TInt aCurrentFont) ; 
+
+	// Extended CFbsBitGc functionality
+	virtual void WsCombinedBitBltMaskedL(TRect aDestinationRect, const RArray<THuiCachedCombinedImageParams>& aBlits);
+
+    // Canvas functionality
+	virtual void BeginActionL(TInt aAction, TRect aDisplayRect,const CHuiCanvasVisual& aUser, TBool aIsCachePrepared, const TRegion& aUpdateRegion);
+    virtual void EnableUpdateRegion(const TRegion& aUpdateRegion, TBool aClear);
+    virtual void DisableUpdateRegion();
+	virtual void EndActionL(const TRegion& aUpdateRegion, TBool aUpdateDisplay);
+    virtual TInt SetCapturingBufferL(CFbsBitmap* aTarget);
+  	virtual CHuiCanvasGc& CanvasGc() const;	
+	virtual void SetPositionDelta( TPoint& aPoint );
+    virtual void ClearCache();
+
+    virtual void SetRelativeOrientation(CHuiGc::TOrientation aOrientation);
+    
+    virtual TBool IsRenderBufferEnabled() const;
+    virtual TBool IsRenderBufferPrepared() const;    
+    virtual TBool IsRenderBufferInitialized() const;
+
+    virtual TInt EnableRenderbuffer(TBool aEnable = ETrue);
+    virtual THuiCanvasWsGcType Type() const;
+
+protected:
+    
+    void DoBeginDrawL(TBool aIsCachePrepared);
+    void DoEndDrawL();
+    TPoint AdjustCoordinates(TPoint aPoint);
+    TRect AdjustCoordinates(TRect aRect);	
+	TDisplayMode SelectDisplayMode();	
+	TRect RoundedDisplayRect() const;
+    CFbsBitmap* CreateMovedMaskL(CFbsBitmap& aOriginalMask, TPoint aNewTopLeftCorner);
+    TBool IsRenderingEnabled() const;
+	
+
+    /**
+     * Drawing related data
+     */
+    TRect iWsClipRect;
+    TPoint iWsOrigin; 
+  
+    /**
+     * The difference between the original position (when first drawn) of the 
+     * window and the current position after visual position has been changed
+     */
+    TPoint iPosDelta;
+    
+    /**
+     * Currently ongiong action, scan or draw.
+     */ 
+    TInt iAction;
+
+    /**
+     * Flag to tell wheter something really has been drawn into this gc
+     */
+    TBool iIsReallyDirty;
+  
+    /**
+     * Backbuffer
+     */
+    CFbsBitGc* iBitGc;
+    CFbsBitmap* iBitBitmap;
+    CFbsBitmapDevice* iBitDevice;
+  
+    /**
+     * Buffer for capturing window drawing into bitmap
+     */
+    CFbsBitGc* iCapturingBitGc;
+    CFbsBitmap* iCapturingBitBitmap;
+    CFbsBitmapDevice* iCapturingBitDevice;
+  
+    /**
+     * Canvas related
+     */
+    CHuiCanvasGc* iCanvasGc;
+    const CHuiCanvasVisual* iVisual;
+
+    /**
+     * RRegionBuf is used instead of RRegion for better performance.
+     */
+    RRegionBuf<KHuiCanvasWsSwGcRegionGranularity> iWsClipRegion; 
+    RRegionBuf<KHuiCanvasWsSwGcRegionGranularity> iTempRegion;  
+    RRegionBuf<KHuiCanvasWsSwGcRegionGranularity> iDefaultClipRegion;
+
+    /**
+     * ETrue if cache is prepared, EFalse otherwise.
+     */    
+    TBool iBitmapPrepared; 
+    
+    /**
+     * ETrue if cache is initialized, EFalse otherwise.
+     */
+    TBool iBitmapInitialized;
+
+};    
+#endif  // __HUICANVASWSSWGC_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huicurvepathprivdata.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* 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: 
+*
+*/
+
+
+#ifndef __HUICURVEPATHPRIVATEDATA__
+#define __HUICURVEPATHPRIVATEDATA__
+
+#include "uiacceltk/HuiVisual.h"
+
+NONSHARABLE_STRUCT(THuiCurvePathExtension)
+    {
+    public:
+    TBool iLooped;
+    TBool iLegacyAPIUsed;
+    CHuiVisual* iVisual;
+    };
+
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huieffectable.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIEFFECTABLE_H_
+#define HUIEFFECTABLE_H_
+
+class THuiRealRect;
+class CHuiFxEffect;
+class CHuiGc;
+
+class MHuiEffectable
+    {
+public:
+    virtual ~MHuiEffectable() { }
+    virtual void EffectSetEffect(CHuiFxEffect* aEffect)=0;
+    virtual TReal32 EffectOpacityTarget() const=0;
+    virtual void EffectSetOpacity(TReal32 aOpacity)=0;
+    virtual void EffectDrawSelf( CHuiGc &aGc, const TRect & aDisplayRect) const=0;
+    virtual THuiRealRect EffectDisplayRect() const __SOFTFP=0;
+    virtual void SetLoadingEffect(TBool aLoading)=0;
+    virtual void EffectSetSource( TBool aIsInput1 )=0;
+    virtual TBool EffectGetSource() const=0;
+    };
+    
+#endif    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huilayoutdata.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,79 @@
+/*
+* 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:   Definition of THuiLayoutPrivateData.
+*
+*/
+
+#ifndef HUILAYOUTDATA_H_
+#define HUILAYOUTDATA_H_
+
+// Private structure
+//
+/**
+ * TScrollState contains information about the scrolling state of the
+ * layout. This is only used when scrolling is enabled. Most layouts
+ * don't use this.
+ */
+class TScrollState
+    {
+public:
+    TScrollState() : iOffset(), iVirtualSize(0, 0) {}
+    THuiTimedPoint iOffset;
+
+    /** Size of the layout considering the placement of children and outer
+        borders. This may be larger than the size of the layout on the
+        screen. Used when scrolling. */
+    TSize iVirtualSize;
+    };
+
+struct CHuiLayout::THuiLayoutPrivateData
+    {
+public:
+    THuiLayoutPrivateData() : 
+        iInnerPadding(0, 0),
+            iScroll(NULL),
+            iTransitionTime(0),
+            iBaseUnit(THuiMetric(), THuiMetric()) // defaults to [1px, 1px]
+    {    
+        }
+    
+public:
+    /** Visuals that are children of the layout. None of these is owned by
+        by the layout. */
+    RPointerArray<CHuiVisual> iChildren;
+
+    /** Inner horizontal padding. */
+    //TInt16 iXPadding;
+
+    /** Inner vertical padding. */
+    //TInt16 iYPadding;
+    
+    /** Inner paddings (horizontal and vertical). */
+    THuiXYMetric iInnerPadding;
+
+    /** State of scrolling. */
+    TScrollState* iScroll;
+
+    /** Used to store the local transition time */
+    TInt iTransitionTime;
+
+    /** Metric for the layout's base measurement unit. The positions and sizes
+        of the children of this layout are interpreted as multiples of this
+        base unit. */
+    THuiXYMetric iBaseUnit;
+    CHuiCanvasGc *iGc;
+    };
+
+
+#endif /* HUILAYOUTDATA_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huilongtapdetector.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class which detects the long pointer press.
+*
+*/
+
+
+
+#ifndef C_HUILONGTAPDETECTOR_H
+#define C_HUILONGTAPDETECTOR_H
+
+#include <e32base.h>
+#include "uiacceltk/HuiEvent.h"
+
+class CHuiRoster;
+
+/**
+ *  This class is responsible of timing the long tap event and
+ *  generating it back to the roster.
+ *
+ *  @code
+ *   ?good_class_usage_example(s)
+ *  @endcode
+ *
+ *  @lib hitchcock.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CHuiLongTapDetector ): public CTimer
+    {
+
+public:
+
+    /**
+     * Two-phased constructor.
+     * @param ?arg1 ?description
+     * @param ?arg2 ?description
+     */
+    static CHuiLongTapDetector* NewL(CHuiRoster& aRoster);
+    
+
+    /**
+    * Destructor.
+    */
+    virtual ~CHuiLongTapDetector();
+
+    /**
+     * ?description
+     *
+     * @since S60 ?S60_version
+     * @param ?arg1 ?description
+     * @param ?arg2 ?description
+     * @return ?description
+     */
+    void OfferPointerEvent( const THuiEvent& aEvent );
+
+
+private:
+
+    CHuiLongTapDetector(CHuiRoster& aRoster);
+
+    void ConstructL();
+    
+    // from base class CActive
+    
+    void RunL();
+    
+    TInt RunError( TInt aError );
+
+private: // data
+
+    /**
+     * ?description_of_member
+     */
+    CHuiRoster& iRoster;
+    THuiEvent iPreviousPointerEvent;
+    };
+
+
+#endif // C_HUILONGTAPDETECTOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huiskinbackroundlayout.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines CHuiDisplay, a drawing buffer into which a the toolkit 
+*                contents (visuals) are drawn.
+*
+*/
+
+
+#ifndef __HUISKINBACKGROUNDLAYOUT_H__
+#define __HUISKINBACKGROUNDLAYOUT_H__
+
+#include <AknsConstants.h>
+#include <aknlayout.cdl.h>
+#include <skinlayout.cdl.h>
+#include <aknlayoutscalable_avkon.cdl.h>
+#include "layoutmetadata.cdl.h"
+
+
+
+TAknsItemID GetParent( const TAknsItemID& aIID );
+TBool GetItemLayout( const TAknsItemID& aIID, const TRect& aParentRect, TRect& aRect  );
+IMPORT_C void GetRectForItem(const TAknsItemID& aID, TRect& aParentRect, TRect& aOutRect);
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huistatictlsdata.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,213 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Declares the private data stored to the thread local storage
+*                by CHuiStatic.
+*
+*/
+
+
+
+#ifndef __HUISTATICTLSDATA_H__
+#define __HUISTATICTLSDATA_H__
+
+
+LOCAL_D const TInt KMaxClocks = 10;
+
+
+class TFakeProbe;
+class CAppFwProxy;
+/**
+ * Thread local storage space. Writable static data is not supported in
+ * Symbian, so static data is stored in this struct.
+ */
+
+extern void CleanupWg(TAny* aWg);
+
+NONSHARABLE_STRUCT(TTlsData)
+    {
+    CHuiRenderPlugin* iRenderer;
+
+    /** The render surface that has been made current. */
+    MHuiRenderSurface* iCurrentRenderSurface;
+
+    /** Primary environment. */
+    CHuiEnv* iPrimaryEnv;
+
+    /** Realtime clock. */
+    TTime iRealUniversalTime;
+
+    /** Internal absolute clock. */
+    TTime iUniversalTime;
+
+    /** Flags that tells if this the first time update is done. */
+    TBool iIsFirstUpdateTime;
+
+    /** Time of the first invocation of UpdateTime. */
+    TTime iFirstUpdateTime;
+
+    /** Microseconds elapsed in the internal absolute clock since the last
+        UpdateTime(). */
+    TInt64 iInternalElapsed;
+    
+    /** Microseconds elapsed from previous update time until pause was called. */
+    TInt64 iInternalElapsedBeforePausing;
+
+    /** Time pause flag. */
+    TBool iTimePaused;
+
+    /** Time factor. */
+    TReal32 iTimeFactor;
+
+    /** Counter for unique identifier numbers. */
+    TInt iIdCounter;
+
+    /** Frame counter since application started. */
+    TUint iFrameCounter;
+    
+    /** Frames counted since FPS was last calculated. */
+    TUint iCurrentFrameCounter;
+
+    /** Time when the first frame was shown. */
+    //TTime iFirstFrameTime;
+
+    //TTime iPreviousFrameTime;
+
+    /** Time when the current frame rate was last calculated. */
+    TTime iLastFpsTime;
+
+    /** The last recorded FPS. */
+    TReal32 iLastFps;
+
+    /** Message logger. */
+    RFile iLogFile;
+    TBool iLogEnabled;
+
+    /** A list of clocks used for timing events.*/
+    TTime iClocks[KMaxClocks];
+
+    /** How long it takes, in milliseconds, for a layout transition to complete. */
+    TInt iLayoutTransitionTime;
+    
+    MHuiProbe* iProbe;
+    TFakeProbe* iFakeProbe;
+
+    // Shared 
+    RWsSession* iWsSession;
+    RPointerArray<RWindowGroup> iWindowGroups;
+    RPointerArray<CWsScreenDevice> iScreenDevices;    
+    RFs* iFs;
+    
+    CAppFwProxy* iAppFwProxy;
+   
+    CWsScreenDevice* WsScreenDevice(TInt aScreenNumber)
+        {
+        if (aScreenNumber < iScreenDevices.Count())
+            {
+            return iScreenDevices[aScreenNumber];
+            }
+        return 0;
+        }       
+    
+    RWindowGroup* RootWin(TInt aScreenNumber)
+        {
+        if (aScreenNumber < iWindowGroups.Count())
+            {
+            return iWindowGroups[aScreenNumber];
+            }
+        return 0;
+        }       
+      
+    TTlsData():
+        iRenderer(0),iCurrentRenderSurface(0),iPrimaryEnv(0),iIsFirstUpdateTime(0),
+        iInternalElapsed(0),iInternalElapsedBeforePausing(0),iTimePaused(0),iTimeFactor(0),
+        iIdCounter(0),iFrameCounter(0),iCurrentFrameCounter(0),iLastFps(0),iLogEnabled(0),
+        iLayoutTransitionTime(0),iProbe(0),iFakeProbe(0),iWsSession(0),iFs(0),iAppFwProxy(0)
+        {  
+        }
+                
+     void DoInitL()
+        {
+        CCoeEnv* coe = CCoeEnv::Static();
+        if (coe)
+            {
+            iWsSession = &coe->WsSession();
+            iFs = &coe->FsSession();
+            iScreenDevices.Append(coe->ScreenDevice()); // Todo: Multiple display support    
+            iWindowGroups.Append(&coe->RootWin()); // Todo: Multiple display support    
+            return;
+            }
+            
+        if(!RFbsSession::GetSession())  
+            {
+            User::LeaveIfError(RFbsSession::Connect());
+            }
+
+        iFs = new (ELeave) RFs;
+        User::LeaveIfError(iFs->Connect());    
+        
+        iWsSession = new (ELeave) RWsSession;
+        User::LeaveIfError(iWsSession->Connect());    
+        
+        CWsScreenDevice* screenDevice =new(ELeave) CWsScreenDevice(*iWsSession);
+        CleanupStack::PushL(screenDevice); 
+        User::LeaveIfError(screenDevice->Construct(0)); // For main display only
+        User::LeaveIfError(iScreenDevices.Append(screenDevice));
+        CleanupStack::Pop();
+        
+        RWindowGroup* windowGroup = new(ELeave) RWindowGroup(*iWsSession);
+        CleanupStack::PushL(TCleanupItem(CleanupWg, (TAny*)windowGroup)); 
+        User::LeaveIfError(windowGroup->Construct((TUint32)screenDevice, EFalse,screenDevice));                   
+        CleanupClosePushL(*windowGroup);
+        User::LeaveIfError(iWindowGroups.Append(windowGroup));
+        CleanupStack::Pop(2);
+        }
+
+    void Disconnect()
+        {
+        if (CCoeEnv::Static())
+            {
+            iWindowGroups.Close();
+            iScreenDevices.Close();
+            return;
+            }
+        
+        for(;iWindowGroups.Count();)
+            {    
+            iWindowGroups[0]->Close();
+            delete iWindowGroups[0];
+            iWindowGroups.Remove(0);
+            }
+            
+        for(;iScreenDevices.Count();)
+            {
+            delete iScreenDevices[0];
+            iScreenDevices.Remove(0);
+            }
+        
+        if (iWsSession)
+            iWsSession->Close();        
+        delete iWsSession;
+        iWsSession = 0;
+        
+        if (iFs)
+            iFs->Close();        
+        delete iFs;
+        iFs = 0;
+
+        RFbsSession::Disconnect();
+        }
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/huitextureanimationstate.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,256 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines CHuiTextureAnimationState, which is used by
+*                CHuiTextureManager when loading animated textures.
+*
+*/
+
+
+#ifndef C_HUITEXTUREANIMATIONSTATE_H
+#define C_HUITEXTUREANIMATIONSTATE_H
+
+#include <e32base.h>
+#include <gdi.h>
+#include <imageconversion.h>
+
+class CFbsBitmap;
+
+/**
+ * This holds animation state. One instance is required per animation.
+ * To produce next frame, you have to have animation state containing
+ * previous frame information. Thus, if animation state is needed, 
+ * you should load frames in sequence (0, 1, ..., N).
+ */
+NONSHARABLE_CLASS( CHuiTextureAnimationState ) : public CBase
+    {
+public:
+    /**
+     * Two-phased constructor.
+     * @param aTextureGroupId texture group id.
+     * @param aImageFile image file.
+     * @param aFrameCount amount of frames in file.
+     */
+    static CHuiTextureAnimationState* NewL( 
+        TInt aTextureGroupId, const TDesC& aImageFile, TInt aFrameCount );
+        
+    /**
+     * Destructor.
+     */
+    ~CHuiTextureAnimationState();
+   
+    /**
+     * Returns owner texture group id.
+     * @return texture group id.
+     */
+    TInt OwnerTextureGroupId() const;
+    
+    /** 
+     * Checks if frame defined by aImageFile and aFrameNumber can be
+     * composed with this state instance.
+     * @param aImageFile image file name.
+     * @param aFrameNumber frame number.
+     * @param aFrameCount amount of frames in the file.
+     */
+    TBool CheckIfCanProduce( 
+        const TDesC& aImageFile, 
+        TInt aFrameNumber, 
+        TInt aFrameCount ) const;
+
+    /**
+     * Gets next frame number.
+     * @return next frame number.
+     */
+    TInt GetNextFrameNumber() const;
+    
+    /**
+     * Offers next frame information. This method will store
+     * information in order to be able to produce next frame
+     * in @c ProduceNextFrameL.
+     * @param aFrameInfo frame info.
+     */
+    void OfferNextFrameInfo( const TFrameInfo& aFrameInfo );
+    
+    /**
+     * Returns overall size.
+     */
+    TSize OverallSize() const;
+
+    /**
+     * Produces next frame.
+     * @param aNewFrame new frame.
+     * @param aNewFrameMask new frame mask.
+     * @param aSubFrame sub frame.
+     * @param aSubFrameMask sub frame mask.
+     */
+    void ProduceNextFrameL(
+        CFbsBitmap*& aNewFrame,
+        CFbsBitmap*& aNewFrameMask,
+        CFbsBitmap* aSubFrame,
+        CFbsBitmap* aSubFrameMask );
+        
+    /** 
+     * Proceed without generating next frame.
+     * @param aSubFrame sub frame.
+     * @param aSubFrameMask sub frame mask.
+     */
+    void ProceedWithoutNextFrameL(
+        CFbsBitmap* aSubFrame,
+        CFbsBitmap* aSubFrameMask );
+        
+private:
+    CHuiTextureAnimationState();
+    void ConstructL( 
+        TInt aTextureGroupId, const TDesC& aImageFile, 
+        TInt aFrameCount );
+   
+    /**
+     * Produces first frame and generates previous.
+     */
+    void ProduceFirstFrameAndGeneratePreviousL(
+        CFbsBitmap*& aNewFrame,
+        CFbsBitmap*& aNewFrameMask,
+        CFbsBitmap* aSubFrame,
+        CFbsBitmap* aSubFrameMask );
+
+    /**
+     * Produces next frame and updates previous.
+     */
+    void ProduceNextFrameAndUpdatePreviousL(
+        CFbsBitmap*& aNewFrame,
+        CFbsBitmap*& aNewFrameMask,
+        CFbsBitmap* aSubFrame,
+        CFbsBitmap* aSubFrameMask );
+
+    /**
+     * Produces first frame and generates previous. Quick
+     * version assumes that mask contains only values 0 and 255.
+     */
+    void QuickProduceFirstFrameAndGeneratePreviousL(
+        CFbsBitmap*& aNewFrame,
+        CFbsBitmap*& aNewFrameMask,
+        CFbsBitmap* aSubFrame,
+        CFbsBitmap* aSubFrameMask );
+
+    /**
+     * Produces next frame and updates previous. Quick
+     * version assumes that mask contains only values 0 and 255.
+     */
+    void QuickProduceNextFrameAndUpdatePreviousL(
+        CFbsBitmap*& aNewFrame,
+        CFbsBitmap*& aNewFrameMask,
+        CFbsBitmap* aSubFrame,
+        CFbsBitmap* aSubFrameMask );
+
+    inline static TRgb BitmapClearColor();
+    inline static TRgb MaskClearColor();
+    inline static TRgb MaskOpaqueColor();
+    
+    /**
+     * Checks sub frame and its mask for validity.
+     * Leaves if invalid.
+     */
+    static void CheckSubFrameL( 
+        CFbsBitmap* aSubFrame, 
+        CFbsBitmap* aSubFrameMask );
+    
+private:
+    //
+    // Information about current animation
+    //
+    
+    /**
+     * Group id.
+     */
+    TInt iTextureGroupId;
+    
+    /**
+     * File name.
+     * Own.
+     */
+    HBufC* iFile;
+    
+    /**
+     * Frame number. -1 if no frame yet produced.
+     */
+    TInt iFrame;
+
+    /**
+     * Frame count. Should be greater than one.
+     */
+    TInt iFrameCount;
+        
+    /**
+     * Size of frames.
+     */
+    TSize iSize;
+
+    //
+    // Information about next frame
+    //
+    
+    /**
+     * Sub frame rectangle.
+     * Updated in OfferNextFrameInfo.
+     */
+    TRect iNextSubFrameRect;
+    
+    /**
+     * Background color.
+     * Updated in OfferNextFrameInfo.
+     */
+    TRgb iNextSubFrameBgColor;
+
+    /**
+     * Boolean value indicating if complex blending is needed,
+     * i.e. subframe has alpha channel (instead of just on/off transparency).
+     * Updated in OfferNextFrameInfo.
+     */
+    TBool iNextSubFrameHasAlpha;
+
+    /**
+     * Enumeration for disposal actions
+     */
+    enum TDisposalAction
+        {
+        EUnspecified,
+        ERestoreToPrevious,
+        ERestoreToBackgroundColour,
+        ELeaveInPlace
+        };
+        
+    /**
+     * Disposal action for next frame.
+     * Updated in OfferNextFrameInfo.
+     */
+    TDisposalAction iNextSubFrameDisposalAction;
+                
+    //
+    // Previous frame information
+    //
+    
+    /**
+     * Previous frame.
+     * Own.
+     */
+    CFbsBitmap* iPrevFrame;
+    
+    /**
+     * Previous frame mask.
+     * Own.
+     */
+    CFbsBitmap* iPrevFrameMask;    
+    };
+
+#endif // C_HUITEXTUREANIMATIONSTATE_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/hwatranseffect.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __HWATRANSEFFECT__
+#define __HWATRANSEFFECT__
+
+#include <e32std.h>
+#include <cone.h>
+#include <alf/alfvisual.h>
+
+class HwaTransEffect
+    {
+public:
+
+enum EFxGuiLibrary{
+   EGuiNone,  // No connection to wserv   
+   EGuiAvkon, // WServ, Cone & Avkon assumed within a thread
+   EGuiQt
+   }
+
+enum EApplicationFxEvent
+    {
+    EFxApplicationStarting,
+    EFxApplicationClosing,
+    EFxApplicationActivated,
+    EFxApplicationDeactivated,
+    EFxApplicationEmbeddedStarting,
+    EFxApplicationEmbeddedClosing
+    // Todo: Should we have different events for embed cases where hos loses its focus ?
+    }
+
+
+   // should we enforce this somehow to AppFW (e.g. ref to CAknAppUi / CCoeEnv / ..)
+   // or e.g. just enum 
+   // Framework will call
+    IMPORT_C static TInt InitStatic(TUid aAppUid, TInt aFxGuiLibrary = EGuiAvkon );
+    IMPORT_C void Close();
+   
+    // Geter for thread singleton
+    IMPORT_C HwaTransEffect* Static() 
+   
+    // --------------------------------------------------------------------------------------------------------------
+    // Registering a component (Effect identifier & component identifier could be strings as well , should they even be??)
+    // --------------------------------------------------------------------------------------------------------------
+    IMPORT_C TInt Register(const CCoeControl& aControl, TInt aEffectIdentifier);
+    IMPORT_C TInt RegisterUnique(const TDesC8&  aComponentIdentifier, const CCoeControl& aControl,  TInt aEffectIdentifier);
+    IMPORT_C TInt Register(const CAlfVisual& aVisual,  TInt aEffectIdentifier);
+    IMPORT_C TInt RegisterUnique(const TDesC8&  aComponentIdentifier, const CAlfVisual& aVisual,  TInt aEffectIdentifier);
+   
+    // ToDo: Should there be possibility to unregister elements / effects as well ?
+
+    // -------------------------------------------------------------------------------------------------------------- 
+    // Launching an effect
+    // --------------------------------------------------------------------------------------------------------------
+    IMPORT_C void Start(TInt aEffectIdentifier );
+    IMPORT_C void End( TInt aEffectIdentifier );
+
+    // ToDo: Other way to launch unique effects would be using just passing cntrl / visual reference here
+    // On the other hand, if we assume that registering is the method that is allowed to fail, it shoul
+    IMPORT_C void Start(const TDesC8& aComponentIdentifier, TInt aEffectIdentifier );
+    IMPORT_C void End( const TDesC8& aComponentIdentifier, TInt aEffectIdentifier );
+
+    IMPORT_C void StartApplicationEffect(const TUid& aAppUid, TInt aApplicationFxEvent);
+    IMPORT_C void StartApplicationEffect(TInt aWindowGroupId, TInt aApplicationFxEvent);
+    IMPORT_C void ResetApplicationEffect(TInt aApplicationFxEvent);
+   
+private:
+   class HwaTransEffectData;
+   HwaTransEffectData* iData
+   };
+   
+#endif // #ifndef __HWATRANSEFFECT__
+
+   
+   
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/inc/hwatranseffectuids.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __HWATRANSEFFECTUIDS__
+#define __HWATRANSEFFECTUIDS__
+
+#include <e32std.h>
+
+enum HWATRANSEFFECTCOMMANDS
+    {
+    // for convenience, introduce these in same order (and ordinals as client defs)
+    EFxCmdApplicationStarting,
+    EFxCmdApplicationClosing,
+    EFxCmdApplicationActivated,
+    EFxCmdApplicationDeactivated,
+    EFxCmdApplicationEmbeddedStarting,
+    EFxCmdApplicationEmbeddedClosing
+ 
+ 
+    ETfxCmdRegisterControl = 100,
+    ETfxCmdRegisterVisual
+    // ...
+    
+    };
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/group/huirendervg10.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project Hitchcock Core
+*                Do not try to build this directly, this is included
+*                as a part of huitk.mmp and huitk_publicsdk.mmp.
+*
+*/
+
+
+
+#include <bldvariant.hrh>
+#include <platform_paths.hrh>
+#include "../../../CommonInc/huicompileroptions.mmh"
+
+// Default render surface flag is in coretkoptions.mmp
+#include "../../../CommonInc/coretkoptions.mmh"
+
+// NVG Flags for locally defining the NVG to be in use
+#define __NVG_MMP
+MACRO __NVG
+
+TARGET          huirenderpluginvg.dll
+TARGETTYPE      PLUGIN
+
+// uid2 specifies an ECOM dll, uid3 specifies a unique identifier for dll
+UID             0x10009D8D 0x200184B7
+VERSION         1.0
+
+CAPABILITY      CAP_ECOM_PLUGIN
+VENDORID        VID_DEFAULT
+
+SOURCEPATH      ../src
+
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   ../../inc
+SYSTEMINCLUDE   /epoc32/include/ecom
+
+USERINCLUDE     ../../inc
+USERINCLUDE     ../inc
+
+//Added as part of break team support changes.
+#include "../../../../../group/stdinc.mmh"
+
+// OpenVG 1.0 Renderer
+SOURCE          HuiVg10RenderPlugin.cpp
+SOURCE          HuiVg10Gc.cpp
+SOURCE          HuiVg10RenderSurface.cpp
+SOURCE          HuiVg10PBufferSurface.cpp
+SOURCE          HuiVg10CurvePath.cpp
+SOURCE          HuiVg10Texture.cpp
+SOURCE          HuiVg10TextureManager.cpp
+SOURCE          HuiVg10TextureProcessor.cpp
+SOURCE          huivg10canvasgc.cpp
+SOURCE          huivg10canvasrenderbuffer.cpp
+SOURCE          HuiVg10VGImageBinder.cpp
+
+
+START RESOURCE 200184B7.rss
+TARGET         huirenderpluginvg.rsc
+END
+// Effects
+SOURCE          HuiFxVg10BlurFilter.cpp
+SOURCE          HuiFxVg10BrightnessContrastFilter.cpp
+SOURCE          HuiFxVg10Engine.cpp
+SOURCE          HuiFxVg10FilterBase.cpp
+SOURCE          HuiFxVg10HSLFilter.cpp
+SOURCE          HuiFxVg10OffscreenRenderbuffer.cpp
+SOURCE          HuiFxVg10OnscreenRenderbuffer.cpp
+SOURCE          HuiFxVg10RenderbufferBase.cpp
+SOURCE          HuiFxVg10ColorizeFilter.cpp
+SOURCE          HuiFxVg10OutlineFilter.cpp
+SOURCE          HuiFxVg10BevelFilter.cpp
+SOURCE          HuiFxVg10ColorMatrixFilterBase.cpp
+SOURCE          HuiFxVg10TransformFilter.cpp
+
+LIBRARY         euser.lib
+LIBRARY         ecom.lib
+LIBRARY         hitchcock.lib
+LIBRARY         fbscli.lib
+LIBRARY         cone.lib
+LIBRARY         ws32.lib
+LIBRARY         gdi.lib
+LIBRARY         bitgdi.lib // For CFbsScreenDevice
+LIBRARY         libc.lib libm.lib
+#ifdef __NVG_MMP
+LIBRARY         nvgdecoder.lib aknicon.lib
+#endif
+// TODO: when proper libopenvg.lib is available effects should use it
+//			 instead of libopenvg_nok.lib.
+LIBRARY         estlib.lib
+
+LIBRARY         libEGL.lib
+
+//#if defined(WINS)
+//LIBRARY         libopenvg_sw.lib
+//LIBRARY         libopenvgu_sw.lib
+//#else
+
+LIBRARY         libOpenVG.lib
+LIBRARY         libOpenVGU.lib
+
+//#endif
+
+
+EXPORTUNFROZEN
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXVG10_H_
+#define HUIFXVG10_H_
+
+#include <VG/openvg.h>
+#include <EGL/egl.h>
+
+#ifdef _DEBUG
+// This macro will cause panic if there was programming error, e.g. invalid handle passed to openvg.
+#define HUIFX_VG_INVARIANT() {TInt vgError = vgGetError();__ASSERT_ALWAYS((vgError == VG_NO_ERROR || vgError == VG_OUT_OF_MEMORY_ERROR), User::Panic(_L("HuiFx"), vgError));}
+#else
+#define HUIFX_VG_INVARIANT() {}
+#endif
+
+#endif /*HUIFXVG10_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10BevelFilter.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXVG10BEVELFILTER_H_
+#define HUIFXVG10BEVELFILTER_H_
+
+#include "HuiFxVg10FilterBase.h"
+
+class CHuiFxVg10BevelFilter : public CHuiFxVg10FilterBase
+    {
+public:
+    static CHuiFxVg10BevelFilter* NewL();
+    CHuiFxVg10BevelFilter *CloneL() const;
+protected:
+    void ConstructL();
+    void DrawEffect(CHuiFxEngine& aEngine, VGImage aTargetImage, VGImage aSourceImage, TInt aWidth, TInt aHeight);
+private:
+    TReal32             iOutlineX;
+    TReal32             iOutlineY;
+    TReal32             iSteepness;
+/*    TReal32             iRed;
+    TReal32             iGreen;
+    TReal32             iBlue;
+*/    };
+
+#endif /*HUIFXVG10BEVELFILTER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10BlurFilter.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXVG10BLURFILTER_H_
+#define HUIFXVG10BLURFILTER_H_
+
+#include "HuiFxVg10FilterBase.h"
+
+class CHuiFxVg10BlurFilter : public CHuiFxVg10FilterBase
+    {
+public:
+    static CHuiFxVg10BlurFilter* NewL();
+    TBool Draw(CHuiFxEngine& aEngine, CHuiGc& aGc,
+            CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource,
+            const TRect& aTargetRect, const TRect& aSourceRect);
+
+    void DrawEffect(CHuiFxEngine& aEngine, VGImage aTargetImage, VGImage aSourceImage, TInt aWidth, TInt aHeight);
+    void CalculateMargin(TMargins &aMargin) const;  
+    CHuiFxVg10BlurFilter *CloneL() const;
+protected:
+    void ConstructL();
+private:
+    void UpdateAlphaLUT();
+    TBool OpacityChanged();
+    
+    TReal32                 iOldOpacity;
+    TReal32                 iBlurX;
+    TReal32                 iBlurY;
+    const static VGubyte    iColorLUT[256];
+    VGubyte                 iAlphaLUT[256];
+    };
+
+#endif /*HUIFXVG10BLURFILTER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10BrightnessContrastFilter.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXVG10BRIGHTNESSCONTRASTFILTER_H_
+#define HUIFXVG10BRIGHTNESSCONTRASTFILTER_H_
+
+#include "HuiFxVg10ColorMatrixFilterBase.h"
+
+class CHuiFxVg10BrightnessContrastFilter: public CHuiFxVg10ColorMatrixFilterBase
+    {
+public:
+    static CHuiFxVg10BrightnessContrastFilter* NewL();
+    CHuiFxVg10BrightnessContrastFilter *CloneL() const;
+protected:
+    void ConstructL();
+    void UpdateColorMatrix(void);    
+private:
+    TReal32 iBrightness;    // from -1.0f to 1.0f 
+    TReal32 iContrast;      // from 0.0f to N
+    };
+
+#endif /*HUIFXVG10BRIGHTNESSCONTRASTFILTER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10ColorMatrixFilterBase.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functionality for vgColorMatrix() based filters. 
+*
+*/
+
+
+
+#ifndef HUIFXVG10COLORMATRIXFILTERBASE_H_
+#define HUIFXVG10COLORMATRIXFILTERBASE_H_
+
+#include "HuiFxVg10FilterBase.h"
+#include "HuiFxVg10.h"
+
+class CHuiFxVg10ColorMatrixFilterBase: public CHuiFxVg10FilterBase
+    {
+public:
+    static CHuiFxVg10ColorMatrixFilterBase* NewL();
+protected:
+    void ConstructL();
+    void DrawEffect(CHuiFxEngine& aEngine, VGImage aTargetImage, VGImage aSourceImage, TInt aWidth, TInt aHeight);
+    virtual void UpdateColorMatrix();
+    void CopyFromL(const CHuiFxVg10ColorMatrixFilterBase *aOldFilter);
+    CHuiFxVg10ColorMatrixFilterBase *CloneL() const;
+
+    VGfloat iColorMatrix[20];
+    };
+
+#endif /*HUIFXVG10COLORMATRIXFILTERBASE_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10ColorizeFilter.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXVG10COLORIZEFILTER_H_
+#define HUIFXVG10COLORIZEFILTER_H_
+
+#include "HuiFxVg10ColorMatrixFilterBase.h"
+
+class CHuiFxVg10ColorizeFilter: public CHuiFxVg10ColorMatrixFilterBase
+    {
+public:
+    static CHuiFxVg10ColorizeFilter* NewL();
+    CHuiFxVg10ColorizeFilter *CloneL() const;
+protected:
+    void UpdateColorMatrix(void);
+    void ConstructL();
+private:
+    TRgb iColor;
+    };
+
+#endif /*HUIFXVG10COLORIZEFILTER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10Engine.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXV10ENGINE_H_
+#define HUIFXV10ENGINE_H_
+
+#include "HuiFxEngine.h"
+#include "HuiVg10RenderPlugin.h"
+#include "HuiVg10PBufferSurface.h"
+#include "HuiFxVg10.h"
+
+//FORWARD DECLARATIONS
+class CHuiFxVg10OnscreenRenderbuffer;
+
+class CHuiFxVg10Engine: public CHuiFxEngine
+    {
+public:
+    static CHuiFxVg10Engine* NewL(CHuiVg10RenderPlugin& aPlugin);
+    ~CHuiFxVg10Engine();
+
+    void Release();
+    void RestoreL();
+
+    CHuiFxRenderbuffer* DefaultRenderbuffer();
+    CHuiFxFilter* CreateFilterL(THuiFxFilterType aType);
+    void Composite(CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource, 
+                   const TRect& aTargetRect, const TRect& aSourceRect,
+                   THuiFxBlendingMode aMode, TInt aAlpha);
+    void Composite(CHuiGc& aGc, CHuiFxRenderbuffer& aSource, const TPoint& aTargetPoint, TBool aOpaque, TInt aAlpha);
+    
+protected:
+    void ConstructL(CHuiVg10RenderPlugin& aPlugin);
+    CHuiFxRenderbuffer* AcquireNativeRenderbuffer(const TSize& aDesiredSize);
+    void ReleaseNativeRenderbuffer(CHuiFxRenderbuffer* aBuffer);
+private:
+    CHuiVg10RenderPlugin*           iPlugin;
+    CHuiFxVg10OnscreenRenderbuffer* iDefaultBuffer;
+    VGPaint                         iCompPaint;
+    };
+
+#endif /*HUIFXV10ENGINE_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10FilterBase.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXVG10FILTERBASE_H_
+#define HUIFXVG10FILTERBASE_H_
+
+#include "HuiFxFilter.h"
+#include "HuiFxVg10RenderbufferBase.h"
+#include "HuiFxVg10.h"
+#include <e32math.h>
+
+// when comparing floating point numbers against zero, if the number is below
+// EPSILON it's considered zero.
+const float EPSILON = 0.001;
+
+
+class CHuiFxVg10FilterBase: public CHuiFxFilter
+    {
+public: // from CHuiFxFilter
+    virtual TBool Draw(CHuiFxEngine& aEngine, CHuiGc& aGc,
+            CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource,
+            const TRect& aTargetRect, const TRect& aSourceRect);
+
+private:
+    virtual void DrawEffect(CHuiFxEngine& aEngine, VGImage aTargetImage, VGImage aSourceImage, TInt aWidth, TInt aHeight) = 0;
+protected:
+    TBool wasEnoughMemory();
+    
+    template <class T>
+    inline T clamp(const T value, const T minimum, const T maximum) {return (Max(Min(maximum, value), minimum));}
+    };
+ 
+
+#endif /*HUIFXVG10FILTERBASE_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10HSLFilter.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXVG10HSLFILTER_H_
+#define HUIFXVG10HSLFILTER_H_
+
+#include "HuiFxVg10ColorMatrixFilterBase.h"
+
+class CHuiFxVg10HSLFilter: public CHuiFxVg10ColorMatrixFilterBase
+    {
+public:
+    static CHuiFxVg10HSLFilter* NewL();
+    CHuiFxVg10HSLFilter *CloneL() const;
+protected:
+    void ConstructL();
+    void UpdateColorMatrix(void);
+private:
+    VGfloat iHue;           // from 0.0f to 360.f   neutral: 0.0f
+    VGfloat iSaturation;    // from 0.0f to N       neutral: 1.0f
+    VGfloat iLightness;     // from -1.0f to 1.0f   neutral: 0.0f
+    };
+
+#endif /*HUIFXVG10HSLFILTER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10OffscreenRenderbuffer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXVG10OFFSCREENRENDERBUFFER_H_
+#define HUIFXVG10OFFSCREENRENDERBUFFER_H_
+
+#include "HuiFxVg10RenderbufferBase.h"
+#include "HuiVg10RenderPlugin.h"
+
+//FORWARD DECLARATIONS
+class CHuiVg10RenderPlugin;
+
+class CHuiFxVg10OffscreenRenderbuffer: public CHuiFxVg10RenderbufferBase
+    {
+public:
+    static CHuiFxVg10OffscreenRenderbuffer* NewL(CHuiVg10RenderPlugin& aPlugin, const TSize& aSize);
+    ~CHuiFxVg10OffscreenRenderbuffer();
+
+    void InitGc(const TSize& aSize);
+    CHuiGc& BindAsRenderTarget();
+    void BindAsTexture(THuiFxRenderbufferUsage aUsage);
+    void UnbindAsRenderTarget();
+    void UnbindAsTexture();
+
+    void PrepareForReuse(const TSize& aReusedSize);
+    
+    VGImage Image() const;
+protected:
+    void ConstructL(CHuiVg10RenderPlugin& aPlugin, const TSize& aSize);
+private:
+    void ReadBackground();
+    void PushEGLContext();
+    void PopEGLContext();
+    
+private:
+    CHuiVg10RenderPlugin*   iPlugin;
+    CHuiGc*                 iGc;
+    VGImage                 iImage;
+    EGLContext              iContext;
+    EGLSurface              iSurface;
+    EGLContext              iSavedContext;
+    EGLSurface              iSavedReadSurface;
+    EGLSurface              iSavedDrawSurface;
+    VGImage                 iRotatedImage;    
+    TEGLState               iPreviousEGLState;
+    };
+
+#endif /*HUIFXVG10OFFSCREENRENDERBUFFER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10OnscreenRenderbuffer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXVG10ONSCREENRENDERBUFFER_H_
+#define HUIFXVG10ONSCREENRENDERBUFFER_H_
+
+#include "HuiFxVg10RenderbufferBase.h"
+
+//FORWARD DECLARATIONS
+class CHuiVg10RenderPlugin;
+class CHuiVg10RenderSurface;
+class CHuiVg10PBufferSurface;
+
+/**
+ *  A renderbuffer that uses an EGL surface for storage.
+ */
+
+class CHuiFxVg10OnscreenRenderbuffer: public CHuiFxVg10RenderbufferBase
+    {
+public:
+    static CHuiFxVg10OnscreenRenderbuffer* NewL(CHuiVg10RenderPlugin& aPlugin, CHuiVg10RenderSurface& aSurface);
+    ~CHuiFxVg10OnscreenRenderbuffer();
+
+    CHuiGc& BindAsRenderTarget();
+    void BindAsTexture(THuiFxRenderbufferUsage aUsage);
+    void UnbindAsRenderTarget();
+    void UnbindAsTexture();
+
+    VGImage Image() const;
+protected:
+    void ConstructL(CHuiVg10RenderPlugin& aPlugin, CHuiVg10RenderSurface& aSurface);
+    void PrepareForReuse(const TSize& /* aReusedRect */);
+private:
+    CHuiVg10RenderPlugin*   iPlugin;
+    CHuiVg10RenderSurface*  iSurface;
+    CHuiGc*                 iGc;
+    VGImage                 iImage;
+    EGLContext              iSavedContext;
+    EGLSurface              iSavedReadSurface;
+    EGLSurface              iSavedDrawSurface;
+    THuiFxRenderbufferUsage iTextureUsage;
+    };
+
+#endif /*HUIFXVG10ONSCREENRENDERBUFFER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10OutlineFilter.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXVG10OUTLINEFILTER_H_
+#define HUIFXVG10OUTLINEFILTER_H_
+
+#include "HuiFxVg10FilterBase.h"
+
+class CHuiFxVg10OutlineFilter : public CHuiFxVg10FilterBase
+    {
+public:
+    static CHuiFxVg10OutlineFilter* NewL();
+protected:
+    void ConstructL();
+    void DrawEffect(CHuiFxEngine& aEngine, VGImage aTargetImage, VGImage aSourceImage, TInt aWidth, TInt aHeight);
+    void CalculateMargin(TMargins &aMargin) const;  
+    CHuiFxVg10OutlineFilter *CloneL() const;
+private:
+    void UpdateLUT();
+    
+    TReal32     iOutlineX;
+    TReal32     iOutlineY;
+    TReal32     iSteepness;
+    TRgb        iColor;
+    VGuint      iLUT[256];
+    };
+
+#endif /*HUIFXVG10OUTLINEFILTER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10RenderbufferBase.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 HUIFXVG10RENDERBUFFERBASE_H_
+#define HUIFXVG10RENDERBUFFERBASE_H_
+
+#include "HuiFxRenderbuffer.h"
+#include "HuiFxVg10.h"
+class CHuiFxVg10RenderbufferBase: public CHuiFxRenderbuffer
+    {
+public:
+    virtual VGImage Image() const = 0;
+    
+    VGImage AcquireSubImage(const TRect& aRect);
+    void ReleaseSubImage(VGImage aImage);
+    };
+
+#endif /*HUIFXVG10RENDERBUFFERBASE_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiFxVg10TransformFilter.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,197 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef HUIFXVG10TRANSFORMFILTER_H_
+#define HUIFXVG10TRANSFORMFILTER_H_
+
+#include <math.h>
+#include "HuiFxVg10FilterBase.h"
+
+class CHuiFxVg10TransformFilter: public CHuiFxVg10FilterBase
+    {
+public: // from CHuiFxFilter
+    virtual TBool Draw(CHuiFxEngine& aEngine, CHuiGc& aGc,
+                       CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource,
+                       const TRect& aTargetRect, const TRect& aSourceRect);
+    static CHuiFxVg10TransformFilter* NewL();
+    void DrawEffect(CHuiFxEngine& /*aEngine*/, VGImage /*aTargetImage*/, VGImage /*aSourceImage*/, TInt /*aWidth*/, TInt /*aHeight*/) {}
+    void CalculateMargin(TMargins &aMargin) const;  
+    CHuiFxVg10TransformFilter *CloneL() const;
+protected:
+    void ConstructL();
+    
+    void identity()
+        {
+        iMatrix [0] = 1.f; iMatrix [1] = 0.f; iMatrix [2] = 0.f; iMatrix [3] = 0.f;
+        iMatrix [4] = 0.f; iMatrix [5] = 1.f; iMatrix [6] = 0.f; iMatrix [7] = 0.f;
+        iMatrix [8] = 0.f; iMatrix [9] = 0.f; iMatrix[10] = 1.f; iMatrix[11] = 0.f;
+        iMatrix[12] = 0.f; iMatrix[13] = 0.f; iMatrix[14] = 0.f; iMatrix[15] = 1.f;
+        }
+    
+    void translate(TReal32 tx, TReal32 ty, TReal32 tz)
+        {
+        const TReal32 tm[16] =
+        {
+            1.f, 0.f, 0.f, 0.f,
+            0.f, 1.f, 0.f, 0.f,
+            0.f, 0.f, 1.f, 0.f,
+            tx,  ty,  tz,  1.f
+        };
+        
+        multiply(tm); 
+        }
+    
+    void scale (const TReal32 sx, const TReal32 sy, const TReal32 sz)
+        {
+        const TReal32 sm[16] =
+        {
+            sx, 0.f, 0.f, 0.f,
+            0.f,  sy, 0.f, 0.f,
+            0.f, 0.f,  sz, 0.f,
+            0.f, 0.f, 0.f, 1.f
+        };
+
+        multiply(sm);
+        }
+    
+    void rotate (const TReal32 angle, const TReal32 x, const TReal32 y, const TReal32 z)
+        {
+        static const TReal32 deg_to_rad = 2.f * (TReal32)M_PI / 360.f;
+        // normalised vector components
+        TReal32 x_n;
+        TReal32 y_n;
+        TReal32 z_n;
+        TReal32 angle_rad = angle * deg_to_rad;
+
+        // normalise if needed
+        const TReal32 length = (TReal32)sqrt(double(x * x) + 
+                      double(y * y) + 
+                      double(z * z));
+        if(fabs(length - 1.0f) > EPSILON) {
+            // in fp calculations, division by zero -> (+/-)inf
+            // can't really help if it's the case.
+            const TReal32 inv_length = 1.f / length;
+            x_n = x * inv_length;
+            y_n = y * inv_length;
+            z_n = z * inv_length;
+        } else {
+            x_n = x;
+            y_n = y;
+            z_n = z;
+        }
+
+        const TReal32 c = cos(angle_rad);
+        const TReal32 s = sin(angle_rad);
+        const TReal32 c_1 = 1.f - c;
+
+        const TReal32 rm[16] =
+        {
+                x_n * x_n * c_1 + c,       y_n * x_n * c_1 + z_n * s, x_n * z_n * c_1 - y_n * s, 0.f,
+                x_n * y_n * c_1 - z_n * s, y_n * y_n * c_1 + c,       y_n * z_n * c_1 + x_n * s, 0.f,
+                x_n * z_n * c_1 + y_n * s, y_n * z_n * c_1 - x_n * s, z_n * z_n * c_1 + c,   0.f,
+                0.f,               0.f,               0.f,           1.f
+        };
+
+        multiply(rm);
+        }
+ 
+    void frustum (const TReal32 l, const TReal32 r, const TReal32 b, const TReal32 t, const TReal32 n, const TReal32 f)
+        {
+        const TReal32 rl = 1.f / (r - l);
+        const TReal32 tb = 1.f / (t - b);
+        const TReal32 fn = 1.f / (f - n);
+
+        const TReal32 A = (r + l) * rl;
+        const TReal32 B = (t + b) * tb;
+        const TReal32 C = -(f + n) * fn; 
+        const TReal32 D = -2.f * f * n * fn;
+
+        const TReal32 fm[16] =
+        {
+            2.f * n * rl,   0.f,        0.f,    0.f,
+            0.f,        2.f * n * tb,   0.f,    0.f,
+            A,      B,      C,  -1.f,
+            0.f,        0.f,        D,  0.f
+        };
+        
+        multiply(fm);
+        }
+
+    void multiply (const TReal32* b)
+        {
+        TReal32 dst[16];
+        for (int i = 0; i < 4; i++)
+        {
+            for (int j = 0; j < 4; j++)
+            {
+                TReal32 sum = 0.f;
+                for (int k = 0; k < 4; k++)
+                    sum += iMatrix[i + 4 * k] * b[k + 4 * j];
+
+                dst[i + 4 * j] = sum;
+            }
+        }
+
+        for (int i = 0; i < 16; i++)
+            iMatrix[i] = dst[i];
+        }
+    
+    void shear (const TReal32 aX, const TReal32 aY, const TReal32 aZ)
+        {
+        TReal32 shearMatrix[16] =
+            {
+            1.0f,   aX,   aX, 0.0f,
+              aY, 1.0f,   aY, 0.0f,
+              aZ,   aZ, 1.0f, 0.0f,
+            0.0f, 0.0f, 0.0f, 1.0f,
+            };
+        
+        multiply(shearMatrix);
+
+        }
+
+private:
+    TReal32             iTranslationX;
+    TReal32             iTranslationY;
+    TReal32             iTranslationZ;
+    
+    TReal32             iScaleX;
+    TReal32             iScaleY;
+    TReal32             iScaleZ;
+    TReal32             iScaleOriginX;
+    TReal32             iScaleOriginY;
+    TReal32             iScaleOriginZ;
+    
+    TReal32             iRotationOriginX;
+    TReal32             iRotationOriginY;
+    TReal32             iRotationOriginZ;
+    TReal32             iRotationAngle;
+    TReal32             iRotationAxisX;
+    TReal32             iRotationAxisY;
+    TReal32             iRotationAxisZ;
+    
+    TReal32             iSkewAngleX;
+    TReal32             iSkewAngleY;
+    TReal32             iSkewAngleZ;
+    TReal32             iSkewOriginX;
+    TReal32             iSkewOriginY;
+    TReal32             iSkewOriginZ;
+    
+    TReal32             iMatrix[16];
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10CurvePath.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,153 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIVG10CURVEPATH_H__
+#define __HUIVG10CURVEPATH_H__
+
+
+#include "uiacceltk/HuiCurvePath.h"
+#include "HuiVg10RenderPlugin.h"
+#include <VG/openvg.h>
+
+/**
+ * Curve path that can be drawn using OpenVG 1.0.
+ */
+NONSHARABLE_CLASS(CHuiVg10CurvePath) : public CHuiCurvePath
+    {
+public:
+
+    /* Constructors and destructor. */
+
+	/**
+	 * Constructor.
+	 */
+	CHuiVg10CurvePath();
+
+	/**
+	 * Second-phase constructor.
+	 */
+	void ConstructL();
+
+    /** 
+     * Destructor.
+     */
+    virtual ~CHuiVg10CurvePath();
+    
+    
+    /* Methods. */
+    
+    /** 
+     * Resets the path by removing all segments.
+     */
+    virtual void Reset();
+    
+    /**
+     * Recalculate the path's vertices and colors. 
+     */
+    void Update(TReal32 aStartPos, TReal32 aEndPos, 
+                TReal32 aAlphaFactor,
+                MHuiMappingFunction* aAlphaFunction,
+                MHuiMappingFunction* aWidthFunction) __SOFTFP;
+    
+    /** 
+     * Draws the path.
+     *
+     * @param aOrigin Offset of drawing in pixels
+     * @param aGc Graphics context to use.
+     */
+    void Draw(const TPoint& aOrigin, CHuiGc* aGc) const;
+
+protected:
+
+    /**
+     *  @returns the number of tuples required for 
+     *           a given segment.
+     */
+    TInt SegmentTuples(const TSegment& aSegment) const;
+    
+    /**
+     *  Reserve space for tuples.
+     *
+     *  @param aTuplecount  Number of tuples required.
+     */
+    void SetTupleCountL(TInt aTupleCount);
+    
+    /**
+     *  Prepare the tuples for a given segment.
+     *
+     *  @param aSegment         Segment to process.
+     *  @param aStart           Start position.
+     *  @param aEnd             End position.
+     *  @param aIsFinal         ETrue if this is the final 
+     *                          segment of the path.
+     *  @param aAlphaFactor     Transparency factor.
+     *  @param aAlphaFunction   Function of path alpha.
+     *  @param aWidthFunction   Function of path width.
+     */
+    void MakeSegmentTuples(const TSegment& aSegment,
+                           TReal32 aStart, TReal32 aEnd,
+                           TBool aIsFinal,
+                           TReal32 aAlphaFactor,
+                           MHuiMappingFunction* aAlphaFunction,
+                           MHuiMappingFunction* aWidthFunction);
+
+    /**
+     *  Add a single tuple to the path.
+     *
+     *  @param aPoint       Tuple coordinates.
+     *  @param aNormal      Tuple normal (left side).
+     *  @param aWidth       Path width.
+     *  @param aAlpha       Path transparency.
+     */
+    void AddTuple(const THuiRealPoint& aPoint,
+                  const THuiRealPoint& aNormal,
+                  TReal32 aWidth, TReal32 aAlpha);
+
+    /**
+     *  Reset the current path.
+     */
+    void ResetPath();
+
+    /**
+     *  Reset the accumulated tuples.
+     */
+    void ResetTuples();
+
+private:
+    /** Path that encloses the whole curve */
+    VGPath   iPath;
+
+    /** Coordinates for the path */
+    VGfloat* iPathCoords;
+
+    /** Commands for the path */
+    VGubyte* iPathCommands;
+
+    /** Last opacity factor used to render the path */
+    TReal32 iLastOpacityFactor;
+
+    /** Number of vertex tuples along the path (at least 2). */
+    TUint iMaxTupleCount;
+    
+    /** Number of vertex tuples used. */
+    TUint iUsedTupleCount;
+    };
+
+
+#endif // __HUIVG10CURVEPATH_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10Gc.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,577 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines CHuiVg10Gc, an OpenVG 1.0 version of the HUITK
+*                graphics context.
+*
+*/
+
+ 
+
+#ifndef __HUIVG10GC_H__
+#define __HUIVG10GC_H__
+
+
+#include <e32def.h>
+#include <VG/openvg.h>
+#include <VG/vgu.h>
+#include <e32cmn.h>
+
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiRealPoint.h"
+#include "uiacceltk/HuiRealSize.h"
+#include "uiacceltk/HuiRealRect.h"
+#include "uiacceltk/HuiSegmentedTexture.h"
+#include "HuiMatrixStack.h"
+
+/* Forward declarations. */
+#ifdef __NVG
+class MNVGIcon;
+class CNvgEngine;
+#endif
+
+/**
+ * CHuiVg10Gc implements an OpenVG 1.0 version of the HUITK
+ * graphics context.
+ */
+NONSHARABLE_CLASS(CHuiVg10Gc) : public CHuiGc
+    {
+    friend class CHuiVg10CurvePath;
+
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructs a new graphics context.
+     */
+    static CHuiVg10Gc* NewL();
+
+    /**
+     * Constructs a new graphics context and leaves it on the cleanup stack.
+     */
+    static CHuiVg10Gc* NewLC();
+
+    /**
+     * Destructor.
+     */
+    virtual ~CHuiVg10Gc();
+
+
+    /* Methods. */
+    
+    virtual void Push(THuiGcMatrix aStack);
+
+    virtual void Pop(THuiGcMatrix aStack);
+
+    virtual void Multiply(THuiGcMatrix aStack, TReal32 aMatrix[16]);
+
+    virtual void LoadIdentity(THuiGcMatrix aStack);
+
+    virtual void Translate(THuiGcMatrix aStack,
+                           TReal32 aX, TReal32 aY, TReal32 aZ) __SOFTFP;
+
+    virtual void Scale(THuiGcMatrix aStack,
+                       TReal32 aX, TReal32 aY, TReal32 aZ) __SOFTFP;
+
+    virtual void Rotate(THuiGcMatrix aStack, TReal32 aAngle,
+                         TReal32 aX, TReal32 aY, TReal32 aZ) __SOFTFP;
+
+    virtual void Shear(THuiGcMatrix aStack,
+                       TReal32 aX, TReal32 aY, TReal32 aZ) __SOFTFP;
+    
+    virtual void InitState();
+
+    /**
+     * Selects the default data arrays.
+     */
+    void RestoreState() const;
+
+    /**
+     * Restores OpenVg state according to flags set up in the render plugin
+     */
+    void RestoreFlaggedState() const;
+    
+    
+    /**
+     * Updates the projection matrix without changing any settings.
+     */
+    void UpdateProjection();
+
+    /**
+     * Returns the number of available texture units.
+     *
+     * @return  Number of units (at least 1).
+     */
+    TInt TextureUnits() const;
+
+    /**
+     * Sets the number of active texture units.
+     *
+     * @param aTextureUnitCount  Number of units to activate (e.g., 2 => 0,1)
+     */
+    void SetTextureUnits(TInt aTextureUnitCount);
+
+    /**
+     * Enable a feature.
+     */
+    void Enable(TFeature aFeature, TBool aDoEnable = ETrue);
+
+    /**
+     * Changes the blending mode.
+     */
+    void SetBlendMode(TBlendMode aBlendMode);
+
+    /**
+     * Changes the texture mode.
+     *
+     * @param aTextureMode  Texturing mode.
+     * @param aParam        Parameter for the texturing.
+     */
+    void SetTextureMode(TTextureMode aTextureMode, TReal32 aParam = 0) __SOFTFP;
+
+    /**
+     * Sets the strength of dimming fog. In order to have effect, enable the
+     * Fog feature.
+     *
+     * @param aColor   Color of dimming.
+     * @param aAmount  Amout of dimming (0...1).
+     */
+    void SetDimmingFog(const TRgb& aColor, TReal32 aAmount) __SOFTFP;
+
+    /**
+     * Clear using the current pen color.
+     */
+    void Clear();
+
+    /**
+     * Clear the depth buffer.
+     */
+    void ClearDepth();
+
+    /**
+     * Clear both color and depth buffer
+     */
+    void ClearColorAndDepth();
+
+	/**
+	 * Do initialization of new frame.
+	 * Called by CHuiDisplay when starting to render new frame.
+	 * Graphics context can do renderer specific state initializations here.
+	 */
+	void InitNewFrame();
+
+    /**
+     * Apply a clipping rectangle to the current clipping region.
+     *
+     * @param aClipRect  Clipping rectangle.
+     */
+    virtual void Clip(const TRect& aClipRect);
+
+    /**
+     * Apply a clipping region to the current clipping region.
+     *
+     * @param aRegion  Clipping region.
+     */
+    virtual void Clip(const TRegion& aRegion);
+
+    /**
+     * Replace the current clipping rectangle.
+     *
+     * @param aClipRect  Clipping rectangle in display coordinates.
+     */
+    virtual void SetClip(const TRect& aClipRect);
+    
+    /**
+     * Replace the current clipping region.
+     *
+     * @param aRegion  List of Clipping rectangles.
+     */
+    virtual void SetClipRegion(const TRegion& aRegion);
+    
+    /**
+     * Cancel an applied clipping rectangle or region.
+     */
+    virtual void CancelClipping();
+
+    /**
+     * Draws a single line of text using the current pen color, font, and
+     * alignment mode.
+     *
+     * @param aTextMesh  Text string.
+     * @param aBounds    Bounding box for the text.
+     * @param aShadow    Darkness of text shadow.
+     */
+    void DrawText(const CHuiTextMesh& aTextMesh,
+                  const THuiRealRect& aBounds,
+                  TReal32 aShadow = 0) __SOFTFP;
+
+    /**
+     * Draws a rectangle with the current graphics context parameters.
+     *
+     * @param aRect  Rectangle to draw.
+     */
+    void DrawRect(const TRect& aRect);
+
+    /**
+     * Draws a solid line of uniform thickness with the current graphics context parameters.
+     *
+     * @param aStart     Start of line.
+     * @param aEnd       End of line.     
+     * @param aThickness Thickness of line in pixels.
+     */
+    void DrawLine(const TPoint& aStart, const TPoint& aEnd, const TInt aThickness);
+
+    /**
+     * Draws a solid or unfilled round rectangle.
+     *
+     * @param aDestinationRect     Start of line.
+     * @param aSize       	Arc size. 
+	 * @param aDrawMode		THuiFillMode 
+     * @param aThickness 	Thickness of border line in pixels.
+     */
+    void DrawRoundRect(const TRect& aDestinationRect, const THuiRealSize& aSize, THuiFillMode aDrawMode, const TInt aThickness);
+
+    /**
+     * Draws a stretched image.
+     *
+     * @param aMode        Stretch mode: horizontal or vertical.
+     * @param aImage       Image.
+     * @param aRect        Rectangle to fill.
+     * @param aStartWidth
+     * @param aEndWidth
+     */
+    void DrawStretchImage(TStretchMode aMode,
+                          const THuiImage& aImage, const THuiRealRect& aRect,
+                          TInt aStartWidth, TInt aEndWidth);
+
+    /**
+     * Draws edges with a color or using a texture.
+     *
+     * @param aOuterRect         The outer edge of the borders.
+     * @param aLeftBorderWidth   The visible width of the left border, 
+     * 							 the width is assumed to be pixel units 
+     * 							 inside from the respective edge 
+     * 							 border. Use 0.0 for no left border.
+     * @param aRightBorderWidth  The visible width of the right border, 
+     * 							 the width is assumed to be pixel units 
+     * 							 inside from the respective edge 
+     * 							 border. Use 0.0 for no right border.
+     * @param aTopBorderWidth    The visible height of the top border, 
+     * 							 the height is assumed to be pixel units 
+     * 							 inside from the respective edge 
+     * 							 border. Use 0.0 for no border.
+     * @param aBottomBorderWidth The visible height of the bottom border, 
+     * 							 the height is assumed to be pixel units 
+     * 							 inside from the respective edge 
+     * 							 border. Use 0.0 for no border.
+     * @param aBorderMode		 Border drawing mode, defines how the
+     * 							 image is streched to the borders.
+     * 							 aImage needs to be 
+     * 							 defined in order to this modes to be
+     * 					         effective.
+     * 
+     * @param aImage			 The image to be used to draw borders,
+     * 							 according to the border drawing mode.
+     * 							 If left NULL will use the current pen 
+     * 							 color to draw single-color borders.
+     */
+    void DrawBorders(const TRect& aOuterRect, 
+                     TReal32 aLeftBorderWidth,
+                     TReal32 aRightBorderWidth, 
+                     TReal32 aTopBorderHeight,
+                     TReal32 aBottomBorderHeight, 
+                     TBorderMode aBorderMode,
+                     const THuiImage* aImage) __SOFTFP;
+
+    /**
+     * Draws a path from the beginning to aPos.
+     *
+     * @param aPath      Weighted path.
+     * @param aOrigin    Offset.
+     * @param aStartPos  Start position on the path.
+     * @param aEndPos    End position on the path.
+     * @param aAlphaFunction  Function for determining alpha values.
+     * @param aWidthFunction  Function for determining line thickness.
+     */
+    void DrawPath(const CHuiCurvePath& aPath,
+                  const TPoint& aOrigin,
+                  TReal32 aStartPos,
+                  TReal32 aEndPos,
+                  MHuiMappingFunction* aAlphaFunction = 0,
+                  MHuiMappingFunction* aWidthFunction = 0) __SOFTFP;
+
+    void DrawMesh(const CHuiMesh& aMesh, const THuiImage* aImage = 0,
+                  const THuiImage* aSecondaryImage = 0,
+                  TReal32 aSecondaryAlpha = 0.0) __SOFTFP;
+
+    void DrawArc(const TPoint& aOrigin, const TSize& aRadius,
+                 TReal32 aStart, TReal32 aEnd, TInt aAnglePerSegment,
+                 TReal32 aWidth, const THuiImage& aImage,
+                 TReal32 (*aAlphaFunc)(TReal32)=0, TBool aAbsoluteAngleParm=EFalse) __SOFTFP;
+
+    void DrawGradient(TGradientType aType, const TRect& aRect,
+                      const TRgb& aStartColor, const TRgb& aEndColor,
+                      TReal32 aStartOpacity = 1.0,
+                      TReal32 aEndOpacity = 1.0,
+                      const THuiRealRect* aTexCoords = 0) __SOFTFP;
+                      
+    void DrawPolygon(RArray<THuiRealPoint>& aPoints);                      
+
+    void DrawEllipse(const TRect& aRect, THuiFillMode aDrawMode, const TInt aThickness);                      
+    
+    /**
+     * Sets a depth offset. The depth offset is used when drawing overlaid
+     * surfaces with the same Z coordinates. Normally the depth offset is
+     * always zero.
+     *
+     * @param aOffset  Offset units.
+     */
+    void SetDepthOffset(TInt aOffset);
+
+    /**
+     * Makes a screen capture of the graphics context's current content.
+     * The data is returned in an array of raw pixel data of size:
+     * aSize.Width() * aSize.Height() * 4.
+     *
+     * @return  Rgba8888 raw bitmap data of the screen's contents.
+     *          Caller must pop and destroy the returned buffer.
+     */
+    TUint8* CaptureLC(TSize& aSize) const;
+
+    /**
+     * Transforms a dirty rectangle. Implementing this method in
+     * inherited classes is optional (if e.g. dirty rects aren't supported)
+     *
+     * @param aRect  Rectangle to transform.
+     */
+    void TransformDirtyRect(THuiRealRect& aRect);
+
+    /*
+     * Implemented.
+     */
+    virtual void UpdateColor(TReal32 aAlphaFactor = 1.0f) __SOFTFP;
+    
+public: // new
+
+    /**
+     * Sets the rule by which a polygon should be filled
+     * Fill rule is useful while filling self-intersecting polygons.
+     *
+     * @param aFillMode Polygon filling mode, which will be mapped to
+     *  openVg Fill_Rule.
+     */
+
+    void SetFillRule( THuiFillMode aFillMode );
+
+    /*
+     * Ownership is not transferred.
+     */
+    void SetPaintPattern(CHuiTexture* aTexture, const TPoint& aTextureOrigin);
+    
+    void DrawArc(const TRect& aRect, THuiFillMode aDrawMode, const TInt aThickness, TReal32 aStart, TReal32 aEnd, TBool aIsPie);
+
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor.
+     */
+    CHuiVg10Gc();
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+
+    /* Methods. */
+
+    /**
+     * Draw the image.
+     *
+     * @param aImage    Image to draw.
+     * @param aTopLeft  Coordinates of the top left corner.
+     * @param aSize     Size of the image.
+     */
+    void DoDrawImage(const THuiImage& aImage, const THuiRealPoint& aTopLeft,
+                     const THuiRealSize& aSize);
+
+    /**
+     * Draws two images simultaneously. Requires at least two texture units.
+     *
+     * Segment count must match and sizes must match if using multiple segments.
+     * Otherwise nothing is drawn.
+     *
+     * @param aImage    Image to draw.
+     * @param aImage2   Secondary image to draw.
+     * @param aTopLeft  Coordinates for the top left corner.
+     * @param aSize     Size of the image.
+     */
+    void DoDrawImages(const THuiImage& aImage,
+                      const THuiImage& aImage2,
+                      const THuiRealPoint& aTopLeft,
+                      const THuiRealSize& aSize);
+
+    CHuiMatrixStack* MatrixStack(THuiGcMatrix aMatrix);
+
+    void SetQuality(THuiQuality aQuality);
+    
+private:
+    /** 
+     *  Synchronize a specific OpenVG matrix with the main matrix.
+     */
+    void UpdateMatrix(VGMatrixMode aMatrix);
+    
+    /**
+     *  Makes sure the latest transformation matrix is used for client-side calculation.
+     */
+    void UpdateClientMatrix();
+
+    /**
+     *  Draw a cropped and possibly scaled portion of an image onto the screen.
+     * 
+     *  @param aTexture     Texture to draw
+     *  @param aSourceRect  Source rectangle
+     *  @param aDestRect    Destination rectangle
+     */
+    void DrawCroppedTexture(const MHuiSegmentedTexture& aTexture, 
+                            const THuiRealRect& aSourceRect, 
+                            const THuiRealRect& aDestRect);
+
+    /**
+     *  Draw a possibly cropped or scaled portion of an image onto the screen.
+     * 
+     *  @param aTexture     Texture to draw
+     *  @param aSourceRect  Source rectangle
+     *  @param aDestRect    Destination rectangle
+     */
+    void DrawTexture(const MHuiSegmentedTexture& aTexture, 
+                     const THuiRealRect& aSourceRect, 
+                     const THuiRealRect& aDestRect);
+
+
+    /**
+     * DrawBorders implementation for EBorderImage
+     * border drawing mode.
+     * @see CHuiGc::DrawBorders()
+     */
+    void DrawBorderImages(const TRect& aOuterRect, 
+                          TReal32 aBorderWidth,
+                          TReal32 aBorderHeight, 
+                          THuiRealPoint aOffset,
+                          const THuiImage* aImage);
+
+
+    /**
+     * DrawBorders implementation for EBorderFixedCorners
+     * border drawing mode.
+     * @see CHuiGc::DrawBorders()
+     */
+    void DrawBorderFixedCorners(const TRect& aOuterRect, 
+                                TReal32 aLeftBorderWidth,
+                                TReal32 aRightBorderWidth, 
+                                TReal32 aTopBorderHeight,
+                                TReal32 aBottomBorderHeight, 
+                                const THuiImage* aImage);
+    
+    
+    void CreateVgObjectsL();
+    
+	
+#ifdef __NVG
+    /**
+     * Draws the icon from NVG data using the NVGDecoder. Does the parsing of the icon header as well
+     * 
+     * @param aNVGData              Extended bitmap data in NVG buffer format to be drawn
+     * @param aIconCmds             Extended bitmap data in VG Object Cached format to be drawn
+     * @param aImageSize            Size of the image
+     * @param aIgnoreAspectRatio    Ignore aspect ratio defined in the icon's header
+     */
+    void DrawNVG(HBufC8* aNVGData, MNVGIcon* aIconCmds, const TSize& aImageSize, TBool aIgnoreAspectRatio);
+#endif
+    
+    void UsePaintPattern();
+    void DiscardPaintPattern();
+    
+private:
+    /** Matrix characteristics */
+    enum TMatrixFlags
+        {
+        EMatrixFlagsRotation = 0x1,
+        };
+
+    /** Model view matrix stack */
+    CHuiMatrixStack* iMatrixStack;
+
+    typedef RArray<TUint> RMatrixFlagsStack;
+    
+    /** Stack for storing additional information about the matrices */
+    RMatrixFlagsStack iMatrixFlagsStack;
+    
+    /** Flags for the current matrix */
+    TUint iMatrixFlags;
+    
+    /** Rendering state */
+	TBool iStateScissorTest;
+	TRect iScissorRect;
+	
+    /** A path for drawing dynamic shapes */
+	VGPath iPath;
+    
+	/** A path for drawing rectangles */
+	VGPath iRectPath;
+	
+	/** A path for drawing round rectangles */
+	VGPath iRoundRectPath;
+
+    /** A path for drawing cropped images */
+    VGPath iImagePath;
+    
+    /** A path for drawing borders */
+    VGPath iBorderPath;
+    
+    /** A path for drawing lines */
+    VGPath iLinePath;
+
+    /** A path for drawing arcs */
+    VGPath iArcPath;
+
+    /** A path for drawing ellipses */
+    VGPath iEllipsePath;
+    
+    /** Default fill and stroke paint */
+	VGPaint iPaint;
+
+    /** Gradient fill paint */
+    VGPaint iGradientPaint;
+    
+    /** The current blend mode */
+    VGBlendMode iBlendMode;
+    
+#ifdef __NVG
+    CNvgEngine* iNvgEngine;
+#endif
+        
+    TBool iVgObjectsCreated;
+    
+    /** Private temp region for general purpose, used to avoid excessive allocations of RRegion heap objects */
+    mutable RRegionBuf<KHuiGcClipRegionGranularity> iTempRegion;
+
+    /** Image pattern for paint, NOT owned */
+    VGImage iPaintPattern;
+    TPoint iPaintPatternOrigin;
+    };
+
+#endif  // __HUIVG10GC_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10PBufferSurface.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,251 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiVg10PBufferSurface class. 
+*                CHuiVg10PBufferSurface is an OpenVG PBuffer surface 
+*                object that implements the MHuiRenderSurface interface.
+*
+*/
+
+
+
+#ifndef __HUIVG10PBUFFERSURFACE_H__
+#define __HUIVG10PBUFFERSURFACE_H__
+
+
+#include "HuiVg10RenderSurface.h"
+
+class CHuiVg10RenderPlugin;
+class CFbsBitmap;
+
+/**
+ * Off-screen rendering surface for OpenGL ES content. A pbuffer (pixel buffer)
+ * surface can be used for instance for rendering temporary graphical content 
+ * onto. This content can then be reused in the current application. Because 
+ * the class has been inherited from MHuiRenderSurface, it can also be used 
+ * for rendering from displays. Doesn't output rendered content on the 
+ * framebuffer.
+ *
+ * @lib hitchcock.lib
+ */
+NONSHARABLE_CLASS(CHuiVg10PBufferSurface) : public CBase, public MHuiRenderSurface
+    {
+public: // Constructors and destructor
+
+    /**
+	 * \todo     
+	 */
+    static CHuiVg10PBufferSurface* NewLC(CHuiVg10RenderPlugin& aRenderer, const TSize& aSize, TInt aAlphaBits, TInt aEglBufferType, TInt aBufferColorMode);
+
+    /**
+     * Constructs a new example CHuiVg10PBufferSurface instance. A static factory method that
+     * leaves the object to the cleanup stack.
+     * @param aRenderer CHuiVg10RenderPlugin object that is used to access the shared context
+     * and determine surface configurations.
+     * @param aSize Size in pixels of the created PBuffer surface object.
+     * @return Newly created instance of CHuiVg10PBufferSurface.
+     */
+    static CHuiVg10PBufferSurface* NewLC(CHuiVg10RenderPlugin& aRenderer, const TSize& aSize, TInt aAlphaBits = 0);
+
+    /**
+     * Constructs a new example CHuiVg10PBufferSurface instance. A static factory method.
+     * @param aSize Size in pixels of the created PBuffer surface object.
+     * @return Newly created instance of CHuiVg10PBufferSurface.
+     */
+    static CHuiVg10PBufferSurface* NewL(const TSize& aSize, TInt aAlphaBits = 0);
+
+    /**
+     * Constructs a new CHuiVg10PBufferSurface class instance and leaves it
+     * on the cleanup stack.
+     * @param aSize Size in pixels of the created PBuffer surface object.
+     * @return Newly created instance of CHuiVg10PBufferSurface.
+     */
+    static CHuiVg10PBufferSurface* NewLC(const TSize& aSize, TInt aAlphaBits = 0);
+
+    /**
+     * Destructor.
+     */
+    virtual ~CHuiVg10PBufferSurface();
+
+public: // From MHuiRenderSurface
+
+    TUint Flags() const;
+    
+    /**
+     * Determines the location of the rendering surface on the screen. But since
+     * this is an off-screen surface, will return EFalse and will not set the
+     * origin.
+     *
+     * @return  If location successfully determined, returns <code>ETrue</code>.
+     *          If the surface is an off-screen surface, returns <code>EFalse</code>.
+     */
+    TBool GetScreenOrigin(TPoint& aOrigin) const;
+
+    /**
+     * Determines the size of the surface.
+     *
+     * @return  Size of the surface in pixels.
+     */
+    TSize Size() const;
+
+    /**
+     * Changes the size of the surface.
+     *
+     * @param aSize  Size of surface in pixels.
+     */
+    void SetSizeL(const TSize& aSize);
+
+    /**
+     * Makes this the current rendering surface for any drawing operations.
+     * Call CHuiStatic::SetCurrentRenderSurface().
+     */
+    void MakeCurrent();
+
+    /**
+     * Swaps the front and back buffers of the surface.
+     * Pbuffers consist of a single buffer only, so swapping has no effect.
+     */
+    void SwapBuffers();
+
+    /**
+     * Binds a texture to the surface to be used during subsequent drawing
+     * operations.
+     */
+    void BindTexture(TInt aTextureUnit,
+                             const MHuiSegmentedTexture& aTexture,
+                             TInt activeTextureSegment);
+
+    /**
+     * Handles change in surface visibility. This method is called if surface is either
+     * hidden or shown.
+     *
+     * @param aIsVisible ETrue if surface becomes visible. EFalse if surface is hidden.
+     */
+    void HandleVisibilityEvent(TBool aIsVisible);
+
+    void Release();
+    
+    void RestoreL();
+    
+    void HandleDisplayUsageChangeL();    
+
+    // These methods are not really used, since opengles renderer doesn't
+    // support dirty region handling or symbian graphics context!
+    virtual void SetDirtyRect(const TRect& aRect);
+    virtual MHuiTargetBitmap* BackBuffer();
+    virtual CFbsBitGc* Gc();
+
+    /**
+     * Provides expandability, helps keeping the binary compatibility. Since virtual
+     * table is now exported and this class is dll derivable and the implementation
+     * is more difficult to change, hence this method, which can provide additional
+     * extension APIs.
+     * 
+     * @param aExtensionUid     UID, which is being used for recognizing the extension
+     * @param aExtensionParams  Return pointer to the extension API, once recognized from the extension uid
+     */
+    virtual void RenderSurfaceExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+public: // New methods
+
+    /**
+     * Returns the associated EGL surface object.
+     */
+    EGLSurface EglSurface();
+    
+	void BindToM3G();
+	
+	void ReleaseFromM3G();
+    
+    /**
+     * \todo
+     */
+    CFbsBitmap* Buffer();
+    
+    /**
+     * \todo
+     */
+    TInt BufferColorMode() const;
+
+
+protected:
+
+    /**
+     * Creates a new PBuffer surface object.
+     */
+    EGLSurface CreateSurface(EGLConfig aConfig);
+
+    /**
+     * Determine config for the owner display.
+     */
+    EGLConfig DetermineConfig();
+
+
+private:
+
+    /* Constructors. */
+
+    /**
+     * Constructs an instance of CHuiClassName.
+     * @param aRenderer    CHuiVg10RenderPlugin object that is used to access 
+     *                     the shared context and determine surface configurations.
+     * @param aSize        Size of the created PBuffer surface.
+     * @note               Protected because this constructor only needs to be 
+     *                     called by derived classes. Use the provided static 
+     *                     factory methods instead.
+     * @see NewL()
+     * @see NewLC()
+     */
+    CHuiVg10PBufferSurface(CHuiVg10RenderPlugin& aRenderer, const TSize& aSize, TInt aAlphaBits, TInt aEglBufferType, TInt aBufferColorMode);
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+
+private:
+
+    /** The display. */
+    EGLDisplay iEglDisplay;
+
+    /** The rendering context. */
+    EGLContext iEglContext;
+
+    /** The pbuffer surface where the graphics are drawn. */
+    EGLSurface iEglSurface;
+
+    /** Current surface size. */
+    TSize iSize;
+
+    /** \todo */
+	TInt iEglBufferType;
+	
+    /** \todo */
+	TInt iBufferColorMode;
+	
+    /** Alpha channel bits to allocate. */
+    TInt iAlphaBits;
+    
+    CFbsBitmap* iBuffer;
+    
+    /** OpenGL ES Render plugin that provides the display configurations and the display
+    for this pbuffer surface. */
+    CHuiVg10RenderPlugin& iRenderer;
+
+    TBool iIsHardwareAccelerated;
+    };
+
+
+#endif // __HUIVG10PBUFFERSURFACE_H__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10RenderPlugin.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,378 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiVg10RenderPlugin. Rendering plugin for OpenVG 1.0.
+*
+*/
+
+
+
+#ifndef __HUIVG10RENDERPLUGIN_H__
+#define __HUIVG10RENDERPLUGIN_H__
+
+
+#include <e32base.h>
+
+#include <EGL/egl.h>
+
+#include <VG/openvg.h>
+
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiMesh.h"
+
+class TEGLState
+    {
+public:
+    EGLContext iContext;
+    EGLSurface iReadSurface;
+    EGLSurface iDrawSurface;
+    EGLDisplay iDisplay;
+    };
+
+/**
+ * OpenVG renderer specific state change flags
+ */
+enum THuiVg10GcStateFlags
+    {
+    EHuiVg10GcStateFlagDirtyMatrixMode      = 1,
+    EHuiVg10GcStateFlagDirtyMatrix          = 2,
+    EHuiVg10GcStateFlagDirtyPaint           = 4,
+    EHuiVg10GcStateFlagDirtyScissor         = 8,
+    EHuiVg10GcStateFlagDirtyScissorRects    = 0x10,
+    EHuiVg10GcStateFlagDirtyBlendMode       = 0x20
+    };
+
+/* Forward declarations. */
+class MHuiRenderSurface;
+class CHuiVg10PBufferSurface;
+#ifdef __NVG
+class CNvgEngine;
+class MVGImageBinder;
+#endif
+
+/** Number of compatible EGL configurations queried. */
+const TInt KVg10ConfigsCount = 2;
+
+/**
+ * Macro for asserting that the renderer's state is OK when entering
+ * a function.
+ */
+#define HUI_VG_INVARIANT() __ASSERT_DEBUG(CHuiVg10RenderPlugin::VgError() == VG_NO_ERROR, THuiPanic::Panic(THuiPanic::EVg10Invariant))
+
+/**
+ * Macro for asserting that the latest OpenVG function call did not
+ * fail. You may put this assert after any OpenVG function call.
+ * Has no effect in release builds.
+ *
+ * @param aPanic  Panic code to use if the assertion fails.
+ *
+ * @see THuiPanic error codes, for at least the ERendererError.
+ */
+#define HUI_VG_ASSERT_SUCCESS(aPanic) __ASSERT_DEBUG(CHuiVg10RenderPlugin::VgError() == VG_NO_ERROR, THuiPanic::Panic(aPanic))
+
+
+/**
+ * Rendering plugin for OpenVG 1.0.
+ *
+ * @todo  GHuiVg10RenderPlugin should be derived from an abstract
+ *        CHuiEglRenderPlugin, which would contain the common EGL-methods.
+ *        OpenVG uses EGL, too.
+ */
+NONSHARABLE_CLASS(CHuiVg10RenderPlugin) : public CHuiRenderPlugin
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructs a new OpenVG 1.0 rendering plugin instance.
+     */
+    static CHuiVg10RenderPlugin* NewL();
+
+    /**
+     * Constructs a new OpenVG 1.0 rendering plugin instance and leaves it
+     * on the cleanup stack.
+     */
+    static CHuiVg10RenderPlugin* NewLC();
+
+
+    /**
+     * Destructor.
+     */
+    virtual ~CHuiVg10RenderPlugin();
+
+
+    /* Methods. */
+
+    TBool Allows(THuiRenderPluginAllow aAllow) const;
+
+    /**
+     * Creates a new rendering surface.
+     *
+     * @param aParams  Parameters for the surface. Ends in EHuiRenderSurfaceNone.
+     */
+    virtual MHuiRenderSurface* CreateRenderSurfaceL(CHuiDisplay& aDisplay);
+
+    /**
+     * Creates a new PBuffer surface for off-screen rendering purposes.
+     *
+     * @param aSize Size of the created PBuffer surface.
+     * @return Pointer to the just created PBuffer surface object.
+     */
+    virtual CHuiVg10PBufferSurface* CreatePBufferSurfaceL(TSize aSize, TInt aEglBufferType = EGL_PBUFFER_BIT, TInt aBufferColorMode = 0);
+
+    /**
+     * Creates a new instance of a HUITK graphics context.
+     */
+    virtual CHuiGc* CreateGcL();
+
+    /**
+     * Creates a new instance of a texture.
+     */
+    virtual CHuiTexture* CreateTextureL(const THuiTextureHandle* aExistingTexture = 0);
+
+    /**
+     * Creates a new instance of a texture manager.
+     */
+    virtual CHuiTextureManager* CreateTextureManagerL(CHuiEnv& aEnv);
+
+    /**
+     * Creates a new instance of an effects engine.
+     */
+    virtual CHuiFxEngine* CreateEffectsEngineL();
+
+
+    /**
+     * Creates a new instance of a mesh. Leaves with KErrNotSupported if this renderer
+     * does not support the given mesh type
+     *
+     * @param aMeshType  CHuiMesh derived concrete mesh type
+     * 
+     * @return  Created concrete mesh implementation.
+     */
+    virtual CHuiMesh* CreateMeshL(THuiMeshType aMeshType);
+
+    /**
+     * Creates a new instance of a text mesh.
+     */
+    virtual CHuiTextMesh* CreateTextMeshL();
+
+    /**
+     * Creates a new instance of a curve path.
+     */
+    virtual CHuiCurvePath* CreateCurvePathL();
+
+    virtual void DeleteNamedTexture(TUint aName);
+
+    /**
+     * Notifies this render plugin of a change in current display count.
+     *
+     * @param aCount The current count of displays existing in the HuiToolkit environment.
+     */
+    virtual void NotifyDisplayCountL(TUint aCount);
+
+    /**
+     * Returns the EGL display currently used by the plugin.
+     */
+    EGLConfig EglDisplay();
+
+    /**
+     * Returns the shared EGL context.
+     *
+     * @param aOtherContext  Context that wants to join the shared context.
+     */
+    EGLContext EglSharedContext() const;
+
+    /**
+     * Sets the shared EGL context.
+     *
+     * @param aContext  Context that is available for sharing with.
+     */
+    void EglSetSharedContext(EGLContext aContext);
+
+    /**
+     * EGL utility method. See eglChooseConfig.
+     *
+     * @return  Number of configurations found.
+     */
+    TInt EglChooseConfig(const TInt* aAttribList);
+
+    /**
+     * EGL utility method. Returns one of the configurations determined by
+     * EglChooseConfig.
+     */
+    TInt EglConfig(TInt aIndex);
+
+    /**
+     * EGL debug method. Prints (using CHuiStatic::Printf) all the attributes of
+     * the specified configuration.
+     */
+    void EglPrintConfig(TInt aIndex);
+
+    /**
+     * Check if the OpenVG context is released. If it is released,
+     * any drawing commands to the context will cause a panic.
+     *
+     * @return ETrue if the OpenVG context has been released.
+     */
+     TBool IsReleased() const;
+
+    /* Static methods. */
+
+    /**
+     * GlErrorMessage returns string description for an OpenVG
+     * error code. Can be used to clarify OpenVG errors when debugging.
+     *
+     * Error codes are from from the OpenVG 1.0 specification, chapter 4.
+     *
+     * @param aErrorCode  OpenVG error code, usually requested by calling
+     *                    vgGetError().
+     * @return  Descriptor with the error message.
+     */
+    static const TDesC& VgErrorMessage(VGErrorCode aErrorCode);
+
+    /**
+     * Returns the latest OpenVG error code. Equivalent to calling vgGetError(),
+     * but also prints the GL error code as a debug message.
+     */
+    static VGErrorCode VgError();
+	
+	/**
+	 * IsHardwareAccelerated returns boolean value if hardware acceleration 
+	 * is available. Also stores value to the iIsHardwareAccelerated variable.
+	 *
+	 * @return  ETrue if hardware accelartion is available
+	 */
+	TBool IsHardwareAccelerated();
+	
+    /**
+     * Creates a new instance of a canvas graphics context.
+     */
+   virtual CHuiCanvasGc* CreateCanvasGcL();
+
+   /**
+    * Used to set flags that describe how the openvg state has changed.
+    */
+   virtual void AddRestoreStateFlags(TInt aFlags);
+   
+   /**
+    * Return the flags, e.g. for vg10gc to reset its state
+    */
+   virtual TInt GetRestoreStateFlags();
+   
+   /**
+    * Clear the stateflags
+    */
+   virtual void ClearRestoreStateFlags();
+   
+#ifdef __NVG
+   /**
+    * Getter for NVGEngine, to be used with NVG drawing inside OpenVG plugin
+    * 
+    * @return   CNvgEngine object
+    */
+   CNvgEngine& NvgEngine() const;
+#endif
+
+	/**
+	*  Getter for texture upload context. This is called by CHuiVg10Texture.
+	*/
+    TEGLState& GetUploadState()
+	    {
+	    return iEGLStateForTextureUpload;
+	    }
+	
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Default constructor.
+     */
+    CHuiVg10RenderPlugin(THuiRenderPluginId aId = EHuiRenderPluginVg10);
+
+    /**
+     * Second-phase constructor. Basicly calls RestoreL().
+     */
+    void ConstructL();
+
+    /**
+     * Release resources associated with EGL and OpenVG.
+     * Also, will destroy the default render surface used
+     * for sharing resources.
+     *
+     * @see RestoreL()
+     */
+    virtual void Release();
+
+    /**
+     * Restores resources needed for EGL/OpenVG rendering.
+     * Finds an EGL display, initializes it for rendering
+     * and restores a default shared render surface that
+     * enables resources to be loaded without an existing
+     * CHuiDisplay.
+     */
+    virtual void RestoreL();
+
+private:
+    
+    void ReadAllowsSwapBufferPreserved();
+    void ReadAllowsVisualPBufferSurfaces();
+        
+private:
+
+    /** The display where the graphics are drawn. */
+    EGLDisplay iEglDisplay;
+
+    /** Describes the format, type and size of the color buffers and
+        ancillary buffers for EGLSurface. */
+    EGLConfig iConfigs[KVg10ConfigsCount];
+
+    /**
+     * EGL Context for shared resources. This will allow us to
+     * for instance preload and create textures before actual
+     * rendering surface exists.
+     */
+    EGLContext iSharedContext;
+
+    /**
+     * Dummy PBuffer surface to be used with default context before any
+     * other rendering surfaces exist.
+     */
+    CHuiVg10PBufferSurface* iDefaultRenderSurface;
+
+    TBool iIsHardwareAccelerated;
+    
+    /**
+     * Member that stores the changed flags
+     */
+	TInt iStateFlags;
+    
+#ifdef __NVG
+    /** NVG decoder for plugin classes to use **/
+    CNvgEngine* iNvgEngine;
+    /** Image binder for NVG-TLV "Group opacity" special case */
+    MVGImageBinder* iMVGImageBinder;
+#endif
+    
+    TBool iAllowsSwapBufferPreserved;
+    TBool iAllowsVisualPBufferSurfaces;
+    
+	// This is initialized by CHuiVg10Texture during first texture upload
+    TEGLState iEGLStateForTextureUpload;
+    
+    };
+
+
+#endif // __HUIVG10RENDERPLUGIN_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10RenderSurface.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,188 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   OpenVG 1.0 render surface.
+*
+*/
+
+
+
+#ifndef __HUIVG10RENDERSURFACE_H__
+#define __HUIVG10RENDERSURFACE_H__
+
+
+#include <e32base.h>
+
+#include <EGL/egl.h>
+
+#include "HuiRenderSurface.h"
+#include "uiacceltk/HuiSessionObject.h"
+
+
+/* Forward declarations. */
+class CHuiDisplay;
+
+
+/**
+ * The render surface is a destination where rendered graphics will ultimately
+ * end up. This may be, e.g., the display frame buffer or a bitmap in memory.
+ */
+NONSHARABLE_CLASS(CHuiVg10RenderSurface) : public CBase, public MHuiRenderSurface,
+                                           public MHuiSessionObject
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    static CHuiVg10RenderSurface* NewL(CHuiDisplay& aDisplay);
+
+    static CHuiVg10RenderSurface* NewLC(CHuiDisplay& aDisplay);
+
+    virtual ~CHuiVg10RenderSurface();
+
+
+    /* Methods, implemets MHuiRenderSurface interface. */
+
+    TUint Flags() const;
+    
+    TBool GetScreenOrigin(TPoint& aOrigin) const;
+
+    TSize Size() const;
+
+    void SetSizeL(const TSize& aSize);
+
+    virtual void MakeCurrent();
+
+    virtual void SwapBuffers();
+
+    virtual void BindTexture(TInt aTextureUnit,
+                             const MHuiSegmentedTexture& aTexture,
+                             TInt aSegment);
+
+    /**
+     * Handles change in surface visibility. This method is called if surface is either
+     * hidden or shown. This default implementation ignores visibility events.
+     *
+     * @param aIsVisible ETrue if surface becomes visible. EFalse if surface is hidden.
+     */
+    virtual void HandleVisibilityEvent(TBool aIsVisible);
+
+    virtual void Release();
+
+    virtual void RestoreL();
+
+    virtual void HandleDisplayUsageChangeL();
+    
+    // These methods are not really used, since opengles renderer doesn't
+    // support dirty region handling or symbian graphics context!
+    virtual void SetDirtyRect(const TRect& aRect);
+    virtual MHuiTargetBitmap* BackBuffer();
+    virtual CFbsBitGc* Gc();
+
+    /**
+     * Provides expandability, helps keeping the binary compatibility. Since virtual
+     * table is now exported and this class is dll derivable and the implementation
+     * is more difficult to change, hence this method, which can provide additional
+     * extension APIs.
+     * 
+     * @param aExtensionUid     UID, which is being used for recognizing the extension
+     * @param aExtensionParams  Return pointer to the extension API, once recognized from the extension uid
+     */
+    virtual void RenderSurfaceExtension(const TUid& aExtensionUid, TAny** aExtensionParams);
+
+    /**
+     * Static method for returning verbose error message strings according to the given
+     * EGL error value. This can be used to create meaningful error messages in
+     * HUIToolkit environments that use OpenVG rendering.
+     *
+     * @param aErrorCode EGL Error code retrieved by eglGetError - method.
+     * @return Verbose error message as a TDesC reference object.
+     */
+    static const TDesC& EglErrorMessage(TInt aErrorCode);
+
+    // Implementation of MHuiSessionObject
+    
+    /**
+     * Gets the object type.
+     */
+    TType Type() const;
+
+    /**
+     * Gets the session id for object.
+     */
+    TInt SessionId() const;
+
+    /**
+     * Sets the session id for object.
+     */
+    void SetSessionId(TInt aSessionId);
+    
+    /**
+     *  @return the currently bound texture image.
+     */
+    const MHuiSegmentedTexture* BoundTexture() const;
+
+protected:
+
+    /* Constructors. */
+
+    CHuiVg10RenderSurface(CHuiDisplay& aDisplay);
+
+    void ConstructL();
+
+    /**
+     * Determines the display to which this rendering surface is attached.
+     *
+     * @return  Display.
+     */
+    CHuiDisplay& Display() const;
+
+    /**
+     * Determine config for the owner display.
+     */
+    EGLConfig DetermineConfig();
+
+    /**
+     * Create an EGL rendering surface.
+     */
+    EGLSurface CreateSurface(EGLConfig aConfig);
+
+
+protected:
+
+    /** Display that owns the surface. */
+    CHuiDisplay* iDisplay;
+
+    /** The display. */
+    EGLDisplay iEglDisplay;
+
+    /** The rendering context. */
+    EGLContext iEglContext;
+
+    /** The window where the graphics are drawn. */
+    EGLSurface iEglSurface;
+
+    /** Size of the rendering surface. */
+    TSize iSize;
+    
+    /** The currently bound texture */
+    const MHuiSegmentedTexture* iBoundTexture;
+
+private:
+    /** Session id */
+    TInt iSessionId;
+    
+    };
+
+
+#endif // __HUIVG10RENDERSURFACE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10Texture.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,365 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines CHuiVg10Texture, an OpenVG-based texture class.
+*
+*/
+
+
+
+#ifndef __HUIVG10TEXTURE_H__
+#define __HUIVG10TEXTURE_H__
+
+
+#include <bldvariant.hrh>
+#include <e32base.h>
+#include <e32std.h>
+#include <gdi.h>
+#include <VG/openvg.h>
+
+#include "uiacceltk/HuiTexture.h"
+#include "uiacceltk/HuiTextureHandle.h"
+#include "HuiVg10RenderPlugin.h"
+
+#ifdef __NVG
+    #include <AknIconHeader.h>
+    class CNvgEngine;
+    class MNVGIcon;
+#endif
+
+/**
+ * CHuiVg10Texture wraps an OpenVG texture object. It provides methods 
+ * for uploading image data. When an instance of CHuiVg10Texture is 
+ * destroyed, the OpenVG texture object is deleted as well.
+ *
+ * @todo  Proper segment support. Support more than two segments.
+ * @todo  Placeholder should be a THuiTextureHandle.
+ */
+NONSHARABLE_CLASS(CHuiVg10Texture) : public CHuiTexture
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructs a new texture object. The texture has no segments initially.
+     *
+     * @param   aRenderPlugin The render plugin that created this texture.
+     * @return  Texture object.
+     */
+    static CHuiVg10Texture* NewL(CHuiVg10RenderPlugin& aRenderPlugin, const THuiTextureHandle* aExistingTexture = 0);
+
+    /**
+     * Constructs a new texture object and leaves it on the cleanup stack.
+     * The texture has no segments initially.
+     *
+     * @param   aRenderPlugin The render plugin that created this texture.
+     * @return  Texture object.
+     */
+    static CHuiVg10Texture* NewLC(CHuiVg10RenderPlugin& aRenderPlugin, const THuiTextureHandle* aExistingTexture = 0);
+
+
+    /** @beginAPI */
+
+    /**
+     * Destructor.
+     */
+    virtual ~CHuiVg10Texture();
+
+
+    /* Methods. */
+    
+    TBool HasContent() const; // override
+
+    /**
+     * Determines if the texture has an alpha channel.
+     *
+     * @return  <code>ETrue</code>, if the texture has an alpha channel.
+     *          Otherwise, <code>EFalse</code>.
+     */
+    TBool HasAlpha() const;
+
+    /**
+     * Determines the maximum possible actual (OpenVG) size for
+     * textures. This limit is usually set by the underlying 
+     * graphics driver/hardware.
+     * @todo should be moved out?
+     */
+    TSize MaxTextureSize() const;
+
+    void UploadL(const CFbsBitmap& aBitmap,
+                 const CFbsBitmap * aMaskBitmap = NULL,
+                 THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault);
+
+    void UploadL(THuiTextureFormat aFormat,
+                 const TSize& aSize,
+                 const TUint8* aBuffer,
+                 THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault,
+                 TUint aBufferSize = 0);
+
+    void PartialUploadL(THuiTextureFormat aFormat,
+                        const TPoint& aOrigin,
+                        const TSize& aSize,
+                        const TUint8* aBuffer);
+
+    void SegmentUploadL(TInt aSegment,
+                        const CFbsBitmap& aBitmap,
+                        const CFbsBitmap * aMaskBitmap = NULL,
+                        THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault);
+
+    void SegmentUploadL(TInt aSegment,
+                        THuiTextureFormat aFormat,
+                        const TSize& aSize,
+                        const TUint8* aBuffer,
+                        TUint aBufferSize = 0);
+
+    void SegmentPartialUpload(TInt aSegment,
+                              THuiTextureFormat aFormat,
+                              const TPoint& aOrigin,
+                              const TSize& aSize,
+                              const TUint8* aBuffer);
+
+    void SegmentClearL(TInt aSegment,
+                       TBool aWithAlpha,
+                       const TRgb& aColor,
+                       TUint8 aAlpha);
+
+    void SetupSegmentsL(const TSize& aLogicalSize,
+                        const TSize& aTextureSize,
+                        THuiTextureUploadFlags aFlags = EHuiTextureUploadFlagDefault);
+
+    /** @endAPI */
+
+    /**
+     * Delete the texture.
+     */
+    void Reset();
+
+    void EnableShadow(TBool aEnable = ETrue);
+
+    TBool IsShadowEnabled() const;
+
+    TBool GetShadowTexture(THuiTextureHandle& aHandle) const;
+    
+#ifdef __NVG
+    /**
+     * Creates a normal texture with the VGImage from extended texture
+     * 
+     * @param   aNvgEngine  Used to draw the extended bitmap data on the VGImage, if ObjectCached icon wasn't found
+     * @param   aDestSize   Destination size for the VGImage
+     * @return  Handle to the rasterized image or <code>VG_INVALID_HANDLE</code> if something went wrong.
+     */ 
+    VGImage CreateRenderedImage(CNvgEngine* aNvgEngine, HBufC8* aNVGData, const TSize& aDestSize);
+    
+    /** 
+     * Identifies whether this texture contains extended texture data
+     */
+    TBool IsExtended() const;
+    
+    /**
+     * Gets the extended texture data. Prefer the GetIconCommandsData() instead.
+     * 
+     * @return  The OpenVG command buffer for the texture
+     */
+    HBufC8* GetExtendedTextureData() const;
+    
+    /**
+     * Gets the VG ObjectCached NVG icon, which can be drawn directly by calling the DrawL() method 
+     * 
+     * @return  The OpenVG Object Cached NVG icon
+     */
+    MNVGIcon* GetIconCommandsData() const;
+#endif
+    
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor. Creates a new texture object with no texture maps.
+     */
+    CHuiVg10Texture(CHuiVg10RenderPlugin& aRenderPlugin);
+
+    /**
+     * Second-phase constructor.
+     * @param   aRenderPlugin The render plugin that created this texture.     
+     */
+    void ConstructL(const THuiTextureHandle* aExistingTexture);
+
+
+    /* Methods. */
+
+    /**
+     * Deallocate resources associated with segment. Will free
+     * all resources associated with a texture segment.
+     * @see SetSegmentCount()
+     */
+    virtual void ResetSegment(TInt aSegment);
+
+    /**
+     * Initialize segment for holding texture data. Allocate texture name etc.
+     */
+    virtual void InitSegmentL(TInt aSegment);
+
+    // from MHuiTexture
+    
+    void TextureExtension(const TUid& aExtensionUid, TAny** aExtensionParameters); 
+
+private:
+    /**
+     *  Define the contents of an image using raw data.
+     * 
+     *  @param aCreateImage If ETrue, a new image is created, otherwise an existing image is updated.
+     * 
+     *  @see SegmentPartialUpload
+     */
+    void SegmentPartialUploadInternal(TInt aSegment, THuiTextureFormat aFormat, const TPoint& aOrigin,
+                                      const TSize& aSize, const TUint8* aBuffer, TBool aCreateImage);
+
+
+    /**
+     *  Generate a shadow for this texture if shadowing is enabled.
+     */
+    void GenerateShadowL();
+    
+    /**
+     *  Make sure the shadow texture is of the proper dimensions.
+     */
+    void UpdateShadowSizeL(const TSize& aSize);
+    
+    /** The render plugin that created this texture. */
+    CHuiVg10RenderPlugin& iRenderPlugin;
+    
+    /** Flags indicating the state of the image object */
+    TInt iInternalFlags;
+    
+    /** Shadow texture */
+    THuiTextureHandle iShadow;
+    
+    /** Should a shadow texture be generated */
+    TBool iShadowEnabled;
+    
+#ifdef __NVG
+    /**
+     * Reads the NVG data from the extended CFbsBitmap
+     * 
+     * @param   aBitmap The extended bitmap, which carries the NVG data to be read
+     * @return  The read NVG data in a 8-bit descriptor
+     */
+    HBufC8* ReadNVGDataL(const CFbsBitmap& aBitmap);
+    
+    /**
+     * Compares two NVG data buffers. Ignores the iconheader part.
+     */
+    TInt CompareNvgData(HBufC8* aNVGData1, HBufC8* aNVGData2);
+    
+    /**
+     * Uploads the NVG data into the texture.
+     * 
+     * @param aBitmap The bitmap that is to be uploaded. Includes the extended NVG data.
+     * @param aFlags Texture upload flags, either EHuiTextureUploadFlagUsePureNvg => upload as object cached NVG. Otherwise will be rasterized into VGImage.
+     */
+    void SegmentUploadNvgL(const CFbsBitmap& aBitmap, const CFbsBitmap* aMaskBitmap, THuiTextureUploadFlags aFlags);
+    
+    /**
+     * Create the Object cached icon out of the NVG data. Does the parsing of the icon header as well.
+     */
+    void CreateObjCachedNVGIconL();
+    
+    /**
+     * Parses the NVG icon header out of the NVG data.
+     * 
+     * @param   aNVGData The NVG formatted data, from which to parse the icon header
+     * @return  The iconheader information
+     */
+    TAknIconHeader GetNvgIconHeader(HBufC8* aNVGData);
+
+    /**
+    * This method has to be called before calling nvgEngine->DrawNvg().
+    * 
+    * @param   aNVGData Nvg data buffer
+    * @return  Descriptor to the NVG data without the additional header information.
+    */
+    TPtr8 GetNvgDataWithoutHeader(HBufC8* aNVGData);
+    
+    /**
+     * Sets the NVG icon aspect ratio and rotation (from the NVG icon header).
+     * 
+     * @param   aNvgEngine NvgEngine instance used for setting the aspect ratio.
+     * @param   aNVGData Nvg data buffer
+     * @param   aIgnoreAspectRatio Use this, if you want to set the rotation, but ignore the aspect ratio.
+     */
+    void SetNvgParamsFromIconHeader(CNvgEngine& aNvgEngine, HBufC8* aNVGData);
+    
+    /**
+     * Calculates new iconsize that will have at least the required 12% margin.
+     * 
+     * @param   aVgImage Image that has been rasterized from the NvgData, used for determining if there's enough margin or not
+     * @param   aSize Size for drawing the image. Used as a base for margin calculations.
+     * @param   aDisplay EGLDisplay, needed for making the VGImage based ClientPBuffer current again.
+     * @param   aSurface EGLSurface, -||-
+     * @param   aContext EGLContext, -||-
+     * @return  New size with the correct margin.
+     */
+    TSize ApplyMargin(VGImage aVgImage, TSize aSize, EGLDisplay aDisplay, EGLSurface aSurface, EGLContext aContext);
+    
+    /**
+     * Sets the color for the icon, if such is defined in the icon header.
+     * 
+     * @param   aSrcImage Image that has been rasterized from the NvgData, used as a source for the color transformation.
+     *          Will be replaced by the new image got from transformation.
+     * @param   aSize Size for creating destination image.
+     * @param   aColor Color from the iconheader, used to fill the icon with it.
+     */
+    void SetIconColor(VGImage& aSrcImage, TSize aSize, TUint32 aColor);
+    
+    /**
+     * Replaces the alpha channel information within aImage, with the alpha mask
+     * information from the aMaskImage. Both images have to be in VG_sARGB_8888 format.
+     * 
+     * @param   aImage VGImage, which's alpha channel is to be replaced.
+     * @param   aMaskImage a mask VGImage.
+     * @param   aSize Size of the images.
+     */
+    void ReplaceVGImageAlphaChannelL(VGImage aImage, VGImage aMaskImage, TSize aSize);
+    
+    /*
+     * Assertains that all texture uploads are done into the same EGL context as the first upload.
+     * Changes context if necessary.
+     */
+    void PushEGLContext();
+    
+    /*
+     * Rolls back to the previous EGL context, if necessary.
+     */
+    void PopEGLContext();
+    
+	// Rolling back to state for PopEGLContext
+    TEGLState iPreviousEGLState;
+    
+    /** Identifies whether this texture has extended bitmap NVG data **/
+    TBool iIsExtended;
+    
+    /** Carries the extended NVG data, if any **/
+    HBufC8* iNVGData;
+    
+    /** 
+     * Stores the ObjectCached VG commands, which are ready to be drawn without
+     * the need to parse the NVG data and create the VG objects again
+     */
+    MNVGIcon* iIconCommands;
+#endif
+    
+    };
+
+#endif  // __HUIVG10TEXTURE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10TextureManager.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#ifndef __HUIVG10TEXTUREMANAGER_H__
+#define __HUIVG10TEXTUREMANAGER_H__
+
+
+#include "uiacceltk/HuiTextureManager.h"
+
+enum TBitmapCopyMode
+    {
+    /** Bitmap handle can be duplicated, no data copying takes place */
+    EAllowDuplication,
+    /** Always create a new bitmap copy */
+    EAlwaysCopy,
+    };
+
+
+/**
+ * Texture manager specialized for OpenGL ES.
+ */
+NONSHARABLE_CLASS(CHuiVg10TextureManager) : public CHuiTextureManager
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructs a new texture manager instance.
+     */
+    static CHuiVg10TextureManager* NewL(CHuiEnv& aEnv);
+    
+    /**
+     * Constructs a new texture manager instance and leaves it on 
+     * the cleanup stack.
+     */
+    static CHuiVg10TextureManager* NewLC(CHuiEnv& aEnv);
+
+    /**
+     * Destructor.
+     */
+    virtual ~CHuiVg10TextureManager();
+
+    /**
+     *  Bitmap color mode conversion.
+     *
+     *  @param aBitmap      Source bitmap to convert.
+     *  @param aDisplayMode Target display mode.
+     *  @param aCopyMode    Desired copy behavior.
+     *  @return a reference to a bitmap with the desired display mode. DOES NOT transfer the ownership!
+     */
+    CFbsBitmap& ConvertBitmapL(const CFbsBitmap& aBitmap, TDisplayMode aDisplayMode, TBitmapCopyMode aCopyMode = EAllowDuplication, TSize aNewSize = TSize(0,0));
+    
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor.
+     */
+    CHuiVg10TextureManager(CHuiEnv& aEnv);
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+private:
+
+    // Member variables needed for bitmap color mode conversion
+    CFbsBitmap*         iBitmap16MA;
+    CFbsBitmap*         iBitmap16MU;
+    CFbsBitmap*         iBitmap64K;
+    CFbsBitmap*         iBitmap256Gray;
+    
+    CFbsBitmapDevice*   iBitmapDevice16MA;
+    CFbsBitmapDevice*   iBitmapDevice16MU;
+    CFbsBitmapDevice*   iBitmapDevice64K;
+    CFbsBitmapDevice*   iBitmapDevice256Gray;
+    
+    CFbsBitGc*          iBitGc16MA;
+    CFbsBitGc*          iBitGc16MU;
+    CFbsBitGc*          iBitGc64K;
+    CFbsBitGc*          iBitGc256Gray;
+    };
+
+#endif  // __HUIVG10TEXTUREMANAGER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10TextureProcessor.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiVg10TextureProcessor. 
+*                CHuiVg10TextureProcessor is a concrete implementation of 
+*                a texture processor for OpenVG 1.0.
+*
+*/
+
+
+
+#ifndef __HUIVG10TEXTUREPROCESSOR_H__
+#define __HUIVG10TEXTUREPROCESSOR_H__
+
+
+#include "uiacceltk/HuiTextureProcessor.h"
+
+
+/* Forward declarations. */
+class CHuiVg10PBufferSurface;
+
+
+/**
+ * Texture processor implementation for OpenVG.
+ */
+NONSHARABLE_CLASS(CHuiVg10TextureProcessor) : public CHuiTextureProcessor
+    {
+public:
+
+    /* Constructors and destructor. */
+
+    /**
+     * Constructs a new texture manager instance.
+     */
+    static CHuiVg10TextureProcessor* NewL(CHuiEnv& aEnv);
+    
+    /**
+     * Constructs a new texture manager instance and leaves it on 
+     * the cleanup stack.
+     */
+    static CHuiVg10TextureProcessor* NewLC(CHuiEnv& aEnv);
+
+    /**
+     * Destructor.
+     */
+    virtual ~CHuiVg10TextureProcessor();
+    
+    
+    /* Methods. */
+    
+    virtual void BlurL(const THuiTextureHandle& aSrc, THuiTextureHandle& aDest,
+                       TInt aFilterSize, TInt aFlag);
+
+    virtual void BlurL(const THuiTextureHandle& aSrc, THuiTextureHandle& aDest,
+                       const TSize& aPreferredSize,
+                       TInt aFilterSize, TInt aFlag);
+    virtual void BlurSegmentedL(const MHuiSegmentedTexture& aSrc,
+                       THuiTextureHandle& aDest,
+                       TInt aFilterSize, TInt aFlags); 
+    
+    virtual void BlurSegmentedL(const MHuiSegmentedTexture& aSrc, 
+                       THuiTextureHandle& aDest,
+                       const TSize& aPreferredSize,
+                       TInt aFilterSize, TInt aFlags);                       
+protected:
+
+    /* Constructors. */
+
+    /**
+     * Constructor.
+     */
+    CHuiVg10TextureProcessor(CHuiEnv& aEnv);
+
+    /**
+     * Second-phase constructor.
+     */
+    void ConstructL();
+
+
+    /* Methods. */
+    
+    /**
+     * Renders a blurred texture into the processing buffer. BlurL() calls this
+     * one or more times to produce the final blurred result.
+     *
+     * @param aBlurConfigPtr  Pointer to a THuiBlurConfig struct, which holds 
+     *                        the parameters of the blurring filter. Note that
+     *                        this is an internal struct defined only in the
+     *                        implementation of CHuiVg10TextureProcessor.
+     * @param aSrc  Source texture.
+     * @param aDestTextureName  Name of the OpenVG texture where the blurred
+     *                          result will be stored.
+     * @param aFlags  The same flags that were used in the call to BlurL().
+     */
+    void DrawBlurred(const TAny* aBlurConfigPtr, 
+                     const THuiTextureHandle& aSrc, 
+                     TUint aDestTextureName,
+                     TInt aFlags);
+
+    /**
+     * Combines two textures so that the end result is an average of both.
+     * The resulting texture uses the same size as the source textures.
+     * Used as part of BlurL() to produce a higher-quality blurring effect.
+     *
+     * @param aSrcTextureName1  Name of the first source texture.
+     * @param aSrcTextureName2  Name of the second source texture.
+     * @param aDestTextureName  Name of the destination texture.
+     * @param aSize  Size of all the three textures.
+     * @param aFlags  The same flags that were used in the call to BlurL().
+     */
+    void DrawAverage(TUint aSrcTextureName1, 
+                     TUint aSrcTextureName2,
+                     TUint aDestTextureName,
+                     const TSize& aSize,
+                     TInt aFlags);
+
+    void Release();
+    
+    void RestoreL();                     
+
+private:
+    };
+
+
+#endif  // __HUIVG10TEXTUREPROCESSOR_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/HuiVg10VgImageBinder.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiVg10VGImageBinder
+*
+*/
+
+#ifndef HUIVG10VGIMAGEBINDER_H_
+#define HUIVG10VGIMAGEBINDER_H_
+
+#include <e32base.h>
+#include <e32def.h>
+#include <VG/openvg.h>
+#include <EGL/egl.h>
+#include <MVGImageBinder.h>
+
+// Forward declarations
+class CHuiVg10RenderPlugin;
+
+/**
+ * Implementation class for MVGImageBinder API.
+ * 
+ * This class is being used for providing the NVGDecoder the necessary
+ * implementation for handling NVG-TLV special case "Group opacity"
+ */
+class CHuiVg10VgImageBinder : public CBase, public MVGImageBinder
+    {
+public:
+
+    /**
+     * Constructor.
+     */
+    static CHuiVg10VgImageBinder* NewL(CHuiVg10RenderPlugin* aRenderPlugin);
+
+    /**
+     * Destructor.
+     */
+    virtual ~CHuiVg10VgImageBinder();
+
+    /**
+     * From MVGImageBinder, creates a new PBufferFromClientBuffer
+     * surface from the given parameter (of type VGImage)
+     * 
+     * @param   aBuffer A Buffer identifier (VGImage handle), used to create the surface
+     * @return  Error code
+     */
+    TInt BindClientBuffer(TUint aBuffer);
+
+    /**
+     * From MVGImageBinder, unbinds the PBufFromCliBuf & restores the previous surface
+     * 
+     * @return  Error code
+     */
+    TInt UnBindClientBuffer();
+
+    
+private:    // Methods
+    
+    /**
+    * Constructor.
+    */
+   CHuiVg10VgImageBinder(CHuiVg10RenderPlugin* aRenderPlugin);
+
+   /**
+    * 2nd phase constructor
+    */
+   void ConstructL();
+    
+   
+private:    // Data
+
+    /** NOT Owned! **/
+    CHuiVg10RenderPlugin* iRenderPlugin;
+    
+    EGLSurface iEglPBufferSurface_Client;
+    EGLSurface iSavedDrawSurface;
+    EGLSurface iSavedReadSurface;
+
+    EGLContext iContext;
+    EGLContext iSavedContext;
+    };
+
+#endif /* HUIVG10VGIMAGEBINDER_H_ */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/huivg10canvasgc.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiCanvasGc
+*
+*/
+
+
+
+#ifndef __HUIVG10CANVASGC_H__
+#define __HUIVG10CANVASGC_H__
+
+
+#include <e32base.h>
+#include <uiacceltk/HuiVisual.h>
+#include "huicanvasgc.h"
+
+
+/* Forward declarations. */    
+
+class CHuiVg10CanvasGc : public CHuiCanvasGc
+    {
+public:
+
+    CHuiVg10CanvasGc();
+    ~CHuiVg10CanvasGc();
+    void DoDrawPolygon(RArray<THuiRealPoint>& aPoints);
+    void DoDrawEllipse(const THuiRealRect& aDestinationRect);
+    void DoDrawArc(const THuiRealRect& aDestinationRect, const THuiRealPoint& aStart, const THuiRealPoint& aEnd);
+    void DoDrawPie(const THuiRealRect& aDestinationRect, const THuiRealPoint& aStart, const THuiRealPoint& aEnd);
+    void DoDrawRoundRect(const THuiRealRect& aDestinationRect, const THuiRealSize& aSize);
+    void DoDrawRenderBuffer(const CHuiCanvasRenderBuffer& aImage, const THuiRealPoint& aDestinationPoint);
+    void DoClearRenderBuffer( CHuiCanvasRenderBuffer& aImage, const TRect & aRect );
+    void DoDrawRects(RArray<THuiRealRect>& aRects);
+
+    void DrawEllipse(const THuiRealRect& aDestinationRect);
+    
+    void ClearWithSkinBackground(const THuiRealRect& aRect);
+    void ClearWithBackgroundItems(const THuiRealRect& aRect, const RArray<THuiDisplayBackgroundItem>& aItems);
+    TInt MaxNumberOfClipRects() const;
+    CHuiCanvasRenderBuffer* CreateRenderBufferL(const TSize& aSize);
+
+    void RestoreFlaggedState() const;
+    
+private: // New
+    
+    void DoDrawPieAndArc(const THuiRealRect& aDestinationRect, 
+          const THuiRealPoint& aStart, const THuiRealPoint& aEnd, TBool aIsPie);
+    };
+
+#endif        
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/inc/huivg10canvasrenderbuffer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiVg10CanvasRenderBuffer
+*
+*/
+
+
+
+#ifndef HUIVG10CANVASRENDERBUFFER_H_
+#define HUIVG10CANVASRENDERBUFFER_H_
+
+
+#include <e32base.h>
+#include <VG/openvg.h>
+#include <EGL/egl.h>
+#include "huicanvasrenderbuffer.h"
+#include "uiacceltk/HuiGc.h"
+#include "HuiVg10RenderPlugin.h"
+    
+/* Forward declarations. */    
+class CHuiRenderPlugin;
+
+NONSHARABLE_CLASS (CHuiVg10CanvasRenderBuffer) : public CHuiCanvasRenderBuffer
+    {
+public:
+
+    /**
+     * Constructor.
+     */
+    CHuiVg10CanvasRenderBuffer();
+
+    /**
+     * Destructor.
+     */ 
+    ~CHuiVg10CanvasRenderBuffer();
+    
+    
+public: // From CHuiCanvasRenderBuffer    
+
+    /**
+     * Initializes render buffer.
+     */
+    void InitializeL(const TSize& aSize);
+    
+    /**
+     * Releases render target resources.
+     */
+    void UnInitialize();
+    
+    /**
+     * Binds as render buffer.
+     */ 
+    void Bind();
+    
+    /**
+     * Unbinds as render target and restores the previous target.
+     */ 
+    void UnBind();
+    
+    /**
+     * Copies content from the given buffer
+     */ 
+    void Copy(const CHuiCanvasRenderBuffer& aSourceBuffer);    
+
+    /**
+     * Copies content from the active surface.
+     */ 
+    void Copy(TPoint aPoint);    
+    
+public:
+    
+    VGImage Image() const;
+    
+private:
+    
+    void PushEGLContext();
+    void PopEGLContext();
+    void ReadBackground(TPoint aPosition);
+        
+private:
+ 
+    CHuiGc*                 iGc;
+    VGImage                 iImage;
+    VGImage                 iRotatedImage;
+    EGLContext              iContext;
+    EGLSurface              iSurface;    
+    EGLContext              iSavedContext;
+    EGLSurface              iSavedReadSurface;
+    EGLSurface              iSavedDrawSurface;
+    TEGLState               iPreviousEGLState;
+    };
+
+#endif /* HUIVG10CANVASRENDERBUFFER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/200184B7.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2001 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Resource definitions for project ?myapp
+*
+*/
+
+
+
+NAME VG10
+
+#include <registryinfo.rh>
+
+// ---------------------------------------------------------------------------
+// HuiRendererPluginInformation
+// Data structure for ECOM framework
+// ---------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO HuiRendererPluginInformation
+    {
+    dll_uid = 0x200184B7; // dll uid3
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            // Renderer Plugin interface UID, KUidHuiRenderPluginBase
+            interface_uid = 0x200113D4;
+            implementations =
+                {
+                // OpenVG 1.0
+                IMPLEMENTATION_INFO
+                    {
+                    // OpenVg10 Renderer implementation UID
+                    implementation_uid = 0x200184B8;
+                    version_no = 1;
+                    display_name = "OpenVG10||Implements a Renderer Plug-in";
+                    default_data = "2";     // Vg10 = 2, from HuiRenderer.h
+                    opaque_data = "";
+                    }
+                };
+            }
+        };
+    }
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10BevelFilter.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxVg10BevelFilter.h"
+#include "HuiFxVg10RenderbufferBase.h"
+#include "HuiFxConstants.h"
+
+CHuiFxVg10BevelFilter* CHuiFxVg10BevelFilter::NewL()
+    {
+    CHuiFxVg10BevelFilter* self = new (ELeave) CHuiFxVg10BevelFilter();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+void CHuiFxVg10BevelFilter::ConstructL()
+    {
+    CHuiFxFilter::ConstructL();
+    iOutlineX = 1.0;
+    iOutlineY = 1.0;
+    iSteepness = 20.0;
+/*    iRed = 0.0f;
+    iGreen = 0.0f;
+    iBlue = 0.0f;*/
+    RegisterParameterL(KLitOutlineX, &iOutlineX);
+    RegisterParameterL(KLitOutlineY, &iOutlineY);
+    RegisterParameterL(KLitSteepness, &iSteepness);
+/*    RegisterParameterL(KLitRed, &iRed);
+    RegisterParameterL(KLitGreen, &iGreen);
+    RegisterParameterL(KLitBlue, &iBlue);*/
+    }
+CHuiFxVg10BevelFilter *CHuiFxVg10BevelFilter::CloneL() const
+    {
+    CHuiFxVg10BevelFilter *filter = new(ELeave)CHuiFxVg10BevelFilter;
+    filter->CHuiFxFilter::CopyFromL(this);
+    filter->iOutlineX = iOutlineX;
+    filter->iOutlineY = iOutlineY;
+    filter->iSteepness = iSteepness;
+    filter->CopyParameterL(KLitOutlineX, &filter->iOutlineX, this);
+    filter->CopyParameterL(KLitOutlineY, &filter->iOutlineY, this);
+    filter->CopyParameterL(KLitSteepness, &filter->iSteepness, this);
+    return filter;
+    }
+
+void CHuiFxVg10BevelFilter::DrawEffect(CHuiFxEngine& aEngine, VGImage aTargetImage, VGImage aSourceImage, TInt aWidth, TInt aHeight)
+    {
+    VGfloat outline_x = clamp(iOutlineX, EPSILON, 128.0f);
+    VGfloat outline_y = clamp(iOutlineY, EPSILON, 128.0f);
+    VGubyte steepness = (VGubyte)clamp(iSteepness, 0.0f, 255.0f);
+//    VGint width = vgGetParameteri(aSourceImage, VG_IMAGE_WIDTH);
+//    VGint height = vgGetParameteri(aSourceImage, VG_IMAGE_HEIGHT);
+    VGint width = aWidth;
+    VGint height = aHeight;
+
+    if((outline_x > EPSILON && outline_y > EPSILON) || steepness == 0) 
+        {
+        // get an aux buffer
+        CHuiFxRenderbuffer* aux1Buffer = aEngine.AcquireRenderbuffer(TSize(width, height));
+        CHuiFxRenderbuffer* aux2Buffer = aEngine.AcquireRenderbuffer(TSize(width, height));
+        if (!aux1Buffer || !aux2Buffer) // can't render the effect
+            {
+            return;
+            }
+        aux1Buffer->BindAsTexture(ERenderbufferUsageReadWrite);
+        aux2Buffer->BindAsTexture(ERenderbufferUsageReadWrite);
+        
+        VGImage aux1Image = (reinterpret_cast<CHuiFxVg10RenderbufferBase*>(aux1Buffer)->Image());
+        VGImage aux2Image = (reinterpret_cast<CHuiFxVg10RenderbufferBase*>(aux2Buffer)->Image());
+
+        VGuint lut[256];
+        int threshold = 1;
+        // generate ramp for alpha channel. the bigger the steepness the more solid the outline. 
+        for(int i = 0; i < threshold; i++) 
+            {
+            lut[i] = 0x00000000; // | i;
+            }
+        for(int i = threshold; i < 256; i++)
+            {
+            lut[i] = 0xffffffff; // | i;
+            }
+        vgLookupSingle(aux1Image, aSourceImage, lut, VG_ALPHA, VG_TRUE, VG_FALSE);
+        
+        // TODO: pixel relative parameters
+        // the variables are commented out because they are not used yet
+/*        
+        VGint shiftX = 0;
+        VGint shiftY = 0;
+//        VGshort kernel[9] = {0, -1, -2, 1, 0, -1, 2, 1, 0}; 
+        VGshort kernel[9] = {1, 0, -1, 2, 0, -2, 1, 0, -1};
+        VGfloat scale = 0.5f;
+        VGfloat bias = 0.5f;
+*/        
+
+//        vgConvolve(aux2Image, aux1Image, 3, 3, shiftX, shiftY, kernel, scale, bias, VG_TILE_PAD);
+
+/*        for(int i = 0; i < 126; i++)
+            {
+            lut[i] = 0x000000ff | i << 24 | i << 16 | i << 8 | i;
+            }
+*/        for(int i = 0; i < 10; i++)
+            {
+            lut[i] = 0x00000000  | i << 24 | i << 16 | i << 8 | 255 - i * 3;
+            }
+        for(int i = 20; i < 255; i++)
+            {
+            lut[i] = 0x00000000; // | i << 24 | i << 16 | i << 8 | i;
+            }
+
+//        vgLookupSingle(aux1Image, aux2Image, lut, VG_ALPHA, VG_TRUE, VG_FALSE);
+
+//        vgGaussianBlur(aTargetImage, aux1Image, outline_x, outline_y, VG_TILE_PAD);        
+        
+        aux1Buffer->UnbindAsTexture();
+        aux2Buffer->UnbindAsTexture();
+        aEngine.ReleaseRenderbuffer(aux1Buffer);
+        aEngine.ReleaseRenderbuffer(aux2Buffer);
+        }
+    else    // fast path --- just copy
+        {
+        vgCopyImage(aTargetImage, 0, 0, aSourceImage, 0, 0, width, height, VG_FALSE);   
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10BlurFilter.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,181 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxVg10BlurFilter.h"
+#include "HuiFxVg10RenderbufferBase.h"
+#include "HuiFxConstants.h"
+
+// identity mapping of colour components (i.e. 0->0, 1->1, ..., 255->255)
+const VGubyte CHuiFxVg10BlurFilter::iColorLUT[256] = 
+    {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
+     0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
+     0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
+     0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
+     0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
+     0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F,
+     0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
+     0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F,
+     0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F,
+     0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F,
+     0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF,
+     0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF,
+     0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
+     0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
+     0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
+     0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF}; 
+
+CHuiFxVg10BlurFilter* CHuiFxVg10BlurFilter::NewL()
+    {
+    CHuiFxVg10BlurFilter* self = new (ELeave) CHuiFxVg10BlurFilter();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+void CHuiFxVg10BlurFilter::ConstructL()
+    {
+    CHuiFxFilter::ConstructL();
+    iOldOpacity = -1.0f;        // value out of range to force update of AlphaLUT
+    iBlurX = 0.0;
+    iBlurY = 0.0;
+
+    memset(iAlphaLUT, '\0', sizeof(iAlphaLUT));
+    
+    RegisterParameterL(KLitBlurX, &iBlurX);
+    RegisterParameterL(KLitBlurY, &iBlurY);
+    }
+CHuiFxVg10BlurFilter *CHuiFxVg10BlurFilter::CloneL() const
+    {
+    CHuiFxVg10BlurFilter *filter = new (ELeave) CHuiFxVg10BlurFilter;
+    filter->CHuiFxFilter::CopyFromL(this);
+    filter->iOldOpacity = iOldOpacity;
+    filter->iBlurX = iBlurX;
+    filter->iBlurY = iBlurY;
+    memcpy(filter->iAlphaLUT, iAlphaLUT, sizeof(iAlphaLUT));
+    filter->CopyParameterL(KLitBlurX, &filter->iBlurX, this);
+    filter->CopyParameterL(KLitBlurY, &filter->iBlurY, this);
+    return filter;
+    }
+
+
+void CHuiFxVg10BlurFilter::CalculateMargin(TMargins &aMargin) const
+{
+    aMargin.iLeft = iBlurX;
+    aMargin.iRight = iBlurX;
+    aMargin.iBottom = iBlurY;
+    aMargin.iTop = iBlurY;
+}
+
+TBool CHuiFxVg10BlurFilter::Draw(CHuiFxEngine& aEngine, CHuiGc& /* aGc */, CHuiFxRenderbuffer& aTarget,
+                                 CHuiFxRenderbuffer& aSource, const TRect& aTargetRect, const TRect& aSourceRect)
+    {
+    aTarget.BindAsTexture(ERenderbufferUsageWriteOnly);
+    aSource.BindAsTexture(ERenderbufferUsageReadOnly);
+    VGImage srcImage  = (reinterpret_cast<CHuiFxVg10RenderbufferBase*>(&aSource))->AcquireSubImage(aSourceRect);
+    VGImage destImage = (reinterpret_cast<CHuiFxVg10RenderbufferBase*>(&aTarget))->AcquireSubImage(aTargetRect);
+    
+    // take opacity into account
+    const VGfloat opacity = clamp(iOpacity, 0.0f, 1.0f);
+
+    if(opacity > EPSILON)
+        {
+        DrawEffect(aEngine, destImage, srcImage, aSourceRect.Width(), aSourceRect.Height());
+        }
+    else
+        {
+//        VGint width = vgGetParameteri(srcImage, VG_IMAGE_WIDTH);
+//        VGint height = vgGetParameteri(srcImage, VG_IMAGE_HEIGHT);
+        VGint width = aSourceRect.Width();
+        VGint height = aSourceRect.Height();
+        vgClearImage(destImage, 0, 0, width, height);
+        }
+
+    HUIFX_VG_INVARIANT();    
+    (reinterpret_cast<CHuiFxVg10RenderbufferBase*>(&aSource))->ReleaseSubImage(srcImage);
+    (reinterpret_cast<CHuiFxVg10RenderbufferBase*>(&aTarget))->ReleaseSubImage(destImage);
+    aTarget.UnbindAsTexture();
+    aSource.UnbindAsTexture();
+    
+    return wasEnoughMemory();
+    }
+
+void CHuiFxVg10BlurFilter::DrawEffect(CHuiFxEngine& aEngine, VGImage aTargetImage, VGImage aSourceImage, TInt aWidth, TInt aHeight)
+    {
+    const VGfloat blur_x = clamp(iBlurX, EPSILON, 128.0f);
+    const VGfloat blur_y = clamp(iBlurY, EPSILON, 128.0f);
+    const VGfloat opacity = clamp(iOpacity, 0.0f, 1.0f);
+    
+    if(opacity < 1.0f - EPSILON)    // slow path --- take opacity into account
+        {
+//        const VGint width = vgGetParameteri(aSourceImage, VG_IMAGE_WIDTH);
+//        const VGint height = vgGetParameteri(aSourceImage, VG_IMAGE_HEIGHT);
+        const VGint width = aWidth;
+        const VGint height = aHeight;
+    
+        CHuiFxRenderbuffer* auxBuffer = aEngine.AcquireRenderbuffer(TSize(width, height));
+        if (!auxBuffer)
+            {
+            return;  // not enough memory --- filter not completed successfully
+            }
+        auxBuffer->BindAsTexture(ERenderbufferUsageReadWrite);
+        
+        VGImage auxImage = reinterpret_cast<CHuiFxVg10RenderbufferBase*>(auxBuffer)->Image();
+        
+        vgGaussianBlur(auxImage, aSourceImage, blur_x, blur_y, VG_TILE_PAD);
+    
+        if(OpacityChanged())
+            {
+            UpdateAlphaLUT();
+            }
+        vgLookup(aTargetImage, auxImage, iColorLUT, iColorLUT, iColorLUT, iAlphaLUT, VG_TRUE, VG_FALSE);
+        auxBuffer->UnbindAsTexture();
+        aEngine.ReleaseRenderbuffer(auxBuffer);
+    }    
+    else    // fast path --- the blur, just blur and nothing but the blur.
+        {
+        vgGaussianBlur(aTargetImage, aSourceImage, blur_x, blur_y, VG_TILE_PAD);   
+        }
+    }
+
+
+TBool CHuiFxVg10BlurFilter::OpacityChanged()
+    {
+    if(iOpacity != iOldOpacity)
+        {
+        iOldOpacity = iOpacity;
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+
+void CHuiFxVg10BlurFilter::UpdateAlphaLUT()
+    {
+    VGfloat opacity = clamp(iOpacity, 0.0f, 1.0f);
+    
+    // generate ramp for alpha channel. the bigger the steepness the more solid the outline. 
+    for(int i = 0; i < 256; i++) 
+        {
+        iAlphaLUT[i] = (VGubyte)((VGfloat)i * opacity); 
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10BrightnessContrastFilter.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxVg10BrightnessContrastFilter.h"
+#include "HuiFxConstants.h"
+
+CHuiFxVg10BrightnessContrastFilter* CHuiFxVg10BrightnessContrastFilter::NewL()
+    {
+    CHuiFxVg10BrightnessContrastFilter* e = new (ELeave) CHuiFxVg10BrightnessContrastFilter();
+    CleanupStack::PushL(e);
+    e->ConstructL();
+    CleanupStack::Pop(e);
+    return e;
+    }
+
+void CHuiFxVg10BrightnessContrastFilter::ConstructL()
+    {
+    CHuiFxVg10ColorMatrixFilterBase::ConstructL();
+    // neutral settings
+    iBrightness = 0.0f;
+    iContrast = 1.0f;
+    RegisterParameterL(KLitBrightness, &iBrightness);
+    RegisterParameterL(KLitContrast, &iContrast);
+    }
+CHuiFxVg10BrightnessContrastFilter *CHuiFxVg10BrightnessContrastFilter::CloneL() const
+    {
+    CHuiFxVg10BrightnessContrastFilter *filter = new(ELeave) CHuiFxVg10BrightnessContrastFilter;
+    filter->CHuiFxVg10ColorMatrixFilterBase::CopyFromL(this);
+    filter->iBrightness = iBrightness;
+    filter->iContrast = iContrast;
+    filter->CopyParameterL(KLitBrightness, &filter->iBrightness, this);
+    filter->CopyParameterL(KLitContrast, &filter->iContrast, this);    
+    return filter;
+    }
+
+void CHuiFxVg10BrightnessContrastFilter::UpdateColorMatrix(void)
+    {
+    // brightness [-1, 1]
+    const VGfloat offset_br = clamp(iBrightness, -1.0f, 1.0f);
+    const VGfloat scale_br = 1.0f - 0.5 * ((offset_br < 0.0f) ? -offset_br : offset_br);
+    
+    // contrast [0, N]
+    const VGfloat scale_con = clamp(iContrast, 0.0f, 100.0f);
+    const VGfloat offset_con = -0.5f * scale_con + 0.5f ;
+    
+    // combine the effects of brightness and contrast
+    const VGfloat off = offset_br + offset_con;
+    const VGfloat sc  = scale_br * scale_con;
+
+    // take opacity into account
+    const VGfloat opacity = clamp(iOpacity, 0.0f, 1.0f);
+    const VGfloat oOff = off * opacity;
+    const VGfloat oSc  = (sc * opacity) + (1.0f - opacity);
+    
+    iColorMatrix[0] = oSc;
+    iColorMatrix[1] = 0.0f;
+    iColorMatrix[2] = 0.0f;
+    iColorMatrix[3] = 0.0f;
+    iColorMatrix[4] = 0.0f;
+    iColorMatrix[5] = oSc;
+    iColorMatrix[6] = 0.0f;
+    iColorMatrix[7] = 0.0f;
+    iColorMatrix[8] = 0.0f;
+    iColorMatrix[9] = 0.0f;
+    iColorMatrix[10] = oSc;
+    iColorMatrix[11] = 0.0f;
+    iColorMatrix[12] = 0.0f;
+    iColorMatrix[13] = 0.0f;
+    iColorMatrix[14] = 0.0f;
+    iColorMatrix[15] = 1.0f;
+    iColorMatrix[16] = oOff;
+    iColorMatrix[17] = oOff;
+    iColorMatrix[18] = oOff;
+    iColorMatrix[19] = 0.0f;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10ColorMatrixFilterBase.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Basic functionality of color matrix based filters.
+*
+*/
+
+
+
+#include "HuiFxVg10ColorMatrixFilterBase.h"
+
+CHuiFxVg10ColorMatrixFilterBase* CHuiFxVg10ColorMatrixFilterBase::NewL()
+    {
+    CHuiFxVg10ColorMatrixFilterBase* e = new (ELeave) CHuiFxVg10ColorMatrixFilterBase();
+    CleanupStack::PushL(e);
+    e->ConstructL();
+    CleanupStack::Pop(e);
+    return e;
+    }
+
+void CHuiFxVg10ColorMatrixFilterBase::ConstructL()
+    {
+    CHuiFxVg10FilterBase::ConstructL();
+    memset(iColorMatrix, 0, sizeof(iColorMatrix));
+    }
+CHuiFxVg10ColorMatrixFilterBase *CHuiFxVg10ColorMatrixFilterBase::CloneL() const
+    {
+    CHuiFxVg10ColorMatrixFilterBase *filter = new(ELeave)CHuiFxVg10ColorMatrixFilterBase;
+    filter->CopyFromL(this);
+    return filter;
+    }
+void CHuiFxVg10ColorMatrixFilterBase::CopyFromL(const CHuiFxVg10ColorMatrixFilterBase *aOldFilter)
+    {
+    CHuiFxVg10FilterBase::CopyFromL(aOldFilter);
+    memcpy(iColorMatrix, aOldFilter->iColorMatrix, sizeof(iColorMatrix));
+    }
+void CHuiFxVg10ColorMatrixFilterBase::DrawEffect(CHuiFxEngine& /*aEngine*/, VGImage aTargetImage, VGImage aSourceImage, TInt aWidth, TInt aHeight )
+    {
+    // take opacity into account
+    const VGfloat opacity = clamp(iOpacity, 0.0f, 1.0f);
+
+    if(opacity > EPSILON)
+        {
+        if(ParameterChanged())
+            {
+            UpdateColorMatrix();
+            }
+        vgColorMatrix(aTargetImage, aSourceImage, iColorMatrix);
+        }
+    else
+        {
+//        VGint width = vgGetParameteri(aSourceImage, VG_IMAGE_WIDTH);
+//        VGint height = vgGetParameteri(aSourceImage, VG_IMAGE_HEIGHT);
+        VGint width = aWidth;
+        VGint height = aHeight;
+        vgCopyImage(aTargetImage, 0, 0, aSourceImage, 0, 0, width, height, VG_FALSE);
+        }
+    }
+
+
+// this is supposed to be overloaded by child classes
+void CHuiFxVg10ColorMatrixFilterBase::UpdateColorMatrix()
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10ColorizeFilter.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxVg10ColorizeFilter.h"
+#include "HuiFxConstants.h"
+
+CHuiFxVg10ColorizeFilter* CHuiFxVg10ColorizeFilter::NewL()
+    {
+    CHuiFxVg10ColorizeFilter* e = new (ELeave) CHuiFxVg10ColorizeFilter();
+    CleanupStack::PushL(e);
+    e->ConstructL();
+    CleanupStack::Pop(e);
+    return e;
+    }
+
+void CHuiFxVg10ColorizeFilter::ConstructL()
+    {
+    CHuiFxVg10ColorMatrixFilterBase::ConstructL();
+    iColor = TRgb(0xffffffff);
+    RegisterParameterL(KLitColor, &iColor);
+    }
+CHuiFxVg10ColorizeFilter *CHuiFxVg10ColorizeFilter::CloneL() const
+    {
+    CHuiFxVg10ColorizeFilter *filter = new(ELeave)CHuiFxVg10ColorizeFilter;
+    filter->CHuiFxVg10ColorMatrixFilterBase::CopyFromL(this);
+    filter->iColor = iColor;
+    filter->CopyParameterL(KLitColor, &filter->iColor, this);
+    return filter;
+    }
+
+void CHuiFxVg10ColorizeFilter::UpdateColorMatrix(void)
+    {
+    const VGfloat o = clamp(iOpacity, 0.0f, 1.0f);
+    const VGfloat ao = 1 - o;
+    const VGfloat Rw = 0.3086f;
+    const VGfloat Gw = 0.6094f;
+    const VGfloat Bw = 0.0820f;
+    const VGfloat R = (o / 255.0f) * (VGfloat)iColor.Red();
+    const VGfloat G = (o / 255.0f) * (VGfloat)iColor.Green();
+    const VGfloat B = (o / 255.0f) * (VGfloat)iColor.Blue();
+    
+    // this matrix is ((I * (1 - opacity)) + (I * opacity) * RGBMatrix * desaturateMatrix)T
+    // i.e. pixel is first converted to luminance, then multiplied by RGB, multiplied by opacity and finally the diagonal
+    // compensated with 1 - opacity.
+    // Precalculating abovementioned matrices to single matrix saves over a magnitude of multiplications and
+    // almost two magnitudes of additions. Also less memory is used and no unnecessary copying is involved.
+    iColorMatrix[0] = R*Rw + ao;
+    iColorMatrix[1] = G*Rw;
+    iColorMatrix[2] = B*Rw;
+    iColorMatrix[3] = 0.0f;
+    iColorMatrix[4] = R*Gw;
+    iColorMatrix[5] = G*Gw + ao;
+    iColorMatrix[6] = B*Gw;
+    iColorMatrix[7] = 0.0f;
+    iColorMatrix[8] = R*Bw;
+    iColorMatrix[9] = G*Bw;
+    iColorMatrix[10] = B*Bw + ao;
+    iColorMatrix[11] = 0.0f;
+    iColorMatrix[12] = 0.0f;
+    iColorMatrix[13] = 0.0f;
+    iColorMatrix[14] = 0.0f;
+    iColorMatrix[15] = 1.0f;
+    iColorMatrix[16] = 0.0f;
+    iColorMatrix[17] = 0.0f;
+    iColorMatrix[18] = 0.0f;
+    iColorMatrix[19] = 0.0f;    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10Engine.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,329 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxVg10Engine.h"
+#include "HuiFxVg10OnscreenRenderbuffer.h"
+#include "HuiFxVg10OffscreenRenderbuffer.h"
+#include "HuiFxVg10BlurFilter.h"
+#include "HuiFxVg10BrightnessContrastFilter.h"
+#include "HuiFxVg10HSLFilter.h"
+#include "HuiFxVg10ColorizeFilter.h"
+#include "HuiFxVg10OutlineFilter.h"
+#include "HuiFxVg10BevelFilter.h"
+#include "HuiVg10Gc.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiDisplay.h"
+#include "uiacceltk/HuiStatic.h"
+
+CHuiFxVg10Engine* CHuiFxVg10Engine::NewL(CHuiVg10RenderPlugin& aPlugin)
+    {
+    CHuiFxVg10Engine* e = new (ELeave) CHuiFxVg10Engine();
+    CleanupStack::PushL(e);
+    e->ConstructL(aPlugin);
+    CleanupStack::Pop(e);
+    return e;
+    }
+
+void CHuiFxVg10Engine::ConstructL(CHuiVg10RenderPlugin& aPlugin)
+    {
+    CHuiFxEngine::ConstructL(EHuiFxEngineVg10);
+    iPlugin = &aPlugin;
+    iDefaultBuffer = 0;
+    iCompPaint = vgCreatePaint();
+    }
+
+CHuiFxVg10Engine::~CHuiFxVg10Engine()
+    {
+    delete iDefaultBuffer;
+    vgDestroyPaint(iCompPaint);
+    }
+
+CHuiFxRenderbuffer* CHuiFxVg10Engine::AcquireNativeRenderbuffer(const TSize& aDesiredSize)
+    {
+    CHuiFxRenderbuffer* ret = NULL;
+    TRAP_IGNORE(ret = CHuiFxVg10OffscreenRenderbuffer::NewL(*iPlugin, aDesiredSize));
+    return ret;
+    }
+
+void CHuiFxVg10Engine::ReleaseNativeRenderbuffer(CHuiFxRenderbuffer* aBuffer)
+    {
+    ASSERT(aBuffer);
+    ASSERT(aBuffer != iDefaultBuffer);
+    
+    delete aBuffer;
+    aBuffer = 0;
+    }
+
+CHuiFxRenderbuffer* CHuiFxVg10Engine::DefaultRenderbuffer()
+    {
+    if (!iDefaultBuffer)
+        {
+        TRAPD(err, RestoreL());
+        if(err != KErrNone)
+            {
+            return NULL;
+            }
+        }
+    return iDefaultBuffer;
+    }
+
+void CHuiFxVg10Engine::Release()
+    {
+    delete iDefaultBuffer;
+    iDefaultBuffer = 0;
+    }
+
+void CHuiFxVg10Engine::RestoreL()
+    {
+    if (!iDefaultBuffer)
+        {
+        CHuiVg10RenderSurface* surface = static_cast<CHuiVg10RenderSurface*>(CHuiStatic::CurrentRenderSurface());
+        if (surface)
+            {
+            iDefaultBuffer = CHuiFxVg10OnscreenRenderbuffer::NewL(*iPlugin, *surface);
+            }
+        }
+    }
+
+CHuiFxFilter* CHuiFxVg10Engine::CreateFilterL(THuiFxFilterType aType)
+    {
+    switch (aType)
+        {
+        case EFilterTypeBrightnessContrast:
+            return CHuiFxVg10BrightnessContrastFilter::NewL();
+            // no break because we returned already
+            
+        case EFilterTypeBlur:
+            return CHuiFxVg10BlurFilter::NewL();
+            // no break because we returned already
+
+        case EFilterTypeHSL:
+        case EFilterTypeDesaturate: // desaturate is generated by hsl filter
+            return CHuiFxVg10HSLFilter::NewL();
+            // no break because we returned already
+            
+        case EFilterTypeColorize:
+            return CHuiFxVg10ColorizeFilter::NewL();
+            // no break because we returned already
+
+        case EFilterTypeOutline:
+            return CHuiFxVg10OutlineFilter::NewL();
+            // no break because we returned already
+
+        case EFilterTypeBevel:
+            return CHuiFxVg10BevelFilter::NewL();
+            // no break because we returned already
+
+        default: // unsupported
+            break;
+        }
+    return NULL;    
+    }
+
+void CHuiFxVg10Engine::Composite(CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource, 
+                                      const TRect& aTargetRect, const TRect& aSourceRect,
+                                      THuiFxBlendingMode aMode, TInt aAlpha)
+    {
+    const TInt VG_MATRIX_SIZE = 9;
+    CHuiGc& gc = aTarget.BindAsRenderTarget();
+    aSource.BindAsTexture(ERenderbufferUsageReadOnly);
+        
+#if 0 // render debug rectangle
+    VGint x = aTargetRect.iTl.iX;
+    VGint y = aTarget.Size().iHeight - aTargetRect.iBr.iY;
+    VGint w = aTargetRect.Size().iWidth;
+    VGint h = aTargetRect.Size().iHeight;
+    VGfloat color[] = 
+        {
+        .2f, .4f, .6f, 1.0f
+        };
+    vgSetfv(VG_CLEAR_COLOR, 4, color);
+    vgClear(x, y, w, h);
+    HUIFX_VG_INVARIANT();
+#else
+    VGImage image = (reinterpret_cast<CHuiFxVg10RenderbufferBase*>(&aSource))->AcquireSubImage(aSourceRect);
+
+    ASSERT(vgGeti(VG_MATRIX_MODE) == VG_MATRIX_IMAGE_USER_TO_SURFACE);
+    VGfloat oldMatrix[VG_MATRIX_SIZE];
+    vgGetMatrix(oldMatrix);
+    vgLoadIdentity();
+    vgSeti(VG_SCISSORING, VG_FALSE); 
+    VGint blendMode = vgGeti(VG_BLEND_MODE);
+
+    // Choose a blending mode
+    switch (aMode)
+        {
+    case EBlendingModeReplace:
+        vgSeti(VG_BLEND_MODE, VG_BLEND_SRC);
+        break;
+    case EBlendingModeOver:
+        vgSeti(VG_BLEND_MODE, VG_BLEND_SRC_OVER);
+        break;
+    case EBlendingModeMultiply:
+        vgSeti(VG_BLEND_MODE, VG_BLEND_MULTIPLY);
+        break;
+    case EBlendingModeAdditive:
+        vgSeti(VG_BLEND_MODE, VG_BLEND_ADDITIVE);
+        break;
+    case EBlendingModeLighten:
+        vgSeti(VG_BLEND_MODE, VG_BLEND_LIGHTEN);
+        break;
+    case EBlendingModeDarken:
+        vgSeti(VG_BLEND_MODE, VG_BLEND_DARKEN);
+        break;
+    default:
+        ASSERT(0);
+        }
+    HUIFX_VG_INVARIANT();
+    
+    // Update alpha
+    TBool mustRestorePaint = EFalse;
+    VGPaint userPaint = VG_INVALID_HANDLE;
+
+    if (aAlpha < 0xff)
+        {
+        if ( iCompPaint == VG_INVALID_HANDLE )
+            {
+            iCompPaint = vgCreatePaint();
+            }
+        if ( iCompPaint != VG_INVALID_HANDLE )
+            {
+            mustRestorePaint = ETrue;
+            userPaint = vgGetPaint( VG_FILL_PATH );
+            // if the original paint is not set, we'll get an error that must be cleared
+            vgSetPaint(iCompPaint, VG_FILL_PATH);
+            }
+        vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_MULTIPLY);
+        vgSetColor(iCompPaint, 0xffffff00 | aAlpha);
+        }
+    else
+        {
+        vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_NORMAL);
+        }
+    
+    // we've taken childimage from source so no clipping or adjusting is needed 
+    // by source rectangle.
+    if (aTarget.BufferType() == EBufferTypeOnscreen)
+        {
+		// we need to adjust our coordinates to screen coordinates. Hitchcock 
+        // thinks origo is on top-left of screen. VG thinks origo is on 
+        // bottom-left.
+        // We must take orientation if we access vg matrixes directly..
+        CHuiDisplay* display = &CHuiStatic::Env().PrimaryDisplay(); // TODO: should use CHuiEnv::CurrentDisplay() ? 
+        
+        if (display->Orientation() == CHuiGc::EOrientationCCW90)
+            {
+            // Rotate around origo and move back to displayarea
+            vgRotate(-90);
+            vgTranslate(aTargetRect.iTl.iX - aTarget.Size().iHeight , aTarget.Size().iWidth - aTargetRect.iBr.iY);
+            }
+        else if (display->Orientation() == CHuiGc::EOrientationCW90)
+            {
+            // Rotate around origo and move back to displayarea
+            vgRotate(90);
+            vgTranslate(aTargetRect.iTl.iX , - aTargetRect.iBr.iY);
+            }
+        else if (display->Orientation() == CHuiGc::EOrientation180)
+            {
+            // Rotate around origo and move back to displayarea
+            vgRotate(180);
+            vgTranslate(aTarget.Size().iWidth- aTargetRect.iTl.iX , - aTargetRect.iBr.iY);
+            }
+        else
+            {
+            vgTranslate(aTargetRect.iTl.iX, aTarget.Size().iHeight - aTargetRect.iBr.iY);
+            }        
+        
+        }
+    else 
+        {
+        // offscreen renderbuffer --- we use VG coordinates
+        vgTranslate(aTargetRect.iTl.iX, aTargetRect.iTl.iY);
+        }
+    
+    // slowpath
+    if(aTargetRect.Size() != aSourceRect.Size())
+        {
+        VGfloat scaleX = (VGfloat)aTargetRect.Width() / aSourceRect.Width();
+        VGfloat scaleY = (VGfloat)aTargetRect.Height() / aSourceRect.Height();
+        vgScale(scaleX, scaleY);
+        }
+    
+    vgDrawImage(image);
+    
+    // Restore default VG state
+    vgSeti(VG_SCISSORING, VG_TRUE);     
+//    vgSeti(VG_BLEND_MODE, VG_BLEND_SRC_OVER);
+    vgSeti(VG_BLEND_MODE, blendMode);
+    vgLoadMatrix(oldMatrix);
+    HUIFX_VG_INVARIANT();
+    if ( mustRestorePaint )
+        {
+        vgSetPaint(userPaint, VG_FILL_PATH);
+        // if the original handle was invalid, this may produce an error
+        }
+    reinterpret_cast<CHuiFxVg10RenderbufferBase*>(&aSource)->ReleaseSubImage(image);
+#endif // debug rectangle
+    aSource.UnbindAsTexture();
+    aTarget.UnbindAsRenderTarget();
+    }
+
+void CHuiFxVg10Engine::Composite(CHuiGc& aGc, CHuiFxRenderbuffer& aSource, const TPoint& aTargetPoint,TBool aOpaque, TInt aAlpha)
+    {
+    // Directly to screen, overrides onscreen buffer. Always "over" blending mode, constant alpha.
+    const CHuiFxVg10OffscreenRenderbuffer* vg10RenderBuffer = (const CHuiFxVg10OffscreenRenderbuffer*) &aSource;        
+    CHuiVg10Gc* vg10Gc = (CHuiVg10Gc*)&aGc;
+    if (vg10RenderBuffer->Image())
+        {
+        // For some reason color is weird at this point, so set our own.
+        TRgb oldPencolor = aGc.PenColor();
+        TInt oldPenAlpha = aGc.PenAlpha();
+        
+        aGc.SetPenColor(KRgbWhite);
+        aGc.SetPenAlpha(aAlpha);
+        vg10Gc->UpdateColor();
+
+        // Push matrix
+        aGc.Push(EHuiGcMatrixModel);
+        
+        // Take into account the screen relative position of the buffer
+        aGc.Translate(EHuiGcMatrixModel, aTargetPoint.iX, aTargetPoint.iY, 0);
+
+        // Flip the content (because of hitchcock/openvg coordinate differencies       
+        aGc.Translate(EHuiGcMatrixModel, 0.0f, aSource.Size().iHeight, 0.0f);
+        aGc.Scale(EHuiGcMatrixModel, 1.0f, -1.0f, 1.0f);
+
+        // Do the drawing, handle opaque windows with writealpha, otherwise blend
+		if (aOpaque)
+			{
+			aGc.Disable(CHuiGc::EFeatureBlending);
+			}
+		else
+			{
+            aGc.Enable(CHuiGc::EFeatureBlending);
+			}
+        vgDrawImage(vg10RenderBuffer->Image());
+
+        // Restore pen color, matrix
+        aGc.Enable(CHuiGc::EFeatureBlending);        
+        aGc.SetPenColor(oldPencolor);                
+        aGc.SetPenAlpha(oldPenAlpha);
+        aGc.Pop(EHuiGcMatrixModel);
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10FilterBase.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxVg10FilterBase.h"
+#include "uiacceltk/HuiUtil.h"
+
+
+//_LIT(KLitPanicMessage, "HuiFx");
+
+
+TBool CHuiFxVg10FilterBase::Draw(CHuiFxEngine& aEngine, CHuiGc& /* aGc */, CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource,
+                                            const TRect& aTargetRect, const TRect& aSourceRect)
+    {
+    aTarget.BindAsTexture(ERenderbufferUsageWriteOnly);
+    aSource.BindAsTexture(ERenderbufferUsageReadOnly);
+    VGImage srcImage  = (reinterpret_cast<CHuiFxVg10RenderbufferBase*>(&aSource))->AcquireSubImage(aSourceRect);
+    VGImage destImage = (reinterpret_cast<CHuiFxVg10RenderbufferBase*>(&aTarget))->AcquireSubImage(aTargetRect);
+    
+    // take opacity into account
+    const VGfloat opacity = clamp(iOpacity, 0.0f, 1.0f);
+
+    if(opacity > EPSILON)
+        {
+        DrawEffect(aEngine, destImage, srcImage, aSourceRect.Width(), aSourceRect.Height());
+        }
+    else
+        {
+//        VGint width = vgGetParameteri(srcImage, VG_IMAGE_WIDTH);
+//        VGint height = vgGetParameteri(srcImage, VG_IMAGE_HEIGHT);
+        VGint width = aSourceRect.Width();
+        VGint height = aSourceRect.Height();
+        vgCopyImage(destImage, 0, 0, srcImage, 0, 0, width, height, VG_FALSE);
+        }
+
+    HUIFX_VG_INVARIANT();    
+    (reinterpret_cast<CHuiFxVg10RenderbufferBase*>(&aSource))->ReleaseSubImage(srcImage);
+    (reinterpret_cast<CHuiFxVg10RenderbufferBase*>(&aTarget))->ReleaseSubImage(destImage);
+    aTarget.UnbindAsTexture();
+    aSource.UnbindAsTexture();
+    
+    return wasEnoughMemory();
+    }
+
+// any unexpected error results in panic
+TBool CHuiFxVg10FilterBase::wasEnoughMemory()
+    {
+#ifndef _DEBUG
+	// vgGetError() -call is REALLY SLOW on HW, remove for now at least,
+	// since nobody is really even checking this return value nor acting on it..
+    TBool success = ETrue;
+#else
+    TBool success = EFalse;
+    const VGErrorCode vgError = vgGetError();
+    
+    switch(vgError)
+        {
+        case VG_NO_ERROR : 
+            success = ETrue;
+            break;
+            
+        case VG_OUT_OF_MEMORY_ERROR : 
+            success = EFalse;
+            break;
+            
+        default :
+            success = EFalse;
+            // should print an error instead of panicking
+            HUI_DEBUG1(_L("CHuiFxVg10FilterBase::wasEnoughMemory() vgError -- %04x"), vgError);
+//            User::Panic(KLitPanicMessage, vgError);
+        }
+#endif
+    return success;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10HSLFilter.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,222 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxVg10HSLFilter.h"
+#include <math.h>
+#include "HuiFxConstants.h"
+
+// local helper functions
+static void getSaturationRotationMatrix(VGfloat *effectMatrix, const VGfloat opacity, const VGfloat angle, const VGfloat saturation);
+static void getSaturationMatrix(VGfloat *effectMatrix, const VGfloat opacity, const VGfloat saturation);
+static void getRotationMatrix(VGfloat *effectMatrix, const VGfloat opacity, const VGfloat angle);
+static void getIdentityMatrix(VGfloat *effectMatrix);
+
+CHuiFxVg10HSLFilter* CHuiFxVg10HSLFilter::NewL()
+    {
+    CHuiFxVg10HSLFilter* e = new (ELeave) CHuiFxVg10HSLFilter();
+    CleanupStack::PushL(e);
+    e->ConstructL();
+    CleanupStack::Pop(e);
+    return e;
+    }
+
+void CHuiFxVg10HSLFilter::ConstructL()
+    {
+    CHuiFxVg10ColorMatrixFilterBase::ConstructL();
+    // neutral settings
+    iHue            = 0.0f;    //  0.0f to 360.0f, neutral: 0.0f
+    iSaturation     = 1.0f;    //  0.0f to 100.0f, neutral: 1.0f
+    iLightness      = 0.0f;    // -1.0f to 1.0f, neutral: 0.0f
+    RegisterParameterL(KLitHue, &iHue);
+    RegisterParameterL(KLitSaturation, &iSaturation);
+    RegisterParameterL(KLitLightness, &iLightness);
+    }
+CHuiFxVg10HSLFilter *CHuiFxVg10HSLFilter::CloneL() const
+{
+    CHuiFxVg10HSLFilter *filter = new (ELeave) CHuiFxVg10HSLFilter;
+    filter->CHuiFxVg10ColorMatrixFilterBase::CopyFromL(this);
+    filter->iHue = iHue;
+    filter->iSaturation = iSaturation;
+    filter->iLightness = iLightness;
+    filter->CopyParameterL(KLitHue, &filter->iHue, this);
+    filter->CopyParameterL(KLitSaturation, &filter->iSaturation, this);
+    filter->CopyParameterL(KLitLightness, &filter->iLightness, this);
+    return filter;
+}
+
+//
+// Background for HSL matrices can be found at http://www.opengl.org/resources/code/samples/advanced/advanced97/notes/node137.html
+//
+void CHuiFxVg10HSLFilter::UpdateColorMatrix(void)
+    {
+    // a helpful constant
+    const VGfloat radsPerDeg = 2.0f * (float)M_PI / 360.0f;
+
+    // make sure parametres are in range
+    const VGfloat opacity = clamp(iOpacity, 0.0f, 1.0f);
+    const VGfloat angle = clamp(iHue * radsPerDeg, 0.0f, 2.0f * (float)M_PI);   // angle [0, 2*pi]
+    const VGfloat saturation = clamp(iSaturation, 0.0f, 100.0f);                // saturation [0, N]
+    const VGfloat lightness = clamp(iLightness, -1.0f, 1.0f);                   // lightness [-1, 1]
+    
+    // check parametres which precalculated matrix we have to use.
+    // Note: lightness affects offset and not matrix so we don't bother optimising that.
+    const bool enableSaturation  = (saturation < 1.0f - EPSILON || saturation > 1.0f + EPSILON);
+    const bool enableHueRotation = (EPSILON < angle && angle < (2.0f * (float)M_PI - EPSILON));
+
+    if(enableSaturation && enableHueRotation)
+        {
+        // contains SaturateT*PrerotationT*HuerotationT*PostrotationT*I*opacity+I*(1-opacity) matrices --- ugly, but saves lot of operations in FPU.
+        // note: there are plenty of redundancy in these calculations --- let compiler optimise them.
+        getSaturationRotationMatrix(&iColorMatrix[0], opacity, saturation, angle);
+        }
+    else if(enableSaturation && !enableHueRotation)
+        {
+        // saturationT*I*opacity+I*(1 - opacity) matrix without hue rotation
+        getSaturationMatrix(&iColorMatrix[0], opacity, saturation);
+        }
+    else if(!enableSaturation && enableHueRotation)
+        {
+        // PrerotationT*HuerotationT*PostrotationT*I*opacity+I*(1-opacity) matrices without saturation matrix
+        getRotationMatrix(&iColorMatrix[0], opacity, angle);
+        }
+    else
+        {
+        // identity matrix
+        getIdentityMatrix(&iColorMatrix[0]);
+        }
+
+    // colour component offsets
+    iColorMatrix[16] = lightness * opacity;
+    iColorMatrix[17] = lightness * opacity;
+    iColorMatrix[18] = lightness * opacity;
+    iColorMatrix[19] = 0.0f;
+    }
+
+
+static void getSaturationRotationMatrix(VGfloat *effectMatrix, const VGfloat opacity, const VGfloat saturation, const VGfloat angle) 
+    {
+    const VGfloat sa = saturation;            
+    const VGfloat as = 1.0f - saturation;
+    
+    const VGfloat o = opacity;
+    const VGfloat ao = 1.0f - o;
+    
+    const VGfloat c = cos(angle);
+    const VGfloat s = sin(angle);
+    
+    effectMatrix[0] = o * ((-0.02473f*as+0.66667f*sa)*c+ (0.30450f*as*s+(0.33333f*as+0.33333f*sa))) + ao;
+    effectMatrix[1] = o * ((-0.02473f*as-0.33333f*sa)*c+((0.30450f*as+0.57736f*sa)*s+(0.33333f*as+0.33333f*sa)));
+    effectMatrix[2] = o * ((-0.02473f*as-0.33333f*sa)*c+((0.30450f*as-0.57736f*sa)*s+(0.33333f*as+0.33333f*sa)));
+    effectMatrix[3] = 0.0f;
+    effectMatrix[4] = o * ((0.27607f*as-0.33333f*sa)*c+((-0.13083f*as-0.57736f*sa)*s+(0.33333f*as+0.33333f*sa)));
+    effectMatrix[5] = o * ((0.27607f*as+0.66667f*sa)*c+ (-0.13083f*as*s+(0.33333f*as+0.33333f*sa))) + ao;
+    effectMatrix[6] = o * ((0.27607f*as-0.33333f*sa)*c+((-0.13083f*as+0.57736f*sa)*s+(0.33333f*as+0.33333f*sa)));
+    effectMatrix[7] = 0.0f;
+    effectMatrix[8] = o * ((-0.25134f*as-0.33333f*sa)*c+((-0.17367f*as+0.57736f*sa)*s+(0.33333f*as+0.33333f*sa)));
+    effectMatrix[9] = o * ((-0.25134f*as-0.33333f*sa)*c+((-0.17367f*as-0.57736f*sa)*s+(0.33333f*as+0.33333f*sa)));
+    effectMatrix[10] = o * ((-0.25134f*as+0.66667f*sa)*c+ (-0.17367f*as*s+(0.33333f*as+0.33333f*sa))) + ao;
+    effectMatrix[11] = 0.0f;
+    effectMatrix[12] = 0.0f;
+    effectMatrix[13] = 0.0f;
+    effectMatrix[14] = 0.0f;
+    effectMatrix[15] = 1.0f;
+}
+
+
+static void getSaturationMatrix(VGfloat *effectMatrix, const VGfloat opacity, const VGfloat saturation)
+    {
+    const VGfloat Rw = 0.3086f;
+    const VGfloat Gw = 0.6094f;
+    const VGfloat Bw = 0.0820f;
+    
+    const VGfloat sa = saturation;            
+    const VGfloat as = 1.0f - saturation;
+    
+    const VGfloat o = opacity;
+    const VGfloat ao = 1.0f - o;
+
+    const VGfloat asRw = o * as * Rw;
+    const VGfloat asGw = o * as * Gw;
+    const VGfloat asBw = o * as * Bw;
+    
+    effectMatrix[0] = asRw + sa + ao;
+    effectMatrix[1] = asRw;
+    effectMatrix[2] = asRw;
+    effectMatrix[3] = 0.0f;
+    effectMatrix[4] = asGw;
+    effectMatrix[5] = asGw + sa + ao;
+    effectMatrix[6] = asGw;
+    effectMatrix[7] = 0.0f;
+    effectMatrix[8] = asBw;
+    effectMatrix[9] = asBw;
+    effectMatrix[10] = asBw + sa + ao;
+    effectMatrix[11] = 0.0f;
+    effectMatrix[12] = 0.0f;
+    effectMatrix[13] = 0.0f;
+    effectMatrix[14] = 0.0f;
+    effectMatrix[15] = 1.0f;
+    }
+
+
+static void getRotationMatrix(VGfloat *effectMatrix, const VGfloat opacity, const VGfloat angle)
+    {
+    const VGfloat o = opacity;
+    const VGfloat ao = 1.0f - o;
+    
+    const VGfloat c = cos(angle);
+    const VGfloat s = sin(angle);
+    
+    effectMatrix[0] = o * ( 0.66667f*c+0.33333f) + ao;
+    effectMatrix[1] = o * (-0.33333f*c+(0.57736f*s+0.33333f));
+    effectMatrix[2] = o * (-0.33333f*c+(-0.57736f*s+0.33333f));
+    effectMatrix[3] =  0.0f;
+    effectMatrix[4] = o * (-0.33333f*c+(-0.57736f*s+0.33333f));
+    effectMatrix[5] = o * ( 0.66667f*c+0.33333f) + ao;
+    effectMatrix[6] = o * (-0.33333f*c+(0.57736f*s+0.33333f));
+    effectMatrix[7] =  0.0f;
+    effectMatrix[8] = o * (-0.33333f*c+(0.57736f*s+0.33333f));
+    effectMatrix[9] = o * (-0.33333f*c+(-0.57736f*s+0.33333f));
+    effectMatrix[10] = o * (0.66667f*c+0.33333f) + ao;
+    effectMatrix[11] = 0.0f;
+    effectMatrix[12] = 0.0f;
+    effectMatrix[13] = 0.0f;
+    effectMatrix[14] = 0.0f;
+    effectMatrix[15] = 1.0f;
+    }
+
+
+static void getIdentityMatrix(VGfloat *effectMatrix)
+    {
+    effectMatrix[0] = 1.0f;
+    effectMatrix[1] = 0.0f;
+    effectMatrix[2] = 0.0f;
+    effectMatrix[3] = 0.0f;
+    effectMatrix[4] = 0.0f;
+    effectMatrix[5] = 1.0f;
+    effectMatrix[6] = 0.0f;
+    effectMatrix[7] = 0.0f;
+    effectMatrix[8] = 0.0f;
+    effectMatrix[9] = 0.0f;
+    effectMatrix[10] = 1.0f;
+    effectMatrix[11] = 0.0f;
+    effectMatrix[12] = 0.0f;
+    effectMatrix[13] = 0.0f;
+    effectMatrix[14] = 0.0f;
+    effectMatrix[15] = 1.0f;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10OffscreenRenderbuffer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,374 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxVg10OffscreenRenderbuffer.h"
+#include "HuiVg10RenderPlugin.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiDisplay.h"
+
+CHuiFxVg10OffscreenRenderbuffer* CHuiFxVg10OffscreenRenderbuffer::NewL(CHuiVg10RenderPlugin& aPlugin, const TSize& aSize)
+    {
+    CHuiFxVg10OffscreenRenderbuffer* e = new (ELeave) CHuiFxVg10OffscreenRenderbuffer();
+    CleanupStack::PushL(e);
+    e->ConstructL(aPlugin, aSize);
+    CleanupStack::Pop(e);
+    return e;
+    }
+
+void CHuiFxVg10OffscreenRenderbuffer::ConstructL(CHuiVg10RenderPlugin& aPlugin, const TSize& aSize)
+    {
+    CHuiFxRenderbuffer::ConstructL(aSize, EBufferTypeOffscreen);
+    iPlugin = &aPlugin;
+
+    PushEGLContext();
+    
+#ifndef __WINS__ // Should possibly query the supported mode instead?
+    VGImageFormat imageInternalFormat = VG_sARGB_8888_PRE;
+#else
+    VGImageFormat imageInternalFormat = VG_sARGB_8888;
+#endif
+
+    iImage = vgCreateImage(imageInternalFormat, aSize.iWidth, aSize.iHeight, 
+                           VG_IMAGE_QUALITY_NONANTIALIASED);
+
+    HUIFX_VG_INVARIANT();
+
+    const TInt BITS_PER_CHANNEL = 8;
+    
+    // Choose an EGL config
+    const EGLint attrs[] =
+        {
+        EGL_SURFACE_TYPE,       EGL_PBUFFER_BIT,
+        EGL_RENDERABLE_TYPE,    EGL_OPENVG_BIT,
+        EGL_RED_SIZE,           BITS_PER_CHANNEL,
+        EGL_GREEN_SIZE,         BITS_PER_CHANNEL,
+        EGL_BLUE_SIZE,          BITS_PER_CHANNEL,
+        EGL_ALPHA_SIZE,         BITS_PER_CHANNEL,
+        EGL_NONE
+        };
+    TInt configCount = iPlugin->EglChooseConfig(attrs);
+    ASSERT(configCount > 0);
+    EGLConfig config = iPlugin->EglConfig(0);
+    
+    // Create a context
+    iContext = eglCreateContext(iPlugin->EglDisplay(), config,
+            iPlugin->EglSharedContext(), NULL);
+    EGLint err = eglGetError();
+    ASSERT(iContext);
+    
+    // Create a pbuffer surface
+    iSurface = eglCreatePbufferFromClientBuffer(iPlugin->EglDisplay(), EGL_OPENVG_IMAGE,
+                                                iImage, config, NULL);
+    ASSERT(iSurface);   
+    
+    // Initialize the context
+    iGc = iPlugin->CreateGcL();
+    this->InitGc(aSize);
+
+    PopEGLContext();
+    }
+
+CHuiFxVg10OffscreenRenderbuffer::~CHuiFxVg10OffscreenRenderbuffer()
+    {  
+    delete iGc;
+    
+    if(iPlugin)
+        {
+        eglDestroySurface(iPlugin->EglDisplay(), iSurface);
+        eglDestroyContext(iPlugin->EglDisplay(), iContext); 
+        }
+    
+    if (iRotatedImage != VG_INVALID_HANDLE)
+        {
+        vgDestroyImage(iRotatedImage);
+        HUIFX_VG_INVARIANT();
+        }
+    vgDestroyImage(iImage);
+    HUIFX_VG_INVARIANT();
+    }
+
+void CHuiFxVg10OffscreenRenderbuffer::InitGc(const TSize& aSize)
+    {
+    BindAsRenderTarget();
+    iGc->InitState();
+    VGfloat color[] = 
+                {
+                 .0f, .0f, .0f, .0f
+                };
+    vgSetfv(VG_CLEAR_COLOR, sizeof(color) / sizeof(VGfloat), color);
+    vgClear(0, 0, aSize.iWidth, aSize.iHeight);
+    UnbindAsRenderTarget();
+    
+    // Let renderer know that we have been fiddlling with OpenVg state directly
+    // "iGc->InitState" confuses scissoring setting, so lets notify it.
+    CHuiVg10RenderPlugin& renderer = CHuiStatic::Vg10Renderer();
+    renderer.AddRestoreStateFlags(EHuiVg10GcStateFlagDirtyScissor);    
+    renderer.AddRestoreStateFlags(EHuiVg10GcStateFlagDirtyBlendMode);    
+    }
+
+void CHuiFxVg10OffscreenRenderbuffer::PrepareForReuse(const TSize& aReusedSize)
+    {
+    if (iBackgroundEnabled)
+        {
+        ReadBackground();
+        }
+    else
+        {
+        const TInt COLOR_COMPONENTS = 4;
+        VGfloat savedColor[COLOR_COMPONENTS];
+        vgGetfv(VG_CLEAR_COLOR, COLOR_COMPONENTS, savedColor);
+        
+        VGfloat color[COLOR_COMPONENTS] = 
+                    {
+                     .0f, .0f, .0f, .0f
+                    };
+        vgSetfv(VG_CLEAR_COLOR, COLOR_COMPONENTS, color);
+        vgClearImage(Image(), 0, 0, aReusedSize.iWidth, aReusedSize.iHeight);
+        vgSetfv(VG_CLEAR_COLOR, COLOR_COMPONENTS, savedColor);        
+        }
+    
+    HUIFX_VG_INVARIANT();
+    }
+
+CHuiGc& CHuiFxVg10OffscreenRenderbuffer::BindAsRenderTarget()
+    {
+    // Save current context and surfaces
+    iSavedContext = eglGetCurrentContext();
+    iSavedDrawSurface = eglGetCurrentSurface(EGL_DRAW);
+    iSavedReadSurface = eglGetCurrentSurface(EGL_READ);
+    ASSERT(iSavedContext != iContext);
+    ASSERT(iSavedDrawSurface != iSurface);
+    ASSERT(iSavedReadSurface != iSurface);
+
+    // Bind our own surface
+    eglMakeCurrent(iPlugin->EglDisplay(), iSurface, iSurface, iContext);
+    ASSERT(eglGetError() == EGL_SUCCESS);
+
+    return *iGc;
+    }
+
+void CHuiFxVg10OffscreenRenderbuffer::BindAsTexture(THuiFxRenderbufferUsage aUsage)
+    {
+    // Nothing to do
+    }
+
+void CHuiFxVg10OffscreenRenderbuffer::UnbindAsTexture()
+    {
+    // Nothing to do
+    }
+
+void CHuiFxVg10OffscreenRenderbuffer::UnbindAsRenderTarget()
+    {
+    // Restore original surface & context
+    eglMakeCurrent(iPlugin->EglDisplay(), iSavedDrawSurface, iSavedReadSurface,
+        iSavedContext);
+    ASSERT(eglGetError() == EGL_SUCCESS);
+    }
+
+VGImage CHuiFxVg10OffscreenRenderbuffer::Image() const
+    {
+    return iImage;
+    }
+
+void CHuiFxVg10OffscreenRenderbuffer::ReadBackground()
+    {
+    if (iBackgroundEnabled)
+        {
+        CHuiDisplay& display = CHuiStatic::Env().PrimaryDisplay();        
+        TBool rotatedDisplay = display.Orientation() == CHuiGc::EOrientationCCW90 || display.Orientation() == CHuiGc::EOrientationCW90;
+        TRect renderBufferLocation = TRect(iPosition, iSize);
+
+#ifdef HUIFX_TRACE    
+        RDebug::Print(_L("CHuiFxVg10OffscreenRenderbuffer::PrepareForReuse - renderBufferLocation original: %i,%i, %i,%i "), 
+                renderBufferLocation.iTl.iX,
+                renderBufferLocation.iTl.iY,
+                renderBufferLocation.iBr.iX,
+                renderBufferLocation.iBr.iY);
+#endif
+        
+        TRect displayArea = display.VisibleArea();
+        
+        TInt displayHeight = displayArea.Height();
+        TInt displayWidth = displayArea.Width();
+       
+        TSize rotatedSize = iSize;
+        TPoint rotatedPos = iPosition;
+        
+        // Read pixels from surface        
+        if (rotatedDisplay)
+            {
+            if (iRotatedImage == VG_INVALID_HANDLE)
+                {
+                PushEGLContext();
+                
+                #ifndef __WINS__ // Should possibly query the supported mode instead?
+                    VGImageFormat imageInternalFormat = VG_sARGB_8888_PRE;
+                #else
+                    VGImageFormat imageInternalFormat = VG_sARGB_8888;
+                #endif
+
+                TSize rotatedImageSize = TSize(iSize.iHeight, iSize.iWidth);
+                iRotatedImage = vgCreateImage(imageInternalFormat, rotatedImageSize.iWidth, rotatedImageSize.iHeight, 
+                                   VG_IMAGE_QUALITY_NONANTIALIASED);
+
+                PopEGLContext();
+                }
+            
+            
+            // If we have rotation on CHuiGc level, we must manually take that into account when
+            // accessing pixels directly                
+            if(display.Orientation() == CHuiGc::EOrientationCCW90)
+                {
+                // Rotate the buffer location relative to real surface coordinates
+                rotatedSize = TSize(iSize.iHeight, iSize.iWidth);
+                rotatedPos = TPoint(displayHeight - iPosition.iY - iSize.iHeight, iPosition.iX);                        
+                renderBufferLocation = TRect(rotatedPos, rotatedSize);            
+                }
+            else if(display.Orientation() == CHuiGc::EOrientationCW90)
+                {
+                // Rotate the buffer location relative to real surface coordinates
+                rotatedSize = TSize(iSize.iHeight, iSize.iWidth);
+                rotatedPos = TPoint(iPosition.iY, displayWidth - iPosition.iX - iSize.iWidth);            
+                renderBufferLocation = TRect(rotatedPos, rotatedSize);
+                }
+            else
+                {
+                // nothing
+                }        
+
+            // If screen is rotated but surface is not in native orientation, this gets difficult
+            // because vgGetPixels is not affected by transformations.
+
+            // Swap h and w so that those are the "real" values from surface point of view.
+            displayHeight = displayWidth;
+
+            #ifdef HUIFX_TRACE    
+            RDebug::Print(_L("CHuiFxVg10OffscreenRenderbuffer::PrepareForReuse - renderBufferLocation: %i,%i, %i,%i "), 
+                    renderBufferLocation.iTl.iX,
+                    renderBufferLocation.iTl.iY,
+                    renderBufferLocation.iBr.iX,
+                    renderBufferLocation.iBr.iY);
+
+            TRect vgRect(TPoint(renderBufferLocation.iTl.iX, displayHeight - renderBufferLocation.iTl.iY - rotatedSize.iHeight), rotatedSize);
+
+            RDebug::Print(_L("CHuiFxVg10OffscreenRenderbuffer::PrepareForReuse - vgRect: %i,%i, %i,%i "), 
+                    vgRect.iTl.iX,
+                    vgRect.iTl.iY,
+                    vgRect.iBr.iX,
+                    vgRect.iBr.iY);
+            #endif
+            
+            // So...first get pixels from surface into rotated image
+            vgGetPixels(iRotatedImage, 0, 0, renderBufferLocation.iTl.iX, displayHeight - renderBufferLocation.iTl.iY - rotatedSize.iHeight, rotatedSize.iWidth, rotatedSize.iHeight);
+            
+            // Draw rotated image into real buffer image, first bind it as render target...
+            BindAsRenderTarget();            
+            
+            // ...store some states...
+            const TInt VG_MATRIX_SIZE = 9;
+            VGfloat oldMatrix[VG_MATRIX_SIZE];
+            vgGetMatrix(oldMatrix);
+
+            // ...set some vg states...
+            vgLoadIdentity();
+            vgSeti(VG_BLEND_MODE, VG_BLEND_SRC);
+            vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_NORMAL);
+            vgSeti(VG_SCISSORING, VG_FALSE);
+
+            TInt w = iSize.iWidth;
+            TInt h = iSize.iHeight;
+            
+            // ...select right rotation...
+            if (display.Orientation() == CHuiGc::EOrientationCW90)
+                {
+                // Rotate around origo and move back to displayarea
+                vgRotate(-90);
+                vgTranslate(-h, 0);
+                }
+            else if (display.Orientation() == CHuiGc::EOrientationCCW90)
+                {
+                // Rotate around origo and move back to displayarea
+                vgRotate(90);
+                vgTranslate(0, -w);
+                }
+            else if (display.Orientation() == CHuiGc::EOrientation180)
+                {
+                // Rotate around origo and move back to displayarea
+                vgRotate(180);
+                vgTranslate(-w, -h);            
+                }
+            else
+                {
+                }        
+            
+            // ...Draw...
+            if (iRotatedImage != VG_INVALID_HANDLE)
+                {
+                vgDrawImage(iRotatedImage);
+                }
+            
+            // ..and restore default VG states
+            vgSeti(VG_SCISSORING, VG_TRUE);
+            vgSeti(VG_BLEND_MODE, VG_BLEND_SRC_OVER);
+            vgLoadMatrix(oldMatrix);
+
+            // ...finally unbind image and we should have the content correctly.
+            UnbindAsRenderTarget();
+            }
+        else
+            {
+            // Much easier if no rotation !
+            vgGetPixels(iImage, 0, 0, renderBufferLocation.iTl.iX, displayHeight - renderBufferLocation.iTl.iY - rotatedSize.iHeight, rotatedSize.iWidth, rotatedSize.iHeight);
+            }
+        }    
+    }
+
+void CHuiFxVg10OffscreenRenderbuffer::PushEGLContext()
+    {
+    iPreviousEGLState.iContext= eglGetCurrentContext(); 
+    TEGLState& state = iPlugin->GetUploadState();
+    if (state.iContext == KErrNotFound)
+        {
+        TEGLState& state = iPlugin->GetUploadState();
+        // the first context used for uploading will be used for all texture uploads
+        state.iContext      = iPreviousEGLState.iContext; 
+        state.iDrawSurface  = eglGetCurrentSurface(EGL_DRAW);
+        state.iReadSurface  = eglGetCurrentSurface(EGL_READ);
+        state.iDisplay      = eglGetCurrentDisplay();
+        }
+    else
+        {
+        // change context only if necessary
+        if (iPreviousEGLState.iContext != state.iContext)
+            {
+            iPreviousEGLState.iDrawSurface  = eglGetCurrentSurface(EGL_DRAW);
+            iPreviousEGLState.iReadSurface  = eglGetCurrentSurface(EGL_READ);
+            iPreviousEGLState.iDisplay      = eglGetCurrentDisplay();
+            eglMakeCurrent(state.iDisplay, state.iDrawSurface, state.iReadSurface, state.iContext);
+            }
+        }
+    }
+
+void CHuiFxVg10OffscreenRenderbuffer::PopEGLContext()
+    {
+    if (iPreviousEGLState.iContext != iPlugin->GetUploadState().iContext)
+        {
+        eglMakeCurrent(iPreviousEGLState.iDisplay,  iPreviousEGLState.iDrawSurface, iPreviousEGLState.iReadSurface,iPreviousEGLState.iContext);
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10OnscreenRenderbuffer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxVg10OnscreenRenderbuffer.h"
+#include "HuiVg10RenderSurface.h"
+#include "HuiVg10RenderPlugin.h"
+
+CHuiFxVg10OnscreenRenderbuffer* CHuiFxVg10OnscreenRenderbuffer::NewL(CHuiVg10RenderPlugin& aPlugin, CHuiVg10RenderSurface& aSurface)
+    {
+    CHuiFxVg10OnscreenRenderbuffer* e = new (ELeave) CHuiFxVg10OnscreenRenderbuffer();
+    CleanupStack::PushL(e);
+    e->ConstructL(aPlugin, aSurface);
+    CleanupStack::Pop(e);
+    return e;
+    }
+
+void CHuiFxVg10OnscreenRenderbuffer::ConstructL(CHuiVg10RenderPlugin& aPlugin, CHuiVg10RenderSurface& aSurface)
+    {
+    CHuiFxRenderbuffer::ConstructL(aSurface.Size(), EBufferTypeOnscreen);
+    iPlugin = &aPlugin;
+    iSurface = &aSurface;
+    iTextureUsage = ERenderbufferUsageReadWrite;
+    
+#ifndef __WINS__ // Should possibly query the supported mode instead?
+    VGImageFormat imageInternalFormat = VG_sARGB_8888_PRE;
+#else
+    VGImageFormat imageInternalFormat = VG_sARGB_8888;
+#endif
+    
+    iImage = vgCreateImage(imageInternalFormat, Size().iWidth, Size().iHeight, VG_IMAGE_QUALITY_NONANTIALIASED);
+    HUIFX_VG_INVARIANT();
+    
+    // Initialize the context
+    iGc = iPlugin->CreateGcL();
+    BindAsRenderTarget();
+    iGc->InitState();
+    UnbindAsRenderTarget();
+    
+    // Let renderer know that we have been fiddlling with OpenVg state directly
+    // "iGc->InitState" confuses scissoring setting, so lets notify it.
+    CHuiVg10RenderPlugin& renderer = CHuiStatic::Vg10Renderer();
+    renderer.AddRestoreStateFlags(EHuiVg10GcStateFlagDirtyScissor);    
+    renderer.AddRestoreStateFlags(EHuiVg10GcStateFlagDirtyBlendMode);        
+    }
+
+CHuiFxVg10OnscreenRenderbuffer::~CHuiFxVg10OnscreenRenderbuffer()
+    {
+    vgDestroyImage(iImage);
+    HUIFX_VG_INVARIANT();
+    
+    delete iGc;
+    }
+
+CHuiGc& CHuiFxVg10OnscreenRenderbuffer::BindAsRenderTarget()
+    {
+    // Save current context and surfaces
+    iSavedContext = eglGetCurrentContext();
+    iSavedDrawSurface = eglGetCurrentSurface(EGL_DRAW);
+    iSavedReadSurface = eglGetCurrentSurface(EGL_READ);
+
+    // Bind our own surface
+    iSurface->MakeCurrent();
+    
+    return *iGc;
+    }
+
+void CHuiFxVg10OnscreenRenderbuffer::BindAsTexture(THuiFxRenderbufferUsage aUsage)
+    {
+    // Copy the contents of the framebuffer into our backbuffer image
+    // TODO: figure out a more efficient way of doing this
+    iTextureUsage = aUsage;
+    if (aUsage == ERenderbufferUsageReadWrite || aUsage == ERenderbufferUsageReadOnly)
+        {
+        BindAsRenderTarget();
+        vgGetPixels(iImage, 0, 0, 0, 0, Size().iWidth, Size().iHeight);
+        HUIFX_VG_INVARIANT();
+        UnbindAsRenderTarget();
+        }
+    }
+
+void CHuiFxVg10OnscreenRenderbuffer::UnbindAsTexture()
+    {
+    // Copy the contents from our backbuffer image to the framebuffer
+    if (iTextureUsage == ERenderbufferUsageReadWrite || iTextureUsage == ERenderbufferUsageWriteOnly)
+        {
+        BindAsRenderTarget();
+        vgSetPixels(0, 0, iImage, 0, 0, Size().iWidth, Size().iHeight);
+        HUIFX_VG_INVARIANT();
+        UnbindAsRenderTarget();
+        }
+    }
+
+void CHuiFxVg10OnscreenRenderbuffer::UnbindAsRenderTarget()
+    {
+    // Restore original surface & context
+    eglMakeCurrent(iPlugin->EglDisplay(), iSavedDrawSurface, iSavedReadSurface,
+                   iSavedContext);
+    }
+
+VGImage CHuiFxVg10OnscreenRenderbuffer::Image() const
+    {
+    return iImage;
+    }
+
+void CHuiFxVg10OnscreenRenderbuffer::PrepareForReuse(const TSize& /* aReusedRect */)
+    {
+    // this should never happen.
+    ASSERT(FALSE);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10OutlineFilter.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxVg10OutlineFilter.h"
+#include "HuiFxVg10RenderbufferBase.h"
+#include "HuiFxConstants.h"
+
+
+CHuiFxVg10OutlineFilter* CHuiFxVg10OutlineFilter::NewL()
+    {
+    CHuiFxVg10OutlineFilter* self = new (ELeave) CHuiFxVg10OutlineFilter();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+void CHuiFxVg10OutlineFilter::ConstructL()
+    {
+    CHuiFxFilter::ConstructL();
+    iOutlineX = 1.0;
+    iOutlineY = 1.0;
+    iSteepness = 20.0;
+    iColor = TRgb(0xff000000);
+    memset(iLUT, '\0', sizeof(iLUT));
+    
+    RegisterParameterL(KLitOutlineX, &iOutlineX);
+    RegisterParameterL(KLitOutlineY, &iOutlineY);
+    RegisterParameterL(KLitSteepness, &iSteepness);
+    RegisterParameterL(KLitColor, &iColor);
+    }
+CHuiFxVg10OutlineFilter *CHuiFxVg10OutlineFilter::CloneL() const
+    {
+    CHuiFxVg10OutlineFilter *filter = new(ELeave) CHuiFxVg10OutlineFilter;
+    filter->CHuiFxFilter::CopyFromL(this);
+    filter->iOutlineX = iOutlineX;
+    filter->iOutlineY = iOutlineY;
+    filter->iSteepness = iSteepness;
+    filter->iColor = iColor;
+    memcpy(filter->iLUT, iLUT, sizeof(iLUT));
+    filter->CopyParameterL(KLitOutlineX, &filter->iOutlineX, this);
+    filter->CopyParameterL(KLitOutlineY, &filter->iOutlineY, this);
+    filter->CopyParameterL(KLitSteepness, &filter->iSteepness, this);
+    filter->CopyParameterL(KLitColor, &filter->iColor, this);
+    return filter;    
+    }
+
+void CHuiFxVg10OutlineFilter::CalculateMargin(TMargins &aMargin) const
+{
+    aMargin.iLeft = iOutlineX*2; 
+    aMargin.iRight = iOutlineX*2;
+    aMargin.iTop = iOutlineY*2;
+    aMargin.iBottom = iOutlineY*2;
+}
+
+
+void CHuiFxVg10OutlineFilter::DrawEffect(CHuiFxEngine& aEngine, VGImage aTargetImage, VGImage aSourceImage, TInt aWidth, TInt aHeight)
+    {
+    VGfloat outline_x = clamp(iOutlineX, EPSILON, 128.0f);
+    VGfloat outline_y = clamp(iOutlineY, EPSILON, 128.0f);
+    VGubyte steepness = clamp((VGubyte)iSteepness, (VGubyte)0, (VGubyte)255);
+
+//    VGint width = vgGetParameteri(aSourceImage, VG_IMAGE_WIDTH);
+//    VGint height = vgGetParameteri(aSourceImage, VG_IMAGE_HEIGHT);
+    VGint width = aWidth;
+    VGint height = aHeight;
+
+    if(outline_x > EPSILON && outline_y > EPSILON) 
+        {
+        CHuiFxRenderbuffer* auxBuffer = aEngine.AcquireRenderbuffer(TSize(width, height));
+        if (!auxBuffer)
+            {
+            return;  // not enough memory --- filter not completed successfully
+            }
+        auxBuffer->BindAsTexture(ERenderbufferUsageReadWrite);
+        
+        VGImage auxImage = reinterpret_cast<CHuiFxVg10RenderbufferBase*>(auxBuffer)->Image();
+        
+        vgGaussianBlur(auxImage, aSourceImage, outline_x, outline_y, VG_TILE_PAD);
+
+        if(ParameterChanged())
+            {
+            UpdateLUT();
+            }
+        vgLookupSingle(aTargetImage, auxImage, iLUT, VG_ALPHA, VG_TRUE, VG_FALSE);
+        auxBuffer->UnbindAsTexture();
+        aEngine.ReleaseRenderbuffer(auxBuffer);
+        }
+    else    // fast path --- just copy
+        {
+        vgCopyImage(aTargetImage, 0, 0, aSourceImage, 0, 0, width, height, VG_FALSE);   
+        }
+    }
+
+
+void CHuiFxVg10OutlineFilter::UpdateLUT()
+    {
+    VGubyte red       = iColor.Red();
+    VGubyte green     = iColor.Green();
+    VGubyte blue      = iColor.Blue();
+    VGubyte steepness = (VGubyte)clamp(iSteepness, 0.0f, 255.0f);
+    VGubyte unnormalisedOpacity = (VGubyte)(clamp(iOpacity, 0.0f, 1.0f) * 255.0f);
+    
+    // generate ramp for alpha channel. the bigger the steepness the more solid the outline. 
+    for(int i = 0; i < 256; i++) 
+        {
+        VGubyte alpha = (i*steepness > unnormalisedOpacity) ? unnormalisedOpacity : i*steepness;
+        iLUT[i] = 0x00000000 | (red << 24) |(green << 16) | (blue << 8) | alpha;
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10RenderbufferBase.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxVg10RenderbufferBase.h"
+
+VGImage CHuiFxVg10RenderbufferBase::AcquireSubImage(const TRect& aRect)
+    {
+    TSize size = Size();
+    TRect parentImageRect(Position(),Size());
+    // Clip sub image rect to always be inside the buffer (to avoid error in vgChildImage) 
+    TRect clippedRect(aRect);
+    clippedRect.Intersection(parentImageRect); 
+      
+    if (clippedRect.iTl.iX == 0 && clippedRect.iTl.iY == 0 && clippedRect.Size() == size)
+        {
+        return Image(); // buffer is exactly the size of the rectangle and correctly positioned --- no need for childimage.
+        }
+    else
+        {
+        TInt x;
+        TInt y;
+        if(BufferType() == EBufferTypeOffscreen) 
+            {
+            x = 0;
+            y = 0;
+            }
+        else
+            {
+            x = clippedRect.iTl.iX;
+            y = size.iHeight - clippedRect.iBr.iY;    // Note: vertically flipped coordinate system. 
+                                                // aRect is in Hitchcock coordinates (top-left 0,0)
+                                                // but y is in VG coordinates (bottom-left 0,0).
+            }
+        VGImage ret = vgChildImage(Image(), x, y, clippedRect.Size().iWidth, clippedRect.Size().iHeight);
+        
+        HUIFX_VG_INVARIANT();
+        return ret;
+        }
+    }
+
+void CHuiFxVg10RenderbufferBase::ReleaseSubImage(VGImage aImage)
+    {
+    if (aImage != Image())
+        {
+        vgDestroyImage(aImage);
+        HUIFX_VG_INVARIANT();
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiFxVg10TransformFilter.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,233 @@
+/*
+* 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: 
+*
+*/
+
+#include "HuiFxVg10TransformFilter.h"
+#include <math.h>
+#include "HuiFxConstants.h"
+
+
+CHuiFxVg10TransformFilter* CHuiFxVg10TransformFilter::NewL()
+    {
+    CHuiFxVg10TransformFilter* self = new (ELeave) CHuiFxVg10TransformFilter();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+void CHuiFxVg10TransformFilter::ConstructL()
+    {
+    CHuiFxFilter::ConstructL();
+    iTranslationX = 0.0f;
+    iTranslationY = 0.0f;
+    iTranslationZ = 0.0f;
+    
+    iScaleX = 1.0f;
+    iScaleY = 1.0f;
+    iScaleZ = 1.0f;
+    iScaleOriginX = 0.0f;
+    iScaleOriginY = 0.0f;
+    iScaleOriginZ = 0.0f;
+    
+    iRotationOriginX = 0.0f;
+    iRotationOriginY = 0.0f;
+    iRotationOriginZ = 0.0f;
+    iRotationAngle = 0.0f;
+    iRotationAxisX = 0.0f;
+    iRotationAxisY = 0.0f;
+    iRotationAxisZ = 1.0f;
+    
+    iSkewAngleX = 0.0f;
+    iSkewAngleY = 0.0f;
+    iSkewAngleZ = 0.0f;
+    iSkewOriginX = 0.0f;
+    iSkewOriginY = 0.0f;
+    iSkewOriginZ = 0.0f;
+    
+    RegisterParameterL(KLitTranslationX, &iTranslationX);
+    RegisterParameterL(KLitTranslationY, &iTranslationY);
+    RegisterParameterL(KLitTranslationZ, &iTranslationZ);
+    
+    RegisterParameterL(KLitScaleX, &iScaleX);
+    RegisterParameterL(KLitScaleY, &iScaleY);
+    RegisterParameterL(KLitScaleZ, &iScaleZ);
+    RegisterParameterL(KLitScaleOriginX, &iScaleOriginX);
+    RegisterParameterL(KLitScaleOriginY, &iScaleOriginY);
+    RegisterParameterL(KLitScaleOriginZ, &iScaleOriginZ);
+    
+    RegisterParameterL(KLitRotationOriginX, &iRotationOriginX);
+    RegisterParameterL(KLitRotationOriginY, &iRotationOriginY);
+    RegisterParameterL(KLitRotationOriginZ, &iRotationOriginZ);
+    RegisterParameterL(KLitRotationAngle, &iRotationAngle);
+    RegisterParameterL(KLitRotationAxisX, &iRotationAxisX);
+    RegisterParameterL(KLitRotationAxisY, &iRotationAxisY);
+    RegisterParameterL(KLitRotationAxisZ, &iRotationAxisZ);
+    
+    RegisterParameterL(KLitSkewAngleX, &iSkewAngleX);
+    RegisterParameterL(KLitSkewAngleY, &iSkewAngleY);
+    RegisterParameterL(KLitSkewAngleZ, &iSkewAngleZ);
+    RegisterParameterL(KLitSkewOriginX, &iSkewOriginX);
+    RegisterParameterL(KLitSkewOriginY, &iSkewOriginY);
+    RegisterParameterL(KLitSkewOriginZ, &iSkewOriginZ);
+    }
+
+CHuiFxVg10TransformFilter *CHuiFxVg10TransformFilter::CloneL() const
+    {
+    CHuiFxVg10TransformFilter *filter = new(ELeave)CHuiFxVg10TransformFilter;
+    filter->CHuiFxFilter::CopyFromL(this);
+    filter->iTranslationX = iTranslationX;
+    filter->iTranslationY = iTranslationY;
+    filter->iTranslationZ = iTranslationZ;
+    
+    filter->iScaleX = iScaleX;
+    filter->iScaleY = iScaleY;
+    filter->iScaleZ = iScaleZ;
+    filter->iScaleOriginX = iScaleOriginX;
+    filter->iScaleOriginY = iScaleOriginY;
+    filter->iScaleOriginZ = iScaleOriginZ;
+    
+    filter->iRotationOriginX = iRotationOriginX;
+    filter->iRotationOriginY = iRotationOriginY;
+    filter->iRotationOriginZ = iRotationOriginZ;
+    filter->iRotationAngle = iRotationAngle;
+    filter->iRotationAxisX = iRotationAxisX;
+    filter->iRotationAxisY = iRotationAxisY;
+    filter->iRotationAxisZ = iRotationAxisZ;
+    
+    filter->iSkewAngleX = iSkewAngleX;
+    filter->iSkewAngleY = iSkewAngleY;
+    filter->iSkewAngleZ = iSkewAngleZ;
+    filter->iSkewOriginX = iSkewOriginX;
+    filter->iSkewOriginY = iSkewOriginY;
+    filter->iSkewOriginZ = iSkewOriginZ;
+    
+    filter->CopyParameterL(KLitTranslationX, &filter->iTranslationX, this);
+    filter->CopyParameterL(KLitTranslationY, &filter->iTranslationY, this);
+    filter->CopyParameterL(KLitTranslationZ, &filter->iTranslationZ, this);
+    
+    filter->CopyParameterL(KLitScaleX, &filter->iScaleX, this);
+    filter->CopyParameterL(KLitScaleY, &filter->iScaleY, this);
+    filter->CopyParameterL(KLitScaleZ, &filter->iScaleZ, this);
+    filter->CopyParameterL(KLitScaleOriginX, &filter->iScaleOriginX, this);
+    filter->CopyParameterL(KLitScaleOriginY, &filter->iScaleOriginY, this);
+    filter->CopyParameterL(KLitScaleOriginZ, &filter->iScaleOriginZ, this);
+    
+    filter->CopyParameterL(KLitRotationOriginX, &filter->iRotationOriginX, this);
+    filter->CopyParameterL(KLitRotationOriginY, &filter->iRotationOriginY, this);
+    filter->CopyParameterL(KLitRotationOriginZ, &filter->iRotationOriginZ, this);
+    filter->CopyParameterL(KLitRotationAngle, &filter->iRotationAngle, this);
+    filter->CopyParameterL(KLitRotationAxisX, &filter->iRotationAxisX, this);
+    filter->CopyParameterL(KLitRotationAxisY, &filter->iRotationAxisY, this);
+    filter->CopyParameterL(KLitRotationAxisZ, &filter->iRotationAxisZ, this);
+    
+    filter->CopyParameterL(KLitSkewAngleX, &filter->iSkewAngleX, this);
+    filter->CopyParameterL(KLitSkewAngleY, &filter->iSkewAngleY, this);
+    filter->CopyParameterL(KLitSkewAngleZ, &filter->iSkewAngleZ, this);
+    filter->CopyParameterL(KLitSkewOriginX, &filter->iSkewOriginX, this);
+    filter->CopyParameterL(KLitSkewOriginY, &filter->iSkewOriginY, this);
+    filter->CopyParameterL(KLitSkewOriginZ, &filter->iSkewOriginZ, this);
+    return filter;
+    }
+
+
+void CHuiFxVg10TransformFilter::CalculateMargin(TMargins &aMargin) const
+{
+    aMargin.iLeft = iTranslationX < 0.0 ? -iTranslationX : 0.0;
+    aMargin.iRight = iTranslationX > 0.0 ? iTranslationX : 0.0;
+    aMargin.iTop = iTranslationY < 0.0 ? -iTranslationY : 0.0;
+    aMargin.iBottom = iTranslationY > 0.0 ? iTranslationY : 0.0;
+    // TODO, how to deal with translationZ/ scale / rotation / skew?
+}
+
+TBool CHuiFxVg10TransformFilter::Draw(CHuiFxEngine& /*aEngine*/, CHuiGc& /*aGc*/,
+        CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource,
+        const TRect& /*aTargetRect*/, const TRect& aSourceRect)
+    {
+    aSource.BindAsTexture(ERenderbufferUsageReadOnly);
+    aTarget.BindAsRenderTarget();
+
+    VGImage srcImage  = (reinterpret_cast<CHuiFxVg10RenderbufferBase*>(&aSource))->AcquireSubImage(aSourceRect);
+
+    vgLoadIdentity();
+    vgScale(iScaleX, iScaleY);
+    vgSeti(VG_BLEND_MODE, VG_BLEND_SRC);
+    vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_NORMAL);
+    
+    identity();
+    
+    // Matrix multiplication is generally not commutative.
+    // Therefore the order of the transformations matters.
+    // In order to prevent the scaling ang skewing from affecting the translation,
+    // if seems wiser to do the translation first, otherwise the results seem to be unpredictable.
+    
+    // Translation
+    if (iTranslationX != 0.0f || iTranslationY != 0.0f || iTranslationZ != 0.0f)
+        {
+        translate(iTranslationX, iTranslationY, iTranslationZ);
+        }    
+
+    // Scaling
+    if (iScaleX != 1.0f || iScaleY != 1.0f || iScaleZ != 1.0f)
+        {
+        translate(iScaleOriginX, iScaleOriginY, iScaleOriginZ);
+        scale(iScaleX, iScaleY, iScaleZ); 
+        translate(-iScaleOriginX, -iScaleOriginY, -iScaleOriginZ);
+        }
+    
+    // Skewing
+    if (iSkewAngleX != 0.0f || iSkewAngleY != 0.0f || iSkewAngleZ != 0.0f)
+        {
+        const TReal32 radsPerDeg = 2.0f * (float)M_PI / 360.0f;
+        TReal32 skewX = tan(iSkewAngleX * radsPerDeg);
+        TReal32 skewY = tan(iSkewAngleY * radsPerDeg);
+        TReal32 skewZ = tan(iSkewAngleZ * radsPerDeg);
+        translate(iSkewOriginX, iSkewOriginY, iSkewOriginZ);
+        shear(skewX, skewY, skewZ); 
+        translate(-iSkewOriginX, -iSkewOriginY, -iSkewOriginZ);
+        }
+
+    // Rotation
+    if (iRotationAngle != 0.0f)
+        {
+        translate(iRotationOriginX, iRotationOriginY, iRotationOriginZ);
+        rotate(iRotationAngle, iRotationAxisX, iRotationAxisY, iRotationAxisZ); 
+        translate(-iRotationOriginX, -iRotationOriginY, -iRotationOriginZ);
+        }
+
+/*
+    // Translation
+    if (iTranslationX != 0.0f || iTranslationY != 0.0f || iTranslationZ != 0.0f)
+        {
+        translate(iTranslationX, iTranslationY, iTranslationZ);
+        }    
+*/
+        
+   ASSERT(!"TODO: implement the following:");
+    // TODO: project vertices
+    // TODO: create warp quad matrix from projected vertices,
+    // see http://torus.untergrund.net/misc/projective_image_warping.pdf
+    // TODO load matrix
+    vgDrawImage(srcImage);
+    
+    // TODO: pixel relative parameters
+    HUIFX_VG_INVARIANT();
+    (reinterpret_cast<CHuiFxVg10RenderbufferBase*>(&aSource))->ReleaseSubImage(srcImage);
+
+    aTarget.UnbindAsRenderTarget();
+    aSource.UnbindAsTexture();
+    
+    return ETrue;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10CurvePath.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,398 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*  Note that we do not use OpenVG's line/arc rendering directly, since the
+*  curves we are dealing with may have variable widths, which is not supported
+*  by OpenVG yet. Also, only one opacity factor per path is supported.
+*
+*/
+
+#include "HuiVg10CurvePath.h"
+#include "HuiVg10Gc.h"
+#include "uiacceltk/HuiRealPoint.h"
+#include "uiacceltk/HuiUtil.h"
+
+CHuiVg10CurvePath::CHuiVg10CurvePath()
+        : CHuiCurvePath()
+    {
+    }
+    
+    
+void CHuiVg10CurvePath::ConstructL()
+    {
+    iPathCommands = 0;
+    iLastOpacityFactor = -1.0;
+    iMaxTupleCount = 0;
+    iUsedTupleCount = 0;
+    iPathCoords = 0;
+
+    iPath = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 
+                         1.0f, 0.0f, 32, 32, VG_PATH_CAPABILITY_APPEND_TO);
+    HUI_VG_INVARIANT();
+    }
+    
+  
+CHuiVg10CurvePath::~CHuiVg10CurvePath()
+    {
+    Reset();
+    vgDestroyPath(iPath);
+    iPath = 0;
+    HUI_VG_INVARIANT();
+    }
+  
+    
+void CHuiVg10CurvePath::Reset()
+    {
+    CHuiCurvePath::Reset();
+    ResetPath();
+    }
+
+void CHuiVg10CurvePath::ResetPath()
+    {
+    ResetTuples();
+    vgClearPath(iPath, VG_PATH_CAPABILITY_APPEND_TO);
+    HUI_VG_INVARIANT();
+    }
+    
+void CHuiVg10CurvePath::ResetTuples()
+    {
+    delete[] iPathCoords;
+    delete[] iPathCommands;
+    iPathCoords = 0;
+    iPathCommands = 0;
+    iMaxTupleCount = 0;
+    iUsedTupleCount = 0;
+    }
+
+TInt CHuiVg10CurvePath::SegmentTuples(const TSegment& aSegment) const
+    {
+    if(aSegment.iType == ESegmentTypeLine)
+        {
+        return 2;
+        }
+    else if(aSegment.iType == ESegmentTypeArc)
+        {
+        const TReal32 KAnglePerSegment = 5;
+        TInt tuples = Abs(aSegment.iAngleDelta) / KAnglePerSegment + 1;
+        if(tuples < 2)
+            {
+            tuples = 2;
+            }
+        return tuples;
+        }
+    ASSERT(0);
+    return 0;
+    }
+        
+void CHuiVg10CurvePath::Update(TReal32 aStartPos, TReal32 aEndPos, 
+                               TReal32 aAlphaFactor,
+                               MHuiMappingFunction* aAlphaFunction,
+                                 MHuiMappingFunction* aWidthFunction) __SOFTFP
+    {
+    const TReal32 KEpsilon = .001;
+    if(!GetVisual() && !NeedUpdate() && Abs(iLastOpacityFactor - aAlphaFactor) < KEpsilon)
+        {
+        // No need to update every time the path is drawn.
+        return;
+        }
+
+    iLastOpacityFactor = aAlphaFactor;        
+    
+    // Allocate enough memory for the path coordinates and commands. This is 
+    // the maximum number of path nodes that can be. If aStartPos and aEndPos are 
+    // somewhere in the middle, a smaller amount of data is generated.
+    TInt tuples = 0;                    
+    TInt i = 0;    
+    for(i = 0; i < SegmentCount(); ++i)
+        {
+        tuples += SegmentTuples(Segment(i)) - 1;
+        }
+        
+    // One extra tuple for the end.        
+    tuples++;
+    
+    TRAPD(err, SetTupleCountL(tuples));
+    if(err != KErrNone)
+        {
+        ResetPath();
+        return;
+        }
+   
+    // Generate commands for the entire path, starting from aStartPos
+    // and stopping at aEndPos.
+    TReal32 pos = 0;
+    iUsedTupleCount = 0;
+    
+    for(i = 0; i < SegmentCount(); ++i)
+        {
+        const TSegment& segment = Segment(i);
+        TReal32 segmentEnd = pos + segment.iLength;
+        
+        if(aStartPos > segmentEnd)
+            {
+            // The start is past the end of the segment.
+            continue;
+            }            
+        if(aEndPos < pos)
+            {
+            // We're past the end!
+            break;
+            }
+            
+        TReal32 start = pos;
+        TReal32 end = segmentEnd;
+        TBool isFinal = EFalse;        
+        
+        if(start < aStartPos)
+            {
+            start = aStartPos;
+            }
+        if(end >= aEndPos || i == SegmentCount() - 1)
+            {
+            end = aEndPos;
+            isFinal = ETrue;
+            }
+        else
+            {
+            isFinal = EFalse;
+            }                   
+            
+        // Normalize.
+        start -= pos;
+        end -= pos;
+            
+        MakeSegmentTuples(segment, start, end, isFinal, aAlphaFactor, 
+                          aAlphaFunction, aWidthFunction);
+        
+        pos += segment.iLength;
+        }
+    ASSERT(iUsedTupleCount <= iMaxTupleCount);
+    ASSERT(iUsedTupleCount > 0);
+
+    // First traverse the curve from start to end 
+    vgAppendPathData(iPath, iUsedTupleCount, iPathCommands, iPathCoords);
+    HUI_VG_INVARIANT();
+   
+    // And then back again on the other side
+    TInt tailIndex = 2 * iMaxTupleCount - iUsedTupleCount;
+    vgAppendPathData(iPath, iUsedTupleCount, &iPathCommands[tailIndex], &iPathCoords[2 * tailIndex]);
+    HUI_VG_INVARIANT();
+
+    // We do not need the tuple arrays anymore so we can free them
+    ResetTuples();
+    
+    CHuiCurvePath::Update(aStartPos, aEndPos, aAlphaFactor, 
+                          aAlphaFunction, aWidthFunction);
+    }
+
+void CHuiVg10CurvePath::SetTupleCountL(TInt aTupleCount)
+    {
+    if(iMaxTupleCount != aTupleCount)
+        {
+        ResetPath();
+        
+        // Allocate new arrays.
+        iMaxTupleCount = aTupleCount;
+        
+        if(iMaxTupleCount > 0)
+            {
+            iPathCoords = new (ELeave) VGfloat[2 * iMaxTupleCount * 2];
+            iPathCommands = new (ELeave) VGubyte[iMaxTupleCount * 2];
+
+            // Since every path command is the same, we can do this at 
+            // allocation time
+            for (TInt i = 0; i < iMaxTupleCount * 2; i++)
+                {
+                iPathCommands[i] = VG_LINE_TO;
+                }
+            }
+        }
+    }
+
+void CHuiVg10CurvePath::MakeSegmentTuples(const TSegment& aSegment,
+                                          TReal32 aStart, TReal32 aEnd,
+                                          TBool aIsFinal,
+                                          TReal32 aAlphaFactor,
+                                          MHuiMappingFunction* aAlphaFunction,
+                                          MHuiMappingFunction* aWidthFunction)
+    {
+    // aStart and aEnd are in range [0,length].
+    THuiRealPoint point;
+    THuiRealPoint normal;
+    TReal32 normStart = (aStart + aSegment.iTotalPos) / Length();
+    TReal32 normEnd = (aEnd + aSegment.iTotalPos) / Length(); 
+    
+    if(aSegment.iType == ESegmentTypeLine)
+        {
+        EvaluateSegment(aStart, aSegment, point, &normal);
+        TReal32 width = 1;
+        if(aWidthFunction)
+            {
+            width = aWidthFunction->MapValue(normStart, 0);
+            }
+        TReal32 alpha = 1;
+        if(aAlphaFunction)
+            {
+            alpha = aAlphaFunction->MapValue(normStart, 0);
+            }
+        AddTuple(point, normal, width, alpha * aAlphaFactor);
+        
+        if(aIsFinal)
+            {
+            // Does not reach the end, so we must also make an end tuple.
+            EvaluateSegment(aEnd, aSegment, point, &normal);
+            if(aWidthFunction)
+                {
+                width = aWidthFunction->MapValue(normEnd, 0);
+                }
+            else
+                {
+                width = 1;
+                }
+            if(aAlphaFunction)
+                {
+                alpha = aAlphaFunction->MapValue(normEnd, 0);
+                }
+            else
+                {                
+                alpha = 1;
+                }
+            AddTuple(point, normal, width, alpha * aAlphaFactor);
+            }
+        }
+        
+    if(aSegment.iType == ESegmentTypeArc)
+        {
+        // Make a set of tuples.
+        TInt count = SegmentTuples(aSegment);
+        TInt endCount = count;
+        if(aIsFinal)
+            {
+            endCount = count - 1;
+            }
+        else
+            {
+            count--;
+            endCount--;
+            }
+        
+        for(TInt i = 0; i < count; ++i)
+            {
+            TReal32 off = i / TReal32(endCount);
+            EvaluateSegment(aStart + (aEnd - aStart) * off, aSegment, point, 
+                            &normal);
+            TReal32 width = 1;
+            if(aWidthFunction)
+                {
+                width = aWidthFunction->MapValue(normStart + 
+                    (normEnd - normStart) * off, 0);
+                }
+            TReal32 alpha = 1;
+            if(aAlphaFunction)
+                {
+                alpha = aAlphaFunction->MapValue(normStart + 
+                    (normEnd - normStart) * off, 0);
+                }
+            AddTuple(point, normal, width, alpha * aAlphaFactor);
+            }
+        }
+    }
+
+void CHuiVg10CurvePath::AddTuple(const THuiRealPoint& aPoint,
+                                 const THuiRealPoint& aNormal,
+                                 TReal32 aWidth, TReal32 /*aAlpha*/)
+    {
+    ASSERT(iUsedTupleCount < iMaxTupleCount);
+
+    // Make a pair of vertices. Normal is to the left.
+    //    
+    // The first half of the path goes from the beginning of the curve 
+    // to the end, while the second half traverses the same route 
+    // backwards:
+    //
+    //     0                     iUsedTupleCount
+    //     >--->--->---> ... >---v
+    //     |                     |
+    //     ^---<---<---< ... <---<
+    //     iMaxTupleCount -      iMaxtupleCount
+    //     iUsedTupleCount
+    //
+    // The coordinate array looks like this:
+    //
+    //     +---+---+---+---+---+---+---+---+    N: tuple N left vertex
+    //     | 0 | 1 | 2 | X | X | 2'| 1'| 0'|   N': tuple N right vertex
+    //     +---+---+---+---+---+---+---+---+    X: unused
+    //
+    VGfloat* vertex1 = &iPathCoords[2 * iUsedTupleCount];
+    VGfloat* vertex2 = &iPathCoords[2 * (2 * iMaxTupleCount - iUsedTupleCount - 1)];
+    const CHuiVisual* visual = GetVisual();
+
+    if (visual)
+        {
+        THuiRealPoint point1(aPoint.iX + aNormal.iX * aWidth/2,aPoint.iY + aNormal.iY * aWidth/2);
+        THuiRealPoint point2(aPoint.iX - aNormal.iX * aWidth/2,aPoint.iY - aNormal.iY * aWidth/2);
+        point1 = visual->LocalPointInPixels(point1);
+        point2 = visual->LocalPointInPixels(point2);  
+        vertex1[0] = point1.iX;
+        vertex1[1] = point1.iY;
+        vertex2[0] = point2.iX;
+        vertex2[1] = point2.iY;
+        }
+    else
+        {
+        vertex1[0] = aPoint.iX + aNormal.iX * aWidth/2;
+        vertex1[1] = aPoint.iY + aNormal.iY * aWidth/2;
+        vertex2[0] = aPoint.iX - aNormal.iX * aWidth/2;
+        vertex2[1] = aPoint.iY - aNormal.iY * aWidth/2;     
+        }
+
+    iUsedTupleCount++;
+    }
+
+void CHuiVg10CurvePath::Draw(const TPoint& aOrigin, CHuiGc* aGc) const
+    {
+    CHuiVg10Gc* gc = static_cast<CHuiVg10Gc*>(aGc);
+    ASSERT(gc);
+    gc->UpdateColor();
+    
+    VGPaint paint = vgGetPaint(VG_FILL_PATH);
+    VGfloat color[4], modifiedColor[4];
+    
+    if (paint != VG_INVALID_HANDLE)
+        {
+        vgGetParameterfv(paint, VG_PAINT_COLOR, 4, color);
+        modifiedColor[0] = color[0];
+        modifiedColor[1] = color[1];
+        modifiedColor[2] = color[2];
+        modifiedColor[3] = iLastOpacityFactor;
+        vgSetParameterfv(paint, VG_PAINT_COLOR, 4, modifiedColor);
+        HUI_VG_INVARIANT();
+        }
+
+    gc->UpdateMatrix(VG_MATRIX_PATH_USER_TO_SURFACE);
+    vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
+    vgTranslate(aOrigin.iX, aOrigin.iY);
+    vgDrawPath(iPath, VG_FILL_PATH);
+    vgTranslate(-aOrigin.iX, -aOrigin.iY);
+    vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
+
+    HUI_VG_INVARIANT();
+
+    if (paint != VG_INVALID_HANDLE)
+        {
+        vgSetParameterfv(paint, VG_PAINT_COLOR, 4, color);
+        HUI_VG_INVARIANT();
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Gc.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,2284 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CHuiVg10Gc, an OpenVG 1.0 version of the HUITK
+*                graphics context.
+*
+*/
+
+
+
+#include "HuiVg10Gc.h"  // Class definition
+#include "HuiVg10RenderPlugin.h"
+#include "HuiVg10Texture.h"
+#include "HuiVg10RenderSurface.h"
+#include "uiacceltk/HuiSegmentedTexture.h"
+#include "uiacceltk/HuiFont.h"
+#include "uiacceltk/HuiImage.h"
+#include "uiacceltk/HuiTextMesh.h"
+#include "uiacceltk/HuiCurvePath.h"
+#include "uiacceltk/HuiTransformation.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/huifixmath.h"
+#include "HuiRenderSurface.h"
+#include "../../CommonInc/uiacceltkdomaincrkeys.h"
+
+#include <e32math.h>
+#include <VG/vgu.h>
+#ifdef __NVG
+#pragma message( "NVG Defined!" )
+    #include <nvg.h>
+    #include <AknIconHeader.h>
+    #include <AknIconUtils.h>
+    #include "NVGIcon.h"
+#endif
+
+const TInt KHuiMaxVgScissorRects = 32;
+
+/** Only render colorful rectangles instead of real graphics 
+ *  content. Useful for debugging broken OpenVG drivers.
+ */
+//#define RENDER_DEBUG_RECTANGLES
+
+CHuiVg10Gc* CHuiVg10Gc::NewL()
+    {
+    CHuiVg10Gc* self = CHuiVg10Gc::NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+CHuiVg10Gc* CHuiVg10Gc::NewLC()
+    {
+    CHuiVg10Gc* self = new (ELeave) CHuiVg10Gc();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+
+CHuiVg10Gc::CHuiVg10Gc()
+        : CHuiGc()
+    {
+    }
+
+
+void CHuiVg10Gc::ConstructL()
+    {
+    // iMatrix stack must be allocated here because InitState() is not allowed to leave
+    
+    iMatrixStack = CHuiMatrixStack::NewL();
+#ifdef __NVG
+    CHuiVg10RenderPlugin& renderer = (CHuiVg10RenderPlugin&) CHuiStatic::Renderer();
+    iNvgEngine = &renderer.NvgEngine();
+#endif    
+    }
+
+
+CHuiVg10Gc::~CHuiVg10Gc()
+    {
+#ifdef __NVG
+    // Don't delete the iNvgEngine, it's owned by the plugin!
+    iNvgEngine = NULL;
+#endif    
+    delete iMatrixStack;
+    
+    vgDestroyPath(iPath);
+    vgDestroyPath(iImagePath);
+    vgDestroyPath(iRectPath);
+    vgDestroyPath(iRoundRectPath);
+    vgDestroyPath(iLinePath);
+    vgDestroyPath(iBorderPath);
+    vgDestroyPath(iArcPath);
+    vgDestroyPaint(iPaint);
+    vgDestroyPaint(iGradientPaint);
+    vgDestroyPath(iEllipsePath);
+    }
+    
+
+void CHuiVg10Gc::Push(THuiGcMatrix aMatrix)
+    {
+    if (aMatrix == EHuiGcMatrixModel)
+        {
+        // Replicate the current OpenVG matrix to the matrix stack
+        UpdateClientMatrix();
+        iMatrixStack->Push();
+        
+        // Save the matrix flags
+        iMatrixFlagsStack.Append(iMatrixFlags);
+        }
+    }
+
+
+void CHuiVg10Gc::Pop(THuiGcMatrix aMatrix)
+    {
+    if (aMatrix == EHuiGcMatrixModel)
+        {
+        // Replicate the current matrix to OpenVG
+        iMatrixStack->Pop();
+        CHuiMatrixStack::TMatrix& matrix = iMatrixStack->Current();
+        vgLoadMatrix((VGfloat*)matrix.iMatrix);
+        
+        // Restore the matrix flags
+        iMatrixFlags = iMatrixFlagsStack[iMatrixFlagsStack.Count() - 1];
+        iMatrixFlagsStack.Remove(iMatrixFlagsStack.Count() - 1);
+        HUI_VG_INVARIANT();
+        }
+    }
+
+
+void CHuiVg10Gc::LoadIdentity(THuiGcMatrix aMatrix)
+    {
+    if (aMatrix == EHuiGcMatrixModel)
+        {
+        vgLoadIdentity();
+        
+        TRect displayArea = DisplayArea();            
+        TInt h = displayArea.Height();
+        TInt w = displayArea.Width();
+
+        // DisplayArea is rotated if orientation is rotated, so we must "counter rotate"
+        // to avoid rotating too much.
+        if(Orientation() == EOrientationCCW90 || Orientation() == EOrientationCW90)
+            {
+            TInt tmp = w;
+            w = h;
+            h = tmp;
+            }
+        
+        // Flip the Y axis to match Hitchcock's coordinate system
+        vgTranslate(0, h); 
+        vgScale(1.0f, -1.0f);
+        
+        if(Orientation() == EOrientationCCW90)
+            {
+            // Rotate around origo and move back to displayarea
+            vgRotate(90);
+            vgTranslate(0, -w);
+            }
+        else if(Orientation() == EOrientationCW90)
+            {            
+            // Rotate around origo and move back to displayarea
+            vgRotate(-90);
+            vgTranslate(-h, 0);
+            }
+        else if (Orientation() == EOrientation180)
+            {
+            // Rotate around origo and move back to displayarea
+            vgRotate(-180);
+            vgTranslate(-w, -h);            
+            }                   
+        else
+            {
+            // Nothing to do ?
+            }
+        
+        // Reset the flags for this matrix
+        iMatrixFlags = 0;
+        
+        HUI_VG_INVARIANT();
+        }
+    }
+
+
+void CHuiVg10Gc::Multiply(THuiGcMatrix aStack, TReal32 aMatrix[16])
+    {
+    if (aStack == EHuiGcMatrixModel)
+        {
+        const VGfloat m[9] = 
+            {
+            aMatrix[0], aMatrix[1], aMatrix[2],
+            aMatrix[4], aMatrix[5], aMatrix[6],
+            aMatrix[8], aMatrix[9], aMatrix[10],
+            };
+        vgMultMatrix(m);
+        HUI_VG_INVARIANT();
+        }
+    }
+
+
+void CHuiVg10Gc::Translate(THuiGcMatrix aMatrix,
+                           TReal32 aX, TReal32 aY, TReal32 /*aZ*/) __SOFTFP
+    {
+    if (aMatrix == EHuiGcMatrixModel)
+        {
+        vgTranslate(aX, aY);
+        HUI_VG_INVARIANT();
+        }
+    }
+
+
+void CHuiVg10Gc::Scale(THuiGcMatrix aMatrix,
+                         TReal32 aX, TReal32 aY, TReal32 /*aZ*/) __SOFTFP
+    {
+    if (aMatrix == EHuiGcMatrixModel)
+        {
+        vgScale(aX, aY);
+        HUI_VG_INVARIANT();
+        }
+    }
+
+void CHuiVg10Gc::Shear(THuiGcMatrix aMatrix,
+                       TReal32 aX, TReal32 aY, TReal32 /*aZ*/) __SOFTFP
+    {
+    if (aMatrix == EHuiGcMatrixModel)
+        {
+        vgShear(aX, aY);
+        HUI_VG_INVARIANT();
+        }
+    }
+
+void CHuiVg10Gc::Rotate(THuiGcMatrix aMatrix, TReal32 aAngle,
+                        TReal32 aX, TReal32 aY, TReal32 aZ) __SOFTFP
+    {
+    if (aMatrix != EHuiGcMatrixModel)
+        {
+        return;
+        }
+
+    // Only rotation around the unit Z axis is supported
+	if (aX != 0.0f || aY != 0.0f || Abs(aZ) != 1.0f)
+	    {
+	    return;
+	    }
+		
+    if (aZ < 0)
+        {
+        aAngle = -aAngle;
+        }
+    
+    iMatrixFlags |= EMatrixFlagsRotation;
+    vgRotate(aAngle);
+    HUI_VG_INVARIANT();
+    }
+
+
+// Replicate the current OpenVG matrix to the matrix stack
+void CHuiVg10Gc::UpdateMatrix(VGMatrixMode aMatrix)
+    {
+    VGfloat m[9];
+    ASSERT(vgGeti(VG_MATRIX_MODE) == VG_MATRIX_IMAGE_USER_TO_SURFACE);
+    vgGetMatrix(m);
+    vgSeti(VG_MATRIX_MODE, aMatrix);
+    vgLoadMatrix(m);
+    vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
+        
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Gc::UpdateClientMatrix()
+    {
+    // Replicate the current OpenVG matrix to the matrix stack
+    vgGetMatrix((VGfloat*)iMatrixStack->Current().iMatrix);
+    
+    // The matrix is *probably* not an identity transform
+    iMatrixStack->Current().iIsIdentity = EFalse;
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Gc::CreateVgObjectsL()
+    {
+    // Make sure we have enough resources to work with
+    ASSERT(vgGeti(VG_MAX_SCISSOR_RECTS) >= 1);
+    
+    // Create the default VG objects
+    iPath = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 
+                         5, 8, VG_PATH_CAPABILITY_APPEND_TO);
+    iImagePath = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 
+                              5, 8, VG_PATH_CAPABILITY_APPEND_TO | VG_PATH_CAPABILITY_MODIFY);
+    iArcPath = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 
+                            2, 7, VG_PATH_CAPABILITY_APPEND_TO);
+    iPaint = vgCreatePaint();
+    iGradientPaint = vgCreatePaint();
+    iBlendMode = VG_BLEND_SRC_OVER;
+
+    // Initialize a rectangle path with dummy coordinates
+    iRectPath = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 
+                             5, 8, VG_PATH_CAPABILITY_APPEND_TO | VG_PATH_CAPABILITY_MODIFY);
+
+    iRoundRectPath = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 
+                                 5, 8, VG_PATH_CAPABILITY_APPEND_TO | VG_PATH_CAPABILITY_MODIFY);
+
+    iEllipsePath = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 
+                                 5, 8, VG_PATH_CAPABILITY_APPEND_TO | VG_PATH_CAPABILITY_MODIFY);
+    
+    const VGubyte rectSegments[] =
+        {
+        VG_MOVE_TO_ABS,
+        VG_LINE_TO_REL,
+        VG_LINE_TO_REL,
+        VG_LINE_TO_REL,
+        VG_CLOSE_PATH
+        };
+    const VGfloat rectCoords[] = 
+        {
+         0.0f, 0.0f,             // (x, y)
+         1.0f, 0.0f,             // (width, 0)
+         0.0f, 1.0f,             // (0, height)
+        -1.0f, 0.0f,             // (-width, 0)
+        };
+    vgAppendPathData(iRectPath, 5, rectSegments, rectCoords);
+    vgRemovePathCapabilities(iRectPath, VG_PATH_CAPABILITY_APPEND_TO);
+    vgAppendPathData(iImagePath, 5, rectSegments, rectCoords);
+    vgRemovePathCapabilities(iImagePath, VG_PATH_CAPABILITY_APPEND_TO);
+
+    // Initialize a line path with dummy coordinates
+    iLinePath = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 
+                             2, 4, VG_PATH_CAPABILITY_APPEND_TO | VG_PATH_CAPABILITY_MODIFY);
+    const VGubyte lineSegments[] =
+        {
+        VG_MOVE_TO_ABS,
+        VG_LINE_TO_ABS,
+        };
+    const VGfloat lineCoords[] = 
+        {
+        0.0f, 0.0f,             // (x, y)
+        1.0f, 1.0f,             // (x, y)
+        };
+    vgAppendPathData(iLinePath, 2, lineSegments, lineCoords);
+    vgRemovePathCapabilities(iLinePath, VG_PATH_CAPABILITY_APPEND_TO);
+    
+    // Initialize a path for drawing borders
+    iBorderPath = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 
+                               11, 10 * 2, VG_PATH_CAPABILITY_APPEND_TO | VG_PATH_CAPABILITY_MODIFY);
+
+    const VGubyte borderSegments[12] =
+        {
+        VG_MOVE_TO_ABS,
+        VG_LINE_TO_REL,
+        VG_LINE_TO_REL,
+        VG_LINE_TO_REL,
+        VG_LINE_TO_REL,
+        VG_LINE_TO_REL,
+        VG_LINE_TO_REL,
+        VG_LINE_TO_REL,
+        VG_LINE_TO_REL,
+        VG_LINE_TO_REL,
+        VG_LINE_TO_REL,
+        VG_CLOSE_PATH,
+        };
+
+    const VGfloat borderCoords[10 * 2] = 
+        {
+        0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
+        0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
+        0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
+        0.0f, 0.0f, 0.0f, 0.0f, 0.0f,
+        };
+
+    vgAppendPathData(iBorderPath, 12, borderSegments, borderCoords);
+    vgRemovePathCapabilities(iBorderPath, VG_PATH_CAPABILITY_APPEND_TO);
+        
+    // Get hardware configuration
+    TInt hwConf = 0; // the defaulf value for everything is 0 to allow new flags to be defined
+    HuiUtil::GetValueFromCentralRepository( KUIAccelTKHWConfigurationFlags, hwConf );
+    if ( hwConf & KHuiAntialiasing )
+        {
+        SetQuality( EHuiQualityAccurate );
+        }
+    else
+        {
+        SetQuality( EHuiQualityFast );
+        }
+
+    
+    iVgObjectsCreated = ETrue;
+    }
+ 
+void CHuiVg10Gc::InitState()
+    {
+    // Clean matrix stack in case there is anything left
+    // We can't construct a new stack here because we are not allowed to leave.
+    // We keep the original stack and just delete the contents leaving one 
+    // identity matrix that is always added when a new matrix stack is created
+    TInt i = 0;
+    // One identity matrix will remain.
+    // When a new matrix stack is created, one identity matrix is added
+    // It can never be removed, the code would panic.
+    for ( i = 0; i < iMatrixStack->Count() - 2; i++ )
+        {
+        iMatrixStack->Pop(); 
+        }
+    // remove flags from stack, too.
+    iMatrixFlagsStack.Reset();
+
+    iScissorRect = TRect(0, 0, 0, 0);
+    iMatrixFlags = 0;
+    
+    if (!iVgObjectsCreated)
+        {
+        TRAP_IGNORE(CreateVgObjectsL());    
+        }
+
+    // Default paint
+    vgSetParameteri(iPaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
+    vgSetPaint(iPaint, VG_FILL_PATH | VG_STROKE_PATH);
+        
+    // Gradient paint
+    vgSetParameteri(iGradientPaint, VG_PAINT_TYPE, VG_PAINT_TYPE_LINEAR_GRADIENT);
+        
+    HUI_VG_INVARIANT();
+    
+    // Reset default state
+    
+    Enable(EFeatureBlending);
+    Disable(EFeatureDepthTest);
+	iStateScissorTest = ETrue;    
+    Disable(EFeatureClipping);
+
+    // Use the image matrix as the primary matrix
+    vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
+
+    RestoreState();
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Gc::SetQuality(THuiQuality aQuality)
+    {
+    CHuiGc::SetQuality(aQuality);
+    switch (Quality())
+        {
+        case EHuiQualityAccurate:
+            vgSeti(VG_RENDERING_QUALITY, VG_RENDERING_QUALITY_BETTER);
+            vgSeti(VG_IMAGE_QUALITY, VG_IMAGE_QUALITY_BETTER);
+            break;
+        case EHuiQualityFast:
+            vgSeti(VG_RENDERING_QUALITY, VG_RENDERING_QUALITY_FASTER);
+            vgSeti(VG_IMAGE_QUALITY, VG_IMAGE_QUALITY_FASTER);
+            break;
+        default:
+            break;
+        }
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Gc::SetFillRule( THuiFillMode aFillMode )
+    {   
+    switch (aFillMode)
+       {
+       case EHuiFillNonZero:
+           vgSeti(VG_FILL_RULE, VG_NON_ZERO);
+           break;
+       case EHuiFillEvenOdd:
+           vgSeti(VG_FILL_RULE, VG_EVEN_ODD);
+           break;
+       default:
+           break;
+       }
+    HUI_VG_INVARIANT();   
+    }
+
+void CHuiVg10Gc::RestoreState() const
+    {
+    // Restore paint
+    vgSetPaint(iPaint, VG_FILL_PATH | VG_STROKE_PATH);        
+
+    // Restore scissor test state
+    if(iStateScissorTest)
+        {
+        vgSeti(VG_SCISSORING, VG_TRUE);
+        }
+    else
+        {
+        vgSeti(VG_SCISSORING, VG_FALSE);
+        }
+    
+    // Restore scissor rects
+    // This fixes CHuiFxEffect cached draw
+    TInt count = iClipRegion.Count();
+    VGint coords[KHuiMaxVgScissorRects * 4];
+
+    if(count > KHuiMaxVgScissorRects)
+        {
+        count = KHuiMaxVgScissorRects; //only 32 scissor rects supported    
+        }
+        
+    TInt numberOfCoords = count*4;
+    for ( TInt i = 0, j=0 ; i < numberOfCoords ; j++)
+        { 
+        coords[i++] = iClipRegion[j].iTl.iX;
+        coords[i++] = iClipRegion[j].iTl.iY;
+        coords[i++] = iClipRegion[j].Width();
+        coords[i++] = iClipRegion[j].Height();      
+        }
+    
+    vgSetiv(VG_SCISSOR_RECTS, numberOfCoords, coords);          
+
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Gc::RestoreFlaggedState() const
+    {
+    // Get the changed stateflags from the renderplugin
+    CHuiVg10RenderPlugin& renderer = (CHuiVg10RenderPlugin&) CHuiStatic::Renderer();
+    TInt flags = renderer.GetRestoreStateFlags();
+    
+    // First a quick check, if nothing needs to be done
+    if(!flags)
+        {
+        return;
+        }
+      
+    // Check each flag and act accrodingly!
+    if(flags & EHuiVg10GcStateFlagDirtyPaint)
+        {
+        // Restore paint
+        vgSetPaint(iPaint, VG_FILL_PATH | VG_STROKE_PATH);
+        }
+
+    if(flags & EHuiVg10GcStateFlagDirtyScissor)
+        {
+        // Restore scissor test state
+        if(iStateScissorTest)
+            {
+            vgSeti(VG_SCISSORING, VG_TRUE);
+            }
+        else
+            {
+            vgSeti(VG_SCISSORING, VG_FALSE);
+            }
+        }
+    
+    if(flags & EHuiVg10GcStateFlagDirtyScissorRects)
+        {
+        // Restore scissor rects
+        TInt count = iClipRegion.Count();
+        VGint coords[KHuiMaxVgScissorRects * 4];
+
+        if(count > KHuiMaxVgScissorRects)
+            {
+            count = KHuiMaxVgScissorRects; //only 32 scissor rects supported    
+            }
+            
+        TInt numberOfCoords = count*4;
+        for ( TInt i = 0, j=0 ; i < numberOfCoords ; j++)
+            { 
+            coords[i++] = iClipRegion[j].iTl.iX;
+            coords[i++] = iClipRegion[j].iTl.iY;
+            coords[i++] = iClipRegion[j].Width();
+            coords[i++] = iClipRegion[j].Height();      
+            }
+        
+        vgSetiv(VG_SCISSOR_RECTS, numberOfCoords, coords);
+        }
+
+    // Clear the flags!
+    renderer.ClearRestoreStateFlags();
+    
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Gc::UpdateProjection()
+    {
+    // Nothing to do
+    }
+
+
+TInt CHuiVg10Gc::TextureUnits() const
+    {
+    return 1;
+    }
+
+
+void CHuiVg10Gc::SetTextureUnits(TInt /*aTextureUnitCount*/)
+    {
+    // Nothing to do
+    }
+
+
+void CHuiVg10Gc::Enable(TFeature aFeature, TBool aDoEnable)
+    {
+    HUI_VG_INVARIANT();
+
+    switch(aFeature)
+        {
+        case EFeatureDepthTest:
+            // Not supported
+            break;
+
+        case EFeatureDepthWrite:
+            // Not supported
+            break;
+
+        case EFeatureTexturing:
+            // Always enabled
+            break;
+
+        case EFeatureBlending:
+            if(aDoEnable)
+                {
+                vgSeti(VG_BLEND_MODE, iBlendMode);
+                }
+            else
+                {
+                vgSeti(VG_BLEND_MODE, VG_BLEND_SRC);
+                }
+            break;
+
+        case EFeatureClipping:
+            if(aDoEnable)
+                {
+                // enable clipping
+                //if(!iStateScissorTest)
+                	{
+                	iStateScissorTest = ETrue;
+                    vgSeti(VG_SCISSORING, VG_TRUE);
+                	}
+                }
+            else
+                {
+                // disable clipping
+                //if(iStateScissorTest)
+                	{
+                	iStateScissorTest = EFalse;
+                    vgSeti(VG_SCISSORING, VG_FALSE);
+                	}
+                
+                }
+            break;
+
+        case EFeatureAntialias:
+            if(aDoEnable)
+                {
+                vgSeti(VG_RENDERING_QUALITY, VG_RENDERING_QUALITY_BETTER);
+                }
+            else
+                {
+                vgSeti(VG_RENDERING_QUALITY, VG_RENDERING_QUALITY_FASTER);
+                }
+            break;
+
+        case EFeatureFog:
+            // Not supported
+            break;
+
+        default:
+            break;
+        }
+
+    HUI_VG_INVARIANT();
+    }
+
+
+void CHuiVg10Gc::SetBlendMode(TBlendMode aBlendMode)
+    {
+    switch(aBlendMode)
+        {
+        case EBlendAdd:
+            iBlendMode = VG_BLEND_ADDITIVE;
+            break;
+
+        default:
+            iBlendMode = VG_BLEND_SRC_OVER;
+            break;
+        }
+        vgSeti(VG_BLEND_MODE, iBlendMode);
+    }
+
+
+void CHuiVg10Gc::SetTextureMode(TTextureMode aTextureMode, TReal32 /*aParam*/) __SOFTFP
+    {
+    switch(aTextureMode)
+        {
+        case ETextureModeNormal:
+            break;
+
+        default:
+            break;
+        }
+
+    HUI_VG_INVARIANT();
+    }
+
+
+void CHuiVg10Gc::SetDimmingFog(const TRgb& /*aColor*/, TReal32 /*aAmount*/) __SOFTFP
+    {
+    // Fog not supported
+    }
+
+
+void CHuiVg10Gc::Clear()
+    {
+    HUI_VG_INVARIANT();
+    TInt x = ProjectionViewport().iTl.iX;
+    TInt y = ProjectionViewport().iTl.iY;
+    TInt w = ProjectionViewport().Width();
+    TInt h = ProjectionViewport().Height();
+    VGfloat scale = 1.0f / 255.0f;
+    VGfloat color[] = 
+        {
+        PenColor().Red()   * scale,
+        PenColor().Green() * scale,
+        PenColor().Blue()  * scale,
+        PenAlpha() * scale
+        };
+    vgSetfv(VG_CLEAR_COLOR, 4, color);
+    vgClear(x, y, w, h);
+    HUI_VG_INVARIANT();
+    }
+
+	
+void CHuiVg10Gc::ClearDepth()
+    {
+    Clear();
+    }
+
+
+void CHuiVg10Gc::ClearColorAndDepth()
+    {
+    Clear();
+    }
+
+// Do renderer specific initializations of the frame
+void CHuiVg10Gc::InitNewFrame()
+	{
+	LoadIdentity(EHuiGcMatrixModel);
+	}
+
+void CHuiVg10Gc::Clip(const TRect& aClipRect)
+    {
+    THuiRealRect transformed = aClipRect;
+    
+    HUI_DEBUGF4(_L("CHuiVg10Gc::Clip() - aClipRect     (%5i, %5i, %5i, %5i)"),
+                aClipRect.iTl.iX, aClipRect.iTl.iY,
+                aClipRect.iBr.iX, aClipRect.iBr.iY);
+    
+    // Transform the rectangle using our stacks
+    UpdateClientMatrix();
+    iMatrixStack->Current().Multiply(transformed.iTl);
+    iMatrixStack->Current().Multiply(transformed.iBr);
+    
+    // Normalize the rectangle
+    if (transformed.iTl.iX > transformed.iBr.iX)
+    	{
+    	TReal32 tmp = transformed.iTl.iX;
+    	transformed.iTl.iX = transformed.iBr.iX;
+    	transformed.iBr.iX = tmp;
+    	}
+    if (transformed.iTl.iY > transformed.iBr.iY)
+    	{
+    	TReal32 tmp = transformed.iTl.iY;
+    	transformed.iTl.iY = transformed.iBr.iY;
+    	transformed.iBr.iY = tmp;
+    	}
+
+    HUI_DEBUGF4(_L("CHuiVg10Gc::Clip() - Transformed = (%5.0f, %5.0f, %5.0f, %5.0f)"),
+                transformed.iTl.iX, transformed.iTl.iY,
+                transformed.iBr.iX, transformed.iBr.iY);
+
+    CHuiGc::Clip(transformed.Round());
+    HUI_VG_INVARIANT();
+    }
+
+
+void CHuiVg10Gc::SetClip(const TRect& aClipRect)
+    {
+    iScissorRect = aClipRect;
+    iScissorRect.Normalize();
+    
+    CHuiGc::SetClip(iScissorRect);
+
+    VGint coords[4] = 
+        {
+        iScissorRect.iTl.iX,  iScissorRect.iTl.iY,
+        iScissorRect.Width(), iScissorRect.Height()
+        };
+   
+    Enable(EFeatureClipping);    
+    vgSetiv(VG_SCISSOR_RECTS, 4, coords);
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Gc::Clip(const TRegion& aRegion)
+    {
+    UpdateClientMatrix();
+
+    iTempRegion.Clear();
+    
+    for (TInt i=0; i<aRegion.Count(); i++)
+        {
+        THuiRealRect transformed = aRegion[i];
+        iMatrixStack->Current().Multiply(transformed.iTl);
+        iMatrixStack->Current().Multiply(transformed.iBr);
+        
+        // Normalize the rectangle
+        if (transformed.iTl.iX > transformed.iBr.iX)
+        	{
+        	TReal32 tmp = transformed.iTl.iX;
+        	transformed.iTl.iX = transformed.iBr.iX;
+        	transformed.iBr.iX = tmp;
+        	}
+        if (transformed.iTl.iY > transformed.iBr.iY)
+        	{
+        	TReal32 tmp = transformed.iTl.iY;
+        	transformed.iTl.iY = transformed.iBr.iY;
+        	transformed.iBr.iY = tmp;
+        	}            
+        
+        iTempRegion.AddRect(transformed.Round());
+        }
+	    
+	CHuiGc::Clip(iTempRegion);	    
+    
+    HUI_VG_INVARIANT();
+    }
+    
+void CHuiVg10Gc::SetClipRegion(const TRegion& aRegion)
+    {
+    TInt count = aRegion.Count();
+    VGint coords[KHuiMaxVgScissorRects * 4];
+
+    if(count > KHuiMaxVgScissorRects)
+        {
+        count = KHuiMaxVgScissorRects; //only 32 scissor rects supported    
+        }
+        
+    TInt numberOfCoords = count*4;
+    for ( TInt i = 0, j=0 ; i < numberOfCoords ; j++)
+        { 
+        coords[i++] = aRegion[j].iTl.iX;
+        coords[i++] = aRegion[j].iTl.iY;
+        coords[i++] = aRegion[j].Width();
+        coords[i++] = aRegion[j].Height();      
+        }
+    
+    CHuiGc::SetClipRegion(aRegion);     
+    
+    Enable(EFeatureClipping);    
+    vgSetiv(VG_SCISSOR_RECTS, numberOfCoords, coords);          
+    
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Gc::CancelClipping()
+    {
+    Disable(EFeatureClipping);    
+    }
+
+void CHuiVg10Gc::DrawText(const CHuiTextMesh& aTextMesh,
+                          const THuiRealRect& aBounds,
+                          TReal32 aShadow) __SOFTFP
+    {
+    CHuiGc::DrawText(aTextMesh, aBounds, aShadow);
+    }
+
+
+/**
+ *  Given a THuiImage, return the corresponding VGImage or 
+ *  VG_INVALID_HANDLE if there is none.
+ */
+static VGImage GetVGImageFromTexture(const MHuiSegmentedTexture& aTexture)
+    {
+    if (aTexture.SegmentCount() == 1)
+        {
+        return (VGImage)aTexture.SegmentName(0);
+        }
+    return VG_INVALID_HANDLE;
+    }
+
+
+/**
+ *  Construct a source rectangle based on the texture coordinates
+ *  specified for an image.
+ */
+static THuiRealRect GetSourceRectangleFromImage(const THuiImage& aImage)
+    {
+    TReal32 texCoords[8];
+    aImage.GetTexCoords(texCoords);
+    THuiRealRect sourceRect;
+    
+    sourceRect.iTl.iX = texCoords[0];
+    sourceRect.iTl.iY = texCoords[1];
+    sourceRect.iBr.iX = texCoords[4];
+    sourceRect.iBr.iY = texCoords[5];
+    
+    return sourceRect;
+    }
+
+void CHuiVg10Gc::DoDrawImage(const THuiImage& aImage,
+                             const THuiRealPoint& aTopLeft,
+                             const THuiRealSize& aSize)
+    {
+    if(!aImage.HasTexture())
+        {
+        return;
+        }
+    
+    // Fetch the texture coordinates from the image
+    THuiRealRect destRect(aTopLeft, aSize);
+    THuiRealRect sourceRect(GetSourceRectangleFromImage(aImage));
+    DrawTexture(aImage.Texture(), sourceRect, destRect);
+    }
+
+
+void CHuiVg10Gc::DoDrawImages(const THuiImage& aImage,
+                                const THuiImage& aImage2,
+                                const THuiRealPoint& aTopLeft,
+                                const THuiRealSize& aSize)
+    {
+    DoDrawImage(aImage,  aTopLeft, aSize);
+    DoDrawImage(aImage2, aTopLeft, aSize);
+    }
+
+
+void CHuiVg10Gc::UpdateColor(TReal32 /*aAlphaFactor*/) __SOFTFP
+    {
+    VGuint color = (PenColor().Internal() << 8) | PenAlpha();
+    
+#if defined(RENDER_DEBUG_RECTANGLES)
+    color = Math::Random() | 0xff;
+#endif
+    
+    // Update the color of the current paint
+    vgSetColor(iPaint, color);
+    
+    // Detect white fully opaque color
+    if (color == 0xffffffff)
+        {
+        vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_NORMAL);
+        }
+    else
+        {
+        vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_MULTIPLY);
+        }
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Gc::DrawCroppedTexture(const MHuiSegmentedTexture& aTexture, const THuiRealRect& aSourceRect,
+                                    const THuiRealRect& aDestRect)
+    {
+    // Render state which affects what we do here (roughly decreasing order of probability):
+    // - Source cropping
+    // - Color modulation
+    // - Alpha modulation
+    // - Affine matrix transform (i.e. other than scale or translation)
+    //
+    // Difficult combinations:
+    // - Source cropping with color or alpha modulation
+    //   - Option 1: Create a child image from the cropped region
+    //     - Can't do this because the cropping region is in floating point coords.
+    //     - Performance overhead possibly non-negligible.
+    //   - Option 2: Use scissoring to do the cropping
+    //     - Does not work for rotate/skew transform.
+    //   - Option 3: Use a mask to do the cropping
+    //     - Auxiliary mask bitmap needed, possible performance hit.
+    //   - Option 4: Use a pattern paint
+    //     - Color/alpha modulation requires an offscreen image.
+    // - Resolution: Go with option 2 and option 1 if rotation/skewing is in effect.
+    TSize imageSize = aTexture.Size();
+    VGfloat srcW   = aSourceRect.Width()  * imageSize.iWidth;
+    VGfloat srcH   = aSourceRect.Height() * imageSize.iHeight;
+    VGfloat srcX   = aSourceRect.iTl.iX   * imageSize.iWidth;
+    VGfloat srcY   = aSourceRect.iTl.iY   * imageSize.iHeight;
+
+    // Make sure the source rectangle is not degenerate
+    srcW = Max(1.0f, srcW);
+    srcH = Max(1.0f, srcH);
+    
+    VGfloat scaleX = aDestRect.Width()  / srcW;
+    VGfloat scaleY = aDestRect.Height() / srcH;
+    VGImage image = VG_INVALID_HANDLE;
+    
+	// Check if OpenVg state has changed
+    RestoreFlaggedState();
+    
+#ifdef __NVG
+    const CHuiVg10Texture& texture = static_cast<const CHuiVg10Texture&>( aTexture );
+    TBool isExtended = texture.IsExtended();
+#endif
+    
+    // Getting the vgImage out of the texture
+    image = GetVGImageFromTexture( aTexture );
+    
+    if (iMatrixFlags & EMatrixFlagsRotation)
+        {
+        VGImage tmpImage = vgChildImage(image, (VGint)srcX, imageSize.iHeight - (VGint)srcY - (VGint)srcH, (VGint)srcW, (VGint)srcH);
+        
+        if (tmpImage == VG_INVALID_HANDLE)
+            {
+            HUI_DEBUG(_L("CHuiVg10Gc::DrawCroppedTexture() - Unable to create temporary child image."));
+            // We cannot leave because we are called by a non-leaving exported function
+            // If we cannot draw, we just return without doing anything.
+            return;
+            }
+        HUI_VG_INVARIANT();
+        
+        // Render the child image
+        Push(EHuiGcMatrixModel);
+#if !defined(RENDER_DEBUG_RECTANGLES)
+        vgTranslate(aDestRect.iTl.iX, aDestRect.iTl.iY);
+        vgScale(scaleX, scaleY);
+        vgDrawImage(tmpImage);
+#else
+        TRect d(aDestRect.iTl.iX, aDestRect.iTl.iY, aDestRect.iBr.iX, aDestRect.iBr.iY);
+        DrawRect(d);
+#endif
+        Pop(EHuiGcMatrixModel);
+        
+        vgDestroyImage(tmpImage);
+        HUI_VG_INVARIANT();
+        return;
+        }
+    
+    // Set a scissor rectangle that corresponds with the target rectangle
+    TBool clippingWasEnabled = iStateScissorTest;
+    
+    if (!clippingWasEnabled)
+        {
+        Enable(EFeatureClipping);    
+        }
+    
+    PushClip();
+    Clip(aDestRect);    
+    
+    // Render the image
+    Push(EHuiGcMatrixModel);
+#if !defined(RENDER_DEBUG_RECTANGLES)
+    vgTranslate(aDestRect.iTl.iX, aDestRect.iTl.iY);
+    vgScale(scaleX, scaleY);
+    vgTranslate(-srcX, -srcY);
+
+#ifdef __NVG
+    if ( isExtended && texture.IsNvgContent())
+        {
+        // Determine the size to which we want to draw the NVG icon paths
+        TSize contentSize( HUI_ROUND_FLOAT_TO_INT(aDestRect.Width()),
+                HUI_ROUND_FLOAT_TO_INT(aDestRect.Height()) );
+        UpdateMatrix(VG_MATRIX_PATH_USER_TO_SURFACE);
+        // Draw the NVG data (be it either the object cached commands or the "normal" nvg data)
+        DrawNVG(texture.GetExtendedTextureData(), texture.GetIconCommandsData(), contentSize, EFalse);
+        }
+    else
+        {
+        if (image != VG_INVALID_HANDLE)
+            {
+            //HUI_DEBUG1(_L("HuiVg10Gc::DrawCroppedTexture - drawing with vgDrawImage(%d) instead of DrawNVG"), image);
+            vgDrawImage(image);
+            }
+        else
+            {
+            HUI_DEBUG1(_L("HuiVg10Gc::DrawCroppedTexture - INVALID HANDLE, vgDrawImage() not called!"), image);
+            }
+        }
+#else
+    vgDrawImage(image);
+#endif // __NVG
+
+#else // RENDER_DEBUG_RECTANGLES
+    TRect d(aDestRect.iTl.iX, aDestRect.iTl.iY, aDestRect.iBr.iX, aDestRect.iBr.iY);
+    DrawRect(d);
+#endif
+    HUI_VG_INVARIANT();
+    Pop(EHuiGcMatrixModel);
+    
+    // Restore state
+    PopClip();
+
+    if (!clippingWasEnabled)
+        {
+        Disable(EFeatureClipping);    
+        }
+    
+    HUI_VG_INVARIANT();
+    
+#if 0
+    // Crop implementation using a paint pattern
+    // TODO: Handle color modulation + cropping
+    VGfloat srcW   = aSourceRect.Width()  * aImage.Texture().Size().iWidth;
+    VGfloat srcH   = aSourceRect.Height() * aImage.Texture().Size().iHeight;
+    VGfloat srcX   = aSourceRect.iTl.iX   * aImage.Texture().Size().iWidth;
+    VGfloat srcY   = aSourceRect.iTl.iY   * aImage.Texture().Size().iHeight;
+    VGfloat scaleX = aDestRect.Width()  / srcW;
+    VGfloat scaleY = aDestRect.Height() / srcH;
+    VGImage image  = GetVGImageFromTexture(aTexture);
+
+    vgPaintPattern(iPaint, image);
+    
+    // Transform the paint pattern to fill the destination rectangle as required
+    vgSeti(VG_MATRIX_MODE, VG_MATRIX_FILL_PAINT_TO_USER);
+    vgLoadIdentity();
+    vgTranslate(aDestRect.iTl.iX, aDestRect.iTl.iY);
+    vgScale(scaleX, scaleY);
+    vgTranslate(-srcX, -srcY);
+    vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
+    
+    // Update the path transformation matrix
+    UpdateMatrix(VG_MATRIX_PATH_USER_TO_SURFACE);
+
+    // Draw a rectangle which is filled with the image as a pattern
+    const VGfloat coords[] = 
+        {
+        aDestRect.iTl.iX, aDestRect.iTl.iY,
+        aDestRect.Width(), 0,
+        0, aDestRect.Height(),
+        -aDestRect.Width(), 0,
+        };
+    vgModifyPathCoords(iImagePath, 0, 5, coords);
+    vgDrawPath(iImagePath, VG_FILL_PATH);
+    
+    // Restore the state
+    vgPaintPattern(iPaint, VG_INVALID_HANDLE);
+    UpdateColor();
+    vgSeti(VG_MATRIX_MODE, VG_MATRIX_FILL_PAINT_TO_USER);
+    vgLoadIdentity();
+    vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
+    HUI_VG_INVARIANT();
+#endif
+    }
+
+void CHuiVg10Gc::DrawTexture(const MHuiSegmentedTexture& aTexture, 
+                             const THuiRealRect& aSourceRect, 
+                             const THuiRealRect& aDestRect)
+    {
+    // See if the image is cropped
+    const VGfloat epsilon = 1e-3;
+    if (aSourceRect.iTl.iX > epsilon || 
+        aSourceRect.iTl.iY > epsilon ||
+        aSourceRect.iBr.iX < 1.0f - epsilon ||
+        aSourceRect.iBr.iY < 1.0f - epsilon)
+        {
+        DrawCroppedTexture(aTexture, aSourceRect, aDestRect);
+        return;
+        }
+
+	// Check if OpenVg state has changed
+    RestoreFlaggedState();
+    
+    Push(EHuiGcMatrixModel);
+#if !defined(RENDER_DEBUG_RECTANGLES)
+    vgTranslate(aDestRect.iTl.iX, aDestRect.iTl.iY);
+    
+#ifdef __NVG
+    const CHuiVg10Texture& texture = static_cast<const CHuiVg10Texture&>( aTexture );
+    TBool isExtended = texture.IsExtended();
+    
+    if (isExtended && texture.IsNvgContent())
+        {
+        UpdateMatrix(VG_MATRIX_PATH_USER_TO_SURFACE);
+        TSize contentSize(0, 0);
+        contentSize.SetSize( HUI_ROUND_FLOAT_TO_INT( aDestRect.Width() ),
+            HUI_ROUND_FLOAT_TO_INT( aDestRect.Height() ) );
+        // Draw the NVG data (be it either the object cached commands or the "normal" nvg data)
+        DrawNVG(texture.GetExtendedTextureData(), texture.GetIconCommandsData(), contentSize, EFalse);
+        }
+    else
+        {
+        // "Option C" -way
+        VGfloat scaleX = aDestRect.Width()  / aTexture.Size().iWidth;
+        VGfloat scaleY = aDestRect.Height() / aTexture.Size().iHeight;
+        VGImage image = GetVGImageFromTexture( aTexture );
+
+        if (image != VG_INVALID_HANDLE)
+            {
+            vgScale(scaleX, scaleY);
+            vgDrawImage(image);
+            //HUI_DEBUG1(_L("HuiVg10Gc::DrawTexture - vgDrawImage(%d) drawn!"), image);
+            }
+        else
+            {
+            HUI_DEBUG(_L("HuiVg10Gc::DrawTexture - INVALID HANDLE, vgDrawImage() not called!"));
+            }
+        }
+#else
+    // TODO: Fast paths for unit scale and opaque blending
+    VGfloat scaleX = aDestRect.Width()  / aTexture.Size().iWidth;
+    VGfloat scaleY = aDestRect.Height() / aTexture.Size().iHeight;
+    VGImage image = GetVGImageFromTexture(aTexture);
+    
+    vgScale(scaleX, scaleY);
+    vgDrawImage(image);
+#endif // __NVG
+    
+#else
+    TRect d(aDestRect.iTl.iX, aDestRect.iTl.iY, aDestRect.iBr.iX, aDestRect.iBr.iY);
+    DrawRect(d);
+#endif
+
+    HUI_VG_INVARIANT();
+    Pop(EHuiGcMatrixModel);
+    }
+
+void CHuiVg10Gc::DrawStretchImage(TStretchMode aMode,
+                                  const THuiImage& aImage, 
+                                  const THuiRealRect& aRect,
+                                  TInt aStartWidth, 
+                                  TInt aEndWidth)
+    {
+    if (!aImage.HasTexture())
+        {
+        return;
+        }
+
+    UpdateColor();
+
+    THuiRealPoint aTopLeft(aRect.iTl);
+    THuiRealSize  aSize(aRect.iBr.iX - aRect.iTl.iX, aRect.iBr.iY - aRect.iTl.iY);
+    THuiRealRect sourceRect(GetSourceRectangleFromImage(aImage));
+    THuiRealSize imageSize = aImage.Texture().Size();
+    
+	switch(aMode) 
+		{
+	    case EStretchFull:
+			{
+			DrawTexture(aImage.Texture(), sourceRect, aRect);
+	    	break;
+			}
+				    
+	    case EStretchVertical:
+	        {
+            THuiRealRect destRect(aRect);
+            if (aStartWidth > 0)
+                {
+                THuiRealRect edgeDestRect(aRect);
+                THuiRealRect edgeSourceRect(sourceRect);
+                edgeDestRect.iBr.iY   = edgeDestRect.iTl.iY   + aStartWidth;
+                edgeSourceRect.iBr.iY = edgeSourceRect.iTl.iY + aStartWidth / imageSize.iHeight;
+                DrawTexture(aImage.Texture(), edgeSourceRect, edgeDestRect);
+                destRect.iTl.iY   += aStartWidth;
+                sourceRect.iTl.iY += aStartWidth / imageSize.iHeight;
+                }
+            if (aEndWidth > 0)
+                {
+                THuiRealRect edgeDestRect(aRect);
+                THuiRealRect edgeSourceRect(sourceRect);
+                edgeDestRect.iTl.iY   = edgeDestRect.iBr.iY   - aEndWidth;
+                edgeSourceRect.iTl.iY = edgeSourceRect.iBr.iY - aEndWidth / imageSize.iHeight;
+                DrawTexture(aImage.Texture(), edgeSourceRect, edgeDestRect);
+                destRect.iBr.iY   -= aEndWidth;
+                sourceRect.iBr.iY -= aEndWidth / imageSize.iHeight;
+                }
+            DrawTexture(aImage.Texture(), sourceRect, destRect);
+	        break;
+	        }
+	    case EStretchHorizontal:
+	        {
+            THuiRealRect destRect(aRect);
+            if (aStartWidth > 0)
+                {
+                THuiRealRect edgeDestRect(aRect);
+                THuiRealRect edgeSourceRect(sourceRect);
+                edgeDestRect.iBr.iX   = edgeDestRect.iTl.iX   + aStartWidth;
+                edgeSourceRect.iBr.iX = edgeSourceRect.iTl.iX + aStartWidth / imageSize.iWidth;
+                DrawTexture(aImage.Texture(), edgeSourceRect, edgeDestRect);
+                destRect.iTl.iX   += aStartWidth;
+                sourceRect.iTl.iX += aStartWidth / imageSize.iWidth;
+                }
+            if (aEndWidth > 0)
+                {
+                THuiRealRect edgeDestRect(aRect);
+                THuiRealRect edgeSourceRect(sourceRect);
+                edgeDestRect.iTl.iX   = edgeDestRect.iBr.iX   - aEndWidth;
+                edgeSourceRect.iTl.iX = edgeSourceRect.iBr.iX - aEndWidth / imageSize.iWidth;
+                DrawTexture(aImage.Texture(), edgeSourceRect, edgeDestRect);
+                destRect.iBr.iX   -= aEndWidth;
+                sourceRect.iBr.iX -= aEndWidth / imageSize.iWidth;
+                }
+            DrawTexture(aImage.Texture(), sourceRect, destRect);
+	        break;
+	        }
+	
+	    default:
+	        HUI_DEBUG(_L("CHuiVg10Gc::DrawStretchImage() - ERROR! Tried to use stretch mode that hasn't been implemented. Panicing."));
+		    HUI_PANIC(THuiPanic::ENotImplemented);
+	}
+    
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Gc::DrawRect(const TRect& aRect)
+    {
+    if (iPaintPattern)
+        {        
+        // Add 0.5 to all coordinates to get them in the middle of pixels 
+        TRect rect = aRect;
+        rect.iTl.iX += 0.5f;
+        rect.iTl.iY += 0.5f;
+        rect.iBr.iX -= 0.5f;
+        rect.iBr.iY -= 0.5f;
+        
+        const VGfloat coords[] = {
+                rect.iTl.iX + 0.5f, rect.iTl.iY + 0.5f,
+                rect.Width(), 0.0f,
+                0.0f, rect.Height(),
+                -rect.Width(), 0.0f,
+            };
+
+        UpdateColor();
+        UpdateMatrix(VG_MATRIX_PATH_USER_TO_SURFACE);
+        
+        UsePaintPattern();
+        
+        vgModifyPathCoords(iRectPath, 0, 4, coords);
+        vgDrawPath(iRectPath, VG_FILL_PATH);
+        
+        // Restore rect path
+        const VGfloat rectCoords[] = 
+            {
+             0.0f, 0.0f,             // (x, y)
+             1.0f, 0.0f,             // (width, 0)
+             0.0f, 1.0f,             // (0, height)
+            -1.0f, 0.0f,             // (-width, 0)
+            };
+
+        vgModifyPathCoords(iRectPath, 0, 4, rectCoords);        
+
+        DiscardPaintPattern();
+        }
+    else
+        {
+        // fast path (doen not work with patterned fill)
+        UpdateColor();
+        UpdateMatrix(VG_MATRIX_PATH_USER_TO_SURFACE);
+        vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
+    
+        vgTranslate(aRect.iTl.iX, aRect.iTl.iY);
+        vgScale(aRect.Width(),aRect.Height());
+    
+        vgDrawPath(iRectPath, VG_FILL_PATH);
+    
+        vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
+        UpdateMatrix(VG_MATRIX_PATH_USER_TO_SURFACE);
+        }
+
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Gc::DrawPolygon( RArray<THuiRealPoint>& aPoints )
+    {
+    
+    // use the path intended for dynamic shapes
+    // it has type float and can hold any number of segments
+       
+    TInt count = aPoints.Count();
+    VGfloat* coords = NULL;
+    coords = new VGfloat[count * 2];
+    
+    VGubyte* segments = NULL;
+    segments = new VGubyte[count + 1];
+    
+    if ( !coords || !segments )
+        {
+        // ran out of memory, must just return
+        delete[] coords;
+        delete[] segments;
+        return;
+        }
+    
+    for( TInt i = 0; i < count; i++ )
+    	{
+	    coords[2 * i] = aPoints[i].iX;
+	    coords[2 * i + 1] = aPoints[i].iY;
+	    segments[i] = VG_LINE_TO_ABS;
+    	}
+    // fix the first segment into move instead of draw	
+    segments[0] = VG_MOVE_TO_ABS;
+    // the last segment closes the path to get a solid object
+    segments[count] = VG_CLOSE_PATH;
+    
+    UpdateColor();
+    UpdateMatrix( VG_MATRIX_PATH_USER_TO_SURFACE );
+    
+    UsePaintPattern(); 
+    
+    vgAppendPathData( iPath, count + 1, segments, coords);
+
+    vgDrawPath( iPath, VG_FILL_PATH );
+    vgClearPath( iPath, VG_PATH_CAPABILITY_APPEND_TO );
+
+    DiscardPaintPattern();
+    
+    // don't leak memory
+    delete[] coords;
+    delete[] segments;
+        
+    HUI_VG_INVARIANT();
+
+    }    
+
+void CHuiVg10Gc::DrawLine(const TPoint& aStart,
+                          const TPoint& aEnd,
+                          const TInt aThickness)
+    {
+
+    // Add 0.5 to all coordinates to get them in the middle of pixels 
+    const VGfloat coords[] = {
+            aStart.iX + 0.5f, aStart.iY + 0.5f,
+            aEnd.iX + 0.5f, aEnd.iY + 0.5f,
+        };
+    
+    UpdateColor();
+    UpdateMatrix(VG_MATRIX_PATH_USER_TO_SURFACE);
+    
+    vgModifyPathCoords(iLinePath, 0, 2, coords);
+    vgSeti(VG_STROKE_CAP_STYLE, VG_CAP_SQUARE);
+    vgSeti(VG_STROKE_LINE_WIDTH, aThickness);
+    vgDrawPath(iLinePath, VG_STROKE_PATH);
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Gc::DrawEllipse(const TRect& aRect, THuiFillMode aDrawMode, const TInt aThickness)
+    {
+    // Fix given destination rect to be in th middle of openvg pixels
+    THuiRealRect destinationRect = aRect;
+    destinationRect.iTl.iX += 0.5f;
+    destinationRect.iTl.iY += 0.5f;
+    destinationRect.iBr.iX -= 0.5f;
+    destinationRect.iBr.iY -= 0.5f;
+    
+    VGfloat alpha = PenAlpha();
+    vgClearPath(iEllipsePath, VG_PATH_CAPABILITY_APPEND_TO);
+    
+    VGfloat cx = (destinationRect.iTl.iX + destinationRect.iBr.iX) / 2.f; 
+    VGfloat cy  = (destinationRect.iTl.iY + destinationRect.iBr.iY) / 2.f;
+    VGfloat width = destinationRect.Width();
+    VGfloat height = destinationRect.Height();
+    
+    vguEllipse(iEllipsePath, cx, cy, width, height);
+   
+    UpdateColor();
+    UpdateMatrix(VG_MATRIX_PATH_USER_TO_SURFACE);
+    
+    TInt oldThickness = vgGeti(VG_STROKE_LINE_WIDTH);
+    if(oldThickness != aThickness)
+        {
+        vgSeti(VG_STROKE_LINE_WIDTH, aThickness);
+        }
+    VGPaint paint;
+    if (aDrawMode != EHuiNoFill)
+        {
+        paint = vgGetPaint(VG_FILL_PATH);
+        }
+     else
+        {
+        paint = vgGetPaint(VG_STROKE_PATH);
+        }
+
+    VGfloat color[4], modifiedColor[4];
+    
+    if (paint != VG_INVALID_HANDLE)
+       {
+       vgGetParameterfv(paint, VG_PAINT_COLOR, 4, color);
+       if (color[3]!=alpha)
+           {
+           modifiedColor[0] = color[0];
+           modifiedColor[1] = color[1];
+           modifiedColor[2] = color[2];
+           modifiedColor[3] = alpha;
+           vgSetParameterfv(paint, VG_PAINT_COLOR, 4, modifiedColor);
+           }
+       else
+           {
+           // no reason to set back the old color. it is the same.
+           paint = VG_INVALID_HANDLE; 
+           }
+       }
+
+    UsePaintPattern();
+    
+    if (aDrawMode != EHuiNoFill)
+        {
+        vgDrawPath(iEllipsePath, VG_FILL_PATH);
+        }
+    else
+        {
+        vgDrawPath(iEllipsePath, VG_STROKE_PATH);
+        }
+
+    DiscardPaintPattern();
+    
+    if (paint != VG_INVALID_HANDLE)
+        {
+        vgSetParameterfv(paint, VG_PAINT_COLOR, 4, color);
+        HUI_VG_INVARIANT();
+        }
+    if(oldThickness != aThickness)
+        {
+        vgSeti(VG_STROKE_LINE_WIDTH, oldThickness);
+        }
+    HUI_VG_INVARIANT();
+    
+    }
+
+void CHuiVg10Gc::DrawArc(const TRect& aRect, THuiFillMode aDrawMode, const TInt aThickness, TReal32 aStart, TReal32 aEnd, TBool aIsPie)
+    {
+    // Fix given destination rect to be in th middle of openvg pixels
+    THuiRealRect destinationRect = aRect;
+    destinationRect.iTl.iX += 0.5f;
+    destinationRect.iTl.iY += 0.5f;
+    destinationRect.iBr.iX -= 0.5f;
+    destinationRect.iBr.iY -= 0.5f;
+    
+    VGfloat alpha = PenAlpha() / 255.f;
+    vgClearPath(iArcPath, VG_PATH_CAPABILITY_APPEND_TO);
+    
+    VGfloat cx = (destinationRect.iTl.iX + destinationRect.iBr.iX) / 2.f; 
+    VGfloat cy  = (destinationRect.iTl.iY + destinationRect.iBr.iY) / 2.f;
+    VGfloat width = destinationRect.Width();
+    VGfloat height = destinationRect.Height();
+    
+    VGUArcType arcType = aIsPie ? VGU_ARC_PIE : VGU_ARC_OPEN;
+
+    // Ready to draw the arc. Note that in OpenVG, y axis points upwards. Anti-clockwise goes
+    // is towards positive direction. The method CHuiVg10CanvasGc::DoDrawPieAndArc made sure that 
+    // angleExtent is always positive.
+    TReal32 angleExtent = aEnd - aStart;
+    vguArc(iArcPath, cx, cy, width, height, aStart, angleExtent, arcType);
+   
+    UpdateColor();
+    UpdateMatrix(VG_MATRIX_PATH_USER_TO_SURFACE);
+    
+    TInt oldThickness = vgGeti(VG_STROKE_LINE_WIDTH);
+    if(oldThickness != aThickness)
+        {
+        vgSeti(VG_STROKE_LINE_WIDTH, aThickness);
+        }
+    VGPaint paint;
+    if (aDrawMode != EHuiNoFill)
+        {
+        paint = vgGetPaint(VG_FILL_PATH);
+        }
+     else
+        {
+        paint = vgGetPaint(VG_STROKE_PATH);
+        }
+
+    VGfloat color[4], modifiedColor[4];
+    
+    if (paint != VG_INVALID_HANDLE)
+       {
+       vgGetParameterfv(paint, VG_PAINT_COLOR, 4, color);
+       if (color[3]!=alpha) 
+           {
+           modifiedColor[0] = color[0];
+           modifiedColor[1] = color[1];
+           modifiedColor[2] = color[2];
+           modifiedColor[3] = alpha;
+           vgSetParameterfv(paint, VG_PAINT_COLOR, 4, modifiedColor);
+           }
+       else
+           {
+           // no reason to set back the old color. it is the same.
+           paint = VG_INVALID_HANDLE; 
+           }
+       }
+
+    UsePaintPattern();
+    
+    if (aDrawMode != EHuiNoFill)
+        {
+        vgDrawPath(iArcPath, VG_FILL_PATH);
+        }
+    else
+        {
+        vgDrawPath(iArcPath, VG_STROKE_PATH);
+        }
+
+    DiscardPaintPattern();
+    
+    // Restore old values
+    if (paint != VG_INVALID_HANDLE)
+        {
+        vgSetParameterfv(paint, VG_PAINT_COLOR, 4, color);
+        HUI_VG_INVARIANT();
+        }
+    if(oldThickness != aThickness)
+        {
+        vgSeti(VG_STROKE_LINE_WIDTH, oldThickness);
+        }
+    HUI_VG_INVARIANT();
+    
+    }
+
+void CHuiVg10Gc::DrawRoundRect(const TRect& aDestinationRect, const THuiRealSize& aSize, THuiFillMode aDrawMode, const TInt aThickness)
+    {
+    // Fix given destination rect to be in th middle of openvg pixels
+    THuiRealRect destinationRect = aDestinationRect;
+    destinationRect.iTl.iX += 0.5f;
+    destinationRect.iTl.iY += 0.5f;
+    destinationRect.iBr.iX -= 0.5f;
+    destinationRect.iBr.iY -= 0.5f;
+    
+    VGfloat alpha = PenAlpha();
+    vgClearPath(iRoundRectPath, VG_PATH_CAPABILITY_APPEND_TO);
+    vguRoundRect(iRoundRectPath, destinationRect.iTl.iX, destinationRect.iTl.iY, destinationRect.Width(), destinationRect.Height(), aSize.iWidth, aSize.iHeight);
+   
+    UpdateColor();
+    UpdateMatrix(VG_MATRIX_PATH_USER_TO_SURFACE);
+    
+    TInt oldThickness = vgGeti(VG_STROKE_LINE_WIDTH);
+    if(oldThickness != aThickness)
+        {
+        vgSeti(VG_STROKE_LINE_WIDTH, aThickness);
+        }
+    VGPaint paint;
+    if (aDrawMode != EHuiNoFill)
+        {
+        paint = vgGetPaint(VG_FILL_PATH);
+        }
+     else
+        {
+        paint = vgGetPaint(VG_STROKE_PATH);
+        }
+
+    VGfloat color[4], modifiedColor[4];
+    
+    if (paint != VG_INVALID_HANDLE)
+       {
+       vgGetParameterfv(paint, VG_PAINT_COLOR, 4, color);
+       if (color[3]!=alpha)
+           {
+           modifiedColor[0] = color[0];
+           modifiedColor[1] = color[1];
+           modifiedColor[2] = color[2];
+           modifiedColor[3] = alpha;
+           vgSetParameterfv(paint, VG_PAINT_COLOR, 4, modifiedColor);
+           }
+       else
+           {
+           // no reason to set back the old color. it is the same.
+           paint = VG_INVALID_HANDLE; 
+           }
+       }
+
+    UsePaintPattern();
+    
+    if (aDrawMode != EHuiNoFill)
+        {
+        vgDrawPath(iRoundRectPath, VG_FILL_PATH);
+        }
+    else
+        {
+        vgDrawPath(iRoundRectPath, VG_STROKE_PATH);
+        }
+
+    DiscardPaintPattern();
+    
+    if (paint != VG_INVALID_HANDLE)
+        {
+        vgSetParameterfv(paint, VG_PAINT_COLOR, 4, color);
+        HUI_VG_INVARIANT();
+        }
+    if(oldThickness != aThickness)
+        {
+        vgSeti(VG_STROKE_LINE_WIDTH, oldThickness);
+        }
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Gc::DrawBorders(const TRect& aOuterRect, 
+				  TReal32 aLeftBorderWidth,
+                  TReal32 aRightBorderWidth, 
+				  TReal32 aTopBorderHeight,
+                  TReal32 aBottomBorderHeight, 
+                  TBorderMode aBorderMode,
+                  const THuiImage* aImage) __SOFTFP
+	{	
+    UpdateColor();
+    
+    if (aBorderMode == EBorderImage)
+        {
+        TReal32 avgBorderWidth     = (aLeftBorderWidth + aRightBorderWidth) * .5f;
+        TReal32 avgBorderHeight    = (aTopBorderHeight + aBottomBorderHeight) * .5f;
+        THuiRealPoint borderOffset = THuiRealPoint((aRightBorderWidth   - aLeftBorderWidth) * .5f,
+                                                   (aBottomBorderHeight - aTopBorderHeight) * .5f);
+        DrawBorderImages(aOuterRect, avgBorderWidth, avgBorderHeight, borderOffset, aImage);
+        }
+    else if (aBorderMode == EBorderFixedCorners)
+        {
+        DrawBorderFixedCorners(aOuterRect, aLeftBorderWidth, aRightBorderWidth, 
+                               aTopBorderHeight, aBottomBorderHeight, aImage);
+        }
+    else
+        {
+        // We cannot leave here because we are a non-leaving function,
+        // and we cannot return an error either. 
+        // If the caller gives us invalid parameters, we do nothing.
+        return;
+        }
+
+    HUI_VG_INVARIANT();
+	}
+
+void CHuiVg10Gc::DrawBorderImages(const TRect& aOuterRect,
+                                  TReal32 aBorderWidth,
+                                  TReal32 aBorderHeight, 
+                                  THuiRealPoint aOffset,
+                                  const THuiImage* aImage)
+    {
+    // If there is no image, draw a solid border
+    if (!aImage || !aImage->HasTexture())
+        {
+        //
+        // The border is drawn like this:
+        //
+        //      +-----------------+
+        //      |                 |
+        //      +---+---------+   |
+        //      |   |         |   |
+        //      |   |         |   |
+        //      |   |         |   |
+        //      |   |         |   |
+        //      |   +---------+   |
+        //      |                 |
+        //      +-----------------+
+        //
+        // We do not use a path with a hole, because some of the edges might become too thin.
+        //
+        TReal32 w = aOuterRect.Width();
+        TReal32 h = aOuterRect.Height();
+
+        const VGfloat borderCoords[10 * 2] = 
+            {
+            aOuterRect.iTl.iX, aOuterRect.iTl.iY,
+            w, 0.0f,
+            0.0f, h,
+            -w, 0.0f,
+            0.0f, -h + aBorderWidth,
+            aBorderWidth, 0.0f,
+            0.0f, h - aBorderHeight - aBorderHeight,
+            w - aBorderHeight - aBorderHeight, 0.0f,
+            0.0f, -h + aBorderHeight + aBorderHeight,
+            -w + aBorderWidth, 0.0f,
+            };
+
+        UpdateMatrix(VG_MATRIX_PATH_USER_TO_SURFACE);
+        vgModifyPathCoords(iBorderPath, 0, 12, borderCoords);
+        vgDrawPath(iBorderPath, VG_FILL_PATH);
+        
+        HUI_VG_INVARIANT();
+        return;
+        }
+    
+    THuiRealRect texCoords = GetSourceRectangleFromImage(*aImage);
+    THuiRealPoint midTexCoord((texCoords.iTl.iX + texCoords.iBr.iX) * .5f,
+                              (texCoords.iTl.iY + texCoords.iBr.iY) * .5f);
+
+    THuiRealRect outerRect(aOuterRect);
+    outerRect.iTl += aOffset;
+    outerRect.iBr += aOffset;
+    THuiRealRect innerRect(aOuterRect);
+    innerRect.Shrink(aBorderWidth, aBorderHeight);
+
+    // Top left segment
+    DrawCroppedTexture(aImage->Texture(), 
+                       THuiRealRect(texCoords.iTl, midTexCoord), 
+                       THuiRealRect(outerRect.iTl, innerRect.iTl));
+
+    // Top segment
+    DrawCroppedTexture(aImage->Texture(), 
+                       THuiRealRect(THuiRealPoint(midTexCoord.iX, texCoords.iTl.iY), midTexCoord),
+                       THuiRealRect(THuiRealPoint(innerRect.iTl.iX, outerRect.iTl.iY), innerRect.TopRight()));
+
+    // Top right segment
+    DrawCroppedTexture(aImage->Texture(), 
+                       THuiRealRect(THuiRealPoint(midTexCoord.iX, texCoords.iTl.iY),
+                                    THuiRealPoint(texCoords.iBr.iX, midTexCoord.iY)),
+                       THuiRealRect(THuiRealPoint(innerRect.iBr.iX, outerRect.iTl.iY),
+                                    THuiRealPoint(outerRect.iBr.iX, innerRect.iTl.iY)));
+
+    // Right segment
+    DrawCroppedTexture(aImage->Texture(), 
+                       THuiRealRect(midTexCoord, 
+                                    THuiRealPoint(texCoords.iBr.iX, midTexCoord.iY)),
+                       THuiRealRect(innerRect.TopRight(),
+                                    THuiRealPoint(outerRect.iBr.iX, innerRect.iBr.iY)));
+
+    // Bottom right segment
+    DrawCroppedTexture(aImage->Texture(), 
+                       THuiRealRect(midTexCoord, texCoords.iBr),
+                       THuiRealRect(innerRect.iBr, outerRect.iBr));
+
+    // Bottom segment
+    DrawCroppedTexture(aImage->Texture(), 
+                       THuiRealRect(midTexCoord, 
+                                    THuiRealPoint(midTexCoord.iX, texCoords.iBr.iY)),
+                       THuiRealRect(innerRect.BottomLeft(),
+                                    THuiRealPoint(innerRect.iBr.iX, outerRect.iBr.iY)));
+
+    // Bottom left segment
+    DrawCroppedTexture(aImage->Texture(), 
+                       THuiRealRect(THuiRealPoint(texCoords.iTl.iX, midTexCoord.iY),
+                                    THuiRealPoint(midTexCoord.iX, texCoords.iBr.iY)),
+                       THuiRealRect(THuiRealPoint(outerRect.iTl.iX, innerRect.iBr.iY),
+                                    THuiRealPoint(innerRect.iTl.iX, outerRect.iBr.iY)));
+
+    // Left segment
+    DrawCroppedTexture(aImage->Texture(), 
+                       THuiRealRect(THuiRealPoint(texCoords.iTl.iX, midTexCoord.iY), 
+                                    midTexCoord),
+                       THuiRealRect(THuiRealPoint(outerRect.iTl.iX, innerRect.iTl.iY),
+                                    innerRect.BottomLeft()));
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Gc::DrawBorderFixedCorners(const TRect& aOuterRect, 
+                                        TReal32 aLeftBorderWidth,
+                                        TReal32 aRightBorderWidth, 
+                                        TReal32 aTopBorderHeight,
+                                        TReal32 aBottomBorderHeight, 
+                                        const THuiImage* aImage)
+    {
+    // If there is no image, draw a solid border
+    if (!aImage || !aImage->HasTexture())
+        {
+        //
+        // The border is drawn like this:
+        //
+        //      +-----------------+
+        //      |                 |
+        //      +---+---------+   |
+        //      |   |         |   |
+        //      |   |         |   |
+        //      |   |         |   |
+        //      |   |         |   |
+        //      |   +---------+   |
+        //      |                 |
+        //      +-----------------+
+        //
+        // We do not use a path with a hole, because some of the edges might become too thin.
+        //
+        TReal32 w = aOuterRect.Width();
+        TReal32 h = aOuterRect.Height();
+
+        const VGfloat borderCoords[10 * 2] = 
+            {
+            aOuterRect.iTl.iX, aOuterRect.iTl.iY,
+            w, 0.0f,
+            0.0f, h,
+            -w, 0.0f,
+            0.0f, -h + aTopBorderHeight,
+            aLeftBorderWidth, 0.0f,
+            0.0f, h - aTopBorderHeight - aBottomBorderHeight,
+            w - aLeftBorderWidth - aRightBorderWidth, 0.0f,
+            0.0f, -h + aTopBorderHeight + aBottomBorderHeight,
+            -w + aRightBorderWidth, 0.0f,
+            };
+
+        UpdateMatrix(VG_MATRIX_PATH_USER_TO_SURFACE);
+        vgModifyPathCoords(iBorderPath, 0, 12, borderCoords);
+        vgDrawPath(iBorderPath, VG_FILL_PATH);
+        
+        HUI_VG_INVARIANT();
+        return;
+        }
+    
+    THuiRealRect texCoords = GetSourceRectangleFromImage(*aImage);
+    THuiRealRect innerTexCoords(texCoords);
+    THuiRealSize texSize = aImage->Texture().Size();
+    THuiRealRect outerRect(aOuterRect);
+    THuiRealRect innerRect(aOuterRect);
+    
+    innerTexCoords.iTl.iX += aLeftBorderWidth    / texSize.iWidth;
+    innerTexCoords.iTl.iY += aTopBorderHeight    / texSize.iHeight;
+    innerTexCoords.iBr.iX -= aRightBorderWidth   / texSize.iWidth;
+    innerTexCoords.iBr.iY -= aBottomBorderHeight / texSize.iHeight;
+
+    innerRect.iTl.iX += aLeftBorderWidth;
+    innerRect.iTl.iY += aTopBorderHeight;
+    innerRect.iBr.iX -= aRightBorderWidth;
+    innerRect.iBr.iY -= aBottomBorderHeight;
+
+    // Top left segment
+    if (aTopBorderHeight > 0.0f && aLeftBorderWidth > 0.0f)
+        {
+        DrawCroppedTexture(aImage->Texture(), 
+                         THuiRealRect(texCoords.iTl, innerTexCoords.iTl), 
+                         THuiRealRect(outerRect.iTl, innerRect.iTl));
+        }
+
+    // Top segment
+    if (aTopBorderHeight > 0.0f)
+        {
+        DrawCroppedTexture(aImage->Texture(), 
+                           THuiRealRect(THuiRealPoint(innerTexCoords.iTl.iX, texCoords.iTl.iY), 
+                                        innerTexCoords.TopRight()),
+                           THuiRealRect(THuiRealPoint(innerRect.iTl.iX, outerRect.iTl.iY), 
+                                        innerRect.TopRight()));
+        }
+
+    // Top right segment
+    if (aTopBorderHeight > 0.0f && aRightBorderWidth > 0.0f)
+        {
+        DrawCroppedTexture(aImage->Texture(), 
+                           THuiRealRect(THuiRealPoint(innerTexCoords.iBr.iX, texCoords.iTl.iY),
+                                        THuiRealPoint(texCoords.iBr.iX, innerTexCoords.iTl.iY)),
+                           THuiRealRect(THuiRealPoint(innerRect.iBr.iX, outerRect.iTl.iY),
+                                        THuiRealPoint(outerRect.iBr.iX, innerRect.iTl.iY)));
+        }
+
+    // Right segment
+    if (aRightBorderWidth > 0.0f)
+        {
+        DrawCroppedTexture(aImage->Texture(), 
+                           THuiRealRect(innerTexCoords.TopRight(), 
+                                        THuiRealPoint(texCoords.iBr.iX, innerTexCoords.iBr.iY)),
+                           THuiRealRect(innerRect.TopRight(),
+                                        THuiRealPoint(outerRect.iBr.iX, innerRect.iBr.iY)));
+        }
+
+    // Bottom right segment
+    if (aBottomBorderHeight > 0.0f && aRightBorderWidth > 0.0f)
+        {
+        DrawCroppedTexture(aImage->Texture(), 
+                           THuiRealRect(innerTexCoords.iBr, texCoords.iBr),
+                           THuiRealRect(innerRect.iBr, outerRect.iBr));
+        }
+
+    // Bottom segment
+    if (aRightBorderWidth > 0.0f)
+        {
+        DrawCroppedTexture(aImage->Texture(), 
+                           THuiRealRect(innerTexCoords.BottomLeft(),
+                                        THuiRealPoint(innerTexCoords.iBr.iX, texCoords.iBr.iY)),
+                           THuiRealRect(innerRect.BottomLeft(),
+                                        THuiRealPoint(innerRect.iBr.iX, outerRect.iBr.iY)));
+        }
+
+    // Bottom left segment
+    if (aBottomBorderHeight > 0.0f && aRightBorderWidth > 0.0f)
+        {
+        DrawCroppedTexture(aImage->Texture(), 
+                           THuiRealRect(THuiRealPoint(texCoords.iTl.iX, innerTexCoords.iBr.iY),
+                                        THuiRealPoint(innerTexCoords.iTl.iX, texCoords.iBr.iY)),
+                           THuiRealRect(THuiRealPoint(outerRect.iTl.iX, innerRect.iBr.iY),
+                                        THuiRealPoint(innerRect.iTl.iX, outerRect.iBr.iY)));
+        }
+
+    // Left segment
+    if (aLeftBorderWidth > 0.0f)
+        {
+        DrawCroppedTexture(aImage->Texture(), 
+                           THuiRealRect(THuiRealPoint(texCoords.iTl.iX, innerTexCoords.iTl.iY), 
+                                        innerTexCoords.BottomLeft()),
+                           THuiRealRect(THuiRealPoint(outerRect.iTl.iX, innerRect.iTl.iY),
+                                        innerRect.BottomLeft()));
+        }
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Gc::DrawPath(const CHuiCurvePath& aPath,
+                            const TPoint& aOrigin,
+                            TReal32 aStartPos,
+                            TReal32 aEndPos,
+                            MHuiMappingFunction* aAlphaFunction,
+                            MHuiMappingFunction* aWidthFunction) __SOFTFP
+    {
+    // Refresh the vertices.
+    CHuiCurvePath* nonConstCurvePath = const_cast<CHuiCurvePath*>(&aPath);
+    nonConstCurvePath->Update(aStartPos, aEndPos, PenAlpha() / 255.f,
+                              aAlphaFunction, aWidthFunction);
+
+    aPath.Draw(aOrigin, this);
+    HUI_VG_INVARIANT();
+    }
+
+
+void CHuiVg10Gc::DrawMesh(const CHuiMesh& /*aMesh*/, const THuiImage* /*aImage*/,
+                            const THuiImage* /*aSecondaryImage*/,
+                            TReal32 /*aSecondaryAlpha*/) __SOFTFP
+    {
+    HUI_DEBUGF(_L("CHuiVg10Gc::DrawMesh() - Method has not been implemented! Sorry."));     
+    }
+
+void CHuiVg10Gc::DrawArc(const TPoint& /*aOrigin*/, const TSize& /*aRadius*/,
+                           TReal32 /*aEnd*/, TReal32 /*aStart*/, TInt /*aAnglePerSegment*/,
+                           TReal32 /*aWidth*/, const THuiImage& /*aImage*/,
+                           TReal32 (aAlphaFunc)(TReal32), TBool /*aAbsoluteAngleParm*/) __SOFTFP
+    {
+	 // not supported
+	aAlphaFunc(1.0); // just to disable compiler warning
+    return;
+    }
+
+
+
+void CHuiVg10Gc::DrawGradient(TGradientType aType, const TRect& aRect,
+                              const TRgb& aStartColor, const TRgb& aEndColor,
+                              TReal32 aStartOpacity, TReal32 aEndOpacity,
+                              const THuiRealRect* aTexCoords) __SOFTFP
+    {
+    VGfloat gradientCoords[4];
+    VGfloat x1 = (VGfloat)aRect.iTl.iX;
+    VGfloat y1 = (VGfloat)aRect.iTl.iY;
+    VGfloat x2 = (VGfloat)aRect.iBr.iX;
+    VGfloat y2 = (VGfloat)aRect.iBr.iY;
+    
+    switch (aType)
+        {
+        case EGradientLinearUp:
+            gradientCoords[0] = x1;  gradientCoords[1] = y2;
+            gradientCoords[2] = x1;  gradientCoords[3] = y1;
+            break;
+        case EGradientLinearRight:
+            gradientCoords[0] = x1;  gradientCoords[1] = y1;
+            gradientCoords[2] = x2;  gradientCoords[3] = y1;
+            break;
+        case EGradientLinearDown:
+            gradientCoords[0] = x1;  gradientCoords[1] = y1;
+            gradientCoords[2] = x1;  gradientCoords[3] = y2;
+            break;
+        case EGradientLinearLeft:
+            gradientCoords[0] = x2;  gradientCoords[1] = y1;
+            gradientCoords[2] = x1;  gradientCoords[3] = y1;
+            break;
+        }
+
+    VGfloat scale = 1.0f / 255.0f;
+    const VGfloat gradientStops[] =
+        {
+        0.0f,  aStartColor.Red() * scale, aStartColor.Green() * scale, aStartColor.Blue() * scale, aStartOpacity,
+        1.0f,  aEndColor.Red()   * scale, aEndColor.Green()   * scale, aEndColor.Blue()   * scale, aEndOpacity,
+        };
+    
+    vgSetParameterfv(iGradientPaint, VG_PAINT_LINEAR_GRADIENT, 2 * 2, gradientCoords);
+    vgSetParameterfv(iGradientPaint, VG_PAINT_COLOR_RAMP_STOPS, 2 * 5, gradientStops);
+    vgSetPaint(iGradientPaint, VG_FILL_PATH);
+    HUI_VG_INVARIANT();
+
+    UpdateColor();
+    UpdateMatrix(VG_MATRIX_PATH_USER_TO_SURFACE);
+    
+    // Draw the gradient as an image if we have a texture, otherwise draw a regular rectangle
+    if (aTexCoords)
+        {
+        /*
+        CHuiDisplay* display = CHuiStatic::Env().CurrentDisplay();
+
+        if (!display)
+            {
+            THuiPanic::Panic(THuiPanic::EVg10Invariant);
+            }
+        CHuiVg10RenderSurface* surface = static_cast<CHuiVg10RenderSurface*>(&display->RenderSurface());
+		*/
+		
+        CHuiVg10RenderSurface* surface = static_cast<CHuiVg10RenderSurface*>(CHuiStatic::CurrentRenderSurface());
+
+        if (!surface)
+            {
+            THuiPanic::Panic(THuiPanic::EVg10Invariant);
+            }
+        
+        const MHuiSegmentedTexture* tex = surface->BoundTexture();
+
+        if (!tex)
+            {
+            DrawRect(aRect);
+            }
+        else
+            {
+            vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_MULTIPLY); // Will be restored by next call to UpdateColor()
+            DrawTexture(*tex, *aTexCoords, aRect);
+            }
+        }
+    else
+        {
+        DrawRect(aRect);
+        }
+    HUI_VG_INVARIANT();
+    
+    // Restore the original paint
+    vgSetPaint(iPaint, VG_FILL_PATH | VG_STROKE_PATH);
+    UpdateColor();
+    }
+
+
+void CHuiVg10Gc::SetDepthOffset(TInt /*aOffset*/)
+    {
+    // No depth offset on OpenVG
+    }
+
+
+TUint8* CHuiVg10Gc::CaptureLC(TSize& aSize) const
+    {
+    TRect displayArea = RawDisplayArea();
+
+    TUint8* buffer = new (ELeave) TUint8[displayArea.Width() *
+                                         displayArea.Height() * 4];
+    CleanupStack::PushL(buffer);
+
+    aSize = displayArea.Size();
+    vgReadPixels(buffer, displayArea.Width() * 4, VG_lARGB_8888, 0, 0, 
+                 displayArea.Width(), displayArea.Height());
+
+    return buffer;
+    }
+
+#ifdef __NVG
+void CHuiVg10Gc::DrawNVG(HBufC8* aNVGData, MNVGIcon* aIconCmds, const TSize& aImageSize, TBool aIgnoreAspectRatio)
+    {
+    HUI_VG_INVARIANT();
+    
+    if (!aNVGData)
+        return;
+    // Parse the icon header info from the extended data
+    TPtr8 IconHeaderPtr((TUint8 *)aNVGData->Des().Ptr(), KIconHeaderLength, KIconHeaderLength);
+    TAknIconHeader iconheader(IconHeaderPtr);
+
+    // The rest of the data (after the iconheader) are the OVG drawing instructions
+    TInt lengthAfterHeader = aNVGData->Length() - KIconHeaderLength;
+    TPtr8 nvgDataVoidIC((TUint8 *)aNVGData->Des().Ptr() + KIconHeaderLength, lengthAfterHeader, lengthAfterHeader);
+    
+    // Set the rotation angle
+    iNvgEngine->Rotate(iconheader.GetRotation(), aImageSize.iWidth >>1, aImageSize.iHeight >>1);
+    
+    if (aIgnoreAspectRatio == EFalse)
+    {
+        // Set preserve aspect ratio (if not ignored)
+        TNvgAlignStatusType alignTypeValue = ENvgPreserveAspectRatio_XmidYmid;
+        TNvgMeetOrSliceType meetOrSliceTypeValue = ENvgMeet;
+        
+        switch ( iconheader.GetScaleMode() )
+            {
+            case EAspectRatioPreserved:
+                {
+                // Use default
+                break;
+                }
+            // Ensures NVG content fully covers the area
+            // of the icon whilst preserving aspect ratio.
+            case EAspectRatioPreservedSlice:
+                {
+                // alignTypeValue use default
+                meetOrSliceTypeValue = ENvgSlice;
+                break;
+                }
+            // EAspectRatioPreservedAndUnusedSpaceRemoved is mapped to the same
+            // values as EAspectRatioNotPreserved because we already have a
+            // frame buffer with the dimensions that preserves the aspect ratio.
+            // This mapping ensures that NVG engine does not calculate aspect
+            // ratio twice and potentially resulting in precision loss.
+            case EAspectRatioPreservedAndUnusedSpaceRemoved:
+            case EAspectRatioNotPreserved:
+                {            
+                alignTypeValue = ENvgPreserveAspectRatio_None;
+                // meetOrSliceTypeValue use default
+                break;
+                }
+            }
+        iNvgEngine->SetPreserveAspectRatio(alignTypeValue, meetOrSliceTypeValue);
+    }
+    
+    // Draw the NVG path onto the current surface using the NVGEngine
+    if (aIconCmds)
+        {
+        aIconCmds->Draw(aImageSize, iNvgEngine);
+        }
+    else
+        {
+        // Fall back drawing directly from the nvg data
+        HUI_DEBUG(_L("CHuiVg10Gc::DrawNVG() - Fallback to draw the old way (via DrawNvg)"));
+        iNvgEngine->DrawNvg(nvgDataVoidIC, aImageSize, NULL, NULL);
+        }
+
+#ifdef _DEBUG
+    // TODO: REMOVE ONCE THE TSW ERROR IS FIXED!
+    VGErrorCode err = vgGetError();
+    if (err)
+        {
+        RDebug::Print(_L("CHuiVg10Gc::DrawNVG - Error in NVG draw: %04x"), err);
+        }
+#endif
+    
+    // The NVG draw messes up the paint, scissoring & rects, so mark them as dirty
+    TInt dirtyFlags = EHuiVg10GcStateFlagDirtyPaint |
+                    EHuiVg10GcStateFlagDirtyScissor | 
+                    EHuiVg10GcStateFlagDirtyScissorRects;
+    ((CHuiVg10RenderPlugin&)CHuiStatic::Renderer()).AddRestoreStateFlags(dirtyFlags);
+    // Restore the paint etc.
+    RestoreFlaggedState();
+
+    HUI_VG_INVARIANT();
+    }
+#endif
+
+void CHuiVg10Gc::TransformDirtyRect(THuiRealRect& aRect)
+    {
+    THuiRealRect transformed = aRect;
+    
+    // Transform the rectangle using our stacks
+    UpdateClientMatrix();
+    iMatrixStack->Current().Multiply(transformed.iTl);
+    iMatrixStack->Current().Multiply(transformed.iBr);
+    
+    // Normalize the rectangle
+    if (transformed.iTl.iX > transformed.iBr.iX)
+        {
+        TReal32 tmp = transformed.iTl.iX;
+        transformed.iTl.iX = transformed.iBr.iX;
+        transformed.iBr.iX = tmp;
+        }
+    if (transformed.iTl.iY > transformed.iBr.iY)
+        {
+        TReal32 tmp = transformed.iTl.iY;
+        transformed.iTl.iY = transformed.iBr.iY;
+        transformed.iBr.iY = tmp;
+        }    
+
+    aRect = transformed;
+    }
+
+void CHuiVg10Gc::SetPaintPattern(CHuiTexture* aTexture, const TPoint& aTextureOrigin)
+    {
+    if (aTexture)
+        {
+        // TODO: This does not work if texture has NVG data only
+        iPaintPattern = GetVGImageFromTexture( *aTexture );
+        }
+    else
+        {
+        iPaintPattern = VG_INVALID_HANDLE;
+        }
+
+    if (iPaintPattern)
+        {
+        vgSetParameteri(iPaint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
+        vgSetParameteri(iPaint, VG_PAINT_PATTERN_TILING_MODE, VG_TILE_REPEAT);        
+        iPaintPatternOrigin = aTextureOrigin;
+        }
+    else
+        {
+        vgSetParameteri(iPaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
+        vgSetParameteri(iPaint, VG_PAINT_PATTERN_TILING_MODE, VG_TILE_FILL);        
+        iPaintPatternOrigin = TPoint(0,0);
+        }
+    
+    vgPaintPattern(iPaint, iPaintPattern);
+    }
+
+void CHuiVg10Gc::UsePaintPattern()
+    {
+    if (iPaintPattern)
+        {
+        // Transform the paint pattern to fill the destination rectangle as required
+        vgSeti(VG_MATRIX_MODE, VG_MATRIX_FILL_PAINT_TO_USER);
+        vgLoadIdentity();
+        vgTranslate(iPaintPatternOrigin.iX, iPaintPatternOrigin.iY);
+        vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
+        }
+    }
+
+void CHuiVg10Gc::DiscardPaintPattern()
+    {
+    if (iPaintPattern)
+        {
+        // Restore
+        vgSeti(VG_MATRIX_MODE, VG_MATRIX_FILL_PAINT_TO_USER);
+        vgLoadIdentity();
+        vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
+        }
+    }
+
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10PBufferSurface.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,587 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiVg10PBufferSurface. CHuiGles10PBufferSurface is
+*                an OpenVG PBuffer surface object that implements the MHuiRenderSurface
+*                interface.
+*
+*/
+
+
+
+#include "HuiVg10RenderPlugin.h"
+#include "HuiVg10PBufferSurface.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiSegmentedTexture.h"
+#include <EGL/egl.h>
+
+#include <coemain.h>
+
+struct THuiColorModeData
+	{
+	TInt iColorMode;
+	TInt iBitCount;
+	TInt iRed;
+	TInt iGreen;
+	TInt iBlue;
+	TInt iAlpha;
+	};
+	
+const THuiColorModeData KHuiColorModeData[] =
+		{ 
+			{0, EGL_DONT_CARE, 0, 0, 0, 8}, // Do not use ENone as there might be many of those in headers
+			{EColor4K, 	 12, 4, 4, 4, 0},
+			{EColor64K,  16, 5, 6, 5, 0},
+			{EColor16M,  24, 8, 8, 8, 0},
+			{EColor16MU, 32, 8, 8, 8, 0},
+#ifndef __NVG
+			{EColor16MA, 32, 8, 8, 8, 8}
+#else
+			{EColor16MA, 32, 8, 8, 8, 8},	
+			{EColor16MAP, 32, 8, 8, 8, 8}	
+#endif			
+		};
+
+
+CHuiVg10PBufferSurface* CHuiVg10PBufferSurface::NewLC(CHuiVg10RenderPlugin& aRenderer, 
+                                                          const TSize& aSize, 
+                                                          TInt aAlphaBits, 
+                                                          TInt aEglBufferType, 
+                                                          TInt aBufferColorMode)
+    {
+    CHuiVg10PBufferSurface* self = new (ELeave) CHuiVg10PBufferSurface(
+    	aRenderer, aSize, aAlphaBits, aEglBufferType, aBufferColorMode);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+
+CHuiVg10PBufferSurface* CHuiVg10PBufferSurface::NewLC(CHuiVg10RenderPlugin& aRenderer, 
+                                                          const TSize& aSize, 
+                                                          TInt aAlphaBits)
+    {
+    return NewLC(aRenderer, aSize, aAlphaBits, EGL_PBUFFER_BIT, 0);
+    }
+
+
+CHuiVg10PBufferSurface* CHuiVg10PBufferSurface::NewL(const TSize& aSize, TInt aAlphaBits)
+    {
+    CHuiVg10PBufferSurface* self = CHuiVg10PBufferSurface::NewLC(aSize, aAlphaBits);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+CHuiVg10PBufferSurface* CHuiVg10PBufferSurface::NewLC(const TSize& aSize, TInt aAlphaBits)
+    {
+    CHuiVg10RenderPlugin& render = CHuiStatic::Vg10Renderer();
+    return NewLC(render, aSize, aAlphaBits);
+    }
+
+
+CHuiVg10PBufferSurface::CHuiVg10PBufferSurface(CHuiVg10RenderPlugin& aRenderer,
+                                                   const TSize& aSize,
+                                                   TInt aAlphaBits, 
+                                                   TInt aEglBufferType, 
+                                                   TInt aBufferColorMode)
+        : iSize(aSize), iEglBufferType(aEglBufferType), iBufferColorMode(aBufferColorMode), 
+          iAlphaBits(aAlphaBits),iRenderer(aRenderer)
+    {
+    }
+
+
+void CHuiVg10PBufferSurface::ConstructL()
+    {
+    HUI_DEBUG(_L("CHuiVg10PBufferSurface::ConstructL() - Constructing OpenVG 1.0 PBuffer Rendering surface."));
+
+    // Create egl context and rendering surface
+    iEglContext = iEglSurface  = NULL;
+    iIsHardwareAccelerated = EFalse;
+    RestoreL();
+
+    HUI_DEBUG(_L("CHuiVg10PBufferSurface::ConstructL() - Construction exited OK."));
+    }
+
+
+CHuiVg10PBufferSurface::~CHuiVg10PBufferSurface()
+    {
+    Release();
+    }
+
+
+TBool CHuiVg10PBufferSurface::GetScreenOrigin(TPoint& /*aOrigin*/) const
+    {
+    // This class does only off-screen rendering, so the on-screen origin
+    // cannot be determined.
+    return EFalse;
+    }
+
+
+EGLConfig CHuiVg10PBufferSurface::DetermineConfig()
+    {    
+    HUI_DEBUG1(_L("CHuiVg10PBufferSurface::DetermineConfig() enter. iBufferColorMode=%d"), iBufferColorMode);
+    // Define properties for the wanted EGLSurface. To get the best possible
+    // performance, choose an EGLConfig with a buffersize matching
+    // the current window's display mode.
+
+    // Determine the buffer size
+#ifdef __WINSCW__
+	if (iBufferColorMode == ENone)
+		{
+		
+    	// Determine the natively supported display mode
+        CWsScreenDevice* screenDevice = CHuiStatic::ScreenDevice();
+        if(screenDevice)
+           	{
+           	screenDevice->DisplayMode();
+           	}
+        }
+#endif
+
+	// Find color mode data
+    THuiColorModeData cmData = KHuiColorModeData[0];
+    //Mem::Copy(&cmData, (&KHuiColorModeData[0]), sizeof(THuiColorModeData)); // default mode
+    for (TInt colorModeIndex = 0; 
+    	 colorModeIndex < (sizeof(KHuiColorModeData) / sizeof(THuiColorModeData)); 
+    	 colorModeIndex++)
+    	 	{
+    	 	if (iBufferColorMode == KHuiColorModeData[colorModeIndex].iColorMode)
+    	 		{
+    	 		Mem::Copy(&cmData, &(KHuiColorModeData[colorModeIndex]), sizeof(THuiColorModeData));
+    	 		}
+    	 	}
+    
+	// Define properties for the wanted EGLSurface.
+	EGLint attribListDefault[15];  // reserve enough space for configurations
+	int tmp = 0;
+	
+    attribListDefault[tmp++] = EGL_BUFFER_SIZE;
+    attribListDefault[tmp++] = cmData.iBitCount;
+        
+    attribListDefault[tmp++] = EGL_SURFACE_TYPE;
+    attribListDefault[tmp++] = iEglBufferType;
+
+    attribListDefault[tmp++] = EGL_RENDERABLE_TYPE;
+    attribListDefault[tmp++] = EGL_OPENVG_BIT;
+    
+    attribListDefault[tmp++] = EGL_ALPHA_SIZE;
+    attribListDefault[tmp++] = cmData.iAlpha;
+
+    /*
+#ifndef __WINSCW__
+	if( iIsHardwareAccelerated )
+		{		
+        // Emulator renders in software, so it does not antialias.
+        // MBX is efficient in supersampling.
+		attribListDefault[tmp++] = EGL_SAMPLE_BUFFERS;
+		attribListDefault[tmp++] = 1;
+
+		attribListDefault[tmp++] = EGL_SAMPLES;
+		attribListDefault[tmp++] = 4;	
+		}
+#endif // __WINSCW__
+*/
+
+	// Terminate attribute list
+	attribListDefault[tmp++] = EGL_NONE;
+         
+
+
+
+	// Define properties for the wanted EGLSurface.
+	EGLint attribListCustom[25];  // reserve enough space for configurations
+	tmp = 0;
+
+	attribListCustom[tmp++] = EGL_BUFFER_SIZE;
+	attribListCustom[tmp++] = cmData.iBitCount;
+	
+	attribListCustom[tmp++] = EGL_RED_SIZE;
+	attribListCustom[tmp++] = cmData.iRed;
+	
+    attribListCustom[tmp++] = EGL_GREEN_SIZE;
+    attribListCustom[tmp++] = cmData.iGreen;
+        
+	attribListCustom[tmp++] = EGL_BLUE_SIZE;
+	attribListCustom[tmp++] = cmData.iBlue;
+	
+	attribListCustom[tmp++] = EGL_RENDERABLE_TYPE;
+	attribListCustom[tmp++] = EGL_OPENVG_BIT;
+        
+	attribListCustom[tmp++] = EGL_SURFACE_TYPE;
+	attribListCustom[tmp++] = iEglBufferType;
+
+    attribListCustom[tmp++] = EGL_ALPHA_SIZE;
+    attribListCustom[tmp++] = cmData.iAlpha;
+	
+/*
+	if( iIsHardwareAccelerated )
+		{		
+        // Emulator renders in software, so it does not antialias.
+        // MBX is efficient in supersampling.
+		attribListCustom[tmp++] = EGL_SAMPLE_BUFFERS;
+		attribListCustom[tmp++] = 1;
+
+		attribListCustom[tmp++] = EGL_SAMPLES;
+		attribListCustom[tmp++] = 4;
+		}
+*/
+	// Terminate attribute list
+	attribListCustom[tmp++] = EGL_NONE;
+
+
+    // Choose an EGLConfig that best matches to the properties in attribList.
+    TInt numOfConfigs = 0;
+	if (iBufferColorMode == 0)
+		{
+		// No explicit color mode. Vg chooses the best mode.
+		numOfConfigs = iRenderer.EglChooseConfig(attribListDefault);
+		}
+	else
+		{
+		numOfConfigs = iRenderer.EglChooseConfig(attribListCustom);
+		}
+		
+    if(!numOfConfigs)
+        {
+#ifdef _DEBUG
+        TInt eglerr = eglGetError();
+        HUI_DEBUG2(_L("CHuiVg10PBufferSurface::DetermineConfig() - eglChooseConfig failed, no required EGL configuration found. Cause: %S (error %i). Panicking."), &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr);
+#endif
+        HUI_PANIC(THuiPanic::ERenderSurfaceUnknownDisplayMode)
+        }
+
+    HUI_DEBUG1(_L("CHuiVg10PBufferSurface::DetermineConfig() - Got %i configs."), numOfConfigs);
+
+    // Print the attributes of the selected config to log file.
+    iRenderer.EglPrintConfig(0);
+
+	if (iBufferColorMode == 0)
+		{
+		// Set color mode based on parameters
+		
+		// Update color mode struct
+    	TInt cfg = iRenderer.EglConfig(0);
+    	eglGetConfigAttrib(iEglDisplay, cfg, EGL_BUFFER_SIZE, 	&(cmData.iBitCount)); 
+    	eglGetConfigAttrib(iEglDisplay, cfg, EGL_RED_SIZE, 		&(cmData.iRed)); 
+    	eglGetConfigAttrib(iEglDisplay, cfg, EGL_GREEN_SIZE, 	&(cmData.iGreen)); 
+    	eglGetConfigAttrib(iEglDisplay, cfg, EGL_BLUE_SIZE, 	&(cmData.iBlue)); 
+    	eglGetConfigAttrib(iEglDisplay, cfg, EGL_ALPHA_SIZE, 	&(cmData.iAlpha)); 
+
+		// Find color mode from array
+    	for (TInt colorModeIndex = 0; 
+    	 	colorModeIndex < (sizeof(KHuiColorModeData) / sizeof(THuiColorModeData)); 
+    	 	colorModeIndex++)
+    		{
+    	 	if (
+    	 		(cmData.iBitCount == KHuiColorModeData[colorModeIndex].iBitCount) &&
+    	 		(cmData.iRed == KHuiColorModeData[colorModeIndex].iRed) &&
+    	 		(cmData.iGreen == KHuiColorModeData[colorModeIndex].iGreen) &&
+    	 		(cmData.iBlue == KHuiColorModeData[colorModeIndex].iBlue) &&
+    	 		(cmData.iAlpha == KHuiColorModeData[colorModeIndex].iAlpha) )
+    	 		{
+    	 		iBufferColorMode = KHuiColorModeData[colorModeIndex].iColorMode;
+    	 		}
+    	 	}		
+		}
+
+    // Choose the best EGLConfig. EGLConfigs returned by eglChooseConfig
+    // are sorted so that the best matching EGLConfig is first in the list.
+    return iRenderer.EglConfig(0);
+    }
+
+
+EGLSurface CHuiVg10PBufferSurface::CreateSurface(EGLConfig aConfig)
+    {
+    EGLSurface surface = EGL_NO_SURFACE;
+    if (iEglBufferType == EGL_PBUFFER_BIT)
+    	{
+    	// Create a Pbuffer surface.
+    	EGLint pbufferAttribList[] =
+        	{
+        	EGL_WIDTH,      iSize.iWidth,
+        	EGL_HEIGHT,     iSize.iHeight,
+        	EGL_NONE
+        	};
+
+    	HUI_DEBUG(_L("CHuiVg10PBufferSurface::CreateSurface() - Attempting to create a PBuffer surface."));  
+    	surface = eglCreatePbufferSurface(iEglDisplay, aConfig, pbufferAttribList);
+    	}
+
+    else if (iEglBufferType == EGL_PIXMAP_BIT)
+    	{
+    	delete(iBuffer);
+    	iBuffer = NULL;    
+    	iBuffer = new CWsBitmap( CHuiStatic::WsSession() );
+    	if (iBuffer && (iBufferColorMode > 0))
+    		{
+    		iBuffer->Create( iSize, (TDisplayMode)iBufferColorMode);
+    		HUI_DEBUG(_L("CHuiVg10PBufferSurface::CreateSurface() - Attempting to create a Pixmap surface."));
+    		surface = eglCreatePixmapSurface(iEglDisplay, aConfig, iBuffer, NULL);
+    		}
+    	}
+    else
+        {
+        // For PC-lint    
+        }
+    	
+    return surface;
+    }
+
+
+TSize CHuiVg10PBufferSurface::Size() const
+    {
+    return iSize;
+    }
+
+
+void CHuiVg10PBufferSurface::SetSizeL(const TSize& aSize)
+    {
+    iSize = aSize;
+
+    // Recreate pbuffer surfaces.
+    eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+
+    // Recreate the rendering surface.
+    eglDestroySurface(iEglDisplay, iEglSurface);
+
+    iEglSurface = CreateSurface(DetermineConfig());
+    if(iEglSurface == EGL_NO_SURFACE)
+        {
+        TInt eglerr = eglGetError();
+        switch (eglerr)
+            {
+            case EGL_BAD_ALLOC:
+                HUI_DEBUG2(_L("CHuiVg10PBufferSurface::SetSizeL() - ERROR! Failed to (re)create surface having size (%ix%i). Out of memory."), 
+                           aSize.iWidth, aSize.iHeight);
+                User::Leave(KErrNoMemory);
+            default:
+                HUI_DEBUG4(_L("CHuiVg10PBufferSurface::SetSizeL() - ERROR! Failed to (re)create surface having size (%ix%i).Cause: %S (EGL error code: %i). Leaving."), 
+                            aSize.iWidth, aSize.iHeight, 
+                            &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr);
+            case EGL_SUCCESS: // indicates that no error was recorded, but still the CreateSurface call failed (=> unable to continue!)
+                User::Leave(KErrNotSupported);
+            }
+        }
+
+    MakeCurrent();
+    }
+
+
+void CHuiVg10PBufferSurface::MakeCurrent()
+    {
+	if (iEglSurface == NULL || iEglContext == NULL)
+	{
+		// we can't makeCurrent on a released surface
+		return;
+	}
+    
+	// No need to change the current render surface if this render surface is current already.
+	if(CHuiStatic::CurrentRenderSurface() != ((MHuiRenderSurface*)this))
+	    {
+        eglMakeCurrent(iEglDisplay, iEglSurface, iEglSurface, iEglContext);
+        
+        TInt eglerr = eglGetError();
+        if(eglerr != EGL_SUCCESS)
+            {
+            HUI_DEBUG2(_L("CHuiVg10PBufferSurface::MakeCurrent() - Could not switch this rendering surface on. Cause: %S (EGL error code: %i). Panicking."),
+                       &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr);
+            HUI_PANIC(THuiPanic::ERenderSurfaceActivationFailed)
+            }
+        CHuiStatic::SetCurrentRenderSurface(this);	    
+	    }    
+    }
+
+
+void CHuiVg10PBufferSurface::SwapBuffers()
+    {
+    // Pbuffers consist of a single buffer only (no front/back buffers to swap).
+    }
+
+
+void CHuiVg10PBufferSurface::BindTexture(TInt aTextureUnit,
+                                           const MHuiSegmentedTexture& aTexture,
+                                           TInt aSegment)
+    {
+    (void)aTextureUnit;
+    (void)aTexture;
+    (void)aSegment;
+    }
+
+void CHuiVg10PBufferSurface::HandleVisibilityEvent(TBool /* aIsVisible */ )
+    {
+    // dummy method, does not handle the events in any way..
+    }
+
+void CHuiVg10PBufferSurface::Release()
+    {
+ 
+    HUI_DEBUG( _L("CHuiVg10PBufferSurface::Release() - Releasing EGL surface and context..") );
+    if (iEglSurface != NULL)
+        {
+        eglDestroySurface(iEglDisplay, iEglSurface);
+        TInt eglerr = eglGetError();
+        if(eglerr != EGL_SUCCESS)
+            {
+            HUI_DEBUG2(_L("CHuiVg10PBufferSurface::Release() - WARNING! Could not destroy EGL surface. Cause: %S (EGL error code: %i)."),
+                       &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr);
+            }
+        iEglSurface = NULL;
+        }
+     
+    // Delete pixmap if exists    
+    delete(iBuffer);
+    iBuffer = NULL;    
+        
+    if (iEglContext != NULL)
+        {
+        // Unshare this context if it was
+        // set as shared..
+        if(iRenderer.EglSharedContext() == iEglContext)
+            {
+            HUI_DEBUG(_L("CHuiVg10PBufferSurface::Release() - Unsharing this render context."));
+            iRenderer.EglSetSharedContext(EGL_NO_CONTEXT);
+            }
+
+        eglDestroyContext(iEglDisplay, iEglContext);
+        TInt eglerr = eglGetError();
+        if(eglerr != EGL_SUCCESS)
+            {
+            HUI_DEBUG2(_L("CHuiVg10PBufferSurface::Release() - WARNING! Could not destroy EGL context. Cause: %S (EGL error code: %i)."),
+                       &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr);
+            }
+        iEglContext = NULL;
+        }
+
+    }
+
+void CHuiVg10PBufferSurface::RestoreL()
+    {
+
+    HUI_DEBUG( _L("CHuiVg10PBufferSurface::RestoreL() - Restoring render surface.") );
+
+    if((iEglSurface != NULL) && (iEglContext != NULL))
+        {
+        HUI_DEBUG( _L("CHuiVg10RenderSurface::RestoreL() - Render surface and context already in place, no need to restore.") );
+        }
+    iEglDisplay = iRenderer.EglDisplay();
+
+    // Create an EGL rendering surface.
+    EGLConfig config = DetermineConfig();
+    iEglSurface = CreateSurface(config);
+    if(iEglSurface == EGL_NO_SURFACE)
+        {
+        TInt eglerr = eglGetError();
+        switch (eglerr)
+            {
+            case EGL_BAD_ALLOC:
+                HUI_DEBUG2(_L("CHuiVg10PBufferSurface::RestoreL() - ERROR! Failed to create pbuffer surface having size (%ix%i). Out of memory."), 
+                           iSize.iWidth, iSize.iHeight);
+                User::Leave(KErrNoMemory);
+            default:
+                HUI_DEBUG4(_L("CHuiVg10PBufferSurface::RestoreL() - ERROR! Failed to create pbuffer surface having size (%ix%i). Cause: %S (EGL error code: %i)."), 
+                            iSize.iWidth, iSize.iHeight, 
+                            &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr);
+            case EGL_SUCCESS: // indicates that no error was recorded, but still the CreateSurface call failed (=> unable to continue!)
+                User::Leave(KErrNotSupported);
+            }
+        }
+
+    // Create rendering context for PBuffer rendering.
+    // There is only a single texture manager in the environment, so textures
+    // need to shared between all contexts.
+    iEglContext = eglCreateContext(iEglDisplay, config,
+                                   iRenderer.EglSharedContext(), NULL);
+    if(iEglContext == EGL_NO_CONTEXT)
+        {
+        TInt eglerr = eglGetError();
+        switch (eglerr)
+            {
+            case EGL_BAD_ALLOC:
+                HUI_DEBUG(_L("CHuiVg10PBufferSurface::RestoreL() - ERROR! Failed to create rendering context. Out of memory."));
+                User::Leave(KErrNoMemory);
+            default:
+                HUI_DEBUG2(_L("CHuiVg10PBufferSurface::RestoreL() - ERROR! Failed to create rendering context. Cause: %S (EGL error code: %i)."),                            
+                            &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr);
+            case EGL_SUCCESS: // indicates that no error was recorded, but still the CreateSurface call failed (=> unable to continue!)
+                User::Leave(KErrNotSupported);
+            }
+        }
+
+    // Share this context if there was not already a shared context for texture
+    // management
+    if(iRenderer.EglSharedContext() == EGL_NO_CONTEXT)
+        {
+        HUI_DEBUG(_L("CHuiVg10PBufferSurface::ConstructL() - Making this surface shared."));
+        // Now that there is a context, make sure the renderer knows of it.
+        iRenderer.EglSetSharedContext(iEglContext);
+        }
+	eglMakeCurrent(iEglDisplay, iEglSurface, iEglSurface, iEglContext);
+    }
+
+EGLSurface CHuiVg10PBufferSurface::EglSurface()
+    {
+    return iEglSurface;
+    }
+
+void CHuiVg10PBufferSurface::BindToM3G()
+	{
+	}
+
+void CHuiVg10PBufferSurface::ReleaseFromM3G()
+	{
+	}
+	
+CFbsBitmap* CHuiVg10PBufferSurface::Buffer()
+	{
+	return iBuffer;
+	}
+    
+TInt CHuiVg10PBufferSurface::BufferColorMode() const
+	{
+	return iBufferColorMode;
+	}
+
+TUint CHuiVg10PBufferSurface::Flags() const
+	{
+	// ToDo: Is some flag needed?
+	return MHuiRenderSurface::EFlagNone;
+	}
+
+void CHuiVg10PBufferSurface::HandleDisplayUsageChangeL()
+    {
+    // Nothing to do
+    }
+	
+void CHuiVg10PBufferSurface::SetDirtyRect(const TRect& /*aRect*/)
+    {
+    // Nothing to do
+    }
+    
+MHuiTargetBitmap* CHuiVg10PBufferSurface::BackBuffer()
+    {
+    // Nothing to do
+    return NULL;
+    }
+
+CFbsBitGc* CHuiVg10PBufferSurface::Gc()
+    {
+    // Nothing to do
+    return NULL;
+    }
+
+void CHuiVg10PBufferSurface::RenderSurfaceExtension(const TUid& /*aExtensionUid*/, TAny** aExtensionParams)
+    {
+    *aExtensionParams = NULL;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10RenderPlugin.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,558 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiVg10RenderPlugin. Rendering plugin for OpenVG 1.0.
+*
+*/
+
+
+
+#include "HuiVg10RenderPlugin.h"
+#include "HuiVg10RenderSurface.h"
+#include "HuiVg10PBufferSurface.h"
+#include "HuiVg10Gc.h"
+#include "HuiVg10Texture.h"
+#include "HuiVg10TextureManager.h"
+#include "HuiVg10CurvePath.h"
+#include "huivg10canvasgc.h"
+#include "HuiRasterizedTextMesh.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiDisplay.h"
+#include "HuiFxVg10Engine.h"
+
+#ifdef __NVG
+    #include <nvg.h>
+    #include "HuiVg10VgImageBinder.h"
+#endif
+
+#include <AknUtils.h>
+#include <implementationproxy.h>
+
+#if !defined(EGL_VERSION_1_2)
+#  error At least EGL version 1.2 is required by the OpenVG render plugin.
+#endif
+
+
+
+const TImplementationProxy ImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY( 0x200184B8, CHuiVg10RenderPlugin::NewL )
+	};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+	{
+	aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+	return ImplementationTable;
+	}
+
+    
+CHuiVg10RenderPlugin* CHuiVg10RenderPlugin::NewL()
+    {
+    CHuiVg10RenderPlugin* self = CHuiVg10RenderPlugin::NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+CHuiVg10RenderPlugin* CHuiVg10RenderPlugin::NewLC()
+    {
+    CHuiVg10RenderPlugin* self = new (ELeave) CHuiVg10RenderPlugin();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+
+CHuiVg10RenderPlugin::CHuiVg10RenderPlugin(THuiRenderPluginId aId)
+        : CHuiRenderPlugin(aId)
+    {
+    }
+
+
+void CHuiVg10RenderPlugin::ConstructL()
+    {
+    HUI_DEBUG(_L("CHuiVg10RenderPlugin::ConstructL() - Initializing Rendering plugin.") );
+    
+	iIsHardwareAccelerated = EFalse;
+	iEGLStateForTextureUpload.iContext = KErrNotFound; // this will be defined later by the first upload in CHuiVg10Texture::PushEGLContext
+    iEglDisplay = NULL; 
+    iDefaultRenderSurface = NULL;
+
+
+    // Restore (Create the EGL surfaces)
+    RestoreL();
+
+// The disable flag is defined in coretkoptions.mmh
+#ifndef VG10_DISABLE_DEFAULT_RENDER_SURFACE
+    HUI_DEBUG(_L("CHuiVg10RenderPlugin::ConstructL() - Create default PBuffer rendering surface for texture preloads.") );
+    // Create default PBuffer rendering surface. This will allow us to for instance preload
+    // and create textures before actual rendering surface exists.
+    iDefaultRenderSurface = CHuiVg10PBufferSurface::NewLC(*this, TSize(64, 64));
+    CleanupStack::Pop(iDefaultRenderSurface);
+    iDefaultRenderSurface->MakeCurrent();
+    iIsHardwareAccelerated = IsHardwareAccelerated();
+#endif
+    HUI_DEBUG(_L("CHuiVg10RenderPlugin::ConstructL() - Rendering plugin for OpenVG 1.0 ready.") );      
+
+    // Initialize some "allow flags" which depend on used HW
+    ReadAllowsSwapBufferPreserved();
+    ReadAllowsVisualPBufferSurfaces();    
+    }
+
+CHuiVg10RenderPlugin::~CHuiVg10RenderPlugin()
+    {
+    Release();
+
+#ifndef VG10_DISABLE_DEFAULT_RENDER_SURFACE
+    if (iDefaultRenderSurface)
+        {
+        HUI_DEBUG(_L("CHuiVg10RenderPlugin::~CHuiVg10RenderPlugin() - Destroying default rendering surface."));
+        // Destroy default rendering surface
+        delete iDefaultRenderSurface; iDefaultRenderSurface = NULL;
+        }
+#endif
+
+    }
+
+void CHuiVg10RenderPlugin::RestoreL()
+    {
+    HUI_DEBUG(_L("CHuiVg10RenderPlugin::RestoreL() - Restoring renderer..") );
+
+    // Get the display for drawing graphics.
+    if (CHuiStatic::Env().GlesRefCounter() == 0)
+        {
+        HUI_DEBUG(_L("CHuiVg10RenderPlugin::RestoreL() - Getting default EGL Display.") );
+        iEglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+        if(iEglDisplay == EGL_NO_DISPLAY)
+            {
+            HUI_DEBUG(_L("CHuiVg10RenderPlugin::RestoreL() - ERROR! No connection to EGL display was available."));
+            TInt eglerr = eglGetError();
+            switch (eglerr)
+                {
+                case EGL_BAD_ALLOC:
+                    HUI_DEBUG(_L("CHuiVg10RenderPlugin::RestoreL() - Cause: Out of memory. Leaving."));
+                    User::Leave(KErrNoMemory);
+                default:
+                    HUI_DEBUG2(_L("CHuiVg10RenderPlugin::RestoreL() - EGL information for the error: %S (EGL error code: %i). Leaving."), &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr);
+                case EGL_SUCCESS:
+                    User::Leave(KErrNotSupported);
+                }
+            }
+        EGLint majorVersion=0;
+        EGLint minorVersion=0;
+        
+        // Initialize display.
+        if(eglInitialize(iEglDisplay, &majorVersion, &minorVersion) == EGL_FALSE)
+            {
+            TInt eglerr = eglGetError();
+            switch (eglerr)
+                {
+                case EGL_BAD_ALLOC:
+                    HUI_DEBUG(_L("CHuiVg10RenderPlugin::RestoreL() - Cause: Out of memory. Leaving."));
+                    User::Leave(KErrNoMemory);
+                default:
+                    HUI_DEBUG2(_L("CHuiVg10RenderPlugin::RestoreL() - ERROR! Failed to initialize EGL display. Cause: %S (EGL error code: %i). Leaving."), &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr);
+                case EGL_SUCCESS: // indicates that no error was recorded, but still the eglInitialize call failed (=> unable to continue!)
+                case EGL_NOT_INITIALIZED:
+                    User::Leave(KErrNotSupported);
+                }
+            }
+        HUI_DEBUG2(_L("CHuiVg10RenderPlugin::RestoreL() - EGL Initialized. EGL Version %i.%i"), majorVersion, minorVersion); 
+        CHuiStatic::Env().GlesRefCounter()++;
+
+        // Indicate that we are going to use OpenVG for our drawing
+        eglBindAPI(EGL_OPENVG_API);
+        }
+
+#ifndef VG10_DISABLE_DEFAULT_RENDER_SURFACE
+    if (iDefaultRenderSurface != NULL)
+        {
+        HUI_DEBUG(_L("CHuiVg10RenderPlugin::RestoreL() - Restoring default rendering surface..") );
+        iDefaultRenderSurface->RestoreL();
+        iDefaultRenderSurface->MakeCurrent();
+        }
+#endif
+
+    iStateFlags = 0;
+#ifdef __NVG
+    iNvgEngine = CNvgEngine::NewL();
+    // Set the image binder for NVG-TLV special case "Group opacity"
+    iMVGImageBinder = CHuiVg10VgImageBinder::NewL(this);
+    iNvgEngine->SetVGImageBinder(iMVGImageBinder);
+#endif
+    HUI_DEBUG(_L("CHuiVg10RenderPlugin::RestoreL() - Renderer restored!") );
+
+    }
+
+void CHuiVg10RenderPlugin::Release()
+    {
+#ifndef VG10_DISABLE_DEFAULT_RENDER_SURFACE
+    if (iDefaultRenderSurface != NULL)
+        {
+        HUI_DEBUG(_L("CHuiVg10RenderPlugin::Release() - Releasing default rendering surface..") );
+        iDefaultRenderSurface->Release();
+        }
+#endif
+    // Uninitialize EGL.
+    if (--CHuiStatic::Env().GlesRefCounter() == 0)
+        {
+        HUI_DEBUG(_L("CHuiVg10RenderPlugin::Release() - Uninitializing EGL."));
+        eglMakeCurrent(iEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+    	eglTerminate(iEglDisplay);
+    	eglReleaseThread();
+        iEglDisplay = 0;
+        }
+#ifdef __NVG
+    delete iNvgEngine;
+    iNvgEngine = NULL;
+    delete iMVGImageBinder;
+    iMVGImageBinder = NULL;
+#endif
+    HUI_DEBUG(_L("CHuiVg10RenderPlugin::Release() - Renderer released."));
+    }
+
+
+TBool CHuiVg10RenderPlugin::Allows(THuiRenderPluginAllow aAllow) const
+    {
+    switch(aAllow)
+        {
+        case EHuiRenderPluginAllowTextureModeInterpolate:
+            // OpenVG does not support texture interpolation.
+            return EFalse;
+#ifdef VG10_DISABLE_DEFAULT_RENDER_SURFACE
+        case EHuiRenderPluginAllowPBufferSurfaces:
+            return EFalse;            
+#endif            
+        case EHuiRenderPluginAllowSwapBufferPreserve:
+            return iAllowsSwapBufferPreserved;
+        case EHuiRenderPluginAllowVisualPBufferSurfaces:
+            return iAllowsVisualPBufferSurfaces;           
+        default:
+            return ETrue;
+        }
+    }
+
+
+MHuiRenderSurface* CHuiVg10RenderPlugin::CreateRenderSurfaceL(CHuiDisplay& aDisplay)
+    {
+    return CHuiVg10RenderSurface::NewL(aDisplay);
+    }
+
+
+CHuiVg10PBufferSurface* CHuiVg10RenderPlugin::CreatePBufferSurfaceL(TSize aSize, TInt aEglBufferType, TInt aBufferColorMode)
+    {
+    CHuiVg10PBufferSurface* surface = CHuiVg10PBufferSurface::NewLC(*this, aSize, 0, aEglBufferType, aBufferColorMode);
+    CleanupStack::Pop(surface);
+    return surface;
+    }
+
+
+CHuiGc* CHuiVg10RenderPlugin::CreateGcL()
+    {
+    return CHuiVg10Gc::NewL();
+    }
+
+
+CHuiTexture* CHuiVg10RenderPlugin::CreateTextureL(const THuiTextureHandle* aExistingTexture)
+    {
+    return CHuiVg10Texture::NewL(*this, aExistingTexture);
+    }
+
+CHuiTextureManager* CHuiVg10RenderPlugin::CreateTextureManagerL(CHuiEnv& aEnv)
+    {
+    return CHuiVg10TextureManager::NewL(aEnv);
+    }
+
+
+CHuiMesh* CHuiVg10RenderPlugin::CreateMeshL(THuiMeshType aMeshType)
+    {
+    CHuiMesh* ret = NULL;
+    
+    switch(aMeshType)
+    	{
+    	default:
+    		User::Leave(KErrNotSupported);
+    		break;
+    	}
+    	
+	return ret;    	
+    }
+
+
+CHuiTextMesh* CHuiVg10RenderPlugin::CreateTextMeshL()
+    {
+    return CHuiRasterizedTextMesh::NewL();
+    }
+
+
+CHuiCurvePath* CHuiVg10RenderPlugin::CreateCurvePathL()
+    {
+    CHuiVg10CurvePath* curve = new (ELeave) CHuiVg10CurvePath();
+    CleanupStack::PushL(curve);
+    curve->ConstructL();
+    CleanupStack::Pop(curve);
+    return curve;
+    }
+
+
+void CHuiVg10RenderPlugin::DeleteNamedTexture(TUint aName)
+    {
+    (void)aName;
+    }
+
+
+#ifndef VG10_DISABLE_DEFAULT_RENDER_SURFACE
+void CHuiVg10RenderPlugin::NotifyDisplayCountL(TUint aCount)
+    {
+    if( aCount == 0 )
+        {
+        // No current display available in the environment.
+        // Make default surface current to be able to continue resource loading.
+        iDefaultRenderSurface->MakeCurrent();
+        }
+    }
+#else
+void CHuiVg10RenderPlugin::NotifyDisplayCountL(TUint /*aCount*/)
+    {
+    }
+#endif
+
+EGLConfig CHuiVg10RenderPlugin::EglDisplay()
+    {
+    return iEglDisplay;
+    }
+
+
+EGLContext CHuiVg10RenderPlugin::EglSharedContext() const
+    {
+    return iSharedContext;
+    }
+
+
+void CHuiVg10RenderPlugin::EglSetSharedContext(EGLContext aContext)
+    {
+    iSharedContext = aContext;
+    }
+
+
+TInt CHuiVg10RenderPlugin::EglChooseConfig(const TInt* aAttribList)
+    {
+    EGLint numOfConfigs = 0;
+    if(eglChooseConfig(iEglDisplay, aAttribList, iConfigs, KVg10ConfigsCount,
+                       &numOfConfigs) == EGL_FALSE)
+        {
+        return 0;
+        }
+    return numOfConfigs;
+    }
+
+
+TInt CHuiVg10RenderPlugin::EglConfig(TInt aIndex)
+    {
+    if(aIndex < 0 || aIndex >= KVg10ConfigsCount)
+        {
+        THuiPanic::Panic(THuiPanic::EEnvConfigNotFound);
+        }
+    return iConfigs[aIndex];
+    }
+
+
+void CHuiVg10RenderPlugin::EglPrintConfig(TInt aIndex)
+    {
+    if(aIndex < 0 || aIndex >= KVg10ConfigsCount)
+        {
+        THuiPanic::Panic(THuiPanic::EEnvConfigNotFound);
+        }
+
+    EGLint value;
+    EGLConfig cfg = iConfigs[aIndex];
+
+    CHuiStatic::Printf(_L("EGL Configuration %i:"), aIndex);
+
+#ifdef WIN32
+#define HUI_PRINT_EGL_ATTRIB(aAttr) \
+    eglGetConfigAttrib(iEglDisplay, cfg, aAttr, &value); \
+    CHuiStatic::Printf(_L(#aAttr " = %i (%04x)"), value, value);
+#else
+#define HUI_PRINT_EGL_ATTRIB(aAttr) \
+    eglGetConfigAttrib(iEglDisplay, cfg, aAttr, &value); \
+    CHuiStatic::Printf(_L("Parameter (id %04x):"), aAttr); \
+    CHuiStatic::Printf(_L8(#aAttr)); \
+    CHuiStatic::Printf(_L("Value: %i (%04x)"), value, value);
+#endif
+    HUI_PRINT_EGL_ATTRIB(EGL_CONFIG_ID);
+    HUI_PRINT_EGL_ATTRIB(EGL_CONFIG_CAVEAT);
+    HUI_PRINT_EGL_ATTRIB(EGL_SURFACE_TYPE);
+    HUI_PRINT_EGL_ATTRIB(EGL_BUFFER_SIZE);
+    HUI_PRINT_EGL_ATTRIB(EGL_RED_SIZE);
+    HUI_PRINT_EGL_ATTRIB(EGL_GREEN_SIZE);
+    HUI_PRINT_EGL_ATTRIB(EGL_BLUE_SIZE);
+    HUI_PRINT_EGL_ATTRIB(EGL_ALPHA_SIZE);
+    HUI_PRINT_EGL_ATTRIB(EGL_DEPTH_SIZE);
+    HUI_PRINT_EGL_ATTRIB(EGL_LEVEL);
+    HUI_PRINT_EGL_ATTRIB(EGL_MAX_PBUFFER_WIDTH);
+    HUI_PRINT_EGL_ATTRIB(EGL_MAX_PBUFFER_HEIGHT);
+    HUI_PRINT_EGL_ATTRIB(EGL_MAX_PBUFFER_PIXELS);
+    HUI_PRINT_EGL_ATTRIB(EGL_NATIVE_RENDERABLE);
+    HUI_PRINT_EGL_ATTRIB(EGL_NATIVE_VISUAL_ID);
+    HUI_PRINT_EGL_ATTRIB(EGL_NATIVE_VISUAL_TYPE);
+    HUI_PRINT_EGL_ATTRIB(EGL_SAMPLE_BUFFERS);
+    HUI_PRINT_EGL_ATTRIB(EGL_SAMPLES);
+    HUI_PRINT_EGL_ATTRIB(EGL_STENCIL_SIZE);
+    HUI_PRINT_EGL_ATTRIB(EGL_TRANSPARENT_TYPE);
+#ifdef EGL_VERSION_1_1
+    HUI_PRINT_EGL_ATTRIB(EGL_BIND_TO_TEXTURE_RGB);
+    HUI_PRINT_EGL_ATTRIB(EGL_BIND_TO_TEXTURE_RGBA);
+    HUI_PRINT_EGL_ATTRIB(EGL_MAX_SWAP_INTERVAL);
+    HUI_PRINT_EGL_ATTRIB(EGL_MIN_SWAP_INTERVAL);
+#endif
+#ifdef EGL_VERSION_1_2
+    HUI_PRINT_EGL_ATTRIB(EGL_PRESERVED_RESOURCES);
+    HUI_PRINT_EGL_ATTRIB(EGL_LUMINANCE_SIZE);
+    HUI_PRINT_EGL_ATTRIB(EGL_ALPHA_MASK_SIZE);
+    HUI_PRINT_EGL_ATTRIB(EGL_COLOR_BUFFER_TYPE);
+    HUI_PRINT_EGL_ATTRIB(EGL_RENDERABLE_TYPE);
+#endif
+    
+#undef HUI_PRINT_EGL_ATTRIB
+    }
+
+
+TBool CHuiVg10RenderPlugin::IsReleased() const
+    {
+    if(CHuiStatic::Env().GlesRefCounter() == 0)
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+const TDesC& CHuiVg10RenderPlugin::VgErrorMessage(VGErrorCode aErrorCode)
+    {
+    // Error messages.
+    _LIT(KGlesErrorUnknown, "Invalid or unknown error.");
+
+    switch(aErrorCode)
+        {
+        default:
+            return KGlesErrorUnknown;
+        }
+    }
+
+
+VGErrorCode CHuiVg10RenderPlugin::VgError()
+    {
+    VGErrorCode error = vgGetError();
+#ifdef _DEBUG
+    // Print the vgError always in debug mode, not just when HUI_DEBUG is in use 
+    if (error != VG_NO_ERROR)
+        {
+        RDebug::Print(_L("CHuiVg10RenderPlugin::VgError -- %04x"), error);
+        }
+#endif
+    return error;
+    }
+
+
+TBool CHuiVg10RenderPlugin::IsHardwareAccelerated()
+	{
+	// consider vg10 plugin as HW accelerated until a better check
+
+//	TBool HWFound = EFalse;
+	iIsHardwareAccelerated = ETrue;
+	return ETrue;		
+	}
+
+CHuiCanvasGc* CHuiVg10RenderPlugin::CreateCanvasGcL()
+    {
+    return new (ELeave) CHuiVg10CanvasGc();        
+    }
+
+CHuiFxEngine* CHuiVg10RenderPlugin::CreateEffectsEngineL()
+    {
+    return CHuiFxVg10Engine::NewL(*this);
+    }
+
+void CHuiVg10RenderPlugin::AddRestoreStateFlags(TInt aFlags)
+    {
+    iStateFlags |= aFlags;
+    }
+
+TInt CHuiVg10RenderPlugin::GetRestoreStateFlags()
+    {
+    return iStateFlags;
+    }
+
+void CHuiVg10RenderPlugin::ClearRestoreStateFlags()
+    {
+    iStateFlags &= 0x00000000;
+    }
+
+#ifdef __NVG
+CNvgEngine& CHuiVg10RenderPlugin::NvgEngine() const
+    {
+    return *iNvgEngine;
+    }
+#endif
+
+// TODO: This is only a temporary check until all HW platforms support feature
+void CHuiVg10RenderPlugin::ReadAllowsSwapBufferPreserved()
+    {    
+#ifdef __WINS__ 
+    iAllowsSwapBufferPreserved = ETrue;
+#else
+    const char* vendor = eglQueryString(iEglDisplay, EGL_VENDOR);    
+    //const VGubyte* vendor = vgGetString(VG_VENDOR);    
+    //RDebug::Print(_L("vendor = %s"), vendor);    
+
+    TBool found = EFalse;
+    if( vendor[0] != 0 && vendor[0] == 'B' && vendor[1] == 'r')
+        {
+        RDebug::Print(_L("CHuiVg10RenderPlugin::ReadAllowsSwapBufferPreserved() -- ETrue"));    
+        found = ETrue;
+        }
+    else
+        {
+        RDebug::Print(_L("CHuiVg10RenderPlugin::ReadAllowsSwapBufferPreserved() -- EFalse"));            
+        }
+    iAllowsSwapBufferPreserved = found;
+#endif
+    }
+
+// TODO: This is only a temporary check until all HW platforms support feature
+void CHuiVg10RenderPlugin::ReadAllowsVisualPBufferSurfaces()
+    {
+#ifdef __WINS__ 
+    iAllowsVisualPBufferSurfaces = ETrue;
+#else
+    const char* vendor = eglQueryString(iEglDisplay, EGL_VENDOR);    
+    //const VGubyte* vendor = vgGetString(VG_VENDOR);    
+    //RDebug::Print(_L("vendor = %s"), vendor);
+
+    TBool found = EFalse;
+    if( vendor[0] != 0 && vendor[0] == 'B' && vendor[1] == 'r')
+        {
+        RDebug::Print(_L("CHuiVg10RenderPlugin::ReadAllowsVisualPBufferSurfaces() -- ETrue"));    
+        found = ETrue;
+        }
+    else
+        {
+        RDebug::Print(_L("CHuiVg10RenderPlugin::ReadAllowsVisualPBufferSurfaces() -- EFalse"));            
+        }
+    iAllowsVisualPBufferSurfaces = found;
+#endif
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10RenderSurface.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,481 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   OpenVG 1.0 render surface implementation.
+*
+*/
+
+
+
+#include "HuiVg10RenderSurface.h"
+#include "HuiVg10RenderPlugin.h"
+#include "uiacceltk/HuiSegmentedTexture.h"
+#include "uiacceltk/HuiDisplay.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiUtil.h"
+#include <coecntrl.h>
+#include <w32std.h>
+#include <gdi.h>
+#include "uiacceltk/HuiProbe.h"
+#include "uiacceltk/HuiEnv.h"
+
+#include <M3G/m3g_core.h>
+
+
+CHuiVg10RenderSurface* CHuiVg10RenderSurface::NewL(CHuiDisplay& aDisplay)
+    {
+    CHuiVg10RenderSurface* self = CHuiVg10RenderSurface::NewLC(aDisplay);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+CHuiVg10RenderSurface* CHuiVg10RenderSurface::NewLC(CHuiDisplay& aDisplay)
+    {
+    CHuiVg10RenderSurface* self = new (ELeave) CHuiVg10RenderSurface(aDisplay);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+
+CHuiVg10RenderSurface::CHuiVg10RenderSurface(CHuiDisplay& aDisplay)
+        : iDisplay(&aDisplay)
+    {
+    HUI_PROBE_ASSOCIATE_WITH_CURRENT_SESSION
+    HUI_PROBE_REPORT_CONSTRUCTED
+    }
+
+
+void CHuiVg10RenderSurface::ConstructL()
+    {
+    HUI_DEBUG(_L("CHuiVg10RenderSurface::ConstructL() - Constructing OpenVG 1.0 Rendering surface."));
+
+    // Size of the surface.
+    iSize = iDisplay->Size();
+
+    // Create egl context and rendering surface
+    iEglContext = iEglSurface  = NULL;
+    iBoundTexture = NULL;
+    RestoreL();
+
+    HUI_DEBUG(_L("CHuiVg10RenderSurface::ConstructL() - Construction succeeded."));
+}
+
+
+CHuiVg10RenderSurface::~CHuiVg10RenderSurface()
+    {
+    Release();
+    iDisplay = NULL;
+    HUI_PROBE_REPORT_DESTRUCTED
+    }
+
+
+CHuiDisplay& CHuiVg10RenderSurface::Display() const
+    {
+    return *iDisplay;
+    }
+    
+    
+TUint CHuiVg10RenderSurface::Flags() const
+	{    
+	TBool useDirtyAreas = CHuiStatic::Renderer().Allows(EHuiRenderPluginAllowSwapBufferPreserve);    	
+    if (useDirtyAreas)
+	    {
+	    return MHuiRenderSurface::EFlagUseDirtyRects;
+	    }
+	else
+	    {
+	    return MHuiRenderSurface::EFlagNone;
+	    }
+	}
+
+
+TBool CHuiVg10RenderSurface::GetScreenOrigin(TPoint& aOrigin) const
+    {
+    if(iDisplay && iDisplay->NativeControl())
+        {
+        aOrigin = iDisplay->NativeControl()->PositionRelativeToScreen();
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+static void CreateConstEglAttribs(int& i, EGLint* attribList)
+    {
+    const TInt BITS_PER_CHANNEL = 8;
+    
+    attribList[i++] = EGL_RED_SIZE;
+    attribList[i++] = BITS_PER_CHANNEL;
+	
+    attribList[i++] = EGL_GREEN_SIZE;
+    attribList[i++] = BITS_PER_CHANNEL;
+    
+    attribList[i++] = EGL_BLUE_SIZE;
+    attribList[i++] = BITS_PER_CHANNEL;
+    
+    attribList[i++] = EGL_ALPHA_SIZE;
+    attribList[i++] = BITS_PER_CHANNEL;
+    
+    attribList[i++] = EGL_SURFACE_TYPE;
+
+    TBool useDirtyAreas = CHuiStatic::Renderer().Allows(EHuiRenderPluginAllowSwapBufferPreserve);       
+    if (useDirtyAreas)
+        {    
+        attribList[i++] = EGL_WINDOW_BIT | EGL_PBUFFER_BIT | EGL_SWAP_BEHAVIOR_PRESERVED_BIT;
+        }
+    else
+        {
+        attribList[i++] = EGL_WINDOW_BIT | EGL_PBUFFER_BIT;
+        }
+
+    attribList[i++] = EGL_RENDERABLE_TYPE;
+    attribList[i++] = EGL_OPENVG_BIT;
+    }
+
+EGLConfig CHuiVg10RenderSurface::DetermineConfig()
+    {
+	EGLint attribList[20];  // reserve enough space for configurations	
+	int i = 0;
+	
+	// Get default properties for the wanted EGLSurface.
+    CreateConstEglAttribs(i, attribList);
+
+	// Terminate attribute list
+	attribList[i++] = EGL_NONE;
+
+    CHuiVg10RenderPlugin& render = CHuiStatic::Vg10Renderer();
+
+    // Choose an EGLConfig that best matches to the properties in attribList.
+    TInt numOfConfigs = render.EglChooseConfig(attribList);
+
+    if(!numOfConfigs)
+        {
+        TInt eglerr = eglGetError();
+        HUI_DEBUG2(_L("CHuiVg10RenderSurface::DetermineConfig() - eglChooseConfig failed, no required EGL configuration found. Cause: %S (error %i). Panicking."), &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr);
+        HUI_PANIC(THuiPanic::ERenderSurfaceUnknownDisplayMode);
+        }
+
+    HUI_DEBUG1(_L("CHuiVg10RenderSurface::DetermineConfig() - Got %i configs."), numOfConfigs);
+
+    // Print the attributes of the selected config to log file.
+    render.EglPrintConfig(0);
+
+    // Choose the best EGLConfig. EGLConfigs returned by eglChooseConfig
+    // are sorted so that the best matching EGLConfig is first in the list.
+    return render.EglConfig(0);
+    }
+
+
+EGLSurface CHuiVg10RenderSurface::CreateSurface(EGLConfig aConfig)
+    {
+	EGLint* attriblistPtr = NULL;
+#ifndef __WINS__ // \todo instead of "#ifndef" should make a check if alpha mode is supported
+    // Create a rendering surface.
+    EGLint attriblist[] = 
+        {
+        EGL_VG_ALPHA_FORMAT, EGL_VG_ALPHA_FORMAT_PRE,
+        EGL_NONE
+        };
+    attriblistPtr = &attriblist[0];
+#endif
+    
+    if(iDisplay->NativeWindow())
+        {
+        HUI_DEBUG(_L("CHuiVg10RenderSurface::CreateSurface() - Attempting to create a real window surface."));
+        EGLSurface surf = eglCreateWindowSurface(iEglDisplay, aConfig,
+                                      iDisplay->NativeWindow(), attriblistPtr);
+
+        TBool useDirtyAreas = CHuiStatic::Renderer().Allows(EHuiRenderPluginAllowSwapBufferPreserve);       
+        if (useDirtyAreas)
+            {    
+            eglSurfaceAttrib(iEglDisplay, surf, EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED );
+            }
+        return surf;
+        }
+    else
+        {
+        // Pbuffer attributes.
+        EGLint pbufferAttribList[] =
+            {
+            EGL_WIDTH,      iSize.iWidth,
+            EGL_HEIGHT,     iSize.iHeight,
+            EGL_NONE
+            };
+
+        HUI_DEBUG(_L("CHuiVg10RenderSurface::CreateSurface() - Attempting to create a pbuffer surface."));
+        return eglCreatePbufferSurface(iEglDisplay, aConfig, pbufferAttribList);
+        }
+    }
+
+
+TSize CHuiVg10RenderSurface::Size() const
+    {
+    return iSize;
+    }
+
+
+void CHuiVg10RenderSurface::SetSizeL(const TSize& aSize)
+    {
+    iSize = aSize;
+
+    if(!iDisplay->NativeWindow())
+        {
+        // Recreate pbuffer surfaces.
+        eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+
+        // Recreate the rendering surface.
+        eglDestroySurface(iEglDisplay, iEglSurface);
+
+        iEglSurface = CreateSurface(DetermineConfig());
+
+        if(iEglSurface == EGL_NO_SURFACE)
+            {
+            TInt eglerr = eglGetError();
+            switch (eglerr)
+                {
+                case EGL_BAD_ALLOC:
+                    HUI_DEBUG2(_L("CHuiVg10RenderSurface::SetSizeL() - ERROR! Failed to (re)create surface having size (%ix%i). Out of memory."), 
+                               aSize.iWidth, aSize.iHeight);
+                    User::Leave(KErrNoMemory);
+                default:
+                    HUI_DEBUG4(_L("CHuiVg10RenderSurface::SetSizeL() - ERROR! Failed to (re)create surface having size (%ix%i).Cause: %S (EGL error code: %i). Leaving."), 
+                                aSize.iWidth, aSize.iHeight, 
+                                &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr);
+                case EGL_SUCCESS: // indicates that no error was recorded, but still the CreateSurface call failed (=> unable to continue!)
+                    User::Leave(KErrNotSupported);
+                }
+            }
+        }
+    }
+
+
+void CHuiVg10RenderSurface::MakeCurrent()
+	{
+	// No need to change the current render surface if this render surface is current already.
+	if(CHuiStatic::CurrentRenderSurface() != ((MHuiRenderSurface*)this))
+		{
+		CHuiEnv* env = CHuiEnv::Static();  
+		if (env && env->iSwapObserver)
+		    {    
+            env->iSwapObserver->ReleaseWindowServer();
+		    }
+		
+		eglMakeCurrent(iEglDisplay, iEglSurface, iEglSurface, iEglContext);
+        
+        if (env && env->iSwapObserver)
+            {
+            env->iSwapObserver->ReleaseWindowServer(EFalse);
+            }
+
+		TInt eglerr = eglGetError();
+		if(eglerr != EGL_SUCCESS)
+			{
+			HUI_DEBUG3(_L("CHuiVg10RenderSurface::MakeCurrent() - Error in switching on the render surface, EGLDisplay: %i, EGLSurface: %i, EGLContext: %i."),
+				iEglDisplay, iEglSurface, iEglContext);
+			HUI_DEBUG2(_L("CHuiVg10RenderSurface::MakeCurrent() - Could not switch this rendering surface on. Cause: %S (EGL error code: %i). Panicking."),
+				&CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr);
+			HUI_PANIC(THuiPanic::ERenderSurfaceActivationFailed)
+			}
+		CHuiStatic::SetCurrentRenderSurface(this);               
+		}
+	}
+
+void CHuiVg10RenderSurface::SwapBuffers()
+    {
+    eglSwapBuffers(iEglDisplay, iEglSurface);
+    }
+
+
+void CHuiVg10RenderSurface::BindTexture(TInt /*aTextureUnit*/,
+                                        const MHuiSegmentedTexture& aTexture,
+                                        TInt /*aSegment*/)
+    {
+    iBoundTexture = &aTexture;
+    }
+
+
+const MHuiSegmentedTexture* CHuiVg10RenderSurface::BoundTexture() const
+    {
+    return iBoundTexture;
+    }
+
+void CHuiVg10RenderSurface::HandleVisibilityEvent(TBool /* aIsVisible */ )
+    {
+    // Dummy method, does not handle the events in any way...
+    }
+
+void CHuiVg10RenderSurface::Release()
+    {
+    HUI_DEBUG( _L("CHuiVg10RenderSurface::Release() - Releasing EGL surface and context..") );
+    if (iEglSurface != NULL)
+        {
+        eglDestroySurface(iEglDisplay, iEglSurface);
+        TInt eglerr = eglGetError();
+        if(eglerr != EGL_SUCCESS)
+            {
+            HUI_DEBUG2(_L("CHuiVg10RenderSurface::Release() - WARNING! Could not destroy EGL surface. Cause: %S (EGL error code: %i)."),
+                       &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr);
+            }
+        iEglSurface = NULL;
+        }
+    if (iEglContext != NULL)
+        {
+        // Unshare this context if it was
+        // set as shared..
+        CHuiVg10RenderPlugin& renderer = CHuiStatic::Vg10Renderer();
+        if(renderer.EglSharedContext() == iEglContext)
+            {
+            HUI_DEBUG(_L("CHuiVg10RenderSurface::Release() - Unsharing this render context."));
+            renderer.EglSetSharedContext(EGL_NO_CONTEXT);
+            }
+
+        eglDestroyContext(iEglDisplay, iEglContext);
+        TInt eglerr = eglGetError();
+        if(eglerr != EGL_SUCCESS)
+            {
+            HUI_DEBUG2(_L("CHuiVg10RenderSurface::Release() - WARNING! Could not destroy EGL context. Cause: %S (EGL error code: %i)."),
+                       &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr);
+            }
+        iEglContext = NULL;
+        }
+    }
+
+void CHuiVg10RenderSurface::RestoreL()
+    {
+    HUI_DEBUG( _L("CHuiVg10RenderSurface::RestoreL() - Recreating render surface.") );
+
+    if((iEglSurface != NULL) && (iEglContext != NULL))
+        {
+        HUI_DEBUG( _L("CHuiVg10RenderSurface::RestoreL() - Render surface and context already in place, no need to restore.") );
+        }
+
+    CHuiVg10RenderPlugin& render = CHuiStatic::Vg10Renderer();
+    iEglDisplay = render.EglDisplay();
+
+    // Create an EGL rendering surface.
+    EGLConfig config = DetermineConfig();
+    iEglSurface = CreateSurface(config);
+
+    if(iEglSurface == EGL_NO_SURFACE)
+        {
+        TInt eglerr = eglGetError();
+        switch (eglerr)
+            {
+            case EGL_BAD_ALLOC:
+                HUI_DEBUG2(_L("CHuiVg10RenderSurface::RestoreL() - ERROR! Failed to create rendering surface having size (%ix%i). Out of memory."), 
+                           iSize.iWidth, iSize.iHeight);
+                User::Leave(KErrNoMemory);
+            default:
+                HUI_DEBUG4(_L("CHuiVg10RenderSurface::RestoreL() - ERROR! Failed to create rendering surface having size (%ix%i). Cause: %S (EGL error code: %i)."), 
+                            iSize.iWidth, iSize.iHeight, 
+                            &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr);
+                User::Leave(KErrNotSupported);
+            }
+        }
+
+    // There is only a single texture manager in the environment, so textures
+    // need to shared between all contexts.
+    iEglContext = eglCreateContext(iEglDisplay, config,
+                                   render.EglSharedContext(), NULL);
+    if(iEglContext == EGL_NO_CONTEXT)
+        {
+        TInt eglerr = eglGetError();
+        switch (eglerr)
+            {
+            case EGL_BAD_ALLOC:
+                HUI_DEBUG(_L("CHuiVg10RenderSurface::RestoreL() - ERROR! Failed to create rendering context. Out of memory."));
+                User::Leave(KErrNoMemory);
+            default:
+                HUI_DEBUG2(_L("CHuiVg10RenderSurface::RestoreL() - ERROR! Failed to create rendering context. Cause: %S (EGL error code: %i)."),                            
+                            &CHuiVg10RenderSurface::EglErrorMessage(eglerr), eglerr);
+                User::Leave(KErrNotSupported);
+            }
+        }
+
+    // Share the created context for texture management.
+    if(render.EglSharedContext() == EGL_NO_CONTEXT)
+        {
+        // Now that there is a context, make sure the renderer knows of it.
+        render.EglSetSharedContext(iEglContext);
+        }
+    }
+
+const TDesC& CHuiVg10RenderSurface::EglErrorMessage(TInt aErrorCode)
+    {
+    // EGL Error messages.
+    _LIT(KEglErrorSUCCESS, "The last function succeeded without error.");
+    _LIT(KEglErrorNOT_INITIALIZED, "EGL is not initialized, or could not be initialized, for the specified EGL display connection.");
+    _LIT(KEglErrorBAD_ACCESS, "EGL cannot access a requested resource (for example a context is bound in another thread).");
+    _LIT(KEglErrorBAD_ALLOC, "EGL failed to allocate resources for the requested operation.");
+    _LIT(KEglErrorBAD_ATTRIBUTE, "An unrecognized attribute or attribute value was passed in the attribute list.");
+    _LIT(KEglErrorBAD_CONTEXT, "An EGLContext argument does not name a valid EGL rendering context.");
+    _LIT(KEglErrorBAD_CONFIG, "An EGLConfig argument does not name a valid EGL frame buffer configuration.");
+    _LIT(KEglErrorBAD_CURRENT_SURFACE, "The current surface of the calling thread is a window, pixel buffer or pixmap that is no longer valid.");
+    _LIT(KEglErrorBAD_DISPLAY, "An EGLDisplay argument does not name a valid EGL display connection.");
+    _LIT(KEglErrorBAD_SURFACE, "An EGLSurface argument does not name a valid surface (window, pixel buffer or pixmap) configured for GL rendering.");
+    _LIT(KEglErrorBAD_MATCH, "Arguments are inconsistent (for example, a valid context requires buffers not supplied by a valid surface).");
+    _LIT(KEglErrorBAD_PARAMETER, "One or more argument values are invalid.");
+    _LIT(KEglErrorBAD_NATIVE_PIXMAP, "A NativePixmapType argument does not refer to a valid native pixmap.");
+    _LIT(KEglErrorBAD_NATIVE_WINDOW, "A NativeWindowType argument does not refer to a valid native window.");
+    _LIT(KEglErrorUNKNOWN, "Unknown EGL Error.");
+
+    // Define literals for the errors
+    switch(aErrorCode)
+        {
+        case EGL_SUCCESS: return KEglErrorSUCCESS;
+        case EGL_NOT_INITIALIZED: return KEglErrorNOT_INITIALIZED;
+        case EGL_BAD_ACCESS: return KEglErrorBAD_ACCESS;
+        case EGL_BAD_ALLOC: return KEglErrorBAD_ALLOC;
+        case EGL_BAD_ATTRIBUTE: return KEglErrorBAD_ATTRIBUTE;
+        case EGL_BAD_CONTEXT: return KEglErrorBAD_CONTEXT;
+        case EGL_BAD_CONFIG: return KEglErrorBAD_CONFIG;
+        case EGL_BAD_CURRENT_SURFACE: return KEglErrorBAD_CURRENT_SURFACE;
+        case EGL_BAD_DISPLAY: return KEglErrorBAD_DISPLAY;
+        case EGL_BAD_SURFACE: return KEglErrorBAD_SURFACE;
+        case EGL_BAD_MATCH: return KEglErrorBAD_MATCH;
+        case EGL_BAD_PARAMETER: return KEglErrorBAD_PARAMETER;
+        case EGL_BAD_NATIVE_PIXMAP: return KEglErrorBAD_NATIVE_PIXMAP;
+        case EGL_BAD_NATIVE_WINDOW: return KEglErrorBAD_NATIVE_WINDOW;
+        default: return KEglErrorUNKNOWN;
+        }
+    }
+
+void CHuiVg10RenderSurface::HandleDisplayUsageChangeL()
+    {
+    // Nothing to do
+    }
+    
+void CHuiVg10RenderSurface::SetDirtyRect(const TRect& /*aRect*/)
+    {
+    // Nothing to do
+    }
+    
+MHuiTargetBitmap* CHuiVg10RenderSurface::BackBuffer()
+    {
+    // Nothing to do
+    return NULL;
+    }
+
+CFbsBitGc* CHuiVg10RenderSurface::Gc()
+    {
+    // Nothing to do
+    return NULL;
+    }
+    
+void CHuiVg10RenderSurface::RenderSurfaceExtension(const TUid& /*aExtensionUid*/, TAny** aExtensionParams)
+    {
+    *aExtensionParams = NULL;
+    }
+
+HUI_SESSION_OBJECT_IMPL(CHuiVg10RenderSurface, ETypeRenderSurface)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10Texture.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1656 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation for CHuiVg10Texture, OpenVG 1.0 Texture.
+*
+*/
+
+
+
+#include <e32def.h>
+#include <e32math.h>
+
+#include "HuiVg10RenderPlugin.h"
+#include "HuiVg10Texture.h"
+#include "HuiVg10TextureManager.h"
+#include "uiacceltk/HuiTextureHandle.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiTextureManager.h"
+#include "uiacceltk/HuiTextureProcessor.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiPanic.h"
+
+// temporary hack until the openvg headers are fixed..
+#ifndef OPENVG_VERSION_1_0_1
+    #warning using temporary hack to define OPENVG_VERSION_1_0_1, see TSW: SKYA-7QQB8
+    #define OPENVG_VERSION_1_0_1
+#endif
+
+#ifdef __NVG
+    #include <EGL/egl.h>
+    #include <nvg.h>
+    #include <AknIconUtils.h>
+    #include "HuiRenderSurface.h"
+    #include "NVGIcon.h"
+#endif
+
+
+/**
+ *  Bitmap color mode conversion.
+ *
+ *  @param aBitmap      Source bitmap to convert.
+ *  @param aDisplayMode Target display mode.
+ *  @param aCopyMode    Desired copy behavior.
+ *  @returns a new bitmap with the desired display mode.
+ */
+static CFbsBitmap& ConvertBitmapL(const CFbsBitmap& aBitmap, TDisplayMode aDisplayMode, TBitmapCopyMode aCopyMode = EAllowDuplication, TSize aNewSize = TSize(0,0))
+    {
+    // Functionality moved to Texture Manager 
+    // (to avoid recreating the bitmaps & bmpDevices every time)
+    CHuiTextureManager& tmpMgr = CHuiStatic::Env().TextureManager();
+    CHuiVg10TextureManager& textureMgr = static_cast<CHuiVg10TextureManager&>(tmpMgr);
+    
+    return textureMgr.ConvertBitmapL(aBitmap, aDisplayMode, aCopyMode, aNewSize);
+    }
+
+/**
+ *  Replace the alpha channel of an EColor16MA bitmap (in-place).
+ * 
+ *  @param aBitmap      Destination bitmap.
+ *  @param aMaskBitmap  Alpha channel source bitmap.
+ */
+static void ReplaceAlphaChannelL(CFbsBitmap& aBitmap, const CFbsBitmap& aMaskBitmap)
+    {
+    ASSERT(aBitmap.DisplayMode() == EColor16MA);
+    ASSERT(aBitmap.SizeInPixels() == aMaskBitmap.SizeInPixels());
+    
+    CFbsBitmap& convMask = ConvertBitmapL(aMaskBitmap, EGray256);
+    
+    aBitmap.BeginDataAccess();
+    convMask.BeginDataAccess();
+    TSize size           = aBitmap.SizeInPixels();
+    TUint32* dest32      = (TUint32*)aBitmap.DataAddress();
+    const TUint8* src8   = (const TUint8*)convMask.DataAddress();
+    TInt destStride      = CFbsBitmap::ScanLineLength(size.iWidth, aBitmap.DisplayMode()) >> 2;
+    TInt srcStride       = CFbsBitmap::ScanLineLength(size.iWidth, convMask.DisplayMode());
+    
+    for (TInt y = 0; y < size.iHeight; y++)
+        {
+        TUint32* d      = dest32;
+        const TUint8* s = src8;
+
+        for (TInt x = 0; x < size.iWidth; x++)
+            {
+            *d   &= ~0xff000000;
+            *d++ |= (*s++) << 24;
+            }
+        
+        dest32 += destStride;
+        src8   += srcStride;
+        }
+
+    aBitmap.EndDataAccess();
+    convMask.EndDataAccess(ETrue);
+    }
+
+#if !defined(OPENVG_VERSION_1_0_1)
+/**
+ *  Convert a native Symbian EColor16MU/A bitmap to an OpenVG 1.0 equivalent (in-place).
+ * 
+ *  @param aBitmap      Bitmap to convert.
+ */
+static void ConvertPixelComponentOrdering(CFbsBitmap& aBitmap)
+    {
+    ASSERT(aBitmap.DisplayMode() == EColor16MA || aBitmap.DisplayMode() == EColor16MU);
+    
+    aBitmap.BeginDataAccess();
+    TSize size           = aBitmap.SizeInPixels();
+    TUint32* dest32      = (TUint32*)aBitmap.DataAddress();
+    TInt destStride      = CFbsBitmap::ScanLineLength(size.iWidth, aBitmap.DisplayMode()) >> 2;
+    
+    for (TInt y = 0; y < size.iHeight; y++)
+        {
+        TUint32* d = dest32;
+
+        for (TInt x = 0; x < size.iWidth; x++)
+            {
+            *d++ = (*d << 8) | ((*d & 0xff000000) >> 24);
+            }
+        
+        dest32 += destStride;
+        }
+    aBitmap.EndDataAccess();
+    }
+#endif
+
+/* Vg10Texture internal flags. */
+enum
+    {
+    /** Content has been uploaded. */
+    EFlagHasContent = 0x1,
+
+    /** The texture has an alpha channel. */
+    EFlagHasAlpha = 0x2
+    };
+
+
+CHuiVg10Texture* CHuiVg10Texture::NewL(CHuiVg10RenderPlugin& aRenderPlugin, const THuiTextureHandle* aExistingTexture)
+    {
+    CHuiVg10Texture* self = CHuiVg10Texture::NewLC(aRenderPlugin, aExistingTexture);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+CHuiVg10Texture* CHuiVg10Texture::NewLC(CHuiVg10RenderPlugin& aRenderPlugin, const THuiTextureHandle* aExistingTexture)
+    {
+    CHuiVg10Texture* self = new (ELeave) CHuiVg10Texture(aRenderPlugin);
+    CleanupStack::PushL(self);
+    self->ConstructL(aExistingTexture);
+    return self;
+    }
+
+
+CHuiVg10Texture::CHuiVg10Texture(CHuiVg10RenderPlugin& aRenderPlugin)
+    : iRenderPlugin(aRenderPlugin),
+      iInternalFlags(0),
+      iShadowEnabled(EFalse)
+    {
+    }
+
+
+void CHuiVg10Texture::ConstructL(const THuiTextureHandle* aExistingTexture)
+    {
+    CHuiTexture::BaseConstructL();
+    
+    SetSegmentCountL(1);
+    SetSegmentName(0, 0);
+    SetSegmentSize(0, TSize(0, 0));
+    SetSegmentTextureSize(0, TSize(0, 0));
+
+    if(aExistingTexture)
+        {
+        // Take over the existing texture (single named texture object).
+        ASSERT(aExistingTexture->SegmentCount() == 1);
+        ASSERT(SegmentCount() == 1);
+        SetSegmentName(0, aExistingTexture->Name());
+        SetSegmentSize(0, aExistingTexture->SegmentSize(0));
+        SetSegmentTextureSize(0, aExistingTexture->SegmentTextureSize(0));
+        SetSize(aExistingTexture->Size());
+        
+        // Copy attributes
+        const CHuiVg10Texture* vgTex = reinterpret_cast<const CHuiVg10Texture*>(aExistingTexture);
+        iInternalFlags = vgTex->iInternalFlags;
+        // Note: shared shadows not supported
+        }
+    }
+
+
+CHuiVg10Texture::~CHuiVg10Texture()
+    {
+    Reset();
+    }
+
+
+TBool CHuiVg10Texture::HasAlpha() const
+    {
+    return (iInternalFlags & EFlagHasAlpha) != 0;
+    }
+    
+    
+TBool CHuiVg10Texture::HasContent() const
+    {
+    if(!CHuiTexture::HasContent())
+        {
+        return EFalse;
+        }
+        
+    return (iInternalFlags & EFlagHasContent) != 0;
+    }    
+
+
+TSize CHuiVg10Texture::MaxTextureSize() const
+    {
+    if (iRenderPlugin.IsReleased())
+        {
+        HUI_DEBUG(_L("CHuiVg10Texture::MaxTextureSize() - Vg10 context not available, cannot get maximum texture size, returning (0,0)."));
+        return TSize(0,0);
+        }
+    
+    int maxWidth  = vgGeti(VG_MAX_IMAGE_WIDTH)-1;
+    int maxHeight = vgGeti(VG_MAX_IMAGE_HEIGHT)-1;
+    HUI_VG_INVARIANT();
+    ASSERT(maxWidth > 0 && maxHeight > 0);
+    
+    return TSize(maxWidth, maxHeight);
+    }
+
+void CHuiVg10Texture::UploadL(const CFbsBitmap& aBitmap,
+                              const CFbsBitmap* aMaskBitmap,
+                              THuiTextureUploadFlags aTextureFlags)
+    {
+    Reset(); // Must delete old content before calling SetupSegmentsL
+    
+    TBool invalidMaskSize = (aMaskBitmap && (aBitmap.SizeInPixels() != aMaskBitmap->SizeInPixels()));
+    
+    CFbsBitmap* maskBitmap = (CFbsBitmap*)aMaskBitmap;
+
+    if (invalidMaskSize)
+        {
+        maskBitmap = &ConvertBitmapL(*aMaskBitmap, aMaskBitmap->DisplayMode(), EAlwaysCopy, aBitmap.SizeInPixels());
+        }
+    
+    SetupSegmentsL(aBitmap.SizeInPixels(), aBitmap.SizeInPixels(), aTextureFlags);
+    SegmentUploadL(0, aBitmap, maskBitmap, aTextureFlags);
+    }
+
+void CHuiVg10Texture::UploadL(THuiTextureFormat aTextureFormat,
+                              const TSize& aTextureSize,
+                              const TUint8* aTextureBuffer,
+                              THuiTextureUploadFlags aTextureFlags,
+                              TUint aTextureBufferSize)
+    {
+    Reset(); // Must delete old content before calling SetupSegmentsL
+    SetupSegmentsL(aTextureSize, aTextureSize, aTextureFlags);
+    SegmentUploadL(0, aTextureFormat, aTextureSize, aTextureBuffer, aTextureBufferSize);
+    }
+    
+
+void CHuiVg10Texture::PartialUploadL(THuiTextureFormat aFormat,
+                                     const TPoint& aOrigin,
+                                     const TSize& aSize,
+                                     const TUint8* aBuffer)
+    {
+    ASSERT(SegmentCount() == 1);
+    SegmentPartialUpload(0, aFormat, aOrigin, aSize, aBuffer);
+    }
+
+
+void CHuiVg10Texture::SegmentUploadL(TInt aSegment,
+                                     const CFbsBitmap& aBitmap,
+                                     const CFbsBitmap* aMaskBitmap,
+                                     THuiTextureUploadFlags aFlags)
+    {
+    ASSERT(aSegment >= 0 && aSegment < SegmentCount());
+    ASSERT(aBitmap.SizeInPixels() == Size());
+    ASSERT(aMaskBitmap && aBitmap.SizeInPixels() == aMaskBitmap->SizeInPixels() || !aMaskBitmap);
+
+    PushEGLContext();
+    if(aSegment < 0 || aSegment >= SegmentCount())
+        {
+        User::Leave(KErrArgument);
+        }
+    
+    // Clear any previous image data
+    ResetSegment(aSegment);
+    
+#ifdef __NVG
+    // Check if the bitmap is extended and has NVG data
+    TUid bitmaptype = aBitmap.ExtendedBitmapType();
+    TUid masktype = KNullUid;
+    if (aMaskBitmap)
+        {
+        masktype = aMaskBitmap->ExtendedBitmapType();
+        // extended bitmap and mask
+        if (bitmaptype == masktype && bitmaptype != KNullUid)
+            {
+            SegmentUploadNvgL(aBitmap, aMaskBitmap, aFlags);
+            // We now have working texture data, no need to do anything else
+            PopEGLContext();
+            return;
+            }
+        }
+    else if (bitmaptype != KNullUid)
+        {
+        SegmentUploadNvgL(aBitmap, aMaskBitmap, aFlags);
+        // We now have working texture data, no need to do anything else
+        PopEGLContext();
+        return;
+        }
+#endif
+    
+    VGImageFormat imageSourceFormat = (VGImageFormat)(-1);
+    VGImageFormat imageInternalFormat = VG_sXRGB_8888; // TODO: get the most optimal image format from the renderer
+    VGbitfield qualityFlags = VG_IMAGE_QUALITY_BETTER | VG_IMAGE_QUALITY_FASTER | VG_IMAGE_QUALITY_NONANTIALIASED;
+    TBool hasAlpha = (aMaskBitmap != NULL);
+    TBool conversionRequired = ETrue;
+    TSize size = Size();
+    TSize textureSize = MaxTextureSize();
+    textureSize.iWidth = Min(size.iWidth, textureSize.iWidth);
+    textureSize.iHeight = Min(size.iHeight, textureSize.iHeight);
+
+    // See if there is a native color mode we could use without conversion
+    switch (aBitmap.DisplayMode())
+        {
+        case EGray256:
+            imageSourceFormat = VG_A_8;
+            conversionRequired = EFalse;
+            break;
+        case EColor64K:
+            imageSourceFormat = VG_sRGB_565;
+            conversionRequired = EFalse;
+            break;
+        case EColor4K:
+            imageSourceFormat = VG_sRGB_565;
+            conversionRequired = ETrue;
+            break;    
+#if defined(OPENVG_VERSION_1_0_1)
+        case EColor16MU:
+            imageSourceFormat = VG_sXRGB_8888;
+            conversionRequired = EFalse;
+            break;
+		case EColor16M:
+            imageSourceFormat = VG_sXRGB_8888;
+            conversionRequired = ETrue;
+            break;
+        case EColor16MA:
+            imageSourceFormat = VG_sARGB_8888;
+            hasAlpha = ETrue;
+            conversionRequired = EFalse;
+            break;
+        case EColor16MAP:
+            imageSourceFormat = VG_sARGB_8888_PRE;
+            hasAlpha = ETrue;
+            conversionRequired = EFalse;
+            break;
+#else // defined(OPENVG_VERSION_1_0_1)
+        case EColor16MU:
+		case EColor16M:
+            imageSourceFormat = VG_sRGBX_8888;
+            break;
+        case EColor16MA:
+            imageSourceFormat = VG_sRGBA_8888;
+            hasAlpha = ETrue;
+            break;
+        case EColor16MAP:
+            imageSourceFormat = VG_sRGBA_8888_PRE;
+            hasAlpha = ETrue;
+            break;
+#endif // defined(OPENVG_VERSION_1_0_1)
+        default:
+#ifdef _DEBUG
+            RDebug::Printf("CHuiVg10Texture::SegmentUploadL - unknown display mode %d", aBitmap.DisplayMode());
+#endif
+            conversionRequired = ETrue;
+            imageSourceFormat = VG_sXRGB_8888;
+        }
+    
+    if (aBitmap.IsCompressedInRAM() || aMaskBitmap)
+        {
+        conversionRequired = ETrue;
+        }
+
+    if (hasAlpha)
+        {
+        imageInternalFormat = VG_sRGBA_8888_PRE;
+        }
+    else
+        {
+        imageInternalFormat = imageSourceFormat;
+        }
+
+    // Create the actual image
+    VGImage image = vgCreateImage(imageInternalFormat, textureSize.iWidth, textureSize.iHeight, qualityFlags);
+
+    if (image == VG_INVALID_HANDLE)
+        {
+        User::Leave(KErrNoMemory);
+        }
+    
+    if (!conversionRequired)
+        {
+        // No data conversion is required and we can upload the pixels as such
+        aBitmap.BeginDataAccess();
+        const void* data = aBitmap.DataAddress();
+        TInt stride      = CFbsBitmap::ScanLineLength(size.iWidth, aBitmap.DisplayMode());
+        vgImageSubData(image, data, stride, imageSourceFormat, 0, 0, textureSize.iWidth, textureSize.iHeight);
+        aBitmap.EndDataAccess( ETrue );
+        }
+    else
+        {
+        // One or more conversion steps are needed
+        if (hasAlpha)
+            {
+            // Alpha channel needs to be accounted for
+#if defined(OPENVG_VERSION_1_0_1)
+            imageSourceFormat = VG_sARGB_8888;
+            CFbsBitmap& convBitmap = ConvertBitmapL(aBitmap, EColor16MA);
+#else // defined(OPENVG_VERSION_1_0_1)
+            imageSourceFormat = VG_sRGBA_8888;
+            CFbsBitmap& convBitmap = ConvertBitmapL(aBitmap, EColor16MA);
+#endif // defined(OPENVG_VERSION_1_0_1)
+            
+            // Bake the alpha channel into the converted bitmap
+            if (aMaskBitmap)
+                {
+                if (aMaskBitmap->IsCompressedInRAM() || masktype != KNullUid)
+                    {
+                    CFbsBitmap& noncompressedMask = ConvertBitmapL(*aMaskBitmap, EGray256, EAlwaysCopy);
+                    ReplaceAlphaChannelL(convBitmap, noncompressedMask);                                                
+                    }
+                 else
+                    {
+                    ReplaceAlphaChannelL(convBitmap, *aMaskBitmap);
+                    }
+                }
+            #if !defined(OPENVG_VERSION_1_0_1)
+                    // Match the native OpenVG 1.0 pixel component ordering
+                    ASSERT(convBitmap.Handle() != aBitmap.Handle());
+                    ConvertPixelComponentOrdering(convBitmap);
+            #endif 
+            convBitmap.BeginDataAccess();
+            const void* data = convBitmap.DataAddress();
+            TInt stride      = CFbsBitmap::ScanLineLength(size.iWidth, convBitmap.DisplayMode());
+            vgImageSubData(image, data, stride, imageSourceFormat, 0, 0, textureSize.iWidth, textureSize.iHeight);
+            convBitmap.EndDataAccess( ETrue );
+            }
+        else
+            {
+            // No alpha channel -- just opaque pixel data
+#if defined(OPENVG_VERSION_1_0_1)
+            TDisplayMode mode = EColor16MU;
+            if (imageSourceFormat == VG_sRGB_565)
+                {
+                mode = EColor64K;
+                }
+            else if (imageSourceFormat == VG_A_8)
+                {
+                mode = EGray256;
+                }
+            else
+                {
+                imageSourceFormat = VG_sXRGB_8888;
+                }
+            CFbsBitmap& convBitmap = ConvertBitmapL(aBitmap, mode);
+#else // defined(OPENVG_VERSION_1_0_1)
+            imageSourceFormat = VG_sRGBX_8888;
+            CFbsBitmap& convBitmap = ConvertBitmapL(aBitmap, EColor16MU);
+            
+            // Match the native OpenVG 1.0 pixel component ordering
+            ASSERT(convBitmap.Handle() != aBitmap.Handle());
+            ConvertPixelComponentOrdering(convBitmap);
+#endif // defined(OPENVG_VERSION_1_0_1)
+            
+            convBitmap.BeginDataAccess();
+            const void* data = convBitmap.DataAddress();
+            TInt stride      = CFbsBitmap::ScanLineLength(size.iWidth, convBitmap.DisplayMode());
+            vgImageSubData(image, data, stride, imageSourceFormat, 0, 0, textureSize.iWidth, textureSize.iHeight);
+            convBitmap.EndDataAccess( ETrue );
+            }
+        }
+    
+    // Save the image handle
+    SetSegmentName(0, (TUint)image);
+    
+    // The texture now has content.
+    iInternalFlags |= EFlagHasContent;
+
+    if (hasAlpha)
+        {
+        iInternalFlags |= EFlagHasAlpha;
+        }
+    
+    // Keep the shadow in sync with the image contents
+    if (IsShadowEnabled())
+        {
+        // if this fails there is nothing we can do
+        // There will be no shadow if something goes wrong here
+        TRAP_IGNORE( GenerateShadowL() );
+        }
+    PopEGLContext();
+    // Wake up refresh. It is likely that the new texture will be visible on
+    // the screen.
+    CHuiStatic::ContinueRefresh();
+    }
+
+static void ConvertBufferRgb888TosRGBX8888(const TUint8* aSrc, TUint8* aDest, TInt aCount)
+{
+    while (aCount--)
+        {
+        *aDest++ = *aSrc++;
+        *aDest++ = *aSrc++;
+        *aDest++ = *aSrc++;
+        *aDest++ = 0xff;
+        }
+}
+
+static void ConvertBufferLa88TosRGBA8888(const TUint8* aSrc, TUint8* aDest, TInt aCount)
+{
+    while (aCount--)
+        {
+        TUint8 l = *aSrc++;
+        TUint8 a = *aSrc++;
+        *aDest++ = l;
+        *aDest++ = l;
+        *aDest++ = l;
+        *aDest++ = a;
+        }
+}
+
+#if !defined(OPENVG_VERSION_1_0_1)
+static void ConvertBufferRgba8888TosRGBA8888(const TUint8* aSrc, TUint8* aDest, TInt aCount)
+{
+    while (aCount--)
+        {
+        TUint8 r = *aSrc++;
+        TUint8 g = *aSrc++;
+        TUint8 b = *aSrc++;
+        TUint8 a = *aSrc++;
+        *aDest++ = a;
+        *aDest++ = r;
+        *aDest++ = g;
+        *aDest++ = b;
+        }
+}
+#endif
+
+void CHuiVg10Texture::SegmentClearL(TInt aSegment,
+                                    TBool aWithAlpha,
+                                    const TRgb& aColor,
+                                    TUint8 aAlpha)
+    {
+    ASSERT(aSegment >= 0 && aSegment < SegmentCount());
+
+    if(aSegment < 0 || aSegment >= SegmentCount())
+        {
+        User::Leave(KErrArgument);
+        }
+
+    // Clear any previous image data
+    TSize size = Size();
+    ResetSegment(aSegment);
+
+    // Create the actual image
+    VGImageFormat imageInternalFormat = aWithAlpha ? VG_sRGBA_8888 : VG_sRGBX_8888;
+    VGbitfield qualityFlags = VG_IMAGE_QUALITY_BETTER | VG_IMAGE_QUALITY_FASTER | VG_IMAGE_QUALITY_NONANTIALIASED;
+    VGImage image = vgCreateImage(imageInternalFormat, size.iWidth, size.iHeight, qualityFlags);
+    
+    if (image == VG_INVALID_HANDLE)
+        {
+        User::Leave(KErrNoMemory);
+        }
+
+    // Set the clear color
+    VGfloat scale = 1.0f / 255.0f;
+    VGfloat color[] = {
+        aColor.Red()   * scale,
+        aColor.Green() * scale,
+        aColor.Blue()  * scale,
+        aWithAlpha ? (aAlpha * scale) : 1.0f
+    };
+    
+    vgSetfv(VG_CLEAR_COLOR, 4, color);
+    vgClearImage(image, 0, 0, size.iWidth, size.iHeight);
+
+    // The texture now has content.
+    iInternalFlags |= EFlagHasContent;
+
+    if (aWithAlpha)
+        {
+        iInternalFlags |= EFlagHasAlpha;
+        }
+
+    // Keep the shadow in sync with the image contents
+    if (IsShadowEnabled())
+        {
+        GenerateShadowL();
+        }
+    
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Texture::SegmentUploadL(TInt aSegment,
+                                     THuiTextureFormat aFormat,
+                                     const TSize& aSize,
+                                     const TUint8* aBuffer,
+                                     TUint /*aBufferSize*/)
+    {
+    ASSERT(aSegment >= 0 && aSegment < SegmentCount());
+    ASSERT(aSize == Size());
+    
+    SegmentPartialUploadInternal(aSegment, aFormat, TPoint(0, 0), aSize, aBuffer, ETrue);
+    }
+
+void CHuiVg10Texture::SegmentPartialUpload(
+        TInt aSegment,
+        THuiTextureFormat aFormat,
+        const TPoint& aOrigin,
+        const TSize& aSize,
+        const TUint8* aBuffer)
+    {
+    SegmentPartialUploadInternal(aSegment, aFormat, aOrigin, aSize, aBuffer, EFalse);
+    }
+
+void CHuiVg10Texture::SegmentPartialUploadInternal(
+        TInt aSegment,
+        THuiTextureFormat aFormat,
+        const TPoint& aOrigin,
+        const TSize& aSize,
+        const TUint8* aBuffer,
+        TBool aCreateImage)
+    {
+    ASSERT(aSegment >= 0 && aSegment < SegmentCount());
+
+    if (aSegment < 0 || aSegment >= SegmentCount())
+        {
+        // we return without doing anything because we are called by a non-leaving function
+        return;
+        }
+
+    if (aOrigin.iX < 0 || aOrigin.iY < 0)
+        {
+        // we return without doing anything because we are called by a non-leaving function
+        return;
+        }
+    
+    HUI_DEBUG4(_L("CHuiVg10Texture::SegmentPartialUploadInternal() - Uploading partial image (%ix%i pixels, offset x: %i y: %i)."),
+               aSize.iWidth, aSize.iHeight, aOrigin.iX, aOrigin.iY);
+    
+    VGImageFormat imageSourceFormat = (VGImageFormat)(-1);
+    VGImageFormat imageInternalFormat = VG_sRGBX_8888; // TODO: get the most optimal image format from the renderer
+    VGbitfield qualityFlags = VG_IMAGE_QUALITY_FASTER | VG_IMAGE_QUALITY_BETTER; // TODO: get this from hitchcock
+    TBool hasAlpha = EFalse;
+    TBool conversionRequired = ETrue;
+    TInt sourceStride = 0;
+    
+    switch (aFormat)
+        {
+        case EHuiTextureFormatRgb565:
+            imageSourceFormat = VG_sRGB_565;
+            conversionRequired = EFalse;
+            sourceStride = aSize.iWidth * 2;
+            break;
+        case EHuiTextureFormatRgb888:
+            imageSourceFormat = VG_sRGBX_8888;
+            sourceStride = aSize.iWidth * 4;
+            break;
+        case EHuiTextureFormatLa88:
+            // We have to expand this format to RGBA, since there is no luminance-alpha format in OpenVG 1.0.1
+            imageSourceFormat = VG_sRGBA_8888;
+            sourceStride = aSize.iWidth * 4;
+            hasAlpha = ETrue;
+            break;
+#if defined(OPENVG_VERSION_1_0_1)
+        case EHuiTextureFormatRgba8888:
+            imageSourceFormat = VG_sARGB_8888;
+            conversionRequired = EFalse;
+            hasAlpha = ETrue;
+            sourceStride = aSize.iWidth * 4;
+            break;
+#else // defined(OPENVG_VERSION_1_0_1)
+        case EHuiTextureFormatRgba8888:
+            imageSourceFormat = VG_sRGBA_8888;
+            sourceStride = aSize.iWidth * 4;
+            hasAlpha = ETrue;
+            break;
+#endif // defined(OPENVG_VERSION_1_0_1)
+        
+        // Compressed formats are not supported
+        default:
+            // we return without doing anything because we are called by a non-leaving function
+            return;
+        }
+    
+    // Use a matching internal format
+    imageInternalFormat = imageSourceFormat;
+
+    // Create the actual image if required
+    VGImage image = VG_INVALID_HANDLE;
+    
+    if (aCreateImage)
+        {
+        image = vgCreateImage(imageInternalFormat, aSize.iWidth, aSize.iHeight, qualityFlags);
+        }
+    else
+        {
+        image = (VGImage)SegmentName(0);
+        
+        // Verify the dimensions
+        if (aOrigin.iX + aSize.iWidth  >= Size().iWidth || 
+            aOrigin.iY + aSize.iHeight >= Size().iHeight)
+            {
+            // we return without doing anything because we are called by a non-leaving function
+            return;
+            }
+        }
+
+    if (image == VG_INVALID_HANDLE)
+        {
+        // we return without doing anything because we are called by a non-leaving function
+        return;
+        }
+    
+    if (!conversionRequired)
+        {
+        // No data conversion is required and we can upload the pixels as such
+        vgImageSubData(image, aBuffer, sourceStride, imageSourceFormat, aOrigin.iX, aOrigin.iY, aSize.iWidth, aSize.iHeight);
+        HUI_VG_INVARIANT();
+        }
+    else
+        {
+        // One or more conversion steps are needed
+        TInt pixels = aSize.iWidth * aSize.iHeight;
+        TUint8* convBuffer = NULL;
+        convBuffer = new TUint8[sourceStride * aSize.iHeight];
+        // there are no leaving functions until our buffer is deleted
+        // We cannot put convBuffer onto cleanup stack because we cannot leave.
+        
+        if ( !convBuffer )
+            {
+            // we return without doing anything because we are called by a non-leaving function
+            return;
+            }
+        
+        switch (aFormat)
+            {
+            case EHuiTextureFormatRgb888:
+                ConvertBufferRgb888TosRGBX8888(aBuffer, convBuffer, pixels);
+                break;
+            case EHuiTextureFormatLa88:
+                ConvertBufferLa88TosRGBA8888(aBuffer, convBuffer, pixels);
+                break;
+#if !defined(OPENVG_VERSION_1_0_1)
+            case EHuiTextureFormatRgba8888:
+                ConvertBufferRgba8888TosRGBA8888(aBuffer, convBuffer, pixels);
+                break;
+#endif // defined(OPENVG_VERSION_1_0_1)
+            default:
+                ASSERT(0);
+            }
+        
+        vgImageSubData(image, convBuffer, sourceStride, imageSourceFormat, aOrigin.iX, aOrigin.iY, aSize.iWidth, aSize.iHeight);
+        delete[] convBuffer;
+        HUI_VG_INVARIANT();
+        }
+
+    // Save the image handle
+    SetSegmentName(0, (TUint)image);
+    
+    // The texture now has content.
+    iInternalFlags |= EFlagHasContent;
+
+    if (hasAlpha)
+        {
+        iInternalFlags |= EFlagHasAlpha;
+        }
+    
+    // Keep the shadow in sync with the image contents
+    if (IsShadowEnabled())
+        {
+        // We cannot leave, we just try our best.
+        // If this fails, we have no shadow
+        TRAP_IGNORE( GenerateShadowL() );
+        }
+    
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Texture::Reset()
+    {
+    CHuiTexture::Reset();
+    
+    if (iShadow.Name())
+        {
+        vgDestroyImage((VGImage)iShadow.Name());
+        iShadow.SetName(0);
+        }
+    
+    iShadowEnabled = EFalse;
+    
+#ifdef __NVG
+    CHuiTexture::SetNvgContent(EFalse);
+    iIsExtended = EFalse;
+    
+    delete iNVGData;
+    iNVGData = NULL;
+    delete iIconCommands;
+    iIconCommands = NULL;
+#endif
+    }
+
+void CHuiVg10Texture::ResetSegment(TInt aSegment)
+    {
+    HUI_DEBUG1(_L("CHuiVg10Texture::ResetSegment() - Trying to delete image for segment %i."), aSegment);
+    HUI_VG_INVARIANT();
+    ASSERT(aSegment>=0 && aSegment < SegmentCount());
+
+    VGImage image = (VGImage)SegmentName(aSegment);
+    if (image != VG_INVALID_HANDLE)
+        {
+        vgDestroyImage(image);
+        }
+
+    SetSegmentName(aSegment, VG_INVALID_HANDLE);
+    SetSegmentTextureSize(aSegment, TSize(0, 0));
+    SetSegmentSize(aSegment, TSize(0, 0));
+    SetSegmentOffset(aSegment, TPoint(0, 0));
+
+    // There is no content anymore
+    iInternalFlags &= ~(EFlagHasContent | EFlagHasAlpha);
+    
+    HUI_VG_INVARIANT();
+    }
+
+
+void CHuiVg10Texture::InitSegmentL(TInt /*aSegment*/)
+    {
+    // Nothing to do
+    }
+
+
+void CHuiVg10Texture::SetupSegmentsL(const TSize& aLogicalSize,
+                                     const TSize& aTextureSize,
+                                     THuiTextureUploadFlags aFlags)
+    {
+    // Assert that the sizes are valid.
+    ASSERT(aTextureSize.iWidth > 0 && aTextureSize.iHeight > 0);
+    ASSERT(aLogicalSize.iWidth > 0 && aLogicalSize.iHeight > 0);
+
+    HUI_DEBUG4(_L("CHuiVg10Texture::SetupSegments() - Configuring a single %ix%i texture segment for %ix%i bitmap."),
+               aTextureSize.iWidth, aTextureSize.iHeight,
+               aTextureSize.iWidth, aTextureSize.iHeight);
+
+    // All textures use only a single segment with OpenVG.
+    SetSegmentCountL(1);
+    
+    SetSegment(0, aLogicalSize, TPoint(0, 0), aTextureSize);
+    SetSegmentName(0, (TUint)VG_INVALID_HANDLE);
+    
+    // The logical size always matches the texture size
+    SetSize(aLogicalSize);
+    
+    // Enable shadow generation if requested
+    if (aFlags & EHuiTextureUploadFlagGenerateShadow)
+        {
+        EnableShadow(ETrue);
+        }
+    }
+    
+void CHuiVg10Texture::TextureExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+	CHuiTexture::TextureExtension(aExtensionUid, aExtensionParameters);    	
+    }
+
+void CHuiVg10Texture::EnableShadow(TBool aEnable)
+    {
+    CHuiTexture::EnableShadow(aEnable);
+    iShadowEnabled = aEnable;
+
+    if (!aEnable && iShadow.Name())
+        {
+        vgDestroyImage((VGImage)iShadow.Name());
+        iShadow.SetName(0);
+        HUI_VG_INVARIANT();
+        }
+    
+    if (aEnable)
+        {
+        // We cannot leave, we just try our best.
+        // If this fails, we have no shadow
+        TRAP_IGNORE( GenerateShadowL() ); 
+        }
+
+    HUI_VG_INVARIANT();
+    }
+
+TBool CHuiVg10Texture::IsShadowEnabled() const
+    {
+    return iShadowEnabled;
+    }
+
+TBool CHuiVg10Texture::GetShadowTexture(THuiTextureHandle& aHandle) const
+    {
+    if (iShadowEnabled && iShadow.SegmentName(0))
+        {
+        aHandle = iShadow;
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+void CHuiVg10Texture::UpdateShadowSizeL(const TSize& aSize)
+    {
+    VGImage shadow = VG_INVALID_HANDLE;
+
+    if (iShadow.Name())
+        {
+        shadow = (VGImage)(iShadow.Name());
+        TInt w = vgGetParameteri(shadow, VG_IMAGE_WIDTH);
+        TInt h = vgGetParameteri(shadow, VG_IMAGE_HEIGHT);
+        
+        if (w != aSize.iWidth || h != aSize.iHeight)
+            {
+            // Destroy the old shadow image -- a new one will be created below
+            vgDestroyImage(shadow);
+            iShadow.SetName(0);
+            }
+        else
+            {
+            return;
+            }
+        }
+    
+    ASSERT(!iShadow.Name());
+    
+    shadow = vgCreateImage(VG_sRGBA_8888_PRE, aSize.iWidth, aSize.iHeight, 
+                           VG_IMAGE_QUALITY_FASTER | VG_IMAGE_QUALITY_NONANTIALIASED);
+
+    if (shadow == VG_INVALID_HANDLE)
+        {
+        return;
+        }
+    iShadow.SetName(shadow);
+    iShadow.SetSize(aSize);
+    
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Texture::GenerateShadowL()
+    {
+    if (iRenderPlugin.IsReleased())
+        {
+        HUI_DEBUG(_L("CHuiVg10Texture::GenerateShadowL - VG context not available, cannot generate texture object."));
+        return;
+        }
+    
+    if (!IsShadowEnabled() || !(iInternalFlags & EFlagHasContent))
+        {
+        return;
+        }
+
+    CHuiTextureProcessor& proc = CHuiStatic::Env().TextureManager().Processor();
+    TSize size = Size();
+
+    switch(ShadowStyle())
+        {
+        case EHuiTextureShadowStyleIcon:
+            {
+            // TODO: Allow for smaller shadow images as an optimization
+            TSize shadowSize(size.iWidth, size.iHeight);
+            UpdateShadowSizeL(shadowSize);
+            proc.BlurL(Handle(), iShadow, shadowSize, 4,
+                CHuiTextureProcessor::EBlurFlagWhite |
+                CHuiTextureProcessor::EBlurFlagAlpha |
+                CHuiTextureProcessor::EBlurFlagExpandEdges);
+            break;
+            }
+
+        case EHuiTextureShadowStyleRasterizedText:
+            {
+            TSize shadowSize(size.iWidth, size.iHeight);
+            UpdateShadowSizeL(shadowSize);
+            proc.BlurL(Handle(), iShadow, shadowSize, 4,
+                CHuiTextureProcessor::EBlurFlagWhite |
+                CHuiTextureProcessor::EBlurFlagAlpha |
+                CHuiTextureProcessor::EBlurFlagExpandEdges);
+            break;
+            }
+
+        default:
+            break;
+        }
+
+    HUI_VG_INVARIANT();
+    }
+
+#ifdef __NVG
+HBufC8* CHuiVg10Texture::ReadNVGDataL(const CFbsBitmap& aBitmap)
+    {
+    // Fetch the extended data
+    aBitmap.BeginDataAccess();
+    const TUint32* data = aBitmap.DataAddress();
+    TInt dataSize = aBitmap.DataSize();
+    TUint8* compressedData = new (ELeave) TUint8[dataSize];
+    CleanupStack::PushL(compressedData);
+    Mem::Copy(compressedData, data, dataSize);
+    aBitmap.EndDataAccess(ETrue);
+    
+    // Create a descriptor out of the extended bitmap data. The iNVGData
+    // will now contain the direct OpenVG commands
+    TPtr8 nvgDataPtr(compressedData, dataSize, dataSize);
+    HBufC8* dataBuf = nvgDataPtr.AllocL();
+    
+    CleanupStack::PopAndDestroy(compressedData);
+    return dataBuf;
+    }
+
+void CHuiVg10Texture::SegmentUploadNvgL(const CFbsBitmap& aBitmap, const CFbsBitmap* aMaskBitmap, THuiTextureUploadFlags aFlags)
+    {
+    HUI_VG_INVARIANT();
+    
+    VGImage image = VG_INVALID_HANDLE;
+    HBufC8* dataBuf = ReadNVGDataL(aBitmap);
+    CleanupStack::PushL(dataBuf);
+    HBufC8* maskDataBuf = NULL;
+    TAknIconHeader header = GetNvgIconHeader(dataBuf);
+    TAknIconHeader maskHeader(header);  // DUMMY Creation, since default constructor is missing!
+    
+    if (aMaskBitmap)
+        {
+        maskDataBuf = ReadNVGDataL(*aMaskBitmap);
+        CleanupStack::PushL(maskDataBuf);
+        maskHeader = GetNvgIconHeader(maskDataBuf);
+        }
+    
+    // The trick here is to check the texture upload flags, and determine
+    // whether we want to draw from NVG object cache directly or raster
+    // the NVG data to a PBuffer
+    if (aFlags & EHuiTextureUploadFlagUsePureNvg)
+        {
+        // Save the NVG data for future use
+        if (iNVGData)
+            {
+            delete iNVGData;
+            iNVGData = NULL;
+            }
+        iNVGData = dataBuf;
+        
+        // TODO: If the NVG ObjectCache is still up-to-date, we could possibly
+        // create the object cached NVG icon for faster drawing, and maybe
+        // discard the iNVGData completely (to save RAM?)
+        CreateObjCachedNVGIconL();  // NOTE: The OPENVG_OBJECT_CACHING has to be defined in NVG!
+        
+        // Mark the texture as an NVG texture
+        CHuiTexture::SetNvgContent(ETrue);
+        iIsExtended = ETrue;
+        }
+    else    // By default, use the "OPTION C" -way!
+        {
+        // Use the same way to create the rendered image as in OPTION_C (see below)
+        CNvgEngine& nvgEngine = iRenderPlugin.NvgEngine();
+        iIsExtended = ETrue;    // I'm an NVG texture yet..
+    
+        // Make sure we don't leak memory
+        if (iNVGData)
+            {
+            delete iNVGData;
+            iNVGData = NULL;
+            }
+        
+        // Create the real image from NVG databuf
+        iNVGData = dataBuf;
+        image = CreateRenderedImage(&nvgEngine, dataBuf, Size());
+        
+        // New functionality for checking the mask
+        if (header.GetBitmapId() != maskHeader.GetBitmapId() &&
+            CompareNvgData(dataBuf, maskDataBuf) != 0)
+            {
+            VGImage maskImg = VG_INVALID_HANDLE;
+            // The mask is from different bitmap => we have to create
+            // a separate mask image for masking the NVG icon
+            maskImg = CreateRenderedImage(&nvgEngine, maskDataBuf, Size());
+            ReplaceVGImageAlphaChannelL(image, maskImg, Size());
+            vgDestroyImage(maskImg);
+            }
+        
+        // Save the image handle
+        SetSegmentName(0, (TUint)image);
+        
+        // No need for object cached cmds, if any did exist
+        delete iIconCommands; // No effect, if iIconCommands aren't created
+        iIconCommands = NULL;
+        
+        // If the VGImage texture creation was successful, we are no longer "NVG 
+        // texture" in a sense. If not, we will use the NVG data directly for drawing
+        if (image != VG_INVALID_HANDLE)
+            {
+            CHuiTexture::SetNvgContent(EFalse);
+            iIsExtended = EFalse;
+            }
+        }
+    
+    if (aMaskBitmap)
+        {
+        CleanupStack::PopAndDestroy(maskDataBuf);
+        }
+    CleanupStack::Pop(dataBuf);
+    
+    // The texture now has content.
+    iInternalFlags |= EFlagHasContent;
+    iInternalFlags |= EFlagHasAlpha;
+    
+    HUI_VG_INVARIANT();
+    }
+
+TInt CHuiVg10Texture::CompareNvgData(HBufC8* aNVGData1, HBufC8* aNVGData2)
+    {
+    TInt lengthAfterHeader1 = aNVGData1->Length() - KIconHeaderLength;
+    TInt lengthAfterHeader2 = aNVGData2->Length() - KIconHeaderLength;
+    
+    TPtr8 firstNoHeader((TUint8 *)aNVGData1->Des().Ptr() + KIconHeaderLength, lengthAfterHeader1, lengthAfterHeader1);
+    TPtr8 secondNoHeader((TUint8 *)aNVGData2->Des().Ptr() + KIconHeaderLength, lengthAfterHeader2, lengthAfterHeader2);
+    
+    TInt returnValue = firstNoHeader.Compare(secondNoHeader);
+    return returnValue;
+    }
+
+VGImage CHuiVg10Texture::CreateRenderedImage(CNvgEngine* aNvgEngine, HBufC8* aNVGData, const TSize& aDestSize)
+    {
+    HUI_VG_INVARIANT();
+    
+    // Image placeholder
+    VGImage image = VG_INVALID_HANDLE;
+
+    if ( !iIsExtended )
+        {
+        // If called outside of the context, do nothing.
+        // Image will be VG_INVALID_HANDLE
+        HUI_DEBUG(_L("CHuiVg10Texture::CreateRenderedImage() - Texture not extended, can't create rendered image"));
+        return image;
+        }
+    
+    // Check if we already have an existing image.
+    if (SegmentCount() == 1)
+        {
+        image = (VGImage)SegmentName(0);
+        if( image != VG_INVALID_HANDLE )
+            {
+            HUI_DEBUG1(_L("CHuiVg10Texture::CreateRenderedImage() - Image already exists: %d"), image);
+            return image;
+            }
+        }
+    
+    // NVGEngine is needed to do the drawing of the extended bitmap to VGImage
+    if (!aNvgEngine || !aNVGData)
+        {
+        HUI_DEBUG(_L("CHuiVg10Texture::CreateRenderedImage() - No NvgEngine / NVGData!"));
+        return image;
+        }
+    
+    // Get the needed egl contexts & stuff for creating the proper eglSurface
+    EGLContext context = iRenderPlugin.EglSharedContext();
+    MHuiRenderSurface* oldSurface = CHuiStatic::CurrentRenderSurface();
+
+#ifndef __WINS__ // Should possibly query the supported mode instead?
+    VGImageFormat imageInternalFormat = VG_sARGB_8888_PRE;
+#else
+    VGImageFormat imageInternalFormat = VG_sARGB_8888;
+#endif
+    
+    VGbitfield qualityFlags = VG_IMAGE_QUALITY_NONANTIALIASED; // | VG_IMAGE_QUALITY_BETTER | VG_IMAGE_QUALITY_FASTER;
+    image = vgCreateImage(imageInternalFormat, aDestSize.iWidth, aDestSize.iHeight, qualityFlags);
+    
+    // Get the configs and displays etc. needed for creating the surface
+    EGLDisplay display = iRenderPlugin.EglDisplay();
+
+#if 1
+    // Returns the same config, as below!
+    // The config used with the current renderer surface has the same parameters
+    // that are needed with the PBufferSurface from vgImage
+    EGLConfig config = iRenderPlugin.EglConfig(0);
+#else
+    // This structure can be used, if surface config params have to be changed
+    // Better way though might be to change the vgImage VGImageFormat accordingly..
+    const TInt BITS_PER_CHANNEL = 8;
+    // Choose an EGL config
+    const EGLint attrs[] =
+        {
+        EGL_RENDERABLE_TYPE,    EGL_OPENVG_BIT,
+        EGL_SURFACE_TYPE,       EGL_PBUFFER_BIT | EGL_VG_ALPHA_FORMAT_PRE_BIT,
+        EGL_RED_SIZE,           BITS_PER_CHANNEL,
+        EGL_GREEN_SIZE,         BITS_PER_CHANNEL,
+        EGL_BLUE_SIZE,          BITS_PER_CHANNEL,
+        EGL_ALPHA_SIZE,         BITS_PER_CHANNEL,
+        EGL_NONE
+        };
+    TInt configCount = iRenderPlugin.EglChooseConfig(attrs);
+    ASSERT(configCount > 0);
+    EGLConfig config = iRenderPlugin.EglConfig(0);
+#endif
+    
+    // The VGImage will act as the surface, so the drawing will go directly to the VGImage
+    EGLSurface newSurface = eglCreatePbufferFromClientBuffer(
+        display, EGL_OPENVG_IMAGE,
+        static_cast<EGLClientBuffer>(image),    // Use the image as buffer
+        config, NULL);
+    
+    // Report error in debug mode, if failed creating the surface
+    if ( newSurface == EGL_NO_SURFACE )
+        {
+        HUI_DEBUG1(_L("CHuiVg10Texture::CreateRenderedImage() - EGL Surface could not be created, eglErr: %04x"), eglGetError() );
+        if ( image != VG_INVALID_HANDLE )
+            {
+            vgDestroyImage( image );
+            image = VG_INVALID_HANDLE;
+            }
+        
+        HUI_VG_INVARIANT();
+        return image;
+        }
+    
+    // Set the new VGImage related eglSurface as current, and start drawing onto it!  
+    // We use the old context, our surface should be compatible with it          
+    if ( eglMakeCurrent( display, newSurface, newSurface, context ) == EGL_FALSE )
+        {
+        // Report error in debug mode
+        HUI_DEBUG1(_L("CHuiVg10Texture::CreateRenderedImage() - EGL Surface could not be made current, eglErr: %04x"), eglGetError());
+        if ( image != VG_INVALID_HANDLE )
+            {
+            vgDestroyImage( image );
+            image = VG_INVALID_HANDLE;
+            }
+        
+        eglDestroySurface( display, newSurface );
+        HUI_VG_INVARIANT();
+        return image;
+        }
+    CHuiStatic::SetCurrentRenderSurface( NULL );
+    
+    
+    // VKN TODO: It would be better, if the GC could somehow spot that openVg
+    // state has changed, and would restore it's own state. Could use the same
+    // AddRestoreStateFlags as the paint is currently using..
+    //
+    // Get the current statematrix and store it for the duration of NVG drawing
+    TReal32 matrix[9];
+    vgGetMatrix(matrix);
+    vgLoadIdentity();
+    
+    // Render the NVGtexture into the image buffer. No transformations are done for this.
+    SetNvgParamsFromIconHeader(*aNvgEngine, aNVGData);
+    
+    if (iIconCommands)
+        {
+        //HUI_DEBUG(_L("CHuiVg10Texture::CreateRenderedImage() - Drawing iIconCommands"));
+        iIconCommands->Draw(aDestSize, aNvgEngine);
+        }
+    else
+        {
+        // If ObjectCached version failed, try to use the old way
+        //HUI_DEBUG(_L("CHuiVg10Texture::CreateRenderedImage() - Drawing with DrawNvg"));
+        VGint blendMode = vgGeti(VG_BLEND_MODE);
+        vgSeti(VG_BLEND_MODE, VG_BLEND_SRC_OVER);
+        aNvgEngine->DrawNvg(GetNvgDataWithoutHeader(aNVGData), aDestSize, NULL, NULL);
+        vgSeti(VG_BLEND_MODE, blendMode);
+        }
+    
+    // NVG-TLV icon margin special case check:
+    // Check, if the icon has to be margin corrected
+    TAknIconHeader iconheader = GetNvgIconHeader(aNVGData);
+    TSize size = aDestSize; // For using the correct size also later on
+    if (iconheader.IsMarginCorrection())
+        {
+        size = ApplyMargin(image, aDestSize, display, newSurface, context);
+        if( size != aDestSize)
+            {
+            // Redo the drawing, this time to the correct size
+            if (iIconCommands)
+                iIconCommands->Draw(size, aNvgEngine);
+            else
+                aNvgEngine->DrawNvg(GetNvgDataWithoutHeader(aNVGData), size, NULL, NULL);
+            }
+        }
+    
+    // The NVG draw messes up the paint, scissoring & rects, so mark them as dirty
+    TInt dirtyFlags = EHuiVg10GcStateFlagDirtyPaint |
+                    EHuiVg10GcStateFlagDirtyScissor | 
+                    EHuiVg10GcStateFlagDirtyScissorRects;
+    iRenderPlugin.AddRestoreStateFlags(dirtyFlags);
+    
+#ifdef _DEBUG
+    // TODO: There's something in the DrawNvg() code, which causes OpenVg to set
+    // error code => PANIC, if not for this temp check here. REMOVE ONCE THE TSW ERROR IS FIXED!
+    VGErrorCode err = vgGetError();
+    if (err)
+        {
+        RDebug::Print(_L("CHuiVG10Texture::CreateRenderedImage - Error in NVG draw: %04x"), err);
+        }
+#endif
+    
+    HUI_VG_INVARIANT();
+    
+    vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
+    vgLoadMatrix(matrix);
+    oldSurface->MakeCurrent();  // This will also call the SetCurrentRenderSurface
+    
+    // Now we should have a rendered image in the image variable!
+    // Release the surface, but not the context because we used a shared context
+    if ( newSurface != EGL_NO_SURFACE )
+        {
+        eglDestroySurface( display, newSurface );
+        }
+    
+    // NVG-TLV color correction special case check: If the icon has 
+    // some color specified in the icon header, set the new icon color
+    TUint32 iconColor = iconheader.GetIconColor();
+    if (iconColor & 0x00FFFFFF)
+        {
+        SetIconColor(image, size, iconColor);
+        }
+    
+    HUI_VG_INVARIANT();
+    
+    return image;
+    }
+
+TBool CHuiVg10Texture::IsExtended() const
+    {
+    return iIsExtended;
+    }
+
+HBufC8* CHuiVg10Texture::GetExtendedTextureData() const
+    {
+    return iNVGData;
+    }
+
+MNVGIcon* CHuiVg10Texture::GetIconCommandsData() const
+    {
+    return iIconCommands;
+    }
+
+void CHuiVg10Texture::CreateObjCachedNVGIconL()
+    {
+    HUI_VG_INVARIANT();
+    // Just to be sure that we don't leak memory
+    if (iIconCommands)
+        {
+        HUI_DEBUG(_L("CHuiVg10Texture::CreateObjCachedNVGIconL() - deleting old iIconCommands. Should never come here"));
+        delete iIconCommands;
+        iIconCommands = NULL;
+        }
+
+    // Fetch the NvgDecoder engine for creating the obj cached icon
+    CNvgEngine& nvgEngine = iRenderPlugin.NvgEngine();
+    
+    //Set Parameters from Icon Header
+    SetNvgParamsFromIconHeader(nvgEngine, iNVGData);
+    
+    // Parse the header info out of the nvg data 
+    TPtr8 nvgDataVoidIC = GetNvgDataWithoutHeader(iNVGData);
+    
+	iIconCommands = nvgEngine.CreateNVGIcon(nvgDataVoidIC, Size());
+	
+	HUI_VG_INVARIANT();
+    }
+
+TAknIconHeader CHuiVg10Texture::GetNvgIconHeader(HBufC8* aNVGData)
+    {
+    // Parse the icon header info from the extended data
+    TPtr8 IconHeaderPtr((TUint8*)aNVGData->Des().Ptr(), KIconHeaderLength, KIconHeaderLength);
+    TAknIconHeader iconheader(IconHeaderPtr);
+    
+    return iconheader;
+    }
+
+TPtr8 CHuiVg10Texture::GetNvgDataWithoutHeader(HBufC8* aNVGData)
+    {
+    // The rest of the data (after the iconheader) are the OVG drawing instructions
+    TInt lengthAfterHeader = aNVGData->Length() - KIconHeaderLength;
+    TPtr8 nvgDataVoidIC((TUint8 *)aNVGData->Des().Ptr() + KIconHeaderLength, lengthAfterHeader, lengthAfterHeader);
+    
+    return nvgDataVoidIC;
+    }
+
+void CHuiVg10Texture::SetNvgParamsFromIconHeader(CNvgEngine& aNvgEngine, HBufC8* aNVGData)
+    {
+    TAknIconHeader iconheader = GetNvgIconHeader(aNVGData);
+    
+    // Set preserve aspect ratio according to the header info
+    TNvgAlignStatusType alignTypeValue = ENvgPreserveAspectRatio_XmidYmid;
+    TNvgMeetOrSliceType meetOrSliceTypeValue = ENvgMeet;
+    
+    switch ( iconheader.GetScaleMode() )
+        {
+        case EAspectRatioPreserved: // Fall through
+            {
+            // Use default
+            break;
+            }
+            
+        // Ensures NVG content fully covers
+        // the area of the icon whilst preserving aspect ratio.
+        case EAspectRatioPreservedSlice:
+            {
+            // alignTypeValue use default
+            meetOrSliceTypeValue = ENvgSlice;
+            break;
+            } 
+            
+        // EAspectRatioPreservedAndUnusedSpaceRemoved is mapped to the same
+        // values as EAspectRatioNotPreserved because we already have a 
+        // frame buffer with the dimensions that preserves the aspect ratio.
+        // This mapping ensures that NVG engine does not calculate aspect
+        // ratio twice and potentially resulting in precision loss.
+        case EAspectRatioPreservedAndUnusedSpaceRemoved:
+        case EAspectRatioNotPreserved:
+            {            
+            alignTypeValue = ENvgPreserveAspectRatio_None;
+            // meetOrSliceTypeValue used default
+            break;
+            }
+        }
+    aNvgEngine.SetPreserveAspectRatio(alignTypeValue, meetOrSliceTypeValue);
+    aNvgEngine.Rotate(iconheader.GetRotation(),Size().iWidth >>1, Size().iHeight >>1);
+    }
+
+TSize CHuiVg10Texture::ApplyMargin(VGImage aImage, TSize aSize, EGLDisplay aDisplay, EGLSurface aSurface, EGLContext aContext)
+    {
+    HUI_VG_INVARIANT();
+    // If the icon is also a current EGL surface, the getImageSubData
+    // won't succeed and return "image in use" -error..
+    if ( eglMakeCurrent( aDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT ) == EGL_FALSE )
+        {
+        HUI_DEBUG1(_L("CHuiVg10Texture::ApplyMargin() - EGL NO_Surface could not be made current, eglErr: %04x"), eglGetError());
+        return aSize;
+        }
+    
+#ifndef __WINS__ // Should possibly query the supported mode instead?
+    VGImageFormat imageInternalFormat = VG_sARGB_8888_PRE;
+#else
+    // This doesn't work in the Emulator anyways.. => remove?
+    VGImageFormat imageInternalFormat = VG_sARGB_8888;
+#endif
+    
+    TInt stride = aSize.iWidth * 4; // VG_sARGB_8888(_PRE) is four bytes long (8888)
+    HBufC8* buf = HBufC8::New(stride);
+    if (!buf)
+        {
+        HUI_DEBUG(_L("CHuiVg10Texture::ApplyMargin() - Ran out of memory!"));
+        return aSize;        
+        }
+    TUint32* ptr = (TUint32*)(buf->Des()).Ptr();
+    
+    const TInt lValidMargin = aSize.iHeight * 12 / 100;
+    
+    const TInt Ha = aSize.iHeight;
+    TInt hTa = 0;
+    TInt hNT = 0;
+    TInt C = 0;
+    TInt hNTN = Ha - 2.0 * 0.12 * Ha;
+    TReal R = 1.0;
+    TInt HaN = Ha;
+    
+    const TInt lastColumn = aSize.iHeight - 1;
+    for (TInt curRow = 0; curRow < lValidMargin; curRow++)
+        {
+        const TInt y = (aSize.iHeight - 1) - curRow; // h - 1 is the last line
+        // Get just one stride at a time (iWidth wide, 1 pixel high)
+        vgGetImageSubData(aImage, ptr, stride, imageInternalFormat, 0, y, aSize.iWidth, 1);
+        for (TInt s = lastColumn; s >= 0; --s)
+            {
+            if (ptr[s] & 0xFF000000)
+                {
+                hTa = curRow;
+                hNT = Ha - 2 * hTa;
+                C = 2 * hTa;
+                R = ( ( (TReal)hNTN / (TReal)hNT ) > 1.0 ) ? 1 : (TReal)hNTN / (TReal)hNT;
+                HaN = Ha * R - C * R + C;
+                curRow = lValidMargin; // to exit the outer loop
+                break; // to exit the inner
+                }
+            }
+        }
+    delete buf;
+    HUI_VG_INVARIANT();
+    
+    // Make the PBuffer surface current again 
+    if ( eglMakeCurrent(aDisplay, aSurface, aSurface, aContext) == EGL_FALSE )
+        {
+        HUI_DEBUG1(_L("CHuiVg10Texture::ApplyMargin() - EGL aSurface could not be made current, eglErr: %04x"), eglGetError());
+        return aSize;
+        }
+    
+    // If icon size has to be changed, clear out old area for new DrawNVG round!
+    if(aSize.iHeight > HaN)
+        {
+        vgLoadIdentity();
+        
+        VGfloat color[4] = { 1.0f, 1.0f, 1.0f, 0.0f };
+        vgSetfv(VG_CLEAR_COLOR, 4, color);
+        vgClear(0, 0, aSize.iWidth, aSize.iHeight);
+        // Or should it be clearImage instead?
+        //vgClearImage(aImage, 0, 0, aSize.iWidth, aSize.iHeight);
+        
+        VGfloat Hr = (VGfloat)HaN/(aSize.iHeight);        
+        TInt WaN = aSize.iWidth*Hr;
+        
+        VGfloat Tx = (aSize.iHeight-HaN)/2;
+        VGfloat Ty = (aSize.iWidth-WaN)/2;
+        vgTranslate(Tx,Ty);
+        
+        HUI_VG_INVARIANT();
+        return(TSize(HaN,WaN));
+        }
+    
+    HUI_VG_INVARIANT();
+    return aSize;
+    }
+
+void CHuiVg10Texture::SetIconColor(VGImage& aSrcImage, TSize aSize, TUint32 aColor)
+    {
+    // TODO: DOESN'T WORK IN EMULATOR FOR SOME REASON! Figure out why!
+    HUI_VG_INVARIANT();
+    
+    vgSeti(VG_FILTER_FORMAT_LINEAR, VG_FALSE);
+    
+#ifndef __WINS__ // Should possibly query the supported mode instead?
+    VGImageFormat imageInternalFormat = VG_sARGB_8888_PRE;
+    // TODO: !!! SHOULD FORMAT_PREMULTIPLIED BE APPLIED?? !!!
+    //vgSeti(VG_FILTER_FORMAT_PREMULTIPLIED, VG_TRUE);
+#else
+    // This doesn't work in the Emulator anyways.. => remove?
+    VGImageFormat imageInternalFormat = VG_sARGB_8888;
+#endif
+    
+    // Rip the RGB components from the aColor param & scale to [0..1]
+    VGfloat red      = (aColor&0xff)/255.0f;
+    VGfloat green    = ((aColor>>8)&0xff)/255.0f;
+    VGfloat blue     = ((aColor>>16)&0xff)/255.0f;
+    
+    //vgSeti(VG_FILTER_CHANNEL_MASK, VG_ALPHA );
+    // This matrix will set all color components in the source image to 0,
+    // and replaces the RGB with the values from the iconheader 
+    VGfloat matrix[20] = {
+            0,0,0,0,
+            0,0,0,0,
+            0,0,0,0,
+            0,0,0,1, // <- Preserves the original alpha value
+            red, green, blue, 0};
+    
+    // Create the destination image & start modifying colors
+    VGImage dstImg = vgCreateImage(imageInternalFormat, aSize.iWidth, aSize.iHeight, VG_IMAGE_QUALITY_NONANTIALIASED);
+    vgColorMatrix(dstImg, aSrcImage, matrix);
+    HUI_VG_INVARIANT();
+    
+    // Destroy the old source image and return the new image with changed colors
+    vgDestroyImage(aSrcImage);
+    aSrcImage = dstImg;
+    
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10Texture::ReplaceVGImageAlphaChannelL(VGImage aImage, VGImage aMaskImage, TSize aSize)
+    {
+    HUI_VG_INVARIANT();
+    
+#ifndef __WINS__ // Should possibly query the supported mode instead?
+    VGImageFormat imageInternalFormat = VG_sARGB_8888_PRE;
+#else
+    VGImageFormat imageInternalFormat = VG_sARGB_8888;
+#endif
+    TInt height = aSize.iHeight;
+    TInt width = aSize.iWidth;
+    const TInt colorDepth = 4;  // VG_sARGB_8888(_PRE) 4 bytes long
+    TInt stride = width * colorDepth;
+    
+    // Create the pointers to RAM in which the image data will be saved temporarily
+    HBufC8* imgBuf = HBufC8::NewL(width * height * colorDepth);
+    CleanupStack::PushL(imgBuf);
+    TUint32* imgPtr = (TUint32*)(imgBuf->Des()).Ptr();
+    const TUint32* imgSavePtr = (TUint32*)(imgBuf->Des()).Ptr(); 
+    
+    HBufC8* maskBuf = HBufC8::NewL(width * height * colorDepth);
+    CleanupStack::PushL(maskBuf);
+    TUint32* maskPtr = (TUint32*)(maskBuf->Des()).Ptr();
+    
+    // Get the image pixel data
+    vgGetImageSubData(aImage, imgPtr, stride, imageInternalFormat, 0, 0, width, height);
+    vgGetImageSubData(aMaskImage, maskPtr, stride, imageInternalFormat, 0, 0, width, height);
+    
+    // Replace destination image's alpha values with mask image
+    for (TInt y = 0; y < height; y++)
+        {
+        for (TInt x = 0; x < width; x++)
+            {
+            *maskPtr    &= 0xff000000;      // Remove other than alpha component from source pixel
+            *imgPtr     &= ~0xff000000;     // Remove alpha channel value from destination pixel
+            *imgPtr++   |= *maskPtr++;      // Bitwise OR the maskImg alpha info to destination image pixel 
+            }
+        }
+
+    // Replace the destination image with combined alpha information from src image
+    vgImageSubData(aImage, imgSavePtr, stride, imageInternalFormat, 0, 0, width, height);
+
+    CleanupStack::PopAndDestroy(maskBuf);
+    CleanupStack::PopAndDestroy(imgBuf);
+    
+    HUI_VG_INVARIANT();
+    }
+#endif
+
+
+void CHuiVg10Texture::PushEGLContext()
+    {
+    iPreviousEGLState.iContext= eglGetCurrentContext(); 
+    TEGLState& state = iRenderPlugin.GetUploadState();
+    if (state.iContext == KErrNotFound)
+        {
+		TEGLState& state = iRenderPlugin.GetUploadState();
+        // the first context used for uploading will be used for all texture uploads
+        state.iContext      = iPreviousEGLState.iContext; 
+        state.iDrawSurface  = eglGetCurrentSurface(EGL_DRAW);
+        state.iReadSurface  = eglGetCurrentSurface(EGL_READ);
+        state.iDisplay      = eglGetCurrentDisplay();
+        }
+    else
+        {
+        // change context only if necessary
+        if (iPreviousEGLState.iContext != state.iContext)
+            {
+            iPreviousEGLState.iDrawSurface  = eglGetCurrentSurface(EGL_DRAW);
+            iPreviousEGLState.iReadSurface  = eglGetCurrentSurface(EGL_READ);
+            iPreviousEGLState.iDisplay      = eglGetCurrentDisplay();
+            eglMakeCurrent(state.iDisplay, state.iDrawSurface, state.iReadSurface, state.iContext);
+            }
+        }
+    }
+
+void CHuiVg10Texture::PopEGLContext()
+    {
+    if (iPreviousEGLState.iContext != iRenderPlugin.GetUploadState().iContext)
+        {
+        eglMakeCurrent(iPreviousEGLState.iDisplay,  iPreviousEGLState.iDrawSurface, iPreviousEGLState.iReadSurface,iPreviousEGLState.iContext);
+        }
+    }
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10TextureManager.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,176 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "HuiVg10TextureManager.h"  // Class definition
+#include "HuiVg10TextureProcessor.h"
+
+
+CHuiVg10TextureManager* CHuiVg10TextureManager::NewL(CHuiEnv& aEnv)
+    {
+    CHuiVg10TextureManager* self = CHuiVg10TextureManager::NewLC(aEnv);
+    CleanupStack::Pop(self);
+    return self;
+    }
+    
+
+CHuiVg10TextureManager* CHuiVg10TextureManager::NewLC(CHuiEnv& aEnv)
+    {
+    CHuiVg10TextureManager* self = new (ELeave) CHuiVg10TextureManager(aEnv);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+
+CHuiVg10TextureManager::CHuiVg10TextureManager(CHuiEnv& aEnv)
+        : CHuiTextureManager(aEnv)
+    {
+    }
+
+
+void CHuiVg10TextureManager::ConstructL()
+    {
+    CHuiTextureManager::BaseConstructL();
+    
+    // Create a texture processor.
+    CHuiVg10TextureProcessor* proc = CHuiVg10TextureProcessor::NewL(Env());
+    SetProcessor(proc); // ownership to base class
+    
+    iBitmap16MA = new (ELeave) CFbsBitmap;
+    iBitmap16MA->Create(TSize(1,1), EColor16MA);
+    iBitmap16MU = new (ELeave) CFbsBitmap;
+    iBitmap16MU->Create(TSize(1,1), EColor16MU);
+    iBitmap64K = new (ELeave) CFbsBitmap;
+    iBitmap64K->Create(TSize(1,1), EColor64K);
+    iBitmap256Gray = new (ELeave) CFbsBitmap;
+    iBitmap256Gray->Create(TSize(1,1), EGray256);
+    
+    iBitmapDevice16MA = CFbsBitmapDevice::NewL(iBitmap16MA);
+    iBitmapDevice16MU = CFbsBitmapDevice::NewL(iBitmap16MU);
+    iBitmapDevice64K = CFbsBitmapDevice::NewL(iBitmap64K);
+    iBitmapDevice256Gray = CFbsBitmapDevice::NewL(iBitmap256Gray);
+    }
+
+
+CHuiVg10TextureManager::~CHuiVg10TextureManager()
+    {
+    delete iBitmap16MA;
+    delete iBitmap16MU;
+    delete iBitmap64K;
+    delete iBitmap256Gray;
+    delete iBitmapDevice16MA;
+    delete iBitmapDevice16MU;
+    delete iBitmapDevice64K;
+    delete iBitmapDevice256Gray;
+    delete iBitGc16MA;
+    delete iBitGc16MU;
+    delete iBitGc64K;
+    delete iBitGc256Gray;
+    }
+
+CFbsBitmap& CHuiVg10TextureManager::ConvertBitmapL(const CFbsBitmap& aBitmap, TDisplayMode aDisplayMode, TBitmapCopyMode aCopyMode, TSize aNewSize)
+    {
+    TSize newSize = aBitmap.SizeInPixels();
+    if (aNewSize != TSize(0,0))
+        {
+        newSize = aNewSize;
+        }
+    
+    // Select the correct Colormode bitmap & device
+    CFbsBitmap* bitmap = NULL;
+    CFbsBitmapDevice* bitmapDevice = NULL;
+    CFbsBitGc* bitGc = NULL;
+    // This is needed for storing the possibly recreated bitGc to a member variable
+    CFbsBitGc** bitGcMemberPtr = NULL;
+    switch(aDisplayMode)
+        {
+        case EColor16MA:
+            bitmap = iBitmap16MA;
+            bitmapDevice = iBitmapDevice16MA;
+            bitGc = iBitGc16MA;
+            bitGcMemberPtr = &iBitGc16MA;
+            break;
+        case EColor16MU:
+            bitmap = iBitmap16MU;
+            bitmapDevice = iBitmapDevice16MU;
+            bitGc = iBitGc16MU;
+            bitGcMemberPtr = &iBitGc16MU;
+            break;
+        case EColor64K:
+            bitmap = iBitmap64K;
+            bitmapDevice = iBitmapDevice64K;
+            bitGc = iBitGc64K;
+            bitGcMemberPtr = &iBitGc64K;
+            break;
+        case EGray256:
+            bitmap = iBitmap256Gray;
+            bitmapDevice = iBitmapDevice256Gray;
+            bitGc = iBitGc256Gray;
+            bitGcMemberPtr = &iBitGc256Gray;
+            break;
+        default:
+            // Not supported! Implement more cases if needed, otherwise this'll leave
+            User::Leave(KErrNotSupported);
+            break;
+        }
+    
+    // No conversion required?
+    if ( aCopyMode == EAllowDuplication && aBitmap.DisplayMode() == aDisplayMode && 
+         !aBitmap.IsCompressedInRAM() && newSize == aBitmap.SizeInPixels() )
+        {
+        // If the bitmap's color mode was already correct & sizes matched,
+        // and bmp isn't rombitmap, no conversion was required and we can return
+        // the same bitmap that was given as a parameter
+        CFbsBitmap& bmp = const_cast<CFbsBitmap&>(aBitmap);
+        return bmp;
+        }
+    
+    // If needed, Resize the bitmap & bitmapDevice to correct dimensions,
+    // instead of recreating them always
+    if (newSize != bitmap->SizeInPixels() || !bitGc)
+        {
+        // Try to resize the bitmap & bmpDevice, leave, if e.g. out of memory
+        User::LeaveIfError(bitmap->Resize(newSize));
+
+        delete bitGc;
+		bitGc = 0;
+        *bitGcMemberPtr = 0;
+
+        User::LeaveIfError(bitmapDevice->Resize(newSize));
+        
+        // The BitGc has to be created every time separately
+        User::LeaveIfError(bitmapDevice->CreateContext(bitGc));
+        // Store the newly created context to a correct member variable
+        *bitGcMemberPtr = bitGc;
+        }
+    
+    if (aDisplayMode == EColor16MA && bitGc)
+        {
+        bitGc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
+        }
+    
+    if (bitGc)
+		{
+		bitGc->BitBlt(TPoint(0, 0), &aBitmap);
+		}
+    return *bitmap;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10TextureProcessor.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,178 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiVg10TextureProcessor.
+*                CHuiVg10TextureProcessor is a concrete implementation of a texture
+*                processor for OpenVG 1.0
+*
+*/
+
+
+
+#include "HuiVg10TextureProcessor.h"  // Class definition
+#include "HuiVg10PBufferSurface.h"
+#include "HuiVg10RenderPlugin.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiImage.h"
+#include "HuiRenderSurface.h"
+
+#include <VG/openvg.h>
+
+CHuiVg10TextureProcessor* CHuiVg10TextureProcessor::NewL(CHuiEnv& aEnv)
+    {
+    CHuiVg10TextureProcessor* self = CHuiVg10TextureProcessor::NewLC(aEnv);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+CHuiVg10TextureProcessor* CHuiVg10TextureProcessor::NewLC(CHuiEnv& aEnv)
+    {
+    CHuiVg10TextureProcessor* self = new (ELeave) CHuiVg10TextureProcessor(aEnv);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+
+CHuiVg10TextureProcessor::CHuiVg10TextureProcessor(CHuiEnv& aEnv)
+        : CHuiTextureProcessor(aEnv)
+    {
+    }
+
+
+void CHuiVg10TextureProcessor::ConstructL()
+    {
+    }
+
+
+CHuiVg10TextureProcessor::~CHuiVg10TextureProcessor()
+    {
+    }
+
+
+void CHuiVg10TextureProcessor::BlurL(const THuiTextureHandle& aSrc, THuiTextureHandle& aDest,
+                                     TInt aFilterSize, TInt aFlags)
+    {
+    // By default, use a quarter of the original size.
+    TSize originalSize = aSrc.Size();
+       
+    return BlurL(aSrc, aDest,
+                 TSize(originalSize.iWidth / 2, originalSize.iHeight / 2),
+                 aFilterSize, aFlags);
+    }
+
+
+void CHuiVg10TextureProcessor::BlurL(const THuiTextureHandle& aSrc,
+                                     THuiTextureHandle& aDest,
+                                     const TSize& /*aPreferredSize*/,
+                                     TInt aFilterSize, TInt /*aFlags*/)
+    {
+    if (!aSrc.HasContent())
+        {
+        return;
+        }
+
+    VGImage src  = (VGImage)aSrc.SegmentName(0);
+
+    if (src == VG_INVALID_HANDLE)
+        {
+        return;
+        }
+    
+    // If src and dest overlap, openvg cannot handle it. Create temp source as workaround.
+    if (aSrc.Name() == aDest.Name())
+        {
+    	TInt width  = vgGetParameteri(src, VG_IMAGE_WIDTH);
+    	TInt height = vgGetParameteri(src, VG_IMAGE_HEIGHT);
+	    VGImage tempsrc = vgCreateImage(VG_sRGBA_8888_PRE, width, height, 
+	                                  VG_IMAGE_QUALITY_FASTER | VG_IMAGE_QUALITY_NONANTIALIASED);
+	
+	    VGImage dest = (VGImage)aDest.SegmentName(0);
+		if (tempsrc == VG_INVALID_HANDLE)
+			{
+			HUI_DEBUG(_L("CHuiVg10TextureProcessor::BlurL() - Unable to allocate tempsrc texture."));
+			return;
+			}		
+
+        // Copy from dest to tempsrc
+        vgCopyImage(tempsrc, 0, 0, dest, 0, 0, width, height, VG_FALSE);
+
+        if (dest != VG_INVALID_HANDLE)
+            {
+            vgGaussianBlur(dest, tempsrc, aFilterSize / 3.0f, aFilterSize / 3.0f, VG_TILE_PAD);                    
+            }
+        
+        vgDestroyImage(tempsrc);            
+        return;
+        }
+    
+    if (!aDest.SegmentCount() || !aDest.SegmentName(0))
+    	{
+    	// No destination texture, so we must create a new one
+    	// TODO: Refactor this to a more proper place
+    	TInt width  = vgGetParameteri(src, VG_IMAGE_WIDTH);
+    	TInt height = vgGetParameteri(src, VG_IMAGE_HEIGHT);
+	    VGImage image = vgCreateImage(VG_sRGBA_8888_PRE, width, height, 
+	                                  VG_IMAGE_QUALITY_FASTER | VG_IMAGE_QUALITY_NONANTIALIASED);
+	
+		if (image == VG_INVALID_HANDLE)
+			{
+			HUI_DEBUG(_L("CHuiVg10TextureProcessor::BlurL() - Unable to allocate blurred texture."));
+			return;
+			}
+		
+		aDest.SetName(image);
+		aDest.SetSize(TSize(width, height));
+    	}
+    
+    VGImage dest = (VGImage)aDest.SegmentName(0);
+    
+    // TODO: EBlurFlagWhite and EBlurFlagBlack
+    
+    if (src == VG_INVALID_HANDLE || dest == VG_INVALID_HANDLE)
+        {
+        return;
+        }
+
+    vgGaussianBlur(dest, src, aFilterSize / 3.0f, aFilterSize / 3.0f, VG_TILE_PAD);
+    HUI_VG_INVARIANT();
+    }
+
+void CHuiVg10TextureProcessor::BlurSegmentedL(const MHuiSegmentedTexture& aSrc,
+                       THuiTextureHandle& aDest,
+                       TInt aFilterSize, TInt aFlags)
+{
+    BlurL(aSrc.Handle(), aDest, aFilterSize, aFlags);
+}
+    
+void CHuiVg10TextureProcessor::BlurSegmentedL(const MHuiSegmentedTexture& aSrc, 
+                       THuiTextureHandle& aDest,
+                       const TSize& aPreferredSize,
+                       TInt aFilterSize, TInt aFlags)
+{
+    BlurL(aSrc.Handle(), aDest, aPreferredSize, aFilterSize, aFlags);
+}
+
+void CHuiVg10TextureProcessor::Release()
+    {
+    HUI_DEBUG(_L("CHuiVg10TextureProcessor::Release() - Destroying processing buffer."));
+    }
+
+
+void CHuiVg10TextureProcessor::RestoreL()
+    {
+    HUI_DEBUG(_L("CHuiVg10TextureProcessor::RestoreL() - Called."));
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/HuiVg10VGImageBinder.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class HuiVg10VGImageBinder
+*
+*/
+
+#include "HuiVg10VgImageBinder.h"
+#include "HuiVg10RenderPlugin.h"
+#include "uiacceltk/HuiUtil.h"
+
+CHuiVg10VgImageBinder::CHuiVg10VgImageBinder(CHuiVg10RenderPlugin* aRenderPlugin):
+    iRenderPlugin(aRenderPlugin)
+    {
+    }
+
+void CHuiVg10VgImageBinder::ConstructL()
+    {
+    }
+
+CHuiVg10VgImageBinder::~CHuiVg10VgImageBinder()
+    {
+    if (iEglPBufferSurface_Client)
+        {
+        eglDestroySurface( iRenderPlugin->EglDisplay(), iEglPBufferSurface_Client );
+        iEglPBufferSurface_Client = EGL_NO_SURFACE;
+        }
+    // Not owned, don't delete.
+    iRenderPlugin = NULL;
+    }
+
+CHuiVg10VgImageBinder* CHuiVg10VgImageBinder::NewL(CHuiVg10RenderPlugin* aRenderPlugin)
+    {   
+    CHuiVg10VgImageBinder* self = new (ELeave) CHuiVg10VgImageBinder(aRenderPlugin);
+    self->ConstructL();
+    return self;
+    }
+
+TInt CHuiVg10VgImageBinder::BindClientBuffer(TUint aBuffer)
+    {
+    // Check whether we should use the Alpha format bit
+    VGImageFormat imageFormat = (VGImageFormat)vgGetParameteri(aBuffer, VG_IMAGE_FORMAT);
+    TInt maskBit = 0;
+    if (imageFormat == VG_sRGBA_8888_PRE)
+        {
+        maskBit = EGL_VG_ALPHA_FORMAT_PRE_BIT;
+        }
+    
+    const TInt BITS_PER_CHANNEL = 8;
+    // Choose an EGL config
+    const EGLint attrs[] =
+        {
+        EGL_RENDERABLE_TYPE,    EGL_OPENVG_BIT,
+        EGL_SURFACE_TYPE,       EGL_PBUFFER_BIT | maskBit,
+        EGL_RED_SIZE,           BITS_PER_CHANNEL,
+        EGL_GREEN_SIZE,         BITS_PER_CHANNEL,
+        EGL_BLUE_SIZE,          BITS_PER_CHANNEL,
+        EGL_ALPHA_SIZE,         BITS_PER_CHANNEL,
+        EGL_NONE
+        };
+    
+    // Create a context
+    TInt configCount = iRenderPlugin->EglChooseConfig(attrs);
+    EGLConfig config = iRenderPlugin->EglConfig(0);
+    
+    // Create a pbuffer surface
+    iEglPBufferSurface_Client = eglCreatePbufferFromClientBuffer(iRenderPlugin->EglDisplay(),
+            EGL_OPENVG_IMAGE, 
+            static_cast<EGLClientBuffer>(aBuffer),    // Use the param image as buffer
+            config, NULL);
+    
+    if (iEglPBufferSurface_Client == EGL_NO_SURFACE)
+        {
+        HUI_DEBUG1(_L("CHuiVg10VgImageBinder::BindClientBuffer() - EGL Surface could not be created, eglErr: %04x"), eglGetError() );
+        return KErrGeneral;
+        }
+
+    // Save current context and surfaces
+    iSavedContext = eglGetCurrentContext();
+    iSavedDrawSurface = eglGetCurrentSurface(EGL_DRAW);
+    iSavedReadSurface = eglGetCurrentSurface(EGL_READ);
+
+    EGLContext context = iRenderPlugin->EglSharedContext();
+    
+    // Bind our own PBuffer surface (from VGImage)
+    if ( eglMakeCurrent(iRenderPlugin->EglDisplay(), iEglPBufferSurface_Client, iEglPBufferSurface_Client, context /*iSavedContext*/) == EGL_FALSE )
+        {
+        HUI_DEBUG1(_L("CHuiVg10VgImageBinder::BindClientBuffer() - EGL Surface could not be made current, eglErr: %04x"), eglGetError());
+        return KErrGeneral;
+        }
+    
+    // Alles in Ordnung!
+    return KErrNone;
+    }
+
+TInt CHuiVg10VgImageBinder::UnBindClientBuffer()
+    {
+    if ( eglMakeCurrent(iRenderPlugin->EglDisplay(), iSavedDrawSurface, iSavedReadSurface, iSavedContext) == EGL_FALSE )
+        {
+        HUI_DEBUG1(_L("CHuiVg10VgImageBinder::BindClientBuffer() - EGL Surface could not be made current, eglErr: %04x"), eglGetError());
+        return KErrGeneral;
+        }
+    
+    iSavedDrawSurface = 0;
+    iSavedReadSurface = 0;
+    iSavedContext = 0;
+
+    if (iEglPBufferSurface_Client)
+        {
+        eglDestroySurface( iRenderPlugin->EglDisplay(), iEglPBufferSurface_Client );
+        iEglPBufferSurface_Client = EGL_NO_SURFACE;
+        }
+    
+    // Everything went fine
+    return KErrNone;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/huivg10canvasgc.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,334 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   OpenVG class for canvas graphics context
+*
+*/
+
+#include <e32math.h>
+
+#include "huivg10canvasgc.h"
+#include "huicanvasgc.h"
+#include "HuiVg10Gc.h"
+#include "uiacceltk/HuiCanvasVisual.h"
+#include "uiacceltk/HuiSkin.h"
+#include "uiacceltk/HuiS60Skin.h"
+#include <uiacceltk/huidisplaybackgrounditem.h>
+#include "HuiRenderSurface.h"
+#include "uiacceltk/HuiDisplay.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiUtil.h"
+#ifndef __SERIES60_30__     
+#include "HuiTargetBitmap.h"
+#endif
+
+#include <AknsRendererWrapper.h>
+#include <AknsDrawUtils.h>
+#include <coecntrl.h>
+#include "huiskinbackroundlayout.h"
+#include "huivg10canvasrenderbuffer.h"
+#include "HuiFxVg10.h"
+
+CHuiVg10CanvasGc::CHuiVg10CanvasGc()
+    {
+    }
+
+CHuiVg10CanvasGc::~CHuiVg10CanvasGc()
+    {	
+    }
+
+void CHuiVg10CanvasGc::DoDrawPolygon(RArray<THuiRealPoint>& aPoints)
+    {
+    if(iPolygonDrawMode == EHuiNoFill)
+    	{
+    	CHuiCanvasGc::DoDrawPolygon(aPoints);
+    	}
+    else
+        {
+        CHuiVg10Gc* vg10Gc = (CHuiVg10Gc *)iGc;
+        vg10Gc->SetFillRule( iPolygonDrawMode );
+        vg10Gc->SetPaintPattern(iPolygonFillTexture, iPolygonFillTextureOrigin);
+        vg10Gc->DrawPolygon(aPoints);                
+        vg10Gc->SetPaintPattern(NULL, iPolygonFillTextureOrigin);
+        }	    
+    }
+
+void CHuiVg10CanvasGc::DoDrawArc(const THuiRealRect& aDestinationRect, 
+       const THuiRealPoint& aStart, const THuiRealPoint& aEnd) 
+   {
+   DoDrawPieAndArc( aDestinationRect, aStart, aEnd, EFalse);
+   }
+   
+void CHuiVg10CanvasGc::DoDrawPie(const THuiRealRect& aDestinationRect, 
+        const THuiRealPoint& aStart, const THuiRealPoint& aEnd)
+    {
+    DoDrawPieAndArc( aDestinationRect, aStart, aEnd, ETrue);
+    }
+
+
+void CHuiVg10CanvasGc::DoDrawPieAndArc(const THuiRealRect& aDestinationRect, 
+      const THuiRealPoint& aStart, const THuiRealPoint& aEnd, TBool aIsPie)  
+    {    
+    THuiRealRect destinationRect = aDestinationRect;
+    destinationRect.Shrink(0.5f, 0.5f);    
+    THuiRealPoint center = destinationRect.Center();
+
+    // Ok, explaining this is not going to be easy. So, please pay attention!
+    //
+    // Symbian Window Gc DrawArc() method always draws an arc anti-clockwise, from start angle
+    // to end angle. As y-axis in Window GC point downwards, the angle grows towards *negative*
+    // direction, if we go anti-clockwise. To be able to make calculations later we have to make 
+    // sure both the start and end angles are negative.
+    // 
+    TReal startAngle = 0;
+    Math::ATan(startAngle, aStart.iY - center.iY,  aStart.iX - center.iX);
+    startAngle = (startAngle*180)/KPi;   
+    // make sure this is negative angle
+    if (startAngle > - 0.000001) 
+        {
+        startAngle -= 360.0; 
+        }
+        
+    TReal endAngle = 0;
+    Math::ATan(endAngle, aEnd.iY - center.iY, aEnd.iX - center.iX);
+    endAngle = (endAngle*180)/KPi;   
+    // make sure this is negative angle
+    if (endAngle > - 0.000001) 
+        {
+        endAngle -= 360.0; 
+        }
+
+    // Make a full circle if the end and start angles are equal
+    if ( Abs(endAngle-startAngle) < 0.000001)
+        {
+        endAngle -= 360.0;
+        }
+
+    // Organize angles so that we go from start to end angle anti-clockwise, i.e. towards negative direction
+    if ( endAngle > startAngle )
+        {
+        endAngle -= 360;
+        }
+
+    CHuiVg10Gc* vg10Gc = (CHuiVg10Gc *)iGc;
+    vg10Gc->SetPaintPattern(iPolygonFillTexture, iPolygonFillTextureOrigin);
+    vg10Gc->DrawArc(aDestinationRect.Round(), iPolygonDrawMode, iPenWidth, startAngle, endAngle, aIsPie);
+    vg10Gc->SetPaintPattern(NULL, iPolygonFillTextureOrigin);  
+    }
+
+ void CHuiVg10CanvasGc::DoDrawRoundRect(const THuiRealRect& aDestinationRect, const THuiRealSize& aSize)
+     {
+     CHuiVg10Gc* vg10Gc = (CHuiVg10Gc *)iGc;
+     vg10Gc->SetPaintPattern(iPolygonFillTexture, iPolygonFillTextureOrigin);
+     vg10Gc->DrawRoundRect(aDestinationRect.Round(), aSize, iPolygonDrawMode, iPenWidth);
+     vg10Gc->SetPaintPattern(NULL, iPolygonFillTextureOrigin);
+     }
+ 
+void CHuiVg10CanvasGc::ClearWithSkinBackground(const THuiRealRect& /*aRect*/) 
+    {
+    if (!iGc)
+        {
+        return;    
+        }
+
+    // Acquire background texture
+    const CHuiTexture* backgroundTexture = NULL;
+    TInt err = CHuiStatic::Env().Skin().GetTexture(EHuiSkinBackgroundTexture, backgroundTexture);
+    ASSERT(backgroundTexture!=NULL);
+    __ASSERT_ALWAYS(err == KErrNone, User::Invariant());
+
+    // Apply background texture
+    THuiImage background(*backgroundTexture);
+
+    TPoint screenOrigin(0, 0);
+    CHuiStatic::CurrentRenderSurface()->GetScreenOrigin(screenOrigin);
+    // The origin is used to offset the background in the display's
+    // rendering surface, so that the background's origin is in the
+    // top left screen corner.
+    screenOrigin.iX = -screenOrigin.iX;
+    screenOrigin.iY = -screenOrigin.iY;
+
+    iGc->SetPenColor(KRgbWhite);
+    iGc->SetPenAlpha(255);
+    iGc->SetAlign(EHuiAlignHLeft, EHuiAlignVTop);            
+    iGc->Disable(CHuiGc::EFeatureBlending);
+    iGc->Disable(CHuiGc::EFeatureClipping);            
+    iGc->DrawImage(background, screenOrigin, background.Texture().Size()); 
+    iGc->Enable(CHuiGc::EFeatureBlending);
+    iGc->Enable(CHuiGc::EFeatureClipping);            
+    }
+
+void CHuiVg10CanvasGc::ClearWithBackgroundItems(const THuiRealRect& /*aRect*/, const RArray<THuiDisplayBackgroundItem>& aItems)
+    {
+    if (!iGc)
+        return;
+
+    THuiDisplayBackgroundItem item;   
+    CHuiS60Skin* s60skin = static_cast<CHuiS60Skin*>(&CHuiStatic::Env().Skin());
+    CHuiTexture* backgroundTexture = NULL;
+
+    for (TInt index = 0; index < aItems.Count(); index++)
+        {        
+        item = aItems[index];    
+        switch (item.ClearMode())
+            {
+            case CHuiDisplay::EClearNone:
+                // do nothing...
+                break;
+            case CHuiDisplay::EClearWithColor:
+                iGc->SetPenColor(item.Color());
+                iGc->SetPenAlpha(TInt(item.Color().Alpha() * 255));
+                iGc->SetAlign(EHuiAlignHLeft, EHuiAlignVTop);            
+                iGc->Disable(CHuiGc::EFeatureBlending);
+                iGc->Enable(CHuiGc::EFeatureClipping);            
+                iGc->PushClip();
+                iGc->Clip(item.Rect());  // takes transformations into account                              
+                iGc->Clear();
+                iGc->PopClip();
+                break;
+            case CHuiDisplay::EClearWithSkinBackground:
+                 TRect skinRect;
+                 TRect dummy;
+                 GetRectForItem(item.SkinBackground(), dummy, skinRect);
+                 backgroundTexture = s60skin->BackgroundTexture(item.SkinBackground());
+                 if (backgroundTexture)
+                    {
+                    THuiImage background(*backgroundTexture);
+
+                    TPoint screenOrigin(0, 0);
+                    CHuiStatic::CurrentRenderSurface()->GetScreenOrigin(screenOrigin);
+                    screenOrigin.iX = -screenOrigin.iX;
+                    screenOrigin.iY = -screenOrigin.iY;
+                    screenOrigin+=skinRect.iTl;
+                    iGc->SetPenColor(KRgbWhite);
+                    iGc->SetPenAlpha(255);
+                    iGc->SetAlign(EHuiAlignHLeft, EHuiAlignVTop);            
+                    iGc->Disable(CHuiGc::EFeatureBlending);
+                    iGc->Enable(CHuiGc::EFeatureClipping);            
+                    skinRect.Intersection(item.Rect());
+                    iGc->PushClip();
+                    iGc->Clip(skinRect); // takes transformations into account
+                    iGc->DrawImage(background, screenOrigin, background.Texture().Size());                     
+                    iGc->PopClip();
+                    }
+                 break;                                                    
+             }
+        }             
+    }
+
+TInt CHuiVg10CanvasGc::MaxNumberOfClipRects() const
+    {
+    // We could ask this number from OpenVg, but spec says that at least 32 must be supported
+    return 32;    
+    }
+
+CHuiCanvasRenderBuffer* CHuiVg10CanvasGc::CreateRenderBufferL(const TSize& /*aSize*/)
+    {
+    CHuiVg10CanvasRenderBuffer* buffer = new (ELeave) CHuiVg10CanvasRenderBuffer;
+    return buffer;
+    }
+
+void CHuiVg10CanvasGc::DoDrawRenderBuffer(const CHuiCanvasRenderBuffer& aImage, const THuiRealPoint& aDestinationPoint)
+    {
+    const CHuiVg10CanvasRenderBuffer* vg10RenderBuffer = (const CHuiVg10CanvasRenderBuffer*) &aImage;    
+    
+    CHuiVg10Gc* vg10Gc = (CHuiVg10Gc *)iGc;
+    if (vg10RenderBuffer->Image())
+        {
+        vg10Gc->UpdateColor();
+        iGc->Push(EHuiGcMatrixModel);
+        vgTranslate(aDestinationPoint.iX, aDestinationPoint.iY);
+        vgDrawImage(vg10RenderBuffer->Image());
+        iGc->Pop(EHuiGcMatrixModel);
+        }
+    }
+
+void CHuiVg10CanvasGc::DoClearRenderBuffer( CHuiCanvasRenderBuffer& aImage, const TRect & aRect )
+    {
+    HUIFX_VG_INVARIANT();   
+    const CHuiVg10CanvasRenderBuffer* vg10RenderBuffer = (const CHuiVg10CanvasRenderBuffer*) &aImage;    
+
+    const TInt COLOR_COMPONENTS = 4;
+    VGfloat savedColor[COLOR_COMPONENTS];
+    vgGetfv(VG_CLEAR_COLOR, COLOR_COMPONENTS, savedColor);
+    
+    VGfloat color[COLOR_COMPONENTS] = 
+                {
+                 0.0f, 0.0f, 0.0f, 0.0f
+                };
+    vgSetfv(VG_CLEAR_COLOR, COLOR_COMPONENTS, color);
+    vgClearImage(vg10RenderBuffer->Image(), aRect.iTl.iX, aRect.iTl.iY, aRect.Size().iWidth, aRect.Size().iHeight);
+    vgSetfv(VG_CLEAR_COLOR, COLOR_COMPONENTS, savedColor);
+    HUIFX_VG_INVARIANT();   
+    }
+
+
+void CHuiVg10CanvasGc::RestoreFlaggedState() const
+    {
+    if (iGc)
+        {
+        CHuiVg10Gc* vg10Gc = (CHuiVg10Gc *)iGc;
+        vg10Gc->RestoreFlaggedState();
+        }
+    }
+
+void CHuiVg10CanvasGc::DoDrawRects(RArray<THuiRealRect>& aRects)
+    {
+    if(iPolygonDrawMode == EHuiNoFill)
+        {
+        CHuiCanvasGc::DoDrawRects(aRects);
+        }
+    else
+        {
+        for(TInt i=0; i<aRects.Count(); i++)
+            {
+            TRect roundedRect = aRects[i].Round();
+            if (roundedRect.Height() > 0 && roundedRect.Width() > 0)
+                {                   
+                CHuiVg10Gc* vg10Gc = (CHuiVg10Gc *)iGc;
+                vg10Gc->SetPaintPattern(iPolygonFillTexture, iPolygonFillTextureOrigin);
+                iGc->DrawRect(roundedRect);
+                vg10Gc->SetPaintPattern(NULL, iPolygonFillTextureOrigin);
+                }           
+            }            
+        }
+    }
+
+void CHuiVg10CanvasGc::DrawEllipse(const THuiRealRect& aDestinationRect)
+    {   
+    if (!iGc)
+       {
+       return;    
+       }
+
+    Setup();
+
+    EnableDelayedClippingIfNeeded(aDestinationRect);    
+
+    while (ClipNext())
+        {
+        DoDrawEllipse( aDestinationRect );
+        }
+
+    DisableDelayedClippingIfNeeded();    
+
+    Cleanup();
+    }
+
+void CHuiVg10CanvasGc::DoDrawEllipse(const THuiRealRect& aDestinationRect)
+    {   
+    CHuiVg10Gc* vg10Gc = (CHuiVg10Gc *)iGc;
+    vg10Gc->SetPaintPattern(iPolygonFillTexture, iPolygonFillTextureOrigin);
+    vg10Gc->DrawEllipse(aDestinationRect.Round(), iPolygonDrawMode, iPenWidth);
+    vg10Gc->SetPaintPattern(NULL, iPolygonFillTextureOrigin);                
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/rendervg10/src/huivg10canvasrenderbuffer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,452 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class canvas renderering target
+*
+*/
+
+
+
+#include "huivg10canvasrenderbuffer.h"
+#include "HuiVg10RenderPlugin.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiEnv.h"
+#include "HuiVg10RenderPlugin.h"
+#include "uiacceltk/HuiDisplay.h"
+
+//#define HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+
+
+CHuiVg10CanvasRenderBuffer::CHuiVg10CanvasRenderBuffer()
+    {       
+    }
+
+CHuiVg10CanvasRenderBuffer::~CHuiVg10CanvasRenderBuffer()
+    {
+    UnInitialize();
+    }
+
+void CHuiVg10CanvasRenderBuffer::UnInitialize()
+    {
+    CHuiVg10RenderPlugin& renderer = CHuiStatic::Vg10Renderer();
+
+    UnBind();
+
+    if (iGc)
+        {
+        delete iGc;
+        iGc = 0;
+        }
+    
+    if (iRotatedImage)
+        {
+        vgDestroyImage(iRotatedImage);
+        iRotatedImage = VG_INVALID_HANDLE;
+        }
+
+    if (iImage)
+        {
+        vgDestroyImage(iImage);
+        iImage = VG_INVALID_HANDLE;
+        }
+    
+    if (iSurface)
+        {
+        eglDestroySurface(renderer.EglDisplay(), iSurface);
+        iSurface = 0;
+        }
+    
+    if (iContext)
+        {
+        eglDestroyContext(renderer.EglDisplay(), iContext);      
+        iContext = 0;
+        }
+
+    iInitialized = EFalse;
+    }
+
+void CHuiVg10CanvasRenderBuffer::InitializeL(const TSize& aSize)
+    {    
+    if (iSize == aSize && iImage && iContext && iSurface)
+        {
+        // Already initalized
+        return;
+        }
+
+    CHuiVg10RenderPlugin& renderer = CHuiStatic::Vg10Renderer();
+    
+    // Just in case...
+    UnInitialize();
+
+    PushEGLContext();
+    
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        TTime startTime;
+        startTime.UniversalTime();
+#endif
+    
+    iSize = aSize;        
+
+#ifndef __WINS__ // Should possibly query the supported mode instead?
+    VGImageFormat imageInternalFormat = VG_sARGB_8888_PRE;
+#else
+    VGImageFormat imageInternalFormat = VG_sARGB_8888;
+#endif
+    
+    iImage = vgCreateImage(imageInternalFormat, iSize.iWidth, iSize.iHeight, 
+                           VG_IMAGE_QUALITY_NONANTIALIASED);
+
+    if (iImage == VG_INVALID_HANDLE)
+        {
+        PopEGLContext();
+
+        VGErrorCode err = vgGetError();
+        RDebug::Print(_L("CHuiVg10CanvasRenderBuffer::InitializeL() - vgCreateImage failed: VgError -- %04x"), err);
+        User::Leave(KErrGeneral);
+        }
+        
+    const TInt BITS_PER_CHANNEL = 8;
+    
+    // Choose an EGL config
+    const EGLint attrs[] =
+        {
+        EGL_SURFACE_TYPE,       EGL_PBUFFER_BIT | EGL_VG_ALPHA_FORMAT_PRE_BIT,
+        EGL_RENDERABLE_TYPE,    EGL_OPENVG_BIT,
+        EGL_RED_SIZE,           BITS_PER_CHANNEL,
+        EGL_GREEN_SIZE,         BITS_PER_CHANNEL,
+        EGL_BLUE_SIZE,          BITS_PER_CHANNEL,
+        EGL_ALPHA_SIZE,         BITS_PER_CHANNEL,
+        EGL_NONE
+        };
+    TInt configCount = renderer.EglChooseConfig(attrs);
+    ASSERT(configCount > 0);
+
+    if (configCount <= 0)
+        {
+        PopEGLContext();
+
+        RDebug::Print(_L("CHuiVg10CanvasRenderBuffer::InitializeL() - no EGL config found !"));
+        User::Leave(KErrGeneral);
+        }    
+    
+    EGLConfig config = renderer.EglConfig(0);
+    
+    // Create a context
+    iContext = eglCreateContext(renderer.EglDisplay(), config,
+            renderer.EglSharedContext(), NULL);
+
+    if(!iContext)
+        {
+        PopEGLContext();
+
+        EGLint err = eglGetError();
+        RDebug::Print(_L("CHuiVg10CanvasRenderBuffer::InitializeL() - EGLContext creation failed: EglError -- %04x"), err);
+        User::Leave(KErrGeneral);
+        }
+
+    // Create a pbuffer surface
+    iSurface = eglCreatePbufferFromClientBuffer(renderer.EglDisplay(), EGL_OPENVG_IMAGE,
+                                                iImage, config, NULL);
+    if(!iSurface)
+        {
+        PopEGLContext();
+
+        EGLint err = eglGetError();
+        RDebug::Print(_L("CHuiVg10CanvasRenderBuffer::InitializeL() - EGLSurface creation failed: EglError -- %04x"), err);
+        User::Leave(KErrGeneral);
+        }
+    
+    // Initialize the context (TODO: We perhaps do not really need to do this by creating Cg 
+    iGc = renderer.CreateGcL();
+    Bind();
+    iGc->InitState();
+        
+    VGfloat color[] = 
+                {
+                0.f, 0.f, 0.f, 0.f
+                };
+    vgSetfv(VG_CLEAR_COLOR, sizeof(color) / sizeof(VGfloat), color);
+    vgClear(0, 0, iSize.iWidth, iSize.iHeight);
+    UnBind();
+
+    // Let renderer know that we have been fiddlling with OpenVg state directly
+    // "iGc->InitState" confuses scissoring setting, so lets notify it.
+    renderer.AddRestoreStateFlags(EHuiVg10GcStateFlagDirtyScissor);    
+    renderer.AddRestoreStateFlags(EHuiVg10GcStateFlagDirtyBlendMode);    
+    
+ #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        TTime endTime;
+        endTime.UniversalTime();
+        TInt timeInMs =  endTime.MicroSecondsFrom( startTime ).Int64()/1000;           
+        RDebug::Print(_L("> CHuiVg10CanvasRenderBuffer::InitializeL took %i ms"), timeInMs);
+#endif
+
+    iInitialized = ETrue;
+    
+    PopEGLContext();
+    }
+
+void CHuiVg10CanvasRenderBuffer::Bind()
+    {
+    // Make sure it is safe to call even if "UnBind" has not been called or this function
+    // has already been called.
+    if (!iSurface || !iContext || iSavedContext || iSavedDrawSurface || iSavedReadSurface)
+        {
+        return;
+        }
+    
+    // Save current context and surfaces
+    iSavedContext = eglGetCurrentContext();
+    iSavedDrawSurface = eglGetCurrentSurface(EGL_DRAW);
+    iSavedReadSurface = eglGetCurrentSurface(EGL_READ);
+    
+    // Bind our own surface
+    CHuiVg10RenderPlugin& renderer = CHuiStatic::Vg10Renderer();
+    eglMakeCurrent(renderer.EglDisplay(), iSurface, iSurface, iContext);
+    }
+
+void CHuiVg10CanvasRenderBuffer::UnBind()
+    {
+    // Make sure it is safe to call even if "Bind" has not been called or this
+    // function has already been called.
+    if (!iSavedDrawSurface || !iSavedReadSurface || !iSavedContext)
+        {
+        return;
+        }        
+    
+    // Restore original surface & context
+    CHuiVg10RenderPlugin& renderer = CHuiStatic::Vg10Renderer();
+	
+	// Todo: Should check whether the saved surface was UI surface 
+	// and call CHuiVg10RenderSurface::MakeCurrent() for that instead
+	CHuiEnv* env = CHuiEnv::Static();  
+	if (env && env->iSwapObserver)
+	    {    
+        env->iSwapObserver->ReleaseWindowServer();
+	    }
+
+    eglMakeCurrent(renderer.EglDisplay(), iSavedDrawSurface, iSavedReadSurface,
+        iSavedContext);
+        
+    if (env && env->iSwapObserver)
+        {
+        env->iSwapObserver->ReleaseWindowServer(EFalse);
+        }
+    
+    iSavedDrawSurface = 0;
+    iSavedReadSurface = 0;
+    iSavedContext = 0;    
+    }
+
+VGImage CHuiVg10CanvasRenderBuffer::Image() const
+    {
+    return iImage;
+    }
+
+
+void CHuiVg10CanvasRenderBuffer::PushEGLContext()
+    {
+    CHuiVg10RenderPlugin& renderer = CHuiStatic::Vg10Renderer();
+    iPreviousEGLState.iContext= eglGetCurrentContext(); 
+    TEGLState& state = renderer.GetUploadState();
+    if (state.iContext == KErrNotFound)
+        {
+        TEGLState& state = renderer.GetUploadState();
+        // the first context used for uploading will be used for all texture uploads
+        state.iContext      = iPreviousEGLState.iContext; 
+        state.iDrawSurface  = eglGetCurrentSurface(EGL_DRAW);
+        state.iReadSurface  = eglGetCurrentSurface(EGL_READ);
+        state.iDisplay      = eglGetCurrentDisplay();
+        }
+    else
+        {
+        // change context only if necessary
+        if (iPreviousEGLState.iContext != state.iContext)
+            {
+            iPreviousEGLState.iDrawSurface  = eglGetCurrentSurface(EGL_DRAW);
+            iPreviousEGLState.iReadSurface  = eglGetCurrentSurface(EGL_READ);
+            iPreviousEGLState.iDisplay      = eglGetCurrentDisplay();
+            eglMakeCurrent(state.iDisplay, state.iDrawSurface, state.iReadSurface, state.iContext);
+            }
+        }
+    }
+
+void CHuiVg10CanvasRenderBuffer::PopEGLContext()
+    {
+    CHuiVg10RenderPlugin& renderer = CHuiStatic::Vg10Renderer();
+    if (iPreviousEGLState.iContext != renderer.GetUploadState().iContext)
+        {
+        eglMakeCurrent(iPreviousEGLState.iDisplay,  iPreviousEGLState.iDrawSurface, iPreviousEGLState.iReadSurface,iPreviousEGLState.iContext);
+        }
+    }
+
+void CHuiVg10CanvasRenderBuffer::Copy(const CHuiCanvasRenderBuffer& aSourceBuffer)
+    {
+    if (iSize != aSourceBuffer.Size())
+        {
+        return;
+        }
+    
+    CHuiVg10CanvasRenderBuffer* sourcebuffer = (CHuiVg10CanvasRenderBuffer*) &aSourceBuffer;    
+    vgCopyImage(iImage, 0, 0, 
+            sourcebuffer->Image(), 0, 0, 
+            iSize.iWidth, iSize.iHeight, VG_FALSE);
+    }
+
+void CHuiVg10CanvasRenderBuffer::Copy(TPoint aPoint)
+    {
+    ReadBackground(aPoint);
+    }
+
+void CHuiVg10CanvasRenderBuffer::ReadBackground(TPoint aPosition)
+    {
+    CHuiDisplay& display = CHuiStatic::Env().PrimaryDisplay();        
+    TBool rotatedDisplay = display.Orientation() == CHuiGc::EOrientationCCW90 || display.Orientation() == CHuiGc::EOrientationCW90;
+    TRect renderBufferLocation = TRect(aPosition, iSize);
+    
+    TRect displayArea = display.VisibleArea();
+    
+    TInt displayHeight = displayArea.Height();
+    TInt displayWidth = displayArea.Width();
+   
+    TSize rotatedSize = iSize;
+    TPoint rotatedPos = aPosition;
+    
+    // Read pixels from surface        
+    if (rotatedDisplay)
+        {
+        if (iRotatedImage == VG_INVALID_HANDLE)
+            {
+            PushEGLContext();
+            
+            #ifndef __WINS__ // Should possibly query the supported mode instead?
+                VGImageFormat imageInternalFormat = VG_sARGB_8888_PRE;
+            #else
+                VGImageFormat imageInternalFormat = VG_sARGB_8888;
+            #endif
+
+            TSize rotatedImageSize = TSize(iSize.iHeight, iSize.iWidth);
+            iRotatedImage = vgCreateImage(imageInternalFormat, rotatedImageSize.iWidth, rotatedImageSize.iHeight, 
+                               VG_IMAGE_QUALITY_NONANTIALIASED);
+
+            PopEGLContext();
+            }
+        
+        
+        // If we have rotation on CHuiGc level, we must manually take that into account when
+        // accessing pixels directly                
+        if(display.Orientation() == CHuiGc::EOrientationCCW90)
+            {
+            // Rotate the buffer location relative to real surface coordinates
+            rotatedSize = TSize(iSize.iHeight, iSize.iWidth);
+            rotatedPos = TPoint(displayHeight - aPosition.iY - iSize.iHeight, aPosition.iX);                        
+            renderBufferLocation = TRect(rotatedPos, rotatedSize);            
+            }
+        else if(display.Orientation() == CHuiGc::EOrientationCW90)
+            {
+            // Rotate the buffer location relative to real surface coordinates
+            rotatedSize = TSize(iSize.iHeight, iSize.iWidth);
+            rotatedPos = TPoint(aPosition.iY, displayWidth - aPosition.iX - iSize.iWidth);            
+            renderBufferLocation = TRect(rotatedPos, rotatedSize);
+            }
+        else
+            {
+            // nothing
+            }        
+
+        // If screen is rotated but surface is not in native orientation, this gets difficult
+        // because vgGetPixels is not affected by transformations.
+
+        // Swap h and w so that those are the "real" values from surface point of view.
+        displayHeight = displayWidth;
+
+        #ifdef HUIFX_TRACE    
+        RDebug::Print(_L("CHuiFxVg10OffscreenRenderbuffer::PrepareForReuse - renderBufferLocation: %i,%i, %i,%i "), 
+                renderBufferLocation.iTl.iX,
+                renderBufferLocation.iTl.iY,
+                renderBufferLocation.iBr.iX,
+                renderBufferLocation.iBr.iY);
+
+        TRect vgRect(TPoint(renderBufferLocation.iTl.iX, displayHeight - renderBufferLocation.iTl.iY - rotatedSize.iHeight), rotatedSize);
+
+        RDebug::Print(_L("CHuiFxVg10OffscreenRenderbuffer::PrepareForReuse - vgRect: %i,%i, %i,%i "), 
+                vgRect.iTl.iX,
+                vgRect.iTl.iY,
+                vgRect.iBr.iX,
+                vgRect.iBr.iY);
+        #endif
+        
+        // So...first get pixels from surface into rotated image
+        vgGetPixels(iRotatedImage, 0, 0, renderBufferLocation.iTl.iX, displayHeight - renderBufferLocation.iTl.iY - rotatedSize.iHeight, rotatedSize.iWidth, rotatedSize.iHeight);
+        
+        // Draw rotated image into real buffer image, first bind it as render target...
+        Bind();            
+        
+        // ...store some states...
+        const TInt VG_MATRIX_SIZE = 9;
+        VGfloat oldMatrix[VG_MATRIX_SIZE];
+        vgGetMatrix(oldMatrix);
+
+        // ...set some vg states...
+        vgLoadIdentity();
+        vgSeti(VG_BLEND_MODE, VG_BLEND_SRC);
+        vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_NORMAL);
+        vgSeti(VG_SCISSORING, VG_FALSE);
+
+        TInt w = iSize.iWidth;
+        TInt h = iSize.iHeight;
+        
+        // ...select right rotation...
+        if (display.Orientation() == CHuiGc::EOrientationCW90)
+            {
+            // Rotate around origo and move back to displayarea
+            vgRotate(-90);
+            vgTranslate(-h, 0);
+            }
+        else if (display.Orientation() == CHuiGc::EOrientationCCW90)
+            {
+            // Rotate around origo and move back to displayarea
+            vgRotate(90);
+            vgTranslate(0, -w);
+            }
+        else if (display.Orientation() == CHuiGc::EOrientation180)
+            {
+            // Rotate around origo and move back to displayarea
+            vgRotate(180);
+            vgTranslate(-w, -h);            
+            }
+        else
+            {
+            }        
+        
+        // ...Draw...
+        if (iRotatedImage != VG_INVALID_HANDLE)
+            {
+            vgDrawImage(iRotatedImage);
+            }
+        
+        // ..and restore default VG states
+        vgSeti(VG_SCISSORING, VG_TRUE);
+        vgSeti(VG_BLEND_MODE, VG_BLEND_SRC_OVER);
+        vgLoadMatrix(oldMatrix);
+
+        // ...finally unbind image and we should have the content correctly.
+        UnBind();
+        }
+    else
+        {
+        // Much easier if no rotation !
+        vgGetPixels(iImage, 0, 0, renderBufferLocation.iTl.iX, displayHeight - renderBufferLocation.iTl.iY - rotatedSize.iHeight, rotatedSize.iWidth, rotatedSize.iHeight);
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/sis/createsisx.bat	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,25 @@
+rem
+rem Copyright (c) 2009 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 Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description: 
+rem
+
+makesis huitk.pkg
+signsis huitk.sis huitk.sisx ..\..\internal\certificates\rd.cer ..\..\internal\certificates\rd-key.pem
+makesis huitk_debug.pkg
+signsis huitk_debug.sis huitk_debug.sisx ..\..\internal\certificates\rd.cer ..\..\internal\certificates\rd-key.pem
+makesis huitk_update.pkg
+signsis huitk_update.sis huitk_update.sisx ..\..\internal\certificates\rd.cer ..\..\internal\certificates\rd-key.pem
+makesis huitk_update_debug.pkg
+signsis huitk_update_debug.sis huitk_update_debug.sisx ..\..\internal\certificates\rd.cer ..\..\internal\certificates\rd-key.pem
+makesis -s huitk_stub.pkg
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/sis/huitk.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,29 @@
+;
+; 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: 
+;
+
+; UID is the dll's UID
+;
+#{"HUITK DLL"},(0x05BC6D02),1,0,0
+; the vendor names are required for EKA2 so uncomment
+; these two lines for S60 3.0 and UIQ 3.x.
+;Localised Vendor name
+%{"Nokia-EN"}
+
+;Unique Vendor name
+:"Nokia"
+
+"\Epoc32\release\armv5\urel\hitchcock.dll"       -"!:\sys\bin\hitchcock.dll"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/sis/huitk_debug.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,29 @@
+;
+; 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: 
+;
+
+; UID is the dll's UID
+;
+#{"HUITK DLL"},(0x05BC6D02),1,0,0
+
+; the vendor names are required for EKA2 so uncomment
+; these two lines for S60 3.0 and UIQ 3.x.
+;Localised Vendor name
+%{"Nokia-EN"}
+
+;Unique Vendor name
+:"Nokia"
+
+"\Epoc32\release\armv5\udeb\hitchcock.dll"       -"!:\sys\bin\hitchcock.dll"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/sis/huitk_stub.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,28 @@
+;
+; 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: 
+;
+
+; UID is the dll's UID
+;
+#{"HUITK DLL"},(0x05BC6D02),1,0,0
+
+%{"Nokia-EN"}
+
+;Unique Vendor name
+:"Nokia"
+
+"\epoc32\release\armv5\urel\hitchcock.dll"       -"z:\sys\bin\hitchcock.dll"
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/sis/huitk_update.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,28 @@
+;
+; 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: 
+;
+
+; UID is the dll's UID
+#{"HUITK DLL"},(0x05BC6D02),1,0,0, TYPE=PU
+
+;Localised Vendor name
+%{"Nokia-EN"}
+
+;Unique Vendor name
+:"Nokia"
+
+"\Epoc32\release\armv5\urel\hitchcock.dll"       -"!:\sys\bin\hitchcock.dll"
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/sis/huitk_update_debug.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,29 @@
+;
+; 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: 
+;
+
+; UID is the dll's UID
+;
+#{"HUITK DLL"},(0x05BC6D02),1,0,0, TYPE=PU
+; the vendor names are required for EKA2 so uncomment
+; these two lines for S60 3.0 and UIQ 3.x.
+;Localised Vendor name
+%{"Nokia-EN"}
+
+;Unique Vendor name
+:"Nokia"
+
+"\Epoc32\release\armv5\udeb\hitchcock.dll"       -"!:\sys\bin\hitchcock.dll"
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiAnchorLayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,946 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation for CHuiAnchorLayout. Anchor layouts 
+*                allow specifying the placement of child visuals using 
+*                anchors, that can be relative or absolute coordinates and 
+*                attached to a specific edge of the layout.
+*
+*/
+
+
+
+#include "uiacceltk/HuiAnchorLayout.h"  // Class definition
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiUtil.h"
+
+//
+// Private structures
+//
+
+/*
+ * Anchor that defines an edge's position and/or size. 
+ */
+struct CHuiAnchorLayout::TEdgeAnchor
+    {
+    THuiAnchorProximity iEdgeProximity;
+    THuiMetric iOffset;
+    THuiAnchorProximity iAttachmentProximity;
+    TInt iAttachmentOrdinal;
+    };
+
+/* 
+ * an axis can contain up to two edges
+ */
+struct CHuiAnchorLayout::TAxis
+    {
+public:
+    inline TInt Edge(THuiAnchorProximity aEdgeProximity, TEdgeAnchor*& aEdge) const;
+    inline TInt AddEdge(THuiAnchorProximity aEdgeProximity, TEdgeAnchor*& aEdge);
+    
+public:
+    /** array of edges */
+    TFixedArray<TEdgeAnchor, 2> iEdges;
+    };
+
+inline TInt CHuiAnchorLayout::TAxis::Edge(THuiAnchorProximity aEdgeProximity, TEdgeAnchor*& aEdge) const
+    {
+    TInt error = KErrNotFound;
+    TInt count = iEdges.Count();
+    for(TInt ii = 0; ii < count && error == KErrNotFound ; ii++)
+        {
+        if(iEdges[ii].iEdgeProximity == aEdgeProximity)
+            {
+            aEdge = const_cast<TEdgeAnchor*>(&(iEdges[ii])); // uses the const operator[] as this is a const method
+            error = KErrNone;
+            }
+        }
+    return error;
+    }
+
+TInt CHuiAnchorLayout::TAxis::AddEdge(THuiAnchorProximity aEdgeProximity, TEdgeAnchor*& aEdge)
+    {
+    TInt error = Edge(aEdgeProximity, aEdge);
+    if(error == KErrNotFound)
+        {
+        // we haven't found the one we're looking for, so now look for an empty slot
+        error = Edge(EHuiAnchorProximityNone, aEdge);
+        if(error == KErrNotFound)
+            {
+            // couldn't find an empty slot, so actually we consider that to be an overflow
+            error = KErrOverflow;
+            }
+        }
+    return error;
+    }
+
+
+/*
+ * axes for a given anchor. 
+ *
+ */
+struct CHuiAnchorLayout::TAnchor
+    {
+public:
+    TAxis& Axis(THuiAnchorAxis aAxis) const;
+    
+public:
+    /** 
+     * array of axes indexed by THuiAnchorAxis, each one contains the edges for a given axis
+     */
+    TFixedArray<TAxis, 2> iAxes;
+    };
+
+CHuiAnchorLayout::TAxis& CHuiAnchorLayout::TAnchor::Axis(THuiAnchorAxis aAxis) const
+    {
+    // index is an enumeration and cannot go outside array boundaries.
+    return const_cast<CHuiAnchorLayout::TAxis&>(iAxes[aAxis]);
+    }
+
+
+/*
+ * Internal private data struct.
+ */
+struct CHuiAnchorLayout::THuiAnchorLayoutPrivateData
+    {
+public:
+    THuiAnchorLayoutPrivateData();
+    
+public:
+    /*
+     * Anchors for a given axis, indexed by ordinal. 
+     * @note that if an ordinal is used that is outside the current size of the 
+     * array, then empty items will be filled in up to the ordinal needed. However,
+     * in general ordinals will correspond to indexes of visuals within the layout, 
+     * and therefore we shouldn't expect unreasonable growth of anchors.
+     */
+    RArray<TAnchor> iAnchors;
+    };
+
+CHuiAnchorLayout::THuiAnchorLayoutPrivateData::THuiAnchorLayoutPrivateData()
+    {
+    }
+
+
+
+//
+// Methods for compatibility with deprecated APIs
+//
+
+THuiAnchorType CHuiAnchorLayout::ConvertDeprecatedAnchorTypeToType(THuiAnchor aAnchor) const
+    {
+    THuiAnchorType type;
+    switch(aAnchor)
+        {
+        case EHuiAnchorTopLeft:
+            type = EHuiAnchorTypeTopLeft;
+            break;
+        case EHuiAnchorBottomRight:
+            type = EHuiAnchorTypeBottomRight;
+            break;
+        default:
+            type = EHuiAnchorTypeNone;
+            break;
+        }
+    return type;
+    }
+    
+THuiAnchorAttachmentOrigin CHuiAnchorLayout::ConvertDeprecatedOrginToAttachmentOrigin(THuiAnchorOrigin aOrigin) const
+    {
+    THuiAnchorAttachmentOrigin origin;
+    switch(aOrigin)
+        {
+        case EHuiAnchorOriginLeft:
+            origin = EHuiAnchorAttachmentOriginLeft;
+            break;
+        case EHuiAnchorOriginHCenter:
+            origin = EHuiAnchorAttachmentOriginHCenter;
+            break;
+        case EHuiAnchorOriginRight:
+            origin = EHuiAnchorAttachmentOriginRight;
+            break;
+        case EHuiAnchorOriginTop:
+            origin = EHuiAnchorAttachmentOriginTop;
+            break;
+        case EHuiAnchorOriginVCenter:
+            origin = EHuiAnchorAttachmentOriginVCenter;
+            break;
+        case EHuiAnchorOriginBottom:
+            origin = EHuiAnchorAttachmentOriginBottom;
+            break;
+        default:
+            origin = EHuiAnchorAttachmentOriginNone;
+            break;
+        }
+    return origin;
+    }
+
+THuiAnchorAttachmentOrigin CHuiAnchorLayout::ConvertDeprecatedOriginsToAttachmentOrigin(THuiAnchorOrigin aHorizOrigin, THuiAnchorOrigin aVertOrigin) const
+    {
+    THuiAnchorAttachmentOrigin newHorizAttachmentOrigin = ConvertDeprecatedOrginToAttachmentOrigin(aHorizOrigin);
+    THuiAnchorAttachmentOrigin newVertAttachmentOrigin = ConvertDeprecatedOrginToAttachmentOrigin(aVertOrigin);
+    THuiAnchorAttachmentOrigin origin = THuiAnchorAttachmentOrigin(newHorizAttachmentOrigin | newVertAttachmentOrigin);
+    return origin;
+    }
+
+THuiMetric CHuiAnchorLayout::ConvertDeprecatedAnchorMetricAndTargetToHuiMetric(THuiAnchorMetric aMetric, TReal32 aTarget) const
+    {
+    THuiUnit unit;
+    switch(aMetric)
+        {
+        case EHuiAnchorMetricAbsolute:
+            unit = EHuiUnitPixel;
+            break;
+        case EHuiAnchorMetricRelativeToSize:
+            unit = EHuiUnitRelativeToMySize;
+            break;
+        default:
+            unit = EHuiUnitPixel;
+            break;
+        }
+    THuiMetric metric(aTarget, unit);
+    return metric;
+    }
+
+THuiXYMetric CHuiAnchorLayout::ConvertDeprecatedAnchorMetricsAndOffsetToHuiMetric(
+    THuiAnchorMetric aHorizMetric,
+    THuiAnchorMetric aVertMetric,
+    const THuiTimedPoint& aOffset) const
+    {
+    TReal32 horizTarget = aOffset.iX.Target();
+    TReal32 vertTarget = aOffset.iY.Target();
+    
+    THuiMetric horizMetric = ConvertDeprecatedAnchorMetricAndTargetToHuiMetric(aHorizMetric, horizTarget);
+    THuiMetric vertMetric = ConvertDeprecatedAnchorMetricAndTargetToHuiMetric(aVertMetric, vertTarget);
+    
+    THuiXYMetric metric(horizMetric, vertMetric);
+    return metric;
+    }
+
+//
+// Methods for dealing with internal data types
+//
+
+THuiAnchorProximity CHuiAnchorLayout::ConvertTypeToProximity(THuiAnchorType aType, THuiAnchorAxis& aAxis) const
+    {
+    THuiAnchorProximity proximity;
+    
+    THuiAnchorProximity proximityH = THuiAnchorProximity((aType & EHuiAnchorBitmaskHorizontal) >> EHuiAnchorBitmaskShiftHorizontal);
+    THuiAnchorProximity proximityV = THuiAnchorProximity((aType & EHuiAnchorBitmaskVertical) >> EHuiAnchorBitmaskShiftVertical);
+    if(proximityH)
+        {
+        proximity = proximityH;
+        aAxis = EHuiAnchorAxisHorizontal;
+        }
+    else if(proximityV)
+        {
+        proximity = proximityV;
+        aAxis = EHuiAnchorAxisVertical;
+        }
+    else 
+        {
+        proximity = EHuiAnchorProximityNone;
+        }
+    return proximity;
+    }
+
+THuiAnchorProximity CHuiAnchorLayout::ConvertAttachmentOriginToProximity(THuiAnchorAttachmentOrigin aAttachmentOrigin, THuiAnchorAxis& aAxis) const
+    {
+    THuiAnchorType type = THuiAnchorType(aAttachmentOrigin);
+    return ConvertTypeToProximity(type, aAxis);
+    }
+
+void CHuiAnchorLayout::ConvertCornerToEdges(THuiAnchorType aCorner, THuiAnchorType& aEdgeH, THuiAnchorType& aEdgeV) const
+    {
+    aEdgeH = THuiAnchorType(aCorner & EHuiAnchorBitmaskHorizontal);
+    aEdgeV = THuiAnchorType(aCorner & EHuiAnchorBitmaskVertical);
+    }
+
+void CHuiAnchorLayout::ConvertCornerAttachmentOriginToEdgeAttachmentOrigins(THuiAnchorAttachmentOrigin aCornerOrigin, THuiAnchorAttachmentOrigin& aAttachmentOriginH, THuiAnchorAttachmentOrigin& aAttachmentOriginV) const
+    {
+    aAttachmentOriginH = THuiAnchorAttachmentOrigin(aCornerOrigin & EHuiAnchorBitmaskHorizontal);
+    aAttachmentOriginV = THuiAnchorAttachmentOrigin(aCornerOrigin & EHuiAnchorBitmaskVertical);
+    }
+
+
+//
+// Methods
+//
+
+EXPORT_C CHuiAnchorLayout* CHuiAnchorLayout::AddNewL(CHuiControl& aOwnerControl,
+                                                     CHuiLayout* aParentLayout)
+    {
+    CHuiAnchorLayout* layout = STATIC_CAST(CHuiAnchorLayout*,
+        aOwnerControl.AppendLayoutL(EHuiLayoutTypeAnchor, aParentLayout));
+    return layout;
+    }
+
+
+CHuiAnchorLayout::CHuiAnchorLayout(MHuiVisualOwner& aOwner)
+        : CHuiLayout(aOwner)
+    {
+    }
+
+
+void CHuiAnchorLayout::ConstructL()
+    {
+    CHuiLayout::ConstructL();
+    iHuiAnchorLayoutPrivateData = new (ELeave) THuiAnchorLayoutPrivateData;
+    }
+
+
+EXPORT_C CHuiAnchorLayout::~CHuiAnchorLayout()
+    {
+    Reset();
+    delete iHuiAnchorLayoutPrivateData;
+    }
+
+
+EXPORT_C void CHuiAnchorLayout::Reset()
+    {
+    if ( iHuiAnchorLayoutPrivateData ) // a Fix for OOM situations, tried to dereference NULL pointer
+    	{
+	    for(TInt ii = EHuiAnchorAxisHorizontal; ii <= EHuiAnchorAxisVertical; ii++)
+	        {
+	        iHuiAnchorLayoutPrivateData->iAnchors.Reset();
+	        }
+    	}
+    }
+
+
+EXPORT_C void CHuiAnchorLayout::SetSize(const THuiRealSize& aSize, TInt aTransitionTime)
+    {
+    CHuiLayout::SetSize(aSize, aTransitionTime);
+    if(!(Flags() & EHuiVisualFlagFreezeLayout))
+        {    
+        UpdateChildrenLayout(aTransitionTime);
+        }
+    }
+
+
+EXPORT_C TBool CHuiAnchorLayout::ChildSize(TInt aOrdinal, TSize& aSize)
+    {
+    TBool result(EFalse);
+    THuiRealRect rect;
+    TInt childRectStatus(THuiLayoutChildRectUpdateNotNeeded);
+    childRectStatus = ChildRect(aOrdinal, rect);
+    if(childRectStatus != THuiLayoutChildRectNotImplemented)
+        {
+        result = (childRectStatus & THuiLayoutChildRectSizeUpdateNeeded);
+        if(result)
+            {
+            THuiRealPoint size(rect.Width(), rect.Height());
+            aSize = LocalPointInPixels(size, EHuiReferenceStateTarget).AsSize();
+            }
+        }
+    return result;
+    }
+    
+EXPORT_C TBool CHuiAnchorLayout::ChildPos(TInt aOrdinal, TPoint& aPos)
+    {
+    TBool result(EFalse);
+    THuiRealRect rect;
+    TInt childRectStatus(THuiLayoutChildRectUpdateNotNeeded);
+    childRectStatus = ChildRect(aOrdinal, rect);
+    if(childRectStatus != THuiLayoutChildRectNotImplemented)
+        {
+        result = (childRectStatus & THuiLayoutChildRectPosUpdateNeeded);
+        if(result)
+            {
+            aPos = LocalPointInPixels(rect.iTl, EHuiReferenceStateTarget);
+            }
+        }
+    return result;
+    }
+
+EXPORT_C TInt CHuiAnchorLayout::ChildRect(TInt aOrdinal, THuiRealRect& aRect)
+    {
+    TInt result(THuiLayoutChildRectUpdateNotNeeded);
+
+    // split inner area (in pixels) into separate axes
+    TFixedArray<TReal32, 2> tl;
+    TFixedArray<TReal32, 2> br;
+
+    // evaluate the anchor along each axis in turn
+    if(aOrdinal < iHuiAnchorLayoutPrivateData->iAnchors.Count())
+        {
+        TAnchor& anchor = iHuiAnchorLayoutPrivateData->iAnchors[aOrdinal];
+        for(TInt ii = EHuiAnchorAxisHorizontal; ii <= EHuiAnchorAxisVertical; ii++)
+            {
+            THuiAnchorAxis axisId = THuiAnchorAxis(ii);
+            TAxis& axis = anchor.Axis(axisId);
+            // index is an enumeration and cannot go outside array boundaries
+            result |= EvaluateAxis(axisId, axis, tl[axisId], br[axisId]);
+            }
+        aRect.iTl.iX = tl[EHuiAnchorAxisHorizontal];
+        aRect.iTl.iY = tl[EHuiAnchorAxisVertical];
+        aRect.iBr.iX = br[EHuiAnchorAxisHorizontal];
+        aRect.iBr.iY = br[EHuiAnchorAxisVertical];
+        }
+
+    if(result == THuiLayoutChildRectUpdateNotNeeded)
+        {
+        // No anchor defined at all. Use the default anchor.
+        THuiRealPoint topLeft = InnerTopLeft();
+        THuiRealSize inner = InnerSize();
+        aRect.iTl = topLeft;
+        aRect.iBr.iX = inner.iWidth;
+        aRect.iBr.iY = inner.iHeight;
+        result = THuiLayoutChildRectLayoutUpdateNeeded;
+        }
+
+    return result;
+    }
+
+
+/* 
+ * the values from the paddings are in parent base units, whilst the anchor edges have 
+ * their own units, so we must first convert everything to real pixels, then calculate 
+ * the pixel positions, then convert everything back into base units of this layout visual
+ */
+TInt CHuiAnchorLayout::EvaluateAxis(THuiAnchorAxis aAxisId, const TAxis& aAxis, TReal32& aNear, TReal32& aFar) const
+    {
+    TInt result(THuiLayoutChildRectUpdateNotNeeded);
+    // @todo use cached value if optimization is needed
+
+    // @todo refactorize with CHuiLayout::InnerSize
+    THuiRealRect paddingRectPx = PaddingInPixels(EHuiReferenceStateTarget);
+    THuiRealPoint sizePointPx = LocalPointInPixels(Size().RealTarget(), EHuiReferenceStateTarget);
+    THuiRealPoint innerPaddingPointPx = MetricToPixels(InnerPadding(), EHuiReferenceStateTarget);
+    
+    // switch to near and far along this axis
+    TReal32 nearPx = (aAxisId == EHuiAnchorAxisHorizontal) ? paddingRectPx.iTl.iX : paddingRectPx.iTl.iY;
+    TReal32 farPaddingPx = (aAxisId == EHuiAnchorAxisHorizontal) ? paddingRectPx.iBr.iX : paddingRectPx.iBr.iY;
+    TReal32 sizePx = (aAxisId == EHuiAnchorAxisHorizontal) ? sizePointPx.iX : sizePointPx.iY;
+    TReal32 farPx = sizePx - farPaddingPx;
+    TReal32 innerPaddingPx= (aAxisId == EHuiAnchorAxisHorizontal) ? innerPaddingPointPx.iX : innerPaddingPointPx.iY;
+
+    // these will be the calculated values, which we build up one edge at a time
+    TReal32 nearCalculatedPx(nearPx);
+    TReal32 farCalculatedPx(farPx);
+
+    // we iterate over the edges, but we don't know what order
+    // they were defined, so have to build up the answer as we go
+    TInt count = aAxis.iEdges.Count();
+    for(TInt ii = 0; ii < count; ii++)
+        {
+        const TEdgeAnchor& edge = aAxis.iEdges[ii];
+        if(edge.iEdgeProximity != EHuiAnchorProximityNone)
+            {
+            // now convert this edge anchor's metric offset into pixels
+            TReal32 offsetPx = EdgeOffsetInPixels(aAxisId, edge);
+            result |= EvaluateEdgeAnchorInPixels(aAxisId, edge, innerPaddingPx , offsetPx, nearPx, nearCalculatedPx, farPx, farCalculatedPx);
+            }
+        }
+
+    // Get metric reference, for converting between base units of this layout (from the child visual's perspective) and pixels.
+    // We must calculate metric reference in both directions, but we only need it along this axis
+    THuiRealPoint childMetricRefSizePx = MetricReferenceForLayoutInPixels(BaseUnit().Abs()); // always target reference
+    TReal32 childMetricRefPx = (aAxisId == EHuiAnchorAxisHorizontal) ? childMetricRefSizePx.iX :childMetricRefSizePx.iY;
+        
+    // Convert the result back into child relative coordinates
+    THuiMetric nearCalculated = (aAxisId == EHuiAnchorAxisHorizontal) ? BaseUnit().iX :BaseUnit().iY;
+    THuiMetric farCalculated(nearCalculated);
+    ConvertPixelsToMetricLength(nearCalculated, nearCalculatedPx, childMetricRefPx);
+    ConvertPixelsToMetricLength(farCalculated, farCalculatedPx, childMetricRefPx);
+
+    // back to point and size
+    aNear = nearCalculated.iMagnitude; 
+    aFar = farCalculated.iMagnitude;
+
+    return result;
+    }
+
+TReal32 CHuiAnchorLayout::EdgeOffsetInPixels(THuiAnchorAxis aAxisId, const TEdgeAnchor& aEdge) const
+    {
+    THuiRealPoint offsetRefSizePx = MetricReferenceInPixels(THuiXYMetric(aEdge.iOffset), EHuiReferenceStateTarget);
+    TReal32 offsetRefPx = (aAxisId == EHuiAnchorAxisHorizontal) ? offsetRefSizePx.iX :offsetRefSizePx.iY;
+    TReal32 offsetPx(0);
+    ConvertMetricLengthToPixels(offsetPx, aEdge.iOffset, offsetRefPx);
+    return offsetPx;
+    }
+    
+TInt CHuiAnchorLayout::EvaluateEdgeAnchorInPixels(
+    THuiAnchorAxis aAxisId,
+    const TEdgeAnchor& aEdge,
+    TReal32 aInnerPaddingPx,
+    TReal32 aOffsetPx,
+    TReal32 aNearPx, TReal32& aNearCalculatedPx, 
+    TReal32 aFarPx, TReal32& aFarCalculatedPx) const
+    {
+    TInt result(THuiLayoutChildRectUpdateNotNeeded);
+
+    // first calculate the offset caused if there is an attached anchor
+    TReal32 attachOriginNearCalculatedPx(aNearPx);
+    TReal32 attachOriginFarCalculatedPx(aFarPx);
+    result |= EvaluateEdgeAttachmentInPixels(aAxisId, aEdge, aInnerPaddingPx, aNearPx, attachOriginNearCalculatedPx, aFarPx, attachOriginFarCalculatedPx);
+    
+    TReal32 origDimensionPx = attachOriginFarCalculatedPx - attachOriginNearCalculatedPx;
+    TReal32 nearOriginTransform = attachOriginNearCalculatedPx - aNearPx;
+    TReal32 farOriginTransform = attachOriginFarCalculatedPx - aFarPx;
+
+    // Transform to origin
+    switch(aEdge.iAttachmentProximity)
+        {
+        case EHuiAnchorProximitySize:
+            // @todo not yet implemented
+            return(EFalse);
+        case EHuiAnchorProximityNear:
+            nearOriginTransform = 0;
+            farOriginTransform -= origDimensionPx;
+            break;
+        case EHuiAnchorProximityCenter:
+            nearOriginTransform += origDimensionPx / 2;
+            farOriginTransform -= origDimensionPx / 2;
+            break;
+        case EHuiAnchorProximityFar:
+            nearOriginTransform += origDimensionPx;
+            farOriginTransform = 0;
+            break;
+        default:
+            break;
+        }
+
+    // Apply edge offset.
+    switch(aEdge.iEdgeProximity)
+        {
+        case EHuiAnchorProximitySize:
+            // @todo not yet implemented
+            return(EFalse);
+        case EHuiAnchorProximityNear:
+            aNearCalculatedPx = attachOriginNearCalculatedPx + aOffsetPx + nearOriginTransform;
+            result |= THuiLayoutChildRectPosUpdateNeeded;
+            break;
+        case EHuiAnchorProximityCenter:
+            // @todo not yet implemented
+            return(EFalse);
+        case EHuiAnchorProximityFar:
+            aFarCalculatedPx = attachOriginFarCalculatedPx + aOffsetPx + farOriginTransform;
+            result |= THuiLayoutChildRectSizeUpdateNeeded;
+            break;
+        default:
+            break;
+        }
+
+    return result;
+    }
+
+TInt CHuiAnchorLayout::EvaluateEdgeAttachmentInPixels(
+    THuiAnchorAxis aAxisId,
+    const TEdgeAnchor& aEdge,
+    TReal32 aInnerPaddingPx,
+    TReal32 aNearPx, TReal32& aNearCalculatedPx, 
+    TReal32 aFarPx, TReal32& aFarCalculatedPx) const
+    {
+    TInt result(THuiLayoutChildRectUpdateNotNeeded);
+    
+    // if there is an attachment, follow that
+    if(aEdge.iAttachmentOrdinal != EHuiAnchorAttachToParent)
+        {
+        // retrieve the edge to which we are attached
+        const TAnchor* nextAnchor = Anchor(aEdge.iAttachmentOrdinal); 
+        if(nextAnchor)
+            {
+            // @todo note that with size attachments, the axis id might change here
+            TAxis& nextAxis = nextAnchor->Axis(aAxisId);
+            TEdgeAnchor* nextEdge = NULL;
+            TInt error = nextAxis.Edge(aEdge.iAttachmentProximity, nextEdge);
+            if(error == KErrNone)
+                {
+                // now need to calculate near and far for the attached edge
+                // @todo in the case of size attachments, need to evaluate both next edges
+                TReal32 nextOffsetPx = EdgeOffsetInPixels(aAxisId, *nextEdge);
+                TReal32 attachOriginNearCalculatedPx(aNearPx);
+                TReal32 attachOriginFarCalculatedPx(aFarPx);
+                result |= EvaluateEdgeAnchorInPixels(aAxisId, *nextEdge, aInnerPaddingPx , nextOffsetPx, aNearPx, attachOriginNearCalculatedPx, aFarPx, attachOriginFarCalculatedPx);
+ 
+                switch(aEdge.iAttachmentProximity)
+                    {
+                    case EHuiAnchorProximitySize:
+                         // @todo not yet implemented
+                        return(EFalse);
+                    case EHuiAnchorProximityNear:
+                        aNearCalculatedPx =  attachOriginNearCalculatedPx + aInnerPaddingPx;
+                        break;
+                    case EHuiAnchorProximityCenter:
+                        aNearCalculatedPx = (attachOriginNearCalculatedPx + attachOriginFarCalculatedPx + aInnerPaddingPx) / 2;
+                        aFarCalculatedPx = aNearCalculatedPx;
+                        break;
+                    case EHuiAnchorProximityFar:
+                        aFarCalculatedPx = attachOriginFarCalculatedPx - aInnerPaddingPx;
+                        break;
+                    default:
+                        break;                    
+                    }
+                }
+            }
+        }
+    return result;
+    }
+    
+const CHuiAnchorLayout::TAnchor* CHuiAnchorLayout::Anchor(TInt aOrdinal) const
+    {
+    TAnchor* anchor(NULL);
+    if(aOrdinal < iHuiAnchorLayoutPrivateData->iAnchors.Count())
+        {
+        anchor = &(iHuiAnchorLayoutPrivateData->iAnchors[aOrdinal]);
+        }
+    return anchor;
+    }
+
+EXPORT_C TInt CHuiAnchorLayout::SetRelativeAnchorRect
+        (TInt aOrdinal,
+         THuiAnchorOrigin aTlHorizOrigin,
+         THuiAnchorOrigin aTlVertOrigin,
+         const THuiRealPoint& aTopLeftOffset,
+         THuiAnchorOrigin aBrHorizOrigin,
+         THuiAnchorOrigin aBrVertOrigin,
+         const THuiRealPoint& aBottomRightOffset)
+    {
+    // Create top left anchor first
+    TInt error = SetAnchor(
+        EHuiAnchorTopLeft, 
+        aOrdinal, 
+        aTlHorizOrigin, 
+        aTlVertOrigin,
+        EHuiAnchorMetricRelativeToSize, 
+        EHuiAnchorMetricRelativeToSize,
+        THuiTimedPoint(aTopLeftOffset.iX, aTopLeftOffset.iY));
+
+    // if TL is OK, create BR anchor
+    if ( error == KErrNone )
+        {
+        error = SetAnchor(
+            EHuiAnchorBottomRight, 
+            aOrdinal, 
+            aBrHorizOrigin, 
+            aBrVertOrigin,
+            EHuiAnchorMetricRelativeToSize, 
+            EHuiAnchorMetricRelativeToSize,
+            THuiTimedPoint(aBottomRightOffset.iX, aBottomRightOffset.iY));
+        
+        // If BR fails try to roll back by removing the TL anchor.
+        if ( error != KErrNone )
+            {
+            RemoveAnchor( EHuiAnchorTopLeft, aOrdinal );
+            }
+        }
+    return error;
+    }
+    
+EXPORT_C TInt CHuiAnchorLayout::SetAnchor(THuiAnchor aAnchor, TInt aOrdinal,
+                                          THuiAnchorOrigin aHorizOrigin,
+                                          THuiAnchorOrigin aVertOrigin,
+                                          THuiAnchorMetric aHorizMetric,
+                                          THuiAnchorMetric aVertMetric,
+                                          const THuiTimedPoint& aOffset)
+    {
+    // convert deprecated API call into new format
+    THuiAnchorType newType = ConvertDeprecatedAnchorTypeToType(aAnchor);
+    THuiAnchorAttachmentOrigin newAttachmentOrigin = ConvertDeprecatedOriginsToAttachmentOrigin(aHorizOrigin, aVertOrigin);
+    THuiXYMetric newOffset = ConvertDeprecatedAnchorMetricsAndOffsetToHuiMetric(aHorizMetric, aVertMetric, aOffset);
+    return Attach(aOrdinal, newType, newOffset, newAttachmentOrigin, EHuiAnchorAttachToParent);
+    }
+
+
+EXPORT_C void CHuiAnchorLayout::RemoveAnchor(THuiAnchor aAnchor, TInt aOrdinal)
+    {
+    // convert deprecated API call into new format
+    THuiAnchorType newType = ConvertDeprecatedAnchorTypeToType(aAnchor);
+    Detach(aOrdinal, newType);
+    }
+
+EXPORT_C TInt CHuiAnchorLayout::Attach(
+    TInt aOrdinal,
+    THuiAnchorType aType, 
+    const THuiMetric& aOffset,
+    THuiAnchorAttachmentOrigin aAttachmentOrigin,
+    TInt aAttachmentOrdinal)
+    {
+    TInt error = KErrNone;
+    
+    // ensure that it's an edge
+    THuiAnchorType edgeH;
+    THuiAnchorType edgeV;
+    ConvertCornerToEdges(aType, edgeH, edgeV);
+    TBool bothAxes = (edgeH != EHuiAnchorTypeNone) && (edgeV != EHuiAnchorTypeNone);
+    if(bothAxes)
+            {
+        return KErrArgument;
+            }
+    
+    THuiAnchorAxis axisId(EHuiAnchorAxisHorizontal);
+    THuiAnchorProximity edgeProximity = ConvertTypeToProximity(aType, axisId);
+    THuiAnchorProximity attachmentProximity = ConvertAttachmentOriginToProximity(aAttachmentOrigin, axisId);
+
+    // size currently not supported, center only supported for attachment proximity
+    TBool sizeProx = (edgeProximity == EHuiAnchorProximitySize) || (attachmentProximity == EHuiAnchorProximitySize);
+    TBool centerProx = (edgeProximity == EHuiAnchorProximityCenter);
+    if(sizeProx || centerProx)
+        {
+        return KErrArgument;
+        }
+
+    // avoid issue of Anchor() returning pointer to const
+    TAnchor* anchor(NULL);
+    TInt count = iHuiAnchorLayoutPrivateData->iAnchors.Count();
+    if(aOrdinal < count)
+        {
+        anchor = &(iHuiAnchorLayoutPrivateData->iAnchors[aOrdinal]);
+        }
+    else
+        {
+        // Create a new anchor. Fill any gaps.
+        for(TInt ii = count; ii <= aOrdinal; ii++)
+            {
+            TInt appendError = iHuiAnchorLayoutPrivateData->iAnchors.Append(TAnchor());
+            if ( appendError != KErrNone )
+                {
+                return appendError;
+                }
+            anchor = &(iHuiAnchorLayoutPrivateData->iAnchors[ii]);
+            Mem::FillZ(anchor, sizeof(*anchor));
+            }
+        }
+        
+    TEdgeAnchor* edge(NULL);
+    TAxis& axis = anchor->Axis(axisId);
+    error = axis.AddEdge(edgeProximity, edge);
+    if(error == KErrNone)
+        {
+        edge->iEdgeProximity = edgeProximity;
+        edge->iOffset = aOffset;
+        edge->iAttachmentProximity = attachmentProximity;
+        edge->iAttachmentOrdinal = aAttachmentOrdinal;
+
+        // ensure that the attachment doesn't attach an edge to itself, 
+        // however we don't need to do anything additional here, as this will
+        // be checked automatically when we check for cycles.
+        
+        // ensure that adding the attachment will not cause a circular dependency...
+        if(CheckForCycles(axisId, edgeProximity, aOrdinal, edge))
+            {
+            edge->iEdgeProximity = EHuiAnchorProximityNone;
+            error = KErrArgument;
+            }
+        }
+    
+    return error;
+    }
+
+EXPORT_C TInt CHuiAnchorLayout::Attach(
+    TInt aOrdinal,
+    THuiAnchorType aType, 
+    const THuiXYMetric& aOffset,
+    THuiAnchorAttachmentOrigin aAttachmentOrigin,
+    TInt aAttachmentOrdinal)
+        {
+    // ensure that it's a corner
+    THuiAnchorType typeH;
+    THuiAnchorType typeV;
+    ConvertCornerToEdges(aType, typeH, typeV);
+    TBool bothAxes = (typeH != EHuiAnchorTypeNone) && (typeV != EHuiAnchorTypeNone);
+    if(!bothAxes)
+        {
+        return KErrArgument;
+        }
+
+    // split the corner into two edges
+    THuiAnchorAttachmentOrigin attachmentOriginH;
+    THuiAnchorAttachmentOrigin attachmentOriginV;
+    ConvertCornerAttachmentOriginToEdgeAttachmentOrigins(aAttachmentOrigin, attachmentOriginH, attachmentOriginV);
+            
+    TInt error = Attach(aOrdinal, typeH, aOffset.iX, attachmentOriginH, aAttachmentOrdinal);
+
+    // if H is OK, create V
+    if ( error == KErrNone )
+        {
+        error = Attach(aOrdinal, typeV, aOffset.iY, attachmentOriginV, aAttachmentOrdinal);
+        // If V fails try to roll back by removing H
+        if ( error != KErrNone )
+            {
+            Detach(aOrdinal, typeH);
+            }
+        }
+    
+    return error;
+    }
+
+EXPORT_C TInt CHuiAnchorLayout::Attach(
+    TInt aOrdinal,
+    const THuiBoxMetric& aOffset,
+    THuiAnchorAttachmentOrigin aAttachmentOrigin,
+    TInt aAttachmentOrdinal)
+    {
+    // first detach all other edges
+    Detach(aOrdinal);
+    
+    // if no attachment origin is specified, interpret this as meaning "attach each edge to its neighbour's corresponding edge"
+    THuiAnchorAttachmentOrigin leftAttachmentOrigin = (aAttachmentOrigin == EHuiAnchorAttachmentOriginNone) ? EHuiAnchorAttachmentOriginLeft : aAttachmentOrigin;
+    THuiAnchorAttachmentOrigin rightAttachmentOrigin = (aAttachmentOrigin == EHuiAnchorAttachmentOriginNone) ? EHuiAnchorAttachmentOriginRight : aAttachmentOrigin;
+    THuiAnchorAttachmentOrigin topAttachmentOrigin = (aAttachmentOrigin == EHuiAnchorAttachmentOriginNone) ? EHuiAnchorAttachmentOriginTop : aAttachmentOrigin;
+    THuiAnchorAttachmentOrigin bottomAttachmentOrigin = (aAttachmentOrigin == EHuiAnchorAttachmentOriginNone) ? EHuiAnchorAttachmentOriginBottom : aAttachmentOrigin;
+        
+    // just attach all four edges separately
+    TInt error = Attach(aOrdinal, EHuiAnchorTypeLeft, aOffset.iLeft, leftAttachmentOrigin, aAttachmentOrdinal);
+    if ( error == KErrNone )
+        {
+        error = Attach(aOrdinal, EHuiAnchorTypeRight, aOffset.iRight, rightAttachmentOrigin, aAttachmentOrdinal);
+        if ( error == KErrNone )
+            {
+            error = Attach(aOrdinal, EHuiAnchorTypeTop, aOffset.iTop, topAttachmentOrigin, aAttachmentOrdinal);
+            if ( error == KErrNone )
+                {
+                error = Attach(aOrdinal, EHuiAnchorTypeBottom, aOffset.iBottom, bottomAttachmentOrigin, aAttachmentOrdinal);
+                // if any of them fail, roll back the ones we've already added, unwinding as we go
+                if ( error != KErrNone )
+                    {
+                    DetachEdge(aOrdinal, EHuiAnchorTypeBottom);
+                    }
+                }
+            if ( error != KErrNone )
+                {
+                DetachEdge(aOrdinal, EHuiAnchorTypeTop);
+                }
+            }
+        if ( error != KErrNone )
+            {
+            DetachEdge(aOrdinal, EHuiAnchorTypeRight);
+            }
+        }
+    if ( error != KErrNone )
+        {
+        DetachEdge(aOrdinal, EHuiAnchorTypeLeft);
+        }
+    return error;
+    }
+
+EXPORT_C void CHuiAnchorLayout::Detach(TInt aOrdinal)
+    {
+    if(aOrdinal < iHuiAnchorLayoutPrivateData->iAnchors.Count())
+        {
+        TAnchor& anchor = iHuiAnchorLayoutPrivateData->iAnchors[aOrdinal];
+        for(TInt axisId = EHuiAnchorAxisHorizontal; axisId <= EHuiAnchorAxisVertical; axisId++)
+            {
+            TAxis& axis = anchor.Axis(THuiAnchorAxis(axisId));
+            TInt count = axis.iEdges.Count();
+            for(TInt ii = 0; ii < count; ii++)
+                {
+                TEdgeAnchor& edge = axis.iEdges[ii];
+                edge.iEdgeProximity = EHuiAnchorProximityNone; 
+                edge.iOffset = THuiMetric();
+                edge.iAttachmentProximity = EHuiAnchorProximityNone;
+                edge.iAttachmentOrdinal = EHuiAnchorAttachToParent;
+                }
+            }
+        }
+    }
+    
+EXPORT_C void CHuiAnchorLayout::Detach(TInt aOrdinal, THuiAnchorType aType)
+    {
+    // split into edges
+    THuiAnchorType typeH;
+    THuiAnchorType typeV;
+    ConvertCornerToEdges(aType, typeH, typeV);
+    if(typeH != EHuiAnchorTypeNone)
+        {
+        DetachEdge(aOrdinal, typeH);
+        }
+    if(typeV != EHuiAnchorTypeNone)
+        {
+        DetachEdge(aOrdinal, typeV);
+        }
+    }
+
+void CHuiAnchorLayout::DetachEdge(TInt aOrdinal, THuiAnchorType aType)
+    {
+    // Try to find an existing edge anchor entry for this
+    TEdgeAnchor* edge(NULL);
+    THuiAnchorAxis axisId(EHuiAnchorAxisHorizontal);
+    THuiAnchorProximity edgeProximity = ConvertTypeToProximity(aType, axisId);
+
+    // avoid issue of Anchor() returning pointer to const
+    TAnchor* anchor(NULL);
+    if(aOrdinal < iHuiAnchorLayoutPrivateData->iAnchors.Count())
+        {
+        anchor = &(iHuiAnchorLayoutPrivateData->iAnchors[aOrdinal]);
+        TAxis& axis = anchor->Axis(axisId);
+        TInt error = axis.Edge(edgeProximity, edge);
+        if(error == KErrNone)
+            {
+            edge->iEdgeProximity = EHuiAnchorProximityNone; 
+            edge->iOffset = THuiMetric();
+            edge->iAttachmentProximity = EHuiAnchorProximityNone;
+            edge->iAttachmentOrdinal = EHuiAnchorAttachToParent;
+            }
+        }
+    }
+
+/*
+ * The model of anchors attached to other anchors should represent a directed 
+ * acyclic graph (DAG), so check that insertion of a new attachment (/edge) does not 
+ * cause a cycle. 
+ * 
+ * @note This method assumes that all previous insertion attempts have maintained 
+ *               the DAG property.
+ * @note This method is implemented using a depth first recursive tree search. 
+ * @note Because there can be only one attachment (which is along a specfic axis) starting 
+ *              at each edge, it is not necessary to keep a visited list.
+ */
+TBool CHuiAnchorLayout::CheckForCycles(
+    THuiAnchorAxis aStartAxisId,
+    THuiAnchorProximity aStartAnchorProximity,
+    TInt aStartOrdinal, 
+    const TEdgeAnchor* aEdge) const
+    {
+    TInt nextOrdinal = aEdge->iAttachmentOrdinal;
+    if(nextOrdinal == EHuiAnchorAttachToParent)
+        {
+        // we've found the end of a path, as this corner attaches to the parent.
+        return EFalse;
+        }
+
+    const TAnchor* nextAnchor = Anchor(nextOrdinal); 
+    if(!nextAnchor)
+        {
+        // anchor not specified, so we've found the end of a path
+        return EFalse;
+        }
+
+    // @todo note that with size attachments, the axis might change here
+    TAxis& nextAxis = nextAnchor->Axis(aStartAxisId);
+    TEdgeAnchor* nextEdge = NULL;
+    TInt error = nextAxis.Edge(aEdge->iAttachmentProximity, nextEdge);
+
+    // @todo, when implementing size attachments, need to evaluate both edges at this point
+    // in order to determine the dependencies for this edge
+    if(error != KErrNone)
+        {
+        return EFalse;
+        }
+
+    // so we now know the next proximity, and the next anchor.
+    if(aStartAnchorProximity == nextEdge->iEdgeProximity && aStartOrdinal == nextOrdinal)
+        {
+        // we have found a cycle!
+        // note that this will also detect an attempt to attach to the same edge on same ordinal
+        return ETrue;
+        }
+    else
+        {
+        return CheckForCycles(aStartAxisId, aStartAnchorProximity, aStartOrdinal, nextEdge);
+        }
+    }
+
+// end of file        
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiAnimatedTexture.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiAnimatedTexture base class, the base class
+*                for application-specific animated textures.
+*
+*/
+
+
+
+#include "uiacceltk/HuiAnimatedTexture.h" // Class definition
+#include "uiacceltk/HuiTextureManager.h"
+#include "uiacceltk/HuiTextureHandle.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiStatic.h"
+
+
+EXPORT_C CHuiAnimatedTexture::CHuiAnimatedTexture(CHuiTextureManager& aManager)
+        : iManager(aManager)
+    {
+    }
+
+
+EXPORT_C void CHuiAnimatedTexture::BaseConstructL()
+    {
+    iTexture = CHuiStatic::Renderer().CreateTextureL();
+
+    // Register automatically for time updates.
+    iManager.iAnimatedTextures.AppendL(*this);
+    }
+
+
+EXPORT_C CHuiAnimatedTexture::~CHuiAnimatedTexture()
+    {
+    iManager.iAnimatedTextures.RemoveIfFound(*this);
+
+    delete iTexture;
+    }
+
+
+EXPORT_C CHuiTexture& CHuiAnimatedTexture::Texture()
+    {
+    return *iTexture;
+    }
+    
+    
+EXPORT_C MHuiSegmentedTexture* CHuiAnimatedTexture::SegmentedTexture()
+    {
+    return this;
+    }
+    
+    
+EXPORT_C MHuiShadowedTexture* CHuiAnimatedTexture::ShadowedTexture()
+    {
+    return NULL;
+    }
+
+
+EXPORT_C const MHuiSegmentedTexture* CHuiAnimatedTexture::SegmentedTexture() const
+    {
+    return this;
+    }
+    
+    
+EXPORT_C const MHuiShadowedTexture* CHuiAnimatedTexture::ShadowedTexture() const
+    {
+    return NULL;
+    }
+    
+
+EXPORT_C TBool CHuiAnimatedTexture::HasContent() const
+    {
+    return iTexture->HasContent();
+    }
+
+
+EXPORT_C TSize CHuiAnimatedTexture::Size() const
+    {
+    return iTexture->Size();
+    }
+
+
+EXPORT_C TInt CHuiAnimatedTexture::SegmentCount() const
+    {
+    return iTexture->SegmentCount();
+    }
+
+
+EXPORT_C TUint CHuiAnimatedTexture::SegmentName(TInt aSegment) const
+    {
+    return iTexture->SegmentName(aSegment);
+    }
+
+
+EXPORT_C TSize CHuiAnimatedTexture::SegmentSize(TInt aSegment) const
+    {
+    return iTexture->SegmentSize(aSegment);
+    }
+
+
+EXPORT_C TSize CHuiAnimatedTexture::SegmentTextureSize(TInt aSegment) const
+    {
+    return iTexture->SegmentTextureSize(aSegment);
+    }
+
+
+EXPORT_C TPoint CHuiAnimatedTexture::SegmentOffset(TInt aSegment) const
+    {
+    return iTexture->SegmentOffset(aSegment);
+    }
+    
+EXPORT_C TBool CHuiAnimatedTexture::TextureChanged() const
+    {
+    if (iTexture)
+        {
+        return iTexture->TextureChanged();    
+        }
+    return EFalse;
+    }
+
+EXPORT_C void CHuiAnimatedTexture::TextureClearChanged() const
+    {
+    if (iTexture)
+        {
+        iTexture->TextureClearChanged();    
+        }
+    return;
+    }
+
+EXPORT_C void CHuiAnimatedTexture::TextureExtension(const TUid& /*aExtensionUid*/, TAny** /*aExtensionParameters*/)
+    {
+    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiBorderBrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,227 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiBorderBrush class - a brush that draws 
+*                a border at the edges of visuals.
+*
+*/
+
+
+
+#include "uiacceltk/HuiBorderBrush.h"  // Class definition
+#include "uiacceltk/HuiDrawing.h"
+#include "uiacceltk/HuiVisual.h"
+
+
+EXPORT_C CHuiBorderBrush* CHuiBorderBrush::NewL(
+                      TInt aThicknessWidth, TInt aThicknessHeight,
+                      TInt aEdgeOffsetX, TInt aEdgeOffsetY)
+    {
+    CHuiBorderBrush* self = NewLC(aThicknessWidth, aThicknessHeight,
+                                  aEdgeOffsetX, aEdgeOffsetY);
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+EXPORT_C CHuiBorderBrush* CHuiBorderBrush::NewLC(
+                       TInt aThicknessWidth, TInt aThicknessHeight,
+                       TInt aEdgeOffsetX, TInt aEdgeOffsetY)
+    {
+    CHuiBorderBrush* self = new (ELeave)
+        CHuiBorderBrush(aThicknessWidth, aThicknessHeight,
+                        aEdgeOffsetX, aEdgeOffsetY);
+    CleanupStack::PushL(self);
+    return self;
+    }
+
+
+CHuiBorderBrush::CHuiBorderBrush(TInt aThicknessWidth, TInt aThicknessHeight,
+                                 TInt aEdgeOffsetX, TInt aEdgeOffsetY)
+        : CHuiBrush(),
+          iColor(KRgbWhite),
+          iThickness( TReal32(aThicknessWidth), TReal32(aThicknessHeight)),
+          iEdgeOffset( TReal32(aEdgeOffsetX), TReal32(aEdgeOffsetY))
+    {
+    SetClipToVisual(EFalse);
+    }
+
+EXPORT_C CHuiBorderBrush* CHuiBorderBrush::NewL(const THuiXYMetric& aThickness,
+                                                const THuiXYMetric& aEdgeOffset)
+    {
+    CHuiBorderBrush* self = NewLC(aThickness, aEdgeOffset);
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+EXPORT_C CHuiBorderBrush* CHuiBorderBrush::NewLC(const THuiXYMetric& aThickness,
+                                                 const THuiXYMetric& aEdgeOffset)
+    {
+    CHuiBorderBrush* self = new (ELeave)
+        CHuiBorderBrush(aThickness, aEdgeOffset);
+    CleanupStack::PushL(self);
+    return self;
+    }
+
+
+CHuiBorderBrush::CHuiBorderBrush(const THuiXYMetric& aThickness,
+                                 const THuiXYMetric& aEdgeOffset)
+        : CHuiBrush(),
+          iColor(KRgbWhite),
+          iThickness(aThickness.iX.iMagnitude, aThickness.iY.iMagnitude),
+          iEdgeOffset(aEdgeOffset.iX.iMagnitude, aEdgeOffset.iY.iMagnitude),
+          iThicknessMetric(aThickness),
+          iEdgeOffsetMetric(aEdgeOffset)
+    {
+    SetClipToVisual(EFalse);
+    }
+
+    
+CHuiBorderBrush::~CHuiBorderBrush()
+    {
+    }
+
+
+EXPORT_C void CHuiBorderBrush::SetImage(const THuiImage& aImage)
+    {
+    iImage = aImage;
+    SetChanged();
+    }
+
+
+EXPORT_C void CHuiBorderBrush::SetColor(const TRgb& aColor)
+    {
+    iColor = aColor;
+    SetChanged();
+    }
+
+EXPORT_C void CHuiBorderBrush::SetThickness(const THuiXYMetric& aThickness)
+    {
+    iThicknessMetric = aThickness;
+    iThickness.iX.Set(aThickness.iX.iMagnitude);    
+    iThickness.iY.Set(aThickness.iY.iMagnitude);    
+    }
+
+EXPORT_C void CHuiBorderBrush::SetEdgeOffset(const THuiXYMetric& aEdgeOffset)
+    {
+    iEdgeOffsetMetric = aEdgeOffset;
+    iEdgeOffset.iX.Set(aEdgeOffset.iX.iMagnitude);    
+    iEdgeOffset.iY.Set(aEdgeOffset.iY.iMagnitude);            
+    }
+
+EXPORT_C void CHuiBorderBrush::SetImageOffset(const THuiXYMetric& aImageOffset)
+    {
+    iImageOffsetMetric = aImageOffset;
+    iImageOffset.iX.Set(aImageOffset.iX.iMagnitude);    
+    iImageOffset.iY.Set(aImageOffset.iY.iMagnitude);                    
+    }
+
+
+TBool CHuiBorderBrush::Changed() const
+    {
+    if ( CHuiBrush::Changed() )
+        {
+        return ETrue;
+        }
+    return iThickness.Changed() || iEdgeOffset.Changed() || iImageOffset.Changed() || iImage.Changed();
+    }
+
+void CHuiBorderBrush::ClearChanged()
+    {
+    CHuiBrush::ClearChanged();
+    iThickness.ClearChanged();
+    iEdgeOffset.ClearChanged();
+    iImageOffset.ClearChanged();
+    iImage.ClearChanged();
+    }
+
+void CHuiBorderBrush::ExpandVisualRect(TRect& aRect) const
+    {
+    // We need access to visual to convert metric units into pixels,
+    // currently a pointer to visual is provided through separate
+    // method since we want to avoid breaking binary compatibility 
+    // of this class.
+    THuiRealPoint edgeOffsetInPixels = EdgeOffsetInPixels(BrushGuide());
+    aRect.Grow((TInt)edgeOffsetInPixels.iX,
+               (TInt)edgeOffsetInPixels.iY);    
+    }
+
+
+void CHuiBorderBrush::Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const
+    {
+    THuiRealRect content = aGuide.BrushRect();
+    TReal32 opacity = aGuide.BrushOpacity() * iOpacity.Now();
+    
+    THuiRealPoint edgeOffsetInPixels = EdgeOffsetInPixels(BrushGuide());
+    THuiRealPoint thicknessInPixels = ThicknessInPixels(BrushGuide());
+    THuiRealPoint imageOffsetInPixels = ImageOffsetInPixels(BrushGuide());
+
+    aGc.SetPenColor(iColor);
+    aGc.SetPenAlpha(TInt(opacity * 255));
+
+    if(iImage.HasTexture())
+        {
+        aGc.Enable(CHuiGc::EFeatureTexturing);
+        iImage.Texture().Bind();
+        }
+    else
+        {
+        aGc.Disable(CHuiGc::EFeatureTexturing);
+        }
+    aGc.Enable(CHuiGc::EFeatureBlending);
+
+    // Apply the texture offset manually.
+    aGc.Push(EHuiGcMatrixTexture);
+    aGc.LoadIdentity(EHuiGcMatrixTexture);
+    aGc.Translate(EHuiGcMatrixTexture, 
+                    -imageOffsetInPixels.iX, -imageOffsetInPixels.iY, 0.f);
+
+    content.Grow(edgeOffsetInPixels.iX, edgeOffsetInPixels.iY);
+        
+    aGc.DrawBorders(content.Round(), 
+                    thicknessInPixels.iX, thicknessInPixels.iX,
+                    thicknessInPixels.iY, thicknessInPixels.iY,
+                    CHuiGc::EBorderFixedCorners, 
+                    &iImage);
+
+    aGc.Pop(EHuiGcMatrixTexture);
+    }
+
+THuiRealPoint CHuiBorderBrush::ThicknessInPixels(const CHuiVisual* aVisual) const 
+    {
+    return PointInPixels(aVisual, iThickness, iThicknessMetric);    
+    }
+
+THuiRealPoint CHuiBorderBrush::EdgeOffsetInPixels(const CHuiVisual* aVisual) const 
+    {
+    return PointInPixels(aVisual, iEdgeOffset, iEdgeOffsetMetric);            
+    }
+
+THuiRealPoint CHuiBorderBrush::ImageOffsetInPixels(const CHuiVisual* aVisual) const 
+    {
+    return PointInPixels(aVisual, iImageOffset, iImageOffsetMetric);            
+    }
+
+THuiRealPoint CHuiBorderBrush::PointInPixels(const CHuiVisual* aVisual, const THuiTimedPoint& aPoint, const THuiXYMetric& aMetric) const 
+    {
+    THuiRealPoint pointInPixels = aPoint.RealNow(); // Init, if no visual available for conversion then defaults to pixels
+    if (aVisual)
+        {
+        THuiXYMetric metric = aMetric;
+        metric.iX.iMagnitude = pointInPixels.iX;        
+        metric.iY.iMagnitude = pointInPixels.iY;        
+        pointInPixels = aVisual->MetricToPixels(metric); // Convert metric width in pixels  
+        }    
+    return pointInPixels;                    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiBrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiBrush. Brushes augment visuals with 
+*                graphical effects.
+*
+*/
+
+
+
+#include "uiacceltk/HuiBrush.h"
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiVisual.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiProbe.h"
+#include "uiacceltk/HuiUtil.h"
+
+
+EXPORT_C CHuiBrush::CHuiBrush()
+        : iOpacity(1.0f), iEnabled(ETrue), iChanged(EFalse) 
+    {
+    HUI_PROBE_ASSOCIATE_WITH_CURRENT_SESSION
+    HUI_PROBE_REPORT_CONSTRUCTED
+    }
+
+
+EXPORT_C CHuiBrush::~CHuiBrush()
+    {
+    iGuideVisual = NULL;
+    
+    HUI_PROBE_REPORT_DESTRUCTED
+    }
+    
+    
+EXPORT_C void CHuiBrush::ExpandVisualRect(TRect& /*aRect*/) const
+    {
+    // The brush does not expand the rectangle by default.
+    }
+    
+    
+EXPORT_C void CHuiBrush::SetChanged()
+    {
+    iChanged = ETrue;
+    }
+
+
+EXPORT_C TBool CHuiBrush::Changed() const
+    {
+    if ( iChanged )
+        {
+        return ETrue;
+        }
+    
+    return iOpacity.Changed();
+    }
+    
+EXPORT_C void CHuiBrush::ClearChanged()
+    {
+    iChanged = EFalse;
+    iOpacity.ClearChanged();
+    }
+
+
+EXPORT_C void CHuiBrush::SetClipToVisual(TBool aClipToVisual)
+    {
+    iClipToVisual = aClipToVisual;
+    }
+    
+    
+EXPORT_C TBool CHuiBrush::ClipToVisual() const
+    {
+    return iClipToVisual;
+    }
+    
+
+EXPORT_C void CHuiBrush::SetLayer(THuiBrushLayer aLayer)
+    {
+    iLayer = aLayer;
+    }
+    
+
+EXPORT_C THuiBrushLayer CHuiBrush::Layer() const
+    {
+    return iLayer;
+    }
+    
+    
+EXPORT_C void CHuiBrush::BeginDraw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const
+    {
+    if(iClipToVisual)
+        {
+        // Visual content clipping is affected by transformation.
+        aGc.PushClip();
+        aGc.Clip(aGuide.BrushRect());
+        }
+    }
+
+
+EXPORT_C void CHuiBrush::Draw(CHuiGc& /*aGc*/, const MHuiBrushGuide& /*aGuide*/) const
+    {
+    }
+
+
+EXPORT_C void CHuiBrush::EndDraw(CHuiGc& aGc, const MHuiBrushGuide& /*aGuide*/) const
+    {
+    if(iClipToVisual)
+        {
+        // Visual content clipping is affected by transformation.
+        aGc.PopClip();
+        }
+
+    iChanged = EFalse;
+    }
+
+
+HUI_SESSION_OBJECT_IMPL_EXPORT(CHuiBrush, ETypeBrush)
+
+EXPORT_C void CHuiBrush::BrushExtension(const TUid& /*aExtensionUid*/, TAny** /*aExtensionParameters*/)
+    {
+    }
+    
+void CHuiBrush::ActivateBrushGuide(const CHuiVisual* aNewGuide) const
+    {
+    iGuideVisual = const_cast<CHuiVisual*>(aNewGuide);     
+    }
+
+CHuiVisual* CHuiBrush::BrushGuide() const
+    {
+    return iGuideVisual;     
+    }
+                                                         
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiBrushArray.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,259 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "uiacceltk/HuiBrushArray.h"
+#include "uiacceltk/HuiVisual.h"
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiPanic.h"
+
+
+EXPORT_C CHuiBrushArray* CHuiBrushArray::NewL()
+    {
+    CHuiBrushArray* self = NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+    
+    
+EXPORT_C CHuiBrushArray* CHuiBrushArray::NewLC()
+    {
+    CHuiBrushArray* self = new (ELeave) CHuiBrushArray();
+    CleanupStack::PushL(self);
+    return self;
+    }
+
+
+CHuiBrushArray::CHuiBrushArray()
+    {
+    }
+    
+  
+EXPORT_C CHuiBrushArray::~CHuiBrushArray()
+    {
+    Reset();
+    }
+  
+    
+EXPORT_C void CHuiBrushArray::Reset()
+    {
+    iElements.ResetAndDestroy();
+    }
+
+
+EXPORT_C void CHuiBrushArray::AppendL(CHuiBrush* aBrush, THuiOwnership aOwnership)
+    {
+    if (!aBrush) // RArrayElement can't handle null ptr correctly in all cases
+        {
+        User::Leave(KErrArgument);
+        }
+        
+    RArrayElement* element = new (ELeave) RArrayElement();
+    CleanupStack::PushL(element);
+    User::LeaveIfError(iElements.Append(element));
+    CleanupStack::Pop(element);
+    
+    element->Set(aBrush, aOwnership);
+    }
+
+
+EXPORT_C void CHuiBrushArray::InsertL(TInt aPos, CHuiBrush* aBrush, 
+                                      THuiOwnership aOwnership)
+    {
+    if (!aBrush) // RArrayElement can't handle null ptr correctly in all cases
+        {
+        User::Leave(KErrArgument);
+        }
+
+    RArrayElement* element = new (ELeave) RArrayElement();
+    CleanupStack::PushL(element);
+    User::LeaveIfError(iElements.Insert(element, aPos));
+    CleanupStack::Pop(element);
+    
+    element->Set(aBrush, aOwnership);
+    }
+
+
+EXPORT_C void CHuiBrushArray::Remove(TInt aPos)
+    {
+    if ( aPos >= Count() )
+        {
+        // if does not exist, just return
+        return;
+        }
+    delete iElements[aPos];
+    iElements.Remove(aPos);
+    }
+
+
+EXPORT_C TInt CHuiBrushArray::Count() const
+    {
+    return iElements.Count();
+    }
+    
+    
+EXPORT_C CHuiBrush& CHuiBrushArray::operator [] (TInt aPos)
+    {
+    return iElements[aPos]->Ref();
+    }
+    
+    
+EXPORT_C CHuiBrush& CHuiBrushArray::At(TInt aPos)
+    {
+    return iElements[aPos]->Ref();
+    }
+
+
+EXPORT_C void CHuiBrushArray::Draw(THuiBrushLayer aLayer, CHuiGc& aGc, 
+                                   const MHuiBrushGuide& aGuide) const
+    {
+    TInt layerBrushCount = LayerBrushCount(aLayer);
+    TInt depth = 0;
+
+    if(!layerBrushCount)
+        {
+        // Nothing on this layer.
+        return;
+        }
+
+    if(aLayer == EHuiBrushLayerBackground)
+        {
+        depth = -layerBrushCount - 1;
+        }
+    
+    for(TInt i = 0; i < Count(); ++i)
+        {
+        CHuiBrush& brush = iElements[i]->Ref();
+        
+        if(brush.Layer() == aLayer)
+            {
+            // Polygon depth offset to avoid Z-conflicts.
+            if(aLayer == EHuiBrushLayerBackground || 
+               aLayer == EHuiBrushLayerForeground)
+                {
+                ++depth;                
+                }
+            aGc.SetDepthOffset(-depth);
+            
+            brush.BeginDraw(aGc, aGuide);
+            brush.Draw(aGc, aGuide);
+            brush.EndDraw(aGc, aGuide);
+            }
+        }
+        
+    // Reset depth offset back to zero.
+    aGc.SetDepthOffset(0);    
+    }
+
+
+EXPORT_C TInt CHuiBrushArray::LayerBrushCount(THuiBrushLayer aLayer) const
+    {
+    TInt count = 0;
+    
+    for(TInt i = 0; i < Count(); ++i)
+        {
+        if(iElements[i]->Ref().Layer() == aLayer)
+            {
+            ++count;
+            }
+        }    
+    
+    return count;
+    }
+EXPORT_C TInt CHuiBrushArray::BrushWithTypeCount(TInt aBrushType) const
+    {
+    TInt count = 0;
+    TInt num = Count();
+    for(TInt i=0;i<num;i++)
+        {
+        if (iElements[i]->Ref().Type2()==aBrushType)
+            {
+            count++;
+            }
+        }
+    return count;
+    }
+EXPORT_C CHuiBrush *CHuiBrushArray::BrushWithTypeAt(TInt aBrushType, TInt aIndex)
+    {
+    TInt count = 0;
+    TInt num = Count();
+    for(TInt i=0;i<num;i++)
+        {
+        if (iElements[i]->Ref().Type2()==aBrushType)
+            {
+            if (count == aIndex)
+                {
+                return &iElements[i]->Ref();
+                }
+            count++;
+            }
+        }
+    return 0;    
+    }
+    
+    
+TBool CHuiBrushArray::Changed() const
+    {
+    for(TInt i = 0; i < iElements.Count(); ++i)
+        {
+        if(iElements[i]->Ref().Changed())
+            {
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+    
+    
+void CHuiBrushArray::ClearChanged()
+    {
+    for(TInt i = 0; i < Count(); ++i)
+        {
+        iElements[i]->Ref().ClearChanged();
+        }
+    }
+    
+    
+void CHuiBrushArray::ExpandVisualRect(TRect& aRect) const
+    {
+    TRect original = aRect;
+    
+    for(TInt i = 0; i < Count(); ++i)
+        {
+        CHuiBrush& brush = iElements[i]->Ref();
+
+        // If the drawing of the brush is clipped to visual contents,
+        // there is no need to expand the rectangle.
+        if(!brush.ClipToVisual())
+            {
+            TRect expanded = original;
+            brush.ExpandVisualRect(expanded);
+            aRect.BoundingRect(expanded);
+            }
+        }
+    }
+
+
+void CHuiBrushArray::ActivateBrushGuide(const CHuiVisual* aNewGuide) const
+    {
+    for(TInt i = 0; i < Count(); ++i)
+        {
+        CHuiBrush& brush = iElements[i]->Ref();
+        brush.ActivateBrushGuide(aNewGuide);
+        }        
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiCanvasCmdBufferReader.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,275 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "uiacceltk/HuiCanvasCmdBufferReader.h"
+#include "uiacceltk/HuiUtil.h"
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CHuiCanvasCmdBufferReader::CHuiCanvasCmdBufferReader()
+    {	    
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CHuiCanvasCmdBufferReader::~CHuiCanvasCmdBufferReader()
+    {
+    iStream.Close();	
+    
+    delete iCachedText;
+    }
+    
+// ---------------------------------------------------------------------------
+// InitL
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasCmdBufferReader::Init( TPtr8& aDes,TInt aLength)
+    {
+    iStream.Close();
+    if (aDes.Ptr())
+        {
+        iStream.Open( aDes.Ptr(), aLength );
+		delete iCachedText;
+        iCachedText = NULL;
+        iBasePtr = &aDes;
+#ifdef _DEBUG
+        iBufferIndex = 0;
+        iBufferLength = aLength;
+#endif
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ReadInt32L
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasCmdBufferReader::ReadInt32L( TInt& aValue )
+        {
+        aValue = iStream.ReadInt32L();
+#ifdef _DEBUG
+    iBufferIndex += sizeof(TInt32);
+#endif
+        }
+
+// ---------------------------------------------------------------------------
+// ReadPointL
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasCmdBufferReader::ReadPointL( TPoint& aPoint )
+    {
+    iStream.ReadL( (TUint8*)&(aPoint.iX), sizeof( TInt32 ) * 2 );
+    }
+// ---------------------------------------------------------------------------
+// ReadRectL
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasCmdBufferReader::ReadRectL( TRect& aRect )
+    {
+    iStream.ReadL( (TUint8*)&(aRect.iTl.iX), sizeof( TInt32) * 4 );
+    }
+
+// ---------------------------------------------------------------------------
+// ReadBitmapLC
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasCmdBufferReader::ReadBitmapLC( CFbsBitmap*& aBitmap )
+    {
+    TInt uid;
+    ReadInt32L( uid );
+    aBitmap = new(ELeave)CFbsBitmap;
+    CleanupStack::PushL( aBitmap );
+    
+    //TODO:Bitmap cache, check if bitmap is already in cache. Avoid call to Duplicate
+    //TODO: Cache needs to remove stuff, if not used.
+    
+    aBitmap->Duplicate( uid );
+    }
+
+// ---------------------------------------------------------------------------
+// ReadBitmapHandleL
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasCmdBufferReader::ReadBitmapHandleL( TInt& aBitmapHandle  )
+    {
+    aBitmapHandle = iStream.ReadInt32L();        
+    }
+     
+// ---------------------------------------------------------------------------
+// ReadTextL
+// ---------------------------------------------------------------------------
+//
+TBool CHuiCanvasCmdBufferReader::ReadTextL( TPtr& aText , THuiCanvasTextParameters& aTextParameters )
+    {
+    TInt length = 0;
+    TBool useCachedText = iStream.ReadInt8L();
+    if ( !useCachedText )
+        {
+        length = iStream.ReadInt32L() / 2 ;
+        TInt startPadding = iStream.ReadInt8L();
+        TInt endPadding = iStream.ReadInt8L();
+
+        TInt offset = iStream.Source()->TellL( MStreamBuf::ERead ).Offset() + startPadding;
+        TPtr16 ptr = TPtr16( (TUint16*)( (TInt)iBasePtr->Ptr() + offset ), length, length );
+        aText.Set( ptr );
+
+        iStream.Source()->SeekL( MStreamBuf::ERead, TStreamPos( offset + length * 2 + endPadding ));
+        if ( !iCachedText )
+            {
+            iCachedText = new(ELeave)TPtr16( ptr );
+            }
+        else
+            {
+            iCachedText->Set( ptr );
+            }
+        }
+    else 
+        {
+        aText.Set( *iCachedText );
+        }
+    TInt8 textParameters = iStream.ReadInt8L();
+    switch ( textParameters )
+        {
+        case 1:
+            {
+            // Is there text parameters
+            aTextParameters.iStart = iStream.ReadInt32L();
+            aTextParameters.iEnd = iStream.ReadInt32L();
+            aTextParameters.iFlags = iStream.ReadUint16L();
+            if ( aTextParameters.iStart >= aTextParameters.iEnd )
+                {
+                return EFalse;
+                }
+            break;
+            }
+        case 2:
+            {
+            aTextParameters.iStart = 0;
+            aTextParameters.iEnd = length / 2;
+            aTextParameters.iFlags = 0;
+            break;
+            }
+        default: // 0
+            {
+            aTextParameters.iStart = 0;
+            aTextParameters.iEnd = KMaxTInt;
+            aTextParameters.iFlags = 0;
+            break;
+            }
+        }
+    return ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// ReadPointArrayL, NOT TESTED
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasCmdBufferReader::ReadPointArrayL( CArrayFix<TPoint>*& aPointArray )
+    {
+    TInt count = iStream.ReadInt32L();
+    TInt index = 0;
+    aPointArray = new(ELeave)CArrayFixFlat<TPoint>(count);
+    CleanupStack::PushL( aPointArray );
+    while( index < count )
+        {
+        TPoint point = TPoint(0,0);
+        ReadPointL( point );
+        aPointArray->AppendL( point );
+        index++;
+        }
+    CleanupStack::Pop( aPointArray );
+    }
+
+// ---------------------------------------------------------------------------
+// ReadPointArrayL, NOT TESTED
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasCmdBufferReader::ReadPointArrayL( TPoint*& aPointArray, TInt& aNumPoints )
+    {
+    ReadInt32L( aNumPoints );
+    TInt index = 0;
+    aPointArray = new(ELeave)TPoint[aNumPoints];
+    CleanupStack::PushL( aPointArray );
+        
+    while( index < aNumPoints )
+        {
+        TPoint* point = new(ELeave)TPoint();
+        CleanupStack::PushL( point );
+        ReadPointL( *point );
+        aPointArray[index]= *point;
+        CleanupStack::Pop( point );
+        index++;
+        }
+    CleanupStack::Pop( aPointArray );
+    }
+
+// ---------------------------------------------------------------------------
+// ReadPointArrayL - NOT TESTED
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasCmdBufferReader::DeletePointArrayL( TPoint*& aPointArray, TInt& aNumPoints )
+    {
+    TInt index = 0;
+    while( index < aNumPoints )
+        {
+        delete &(aPointArray[index]);
+        index++;
+        }
+    delete aPointArray;
+    aPointArray = NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// ReadRegionL
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasCmdBufferReader::ReadRegionL( RRegion& aRegion )
+    {
+    aRegion.Clear();
+    TRect rect;
+    TInt count;
+    ReadInt32L( count );// rect count
+    for (TInt i = 0 ; i < count ; i++ )
+        {
+        ReadRectL( rect );
+        aRegion.AddRect( rect );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ReadColorL
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasCmdBufferReader::ReadColorL( TRgb& aColor )
+    {
+    aColor.SetInternal( iStream.ReadUint32L());
+    }
+
+// ---------------------------------------------------------------------------
+// Stream
+// ---------------------------------------------------------------------------
+//
+RMemReadStream& CHuiCanvasCmdBufferReader::Stream()
+    {
+    return iStream;    
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiCanvasTextureCache.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,3475 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "huicanvastexturecache.h"
+#include "uiacceltk/HuiImage.h"
+#include "uiacceltk/HuiTexture.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiStatic.h"
+#include "huicanvasgc.h"
+#include "HuiRenderPlugin.h"
+#include "huicanvasrenderbuffer.h"
+
+#include <e32cmn.h>
+#include <bitdev.h>
+#include <AknLayoutFont.h>
+#include <e32property.h>
+
+// Enable this for debugging cache usage
+//#define HUI_DEBUG_PRINT_CANVAS_TEXTURE_CACHE
+//#define HUI_DEBUG_PRINT_CANVAS_TEXTURE_CACHE_EGL
+//#define HUI_DEBUG_PRINT_CANVAS_TEXTURE_CACHE_EXTENDED
+
+// Enable this for debugging performance
+//#define HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+
+/** Magic S60 font constant */
+const TInt KHuiFontVerticalShiftInPixels = 1; 
+
+/** Initial touch count value */
+const TInt KHuiInitialBitmapTouchCount = -1; 
+
+/** Estimated bits per pixel for all textures */
+const TReal32 KHuiTextureEstimatedBpp = 32;
+
+/** Estimated bits per pixel for rasterized canvas texts */
+const TReal32 KHuiCanvasTextEstimatedBpp = 8;
+
+/** Estimated bits per pixel for canvas images */
+const TReal32 KHuiCanvasImageEstimatedBpp = 32;
+
+/** Estimated bits per pixel for canvas render buffers */
+const TReal32 KHuiCanvasRenderBufferEstimatedBpp = 32;
+
+/** Constant to define target how much memory UI textures should use, 
+    this is not a hard limit but effects how long unused textures are cached */
+const TInt KHuiMaxRecommendedTextureAmountInKBytes = 4096;
+
+/** Constant to define target how much memory UI render buffers should use, 
+    this is not a hard limit but effects how long unused render buffers are cached */
+const TInt KHuiMaxRecommendedRenderBufferAmountInKBytes = 0;
+
+/** Ratio how cache is divided between canvas texts and images */
+const TReal32 KHuiCanvasUnusedTextImageCacheRatio = 0.1f;
+
+/** Max amount of recycled texture objects */
+const TInt KHuiMaxRecycledTextureCount = 100;
+
+/** Use color modulation or not for setting text color */
+const TBool KHuiCanvasTextUseColorModulation = ETrue;
+
+/** Store bitmap pointers to avoid handle duplication */
+const TBool KHuiCanvasKeepBitmapPointer = ETrue;
+
+CHuiCanvasImage::CHuiCanvasImage() :
+        iTexture(NULL),
+        iCache(NULL)
+    {
+    }
+
+CHuiCanvasImage::~CHuiCanvasImage()
+    {
+    if (iCache && iTexture)
+        {
+        iCache->DeleteRecycledTexture(iTexture);
+        }
+    else
+        {
+        delete iTexture;        
+        }    
+    
+    iActiveUsers.Close();            
+    }
+
+void CHuiCanvasImage::RefreshUser(const CHuiCanvasVisual& aUser)
+    {
+    if (iActiveUsers.FindInAddressOrder(&aUser) == KErrNotFound)
+        {
+        iActiveUsers.InsertInAddressOrder(&aUser);
+        }
+
+    // Update last usage time    
+    iLastUsed.UniversalTime();        
+    }
+
+void CHuiCanvasImage::RemoveUser(const CHuiCanvasVisual& aUser)
+    {
+    TInt index = iActiveUsers.FindInAddressOrder(&aUser);
+
+    if (index != KErrNotFound)
+        {
+        iActiveUsers.Remove(index);
+        }    
+    }
+
+TBool CHuiCanvasImage::IsUser(const CHuiCanvasVisual& aUser) const
+    {
+    TInt index = iActiveUsers.FindInAddressOrder(&aUser);
+
+    if (index != KErrNotFound)
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+TBool CHuiCanvasImage::IsAnyUser() const
+    {
+    return iActiveUsers.Count() != 0;
+    }
+
+CHuiTexture* CHuiCanvasImage::Texture() const
+    {
+    return iTexture;
+    }
+
+void CHuiCanvasImage::CopyAttributes(CHuiCanvasImage& aSrc)
+    {
+    iTexture = aSrc.iTexture;
+    iGcParams = aSrc.iGcParams;
+    iLastUsed = aSrc.iLastUsed;
+    iCache = aSrc.iCache;
+    
+    iActiveUsers.Reset();        
+    for (TInt i=0; i < aSrc.iActiveUsers.Count(); i++)
+        {
+        iActiveUsers.Append(aSrc.iActiveUsers[i]);    
+        }               
+    }
+    
+void CHuiCanvasImage::Reset()
+    {
+    // Reset does not delete owned items !
+    iTexture = NULL;            
+    iGcParams = THuiCachedGcParams();       
+    iActiveUsers.Reset();
+    }
+
+
+CHuiCanvasGraphicImage::CHuiCanvasGraphicImage() :
+    iBitmapHandle(0),
+    iMaskHandle(0),
+    iBitmap(NULL),
+    iMask(NULL),
+    iInvertedMask(EFalse),
+    iMaskOriginPoint(TPoint(0,0)),
+    iBitmapTouchCount(-1),
+    iMaskTouchCount(-1),
+    iImageSize(TSize(0,0))        
+        {
+        }
+
+void CHuiCanvasGraphicImage::CopyAttributes(CHuiCanvasGraphicImage& aSrc)
+    {
+    CHuiCanvasImage::CopyAttributes(aSrc);
+    iBitmap = aSrc.iBitmap;
+    iMask = aSrc.iMask;        
+    iBitmapHandle = aSrc.iBitmapHandle;
+    iMaskHandle = aSrc.iMaskHandle;
+    iInvertedMask = aSrc.iInvertedMask;
+    iMaskOriginPoint = aSrc.iMaskOriginPoint;
+    iTexture = aSrc.iTexture;
+    iBitmapTouchCount = aSrc.iBitmapTouchCount;
+    iMaskTouchCount = aSrc.iMaskTouchCount;
+    iImageSize = aSrc.iImageSize;        
+
+    iSubImages.Reset();
+    for (TInt i=0; i<aSrc.iSubImages.Count();i++)
+        {
+        iSubImages.Append(aSrc.iSubImages[i]);    
+        }               
+    }
+
+void CHuiCanvasGraphicImage::Reset()
+    {
+    // Reset does not delete owned items !        
+    CHuiCanvasImage::Reset();                
+    iBitmap = NULL;
+    iMask = NULL;        
+    iSubImages.Reset();        
+    iBitmapHandle = 0;
+    iMaskHandle = 0;
+    iInvertedMask = EFalse;
+    iMaskOriginPoint = TPoint(0,0);
+    iTexture = NULL;
+    iBitmapTouchCount = -1;
+    iMaskTouchCount = -1;
+    iImageSize = TSize(0,0);        
+    };
+
+        
+
+CHuiCanvasGraphicImage::~CHuiCanvasGraphicImage()
+    {
+    delete iBitmap;
+    delete iMask;
+    for (TInt i=0;i<iSubImages.Count();i++)
+        {
+        delete iSubImages[i].iBitmap;    
+        delete iSubImages[i].iMask;    
+        }
+    iSubImages.Close();
+    }
+
+
+
+
+CHuiCanvasTextImage::CHuiCanvasTextImage() :
+    iText(NULL),
+    iFindTextPtr(NULL),
+    iFontHandle(0),
+    iRasterizationOffset(TPoint(0,0)),
+    iTextBoxMaxSize(TSize(KMinTInt,KMinTInt)),
+    iTextWidth(KMinTInt),
+    iBaseLineOffset(KMinTInt),
+    iTextAlign(CGraphicsContext::ELeft),
+    iMargin(0),
+    iAngle(0),
+    iUseColorModulation(EFalse),
+    iFont(NULL)                
+        {
+        }
+        
+void CHuiCanvasTextImage::CopyAttributes(CHuiCanvasTextImage& aSrc)
+    {
+    CHuiCanvasImage::CopyAttributes(aSrc);
+    iText = aSrc.iText;
+    iFindTextPtr = aSrc.iFindTextPtr;
+    iFontHandle = aSrc.iFontHandle;
+    iRasterizationOffset = aSrc.iRasterizationOffset;
+    iTextBoxMaxSize = aSrc.iTextBoxMaxSize;
+    iTextWidth = aSrc.iTextWidth;
+    iBaseLineOffset = aSrc.iBaseLineOffset;
+    iTextAlign = aSrc.iTextAlign;
+    iMargin = aSrc.iMargin;
+    iAngle = aSrc.iAngle;
+    iUseColorModulation = aSrc.iUseColorModulation;            
+    iTextParams = aSrc.iTextParams;
+    iFont = aSrc.iFont;
+    }
+
+void CHuiCanvasTextImage::Reset()
+    {
+    // Reset does not delete owned items !
+    CHuiCanvasImage::Reset();        
+    iText = NULL;
+    iFindTextPtr = NULL;
+    iFontHandle = 0,
+    iRasterizationOffset = TPoint(0,0);
+    iTextBoxMaxSize = TSize(KMinTInt,KMinTInt);
+    iTextWidth = KMinTInt;
+    iBaseLineOffset = KMinTInt;
+    iTextAlign = CGraphicsContext::ELeft;
+    iMargin = 0;
+    iAngle = 0;
+    iUseColorModulation = EFalse;            
+    iFont = NULL;
+    }
+
+CHuiCanvasTextImage::~CHuiCanvasTextImage()
+    {
+    }
+
+TBool CHuiCanvasTextImage::UseColorModulation() const
+    {
+    return iUseColorModulation; 
+    }
+
+NONSHARABLE_CLASS( CHuiCanvasRenderBufferImage ) : public CHuiCanvasImage
+    {
+public:
+    
+    CHuiCanvasRenderBufferImage();
+
+    ~CHuiCanvasRenderBufferImage();
+            
+    virtual void CopyAttributes(CHuiCanvasRenderBufferImage& aSrc);
+
+    virtual void Reset();
+
+public:
+
+    CHuiCanvasRenderBuffer* iCanvasRenderBuffer;
+    TAny* iOwner;
+    };
+
+
+CHuiCanvasRenderBufferImage::CHuiCanvasRenderBufferImage() :
+    iCanvasRenderBuffer(NULL),
+    iOwner(NULL)
+        {
+        }
+        
+void CHuiCanvasRenderBufferImage::CopyAttributes(CHuiCanvasRenderBufferImage& aSrc)
+    {
+    CHuiCanvasImage::CopyAttributes(aSrc);
+    iCanvasRenderBuffer= aSrc.iCanvasRenderBuffer;
+    iOwner = aSrc.iOwner;
+    }
+
+void CHuiCanvasRenderBufferImage::Reset()
+    {
+    // Reset does not delete owned items !
+    CHuiCanvasImage::Reset();        
+    iCanvasRenderBuffer = NULL;
+    iOwner = NULL;
+    }
+
+CHuiCanvasRenderBufferImage::~CHuiCanvasRenderBufferImage()
+    {
+    delete iCanvasRenderBuffer;
+    }
+
+
+NONSHARABLE_CLASS( CHuiCanvasImageRasterizer ) : public CBase
+    {
+public:
+
+    CHuiCanvasImageRasterizer();
+
+    ~CHuiCanvasImageRasterizer();
+
+    void ConstructL(TDisplayMode aPreferredMode = ENone);
+
+    TBool IsSeparateTextMaskUsed();
+
+    static CFbsBitmap* CreateMovedMaskL(CFbsBitmap& aOriginalMask, TPoint aNewTopLeftCorner);
+
+    static CFbsBitmap* CreateInvertedMaskL(CFbsBitmap& aOriginalMask);
+
+protected:
+
+    CFbsBitmap* iTempMask;
+    CFbsBitmapDevice* iTempMaskDevice;
+    CFbsBitGc*  iTempMaskGc;
+    
+    CFbsBitmap* iTempBitmap;
+    CFbsBitmapDevice* iTempBitmapDevice;
+    CFbsBitGc*  iTempBitmapGc;    
+    };
+
+CHuiCanvasImageRasterizer::CHuiCanvasImageRasterizer()
+    {    
+    }
+
+CHuiCanvasImageRasterizer::~CHuiCanvasImageRasterizer()
+    {
+    delete iTempMaskGc;
+    delete iTempMaskDevice;
+    delete iTempMask;
+
+    delete iTempBitmapGc;
+    delete iTempBitmapDevice;
+    delete iTempBitmap; 
+    }
+
+void CHuiCanvasImageRasterizer::ConstructL(TDisplayMode aPreferredMode)
+    {
+    iTempMask = NULL;
+    iTempMaskDevice = NULL;
+    iTempMaskGc = NULL;
+
+    iTempBitmap = NULL;
+    iTempBitmapDevice = NULL;
+    iTempBitmapGc = NULL;
+    
+    // Select fastest color mode for uploading rasterized texts, we assume that EColor16MA 
+    // should be best for HW accelrated rendereres (requiring least amount of conversions
+    // needed before uploading to texture memory) and EColor64K is good for
+    // bitgdi because its backbuffer is in that format.
+    //
+    // NOTE: EHuiRendererGles10 and EHuiRendererGles11 temporarely use EColor64K
+    // beacuse it looks as there are some problems with uploading 16MA 
+    // mode bitmaps into multisegmented textures.
+    //
+    TDisplayMode colorMode = EColor16MA;
+    if (aPreferredMode == EGray256 && 
+        CHuiStatic::Env().Renderer() == EHuiRendererVg10)
+        {
+        colorMode = EGray256;
+        }
+    else if (aPreferredMode == EColor64K)
+        {
+        colorMode = EColor64K;
+        }
+    else if (CHuiStatic::Env().Renderer() == EHuiRendererBitgdi || 
+        CHuiStatic::Env().Renderer() == EHuiRendererGles10 || 
+        CHuiStatic::Env().Renderer() == EHuiRendererGles11)
+        {
+        colorMode = EColor64K;           
+        }
+
+    iTempBitmap = new (ELeave) CFbsBitmap;
+    iTempBitmap->Create(TSize(4,4), colorMode);       
+    iTempBitmapDevice = CFbsBitmapDevice::NewL(iTempBitmap);
+    User::LeaveIfError(iTempBitmapDevice->CreateContext(iTempBitmapGc));             
+    
+    if (colorMode != EGray256)
+        {
+        iTempMask = new (ELeave) CFbsBitmap;
+        iTempMask->Create(TSize(4,4), EGray256);       
+        iTempMaskDevice = CFbsBitmapDevice::NewL(iTempMask);
+        User::LeaveIfError(iTempMaskDevice->CreateContext(iTempMaskGc));                 
+        }
+    }
+
+TBool CHuiCanvasImageRasterizer::IsSeparateTextMaskUsed()
+    {
+    if (iTempBitmap && 
+        iTempBitmap->DisplayMode() != EColor16MA && 
+        iTempBitmap->DisplayMode() != EColor16MAP &&
+        iTempBitmap->DisplayMode() != EGray256)
+        {
+        return ETrue;    
+        }
+    else
+        {
+        return EFalse;    
+        }            
+    }
+
+CFbsBitmap* CHuiCanvasImageRasterizer::CreateInvertedMaskL(CFbsBitmap& aOriginalMask)
+    {
+    TSize size = aOriginalMask.SizeInPixels();
+    
+    CFbsBitmap* newMask = new(ELeave)CFbsBitmap;                       
+    CleanupStack::PushL(newMask);
+    
+    CFbsBitmap* bitmap = new(ELeave)CFbsBitmap;                       
+    CleanupStack::PushL(bitmap);
+        
+    newMask->Create(size, aOriginalMask.DisplayMode());       
+    bitmap->Create(size, aOriginalMask.DisplayMode());       
+    
+    CFbsDevice* newMaskdevice = NULL;
+    CFbsBitGc* newMaskGc = NULL;
+
+    CFbsDevice* bitmapDevice = NULL;
+    CFbsBitGc* bitmapGc = NULL;
+
+    newMaskdevice = CFbsBitmapDevice::NewL(newMask);
+    CleanupStack::PushL(newMaskdevice);
+    User::LeaveIfError(newMaskdevice->CreateContext(newMaskGc));
+
+    bitmapDevice = CFbsBitmapDevice::NewL(bitmap);
+    CleanupStack::PushL(bitmapDevice);
+    User::LeaveIfError(bitmapDevice->CreateContext(bitmapGc));
+
+    bitmapGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
+    bitmapGc->SetPenStyle(CGraphicsContext::ESolidPen);
+    bitmapGc->SetPenColor(KRgbBlack);
+    bitmapGc->SetBrushColor(KRgbBlack);
+    bitmapGc->DrawRect(TRect(TPoint(0,0), size));
+    
+    newMaskGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
+    newMaskGc->SetPenStyle(CGraphicsContext::ESolidPen);
+    newMaskGc->SetPenColor(KRgbWhite);
+    newMaskGc->SetBrushColor(KRgbWhite);
+    newMaskGc->DrawRect(TRect(TPoint(0,0), size));
+    newMaskGc->BitBltMasked(TPoint(0,0), bitmap, TRect(TPoint(0,0), size), &aOriginalMask, EFalse);
+    
+    delete bitmapGc;
+    delete newMaskGc;
+    
+    CleanupStack::PopAndDestroy(bitmapDevice);
+    CleanupStack::PopAndDestroy(newMaskdevice);
+    CleanupStack::PopAndDestroy(bitmap);
+    CleanupStack::Pop(newMask);
+    
+    return newMask;
+    }
+
+CFbsBitmap* CHuiCanvasImageRasterizer::CreateMovedMaskL(CFbsBitmap& aOriginalMask, TPoint aNewTopLeftCorner)
+    {
+    TSize size = aOriginalMask.SizeInPixels();
+    
+    CFbsBitmap* newMask = new(ELeave)CFbsBitmap;                       
+    CleanupStack::PushL(newMask);
+            
+    newMask->Create(size, aOriginalMask.DisplayMode());       
+    
+    CFbsDevice* newMaskdevice = NULL;
+    CFbsBitGc* newMaskGc = NULL;
+
+    newMaskdevice = CFbsBitmapDevice::NewL(newMask);
+    CleanupStack::PushL(newMaskdevice);
+    User::LeaveIfError(newMaskdevice->CreateContext(newMaskGc));
+
+    newMaskGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
+    newMaskGc->SetPenStyle(CGraphicsContext::ESolidPen);
+    newMaskGc->SetPenColor(KRgbWhite);
+    newMaskGc->SetBrushColor(KRgbWhite);
+    newMaskGc->DrawRect(TRect(TPoint(0,0), size));
+    newMaskGc->BitBlt(TPoint(0,0), &aOriginalMask, TRect(aNewTopLeftCorner, size));
+    newMaskGc->BitBlt(aNewTopLeftCorner, &aOriginalMask, TRect(TPoint(0,0), size));
+    
+    delete newMaskGc;    
+    CleanupStack::PopAndDestroy(newMaskdevice);
+    CleanupStack::Pop(newMask);
+    
+    return newMask;
+    }
+    
+
+NONSHARABLE_CLASS( CHuiCanvasTextImageRasterizer ) : public CHuiCanvasImageRasterizer
+    {
+public:
+
+    CHuiCanvasTextImageRasterizer();
+
+    ~CHuiCanvasTextImageRasterizer();
+
+    void RasterizeL(CHuiCanvasTextImage& aTextImage);
+
+private:
+
+    TSize CalculateRasterizedTextSize(const TDesC& aText, CFont* aFont) const;
+
+    void InitL(CHuiCanvasTextImage& aTextImage, TSize& aTextsize);
+
+    void DrawL(CHuiCanvasTextImage& aTextImage, TSize& aTextsize, TPoint& aRasterizedOffset);
+
+    void UploadL(CHuiCanvasTextImage& aTextImage, TPoint& aRasterrizedOffset);
+
+private:
+
+    TInt iFontHandle;
+    CFbsBitGcFont* iFont;
+    };
+
+CHuiCanvasTextImageRasterizer::CHuiCanvasTextImageRasterizer()
+    {    
+    }
+
+CHuiCanvasTextImageRasterizer::~CHuiCanvasTextImageRasterizer()
+    {
+    delete iFont;
+    }
+    
+TSize CHuiCanvasTextImageRasterizer::CalculateRasterizedTextSize(const TDesC& aText, CFont* aFont) const
+    {
+    CFont::TMeasureTextInput input; 
+    input.iFlags = CFont::TMeasureTextInput::EFVisualOrder;
+    CFont::TMeasureTextOutput output; 
+    
+    TInt textAdvance = aFont->MeasureText( aText, &input, &output );
+	
+	TRect bounds = output.iBounds;
+	bounds.iTl.iX = Min(bounds.iTl.iX, 0);
+	bounds.iBr.iX = Max(bounds.iBr.iX, textAdvance);    
+    
+    TSize textSize = TSize(bounds.Width(), aFont->FontMaxHeight());
+ 
+    const CAknLayoutFont* layoutFont = 0;
+  
+    if (CCoeEnv::Static())
+        {
+        layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( aFont );
+        }
+		
+    if ( layoutFont )
+        {
+        textSize.iHeight = aFont->HeightInPixels();
+        TInt textPaneHeight = layoutFont->TextPaneHeight();
+        TInt textPaneTopToBaseline = layoutFont->TextPaneTopToBaseline();
+        
+        textSize.iHeight += textPaneHeight - textPaneTopToBaseline;
+        textSize.iHeight += KHuiFontVerticalShiftInPixels;
+        }
+    else
+        {
+        textSize.iHeight = Max(textSize.iHeight, aFont->HeightInPixels());
+        textSize.iHeight += 3; // the best approximation - fails on big (>=72) fonts
+        }
+                   
+    return textSize;            
+    }
+    
+    
+void CHuiCanvasTextImageRasterizer::RasterizeL(CHuiCanvasTextImage& aTextImage)
+    {
+    TPoint rasterizedOffset(0, 0);
+    
+    if (aTextImage.iFontHandle && (iFontHandle != aTextImage.iFontHandle))
+        {
+        delete iFont;
+        iFont = NULL;    
+
+        // the font might have been duplicated earlier in order to
+        // find out whether it is an outline font or not. As the CHuiCanvasTextImage
+        // does not own the font pointer by it's member iFont, just copy the pointer
+        // to the instance of this class..        
+        if (aTextImage.iFont)
+            {
+            iFont = aTextImage.iFont;
+            }
+        else
+            {
+            // Font is cached as pointer because next text may same font and in that case
+            // we are much faster as there is no need to do font duplication again.
+            iFont = new (ELeave) CFbsBitGcFont();
+            iFontHandle = aTextImage.iFontHandle;
+            TInt fontDuplicateErrorCode = iFont->Duplicate(iFontHandle);            
+            
+            if (fontDuplicateErrorCode)
+                {
+                // Invalid handle which would panic inside fbsbitgc
+                iFontHandle = 0;
+                delete iFont;
+                iFont = NULL;                    
+                aTextImage.iFont = NULL;
+                }
+            else
+                {
+                // we need a reference to the font in CHuiCanvasTextImage aswell..
+                aTextImage.iFont = iFont;
+                }
+            }
+        }
+    
+    if (iFont)
+        {
+        TSize textSize = TSize(0,0);
+        TInt textAscent = 0;
+
+        // If no max size is provided, we need to approximate the needed texture size.
+        if (aTextImage.iTextBoxMaxSize == TSize(KMinTInt,KMinTInt))
+            {                    
+            textSize = CalculateRasterizedTextSize(*aTextImage.iText, iFont);            
+
+            // To get most closest values for the font metrics we could try to cast
+            // font into aknlayoutfont, but that does not seem to work when font is
+            // duplicated trough handle. This solution is not accurate and results slightly 
+            // too  large textures but avoids text clipping.
+            TReal32 height = textSize.iHeight;
+            textSize.iHeight = height * 1.2;
+            textAscent = height * 0.9;
+                          
+            // If rotated 90 degress, then flip width and heigths
+            if (aTextImage.iAngle == 90 || aTextImage.iAngle == -90)
+                {
+                TSize horizontalTextSize = textSize;
+                textSize.iWidth = horizontalTextSize.iHeight;
+                textSize.iHeight = horizontalTextSize.iWidth;                    
+                }
+            
+            // Since we modify the actual point where drawing is to happen
+            // (so that image size gets minimized), we use rasterizedOffset to specify
+            // offset we have used. That offset needs to be used when image of the text 
+            // is to be drawn because with these coordinates text goes exactly where it ´
+            // is supposed to go. 
+            if (aTextImage.iAngle == 90)
+                {
+                // Rotated clockwise
+                rasterizedOffset.iX = textSize.iWidth-textAscent;                                            
+                }
+            else if (aTextImage.iAngle == -90)
+                {
+                // Rotated anti clockwise
+                rasterizedOffset.iX = textAscent;                                                                    
+                // Drawing happens upwards
+                rasterizedOffset.iY = textSize.iHeight;                                                                    
+                }
+            else
+                {
+                // No rotation, just drawn lower
+                rasterizedOffset.iY = textAscent;                    
+                }                                            
+            }
+        else
+            {
+            // Clipping text box is provided, much easier this way.
+            textSize = aTextImage.iTextBoxMaxSize;
+            }
+
+        // Setup gc parameters
+        InitL(aTextImage, textSize);                                
+        
+        // Draw the text 
+        DrawL(aTextImage, textSize, rasterizedOffset);
+        }
+              
+    // Upload content          
+    UploadL(aTextImage, rasterizedOffset);    
+        
+    }
+    
+void CHuiCanvasTextImageRasterizer::InitL(CHuiCanvasTextImage& aTextImage, TSize& aTextsize)
+    {
+    TFontUnderline underline = (TFontUnderline)aTextImage.iGcParams.iUnderline;
+    TFontStrikethrough strikethrough = (TFontStrikethrough)aTextImage.iGcParams.iStrikethrough;
+    CGraphicsContext::TBrushStyle brushstyle = (CGraphicsContext::TBrushStyle)aTextImage.iGcParams.iBrushStyle;
+    CGraphicsContext::TPenStyle penstyle = (CGraphicsContext::TPenStyle)aTextImage.iGcParams.iPenStyle;
+    TInt shadowmode = aTextImage.iGcParams.iShadowMode; // TODO: Is this even needed for texts ?
+    TBool outlinefont = iFont->FontSpecInTwips().iFontStyle.IsEffectOn(FontEffect::EOutline);
+    if (IsSeparateTextMaskUsed())
+        {
+        iTempMask->Resize(aTextsize);
+        iTempMaskDevice->Resize(aTextsize);
+
+        delete iTempMaskGc;
+        iTempMaskGc = NULL;                             
+        User::LeaveIfError(iTempMaskDevice->CreateContext(iTempMaskGc));     
+
+        // Mask bitmap, this defines the shape of the text.
+    	iTempMaskGc->SetBrushColor(KRgbBlack);
+    	iTempMaskGc->Clear();    	
+   	    iTempMaskGc->SetPenColor(KRgbWhite);
+
+        // We dont call the UseFont() variant with handle param because it is slower
+        iTempMaskGc->UseFont(iFont);
+
+        // Set correct gc settings
+        iTempMaskGc->SetPenStyle(penstyle);
+        iTempMaskGc->SetBrushStyle(brushstyle);
+        iTempMaskGc->SetUnderlineStyle(underline);
+        iTempMaskGc->SetStrikethroughStyle(strikethrough);
+        iTempMaskGc->SetShadowMode(shadowmode);            
+        }
+
+    iTempBitmap->Resize(aTextsize);
+    iTempBitmapDevice->Resize(aTextsize);
+
+    delete iTempBitmapGc;
+    iTempBitmapGc = NULL;        
+    User::LeaveIfError(iTempBitmapDevice->CreateContext(iTempBitmapGc));                 
+    
+    if (IsSeparateTextMaskUsed())
+        {
+        // Just fill with correct color, text shape comes from mask
+        if (KHuiCanvasTextUseColorModulation)
+            {
+            iTempBitmapGc->SetPenColor(KRgbWhite);
+            }
+        else
+            {
+            iTempBitmapGc->SetPenColor(aTextImage.iGcParams.iPenColor);
+            }    
+
+        iTempBitmapGc->SetBrushColor(aTextImage.iGcParams.iBrushColor);                
+	    iTempBitmapGc->Clear();  
+        }
+    else
+        {
+        // First clear
+        TRgb clearColor(KRgbBlack);
+        clearColor.SetAlpha(0);
+        iTempBitmapGc->SetPenColor(clearColor);
+        iTempBitmapGc->SetBrushColor(clearColor);
+        if (iTempBitmap->DisplayMode() == EColor16MA)
+            {
+            iTempBitmapGc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
+            }
+        else
+            {
+            iTempBitmapGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
+            }
+                            	    
+	    iTempBitmapGc->Clear();                  
+
+        // Set correct gc settings
+        if (!outlinefont && KHuiCanvasTextUseColorModulation)
+            {
+            iTempBitmapGc->SetPenColor(KRgbWhite);                        
+            }
+        else
+            {
+            iTempBitmapGc->SetPenColor(aTextImage.iGcParams.iPenColor);        
+            iTempBitmapGc->SetBrushColor(aTextImage.iGcParams.iBrushColor);        
+            }
+        
+        iTempBitmapGc->SetPenStyle(penstyle);
+        if (!outlinefont)
+            {
+            iTempBitmapGc->SetBrushStyle( CGraphicsContext::ENullBrush );
+            }
+        else
+            {
+            iTempBitmapGc->SetBrushStyle( brushstyle );
+            }
+        
+        iTempBitmapGc->SetUnderlineStyle(underline);
+        iTempBitmapGc->SetStrikethroughStyle(strikethrough);
+        iTempBitmapGc->SetShadowMode(shadowmode);            
+        }    
+            
+    // We dont call the UseFont() variant with handle param because it is slower
+    iTempBitmapGc->UseFont(iFont);    
+
+    // Are we using color modulation, store info to entry
+    aTextImage.iUseColorModulation = outlinefont ? EFalse : KHuiCanvasTextUseColorModulation;
+
+    // Debug, enable this to see texture outlines.
+    //iTempMaskGc->DrawRect(TRect(TPoint(0,0), textSize));                
+    }
+
+void CHuiCanvasTextImageRasterizer::DrawL(CHuiCanvasTextImage& aTextImage, TSize& aTextsize, TPoint& aRasterizedOffset)
+    {
+#ifdef SYMBIAN_BUILD_GCE            
+    CGraphicsContext::TTextParameters gcTextParams = *(CGraphicsContext::TTextParameters*)& aTextImage.iTextParams;
+#endif            
+    // Based on supplied params, select the approprite DrawText variant.
+    TBool up = (aTextImage.iAngle == -90);
+    if (aTextImage.iTextBoxMaxSize != TSize(KMinTInt,KMinTInt))
+        {
+        if (aTextImage.iBaseLineOffset != KMinTInt)
+            {
+            CGraphicsContext::TTextAlign align = (CGraphicsContext::TTextAlign) aTextImage.iTextAlign;
+
+            if (aTextImage.iTextWidth != KMinTInt)
+            
+                {
+                if (aTextImage.iAngle == 0)
+                    {                                
+                    if (IsSeparateTextMaskUsed())
+                        {
+                        iTempMaskGc->DrawText(*aTextImage.iText, 
+#ifdef SYMBIAN_BUILD_GCE            
+                        &gcTextParams,
+#endif                            
+                        TRect(TPoint(0,0), aTextsize), aTextImage.iBaseLineOffset, aTextImage.iTextWidth, align, aTextImage.iMargin);                            
+                        }
+                    else
+                        {
+                        // No need to draw separate mask, iTempBitmapGc is using EDrawModeWriteAlpha mode
+                        }    
+                    
+                    iTempBitmapGc->DrawText(*aTextImage.iText, 
+#ifdef SYMBIAN_BUILD_GCE            
+                    &gcTextParams,
+#endif                                                      
+                    TRect(TPoint(0,0), aTextsize), aTextImage.iBaseLineOffset, aTextImage.iTextWidth, align, aTextImage.iMargin);
+                    }
+                else
+                    {
+                    if (IsSeparateTextMaskUsed())
+                        {
+                        iTempMaskGc->DrawTextVertical(*aTextImage.iText, 
+#ifdef SYMBIAN_BUILD_GCE            
+                        &gcTextParams,
+#endif                                                      
+                        TRect(TPoint(0,0), aTextsize), aTextImage.iBaseLineOffset, aTextImage.iTextWidth, up, align, aTextImage.iMargin);
+                        }
+                    else
+                        {
+                        // No need to draw separate mask, iTempBitmapGc is using EDrawModeWriteAlpha mode
+                        }    
+                    iTempBitmapGc->DrawTextVertical(*aTextImage.iText, 
+#ifdef SYMBIAN_BUILD_GCE            
+                    &gcTextParams,
+#endif                            
+                    TRect(TPoint(0,0), aTextsize), aTextImage.iBaseLineOffset, aTextImage.iTextWidth, up, align, aTextImage.iMargin);                                                            
+                    }    
+                }
+            else
+                {
+                if (aTextImage.iAngle == 0)
+                    {                               
+                    if (IsSeparateTextMaskUsed())
+                        {
+                        iTempMaskGc->DrawText(*aTextImage.iText, 
+#ifdef SYMBIAN_BUILD_GCE            
+                        &gcTextParams,
+#endif                            
+                        TRect(TPoint(0,0), aTextsize), aTextImage.iBaseLineOffset, align, aTextImage.iMargin);
+                        }
+                    else
+                        {
+                        // No need to draw separate mask, iTempBitmapGc is using EDrawModeWriteAlpha mode
+                        }    
+                    iTempBitmapGc->DrawText(*aTextImage.iText, 
+#ifdef SYMBIAN_BUILD_GCE            
+                    &gcTextParams,
+#endif                                                      
+                    TRect(TPoint(0,0), aTextsize), aTextImage.iBaseLineOffset, align, aTextImage.iMargin);                            
+                    }
+                else
+                    {
+                    if (IsSeparateTextMaskUsed())
+                        {                                
+                        iTempMaskGc->DrawTextVertical(*aTextImage.iText, 
+#ifdef SYMBIAN_BUILD_GCE            
+                        &gcTextParams,
+#endif                            
+                        TRect(TPoint(0,0), aTextsize), aTextImage.iBaseLineOffset, up, align, aTextImage.iMargin);
+                        }
+                    else
+                        {
+                        // No need to draw separate mask, iTempBitmapGc is using EDrawModeWriteAlpha mode
+                        }    
+                    iTempBitmapGc->DrawTextVertical(*aTextImage.iText, 
+#ifdef SYMBIAN_BUILD_GCE            
+                    &gcTextParams,
+#endif                            
+                    TRect(TPoint(0,0), aTextsize), aTextImage.iBaseLineOffset, up, align, aTextImage.iMargin);                                                            
+                    }    
+                }                           
+            }
+        else
+            {
+            if (aTextImage.iAngle == 0)
+                {                               
+                if (IsSeparateTextMaskUsed())
+                    {                                
+                    iTempMaskGc->DrawText(*aTextImage.iText, 
+#ifdef SYMBIAN_BUILD_GCE            
+                    &gcTextParams,
+#endif                            
+                    TRect(TPoint(0,0), aTextsize) );
+                    }
+                else
+                    {
+                    // No need to draw separate mask, iTempBitmapGc is using EDrawModeWriteAlpha mode
+                    }    
+                    
+                iTempBitmapGc->DrawText(*aTextImage.iText, 
+#ifdef SYMBIAN_BUILD_GCE            
+                    &gcTextParams,
+#endif                            
+                TRect(TPoint(0,0), aTextsize));                                                        
+                }
+            else
+                {
+                if (IsSeparateTextMaskUsed())
+                    {                          
+                    iTempMaskGc->DrawTextVertical(*aTextImage.iText, 
+#ifdef SYMBIAN_BUILD_GCE            
+                    &gcTextParams,
+#endif                            
+                    TRect(TPoint(0,0), aTextsize), up );
+                    }
+                else
+                    {
+                    // No need to draw separate mask, iTempBitmapGc is using EDrawModeWriteAlpha mode
+                    }    
+                
+                iTempBitmapGc->DrawTextVertical(*aTextImage.iText, 
+#ifdef SYMBIAN_BUILD_GCE            
+                    &gcTextParams,
+#endif                            
+                TRect(TPoint(0,0), aTextsize), up);                                                                                    
+                }    
+            }    
+        }
+    else
+        {
+        if (aTextImage.iAngle == 0)
+            {                                             
+            if (IsSeparateTextMaskUsed())
+                {                          
+                iTempMaskGc->DrawText(*aTextImage.iText, 
+#ifdef SYMBIAN_BUILD_GCE            
+                &gcTextParams,
+#endif                            
+                aRasterizedOffset);
+                }
+            else
+                {
+                // No need to draw separate mask, iTempBitmapGc is using EDrawModeWriteAlpha mode
+                }
+                    
+            iTempBitmapGc->DrawText(*aTextImage.iText, 
+#ifdef SYMBIAN_BUILD_GCE            
+                &gcTextParams,
+#endif                            
+            aRasterizedOffset);                                    
+            }
+        else
+            {
+            if (IsSeparateTextMaskUsed())
+                {                          
+                iTempMaskGc->DrawTextVertical(*aTextImage.iText, 
+#ifdef SYMBIAN_BUILD_GCE            
+                &gcTextParams,
+#endif                            
+                aRasterizedOffset, up);
+                }
+            else
+                {
+                // No need to draw separate mask, iTempBitmapGc is using EDrawModeWriteAlpha mode
+                }
+                
+            iTempBitmapGc->DrawTextVertical(*aTextImage.iText, 
+#ifdef SYMBIAN_BUILD_GCE            
+                &gcTextParams,
+#endif                                            
+            aRasterizedOffset, up);                                                            
+            }    
+        }        
+    }
+
+void CHuiCanvasTextImageRasterizer::UploadL(CHuiCanvasTextImage& aTextImage, TPoint& aRasterizedOffset)
+    {
+    // Upload bitmap content...this may be slow depending on used HW acceleration !
+    
+    TSize colorBitmapSize = iTempBitmap->SizeInPixels();
+    TSize maskBitmapSize = IsSeparateTextMaskUsed() ? iTempMask->SizeInPixels() : colorBitmapSize;
+    CFbsBitmap* textColorBitmap = iTempBitmap;
+    CFbsBitmap* textMaskBitmap = IsSeparateTextMaskUsed() ? iTempMask : NULL;
+    
+           
+    if (maskBitmapSize.iWidth > 0 && 
+        maskBitmapSize.iHeight > 0 &&
+        colorBitmapSize.iWidth > 0 && 
+        colorBitmapSize.iHeight > 0)
+        {
+        // TODO: For BitGdi it might be good to use direct upload, but it would require changes such as 
+        // making new textColorBitmap, textMaskBitmap everytime.
+        THuiTextureUploadFlags uploadFlags = THuiTextureUploadFlags(EHuiTextureUploadFlagDoNotRetainResolution | EHuiTextureUploadFlagRetainColorDepth);
+
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        TTime startTime;
+        startTime.UniversalTime();
+#endif
+
+        aTextImage.iRasterizationOffset = aRasterizedOffset;
+        
+        CHuiTexture* texture = aTextImage.iTexture;
+        texture->UploadL(*textColorBitmap, textMaskBitmap, uploadFlags);                
+
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        TTime endTime;
+        endTime.UniversalTime();
+        TInt uploadTimeInMilliSeconds = endTime.MicroSecondsFrom( startTime ).Int64()/1000;
+        RDebug::Print(_L(">>> CHuiCanvasTextImageRasterizer::UpdateCachedTextL: Upload of %ix%i %S took %i ms"), 
+            texture->Size().iWidth, 
+            texture->Size().iHeight, 
+            aTextImage.iText,            
+            uploadTimeInMilliSeconds);
+#endif    
+        }        
+    }
+    
+
+NONSHARABLE_CLASS( CHuiCanvasGraphicImageRasterizer ) : public CHuiCanvasImageRasterizer
+    {
+public:
+
+    CHuiCanvasGraphicImageRasterizer();
+
+    ~CHuiCanvasGraphicImageRasterizer();
+
+    void ConstructL(TBool aUseGray256 = EFalse);
+
+    void RasterizeL(CHuiCanvasGraphicImage& aImage);
+
+private:
+    };
+
+CHuiCanvasGraphicImageRasterizer::CHuiCanvasGraphicImageRasterizer()
+    {    
+    }
+
+CHuiCanvasGraphicImageRasterizer::~CHuiCanvasGraphicImageRasterizer()
+    {
+    }
+
+void CHuiCanvasGraphicImageRasterizer::ConstructL(TBool /*aUseGray256*/)
+    {        
+    }
+
+void CHuiCanvasGraphicImageRasterizer::RasterizeL(CHuiCanvasGraphicImage& aImage)
+    {
+    CFbsBitmap* bitmap = NULL;                       
+    CFbsBitmap* mask = NULL;                       
+
+    TInt bitmapTouchCount = KHuiInitialBitmapTouchCount;
+    TInt maskTouchCount = KHuiInitialBitmapTouchCount;
+
+#ifdef SYMBIAN_BUILD_GCE            
+    TBool volatileBitmapOrMask = EFalse;
+#else
+    TBool volatileBitmapOrMask = ETrue;
+#endif
+
+    TBool originalMaskUsed = ETrue;
+
+
+    TInt bitmapHandle = aImage.iBitmapHandle;
+    TInt maskHandle = aImage.iMaskHandle;
+    TBool invertMask = aImage.iInvertedMask;
+    TPoint maskOriginPoint = aImage.iMaskOriginPoint;
+
+    if (!bitmapHandle)
+        {
+        return;    
+        }
+    
+    // Lets see if we have already cached the pointer...
+    if (aImage.iBitmap)
+        {
+        // ...yes lets use it
+        bitmap = aImage.iBitmap;    
+        }
+    else
+        {
+        // ...no, so we need to duplicate the handle
+        bitmap = new(ELeave)CFbsBitmap;                       
+        bitmap->Duplicate(bitmapHandle);
+        if (bitmap)
+            {
+            if (KHuiCanvasKeepBitmapPointer)
+                {
+                aImage.iBitmap = bitmap;                    
+                }
+            else
+                {
+                CleanupStack::PushL(bitmap);                
+                }                
+            }           
+            
+        }
+
+#ifdef SYMBIAN_BUILD_GCE            
+        if (bitmap)
+            {
+            bitmapTouchCount = bitmap->TouchCount();        
+            volatileBitmapOrMask |= bitmap->IsVolatile();
+            }
+#endif            
+
+    // Mask is optional
+    if (maskHandle)
+        {
+        // Lets see if we have already cached the pointer...
+        if (aImage.iMask)
+            {
+            // ...yes lets use it
+            mask = aImage.iMask;    
+            }
+        else
+            {
+            // ...no, so we need to duplicate the handle
+            mask = new(ELeave)CFbsBitmap;                       
+            mask->Duplicate(maskHandle);
+            if (mask)
+                {
+                if (KHuiCanvasKeepBitmapPointer)
+                    {
+                    aImage.iMask = mask;    
+                    }
+                else
+                    {
+                    CleanupStack::PushL(mask);                                    
+                    }                
+                }                                
+            }
+
+#ifdef SYMBIAN_BUILD_GCE            
+        if (mask)
+            {
+            maskTouchCount = mask->TouchCount();    
+            volatileBitmapOrMask |= mask->IsVolatile();
+            }
+#endif
+        
+        // If mask is defined not to be inverted, 
+        // we must invert it because toolkit assumes they are always inverted. Huh.
+#ifdef __NVG
+        // Inverting masks is done ONLY for non-extended bitmaps!
+        if (bitmap->ExtendedBitmapType() == KNullUid) // => Bitmap isn't extended
+            {
+#endif
+            if (invertMask && mask->DisplayMode() == EGray2)
+                {
+                CFbsBitmap* invertedMask = CreateInvertedMaskL(*mask);
+                
+                // If we are not using stored pointer, delete it
+                if (mask != aImage.iMask)
+                    {
+                    CleanupStack::PopAndDestroy(mask);        
+                    }
+                
+                mask = invertedMask;
+                CleanupStack::PushL(mask);    
+                originalMaskUsed = EFalse;
+                }
+            
+            // Upload expects mask to begin always at TPoint(0,0), so if mask
+            // offset is defined we re-create mask with the given new
+            // offset. Note that it might be a good idea to combine this op
+            // with mask inversion op, but we assume that these are not really used
+            // very often, even more rarely together. 
+            if (maskOriginPoint != TPoint(0,0))
+                {
+                CFbsBitmap* movedMask = CreateMovedMaskL(*mask, maskOriginPoint);
+
+                // If we are not using stored pointer, delete it
+                if (mask != aImage.iMask)
+                    {
+                    CleanupStack::PopAndDestroy(mask);
+                    }
+                mask = movedMask;
+                CleanupStack::PushL(mask);                            
+                originalMaskUsed = EFalse;
+                }
+#ifdef __NVG
+            }
+#endif
+        }
+
+    // Bitmap has changed, must be updated ?
+    TBool touchCountChanged = EFalse;    
+    touchCountChanged |= volatileBitmapOrMask;
+    touchCountChanged |= (aImage.iBitmapTouchCount != bitmapTouchCount);
+    touchCountChanged |= (aImage.iMaskTouchCount != maskTouchCount);
+
+    // Is touch count check enabled ?
+    TBool touchCountCheckEnabled = CHuiStatic::Env().CanvasTextureCache().IsTouchCountCheckEnabled();
+    
+    // Has it old content at all ?
+    TBool hasContent = aImage.iTexture->HasContent();
+    
+    if (!hasContent || (touchCountCheckEnabled && touchCountChanged))
+        {
+        // Upload bitmap content...this may be slow depending on used HW acceleration !
+        if (bitmap->SizeInPixels().iWidth > 0 && 
+            bitmap->SizeInPixels().iHeight > 0 &&
+            (!mask || (mask->SizeInPixels().iWidth > 0 && mask->SizeInPixels().iHeight)))
+            {
+            // EHuiTextureUploadFlagDoNotRetainResolution should be removed when 
+            // texturecoordinates with segmented textures work.
+            // This flag causes ugly scaling to happen with small textures.
+            THuiTextureUploadFlags uploadFlags = THuiTextureUploadFlags(EHuiTextureUploadFlagDoNotRetainResolution | EHuiTextureUploadFlagRetainColorDepth);
+
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+            TTime startTime;
+            startTime.UniversalTime();
+#endif
+
+            CHuiTexture* texture = aImage.iTexture;
+            texture->UploadL(*bitmap, mask, uploadFlags);
+
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+            TTime endTime;
+            endTime.UniversalTime();
+            TInt uploadTimeInMilliSeconds = endTime.MicroSecondsFrom( startTime ).Int64()/1000;
+            
+            if (volatileBitmapOrMask)
+                {
+                RDebug::Print(_L(">>> CHuiCanvasGraphicImageRasterizer::UpdateCachedImageL: Reason for uploading is volatileBitmapOrMask"));                     
+                }
+
+            if (aImage.iBitmapTouchCount != bitmapTouchCount)
+                {
+                RDebug::Print(_L(">>> CHuiCanvasGraphicImageRasterizer::UpdateCachedImageL: Reason for uploading is iBitmapTouchCount %i, old was %i "), bitmapTouchCount, aImage.iBitmapTouchCount);                     
+                }
+
+            if (aImage.iMaskTouchCount != maskTouchCount)
+                {
+                RDebug::Print(_L(">>> CHuiCanvasGraphicImageRasterizer::UpdateCachedImageL: Reason for uploading is iMaskTouchCount %i, old was %i "), maskTouchCount, aImage.iMaskTouchCount);                     
+                }
+
+            RDebug::Print(_L(">>> CHuiCanvasGraphicImageRasterizer::UpdateCachedImageL: Upload of %ix%i %i+%i took %i ms"), 
+                texture->Size().iWidth, 
+                texture->Size().iHeight,
+                aImage.iBitmapHandle,
+                aImage.iMaskHandle,
+                uploadTimeInMilliSeconds);
+#endif
+            }            
+        
+#ifdef SYMBIAN_BUILD_GCE            
+        // Texture upload itself must not modify bitmap or mask touch count.
+        // Otherwise, it's impossible to detect client data access
+        // (since there is not necessarily any synchronisation between client & alf).
+        
+        aImage.iBitmapTouchCount = bitmapTouchCount;
+        aImage.iMaskTouchCount = maskTouchCount;
+#endif                    
+        }
+    else
+        {
+        if (touchCountChanged && !touchCountCheckEnabled)
+            {
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+            RDebug::Print(_L(">>> CHuiCanvasGraphicImageRasterizer::UpdateCachedImageL: skipping uploading because touchcount check is disabled"));
+#endif
+            }        
+        }
+
+    // If we are not using stored pointer, delete it
+    if (mask && (mask != aImage.iMask))
+        {
+        CleanupStack::PopAndDestroy(mask);
+        mask = NULL;                    
+        }
+
+    // If we are not using stored pointer, delete it
+    if (bitmap && (bitmap != aImage.iBitmap))
+        {
+        CleanupStack::PopAndDestroy(bitmap);
+        bitmap = NULL;                    
+        }                    
+    }
+    
+
+
+NONSHARABLE_CLASS( CHuiCanvasCombinedGraphicImageRasterizer ) : public CHuiCanvasImageRasterizer
+    {
+public:
+
+    CHuiCanvasCombinedGraphicImageRasterizer();
+
+    ~CHuiCanvasCombinedGraphicImageRasterizer();
+
+    void RasterizeL(CHuiCanvasGraphicImage& aImage);
+
+private:
+
+    void InitL(CHuiCanvasGraphicImage& aImage);
+
+    void DrawL(CHuiCanvasGraphicImage& aImage);
+
+    void UploadL(CHuiCanvasGraphicImage& aImage);
+
+    };
+
+CHuiCanvasCombinedGraphicImageRasterizer::CHuiCanvasCombinedGraphicImageRasterizer()
+    {    
+    }
+
+CHuiCanvasCombinedGraphicImageRasterizer::~CHuiCanvasCombinedGraphicImageRasterizer()
+    {
+    }
+
+void CHuiCanvasCombinedGraphicImageRasterizer::RasterizeL(CHuiCanvasGraphicImage& aImage)
+    {
+    // First check the bitmaps
+    TBool bitmapsChanged = EFalse;    
+    for (TInt i=0; i<aImage.iSubImages.Count(); i++)
+        {
+        // Lets see if we have already cached the pointer...
+        if (!aImage.iSubImages[i].iBitmap)
+            {
+            // ...no we must duplicate handle
+            if (aImage.iSubImages[i].iBitmapHandle)
+                {
+                aImage.iSubImages[i].iBitmap = new (ELeave) CFbsBitmap;                       
+                aImage.iSubImages[i].iBitmap->Duplicate(aImage.iSubImages[i].iBitmapHandle);
+                }
+            }
+                               
+        if (!aImage.iSubImages[i].iMask)
+            {
+            // Lets see if we have already cached the pointer...
+            if (aImage.iSubImages[i].iMaskHandle)
+                {
+                aImage.iSubImages[i].iMask = new (ELeave) CFbsBitmap;                       
+                aImage.iSubImages[i].iMask->Duplicate(aImage.iSubImages[i].iMaskHandle);
+                }
+            }
+                
+        if (aImage.iSubImages[i].iBitmap)
+            {
+            bitmapsChanged |= (aImage.iSubImages[i].iBitmapTouchCount != aImage.iSubImages[i].iBitmap->TouchCount());                        
+            }
+            
+        if (aImage.iSubImages[i].iMask)
+            {
+            bitmapsChanged |= (aImage.iSubImages[i].iMaskTouchCount != aImage.iSubImages[i].iMask->TouchCount());        
+            }                
+        }
+         
+   if (bitmapsChanged)
+       {        
+       InitL(aImage);
+       
+       DrawL(aImage);
+       
+       UploadL(aImage);
+
+       // Touch counts updated after upload in case upload changes the count ?
+       for (TInt i=0; i<aImage.iSubImages.Count(); i++)
+           {
+           if (aImage.iSubImages[i].iBitmap)
+               aImage.iSubImages[i].iBitmapTouchCount = aImage.iSubImages[i].iBitmap->TouchCount();
+
+           if (aImage.iSubImages[i].iMask)
+               aImage.iSubImages[i].iMaskTouchCount = aImage.iSubImages[i].iMask->TouchCount();
+           }
+       }
+   
+   if (!KHuiCanvasKeepBitmapPointer)
+        {
+        for (TInt i=0; i<aImage.iSubImages.Count(); i++)
+            {
+            delete aImage.iSubImages[i].iBitmap;
+            aImage.iSubImages[i].iBitmap = NULL;
+            
+            delete aImage.iSubImages[i].iMask;
+            aImage.iSubImages[i].iMask = NULL;
+            }
+        }                                       
+    }
+
+
+void CHuiCanvasCombinedGraphicImageRasterizer::InitL(CHuiCanvasGraphicImage& aImage)
+    {
+    if (IsSeparateTextMaskUsed())
+        {
+        iTempMask->Resize(aImage.iImageSize);
+        iTempMaskDevice->Resize(aImage.iImageSize);
+
+        delete iTempMaskGc;
+        iTempMaskGc = NULL;                             
+        User::LeaveIfError(iTempMaskDevice->CreateContext(iTempMaskGc));     
+
+        iTempMaskGc->Reset();
+    	iTempMaskGc->SetBrushColor(KRgbBlack);
+    	iTempMaskGc->Clear();    	
+   	    iTempMaskGc->SetPenColor(KRgbWhite);
+        }
+
+    iTempBitmap->Resize(aImage.iImageSize);
+    iTempBitmapDevice->Resize(aImage.iImageSize);
+
+    delete iTempBitmapGc;
+    iTempBitmapGc = NULL;        
+    User::LeaveIfError(iTempBitmapDevice->CreateContext(iTempBitmapGc));                 
+    
+    if (IsSeparateTextMaskUsed())
+        {
+        TRgb clearColor(KRgbWhite);
+        clearColor.SetAlpha(0);
+        iTempBitmapGc->SetPenColor(clearColor);
+        iTempBitmapGc->SetBrushColor(clearColor);
+        iTempBitmapGc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);                    	    
+	    iTempBitmapGc->Clear();                  
+        iTempBitmapGc->SetPenColor(KRgbWhite);                        
+
+        iTempMaskGc->SetPenColor(clearColor);
+        iTempMaskGc->SetBrushColor(clearColor);
+        iTempMaskGc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);                    	    
+	    iTempMaskGc->Clear();                  
+        iTempMaskGc->SetPenColor(KRgbWhite);                        
+        }
+    else
+        {
+        // First clear
+        TRgb clearColor(KRgbWhite);
+        clearColor.SetAlpha(0);
+        iTempBitmapGc->SetPenColor(clearColor);
+        iTempBitmapGc->SetBrushColor(clearColor);
+        iTempBitmapGc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);                    	    
+	    iTempBitmapGc->Clear();                  
+        iTempBitmapGc->SetPenColor(KRgbWhite);                        
+        }    
+    }
+
+void CHuiCanvasCombinedGraphicImageRasterizer::DrawL(CHuiCanvasGraphicImage& aImage)
+    {
+    for (TInt i=0; i<aImage.iSubImages.Count(); i++)
+        {        
+        CFbsBitmap* bitmap = aImage.iSubImages[i].iBitmap;
+        CFbsBitmap* mask = aImage.iSubImages[i].iMask;
+        TPoint point = aImage.iSubImages[i].iCombinedBitmapPoint; 
+
+        if (bitmap)
+            {
+            if (IsSeparateTextMaskUsed())
+                {
+                TRect sourceRect = TRect(TPoint(0,0), bitmap->SizeInPixels());                
+                if (bitmap)
+                    {
+                    iTempBitmapGc->BitBlt(point, bitmap);                                           
+                    }                                                                        
+                if (mask)
+                    {
+                    iTempMaskGc->BitBlt(point, mask);                       
+                    }
+                }
+            else
+                {
+                TRect sourceRect = TRect(TPoint(0,0), bitmap->SizeInPixels());
+                if (mask)
+                    {
+                    TBool invertMask = (mask->DisplayMode() == EGray256);                       
+                    iTempBitmapGc->BitBltMasked(point, bitmap, sourceRect, mask, invertMask);                       
+                    }
+                else
+                    {
+                    iTempBitmapGc->BitBlt(point, bitmap);                                           
+                    }                                                    
+                }    
+            }
+        }        
+    }
+
+void CHuiCanvasCombinedGraphicImageRasterizer::UploadL(CHuiCanvasGraphicImage& aImage)
+    {
+    CFbsBitmap* mask = IsSeparateTextMaskUsed() ? iTempMask : NULL; 
+        
+    // Upload bitmap content...this may be slow depending on used HW acceleration !
+    if (iTempBitmap->SizeInPixels().iWidth > 0 && 
+        iTempBitmap->SizeInPixels().iHeight > 0 &&
+        (!mask || (mask->SizeInPixels().iWidth > 0 && mask->SizeInPixels().iHeight)))
+        {
+        // EHuiTextureUploadFlagDoNotRetainResolution should be removed when 
+        // texturecoordinates with segmented textures work.
+        // This flag causes ugly scaling to happen with small textures.
+        THuiTextureUploadFlags uploadFlags = THuiTextureUploadFlags(EHuiTextureUploadFlagDoNotRetainResolution | EHuiTextureUploadFlagRetainColorDepth);
+
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        TTime startTime;
+        startTime.UniversalTime();
+#endif
+
+        CHuiTexture* texture = aImage.iTexture;                
+        texture->UploadL(*iTempBitmap, mask, uploadFlags);
+
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        TTime endTime;
+        endTime.UniversalTime();
+        TInt uploadTimeInMilliSeconds = endTime.MicroSecondsFrom( startTime ).Int64()/1000;
+        
+        RDebug::Print(_L(">>> CHuiCanvasCombinedGraphicImageRasterizer::UploadCombinedImageL: Upload of %ix%i %i+%i took %i ms"), 
+            texture->Size().iWidth, 
+            texture->Size().iHeight,
+            aImage.iBitmapHandle,
+            aImage.iMaskHandle,
+            uploadTimeInMilliSeconds);
+#endif
+        }                    
+    }
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt ImageTimeOrderFunc(const CHuiCanvasGraphicImage& aFirst, const CHuiCanvasGraphicImage& aSecond)
+    {
+    if (aFirst.iLastUsed < aSecond.iLastUsed)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iLastUsed > aSecond.iLastUsed)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        return 0;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt TextTimeOrderFunc(const CHuiCanvasTextImage& aFirst, const CHuiCanvasTextImage& aSecond)
+    {
+    if (aFirst.iLastUsed < aSecond.iLastUsed)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iLastUsed > aSecond.iLastUsed)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        return 0;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt RenderBufferTimeOrderFunc(const CHuiCanvasRenderBufferImage& aFirst, const CHuiCanvasRenderBufferImage& aSecond)
+    {
+    if (aFirst.iLastUsed < aSecond.iLastUsed)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iLastUsed > aSecond.iLastUsed)
+        {
+        return 1; // more than  
+        }
+    else
+        {
+        return 0;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt GcImageOrderFunc(const THuiCachedGcParams& /*aFirst*/, const THuiCachedGcParams& /*aSecond*/)
+    {
+    return 0; // equal enough, note that we don't check every field
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt GcTextOrderFunc(const THuiCachedGcParams& aFirst, const THuiCachedGcParams& aSecond)
+    {    
+    if (!KHuiCanvasTextUseColorModulation)
+        {            
+        if (aFirst.iPenColor.Value() < aSecond.iPenColor.Value())
+            {
+            return -1; // less than
+            }
+        else if (aFirst.iPenColor.Value() > aSecond.iPenColor.Value())
+            {
+            return 1; // more than	
+            }
+        else
+            {
+            // For PC-lint
+            }
+        }
+
+    if (aFirst.iPenStyle < aSecond.iPenStyle)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iPenStyle > aSecond.iPenStyle)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    if (aFirst.iDrawMode < aSecond.iDrawMode)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iDrawMode > aSecond.iDrawMode)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    if (aFirst.iStrikethrough < aSecond.iStrikethrough)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iStrikethrough > aSecond.iStrikethrough)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    if (aFirst.iUnderline < aSecond.iUnderline)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iUnderline > aSecond.iUnderline)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    return 0; // equal enough, note that we don't check every field
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt ImageOrderFunc(const CHuiCanvasGraphicImage& aFirst, const CHuiCanvasGraphicImage& aSecond)
+    {
+    // Bitmap handle
+    if (aFirst.iBitmapHandle < aSecond.iBitmapHandle)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iBitmapHandle > aSecond.iBitmapHandle)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    // Mask handle
+    if (aFirst.iMaskHandle < aSecond.iMaskHandle)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iMaskHandle > aSecond.iMaskHandle)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    // Inverted mask
+    if (aFirst.iInvertedMask < aSecond.iInvertedMask)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iInvertedMask > aSecond.iInvertedMask)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    // Mask origin point X
+    if (aFirst.iMaskOriginPoint.iX < aSecond.iMaskOriginPoint.iX)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iMaskOriginPoint.iX > aSecond.iMaskOriginPoint.iX)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+        
+    // Mask origin point Y
+    if (aFirst.iMaskOriginPoint.iY < aSecond.iMaskOriginPoint.iY)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iMaskOriginPoint.iY > aSecond.iMaskOriginPoint.iY)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    if (aFirst.iImageSize.iHeight < aSecond.iImageSize.iHeight)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iImageSize.iHeight > aSecond.iImageSize.iHeight)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    if (aFirst.iImageSize.iWidth < aSecond.iImageSize.iWidth)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iImageSize.iWidth > aSecond.iImageSize.iWidth)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+    
+    if (aFirst.iSubImages.Count() < aSecond.iSubImages.Count())
+        {
+        return -1;    
+        }
+    else if (aFirst.iSubImages.Count() > aSecond.iSubImages.Count())
+        {
+        return 1;                
+        }
+    else
+        {
+        // Same amount, must check array content
+        if (aFirst.iSubImages.Count() && aSecond.iSubImages.Count())
+            {
+            for (TInt i=0; i<aFirst.iSubImages.Count();i++)
+                {
+                if (aFirst.iSubImages[i].iBitmapHandle < aSecond.iSubImages[i].iBitmapHandle)
+                    {
+                    return -1;    
+                    }
+                else if (aFirst.iSubImages[i].iBitmapHandle > aSecond.iSubImages[i].iBitmapHandle)
+                    {
+                    return 1;                            
+                    }
+                else
+                    {
+                    // For PC-lint                                        
+                    }                        
+
+                if (aFirst.iSubImages[i].iMaskHandle < aSecond.iSubImages[i].iMaskHandle)
+                    {
+                    return -1;    
+                    }
+                else if (aFirst.iSubImages[i].iMaskHandle > aSecond.iSubImages[i].iMaskHandle)
+                    {
+                    return 1;                            
+                    }
+                else
+                    {
+                    // For PC-lint                                        
+                    }    
+                                        
+                if (aFirst.iSubImages[i].iCombinedBitmapPoint.iX < aSecond.iSubImages[i].iCombinedBitmapPoint.iX)
+                    {
+                    return -1;    
+                    }
+                else if (aFirst.iSubImages[i].iCombinedBitmapPoint.iX > aSecond.iSubImages[i].iCombinedBitmapPoint.iX)
+                    {
+                    return 1;                            
+                    }
+                else
+                    {
+                    // For PC-lint                                        
+                    }                        
+
+                if (aFirst.iSubImages[i].iCombinedBitmapPoint.iY < aSecond.iSubImages[i].iCombinedBitmapPoint.iY)
+                    {
+                    return -1;    
+                    }
+                else if (aFirst.iSubImages[i].iCombinedBitmapPoint.iY > aSecond.iSubImages[i].iCombinedBitmapPoint.iY)
+                    {
+                    return 1;                            
+                    }
+                else
+                    {
+                    // For PC-lint                                        
+                    }                        
+
+
+                }                
+            }
+        else
+            {
+            // For PC-lint                
+            }            
+        }                
+    return GcImageOrderFunc(aFirst.iGcParams, aSecond.iGcParams); 
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt TextOrderFunc(const CHuiCanvasTextImage& aFirst, const CHuiCanvasTextImage& aSecond)
+    {
+    // Font handle
+    if (aFirst.iFontHandle < aSecond.iFontHandle)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iFontHandle > aSecond.iFontHandle)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+        
+    // Text width
+    if (aFirst.iTextWidth < aSecond.iTextWidth)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iTextWidth > aSecond.iTextWidth)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    // iTextBoxMaxSize.iWidth
+    if (aFirst.iTextBoxMaxSize.iWidth < aSecond.iTextBoxMaxSize.iWidth)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iTextBoxMaxSize.iWidth > aSecond.iTextBoxMaxSize.iWidth)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    // Text content
+    TInt textcompare = KErrNotFound;
+    if ( aFirst.iFindTextPtr )
+        {
+        textcompare = aFirst.iFindTextPtr->Compare(*aSecond.iText);     
+        }
+    else
+        {
+        textcompare = aFirst.iText->Compare(*aSecond.iText);
+        }
+    
+    if (textcompare < 0)
+        {
+        return -1;    
+        }
+    else if (textcompare > 0)
+        {
+        return 1;    
+        }
+    else
+        {
+        // For PC-lint
+        }            
+    
+    // iBaseLineOffset
+    if (aFirst.iBaseLineOffset < aSecond.iBaseLineOffset)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iBaseLineOffset > aSecond.iBaseLineOffset)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    // iTextAlign
+    if (aFirst.iTextAlign < aSecond.iTextAlign)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iTextAlign > aSecond.iTextAlign)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    // iMargin
+    if (aFirst.iMargin < aSecond.iMargin)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iMargin > aSecond.iMargin)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    // iAngle
+    if (aFirst.iAngle < aSecond.iAngle)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iAngle > aSecond.iAngle)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+       
+    // Font handle
+    if (aFirst.iTextParams.iStart < aSecond.iTextParams.iStart)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iTextParams.iStart > aSecond.iTextParams.iStart)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    // Font handle
+    if (aFirst.iTextParams.iEnd < aSecond.iTextParams.iEnd)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iTextParams.iEnd > aSecond.iTextParams.iEnd)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    // Font handle
+    if (aFirst.iTextParams.iFlags < aSecond.iTextParams.iFlags)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iTextParams.iFlags > aSecond.iTextParams.iFlags)
+        {
+        return 1; // more than	
+        }
+    else
+        {
+        // For PC-lint
+        }
+                    
+    return GcTextOrderFunc(aFirst.iGcParams, aSecond.iGcParams); 
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt RenderBufferOrderFunc(const CHuiCanvasRenderBufferImage& aFirst, const CHuiCanvasRenderBufferImage& aSecond)
+    {
+    if (aFirst.iOwner < aSecond.iOwner)
+        {
+        return -1; // less than
+        }
+    else if (aFirst.iOwner > aSecond.iOwner)
+        {
+        return 1; // more than  
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    return 0; // Equal
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CHuiCanvasTextureCache::CHuiCanvasTextureCache()
+    {
+    EnableLowMemoryState(EFalse);
+    CHuiStatic::Env().AddLowMemoryObserver(this);
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CHuiCanvasTextureCache::~CHuiCanvasTextureCache()
+    {
+    CHuiStatic::Env().RemoveLowMemoryObserver(this);
+    iCachedTexts.ResetAndDestroy();
+    iCachedImages.ResetAndDestroy();        
+    iRecycledTextures.ResetAndDestroy();
+    
+    if (iSearchedTextImageEntry)
+        {
+        iSearchedTextImageEntry->Reset();
+        delete iSearchedTextImageEntry;
+        }
+    
+    if (iSearchedGraphicImageEntry)
+        {
+        iSearchedGraphicImageEntry->Reset();
+        delete iSearchedGraphicImageEntry;
+        }
+    
+    if (iSearchedRenderBufferImageEntry)
+        {
+        iSearchedRenderBufferImageEntry->Reset();
+        delete iSearchedRenderBufferImageEntry;        
+        }
+
+    delete iTextImageRasterizer;
+    delete iOutLineTextImageRasterizer;
+    delete iGraphicImageRasterizer;
+    delete iCombinedGraphicImageRasterizer;
+    delete iCanvasGc;
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CHuiCanvasTextureCache* CHuiCanvasTextureCache::NewL()
+    {
+    CHuiCanvasTextureCache* self = CHuiCanvasTextureCache::NewLC();
+    CleanupStack::Pop(self);
+    return self;        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CHuiCanvasTextureCache* CHuiCanvasTextureCache::NewLC()
+    {
+    CHuiCanvasTextureCache* self = new (ELeave) CHuiCanvasTextureCache();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::ConstructL()
+    {
+    iMemoryLevel = EHuiMemoryLevelNormal;
+    
+    iCanvasGc = CHuiStatic::Renderer().CreateCanvasGcL();
+    
+    iTextImageRasterizer = new (ELeave) CHuiCanvasTextImageRasterizer;
+    iTextImageRasterizer->ConstructL(EGray256);
+    
+    iOutLineTextImageRasterizer = new (ELeave) CHuiCanvasTextImageRasterizer;
+    iOutLineTextImageRasterizer->ConstructL(EColor16MA);
+    
+    iGraphicImageRasterizer = new (ELeave) CHuiCanvasGraphicImageRasterizer;
+    iGraphicImageRasterizer->ConstructL();
+
+    iCombinedGraphicImageRasterizer = new (ELeave) CHuiCanvasCombinedGraphicImageRasterizer;    
+    iCombinedGraphicImageRasterizer->ConstructL(EColor64K);
+    
+    iSearchedTextImageEntry = new (ELeave) CHuiCanvasTextImage;
+    iSearchedGraphicImageEntry = new (ELeave) CHuiCanvasGraphicImage;
+    iSearchedRenderBufferImageEntry = new (ELeave) CHuiCanvasRenderBufferImage;
+    }
+    
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+const CHuiCanvasGraphicImage* CHuiCanvasTextureCache::FindCachedImageL(
+    const THuiCachedImageParams& aCachedImageParams, 
+    const CHuiCanvasVisual& aUser)
+    {    
+    TInt cachedEntry = KErrNotFound;
+
+    iSearchedGraphicImageEntry->Reset();        
+    iSearchedGraphicImageEntry->iBitmapHandle = aCachedImageParams.iBitmapHandle;
+    iSearchedGraphicImageEntry->iMaskHandle = aCachedImageParams.iMaskHandle;
+    iSearchedGraphicImageEntry->iTexture = NULL;
+    iSearchedGraphicImageEntry->iInvertedMask = aCachedImageParams.iInvertedMask;
+    iSearchedGraphicImageEntry->iMaskOriginPoint = aCachedImageParams.iMaskOriginPoint;
+    iSearchedGraphicImageEntry->iBitmapTouchCount = KHuiInitialBitmapTouchCount;
+    iSearchedGraphicImageEntry->iMaskTouchCount = KHuiInitialBitmapTouchCount;
+    iSearchedGraphicImageEntry->iGcParams = aCachedImageParams.iGcParams;
+    
+    cachedEntry = iCachedImages.FindInOrder(iSearchedGraphicImageEntry, ImageOrderFunc);
+    if (cachedEntry == KErrNotFound)
+        {
+        User::Leave(KErrNotFound);
+        }
+    
+    iCachedImages[cachedEntry]->RefreshUser(aUser);
+    return iCachedImages[cachedEntry];    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// 
+// ---------------------------------------------------------------------------
+//
+const CHuiCanvasGraphicImage* CHuiCanvasTextureCache::CreateCombinedCachedImageL(
+    const RArray<THuiCachedCombinedImageParams>& aCachedImageParams,
+    const THuiCachedGcParams& aGcParams,
+    const TSize& aImageSize, 
+    const CHuiCanvasVisual& aUser)
+    {
+    TBool needUpdate = EFalse;
+    TInt cachedEntry = KErrNotFound;
+        
+    iSearchedGraphicImageEntry->Reset();
+    iSearchedGraphicImageEntry->iGcParams = aGcParams;
+    iSearchedGraphicImageEntry->iImageSize = aImageSize;
+    
+    
+    for (TInt i=0; i<aCachedImageParams.Count();i++)
+        {
+        THuiCachedBitmap cachedBitmap;
+        cachedBitmap.iBitmapHandle = aCachedImageParams[i].iBitmapHandle;
+        cachedBitmap.iMaskHandle = aCachedImageParams[i].iMaskHandle;
+        cachedBitmap.iCombinedBitmapPoint = aCachedImageParams[i].iCombinedBitmapPoint;        
+        iSearchedGraphicImageEntry->iSubImages.Append(cachedBitmap);            
+        }
+            
+    cachedEntry = iCachedImages.FindInOrder(iSearchedGraphicImageEntry, ImageOrderFunc);
+    if (cachedEntry == KErrNotFound)
+        {
+        // Create new entry object
+        CHuiCanvasGraphicImage* newEntry = new (ELeave) CHuiCanvasGraphicImage; 
+        CleanupStack::PushL(newEntry);                    
+        newEntry->CopyAttributes(*iSearchedGraphicImageEntry);
+        
+        // Create new accelerated image
+        CHuiTexture* newtexture = CreateRecycledTextureL();
+        newEntry->iTexture = newtexture;        
+        
+        User::LeaveIfError(iCachedImages.InsertInOrder(newEntry, ImageOrderFunc));
+        cachedEntry = iCachedImages.FindInOrder(newEntry, ImageOrderFunc);
+
+        CleanupStack::Pop(newEntry);
+        needUpdate = ETrue;            
+        }
+    else
+        {
+        // Check if needs to be updated by checking active users list
+        if (!iCachedImages[cachedEntry]->IsUser(aUser))
+            {
+            needUpdate = ETrue;            
+            }
+        }    
+
+    if (needUpdate)
+        {
+        TRAPD(updateError, iCombinedGraphicImageRasterizer->RasterizeL(*iCachedImages[cachedEntry]));
+        if (updateError == KErrNoMemory)
+            {                
+            // Call grim reaper to initiate system level texture memory actions !
+            HandleOutOfTextureMemory();
+            User::LeaveIfError(updateError);
+            }
+        }
+
+    iCachedImages[cachedEntry]->RefreshUser(aUser);        
+    return iCachedImages[cachedEntry];    
+    }
+
+    
+// ---------------------------------------------------------------------------
+// Improvement idea for HW accelerated, upload all images of the buffer 
+// into single texture and use texture coordinates to draw each image. 
+// ---------------------------------------------------------------------------
+//
+const CHuiCanvasGraphicImage* CHuiCanvasTextureCache::CreateCachedImageL(
+    const THuiCachedImageParams& aCachedImageParams, 
+    const CHuiCanvasVisual& aUser)
+    {    
+    TBool needUpdate = EFalse;
+    TInt cachedEntry = KErrNotFound;
+    
+    iSearchedGraphicImageEntry->Reset();    
+    iSearchedGraphicImageEntry->iBitmapHandle = aCachedImageParams.iBitmapHandle;
+    iSearchedGraphicImageEntry->iMaskHandle = aCachedImageParams.iMaskHandle;
+    iSearchedGraphicImageEntry->iTexture = NULL;
+    iSearchedGraphicImageEntry->iInvertedMask = aCachedImageParams.iInvertedMask;
+    iSearchedGraphicImageEntry->iMaskOriginPoint = aCachedImageParams.iMaskOriginPoint;
+    iSearchedGraphicImageEntry->iBitmapTouchCount = KHuiInitialBitmapTouchCount;
+    iSearchedGraphicImageEntry->iMaskTouchCount = KHuiInitialBitmapTouchCount;
+    iSearchedGraphicImageEntry->iGcParams = aCachedImageParams.iGcParams;
+    
+    cachedEntry = iCachedImages.FindInOrder(iSearchedGraphicImageEntry, ImageOrderFunc);
+    if (cachedEntry == KErrNotFound)
+        {
+        // Create new entry object
+        CHuiCanvasGraphicImage* newEntry = new (ELeave) CHuiCanvasGraphicImage; 
+        CleanupStack::PushL(newEntry);                    
+        
+        newEntry->CopyAttributes(*iSearchedGraphicImageEntry);
+        
+        // Create new accelerated image
+        CHuiTexture* newtexture = CreateRecycledTextureL();
+        newEntry->iTexture = newtexture;        
+
+        User::LeaveIfError(iCachedImages.InsertInOrder(newEntry, ImageOrderFunc));
+        cachedEntry = iCachedImages.FindInOrder(newEntry, ImageOrderFunc);
+        CleanupStack::Pop(newEntry);
+        needUpdate = ETrue;            
+        }
+    else
+        {
+        // Check if needs to be updated by checking active users list
+        if (!iCachedImages[cachedEntry]->IsUser(aUser))
+            {
+            needUpdate = ETrue;            
+            }
+        }    
+
+    if (needUpdate)
+        {
+        TRAPD(updateError, iGraphicImageRasterizer->RasterizeL(*iCachedImages[cachedEntry]));
+        if (updateError == KErrNoMemory)
+            {                                
+            // Call grim reaper to initiate system level texture memory actions !
+            HandleOutOfTextureMemory();
+            User::LeaveIfError(updateError);
+            }
+        }
+
+    iCachedImages[cachedEntry]->RefreshUser(aUser);        
+    return iCachedImages[cachedEntry];    
+    }
+    
+    
+
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+const CHuiCanvasTextImage* CHuiCanvasTextureCache::CreateCachedTextL( 
+    const THuiCachedTextParams& aCachedTextParams,
+    const CHuiCanvasVisual& aUser)
+    {
+    TBool needUpdate = EFalse;
+    TInt cachedEntry = KErrNotFound;
+    
+    iSearchedTextImageEntry->Reset();        
+    iSearchedTextImageEntry->iFindTextPtr= aCachedTextParams.iFindTextPtr; // Not owned, gets be updated if not found
+    iSearchedTextImageEntry->iTexture = NULL; // Gets updated if not found
+    iSearchedTextImageEntry->iFontHandle = aCachedTextParams.iFontHandle;
+    iSearchedTextImageEntry->iRasterizationOffset = TPoint(0,0); // Gets updated when text has been rasterized        
+    Mem::Copy( &iSearchedTextImageEntry->iTextParams, &aCachedTextParams.iTextParams, sizeof(THuiCanvasTextParameters));        
+    iSearchedTextImageEntry->iTextBoxMaxSize = aCachedTextParams.iTextBoxMaxSize;
+    iSearchedTextImageEntry->iTextWidth = aCachedTextParams.iTextWidth;
+    iSearchedTextImageEntry->iBaseLineOffset = aCachedTextParams.iBaseLineOffset;
+    iSearchedTextImageEntry->iTextAlign = aCachedTextParams.iTextAlign;
+    iSearchedTextImageEntry->iMargin = aCachedTextParams.iMargin;
+    iSearchedTextImageEntry->iAngle = aCachedTextParams.iAngle;
+    iSearchedTextImageEntry->iGcParams = aCachedTextParams.iGcParams;
+
+    
+    cachedEntry = iCachedTexts.FindInOrder(iSearchedTextImageEntry, TextOrderFunc);
+    if (cachedEntry == KErrNotFound)
+        {
+        // Create new entry object
+        CHuiCanvasTextImage* newTextEntry = new (ELeave) CHuiCanvasTextImage; 
+        CleanupStack::PushL(newTextEntry);                    
+        
+        newTextEntry->CopyAttributes(*iSearchedTextImageEntry);
+        
+        // Create new accelerated image
+        CHuiTexture* newtexture = CreateRecycledTextureL();
+        newTextEntry->iTexture = newtexture;
+
+        // Create text which entry will own        
+        HBufC* ownedText = aCachedTextParams.iFindTextPtr->AllocL();
+        newTextEntry->iText = ownedText;
+        newTextEntry->iFindTextPtr = NULL;
+        TInt insertSuccess = iCachedTexts.InsertInOrder(newTextEntry, TextOrderFunc);
+        __ASSERT_DEBUG( !insertSuccess, USER_INVARIANT() );
+        User::LeaveIfError( insertSuccess );
+        cachedEntry = iCachedTexts.FindInOrder(newTextEntry, TextOrderFunc);
+
+        CleanupStack::Pop(newTextEntry); 
+        needUpdate = ETrue;            
+        }
+    else
+        {
+        // If it was found, great. No need to update it.
+        }        
+
+
+    if (needUpdate)
+        {
+        TBool outlinefont = EFalse;
+
+        if (!(*iCachedTexts[cachedEntry]).iFont)
+            {
+            CFbsBitGcFont* font = new (ELeave) CFbsBitGcFont();
+            CleanupStack::PushL(font);
+            User::LeaveIfError(font->Duplicate((*iCachedTexts[cachedEntry]).iFontHandle));
+            (*iCachedTexts[cachedEntry]).iFont = font;
+            CleanupStack::Pop(); // font                    
+            }
+
+        outlinefont = (*iCachedTexts[cachedEntry]).iFont->FontSpecInTwips().iFontStyle.IsEffectOn(FontEffect::EOutline);
+        TInt updateError(KErrNone);
+        if (!outlinefont)
+            {
+            TRAP(updateError, iTextImageRasterizer->RasterizeL(*iCachedTexts[cachedEntry]));
+            }
+        else
+            {
+            TRAP(updateError, iOutLineTextImageRasterizer->RasterizeL(*iCachedTexts[cachedEntry]));
+            }
+        
+        
+        
+        if (updateError == KErrNoMemory)
+            {                
+            // Call grim reaper to initiate system level texture memory actions !
+            HandleOutOfTextureMemory();
+            User::LeaveIfError(updateError);
+            }
+        }
+
+    iCachedTexts[cachedEntry]->RefreshUser(aUser);
+    return iCachedTexts[cachedEntry];            
+    }
+
+
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::ReleaseAllCachedEntries(const CHuiCanvasVisual& aUser)
+    {    
+    // Texts
+    for (TInt i=0; i < iCachedTexts.Count(); i++)
+        {
+        TInt index = iCachedTexts[i]->iActiveUsers.FindInAddressOrder(&aUser);
+
+        if (index != KErrNotFound)
+            {
+            iCachedTexts[i]->iActiveUsers.Remove(index);
+            iHasReleasedTexts = ETrue;
+            }
+        }        
+
+    // Images
+    for (TInt i=0; i < iCachedImages.Count(); i++)
+        {
+        TInt index = iCachedImages[i]->iActiveUsers.FindInAddressOrder(&aUser);
+
+        if (index != KErrNotFound)
+            {
+            iCachedImages[i]->iActiveUsers.Remove(index);
+            iHasReleasedImages = ETrue;
+            }
+        }
+    
+    // Render buffers are _not_ released together with images and text    
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::DeleteAllReleasedEntries(TBool aAllowKeepCached)
+    {
+    // Texts
+    if (iHasReleasedTexts)
+        {
+        RPointerArray<CHuiCanvasTextImage> unusedEntries;
+        
+        FindUnusedTextEntries(unusedEntries);
+            
+        // Remove unused entries if they fit into the cache, leave last used ones in the cache if cache size allows
+        if (aAllowKeepCached)
+            {                
+            SelectPreservedUnusedTextEntries(unusedEntries);            
+            }
+        
+        DeleteUnusedTextEntries(unusedEntries);
+
+        unusedEntries.Close();                
+        iHasReleasedTexts = EFalse;                        
+        }
+
+    // Images
+    if (iHasReleasedImages)
+        {
+        RPointerArray<CHuiCanvasGraphicImage> unusedEntries;
+
+        FindUnusedImageEntries(unusedEntries);
+
+        // Remove unused entries if they fit into the cache, leave last used ones in the cache if cache size allows
+        if (aAllowKeepCached)
+            {                
+            SelectPreservedUnusedImageEntries(unusedEntries);            
+            }
+
+        DeleteUnusedImageEntries(unusedEntries);
+            
+        unusedEntries.Close();                            
+        iHasReleasedImages = EFalse;                                        
+        }
+    
+    // Render buffers
+    if (iHasReleasedRenderBuffers)
+        {
+        RPointerArray<CHuiCanvasRenderBufferImage> unusedEntries;
+
+        FindUnusedRenderBufferEntries(unusedEntries);
+
+        // Remove unused entries if they fit into the cache, leave last used ones in the cache if cache size allows
+        if (aAllowKeepCached)
+            {                
+            SelectPreservedUnusedRenderBufferEntries(unusedEntries);            
+            }
+
+        DeleteUnusedRenderBufferEntries(unusedEntries);
+            
+        unusedEntries.Close();                            
+        iHasReleasedRenderBuffers = EFalse;                                        
+        }    
+    }
+
+#ifdef HUI_DEBUG_PRINT_CANVAS_TEXTURE_CACHE_EGL
+#include "eglext.h"
+typedef EGLBoolean (*NOK_resource_profiling)(EGLDisplay, EGLint, EGLint*, EGLint, EGLint*);
+
+void ReportGraphicsMemoryUsage()
+    {
+	RDebug::Print(_L("About to ask EGL profiling ext"));
+    EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+	
+    /*
+     ** Search for extName in the extensions string.  Use of strstr()
+     ** is not sufficient because extension names can be prefixes of
+     ** other extension names.  Could use strtok() but the constant
+     ** string returned by glGetString can be in read-only memory.
+     */
+   /* TBool extensionFound = EFalse;
+    char *p = (char *) eglQueryString(dpy,EGL_EXTENSIONS);
+    char *end;
+    int extNameLen = strlen("EGL_NOK_resource_profiling");
+    end = p + strlen(p);
+
+    while (p < end) 
+        {
+        int n = strcspn(p, " ");
+        if ((extNameLen == n) && (strncmp("EGL_NOK_resource_profiling", p, n) == 0)) 
+            {
+            extensionFound = ETrue;
+            break;
+            }
+        p += (n + 1);
+        }
+  
+    if (!extensionFound)
+        {
+        TRACES("EGL_NOK_resource_profiling not found from EGL_EXTENSIONS");
+        }*/
+    // okay, let's fetch the function ptr to our profiling functions
+    // resource profiling extension function ptr
+    NOK_resource_profiling eglQueryProfilingData = (NOK_resource_profiling)eglGetProcAddress("eglQueryProfilingDataNOK");
+    if (!eglQueryProfilingData)
+        {
+	   	RDebug::Print(_L("EGL profiling ext not present"));
+        return;
+        }
+
+    EGLint data_count;
+    EGLint* prof_data;
+    TInt i(0);
+
+	/* Find out how much profiling data is available */
+	eglQueryProfilingData(dpy, EGL_PROF_QUERY_GLOBAL_BIT_NOK | EGL_PROF_QUERY_MEMORY_USAGE_BIT_NOK,
+							NULL, 0, &data_count);
+
+	/* Allocate room for the profiling data */
+	prof_data = (EGLint*)User::Alloc(data_count * sizeof(EGLint));
+	if (prof_data == NULL)
+		{
+		RDebug::Print(_L("Could not get mem for EGL profiling ext"));
+		return;
+		}
+	/* Retrieve the profiling data */
+	eglQueryProfilingData(dpy,
+							 EGL_PROF_QUERY_GLOBAL_BIT_NOK |
+							 EGL_PROF_QUERY_MEMORY_USAGE_BIT_NOK,
+							 prof_data,
+							 data_count,
+							 &data_count);
+
+	/* Iterate over the returned data */
+	while (i < data_count)
+		{
+		switch (prof_data[i++])
+			{
+			case EGL_PROF_USED_MEMORY_NOK:
+				{
+				RDebug::Print(_L("EGL Profiling: used mem %d"), prof_data[i++]);
+				break;
+				}
+			case EGL_PROF_TOTAL_MEMORY_NOK:
+				{
+				RDebug::Print(_L("EGL Profiling: total mem available: %d"), prof_data[i++]);
+				break;
+				}
+		    case EGL_PROF_THREAD_ID_NOK:
+                {
+                if (sizeof(EGLNativeThreadIdTypeNOK) == 8)
+                    {
+                    i+=2;
+                    }
+                else
+                    {
+                    i++;
+                    }
+                break;
+                }
+            case EGL_PROF_THREAD_USED_PRIVATE_MEMORY_NOK:
+            case EGL_PROF_THREAD_USED_SHARED_MEMORY_NOK:
+			default:
+				{
+                i++;
+				break;
+				}
+			}
+		}
+
+	User::Free(prof_data);
+    }
+
+#endif
+    
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::AdvanceTime()
+    {
+#ifdef HUI_DEBUG_PRINT_CANVAS_TEXTURE_CACHE
+    RDebug::Print(_L("-- CHuiCanvasTextureCache::AdvanceTime: begin --"));
+    if (IsLowMemoryStateEnabled())
+        {        
+        RDebug::Print(_L("-- CHuiCanvasTextureCache::AdvanceTime: LOW MEMORY STATE ENABLED"));
+        }    
+    if(iEglProfiling > 10)
+        {
+#ifdef HUI_DEBUG_PRINT_CANVAS_TEXTURE_CACHE_EGL
+        ReportGraphicsMemoryUsage();
+#endif
+        iEglProfiling = 0;
+        }
+    else
+        {
+        iEglProfiling++; 
+        }           
+#endif
+
+    // We do not delete all, by leaving something unused in the cache
+    // we can improve performance.
+    CalculateGraphicsMemoryUsage();
+    DeleteAllReleasedEntries(ETrue);        
+
+    // Reset bitmap sizes to save memory. Commented out as resize appears to
+    // be relatively slow (0.2 - 0.5 ms). Not resizing here means that it uses
+    // more RAM between frames.
+    //iTempMask->Resize(KEmptyBitmapSize);
+    //iTempBitmap->Resize(KEmptyBitmapSize);                        
+    
+    //iFontHandle = 0;
+    //delete iFont;
+    //iFont = NULL;
+
+#ifdef HUI_DEBUG_PRINT_CANVAS_TEXTURE_CACHE
+    RDebug::Print(_L("-- Cached texts: %i --"), iCachedTexts.Count());
+    RDebug::Print(_L("-- Cached imgs : %i --"), iCachedImages.Count());
+
+    TInt totalPixels = 0;
+
+    for(TInt i=iCachedTexts.Count() - 1; i >= 0; i--)
+        {    
+        TSize size = iCachedTexts[i]->iTexture->Size();    
+        RDebug::Print(_L("-- Cached text: %ix%i, users=%i, string=%S --"), size.iWidth, size.iHeight, iCachedTexts[i]->iActiveUsers.Count(), iCachedTexts[i]->iText );
+        totalPixels += size.iWidth * size.iHeight;
+
+#ifdef HUI_DEBUG_PRINT_CANVAS_TEXTURE_CACHE_EXTENDED
+
+        RDebug::Print(_L("--   iFontHandle: %i --"), iCachedTexts[i]->iFontHandle );
+        RDebug::Print(_L("--   iTextWidth: %i --"), iCachedTexts[i]->iTextWidth );
+        RDebug::Print(_L("--   iTextBoxMaxSize.iWidth: %i --"), iCachedTexts[i]->iTextBoxMaxSize.iWidth );
+        RDebug::Print(_L("--   iBaseLineOffset: %i --"), iCachedTexts[i]->iBaseLineOffset );
+        RDebug::Print(_L("--   iTextAlign: %i --"), iCachedTexts[i]->iTextAlign );
+        RDebug::Print(_L("--   iMargin: %i --"), iCachedTexts[i]->iMargin );
+        RDebug::Print(_L("--   iAngle: %i --"), iCachedTexts[i]->iAngle );
+        RDebug::Print(_L("--   iTextParams.iStart: %i --"), iCachedTexts[i]->iTextParams.iStart );
+        RDebug::Print(_L("--   iTextParams.iEnd: %i --"), iCachedTexts[i]->iTextParams.iEnd );
+        RDebug::Print(_L("--   iTextParams.iFlagst: %i --"), iCachedTexts[i]->iTextParams.iFlags );
+        
+
+        THuiCachedGcParams p = iCachedTexts[i]->iGcParams;    
+        RDebug::Print(_L("--    iPenColor: %i --"), p.iPenColor );
+        RDebug::Print(_L("--    iPenStyle: %i --"), p.iPenStyle );
+        RDebug::Print(_L("--    iDrawMode: %i --"), p.iDrawMode );
+        RDebug::Print(_L("--    iBrushColor: %i --"), p.iBrushColor );
+        RDebug::Print(_L("--    iBrushStyle: %i --"), p.iBrushStyle );
+        RDebug::Print(_L("--    iShadowMode: %i --"), p.iShadowMode );
+        RDebug::Print(_L("--    iStrikethrough: %i --"), p.iStrikethrough );
+        RDebug::Print(_L("--    iUnderline: %i --"), p.iUnderline );
+        RDebug::Print(_L("--    iUserDisplayMode: %i --"), p.iUserDisplayMode );
+        RDebug::Print(_L("--    iShadowColor: %i --"), p.iShadowColor );
+#endif
+        }
+
+    for(TInt i=iCachedImages.Count() - 1; i >= 0; i--)
+        {    
+        TSize size = iCachedImages[i]->iTexture->Size();    
+        if (iCachedImages[i]->iSubImages.Count())
+            {
+            RDebug::Print(_L("-- Cached combined image: %i+%i  %ix%i, users=%i --"), iCachedImages[i]->iBitmapHandle, iCachedImages[i]->iMaskHandle, size.iWidth, size.iHeight, iCachedImages[i]->iActiveUsers.Count());                        
+            RDebug::Print(_L("--  Blit size: %ix%i --"), iCachedImages[i]->iImageSize.iWidth, iCachedImages[i]->iImageSize.iHeight);                            
+            for (TInt j=0; j<iCachedImages[i]->iSubImages.Count();j++)
+                {
+                RDebug::Print(_L("--  subimage: %i+%i Point: %i,%i--"), 
+                    iCachedImages[i]->iSubImages[j].iBitmapHandle, 
+                    iCachedImages[i]->iSubImages[j].iMaskHandle, 
+                    iCachedImages[i]->iSubImages[j].iCombinedBitmapPoint.iX,
+                    iCachedImages[i]->iSubImages[j].iCombinedBitmapPoint.iY);        
+                }            
+            }
+        else
+            {
+            RDebug::Print(_L("-- Cached image: %i+%i  %ix%i, users=%i --"), iCachedImages[i]->iBitmapHandle,iCachedImages[i]->iMaskHandle, size.iWidth, size.iHeight, iCachedImages[i]->iActiveUsers.Count());        
+            }    
+        
+        totalPixels += size.iWidth * size.iHeight;
+        }
+        
+    RDebug::Print(_L("-- Estimated canvas texture mem usage with 32bpp %i KBytes --"), totalPixels*4 / 1024);
+
+    TInt unusedCanvasTextures = CalculateUnusedCanvasTextureUsageInKbytes();
+
+    RDebug::Print(_L("-- Estimated canvas unused texture mem usage with 32bpp %i KBytes --"), unusedCanvasTextures);
+
+    TInt totalUsedTextureMemoryInKBytes = CHuiStatic::Env().TextureManager().EstimatedTextureMemUsage(KHuiTextureEstimatedBpp) / 1024;
+    
+    RDebug::Print(_L("-- Estimated total texture mem usage with 32bpp %i KBytes --"), totalUsedTextureMemoryInKBytes);
+
+    TInt totalPixelsForRenderBuffers = 0;
+    for(TInt i=iCachedRenderBuffers.Count() - 1; i >= 0; i--)
+        {
+        if (iCachedRenderBuffers[i]->iCanvasRenderBuffer)
+            {
+            TSize size = iCachedRenderBuffers[i]->iCanvasRenderBuffer->Size();    
+            RDebug::Print(_L("-- Cached render buffer: %ix%i, users=%i --"),  size.iWidth, size.iHeight, iCachedRenderBuffers[i]->iActiveUsers.Count());                
+            totalPixelsForRenderBuffers += size.iWidth * size.iHeight;
+            }
+        else
+            {
+            RDebug::Print(_L("-- Cached render buffer: 0x0, users=%i --"), iCachedRenderBuffers[i]->iActiveUsers.Count());                
+            }
+        }
+    RDebug::Print(_L("-- Estimated canvas render buffer mem usage with 32bpp %i KBytes --"), totalPixelsForRenderBuffers*4 / 1024);    
+    
+    TInt totalAllocSize = 0;
+    User::AllocSize(totalAllocSize);
+    RDebug::Print(_L("-- User::AllocSize = %i"), totalAllocSize);
+
+    RDebug::Print(_L("-- CHuiCanvasTextureCache::AdvanceTime: end --"));
+#endif
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::FindUnusedImageEntries(RPointerArray<CHuiCanvasGraphicImage>& aIndexEntries)
+    {
+    for(TInt i=iCachedImages.Count() - 1; i >= 0; i--)
+        {
+        CHuiCanvasGraphicImage* entry = iCachedImages[i];    
+        if (!entry->iActiveUsers.Count())
+            {
+            aIndexEntries.InsertInOrderAllowRepeats(entry, ImageTimeOrderFunc);
+            }
+        }    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::FindUnusedTextEntries(RPointerArray<CHuiCanvasTextImage>& aIndexEntries)
+    {
+    for(TInt i=iCachedTexts.Count() - 1; i >= 0; i--)
+        {                
+        CHuiCanvasTextImage* entry = iCachedTexts[i];    
+
+        if (!entry->iActiveUsers.Count())
+            {
+            aIndexEntries.InsertInOrderAllowRepeats(entry, TextTimeOrderFunc);
+            }
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::FindUnusedRenderBufferEntries(RPointerArray<CHuiCanvasRenderBufferImage>& aIndexEntries)
+    {
+    for(TInt i=iCachedRenderBuffers.Count() - 1; i >= 0; i--)
+        {                
+        CHuiCanvasRenderBufferImage* entry = iCachedRenderBuffers[i];    
+
+        if (!entry->iActiveUsers.Count())
+            {
+            aIndexEntries.InsertInOrderAllowRepeats(entry, RenderBufferTimeOrderFunc);
+            }
+        }            
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::DeleteUnusedImageEntries(RPointerArray<CHuiCanvasGraphicImage>& aIndexEntries)
+    {
+    // Remove given entries
+    for(TInt i=aIndexEntries.Count() - 1; i >= 0; i--)
+        {
+        TInt indexEntry = iCachedImages.FindInOrder(aIndexEntries[i], ImageOrderFunc);
+        if (indexEntry != KErrNotFound)
+            {                        
+            CHuiCanvasGraphicImage* entry = iCachedImages[indexEntry];
+            iCachedImages.Remove(indexEntry); 
+            delete entry;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::DeleteUnusedTextEntries(RPointerArray<CHuiCanvasTextImage>& aIndexEntries)
+    {
+    // Remove given entries
+    for(TInt i=aIndexEntries.Count() - 1; i >= 0; i--)
+        {                
+        TInt indexEntry = iCachedTexts.FindInOrder(aIndexEntries[i], TextOrderFunc);
+        if (indexEntry != KErrNotFound)
+            {                        
+            CHuiCanvasTextImage* entry = iCachedTexts[indexEntry];
+            iCachedTexts.Remove(indexEntry); 
+            delete entry;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::DeleteUnusedRenderBufferEntries(RPointerArray<CHuiCanvasRenderBufferImage>& aIndexEntries)
+    {
+    // Remove given entries
+    for(TInt i=aIndexEntries.Count() - 1; i >= 0; i--)
+        {                
+        TInt indexEntry = iCachedRenderBuffers.FindInOrder(aIndexEntries[i], RenderBufferOrderFunc);
+        if (indexEntry != KErrNotFound)
+            {                        
+            CHuiCanvasRenderBufferImage* entry = iCachedRenderBuffers[indexEntry];
+            iCachedRenderBuffers.Remove(indexEntry);
+            delete entry;            
+            }
+        }    
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::SelectPreservedUnusedImageEntries(RPointerArray<CHuiCanvasGraphicImage>& aIndexEntries)
+    {
+    TInt totalUnusedTextureBytes = 0;
+
+    // Remove unused entries if they fit into the cache, leave last used ones in the cache if cache size allows
+    for(TInt i=aIndexEntries.Count() - 1; i >= 0; i--)
+        {
+        // Always delete bitmaps from unused entries, we can again duplicate pointers from handles when needed.
+        // Pointers are kept only for perfromance reasons.
+        CHuiCanvasGraphicImage* entry = aIndexEntries[i];
+
+        delete entry->iBitmap;    
+        entry->iBitmap = NULL;
+
+        delete entry->iMask;    
+        entry->iMask = NULL;        
+        
+        for (TInt j=0; j < entry->iSubImages.Count(); j++)
+            {
+            delete entry->iSubImages[j].iBitmap;
+            entry->iSubImages[j].iBitmap = NULL;
+            
+            delete entry->iSubImages[j].iMask;
+            entry->iSubImages[j].iMask = NULL;    
+            }
+                    
+        TSize textureSize = entry->iTexture->Size();    
+        TInt textureEstimatedSizeInBytes = textureSize.iWidth * textureSize.iHeight * KHuiCanvasImageEstimatedBpp/8.f;
+
+        if (totalUnusedTextureBytes + textureEstimatedSizeInBytes < iUnusedCanvasImageTextureCacheSizeInKBytes*1024)
+            {
+            // Fits in the cache, remove from unused list, but keep zero size textures                        
+            if (textureEstimatedSizeInBytes != 0)
+                {
+                aIndexEntries.Remove(i);        
+                }            
+            }
+
+        totalUnusedTextureBytes += textureEstimatedSizeInBytes;
+        }                
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::SelectPreservedUnusedTextEntries(RPointerArray<CHuiCanvasTextImage>& aIndexEntries)
+    {
+    TInt totalUnusedTextureBytes = 0;
+
+    // Remove unused entries if they fit into the cache, leave last used ones in the cache if cache size allows
+    for(TInt i=aIndexEntries.Count() - 1; i >= 0; i--)
+        {
+        TSize textureSize = aIndexEntries[i]->iTexture->Size();    
+        TInt textureEstimatedSizeInBytes = textureSize.iWidth * textureSize.iHeight * KHuiCanvasTextEstimatedBpp/8.f;
+            
+        if (totalUnusedTextureBytes + textureEstimatedSizeInBytes < iUnusedCanvasTextTextureCacheSizeInKBytes*1024)
+            {
+            // Fits in the cache, remove from unused list, but keep zero size textures                         
+            if (textureEstimatedSizeInBytes != 0)
+                {
+                aIndexEntries.Remove(i);
+                }
+            }
+
+        totalUnusedTextureBytes += textureEstimatedSizeInBytes;        
+        }        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::SelectPreservedUnusedRenderBufferEntries(RPointerArray<CHuiCanvasRenderBufferImage>& aIndexEntries)
+    {
+    TInt totalUnusedRenderBufferBytes = 0;
+
+    // Remove unused entries if they fit into the cache, leave last used ones in the cache if cache size allows
+    for(TInt i=aIndexEntries.Count() - 1; i >= 0; i--)
+        {
+        CHuiCanvasRenderBufferImage* entry = aIndexEntries[i];
+        if (entry->iCanvasRenderBuffer)
+            {
+            TSize renderBufferSize = entry->iCanvasRenderBuffer->Size();    
+            TInt renderBufferEstimatedSizeInBytes = renderBufferSize.iWidth * renderBufferSize.iHeight * KHuiCanvasRenderBufferEstimatedBpp/8.f;
+                
+            if (totalUnusedRenderBufferBytes + renderBufferEstimatedSizeInBytes < iUnusedCanvasRenderBufferCacheSizeInKBytes*1024)
+                {
+                aIndexEntries.Remove(i);
+                }
+            totalUnusedRenderBufferBytes += renderBufferEstimatedSizeInBytes;        
+            }
+        else
+            {
+#ifdef HUI_DEBUG_PRINT_CANVAS_TEXTURE_CACHE            
+            RDebug::Print(_L("CHuiCanvasTextureCache::PurgeUnusedRenderBufferEntries: Non existing render buffer, Render does not support canvas render buffers ?"));
+#endif
+            }
+        }            
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::HandleOutOfTextureMemory()
+    {
+    RDebug::Print(_L("CHuiCanvasTextureCache::HandleOutOfTextureMemory: Out of memory happened !"));
+
+    DeleteAllReleasedEntries(EFalse);    
+    
+    // TODO: Who you gonna call when texture memory is full and we cannot ourself
+    // delete anymore textures ? 
+    //
+    // Grim reaper ?!
+    //
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::CalculateGraphicsMemoryUsage()
+    {
+    // TODO: This should handle NVG textures
+
+    if (iMaxTextureMemoryInKBytes)
+        {
+        // How much all alfred textures use memory currently, this include alf apps and all canvas textures
+        TInt totalUsedTextureMemoryInKBytes = CHuiStatic::Env().TextureManager().EstimatedTextureMemUsage(KHuiTextureEstimatedBpp) / 1024;
+
+        // How much there are unused textures cached currently
+        TInt totalUnusedCanvasTextureMemoryUsageInKBytes = CalculateUnusedCanvasTextureUsageInKbytes();
+
+        // Calculate how much there is space for unused textures 
+        TInt availableCacheSizeInKBytes = iMaxTextureMemoryInKBytes - (totalUsedTextureMemoryInKBytes - totalUnusedCanvasTextureMemoryUsageInKBytes);
+
+        // Divide available space for unused textures between texts and images using defined ratio
+        if (availableCacheSizeInKBytes > 0)
+            {
+            iUnusedCanvasTextTextureCacheSizeInKBytes = availableCacheSizeInKBytes * KHuiCanvasUnusedTextImageCacheRatio;
+            iUnusedCanvasImageTextureCacheSizeInKBytes = availableCacheSizeInKBytes * (1.f - KHuiCanvasUnusedTextImageCacheRatio);                            
+            }
+        else
+            {
+            iUnusedCanvasTextTextureCacheSizeInKBytes = 0;
+            iUnusedCanvasImageTextureCacheSizeInKBytes = 0;  
+            }    
+        }
+    else
+        {
+        iUnusedCanvasTextTextureCacheSizeInKBytes = 0;
+        iUnusedCanvasImageTextureCacheSizeInKBytes = 0;          
+        }
+    
+    if (iMaxRenderBufferMemoryInKBytes)
+        {
+        // How much there are render buffers cached currently
+        TInt totalInKBytes = CalculateTotalCanvasRenderBufferUsageInKbytes();
+
+        // How much available for unused
+        TInt availableCacheSizeInKBytes = iMaxRenderBufferMemoryInKBytes - totalInKBytes;
+
+        if (availableCacheSizeInKBytes > 0)
+            {
+            iUnusedCanvasRenderBufferCacheSizeInKBytes = iMaxRenderBufferMemoryInKBytes - totalInKBytes;
+            }
+        else
+            {
+            iUnusedCanvasRenderBufferCacheSizeInKBytes = 0;
+            }    
+        }
+    else
+        {
+        iUnusedCanvasRenderBufferCacheSizeInKBytes = 0;
+        }
+
+#ifdef HUI_DEBUG_PRINT_CANVAS_TEXTURE_CACHE
+    RDebug::Print(_L("-- CHuiCanvasTextureCache::CalculateTextureUsage: iUnusedCanvasTextTextureCacheSizeInKBytes = %i"), iUnusedCanvasTextTextureCacheSizeInKBytes);
+    RDebug::Print(_L("-- CHuiCanvasTextureCache::CalculateTextureUsage: iUnusedCanvasImageTextureCacheSizeInKBytes = %i"), iUnusedCanvasImageTextureCacheSizeInKBytes);
+    RDebug::Print(_L("-- CHuiCanvasTextureCache::CalculateTextureUsage: iUnusedCanvasRenderBufferCacheSizeInKBytes = %i"), iUnusedCanvasRenderBufferCacheSizeInKBytes);
+#endif
+    }
+
+void CHuiCanvasTextureCache::EnableTouchCountCheck(TBool aEnable)
+    {
+    iTouchCountCheckEnabled = aEnable;
+    }
+
+TBool CHuiCanvasTextureCache::IsTouchCountCheckEnabled()
+    {
+    return iTouchCountCheckEnabled;   
+    }    
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CHuiCanvasTextureCache::CalculateUnusedCanvasTextureUsageInKbytes()
+    {
+    // TODO: This should handle NVG textures
+    
+    TInt totalUnusedTextureBytes = 0;
+    
+    // Texts
+    RPointerArray<CHuiCanvasTextImage> textEntries;
+    
+    FindUnusedTextEntries(textEntries);
+
+    for(TInt i=textEntries.Count() - 1; i >= 0; i--)
+        {
+        TSize textureSize = textEntries[i]->iTexture->Size();    
+        totalUnusedTextureBytes += textureSize.iWidth * textureSize.iHeight * KHuiCanvasTextEstimatedBpp/8.f;
+        }            
+    
+    textEntries.Close();        
+
+    // Images
+    RPointerArray<CHuiCanvasGraphicImage> imageEntries;
+    
+    FindUnusedImageEntries(imageEntries);
+
+    for(TInt i=imageEntries.Count() - 1; i >= 0; i--)
+        {
+        TSize textureSize = imageEntries[i]->iTexture->Size();    
+        totalUnusedTextureBytes += textureSize.iWidth * textureSize.iHeight * KHuiCanvasImageEstimatedBpp/8.f;
+        }            
+    
+    imageEntries.Close();        
+    
+    return totalUnusedTextureBytes/1024;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CHuiCanvasTextureCache::CalculateUnusedCanvasRenderBufferUsageInKbytes()
+    {
+    TInt totalUnusedRenderBufferBytes = 0;
+    
+    RPointerArray<CHuiCanvasRenderBufferImage> entries;
+    
+    FindUnusedRenderBufferEntries(entries);
+
+    for(TInt i=entries.Count() - 1; i >= 0; i--)
+        {
+        if (iCachedRenderBuffers[i]->iCanvasRenderBuffer)
+            {        
+            TSize renderBufferSize = entries[i]->iCanvasRenderBuffer->Size();    
+            totalUnusedRenderBufferBytes += renderBufferSize.iWidth * renderBufferSize.iHeight * KHuiCanvasRenderBufferEstimatedBpp/8.f;
+            }
+        }            
+    
+    entries.Close();        
+
+    return totalUnusedRenderBufferBytes/1024;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CHuiCanvasTextureCache::CalculateTotalCanvasRenderBufferUsageInKbytes()
+    {
+    TInt totalRenderBufferBytes = 0;
+    for(TInt i=iCachedRenderBuffers.Count() - 1; i >= 0; i--)
+        {
+        if (iCachedRenderBuffers[i]->iCanvasRenderBuffer)
+            {
+            TSize renderBufferSize = iCachedRenderBuffers[i]->iCanvasRenderBuffer->Size();    
+            totalRenderBufferBytes += renderBufferSize.iWidth * renderBufferSize.iHeight * KHuiCanvasRenderBufferEstimatedBpp/8.f;
+            }
+        }     
+    return totalRenderBufferBytes/1024;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CHuiTexture* CHuiCanvasTextureCache::CreateRecycledTextureL()
+    {
+    CHuiTexture* texture = NULL;
+    if (iRecycledTextures.Count())
+        {
+        // If there are recycled textures, use one of those
+        TInt last = iRecycledTextures.Count() - 1;
+        texture = iRecycledTextures[last];
+        iRecycledTextures.Remove(last);    
+        }
+    else
+        {
+        // No recycled textures available, create new one
+        texture = CHuiTexture::NewL();    
+        }    
+    return texture;        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::DeleteRecycledTexture(CHuiTexture* aTexture)
+    {
+    aTexture->Reset();
+
+    TInt error = KErrNone;
+    
+    if (iRecycledTextures.Count() < KHuiMaxRecycledTextureCount)
+        {
+        error = iRecycledTextures.Append(aTexture);            
+        if (error)
+            {
+            delete aTexture;    
+            }
+        }
+    else
+        {
+        delete aTexture;        
+        }            
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CHuiCanvasRenderBuffer* CHuiCanvasTextureCache::CreateCachedRenderBufferL(const CHuiCanvasVisual& aUser, TSize aSizeHint)
+    {
+    if (IsLowMemoryStateEnabled())
+        {
+        // No canvas render buffers created in low memory state
+        return NULL;
+        }    
+    
+    TInt cachedEntry = KErrNotFound;
+    CHuiCanvasRenderBufferImage* newRenderBufferEntry = NULL;
+    
+    iSearchedRenderBufferImageEntry->Reset();        
+    iSearchedRenderBufferImageEntry->iOwner = (TAny*)&aUser;
+    
+    cachedEntry = iCachedRenderBuffers.FindInOrder(iSearchedRenderBufferImageEntry, RenderBufferOrderFunc);
+    
+    if (cachedEntry == KErrNotFound)
+        {
+        // Try first getting reused render buffer
+        newRenderBufferEntry = ReUseReleasedRenderBuffer(aSizeHint);
+
+        // Create new entry object if needed
+        if (!newRenderBufferEntry)
+            {
+            newRenderBufferEntry = new (ELeave) CHuiCanvasRenderBufferImage;             
+            }
+
+        // Copy attributes (only iOwner attribute)
+        newRenderBufferEntry->iOwner = iSearchedRenderBufferImageEntry->iOwner;
+        
+        CleanupStack::PushL(newRenderBufferEntry);                    
+        
+        // Create new render buffer
+        if (!newRenderBufferEntry->iCanvasRenderBuffer)
+            {
+            newRenderBufferEntry->iCanvasRenderBuffer = iCanvasGc->CreateRenderBufferL(TSize(0,0)); 
+            }
+
+        // Insert to cache array
+        TInt insertSuccess = iCachedRenderBuffers.InsertInOrder(newRenderBufferEntry, RenderBufferOrderFunc);
+        __ASSERT_DEBUG( !insertSuccess, USER_INVARIANT() );
+        User::LeaveIfError( insertSuccess );
+        
+        // We don't know which index it got, so look it up
+        cachedEntry = iCachedRenderBuffers.FindInOrder(newRenderBufferEntry, RenderBufferOrderFunc);
+
+        CleanupStack::Pop(newRenderBufferEntry); 
+        }
+    else
+        {
+        // If it was found, great. 
+        }        
+    
+    iCachedRenderBuffers[cachedEntry]->RefreshUser(aUser);
+
+    return iCachedRenderBuffers[cachedEntry]->iCanvasRenderBuffer;                
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CHuiCanvasRenderBuffer* CHuiCanvasTextureCache::FindCachedRenderBuffer(const CHuiCanvasVisual& aUser)
+    {
+    TInt cachedEntry = KErrNotFound;
+    
+    iSearchedRenderBufferImageEntry->Reset();        
+    iSearchedRenderBufferImageEntry->iOwner = (TAny*)&aUser;
+    
+    cachedEntry = iCachedRenderBuffers.FindInOrder(iSearchedRenderBufferImageEntry, RenderBufferOrderFunc);
+    if (cachedEntry != KErrNotFound)
+        {
+        iCachedRenderBuffers[cachedEntry]->RefreshUser(aUser);
+        return iCachedRenderBuffers[cachedEntry]->iCanvasRenderBuffer;                    
+        }
+    else
+        {
+        return NULL;                            
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasTextureCache::ReleaseCachedRenderBuffer(const CHuiCanvasVisual& aUser)
+    {
+    TInt cachedEntry = KErrNotFound;
+    
+    iSearchedRenderBufferImageEntry->Reset();        
+    iSearchedRenderBufferImageEntry->iOwner = (TAny*)&aUser;
+    
+    cachedEntry = iCachedRenderBuffers.FindInOrder(iSearchedRenderBufferImageEntry, RenderBufferOrderFunc);
+    if (cachedEntry != KErrNotFound)
+        {
+        CHuiCanvasRenderBufferImage* releasedEntry = iCachedRenderBuffers[cachedEntry];        
+        iCachedRenderBuffers.Remove(cachedEntry);
+        releasedEntry->RemoveUser(aUser);
+        releasedEntry->iOwner = releasedEntry; // No real owner anymore, se it self as owner
+ 
+        if(!IsLowMemoryStateEnabled())
+            {
+            // re-insert released entry (new position in the array order because we clered iOwner)
+            TInt insertSuccess = iCachedRenderBuffers.InsertInOrder(releasedEntry, RenderBufferOrderFunc);
+        
+            if (insertSuccess != KErrNone)
+                {
+                // oh no re-insert failed, now we must delete the entry to avoid memory leak.
+                delete releasedEntry;
+                }
+            }
+        else
+            {
+            delete releasedEntry;
+            }
+        
+        iHasReleasedRenderBuffers = ETrue;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CHuiCanvasRenderBufferImage* CHuiCanvasTextureCache::ReUseReleasedRenderBuffer(TSize aSizeHint)
+    {
+    if (aSizeHint == TSize(0,0))
+        {
+        return NULL;
+        }
+    
+    for(TInt i=iCachedRenderBuffers.Count() - 1; i >= 0; i--)
+        {
+        // Check if there are any released buffers with have requested size
+        if (!iCachedRenderBuffers[i]->IsAnyUser() && 
+            iCachedRenderBuffers[i]->iCanvasRenderBuffer && 
+            iCachedRenderBuffers[i]->iCanvasRenderBuffer->Size() == aSizeHint)
+            {
+            // Remove from array and return instance to caller
+            CHuiCanvasRenderBufferImage* reusedEntry = iCachedRenderBuffers[i];        
+            iCachedRenderBuffers.Remove(i);
+            return reusedEntry;
+            }
+        }         
+
+    return NULL;
+    }
+
+void CHuiCanvasTextureCache::EnableLowMemoryState(TBool aEnable)
+    {
+    // deprecated
+    }
+
+THuiMemoryLevel CHuiCanvasTextureCache::MemoryLevel()
+    {
+    return iMemoryLevel;
+    }
+
+void CHuiCanvasTextureCache::SetMemoryLevel(THuiMemoryLevel aLevel)
+    {
+    iMemoryLevel = aLevel;
+
+    if (iMemoryLevel <= EHuiMemoryLevelLowest)
+        {
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+RDebug::Print(_L("-- CHuiCanvasTextureCache::SetMemoryLevel: Enabling lowest memory state"));
+#endif
+
+        // Set cache sizes to minimum
+        iMaxTextureMemoryInKBytes = 0;
+        iMaxRenderBufferMemoryInKBytes = 0;
+
+        // Delete images, even if they are in use
+        for(TInt i=iCachedImages.Count() - 1; i >= 0; i--)
+            {
+            CHuiCanvasGraphicImage* entry = iCachedImages[i];    
+            iCachedImages.Remove(i);
+            delete entry;
+            }    
+
+       // Delete texts, even if they are in use
+        for(TInt i=iCachedTexts.Count() - 1; i >= 0; i--)
+            {                
+            CHuiCanvasTextImage* entry = iCachedTexts[i];    
+            iCachedTexts.Remove(i);
+            delete entry;
+            }        
+        
+        
+        // Delete canvas render buffers, even if they are in use
+        for(TInt i=iCachedRenderBuffers.Count() - 1; i >= 0; i--)
+            {                
+            CHuiCanvasRenderBufferImage* entry = iCachedRenderBuffers[i];    
+            iCachedRenderBuffers.Remove(i);
+            delete entry;            
+            }                    
+        }
+    else if (iMemoryLevel <= EHuiMemoryLevelLow)
+        {
+        #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        RDebug::Print(_L("-- CHuiCanvasTextureCache::SetMemoryLevel: Enabling low memory state"));
+        #endif
+        // Set cache sizes to minimum
+        iMaxTextureMemoryInKBytes = 0;
+        iMaxRenderBufferMemoryInKBytes = 0;
+        
+        // Set flags to make sure we check all entries
+        iHasReleasedTexts = ETrue;
+        iHasReleasedImages = ETrue;
+        iHasReleasedRenderBuffers = ETrue;
+        
+        // Delete released cached entries
+        DeleteAllReleasedEntries(EFalse);
+
+        // Delete canvas render buffers, even if they are in use
+        for(TInt i=iCachedRenderBuffers.Count() - 1; i >= 0; i--)
+            {                
+            CHuiCanvasRenderBufferImage* entry = iCachedRenderBuffers[i];    
+            iCachedRenderBuffers.Remove(i);
+            delete entry;            
+            }                    
+        }
+    else
+        {
+        #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        RDebug::Print(_L("-- CHuiCanvasTextureCache::SetMemoryLevel: Disabling low memory state"));
+        #endif
+
+        // TODO: This could be configurable cenrep or something ?
+        iMaxTextureMemoryInKBytes = KHuiMaxRecommendedTextureAmountInKBytes;
+        iMaxRenderBufferMemoryInKBytes = KHuiMaxRecommendedRenderBufferAmountInKBytes;       
+        }    
+    }
+
+TBool CHuiCanvasTextureCache::IsLowMemoryStateEnabled() const
+    {
+    if (iMemoryLevel < EHuiMemoryLevelReduced)
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;        
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiCanvasVisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1270 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiCanvasVisual.
+*
+*/
+
+
+
+#include "uiacceltk/HuiCanvasVisual.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiVisual.h"
+#include "uiacceltk/HuiLayout.h"
+#include "uiacceltk/HuiTextMesh.h"
+#include "uiacceltk/HuiCanvasCmdBufferReader.h"
+#include "uiacceltk/HuiTransformation.h"
+#include "huicanvasgc.h"
+#include "HuiRenderSurface.h"
+#include "huicanvastexturecache.h"
+#include "huicanvasbackground.h"
+#include <graphics/wsgraphicscontext.h>
+#include <e32cmn.h>
+#include <AknLayoutFont.h>
+#include "huicanvasalfpainter.h"
+#include "huicanvaswspainter.h"
+#include "HuiRosterImpl.h"
+#include "huilayoutdata.h"
+#include "Matrix.h"
+
+
+#include "HuiFxEffect.h"
+#include "HuiCmdBufferBrush.h"
+
+/** Flag to convienintly disable/enable canvas render buffer usage if needed */
+/* Turned to EFalse as DFS77 was having booting problems in wk26 */
+/* Now checked dynamically from CHuiRenderer to allow different behaviour in DFS77 and DFS79 */
+//const TBool KHuiCanvasVisualUseRenderBuffer = EFalse; 
+
+NONSHARABLE_STRUCT( CHuiCanvasVisual::THuiCanvasVisualData )
+    {
+    THuiCanvasVisualData(){};
+    TInt iCommandSetType;
+    TInt iCanvasFlags;
+    
+    // Canvas background
+    CHuiCanvasBackground* iBackground;    
+    CHuiCanvasPainter* iCanvasPainter;
+
+	// External draw content. Can be layout visual that have child visuals.
+    CHuiVisual* iExternalContentVisual; // Not owned
+    
+    CHuiCanvasVisual* iParentCanvas; // Not owned
+    RPointerArray<CHuiCanvasVisual> iChildCanvasList; // Does not own contained visuals 
+    RRegionBuf<5> iClipRegion;
+    RRegionBuf<20> iPaintedRegion;
+    CHuiCanvasRenderBuffer* iStoredRenderBuffer;
+    
+    // For handling possible background surface that window may have
+    TBool iLayerUsesAlphaFlag;
+    TRect iLayerExtent;
+    };
+
+EXPORT_C CHuiCanvasVisual* CHuiCanvasVisual::AddNewL(CHuiControl& aOwnerControl,
+                                                 CHuiLayout* aParentLayout)
+    {
+    CHuiCanvasVisual* canvas = STATIC_CAST(CHuiCanvasVisual*,
+        aOwnerControl.AppendVisualL(EHuiVisualTypeCanvas, aParentLayout));
+    return canvas;
+    }
+
+
+CHuiCanvasVisual::CHuiCanvasVisual(MHuiVisualOwner& aOwner)
+        : CHuiLayout(aOwner)
+    {
+    }
+
+void CHuiCanvasVisual::ConstructL()
+    {
+    CHuiLayout::ConstructL();
+        
+    iCanvasVisualData = new (ELeave) THuiCanvasVisualData;
+    iCanvasVisualData->iCommandSetType = ECommandBufferWs;
+    iCanvasVisualData->iCanvasFlags = 0;   
+    iCanvasVisualData->iExternalContentVisual = NULL;    
+    iCanvasVisualData->iParentCanvas = NULL;
+    iCanvasVisualData->iBackground = NULL;
+    iCanvasVisualData->iCanvasPainter = NULL;
+    
+    iCanvasVisualData->iBackground = CHuiCanvasBackground::NewL();
+    iCanvasVisualData->iBackground->SetVisual(this);
+    
+    iCanvasVisualData->iCanvasPainter = CHuiCanvasWsPainter::NewL();
+    iCanvasVisualData->iCanvasPainter->SetVisual(this);
+    iCanvasVisualData->iStoredRenderBuffer = 0;
+    
+    TBool useCanvasRenderBuffer = CHuiStatic::Renderer().Allows(EHuiRenderPluginAllowVisualPBufferSurfaces);    
+    iCanvasVisualData->iCanvasPainter->EnableRenderBuffer(useCanvasRenderBuffer); 
+
+    iCanvasVisualData->iLayerUsesAlphaFlag = EFalse;
+    iCanvasVisualData->iLayerExtent = TRect();
+    
+    // subwindow effects
+    EnableBrushesL(ETrue);
+    }
+
+
+CHuiCanvasVisual::~CHuiCanvasVisual()
+    {
+    FreeRenderBuffer();
+    if(iCanvasVisualData->iExternalContentVisual)
+    	{
+    	// Allow the external content visual to be drawn normally
+    	iCanvasVisualData->iExternalContentVisual->ClearFlag(EHuiVisualFlagDrawOnlyAsExternalContent);
+    	}
+    	
+    if (iCanvasVisualData)
+        {
+        ClearCommandSet();
+        delete iCanvasVisualData->iBackground;
+        iCanvasVisualData->iBackground = NULL;
+        delete iCanvasVisualData->iCanvasPainter;
+    	iCanvasVisualData->iCanvasPainter = NULL;
+    	iCanvasVisualData->iExternalContentVisual = NULL;
+    	
+    	// Tell parent that we are destructed
+    	if (iCanvasVisualData->iParentCanvas)
+    	    {
+    	    iCanvasVisualData->iParentCanvas->RemoveChildCanvas(this);
+    	    }
+    	
+    	// Tell children
+        for (TInt i=0; i<iCanvasVisualData->iChildCanvasList.Count(); i++)
+            {
+            iCanvasVisualData->iChildCanvasList[i]->SetParentCanvas(NULL);
+            }
+    	
+        iCanvasVisualData->iPaintedRegion.Close();
+        iCanvasVisualData->iClipRegion.Close();
+        iCanvasVisualData->iChildCanvasList.Close();
+        }
+    
+    delete iCanvasVisualData;
+    iCanvasVisualData = NULL;
+    
+    }
+
+CHuiCanvasGc& CHuiCanvasVisual::CanvasGc() const
+    {
+    return iCanvasVisualData->iCanvasPainter->CanvasGc();
+    }
+
+EXPORT_C void CHuiCanvasVisual::SetClearBackground(CHuiDisplay::TClearMode aClearBackground)
+    {
+    if (iCanvasVisualData->iBackground->ClearBackground() != aClearBackground)
+        {
+        iCanvasVisualData->iBackground->SetClearBackground(aClearBackground);    
+        SetChanged();
+        }
+    }
+
+EXPORT_C void CHuiCanvasVisual::SetBackgroundColor(const TRgb& aBackgroundColor)
+    {
+    if (iCanvasVisualData->iBackground->BackgroundColor() != aBackgroundColor)
+        {
+        iCanvasVisualData->iBackground->SetBackgroundColor(aBackgroundColor);    
+        SetChanged();
+        }
+    }
+
+EXPORT_C void CHuiCanvasVisual::SetBackgroundItems(const RArray<THuiDisplayBackgroundItem>& aItems)
+    {
+    iCanvasVisualData->iBackground->SetBackgroundItems(aItems);    
+    }
+
+
+EXPORT_C void CHuiCanvasVisual::SetExternalContentL(CHuiVisual* aVisual)
+	{
+	if (aVisual)
+		{
+		// Clip external content to canvas visual rect
+		SetClipping(ETrue);
+		}
+	else
+		{
+		SetClipping(EFalse);
+		}
+		
+	iCanvasVisualData->iExternalContentVisual = aVisual;
+	}
+
+EXPORT_C CHuiVisual* CHuiCanvasVisual::ExternalContent()
+	{
+	return iCanvasVisualData->iExternalContentVisual;
+	}
+
+
+void CHuiCanvasVisual::ExpandRectWithContent(TRect& aRect) const
+    {
+    TRect scannedRect(0,0,0,0);
+    
+    // HandleBuffer tries to return area where the drawing actually happens, area
+    // may be smaller than the visuals displayarea. In that case we dont expand
+    // rect but make it smaller.
+    HandleBuffer(scannedRect, EScanBuffer, NULL); 
+    
+    // Note: this could be improved to take care of dirty rects 
+    if (Effect() && Display())
+        {        
+        // If there is effect enabled, we cannot say anything about dirty area so
+        // we set whole screen dirty.
+        scannedRect = TRect(TPoint(0,0), Display()->VisibleArea().Size());
+        }
+    else if (IsBackgroundDrawingEnabled() || IsExternalContentDrawingEnabled())
+        {
+        // If the visual has external content or draws background, 
+        // set always the whole window area as a content.
+        scannedRect = aRect; 
+        }
+    
+    if (scannedRect != TRect(0,0,0,0))
+        {        
+        if (!Brushes())
+            {
+            aRect = scannedRect;                
+            }
+        else
+            {
+            // However if there are brushes they need to know the visual displayrect
+            // so incase scanned rect is smaller we use bounding rect as the expanded rect
+            if (!Clipping())
+                {
+                aRect.BoundingRect(scannedRect);                        
+                }            
+            }    
+        }
+
+    CHuiLayout::ExpandRectWithContent(aRect);
+    }
+
+void CHuiCanvasVisual::HandleBuffer(TRect& aDisplayRect, TInt aAction, CHuiGc* aGc) const
+    {
+    if (iCanvasVisualData->iCommandSetType == ECommandBufferWs || iCanvasVisualData->iCommandSetType == ECommandBufferAlf)
+        {
+        TRAPD(err, iCanvasVisualData->iCanvasPainter->HandleBufferL(aDisplayRect, aAction, *this, aGc, DisplayRect().iTl.Round()));  
+        if (err)
+        	{
+        	HUI_DEBUG2(_L("CHuiCanvasVisual::HandleBufferL returned:%d command type was: %d"), err,iCanvasVisualData->iCommandSetType);
+        	}
+        }
+    else
+        {
+        // do nothing    
+        }                
+    
+    }
+
+
+TBool CHuiCanvasVisual::PrepareDrawL() 
+    {
+	if (Flags() & EHuiVisualFlagDrawOnlyAsExternalContent)
+	   	{
+	    // This is used only as external content visual. Return now if we are not currently drawing
+	    // external content.
+	   	if (!Display() || !Display()->RosterImpl().IsDrawingExternalContent())
+	   		{
+			return ETrue;
+	   		}
+	   	}
+
+    TBool ret = CHuiLayout::PrepareDrawL();
+    
+    if (ret && IsExternalContentDrawingEnabled())
+    	{
+    	if (Display())
+    		{
+    		// Enable drawing external visual tree
+	    	Display()->RosterImpl().SetDrawingExternalContent(ETrue);
+    		ret =  iCanvasVisualData->iExternalContentVisual->PrepareDrawL();
+	    	Display()->RosterImpl().SetDrawingExternalContent(EFalse);
+    		}
+    	}
+    return ret;	
+    }
+    
+    
+void CHuiCanvasVisual::Draw(CHuiGc& aGc) const
+    {
+    if (Flags() & EHuiVisualFlagDrawOnlyAsExternalContent)
+    	{
+   	    // This is used only as external content visual. Return now if we are not currently drawing
+   	    // external content.
+    	if (!Display() || !Display()->RosterImpl().IsDrawingExternalContent())
+    		{
+			return;
+    		}
+    	}
+    
+    TBool semiTranparentEffectActive = (Effect() && Effect()->IsSemitransparent());
+    TBool childWindowEffectActive = (Effect() && EffectIsAppliedToChildren());
+    TBool invisible = (iOpacity.Now() <= EPSILON && !semiTranparentEffectActive);
+    
+    if( invisible || 
+        (!HasCommandBuffers(ETrue /*include children*/) && 
+         !childWindowEffectActive &&
+         !IsBackgroundDrawingEnabled() && 
+         !IsExternalContentDrawingEnabled()&&
+         !IsExternalContentDrawingEnabled(ETrue /*include children*/)
+         
+        ))
+        {
+        // This will not be visible due to being completely transparent, or the visual does not actually draw anything
+    
+        // However, the draw should continue, if the effect is possibly manipulating the opacity of the visual. See CHuiFxVisualLayer::Draw.
+        return;
+        }
+
+    if ((IsDelayedEffectSource() || Freezed()))
+        {
+        if (StoredRenderBuffer())
+            {
+            DrawStoredFullScreenRenderBuffer(aGc);
+            return;
+            }
+        else if (iCanvasVisualData->iStoredRenderBuffer)
+            {
+            DrawStoredVisualRenderBuffer();
+            return;
+			}
+        }  
+    
+    // If this visual is completely under another visual, then this visual 
+    // shouldn't draw anything, but of course there might still be children 
+    // that should be drawn.
+    // For example, consider the case where you have two visuals:
+    // - visual B is child of window A.
+    // - visual A and B have exactly same position and size.
+    // - both are opaque.
+    // Thus, window A can have 'under opaque' hint, but not window B.
+    const TBool drawVisualContent = !( Flags() & EHuiVisualFlagUnderOpaqueHint );
+    
+    THuiRealRect area = DisplayRect();
+
+    // Apply local transformation.
+    EnterLocalProjection(aGc, ETrue, 0.f, &area);
+    Transform(aGc, ETrue, &area);
+
+    if (drawVisualContent)
+        {
+        DrawBrushes(aGc, EHuiBrushLayerBackground);
+        }
+
+    if(Clipping())
+        {
+        // @todo  Clipping not going to work if there is a transformation?
+        // Layout clipping is not affected by transformation.
+        aGc.Enable(CHuiGc::EFeatureClipping);
+        aGc.PushClip();
+        aGc.Clip(area);
+        }
+
+    // Flag to know what we did
+    TBool didDrawEffect = EFalse;
+    
+    if (EffectActive())
+        {
+        // Note that EHuiVisualFlagOpaqueHint improves performance a lot in cached effect drawing 
+        TBool transparent = EFalse; 
+        transparent |= (!(Flags() & EHuiVisualFlagOpaqueHint)); // Does not have opaque hint -> always transparent
+        transparent |= iOpacity.Now() < 1.0f; // Opacity less than 1.0f -> always transparent
+        
+        TBool refreshCache = EFalse;        
+        if (EffectIsAppliedToChildren())
+            {
+            refreshCache |= ChildTreeChanged(EHuiCanvasFlagExcludeFromParentEffect);
+            }
+        else
+            {
+            refreshCache |= Changed();
+            }
+        
+        // TODO: We could update this somewhere else, not here everytime
+        iCanvasVisualData->iPaintedRegion.Clear();
+        TInt paintedAreaCount = PaintedAreaCount();  
+        for (TInt i=0; i<paintedAreaCount; i++ )
+            {
+            iCanvasVisualData->iPaintedRegion.AddRect( CanvasPaintedArea(i).iPaintedRect.Round() );
+            }
+        
+        didDrawEffect = Effect()->CachedDraw(aGc, area, refreshCache, !transparent, iCanvasVisualData->iPaintedRegion);
+        }
+    
+    if ( !didDrawEffect )
+        {
+        DrawSelf(aGc, area);
+        }
+    else
+        {
+        // Effect was drawn, OpenGLES/OpenVG may be in different state than what Gc thinks so we restore it.
+        aGc.RestoreState();        
+        }
+    
+    if (!didDrawEffect)
+        {
+        // Draw all children
+        DrawCanvasChildren(aGc, 0, 0);
+        }
+    else if (didDrawEffect && !EffectIsAppliedToChildren())
+        {
+        // Draw all children
+        DrawCanvasChildren(aGc, 0, 0);    
+        }
+    else if (didDrawEffect && EffectIsAppliedToChildren())
+        {
+        // Draw only children which do not want to have parent effect applied to them
+        DrawCanvasChildren(aGc, EHuiCanvasFlagExcludeFromParentEffect, 0);        
+        }
+
+    if (drawVisualContent && IsContentDrawingEnabled() && IsExternalContentDrawingEnabled())
+    	{
+    	if (Display())
+    		{
+    		// Enable drawing external visual tree
+    		Display()->RosterImpl().SetDrawingExternalContent(ETrue);
+    		// The possible effect has been attached to the layout of the visual itself
+    		// If the external content needs an effect, too, it should probably be defined
+    		// separately, or alternatively the drawing of an effect should be able to 
+    		// handle the external content, too.
+	   		iCanvasVisualData->iExternalContentVisual->Draw(aGc);
+    		Display()->RosterImpl().SetDrawingExternalContent(EFalse);
+    		}
+    	}
+
+    if(Clipping())
+        {
+        // Restore original clipping rectangle.
+        aGc.PopClip();
+        }
+
+    if (drawVisualContent)
+        {
+        DrawBrushes(aGc, EHuiBrushLayerForeground);
+        }
+
+    // Restore original transformation.
+    Transform(aGc, EFalse);
+    EnterLocalProjection(aGc, EFalse);
+    }
+
+
+void CHuiCanvasVisual::DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect) const
+    {
+#ifdef HUI_DEBUG_TRACK_DRAWING	
+    if ( Tracking() )
+        {
+        RDebug::Print(_L("CHuiCanvasVisual::DrawSelf - tracked visual"));
+        }
+#endif		
+      
+    TReal32 effectiveOpacity = EffectiveOpacity();
+        
+    if (effectiveOpacity <= 0 || !HasCommandBuffers(ETrue))
+        {
+        // In case background drawing is enabled, and even if we don't have command buffers we still
+        // want to issue clear. If the background drawing is enabled here, it means that the
+        // window bound to this visual has a background surface. If we dont do the clear, the
+        // surface will be covered by the Alf surface, ie. the underlying surface is not visible
+        // It's quite common for applications using Khronos APIs not to issue any drawing commands, 
+        // as the drawing goes directly via Khronos APIs.
+        // In that case, the background clearing should only be skipped if the window is not 
+        // visible (ie. the visual is inactive), and that should already be handled elsewhere.
+        if (!IsBackgroundDrawingEnabled())
+            {
+            return;
+            }
+        }
+
+    if ((IsDelayedEffectSource() || Freezed()))
+        {
+        if (StoredRenderBuffer())
+            {
+            DrawStoredFullScreenRenderBuffer(aGc);
+			return;
+            }
+        else if (iCanvasVisualData->iStoredRenderBuffer)
+            {
+            DrawStoredVisualRenderBuffer();
+            return;
+            }
+        }    
+
+    // Use 'under opaque' hint to optimize drawing.
+    // See comment from CHuiCanvasVisual::Draw for further details. 
+    const TBool drawVisualContent = !( Flags() & EHuiVisualFlagUnderOpaqueHint );
+
+    // Canvas clipping is done in DrawSelf instead of Draw so that canvas clipping does not clip effects 
+    if (IsCanvasClippingEnabled())
+        {
+        aGc.Enable(CHuiGc::EFeatureClipping);
+        aGc.PushClip();
+        aGc.Clip(ClipRegion());        
+        }
+    
+    // Draws background if it has been defined
+    if (drawVisualContent && IsBackgroundDrawingEnabled())
+        { 
+        iCanvasVisualData->iBackground->DrawSelf(aGc, aDisplayRect); 
+        }
+
+    aGc.Push(EHuiGcMatrixModel);	
+
+    TRect displayRect = aDisplayRect;
+    
+    if (IsContentDrawingEnabled())
+        {
+        // Handle buffer normally unless layered subwindow effects are active
+        if (drawVisualContent && !IsContentDrawingLayered())
+            {        
+            HandleBuffer(displayRect, EDrawBuffer, &aGc);
+            }
+        
+        if (EffectActive() && EffectIsAppliedToChildren())
+            {
+            DrawCanvasChildren(aGc, 0, EHuiCanvasFlagExcludeFromParentEffect);        
+            }
+        }
+	
+    aGc.Pop(EHuiGcMatrixModel);
+    
+    if(IsCanvasClippingEnabled())
+        {
+        // Restore original clipping rectangle.
+        aGc.PopClip();
+        }
+    }
+
+void CHuiCanvasVisual::DrawChildren(CHuiGc& aGc) const
+    {
+    // Draw child windows, begin
+    TBool afterOthers = EFalse;
+    const TInt count = Count();
+    for(TInt i = 0; i < count; ++i)
+        {
+        CHuiVisual* visual = iHuiLayoutPrivateData->iChildren[i];
+        //Ignore inactive child visuals
+        if ( visual->Flags()& EHuiVisualFlagInactive )
+            {
+            continue;
+            }
+        if(visual->Flags() & EHuiVisualFlagDrawAfterOthers)
+            {
+            afterOthers = ETrue;
+            continue;
+            }
+
+        // @todo  No need to draw children that won't be visible.
+        visual->Draw(aGc);
+        }
+    if(afterOthers)
+        {
+        for(TInt i = 0; i < count; ++i)
+            {
+            if(iHuiLayoutPrivateData->iChildren[i]->Flags() & EHuiVisualFlagDrawAfterOthers)
+                {
+                iHuiLayoutPrivateData->iChildren[i]->Draw(aGc);
+                }
+            }
+        }            
+    }
+
+void CHuiCanvasVisual::DrawCanvasChildren(CHuiGc& aGc, TInt aIncludeCanvasFlags, TInt aExcludeCanvasFlags) const
+    {
+    // Draw child windows, begin
+    TBool afterOthers = EFalse;
+    const TInt count = Count();
+    for(TInt i = 0; i < count; ++i)
+        {
+        // This cast is not really safe, but dynamic cast is slow
+        CHuiCanvasVisual* visual = (CHuiCanvasVisual*) iHuiLayoutPrivateData->iChildren[i];
+        //Ignore inactive child visuals
+        if ((visual->Flags()& EHuiVisualFlagInactive))
+            {
+            continue;
+            }
+        
+        if (aIncludeCanvasFlags && !(visual->CanvasFlags()& aIncludeCanvasFlags))
+            {
+            continue;
+            }
+
+        if (aExcludeCanvasFlags && (visual->CanvasFlags()& aExcludeCanvasFlags))
+            {
+            continue;
+            }
+        
+        if(visual->Flags() & EHuiVisualFlagDrawAfterOthers)
+            {
+            afterOthers = ETrue;
+            continue;
+            }
+
+        // @todo  No need to draw children that won't be visible.
+        visual->Draw(aGc);
+        }
+    if(afterOthers)
+        {
+        for(TInt i = 0; i < count; ++i)
+            {
+            if(iHuiLayoutPrivateData->iChildren[i]->Flags() & EHuiVisualFlagDrawAfterOthers)
+                {
+                iHuiLayoutPrivateData->iChildren[i]->Draw(aGc);
+                }
+            }
+        }                
+    }
+
+TBool CHuiCanvasVisual::Changed() const
+    {
+    if (iCanvasVisualData->iCanvasPainter->BuffersChanged())
+        {
+        return ETrue;        
+        }
+    else if(CHuiLayout::Changed())
+        {
+        return ETrue;
+        } 
+        
+    TBool hasChanged = EFalse;     
+    if (IsExternalContentDrawingEnabled())
+    	{
+		hasChanged = iCanvasVisualData->iExternalContentVisual->Changed();
+    	}
+
+   	return hasChanged;
+    }
+
+TBool CHuiCanvasVisual::ChildTreeChanged(TInt aExcludeCanvasFlags) const
+    {
+    // CHuiLayout::Changed() does not check children.  
+    // This utility method checks whole child tree below this visual.
+    TBool changed = EFalse;
+
+    // Check wheter we should include this visual or igonre it.
+    if (aExcludeCanvasFlags)
+        {
+        if (!(iCanvasVisualData->iCanvasFlags & aExcludeCanvasFlags))
+            {
+            changed |= Changed();
+            }        
+        }
+    
+    const TInt count = Count();
+    for(TInt i = 0; i < count; ++i)
+        {
+        CHuiCanvasVisual* visual = (CHuiCanvasVisual*) iHuiLayoutPrivateData->iChildren[i];
+        changed |= visual->ChildTreeChanged(aExcludeCanvasFlags);        
+        if (changed)
+            {
+            break;
+            }
+        }
+    return changed;
+    }
+
+
+EXPORT_C void CHuiCanvasVisual::ClearChanged()
+    {
+    iCanvasVisualData->iCanvasPainter->ClearAllBuffersChanged();
+    CHuiLayout::ClearChanged();
+    }
+
+EXPORT_C void CHuiCanvasVisual::SetChanged()
+    {
+    iCanvasVisualData->iCanvasPainter->SetAllBuffersChanged(ETrue);
+    CHuiLayout::SetChanged();    
+    }
+
+EXPORT_C void CHuiCanvasVisual::SetCommandSetL( const TDesC8& aCommands )
+    {
+    Env().CanvasTextureCache().EnableTouchCountCheck();    
+    ClearCommandSet();
+	TRAP_IGNORE(iCanvasVisualData->iCanvasPainter->SetCommandSetL(aCommands));	
+
+	// Memory optimization. Do not prepare cache if visual is inactive.
+    TBool rosterFrozen = Display() && Display()->Roster().IsVisibleContentFrozen();
+    TBool inactive = EFalse; 
+    inactive |= Flags() & EHuiVisualFlagInactive;
+    inactive |= Flags() & EHuiVisualFlagUnderOpaqueHint;
+
+    if (rosterFrozen || inactive)
+        {
+        ClearCache();
+        }
+    else
+        {
+        PrepareCache();
+        }
+    
+    SetChanged();
+    Env().CanvasTextureCache().EnableTouchCountCheck(EFalse);    
+    }
+
+THuiRealPoint CHuiCanvasVisual::ConvertPoint(const THuiRealPoint& aPointInUnits) const
+    {
+    // Convert first from units to pixels        
+    THuiRealPoint converted = LocalPointInPixels(aPointInUnits);
+    
+    // Pixels are relative to the canvas visual itself, change to display relative
+    THuiRealRect displayRect = DisplayRect();
+    converted.iX += displayRect.iTl.iX;
+    converted.iY += displayRect.iTl.iY;
+
+    return converted;        
+    }
+
+void CHuiCanvasVisual::ExpandRect(TRect& aRectToExpand, const TRect& aNewRect) const
+    {
+    if (aRectToExpand == TRect(0,0,0,0))
+        {
+        aRectToExpand = aNewRect;    
+        }
+    else
+        {
+        aRectToExpand.BoundingRect(aNewRect);            
+        }            
+    }
+    
+EXPORT_C void CHuiCanvasVisual::SetCommandType( TInt aCommandType )
+    {
+    TRAP_IGNORE(SetCommandTypeL(aCommandType));
+    }
+
+EXPORT_C void CHuiCanvasVisual::ClearCommandSet()
+    {
+    iCanvasVisualData->iCanvasPainter->ClearCommandSet();
+    SetChanged();
+    }
+
+#ifdef HUI_DEBUG_TRACK_DRAWING  
+EXPORT_C void CHuiCanvasVisual::SetTrackCommandSet( TFileName& aFileName, TBool aTrack )
+    {
+    iCanvasVisualData->iCanvasPainter->SetTrackCommandSet( aFileName, aTrack || iTrackVisual );
+    }
+#else
+EXPORT_C void CHuiCanvasVisual::SetTrackCommandSet( TFileName&, TBool){
+    }
+#endif
+
+
+EXPORT_C void CHuiCanvasVisual::AddCommandSetL( const TDesC8& aMoreCommands )
+    {
+    Env().CanvasTextureCache().EnableTouchCountCheck();    
+    TRAP_IGNORE(iCanvasVisualData->iCanvasPainter->AddCommandSetL(aMoreCommands));
+    
+    // Memory optimization. Do not prepare cache if visual is inactive.
+    TBool rosterFrozen = Display() && Display()->Roster().IsVisibleContentFrozen();
+    TBool inactive = EFalse; 
+    inactive |= Flags() & EHuiVisualFlagInactive;
+    inactive |= Flags() & EHuiVisualFlagUnderOpaqueHint;
+
+    if (rosterFrozen || inactive)
+        {
+        ClearCache();
+        }
+    else
+        {
+        PrepareCache();
+        }
+    
+    SetChanged();
+    Env().CanvasTextureCache().EnableTouchCountCheck(EFalse);    
+    }
+
+EXPORT_C void CHuiCanvasVisual::AddPartialCommandSetL( const TDesC8& aMoreCommands, TBool aLastPart )
+    {
+    iCanvasVisualData->iCanvasPainter->AddPartialCommandSetL(aMoreCommands, aLastPart); 
+    }
+
+    
+EXPORT_C void CHuiCanvasVisual::ClearCache()
+    {
+    iCanvasVisualData->iCanvasPainter->ClearCache();
+    }
+
+EXPORT_C void CHuiCanvasVisual::PrepareCache()
+    {
+    if (iCanvasVisualData->iCanvasPainter->HasCommandBuffers())
+        {
+        TRect displayRect = DisplayRect();
+        HandleBuffer(displayRect, EScanBuffer, NULL);                    
+        }        
+    }
+
+void CHuiCanvasVisual::SetCommandTypeL(TInt aCommandType)
+    {
+    if (iCanvasVisualData->iCommandSetType == aCommandType)
+        {
+        return;    
+        }
+    
+   	if (aCommandType == ECommandBufferAlf)
+   	   	{
+   	   	delete iCanvasVisualData->iCanvasPainter;
+   	   	iCanvasVisualData->iCanvasPainter = NULL;
+        iCanvasVisualData->iCommandSetType = ECommandBufferAlf;    
+   	   	iCanvasVisualData->iCanvasPainter = CHuiCanvasAlfPainter::NewL();   
+        iCanvasVisualData->iCanvasPainter->SetVisual(this);
+   		}	     
+    else if (aCommandType == ECommandBufferWs)
+    	{
+    	delete iCanvasVisualData->iCanvasPainter;
+   	   	iCanvasVisualData->iCanvasPainter = NULL;
+        iCanvasVisualData->iCommandSetType = ECommandBufferWs;    
+   	   	iCanvasVisualData->iCanvasPainter = CHuiCanvasWsPainter::NewL(); 
+        iCanvasVisualData->iCanvasPainter->SetVisual(this);
+        TBool useCanvasRenderBuffer = CHuiStatic::Renderer().Allows(EHuiRenderPluginAllowVisualPBufferSurfaces);            
+        iCanvasVisualData->iCanvasPainter->EnableRenderBuffer(useCanvasRenderBuffer); 
+    	}
+    else
+        {
+        // For pc lint    
+        }	        
+    }
+
+EXPORT_C TInt CHuiCanvasVisual::PaintedAreaCount() const
+    {
+    TInt count = 0;    
+
+    count = iCanvasVisualData->iCanvasPainter->PaintedAreaCount();
+
+    // Check if there is background clearing, it may increase painted area count
+    if (IsBackgroundDrawingEnabled())
+        {
+        TInt backgroundItemCount = iCanvasVisualData->iBackground->BackgroundItemsCount();
+        
+        if (backgroundItemCount > 0)
+            {
+            // Background items                
+            count += backgroundItemCount; 
+            }
+        else
+            {
+            // If there are no background items, then color clearing is used.                
+            count += 1; 
+            }                         
+        }
+    
+    return count;    
+    }
+    
+EXPORT_C THuiCanvasPaintedArea CHuiCanvasVisual::PaintedArea(TInt aIndex)
+    {
+    return CanvasPaintedArea(aIndex);            
+    }
+
+THuiCanvasPaintedArea CHuiCanvasVisual::CanvasPaintedArea(TInt aIndex) const
+    {
+    if (IsBackgroundDrawingEnabled())
+        {
+        // Check if there is background clearing, it may increase painted area count
+        THuiCanvasPaintedArea background;
+        TInt backgroundItemCount = iCanvasVisualData->iBackground->BackgroundItemsCount();
+        
+        if (backgroundItemCount > 0)
+            {
+            // Background items
+            if (aIndex < backgroundItemCount)
+                {
+                RArray<THuiDisplayBackgroundItem> backgroundItems;
+                iCanvasVisualData->iBackground->GetBackgroundItems(backgroundItems);
+
+                if (backgroundItems[aIndex].ClearMode() == CHuiDisplay::EClearNone)
+                    {
+                    // No clearing -> transparent
+                    background.iPaintType = EHuiCanvasPaintTypeTransparent;                                             
+                    }
+                else if (backgroundItems[aIndex].ClearMode() == CHuiDisplay::EClearWithColor)
+                    {
+                    // Clearing with color, transparency does NOT depend on alpha but is always opaque
+                    // because clearing is done with "fast" clear and it just writes the alpha
+                    // instead of blending
+                    background.iPaintType = EHuiCanvasPaintTypeOpaque;                                                                                                     
+                    }
+                else
+                    {
+                    // By default assume opaque
+                    background.iPaintType = EHuiCanvasPaintTypeOpaque;                                                 
+                    }                    
+
+                background.iPaintedRect = backgroundItems[aIndex].Rect();
+                return background;
+                }
+            else
+                {
+                return iCanvasVisualData->iCanvasPainter->PaintedArea(aIndex - backgroundItemCount);
+                }
+            }
+        else
+            {
+            // If there are no background items, then color clearing is used.                
+            if (aIndex == 0)
+                {
+                background.iPaintedRect = DisplayRect();
+                background.iPaintType = /*(iCanvasVisualData->iBackground->BackgroundColor().Alpha() == 255) ?*/ EHuiCanvasPaintTypeOpaque;// : EHuiCanvasPaintTypeTransparent; 
+                return background;
+                }                
+            }                                            
+        }
+
+    return iCanvasVisualData->iCanvasPainter->PaintedArea(aIndex);            
+    }
+
+EXPORT_C TInt CHuiCanvasVisual::SetCapturingBufferL(CFbsBitmap* aTargetBuffer)
+    {
+    return iCanvasVisualData->iCanvasPainter->SetCapturingBufferL(aTargetBuffer);                 
+    }
+
+EXPORT_C void CHuiCanvasVisual::SetCanvasFlags(TInt aCanvasFlags)
+    {
+    TInt oldFlags = iCanvasVisualData->iCanvasFlags;           
+    iCanvasVisualData->iCanvasFlags |= aCanvasFlags;
+
+    // Set visual changed if flags were really changed
+    if (oldFlags != iCanvasVisualData->iCanvasFlags)
+        {
+        SetChanged();
+        }
+    }
+
+EXPORT_C void CHuiCanvasVisual::ClearCanvasFlags(TInt aCanvasFlags)
+    {
+    TInt oldFlags = iCanvasVisualData->iCanvasFlags;           
+    iCanvasVisualData->iCanvasFlags &= ~aCanvasFlags;
+
+    // Set visual changed if flags were really changed
+    if (oldFlags != iCanvasVisualData->iCanvasFlags)
+        {
+        SetChanged();
+        }
+    }
+
+EXPORT_C TInt CHuiCanvasVisual::CanvasFlags()
+    {
+    return iCanvasVisualData->iCanvasFlags;
+    }
+
+
+EXPORT_C TBool CHuiCanvasVisual::IsBackgroundDrawingEnabled() const
+    {
+    TBool drawBackground = EFalse;
+    drawBackground |= (iCanvasVisualData->iBackground->ClearBackground() != CHuiDisplay::EClearNone);
+    drawBackground |= (iCanvasVisualData->iBackground->BackgroundItemsCount() > 0);
+    
+    if (iCanvasVisualData->iCanvasFlags & EHuiCanvasFlagDisableCanvasBackground)
+        {
+        drawBackground = EFalse;    
+        }
+    return drawBackground;        
+    }
+
+TBool CHuiCanvasVisual::IsContentDrawingEnabled() const
+    {
+    TBool drawContent = ETrue;
+    if (iCanvasVisualData->iCanvasFlags & EHuiCanvasFlagDisableCanvasContent)
+        {
+        drawContent = EFalse;    
+        }
+    return drawContent;       
+    }
+
+TBool CHuiCanvasVisual::IsExternalContentDrawingEnabled(TBool aIncludeChildren) const
+    {
+    TBool drawExternalContent = EFalse;
+    if (iCanvasVisualData->iExternalContentVisual)
+        {
+        drawExternalContent = ETrue;    
+        }
+    if (aIncludeChildren)
+        {
+        for (TInt i=0; !drawExternalContent && i<Count(); i++)
+             {
+             CHuiCanvasVisual* canvasVisual = (CHuiCanvasVisual*) &Visual(i);
+             drawExternalContent |= canvasVisual->IsExternalContentDrawingEnabled(ETrue);
+             }
+        }
+    return drawExternalContent;       
+    }
+
+EXPORT_C void CHuiCanvasVisual::SetParentCanvas(CHuiCanvasVisual* aParent)
+    {
+    iCanvasVisualData->iParentCanvas = aParent;
+    if (aParent)
+        {
+        aParent->AddChildCanvas(this);
+        }
+    }
+
+const TRegion& CHuiCanvasVisual::ClipRegion() const
+    {
+    iCanvasVisualData->iClipRegion.Clear();
+    // TODO: This should be region in cases when canvas shape is non-rectangular, 
+    // for now just use display rect. Window Shape is currently only known by the wspainter, 
+    // so new interface is needed to query it.
+    iCanvasVisualData->iClipRegion.AddRect(DisplayRect().Round());
+
+    CHuiCanvasVisual* parent = iCanvasVisualData->iParentCanvas;    
+    if (parent)
+        {
+        const TRegion& parentClipRegion = parent->ClipRegion(); 
+        iCanvasVisualData->iClipRegion.Intersect(parentClipRegion);
+        }
+    
+    return iCanvasVisualData->iClipRegion;
+    }
+
+void CHuiCanvasVisual::AddChildCanvas(CHuiCanvasVisual* aChild)
+    {
+    if (iCanvasVisualData->iChildCanvasList.Find(aChild) == KErrNotFound)
+        {
+        iCanvasVisualData->iChildCanvasList.Append(aChild);
+        }
+    }
+
+void CHuiCanvasVisual::RemoveChildCanvas(CHuiCanvasVisual* aChild)
+    {
+    for (TInt i=0; i<iCanvasVisualData->iChildCanvasList.Count(); i++)
+        {
+        if (iCanvasVisualData->iChildCanvasList[i] == aChild)
+            {
+            iCanvasVisualData->iChildCanvasList.Remove(i);
+            break;
+            }        
+        }
+    }
+
+EXPORT_C TBool CHuiCanvasVisual::LayerUsesAlphaFlag()
+    {
+    return iCanvasVisualData->iLayerUsesAlphaFlag;
+    }
+
+EXPORT_C void CHuiCanvasVisual::SetLayerUsesAlphaFlag(TBool aEnabled)
+    {
+    iCanvasVisualData->iLayerUsesAlphaFlag = aEnabled;
+    }
+
+EXPORT_C TRect& CHuiCanvasVisual::LayerExtent()
+    {
+    return iCanvasVisualData->iLayerExtent;
+    }
+
+EXPORT_C void CHuiCanvasVisual::SetLayerExtent(TRect& aExtent)
+    {
+    iCanvasVisualData->iLayerExtent = aExtent;
+    if(0)// aExtent != TRect() ) // background surface was set or moved to new place
+        {
+        EnableTransformationL();
+        CHuiTransformation& transformation = Transformation();
+        
+        TPoint extentPos = aExtent.iTl;
+        TPoint visualPos = Pos().Now();
+
+        TReal32 xDif = (TReal32)(extentPos.iX - visualPos.iX);
+        TReal32 yDif = (TReal32)(extentPos.iY - visualPos.iY);
+        
+        TSize extentSize = aExtent.Size(); 
+        TPoint visualSize = Size().Now();
+
+        TReal32 hVisualWidth = (TReal32)visualSize.iX/2;
+        TReal32 hVisualHeigth = (TReal32)visualSize.iY/2;
+        
+        
+        TReal32 xScale = (TReal32)extentSize.iWidth/visualSize.iX;
+        TReal32 yScale = (TReal32)extentSize.iHeight/visualSize.iY;
+        
+		// create transformation when applying first time
+        if(transformation.Count() == 0)
+            {
+            transformation.Translate(xDif,yDif);
+            // for moving the visual origo to visual's top left corner
+            transformation.Translate(-hVisualWidth,-hVisualHeigth);
+            transformation.Scale(xScale,yScale);    
+            // move back
+            transformation.Translate(hVisualWidth,hVisualHeigth);
+            }
+        else // update existing transformations
+            {
+            CHuiTransformation::TTransform& translate = transformation[0];
+            translate.iParams[EHuiTransformParamTranslateX] = xDif;
+            translate.iParams[EHuiTransformParamTranslateY] = yDif;
+            
+            CHuiTransformation::TTransform& translateforscale = transformation[1];
+            translateforscale.iParams[EHuiTransformParamTranslateX] = -hVisualWidth;
+            translateforscale.iParams[EHuiTransformParamTranslateY] = -hVisualHeigth;
+            
+            CHuiTransformation::TTransform& scale = transformation[2];
+            scale.iParams[EHuiTransformParamScaleX] = xScale;
+            scale.iParams[EHuiTransformParamScaleY] = yScale;
+
+            CHuiTransformation::TTransform& translateback = transformation[3];
+            translateback.iParams[EHuiTransformParamTranslateX] = hVisualWidth;
+            translateback.iParams[EHuiTransformParamTranslateY] = hVisualHeigth;
+            }
+        }
+    else // background surface was removed
+        {
+        EnableTransformationL(EFalse);
+        }
+    }
+
+
+TBool CHuiCanvasVisual::IsCanvasClippingEnabled() const
+    {
+    return iCanvasVisualData->iCanvasFlags & EHuiCanvasFlagEnableCanvasClipping; 
+    }
+
+TBool CHuiCanvasVisual::EffectActive() const
+    {
+    return Effect() && !LoadingEffect();
+    }
+    
+TBool CHuiCanvasVisual::IsContentDrawingLayered() const
+    {
+    // TODO: real flag here to check if drawing normally or layered with brushes
+    return (Brushes() && (Brushes()->Count() > 0));
+    }
+
+EXPORT_C void CHuiCanvasVisual::StoreRenderBufferL()
+    {
+    CHuiCanvasGc& gc = CanvasGc();
+    CHuiCanvasRenderBuffer *content_rb = Env().CanvasTextureCache().FindCachedRenderBuffer(*this);
+    if (content_rb)
+        {
+        if (!iCanvasVisualData->iStoredRenderBuffer)
+            {
+            iCanvasVisualData->iStoredRenderBuffer = gc.CreateRenderBufferL(TSize(0,0));
+            }
+        iCanvasVisualData->iStoredRenderBuffer->InitializeL(content_rb->Size());
+        iCanvasVisualData->iStoredRenderBuffer->Copy(*content_rb);    
+        }
+    }
+
+void CHuiCanvasVisual::DrawStoredVisualRenderBuffer() const
+    {
+    CHuiCanvasGc& gc = CanvasGc();
+    THuiRealPoint dest_point = DisplayRect().iTl;
+    CHuiCanvasRenderBuffer *stored = iCanvasVisualData->iStoredRenderBuffer;
+    gc.DrawImage(*stored, dest_point);
+    }
+
+void CHuiCanvasVisual::DrawStoredFullScreenRenderBuffer(CHuiGc& aGc) const
+    {
+    if (!Display()) return;
+    CHuiCanvasGc& gc = *iHuiLayoutPrivateData->iGc;
+    gc.SetGc(aGc);
+    gc.SetDefaults();
+    gc.PushTransformationMatrix();
+    
+    TRect displayArea = Display()->VisibleArea();
+    TInt h = displayArea.Height();
+
+    // Pixels are upside down in OpenVG canvas render buffer
+    if (CHuiStatic::Env().Renderer() == EHuiRendererVg10)
+        {
+        gc.Translate(0.0f, h, 0.0f);            
+        gc.Scale(1.f, -1.f, 1.f);
+        }
+    
+    THuiRealPoint dest_point = DisplayRect().iTl;
+    CHuiCanvasRenderBuffer *stored = StoredRenderBuffer();
+    gc.DrawImage(*stored, dest_point); 
+
+    gc.PopTransformationMatrix();
+    }
+
+EXPORT_C void CHuiCanvasVisual::FreeRenderBuffer()
+    {
+    if (iCanvasVisualData)
+        {
+        if (iCanvasVisualData->iStoredRenderBuffer)
+            {
+            delete iCanvasVisualData->iStoredRenderBuffer;
+            iCanvasVisualData->iStoredRenderBuffer = NULL;
+            }
+        }
+    }
+
+EXPORT_C TBool CHuiCanvasVisual::HasCommandBuffers(TBool aIncludeChildren) const
+    {
+    TBool hasCommandBuffers = iCanvasVisualData->iCanvasPainter->HasCommandBuffers();
+    if (aIncludeChildren)
+        {
+        for (TInt i=0; i<Count(); i++)
+            {
+            CHuiCanvasVisual* canvasVisual = (CHuiCanvasVisual*) &Visual(i); // Dynamic cast is too slow for us ;)
+            hasCommandBuffers |= canvasVisual->HasCommandBuffers(aIncludeChildren);
+            if (hasCommandBuffers)
+                {
+                break;
+                }
+            }
+        }
+    return hasCommandBuffers;
+    }
+    
+
+void CHuiCanvasVisual::SetSize(const THuiRealSize& aSize, TInt aTransitionTime)
+    {
+    CHuiLayout::SetSize(aSize, aTransitionTime);
+    UpdateChildrenLayout(aTransitionTime);    
+    }
+
+TBool CHuiCanvasVisual::ChildSize(TInt aOrdinal, TSize& aSize)
+    {
+    TBool result(EFalse);
+    THuiRealRect rect;
+    TInt childRectStatus(THuiLayoutChildRectUpdateNotNeeded);
+    childRectStatus = ChildRect(aOrdinal, rect);
+    if(childRectStatus != THuiLayoutChildRectNotImplemented)
+        {
+        result = (childRectStatus & THuiLayoutChildRectSizeUpdateNeeded);
+        if(result)
+            {
+            THuiRealPoint size(rect.Width(), rect.Height());
+            aSize = LocalPointInPixels(size).AsSize();
+            }
+        }
+    return result;
+    }
+
+TBool CHuiCanvasVisual::ChildPos(TInt aOrdinal, TPoint& aPos)
+    {
+    TBool result(EFalse);
+    THuiRealRect rect;
+    TInt childRectStatus(THuiLayoutChildRectUpdateNotNeeded);
+    childRectStatus = ChildRect(aOrdinal, rect);
+    if(childRectStatus != THuiLayoutChildRectNotImplemented)
+        {
+        result = (childRectStatus & THuiLayoutChildRectPosUpdateNeeded);
+        if(result)
+            {
+            aPos = LocalPointInPixels(rect.iTl);
+            }
+        }
+    return result;
+    }
+
+TInt CHuiCanvasVisual::ChildRect(TInt /*aOrdinal*/, THuiRealRect& aPos)
+    {
+    THuiRealSize innerSize = InnerSize();
+    aPos.iTl = InnerTopLeft(); 
+    aPos.iBr = aPos.iTl + THuiRealPoint(innerSize.iWidth, innerSize.iHeight) ; 
+    return THuiLayoutChildRectLayoutUpdateNeeded;
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiCmdBufferBrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,368 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiCmdBufferBrush.h"
+#include "HuiFxEffect.h"
+#include <uiacceltk/HuiBrushArray.h>
+#include "huicanvasgc.h"
+#include "huicanvaswsgc.h"
+#include "huicanvaswshwgc.h"
+#include "huicanvaspainter.h"
+#include "huicanvaswspainter.h"
+CHuiCmdBufferBrush *CHuiCmdBufferBrush::NewL(TInt aLayerId, CHuiCanvasGc &aGc, CHuiCanvasWsGc &aWsGc, CHuiCanvasVisual &aVisual, CHuiCanvasPainter &aPainter)
+    {
+    CHuiCmdBufferBrush *brush = new (ELeave) CHuiCmdBufferBrush(aGc, aWsGc);
+    CleanupStack::PushL(brush);
+    brush->ConstructL(aLayerId, aVisual, aPainter);
+    CleanupStack::Pop(brush);
+    return brush;
+    }
+CHuiCmdBufferBrush::CHuiCmdBufferBrush( CHuiCanvasGc &aGc, CHuiCanvasWsGc &aWsGc )
+    : iCanvasGc(aGc), iCanvasWsGc(aWsGc)
+    {
+    }
+
+
+void CHuiCmdBufferBrush::ConstructL(TInt aLayerId, CHuiCanvasVisual &aVisual, CHuiCanvasPainter &aPainter)
+    {
+    iLayerId = aLayerId;
+    iVisual = &aVisual;
+    iCanvasPainter = &aPainter;
+    }
+CHuiCmdBufferBrush::~CHuiCmdBufferBrush()
+    {
+    TInt count = iBuffers.Count();
+    for(int i=0;i<count;i++)
+        {
+        CHuiCanvasCommandBuffer *buf = iBuffers[i].iCommandBuffer;
+        buf->RemoveDestroyObserver(this);
+        }
+    }
+TInt CHuiCmdBufferBrush::Type2() const { return ECmdBufferBrush; }
+
+void CHuiCmdBufferBrush::AddBufferL(TLayeredBuffer aBuffer)
+    {
+    iBuffers.AppendL(aBuffer);
+    }
+
+
+void CHuiCmdBufferBrush::Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const
+    {
+    THuiRealRect brushRect = aGuide.BrushRect();
+    DrawSelf(aGc, brushRect);
+    }
+void CHuiCmdBufferBrush::DrawSelf(CHuiGc &aGc, THuiRealRect brushRect) const
+{    
+    iCanvasGc.SetVisual(*iVisual);
+    iCanvasGc.SetGc(aGc);
+    iCanvasGc.SetDefaults();   
+    //iCanvasPainter->EnableRenderBuffer(ETrue);
+    //static_cast<CHuiCanvasWsPainter*>(iCanvasPainter)->EnableRenderBufferIfNeeded(ETrue);
+
+    TRect displayRect = brushRect.Round();
+    
+    RRegion reg;
+    TInt size = iBuffers.Count();
+    for(int i=0;i<size;i++)
+        {
+        TRect rect = iBuffers[i].iBoundingRectangle;
+
+        RDebug::Print(_L("TP: ClearBackground %d"), iLayerId);
+        ClearBackground(aGc, rect);
+
+        rect.iTl.iX += brushRect.iTl.iX;
+        rect.iTl.iY += brushRect.iTl.iY;
+        rect.iBr.iX += brushRect.iTl.iX;
+        rect.iBr.iY += brushRect.iTl.iY;
+        reg.AddRect(rect);
+        }
+    iCanvasWsGc.BeginActionL(EDrawBuffer,reg.BoundingRect() /*displayRect*/,*iVisual,EFalse,reg);                   
+
+    for(int i2=0;i2<size;i2++)
+        {
+        TRect rect = iBuffers[i2].iBoundingRectangle;
+
+        rect.iTl.iX += brushRect.iTl.iX;
+        rect.iTl.iY += brushRect.iTl.iY;
+        rect.iBr.iX += brushRect.iTl.iX;
+        rect.iBr.iY += brushRect.iTl.iY;
+
+        RRegion region;
+        region.AddRect(rect);
+        for(int ii2 = i2+1;ii2<size; ii2++)
+            {
+            TRect rect2 = iBuffers[ii2].iBoundingRectangle;
+
+            rect2.iTl.iX += brushRect.iTl.iX;
+            rect2.iTl.iY += brushRect.iTl.iY;
+            rect2.iBr.iX += brushRect.iTl.iX;
+            rect2.iBr.iY += brushRect.iTl.iY;
+            if (iBuffers[i2].iCommandBuffer != iBuffers[ii2].iCommandBuffer)
+                {
+                region.SubRect(rect2);
+                }
+            }
+        region.Intersect(iBuffers[i2].iCommandBuffer->iUpdateRegion);
+            
+        if (!region.IsEmpty())
+            {
+            
+            //iCanvasWsGc.BeginActionL(EScanBuffer,rect /*displayRect*/,*iVisual,EFalse,region);                   
+            //DrawDrawingCommands(EScanBuffer, aGc, rect, iBuffers[i2].iBufferPart, iBuffers[i2].iCommandBuffer, region);
+            //iCanvasWsGc.EndActionL(region);                 
+
+            DrawDrawingCommands(EDrawBuffer, aGc, rect, iBuffers[i2].iBufferPart, iBuffers[i2].iCommandBuffer, region);
+            }
+        region.Close();
+        }
+    {
+    TInt flags = iVisual->Flags();
+    iVisual->ClearFlag(EHuiVisualFlagOpaqueHint);
+    iCanvasWsGc.EndActionL(reg, ETrue);                     
+    iVisual->SetFlags(flags);
+    }
+
+    reg.Close();
+    
+#if 0
+    for(int i3=0;i3<size;i3++)
+        {
+        TRect rect = iBuffers[i3].iBoundingRectangle;
+        rect.iTl.iX += brushRect.iTl.iX;
+        rect.iTl.iY += brushRect.iTl.iY;
+        rect.iBr.iX += brushRect.iTl.iX;
+        rect.iBr.iY += brushRect.iTl.iY;
+        CopyBuffer(aGc, rect);
+        }
+#endif
+
+    }
+
+void CHuiCmdBufferBrush::ClearBackground(CHuiGc &aGc, TRect aRectangle) const
+    {
+    //void DrawRects(RArray<THuiRealRect>& aRects);
+#if 0
+    THuiRealPoint tl(aRectangle.iTl.iX, aRectangle.iTl.iY);
+    THuiRealPoint br(aRectangle.iBr.iX, aRectangle.iBr.iY);
+    THuiRealRect rect(tl, br);
+    TReal32 opacity = iCanvasGc.Opacity();
+    iCanvasGc.SetOpacity(0.0f);
+    iCanvasGc.Clear(rect);
+    iCanvasGc.SetOpacity(opacity);
+#endif
+
+    CHuiCanvasRenderBuffer* renderbuffer = NULL;
+    renderbuffer = iVisual->Env().CanvasTextureCache().FindCachedRenderBuffer(*iVisual);
+    iCanvasGc.ClearRenderBuffer(*renderbuffer, aRectangle /*TRect(0,0,iVisual->DisplayRect().Size().iWidth, iVisual->DisplayRect().Size().iHeight)*/);
+    }
+void CHuiCmdBufferBrush::DrawDrawingCommands(TInt aAction, CHuiGc &aGc, TRect aClippingRectangle, 
+                                             TPtrC8 aCommands, CHuiCanvasCommandBuffer *buf, const TRegion &reg) const
+    {
+    TRect rect = aClippingRectangle;
+    RDebug::Print(_L("TP: DrawDrawingCommands (%d,%d)-(%d,%d)"), rect.iTl.iX, rect.iTl.iY, rect.iBr.iX, rect.iBr.iY);    
+
+    //iCanvasWsGc.EnableUpdateRegion(reg /*buf->iUpdateRegion*/, EFalse /*aClearBeforeHandlingBuffers*/);
+
+    TRAP_IGNORE(iCanvasPainter->HandleBufferL(rect, aAction, *iVisual, &aGc, TPoint(0,0), aCommands, buf));  
+    //iCanvasWsGc.DisableUpdateRegion();
+
+    }
+void CHuiCmdBufferBrush::CopyBuffer(CHuiGc &aGc, TRect aRectangle) const
+    {
+    RDebug::Print(_L("TP: CopyBuffer"));    
+    }
+
+void CHuiCmdBufferBrush::Flush() const
+    {
+    
+    }
+
+void CHuiCmdBufferBrush::EffectSetEffect(CHuiFxEffect* aEffect)
+    {
+    if (iEffect)
+        {
+        iEffect->SetEffectEndObserver( NULL, 0 );
+        }
+    delete iEffect;
+    iEffect = aEffect;
+    }
+
+TReal32 CHuiCmdBufferBrush::EffectOpacityTarget() const
+    {
+    return 1.0;
+    }
+void CHuiCmdBufferBrush::EffectSetOpacity(TReal32 aOpacity)
+    {
+    // empty
+    }
+void CHuiCmdBufferBrush::EffectDrawSelf( CHuiGc &aGc, const TRect & aDisplayRect) const
+    {
+    DrawSelf(aGc, aDisplayRect);
+    }
+
+THuiRealRect CHuiCmdBufferBrush::EffectDisplayRect() const __SOFTFP
+    {
+    RRegion reg;
+    TInt size = iBuffers.Count();
+    for(int i=0;i<size;i++)
+        {
+        TRect rect = iBuffers[i].iBoundingRectangle;
+        reg.AddRect(rect);
+        }
+    
+    THuiRealRect r(reg.BoundingRect());
+    reg.Close();
+    return r;
+    }
+
+void CHuiCmdBufferBrush::SetLoadingEffect(TBool /*aLoading*/)
+    {
+    // TODO
+    }
+void CHuiCmdBufferBrush::EffectSetSource( TBool /*aIsInput1*/ )
+    {
+    }
+TBool CHuiCmdBufferBrush::EffectGetSource() const
+    {
+    return EFalse;
+    }
+
+void CHuiCmdBufferBrush::DestroyBuffer(CHuiCanvasCommandBuffer *aBuffer)
+    {
+    TInt count = iBuffers.Count();
+    for(int i=count-1;i>=0;i--)
+        {
+        CHuiCanvasCommandBuffer *buf = iBuffers[i].iCommandBuffer;
+        if (buf == aBuffer)
+            {
+            iBuffers.Remove(i);
+            }
+        }
+    }
+
+struct TIndexTableElement
+    {
+    TInt32 iOffset;
+    TInt32 iSize;
+    TInt32 iLayerId;
+    //TRect iBoundingRect;
+    TInt iTliX;
+    TInt iTliY;
+    TInt iBriX;
+    TInt iBriY;
+    //TInt32 iBufferId;
+    };
+
+void ReplaceBufferL(RArray<CHuiCmdBufferBrush::TLayeredBuffer> &aBuffers, const CHuiCmdBufferBrush::TLayeredBuffer &buf);
+TInt FindBuffer(CHuiBrushArray &aBrushes, TInt aLayerId);
+
+
+void ParseCmdBufferL(CHuiBrushArray &aBrushes, TPtrC8 aBuffer, TPtrC8 aIndexTable, CHuiCanvasGc &aGc, CHuiCanvasWsGc &aWsGc, CHuiCanvasVisual &aVisual, CHuiCanvasPainter &aPainter)
+    {
+    TInt32 numIndexes = aIndexTable.Length() / sizeof(TIndexTableElement);
+    for(TInt i=0;i<numIndexes;i++)
+        {
+        TInt32 offset = i * sizeof(TIndexTableElement);
+        TInt32 size = sizeof(TIndexTableElement);
+        TPtrC8 ptr;
+        ptr.Set(aIndexTable.Mid(offset, size));
+        TIndexTableElement *elem = (TIndexTableElement*)ptr.Ptr();
+        //RDebug::Print(_L("Layer: %d: ID: %d, offset=%d, size = %d"), i, elem->iLayerId, elem->iOffset, elem->iSize);
+        //RDebug::Print(_L("aBuffer.Length()=%d"), aBuffer.Length());
+        TPtrC8 ptr2(aBuffer.Ptr()+elem->iOffset, elem->iSize) ; // aBuffer.Mid(elem->iOffset, elem->iSize));
+        //ptr2.Set();
+	
+        TInt index = FindBuffer(aBrushes, elem->iLayerId);
+        if (index == -1)
+            {
+            CHuiCmdBufferBrush *brush2 = CHuiCmdBufferBrush::NewL(elem->iLayerId, aGc, aWsGc, aVisual, aPainter);
+            CleanupStack::PushL(brush2);
+            aBrushes.AppendL(brush2, EHuiHasOwnership);
+            CleanupStack::Pop();
+            brush2->SetLayer(EHuiBrushLayerForeground);
+            index = aBrushes.Count() - 1;
+            }
+        CHuiCmdBufferBrush &brush = (CHuiCmdBufferBrush&)aBrushes[index];
+        CHuiCmdBufferBrush::TLayeredBuffer buf;
+        //buf.iBufferId = elem->iBufferId;
+        //TODO buf.iUpdateRegion = ...
+        TInt count = aPainter.NumBuffers();
+        CHuiCanvasCommandBuffer *buffer = count ? aPainter.At(count-1) : NULL;
+        if (buffer)
+            {
+            buffer->AddDestroyObserver(&brush);
+            }
+        buf.iBoundingRectangle.SetRect(elem->iTliX, elem->iTliY, elem->iBriX, elem->iBriY);
+        if (buf.iBoundingRectangle == TRect(0,0,0,0))
+            {
+            buf.iBoundingRectangle = TRect(0,0,aVisual.BrushRect().Size().iWidth, aVisual.BrushRect().Size().iHeight);
+            }
+        buf.iBufferPart.Set(ptr2);
+        buf.iCommandBuffer = buffer;
+        ReplaceBufferL(brush.iBuffers, buf);
+        }
+    }
+
+void ReplaceBufferL(RArray<CHuiCmdBufferBrush::TLayeredBuffer> &aBuffers, const CHuiCmdBufferBrush::TLayeredBuffer &aBuf)
+    {
+    aBuffers.AppendL(aBuf);
+#if 0
+    // TODO: Dunno if iBufferId can be used or whether we need to use regions to
+    // identify buffers.
+    TInt size = aBuffers.Count();
+    TInt index = -1;
+    for(int i=0;i<size;i++)
+        { // this loop might be able to optimize away if it becomes performance problem.
+          // but would need to notice that ParseCmdBuffer always goes layers in order.
+          // current code has no such assumption.
+        CHuiCmdBufferBrush::TLayeredBuffer &buffer= aBuffers[i];
+        if (buffer.iBufferId == buf.iBufferId)
+            {
+            index = i;
+            break;
+            }
+        }
+    if (index != -1)
+        {
+        aBuffers[index] = buf;
+        }
+    else
+        {
+        aBuffers.AppendL(buf);
+        }
+#endif
+    }
+
+TInt FindBuffer(CHuiBrushArray &aBrushes, TInt aLayerId)
+    {
+    TInt size = aBrushes.Count();
+    for(int i=0;i<size;i++)
+        {
+        CHuiCmdBufferBrush *brush = dynamic_cast<CHuiCmdBufferBrush*>(&aBrushes[i]);
+        if (brush && brush->LayerId() == aLayerId)
+            {
+            return i;
+            }
+        }
+    return -1;
+    }
+
+// wspainter needs to be able to skip the index table command
+void SkipCommand()
+    {
+    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiCommand.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,829 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of THuiCommand and derived command classes.
+*
+*/
+
+
+
+#include "uiacceltk/HuiCommand.h"  // Class definition
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiScheduler.h"
+#include "uiacceltk/huieventhandler.h"
+#include "uiacceltk/HuiDisplay.h"
+#include "uiacceltk/HuiEvent.h"
+#include "uiacceltk/HuiControlGroup.h"
+#include "uiacceltk/HuiVisuals.h"
+#include "uiacceltk/HuiTransformation.h"
+#include "uiacceltk/HuiUtil.h"
+
+
+THuiCommand::THuiCommand(THuiCommandType aType)
+        : iType(aType), iSenderType(EHuiCommandObjectTypeNone), iSender(NULL)
+    {
+    }
+
+
+EXPORT_C THuiCommand::~THuiCommand()
+    {
+    iSender = NULL;
+    }
+
+
+EXPORT_C void THuiCommand::SetSender(THuiCommandObjectType aType, TAny* aSender)
+    {
+    iSenderType = aType;
+    iSender = aSender;
+    }
+
+
+EXPORT_C THuiCommandType THuiCommand::Type() const
+    {
+    return iType;
+    }
+
+
+EXPORT_C const THuiObjectCommand* THuiCommand::ObjectCommand() const
+    {
+    return NULL;
+    }
+
+
+EXPORT_C THuiCommandObjectType THuiCommand::SenderType() const
+    {
+    return iSenderType;
+    }
+
+
+EXPORT_C TAny* THuiCommand::Sender() const
+    {
+    return iSender;
+    }
+
+
+EXPORT_C CHuiVisual* THuiCommand::SenderVisual() const
+    {
+    if(iSenderType == EHuiCommandObjectTypeVisual)
+        {
+        return reinterpret_cast<CHuiVisual*>(iSender);
+        }
+    return NULL;
+    }
+
+
+EXPORT_C CHuiControl* THuiCommand::SenderControl() const
+    {
+    if(iSenderType == EHuiCommandObjectTypeControl)
+        {
+        return reinterpret_cast<CHuiControl*>(iSender);
+        }
+    return NULL;
+    }
+
+
+EXPORT_C CHuiControlGroup* THuiCommand::SenderControlGroup() const
+    {
+    if(iSenderType == EHuiCommandObjectTypeControlGroup)
+        {
+        return reinterpret_cast<CHuiControlGroup*>(iSender);
+        }
+    return NULL;
+    }
+
+EXPORT_C void THuiCommand::CommandExtension(const TUid& /*aExtensionUid*/, TAny** /*aExtensionParams*/)
+    {
+    }
+
+EXPORT_C THuiActionCommand::THuiActionCommand(TInt aId)
+        : THuiCommand(EHuiCommandTypeAction), iId(aId)
+    {
+    }
+
+
+EXPORT_C void THuiActionCommand::ExecuteL(CHuiEnv& aEnv) const
+    {
+    TInt error = aEnv.ReportAction(*this);
+    if(error != KErrNone)
+        {
+        // Leave with the error code if one of the observers failed.
+        User::Leave(error);
+        }
+    }
+
+
+EXPORT_C TInt THuiActionCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C TInt THuiActionCommand::Id() const
+    {
+    return iId;
+    }
+    
+EXPORT_C void THuiActionCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    THuiCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+
+THuiObjectCommand::THuiObjectCommand(THuiCommandType aType, TAny* aDataOwnerObject, THuiOp aOperation)
+        : THuiCommand(aType), iObject(aDataOwnerObject), iOperation(aOperation)
+    {
+    }
+
+
+EXPORT_C TAny* THuiObjectCommand::Object() const
+    {
+    return iObject;
+    }
+
+
+EXPORT_C THuiOp THuiObjectCommand::Operation() const
+    {
+    return iOperation;
+    }
+    
+EXPORT_C TInt THuiObjectCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C const THuiObjectCommand* THuiObjectCommand::ObjectCommand() const
+    {
+    // All object commands can be casted to THuiObjectCommand.
+    return this;
+    }
+    
+EXPORT_C void THuiObjectCommand::ExecuteL(CHuiEnv& /*aEnv*/) const
+    {
+    HUI_DEBUG1(_L("THuiObjectCommand::ExecuteL() - Unknown op %i."), Operation());
+    }  
+    
+EXPORT_C void THuiObjectCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    THuiCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+
+EXPORT_C THuiGroupCommand::THuiGroupCommand(CHuiControlGroup& aGroup, THuiOp aOperation,
+                                            CHuiDisplay* aDisplay)
+        : THuiObjectCommand(EHuiCommandTypeGroup, &aGroup, aOperation),
+          iDisplay(aDisplay)
+    {
+    }
+
+
+EXPORT_C void THuiGroupCommand::ExecuteL(CHuiEnv& /*aEnv*/) const
+    {
+    switch(Operation())
+        {
+        case EHuiOpShow:
+            if(iDisplay)
+                {
+                iDisplay->Roster().ShowL(ControlGroup());
+                }
+            break;
+
+        case EHuiOpHide:
+            if(iDisplay)
+                {
+                iDisplay->Roster().Hide(ControlGroup());
+                }
+            break;
+
+        case EHuiOpEnableInput:
+            ControlGroup().SetAcceptInput(ETrue);
+            break;
+
+        case EHuiOpDisableInput:
+            ControlGroup().SetAcceptInput(EFalse);
+            break;
+
+        default:
+            HUI_DEBUG1(_L("THuiGroupCommand::ExecuteL() - Unknown op %i."), Operation());
+            break;
+        }
+    }
+
+
+EXPORT_C TInt THuiGroupCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C CHuiControlGroup& THuiGroupCommand::ControlGroup() const
+    {
+    return *static_cast<CHuiControlGroup*>(Object());
+    }
+
+
+EXPORT_C CHuiDisplay* THuiGroupCommand::Display() const
+    {
+    return iDisplay;
+    }
+    
+EXPORT_C void THuiGroupCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    THuiObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+
+EXPORT_C THuiControlCommand::THuiControlCommand(CHuiControl& aControl, THuiOp aOperation)
+        : THuiObjectCommand(EHuiCommandTypeControl, &aControl, aOperation)
+    {
+    }
+
+
+EXPORT_C void THuiControlCommand::ExecuteL(CHuiEnv& /*aEnv*/) const
+    {
+    HUI_DEBUG1(_L("THuiControlCommand::ExecuteL() - Unknown op %i."), Operation());
+    }
+
+
+EXPORT_C TInt THuiControlCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C CHuiControl& THuiControlCommand::Control() const
+    {
+    return *static_cast<CHuiControl*>(Object());
+    }
+    
+EXPORT_C void THuiControlCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    THuiObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+
+EXPORT_C THuiVisualCommand::THuiVisualCommand(CHuiVisual& aVisual, THuiOp aOperation,
+                                              TInt aSetFlags, TInt aClearFlags)
+        : THuiObjectCommand(EHuiCommandTypeVisual, &aVisual, aOperation),
+          iSetFlags(aSetFlags), iClearFlags(aClearFlags)
+    {
+    }
+
+
+EXPORT_C void THuiVisualCommand::ExecuteL(CHuiEnv& /*aEnv*/) const
+    {
+    switch(Operation())
+        {
+        case EHuiOpRemoveAndDestroyAll:
+            Visual().RemoveAndDestroyAllD();
+            // The object is no longer valid after this.
+            break;
+        case EHuiOpEnableTransformation:
+            HUI_DEBUG(_L("THuiVisualCommand::ExecuteL() -- Enable transformation."));
+            Visual().EnableTransformationL(ETrue);
+            break;
+
+        case EHuiOpDisableTransformation:
+            HUI_DEBUG(_L("THuiVisualCommand::ExecuteL() -- Disable transformation."));
+            Visual().EnableTransformationL(EFalse);
+            break;
+
+        case EHuiOpModifyFlags:
+            if(iSetFlags)
+                {
+                Visual().SetFlags(iSetFlags);
+                }
+            if(iClearFlags)
+                {
+                Visual().ClearFlags(iClearFlags);
+                }
+            break;
+
+        default:
+            HUI_DEBUG1(_L("THuiVisualCommand::ExecuteL() - Unknown op %i."), Operation());
+            break;
+        }
+    }
+
+
+EXPORT_C TInt THuiVisualCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C CHuiVisual& THuiVisualCommand::Visual() const
+    {
+    return *static_cast<CHuiVisual*>(Object());
+    }
+
+
+EXPORT_C TInt THuiVisualCommand::FlagsToSet() const
+    {
+    return iSetFlags;
+    }
+
+
+EXPORT_C TInt THuiVisualCommand::FlagsToClear() const
+    {
+    return iClearFlags;
+    }
+    
+EXPORT_C void THuiVisualCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    THuiObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+
+EXPORT_C THuiImageCommand::THuiImageCommand(CHuiImageVisual& aImageVisual,
+                                            const THuiImage& aImage,
+                                            THuiOp aOperation)
+        : THuiObjectCommand(EHuiCommandTypeImage, &aImageVisual, aOperation),
+          iImage(aImage)
+    {
+    }
+
+
+EXPORT_C void THuiImageCommand::ExecuteL(CHuiEnv& /*aEnv*/) const
+    {
+    switch(Operation())
+        {
+        case EHuiOpSetPrimaryImage:
+            ImageVisual().SetImage(iImage);
+            break;
+
+        case EHuiOpSetSecondaryImage:
+            ImageVisual().SetSecondaryImage(iImage);
+            break;
+
+        default:
+            HUI_DEBUG1(_L("THuiImageCommand::ExecuteL() - Unknown op %i."), Operation());
+            break;
+        }
+    }
+
+
+EXPORT_C TInt THuiImageCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C CHuiImageVisual& THuiImageCommand::ImageVisual() const
+    {
+    return *static_cast<CHuiImageVisual*>( Object() );
+    }
+
+
+EXPORT_C const THuiImage& THuiImageCommand::Image() const
+    {
+    return iImage;
+    }
+    
+EXPORT_C void THuiImageCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    THuiObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+
+EXPORT_C THuiTextCommand::THuiTextCommand(CHuiTextVisual& aTextVisual, const TDesC& aText,
+                                          THuiOp aOperation)
+        : THuiObjectCommand(EHuiCommandTypeText, &aTextVisual, aOperation),
+          iText(aText)
+    {
+    }
+
+
+EXPORT_C void THuiTextCommand::ExecuteL(CHuiEnv& /*aEnv*/) const
+    {
+    switch(Operation())
+        {
+        case EHuiOpSetText:
+            TextVisual().SetTextL(iText);
+            break;
+
+        default:
+            HUI_DEBUG1(_L("THuiTextCommand::ExecuteL() - Unknown op %i."), Operation());
+            break;
+        }
+    }
+
+
+EXPORT_C TInt THuiTextCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C CHuiTextVisual& THuiTextCommand::TextVisual() const
+    {
+    return *static_cast<CHuiTextVisual*>( Object() );
+    }
+
+
+EXPORT_C const TDesC& THuiTextCommand::Text() const
+    {
+    return iText;
+    }
+    
+EXPORT_C void THuiTextCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    THuiObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+
+EXPORT_C THuiValueCommand::THuiValueCommand(TAny* aOwner, THuiTimedValue& aValue,
+                                            TReal32 aTarget, TInt aTransitionTime) __SOFTFP
+        : THuiObjectCommand(EHuiCommandTypeValue, aOwner, EHuiOpSet),
+          iTimedValue(aValue), iTarget(aTarget), iTransitionTime(aTransitionTime),
+          iSpeed(0.0)
+    {
+    }
+
+
+EXPORT_C THuiValueCommand::THuiValueCommand(TAny* aOwner, THuiTimedValue& aValue,
+                                            THuiOp aOperation,
+                                            TReal32 aTarget, TReal32 aTiming) __SOFTFP
+        : THuiObjectCommand(EHuiCommandTypeValue, aOwner, aOperation),
+          iTimedValue(aValue), iTarget(aTarget), iTransitionTime(0),
+          iSpeed(0.0)
+    {
+    if(aOperation == EHuiOpSetWithSpeed)
+        {
+        iSpeed = aTiming;
+        }
+    else
+        {
+        iTransitionTime = TInt(aTiming);
+        }
+    }
+
+
+EXPORT_C void THuiValueCommand::ExecuteL(CHuiEnv& /*aEnv*/) const
+    {
+    // Check for interpolation style change ops.
+    TInt op = Operation();
+    if(op >= EHuiOpSetStyle && op < EHuiOpSetStyle + EHuiTimedValueStyleLast)
+        {
+        iTimedValue.SetStyle(THuiInterpolationStyle(op - EHuiOpSetStyle));
+        }
+
+    switch(Operation())
+        {
+        case EHuiOpSet:
+            iTimedValue.Set(iTarget, iTransitionTime);
+            break;
+
+        case EHuiOpSetWithSpeed:
+            iTimedValue.SetWithSpeed(iTarget, iSpeed);
+            break;
+
+        default:
+            HUI_DEBUG1(_L("THuiValueCommand::ExecuteL() - Unknown op %i."), Operation());
+            break;
+        }
+    }
+
+
+EXPORT_C TInt THuiValueCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C THuiTimedValue& THuiValueCommand::TimedValue() const
+    {
+    return iTimedValue;
+    }
+
+
+EXPORT_C TReal32 THuiValueCommand::Target() const __SOFTFP
+    {
+    return iTarget;
+    }
+
+
+EXPORT_C TInt THuiValueCommand::TransitionTime() const
+    {
+    return iTransitionTime;
+    }
+
+
+EXPORT_C TReal32 THuiValueCommand::Speed() const __SOFTFP
+    {
+    return iSpeed;
+    }
+    
+EXPORT_C void THuiValueCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    THuiObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+
+EXPORT_C THuiPointCommand::THuiPointCommand(TAny* aOwner, THuiTimedPoint& aPoint,
+                                            THuiOp aOperation)
+        : THuiObjectCommand(EHuiCommandTypePoint, aOwner, aOperation),
+          iTimedPoint(aPoint), iTransitionTime(0), iSpeed(0.0)
+    {
+    }
+
+
+EXPORT_C THuiPointCommand::THuiPointCommand(TAny* aOwner, THuiTimedPoint& aPoint,
+                                            THuiRealPoint aTarget, TInt aTransitionTime) __SOFTFP
+        : THuiObjectCommand(EHuiCommandTypePoint, aOwner, EHuiOpSet),
+          iTimedPoint(aPoint), iTarget(aTarget),
+          iTransitionTime(aTransitionTime), iSpeed(0.0)
+    {
+    }
+
+
+EXPORT_C THuiPointCommand::THuiPointCommand(TAny* aOwner, THuiTimedPoint& aPoint,
+                                            THuiOp aOperation,
+                                            THuiRealPoint aTarget, TReal32 aTiming) __SOFTFP
+        : THuiObjectCommand(EHuiCommandTypePoint, aOwner, aOperation),
+          iTimedPoint(aPoint), iTarget(aTarget),
+          iTransitionTime(0), iSpeed(0.0)
+    {
+    if(aOperation == EHuiOpSetWithSpeed)
+        {
+        iSpeed = aTiming;
+        }
+    else
+        {
+        iTransitionTime = TInt(aTiming);
+        }
+    }
+
+
+EXPORT_C void THuiPointCommand::ExecuteL(CHuiEnv& /*aEnv*/) const
+    {
+    // Check for interpolation style change ops.
+    TInt op = Operation();
+    if(op >= EHuiOpSetStyle && op < EHuiOpSetStyle + EHuiTimedValueStyleLast)
+        {
+        iTimedPoint.SetStyle(THuiInterpolationStyle(op - EHuiOpSetStyle));
+        }
+
+    switch(Operation())
+        {
+        case EHuiOpSet:
+            iTimedPoint.Set(iTarget, iTransitionTime);
+            break;
+
+        case EHuiOpSetWithSpeed:
+            iTimedPoint.SetWithSpeed(iTarget, iSpeed);
+            break;
+
+        default:
+            HUI_DEBUG1(_L("THuiPointCommand::ExecuteL() - Unknown op %i."), Operation());
+            break;
+        }
+    }
+
+
+EXPORT_C TInt THuiPointCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C THuiTimedPoint& THuiPointCommand::TimedPoint() const
+    {
+    return iTimedPoint;
+    }
+
+
+EXPORT_C THuiRealPoint THuiPointCommand::Target() const __SOFTFP
+    {
+    return iTarget;
+    }
+
+
+EXPORT_C TInt THuiPointCommand::TransitionTime() const
+    {
+    return iTransitionTime;
+    }
+
+
+EXPORT_C TReal32 THuiPointCommand::Speed() const __SOFTFP
+    {
+    return iSpeed;
+    }
+
+EXPORT_C void THuiPointCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    THuiObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+
+EXPORT_C THuiTransformationCommand::THuiTransformationCommand(
+    TAny* aOwner, CHuiTransformation& aTransformation, THuiOp aOperation, TInt aStep)
+        : THuiObjectCommand(EHuiCommandTypeTransformation, aOwner, aOperation),
+          iTransformation(aTransformation), iStep(aStep)
+    {
+    }
+
+
+EXPORT_C void THuiTransformationCommand::ExecuteL(CHuiEnv& /*aEnv*/) const
+    {
+    switch(Operation())
+        {
+        case EHuiOpLoadIdentity:
+            iTransformation.LoadIdentity();
+            break;
+
+        case EHuiOpTranslate:
+            if(iStep != EStepNone)
+                {
+                CHuiTransformation::TTransform& xs = iTransformation.Step(iStep);
+                xs.iType = CHuiTransformation::ETypeTranslate;
+                xs.iParams[EHuiTransformParamTranslateX] = iX;
+                xs.iParams[EHuiTransformParamTranslateY] = iY;
+                xs.iParams[EHuiTransformParamTranslateZ] = iZ;
+                }
+            else
+                {
+                iTransformation.Translate(iX, iY);
+                }
+            break;
+
+        case EHuiOpScale:
+            if(iStep != EStepNone)
+                {
+                CHuiTransformation::TTransform& xs = iTransformation.Step(iStep);
+                xs.iType = CHuiTransformation::ETypeScale;
+                xs.iParams[EHuiTransformParamScaleX] = iX;
+                xs.iParams[EHuiTransformParamScaleY] = iY;
+                xs.iParams[EHuiTransformParamScaleZ] = iZ;
+                }
+            else
+                {
+                iTransformation.Scale(iX, iY, iZ);
+                }
+            break;
+
+        case EHuiOpRotate:
+            if(iStep != EStepNone)
+                {
+                CHuiTransformation::TTransform& xs = iTransformation.Step(iStep);
+                xs.iType = CHuiTransformation::ETypeRotate;
+                xs.iParams[EHuiTransformParamRotateAngle] = iAngle;
+                xs.iParams[EHuiTransformParamRotateAxisX] = iX;
+                xs.iParams[EHuiTransformParamRotateAxisY] = iY;
+                xs.iParams[EHuiTransformParamRotateAxisZ] = iZ;
+                }
+            else
+                {
+                THuiTimedValue unsuspended;
+                unsuspended = iX;
+                TReal32 x = unsuspended.Now();
+                unsuspended = iY;
+                TReal32 y = unsuspended.Now();
+                unsuspended = iZ;
+                TReal32 z = unsuspended.Now();
+                iTransformation.Rotate(iAngle, x, y, z);
+                }
+            break;
+
+        default:
+            HUI_DEBUG1(_L("THuiTransformationCommand::ExecuteL() - Unknown op %i."), Operation());
+            break;
+        }
+    }
+
+
+EXPORT_C TInt THuiTransformationCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C CHuiTransformation& THuiTransformationCommand::Transformation() const
+    {
+    return iTransformation;
+    }
+
+
+EXPORT_C TInt THuiTransformationCommand::Step() const
+    {
+    return iStep;
+    }
+
+
+EXPORT_C void THuiTransformationCommand::SetX(const THuiTimedValue& aValue)
+    {
+    iX = aValue;
+    iX.Suspend();
+    }
+
+
+EXPORT_C void THuiTransformationCommand::SetY(const THuiTimedValue& aValue)
+    {
+    iY = aValue;
+    iY.Suspend();
+    }
+
+
+EXPORT_C void THuiTransformationCommand::SetZ(const THuiTimedValue& aValue)
+    {
+    iZ = aValue;
+    iZ.Suspend();
+    }
+
+
+EXPORT_C void THuiTransformationCommand::SetAngle(const THuiTimedValue& aValue)
+    {
+    iAngle = aValue;
+    iAngle.Suspend();
+    }
+    
+EXPORT_C void THuiTransformationCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    THuiObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+
+EXPORT_C THuiMarkerCommand::THuiMarkerCommand(TInt aId)
+        : THuiCommand(THuiCommandType(EHuiCommandTypeMarkerFirst + aId))
+    {
+    }
+
+
+EXPORT_C void THuiMarkerCommand::ExecuteL(CHuiEnv& /*aEnv*/) const
+    {
+    HUI_DEBUG1(_L("THuiMarkerCommand::ExecuteL() - Marker %i reached."), Id());
+    }
+
+
+EXPORT_C TInt THuiMarkerCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C TInt THuiMarkerCommand::Id() const
+    {
+    return Type() - EHuiCommandTypeMarkerFirst;
+    }
+
+EXPORT_C void THuiMarkerCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    THuiCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
+
+EXPORT_C THuiCustomEventCommand::THuiCustomEventCommand(TInt aEventParam, MHuiEventHandler* aRecipient)
+        : THuiObjectCommand(EHuiCommandTypeCustomEvent, aRecipient, EHuiOpNone),
+          iEventParam(aEventParam)
+    {
+    }
+
+
+EXPORT_C void THuiCustomEventCommand::ExecuteL(CHuiEnv& aEnv) const
+    {
+    THuiEvent customEvent(iEventParam);
+
+    if(Recipient())
+        {
+        Recipient()->OfferEventL(customEvent);
+        }
+    else
+        {
+        aEnv.BroadcastEventL(customEvent);
+        }
+    }
+
+
+EXPORT_C TInt THuiCustomEventCommand::Size() const
+    {
+    return sizeof(*this);
+    }
+
+
+EXPORT_C MHuiEventHandler* THuiCustomEventCommand::Recipient() const
+    {
+    return static_cast<MHuiEventHandler*>( Object() );
+    }
+
+
+EXPORT_C TInt THuiCustomEventCommand::Param() const
+    {
+    return iEventParam;
+    }
+    
+EXPORT_C void THuiCustomEventCommand::CommandExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    THuiObjectCommand::CommandExtension( aExtensionUid, aExtensionParams );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiControl.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,794 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   CHuiControl provides a base class for a generic logical 
+*                control element in the HUITK UI.
+*
+*/
+
+
+
+#include "uiacceltk/HuiControl.h"  // Class definition
+#include "uiacceltk/HuiControlGroup.h"
+#include "uiacceltk/huieventhandler.h"
+#include "uiacceltk/HuiVisual.h"
+#include "uiacceltk/HuiDisplay.h"
+#include "HuiRosterImpl.h"
+#include "uiacceltk/HuiEnv.h"
+#include "HuiVisualFactory.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiProbe.h"
+
+
+EXPORT_C CHuiControl::CHuiControl(CHuiEnv& aEnv)
+        : iEnv(aEnv), iFocusing(EFalse)
+    {
+    HUI_PROBE_ASSOCIATE_WITH_CURRENT_SESSION
+    HUI_PROBE_REPORT_CONSTRUCTED
+
+    // Generate an automatical ID for all controls.
+    iId = CHuiStatic::GenerateId();
+    }
+
+// virtual second phase construtor
+EXPORT_C void CHuiControl::BaseConstructL()
+    {
+    }
+
+
+EXPORT_C CHuiControl::~CHuiControl()
+    {
+    // Cancel scheduled commands for this control.
+    Env().CancelCommands(this);
+    
+    iOwnerGroup = NULL;
+    iBoundDisplay = NULL;
+
+    if(iHost)
+        {
+        iHost->RemoveConnection(this);
+        iHost = NULL;
+        }
+
+    for(TInt i = iConnections.Count() - 1; i >= 0; --i)
+        {
+        RemoveConnection(iConnections[i].iControl);
+        }
+    iConnections.Reset();
+
+    // The visuals are owned by the control.
+    iVisuals.ResetAndDestroy();
+
+    HUI_PROBE_REPORT_DESTRUCTED
+    
+    }
+
+
+EXPORT_C CHuiEnv& CHuiControl::Env() const
+    {
+    return iEnv;
+    }
+
+
+EXPORT_C CHuiControlGroup* CHuiControl::ControlGroup() const
+    {
+    return iOwnerGroup;
+    }
+    
+    
+void CHuiControl::SetControlGroup(CHuiControlGroup& aOwnerGroup)
+    {
+    iOwnerGroup = &aOwnerGroup;
+    }
+    
+    
+EXPORT_C CHuiTextureManager& CHuiControl::TextureManager() const
+    {
+    return Env().TextureManager();
+    }
+    
+    
+EXPORT_C CHuiDisplay* CHuiControl::Display() const
+    {
+    return iBoundDisplay;
+    }
+    
+
+EXPORT_C void CHuiControl::BindDisplay(CHuiDisplay& aDisplay)
+    {
+    iBoundDisplay = &aDisplay;
+    }    
+
+
+EXPORT_C void CHuiControl::SetId(TInt aId)
+    {
+    iId = aId;
+    }
+
+
+EXPORT_C TInt CHuiControl::Id() const
+    {
+    return iId;
+    }
+
+
+EXPORT_C void CHuiControl::AppendL(CHuiVisual* aVisual)
+    {
+    User::LeaveIfError(iVisuals.Append(aVisual));
+    aVisual->SetOwner(*this);
+    TRAPD(err, VisualAddedL(aVisual));
+    if(err != KErrNone)
+        {
+        // Can't leave the visual in the array of our owned visuals.
+        iVisuals.Remove(iVisuals.Find(aVisual));
+        }
+    }
+
+
+EXPORT_C void CHuiControl::AppendL(CHuiVisual* aVisual, CHuiLayout* aParentLayout)
+    {
+    TInt err = KErrNone;
+
+    User::LeaveIfError(iVisuals.Append(aVisual));
+
+    // Append to the parent layout before notification.
+    if(aParentLayout)
+        {
+        TRAP(err, aParentLayout->AppendL(aVisual));
+        }
+
+    TRAP(err, VisualAddedL(aVisual));
+    if(err != KErrNone)
+        {
+        // Can't leave the visual in the array of our owned visuals.
+        iVisuals.Remove(iVisuals.Find(aVisual));
+        }
+    }
+
+
+EXPORT_C void CHuiControl::Remove(CHuiVisual* aVisual)
+    {
+    TInt index = iVisuals.Find(aVisual);
+    if(index != KErrNotFound)
+        {
+        VisualRemoved(aVisual);
+        iVisuals.Remove(index);
+        }
+    }
+
+
+EXPORT_C CHuiVisual* CHuiControl::AppendVisualL(THuiVisualType aVisualType,
+                                                CHuiLayout* aParentLayout)
+    {
+    CHuiVisual* visual = Env().VisualFactory().NewVisualLC(aVisualType, *this);
+    AppendL(visual, aParentLayout);
+    // The visual is now owned by this control.
+    CleanupStack::Pop(visual);
+    return visual;
+    }
+
+
+EXPORT_C CHuiLayout* CHuiControl::AppendLayoutL(THuiLayoutType aLayoutType,
+                                                CHuiLayout* aParentLayout)
+    {
+    CHuiLayout* layout = Env().VisualFactory().NewLayoutLC(aLayoutType, *this);
+    AppendL(layout, aParentLayout);
+    // The visual is now owned by this control.
+    CleanupStack::Pop(layout);
+    return layout;
+    }
+
+
+EXPORT_C CHuiVisual& CHuiControl::Visual(TInt aIndex) const
+    {
+    return *iVisuals[aIndex];
+    }
+
+
+EXPORT_C TInt CHuiControl::VisualCount() const
+    {
+    return iVisuals.Count();
+    }
+
+
+EXPORT_C CHuiVisual* CHuiControl::FindTag(const TDesC8& aTag) const
+    {
+    TInt i = 0;
+    
+    for(i = 0; i < iVisuals.Count(); ++i)
+        {
+        if(HuiUtil::TagMatches(iVisuals[i]->Tag(), aTag))
+            {
+            return iVisuals[i];
+            }
+        }   
+        
+    return NULL;
+    }
+
+
+EXPORT_C CHuiControl* CHuiControl::Host() const
+    {
+    return iHost;
+    }
+
+
+EXPORT_C void CHuiControl::SetHost(CHuiControl* aHost)
+    {
+    // do not call this function directly. This should be only called by the 
+    // AddConnectionL and RemoveConnection functions.
+    
+    if ( aHost )
+        {    
+        // When adding a host, the host must be aware of this connection first.
+        __ASSERT_ALWAYS( aHost->FindConnection(this) != KErrNotFound, USER_INVARIANT() );
+        }
+    
+    TRAPD(err, HostChangingL(aHost));
+    if(err != KErrNone)
+        {
+        if(aHost)
+            {
+            RemoveVisualsFromHostControl(*aHost);
+            }
+        return;
+        }
+
+    iHost = aHost;
+    }
+
+
+EXPORT_C void CHuiControl::AddConnectionL(CHuiControl* aConnectedControl, TInt aRole)
+    {
+    // check that the connection does not exist:
+    if ( FindConnection( aConnectedControl ) != KErrNotFound )
+        {
+        User::Leave( KErrAlreadyExists );
+        }
+    
+    SConnection client;
+    client.iControl = aConnectedControl;
+    client.iRole = aRole;
+    User::LeaveIfError(iConnections.Append(client));
+
+    // This control is now the client's host.
+    aConnectedControl->SetHost(this);
+    
+    if ( aConnectedControl->Host() != this )
+        {
+        // Adding Host failed -> remove connection
+        iConnections.Remove( iConnections.Count()-1 );
+        User::Leave( KErrGeneral );
+        }
+    else
+        {
+        // Host set OK
+        ConnectionAddedL(aConnectedControl, aRole);
+        }
+    }
+
+
+EXPORT_C void CHuiControl::RemoveConnection(CHuiControl* aConnectedControl)
+    {
+    for(TInt i = 0; i < iConnections.Count(); ++i)
+        {
+        if(iConnections[i].iControl == aConnectedControl)
+            {
+            aConnectedControl->SetHost(NULL);
+            const TInt role = iConnections[i].iRole;
+            iConnections.Remove(i);
+            
+            ConnectionRemoved(aConnectedControl, role );
+            return;
+            }
+        }
+    // The client must exist.
+    __ASSERT_ALWAYS(EFalse, THuiPanic::Panic(THuiPanic::EInternal));
+    }
+
+
+EXPORT_C TInt CHuiControl::ConnectionCount() const
+    {
+    return iConnections.Count();
+    }
+
+
+EXPORT_C CHuiControl& CHuiControl::Connection(TInt aIndex) const
+    {
+    return *iConnections[aIndex].iControl;
+    }
+
+// @deprecated
+EXPORT_C CHuiControl& CHuiControl::ConnectionByOrdinal(TInt aOrdinal) const
+    {
+    // First look based on role.
+    for(TInt i = 0; i < iConnections.Count(); ++i)
+        {
+        if(iConnections[i].iRole == aOrdinal + 1)
+            {
+            return *iConnections[i].iControl;
+            }
+        }
+
+    // Fall back to index.
+    return Connection(aOrdinal);
+    }
+
+
+EXPORT_C TInt CHuiControl::FindConnection(const CHuiControl* aConnected) const
+    {
+    for(TInt i = 0; i < iConnections.Count(); ++i)
+        {
+        if(iConnections[i].iControl == aConnected)
+            {
+            return i;
+            }
+        }
+    return KErrNotFound;
+    }
+
+
+EXPORT_C TInt CHuiControl::ConnectionRole(TInt aIndex) const
+    {
+    return iConnections[aIndex].iRole;
+    }
+
+
+// @deprecated
+EXPORT_C TInt CHuiControl::ConnectionOrdinal(TInt aIndex) const
+    {
+    if(iConnections[aIndex].iRole)
+        {
+        return iConnections[aIndex].iRole - 1;
+        }
+    return aIndex;
+    }
+
+
+EXPORT_C TInt CHuiControl::Role() const
+    {
+    return iRole;
+    }
+
+
+EXPORT_C void CHuiControl::SetRole(TInt aRole)
+    {
+    iRole = aRole;
+    }
+
+
+EXPORT_C TInt CHuiControl::HostId() const
+    {
+    return iHostId;
+    }
+
+
+EXPORT_C void CHuiControl::SetHostId(TInt aHostId)
+    {
+    // If adding automatic visual host, there cannot be already one defined.
+    __ASSERT_ALWAYS( !iHost, USER_INVARIANT() );
+    
+    iHostId = aHostId;
+    }
+
+
+EXPORT_C CHuiLayout* CHuiControl::ContainerLayout(const CHuiControl* /*aConnected*/) const
+    {
+    // Generic controls aren't able to provide container layouts.
+    return NULL;
+    }
+
+
+EXPORT_C void CHuiControl::VisualAddedL(CHuiVisual* aVisual)
+    {
+    // Add the new visual to the container layout.
+    if(iHost && !aVisual->Layout())
+        {
+        CHuiLayout* container = iHost->ContainerLayout(this);
+        if(container)
+            {
+            container->AppendL(aVisual);
+            }
+        }
+    else
+        {
+        // If the control has been bound to a display (for example, when
+        // the control is shown), new visuals will be automatically shown.
+        if(iBoundDisplay && 
+           (iOwnerGroup && iBoundDisplay->Roster().Find(iOwnerGroup) != KErrNotFound) && 
+           !aVisual->Layout() && !aVisual->Display())
+            {
+            iBoundDisplay->Roster().ShowVisualL(aVisual);
+            }
+        }
+    }
+
+
+EXPORT_C void CHuiControl::VisualRemoved(CHuiVisual* aVisual)
+    {
+    // Add the new visual to the container layout.
+    if(iHost)
+        {
+        CHuiLayout* container = iHost->ContainerLayout(this);
+        if(container)
+            {
+            container->Remove(aVisual);
+            }
+        }
+    }
+
+
+EXPORT_C void CHuiControl::ConnectionAddedL(CHuiControl* /*aConnectedControl*/, TInt /*aRole*/)
+    {
+    // Do nothing.
+    }
+
+
+EXPORT_C void CHuiControl::ConnectionRemoved(CHuiControl* /*aConnectedControl*/, TInt /*aRole*/)
+    {
+    // Do nothing.
+    }
+
+
+void CHuiControl::RemoveVisualsFromHostControl( CHuiControl& aHostControl )
+    {
+    __ASSERT_ALWAYS( &aHostControl != this, USER_INVARIANT() );
+    
+    // Remove the visuals.
+    for(TInt i = 0; i < iVisuals.Count(); ++i)
+        {
+        if ( iVisuals[i]->Layout() && &iVisuals[i]->Layout()->Owner() == &aHostControl )
+            {
+            iVisuals[i]->Layout()->Remove(iVisuals[i]);
+            
+            // If the own control group is showing still in some roster,
+            // we need to add the root visuals over there
+            if ( iBoundDisplay )
+                {
+                TRAP_IGNORE( iBoundDisplay->Roster().ShowVisualL( iVisuals[i] ) )
+                }
+            }
+        }
+    }
+
+
+EXPORT_C void CHuiControl::HostChangingL(CHuiControl* aNewHost)
+    {
+    CHuiLayout* newContainer = 0;
+    TInt i = 0;
+
+    if(aNewHost)
+        {
+        // The container layout provided by the new host.
+        newContainer = aNewHost->ContainerLayout(this);
+        }
+
+    if(iHost)
+        {
+        RemoveVisualsFromHostControl(*iHost);
+        }
+
+    if(newContainer)
+        {
+        for(i = 0; i < iVisuals.Count(); ++i)
+            {
+            // Only the visuals that aren't already attached to a layout
+            // are added to the container layout.
+            if(!iVisuals[i]->Layout())
+                {
+                newContainer->AppendL(iVisuals[i]);
+                }
+            }
+        }
+    }
+
+
+void CHuiControl::ShowL(CHuiDisplay& aDisplay)
+    {
+    if(HostId())
+        {
+        CHuiControl* host = Env().FindControl(HostId());
+
+        if(host)
+            {
+            host->AddConnectionL(this, Role());
+            }
+        else
+            {
+            }
+        }
+
+    BindDisplay(aDisplay);
+
+    // Show all the visuals on the specified display.
+    for(TInt i = 0; i < iVisuals.Count(); ++i)
+        {
+        // The visuals that are part of a layout will be shown when the
+        // layout is shown.
+        if(!iVisuals[i]->Layout() && !iVisuals[i]->Display())
+            {
+            aDisplay.Roster().ShowVisualL(iVisuals[i]);
+            }
+        }
+        
+    NotifyControlVisibility(ETrue, aDisplay);
+    }
+
+
+void CHuiControl::Hide(CHuiDisplay& aDisplay)
+    {
+    NotifyControlVisibility(EFalse, aDisplay);
+    
+    // Show all the visuals on the specified display.
+    for(TInt i = 0; i < iVisuals.Count(); ++i)
+        {
+        // The visuals that are part of a layout will be shown when the
+        // layout is shown.
+        if(!iVisuals[i]->Layout() && iVisuals[i]->Display() == &aDisplay)
+            {
+            aDisplay.RosterImpl().HideVisual(iVisuals[i]);
+            }
+        }
+
+    // Unbind from display?
+    if(iBoundDisplay == &aDisplay)
+        {
+        iBoundDisplay = NULL;
+        }
+
+    // Unlink from parent control if automated host id set.
+    if(Host() && HostId() )
+        {
+        Host()->RemoveConnection(this);
+        }
+    }
+
+
+EXPORT_C void CHuiControl::NotifyControlVisibility(TBool /*aIsVisible*/, 
+                                                   CHuiDisplay& /*aDisplay*/)
+    {
+    // Nothing to do by default.
+    }
+
+
+EXPORT_C TPoint CHuiControl::HostToDisplay(const TPoint& aPoint) const
+    {
+    if(!iHost)
+        {
+        return aPoint;
+        }
+
+    CHuiLayout* container = iHost->ContainerLayout(this);
+
+    return container->LocalToDisplay(aPoint) + container->Pos().Target();
+    }
+
+
+EXPORT_C TPoint CHuiControl::DisplayToHost(const TPoint& aPoint) const
+    {
+    if(!iHost)
+        {
+        return aPoint;
+        }
+
+    CHuiLayout* container = iHost->ContainerLayout(this);
+
+    return container->DisplayToLocal(aPoint) - container->Pos().Target();
+    }
+
+
+EXPORT_C TRect CHuiControl::Bounds() const
+    {
+    TPoint min;
+    TPoint max;
+
+    min.iX = KMaxTInt;
+    min.iY = KMaxTInt;
+    max.iX = KMinTInt;
+    max.iY = KMinTInt;
+
+    for(TInt i = 0; i < iVisuals.Count(); ++i)
+        {
+        TRect visualRect = iVisuals[i]->DisplayRectTarget();
+
+        min.iX = Min(min.iX, visualRect.iTl.iX);
+        min.iY = Min(min.iY, visualRect.iTl.iY);
+        max.iX = Max(max.iX, visualRect.iBr.iX);
+        max.iY = Max(max.iY, visualRect.iBr.iY);
+        }
+
+    return TRect(min, max);
+    }
+
+
+EXPORT_C TBool CHuiControl::HitTest(const TPoint& aPoint) const
+    {
+    return Bounds().Contains(aPoint);
+    }
+
+
+
+EXPORT_C void CHuiControl::AcquireFocus()
+    {
+    
+    /** @todo  Focus should be set separately in each display the control
+               has visuals in. */
+    
+    for(TInt i = 0; i < iVisuals.Count(); ++i)
+        {
+        if(iVisuals[i]->Display())
+            {
+            iVisuals[i]->Display()->Roster().SetFocus(*this /*Id()*/);
+            //return;
+            }
+        }
+    }   
+
+
+EXPORT_C TBool CHuiControl::Focus() const
+    {
+    return iHasFocus;
+    }
+
+
+void CHuiControl::SetFocus(CHuiDisplay& aDisplay, TBool aHasFocus)
+    {
+    if ( ( iHasFocus && !aHasFocus ) || ( !iHasFocus && aHasFocus ) )
+        {
+        iHasFocus = aHasFocus;
+        FocusChanged(aDisplay, aHasFocus);
+        }
+    }
+
+
+EXPORT_C TBool CHuiControl::IsFocusing() const
+    {
+    return iFocusing;
+    }
+
+
+void CHuiControl::SetFocusing(TBool aFocusing)
+    {
+    iFocusing = aFocusing;
+    }
+
+
+EXPORT_C void CHuiControl::FocusChanged(CHuiDisplay& /*aDisplay*/, TBool /*iFocused*/)
+    {
+    // Do nothing by default.
+    }
+
+
+EXPORT_C TBool CHuiControl::AcceptInput() const
+    {
+    if(iOwnerGroup)
+        {
+        return iOwnerGroup->AcceptInput();
+        }
+    return ETrue;    
+    }
+
+
+EXPORT_C TBool CHuiControl::OfferEventL(const THuiEvent& /*aEvent*/)
+    {
+    return EFalse;
+    }
+
+
+EXPORT_C TRect CHuiControl::DisplayArea() const
+    {
+    if(iBoundDisplay)
+        {
+        return iBoundDisplay->VisibleArea();
+        }
+    
+    // The first visual shown on a display determines the display area.            
+    for(TInt i = 0; i < iVisuals.Count(); ++i)
+        {
+        if(iVisuals[i]->Display())
+            {
+            return iVisuals[i]->Display()->VisibleArea();
+            }
+        }
+        
+    if(!Env().DisplayCount())
+        {
+        // No displays created in the environment yet. Assume device 
+        // native resolution.
+        return TRect(TPoint(0, 0), HuiUtil::ScreenSize());
+        }
+        
+    // Assume it is the primary display, then.   
+    return Env().PrimaryDisplay().VisibleArea();
+    }
+
+
+EXPORT_C THuiRealPoint CHuiControl::DisplayCenter() const __SOFTFP
+    {
+    TRect area(DisplayArea());
+    return area.iTl + THuiRealPoint(area.Width()/2.f, area.Height()/2.f);
+    }
+
+
+EXPORT_C void CHuiControl::CancelAllCommands()
+    {
+    iEnv.CancelCommands(this);
+    
+    for(TInt i = 0; i < iVisuals.Count(); ++i)
+        {
+        iEnv.CancelCommands(iVisuals[i]);
+        }
+    }
+    
+
+void CHuiControl::ClearChanged()
+    {
+    }
+
+
+EXPORT_C void CHuiControl::VisualLayoutUpdated(CHuiVisual& /*aVisual*/)
+    {
+    // Nothing done by default.
+    }
+
+
+EXPORT_C void CHuiControl::VisualDestroyed(CHuiVisual& aVisual)
+    {
+    Remove(&aVisual);
+    }
+
+
+EXPORT_C void CHuiControl::VisualPrepareDrawFailed(
+#ifdef _DEBUG
+    #ifdef __WINS__
+        #ifdef HUI_NO_DEBUG_OUTPUT_IN_WINS
+            CHuiVisual& /*aVisual*/, 
+            TInt /*aErrorCode*/
+        #else
+            CHuiVisual& /*aVisual*/, 
+            TInt /*aErrorCode*/
+        #endif    
+    #else
+        CHuiVisual& /*aVisual*/, 
+        TInt /*aErrorCode*/
+    #endif
+#else    
+    CHuiVisual& /*aVisual*/, 
+    TInt /*aErrorCode*/
+#endif
+    )
+	{
+	//HUI_DEBUG2(_L("CHuiControl::VisualPrepareDrawFailed() - ERROR! Visual 0x%x failed to prepare for drawing. Error Code %i. Panicing. (TIP: override this method for custom error handling)."), 
+	//           &aVisual, aErrorCode);
+	#ifdef _DEBUG           
+	HUI_PANIC(THuiPanic::EVisualPrepareDrawFailed)
+	#endif
+	}
+
+
+EXPORT_C MHuiEventHandler* CHuiControl::EventHandler()
+    {
+    return this;
+    }
+
+
+HUI_SESSION_OBJECT_IMPL_EXPORT(CHuiControl, ETypeControl)
+
+EXPORT_C void CHuiControl::ControlExtension(const TUid& /*aExtensionUid*/, TAny** /*aExtensionParams*/)
+    {
+    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiControlGroup.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,257 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "uiacceltk/HuiControlGroup.h"  // Class definition
+#include "uiacceltk/HuiLayouts.h"
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiTransformation.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiProbe.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiDisplay.h"
+#include "uiacceltk/HuiEnv.h"
+
+CHuiControlGroup::CHuiControlGroup(TInt aResourceId, CHuiEnv& aEnv)
+        : iResourceId(aResourceId), iEnv(aEnv), iAcceptInput(ETrue), iOpacity( 1.f )
+    {
+    HUI_PROBE_ASSOCIATE_WITH_CURRENT_SESSION
+    HUI_PROBE_REPORT_CONSTRUCTED
+    }
+
+
+void CHuiControlGroup::ConstructL()
+    {    
+    }
+    
+    
+void CHuiControlGroup::ConstructFromResourceL(TResourceReader& /*aReader*/)
+    {
+    /// @todo Method not yet implemented. Implement if UI creation from resource file is required.
+    }
+
+	
+CHuiControlGroup::~CHuiControlGroup()
+    {    
+    iUnhandledEventObservers.Close();
+    
+    // The group owns the controls, so it must destroy them.
+    // Destroy in reverse order so that references will be removed in 
+    // natural order (children of a pane will be removed before the pane).
+    for(TInt i = iControls.Count() - 1; i >= 0; --i)
+        {
+        CHuiControl* c = iControls[i];
+        iControls.Remove(i);
+        delete c;
+        }
+    iControls.Reset();
+    
+    delete iTransform;
+    HUI_PROBE_REPORT_DESTRUCTED
+    }
+    
+    
+EXPORT_C TInt CHuiControlGroup::ResourceId() const
+    {
+    return iResourceId;
+    }
+
+
+EXPORT_C void CHuiControlGroup::AppendL(CHuiControl* aControl)
+    {
+    User::LeaveIfError( iControls.Append(aControl) );
+    aControl->SetControlGroup(*this);
+    
+    // if the control group is shown in a roster, the new control 
+    // has to be shown as well
+    
+    TRAPD( err, 
+        {
+        // if there are other controls in the group, check from those
+        if ( iControls.Count() > 1 ) // so more than this added one
+            {
+            if ( iControls[0]->Display() )
+                {
+                aControl->ShowL( *iControls[0]->Display() );
+                }
+            }
+        else
+            {
+            // if not, go though the displays
+            for ( TInt d = 0; d < iEnv.DisplayCount(); d++ )
+                {
+                CHuiDisplay* display = (iEnv.Displays())[d];
+                // if this control group is in any roster, show the control in that display.
+                if ( display->Roster().Find( this ) != KErrNotFound )
+                    {
+                    aControl->ShowL( *display );
+                    }
+                }
+            }
+            
+        }); // TRAPD
+    if ( err != KErrNone )
+        {
+        iControls.Remove( iControls.Count()-1);
+        CHuiControlGroup* nullGroup = NULL;
+        aControl->SetControlGroup(*nullGroup);
+        User::Leave( err );
+        }
+    }
+
+
+EXPORT_C void CHuiControlGroup::AppendAndPopL(CHuiControl* aControl)
+    {
+    AppendL(aControl);
+    CleanupStack::Pop(aControl);
+    }
+
+
+EXPORT_C TInt CHuiControlGroup::Remove(CHuiControl* aControl)
+    {
+    TInt index = iControls.Find(aControl);
+    if(index != KErrNotFound)
+        {
+        // If the control group is shown is a roster, the 
+        // control has to be hidden as well.
+        CHuiDisplay* display = aControl->Display();
+        if ( display ) // check that the control is bound to a display
+            {
+            // Check that this group is shown on the display.
+            if ( display->Roster().Find( this ) != KErrNotFound )
+                {
+                // hide control 
+                aControl->Hide( *display );
+                }
+            }
+        
+        iControls.Remove(index);
+        CHuiControlGroup* nullGroup = NULL;
+        aControl->SetControlGroup(*nullGroup);
+        return KErrNone;
+        }
+    // The control was not in the group.    
+    return KErrNotFound;
+    }
+
+
+EXPORT_C TInt CHuiControlGroup::Count() const
+    {
+    return iControls.Count();
+    }
+
+
+EXPORT_C CHuiControl& CHuiControlGroup::Control(TInt aIndex) const
+    {
+    return *iControls[aIndex];
+    }
+
+
+EXPORT_C CHuiControl* CHuiControlGroup::FindControl(TInt aId) const
+    {
+    for(TInt i = 0; i < iControls.Count(); ++i)
+        {
+        if(iControls[i]->Id() == aId)
+            {
+            return iControls[i];
+            }
+        }
+    return NULL;
+    }
+
+
+EXPORT_C void CHuiControlGroup::EnableTransformationL(TBool aIsTransformed)
+    {
+    if(iTransform && !aIsTransformed)
+        {
+        // Disable transformation.
+        delete iTransform;
+        iTransform = NULL;
+        }
+    else if(!iTransform && aIsTransformed)
+        {
+        // Enable transformation.
+        iTransform = CHuiTransformation::NewL();
+        }
+    else
+        {
+        // For PC-lint
+        }
+    }
+
+    
+EXPORT_C CHuiTransformation& CHuiControlGroup::Transformation()
+    {
+    if(!iTransform)
+        {
+        THuiPanic::Panic(THuiPanic::EControlGroupTransformNotEnabled);
+        }
+    return *iTransform;        
+    }
+
+
+EXPORT_C TBool CHuiControlGroup::IsTransformed() const
+    {
+    return iTransform != 0;
+    }
+
+
+EXPORT_C TBool CHuiControlGroup::AcceptInput() const
+    {
+    return iAcceptInput;
+    }
+
+
+EXPORT_C void CHuiControlGroup::SetAcceptInput(TBool aAcceptInput) 
+    {
+    iAcceptInput = aAcceptInput;
+    }
+
+
+TBool CHuiControlGroup::Changed() const
+    {
+    if(iTransform && iTransform->Changed())
+        {
+        return ETrue;
+        }
+
+    return iOpacity.Changed();
+    }
+
+
+void CHuiControlGroup::ClearChanged()
+    {
+    iOpacity.ClearChanged();
+
+    if(iTransform)
+        {
+        iTransform->ClearChanged();
+        }
+    
+    for(TInt i = 0; i < iControls.Count(); ++i)
+        {
+        iControls[i]->ClearChanged();
+        }
+    }
+
+
+HUI_SESSION_OBJECT_IMPL_EXPORT(CHuiControlGroup, ETypeControlGroup)
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiCurvePath.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,418 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation for CHuiCurvePath. Curve paths are composed of 
+*                path segments and can be used as mapping functions, and in 
+*                line visuals.
+*
+*/
+
+
+
+#include "uiacceltk/HuiCurvePath.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiRealPoint.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/huifixmath.h"
+#include "huicurvepathprivdata.h"
+#include <e32math.h>
+
+
+
+EXPORT_C CHuiCurvePath* CHuiCurvePath::NewL()
+    {
+    CHuiCurvePath* self = CHuiCurvePath::NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+    
+    
+EXPORT_C CHuiCurvePath* CHuiCurvePath::NewLC()
+    {
+    // Create a curve path suitable for the current renderer.
+    CHuiCurvePath* self = CHuiStatic::Renderer().CreateCurvePathL();
+    self->iExtension = new (ELeave) THuiCurvePathExtension;
+    self->iExtension->iLooped = ETrue;
+    self->iExtension->iLegacyAPIUsed = EFalse;
+    self->iExtension->iVisual = NULL;
+    CleanupStack::PushL(self);
+    return self;
+    }
+
+
+EXPORT_C CHuiCurvePath::CHuiCurvePath()
+        : iExtension(NULL), iChanged(ETrue)
+    {
+    }
+    
+    
+EXPORT_C CHuiCurvePath::~CHuiCurvePath()
+    {
+    iSegments.Close();
+    delete iExtension;
+    }
+  
+    
+EXPORT_C void CHuiCurvePath::Reset()
+    {
+    iSegments.Reset();
+    iTotalLength = 0;
+    iOffset.Set(TPoint(0, 0));
+    iPosOrigin = 0;
+    iChanged = ETrue;
+    }
+    
+      
+EXPORT_C void CHuiCurvePath::EnableLoop(TBool aEnable)
+    {
+    iExtension->iLooped = aEnable;
+    iChanged = ETrue;
+    }
+
+
+EXPORT_C TBool CHuiCurvePath::Loop() const
+    {
+    return iExtension->iLooped;
+    }
+    
+    
+EXPORT_C TBool CHuiCurvePath::NeedUpdate() const
+    {
+    if ( iOffset.Changed() )
+        {
+        return ETrue;
+        }
+    
+    return iNeedUpdate;
+    }
+    
+EXPORT_C void CHuiCurvePath::SetNeedsUpdate()
+    {
+    iNeedUpdate = ETrue;
+    }
+    
+    
+EXPORT_C void CHuiCurvePath::SetOrigin(TReal32 aPosOrigin) __SOFTFP
+    {
+    iPosOrigin = aPosOrigin;
+    iNeedUpdate = ETrue;    
+    iChanged = ETrue;
+    }
+
+
+/**
+ * @deprecated 
+ */
+EXPORT_C void 
+CHuiCurvePath::AppendLineL(const TPoint& aStart, const TPoint& aEnd, 
+                           TReal32 aLength) __SOFTFP
+    {
+    AppendLineL(THuiRealPoint(aStart), THuiRealPoint(aEnd), aLength);
+    iExtension->iLegacyAPIUsed = ETrue;
+    }
+    
+
+EXPORT_C void 
+CHuiCurvePath::AppendLineL(const THuiRealPoint& aStart, const THuiRealPoint& aEnd, 
+                           TReal32 aLength) __SOFTFP
+    {
+    TSegment segment;
+    segment.iType = ESegmentTypeLine;
+    segment.iOrigin = aStart;
+    segment.iDelta = aEnd - aStart;
+    segment.iStartAngle = segment.iAngleDelta = 0;
+    if(aLength < 0)
+        {
+        TReal length2 = segment.iDelta.iX * segment.iDelta.iX + 
+                        segment.iDelta.iY * segment.iDelta.iY;
+        TReal target;
+        Math::Sqrt(target, length2);
+        segment.iLength = TReal32(target);
+        }
+    else
+        {
+        segment.iLength = aLength;
+        }
+    TReal32 length = CalculateLength();        
+    segment.iTotalPos = length;
+
+    User::LeaveIfError(iSegments.Append(segment)); 
+    
+    iTotalLength = length + segment.iLength;
+    iNeedUpdate = ETrue;
+    iChanged = ETrue;
+    }
+    
+
+/**
+ * @deprecated 
+ */
+EXPORT_C void 
+CHuiCurvePath::AppendArcL(const TPoint& aOrigin, const TSize& aSize,
+                          TReal32 aStartAngle, TReal32 aEndAngle,
+                          TReal32 aLength) __SOFTFP
+    {
+    AppendArcL(THuiRealPoint(aOrigin), THuiRealSize(aSize), aStartAngle, aEndAngle, aLength);    
+    iExtension->iLegacyAPIUsed = ETrue;
+    }
+
+
+
+EXPORT_C void 
+CHuiCurvePath::AppendArcL(const THuiRealPoint& aOrigin, const THuiRealSize& aSize,
+                          TReal32 aStartAngle, TReal32 aEndAngle,
+                          TReal32 aLength) __SOFTFP
+    {
+    TSegment segment;
+    segment.iType = ESegmentTypeArc;
+    segment.iOrigin = aOrigin;
+    segment.iDelta = THuiRealPoint(aSize.iWidth, aSize.iHeight);
+    segment.iStartAngle = aStartAngle;
+    segment.iAngleDelta = aEndAngle - aStartAngle;
+    if(aLength < 0)
+        {
+        // Calculate ellipse arc length.
+        // Approximation: 2 * pi * sqrt((a^2+b^2)/2) 
+        TReal temp = 0;
+        TReal a = (aSize.iWidth*aSize.iWidth + 
+                   aSize.iHeight*aSize.iHeight) / 2.0;
+        Math::Sqrt(temp, a);
+        TReal32 angleLength = segment.iAngleDelta;
+        if(angleLength < 0)
+            {
+            angleLength = -angleLength;
+            }
+        segment.iLength = 2.f * KPi * temp * angleLength / 360.f;
+        }
+    else
+        {
+        segment.iLength = aLength;
+        }
+
+    TReal32 length = CalculateLength();        
+    segment.iTotalPos = length;
+        
+    User::LeaveIfError(iSegments.Append(segment));
+    
+    iTotalLength = length + segment.iLength;
+    iNeedUpdate = ETrue;
+    iChanged = ETrue;
+    }
+
+
+EXPORT_C TReal32 CHuiCurvePath::CalculateLength() const
+    {
+    TReal32 length = 0;
+    
+    for(TInt i = 0; i < iSegments.Count(); ++i)
+        {
+        length += iSegments[i].iLength;
+        }
+    return length;        
+    }
+    
+    
+EXPORT_C TReal32 CHuiCurvePath::Length() const __SOFTFP
+    {
+    return iTotalLength;
+    }
+     
+
+EXPORT_C void CHuiCurvePath::Evaluate(TReal32 aPos, THuiRealPoint& aPoint) const __SOFTFP
+    {
+    if(!iSegments.Count())
+        {
+        // No segments to evalute.
+        aPoint = THuiRealPoint(0.f, 0.f);
+        return;
+        }
+    
+    aPos += iPosOrigin;
+    
+    TReal32 length = Length();
+    if(iExtension->iLooped)
+        {
+        // Wrap to range so that negative positions are mapped to the end.
+        HuiUtil::WrapValue(aPos, 0.f, length);
+        }
+    else
+        {
+        aPos = Max(0.f, aPos);
+        aPos = Min(aPos, length);
+        }
+    
+    if(aPos < 0)
+        {
+        // Not a valid position on the path. Beginning of the first segment.
+        EvaluateSegment(0.f, iSegments[0], aPoint);
+        return;
+        }                        
+        
+    for(TInt i = 0; i < iSegments.Count(); ++i)
+        {
+        const TSegment& segment = iSegments[i];
+        
+        if(aPos < segment.iLength)
+            {
+            EvaluateSegment(aPos, segment, aPoint);
+            return;
+            }
+            
+        aPos -= segment.iLength;
+        }
+        
+    // The position is past the end of the last segment.
+    const TSegment& lastSegment = iSegments[iSegments.Count() - 1];
+    EvaluateSegment(lastSegment.iLength, lastSegment, aPoint);
+    }
+
+
+EXPORT_C TInt CHuiCurvePath::SegmentCount() const
+    {
+    return iSegments.Count();
+    }
+                         
+
+EXPORT_C CHuiCurvePath::TSegment CHuiCurvePath::Segment(TInt aIndex) const
+    {
+    return iSegments[aIndex];
+    }
+
+
+EXPORT_C void CHuiCurvePath::EvaluateSegment(TReal32 aPos, const TSegment& aSegment,
+                                    THuiRealPoint& aPoint,
+                                    THuiRealPoint* aNormal) const
+    {
+    // aPos is in range [0,width].
+    if(aSegment.iLength > 0)
+        {
+        // Normalize position.
+        aPos /= aSegment.iLength;
+        }
+    
+    if(aSegment.iType == ESegmentTypeLine)
+        {
+        aPoint.iX = aSegment.iOrigin.iX + aPos * aSegment.iDelta.iX;
+        aPoint.iY = aSegment.iOrigin.iY + aPos * aSegment.iDelta.iY;
+        
+        if(aNormal)
+            {
+            aNormal->iX = -aSegment.iDelta.iY;
+            aNormal->iY = aSegment.iDelta.iX;
+            HuiUtil::QuickNormalize(*aNormal);
+            }
+        }
+    else if(aSegment.iType == ESegmentTypeArc)
+        {
+        TReal a = 0.0;
+        TReal b = 0.0;
+        const TReal angle = ((aSegment.iStartAngle + aPos * aSegment.iAngleDelta) / 180.f ) * KPi;
+        
+        Math::Cos( a, angle );
+        Math::Sin( b, angle );
+
+        aPoint.iX = aSegment.iOrigin.iX + aSegment.iDelta.iX * a;
+        aPoint.iY = aSegment.iOrigin.iY + aSegment.iDelta.iY * b;
+        
+        if(aNormal)
+            {
+            aNormal->iX = a * aSegment.iDelta.iX;
+            aNormal->iY = b * aSegment.iDelta.iY;
+            HuiUtil::QuickNormalize(*aNormal);
+            
+            // Reverse normal, if arc going the other way.
+            if(aSegment.iAngleDelta > 0)
+                {
+                aNormal->iX = -aNormal->iX;
+                aNormal->iY = -aNormal->iY;
+                }
+            }
+        }
+    else
+        {
+        // for PC lint
+        }
+
+    // Apply an offset.        
+    aPoint += iOffset.RealNow();        
+    }
+
+
+EXPORT_C TReal32 CHuiCurvePath::MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP
+    {
+    THuiRealPoint point;
+    Evaluate(aValue, point);
+    if(aComponent == 0)
+        {
+        return point.iX;
+        }
+    else
+        {
+        return point.iY;
+        }
+    }
+    
+    
+EXPORT_C TBool CHuiCurvePath::MappingFunctionChanged() const
+    {
+    return iChanged;
+    }
+    
+    
+EXPORT_C void CHuiCurvePath::MappingFunctionClearChanged()
+    {
+    iChanged = EFalse;
+    }
+
+    
+EXPORT_C void CHuiCurvePath::Update(TReal32 /*aStartPos*/, 
+                           TReal32 /*aEndPos*/, 
+                           TReal32 /*aAlphaFactor*/,
+                           MHuiMappingFunction* /*aAlphaFunction*/,
+                           MHuiMappingFunction* /*aWidthFunction*/) __SOFTFP
+    {
+    iNeedUpdate = EFalse;
+    iOffset.ClearChanged();
+    }
+    
+
+EXPORT_C void CHuiCurvePath::Draw(const TPoint& /*aOrigin*/, CHuiGc* /*aGc*/) const
+    {
+    }
+
+EXPORT_C void CHuiCurvePath::SetVisual(const CHuiVisual* aVisual) const
+    {
+    if (!iExtension->iLegacyAPIUsed)
+        {
+        iExtension->iVisual = const_cast<CHuiVisual*>(aVisual);   
+        }
+    }
+
+EXPORT_C const CHuiVisual* CHuiCurvePath::GetVisual() const
+    {
+    return iExtension->iVisual;
+    }
+
+
+EXPORT_C TBool CHuiCurvePath::IsLegacyApiUsed() const
+	{
+	return(iExtension->iLegacyAPIUsed);
+	}
+
+EXPORT_C void CHuiCurvePath::CurvePathExtension(const TUid& /*aExtensionUid*/, TAny** aExtensionParams)
+    {
+    // If no extension with given UID was found, indicate it by returning null
+    *aExtensionParams = NULL;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiCurvePathLayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation for CHuiCurvePathLayout. Combines a layout 
+*                visual and a curve path. The path is rescaled as the layout's 
+*                size changes.
+*
+*/
+
+
+
+#include "uiacceltk/HuiCurvePathLayout.h"  // Class definition
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiCurvePath.h"
+#include "uiacceltk/HuiPanic.h"
+
+
+const TReal32 KPathLogicalCoordsMax = 1000.0;
+
+
+EXPORT_C CHuiCurvePathLayout* CHuiCurvePathLayout::AddNewL(CHuiControl& aOwnerControl,
+                                                           CHuiLayout* aParentLayout)
+    {
+    CHuiCurvePathLayout* layout = new (ELeave) CHuiCurvePathLayout(aOwnerControl);
+    CleanupStack::PushL(layout);
+    layout->ConstructL();    
+    aOwnerControl.AppendL(layout, aParentLayout);
+    CleanupStack::Pop(layout);           
+    return layout;
+    }
+
+
+CHuiCurvePathLayout::CHuiCurvePathLayout(MHuiVisualOwner& aOwner)
+        : CHuiLayout(aOwner)
+    {
+    }
+
+
+void CHuiCurvePathLayout::ConstructL()
+    {    
+    CHuiLayout::ConstructL();
+    iPath = CHuiCurvePath::NewL();
+    }
+
+    
+CHuiCurvePathLayout::~CHuiCurvePathLayout()
+    {    
+    delete iPath;
+    }
+
+
+EXPORT_C CHuiCurvePath& CHuiCurvePathLayout::CurvePath()
+    {
+    return *iPath;
+    }
+
+
+TReal32 CHuiCurvePathLayout::MapValue(TReal32 aValue, TInt aMode) const __SOFTFP
+    {
+    TReal32 value = iPath->MapValue(aValue, aMode);  
+    
+    if (iPath->IsLegacyApiUsed())
+    	{
+    	// The path defines points in range (0, 1000).
+    	value /= KPathLogicalCoordsMax;
+    	if(aMode == 0) // Horizontal.
+        	{
+        	value *= Size().RealNow().iX;
+        	}
+    	else // Vertical.
+        	{
+        	value *= Size().RealNow().iY;
+        	}
+    	}
+    
+    return value;
+    }
+
+TBool CHuiCurvePathLayout::MappingFunctionChanged() const
+    {
+    return iPath->MappingFunctionChanged() || Size().Changed();
+    }
+    
+    
+void CHuiCurvePathLayout::MappingFunctionClearChanged()
+    {
+    iPath->MappingFunctionClearChanged();
+    }
+
+void CHuiCurvePathLayout::SetSize(const THuiRealSize& aSize, TInt aTransitionTime)
+    {
+    CHuiLayout::SetSize(aSize, aTransitionTime);
+    UpdateChildrenLayout(aTransitionTime);    
+    }
+    
+
+TBool CHuiCurvePathLayout::ChildSize(TInt /*aOrdinal*/, TSize& /*aSize*/)
+    {
+    return EFalse;
+    }
+
+TBool CHuiCurvePathLayout::ChildPos(TInt /*aOrdinal*/, TPoint& /*aPos*/)
+    {
+    return EFalse;
+    }
+    
+EXPORT_C TInt CHuiCurvePathLayout::ChildRect(TInt /*aOrdinal*/, THuiRealRect& /*aPos*/)
+    {
+    return THuiLayoutChildRectUpdateNotNeeded;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiDeckLayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation for CHuiDeckLayout. Deck layout is a very simple layout
+*                that overlays all its children to match the layout's own rectangle.
+*                Think of it as a deck of cards.
+*
+*/
+
+
+
+#include "uiacceltk/HuiDeckLayout.h"  // Class definition
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiPanic.h"
+
+
+EXPORT_C CHuiDeckLayout* CHuiDeckLayout::AddNewL(CHuiControl& aOwnerControl,
+                                                 CHuiLayout* aParentLayout)
+    {
+    CHuiDeckLayout* layout = new (ELeave) CHuiDeckLayout(aOwnerControl);
+    CleanupStack::PushL(layout);
+    layout->ConstructL();    
+    aOwnerControl.AppendL(layout, aParentLayout);
+    CleanupStack::Pop(layout);           
+    return layout;
+    }
+
+
+CHuiDeckLayout::CHuiDeckLayout(MHuiVisualOwner& aOwner)
+        : CHuiLayout(aOwner)
+    {
+    }
+
+
+void CHuiDeckLayout::ConstructL()
+    {    
+    CHuiLayout::ConstructL();
+    }
+
+    
+EXPORT_C CHuiDeckLayout::~CHuiDeckLayout()
+    {    
+    }
+
+
+void CHuiDeckLayout::SetSize(const THuiRealSize& aSize, TInt aTransitionTime)
+    {
+    CHuiLayout::SetSize(aSize, aTransitionTime);
+    UpdateChildrenLayout(aTransitionTime);    
+    }
+
+TBool CHuiDeckLayout::ChildSize(TInt aOrdinal, TSize& aSize)
+    {
+    TBool result(EFalse);
+    THuiRealRect rect;
+    TInt childRectStatus(THuiLayoutChildRectUpdateNotNeeded);
+    childRectStatus = ChildRect(aOrdinal, rect);
+    if(childRectStatus != THuiLayoutChildRectNotImplemented)
+        {
+        result = (childRectStatus & THuiLayoutChildRectSizeUpdateNeeded);
+        if(result)
+            {
+            THuiRealPoint size(rect.Width(), rect.Height());
+            aSize = LocalPointInPixels(size).AsSize();
+            }
+        }
+    return result;
+    }
+
+TBool CHuiDeckLayout::ChildPos(TInt aOrdinal, TPoint& aPos)
+    {
+    TBool result(EFalse);
+    THuiRealRect rect;
+    TInt childRectStatus(THuiLayoutChildRectUpdateNotNeeded);
+    childRectStatus = ChildRect(aOrdinal, rect);
+    if(childRectStatus != THuiLayoutChildRectNotImplemented)
+        {
+        result = (childRectStatus & THuiLayoutChildRectPosUpdateNeeded);
+        if(result)
+            {
+            aPos = LocalPointInPixels(rect.iTl);
+            }
+        }
+    return result;
+    }
+
+TInt CHuiDeckLayout::ChildRect(TInt /*aOrdinal*/, THuiRealRect& aPos)
+    {
+    THuiRealSize innerSize = InnerSize();
+    aPos.iTl = InnerTopLeft(); 
+    aPos.iBr = aPos.iTl + THuiRealPoint(innerSize.iWidth, innerSize.iHeight) ; 
+    return THuiLayoutChildRectLayoutUpdateNeeded;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiDisplay.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1685 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiDisplay, a drawing buffer into which a 
+*                the toolkit contents (visuals) are drawn.
+*
+*/
+
+
+
+#include "uiacceltk/HuiDisplay.h"  // Class definition
+#include "uiacceltk/HuiStatic.h"
+#include "HuiRenderPlugin.h"
+#include "HuiRenderSurface.h"
+#include "uiacceltk/HuiEnv.h"
+#include "HuiRosterImpl.h"
+#include "uiacceltk/HuiSkin.h"
+#include "uiacceltk/HuiTransformation.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiTexture.h"
+#include "uiacceltk/HuiProbe.h"
+#include "uiacceltk/HuiS60Skin.h"
+#include "uiacceltk/HuiGc.h"
+#ifndef __SERIES60_30__ 
+#include "HuiTargetBitmap.h"
+#endif
+#include "uiacceltk/HuiControlGroup.h"
+#include "alf/alfconstants.h" 
+
+#ifdef RD_ALF_IN_PLATFORM            
+#include <displaylayoutmetrics.cdl.h>
+#endif // RD_ALF_IN_PLATFORM            
+
+#include <AknsRendererWrapper.h>
+#include <AknsDrawUtils.h>
+
+#include <coecntrl.h>
+#include <uiacceltk/huidisplaybackgrounditem.h>
+#include "huiskinbackroundlayout.h"
+#include "HuiFxEngine.h"
+
+const TUid KHuiInternalFbsBitmapBufferGcUid = {0x2000e5a3}; 
+
+//#define HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+
+
+// *** Class CHuiFbsBitmapBufferGc
+
+class CHuiFbsBitmapBufferGc: public CBase, public MHuiFbsBitmapBufferGc
+    {
+    public:
+    	CHuiFbsBitmapBufferGc(CFbsBitmap* aBitmap) :iBitmap(aBitmap) {};
+    
+    private: // From MHuiFbsBitmapBufferGc
+    	void ReleaseGc(); 
+    	CFbsBitmap* Bitmap(); 
+
+    private:
+    	CFbsBitmap* iBitmap; // not owned  
+    };
+
+
+void CHuiFbsBitmapBufferGc::ReleaseGc()
+	{
+	// Line "delete(this)" should always be the last line in this method.
+	// If you change this method behaviour make sure you know what caveats "delete(this)" has.
+	delete(this); 
+	}
+
+CFbsBitmap* CHuiFbsBitmapBufferGc::Bitmap()
+	{
+	return iBitmap; 
+	}
+
+// *** Class CHuiDisplay
+
+CHuiDisplay::CHuiDisplay(CHuiEnv& aEnv, RWindow* aNativeWindow, TInt aDisplayType, TUid aBackBufferUid )
+          : iEnv(aEnv),
+          iDisplayType(aDisplayType),
+          iActive(ETrue),
+          iBackgroundColor(KRgbBlack),
+          iUpdateRenderState(ETrue),
+          iUsageHint(EHuiDisplayUsageGeneric),
+          iOnForeground(ETrue),
+          iScreenBufferUid(aBackBufferUid),
+          iUseTransformedDirtyRegions(EFalse),
+          iDrawVisualOutline( EDrawVisualOutlineNone ),
+          iNativeWindow(aNativeWindow)
+    {
+    }
+
+CHuiDisplay::CHuiDisplay(CHuiEnv& aEnv, CCoeControl* aNativeControl, TInt aDisplayType, TUid aBackBufferUid )
+        : iEnv(aEnv),
+          iDisplayType(aDisplayType),
+          iNativeControl(aNativeControl),
+          iSize(0, 0),
+          iActive(ETrue),
+          iBackgroundColor(KRgbBlack),
+          iUpdateRenderState(ETrue),
+          iUsageHint(EHuiDisplayUsageGeneric),
+          iOnForeground(ETrue),
+          iScreenBufferUid(aBackBufferUid),
+          iUseTransformedDirtyRegions(EFalse),
+          iDrawDirtyRegions( EFalse ),
+          iDrawVisualOutline( EDrawVisualOutlineNone )
+    {
+    }
+
+
+void CHuiDisplay::ConstructL(const TRect& aRect, CHuiRoster* aSharedRoster)
+    {
+    HUI_DEBUG1(_L("CHuiDisplay::ConstructL - Free memory in beginning: %i"), HuiUtil::FreeMemory());
+    
+    // Register this display to receive foreground lost / gained events.
+/*    CCoeEnv* coeEnv = CCoeEnv::Static();
+    if(coeEnv && NativeWindow())
+        {
+        coeEnv->AddMessageMonitorObserverL(*this);
+        NativeWindow()->EnableVisibilityChangeEvents();
+        }
+*/    
+
+    iSize = aRect.Size();
+
+    // Create a rendering surface.
+    iRenderSurface = CHuiStatic::Renderer().CreateRenderSurfaceL(*this);
+    
+    iCurrentDirtyRegions = &iDirtyRegions;
+    
+    // Preserve previous dirty rect info only if the surface uses both dirty rects and double 
+    // buffering
+    TUint flags = MHuiRenderSurface::EFlagUseDirtyRects | MHuiRenderSurface::EFlagUseDoubleBuffering;
+    TBool preservePreviousDirtyRectInfo = ((iRenderSurface->Flags() & flags) == flags);
+
+    if (preservePreviousDirtyRectInfo)
+   		{
+    	iPreviousDirtyRegions = &iDirtyRegions2;
+   		}
+    		 
+    // Create a control roster.
+    if(aSharedRoster)
+        {
+        iRoster.Set(aSharedRoster, EHuiDoesNotHaveOwnership);
+        }
+    else
+        {
+        // Construct a private roster.
+        CHuiRosterImpl* roster = new (ELeave) CHuiRosterImpl(this);
+        iRoster.Set(roster, EHuiHasOwnership);
+        }
+
+    // Transformation for the entire display.
+    iTransform = CHuiTransformation::NewL();
+    // Window transformation for the entire display.
+    iWindowTransform = CHuiTransformation::NewL();
+
+	SetScreenBufferLock(EFalse);
+
+    // Create a graphics context.
+    iGc = CHuiStatic::Renderer().CreateGcL();
+
+    HUI_DEBUG1(_L("CHuiDisplay::ConstructL - Free memory after GC created: %i"), HuiUtil::FreeMemory());
+
+    SetVisibleArea(TRect(TPoint(0, 0), iSize));
+
+    HUI_DEBUG1(_L("CHuiDisplay::ConstructL - Free memory after surface created: %i"), HuiUtil::FreeMemory());
+    
+    if ( !CHuiStatic::Renderer().Allows( EHuiRenderPluginAllowPBufferSurfaces ) )
+    // There is no default render surface, so make this one current 
+    // immediately to enable texture loading.
+        {
+        iRenderSurface->MakeCurrent();
+        }
+    
+    // When dirty regions are transformed it is possible to avoid
+    // full display refresh in many cases -> better performance.
+    iGc->EnableTransformedClippingRects(iUseTransformedDirtyRegions);
+
+    HUI_DEBUG1(_L("CHuiDisplay::ConstructL - Free memory when exiting ConstructL: %i"), HuiUtil::FreeMemory());
+    }
+
+
+EXPORT_C CHuiDisplay::~CHuiDisplay()
+    {
+    HUI_DEBUG1(_L("CHuiDisplay %x destructor"), this);
+
+    // Unregister this display from foreground gained / lost events.
+//    CCoeEnv* coeEnv = CCoeEnv::Static();
+//    if(coeEnv && NativeWindow())
+//        {
+//        coeEnv->RemoveMessageMonitorObserver(*this);
+//        }
+
+    // Notify observers of deletion.
+    
+   	if(iScreenBufferObserver)
+		{
+		iScreenBufferObserver->HandleScreenBufferEvent(iScreenBufferUid, MHuiScreenBufferObserver::EDeleted);
+		}
+ 
+    for(TInt i = 0; i < iDeletionObservers.Count(); ++i)
+        {
+        iDeletionObservers[i].NotifyDisplayDeletion(*this);
+        }
+    iDeletionObservers.Reset();
+    iRefreshObservers.Reset();
+    iVisibleAreaObservers.Reset();
+    iRosterObservers.Reset();
+
+    iDirtyRegions.Close();
+    iDirtyRegions2.Close();
+    if ( iCurrentDirtyRegions )
+        {
+        iCurrentDirtyRegions->Close();
+        }
+    iCurrentDirtyRegions = NULL;
+    
+    if ( iPreviousDirtyRegions )
+        {
+        iPreviousDirtyRegions->Close();
+        }
+    iPreviousDirtyRegions = NULL;
+
+    delete iRenderSurface;
+    iRenderSurface = NULL;
+
+    delete iGc;
+    iGc = NULL;
+
+    delete iTransform; 
+    iTransform = NULL;
+
+    delete iWindowTransform;
+    iWindowTransform = NULL;
+    
+    iEnv.RemoveDisplay(*this);
+    
+    iNativeControl = NULL;
+    
+    iBackgroundItems.Close();
+    
+    delete iForegroundTexture;
+
+    delete iForegroundBitmapGc;
+    delete iForegroundBitmapDevice;
+    iForegroundBitmap = NULL;
+    }
+
+TReal32 CHuiDisplay::UnitValue() const
+    {
+#ifdef RD_ALF_IN_PLATFORM            
+    // this will be correct according to the currently loaded layout pack for the current display
+    if (CCoeEnv::Static())
+        {
+        return Display_Layout_Metrics::UnitValue();
+        }
+    else
+        {
+        return 1.0f;
+        }
+#else // RD_ALF_IN_PLATFORM            
+    // not supported
+    return 1.0f;
+#endif // RD_ALF_IN_PLATFORM            
+    }
+
+void CHuiDisplay::MonitorWsMessage(const TWsEvent& aEvent)
+    {
+	switch(aEvent.Type())
+	    {
+        case EEventWindowVisibilityChanged:
+            {
+            const TBool wasOnForeground = iOnForeground;
+            
+//            iOnForeground = !(aEvent.VisibilityChanged()->iFlags&TWsVisibilityChangedEvent::ENotVisible);
+            
+            if ( !wasOnForeground && iOnForeground )
+                {
+                // Becomes visible, force refresh. 
+                // This is needed for example in case of resolution changes.
+                SetDirty();
+                }
+            break;
+            }
+            
+      	default:
+        	break;              
+	    }
+    }
+
+
+CHuiGc* CHuiDisplay::Gc()
+    {
+    ASSERT(iGc != NULL);
+    
+    return iGc;
+    }
+    
+EXPORT_C CCoeControl* CHuiDisplay::NativeControl()
+    {
+    return iNativeControl;
+    }
+
+
+EXPORT_C RDrawableWindow* CHuiDisplay::NativeWindow()
+    {
+    if (iNativeWindow)
+        {
+        return iNativeWindow;
+        }
+                
+    else if(iNativeControl)
+        {
+        return iNativeControl->DrawableWindow();
+        }
+        
+    return 0;
+    }
+
+
+EXPORT_C CHuiEnv& CHuiDisplay::Env()
+    {
+    return iEnv;
+    }
+
+
+EXPORT_C MHuiRenderSurface& CHuiDisplay::RenderSurface() const
+    {
+    return *iRenderSurface;
+    }
+
+
+EXPORT_C CHuiRoster& CHuiDisplay::Roster()
+    {
+    return iRoster.Ref();
+    }
+
+
+EXPORT_C const CHuiRoster& CHuiDisplay::Roster() const
+    {
+    return iRoster.Ref();
+    }
+
+
+EXPORT_C void CHuiDisplay::Show(TBool aShow)
+    {
+    iRenderSurface->HandleVisibilityEvent(aShow);
+
+    // Update projection and GC state on the next refresh.
+    iUpdateRenderState = ETrue;
+    }
+
+
+CHuiRosterImpl& CHuiDisplay::RosterImpl() const
+    {
+    return STATIC_CAST(CHuiRosterImpl&, iRoster.NonConstRef());
+    }
+
+
+EXPORT_C void CHuiDisplay::SetSizeL(const TSize& aSize)
+    {
+    iSize = aSize;
+
+    // Update projection and GC state on the next refresh.
+    iUpdateRenderState = ETrue;
+
+    if(iRenderSurface)
+        {
+        iRenderSurface->SetSizeL(iSize);
+        }
+    }
+
+
+EXPORT_C TSize CHuiDisplay::Size() const
+    {
+    return iSize;
+    }
+
+
+EXPORT_C TRect CHuiDisplay::VisibleArea() const
+    {
+    return iGc->DisplayArea();
+    }
+
+
+EXPORT_C void CHuiDisplay::SetVisibleArea(const TRect& aArea)
+    {
+    if(iGc)
+        {
+        // If clipping has been defined for visible are, it is now invalid so disable.
+        SetVisibleAreaClippingRect(TRect(0,0,0,0));
+        
+        iGc->SetDisplayArea(aArea);
+        // Make sure everything gets redrawn.
+        SetDirty();
+        
+  		// Can change the roster rect only if the roster is own
+   		// \todo This should be prevented also for other shared roster types.
+       	RosterImpl().SetRect(aArea);
+
+        // Update projection and GC state on the next refresh.
+        iUpdateRenderState = ETrue;
+
+        // Inform observers.
+        for(TInt i = 0; i < iVisibleAreaObservers.Count(); ++i)
+            {
+            iVisibleAreaObservers[i].NotifyDisplayVisibleAreaChanged(*this);
+            }
+        }
+    }
+
+
+EXPORT_C void CHuiDisplay::Activate(TBool aActivate)
+    {
+    iActive = aActivate;
+
+    if(iActive)
+        {
+        // This is the display now using the roster. Only meaningful when the
+        // roster is shared between many displays.
+        RosterImpl().SetDisplay(this);
+        }
+    }
+
+
+EXPORT_C TBool CHuiDisplay::Active() const
+    {
+    return iActive;
+    }
+
+
+EXPORT_C void CHuiDisplay::SetOrientation(CHuiGc::TOrientation aOrientation)
+    {
+    if (iGc->Orientation() == aOrientation)
+        {
+        return;
+        }
+    
+    iGc->SetOrientation(aOrientation);
+
+    // The effective visible area, as seen by the UI, changes.
+    RosterImpl().SetRect(VisibleArea());
+    for(TInt i = 0; i < iVisibleAreaObservers.Count(); ++i)
+        {
+        iVisibleAreaObservers[i].NotifyDisplayVisibleAreaChanged(*this);
+        }
+
+    SetDirty();
+
+    // Update projection and GC state on the next refresh.
+    iUpdateRenderState = ETrue;
+    
+    // Clear effect engine cache as it most likely now contains buffers which 
+    // sizes are not very well reusable. It would be better to have "fifo" or
+    // something in the cache implementation but until that just release everything here
+    // when display layout changes.
+    CHuiFxEngine* fxEngine = Env().EffectsEngine();  
+    if (fxEngine)
+        {
+        fxEngine->ClearCache();
+        }
+    } 
+
+
+EXPORT_C CHuiGc::TOrientation CHuiDisplay::Orientation() const
+    {
+    return iGc->Orientation();
+    }
+
+
+EXPORT_C void CHuiDisplay::SetDirty()
+    {
+    // Mark the entire display dirty.
+    HUI_DEBUG(_L("CHuiDisplay::SetDirty() - called."));
+   
+    if ( iWholeDisplayAreaIsDirty )
+        {
+        return;
+        }
+   
+    TRect displayArea = iGc->DisplayArea();
+    AddDirtyRegion(displayArea, *iCurrentDirtyRegions);
+    if (iPreviousDirtyRegions)
+    	{
+		AddDirtyRegion(displayArea, *iPreviousDirtyRegions);
+    	}
+    iEnv.ContinueRefresh();
+    
+    iWholeDisplayAreaIsDirty = ETrue;
+    }
+
+
+TBool CHuiDisplay::IsDirty() const
+    {
+    //iRoster->ScanDirty();
+    //return iDirtyRegions.Count() > 0;
+
+    /** @todo  Determine this better. There should be a way to quickly
+               determine if the display needs to be updated; although
+               a visual change scan is also a possiblity if it is done
+               once per frame. */
+
+    return iActive;
+    }
+
+
+void CHuiDisplay::AddDirtyRegion(const TRect& aDirtyRegion)
+    {        
+    // Whole screen has been set dirty, no need to add new areas.
+    if (iWholeDisplayAreaIsDirty && iGotDirtyReports)
+        {
+        return;    
+        }
+
+    TRect clippedDirtyRect = aDirtyRegion;            
+    
+    if (UseTransformedDirtyRegions())
+        {
+        TransformDirtyRect(clippedDirtyRect);
+        }
+    
+    ClipDirtyRect(clippedDirtyRect);
+        
+    // If whole screen is set dirty, update flag which can be used to avoid 
+    // further unnecessary dirty area calculations
+    if (iGc && (iGc->DisplayArea() ==  clippedDirtyRect))
+        {
+        iWholeDisplayAreaIsDirty = ETrue;    
+        }        
+
+    // At least one dirty region was reported.
+    iGotDirtyReports = ETrue;
+
+    AddDirtyRegion(clippedDirtyRect, *iCurrentDirtyRegions);
+    }
+
+
+void CHuiDisplay::CombineAndAddDirtyRegion(const TRect& aPrevDirtyRegion, TRect& aDirtyRegion)
+    {   
+    // aPrevDirtyRegion has already been transformed, but aDirtyRegion is not (yet)
+    // transformed.
+
+    TRect dirtyRect = aDirtyRegion;            
+    
+    if (!dirtyRect.IsEmpty() && UseTransformedDirtyRegions())
+        {
+        TransformDirtyRect(dirtyRect);
+     	}
+
+    TRect transformedNewDirtyRect = dirtyRect;            
+              
+    // If the whole display is not dirty, update current combined dirty region     
+    if (!iWholeDisplayAreaIsDirty)
+    	{
+    	dirtyRect.BoundingRect(aPrevDirtyRegion);	
+    
+    	ClipDirtyRect(dirtyRect);
+    	
+     	if (iGc && (iGc->DisplayArea() ==  dirtyRect))
+        	{
+    		// If whole screen is set dirty, update flag which can be used to avoid 
+    		// further unnecessary dirty area calculations
+        	iWholeDisplayAreaIsDirty = ETrue;    
+        	}        
+
+    	// At least one dirty region was reported.
+    	iGotDirtyReports = ETrue;         	
+   		AddDirtyRegion(dirtyRect, *iCurrentDirtyRegions);
+    	}
+    // We must only transform the (new) dirtyregion, not combine or anything else here
+    aDirtyRegion = transformedNewDirtyRect;
+    }
+
+
+void CHuiDisplay::AddDirtyRegion(const TRect& aDirtyRegion, RDirtyRegions& aRegions, TBool /*aGrow*/)
+    {
+    TBool combined = ETrue;
+    TInt i = 0;
+    TInt k = 0;
+
+    aRegions.Append(aDirtyRegion);
+
+    // Combine overlapping regions.
+    while(combined && aRegions.Count() > 1)
+        {
+        combined = EFalse;
+
+        // Check that none of the regions overlap each other.
+        /** @todo Performance? */
+        for(i = 0; i < aRegions.Count(); ++i)
+            {
+            TRect expanded = aRegions[i];
+            expanded.Grow(20, 20); //(8, 8);
+
+            for(k = i + 1; k < aRegions.Count(); ++k)
+                {
+                // E: comment out for lazy merging
+                if(aRegions[k].Intersects(expanded))
+                    {
+                    // Remove the latter one.
+                    aRegions[i].BoundingRect(aRegions[k]);
+                    aRegions.Remove(k);
+                    --k;
+                    combined = ETrue;
+                    }
+                }
+            }
+        }
+    }
+
+
+TBool CHuiDisplay::Refresh()
+    {
+    HUI_DEBUGF(_L("CHuiDisplay::Refresh() - Entering."));
+    HUI_PROBE_PROGRAMFLOW_ENTER(MHuiProbe::EProgramFlowPointRefresh)
+    
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+    RDebug::Print(_L("CHuiDisplay::Refresh: starting measuring."));
+    TTime startTime;
+    startTime.UniversalTime();
+#endif
+    
+    
+    // Prevent display refresh, if the display is on background.
+    if(!iOnForeground || IsScreenBufferLocked())
+        {
+        return EFalse;
+        }
+    
+    TBool useDirtyRects = (RenderSurface().Flags() & MHuiRenderSurface::EFlagUseDirtyRects) 
+    					  == MHuiRenderSurface::EFlagUseDirtyRects;
+ 	
+    iWholeDisplayAreaIsDirty = EFalse;    
+    
+    if(iUpdateRenderState)
+        {
+        // Set state when requested.
+        iGc->InitState();
+        iGc->SetProjection();
+
+        iUpdateRenderState = EFalse;
+        }
+
+    // Let the skin know that we're now drawing in this context.
+    iEnv.Skin().SetContext(*iGc);
+
+    TRect displayArea = iGc->DisplayArea();
+
+    // Notify observers of the display refresh.
+    TInt i = 0;
+    for(i = 0; i < iRefreshObservers.Count(); ++i)
+        {
+        iRefreshObservers[i].NotifyDisplayRefreshStarted(*this);
+        }
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+    TTime afterNotifiedTime;
+    afterNotifiedTime.UniversalTime();
+#endif
+
+
+	if (IsDisplayTypeTvOut())
+		{
+		// Scale shared roster to Tv-out screen				
+		TReal32 scaleFactorX = (TReal32)Size().iWidth / (TReal32)RosterImpl().Rect().Width();
+		TReal32 scaleFactorY = (TReal32)Size().iHeight / (TReal32)RosterImpl().Rect().Height();					
+		// Calculate window transformations		
+    	iWindowTransform->LoadIdentity();
+    	iWindowTransform->Scale(scaleFactorX, scaleFactorY, 1.f);
+    	}
+
+//	THuiRenderer renderer = iEnv.Renderer();
+	TBool hasTransformations = iTransform->Count() != 0 || iWindowTransform->Count() != 0 || RosterImpl().HasTransformedControlGroups();
+	TBool cantUseDirtyRectsInThisFrame = hasTransformations && !UseTransformedDirtyRegions();
+	    
+    // When refresh is forced, there is no need to scan dirty areas.
+    if (iEnv.RefreshMode() != EHuiRefreshModeForced) 
+        {
+        // Flag that tells us if any dirty regions were reported for
+        // this frame.
+        iGotDirtyReports = (iCurrentDirtyRegions->Count() > 0);
+        
+        // Tell all visuals to post their dirty regions (for the current state).
+        if (UseTransformedDirtyRegions())
+            {
+            RosterImpl().ScanTransformedDirty(*iGc, this);	         	        
+            }
+         else
+            {
+            RosterImpl().ScanDirty();	         	      
+            }   
+
+        if (!useDirtyRects || cantUseDirtyRectsInThisFrame || iEnv.EffectsEngine()->HasActiveEffects()) 
+         	{         	
+	        // Just redraw everything
+	        iCurrentDirtyRegions->Reset();
+	        AddDirtyRegion(displayArea, *iCurrentDirtyRegions, EFalse);
+         	} 
+        }
+    else
+        {
+        iGotDirtyReports = ETrue;
+
+        // Just redraw everything since determining dirty regions is
+        // complicated with a transformed display.
+        iCurrentDirtyRegions->Reset();
+        AddDirtyRegion(displayArea);
+        }
+
+	// We can return now if there are no new or old dirty areas
+	if (!iGotDirtyReports && (!iPreviousDirtyRegions || (iPreviousDirtyRegions->Count() == 0)))
+		{
+		iCurrentDirtyRegions->Reset();
+		return EFalse;
+		}
+
+    // Form the real list of dirty regions by combining the dirty regions of
+    // this frame and the previous frame (this is needed when buffer swapping
+    // is used; with buffer copying a single list of dirty regions would
+    // suffice).
+    RDirtyRegions dirty;
+    for(i = 0; i < iCurrentDirtyRegions->Count(); ++i)
+        {
+        dirty.Append((*iCurrentDirtyRegions)[i]);
+        }
+    if (iPreviousDirtyRegions)
+    	{
+    	for(i = 0; i < iPreviousDirtyRegions->Count(); ++i)
+        	{
+        	AddDirtyRegion((*iPreviousDirtyRegions)[i], dirty, EFalse);
+        	}
+    	}
+
+	// Do initializations for new frame
+	// initnewframe may clear the screen, and it may be that
+	// the clipping rectangle is not set up correctly
+	// atleast if the dirty area tracking is on..
+	iGc->SetPenColor(iBackgroundColor);
+	iGc->InitNewFrame();
+
+    if ( iDrawDirtyRegions )
+        {
+        // Show dirty. 
+        // This will draw the whole background with black.
+        iGc->SetPenColor(KRgbBlack);
+        iGc->Disable(CHuiGc::EFeatureClipping);
+        iGc->Clear();
+        }
+
+		
+    // Set up clipping.
+    TInt markedClipStackCount = iGc->ClipStackCount();
+    if(useDirtyRects)
+    	{
+	    iGc->Enable(CHuiGc::EFeatureClipping);
+    	}
+
+	// Assume that we succeed to clean the dirty regions
+    TBool dirtyRegionsCleaned = ETrue;
+
+	// Set dirty rect in render surface to minimize screen update
+	// Only implemented for BitGdi renderer for now
+    TRect mergedDirtyRect;
+    if (dirty.Count() > 0)
+    	{
+    	mergedDirtyRect = dirty[0];
+    	}
+    	
+	if (useDirtyRects)
+	    {
+		// When Bitgdi renderer used set dirty rect in render surface
+		// to minimize screen update in CHuiBitgdiRenderSurface::SwapBuffers
+	    if (dirty.Count() == 1)
+		    {
+            ClipDirtyRect(mergedDirtyRect, VisibleAreaClippingRect());
+            iRenderSurface->SetDirtyRect(mergedDirtyRect);
+		    }
+		else if (dirty.Count() > 1) 
+		    {
+			for(i = 1; i < dirty.Count(); ++i)
+				{
+				TRect r(dirty[i]);
+				// check top left corner to expand or not
+				if (r.iTl.iX < mergedDirtyRect.iTl.iX)
+				    {
+				    mergedDirtyRect.iTl.iX = r.iTl.iX;
+				    }
+				if (r.iTl.iY < mergedDirtyRect.iTl.iY)
+				    {
+				    mergedDirtyRect.iTl.iY = r.iTl.iY;
+				    }
+				// check bottom right corner to expand or not
+				if (mergedDirtyRect.iBr.iX < r.iBr.iX)
+				    {
+				    mergedDirtyRect.iBr.iX = r.iBr.iX;
+				    }
+				if (mergedDirtyRect.iBr.iY < r.iBr.iY)
+				    {
+				    mergedDirtyRect.iBr.iY = r.iBr.iY;
+				    }
+				}
+				
+            ClipDirtyRect(mergedDirtyRect, VisibleAreaClippingRect());
+            iRenderSurface->SetDirtyRect(mergedDirtyRect);
+		    }
+        else
+            {
+            // for PC lint
+            }
+            
+        if ( iDrawDirtyRegions )
+	        {
+            // This will disable the clipping of the frame buffer when 
+            // blitting on the screen.
+	        iRenderSurface->SetDirtyRect(displayArea);
+            }
+	    }	   
+
+	// Merge into max one dirty area when HW accelrated drawing is used
+	if (useDirtyRects && IsRendererHWAccelerated())
+	    {
+	    dirty.Reset();
+	    dirty.Append(mergedDirtyRect);
+	    }
+	
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+    RDebug::Print(_L("CHuiDisplay::Refresh: Merged dirty rect: %d %d %d %d"), 
+            mergedDirtyRect.iTl.iX,  
+            mergedDirtyRect.iTl.iY,  
+            mergedDirtyRect.iBr.iX,  
+            mergedDirtyRect.iBr.iY);  
+#endif	
+	
+    // Usually there is only one dirty region (if any).
+    for(i = 0; i < dirty.Count(); ++i)
+        {
+        // Set up the clipping rectangle.
+        TRect dirtyRect = dirty[i];
+        ClipDirtyRect(dirtyRect, VisibleAreaClippingRect());
+        
+        iGc->PushClip();
+        iGc->Clip(dirtyRect);        
+        
+        if ( iForegroundBitmapGc )
+            {
+            // If we are in SW rendering mode, then SW bitmap is blended.
+            // However, it's possible that nothing is drawn below, so clear
+            // background.
+            const TRgb oldBgColor = iBackgroundColor;
+            iBackgroundColor = KRgbBlack;
+            iBackgroundColor.SetAlpha(0);
+            ClearWithColor( dirtyRect );
+            iBackgroundColor = oldBgColor;
+            }
+                
+        // Clear background for the dirty area
+        if (iBackgroundItems.Count() != 0)
+            {
+            ClearWithBackgroundItems(dirtyRect);    
+            }
+        else
+            {
+            switch (iClearBackground)
+                {
+                case EClearWithColor:
+                    {
+                    ClearWithColor(dirtyRect);                            
+                    break;    
+                    }
+                case EClearWithSkinBackground:
+                    {
+                    ClearWithSkinBackground(dirtyRect);                                                    
+                    break;    
+                    }
+                case EClearNone:
+                default:
+                    {
+                    // Don't do anything
+                    break;    
+                    }                                                
+                }                                    
+            }                                        
+        
+        if ( iForegroundBitmapGc )
+            {
+            iForegroundBitmapGc->Reset();
+            iForegroundBitmapGc->SetClippingRegion( iGc->ClipRegion() );
+
+            TRgb clearColor = KRgbBlack;
+            clearColor.SetAlpha(0x00);
+                    
+	        iForegroundBitmapGc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
+            iForegroundBitmapGc->SetPenColor(clearColor);
+            iForegroundBitmapGc->SetBrushColor(clearColor);
+            iForegroundBitmapGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
+  	        iForegroundBitmapGc->Clear();
+  	        iForegroundBitmapGc->Reset();
+            }
+        		
+        for(TInt i = 0; i < iRosterObservers.Count(); i++)
+            {
+            iRosterObservers[i].NotifyRosterDrawStart(*this);
+            }
+        
+		// Prepare dirty visuals for drawing
+		// Draw only if the prepare was successful
+		if (RosterImpl().PrepareDraw())
+			{
+	        // Draw all the dirty visuals (that are touching dirty regions).
+	        iGc->Enable(CHuiGc::EFeatureBlending);
+            RosterImpl().Draw(*iGc, this);                    
+			}
+		else 
+			{
+		    HUI_DEBUGF(_L("CHuiDisplay::Refresh() - Failed to prepare drawing!"));
+	        dirtyRegionsCleaned = EFalse;			
+			}
+
+        for(TInt i = 0; i < iRosterObservers.Count(); i++)
+            {
+            iRosterObservers[i].NotifyRosterDrawEnd(*this);
+            }
+		
+		if (iForegroundTexture)
+		    {
+		    DrawForegroundTexture();
+		    }
+		
+        // Return to the clipping rectangle that was in use previously.
+        iGc->PopClip();
+        }
+
+    dirty.Reset();
+
+    // There must be no disparity in the number of pushed clipping rectangles.
+    // (equivalent to __ASSERT_ALWAYS)
+    if(iGc->ClipStackCount() > markedClipStackCount)
+        {
+        THuiPanic::Panic(THuiPanic::EDisplayClipStackUnpopped);
+        }
+    if(iGc->ClipStackCount() < markedClipStackCount)
+        {
+        THuiPanic::Panic(THuiPanic::EDisplayClipStackEarlyPop);
+        }
+
+    // Reset and flip if we managed to clean (draw) everything
+	if (iPreviousDirtyRegions && dirtyRegionsCleaned && iCurrentDirtyRegions->Count() > 0) 
+		{
+    	RDirtyRegions* tmp = iPreviousDirtyRegions;
+    	iPreviousDirtyRegions = iCurrentDirtyRegions;
+    	iCurrentDirtyRegions = tmp;
+		}
+		
+	// Clear current dirty regions	
+	iCurrentDirtyRegions->Reset();
+	
+	// Trick to swap gles buffers if we are drawing idle screens before refresh loop is going to
+	// sleep. 
+	if(	IsRendererHWAccelerated() && !iGotDirtyReports && !iScreenBufferObserver) 
+    		{
+	    	//RenderSurface().SwapBuffers(); [ohi]
+	    	}
+	    	
+	// Tell the screen buffer observer that the buffer is complete 
+	if(iScreenBufferObserver)
+		{
+		SetScreenBufferLock(ETrue); // the observer should do unlock!
+		
+		TRect rect(VisibleArea()); // This is not the real display rect in ALF display case(!)
+		TRect dirtyRect(mergedDirtyRect);
+		
+		// Update screen buffer GC bitmap
+		if (DisplayType() != CHuiDisplay::EDisplayOffScreenBuffer)
+			{
+			TRAP_IGNORE(CHuiStatic::Renderer().UpdateOffScreenBitmapL(*this));			
+			}
+						
+		if (iScreenBufferObserver->ScreenBufferComplete(iScreenBufferUid, rect, dirtyRect))
+			{
+			SetScreenBufferLock(EFalse);
+			}
+		}
+
+    iWholeDisplayAreaIsDirty = EFalse;    
+	
+    HUI_PROBE_PROGRAMFLOW_EXIT(MHuiProbe::EProgramFlowPointRefresh)
+    HUI_DEBUGF(_L("CHuiDisplay::Refresh() - Exiting."));
+
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+    TTime endTime;
+    endTime.UniversalTime();
+    TInt timeInMs =  endTime.MicroSecondsFrom( startTime ).Int64()/1000;           
+    TInt notifyTimeInMs =  afterNotifiedTime.MicroSecondsFrom( startTime ).Int64()/1000;           
+    TInt restTimeInMs =  endTime.MicroSecondsFrom( afterNotifiedTime ).Int64()/1000;           
+
+    RDebug::Print(_L("CHuiDisplay::Refresh: took %i ms"), timeInMs);
+    RDebug::Print(_L("CHuiDisplay::Refresh: notify refresh observers took %i ms"), notifyTimeInMs);
+    RDebug::Print(_L("CHuiDisplay::Refresh: rest took %i ms"), restTimeInMs);
+
+#endif
+
+
+    // If something was reported (even if eventually clipped), we'll say that
+    // there was some activity. If it was clipped and did not show up on the
+    // display, it may soon (re)appear, so let's be cautious.
+    return iGotDirtyReports;
+    }
+
+
+EXPORT_C CHuiTransformation& CHuiDisplay::Transformation() const
+    {
+    return *iTransform;
+    }
+
+
+EXPORT_C void CHuiDisplay::SetClearBackgroundL(TClearMode aClearBackground)
+    {
+    // Make sure that background resource allocation is succeeded.
+    if(aClearBackground == EClearWithSkinBackground)
+        {
+        iEnv.Skin().TextureL(EHuiSkinBackgroundTexture);
+        }
+
+    iClearBackground = aClearBackground;
+    iBackgroundItems.Reset();
+    }
+
+
+EXPORT_C void CHuiDisplay::SetBackgroundColor(const TRgb& aBackgroundColor)
+    {
+    iBackgroundColor = aBackgroundColor;
+    }
+
+
+EXPORT_C void CHuiDisplay::SetUseDepth(TBool aUseDepth)
+    {
+    iUseDepth = aUseDepth;
+    }
+
+
+EXPORT_C TUint8* CHuiDisplay::CaptureLC(TSize& aSize) const
+    {
+    return iGc->CaptureLC(aSize);
+    }
+
+
+EXPORT_C void CHuiDisplay::SetQuality(THuiQuality aRenderingQuality)
+    {
+    if(iGc)
+        {
+        iGc->SetQuality(aRenderingQuality);
+        SetDirty();
+        }
+    }
+
+
+EXPORT_C THuiQuality CHuiDisplay::Quality() const
+    {
+    if(iGc)
+        {
+        return iGc->Quality();
+        }
+    return EHuiQualityAccurate;
+    }
+
+
+EXPORT_C void CHuiDisplay::Release()
+    {      
+    // Free the render surface.
+    ASSERT(iRenderSurface != NULL);
+    HUI_DEBUG(_L("CHuiDisplay::Release() - Releasing render surface."));    
+    iRenderSurface->Release();
+        
+    HUI_DEBUG(_L("CHuiDisplay::Release() - Display released."));            
+    }
+
+
+EXPORT_C void CHuiDisplay::RestoreL()
+    {
+    HUI_DEBUG(_L("CHuiDisplay::RestoreL() - Restoring display resources."));    
+    
+    // Reconfigure graphics context when display is refreshed.
+    iUpdateRenderState = ETrue;
+    
+    // Create a rendering surface.
+    iRenderSurface->RestoreL();
+    }
+
+
+EXPORT_C TInt CHuiDisplay::DisplayType()
+	{
+	return iDisplayType;
+	}
+	
+EXPORT_C TUid CHuiDisplay::ScreenBufferUid()
+	{
+	return iScreenBufferUid;
+	}
+	
+
+EXPORT_C TBool CHuiDisplay::IsScreenBufferLocked() const
+	{
+	return iIsScreenBufferLocked;
+	}
+    
+    
+EXPORT_C void CHuiDisplay::SetScreenBufferLock(TBool aLock)
+	{
+	iIsScreenBufferLocked = aLock;
+	}
+
+
+EXPORT_C MHuiBufferDrawer* CHuiDisplay::GetDrawingInterface(const TUid& /*aInterfaceUid*/)
+	{
+	return (MHuiBufferDrawer*)NULL;
+	}
+	
+	
+EXPORT_C MHuiGc* CHuiDisplay::GetGraphicsContext(const TUid& aInterfaceUid)
+	{
+	MHuiGc* gc = NULL;
+	if (aInterfaceUid == KHuiInternalFbsBitmapBufferGcUid)
+		{
+    	if (iEnv.Renderer() == EHuiRendererBitgdi) 
+			{
+			CFbsBitmap* backBuffer = iRenderSurface->BackBuffer()->FbsBitmap();
+			CHuiFbsBitmapBufferGc* bitmapGc = new CHuiFbsBitmapBufferGc(backBuffer);
+			gc =  (MHuiFbsBitmapBufferGc*) bitmapGc;
+			}
+        else
+            {
+            if ( DisplayType() != CHuiDisplay::EDisplayOffScreenBuffer )
+			    {
+			    gc =(MHuiFbsBitmapBufferGc*) new CHuiFbsBitmapBufferGc(
+			        CHuiStatic::Renderer().OffScreenBitmap());
+			    }
+            }
+		}
+	return gc;     	
+	}	
+	
+EXPORT_C void CHuiDisplay::AddScreenBufferObserverL(MHuiScreenBufferObserver* aObserver)
+	{
+	if (DisplayType() != CHuiDisplay::EDisplayOffScreenBuffer)
+		{
+		CHuiStatic::Renderer().EnableOffScreenBitmapL(0);
+		}
+								
+	iScreenBufferObserver = aObserver;
+	SetScreenBufferLock(EFalse); 
+	}
+	
+	
+EXPORT_C void CHuiDisplay::RemoveScreenBufferObserver()
+	{
+	iScreenBufferObserver = NULL;	
+	
+	if (DisplayType() != CHuiDisplay::EDisplayOffScreenBuffer)
+		{
+		CHuiStatic::Renderer().DisableOffScreenBitmap();
+		}
+	
+	SetScreenBufferLock(EFalse); 
+	}
+     
+     
+EXPORT_C MHuiScreenBufferObserver*  CHuiDisplay::ScreenBufferObserver()
+	{
+	return iScreenBufferObserver;
+	}
+	
+
+EXPORT_C void CHuiDisplay::DrawScreenBuffer() 
+	{
+	if (DisplayType() != CHuiDisplay::EDisplayOffScreenBuffer)
+		{
+		TRAP_IGNORE(CHuiStatic::Renderer().DrawOffScreenBitmapToWindowL(*this));			
+		}					
+	}
+
+
+void CHuiDisplay::ClearChanged()
+    {
+    RosterImpl().ClearChanged();
+    }
+        
+EXPORT_C void CHuiDisplay::SetUsageL(TUint aUsageHint)
+    {
+    iUsageHint = aUsageHint;    
+    if (iRenderSurface)
+        {
+        iRenderSurface->HandleDisplayUsageChangeL();    
+        }
+    }
+
+EXPORT_C TUint CHuiDisplay::Usage() const
+    {
+    return iUsageHint;     
+    }
+  
+    
+EXPORT_C TInt CHuiDisplay::GetPreferredTextureFormats(RPointerArray<CHuiDisplay::CTextureBitmapFormat>& aTextureFormats)
+	{
+    // Note: It would be better if preferred display mode was asked from the renderer itself
+	TInt err = KErrNone;
+	CHuiDisplay::CTextureBitmapFormat* format = NULL;
+    if (!IsRendererHWAccelerated())
+        {
+        format = new CHuiDisplay::CTextureBitmapFormat(EColor64K, EGray256);
+        if (format != NULL)
+        	{
+        	err = aTextureFormats.Append(format);
+        	}
+        }
+    else
+        {
+        format = new CHuiDisplay::CTextureBitmapFormat(EColor16MA, ENone);
+        if (format != NULL)
+        	{
+        	err = aTextureFormats.Append(format);
+        	if (!err)
+        		{
+        		format = new CHuiDisplay::CTextureBitmapFormat(EColor64K, EGray256);
+        		if (format != NULL)
+        			{
+        			err = aTextureFormats.Append(format);
+        			}
+        		}
+        	}
+        }
+        			
+	if (err)
+    	{
+        delete(format);
+        }
+        
+    return (format == NULL) ? KErrNoMemory : err;	   
+	}
+  
+    
+CHuiTransformation& CHuiDisplay::WindowTransformation() const
+    {
+    return *iWindowTransform;        
+    }
+
+EXPORT_C TBool CHuiDisplay::IsDisplayTypeTvOut() const
+   	{
+   	return((iDisplayType == CHuiDisplay::EDisplayTvOut) || 
+   	       (iDisplayType == CHuiDisplay::EDisplayTvOutWide) ||
+   	       ((iDisplayType == CHuiDisplay::EDisplayNormal) && 
+   	       ((iScreenBufferUid == KHuiUidBackBufferTvOutNormal) ||
+   	        (iScreenBufferUid == KHuiUidBackBufferTvOutWide))));
+   	}
+
+TBool CHuiDisplay::IsRendererBitgdi() const
+    {
+    return (iEnv.Renderer() == EHuiRendererBitgdi);        
+    }
+
+TBool CHuiDisplay::IsRendererHWAccelerated() const
+    {
+    return (iEnv.Renderer() != EHuiRendererBitgdi);
+    }
+
+void CHuiDisplay::ClipDirtyRect(TRect& aRect)
+    {
+    // Check if dirty regions partially outside display are reported, limit
+    // inside display area. 
+    if(iGc)
+        {            
+        TRect displayRect = iGc->DisplayArea();        
+        // If partially outside display area, we use intersection instead.
+        if (aRect.Intersects(displayRect))
+            {
+            aRect.Intersection(displayRect);  
+            }        
+        }        
+    }
+
+void CHuiDisplay::TransformDirtyRect(TRect& aRect)
+    {
+    if ( iGc )
+        {
+        THuiRealRect realDirtyRect(aRect);
+        iGc->TransformDirtyRect(realDirtyRect);
+        aRect = TRect(HUI_ROUND_FLOAT_TO_INT(realDirtyRect.iTl.iX), HUI_ROUND_FLOAT_TO_INT(realDirtyRect.iTl.iY),
+                      HUI_ROUND_FLOAT_TO_INT(realDirtyRect.iBr.iX), HUI_ROUND_FLOAT_TO_INT(realDirtyRect.iBr.iY));
+        }
+    }
+    
+TBool CHuiDisplay::UseTransformedDirtyRegions() const
+    {
+    return iUseTransformedDirtyRegions;    
+    }
+    
+EXPORT_C void CHuiDisplay::ShowDirtyRegions( TBool aShow )
+    {
+    iDrawDirtyRegions = aShow;
+    }
+
+EXPORT_C void CHuiDisplay::SetDrawVisualOutline( TUint aDrawVisualOutline )
+	{
+	iDrawVisualOutline = aDrawVisualOutline;
+	}
+	 
+TUint CHuiDisplay::DrawVisualOutline() const
+	{
+	return iDrawVisualOutline;
+	}
+
+TBool CHuiDisplay::IsDirtyScanNeeded() const
+    {
+    TUint flag = MHuiRenderSurface::EFlagUseDirtyRects;
+	TBool useDirtyRects = (RenderSurface().Flags() & flag) == flag;
+	return (useDirtyRects || !iGotDirtyReports);
+    }
+    
+EXPORT_C void CHuiDisplay::SetBackgroundItemsL(const RArray<THuiDisplayBackgroundItem>& aItems)
+    {
+    iClearBackground = EClearNone;
+    iBackgroundItems.Reset();
+    for(TInt i = 0; i < aItems.Count(); ++i)
+        {
+        iBackgroundItems.AppendL(aItems[i]);
+        }
+    if (IsRendererHWAccelerated())
+        {
+        CHuiS60Skin* s60skin = static_cast<CHuiS60Skin*>(&iEnv.Skin());
+        s60skin->UpdateBackgroundsL(iBackgroundItems);
+        }
+    SetDirty();    
+    }
+
+void CHuiDisplay::ClearWithColor(TRect aRect)
+    {
+    if (!IsRendererHWAccelerated())
+        {
+        BitgdiClearWithColor(aRect);    
+        }
+    else
+        {
+        HWAcceleratedClearWithColor(aRect);    
+        }
+    }
+
+void CHuiDisplay::ClearWithSkinBackground(TRect aRect)
+    {    
+    if (!IsRendererHWAccelerated())
+        {
+        BitgdiClearWithSkinBackground(aRect);    
+        }
+    else
+        {
+        HWAcceleratedClearWithSkinBackground(aRect);    
+        }
+    }
+
+void CHuiDisplay::ClearWithBackgroundItems(TRect aRect)
+    {
+    if (!IsRendererHWAccelerated())
+        {
+        BitgdiClearWithBackgroundItems(aRect);    
+        }
+    else
+        {
+        HWAcceleratedClearWithBackgroundItems(aRect);    
+        }
+    }
+
+    
+void CHuiDisplay::BitgdiClearWithColor(TRect /*aRect*/) 
+    {
+    iGc->Enable(CHuiGc::EFeatureClipping);
+    iGc->Clear();        
+    }
+     
+void CHuiDisplay::BitgdiClearWithSkinBackground(TRect aRect) 
+    {
+	CCoeControl* nativeControl = NativeControl();
+   	CHuiS60Skin* s60skin = static_cast<CHuiS60Skin*>(&iEnv.Skin());
+    CAknsBasicBackgroundControlContext* bgcontext = (CAknsBasicBackgroundControlContext*)s60skin->SkinControlContext();
+
+    CFbsBitGc* bitGc = iRenderSurface->BackBuffer()->Gc();
+	if (nativeControl)
+		{
+		bgcontext->SetRect(TRect(TPoint(0, -nativeControl->Position().iY), HuiUtil::ScreenSize()));
+		}
+	else
+		{
+		bgcontext->SetRect(TRect(TPoint(0, 0), HuiUtil::ScreenSize()));
+		}
+
+    // Draw the background onto the framebuffer
+	MAknsSkinInstance* skin = CHuiStatic::SkinInstance();
+	TPoint tl = aRect.iTl;
+	TRect rect = aRect;
+    bgcontext->SetBitmap(KAknsIIDQsnBgScreen);       
+
+    AknsDrawUtils::DrawBackground(skin, bgcontext, NULL, 
+    								*bitGc, tl, rect, 
+                                  	KAknsDrawParamDefault);
+    }
+
+void CHuiDisplay::BitgdiClearWithBackgroundItems(TRect aRect)
+    {
+   	CHuiS60Skin* s60skin = static_cast<CHuiS60Skin*>(&iEnv.Skin());
+    CAknsBasicBackgroundControlContext* bgcontext = (CAknsBasicBackgroundControlContext*)s60skin->SkinControlContext();
+
+    CFbsBitGc* bitGc = iRenderSurface->BackBuffer()->Gc();
+    THuiDisplayBackgroundItem item;    
+    MAknsSkinInstance* skin = CHuiStatic::SkinInstance();
+
+    for (TInt index = 0; index < iBackgroundItems.Count(); index++)
+        {
+        TRect clearRect = aRect;
+        TRect skinRect = TRect(0,0,0,0);
+        TRect dummy = TRect(0,0,0,0);
+
+        item = iBackgroundItems[index];
+        switch (item.ClearMode())
+            {
+            case EClearWithSkinBackground:
+                if (skin)
+                    {
+                    GetRectForItem(item.SkinBackground(), dummy, skinRect);
+                    bgcontext->SetRect(skinRect);
+                    bgcontext->SetBitmap(item.SkinBackground());       
+                    skinRect.Intersection(aRect);
+                    skinRect.Intersection(item.Rect());
+  		            AknsDrawUtils::DrawBackground(skin, bgcontext, NULL, 
+							*bitGc, skinRect.iTl, skinRect, 
+                          	KAknsDrawParamDefault);
+                    break;
+                    } // else fall through
+            case EClearWithColor:
+                clearRect.Intersection(item.Rect());
+                if (!clearRect.IsEmpty())
+                    {
+                    bitGc->SetBrushColor(item.Color());
+                    bitGc->Clear(clearRect);                                    
+                    }
+                break;
+            case EClearNone:
+            default: 
+                // do nothing...
+                break;
+            }
+        }
+        
+    }
+    
+void CHuiDisplay::HWAcceleratedClearWithColor(TRect /*aRect*/)
+    {
+    iGc->SetPenColor(iBackgroundColor);
+    iGc->SetPenAlpha(iBackgroundColor.Alpha());
+    iGc->Disable(CHuiGc::EFeatureBlending);
+    iGc->Enable(CHuiGc::EFeatureClipping);
+    iGc->Clear();
+    }
+
+void CHuiDisplay::HWAcceleratedClearWithSkinBackground(TRect /*aRect*/)
+    {
+    // Acquire background texture
+    const CHuiTexture* backgroundTexture = NULL;
+    TInt err = iEnv.Skin().GetTexture(EHuiSkinBackgroundTexture, backgroundTexture);
+    ASSERT(backgroundTexture!=NULL);
+    __ASSERT_ALWAYS(err == KErrNone, USER_INVARIANT());
+
+    // Apply background texture
+    THuiImage background(*backgroundTexture);
+
+    TPoint screenOrigin(0, 0);
+    iRenderSurface->GetScreenOrigin(screenOrigin);
+    // The origin is used to offset the background in the display's
+    // rendering surface, so that the background's origin is in the
+    // top left screen corner.
+    screenOrigin.iX = -screenOrigin.iX;
+    screenOrigin.iY = -screenOrigin.iY;
+
+    iGc->SetPenColor(KRgbWhite);
+    iGc->SetPenAlpha(255);
+    iGc->SetAlign(EHuiAlignHLeft, EHuiAlignVTop);            
+    iGc->Disable(CHuiGc::EFeatureBlending);
+    iGc->Enable(CHuiGc::EFeatureClipping);            
+    iGc->DrawImage(background, screenOrigin, background.Texture().Size());        
+    }
+
+void CHuiDisplay::HWAcceleratedClearWithBackgroundItems(TRect aRect)
+    {
+    THuiDisplayBackgroundItem item;
+	CHuiS60Skin* s60skin = static_cast<CHuiS60Skin*>(&iEnv.Skin());
+    CHuiTexture* backgroundTexture = NULL;
+    for (TInt index = 0; index < iBackgroundItems.Count(); index++)
+        {
+        item = iBackgroundItems[index];
+        switch (item.ClearMode())
+            {
+            case EClearNone:
+                // do nothing...
+                break;
+            case EClearWithColor:
+                // do not draw anything if background item rect does not intersect with dirty/ current clip rect
+                if( item.Rect().Intersects(aRect)) 
+                    {
+                    iGc->SetPenColor(item.Color());
+                    iGc->SetPenAlpha(255);
+                    iGc->SetAlign(EHuiAlignHLeft, EHuiAlignVTop);            
+                    iGc->Disable(CHuiGc::EFeatureBlending);
+                    iGc->Enable(CHuiGc::EFeatureClipping);            
+                    iGc->PushClip();
+                    TRect temp = item.Rect();
+                    temp.Intersection(aRect);
+                    iGc->Clip(temp);
+                    iGc->Clear();
+                    iGc->PopClip();
+                    }
+                break;
+            case EClearWithSkinBackground:
+                 TRect skinRect;
+                 TRect dummy;
+                 GetRectForItem(item.SkinBackground(), dummy, skinRect);
+                 backgroundTexture = s60skin->BackgroundTexture(item.SkinBackground());
+                 if (backgroundTexture)
+                    {
+                    THuiImage background(*backgroundTexture);
+
+                    TPoint screenOrigin(0, 0);
+                    iRenderSurface->GetScreenOrigin(screenOrigin);
+                    screenOrigin.iX = -screenOrigin.iX;
+                    screenOrigin.iY = -screenOrigin.iY;
+                    screenOrigin+=skinRect.iTl;
+                    
+                    // do not draw anything if background item rects does not intersect with dirty/ current clip rect
+                    skinRect.Intersection(item.Rect());
+                    if( skinRect.Intersects(aRect) )
+                        {
+                        iGc->SetPenColor(KRgbWhite);
+                        iGc->SetPenAlpha(255);
+                        iGc->SetAlign(EHuiAlignHLeft, EHuiAlignVTop);            
+                        iGc->Disable(CHuiGc::EFeatureBlending);
+                        iGc->Enable(CHuiGc::EFeatureClipping);            
+                        iGc->PushClip();
+                        skinRect.Intersection(aRect);
+                        iGc->Clip(skinRect);
+                        iGc->DrawImage(background, screenOrigin, background.Texture().Size());                     
+                        iGc->PopClip();
+                        }
+                    }
+                 break;                                                    
+             }
+        }             
+    }
+    
+EXPORT_C void CHuiDisplay::SetVisibleAreaClippingRect(const TRect& 
+        #ifndef SYMBIAN_BUILD_GCE  
+        aVisibleAreaClippingRect 
+        #endif  
+        )
+    {
+// Visible area clipping is disabled in NGA    
+#ifndef SYMBIAN_BUILD_GCE    
+    iVisibleAreaClippingRect = aVisibleAreaClippingRect;   
+#endif
+    } 
+    
+TRect CHuiDisplay::VisibleAreaClippingRect() const
+    {
+// Visible area clipping is disabled in NGA    
+#ifndef SYMBIAN_BUILD_GCE    
+    if (IsVisibleAreaClippingEnabled())
+        {
+        return iVisibleAreaClippingRect;             
+        }
+    else
+        { 
+        return VisibleArea();             
+        }        
+#else
+    return VisibleArea();                 
+#endif    
+    }
+    
+TBool CHuiDisplay::IsVisibleAreaClippingEnabled() const
+    {
+// Visible area clipping is disabled in NGA    
+#ifndef SYMBIAN_BUILD_GCE    
+    return iVisibleAreaClippingRect != TRect(0,0,0,0);            
+#else
+    return EFalse;
+#endif
+    }
+
+void CHuiDisplay::ClipDirtyRect(TRect& aRect, TRect aClippingRect)
+    {
+    if (aRect.Intersects(aClippingRect))
+        {
+        aRect.Intersection(aClippingRect);  
+        }                
+    }
+    
+EXPORT_C void CHuiDisplay::SetForegroundTexture(CHuiTexture* aTexture)
+    {
+    if (iForegroundTexture != aTexture)
+        {
+        delete iForegroundTexture;
+        iForegroundTexture = aTexture;
+        SetDirty();
+        }
+    }
+
+EXPORT_C CHuiTexture* CHuiDisplay::ForegroundTexture() const
+    {
+    return iForegroundTexture;
+    }
+
+
+void CHuiDisplay::DrawForegroundTexture()
+    {
+    if (iForegroundTexture)
+        {
+        // The following is similar to HWAcceleratedClearWithSkinBackground,
+        // except blending is enabled.
+        
+        TPoint screenOrigin(0, 0);
+        iRenderSurface->GetScreenOrigin(screenOrigin);
+        screenOrigin.iX = -screenOrigin.iX;
+        screenOrigin.iY = -screenOrigin.iY;
+
+        THuiImage image = THuiImage(*iForegroundTexture);
+        iGc->SetPenColor(KRgbWhite);
+        iGc->SetPenAlpha(255);
+        iGc->SetAlign(EHuiAlignHLeft, EHuiAlignVTop);            
+        iGc->Enable(CHuiGc::EFeatureBlending);
+        iGc->Enable(CHuiGc::EFeatureClipping);            
+        iGc->DrawImage(image, screenOrigin, image.Texture().Size());        
+        }
+    }
+    
+EXPORT_C void CHuiDisplay::SetForegroundBitmapL(CFbsBitmap* aBitmap)
+    {
+    // Note this method may be called with same bitmap, e.g.
+    // when emulator display orientation is changed. Then we recreate
+    // device & context in order to avoid panics.
+    
+    if ( !aBitmap )
+        {
+        delete iForegroundBitmapGc;
+        iForegroundBitmapGc = NULL;
+        delete iForegroundBitmapDevice;
+        iForegroundBitmapDevice = NULL;
+        iForegroundBitmap = NULL;
+        }
+    else
+        {
+        CFbsBitmapDevice* device = CFbsBitmapDevice::NewL( aBitmap );
+        CleanupStack::PushL( device );
+        
+        CFbsBitGc* gc = NULL;
+        User::LeaveIfError( device->CreateContext( gc ) );
+        User::LeaveIfNull( gc );
+        
+        CleanupStack::Pop( device );
+        
+        iForegroundBitmap = aBitmap;
+        delete iForegroundBitmapDevice;
+        iForegroundBitmapDevice = device;
+        delete iForegroundBitmapGc;
+        iForegroundBitmapGc = gc;
+        }
+    }
+    
+EXPORT_C CFbsBitmap* CHuiDisplay::ForegroundBitmap() const
+    {
+    return iForegroundBitmap;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiDisplayCoeControl.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,250 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of the CHuiDisplayCoeControl class. 
+*                CHuiDisplayCoeControl is a CCoeControl that has its own 
+*                CHuiDisplay instance attached to the control's RWindow.
+*
+*/
+
+
+
+#include "uiacceltk/HuiDisplayCoeControl.h"  // Class definition
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiDisplay.h"
+#include "uiacceltk/HuiEvent.h"
+
+
+EXPORT_C CHuiDisplayCoeControl* 
+CHuiDisplayCoeControl::NewL(CHuiEnv& aEnv, const TRect& aRect, TInt aFlags)
+    {
+    CHuiDisplayCoeControl* self = CHuiDisplayCoeControl::NewLC(aEnv, aRect, aFlags);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+EXPORT_C CHuiDisplayCoeControl* 
+CHuiDisplayCoeControl::NewLC(CHuiEnv& aEnv, const TRect& aRect, TInt aFlags)
+    {
+    CHuiDisplayCoeControl* self = new (ELeave) CHuiDisplayCoeControl(aEnv);
+    CleanupStack::PushL(self);
+    self->ConstructL(aRect, aFlags);
+    return self;
+    }
+
+
+EXPORT_C CHuiDisplayCoeControl::CHuiDisplayCoeControl(CHuiEnv& aEnv)
+        : iEnv(aEnv)
+    {
+    }
+
+
+EXPORT_C void CHuiDisplayCoeControl::ConstructL(const TRect& aRect, TInt aFlags)
+    {
+    // The display has its own window.
+    CreateWindowL();
+#ifndef SYMBIAN_BUILD_GCE
+    Window().EnableOSB(EFalse);
+#endif
+    // Set the size of the control.
+    SetRect(aRect);
+
+    if(aFlags & CHuiEnv::ENewDisplayFullScreen)
+        {
+        SetExtentToWholeScreen();
+        }
+
+    // Create a new CHuiDisplay for our window. We don't get ownership of 
+    // the display instance.
+    iDisplay = &iEnv.NewDisplayL(Rect(), this, aFlags);
+
+    // Since display creation went ok, we know that this rectangle size can be handled.
+    iPrevRect = aRect;
+
+    // The control is now ready to be drawn.
+    ActivateL();
+    
+    EnableDragEvents();
+    }
+
+
+EXPORT_C CHuiDisplayCoeControl::~CHuiDisplayCoeControl()
+    {	    	
+    // if the environment has been destroyed, the display is
+    // already been deleted
+    if (CHuiEnv::Static())
+        {
+        // The display is discarded.
+        delete iDisplay;
+        }
+    }
+
+
+EXPORT_C CHuiEnv& CHuiDisplayCoeControl::Env()
+    {
+    return iEnv;
+    }
+    
+
+EXPORT_C CHuiDisplay& CHuiDisplayCoeControl::Display() 
+    {
+    return *iDisplay;
+    }
+
+
+EXPORT_C void CHuiDisplayCoeControl::SizeChanged()
+    {
+    if(iDisplay)
+        {     
+        // Change the size of the display.
+        TSize size = Rect().Size();
+        TRAPD(err, iDisplay->SetSizeL(size));
+        if(err != KErrNone)
+            {
+            // Switching to new size failed. Maintain old size.
+            size = iPrevRect.Size();
+            }
+        else
+            {
+            iPrevRect = Rect();
+            }
+        
+        // Redefine the portion of the drawing surface that is used by 
+        // the display.
+        iDisplay->SetVisibleArea(TRect(TPoint(0, 0), size));
+        }
+    }
+
+
+EXPORT_C TInt CHuiDisplayCoeControl::CountComponentControls() const
+    {
+    return 0;
+    }
+
+
+EXPORT_C CCoeControl* CHuiDisplayCoeControl::ComponentControl(TInt /*aIndex*/) const
+    {
+    return NULL;
+    }
+
+
+EXPORT_C void CHuiDisplayCoeControl::Draw(const TRect& /*aRect*/) const
+    {
+    // This is called when the application framework wants us to redraw
+    // a certain portion of the screen.
+
+    if(iDisplay)
+        {
+        /// @todo  Use aRect as the dirty area to redraw.
+        
+        // Make sure refresh is going to happen.           
+        iDisplay->SetDirty();               
+        }
+    }
+
+
+EXPORT_C void CHuiDisplayCoeControl::HandleResourceChange(TInt aType)
+    {
+    CCoeControl::HandleResourceChange(aType);
+    }
+
+
+EXPORT_C void CHuiDisplayCoeControl::HandleControlEventL(CCoeControl* /*aControl*/,
+                                                         TCoeEvent /*aEventType*/)
+    {
+    /** @todo What to do here? */
+    }
+
+
+EXPORT_C TKeyResponse CHuiDisplayCoeControl::OfferKeyEventL(const TKeyEvent& aKeyEvent,
+                                                   TEventCode aType)
+    {
+    THuiEvent event(iDisplay, aKeyEvent, aType);
+
+    // Notify the environemnt.    
+    iEnv.NotifyInputReceivedL(event);
+    
+    if(iDisplay->Roster().HandleEventL(event))
+        {
+        return EKeyWasConsumed;
+        }
+    return EKeyWasNotConsumed;
+    }
+
+
+EXPORT_C void CHuiDisplayCoeControl::HandlePointerEventL(const TPointerEvent& aPointerEvent)
+    {
+    THuiEvent event(iDisplay, aPointerEvent);
+
+    // Notify the environment.    
+    iEnv.NotifyInputReceivedL(event);
+
+    iDisplay->Roster().HandleEventL(event);
+    }
+
+EXPORT_C void CHuiDisplayCoeControl::DisplayCoeCntrlExtension(const TUid& /*aExtensionUid*/, TAny** /*aExtensionParams*/)
+    {
+    }
+
+EXPORT_C void CHuiDisplayCoeControl::MakeVisible(TBool aVisible)
+    {
+    CCoeControl::MakeVisible(aVisible);
+    }
+    
+EXPORT_C void CHuiDisplayCoeControl::SetDimmed(TBool aDimmed)
+    {
+    CCoeControl::SetDimmed(aDimmed);
+    }
+
+EXPORT_C void CHuiDisplayCoeControl::ConstructFromResourceL(TResourceReader& aReader)
+    {
+    CCoeControl::ConstructFromResourceL(aReader);
+    }
+    
+EXPORT_C void CHuiDisplayCoeControl::ActivateL()
+    {
+    Window().EnableAdvancedPointers();
+    CCoeControl::ActivateL();
+    }
+    
+EXPORT_C void CHuiDisplayCoeControl::PrepareForFocusLossL()
+    {
+    CCoeControl::PrepareForFocusLossL();
+    }
+    
+EXPORT_C void CHuiDisplayCoeControl::PrepareForFocusGainL()
+    {
+    CCoeControl::PrepareForFocusGainL();
+    }
+    
+EXPORT_C TCoeInputCapabilities CHuiDisplayCoeControl::InputCapabilities() const
+    {
+    return CCoeControl::InputCapabilities();
+    }
+    
+EXPORT_C void CHuiDisplayCoeControl::FocusChanged(TDrawNow aDrawNow)
+    {
+    CCoeControl::FocusChanged(aDrawNow);
+    }
+    
+EXPORT_C void CHuiDisplayCoeControl::PositionChanged()
+    {
+    CCoeControl::PositionChanged();
+    }
+
+EXPORT_C void CHuiDisplayCoeControl::SetContainerWindowL(const CCoeControl& aContainer)
+    {
+    CCoeControl::SetContainerWindowL(aContainer);
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiDropShadowBrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,202 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "uiacceltk/HuiDropShadowBrush.h"  // Class definition
+#include "uiacceltk/HuiDrawing.h"
+#include "uiacceltk/HuiVisual.h"
+#include "uiacceltk/HuiUtil.h"
+
+
+/** Default shadow softness. */
+const TReal32 KHuiDropShadowBrushSoftness = 3.f;
+
+/** Default shadow opacity. */
+const TReal32 KHuiDropShadowBrushOpacity = 100.f/255.f;
+
+
+EXPORT_C CHuiDropShadowBrush* CHuiDropShadowBrush::NewL(const THuiMetric& aDepth)
+    {
+    CHuiDropShadowBrush* self = NewLC(aDepth);
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+EXPORT_C CHuiDropShadowBrush* CHuiDropShadowBrush::NewLC(const THuiMetric& aDepth)
+    {
+    CHuiDropShadowBrush* self = new (ELeave) CHuiDropShadowBrush(aDepth);
+    CleanupStack::PushL(self);
+    return self;
+    }
+
+
+EXPORT_C CHuiDropShadowBrush* CHuiDropShadowBrush::NewL(TInt aDepth)
+    {
+    CHuiDropShadowBrush* self = NewLC(aDepth);
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+EXPORT_C CHuiDropShadowBrush* CHuiDropShadowBrush::NewLC(TInt aDepth)
+    {
+    CHuiDropShadowBrush* self = new (ELeave) CHuiDropShadowBrush(aDepth);
+    CleanupStack::PushL(self);
+    return self;
+    }
+
+CHuiDropShadowBrush::CHuiDropShadowBrush(const THuiMetric& aDepth)
+        : CHuiBrush(),
+          iSoftness(KHuiDropShadowBrushSoftness),
+          iDepth(aDepth.iMagnitude),
+          iDepthMetric(aDepth),
+          iSoftnessMetric(KHuiDropShadowBrushSoftness),
+          iColor(TRgb(0, 0, 110))
+    {
+    SetClipToVisual(EFalse);
+    iOpacity.Set(KHuiDropShadowBrushOpacity);
+    }
+
+CHuiDropShadowBrush::CHuiDropShadowBrush(TInt aDepth)
+        : CHuiBrush(),
+          iSoftness(KHuiDropShadowBrushSoftness),
+          iDepth(TReal32(aDepth)),
+          iDepthMetric(aDepth),
+          iSoftnessMetric(KHuiDropShadowBrushSoftness),
+          iColor(TRgb(0, 0, 110)) 
+    {
+    SetClipToVisual(EFalse);
+    iOpacity.Set(KHuiDropShadowBrushOpacity);
+    }
+
+
+CHuiDropShadowBrush::~CHuiDropShadowBrush()
+    {
+    }
+    
+TBool CHuiDropShadowBrush::Changed() const
+    {
+    if ( CHuiBrush::Changed() )
+        {
+        return ETrue;
+        }
+    return iSoftness.Changed() || iDepth.Changed();
+    }
+
+void CHuiDropShadowBrush::ClearChanged()
+    {
+    CHuiBrush::ClearChanged();
+    iSoftness.ClearChanged();
+    iDepth.ClearChanged();
+    }
+
+void CHuiDropShadowBrush::Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const
+    {
+    THuiRealRect realRect = aGuide.BrushRect();
+    TReal32 opacity = aGuide.BrushOpacity() * iOpacity.Now();
+    TReal32 distanceInPixels = DepthInPixels(BrushGuide());
+    TReal32 softnessInPixels = SoftnessInPixels(BrushGuide());
+
+    TReal32 borderWidth = (softnessInPixels + distanceInPixels/2.f); //distance;
+
+    aGc.Push(EHuiGcMatrixModel);
+    aGc.Translate(EHuiGcMatrixModel, distanceInPixels, distanceInPixels, 0.0f);
+
+    borderWidth = Min( borderWidth, realRect.Width()/2.f );
+    borderWidth = Min( borderWidth, realRect.Height()/2.f );
+
+    aGc.SetPenColor(iColor);
+    aGc.SetPenAlpha(TInt(opacity * 255));
+
+    const CHuiTexture* shadowTexture = NULL;
+    TInt err = aGuide.BrushSkin().GetTexture(EHuiSkinShadowTexture, shadowTexture);
+    if (err!=KErrNone)
+    	{
+    	ASSERT(EFalse); // failed to get the shadow texture - unable to proceed!
+    	return;
+	    }
+    THuiImage dropShadowImage(*shadowTexture);
+
+    aGc.Disable(CHuiGc::EFeatureDepthWrite);
+
+	TRect roundedRect = realRect.Round();
+	// draw drop shadow borders
+    aGc.DrawBorders(roundedRect, borderWidth, borderWidth, borderWidth, borderWidth, 
+                    CHuiGc::EBorderImage, &dropShadowImage);                   
+    
+    aGc.Disable(CHuiGc::EFeatureTexturing);
+    roundedRect.Shrink( HUI_ROUND_FLOAT_TO_INT(borderWidth), HUI_ROUND_FLOAT_TO_INT(borderWidth));
+    aGc.DrawRect(roundedRect);
+    aGc.Enable(CHuiGc::EFeatureDepthWrite);
+
+    aGc.Pop(EHuiGcMatrixModel);
+    }
+
+
+void CHuiDropShadowBrush::ExpandVisualRect(TRect& aRect) const
+    {
+    TReal32 depthInPixels = DepthInPixels(BrushGuide());
+    
+    if ( depthInPixels > 0 )
+        {
+        // Currently support only drop shadow on the bottom right of the visual
+        aRect.iBr.iX += HUI_ROUND_FLOAT_TO_INT( depthInPixels );
+        aRect.iBr.iY += HUI_ROUND_FLOAT_TO_INT( depthInPixels );
+        }
+    }
+    
+EXPORT_C void CHuiDropShadowBrush::SetDepth(const THuiMetric& aDepth)
+    {
+    iDepthMetric = aDepth;
+    iDepth.Set(aDepth.iMagnitude);    
+    }
+
+EXPORT_C void CHuiDropShadowBrush::SetSoftness(const THuiMetric& aSoftness)
+    {
+    iSoftnessMetric = aSoftness;
+    iSoftness.Set(aSoftness.iMagnitude);    
+    }
+
+EXPORT_C void CHuiDropShadowBrush::SetColor(const TRgb& aColor)
+    {
+    iColor = aColor;    
+    }
+    
+TReal32 CHuiDropShadowBrush::DepthInPixels(const CHuiVisual* aVisual) const
+    {
+    return ValueInPixels(aVisual, iDepth);                    
+    }
+    
+TReal32 CHuiDropShadowBrush::SoftnessInPixels(const CHuiVisual* aVisual) const
+    {
+    return ValueInPixels(aVisual, iSoftness);                            
+    }
+
+TReal32 CHuiDropShadowBrush::ValueInPixels(const CHuiVisual* aVisual, const THuiTimedValue& aValue) const
+    {
+    TReal32 valueInPixels = aValue.Now(); // Default to old pixel width
+    if (aVisual)
+        {
+        THuiMetric metric = iDepthMetric;
+        metric.iMagnitude = valueInPixels;        
+        valueInPixels = aVisual->MetricToPixels(THuiXYMetric(metric, metric)).iX; // Calculate metric width in pixels  
+        }    
+    return valueInPixels;                            
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiEnv.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1764 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiEnv, a common working environment for the Toolkit.
+*
+*/
+
+
+
+#include <eikenv.h>
+#include <bautils.h>
+#include <coemain.h>
+#include <w32std.h>
+#include <gdi.h>
+#include <e32math.h>
+
+#include "uiacceltk/HuiEnv.h"  // Class definition
+#include <ecom/implementationinformation.h>
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiStatic.h"
+#include "alf/alfconstants.h"
+#include "HuiRenderSurface.h"
+#include "uiacceltk/HuiDisplay.h"
+#include "HuiRosterImpl.h"
+#include "uiacceltk/HuiScheduler.h"
+#include "uiacceltk/HuiTextureManager.h"
+#include "uiacceltk/HuiControlGroup.h"
+#include "HuiVisualFactory.h"
+#include "uiacceltk/HuiS60Skin.h"
+#include "uiacceltk/HuiEvent.h"
+#include "uiacceltk/HuiRoster.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/huitextstylemanager.h"
+#include "huistatictlsdata.h"
+#include "uiacceltk/HuiThemeManager.h"
+#include "huicanvastexturecache.h"
+#include "HuiFxEngine.h"
+
+#define HUI_HIRES_TIMER
+
+
+/* Constants */
+
+// Until we get refresh interval issues solved (implement hi-res timer), this define keeps fps at respectable enough level
+#ifdef SYMBIAN_BUILD_GCE
+#define HUI_NGA_MIN_REFRESH_INTERVAL 
+#endif
+
+// This is for testing, can be used to force forced refresh
+#ifdef SYMBIAN_BUILD_GCE
+//#define HUI_NGA_FORCED_REFRESH 
+#endif
+
+// This is for testing, prints performance information
+//#define HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+
+#ifdef SYMBIAN_BUILD_GCE
+    #ifdef __WINSCW__
+    const TInt KHuiEnvDefaultNormalRefreshIntervalMs = 40;
+    const TInt KHuiEnvDefaultBusyRefreshIntervalMs = 40;
+    #else
+    const TInt KHuiEnvDefaultNormalRefreshIntervalMs = 15;
+    const TInt KHuiEnvDefaultBusyRefreshIntervalMs = 15;
+    #endif
+#else
+const TInt KHuiEnvDefaultNormalRefreshIntervalMs = 20;
+const TInt KHuiEnvDefaultBusyRefreshIntervalMs = 2 * KHuiEnvDefaultNormalRefreshIntervalMs;
+#endif
+
+
+#ifndef SYMBIAN_BUILD_GCE
+const TUint KHuiEnvMaxCpuTime = 100;
+#endif
+const TUint KRndTexMemCalcFlag = 0x800;
+
+/* If there is idle between frames, this is how much we can use as overdrive max cpu utilisation */
+const TUint KHuiEnvMaxCpuTimeOverdriveMaxValue = 100;
+
+/* If max cpu usage has been set below this value, overdrive is not used because there is probaply a good reson 
+for a low max cpu usage value */
+const TUint KHuiEnvMaxCpuTimeOverdriveLowerThreshold = 50;
+
+
+/** Threshold number for refreshes that don't have any effect. When exceeded,
+    refresh is paused. */
+const TInt KIdleRefreshCountThreshold = 3;
+
+const THuiRefreshMode KHuiDefaultRefreshMode = EHuiRefreshModeAutomatic;
+class CHighResTimer : public CTimer
+	{
+public:
+	static CHighResTimer* NewL(TCallBack aCallBack, TInt aPriority)
+		{
+		CHighResTimer* self = new(ELeave) CHighResTimer(aCallBack, aPriority);
+		CleanupStack::PushL(self);
+		self->ConstructL();
+		CleanupStack::Pop(self);
+		return self;
+		}
+	
+	~CHighResTimer()
+		{
+		Cancel();
+		}
+
+	void CallBack(const TInt aWaitInMilliSecs)
+		{
+		TInt wait = 1000*aWaitInMilliSecs;
+		if (wait < 0)
+		    {
+		    wait = 15000;
+		    }
+		else if (wait > 60000)
+		    {
+		    wait = 60000;
+		    }
+		
+		HighRes( TTimeIntervalMicroSeconds32( wait ) );
+		}
+	
+private:
+	CHighResTimer(TCallBack aCallBack, TInt aPriority) 
+	: CTimer(aPriority), iCallBack(aCallBack)
+		{
+		CActiveScheduler::Add(this);
+		}
+
+	void RunL()
+		{
+		iCallBack.CallBack();
+		}
+	
+	TCallBack iCallBack;
+	};
+
+EXPORT_C CHuiEnv* CHuiEnv::NewL(THuiRenderer aRenderer, MHuiEnvObserver* aObserver)
+    {
+    CHuiEnv* self = CHuiEnv::NewLC(aRenderer, aObserver);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+EXPORT_C CHuiEnv* CHuiEnv::NewLC(THuiRenderer aRenderer, MHuiEnvObserver* aObserver)
+    {
+    CHuiEnv* self = new (ELeave) CHuiEnv(aObserver);
+    CleanupStack::PushL(self);
+    self->ConstructL(aRenderer);
+
+    return self;
+    }
+
+
+CHuiEnv::CHuiEnv(MHuiEnvObserver* aObserver)
+        : iState(ENormal),
+          iRefreshMode(KHuiDefaultRefreshMode),
+          iRefreshInterval(KHuiEnvDefaultNormalRefreshIntervalMs),
+          iRefreshIntervalTarget(KHuiEnvDefaultNormalRefreshIntervalMs),
+          iEnvObserver(aObserver),
+          iIdleThreshold(10),
+          iMaxCPUUtilization(0), // disable adaptive scheduling by default
+          iRefreshLoopPriority(CActive::EPriorityStandard),
+          iRefreshLoopActive(EFalse)
+    {
+    iIdleCPUValueMonitored = CPUTimeSupported() && OpenHandleToIdleCPUValueThread();
+    }
+
+// to get around nasty ownership problem with texture manager interface
+void NullTextureManagerPtr(TAny* aPtrToPtr)
+    {
+    if (aPtrToPtr)
+        {
+        CHuiTextureManager** ptr = (CHuiTextureManager**)aPtrToPtr;
+        *ptr = 0;
+        }
+    }
+
+void CHuiEnv::ConstructL(THuiRenderer aRenderer)
+    {
+    HUI_DEBUG(_L("CHuiEnv::ConstructL() - Constructing Hitchcock User Interface Toolkit (HUITK) working environment") );
+    HUI_DEBUG1(_L("CHuiEnv::ConstructL() - Free memory in beginning: %i"), HuiUtil::FreeMemory());
+
+    // Static data area.
+    iStatic = CHuiStatic::NewL(this);
+    HUI_DEBUG1(_L("CHuiEnv::ConstructL() - Free memory after static created: %i"), HuiUtil::FreeMemory());
+
+    // Instantiate the right type of renderer plugin.
+    
+    
+    // The Ecom plugin framework requires the identifier to be a descriptor.
+    // Convert the identifier to descriptor, which the ecom uses to determine
+    // the correct renderer.
+
+    // -----------RnD-------------------------------------------------------------
+    // Disable renderer selection for now !!
+    // -----------RnD-------------------------------------------------------------
+
+    // can't currently switch on fly and alf_config has its issues..
+    aRenderer = EHuiRendererVg10; 
+    
+
+    TBuf<10> renderer;
+    renderer.Num(aRenderer);
+
+    // The aRenderer holds the renderer information which is usually gotten from
+    // central repository key. It might not be defined though, and in that case,
+    // we'll try to load from the 
+    switch(aRenderer)
+        {
+        case EHuiRendererDefault:
+            {
+            const THuiRenderer rendererTable[] =
+                {
+                EHuiRendererVg10,
+                EHuiRendererBitgdi,
+                EHuiRendererGles20,
+                EHuiRendererGles11,
+                EHuiRendererGles10,
+                };
+            const TInt KRendererCount = 5;        
+            for (TInt index = 0; index <  KRendererCount ; index++)
+                {
+                renderer.Num(rendererTable[index]);
+                TRAPD(error, iRenderer = reinterpret_cast<CHuiRenderPlugin*>(CHuiRenderPluginBase::NewL( renderer )));
+                if (error)
+                    {
+                    HUI_DEBUG1(_L("CHuiEnv::ConstructL() - Renderer construction failed, error code: %i, trying next one...."),error );
+                    if (index ==  KRendererCount-1) 
+                        {
+                        // the last renderer in the table failed to load
+                        HUI_DEBUG(_L("CHuiEnv::ConstructL() - ERROR! Failed to create any renderer.. bailing out") );
+                        User::Leave(error);
+                        }
+                    continue;                    
+                    }
+                // got a renderer, use that...
+                iRendererIdentifier = rendererTable[index];
+                break;
+                }
+            break;
+            }
+
+
+        default:
+            {
+            // Load the renderer plugin with the given identifier. The Ecom framework
+            // will take care searching for matching renderer. If not found, will leave with KErrNotFound
+            iRenderer = reinterpret_cast<CHuiRenderPlugin*>(CHuiRenderPluginBase::NewL( renderer ));
+            iRendererIdentifier = aRenderer;
+            
+            // @TODO Should we panic, if renderer wasn't found, or is the Leave
+            // with KErrNotFound enough?
+            //THuiPanic::Panic(THuiPanic::EStaticInvalidRenderer);
+            break;
+            }
+        }
+
+    iStatic->SetRenderer(*iRenderer);
+
+    CHuiStatic::Tic(1);
+
+    // Create the scheduler.
+    iScheduler = new (ELeave) CHuiScheduler(*this);
+
+    // Create a texture manager.
+    
+    CleanupStack::PushL(TCleanupItem(NullTextureManagerPtr,&iTextureManager));
+    iTextureManager = iRenderer->CreateTextureManagerL(*this);
+    // Register as a state change and texture loaded event observer
+    CleanupStack::Pop(); 
+    iTextureManager->iStateObservers.AppendL(*this);
+    iTextureManager->iLoadObservers.AppendL(*this);
+
+    // Create a font manager.
+    iFontManager = iRenderer->CreateFontManagerL();
+    
+    // Create a text style manager.
+    iTextStyleManager = CHuiTextStyleManager::NewL();
+    iTextStyleManager->ConstructBuiltInStylesL();
+    
+    // Create a visual factory.
+    iVisualFactory = new (ELeave) CHuiVisualFactory(*this);
+
+    // Create an effects engine
+    iEffectsEngine = iRenderer->CreateEffectsEngineL();
+
+    // Cache the last input time.
+    iLastInputTime = CHuiStatic::Time();
+
+    // Create a shared roster. This is used by all overlaid displays.
+    iSharedRoster = new (ELeave) CHuiRosterImpl(NULL);
+
+    /** @todo Create a skin here. This must be done in a better way.
+        The skin can only be created when there is a EGL context because
+        the skin will attempt to create textures and load fonts. */
+
+    if(!iSkin)
+        {
+        if(iEnvObserver)
+            {
+            iSkin = iEnvObserver->CreateSkinL(*this);
+            }
+        if(!iSkin)
+            {
+            // Create an instance of the default skin. The S60 skin uses data
+            // and bitmaps from the current S60 skin.
+            iSkin = new (ELeave) CHuiS60Skin(*this);
+            (static_cast<CHuiS60Skin*>(iSkin))->ConstructL();
+            }
+        }
+
+    // DEPRECATED: JUST A DUMMY CONSTRUCTION TO PREVENT BREAKS
+    //iThemeManager = CHuiThemeManager::NewL();
+
+    iCanvasTextureCache = CHuiCanvasTextureCache::NewL();
+
+#ifndef SYMBIAN_BUILD_GCE
+#ifndef __WINSCW__
+    // for now, display fps information automatically if errrd installed
+    if (eikenv)
+        {
+        _LIT(KRDSupport, "c:\\resource\\errrd" );
+        if (eikenv->FsSession().Handle() && BaflUtils::FileExists( eikenv->FsSession(), KRDSupport ))
+            {
+            SetFPSCounterThreshold(700);
+            }
+        }
+#endif
+#endif //SYMBIAN_BUILD_GCE
+    HUI_DEBUG(_L("CHuiEnv::ConstructL - Working environment ready."));
+    }
+
+
+CHuiEnv::~CHuiEnv()
+    {
+    iActionObservers.Close();
+
+    // Destroy groups in reverse order so that references will be removed
+    // in natural order.
+    TInt i = 0;
+    for(i = iLoadedGroups.Count() - 1; i >= 0; --i)
+        {
+        CHuiControlGroup* g = iLoadedGroups[i];
+        iLoadedGroups.Remove(i);
+        delete g;
+        }
+    iLoadedGroups.Reset();
+
+    for(i = iDisplays.Count() - 1; i >= 0; --i)
+        {
+        // Deleting a display causes it to be automatically removed from the
+        // displays array.
+        delete iDisplays[i];
+        }
+
+    iDisplays.Reset();
+    iOverlaidDisplays.Reset();
+
+    delete iCanvasTextureCache;
+
+    delete iSharedRoster;
+    delete iSkin;
+    delete iVisualFactory;
+    delete iTextureManager;
+    delete iEffectsEngine;
+
+    // DEPRECATED: JUST A DUMMY DESTRUCTION
+    //delete iThemeManager;	//Theme support
+
+    delete iFontManager;
+    delete iTextStyleManager;
+    delete iPeriodic;
+    delete iScheduler;
+    iScheduler = NULL;
+    delete iRenderer;
+    delete iStatic;
+    iEnvObserver = NULL;
+    
+    if (iIdleCPUValueMonitored)
+        {
+        CloseHandleToIdleCPUValueThread();            
+        }
+    
+    iLowMemoryObservers.Close();
+    iMemoryLevelObservers.Close();
+    }
+
+
+void CHuiEnv::SetTextureManager(CHuiTextureManager& aManager)
+    {
+    iTextureManager = &aManager;
+    }
+
+
+EXPORT_C THuiRenderer CHuiEnv::Renderer() const
+    {
+    return iRendererIdentifier;
+    }
+
+
+EXPORT_C void CHuiEnv::SetRefreshMode(THuiRefreshMode aMode)
+    {
+    switch (aMode)
+        {
+        case EHuiRefreshModeManual:
+               //HUI_DEBUG(_L("CHuiEnv::SetRefreshMode() - Setting manual refresh mode."));
+               break;
+        case EHuiRefreshModeAutomatic:
+               //HUI_DEBUG(_L("CHuiEnv::SetRefreshMode() - Setting automatic refresh mode."));
+               break;
+        case EHuiRefreshModeForced:
+               //HUI_DEBUG(_L("CHuiEnv::SetRefreshMode() - Setting forced refresh mode."));
+               break;
+        default:
+               //HUI_DEBUG(_L("CHuiEnv::SetRefreshMode() - ERROR! Tried to set unknown refresh mode! Ignoring.."));
+               return;
+        }
+
+
+#ifdef HUI_NGA_FORCED_REFRESH
+    iRefreshMode = EHuiRefreshModeForced;
+#else
+    iRefreshMode = aMode;
+#endif
+    
+    if(aMode == EHuiRefreshModeManual)
+        {
+        StopRefresh();
+        }
+    else
+        {
+        StartRefresh(iRefreshIntervalTarget);
+        }
+    }
+
+
+EXPORT_C THuiRefreshMode CHuiEnv::RefreshMode() const
+    {
+    return iRefreshMode;
+    }
+
+
+EXPORT_C void CHuiEnv::SetMaxFrameRate(TReal32 aFrameRate) __SOFTFP
+    {
+#ifdef HUI_NGA_MIN_REFRESH_INTERVAL
+    if (aFrameRate < (1000/KHuiEnvDefaultNormalRefreshIntervalMs))
+        aFrameRate = 1000/KHuiEnvDefaultNormalRefreshIntervalMs;
+#endif
+    
+    TInt oldIRefreshIntervalTarget = iRefreshIntervalTarget;
+    if(aFrameRate != 0.0)
+        {
+        iRefreshIntervalTarget = TInt(1000 / aFrameRate);
+        }
+    else
+        {
+        iRefreshIntervalTarget = KHuiEnvDefaultNormalRefreshIntervalMs;
+        }
+
+    if(iRefreshIntervalTarget < 1)
+        {
+        iRefreshIntervalTarget = 1;
+        }
+
+    // If the refresh timer is running, update it.
+    if(!iMaxCPUUtilization &&  /* Adaptive scheduling not enabled */ 
+       iPeriodic && (iPeriodic->IsActive() || iRefreshLoopActive ) && /* and heart beat already active */
+       oldIRefreshIntervalTarget != iRefreshIntervalTarget ) 
+        {
+        StartRefresh(iRefreshIntervalTarget);
+        }
+    }
+
+
+EXPORT_C void CHuiEnv::StartRefresh(TInt aMilliSeconds)
+    {
+    StartRefresh(aMilliSeconds, aMilliSeconds);
+    }
+
+void CHuiEnv::StartRefresh(TInt aIntervalInMilliSeconds, TInt aDelayInMilliseconds)
+    {
+    // Cancel the previous timer.
+    StopRefresh();
+
+    if(iState == EReleased)
+        {
+        // When environment is released no refresh is done.
+        return;
+        }
+        
+    if ( aIntervalInMilliSeconds < 1 )
+        {
+        HUI_DEBUG1(_L("CHuiEnv::StartRefresh() - Requested %i ms - too low!."), aIntervalInMilliSeconds);
+        aIntervalInMilliSeconds = 1;
+        }
+   
+    if (aIntervalInMilliSeconds > 1000)
+        {
+        HUI_DEBUG1(_L("CHuiEnv::StartRefresh() - Requested %i ms - too high!."), aIntervalInMilliSeconds);
+        aIntervalInMilliSeconds = 1000;    
+        }
+
+    if ( aDelayInMilliseconds < 1 )
+        {
+        HUI_DEBUG1(_L("CHuiEnv::StartRefresh() - Requested %i aDelayInMilliseconds ms - too low!."), aDelayInMilliseconds);
+        aDelayInMilliseconds = 1;
+        }
+   
+    if (aDelayInMilliseconds > 1000)
+        {
+        HUI_DEBUG1(_L("CHuiEnv::StartRefresh() - Requested %i aDelayInMilliseconds ms - too high!."), aDelayInMilliseconds);
+        aDelayInMilliseconds = 1000;    
+        }
+    
+    
+    //HUI_DEBUG1(_L("CHuiEnv::StartRefresh() - Starting at %i ms interval."), aMilliSeconds);
+
+    // Create a new refresh timer.
+    
+    TInt err(0);
+    if (!iPeriodic)
+        {
+#ifdef HUI_HIRES_TIMER
+        TRAP(err, iPeriodic = CHighResTimer::NewL(TCallBack(CHuiEnv::RefreshCallBack, this), iRefreshLoopPriority));
+#else
+        TRAP( err, iPeriodic = CPeriodic::NewL(iRefreshLoopPriority) );
+#endif
+        }
+
+    if (!err)
+        {
+#ifdef HUI_HIRES_TIMER
+        iPeriodic->CallBack( aIntervalInMilliSeconds );
+#else 
+        iPeriodic->Start(TTimeIntervalMicroSeconds32(1000 * aDelayInMilliseconds),
+                         TTimeIntervalMicroSeconds32(1000 * aIntervalInMilliSeconds),
+                         TCallBack(CHuiEnv::RefreshCallBack, this));  
+#endif
+        iRefreshLoopActive = ETrue;
+
+        // Store current refresh interval                   
+        iRefreshInterval = aIntervalInMilliSeconds; 
+        }
+    }
+
+void CHuiEnv::StopRefresh()
+    {
+    //HUI_DEBUG(_L("CHuiEnv::StopRefresh()"));
+    if(iPeriodic)
+        {
+        iPeriodic->Cancel();
+        iRefreshLoopActive = EFalse;
+        }
+    }
+
+
+EXPORT_C void CHuiEnv::ContinueRefresh()
+    {
+    ContinueRefresh(EFalse);
+    }
+
+void CHuiEnv::ContinueRefresh(TBool aFastFirstRefresh)
+    {
+    if((iRefreshMode == EHuiRefreshModeManual) ||
+       (iState == EReleased))
+        {
+        // When running in manual refresh mode, this has no effect. Refreshes
+        // must be manually requested.
+        // When environment is released no refresh is done.
+        return;
+        }
+
+    if(!iPeriodic || ( !iPeriodic->IsActive() && !iRefreshLoopActive ) )
+        {
+        HUI_DEBUG1(_L("CHuiEnv::ContinueRefresh() - Continuing normal refresh with %i ms intervals."),
+                   iRefreshInterval);
+        
+        TInt refreshDelay = aFastFirstRefresh ? 1 : iRefreshIntervalTarget;
+        StartRefresh(iRefreshIntervalTarget, refreshDelay);
+
+        // When refresh is paused, the frame rate is virtually infinite
+        // since nothing needs to be done on each refresh. This means that
+        // when refresh continues, the first elapsed step should be zero.
+        // A call to UpdateTime() updates the internal absolute clock with
+        // the latest time.
+        CHuiStatic::UpdateTime();
+        }    
+    }
+
+EXPORT_C void CHuiEnv::PauseRefresh()
+    {
+    HUI_DEBUG(_L("CHuiEnv::PauseRefresh() - Refresh paused due to inactivity."));
+    HUI_DEBUG1(_L("CHuiEnv::PauseRefresh() - Free memory left: %i"), HuiUtil::FreeMemory());
+    StopRefresh();
+    }
+
+
+EXPORT_C CHuiDisplay&
+CHuiEnv::NewDisplayL(const TRect& aRect, CCoeControl* aNativeControl, TInt aFlags, 
+					 CHuiDisplay* aDisplayToShareRoster, TInt aDisplayType )
+    {
+    return NewDisplayL(aRect, aNativeControl, aFlags, aDisplayToShareRoster, aDisplayType, KHuiUidBackBufferScreen0);
+    }
+
+
+EXPORT_C CHuiDisplay&
+CHuiEnv::NewDisplayL(const TRect& aRect, CCoeControl* aNativeControl, TInt aFlags, 
+					 CHuiDisplay* aDisplayToShareRoster, TInt aDisplayType, TUid aBackBufferUid)
+    {
+    TBool isDisplayTypeTvOut = 
+    	((aDisplayType == CHuiDisplay::EDisplayTvOut) || 
+   	     (aDisplayType == CHuiDisplay::EDisplayTvOutWide) ||
+   	     ((aDisplayType == CHuiDisplay::EDisplayNormal) && 
+   	     ((aBackBufferUid == KHuiUidBackBufferTvOutNormal) ||
+   	      (aBackBufferUid == KHuiUidBackBufferTvOutWide))));
+
+    if ((iRendererIdentifier != EHuiRendererBitgdi) &&
+    	(isDisplayTypeTvOut ||  (aDisplayType == CHuiDisplay::EDisplayOffScreenBuffer)))
+    	{
+    	User::Leave(KErrNotSupported);
+    	}
+    
+    CHuiRoster* roster = NULL;
+    if (aDisplayToShareRoster) 
+    	{
+    	roster = &aDisplayToShareRoster->Roster();
+    	}
+    if(aFlags & ENewDisplayOverlaid)
+        {
+        roster = iSharedRoster;
+        }
+
+    CHuiDisplay* display = new (ELeave) CHuiDisplay(*this, aNativeControl, aDisplayType, aBackBufferUid);
+    CleanupStack::PushL(display);
+    display->ConstructL(aRect, roster);
+    User::LeaveIfError(iDisplays.Append(display));
+    CleanupStack::Pop(display);
+
+    // Notify the current renderer of the changed number of displays
+    iRenderer->NotifyDisplayCountL(iDisplays.Count());
+
+    HUI_DEBUG2(_L("HuiEnv::NewDisplay %x added to array, with flags %x"), display, aFlags);
+    
+    // Notify observers about new TvOut display
+    if(isDisplayTypeTvOut)
+        {
+        ReportAction(THuiActionCommand(KHuiActionNewTVOutDisplayUid.iUid));
+        }
+
+    return *display;
+    }
+
+EXPORT_C CHuiDisplay& CHuiEnv::NewDisplayL(RWindow* aNativeWindow,
+                                      TInt aFlags,
+                                      CHuiDisplay* aDisplayToShareRoster, 
+                                      TInt aDisplayType, 
+                                      TUid aBackBufferUid)
+    {
+    CHuiRoster* roster = NULL;
+    if (aDisplayToShareRoster) 
+    	{
+    	roster = &aDisplayToShareRoster->Roster();
+    	}
+    if(aFlags & ENewDisplayOverlaid)
+        {
+        roster = iSharedRoster;
+        }
+
+    CHuiDisplay* display = new (ELeave) CHuiDisplay(*this, aNativeWindow, aDisplayType, aBackBufferUid);
+    CleanupStack::PushL(display);
+    display->ConstructL(TRect(TPoint(0,0),aNativeWindow->Size()), roster);
+    User::LeaveIfError(iDisplays.Append(display));
+    CleanupStack::Pop(display);
+
+    // Notify the current renderer of the changed number of displays
+    iRenderer->NotifyDisplayCountL(iDisplays.Count());
+
+    HUI_DEBUG2(_L("HuiEnv::NewDisplay %x added to array, with flags %x"), display, aFlags);
+    
+    return *display;
+    }
+
+
+EXPORT_C TInt CHuiEnv::DisplayCount() const
+    {
+    return iDisplays.Count();
+    }
+
+
+void CHuiEnv::RemoveDisplay(CHuiDisplay& aDisplay)
+    {
+    // Actually this is "DestroyDisplay"
+
+    /** @todo  Make a proper observer. */
+    TInt index = iDisplays.Find(&aDisplay);
+    if(index >= 0)
+        {
+        iDisplays.Remove(index);
+        }
+    else
+        {
+        HUI_DEBUG1(_L("HuiEnv::DestroyContext: display %x not in array"), &aDisplay);
+        }
+    index = iOverlaidDisplays.Find(&aDisplay);
+    if(index >= 0)
+        {
+        iOverlaidDisplays.Remove(index);
+        }
+
+    // Notify the current renderer of the changed number of displays
+    TRAP_IGNORE(iRenderer->NotifyDisplayCountL(iDisplays.Count()))
+
+#ifdef _DEBUG
+    HUI_DEBUG(_L("  Contents of iDisplays:"));
+    for(TInt i = 0; i < iDisplays.Count(); ++i)
+        {
+        HUI_DEBUG2(_L("  %i: %x"), i, iDisplays[i]);
+        }
+#endif
+    }
+
+
+EXPORT_C TInt CHuiEnv::RefreshCallBack(TAny* aInstance)
+    {
+    ASSERT( aInstance );
+    CHuiEnv* self = static_cast<CHuiEnv*>( aInstance );
+    
+    TReal32 elapsedTime = 0;
+
+    // Investigate whether the environment is released
+    if(self->iState == EReleased)
+        {
+        HUI_DEBUG(_L("CHuiEnv::RefreshCallBack() - Warning: Refresh callback called while environment is released."));
+        return KErrNone;
+        }
+
+    self->SetTimeFromLastUpdate(CHuiStatic::MilliSecondsSinceUpdateTime());
+    // Compute the elapsed time (in sec.) between the current and the
+    // previous refresh call.
+    CHuiStatic::UpdateTime();
+    elapsedTime = CHuiStatic::ElapsedSeconds();
+
+    // Time advancements should not happen in too large increments.
+    /** @todo The time advancement should be done in steps if the
+              elapsed time is too long. The static time in CHuiStatic
+              should also be updated using the same steps. This will
+              allow scheduled commands to be executed and timed
+              correctly (start times of timed transitions).  */
+
+    HUI_DEBUGF1(_L("CHuiEnv::RefreshCallBack() - Elapsed time: %f"), elapsedTime);
+
+    if (elapsedTime < 0)
+        {
+        elapsedTime = 1;
+        }
+
+    self->AdvanceTime(elapsedTime);
+
+    // Report the current frame rate at certain intervals.
+    TReal32 nowTime = CHuiStatic::SecondsSinceStart();
+    if(nowTime - self->iPreviousFpsTime > 3)
+        {
+        HUI_DEBUG1(_L("CHuiEnv::RefreshCallBack() - FPS: %f"), CHuiStatic::FrameRate());
+        self->iPreviousFpsTime = nowTime;
+        }
+
+    return KErrNone;
+    }
+
+
+void CHuiEnv::AdvanceTime(TReal32 aElapsedTime)
+    {
+    HUI_DEBUGF( _L("CHuiEnv::AdvanceTime() - Started") );
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+    TTime startTime;
+    TTime endTime;
+#endif
+
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+    RDebug::Print(_L("CHuiEnv::AdvanceTime starting measuring 0."));
+    startTime.UniversalTime();
+#endif
+    
+    
+    TUint usedMaxCPUUtilization = iMaxCPUUtilization;
+
+    // Calculate cpu values based on null thread cpu usage between frames. 
+    // Values will be updated at the end of the frame.
+    if (iIdleCPUValueMonitored && usedMaxCPUUtilization)
+        {
+        TTime currentTime;
+        currentTime.HomeTime();
+
+        TTimeIntervalMicroSeconds cputime;
+        iIdleCPUValueThread.GetCpuTime(cputime);
+
+        TInt64 cpudelta = cputime.Int64() - iIdleCPUValue;
+        TInt64 timedelta = currentTime.Int64() - iIdleCPUValuePreviousTime;
+
+        // If null thread was runnign between frames, we could use more cpu if needed.
+        if (cpudelta && timedelta)
+            {
+            // Calculate how much we want !
+            if (iMaxCPUUtilization > KHuiEnvMaxCpuTimeOverdriveLowerThreshold &&
+                iMaxCPUUtilization < KHuiEnvMaxCpuTimeOverdriveMaxValue )
+                {
+                usedMaxCPUUtilization += (KHuiEnvMaxCpuTimeOverdriveMaxValue - iMaxCPUUtilization) * cpudelta/timedelta;
+                
+                // Sanity check just in case cpu/time measurements are not accurate
+                if (usedMaxCPUUtilization > KHuiEnvMaxCpuTimeOverdriveMaxValue)
+                    {
+                    usedMaxCPUUtilization = KHuiEnvMaxCpuTimeOverdriveMaxValue;   
+                    }
+                
+                if (usedMaxCPUUtilization < iMaxCPUUtilization)
+                    {
+                    usedMaxCPUUtilization = iMaxCPUUtilization;    
+                    }                                    
+                }
+            }
+        }
+
+    if(aElapsedTime > 0)
+        {
+        // Let the scheduler know that time has passed. It will possible animate
+        // visuals and perform actions, causing dirty regions in the display.
+        iScheduler->AdvanceTime(aElapsedTime);
+
+        // Scheduled command might have released the environment.
+        if(iState == EReleased)
+            {
+            HUI_DEBUG(_L("CHuiEnv::AdvanceTime() - Environment released when executing scheduled commands. AdvanceTime cancelled."));
+            return;
+            }
+
+        // Let the texture manager know that time has passed. It will update any
+        // animated textures.
+        iTextureManager->AdvanceTime(aElapsedTime);                
+        // Notify the effects engine to update animated effects
+        if (iEffectsEngine)
+            {
+            iEffectsEngine->AdvanceTime(aElapsedTime);
+
+            // Notify the effects end observers
+            iEffectsEngine->NotifyEffectEndObservers();
+            }
+        }
+
+    // Check for no input for long time.
+    TTime now = CHuiStatic::Time();
+    TTimeIntervalSeconds seconds = 0;
+    now.SecondsFrom(iLastInputTime, seconds);
+    if(seconds.Int() >= iIdleThreshold && !iInputIdleIsActive)
+        {
+        HUI_DEBUG1(_L("CHuiEnv::AdvanceTime() - No input received within %i seconds. Going to idle."), iIdleThreshold);
+        iInputIdleIsActive = ETrue;
+        
+        // Idle state begins.
+        TRAPD(err, SendIdleL(ETrue));
+        if(err != KErrNone)
+            {
+            // @todo  Log error?
+            }
+            
+        // Switching to idle state might have released the environment.
+        if(iState == EReleased)
+            {
+            HUI_DEBUG(_L("CHuiEnv::AdvanceTime() - Environment released when switching to idle state. AdvanceTime cancelled."));
+            return;
+            }            
+        }
+
+    TBool somethingUpdated = EFalse;
+
+    // Refresh all displays.
+    TInt i;
+    const TInt displayCount = iDisplays.Count();
+    RArray<TBool> displayRefreshed( displayCount ? displayCount : 1 );
+    for(i = 0; i < iDisplays.Count(); ++i)
+        {
+        displayRefreshed.Append(EFalse);
+        if(iRefreshMode == EHuiRefreshModeForced || iDisplays[i]->IsDirty())
+            {
+            MakeCurrent(*iDisplays[i]);
+
+            HUI_DEBUGF1( _L("CHuiEnv::AdvanceTime() - Refreshing display %i"), i );
+            TBool updated = iDisplays[i]->Refresh();
+            displayRefreshed[i] = updated;
+            if(updated)
+                {
+                somethingUpdated = ETrue;
+                }
+            }
+        }
+
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+    endTime.UniversalTime();
+    TInt timeInMs =  endTime.MicroSecondsFrom( startTime ).Int64()/1000;           
+    RDebug::Print(_L("CHuiEnv::AdvanceTime first part %i ms"), timeInMs);
+#endif
+    
+    TBool continueRefresh = ETrue;
+
+    if(somethingUpdated)
+        {
+
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+    RDebug::Print(_L("CHuiEnv::AdvanceTime starting measuring 2."));
+    startTime.UniversalTime();
+#endif
+    
+        iIdleRefreshCount = 0;
+        // Clear change flags now that the frames are complete.
+        for(i = 0; i < iDisplays.Count(); ++i)
+            {
+            // Clear changed for an off screen display only if the buffer has new content.
+            // Index is ok becacause displayRefreshed array was defined using size of iDisplays array
+            if (displayRefreshed[i])
+            	{
+            	iDisplays[i]->ClearChanged();
+            	}
+            }
+        }
+    else if(iScheduler->PendingCount() == 0)
+        {
+        // But if there are scheduled commands, let's make sure they'll get
+        // executed at the right time. They might get badly delayed if the
+        // refresh wasn't occuring.
+
+        /** @todo  Use a separate timer for the scheduler? */
+
+        // Nothing happened during the display refreshing.
+        iIdleRefreshCount++;
+
+        // If this occurs too often, pause refresh automatically.
+        if(iIdleRefreshCount > KIdleRefreshCountThreshold)
+            {
+            if (iFpsCounterThreshold && iMillisecondFromFPSUpdate && iFrames)
+                {
+                TBuf<16> numBuf;
+                TReal fps = 1000*(TReal)iFrames/iMillisecondFromFPSUpdate;
+                numBuf.AppendNum(fps, TRealFormat(5,2));
+                User::InfoPrint(numBuf);
+                iFrames = 0;
+                iMillisecondFromFPSUpdate = 0;
+                }
+
+            PauseRefresh();
+            continueRefresh = EFalse;
+            }
+        }
+    else
+        {
+        // for PC lint
+        }
+
+    if(somethingUpdated)
+        {
+        HUI_DEBUGF( _L("CHuiEnv::AdvanceTime() - Swap buffers") );
+
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+    RDebug::Print(_L("CHuiEnv::AdvanceTime starting measuring 1."));
+    startTime.UniversalTime();
+#endif
+
+        SwapBuffers(displayRefreshed);
+
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+    endTime.UniversalTime();
+    TInt timeInMs =  endTime.MicroSecondsFrom( startTime ).Int64()/1000;           
+    RDebug::Print(_L("CHuiEnv::AdvanceTime swapbuffers took %i ms"), timeInMs);
+#endif
+        }
+
+    displayRefreshed.Close(); // Not needed any more
+    
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+    endTime.UniversalTime();
+    timeInMs =  endTime.MicroSecondsFrom( startTime ).Int64()/1000;           
+    RDebug::Print(_L("CHuiEnv::AdvanceTime iDisplays[i]->ClearChanged() took %i ms"), timeInMs);
+#endif
+    
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+    RDebug::Print(_L("CHuiEnv::AdvanceTime starting measuring 3."));
+    startTime.UniversalTime();
+#endif
+	
+	
+    // Clear change flags of all control groups now that the refresh has
+    // been completed for all displays.
+    //
+    // DEPRECATE:
+    // This should be removed when control opacities are deprecated! 
+    // Controls shouldn't need change flags because change flags are 
+    // only for the refresh.
+    //
+    for(i = 0; i < iLoadedGroups.Count(); ++i)
+        {
+        iLoadedGroups[i]->ClearChanged();
+        }
+
+    iTextureManager->ClearChangedTextures();
+    iCanvasTextureCache->AdvanceTime();
+
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+    endTime.UniversalTime();
+    timeInMs =  endTime.MicroSecondsFrom( startTime ).Int64()/1000;           
+    RDebug::Print(_L("CHuiEnv::AdvanceTime textures ClearChanged() and other stuff took %i ms"), timeInMs);
+#endif
+    
+    if (continueRefresh)
+        {
+        TUint refreshTime = CHuiStatic::MilliSecondsSinceUpdateTime();
+        // Refresh rate adjustment
+        if (usedMaxCPUUtilization)
+            {
+			// Estimated frame, when sleep time is included. 
+            TUint estimatedTotalRefreshTime = (refreshTime * 100) / usedMaxCPUUtilization; 
+    
+            if (estimatedTotalRefreshTime >= iRefreshIntervalTarget) 
+                {
+                // Rendering slower that fps limit set by user.
+                // Start refresh after the sleep period as the frame has already been rendered.
+                StartRefresh(estimatedTotalRefreshTime - refreshTime);        
+                }
+#ifndef HUI_HIRES_TIMER
+            else if (iRefreshIntervalTarget != iRefreshInterval)
+                {
+                StartRefresh(iRefreshIntervalTarget);			
+                }
+#endif            
+            else
+                {
+                // Rendering faster than the fps limit set by user. Limit fps to target fps.
+                // The sleep time is the full frame time less by the render time. 
+#ifdef HUI_HIRES_TIMER
+                StartRefresh( iRefreshIntervalTarget - refreshTime );
+#endif
+                }
+            }
+        else
+        	{
+            // No CPU utilisation.
+            // The sleep time is the full frame time less by the render time. 
+#ifdef HUI_HIRES_TIMER
+            StartRefresh( iRefreshIntervalTarget - refreshTime );
+#endif
+        	}
+
+        if (iFpsCounterThreshold && iMillisecondFromFPSUpdate > iFpsCounterThreshold)
+            {
+            TBuf<16> numBuf;
+            TReal fps = 1000*(TReal)iFrames/iMillisecondFromFPSUpdate;
+            numBuf.AppendNum(fps, TRealFormat(5,2));
+            User::InfoPrint(numBuf);
+            iFrames = 0;
+            iMillisecondFromFPSUpdate = 0;
+            }
+        }
+
+    iCurrentDisplay = NULL; // informs the egosystem that the drawing is done.
+    CHuiStatic::ReportNewFrame();
+    
+    // Store cpu value conters of null thread. Values will be used at the start of the next frame.
+    if (iIdleCPUValueMonitored)
+        {
+        TTime currentTime;
+        currentTime.HomeTime();
+
+        TTimeIntervalMicroSeconds cputime;
+        iIdleCPUValueThread.GetCpuTime(cputime);
+
+        // Store as previous values
+        iIdleCPUValue = cputime.Int64();
+        iIdleCPUValuePreviousTime = currentTime.Int64();                           
+        }
+            
+    HUI_DEBUGF( _L("CHuiEnv::AdvanceTime() - Exited") );
+    }
+
+
+EXPORT_C TBool CHuiEnv::HandleKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType,
+                                        CHuiDisplay* aAssocDisplay)
+    {
+    if(aAssocDisplay)
+        {
+        THuiEvent event(aAssocDisplay, aKeyEvent, aType);
+
+        // Notify the environment itself.
+        NotifyInputReceivedL(event);
+
+        if(aAssocDisplay->Roster().HandleEventL(event))
+            {
+            return EKeyWasConsumed;
+            }
+        return EKeyWasNotConsumed;
+        }
+
+    return EKeyWasNotConsumed;
+    }
+
+
+void CHuiEnv::NotifyInputReceivedL(const THuiEvent& aEvent)
+    {
+    ContinueRefresh();
+
+    if(aEvent.IsKeyEvent() || aEvent.IsPointerEvent())
+        {
+        if(iInputIdleIsActive)
+            {
+            HUI_DEBUG(_L("CHuiEnv::NotifyInputReceivedL() - Got key/pointer input! Idle state ends!"));
+            // Idle state ends.
+            SendIdleL(EFalse);
+            }
+
+        iLastInputTime = CHuiStatic::Time();
+        iInputIdleIsActive = EFalse;
+        }
+    }
+
+
+void CHuiEnv::SendIdleL(TBool aIdleBegins)
+    {
+    CHuiDisplay* display = NULL;
+    
+    if(iDisplays.Count() != 0)
+        {
+        // If we have any displays, pass the first one.
+        display = iDisplays[0];
+        }
+    
+    THuiEvent idleEvent(display,
+        aIdleBegins ? THuiEvent::ETypeIdleBegin :
+                      THuiEvent::ETypeIdleEnd);
+    BroadcastEventL(idleEvent);
+    }
+
+
+EXPORT_C void CHuiEnv::SetIdleThreshold(TInt aMilliSeconds)
+    {
+    iIdleThreshold = aMilliSeconds/1000;
+    }
+
+
+EXPORT_C void CHuiEnv::BroadcastEventL(const THuiEvent& aEvent)
+    {
+    for(TInt i = 0; i < iDisplays.Count(); ++i)
+        {
+        THuiEvent event = aEvent;
+        event.iDisplay = iDisplays[i];
+        /** @todo  Musn't access the roster directly. */
+        iDisplays[i]->Roster().HandleEventL(event);
+        }
+    }
+
+
+void CHuiEnv::MakeCurrent(const CHuiDisplay& aDisplay) const
+    {
+    aDisplay.RenderSurface().MakeCurrent();
+    iCurrentDisplay = const_cast<CHuiDisplay*>(&aDisplay);
+    }
+
+
+void CHuiEnv::SwapBuffers(const RArray<TBool>& aDisplayRefreshed)
+    {
+    /** @todo This may not work as expected when multiple displays are
+        being used. */
+
+    if (iFpsCounterThreshold)
+        {
+        iFrames++;
+        iMillisecondFromFPSUpdate += iRefreshIntervalReal;
+        }    
+
+    /** @todo  Only swap the visible displays. */
+
+    for(TInt i = 0; i < iDisplays.Count(); ++i)
+        {          
+        // Index should ok becacause displayRefreshed array was defined using size of iDisplays array
+        // This function should only be called from inside CHuiEnv even if it is public.
+        // At least it is not exported.
+        if (aDisplayRefreshed[i] 
+            && (iDisplays[i]->DisplayType() != CHuiDisplay::EDisplayOffScreenBuffer)
+            && (iDisplays[i]->ScreenBufferObserver() == NULL))
+        	{
+            MakeCurrent(*iDisplays[i]);
+            if (iSwapObserver)
+                iSwapObserver->PrepareSwap();
+     		iDisplays[i]->RenderSurface().SwapBuffers();
+            if (iSwapObserver)
+                iSwapObserver->SwapComplete();
+        	
+        	}
+        }
+    }
+
+
+void CHuiEnv::CreateResourceReaderLC(TResourceReader& aReader, TInt aResourceId) const
+    {
+    CCoeEnv* coe = CCoeEnv::Static();
+    if (!coe)
+    		{
+    		User::Leave(KErrNotSupported);
+    	  }
+    coe->CreateResourceReaderLC(aReader, aResourceId);
+    }
+
+
+EXPORT_C CHuiControlGroup& CHuiEnv::NewControlGroupL(TInt aId)
+    {
+    CHuiControlGroup* group = new (ELeave) CHuiControlGroup(aId, *this);
+    CleanupStack::PushL(group);
+    User::LeaveIfError(iLoadedGroups.Append(group));
+    CleanupStack::Pop(group);
+    return *group;
+    }
+
+
+EXPORT_C TInt CHuiEnv::DeleteControlGroup(TInt aId)
+    {
+    TInt i;
+
+    for(i = 0; i < iLoadedGroups.Count(); ++i)
+        {
+        if(iLoadedGroups[i]->ResourceId() == aId)
+            {
+            // This is control group to delete.
+            CHuiControlGroup* group = iLoadedGroups[i];
+            CancelCommands(group);
+
+            for (TInt ii = iDisplays.Count()-1; ii>=0; ii--)
+                {
+                TInt index = iDisplays[ii]->Roster().Find(group);
+                if (index != KErrNotFound)
+                    {
+                    iDisplays[ii]->Roster().Hide(iDisplays[ii]->Roster().ControlGroup(index));
+                    }
+                }
+            
+            iLoadedGroups.Remove(i);
+            delete group;
+            return KErrNone;
+            }
+        }
+
+    return KErrNotFound;
+    }
+
+
+EXPORT_C CHuiControlGroup& CHuiEnv::LoadControlGroupL(TInt aResourceId)
+    {
+    CHuiControlGroup* group = new (ELeave) CHuiControlGroup(aResourceId, *this);
+    CleanupStack::PushL(group);
+
+    // Create a resource reader and construct the group and its controls.
+    TResourceReader reader;
+    CreateResourceReaderLC(reader, aResourceId);
+    group->ConstructFromResourceL(reader);
+    CleanupStack::PopAndDestroy(); // reader
+
+    // Add the control group to the list of all existing groups.
+    // The environment will retain ownership of the group.
+    User::LeaveIfError( iLoadedGroups.Append(group) );
+
+    CleanupStack::Pop(group);
+    return *group;
+    }
+
+
+EXPORT_C void CHuiEnv::LoadBitmapsL(TInt aResourceId)
+    {
+    TResourceReader reader;
+    CreateResourceReaderLC(reader, aResourceId);
+
+    TInt count = reader.ReadInt16();
+    HUI_DEBUG2(_L("CHuiEnv::LoadBitmapsL() - Registering %i bitmaps from resource id %i to the texture manager."), count, aResourceId);
+
+    TInt i = 0;
+    CHuiTextureManager & manager = TextureManager();
+    for(i = 0; i < count; ++i)
+        {
+        TInt id = reader.ReadInt32();
+        TPtrC fileName = reader.ReadTPtrC();
+        HUI_DEBUG2(_L("CHuiEnv::LoadBitmapsL() - Bitmap id %i: \"%S\""), id, &fileName);
+        manager.DefineFileNameL(id, fileName);
+        }
+
+    CleanupStack::PopAndDestroy(); // reader
+    }
+
+
+EXPORT_C CHuiControlGroup& CHuiEnv::ControlGroup(TInt aResourceId)
+    {
+    for(TInt i = 0; i < iLoadedGroups.Count(); ++i)
+        {
+        if(iLoadedGroups[i]->ResourceId() == aResourceId)
+            {
+            return *iLoadedGroups[i];
+            }
+        }
+
+    // Group hasn't been loaded yet
+    /** @todo load automatically? */
+    THuiPanic::Panic(THuiPanic::EInternal);
+    return *iLoadedGroups[0];
+    }
+
+
+EXPORT_C CHuiControl* CHuiEnv::FindControl(TInt aId) const
+    {
+    for(TInt i = 0; i < iLoadedGroups.Count(); ++i)
+        {
+        CHuiControl* control = iLoadedGroups[i]->FindControl(aId);
+        if(control)
+            {
+            return control;
+            }
+        }
+    // The control does not exist.
+    return NULL;
+    }
+
+
+EXPORT_C CHuiVisualFactory& CHuiEnv::VisualFactory() const
+    {
+    return *iVisualFactory;
+    }
+
+
+EXPORT_C CHuiTextureManager& CHuiEnv::TextureManager() const
+    {
+    return *iTextureManager;
+    }
+
+
+EXPORT_C THuiFontManager& CHuiEnv::FontManager() const
+    {
+    return *iFontManager;
+    }
+
+
+EXPORT_C CHuiTextStyleManager& CHuiEnv::TextStyleManager() const
+    {
+    return *iTextStyleManager;
+    }
+
+
+EXPORT_C CHuiSkin& CHuiEnv::Skin() const
+    {
+    return *iSkin;
+    }
+
+
+EXPORT_C void CHuiEnv::NotifySkinChangedL()
+    {
+    ReportAction(THuiActionCommand(KAknsMessageSkinChange));
+    for(TInt i = 0; i < iDisplays.Count(); ++i)
+        {
+        iDisplays[i]->RosterImpl().NotifySkinChangedL();
+        }
+    iTextureManager->NotifySkinChangedL();
+    }
+
+
+EXPORT_C TInt CHuiEnv::Send(const THuiCommand& aCommand, TInt aDelayMilliSeconds)
+    {
+    TRAPD(err, SendL(aCommand, aDelayMilliSeconds));
+    if(err != KErrNone)
+        {
+        HUI_DEBUG1(_L("CHuiEnv::Send() - Leave %i while posting command."), err);
+        }
+    return err;
+    }
+
+
+EXPORT_C void CHuiEnv::SendL(const THuiCommand& aCommand, TInt aDelayMilliSeconds)
+    {
+    ContinueRefresh();
+    iScheduler->PostCommandL(aCommand, aDelayMilliSeconds);
+    }
+
+
+EXPORT_C void CHuiEnv::CancelCommands(TAny* aObject)
+    {
+    if (iScheduler)
+        {
+        iScheduler->CancelCommands(aObject);
+        }
+    }
+
+
+EXPORT_C void CHuiEnv::CancelCommands(MHuiEventHandler* aObject)
+    {
+    if (iScheduler)
+        {
+        iScheduler->CancelCommands(aObject);
+        }
+    }
+
+
+EXPORT_C void CHuiEnv::CancelCommands(TAny* aObject,
+                                      THuiOp aCommandOperation)
+    {
+    if (iScheduler)
+        {
+        iScheduler->CancelCommands(aObject, aCommandOperation);
+        }
+    }
+
+
+EXPORT_C void CHuiEnv::CancelCommands(TAny* aObject,
+                                      THuiCommandType aCommandType,
+                                      TInt aParam)
+    {
+    if (iScheduler)
+        {
+        iScheduler->CancelCommands(aObject, aCommandType, aParam);
+        }
+    }
+
+
+EXPORT_C TInt CHuiEnv::TimeUntilCommand(TAny* aObject,
+                                        THuiCommandType aCommandType)
+    {
+    return iScheduler->TimeUntilCommand(aObject, aCommandType);
+    }
+
+
+void CHuiEnv::TextureLoadingCompleted(CHuiTexture& /*aTexture*/,
+                                    TInt /*aTextureId*/,
+                                    TInt /*aErrorCode*/)
+    {
+    // Texture changed flag has been set, visuals should redraw
+    // changed textures automatically.
+    }
+
+
+void CHuiEnv::TextureManagerStateChanged(const CHuiTextureManager& aManager)
+    {
+    if(aManager.State() == CHuiTextureManager::EIdle)
+        {
+        StartRefresh(iRefreshIntervalTarget);
+        }
+    else if (!iMaxCPUUtilization)  
+        { // only use busy refresh interwall if adaptive scheduling is not enabled
+        StartRefresh(KHuiEnvDefaultBusyRefreshIntervalMs);
+        }
+    else
+        {
+        // for PC lint
+        }
+    }
+
+
+EXPORT_C CHuiDisplay& CHuiEnv::PrimaryDisplay() const
+    {
+    return *iDisplays[0];
+    }
+
+
+EXPORT_C CHuiDisplay& CHuiEnv::Display(TInt aIndex) const
+    {
+    return *iDisplays[aIndex];
+    }
+
+
+EXPORT_C void CHuiEnv::Release()
+    {
+    if(iState == ENormal)
+        {
+        HUI_DEBUG(_L("CHuiEnv::Release() - Switching to background!"));
+        
+        ReportAction(THuiActionCommand(KHuiEnvReleasedActionId));
+        
+        // Pause refresh.
+        PauseRefresh();
+
+        // Release the displays.
+        for(TInt i = 0; i < iDisplays.Count(); ++i)
+            {
+            iDisplays[i]->Release();
+            }
+
+        // Release the texture manager.
+        TBool allTexturesReleased = iTextureManager->Release();
+
+        // Release the rendering plugin only if all the textures are released.
+        if ( allTexturesReleased )
+            {
+            HUI_DEBUG(_L("CHuiEnv::Release() - All textures released - releasing renderer"));
+            iRenderer->Release();
+            }
+        if (iEffectsEngine)
+            {
+            iEffectsEngine->Release();
+            }
+        
+        // Finally set the new state.
+        iState = EReleased;        
+        }
+    }
+
+
+EXPORT_C void CHuiEnv::RestoreL()
+    {
+    if(iState == EReleased)
+        {
+        HUI_DEBUG(_L("CHuiEnv::RestoreL() - Coming back to foreground!"));
+
+        // Restore the renderer plugin.
+        iRenderer->RestoreL();
+
+        // Restore the texture manager.
+        iTextureManager->RestoreL();
+        if (iEffectsEngine)
+            {
+            iEffectsEngine->RestoreL();
+            }
+
+        HUI_DEBUG(_L("CHuiEnv::RestoreL() - Restoring displays.."));
+
+        // Restore the displays.
+        for(TInt i = 0; i < iDisplays.Count(); ++i)
+            {
+            iDisplays[i]->RestoreL();
+            }
+
+        // Set the state to normal
+        iState = ENormal;
+
+        ReportAction(THuiActionCommand(KHuiEnvRestoredActionId));
+
+        // Continue refresh.
+        ContinueRefresh();
+
+        HUI_DEBUG(_L("CHuiEnv::RestoreL() - Environment restored!"));
+        }
+    }
+
+EXPORT_C void CHuiEnv::SetMaxCpuTime(TUint aPercent)
+    {
+    aPercent = aPercent; // to avoid warnings
+#ifndef SYMBIAN_BUILD_GCE
+    iMaxCPUUtilization = (aPercent < KHuiEnvMaxCpuTime?aPercent:KHuiEnvMaxCpuTime); // Min does not work
+#endif
+    }
+
+// Forward the respective RnD feature flag to respective components, here to TextureManager
+EXPORT_C void CHuiEnv::EnableDebugFlag( TUint aRndFlag )
+	{	
+	iTextureManager->EnableTexMemoryCalculation( aRndFlag&KRndTexMemCalcFlag );
+	}
+
+CHuiScheduler& CHuiEnv::Scheduler()
+    {
+    return *iScheduler;
+    }
+
+
+TInt CHuiEnv::ReportAction(const THuiActionCommand& aCommand)
+    {
+    TInt resultError = KErrNone;
+
+    for(TInt i = 0; i < iActionObservers.Count(); ++i)
+        {
+        TRAPD(err, iActionObservers[i].HandleActionL(aCommand));
+        if(err != KErrNone && resultError == KErrNone)
+            {
+            // The first error code is returned.
+            resultError = err;
+            }
+        }
+    return resultError;
+    }
+    
+
+RPointerArray<CHuiDisplay> CHuiEnv::Displays() const
+    {
+    return iDisplays;
+    }
+
+
+EXPORT_C TInt& CHuiEnv::GlesRefCounter()
+   	{
+   	return iGlesRefCounter;
+   	}
+   	
+EXPORT_C CHuiEnv* CHuiEnv::Static()
+    {
+    return &(CHuiStatic::Env());
+    }
+
+EXPORT_C  CHuiThemeManager& CHuiEnv::ThemeManager() const
+    {
+    return *iThemeManager;   
+    }
+
+EXPORT_C void CHuiEnv::SetFPSCounterThreshold(TUint aMilliseconds)
+    {
+    if (aMilliseconds > 0)
+        {
+        iFpsCounterThreshold = aMilliseconds;
+        }
+    else
+        {
+        iFpsCounterThreshold = 0;
+        }
+    
+    iFrames = 0;
+    iMillisecondFromFPSUpdate = 0;
+    }
+
+void CHuiEnv::SetTimeFromLastUpdate(TUint aTimeFromLastUpdate)
+    {
+    iRefreshIntervalReal = aTimeFromLastUpdate;
+    }
+
+
+CHuiDisplay* CHuiEnv::CurrentDisplay() const
+    {
+    return iCurrentDisplay;    
+    }
+
+EXPORT_C void CHuiEnv::ChangeRefreshLoopPriority(CActive::TPriority aPriority)
+    {
+    iRefreshLoopPriority = aPriority;
+    if (iPeriodic)
+        {
+        TBool wasActive = (iPeriodic->IsActive() || iRefreshLoopActive);
+        StopRefresh();
+        delete iPeriodic;
+        iPeriodic = 0;
+        iRefreshLoopActive = EFalse;
+        if (wasActive)
+            {
+            StartRefresh(iRefreshIntervalTarget);
+            }
+        }
+    }
+
+TBool CHuiEnv::CPUTimeSupported()
+    {
+    TTimeIntervalMicroSeconds time;
+    TInt err = RThread().GetCpuTime(time);
+    
+    if (err == KErrNone && time.Int64() > 0)
+        {
+        return ETrue;    
+        }        
+    else
+        {
+        return EFalse;    
+        }        
+    }
+    
+TBool CHuiEnv::OpenHandleToIdleCPUValueThread()
+    {
+    // find the kernel process and then the null thread
+    TFindProcess fp(_L("ekern.exe*"));
+    
+    TFullName kernelName;
+    if (fp.Next(kernelName) == KErrNone)
+        {
+        // process found, append null thread identifier
+        kernelName.Append(_L("::Null"));
+        
+        // find the thread
+        TFindThread ft(kernelName);
+
+        TFullName threadName;
+        if (ft.Next(threadName) == KErrNone)
+            {
+            // open instance to the thread
+            if (iIdleCPUValueThread.Open(threadName) != KErrNone)
+                {
+                return EFalse;                    
+                }                
+            }
+        }        
+    else
+        {
+        // process not found
+        return EFalse;    
+        }        
+    
+    // success!
+    return ETrue;        
+    }
+
+void CHuiEnv::CloseHandleToIdleCPUValueThread()
+    {
+    iIdleCPUValueThread.Close();
+    }
+
+CHuiCanvasTextureCache& CHuiEnv::CanvasTextureCache() const
+    {
+    return *iCanvasTextureCache;    
+    }
+
+EXPORT_C CHuiFxEngine* CHuiEnv::EffectsEngine() const
+    {
+    return iEffectsEngine;
+    }
+
+EXPORT_C void CHuiEnv::AddLowMemoryObserver(MHuiLowMemoryObserver * aObserver)
+    {
+    iLowMemoryObservers.Append(aObserver);
+    }
+
+EXPORT_C void CHuiEnv::RemoveLowMemoryObserver(MHuiLowMemoryObserver * aObserver)
+    {
+    TInt index = iLowMemoryObservers.Find(aObserver); 
+    if(index != KErrNotFound)
+        {
+        iLowMemoryObservers.Remove(index);
+        }    
+    }
+
+EXPORT_C void CHuiEnv::NotifyLowMemory(TBool /*aEnable*/)
+    {
+    //deprecated
+    }
+
+
+EXPORT_C void CHuiEnv::AddMemoryLevelObserver(MHuiMemoryLevelObserver * aObserver)
+    {
+    iMemoryLevelObservers.Append(aObserver);
+    }
+
+EXPORT_C void CHuiEnv::RemoveMemoryLevelObserver(MHuiMemoryLevelObserver * aObserver)
+    {
+    TInt index = iMemoryLevelObservers.Find(aObserver); 
+    if(index != KErrNotFound)
+        {
+        iMemoryLevelObservers.Remove(index);
+        }    
+    }
+
+EXPORT_C void CHuiEnv::NotifyMemoryLevel(THuiMemoryLevel aMemoryLevel)
+    {
+    iMemoryLevel = aMemoryLevel;
+    
+    // notify all observers
+    for(TInt i=0; i<iMemoryLevelObservers.Count(); i++)
+        {
+        iMemoryLevelObservers[i]->SetMemoryLevel(aMemoryLevel);
+        }
+    }
+
+EXPORT_C THuiMemoryLevel CHuiEnv::MemoryLevel()
+    {
+    return iMemoryLevel;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiEnv_stubs.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,557 @@
+/*
+* 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: 
+*
+*/
+
+#include <eikenv.h>
+#include <bautils.h>
+#include <coemain.h>
+#include <w32std.h>
+#include <gdi.h>
+#include <e32math.h>
+
+#include "uiacceltk/huiEnv.h"  // Class definition
+#include <ecom/implementationinformation.h>
+#include "huirenderplugin.h"
+#include "uiacceltk/huiStatic.h"
+#include "alf/alfconstants.h"
+#include "huirendersurface.h"
+#include "uiacceltk/huiDisplay.h"
+#include "huirosterimpl.h"
+#include "uiacceltk/huiScheduler.h"
+#include "uiacceltk/huiTextureManager.h"
+#include "uiacceltk/huiControlGroup.h"
+#include "huivisualfactory.h"
+#include "uiacceltk/huiS60Skin.h"
+#include "uiacceltk/huiEvent.h"
+#include "uiacceltk/huiRoster.h"
+#include "uiacceltk/huiUtil.h"
+#include "uiacceltk/huipanic.h"
+#include "uiacceltk/huiTextStyleManager.h"
+#include "huistatictlsdata.h"
+#include "uiacceltk/HuiThemeManager.h"
+
+
+/* Constants */
+const TInt KHuiEnvDefaultNormalRefreshIntervalMs = 40;
+
+/* If there is idle between frames, this is how much we can use as overdrive max cpu utilisation */
+const TUint KHuiEnvMaxCpuTimeOverdriveMaxValue = 100;
+
+/* If max cpu usage has been set below this value, overdrive is not used because there is probaply a good reson 
+for a low max cpu usage value */
+const TUint KHuiEnvMaxCpuTimeOverdriveLowerThreshold = 50;
+
+// @todo: this should be obsolete once scheduling can adapt to CPU load
+const TInt KHuiEnvDefaultBusyRefreshIntervalMs = 2 * KHuiEnvDefaultNormalRefreshIntervalMs;
+
+/** Threshold number for refreshes that don't have any effect. When exceeded,
+    refresh is paused. */
+const TInt KIdleRefreshCountThreshold = 3;
+
+
+// to get around nasty ownership problem with texture manager interface
+void NullTextureManagerPtr(TAny* aPtrToPtr)
+    {
+    if (aPtrToPtr)
+        {
+        CHuiTextureManager** ptr = (CHuiTextureManager**)aPtrToPtr;
+        *ptr = 0;
+        }
+    }
+
+
+void CHuiEnv::SetTextureManager(CHuiTextureManager& aManager)
+    {
+    iTextureManager = &aManager;
+    }
+
+
+
+void CHuiEnv::StopRefresh()
+    {
+    HUI_DEBUG(_L("CHuiEnv::StopRefresh()"));
+    if(iPeriodic)
+        {
+        iPeriodic->Cancel();
+        }
+    }
+
+void CHuiEnv::RemoveDisplay(CHuiDisplay& aDisplay)
+    {
+    // Actually this is "DestroyDisplay"
+
+    /** @todo  Make a proper observer. */
+    TInt index = iDisplays.Find(&aDisplay);
+    if(index >= 0)
+        {
+        iDisplays.Remove(index);
+        }
+    else
+        {
+        HUI_DEBUG1(_L("HuiEnv::DestroyContext: display %x not in array"), &aDisplay);
+        }
+    index = iOverlaidDisplays.Find(&aDisplay);
+    if(index >= 0)
+        {
+        iOverlaidDisplays.Remove(index);
+        }
+
+    // Notify the current renderer of the changed number of displays
+    TRAP_IGNORE(iRenderer->NotifyDisplayCountL(iDisplays.Count()))
+
+#ifdef _DEBUG
+    HUI_DEBUG(_L("  Contents of iDisplays:"));
+    for(TInt i = 0; i < iDisplays.Count(); ++i)
+        {
+        HUI_DEBUG2(_L("  %i: %x"), i, iDisplays[i]);
+        }
+#endif
+    }
+
+
+void CHuiEnv::AdvanceTime(TReal32 aElapsedTime)
+    {
+    HUI_DEBUGF( _L("CHuiEnv::AdvanceTime() - Started") )
+
+    TUint usedMaxCPUUtilization = iMaxCPUUtilization;
+
+    // Calculate cpu values based on null thread cpu usage between frames. 
+    // Values will be updated at the end of the frame.
+    if (iIdleCPUValueMonitored)
+        {
+        TTime currentTime;
+        currentTime.HomeTime();
+
+        TTimeIntervalMicroSeconds cputime;
+        iIdleCPUValueThread.GetCpuTime(cputime);
+
+        TInt64 cpudelta = cputime.Int64() - iIdleCPUValue;
+        TInt64 timedelta = currentTime.Int64() - iIdleCPUValuePreviousTime;
+
+        // If null thread was runnign between frames, we could use more cpu if needed.
+        if (cpudelta && timedelta)
+            {
+            // Calculate how much we want !
+            if (iMaxCPUUtilization > KHuiEnvMaxCpuTimeOverdriveLowerThreshold &&
+                iMaxCPUUtilization < KHuiEnvMaxCpuTimeOverdriveMaxValue )
+                {
+                usedMaxCPUUtilization += (KHuiEnvMaxCpuTimeOverdriveMaxValue - iMaxCPUUtilization) * cpudelta/timedelta;
+                
+                // Sanity check just in case cpu/time measurements are not accurate
+                if (usedMaxCPUUtilization > KHuiEnvMaxCpuTimeOverdriveMaxValue)
+                    {
+                    usedMaxCPUUtilization = KHuiEnvMaxCpuTimeOverdriveMaxValue;   
+                    }                
+                }
+            }
+        }
+
+    if(aElapsedTime > 0)
+        {
+        // Let the scheduler know that time has passed. It will possible animate
+        // visuals and perform actions, causing dirty regions in the display.
+        iScheduler->AdvanceTime(aElapsedTime);
+
+        // Scheduled command might have released the environment.
+        if(iState == EReleased)
+            {
+            HUI_DEBUG(_L("CHuiEnv::AdvanceTime() - Environment released when executing scheduled commands. AdvanceTime cancelled."));
+            return;
+            }
+
+        // Let the texture manager know that time has passed. It will update any
+        // animated textures.
+        iTextureManager->AdvanceTime(aElapsedTime);                
+        }
+
+    // Check for no input for long time.
+    TTime now = CHuiStatic::Time();
+    TTimeIntervalSeconds seconds = 0;
+    now.SecondsFrom(iLastInputTime, seconds);
+    if(seconds.Int() >= iIdleThreshold && !iInputIdleIsActive)
+        {
+        HUI_DEBUG1(_L("CHuiEnv::AdvanceTime() - No input received within %i seconds. Going to idle."), iIdleThreshold);
+        iInputIdleIsActive = ETrue;
+        
+        // Idle state begins.
+        TRAPD(err, SendIdleL(ETrue));
+        if(err != KErrNone)
+            {
+            // @todo  Log error?
+            }
+            
+        // Switching to idle state might have released the environment.
+        if(iState == EReleased)
+            {
+            HUI_DEBUG(_L("CHuiEnv::AdvanceTime() - Environment released when switching to idle state. AdvanceTime cancelled."));
+            return;
+            }            
+        }
+
+    TBool somethingUpdated = EFalse;
+
+    // Refresh all displays.
+    TInt i;
+    const TInt displayCount = iDisplays.Count();
+    RArray<TBool> displayRefreshed( displayCount ? displayCount : 1 );
+    for(i = 0; i < iDisplays.Count(); ++i)
+        {
+        displayRefreshed.Append(EFalse);
+        if(iRefreshMode == EHuiRefreshModeForced || iDisplays[i]->IsDirty())
+            {
+            MakeCurrent(*iDisplays[i]);
+
+            HUI_DEBUGF1( _L("CHuiEnv::AdvanceTime() - Refreshing display %i"), i )
+            TBool updated = iDisplays[i]->Refresh();
+            displayRefreshed[i] = updated;
+            if(updated)
+                {
+                somethingUpdated = ETrue;
+                }
+            }
+        }
+    
+    TBool continueRefresh = ETrue;
+
+    if(somethingUpdated)
+        {
+        HUI_DEBUGF( _L("CHuiEnv::AdvanceTime() - Swap buffers") )
+
+        SwapBuffers(displayRefreshed);
+        iIdleRefreshCount = 0;
+        // Clear change flags now that the frames are complete.
+        for(i = 0; i < iDisplays.Count(); ++i)
+            {
+            // Clear changed for an off screen display only if the buffer has new content.
+            // Index is ok becacause displayRefreshed array was defined using size of iDisplays array
+            if (displayRefreshed[i])
+            	{
+            	iDisplays[i]->ClearChanged();
+            	}
+            }
+        }
+    else if(iScheduler->PendingCount() == 0)
+        {
+        // But if there are scheduled commands, let's make sure they'll get
+        // executed at the right time. They might get badly delayed if the
+        // refresh wasn't occuring.
+
+        /** @todo  Use a separate timer for the scheduler? */
+
+        // Nothing happened during the display refreshing.
+        iIdleRefreshCount++;
+
+        // If this occurs too often, pause refresh automatically.
+        if(iIdleRefreshCount > KIdleRefreshCountThreshold)
+            {
+            if (iFpsCounterThreshold && iMillisecondFromFPSUpdate && iFrames)
+                {
+                TBuf<16> numBuf;
+                TReal fps = 1000*(TReal)iFrames/iMillisecondFromFPSUpdate;
+                numBuf.AppendNum(fps, TRealFormat(5,2));
+                User::InfoPrint(numBuf);
+                iFrames = 0;
+                iMillisecondFromFPSUpdate = 0;
+                }
+
+            PauseRefresh();
+            continueRefresh = EFalse;
+            }
+        }
+    else
+        {
+        // for PC lint
+        }
+
+	displayRefreshed.Close(); // Not needed any more
+
+    // Clear change flags of all control groups now that the refresh has
+    // been completed for all displays.
+    //
+    // DEPRECATE:
+    // This should be removed when control opacities are deprecated! 
+    // Controls shouldn't need change flags because change flags are 
+    // only for the refresh.
+    //
+    for(i = 0; i < iLoadedGroups.Count(); ++i)
+        {
+        iLoadedGroups[i]->ClearChanged();
+        }
+
+    iTextureManager->ClearChangedTextures();
+
+    if (continueRefresh)
+        {
+        // Refresh rate adjustment
+        if (usedMaxCPUUtilization)
+            {
+            TUint millisecondsUsedInRefresh = CHuiStatic::MilliSecondsSinceUpdateTime();
+
+            TUint totalLoopTime = (millisecondsUsedInRefresh * 100) / usedMaxCPUUtilization;
+    
+            if (totalLoopTime >= iRefreshIntervalTarget)
+                {
+                iRefreshInterval = (millisecondsUsedInRefresh*(100-usedMaxCPUUtilization))/usedMaxCPUUtilization;
+                StartRefresh(iRefreshInterval);        
+                }
+            else if (iRefreshIntervalTarget != iRefreshInterval)
+                {
+                iRefreshInterval = iRefreshIntervalTarget; 
+                StartRefresh(iRefreshInterval);
+                }
+            else
+                {
+                // otherwise just let the periodic run as it already has good interval set
+                }
+            }
+
+        if (iFpsCounterThreshold && iMillisecondFromFPSUpdate > iFpsCounterThreshold)
+            {
+            TBuf<16> numBuf;
+            TReal fps = 1000*(TReal)iFrames/iMillisecondFromFPSUpdate;
+            numBuf.AppendNum(fps, TRealFormat(5,2));
+            User::InfoPrint(numBuf);
+            iFrames = 0;
+            iMillisecondFromFPSUpdate = 0;
+            }
+        }
+
+    iCurrentDisplay = NULL; // informs the egosystem that the drawing is done.
+    CHuiStatic::ReportNewFrame();
+    
+    // Store cpu value conters of null thread. Values will be used at the start of the next frame.
+    if (iIdleCPUValueMonitored)
+        {
+        TTime currentTime;
+        currentTime.HomeTime();
+
+        TTimeIntervalMicroSeconds cputime;
+        iIdleCPUValueThread.GetCpuTime(cputime);
+
+        // Store as previous values
+        iIdleCPUValue = cputime.Int64();
+        iIdleCPUValuePreviousTime = currentTime.Int64();                           
+        }
+            
+    HUI_DEBUGF( _L("CHuiEnv::AdvanceTime() - Exited") );
+    }
+
+void CHuiEnv::NotifyInputReceivedL(const THuiEvent& aEvent)
+    {
+    ContinueRefresh();
+
+    if(aEvent.IsKeyEvent() || aEvent.IsPointerEvent())
+        {
+        if(iInputIdleIsActive)
+            {
+            HUI_DEBUG(_L("CHuiEnv::NotifyInputReceivedL() - Got key/pointer input! Idle state ends!"));
+            // Idle state ends.
+            SendIdleL(EFalse);
+            }
+
+        iLastInputTime = CHuiStatic::Time();
+        iInputIdleIsActive = EFalse;
+        }
+    }
+
+
+void CHuiEnv::SendIdleL(TBool aIdleBegins)
+    {
+    CHuiDisplay* display = NULL;
+    
+    if(iDisplays.Count() != 0)
+        {
+        // If we have any displays, pass the first one.
+        display = iDisplays[0];
+        }
+    
+    THuiEvent idleEvent(display,
+        aIdleBegins ? THuiEvent::ETypeIdleBegin :
+                      THuiEvent::ETypeIdleEnd);
+    BroadcastEventL(idleEvent);
+    }
+
+
+
+void CHuiEnv::MakeCurrent(const CHuiDisplay& aDisplay) const
+    {
+    aDisplay.RenderSurface().MakeCurrent();
+    iCurrentDisplay = const_cast<CHuiDisplay*>(&aDisplay);
+    }
+
+
+void CHuiEnv::SwapBuffers(const RArray<TBool>& aDisplayRefreshed)
+    {
+    /** @todo This may not work as expected when multiple displays are
+        being used. */
+
+    if (iFpsCounterThreshold)
+        {
+        iFrames++;
+        iMillisecondFromFPSUpdate += iRefreshIntervalReal;
+        }    
+
+    /** @todo  Only swap the visible displays. */
+
+    for(TInt i = 0; i < iDisplays.Count(); ++i)
+        {          
+        // Index should ok becacause displayRefreshed array was defined using size of iDisplays array
+        // This function should only be called from inside CHuiEnv even if it is public.
+        // At least it is not exported.
+        if (aDisplayRefreshed[i] 
+            && (iDisplays[i]->DisplayType() != CHuiDisplay::EDisplayOffScreenBuffer)
+            && (iDisplays[i]->ScreenBufferObserver() == NULL))
+        	{
+     		iDisplays[i]->RenderSurface().SwapBuffers();
+        	}
+        }
+    }
+
+
+void CHuiEnv::CreateResourceReaderLC(TResourceReader& aReader, TInt aResourceId) const
+    {
+    CCoeEnv* coe = CCoeEnv::Static();
+    if (!coe)
+    		{
+    		User::Leave(KErrNotSupported);
+    	  }
+    coe->CreateResourceReaderLC(aReader, aResourceId);
+    }
+
+void CHuiEnv::TextureLoadingCompleted(CHuiTexture& /*aTexture*/,
+                                    TInt /*aTextureId*/,
+                                    TInt /*aErrorCode*/)
+    {
+    // Texture changed flag has been set, visuals should redraw
+    // changed textures automatically.
+    }
+
+
+void CHuiEnv::TextureManagerStateChanged(const CHuiTextureManager& aManager)
+    {
+    if(aManager.State() == CHuiTextureManager::EIdle)
+        {
+        StartRefresh(iRefreshIntervalTarget);
+        }
+    else if (!iMaxCPUUtilization)  
+        { // only use busy refresh interwall if adaptive scheduling is not enabled
+        StartRefresh(KHuiEnvDefaultBusyRefreshIntervalMs);
+        }
+    else
+        {
+        // for PC lint
+        }
+    }
+
+CHuiScheduler& CHuiEnv::Scheduler()
+    {
+    return *iScheduler;
+    }
+
+
+TInt CHuiEnv::ReportAction(const THuiActionCommand& aCommand)
+    {
+    TInt resultError = KErrNone;
+
+    for(TInt i = 0; i < iActionObservers.Count(); ++i)
+        {
+        TRAPD(err, iActionObservers[i].HandleActionL(aCommand));
+        if(err != KErrNone && resultError == KErrNone)
+            {
+            // The first error code is returned.
+            resultError = err;
+            }
+        }
+    return resultError;
+    }
+    
+
+RPointerArray<CHuiDisplay> CHuiEnv::Displays() const
+    {
+    return iDisplays;
+    }
+
+
+
+void CHuiEnv::SetTimeFromLastUpdate(TUint aTimeFromLastUpdate)
+    {
+    iRefreshIntervalReal = aTimeFromLastUpdate;
+    }
+
+
+CHuiDisplay* CHuiEnv::CurrentDisplay() const
+    {
+    return iCurrentDisplay;    
+    }
+
+TBool CHuiEnv::CPUTimeSupported()
+    {
+    TTimeIntervalMicroSeconds time;
+    TInt err = RThread().GetCpuTime(time);
+    
+    if (err == KErrNone && time.Int64() > 0)
+        {
+        return ETrue;    
+        }        
+    else
+        {
+        return EFalse;    
+        }        
+    }
+    
+TBool CHuiEnv::OpenHandleToIdleCPUValueThread()
+    {
+    // find the kernel process and then the null thread
+    TFindProcess fp(_L("ekern.exe*"));
+    
+    TFullName kernelName;
+    if (fp.Next(kernelName) == KErrNone)
+        {
+        // process found, append null thread identifier
+        kernelName.Append(_L("::Null"));
+        
+        // find the thread
+        TFindThread ft(kernelName);
+
+        TFullName threadName;
+        if (ft.Next(threadName) == KErrNone)
+            {
+            // open instance to the thread
+            if (iIdleCPUValueThread.Open(threadName) != KErrNone)
+                {
+                return EFalse;                    
+                }                
+            }
+        }        
+    else
+        {
+        // process not found
+        return EFalse;    
+        }        
+    
+    // success!
+    return ETrue;        
+    }
+
+void CHuiEnv::CloseHandleToIdleCPUValueThread()
+    {
+    iIdleCPUValueThread.Close();
+    }
+
+CHuiCanvasTextureCache& CHuiEnv::CanvasTextureCache() const
+    {
+    return *iCanvasTextureCache;    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiEvent.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "uiacceltk/HuiEvent.h"  // Class definition
+
+
+THuiEvent::THuiEvent(CHuiDisplay* aDisplay, TType aType)
+        : iDisplay(aDisplay),
+          iCode(EEventNull),
+          iParam( KErrNotFound),
+          iType(aType),
+          iVisual(0)
+    {
+    }
+
+
+EXPORT_C THuiEvent::THuiEvent(TInt aCustomParam)
+        : iDisplay(0),
+          iCode(EEventNull),
+          iParam(aCustomParam),
+          iType(ETypeCustom),
+          iVisual(0)
+    {
+    }
+
+
+EXPORT_C THuiEvent::THuiEvent(CHuiDisplay* aDisplay, const TPointerEvent& aPointerEvent)
+        : iDisplay(aDisplay),
+          iCode(EEventNull),         
+          iParam( KErrNotFound),
+          iType(ETypePointer),
+          iVisual(0)          
+    {        
+    if ( aPointerEvent.iModifiers &EModifierAdvancedPointerEvent )
+        {
+        iPointerEvent = *aPointerEvent.AdvancedPointerEvent();
+        }
+    else
+        {
+        iPointerEvent.iType=aPointerEvent.iType;       
+        iPointerEvent.iPosition=aPointerEvent.iPosition;
+        iPointerEvent.iParentPosition=aPointerEvent.iParentPosition;
+        }
+    }
+
+
+THuiEvent::THuiEvent(CHuiDisplay* aDisplay,
+                     const TKeyEvent& aKeyEvent,
+                     TEventCode aType)
+        : iDisplay(aDisplay),
+          iCode(aType),
+          iKeyEvent(aKeyEvent),
+          iParam( KErrNotFound ),
+          iType(ETypeKey),
+          iVisual(0)
+    {
+    }
+
+
+
+EXPORT_C THuiEvent::TType THuiEvent::Type() const
+    {
+    return iType;
+    }
+
+
+EXPORT_C TBool THuiEvent::IsCustomEvent() const
+    {
+    return iType == ETypeCustom;
+    }
+
+
+EXPORT_C TBool THuiEvent::IsKeyEvent() const
+    {
+    return iType == ETypeKey;
+    }
+
+
+EXPORT_C TBool THuiEvent::IsPointerEvent() const
+    {
+    return iType == ETypePointer;
+    }
+
+
+EXPORT_C CHuiDisplay& THuiEvent::Display() const
+    {
+    ASSERT( iDisplay );
+    return *iDisplay;
+    }
+
+
+EXPORT_C TBool THuiEvent::PointerDown() const
+    {
+    return iType == ETypePointer &&
+           iPointerEvent.iType == TPointerEvent::EButton1Down;
+    }
+
+
+EXPORT_C TBool THuiEvent::PointerUp() const
+    {
+    return iType == ETypePointer &&
+           iPointerEvent.iType == TPointerEvent::EButton1Up;
+    }
+    
+EXPORT_C TBool THuiEvent::PointerLongTap() const
+    {
+    return iType == ETypePointer &&
+           iPointerEvent.iType == TPointerEvent::EButtonRepeat;
+    }
+
+
+EXPORT_C void THuiEvent::SetVisual(CHuiVisual* aVisual)
+    {
+    iVisual = aVisual;
+    }
+   
+    
+EXPORT_C CHuiVisual* THuiEvent::Visual() const
+    {
+    return iVisual;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFlowLayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,207 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+ 
+#include <AknUtils.h>
+
+#include "uiacceltk/HuiFlowLayout.h"  // Class definition
+#include "uiacceltk/HuiControl.h"
+
+
+EXPORT_C CHuiFlowLayout* CHuiFlowLayout::AddNewL(CHuiControl& aOwnerControl, 
+                                                 TFlowDirection aDirection,
+                                                 CHuiLayout* aParentLayout)
+    {
+    CHuiFlowLayout* flow = STATIC_CAST(CHuiFlowLayout*,
+        aOwnerControl.AppendLayoutL(EHuiLayoutTypeFlow, aParentLayout));
+    flow->SetFlowDirection(aDirection);       
+    return flow;
+    }
+
+
+CHuiFlowLayout::CHuiFlowLayout(MHuiVisualOwner& aOwner)
+        : CHuiLayout(aOwner), iMode(EFlowHorizontal)
+    {
+    }
+
+
+void CHuiFlowLayout::ConstructL()
+    {    
+    CHuiLayout::ConstructL();
+    }
+
+	
+EXPORT_C CHuiFlowLayout::~CHuiFlowLayout()
+    {    
+    }
+
+
+EXPORT_C void CHuiFlowLayout::SetSize(const THuiRealSize& aSize, 
+                                      TInt aTransitionTime)
+    {
+    CHuiLayout::SetSize(aSize, aTransitionTime);
+    UpdateChildrenLayout(aTransitionTime);    
+    }
+
+
+EXPORT_C TBool CHuiFlowLayout::ChildSize(TInt aOrdinal, TSize& aSize)
+    {    
+    TBool result(EFalse);
+    THuiRealRect rect;
+    TInt childRectStatus(THuiLayoutChildRectUpdateNotNeeded);
+    childRectStatus = ChildRect(aOrdinal, rect);
+    if(childRectStatus != THuiLayoutChildRectNotImplemented)
+        {
+        result = (childRectStatus & THuiLayoutChildRectSizeUpdateNeeded);
+        if(result)
+            {
+            THuiRealPoint size(rect.Width(), rect.Height());
+            aSize = LocalPointInPixels(size).AsSize();
+            }
+        }
+    return result;        
+    }
+    
+    
+EXPORT_C TBool CHuiFlowLayout::ChildPos(TInt aOrdinal, TPoint& aPos)
+    {
+    TBool result(EFalse);
+    THuiRealRect rect;
+    TInt childRectStatus(THuiLayoutChildRectUpdateNotNeeded);
+    childRectStatus = ChildRect(aOrdinal, rect);
+    if(childRectStatus != THuiLayoutChildRectNotImplemented)
+        {
+        result = (childRectStatus & THuiLayoutChildRectPosUpdateNeeded);
+        if(result)
+            {
+            aPos = LocalPointInPixels(rect.iTl);
+            }
+        }
+    return result;   
+    }
+
+EXPORT_C TInt CHuiFlowLayout::ChildRect(TInt aOrdinal, THuiRealRect& aRect)
+    {    
+    THuiRealPoint childTopLeft;    
+    THuiRealSize childSize = Visual(aOrdinal).Size().RealTarget().AsSize();
+    THuiRealSize parentSize = InnerSize();
+    TReal32 horizDirection = 1.0;
+    
+    // By default, flow layout modifies only positions of the children
+    TInt ret = THuiLayoutChildRectPosUpdateNeeded;
+    
+    // Adjust the child size if perpendicular fit is specified
+    if(iMode & EModeFitPerpendicular)
+        {
+        // Expand the child's size to fit the layout rectangle along
+        // the minor axis.        
+        if(iDirection == EFlowVertical)
+            {
+            childSize.iWidth = parentSize.iWidth;
+            }
+        else
+            {
+            childSize.iHeight = parentSize.iHeight;
+            }                                
+        // Modify also the size of the child.        
+        ret |= THuiLayoutChildRectSizeUpdateNeeded;
+        }      
+    
+    // Center the child perpendicular to the flow direction
+    if(iMode & EModeCenterPerpendicular)
+        {
+        if(iDirection == EFlowHorizontal)
+            {            
+            childTopLeft.iY = parentSize.iHeight/2 - childSize.iHeight/2;
+            }
+        else
+            {
+            childTopLeft.iX = parentSize.iWidth/2 - childSize.iWidth/2;
+            }
+        }
+        
+    // Apply parent padding
+    THuiRealPoint topLeft = InnerTopLeft();
+    childTopLeft += topLeft;
+
+    // Iterate through previous children and add their width or height along with
+    // inner padding to the position.
+    THuiRealPoint innerPadding = InnerPaddingInBaseUnits();
+    for(TInt i = 0; i < aOrdinal; ++i)
+        {
+        if(!(Visual(i).Flags() & EHuiVisualFlagManualPosition))
+            {
+            // Take child visual into calculations unless it is manually positioned.
+            THuiRealSize size = Visual(i).Size().RealTarget().AsSize();
+            
+            if(iDirection == EFlowHorizontal)
+                {
+                size.iWidth += innerPadding.iX;
+                childTopLeft.iX += horizDirection * size.iWidth;
+                }
+            else
+                {
+                size.iHeight += innerPadding.iY;
+                childTopLeft.iY += size.iHeight;
+                }            
+            }
+        }      
+    
+    // Compose the final child rectangle    
+    aRect = THuiRealRect(childTopLeft, childSize);
+    
+    // Return the bitmask of modified components
+    return ret;
+    }
+
+
+EXPORT_C void CHuiFlowLayout::SetFlowDirection(TFlowDirection aDirection)
+    {
+    if(iDirection != aDirection)
+        {
+        iDirection = aDirection;
+        SetChanged();        
+        }
+    }
+
+
+EXPORT_C void CHuiFlowLayout::SetCentering(TBool aCentering)
+    {
+    if(aCentering)
+        {
+        iMode |= EModeCenterPerpendicular;
+        }
+    else
+        {
+        iMode &= ~EModeCenterPerpendicular;
+        }
+    SetChanged();        
+    }
+
+
+EXPORT_C void CHuiFlowLayout::SetMode(TInt aMode)
+    {
+    iMode = aMode;
+    SetChanged();
+    }
+
+
+EXPORT_C TInt CHuiFlowLayout::Mode() const
+    {
+    return iMode;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFont.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,318 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   THuiFont implementation
+*
+*/
+
+
+
+#include <coemain.h>
+#include <w32std.h>
+#include <AknBidiTextUtils.h>
+#include <AknFontAccess.h>
+#include <AknLayoutFont.h>
+
+#include "uiacceltk/HuiFont.h"
+#include "uiacceltk/HuiUtil.h"
+
+const TInt KHuiFontVerticalShiftInPixels = 1;
+
+/**
+ * Structure containing Symbian Font instance and reference count.
+ */
+NONSHARABLE_STRUCT( THuiFont::TFontRef )
+    {
+    /**
+     * Constructor. Initializes both member variables to zero.
+     */
+    inline TFontRef();
+
+    /** Symbian Font instance. */
+    CFont* iFontInstance;
+    /** Reference count */
+    TInt iRefCount;
+    };
+
+EXPORT_C THuiFont::THuiFont(TInt aId, const TFontSpec& aFontSpec)
+        : iId(aId), iFontSpec(aFontSpec), iFont(NULL), iTextPaneHeight(0), iCategory(EAknFontCategoryUndefined)
+    {
+    }
+
+EXPORT_C THuiFont::THuiFont()
+		: iId(0), iFont(NULL), iTextPaneHeight(0), iCategory(EAknFontCategoryUndefined)
+	{
+	}
+     
+EXPORT_C THuiFont::~THuiFont()
+    {
+	ReleaseFont();
+	iFont = NULL;
+    }
+
+EXPORT_C THuiFont::THuiFont( const THuiFont& aFont )
+    : iId( aFont.iId ), iFontSpec( aFont.iFontSpec ), iFont( aFont.iFont ), 
+      iTextPaneHeight( aFont.iTextPaneHeight ), iCategory( aFont.iCategory )  
+    {
+    if ( iFont )
+        {
+        iFont->iRefCount++;
+        }
+    }
+            
+EXPORT_C THuiFont& THuiFont::operator=( const THuiFont& aFont )
+    {
+    if ( this == &aFont )
+        {
+        return *this;
+        }
+        
+    ReleaseFont();
+        
+    iId = aFont.iId;
+    iFontSpec = aFont.iFontSpec;
+    iFont = aFont.iFont;
+    if ( iFont )
+        {
+        iFont->iRefCount++;
+        }
+
+    iTextPaneHeight = aFont.iTextPaneHeight;
+    iCategory = aFont.iCategory;
+    return *this;
+    }
+
+
+EXPORT_C TInt THuiFont::Id() const
+    {
+    return iId;
+    }
+
+
+EXPORT_C TAknFontCategory THuiFont::Category() const
+    {
+    return iCategory;
+    }
+
+
+EXPORT_C void THuiFont::SetCategory(const TAknFontCategory aCategory)
+    {
+    iCategory = aCategory;
+    ReleaseFont();
+    }
+
+EXPORT_C TInt THuiFont::TextPaneHeight() const
+    {
+    return iTextPaneHeight;
+    }
+
+EXPORT_C void THuiFont::SetTextPaneHeight(TInt aTextPaneHeight)
+    {
+    iTextPaneHeight = aTextPaneHeight;
+    ReleaseFont();
+    }
+
+EXPORT_C void THuiFont::SetFontSpec(const TFontSpec& aFontSpec)
+    {
+    iFontSpec = aFontSpec;
+    ReleaseFont();
+    }
+
+
+EXPORT_C TFontSpec THuiFont::FontSpec(MGraphicsDeviceMap* /*aMap*/) const
+    {
+    // @Todo need to implement the zooming here
+    return iFontSpec;
+    }
+
+
+EXPORT_C CFont* THuiFont::NearestFontL(TReal32 aTextMeshYScale) __SOFTFP
+	{
+    /// @todo  Accessing the screen device during a display resizing event may
+    ///        result in a font that is suitable for the display size that
+    ///        was in use prior to the resize. Probably we should use
+    ///        AknLayoutUtils here.
+
+    if(!iFont)
+	    {
+        CWsScreenDevice* screenDev = 0;    
+        if (CCoeEnv::Static())
+            {
+            screenDev = CCoeEnv::Static()->ScreenDevice();
+            }
+        else
+            {
+            screenDev = CHuiStatic::ScreenDevice();
+            }
+	    User::LeaveIfNull(screenDev);
+	    
+        TFontSpec spec = iFontSpec;
+                   
+        if(aTextMeshYScale != 1)
+            {
+            spec.iHeight = HUI_ROUND_FLOAT_TO_INT( TReal32(iFontSpec.iHeight) * aTextMeshYScale );
+            }
+
+        TFontRef* font = new (ELeave) TFontRef;
+        CleanupStack::PushL( font );
+        font->iRefCount++;
+        
+        if (!CCoeEnv::Static())
+             {
+             _LIT(KS60Digital, "Series 60 ZDigi"); // we assume that only FPS counter uses texts inside hui
+             spec = TFontSpec(KS60Digital, 150);         
+             User::LeaveIfError( screenDev->GetNearestFontInTwips(font->iFontInstance, spec) );
+             iTextPaneHeight = screenDev->VerticalTwipsToPixels(spec.iHeight);
+             }
+        else
+            {
+            TAknFontSpecification aknFs(Category(), spec, screenDev);
+            aknFs.SetTextPaneHeight( screenDev->VerticalTwipsToPixels(spec.iHeight));
+            aknFs.SetTextPaneHeightIsDesignHeight( ETrue );
+            font->iFontInstance = 
+                AknFontAccess::CreateLayoutFontFromSpecificationL( 
+                        *screenDev, 
+                        spec.iTypeface,
+                        aknFs );
+            }    
+        CleanupStack::Pop( font );
+        iFont = font;
+		}
+    return iFont->iFontInstance;
+	}
+
+
+EXPORT_C void THuiFont::RasterizeLineL(const TDesC& aTextString, CFbsBitGc& aTargetContext)
+	{
+    // Retrieve the CFont object used when rasterizing this text mesh.
+    CFont* font = NearestFontL();
+
+    // Draw the text
+    aTargetContext.UseFont(font);
+    
+    TInt avkonMaxAscent = 0;
+    if (CCoeEnv::Static())
+        {
+        const CAknLayoutFont* layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( font );
+        avkonMaxAscent = layoutFont->MaxAscent() + KHuiFontVerticalShiftInPixels;
+        }
+    else
+        {
+        avkonMaxAscent = iTextPaneHeight; 
+        }
+    aTargetContext.DrawText(aTextString, TPoint(0,  avkonMaxAscent ));
+    aTargetContext.DiscardFont();
+	}
+
+EXPORT_C TSize THuiFont::LineExtentsL(const TDesC& aTextString)
+	{
+	if (aTextString.Length() == 0)
+    	{
+    	// Zero length strings have extents of zero.
+        return TSize(0, 0);
+    	}
+	
+    // Retrieve the CFont object used when rasterizing this text mesh.
+	CFont* font = NearestFontL();
+    TSize textSize( MeasureBidiTextBoundsWidth(*font, aTextString, CFont::TMeasureTextInput::EFVisualOrder), 
+                    font->FontMaxHeight());
+    
+    const CAknLayoutFont* layoutFont = 0;
+    if (CCoeEnv::Static())
+        {
+        layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( font );
+        }
+    
+    if ( layoutFont )
+        {
+        textSize.iHeight = font->HeightInPixels();
+        TInt textPaneHeight = layoutFont->TextPaneHeight();
+        TInt textPaneTopToBaseline = layoutFont->TextPaneTopToBaseline();
+        
+        textSize.iHeight += textPaneHeight - textPaneTopToBaseline;
+        textSize.iHeight += KHuiFontVerticalShiftInPixels;
+        }
+    else
+        {
+        textSize.iHeight = Max(textSize.iHeight, font->HeightInPixels());
+        textSize.iHeight += 3; // the best approximation - fails on big (>=72) fonts
+        }
+        
+    // Return the calculated text size.
+    return textSize;
+	}
+
+TInt THuiFont::MeasureBidiTextBoundsWidth(
+    const CFont& aFont,
+    const TDesC& aText,
+    CFont::TMeasureTextInput::TFlags aOrder) const
+    {
+    CFont::TMeasureTextInput input; 
+    input.iFlags = aOrder;
+    CFont::TMeasureTextOutput output; 
+    
+    TInt textAdvance = aFont.MeasureText( aText, &input, &output );
+	
+	TRect bounds = output.iBounds;
+	bounds.iTl.iX = Min(bounds.iTl.iX, 0);
+	bounds.iBr.iX = Max(bounds.iBr.iX, textAdvance);    
+    return bounds.Width();
+    }
+
+EXPORT_C void THuiFont::ReleaseFont()
+	{
+	if(iFont)
+		{
+        iFont->iRefCount--;
+        if ( !iFont->iRefCount )
+            {
+            // No more references to iFont instance, we can release 
+            // Symbian Font instance & delete TFontRef object.
+
+            const CAknLayoutFont* layoutFont = 0;
+            if (CCoeEnv::Static())
+                {
+                layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( iFont->iFontInstance );
+                }
+            
+            if ( layoutFont )
+                {
+                delete layoutFont;
+                }
+            else
+                {
+                CWsScreenDevice* screenDev = 0;    
+                if (CCoeEnv::Static())
+                    {
+                    screenDev = CCoeEnv::Static()->ScreenDevice();
+                    }
+                else
+                    {
+                    screenDev = CHuiStatic::ScreenDevice();
+                    }
+
+	            screenDev->ReleaseFont( iFont->iFontInstance );
+                }
+            delete iFont;
+            }
+        iFont = NULL;
+		}		
+	}
+
+// Implementation of THuiFont::TFontRef:
+
+inline THuiFont::TFontRef::TFontRef()
+    : iFontInstance( NULL ), iRefCount( 0 )
+    {
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxColorParameter.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxColorParameter.h"
+#include <gdi.h>
+
+template<>
+TUint32 RHuiFxColorTimeLine::ToFixedPoint(const TRgb& aValue)
+    {
+    return aValue.Internal();
+    }
+
+template<>
+TRgb RHuiFxColorTimeLine::FromFixedPoint(const TUint32& aValue)
+    {
+    return TRgb(aValue);
+    }
+
+template<>
+TUint32 RHuiFxColorTimeLine::Blend(const TUint32& aValue1, const TUint32& aValue2, TInt32 aAlpha)
+    {
+    TUint32 redBlue1    = (aValue1 & 0x00ff00ff);
+    TUint32 alphaGreen1 = (aValue1 & 0xff00ff00) >> 8;
+    TUint32 redBlue2    = (aValue2 & 0x00ff00ff);
+    TUint32 alphaGreen2 = (aValue2 & 0xff00ff00) >> 8;
+    
+    TUint32 redBlueDelta    = redBlue2 - redBlue1; 
+    TUint32 alphaGreenDelta = alphaGreen2 - alphaGreen1;
+
+    aAlpha >>= 8;
+    
+    redBlueDelta    = (redBlueDelta * aAlpha) >> 8;
+    alphaGreenDelta = (alphaGreenDelta * aAlpha) >> 8;
+
+    redBlue1    += (redBlueDelta & 0xff00ff);
+    alphaGreen1 += (alphaGreenDelta & 0xff00ff);
+    
+    return redBlue1 | (alphaGreen1 << 8);
+    }
+
+template<>
+TUint32 RHuiFxColorTimeLine::WeightedSum4(const TUint32& aValue1, const TUint32& aValue2, const TUint32& aValue3, const TUint32& aValue4,
+                                          TInt32 aWeight1, TInt32 aWeight2, TInt32 aWeight3, TInt32 aWeight4)
+    {
+    TUint32 a1 = ((aValue1 & 0xff000000) >> 24) * aWeight1;
+    TUint32 a2 = ((aValue2 & 0xff000000) >> 24) * aWeight2;
+    TUint32 a3 = ((aValue3 & 0xff000000) >> 24) * aWeight3;
+    TUint32 a4 = ((aValue4 & 0xff000000) >> 24) * aWeight4;
+    
+    TUint32 r1 = ((aValue1 & 0x00ff0000) >> 16) * aWeight1;
+    TUint32 r2 = ((aValue2 & 0x00ff0000) >> 16) * aWeight2;
+    TUint32 r3 = ((aValue3 & 0x00ff0000) >> 16) * aWeight3;
+    TUint32 r4 = ((aValue4 & 0x00ff0000) >> 16) * aWeight4;
+
+    TUint32 g1 = ((aValue1 & 0x0000ff00) >> 8) * aWeight1;
+    TUint32 g2 = ((aValue2 & 0x0000ff00) >> 8) * aWeight2;
+    TUint32 g3 = ((aValue3 & 0x0000ff00) >> 8) * aWeight3;
+    TUint32 g4 = ((aValue4 & 0x0000ff00) >> 8) * aWeight4;
+    
+    TUint32 b1 = (aValue1 & 0x000000ff) * aWeight1;
+    TUint32 b2 = (aValue2 & 0x000000ff) * aWeight2;
+    TUint32 b3 = (aValue3 & 0x000000ff) * aWeight3;
+    TUint32 b4 = (aValue4 & 0x000000ff) * aWeight4;
+    
+    TUint32 a = ((a1 + a2 + a3 + a4) << 8)  & 0xff000000;
+    TUint32 r = ((r1 + r2 + r3 + r4))       & 0x00ff0000;
+    TUint32 g = ((g1 + g2 + g3 + g4) >> 8)  & 0x0000ff00;
+    TUint32 b = ((b1 + b2 + b3 + b4) >> 16) & 0x000000ff;
+    
+    return (a | r | g | b);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxEffect.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,542 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxEffect.h"
+#include "HuiFxGroupLayer.h"
+#include "HuiRenderPlugin.h"
+#include "HuiCmdBufferBrush.h" // MHuiEffectable
+
+EXPORT_C CHuiFxEffect* CHuiFxEffect::NewL(CHuiFxEngine& aEngine)
+    {
+    CHuiFxEffect* e = new (ELeave) CHuiFxEffect( aEngine );
+    CleanupStack::PushL(e);
+    e->ConstructL();
+    CleanupStack::Pop(e);
+    return e;
+    }
+
+CHuiFxEffect::CHuiFxEffect( CHuiFxEngine& aEngine ) :
+    iEngine( &aEngine )
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEffect::CHuiFxEffect - 0x%x"), this);
+#endif
+    }
+EXPORT_C CHuiFxEffect *CHuiFxEffect::CloneL() const
+{
+   CHuiFxEffect *effect = new (ELeave)CHuiFxEffect(*iEngine);
+   effect->iRoot = iRoot->CloneL();
+   effect->iEffectEndObserver = iEffectEndObserver;
+   effect->iHandle = iHandle;
+   return effect;
+}
+EXPORT_C void CHuiFxEffect::SetExtRect( TRect *aExtRect )
+    {
+    iRoot->SetExtRect(aExtRect);
+    }
+EXPORT_C void CHuiFxEffect::SetVisual( CHuiVisual *aVisual )
+    {
+    iRoot->SetVisual(aVisual);
+    }
+EXPORT_C void CHuiFxEffect::SetVisual( MHuiEffectable *aEffectable )
+    {
+    iRoot->SetVisual(aEffectable);
+    }
+EXPORT_C void CHuiFxEffect::SetEngine( CHuiFxEngine *aEngine )
+    {
+    iEngine = aEngine;
+    iEngine->AddEffectL(this);
+    }
+
+EXPORT_C void CHuiFxEffect::ConstructL( )
+    {
+    iRoot = CHuiFxGroupLayer::NewL(ETrue);
+#ifndef HUIFX_EFFECTCACHE_ENABLED    
+    iEngine->AddEffectL(this);
+#endif
+    }
+
+EXPORT_C CHuiFxEffect::~CHuiFxEffect()
+    {
+    delete iRoot;
+    iRoot = NULL;
+    
+    NotifyEffectEndObserver();
+    
+    ReleaseCachedRenderTarget();
+    
+    iEngine->RemoveEffect(this);
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEffect::~CHuiFxEffect - 0x%x"), this);
+#endif
+    }
+
+void CHuiFxEffect::NotifyEffectEndObserver()
+    {
+    if ( iEffectEndObserver )
+        {
+        // The callback can be called only once when the effect finishes
+        iEffectEndObserver->AlfGfxEffectEndCallBack( iHandle );
+        iEffectEndObserver = NULL;
+        iHandle = 0;
+        }    
+    }
+
+EXPORT_C void CHuiFxEffect::AddLayerL(const CHuiFxLayer* aLayer)
+    {
+    iRoot->AddLayerL(aLayer);
+    }
+
+void CHuiFxEffect::ReleaseCachedRenderTarget()
+    {
+    if (iCachedRenderTarget)
+        {
+        iEngine->ReleaseRenderbuffer(iCachedRenderTarget);
+        iCachedRenderTarget = NULL;
+        }                
+    }
+
+void CHuiFxEffect::PrepareCachedRenderTarget(const TPoint& aPosition, const TSize& aSize, TBool aClear, TBool aEnableBackground)
+    {
+    // If size has chnaged, we must delete old one
+    if (iCachedRenderTarget && 
+        iCachedRenderTarget->Size() != aSize)
+        {
+        ReleaseCachedRenderTarget();
+        }            
+    
+    // Accure new buffer
+    if (!iCachedRenderTarget)
+        {
+        iCachedRenderTarget = iEngine->AcquireRenderbuffer(aSize, EFalse);                    
+        }    
+    
+    if (iCachedRenderTarget)
+        {
+        // Set render buffer position in screen coordinates
+        iCachedRenderTarget->SetPosition(aPosition);                 
+        
+        // Enable background if needed
+       iCachedRenderTarget->EnableBackground(aEnableBackground);
+
+       // Clear if requested
+        if (aClear)
+            {
+            iCachedRenderTarget->PrepareForReuse(iCachedRenderTarget->Size());
+            }        
+        }    
+    }
+
+void CHuiFxEffect::ForceCachedRenderTargetUsage(TBool aUseCachedRenderTarget)
+    {
+    iForcedUseCachedRenderTarget = aUseCachedRenderTarget;
+    }
+
+TBool CHuiFxEffect::IsCachedRenderTargetPreferred() const
+    {
+    // Prefer use cached render target if 
+    //
+    // 1. I am filter effect. 
+    //    Note that this does not provide good performance if effect 
+    //    is animated, but noncached version does not work visually correctly 
+    //    in rotated display if effect is applied to background as well.
+    //    -> TODO: Return EFalse if effect has animated filter which does not use background pixels 
+    // 
+    // 2. User has set force flag
+    //
+    if (iForcedUseCachedRenderTarget || iRoot->IsFiltered())
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+TBool CHuiFxEffect::IsCachedRenderTargetSupported() const
+    {
+    // Can use cached render target if
+    //
+    // 1. Render supports it (openvg for now).
+    // 2. Engine is not in low memory mode.
+    //
+    if (iEngine->EngineType() == EHuiFxEngineVg10 && 
+        !iEngine->LowMemoryState()) // normal
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+TBool CHuiFxEffect::CachedDraw(CHuiGc& aGc, const TRect& aDisplayRect, TBool aRefreshCachedRenderTarget, TBool aOpaque)
+    {
+    RRegion dummy;
+    TBool ret = CachedDraw(aGc, aDisplayRect, aRefreshCachedRenderTarget, aOpaque, dummy);
+    dummy.Close();
+    return ret;
+    }
+
+// TODO: effect area should be reduced if aClipRegion is smaller than aDisplayRect.
+TBool CHuiFxEffect::CachedDraw(CHuiGc& aGc, const TRect& aDisplayRect, TBool aRefreshCachedRenderTarget, TBool aOpaque, const TRegion& aClipRegion, TInt aAlpha)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEffect::CachedDraw - 0x%x"), this);
+#endif    
+    iFramesDrawn++;
+    if (!CHuiStatic::Renderer().Allows(EHuiRenderPluginAllowVisualPBufferSurfaces))
+        {
+        return EFalse;
+        }
+            
+    
+    CHuiFxRenderbuffer* target = NULL;
+    
+    // Prepare all layers
+    TRect displayArea = aGc.DisplayArea();
+    TRect targetArea = aDisplayRect;
+    targetArea.Intersection(displayArea);
+
+    if (targetArea.Width() <= 0 || targetArea.Height() <= 0)
+        {
+        // Not visible
+        return ETrue;
+        }
+
+    if (!iEngine || !iRoot)
+        {
+        return EFalse;
+        }
+
+    if (iEngine->LowMemoryState())
+        {
+        // No memory, no effects.
+        return EFalse;
+        }
+    
+    // Check if margins are allowed to be used for this effect
+    if (EffectFlags() & KHuiFxEffectDisableMarginsFlag)
+        {
+        iRoot->EnableMargin(EFalse);
+        }
+    
+    iRoot->SetTargetRect(targetArea);
+    iRoot->SetSourceRect(targetArea);        
+    iRoot->SetDisplayArea(displayArea);
+    
+    TRAPD(err, iRoot->PrepareDrawL(*iEngine));
+    
+    if (err != KErrNone)
+        {
+        return EFalse;
+        }
+
+    if (IsCachedRenderTargetSupported() && IsCachedRenderTargetPreferred())
+        {
+        // Background needs to be captured from surface if effect uses background AND 
+        // Visual is transparent or margin is enabled AND
+        // Background has not been disabled with a effect specific flag
+        TBool enableBackground = IsAppliedToBackground() && (!aOpaque || iRoot->IsMarginEnabled()) && !(EffectFlags() & KHuiFxDisableBackground);
+        
+        // Check if cache is up-to date or does it need to be refreshed
+        TBool cachedRenderTargetNeedsRefresh = (iRoot->Changed() || aRefreshCachedRenderTarget || enableBackground);
+
+        // Try to apply also margins, we cannot just use aDisplayRect directly
+        TRect targetRect = iRoot->VisualRect();
+        
+        // Size is always same as target rect. It contains margins if those are enabled.
+        TSize cachedRenderTargetSize = targetRect.Size();        
+                
+        // Prepare cached offscreen render target
+        PrepareCachedRenderTarget(targetRect.iTl, cachedRenderTargetSize, cachedRenderTargetNeedsRefresh, enableBackground);
+        
+        // If it is available, then lets do it 
+        if (iCachedRenderTarget)
+            {
+            // Disable clipping, otherwise strange things happen.
+            aGc.Disable(CHuiGc::EFeatureClipping);             
+            if (cachedRenderTargetNeedsRefresh)
+                {
+                // Render to cached render target
+                iRoot->Draw(*iEngine, aGc, *iCachedRenderTarget, *iCachedRenderTarget);                
+#ifdef HUIFX_TRACE    
+                RDebug::Print(_L("CHuiFxEffect::CachedDraw - refreshed cached render buffer 0x%x"), this);
+#endif
+                }            
+
+            if (aClipRegion.Count())
+                {
+                aGc.Enable(CHuiGc::EFeatureClipping);
+                aGc.PushClip();
+                aGc.Clip(aClipRegion);
+                }
+            
+            // Write cached buffer to the display
+            iEngine->Composite(aGc, *iCachedRenderTarget, targetRect.iTl, aOpaque && !(EffectFlags() & KHuiFxAlwaysBlend), aAlpha);
+
+            if (aClipRegion.Count())
+                {
+                aGc.PopClip();
+                }
+            
+            aGc.Enable(CHuiGc::EFeatureClipping);
+#ifdef HUIFX_TRACE    
+            RDebug::Print(_L("CHuiFxEffect::CachedDraw - Cached render buffer drawn 0x%x"), this);
+            RDebug::Print(_L("CHuiFxEffect::CachedDraw - displayrect: %i,%i, %i,%i "), 
+                    aDisplayRect.iTl.iX,
+                    aDisplayRect.iTl.iY,
+                    aDisplayRect.iBr.iX,
+                    aDisplayRect.iBr.iY);
+#endif            
+            }
+        else
+            {
+            // It might not be available e.g. in low memory situations, just indiacte that we could not draw.
+            return EFalse;
+            }
+        }
+    else
+        {
+        // Release cached render target just in case it is reserved for some reason
+        ReleaseCachedRenderTarget();
+
+        // Use default onscreen render target
+        if (!target)
+            {
+            target = iEngine->DefaultRenderbuffer();
+            }
+        
+        if (!target)
+            {
+            return EFalse;
+            }
+        
+        // Normal drawing
+        iRoot->Draw(*iEngine, aGc, *target, *target);
+        }
+                
+    return ETrue;    
+    }
+
+EXPORT_C TBool CHuiFxEffect::Draw(CHuiGc& aGc, const TRect& aDisplayRect)
+    {
+    // Prepare all layers
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEffect::Draw - 0x%x"), this);
+#endif
+    iFramesDrawn++;
+    if (!CHuiStatic::Renderer().Allows(EHuiRenderPluginAllowVisualPBufferSurfaces))
+        {
+        return EFalse;
+        }
+            
+    TRect displayArea = aGc.DisplayArea();
+    TRect targetArea = aDisplayRect;
+    targetArea.Intersection(displayArea);
+
+    if (targetArea.Width() <= 0 || targetArea.Height() <= 0)
+        {
+        // Not visible
+        return ETrue;
+        }
+
+    if (!iEngine || !iRoot)
+        {
+        return EFalse;
+        }
+
+    if (iEngine->LowMemoryState())
+        {
+        // No memory, no effects.
+        return EFalse;
+        }
+    
+    // Check if margins are allowed to be used for this effect
+    if (EffectFlags() & KHuiFxEffectDisableMarginsFlag)
+        {
+        iRoot->EnableMargin(EFalse);
+        }
+    
+    iRoot->SetDisplayArea(displayArea);
+    iRoot->SetTargetRect(targetArea);
+    iRoot->SetSourceRect(targetArea);
+    
+    TRAPD(err, iRoot->PrepareDrawL(*iEngine));
+    
+    if (err != KErrNone)
+        {
+        return EFalse;
+        }
+    
+    CHuiFxRenderbuffer* target = iEngine->DefaultRenderbuffer();
+    
+    if (!target)
+        {
+        return EFalse;
+        }
+
+    iRoot->Draw(*iEngine, aGc, *target, *target);
+    return ETrue;
+    }
+
+EXPORT_C TBool CHuiFxEffect::VisualArea(TRect& aRect) const
+    {
+    return iRoot->VisualArea(aRect);
+    }
+
+EXPORT_C CHuiFxEngine& CHuiFxEffect::Engine() const
+    {
+    return *iEngine;
+    }
+
+EXPORT_C TBool CHuiFxEffect::Changed()
+    {
+    TBool changed = iRoot->Changed();
+    return changed;
+    }
+    
+EXPORT_C void CHuiFxEffect::SetEffectEndObserver( MAlfGfxEffectObserver* aEffectEndObserver, TInt aHandle )
+    {
+    iEffectEndObserver = aEffectEndObserver;
+    iHandle = aHandle;
+    }
+
+EXPORT_C void CHuiFxEffect::SetEffectFlags( TInt aFlags )
+    {
+    iFlags = aFlags;
+    }
+
+EXPORT_C void CHuiFxEffect::SetEffectGroup(TInt aGroupId)
+    {
+    iGroupId = aGroupId;
+    }
+
+EXPORT_C TInt CHuiFxEffect::EffectFlags()
+    {
+    return iFlags;
+    }
+
+EXPORT_C TInt CHuiFxEffect::GroupId()
+    {
+    return iGroupId;
+    }
+
+EXPORT_C void CHuiFxEffect::AdvanceTime(TReal32 aElapsedTime)
+    {
+    if (iFlags & KHuiFxDelayRunUntilFirstFrameHasBeenDrawn)
+        {
+        if (iFramesDrawn)
+            {
+            if (iFramesDrawn == 1)
+                {
+                aElapsedTime = 0;
+                iFramesDrawn++;
+                }
+            iRoot->AdvanceTime(aElapsedTime);
+            }
+        else
+            {
+            }
+        }
+    else
+        {
+        iRoot->AdvanceTime(aElapsedTime);
+        }
+    }
+    
+EXPORT_C TBool CHuiFxEffect::IsAnimated() const
+    {
+    if (iRoot && iRoot->IsAnimated())
+        {
+        return ETrue;        
+        }
+    else
+        {
+        return EFalse;
+        }    
+    }
+
+EXPORT_C TBool CHuiFxEffect::IsTransformed() const
+    {
+    if (iRoot && iRoot->IsTransformed())
+        {
+        return ETrue;        
+        }
+    else
+        {
+        return EFalse;
+        }            
+    }
+
+TBool CHuiFxEffect::IsFiltered() const
+    {
+    if (iRoot && iRoot->IsFiltered())
+        {
+        return ETrue;        
+        }
+    else
+        {
+        return EFalse;
+        }            
+    }
+
+TBool CHuiFxEffect::IsAppliedToBackground()
+    {
+    if (iRoot && iRoot->LayerCount())
+        {
+        if (iRoot->Layer(0).Type() == ELayerTypeGroup)
+            {
+            // If first layer after root is group, then effect is not applied to background (?)
+            return EFalse;    
+            }
+        else
+            {
+            if (IsFiltered())
+                {
+                return ETrue;
+                }
+            else
+                {
+                // Not filter effect -> cannot be applied to background.
+                return EFalse;
+                }
+            } 
+        }            
+    return EFalse;    
+    }
+
+TBool CHuiFxEffect::IsSemitransparent() const
+    {
+    if (iRoot && iRoot->IsSemitransparent())
+        {
+        return ETrue;        
+        }
+    else
+        {
+        return EFalse;
+        }            
+    }
+
+void CHuiFxEffect::FxmlVisualInputs(RArray<THuiFxVisualSrcType> &aArray)
+    {
+    iRoot->FxmlVisualInputs(aArray);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxEffectCache.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,409 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxEffectCache.h"
+#include "HuiFxEffectParser.h"
+#include "HuiFxEffect.h"
+#include "uiacceltk/HuiVisual.h" 
+#include "uiacceltk/HuiPanic.h"
+#include "HuiFxConstants.h"
+
+CHuiFxEffectCache *CHuiFxEffectCache::NewL()
+{
+	return new (ELeave)CHuiFxEffectCache;
+}
+
+CHuiFxEffectCache::~CHuiFxEffectCache()
+   {
+   iCachedEffects.ResetAndDestroy();
+#if 0
+   THashMapIter<TInt, MHuiFxEffectCacheNode*> iter(iDuplicateEffects);
+   MHuiFxEffectCacheNode * const *node;
+   do
+       {
+       node =  iter.NextValue();
+       if (node)
+           {
+           delete *node;
+           }
+       }
+   while(node);
+#endif
+   TInt size = iDuplicateEffects.Count();
+   for(TInt i=0;i<size;i++)
+       {
+       const IDNode &node = iDuplicateEffects[i];
+       delete node.iNode;
+       }
+
+   iCachedEffects.Close();
+   iDuplicateEffects.Close();   
+   }
+
+TInt CHuiFxEffectCache::UniqueId()
+    {
+    iUniqueId++;
+    return iUniqueId;
+    }
+
+void CHuiFxEffectCache::CreateL(MHuiFxEffectCacheNode *aNode)
+    { // registration of fxml file
+    MHuiFxEffectCacheNode *cachedNode = Find(aNode);
+    if (cachedNode)
+       { // found in cache => duplicate registration => no need to do anything
+       cachedNode->Ref(1);
+       delete aNode;
+       }
+    else
+       { // not found in cache, so insert it and start parsing the effect.
+       TInt id = UniqueId();
+       IDNode n = { id, aNode };
+       iDuplicateEffects.Append(n);
+
+       TRAPD(err, aNode->HeavyOperationL(this, id)); // from empty to this instance
+       if (err != KErrNone)
+           {
+           iDuplicateEffects.Remove(iDuplicateEffects.Count()-1);
+           User::Leave(err);
+           }
+       }
+    }
+
+EXPORT_C void CHuiFxEffectCache::FindOrCreateL(MHuiFxEffectCacheNode *aNode)
+   { // using fxml file
+   MHuiFxEffectCacheNode *cachedNode = Find(aNode);
+
+   if (cachedNode)
+	  { // found in cache
+	  aNode->LightOperationL(cachedNode); // from cache to this instance  
+	  delete aNode;
+	  }
+   else
+	  { // not found in cache, so start parsing the effect.
+
+	  // TODO: What happens if we did not find it from cache, but it exists in iDuplicateEffects?
+	  //       Current behaviour is that it starts to load it again, causing duplicate entries in the cache.
+	  TInt id = UniqueId();
+      IDNode n = { id, aNode };
+      iDuplicateEffects.Append(n);
+      //iDuplicateEffects.InsertL(id, aNode);
+
+	  TRAPD(err, aNode->HeavyOperationL(this, id)); // from empty to this instance
+	  if (err != KErrNone)
+	      {
+	      iDuplicateEffects.Remove(iDuplicateEffects.Count()-1);
+	      User::Leave(err);
+	      }
+	  }
+  }
+
+void CHuiFxEffectCache::UnUse(MHuiFxEffectCacheNode *aNode)
+   { // unregisteration of fxml file
+   MHuiFxEffectCacheNode *cachedNode = Find(aNode);
+   if (cachedNode)
+       {
+       TInt count = cachedNode->Ref(-1);
+       if (count == 0)
+           {
+           delete cachedNode;
+           Remove(iCachedEffects, cachedNode);
+           }
+       }
+   if (cachedNode != aNode)
+       { // this node was not found in iCachedEffects array, so it needs to be in iDuplicateEffects array
+       delete aNode;
+       Remove(iDuplicateEffects, aNode);
+       }
+   }
+
+void CHuiFxEffectCache::ParsingEnded(TInt aHandle)
+    {
+    //MHuiFxEffectCacheNode **node2 = iDuplicateEffects.Find(aHandle);
+    TInt index = FindById(aHandle);
+    if (index == -1) return;
+    MHuiFxEffectCacheNode *node = iDuplicateEffects[index].iNode;
+    node->ParsingEndedBefore();
+    iCachedEffects.AppendL(node); // takes ownership
+    iDuplicateEffects.Remove(index);
+    node->Ref(1);
+    node->ParsingEndedAfter(node);
+    }
+
+bool CHuiFxEffectCache::Compare(MHuiFxEffectCacheNode *aNode1, MHuiFxEffectCacheNode *aNode2)
+   {
+   return aNode1->Id().Compare(aNode2->Id()) == 0;
+   }
+
+MHuiFxEffectCacheNode *CHuiFxEffectCache::Find(MHuiFxEffectCacheNode *aNode)
+   {
+   TInt size = iCachedEffects.Count();
+   for(TInt i=0;i<size;i++)
+	{
+	MHuiFxEffectCacheNode *node = iCachedEffects[i];
+	if (Compare(node, aNode))
+		{
+		return node;
+		}
+	}
+   return 0;
+   }
+
+TInt CHuiFxEffectCache::FindById(TInt aId)
+    {
+    TInt size = iDuplicateEffects.Count();
+    for(TInt i=0;i<size;i++)
+        {
+        const IDNode &node = iDuplicateEffects[i];
+        if (node.iId == aId)
+            {
+            return i;
+            }
+        }
+    return -1;
+    }
+
+
+MHuiFxEffectCacheNode *CHuiFxEffectCache::FindDup(const TDesC &aId)
+    {
+    TInt size = iDuplicateEffects.Count();
+    for(TInt i=0;i<size;i++)
+        {
+        const IDNode &node = iDuplicateEffects[i];
+        if (node.iNode->Id() == aId)
+            {
+            return node.iNode;
+            }
+        }
+    
+#if 0
+    THashMapIter<TInt, MHuiFxEffectCacheNode*> iter(iDuplicateEffects);
+    MHuiFxEffectCacheNode * const * node = 0;
+    do
+        {
+        node = iter.NextValue();
+        if (node && (*node)->Id()==aId)
+            {
+            return *node;
+            }
+        }
+    while(node);
+#endif
+    
+   TInt size2 = iCachedEffects.Count();
+   for(TInt i=0;i<size2;i++)
+	   {
+	   MHuiFxEffectCacheNode *node = iCachedEffects[i];
+	   if (node->Id()==aId)
+		  {
+		  return node;
+		  }
+	   }
+    return 0;
+    }
+MHuiFxEffectCacheNode *CHuiFxEffectCache::FindCached(const TDesC &aId)
+    {
+    TInt size2 = iCachedEffects.Count();
+    for(TInt i=0;i<size2;i++)
+        {
+        MHuiFxEffectCacheNode *node = iCachedEffects[i];
+        if (node->Id()==aId)
+           {
+           return node;
+           }
+        }
+     return 0;    
+    }
+
+TBool CHuiFxEffectCache::FxmlUsesInput1(const TDesC &aFileName)
+    {
+    MHuiFxEffectCacheNode *node = FindCached(aFileName);
+    if (node)
+        return node->FxmlUsesInput1();
+    else
+        return EFalse;
+    }
+
+
+void CHuiFxEffectCache::Remove(RHashMap<TInt, MHuiFxEffectCacheNode*> & /*aMap*/, MHuiFxEffectCacheNode * /*aNode*/)
+    {
+#if 0
+    THashMapIter<TInt, MHuiFxEffectCacheNode*> iter(aMap);
+    MHuiFxEffectCacheNode * const *node = 0;
+    do
+        {
+        node = iter.NextValue();
+        if (!node)
+            break;
+	    MHuiFxEffectCacheNode *n = *node;
+        if (n == aNode)
+            {
+            const TInt *key = iter.CurrentKey();
+            aMap.Remove(*key);
+            return;
+            }
+        }
+    while(node);
+#endif
+    }
+
+void CHuiFxEffectCache::Remove(RPointerArray<MHuiFxEffectCacheNode> &aEffects, MHuiFxEffectCacheNode *aNode)
+    {
+    TInt size = aEffects.Count();
+    for(TInt i=0;i<size;i++)
+        {
+        MHuiFxEffectCacheNode *node = aEffects[i];
+        if (node == aNode)
+            {
+            aEffects.Remove(i);
+            return;
+            }
+        }
+    }
+
+void CHuiFxEffectCache::Remove(RArray<IDNode> &aMap, MHuiFxEffectCacheNode *aNode)
+    {
+    TInt size = aMap.Count();
+    for(TInt i=0;i<size;i++)
+        {
+        const IDNode &n = aMap[i];
+        if (n.iNode == aNode)
+            {
+            aMap.Remove(i);
+            return;
+            }
+        }
+    }
+
+
+CHuiFxEffectCacheEffectNode::~CHuiFxEffectCacheEffectNode()
+    {
+    delete iFileName;
+    delete iParser;
+    }
+
+TPtrC CHuiFxEffectCacheEffectNode::Id()
+   {
+   return TPtrC(*iFileName);
+   }
+
+TInt CHuiFxEffectCacheEffectNode::Ref(TInt aCount)
+    {
+    iRefCount += aCount;
+    return iRefCount;
+    }
+
+MHuiFxEffectCacheNode *CHuiFxEffectCacheEffectNode::CloneL()
+   {
+   CHuiFxEffect *effect = iEffect->CloneL();
+   return new CHuiFxEffectCacheEffectNode(*iFileName, effect);
+   }
+
+void CHuiFxEffectCacheEffectNode::HeavyOperationL(MHuiFxParsingEndedObserver *aObserver, TInt aIndex)
+	{
+	TRect extRect = TRect();
+    if ( iExtRect )
+       	{
+       	extRect = *iExtRect;
+       	}
+    iParser = CHuiFxEffectParser::NewL( *iEngine, iVisual );
+    iParser->SetEffectEndObserver( iEffectEndObserver, iHandle );
+    iParser->SetEffectFlags( iFlags );
+    iParser->SetParsingEndedObserver(aObserver, aIndex);
+    iParser->ParseL( *iFileName, extRect );
+    if (iVisual)
+        {
+        iVisual->SetLoadingEffect(ETrue);
+        }
+	}
+
+void CHuiFxEffectCacheEffectNode::LightOperationL(MHuiFxEffectCacheNode *aCached)
+	{
+	CHuiFxEffectCacheEffectNode *cachednode = (CHuiFxEffectCacheEffectNode*)aCached;
+	TRect extRect = TRect();
+	if ( iExtRect )
+		{
+		extRect = *iExtRect;
+		}
+	iEffectCached = cachednode->iEffect;
+	iEffect = iEffectCached->CloneL();	
+	iEffect->SetEffectEndObserver(iEffectEndObserver, iHandle);
+	iEffect->SetEffectFlags(iFlags);
+	iEffect->SetEffectGroup(iGroup);
+	iEffect->SetExtRect( &extRect );
+	iEffect->SetVisual( iVisual );
+	iEffect->SetEngine( iEngine );
+	if (iVisual)
+	    iVisual->EffectSetEffect( iEffect );
+	}
+
+void CHuiFxEffectCacheEffectNode::ParsingEndedBefore()
+    {
+    iParser->Effect( iEffect );
+    }
+
+void CHuiFxEffectCacheEffectNode::ParsingEndedAfter(MHuiFxEffectCacheNode *aCached)
+    {
+    if (iVisual)
+        {
+        //iVisual->SetEffect( iEffect );
+        iVisual->SetLoadingEffect(EFalse);
+        CHuiFxEffectCacheEffectNode *node = new (ELeave) CHuiFxEffectCacheEffectNode(*iFileName, iEffect, iVisual, iExtRect, iEngine);
+        CleanupStack::PushL(node);
+        node->LightOperationL(aCached);
+        CleanupStack::PopAndDestroy(node);
+        }
+    // no delete here, because the parser will be destroyed immediately after this inside CHuiFxEffectParser::RunL()
+    // This moves ownership to CHuiFxEffectParser.
+    iParser = NULL;
+    }
+
+void CHuiFxEffectCacheEffectNode::SetEffectEndObserver( MAlfGfxEffectObserver* aEffectEndObserver, TInt aHandle )
+    {
+    iEffectEndObserver = aEffectEndObserver;
+    iHandle = aHandle;
+    }
+
+void CHuiFxEffectCacheEffectNode::SetEffectFlags( TInt aFlags )
+    {
+    iFlags = aFlags;
+    }
+	
+void CHuiFxEffectCacheEffectNode::SetEffectGroup( TInt aGroup)
+    {
+    iGroup = aGroup;
+    }
+
+TBool CHuiFxEffectCacheEffectNode::FxmlUsesInput1()
+    {
+    CHuiFxEffect *effect = iEffect;
+
+    RArray<THuiFxVisualSrcType> array;
+    effect->FxmlVisualInputs(array);
+ 
+    TInt c = array.Count();
+    for(TInt i = 0; i<c; i++)
+        {
+        THuiFxVisualSrcType val = array[i];
+        if (val == EVisualSrcInput1)
+            {
+            array.Close();
+            return ETrue;
+            }
+        }
+    array.Close();
+    return EFalse;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxEffectParser.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1215 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxEffectParser.h"
+
+#include <stdarg.h>
+#include <gmxmldocument.h>
+#include <gmxmlelement.h>
+#include <gmxmlnode.h>
+#include <gmxmltext.h>
+#include <gmxmlprocessinginstruction.h>
+#include <gmxmlcdatasection.h>
+#include "HuiFxConstants.h"
+#include "HuiFxFilter.h"
+#include "HuiFxGroupLayer.h"
+#include "HuiFxFilterLayer.h"
+#include "HuiFxVisualLayer.h"
+#include "HuiFxEffect.h"
+#include "HuiFxParameter.h"
+#include "HuiFxScalarParameter.h"
+#include "HuiFxColorParameter.h"
+#include "uiacceltk/HuiVisual.h"  // Class definition
+#include "alflogger.h"
+#include "huieffectable.h"
+#include <stdlib.h>
+
+//#define _HUI_FX_PARSER_LOGGING // Enable this, if you need to debug the xml parsing. otherwise leave this out, because the logging breaks the timing of effects
+// Debugging macros
+#if !defined(NDEBUG)
+#define FAIL(CODE, MSG)         FailL(CODE, MSG)
+#define FAIL1(CODE, MSG, P1)    FailL(CODE, MSG, P1)
+#else
+#define FAIL(CODE, MSG)
+#define FAIL1(CODE, MSG, P1)
+#endif
+
+CHuiFxEffectParser* CHuiFxEffectParser::NewL(CHuiFxEngine& aEngine, MHuiEffectable* aVisual)
+    {
+    CHuiFxEffectParser* self = NewLC(aEngine, aVisual);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CHuiFxEffectParser* CHuiFxEffectParser::NewLC(CHuiFxEngine& aEngine, MHuiEffectable* aVisual)
+    {
+    CHuiFxEffectParser* self = new (ELeave) CHuiFxEffectParser( aEngine, aVisual );
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+    
+void CHuiFxEffectParser::ConstructL()
+    {
+    iParser = CMDXMLParser::NewL( this ) ;
+    User::LeaveIfError( iFs.Connect() );
+    CActiveScheduler::Add( this );
+    }
+    
+CHuiFxEffectParser::CHuiFxEffectParser( CHuiFxEngine& aEngine, MHuiEffectable* aVisual ) :
+    CActive( EPriorityHigh ),
+    iEngine( aEngine ),
+    iVisual( aVisual ),
+    iParsingEndedObserver( NULL ), iParsingEndedHandle(0)
+    {
+    __ALFFXLOGSTRING2("CHuiFxEffectParser::CHuiFxEffectParser - this: 0x%x aVisual 0x%x", this, aVisual);
+    }
+    
+CHuiFxEffectParser::~CHuiFxEffectParser()
+    {
+    Cancel();
+    
+    delete iParser;
+    iParser = NULL;
+    
+    delete iDoc;
+    iDoc = NULL;
+    
+    delete iEffect;
+    iEffect = NULL;
+    
+    iFs.Close();
+    __ALFFXLOGSTRING1("CHuiFxEffectParser::~CHuiFxEffectParser - 0x%x ", this);
+}
+    
+void CHuiFxEffectParser::ParseFileCompleteL()
+    {
+    TRequestStatus* status = &iStatus;
+    TInt err = KErrNone; // We don't get any error from the caller.
+    if ( iIsCancelled )
+       {
+       err = KErrCancel;
+       }
+    User::RequestComplete( status, err );
+    __ALFFXLOGSTRING1("CHuiFxEffectParser::ParseFileCompleteL - 0x%x",this);
+    }
+
+void CHuiFxEffectParser::RunL()
+    {
+    __ALFFXLOGSTRING2("CHuiFxEffectParser::RunL - this 0x%x, status: %d", this, iStatus.Int());
+    // RunL will only be called once after the parsing completes
+    if ( iStatus.Int() == KErrNone )
+        {
+        BuildEffectL();
+        iEffect->SetEffectFlags( iFlags );
+        iFlags = 0;
+        // As soon as the visual gets the effect, it kills this effect parser.
+        // Therefore the effect must be stored into a temporary variable 
+        // and the member of the parser set to null to prevent the fresly released visual
+        // from being destroyed immediately.
+        // CHuiVisual::SetEffect does dot leave, it just stores the pointer to its own data area,
+        // so this is a safe trick, and the boat does not leak.
+        if (iParsingEndedObserver)
+            {
+            iParsingEndedObserver->ParsingEnded(iParsingEndedHandle);
+            }
+
+#ifndef HUIFX_EFFECTCACHE_ENABLED
+        CHuiFxEffect* tempEffect = iEffect;
+#endif
+        iEffect = NULL;
+        if (iVisual)
+            {
+            iVisual->EffectSetOpacity(1.0f);
+#ifndef HUIFX_EFFECTCACHE_ENABLED
+            iVisual->SetEffect( tempEffect );
+#endif
+            }
+        }
+    else if ( iStatus.Int() != KErrCancel )
+        {
+        // some error during parsing - delete possible incomplete effect
+        // and set the effect in the visual to NULL as we did not succeed in creating
+        // a decent effect
+        if (iParsingEndedObserver)
+            {
+            iParsingEndedObserver->ParsingEnded(iParsingEndedHandle);
+            }
+        delete iEffect;
+        iEffect = NULL;
+        if (iVisual)
+            {
+            iVisual->EffectSetOpacity(1.0f);
+            iVisual->EffectSetEffect( NULL );
+            }
+        }
+    else // We got cancelled
+        {
+        delete iEffect;
+        iEffect = NULL;
+        }    
+    delete this;
+    // MUST NOT DO ANYTHING AFTER THE delete this -line!
+    }
+
+TInt CHuiFxEffectParser::RunError( TInt /*aError*/ )
+    {
+    // we signal that we handled the error 
+    delete iEffect;
+    iEffect = NULL;
+    if ( iVisual )
+        {
+        iVisual->EffectSetEffect( NULL );
+        }
+    return KErrNone;
+    }
+
+void CHuiFxEffectParser::DoCancel()
+    {
+    // cancel the parsing.
+    // 
+    iIsCancelled = ETrue;
+    iParser->Cancel();
+    // parser should now call our ParseFileCompleteL()
+    // Unfortunately it will not tell us any error code.
+    // Therefore we must remember that we were cancelled.
+    // We can only be cancelled when CHuiFxEffectParser is deleted.
+    // We do not call iVisual->SetEffect any more in that case 
+    // because in that case the parser gets deleted anyway.
+    // We don't want to be deleted twice - though setting the parser to NULL after
+    // deleting should take care of that anyway.
+    
+    // Actually it seems that parser will not necessarily call us,
+    // so we must ensure ourselves that we are completed (but only once!)
+    // Otherwise then whole system will hang waiting for an event
+    
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrCancel );
+    __ALFFXLOGSTRING1("CHuiFxEffectParser::DoCancel - 0x%x",this);
+    }
+
+void CHuiFxEffectParser::ParseL( const TDesC& aFile, TRect aExtRect )
+    {
+    __ALFFXLOGSTRING2("CHuiFxEffectParser::ParseL - 0x%x %S",this, &aFile);
+    iIsCancelled = EFalse;
+    iExtRect = aExtRect;
+    TInt err = iParser->ParseFile( iFs, aFile );
+    if ( err != KErrNone )
+        {
+        // If parsing fails, give up immediately
+        iVisual->EffectSetEffect( NULL );
+        User::Leave( err );
+        }
+    iStatus = KRequestPending;
+    SetActive();
+    // BuildEffectL is called in RunL when parser calls our callback which completes us.
+    __ALFFXLOGSTRING("CHuiFxEffectParser::ParseL - activated ");
+    }
+
+void CHuiFxEffectParser::Effect( CHuiFxEffect*& aEffect )
+    {
+    aEffect = iEffect;
+    iEffect = NULL;
+    }
+
+void CHuiFxEffectParser::SetEffectEndObserver( MAlfGfxEffectObserver* aEffectEndObserver, TInt aHandle )
+    {
+    iEffectEndObserver = aEffectEndObserver;
+    iHandle = aHandle;
+    }
+
+void CHuiFxEffectParser::SetParsingEndedObserver( MHuiFxParsingEndedObserver *aObserver, TInt aHandle )
+    {
+    iParsingEndedObserver = aObserver;
+    iParsingEndedHandle = aHandle;
+    }
+
+
+void CHuiFxEffectParser::SetEffectFlags( TInt aFlags )
+    {
+    iFlags = aFlags;
+    }
+    
+void CHuiFxEffectParser::BuildEffectL()
+    {
+    __ALFFXLOGSTRING1("CHuiFxEffectParser::BuildEffectL - 0x%x",this);    
+    iEffect = CHuiFxEffect::NewL( iEngine );
+    iEffect->SetEffectEndObserver( iEffectEndObserver, iHandle );
+    iEffectEndObserver = NULL;
+    iHandle = 0;
+    iDoc = iParser->DetachXMLDoc();
+    User::LeaveIfNull( iDoc );
+    CMDXMLElement* root = iDoc->DocumentElement();
+    User::LeaveIfNull( root );
+    CMDXMLNode* node = root->FirstChild();
+    if( node->NodeName().Compare( KLitLayers ) != 0 )
+        {
+        FAIL(KErrGeneral, _L("Layer list not found"));
+        }
+    for (node = node->FirstChild(); node; node = node->NextSibling())
+        {
+        ParseNodeL( node, NULL );
+        }
+    __ALFFXLOGSTRING("CHuiFxEffectParser::BuildEffectL - complete ");
+    }
+    
+void CHuiFxEffectParser::ParseNodeL( CMDXMLNode* aNode, CHuiFxLayer* aLayer)
+    {
+    switch( ResolveNode( aNode ) )
+        {
+        case ENodeTypeUnknown:
+            {
+#ifdef _HUI_FX_PARSER_LOGGING
+            __ALFFXLOGSTRING("CHuiFxEffectParser::ParseNodeL - ENodeTypeUnknown");
+#endif
+            FAIL(KErrGeneral, _L("Unknown node type"));
+            break;
+            }
+            
+        case ENodeTypeGroup:
+            {
+#ifdef _HUI_FX_PARSER_LOGGING
+            __ALFFXLOGSTRING("CHuiFxEffectParser::ParseNodeL - ENodeTypeGroup");
+#endif
+            // can't have group layers inside group layer
+            if (aLayer && aLayer->Type() == ELayerTypeGroup)
+                {
+                FAIL(KErrGeneral, _L("Nested group layers not supported"));
+                }
+            
+            CHuiFxGroupLayer* group = CHuiFxGroupLayer::NewL();
+            CleanupStack::PushL( group );
+            for (CMDXMLNode* node = aNode->FirstChild(); node; node = node->NextSibling())
+                {
+                ParseNodeL( node, group );
+                }
+            iEffect->AddLayerL( group ); // ownership transferred
+            CleanupStack::Pop( group );
+            break;
+            }
+            
+        case ENodeTypeFilter:
+            {
+#ifdef _HUI_FX_PARSER_LOGGING
+            __ALFFXLOGSTRING("CHuiFxEffectParser::ParseNodeL - ENodeTypeFilter");
+#endif
+            THuiFxFilterType filterType = GetFilterTypeL( aNode );
+            CHuiFxFilter* filter = iEngine.CreateFilterL( filterType );
+            CleanupStack::PushL( filter );
+            CHuiFxFilterLayer* filterLayer = CHuiFxFilterLayer::NewL( filter );
+            CleanupStack::Pop( filter );
+            CleanupStack::PushL( filterLayer );
+            if (aLayer && aLayer->Type() == ELayerTypeGroup)
+                {
+                CHuiFxGroupLayer* group = reinterpret_cast<CHuiFxGroupLayer*>(aLayer);
+                group->AddLayerL( filterLayer ); // ownership transferred
+                }
+            else
+                {
+                iEffect->AddLayerL( filterLayer ); // ownership transferred
+                }
+            CleanupStack::Pop( filterLayer );
+            
+            if (filterType == EFilterTypeTransform)
+                {
+                filterLayer->SetTransformed(ETrue);
+                }
+            
+            for (CMDXMLNode* node = aNode->FirstChild(); node; node = node->NextSibling())
+                {
+                ParseNodeL( node, filterLayer );
+                }
+            break;
+            }
+            
+        case ENodeTypeVisual:
+            {
+#ifdef _HUI_FX_PARSER_LOGGING
+            __ALFFXLOGSTRING("CHuiFxEffectParser::ParseNodeL - ENodeTypeVisual");
+#endif
+            TPtrC16 extBitmap;
+            THuiFxVisualSrcType srcType = GetSrcTypeL( aNode, extBitmap );
+            CHuiFxVisualLayer* visual = CHuiFxVisualLayer::NewL( *iVisual );
+            CleanupStack::PushL( visual );
+            visual->SetSourceType( srcType );
+            if ( srcType == EVisualSrcBitmap && extBitmap.Length() > 0 )
+                {
+                visual->SetExtBitmapFileL( extBitmap );
+                }
+            if (aLayer && aLayer->Type() == ELayerTypeGroup)
+                {
+                CHuiFxGroupLayer* group = reinterpret_cast<CHuiFxGroupLayer*>(aLayer);
+                group->AddLayerL( visual ); // ownership transferred
+                }
+            else
+                {
+                iEffect->AddLayerL( visual ); // ownership transferred
+                }
+            for (CMDXMLNode* node = aNode->FirstChild(); node; node = node->NextSibling())
+                {
+                ParseNodeL( node, visual );
+                }
+            CleanupStack::Pop( visual );
+            break;
+            }
+         
+         case ENodeTypeBlending:
+            {
+#ifdef _HUI_FX_PARSER_LOGGING
+            __ALFFXLOGSTRING("CHuiFxEffectParser::ParseNodeL - ENodeTypeBlending");
+#endif
+            CMDXMLNode* blendingNode = aNode->FirstChild();
+            if( blendingNode->NodeType() != CMDXMLNode::ETextNode )
+                {
+                FAIL(KErrGeneral, _L("Bad blending mode"));
+                }
+            TPtrC modePtr( ((CMDXMLText *)blendingNode)->Data() );
+            
+            // set replace as default blending mode
+            THuiFxBlendingMode blendingMode = EBlendingModeReplace;
+            if( modePtr.Compare( KLitReplace ) == 0 )
+                {
+                blendingMode = EBlendingModeReplace;
+                }
+            else if( modePtr.Compare( KLitOver ) == 0 )
+                {
+                blendingMode = EBlendingModeOver;
+                }
+            else if( modePtr.Compare( KLitMultiply ) == 0 )
+                {
+                blendingMode = EBlendingModeMultiply;
+                }
+            else if( modePtr.Compare( KLitAdditive ) == 0 )
+                {
+                blendingMode = EBlendingModeAdditive;
+                }
+            else if( modePtr.Compare( KLitDarken ) == 0 )
+                {
+                blendingMode = EBlendingModeDarken;
+                }
+            else if( modePtr.Compare( KLitLighten ) == 0 )
+                {
+                blendingMode = EBlendingModeLighten;
+                }
+            else
+                {
+                FAIL(KErrGeneral, _L("Bad blending mode"));
+                }
+                
+            if (aLayer && aLayer->Type() == ELayerTypeGroup)
+                {
+                aLayer->SetBlendingMode( blendingMode );
+                }
+            else
+                {
+                // TODO: should other layers have a blending mode?
+                FAIL(KErrGeneral, _L("Blending mode can only be set for a group layer"));
+                }            
+            break;
+            }
+            
+         case  ENodeTypeParam:
+            {
+#ifdef _HUI_FX_PARSER_LOGGING
+            __ALFFXLOGSTRING("CHuiFxEffectParser::ParseNodeL - ENodeTypeParam");
+#endif
+            ResolveParamL(aNode, aLayer);
+            break;
+            }
+            
+        default:
+            __ALFFXLOGSTRING("CHuiFxEffectParser::ParseNodeL - default??");
+            break;
+        }
+    
+    }
+    
+CHuiFxEffectParser::TNodeType CHuiFxEffectParser::ResolveNode( CMDXMLNode* aNode )
+    {    
+    TPtrC nodeName( aNode->NodeName() );
+    if( nodeName.Compare( KLitLayerGroup ) == 0 )
+        {
+        return ENodeTypeGroup;
+        }
+    else if( nodeName.Compare( KLitFilter ) == 0 )
+        {
+        return ENodeTypeFilter;
+        }
+    else if( nodeName.Compare( KLitVisual ) == 0 )
+        {
+        return ENodeTypeVisual;
+        }
+    else if( nodeName.Compare( KLitBlending ) == 0 )
+        {
+        return ENodeTypeBlending;
+        }
+    else if( nodeName.Compare( KLitParam ) == 0 )
+        {
+        return ENodeTypeParam;
+        }
+    else if( nodeName.Compare( KLitStyle ) == 0 )
+        {
+        return ENodeTypeStyle;
+        }
+    else if( nodeName.Compare( KLitDuration ) == 0 )
+        {
+        return ENodeTypeDuration;
+        }
+    else if( nodeName.Compare( KLitKeyFrame ) == 0 )
+        {
+        return ENodeTypeKeyFrame;
+        }
+    else if( nodeName.Compare( KLitMarker ) == 0 )
+        {
+        return ENodeTypeMarker;
+        }
+    else if( nodeName.Compare( KLitStart ) == 0 )
+        {
+        return ENodeTypeStart;
+        }
+    else if( nodeName.Compare( KLitEnd ) == 0 )
+        {
+        return ENodeTypeEnd;
+        }
+    else
+        {
+        return ENodeTypeUnknown;
+        }
+    }
+
+// not locale dependent float parser
+static TReal32 ParseFloatVal(TPtrC valuePtr)
+    {
+    HBufC8 *buf = HBufC8::New(valuePtr.Length()+1);
+    if (!buf) return 0.0;
+    CleanupStack::PushL(buf);
+    buf->Des().Copy(valuePtr);
+    
+    TUint8 *buf2 = new TUint8[valuePtr.Length()+1];
+    if (!buf2) return 0.0;
+    int s = valuePtr.Length();
+    int i = 0;
+    for(;i<s;i++)
+        buf2[i] = buf->operator[](i);
+    buf2[i] = 0;
+    
+    TReal32 v = atof((const char*)buf2);
+    delete [] buf2;
+    CleanupStack::PopAndDestroy(buf);
+    return v;
+    }
+
+TReal32 CHuiFxEffectParser::ParseFloatAttributeL(CMDXMLNode* aNode, const TDesC& aName, TBool aMustExist)
+    {
+    TInt index = ((CMDXMLElement*)aNode)->FindIndex(aName);
+    if( index == KErrNotFound )
+        {
+        if (aMustExist)
+            {
+            FAIL1(KErrGeneral, _L("Attribute not found: %S"), &aName); // leaves 
+            return 0.0f; // never reached. For completeness
+            }
+        else
+            {
+            return 0.0f;
+            }
+        }
+
+    TPtrC attributeValue;
+    TPtrC attributeName;
+    TReal32 value = 0.0f;
+    User::LeaveIfError(((CMDXMLElement*)aNode)->AttributeDetails( index, attributeName, attributeValue ));
+
+    value = ParseFloatVal(attributeValue);
+    return value;
+    }
+
+TReal32 CHuiFxEffectParser::ParseFloatValueL(CMDXMLNode* aNode)
+    {
+    if ( !aNode || aNode->NodeType() != CMDXMLNode::ETextNode )
+        {
+        FAIL(KErrGeneral, _L("Text node expected while parsing a floating point value"));
+        }
+    
+    TPtrC valuePtr( ((CMDXMLText *)aNode)->Data() );
+    TReal32 v = ParseFloatVal(valuePtr);
+    return v;
+    }
+
+TRgb CHuiFxEffectParser::ParseColorValueL(CMDXMLNode* aNode)
+    {
+    // Parse color definition in HTML notation (#aarrggbb)
+    if ( !aNode || aNode->NodeType() != CMDXMLNode::ETextNode )
+        {
+        FAIL(KErrGeneral, _L("Text node expected while parsing a color value")); // leaves
+        return KRgbBlack; // never reached. For completeness
+        }
+    
+    TPtrC valuePtr( ((CMDXMLText *)aNode)->Data() );
+    TLex parser(valuePtr);
+
+    if (parser.Get() != '#')
+            {
+            FAIL(KErrGeneral, _L("Invalid color specification")); // leaves
+            return KRgbBlack; // never reached. For completeness
+            }
+
+    TUint32 color;
+    parser.Val(color, EHex);
+    // Opaque alpha by default
+    if (valuePtr.Length() <= 7)
+        {
+        color |= 0xff000000;
+        }
+    
+    TUint32 r = (color & 0x00ff0000) >> 16;
+    TUint32 g = (color & 0x0000ff00) >> 8;
+    TUint32 b = (color & 0x000000ff);
+    TUint32 a = (color & 0xff000000) >> 24;
+    
+    return TRgb(r, g, b, a);
+    }
+
+template <>
+TReal32 CHuiFxEffectParser::ParseAnimationKeyFrameValueL(CMDXMLNode* aNode, RHuiFxScalarTimeLine& /*aTimeLine*/)
+    {
+    return ParseFloatValueL(aNode);
+    }
+
+template <>
+TRgb CHuiFxEffectParser::ParseAnimationKeyFrameValueL(CMDXMLNode* aNode, RHuiFxColorTimeLine& /*aTimeLine*/)
+    {
+    return ParseColorValueL(aNode);
+    }
+
+template <typename PARAM_TYPE, typename TIMELINE_TYPE, typename VALUE_TYPE>
+void CHuiFxEffectParser::ParseAnimationNodeL(CMDXMLNode* aNode, PARAM_TYPE& aParam, TIMELINE_TYPE& aTimeLine)
+    {
+#ifdef _HUI_FX_PARSER_LOGGING
+    __ALFFXLOGSTRING1("CHuiFxEffectParser::ParseAnimationNodeL - 0x%x", this);
+#endif
+    switch( ResolveNode( aNode ) )
+        {
+        case ENodeTypeDuration:
+            {
+            aTimeLine.SetDuration(ParseFloatValueL(aNode->FirstChild()));
+            }
+            break;
+        case ENodeTypeStyle:
+            {
+            CMDXMLNode* styleNode = aNode->FirstChild();
+            if (styleNode->NodeType() != CMDXMLNode::ETextNode)
+                {
+                FAIL(KErrGeneral, _L("Text node expected while parsing an interpolation mode"));
+                }
+            TPtrC modePtr( ((CMDXMLText *)styleNode)->Data() );
+            
+            if( modePtr.Compare( KLitHold ) == 0 )
+                {
+                aTimeLine.SetInterpolationMode(EInterpolationModeHold);
+                }
+            else if( modePtr.Compare( KLitLinear ) == 0 )
+                {
+                aTimeLine.SetInterpolationMode(EInterpolationModeLinear);
+                }
+            else if( modePtr.Compare( KLitInQuad ) == 0 )
+                {
+                aTimeLine.SetInterpolationMode(EInterpolationModeInQuad);
+                }
+            else if( modePtr.Compare( KLitOutQuad ) == 0 )
+                {
+                aTimeLine.SetInterpolationMode(EInterpolationModeOutQuad);
+                }
+            else if( modePtr.Compare( KLitInOutQuad ) == 0 )
+                {
+                aTimeLine.SetInterpolationMode(EInterpolationModeInOutQuad);
+                }
+            else if( modePtr.Compare( KLitOutInQuad ) == 0 )
+                {
+                aTimeLine.SetInterpolationMode(EInterpolationModeOutInQuad);
+                }
+            else if( modePtr.Compare( KLitInBack ) == 0 )
+                {
+                aTimeLine.SetInterpolationMode(EInterpolationModeInBack);
+                }
+            else if( modePtr.Compare( KLitOutBack ) == 0 )
+                {
+                aTimeLine.SetInterpolationMode(EInterpolationModeOutBack);
+                }
+            else if( modePtr.Compare( KLitInOutBack ) == 0 )
+                {
+                aTimeLine.SetInterpolationMode(EInterpolationModeInOutBack);
+                }
+            else if( modePtr.Compare( KLitOutInBack ) == 0 )
+                {
+                aTimeLine.SetInterpolationMode(EInterpolationModeOutInBack);
+                }
+            else if( modePtr.Compare( KLitQuadraticBezier ) == 0 )
+                {
+                aTimeLine.SetInterpolationMode(EInterpolationModeQuadraticBezier);
+                }
+            else if( modePtr.Compare( KLitCubicBezier ) == 0 )
+                {
+                aTimeLine.SetInterpolationMode(EInterpolationModeCubicBezier);
+                }
+/*                
+            else if( modePtr.Compare( KLitDeclerate ) == 0 )
+                {
+                aTimeLine.SetInterpolationMode(EInterpolationModeDecelerate);
+                }
+            else if( modePtr.Compare( KLitAccelerate ) == 0 )
+                {
+                aTimeLine.SetInterpolationMode(EInterpolationModeAccelerate);
+                }
+            else if( modePtr.Compare( KLitImpulse ) == 0 )
+                {
+                aTimeLine.SetInterpolationMode(EInterpolationModeImpulse);
+                }
+*/                
+            else
+                {
+                // unknown (unsupported) interpolation modes default to linear
+                // (at least during testing when we add modes)
+                aTimeLine.SetInterpolationMode(EInterpolationModeLinear);
+//                FAIL(KErrGeneral, _L("Unknown interpolation mode"));
+                }
+            break;
+            }
+        case ENodeTypeMarker:
+            {
+            TReal32 time = ParseFloatAttributeL(aNode, KLitAt);
+            TInt typeIndex = ((CMDXMLElement*)aNode)->FindIndex( KLitType );
+            
+            if (typeIndex == KErrNotFound)
+                {
+                FAIL(KErrGeneral, _L("Marker name not found"));
+                }
+
+            TPtrC attributeValue;
+            TPtrC attributeName;
+            User::LeaveIfError(((CMDXMLElement*)aNode)->AttributeDetails( typeIndex, attributeName, attributeValue ));
+
+            // TODO: Should this be controllable?
+            aTimeLine.SetLoopingMode(ELoopingModeRepeat);
+
+            if (attributeValue.Compare(KLitLoopStart) == 0)
+                {
+                aTimeLine.SetLoopStart(time);
+                }
+            else if (attributeValue.Compare(KLitLoopEnd) == 0)
+                {
+                aTimeLine.SetLoopEnd(time);
+                }
+            else
+                {
+                FAIL(KErrGeneral, _L("Unsupported marker type"));
+                }
+            break;
+            }
+        case ENodeTypeKeyFrame:
+            {
+            TReal32 time = ParseFloatAttributeL(aNode, KLitAt);
+            TReal32 aux1 = ParseFloatAttributeL(aNode, KLitAux1, EFalse);
+            TReal32 aux2 = ParseFloatAttributeL(aNode, KLitAux2, EFalse);
+            VALUE_TYPE value = ParseAnimationKeyFrameValueL<PARAM_TYPE::ValueType, TIMELINE_TYPE>(aNode->FirstChild(), aTimeLine);
+            TRAPD(err, aTimeLine.AppendKeyFrameL(time, value, aux1, aux2));
+            if (err != KErrNone)
+                {
+                FAIL(KErrGeneral, _L("Unable to append new key frame to timeline"));
+                }
+            }
+            break;
+        case ENodeTypeStart:
+            {
+            TInt refIndex  = ((CMDXMLElement*)aNode)->FindIndex( KLitRef );
+            TReal32 refValue = 0;
+            TBool needRefValue = EFalse;
+            THuiFxReferencePoint ref = EReferencePointUndefined;
+            if ( refIndex != KErrNotFound )
+                {
+                ref = GetReferencePointL( aNode, refValue, needRefValue );
+                }
+            aParam.SetStartReference( ref );
+            if ( needRefValue )
+                {
+                aParam.SetStartValue( refValue );
+                }
+            if ( aParam.StartReference() != EReferencePointUndefined &&
+               aParam.EndReference() != EReferencePointUndefined )
+                {
+                aParam.SetReferencePoint( EReferencePointUndefined );
+                }
+	     float value = ParseFloatValueL(aNode->FirstChild());
+	     aParam.SetStartMultiplier( value );
+
+            }
+            break;
+        case ENodeTypeEnd:
+            {
+            TInt refIndex  = ((CMDXMLElement*)aNode)->FindIndex( KLitRef );
+            TReal32 refValue = 0;
+            TBool needRefValue = EFalse;
+            THuiFxReferencePoint ref = EReferencePointUndefined;
+            if ( refIndex != KErrNotFound )
+                {
+                ref = GetReferencePointL( aNode, refValue, needRefValue );
+                }
+            aParam.SetEndReference( ref );
+            if ( needRefValue )
+                {
+                aParam.SetEndValue( refValue );
+                }
+            if ( aParam.StartReference() != EReferencePointUndefined &&
+               aParam.EndReference() != EReferencePointUndefined )
+                {
+                aParam.SetReferencePoint( EReferencePointUndefined );
+                }
+            float value = ParseFloatValueL(aNode->FirstChild());
+            aParam.SetEndMultiplier( value );
+
+            }
+            break;
+        }
+#ifdef _HUI_FX_PARSER_LOGGING
+    __ALFFXLOGSTRING("CHuiFxEffectParser::ParseAnimationNodeL - out");
+#endif
+    }
+
+
+void CHuiFxEffectParser::ResolveParamL( CMDXMLNode* aNode, CHuiFxLayer* aLayer )
+    {
+#ifdef _HUI_FX_PARSER_LOGGING
+    __ALFFXLOGSTRING1("CHuiFxEffectParser::ResolveParamL - 0x%x",this);
+#endif
+    ASSERT(aNode->NodeType() == CMDXMLNode::EElementNode);
+
+    TInt nameIndex = ((CMDXMLElement*)aNode)->FindIndex( KLitName );
+    TInt typeIndex = ((CMDXMLElement*)aNode)->FindIndex( KLitType );
+    TInt refIndex  = ((CMDXMLElement*)aNode)->FindIndex( KLitRef );
+    if( nameIndex == KErrNotFound )
+        {
+        FAIL(KErrGeneral, _L("Parameter name not found"));
+        }
+    
+    THuiFxReferencePoint ref = EReferencePointIdentity;
+    TBool isAnimated = EFalse;
+    TPtrC paramName;
+    TPtrC attributeName;
+    User::LeaveIfError(((CMDXMLElement*)aNode)->AttributeDetails(nameIndex, attributeName, paramName));
+
+    if (typeIndex != KErrNotFound)
+        {
+        TPtrC paramType;
+        User::LeaveIfError(((CMDXMLElement*)aNode)->AttributeDetails(typeIndex, attributeName, paramType));
+
+        if( paramType.Compare( KLitAnim ) == 0 )
+            {
+            isAnimated = ETrue;
+            aLayer->SetAnimated(ETrue);
+            }
+        else
+            {
+            FAIL(KErrGeneral, _L("Unsupported parameter type"));
+            }
+        }
+    
+    TReal32 refValue;
+    TBool needRefValue = EFalse;
+    
+    
+    if ( refIndex != KErrNotFound )
+        {
+        ref = GetReferencePointL( aNode, refValue, needRefValue );
+        if ( ref == EReferencePointUndefined )
+            {
+            // For the parameters an undefined reference point means no value for the change
+            ref = EReferencePointIdentity;
+            }
+        }
+    
+    MHuiFxParameter* param = NULL;
+    if (aLayer && aLayer->Type() == ELayerTypeFilter)
+        {
+        CHuiFxFilterLayer* filterLayer = reinterpret_cast<CHuiFxFilterLayer*>(aLayer);
+        // We must check if we really have a filter.
+        // If the filter type was incorrect, a filter was not created
+        // We should not crash or panic even if the effect file is not syntactically correct.
+        // An incorrect file should simply produce no effect.
+        CHuiFxFilter& filter = filterLayer->Filter();
+        
+        if ( &filter )
+            {
+            param = filter.Parameter( paramName );
+            }
+        }
+    else if (aLayer && aLayer->Type() == ELayerTypeVisual)
+        {
+        CHuiFxVisualLayer* visualLayer = reinterpret_cast<CHuiFxVisualLayer*>(aLayer); 
+        param = visualLayer->Parameter(paramName);
+        }
+    
+    if (!param)
+        {
+        FAIL(KErrNotFound, _L("Parameter name not recognized")); // leaves
+        return; // never reached. For completeness
+        }
+
+    param->SetReferencePoint(ref);
+    if ( needRefValue )
+        {
+        param->SetReferenceValue( refValue );
+        }
+    
+    if (isAnimated)
+        {
+        // Collect animation keyframes and other parameters
+        switch (param->Type())
+            {
+            case EParameterTypeScalar:
+                {
+                RHuiFxScalarTimeLine* t = new (ELeave) RHuiFxScalarTimeLine();
+                CHuiFxScalarParameter* p = static_cast<CHuiFxScalarParameter*>(param); 
+                CleanupStack::PushL(t);
+                for (CMDXMLNode* child = aNode->FirstChild(); child; child = child->NextSibling())
+                    {
+                    ParseAnimationNodeL<CHuiFxScalarParameter, RHuiFxScalarTimeLine, CHuiFxScalarParameter::ValueType>(child, *p, *t);
+                    }
+                CleanupStack::Pop(t);
+                p->SetTimeLine(t);
+                if ( p->ReferencePoint() == EReferencePointUndefined )
+                    {
+                    if ( paramName.Compare( KLitScaleX ) == 0 )
+                        {
+                        p->SetReferencePoint( EReferencePointVisualWidth );
+                        }
+                    else if ( paramName.Compare( KLitScaleY ) == 0 )
+                        {
+                        p->SetReferencePoint( EReferencePointVisualHeight );
+                        }
+                    else
+                        {
+                        p->SetReferencePoint( EReferencePointIdentity );
+                        }
+                    }
+                break;
+                }
+        case EParameterTypeColor:
+                {
+                RHuiFxColorTimeLine* t = new (ELeave) RHuiFxColorTimeLine();
+                CHuiFxColorParameter* p = static_cast<CHuiFxColorParameter*>(param); 
+                CleanupStack::PushL(t);
+                for (CMDXMLNode* child = aNode->FirstChild(); child; child = child->NextSibling())
+                    {
+                    ParseAnimationNodeL<CHuiFxColorParameter, RHuiFxColorTimeLine, CHuiFxColorParameter::ValueType>(child, *p, *t);
+                    }
+                CleanupStack::Pop(t);
+                p->SetTimeLine(t);
+                if ( p->ReferencePoint() == EReferencePointUndefined )
+                    {
+                    p->SetReferencePoint( EReferencePointIdentity );
+                    }
+                break;
+                }
+            }
+        }
+    else
+        {
+        switch (param->Type())
+            {
+            case EParameterTypeScalar:
+                {
+                CHuiFxScalarParameter* p = static_cast<CHuiFxScalarParameter*>(param); 
+                p->SetValue(ParseFloatValueL(aNode->FirstChild()));
+                break;
+                }
+        case EParameterTypeColor:
+                {
+                CHuiFxColorParameter* p = static_cast<CHuiFxColorParameter*>(param); 
+                p->SetValue(ParseColorValueL(aNode->FirstChild()));
+                break;
+                }
+            }
+        }
+#ifdef _HUI_FX_PARSER_LOGGING
+    __ALFFXLOGSTRING("CHuiFxEffectParser::ResolveParamL - out ");
+#endif
+    }
+
+THuiFxFilterType CHuiFxEffectParser::GetFilterTypeL( CMDXMLNode* aNode )
+    {
+#ifdef _HUI_FX_PARSER_LOGGING
+    __ALFFXLOGSTRING1("CHuiFxEffectParser::GetFilterTypeL - 0x%x",this);
+#endif
+    if (aNode->NodeType() != CMDXMLNode::EElementNode)
+        {
+        FAIL(KErrGeneral, _L("Text node expected while reading filter type"));
+        }
+    
+    TInt attributeIndex = ((CMDXMLElement*)aNode)->FindIndex( KLitType );
+
+    if (attributeIndex == KErrNotFound)
+        {
+        FAIL(KErrGeneral, _L("Filter type not found"));
+        }
+    
+    TPtrC attributeValue;
+    TPtrC attributeName;
+    User::LeaveIfError(((CMDXMLElement*)aNode)->AttributeDetails( attributeIndex, attributeName, attributeValue));
+
+    if( attributeValue.Compare( KLitDesaturate ) == 0 )
+        {
+        return EFilterTypeDesaturate;
+        }
+    else if( attributeValue.Compare( KLitBlur ) == 0 )
+        {
+        return EFilterTypeBlur;
+        }
+    else if( attributeValue.Compare( KLitGlow ) == 0 )
+        {
+        return EFilterTypeGlow;
+        }
+    else if( attributeValue.Compare( KLitBrightnessContrast ) == 0 )
+        {
+        return EFilterTypeBrightnessContrast;
+        }
+    else if( attributeValue.Compare( KlitHSL ) == 0 )
+        {
+        return EFilterTypeHSL;
+        }
+    else if( attributeValue.Compare( KlitColorize ) == 0 )
+        {
+        return EFilterTypeColorize;
+        }
+    else if( attributeValue.Compare( KlitOutline ) == 0 )
+        {
+        return EFilterTypeOutline;
+        }
+    else if( attributeValue.Compare( KLitDropShadow ) == 0 )
+        {
+        // drop shadow is generated using outline filter
+        return EFilterTypeOutline;
+        }
+    else if( attributeValue.Compare( KlitBevel ) == 0 )
+        {
+        return EFilterTypeBevel;
+        }
+    else if ( attributeValue.Compare ( KlitTransform ) == 0 )
+        {
+        return EFilterTypeTransform;
+        }
+    else
+        {
+        return EFilterTypeUnknown;
+        }
+    }
+    
+THuiFxReferencePoint CHuiFxEffectParser::GetReferencePointL( CMDXMLNode* aNode, TReal32& aRefValue, TBool& aNeedRefValue )
+    {
+    __ALFFXLOGSTRING1("CHuiFxEffectParser::GetReferencePointL - 0x%x",this);
+    if (aNode->NodeType() != CMDXMLNode::EElementNode)
+        {
+        FAIL(KErrGeneral, _L("Text node expected while reading ref type"));
+        }
+    
+    TInt attributeIndex = ((CMDXMLElement*)aNode)->FindIndex( KLitRef );
+
+    THuiFxReferencePoint ref = EReferencePointIdentity;
+    if (attributeIndex == KErrNotFound)
+        {
+        ref = EReferencePointUndefined;
+        return ref;
+        }
+    aRefValue = 0;
+        
+    TPtrC attributeName;
+    TPtrC paramRef;
+    User::LeaveIfError(((CMDXMLElement*)aNode)->AttributeDetails( attributeIndex, attributeName, paramRef));
+    TReal32 refValue = 0;
+    TBool needRefValue = EFalse;
+
+    if ( paramRef.Compare( KLitVisualWidth ) == 0 )
+        {
+        ref = EReferencePointVisualWidth;
+        }
+    else if ( paramRef.Compare( KLitVisualHeight ) == 0 )
+        {
+        ref = EReferencePointVisualHeight;
+        }
+    else if ( paramRef.Compare( KLitVisualTop ) == 0 )
+        {
+        ref = EReferencePointVisualTop;
+        }
+    else if ( paramRef.Compare( KLitVisualBottom ) == 0 )
+        {
+        ref = EReferencePointVisualBottom;
+        }
+    else if ( paramRef.Compare( KLitVisualLeft ) == 0 )
+        {
+        ref = EReferencePointVisualLeft;
+        }
+    else if ( paramRef.Compare( KLitVisualRight ) == 0 )
+        {
+        ref = EReferencePointVisualRight;
+        }
+    else if ( paramRef.Compare( KLitDisplayWidth ) == 0 )
+        {
+        ref = EReferencePointDisplayWidth;
+        }
+    else if ( paramRef.Compare( KLitDisplayHeight ) == 0 )
+        {
+        ref = EReferencePointDisplayHeight;
+        }
+    else if ( paramRef.Compare( KLitDisplayTop ) == 0 )
+        {
+        ref = EReferencePointDisplayTop;
+        }
+    else if ( paramRef.Compare( KLitDisplayBottom ) == 0 )
+        {
+        ref = EReferencePointDisplayBottom;
+        }
+    else if ( paramRef.Compare( KLitDisplayLeft ) == 0 )
+        {
+        ref = EReferencePointDisplayLeft;
+        }
+    else if ( paramRef.Compare( KLitDisplayRight ) == 0 )
+        {
+        ref = EReferencePointDisplayRight;
+        }
+    else if ( paramRef.Compare( KLitExtRectWidth ) == 0 )
+        {
+        needRefValue = ETrue;
+        ref = EReferencePointExtRectWidth;
+        refValue = iExtRect.Width();
+        }
+    else if ( paramRef.Compare( KLitExtRectHeight ) == 0 )
+        {
+        needRefValue = ETrue;
+        ref = EReferencePointExtRectHeight;
+        refValue = iExtRect.Height();
+        }
+    else if ( paramRef.Compare( KLitExtRectTop ) == 0 )
+        {
+        needRefValue = ETrue;
+        ref = EReferencePointExtRectTop;
+        refValue = iExtRect.iTl.iY;
+        }
+    else if ( paramRef.Compare( KLitExtRectBottom ) == 0 )
+        {
+        needRefValue = ETrue;
+        ref = EReferencePointExtRectBottom;
+        refValue = iExtRect.iBr.iY;
+        }
+    else if ( paramRef.Compare( KLitExtRectLeft ) == 0 )
+        {
+        needRefValue = ETrue;
+        ref = EReferencePointExtRectLeft;
+        refValue = iExtRect.iTl.iX;
+        }
+    else if ( paramRef.Compare( KLitExtRectRight ) == 0 )
+        {
+        needRefValue = ETrue;
+        ref = EReferencePointExtRectRight;
+        refValue = iExtRect.iBr.iX;
+        }
+    // these are deprecated
+    else if (paramRef.Compare(KLitVisualWidth1) == 0)
+        {
+        ref = EReferencePointVisualWidth; 
+        }
+    else if (paramRef.Compare(KLitVisualHeight1) == 0)
+        {
+        ref = EReferencePointVisualHeight; 
+        }
+    else if (paramRef.Compare(KLitDisplayWidth1) == 0)
+        {
+        ref = EReferencePointDisplayWidth; 
+        }
+    else if (paramRef.Compare(KLitDisplayHeight1) == 0)
+        {
+        ref = EReferencePointDisplayHeight; 
+        }
+    else
+        {
+        FAIL(KErrGeneral, _L("Unsupported parameter reference point"));
+        }
+    aRefValue = refValue;
+    aNeedRefValue = needRefValue;
+#ifdef _HUI_FX_PARSER_LOGGING
+    __ALFFXLOGSTRING1("CHuiFxEffectParser::GetReferencePointL - return %d",ref);
+#endif
+    return ref;
+    }
+
+THuiFxVisualSrcType CHuiFxEffectParser::GetSrcTypeL( CMDXMLNode* aNode, TPtrC16& aBitmap )
+    {
+#ifdef _HUI_FX_PARSER_LOGGING
+    __ALFFXLOGSTRING1("CHuiFxEffectParser::GetSrcTypeL - 0x%x ",this);
+#endif
+    if (aNode->NodeType() != CMDXMLNode::EElementNode)
+        {
+        FAIL(KErrGeneral, _L("Text node expected while reading visual source type"));
+        }
+    TInt attributeIndex = ((CMDXMLElement*)aNode)->FindIndex( KLitSrc );
+    
+    if (attributeIndex == KErrNotFound)
+        {
+        // If src not found, the source defaults to visual itself
+        return EVisualSrcVisual;
+        }
+        
+    TPtrC attributeValue;
+    TPtrC attributeName;
+    User::LeaveIfError(((CMDXMLElement*)aNode)->AttributeDetails( attributeIndex, attributeName, attributeValue ));
+  
+    if( attributeValue.Compare( KLitItem ) == 0 )
+        {
+        return EVisualSrcVisual;
+        }
+    else if ( attributeValue.Compare( KLitInput1 ) == 0 )
+        {
+        // This means that the source is given as a parameter to the effect
+        return EVisualSrcInput1;
+        }
+    else if ( attributeValue.Compare( KLitInput2 ) == 0 )
+        {
+        // This means that the source is given as a parameter to the effect
+        return EVisualSrcInput2;
+        }
+    else
+        {
+        // if nothing else is defined, the src represents an external file (bitmap)
+        aBitmap.Set( attributeValue );
+        return EVisualSrcBitmap;
+        }
+    
+    }
+
+
+void CHuiFxEffectParser::FailL(TInt aCode, TRefByValue<const TDesC> aFormat, ...)
+    {
+    TBuf<512> message;
+    VA_LIST args;
+    VA_START(args, aFormat);
+    message.Append(_L("CHuiFxEffectParser::Fail(): "));
+    message.AppendFormatList(aFormat, args);
+    VA_END(args);
+    __ALFFXLOGSTRING1("CHuiFxEffectParser::FailL %S", &message);
+    User::InfoPrint( message );
+    User::Leave(aCode);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxEngine.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,644 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxEngine.h"
+#include "HuiFxEffectParser.h"
+#include "HuiFxEffect.h"
+#include "HuiFxEffectCache.h"
+#include <uiacceltk/HuiEnv.h>
+#include <uiacceltk/HuiStatic.h>
+#include <uiacceltk/HuiUtil.h>
+#include <bautils.h>
+#include <uiacceltk/HuiDisplay.h>
+
+#if 0
+_LIT(cache1, "C:\\Data\\drop_shadow.fxml");
+const TDesC *cache_array[]={ &cache1 };
+TInt cache_array_size = sizeof(cache_array)/sizeof(cache_array[0]);
+#endif
+
+EXPORT_C void CHuiFxEngine::ConstructL(THuiFxEngineType aEngineType)
+    {
+    iType = aEngineType;
+    iBuffersInUse = 0;
+#ifdef HUIFX_RBCACHE_ENABLED
+    iBuffersInCache = 0;
+    // critical to be initialised to zeros: zero indicates an empty entry in array.
+    memset(iBufferCache, '\0', sizeof(iBufferCache));
+#endif
+#ifdef HUIFX_EFFECTCACHE_ENABLED
+    iCache = CHuiFxEffectCache::NewL();
+
+#if 0
+    // Preloading cache items
+    for(int i=0;i<cache_array_size;i++)
+        {
+        const TDesC *filename = cache_array[i];
+        if (!BaflUtils::FileExists( CHuiStatic::FsSession(), *filename ))
+            {
+            continue;
+            }
+        CHuiFxEffect *effect = NULL;
+        TRect extRectI;
+        TRect *extRect = &extRectI;
+        CHuiFxEffectCacheEffectNode *node = new(ELeave) CHuiFxEffectCacheEffectNode(*filename, effect, 0, extRect, this);
+        CleanupStack::PushL(node);
+        iCache->FindOrCreateL(node); // moves ownership
+        CleanupStack::Pop();
+        //delete effect; // no need for this effect.
+        }
+#endif
+#endif
+    CHuiStatic::Env().AddMemoryLevelObserver(this);
+    }
+
+EXPORT_C TBool CHuiFxEngine::FxmlUsesInput1(const TDesC &aFileName)
+    {
+#ifdef HUIFX_EFFECTCACHE_ENABLED
+    return iCache->FxmlUsesInput1(aFileName);
+#endif
+#ifndef HUIFX_EFFECTCACHE_ENABLED
+    return EFalse;
+#endif
+    }
+    
+EXPORT_C void CHuiFxEngine::RegisterEffectL(const TDesC &aFileName)
+    {
+#ifdef HUIFX_EFFECTCACHE_ENABLED
+    const TDesC *filename = &aFileName;
+    if (!BaflUtils::FileExists( CHuiStatic::FsSession(), *filename ))
+        {
+        return;
+        }
+    CHuiFxEffect *effect = NULL;
+    TRect extRectI;
+    TRect *extRect = &extRectI;
+    CHuiFxEffectCacheEffectNode *node = new(ELeave) CHuiFxEffectCacheEffectNode(*filename, effect, 0, extRect, this);
+    CleanupStack::PushL(node);
+    iCache->CreateL(node); // moves ownership
+    CleanupStack::Pop();
+#endif
+    }
+
+#ifdef HUIFX_EFFECTCACHE_ENABLED
+EXPORT_C void CHuiFxEngine::UnRegisterEffectL(const TDesC &aFileName)
+    {
+    MHuiFxEffectCacheNode *node = iCache->FindDup(aFileName);
+    if (node) 
+        iCache->UnUse(node);
+#else
+EXPORT_C void CHuiFxEngine::UnRegisterEffectL(const TDesC &)
+    {
+#endif
+    }
+
+EXPORT_C void CHuiFxEngine::LoadEffectL(
+    const TDesC& aFileName,
+    CHuiFxEffect*& aEffect,
+    MHuiEffectable* aVisual,
+#ifndef HUIFX_EFFECTCACHE_ENABLED
+    TRect* extRect,
+#else
+    TRect*,
+#endif		
+    MAlfGfxEffectObserver* aEffectEndObserver,
+    TInt aHandle, 
+    TInt aFlags )
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEngine::LoadEffectL - %S, 0x%x, 0x%x"),&aFileName, aVisual, aEffect );
+#endif
+    if (aFileName.Length() == 0)
+    	{
+    	User::Leave( KErrNotFound);
+    	}
+    //TODO: reuse parser?
+    if( aEffect != NULL ) User::Leave( KErrGeneral );
+#ifndef HUIFX_EFFECTCACHE_ENABLED
+    iExtRect = TRect(); // clear the extrect
+    if ( extRect )
+        {
+        iExtRect = *extRect;
+        }
+    CHuiFxEffectParser* parser = CHuiFxEffectParser::NewL( *this, aVisual );
+    CleanupStack::PushL( parser );
+    parser->SetEffectEndObserver( aEffectEndObserver, aHandle );
+    parser->SetEffectFlags( aFlags );
+    // Parsing is asychronous, but we are not waiting for it to end.
+    // CHuiFxEffectParser will take care of everything, and CHuiVisual
+    // will kill the parser when parsing is finished or cancelled.
+    aVisual->SetEffectParser( parser ); // ownership transferred
+    CleanupStack::Pop( parser );    
+    parser->ParseL( aFileName, iExtRect );
+#endif
+#ifdef HUIFX_EFFECTCACHE_ENABLED
+    CHuiFxEffectCacheEffectNode *node = new (ELeave) CHuiFxEffectCacheEffectNode(aFileName, aEffect, aVisual, &iExtRect, this);
+    node->SetEffectEndObserver( aEffectEndObserver, aHandle );
+    aFlags |= KHuiFxDelayRunUntilFirstFrameHasBeenDrawn;
+    node->SetEffectFlags( aFlags );
+    CleanupStack::PushL(node);
+    iCache->FindOrCreateL(node); // takes ownership
+    CleanupStack::Pop();
+#endif
+    }
+
+EXPORT_C void CHuiFxEngine::LoadGroupEffectL(
+    const TDesC& aFileName,
+    CHuiFxEffect*& aEffect,
+    MHuiEffectable* aVisual,
+    TInt aGroup,
+#ifndef HUIFX_EFFECTCACHE_ENABLED
+    TRect* extRect,
+#else
+    TRect*,
+#endif		
+    MAlfGfxEffectObserver* aEffectEndObserver,
+    TInt aHandle,
+    TInt aFlags )
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEngine::LoadEffectL - %S, 0x%x, 0x%x"),&aFileName, aVisual, aEffect );
+#endif
+    if (aFileName.Length() == 0)
+    	{
+    	User::Leave( KErrNotFound);
+    	}
+    //TODO: reuse parser?
+    if( aEffect != NULL ) User::Leave( KErrGeneral );
+#ifndef HUIFX_EFFECTCACHE_ENABLED
+    iExtRect = TRect(); // clear the extrect
+    if ( extRect )
+        {
+        iExtRect = *extRect;
+        }
+    CHuiFxEffectParser* parser = CHuiFxEffectParser::NewL( *this, aVisual );
+    CleanupStack::PushL( parser );
+    parser->SetEffectEndObserver( aEffectEndObserver, aHandle );
+    parser->SetEffectFlags( aFlags );
+    // Parsing is asychronous, but we are not waiting for it to end.
+    // CHuiFxEffectParser will take care of everything, and CHuiVisual
+    // will kill the parser when parsing is finished or cancelled.
+    aVisual->SetEffectParser( parser ); // ownership transferred
+    CleanupStack::Pop( parser );    
+    parser->ParseL( aFileName, iExtRect );
+#endif
+#ifdef HUIFX_EFFECTCACHE_ENABLED
+    CHuiFxEffectCacheEffectNode *node = new (ELeave) CHuiFxEffectCacheEffectNode(aFileName, aEffect, aVisual, &iExtRect, this);
+    node->SetEffectEndObserver( aEffectEndObserver, aHandle );
+    if (aGroup != KErrNotFound)
+    	{
+		aFlags |= KHuiFxWaitGroupSyncronization;
+		node->SetEffectGroup(aGroup);
+    	}
+    aFlags |= KHuiFxDelayRunUntilFirstFrameHasBeenDrawn;
+    node->SetEffectFlags( aFlags );
+    
+    CleanupStack::PushL(node);
+    iCache->FindOrCreateL(node); // takes ownership
+    CleanupStack::Pop();
+#endif
+    }
+EXPORT_C CHuiFxEngine::~CHuiFxEngine()
+    {  
+    iActiveEffects.ResetAndDestroy();
+    iActiveEffects.Close();
+#ifdef HUIFX_EFFECTCACHE_ENABLED
+    delete iCache;
+#endif
+    CHuiStatic::Env().RemoveMemoryLevelObserver(this);
+    }
+
+EXPORT_C void CHuiFxEngine::Release()
+    {
+    ASSERT(iBuffersInUse == 0);
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEngine::Release - 0x%x"),this);
+#endif
+#ifdef HUIFX_RBCACHE_ENABLED
+    int freedBuffers = 0;
+    for(int i = 0; i < CACHE_SIZE; i++)
+        {
+        CHuiFxRenderbuffer *entry = iBufferCache[i];
+        if(entry)
+            {
+            ReleaseNativeRenderbuffer(entry);
+            iBufferCache[i] = 0;
+            freedBuffers++;
+            }
+        }
+    // there should be as many freed buffers as there were free buffers.
+    ASSERT(freedBuffers == iBuffersInCache);
+#endif
+    }
+
+EXPORT_C void CHuiFxEngine::RestoreL()
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEngine::RestoreL - 0x%x "), this);
+#endif
+#ifdef HUIFX_RBCACHE_ENABLED
+    memset(iBufferCache, '\0', sizeof(iBufferCache));
+    iBuffersInCache = 0;
+#endif
+    iBuffersInUse = 0;
+    }
+
+void CHuiFxEngine::NotifyEffectEndObservers()
+    {
+    for ( TInt i = iActiveEffects.Count() - 1; i >= 0; i-- )
+        {
+        CHuiFxEffect* effect = iActiveEffects[i];
+        if (!effect->Changed())
+            {
+            effect->NotifyEffectEndObserver();
+            }
+        }    
+    }
+
+EXPORT_C void CHuiFxEngine::AdvanceTime(TReal32 aElapsedTime)
+    {
+    // TODO: Can we do anything about all this polling?
+    TInt i;
+    TBool refreshRequired = EFalse;
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEngine::AdvanceTime - 0x%x "), this);   
+#endif
+    // Go through the list in reverse order.
+// If the effect has ended, and has the callback set,
+// the effect will be removed, and will no longer be part of iActiveEffects set.
+// We must check if the effect is still in our list, but the indices change
+// if something is removed from the middle of the list
+    for ( i = iActiveEffects.Count() - 1; i >= 0; i-- )
+        {
+        CHuiFxEffect* effect = iActiveEffects[i];
+        if (effect->Changed())
+            {
+            refreshRequired = ETrue;
+            }
+        if ( i < iActiveEffects.Count() && effect == iActiveEffects[i] && !(effect->EffectFlags() & KHuiFxWaitGroupSyncronization))
+            {
+            // The effect is still in its place, it did not go away yet
+            effect->AdvanceTime(aElapsedTime);
+            }
+        }
+    
+    if (refreshRequired)
+        {
+#ifdef HUIFX_TRACE    
+        RDebug::Print(_L("CHuiFxEngine::AdvanceTime - manually continue refresh "));
+#endif
+        CHuiStatic::Env().ContinueRefresh();
+        }
+    }
+
+EXPORT_C void CHuiFxEngine::AddEffectL(CHuiFxEffect* aEffect)
+    {
+#ifdef HUIFX_TRACE        
+    RDebug::Print(_L("CHuiFxEngine::AddEffectL - 0x%x "), aEffect);
+#endif // #ifdef HUIFX_TRACE    
+
+    iActiveEffects.AppendL(aEffect);
+    }
+
+EXPORT_C void CHuiFxEngine::RemoveEffect(CHuiFxEffect* aEffect)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEngine::RemoveEffect - 0x%x "), aEffect);
+#endif    
+    TInt i = iActiveEffects.Find(aEffect);
+    if (i >= 0)
+        {
+        iActiveEffects.Remove(i);
+        }
+    }
+
+EXPORT_C TReal32 CHuiFxEngine::GetReferenceValue(THuiFxReferencePoint aPoint)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEngine::GetReferenceValue - %d "), aPoint);
+#endif
+    switch (aPoint)
+        {
+        case EReferencePointDisplayWidth:
+        case EReferencePointDisplayRight:
+            {
+            CHuiDisplay* display = &CHuiStatic::Env().PrimaryDisplay(); 
+            return display->VisibleArea().Size().iWidth; // was DefaultRenderbuffer()->Size().iWidth
+            }
+        case EReferencePointDisplayHeight:
+        case EReferencePointDisplayBottom:
+            {
+            CHuiDisplay* display = &CHuiStatic::Env().PrimaryDisplay(); 
+            return display->VisibleArea().Size().iHeight; // was DefaultRenderbuffer()->Size().iHeight
+            }
+        default:
+            break;
+        }
+    // display left and top return 0
+    return 0.0f;
+    }
+
+EXPORT_C THuiFxEngineType CHuiFxEngine::EngineType()
+    {
+    return iType;
+    }
+
+EXPORT_C CHuiFxRenderbuffer* CHuiFxEngine::AcquireRenderbuffer(const TSize& aDesiredSize)
+    {
+    return AcquireRenderbuffer(aDesiredSize, ETrue);
+    }
+
+CHuiFxRenderbuffer* CHuiFxEngine::AcquireRenderbuffer(const TSize& aDesiredSize, TBool aAllowLarger)
+    {
+    CHuiFxRenderbuffer *buffer = 0;
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEngine::AcquireRenderbuffer - w: %d h: %d "), aDesiredSize.iWidth, aDesiredSize.iHeight);
+#endif    
+    
+#ifdef HUIFX_RBCACHE_ENABLED
+    if(!IsCacheEmpty())
+        {
+        buffer = LookupFreeRenderbuffer(aDesiredSize, aAllowLarger);
+        }
+
+    if(buffer == 0)     // no free or no suitable buffer available --- create new
+        {
+#endif        
+        buffer = AcquireNativeRenderbuffer(aDesiredSize);
+#ifdef HUIFX_RBCACHE_ENABLED
+        if(!IsCacheEmpty())
+            {
+#ifdef HUIFX_TRACE                
+            RDebug::Print(_L("CHuiFxEngine::AcquireRenderbuffer() --- no suitable buffer found from cache even if it is populated. Needed buffer size: %dx%d"), aDesiredSize.iWidth, aDesiredSize.iHeight);
+#endif
+            }
+        }
+    else
+        {
+        buffer->SetPosition(TPoint(0,0));
+        buffer->EnableBackground(EFalse);
+        buffer->PrepareForReuse(aDesiredSize);   // clean up the buffer
+        }
+#endif
+    iBuffersInUse++;
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEngine::AcquireRenderbuffer - buffer 0x%x "), buffer);
+#endif
+    return (CHuiFxRenderbuffer *)buffer;
+    }
+
+// try to find a reusable buffer from iFreeBufferList
+#ifdef HUIFX_RBCACHE_ENABLED
+
+CHuiFxRenderbuffer* CHuiFxEngine::LookupFreeRenderbuffer(const TSize& aDesiredSize, TBool aAllowLarger)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEngine::LookupFreeRenderbuffer - w: %d h: %d "), aDesiredSize.iWidth, aDesiredSize.iHeight);
+#endif
+#ifdef _DEBUG    
+    const int preFreeBuffers = iBuffersInCache;
+#endif
+    CHuiFxRenderbuffer *buffer = 0;
+    int i;
+
+    for(i = 0; i < CACHE_SIZE; i++)
+        {
+        if(iBufferCache[i])
+            {
+            const TSize& bufferSize = iBufferCache[i]->Size();
+            
+            if (aAllowLarger)
+                {
+                if ((aDesiredSize.iHeight <= bufferSize.iHeight) && (aDesiredSize.iWidth <= bufferSize.iWidth))
+                    {
+                    buffer = iBufferCache[i];
+                    iBufferCache[i] = 0;     // mark entry as empty
+                    iBuffersInCache--;
+                    break;                      // we've found a suitable buffer 
+                    }                
+                }
+            else
+                {
+                if ((aDesiredSize.iHeight == bufferSize.iHeight) && (aDesiredSize.iWidth == bufferSize.iWidth))
+                    {
+                    buffer = iBufferCache[i];
+                    iBufferCache[i] = 0;     // mark entry as empty
+                    iBuffersInCache--;
+                    break;                      // we've found a suitable buffer 
+                    }                
+                
+                }
+            }
+        }
+    
+    // sanity check
+    ASSERT(((buffer != 0) ? (preFreeBuffers == iBuffersInCache + 1) : (preFreeBuffers == iBuffersInCache)));
+    
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEngine::LookupFreeRenderbuffer - buffer 0x%x "), buffer);
+#endif
+    return buffer;
+    }
+#endif
+
+EXPORT_C void CHuiFxEngine::ReleaseRenderbuffer(CHuiFxRenderbuffer* aBuffer)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEngine::ReleaseRenderbuffer - buffer: 0x%x "), aBuffer);
+#endif
+    ASSERT((aBuffer) && (iBuffersInUse > 0));
+
+#ifdef HUIFX_RBCACHE_ENABLED
+    if(iLowGraphicsMemoryMode || IsCacheFull())
+        {
+#ifdef HUIFX_TRACE            
+        RDebug::Print(_L("CHuiFxEngine::ReleaseRenderbuffer() --- Renderbuffer cache full! Suspectible for memory fragmentation! Cache size is %d entries."), CACHE_SIZE);
+#endif
+#endif        
+        ReleaseNativeRenderbuffer(aBuffer);
+        aBuffer = 0;
+#ifdef HUIFX_RBCACHE_ENABLED
+        }
+    else
+        {
+        InsertFreeRenderbuffer(aBuffer);        
+        }
+#endif
+    iBuffersInUse--;
+    }
+
+#ifdef HUIFX_RBCACHE_ENABLED
+void CHuiFxEngine::InsertFreeRenderbuffer(CHuiFxRenderbuffer* aBuffer)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEngine::InsertFreeRenderbuffer - buf: 0x%x "), aBuffer);
+#endif
+#ifdef _DEBUG    
+	const int preiFreeBuffers = iBuffersInCache;
+#endif
+    
+    ASSERT((aBuffer) && (!IsCacheFull()));
+    
+    for(int i = 0; i < CACHE_SIZE; i++)
+        {
+        if(iBufferCache[i] == 0)
+            {
+            iBufferCache[i] = aBuffer;
+            iBuffersInCache++;
+            aBuffer = 0;
+            break;
+            }
+        }
+    
+    ASSERT((aBuffer == 0) && (preiFreeBuffers + 1 == iBuffersInCache));   // we have actually inserted the aBuffer into iFreeBufferList successfully?
+    }
+
+inline TBool CHuiFxEngine::IsCacheEmpty() const 
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEngine::IsCacheEmpty - %d "), (iBuffersInCache == 0));
+#endif
+    if(iBuffersInCache == 0)
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+inline TBool CHuiFxEngine::IsCacheFull() const  
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxEngine::IsCacheFull - %d "), (iBuffersInCache == CACHE_SIZE));
+#endif
+    if(iBuffersInCache == CACHE_SIZE)
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+#endif
+
+EXPORT_C void CHuiFxEngine::EnableLowMemoryState(TBool /*aEnable*/)
+    {
+    // deprecated
+    }
+    
+EXPORT_C void  CHuiFxEngine::SetMemoryLevel(THuiMemoryLevel aLevel)
+    {
+    iLowGraphicsMemoryMode = aLevel;
+    if(iLowGraphicsMemoryMode) // != Normal
+        {
+        ClearCache();
+        }
+    }
+
+EXPORT_C void CHuiFxEngine::Composite(CHuiGc& /*aGc*/, CHuiFxRenderbuffer& /*aSource*/, const TPoint& /*aTargetPoint*/, TBool /*aOpaque*/, TInt /*aAlpha*/)
+    {
+    // Default implementation does nothing
+    }
+
+TInt CHuiFxEngine::LowMemoryState()
+    {
+    return iLowGraphicsMemoryMode;
+    }
+
+TBool CHuiFxEngine::HasActiveEffects() const
+    {
+    return iActiveEffects.Count() > 0;
+    }
+
+void CHuiFxEngine::ClearCache()
+    {
+    // Release cached render targets from effects
+    for (TInt j=0; j<iActiveEffects.Count();j++)
+        {
+        iActiveEffects[j]->ReleaseCachedRenderTarget();
+        }
+    
+    if(IsCacheEmpty())
+        {
+        return;
+        }
+    else
+        {
+        //clear cache
+        for(TInt i = 0; i < CACHE_SIZE; i++)
+                {
+                if(iBufferCache[i] != 0)
+                    {
+                    ReleaseNativeRenderbuffer(iBufferCache[i]);
+                    iBufferCache[i] = 0;
+                    iBuffersInCache--;
+                    }
+                }
+        }
+    
+    ASSERT(iBuffersInCache == 0);    
+    }
+	
+EXPORT_C void CHuiFxEngine::BeginGroupEffect(TInt aGroup)
+	{
+	TInt index = iActiveEffectGroups.Find(aGroup);
+	if (index == KErrNotFound)
+		{
+		iActiveEffectGroups.Append(aGroup);
+		}
+	else
+		{
+		// group already exists
+		}
+	}
+
+EXPORT_C TInt CHuiFxEngine::ActiveGroupEffect()
+	{
+	if (iActiveEffectGroups.Count() > 0)
+		{
+		return iActiveEffectGroups[iActiveEffectGroups.Count()-1];
+		}
+	else
+		{
+		return KErrNotFound;
+		}
+	}
+
+EXPORT_C void CHuiFxEngine::StartGroupEffect(TInt aGroup)
+	{
+	TInt index = iActiveEffectGroups.Find(aGroup);
+	if (index != KErrNotFound)
+		{
+		iActiveEffectGroups.Remove(index);
+	
+		for ( TInt i = iActiveEffects.Count() - 1; i >= 0; i-- )
+			{
+			CHuiFxEffect* effect = iActiveEffects[i];
+			TInt flags = effect->EffectFlags();
+			if ((flags & KHuiFxWaitGroupSyncronization) && (effect->GroupId() == aGroup))
+				{
+				flags &= ~KHuiFxWaitGroupSyncronization;
+				effect->SetEffectFlags(flags);
+				}
+			}
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxFilter.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,162 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxFilter.h"
+#include "HuiFxScalarParameter.h"
+#include "HuiFxColorParameter.h"
+#include "HuiFxParameterManager.h"
+#include "HuiFxConstants.h"
+
+
+EXPORT_C void CHuiFxFilter::ConstructL()
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxFilter::ConstructL - 0x%x "), this);
+#endif
+    iMargin = TSize(0, 0);
+    iIsFreeForm = EFalse;
+    iOpacity = 1.0f;
+    iParameterChanged = EFalse;
+    iFirstParameterCheck = ETrue;
+    iFrameCount = ETrue;
+    iParameterManager = CHuiFxParameterManager::NewL();
+    RegisterParameterL(KLitOpacityParameter, &iOpacity);
+    }
+
+EXPORT_C void CHuiFxFilter::CopyFromL(const CHuiFxFilter *aOldFilter)
+    {
+    iMargin = aOldFilter->iMargin;
+    iIsFreeForm = aOldFilter->iIsFreeForm;
+    iOpacity = aOldFilter->iOpacity;
+    iParameterChanged = aOldFilter->iParameterChanged;
+    iFirstParameterCheck = aOldFilter->iFirstParameterCheck;
+    iFrameCount = aOldFilter->iFrameCount;
+    iParameterManager = aOldFilter->iParameterManager->CloneL();
+    CopyParameterL(KLitOpacityParameter, &iOpacity, aOldFilter);
+    }
+
+EXPORT_C CHuiFxFilter::~CHuiFxFilter()
+    {
+    delete iParameterManager;
+    iParameterManager = NULL;
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxFilter::~CHuiFxFilter - 0x%x "), this);
+#endif
+    }
+
+EXPORT_C TBool CHuiFxFilter::Changed() const
+    {
+    return iParameterManager->HasAnimatedParameters();
+    }
+
+EXPORT_C TBool CHuiFxFilter::PrepareDrawL(CHuiFxEngine& aEngine)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxFilter::PrepareDrawL - 0x%x "), this);
+#endif
+    iFrameCount++;
+    iParameterChanged = iParameterManager->Update(aEngine, VisualRect());
+    return ETrue;
+    }
+EXPORT_C void CHuiFxFilter::CalculateMargin(TMargins &aMargin) const
+    {
+    aMargin.iLeft = 0;
+    aMargin.iRight = 0;
+    aMargin.iTop = 0;
+    aMargin.iBottom = 0;
+    }
+
+EXPORT_C void CHuiFxFilter::AdvanceTime(TReal32 aElapsedTime)
+    {
+    iParameterManager->AdvanceTime(aElapsedTime);
+    }
+
+EXPORT_C void CHuiFxFilter::SetMargin(const TSize& aMargin)
+    {
+    iMargin = aMargin;
+    }
+
+EXPORT_C const TSize& CHuiFxFilter::Margin() const
+    {
+    return iMargin;
+    }
+EXPORT_C const TMargins &CHuiFxFilter::Margin2() const
+    {
+    CalculateMargin(iMargin2);
+    return iMargin2;
+    }
+
+EXPORT_C void CHuiFxFilter::SetFreeForm(TBool aEnable)
+    {
+    iIsFreeForm = aEnable;
+    }
+
+EXPORT_C TBool CHuiFxFilter::IsFreeForm() const
+    {
+    return iIsFreeForm;
+    }
+
+EXPORT_C MHuiFxParameter* CHuiFxFilter::Parameter(const TDesC& aName)
+    {
+    return iParameterManager->Parameter(aName);
+    }
+
+EXPORT_C void CHuiFxFilter::RegisterParameterL(const TDesC& aName, TReal32* aValue)
+    {
+    iParameterManager->RegisterParameterL(aName, aValue);
+    }
+
+EXPORT_C void CHuiFxFilter::RegisterParameterL(const TDesC& aName, TRgb* aValue)
+    {
+    iParameterManager->RegisterParameterL(aName, aValue);
+    }
+EXPORT_C void CHuiFxFilter::CopyParameterL(const TDesC& aName, TRgb* aValue, const CHuiFxFilter *aOldFilter)
+    {
+    iParameterManager->CopyParameterL(aName, aValue, aOldFilter->iParameterManager);
+    }
+EXPORT_C void CHuiFxFilter::CopyParameterL(const TDesC& aName, TReal32* aValue, const CHuiFxFilter *aOldFilter)
+    {
+    iParameterManager->CopyParameterL(aName, aValue, aOldFilter->iParameterManager);    
+    }
+
+EXPORT_C TBool CHuiFxFilter::ParameterChanged()
+    {
+    if(iFirstParameterCheck)
+        {
+        iFirstParameterCheck = EFalse;
+        return ETrue;
+        }
+    else
+        {
+        return iParameterChanged || (iFrameCount <= 1);
+        }
+    }
+
+EXPORT_C void CHuiFxFilter::SetVisualRect(const TRect& aRect)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxFilter::SetVisualRect - 0x%x (%d,%d,%d,%d))"), this, aRect.iTl.iX, aRect.iTl.iY, aRect.iBr.iX, aRect.iBr.iY);
+#endif
+    iVisualRect = aRect;
+    }
+
+EXPORT_C const TRect& CHuiFxFilter::VisualRect() const
+    {
+    return iVisualRect;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxFilterLayer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxFilterLayer.h"
+#include "HuiFxFilter.h"
+
+CHuiFxFilterLayer* CHuiFxFilterLayer::NewL(CHuiFxFilter* aFilter)
+    {
+    CHuiFxFilterLayer* e = new (ELeave) CHuiFxFilterLayer();
+    CleanupStack::PushL(e);
+    e->ConstructL(aFilter);
+    CleanupStack::Pop(e);
+    return e;
+    }
+
+CHuiFxFilterLayer::CHuiFxFilterLayer()
+    {
+#ifdef HUIFX_TRACE        
+    RDebug::Print(_L("CHuiFxFilterLayer::CHuiFxFilterLayer - 0x%x "), this);
+#endif
+    }
+
+CHuiFxFilterLayer::~CHuiFxFilterLayer()
+    {
+    delete iFilter;
+    iFilter = NULL;
+#ifdef HUIFX_TRACE 
+    RDebug::Print(_L("CHuiFxFilterLayer::~CHuiFxFilterLayer - 0x%x "), this);
+#endif
+    }
+EXPORT_C CHuiFxFilterLayer *CHuiFxFilterLayer::CloneL() const
+{
+    CHuiFxFilter *filter = iFilter->CloneL();
+    CHuiFxFilterLayer *layer = CHuiFxFilterLayer::NewL(filter);
+    layer->CHuiFxLayer::CopyFromL(this);
+    return layer;
+}
+EXPORT_C void CHuiFxFilterLayer::SetExtRect( TRect * /*aExtRect*/ )
+    {
+    // iFilter does not need these
+    }
+EXPORT_C void CHuiFxFilterLayer::SetVisual( CHuiVisual * /*aVisual*/ )
+    {
+    // iFilter does not need these
+    }
+EXPORT_C void CHuiFxFilterLayer::SetVisual( MHuiEffectable *aVisual )
+    {
+    // iFilter does not need these
+    }
+
+
+EXPORT_C void CHuiFxFilterLayer::ConstructL(CHuiFxFilter* aFilter)
+    {
+    CHuiFxLayer::ConstructL( ELayerTypeFilter );
+    iFilter = aFilter;
+    }
+
+EXPORT_C TBool CHuiFxFilterLayer::PrepareDrawL(CHuiFxEngine& aEngine)
+    {
+    return iFilter->PrepareDrawL(aEngine);
+    }
+
+
+EXPORT_C TBool CHuiFxFilterLayer::Changed() const
+    {
+#ifdef HUIFX_TRACE 
+    RDebug::Print(_L("CHuiFxFilterLayer::Changed - 0x%x %d"), this,iFilter->Changed() );
+#endif
+    return iFilter->Changed();
+    }
+
+EXPORT_C void CHuiFxFilterLayer::AdvanceTime(TReal32 aElapsedTime)
+    {
+    iFilter->AdvanceTime(aElapsedTime);
+    }
+
+EXPORT_C void CHuiFxFilterLayer::Draw(CHuiFxEngine& aEngine, CHuiGc& aGc, CHuiFxRenderbuffer& aTarget, CHuiFxRenderbuffer& aSource)
+    {
+#ifdef HUIFX_TRACE 
+	RDebug::Print(_L("CHuiFxFilterLayer::Draw - 0x%x "), this);
+#endif
+// TODO: fast path
+    CHuiFxRenderbuffer* backBuffer = aEngine.AcquireRenderbuffer(TargetRect().Size());
+
+    if (!backBuffer)
+        {
+        return;
+        }
+
+    // Render the filter
+    TRect targetRect(TPoint(0, 0), TargetRect().Size());
+    TInt alpha = 0xff; // TODO
+
+    iFilter->Draw(aEngine, aGc, *backBuffer, aSource, targetRect, SourceRect());
+
+    // Composite the result
+    TRect compositionSourceRect(targetRect);
+    TRect compositionTargetRect(TargetRect());
+    
+    compositionTargetRect.Move(-aTarget.Position());
+    
+    aEngine.Composite(aTarget, *backBuffer, compositionTargetRect, compositionSourceRect, BlendingMode(), alpha);
+    aEngine.ReleaseRenderbuffer(backBuffer);
+    }
+
+EXPORT_C TBool CHuiFxFilterLayer::Margin(TMargins &m)
+   {
+   TMargins s = iFilter->Margin2();
+   m.iTop = s.iTop;
+   m.iBottom = s.iBottom;
+   m.iLeft = s.iLeft;
+   m.iRight = s.iRight;
+   return ETrue;
+   }
+
+EXPORT_C CHuiFxFilter& CHuiFxFilterLayer::Filter() const
+    {
+    return *iFilter;
+    }
+
+TBool CHuiFxFilterLayer::IsFiltered() const
+    {
+    return ETrue;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxGroupLayer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,449 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxGroupLayer.h"
+
+EXPORT_C CHuiFxGroupLayer::CHuiFxGroupLayer()
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxGroupLayer::CHuiFxGroupLayer - 0x%x "), this);
+#endif
+    }
+
+EXPORT_C CHuiFxGroupLayer::~CHuiFxGroupLayer()
+    {
+    /*for (TInt i = 0; i < iLayers.Count(); i++)
+        {
+        delete iLayers[i];
+        }
+    iLayers.Close();*/
+    iLayers.ResetAndDestroy();
+    iLayers.Close();
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxGroupLayer::~CHuiFxGroupLayer - 0x%x "), this);
+#endif
+    }
+
+EXPORT_C CHuiFxGroupLayer* CHuiFxGroupLayer::NewL(TBool aIsRoot)
+    {
+    CHuiFxGroupLayer* e = new (ELeave) CHuiFxGroupLayer();
+    CleanupStack::PushL(e);
+    e->ConstructL(aIsRoot);
+    CleanupStack::Pop(e);
+    return e;
+    }
+
+EXPORT_C CHuiFxGroupLayer *CHuiFxGroupLayer::CloneL() const
+{
+   CHuiFxGroupLayer *gl = new (ELeave)CHuiFxGroupLayer;
+   gl->CHuiFxLayer::CopyFromL(this);
+   for(int i=0;i<iLayers.Count();i++)
+       {
+       CHuiFxLayer *layer = iLayers[i];
+       CHuiFxLayer *layer2 = layer->CloneL();
+       gl->iLayers.AppendL(layer2);
+       }
+   gl->iIsRoot = iIsRoot;
+   gl->iBackbufferRect = iBackbufferRect;
+   return gl;
+}
+EXPORT_C void CHuiFxGroupLayer::SetExtRect( TRect *aExtRect )
+    {
+    for(int i=0;i<iLayers.Count();i++)
+        {
+        CHuiFxLayer *layer = iLayers[i];
+        layer->SetExtRect( aExtRect );
+        }
+    }
+EXPORT_C void CHuiFxGroupLayer::SetVisual( CHuiVisual *aVisual )
+    {
+    for(int i=0;i<iLayers.Count();i++)
+        {
+        CHuiFxLayer *layer = iLayers[i];
+        layer->SetVisual(aVisual);
+        }
+    }
+EXPORT_C void CHuiFxGroupLayer::SetVisual( MHuiEffectable *aVisual )
+    {
+    for(int i=0;i<iLayers.Count();i++)
+        {
+        CHuiFxLayer *layer = iLayers[i];
+        layer->SetVisual(aVisual);
+        }    
+    }
+EXPORT_C void CHuiFxGroupLayer::ConstructL(TBool aIsRoot)
+    {
+    CHuiFxLayer::ConstructL( ELayerTypeGroup );
+    iIsRoot = aIsRoot;
+    }
+
+EXPORT_C TBool CHuiFxGroupLayer::PrepareDrawL(CHuiFxEngine& aEngine)
+    {
+    // TODO: fast path
+    if (!VisualArea(iBackbufferRect))
+        {
+        ApplyMargin( iBackbufferRect );
+
+        // Clip to display area (if set) 
+        iBackbufferRect.Intersection(iDisplayArea);
+
+        SetVisualRect(iBackbufferRect);
+        //iBackbufferRect = TargetRect();
+        }
+    else
+        {
+        ApplyMargin( iBackbufferRect );
+        // Restrict rendering to the output area
+
+        // Clip to display area (if set) 
+        iBackbufferRect.Intersection(iDisplayArea);
+        
+        SetVisualRect(iBackbufferRect);
+        //iBackbufferRect.Intersection(TargetRect());
+        }
+
+    TRect targetRect;
+    TRect sourceRect;
+
+    if (!iIsRoot)
+        {
+        sourceRect = targetRect = TRect(TPoint(0, 0), iBackbufferRect.Size());
+        }
+    else
+        {
+        sourceRect = targetRect = iBackbufferRect;
+        }
+
+    TRect newBackbufferRect(0,0,0,0);
+    for (TInt i = 0; i < iLayers.Count(); i++)
+        {
+        iLayers[i]->SetDisplayArea(iDisplayArea);
+        
+        // Should we shrink the visual area?
+        if (i > 0 && iLayers[i]->VisualArea(newBackbufferRect))
+            {
+            ApplyMargin( newBackbufferRect );
+            SetVisualRect(newBackbufferRect);
+            //newBackbufferRect.Intersection(TargetRect());
+            
+            // Clip to display area (if set) 
+            newBackbufferRect.Intersection(iDisplayArea);
+            
+            ASSERT(newBackbufferRect.Size().iWidth  <= iBackbufferRect.Size().iWidth &&
+                   newBackbufferRect.Size().iHeight <= iBackbufferRect.Size().iHeight);
+            if (iIsRoot)
+                {
+                sourceRect = targetRect = newBackbufferRect;
+                }
+            else
+                {
+                targetRect.iTl.iX = newBackbufferRect.iTl.iX - iBackbufferRect.iTl.iX;
+                targetRect.iTl.iY = newBackbufferRect.iTl.iY - iBackbufferRect.iTl.iY;
+                targetRect.iBr.iX = newBackbufferRect.iBr.iX - iBackbufferRect.iTl.iX;
+                targetRect.iBr.iY = newBackbufferRect.iBr.iY - iBackbufferRect.iTl.iY;
+                sourceRect = targetRect;
+                }
+            }
+        iLayers[i]->SetSourceRect(sourceRect);
+        iLayers[i]->SetTargetRect(targetRect);
+        iLayers[i]->SetVisualRect(VisualRect());
+        if (!iLayers[i]->PrepareDrawL(aEngine))
+            {
+            return EFalse;
+            }
+        }
+    return ETrue;
+    }
+
+EXPORT_C void CHuiFxGroupLayer::Draw(CHuiFxEngine& aEngine, CHuiGc& aGc, CHuiFxRenderbuffer& aTarget, 
+                                     CHuiFxRenderbuffer& aSource)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxGroupLayer::Draw - 0x%x "), this);
+#endif
+    // TODO: fast path
+    CHuiFxRenderbuffer* backBuffer = &aTarget;
+    CHuiFxRenderbuffer* sourceBuffer = &aSource;
+    THuiFxEngineType engineType = aEngine.EngineType();
+
+    // The root group does not require a back buffer
+    if (!iIsRoot)
+        {
+        backBuffer = aEngine.AcquireRenderbuffer(iBackbufferRect.Size());
+        if (!backBuffer)
+            {
+            return;
+            }
+        sourceBuffer = backBuffer;
+        
+        // Translate the graphics context so that the content appears in the correct place
+        backBuffer->BindAsRenderTarget();        
+        aGc.Push(EHuiGcMatrixModel);
+        if(engineType == EHuiFxEngineVg10)
+            {
+            aGc.Scale(EHuiGcMatrixModel, 1.0f, -1.0f, 1.0f);
+            aGc.Translate(EHuiGcMatrixModel, 0.0f, -iBackbufferRect.Size().iHeight, 0.0f);
+            }
+        
+        aGc.Translate(EHuiGcMatrixModel, -iBackbufferRect.iTl.iX, -iBackbufferRect.iTl.iY, 0.0f);
+        backBuffer->UnbindAsRenderTarget();
+        }
+    else if (iIsRoot && (&aTarget != aEngine.DefaultRenderbuffer()))
+        {
+        // We are rendering to offscreen buffer
+        // Translate the graphics context so that the content appears in the correct place
+        backBuffer->BindAsRenderTarget();        
+        aGc.Push(EHuiGcMatrixModel);
+        if(engineType == EHuiFxEngineVg10)
+            {
+            aGc.Scale(EHuiGcMatrixModel, 1.0f, -1.0f, 1.0f);
+            aGc.Translate(EHuiGcMatrixModel, 0.0f, -iBackbufferRect.Size().iHeight, 0.0f);
+            }
+        
+        aGc.Translate(EHuiGcMatrixModel, -iBackbufferRect.iTl.iX, -iBackbufferRect.iTl.iY, 0.0f);
+        backBuffer->UnbindAsRenderTarget();        
+        }
+    
+    for (TInt i = 0; i < iLayers.Count(); i++)
+        {
+        iLayers[i]->Draw(aEngine, aGc, *backBuffer, *sourceBuffer);
+        }
+
+    // The root group does not support composition
+    if (!iIsRoot)
+        {
+        TRect compSourceRect(TPoint(0, 0), iBackbufferRect.Size());
+        TInt alpha = 0xff; // TODO
+        if(engineType == EHuiFxEngineVg10)
+            {
+            backBuffer->BindAsRenderTarget();
+            aGc.Pop(EHuiGcMatrixModel);
+            backBuffer->UnbindAsRenderTarget();
+            }
+        else
+            {
+            aGc.Pop(EHuiGcMatrixModel);
+            }                    
+        
+        // Composite the result
+        TRect compositionTargetRect(TargetRect());        
+        compositionTargetRect.Move(-aTarget.Position());
+
+        aEngine.Composite(aTarget, *backBuffer, compositionTargetRect, compSourceRect, BlendingMode(), alpha);
+        aEngine.ReleaseRenderbuffer(backBuffer);
+        }
+    else if (iIsRoot && (&aTarget != aEngine.DefaultRenderbuffer()))
+        {
+        // We did rendering to offscreen buffer
+        if(engineType == EHuiFxEngineVg10)
+            {
+            backBuffer->BindAsRenderTarget();
+            aGc.Pop(EHuiGcMatrixModel);
+            backBuffer->UnbindAsRenderTarget();
+            }
+        else
+            {
+            aGc.Pop(EHuiGcMatrixModel);
+            }                            
+        }
+    }
+
+EXPORT_C void CHuiFxGroupLayer::AddLayerL(const CHuiFxLayer* aLayer)
+    {
+    iLayers.AppendL(aLayer);
+    }
+
+EXPORT_C TBool CHuiFxGroupLayer::VisualArea( TRect& aRect )
+    {
+    for( TInt i=0 ; i < iLayers.Count() ; i++ )
+        {
+        if( iLayers[i]->Type() == ELayerTypeFilter )
+            {
+            // found filter layer before visual => should apply to whole screen
+            return EFalse;
+            }
+        else if(iLayers[i]->VisualArea( aRect ))
+            {
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+
+EXPORT_C void CHuiFxGroupLayer::ApplyMargin( TRect &aRect )
+    {
+    if (IsMarginEnabled())       
+        {
+        TMargins m;
+        Margin(m);
+        aRect.iTl.iX -= m.iLeft;
+        aRect.iTl.iY -= m.iTop;
+        aRect.iBr.iX += m.iRight;
+        aRect.iBr.iY += m.iBottom;
+        }
+    }
+
+EXPORT_C TBool CHuiFxGroupLayer::Margin( TMargins &aMargin )
+     {
+     TMargins m;
+     m.iLeft = 0;
+     m.iRight = 0;
+     m.iTop = 0;
+     m.iBottom = 0;
+     for( TInt i=0; i < iLayers.Count() ; i++)
+         {
+         TMargins m2;
+         if ( iLayers[i]->Margin(m2) )
+             {
+             m.iLeft += m2.iLeft;
+             m.iRight += m2.iRight;
+             m.iTop += m2.iTop;
+             m.iBottom += m2.iBottom;
+             }
+         }
+     aMargin = m;
+     return ETrue;
+     }
+void CHuiFxGroupLayer::EnableMarginApplyChildren(TBool aEnable)
+    {
+    for( TInt i=0 ; i < iLayers.Count() ; i++ )
+        {
+        iLayers[i]->EnableMargin(aEnable);
+        }
+    }
+
+EXPORT_C void CHuiFxGroupLayer::AdvanceTime(TReal32 aElapsedTime)
+    {
+    for( TInt i=0 ; i < iLayers.Count() ; i++ )
+        {
+        iLayers[i]->AdvanceTime(aElapsedTime);
+        }
+    }
+
+EXPORT_C TBool CHuiFxGroupLayer::Changed() const
+    {
+    for( TInt i=0 ; i < iLayers.Count() ; i++ )
+        {
+        if (iLayers[i]->Changed())
+            {
+#ifdef HUIFX_TRACE    
+            RDebug::Print(_L("CHuiFxGroupLayer::Changed true - 0x%x,"), this);
+#endif
+            return ETrue;
+            }
+        }
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxGroupLayer::Changed false- 0x%x,"), this);
+#endif
+    return EFalse;
+    }
+	
+TBool CHuiFxGroupLayer::IsAnimated() const
+    {
+    if (CHuiFxLayer::IsAnimated())
+        {
+        return ETrue;
+        }
+    else
+        {
+        for( TInt i=0 ; i < iLayers.Count() ; i++ )
+            {
+            if (iLayers[i]->IsAnimated())
+                {
+                return ETrue;
+                }
+            }
+        }
+    return EFalse;
+    }
+	
+TBool CHuiFxGroupLayer::IsTransformed() const
+    {
+    if (CHuiFxLayer::IsTransformed())
+        {
+        return ETrue;
+        }
+    else
+        {
+        for( TInt i=0 ; i < iLayers.Count() ; i++ )
+            {
+            if (iLayers[i]->IsTransformed())
+                {
+                return ETrue;
+                }
+            }
+        }
+    return EFalse;
+    }
+
+TBool CHuiFxGroupLayer::IsFiltered() const
+    {
+    if (CHuiFxLayer::IsFiltered())
+        {
+        return ETrue;
+        }
+    else
+        {
+        for( TInt i=0 ; i < iLayers.Count() ; i++ )
+            {
+            if (iLayers[i]->IsFiltered())
+                {
+                return ETrue;
+                }
+            }
+        }
+    return EFalse;
+    }
+
+TBool CHuiFxGroupLayer::IsSemitransparent() const
+    {
+    if (CHuiFxLayer::IsSemitransparent())
+        {
+        return ETrue;
+        }
+    else
+        {
+        for( TInt i=0 ; i < iLayers.Count() ; i++ )
+            {
+            if (iLayers[i]->IsSemitransparent())
+                {
+                return ETrue;
+                }
+            }
+        }
+    return EFalse;
+    }
+
+
+TInt CHuiFxGroupLayer::LayerCount() const
+    {
+    return iLayers.Count();
+    }
+
+CHuiFxLayer& CHuiFxGroupLayer::Layer(TInt aIndex) const
+    {
+    return *iLayers[aIndex];
+    }
+void CHuiFxGroupLayer::FxmlVisualInputs(RArray<THuiFxVisualSrcType> &aArray)
+    {
+    for( TInt i=0 ; i < iLayers.Count() ; i++ )
+        {
+        iLayers[i]->FxmlVisualInputs(aArray);
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxLayer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,190 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxLayer.h"
+
+EXPORT_C CHuiFxLayer::CHuiFxLayer() :
+    iLayerType( ELayerTypeUnknown )
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxLayer::CHuiFxLayer - 0x%x "), this);
+#endif
+    }
+
+EXPORT_C CHuiFxLayer::~CHuiFxLayer()
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxLayer::~CHuiFxLayer - 0x%x "), this);
+#endif
+    }
+
+EXPORT_C void CHuiFxLayer::ConstructL( THuiFxLayerType aType )
+    {
+    iBlendingOp = EBlendingModeReplace;
+    iLayerType = aType;
+    iSourceRect = TRect(0, 0, 0, 0);
+    iTargetRect = TRect(0, 0, 0, 0);
+    iVisualRect = TRect(0, 0, 0, 0);
+    iAnimated = EFalse;
+    iTransformed = EFalse;
+    iMarginEnabled = ETrue;
+    }
+EXPORT_C void CHuiFxLayer::CopyFromL(const CHuiFxLayer *aOldLayer)
+    {
+    iBlendingOp = aOldLayer->iBlendingOp;
+    iLayerType = aOldLayer->iLayerType;
+    iSourceRect = aOldLayer->iSourceRect;
+    iTargetRect = aOldLayer->iTargetRect;
+    iVisualRect = aOldLayer->iVisualRect;
+    iAnimated = aOldLayer->iAnimated;
+    iTransformed = aOldLayer->iTransformed;
+    iMarginEnabled = aOldLayer->iMarginEnabled;
+    }
+
+EXPORT_C TBool CHuiFxLayer::PrepareDrawL(CHuiFxEngine& /*aEngine*/)
+    {
+    // Nothing to do
+    return ETrue;
+    }
+
+EXPORT_C TBool CHuiFxLayer::VisualArea( TRect& /*aRect*/ )
+    {
+    // No area in base class
+    return EFalse;
+    }
+EXPORT_C TBool CHuiFxLayer::Margin( TMargins & /* aMargin */ )
+{
+   // empty implementation in base class
+   return EFalse;
+}
+
+EXPORT_C TBool CHuiFxLayer::Changed() const
+    {
+    return EFalse;
+    }
+
+EXPORT_C void CHuiFxLayer::AdvanceTime(TReal32 /*aElapsedTime*/)
+    {
+    // Nothing to do
+    }
+
+EXPORT_C THuiFxLayerType CHuiFxLayer::Type()
+    {
+    return iLayerType;
+    }
+
+EXPORT_C void CHuiFxLayer::SetBlendingMode(THuiFxBlendingMode aOp)
+    {
+    iBlendingOp = aOp;
+    }
+
+EXPORT_C THuiFxBlendingMode CHuiFxLayer::BlendingMode() const
+    {
+    return iBlendingOp;
+    }
+
+EXPORT_C void CHuiFxLayer::SetDisplayArea(const TRect& aRect)
+    {
+    iDisplayArea = aRect;
+    }
+
+EXPORT_C void CHuiFxLayer::SetSourceRect(const TRect& aRect)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxLayer::SetSourceRect - 0x%x (%d,%d,%d,%d))"), this, aRect.iTl.iX, aRect.iTl.iY, aRect.iBr.iX, aRect.iBr.iY);
+#endif
+    iSourceRect = aRect;
+    }
+
+EXPORT_C void CHuiFxLayer::SetTargetRect(const TRect& aRect)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxLayer::SetTargetRect - 0x%x (%d,%d,%d,%d))"), this, aRect.iTl.iX, aRect.iTl.iY, aRect.iBr.iX, aRect.iBr.iY);
+#endif
+    iTargetRect = aRect;
+    }
+
+EXPORT_C void CHuiFxLayer::SetVisualRect(const TRect& aRect)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxLayer::SetVisualRect - 0x%x (%d,%d,%d,%d))"), this, aRect.iTl.iX, aRect.iTl.iY, aRect.iBr.iX, aRect.iBr.iY);
+#endif
+    iVisualRect = aRect;
+    }
+
+EXPORT_C const TRect& CHuiFxLayer::SourceRect() const
+    {
+    return iSourceRect;
+    }
+
+EXPORT_C const TRect& CHuiFxLayer::TargetRect() const
+    {
+    return iTargetRect;
+    }
+
+EXPORT_C const TRect& CHuiFxLayer::VisualRect() const
+    {
+    return iVisualRect;
+    }
+
+TBool CHuiFxLayer::IsAnimated() const
+    {
+    return iAnimated;
+    }
+
+void CHuiFxLayer::SetAnimated(TBool aAnimated)
+    {
+    iAnimated = aAnimated;
+    }
+
+TBool CHuiFxLayer::IsTransformed() const
+    {
+    return iTransformed;
+    }    
+
+void CHuiFxLayer::SetTransformed(TBool aTransformed)
+    {
+    iTransformed = aTransformed;
+    }
+
+void CHuiFxLayer::EnableMargin(TBool aEnable)
+    {
+    iMarginEnabled = aEnable;
+    EnableMarginApplyChildren(aEnable);
+    }
+void CHuiFxLayer::EnableMarginApplyChildren(TBool /*aEnable*/)
+    {
+    /* empty in baseclass */
+    }
+
+
+TBool CHuiFxLayer::IsMarginEnabled() const
+    {
+    return iMarginEnabled;
+    }
+
+TBool CHuiFxLayer::IsFiltered() const
+    {
+    return EFalse;
+    }
+
+TBool CHuiFxLayer::IsSemitransparent() const
+    {
+    return EFalse;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxParameter.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxParameter.h"
+
+MHuiFxParameter::~MHuiFxParameter()
+    {
+    }
+
+static void DoCleanupFxParameter(TAny* aAny)
+    {
+    MHuiFxParameter* parameter = static_cast<MHuiFxParameter*>(aAny);
+    delete parameter;
+    }
+
+void CleanupFxParameterL(MHuiFxParameter* aParameter)
+    {
+    CleanupStack::PushL(TCleanupItem(DoCleanupFxParameter, aParameter));
+    }
+
+void ReRefInternal(TReal32 *aValue, TReal32 **aValue2)
+    {
+    *aValue2 = aValue;
+    }
+void ReRefInternal(TRgb *aValue, TRgb **aValue2)
+    {
+    *aValue2 = aValue;
+    }
+void ReRefInternal(TReal32 *aValue, TRgb **aValue2)
+    {
+    // empty because assignment from TReal to TRgb fails
+    }
+void ReRefInternal(TRgb *aValue, TReal32 **aValue2)
+    {
+    // empty because assignment from TRgb to TReal32 fails
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxParameterManager.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,225 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxParameterManager.h"
+#include "HuiFxEngine.h"
+#include "HuiFxScalarParameter.h"
+#include "HuiFxColorParameter.h"
+#include <e32base.h>
+
+CHuiFxParameterManager* CHuiFxParameterManager::NewL()
+    {
+    CHuiFxParameterManager* self = new (ELeave) CHuiFxParameterManager();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CHuiFxParameterManager::CHuiFxParameterManager()
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxParameterManager::CHuiFxParameterManager - 0x%x "), this);
+#endif
+    }
+
+void CHuiFxParameterManager::ConstructL()
+    {
+    }
+
+CHuiFxParameterManager* CHuiFxParameterManager::CloneL() const
+{
+  CHuiFxParameterManager *params = CHuiFxParameterManager::NewL();
+  return params;
+}
+
+void CHuiFxParameterManager::CopyParameterL(const TDesC &aName, TReal32 *aValue, const CHuiFxParameterManager *aOldValues)
+    {
+    MHuiFxParameter *param = const_cast<CHuiFxParameterManager*>(aOldValues)->Parameter(aName);
+    MHuiFxParameter *param2 = param->CloneL();
+    param2->ReRef(aValue);
+    iParameters.InsertL(aName.AllocL(), param2);
+    }
+void CHuiFxParameterManager::CopyParameterL(const TDesC &aName, TRgb *aValue, const CHuiFxParameterManager *aOldValues)
+    {
+    MHuiFxParameter *param = const_cast<CHuiFxParameterManager*>(aOldValues)->Parameter(aName);
+    MHuiFxParameter *param2 = param->CloneL();
+    param2->ReRef(aValue);
+    iParameters.InsertL(aName.AllocL(), param2);
+    }
+
+
+CHuiFxParameterManager::~CHuiFxParameterManager()
+    {
+    // Free registered parameters
+    /*TPtrHashMapIter<TDesC, MHuiFxParameter> i(iParameters);
+    for (i.NextValue(); i.CurrentValue(); i.NextValue())
+        {
+        delete i.CurrentKey();
+        delete i.CurrentValue();
+        }
+    iParameters.Close();*/
+    iParameters.ResetAndDestroy();
+    iParameters.Close();
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxParameterManager::~CHuiFxParameterManager - 0x%x "), this);
+#endif
+    }
+
+void CHuiFxParameterManager::RegisterParameterL(const TDesC& aName, TReal32* aValue)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxParameterManager::RegisterParameterL - 0x%x %S scal: 0x%x"), this, &aName, *aValue);
+#endif
+    MHuiFxParameter* param = new (ELeave) CHuiFxScalarParameter(aValue);
+    CleanupStack::PushL(param);
+    iParameters.InsertL(aName.AllocL(), param);
+    CleanupStack::Pop(param);
+    }
+
+void CHuiFxParameterManager::RegisterParameterL(const TDesC& aName, TRgb* aValue)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxParameterManager::RegisterParameterL - 0x%x %S rgb: 0x%x"), this, &aName, *aValue);
+#endif //#ifdef HUIFX_TRACE    
+    MHuiFxParameter* param = new (ELeave) CHuiFxColorParameter(aValue);
+    CleanupStack::PushL(param);
+    iParameters.InsertL(aName.AllocL(), param);
+    CleanupStack::Pop(param);
+    }
+
+TBool CHuiFxParameterManager::HasAnimatedParameters() const
+    {
+    TPtrHashMapIter<TDesC, MHuiFxParameter> i(iParameters);
+    for (i.NextValue(); i.CurrentValue(); i.NextValue())
+        {
+        if (i.CurrentValue()->IsAnimated())
+            {
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+
+void CHuiFxParameterManager::AdvanceTime(TReal32 aElapsedTime)
+    {
+    TPtrHashMapIter<TDesC, MHuiFxParameter> i(iParameters);
+    for (i.NextValue(); i.CurrentValue(); i.NextValue())
+        {
+        MHuiFxParameter* p = (MHuiFxParameter*)i.CurrentValue();
+        p->AdvanceTime(aElapsedTime);
+        }
+    }
+
+TBool CHuiFxParameterManager::Update(CHuiFxEngine& aEngine, const TRect& aVisualRect)
+    {
+    // Calculate all current parameter values
+    TPtrHashMapIter<TDesC, MHuiFxParameter> i(iParameters);
+    
+    TBool parameterChanged = EFalse;
+    for (i.NextValue(); i.CurrentValue(); i.NextValue())
+        {
+        MHuiFxParameter* p = (MHuiFxParameter*)i.CurrentValue();
+        if ( p->IsAnimated() )
+            {
+            parameterChanged = ETrue;
+            }
+        
+        TReal32 newValue = p->ReferenceValue();
+        ResolveReference( newValue, p->ReferencePoint(), aEngine, aVisualRect );
+        if ( newValue != p->ReferenceValue() )
+            {
+            p->SetReferenceValue( newValue );
+            parameterChanged = ETrue;
+            }
+            
+        if ( p->StartReference() != EReferencePointUndefined )
+            {
+            newValue = p->StartValue();
+            ResolveReference( newValue, p->StartReference(), aEngine, aVisualRect );
+            if ( newValue != p->StartValue() )
+                {
+                p->SetStartValue( newValue );
+                parameterChanged = ETrue;
+                }
+            }
+            
+        if ( p->EndReference() != EReferencePointUndefined )
+            {
+            newValue = p->EndValue();
+            ResolveReference( newValue, p->EndReference(), aEngine, aVisualRect );
+            if ( newValue != p->EndValue() )
+                {
+                p->SetEndValue( newValue );
+                parameterChanged = ETrue;
+                }
+            }
+            
+        p->Update();
+        }
+    return parameterChanged;
+    }
+    
+MHuiFxParameter* CHuiFxParameterManager::Parameter(const TDesC& aName)
+    {
+    return iParameters.Find(aName);
+    }
+    
+void CHuiFxParameterManager::ResolveReference( TReal32& aDefaultValue, THuiFxReferencePoint aRef, CHuiFxEngine& aEngine, const TRect& aVisualRect )
+    {
+    switch ( aRef )
+        {
+        case EReferencePointIdentity:
+        case EReferencePointUndefined:
+        // If the reference point is an external value, it will not change
+        // after it has been set
+        case EReferencePointExtRectWidth:
+        case EReferencePointExtRectHeight:
+        case EReferencePointExtRectTop:
+        case EReferencePointExtRectBottom:
+        case EReferencePointExtRectLeft:
+        case EReferencePointExtRectRight:
+            break;
+        case EReferencePointVisualWidth:
+            aDefaultValue = aVisualRect.Size().iWidth;
+            break;
+        case EReferencePointVisualHeight:
+            aDefaultValue = aVisualRect.Size().iHeight;
+            break;
+        case EReferencePointVisualTop:
+            aDefaultValue = aVisualRect.iTl.iY;
+            break;
+        case EReferencePointVisualBottom:
+            // the bottom right corner of a rect is actually outside the rect
+            aDefaultValue = aVisualRect.iBr.iY;
+            break;
+        case EReferencePointVisualLeft:
+            aDefaultValue = aVisualRect.iTl.iX;
+            break;
+        case EReferencePointVisualRight:
+            // the bottom right corner of a rect is actually outside the rect
+            aDefaultValue = aVisualRect.iBr.iX;
+            break;
+        default:
+            // This will return reference points that depend on display size
+            aDefaultValue = aEngine.GetReferenceValue( aRef );
+            break;
+        }
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxRenderbuffer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxRenderbuffer.h"
+
+EXPORT_C CHuiFxRenderbuffer::CHuiFxRenderbuffer()
+    {
+    }
+
+EXPORT_C void CHuiFxRenderbuffer::ConstructL(const TSize& aSize, TRenderBufferType aBufferType)
+    {
+    iSize = aSize;
+    iType = aBufferType;
+    }
+
+EXPORT_C CHuiFxRenderbuffer::~CHuiFxRenderbuffer()
+    {
+    }
+
+EXPORT_C const TSize& CHuiFxRenderbuffer::Size() const
+    {
+    return iSize;
+    }
+
+EXPORT_C const TRenderBufferType& CHuiFxRenderbuffer::BufferType() const
+    {
+    return iType;
+    }
+
+EXPORT_C const TPoint& CHuiFxRenderbuffer::Position() const
+    {
+    return iPosition;
+    }
+
+EXPORT_C void CHuiFxRenderbuffer::SetPosition(TPoint aPosition)
+    {
+    iPosition = aPosition;
+    }
+
+EXPORT_C void CHuiFxRenderbuffer::EnableBackground(TBool aEnable)
+    {
+    iBackgroundEnabled = aEnable;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxScalarParameter.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxScalarParameter.h"
+
+template<>
+TInt32 RHuiFxScalarTimeLine::ToFixedPoint(const TReal32& aValue)
+    {
+    return (TInt32)(aValue * 0x10000);
+    }
+
+template<>
+TReal32 RHuiFxScalarTimeLine::FromFixedPoint(const TInt32& aValue)
+    {
+    return aValue / (TReal32)(0x10000);
+    }
+
+template<>
+TInt32 RHuiFxScalarTimeLine::Blend(const TInt32& aValue1, const TInt32& aValue2, TInt32 aAlpha)
+    {
+    TInt64 diff = aValue2 - aValue1;
+    return (TInt32)((TInt64)aValue1 + ((diff * (aAlpha >> 8)) >> 8));
+    }
+
+template<>
+TInt32 RHuiFxScalarTimeLine::WeightedSum4(const TInt32& aValue1, const TInt32& aValue2, const TInt32& aValue3, const TInt32& aValue4,
+                                          TInt32 aWeight1, TInt32 aWeight2, TInt32 aWeight3, TInt32 aWeight4)
+    {
+    TInt64 f1 = (TInt64)aValue1 * (TInt64)aWeight1;
+    TInt64 f2 = (TInt64)aValue2 * (TInt64)aWeight2;
+    TInt64 f3 = (TInt64)aValue3 * (TInt64)aWeight3;
+    TInt64 f4 = (TInt64)aValue4 * (TInt64)aWeight4;
+    return (TInt32)((f1 + f2 + f3 + f4) >> 16);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiFxVisualLayer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,441 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "HuiFxVisualLayer.h"
+#include "Matrix.h"
+#include "HuiFxParameterManager.h"
+#include <uiacceltk/HuiVisual.h>
+#include "HuiFxConstants.h"
+#include <e32math.h>
+#include "HuiCmdBufferBrush.h"
+
+EXPORT_C CHuiFxVisualLayer* CHuiFxVisualLayer::NewL(MHuiEffectable& aVisual)
+    {
+    CHuiFxVisualLayer* e = new (ELeave) CHuiFxVisualLayer();
+    CleanupStack::PushL(e);
+    e->ConstructL(aVisual);
+    CleanupStack::Pop(e);
+    return e;
+    }
+
+EXPORT_C void CHuiFxVisualLayer::ConstructL(MHuiEffectable& aVisual)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxVisualLayer::ConstructL - 0x%x "), this);
+#endif
+    CHuiFxLayer::ConstructL( ELayerTypeVisual );
+    iParameterManager = CHuiFxParameterManager::NewL();
+    iVisual = &aVisual;
+    iSrcType = EVisualSrcVisual;
+    iExtBitmapFile = NULL;
+    
+    iTranslationX = 0.0f;
+    iTranslationY = 0.0f;
+    iTranslationZ = 0.0f;
+    
+    iScaleX = 1.0f;
+    iScaleY = 1.0f;
+    iScaleZ = 1.0f;
+    iScaleOriginX = 0.0f;
+    iScaleOriginY = 0.0f;
+    iScaleOriginZ = 0.0f;
+    
+    iRotationOriginX = 0.0f;
+    iRotationOriginY = 0.0f;
+    iRotationOriginZ = 0.0f;
+    iRotationAngle = 0.0f;
+    iRotationAxisX = 0.0f;
+    iRotationAxisY = 0.0f;
+    iRotationAxisZ = 1.0f;
+    
+    iSkewAngleX = 0.0f;
+    iSkewAngleY = 0.0f;
+    iSkewAngleZ = 0.0f;
+    iSkewOriginX = 0.0f;
+    iSkewOriginY = 0.0f;
+    iSkewOriginZ = 0.0f;
+    
+    // We use the visual's own target opacity if we haven't set something explicitly    
+    if (iVisual)
+        {
+        //iOpacity = iVisual->iOpacity.Target();
+        iOpacity = iVisual->EffectOpacityTarget();
+        }
+    else
+        {
+        iOpacity = 1.0;
+        }
+    RegisterParameterL(KLitTranslationX, &iTranslationX);
+    RegisterParameterL(KLitTranslationY, &iTranslationY);
+    RegisterParameterL(KLitTranslationZ, &iTranslationZ);
+    
+    RegisterParameterL(KLitScaleX, &iScaleX);
+    RegisterParameterL(KLitScaleY, &iScaleY);
+    RegisterParameterL(KLitScaleZ, &iScaleZ);
+    RegisterParameterL(KLitScaleOriginX, &iScaleOriginX);
+    RegisterParameterL(KLitScaleOriginY, &iScaleOriginY);
+    RegisterParameterL(KLitScaleOriginZ, &iScaleOriginZ);
+   
+    RegisterParameterL(KLitRotationOriginX, &iRotationOriginX);
+    RegisterParameterL(KLitRotationOriginY, &iRotationOriginY);
+    RegisterParameterL(KLitRotationOriginZ, &iRotationOriginZ);
+    RegisterParameterL(KLitRotationAngle, &iRotationAngle);
+    RegisterParameterL(KLitRotationAxisX, &iRotationAxisX);
+    RegisterParameterL(KLitRotationAxisY, &iRotationAxisY);
+    RegisterParameterL(KLitRotationAxisZ, &iRotationAxisZ);
+    
+    RegisterParameterL(KLitSkewAngleX, &iSkewAngleX);
+    RegisterParameterL(KLitSkewAngleY, &iSkewAngleY);
+    RegisterParameterL(KLitSkewAngleZ, &iSkewAngleZ);
+    RegisterParameterL(KLitSkewOriginX, &iSkewOriginX);
+    RegisterParameterL(KLitSkewOriginY, &iSkewOriginY);
+    RegisterParameterL(KLitSkewOriginZ, &iSkewOriginZ);
+    
+    RegisterParameterL(KLitOpacityParameter, &iOpacity);
+    }
+
+EXPORT_C CHuiFxVisualLayer *CHuiFxVisualLayer::CloneL() const
+{
+    CHuiFxVisualLayer *layer = new (ELeave) CHuiFxVisualLayer;
+    layer->CHuiFxLayer::ConstructL( ELayerTypeVisual );
+    layer->CHuiFxLayer::CopyFromL(this);
+    layer->iVisual = iVisual; // visual will be set later...
+    layer->iParameterManager = iParameterManager->CloneL();
+    layer->iParameterManager->CopyParameterL(KLitTranslationX, &layer->iTranslationX, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitTranslationY, &layer->iTranslationY, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitTranslationZ, &layer->iTranslationZ, iParameterManager);
+    
+    layer->iParameterManager->CopyParameterL(KLitScaleX, &layer->iScaleX, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitScaleY, &layer->iScaleY, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitScaleZ, &layer->iScaleZ, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitScaleOriginX, &layer->iScaleOriginX, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitScaleOriginY, &layer->iScaleOriginY, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitScaleOriginZ, &layer->iScaleOriginZ, iParameterManager);
+   
+    layer->iParameterManager->CopyParameterL(KLitRotationOriginX, &layer->iRotationOriginX, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitRotationOriginY, &layer->iRotationOriginY, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitRotationOriginZ, &layer->iRotationOriginZ, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitRotationAngle, &layer->iRotationAngle, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitRotationAxisX, &layer->iRotationAxisX, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitRotationAxisY, &layer->iRotationAxisY, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitRotationAxisZ, &layer->iRotationAxisZ, iParameterManager);
+    
+    layer->iParameterManager->CopyParameterL(KLitSkewAngleX, &layer->iSkewAngleX, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitSkewAngleY, &layer->iSkewAngleY, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitSkewAngleZ, &layer->iSkewAngleZ, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitSkewOriginX, &layer->iSkewOriginX, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitSkewOriginY, &layer->iSkewOriginY, iParameterManager);
+    layer->iParameterManager->CopyParameterL(KLitSkewOriginZ, &layer->iSkewOriginZ, iParameterManager);
+    
+    layer->iParameterManager->CopyParameterL(KLitOpacityParameter, &layer->iOpacity, iParameterManager);
+
+    layer->iSrcType = iSrcType;
+    layer->iTranslationX = iTranslationX;
+    layer->iTranslationY = iTranslationY;
+    layer->iTranslationZ = iTranslationZ;
+    layer->iScaleX = iScaleX;    
+    layer->iScaleY = iScaleY;    
+    layer->iScaleZ = iScaleZ;    
+    layer->iScaleOriginX = iScaleOriginX;    
+    layer->iScaleOriginY = iScaleOriginY;    
+    layer->iScaleOriginZ = iScaleOriginZ;    
+    layer->iRotationOriginX = iRotationOriginX;    
+    layer->iRotationOriginY = iRotationOriginY;    
+    layer->iRotationOriginZ = iRotationOriginZ;    
+    layer->iRotationAngle = iRotationAngle;
+    layer->iRotationAxisX = iRotationAxisX;
+    layer->iRotationAxisY = iRotationAxisY;
+    layer->iRotationAxisZ = iRotationAxisZ;
+    layer->iSkewAngleX = iSkewAngleX;
+    layer->iSkewAngleY = iSkewAngleY;
+    layer->iSkewAngleZ = iSkewAngleZ;
+    
+    layer->iSkewOriginX = iSkewOriginX;
+    layer->iSkewOriginY = iSkewOriginY;
+    layer->iSkewOriginZ = iSkewOriginZ;
+    if (iExtBitmapFile)
+        layer->iExtBitmapFile = iExtBitmapFile->AllocL();
+    else
+        layer->iExtBitmapFile = NULL;
+    layer->iOpacity = iOpacity;
+    return layer;
+}
+EXPORT_C void CHuiFxVisualLayer::SetExtRect( TRect * /*aExtRect*/ )
+    {
+    // not needed..
+    }
+EXPORT_C void CHuiFxVisualLayer::SetVisual( CHuiVisual * aVisual )
+    {
+    iVisual = aVisual->Effectable();
+    
+    if (Math::IsInfinite(iOpacity))
+        {
+        iOpacity = aVisual->iOpacity.Target();
+        }
+    }
+EXPORT_C void CHuiFxVisualLayer::SetVisual( MHuiEffectable *aVisual )
+    {
+    iVisual = aVisual;
+    
+    if (Math::IsInfinite(iOpacity))
+        {
+        //iOpacity = iVisual->iOpacity.Target();
+        iOpacity = iVisual->EffectOpacityTarget();
+        }    
+    }
+
+
+
+EXPORT_C CHuiFxVisualLayer::~CHuiFxVisualLayer()
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxVisualLayer::~CHuiFxVisualLayer - 0x%x "), this);
+#endif
+    delete iExtBitmapFile;
+    delete iParameterManager;
+    iParameterManager = NULL;
+    }
+
+EXPORT_C TBool CHuiFxVisualLayer::Changed() const
+    {
+    TBool ret = iParameterManager->HasAnimatedParameters();
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxVisualLayer::Changed - 0x%x , ret %d"), this, ret);    
+#endif
+    return ret;
+    }
+
+EXPORT_C void CHuiFxVisualLayer::AdvanceTime(TReal32 aElapsedTime)
+    {
+    iParameterManager->AdvanceTime(aElapsedTime);
+    }
+
+EXPORT_C TBool CHuiFxVisualLayer::PrepareDrawL(CHuiFxEngine& aEngine)
+    {
+    iParameterManager->Update(aEngine, VisualRect());
+    return ETrue;
+    }
+
+EXPORT_C void CHuiFxVisualLayer::Draw(CHuiFxEngine& aEngine, CHuiGc& aGc, CHuiFxRenderbuffer &aTarget, CHuiFxRenderbuffer& /*aSource*/)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxVisualLayer::Draw - 0x%x "), this);
+#endif
+    aTarget.BindAsRenderTarget();
+    aGc.Push(EHuiGcMatrixModel);
+    
+    THuiFxEngineType engineType = aEngine.EngineType();
+    TRenderBufferType bufferType = aTarget.BufferType();
+    if(engineType == EHuiFxEngineGles20)
+        {
+        if(bufferType == EBufferTypeOffscreen)
+            {
+            aGc.Enable(CHuiGc::EFeatureBlending, ETrue);
+            aGc.SetBlendMode(CHuiGc::EBlendReplace);
+            }
+        TRect viewPort(TPoint(0,0), aTarget.Size());
+        aGc.SetProjection(CHuiGc::EProjectionOrthographic, viewPort);
+        }
+    
+    aGc.Translate(EHuiGcMatrixModel, VisualRect().iTl.iX, VisualRect().iTl.iY, 0.0f);
+    ApplyTransformations(aGc);
+    aGc.Translate(EHuiGcMatrixModel, -VisualRect().iTl.iX, -VisualRect().iTl.iY, 0.0f);
+    
+    aGc.SetBlendMode( CHuiGc::EBlendNormal );
+    //iVisual->iOpacity.Set( iOpacity );
+    iVisual->EffectSetOpacity( iOpacity );   
+    
+    // Set new clipping region which does not clip anything. 
+    // We want always draw visual fully to the aTarget. 
+    aGc.PushClip();
+    TRect bufferArea = TRect(TPoint(0,0), aTarget.Size()); 
+    aGc.SetClip(bufferArea); // this does not transform bufferArea which is fine for us    
+    
+    // Draw visual content to aTarget
+    //iVisual->DrawSelf(aGc, TargetRect());
+    iVisual->EffectSetSource(iSrcType==EVisualSrcInput1);
+    iVisual->EffectDrawSelf( aGc, TargetRect() );
+    iVisual->EffectSetSource(EFalse);
+    
+    // Restore original clipping
+    aGc.PopClip();
+    
+    if(engineType == EHuiFxEngineGles20)
+        {
+        if(bufferType == EBufferTypeOffscreen)
+            {
+            aGc.SetBlendMode(CHuiGc::EBlendNormal);
+            }
+        aGc.SetProjection(CHuiGc::EProjectionOrthographic);
+        }
+    
+    aGc.Pop(EHuiGcMatrixModel);
+    aTarget.UnbindAsRenderTarget();
+    }
+
+void CHuiFxVisualLayer::ApplyTransformations(CHuiGc& aGc)
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxVisualLayer::ApplyTransformations - 0x%x "), this);
+#endif
+    // Matrix multiplication is generally not commutative.
+    // Therefore the order of the transformations matters.
+    // In order to prevent the scaling ang skewing from affecting the translation,
+    // if seems wiser to do the translation first, otherwise the results seem to be unpredictable.
+    
+    // Translation
+    if (iTranslationX != 0.0f || iTranslationY != 0.0f || iTranslationZ != 0.0f)
+        {
+        aGc.Translate(EHuiGcMatrixModel, iTranslationX, iTranslationY, iTranslationZ);
+        }    
+        
+    // Scaling
+    if (iScaleX != 1.0f || iScaleY != 1.0f || iScaleZ != 1.0f)
+        {
+        if ( iScaleOriginX != 0 || iScaleOriginY != 0 || iScaleOriginZ != 0 )
+            {
+            aGc.Translate(EHuiGcMatrixModel, iScaleOriginX, iScaleOriginY, iScaleOriginZ);
+            aGc.Scale(EHuiGcMatrixModel, iScaleX, iScaleY, iScaleZ); 
+            aGc.Translate(EHuiGcMatrixModel, -iScaleOriginX, -iScaleOriginY, -iScaleOriginZ);
+            }
+        else
+            {
+            aGc.Scale(EHuiGcMatrixModel, iScaleX, iScaleY, iScaleZ); 
+            }
+        }
+    
+    // Skewing
+    if (iSkewAngleX != 0.0f || iSkewAngleY != 0.0f || iSkewAngleZ != 0.0f)
+        {
+        const TReal32 radsPerDeg = 2.0f * (float)M_PI / 360.0f;
+        TReal32 skewX = tan(iSkewAngleX * radsPerDeg);
+        TReal32 skewY = tan(iSkewAngleY * radsPerDeg);
+        TReal32 skewZ = tan(iSkewAngleZ * radsPerDeg);
+        if ( iSkewOriginX != 0 || iSkewOriginY != 0 || iSkewOriginZ != 0 )
+            {
+            aGc.Translate(EHuiGcMatrixModel, iSkewOriginX, iSkewOriginY, iSkewOriginZ);
+            aGc.Shear(EHuiGcMatrixModel, skewX, skewY, skewZ); 
+            aGc.Translate(EHuiGcMatrixModel, -iSkewOriginX, -iSkewOriginY, -iSkewOriginZ);
+            }
+        else
+            {
+            aGc.Shear(EHuiGcMatrixModel, skewX, skewY, skewZ); 
+            }
+        }
+
+    // Rotation
+    if (iRotationAngle != 0.0f)
+        {
+        if ( iRotationOriginX != 0 || iRotationOriginY != 0 || iRotationOriginZ != 0 )
+            {
+            aGc.Translate(EHuiGcMatrixModel, iRotationOriginX, iRotationOriginY, iRotationOriginZ);
+            aGc.Rotate(EHuiGcMatrixModel, iRotationAngle, iRotationAxisX, iRotationAxisY, iRotationAxisZ); 
+            aGc.Translate(EHuiGcMatrixModel, -iRotationOriginX, -iRotationOriginY, -iRotationOriginZ);
+            }
+        else
+            {
+            aGc.Rotate(EHuiGcMatrixModel, iRotationAngle, iRotationAxisX, iRotationAxisY, iRotationAxisZ); 
+            }
+        }
+
+    // Translation
+/*    
+    if (iTranslationX != 0.0f || iTranslationY != 0.0f || iTranslationZ != 0.0f)
+        {
+        aGc.Translate(EHuiGcMatrixModel, iTranslationX, iTranslationY, iTranslationZ);
+        }    
+*/        
+    }
+
+EXPORT_C TBool CHuiFxVisualLayer::VisualArea( TRect& aRect )
+    {
+    // TODO: cache?
+    // TODO: transforms
+    //aRect = iVisual->DisplayRect();        
+    THuiRealRect rect = iVisual->EffectDisplayRect();
+    aRect = rect;
+    return ETrue;
+    }
+
+EXPORT_C TBool CHuiFxVisualLayer::Margin(TMargins &m)
+   {
+   m.iLeft = iTranslationX < 0.0 ? -iTranslationX : 0.0;
+   m.iRight = iTranslationX > 0.0 ? iTranslationX : 0.0;
+   m.iTop = iTranslationY < 0.0 ? -iTranslationY : 0.0;
+   m.iBottom = iTranslationY > 0.0 ? iTranslationY : 0.0;
+   return ETrue;
+   }
+
+EXPORT_C MHuiFxParameter* CHuiFxVisualLayer::Parameter(const TDesC& aName)
+    {
+    return iParameterManager->Parameter(aName);
+    }
+
+EXPORT_C void CHuiFxVisualLayer::RegisterParameterL(const TDesC& aName, TReal32* aValue)
+    {
+    iParameterManager->RegisterParameterL(aName, aValue);
+    }
+
+EXPORT_C void CHuiFxVisualLayer::RegisterParameterL(const TDesC& aName, TRgb* aValue)
+    {
+    iParameterManager->RegisterParameterL(aName, aValue);
+    }
+
+void CHuiFxVisualLayer::SetSourceType( const THuiFxVisualSrcType aSrcType )
+    {
+    iSrcType = aSrcType; 
+    }
+    
+THuiFxVisualSrcType CHuiFxVisualLayer::SourceType() const
+    {
+    return iSrcType;
+    }
+    
+void CHuiFxVisualLayer::SetExtBitmapFileL( TDesC& aFilename )
+    {
+#ifdef HUIFX_TRACE    
+    RDebug::Print(_L("CHuiFxVisualLayer::SetExtBitmapFileL - 0x%x, %S "), this, &aFilename);
+#endif    
+    delete iExtBitmapFile;
+    iExtBitmapFile = NULL;
+    if ( aFilename.Length() == 0 )
+        {
+        // don't set an empty filename
+        return;
+        }
+    iExtBitmapFile = HBufC::NewL( aFilename.Length() );
+    *iExtBitmapFile = aFilename;
+    //TODO: the bitmap from this filename should be loaded as texture to the visual.
+    }
+void CHuiFxVisualLayer::FxmlVisualInputs(RArray<THuiFxVisualSrcType> &aArray)
+    {
+    aArray.Append(iSrcType);
+    }
+    
+TBool CHuiFxVisualLayer::IsSemitransparent() const
+    {
+    if (iOpacity < 1.f)
+        {
+        return ETrue;        
+        }
+    else
+        {
+        return EFalse;        
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiGc.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,829 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation for CHuiGc (graphics context) class.
+*
+*/
+
+
+
+#include "uiacceltk/HuiGc.h"  // Class definition
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiSegmentedTexture.h"
+#include "uiacceltk/HuiTextMesh.h"
+#include "uiacceltk/HuiFont.h"
+#include "uiacceltk/HuiImage.h"
+#include "uiacceltk/HuiTransformation.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiUtil.h"  // For hui assert.
+#include "uiacceltk/HuiTransformation.h"
+
+#include <e32math.h>
+#include <AknUtils.h>
+
+const TInt KHuiMaxRecycledRegionCount = 20;
+
+/** Default offset from the Z=0 plane (which 2D projection uses) to the
+    eyepoint, in 3D projection mode. */
+LOCAL_D const TReal32 KDefaultOffset2D = 1199.0;
+
+
+EXPORT_C CHuiGc::CHuiGc()
+        : iOrientation(EOrientationNormal),
+          iNearClipDistance(20.f),
+          iFarClipDistance(10000.f),
+          iFovFactor(1.f),
+          iPenColor(TRgb(255, 255, 255)), iPenAlpha(255),
+          iAlignHorizontal(EHuiAlignHLeft), iAlignVertical(EHuiAlignVTop),
+          iFrustumOffsetCompleteness(1.f),
+          iQuality(EHuiQualityAccurate),
+          iClipRegionStackCount(0)
+    {
+    /// @todo  Fix this: The real default is 1.f, but the application should
+    ///        be able to adjust the completeness. Wowidle/Mmenu have been
+    ///        developed with .666f.
+    iFrustumOffsetCompleteness = .666f;
+    }
+
+EXPORT_C CHuiGc::~CHuiGc()
+    {
+    iTempRegion.Close();
+    iClipRegion.Close();
+    iClipRegionStack.Reset();
+    iRecycledRegions.ResetAndDestroy();    
+    iWindowTransform = NULL;
+    iCurrentFont = NULL;
+    }
+
+
+EXPORT_C void CHuiGc::SetQuality(THuiQuality aQuality)
+    {
+    iQuality = aQuality;
+    }
+
+
+EXPORT_C THuiQuality CHuiGc::Quality() const
+    {
+    return iQuality;
+    }
+
+
+EXPORT_C void CHuiGc::SetDisplayArea(const TRect& aDisplayArea)
+    {
+    iDisplayArea = aDisplayArea;
+    iClipRegion.Clear();
+    iClipRegion.AddRect(aDisplayArea);
+    }
+
+
+EXPORT_C TRect CHuiGc::DisplayArea() const
+    {
+    if(iOrientation == EOrientationNormal)
+        {
+        return iDisplayArea;
+        }
+    else
+        {
+        TInt width = iDisplayArea.Width();
+        TInt height = iDisplayArea.Height();
+        /// @todo  Should not always be at the top left corner.
+        TRect rect(TPoint(0, 0), TSize(height, width));
+        return rect;
+        }
+    }
+
+
+EXPORT_C void CHuiGc::SetOrientation(TOrientation aOrientation)
+    {
+    iOrientation = aOrientation;
+    }
+
+
+EXPORT_C CHuiGc::TOrientation CHuiGc::Orientation() const
+    {
+    return iOrientation;
+    }
+
+
+EXPORT_C void CHuiGc::SetProjection(TProjection aProjection)
+    {
+    SetProjection(aProjection, iDisplayArea);
+    }
+
+
+EXPORT_C CHuiGc::TProjection CHuiGc::Projection() const
+    {
+    return iProjection;
+    }
+
+
+EXPORT_C void CHuiGc::SetProjection(TProjection aProjection, const TRect& aViewport)
+    {
+    iProjection = aProjection;
+    iProjectionViewport = aViewport;
+    iFrustumOffset = THuiRealPoint(0.f, 0.f);
+
+    UpdateProjection();
+    }
+
+
+EXPORT_C void CHuiGc::SetFrustumOffset(const THuiRealPoint& aFrustumOffset)
+    {
+    if(!iDisplayArea.Width() || !iDisplayArea.Height())
+        {
+        return;
+        }
+
+    THuiRealPoint local = aFrustumOffset;
+    TRect area = DisplayArea(); // Orientation applied.
+    local.iX -= area.Width()/2.f;
+    local.iY -= area.Height()/2.f;
+    local.iX /= area.Width()/2.f;
+    local.iY /= area.Height()/2.f;
+
+    // Adjust so that the perspective correction isn't complete.
+    local.iX *= iFrustumOffsetCompleteness;
+    local.iY *= iFrustumOffsetCompleteness;
+
+    iFrustumOffset = local;
+
+    UpdateProjection();
+    }
+
+
+EXPORT_C void CHuiGc::Disable(TFeature aFeature)
+    {
+    Enable(aFeature, EFalse);
+    }
+
+
+EXPORT_C TRect CHuiGc::UnOrientRect(const TRect& aOrientedRect) const
+    {
+    if(iOrientation == EOrientationCCW90)
+        {
+        // Un-orient 90 degrees clockwise.
+        TSize size(aOrientedRect.Height(), aOrientedRect.Width());
+        TPoint pos(iDisplayArea.Width() - aOrientedRect.iBr.iY,
+                   aOrientedRect.iTl.iX);
+        return TRect(pos, size);
+        }
+    else if(iOrientation == EOrientationCW90)
+        {
+        // Un-orient 90 degrees counterclockwise.
+        TSize size(aOrientedRect.Height(), aOrientedRect.Width());
+        TPoint pos(aOrientedRect.iTl.iY,
+                   iDisplayArea.Height() - aOrientedRect.iBr.iX);
+        return TRect(pos, size);
+        }
+    else
+        {
+        // No change because there is no orientation.
+        return aOrientedRect;
+        }
+    }
+
+EXPORT_C void CHuiGc::UnOrientRegion(TRegion& aOrientedRegion) const
+    {
+    if(iOrientation == EOrientationCCW90 || iOrientation == EOrientationCW90)
+        {
+        iTempRegion.Clear();
+        for (TInt i=0; i < aOrientedRegion.Count(); i++)
+            {
+            iTempRegion.AddRect(UnOrientRect(aOrientedRegion[i]));
+            }        
+        aOrientedRegion.Copy(iTempRegion);
+        }
+    else
+        {
+        // No change because there is no orientation.
+        }
+    }
+
+EXPORT_C void CHuiGc::PushClip()
+    {
+    RRegion* newRegion = CreateRecycledRegion();
+    
+    if (newRegion)
+        {
+        newRegion->Copy(iClipRegion);
+        iClipRegionStack.Append(newRegion);    
+        }
+        
+    // Out of memory situation is handled by keeping separate
+    // counter which is checked at pop.   
+    iClipRegionStackCount++;
+    }
+
+EXPORT_C void CHuiGc::PopClip()
+    {
+    __ASSERT_ALWAYS(iClipRegionStack.Count() > 0,
+                    THuiPanic::Panic(THuiPanic::EGcClipStackPopFromEmpty));
+
+    // Check if out of memory situation has happened in the push, so we don't pop
+    // because we have not really pushed anything.  
+    if (iClipRegionStackCount > iClipRegionStack.Count())
+        {
+        iClipRegionStackCount--;    
+        return;
+        }
+
+    if(iClipRegionStack.Count() > 0)
+        {
+        TInt index = iClipRegionStack.Count() - 1;
+        SetClipRegion(*iClipRegionStack[index]);        
+        RRegion* region = iClipRegionStack[index];        
+        iClipRegionStack.Remove(index);
+        DeleteRecycledRegion(region);
+        region = NULL;
+        iClipRegionStackCount--;    
+        }
+    }
+
+EXPORT_C void CHuiGc::SetClip(const TRect& aClipRect)
+    {
+    HUI_ASSERT(aClipRect.Width() >= 0);
+    HUI_ASSERT(aClipRect.Height() >= 0);    
+    
+    iTempRegion.Clear();
+    iTempRegion.AddRect(aClipRect);    
+    CHuiGc::SetClipRegion(iTempRegion);
+    }
+
+EXPORT_C TRect CHuiGc::ClipRect() const
+    {
+    // This does not really provide actually valid data anymore
+    // since clipping is done with a region. 
+    return iClipRegion.BoundingRect();
+    }
+
+const TRegion& CHuiGc::ClipRegion() const
+    {
+    return iClipRegion;
+    }
+
+
+EXPORT_C void CHuiGc::Clip(const TRect& aClipRect)
+    {
+    HUI_ASSERT(aClipRect.Width() >= 0);
+    HUI_ASSERT(aClipRect.Height() >= 0);
+    
+    if(iClipRegion.Intersects(aClipRect))
+        {
+        iTempRegion.Clear();
+        iTempRegion.AddRect(aClipRect);
+        iClipRegion.Intersect(iTempRegion);
+        }
+    else
+        {
+        // Empty clipping rectangle.
+        iClipRegion.Clear();
+        }
+    
+    SetClipRegion(iClipRegion);        
+    }
+
+EXPORT_C void CHuiGc::Clip(const TRegion& aClipRegion)
+    {
+    iClipRegion.Intersect(aClipRegion);
+    SetClipRegion(iClipRegion);
+    }
+    
+EXPORT_C void CHuiGc::SetClipRegion(const TRegion& aClipRegion)
+	{
+	if (&aClipRegion != &iClipRegion)
+	    {
+	    iClipRegion.Copy(aClipRegion);        
+	    }
+	}
+	
+EXPORT_C void CHuiGc::CancelClipping()
+    {
+    }
+
+EXPORT_C TInt CHuiGc::ClipStackCount() const
+    {
+    return iClipRegionStack.Count();
+    }
+
+
+EXPORT_C void CHuiGc::SetAlign(THuiAlignHorizontal aHorizontalAlign,
+                               THuiAlignVertical aVerticalAlign)
+    {
+    switch(aHorizontalAlign)
+        {
+        case EHuiAlignHLocale:
+            iAlignHorizontal = LocaleTextAlignment();
+            break;
+
+        case EHuiAlignHLocaleMirrored:
+            iAlignHorizontal = LocaleTextAlignment();
+            if(iAlignHorizontal == EHuiAlignHLeft)
+                {
+                iAlignHorizontal = EHuiAlignHRight;
+                }
+            else
+                {
+                iAlignHorizontal = EHuiAlignHLeft;
+                }
+            break;
+
+        default:
+            iAlignHorizontal = aHorizontalAlign;
+            break;
+        }
+
+    iAlignVertical = aVerticalAlign;
+    }
+
+
+EXPORT_C THuiAlignHorizontal CHuiGc::AlignHorizontal() const
+    {
+    return iAlignHorizontal;
+    }
+
+
+EXPORT_C THuiAlignVertical CHuiGc::AlignVertical() const
+    {
+    return iAlignVertical;
+    }
+
+
+EXPORT_C void CHuiGc::SetPenColor(const TRgb& aColor)
+    {
+    iPenColor = aColor;
+    }
+
+
+EXPORT_C TRgb CHuiGc::PenColor() const
+    {
+    return iPenColor;
+    }
+
+
+EXPORT_C void CHuiGc::SetPenColorAlpha(const TRgb& aColor)
+    {
+    iPenColor = aColor;
+    iPenColor.SetAlpha(255);
+
+    iPenAlpha = TUint8(aColor.Alpha()); // 8 bits should be enough
+    }
+
+
+EXPORT_C TRgb CHuiGc::PenColorAlpha() const
+    {
+    TRgb color = iPenColor;
+    color.SetAlpha(iPenAlpha);
+    return color;
+    }
+
+
+EXPORT_C void CHuiGc::SetPenAlpha(TInt aAlpha)
+    {
+    if(aAlpha < 0)
+        {
+        aAlpha = 0;
+        }
+    else if(aAlpha > 255)
+        {
+        aAlpha = 255;
+        }
+    else
+        {
+        // for PC lint
+        }
+    iPenAlpha = TUint8(aAlpha); // 8 bits should be enough
+    }
+
+
+EXPORT_C TInt CHuiGc::PenAlpha() const
+    {
+    return iPenAlpha;
+    }
+
+
+EXPORT_C void CHuiGc::SetFont(THuiFont& aFont)
+    {
+    iCurrentFont = &aFont;
+    }
+
+
+EXPORT_C void CHuiGc::DrawTextL(const TDesC& aText,
+                                const THuiRealRect& aBounds,
+                                TReal32 aShadow) __SOFTFP
+    {
+    if(!Font())
+        {
+        return;
+        }
+    CHuiTextMesh* mesh = CHuiStatic::Renderer().CreateTextMeshL();
+    CleanupStack::PushL(mesh);
+    mesh->SetTextL(aText, ETrue);
+    DrawText(*mesh, aBounds, aShadow);
+    CleanupStack::PopAndDestroy(mesh);
+    }
+
+
+EXPORT_C void CHuiGc::DrawText(const CHuiTextMesh& aTextMesh,
+                               const THuiRealRect& aBounds,
+                               TReal32 aShadow) __SOFTFP
+    {
+    /** @todo  This could be generalized: MHuiBoundedDrawable (for example) */
+
+    // Font is defined in the text mesh.
+
+    // Real bounding size of the text.
+    TSize textBounds = aTextMesh.Extents();
+
+    // Reference origin for the text.
+    TPoint offset = AlignOffset(aBounds.Size());
+
+    // Actual starting point for glyphs.
+    THuiRealPoint pos = aBounds.iTl - offset;
+    switch(AlignHorizontal())
+        {
+        case EHuiAlignHRight:
+            pos.iX -= textBounds.iWidth;
+            break;
+
+        case EHuiAlignHCenter:
+            pos.iX -= textBounds.iWidth / 2; // or 2.f?
+            break;
+
+        default:
+            break;
+        }
+    switch(AlignVertical())
+        {
+        case EHuiAlignVBottom:
+            pos.iY -= textBounds.iHeight;
+            break;
+
+        case EHuiAlignVCenter:
+            pos.iY -= textBounds.iHeight / 2; // or 2.f?
+            break;
+
+        default:
+            break;
+        }
+
+
+    // Apply the position.
+    Push(EHuiGcMatrixModel);
+    Translate(EHuiGcMatrixModel, pos.iX, pos.iY, 0.f);
+
+    aTextMesh.Draw(*this, aShadow);
+
+    Pop(EHuiGcMatrixModel);
+    }
+
+
+EXPORT_C void CHuiGc::DrawImage(const THuiImage& aImage,
+                                const THuiRealPoint& aPos,
+                                const THuiRealSize& aSize)
+    {
+    if(!aImage.HasTexture())
+        {
+        return;
+        }
+
+    THuiRealPoint topLeft = aPos + AlignOffset(aSize);
+    UpdateColor();
+
+    // Update texture preferred size, toolkit may use this information to resize texture
+    NotifyImagePreferredSize(aImage, THuiRealRect(topLeft,aSize));
+    
+    DoDrawImage(aImage, topLeft, aSize);
+    }
+
+
+EXPORT_C void CHuiGc::DrawImages(const THuiImage& aImage,
+                                 const THuiImage& aImage2,
+                                 const THuiRealPoint& aPos,
+                                 const THuiRealSize& aSize)
+    {
+    if(!aImage.HasTexture() || !aImage2.HasTexture())
+        {
+        return;
+        }
+
+    THuiRealPoint topLeft = aPos + AlignOffset(aSize);
+    UpdateColor();
+    
+    // Update texture preferred size, toolkit may use this information to resize texture
+    NotifyImagePreferredSize(aImage, THuiRealRect(topLeft,aSize));
+    NotifyImagePreferredSize(aImage2, THuiRealRect(topLeft,aSize));
+
+    DoDrawImages(aImage, aImage2, topLeft, aSize);
+    }
+
+
+EXPORT_C void CHuiGc::DrawImage(const THuiImage& aImage,
+                                const THuiRealRect& aBounds)
+    {
+    if(!aImage.HasTexture())
+        {
+        return;
+        }
+
+    TSize space(TInt(aBounds.Width() - aImage.Texture().Size().iWidth),
+                TInt(aBounds.Height() - aImage.Texture().Size().iHeight));
+
+    TPoint topLeft = aBounds.iTl - AlignOffset(space);
+
+    UpdateColor();
+
+    // Update texture preferred size, toolkit may use this information to resize texture
+    NotifyImagePreferredSize(aImage, aBounds);
+
+    DoDrawImage(aImage, topLeft, aImage.Texture().Size());
+    }
+
+
+EXPORT_C void CHuiGc::DrawImage( const THuiImage& aImage,
+                                 const THuiRealSize& aSize,
+                                 const THuiRealRect& aBounds)
+    {
+    if(!aImage.HasTexture())
+        {
+        return;
+        }
+
+    TSize space(TInt(aBounds.Width() - aSize.iWidth),
+                TInt(aBounds.Height() - aSize.iHeight));
+
+    TPoint topLeft = aBounds.iTl - AlignOffset(space);
+
+    UpdateColor();
+
+    // Update texture preferred size, toolkit may use this information to resize texture
+    NotifyImagePreferredSize(aImage, THuiRealRect(topLeft,aSize));
+
+    DoDrawImage(aImage, topLeft, aSize);
+    }
+
+
+EXPORT_C void CHuiGc::DrawImages(const THuiImage& aImage,
+                                 const THuiImage& aImage2,
+                                 const THuiRealSize& aSize,
+                                 const THuiRealRect& aBounds)
+    {
+    if(!aImage.HasTexture() || !aImage2.HasTexture())
+        {
+        return;
+        }
+
+    TSize space(TInt(aBounds.Width() - aSize.iWidth),
+                TInt(aBounds.Height() - aSize.iHeight));
+
+    TPoint topLeft = aBounds.iTl - AlignOffset(space);
+
+    UpdateColor();
+
+    // Update texture preferred size, toolkit may use this information to resize texture
+    NotifyImagePreferredSize(aImage, THuiRealRect(topLeft,aSize));
+    NotifyImagePreferredSize(aImage2, THuiRealRect(topLeft,aSize));
+
+    DoDrawImages(aImage, aImage2, topLeft, aSize);
+    }
+
+
+EXPORT_C THuiFont* CHuiGc::Font()
+    {
+    return iCurrentFont;
+    }
+
+
+EXPORT_C TPoint CHuiGc::AlignOffset(const TSize& aBounds) const
+    {
+    TPoint offset(0, 0);
+
+    switch(iAlignHorizontal)
+        {
+        case EHuiAlignHRight:
+            offset.iX = -aBounds.iWidth;
+            break;
+
+        case EHuiAlignHCenter:
+            offset.iX = -aBounds.iWidth / 2;
+            break;
+
+        default:
+            offset.iX = 0;
+            break;
+        }
+
+    switch(iAlignVertical)
+        {
+        case EHuiAlignVBottom:
+            offset.iY = -aBounds.iHeight;
+            break;
+
+        case EHuiAlignVCenter:
+            offset.iY = -aBounds.iHeight / 2;
+            break;
+
+        default:
+            offset.iY = 0;
+            break;
+        }
+
+    return offset;
+    }
+
+
+EXPORT_C TReal32 CHuiGc::Offset2D() const __SOFTFP
+    {
+    /// @todo  Make this configurable.
+    //return 100.0 / FovFactor();
+    return KDefaultOffset2D;
+    }
+
+
+EXPORT_C void
+CHuiGc::SetWindowTransformation(CHuiTransformation* aWindowTransformation)
+    {
+    iWindowTransform = aWindowTransformation;
+    }
+
+
+EXPORT_C TReal32 CHuiGc::NearClipDistance() const __SOFTFP
+    {
+    return iNearClipDistance;
+    }
+
+
+EXPORT_C TReal32 CHuiGc::FarClipDistance() const __SOFTFP
+    {
+    return iFarClipDistance;
+    }
+
+
+EXPORT_C TRect CHuiGc::ProjectionViewport() const
+    {
+    return iProjectionViewport;
+    }
+
+
+EXPORT_C TRect CHuiGc::RawDisplayArea() const
+    {
+    return iDisplayArea;
+    }
+
+
+EXPORT_C const CHuiTransformation* CHuiGc::WindowTransformation() const
+    {
+    return iWindowTransform;
+    }
+
+
+EXPORT_C THuiRealPoint CHuiGc::FrustumOffset() const
+    {
+    return iFrustumOffset;
+    }
+
+
+EXPORT_C TReal32 CHuiGc::FovFactor() const __SOFTFP
+    {
+    return 1.f / iFovFactor;
+    }
+
+
+EXPORT_C THuiAlignHorizontal CHuiGc::LocaleTextAlignment()
+    {
+    if(CHuiStatic::LayoutMirrored())
+        {
+        return EHuiAlignHRight;
+        }
+    return EHuiAlignHLeft;
+    }
+
+EXPORT_C void CHuiGc::DrawStretchImage(TStretchMode /*aMode*/,
+                      const THuiImage& aImage,
+                      const THuiRealRect& aRect,
+                      TInt /*aStretchStartWidth*/,
+                      TInt /*aStretchEndWidth*/)                      
+    {
+    // Update texture preferred size, toolkit may use this information to resize texture
+    NotifyImagePreferredSize(aImage, aRect);        
+    }
+
+
+EXPORT_C void CHuiGc::NotifyImagePreferredSize(const THuiImage& aImage, THuiRealRect aRect)
+    {
+    const CHuiTexture* texture = aImage.ImageDefaultTexture();    
+    
+    if  (texture)
+        {        
+        CHuiTexture* notifiedTexture = const_cast<CHuiTexture*> (texture);
+        if (notifiedTexture->IsAutoSizeCalculationEnabled())
+            {                
+            TReal32 xratio = 1;
+            TReal32 yratio = 1;
+            
+            // Take into account used texture coordinates of THuiImage       
+            TReal32 relativeWidth = aImage.BottomRight().iX - aImage.TopLeft().iX;
+            TReal32 relativeHeight = aImage.BottomRight().iY - aImage.TopLeft().iY;
+            
+            if (relativeWidth != 0.f && relativeHeight != 0.f)
+                {
+                xratio *= (1/relativeWidth);
+                yratio *= (1/relativeHeight);                
+                }
+
+            TReal32 width = aRect.Size().iWidth * xratio;
+            TReal32 height = aRect.Size().iHeight * yratio;
+            
+            // Take into account window transformation scale (To enable HiRes TV-OUT textures)
+            // Other transformations are ignored for now. Possible those could be optionally
+            // taken into account as well if resizing algortihm is lazy enough.
+            CHuiTransformation* wt =  (CHuiTransformation*)WindowTransformation();
+            if (wt)
+                {
+                TInt count = wt->Count();
+                for (TInt i=0;i<count;i++)
+                    {
+                    CHuiTransformation::TTransform& step = wt->Step(i);
+                    if (step.iType == CHuiTransformation::ETypeScale)
+                        {
+                        width = width * step.iParams[EHuiTransformParamTranslateX].Now();    
+                        height = height * step.iParams[EHuiTransformParamTranslateY].Now();    
+                        }                        
+                    }                    
+                }
+            
+            
+            notifiedTexture->NotifyPreferredSize(THuiRealSize(width,height));    
+            }
+        }
+    }
+
+EXPORT_C void CHuiGc::TransformDirtyRect(THuiRealRect& /*aRect*/)
+    {
+    // No sensible implementation for HuiGc base class. Implement at least in
+    // HuiBitgdiGc child class.
+    }
+
+EXPORT_C void CHuiGc::EnableTransformedClippingRects(TBool /*aEnable*/)
+    {
+    // No sensible implementation for HuiGc base class. Implement at least in
+    // HuiBitgdiGc child class.
+    }
+
+EXPORT_C void CHuiGc::SetClip(const TRect& /*aClipRect*/, TBool /*aTransformClipRect*/)
+    {
+    // No sensible implementation for HuiGc base class. Implement at least in
+    // HuiBitgdiGc child class.
+    }
+
+EXPORT_C void CHuiGc::GcExtension(const TUid& /*aExtensionUid*/, TAny** aExtensionParams)
+    {
+    // If no extension with given UID was found, indicate it by returning null
+    *aExtensionParams = NULL;
+    }
+
+RRegion* CHuiGc::CreateRecycledRegion()
+    {
+    RRegion* region = NULL;
+    if (iRecycledRegions.Count())
+        {
+        // If there are recycled regionbufs, use one of those
+        TInt last = iRecycledRegions.Count() - 1;
+        region = iRecycledRegions[last];
+        iRecycledRegions.Remove(last);    
+        }
+    else
+        {
+        // No recycled regionbufs available, create new one
+        region = new RRegionBuf<KHuiGcClipRegionGranularity>();   
+        }    
+    return region;        
+    }
+
+void CHuiGc::DeleteRecycledRegion(RRegion* aRegion)
+    {
+    TInt error = KErrNone;
+    
+    if (iRecycledRegions.Count() < KHuiMaxRecycledRegionCount)
+        {
+        aRegion->Clear();
+        error = iRecycledRegions.Append(aRegion);            
+        if (error)
+            {
+            aRegion->Destroy();
+            }
+        }
+    else
+        {
+        aRegion->Destroy();
+        }                    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiGradientBrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,300 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiLinearGradientBrush - a Brush that is 
+*                able to draw linear color gradients.
+*
+*/
+
+
+
+#include "uiacceltk/HuiGradientBrush.h"  // Class definition
+#include "uiacceltk/HuiDrawing.h"
+#include "uiacceltk/HuiVisual.h"
+#include "uiacceltk/HuiUtil.h"
+
+
+EXPORT_C CHuiGradientBrush* CHuiGradientBrush::NewL()
+    {
+    CHuiGradientBrush* self = NewLC();
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+EXPORT_C CHuiGradientBrush* CHuiGradientBrush::NewLC()
+    {
+    CHuiGradientBrush* self = new (ELeave) CHuiGradientBrush();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+
+CHuiGradientBrush::CHuiGradientBrush()
+        : CHuiBrush(),
+          iDirection(EDirectionRight)
+    {
+    }
+
+
+void CHuiGradientBrush::ConstructL()
+    {
+    SColor defaultColor;
+    defaultColor.iPosition = 0;
+    defaultColor.iColor = KRgbWhite;
+    defaultColor.iOpacity = 1.0;
+    User::LeaveIfError(iColors.Append(defaultColor));
+    }
+
+
+CHuiGradientBrush::~CHuiGradientBrush()
+    {
+    iColors.Reset();
+    }
+
+
+EXPORT_C void CHuiGradientBrush::SetDirection(TDirection aDirection)
+    {
+    iDirection = aDirection;
+    SetChanged();
+    }
+    
+
+void CHuiGradientBrush::Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const
+    {
+    TRect content = aGuide.BrushRect();
+    TReal32 opacity = aGuide.BrushOpacity() * iOpacity.Now();
+
+    if(opacity <= 0)
+        {
+        return;
+        }
+
+    TBool useTexture = EFalse;
+    TReal32 texCoords[8];
+    THuiRealRect texCoordRect;
+
+    aGc.SetPenAlpha(TInt(opacity * 255));
+
+    if(iImage.HasTexture())
+        {
+        useTexture = ETrue;
+        iImage.GetTexCoords(texCoords);
+        aGc.Enable(CHuiGc::EFeatureTexturing);
+        iImage.Texture().Bind();
+        }
+    else
+        {
+        aGc.Disable(CHuiGc::EFeatureTexturing);
+        }
+
+    // Optimization for gradientbrush (MNIA-7G79GD). Draws a simple rect with one color
+    // if there really isn't anything to gradient. 
+    // Updated optimization to work with single semi-transparent color
+    if(iColors.Count() == 1 && !iImage.HasTexture() && (iColors[0].iOpacity * opacity) >= 1 )
+        {
+        aGc.SetPenColor(iColors[0].iColor);
+        aGc.DrawRect(content);
+        return;
+        }
+
+    aGc.Enable(CHuiGc::EFeatureBlending);
+
+    TInt segments = iColors.Count() - 1;
+    if(segments <= 0)
+        {
+        segments = 1;
+        }
+
+    TInt length = content.Width();
+    TBool isHoriz = ETrue;
+    TBool invert = EFalse;
+    CHuiGc::TGradientType gradientType;
+
+    switch(iDirection)
+        {
+        default:
+        case EDirectionUp:
+            gradientType = CHuiGc::EGradientLinearUp;
+            isHoriz = EFalse;
+            length = content.Height();
+            invert = ETrue;
+            break;
+
+        case EDirectionDown:
+            gradientType = CHuiGc::EGradientLinearDown;
+            isHoriz = EFalse;
+            length = content.Height();
+            break;
+
+        case EDirectionRight:
+            gradientType = CHuiGc::EGradientLinearRight;
+            break;
+
+        case EDirectionLeft:
+            gradientType = CHuiGc::EGradientLinearLeft;
+            invert = ETrue;
+            break;
+        }
+
+    for(TInt start = 0; start < segments; ++start)
+        {
+        TReal32 startPosition = iColors[start].iPosition;
+
+        TInt end = start + 1;
+        TReal32 endPosition;
+        if(end >= iColors.Count())
+            {
+            end = iColors.Count() - 1;
+            endPosition = 1;
+            }
+        else
+            {
+            endPosition = iColors[end].iPosition;
+            }
+
+        if(iColors[start].iOpacity <= 0 && iColors[end].iOpacity <= 0)
+            {
+            // Won't be visible.
+            continue;
+            }
+
+        if(invert)
+            {
+            // Inverted direction.
+            startPosition = 1 - startPosition;
+            endPosition = 1 - endPosition;
+            }
+
+        TInt beginCoord = (isHoriz? content.iTl.iX : content.iTl.iY);
+        TInt startCoord = beginCoord + TInt(startPosition * length);
+        TInt endCoord = beginCoord + TInt(endPosition * length);
+
+        TRect segmentRect;
+
+        if(isHoriz)
+            {
+            segmentRect.iTl = TPoint(startCoord, content.iTl.iY);
+            segmentRect.iBr = TPoint(endCoord, content.iBr.iY);
+            }
+        else
+            {
+            segmentRect.iTl = TPoint(content.iTl.iX, startCoord);
+            segmentRect.iBr = TPoint(content.iBr.iX, endCoord);
+            }
+
+        // Calculate texture coordinates, if necessary.
+        if(useTexture)
+            {
+            if(isHoriz)
+                {
+                texCoordRect.iTl.iX = HuiUtil::Interpolate(startPosition, texCoords[0], texCoords[2]);
+                texCoordRect.iTl.iY = texCoords[3];
+                texCoordRect.iBr.iX = HuiUtil::Interpolate(endPosition, texCoords[0], texCoords[2]);
+                texCoordRect.iBr.iY = texCoords[5];
+                }
+            else
+                {
+                texCoordRect.iTl.iX = texCoords[0];
+                texCoordRect.iTl.iY = HuiUtil::Interpolate(startPosition, texCoords[3], texCoords[5]);
+                texCoordRect.iBr.iX = texCoords[2];
+                texCoordRect.iBr.iY = HuiUtil::Interpolate(endPosition, texCoords[3], texCoords[5]);
+                }
+            }
+
+        aGc.DrawGradient(gradientType, segmentRect,
+                         iColors[start].iColor, iColors[end].iColor,
+                         iColors[start].iOpacity * opacity,
+                         iColors[end].iOpacity * opacity,
+                         useTexture? &texCoordRect : NULL);                     
+        }
+    aGc.Disable(CHuiGc::EFeatureBlending);        
+    }
+
+
+EXPORT_C void CHuiGradientBrush::SetColor(const TRgb& aColor, TReal32 aOpacity) __SOFTFP
+    {
+    while(iColors.Count() > 1)
+        {
+        iColors.Remove(iColors.Count() - 1);
+        }
+
+    SColor color;
+    color.iPosition = 0;
+    color.iColor = aColor;
+    color.iOpacity = aOpacity;
+
+    iColors[0] = color;
+
+    SetChanged();
+    }
+
+
+EXPORT_C TRgb CHuiGradientBrush::Color(TInt aIndex) const
+    {
+    // make sure aIndex is not out of bounds
+    if ( aIndex < iColors.Count() )
+        {
+        return iColors[aIndex].iColor;
+        }
+    else
+        {
+        // default color always exists
+        return iColors[0].iColor;
+        }
+    }
+
+
+EXPORT_C TReal32 CHuiGradientBrush::Opacity(TInt aIndex) const __SOFTFP
+    {
+    // make sure aIndex is not out of bounds
+    // make sure aIndex is not out of bounds
+    if ( aIndex < iColors.Count() )
+        {
+        return iColors[aIndex].iOpacity;
+        }
+    else
+        {
+        // default color always exists
+        return iColors[0].iOpacity;
+        }
+    }
+
+
+EXPORT_C void CHuiGradientBrush::AppendColorL(TReal32 aPosition,
+                                               const TRgb& aColor,
+                                               TReal32 aOpacity) __SOFTFP
+    {
+    SColor color;
+
+    color.iPosition = aPosition;
+    color.iColor = aColor;
+    color.iOpacity = aOpacity;
+    User::LeaveIfError(iColors.Append(color));
+
+    SetChanged();
+    }
+
+
+EXPORT_C void CHuiGradientBrush::SetImage(const THuiImage& aImage)
+    {
+    iImage = aImage;
+    SetChanged();
+    }
+
+
+EXPORT_C const THuiImage& CHuiGradientBrush::Image() const
+    {
+    return iImage;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiGridLayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,839 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "uiacceltk/HuiGridLayout.h"  // Class definition
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/huimetric.h"
+
+#include <AknUtils.h>
+
+
+#define FLOOR(x) (TReal32(TInt(TReal32(x))))
+#define FLOOR_INT(x) (TInt((x)))
+
+// Symbian does not have a native ceil() implementation, we need to use "near enough" rounding.
+#define CEIL(x) (TReal32(TInt(TReal32(x)+0.999f)))
+#define CEIL_INT(x) (TInt(TReal32(x)+0.999f))
+
+// Fractional part of real
+#define FRAC(x) (TReal32(x)-FLOOR(x))
+
+//
+// Private structures
+//
+
+struct TAxis
+    {
+    
+    /** Array of block weights. Used to calculate relative sizes of lines of blocks. */
+    RArray<THuiMetric> iWeights;
+    TUint iLayoutFlags;    
+    };
+
+/*
+ * grid weights
+ */
+struct CHuiGridLayout::TGridLayoutPrivateData
+    {
+public:
+    TGridLayoutPrivateData();
+public:
+    RArray<TAxis> iAxes;
+    
+    /** Sets the grid dimensions to automatically expand to store more content */
+    TInt iExpansionFlags;
+    };
+
+CHuiGridLayout::TGridLayoutPrivateData::TGridLayoutPrivateData()
+    : 
+    iExpansionFlags(0) 
+    {
+    
+    }
+
+
+//
+// class CHuiGridLayout
+//
+
+EXPORT_C CHuiGridLayout* CHuiGridLayout::AddNewL(CHuiControl& aOwnerControl, 
+                                                 TInt aColumns, TInt aRows,
+                                                 CHuiLayout* aParentLayout)
+    {
+    CHuiGridLayout* grid = STATIC_CAST(CHuiGridLayout*,
+        aOwnerControl.AppendLayoutL(EHuiLayoutTypeGrid, aParentLayout));
+    grid->SetColumnsL(aColumns);
+    grid->SetRowsL(aRows);
+
+    return grid;
+    }
+
+
+EXPORT_C CHuiGridLayout::CHuiGridLayout(MHuiVisualOwner& aOwner)
+        : CHuiLayout(aOwner)
+    {
+    }
+
+
+EXPORT_C void CHuiGridLayout::ConstructL()
+    {    
+    CHuiLayout::ConstructL();
+    iGridLayoutData = new(ELeave) TGridLayoutPrivateData;
+    for(TInt ii = EHuiGridColumn; ii <= EHuiGridRow; ii++)
+        {
+        TAxis axis;
+        axis.iLayoutFlags = 0;
+        
+        iGridLayoutData->iAxes.AppendL(axis);
+        }
+    SetColumnsL(1);
+    SetRowsL(1);
+    }
+
+	
+EXPORT_C CHuiGridLayout::~CHuiGridLayout()
+    {    
+    if ( iGridLayoutData )
+        {
+        for(TInt ii = EHuiGridColumn; ii <= EHuiGridRow; ii++)
+            {
+            TAxis& axis = iGridLayoutData->iAxes[ii];
+            axis.iWeights.Reset();
+            }
+
+        iGridLayoutData->iAxes.Reset();
+        }
+
+    delete iGridLayoutData;
+    iGridLayoutData = 0;
+    }
+
+
+EXPORT_C TInt CHuiGridLayout::ChildOrdinal(TInt aIndex)
+    {
+    // Use the visual index as ordinal.
+    return EffectiveLayoutOrdinal(Visual(aIndex));
+    }
+
+
+EXPORT_C TPoint CHuiGridLayout::OrdinalToBlock(TInt aOrdinal) const
+    {
+    TPoint block(0,0);
+    TInt cols = ColumnCount();
+    TInt rows = RowCount();
+    
+    if (cols && rows)
+        {
+        if ( iGridLayoutData->iExpansionFlags & EExpandHorizontally )
+            {
+            block.iX = aOrdinal / rows;
+            block.iY = aOrdinal % rows;
+            }
+        else
+            {
+            // By default the flow is vertically
+            block.iX = aOrdinal % cols;
+            block.iY = aOrdinal / cols;
+            }
+        }
+        
+    return block;    
+    }
+
+EXPORT_C void CHuiGridLayout::SetSize(const THuiRealSize& aSize, TInt aTransitionTime)
+    {
+    CHuiLayout::SetSize(aSize, aTransitionTime);
+    UpdateChildrenLayout(aTransitionTime);    
+    }
+
+EXPORT_C TBool CHuiGridLayout::ChildSize(TInt aOrdinal, TSize& aSize)
+    {
+    TBool result(EFalse);
+    THuiRealRect rect;
+    TInt childRectStatus(THuiLayoutChildRectUpdateNotNeeded);
+    childRectStatus = ChildRect(aOrdinal, rect);
+    if(childRectStatus != THuiLayoutChildRectNotImplemented)
+        {
+        result = (childRectStatus & THuiLayoutChildRectSizeUpdateNeeded);
+        if(result)
+            {
+            THuiRealPoint size(rect.Width(), rect.Height());
+            aSize = LocalPointInPixels(size).AsSize();
+            }
+        }
+    return result;
+    }
+    
+EXPORT_C TBool CHuiGridLayout::ChildPos(TInt aOrdinal, TPoint& aPos)
+    {
+    TBool result(EFalse);
+    THuiRealRect rect;
+    TInt childRectStatus(THuiLayoutChildRectUpdateNotNeeded);
+    childRectStatus = ChildRect(aOrdinal, rect);
+    if(childRectStatus != THuiLayoutChildRectNotImplemented)
+        {
+        result = (childRectStatus & THuiLayoutChildRectPosUpdateNeeded);
+        if(result)
+            {
+            aPos = LocalPointInPixels(rect.iTl);
+            }
+        }
+    return result;
+    }
+    
+    
+EXPORT_C TInt CHuiGridLayout::ChildRect(TInt aOrdinal, THuiRealRect& aPos)
+    {        
+    if (!ColumnCount() || !RowCount())
+        {
+        return THuiLayoutChildRectUpdateNotNeeded;
+        }
+        
+    // @todo refactorize with CHuiLayout::InnerSize
+    THuiRealRect paddingPx = PaddingInPixels(EHuiReferenceStateTarget);
+
+    // find the inner border and remove the inner paddings
+    THuiRealPoint innerSizePx = LocalPointInPixels(Size().RealTarget(), EHuiReferenceStateTarget);
+    innerSizePx.iX -= paddingPx.iTl.iX + paddingPx.iBr.iX;
+    innerSizePx.iY -= paddingPx.iTl.iY + paddingPx.iBr.iY;
+
+    // subtract the inner padding (space between each child).
+    THuiRealPoint innerPaddingPx = MetricToPixels(InnerPadding(), EHuiReferenceStateTarget);
+     
+    THuiRealPoint availablePx(innerSizePx.iX - ((ColumnCount() - 1) * innerPaddingPx.iX),
+                              innerSizePx.iY - ((RowCount() - 1) * innerPaddingPx.iY));
+
+    TPoint blockLogical = OrdinalToBlock(aOrdinal);
+    TPoint blockPosPx;
+    TSize blockSizePx;
+
+    CalculateCellInPixels(EHuiGridColumn, blockLogical.iX, availablePx.iX, blockPosPx.iX, blockSizePx.iWidth);
+    CalculateCellInPixels(EHuiGridRow, blockLogical.iY, availablePx.iY, blockPosPx.iY, blockSizePx.iHeight);    
+
+    // now add back in the inner paddings and the padding
+    blockPosPx.iX += HUI_ROUND_FLOAT_TO_INT( paddingPx.iTl.iX + (blockLogical.iX * innerPaddingPx.iX) );
+    blockPosPx.iY += HUI_ROUND_FLOAT_TO_INT( paddingPx.iTl.iY + (blockLogical.iY * innerPaddingPx.iY) );
+
+    // get metric reference, for converting between base units of this layout (from the child visual's perspective) and pixels
+    THuiRealPoint layoutRefPx = MetricReferenceForLayoutInPixels(BaseUnit().Abs()); // always target reference
+
+    // Convert the result back into child relative coordinates
+    THuiXYMetric blockPosChildMetric = BaseUnit();
+    THuiXYMetric blockSizeChildMetric = BaseUnit();
+
+    ConvertPixelsToMetricLength(blockPosChildMetric.iX, TReal32(blockPosPx.iX), layoutRefPx.iX);
+    ConvertPixelsToMetricLength(blockPosChildMetric.iY, TReal32(blockPosPx.iY), layoutRefPx.iY);
+    ConvertPixelsToMetricLength(blockSizeChildMetric.iX, TReal32(blockSizePx.iWidth), layoutRefPx.iX);
+    ConvertPixelsToMetricLength(blockSizeChildMetric.iY, TReal32(blockSizePx.iHeight), layoutRefPx.iY);
+
+    aPos.iTl.iX =  blockPosChildMetric.iX.iMagnitude;
+    aPos.iTl.iY =  blockPosChildMetric.iY.iMagnitude;
+    aPos.iBr.iX = aPos.iTl.iX + blockSizeChildMetric.iX.iMagnitude;
+    aPos.iBr.iY = aPos.iTl.iY + blockSizeChildMetric.iY.iMagnitude;
+    
+    return THuiLayoutChildRectLayoutUpdateNeeded;
+    }
+   
+   
+EXPORT_C void CHuiGridLayout::SetColumnsL(TInt aColumnCount)
+    {
+    THuiMetric defaultWeight(1.f, EHuiUnitWeight);
+    FillWeightsL(EHuiGridColumn, aColumnCount, defaultWeight);    
+    }
+   
+    
+EXPORT_C void CHuiGridLayout::SetRowsL(TInt aRowCount)
+    {
+    THuiMetric defaultWeight(1.f, EHuiUnitWeight);
+    FillWeightsL(EHuiGridRow, aRowCount, defaultWeight);    
+    }
+   
+
+EXPORT_C void CHuiGridLayout::SetColumnsL(const RArray<TInt>& aWeights)
+    {
+    TAxis& axis = iGridLayoutData->iAxes[EHuiGridColumn];
+    axis.iWeights.Reset();
+    for(TInt i = 0; i < aWeights.Count(); ++i)
+        {
+        THuiMetric weight(TReal32(aWeights[i]), EHuiUnitWeight);
+        User::LeaveIfError(axis.iWeights.Append(weight));
+        }
+    }
+    
+EXPORT_C void CHuiGridLayout::SetRowsL(const RArray<TInt>& aWeights)
+    {
+    TAxis& axis = iGridLayoutData->iAxes[EHuiGridRow];
+    axis.iWeights.Reset();
+    for(TInt i = 0; i < aWeights.Count(); ++i)
+        {
+        THuiMetric weight(TReal32(aWeights[i]), EHuiUnitWeight);
+        User::LeaveIfError(axis.iWeights.Append(weight));
+        }
+    }
+
+EXPORT_C void CHuiGridLayout::FillWeightsL(THuiGridDimension aDim, TInt aCount, const THuiMetric& aWeight)
+    {
+    if(aDim <= EHuiGridRow)
+        {
+        TAxis& axis = iGridLayoutData->iAxes[aDim];
+        axis.iWeights.Reset();
+        for(TInt i = 0; i < aCount; ++i)
+            {
+            User::LeaveIfError(axis.iWeights.Append(aWeight));
+            }
+        }
+    }
+    
+EXPORT_C void CHuiGridLayout::AppendWeightL(THuiGridDimension aDim, const THuiMetric& aWeight)
+    {
+    if(aDim <= EHuiGridRow)
+        {
+        TAxis& axis = iGridLayoutData->iAxes[aDim];
+        User::LeaveIfError(axis.iWeights.Append(aWeight));
+        }
+    }
+    
+EXPORT_C void CHuiGridLayout::InsertWeightL(THuiGridDimension aDim, const THuiMetric& aWeight, TInt aPos)
+    {
+    if(aDim <= EHuiGridRow)
+        {
+        TAxis& axis = iGridLayoutData->iAxes[aDim];
+        if(aPos < 0 || aPos >= axis.iWeights.Count())
+            {
+            User::Leave(KErrArgument);
+            }
+        else
+            {
+            User::LeaveIfError(axis.iWeights.Insert(aWeight, aPos));
+            }
+        }
+    }
+    
+EXPORT_C void CHuiGridLayout::ReplaceWeightL(THuiGridDimension aDim, const THuiMetric& aWeight, TInt aPos)
+    {
+    if(aDim <= EHuiGridRow)
+        {
+        TAxis& axis = iGridLayoutData->iAxes[aDim];
+        if(aPos < 0 || aPos >= axis.iWeights.Count())
+            {
+            User::Leave(KErrArgument);
+            }
+        else
+            {
+            axis.iWeights[aPos] = aWeight;
+            }
+        }
+    }
+    
+EXPORT_C void CHuiGridLayout::RemoveWeightL(THuiGridDimension aDim, TInt aPos)
+    {
+    if(aDim <= EHuiGridRow)
+        {
+        TAxis& axis = iGridLayoutData->iAxes[aDim];
+        if(aPos < 0 || aPos >= axis.iWeights.Count())
+            {
+            User::Leave(KErrArgument);
+            }
+        else
+            {
+            axis.iWeights.Remove(aPos);
+            }
+        }
+    }
+    
+EXPORT_C THuiMetric CHuiGridLayout::Weight(THuiGridDimension aDim, TInt aPos) const
+    {
+    THuiMetric metric(0.f, EHuiUnitWeight); 
+    if(aDim <= EHuiGridRow)
+        {
+        TAxis& axis = iGridLayoutData->iAxes[aDim];
+        if(aPos < 0 || aPos >= axis.iWeights.Count())
+            {
+            // use empty weight
+            }
+        else
+            {
+            metric = axis.iWeights[aPos];
+            }
+        }
+    return metric;
+    }
+    
+EXPORT_C TInt CHuiGridLayout::DimensionCount(THuiGridDimension aDim) const
+    {
+    TInt count = 0;
+    if(aDim <= EHuiGridRow)
+        {
+        count = iGridLayoutData->iAxes[aDim].iWeights.Count();
+        }
+    return count;
+    }
+
+EXPORT_C void CHuiGridLayout::SetExpanding(TInt aFlags)
+    {
+    iGridLayoutData->iExpansionFlags = aFlags;    
+    }
+    
+// ---------------------------------------------------------------------------
+// Function that determines if the filling order.
+// ---------------------------------------------------------------------------
+//
+TBool CHuiGridLayout::UseRightToLeftFillingOrder() const
+    {
+    return CHuiStatic::LayoutMirrored();
+    }
+
+EXPORT_C void CHuiGridLayout::GetClassName(TDes& aName) const
+    {
+    aName = _L("CHuiGridLayout");
+    }
+
+EXPORT_C THuiXYMetric CHuiGridLayout::BaseUnit() const
+    {
+    return CHuiLayout::BaseUnit();
+    }
+
+EXPORT_C CHuiVisual* CHuiGridLayout::FindTag(const TDesC8& aTag)
+    {
+    return CHuiLayout::FindTag(aTag);
+    }
+    
+EXPORT_C TInt CHuiGridLayout::Count() const
+    {
+    return CHuiLayout::Count();
+    }
+    
+EXPORT_C CHuiVisual& CHuiGridLayout::Visual(TInt aIndex) const
+    {
+    return CHuiLayout::Visual(aIndex);
+    }
+    
+EXPORT_C void CHuiGridLayout::SetPos(const THuiRealPoint& aPos, TInt aTransitionTime)
+    {
+    CHuiLayout::SetPos(aPos, aTransitionTime);
+    }
+    
+EXPORT_C void CHuiGridLayout::UpdateChildrenLayout(TInt aTransitionTime)
+    {
+    CHuiLayout::UpdateChildrenLayout(aTransitionTime);
+    }
+    
+EXPORT_C TBool CHuiGridLayout::PrepareDrawL()
+    {
+    return CHuiLayout::PrepareDrawL();
+    }
+    
+EXPORT_C void CHuiGridLayout::Draw(CHuiGc& aGc) const
+    {
+    CHuiLayout::Draw(aGc);
+    }
+    
+EXPORT_C void CHuiGridLayout::DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect) const
+    {
+    CHuiLayout::DrawSelf(aGc, aDisplayRect);
+    }
+    
+EXPORT_C TBool CHuiGridLayout::Changed() const
+    {
+    return CHuiLayout::Changed();
+    }
+    
+EXPORT_C void CHuiGridLayout::ReportChanged()
+    {
+    CHuiLayout::ReportChanged();
+    }
+    
+EXPORT_C void CHuiGridLayout::ClearChanged()
+    {
+    CHuiLayout::ClearChanged();
+    }
+    
+EXPORT_C void CHuiGridLayout::NotifySkinChangedL()
+    {
+    CHuiLayout::NotifySkinChangedL();
+    }
+    
+EXPORT_C void CHuiGridLayout::ExpandRectWithContent(TRect& aRect) const
+    {
+    CHuiLayout::ExpandRectWithContent(aRect); 
+    }
+    
+EXPORT_C void CHuiGridLayout::VisualExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CHuiLayout::VisualExtension(aExtensionUid, aExtensionParams);
+    }
+    
+EXPORT_C void CHuiGridLayout::DumpTree() const
+    {
+    CHuiLayout::DumpTree();
+    }
+    
+EXPORT_C void CHuiGridLayout::GetInstanceName(TDes& aName) const
+    {
+    CHuiLayout::GetInstanceName(aName);
+    }
+
+EXPORT_C void CHuiGridLayout::RemoveAndDestroyAllD()
+    {
+    CHuiLayout::RemoveAndDestroyAllD();
+    }
+
+HUI_SESSION_OBJECT_IMPL_EXPORT(CHuiGridLayout, ETypeVisual)
+
+
+EXPORT_C TInt CHuiGridLayout::RowCount() const
+    {
+    return iGridLayoutData->iAxes[EHuiGridRow].iWeights.Count();
+    }
+
+EXPORT_C TInt CHuiGridLayout::ColumnCount() const
+    {
+    return iGridLayoutData->iAxes[EHuiGridColumn].iWeights.Count();
+    }
+
+   
+EXPORT_C void CHuiGridLayout::SetLayoutModeFlags(THuiGridDimension aDim, TUint aGridLayoutModeFlags)
+    {
+    if(aDim <= EHuiGridRow)
+        {
+        TAxis& axis = iGridLayoutData->iAxes[aDim];
+        TUint oldFlags = axis.iLayoutFlags;
+        
+
+        // The following flags are mutually exclusive, clear existing flags first
+        if (aGridLayoutModeFlags&EHuiGridIncreaseInnerPadding)
+            {
+            axis.iLayoutFlags &= ~EHuiGridDecreaseInnerPadding;
+            }
+        
+        if (aGridLayoutModeFlags&EHuiGridDecreaseInnerPadding)
+            {
+            axis.iLayoutFlags &= ~EHuiGridIncreaseInnerPadding;
+            }        
+
+        if (aGridLayoutModeFlags&EHuiGridIncreaseOuterPadding)
+            {
+            axis.iLayoutFlags &= ~EHuiGridDecreaseOuterPadding;
+            }
+        
+        if (aGridLayoutModeFlags&EHuiGridDecreaseOuterPadding)
+            {
+            axis.iLayoutFlags &= ~EHuiGridIncreaseOuterPadding;
+            }   
+        
+        axis.iLayoutFlags |= aGridLayoutModeFlags;
+        
+        if((oldFlags != axis.iLayoutFlags) && !(Flags() & EHuiVisualFlagFreezeLayout))
+            {
+            UpdateChildrenLayout(0);
+            }          
+        }             
+    }
+  
+EXPORT_C void CHuiGridLayout::ClearLayoutModeFlags(THuiGridDimension aDim, TUint aGridLayoutModeFlags)
+    {
+    if(aDim <= EHuiGridRow)
+        {
+        TAxis& axis = iGridLayoutData->iAxes[aDim];
+        TUint oldFlags = axis.iLayoutFlags;      
+        axis.iLayoutFlags &= ~aGridLayoutModeFlags;
+        
+        if((oldFlags != axis.iLayoutFlags) && !(Flags() & EHuiVisualFlagFreezeLayout))
+            {
+            UpdateChildrenLayout(0);
+            }                         
+        }          
+    }
+
+EXPORT_C TUint CHuiGridLayout::LayoutModeFlags(THuiGridDimension aDim)
+    {
+    if(aDim <= EHuiGridRow)
+        {
+        TAxis& axis = iGridLayoutData->iAxes[aDim];
+        return axis.iLayoutFlags;
+        }
+        
+    return 0;
+    }
+
+void CHuiGridLayout::CalculateCellInPixels(
+    THuiGridDimension aDim, 
+    TInt aIndex, 
+    TReal32 aAvailablePixels, 
+    TInt& aPos, 
+    TInt& aSize) const
+    {
+    ASSERT(aDim < EHuiGridSize);
+    
+    TAxis& axis = iGridLayoutData->iAxes[aDim]; 
+    TInt numItems = (aDim==EHuiGridColumn)?ColumnCount():RowCount();    
+    TInt itemIntegerWidths = 0;
+    TInt itemCeilingedIntegerWidths = 0;
+    TReal32 realPos;
+    TReal32 realSize;
+    TInt sumIntegerWidths;            
+    TInt sumCeilingIntegerWidths;
+    TReal32 layoutWidthPx;
+    TReal32 layoutSizePx;    
+            
+    CalculateCellInPixelsReal(aDim, aIndex, aAvailablePixels, realPos, realSize, itemIntegerWidths, itemCeilingedIntegerWidths);
+    
+    TReal32 innerPadPos = realPos;
+    
+    // Decide what to do with pixel error based on flags
+    if (axis.iLayoutFlags&EHuiGridDecreaseInnerPadding)
+        {
+        // Allow every item to grow out into the padding, this will make the padding appear smaller.
+        realSize = CEIL(realSize);             
+        }
+    else if (axis.iLayoutFlags&EHuiGridIncreaseInnerPadding)
+        {
+        // Allow every item to be floored, this will make the padding appear bigger.
+        realSize = FLOOR(realSize);             
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    if (axis.iLayoutFlags&EHuiGridIncreaseOuterPadding)            
+        {
+        // Ignore accumulated error, simply increase outer padding by the total error for the entire layout.
+        
+        // Ignore the rounded positions we have calculated, we get the pos by summing the integer widths,
+        realPos = itemIntegerWidths-FLOOR_INT(realSize);
+        
+        CalculateCellInPixelsReal(aDim, numItems-1, aAvailablePixels, layoutWidthPx, layoutSizePx, sumIntegerWidths, sumCeilingIntegerWidths);            
+        realPos += (aAvailablePixels-sumIntegerWidths)/2;
+        realSize = FLOOR(realSize);
+        }
+    else if (axis.iLayoutFlags&EHuiGridDecreaseOuterPadding)
+        {
+        // Ignore accumulated error, simply decrease outer padding by the total error for the entire layout.
+        
+        // Ignore the rounded positions we have calculated, we get the pos by summing the integer widths,
+        realPos = itemCeilingedIntegerWidths-CEIL_INT(realSize);
+        
+        CalculateCellInPixelsReal(aDim, numItems-1, aAvailablePixels, layoutWidthPx, layoutSizePx, sumIntegerWidths, sumCeilingIntegerWidths);
+        realPos += (aAvailablePixels-sumCeilingIntegerWidths)/2;   
+        realSize = CEIL(realSize);
+        }
+    else
+        {
+        // For PC-lint
+        }
+
+    realPos = ProportionalInnerOuterPadding(aDim, innerPadPos, realPos);
+    
+    aPos = TInt(realPos);
+    aSize = TInt(realSize);
+    }
+
+TReal32 CHuiGridLayout::ProportionalInnerOuterPadding(  
+    THuiGridDimension aDim,
+    TReal32 aInnerPadPos,
+    TReal32 aOuterPadPos) const
+    {
+    THuiRealPoint innerPaddingPx = MetricToPixels(InnerPadding(), EHuiReferenceStateTarget);
+    THuiRealRect outerPaddingPx = PaddingInPixels(EHuiReferenceStateTarget);
+    TAxis& axis = iGridLayoutData->iAxes[aDim]; 
+    TUint flag = axis.iLayoutFlags;    
+    TReal32 totalPadding;
+    TReal32 meanOuterPadding;
+    
+    if ( HuiUtil::RealCompare( aInnerPadPos, aOuterPadPos ) )
+        {
+        // Same pos, nothing to do.
+        return aOuterPadPos;
+        }
+    
+    if (aDim==EHuiGridColumn)
+        {
+        meanOuterPadding = (outerPaddingPx.iTl.iX+outerPaddingPx.iBr.iX)/2.0f;
+        totalPadding = innerPaddingPx.iX+meanOuterPadding;
+        }
+    else
+        {
+        meanOuterPadding = (outerPaddingPx.iTl.iY+outerPaddingPx.iBr.iY)/2.0f;
+        totalPadding = innerPaddingPx.iY+meanOuterPadding;            
+        }
+    
+    if (totalPadding && ((flag&EHuiGridIncreaseInnerPadding) && (flag&EHuiGridIncreaseOuterPadding))
+                     || ((flag&EHuiGridIncreaseInnerPadding) && (flag&EHuiGridDecreaseOuterPadding))
+                     || ((flag&EHuiGridDecreaseInnerPadding) && (flag&EHuiGridIncreaseOuterPadding))
+                     || ((flag&EHuiGridDecreaseInnerPadding) && (flag&EHuiGridDecreaseOuterPadding)))
+        {
+        // Both inner and outer padding flags are active, linearly interpolate between them based on ratio.    
+        if (aDim==EHuiGridColumn)
+            {
+            return ((innerPaddingPx.iX*aInnerPadPos + meanOuterPadding*aOuterPadPos)/totalPadding);            
+            }
+        else
+            {
+            return ((innerPaddingPx.iY*aInnerPadPos + meanOuterPadding*aOuterPadPos)/totalPadding);            
+            }
+        }
+        
+    return aOuterPadPos;
+    }  
+    
+    
+void CHuiGridLayout::CalculateCellInPixelsReal(
+    THuiGridDimension aDim, 
+    TInt aIndex, 
+    TReal32 aAvailablePixels, 
+    TReal32& aPos, 
+    TReal32& aSize,
+    TInt& aFloorPixelPos,
+    TInt& aCeilingPixelPos) const
+    {
+    // note that we will add in the inner padding later
+    // total up the pixels or weights on either side of the target block, so that we know what
+    // the total size is that we're sharing out by weight. 
+    // while we're at it we can remember the size of the target block as well (call it "mid")
+    TReal32 totalWeightsValid(0.f);
+    TReal32 totalPixelsValid(0.f);  
+    TReal32 error(0.f);     
+    TInt pixelWeight;
+    TReal32 weightWeight;    
+    
+    TAxis& axis = iGridLayoutData->iAxes[aDim];
+    TInt weightCount = axis.iWeights.Count();
+    
+    aPos = 0;
+    aSize = 0;
+    aFloorPixelPos = 0;
+    aCeilingPixelPos = 0;
+    
+    // First pass to get total weights and pixels.
+    for(TInt ii = 0; ii < weightCount; ii++)
+        {    
+        THuiMetric& weight = axis.iWeights[ii];
+                    
+        WeightFromMetric(aDim, weight, weightWeight, pixelWeight);
+        totalPixelsValid += pixelWeight;
+        totalWeightsValid += weightWeight;
+        }
+
+    // All the fixed-pixel items have been accounted for, this is
+    // what's left for distribution between the variable, weighted items.    
+    TReal32 remainderPixels = aAvailablePixels - totalPixelsValid;
+
+    // Second pass to calculate size and pos
+    for(TInt ii = 0; ii <= aIndex; ii++)
+        {
+        TReal32 nextWeight(0.f);
+        TReal32 nextPixels(0.f);
+
+        // Child visuals that are outside of the specified range of blocks 
+        // should take the weight of the last specified block.
+        THuiMetric weight(1.f, EHuiUnitWeight);
+        if(ii < weightCount)
+            {
+            weight = axis.iWeights[ii];
+            }
+        else if( weightCount ) // return weight of last element
+            {
+            weight = axis.iWeights[weightCount-1];
+            }
+        else
+            {
+            // For PC-lint
+            }
+
+        WeightFromMetric(aDim, weight, nextWeight, pixelWeight);
+        nextPixels += pixelWeight;
+
+        TReal32 width;
+        if(totalWeightsValid != 0)
+            {
+            width = (nextWeight / totalWeightsValid) * remainderPixels;
+            }
+        else
+            {
+            width = 0;
+            }
+        
+        aFloorPixelPos += FLOOR_INT(width);
+        aCeilingPixelPos += CEIL_INT(width);     
+        aFloorPixelPos += nextPixels;
+        aCeilingPixelPos += nextPixels;             
+        
+        error += FRAC(width);
+
+        if ((axis.iLayoutFlags == 0))
+            {
+            if (error >= 0.5)
+                {
+                // There is a rounding error here, so increase size if no flags forcing exact-size are set
+                error--;
+                width = CEIL(width);
+                }
+            else
+                {
+                width = FLOOR(width);
+                }
+            }
+            
+        if(ii < aIndex)
+            {
+            aPos += width;            
+            aPos += nextPixels;
+            }
+        else
+            {
+            aSize += width;
+            aSize += nextPixels;
+            }                    
+        }
+    }
+
+void CHuiGridLayout::WeightFromMetric(THuiGridDimension aDim, THuiMetric& aMetric, TReal32& aWeight, TInt& aPix) const
+    {
+    aWeight = 0.0f;
+    aPix = 0;
+    
+    switch(aMetric.iUnit)
+        {
+        case EHuiUnitWeight:
+            {
+            aWeight = aMetric.iMagnitude;
+            break;
+            }
+        case EHuiUnitPixel:
+            {
+            // slight optimization here as we know it's pixels
+            aPix = HUI_ROUND_FLOAT_TO_INT(aMetric.iMagnitude);
+            break;
+            }
+        case EHuiUnitNormalized:
+        case EHuiUnitRelativeToDisplay:
+        case EHuiUnitRelativeToMySize:
+        case EHuiUnitS60:
+            {
+            THuiRealPoint refPx = MetricToPixels(THuiXYMetric(aMetric), EHuiReferenceStateTarget);
+            aPix = (aDim == EHuiGridColumn) ? HUI_ROUND_FLOAT_TO_INT(refPx.iX) : HUI_ROUND_FLOAT_TO_INT(refPx.iY);
+            break;
+            }
+        default:
+            break;
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiImage.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,476 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of THuiImage, which specifies an area on 
+*                a (segmented) texture object.
+*
+*/
+
+
+
+#include "uiacceltk/HuiImage.h"  // Class definition
+#include "uiacceltk/HuiTexture.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiPanic.h"
+
+enum THuiImageInternalFlags
+    {
+    EHuiImageFlagDefaultTextureType = 0x1        
+    };
+
+
+EXPORT_C THuiImage::THuiImage()
+        : iTexture(0), iTl( 0.f, 0.f ), iBr( 0.f, 0.f )
+    {
+    }
+
+
+EXPORT_C THuiImage::THuiImage(const MHuiTexture& aTexture,
+                              TReal32 aTlX, TReal32 aTlY,
+                              TReal32 aBrX, TReal32 aBrY) __SOFTFP
+        : iTexture( &aTexture ),
+          iTl( aTlX, aTlY ), 
+          iBr( aBrX, aBrY ),
+          iFlags(0)
+    {
+    }
+
+EXPORT_C THuiImage::THuiImage(const CHuiTexture& aTexture,
+                     TReal32 aTlX, TReal32 aTlY,
+                     TReal32 aBrX, TReal32 aBrY) __SOFTFP
+        : iTexture( &aTexture ),
+          iTl( aTlX, aTlY ), 
+          iBr( aBrX, aBrY ),
+          iFlags(EHuiImageFlagDefaultTextureType)
+    {
+    }
+
+
+EXPORT_C TInt THuiImage::SegmentCount() const
+    {
+    if(HasTexture())
+        {
+        return iTexture->SegmentedTexture()->SegmentCount();
+        }
+    else
+        {
+        return 0;
+        }
+    }
+
+
+EXPORT_C void THuiImage::GetVertexCoords(TInt16* aOutCoords, TInt aSegment) const
+    {
+    if(!iTexture)
+        {
+        for(TInt i = 0; i < 8; ++i)
+            {
+            aOutCoords[i] = 0;
+            }
+        return;
+        }
+    
+    const MHuiSegmentedTexture* tex = iTexture->SegmentedTexture();
+    HUI_ASSERT2(tex, THuiPanic::EImageNotSegmentedTexture);
+    
+    // Use dummy coordinates, if texture is not available
+    if(SegmentCount() == 0)
+        {
+        for(TInt i = 0; i < 8; ++i)
+            {
+            aOutCoords[i] = 0;
+            }
+        }
+    else
+        {
+        // for handling cases where segmentcount >= 1 ..
+
+        // hmm should we use floating point type here?
+        // anyway here we have TInt to TInt16 conversions..
+        TSize segmentSize = tex->SegmentSize(aSegment);
+        TPoint segmentOffset = tex->SegmentOffset(aSegment);
+        aOutCoords[0] = segmentOffset.iX;
+        aOutCoords[1] = segmentOffset.iY;
+        aOutCoords[2] = segmentOffset.iX + segmentSize.iWidth;
+        aOutCoords[3] = segmentOffset.iY;
+        aOutCoords[4] = aOutCoords[2];
+        aOutCoords[5] = segmentOffset.iY + segmentSize.iHeight;
+        aOutCoords[6] = aOutCoords[0];
+        aOutCoords[7] = aOutCoords[5];
+        }
+    }
+
+
+EXPORT_C void THuiImage::GetTexCoords(TReal32* aTexCoordsOut, TInt aSegment) const
+    {
+    if(!iTexture)
+        {
+        for(TInt i = 0; i < 8; ++i)
+            {
+            aTexCoordsOut[i] = 0;
+            }
+        return;
+        }
+    
+    const MHuiSegmentedTexture* tex = iTexture->SegmentedTexture();
+    HUI_ASSERT2(tex, THuiPanic::EImageNotSegmentedTexture);
+
+    // Use dummy coordinates, if texture is not available
+    if(!HasTexture())
+        {
+        for(TInt i = 0; i < 8; ++i)
+            {
+            aTexCoordsOut[i] = 0;
+            }
+        return;
+        }
+
+    if(tex->SegmentCount() == 1)
+        {
+        // user-defined custom coordinates.
+        aTexCoordsOut[0] = iTl.iX.Now();
+        aTexCoordsOut[1] = iTl.iY.Now();
+        aTexCoordsOut[2] = iBr.iX.Now();
+        aTexCoordsOut[3] = iTl.iY.Now();
+        aTexCoordsOut[4] = iBr.iX.Now();
+        aTexCoordsOut[5] = iBr.iY.Now();
+        aTexCoordsOut[6] = iTl.iX.Now();
+        aTexCoordsOut[7] = iBr.iY.Now();
+
+        // NOTE: by default custom coordinates modulate the
+        // coordinates calculated from the textures
+
+        // calculate coordinates based on texture
+        TSize size = tex->SegmentSize(0);
+        TSize textureSize = tex->SegmentTextureSize(0);
+
+        if (textureSize.iWidth)
+            {
+            // if we have partially filled texture ...
+            if (textureSize.iWidth > size.iWidth)
+            	{
+            	// There has been some visible "ghost lines" and therefore substraction of 0.2 pixels
+                aTexCoordsOut[0] = aTexCoordsOut[0] * (size.iWidth - 0.2f) / textureSize.iWidth;
+                aTexCoordsOut[2] = aTexCoordsOut[2] * (size.iWidth - 0.2f) / textureSize.iWidth;
+                aTexCoordsOut[6] = aTexCoordsOut[0] ;
+                aTexCoordsOut[4] = aTexCoordsOut[2] ;
+
+                }
+            else
+                {
+                // 100% of the texture used,
+                // just use custom coordinates directly
+                }
+            }
+        if(textureSize.iHeight)
+            {
+            // if we have partially filled texture ...
+            if (textureSize.iHeight > size.iHeight)
+                {
+                // There has been some visible "ghost lines" and therefore substraction of 0.2 pixels
+                aTexCoordsOut[3] = aTexCoordsOut[3] * (size.iHeight - 0.2f) / textureSize.iHeight;
+                aTexCoordsOut[1] = aTexCoordsOut[3];
+                aTexCoordsOut[5] = aTexCoordsOut[5] * (size.iHeight - 0.2f) / textureSize.iHeight;
+                aTexCoordsOut[7] = aTexCoordsOut[5];
+                }
+            else
+                {
+                // 100% of the texture used,
+                // just use custom coordinates directly
+                }
+            }
+        }
+    else
+        {
+        // calculate coordinates for multiple segments..
+        TReal32 leftu; // top u coordinate
+        TReal32 rightu; // bottom u coordinate
+        TReal32 topv; // top v coordinate
+        TReal32 bottomv; // bottom v coordinate
+
+        THuiRealSize  size = tex->Size();
+        THuiRealSize  segmentSize = tex->SegmentSize(aSegment);
+        THuiRealPoint segmentOffset = tex->SegmentOffset(aSegment);
+        // lets do some consistency checks..
+
+        ASSERT(segmentOffset.iX >= 0 && segmentOffset.iX < size.iWidth);
+        ASSERT(segmentOffset.iY >= 0 && segmentOffset.iY < size.iHeight);
+        ASSERT(segmentSize.iWidth > 0 && segmentSize.iWidth <= size.iWidth);
+        ASSERT(segmentSize.iHeight > 0 && segmentSize.iHeight <= size.iHeight);
+        // transform offset and size to texture space
+        segmentOffset.iX /= size.iWidth;
+        segmentOffset.iY /= size.iHeight;
+        segmentSize.iWidth /= size.iWidth;
+        segmentSize.iHeight /= size.iHeight;
+
+        // calculate coordinates
+        // left side..
+        TReal32 edge = iTl.iX.Now();
+        TReal32 offset = segmentOffset.iX;
+        TReal32 width = segmentSize.iWidth;
+        TReal32 coord;
+        if (edge <= offset)
+            {
+            // visible texture edge is at the left/top region (outside),
+            // so this texture segment is fully visible
+            coord = 0.0;
+            }
+        else if (edge - offset < width)
+            {
+            // the edge of the visible texture is somewhere
+            // inside this block, so texture coordinate has
+            // to be set inside
+            coord = (edge - offset)/width;
+            ASSERT(coord>0.0 && coord<1.0);
+            }
+        else
+            {
+            // the edge is outside, at the right/bottom side of this segment.
+            coord = 1.0;
+            }
+        leftu = coord;
+
+        // right side..
+        edge = iBr.iX.Now();
+        if (edge <= offset)
+            {
+            coord = 0.0;
+            }
+        else if (edge - offset < width)
+            {
+            coord = (edge - offset)/width;
+            ASSERT(coord>0.0 && coord<1.0);
+            }
+        else
+            {
+            coord = 1.0;
+            }
+        rightu = coord;
+
+        // top side
+        edge = iTl.iY.Now();
+        offset = segmentOffset.iY;
+        width = segmentSize.iHeight;
+        if (edge <= offset)
+            {
+            coord = 0.0;
+            }
+        else if (edge - offset < width)
+            {
+            coord = (edge - offset)/width;
+            ASSERT(coord>0.0 && coord<1.0);
+            }
+        else
+            {
+            coord = 1.0;
+            }
+        topv = coord;
+
+        // bottom side
+        edge = iBr.iY.Now();
+        if (edge <= offset)
+            {
+            coord = 0.0;
+            }
+        else if (edge - offset < width)
+            {
+            coord = (edge - offset)/width;
+            ASSERT(coord>0.0 && coord<1.0);
+            }
+        else
+            {
+            coord = 1.0;
+            }
+        bottomv = coord;
+
+        // modulate coordinates (if texture utilization != 100%)
+        segmentSize = tex->SegmentSize(aSegment);
+        TSize  segmentTexSize = tex->SegmentTextureSize(aSegment);
+        TReal32 uscale = (segmentTexSize.iWidth > 0 ?
+                        (TReal32(segmentSize.iWidth) / TReal32(segmentTexSize.iWidth))
+                        : 1);
+        TReal32 vscale = (segmentTexSize.iHeight > 0 ?
+                        (TReal32(segmentSize.iHeight) / TReal32(segmentTexSize.iHeight))
+                        : 1);
+
+        leftu *= uscale;
+        rightu *= uscale;
+        topv *= vscale;
+        bottomv *= vscale;
+
+        // set output coordinates (width)
+        aTexCoordsOut[0] = leftu;    // top-left u
+        aTexCoordsOut[2] = rightu;   // top-right u
+        aTexCoordsOut[4] = aTexCoordsOut[2]; // bottom-right u
+        aTexCoordsOut[6] = aTexCoordsOut[0]; // bottom-left u
+        // set output coordinates (height)
+        aTexCoordsOut[1] = topv; // top-left v
+        aTexCoordsOut[3] = aTexCoordsOut[1]; // top-right v
+        aTexCoordsOut[5] = bottomv; // bottom-left v
+        aTexCoordsOut[7] = aTexCoordsOut[5]; // bottom-right v
+
+        }
+    }
+
+
+EXPORT_C void THuiImage::SetTexCoords(TReal32 aTlX, TReal32 aTlY,
+                                      TReal32 aBrX, TReal32 aBrY,
+                                      TInt aTransitionTime) __SOFTFP
+    {
+    iTl.Set(THuiRealPoint(aTlX, aTlY), aTransitionTime);
+    iBr.Set(THuiRealPoint(aBrX, aBrY), aTransitionTime);
+    }
+
+
+EXPORT_C THuiRealPoint THuiImage::TopLeft() const __SOFTFP
+    {
+    return iTl.RealNow();
+    }
+
+
+EXPORT_C THuiRealPoint THuiImage::BottomRight() const __SOFTFP
+    {
+    return iBr.RealNow();
+    }
+
+
+EXPORT_C void THuiImage::SetTexture(const MHuiTexture& aTexture)
+    {
+    HUI_ASSERT2(aTexture.SegmentedTexture(), THuiPanic::EImageNotSegmentedTexture)
+        
+    iTexture = &aTexture;
+    
+    // Clear default type flag as we cannot know it for sure
+    iFlags &= ~EHuiImageFlagDefaultTextureType;
+    }
+
+EXPORT_C void THuiImage::SetTexture(const CHuiTexture& aTexture)
+    {
+    iTexture = &aTexture;
+
+    // Set default type flag 
+    iFlags |= EHuiImageFlagDefaultTextureType;
+    }
+
+
+EXPORT_C TBool THuiImage::HasTexture() const
+    {
+    return (iTexture && iTexture->SegmentedTexture() && iTexture->HasContent());
+    }
+
+
+EXPORT_C const MHuiTexture& THuiImage::TextureIf() const
+    {
+    HUI_ASSERT2(iTexture != 0, THuiPanic::EImageNoTexture)
+
+    return *iTexture;
+    }
+
+
+EXPORT_C const MHuiSegmentedTexture& THuiImage::Texture() const
+    {
+    HUI_ASSERT2(iTexture != 0, THuiPanic::EImageNoTexture)
+    HUI_ASSERT2(iTexture->SegmentedTexture() != 0, THuiPanic::EImageNotSegmentedTexture)
+
+    return *iTexture->SegmentedTexture();
+    }
+  
+  
+EXPORT_C TBool THuiImage::HasShadow() const
+    {
+    if(!iTexture || !iTexture->ShadowedTexture())
+        {
+        return EFalse;
+        }
+    return iTexture->ShadowedTexture()->IsShadowEnabled();
+    }
+  
+    
+EXPORT_C THuiTextureHandle THuiImage::ShadowTexture() const
+    {
+    THuiTextureHandle handle;
+    
+    if(iTexture && iTexture->ShadowedTexture())
+        {
+        iTexture->ShadowedTexture()->GetShadowTexture(handle);
+        }
+        
+    return handle;
+    }    
+
+
+EXPORT_C void THuiImage::Translate(TReal32 aDx, TReal32 aDy, TInt aTransitionTime) __SOFTFP
+    {
+    iTl.iX.Set(iTl.iX.Target() + aDx, aTransitionTime);
+    iTl.iY.Set(iTl.iY.Target() + aDy, aTransitionTime);
+    iBr.iX.Set(iBr.iX.Target() + aDx, aTransitionTime);
+    iBr.iY.Set(iBr.iY.Target() + aDy, aTransitionTime);
+    }
+
+
+EXPORT_C void THuiImage::Scale(TReal32 aScaleX, TReal32 aScaleY, TInt aTransitionTime) __SOFTFP
+    {
+    iTl.iX.Set(iTl.iX.Target() * aScaleX, aTransitionTime);
+    iTl.iY.Set(iTl.iY.Target() * aScaleY, aTransitionTime);
+    iBr.iX.Set(iBr.iX.Target() * aScaleX, aTransitionTime);
+    iBr.iY.Set(iBr.iY.Target() * aScaleY, aTransitionTime);
+    }
+
+
+TBool THuiImage::Changed() const
+	{
+	if(iTexture && iTexture->TextureChanged())
+		{
+		return ETrue;
+		}
+		
+	return (iTl.Changed() || iBr.Changed());	
+	}
+
+
+void THuiImage::ClearChanged()
+	{
+	if(iTexture)
+		{
+		iTexture->TextureClearChanged();
+		}	
+		
+    iTl.ClearChanged();
+    iBr.ClearChanged();		
+	}	    
+
+const MHuiTexture* THuiImage::ImageTexture() const
+    {
+    return iTexture;    
+    }
+
+const CHuiTexture* THuiImage::ImageDefaultTexture() const
+    {
+    if (iTexture)
+        {            
+        // Dynamic cast is slow and this method is called
+        // often, hence the optmization.        
+        if (iFlags & EHuiImageFlagDefaultTextureType)
+            {
+            return static_cast<const CHuiTexture*> (iTexture);    
+            }
+        else
+            {
+            return dynamic_cast<const CHuiTexture*> (iTexture);                    
+            }    
+        }
+    else
+        {
+        return NULL;    
+        }    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiImageBrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,334 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 a brush that is able to draw images.
+*
+*/
+
+
+
+#include "uiacceltk/HuiImageBrush.h"  // Class definition
+#include "uiacceltk/HuiDrawing.h"
+#include "uiacceltk/HuiVisual.h"
+#include "uiacceltk/HuiUtil.h"
+
+
+EXPORT_C CHuiImageBrush*
+CHuiImageBrush::NewL(const THuiImage & aImage)
+    {
+    CHuiImageBrush* self = NewLC(aImage);
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+EXPORT_C CHuiImageBrush* CHuiImageBrush::NewLC(const THuiImage & aImage)
+    {
+    CHuiImageBrush* self = new (ELeave) CHuiImageBrush(aImage);
+    CleanupStack::PushL(self);
+    return self;
+    }
+
+
+CHuiImageBrush::CHuiImageBrush(const THuiImage & aImage)
+        : iImage(aImage),
+          iScaleMode(CHuiImageVisual::EScaleFit),
+          iLeftBorderWidth(0),
+          iRightBorderWidth(0),
+		  iTopBorderWidth(0),
+    	  iBottomBorderWidth(0)
+    	  
+    {
+    SetClipToVisual(EFalse);
+    iScale.Set(1.f);
+    iImageOffset.iX.Set(0.f);
+    iImageOffset.iY.Set(0.f);
+    }
+
+EXPORT_C CHuiImageBrush::~CHuiImageBrush()
+    {
+    }
+    
+EXPORT_C void CHuiImageBrush::SetScaleMode(
+    CHuiImageVisual::TScaleMode aScaleMode)
+    {
+    iScaleMode = aScaleMode;
+    SetChanged();
+    }
+
+EXPORT_C void CHuiImageBrush::SetImage(const THuiImage& aImage)
+    {
+    iImage = aImage;
+    SetChanged();
+    }
+
+EXPORT_C const THuiImage& CHuiImageBrush::Image() const
+    {
+    return iImage;    
+    }
+
+
+EXPORT_C void CHuiImageBrush::SetBorders(TInt aLeftBorderPixels,
+                         TInt aRightBorderPixels,
+                         TInt aTopBorderPixels,
+                         TInt aBottomBorderPixels)
+	{
+    iLeftBorderWidth = aLeftBorderPixels;
+    iRightBorderWidth = aRightBorderPixels;
+    iTopBorderWidth = aTopBorderPixels;
+    iBottomBorderWidth = aBottomBorderPixels;
+    SetChanged();
+	}                         
+
+EXPORT_C TBool CHuiImageBrush::BorderDrawingEnabled() const
+	{
+	return ((iLeftBorderWidth!=0) || (iRightBorderWidth!=0)		
+		    || (iTopBorderWidth!=0) || (iBottomBorderWidth!=0));
+	}
+
+EXPORT_C TBool CHuiImageBrush::CenterDrawingEnabled() const
+	{
+	if(!iImage.HasTexture()) 
+		{
+		return EFalse;
+		}				
+	// determine if there are center pixels available inside borders
+	// if not, we can't draw the center..
+	TSize imageSize = iImage.Texture().Size();	
+	if(((imageSize.iWidth - iLeftBorderWidth) - iRightBorderWidth <= 0)
+	   || ((imageSize.iHeight - iTopBorderWidth) - iBottomBorderWidth <= 0))
+		{
+		return EFalse;
+		}	  
+		
+	return ETrue;
+	}
+
+EXPORT_C void CHuiImageBrush::ExpandVisualRect(TRect& aRect) const
+    {
+    if ( CenterDrawingEnabled() )
+        {
+        THuiRealRect contentArea(aRect);
+         
+        // Get the scaled size
+        THuiRealSize imageSize( iImage.Texture().Size() );
+        if ( iScaleMode == CHuiImageVisual::EScaleFit )
+            {
+            imageSize = contentArea.Size() * iScale.Now();
+            }
+        else
+            {
+            TReal32 scale = HuiUtil::CalculateScaleFactorFromScaleMode(
+                contentArea.Size(),
+                iImage.Texture().Size(),
+                iScaleMode,
+                iScale.Now() );
+            imageSize = imageSize * scale;
+            }
+
+        THuiRealPoint mid = contentArea.Center();
+        
+        // Move mid point based on the offset
+        TReal32 xOffset = 0;
+        TReal32 yOffset = 0;
+
+        xOffset = contentArea.Width() * iImageOffset.iX.Now();
+        yOffset = contentArea.Height() * iImageOffset.iY.Now();
+        
+        mid += THuiRealPoint( xOffset, yOffset );
+        
+        // expand the dirty area rect if needed
+        aRect.iTl.iX = Min( aRect.iTl.iX, mid.iX-imageSize.iWidth/2.f );
+        aRect.iTl.iY = Min( aRect.iTl.iY, mid.iY-imageSize.iHeight/2.f );
+        aRect.iBr.iX = Max( aRect.iBr.iX, mid.iX+imageSize.iWidth/2.f );
+        aRect.iBr.iY = Max( aRect.iBr.iY, mid.iY+imageSize.iHeight/2.f );
+        }
+    
+	if(BorderDrawingEnabled())
+		{
+        // expand the area of the content to include the border:
+        aRect.Grow((Max(iLeftBorderWidth, 0) + Max(iRightBorderWidth, 0)) / 2, 
+                   (Max(iTopBorderWidth, 0) + Max(iBottomBorderWidth, 0)) / 2);
+        // move the area to justify the border width differencies
+        aRect.Move((Max(iRightBorderWidth, 0)-Max(iLeftBorderWidth, 0)) / 2,
+                   (Max(iTopBorderWidth, 0)-Max(iBottomBorderWidth, 0)) / 2);
+		}	
+    }
+    
+TBool CHuiImageBrush::Changed() const
+    {
+    if ( CHuiBrush::Changed() )
+        {
+        return ETrue;
+        }
+    return iImageOffset.Changed() || iScale.Changed() || iImage.Changed();
+    }
+
+void CHuiImageBrush::ClearChanged()
+    {
+    CHuiBrush::ClearChanged();
+    iImageOffset.ClearChanged();
+    iScale.ClearChanged();
+    iImage.ClearChanged();
+    }
+
+EXPORT_C void CHuiImageBrush::Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const
+    {
+    
+	TBool borderDrawing = BorderDrawingEnabled();
+	TBool centerDrawing = CenterDrawingEnabled();
+    
+    TReal32 opacity = aGuide.BrushOpacity() * iOpacity.Now();    
+    aGc.SetPenColor(KRgbWhite);
+    aGc.SetPenAlpha(TInt(opacity * 255.f));
+    
+    if(centerDrawing) 
+	    {
+        THuiRealRect contentArea = aGuide.BrushRect();
+    
+        aGc.Enable(CHuiGc::EFeatureBlending);
+    
+	    if(borderDrawing)
+		    {
+	        // contract the content area if the borders
+	        // have been defined to be inside
+		    if(iLeftBorderWidth < 0)
+			    {
+			    contentArea.iTl.iX -= iLeftBorderWidth;
+			    }
+		    if(iRightBorderWidth < 0)
+			    {
+			    contentArea.iBr.iX += iRightBorderWidth;
+			    }
+		    if(iTopBorderWidth < 0)
+			    {
+			    contentArea.iTl.iY -= iTopBorderWidth;
+			    }
+		    if(iBottomBorderWidth < 0)
+			    {
+			    contentArea.iBr.iY += iBottomBorderWidth;
+			    }
+		    	
+		    // Read in the original texture coordinates (NOTE: not affected
+		    // by any renderer-specific texcoord manipulations, like the Gles POT trick).
+		    TSize imageSize(iImage.Texture().Size());
+		    THuiRealPoint tl = iImage.TopLeft(), br = iImage.BottomRight();
+            TReal32 widthU = br.iX - tl.iX;
+            TReal32 heightV = br.iY - tl.iY;
+
+			// Remove borders by adjusting texture coordinates.
+			// But don't divide by 0
+			if ( imageSize.iWidth != 0 && imageSize.iHeight != 0 )
+			    {
+    			tl.iX += ((TReal32)Abs(iLeftBorderWidth) / (TReal32)imageSize.iWidth) * widthU;
+    			br.iX -= ((TReal32)Abs(iRightBorderWidth) / (TReal32)imageSize.iWidth) * widthU;
+    			tl.iY += ((TReal32)Abs(iTopBorderWidth) / (TReal32)imageSize.iHeight) * heightV;
+    			br.iY -= ((TReal32)Abs(iBottomBorderWidth) / (TReal32)imageSize.iHeight) * heightV;
+			    }
+								    	    		    	    
+			// Create temporary Image with adjusted texcoords
+		    THuiImage imageBordersRemoved;
+		    imageBordersRemoved.SetTexture(iImage.TextureIf());
+		    imageBordersRemoved.SetTexCoords(tl.iX, tl.iY, br.iX, br.iY);
+		    
+		    // Draw the image without the borders.
+	        aGc.DrawStretchImage(CHuiGc::EStretchFull,
+	                             imageBordersRemoved,
+	                             contentArea);		    			
+		    }
+	    else
+		    {	  
+
+            TReal32 scale = HuiUtil::CalculateScaleFactorFromScaleMode(
+                contentArea.Size(),
+                iImage.Texture().Size(),
+                iScaleMode,
+                iScale.Now() );
+             
+            // Determine offset.
+            TReal32 xOffset = 0;
+            TReal32 yOffset = 0;
+
+            xOffset = aGuide.BrushRect().Width() * iImageOffset.iX.Now();
+            yOffset = aGuide.BrushRect().Height() * iImageOffset.iY.Now();
+             
+            
+            // Do scaling
+            TBool doTranslate = !HuiUtil::RealCompare( scale, 1.f ) || !HuiUtil::RealCompare(xOffset,0.f) || !HuiUtil::RealCompare(yOffset,0.f);
+            if( doTranslate )
+                {
+                /** @todo  GC must provide some support for transformations. */
+                aGc.Push(EHuiGcMatrixModel);
+
+                // Rotate around the midpoint of the visual.
+                THuiRealPoint mid = contentArea.Center();
+
+                aGc.Translate(EHuiGcMatrixModel, mid.iX + xOffset, mid.iY + yOffset, 0.f);
+                if( !HuiUtil::RealCompare( scale, 1.f ) )
+                    {
+                    aGc.Scale(EHuiGcMatrixModel, scale, scale, 1.f);
+                    }
+                aGc.Translate(EHuiGcMatrixModel, -mid.iX, -mid.iY, 0.f);
+                }
+            
+            // Use the appropriate alignment in the graphics context.
+            if(iScaleMode == CHuiImageVisual::EScaleFit)
+                {
+                aGc.SetAlign(EHuiAlignHLeft, EHuiAlignVTop);
+                }
+            else
+                {
+                aGc.SetAlign(EHuiAlignHCenter, EHuiAlignVCenter);
+                }   
+            
+            // draw the image
+            if(iScaleMode == CHuiImageVisual::EScaleFit)
+                {
+                aGc.DrawImage(iImage, contentArea.iTl, contentArea.Size());
+                }
+            else
+                {
+                aGc.DrawImage(iImage, contentArea);
+                }
+                
+            // Restore original transformation.
+            if( doTranslate )
+                {
+                aGc.Pop(EHuiGcMatrixModel);
+                }
+        		
+		    } 
+
+        }
+
+	if(borderDrawing)
+		{
+        THuiRealRect contentArea = aGuide.BrushRect();
+		
+        // expand the area of the content to include the border:
+        contentArea.Grow((Max(iLeftBorderWidth, 0) + Max(iRightBorderWidth, 0)) / 2, 
+                   (Max(iTopBorderWidth, 0) + Max(iBottomBorderWidth, 0)) / 2);
+        // move the area to justify the border width differencies
+        contentArea.Move((Max(iRightBorderWidth, 0)-Max(iLeftBorderWidth, 0)) / 2,
+                   (Max(iTopBorderWidth, 0)-Max(iBottomBorderWidth, 0)) / 2);
+                                                          
+		aGc.DrawBorders(contentArea.Round(),
+						Abs(iLeftBorderWidth),
+						Abs(iRightBorderWidth),
+						Abs(iTopBorderWidth),
+						Abs(iBottomBorderWidth),
+						CHuiGc::EBorderFixedCorners,
+						&iImage);
+		}
+
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiImageLoaderUtil.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,410 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CHuiImageLoaderUtil, a utility to load skin-able image/icon.
+*
+*/
+
+
+
+#include "uiacceltk/HuiImageLoaderUtil.h"
+#include "uiacceltk/HuiBitmapProvider.h"
+#include "uiacceltk/HuiTextureManager.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiEnv.h"
+
+struct THuiProvidedBitmap
+    {
+    TInt iId;
+    THuiRealSize iPreferredSize;        
+    };
+
+/**
+ * Base class of the image loder classes
+ */
+NONSHARABLE_CLASS(CHuiImageLoader): public CBase, public MHuiBitmapProvider, public MHuiTextureAutoSizeObserver
+	{
+public:
+	CHuiImageLoader();
+
+    ~CHuiImageLoader();
+    /**
+     * Set size of the icon. This must be called before creating texture.
+     * This call only sets information and dees *NOT* cause any scalable icon rasterization.
+     *
+     * @param aSize     Size in pixel.
+     */
+	void SetSize(const TSize& aSize) {iSize = aSize;}
+
+	void SetScaleMode(TScaleMode aScaleMode) {iScaleMode = aScaleMode;}
+
+    /**
+     * Set skin instance, which is acquired from AknsUtils::SkinInstance().
+     *
+     * @param aSkinInstance     An Avkon skin instamce.
+     */
+	void SetSkinInstance(MAknsSkinInstance *aSkinInstance) {iSkinInstance = aSkinInstance;}
+
+public:
+    // From MHuiBitmapProvider
+	virtual void ProvideBitmapL (TInt aId, CFbsBitmap *& aBitmap, CFbsBitmap *& aMaskBitmap) ;
+
+    // From MHuiTextureAutoSizeObserver
+    virtual TBool PreferredSizeChanged(const CHuiTexture& aTexture, TInt aTextureId, const THuiRealSize& aPreferredSize);
+
+    // From MHuiTextureAutoSizeObserver
+    virtual void PreferredSizeReportCompleted();
+
+protected:
+	MAknsSkinInstance* GetValidSkinInstance();
+    TSize PreferredSize(TInt aId);
+
+protected:
+	// common source info data
+	MAknsSkinInstance *iSkinInstance;
+	TSize iSize;
+	TScaleMode iScaleMode;
+	RArray<THuiProvidedBitmap> iProvidedBitmaps;
+	};
+
+
+/**
+ * Image loader utility for skin item image loading.
+ *
+ */
+NONSHARABLE_CLASS(CHuiSkinItemImageLoader): public CHuiImageLoader
+{
+public:
+    /**
+     * Construct an icon source information with Avkon skin item ID. AknsUtils::CreateIconL()
+     * will be called in RHuiImageLoaderUtil::CreateIconL().
+     *
+     * @param aInstance     Skin instance.
+     * @param aID  An ID of the graphical item (e.g. an icon).
+     * @param aFileName  File name of graphics file e.g. mif file) when sepcified item is not found in the current skin.
+     * @param aBitmapId  ID of the bitmap when fallback is used.
+     * @param aMaskId  ID of the mask bitmap when fallback is used.
+     */
+	CHuiSkinItemImageLoader(const TAknsItemID &aID, const TDesC &aFileName, TInt aBitmapId, TInt aMaskId);
+
+    /**
+     * Implementation of MHuiBitmapProvider interface.
+     *
+     * @param aId     A unique ID of the texture needed to provide bitmaps.
+     * @param aBitmap     A bitmap.
+     * @param aMaskBitmap     A mask bitmap.
+     */
+	virtual void ProvideBitmapL (TInt aId, CFbsBitmap *& aBitmap, CFbsBitmap *& aMaskBitmap) ;
+
+private:
+	TAknsItemID iId;
+	TPtrC iFileName;
+	TInt iBitmapId;
+	TInt iMaskId;
+};
+
+
+/**
+ * Image loader utility for application icon loading.
+ *
+ */
+NONSHARABLE_CLASS(CHuiAppIconImageLoader): public CHuiImageLoader
+{
+public:
+    /**
+     * Construct an icon source information to create application icon. AknsUtils::CreateAppIconLC()
+     * will be called in RHuiImageLoaderUtil::CreateIconL().
+     *
+     * @param aInstance     Skin instance.
+     * @param aAppUid  Application UID of the icon to be created.
+     * @param aType  Type of the application icon. Likely EAknsAppIconTypeContext is used...
+     */
+	CHuiAppIconImageLoader(TUid aAppUid, TAknsAppIconType aType);
+    
+    /**
+     * Implementation of MHuiBitmapProvider interface.
+     *
+     * @param aId     A unique ID of the texture needed to provide bitmaps.
+     * @param aBitmap     A bitmap.
+     * @param aMaskBitmap     A mask bitmap.
+     */
+	virtual void ProvideBitmapL (TInt aId, CFbsBitmap *& aBitmap, CFbsBitmap *& aMaskBitmap) ;
+private:
+	TUid iAppUid;
+	TAknsAppIconType iType;
+};
+
+// Image loader util
+EXPORT_C CHuiImageLoaderUtil::CHuiImageLoaderUtil()
+		:iSize(4,4), iScaleMode(EAspectRatioPreserved)
+	{
+	}
+
+
+EXPORT_C CHuiImageLoaderUtil::~CHuiImageLoaderUtil()
+	{
+	for (TInt i=0; i<iImageLoaderList.Count(); i++)
+	    {
+	    delete iImageLoaderList[i];
+	    }
+	iImageLoaderList.Close();
+	iSkinInstance = NULL;
+	}
+
+
+EXPORT_C MHuiBitmapProvider* CHuiImageLoaderUtil::CreateImageLoaderL(
+				const TAknsItemID &aID, 
+				const TDesC &aFileName, 
+				TInt aBitmapId, 
+				TInt aMaskId)
+	{
+	CHuiSkinItemImageLoader* imgLoader = new (ELeave) CHuiSkinItemImageLoader(
+			aID, aFileName, aBitmapId, aMaskId);
+    CleanupStack::PushL( imgLoader );
+	imgLoader->SetSize(iSize);
+	imgLoader->SetScaleMode(iScaleMode);
+	imgLoader->SetSkinInstance(iSkinInstance);
+	iImageLoaderList.AppendL(imgLoader);
+	CleanupStack::Pop( imgLoader );
+	return imgLoader;
+	}
+
+
+EXPORT_C MHuiBitmapProvider* CHuiImageLoaderUtil::CreateImageLoaderL(
+				TUid aAppUid, 
+				TAknsAppIconType aType)
+	{
+	CHuiAppIconImageLoader* imgLoader = new (ELeave) CHuiAppIconImageLoader(
+			aAppUid, aType);
+    CleanupStack::PushL( imgLoader );
+	imgLoader->SetSize(iSize);
+	imgLoader->SetScaleMode(iScaleMode);
+	imgLoader->SetSkinInstance(iSkinInstance);
+	iImageLoaderList.AppendL(imgLoader);
+	CleanupStack::Pop( imgLoader );
+	return imgLoader;
+	}
+
+
+EXPORT_C void CHuiImageLoaderUtil::SetSize(TSize aSize, TScaleMode aMode)
+	{
+	iSize = aSize;
+	iScaleMode = aMode;
+	}
+
+
+EXPORT_C void CHuiImageLoaderUtil::SetSkinInstance(MAknsSkinInstance *aSkinInstance)
+	{
+	iSkinInstance = aSkinInstance;
+	}
+
+
+
+// Image loaders
+MAknsSkinInstance* CHuiImageLoader::GetValidSkinInstance()
+	{
+	if (iSkinInstance == NULL && CCoeEnv::Static())
+		{
+		return AknsUtils::SkinInstance();
+		}
+	else
+		{
+		return iSkinInstance;
+		}
+	}
+
+TBool CHuiImageLoader::PreferredSizeChanged(const CHuiTexture& /*aTexture*/, TInt aTextureId, const THuiRealSize& aPreferredSize)    {
+    for(TInt ii = 0; ii < iProvidedBitmaps.Count(); ii++)
+        {
+        if (iProvidedBitmaps[ii].iId == aTextureId)
+            {
+            iProvidedBitmaps[ii].iPreferredSize = aPreferredSize;     
+            return ETrue;
+            }
+        }
+    return EFalse;            
+    }
+
+void CHuiImageLoader::PreferredSizeReportCompleted()
+    {
+    // Nothing to do    
+    }
+
+void CHuiImageLoader::ProvideBitmapL (TInt aId, CFbsBitmap *& /*aBitmap*/, CFbsBitmap *& /*aMaskBitmap*/)
+    {
+    for(TInt i = 0; i < iProvidedBitmaps.Count(); i++)
+        {
+        if (iProvidedBitmaps[i].iId == aId)
+            {            
+            // Already in list, do nothing
+            return;   
+            }
+        }
+    
+    // If provided bitmap is not yet in the list, add it.    
+    THuiProvidedBitmap providedBitmap;
+    providedBitmap.iId = aId;
+    providedBitmap.iPreferredSize = iSize;        
+    iProvidedBitmaps.AppendL(providedBitmap);            
+    }
+
+CHuiImageLoader::CHuiImageLoader():iSize(4,4), iScaleMode(EAspectRatioPreserved)
+    {
+    }
+
+CHuiImageLoader::~CHuiImageLoader()
+    {
+    iProvidedBitmaps.Close();
+    };
+
+TSize CHuiImageLoader::PreferredSize(TInt aId)
+    {
+    for(TInt i = 0; i < iProvidedBitmaps.Count(); i++)
+        {
+        if (iProvidedBitmaps[i].iId == aId)
+            {
+            // Already in list, do nothing
+            return iProvidedBitmaps[i].iPreferredSize;   
+            }
+        }
+    return iSize;    
+    }
+
+
+CHuiSkinItemImageLoader::CHuiSkinItemImageLoader(
+		const TAknsItemID &aID, 
+		const TDesC &aFileName, 
+		TInt aBitmapId, 
+		TInt aMaskId):
+		iId(aID),
+		iBitmapId(aBitmapId),
+		iMaskId(aMaskId)
+	{
+	iFileName.Set(aFileName);
+	}
+
+
+void CHuiSkinItemImageLoader::ProvideBitmapL (TInt aId, CFbsBitmap *& aBitmap, CFbsBitmap *& aMaskBitmap)
+	{
+	CHuiImageLoader::ProvideBitmapL( aId, aBitmap, aMaskBitmap);
+	MAknsSkinInstance* skininstance = GetValidSkinInstance();
+	
+	if (skininstance)
+	    {
+	    TRAPD(err, AknsUtils::CreateIconL(
+					skininstance, iId,
+					aBitmap, aMaskBitmap, 
+					iFileName, iBitmapId, iMaskId););
+	    if (err == KErrNotFound)
+	        {
+	        AknsUtils::CreateIconL(skininstance,
+	                iId,
+	                aBitmap,
+	                iFileName,
+	                iBitmapId );
+	        }
+	    else
+	        {
+	        User::LeaveIfError(err);
+	        }
+	    }
+	else // proxy from other process 
+	    {
+	    CHuiStatic::GetMaskedBitmapL(iId,
+                aBitmap, aMaskBitmap, iFileName, iBitmapId, iMaskId, PreferredSize(aId), iScaleMode );
+	    return;
+	    }
+	    
+
+    // Leave if bitmap or mask is NULL.
+    User::LeaveIfNull( aBitmap );
+    //User::LeaveIfNull( aMaskBitmap );
+
+	// Disable compression so that the bitmap may be able to be duplicated inside
+	// HUITK when BITGDI renderer is in use.
+#ifndef __SERIES60_30__
+	AknIconUtils::DisableCompression( aBitmap );
+#else
+#pragma message ("S60R30: FBS Compression can't be disabled, graphics may look crappy, deal with it")
+#endif
+
+    // Set icon sizes and render them on the bitmaps.
+    // This does the actual rendering to specified size. (SVG -> bitmap)
+    AknIconUtils::SetSize( aBitmap, PreferredSize(aId), iScaleMode );
+	}
+
+
+CHuiAppIconImageLoader::CHuiAppIconImageLoader(
+		TUid aAppUid, 
+		TAknsAppIconType aType):
+		iAppUid(aAppUid),
+		iType(aType)
+	{
+	}
+
+
+void CHuiAppIconImageLoader::ProvideBitmapL (
+		TInt aId, 
+		CFbsBitmap *& aBitmap, 
+		CFbsBitmap *& aMaskBitmap)
+	{
+	CHuiImageLoader::ProvideBitmapL( aId, aBitmap, aMaskBitmap);
+    MAknsSkinInstance* skin = GetValidSkinInstance();
+    if (skin)
+        {
+        AknsUtils::CreateAppIconLC( 
+					skin, 
+					iAppUid, iType,
+					aBitmap, aMaskBitmap );
+        }
+    // Leave if bitmap or mask is NULL.
+    User::LeaveIfNull( aBitmap );
+    //User::LeaveIfNull( aMaskBitmap );
+
+	// diable compression so that the bitmap may be able to be duplicated inside
+	// HUITK when BITGDI renderer is in use.
+#ifndef __SERIES60_30__
+	AknIconUtils::DisableCompression( aBitmap );
+#else
+#pragma message ("S60R30: FBS Compression can't be disabled, graphics may look crappy, deal with it")
+#endif
+
+    // Set icon sizes and render them on the bitmaps.
+    // This does the actual rendering to specified size. (SVG -> bitmap)
+    AknIconUtils::SetSize( aBitmap, PreferredSize(aId), iScaleMode );
+    
+	// pop the passed bitmap and mask 
+	CleanupStack::Pop(2);
+	}
+
+EXPORT_C void CHuiImageLoaderUtil::ImageLoaderExtension(const TUid& /*aExtensionUid*/, TAny** /*aExtensionParamters*/ )
+    {
+    
+    }
+
+EXPORT_C TBool CHuiAutoSizeImageLoaderUtil::PreferredSizeChanged(const CHuiTexture& aTexture, TInt aTextureId, const THuiRealSize& aPreferredSize)
+    {
+    TBool ret = EFalse;
+    TInt count = iImageLoaderList.Count();
+    for (TInt i=0; i<count;i++)
+        {
+        ret |= iImageLoaderList[i]->PreferredSizeChanged(aTexture, aTextureId, aPreferredSize);    
+        }
+    return ret;    
+        
+    }
+    
+EXPORT_C void CHuiAutoSizeImageLoaderUtil::PreferredSizeReportCompleted()
+    {
+    // Do nothing    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiImageVisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,650 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiImageVisual. CHuiImageVisual is a visual
+*                that is able to display images.
+*
+*/
+
+
+
+#include "uiacceltk/HuiImageVisual.h"  // Class definition
+#include "uiacceltk/HuiStatic.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiDrawing.h"
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/huifixmath.h"
+#include "HuiMatrixStack.h"
+
+#include "uiacceltk/huidropshadow.h"
+#include "uiacceltk/HuiDisplay.h"
+
+#include "HuiRosterImpl.h"
+
+
+EXPORT_C CHuiImageVisual* CHuiImageVisual::AddNewL(CHuiControl& aOwnerControl,
+                                                   CHuiLayout* aParentLayout)
+    {
+    CHuiImageVisual* image = static_cast<CHuiImageVisual*>(
+        aOwnerControl.AppendVisualL(EHuiVisualTypeImage, aParentLayout));
+    return image;
+    }
+
+
+CHuiImageVisual::CHuiImageVisual(MHuiVisualOwner& aOwner)
+        : CHuiVisual(aOwner), iScaleMode(EScaleFit),
+          iStretchMode(CHuiGc::EStretchVertical), iColor(KRgbWhite),
+          iScale(1.f),iOffset(.5f,.5f),iDropShadow(0)
+    {
+    iSecondaryAlpha.SetStyle(EHuiTimedValueStyleLinear);
+    }
+
+
+void CHuiImageVisual::ConstructL()
+    {
+    CHuiVisual::ConstructL();
+    }
+
+
+CHuiImageVisual::~CHuiImageVisual()
+    {
+    }
+
+
+EXPORT_C void CHuiImageVisual::SetScaleMode(TScaleMode aScaleMode)
+    {
+    iScaleMode = aScaleMode;
+    SetChanged();
+    }
+
+
+EXPORT_C void CHuiImageVisual::SetStretch(TInt aTop, TInt aBottom)
+    {
+    iTopStretch = aTop;
+    iBottomStretch = aBottom;
+    SetChanged();
+    }
+
+
+EXPORT_C void CHuiImageVisual::SetStretchMode(CHuiGc::TStretchMode aStretchMode)
+    {
+    iStretchMode = aStretchMode;
+    SetChanged();
+    }
+
+// deprecated
+EXPORT_C void CHuiImageVisual::SetDropShadow(TInt aShadowDistance)
+    {
+    SetDropShadow(THuiXYMetric(aShadowDistance));
+    }
+    
+EXPORT_C void CHuiImageVisual::SetDropShadow(const THuiMetric& aShadowDistance)
+	{
+    SetDropShadow(THuiXYMetric(aShadowDistance));
+	}
+
+EXPORT_C void CHuiImageVisual::SetDropShadow(const THuiXYMetric& aShadowDistance)
+	{
+    iDropShadow = aShadowDistance;
+    SetChanged();	
+    
+    if(!HuiUtil::RealCompare(iDropShadow.iX.iMagnitude,0.f) || !HuiUtil::RealCompare(iDropShadow.iY.iMagnitude,0.f))
+        {
+        TRAP_IGNORE( EnableDropShadowL( ETrue ) );
+        }
+    else
+        {
+        TRAP_IGNORE( EnableDropShadowL( EFalse ) );
+        }
+
+	}
+
+
+EXPORT_C void CHuiImageVisual::SetImage(const THuiImage& aImage)
+    {
+    iImage = aImage;
+    SetChanged();
+    }
+
+
+EXPORT_C void CHuiImageVisual::SetSecondaryImage(const THuiImage& aImage)
+    {
+    iSecondaryImage = aImage;
+    SetChanged();
+    }
+
+
+EXPORT_C const THuiImage& CHuiImageVisual::Image() const
+    {
+    return iImage;
+    }
+
+
+EXPORT_C void CHuiImageVisual::SetColor(const TRgb& aColor)
+    {
+    iColor = aColor;
+    SetChanged();
+    }
+
+
+EXPORT_C void CHuiImageVisual::SetColorMode(TColorMode aColorMode, TReal32 aParam) __SOFTFP
+    {
+    iColorMode = aColorMode;
+    iColorParam = aParam;
+    SetChanged();
+    }
+
+TBool CHuiImageVisual::PrepareDrawL()
+    {
+	if (Flags() & EHuiVisualFlagDrawOnlyAsExternalContent)
+	   	{
+	    // This is used only as external content visual. Return now if we are not currently drawing
+	    // external content.
+	   	if (!Display() || !Display()->RosterImpl().IsDrawingExternalContent())
+	   		{
+			return ETrue;
+	   		}
+	   	}
+
+    if ( iImage.HasTexture() )
+        {   
+        CHuiDropShadow* shadowHandler = DropShadowHandler();
+        if ( shadowHandler && shadowHandler->IsShadowVisible() )
+            {
+            CHuiTexture* shadowTextureSource = shadowHandler->ShadowedTextureInstance( *iImage.ImageTexture() );
+            if ( shadowTextureSource )
+                {        
+                const TInt requestedBlurredSize = HUI_ROUND_FLOAT_TO_INT( 2*DropShadowHandler()->iRadius.Now() );
+                shadowTextureSource->CreateShadowTextureL( requestedBlurredSize, EHuiTextureShadowStyleIcon );
+                }
+            }
+        }
+    return ETrue;       
+    }
+
+void CHuiImageVisual::DrawSelf(CHuiGc& aGc, const TRect& /*aDisplayRect*/) const
+    {
+    TReal32 effectiveOpacity = EffectiveOpacity();
+
+    THuiRealRect content = DisplayRect();
+    content.Shrink(PaddingInPixels());
+
+    if(!iImage.HasTexture() || effectiveOpacity <= 0)
+        {        
+        aGc.NotifyImagePreferredSize(iImage, content);
+        return;
+        }
+
+    if(content.Width() <= 0 || content.Height() <= 0)
+        {
+        // Too small to see.
+        return;
+        }
+
+    aGc.Enable(CHuiGc::EFeatureBlending);
+
+    TReal32 turnAngle = iTurnAngle.Now();
+    TReal32 xOffset = 0;
+    TReal32 yOffset = 0;
+
+    TReal32 scale = HuiUtil::CalculateScaleFactorFromScaleMode(
+                content.Size(),
+                iImage.Texture().Size(),
+                iScaleMode,
+                iScale.Now() );
+
+    // Determine offset.
+    TSize imageSize = iImage.Texture().Size();
+    TReal32 scaled = scale * imageSize.iWidth;
+    if(scaled > content.Width())
+        {
+        xOffset = (scaled - content.Width()) * (iOffset.iX.Now() - 0.5f);
+        }
+    scaled = scale * imageSize.iHeight;
+    if(scaled > content.Height())
+        {
+        yOffset = (scaled - content.Height()) * (iOffset.iY.Now() - 0.5f);
+        }
+
+    if(turnAngle != 0 || scale != 1)
+        {
+        /** @todo  GC must provide some support for transformations. */
+        aGc.Push(EHuiGcMatrixModel);
+
+        // Rotate around the midpoint of the visual.
+        THuiRealPoint mid = content.Center();
+
+        aGc.Translate(EHuiGcMatrixModel, mid.iX - xOffset, mid.iY - yOffset, 0.f);
+        if(turnAngle != 0)
+            {
+            aGc.Rotate(EHuiGcMatrixModel, turnAngle, 0.f, 0.f, -1.f);
+            }
+        if(scale != 1)
+            {
+            aGc.Scale(EHuiGcMatrixModel, scale, scale, 1.f);
+            }
+        aGc.Translate(EHuiGcMatrixModel, -mid.iX, -mid.iY, 0.f);
+        }
+
+    // Use the appropriate alignment in the graphics context.
+    if(iScaleMode == EScaleFit)
+        {
+        aGc.SetAlign(EHuiAlignHLeft, EHuiAlignVTop);
+        }
+    else
+        {
+        aGc.SetAlign(EHuiAlignHCenter, EHuiAlignVCenter);
+        }
+   
+    // draw drop shadow
+    CHuiDropShadow* shadowHandler = DropShadowHandler();
+    if ( shadowHandler && iImage.HasTexture() )
+        {
+        CHuiTexture* shadowTextureSource = shadowHandler->ShadowedTextureInstance( *iImage.ImageTexture() );
+        if ( iImage.ImageTexture() &&
+             shadowTextureSource &&
+             shadowHandler->IsShadowVisible() )
+            {
+            const TInt requestedBlurredSize = HUI_ROUND_FLOAT_TO_INT( 2*DropShadowHandler()->iRadius.Now() );
+            
+            THuiTextureHandle shadow;
+            TBool haveShadowTexture = shadowTextureSource->GetShadowTexture( shadow,requestedBlurredSize );
+
+            if ( haveShadowTexture )
+                {
+                THuiImage shadowImage( shadow );
+                const THuiRealRect shadowDrawingRect = shadowHandler->ShadowDrawingRealRect( 
+                    content.iTl,
+                    content.Size(),
+                    shadow.Size(),
+                    *this );
+                
+                // set drawing parameters
+                aGc.SetPenAlpha(TInt(effectiveOpacity * shadowHandler->iOpacity.Now()*255.f));
+                aGc.SetPenColor(shadowHandler->Color());
+                const THuiQuality oldQuality = aGc.Quality(); // store the original quality
+                aGc.SetQuality(EHuiQualityFast); // draw always with 'fast'
+                
+                if(iScaleMode == EScaleFit)
+                    {
+                    aGc.DrawImage(shadowImage, shadowDrawingRect.iTl, shadowDrawingRect.Size() );
+                    }
+                else
+                    {
+                    THuiRealSize relativeShadowTextureSize = iImage.Texture().Size();
+                    relativeShadowTextureSize.iWidth *= ((TReal32)shadowDrawingRect.Width())/((TReal32)content.Size().iWidth);
+                    relativeShadowTextureSize.iHeight *= ((TReal32)shadowDrawingRect.Height())/((TReal32)content.Size().iHeight);
+
+                    aGc.DrawImage(
+                        shadowImage, 
+                        relativeShadowTextureSize,
+                        THuiRealRect( shadowDrawingRect.iTl, shadowDrawingRect.Size() ));
+                       
+                    }
+                    
+                aGc.SetQuality(oldQuality); // restore quality
+                }
+            }
+        }
+        
+    // Actual color of the image.
+    aGc.SetPenAlpha(TInt(effectiveOpacity * 255));
+    aGc.SetPenColor(iColor);
+
+    // Apply special color mode.
+    if(iColorMode == EColorDimmed)
+        {
+        aGc.Enable(CHuiGc::EFeatureFog);
+        aGc.SetDimmingFog(iColor, iColorParam);
+        }
+
+    if(iTopStretch || iBottomStretch)
+        {
+        aGc.DrawStretchImage(iStretchMode, iImage, content,
+                             iTopStretch, iBottomStretch);
+        }
+    else
+        {
+        if(aGc.TextureUnits() >= 2 &&
+           CHuiStatic::Renderer().Allows(EHuiRenderPluginAllowTextureModeInterpolate) &&
+           iImage.HasTexture() && iSecondaryImage.HasTexture() &&
+           (iImage.SegmentCount() == iSecondaryImage.SegmentCount() && 
+           (iImage.Texture().Size() == iSecondaryImage.Texture().Size() || iImage.SegmentCount() == 1)))
+            {
+            // Can use multitexturing to interpolate.
+            aGc.SetTextureUnits(2);
+            aGc.Enable(CHuiGc::EFeatureTexturing);
+            aGc.SetTextureMode(CHuiGc::ETextureModeInterpolate,
+                               iSecondaryAlpha.Now());
+            aGc.SetPenAlpha(TInt(effectiveOpacity * 255));
+
+            if(iScaleMode == EScaleFit)
+                {
+                // Scale both images to the content rectangle.
+                aGc.DrawImages(iImage, iSecondaryImage,
+                               content.iTl, content.Size());
+                }
+            else
+                {
+                // Draw both images by taking the size of the first one.
+                aGc.DrawImages(iImage, iSecondaryImage,
+                               iImage.Texture().Size(), content);
+                }
+
+            aGc.SetTextureUnits(1);
+            aGc.SetTextureMode(CHuiGc::ETextureModeNormal);
+            }
+        else
+            {
+            // Must draw using two passes.
+            TInt primaryAlpha = 0;
+            TInt secondaryAlpha = 0;
+            GetDualAlpha(effectiveOpacity, iSecondaryAlpha.Now(),
+                         primaryAlpha, secondaryAlpha);
+
+            // Draw both the primary and the secondary images.
+            if(primaryAlpha > 0)
+                {
+                aGc.SetPenAlpha(primaryAlpha);
+                if(iScaleMode == EScaleFit)
+                    {
+                    aGc.DrawImage(iImage, content.iTl, content.Size());
+                    }
+                else
+                    {
+                    aGc.DrawImage(iImage, content);
+                    }
+                }
+
+            if(secondaryAlpha > 0 && iSecondaryImage.HasTexture())
+                {
+                aGc.SetPenAlpha(secondaryAlpha);
+                if(iScaleMode == EScaleFit)
+                    {
+                    aGc.DrawImage(iSecondaryImage, content.iTl, content.Size());
+                    }
+                else
+                    {
+                    aGc.DrawImage(iSecondaryImage, iImage.Texture().Size(), content);
+                    }
+                }
+            else
+                {
+                // Notify preferred size even if image is not drawn (yet)
+                aGc.NotifyImagePreferredSize(iSecondaryImage, content);                    
+                }
+            }
+        }
+
+    // Disable special color modes.
+    if(iColorMode == EColorDimmed)
+        {
+        aGc.Disable(CHuiGc::EFeatureFog);
+        }
+
+    // Restore original transformation.
+    if(turnAngle != 0 || scale != 1)
+        {
+        aGc.Pop(EHuiGcMatrixModel);
+        }
+    }
+
+
+TBool CHuiImageVisual::Changed() const
+    {
+    if(CHuiVisual::Changed())
+        {
+        return ETrue;
+        }
+        
+	if(iImage.Changed())
+		{
+		return ETrue;
+		}
+		        
+    return (iTurnAngle.Changed() || iOffset.Changed() || iScale.Changed() ||
+            iSecondaryAlpha.Changed());
+    }
+
+
+void CHuiImageVisual::ClearChanged()
+    {
+    CHuiVisual::ClearChanged();
+    iImage.ClearChanged();
+    iTurnAngle.ClearChanged();
+    iOffset.ClearChanged();
+    iScale.ClearChanged();
+    iSecondaryAlpha.ClearChanged();
+    }
+
+void DoRotateRect(THuiRealRect& aRect, TReal32 aAngle)
+    {
+    // Transform dirty rect and enlarge it if rotated.    
+    THuiRealRect transformed(aRect);
+    
+    THuiRealPoint coords[4];
+    coords[0].iX = transformed.iTl.iX;
+    coords[0].iY = transformed.iTl.iY;
+    coords[1].iX = transformed.iBr.iX;
+    coords[1].iY = transformed.iTl.iY;
+    coords[2].iX = transformed.iBr.iX;
+    coords[2].iY = transformed.iBr.iY;
+    coords[3].iX = transformed.iTl.iX;
+    coords[3].iY = transformed.iBr.iY;
+    
+
+    TInt radians = HuiFixMath::FixMul(HuiFixMath::FloatToFix(aAngle),KFixPi)/180;
+    if (aAngle < 0)
+        {
+        radians = -radians;
+        }
+
+    TInt sin = HuiFixMath::FixSin(radians);
+    TInt cos = HuiFixMath::FixCos(radians);
+        
+        
+    CHuiMatrixStack::TMatrix rotation;
+    rotation.iMatrix[0] = HuiFixMath::FixToFloat(cos);
+    rotation.iMatrix[1] = HuiFixMath::FixToFloat(sin);
+    rotation.iMatrix[3] = HuiFixMath::FixToFloat(-sin);
+    rotation.iMatrix[4] = HuiFixMath::FixToFloat(cos);
+    rotation.iMatrix[8] = 1.0f;
+    rotation.iIsIdentity = EFalse;
+
+    for (TInt count = 0; count < 4; count++)
+        {
+        rotation.Multiply(coords[count]);
+        }
+
+    // rotate only if there is really rotation, not mirroring
+    
+    if ( !HuiUtil::RealCompare(coords[2].iY, coords[3].iY) )
+        {
+        // rotation has been applied
+        THuiRealPoint minPoint = coords[0];
+        THuiRealPoint maxPoint = coords[0];
+        for (TInt count = 1; count < 4; count++)
+            {
+            if (coords[count].iX < minPoint.iX)
+                {
+                minPoint.iX = coords[count].iX;
+                }
+            if (coords[count].iY < minPoint.iY)
+                {
+                minPoint.iY = coords[count].iY;
+                }
+            if (coords[count].iX > maxPoint.iX)
+                {
+                maxPoint.iX = coords[count].iX;
+                }
+            if (coords[count].iY > maxPoint.iY)
+                {
+                maxPoint.iY = coords[count].iY;
+                }
+            }
+				
+        transformed.iTl = minPoint;
+        transformed.iBr = maxPoint;
+        }
+    else
+        {
+        transformed.iTl = coords[0];
+        transformed.iBr = coords[2];            
+        }    
+        
+    aRect = transformed;
+    }
+
+
+void CHuiImageVisual::ExpandRectWithContent(TRect& aRect) const
+    {
+    if(!Clipping())
+        {
+        if( iImage.HasTexture() )
+            {
+            TSize imageSize = iImage.Texture().Size(); 
+
+            // Handle scale mode
+            if (iScaleMode == EScaleNormal && 
+                 ( imageSize.iWidth > aRect.Width() || imageSize.iHeight > aRect.Height()))
+                {
+                const TInt growX = Max( 0, ((imageSize.iWidth - aRect.Width()) + 1) / 2 );
+                const TInt growY = Max( 0, ((imageSize.iHeight - aRect.Height()) + 1) / 2 );
+                aRect.Grow( growX, growY );
+                }
+            else if (iScaleMode == EScaleFitWidth)
+                {
+                TReal32 scale = HuiUtil::CalculateScaleFactorFromScaleMode(
+                    aRect.Size(),
+                    imageSize,
+                    iScaleMode,
+                    1.f );
+                TInt scaled = (TReal32)imageSize.iHeight*scale+0.5f;
+                if (scaled > aRect.Height())
+                    {
+                    aRect.Grow(0,(((scaled-aRect.Height()) +1)/2));
+                    }
+                }
+            else if (iScaleMode == EScaleFitHeight)
+                {
+                TReal32 scale = HuiUtil::CalculateScaleFactorFromScaleMode(
+                    aRect.Size(),
+                    imageSize,
+                    iScaleMode,
+                    1.f );
+                TInt scaled = (TReal32)imageSize.iWidth*scale+0.5f;
+                if (scaled > aRect.Width())
+                    {
+                    aRect.Grow((((scaled-aRect.Width()) +1)/2),0);                    
+                    }
+                }
+            else if (iScaleMode == EScaleCover || iScaleMode == EScaleFitInside)
+                {
+                TReal32 scale = HuiUtil::CalculateScaleFactorFromScaleMode(
+                    aRect.Size(),
+                    imageSize,
+                    iScaleMode,
+                    1.f );
+                TInt scaledW = (TReal32)imageSize.iWidth*scale+0.5f;
+                TInt scaledH = (TReal32)imageSize.iHeight*scale+0.5f;
+
+                if (scaledW > aRect.Width())
+                    {
+                    aRect.Grow((((scaledW-aRect.Width()) +1)/2),0);                    
+                    }
+                if (scaledH > aRect.Height())
+                    {
+                    aRect.Grow(0,(((scaledH-aRect.Height()) +1)/2));
+                    }
+                }
+            else
+                {
+                // For PC-lint
+                }
+            }
+               
+        // Calculate scaled rect.
+        // aRect and scaled rect has same center position. 
+        TRect adjusted;
+        TReal32 scale = iScale.Now();
+        TReal32 offsetX = TReal32(aRect.Width()) * scale / 2.f;
+        TReal32 offsetY = TReal32(aRect.Height()) * scale / 2.f;
+
+        adjusted.iTl.iX = HUI_ROUND_FLOAT_TO_INT((aRect.iTl.iX + aRect.Width()/2.f) - offsetX);
+        adjusted.iTl.iY = HUI_ROUND_FLOAT_TO_INT((aRect.iTl.iY + aRect.Height()/2.f) - offsetY);
+        adjusted.iBr.iX = HUI_ROUND_FLOAT_TO_INT((aRect.iBr.iX - aRect.Width()/2.f) + offsetX);
+        adjusted.iBr.iY = HUI_ROUND_FLOAT_TO_INT((aRect.iBr.iY - aRect.Height()/2.f) + offsetY);
+
+        // aRect must not become smaller.
+        aRect.BoundingRect( adjusted );
+        
+        // calculate drop shadow
+        CHuiDropShadow* shadowHandler = DropShadowHandler();
+        if ( iImage.HasTexture() &&
+            shadowHandler &&
+            shadowHandler->IsShadowVisible() )
+            {
+            CHuiTexture* shadowTextureSource = shadowHandler->ShadowedTextureInstance( *iImage.ImageTexture() );
+            if ( shadowTextureSource )
+                {
+                    
+                const TInt requestedBlurredSize = HUI_ROUND_FLOAT_TO_INT( 2*shadowHandler->iRadius.Now() );
+                
+                THuiTextureHandle shadow;
+                TBool haveShadowTexture = shadowTextureSource->GetShadowTexture( shadow,requestedBlurredSize );
+                
+                if ( haveShadowTexture )
+                    {
+                    const TRect shadowRect = shadowHandler->ShadowDrawingTRect( 
+                        aRect.iTl,
+                        aRect.Size(),
+                        shadow.Size(),
+                        *this );
+                         
+                    // aRect must not become smaller.
+                    aRect.BoundingRect( shadowRect );
+                    }
+                }
+            }
+
+        // add the turn angle effect
+        if ( iImage.HasTexture() && iTurnAngle.Now() )
+            {
+            // Take turn angle into accout by rotating aRect.
+            THuiRealRect rotated( THuiRealPoint(0.f,0.f), aRect.Size() );
+            rotated.Move( -rotated.Center().iX, -rotated.Center().iY );
+            DoRotateRect( rotated, iTurnAngle.Now() );
+            TSize rotatedSize = rotated.Size();
+            // Size rounds down, compensate by increasing by one.
+            rotatedSize.iWidth++;
+            rotatedSize.iHeight++;
+            
+            // Define rotatedRect: same center point as aRect, different size
+            TRect rotatedRect( rotatedSize );
+            rotatedRect.Move( 
+                aRect.Center() - 
+                TPoint( ( rotatedSize.iWidth + 1 )/2, ( rotatedSize.iHeight + 1 )/2 ) );
+            rotatedRect.iBr += TPoint( 1, 1 ); // two possible center
+            
+            // aRect must not become smaller.
+            aRect.BoundingRect( rotatedRect );
+            }
+        
+        // Apparently, there is two pixel error in above 
+        // (occurs already before scaling, fit width/fit height cases).
+        aRect.Grow( 2, 2 );
+        }
+
+    CHuiVisual::ExpandRectWithContent(aRect);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiInteractionInterval.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   THuiInteractionInterval is a utility class that can be used 
+*                as specify intervals that adapt to user input.
+*
+*/
+
+
+
+#include "uiacceltk/HuiInteractionInterval.h"  // Class definition
+#include "uiacceltk/HuiStatic.h"
+
+
+EXPORT_C THuiInteractionInterval::THuiInteractionInterval(TReal32 aScalar) __SOFTFP
+        : iScalar(aScalar), iLastTimeMs(0)
+    {
+    }
+
+
+EXPORT_C void THuiInteractionInterval::SetScalar(TReal32 aScalar) __SOFTFP
+    {
+    iScalar = aScalar;
+    }
+    
+    
+EXPORT_C TReal32 THuiInteractionInterval::Scalar() const __SOFTFP
+    {
+    return iScalar;
+    }
+    
+
+EXPORT_C TInt THuiInteractionInterval::Interval(TInt aIntervalTime)
+    {
+    TUint32 now = CHuiStatic::MilliSecondsSinceStart();
+    TUint32 elapsed = now - iLastTimeMs;
+    
+    if(iScalar * elapsed < aIntervalTime)
+        {
+        // The last movement is probably still going on.
+        aIntervalTime = TInt(elapsed * iScalar);
+        }
+        
+    iLastTimeMs = now;
+    
+    return aIntervalTime;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiLayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1254 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiLayout class. Layouts are visuals that 
+*                manage the placement of a set of child visuals.
+*
+*/
+
+
+
+#include <AknUtils.h>
+
+#include "uiacceltk/HuiLayout.h"  // Class definition
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiDrawing.h"
+#include "uiacceltk/HuiDisplay.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiUtil.h"
+#include "HuiRosterImpl.h"
+#include "huilayoutdata.h"
+
+#include "HuiFxEffect.h"
+#include "HuiRenderPlugin.h"
+#include "huicanvasgc.h"
+#include "Matrix.h"
+// 
+// methods
+//
+
+EXPORT_C CHuiLayout* CHuiLayout::AddNewL(CHuiControl& aOwnerControl,
+                                         CHuiLayout* aParentLayout)
+    {
+    CHuiLayout* layout = aOwnerControl.AppendLayoutL(EHuiLayoutTypeLayout,
+                                                     aParentLayout);
+    return layout;
+    }
+
+
+EXPORT_C CHuiLayout::CHuiLayout(MHuiVisualOwner& aOwner)
+        : CHuiVisual(aOwner)
+    {
+    }
+
+
+EXPORT_C void CHuiLayout::ConstructL()
+    {
+    CHuiVisual::ConstructL();
+    iHuiLayoutPrivateData = new (ELeave) THuiLayoutPrivateData;
+    CHuiRenderPlugin& renderplugin = CHuiStatic::Renderer();
+    iHuiLayoutPrivateData->iGc = renderplugin.CreateCanvasGcL();
+    }
+
+
+EXPORT_C CHuiLayout::~CHuiLayout()
+    {
+    if ( iHuiLayoutPrivateData ) // a Fix for OOM situations, tried to dereference NULL pointer
+    	{
+	    delete iHuiLayoutPrivateData->iScroll;
+	
+	    // Remove children in reverse order.
+	    for(TInt i = Count() - 1; i >= 0; --i)
+	        {
+	        Remove(iHuiLayoutPrivateData->iChildren[i]);
+	        }
+	    iHuiLayoutPrivateData->iChildren.Reset();
+	    delete iHuiLayoutPrivateData->iGc;
+	    delete iHuiLayoutPrivateData;
+    	}
+    }
+
+
+EXPORT_C void CHuiLayout::RemoveAndDestroyAllD()
+    {
+    // Make sure we do not re-layout during destruction
+    SetFlag( EHuiVisualFlagFreezeLayout );
+    
+    for(TInt i = Count() - 1; i >= 0; --i)
+        {
+        iHuiLayoutPrivateData->iChildren[i]->RemoveAndDestroyAllD();
+        }
+    iHuiLayoutPrivateData->iChildren.Reset();
+
+    CHuiVisual::RemoveAndDestroyAllD();
+    }
+
+
+EXPORT_C void CHuiLayout::AppendL(CHuiVisual* aVisual, TInt aLayoutTransitionTime)
+    {
+    ASSERT(aVisual != NULL);
+    __ASSERT_ALWAYS( iHuiLayoutPrivateData->iChildren.Find(aVisual) == KErrNotFound,
+                     THuiPanic::Panic(THuiPanic::ELayoutDuplicateVisual) );
+
+    User::LeaveIfError( iHuiLayoutPrivateData->iChildren.Append(aVisual) );
+    
+    CHuiLayout* oldLayout = aVisual->Layout();
+    if (oldLayout != NULL)
+    	{
+    	// If this visual is already a member of another layout, remove it from the old one first.
+    	oldLayout->Remove(aVisual);
+	    }
+	else
+	    {
+	    // if the visual is a showing as root visual before, remove it from the roster
+	    if ( aVisual->Display() )
+	        {
+	        aVisual->Display()->Roster().HideVisual( aVisual );
+	        }
+	    }
+    
+    aVisual->SetLayout(this);
+
+    // Update the visual's layout immediately.
+    if(!(Flags() & EHuiVisualFlagFreezeLayout))
+        {
+        UpdateChildrenLayout(aLayoutTransitionTime);
+        }
+
+    SetChanged();
+    }
+
+
+EXPORT_C void CHuiLayout::InsertL(CHuiVisual* aVisual, TInt aPosition, TInt aLayoutTransitionTime)
+    {
+    ASSERT(aVisual != NULL);
+    __ASSERT_ALWAYS( iHuiLayoutPrivateData->iChildren.Find(aVisual) == KErrNotFound,
+                     THuiPanic::Panic(THuiPanic::ELayoutDuplicateVisual) );
+    ASSERT((aPosition >= 0) && aPosition <= Count());
+    
+    iHuiLayoutPrivateData->iChildren.InsertL(aVisual, aPosition);
+    
+    CHuiLayout* oldLayout = aVisual->Layout();
+    if (oldLayout != NULL)
+    	{
+    	// If this visual is already a member of another layout, remove it from the old one first.
+    	oldLayout->Remove(aVisual);
+	    }
+	else
+	    {
+	    // if the visual is a showing as root visual before, remove it from the roster
+	    if ( aVisual->Display() )
+	        {
+	        aVisual->Display()->Roster().HideVisual( aVisual );
+	        }
+	    }
+
+    // Update the visual's layout immediately.
+    aVisual->SetLayout(this);
+    
+    if(!(Flags() & EHuiVisualFlagFreezeLayout))
+        {
+        UpdateChildrenLayout(aLayoutTransitionTime);
+        }
+
+    SetChanged();
+    }
+
+
+EXPORT_C void CHuiLayout::Remove(CHuiVisual* aVisual, TInt aLayoutTransitionTime)
+    {
+    TInt index = iHuiLayoutPrivateData->iChildren.Find(aVisual);
+    /*__ASSERT_DEBUG(index != KErrNotFound,
+                   THuiPanic::Panic(THuiPanic::EInternal));*/
+    if(index != KErrNotFound)
+        {
+        iHuiLayoutPrivateData->iChildren.Remove(index);
+        aVisual->SetLayout(NULL); // defect. this should check if there is a Host()->ContainerLayout()
+        
+        // If the control group of the aVisual is showing in a roster,
+        // we need to add it as the root visual of that roster
+        /*
+        for ( TInt d = 0; d < Env().DisplayCount() ; d ++ )
+            {
+            if ( (Env().Displays())[d]->Roster().Find( aVisual->Owner().ControlGroup() ) != KErrNotFound )
+                {
+                TRAP_IGNORE( (Env().Displays())[d]->Roster().ShowVisualL( aVisual ) );
+                break;
+                }
+            }*/
+
+        // Update the layout of all the children immediately.
+        if(!(Flags() & EHuiVisualFlagFreezeLayout))
+            {
+            UpdateChildrenLayout(aLayoutTransitionTime);
+            }
+
+        SetChanged();
+        }
+    }
+
+
+EXPORT_C TInt CHuiLayout::Count() const
+    {
+    return iHuiLayoutPrivateData->iChildren.Count();
+    }
+
+
+EXPORT_C CHuiVisual& CHuiLayout::Visual(TInt aIndex) const
+    {
+    return *(iHuiLayoutPrivateData->iChildren[aIndex]);
+    }
+
+
+EXPORT_C TInt CHuiLayout::FindVisual(const CHuiVisual* aVisual) const
+    {
+    for(TInt i = 0; i < Count(); ++i)
+        {
+        if(&Visual(i) == aVisual)
+            {
+            return i;
+            }
+        }
+    return KErrNotFound;
+    }
+
+
+THuiRealRect CHuiLayout::BoundingRect() const
+    {
+    THuiRealPoint min;
+    THuiRealPoint max;
+    
+    min.iX = 0;
+    min.iY = 0;
+    max.iX = 0;
+    max.iY = 0;
+    
+    TInt count = Count();
+    if(count > 0) 
+    	{
+    	min = Visual(0).Pos().Target();
+    	max = min + Visual(0).Size().Target();    	
+    	}
+
+    for(TInt i = 1; i < count; ++i)
+        {
+        THuiRealPoint tl = Visual(i).Pos().Target();
+        THuiRealPoint br = tl + Visual(i).Size().Target();
+
+        min.iX = Min(min.iX, tl.iX);
+        min.iY = Min(min.iY, tl.iY);
+        max.iX = Max(max.iX, br.iX);
+        max.iY = Max(max.iY, br.iY);
+        }
+
+    return THuiRealRect(min, max);
+    }
+    
+    
+EXPORT_C THuiRealSize CHuiLayout::InnerSize() const __SOFTFP
+    {
+    // Determine the size of this layout in pixels.
+    THuiRealSize innerSizeChild = Size().RealTarget().AsSize(); // not correct units, but will work as fallback value if base unit is in pixels
+    THuiRealPoint innerSizePx = LocalPointInPixels(Size().RealTarget(), EHuiReferenceStateTarget);
+
+    // Subtract outer paddings.
+    THuiRealRect paddingInPixels = PaddingInPixels(EHuiReferenceStateTarget);
+    innerSizePx.iX -= paddingInPixels.iTl.iX + paddingInPixels.iBr.iX;
+    innerSizePx.iY -= paddingInPixels.iTl.iY + paddingInPixels.iBr.iY;
+    
+    // Convert the result into base units of *this* layout.
+    CHuiVisual* child = 0;
+    if (iHuiLayoutPrivateData->iChildren.Count())
+        {
+        child = iHuiLayoutPrivateData->iChildren[0]; // get the first child, if there isn't one, then nothing to do anyway
+        }
+    if(child)
+        {
+        innerSizeChild = child->PixelPointInUnits(innerSizePx, BaseUnit().Abs(), EHuiReferenceStateTarget).AsSize();
+        }
+
+    return innerSizeChild;    
+    }
+
+
+EXPORT_C THuiRealPoint CHuiLayout::InnerTopLeft() const __SOFTFP
+    {
+    THuiRealPoint topLeftChild(0, 0);
+    CHuiVisual* child = 0;
+    if (iHuiLayoutPrivateData->iChildren.Count())
+        {
+        child = iHuiLayoutPrivateData->iChildren[0]; // get the first child, if there isn't one, then nothing to do anyway
+        }
+    if(child)
+        {
+        topLeftChild = child->PixelPointInUnits(PaddingInPixels().iTl, BaseUnit().Abs(), EHuiReferenceStateTarget);
+        }
+    return topLeftChild;
+    }
+
+
+EXPORT_C void CHuiLayout::SetSize(const THuiRealSize& aSize, TInt aTransitionTime)
+    {
+    CHuiVisual::SetSize(aSize, aTransitionTime);
+
+    // The default layout does not need to update its children.
+    }
+
+
+EXPORT_C void CHuiLayout::UpdateChildrenLayout(TInt aTransitionTime)
+    {
+    // Update the layout of all children.
+    TInt count = Count();
+    for(TInt i = 0; i < count; ++i)
+        {
+        //Ignore inactive child visuals
+        if ( iHuiLayoutPrivateData->iChildren[i]->Flags() & EHuiVisualFlagInactive )
+        	{
+        	continue;
+        	}
+        UpdateChildLayout(i, aTransitionTime);
+        }
+
+    CHuiVisual::UpdateChildrenLayout(aTransitionTime);
+
+    // Report that the layout of this layout visual has been fully updated.
+    ReportLayoutUpdate();
+    }
+
+
+EXPORT_C void CHuiLayout::UpdateChildLayout(TInt aIndex, TInt aTransitionTime)
+    {
+    THuiRealRect rect;
+    TSize size;
+    TPoint pos;
+    TInt ordinal = ChildOrdinal(aIndex);
+    CHuiVisual* child = iHuiLayoutPrivateData->iChildren[aIndex];
+    TInt flags = child->Flags();
+
+    TInt transitionTime = aTransitionTime;
+
+    if(flags & EHuiVisualFlagManualTransitionTime)
+        {
+        // override the parent's transition time with our local one.
+        transitionTime = TransitionTime();
+        }
+
+    // if either flag is missing, call child rect...
+    TBool bothManual = (flags & EHuiVisualFlagManualPosition) && (flags & EHuiVisualFlagManualSize);
+    if(!bothManual)
+        {
+        TInt childRectStatus = ChildRect(ordinal, rect);
+        if(childRectStatus != THuiLayoutChildRectNotImplemented)
+            {
+            if(!(flags & EHuiVisualFlagManualPosition) && (childRectStatus & THuiLayoutChildRectPosUpdateNeeded))
+                {
+                child->SetPos(rect.iTl, transitionTime);
+                }
+            if(!(flags & EHuiVisualFlagManualSize) && (childRectStatus & THuiLayoutChildRectSizeUpdateNeeded))
+                {
+                child->SetSize(rect.Size(), transitionTime);
+                }
+            }
+        else
+            {
+            if(!(flags & EHuiVisualFlagManualPosition) && ChildPos(ordinal, pos))
+                {
+                child->SetPos(pos, transitionTime);
+                }
+            if(!(flags & EHuiVisualFlagManualSize) && ChildSize(ordinal, size))
+                {
+                child->SetSize(size, transitionTime);
+                }
+            }
+        }
+    child->ReportLayoutUpdate();
+    }
+
+
+EXPORT_C TInt CHuiLayout::ChildOrdinal(TInt aIndex)
+    {
+    return aIndex;
+    }
+
+
+EXPORT_C TBool CHuiLayout::ChildSize(TInt /*aOrdinal*/, TSize& /*aSize*/)
+    {
+    // The default layout doesn't constrain the sizes of the children.
+    return EFalse;
+    }
+
+EXPORT_C TBool CHuiLayout::ChildPos(TInt /*aOrdinal*/, TPoint& /*aPos*/)
+    {
+    // The default layout lets the children position themselves.
+    return EFalse;
+    }
+
+EXPORT_C TInt CHuiLayout::ChildRect(TInt /*aOrdinal*/, THuiRealRect& /*aPos*/)
+    {
+    // The default layout lets the children position themselves.
+    return THuiLayoutChildRectNotImplemented;
+    }
+
+
+EXPORT_C void CHuiLayout::SetInnerPadding(const TPoint& aInnerPadding)
+    {
+    iHuiLayoutPrivateData->iInnerPadding.iX = THuiMetric(aInnerPadding.iX, EHuiUnitPixel);
+    iHuiLayoutPrivateData->iInnerPadding.iY = THuiMetric(aInnerPadding.iY, EHuiUnitPixel);
+    SetChanged();
+    }
+
+
+EXPORT_C void CHuiLayout::SetInnerPadding(const THuiXYMetric& aInnerPadding)
+    {
+    iHuiLayoutPrivateData->iInnerPadding = aInnerPadding;
+    SetChanged();
+    }
+
+
+EXPORT_C const THuiXYMetric& CHuiLayout::InnerPadding() const
+    {
+    return iHuiLayoutPrivateData->iInnerPadding;
+    }
+    
+
+EXPORT_C THuiRealPoint CHuiLayout::InnerPaddingInBaseUnits() const __SOFTFP
+    {
+    THuiRealPoint innerPaddingPx = MetricToPixels(iHuiLayoutPrivateData->iInnerPadding, EHuiReferenceStateTarget);
+    return PixelPointInUnits(innerPaddingPx, BaseUnit().Abs(), EHuiReferenceStateTarget);    
+    }
+
+
+EXPORT_C TInt CHuiLayout::HorizontalInnerPadding() const
+    {
+    return 0; //iHuiLayoutPrivateData->iXPadding;
+    }
+
+
+EXPORT_C TInt CHuiLayout::VerticalInnerPadding() const
+    {
+    return 0; //iHuiLayoutPrivateData->iYPadding;
+    }
+    
+
+EXPORT_C TBool CHuiLayout::PrepareDrawL() 
+    {
+    if (Flags() & EHuiVisualFlagDrawOnlyAsExternalContent)
+    	{
+   	    // This is used only as external content visual. Return now if we are not currently drawing
+   	    // external content.
+    	if (!Display() || !Display()->RosterImpl().IsDrawingExternalContent())
+    		{
+			return ETrue;
+    		}
+    	}
+
+    // The layout itself is invisible. Only its children can be seen.
+    TInt count = Count();
+    for(TInt i = 0; i < count; ++i)
+        {
+        CHuiVisual* visual = iHuiLayoutPrivateData->iChildren[i];
+        //Ignore inactive child visuals
+        if ( visual->Flags()& EHuiVisualFlagInactive )
+        	{
+        	continue; 
+        	}
+        TBool successfullyPrepared = ETrue;
+        TRAPD(err, successfullyPrepared = visual->PrepareDrawL());
+        if (err != KErrNone)
+            {
+            // Handle the error by calling the visual owner
+            // errorhandling callback
+            visual->Owner().VisualPrepareDrawFailed(*visual, err);
+            return EFalse;
+            }
+        if (!successfullyPrepared) 
+	        {
+	        // we can stop preparing the rest of the children
+	        // if one prepare failed (we won't be drawing anything 
+	        // anyway)
+	        
+	        // also if the prepare failed but there was not a leave,
+	        // we assume it was already handled 
+	        return EFalse;
+	        }
+        }
+    return ETrue;
+    }
+
+
+EXPORT_C void CHuiLayout::Draw(CHuiGc& aGc) const
+    {
+    if (Flags() & EHuiVisualFlagDrawOnlyAsExternalContent)
+    	{
+   	    // This is used only as external content visual. Return now if we are not currently drawing
+   	    // external content.
+    	if (!Display() || !Display()->RosterImpl().IsDrawingExternalContent())
+    		{
+			return;
+    		}
+    	}
+
+    if(iOpacity.Now() <= EPSILON && (Effect() && !Effect()->IsSemitransparent()))
+        {
+        // This will not be visible due to being completely transparent.
+        return;
+        }
+
+    if (( IsDelayedEffectSource()||Freezed() ) && StoredRenderBuffer())
+        {
+        DrawStoredBitmap(aGc);        
+        return;
+        }
+    if (!HasActiveChilderen() && !Brushes() && !Effect())
+        {
+        // No children, no brushes just return.
+        return;            
+        }
+    
+    
+    /** @todo  Wouldn't it be possible to just extend CHuiVisual::Draw()
+               instead of redefining the entire method? */
+
+    THuiRealRect area = DisplayRect();
+
+    // Apply local transformation.
+    EnterLocalProjection(aGc, ETrue, 0.f, &area);
+    Transform(aGc, ETrue, &area);
+
+    DrawBrushes(aGc, EHuiBrushLayerBackground);
+
+    if(Clipping())
+        {
+        // @todo  Clipping not going to work if there is a transformation?
+        // Layout clipping is not affected by transformation.
+        aGc.Enable(CHuiGc::EFeatureClipping);
+        aGc.PushClip();
+        aGc.Clip(area);
+        }
+
+    // Can we draw effect
+    TBool canUseEffectDrawing = Effect() && !LoadingEffect();
+
+    // Flag to know what we did
+    TBool didDrawEffect = EFalse;
+    
+    if (canUseEffectDrawing)
+        {
+        // Note that EHuiVisualFlagOpaqueHint improves performance a lot in cached effect drawing 
+        TBool transparent = !(Flags() & EHuiVisualFlagOpaqueHint) && iOpacity.Now() < 1.0f;
+        TBool refreshCache = Changed();                
+        didDrawEffect =  Effect()->CachedDraw(aGc, area, refreshCache, !transparent);
+        }
+    
+    if ( !didDrawEffect )
+        {
+        // huilayout does not draw itself, only children.
+        }
+    else
+        {
+        // Effect was drawn, OpenGLES/OpenVG may be in different state than what Gc thinks so we restore it.
+        aGc.RestoreState();        
+        }
+    
+    if ( !didDrawEffect || (didDrawEffect && !EffectIsAppliedToChildren()))
+        {
+        // The layout itself is invisible. Only its children can be seen.
+        TBool afterOthers = EFalse;
+        const TInt count = Count();
+        for(TInt i = 0; i < count; ++i)
+            {
+            CHuiVisual* visual = iHuiLayoutPrivateData->iChildren[i];
+            //Ignore inactive child visuals
+            if ( visual->Flags()& EHuiVisualFlagInactive )
+                {
+                continue; 
+                }
+            if(visual->Flags() & EHuiVisualFlagDrawAfterOthers)
+                {
+                afterOthers = ETrue;
+                continue;
+                }
+
+            // @todo  No need to draw children that won't be visible.
+            visual->Draw(aGc);
+            }       
+        if(afterOthers)
+            {
+            for(TInt i = 0; i < count; ++i)
+                {
+                if(iHuiLayoutPrivateData->iChildren[i]->Flags() & EHuiVisualFlagDrawAfterOthers)
+                    {
+                    iHuiLayoutPrivateData->iChildren[i]->Draw(aGc);        
+                    }
+                }
+            }
+        }
+
+
+    if(Clipping())
+        {
+        // Restore original clipping rectangle.
+        aGc.PopClip();
+        }
+
+
+    DrawBrushes(aGc, EHuiBrushLayerForeground);
+
+    // Restore original transformation.
+    Transform(aGc, EFalse);
+    EnterLocalProjection(aGc, EFalse);
+    }
+
+
+EXPORT_C void CHuiLayout::ReportChanged()
+    {
+    // Report changes in the layout itself.
+    CHuiVisual::ReportChanged();
+
+    // Notify the display that the visual's area should be redrawn.
+    CHuiDisplay* display = NULL;
+
+    // Select active display, fallback to own display.
+    // For scaled tv-out cloning the active display takes care of scaling direty areas too. 
+    if (iOwner && iOwner->Env().CurrentDisplay())
+        {
+        display = iOwner->Env().CurrentDisplay();    
+        }
+    else
+        {
+        display = Display();    
+        }
+
+    if (display && !display->IsDirtyScanNeeded())
+        {
+        return;    
+        }        
+
+    if (display && display->UseTransformedDirtyRegions())
+        {
+        THuiRealRect displayRect = DisplayRect();
+        EnterLocalProjection(*display->Gc(), ETrue, 0.f, &displayRect);
+        Transform(*display->Gc(), ETrue, &displayRect);
+        }
+
+        
+    TInt count = Count();
+    for(TInt i = 0; i < count; ++i)
+        {        
+        if (display && !display->IsDirtyScanNeeded())
+            {
+            break;    
+            }        
+        //Ignore inactive child visuals
+        if ( iHuiLayoutPrivateData->iChildren[i]->Flags()& EHuiVisualFlagInactive )
+        	{
+        	continue;
+        	}
+        iHuiLayoutPrivateData->iChildren[i]->ReportChanged();     
+        }
+        
+    if (display && display->UseTransformedDirtyRegions())
+        {
+        EnterLocalProjection(*display->Gc(), EFalse);
+        Transform(*display->Gc(), EFalse);                
+        }
+    }
+
+
+EXPORT_C TBool CHuiLayout::Changed() const
+    {
+    if(CHuiVisual::Changed())
+        {
+        return ETrue;
+        }
+    if(iHuiLayoutPrivateData->iScroll)
+        {
+        return iHuiLayoutPrivateData->iScroll->iOffset.Changed();
+        }
+    return EFalse;
+    }
+
+
+EXPORT_C void CHuiLayout::ClearChanged()
+    {
+    CHuiVisual::ClearChanged();
+    
+    // Clear the change flags of children as well.
+    TInt count = Count();
+    for(TInt i = 0; i < count; ++i)
+        {
+        if (Flags() & EHuiVisualFlagInactive)
+            {
+            // No need to clear inactive children
+            continue;
+            }
+        iHuiLayoutPrivateData->iChildren[i]->ClearChanged();
+        }
+        
+    if(iHuiLayoutPrivateData->iScroll)
+        {
+        iHuiLayoutPrivateData->iScroll->iOffset.ClearChanged();
+        }
+    }
+
+EXPORT_C void CHuiLayout::SetBaseUnit(const THuiMetric& aBaseUnit)
+    {
+    iHuiLayoutPrivateData->iBaseUnit.iX = aBaseUnit;
+    iHuiLayoutPrivateData->iBaseUnit.iY = aBaseUnit;
+    SetChanged();
+    }
+    
+EXPORT_C void CHuiLayout::SetBaseUnit(const THuiXYMetric& aBaseUnit)
+    {
+    iHuiLayoutPrivateData->iBaseUnit = aBaseUnit;
+    SetChanged();
+    }
+
+
+EXPORT_C THuiXYMetric CHuiLayout::BaseUnit() const
+    {
+    THuiXYMetric metric(iHuiLayoutPrivateData->iBaseUnit);
+    if((Flags() & EHuiVisualFlagAutomaticLocaleMirroringEnabled) && CHuiStatic::LayoutMirrored())
+        {
+        metric.iX.iMagnitude = -metric.iX.iMagnitude;
+        }
+    return metric;
+    }
+
+
+EXPORT_C void CHuiLayout::EnableScrollingL(TBool aScrolling)
+    {
+    if(iHuiLayoutPrivateData->iScroll && !aScrolling)
+        {
+        // Disable scrolling.
+        delete iHuiLayoutPrivateData->iScroll;
+        iHuiLayoutPrivateData->iScroll = NULL;
+        }
+    else if(!iHuiLayoutPrivateData->iScroll && aScrolling)
+        {
+        // Enable scrolling.
+        iHuiLayoutPrivateData->iScroll = new (ELeave) TScrollState();
+        }
+    else
+        {
+        // for PC lint
+        }
+    }
+
+
+EXPORT_C TBool CHuiLayout::Scrolling() const
+    {
+    return iHuiLayoutPrivateData->iScroll != 0;
+    }
+
+
+EXPORT_C THuiTimedPoint& CHuiLayout::ScrollOffset()
+    {
+    __ASSERT_ALWAYS(iHuiLayoutPrivateData->iScroll,
+                    THuiPanic::Panic(THuiPanic::ELayoutNotScrolling));
+    return iHuiLayoutPrivateData->iScroll->iOffset;
+    }
+
+
+EXPORT_C const THuiTimedPoint& CHuiLayout::ScrollOffset() const
+    {
+    __ASSERT_ALWAYS(iHuiLayoutPrivateData->iScroll,
+                    THuiPanic::Panic(THuiPanic::ELayoutNotScrolling));
+    return iHuiLayoutPrivateData->iScroll->iOffset;
+    }
+
+
+EXPORT_C void CHuiLayout::SetScrollOffsetInBaseUnits(const THuiRealPoint& aOffset, TInt aTransitionTime)
+    {
+    // Pass information directly to the scroll offset
+    ScrollOffset().Set(aOffset, aTransitionTime);
+    }
+
+
+EXPORT_C TSize CHuiLayout::VirtualSize() const
+    {
+    __ASSERT_ALWAYS(iHuiLayoutPrivateData->iScroll,
+                    THuiPanic::Panic(THuiPanic::ELayoutNotScrolling));
+    return iHuiLayoutPrivateData->iScroll->iVirtualSize;
+    }
+
+
+EXPORT_C TInt
+CHuiLayout::EffectiveLayoutOrdinal(const CHuiVisual& aVisual) const
+    {
+    TInt ordinal = 0;
+
+    TInt count = Count();
+    for(TInt i = 0; i < count; ++i)
+        {
+        if(iHuiLayoutPrivateData->iChildren[i] == &aVisual)
+            {
+            return ordinal;
+            }
+
+        // The visuals that are laid out completely manually do not affect
+        // the layout ordinal.
+        if((iHuiLayoutPrivateData->iChildren[i]->Flags() & EHuiVisualFlagManualLayout) !=
+           EHuiVisualFlagManualLayout)
+            {
+            ++ordinal;
+            }
+        }
+
+    THuiPanic::Panic(THuiPanic::ELayoutChildVisualNotFound);
+    return 0;
+    }
+
+
+EXPORT_C void CHuiLayout::Reorder(CHuiVisual& aVisual, TInt aPosition, TInt aLayoutTransitionTime)
+    {
+    TInt index = FindVisual(&aVisual);
+    if(index != aPosition)
+        {
+        __ASSERT_ALWAYS( aPosition >= 0 && aPosition < Count(),
+                         THuiPanic::Panic(THuiPanic::ELayoutInvalidChildPosition) );
+        __ASSERT_ALWAYS( index != KErrNotFound, 
+                         THuiPanic::Panic(THuiPanic::ELayoutChildVisualNotFound) );
+
+        // Move the children around in the array, so that aVisual ends up
+        // at aPosition.
+        TInt dir = (aPosition > index? +1 : -1);
+        for(TInt i = index; i != aPosition; i += dir)
+            {
+            iHuiLayoutPrivateData->iChildren[i] = iHuiLayoutPrivateData->iChildren[i + dir];
+            }
+        iHuiLayoutPrivateData->iChildren[aPosition] = &aVisual;        
+        SetChanged();
+        }
+
+    if(!(Flags() & EHuiVisualFlagFreezeLayout))
+        {
+        UpdateChildrenLayout(aLayoutTransitionTime);
+        }    
+    }
+
+
+EXPORT_C void CHuiLayout::MoveVisualToFront(CHuiVisual& aVisual, TInt aLayoutTransitionTime)
+    {
+    Reorder(aVisual, Count() - 1, aLayoutTransitionTime);
+    }
+
+
+EXPORT_C void CHuiLayout::MoveVisualToBack(CHuiVisual& aVisual, TInt aLayoutTransitionTime)
+    {
+    Reorder(aVisual, 0, aLayoutTransitionTime);
+    }
+
+
+EXPORT_C void CHuiLayout::DumpTree() const
+    {
+    // Dump children.
+    TBuf<100> myName;
+    TBuf<100> childName;
+
+    CHuiVisual::DumpTree();
+
+    GetInstanceName(myName);
+
+    TInt count = Count();
+    for(TInt i = 0; i < count; ++i)
+        {
+        iHuiLayoutPrivateData->iChildren[i]->GetInstanceName(childName);
+        CHuiStatic::Printf(_L("%S -> %S;"), &myName, &childName);
+
+        iHuiLayoutPrivateData->iChildren[i]->DumpTree();
+        }
+    }
+
+
+EXPORT_C void CHuiLayout::NotifySkinChangedL()
+    {
+    TInt count = Count();
+    for(TInt i = 0; i < count; ++i)
+        {
+        //Ignore inactive child visuals
+        if ( iHuiLayoutPrivateData->iChildren[i]->Flags()& EHuiVisualFlagInactive )
+        	{
+        	continue; 
+        	}
+        iHuiLayoutPrivateData->iChildren[i]->NotifySkinChangedL();
+        }
+    }
+
+
+EXPORT_C CHuiVisual* CHuiLayout::FindTag(const TDesC8& aTag)
+    {
+    // Check self first.
+    CHuiVisual* result = CHuiVisual::FindTag(aTag);
+    if(result)
+        {
+        return result;
+        }
+
+    // Check children.
+    TInt i;
+    TInt count = Count();
+    for(i = 0; i < count; ++i)
+        {
+        result = iHuiLayoutPrivateData->iChildren[i]->FindTag(aTag);
+        if(result)
+            {
+            return result;
+            }
+        }
+
+    // Could not find it.
+    return NULL;
+    }
+
+
+EXPORT_C void CHuiLayout::SetTransitionTime(TInt aTransitionTime)
+    {
+    iHuiLayoutPrivateData->iTransitionTime = aTransitionTime;
+    }
+
+
+EXPORT_C TInt CHuiLayout::TransitionTime() const
+    {
+    return iHuiLayoutPrivateData->iTransitionTime;
+    }
+
+EXPORT_C THuiRealPoint CHuiLayout::MetricReferenceForLayoutInPixels(const CHuiLayout* /*aLayout*/, const THuiXYMetric& aMetric) const __SOFTFP
+    {
+    return MetricReferenceForLayoutInPixels(aMetric);
+    }
+    
+/*
+ * can be used by a layout to convert a pixel value into
+ * its own units as if from a child visual's frame of reference
+ *
+ * @todo this needs refactoring with CHuiVisual::MetricReferenceInPixels
+ */
+EXPORT_C THuiRealPoint CHuiLayout::MetricReferenceForLayoutInPixels(const THuiXYMetric& aMetric) const __SOFTFP
+    {
+    THuiRealPoint refSizePx(0.f, 0.f);
+    
+    // if weights are used in this context, treat them as normalized units
+    TInt xUnit = (aMetric.iX.iUnit == EHuiUnitWeight) ? EHuiUnitNormalized : aMetric.iX.iUnit;
+    TInt yUnit = (aMetric.iY.iUnit == EHuiUnitWeight) ? EHuiUnitNormalized : aMetric.iY.iUnit;
+    
+    // For normalized units, the reference is the parent size in pixels.
+    if(xUnit == EHuiUnitNormalized || yUnit == EHuiUnitNormalized ||
+       xUnit == EHuiUnitParentWidth || yUnit == EHuiUnitParentWidth ||
+       xUnit == EHuiUnitParentHeight || yUnit == EHuiUnitParentHeight)        
+        {
+        THuiRealPoint sizePx(0.f, 0.f);
+        
+        // Determine the size of this layout in pixels.
+        if(Layout())
+            {
+            // Recursive fun. We don't want to do this more than once.
+            // (LocalPointInPixels => MetricsToPixels => MetricReferenceInPixels => LocalPointInPixels)
+            sizePx = LocalPointInPixels(Size().RealTarget(), EHuiReferenceStateTarget);
+            }
+        else if(Display())
+            {
+            // @todo Jaakko please code review this change!
+//            sizePx = Display()->Size().AsPoint();
+            sizePx = Display()->VisibleArea().Size().AsPoint();
+            }
+        else
+            {
+            // For PC-lint
+            }
+            
+        if(xUnit == EHuiUnitNormalized || xUnit == EHuiUnitParentWidth)
+            {
+            refSizePx.iX = sizePx.iX;
+            }
+        else if(xUnit == EHuiUnitParentHeight)
+            {
+            refSizePx.iX = sizePx.iY;
+            }
+        else
+            {
+            // For PC-lint
+            }
+
+        if(yUnit == EHuiUnitNormalized || yUnit == EHuiUnitParentHeight)
+            {
+            refSizePx.iY = sizePx.iY;
+            }
+        else if(yUnit == EHuiUnitParentWidth)
+            {
+            refSizePx.iY = sizePx.iX;
+            }
+        else
+            {
+            // For PC-lint
+            }
+        }
+
+    // Display-relative units are always relative to the display where the visual is on.
+    if(xUnit == EHuiUnitRelativeToDisplay && Display())
+        {
+        refSizePx.iX = Display()->VisibleArea().Width();
+        }
+    if(yUnit == EHuiUnitRelativeToDisplay && Display())
+        {
+        refSizePx.iY = Display()->VisibleArea().Height();
+        }        
+        
+    // For relative to my size units, the reference is the size of this visual in pixels.
+    if(xUnit == EHuiUnitRelativeToMySize || yUnit == EHuiUnitRelativeToMySize ||
+        xUnit == EHuiUnitMyWidth || yUnit == EHuiUnitMyWidth ||
+        xUnit == EHuiUnitMyHeight || yUnit == EHuiUnitMyHeight ||
+        xUnit == EHuiUnitMyDimensionAverage || yUnit == EHuiUnitMyDimensionAverage)
+        {
+        THuiRealPoint sizePx(0.f, 0.f);
+        if(Layout())
+            {
+            // Recursive fun. We don't want to do this more than once.
+            // (MetricsToPixels => MetricReferenceInPixels)
+            sizePx = MetricToPixels(LocalBaseUnit().Abs() * Size().RealTarget(), EHuiReferenceStateTarget);
+            }
+        else if(Display())
+            {
+            sizePx = Display()->VisibleArea().Size().AsPoint();
+            }
+        else
+            {
+            // For PC-lint
+            }
+        
+        if(xUnit == EHuiUnitRelativeToMySize || xUnit == EHuiUnitMyWidth)
+            {
+            refSizePx.iX = sizePx.iX;
+            }
+        else if(xUnit == EHuiUnitMyHeight)
+            {
+            refSizePx.iX = sizePx.iY;
+            }
+        else
+            {
+            // For PC-lint
+            }
+        
+        if(yUnit == EHuiUnitRelativeToMySize || yUnit == EHuiUnitMyHeight)
+            {
+            refSizePx.iY = sizePx.iY;
+            }
+        else if(yUnit == EHuiUnitMyWidth)
+            {
+            refSizePx.iY = sizePx.iX;
+            }
+        else
+            {
+            // For PC-lint
+            }
+
+        if( xUnit == EHuiUnitMyDimensionAverage ||
+      	    yUnit == EHuiUnitMyDimensionAverage )
+            {
+            TReal32 average = (sizePx.iX + sizePx.iY) / 2;
+            if(xUnit == EHuiUnitMyDimensionAverage)
+      	        {
+                refSizePx.iX = average;
+                }
+            if(yUnit == EHuiUnitMyDimensionAverage)
+                {           
+                refSizePx.iY = average;
+                }
+            }
+        }
+                
+    // S60 platform units are specific to the display where the visual is on.
+    if(xUnit == EHuiUnitS60 && Display())
+        {
+        refSizePx.iX = Display()->UnitValue();
+        }
+    if(yUnit == EHuiUnitS60 && Display())
+        {
+        refSizePx.iY = Display()->UnitValue();
+        }
+
+    return refSizePx;        
+    }
+   
+EXPORT_C void CHuiLayout::ExpandRectWithContent(TRect& aRect) const
+    {
+    // Expand with scroll offset
+    if ( iHuiLayoutPrivateData->iScroll )
+        {
+        const TPoint scrollOffset = LocalPointInPixels(iHuiLayoutPrivateData->iScroll->iOffset.RealNow(), EHuiReferenceStateNow );
+        if ( scrollOffset.iX > 0 )
+            {
+            aRect.iTl.iX -= scrollOffset.iX;
+            }
+        if ( scrollOffset.iX < 0 )
+            {
+            aRect.iBr.iX -= scrollOffset.iX;
+            }
+        if ( scrollOffset.iY > 0 )
+            {
+            aRect.iTl.iY -= scrollOffset.iY;
+            }
+        if ( scrollOffset.iY < 0 )
+            {
+            aRect.iBr.iY -= scrollOffset.iY;
+            }
+        }
+    
+    CHuiVisual::ExpandRectWithContent( aRect );
+    }
+
+EXPORT_C void CHuiLayout::VisualExtension(const TUid& aExtensionUid, TAny** aExtensionParams)
+    {
+    CHuiVisual::VisualExtension(aExtensionUid, aExtensionParams);
+    }
+
+EXPORT_C void CHuiLayout::SetPos(const THuiRealPoint& aPos, TInt aTransitionTime)
+    {
+    CHuiVisual::SetPos(aPos,aTransitionTime);
+    }
+
+void CHuiLayout::DrawStoredBitmap(CHuiGc &aGc) const
+    {
+    if (!Display()) return;
+    CHuiCanvasGc& gc = *iHuiLayoutPrivateData->iGc;
+    gc.SetGc(aGc);
+    gc.SetDefaults();
+    gc.PushTransformationMatrix();
+    
+    //TInt w = displayArea.Width();
+    TRect displayArea = Display()->VisibleArea();
+    TInt h = displayArea.Height();
+
+    // Pixels are upside down in OpenVG canvas render buffer
+    if (CHuiStatic::Env().Renderer() == EHuiRendererVg10)
+        {
+        TInt height = h;
+        //if (relativeOrientation == CHuiGc::EOrientationCW90 || relativeOrientation == CHuiGc::EOrientationCCW90)
+        //    {
+        //    height = w;    
+        //    }            
+        gc.Translate(0.0f, height, 0.0f);            
+        gc.Scale(1.f, -1.f, 1.f);
+        }
+    
+    THuiRealPoint dest_point = DisplayRect().iTl;
+    CHuiCanvasRenderBuffer *stored = StoredRenderBuffer();
+    gc.DrawImage(*stored, dest_point); 
+
+    gc.PopTransformationMatrix();
+
+    }
+
+EXPORT_C void CHuiLayout::DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect) const
+    {
+    if (( IsDelayedEffectSource()||Freezed() ) && StoredRenderBuffer())
+        {
+        DrawStoredBitmap(aGc);        
+        return;
+        }
+
+    if( Effect() && EffectIsAppliedToChildren() )
+        {
+        // The layout itself is invisible. Only its children can be seen.
+        TBool afterOthers = EFalse;
+        const TInt count = Count();
+        for(TInt i = 0; i < count; ++i)
+            {
+            CHuiVisual* visual = iHuiLayoutPrivateData->iChildren[i];
+            //Ignore inactive child visuals
+            if ( visual->Flags()& EHuiVisualFlagInactive )
+                {
+                continue; 
+                }
+            if(visual->Flags() & EHuiVisualFlagDrawAfterOthers)
+                {
+                afterOthers = ETrue;
+                continue;
+                }
+                
+            // @todo  No need to draw children that won't be visible.
+            visual->Draw(aGc);
+            }       
+        if(afterOthers)
+            {
+            for(TInt i = 0; i < count; ++i)
+                {
+                if(iHuiLayoutPrivateData->iChildren[i]->Flags() & EHuiVisualFlagDrawAfterOthers)
+                    {
+                    iHuiLayoutPrivateData->iChildren[i]->Draw(aGc);        
+                    }
+                }
+            }
+        }
+    else
+        {
+        CHuiVisual::DrawSelf(aGc, aDisplayRect);
+        }
+    }
+
+EXPORT_C TReal32 CHuiLayout::BrushOpacity() const __SOFTFP
+    {
+    return CHuiVisual::BrushOpacity();
+    }
+
+EXPORT_C THuiRealRect CHuiLayout::BrushRect() const __SOFTFP
+    {
+    return CHuiVisual::BrushRect();
+    }
+
+
+EXPORT_C CHuiSkin& CHuiLayout::BrushSkin() const
+    {
+    return CHuiVisual::BrushSkin();
+    }
+
+HUI_SESSION_OBJECT_IMPL_EXPORT(CHuiLayout, ETypeVisual)
+
+EXPORT_C void CHuiLayout::GetInstanceName(TDes& aName) const
+    {
+    CHuiVisual::GetInstanceName(aName);
+    }
+
+
+EXPORT_C void CHuiLayout::GetClassName(TDes& aName) const
+    {
+    aName = _L("CHuiLayout");
+    }
+
+TBool CHuiLayout::HasActiveChilderen() const
+    {
+    TBool hasActiveChildren = EFalse;
+    const TInt count = Count();
+    for(TInt i = 0; i < count; ++i)
+        {
+        CHuiVisual* visual = iHuiLayoutPrivateData->iChildren[i];
+        if (!(visual->Flags()& EHuiVisualFlagInactive ))
+            {
+            hasActiveChildren = ETrue;
+            break;
+            }
+        }    
+    return hasActiveChildren;    
+    }
+
+TBool CHuiLayout::EffectIsAppliedToChildren() const
+    {
+    if (Effect() && !LoadingEffect() && !(Effect()->EffectFlags() & KHuiFxEffectExcludeChildrenFlag))
+        {
+        return ETrue;
+        }
+    else
+        {
+        return EFalse;
+        }    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiLineVisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,262 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiLineVisual, Visual that is able to draw 
+*                lines onto a curve path.
+*
+*/
+
+
+
+#include "uiacceltk/HuiLineVisual.h"  // Class definition
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiDrawing.h"
+#include "uiacceltk/HuiUtil.h"
+
+
+EXPORT_C CHuiLineVisual* CHuiLineVisual::AddNewL(CHuiControl& aOwnerControl,
+                                                 CHuiLayout* aParentLayout)
+    {
+    CHuiLineVisual* line = STATIC_CAST(CHuiLineVisual*,
+        aOwnerControl.AppendVisualL(EHuiVisualTypeLine, aParentLayout));
+    return line;
+    }
+
+
+CHuiLineVisual::CHuiLineVisual(MHuiVisualOwner& aOwner)
+        : CHuiVisual(aOwner), iColor(KRgbWhite)
+    {
+    iThickness.Set(12.f);
+    iEndPos.Set(1.f);
+    }
+
+
+void CHuiLineVisual::ConstructL()
+    {
+    CHuiVisual::ConstructL();
+    
+    // Use the default line texture by default.
+    iImage = THuiImage(Env().Skin().TextureL(EHuiSkinLineTexture));
+    }
+
+
+CHuiLineVisual::~CHuiLineVisual()
+    {
+    iAlphaFunction = NULL;
+    iWidthFunction = NULL;
+    }
+
+
+/*EXPORT_C void CHuiLineVisual::LayoutToPath()
+    {
+    TRect bounds(TPoint(0, 0), TSize(1, 1));
+
+    for(TInt i = 0; i < iPath.Count(); ++i)
+        {
+        bounds.BoundingRect(TRect(iPath[i].iPoint, TSize(1, 1)));
+        }
+
+    SetSize(bounds.Size());
+    }*/
+
+
+EXPORT_C void CHuiLineVisual::SetPath(CHuiCurvePath* aPath,
+                                      THuiOwnership aOwnership)
+    {
+    iPath.Set(aPath, aOwnership);
+    SetChanged();
+    }
+
+
+EXPORT_C CHuiCurvePath& CHuiLineVisual::Path()
+    {
+    SetChanged();
+    return iPath.Ref();
+    }
+
+
+void CHuiLineVisual::DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect) const
+    {
+    if(!iPath.Ptr())
+        {
+        // If the path is empty, ie has no data, return without drawing anything.
+        return;
+        }
+
+    aGc.Enable(CHuiGc::EFeatureBlending);
+    aGc.SetPenAlpha(TInt(EffectiveOpacity() * 255));
+    aGc.SetPenColor(iColor);
+
+    // By default, use the current thickness for the entire path.
+    if ( !HuiUtil::RealCompare( iDefaultWidthFunction.iValue, iThickness.Now() ) )
+        {
+        iPath.NonConstRef().SetNeedsUpdate();
+        iDefaultWidthFunction.iValue = iThickness.Now();
+        }
+
+	aGc.Enable(CHuiGc::EFeatureTexturing);
+	if(iImage.HasTexture())
+		{
+		iImage.Texture().Bind();
+		}
+
+    iPath->SetVisual(this);
+    aGc.DrawPath(iPath.Ref(), aDisplayRect.iTl,
+                 iStartPos.Now(), iEndPos.Now(),
+                 iAlphaFunction,
+                 iWidthFunction == 0? &iDefaultWidthFunction : 0);
+    iPath->SetVisual(NULL);
+    }
+
+
+TBool CHuiLineVisual::Changed() const
+    {
+    if(CHuiVisual::Changed())
+        {
+        return ETrue;
+        }
+
+    return iThickness.Changed() || iShadowThickness.Changed() ||
+           iStartPos.Changed() || iEndPos.Changed() || iImage.Changed();
+    }
+
+
+void CHuiLineVisual::ClearChanged()
+    {
+    CHuiVisual::ClearChanged();
+    iThickness.ClearChanged();
+    iShadowThickness.ClearChanged();
+    iStartPos.ClearChanged();
+    iEndPos.ClearChanged();
+    iImage.ClearChanged();
+    }
+
+
+EXPORT_C void CHuiLineVisual::SetImage(const THuiImage& aImage)
+    {
+    iImage = aImage;
+    SetChanged();
+    }
+
+
+EXPORT_C void CHuiLineVisual::SetAlphaFunction(MHuiMappingFunction* aFunction)
+    {
+    iAlphaFunction = aFunction;
+    SetChanged();
+    }
+
+
+EXPORT_C void CHuiLineVisual::SetWidthFunction(MHuiMappingFunction* aFunction)
+    {
+    iWidthFunction = aFunction;
+    SetChanged();
+    }
+    
+EXPORT_C void CHuiLineVisual::SetColor(const TRgb& aColor)
+    {
+	iColor = aColor;
+    SetChanged();
+    }
+    
+
+void CHuiLineVisual::ExpandRectWithContent(TRect& aRect) const
+    {
+    if(!iPath.Ptr())
+        {
+        // If the path is empty, ie has no data, return directly
+        return;
+        }
+    
+    const TInt segmentCount = iPath->SegmentCount();    
+    if(!Clipping() && segmentCount)
+        {
+            
+        // calculate each segment
+        THuiRealRect segmentsCoverRectInMetrics;
+        for ( TInt i = 0 ; i < segmentCount ; i++ )
+            {
+            const CHuiCurvePath::TSegment segment = iPath->Segment(i);
+            THuiRealRect segmentAreaInMetrics;
+            
+            if ( segment.iType == CHuiCurvePath::ESegmentTypeLine )
+                {
+                segmentAreaInMetrics = THuiRealRect( 
+                    THuiRealPoint( segment.iOrigin.iX,segment.iOrigin.iY ),
+                    THuiRealSize( segment.iDelta.AsSize().iWidth, segment.iDelta.AsSize().iHeight ) );
+                }
+            else // ESegmentTypeArc
+                {
+                segmentAreaInMetrics = THuiRealRect( 
+                    THuiRealPoint( 
+                        segment.iOrigin.iX - segment.iDelta.AsSize().iWidth,
+                        segment.iOrigin.iY - segment.iDelta.AsSize().iHeight ),
+                    THuiRealPoint( 
+                        segment.iOrigin.iX + segment.iDelta.AsSize().iWidth,
+                        segment.iOrigin.iY + segment.iDelta.AsSize().iHeight ));        
+                }
+               
+            if ( i == 0 )
+                {
+                // first rect
+                segmentsCoverRectInMetrics = segmentAreaInMetrics;
+                }
+            else
+                {
+                // append to previous rect combination
+                segmentsCoverRectInMetrics.BoundingRect( segmentAreaInMetrics );
+                }
+            }
+        
+        // Change metrics to pixels
+        THuiRealRect segmentsCoverRectInPixels( 
+            LocalPointInPixels( segmentsCoverRectInMetrics.iTl ),
+            LocalPointInPixels( segmentsCoverRectInMetrics.iBr ) );
+        
+        // check that both height and width != zero    
+        if ( !HuiUtil::RealCompare( segmentsCoverRectInPixels.Height(), 0.f ) && 
+             !HuiUtil::RealCompare( segmentsCoverRectInPixels.Width(), 0.f ) )
+            {
+            // move by offset: assume that iOffset is in pixels
+            const THuiRealPoint offsetNowInPixels = iPath->iOffset.Now();
+            segmentsCoverRectInPixels.Move( offsetNowInPixels.iX,offsetNowInPixels.iY);
+            
+            // move into relation of the visual area (aRect in pixels)
+            segmentsCoverRectInPixels.Move( aRect.iTl.iX, aRect.iTl.iY );
+            
+            // add the thickness
+            THuiRealSize thicknessInPixels = LocalPointInPixels(THuiRealPoint( iThickness.Now()/2.f, iThickness.Now()/2.f )).AsSize();
+            
+            // Take the average of the x and y dimensions - what would be the correct behaviour?
+            const TInt averageThincknessInPixels = 
+                HUI_ROUND_FLOAT_TO_INT( (
+                    thicknessInPixels.iWidth + 
+                    thicknessInPixels.iHeight
+                    )/2.f );
+  
+            segmentsCoverRectInPixels.Grow( averageThincknessInPixels, averageThincknessInPixels );
+            
+            // Finally round to TRect
+            const TRect finalSegmentsCoverArea(
+                HUI_ROUND_FLOAT_TO_INT(segmentsCoverRectInPixels.iTl.iX),
+                HUI_ROUND_FLOAT_TO_INT(segmentsCoverRectInPixels.iTl.iY),
+                HUI_ROUND_FLOAT_TO_INT(segmentsCoverRectInPixels.iBr.iX),
+                HUI_ROUND_FLOAT_TO_INT(segmentsCoverRectInPixels.iBr.iY) );
+                
+            // combine the calculated segment area and the 
+            aRect.BoundingRect(finalSegmentsCoverArea);
+            }
+        }
+        
+    CHuiVisual::ExpandRectWithContent(aRect);
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiMappingFunctions.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "uiacceltk/HuiMappingFunctions.h"
+#include "uiacceltk/huifixmath.h"
+
+
+EXPORT_C
+THuiConstantMappingFunction::THuiConstantMappingFunction(TReal32 aValue) __SOFTFP
+        : iValue(aValue)
+    {
+    }
+    
+    
+EXPORT_C TReal32 THuiConstantMappingFunction::MapValue(TReal32 /*aValue*/, 
+                                                     TInt /*aComponent*/) const __SOFTFP
+    {
+    return iValue;
+    }
+
+
+
+EXPORT_C THuiLinearMappingFunction::THuiLinearMappingFunction(TReal32 aFactor, TReal32 aOffset) __SOFTFP
+        : iFactor(aFactor), iOffset(aOffset)
+    {
+    }
+    
+
+EXPORT_C TReal32 THuiLinearMappingFunction::MapValue(TReal32 aValue, TInt /*aComponent*/) const __SOFTFP
+    {
+    return aValue * iFactor + iOffset;
+    }
+
+
+EXPORT_C 
+THuiSineMappingFunction::THuiSineMappingFunction(TReal32 aFactor, TReal32 aOffset) __SOFTFP
+        : iFactor(aFactor), iOffset(aOffset)
+    {
+    }
+
+
+EXPORT_C TReal32 THuiSineMappingFunction::MapValue(TReal32 aValue, TInt /*aComponent*/) const __SOFTFP
+    {
+    TReal32 mapped = HuiFixMath::FixToFloat(HuiFixMath::FixSin(HuiFixMath::FloatToFix(aValue)));
+    return mapped * iFactor + iOffset;
+    }
+
+
+EXPORT_C 
+THuiCosineMappingFunction::THuiCosineMappingFunction(TReal32 aFactor, TReal32 aOffset) __SOFTFP
+        : iFactor(aFactor), iOffset(aOffset)
+    {
+    }
+
+
+EXPORT_C TReal32 THuiCosineMappingFunction::MapValue(TReal32 aValue, TInt /*aComponent*/) const __SOFTFP
+    { 
+    TReal32 mapped = HuiFixMath::FixToFloat(HuiFixMath::FixCos(HuiFixMath::FloatToFix(aValue)));
+    return mapped * iFactor + iOffset;
+    }
+
+
+EXPORT_C
+THuiAverageMappingFunction::THuiAverageMappingFunction(MHuiMappingFunction* aFunc1, 
+                                                       MHuiMappingFunction* aFunc2)
+        : iFunc1(aFunc1), iFunc2(aFunc2), iFactor(0.5f),
+          iWeight( 0.5f ) // Balance between the functions.
+    {
+    }
+    
+
+EXPORT_C TReal32 THuiAverageMappingFunction::MapValue(TReal32 aValue, TInt aComponent) const __SOFTFP
+    {
+    TReal32 value = 0;
+    TReal32 weight = iWeight.Now();
+    
+    if(iFunc1)
+        {
+        value += 2 * (1 - weight) * iFunc1->MapValue(aValue, aComponent);
+        }
+    if(iFunc2)
+        {
+        value += 2 * weight * iFunc2->MapValue(aValue, aComponent);
+        }
+
+    return value * iFactor.Now();
+    }
+
+
+EXPORT_C TBool THuiAverageMappingFunction::MappingFunctionChanged() const
+    {
+    return (iFunc1 && iFunc1->MappingFunctionChanged() ||
+            iFunc2 && iFunc2->MappingFunctionChanged() ||
+            iFactor.Changed() || iWeight.Changed());
+    }
+
+
+EXPORT_C void THuiAverageMappingFunction::MappingFunctionClearChanged()
+    {
+    if(iFunc1)
+        {
+        iFunc1->MappingFunctionClearChanged();
+        }
+    if(iFunc2)
+        {
+        iFunc2->MappingFunctionClearChanged();
+        }
+    iFactor.ClearChanged();
+    iWeight.ClearChanged();  
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiMaterial.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "uiacceltk/HuiMaterial.h"
+
+
+EXPORT_C THuiMaterial::THuiMaterial()
+        : iPreset(EHuiMaterialCustom), iColor(KRgbWhite), iSpecular( 1.f )
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiMatrixStack.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,194 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiMatrixStack. CHuiMatrixStack is a stack 
+*                of 2D transformation matrices.
+*
+*/
+
+
+
+#include "HuiMatrixStack.h"
+#include "uiacceltk/HuiPanic.h"
+
+
+EXPORT_C CHuiMatrixStack::TMatrix::TMatrix()
+        : iIsIdentity(ETrue)
+    {
+    // First column.
+    iMatrix[0] = 1;
+    iMatrix[1] = 0;
+    iMatrix[2] = 0;
+
+    // Second column.
+    iMatrix[3] = 0;
+    iMatrix[4] = 1;
+    iMatrix[5] = 0;
+
+    // Third column.
+    iMatrix[6] = 0;
+    iMatrix[7] = 0;
+    iMatrix[8] = 1;
+    }
+
+#define HUI_MATRIX_INDEX(aRow, aColumn) (aColumn*3 + aRow)
+
+void CHuiMatrixStack::TMatrix::Multiply(const TMatrix& aOther)
+    {
+    TMatrix result;
+
+    // Clear the result.
+    Mem::FillZ(result.iMatrix, sizeof(result.iMatrix));
+
+    // It could still be an identity matrix, but probably not.
+    result.iIsIdentity = EFalse;
+
+    for(TInt i = 0; i < 3; ++i) // Row.
+        {
+        for(TInt j = 0; j < 3; ++j) // Column.
+            {
+            for(TInt k = 0; k < 3; ++k)
+                {
+                result.iMatrix[ HUI_MATRIX_INDEX(i, j) ] +=
+                    iMatrix[ HUI_MATRIX_INDEX(i, k) ] * aOther.iMatrix[ HUI_MATRIX_INDEX(k, j) ];
+
+                }
+            }
+        }
+
+    *this = result;
+    }
+
+
+EXPORT_C void CHuiMatrixStack::TMatrix::Multiply(THuiRealPoint& aPoint) const
+    {
+    if(iIsIdentity)
+        {
+        // No need to do anything.
+        return;
+        }
+
+    TReal32 wPoint[3] =
+        {
+        aPoint.iX,
+        aPoint.iY,
+        1.0f
+        };
+    TReal32 result[3] =
+        {
+        0, 0, 0
+        };
+
+    for(TInt i = 0; i < 3; ++i)
+        {
+        for(TInt j = 0; j < 3; ++j)
+            {
+            result[i] += wPoint[j] * iMatrix[ HUI_MATRIX_INDEX(i, j) ];
+            }
+        }
+
+    if(result[2] != 0)
+        {
+        // Normalize.
+        result[0] /= result[2];
+        result[1] /= result[2];
+        }
+    else
+        {
+        // Completely zero.
+        result[0] = 0;
+        result[1] = 0;
+        }
+
+    aPoint.iX = result[0];
+    aPoint.iY = result[1];
+    }
+
+
+EXPORT_C CHuiMatrixStack* CHuiMatrixStack::NewL()
+    {
+    CHuiMatrixStack* self = CHuiMatrixStack::NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+    
+CHuiMatrixStack* CHuiMatrixStack::NewLC()
+    {
+    CHuiMatrixStack* self = new (ELeave) CHuiMatrixStack();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+    
+    
+CHuiMatrixStack::~CHuiMatrixStack()
+    {
+    iStack.Close();    
+    }
+    
+
+CHuiMatrixStack::CHuiMatrixStack()
+    {
+    }
+    
+    
+void CHuiMatrixStack::ConstructL()
+    {
+    // Append one identity matrix as the default contents of the stack.
+    User::LeaveIfError( iStack.Append(TMatrix()) );
+    }
+
+
+EXPORT_C TInt CHuiMatrixStack::Count() const
+    {
+    return iStack.Count();
+    }
+
+
+EXPORT_C CHuiMatrixStack::TMatrix& CHuiMatrixStack::Current()
+    {
+    // There is always at least one matrix in the stack.
+    return iStack[iStack.Count() - 1];
+    }
+
+
+EXPORT_C TInt CHuiMatrixStack::Push()
+    {
+    // Make a copy of the topmost item.
+    return iStack.Append(Current());
+    }
+
+
+EXPORT_C void CHuiMatrixStack::Pop()
+    {
+    if(iStack.Count() <= 1)
+        {
+        // Invalid operation.
+        THuiPanic::Panic(THuiPanic::EMatrixStackPopFromEmpty);
+        }
+
+    iStack.Remove(iStack.Count() - 1);
+    }
+      
+
+EXPORT_C void CHuiMatrixStack::LoadIdentity()
+    {
+    Current() = TMatrix();
+    }    
+
+
+EXPORT_C void CHuiMatrixStack::Multiply(const TMatrix& aMatrix)
+    {
+    Current().Multiply(aMatrix);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiMesh.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,113 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "uiacceltk/HuiMesh.h"
+#include "uiacceltk/HuiStatic.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiProbe.h"
+#include "uiacceltk/HuiUtil.h"
+
+
+EXPORT_C CHuiMesh* CHuiMesh::NewL(THuiMeshType aMeshType)
+    {
+    CHuiMesh* self = CHuiMesh::NewLC(aMeshType);
+    CleanupStack::Pop(self);
+    return self;
+    }
+    
+EXPORT_C CHuiMesh* CHuiMesh::NewLC(THuiMeshType aMeshType)
+    {
+    CHuiMesh* self = CHuiStatic::Renderer().CreateMeshL(aMeshType);
+    CleanupStack::PushL(self);
+    return self;
+    }
+
+
+CHuiMesh::CHuiMesh(THuiMeshType aMeshType)
+    : iMeshType(aMeshType)
+    {
+    HUI_PROBE_ASSOCIATE_WITH_CURRENT_SESSION
+    HUI_PROBE_REPORT_CONSTRUCTED
+    }
+
+EXPORT_C CHuiMesh::~CHuiMesh()
+    {
+    HUI_PROBE_REPORT_DESTRUCTED
+    }
+    
+    
+EXPORT_C THuiMeshType CHuiMesh::MeshType() const
+	{
+	return iMeshType;
+	}
+
+
+EXPORT_C void CHuiMesh::Reset()
+    {
+    }
+
+
+EXPORT_C void CHuiMesh::StretchUniformly(TReal32 /*aXLimit*/, TReal32 /*aXOffset*/, 
+                                         TReal32 /*aYLimit*/, TReal32 /*aYOffset*/,
+                                         TReal32 /*aZLimit*/, TReal32 /*aZOffset*/) __SOFTFP
+    {
+    }
+
+
+EXPORT_C void CHuiMesh::ScaleUniformly(TReal32 /*aX*/, TReal32 /*aY*/, TReal32 /*aZ*/) __SOFTFP
+    {
+    }
+
+
+void CHuiMesh::Draw(CHuiGc& /*aGc*/, const THuiImage* /*aImage*/, 
+                    const THuiImage* /*aSecondaryImage*/,
+                    TReal32 /*aSecondaryAlpha*/) const __SOFTFP
+    {
+    }
+
+EXPORT_C TInt CHuiMesh::AnimationControllerCount() const
+	{
+	return 0;
+	}
+		
+EXPORT_C void CHuiMesh::SetAnimationPosition(TInt /*aControllerId*/, TReal32 /*aTraget*/, TInt /*aTime*/) __SOFTFP
+	{		
+	}
+	
+// ---------------------------------------------------------------------------
+// Start animation of the controller
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CHuiMesh::StartAnimationController(TInt /*aControllerId*/)
+	{	
+	}
+
+// ---------------------------------------------------------------------------
+// Stop animation of the controller
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CHuiMesh::StopAnimationController(TInt /*aControllerId*/)
+	{	
+	}
+	
+	
+
+HUI_SESSION_OBJECT_IMPL_EXPORT(CHuiMesh, ETypeMesh)
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiMeshVisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,318 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiMeshVisual. CHuiMeshVisual is a visual
+*                that is able to display a 3D triangle mesh.
+*
+*/
+
+
+
+#include "uiacceltk/HuiMeshVisual.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiMesh.h" // only OpenGL ES supported
+#include "uiacceltk/huim3gmesh.h"
+#include "uiacceltk/huiproceduralmesh.h"
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiTexture.h"
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiVisual.h"
+
+EXPORT_C CHuiMeshVisual* CHuiMeshVisual::AddNewL(CHuiControl& aOwnerControl,
+												 THuiMeshType aMeshType,
+                                                 CHuiLayout* aParentLayout)
+    {
+    CHuiMeshVisual* mesh = STATIC_CAST(CHuiMeshVisual*,
+        aOwnerControl.AppendVisualL(EHuiVisualTypeMesh, aParentLayout));
+        
+	mesh->CreateMeshL(aMeshType);
+                
+    return mesh;
+    }
+
+
+CHuiMeshVisual::CHuiMeshVisual(MHuiVisualOwner& aOwner)
+        : CHuiVisual(aOwner)
+    {
+    }
+
+
+void CHuiMeshVisual::ConstructL()
+    {
+    CHuiVisual::ConstructL();
+    
+    CreateMeshL(EHuiMeshTypeProcedural);
+    
+    iSecondaryAlpha.SetStyle(EHuiTimedValueStyleLinear);
+
+    iScale.Set(1.f);
+
+    // Meshes use 3D projection by default.
+    SetFlag(EHuiVisualFlag3DProjection);
+    }
+
+
+CHuiMeshVisual::~CHuiMeshVisual()
+    {
+    }
+
+
+EXPORT_C void CHuiMeshVisual::CreateMeshL(THuiMeshType aMeshType)
+	{
+    // Create a new mesh.
+    iMesh.Set(CHuiMesh::NewL(aMeshType), EHuiHasOwnership);
+	}
+
+
+EXPORT_C void CHuiMeshVisual::SetImage(const THuiImage& aImage)
+    {
+    iImage = aImage;
+    }
+
+
+EXPORT_C void CHuiMeshVisual::SetSecondaryImage(const THuiImage& aImage)
+    {
+    iSecondaryImage = aImage;
+    SetChanged();
+    }
+
+
+EXPORT_C void CHuiMeshVisual::SetSpecularImage(const THuiImage& aImage)
+    {
+    if(iMesh->MeshType() == EHuiMeshTypeProcedural) 
+        {
+        CHuiProceduralMesh *mesh = static_cast<CHuiProceduralMesh*>(&iMesh.NonConstRef());
+        mesh->iMaterial.iSpecularImage = aImage;
+        SetChanged();
+        }
+    }
+
+
+void CHuiMeshVisual::SetPos( const THuiRealPoint& aPos, TInt aTransitionTime )
+	{
+	SetChanged(); // \todo optimize: do not set if the value is the same(?)
+	CHuiVisual::SetPos( aPos, aTransitionTime);
+	if ( iMesh->MeshType() == EHuiMeshTypeM3G )
+		{
+		// \todo Handle animation?
+		THuiRealPoint realSize = LocalPointInPixels(THuiRealPoint(Size().Target().iX,Size().Target().iY),EHuiReferenceStateTarget);
+		THuiRealRect rect( LocalPointInPixels(Pos().Target(),EHuiReferenceStateTarget), 
+							THuiRealSize(realSize.iX, realSize.iY) );
+		M3GMesh()->SetViewportRect( rect );
+		}
+	}
+
+
+void CHuiMeshVisual::SetSize( const THuiRealSize& aSize, TInt aTransitionTime )
+	{
+	SetChanged(); // \todo optimize: do not set if the value is the same(?)
+	CHuiVisual::SetSize( aSize, aTransitionTime);
+	if ( iMesh->MeshType() == EHuiMeshTypeM3G )
+		{
+		// \todo Handle animation
+		THuiRealPoint realSize = LocalPointInPixels(THuiRealPoint(Size().Target().iX,Size().Target().iY),EHuiReferenceStateTarget);
+		THuiRealRect rect( LocalPointInPixels(Pos().Target(),EHuiReferenceStateTarget), 
+							THuiRealSize(realSize.iX, realSize.iY) );
+		M3GMesh()->SetViewportRect( rect );
+		}
+	}
+
+
+void CHuiMeshVisual::SetRect( const THuiRealRect& aRect, TInt aTransitionTime )
+	{
+	SetChanged(); // \todo optimize: do not set if the value is the same(?)
+	CHuiVisual::SetRect( aRect, aTransitionTime );
+	if ( iMesh->MeshType() == EHuiMeshTypeM3G )
+		{
+		// \todo Handle animation
+		THuiRealPoint realSize = LocalPointInPixels(THuiRealPoint(Size().Target().iX,Size().Target().iY),EHuiReferenceStateTarget);
+		THuiRealRect rect( LocalPointInPixels(Pos().Target(),EHuiReferenceStateTarget), 
+							THuiRealSize(realSize.iX, realSize.iY) );
+		M3GMesh()->SetViewportRect( rect );
+		}
+	}
+
+
+void CHuiMeshVisual::DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect) const
+    {
+    
+    THuiRealRect content = DisplayRect();
+    content.Shrink(PaddingInPixels(EHuiReferenceStateNow));
+    TReal32 opacity = EffectiveOpacity();
+
+    /*
+    aGc.SetProjection(CHuiGc::EProjectionPerspective);
+    if(Flags() & EHuiVisualFlagLocalHorizon)
+        {
+        aGc.SetFrustumOffset(content.Center());
+        }
+    */
+
+    aGc.SetPenColor(TRgb(255, 255, 255));
+    aGc.SetPenAlpha(TInt(255 * opacity));
+
+    aGc.Push(EHuiGcMatrixModel);
+
+    TReal32 scaling = 1.0f;
+
+    TReal32 yaw = iYawAngle.Now();
+    TReal32 pitch = iPitchAngle.Now();
+
+	CHuiProceduralMesh *proceduralMesh = ProceduralMesh();
+	CHuiM3GMesh *m3gMesh = M3GMesh();
+	if(proceduralMesh)
+		{
+		//translate
+	    THuiRealPoint mid = content.Center();
+	    aGc.Translate(EHuiGcMatrixModel, mid.iX, mid.iY, 0.f);
+	    
+	    // Scale the model based on the size (width) of the visual.
+	    /** @todo  Where does this factor really come from? () */
+    	scaling = .000113f * .2f * Min(content.Width(), content.Height()) * iScale.Now();
+    	aGc.Scale(EHuiGcMatrixModel, scaling, scaling, scaling);
+    	
+    	// Rotate
+		aGc.Rotate(EHuiGcMatrixModel, pitch, 1.f, 0.f, 0.f);		
+	    aGc.Rotate(EHuiGcMatrixModel, yaw, 0.f, 1.f, 0.f);  
+		}
+	if(m3gMesh)
+		{
+    	m3gMesh->SetViewportRect(aDisplayRect);
+    	
+		// translate
+	    THuiRealPoint tl = content.iTl;
+	    TRect dispArea = aGc.DisplayArea();
+	    // don't divide by 0
+	    if ( dispArea.Width() != 0 && dispArea.Height() != 0 )
+	        {
+	        aGc.Translate(EHuiGcMatrixModel, 2.f * (tl.iX / dispArea.Width()), -2.f * (tl.iY / dispArea.Height()), 0.f);
+	        }
+	    
+	    // scale
+	    scaling = iScale.Now();
+	    aGc.Scale(EHuiGcMatrixModel, scaling, scaling, scaling);
+	    
+	    // animate	    
+	    m3gMesh->AnimateControllers();
+	    
+    	m3gMesh->StoreCamera();
+    	
+    	// rotate    
+    	m3gMesh->RotateYaw(yaw);
+    	m3gMesh->RotatePitch(pitch);
+    	
+		}
+				
+    // Generate texture coordinates. Use NonConstRef() to get a modifiable
+    // reference to the mesh instance even though we are currently in
+    // a const method.
+    
+    if(proceduralMesh) 
+    	{
+    	proceduralMesh->UpdateSurface(yaw, pitch);
+
+
+        if(proceduralMesh->iMaterial.iPreset == EHuiMaterialShadow)
+            {
+            // Set up a shadow projection.
+            /** @todo  Should determine max Z of model and project there. */
+            TReal32 mat[16];
+            TReal32 point[3] =
+                {
+                0, 0, -18000
+                };
+            TReal32 normal[3] =
+                {
+                0, 0, 1
+                };
+            TReal32 light[4] =
+                {
+                -750, -750, 1000, 0
+                };
+            HuiUtil::ShadowMatrix(point, normal, light, mat);
+            aGc.Multiply(EHuiGcMatrixModel, mat);
+            }
+
+    	}
+	
+    // Depth testing is needed when drawing in 3D.
+    /** @todo  Push attrib needed for depth test. */
+    aGc.Enable(CHuiGc::EFeatureDepthTest);
+    aGc.DrawMesh(iMesh.Ref(), &iImage, &iSecondaryImage, iSecondaryAlpha.Now());
+    aGc.Disable(CHuiGc::EFeatureDepthTest);
+
+	if (m3gMesh) 
+		{
+		m3gMesh->RestoreCamera();
+		}
+
+    // Restore original transformation.
+    aGc.Pop(EHuiGcMatrixModel);
+    }
+
+TBool CHuiMeshVisual::Changed() const
+    {
+    if(CHuiVisual::Changed())
+        {
+        return ETrue;
+        }
+    return iYawAngle.Changed() || iPitchAngle.Changed() || iScale.Changed() || iImage.Changed() || iSecondaryImage.Changed();
+    }
+
+
+void CHuiMeshVisual::ClearChanged()
+    {
+    CHuiVisual::ClearChanged();
+    iYawAngle.ClearChanged();
+    iPitchAngle.ClearChanged();
+    iImage.ClearChanged();
+    iSecondaryImage.ClearChanged();
+    }
+
+
+EXPORT_C CHuiMesh& CHuiMeshVisual::Mesh()
+    {
+    SetChanged(); // \todo Why this is always set?
+    return iMesh.Ref();
+    }
+
+// ---------------------------------------------------------------------------
+// Return procedural mesh
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CHuiProceduralMesh* CHuiMeshVisual::ProceduralMesh() const
+	{
+	if(iMesh->MeshType() != EHuiMeshTypeProcedural) 
+		{
+		return NULL;
+		}    
+	return (CHuiProceduralMesh*)(&iMesh.Ref());
+	}
+
+// ---------------------------------------------------------------------------
+// Return M3G mesh
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CHuiM3GMesh* CHuiMeshVisual::M3GMesh() const 
+	{
+	if(iMesh->MeshType() != EHuiMeshTypeM3G) 
+		{
+		return NULL;
+		}    
+	return (CHuiM3GMesh*)(&iMesh.Ref());
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiPanic.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of THuiPanic. Utility class for panicing 
+*                (macros and panic codes).
+*
+*/
+
+
+
+#include <e32std.h>
+
+#include "uiacceltk/HuiPanic.h"
+
+
+_LIT(KHuiPanicCategory, "UiAccelCoreTK"); // max 16 characters
+
+
+EXPORT_C void THuiPanic::Panic(TReason aReason)
+    {
+	User::Panic(KHuiPanicCategory, aReason);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiRasterizedTextMesh.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,758 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiRasterizedTextMesh. CHuiRasterizedTextMesh 
+*                stores a rasterized bitmap version of a text string.
+*
+*/
+
+
+#include <s32mem.h>
+#include "HuiRasterizedTextMesh.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiSkin.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiFont.h"
+#include "uiacceltk/HuiTexture.h"
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiPanic.h"
+
+#include "uiacceltk/huitextstylemanager.h" // @todo remove when text drawing is moved to THuiFont
+#include "uiacceltk/huitextstyle.h" // @todo remove when text drawing is moved to THuiFont
+#include "uiacceltk/huidropshadow.h"
+#include "uiacceltk/HuiTextureProcessor.h"
+
+#include <AknBidiTextUtils.h>
+#include <AknPictographInterface.h>
+#include <AknPictographDrawerInterface.h>
+
+
+/** Granularity of line wrapping array. */
+const TInt KLineArrayGranularity = 4;
+
+enum THuiRasterizeLevel
+    {
+    ERasterizeNone = 0x0,
+    ERasterizeText = 0x1,           
+    ERasterizePictographs = 0x2,           
+    ERasterizeAll = 0xFFFFFFFF
+    };
+
+EXPORT_C CHuiRasterizedTextMesh* CHuiRasterizedTextMesh::NewL()
+    {
+    CHuiRasterizedTextMesh* self = CHuiRasterizedTextMesh::NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+CHuiRasterizedTextMesh* CHuiRasterizedTextMesh::NewLC()
+    {
+    CHuiRasterizedTextMesh* self = new (ELeave) CHuiRasterizedTextMesh();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+
+CHuiRasterizedTextMesh::CHuiRasterizedTextMesh()
+    {
+    }
+
+CHuiRasterizedTextMesh::~CHuiRasterizedTextMesh()
+    {
+    ResetLines();
+    iLines.Close();
+    ResetPictographLines();
+    iPictographLines.Close();
+    delete iPictographBitmap;
+    }
+
+
+void CHuiRasterizedTextMesh::Reset()
+    {
+    if (!iUsingPreRasterizedMesh)
+        {
+        CHuiTextMesh::Reset();
+        ResetLines();
+        ResetPictographLines();
+        }
+    }
+
+void CHuiRasterizedTextMesh::ResetLines()
+    {
+    HUI_DEBUG(_L("CHuiRasterizedTextMesh::ResetLines() - Deleting textures for all rasterized lines."));
+
+    for(TInt i = 0; i < iLines.Count(); ++i)
+        {
+        if (!iUsingPreRasterizedMesh) 
+            {
+            delete iLines[i].iTexture;
+            }
+        iLines[i].iTexture = NULL;
+        }
+
+    iLines.Reset();
+    }
+
+void CHuiRasterizedTextMesh::ResetPictographLines()
+    {
+    HUI_DEBUG(_L("CHuiRasterizedTextMesh::ResetPictographLines() - Deleting textures for all rasterized lines."));
+
+    for(TInt i = 0; i < iPictographLines.Count(); ++i)
+        {
+        delete iPictographLines[i].iTexture; iPictographLines[i].iTexture = NULL;
+        }
+
+    iPictographLines.Reset();
+    }
+
+
+TBool CHuiRasterizedTextMesh::IsMaxLineCountReached() const
+    {
+    return iLines.Count() >= MaxLineCount();
+    }
+
+
+TBool CHuiRasterizedTextMesh::RasterizeLineL(const TDesC& aTextLine, SRasterizedLine & aLineOut)
+    {
+    if(iUsingPreRasterizedMesh)
+        {
+        return ETrue;
+        }
+    // Retrieve the used text style.
+    THuiTextStyle* textStyle = CHuiStatic::Env().TextStyleManager().TextStyle(iTextStyleId);
+    
+    // Calculate line extents and assign it to texture size.
+    TSize textureSize = textStyle->LineExtentsL(aTextLine);
+    
+    if(textureSize.iWidth == 0)
+        {
+        // This is an empty string. We will not rasterize it.
+        // Just add a gap.
+        aLineOut.iTexture = NULL;
+        aLineOut.iGap = textureSize.iHeight; // @todo: refacture/rename iGap? iGap is used as a size of an empty line?
+
+        HUI_DEBUG1(_L("CHuiRasterizedTextMesh::RasterizeLineL() - Added line gap: %i"),
+                   aLineOut.iGap);
+
+        return !IsMaxLineCountReached();
+        }
+
+    // Create a texture for storing the text into.
+    if (aLineOut.iTexture == NULL)
+        {
+        HUI_DEBUG1(_L("CHuiRasterizedTextMesh::RasterizeLineL() - Registering self (0x%x) as a texture content observer."), this);
+        aLineOut.iTexture = CHuiTexture::NewL();
+        // Register one content observer for the first texture that
+        // is able to restore all lines in a single run
+        if (iLines.Count()==1)
+            {
+            aLineOut.iTexture->iContentObservers.AppendL(*this);
+            }
+        aLineOut.iGap = 0;
+        }
+
+    // set a name for the texture
+    aLineOut.iTexture->SetImageFileNameL(aTextLine);
+    
+    // Rasterize string using the defined text style.
+    textStyle->RasterizeLineL(aTextLine, *aLineOut.iTexture);
+
+    if ( RasterizedShadow() && aLineOut.iTexture )
+        {
+        const TInt requestedBlurredSize = HUI_ROUND_FLOAT_TO_INT( 2*iVisual->DropShadowHandler()->iRadius.Now() );
+        aLineOut.iTexture->CreateShadowTextureL( requestedBlurredSize, EHuiTextureShadowStyleRasterizedText );
+        }
+
+
+    return !IsMaxLineCountReached();
+    }
+
+TBool CHuiRasterizedTextMesh::RasterizePictographLineL(const TDesC& aTextLine, CFont* aFont, SRasterizedLine & aLineOut)
+    {
+    if(iUsingPreRasterizedMesh)
+        {
+        return EFalse;
+        }
+
+    // Retrieve the used text style.
+    THuiTextStyle* textStyle = CHuiStatic::Env().TextStyleManager().TextStyle(iTextStyleId);
+    
+    // Calculate line extents and assign it to texture size.
+    TSize textureSize = textStyle->LineExtentsL(aTextLine);
+	    
+    if(textureSize.iWidth == 0 || !iPictographInterface || !iPictographInterface->Interface()->ContainsPictographs(aTextLine))
+        {
+        // This is an empty string or it does not contain pictographs. We will not rasterize it.
+        // Just add a gap.
+        aLineOut.iTexture = NULL;
+        aLineOut.iGap = textureSize.iHeight;
+        return !IsMaxLineCountReached(); 
+        }
+
+    // store the actual size to be assigned as the textures logical size
+    TSize actualsize(textureSize);
+
+    if (aLineOut.iTexture == NULL)
+        {
+    // Create a texture for storing the pictographs into.
+        aLineOut.iTexture = CHuiTexture::NewL();
+        HUI_DEBUG1(_L("CHuiRasterizedTextMesh::RasterizePictographLineL() - Registering self (0x%x) as a texture content observer."), this);        
+        // Register one content observer for the first texture that
+        // is able to restore all lines in a single run
+        if (iLines.Count()==1)
+            {
+            aLineOut.iTexture->iContentObservers.AppendL(*this);
+            }
+        aLineOut.iGap = 0;
+        }
+
+    // set a name for the texture
+    // @todo is this needed, what names to use
+    aLineOut.iTexture->SetImageFileNameL(_L("Pictographs"));
+
+    TSize maxTextureSize = aLineOut.iTexture->MaxTextureSize();
+    textureSize.iWidth = Min(textureSize.iWidth, maxTextureSize.iWidth);
+    textureSize.iHeight = Min(textureSize.iHeight, maxTextureSize.iHeight);
+
+    if((textureSize.iWidth == 0) || (textureSize.iHeight == 0))
+        {
+        // Cannot draw into this tiny texture, so leave.
+        HUI_DEBUG2(_L("CHuiRasterizedTextMesh::RasterizePictographLineL() - texture size was too small to draw into (%i, %i)."), textureSize.iWidth, textureSize.iHeight);
+        User::Leave(KErrAbort);
+        }
+
+    User::LeaveIfError( iPictographBitmap->Resize(textureSize) );
+
+    CFbsBitmapDevice* device = CFbsBitmapDevice::NewL(iPictographBitmap);
+    CleanupStack::PushL(device);
+
+    CFbsBitGc* gc = 0;
+    User::LeaveIfError( device->CreateContext(gc) );
+    CleanupStack::PushL(gc);
+
+    // Prepare the bitmap for drawing...set drawmode because of EColor16MA mode...
+    gc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha); 
+
+    TRgb color = KRgbWhite;
+    color.SetAlpha(0x00);
+    gc->SetBrushColor(color);
+    gc->Clear();
+    gc->UseFont(aFont);  
+    
+	// Draw pictorgraphs
+    iPictographInterface->Interface()->DrawPictographsInText(
+            *gc,
+            *aFont,
+            aTextLine, TPoint(0, aFont->FontMaxAscent()));
+
+    CleanupStack::PopAndDestroy(gc);
+    CleanupStack::PopAndDestroy(device);
+
+    aLineOut.iTexture->UploadL(*iPictographBitmap, NULL, EHuiTextureUploadFlagRetainResolution);
+    aLineOut.iTexture->SetSize(actualsize);
+    return !IsMaxLineCountReached();
+    }
+
+void CHuiRasterizedTextMesh::BuildL(TBool aRasterize)
+    {
+    if (aRasterize)
+        {
+        DoBuildL(ERasterizeAll);    
+        }
+    else
+        {
+        DoBuildL(ERasterizeNone);                
+        }    
+    }
+
+void CHuiRasterizedTextMesh::DoBuildL(TInt aRasterizeFlags)
+    {
+    if(iUsingPreRasterizedMesh)
+        {
+        return;
+        }
+
+    TSize extents(0, 0);
+    
+    HUI_DEBUG(_L("CHuiRasterizedTextMesh::BuildL() - Updating rasterized text."));
+
+    // This is never NULL during BuildL().
+    const TDesC& text = *Text();
+    
+    // Retrieve the text style used when rasterizing this text mesh.
+    THuiTextStyle* textStyle = CHuiStatic::Env().TextStyleManager().TextStyle(iTextStyleId);
+
+    // Retrieve the CFont object used when rasterizing this text mesh.
+    CFont* font = textStyle->Font().NearestFontL(iTextMeshScale);
+
+    // Maximum width of a text line in pixels.
+    TInt maxWidth = MaxLineWidth();
+
+    TInt startIndex = 0;
+    TInt index = 0;
+    TInt lineCount = 0;
+
+    CArrayFixFlat<TPtrC>* linePtrs = new (ELeave) CArrayFixFlat<TPtrC>(KLineArrayGranularity);
+    CleanupStack::PushL(linePtrs);
+
+    while(startIndex < text.Length())
+        {
+        /// @todo What is the Symbian way to determine line break chars?
+#define HUI_IS_LINE_BREAK(aChar) (aChar == '\n')
+
+        // Find the next logical line.
+        while(index < text.Length() && !HUI_IS_LINE_BREAK(text[index]))
+            {
+            index++;
+            }
+
+        TPtrC logicalLine = text.Mid(startIndex, index - startIndex);
+        ++index; // Skip the line break.
+        startIndex = index;
+
+        switch(LineMode())
+            {
+            case ELineModeTruncate:
+                {
+                ++lineCount; // there's always one line created per logical line
+                HBufC* buf = logicalLine.AllocLC();
+                TPtr ptr = buf->Des();
+                // truncate line
+                CHuiStatic::ConvertToVisualAndClipL(ptr, *font, maxWidth, maxWidth);
+                // create the line entry if not already existing
+                
+                if (aRasterizeFlags != ERasterizeNone)
+                	{
+                    if (iLines.Count() < lineCount)
+                        {
+                        SRasterizedLine line;
+                        line.iTexture = NULL;
+                        line.iGap = 0;
+                        iLines.AppendL(line);
+                        
+                        if (iPictographInterface)
+                            {
+                            SRasterizedLine pictographline;
+                            pictographline.iTexture = NULL;
+                            pictographline.iGap = 0;
+                            iPictographLines.AppendL(pictographline);                                
+                            }
+                        }                	
+                        
+                	TInt currentLine = lineCount-1;
+    	            if (aRasterizeFlags & ERasterizeText)
+    	                {
+    	                // rasterize a single line (updates texture in iLines[0].iTexture)
+        	            RasterizeLineL(ptr, iLines[currentLine]);	                    
+    	                }
+
+    	            if (aRasterizeFlags & ERasterizePictographs && iPictographInterface)
+    	                {
+                        // Rasterize pictographs if needed
+        	            RasterizePictographLineL(ptr, font, iPictographLines[currentLine]);
+    	                }
+
+    	            // Get extents from the texture we just created
+                    CHuiTexture* tex = iLines[currentLine].iTexture;
+                    extents.iHeight += iLines[currentLine].iGap;
+                    if(tex)
+                        {
+                        extents.iWidth = Max(extents.iWidth, tex->Size().iWidth);
+                        extents.iHeight += tex->Size().iHeight;
+                        }	                
+                	}
+                else
+                    {
+                    // Don't rasterise or create textures, just get the extents of this text.
+                    TSize lineExtents = textStyle->LineExtentsL(ptr);
+                    extents.iWidth = Max(extents.iWidth, lineExtents.iWidth);
+                    extents.iHeight += lineExtents.iHeight;                    
+                    }
+
+                	
+        	    CleanupStack::PopAndDestroy(buf);
+                break;
+                }
+
+            case ELineModeWrap:
+                {
+                // wrap lines to array
+                HBufC* buf = CHuiStatic::ConvertToVisualAndWrapToArrayL(
+                    logicalLine, maxWidth, *font, *linePtrs);
+                CleanupStack::PushL(buf);
+
+                // one line may create several wrapped lines
+                lineCount += linePtrs->Count();
+
+                if (aRasterizeFlags != ERasterizeNone)
+                  	{    
+
+                    // create new entries..
+                    while (iLines.Count() < lineCount)
+                        {
+                        SRasterizedLine line;
+                        line.iTexture = NULL;
+                        line.iGap = 0;
+                        iLines.AppendL(line);
+
+                        if (iPictographInterface)
+                            {
+                            SRasterizedLine pictographline;
+                            pictographline.iTexture = NULL;
+                            pictographline.iGap = 0;
+                            iPictographLines.AppendL(pictographline);                                
+                            }
+                        }
+                    
+                   	// Do rasterisation if we want to render to texture.
+                    for(TInt i = 0; i < linePtrs->Count(); ++i)
+                        {
+                        TInt currentLine = (lineCount - linePtrs->Count()) + i;   
+          	   	                
+    	                if (aRasterizeFlags & ERasterizeText)
+    	                    {
+                            // rasterize a single line (updates texture in iLines[i].iTexture)
+                            RasterizeLineL(linePtrs->At(i), iLines[currentLine]);
+    	                    }
+    	                    
+	                    if (aRasterizeFlags & ERasterizePictographs && iPictographInterface)
+	                        {
+                            // Rasterize pictographs if needed
+                            RasterizePictographLineL(linePtrs->At(i), font, iPictographLines[currentLine]);                                                                 	                            
+	                        }
+           	                // Get extents from the texture we just created
+                            CHuiTexture* tex = iLines[i].iTexture;
+                            extents.iHeight += iLines[i].iGap;
+                            
+                            if(tex)
+                                {
+                                extents.iWidth = Max(extents.iWidth, tex->Size().iWidth);
+                                extents.iHeight += tex->Size().iHeight;
+                                }    
+                            	                                                         
+    	                TBool moreAvailable = (currentLine + 1 < MaxLineCount());
+                        if (!moreAvailable)
+          	                {
+       	                    // Maximum number of lines reached.
+       	                    break;
+       	                    }
+                        }
+                  	}
+   	            else
+   	                {
+                    // Don't rasterise or create textures, just get the extents of this text.   	                    
+                    for(TInt i = 0; i < linePtrs->Count(); ++i)
+                        {  
+                        TSize lineExtents = textStyle->LineExtentsL(linePtrs->At(i));
+                        extents.iWidth = Max(extents.iWidth, lineExtents.iWidth);
+                        extents.iHeight += lineExtents.iHeight;                                                              
+                        }
+       	            }
+                	
+                linePtrs->Reset();
+                CleanupStack::PopAndDestroy(buf);
+                break;
+                }
+
+            default:
+                break;
+            }
+
+        // If we have reached the maximum number of lines, stop building.
+        if(IsMaxLineCountReached())
+            {
+            break;
+            }
+        }
+
+    HUI_DEBUG(_L("CHuiRasterizedTextMesh::BuildL() - Finished rasterizing text."));
+
+    CleanupStack::PopAndDestroy(linePtrs); linePtrs = 0;
+
+    if (iPictographBitmap)
+        {
+        iPictographBitmap->Resize(TSize(0, 0));
+        }
+
+    HUI_DEBUG(_L("CHuiRasterizedTextMesh::BuildL() - Updating text extents.."));
+    // The extents of the mesh depend on how many lines there are.
+    SetExtents(extents);
+
+    HUI_DEBUG(_L("CHuiRasterizedTextMesh::BuildL() - Done!"));
+
+    }
+
+void CHuiRasterizedTextMesh::ExpandRectWithShadow(TRect& aRect) const
+    {
+    if ( iVisual && iLines.Count() )
+        {
+        CHuiDropShadow* shadowHandler = iVisual->DropShadowHandler();
+        if ( shadowHandler &&
+             shadowHandler->IsShadowVisible() &&
+             iLines[0].iTexture )
+            {
+            const TInt requestedBlurredSize = HUI_ROUND_FLOAT_TO_INT( 2*shadowHandler->iRadius.Now() );
+            THuiTextureHandle shadow;
+            // take the first line as an example
+            TBool haveShadowTexture = iLines[0].iTexture->GetShadowTexture( shadow,requestedBlurredSize );
+            
+            if ( haveShadowTexture )
+                {
+                const TRect shadowRect = shadowHandler->ShadowDrawingTRect( 
+                        aRect.iTl,
+                        aRect.Size(),
+                        shadow.Size(),
+                        *iVisual );           
+                           
+                aRect.BoundingRect( shadowRect );
+                }
+            }
+        }
+    }
+    
+
+void CHuiRasterizedTextMesh::Draw(CHuiGc& aGc, TReal32 aShadowOpacity) const __SOFTFP
+    {
+    THuiAlignHorizontal oldHorizAlign = aGc.AlignHorizontal();
+    THuiAlignVertical oldVertAlign = aGc.AlignVertical();
+
+    // Because we are using DrawImage, which respects Gc alignments, and the
+    // context has already set up the appropriate alignment offset, we must
+    // disable the alignment temporarily.
+    aGc.SetAlign(EHuiAlignHLeft, EHuiAlignVTop);
+
+
+    // The actual text.
+    DrawLines(aGc, THuiRealPoint(0.f, 0.f), oldHorizAlign, aShadowOpacity);
+
+    if(!iUsingPreRasterizedMesh)
+        {
+        // Pictographs, if needed.
+        DrawPictographLines(aGc, THuiRealPoint(0.f, 0.f), oldHorizAlign);
+        }
+    
+    aGc.SetAlign(oldHorizAlign, oldVertAlign);
+    }
+
+
+void CHuiRasterizedTextMesh::DrawLines(CHuiGc& aGc, const THuiRealPoint& aOffset,
+                                       THuiAlignHorizontal aLineAlignment, TReal32 aShadowOpacity) const
+    {    
+    TInt y = 0;
+
+    // Draw the built lines using THuiImages.
+    for(TInt i = 0; i < iLines.Count(); ++i)
+        {
+        const SRasterizedLine& line = iLines[i];
+        if(line.iTexture)
+            {
+
+            THuiImage textImage(*line.iTexture);
+            THuiRealPoint linePos(0.f, TReal32(y));
+            THuiRealSize lineSize = line.iTexture->Size();
+                   
+            // Do a downward scaling for line texture from TV resolution to LCD resolution.
+            if(iTextMeshScale != 1)
+                {
+                lineSize.iHeight = lineSize.iHeight/iTextMeshScale;
+                lineSize.iWidth = lineSize.iWidth/iTextMeshScale;
+                }
+            
+            // Choose the line-specific alignment.
+            switch(aLineAlignment)
+                {
+                case EHuiAlignHRight:
+                    linePos.iX = Extents().iWidth - lineSize.iWidth;
+                    break;
+
+                case EHuiAlignHCenter:
+                    linePos.iX = (Extents().iWidth - lineSize.iWidth) / 2;
+                    break;
+
+                default:
+                    break;
+                }
+
+            
+            // Is there a shadow?
+            if ( RasterizedShadow() )
+                {
+                const TInt requestedBlurredSize = HUI_ROUND_FLOAT_TO_INT( 2*iVisual->DropShadowHandler()->iRadius.Now() );
+                THuiTextureHandle shadow;
+                TBool haveShadowTexture = line.iTexture->GetShadowTexture(shadow,requestedBlurredSize );
+                
+                if ( haveShadowTexture )
+                    {
+                    THuiImage shadowImage(shadow);
+                    const THuiRealRect shadowDrawingRect = iVisual->DropShadowHandler()->ShadowDrawingRealRect( 
+                        linePos,
+                        lineSize,
+                        shadow.Size(),
+                        *iVisual );
+                    
+                    const TRgb oldColor = aGc.PenColorAlpha();
+                    aGc.SetPenColor(iVisual->DropShadowHandler()->Color());
+                    aGc.SetPenAlpha(HUI_ROUND_FLOAT_TO_INT(aShadowOpacity * 255.0f));
+                    
+                    const THuiQuality oldQuality = aGc.Quality();
+                    aGc.SetQuality(EHuiQualityFast);
+                    
+                    aGc.DrawImage(shadowImage, shadowDrawingRect.iTl + aOffset, shadowDrawingRect.Size());
+                    
+                    aGc.SetPenColorAlpha(oldColor);
+                    aGc.SetQuality(oldQuality);
+                    }
+                }
+                
+            aGc.DrawImage(textImage, linePos + aOffset, lineSize);
+
+            // Move one line downwards.
+            y += TInt(lineSize.iHeight) + line.iGap;
+            }
+
+        // Move extra gap downwards.
+        y += line.iGap;
+        
+        // Add line spacing.
+        y += iLineSpacing;
+        }
+    }
+
+void CHuiRasterizedTextMesh::DrawPictographLines(CHuiGc& aGc, const THuiRealPoint& aOffset,
+                                       THuiAlignHorizontal aLineAlignment) const
+    {
+    if (!iPictographInterface || iUsingPreRasterizedMesh)
+        {
+        return;    
+        }
+    
+    
+    TInt y = 0;
+
+    // Draw the built lines using THuiImages.
+    for(TInt i = 0; i < iPictographLines.Count(); ++i)
+        {
+        const SRasterizedLine& line = iPictographLines[i];
+        if(line.iTexture)
+            {
+
+            THuiImage textImage(*line.iTexture);
+            THuiRealPoint linePos(0.f, TReal32(y));
+            THuiRealSize lineSize = line.iTexture->Size();
+
+            // Choose the line-specific alignment.
+            switch(aLineAlignment)
+                {
+                case EHuiAlignHRight:
+                    linePos.iX = Extents().iWidth - lineSize.iWidth;
+                    break;
+
+                case EHuiAlignHCenter:
+                    linePos.iX = (Extents().iWidth - lineSize.iWidth) / 2;
+                    break;
+
+                default:
+                    break;
+                }
+
+            aGc.SetPenColor(KRgbWhite);
+            aGc.DrawImage(textImage, linePos + aOffset, lineSize);
+
+            // Move one line downwards.
+            y += TInt(lineSize.iHeight) + line.iGap;
+            }
+
+        // Move extra gap downwards.
+        y += line.iGap;
+        
+        // Add line spacing.
+        y += iLineSpacing;
+        }
+    }
+
+
+void CHuiRasterizedTextMesh::TextureContentUploaded(CHuiTexture& /*aTexture*/)
+    {
+    }
+
+
+void CHuiRasterizedTextMesh::TextureContentReleased(CHuiTexture& /*aTexture*/)
+    {
+    }
+
+
+void CHuiRasterizedTextMesh::RestoreTextureContentL(CHuiTexture& /*aTexture*/)
+    {
+    // We only get one of these, so let's rebuild the text mesh.
+    HUI_DEBUG(_L("CHuiRasterizedTextMesh::RestoreTextureContentL() - Rebuilding text."));
+    
+    // We want to render the mesh so pass true.
+    BuildL(ETrue);
+    }
+void CHuiRasterizedTextMesh::InitPictographsL(CAknPictographInterface* aInterface)
+    {
+    if(!iUsingPreRasterizedMesh)
+        {
+        iPictographInterface = aInterface;
+        delete iPictographBitmap;
+        iPictographBitmap = NULL;
+        iPictographBitmap = new (ELeave) CFbsBitmap();    
+        User::LeaveIfError( iPictographBitmap->Create(TSize(0, 0), EColor16MA) );        
+        }
+    }
+
+void CHuiRasterizedTextMesh::BuildPictographsL()
+    {
+    if(!iUsingPreRasterizedMesh)
+        {
+        DoBuildL(ERasterizePictographs);
+        }
+    }
+
+void  CHuiRasterizedTextMesh::UpdateMeshL(const TDesC8& aBuffer)
+    {
+    iUsingPreRasterizedMesh = ETrue;
+    ResetLines();
+    RDesReadStream stream(aBuffer);
+    TInt count = stream.ReadInt32L();
+    for (TInt i=count-1;i>=0;i--)
+        {
+        // lines are in reverse order
+        SRasterizedLine line;
+        line.iTexture = dynamic_cast<CHuiTexture*>((MHuiTexture*)stream.ReadInt32L()); //scary
+        line.iGap = stream.ReadInt32L();
+        iLines.InsertL(line, 0);
+        }
+    TSize extents;
+    extents.iWidth = stream.ReadInt32L();
+    extents.iHeight = stream.ReadInt32L();
+    SetExtents(extents);
+    stream.Close();
+    
+    if (RasterizedShadow()) // update shadow
+        {
+        for (TInt i = iLines.Count()-1; i >=0; i-- )
+            {
+            if (iLines[i].iTexture)
+                {
+                const TInt requestedBlurredSize = HUI_ROUND_FLOAT_TO_INT( 2*iVisual->DropShadowHandler()->iRadius.Now() );
+                iLines[i].iTexture->CreateShadowTextureL( requestedBlurredSize, EHuiTextureShadowStyleRasterizedText );
+                }
+            }
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiRenderPlugin.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,166 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/huifontmanager.h"
+
+EXPORT_C CHuiRenderPlugin::CHuiRenderPlugin(THuiRenderPluginId aId)
+        : iId(aId)
+    {
+    }
+
+EXPORT_C CHuiRenderPlugin::~CHuiRenderPlugin()
+    {
+    }
+
+
+EXPORT_C THuiRenderPluginId CHuiRenderPlugin::Id() const
+    {
+    return iId;
+    }
+
+
+EXPORT_C TBool CHuiRenderPlugin::Allows(THuiRenderPluginAllow /*aAllow*/) const
+    {
+    // Allow full functionality by default.
+    return ETrue;
+    }
+
+
+EXPORT_C MHuiRenderSurface* CHuiRenderPlugin::CreateRenderSurfaceL(CHuiDisplay& /*aDisplay*/)
+    {
+    return NULL;
+    }
+
+
+EXPORT_C CHuiGc* CHuiRenderPlugin::CreateGcL()
+    {
+    return NULL;
+    }
+
+
+EXPORT_C CHuiTexture* CHuiRenderPlugin::CreateTextureL(const THuiTextureHandle* /*aExistingTexture*/)
+    {
+    return NULL;
+    }
+
+
+EXPORT_C CHuiTexture* CHuiRenderPlugin::CreateTextureLC(const THuiTextureHandle* aExistingTexture)
+    {
+    CHuiTexture* texture = CreateTextureL(aExistingTexture);
+    CleanupStack::PushL(texture);
+    return texture;
+    }
+
+
+EXPORT_C CHuiTextureManager* CHuiRenderPlugin::CreateTextureManagerL(CHuiEnv& /*aEnv*/)
+    {
+    return NULL;
+    }
+
+EXPORT_C CHuiFxEngine* CHuiRenderPlugin::CreateEffectsEngineL()
+    {
+    return NULL;
+    }
+
+EXPORT_C THuiFontManager* CHuiRenderPlugin::CreateFontManagerL() const
+    {
+    // Construct the default font manager instance. This can
+    // be overridden in CHuiRenderPlugin - derived classes if 
+    // specialized font manager is to be used.
+    THuiFontManager* fontManager = new (ELeave) THuiFontManager();
+    return fontManager;
+    }
+
+
+EXPORT_C CHuiMesh* CHuiRenderPlugin::CreateMeshL(THuiMeshType /*aMeshType*/)
+    {
+    return NULL;
+    }
+
+
+EXPORT_C CHuiCurvePath* CHuiRenderPlugin::CreateCurvePathL()
+    {
+    return NULL;
+    }
+
+
+EXPORT_C void CHuiRenderPlugin::DeleteNamedTexture(TUint /*aName*/)
+    {
+    }
+
+
+EXPORT_C void CHuiRenderPlugin::NotifyDisplayCountL(TUint /*aCount*/)
+    {
+    }
+
+    
+EXPORT_C void CHuiRenderPlugin::Release()
+	{
+	}
+
+
+EXPORT_C void CHuiRenderPlugin::RestoreL()
+	{
+	}
+
+EXPORT_C void CHuiRenderPlugin::EnableOffScreenBitmapL(TInt /*aFlags*/)
+	{	
+	}
+
+EXPORT_C void CHuiRenderPlugin::DisableOffScreenBitmap()
+	{	
+	}
+
+EXPORT_C CFbsBitmap* CHuiRenderPlugin::OffScreenBitmap() const
+	{
+	return NULL;
+	}
+
+EXPORT_C void CHuiRenderPlugin::UpdateOffScreenBitmapL(CHuiDisplay& /*aDisplay*/)
+	{	
+	}
+
+EXPORT_C void CHuiRenderPlugin::DrawOffScreenBitmapToWindowL(CHuiDisplay& /*aDisplay*/)
+	{	
+	}
+
+EXPORT_C CHuiCanvasGc* CHuiRenderPlugin::CreateCanvasGcL()
+    {
+    return NULL;        
+    }
+
+EXPORT_C void CHuiRenderPlugin::AddRestoreStateFlags(TInt /*aFlags*/)
+    {
+    }
+
+EXPORT_C TInt CHuiRenderPlugin::GetRestoreStateFlags()
+    {
+    return 0;
+    }
+
+EXPORT_C void CHuiRenderPlugin::ClearRestoreStateFlags()
+    {
+    }
+	
+EXPORT_C void CHuiRenderPlugin::RenderPluginExtension(const TUid& /*aExtensionUid*/, TAny** aExtensionParams)
+    {
+    // If no extension with given UID was found, indicate it by returning null
+    *aExtensionParams = NULL;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiRenderSurface.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   MHuiRenderSurface implementation (not much though).
+*
+*/
+
+
+
+#include "HuiRenderSurface.h"
+
+EXPORT_C MHuiRenderSurface::~MHuiRenderSurface()
+    {
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiRoster.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "uiacceltk/HuiRoster.h"  // Class definition
+
+
+CHuiRoster::CHuiRoster()
+    {
+    }
+
+CHuiRoster::~CHuiRoster()
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiRosterEntry.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "HuiRosterEntry.h"
+#include "uiacceltk/HuiDisplay.h"
+#include "HuiRosterImpl.h"
+#include "uiacceltk/HuiVisual.h"
+#include "uiacceltk/HuiPanic.h"
+
+
+CHuiRosterEntry::CHuiRosterEntry(CHuiControlGroup& aGroup)
+        : iGroup(aGroup)
+    {    
+    }
+    
+    
+CHuiRosterEntry::~CHuiRosterEntry()
+    {
+    // Make sure the root visuals are hidden.
+    for(TInt i = iRootVisuals.Count() - 1; i >= 0; --i)
+        {
+        CHuiDisplay* display = iRootVisuals[i]->Display();
+        if(display)
+            {
+            CHuiRosterImpl& roster = STATIC_CAST(CHuiRosterImpl&, display->Roster());
+            roster.HideVisual(iRootVisuals[i]);
+            }
+        }
+    iRootVisuals.Reset();
+    }
+   
+
+CHuiControlGroup& CHuiRosterEntry::ControlGroup() const
+    {
+    return iGroup;    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiRosterImpl.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1709 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiRosterImpl. CHuiRosterImpl implements 
+*                the interface defined by CHuiRoster.
+*
+*/
+
+
+
+#include "HuiRosterImpl.h"  // Class definition
+#include "HuiRosterEntry.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiControlGroup.h"
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiDisplay.h"
+#include "uiacceltk/HuiEvent.h"
+#include "uiacceltk/HuiTransformation.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiProbe.h"
+#include "uiacceltk/HuiCanvasVisual.h"
+#include "huilongtapdetector.h"
+#include "HuiFxEffect.h"
+#include "huieffectable.h"
+#include "huicanvasrenderbuffer.h"
+#include "huicanvasgc.h"
+#include "HuiRenderPlugin.h"
+
+#ifdef RD_TACTILE_FEEDBACK
+#include <touchfeedback.h>
+#endif //RD_TACTILE_FEEDBACK
+
+const TReal32 KHuiVisualOutlineWidth = 1.f;
+
+struct THuiPointerEventDetails 
+	{
+	MHuiEventHandler* iEventHandler;
+	THuiXYMetric iXYMetric;
+	TBool iDisableLongTapWhenDragging;
+	TBool iDragging;
+	};
+
+
+
+CHuiRosterImpl::CHuiRosterImpl(CHuiDisplay* aDisplay)
+        : iDisplay(aDisplay), iInitialDownEvent(NULL), iEffectOpacity(1.f)
+    {
+    }
+
+CHuiRosterImpl::~CHuiRosterImpl()
+    {
+    FreezeVisibleContentL(EFalse);
+    
+    delete iLongTapDetector;
+    iEntries.ResetAndDestroy();
+    iPointerDragObservers.Close();
+    iDisplay = NULL;
+    iInputFocus = NULL;
+    iUnhandledPointerObservers.Close();
+    iLongTapObservers.Close();
+    while(iPointerEventDetails.Count()>0)
+    	{
+    	delete iPointerEventDetails[0];
+		iPointerEventDetails.Remove(0);    	
+    	}
+    iPointerEventDetails.ResetAndDestroy();
+    }
+
+
+void CHuiRosterImpl::SetDisplay(CHuiDisplay* aDisplay)
+    {
+    iDisplay = aDisplay;    
+    }
+    
+    
+void CHuiRosterImpl::SetRect(const TRect& aRect)
+    {
+    iRect = TRect(0, 0, aRect.Width(), aRect.Height());
+    UpdateLayout();
+
+    SetChanged();
+    }
+    
+ 
+TRect CHuiRosterImpl::Rect() const
+	{
+	return(iRect);
+	}
+   
+    
+void CHuiRosterImpl::ShowL(CHuiControlGroup& aGroup, TInt aWhere)
+    {
+    // If the group is already shown on the display, just adjust its position
+    // according to the parameters.
+    if(Find(&aGroup) != KErrNotFound)
+        {
+        // It is already shown. Only adjust position.
+        TInt newPos = aWhere;
+        if(newPos == KHuiRosterShowAtTop)
+            {
+            newPos = Count() - 1;
+            }
+        else if(newPos == KHuiRosterShowAtBottom)
+            {
+            newPos = 0;
+            }
+        else
+            {
+            // for PC lint
+            }
+        Move(&aGroup, newPos);            
+        return;
+        }
+
+    if(aWhere == KHuiRosterShowAtTop)
+        {
+        // Put the group on top of the roster.
+        AppendL(&aGroup);
+        }
+    else if(aWhere == KHuiRosterShowAtBottom)
+        {
+        InsertL(&aGroup, 0);
+        }
+    else
+        {
+        InsertL(&aGroup, aWhere);
+        }
+
+    // The group will automatically accept input events once shown.
+    aGroup.SetAcceptInput(ETrue);
+
+    // Show all the controls of the group.
+    for(TInt i = 0; i < aGroup.Count(); ++i)
+        {
+        aGroup.Control(i).ShowL(*iDisplay);
+        }
+    }
+
+
+void CHuiRosterImpl::Hide(CHuiControlGroup& aGroup)
+    {
+    // Hide all the controls of the group.
+    for(TInt i = 0; i < aGroup.Count(); ++i)
+        {
+        aGroup.Control(i).Hide(*iDisplay);
+        }
+
+    Remove(&aGroup);
+    }
+
+
+void CHuiRosterImpl::AppendL(CHuiControlGroup* aGroup)
+    {
+    ASSERT( aGroup );
+    CHuiRosterEntry* entry = new (ELeave) CHuiRosterEntry(*aGroup);
+    CleanupStack::PushL(entry);
+    User::LeaveIfError(iEntries.Append(entry));
+    CleanupStack::Pop(entry);
+
+    if(iDisplay)
+        {
+        iDisplay->Env().ContinueRefresh();
+        }
+        
+    SetChanged();
+    }
+
+
+void CHuiRosterImpl::InsertL(CHuiControlGroup* aGroup, TInt aPos)
+    {
+    ASSERT( aGroup );
+    if(Find(aGroup) != KErrNotFound)
+        {
+        User::Leave(KErrAlreadyExists);
+        }
+
+    CHuiRosterEntry* entry = new (ELeave) CHuiRosterEntry(*aGroup);
+    CleanupStack::PushL(entry);
+    User::LeaveIfError(iEntries.Insert(entry, aPos));
+    CleanupStack::Pop(entry);
+    
+    if(iDisplay)
+        {
+        iDisplay->Env().ContinueRefresh();
+        }
+
+    SetChanged();
+    }
+
+void CHuiRosterImpl::Move(CHuiVisual* aVisual, TInt aPos)
+    {
+    CHuiRosterEntry* entry = EntryForVisual(aVisual);
+    if (entry)
+        {
+        Move(&entry->ControlGroup(), aPos);        
+        }    
+    }
+
+void CHuiRosterImpl::Move(CHuiControlGroup* aGroup, TInt aPos)
+    {
+    TInt index = Find(aGroup);
+    TInt k = 0;
+    
+    if(index != KErrNotFound && index != aPos)
+        {
+        CHuiRosterEntry* moving = iEntries[index];
+        
+        if(aPos > index)
+            {
+            for(k = index; k < aPos; ++k)
+                {
+                iEntries[k] = iEntries[k + 1];
+                }
+            }
+        else 
+            {
+            for(k = index; k > aPos; --k)
+                {
+                iEntries[k] = iEntries[k - 1];
+                }
+            }
+        iEntries[aPos] = moving;                
+        }
+        
+    if(iDisplay)
+        {
+        iDisplay->Env().ContinueRefresh();        
+        }
+
+    SetChanged();
+    }
+
+
+TInt CHuiRosterImpl::Find(CHuiControlGroup* aGroup) const
+    {
+    for(TInt i = 0; i < iEntries.Count(); ++i)
+        {
+        if(&iEntries[i]->ControlGroup() == aGroup)
+            {
+            return i;
+            }
+        }
+    return KErrNotFound;
+    }
+
+
+void CHuiRosterImpl::Remove(CHuiControlGroup* aGroup)
+    {
+    TInt index = Find(aGroup);
+    if(index != KErrNotFound)
+        {
+        delete iEntries[index];
+        iEntries.Remove(index);
+
+        if(iDisplay)
+            {
+            iDisplay->Env().ContinueRefresh();
+            }
+
+        SetChanged();
+        }
+    }
+
+
+TInt CHuiRosterImpl::Count() const
+    {
+    return iEntries.Count();
+    }
+
+
+CHuiControlGroup& CHuiRosterImpl::ControlGroup(TInt aIndex) const
+    {
+    return iEntries[aIndex]->ControlGroup();
+    }
+
+
+CHuiControl* CHuiRosterImpl::FindControl(TInt aControlId) const
+    {
+    CHuiControl* control = 0;
+    for(TInt i = 0; i < iEntries.Count(); ++i)
+        {
+        control = iEntries[i]->ControlGroup().FindControl(aControlId);
+        if(control)
+            {
+            break;
+            }
+        }
+    return control;
+    }
+
+
+CHuiRosterEntry* CHuiRosterImpl::EntryForVisual(const CHuiVisual* aVisual)
+    {
+    ASSERT( aVisual != NULL );
+    CHuiControlGroup* group = aVisual->Owner().ControlGroup();
+    TInt index = Find(group);
+    if(index == KErrNotFound)
+        {
+        // The group is not in this roster.
+        return NULL;
+        }
+    return iEntries[index];
+    }
+
+
+void CHuiRosterImpl::ShowVisualL(CHuiVisual* aVisual)
+    {
+    CHuiRosterEntry* entry = EntryForVisual(aVisual);
+
+    if(!entry)
+        {
+        User::Leave(KErrNotFound);
+        }
+    
+    if(entry->iRootVisuals.Find(aVisual) != KErrNotFound)
+        {
+        User::Leave(KErrAlreadyExists);
+        }
+    
+    User::LeaveIfError( entry->iRootVisuals.Append(aVisual) );
+
+    SetVisualToFullArea(aVisual);    
+    }
+
+
+void CHuiRosterImpl::HideVisual(CHuiVisual* aVisual)
+    {
+    ASSERT( aVisual );
+    aVisual->SetDisplay(NULL);
+    
+    CHuiRosterEntry* entry = EntryForVisual(aVisual);
+    if(entry)
+        {
+        TInt index = entry->iRootVisuals.Find(aVisual);
+        if(index != KErrNotFound) // do nothing if visual was not found
+            {
+            entry->iRootVisuals.Remove(index);
+    
+            if(iDisplay)
+                {
+                iDisplay->Env().ContinueRefresh();
+                }
+            }
+        }
+    }
+
+
+void CHuiRosterImpl::SetFocus(CHuiControl& aControl)
+    {
+    ChangeInputFocus(&aControl);
+    }
+
+
+void CHuiRosterImpl::ClearFocus()
+    {
+    ChangeInputFocus(NULL);
+    }
+
+
+void CHuiRosterImpl::ChangeInputFocus(CHuiControl* aControl)
+    {
+    if(aControl)
+        {
+        // The control must be in one of groups of the roster.
+        CHuiControl* control = FindControl(aControl->Id());
+        if(control != aControl)
+            {
+            // Illegal focus.
+            return;
+            }
+        }
+
+    iInputFocus = aControl;
+    }
+
+TBool CHuiRosterImpl::PrepareDraw() const
+    {
+    HUI_PROBE_PROGRAMFLOW_ENTER(MHuiProbe::EProgramFlowPointRefreshPrepareDraw)
+    
+    TInt i = 0;
+    TInt j = 0;
+
+    TInt visualCount = 0;
+    TInt entryCount = iEntries.Count();
+    // Prepare the visuals tree in the display.
+    for(j = 0; j < entryCount; ++j)
+        {
+        CHuiRosterEntry& entry = *iEntries[j]; 
+        
+        visualCount = entry.iRootVisuals.Count();
+        for(i = 0; i < visualCount; ++i)
+            {
+            CHuiVisual* visual = entry.iRootVisuals[i];
+            //Ignore inactive visuals
+            if ( visual->Flags()& EHuiVisualFlagInactive )
+            	{
+            	continue; 
+            	}
+            TBool successfullyPrepared = ETrue;
+            TRAPD(err, successfullyPrepared = visual->PrepareDrawL());
+            if (err != KErrNone)
+	            {
+	            // Handle the error by calling the visual owner
+	            // errorhandling callback
+                visual->Owner().VisualPrepareDrawFailed(*visual, err);
+
+                HUI_PROBE_PROGRAMFLOW_EXIT(MHuiProbe::EProgramFlowPointRefreshPrepareDraw)
+                return EFalse;
+	            }
+	        if (!successfullyPrepared) 
+		        {
+		        // we can stop preparing the rest of the root visuals
+		        // if one prepare failed (we won't be drawing 
+		        // anything anyway)
+
+		        // also if the prepare failed but it didn't leave,
+		        // we assume it was already handled 
+
+                HUI_PROBE_PROGRAMFLOW_EXIT(MHuiProbe::EProgramFlowPointRefreshPrepareDraw)
+		        return EFalse;
+		        }
+            }
+        }
+
+    HUI_PROBE_PROGRAMFLOW_EXIT(MHuiProbe::EProgramFlowPointRefreshPrepareDraw)
+    return ETrue;
+    }
+
+
+void CHuiRosterImpl::Draw(CHuiGc& aGc) const
+    {
+    Draw(aGc, NULL);
+    }
+
+void CHuiRosterImpl::Draw(CHuiGc& aGc, CHuiDisplay* aDisplay) const
+    {
+    CHuiDisplay* display = aDisplay ? aDisplay : iDisplay;
+    THuiRealRect displayRect = display->VisibleArea();
+    TBool refreshCache = ETrue; // TODO: Could this be optimized ?
+    TBool opaque = EFalse;  
+
+    // Init projection matrix
+    aGc.LoadIdentity(EHuiGcMatrixProjection);
+
+    // Init model matrix 
+    aGc.LoadIdentity(EHuiGcMatrixModel);        
+    
+    // Set up display-specifc window transformations e.g. scaling for tv out        
+    aGc.SetWindowTransformation(&(display->WindowTransformation()));
+    aGc.UpdateProjection();                            
+
+    TBool didDrawEffect = EFalse;
+    if (iEffect)
+        {
+        //RDebug::Print(_L("CHuiRosterImpl::Draw trying to use effect"));
+        TRgb oldColor = aGc.PenColor(); 
+        TInt oldAlpha = aGc.PenAlpha(); 
+
+        // Clear
+        aGc.SetPenColor(KRgbBlack);
+        aGc.SetPenAlpha(0);
+        aGc.Disable(CHuiGc::EFeatureBlending);
+        aGc.Disable(CHuiGc::EFeatureClipping);
+        aGc.Clear();
+
+        // Restore Gc values
+        aGc.SetPenColor(oldColor);
+        aGc.SetPenAlpha(oldAlpha);
+        aGc.Enable(CHuiGc::EFeatureBlending);
+        aGc.Enable(CHuiGc::EFeatureClipping);
+
+        // Note: Opacity implementation in effect system  does not really work visually 
+        // correct if there are semitransparent child windows. Child window opacity becomes too
+        // large, because opacity is applied during visual tree drawing and thus blending child
+        // visuals on top of the parent produces wrong transparency level.
+        //
+        // We workaround this issue here so that we force rendering to cached render
+        // target (with opacity 255) and give the real opacity as a parameter to effect
+        // drawing so the whole operation gets correct opacity. However there is possibility
+        // that complex effect fxml would assume transparency to be handled *before*
+        // some other part of the effect, so this workaround won't work correctly in those cases. 
+        // To get those working, propably whole opacity effect handling should be re-written 
+        // differently.
+        if (iEffect->IsSemitransparent() || iEffectOpacity < 1.f)
+            {
+            iEffect->ForceCachedRenderTargetUsage(ETrue);
+            }        
+        RRegion dummy;
+        didDrawEffect = iEffect->CachedDraw(aGc, displayRect, refreshCache, opaque, dummy, iEffectOpacity*255);        
+        dummy.Close();
+        }
+    
+    if (!didDrawEffect)
+        {
+        DrawSelf(aGc, aDisplay);
+        }
+    else
+        {
+        // Effect was drawn, OpenGLES/OpenVG may be in different state than what Gc thinks so we restore it.
+        aGc.RestoreState();                
+        }
+
+    // Undo display-specifc window transformations                          
+    aGc.SetWindowTransformation(NULL);
+    aGc.UpdateProjection();            
+
+    // Undo changes to model matrix
+    aGc.LoadIdentity(EHuiGcMatrixModel);    
+    }
+
+void CHuiRosterImpl::DrawSelf(CHuiGc& aGc, CHuiDisplay* aDisplay) const
+    {
+    HUI_PROBE_PROGRAMFLOW_ENTER(MHuiProbe::EProgramFlowPointRefreshDraw)
+
+    TInt i = 0;
+    TInt j = 0;
+
+    CHuiDisplay* display = aDisplay ? aDisplay : iDisplay;
+
+    if (iCanvasRenderBuffer && iCanvasGc)
+        {
+        DrawSelfFrozen(aGc, aDisplay);
+        return;
+        }
+
+    TInt visualCount = 0;
+    TInt entryCount = iEntries.Count();
+    // Draw the visuals tree in the display.
+    for(j = 0; j < entryCount; ++j)
+        {
+        CHuiRosterEntry& entry = *iEntries[j]; 
+        CHuiControlGroup& group = entry.ControlGroup();
+
+        // Init model matrix always for every group
+        //aGc.LoadIdentity(EHuiGcMatrixModel);        
+        aGc.Push(EHuiGcMatrixModel);
+        
+        // Set up display-specifc transformations i.e. camera transformations    	
+        display->Transformation().Execute(EHuiGcMatrixModel, aGc);
+        
+        // Set up a group-specific transformation.
+        if(group.IsTransformed())
+            {
+   	        group.Transformation().Execute(EHuiGcMatrixModel, aGc);
+            }
+        
+        // Draw visuals
+        visualCount = entry.iRootVisuals.Count();
+        for(i = 0; i < visualCount; ++i)
+            {
+            CHuiVisual* visual = entry.iRootVisuals[i];
+            //Ignore inactive visuals
+            if ( visual->Flags()& EHuiVisualFlagInactive || visual->LoadingEffect() )
+            	{
+            	continue; 
+            	}
+            visual->Draw(aGc);
+            }       
+
+        if( display->DrawVisualOutline() != CHuiDisplay::EDrawVisualOutlineNone )
+            {        	
+            for(i = 0; i < visualCount; ++i)
+                {	
+                // Draw Visual Outline depending on central repository setting
+                // and visual flag value
+                const TBool drawOutline =
+                    ( entry.iRootVisuals[i]->Flags() & EHuiVisualFlagEnableDebugMode ) ||  
+                    ( display->DrawVisualOutline() == CHuiDisplay::EDrawVisualOutlineAllVisuals );
+                
+                DrawBoundaries( aGc, entry.iRootVisuals[i], drawOutline );        
+                }
+            }
+        
+        aGc.Pop(EHuiGcMatrixModel);        
+        }
+    
+    HUI_PROBE_PROGRAMFLOW_EXIT(MHuiProbe::EProgramFlowPointRefreshDraw)
+    }
+
+void CHuiRosterImpl::DrawSelfFrozen(CHuiGc& aGc, CHuiDisplay* aDisplay) const
+    {
+    if (iCanvasGc && iCanvasRenderBuffer)
+        {
+        iCanvasGc->SetGc(aGc);
+        iCanvasGc->SetDefaults();
+        iCanvasGc->PushTransformationMatrix();
+                
+        // Calculate rotation as relative to the current display rotation.
+        CHuiGc::TOrientation relativeOrientation = CHuiGc::EOrientationNormal;    
+        CHuiGc::TOrientation displayOrientation = aDisplay->Orientation(); 
+        CHuiGc::TOrientation renderBufferOrientation = iCanvasRenderBufferOrientation; 
+        
+        TInt rotationAngle[] =
+            {
+            0, 
+            270, 
+            90, 
+            180
+            };
+            
+        TInt displayOrientationAngle = rotationAngle[displayOrientation];
+        TInt renderBufferOrientationAngle = rotationAngle[renderBufferOrientation];    
+        TInt relativeOrientationAngle = renderBufferOrientationAngle - displayOrientationAngle;
+        
+        // Check over/underflow
+        if (relativeOrientationAngle > 360)
+            {
+            relativeOrientationAngle -= 360;
+            }
+        else if (relativeOrientationAngle < 0)
+            {
+            relativeOrientationAngle += 360;
+            }
+        
+        switch (relativeOrientationAngle)
+            {
+            case 0:
+                {
+                relativeOrientation = CHuiGc::EOrientationNormal;
+                break;
+                }
+            case 90:
+                {
+                relativeOrientation = CHuiGc::EOrientationCW90;            
+                break;
+                }
+            case 270:
+                {
+                relativeOrientation = CHuiGc::EOrientationCCW90;            
+                break;
+                }
+            case 180:
+                {
+                relativeOrientation = CHuiGc::EOrientation180;            
+                break;
+                }
+            default:
+                {
+                // As usual, this should not happen...but just in case it does use normal rotation
+                relativeOrientation = CHuiGc::EOrientationNormal;
+                break;
+                }        
+            }
+        
+        TRect displayArea = aDisplay->VisibleArea();
+        TInt w = displayArea.Width();
+        TInt h = displayArea.Height();
+
+       
+        // ...select right rotation...
+        if (relativeOrientation == CHuiGc::EOrientationCW90)
+            {
+            // Rotate around origo and move back to displayarea
+            iCanvasGc->Rotate(-90, 0, 0, 1.f);
+            iCanvasGc->Translate(-h, 0, 0);
+            }
+        else if (relativeOrientation == CHuiGc::EOrientationCCW90)
+            {
+            // Rotate around origo and move back to displayarea
+            iCanvasGc->Rotate(90, 0, 0, 1.f);
+            iCanvasGc->Translate(0, -w, 0);
+            }
+        else if (relativeOrientation == CHuiGc::EOrientation180)
+            {
+            // Rotate around origo and move back to displayarea
+            iCanvasGc->Rotate(180, 0, 0, 1.f);
+            iCanvasGc->Translate(-w, -h, 0);            
+            }
+        else
+            {
+            // Nothing
+            }            
+
+        // Pixels are upside down in OpenVG canvas render buffer
+        if (CHuiStatic::Env().Renderer() == EHuiRendererVg10)
+            {
+            TInt height = h;
+            if (relativeOrientation == CHuiGc::EOrientationCW90 || relativeOrientation == CHuiGc::EOrientationCCW90)
+                {
+                height = w;    
+                }            
+            iCanvasGc->Translate(0.0f, height, 0.0f);            
+            iCanvasGc->Scale(1.f, -1.f, 1.f);
+            }
+        
+        iCanvasGc->DrawImage(*iCanvasRenderBuffer, TPoint(0,0));        
+        iCanvasGc->PopTransformationMatrix();
+        }
+    }
+
+void CHuiRosterImpl::DrawBoundaries( CHuiGc& aGc, CHuiVisual* aVisual, TBool aDrawOutline ) const
+	{
+    if( aDrawOutline )
+        {
+        const THuiRealRect content = aVisual->DisplayRect();
+        
+        if (aVisual->Flags()& EHuiVisualFlagInactive)
+            {
+            aGc.SetPenColor( KRgbDarkGray );           
+            }
+        else
+            {
+            aGc.SetPenColor( TUint32(aVisual)&0x00ffffff/*KRgbBlack*/ );  // Use "random" color
+            }
+        aGc.DrawBorders(content.Round(), 
+            KHuiVisualOutlineWidth, KHuiVisualOutlineWidth,
+            KHuiVisualOutlineWidth, KHuiVisualOutlineWidth,
+            CHuiGc::EBorderFixedCorners);
+        }
+        
+    for( TInt k = 0; k < aVisual->Count(); ++k )
+        {
+        DrawBoundaries( 
+            aGc, 
+            &aVisual->Visual( k ), 
+            ( (  aVisual->Visual( k ).Flags() & EHuiVisualFlagEnableDebugMode ) || 
+                aDrawOutline ) );
+        }
+    }
+
+
+TBool CHuiRosterImpl::HasTransformedControlGroups() const
+    {
+    TInt j = 0;
+    for(j = 0; j < iEntries.Count(); ++j)
+        {
+        CHuiRosterEntry& entry = *iEntries[j]; 
+        CHuiControlGroup& group = entry.ControlGroup();
+        if(group.IsTransformed())
+            {
+            return ETrue;    
+            }
+        }
+    return EFalse;    
+    }
+
+
+TBool CHuiRosterImpl::HandleEventL(const THuiEvent& aEvent)
+    {
+    TInt i = 0;
+    TInt k = 0;
+
+    if(iDisplay)
+        {
+        iDisplay->Env().ContinueRefresh();
+        }
+
+    if(aEvent.IsPointerEvent())
+        {
+        iTactileFeedbackHandled = EFalse;
+        
+        // Put event details array up to date
+        CleanEventDetails();
+        
+        if ( !iLongTapDetector )
+            {
+            iLongTapDetector = CHuiLongTapDetector::NewL( *this );
+            }
+        iLongTapDetector->OfferPointerEvent( aEvent );
+        
+        if ( aEvent.PointerDown() )
+        	{
+        	iInitialDownEvent = aEvent;
+        	CleanDraggingFlags();
+        	}
+		
+        
+        // Restricted distribution?
+        if(aEvent.iPointerEvent.iType == TPointerEvent::EDrag)
+            {
+            // Only send these if there are observers.
+            for(i = 0; i < iPointerDragObservers.Count(); ++i)
+                {
+                if( DragEventOutOfRangeL( &iPointerDragObservers[i], aEvent) )
+                	{
+	                if(iPointerDragObservers[i].OfferEventL(aEvent))
+	                    {
+	                    return ETrue;
+	                    }                                    	
+                	}
+                }
+            return EFalse;
+            }
+            
+        // The event is generated by the long tap detector
+        if(aEvent.iPointerEvent.iType == TPointerEvent::EButtonRepeat)
+            {
+            // Only send these if there are observers.
+            for(i = 0; i < iLongTapObservers.Count(); ++i)
+                {
+                if(IsLongTapEventAllowed(&iLongTapObservers[i]))
+                	{
+	                if(iLongTapObservers[i].OfferEventL(aEvent))
+	                    {
+	                    return ETrue;
+	                    }                	
+                	}
+                }
+            return EFalse;
+            }  
+        
+        // The other pointer events are offered depending on the visuals.
+        for(i = iEntries.Count() - 1; i >= 0; --i)
+            {
+            CHuiRosterEntry& entry = *iEntries[i];
+            CHuiControlGroup& group = entry.ControlGroup();
+            
+            if(!group.AcceptInput())
+                {
+                // The group will not be receiving input events.
+                continue;
+                }
+           
+            for(k = entry.iRootVisuals.Count() - 1; k >= 0; --k)
+                {
+                if(OfferPointerEventWithinTreeL(*entry.iRootVisuals[k], aEvent))
+                    {
+                    return ETrue;
+                    }
+                }    
+                
+            // Offer to the fallback handlers of the group.
+            for(k = 0; k < group.iUnhandledEventObservers.Count(); ++k)
+                {
+                if(group.iUnhandledEventObservers[k].OfferEventL(aEvent))
+                    {
+                    return ETrue;
+                    }
+                }
+            }
+            
+        // No one handled the event.
+        for(i = 0; i < iUnhandledPointerObservers.Count(); ++i)
+            {
+            if(iUnhandledPointerObservers[i].OfferEventL(aEvent))
+                {
+                return ETrue;
+                }
+            }
+        }
+    else 
+        {
+        // First offer to the input control.
+        if(aEvent.IsKeyEvent() && iInputFocus && iInputFocus->AcceptInput())
+            {
+            if(iInputFocus->OfferEventL(aEvent))
+                {
+                return ETrue;
+                }
+            }
+
+        // Iterate through the groups and controls in priority order.
+        for(i = iEntries.Count() - 1; i >= 0; --i)
+            {
+            CHuiControlGroup& group = iEntries[i]->ControlGroup();
+            
+            if(!group.AcceptInput())
+                {
+                // The group will not be receiving input events.
+                continue;
+                }
+            
+            for(k = group.Count() - 1; k >= 0; --k)
+                {
+                CHuiControl& control = group.Control(k);
+                if(control.OfferEventL(aEvent))
+                    {
+                    // The event was consumed, now it can't be handled by
+                    // anyone else.
+                    return ETrue;
+                    }
+                }
+            // Notify observer that group didn't handle event?
+            }
+        }
+
+    return EFalse;
+    }
+    
+    
+TBool CHuiRosterImpl::OfferPointerEventWithinTreeL(CHuiVisual& aVisual, const THuiEvent& aEvent, TBool aUseDispRect)
+    {
+    //Ignore inactive visuals
+    if( ( aVisual.Flags() & EHuiVisualFlagIgnorePointer ) || 
+    		( aVisual.Flags() & EHuiVisualFlagInactive ) )
+        {
+        // Discard the entire branch of visuals.
+        return EFalse;
+        }
+
+    const TPoint& pos = aEvent.iPointerEvent.iPosition;
+    
+    TBool useDispRect = EFalse;
+    // If it has children, offer to those first.
+    for(TInt i = aVisual.Count() - 1; i >= 0; --i)
+        {
+        // set useDispRect, if scroll is enabled on a layout
+        useDispRect = static_cast<CHuiLayout&>(aVisual).Scrolling();
+        
+        if(OfferPointerEventWithinTreeL(aVisual.Visual(i), aEvent, useDispRect))
+            {
+            return ETrue;
+            }
+        }
+            
+    TRect visualRect;
+    if(aUseDispRect)
+        {
+        visualRect = TRect(aVisual.DisplayRect());
+        }
+    else
+        {
+        // use cashed display rect
+        visualRect = TRect(aVisual.CachedDisplayRect());
+        }
+    
+    // Offer to the visual itself.
+    if(visualRect.Contains(pos))
+        {
+        HUI_DEBUG3(_L("CHuiRosterImpl::OfferPointerEventWithinTreeL: aVisual=%x pos=%i,%i"), 
+            &aVisual, pos.iX, pos.iY);
+
+        MHuiEventHandler* handler = aVisual.Owner().EventHandler();
+        if(handler)
+            {
+            THuiEvent eventWithVisual = aEvent;
+            eventWithVisual.SetVisual(&aVisual);
+            HandleTactileFeedback( eventWithVisual );
+            if(handler->OfferEventL(eventWithVisual))
+                {
+                return ETrue;
+                }
+            }
+        }
+        
+    // Not consumed.
+    return EFalse;        
+    }
+    
+    
+TBool CHuiRosterImpl::Changed() const
+    {
+    if(iChanged)
+        {
+        return ETrue;
+        }
+    
+    TInt entryCount = iEntries.Count();
+    for(TInt i = 0; i < entryCount; ++i)
+        {
+        if(iEntries[i]->ControlGroup().Changed())
+            {
+            return ETrue;
+            }
+        }
+
+    if (iEffect && iEffect->Changed())
+        {
+        return ETrue;
+        }
+                        
+    return EFalse;        
+    }
+    
+    
+void CHuiRosterImpl::ScanDirty()
+    {
+    if(Changed())
+        {
+        // If the entire roster has changed, there is no need to query 
+        // individual visuals.
+        if(iDisplay)
+            {
+            iDisplay->AddDirtyRegion(iRect);
+            }
+        
+        SetChanged(EFalse);
+        return;
+        }
+    
+    if (iDisplay && !iDisplay->IsDirtyScanNeeded())
+        {
+        // Dirty scan is not needed, we can return directly.
+        return;    
+        }
+    
+    TInt entryCount = iEntries.Count();
+    for(TInt j = 0; j < entryCount; ++j)
+        {
+        CHuiRosterEntry& entry = *iEntries[j]; 
+        TInt count = entry.iRootVisuals.Count();
+        for(TInt i = 0; i < count; ++i)
+            {
+            //Ignore inactive visuals
+            if ( entry.iRootVisuals[i]->Flags()& EHuiVisualFlagInactive )
+           		{
+           		continue; 
+           		}
+            entry.iRootVisuals[i]->ReportChanged();
+            }
+        }
+    }
+
+
+// This ScanDirty-method supports transformed dirty rects
+void CHuiRosterImpl::ScanTransformedDirty(CHuiGc& aGc, CHuiDisplay* aDisplay)
+    {
+    CHuiDisplay* display = aDisplay ? aDisplay : iDisplay;
+
+    // Init projection matrix
+    aGc.LoadIdentity(EHuiGcMatrixProjection);
+
+    // Set up display-specifc window transformations e.g. scaling for tv out    	
+    aGc.SetWindowTransformation(&(display->WindowTransformation()));
+    aGc.UpdateProjection();                            
+
+    if(Changed()) 
+        {
+        // If the entire roster has changed, there is no need to query 
+        // individual visuals.
+        if(display)
+            {
+            display->AddDirtyRegion(iRect);
+            }
+        
+        SetChanged(EFalse);
+        }
+    
+    for(TInt j = 0; j < iEntries.Count(); ++j)
+    	{
+        if (display && !display->IsDirtyScanNeeded())
+        	{
+            break;    
+            }
+
+        CHuiRosterEntry& entry = *iEntries[j]; 
+        CHuiControlGroup& group = entry.ControlGroup();
+
+        // Init model matrix always for every group
+        aGc.LoadIdentity(EHuiGcMatrixModel);        
+            
+        // Set up display-specifc transformations i.e. camera transformations    	
+        __ASSERT_DEBUG(display, USER_INVARIANT());
+        display->Transformation().Execute(EHuiGcMatrixModel, aGc);
+            
+        // Set up a group-specific transformation.
+        if(group.IsTransformed())
+            {
+            group.Transformation().Execute(EHuiGcMatrixModel, aGc);
+            }
+
+        for(TInt i = 0; i < entry.iRootVisuals.Count(); ++i)
+            {
+            if (display && !display->IsDirtyScanNeeded())
+                {
+                break;    
+                }
+            //Ignore inactive visuals     
+            if ( entry.iRootVisuals[i]->Flags()& EHuiVisualFlagInactive )
+           		{
+                continue;
+           		}
+            entry.iRootVisuals[i]->ReportChanged();
+            }
+        }
+
+    // Undo display-specifc window transformations                          
+    aGc.SetWindowTransformation(NULL);
+    aGc.UpdateProjection();            
+
+    // Undo changes to model matrix
+    aGc.LoadIdentity(EHuiGcMatrixModel);
+    }
+
+
+void CHuiRosterImpl::MoveVisualToFront(CHuiVisual* aRootVisual)
+    {
+    ASSERT( aRootVisual );
+    MoveVisualToFront(*aRootVisual);
+    }
+
+
+void CHuiRosterImpl::MoveVisualToFront(const CHuiVisual& aRootVisual)
+    {
+    CHuiRosterEntry* entry = EntryForVisual(&aRootVisual);
+    __ASSERT_ALWAYS( entry != NULL, THuiPanic::Panic(THuiPanic::ERosterGroupNotFound) );
+    TInt index = entry->iRootVisuals.Find(&aRootVisual);
+    if(index == KErrNotFound)
+        {
+        /** @todo Panic? */
+        return;
+        }
+        
+    entry->iRootVisuals.Remove(index);
+    entry->iRootVisuals.Append(&aRootVisual);        
+    
+    UpdateLayout();
+    }
+    
+     
+void CHuiRosterImpl::UpdateLayout()
+    {
+    SetChanged();
+    
+    TInt visualCount = 0;
+    TInt entryCount = iEntries.Count();
+    for(TInt i = 0; i < entryCount; ++i)
+        {
+        visualCount = iEntries[i]->iRootVisuals.Count();
+        for(TInt j = 0; j < visualCount; ++j)
+            {
+            //Ignore inactive visuals
+            if ( iEntries[i]->iRootVisuals[j]->Flags()& EHuiVisualFlagInactive )
+            	{
+            	continue;
+            	}
+            SetVisualToFullArea(iEntries[i]->iRootVisuals[j]);
+            }
+        }
+    }    
+
+
+void CHuiRosterImpl::SetVisualToFullArea(CHuiVisual* aVisual)
+    {
+    ASSERT( aVisual );
+    
+    TInt globalTransitionTime = CHuiStatic::LayoutTransitionTime();
+    
+    // Root visuals are automatically full size.
+    /** @todo  Needs a better way to set the visual's display. */
+    if(iDisplay)
+        {
+        aVisual->SetDisplay(iDisplay);
+        iDisplay->Env().ContinueRefresh();
+        }
+    
+    if(!(aVisual->Flags() & EHuiVisualFlagManualPosition))
+        {
+        aVisual->SetPos(iRect.iTl, globalTransitionTime);
+        }
+
+    if(!(aVisual->Flags() & EHuiVisualFlagManualSize))
+        {
+        aVisual->SetSize(iRect.Size(), globalTransitionTime);
+        }
+    else
+        {
+        aVisual->UpdateChildrenLayout(globalTransitionTime);
+        }
+        
+    aVisual->ReportLayoutUpdate();        
+    }
+
+
+void CHuiRosterImpl::NotifySkinChangedL()
+    {
+    TInt visualCount = 0;
+    TInt entryCount = iEntries.Count();
+    for(TInt j = 0; j < entryCount; ++j)
+        {
+        CHuiRosterEntry& entry = *iEntries[j];
+        visualCount = entry.iRootVisuals.Count();
+        for(TInt i = 0; i < visualCount; ++i)
+            {
+            //Ignore inactive visuals
+            if ( entry.iRootVisuals[i]->Flags()& EHuiVisualFlagInactive )
+            	{
+            	continue;	
+            	}
+            entry.iRootVisuals[i]->NotifySkinChangedL();
+            }
+        }
+    }
+
+
+void CHuiRosterImpl::DumpRootLevelTrees() const
+    {
+    TInt visualCount = 0;
+    TInt entryCount = iEntries.Count();
+    for(TInt j = 0; j < entryCount; ++j)
+        {
+        CHuiRosterEntry& entry = *iEntries[j];
+        visualCount = entry.iRootVisuals.Count();
+        for(TInt i = 0; i < visualCount; ++i)
+            {
+            CHuiVisual* visual = entry.iRootVisuals[i];
+            visual->DumpTree();
+            }
+        }
+    }
+
+
+void CHuiRosterImpl::ClearChanged()
+    {
+    HUI_DEBUGF(_L("CHuiRosterImpl::ClearChanged() - Clearing all change flags."));
+    
+    TInt visualCount = 0;
+    TInt entryCount = iEntries.Count();
+    for(TInt j = 0; j < entryCount; ++j)
+        {
+        CHuiRosterEntry& entry = *iEntries[j];
+        visualCount = entry.iRootVisuals.Count();
+        for(TInt i = 0; i < visualCount; ++i)
+            {
+            // Ignore inactive visuals
+            if ( entry.iRootVisuals[i]->Flags()& EHuiVisualFlagInactive )
+                {
+                continue; 
+                }
+            
+            // This will clear the change flags of the entire tree of visuals.
+            entry.iRootVisuals[i]->ClearChanged();
+            }
+        }
+    }
+
+
+void CHuiRosterImpl::SetChanged(TBool aIsChanged)
+    {
+    if(aIsChanged && !iChanged)
+        {
+        HUI_DEBUG(_L("CHuiRosterImpl::SetChanged() - Roster flagged as changed."));
+        }
+    else if(!aIsChanged && iChanged)
+        {
+        HUI_DEBUG(_L("CHuiRosterImpl::SetChanged() - Roster change flag cleared."));
+        }
+    else
+        {
+        // for PC lint
+        }
+        
+    iChanged = aIsChanged;
+    }
+
+
+RHuiObserverArray<MHuiEventHandler>& CHuiRosterImpl::Observers(THuiInputType aInputType)
+    {
+    switch(aInputType)
+        {
+        case EHuiInputPointerDrag:
+            return iPointerDragObservers;
+            
+        case EHuiInputPointerLongTap:
+            return iLongTapObservers;
+
+        case EHuiInputPointerUnhandled:
+            return iUnhandledPointerObservers;
+            
+        default:
+            HUI_PANIC(THuiPanic::ERosterUnknownInputObserverType)
+            return iPointerDragObservers; // never reached
+        }
+    }
+    
+void CHuiRosterImpl::HandleTactileFeedback( const THuiEvent& aEvent )
+    {
+    // If tactile feedback has been already deciede for this event....
+    if ( iTactileFeedbackHandled )
+        {
+        return;
+        }
+    
+    // The tactile feedback is defined on visual basis
+    if ( !aEvent.Visual() )
+        {
+        // no visual, no feedback
+        return;
+        }
+        
+    // Only pointer events
+    if ( !aEvent.IsPointerEvent() )
+        {
+        return;
+        }
+        
+    // Currently support only pointer down events
+    if ( !aEvent.PointerDown() )
+        {
+        return;
+        }
+        
+    const TInt eventType = 0; // = ETouchEventStylusDown
+    
+    // Check if the viusal has a tactile feedback specified
+    const TInt feedbackType = aEvent.Visual()->TactileFeedback( eventType );
+    
+    if ( feedbackType != KErrNotFound )
+        {
+        iTactileFeedbackHandled = ETrue; // Handling it now.
+        
+#ifdef RD_TACTILE_FEEDBACK
+        MTouchFeedback* feedback = MTouchFeedback::Instance();
+        if ( feedback )
+            {
+            feedback->InstantFeedback( (TTouchLogicalFeedback)feedbackType );
+            }   
+#else
+
+#ifdef _DEBUG
+        // for RnD
+        switch( feedbackType )
+            {
+            case 0: // none
+                User::InfoPrint( _L("None") );
+                break;
+            case 1: // basic
+                User::InfoPrint( _L("Basic") );
+                break;
+            case 2: // sensitive
+                User::InfoPrint( _L("Sensitive") );
+                break;
+            default:
+                break;
+            }
+#endif // _DEBUG
+
+#endif
+        }
+    }
+
+// Adds new detail entry to iPointerEventDetails
+void CHuiRosterImpl::AddEventDetailsL(MHuiEventHandler* aEventHandler, const THuiXYMetric& aXYMetric, TBool aDisable)
+	{
+	THuiPointerEventDetails* newDetails = new (ELeave) THuiPointerEventDetails;
+	newDetails->iEventHandler = aEventHandler;
+	newDetails->iXYMetric = aXYMetric;
+	newDetails->iDisableLongTapWhenDragging = aDisable;
+	newDetails->iDragging = EFalse;	
+	TInt err = iPointerEventDetails.Append(newDetails);
+	if ( err != KErrNone )
+	    {
+	    delete newDetails;
+	    User::Leave( err );
+	    }
+	}
+	
+// Cleans entries from iPointerEventDetails if there isn't observer for 
+// that event handler
+void CHuiRosterImpl::CleanEventDetails()
+	{
+	TInt i = 0;
+	
+	while(i < iPointerEventDetails.Count())
+		{
+		TBool used = EFalse;
+		
+		// Check in drag observers
+		for(TInt j = 0; j < iPointerDragObservers.Count(); ++j)
+			{
+			if(iPointerEventDetails[i]->iEventHandler == &iPointerDragObservers[j])
+				{
+				used = ETrue;
+				break;
+				}
+			}
+
+		// Check in long tap observers
+		if(!used) 
+			{
+			for(TInt j = 0; j < iLongTapObservers.Count(); ++j)
+				{
+				if(iPointerEventDetails[i]->iEventHandler == &iLongTapObservers[j])
+					{
+					used = ETrue;
+					break;
+					}
+				}			
+			}
+			
+		// Check in unhandled observers
+		if(!used) 
+			{
+			for(TInt j = 0; j < iUnhandledPointerObservers.Count(); ++j)
+				{
+				if(iPointerEventDetails[i]->iEventHandler == &iUnhandledPointerObservers[j])
+					{
+					used = ETrue;
+					break;
+					}
+				}
+			}
+		
+		// If event handler isn't found in observers, we remove details for that
+		// event handler from iPointerEventDetails
+		if(!used)
+			{
+			delete iPointerEventDetails[i];
+			iPointerEventDetails.Remove(i);
+			}
+		else
+			{
+			i++;
+			}
+		}	
+	}
+
+// Cleans dragging flags in iPointerEventDetails
+void CHuiRosterImpl::CleanDraggingFlags()
+	{
+	for(TInt i = 0; i < iPointerEventDetails.Count(); ++i)
+		{
+		iPointerEventDetails[i]->iDragging = EFalse;
+		}
+	}
+
+// Sets treshold which pointer needs to be moved before starting to send drag events.
+void CHuiRosterImpl::SetPointerDragThresholdL(const MHuiEventHandler& aEventHandler, const THuiXYMetric& aXYMetric)
+	{		
+	MHuiEventHandler *handler = (MHuiEventHandler*)&aEventHandler;
+
+	// Check if there is already detail entry in iPointerEventDetails where to update
+	// details
+	for(TInt i = 0; i < iPointerEventDetails.Count(); ++i)
+		{
+		if(iPointerEventDetails[i]->iEventHandler == handler)
+			{
+			iPointerEventDetails[i]->iXYMetric = aXYMetric;
+			return;
+			}					
+		}
+	
+	// If event handler wasn't found, we add new detail entry
+	AddEventDetailsL(handler, aXYMetric, EFalse);
+	}
+	
+// Disables long tap events when dragging is going on. 
+void  CHuiRosterImpl::DisableLongTapEventsWhenDraggingL(const MHuiEventHandler& aEventHandler, TBool aDisable)
+	{
+	MHuiEventHandler* handler = const_cast<MHuiEventHandler*>( &aEventHandler );
+	
+	// Check if there is already detail entry in iPointerEventDetails where to update
+	// details
+	for(TInt i = 0; i < iPointerEventDetails.Count(); ++i)
+		{
+		if(iPointerEventDetails[i]->iEventHandler == handler)
+			{
+			iPointerEventDetails[i]->iDisableLongTapWhenDragging = aDisable;
+			return;
+			}
+		}	
+
+	// If event handler wasn't found, we add new detail entry
+	AddEventDetailsL(handler, THuiXYMetric(KDefaultDragTresholdInPixelsX, KDefaultDragTresholdInPixelsY), aDisable);
+	}
+
+// Checks if event handler is within threshold range.
+TBool CHuiRosterImpl::DragEventOutOfRangeL(MHuiEventHandler* aEventHandler, const THuiEvent& aEvent)
+	{	
+ 	if ( aEvent.IsPointerEvent() && iInitialDownEvent.IsPointerEvent())
+        {
+		TBool handlerFound = EFalse;
+		
+		// Find event handler from detail array
+		for(TInt i = 0; i < iPointerEventDetails.Count(); ++i)
+			{
+			if(iPointerEventDetails[i]->iEventHandler == aEventHandler)
+				{
+				
+				// If we are already sending dragging events to this handler
+				// we can return immediately
+				if(iPointerEventDetails[i]->iDragging) 
+					{
+					return ETrue;
+					}
+					
+				handlerFound = ETrue;
+				
+				// calculate moved distance in pixels
+				TPoint result = iInitialDownEvent.iPointerEvent.iPosition-aEvent.iPointerEvent.iPosition;
+								
+				// Do metric calculations
+			    THuiRealPoint tresholdInPx(iPointerEventDetails[i]->iXYMetric.iX.iMagnitude, iPointerEventDetails[i]->iXYMetric.iY.iMagnitude);
+			    if(iPointerEventDetails[i]->iXYMetric.iX.iUnit != EHuiUnitPixel) 
+			    	{
+			    	TReal32 reference = 0;
+			    	if (iPointerEventDetails[i]->iXYMetric.iX.iUnit == EHuiUnitRelativeToDisplay && iDisplay ) 
+			    		{
+			    		reference = iDisplay->VisibleArea().Width();
+			    		}
+			    	if (iPointerEventDetails[i]->iXYMetric.iX.iUnit == EHuiUnitS60  && iDisplay ) 
+			    		{
+			    		reference = iDisplay->UnitValue();
+			    		}			    		
+			    	tresholdInPx.iX = tresholdInPx.iX * reference;
+			    	}
+			    if(iPointerEventDetails[i]->iXYMetric.iY.iUnit != EHuiUnitPixel) 
+			    	{
+			    	TReal32 reference = 0;
+			    	if (iPointerEventDetails[i]->iXYMetric.iY.iUnit == EHuiUnitRelativeToDisplay && iDisplay ) 
+			    		{
+			    		reference = iDisplay->VisibleArea().Width();
+			    		}
+			    	if (iPointerEventDetails[i]->iXYMetric.iY.iUnit == EHuiUnitS60  && iDisplay ) 
+			    		{
+			    		reference = iDisplay->UnitValue();
+			    		}			    		
+			    	tresholdInPx.iY = tresholdInPx.iY * reference;
+			    	}
+			    
+			    // Check if we are outside of the threshold
+				if (result.iX < -tresholdInPx.iX || result.iX > tresholdInPx.iX||
+					result.iY < -tresholdInPx.iY ||	result.iY > tresholdInPx.iY	) 
+					{
+					iPointerEventDetails[i]->iDragging = ETrue;					
+					return ETrue;						
+					}
+				else
+					{
+					iPointerEventDetails[i]->iDragging = EFalse;
+					}
+				}
+			}
+			
+		// If no event handler found in iPointerEventDetails array,
+		// check with default threshold.
+		if(!handlerFound) 
+			{
+			TPoint result = iInitialDownEvent.iPointerEvent.iPosition-aEvent.iPointerEvent.iPosition;
+								
+			if (result.iX < -KDefaultDragTresholdInPixelsX || result.iX > KDefaultDragTresholdInPixelsX||
+				result.iY < -KDefaultDragTresholdInPixelsY || result.iY > KDefaultDragTresholdInPixelsY) 
+				{
+				// We need to add new event detail to store dragging flag
+				AddEventDetailsL(aEventHandler, THuiXYMetric(KDefaultDragTresholdInPixelsX, KDefaultDragTresholdInPixelsY), EFalse);
+				return DragEventOutOfRangeL(aEventHandler, aEvent);
+				}			
+			}		
+        }	
+	return EFalse;
+	}
+
+// Checks if long tap event is allowed to send.
+TBool CHuiRosterImpl::IsLongTapEventAllowed(MHuiEventHandler* aEventHandler)
+	{
+	for(TInt i = 0; i < iPointerEventDetails.Count(); ++i)
+		{
+		if(iPointerEventDetails[i]->iEventHandler == aEventHandler)
+			{
+			if ( iPointerEventDetails[i]->iDragging ) 
+				{
+				return !(iPointerEventDetails[i]->iDisableLongTapWhenDragging);				
+				}
+			}	
+        }	
+	return ETrue;
+	}
+
+
+void CHuiRosterImpl::SetDrawingExternalContent(TBool aEnable)
+	{
+	iDrawEvenIfDisabledDrawInRoster = aEnable;
+	}
+
+	
+TBool CHuiRosterImpl::IsDrawingExternalContent() const
+	{
+	return iDrawEvenIfDisabledDrawInRoster;
+	}
+
+void CHuiRosterImpl::RemoveExternalContentVisualFromParentL(CHuiVisual* aExternalContentVisual)
+    {
+    // External content is only used with canvas visuals, and the layouts of canvas visuals are always in the roster.
+    // Browse all layouts in the roster and check if they have a canvas visual as a child visual.
+    // Note: this can be slow operation, so it should only be done rarely.
+   
+    TInt visualCount = 0;
+    TInt entryCount = iEntries.Count();    
+    for(TInt j = 0; j < entryCount; ++j)
+    	{
+    	CHuiRosterEntry& entry = *iEntries[j]; // control group
+    	visualCount = entry.iRootVisuals.Count();
+        for(TInt i = 0; i < visualCount; ++i)
+        	{
+        	CHuiLayout* layout = dynamic_cast<CHuiLayout*>(entry.iRootVisuals[i]); // layout
+        	
+        	if (layout)
+        		{
+        		RemoveExternalContentVisualFromParentL(aExternalContentVisual,layout);
+        		}
+        	} 	
+    	}
+    }
+
+void CHuiRosterImpl::RemoveExternalContentVisualFromParentL(CHuiVisual* aExternalContentVisual, CHuiLayout* aLayout)
+	{
+	for(TInt k = 0; aLayout && k < aLayout->Count(); ++k)
+		{
+		CHuiCanvasVisual* canvasVisual = dynamic_cast<CHuiCanvasVisual*>(&(aLayout->Visual(k)));
+
+		if (canvasVisual)
+			{
+			if (canvasVisual->ExternalContent() == aExternalContentVisual)
+				{
+				// Remove aExternalContentVisual from the parent visual
+				canvasVisual->SetExternalContentL(NULL);
+				}
+			}
+		else
+			{
+			CHuiLayout* layoutVisual = dynamic_cast<CHuiLayout*>(&(aLayout->Visual(k)));
+			if ( layoutVisual)
+				{
+				RemoveExternalContentVisualFromParentL(aExternalContentVisual,layoutVisual);
+				}
+			}
+		}
+	}
+
+
+void CHuiRosterImpl::FreezeVisibleContentL(TBool aEnable)
+    {
+    if (aEnable)
+        {    
+        if (!iCanvasGc)
+            {
+            CHuiRenderPlugin& renderplugin = CHuiStatic::Renderer();
+            iCanvasGc = renderplugin.CreateCanvasGcL();
+            }    
+        if (!iCanvasRenderBuffer)
+            {
+            iCanvasRenderBuffer = iCanvasGc->CreateRenderBufferL(TSize(0,0));
+            iCanvasRenderBuffer->InitializeL(CHuiStatic::Env().Display(0).VisibleArea().Size());
+            iCanvasRenderBuffer->Copy(TPoint(0,0));    
+            iCanvasRenderBufferOrientation = CHuiStatic::Env().Display(0).Orientation();
+            }
+        }
+    else
+        {
+        delete iCanvasGc;
+        iCanvasGc = NULL;        
+        delete iCanvasRenderBuffer;
+        iCanvasRenderBuffer = NULL;
+        SetChanged();
+        }    
+    }
+
+TBool CHuiRosterImpl::IsVisibleContentFrozen() const
+    {
+    return ((iCanvasRenderBuffer != NULL) && (iCanvasGc != NULL));
+    }
+    
+void CHuiRosterImpl::EffectSetEffect(CHuiFxEffect* aEffect)
+    {
+    if (iEffect)
+        {
+        delete iEffect;
+        iEffect = NULL;
+        }
+    iEffect = aEffect;
+    SetChanged();
+    }
+
+TReal32 CHuiRosterImpl::EffectOpacityTarget() const
+    {
+    return iEffectOpacity; 
+    }
+
+void CHuiRosterImpl::EffectSetOpacity(TReal32 aOpacity)
+    {
+    iEffectOpacity = aOpacity;
+    }
+
+void CHuiRosterImpl::EffectDrawSelf( CHuiGc &aGc, const TRect & aDisplayRect) const
+    {
+    DrawSelf(aGc, iDisplay);
+    }
+
+THuiRealRect CHuiRosterImpl::EffectDisplayRect() const __SOFTFP
+    {
+    if (iDisplay)
+        {
+        return iDisplay->VisibleArea();
+        }
+    else
+        {
+        return THuiRealRect(TRect(0,0,0,0));
+        }    
+    }
+
+MHuiEffectable* CHuiRosterImpl::Effectable()
+    {
+    return this;
+    }
+
+void CHuiRosterImpl::SetLoadingEffect(TBool /*aLoading*/)
+    {
+    // not needed
+    }
+void CHuiRosterImpl::EffectSetSource( TBool aIsInput1 )
+    {
+    iIsInput1 = aIsInput1;
+    }
+
+TBool CHuiRosterImpl::EffectGetSource() const
+    {
+    return iIsInput1;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiS60Skin.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,427 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiS60Skin. CHuiS60Skin is a HUITK skin 
+*                that uses resources from the current S60 skin.
+*
+*/
+
+
+
+#include "uiacceltk/HuiS60Skin.h"  // Class definition
+#include "uiacceltk/HuiStatic.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiTextureManager.h"
+#include "uiacceltk/HuiTexture.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiDisplay.h"
+
+#include <AknsDrawUtils.h>
+#include <AknUtils.h>
+
+#include "huiskinbackroundlayout.h"
+
+
+struct TBackgroundTexture
+    {
+    TAknsItemID iID;
+    CHuiTexture* iBackgroundTexture;    //not owned
+    };
+    
+struct TPrivData
+    {
+    RArray<TBackgroundTexture> iBackgrounds;
+    };
+
+
+    
+EXPORT_C CHuiS60Skin::CHuiS60Skin(CHuiEnv& aEnv)
+    : CHuiSkin(aEnv)
+    {
+    iSpare = NULL;
+    }
+
+
+EXPORT_C void CHuiS60Skin::ConstructL()
+    {
+    iSkinControlContext = CAknsBasicBackgroundControlContext::NewL(
+        KAknsIIDQsnBgScreen, TRect(TPoint(0, 0), HuiUtil::ScreenSize()), ETrue);
+    iSpare = new (ELeave) TPrivData;
+    iSkinChanged = ETrue;
+    }
+
+
+EXPORT_C CHuiS60Skin::~CHuiS60Skin()
+    {
+    FreeBackgrounds();
+    delete (TPrivData*)(iSpare);
+    delete iSkinControlContext;
+    delete iBackgroundTexture;
+    if (iSkinSrvConnected)
+        iSkinSrvSession.Close();
+        
+   delete iBackgroundBitmap;
+    }
+
+
+EXPORT_C THuiSkinLocation CHuiS60Skin::Location(THuiSkinElement aElement)
+    {
+    // Changed so that correct cba location is asked from AknLayouUtils
+    switch(aElement)
+         {
+         case EHuiSkinElementSoftKeys:
+            {
+            THuiSkinLocation retValue;
+            AknLayoutUtils::TAknCbaLocation skLocation; 
+            skLocation = (AknLayoutUtils::TAknCbaLocation)CHuiStatic::CbaLocation();
+            switch ( skLocation )
+                {
+                default:
+                    // falltrough
+                case AknLayoutUtils::EAknCbaLocationBottom:
+                    {
+                    retValue = EHuiSkinLocationBottom;
+                    break;
+                    }
+                case AknLayoutUtils::EAknCbaLocationRight:
+                    {
+                    retValue = EHuiSkinLocationRight;
+                    break;
+                    }
+                case AknLayoutUtils::EAknCbaLocationLeft:
+                    {
+                    retValue = EHuiSkinLocationLeft;
+                    break;
+                    }
+                }
+            return retValue;
+            }
+
+        default:
+            {
+            return EHuiSkinLocationNone;
+            }
+        }
+   }
+
+
+MAknsSkinInstance* CHuiS60Skin::SkinInstance() const
+    {
+    MAknsSkinInstance* skin = 0;
+    if ( CCoeEnv::Static())
+        {
+        skin = AknsUtils::SkinInstance();
+        if(!skin )
+            {
+            TRAP_IGNORE( AknsUtils::InitSkinSupportL() )
+            skin = AknsUtils::SkinInstance();
+            }
+        }
+    return skin;
+    }
+
+
+void CHuiS60Skin::UpdateBackgroundL()
+    {
+    if(iBackgroundTexture)
+         {
+         iBackgroundTexture->Reset();
+         delete iBackgroundTexture;
+         iBackgroundTexture = 0;
+         }
+
+    HUI_DEBUG1(_L("CHuiS60Skin::UpdateBackgroundL - Free memory in the beginning: %i"), HuiUtil::FreeMemory());
+    iBackgroundTexture = CreateSkinBackgroundL(KAknsIIDQsnBgScreen);
+    iBackgroundTexture->SetSkinContent(ETrue);
+    iBackgroundTexture->iContentObservers.AppendL(*this);
+
+    HUI_DEBUG1(_L("CHuiS60Skin::UpdateBackgroundL - Free memory at exit: %i"), HuiUtil::FreeMemory());
+    }
+
+
+void CHuiS60Skin::SkinContentChanged()
+    {
+    iSkinChanged = ETrue;
+    }
+
+void CHuiS60Skin::SkinConfigurationChanged(
+    const TAknsSkinStatusConfigurationChangeReason aReason )
+    {
+    
+    }
+void CHuiS60Skin::SkinPackageChanged(
+    const TAknsSkinStatusPackageChangeReason aReason )
+    {
+    
+    }
+
+
+EXPORT_C const CHuiTexture& CHuiS60Skin::TextureL(TInt aSkinTextureId)
+    {
+    // Create S60 theme specific background texture
+
+    // If Bitgdi renderer is used, do not create a copy of background 
+    // image, but return the default dummy texture.
+    if(aSkinTextureId == EHuiSkinBackgroundTexture && 
+    	CHuiStatic::Renderer().Id () != EHuiRenderPluginBitgdi) 
+        {
+        if(!iBackgroundTexture || iReloadBackground || iSkinChanged)
+            {
+            UpdateBackgroundL();
+            iReloadBackground = EFalse;
+            }
+        return *iBackgroundTexture;
+        }
+        
+    // Otherwise use the default textures        
+    return CHuiSkin::TextureL(aSkinTextureId);
+    }
+
+
+EXPORT_C void CHuiS60Skin::ReleaseTexture(TInt aSkinTextureResource)
+    {
+    HUI_DEBUG(_L("CHuiS60Skin::ReleaseTexture() - Called."));
+    
+    // Release background texture
+    if(aSkinTextureResource == EHuiSkinBackgroundTexture)
+        {
+        HUI_DEBUG(_L("CHuiS60Skin::ReleaseTexture() - Destroying background texture."));
+        
+        delete iBackgroundTexture;
+        iBackgroundTexture = NULL;
+        }
+    else
+        {
+        // Otherwise use the default method
+        return CHuiSkin::ReleaseTexture(aSkinTextureResource);
+        }                
+    }
+
+
+EXPORT_C void CHuiS60Skin::NotifyDisplaySizeChangedL()
+    {
+    // The background is now different.
+    iReloadBackground = ETrue;
+    SkinContentChanged(); // for changing the iSkinChanged flag
+    Env().NotifySkinChangedL();
+    Env().TextStyleManager().NotifyDisplaySizeChangedL();
+    ReloadBgTexturesL();
+    }
+
+
+EXPORT_C TRgb CHuiS60Skin::StyleTextColor(THuiPreconfiguredTextStyle aStyle,
+                                          THuiBackgroundType aBackgroundType) const
+    {
+    // Default text color depends directly on the background type.
+    TRgb defaultColor = (aBackgroundType == EHuiBackgroundTypeLight? KRgbBlack : KRgbWhite);
+
+    switch(aStyle)
+        {
+        default:
+            break;
+
+        case EHuiTextStyleSupplement:
+            return TRgb(128, 128, 128);
+        }
+
+    return defaultColor;
+    }
+
+
+EXPORT_C void CHuiS60Skin::RestoreTextureContentL(CHuiTexture& aTexture)
+    {
+    if(&aTexture == iBackgroundTexture)
+        {
+        iReloadBackground = ETrue;
+        TextureL(EHuiSkinBackgroundTexture);
+        }
+    else
+        {
+        CHuiSkin::RestoreTextureContentL(aTexture);
+        }
+    }
+
+EXPORT_C void CHuiS60Skin::SkinExtension(const TUid& aExtensionUid, TAny** aExtensionParameters)
+    {
+    CHuiSkin::SkinExtension(aExtensionUid,aExtensionParameters);
+    }
+    
+EXPORT_C THuiSkinOrientation CHuiS60Skin::Orientation() const
+    {
+    return CHuiSkin::Orientation();
+    }
+         
+EXPORT_C void CHuiS60Skin::SetContext(CHuiGc& aGc)
+    {
+    CHuiSkin::SetContext(aGc);
+    }
+
+EXPORT_C CHuiGc& CHuiS60Skin::Context() const
+    {
+    return CHuiSkin::Context();
+    }
+
+EXPORT_C TInt CHuiS60Skin::GetTexture(TInt aSkinTextureResource, const CHuiTexture*& aOutTexture)
+    {
+    return CHuiSkin::GetTexture(aSkinTextureResource, aOutTexture);
+    }
+
+
+void CHuiS60Skin::FreeBackgrounds()
+    {
+    if (CHuiStatic::Renderer().Id () == EHuiRenderPluginBitgdi)
+        {
+        // no need to render the skin backgrounds separately on shitgdi
+        return;
+        }
+
+    if (!iSpare)
+        {
+        return;
+        }
+
+    TBackgroundTexture bgTexture;
+    TInt itemCount = ((TPrivData*)(iSpare))->iBackgrounds.Count(); 
+    for (TInt index = 0; index < itemCount; index++)
+        {
+        bgTexture = ((TPrivData*)(iSpare))->iBackgrounds[index];
+        delete bgTexture.iBackgroundTexture;
+        bgTexture.iBackgroundTexture = NULL;
+        }
+    ((TPrivData*)(iSpare))->iBackgrounds.Reset(); 
+    
+    }
+    
+    
+CHuiTexture* CHuiS60Skin::CreateSkinBackgroundL(const TAknsItemID& aID)
+    {
+    // Update the background image.
+    if (!iSkinSrvConnected)
+        {
+        User::LeaveIfError(iSkinSrvSession.Connect(this));
+        iSkinSrvConnected = ETrue;
+        }
+    
+    MAknsSkinInstance* skin = SkinInstance();
+    CHuiTexture* texture = CHuiTexture::NewL();
+    
+    CleanupStack::PushL(texture);            
+    if(iSkinChanged)
+         {
+     
+        delete iBackgroundBitmap; 
+        iBackgroundBitmap = NULL;
+        
+        if (skin)
+            {
+            TRect dummy;
+            TRect skinRect;
+            GetRectForItem(aID, dummy, skinRect);
+    
+            iBackgroundBitmap = new (ELeave) CFbsBitmap();
+            User::LeaveIfError( iBackgroundBitmap->Create(skinRect.Size(), EColor64K) );        
+    
+            CFbsBitmapDevice* device = CFbsBitmapDevice::NewL(iBackgroundBitmap);
+            CleanupStack::PushL(device);
+    
+            CFbsBitGc* gc = 0;
+            User::LeaveIfError( device->CreateContext(gc) );
+            CleanupStack::PushL(gc);
+            iSkinControlContext->SetRect(skinRect);
+            iSkinControlContext->SetBitmap(aID);
+    
+            AknsDrawUtils::DrawBackground(skin, iSkinControlContext, NULL, *gc, TPoint(0,0), skinRect,
+                              KAknsDrawParamDefault);
+    
+            CleanupStack::PopAndDestroy(gc);
+            CleanupStack::PopAndDestroy(device);
+            }
+        else
+            {
+            iBackgroundBitmap = CHuiStatic::GetBgBitmapLC(aID);   
+            CleanupStack::Pop( iBackgroundBitmap );
+            }
+         }
+    texture->UploadL(*iBackgroundBitmap,NULL,EHuiTextureUploadFlagRetainResolution );            
+    
+    CleanupStack::Pop(texture);
+    iSkinChanged = EFalse;
+    return texture;
+    }
+
+void CHuiS60Skin::ReloadBgTexturesL()
+    {
+    if (CHuiStatic::Renderer().Id () == EHuiRenderPluginBitgdi )
+        {
+        // no need to render the skin backgrounds separately on bitgdi
+        return;
+        }
+    TBackgroundTexture bgTexture;
+    TInt itemCount = ((TPrivData*)(iSpare))->iBackgrounds.Count(); 
+    for (TInt index = 0; index < itemCount; index++)
+        {
+        bgTexture = ((TPrivData*)(iSpare))->iBackgrounds[index];
+        delete bgTexture.iBackgroundTexture;
+        bgTexture.iBackgroundTexture = CreateSkinBackgroundL(bgTexture.iID);
+        ((TPrivData*)(iSpare))->iBackgrounds[index] = bgTexture;
+        }
+    }
+
+void CHuiS60Skin::UpdateBackgroundsL(const RArray<THuiDisplayBackgroundItem>& aItems)
+    {
+    if (CHuiStatic::Renderer().Id () == EHuiRenderPluginBitgdi)
+        {
+        // no need to render the skin backgrounds separately on shitgdi
+        return;
+        }
+    FreeBackgrounds();    
+    
+    THuiDisplayBackgroundItem bgItem;
+    TBackgroundTexture bgTexture;
+    for (TInt index = 0; index < aItems.Count(); index++)
+        {
+        bgItem = aItems[index];
+        if (bgItem.ClearMode() == CHuiDisplay::EClearWithSkinBackground)
+            {
+            bgTexture.iID = bgItem.SkinBackground();
+            bgTexture.iBackgroundTexture = CreateSkinBackgroundL(bgItem.SkinBackground());
+            ((TPrivData*)(iSpare))->iBackgrounds.Append(bgTexture);
+            }
+        }           
+    }
+
+EXPORT_C CHuiTexture* CHuiS60Skin::BackgroundTexture(const TAknsItemID& aID)
+    {
+    if (CHuiStatic::Renderer().Id () == EHuiRenderPluginBitgdi)
+        {
+        // only opengl has separate skin bg textures.
+        return NULL;
+        }
+    if (!iSpare)
+        {
+        return NULL;
+        }
+    TBackgroundTexture bgTexture;
+    TInt itemCount = ((TPrivData*)(iSpare))->iBackgrounds.Count(); 
+    for (TInt index = 0; index < itemCount; index++)
+        {
+        bgTexture = ((TPrivData*)(iSpare))->iBackgrounds[index];
+        if (bgTexture.iID == aID)
+            {
+            return bgTexture.iBackgroundTexture;
+            }
+        }
+    return NULL;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiS60TextStyle.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   A Text style encapsulates a unique text style 
+*                in Hitchcock UI Toolkit usage.
+*
+*/
+
+
+
+#include <AknUtils.h>
+#include <AknLayoutFont.h>
+#include <AknFontSpecification.h>
+
+#include "HuiS60TextStyle.h"
+
+
+EXPORT_C THuiS60TextStyle::THuiS60TextStyle(TInt aFontStyleId, TInt aParentId)
+    : THuiTextStyle(aFontStyleId, aParentId)
+    {
+    Init();
+    }
+
+void THuiS60TextStyle::Init()
+    {
+    if (!CCoeEnv::Static())
+        {
+        return;
+        }
+		
+    TFontSpec fs; 
+    // note that we can use CAknLayoutFont::AsCAknLayoutFontOrNull to downcast
+    const CAknLayoutFont* font = AknLayoutUtils::LayoutFontFromId(iFontStyleId, NULL);
+    fs = font->FontSpecInTwips();
+    
+    // Define everything that is found from the TFontSpec
+    iLocalDefinitionFlags |= KTextSizeDefined;
+    iLocalDefinitionFlags |= KStrokeWeightDefined;
+    iLocalDefinitionFlags |= KPostureDefined;
+    iLocalDefinitionFlags |= KFontDefined;
+
+    iFont.SetFontSpec(fs); 
+    THuiFont huiFont(0, fs);
+    
+    // transfer the text pane height between the different font specs
+    TAknFontSpecification aknFs = font->FontSpecification();
+    huiFont.SetTextPaneHeight(aknFs.TextPaneHeight());
+    
+    SetFont(huiFont);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiScheduler.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,214 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "uiacceltk/HuiScheduler.h"  // Class definition
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiCommand.h"
+#include "uiacceltk/HuiEvent.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiUtil.h"
+
+#include "uiacceltk/HuiPanic.h"
+
+
+CHuiScheduler::CHuiScheduler(CHuiEnv& aEnv)
+        : iEnv(aEnv)
+    {
+    }
+
+CHuiScheduler::~CHuiScheduler()
+    {
+    for(TInt i = iPendingCommands.Count() - 1; i >= 0; --i)
+        {
+        RemovePendingCommand(i);
+        }
+    iPendingCommands.Close();
+    }
+    
+    
+void CHuiScheduler::RemovePendingCommand(TInt aIndex)
+    {
+    delete iPendingCommands[aIndex].iCommand;
+    iPendingCommands[aIndex].iCommand = NULL;
+    iPendingCommands.Remove(aIndex);
+    }
+
+
+void CHuiScheduler::AdvanceTime(TReal32 /*aElapsedTime*/)
+    {
+    TTime now = CHuiStatic::Time();
+
+    // Check the pending commands. They are iterated in chronological order
+    // so that commands with the same execution time will be executed in
+    // the same order as they were posted.    
+
+    /** @todo  Could be done more efficiently. Priority queue? */
+    
+    for(TInt i = 0; i < iPendingCommands.Count(); ++i)
+        {
+        if(iPendingCommands[i].iExecutionTime <= now)
+            {
+            // The execution of the command may modify the list of pending
+            // commands. Take the command out of the pending array first.
+            const THuiCommand* command = iPendingCommands[i].iCommand;
+            iPendingCommands.Remove(i);
+
+            // Must trap because the command is not on the cleanup stack.
+            TRAPD(err, command->ExecuteL(iEnv));
+            if(err != KErrNone)
+                {
+                HUI_DEBUG1(_L("CHuiScheduler::AdvanceTime() - Leave %i during command execution."), err);
+                }
+
+            delete command; 
+            command = NULL;
+
+            // Check through the list of pending again, in case there
+            // were alterations.
+            i = -1;
+            }
+        }
+    }
+
+
+void CHuiScheduler::PostCommandL(const THuiCommand& aCommand,
+                                 TInt aTransitionTime)
+    {
+    if(aTransitionTime > 0)
+        {
+        // Make a copy of the command.
+        const THuiCommand* data = (const THuiCommand*) new (ELeave) TUint8[aCommand.Size()];
+        CleanupStack::PushL((TAny*)data);
+        Mem::Copy((TAny*)data, (TAny*)&aCommand, aCommand.Size());
+        
+        // Won't be executed yet.
+        TDelayedCommand delayed(data);
+        delayed.iExecutionTime = CHuiStatic::Time() +
+            TTimeIntervalMicroSeconds32(1000 * aTransitionTime);
+        User::LeaveIfError( iPendingCommands.Append(delayed) ); 
+        CleanupStack::Pop((TAny*)data);
+        }
+    else
+        {
+        // Execute immediately.
+        aCommand.ExecuteL(iEnv);
+        }
+    }
+
+
+void CHuiScheduler::CancelCommands(const TAny* aObject)
+    {
+    for(TInt i = iPendingCommands.Count() - 1; i >= 0; --i)
+        {
+        const THuiObjectCommand* objectCommand = iPendingCommands[i].iCommand->ObjectCommand();
+        if(objectCommand && objectCommand->Object() == aObject)
+            {
+            // Cancel this one.
+            RemovePendingCommand(i);
+            }
+        }
+    }
+
+
+void CHuiScheduler::CancelCommands(const TAny* aObject, THuiOp aCommandOperation)
+    {
+    for(TInt i = iPendingCommands.Count() - 1; i >= 0; --i)
+        {
+        const THuiObjectCommand* objectCommand = iPendingCommands[i].iCommand->ObjectCommand();
+        if(objectCommand && 
+           objectCommand->Object() == aObject &&
+           objectCommand->Operation() == aCommandOperation)
+            {
+            // Cancel this one.
+            RemovePendingCommand(i);
+            }
+        }
+    }
+    
+    
+void CHuiScheduler::CancelCommands(const TAny* aObject,
+                                   THuiCommandType aCommandType,
+                                   TInt aParam)
+    {
+    for(TInt i = iPendingCommands.Count() - 1; i >= 0; --i)
+        {
+        const THuiObjectCommand* objectCommand = iPendingCommands[i].iCommand->ObjectCommand();
+
+        if(objectCommand && 
+           objectCommand->Object() == aObject &&
+           objectCommand->Type() == aCommandType)
+            {
+            if(objectCommand->Type() == EHuiCommandTypeCustomEvent)
+                {
+                const THuiCustomEventCommand* cec = 
+                    static_cast<const THuiCustomEventCommand*>( objectCommand );
+                    
+                if(cec->Param() != aParam)
+                    {
+                    // Not this one, wrong parameter.
+                    continue;
+                    }
+                }
+            // Cancel this one.
+            RemovePendingCommand(i);
+            }
+        }
+    }
+
+
+TInt CHuiScheduler::TimeUntilCommand(const TAny* aObject,
+                                     THuiCommandType aCommandType)
+    {
+    TTime now = CHuiStatic::Time();
+    TInt earliest = -1;
+
+    for(TInt i = 0; i < iPendingCommands.Count(); ++i)
+        {
+        const THuiObjectCommand* objectCommand = iPendingCommands[i].iCommand->ObjectCommand();
+        if(objectCommand &&
+           objectCommand->Object() == aObject &&
+           objectCommand->Type() == aCommandType)
+            {
+            TInt remaining =
+#ifndef EKA2
+                iPendingCommands[i].iExecutionTime.MicroSecondsFrom(now).Int64().GetTInt() / 1000;
+#else
+                I64LOW(iPendingCommands[i].iExecutionTime.MicroSecondsFrom(now).Int64()) / 1000;
+#endif
+
+            if(remaining < 0)
+                {
+                /** @todo  Should never happen? */
+                remaining = 0;
+                }
+            if(earliest < 0 || remaining < earliest)
+                {
+                earliest = remaining;
+                }
+            }
+        }
+
+    return earliest;
+    }
+
+
+TInt CHuiScheduler::PendingCount() const
+    {
+    return iPendingCommands.Count();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiSegmentedTexture.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation for non-pure-virtual methods in MHuiSegmentedTexture.
+*
+*/
+
+
+
+#include "uiacceltk/HuiSegmentedTexture.h"
+#include "uiacceltk/HuiStatic.h"
+#include "HuiRenderSurface.h"
+#include "uiacceltk/HuiTextureHandle.h"
+
+
+EXPORT_C MHuiSegmentedTexture::~MHuiSegmentedTexture()
+    {
+    }
+
+
+EXPORT_C THuiTextureHandle MHuiSegmentedTexture::Handle(TInt aSegment) const
+    {
+    return THuiTextureHandle(SegmentName(aSegment), 
+                             SegmentSize(aSegment), 
+                             SegmentTextureSize(aSegment));
+    }
+
+
+EXPORT_C void MHuiSegmentedTexture::Bind(TInt aSegment, TInt aTextureUnit) const
+    {
+    // Activate the correct texture unit.
+    if(CHuiStatic::CurrentRenderSurface())
+        {
+        CHuiStatic::CurrentRenderSurface()->BindTexture(aTextureUnit, *this, aSegment);
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiShadowBorderBrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,169 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiShadowBorderBrush - Shadow borders for visuals.
+*
+*/
+
+
+
+#include "uiacceltk/HuiShadowBorderBrush.h"  // Class definition
+#include "uiacceltk/HuiDrawing.h"
+#include "uiacceltk/HuiVisual.h"
+#include "uiacceltk/HuiUtil.h"
+
+/** Default shadow opacity. */
+const TReal32 KHuiShadowBorderBrushOpacity = 100.f/255.f;
+
+
+EXPORT_C CHuiShadowBorderBrush* CHuiShadowBorderBrush::NewL(TInt aWidth)
+    {
+    CHuiShadowBorderBrush* self = NewLC(aWidth);
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+EXPORT_C CHuiShadowBorderBrush* CHuiShadowBorderBrush::NewLC(TInt aWidth)
+    {
+    CHuiShadowBorderBrush* self = new (ELeave) CHuiShadowBorderBrush(aWidth);
+    CleanupStack::PushL(self);
+    return self;
+    }
+
+EXPORT_C CHuiShadowBorderBrush* CHuiShadowBorderBrush::NewL(const THuiMetric& aWidth)
+    {
+    CHuiShadowBorderBrush* self = NewLC(aWidth);
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+EXPORT_C CHuiShadowBorderBrush* CHuiShadowBorderBrush::NewLC(const THuiMetric& aWidth)
+    {
+    CHuiShadowBorderBrush* self = new (ELeave) CHuiShadowBorderBrush(aWidth);
+    CleanupStack::PushL(self);
+    return self;
+    }
+ 
+
+CHuiShadowBorderBrush::CHuiShadowBorderBrush(TInt aWidth)
+        : CHuiBrush(),
+          iWidth(TReal32(aWidth))
+    {
+    SetClipToVisual(EFalse);
+    iOpacity.Set(KHuiShadowBorderBrushOpacity);
+    }
+
+CHuiShadowBorderBrush::CHuiShadowBorderBrush(const THuiMetric& aWidth)
+        : CHuiBrush(),
+          iWidth(aWidth.iMagnitude),
+          iMetricWidth(aWidth)
+    {    
+    SetClipToVisual(EFalse);
+    iOpacity.Set(KHuiShadowBorderBrushOpacity);
+    }
+
+CHuiShadowBorderBrush::~CHuiShadowBorderBrush()
+    {
+    }
+
+
+void CHuiShadowBorderBrush::ExpandVisualRect(TRect& aRect) const
+    {
+    // We need access to visual to convert metric units into pixels,
+    // currently a pointer to visual is provided through separate
+    // method since we want to avoid breaking binary compatibility 
+    // of this class.
+    TReal32 widthInPixels = WidthInPixels(BrushGuide()); 
+    aRect.Grow(HUI_ROUND_FLOAT_TO_INT(widthInPixels), HUI_ROUND_FLOAT_TO_INT(widthInPixels)); 
+    }
+    
+TBool CHuiShadowBorderBrush::Changed() const
+    {
+    if ( CHuiBrush::Changed() )
+        {
+        return ETrue;
+        }
+    
+    return iWidth.Changed();
+    }
+
+void CHuiShadowBorderBrush::ClearChanged()
+    {
+    CHuiBrush::ClearChanged();
+    iWidth.ClearChanged();
+    }
+
+void CHuiShadowBorderBrush::Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const
+    {
+    TRect content = aGuide.BrushRect().Round();
+    TReal32 opacity = aGuide.BrushOpacity() * iOpacity.Now();
+
+    if(opacity <= 0)
+        {
+        return;
+        }
+
+    aGc.SetPenAlpha(TInt(opacity * 255));
+    aGc.SetPenColor(TRgb(0, 0, 30));
+
+    const CHuiTexture* shadowTexture = NULL;
+    TInt err = aGuide.BrushSkin().GetTexture(EHuiSkinShadowTexture, shadowTexture);
+    if (err!=KErrNone)
+    	{
+    	ASSERT(EFalse); // failed to get the shadow texture - unable to proceed!
+    	return;
+	    }
+    ASSERT(shadowTexture);
+    THuiImage shadowImage(*shadowTexture);
+
+    aGc.Disable(CHuiGc::EFeatureDepthWrite);
+    
+    TReal32 widthInPixels = WidthInPixels(BrushGuide()); 
+    content.Grow(HUI_ROUND_FLOAT_TO_INT(widthInPixels), HUI_ROUND_FLOAT_TO_INT(widthInPixels)); 
+    
+    // ID:  EHJK-7G5AHB - shadow border leaves artifacts in the display while visual is moved.
+    TReal32 offset = 0.0f; // NOTE: It was 1.f. 
+
+    // Note: DrawBorders does not (yet) support different widths for every border.
+    aGc.DrawBorders(content, 
+                    widthInPixels-offset, 
+                    widthInPixels+offset, 
+                    widthInPixels-offset, 
+                    widthInPixels+offset, 
+                    CHuiGc::EBorderImage, 
+                    &shadowImage);            
+
+    aGc.Enable(CHuiGc::EFeatureDepthWrite);
+    }
+    
+EXPORT_C void CHuiShadowBorderBrush::SetWidth(const THuiMetric& aWidth)
+    {
+    iMetricWidth = aWidth;
+    iWidth.Set(aWidth.iMagnitude);      
+    }
+
+
+TReal32 CHuiShadowBorderBrush::WidthInPixels(const CHuiVisual* aVisual) const
+    {
+    TReal32 widthInPixels = iWidth.Now(); // Default to old pixel width
+    if (aVisual)
+        {
+        THuiMetric metric = iMetricWidth;
+        metric.iMagnitude = widthInPixels;        
+        widthInPixels = aVisual->MetricToPixels(THuiXYMetric(metric, metric)).iX; // Calculate metric width in pixels  
+        }    
+    return widthInPixels;            
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiSkin.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,273 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiSkin. CHuiSkin is the abstract base 
+*                class of skins.
+*
+*/
+
+
+
+#include "uiacceltk/HuiSkin.h"  // Class definition
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiStatic.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiTexture.h"
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiDisplay.h" 
+
+CHuiSkin::CHuiSkin(CHuiEnv& aEnv)
+        : iEnv(aEnv)
+    {
+    }
+
+
+CHuiSkin::~CHuiSkin()
+    {
+    delete iShadowTexture;
+    delete iLineTexture;
+    delete iGlyphShadowTexture;
+    iGc = NULL;
+    }
+
+
+EXPORT_C THuiSkinOrientation CHuiSkin::Orientation() const
+    {
+    TSize screenSize = HuiUtil::ScreenSize();
+    if(screenSize.iWidth > screenSize.iHeight)
+        {
+        return EHuiSkinOrientationLandscape;
+        }
+    return EHuiSkinOrientationPortrait;
+    }
+
+
+EXPORT_C THuiSkinLocation CHuiSkin::Location(THuiSkinElement /*aElement*/)
+    {
+    // The default skin has no opinion on element locations.
+    return EHuiSkinLocationNone;
+    }
+
+
+EXPORT_C void CHuiSkin::NotifyDisplaySizeChangedL()
+    {
+    for(TInt i=0;i<iEnv.DisplayCount();i++)
+    	{
+    	(iEnv.Display(i)).SetDirty();	
+    	}
+    }
+
+
+EXPORT_C void CHuiSkin::SetContext(CHuiGc& aGc)
+    {
+    iGc = &aGc;
+    }
+
+
+EXPORT_C CHuiGc& CHuiSkin::Context() const
+    {
+    __ASSERT_ALWAYS(iGc != NULL,
+                    THuiPanic::Panic(THuiPanic::ESkinHasNoGraphicsContext));
+    return *iGc;
+    }
+
+EXPORT_C const CHuiTexture& CHuiSkin::TextureL(TInt aSkinTextureId)
+    {
+    return TextureL(aSkinTextureId, EFalse /* don't force prepare */);
+    }
+
+
+const CHuiTexture& CHuiSkin::TextureL(TInt aSkinTextureId, TBool aForcedPrepare)
+    {
+    TBool prepare = aForcedPrepare;
+    
+    switch(aSkinTextureId)
+        {
+        // Default background skin texture implementation only returns blank texture.
+        case EHuiSkinBackgroundTexture:
+            return iEnv.TextureManager().BlankTexture();
+
+        // Return shadow texture. Create if necessary.
+        case EHuiSkinShadowTexture:
+            if(!iShadowTexture)
+                {
+                iShadowTexture = CHuiTexture::NewL();
+                iShadowTexture->iContentObservers.AppendL(*this);
+                prepare = ETrue;
+                }
+            if(prepare)
+                {
+                PrepareShadowTextureL(*iShadowTexture);
+                }
+            return *iShadowTexture;
+
+        // Return glyph shadow texture. Create if necessary.
+        case EHuiSkinGlyphShadowTexture:
+            if(!iGlyphShadowTexture)
+                {
+                iGlyphShadowTexture = CHuiTexture::NewL();
+                iGlyphShadowTexture->iContentObservers.AppendL(*this);
+                prepare = ETrue;
+                }
+            if(prepare)
+                {
+                PrepareGlyphShadowTextureL(*iGlyphShadowTexture);
+                }
+            return *iGlyphShadowTexture;
+
+        // Return line texture. Create if necessary.
+        case EHuiSkinLineTexture:
+            if(!iLineTexture)
+                {
+                iLineTexture = CHuiTexture::NewL();
+                iLineTexture->iContentObservers.AppendL(*this);
+                prepare = ETrue;
+                }
+            if(prepare)
+                {
+                PrepareLineTextureL(*iLineTexture);
+                }
+            return *iLineTexture;
+
+        // Specified skin texture id is not supported.
+        default:
+            HUI_DEBUG1(_L("CHuiSkin::TextureL() - Skin texture id: %i not supported."), aSkinTextureId);
+            User::Leave(KErrNotSupported);
+            break;
+        }
+
+    // Never reached
+    return iEnv.TextureManager().BlankTexture();
+    }
+
+
+EXPORT_C void CHuiSkin::ReleaseTexture(TInt aSkinTextureResource)
+    {   
+    switch(aSkinTextureResource)
+        {
+        case EHuiSkinShadowTexture:
+            delete iShadowTexture;
+            iShadowTexture = NULL;
+            break;
+
+        case EHuiSkinGlyphShadowTexture:
+            delete iGlyphShadowTexture;
+            iGlyphShadowTexture = NULL;
+            break;
+
+        case EHuiSkinLineTexture:
+            delete iLineTexture;
+            iLineTexture = NULL;
+            break;
+
+        default:
+            break;
+        }
+    }
+
+
+EXPORT_C TInt CHuiSkin::GetTexture(TInt aSkinTextureId, const CHuiTexture*& aOutTexture)
+    {
+    // Try to access the texture.
+    TRAPD(err, aOutTexture = &TextureL(aSkinTextureId));
+
+    if(err != KErrNone)
+        {
+        // If texture creation failed set out texture to blank texture
+        aOutTexture = &iEnv.TextureManager().BlankTexture();
+        }
+
+    return err;
+    }
+
+
+void CHuiSkin::PrepareShadowTextureL(CHuiTexture& aTexture)
+    {
+    aTexture.GenerateBlobL(TSize(16, 16));
+    }
+
+
+void CHuiSkin::PrepareGlyphShadowTextureL(CHuiTexture& /*aTexture*/) 
+    {
+    }
+
+
+void CHuiSkin::PrepareLineTextureL(CHuiTexture& aTexture)
+    {
+    const TUint8 lineData[2 * 16 * 4] =
+        {
+          0,   0,   0, 0,          0,   0,   0,  0,
+          0,   0, 128, 0*8/10,       0,   0, 128, 0*8/10,
+          0,   0, 128, 8*8/10,       0,   0, 128, 8*8/10,
+          0,   0, 128, 16*8/10,      0,   0, 128, 16*8/10,
+          0,   0, 128, 32*8/10,      0,   0, 128, 32*8/10,
+         64,  64, 128, 64*8/10,     64,  64, 128, 64*8/10,
+        128, 128, 192, 128,      128, 128, 192, 128,
+        255, 255, 255, 255,      255, 255, 255, 255,
+        255, 255, 255, 255,      255, 255, 255, 255,
+        128, 128, 192, 128,      128, 128, 192, 128,
+         64,  64, 128, 64*8/10,     64,  64, 128, 64*8/10,
+          0,   0, 128, 32*8/10,      0,   0, 128, 32*8/10,
+          0,   0, 128, 16*8/10,      0,   0, 128, 16*8/10,
+          0,   0, 128, 8*8/10,       0,   0, 128,  8*8/10,
+          0,   0, 128, 0*8/10,       0,   0, 128,  0*8/10,
+          0,   0,   0, 0,          0,   0,   0,  0
+
+        };
+
+    aTexture.UploadL(EHuiTextureFormatRgba8888, TSize(2, 16), lineData);
+    }
+
+
+EXPORT_C void CHuiSkin::TextureContentUploaded(CHuiTexture& /*aTexture*/)
+    {
+    HUI_DEBUG(_L("CHuiSkin::TextureContentUploaded() - Called."));
+    }
+    
+
+EXPORT_C void CHuiSkin::TextureContentReleased(CHuiTexture& /*aTexture*/)
+    {
+    HUI_DEBUG(_L("CHuiSkin::TextureContentReleased() - Called."));
+    }
+
+
+EXPORT_C void CHuiSkin::RestoreTextureContentL(CHuiTexture& aTexture)
+    {
+    HUI_DEBUG(_L("CHuiSkin::RestoreTextureContentL() - Called."));
+      
+    // Restore the textures that existed prior to release.
+    if(&aTexture == iShadowTexture)
+        {
+        TextureL(EHuiSkinShadowTexture, ETrue);
+        }
+    else if(&aTexture == iGlyphShadowTexture)
+        {
+        TextureL(EHuiSkinGlyphShadowTexture, ETrue);
+        }
+    else if(&aTexture == iLineTexture)
+        {
+        TextureL(EHuiSkinLineTexture, ETrue);
+        }
+    else
+        {
+        // for PC lint
+        }
+    }
+
+void CHuiSkin::SkinExtension(const TUid& /*aExtensionUid*/, TAny** /*aExtensionParameters*/)
+    {
+    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiSoftKeyControl.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,433 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of a soft key control class. CHuiSoftKeyControl 
+*                is a control that displays the soft key labels and handles 
+*                soft key input events.
+*
+*/
+
+
+
+#include "uiacceltk/HuiSoftKeyControl.h"  // Class definition
+#include "uiacceltk/HuiTextVisual.h"
+#include "uiacceltk/HuiEvent.h"
+#include "uiacceltk/HuiDisplay.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiCommand.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiAnchorLayout.h"
+#include "uiacceltk/HuiBrushes.h"
+
+const TReal32 KLabelHeightFactor = 0.1f; // Soft key label height relative to display height.
+const TReal32 KLabelWidthFactor = 0.25f; // Soft key label width relative to display width.
+const TUint KDefaultExitTransitionTime = 500; // Default exit animation transition time.
+const TUint KDefaultEnterTransitionTime = 500; // Default exit animation transition time.
+
+EXPORT_C CHuiSoftKeyControl* CHuiSoftKeyControl::NewL(CHuiEnv& aEnv)
+    {
+    CHuiSoftKeyControl* self = NewLC(aEnv);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+EXPORT_C CHuiSoftKeyControl* CHuiSoftKeyControl::NewLC(CHuiEnv& aEnv)
+    {
+    CHuiSoftKeyControl* self = new (ELeave) CHuiSoftKeyControl(aEnv);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+
+CHuiSoftKeyControl::CHuiSoftKeyControl(CHuiEnv& aEnv)
+        : CHuiControl(aEnv), iCurrentLocation(EHuiSkinLocationNone),
+        iExitTransitionTime(KDefaultExitTransitionTime),
+        iEnterTransitionTime(KDefaultEnterTransitionTime)
+    {
+    }
+
+
+void CHuiSoftKeyControl::ConstructL()
+    {
+    // Append anchor layout to be used to align the label visuals relatively to display
+    iLayout = (CHuiAnchorLayout*)(AppendLayoutL(EHuiLayoutTypeAnchor));
+
+    // Create left soft key label visual and align it using anchor layout
+    iLeftLabel = CHuiTextVisual::AddNewL(*this, iLayout);
+    iLeftLabel->SetAlign(EHuiAlignHLeft, EHuiAlignVBottom);
+    iLeftLabel->SetStyle(EHuiTextStyleSoftkey, EHuiBackgroundTypeDark);
+    iLeftLabel->SetPadding(TPoint(2, 3));
+
+    // Create right soft key label visual and align it using anchor layout
+    iRightLabel = CHuiTextVisual::AddNewL(*this, iLayout);
+    iRightLabel->SetAlign(EHuiAlignHRight, EHuiAlignVBottom);
+    iRightLabel->SetStyle(EHuiTextStyleSoftkey, EHuiBackgroundTypeDark);
+    iRightLabel->SetPadding(TPoint(2, 3));    
+
+    //iRightLabel->SetFlag(EHuiVisualFlagLayoutUpdateNotification);
+    iLayout->SetFlag(EHuiVisualFlagLayoutUpdateNotification);
+    }
+
+
+EXPORT_C void CHuiSoftKeyControl::SetBackgroundType(THuiBackgroundType aBackgroundType)
+    {
+    iLeftLabel->SetStyle(EHuiTextStyleSoftkey, aBackgroundType);
+    iRightLabel->SetStyle(EHuiTextStyleSoftkey, aBackgroundType);
+    }
+
+
+CHuiSoftKeyControl::~CHuiSoftKeyControl()
+    {
+    delete iLeftText;
+    delete iRightText;
+    
+    iRightLabel = NULL;
+    iRightLabelImageBrush = NULL;
+    iLayout = NULL;
+    }
+
+
+
+EXPORT_C void CHuiSoftKeyControl::SetLabelL(THuiSoftKeyPosition aKeyPos, const TDesC& aText, TBool aAnimateControl)
+    {
+    // Animate softkey label change, if a valid softkey location is set.
+    if(iCurrentLocation != EHuiSkinLocationNone)
+        {
+        if(aKeyPos == EHuiSoftKeyLower || aKeyPos == EHuiSoftKeyLeft)
+            {
+            // Exit view, animate only the changed softkey.
+            ExitView(ESoftkeyLabelLeft | (aAnimateControl ? ESoftkeyLabelRight : 0));
+            // Cache label text
+            delete iLeftText;
+            iLeftText = NULL;
+            iLeftText = aText.AllocL();
+            }
+        else
+            {
+            // Exit view, animate only the changed softkey.
+            ExitView(ESoftkeyLabelRight | (aAnimateControl ? ESoftkeyLabelLeft : 0));
+            // Cache label text
+            delete iRightText;
+            iRightText = NULL;
+            iRightText = aText.AllocL();
+            }
+
+        // Update label(s) after softkey has exited the view.
+        if(aAnimateControl)
+            {
+            Env().Send(THuiCustomEventCommand(ECustomEventUpdateLabels, this), iExitTransitionTime);
+            }
+        else
+            {
+            Env().Send(THuiCustomEventCommand(ECustomEventUpdateLabel, this), iExitTransitionTime);
+            }
+        }
+    else
+        {
+        /** @todo  Display orientation affects how the key positions are
+                   interpreted? */
+
+        if(aKeyPos == EHuiSoftKeyLower || aKeyPos == EHuiSoftKeyLeft)
+            {
+            iLeftLabel->SetTextL(aText);
+            }
+        else
+            {
+            iRightLabel->SetTextL(aText);
+            }
+        }                
+    }
+
+/**
+ * Sets background image to the softkeys.
+ */
+EXPORT_C void CHuiSoftKeyControl::SetBackgroundL(THuiImage image, TInt aLeftBorderWidth, TInt aRightBorderWidth)
+    {
+    // Create image brush for left softkey (if needed)
+    if (iLeftLabelImageBrush==NULL)
+        {
+        iLeftLabel->EnableBrushesL();
+        iLeftLabelImageBrush = CHuiImageBrush::NewL(image);
+        iLeftLabelImageBrush->SetBorders(aLeftBorderWidth, aRightBorderWidth, 0, 0);
+        iLeftLabel->Brushes()->AppendL(iLeftLabelImageBrush, EHuiHasOwnership);
+        }
+    else
+        {
+        // Set background image for the softkey
+        iLeftLabelImageBrush->SetImage(image);
+        iLeftLabelImageBrush->SetBorders(aLeftBorderWidth, aRightBorderWidth, 0, 0);
+        }
+
+    // Create image brush for right softkey (if needed)
+    if (iRightLabelImageBrush==NULL)
+        {
+        iRightLabel->EnableBrushesL();
+        iRightLabelImageBrush = CHuiImageBrush::NewL(image);
+        iRightLabelImageBrush->SetBorders(aLeftBorderWidth, aRightBorderWidth, 0, 0);
+        iRightLabel->Brushes()->AppendL(iRightLabelImageBrush, EHuiHasOwnership);
+        }
+    else
+        {
+        // Set background image for the softkey
+        iRightLabelImageBrush->SetImage(image);
+        iRightLabelImageBrush->SetBorders(aLeftBorderWidth, aRightBorderWidth, 0, 0);
+        }
+
+    }
+
+
+EXPORT_C void CHuiSoftKeyControl::SetAnimationTimes( TUint aEnterTransition, TUint aExitTransition )
+    {
+    iEnterTransitionTime = aEnterTransition;
+    iExitTransitionTime = aExitTransition;
+    }
+
+
+EXPORT_C void CHuiSoftKeyControl::EnterView(TUint aLabelMask)
+    {
+    // Show control
+    TRAP_IGNORE(ShowL( *Display() ))
+
+    // Set anchor points to target
+    SetAnchorPoints(iCurrentLocation, ETrue, aLabelMask);
+
+    // Do the transition
+    iLayout->UpdateChildrenLayout(iEnterTransitionTime);
+    }
+
+
+EXPORT_C void CHuiSoftKeyControl::ExitView(TUint aLabelMask)
+    {
+    ExitView(iCurrentLocation, aLabelMask);
+    }
+
+
+TBool CHuiSoftKeyControl::OfferEventL(const THuiEvent& aEvent)
+    {
+    if(aEvent.IsCustomEvent())
+        {
+        if(aEvent.iParam == ECustomEventEnterView)
+            {
+            // Hide soft keys first
+            SetAnchorPoints(iCurrentLocation, EFalse);
+            iLayout->UpdateChildrenLayout(0);
+
+            // Enter soft keys to view
+            EnterView();
+            return ETrue;
+            }
+        if(aEvent.iParam == ECustomEventUpdateLabels || aEvent.iParam == ECustomEventUpdateLabel)
+            {
+            if(iLeftText)
+                {
+                // Define label update mask
+                TUint labelMask = ESoftkeyLabelLeft | ((aEvent.iParam == ECustomEventUpdateLabels) ? ESoftkeyLabelRight : 0);
+
+                // Hide soft key(s) first
+                SetAnchorPoints(iCurrentLocation, EFalse, labelMask);
+                iLayout->UpdateChildrenLayout(0);
+
+                // Update label text
+                iLeftLabel->SetTextL(*iLeftText);
+                delete iLeftText;
+                iLeftText = 0;
+
+                // Enter soft key(s) to view
+                EnterView(labelMask);
+                }
+            if(iRightText)
+                {
+                // Define label update mask
+                TUint labelMask = ESoftkeyLabelRight | ((aEvent.iParam == ECustomEventUpdateLabels) ? ESoftkeyLabelLeft : 0);
+
+                // Hide soft key(s) first
+                SetAnchorPoints(iCurrentLocation, EFalse, labelMask);
+                iLayout->UpdateChildrenLayout(0);
+
+                // Update label text
+                iRightLabel->SetTextL(*iRightText);
+                delete iRightText;
+                iRightText = 0;
+
+                // Enter soft key(s) to view
+                EnterView(labelMask);
+                }
+
+            return ETrue;
+            }
+        }
+
+    return EFalse;
+    }
+
+
+void CHuiSoftKeyControl::VisualLayoutUpdated(CHuiVisual& aVisual)
+    {
+    if(&aVisual == iLayout)
+        {
+        // Get current soft keys location
+        THuiSkinLocation location = Env().Skin().Location(EHuiSkinElementSoftKeys);
+
+        if(location != iCurrentLocation)
+            {
+            // Get the previous location
+            THuiSkinLocation prevLocation = iCurrentLocation;
+
+            // Set the current location
+            iCurrentLocation = location;
+
+            // Enter from new location after exit transition is completed.
+            Env().Send(THuiCustomEventCommand(ECustomEventEnterView, this), ExitView(prevLocation));
+            }
+        }
+    }
+
+
+void CHuiSoftKeyControl::SetAnchorPoints(THuiSkinLocation aSkinLocation, TBool aShown, TUint aLabelMask)
+    {
+    // Recalculate visual rectangles depending on the skin location.
+    switch(aSkinLocation)
+        {
+        case EHuiSkinLocationTop:
+            HUI_DEBUG(_L("CHuiSoftKeyControl::ResetLabelRectangles() - EHuiSkinLocationTop not yet supported."));
+            HUI_PANIC(THuiPanic::ENotImplemented)
+            break;
+
+        case EHuiSkinLocationRight:
+            {
+            // Determine soft key label x-offset from the right border of the layout.
+            TReal32 leftX = aShown ? -KLabelWidthFactor : 0.0f;
+            TReal32 rightX = aShown ? 0.0 : KLabelWidthFactor;
+
+            if(aLabelMask & ESoftkeyLabelLeft)
+                {
+                // Define label text alignment
+                iLeftLabel->SetAlign(EHuiAlignHRight, EHuiAlignVBottom);
+
+                // Anchor top-left corner of the left soft key label (ordinal 0)
+                iLayout->SetAnchor(EHuiAnchorTopLeft, 0,
+                    EHuiAnchorOriginRight, EHuiAnchorOriginVCenter,
+                    EHuiAnchorMetricRelativeToSize, EHuiAnchorMetricRelativeToSize,
+                    THuiTimedPoint(leftX, 0.f));
+
+                // Anchor bottom-right corner of the left soft key label (ordinal 0)
+                iLayout->SetAnchor(EHuiAnchorBottomRight, 0,
+                    EHuiAnchorOriginRight, EHuiAnchorOriginBottom,
+                    EHuiAnchorMetricRelativeToSize, EHuiAnchorMetricRelativeToSize,
+                    THuiTimedPoint(rightX, 0.f));
+                }
+            if(aLabelMask & ESoftkeyLabelRight)
+                {
+                // Define label text alignment
+                iRightLabel->SetAlign(EHuiAlignHRight, EHuiAlignVTop);
+
+                // Anchor top-left corner of the right soft key label (ordinal 1)
+                iLayout->SetAnchor(EHuiAnchorTopLeft, 1,
+                    EHuiAnchorOriginRight, EHuiAnchorOriginTop,
+                    EHuiAnchorMetricRelativeToSize, EHuiAnchorMetricRelativeToSize,
+                    THuiTimedPoint(leftX, 0.f));
+
+                // Anchor bottom-right corner of the right soft key label (ordinal 1)
+                iLayout->SetAnchor(EHuiAnchorBottomRight, 1,
+                    EHuiAnchorOriginRight, EHuiAnchorOriginVCenter,
+                    EHuiAnchorMetricRelativeToSize, EHuiAnchorMetricRelativeToSize,
+                    THuiTimedPoint(rightX, 0.f));
+                }
+            
+            break;
+            }
+        case EHuiSkinLocationBottom:
+            {
+            // Determine soft key label y-offset from the bottom of the layout.
+            TReal32 topY = aShown ? -KLabelHeightFactor : 0.0f;
+            TReal32 bottomY = aShown ? 0.0 : KLabelHeightFactor;
+
+            if(aLabelMask & ESoftkeyLabelLeft)
+                {
+                // Define label text alignment
+                iLeftLabel->SetAlign(EHuiAlignHLeft, EHuiAlignVBottom);
+                
+                // Retrieve text label visual width.
+                /// @todo There should be a way to transform this width to relative coordinates
+                /// otherwise we can't make sure that the text label is wide enough.
+                TSize leftSize = iLeftLabel->TextExtents();
+
+                // Anchor top-left corner of the left soft key label (ordinal 0)
+                iLayout->SetAnchor(EHuiAnchorTopLeft, 0,
+                    EHuiAnchorOriginLeft, EHuiAnchorOriginBottom,
+                    EHuiAnchorMetricRelativeToSize, EHuiAnchorMetricRelativeToSize,
+                    THuiTimedPoint(0.f, topY));
+
+                // Anchor bottom-right corner of the left soft key label (ordinal 0)
+                iLayout->SetAnchor(EHuiAnchorBottomRight, 0,
+                    EHuiAnchorOriginLeft, EHuiAnchorOriginBottom,
+                    EHuiAnchorMetricAbsolute, EHuiAnchorMetricRelativeToSize,
+                    THuiTimedPoint(leftSize.iWidth, bottomY));
+                }
+
+            if(aLabelMask & ESoftkeyLabelRight)
+                {
+                // Define label text alignment
+                iRightLabel->SetAlign(EHuiAlignHRight, EHuiAlignVBottom);
+
+                // Retrieve text label visual width.
+                /// @todo There should be a way to transform this width to relative coordinates
+                /// otherwise we can't make sure that the text label is wide enough.
+                TSize rightSize = iRightLabel->TextExtents();
+
+                // Anchor top-left corner of the right soft key label (ordinal 1)
+                iLayout->SetAnchor(EHuiAnchorTopLeft, 1,
+                    EHuiAnchorOriginRight, EHuiAnchorOriginBottom,
+                    EHuiAnchorMetricAbsolute, EHuiAnchorMetricRelativeToSize,
+                    THuiTimedPoint(-rightSize.iWidth, topY));
+
+                // Anchor bottom-right corner of the right soft key label (ordinal 1)
+                iLayout->SetAnchor(EHuiAnchorBottomRight, 1,
+                    EHuiAnchorOriginRight, EHuiAnchorOriginBottom,
+                    EHuiAnchorMetricRelativeToSize, EHuiAnchorMetricRelativeToSize,
+                    THuiTimedPoint(0.f, bottomY));
+                }
+
+            break;
+            }
+        case EHuiSkinLocationLeft:
+            HUI_DEBUG(_L("CHuiSoftKeyControl::ResetLabelRectangles() - EHuiSkinLocationLeft not yet supported."));
+            HUI_PANIC(THuiPanic::ENotImplemented)
+            break;
+
+        default:
+            HUI_DEBUG(_L("CHuiSoftKeyControl::ResetLabelRectangles() - Unknown soft key draw location."));
+            HUI_PANIC(THuiPanic::ENotImplemented)
+            break;
+        }
+    }
+
+
+TUint CHuiSoftKeyControl::ExitView(THuiSkinLocation aTarget, TUint aLabelMask)
+    {
+    // Bail out if target location is none.
+    if(aTarget == EHuiSkinLocationNone)
+        {
+        return 0;
+        }
+
+    // Set anchor points to target
+    SetAnchorPoints(aTarget, EFalse, aLabelMask);
+
+    // Do the transition
+    iLayout->UpdateChildrenLayout(iExitTransitionTime);
+
+    return iExitTransitionTime;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiStatic.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1279 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CHuiStatic, static data access and utility 
+*                functions such as timing.
+*
+*/
+
+
+
+#include "uiacceltk/HuiStatic.h"  // Class definition
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiEnv.h"
+#include "HuiRenderPlugin.h"
+#include "huistatictlsdata.h"
+#include "uiacceltk/HuiProbe.h"
+#include <e32math.h>
+#include <eikenv.h>
+#include <flogger.h>
+#include <AknsUtils.h>
+#include <AknUtils.h>
+#include <AknBidiTextUtils.h>
+#include <bidivisual.h>
+#include "alfappfwproxyops.h"
+
+
+
+// Global writeable data, used in HW instead of TLS which relatively slow
+#ifndef __WINSCW__
+TTlsData globalWriteableData;
+#endif
+
+void CleanupWg(TAny* aWg)
+    {   
+    RWindowGroup* wg = static_cast<RWindowGroup*>(aWg);
+    delete wg;
+    }
+
+/** Dummy implementation for HuiProbe, to be used when external probe is not set */
+NONSHARABLE_CLASS(TFakeProbe) : public MHuiProbe
+    {
+public:
+    virtual void ReportObjectLifeCycleEvent(const MHuiSessionObject&, TLifecycleEvent) {}
+    virtual void ReportProgramFlowEvent(TProgramFlowPoint, TProgramFlowEvent) {}
+    virtual void ReportProgramFlowEvent(const MHuiSessionObject&, TProgramFlowPoint, TProgramFlowEvent) {}
+    void ReportFrameRate(TInt) const {}
+    void AssociateWithCurrentSession(MHuiSessionObject&) {}
+    };
+
+
+NONSHARABLE_CLASS(CAppFwProxy): public CBase
+    {
+public:
+    class CAlfLayoutListener: public CActive
+        {
+        public:
+        CAlfLayoutListener(CAppFwProxy& aNotif):CActive(CActive::EPriorityStandard), iNotif(aNotif)
+            {
+            CActiveScheduler::Add(this);
+            iStatus = KErrNotFound;    
+            }
+
+        ~CAlfLayoutListener()
+            {
+            Cancel();    
+            }
+            
+        void RunL()
+            {           
+            iNotif.iLayoutMirrored = (iStatus.Int() > 0);         
+            SetActive();
+            TAlfCommandParams params={EAlfIsMirrorred,0,0,0};
+            TPckgC<TAlfCommandParams> pkg(params);
+            TBuf8<1> awkwardApiDummy;
+            iNotif.iNotif.StartNotifierAndGetResponse(iStatus,TUid::Uid(KAlfAppFwProxyUid), pkg, awkwardApiDummy);            }
+    
+        void DoCancel()
+            {
+            // just wait for notifier completion    
+            User::WaitForRequest(iStatus);    
+            }    
+
+        private:
+            CAppFwProxy& iNotif;
+            };    
+
+    CAppFwProxy():iLayoutMirrored(KErrNotFound)
+        {}
+        
+    ~CAppFwProxy()
+        {
+        if (iConnected)
+            {
+            iNotif.Close();
+            delete iLayoutUpdateAo;
+			}
+		}
+    
+    TBool Connect()
+        {
+        if (!iConnected)
+            {
+            // perhaps should check also whether eikon server / notifier server exists..
+            iConnected = (iNotif.Connect() == KErrNone);
+            }
+        return iConnected;
+        }
+    
+    TBool LayoutMirrored()
+        {                
+        if ( Connect() && iLayoutMirrored == KErrNotFound)
+            {
+            TRequestStatus status;
+            TAlfCommandParams params={EAlfIsMirrorred,0,0,0};
+            TPckgC<TAlfCommandParams> pkg(params);
+            TBuf8<1> awkwardApiDummy;
+            iNotif.StartNotifierAndGetResponse(status,TUid::Uid(KAlfAppFwProxyUid), pkg, awkwardApiDummy);
+            User::WaitForRequest(status);
+            // order updates
+            iLayoutUpdateAo = new CAlfLayoutListener(*this);
+            if (iLayoutUpdateAo)
+                {
+                TRAP_IGNORE(iLayoutUpdateAo->RunL());
+                }
+            
+            iLayoutMirrored = (status.Int() > 0);
+            }
+     
+        return iLayoutMirrored==KErrNotFound?EFalse:iLayoutMirrored;    
+        }
+
+    TInt SoftKeyOrientation()
+        {
+        TInt ret = 0;
+        if ( Connect() )
+            {
+            TRequestStatus status;
+            TAlfCommandParams params={EAlfCbaLocation,0,0,0};
+            TPckgC<TAlfCommandParams> pkg(params);
+            TBuf8<1> awkwardApiDummy;
+            iNotif.StartNotifierAndGetResponse(status,TUid::Uid(KAlfAppFwProxyUid), pkg, awkwardApiDummy);
+            User::WaitForRequest(status);
+            ret = status.Int();
+            }
+        
+        return ret;    
+        }
+
+    TRect LayoutMetricsRect(TInt aType)
+        {
+        TRect ret=TRect(0,0,0,0);
+        if ( Connect() )
+            {
+            TRequestStatus status;
+            TAlfCommandParams params={EAlfLayoutMetricsRect,aType,0,0};
+            TPckgC<TAlfCommandParams> pkg(params);
+            TPckg<TRect> retpkg(ret);
+                        
+            iNotif.StartNotifierAndGetResponse(status,TUid::Uid(KAlfAppFwProxyUid), pkg, retpkg);
+            User::WaitForRequest(status);
+            }
+        
+        return ret;    
+        }
+  
+    TInt GetCachedColor(TRgb& aRgb, const TAknsItemID& aID,
+            const TInt aIndex )
+        {
+        if ( Connect() )
+            {
+            TRequestStatus status;
+            TAlfCommandParams params={EAlfGetCachedColor,aID.iMajor,aID.iMinor,aIndex};
+            TPckgC<TAlfCommandParams> pkg(params);
+            TPckg<TRgb> retpkg(aRgb);
+                    
+            iNotif.StartNotifierAndGetResponse(status,TUid::Uid(KAlfAppFwProxyUid), pkg, retpkg);
+            User::WaitForRequest(status);
+            return status.Int();
+            }
+    
+        return KErrCouldNotConnect;    
+        }
+    
+    void GetSkinBitmapL(CFbsBitmap* aBitmap, CFbsBitmap* aMask, const TAknsItemID& aID, const TDesC& aFileName, TInt aBitmapId, 
+                        TInt aMaskId, const TSize& aSize, TScaleMode aScaleMode)
+        {
+        if ( Connect() )
+            {
+            TRequestStatus status;
+            TAlfCommandParams2 params={EAlfGetSkinBitmap,aID.iMajor,aID.iMinor,aBitmapId,aMaskId,aFileName, aSize, aScaleMode};
+            TPckgC<TAlfCommandParams2> pkg(params);
+            TInt2 handles = {0,0};
+            TPckg<TInt2> retpkg(handles);
+                    
+            iNotif.StartNotifierAndGetResponse(status,TUid::Uid(KAlfAppFwProxyUid), pkg, retpkg);
+            User::WaitForRequest(status);
+            User::LeaveIfError(status.Int());
+            if (!handles.iInt1)
+                {
+                User::Leave(KErrNotFound); 
+                }   
+            User::LeaveIfError(aBitmap->Duplicate(handles.iInt1));
+            if ( aMask && handles.iInt2 )
+                {
+                User::LeaveIfError(aMask->Duplicate(handles.iInt2));                    
+                }
+            }
+        }
+
+    void GetSkinBackgroundBitmapL(CFbsBitmap* aBitmap, const TAknsItemID& aID )
+        {
+        if ( Connect() )
+            {
+            TRequestStatus status;
+            TAlfCommandParams params={EAlfGetSkinBackgroundBitmap,aID.iMajor,aID.iMinor,0};
+            TPckgC<TAlfCommandParams> pkg(params);
+            TInt handle = 0;
+            TPckg<TInt> retpkg(handle);
+                    
+            iNotif.StartNotifierAndGetResponse(status,TUid::Uid(KAlfAppFwProxyUid), pkg, retpkg);
+            User::WaitForRequest(status);
+            User::LeaveIfError(status.Int());
+            User::LeaveIfError(aBitmap->Duplicate(handle));
+            }
+        }
+
+    void GetCachedSkinItemDataArrayL(const TAknsItemID& aID, TInt aType, TAlfCachedSkinItemArray& aArray)  
+        {
+        if ( Connect() )
+            {
+            TRequestStatus status;
+            TAlfCommandParams params={EGetCachedSkinItemData,aID.iMajor,aID.iMinor,aType};
+            TPckgC<TAlfCommandParams> pkg(params);
+            TPckg<TAlfCachedSkinItemArray> retpkg(aArray);
+                    
+            iNotif.StartNotifierAndGetResponse(status,TUid::Uid(KAlfAppFwProxyUid), pkg, retpkg);
+            User::WaitForRequest(status);
+            User::LeaveIfError(status.Int());
+            }
+        }
+        
+    void GetListOfWindowGroupsL(TRequestStatus& aStatus, TPtr8& aPtr)
+        {
+        if ( Connect() )
+            {
+            TAlfCommandParams params={EGetListOfWindowGroups,0,0,0};
+            TPckgC<TAlfCommandParams> pkg(params);
+            iNotif.StartNotifierAndGetResponse(aStatus,TUid::Uid(KAlfAppFwProxyUid), pkg, aPtr);
+            }        
+        }    
+    public: 
+        TBool iLayoutMirrored;
+        RNotifier iNotif;
+        TBool iConnected;
+        CAlfLayoutListener* iLayoutUpdateAo;
+    };
+
+CHuiStatic* CHuiStatic::NewLC(CHuiEnv* aPrimaryEnv)
+    {
+    CHuiStatic* self = new (ELeave) CHuiStatic();
+    CleanupStack::PushL(self);
+    self->ConstructL(aPrimaryEnv);
+    return self;
+    }
+
+
+CHuiStatic* CHuiStatic::NewL(CHuiEnv* aPrimaryEnv)
+    {
+    CHuiStatic* self = NewLC(aPrimaryEnv);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+CHuiStatic::CHuiStatic()
+    {
+    }
+
+
+void CHuiStatic::ConstructL(CHuiEnv* aPrimaryEnv)
+    {
+    iData = new (ELeave) TTlsData();
+    
+    iData->iPrimaryEnv = aPrimaryEnv;
+    iData->iIdCounter = -1;
+    iData->iTimeFactor = 1.0;
+    iData->iIsFirstUpdateTime = ETrue;
+    iData->iFirstUpdateTime.UniversalTime();
+    iData->iUniversalTime.UniversalTime();
+    iData->iRealUniversalTime.UniversalTime();
+    iData->iLastFpsTime.UniversalTime();
+    iData->DoInitL(); // make sure that we have infra even CCoeEnv was not there
+
+    // Re-construct the virtual table for iFakeProbe
+    iData->iFakeProbe = new (ELeave) TFakeProbe;
+    
+    iData->iAppFwProxy = new (ELeave) CAppFwProxy;
+    
+    //Register for environment change ( here system time change ) event notification
+    iChangeNotifier = CEnvironmentChangeNotifier::NewL(0, TCallBack(CHuiStatic::SettingChangedCallBack, this));
+    iChangeNotifier->Start();
+#ifndef __WINSCW__
+    globalWriteableData = *iData;
+#else
+    Dll::SetTls(iData);
+#endif
+
+#ifndef WIN32
+#ifdef HUI_DEBUG_WITH_PRINTF
+    EnableLogging();
+#endif
+#endif
+    }
+
+
+CHuiStatic::~CHuiStatic()
+    {
+    if(iData)
+        {
+        if(iData->iFakeProbe)
+            {
+            delete iData->iFakeProbe;
+            iData->iFakeProbe = NULL;
+            }
+        iData->iLogFile.Close();
+        delete iData->iAppFwProxy;
+        iData->Disconnect();
+        }
+    iChangeNotifier->Cancel();
+    delete iChangeNotifier;
+#ifdef __WINSCW__
+    Dll::FreeTls();
+#endif
+    delete iData;
+    }
+
+
+EXPORT_C TTlsData* CHuiStatic::Data()
+    {
+#ifndef __WINSCW__
+    return &globalWriteableData;
+#else
+    return static_cast<TTlsData*>(Dll::Tls());
+#endif
+    }
+
+
+void CHuiStatic::UpdateTime(TTlsData* aData)
+    {
+    ASSERT( aData );
+    // Updates the toolkit's time counters. This includes the toolkit's
+    // realtime clock, the internal absolute clock (which is affected by the
+    // time factor), the amount of elapsed time since last UpdateTime()
+    // invocation, and the amount of elapsed time since the first UpdateTime()
+    // invocation (which was done in the beginning of the first refresh).
+
+    if(aData->iIsFirstUpdateTime)
+        {
+        aData->iIsFirstUpdateTime = EFalse;
+        aData->iFirstUpdateTime.UniversalTime();
+        aData->iUniversalTime = aData->iFirstUpdateTime;
+        aData->iRealUniversalTime = aData->iUniversalTime;
+        return;
+        }
+
+    TTime now;
+    now.UniversalTime();
+
+    // Advance the toolkit's internal clock, applying the time factor.
+    if(!aData->iTimePaused)
+        {
+        aData->iInternalElapsed = now.MicroSecondsFrom(aData->iRealUniversalTime).Int64();
+        aData->iInternalElapsed = (TInt64)((TReal32)aData->iInternalElapsed * aData->iTimeFactor);
+        aData->iUniversalTime += TTimeIntervalMicroSeconds(aData->iInternalElapsed);
+        }
+    else
+        {
+        aData->iInternalElapsed = aData->iInternalElapsedBeforePausing;
+        aData->iInternalElapsedBeforePausing = 0;        
+        }
+
+    aData->iRealUniversalTime = now;      
+    }
+
+
+TUint32 CHuiStatic::MilliSecondsSinceUpdateTime()
+    {
+    TTlsData* data = Data();
+    
+    TTime now;
+    now.UniversalTime();
+    
+    return now.MicroSecondsFrom(data->iRealUniversalTime).Int64() / 1000;
+    }
+
+
+EXPORT_C CHuiEnv& CHuiStatic::Env()
+    {
+    if(!Data())
+        {
+        THuiPanic::Panic(THuiPanic::EStaticDataNotCreated);
+        }
+    return *Data()->iPrimaryEnv;
+    }
+
+
+EXPORT_C CHuiRenderPlugin& CHuiStatic::Renderer()
+    {
+    if(!Data() || !Data()->iRenderer)
+        {
+           HUI_DEBUG(_L("CHuiStatic::Renderer() - Static data or renderer not specified."));
+        THuiPanic::Panic(THuiPanic::EStaticInvalidRenderer);
+        }
+    return *Data()->iRenderer;
+    }
+
+
+void CHuiStatic::SetRenderer(CHuiRenderPlugin& aRenderer)
+    {
+    if(!Data())
+        {
+        THuiPanic::Panic(THuiPanic::EStaticDataNotCreated);
+        }
+    Data()->iRenderer = &aRenderer;
+    }
+
+
+// @TODO SHOULD THIS BE MODIFIED SOMEHOW, OR IS THIS EXPORT OK???
+EXPORT_C CHuiBitgdiRenderPlugin& CHuiStatic::BitgdiRenderer()
+    {
+    CHuiRenderPlugin* renderer = &Renderer();
+    if(renderer->Id() != EHuiRenderPluginBitgdi)
+        {
+        HUI_DEBUG(_L("CHuiStatic::BitgdiRenderer() - Renderer cannot be used as Bitgdi renderer."));
+        THuiPanic::Panic(THuiPanic::EStaticInvalidRenderer);
+        }
+    return *reinterpret_cast< CHuiBitgdiRenderPlugin* >(renderer);
+    }
+
+
+EXPORT_C CHuiVg10RenderPlugin& CHuiStatic::Vg10Renderer()
+    {
+    CHuiRenderPlugin* renderer = &Renderer();
+    if(renderer->Id() != EHuiRenderPluginVg10)
+        {
+        HUI_DEBUG(_L("CHuiStatic::Vg10Renderer() - Renderer cannot be used as Vg10 renderer."));
+        THuiPanic::Panic(THuiPanic::EStaticInvalidRenderer);
+        }
+    return *reinterpret_cast< CHuiVg10RenderPlugin* >(renderer);
+    }
+
+
+EXPORT_C CHuiGles10RenderPlugin& CHuiStatic::Gles10Renderer()
+    {
+    CHuiRenderPlugin* renderer = &Renderer();
+    if(renderer->Id() != EHuiRenderPluginGles10 &&
+       renderer->Id() != EHuiRenderPluginGles11) // compatible
+        {
+        HUI_DEBUG(_L("CHuiStatic::Gles10Renderer() - Renderer cannot be used as Gles10 renderer."));
+        THuiPanic::Panic(THuiPanic::EStaticInvalidRenderer);
+        }
+    return *reinterpret_cast< CHuiGles10RenderPlugin* >(renderer);
+    }
+
+
+EXPORT_C CHuiGles11RenderPlugin& CHuiStatic::Gles11Renderer()
+    {
+    CHuiRenderPlugin* renderer = &Renderer();
+    if(renderer->Id() != EHuiRenderPluginGles11)
+        {
+        HUI_DEBUG(_L("CHuiStatic::Gles11Renderer() - Renderer cannot be used as Gles11 renderer."));
+        THuiPanic::Panic(THuiPanic::EStaticInvalidRenderer);
+        }
+    return *reinterpret_cast< CHuiGles11RenderPlugin* >(renderer);
+    }
+
+
+EXPORT_C CHuiGles20RenderPlugin& CHuiStatic::Gles20Renderer()
+    {
+    CHuiRenderPlugin* renderer = &Renderer();
+    if(renderer->Id() != EHuiRenderPluginGles20)
+        {
+        HUI_DEBUG(_L("CHuiStatic::Gles20Renderer() - Renderer cannot be used as Gles20 renderer."));
+        THuiPanic::Panic(THuiPanic::EStaticInvalidRenderer);
+        }
+    return *reinterpret_cast< CHuiGles20RenderPlugin* >(renderer);
+    }
+
+
+EXPORT_C MHuiRenderSurface* CHuiStatic::CurrentRenderSurface()
+    {
+    if(!Data())
+        {
+        HUI_DEBUG(_L("CHuiStatic::CurrentRenderSurface() - Static data or current render surface not specified. Panicking."));
+        THuiPanic::Panic(THuiPanic::EStaticCurrentRenderSurfaceNotSpecified);
+        }
+    return Data()->iCurrentRenderSurface;
+    }
+
+
+EXPORT_C void CHuiStatic::SetCurrentRenderSurface(MHuiRenderSurface* aSurface)
+    {
+    Data()->iCurrentRenderSurface = aSurface;
+    }
+
+
+EXPORT_C void CHuiStatic::EnableLogging(TBool aEnable)
+    {
+    TTlsData* data = Data();
+
+    if(aEnable && !data->iLogEnabled)
+        {
+        data->iLogEnabled = ETrue;
+
+		// debug code only 
+        TFileName filename;
+        filename.Append('e');
+        filename.Append(':');
+        filename.Append('\\');
+        filename.Append(_L("HuiMessages.log"));
+                
+        if(data->iLogFile.Replace(*data->iFs, filename, EFileWrite) != KErrNone)
+            {
+            RDebug::Print(_L("CHuiStatic::EnableLogging() - Could not open log file e:HuiMessages.log for writing. Trying c: .."));
+            _LIT(KFileName2, "c:\\HuiMessages.log");
+            if(data->iLogFile.Replace(*data->iFs, KFileName2, EFileWrite) != KErrNone)
+                {
+                RDebug::Print(_L("CHuiStatic::EnableLogging() - Could not open log file c:HuiMessages.log for writing. Logging disabled."));
+                data->iLogEnabled = EFalse;
+                }
+            else
+                {
+                RDebug::Print(_L("CHuiStatic::EnableLogging() - Enabled Logging to c \"HuiMessages.log\"."));
+                Printf(_L("CHuiStatic::EnableLogging() - Enabled Logging to \"HuiMessages.log\"."));
+                }
+            }
+        else
+            {
+            RDebug::Print(_L("CHuiStatic::EnableLogging() - Enabled Logging to mmc \"HuiMessages.log\"."));
+            Printf(_L("CHuiStatic::EnableLogging() - Enabled Logging to mmc \"HuiMessages.log\"."));
+            }
+        }
+    else if(!aEnable && data->iLogEnabled)
+        {
+        data->iLogFile.Close();
+        data->iLogEnabled = EFalse;
+        }
+    else
+        {
+        // for PC lint
+        }
+    }
+
+
+EXPORT_C TBool CHuiStatic::Logging()
+    {
+    return Data()->iLogEnabled;
+    }
+
+
+EXPORT_C void CHuiStatic::ContinueRefresh()
+    {
+    TTlsData* data = Data();
+    if(data && data->iPrimaryEnv)
+        {
+        data->iPrimaryEnv->ContinueRefresh();
+        }
+    }
+
+
+void CHuiStatic::UpdateTime()
+    {
+    // Updates the toolkit's time counters. This includes the toolkit's
+    // realtime clock, the internal absolute clock (which is affected by the
+    // time factor), the amount of elapsed time since last UpdateTime()
+    // invocation, and the amount of elapsed time since the first UpdateTime()
+    // invocation (which was done in the beginning of the first refresh).
+
+    TTlsData* data = Data();
+    
+    UpdateTime(data);
+    }
+
+
+EXPORT_C const TTime& CHuiStatic::Time()
+    {
+    return Data()->iUniversalTime;
+    }
+
+
+EXPORT_C void CHuiStatic::SetTimeFactor(TReal32 aTimeFactor) __SOFTFP
+    {
+    TTlsData* data = Data();
+
+    if(data)
+        {
+        if(aTimeFactor < 0)
+            {
+            aTimeFactor = 0;
+            }
+            
+        if(data->iTimeFactor == 0 && aTimeFactor != 0)
+            {
+            // Continuing from a paused state
+            UpdateTime(data);
+            }
+            
+        data->iTimeFactor = aTimeFactor;
+        }
+    }
+
+
+EXPORT_C TReal32 CHuiStatic::TimeFactor() __SOFTFP
+    {
+    TTlsData* data = Data();
+
+    if(data)
+        {
+        return data->iTimeFactor;
+        }
+    return 1.0;
+    }
+
+
+EXPORT_C void CHuiStatic::PauseTime()
+    {
+    TTlsData* data = Data();
+
+    if(data)
+        {
+        // Update internal elapsed
+        UpdateTime(data);       
+        // Cache internal elapsed in internal time passed before pausing
+        data->iInternalElapsedBeforePausing = data->iInternalElapsed;
+        // Pause timing
+        data->iTimePaused = ETrue;
+        }
+    }
+
+
+EXPORT_C void CHuiStatic::ContinueTime()
+    {
+    TTlsData* data = Data();
+
+    if(data && data->iTimePaused)
+        {
+        UpdateTime(data);
+        data->iTimePaused = EFalse;
+        }
+    }
+
+
+EXPORT_C TBool CHuiStatic::TimePaused()
+    {
+    TTlsData* data = Data();
+
+    if(data)
+        {
+        return data->iTimePaused;
+        }
+    return EFalse;
+    }
+
+
+EXPORT_C TReal32 CHuiStatic::ElapsedSeconds() __SOFTFP
+    {
+    TTlsData* data = Data();
+
+    if(data)
+        {
+#ifdef EKA2
+        return data->iInternalElapsed / 1.0e6;
+#else
+        return data->iInternalElapsed.GetTReal() / 1.0e6;
+#endif
+        }
+    return 0;
+    }
+
+
+EXPORT_C TReal32 CHuiStatic::SecondsSinceStart() __SOFTFP
+    {
+    TTlsData* data = Data();
+    if(!data)
+        {
+        // Time has not begun yet.
+        return 0;
+        }
+
+    // Calculate difference between internal absolute clock and the first update time.
+    TInt64 delta = data->iUniversalTime.MicroSecondsFrom(data->iFirstUpdateTime).Int64();
+#ifdef EKA2
+    return delta / 1.0e6;
+#else
+    return delta.GetTReal() / 1.0e6;
+#endif
+    }
+
+
+EXPORT_C TUint32 CHuiStatic::MilliSecondsSinceStart()
+    {
+    // This will wrap around in approx. 50 days.
+    TTlsData* data = Data();
+    if(data)
+        {
+        // Calculate difference between internal absolute clock and the first update time.
+        TInt64 delta = data->iUniversalTime.MicroSecondsFrom(data->iFirstUpdateTime).Int64();
+        return delta / 1000;
+        }
+    return 0;
+
+    }
+
+
+TInt CHuiStatic::GenerateId()
+    {
+    TTlsData* data = Data();
+
+    // The ID counter counts backwards.
+    TInt id = data->iIdCounter;
+
+    if(data->iIdCounter == KMinTInt)
+        {
+        // Wrap around to stay negative.
+        data->iIdCounter = -1;
+        }
+    else
+        {
+        --data->iIdCounter;
+        }
+
+    return id;
+    }
+
+
+void CHuiStatic::ReportNewFrame()
+    {
+    TTlsData* data = Data();
+    data->iFrameCounter++;
+    data->iCurrentFrameCounter++;
+    }
+
+
+EXPORT_C TUint CHuiStatic::FrameCount()
+    {
+    TTlsData* data = Data();
+    return data->iFrameCounter;
+    }
+
+
+EXPORT_C TReal32 CHuiStatic::AverageFrameRate() __SOFTFP
+    {
+    return 0;
+    }
+
+
+EXPORT_C TReal32 CHuiStatic::FrameRate() __SOFTFP
+    {
+
+    TTlsData* data = Data();
+
+    TTime now;
+    now.UniversalTime();
+
+    // If very little time has passed, don't calculate a new value yet.
+    TTimeIntervalMicroSeconds msFromLast = 0;
+    msFromLast = now.MicroSecondsFrom(data->iLastFpsTime);
+    if(msFromLast < TTimeIntervalMicroSeconds(TInt64(1e6)))
+        {
+        // Do not recalculate yet.
+#ifdef SYMBIAN_BUILD_GCE
+        return 0; // to ignore the value if time is not elapsed
+#else
+        return data->iLastFps;
+#endif
+        }
+
+    if(data->iCurrentFrameCounter == 0)
+        {
+        data->iLastFpsTime = now;
+        return 0;
+        }
+
+    TInt64 delta = now.MicroSecondsFrom(data->iLastFpsTime).Int64();
+
+    TReal32 fps = 0;
+#ifdef EKA2
+    TReal32 elapsed = delta / 1.0e6;
+#else
+    TReal32 elapsed = delta.GetTReal() / 1.0e6;
+#endif
+
+    if(elapsed > 0)
+        {
+        fps = (TReal32)data->iCurrentFrameCounter / elapsed;
+        }
+
+    data->iLastFps = fps;
+    data->iCurrentFrameCounter = 0;
+    data->iLastFpsTime = now;
+
+    return fps;
+    }
+
+
+EXPORT_C void CHuiStatic::Printf(TRefByValue<const TDesC8> aFormat, ...)
+    {
+    TTlsData* data = Data();
+    // Bail out early if logging is disabled.
+    if(!data || !data->iLogEnabled)
+        {
+#ifdef _DEBUG
+        // redirect to RDebug output if we are debugging
+        TUint total = 0;
+        TUint free = HuiUtil::FreeMemory(&total);
+        TBuf8<256> buf;
+        VA_LIST list;
+        VA_START(list, aFormat);
+        buf.FormatList(aFormat, list);
+        VA_END(list);
+        RDebug::Print(_L("(%i/%i KB) %s"), free/1024, total/1024, &buf);
+#endif
+        // Already gone?
+        return;
+        }
+    TTime now;
+    now.UniversalTime();
+    TInt32 elapsed = (TInt32)(now.MicroSecondsFrom(data->iFirstUpdateTime).Int64() / 1000);
+
+    TBuf8<100> memData;
+    TUint total = 0;
+    TUint free = HuiUtil::FreeMemory(&total);
+    memData.Format(_L8("% 2d,%03d (%i/%i KB) "), elapsed / 1000,
+                                             elapsed % 1000,
+                                             free/1024, total/1024);
+
+    TBuf8<512> buf;
+    VA_LIST list;
+    VA_START(list, aFormat);
+    buf.FormatList(aFormat, list);
+    VA_END(list);
+    buf.Insert(0, memData);
+    buf.Append(_L8("\n"));
+
+    data->iLogFile.Write(buf);
+    data->iLogFile.Flush();
+    }
+
+
+EXPORT_C void CHuiStatic::Printf(TRefByValue<const TDesC16> aFormat, ...)
+    {
+    TTlsData* data = Data();
+    // Bail out early if logging is disabled.
+    if(!data || !data->iLogEnabled)
+        {
+#ifdef _DEBUG
+        // redirect to RDebug output if we are debugging
+        TBuf16<512> buf;
+        TUint total; TUint free = HuiUtil::FreeMemory(&total);
+        VA_LIST list;
+        VA_START(list, aFormat);
+        buf.FormatList(aFormat, list);
+        VA_END(list);
+        RDebug::Print(_L("(%i/%i KB) %S"), free/1024, total/1024, &buf);
+#endif
+        // Already gone?
+        return;
+        }
+    TTime now;
+    now.UniversalTime();
+    TInt32 elapsed = (TInt32)(now.MicroSecondsFrom(data->iFirstUpdateTime).Int64() / 1000);
+
+    TBuf16<100> memData;
+    TUint total = 0;
+    TUint free = HuiUtil::FreeMemory(&total);
+    memData.Format(_L16("% 2d,%03d (%i/%i KB) "), elapsed / 1000,
+                                              elapsed % 1000,
+                                              free/1024, total/1024);
+
+    TBuf16<512> buf;
+    VA_LIST list;
+    VA_START(list, aFormat);
+    buf.FormatList(aFormat, list);
+    VA_END(list);
+    buf.Insert(0, memData);
+    buf.Append(_L16("\n"));
+
+    TBuf8<512> buf8;
+    buf8.SetLength(buf.Length());
+    for(TInt i = 0; i < buf.Length(); ++i)
+        {
+        buf8[i] = TUint8(buf[i]);
+        }
+
+    data->iLogFile.Write(buf8);
+    data->iLogFile.Flush();
+    }
+
+
+EXPORT_C void CHuiStatic::Tic(TInt aClock)
+    {
+    if(aClock < 0 || aClock >= KMaxClocks)
+        {
+        THuiPanic::Panic(THuiPanic::EStaticInvalidClock);
+        }
+
+    TTlsData* data = Data();
+    data->iClocks[aClock].UniversalTime();
+    }
+
+
+EXPORT_C TReal32 CHuiStatic::Toc(TInt aClock) __SOFTFP
+    {
+    if(aClock < 0 || aClock >= KMaxClocks)
+        {
+        THuiPanic::Panic(THuiPanic::EStaticInvalidClock);
+        }
+
+    TTlsData* data = Data();
+
+    TTime now;
+    now.UniversalTime();
+
+    TInt64 delta = now.MicroSecondsFrom(data->iClocks[aClock]).Int64();
+#ifdef EKA2
+    return delta / 1.0e6;
+#else
+    return delta.GetTReal() / 1.0e6;
+#endif
+    }
+
+
+EXPORT_C RFs& CHuiStatic::FsSession()
+    {
+    TTlsData* data = Data();
+    __ASSERT_ALWAYS(data, User::Panic(_L("HUI"),0));
+    return *data->iFs;
+    }
+
+EXPORT_C RWsSession& CHuiStatic::WsSession()
+    {
+    TTlsData* data = Data();
+    __ASSERT_ALWAYS(data, User::Panic(_L("HUI"),0));
+    return *data->iWsSession;
+    }
+
+EXPORT_C CWsScreenDevice* CHuiStatic::ScreenDevice( TInt aScreenNumber )
+    {
+    TTlsData* data = Data();
+    __ASSERT_ALWAYS(data, User::Panic(_L("HUI"),0));
+    return data->WsScreenDevice(aScreenNumber);
+    }
+
+EXPORT_C RWindowGroup* CHuiStatic::RootWin( TInt aScreenNumber )
+    {
+    TTlsData* data = Data();
+    __ASSERT_ALWAYS(data, User::Panic(_L("HUI"),0));
+    return data->RootWin(aScreenNumber);
+    }
+
+EXPORT_C void CHuiStatic::SetLayoutTransitionTime( TInt aTime )
+    {
+    TTlsData* data = Data();
+    if(data)
+        {
+        data->iLayoutTransitionTime = aTime;
+        }
+    }
+
+
+EXPORT_C TInt CHuiStatic::LayoutTransitionTime()
+    {
+    TTlsData* data = Data();
+    if(data)
+        {
+        return data->iLayoutTransitionTime;
+        }
+    return 0;
+    }
+
+EXPORT_C void CHuiStatic::SetProbe(MHuiProbe* aProbe)
+    {
+    TTlsData* data = Data();
+    if(data)
+        {
+        data->iProbe = aProbe;
+        }
+    }
+
+MHuiProbe& CHuiStatic::Probe()
+    {
+    TTlsData* data = Data();
+    
+    if ( !data )
+        {
+        THuiPanic::Panic(THuiPanic::EStaticDataNotCreated);
+        }
+    
+    if(data->iProbe)
+        {
+        return *(data->iProbe);
+        }
+    return *(data->iFakeProbe);
+    }
+
+EXPORT_C MAknsSkinInstance* CHuiStatic::SkinInstance()
+    {
+    if (CCoeEnv::Static())
+        {
+        return AknsUtils::SkinInstance();
+        }
+    return 0;
+    }
+
+TBool CHuiStatic::LayoutMirrored()
+    {
+    if (CCoeEnv::Static())
+        {
+        return AknLayoutUtils::LayoutMirrored();
+        }
+    else
+        {
+        TTlsData* data = Data();
+        return data->iAppFwProxy->LayoutMirrored(); 
+        }
+    }
+
+TInt CHuiStatic::CbaLocation()
+    {
+    if (CCoeEnv::Static())
+        {
+        return AknLayoutUtils::CbaLocation();
+        }
+    else
+        {
+        TTlsData* data = Data();
+        return data->iAppFwProxy->SoftKeyOrientation(); 
+        }
+    }
+
+void CHuiStatic::LayoutMetricsRect(TInt aType, TRect& aRect)
+    {
+    if (CCoeEnv::Static())
+        {
+        (void)AknLayoutUtils::LayoutMetricsRect((AknLayoutUtils::TAknLayoutMetrics)aType, aRect);
+        }
+    else
+        {
+        TTlsData* data = Data();
+        aRect = data->iAppFwProxy->LayoutMetricsRect(aType); 
+        }
+    }
+
+TInt CHuiStatic::GetCachedColor(TRgb& aRgb, const TAknsItemID& aID,
+          const TInt aIndex )
+    {
+    MAknsSkinInstance* skin = SkinInstance();
+    if (skin)
+        {
+        return AknsUtils::GetCachedColor(skin, aRgb, aID, aIndex );
+        }
+    else
+        {
+        TTlsData* data = Data();
+        return data->iAppFwProxy->GetCachedColor(aRgb, aID, aIndex );        
+        }
+    }
+
+TBool CHuiStatic::ConvertToVisualAndClipL(
+    TDes& aLogicalText,
+    const CFont& aFont,
+    TInt aMaxWidthInPixels,
+    TInt aMaxClippedWidthInPixels )
+    {
+    if (CCoeEnv::Static())
+       {
+       return AknBidiTextUtils::ConvertToVisualAndClipL(
+            aLogicalText,
+            aFont,
+            aMaxWidthInPixels,
+            aMaxClippedWidthInPixels );
+       }
+    else
+        {
+        if ( !aLogicalText.Length() )
+            {
+            aLogicalText = KNullDesC; // null text 
+            return EFalse;
+            }
+
+        HBufC* visualBuffer = HBufC::NewLC(
+                aLogicalText.Length() + KAknBidiExtraSpacePerLine );
+        
+        TPtr ptr = visualBuffer->Des();
+        
+        TInt chars = aLogicalText.Length();
+
+        TBool clipped = EFalse;
+
+        TChar clipChar = 0xffff;
+
+        // TextCount() converts text to visual form and then checks it
+        if ( aFont.TextCount( aLogicalText, aMaxWidthInPixels ) < chars )
+            {
+            clipped = ETrue;
+
+            TInt clipCharWidth = 0;
+            // Not enough space even for clip char alone - return empty descriptor.
+            if ( aMaxClippedWidthInPixels < clipCharWidth )
+                {
+                aLogicalText = KNullDesC; // null text 
+                CleanupStack::PopAndDestroy(); // visual buf
+                return ETrue;
+                }
+
+            // Check how many characters fit in given space with truncation char.
+            // We need to give this information to TBidiLogicalToVisual.
+            chars = aFont.TextCount( 
+                    aLogicalText, aMaxClippedWidthInPixels - clipCharWidth );
+
+            // This is "avkon rule": should not insert ellipsis right after a space.
+            if ( chars > 1 && 
+                    aLogicalText[chars - 1] == ' ' &&
+                    aLogicalText[chars - 2] != ' ' )
+                {
+                chars--;
+                }
+            }
+        
+        TBidirectionalState::TRunInfo* array =
+                new TBidirectionalState::TRunInfo[chars];
+        
+        TBidiLogicalToVisual converter(
+                aLogicalText,
+                array,
+                chars ) ;
+ 
+        TInt count = converter.Reorder();
+
+        if (count > chars)
+            {
+            delete array;
+            array = 0;
+            array = new TBidirectionalState::TRunInfo[chars];
+            }
+     
+        if (array)
+            {
+            TBidiLogicalToVisual converter = TBidiLogicalToVisual( aLogicalText, array, chars );
+            converter.Reorder();
+            TPtr ptr = visualBuffer->Des();
+            converter.GetVisualLine( ptr, 0, chars, clipChar );
+            }
+     
+        aLogicalText = *visualBuffer;
+   
+        CleanupStack::PopAndDestroy();
+        return clipped;
+        }
+    }
+
+HBufC* CHuiStatic::ConvertToVisualAndWrapToArrayL( 
+    const TDesC& aLogicalText,
+    TInt aLineWidth,
+    const CFont& aFont,
+    CArrayFix<TPtrC>& aWrappedArray )
+    {
+    if (CCoeEnv::Static())
+        {
+        return AknBidiTextUtils::ConvertToVisualAndWrapToArrayL( 
+            aLogicalText,
+            aLineWidth,
+            aFont,
+            aWrappedArray);
+        }
+    else
+        {
+        // will not be supported ever
+        HBufC* ret = aLogicalText.AllocLC();
+        aWrappedArray.AppendL(ret->Des());
+        CleanupStack::Pop();
+        return ret;
+        }
+    }
+
+CFbsBitmap* CHuiStatic::GetBgBitmapLC(const TAknsItemID& aID)
+    {
+    CFbsBitmap * bitmap = new (ELeave) CFbsBitmap();
+    CleanupStack::PushL(bitmap);
+ 
+    TTlsData* data = Data();
+    data->iAppFwProxy->GetSkinBackgroundBitmapL(bitmap, aID);        
+    
+    return bitmap;
+    }
+
+void CHuiStatic::GetMaskedBitmapL(const TAknsItemID& aID, CFbsBitmap*& aBitmap, CFbsBitmap*& aBitmapMask,
+                                 const TDesC& aFileName, TInt aBitmapId, TInt aMaskId,  const TSize& aSize, TScaleMode aScaleMode)
+    {
+    CFbsBitmap * bitmap = new (ELeave) CFbsBitmap();
+    CleanupStack::PushL(bitmap);
+
+    CFbsBitmap * mask = new (ELeave) CFbsBitmap();
+    CleanupStack::PushL(mask);
+
+    TTlsData* data = Data();
+    data->iAppFwProxy->GetSkinBitmapL(bitmap, mask, aID, aFileName, aBitmapId, aMaskId, aSize, aScaleMode );        
+    
+    // Transfer the ownership
+    if (mask->Handle())
+        {
+        aBitmapMask = mask;
+        CleanupStack::Pop(); //mask
+        }
+    else 
+        {
+        CleanupStack::PopAndDestroy(); //mask
+        }        
+    aBitmap = bitmap;
+    CleanupStack::Pop(); //bitmap
+    }
+        
+CAknsItemData* CHuiStatic::GetCachedSkinItemDataL(const TAknsItemID& aID, TInt aDataType)   
+    {
+    CAknsImageTableItemData* skindata = 0;    
+    if (aDataType == EAknsITImageTable) // only image table for framebrush supported
+        {
+        TTlsData* data = Data();
+        TAlfCachedSkinItemArray array;
+        data->iAppFwProxy->GetCachedSkinItemDataArrayL(aID, aDataType, array);         
+        if (array.iCount)
+            {
+            skindata = CAknsImageTableItemData::NewL();
+            CleanupStack::PushL(skindata);
+            skindata->SetImagesL(array.iCount, array.iImages);
+            CleanupStack::Pop();
+            }        
+        }
+    return skindata;
+    }
+
+TInt CHuiStatic::SettingChangedCallBack(TAny* aInstance)
+    {
+    return ((CHuiStatic *)aInstance)->DoChange();
+    }
+
+TInt CHuiStatic::DoChange()
+    {
+    TInt change = iChangeNotifier->Change();
+    TTlsData* data = Data();
+    if(!data)
+        {
+        // Time has not begun yet.
+         return 0;
+         }
+      if (change & EChangesLocale)
+          {
+          data->iIsFirstUpdateTime = ETrue;
+          UpdateTime();
+          }
+     
+      if (change & EChangesSystemTime)
+          {
+          data->iIsFirstUpdateTime = ETrue;
+          UpdateTime();
+          }
+      
+      return 1;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiStatic_stubs.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,132 @@
+/*
+* 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: 
+*
+*/
+
+#include "uiacceltk/huiStatic.h"  // Class definition
+#include "uiacceltk/huiUtil.h"
+#include "uiacceltk/huiEnv.h"
+#include "huirenderplugin.h"
+#include "huistatictlsdata.h"
+#include "uiacceltk/huiProbe.h"
+#include <e32math.h>
+#include <eikenv.h>
+#include <flogger.h>
+
+
+
+void CHuiStatic::UpdateTime(TTlsData* aData)
+    {
+    ASSERT( aData );
+    // Updates the toolkit's time counters. This includes the toolkit's
+    // realtime clock, the internal absolute clock (which is affected by the
+    // time factor), the amount of elapsed time since last UpdateTime()
+    // invocation, and the amount of elapsed time since the first UpdateTime()
+    // invocation (which was done in the beginning of the first refresh).
+
+    if(aData->iIsFirstUpdateTime)
+        {
+        aData->iIsFirstUpdateTime = EFalse;
+        aData->iFirstUpdateTime.UniversalTime();
+        aData->iUniversalTime = aData->iFirstUpdateTime;
+        aData->iRealUniversalTime = aData->iUniversalTime;
+        return;
+        }
+
+    TTime now;
+    now.UniversalTime();
+
+    // Advance the toolkit's internal clock, applying the time factor.
+    if(!aData->iTimePaused)
+        {
+        aData->iInternalElapsed = now.MicroSecondsFrom(aData->iRealUniversalTime).Int64();
+        aData->iInternalElapsed = (TInt64)((TReal32)aData->iInternalElapsed * aData->iTimeFactor);
+        aData->iUniversalTime += TTimeIntervalMicroSeconds(aData->iInternalElapsed);
+        }
+    else
+        {
+        aData->iInternalElapsed = aData->iInternalElapsedBeforePausing;
+        aData->iInternalElapsedBeforePausing = 0;        
+        }
+
+    aData->iRealUniversalTime = now;      
+    }
+
+
+TUint32 CHuiStatic::MilliSecondsSinceUpdateTime()
+    {
+    TTlsData* data = Data();
+    
+    TTime now;
+    now.UniversalTime();
+    
+    return now.MicroSecondsFrom(data->iRealUniversalTime).Int64() / 1000;
+    }
+
+
+
+void CHuiStatic::SetRenderer(CHuiRenderPlugin& aRenderer)
+    {
+    if(!Data())
+        {
+        THuiPanic::Panic(THuiPanic::EStaticDataNotCreated);
+        }
+    Data()->iRenderer = &aRenderer;
+    }
+
+
+void CHuiStatic::UpdateTime()
+    {
+    // Updates the toolkit's time counters. This includes the toolkit's
+    // realtime clock, the internal absolute clock (which is affected by the
+    // time factor), the amount of elapsed time since last UpdateTime()
+    // invocation, and the amount of elapsed time since the first UpdateTime()
+    // invocation (which was done in the beginning of the first refresh).
+
+    TTlsData* data = Data();
+    
+    UpdateTime(data);
+    }
+
+
+
+TInt CHuiStatic::GenerateId()
+    {
+    TTlsData* data = Data();
+
+    // The ID counter counts backwards.
+    TInt id = data->iIdCounter;
+
+    if(data->iIdCounter == KMinTInt)
+        {
+        // Wrap around to stay negative.
+        data->iIdCounter = -1;
+        }
+    else
+        {
+        --data->iIdCounter;
+        }
+
+    return id;
+    }
+
+
+void CHuiStatic::ReportNewFrame()
+    {
+    TTlsData* data = Data();
+    data->iFrameCounter++;
+    data->iCurrentFrameCounter++;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiTextMesh.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,373 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiTextMesh. CHuiTextMesh stores a cached 
+*                version of a text string.
+*
+*/
+
+
+ 
+#include <AknUtils.h>
+#include "alf/alfconstants.h"
+
+#include "uiacceltk/HuiTextMesh.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiFont.h"
+#include "uiacceltk/HuiTexture.h"
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/huitextstylemanager.h"
+#include "uiacceltk/huitextstyle.h"
+#include "uiacceltk/HuiDisplay.h"
+#include "HuiRosterImpl.h"
+
+  
+CHuiTextMesh::CHuiTextMesh()
+        : iTextStyleId(0),
+          iLineSpacing(0),        
+          iTextMeshScale(1.0),        
+          iLineMode(ELineModeTruncate),
+          iMaxLineWidth(KMaxTInt),
+          iScaledMaxLineWidth(KMaxTInt),
+          iMaxLineCount(KMaxTInt),          
+          iRasterizedShadow(EFalse)
+    {
+    }
+
+    
+void CHuiTextMesh::ConstructL()
+    {
+    // Register as observer
+    CHuiStatic::Env().iActionObservers.AppendL(*this);
+    RPointerArray<CHuiDisplay> displays = CHuiStatic::Env().Displays();
+    for(TInt i = 0; i<displays.Count(); i++)
+        {
+        displays[i]->iVisibleAreaObservers.AppendL(*this);
+        
+        if (displays[i]->IsDisplayTypeTvOut())
+            {
+            displays[i]->iDeletionObservers.AppendL(*this);
+            }
+        }
+    ReleaseFont();
+        
+    CalculateTvOutScales();
+    }
+   
+
+CHuiTextMesh::~CHuiTextMesh()
+    {
+    // Remove observers
+    CHuiStatic::Env().iActionObservers.RemoveIfFound(*this);
+    RPointerArray<CHuiDisplay> displays = CHuiStatic::Env().Displays();
+    for(TInt i = 0; i<displays.Count(); i++)
+        {
+        displays[i]->iVisibleAreaObservers.RemoveIfFound(*this);
+        
+        if (displays[i]->IsDisplayTypeTvOut())
+            {
+            displays[i]->iDeletionObservers.RemoveIfFound(*this);
+            }
+        }
+        
+    delete iString;
+    iPictographInterface = NULL;
+    }
+    
+    
+void CHuiTextMesh::Reset()
+    {
+    delete iString; 
+    iString = 0;
+    }
+
+
+void CHuiTextMesh::SetLineMode(TLineMode aLineMode)
+    {
+    iLineMode = aLineMode;
+    }
+    
+
+CHuiTextMesh::TLineMode CHuiTextMesh::LineMode() const
+    {
+    return iLineMode;
+    }
+
+
+TBool CHuiTextMesh::SetMaxLineWidth(TInt aMaxLineWidth)
+    {
+    // Note: this do not tell if only scaling has been changed.
+    TBool isDifferent = (iMaxLineWidth != aMaxLineWidth);
+    iMaxLineWidth = aMaxLineWidth;
+
+    // Max line width has to be scaled to get proper line wrapping
+    if(iTextMeshScale != 1 && aMaxLineWidth != KMaxTInt)
+        {
+        // Scale width with Y-scale to retain correct font proportions
+        iScaledMaxLineWidth = HUI_ROUND_FLOAT_TO_INT( aMaxLineWidth * iTextMeshScale );
+        } 
+
+    return isDifferent;
+    }
+
+
+TInt CHuiTextMesh::MaxLineWidth() const
+    {
+    if(iTextMeshScale != 1)
+        {
+        return iScaledMaxLineWidth;
+        } 
+
+    return iMaxLineWidth;
+    }
+
+
+TBool CHuiTextMesh::SetMaxLineCount(TInt aMaxLineCount)
+    {
+    TBool isDifferent = (iMaxLineCount != aMaxLineCount);
+    iMaxLineCount = aMaxLineCount;
+    return isDifferent;
+    }
+
+
+TInt CHuiTextMesh::MaxLineCount() const
+    {
+    return iMaxLineCount;
+    }
+      
+
+void CHuiTextMesh::SetFontL(const THuiFont& aFont, TBool aRefreshTextures)
+    {
+    THuiTextStyle* textStyle = CHuiStatic::Env().TextStyleManager().TextStyle(iTextStyleId);
+    textStyle->SetFont(aFont);
+    
+    if(iString && aRefreshTextures)
+        {
+        BuildL(ETrue);
+        }
+    }
+
+
+void CHuiTextMesh::SetTextL(const TDesC& aText, TBool aRasterize)
+    {
+    delete iString; iString = 0;
+    iString = aText.AllocL();
+
+    // Rasterize text into textures.
+    BuildL(aRasterize);    
+    }
+
+    
+const TDesC* CHuiTextMesh::Text() const
+    {
+    return iString;
+    }
+    
+    
+void CHuiTextMesh::EnableRasterizedShadow(const TBool aIsEnabled)
+    {
+    TBool isChanged = ETrue;
+    if ( (iRasterizedShadow && aIsEnabled) || 
+         ( !iRasterizedShadow && !aIsEnabled ) )
+        {
+        isChanged = EFalse;
+        }
+        
+    iRasterizedShadow = aIsEnabled;
+        
+    if(isChanged && iString)
+        {
+        // Status of rasterized shadow has changed.
+        // Assuming the sharp shadow is prerendered.
+        TRAP_IGNORE(BuildL(ETrue))
+        }
+    }
+   
+   
+TBool CHuiTextMesh::RasterizedShadow() const
+    {
+    if ( iVisual )
+        {
+        return TBool(iVisual->DropShadowHandler());
+        }
+    return iRasterizedShadow;
+    }
+     
+   
+TSize CHuiTextMesh::Extents() const
+    {
+    TSize extents = iExtents;
+    
+    if(iTextMeshScale != 1)
+        {
+        extents.iHeight = iScaledExtents.iHeight;
+        extents.iWidth = iScaledExtents.iWidth;
+        }
+    
+    return extents;
+    }
+    
+void CHuiTextMesh::ExpandRectWithShadow(TRect& /*aRect*/) const
+    {
+    }
+
+void CHuiTextMesh::SetExtents(const TSize& aExtents)
+    {
+    TBool isChanged = (iExtents != aExtents);
+    
+    iExtents = aExtents;
+    
+    if(iTextMeshScale != 1 && isChanged)
+        {
+        iScaledExtents.iHeight = HUI_ROUND_FLOAT_TO_INT( aExtents.iHeight/iTextMeshScale );
+        iScaledExtents.iWidth = HUI_ROUND_FLOAT_TO_INT( aExtents.iWidth/iTextMeshScale );
+        }
+    }
+
+
+void CHuiTextMesh::InitPictographsL(CAknPictographInterface* aInterface)
+    {
+    iPictographInterface = aInterface;    
+    }
+
+
+void CHuiTextMesh::SetTextStyle(TInt aTextStyleId)
+    {
+    iTextStyleId = aTextStyleId;
+    ReleaseFont(); 
+    }
+
+
+TInt CHuiTextMesh::TextStyle() const
+	{
+	return iTextStyleId;
+	}
+
+
+void CHuiTextMesh::BuildPictographsL()
+    {        
+    }
+
+
+void CHuiTextMesh::SetLineSpacing(TInt aLineSpacingInPixels)
+    {
+    iLineSpacing = aLineSpacingInPixels;
+    }
+    
+    
+void CHuiTextMesh::ReleaseFont()
+    {
+    THuiTextStyle* textStyle = CHuiStatic::Env().TextStyleManager().TextStyle(iTextStyleId);
+    textStyle->Font().ReleaseFont();
+    }
+    
+
+void CHuiTextMesh::CalculateTvOutScales()
+    {
+    // Calculate the TV Out scales
+    RPointerArray<CHuiDisplay> displays = CHuiStatic::Env().Displays();
+    for(TInt i = 0; i<CHuiStatic::Env().DisplayCount(); i++)
+        {
+        if (displays[i]->IsDisplayTypeTvOut())
+            {
+            // Scale with height to retain correct font proportions
+            iTextMeshScale = (TReal32)displays[i]->Size().iHeight / (TReal32)displays[i]->RosterImpl().Rect().Height();
+            }
+        }
+    }
+    
+    
+void CHuiTextMesh::NotifyDisplayVisibleAreaChanged(CHuiDisplay& aDisplay)
+    {
+    if (aDisplay.IsDisplayTypeTvOut())
+        {
+        iTextMeshScale = (TReal32)aDisplay.Size().iHeight / (TReal32)aDisplay.RosterImpl().Rect().Height();
+        }
+        
+    ReleaseFont();
+    }
+
+
+void CHuiTextMesh::NotifyDisplayDeletion(CHuiDisplay& aDisplay)
+    {
+    if (iString && aDisplay.IsDisplayTypeTvOut())
+        {
+        iTextMeshScale = 1.0;
+        ReleaseFont();
+        ResetLines();
+        ResetPictographLines();
+        // Updates the mesh and the extents
+        TRAP_IGNORE(BuildL(ETrue));
+        }
+    }
+
+
+void CHuiTextMesh::HandleActionL(const THuiActionCommand& aActionCommand)
+    {
+    if(aActionCommand.Id() == KHuiActionNewTVOutDisplayUid.iUid)
+        {
+        // find the TvOut display
+        RPointerArray<CHuiDisplay> displays = CHuiStatic::Env().Displays();
+        for(TInt i = 0; i<displays.Count(); i++)
+            {
+            if (displays[i]->IsDisplayTypeTvOut())
+                {
+                // Register as observer
+                displays[i]->iVisibleAreaObservers.AppendIfNotFoundL(*this);
+                displays[i]->iDeletionObservers.AppendIfNotFoundL(*this);
+                
+                // calculate new scale factors
+                CalculateTvOutScales();
+                }
+            }
+            
+        ReleaseFont();
+        ResetLines();
+        ResetPictographLines();
+        // Updates the mesh and the extents
+        if(Text() != NULL)
+            {
+            BuildL(ETrue);
+            }
+        }
+            
+    else if ( aActionCommand.Id() == KAknsMessageSkinChange )
+        {
+        // When the resolution/skin changes and this text visual is not in 
+        // the roster, the change notification is not received through the normal
+        // route aka CHuiVisual::NotifySkinChangedL() 
+        //
+        // Setting the iMaxLineWidth into -1 is a hack. It would be better to
+        // set the iMeshUpdated into EFalse in the CHuiTextVisual, but this class
+        // has no pointer to the owning text visual. The text visual calls the 
+        // SetMaxLineWidth function before it draws this mesh so the "changed" 
+        // notification is informed through that function call.
+        iMaxLineWidth = -1;
+        }
+    else
+        {
+        // For PC lint
+        }
+    }
+
+void CHuiTextMesh::SetRelatedVisual(CHuiVisual* aVisual)
+    {
+    iVisual = aVisual;
+    }
+
+void CHuiTextMesh::UpdateMeshL(const TDesC8& /*aBuffer*/)
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiTextStyle.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,637 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   A Text style encapsulates a unique text style 
+*                in Hitchcock UI Toolkit usage.
+*
+*/
+
+
+
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/huitextstyle.h"
+#include "uiacceltk/huitextstylemanager.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiUtil.h"
+
+#include <AknFontProvider.h>
+#include <e32math.h>
+
+void Blur(CFbsBitmap& aImage, TInt aRadius )
+    {
+    if (aRadius < 1)
+        {
+        return;
+        }
+ 
+    TReal expn = 0.0f;
+    Math::Exp(expn, -2.3f/(aRadius+1.f));
+    TInt alpha = (TInt)((1<<16)*(1.0f-expn));
+
+    TSize imagesize = aImage.SizeInPixels();
+    TInt imageW = imagesize.iWidth;//aImage.SizeInPixels().Width
+    TInt imageH = imagesize.iHeight;
+    TInt imageP = aImage.ScanLineLength(imageW,EGray256);
+    for(TInt row=0;row<imageH;row++) 
+        {
+        TInt zA;
+
+        TUint8 *ptr = ((TUint8*)(aImage.DataAddress())+(row*imageP));
+
+        zA = (*ptr)<<7;
+
+        for(TInt index=1; index<imageW; index++) 
+            {
+                {
+                TInt A;
+                A = ptr[index];
+                zA += (alpha * ((A<<7)-zA))>>16;
+                ptr[index] = zA>>7;
+                }
+            }
+        for(TInt index=imageW-2; index>=0; index--) 
+            {
+            TInt A;
+            A = ptr[index];
+            zA += (alpha * ((A<<7)-zA))>>16;
+            ptr[index] = zA>>7;
+            }
+        }
+
+    for(TInt col=0;col<imageW;col++) 
+        {
+        TInt zA;
+
+        TUint8 *ptr = (TUint8*)aImage.DataAddress();
+        ptr+=col;
+
+        zA = *((TUint8 *)ptr)<<7;
+        for(TInt index=imageP; index<(imageH-1)*imageP;index+=imageP) 
+            {
+            TInt A;
+            A = ptr[index];
+            zA += (alpha * ((A<<7)-zA))>>16;
+            ptr[index] = zA>>7;
+            }
+
+        for(TInt index=(imageH-2)*imageP; index>=0;index-=imageP)
+            {
+            TInt A;
+            A = ptr[index];
+            zA += (alpha * ((A<<7)-zA))>>16;
+            ptr[index] = zA>>7;
+            }    		
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Default constructor. Will create the root (default) text style with
+// default parameters.
+// ---------------------------------------------------------------------------
+//
+THuiTextStyle::THuiTextStyle(TInt aFontStyleId,  TInt aParentId)
+		: iFontStyleId( aFontStyleId ),
+		  iParentId(aParentId),
+		  iTextColor(KRgbWhite),
+		  iIsUnderline(EFalse),
+          iIsStrikeThrough(EFalse),
+          iClippingEnabled(EFalse)
+    {
+    // This is the default style, everything is defined here.
+    if(aParentId == -1) 
+        {
+        iLocalDefinitionFlags = 0xFFFFFFFF;
+        }
+    // other styles, by default, nothing is defined, everything comes from the parent
+    else
+        {
+        iLocalDefinitionFlags = 0x00000000;
+        }
+   }
+     
+// ---------------------------------------------------------------------------
+// Copy constructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C THuiTextStyle::THuiTextStyle( const THuiTextStyle& aTextStyle )
+	{
+	iFont = aTextStyle.Font();
+	iFontStyleId = aTextStyle.FontStyleId();
+    iParentId = aTextStyle.ParentId();
+    iId = -1; // Id is not yet set. A unique Id will be set by the text style manager.
+    iBackgroundColor = aTextStyle.BackgroundColor();
+    iTextColor = aTextStyle.TextColor();
+    iIsUnderline = aTextStyle.Underline();
+    iIsStrikeThrough = aTextStyle.StrikeThrough();
+    iLocalDefinitionFlags = aTextStyle.LocalDefinitionFlags();
+    iClippingEnabled = aTextStyle.iClippingEnabled;
+    iClipRect = aTextStyle.iClipRect;
+	}
+
+// ---------------------------------------------------------------------------
+// THuiTextStyle::Id
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt THuiTextStyle::Id() const
+	{
+	return iId;   
+	}
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::SetId
+// ---------------------------------------------------------------------------
+//
+void THuiTextStyle::SetId(TInt aId)
+    {
+    iId = aId;
+    }
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::ParentId
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt THuiTextStyle::ParentId() const
+	{
+	return iParentId;     
+	}
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::SetParentId
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void THuiTextStyle::SetParentId(TInt aParentId)
+	{
+	if(iParentId != aParentId)
+	    {
+	    iParentId = aParentId;
+	    }
+	
+	iParentId = aParentId;   
+	}
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::LocalDefinitionFlags
+// ---------------------------------------------------------------------------
+//
+TInt THuiTextStyle::LocalDefinitionFlags() const
+    {
+    return iLocalDefinitionFlags;
+    }
+
+// ---------------------------------------------------------------------------
+// THuiTextStyle::SetLocalDefinitionFlags
+// ---------------------------------------------------------------------------
+//
+void THuiTextStyle::SetLocalDefinitionFlags(TInt aLocalDefinitionFlags)
+    {
+    iLocalDefinitionFlags = aLocalDefinitionFlags;
+    }
+
+// ---------------------------------------------------------------------------
+// THuiTextStyle::Font
+// ---------------------------------------------------------------------------
+//
+EXPORT_C THuiFont& THuiTextStyle::Font()
+    {
+    if(iLocalDefinitionFlags & KFontDefined)
+        {
+        return iFont;
+        }
+    return CHuiStatic::Env().TextStyleManager().TextStyle(iParentId)->Font();
+    }
+    
+// ---------------------------------------------------------------------------
+// THuiTextStyle::Font
+// ---------------------------------------------------------------------------
+//
+EXPORT_C const THuiFont& THuiTextStyle::Font() const
+    {
+    if(iLocalDefinitionFlags & KFontDefined)
+        {
+        return iFont;
+        }
+    return CHuiStatic::Env().TextStyleManager().TextStyle(iParentId)->Font();
+    }
+
+// ---------------------------------------------------------------------------
+// THuiTextStyle::SetFont
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void THuiTextStyle::SetFont(THuiFont aFont)
+    {
+    iFont = aFont;
+    iLocalDefinitionFlags |= KFontDefined;
+    }
+
+// ---------------------------------------------------------------------------
+// THuiTextStyle::TextColor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TRgb THuiTextStyle::TextColor() const
+	{
+    if(iLocalDefinitionFlags & KTextColorDefined)
+        {
+        return iTextColor;
+        }
+    return CHuiStatic::Env().TextStyleManager().TextStyle(iParentId)->TextColor();
+	}
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::SetTextColor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void THuiTextStyle::SetTextColor(const TRgb& aTextColor)
+    {
+    iTextColor = aTextColor;
+    iLocalDefinitionFlags |= KTextColorDefined;
+    }
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::BackgroundColor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TRgb THuiTextStyle::BackgroundColor() const // @todo: not currently implemented, does nothing.
+    {
+    if(iLocalDefinitionFlags & KBackgroundColorDefined)
+        {
+        return iBackgroundColor;
+        }
+    return CHuiStatic::Env().TextStyleManager().TextStyle(iParentId)->BackgroundColor();
+    }
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::SetBackgroundColor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void THuiTextStyle::SetBackgroundColor(const TRgb& aBackgroundColor)// @todo: not currently implemented, does nothing.
+    {
+    iBackgroundColor = aBackgroundColor;
+    iLocalDefinitionFlags |= KBackgroundColorDefined;
+    }
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::TextSizeInTwips
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt THuiTextStyle::TextSizeInTwips(TBool /*aIsDecoratedSize*/)
+	{
+    if(iLocalDefinitionFlags & KTextSizeDefined)
+        {
+        TFontSpec spec = iFont.FontSpec();
+        TInt size = spec.iHeight;
+            
+        return size;
+        }
+    return CHuiStatic::Env().TextStyleManager().TextStyle(iParentId)->TextSizeInTwips();
+	}
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::SetTextSizeInTwips
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void THuiTextStyle::SetTextSizeInTwips(TInt aTextSize, TBool /*aIsDecoratedSize*/)
+    {
+	TFontSpec spec = iFont.FontSpec();
+    
+    spec.iHeight = aTextSize;
+    iFont.SetFontSpec(spec);
+    iLocalDefinitionFlags |= KTextSizeDefined;
+    }
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::TextSizeInPixels
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt THuiTextStyle::TextSizeInPixels(TBool /*aIsDecoratedSize*/)
+	{
+    if(iLocalDefinitionFlags & KTextSizeDefined)
+        {
+        TFontSpec spec = iFont.FontSpec();
+        CWsScreenDevice* screenDevice = CHuiStatic::ScreenDevice();
+        TInt textsizeInPix = screenDevice->VerticalTwipsToPixels(spec.iHeight);
+            
+        return textsizeInPix;
+        }
+    return CHuiStatic::Env().TextStyleManager().TextStyle(iParentId)->TextSizeInTwips();
+	}
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::SetTextSizeInPixels
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void THuiTextStyle::SetTextSizeInPixels(TInt aTextSizeInPix, TBool /*aIsDecoratedSize*/)
+    {
+    TFontSpec spec = iFont.FontSpec(); 
+    CWsScreenDevice* screenDev = CHuiStatic::ScreenDevice();
+    
+    TInt textsizeInTwips = screenDev->VerticalPixelsToTwips(aTextSizeInPix);
+    spec.iHeight = textsizeInTwips;
+    iFont.SetFontSpec(spec);
+    iLocalDefinitionFlags |= KTextSizeDefined;
+    }
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::StrokeWeight
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool THuiTextStyle::StrokeWeight()
+    {
+    TFontSpec spec = iFont.FontSpec();
+
+    if(iLocalDefinitionFlags & KStrokeWeightDefined)
+        {
+        return spec.iFontStyle.StrokeWeight();
+        }
+    return CHuiStatic::Env().TextStyleManager().TextStyle(iParentId)->StrokeWeight();
+    }
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::SetStrokeWeight
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void THuiTextStyle::SetStrokeWeight(TBool aIsStrokeWeight)
+    {
+    TFontSpec spec = iFont.FontSpec();
+	spec.iFontStyle.SetStrokeWeight((aIsStrokeWeight ? EStrokeWeightBold : EStrokeWeightNormal));
+    iFont.SetFontSpec(spec);
+    iLocalDefinitionFlags |= KStrokeWeightDefined;
+    }
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::Posture
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool THuiTextStyle::Posture()
+    {
+    TFontSpec spec = iFont.FontSpec();
+
+    if(iLocalDefinitionFlags & KPostureDefined)
+        {
+        return spec.iFontStyle.Posture();
+        }
+    return CHuiStatic::Env().TextStyleManager().TextStyle(iParentId)->Posture();
+    }
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::SetPosture
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void THuiTextStyle::SetPosture(TBool aIsItalic)
+    {
+    TFontSpec spec = iFont.FontSpec();
+	spec.iFontStyle.SetPosture((aIsItalic ? EPostureItalic : EPostureUpright));
+    iFont.SetFontSpec(spec);
+    iLocalDefinitionFlags |= KPostureDefined;
+    }
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::Underline
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool THuiTextStyle::Underline() const
+    {
+    if(iLocalDefinitionFlags & KUnderlineDefined)
+        {
+        return iIsUnderline;
+        }
+    return CHuiStatic::Env().TextStyleManager().TextStyle(iParentId)->Underline();
+    }
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::SetUnderline
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void THuiTextStyle::SetUnderline(TBool aIsUnderline)
+    {
+    iIsUnderline = aIsUnderline;
+    iLocalDefinitionFlags |= KUnderlineDefined;
+    }
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::StrikeThrough
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TBool THuiTextStyle::StrikeThrough() const
+    {
+    if(iLocalDefinitionFlags & KStrikeThroughDefined)
+        {
+        return iIsStrikeThrough;
+        }
+    return CHuiStatic::Env().TextStyleManager().TextStyle(iParentId)->StrikeThrough();
+    }
+	
+// ---------------------------------------------------------------------------
+// THuiTextStyle::SetStrikeThrough
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void THuiTextStyle::SetStrikeThrough(TBool aIsStrikeThrough)
+    {
+    iIsStrikeThrough = aIsStrikeThrough;
+    iLocalDefinitionFlags |= KStrikeThroughDefined;
+    }
+
+// ---------------------------------------------------------------------------
+// THuiTextStyle::FontStyleId
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt THuiTextStyle::FontStyleId() const
+    {
+    return iFontStyleId;     
+    }
+
+// ---------------------------------------------------------------------------
+// THuiTextStyle::GetTypeface
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void THuiTextStyle::GetTypeface( TTypeface& aTypeface ) const
+    {
+    TFontSpec spec = iFont.FontSpec();
+    aTypeface = spec.iTypeface; // Structure copy
+    }
+
+// ---------------------------------------------------------------------------
+// THuiTextStyle::SetTextPaneHeightInPixels
+// ---------------------------------------------------------------------------
+EXPORT_C void THuiTextStyle::SetTextPaneHeightInPixels(TInt aTextPaneHeight, TBool /*aIsDecoratedSize*/)
+    {
+    if (!CCoeEnv::Static())
+        return;
+    
+    TFontSpec oldFontSpec = iFont.FontSpec(); 
+    
+    // now generate a font with the new text pane height 
+    CWsScreenDevice* screenDev = CHuiStatic::ScreenDevice();
+    TAknFontSpecification aknFs(iFont.Category(), oldFontSpec, screenDev);
+    aknFs.SetTextPaneHeight(aTextPaneHeight);
+
+    // and get its corresponding spec
+    TFontSpec newFontSpec;
+    TInt foundIndex(KErrNotFound);
+    AknFontProvider::GetFontSpecFromMetrics(*screenDev, 0, aknFs, newFontSpec, foundIndex);
+
+    if(foundIndex != KErrNotFound)
+        {
+        TInt textsizeInTwips = screenDev->VerticalPixelsToTwips(newFontSpec.iHeight);
+        newFontSpec.iHeight = textsizeInTwips;
+        iFont.SetFontSpec(newFontSpec);
+        iLocalDefinitionFlags |= KTextSizeDefined;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// THuiTextStyle::RasterizeLineL
+// Rasterizes the given string on to the target texture using this text style.
+// ---------------------------------------------------------------------------
+//
+void THuiTextStyle::RasterizeLineL(const TDesC& aTextLine, CHuiTexture& aTargetTexture)
+	{
+	// Calculate the pixel extents of the text line.
+	TSize textureSize = LineExtentsL(aTextLine);
+	
+	TSize maxTextureSize = aTargetTexture.MaxTextureSize();
+	
+	// With OpenGL renderers we have possibility to segment larger textures
+	// so we don't need to limit texture size to maximum texture size
+	if(CHuiStatic::Renderer().Id() != EHuiRenderPluginGles10 &&
+	   CHuiStatic::Renderer().Id() != EHuiRenderPluginGles11 ) 
+        {
+        textureSize.iWidth = Min(textureSize.iWidth, maxTextureSize.iWidth);
+        textureSize.iHeight = Min(textureSize.iHeight, maxTextureSize.iHeight);
+        }
+        
+    // Verify that max texture dimensions are greater than zero.        
+	if((maxTextureSize.iWidth == 0) || (maxTextureSize.iHeight == 0))
+	    {
+	    // Cannot draw into this tiny texture, so leave.
+	    HUI_DEBUG2(_L("CHuiRasterizedTextMesh::RasterizeLineL() - texture size was too small to draw into (%i, %i)."), textureSize.iWidth, textureSize.iHeight);
+	    User::Leave(KErrAbort);
+	    }
+	
+	// Create target alpha bitmap to rasterize the text onto.
+	CFbsBitmap* alphaBitmap = new (ELeave) CFbsBitmap();
+	CleanupStack::PushL(alphaBitmap);
+    User::LeaveIfError(alphaBitmap->Create(textureSize, EGray256));
+	
+	// Create the bitmap device to be used in rasterization.
+    CFbsBitmapDevice* device = CFbsBitmapDevice::NewL(alphaBitmap);
+	CleanupStack::PushL(device);
+	
+	// Create drawing context.
+	CFbsBitGc* gc = 0;
+	User::LeaveIfError(device->CreateContext(gc));
+	CleanupStack::PushL(gc);
+	
+	// Prepare the bitmap for drawing.
+	gc->SetBrushColor(KRgbBlack);
+	gc->Clear();
+	
+	// Draw the text onto the bitmap.    
+	gc->SetPenColor(KRgbWhite);
+		
+	// Do underlining
+	gc->SetUnderlineStyle(Underline() ? EUnderlineOn : EUnderlineOff);
+	// Do strikethrough
+	gc->SetStrikethroughStyle(StrikeThrough() ? EStrikethroughOn : EStrikethroughOff);
+	
+	if(iClippingEnabled)
+	{
+    	gc->SetClippingRect(iClipRect);
+	}
+    
+	// Rasterize text string using the configured font.
+	Font().RasterizeLineL(aTextLine, *gc);
+	
+	// Destroy graphics context and drawing device.
+	CleanupStack::PopAndDestroy(gc);
+	CleanupStack::PopAndDestroy(device);
+	
+	// Create target color bitmap.
+	CFbsBitmap* colorBitmap = new (ELeave) CFbsBitmap;
+	CleanupStack::PushL(colorBitmap);		
+	User::LeaveIfError(colorBitmap->Create(textureSize, EColor64K));
+		
+	// Lock the color bitmap heap and acquire the pixel data pointers for per-pixel operations.
+	colorBitmap->LockHeapLC(ETrue);
+	
+	// Color bitmap poses EColor64K pixel format.
+	TUint32 bitmappitch = CFbsBitmap::ScanLineLength(textureSize.iWidth, EColor64K)>>1;
+	
+	if(CHuiStatic::Renderer().Id() == EHuiRenderPluginBitgdi)
+	    {
+        // fill the color bitmap with white -> color modulation works correctly
+        Mem::Fill(colorBitmap->DataAddress(), bitmappitch*2*textureSize.iHeight ,0xff);
+        
+   	    }
+	else
+	    {
+	    // opengl renderer.
+	    // Clear the font image bitmap with a solid color. The alpha mask contains the shape of the letters.
+	    CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL(colorBitmap);
+	    CleanupStack::PushL(dev);
+	
+	    // Create drawing context for color bitmap.
+	    CFbsBitGc* gct = 0;
+	    User::LeaveIfError(dev->CreateContext(gct));
+	    CleanupStack::PushL(gct);
+	
+	    // fill the color bitmap with white -> color modulation works correctly
+	    gct->SetBrushColor(KRgbWhite);
+	    gct->Clear();  
+	    
+	    // Destroy the color bitmap drawing context.
+	    CleanupStack::PopAndDestroy(gct);
+	    CleanupStack::PopAndDestroy(dev);                  
+	    }
+	
+	// Upload the rasterized text onto a texture.
+	CleanupStack::PopAndDestroy(); // Heaplock
+	aTargetTexture.UploadL(*colorBitmap, alphaBitmap, EHuiTextureUploadFlagRetainResolution);
+
+	CleanupStack::PopAndDestroy(); // Color bitmap
+	
+	// Re-assign the size of the text
+	aTargetTexture.SetSize(textureSize);
+		
+    // Delete target bitmap.
+	CleanupStack::PopAndDestroy(alphaBitmap);	
+	}
+
+// ---------------------------------------------------------------------------
+// THuiTextStyle::LineExtentsL
+// Provides dimensions of the rasterization of the given string. 
+// ---------------------------------------------------------------------------
+//
+TSize THuiTextStyle::LineExtentsL(const TDesC& aTextLine)
+	{    
+	// Retrieve the non-decorated line extents from the used font.
+	TSize textSize = Font().LineExtentsL(aTextLine);
+	
+	// Add the decorations (shadow, etc.) to the line extents.
+    if(textSize.iWidth == 0)
+        {
+        return textSize;
+        }
+    return textSize;
+	}
+	
+void  THuiTextStyle::EnableClipping(TRect aClipRect)
+	{
+	iClippingEnabled = ETrue;
+	iClipRect = aClipRect;
+	}
+	
+void  THuiTextStyle::DisableClipping()		
+	{
+	iClippingEnabled = EFalse;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiTextStyleManager.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,300 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of HuiTextStyleManager. Handles the management
+*                of Hitchcock UI Toolkit specific font styles. The 
+*                implementation consists only of Symbian / S60 specific
+*                implementation but the interface is designed so that 
+*                alternative platforms can be utilized.
+*
+*/
+
+
+
+#include <avkon.hrh> // @todo: include proper header file
+#include <AknUtils.h>
+#include <aknappui.h>
+#include <gdi.h>
+#ifndef PUBLIC_SDK
+#include <aknlayoutscalable_avkon.cdl.h>
+#endif
+
+#include "uiacceltk/huitextstylemanager.h"
+#include "HuiS60TextStyle.h"
+#include "uiacceltk/HuiUtil.h"
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Creates the CHuiTextStyleManager. Sets parameters to default values.
+// ---------------------------------------------------------------------------
+//
+CHuiTextStyleManager::CHuiTextStyleManager() 
+	{
+
+	}
+
+// ---------------------------------------------------------------------------
+// Destroys the CHuiTextStyleManager. Makes sure all allocated resources are 
+// freed.
+// ---------------------------------------------------------------------------
+//
+CHuiTextStyleManager::~CHuiTextStyleManager()
+    {
+    // delete the text style in the array
+    for(TInt i = 0; i < iTextStyles.Count(); i++)
+        {
+        // need to down cast, because base class does not have
+        // virtual destructor.
+        THuiS60TextStyle* deletedStyle = static_cast<THuiS60TextStyle*>(iTextStyles[i]);
+        delete deletedStyle;
+        }
+    
+    // Close the array
+    iTextStyles.Close();
+    }
+
+
+// -----------------------------------------------------------------------------
+// CHuiTextStyleManager::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CHuiTextStyleManager* CHuiTextStyleManager::NewL()
+    {
+    CHuiTextStyleManager* self = NewLC();
+    CleanupStack::Pop();
+    return self;
+    }
+
+
+// -----------------------------------------------------------------------------
+// CHuiTextStyleManager::NewLC
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CHuiTextStyleManager* CHuiTextStyleManager::NewLC()
+    {
+    CHuiTextStyleManager* self = new (ELeave) CHuiTextStyleManager();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// CHuiTextStyleManager::ConstructL
+// Symbian 2nd phase constructor.
+// ---------------------------------------------------------------------------
+//
+void CHuiTextStyleManager::ConstructL()
+    {
+    // Construct the default text style first. 
+	// It is the same as ENormalFont / EHuiTextStyleNormal, EHuiTextStyleMenuItem
+    // Parent id -1 means no parent
+    CreatePlatformTextStyleL( EAknLogicalFontPrimaryFont, -1 );
+    }
+
+// ---------------------------------------------------------------------------
+// Creates a new text style instance.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CHuiTextStyleManager::CreatePlatformTextStyleL(TInt aFontStyleId, TInt aParentId)
+	{
+	THuiS60TextStyle* style = new (ELeave) THuiS60TextStyle(aFontStyleId, aParentId);
+	
+    // Append the specified text style into the array of styles.
+    CleanupStack::PushL( style );
+    InsertIntoArrayAndSetIdL(*style); 
+    CleanupStack::Pop( style );
+    
+    // Return the unique ID of the text style.
+    return style->Id();
+	}
+
+// ---------------------------------------------------------------------------
+// Retuns A pointer to the requested text style.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C THuiTextStyle* CHuiTextStyleManager::TextStyle(TInt aId)
+	{
+    if ( aId >= 0 && aId < iTextStyles.Count() )
+        {
+        __ASSERT_DEBUG( iTextStyles[aId] , USER_INVARIANT() );
+        return iTextStyles[aId];
+        }
+
+	return iTextStyles[EHuiTextStyleNormal];
+	}
+
+// ---------------------------------------------------------------------------
+// Creates a new text style object that is identical with the given source 
+// text style.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CHuiTextStyleManager::CopyTextStyleL(TInt aSourceId)
+	{
+	// get the source text style by the id
+	const THuiTextStyle sourceStyle = *TextStyle(aSourceId);
+	
+	// make a copy of the source text style
+	THuiTextStyle* style = new (ELeave) THuiTextStyle(sourceStyle);
+	
+    // Append the specified text style into the array of styles.
+    CleanupStack::PushL( style );
+    InsertIntoArrayAndSetIdL(*style); 
+    CleanupStack::Pop( style );
+    
+    // Return the unique ID of the text style.
+    return style->Id();
+	}
+
+// ---------------------------------------------------------------------------
+// Deletes text style with given ID.
+// ---------------------------------------------------------------------------
+//	
+EXPORT_C TInt CHuiTextStyleManager::DeleteTextStyle(TInt aId)
+    {
+    // Cannot delete platform styles from an application.
+    if ( aId >= 0 && aId <= iLastBuiltInStyleId )
+        {
+        return KErrAccessDenied;
+        }
+        
+    if ( aId >= iTextStyles.Count() )
+        {
+        return KErrArgument;
+        }
+    // need to down cast, because base class does not have
+    // virtual destructor.
+    THuiS60TextStyle* deletedStyle = static_cast<THuiS60TextStyle*>(iTextStyles[aId]);
+    
+    if ( deletedStyle )
+        {
+        delete deletedStyle;
+        iTextStyles[aId] = NULL; // NULL the slot for later usage.
+        }
+    else
+        {
+        return KErrArgument;
+        }
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// Construct built-in styles.
+// these ate the preconfigured text styles enumerated in HuiSkin.h
+// ---------------------------------------------------------------------------
+//
+void CHuiTextStyleManager::ConstructBuiltInStylesL()
+    {
+    THuiTextStyle* style;
+
+    // the order here must be the same as in HuiSkin.h THuiPreconfiguredTextStyle
+    
+ 	// ENormalItalicFont / no EHuiTextStyleXxx def
+    TInt normalItalicStyleId = CreatePlatformTextStyleL( EAknLogicalFontPrimaryFont, EHuiTextStyleNormal );
+    style = TextStyle(normalItalicStyleId);
+	style->SetPosture(ETrue);
+	
+ 	// EHuiTextStyleMenuItem
+    CreatePlatformTextStyleL( EAknLogicalFontPrimaryFont, EHuiTextStyleNormal );
+	
+ 	// ESmallFont / EHuiTextStyleSmall
+    TInt smallStyleId = CreatePlatformTextStyleL( EAknLogicalFontSecondaryFont, EHuiTextStyleNormal );
+	
+ 	// ESmallFont EHuiTextStyleMenuSmall
+    CreatePlatformTextStyleL( EAknLogicalFontSecondaryFont, smallStyleId );
+	
+ 	// ENormalBoldFont / EHuiTextStyleMenuTitle 
+    TInt normalBoldStyleId = CreatePlatformTextStyleL( EAknLogicalFontPrimaryFont, EHuiTextStyleNormal );
+    style = TextStyle(normalBoldStyleId);
+	style->SetStrokeWeight(ETrue);
+	
+ 	// ELargeFont / EHuiTextStyleLarge
+    CreatePlatformTextStyleL( EAknLogicalFontTitleFont, EHuiTextStyleNormal );
+	
+    // ESoftkeyFont / EHuiTextStyleSoftkey
+    TInt softkeyStyleId = CreatePlatformTextStyleL( EAknLogicalFontTitleFont, EHuiTextStyleNormal );
+    SetSoftkeyTextStyle(softkeyStyleId);
+	
+    // EHuiTextStyleSupplement
+    CreatePlatformTextStyleL( EAknLogicalFontPrimaryFont, EHuiTextStyleNormal );
+	
+    // EHuiTextStyleTitle
+    iLastBuiltInStyleId = CreatePlatformTextStyleL( EAknLogicalFontTitleFont, EHuiTextStyleNormal );
+
+    NotifyDisplaySizeChangedL(); // @todo: Why this is needed to make EHuiTextStyleSmall to look "small" instead of "normal" ???
+    }
+
+void CHuiTextStyleManager::SetSoftkeyTextStyle(TInt aTextStyleId)
+	{
+    // Deprecated, really
+	if (!CCoeEnv::Static())
+	    {
+	    return;
+	    }
+		
+	THuiTextStyle* style = TextStyle(aTextStyleId);
+	TFontSpec spec;
+	
+	/// Approximate the S60 softkey font parameters    
+    const CFont* font = AknLayoutUtils::FontFromId(EAknLogicalFontTitleFont, NULL);
+    spec = font->FontSpecInTwips();
+	spec.iHeight = 80 * spec.iHeight / 100;
+	THuiFont huiFont(0, spec);
+	style->SetFont(huiFont);
+	}
+
+void CHuiTextStyleManager::NotifyDisplaySizeChangedL()
+    {
+    for(TInt i = 0; i < iLastBuiltInStyleId; i++)
+        {
+        THuiS60TextStyle* platformStyle = dynamic_cast<THuiS60TextStyle*>(iTextStyles[i]);
+        // Assume that dynmic cast returns null if iTextStyles[i] is not THuiS60TextStyle
+        if (platformStyle)
+            {
+            platformStyle->Init();
+            }                
+        }        
+    }
+    
+void CHuiTextStyleManager::InsertIntoArrayAndSetIdL(THuiTextStyle& style)
+    {
+    TInt id = KErrNotFound;
+    
+    // try to find an empty slot
+    for ( TInt i = iTextStyles.Count() - 1 ; i >= 0 && id == KErrNotFound; i-- )
+        {
+        if ( !iTextStyles[i] )
+            {
+            // empty found
+            id = i;
+            }
+        }
+    
+    if ( id != KErrNotFound )
+        {
+        // empty slot found -> utilize that
+        iTextStyles[id] = &style;
+        }
+    else
+        {
+        // append
+        id = iTextStyles.Count();
+        iTextStyles.AppendL(&style);
+        }
+        
+    style.SetId( id );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiTextVisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,828 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiTextVisual. CHuiTextVisual is a visual
+*                that draws text.
+*
+*/
+
+
+
+#include <AknsConstants.h>
+#include <AknsUtils.h>
+#include <AknPictographInterface.h>
+#include <AknPictographDrawerInterface.h>
+#include <AknUtils.h>
+#include "uiacceltk/HuiTextVisual.h"  // Class definition
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiDrawing.h"
+#include "uiacceltk/HuiTextMesh.h"  
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/huitextstyle.h"
+#include "uiacceltk/huitextstylemanager.h"
+#include "uiacceltk/huidropshadow.h"
+
+#include "HuiRosterImpl.h"
+
+// Internal class to handle Japanese pictograph animations.
+NONSHARABLE_CLASS(CHuiPictographAnimator) : public CBase, public MAknPictographAnimatorCallBack
+    {
+public:
+    CHuiPictographAnimator(CHuiTextVisual* aVisual, CHuiTextMesh* aTextMesh);
+    ~CHuiPictographAnimator();
+    TBool IsAnimating() const;
+    void SetAnimating(TBool aAnimating);    
+    // From MAknPictographAnimatorCallBack
+    void DrawPictographArea();
+private:    
+    CHuiTextVisual* iVisual;
+    CHuiTextMesh* iTextMesh;    
+    TBool iAnimating;
+    };
+    
+CHuiPictographAnimator::CHuiPictographAnimator(CHuiTextVisual* aVisual, CHuiTextMesh* aTextMesh)
+    {
+    iVisual = aVisual;
+    iTextMesh = aTextMesh;	
+    }
+
+CHuiPictographAnimator::~CHuiPictographAnimator()
+    {	
+    iVisual = NULL;
+    iTextMesh = NULL;
+    }
+
+TBool CHuiPictographAnimator::IsAnimating() const
+    {
+    return iAnimating;	
+    }
+
+void CHuiPictographAnimator::SetAnimating(TBool aAnimating)
+    {
+    iAnimating = aAnimating;	
+    }
+
+void CHuiPictographAnimator::DrawPictographArea()
+    {
+    // This condition might need some further consideration.
+    if (iVisual->EffectiveOpacity() > 0.0 && 
+        CHuiStatic::Env().RefreshMode() != EHuiRefreshModeManual)
+        {
+        SetAnimating(ETrue);
+        // This BuildPictographsL()-call also keeps the animation ticker 
+        // behind CAknPictographInterface alive.
+        TRAP_IGNORE(iTextMesh->BuildPictographsL())
+        iVisual->SetChanged();            
+        }
+    else
+        {
+        // No call made to CAknPictographInterface -> animation timer gets automatically freezed.
+        SetAnimating(EFalse);                    
+        }    
+    }
+
+
+EXPORT_C CHuiTextVisual* CHuiTextVisual::AddNewL(CHuiControl& aOwnerControl,
+                                                 CHuiLayout* aParentLayout)
+    {
+    CHuiTextVisual* text = STATIC_CAST(CHuiTextVisual*,
+        aOwnerControl.AppendVisualL(EHuiVisualTypeText, aParentLayout));
+    return text;
+    }
+
+
+CHuiTextVisual::CHuiTextVisual(MHuiVisualOwner& aOwner)
+        : CHuiVisual(aOwner),
+          iLineWrapping(ELineWrapManual),
+          iAlignHorizontal(EHuiAlignHCenter),
+          iAlignVertical(EHuiAlignVCenter),
+          iStyle(EHuiTextStyleNormal),
+          iFontColor(KRgbWhite),
+          iFontColorId(KAknsIIDNone)
+    {
+    }
+
+
+void CHuiTextVisual::ConstructL()
+    {
+    CHuiVisual::ConstructL();
+    
+    iTextMesh = CHuiStatic::Renderer().CreateTextMeshL();
+    iTextMesh->SetRelatedVisual( this );
+    
+    iMeshUpdated = EFalse;
+    iExtentsUpdated = EFalse;
+    iPictographAnimator = new (ELeave) CHuiPictographAnimator(this, iTextMesh);
+    // Ugly missing CCoeControl workaround, but CAknPictographInterface does not seem to use CCoeControl.
+    CCoeControl* dummy = NULL;    
+    iPictographInterface = CAknPictographInterface::NewL( *dummy, *iPictographAnimator ); // Returns NULL if not supported.
+    if (iPictographInterface)
+        {
+        iTextMesh->InitPictographsL(iPictographInterface);    
+        }
+    }
+
+
+CHuiTextVisual::~CHuiTextVisual()
+    {
+    delete iText;
+    delete iTextMesh;
+    delete iPictographAnimator;    
+    delete iPictographInterface;
+    }
+
+
+EXPORT_C void CHuiTextVisual::SetStyle(THuiPreconfiguredTextStyle aStyle, THuiBackgroundType aBackgroundType)
+    {
+    SetTextStyle(aStyle);
+    iStyle = aStyle;
+    THuiTextStyle* textStyle = Env().TextStyleManager().TextStyle(aStyle);
+    
+    if( aBackgroundType == EHuiBackgroundTypeLight)
+        {
+        textStyle->SetTextColor(KRgbBlack);
+        }
+    else
+        {
+        textStyle->SetTextColor(KRgbWhite);
+        }
+    iBackgroundType = aBackgroundType;
+    }
+
+
+EXPORT_C THuiPreconfiguredTextStyle CHuiTextVisual::Style() const
+    {
+    return iStyle;
+    }
+
+
+EXPORT_C void CHuiTextVisual::SetMaxLineCount(TInt aMaxLineCount)
+    {
+    if(iTextMesh->SetMaxLineCount(aMaxLineCount))
+        {
+        iMeshUpdated = EFalse;
+        iExtentsUpdated = EFalse;        
+        SetChanged();
+        }
+    }
+
+
+EXPORT_C TInt CHuiTextVisual::MaxLineCount() const
+    {
+    return iTextMesh->MaxLineCount();
+    }
+
+
+EXPORT_C CHuiTextVisual::TLineWrap CHuiTextVisual::Wrapping() const
+    {
+    return iLineWrapping;
+    }
+
+
+EXPORT_C void CHuiTextVisual::SetWrapping(TLineWrap aWrap)
+    {
+    iLineWrapping = aWrap;
+    switch(iLineWrapping)
+        {
+        case ELineWrapManual:
+        case ELineWrapTruncate:
+            iTextMesh->SetLineMode(CHuiTextMesh::ELineModeTruncate);
+            break;
+
+        case ELineWrapBreak:
+            iTextMesh->SetLineMode(CHuiTextMesh::ELineModeWrap);
+            break;
+        }
+    SetChanged();
+    }
+
+
+EXPORT_C THuiBackgroundType CHuiTextVisual::BackgroundType() const
+    {
+    return iBackgroundType;
+    }
+
+
+EXPORT_C void CHuiTextVisual::SetTextL(const TDesC& aText)
+    {
+    delete iText; iText = 0;
+    iText = aText.AllocL();
+
+    iMeshUpdated = EFalse;
+    iExtentsUpdated = EFalse;    
+    SetChanged();
+    }
+
+    
+EXPORT_C const TDesC& CHuiTextVisual::Text() const
+    {
+    if(iText)
+        {
+        return *iText;
+        }
+    _LIT(KNoText, "");
+    return KNoText;
+    }
+
+
+EXPORT_C void CHuiTextVisual::SetAlign(THuiAlignHorizontal aAlignHorizontal,
+                                       THuiAlignVertical aAlignVertical)
+    {
+    iAlignHorizontal = aAlignHorizontal;
+    iAlignVertical = aAlignVertical;
+
+    SetChanged();
+    }
+
+
+EXPORT_C void CHuiTextVisual::SetLineSpacing(TInt aLineSpacing, TLineSpacingUnits aUnits)
+    {
+    TInt lineSpacingInPixels = 0;
+    
+    if(aUnits == ETwips)
+        {
+        CWsScreenDevice* screenDev = CHuiStatic::ScreenDevice();
+        lineSpacingInPixels = screenDev->VerticalTwipsToPixels(aLineSpacing);
+        }
+    else
+        {
+        lineSpacingInPixels = aLineSpacing;  
+        }
+        
+    iTextMesh->SetLineSpacing(lineSpacingInPixels);     
+    }
+
+
+EXPORT_C TSize CHuiTextVisual::TextExtents() const
+    {
+    if(!iText)
+        {
+        return TSize(0, 0);
+        }
+
+	if (!iExtentsUpdated)
+		{
+		TRAPD(err, iTextMesh->SetTextL(*iText, EFalse));
+		if (err != KErrNone) 
+			{
+			HUI_DEBUG1(_L("CHuiTextVisual::TextExtents() - ERROR! Failed to update mesh with leave errorcode %i. Text extents are not currently available. "), err);
+			iExtentsUpdated = EFalse; // we have to retry soon..
+            return TSize(0, 0);
+			}
+			
+	    iExtentsUpdated = ETrue;
+		}
+	
+    return iTextMesh->Extents();
+    }
+
+EXPORT_C TRect CHuiTextVisual::SubstringExtents(TUint aStart, TUint aEnd) const
+    {
+    if(!iText)
+        {
+        return TRect(0, 0, 0, 0);
+        }
+
+    // Retrieve the text style used when rasterizing this text.
+    THuiTextStyle* textStyle = CHuiStatic::Env().TextStyleManager().TextStyle(iTextMesh->TextStyle());
+    
+    TSize begin(0,0); 
+    TSize end(0,0);
+    TRAP_IGNORE( 
+        {
+        begin = textStyle->LineExtentsL(iText->Mid(0, aStart));
+        end = textStyle->LineExtentsL(iText->Mid(0, aEnd));
+        })
+
+    return TRect(begin.iWidth, 0, end.iWidth, end.iHeight);
+    }
+
+const TUint8 color_s_to_lin[256] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+   0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+   0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
+   0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04,
+   0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
+   0x05, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07,
+   0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x0a,
+   0x0a, 0x0a, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0d,
+   0x0d, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x10, 0x10,
+   0x11, 0x11, 0x12, 0x12, 0x12, 0x13, 0x13, 0x14,
+   0x15, 0x15, 0x16, 0x16, 0x17, 0x17, 0x18, 0x18,
+   0x19, 0x1a, 0x1a, 0x1b, 0x1b, 0x1c, 0x1d, 0x1d,
+   0x1e, 0x1f, 0x1f, 0x20, 0x21, 0x21, 0x22, 0x23,
+   0x23, 0x24, 0x25, 0x26, 0x26, 0x27, 0x28, 0x29,
+   0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2d, 0x2e, 0x2f,
+   0x30, 0x31, 0x32, 0x33, 0x33, 0x34, 0x35, 0x36,
+   0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e,
+   0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46,
+   0x47, 0x48, 0x49, 0x4a, 0x4c, 0x4d, 0x4e, 0x4f,
+   0x50, 0x51, 0x52, 0x54, 0x55, 0x56, 0x57, 0x58,
+   0x5a, 0x5b, 0x5c, 0x5d, 0x5f, 0x60, 0x61, 0x63,
+   0x64, 0x65, 0x67, 0x68, 0x69, 0x6b, 0x6c, 0x6d,
+   0x6f, 0x70, 0x72, 0x73, 0x74, 0x76, 0x77, 0x79,
+   0x7a, 0x7c, 0x7d, 0x7f, 0x80, 0x82, 0x83, 0x85,
+   0x86, 0x88, 0x8a, 0x8b, 0x8d, 0x8e, 0x90, 0x92,
+   0x93, 0x95, 0x97, 0x98, 0x9a, 0x9c, 0x9d, 0x9f,
+   0xa1, 0xa3, 0xa4, 0xa6, 0xa8, 0xaa, 0xac, 0xad,
+   0xaf, 0xb1, 0xb3, 0xb5, 0xb7, 0xb8, 0xba, 0xbc,
+   0xbe, 0xc0, 0xc2, 0xc4, 0xc6, 0xc8, 0xca, 0xcc,
+   0xce, 0xd0, 0xd2, 0xd4, 0xd6, 0xd8, 0xda, 0xdc,
+   0xde, 0xe0, 0xe2, 0xe5, 0xe7, 0xe9, 0xeb, 0xed,
+   0xef, 0xf2, 0xf4, 0xf6, 0xf8, 0xfa, 0xfd, 0xff };
+
+inline TRgb ConvertToLinear(TRgb aColor)
+    {
+    // perform sRGB->linear color conversion if the renderer is
+    // openvg
+    // NOTE: For emulator depending on the OpenVG SW version mapping may
+    // be needed or not. Use/unuse ifdefs below if text colors are too dark/light.
+//#ifndef __WINSCW__
+//    if (CHuiStatic::Env().Renderer() == EHuiRendererVg10)
+        {
+        TUint32 color = aColor.Internal();
+        return
+            ((TUint32)color_s_to_lin[(color >> 0) & 0xff] << 16) |
+            ((TUint32)color_s_to_lin[(color >> 8) & 0xff] << 8) |
+            ((TUint32)color_s_to_lin[(color >> 16) & 0xff] << 0) |
+            (color & 0xff000000);
+        }
+//#endif    
+    return aColor;
+    }
+
+    
+EXPORT_C void CHuiTextVisual::SetColor(const TRgb& aColor)
+    {
+	iFontColor = ConvertToLinear(aColor);
+    iFontColorId = KAknsIIDNone;
+    iFontColorIndex = -1;
+    iFontColorValid = ETrue;
+    SetChanged();
+    }
+    
+    
+EXPORT_C void CHuiTextVisual::SetColor(const TAknsItemID& aID,const TInt aIndex)
+    {
+    iFontColorId = aID;
+    iFontColorIndex = aIndex;
+    iFontColorValid = EFalse;
+    SetChanged();
+    }
+    
+
+EXPORT_C void CHuiTextVisual::EnableShadow(TBool aDoEnable)
+    {
+    TRAP_IGNORE( EnableDropShadowL(aDoEnable) );
+    }
+    
+
+TBool CHuiTextVisual::PrepareDrawL()
+	{
+    if (Flags() & EHuiVisualFlagDrawOnlyAsExternalContent)
+    	{
+   	    // This is used only as external content visual. Return now if we are not currently drawing
+   	    // external content.
+    	if (!Display() || !Display()->RosterImpl().IsDrawingExternalContent())
+    		{
+			return ETrue;
+    		}
+    	}
+
+    if(!iText)
+        {
+        return ETrue;
+        }   
+
+    TReal32 effectiveOpacity = EffectiveOpacity();
+    if(effectiveOpacity <= 0)
+        {
+        return ETrue;
+        }
+        
+    if ( DropShadowHandler() )
+        {
+        if ( DropShadowHandler()->iRadius.Changed() )
+            {
+            iMeshUpdated = EFalse;
+            }
+        }
+
+    iTextMesh->EnableRasterizedShadow(TBool(DropShadowHandler()));
+
+    // use directly target rect and thus rasterize the text only once
+    // and not for each frame when the visual's size is changing
+    THuiRealRect content = DisplayRectTarget();
+    content.Shrink(PaddingInPixels());
+    
+    // In wrapping mode, let the mesh know how much space there is
+    // for drawing into.
+    TInt maxWidth = KMaxTInt;
+    if(iLineWrapping != ELineWrapManual)
+        {
+        maxWidth = TInt(content.Width()+0.5f);
+        }
+
+    // Update the text mesh, if needed. Set max line width first to avoid
+    // rendering with wrong max line width.
+    if(iTextMesh->SetMaxLineWidth(maxWidth) || !iMeshUpdated) 
+        {
+        UpdateMeshL();
+        }
+        
+    if (effectiveOpacity > 0 && 
+        iPictographInterface &&
+        iPictographAnimator && 
+        !iPictographAnimator->IsAnimating())
+        {
+        iPictographAnimator->DrawPictographArea(); // restarts animation timer if needed    
+        }
+        
+	return ETrue;
+	}
+
+
+void CHuiTextVisual::DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect) const
+    {
+    if(!iText)
+        {
+        return;
+        }
+
+    TReal32 effectiveOpacity = EffectiveOpacity();
+    if(effectiveOpacity <= 0)
+        {
+        return;
+        }        
+    aGc.Enable(CHuiGc::EFeatureBlending);
+    aGc.SetAlign(iAlignHorizontal, iAlignVertical);
+    aGc.SetPenAlpha(TInt(effectiveOpacity * 255));
+    
+    // Set up the text color. Priority order is: explicit color set, then by skin ID, then by Hui Style
+    TBool setDefaultColor = ETrue;
+    if ( iFontColorValid )
+        {
+        setDefaultColor = EFalse;
+        aGc.SetPenColor(iFontColor);
+        }
+    else if (iFontColorId != KAknsIIDNone)
+        {
+        TRgb color = KRgbGreen;
+        setDefaultColor = ( CHuiStatic::GetCachedColor(
+                  color, iFontColorId, iFontColorIndex )
+                                != KErrNone );
+        if ( !setDefaultColor )
+            {
+            aGc.SetPenColor(color);
+            }
+        }
+    else
+        {
+        // setDefaultColor equals to ETrue and so it's ok.
+        }
+
+    if ( setDefaultColor )
+        {
+        // Default is to use the color indicated by style
+        aGc.SetPenColor(Skin().StyleTextColor(iStyle, iBackgroundType));
+        }    
+
+    HUI_DEBUGF3(_L("CHuiTextVisual::DrawSelf() -- iStyle=%i, iBackgroundType=%i, lightness=%f"),
+                iStyle, iBackgroundType, HuiUtil::ColorLightness(aGc.PenColor()));
+
+    THuiRealRect content = aDisplayRect;
+    content.Shrink(PaddingInPixels());
+    content.iTl += LocalPointInPixels(iOffset.Now());
+
+    if ( DropShadowHandler() )
+        {
+        aGc.DrawText(*iTextMesh, content, DropShadowHandler()->iOpacity.Now());
+        }
+    else
+        {
+        aGc.DrawText(*iTextMesh, content, 0.f);
+        }
+
+
+	if(iHighlightEnd - iHighlightStart)
+		{
+		TPoint textPos(content.iTl.iX, content.iTl.iY);
+	        
+	     TSize textBounds = TextExtents();
+	        
+	   	switch(iAlignHorizontal)
+	        {
+	        case EHuiAlignHRight:
+	            textPos.iX = content.iBr.iX - textBounds.iWidth;
+	            break;
+    
+            case EHuiAlignHCenter:
+	            textPos.iX = content.Center().iX - textBounds.iWidth / 2; // or 2.f?
+	            break;
+    
+            default:
+	            break;
+	   	    }
+	        
+	   	switch(iAlignVertical)
+	       	{
+	        case EHuiAlignVBottom:
+	            textPos.iY = content.iBr.iY - textBounds.iHeight;
+	            break;
+    
+            case EHuiAlignVCenter:
+	            textPos.iY = content.Center().iY - textBounds.iHeight / 2; // or 2.f?
+	            break;
+    
+            default:
+	            break;
+	       	}
+	    
+		THuiRealRect textRect(textPos, textBounds);
+
+		// hackish, for now
+		TBool conversionRequired = ETrue;
+		if (iHighlightStart > iText->Length() || iHighlightEnd > iText->Length() )
+		    {
+		    conversionRequired = ETrue;
+		    }
+		
+        const TBidiText::TDirectionality bidiDirection = TBidiText::TextDirectionality( *iText);
+        if ( bidiDirection == TBidiText::ERightToLeft )	        
+			{
+			textRect.iBr.iX -= conversionRequired?SubstringExtents(0, iHighlightStart).Width():iHighlightStart;	    
+		    textRect.iTl.iX = textRect.iBr.iX - conversionRequired?SubstringExtents(iHighlightStart,iHighlightEnd).Width():iHighlightEnd;
+			}
+		else
+			{
+			textRect.iTl.iX += conversionRequired?SubstringExtents(0, iHighlightStart).Width():iHighlightStart;	    
+		   	textRect.iBr.iX = textRect.iTl.iX + conversionRequired?SubstringExtents(iHighlightStart,iHighlightEnd).Width():iHighlightEnd;
+			}
+        
+	    aGc.SetPenColor(iHighlightColor);
+	    aGc.DrawRect(textRect);
+	    aGc.SetPenColor(iHighlightTextColor);
+
+		THuiTextStyle* textStyle = CHuiStatic::Env().TextStyleManager().TextStyle(iTextMesh->TextStyle());
+		
+		textRect.Move(- textPos.iX, - textPos.iY);
+		
+		textStyle->EnableClipping(textRect);
+		
+		TRAPD(error,UpdateMeshL());  
+				
+		if ( DropShadowHandler() )
+        	{
+        	aGc.DrawText(*iTextMesh, content, DropShadowHandler()->iOpacity.Now());
+        	}
+    	else
+        	{
+	    	aGc.DrawText(*iTextMesh, content, 0.f);
+        	}
+
+		textStyle->DisableClipping();
+	
+		TRAP(error,UpdateMeshL());  
+		
+	    }
+
+    }
+
+
+TBool CHuiTextVisual::Changed() const
+    {
+    if(CHuiVisual::Changed())
+        {
+        return ETrue;
+        }
+    return (iOffset.Changed() );
+    }
+
+
+void CHuiTextVisual::ClearChanged()
+    {
+    CHuiVisual::ClearChanged();
+    iOffset.ClearChanged();
+    }
+
+
+void CHuiTextVisual::UpdateMeshL() const
+    {
+    iTextMesh->Reset();
+    iTextMesh->SetTextL(*iText, ETrue);
+    iMeshUpdated = ETrue;
+    iExtentsUpdated = ETrue;    
+    }
+
+
+void CHuiTextVisual::NotifySkinChangedL()
+    {
+    iMeshUpdated = EFalse;
+    iExtentsUpdated = EFalse;    
+    SetChanged();
+    }
+
+
+void CHuiTextVisual::ExpandRectWithContent(TRect& aRect) const
+    {   
+    if(!Clipping() && iText && iText->Length() )
+        {
+        TSize extents = TextExtents();
+        TPoint tl = aRect.Center();
+        
+        // check top left X
+        THuiAlignHorizontal usedHorizontalAlign = iAlignHorizontal;
+        switch(iAlignHorizontal)
+            {
+            case EHuiAlignHLocale:
+                if(CHuiStatic::LayoutMirrored())
+                    {
+                    usedHorizontalAlign = EHuiAlignHRight;
+                    }
+                else
+                    {
+                    usedHorizontalAlign = EHuiAlignHLeft;
+                    }
+                break;
+
+            case EHuiAlignHLocaleMirrored:
+                if(CHuiStatic::LayoutMirrored())
+                    {
+                    usedHorizontalAlign = EHuiAlignHLeft;
+                    }
+                else
+                    {
+                    usedHorizontalAlign = EHuiAlignHRight;
+                    }
+                break;
+            case EHuiAlignHBidirectionalText:
+                {
+                TBool bidiInformationFound = EFalse;
+                const TBidiText::TDirectionality bidiDirection = TBidiText::TextDirectionality( *iText, &bidiInformationFound );
+                if ( bidiInformationFound )
+                    {
+                    if ( bidiDirection == TBidiText::ELeftToRight )
+                        {
+                        usedHorizontalAlign = EHuiAlignHLeft;
+                        }
+                    else // ERightToLeft
+                        {
+                        usedHorizontalAlign = EHuiAlignHRight;
+                        }
+                    }
+                else // fall back... use locale
+                    {
+                    if(CHuiStatic::LayoutMirrored())
+                        {
+                        usedHorizontalAlign = EHuiAlignHRight;
+                        }
+                    else
+                        {
+                        usedHorizontalAlign = EHuiAlignHLeft;
+                        }
+                    }
+                }
+                break;
+            case EHuiAlignHBidirectionalTextMirrored:
+                {
+                TBool bidiInformationFound = EFalse;
+                const TBidiText::TDirectionality bidiDirection = TBidiText::TextDirectionality( *iText, &bidiInformationFound );
+                if ( bidiInformationFound )
+                    {
+                    if ( bidiDirection == TBidiText::ELeftToRight )
+                        {
+                        usedHorizontalAlign = EHuiAlignHRight;
+                        }
+                    else // ERightToLeft
+                        {
+                        usedHorizontalAlign = EHuiAlignHLeft;
+                        }
+                    }
+                else // fall back... use locale mirrored
+                    {
+                    if(CHuiStatic::LayoutMirrored())
+                        {
+                        usedHorizontalAlign = EHuiAlignHLeft;
+                        }
+                    else
+                        {
+                        usedHorizontalAlign = EHuiAlignHRight;
+                        }
+                    }
+                }
+                break;
+            default:
+                break;
+            }
+        
+        switch( usedHorizontalAlign )
+            {
+            case EHuiAlignHLeft:
+                tl.iX = aRect.iTl.iX;
+                break;
+            case EHuiAlignHCenter:
+                tl.iX -= extents.iWidth/2;
+                break;
+            case EHuiAlignHRight:
+                tl.iX = aRect.iBr.iX - extents.iWidth;
+                break;
+            default:
+                break;
+            }
+            
+        // check top left Y
+        switch( iAlignVertical )
+            {
+            case EHuiAlignVTop:
+                tl.iY = aRect.iTl.iY;
+                break;
+            case EHuiAlignVCenter:
+                tl.iY -= extents.iHeight/2;
+                break;
+            case EHuiAlignVBottom:
+                tl.iY = aRect.iBr.iY - extents.iHeight;
+                break;
+            default:
+                break;
+            }
+        
+        TRect textExtendsRect(tl, extents);
+        textExtendsRect.Grow(1,1); // fix rounding errors from Center() and /2 functions.
+
+        textExtendsRect.Move(TPoint(LocalPointInPixels(iOffset.Now()))); 
+                
+        aRect.BoundingRect(textExtendsRect);
+       
+        
+        // add shadow
+        CHuiDropShadow* shadowHandler = DropShadowHandler();
+        if ( shadowHandler &&
+             !HuiUtil::RealCompare( shadowHandler->iScale.Now(), 0.f ) &&
+             !HuiUtil::RealCompare( shadowHandler->iOpacity.Now(), 0.f ) )
+            {
+            iTextMesh->ExpandRectWithShadow( aRect );
+            }
+        }
+
+    CHuiVisual::ExpandRectWithContent(aRect);
+    }
+    
+
+EXPORT_C void CHuiTextVisual::SetTextStyle(TInt aTextStyleId)
+    {
+    iTextMesh->SetTextStyle(aTextStyleId);
+    
+    iMeshUpdated = EFalse;
+    iExtentsUpdated = EFalse;
+    iStyle = STATIC_CAST(THuiPreconfiguredTextStyle, aTextStyleId);
+    SetChanged();
+    }
+
+EXPORT_C TInt CHuiTextVisual::TextStyle() const
+    {
+    return iStyle;   
+    }
+
+
+EXPORT_C void CHuiTextVisual::SetHighlightRange(TInt aStart, TInt aEnd, TRgb& aHighlightColor, TRgb& aHighlightTextColor)
+	{
+	/*
+	if((aStart < 0) || (aStart > iText->Length()) || (aEnd < 0))
+		return;
+	
+	if(aStart >= aEnd)
+		return;
+	
+	if(aEnd > iText->Length())
+		aEnd = iText->Length();
+	*/
+    iHighlightStart = aStart;
+    iHighlightEnd = aEnd;
+      
+    iHighlightColor = aHighlightColor;
+    iHighlightTextColor = aHighlightTextColor;
+    
+    SetChanged();
+	}
+
+EXPORT_C void CHuiTextVisual::UpdateMeshL(const TDesC8& aBuffer)
+    {
+    iTextMesh->UpdateMeshL(aBuffer);
+    if (!iText)
+        {
+        SetTextL(KNullDesC);
+        }
+
+    SetChanged();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiTexture.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,831 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiTexture.
+*
+*/
+
+
+
+#include "uiacceltk/HuiTexture.h"  // Class definition
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiPanic.h"
+#include "HuiRenderSurface.h"
+#include "uiacceltk/HuiProbe.h"
+
+#include "uiacceltk/HuiTextureProcessor.h"
+
+#include <e32math.h>
+
+const TInt KHuiTextureDefaultPriority = 1; // currenly just != 0
+
+
+// placeholder
+EXPORT_C MHuiTexture::~MHuiTexture()
+    {
+    }
+
+EXPORT_C CHuiTexture* CHuiTexture::NewL(const THuiTextureHandle* aExistingTexture)
+    {
+    return CHuiStatic::Renderer().CreateTextureL(aExistingTexture);
+    }
+
+
+EXPORT_C CHuiTexture* CHuiTexture::NewLC(const THuiTextureHandle* aExistingTexture)
+    {
+    CHuiTexture* self = CHuiTexture::NewL(aExistingTexture);
+    CleanupStack::PushL(self);
+    return self;
+    }
+
+
+EXPORT_C CHuiTexture::CHuiTexture()
+    {
+    HUI_PROBE_ASSOCIATE_WITH_CURRENT_SESSION
+    HUI_PROBE_REPORT_CONSTRUCTED
+    }
+
+
+EXPORT_C void CHuiTexture::BaseConstructL()
+    {
+    // No name by default.
+    SetImageFileNameL(_L(""));
+
+    HUI_DEBUG(_L("CHuiTexture::BaseConstructL() - Auto-appending to texture manager."));
+
+    // Make the texture automatically owned by the texture manager.
+    CHuiStatic::Env().TextureManager().AppendTextureL(this);
+    iInternalState |= EHuiTextureFlagAddedToTManager;
+    
+    iPriority  = KHuiTextureDefaultPriority;
+    }
+
+
+EXPORT_C CHuiTexture::~CHuiTexture()
+    {
+    iContentObservers.Close();
+
+    HUI_DEBUG(_L("CHuiTexture::~CHuiTexture() - Auto-removing from texture manager."));
+
+    // Remove the texture automatically from the texture manager.
+    if (iInternalState & EHuiTextureFlagAddedToTManager)
+        {
+        CHuiStatic::Env().TextureManager().RemoveTexture(*this);
+        }
+
+    // NOTE: Do NOT call Reset, or SegSegmentCount(0) from
+    // here since they have pure virtual method calls,
+    // which won't work anymore :(
+    iSegments.Close();
+    delete iImageFileName;
+    iImageFileName = NULL;
+    iPlaceholder = NULL;
+    iPreferredSizes.Close();
+    
+    // delete all created shadows
+    ResetShadows();
+    iShadows.Close();
+    
+    HUI_PROBE_REPORT_DESTRUCTED
+    }
+
+
+EXPORT_C MHuiSegmentedTexture* CHuiTexture::SegmentedTexture()
+    {
+    return this;
+    }
+
+
+EXPORT_C MHuiShadowedTexture* CHuiTexture::ShadowedTexture()
+    {
+    return this;
+    }
+
+
+EXPORT_C const MHuiSegmentedTexture* CHuiTexture::SegmentedTexture() const
+    {
+    return this;
+    }
+
+
+EXPORT_C const MHuiShadowedTexture* CHuiTexture::ShadowedTexture() const
+    {
+    return this;
+    }
+
+
+TBool CHuiTexture::GetShadowTexture(
+        THuiTextureHandle& aHandle, 
+        TInt aBlurDimension ) const
+    {
+    for ( TInt i = 0 ; i < iShadows.Count() ; i++ )
+        {
+        if ( iShadows[i].iBlurDimension == aBlurDimension )
+            {
+            aHandle = iShadows[i].iShadowTexture->Handle();
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+        
+void CHuiTexture::CreateShadowTextureL(
+        TInt aBlurDimension,
+        THuiShadowStyle aStyle )
+    {
+    // check if the shadow already exists
+        {
+        THuiTextureHandle dummy;
+        if ( GetShadowTexture( dummy, aBlurDimension ) )
+            {
+            return;
+            }   
+        }
+    
+    // shadow not found -> generate one.
+    CHuiTexture* newShadowTexture = CHuiTexture::NewL();
+    CHuiStatic::Env().TextureManager().RemoveTexture(*newShadowTexture);
+    newShadowTexture->iInternalState &= ~EHuiTextureFlagAddedToTManager;
+    CleanupStack::PushL( newShadowTexture );
+    newShadowTexture->SetSegmentCountL(1);
+    
+    // blur
+    CHuiTextureProcessor& proc = CHuiStatic::Env().TextureManager().Processor();
+
+    THuiTextureHandle shadowHandle = newShadowTexture->Handle();
+    switch(aStyle)
+        {
+        case EHuiTextureShadowStyleIcon:
+            proc.BlurSegmentedL(*this, shadowHandle, TSize(Size().iWidth/2, Size().iHeight/2), aBlurDimension,
+                CHuiTextureProcessor::EBlurFlagWhite |
+                CHuiTextureProcessor::EBlurFlagAlpha |
+                CHuiTextureProcessor::EBlurFlagExpandEdges);
+            break;
+
+        case EHuiTextureShadowStyleRasterizedText:
+            proc.BlurSegmentedL(*this, shadowHandle, TSize(Size().iWidth/*/2*/, Size().iHeight/*/2*/), aBlurDimension,
+                CHuiTextureProcessor::EBlurFlagWhite |
+                CHuiTextureProcessor::EBlurFlagAlpha |
+                CHuiTextureProcessor::EBlurFlagExpandEdges);
+            break;
+
+        default:
+            break;
+        }   
+        
+    newShadowTexture->SetSegmentSize(0,shadowHandle.iSize );
+    newShadowTexture->SetSegmentTextureSize(0,shadowHandle.iTextureSize );    
+    
+    // create item on the array
+    TShadowData newData;
+    newData.iShadowTexture = newShadowTexture;
+    newData.iBlurDimension = aBlurDimension;
+    
+    iShadows.AppendL( newData );
+    CleanupStack::Pop( newShadowTexture );
+    }
+    
+
+EXPORT_C void CHuiTexture::EnableShadow(TBool aEnable)
+    {
+    if(aEnable)
+    	{
+    	iInternalState |= EHuiTextureFlagShadowEnabled;
+    	}
+    else
+    	{
+    	iInternalState &= ~EHuiTextureFlagShadowEnabled;
+    	
+    	// delete all created shadows
+    	ResetShadows();
+    	}
+    }
+
+
+EXPORT_C TBool CHuiTexture::IsShadowEnabled() const
+    {
+    return ((iInternalState & EHuiTextureFlagShadowEnabled) != 0);
+    }
+
+
+EXPORT_C void CHuiTexture::SetShadowStyle(THuiShadowStyle aShadowStyle)
+    {
+    iShadowStyle = aShadowStyle;
+    }
+
+
+EXPORT_C THuiShadowStyle CHuiTexture::ShadowStyle() const
+    {
+    return iShadowStyle;
+    }
+    
+EXPORT_C TBool CHuiTexture::GetShadowTexture(THuiTextureHandle& aHandle) const
+    {
+    // Return the first shadow if generated
+    if ( iShadows.Count() )
+        {
+        aHandle = iShadows[0].iShadowTexture->Handle();
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+
+EXPORT_C void CHuiTexture::SetSegmentCountL(TInt aSegmentCount)
+    {
+    // delete old segments (if needed)
+    TInt count = iSegments.Count();
+    while(count > aSegmentCount)
+        {
+        count--;
+        HUI_DEBUG1(_L("CHuiTexture::SetSegmentCount - Deallocating segment %i"), count);
+        // Deallocate resources associated with segment
+        // NOTE: call to pure virtual method, will not work from the
+        // destructor of this class..
+        ResetSegment(count);
+        iSegments.Remove(count);
+        }
+
+    // add new texture segments (if needed)
+    while(count < aSegmentCount)
+        {
+        TSegment seg;
+        User::LeaveIfError(iSegments.Append(seg));
+        HUI_DEBUG1(_L("CHuiTexture::SetSegmentCount - Creating segment %i"), count);
+        // Create initial segment with texture name etc.
+        InitSegmentL(count);
+        count++;
+        }
+
+    }
+
+
+EXPORT_C TSize CHuiTexture::Size() const
+    {
+    if(iPlaceholder)
+        {
+        return iPlaceholder->Size();
+        }
+    return iSize;
+    }
+
+
+EXPORT_C TInt CHuiTexture::SegmentCount() const
+    {
+    if(iPlaceholder)
+        {
+        return iPlaceholder->SegmentCount();
+        }
+    return iSegments.Count();
+    }
+
+
+EXPORT_C TUint CHuiTexture::SegmentName(TInt aSegment) const
+    {
+    ASSERT(aSegment < SegmentCount());
+    if(iPlaceholder)
+        {
+        return iPlaceholder->SegmentName(aSegment);
+        }
+
+    return iSegments[aSegment].iName;
+    }
+
+
+EXPORT_C TSize CHuiTexture::SegmentSize(TInt aSegment) const
+    {
+    ASSERT(aSegment < SegmentCount());
+    if(iPlaceholder)
+        {
+        return iPlaceholder->SegmentSize(aSegment);
+        }
+
+    return iSegments[aSegment].iSize;
+    }
+
+
+EXPORT_C TSize CHuiTexture::SegmentTextureSize(TInt aSegment) const
+    {
+    ASSERT(aSegment < SegmentCount());
+    if(iPlaceholder)
+        {
+        return iPlaceholder->SegmentTextureSize(aSegment);
+        }
+
+    return iSegments[aSegment].iTextureSize;
+    }
+
+
+EXPORT_C TPoint CHuiTexture::SegmentOffset(TInt aSegment) const
+    {
+    ASSERT(aSegment < SegmentCount());
+    if(iPlaceholder)
+        {
+        return iPlaceholder->SegmentOffset(aSegment);
+        }
+
+    return iSegments[aSegment].iOffset;
+    }
+
+
+EXPORT_C void CHuiTexture::SetSize(const TSize& aSize)
+    {
+    // if there are multiple
+    // segments already defined we have to recalculate (rescale)
+    // the logical sizes and offsets for the individual segments
+    // to match the new logical size
+    if (SegmentCount()>0 && iSize.iWidth > 0 && iSize.iHeight > 0)
+        {
+        for (TInt s = 0; s < SegmentCount(); s++)
+            {
+            TSize oldSize(SegmentSize(s));
+            TSize newSize(oldSize.iWidth * aSize.iWidth / iSize.iWidth,
+                          oldSize.iHeight * aSize.iHeight / iSize.iHeight);
+            TPoint oldOffset(SegmentOffset(s));
+            TPoint newOffset(oldOffset.iX * aSize.iWidth / iSize.iWidth,
+                             oldOffset.iY * aSize.iHeight / iSize.iHeight);
+            SetSegmentSize(s, newSize);
+            SetSegmentOffset(s, newOffset);
+            }
+        }
+
+    // assign new logical size
+    iSize = aSize;
+
+    }
+
+
+EXPORT_C void CHuiTexture::SetSegmentName(TInt aSegment, TUint aName)
+    {
+    ASSERT(aSegment < SegmentCount());
+    iSegments[aSegment].iName = aName;
+    }
+
+
+EXPORT_C void CHuiTexture::SetSegmentSize(TInt aSegment, const TSize& aSegmentSize)
+    {
+    ASSERT(aSegment < SegmentCount());
+    iSegments[aSegment].iSize = aSegmentSize;
+    }
+
+
+EXPORT_C void CHuiTexture::SetSegmentTextureSize(TInt aSegment, const TSize& aSegmentTextureSize)
+    {
+    ASSERT(aSegment < SegmentCount());
+    iSegments[aSegment].iTextureSize = aSegmentTextureSize;
+    }
+
+
+EXPORT_C void CHuiTexture::SetSegmentOffset(TInt aSegment, const TPoint& aOffset)
+    {
+    ASSERT(aSegment < SegmentCount());
+    iSegments[aSegment].iOffset = aOffset;
+    }
+
+
+EXPORT_C void CHuiTexture::SetSkinContent(TBool aSkinContent)
+    {
+    if(aSkinContent)
+    	{
+    	iInternalState |= EHuiTextureFlagSkinContent;
+    	}
+    else
+    	{
+    	iInternalState &= ~EHuiTextureFlagSkinContent;
+    	}    
+    
+    }
+    
+
+EXPORT_C TBool CHuiTexture::IsSkinContent() const
+    {
+    return ((iInternalState & EHuiTextureFlagSkinContent) != 0);    
+    }
+
+
+EXPORT_C void CHuiTexture::Reset()
+    {
+    EnableShadow(EFalse); // deletes the shadow textures
+    RemoveAllSegments();
+    iActiveSegment = 0;
+    iSize = TSize(0, 0);
+    iPlaceholder = NULL;
+    // We're not resetting the texture name here.
+    // this is intentional since the name may be
+    // used to restore the texture content later on
+    }
+
+EXPORT_C void CHuiTexture::ResetShadows()
+    {
+    while ( iShadows.Count() )
+        {
+        delete iShadows[iShadows.Count()-1].iShadowTexture;
+        iShadows.Remove( iShadows.Count()-1);
+        }
+    }
+
+
+EXPORT_C const TDesC& CHuiTexture::ImageFileName() const
+    {
+    return *iImageFileName;
+    }
+
+
+EXPORT_C TBool CHuiTexture::HasContent() const
+    {
+    return (SegmentCount() > 0);
+    }
+
+
+EXPORT_C TInt CHuiTexture::ClearL(const TSize& aSize, const TRgb& aColor)
+    {
+    // Always assign new logical size
+    SetSize(aSize);
+
+    // if there are no segments, configure them based on the given size!
+    ASSERT(SegmentCount() != 0 || (aSize.iWidth > 0 && aSize.iHeight > 0));
+    if(SegmentCount() == 0)
+        {
+        SetupSegmentsL(aSize, aSize);
+        }
+    // clear all segments..
+    for(TInt segment = 0; segment < SegmentCount(); ++segment)
+        {
+        TRAPD(err, SegmentClearL(segment, EFalse, aColor, 0) );
+        if(err == KErrNoMemory)
+            {
+            HUI_DEBUG2(_L("CHuiTexture::Clear() - Out of memory trying to clear segment %i from \"%S\"."),
+                       segment, &ImageFileName());
+            return err;
+            }
+        else if(err != KErrNone)
+            {
+            HUI_DEBUG1(_L("CHuiTexture::Clear() - SegmentClearL failed with error code %i."), err);
+            return err;
+            }
+        else
+            {
+            // for PC lint
+            }
+        }
+    // succeeded!
+    return KErrNone;
+    }
+
+
+EXPORT_C TInt CHuiTexture::ClearWithAlphaL(const TSize& aSize, const TRgb& aColor,
+        TUint8 aAlpha)
+    {
+    if(Size()==TSize(0,0))
+        {
+        SetSize(aSize);
+        }
+    // if there are no segments, configure them based on the given size!
+    ASSERT(SegmentCount() != 0 || (aSize.iWidth > 0 && aSize.iHeight > 0));
+    if(SegmentCount() == 0)
+        {
+        SetupSegmentsL(aSize, aSize);
+        }
+    // clear all segments..
+    for (TInt segment = 0; segment < SegmentCount(); ++segment)
+        {
+        TRAPD(err, SegmentClearL(segment, ETrue, aColor, aAlpha) );
+        if(err == KErrNoMemory)
+            {
+            HUI_DEBUG2(_L("CHuiTexture::ClearWithAlpha() - Out of memory trying to clear segment %i from \"%S\"."),
+                       segment, &ImageFileName());
+            return err;
+            }
+        else if(err != KErrNone)
+            {
+            HUI_DEBUG1(_L("CHuiTexture::ClearWithAlpha() - SegmentClearL failed with error code %i."), err);
+            return err;
+            }
+        else
+            {
+            // for PC lint
+            }
+        }
+    // succeeded!
+    return KErrNone;
+    }
+
+/**
+ * Set segment data.
+ */
+EXPORT_C void CHuiTexture::SetSegment(TInt aSegment,
+                             const TSize & aSize,
+                             const TPoint & aOffset,
+                             const TSize & aTextureSize)
+    {
+    SetSegmentSize(aSegment, aSize);
+    SetSegmentOffset(aSegment, aOffset);
+    SetSegmentTextureSize(aSegment, aTextureSize);
+
+    // Note: segment name is assigned by the GL specialization class during InitSegment()!
+    }
+
+void CHuiTexture::SetPlaceholder(THuiTextureHandle* aPlaceholder)
+    {
+    iPlaceholder = aPlaceholder;
+    }
+
+
+void CHuiTexture::GenerateBlobL(const TSize& aSize)
+    {
+    SetSize(aSize);
+    // calculate parameters for the segments..
+    SetupSegmentsL(aSize, aSize);
+
+    ASSERT(SegmentCount()==1);
+
+    TSize textureSize = SegmentTextureSize(0);
+    TUint8* buffer = new (ELeave) TUint8[
+                         textureSize.iWidth * textureSize.iHeight * 4];
+    CleanupStack::PushL( buffer );
+
+    /** @todo  This is too slow. Just load a pregenerated texture. */
+
+    TUint8* ptr = buffer;
+    for(TInt y = 0; y < textureSize.iHeight; y++)
+        {
+        for(TInt x = 0; x < textureSize.iWidth; x++, ptr += 4)
+            {
+            ptr[0] = ptr[1] = ptr[2] = 255;
+
+            TReal32 dx = TReal32(x) - textureSize.iWidth/2.f;
+            TReal32 dy = TReal32(y) - textureSize.iHeight/2.f;
+            TReal32 src = dx * dx + dy * dy;
+            TReal trg = 0;
+
+            if(dx != 0 || dy != 0)
+                {
+                Math::Sqrt(trg, src);
+                }
+
+            trg = trg / (textureSize.iWidth/2.0f);
+            if(trg < 0)
+                {
+                trg = 0;
+                }
+            if(trg > 1)
+                {
+                trg = 1;
+                }
+
+            ptr[3] = (TInt) ((1 - trg) * 255);
+            }
+        }
+
+    // Upload the solid color buffer.
+    SegmentUploadL(0, EHuiTextureFormatRgba8888, textureSize, buffer);
+
+    CleanupStack::PopAndDestroy( buffer );
+    }
+
+
+void CHuiTexture::SetImageFileNameL(const TDesC& aFileName)
+    {
+    delete iImageFileName;
+    iImageFileName = 0;
+    iImageFileName = aFileName.AllocL();
+    }
+
+    
+void CHuiTexture::UploadDirectL(const CFbsBitmap& aBitmap, const CFbsBitmap* aMaskBitmap, THuiTextureUploadFlags aFlags)
+	{
+	// Setup extension parameters
+	CHuiTexture::TExtParams_UploadDirectL params = {aBitmap, aMaskBitmap, aFlags, 0};
+    CHuiTexture::TExtParams_UploadDirectL* pparams = &params;
+    
+    // Call extension
+    TextureExtension(KHuiTextureExtUid_UploadDirectL, (TAny**)&pparams); // virtual, deriving classes define the actual implementation 
+    
+    // Handle return value
+    User::LeaveIfError(pparams->iLeaveCode);	
+	}
+    
+
+void CHuiTexture::RemoveAllSegments()
+    {
+    // delete segments
+    TInt count = iSegments.Count();
+    while(count)
+        {
+        count--;
+        HUI_DEBUG1(_L("CHuiTexture::RemoveAllSegments - Removing segment %i"), count);
+        // Deallocate resources associated with segment
+        // NOTE: call to pure virtual method, will not work from the
+        // destructor of this class..
+        ResetSegment(count);
+        iSegments.Remove(count);
+        }
+    }
+
+
+EXPORT_C TBool CHuiTexture::TextureChanged() const
+    {
+    return iTextureChanged;
+    }
+
+
+EXPORT_C void CHuiTexture::TextureClearChanged() const
+    {
+    iTextureChanged = EFalse;
+    }
+
+
+EXPORT_C void CHuiTexture::Release()
+    {
+    HUI_DEBUG2(_L("CHuiTexture::Release() - Resetting texture 0x%x (\"%S\")."),
+               this, &ImageFileName());
+
+    // Reset the content of the texture.
+    Reset();
+
+    // Notify observers.
+    for(TInt i = 0; i < iContentObservers.Count(); ++i)
+        {
+        iContentObservers[i].TextureContentReleased(*this);
+        }
+        
+    HUI_PROBE_REPORT_RELEASED
+    }
+
+
+EXPORT_C void CHuiTexture::RestoreL()
+    {
+    // Tell observers to restore the content of this texture.
+    if (iContentObservers.Count() > 0)
+        {
+        for(TInt i = 0; i < iContentObservers.Count(); ++i)
+            {
+            HUI_DEBUG4(_L("CHuiTexture::RestoreL() - Texture 0x%x requesting restore from content observer 0x%x (%i/%i)."),
+                       this, &(iContentObservers[i]), i+1, iContentObservers.Count());
+            iContentObservers[i].RestoreTextureContentL(*this);
+            }
+        HUI_DEBUG1(_L("CHuiTexture::RestoreL() - Texture 0x%x restored!"), this);
+        }
+    else
+        {
+        HUI_DEBUG1(_L("CHuiTexture::RestoreL() - WARNING! This Texture (0x%x) has no content observers. Unable to Restore at this point."), this);
+        }
+        
+    HUI_PROBE_REPORT_RESTORED
+    }
+    
+EXPORT_C void CHuiTexture::SetPriority( TInt aPriority )
+    {
+    iPriority = aPriority;
+    }
+    
+EXPORT_C TInt CHuiTexture::Priority() const
+    {
+    return iPriority;
+    }
+
+HUI_SESSION_OBJECT_IMPL_EXPORT(CHuiTexture, ETypeTexture)
+
+EXPORT_C void CHuiTexture::TextureExtension(const TUid& /*aExtensionUid*/, TAny** /*aExtensionParameters*/)
+    {
+    
+    }
+
+void CHuiTexture::NotifyPreferredSize(const THuiRealSize& aSize)
+    {
+    // Consider size to be (0,0) if either width or height is zero
+    // to avoid unnecessary change notifications. 
+    if (HuiUtil::RealCompare(aSize.iHeight,0,0.5) || HuiUtil::RealCompare(aSize.iWidth,0,0.5))
+        {
+        iPreferredSizes.Append(THuiRealSize(0,0));            
+        }
+    else
+        {
+        iPreferredSizes.Append(aSize);        
+        }    
+    }
+    
+void CHuiTexture::ResetAutoSizeCalculation()
+    {
+    iPreferredSizes.Reset();
+    iCalculatedPreviousAutoSize = iCalculatedAutoSize;
+    }
+
+TBool CHuiTexture::IsAutoSizeCalculationEnabled() const
+    {
+    return iAutoSizeCalculationEnabled;    
+    }
+
+EXPORT_C void CHuiTexture::EnableAutoSizeCalculation(TBool aEnable)
+    {
+    iAutoSizeCalculationEnabled = aEnable;    
+    
+    // Initialize everything
+    iPreferredSizes.Reset();
+    iCalculatedPreviousAutoSize = THuiRealSize(0,0);
+    iCalculatedAutoSize = THuiRealSize(0,0);
+    
+    // Make sure texturemanager is aware of me
+    if (aEnable)
+        {
+        CHuiStatic::Env().TextureManager().EnableAutoSizeCalculation(ETrue);        
+        }    
+    }
+
+TBool CHuiTexture::CalculatedAutoSizeChanged() const
+    {
+    if (!IsAutoSizeCalculationEnabled() || 
+        (HUI_ROUND_FLOAT_TO_INT(iCalculatedAutoSize.iWidth) == HUI_ROUND_FLOAT_TO_INT(iCalculatedPreviousAutoSize.iWidth) &&
+         HUI_ROUND_FLOAT_TO_INT(iCalculatedAutoSize.iHeight) == HUI_ROUND_FLOAT_TO_INT(iCalculatedPreviousAutoSize.iHeight)))
+        {
+        return EFalse;    
+        }
+    else
+        {
+        return ETrue;                    
+        }    
+    }
+
+THuiRealSize CHuiTexture::CalculateAutoSize()
+    {
+    // If only one size, retun it.
+    if (iPreferredSizes.Count() == 1)
+        {
+        iCalculatedAutoSize = iPreferredSizes[0];                
+        }
+    else
+        {
+        // If more sizes reported, then try to report largest one.
+        if (iPreferredSizes.Count())
+            {
+            iCalculatedAutoSize = iPreferredSizes[0];
+            TInt autoSizeArea = iCalculatedAutoSize.iWidth * iCalculatedAutoSize.iHeight;
+            for (TInt i=0; i<iPreferredSizes.Count();i++)
+                {
+                if ((iPreferredSizes[i].iWidth * iPreferredSizes[i].iHeight) > autoSizeArea)
+                    {
+                    iCalculatedAutoSize = iPreferredSizes[i];
+                    autoSizeArea = iPreferredSizes[i].iWidth * iPreferredSizes[i].iHeight;                        
+                    }                
+                }
+            }                            
+        }    
+            
+    return iCalculatedAutoSize;    
+    }
+
+
+EXPORT_C void CHuiTexture::SetAutoSizeParams(const THuiTextureAutoSizeParams& aParams)
+    {
+    iAutoSizeParams = aParams;
+    }
+    
+EXPORT_C THuiTextureAutoSizeParams CHuiTexture::AutoSizeParams() const
+    {
+    return iAutoSizeParams;        
+    }
+
+EXPORT_C void CHuiTexture::SetTextureChanged(TBool aChanged)
+    {
+    if (aChanged && !iTextureChanged)
+        {
+        CHuiEnv& env = CHuiStatic::Env();
+        env.TextureManager().SetHasChangedTextures();
+        env.ContinueRefresh();        
+        }
+    
+    iTextureChanged = aChanged;   
+    }
+
+EXPORT_C void CHuiTexture::SetNvgContent(TBool aNvgContent)
+    {
+    if(aNvgContent)
+        {
+        iInternalState |= EHuiTextureFlagNvgContent;
+        }
+    else
+        {
+        iInternalState &= ~EHuiTextureFlagNvgContent;
+        }
+    }
+
+EXPORT_C TBool CHuiTexture::IsNvgContent() const
+    {
+    return ((iInternalState & EHuiTextureFlagNvgContent) != 0);
+    }
+
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiTextureHandle.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,169 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of THuiTextureHandle. THuiTextureHandle is a 
+*                handle to a named texture object. It does not have ownership 
+*                of the texture object.
+*
+*/
+
+
+
+#include "uiacceltk/HuiTextureHandle.h"
+#include "uiacceltk/HuiStatic.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiUtil.h"
+
+
+EXPORT_C THuiTextureHandle::THuiTextureHandle()
+        : iName(0), iSize(0, 0), iTextureSize(0, 0)
+    {
+    }
+
+
+EXPORT_C THuiTextureHandle::THuiTextureHandle(TUint aName,
+        const TSize& aSize,
+        const TSize& aTextureSize)
+    {
+    Set(aName, aSize, aTextureSize);
+    }
+  
+  
+EXPORT_C TBool THuiTextureHandle::IsNull() const
+    {
+    return iName == 0;
+    }  
+  
+
+EXPORT_C TBool THuiTextureHandle::HasContent() const
+    {
+    return !IsNull();
+    }
+
+
+EXPORT_C void THuiTextureHandle::Release()
+    {
+    CHuiStatic::Renderer().DeleteNamedTexture(iName);
+    iName = 0;
+    iSize = iTextureSize = TSize(0, 0);
+    }
+
+
+EXPORT_C void THuiTextureHandle::Set(TUint aName,
+                                     const TSize& aSize,
+                                     const TSize& aTextureSize)
+    {
+    iName = aName;
+    iSize = aSize;
+    iTextureSize = aTextureSize;
+    }
+
+
+EXPORT_C void THuiTextureHandle::SetName(TUint aName)
+    {
+    iName = aName;
+    }
+
+
+EXPORT_C void THuiTextureHandle::SetSize(const TSize& aSize)
+    {
+    iSize = aSize;
+    }
+
+
+EXPORT_C void THuiTextureHandle::SetTextureSize(const TSize& aTextureSize)
+    {
+    iTextureSize = aTextureSize;
+    }
+
+
+EXPORT_C TInt THuiTextureHandle::SegmentCount() const
+    {
+    return 1;
+    }
+
+
+EXPORT_C TSize THuiTextureHandle::Size() const
+    {
+    return iSize;
+    }
+
+
+EXPORT_C TUint THuiTextureHandle::SegmentName(TInt /*aSegment*/) const
+    {
+    return iName;
+    }
+
+
+EXPORT_C TSize THuiTextureHandle::SegmentSize(TInt /*aSegment*/) const
+    {
+    return iSize;
+    }
+
+
+EXPORT_C TSize THuiTextureHandle::SegmentTextureSize(TInt /*aSegment*/) const
+    {
+    return iTextureSize;
+    }
+
+
+EXPORT_C TPoint THuiTextureHandle::SegmentOffset(TInt /*aSegment*/) const
+    {
+    return TPoint(0, 0);
+    }
+
+
+EXPORT_C MHuiSegmentedTexture* THuiTextureHandle::SegmentedTexture()
+    {
+    return this;
+    }
+    
+    
+EXPORT_C MHuiShadowedTexture* THuiTextureHandle::ShadowedTexture()
+    {
+    return NULL;
+    }
+
+
+EXPORT_C const MHuiSegmentedTexture* THuiTextureHandle::SegmentedTexture() const
+    {
+    return this;
+    }
+    
+    
+EXPORT_C const MHuiShadowedTexture* THuiTextureHandle::ShadowedTexture() const
+    {
+    return NULL;
+    }
+    
+
+EXPORT_C TUint THuiTextureHandle::Name() const
+    {
+    return iName;
+    }
+
+
+EXPORT_C TBool THuiTextureHandle::TextureChanged() const
+    {
+	return EFalse;
+    }
+
+
+EXPORT_C void THuiTextureHandle::TextureClearChanged() const
+    {
+	return;
+    }
+
+EXPORT_C void THuiTextureHandle::TextureExtension(const TUid& /*aExtensionUid*/, TAny** /*aExtensionParameters*/)
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiTextureManager.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,2505 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiTextureManager, texture objects loading 
+*                and management.
+*
+*/
+
+
+
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+
+#include "uiacceltk/HuiTextureManager.h"  // Class definition
+#include "uiacceltk/HuiTextureProcessor.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiTexture.h"
+#include "uiacceltk/HuiFont.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiDisplay.h"
+#include "huitextureanimationstate.h"
+
+/**
+ * Granularity of CHuiTextureManager::iAnimations and 
+ * CHuiTextureManager::iAnimatedTextureGroupItems arrays.
+ */
+const TInt KHuiAnimationsGranularity = 4;
+
+EXPORT_C MHuiBitmapProvider::~MHuiBitmapProvider()
+    {
+    }
+
+EXPORT_C CHuiTextureManager::CHuiTextureManager(CHuiEnv& aEnv)
+        : CActive(EPriorityHigh),
+        iEnv(aEnv), iState(EIdle), iReleaseState(ENormal), iFS(CHuiStatic::FsSession()),
+        iAnimatedTextureGroupItems( KHuiAnimationsGranularity ),
+        iAnimations( KHuiAnimationsGranularity ),
+        iEnableTexMemCalculation( EFalse )  //Texture memory calculation is disabled by default
+    {}
+
+
+EXPORT_C void CHuiTextureManager::BaseConstructL()
+    {
+    iEnv.SetTextureManager(*this);
+
+    SetImagePathL(_L(""));
+
+    // Create a small initial bitmaps for decoder output.
+    iBitmap = new (ELeave) CFbsBitmap();
+    User::LeaveIfError( iBitmap->Create(TSize(4, 4), EColor64K) );
+    iMaskBitmap = new (ELeave) CFbsBitmap();
+    User::LeaveIfError( iMaskBitmap->Create(TSize(4, 4), EGray256) );
+
+    // Create blank texture
+    iBlankTexture = CHuiStatic::Renderer().CreateTextureL();
+    iBlankTexture->SetImageFileNameL(_L("blank"));
+
+    CActiveScheduler::Add(this);
+    
+    // Enabling logging will cause diagnostics and debugging messages to be
+    // printed to a file.
+    CHuiStatic::EnableLogging(EFalse);
+    }
+
+
+EXPORT_C CHuiTextureManager::~CHuiTextureManager()
+    {
+    Cancel();
+
+    delete iAnimationWithoutGroup;
+    iAnimatedTextureGroupItems.Close();
+    iAnimations.ResetAndDestroy();
+    iAnimations.Close();
+
+    // Delete the texture processor.
+    delete iProcessor;
+
+    // Clear any remaining entries in the load queue.
+    for(TInt i = 0; i < iLoadQueue.Count(); ++i)
+        {
+        delete iLoadQueue[i].iDecoder;
+        iLoadQueue[i].iDecoder = 0;
+        }
+    iLoadQueue.Reset();
+
+    delete iBlankTexture;
+
+    // Remove all texture entries (from last to first -order)
+    /*while (iTextures.Count()>0)*/
+    for(TInt i = iTextures.Count()-1; i >= 0; --i)
+        {
+        CTextureEntry * te = iTextures[i];
+        
+        if (te->iTexture)
+            {
+            delete te->iTexture;
+            }
+        else
+            {
+            // This texture was defined but never loaded.
+            HUI_DEBUG2(_L("CHuiTextureManager::~CHuiTextureManager() - Notice, texture id %i (\"%S\") was never loaded!"), te->iId, te->iFileName);
+            }
+        }
+        
+    iTextures.ResetAndDestroy();
+    iStateObservers.Close();
+    iLoadObservers.Close();
+    iAnimatedTextures.Close();
+    iTextureAutoSizeObservers.Close();
+
+    delete iBitmap;
+    delete iMaskBitmap;
+    delete iImagePath;
+    }
+
+
+EXPORT_C CHuiEnv& CHuiTextureManager::Env()
+    {
+    return iEnv;
+    }
+
+
+EXPORT_C CHuiTexture* CHuiTextureManager::Texture(TInt aId)
+    {
+    TInt index = CheckTexture(aId);
+    if(index == -1)
+        {
+        HUI_DEBUG1(_L("CHuiTextureManager::Texture() - Texture id %i not found! Returning blank."), aId);
+        // NOTE: there is a danger of editing the blank texture
+        // instead of the real texture..
+        return &BlankTexture();
+        }
+    CHuiTexture * texture = iTextures[index]->iTexture;
+    if(texture)
+        {
+        return texture;
+        }
+    else
+        {
+        HUI_ASSERT(EFalse); // texture exists but is not loaded! (defined but not loaded)
+        return &BlankTexture();
+        }
+    }
+
+
+EXPORT_C const CHuiTexture* CHuiTextureManager::Texture(TInt aId) const
+    {
+    TInt id = CheckTexture(aId);
+    if(id == -1)
+        {
+        return &BlankTexture();
+        }
+    const CHuiTexture * texture = iTextures[id]->iTexture;
+    if(texture)
+        {
+        return texture;
+        }
+    else
+        {
+        HUI_ASSERT(EFalse); // texture exists but is not loaded! (defined but not loaded)
+        return &BlankTexture();
+        }
+    }
+
+
+EXPORT_C CHuiTexture* CHuiTextureManager::TextureL(TInt aId)
+    {
+    // try to get the index for the texture id
+    TInt index = CheckTexture(aId);
+    if(index != -1)
+        {
+        // If the texture has content and a filename, we can do a load-on-demand.       
+        if(!iTextures[index]->iTexture->HasContent() && iTextures[index]->iFileName)
+            {
+            // we don't want to return textures without content
+            // so load-on-demand      
+                    
+            // texture has an entry but the
+            // actual texture object has not been loaded yet
+
+            // we can load the texture if there's a filename
+            // available for this id
+            return &LoadTextureL(aId);
+            }
+            
+        // texture found  
+        return iTextures[index]->iTexture;
+        }
+
+    User::Leave(KErrNotFound);
+    return NULL; // never
+    }
+
+
+EXPORT_C void CHuiTextureManager::SetImagePathL(const TDesC& aPath)
+    {
+    delete iImagePath;
+    iImagePath = NULL;
+
+    TParsePtrC parse(aPath);
+    CEikonEnv* coe = CEikonEnv::Static();
+    if (aPath.Length() && !parse.DrivePresent() && coe && coe->EikAppUi() && coe->EikAppUi()->Application())
+        {
+        iImagePath = HBufC::NewL(aPath.Size()+2); // two extra characters for drive
+        TPtr ptr = iImagePath->Des();
+        ptr.Append(coe->EikAppUi()->Application()->AppFullName().Left(2));
+        ptr.Append(aPath);
+        }
+    else
+        {
+        iImagePath = aPath.AllocL();        
+        }
+    }
+
+EXPORT_C const TDesC& CHuiTextureManager::ImagePath() const
+    {
+    return *iImagePath;
+    }
+
+
+EXPORT_C const CHuiTexture& CHuiTextureManager::BlankTexture() const
+    {
+    HUI_ASSERT(iBlankTexture!=NULL); // this MUST have a valid pointer otherwise access violation will follow..
+    return *iBlankTexture;
+    }
+
+
+EXPORT_C CHuiTexture& CHuiTextureManager::BlankTexture()
+    {
+    HUI_ASSERT(iBlankTexture!=NULL); // this MUST have a valid pointer otherwise access violation will follow..
+    return *iBlankTexture;
+    }
+
+
+EXPORT_C TBool CHuiTextureManager::SetTextureId(CHuiTexture* aTexture, TInt aId)
+    {
+    
+    if(!aTexture)
+        {
+        // Cannot set texture ID for null texture.
+        return EFalse;
+        }
+    
+    // Iterate through all the managed textures to find the one we
+    // are interested in, and then set its texture ID.
+    for(TInt i = 0; i < iTextures.Count(); ++i)
+        {
+        if(iTextures[i]->iTexture == aTexture)
+            {
+            // Texture was found in the list, so set the new identifier.
+            iTextures[i]->iId = aId;
+            return ETrue;
+            }
+        }
+
+    // Texture was not found in the manager's list.
+    return EFalse;
+    }
+
+EXPORT_C TBool CHuiTextureManager::IsLoaded(const CHuiTexture * texture) const
+    {
+    if(texture != NULL && texture->HasContent() && !IsInLoadQueue(texture))
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+
+EXPORT_C TBool CHuiTextureManager::IsLoaded(const TDesC& aImageName, const TInt aFrameNumber) const
+    {
+    TFileName fileName = *iImagePath;
+    fileName.Append(aImageName);
+    TInt index = CheckTexture(fileName, aFrameNumber);
+    if(index < 0)
+        {
+        HUI_DEBUG1(_L("CHuiTextureManager::IsLoaded() - Texture \"%S\" was not found. Assuming not loaded."), &aImageName);
+        return EFalse;
+        }
+    return IsLoaded(iTextures[index]->iTexture);
+    }
+
+
+EXPORT_C TBool CHuiTextureManager::IsLoaded(TInt aId) const
+    {
+    HUI_ASSERT(aId!=0);
+    TInt index = CheckTexture(aId);
+    if(index < 0)
+        {
+        HUI_DEBUG1(_L("CHuiTextureManager::IsLoaded() - Texture having id %i was not found. Assuming not loaded."), aId);
+        return EFalse;
+        }
+    return IsLoaded(iTextures[index]->iTexture);
+    }
+
+
+EXPORT_C void CHuiTextureManager::AppendTextureL(CHuiTexture* aTexture, TInt aId)
+    {
+    // Panic if the manager is currently restoring or releasing textures.
+    if(iReleaseState == EReleasing)
+        {
+        THuiPanic::Panic(THuiPanic::ETextureManagerTextureDestroyedDuringRelease);
+        }
+    else if(iReleaseState == ERestoring)
+        {
+        THuiPanic::Panic(THuiPanic::ETextureManagerTextureConstructedDuringRestore);
+        }
+    else
+        {
+        // for PC lint
+        }
+
+    HUI_ASSERT(aTexture != NULL);
+
+#ifdef _DEBUG
+    // Look for an existing entry for this.
+    // There must not be any duplicates present!
+    for(TInt i = 0; i < iTextures.Count(); ++i)
+        {
+        if(iTextures[i]->iTexture == aTexture)
+            {
+            User::Leave(KErrAlreadyExists);
+            }
+        }
+#endif
+
+    // Create a new texture entry
+    CTextureEntry * te = new (ELeave) CTextureEntry(aId, aTexture);
+    CleanupStack::PushL(te);
+    // Add the new entry to the list of new textures
+    User::LeaveIfError( iTextures.Append(te) );
+    CleanupStack::Pop(); // pop the texture entry
+
+    HUI_DEBUG1(_L("CHuiTextureManager::AppendTextureL() - Registered texture 0x%x."), aTexture);
+    }
+
+
+EXPORT_C void CHuiTextureManager::RemoveTexture(CHuiTexture& aTexture)
+    {
+    // Panic if the manager is currently restoring or releasing textures.
+    if(iReleaseState == EReleasing)
+        {
+        THuiPanic::Panic(THuiPanic::ETextureManagerTextureDestroyedDuringRelease);
+        }
+    else if(iReleaseState == ERestoring)
+        {
+        THuiPanic::Panic(THuiPanic::ETextureManagerTextureDestroyedDuringRestore);
+        }
+    else
+        {
+        // for PC lint
+        }
+    
+    // Cancel loading of the texture to be removed.
+    CancelLoadingOfTexture(aTexture);
+
+    // Manual sequential search.
+    for(TInt index = iTextures.Count() - 1; index >= 0; --index)
+        {
+        if(iTextures[index]->iTexture == &aTexture)
+            {
+            CTextureEntry * entry = iTextures[index];
+            if ( entry->iFileName )
+                {
+                HUI_DEBUG4(_L("CHuiTextureManager::RemoveTexture() - Removing texture 0x%x  (Name: \"%S\", Id: %i). Number of textures after deleting: %i."),
+                              &aTexture, &(aTexture.ImageFileName()), entry->iId, iTextures.Count()-1);                     
+                }
+            else
+                {
+                HUI_DEBUG3(_L("CHuiTextureManager::RemoveTexture() - Removing unnamed texture 0x%x  ( Id: %i). Number of textures after deleting: %i."),
+                              &aTexture, entry->iId, iTextures.Count()-1);                     
+                }
+
+            iTextures.Remove(index);
+            delete entry;
+            return;
+            }
+        }
+
+    HUI_DEBUG2(_L("CHuiTextureManager::RemoveTexture() - Error! Failed to remove texture 0x%x \"%S\". Texture not found."), &aTexture, &aTexture.ImageFileName());
+    // this is a programming error.. texturemanager is aware of all textures in the toolkit!!
+    #ifdef _DEBUG
+    HUI_PANIC(THuiPanic::ETextureNotValid)
+    #endif
+    }
+
+
+EXPORT_C CHuiTexture& CHuiTextureManager::LoadTextureL(
+    const TDesC& aImageName,
+    THuiTextureUploadFlags aFlags,
+    TInt aId,
+    TInt aFrameNumber)
+    {
+    return LoadTextureL(aImageName, TSize(0, 0), aFlags, aId, aFrameNumber);
+    }
+
+
+EXPORT_C CHuiTexture& CHuiTextureManager::LoadTextureL(const TInt aId,
+                                       const TSize& aTextureMaxSize,
+                                       THuiTextureUploadFlags aFlags)
+    {
+    return LoadTextureL(KNullDesC(), aTextureMaxSize, aFlags, aId);
+    }
+
+
+EXPORT_C CHuiTexture& CHuiTextureManager::LoadTextureL(const TDesC& aImageName,
+        const TSize& aTextureMaxSize,
+        THuiTextureUploadFlags aFlags,
+        TInt aId,
+        TInt aFrameNumber)
+    {
+    // Ignore EHuiTextureFlagAllowDirectBitmapUsage flag
+   	aFlags = (THuiTextureUploadFlags)(aFlags & ~EHuiTextureFlagAllowDirectBitmapUsage);		
+    
+    TFileName fileName;
+
+    CTextureEntry * entry = NULL;  
+
+    // If the name is invalid, and there was no filename available
+    // based on id, return a dummy texture.
+    if((aImageName.Length() == 0) && (aId == 0))
+        {
+        HUI_DEBUG(_L("CHuiTextureManager::LoadTextureL() - No filename or id provided for texture. Returning blank."));
+        return BlankTexture();
+        }
+
+    // add path to filename if filename has been passed
+    if(aImageName.Length() > 0)
+        {
+        // assume relative pathname and prepend the image path to get full filename
+        fileName = aImageName;
+        PrependImagePath(fileName);
+        }
+
+    // if no name has been passed as a parameter but
+    // a nonzero id has been passed, we
+    // can assume that there's a predefined name available
+    if((aImageName.Length() == 0) && (aId != 0))
+       {
+        // search for a texture filename based on the id.
+        TInt index = CheckTexture(aId);
+        if(index >=0)
+            {
+            entry = iTextures[index];
+            HUI_ASSERT(entry->iFileName);
+            fileName = *(entry->iFileName);
+            }
+        else
+            {
+            HUI_DEBUG1(_L("CHuiTextureManager::LoadTextureL() - Unable to load texture without filename or pre-defined id (filename definition for id %i not found)."), aId);
+            User::Leave(KErrNotFound);
+            }
+       }
+
+    // a guarantee that there's a filename available
+    HUI_ASSERT(	fileName.Length()>0 );
+
+    // Reuse pre-existing entries:
+    // try first finding an entry based on id
+    if(entry == NULL && aId != 0)
+        {
+        TInt previouslyLoadedIndex = CheckTexture(aId);
+        if (previouslyLoadedIndex >= 0)
+            {
+            entry = iTextures[previouslyLoadedIndex];
+            }
+        }
+
+    // We are not allowed to change required texture id so we can't 
+    // try again with the filename unless user does not care about id
+    if(aId == 0 && entry == NULL)
+        {
+        TInt previouslyLoadedIndex = CheckTexture(fileName, aFrameNumber);
+        if (previouslyLoadedIndex >= 0)
+            {
+            entry = iTextures[previouslyLoadedIndex];
+            }
+        }
+
+    // create new texture entry if there's not one
+    // available at this point
+    if(entry == NULL)
+        {
+        HUI_DEBUG(_L("CHuiTextureManager::LoadTextureL() - Creating new texture."));
+
+        // in the case that a previously loaded slot was not found,
+        // create a new texture, which automatically registers a new
+        // texture entry in the iTextures list.
+        CHuiTexture::NewL();
+
+        // we assume that the newest entry was added the last
+        entry = iTextures[iTextures.Count()-1];
+
+        entry->iId = aId;
+        }
+    else
+        {
+        // We have a valid texture name and ID.
+        HUI_ASSERT(entry->iTexture);
+      
+        // we have a pre-existing texture,
+        // but check that the texture is loaded ok, we can also
+        // return unloaded textures that are in the load queue
+        if (entry->iTexture->HasContent() || IsInLoadQueue(entry->iTexture))
+            {
+            // a previous texture exists!
+            HUI_ASSERT(entry->iTexture!=NULL);            
+            
+            HUI_DEBUG3(_L("CHuiTextureManager::LoadTextureL() - Reusing texture 0x%x (\"%S\", id: %i) No need to load."),
+                      entry->iTexture, &entry->iTexture->ImageFileName(), entry->iId);
+            return *(entry->iTexture);
+            }
+        }
+
+    HUI_ASSERT(entry!=NULL);
+    HUI_ASSERT(entry->iTexture!=NULL);
+       
+    // replace filename
+    // File names are relative to the image path.
+    entry->SetFileName(fileName);
+    entry->iTexture->SetImageFileNameL(fileName);
+    entry->iTexture->EnableShadow((aFlags & EHuiTextureUploadFlagGenerateShadow) != 0);
+    entry->iFrameNumber = aFrameNumber;
+
+    // add a content observer so that we can reload the texture
+    // during restoring
+    if (entry->iTexture->iContentObservers.Count()==0)
+        {
+        HUI_DEBUG2(_L("CHuiTextureManager::LoadTextureL() - Adding content observer 0x%x for texture 0x%x."),  entry, entry->iTexture);
+        entry->iTexture->iContentObservers.AppendL(*entry);
+        }
+
+    HUI_DEBUG3(_L("CHuiTextureManager::LoadTextureL() - Enqueuing texture 0x%x (Name: \"%S\", Id: %i)."),
+               entry->iTexture, &entry->iTexture->ImageFileName(), entry->iId);
+
+    // Prepare for loading by creating a load queue entry.
+    SLoadQueueEntry loadqentry;
+    Mem::FillZ(&loadqentry, sizeof(loadqentry));
+    loadqentry.iLoading = entry;
+    entry->iMaxTextureSize = aTextureMaxSize;
+    entry->iFlags = aFlags;
+
+    // Textures are loaded one at a time, in the order they were requested.
+    User::LeaveIfError( iLoadQueue.Append(loadqentry) );
+
+    // Start loading images.
+    if(iState == EIdle)
+        {
+        StartLoading();
+        
+        if(iState == ELoading)
+            {
+            // Notify observers that loading has started.
+            NotifyStateChange();
+            }
+        }
+
+    return *entry->iTexture;
+    }
+
+EXPORT_C CHuiTexture&
+CHuiTextureManager::CreateTextureL(TInt aId,
+                                   MHuiBitmapProvider* aBitmapProvider,
+                                   THuiTextureUploadFlags aFlags)
+    {
+    CHuiTexture* tex;
+    
+    // can't create texture without id (or filename)
+    if (aId==0)
+        {
+        HUI_DEBUG(_L("CHuiTextureManager::CreateTextureL() - ERROR! Can't create texture without valid id. Please use nonzero ids."));
+        User::Leave(KErrArgument);
+        }
+
+    // Provide an already created texture if such exists.
+    CHuiTexture* texture = NULL;
+    TRAPD(err, texture = TextureL(aId));
+    if(err == KErrNone)
+        {
+        ASSERT( texture );
+
+        // Update flags here because there is no other way to change flags. 
+        CTextureEntry* entry = TextureEntry(CheckTexture(aId));
+        if (entry)
+            {
+            entry->iFlags = aFlags;        
+            }
+        
+        return *texture;
+        }
+
+    // Assert that the bitmap provider object exists.
+    HUI_ASSERT(aBitmapProvider != NULL);
+
+    HUI_DEBUG1(_L("CHuiTextureManager::CreateTextureL() - Requesting bitmap content from provider 0x%x .."), aBitmapProvider);
+
+    // Initialize bitmap and mask bitmap pointers to zero.
+    CFbsBitmap* bitmap = NULL;
+    CFbsBitmap* maskBitmap = NULL;
+
+    // Call the bitmapProvider method to load the bitmaps.
+    ASSERT( aBitmapProvider );
+    aBitmapProvider->ProvideBitmapL(aId, bitmap, maskBitmap);
+
+    // Error if main bitmap could not be loaded
+    User::LeaveIfNull(bitmap);
+    CleanupStack::PushL(bitmap);
+    
+    UpdateFlags(*bitmap, maskBitmap, aFlags);
+    
+    if (maskBitmap)
+        {
+        // A mask was provided, so pass this to texture creation.
+        CleanupStack::PushL(maskBitmap);
+        // create textures right away for these bitmaps
+        tex = &CreateTextureL(*bitmap, maskBitmap, aFlags, aId);
+        // get rid of bitmap and mask
+        CleanupStack::PopAndDestroy(maskBitmap);
+        }
+    else
+        {
+        // No mask, so create texture without one.
+        // create textures right away for these bitmaps
+        tex = &CreateTextureL(*bitmap, NULL, aFlags, aId);            
+        }
+        
+    CleanupStack::PopAndDestroy(bitmap);        
+
+    // store the provider with the texture for Restore operations
+    HUI_ASSERT(CheckTexture(aId)>=0);
+    CTextureEntry * entry = TextureEntry(CheckTexture(aId));
+    entry->iBitmapProvider = aBitmapProvider;
+    entry->iFlags = aFlags;
+
+    HUI_ASSERT(entry->iTexture);
+
+    // add a content observer so that we can reload the texture
+    // during restoring
+    if (entry->iTexture->iContentObservers.Count()==0)
+        {
+        HUI_DEBUG2(_L("CHuiTextureManager::CreateTextureL() - Adding content observer 0x%x for texture 0x%x."),  entry, entry->iTexture);
+        entry->iTexture->iContentObservers.AppendL(*entry);
+        }
+
+    return *tex;
+    }
+
+EXPORT_C CHuiTexture& CHuiTextureManager::CreateTextureL(CFbsBitmap& aBitmap,
+                                   const CFbsBitmap* aMask,
+                                   THuiTextureUploadFlags aFlags,
+                                   TInt aId)
+    {
+    TBool hasAlpha = (aMask != NULL);
+    TSize bitmapSize = aBitmap.SizeInPixels();
+
+    CHuiStatic::Tic(2);
+
+    // Verify that the bitmap size is same as the mask size.
+    if(hasAlpha && (bitmapSize != aMask->SizeInPixels()))
+        {
+        HUI_DEBUG(_L("CHuiTextureManager::CreateTextureL() - Bitmap size is not compatible with the mask bitmap!"));
+        User::Leave(KErrArgument);
+        }
+
+    // Leave if the name and the id are empty.
+    if(aId==0)
+        {
+        HUI_DEBUG(_L("CHuiTextureManager::CreateTextureL() - ERROR! Can't create texture without valid id or name."));
+        User::Leave(KErrArgument);
+        }
+
+    // If the texture has already been loaded, just return a reference.
+    TInt previouslyLoadedIndex = CheckTexture(aId);
+
+    if((previouslyLoadedIndex != -1) && IsLoaded(aId))
+        {
+        CHuiTexture * tex = iTextures[previouslyLoadedIndex]->iTexture;
+        HUI_ASSERT(tex);
+        HUI_DEBUG3(_L("CHuiTextureManager::CreateTextureL() - Reusing previously loaded texture (0x%x, \"%S\", id: %i)."),
+                     tex, &tex->ImageFileName(), iTextures[previouslyLoadedIndex]->iId);
+        return *tex;
+        }
+
+    // create and append to the textures list (automatic)
+    CHuiTexture* texture = CHuiTexture::NewL();
+    // Set texture name
+    texture->SetImageFileNameL(_L(""));
+    // Set the texture id.
+    HUI_ASSERT(TextureEntryCount()>0);
+    CTextureEntry * te = TextureEntry(TextureEntryCount()-1);
+    te->iId = aId;
+
+    HUI_DEBUG3(_L("CHuiTextureManager::CreateTextureL() - Created new texture 0x%x (\"%S\", id: %i)."),
+                     texture, &texture->ImageFileName(), aId);
+
+    // Let the texture know its size as soon as possible.
+    texture->SetSize(bitmapSize);
+
+    HUI_DEBUG6(_L("CHuiTextureManager::CreateTextureL() - Image for texture 0x%x is \"%S\": w=%i, h=%i, dm=%i, mdm=%i"),
+               texture,
+               &texture->ImageFileName(),
+               bitmapSize.iWidth,
+               bitmapSize.iHeight,
+               aBitmap.DisplayMode(),
+               (aMask != NULL ? aMask->DisplayMode() : ENone));
+
+    // Enable texture shadow.
+    texture->EnableShadow((aFlags & EHuiTextureUploadFlagGenerateShadow) != 0);
+
+	if (bitmapSize.iWidth != 0 && bitmapSize.iHeight != 0)
+	    {
+    	if (aFlags & EHuiTextureFlagAllowDirectBitmapUsage) 
+    		{
+       		texture->UploadDirectL(aBitmap, aMask, aFlags);		
+    		}
+    	else 
+    		{
+       		texture->UploadL(aBitmap, aMask, aFlags);		
+    		}
+
+	    }
+
+    HUI_DEBUG1(_L("CHuiTextureManager::CreateTextureL() - Upload for texture 0x%x done, notifying possible observers.."), texture);
+
+    // Store bits per pixel info to calculate texture memory usage
+    te->iBitDepth = TDisplayModeUtils::NumDisplayModeBitsPerPixel( aBitmap.DisplayMode() );
+    if( aMask )
+    	{
+    	 te->iBitDepth =  te->iBitDepth + TDisplayModeUtils::NumDisplayModeBitsPerPixel( aMask->DisplayMode() );
+    	}
+
+    // Notify the observers
+    NotifyTextureLoaded(*texture, aId, KErrNone);
+
+    HUI_DEBUG2(_L("CHuiTextureManager::CreateTextureL() - Finished with texture 0x%x, toc: %f seconds"), texture, CHuiStatic::Toc(2));
+    return *texture;
+    }
+
+
+EXPORT_C void CHuiTextureManager::UpdateTextureFromBitmapL(TInt aId, MHuiBitmapProvider* aBitmapProvider)
+    {
+    TInt previouslyLoadedIndex = CheckTexture(aId);
+    if (previouslyLoadedIndex == KErrNotFound)
+    	{
+    	User::Leave(KErrNotFound);
+    	}
+
+	// Unload
+	
+    UnloadTexture(aId);      
+
+	// Upload with the new content
+	
+	CTextureEntry* entry = iTextures[previouslyLoadedIndex];
+    
+    HUI_DEBUG1(_L("CHuiTextureManager::UpdateTextureFromBitmapL() - Requesting bitmap content from provider 0x%x .."), aBitmapProvider);
+
+    // Initialize bitmap and mask bitmap pointers to zero.
+    CFbsBitmap* bitmap = NULL;
+    CFbsBitmap* maskBitmap = NULL;
+
+    // Call the bitmapProvider method to load the bitmaps.
+    if (!aBitmapProvider)
+    	{
+    	aBitmapProvider = entry->iBitmapProvider;
+    	}
+    if (aBitmapProvider)
+    	{
+   	    aBitmapProvider->ProvideBitmapL(aId, bitmap, maskBitmap);
+    	}
+
+    // Error if main bitmap could not be loaded
+    if (!bitmap)
+    	{
+    	User::Leave(KErrNotFound);
+    	}
+    CleanupStack::PushL(bitmap);
+    
+    if (maskBitmap)
+        {
+        CleanupStack::PushL(maskBitmap);
+        }
+
+    TBool hasAlpha = (maskBitmap != NULL);
+    TSize bitmapSize = bitmap->SizeInPixels();
+
+    CHuiStatic::Tic(2);
+
+    // Verify that the bitmap size is same as the mask size.
+    if(hasAlpha && (bitmapSize != maskBitmap->SizeInPixels()))
+        {
+        HUI_DEBUG(_L("CHuiTextureManager::UpdateTextureFromBitmapL() - Bitmap size is not compatible with the mask bitmap!"));
+        User::Leave(KErrArgument);
+        }
+
+    CHuiTexture* texture = entry->iTexture;
+    // Set texture name
+    texture->SetImageFileNameL(_L(""));
+
+    HUI_DEBUG6(_L("CHuiTextureManager::UpdateTextureFromBitmapL() - Image for texture 0x%x is \"%S\": w=%i, h=%i, dm=%i, mdm=%i"),
+               texture,
+               &texture->ImageFileName(),
+               bitmapSize.iWidth,
+               bitmapSize.iHeight,
+               bitmap->DisplayMode(),
+               (maskBitmap != NULL ? maskBitmap->DisplayMode() : ENone));
+
+    UpdateFlags(*bitmap, maskBitmap, entry->iFlags);
+    
+	if (bitmapSize.iWidth != 0 && bitmapSize.iHeight != 0)
+	    {
+    	if (entry->iFlags & EHuiTextureFlagAllowDirectBitmapUsage) 
+    		{
+       		texture->UploadDirectL(*bitmap, maskBitmap, entry->iFlags);		
+    		}
+    	else 
+    		{
+       		texture->UploadL(*bitmap, maskBitmap, entry->iFlags);		
+    		}
+	    }
+    HUI_DEBUG2(_L("CHuiTextureManager::UpdateTextureFromBitmapL() - Finished with texture 0x%x, toc: %f seconds"), texture, CHuiStatic::Toc(2));
+     
+    // Store bits per pixel info to calculate texture memory usage
+    entry->iBitDepth = TDisplayModeUtils::NumDisplayModeBitsPerPixel( bitmap->DisplayMode() );
+    if (maskBitmap)
+    	{
+    	entry->iBitDepth = entry->iBitDepth + TDisplayModeUtils::NumDisplayModeBitsPerPixel( maskBitmap->DisplayMode() );
+    	}
+    
+    if (maskBitmap)    
+    	{
+    	CleanupStack::PopAndDestroy(maskBitmap);   	
+    	}
+    	
+    CleanupStack::PopAndDestroy(bitmap);        
+    
+    // Store provider in case it has changed
+    if (aBitmapProvider)
+    	{
+    	entry->iBitmapProvider = aBitmapProvider;
+    	}
+   }
+    
+ 
+void CHuiTextureManager::UpdateFlags(const CFbsBitmap& aBitmap, const CFbsBitmap* aMaskBitmap, 
+	                                 THuiTextureUploadFlags& aFlags)
+	{
+	// Update EHuiTextureFlagUseBitmapDirectly flag if needed
+	
+	if (aFlags & EHuiTextureFlagAllowDirectBitmapUsage)
+		{
+		TBool isDirectBitmapOk = !aBitmap.IsCompressedInRAM() && 
+		                     (!aMaskBitmap || !aMaskBitmap->IsCompressedInRAM());
+		// Check texture formats from the display
+		// Note: if there is no display the check cannot be done
+		if (isDirectBitmapOk)
+			{
+			isDirectBitmapOk = EFalse;		
+			if (CHuiStatic::Env().DisplayCount() > 0)
+				{
+				RPointerArray<CHuiDisplay::CTextureBitmapFormat> formatArray;
+    			TInt err = CHuiStatic::Env().PrimaryDisplay().GetPreferredTextureFormats(formatArray);
+    			if (!err)
+    				{
+    				for (TInt i = 0; i < formatArray.Count(); i++)
+    					{
+   			   			if ((aBitmap.DisplayMode() == formatArray[i]->iImage) &&
+   			   				((!aMaskBitmap) || (aMaskBitmap->DisplayMode() == formatArray[i]->iMask)))
+   			   				{
+   			   				isDirectBitmapOk = ETrue;
+   			   				}
+    					}
+					}
+				formatArray.ResetAndDestroy();
+				}
+			}
+		// Update	
+		if (!isDirectBitmapOk)
+			{
+   			aFlags = (THuiTextureUploadFlags)(aFlags & ~EHuiTextureFlagAllowDirectBitmapUsage);		
+			}
+		}
+	}
+
+    
+RFs& CHuiTextureManager::FsSession() const
+    {
+    return iFS;
+    }
+
+
+EXPORT_C void CHuiTextureManager::PrependImagePath(TDes& aFileName) const
+    {
+    TFileName buf;
+
+    //allow app to load textures from different drive with complete path
+    TParse p1;
+    p1.Set(aFileName,0,0);
+
+    if (p1.DrivePresent())
+        {
+        return;
+        }
+
+    if(aFileName.Find(*iImagePath) == KErrNotFound)
+        {
+        buf = *iImagePath;
+        buf.Append(aFileName);
+        aFileName = buf;
+        }
+    }
+
+
+EXPORT_C void CHuiTextureManager::UnloadTexture(const TDesC& aImageName, const TInt aFrameNumber)
+    {
+    TFileName fileName = aImageName;
+    PrependImagePath(fileName);
+    TInt index = CheckTexture(fileName, aFrameNumber);
+    if (index >= 0)
+        {
+        HUI_DEBUG2(_L("CHuiTextureManager::UnloadTexture() - Unloading texture 0x%x (id: %i)."),
+                   iTextures[index]->iTexture,
+                   iTextures[index]->iId);
+        DoUnload(index);
+        return;
+        }
+    HUI_DEBUG1(_L("CHuiTextureManager::UnloadTexture() - Warning! Unable to unload \"%S\" - No such texture(s) found. Already unloaded?"), &fileName);
+    }
+
+
+EXPORT_C void CHuiTextureManager::UnloadTexture(TInt aId)
+    {
+    TInt index = CheckTexture(aId);
+    if (index >= 0)
+        {
+        HUI_DEBUG2(_L("CHuiTextureManager::UnloadTexture() - Unloading texture 0x%x (id: %i)."),
+                   iTextures[index]->iTexture,
+                   iTextures[index]->iId);
+        DoUnload(index);
+        return;
+        }
+    HUI_DEBUG1(_L("CHuiTextureManager::UnloadTexture() - Warning! Unable to unload id %i. No texture with such id. Already unloaded?"), aId);
+    }
+
+
+EXPORT_C void CHuiTextureManager::DefineFileNameL(TInt aId,
+                                                  const TDesC& aImageName)
+    {
+    if (aId==0)
+        {
+        HUI_DEBUG(_L("CHuiTextureManager::DefineFileNameL() - ERROR! Defining filename for texture id 0 is not allowed. Please use nonzero ids."));
+        User::Leave(KErrArgument); // can't specify filename for "no id"
+        }
+
+    // Look for an existing entry for the id.
+    for(TInt i = 0; i < iTextures.Count(); ++i)
+        {
+        if(iTextures[i]->iId == aId)
+            {
+            // Just set the new image name.
+            iTextures[i]->SetFileName(aImageName);
+            return;
+            }
+        }
+
+    // create a new texture, which automatically registers a new
+    // texture entry in the iTextures list.
+    CHuiTexture::NewL();
+    // we assume that the newest entry was added last
+    CTextureEntry* entry = iTextures[iTextures.Count()-1];
+    entry->iId = aId;
+    entry->SetFileName(aImageName);
+    }
+
+
+EXPORT_C TInt CHuiTextureManager::CheckTexture(const TDesC& aImageName, TInt aFrameNumber) const
+    {
+    if(aImageName.Length()==0)
+        {
+        // name empty, can't check
+        return -1;
+        }
+    for(TInt i = 0; i < iTextures.Count(); ++i)
+        {
+        CTextureEntry * te = iTextures[i];
+        // compare against texture manager entry filename (iFileName)
+        if((te->iFileName != NULL)
+            && (aImageName.Compare(*(te->iFileName)) == 0)
+            && te->iFrameNumber == aFrameNumber)
+            {
+            return i;
+            }
+
+        // compare against texture object imagefilename
+        if( te->iTexture 
+            && te->iTexture->ImageFileName().Compare(aImageName) == 0
+            && te->iTexture->iFrameNumber == aFrameNumber)
+            {
+            return i;
+            }
+        }
+    // not found
+    return -1;
+    }
+
+
+EXPORT_C TInt CHuiTextureManager::CheckTexture(TInt aId) const
+    {
+    if(aId == 0)
+        {
+        // id not defined, can't search
+        return -1;
+        }
+    for(TInt i = 0; i < iTextures.Count(); ++i)
+        {
+        if(iTextures[i]->iId == aId)
+            {
+            return i;
+            }
+        }
+    // not found:
+    return -1;
+    }
+
+
+TBool CHuiTextureManager::IsInLoadQueue(const CHuiTexture * texture) const
+    {
+
+    if (texture == NULL)
+        {
+        return EFalse;
+        }
+
+    // textures in the load queue are not loaded yet,
+    // the others are assumed to be loaded..
+    for(TInt i = 0; i < iLoadQueue.Count(); ++i)
+        {
+        CTextureEntry* textureEntry = iLoadQueue[i].iLoading;
+        if(textureEntry->iTexture == texture)
+            {
+            // Still in the queue.
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+
+TBool CHuiTextureManager::IsInLoadQueue(TInt id) const
+    {
+    // textures in the load queue are not loaded yet,
+    // the others are assumed to be loaded..
+    for(TInt i = 0; i < iLoadQueue.Count(); ++i)
+        {
+        if(iLoadQueue[i].iLoading->iId == id)
+            {
+            // Still in the queue.
+            return ETrue;
+            }
+        }
+    return EFalse;
+    }
+
+
+void CHuiTextureManager::StartLoading()
+    {
+    // Start the texture load active object if we're not loading
+    if(iState == EIdle)
+        {
+        HUI_DEBUG(_L("CHuiTextureManager::StartLoading() - Starting load queue."));
+
+        // loop that finds next entry to load
+        while (1)
+            {            
+            HUI_DEBUG(_L("CHuiTextureManager::StartLoading() - Find next to be loaded."));
+            
+            // try to schedule next image for loading..
+            TRAPD(err, DoLoadNextL());
+            // ok?
+                
+            if(err != KErrNone)
+                {
+                HUI_DEBUG(_L("CHuiTextureManager::StartLoading() - Found an error."));
+                
+                HUI_ASSERT(iLoadQueue.Count()>0);
+                // remove the entry from the queue
+                SLoadQueueEntry entry = PopLoadedQueueEntry();
+                switch (err)
+                    {
+                    case KErrNoMemory:
+                        {
+                        HUI_DEBUG3( _L("CHuiTextureManager::StartLoading() - Unable to start loading \"%S\" (id %i): Out of memory. Trying to continue with %i items in the queue.."), &(entry.iLoading->iTexture->ImageFileName()), entry.iLoading->iId, iLoadQueue.Count());
+                        break;
+                        }
+                    default:
+                        {
+                        HUI_DEBUG4( _L("CHuiTextureManager::StartLoading() - Unable to start loading \"%S\" (id %i): Leave error code %i. Trying to continue with %i items in the queue.."), &(entry.iLoading->iTexture->ImageFileName()), entry.iLoading->iId, err, iLoadQueue.Count());
+                        break;
+                        }
+                    }
+                // Notify observers about the image loading error
+                NotifyTextureLoaded(*entry.iLoading->iTexture, entry.iLoading->iId, err);
+                // Image loading has been completed.
+                iState = EIdle;
+                continue;
+                }
+            else
+                {
+                HUI_DEBUG(_L("CHuiTextureManager::StartLoading() - Found next texture to load."));
+                if(iLoadQueue.Count() == 0 && iLoadQueueHadValidTexture)
+                    {
+                    // During the load loop that has passed we have succesfully started to load
+                    // at least one texture. So the state has been changed to ELoading, thus
+                    // it is now changed back to EIdle.
+                    NotifyStateChange();
+                    iLoadQueueHadValidTexture = EFalse;
+                    }
+                }
+                
+            // leave the loop if we had no trouble scheduling the next
+            // image decode
+            break;
+            }
+
+        HUI_DEBUG(_L("CHuiTextureManager::StartLoading() - Load queue started."));
+        }                     
+    }
+
+
+CHuiTextureManager::SLoadQueueEntry CHuiTextureManager::PopLoadedQueueEntry()
+    {
+    SLoadQueueEntry entry = iLoadQueue[0];
+    HUI_DEBUG2( _L("CHuiTextureManager::PopLoadedQueueEntry() - Cleaning up load queue entry for \"%S\" (id %i)."),
+                &(entry.iLoading->iTexture->ImageFileName()), entry.iLoading->iId);
+    iLoadQueue.Remove(0);
+    // Delete the decoder.
+    delete entry.iDecoder;
+    entry.iDecoder = 0;
+    return entry;
+    }
+
+
+void CHuiTextureManager::DoLoadNextL()
+    {
+	HUI_DEBUG(_L("CHuiTextureManager::DoLoadNextL() - Going into assert."));    
+    __ASSERT_ALWAYS(iState == EIdle, THuiPanic::Panic(THuiPanic::EInternal));
+    HUI_DEBUG(_L("CHuiTextureManager::DoLoadNextL() - Survived assert."));
+
+    // Any loading tasks left?
+    if(iLoadQueue.Count() == 0)
+        {
+        HUI_DEBUG(_L("CHuiTextureManager::DoLoadNextL() - No more items to load. Changing state to idle."));
+        return; // nothing else to be loaded.
+        }
+
+    // Start timing
+    CHuiStatic::Tic(2);
+
+    // Manager is now busy.
+    iState = ELoading;
+
+    HUI_DEBUG(_L("CHuiTextureManager::DoLoadNextL() - Fetching next load queue entry."));
+
+    // Fetch a load queue entry
+    SLoadQueueEntry& entry = iLoadQueue[0];
+    CHuiTexture* texture = entry.iLoading->iTexture;
+    HUI_ASSERT(texture != NULL);
+    HUI_DEBUG1(_L("CHuiTextureManager::DoLoadNext() - Starting to decode %S"), &texture->ImageFileName());
+
+    // Create a new image decoder for loading the image.
+    TFileName imageFileName = texture->ImageFileName(); // does not include image path
+    PrependImagePath(imageFileName);
+    
+    delete entry.iDecoder;
+    entry.iDecoder = NULL;
+    
+    TRAPD( err,  entry.iDecoder = CImageDecoder::FileNewL(FsSession(), imageFileName, CImageDecoder::EOptionAlwaysThread) );
+    
+    // check for errors..
+    if(err != KErrNone)
+        {
+        // Try to cancel the decoding (if possible)
+        if(entry.iDecoder)
+            {
+            entry.iDecoder->Cancel();
+            }
+        switch (err)
+            {
+            case KEComErrNoInterfaceIdentified:
+                {
+                HUI_DEBUG1( _L("CHuiTextureManager::DoLoadNext() - CImageDecoder failed to decode \"%S\". No plugin decoders were found."), &texture->ImageFileName() );
+                User::Leave(err); // re-leave with the error
+                }
+            case KErrPathNotFound:
+                {
+                HUI_DEBUG1( _L("CHuiTextureManager::DoLoadNext() - CImageDecoder failed to decode \"%S\". Path not found."), &texture->ImageFileName() );
+                User::Leave(err); // re-leave with the error
+                }
+            case KErrAccessDenied:
+            case KErrPermissionDenied:
+                {
+                HUI_DEBUG1( _L("CHuiTextureManager::DoLoadNext() - CImageDecoder failed to decode \"%S\". Access denied."), &texture->ImageFileName() );
+                User::Leave(err); // re-leave with the error
+                }
+            case KErrNotFound:
+                {
+                HUI_DEBUG1( _L("CHuiTextureManager::DoLoadNext() - CImageDecoder failed to decode \"%S\". Resource not found."), &texture->ImageFileName() );
+                User::Leave(err); // re-leave with the error
+                }
+            case KErrUnderflow:
+                {
+                HUI_DEBUG1( _L("CHuiTextureManager::DoLoadNext() - CImageDecoder failed to decode \"%S\". Not enough data in file to identify which plugin decoder to use."), &texture->ImageFileName() );
+                User::Leave(err); // re-leave with the error
+                }
+            case KErrNotSupported:
+                {
+                HUI_DEBUG1( _L("CHuiTextureManager::DoLoadNext() - CImageDecoder failed to decode \"%S\". Format not supported."), &texture->ImageFileName() );
+                User::Leave(err); // re-leave with the error
+                }
+            default:
+                {
+                HUI_DEBUG2( _L("CHuiTextureManager::DoLoadNext() - CImageDecoder failed to decode \"%S\". Unknown error (code %i)."), &texture->ImageFileName(), err );
+                User::Leave(err); // re-leave with the error
+                }
+            }
+        }
+     
+    entry.iDecoder->SetDecoderThreadPriority(EPriorityAbsoluteBackgroundNormal);
+        
+    // There is a valid texture in the load queue that we now start to load.
+    iLoadQueueHadValidTexture = ETrue;        
+        
+    // from decoder's frame info retrieve the framesize
+    const TInt frameCount = entry.iDecoder->FrameCount();
+    entry.iLoading->iFrameCount = frameCount;
+    if (frameCount && entry.iLoading->iFrameNumber>frameCount)
+        {
+        entry.iLoading->iFrameNumber = frameCount-1;
+        }
+
+    CHuiTextureAnimationState* textureAnimationState = NULL;
+    
+    TInt groupId = 0;
+    TBool foundGroup = FindGroupIdByTextureId( entry.iLoading->iId, groupId );
+    
+    if ( frameCount > 1 && NeedsAnimationState( *entry.iDecoder ) )
+        {
+        // It's animated texture which needs to be produced sequentially.
+        if ( !foundGroup )
+            {
+            HUI_DEBUG(_L("CHuiTextureManager::DoLoadNextL() - Animation: Group not found."));
+
+            if ( iAnimationWithoutGroup && 
+                 iAnimationWithoutGroup->CheckIfCanProduce( 
+                    imageFileName,
+                    entry.iLoading->iFrameNumber,
+                    frameCount ) )
+                {
+                // use iAnimationWithoutGroup
+                }
+            else
+                {
+                delete iAnimationWithoutGroup;
+                iAnimationWithoutGroup = NULL;
+                
+                iAnimationWithoutGroup = 
+                    CHuiTextureAnimationState::NewL( 
+                        0, imageFileName, frameCount );
+                }
+            textureAnimationState = iAnimationWithoutGroup;
+            }
+        else
+            {
+            HUI_DEBUG(_L("CHuiTextureManager::DoLoadNextL() - Animation: Group found."));
+            textureAnimationState = CreateAnimationStateL( 
+                groupId, imageFileName, 
+                entry.iLoading->iFrameNumber, frameCount );
+            }
+        }
+    else
+        {
+        // No need to produce sequentially.
+        if ( foundGroup )
+            {
+            RemoveAnimationState( FindAnimationState( groupId ) );
+            }
+        }
+
+    if ( textureAnimationState != iAnimationWithoutGroup )
+        {
+        delete iAnimationWithoutGroup;
+        iAnimationWithoutGroup = NULL;
+        }
+
+    const TInt frameToBeLoaded = 
+        !textureAnimationState ? 
+        entry.iLoading->iFrameNumber : 
+        textureAnimationState->GetNextFrameNumber();
+        
+    TFrameInfo frameInfo(entry.iDecoder->FrameInfo(frameToBeLoaded));
+    entry.iLoading->iFrameInterval = frameInfo.iDelay.Int64();
+
+    if ( textureAnimationState )
+        {
+        textureAnimationState->OfferNextFrameInfo( frameInfo );
+        }
+    
+    // check for alpha channel
+    // Gifs don't have alpha but support tranparency so the alpha flag is ignored currently
+    if(frameInfo.iFlags & TFrameInfo::ETransparencyPossible/* &&
+            frameInfo.iFlags & TFrameInfo::EAlphaChannel*/)
+        {
+        entry.iHasAlpha = ETrue;
+        }
+    else
+        {
+        entry.iHasAlpha = EFalse;
+        }
+
+    // Get the image original size
+    TRect bitmapSize = frameInfo.iFrameCoordsInPixels;
+    TSize overallSize = 
+        !textureAnimationState ? 
+            bitmapSize.Size() : 
+            textureAnimationState->OverallSize();
+    
+    entry.iOriginalSize = overallSize;
+
+    HUI_DEBUG6(_L("CHuiTextureManager::DoLoadNext() - (sub)Image %S (id %i): w=%i, h=%i, bpp=%i, dm=%i"),
+               &texture->ImageFileName(),
+               entry.iLoading->iId,
+               bitmapSize.Size().iWidth,
+               bitmapSize.Size().iHeight,
+               frameInfo.iBitsPerPixel,
+               frameInfo.iFrameDisplayMode);
+
+    HUI_DEBUG(_L("CHuiTextureManager::DoLoadNext() - Setting logical size of the bitmap."));
+
+    // Try to assign the original size to the image
+    texture->SetSize(overallSize);
+
+    // target resolution for texture, initially equal to bitmap size
+    TInt widthResolutionTarget = overallSize.iWidth;
+    TInt heightResolutionTarget = overallSize.iHeight;
+
+    TSize maxTexSize = entry.iLoading->iMaxTextureSize;
+
+    // Assign new texture resolution target dimensions
+    // if we have explicitly requested them
+    if( (entry.iLoading->iFlags & EHuiTextureUploadFlagDoNotRetainResolution)
+            && maxTexSize.iWidth > 0
+            && maxTexSize.iHeight > 0)
+        {
+        HUI_DEBUG3(_L("CHuiTextureManager::DoLoadNext() - Custom texture size for image %S: w=%i, h=%i"),
+                   &texture->ImageFileName(),
+                   maxTexSize.iWidth,
+                   maxTexSize.iHeight);
+
+        // assign new target resolution for decoder-based scaling
+        if(maxTexSize.iWidth < widthResolutionTarget)
+            {
+            widthResolutionTarget = maxTexSize.iWidth;
+            }
+        if(maxTexSize.iHeight < heightResolutionTarget)
+            {
+            heightResolutionTarget = maxTexSize.iHeight;
+            }
+        }
+
+    // Set up segmentation so we know what kind of texture (and texture
+    // size) we are dealing with
+    texture->SetupSegmentsL(overallSize,
+                           TSize(widthResolutionTarget, heightResolutionTarget),
+                           entry.iLoading->iFlags);
+
+    // we can do direct decoder-based scaling,
+    // if only a single segment texture is used
+    if( !textureAnimationState &&
+        texture->SegmentCount() == 1 &&
+        (texture->SegmentTextureSize(0).iWidth < bitmapSize.Size().iWidth ||
+         texture->SegmentTextureSize(0).iHeight < bitmapSize.Size().iHeight))
+        {
+
+        // assign new texture size target dimensions from the calculated segment 0
+        widthResolutionTarget = texture->SegmentTextureSize(0).iWidth;
+        heightResolutionTarget = texture->SegmentTextureSize(0).iHeight;
+
+        // we need to do some downscaling, but can we do arbitrary
+        // scaling as well?
+        if(frameInfo.iFlags & TFrameInfo::EFullyScaleable)
+            {
+            // .. yes, arbitrary scaling is possible
+            // just assign the new size to the bitmap
+            // so that it will be scaled accordingly during
+            // conversion
+            HUI_DEBUG3(_L("CHuiTextureManager::DoLoadNext() - Downscaling image %S to size %ix%i."),
+                       &texture->ImageFileName(),
+                       widthResolutionTarget,
+                       heightResolutionTarget);
+            }
+        else
+            {
+            // all decoders should be able to do 1/2, 1/4, 1/8 DCT Scaling
+            // calculate nearest half size for the decoder-downscaled bitmap
+            // halve image width&height to size which is closest larger match
+            // of the bitmap size
+            TInt halvedWidth = bitmapSize.Size().iWidth;
+            TInt halvedHeight = bitmapSize.Size().iHeight;
+            TInt halveFactor = 1; // this limits the halving to 1/8 max
+            while ( ((halvedWidth >> 1) > widthResolutionTarget) &&
+                    ((halvedHeight >> 1) > heightResolutionTarget)
+                    && (halveFactor << 1) <= 8)
+                {
+                halveFactor <<= 1;
+                }
+            halvedWidth = halvedWidth / halveFactor;
+            halvedHeight = halvedHeight / halveFactor;
+            // .. the bitmap will be downscaled further to the correct
+            // dimensions by ImageLoadingCompleteL after the bitmap has been decoded
+            HUI_DEBUG4(_L("CHuiTextureManager::DoLoadNext() - Halving image %S size to %ix%i (factor %i)."),
+                       &texture->ImageFileName(),
+                       halvedWidth,
+                       halvedHeight, halveFactor);
+            widthResolutionTarget = halvedWidth;
+            heightResolutionTarget = halvedHeight;
+            }
+        }
+    else
+        {
+        // either multi-segmented or no need for scaling..
+        HUI_DEBUG(_L("CHuiTextureManager::DoLoadNext() - Decoder-based downscaling not required/possible."));
+        }
+
+    if ( textureAnimationState )
+        {
+        // we convert subframe completely
+        widthResolutionTarget = bitmapSize.Size().iWidth;
+        heightResolutionTarget = bitmapSize.Size().iHeight;
+        }
+
+    if (!(entry.iLoading->iFlags & EHuiTextureUploadFlagRetainColorDepth) && iBitmap->DisplayMode()!=EColor64K)
+        {
+        // (Re)Create the bitmap in EColor64K (16bit) mode to save memory
+        iBitmap->Create(TSize(widthResolutionTarget, heightResolutionTarget), EColor64K);
+        }
+    else if ((entry.iLoading->iFlags & EHuiTextureUploadFlagRetainColorDepth) && iBitmap->DisplayMode()==EColor64K)
+        {
+        // (Re)Create the bitmap in EColor16MU (24bit) mode retain the color information
+        iBitmap->Create(TSize(widthResolutionTarget, heightResolutionTarget), EColor16MU);
+        }
+    else
+        {
+        // no need to recreate the bitmap, but assign the new size!
+        iBitmap->Resize(TSize(widthResolutionTarget, heightResolutionTarget));
+        }
+
+    if (iBitmap->DisplayMode()==EColor64K)
+        {
+        HUI_DEBUG(_L("CHuiTextureManager::DoLoadNext() - Decoding to 16bit image to conserve memory."));
+        }
+    // Decode ( and rescale ) to bitmap.
+    if(entry.iHasAlpha)
+        {
+        // set the alpha channel bitmap to the same size than the color bitmap
+        iMaskBitmap->Resize(TSize(widthResolutionTarget, heightResolutionTarget));
+        entry.iDecoder->Convert(&iStatus, *iBitmap, *iMaskBitmap, frameToBeLoaded);
+        }
+    else
+        {
+        // Save some memory by making the unused alpha channel bitmap
+        // very small.
+        iMaskBitmap->Resize(TSize(4, 4));
+        entry.iDecoder->Convert(&iStatus, *iBitmap, frameToBeLoaded);
+        }
+
+    // Wait for completion.
+    SetActive();
+
+    HUI_DEBUG1(_L("CHuiTextureManager::DoLoadNext() - Exiting, toc %.2f sec"), CHuiStatic::Toc(2));
+    }
+
+CHuiTextureAnimationState* CHuiTextureManager::CreateAnimationStateL( 
+        TInt aGroupId, const TDesC& aImageFile, 
+        TInt aFrameNumber, TInt aFrameCount )
+    {
+    CHuiTextureAnimationState* result = FindAnimationState( aGroupId );
+    
+    TBool recreate = !result || !aFrameNumber;
+    if ( !recreate )
+        {
+        // result != NULL => check if result is animation state of some
+        // previous frame
+        recreate = 
+            !result->CheckIfCanProduce( aImageFile, aFrameNumber, aFrameCount );
+        }
+        
+    if ( recreate )
+        {
+        // First frame, let's just recreate animation state.
+        RemoveAnimationState( result );
+        result = NULL;
+        
+        result = CHuiTextureAnimationState::NewL( 
+            aGroupId, aImageFile, aFrameCount );
+        CleanupStack::PushL( result );
+        iAnimations.AppendL( result );
+        CleanupStack::Pop( result );
+        }
+        
+    return result;
+    }
+
+CHuiTextureAnimationState* CHuiTextureManager::FindAnimationState( 
+        TInt aGroupId )
+    {
+    CHuiTextureAnimationState* result = NULL;
+    const TInt count = iAnimations.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        CHuiTextureAnimationState* state = iAnimations[ i ];
+        if ( state->OwnerTextureGroupId() == aGroupId )
+            {
+            result = state;
+            break;
+            }
+        }
+    return result;
+    }
+
+void CHuiTextureManager::RemoveAnimationState( 
+        CHuiTextureAnimationState* aState )
+    {
+    if ( aState )
+        {        
+        TInt pos = iAnimations.Find( aState );
+        if ( pos != KErrNotFound )
+            {
+            iAnimations.Remove( pos );
+            }
+        delete aState;
+        }
+    }
+
+TBool CHuiTextureManager::FindGroupIdByTextureId( 
+        TInt aTextureId, TInt& aGroupId ) const
+    {
+    TBool found = EFalse;
+    const TInt count = iAnimatedTextureGroupItems.Count();
+    TInt i = 0;
+    while ( !found && ( i < count ) )
+        {
+        const TAnimatedTextureGroupItem& item = iAnimatedTextureGroupItems[ i ];
+        if ( item.iTextureId == aTextureId )
+            {
+            found = ETrue;
+            aGroupId = item.iGroupId;
+            }
+        i++;
+        }
+    return found;
+    }
+
+TBool CHuiTextureManager::NeedsAnimationState( const CImageDecoder& aDecoder )
+    {
+    // If this image contains any special image disposal methods, then
+    // use animation state.
+    
+    const TInt frames = aDecoder.FrameCount();
+    TBool result = EFalse;
+    
+    for ( TInt i = 0; !result && i < frames; ++i )
+        {
+        const TFrameInfo& info = aDecoder.FrameInfo( i );
+        const TUint32 disposalFlags =
+            info.iFlags & 
+                ( TFrameInfo::ELeaveInPlace |
+                  TFrameInfo::ERestoreToBackground |
+                  TFrameInfo::ERestoreToPrevious );
+                  
+        result = result || disposalFlags;
+        }
+    
+    return result;
+    }
+
+void CHuiTextureManager::DoUnload(TInt index)
+    {
+    HUI_ASSERT(index>=0 && index < iTextures.Count());
+    CHuiTexture * t = iTextures[index]->iTexture;
+    if (t == NULL)
+        {
+        HUI_DEBUG1(_L("CHuiTextureManager::UnloadTexture() - Not unloading a NULL texture at index %i."), index);
+        return;
+        }
+
+    HUI_DEBUG3(_L("CHuiTextureManager::UnloadTexture() - Unloading texture \"%S\" id %i at index %i."), &t->ImageFileName(), iTextures[index]->iId, index);
+    // Is this in the queue?
+    if(IsInLoadQueue(t))
+        {
+        // Not loaded yet, can't unload. Mark it as unloaded, though,
+        // so it will be discarded when the loading completes.
+        for(TInt i = 0; i < iLoadQueue.Count(); ++i)
+            {
+            if(iLoadQueue[i].iLoading->iTexture == t)
+                {
+                HUI_DEBUG1(_L("CHuiTextureManager::UnloadTexture() - Marking \"%S\" as unloaded (still in the load queue). "), &t->ImageFileName());
+                iLoadQueue[i].iUnloaded = ETrue;
+                return;
+                }
+            }
+        }
+
+    // Just delete the contents of the texture
+    t->Reset();
+    HUI_ASSERT(!t->HasContent());
+    }
+
+
+EXPORT_C TInt CHuiTextureManager::RunError( TInt /*aError*/ )
+    {
+    // Should never be called, RunL is responsible for handling all error cases
+    HUI_ASSERT(EFalse);
+    return KErrNone;
+    }
+
+
+EXPORT_C void CHuiTextureManager::RunL()
+    {
+    if( iReleaseState == EReleased || 
+        iReleaseState == EPartiallyReleased ||
+        iReleaseState == EReleasing )
+        {
+        // Set the loading state to idle, but do not notify observers of this,
+        // since we are released.
+        // This has to be done so that unfinished loading can be restarted in
+        // the RestoreL().
+        iState = EIdle;        
+        // Leave the texture to the load queue and load it again after restore.
+        return;
+        }
+    
+    TInt status = iStatus.Int();
+    
+    if ( status == KErrNone )
+        {
+        status = ImageLoadingContinue();
+        if ( status > KErrNone )
+            {
+            HUI_DEBUG(_L("CHuiTextureManager::RunL() - Animation: Continue loading."));
+            return;
+            }
+        }
+    
+    // remove the loaded entry from the queue
+    SLoadQueueEntry entry = PopLoadedQueueEntry();
+
+    // Image loading has been completed.
+    iState = EIdle;
+
+    // check status
+    if( status == KErrNone )
+        {
+        // ok, we have a loaded image, but
+        // we still need to do texture uploads
+        // and possibly some image conversions
+        TRAPD( err, ImageLoadingCompleteL(entry) );
+
+        if(err != KErrNone)
+            {
+            delete iAnimationWithoutGroup;
+            iAnimationWithoutGroup = NULL;
+            
+            switch (err)
+                {
+                case KErrNoMemory:
+                    {
+                    HUI_DEBUG3( _L("CHuiTextureManager::RunL() - ERROR! Failed to convert image to texture. Out of memory in ImageLoadingCompleteL(). Source image was  \"%S\" (id %i). Trying to continue with %i items in the queue.."),
+                                &(entry.iLoading->iTexture->ImageFileName()), entry.iLoading->iId, iLoadQueue.Count() );
+                    break;                                
+                    }
+                default:
+                    {
+                    HUI_DEBUG4( _L("CHuiTextureManager::RunL() - Error %i occurred during image upload/conversion to texture. Image filename was: \"%S\" (id %i). Trying to continue with %i items in the queue.."),
+                                err, &(entry.iLoading->iTexture->ImageFileName()), entry.iLoading->iId, iLoadQueue.Count() );
+                    break;
+                    }
+                }
+            // Notify observers about the image upload error
+            NotifyTextureLoaded(*entry.iLoading->iTexture, entry.iLoading->iId, err);
+            }
+        }
+    else
+        {
+        HUI_DEBUG2( _L("CHuiTextureManager::RunL() - Image decoding error while decoding \"%S\" (id %i). Bypassing image.."), &(entry.iLoading->iTexture->ImageFileName()), entry.iLoading->iId);
+
+        delete iAnimationWithoutGroup;
+        iAnimationWithoutGroup = NULL;
+
+        // notify sb of failed image load!
+        NotifyTextureLoaded(*entry.iLoading->iTexture, entry.iLoading->iId, status);
+        }
+
+    // Continue loading entries.
+    StartLoading();
+
+    if(iLoadQueue.Count() == 0)
+        {
+        HUI_DEBUG(_L("CHuiTextureManager::RunL() - No more images to load, exiting.."));
+        }
+    }
+
+
+EXPORT_C void CHuiTextureManager::DoCancel()
+    {
+    if(iLoadQueue.Count() > 0)
+        {
+        iLoadQueue[0].iDecoder->Cancel();
+        }
+        
+    iState = EIdle;
+    }
+
+TInt CHuiTextureManager::ImageLoadingContinue()
+    {
+    TInt status = KErrNone;
+    
+    const SLoadQueueEntry& entry = iLoadQueue[0];
+    
+    TInt groupId = 0;
+    CHuiTextureAnimationState* state = NULL;
+    if ( iAnimationWithoutGroup )
+        {
+        state = iAnimationWithoutGroup;
+        }
+    else if ( FindGroupIdByTextureId( entry.iLoading->iId, groupId ) )
+        {
+        state = FindAnimationState( groupId );
+        }
+    else
+        {
+        // state = NULL;
+        }
+        
+    if ( state && 
+         ( state->GetNextFrameNumber() != entry.iLoading->iFrameNumber ) )
+        {
+        // Someone has asked animated frames not in sequence - 
+        // very inefficient!
+        HUI_DEBUG(_L("CHuiTextureManager::ImageLoadingContinue: Frames not requested in sequence."));
+        TRAP( status, 
+            state->ProceedWithoutNextFrameL( 
+                iBitmap, 
+                entry.iHasAlpha ? iMaskBitmap : NULL ) );
+
+        if ( status == KErrNone )
+            {
+            // Image loading has been completed.
+            iState = EIdle;            
+            StartLoading();
+            status = 1; // indicate that started loading.
+            }
+        }
+    
+    return status;
+    }
+
+void CHuiTextureManager::ImageLoadingCompleteL(SLoadQueueEntry& aEntry)
+    {
+    CHuiTexture* tex = aEntry.iLoading->iTexture;
+    HUI_ASSERT(tex);
+    tex->iFrameNumber = aEntry.iLoading->iFrameNumber;
+    tex->iFrameCount = aEntry.iLoading->iFrameCount;
+    tex->iFrameInterval = aEntry.iLoading->iFrameInterval;
+
+    if(iReleaseState != ENormal)
+        {
+        HUI_DEBUG1(_L("CHuiTextureManager::ImageLoadingCompleteL() - Unable to upload bitmap data for \"%S\". Texture manager has been released."), &tex->ImageFileName());
+        return;
+        }
+       
+    if ( tex->iFrameCount > 1 )
+        {
+        ProcessAnimatedFrameL( aEntry );
+        }
+    TBool hasAlpha = aEntry.iHasAlpha;
+    
+    delete iAnimationWithoutGroup;
+    iAnimationWithoutGroup = NULL;
+
+    TSize* maxTexSize = &aEntry.iLoading->iMaxTextureSize;    
+    if(((maxTexSize->iWidth != 0) && (maxTexSize->iHeight != 0)) && iBitmap->SizeInPixels() != aEntry.iLoading->iMaxTextureSize )
+        {
+        // The decoder failed to constrain the texture dimensions properly, due to its internal limitations.
+        // So we need to scale the texture(s) down further to the correct size.      
+        
+        CFbsBitmap* dest = new (ELeave) CFbsBitmap();
+        CleanupStack::PushL( dest );
+        User::LeaveIfError( dest->Create(*maxTexSize, iBitmap->DisplayMode()) );
+        HuiUtil::ScaleFbsBitmapL(*iBitmap, *dest);
+        CleanupStack::Pop( dest );
+        delete iBitmap;
+        iBitmap = dest;
+
+        if( hasAlpha )
+            {
+            // Scale the alpha as well.
+            dest = new (ELeave) CFbsBitmap();   
+            CleanupStack::PushL( dest );
+            User::LeaveIfError(
+                dest->Create(*maxTexSize, iMaskBitmap->DisplayMode()) );     
+            HuiUtil::ScaleFbsBitmapL(*iMaskBitmap, *dest);
+            CleanupStack::Pop( dest );
+            delete iMaskBitmap;
+            iMaskBitmap = dest;
+            }                      
+        }        
+
+    HUI_DEBUG3(_L("CHuiTextureManager::ImageLoadingCompleteL() - Loading complete for \"%S\". Uploading %ix%i FBS bitmap to texture.."),
+               &tex->ImageFileName(),
+               iBitmap->SizeInPixels().iWidth,
+               iBitmap->SizeInPixels().iHeight);
+
+    // Upload without compression.
+    tex->UploadL(*iBitmap,
+                (hasAlpha? iMaskBitmap: NULL),
+                 aEntry.iLoading->iFlags);
+
+    // Store bits per pixel info to calculate texture memory usage
+    aEntry.iLoading->iBitDepth = TDisplayModeUtils::NumDisplayModeBitsPerPixel( iBitmap->DisplayMode() );
+    if( iMaskBitmap )
+        {
+        aEntry.iLoading->iBitDepth = aEntry.iLoading->iBitDepth + 
+        TDisplayModeUtils::NumDisplayModeBitsPerPixel( iMaskBitmap->DisplayMode() );
+        }
+    
+    // Now we're setting up the real texture, no more placeholder needed
+    tex->SetPlaceholder(NULL);
+
+    HUI_DEBUG2(_L("CHuiTextureManager::ImageLoadingCompleteL() - ... Upload done. Setting original size of %ix%i pixels."),
+               aEntry.iOriginalSize.iWidth,
+               aEntry.iOriginalSize.iHeight);
+
+    // (Re)set the original size of the image as the logical size
+    tex->SetSize(aEntry.iOriginalSize);
+
+    // Notify the observers of loaded texture
+    NotifyTextureLoaded(*tex, aEntry.iLoading->iId, KErrNone);
+
+    // Unload, if the unloading was already requested while loading!
+    if(aEntry.iUnloaded)
+        {
+        UnloadTexture(tex->ImageFileName(),tex->iFrameNumber);
+        }
+
+    HUI_DEBUG(_L("CHuiTextureManager::ImageLoadingCompleteL() - Done. "));
+    }
+
+void CHuiTextureManager::ProcessAnimatedFrameL(SLoadQueueEntry& aEntry)
+    {
+    // Animated file - produce next frame.
+    CFbsBitmap* frameBitmap = NULL;
+    CFbsBitmap* frameMask = NULL;
+
+    // ImageFileName() does not include image path
+    CHuiTextureAnimationState* state = NULL;
+    TInt groupId = 0;
+    if ( iAnimationWithoutGroup )
+        {
+        state = iAnimationWithoutGroup;
+        }
+    else if ( FindGroupIdByTextureId( aEntry.iLoading->iId, groupId ) )
+        {
+        state = FindAnimationState( groupId );
+        }
+
+    if ( !state )
+        {
+        return;
+        }
+
+    HUI_DEBUG1(_L("CHuiTextureManager::ProcessAnimatedFrameL: Producing next frame (%d)."), 
+        state->GetNextFrameNumber() );
+
+    state->ProduceNextFrameL( 
+        frameBitmap, frameMask, 
+        iBitmap, aEntry.iHasAlpha ? iMaskBitmap : NULL );
+
+    HUI_DEBUG2(_L("CHuiTextureManager::ProcessAnimatedFrameL: Next frame produced (%x, %x)."),
+        frameBitmap, frameMask );
+    
+    aEntry.iHasAlpha = ( frameMask != NULL );
+    if ( frameBitmap != iBitmap )
+        {
+        delete iBitmap;
+        iBitmap = frameBitmap;
+        }
+        
+    if ( frameMask && (frameMask != iMaskBitmap) )
+        {
+        delete iMaskBitmap;
+        iMaskBitmap = frameMask;
+        }        
+    }
+
+EXPORT_C TInt CHuiTextureManager::LoadQueueCount() const
+    {
+    return iLoadQueue.Count();
+    }
+
+
+EXPORT_C void CHuiTextureManager::AdvanceTime(TReal32 aElapsedTime) const
+    {
+    for(TInt i = 0; i < iAnimatedTextures.Count(); ++i)
+        {
+        iAnimatedTextures[i].AdvanceTime(aElapsedTime);
+        }
+    NotifyTextureAutoSizeObservers();
+    // Write total memory consumed on rendering textures as an info message,
+    // if feature is enabled from central repository Rnd flag
+    if ( iEnableTexMemCalculation )
+    	{
+    	TextureMemUsage(); 
+    	}    
+    }
+
+
+EXPORT_C void CHuiTextureManager::SetProcessor(CHuiTextureProcessor* aProcessor)
+    {
+    // Since we have ownership of the processor, delete the previous one if
+    // there is one.
+    if(iProcessor)
+        {
+        delete iProcessor;
+        iProcessor = NULL;
+        }
+
+    iProcessor = aProcessor;
+    }
+
+
+EXPORT_C CHuiTextureProcessor& CHuiTextureManager::Processor()
+    {
+    if(!iProcessor)
+        {
+        THuiPanic::Panic(THuiPanic::ETextureManagerNoProcessor);
+        }
+    return *iProcessor;
+    }
+
+
+void CHuiTextureManager::CancelLoadingOfTexture(CHuiTexture& aTexture)
+    {
+    for(TInt i = 0; i < iLoadQueue.Count(); ++i)
+        {
+        if(iLoadQueue[i].iLoading->iTexture == &aTexture)
+            {
+            // Texture found from the load queue.
+            if(i == 0 && iState == ELoading)
+                {
+                // Texture is currently loading
+                Cancel();
+                PopLoadedQueueEntry();
+                StartLoading();                
+                }
+            else
+                {
+                // Delete the decoder and remove entry.
+                delete iLoadQueue[i].iDecoder;
+                iLoadQueue.Remove(i);
+                }
+            break;
+            }
+        }
+    }
+
+
+void CHuiTextureManager::NotifyStateChange() const
+    {
+    for(TInt index = 0; index < iStateObservers.Count(); ++index)
+        {
+        iStateObservers[index].TextureManagerStateChanged(*this);
+        }
+    }
+
+
+EXPORT_C void CHuiTextureManager::NotifyTextureLoaded(CHuiTexture& aTexture,
+                             TInt aTextureId,
+                             TInt aErrorCode) const
+    {
+    aTexture.SetTextureChanged(ETrue);
+    for(TInt index = 0; index < iLoadObservers.Count(); ++index)
+        {
+        iLoadObservers[index].TextureLoadingCompleted(aTexture, aTextureId, aErrorCode);
+        }
+    }
+
+EXPORT_C CHuiTextureManager::CTextureEntry * CHuiTextureManager::TextureEntry(TInt aIndex)
+    {
+    // check limits
+    if ( aIndex < iTextures.Count() )
+        {
+        return iTextures[aIndex];
+        }
+    else
+        {
+        return NULL;
+        }
+    }
+
+EXPORT_C TInt CHuiTextureManager::TextureEntryCount() const
+    {
+    return iTextures.Count();
+    }
+
+EXPORT_C TBool CHuiTextureManager::Release()
+    {
+    HUI_DEBUG(_L("CHuiTextureManager::Release() - Called."));
+
+    HUI_ASSERT(iReleaseState == ENormal);
+    iReleaseState = EReleasing;
+    
+    TBool allReleased = ETrue; // by default, all texures are released.
+
+    // Release all textures. Use an order inverse to creation order.
+    for(TInt i = iTextures.Count() - 1; i >= 0; --i)
+        {
+        CHuiTexture * tex = iTextures[i]->iTexture;
+        if (tex)
+            {
+            // This is called when application goes into the backgrounf
+            // If release priority is set to 0, the texture should not be released.
+            if ( tex->Priority() == 0 )
+                {
+                HUI_DEBUG5(_L("CHuiTextureManager::Release() - Not releasing priority texture 0x%x (\"%S\", id: %i) [%i/%i]"),
+                          tex, &(tex->ImageFileName()), iTextures[i]->iId, i+1, iTextures.Count());
+                allReleased = EFalse;
+                }
+            else
+                {     
+                HUI_DEBUG5(_L("CHuiTextureManager::Release() - Releasing texture 0x%x (\"%S\", id: %i) [%i/%i]"),
+                          tex, &(tex->ImageFileName()), iTextures[i]->iId, i+1, iTextures.Count());
+                tex->Release();
+                }
+            }
+        else
+            {
+            HUI_DEBUG4(_L("CHuiTextureManager::Release() - Not releasing unloaded texture 0x%x, id: %i) [%i/%i]"),
+                          tex, iTextures[i]->iId, i+1, iTextures.Count());                
+            }
+        }
+
+    HUI_DEBUG(_L("CHuiTextureManager::Release() - Release processor."));
+
+    // Release texture processor.
+    if(iProcessor)
+        {
+        iProcessor->Release();
+        }
+
+    HUI_ASSERT(iReleaseState == EReleasing);
+    if ( allReleased )
+        {
+        HUI_DEBUG(_L("CHuiTextureManager::Release() - Exiting (EReleased)."));
+        iReleaseState = EReleased;
+        }
+    else
+        {
+        HUI_DEBUG(_L("CHuiTextureManager::Release() - Exiting (EPartiallyReleased)."));
+        iReleaseState = EPartiallyReleased;
+        }
+    return allReleased;
+    }
+
+
+EXPORT_C void CHuiTextureManager::RestoreL()
+    {
+    HUI_DEBUG(_L("CHuiTextureManager::RestoreL() - Called."));
+
+    HUI_ASSERT(iReleaseState == EReleased || iReleaseState == EPartiallyReleased );
+    iReleaseState = ERestoring;
+
+    // Restore texture processor.
+    if(iProcessor)
+        {
+        iProcessor->RestoreL();
+        }
+
+    // Restore all textures. Use same order as in which the textures were created.
+    for(TInt i = 0; i < iTextures.Count(); ++i)
+        {
+        CHuiTexture * tex = iTextures[i]->iTexture;
+        if (tex)
+            {
+            if ( tex->HasContent() )
+                {
+                HUI_DEBUG5(_L("CHuiTextureManager::RestoreL() - Alredy has content texture 0x%x (\"%S\", id: %i) [%i/%i]"),
+                          tex, &(tex->ImageFileName()), iTextures[i]->iId, i+1, iTextures.Count());
+                }
+            else
+                {    
+                HUI_DEBUG5(_L("CHuiTextureManager::RestoreL() - Restoring texture 0x%x (\"%S\", id: %i) [%i/%i]"),
+                          tex, &(tex->ImageFileName()), iTextures[i]->iId, i+1, iTextures.Count());
+                // Restore the texture.
+                tex->RestoreL();
+                }
+            }
+        else
+            {
+            HUI_DEBUG4(_L("CHuiTextureManager::RestoreL() - Not restoring unloaded texture 0x%x, id: %i) [%i/%i]"),
+                          tex, iTextures[i]->iId, i+1, iTextures.Count());                
+            }
+        }
+
+    // Restart loading of textures that still might be in the load queue.
+    StartLoading();
+
+    HUI_ASSERT(iReleaseState == ERestoring);
+    iReleaseState = ENormal;
+    }
+
+EXPORT_C void CHuiTextureManager::NotifySkinChangedL()
+    {
+    for(TInt i = iTextures.Count()-1; i >= 0; i--)
+        {
+        CHuiTexture * tex = iTextures[i]->iTexture;
+        if (tex &&
+            tex->HasContent() &&
+            tex->IsSkinContent())
+            {
+            tex->Release();
+            tex->RestoreL();    
+            }
+        }            
+    }
+
+EXPORT_C TInt CHuiTextureManager::AddAnimatedTextureGroupL( 
+        const RArray<TInt>& aTextureIds )
+    {
+    const TInt count = aTextureIds.Count();
+    
+    // Zero ids are not allowed here
+    for ( TInt j = 0; j < count; j++ )
+        {
+        if ( !aTextureIds[ j ] ) 
+            {
+            User::Leave( KErrNotSupported );
+            }
+        }
+        
+    TInt result = 0;
+    if ( count )
+        {
+        result = aTextureIds[ 0 ]; 
+    
+        // Reserve space so next loop cannot fail.
+        iAnimatedTextureGroupItems.ReserveL( 
+            iAnimatedTextureGroupItems.Count() + aTextureIds.Count() );
+    
+        TAnimatedTextureGroupItem item;
+        item.iGroupId = result;
+        
+        for ( TInt i = 0; i < count; i++ )
+            {
+            item.iTextureId = aTextureIds[ i ];
+            
+            (void)iAnimatedTextureGroupItems.
+                Append( item ); // ought not to fail due to Reserve.
+            }
+        }
+        
+    return result;
+    }
+    
+EXPORT_C void CHuiTextureManager::RemoveAnimatedTextureGroup( TInt aGroupId )
+    {
+    // Remove animated texture group items.
+    const TInt count = iAnimatedTextureGroupItems.Count();
+    for ( TInt i = count - 1; i >= 0; --i )
+        {
+        if ( iAnimatedTextureGroupItems[ i ].iGroupId == aGroupId )
+            {
+            iAnimatedTextureGroupItems.Remove( i );
+            }
+        }
+    
+    RemoveAnimationState( FindAnimationState( aGroupId ) );
+    }
+
+// CHuiTextureManager::CTextureEntry
+
+CHuiTextureManager::CTextureEntry::CTextureEntry(
+    TInt aId,
+    const TFileName & aFileName,
+    const TSize& aMaxTextureSize,
+    THuiTextureUploadFlags aFlags,
+    TInt aFrameNumber )
+    : iId(aId), iFileName(NULL),
+      iTexture(NULL),
+      iMaxTextureSize(aMaxTextureSize), iFlags(aFlags),
+      iBitmapProvider(NULL),
+      iFrameNumber(aFrameNumber),
+      iFrameCount(0),
+      iFrameInterval(0)
+    {
+    SetFileName(aFileName);
+    }
+    
+CHuiTextureManager::CTextureEntry::CTextureEntry(TInt aId, CHuiTexture * aTexture)
+                      : iId(aId),
+                        iFileName(NULL),
+                        iTexture(aTexture),
+                        iMaxTextureSize(TSize(0,0)),
+                        iFlags(EHuiTextureUploadFlagDefault),
+                        iBitmapProvider(NULL),
+                        iFrameNumber(0),
+                        iFrameCount(0),
+                        iFrameInterval(0)
+    {
+    }
+            
+CHuiTextureManager::CTextureEntry::CTextureEntry(const CTextureEntry &aSrc)
+                      : iId(aSrc.iId),
+                        iFileName(NULL),
+                        iTexture(aSrc.iTexture),
+                        iMaxTextureSize(aSrc.iMaxTextureSize),
+                        iFlags(aSrc.iFlags),
+                        iBitmapProvider(NULL),
+                        iFrameNumber(aSrc.iFrameNumber),
+                        iFrameCount(0),
+                        iFrameInterval(0)
+    {
+    SetFileName(*aSrc.iFileName);
+    }
+            
+CHuiTextureManager::CTextureEntry & CHuiTextureManager::CTextureEntry::operator=(const CTextureEntry &aSrc)
+    {
+    if ( this == &aSrc )
+        {
+        return *this;
+        }
+            
+    iId = aSrc.iId;
+    if (aSrc.iFileName != NULL)
+        {
+        SetFileName(*aSrc.iFileName);
+        }
+    iMaxTextureSize = aSrc.iMaxTextureSize;
+    iFlags = aSrc.iFlags;
+    iBitmapProvider = aSrc.iBitmapProvider;
+    iFrameNumber = aSrc.iFrameNumber;
+    iFrameCount = aSrc.iFrameCount;
+    iFrameInterval = aSrc.iFrameInterval;
+    return *this;
+    }
+            
+EXPORT_C CHuiTextureManager::CTextureEntry::~CTextureEntry()
+    {
+    delete iFileName; 
+    iFileName = NULL;
+    // CHuiTextureManager deletes the iTexture
+    }
+    
+void CHuiTextureManager::CTextureEntry::SetFileName(const TFileName & aFileName)
+    {
+    delete iFileName;
+    iFileName = NULL;
+    if (aFileName.Length()>0)
+        {
+        // this might fail and therefore the iFileName is left as NULL.
+        iFileName = aFileName.Alloc();
+        }
+    }
+
+void CHuiTextureManager::CTextureEntry::TextureContentUploaded(CHuiTexture& /*aTexture*/)
+    {
+    }
+void CHuiTextureManager::CTextureEntry::TextureContentReleased(CHuiTexture& /*aTexture*/)
+    {
+    }
+void CHuiTextureManager::CTextureEntry::RestoreTextureContentL(CHuiTexture& aTexture)
+    {
+    HUI_DEBUG(_L("CHuiTextureManager::CTextureEntry::RestoreTextureContentL() - Called for entry 0x%x (id: %i)."));
+    if (iBitmapProvider != NULL)
+        {
+        HUI_DEBUG3(_L("CHuiTextureManager::CTextureEntry::RestoreTextureContentL() - Using bitmap provider 0x%x to recreate content for texture 0x%x (id: %i).."), iBitmapProvider, &aTexture, iId);
+        CFbsBitmap* bitmap = NULL;
+        CFbsBitmap* maskBitmap = NULL;
+
+        // call the bitmapProvider method to load the bitmaps
+        iBitmapProvider->ProvideBitmapL(iId, bitmap, maskBitmap);
+
+        if (maskBitmap)
+            {
+            CleanupStack::PushL(maskBitmap);
+            }
+        
+        if (!bitmap)
+            {
+            User::Leave(KErrArgument);
+            }
+        else
+            {
+            CleanupStack::PushL(bitmap);
+            }
+        
+        // recreate texture content..
+
+        // Let the texture know its size as soon as possible.
+        aTexture.SetSize(bitmap->SizeInPixels());
+
+        // Enable texture shadow.
+        aTexture.EnableShadow((iFlags & EHuiTextureUploadFlagGenerateShadow) != 0);
+
+        // Upload!    
+        TSize bitmapSize = bitmap->SizeInPixels();
+    	if (bitmapSize.iWidth != 0 && bitmapSize.iHeight != 0)
+    	    {
+    		if (iFlags & EHuiTextureFlagAllowDirectBitmapUsage) 
+    			{
+       			aTexture.UploadDirectL(*bitmap, maskBitmap, iFlags);		
+    			}
+    		else 
+    			{
+            	aTexture.UploadL(*bitmap, maskBitmap, iFlags);
+    			}
+    	    }
+        // Clean up owned bitmaps
+        CleanupStack::PopAndDestroy(bitmap);        
+        if (maskBitmap)
+            {
+            CleanupStack::PopAndDestroy(maskBitmap);        
+            }       
+        }
+    // check for file-based restore
+    else if (iFileName != NULL)
+        {
+        HUI_DEBUG2(_L("CHuiTextureManager::CTextureEntry::RestoreTextureContentL() - Reloading texture 0x%x from \"%S\".."), &aTexture, iFileName);
+        CHuiStatic::Env().TextureManager().LoadTextureL(*iFileName, iMaxTextureSize, iFlags, iId);
+        return;
+        }
+    else
+        {
+        // for PC lint
+        }
+    }
+
+void CHuiTextureManager::NotifyTextureAutoSizeObservers() const
+    {
+    if (!iTextureAutoSizingEnabled)
+        {
+        return;
+        }
+    
+    TBool somethingWasReported = EFalse;
+    TBool anyAutoSizedTexturesExist = EFalse;
+    
+    for(TInt index = iTextures.Count() - 1; index >= 0; --index)
+        {
+        CTextureEntry * entry = iTextures[index];
+        if (entry->iTexture)
+            {
+            if (entry->iTexture->IsAutoSizeCalculationEnabled())
+                {
+                anyAutoSizedTexturesExist = ETrue;
+                
+                // Calculate preferred size from the previous frame data
+                THuiRealSize preferredSize = entry->iTexture->CalculateAutoSize();
+                
+                // Notify observers if preferred size has changed
+                if (entry->iTexture->CalculatedAutoSizeChanged())
+                    {
+                    HUI_DEBUG3(_L("CHuiTextureManager::NotifyTexturePreferredSizeObservers - To be notified id: %i, width: %f , height %f"), entry->iId, preferredSize.iWidth, preferredSize.iHeight);                    
+
+                    // Notify observers. For now ignore return values.
+                    for(TInt index = 0; index < iTextureAutoSizeObservers.Count(); ++index)
+                        {
+                        iTextureAutoSizeObservers[index].PreferredSizeChanged(*entry->iTexture, entry->iId, preferredSize);
+                        somethingWasReported = ETrue;
+                        }            
+                    }
+                
+                // Restart preferred size calculations for next frame   
+                entry->iTexture->ResetAutoSizeCalculation();        
+                }
+            }
+        }
+    
+    if (somethingWasReported)
+        {
+        for(TInt index = 0; index < iTextureAutoSizeObservers.Count(); ++index)
+            {
+            iTextureAutoSizeObservers[index].PreferredSizeReportCompleted();                
+            }                        
+        }
+
+    // Keep checking autosized textures only if those exist. 
+    // New textures will enable flag when needed.
+    iTextureAutoSizingEnabled = anyAutoSizedTexturesExist;
+    }
+
+EXPORT_C void CHuiTextureManager::ClearChangedTextures()
+    {
+    if (iHasChangedTextures)
+        {
+        for(TInt index = iTextures.Count() - 1; index >= 0; --index)
+            {
+            CTextureEntry * entry = iTextures[index];
+            if (entry->iTexture)
+                {
+                entry->iTexture->TextureClearChanged();
+                }
+            }
+        iHasChangedTextures = EFalse;        
+        }
+    }
+    
+EXPORT_C void CHuiTextureManager::SetHasChangedTextures()
+    {
+    iHasChangedTextures = ETrue;    
+    }
+
+/*
+ * Enables/Disables memory usage calculation.
+ */
+EXPORT_C void CHuiTextureManager::EnableTexMemoryCalculation( TBool aEnableTeMemCal )
+	{
+	iEnableTexMemCalculation = aEnableTeMemCal;
+	}
+
+/*
+ * Calculates memory used by texturemanager to store all the textures.
+ * Texture memory is calculated as ( Texture area ) * ( bits per pixel )
+ * 
+ * This routine prints info message stating toal no of textures and memory consuption by them.
+ */
+void CHuiTextureManager::TextureMemUsage() const
+	{
+	TReal32 totalMemUsage = 0;
+	TReal32 avgBitDepth = 0;
+    for(TInt i = 0; i < iTextures.Count(); ++i)
+        {
+        if( iTextures[i]->iTexture )
+            {            
+            TSize size = iTextures[i]->iTexture->Size();         
+            totalMemUsage = totalMemUsage + size.iWidth * size.iHeight * iTextures[i]->iBitDepth;   
+            avgBitDepth = avgBitDepth + iTextures[i]->iBitDepth;
+            }        
+        }
+    
+    avgBitDepth = avgBitDepth/iTextures.Count();
+    totalMemUsage = totalMemUsage/8000000;
+    TBuf<300> buf;
+    buf.FillZ();
+    buf.AppendNum( totalMemUsage, TRealFormat( 8, 4 ) );
+    buf.Append(_L( "MB;By:" ) );
+    buf.AppendNum( iTextures.Count() );
+    buf.Append(_L( ";BD:" ) );
+    buf.AppendNum( avgBitDepth );
+    User::InfoPrint( buf );      
+	}
+TInt CHuiTextureManager::EstimatedTextureMemUsage(TInt aAverageBitsPerPixel) const
+    {
+    TReal32 averageBytesPerPixel =  TReal32(aAverageBitsPerPixel)/8.f;
+	TReal32 totalMemUsage = 0;
+    TInt pixels = 0;
+    for(TInt i = 0; i < iTextures.Count(); ++i)
+        {
+        // TODO: Exclude NVG textures !
+        if( iTextures[i]->iTexture /*&& 
+            iTextures[i]->iTexture->HasContent()*/)
+            {            
+            TSize size = iTextures[i]->iTexture->Size();         
+            pixels += size.iWidth * size.iHeight;                        
+            }        
+        }
+        
+    totalMemUsage = TReal32(pixels) * averageBytesPerPixel;        
+    return totalMemUsage;
+    }
+
+
+
+EXPORT_C void CHuiTextureManager::TextureManagerExtension(const TUid& /*aExtensionUid*/, TAny** aExtensionParams)
+    {
+    // If no extension with given UID was found, indicate it by returning null
+    *aExtensionParams = NULL;
+    }
+
+void CHuiTextureManager::EnableAutoSizeCalculation(TBool aEnable)
+    {
+    iTextureAutoSizingEnabled = aEnable;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiTextureProcessor.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiTextureProcessor. CHuiTextureProcessor 
+*                is the abstract base class for texture processors.
+*
+*/
+
+
+
+#include "uiacceltk/HuiTextureProcessor.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiUtil.h"
+
+
+EXPORT_C CHuiTextureProcessor::CHuiTextureProcessor(CHuiEnv& aEnv)
+        : iEnv(aEnv)
+    {
+    }
+
+EXPORT_C CHuiTextureProcessor::~CHuiTextureProcessor()
+    {
+    }
+    
+
+EXPORT_C CHuiEnv& CHuiTextureProcessor::Env()
+    {
+    return iEnv;
+    }
+
+
+EXPORT_C void CHuiTextureProcessor::Release()
+    {
+    HUI_DEBUG(_L("CHuiTextureProcessor::Release() - Called. -=- NOT IMPLEMENTED -=-"));
+    }
+    
+    
+EXPORT_C void CHuiTextureProcessor::RestoreL()
+    {
+    HUI_DEBUG(_L("CHuiTextureProcessor::RestoreL() - Called. -=- NOT IMPLEMENTED -=-"));
+    }
+
+EXPORT_C void CHuiTextureProcessor::TextureProcessorExtension(const TUid& /*aExtensionUid*/, TAny** aExtensionParams)
+    {
+    // If no extension with given UID was found, indicate it by returning null
+    *aExtensionParams = NULL;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiThemeManager.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiThemeManager class, the class
+*                which is an interface to the ThemeManager component
+*
+*/
+
+
+#include "uiacceltk/HuiThemeManager.h"
+
+#include <utf.h>
+#include "uiacceltk/HuiUtil.h"
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CHuiThemeManager::CHuiThemeManager()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CHuiThemeManager::~CHuiThemeManager()
+    {
+
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CHuiThemeManager* CHuiThemeManager::NewL()
+    {
+    CHuiThemeManager* self = CHuiThemeManager::NewLC();
+    CleanupStack::Pop();
+    return self;        
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CHuiThemeManager* CHuiThemeManager::NewLC()
+    {
+    CHuiThemeManager* self = new (ELeave) CHuiThemeManager();
+    self->ConstructL();
+    CleanupStack::PushL(self);
+    return self;        
+    }
+
+// ---------------------------------------------------------------------------
+// Two phase constructor
+// ---------------------------------------------------------------------------
+//
+void CHuiThemeManager::ConstructL()
+	{
+	iThemeManager = NULL;
+	}
+
+// ---------------------------------------------------------------------------
+// Get Item ID from ThemeManager
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CHuiThemeManager::GetItemID(const TDesC& aColorTable, TAknsItemID& aItemID)
+    {
+    HUI_DEBUG(_L("CHuiThemeManager::GetItemID DO NOT USE THIS FUNCTION"));
+    TRAPD( err, GetItemIdL( aColorTable, aItemID ) );
+    if ( err != KErrNone )
+        {
+        HUI_DEBUG1(_L("CHuiThemeManager::GetItemID error ignored %d" ), err);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// DEPRECATED
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CHuiThemeManager::GetItemIdL(const TDesC& /*aColorTable*/, TAknsItemID& /*aItemID*/)
+	{
+	// Create ThemeManager instance
+	HUI_DEBUG(_L("CHuiThemeManager::GetItemIDL FUNCTIONALITY REMOVED. REFER TO ANTRIKSH PROJECT"));
+	}
+
+
+// ---------------------------------------------------------------------------
+// Get Skin Image parameters
+// ---------------------------------------------------------------------------
+//
+EXPORT_C THuiThemeImageparams CHuiThemeManager::GetSkinImageParams(const TDesC& aSkinLogicalName)
+    {
+    THuiThemeImageparams result;
+    
+    HUI_DEBUG(_L("CHuiThemeManager::GetSkinImageParams DO NOT USE THIS FUNCTION"));
+    TRAPD( err, result = GetSkinImageParamsL( aSkinLogicalName ) );
+    if ( err != KErrNone )
+        {
+        HUI_DEBUG1(_L("CHuiThemeManager::GetSkinImageParams error ignored %d" ), err);
+        }
+    return result;
+    }
+    
+    
+    
+// ---------------------------------------------------------------------------
+// Get Skin Image parameters
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C THuiThemeImageparams CHuiThemeManager::GetSkinImageParamsL(const TDesC& aSkinLogicalName)
+	{
+	
+	THuiThemeImageparams themeImageParams;
+	themeImageParams.iSkinLogicalName= aSkinLogicalName;
+
+	return themeImageParams;	
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiTimedPoint.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "uiacceltk/HuiTimedPoint.h"  // Class definition
+#include "uiacceltk/HuiUtil.h"
+
+EXPORT_C THuiTimedPoint::THuiTimedPoint()
+    {
+    iX.SetMappingMode(0);
+    iY.SetMappingMode(1);
+    }
+
+
+EXPORT_C THuiTimedPoint::THuiTimedPoint(TReal32 aX, TReal32 aY) __SOFTFP
+        : iX(aX), iY(aY)
+    {
+    iX.SetMappingMode(0);
+    iY.SetMappingMode(1);
+    }
+
+
+EXPORT_C void THuiTimedPoint::SetStyle(THuiInterpolationStyle aStyle)
+    {
+    iX.SetStyle(aStyle);
+    iY.SetStyle(aStyle);
+    }
+
+
+EXPORT_C void THuiTimedPoint::SetFunction(MHuiMappingFunction* aFunction)
+    {
+    // Both use the same function, but the components are different.
+    iX.SetFunction(aFunction);
+    iY.SetFunction(aFunction);
+    }
+
+
+EXPORT_C void THuiTimedPoint::Set(const THuiRealPoint& aPoint,
+                                  TInt aTransitionTime)
+    {
+    iX.Set(aPoint.iX, aTransitionTime);
+    iY.Set(aPoint.iY, aTransitionTime);
+    }
+
+
+EXPORT_C void THuiTimedPoint::SetWithSpeed(const THuiRealPoint& aPoint,
+                                           TReal32 aUnitsPerSecond) __SOFTFP
+    {
+    iX.SetWithSpeed(aPoint.iX, aUnitsPerSecond);
+    iY.SetWithSpeed(aPoint.iY, aUnitsPerSecond);
+    }
+
+
+EXPORT_C void THuiTimedPoint::Set(TReal32 aValue, TInt aTransitionTime) __SOFTFP
+    {
+    iX.Set(aValue, aTransitionTime);
+    iY.Set(aValue, aTransitionTime);
+    }
+
+
+EXPORT_C void THuiTimedPoint::SetWithSpeed(TReal32 aValue, TReal32 aUnitsPerSecond) __SOFTFP
+    {
+    iX.SetWithSpeed(aValue, aUnitsPerSecond);
+    iY.SetWithSpeed(aValue, aUnitsPerSecond);
+    }
+
+
+EXPORT_C TPoint THuiTimedPoint::Now() const
+    {
+    // NOTE! the THuiTimeValue Now() and Target() return floating point values
+    // Round these floating point values to closest integer values
+    return TPoint(HUI_ROUND_FLOAT_TO_INT(iX.Now()), HUI_ROUND_FLOAT_TO_INT(iY.Now()));
+    }
+
+
+EXPORT_C THuiRealPoint THuiTimedPoint::RealNow() const __SOFTFP
+    {
+    // NOTE! the THuiTimeValue Now() and Target() return floating point values
+    return THuiRealPoint(iX.Now(), iY.Now());
+    }
+
+
+EXPORT_C TPoint THuiTimedPoint::Target() const
+    {
+    // NOTE! the THuiTimeValue Now() and Target() return floating point values
+    // Round these floating point values to closest integer values
+    return TPoint(HUI_ROUND_FLOAT_TO_INT(iX.Target()), HUI_ROUND_FLOAT_TO_INT(iY.Target()));
+    }
+
+
+EXPORT_C THuiRealPoint THuiTimedPoint::RealTarget() const __SOFTFP
+    {
+    return THuiRealPoint(iX.Target(), iY.Target());
+    }
+
+
+EXPORT_C void THuiTimedPoint::Finish()
+    {
+    iX.Finish();
+    iY.Finish();
+    }
+
+
+TBool THuiTimedPoint::Changed() const
+    {
+    return iX.Changed() || iY.Changed();
+    }
+
+
+void THuiTimedPoint::ClearChanged()
+    {
+    iX.ClearChanged();
+    iY.ClearChanged();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiTimedValue.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,491 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of THuiTimedValue. THuiTimedValue is value 
+*                that can change based on time.
+*
+*/
+
+
+
+#include "uiacceltk/HuiTimedValue.h"  // Class definition
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/huifixmath.h"
+
+#include <e32math.h>
+
+EXPORT_C TBool MHuiMappingFunction::MappingFunctionChanged() const
+    {
+    return EFalse;
+    }
+
+
+EXPORT_C void MHuiMappingFunction::MappingFunctionClearChanged()
+    {
+    }
+
+
+EXPORT_C THuiTimedValue::THuiTimedValue(THuiInterpolationStyle aStyle)
+        :
+          iStyle(aStyle),
+          iInternalState(0),
+          iInterpolationStartValue(0),
+          iTargetValue(0),
+          iMapFunction(0),
+          iTimeRemainingWhenSuspended(0)
+    {
+    // Use current time.
+    iInterpolationStartTime = CHuiStatic::MilliSecondsSinceStart();
+    iInterpolationEndTime = iInterpolationStartTime;
+
+    SetStyle(aStyle);
+    }
+
+
+EXPORT_C THuiTimedValue::THuiTimedValue(TReal32 aInitialValue, THuiInterpolationStyle aStyle) __SOFTFP
+        : iStyle(aStyle),
+          iInternalState(0),
+          iInterpolationStartValue(aInitialValue),
+          iTargetValue(aInitialValue),
+          iMapFunction(0),
+          iTimeRemainingWhenSuspended(0)
+    {
+    // Use current time.
+    iInterpolationStartTime = CHuiStatic::MilliSecondsSinceStart();
+    iInterpolationEndTime = iInterpolationStartTime;
+
+    SetStyle(aStyle);
+    }
+
+
+EXPORT_C THuiInterpolationStyle THuiTimedValue::Style() const
+    {
+    return iStyle;
+    }
+
+
+EXPORT_C void THuiTimedValue::SetStyle(THuiInterpolationStyle aStyle)
+    {
+    iStyle = aStyle;
+
+    if(iStyle == EHuiTimedValueStyleAdaptive)
+        {
+        iInternalState |= EFlagAdaptive;
+        }
+    else
+        {
+        iInternalState &= ~EFlagAdaptive;
+        }
+    }
+
+
+EXPORT_C void THuiTimedValue::SetFunction(MHuiMappingFunction* aFunction)
+    {
+    TReal32 oldMapped = 0;
+
+    if(!aFunction)
+        {
+        // We are switching to identity mapping, store the current mapped
+        // value.
+        oldMapped = Now();
+        }
+
+    iMapFunction = aFunction;
+
+    if(!aFunction)
+        {
+        // No jumping around. Use the previous mapped value.
+        Set(oldMapped);
+        }
+    }
+
+
+TReal32 THuiTimedValue::SecondsFrom(TUint32 aStart, TUint32 aEnd) const
+    {
+    TUint32 diff;
+
+    diff = aEnd - aStart;
+    
+    if (diff > 0x7FFFFFFF)
+        {
+        // Timer has wrapped, we need to account for overflow.
+        diff = (0xFFFFFFFF - aStart) + aEnd;
+        }
+
+    return diff / 1000.0;
+    }
+
+
+TReal32 THuiTimedValue::MapValue(TReal32 aValue) const
+    {
+    if(!iMapFunction)
+        {
+        // No change.
+        return aValue;
+        }
+    else
+        {
+        return iMapFunction->MapValue(aValue,
+            (iInternalState & EFlagMappingModeMask ? 1 : 0));
+        }
+    }
+
+
+EXPORT_C TReal32 THuiTimedValue::Now() const __SOFTFP
+    {
+    return MapValue(UnmappedNow());
+    }
+
+    // This macro is used for modifying the return value appropriately
+    // for the clock flag.
+#define HUI_EVALUATED_VALUE(aValue)  \
+    ((aValue) + (iInternalState & EFlagAddSecondsSinceStart? CHuiStatic::SecondsSinceStart() : 0))
+
+EXPORT_C TReal32 THuiTimedValue::UnmappedNow() const __SOFTFP
+    {
+    if(iInternalState & EFlagFrozen)
+        {
+        // Frozen values are not updated in any way.
+        return iInterpolationStartValue;
+        }
+
+    /** @todo  Wrapping of iInterpolationEndTime and iInterpolationStartTime is 
+               not handled at the moment. If wrapping occurs during interpolation, 
+               the interpolation is cut short and the value skips to the target. */
+
+    if((iInternalState & EFlagInterpolating) && iInterpolationEndTime > iInterpolationStartTime)
+        {
+        iInternalState |= EFlagChanged;
+
+        TInt duration = HuiFixMath::FloatToFix(SecondsFrom(iInterpolationStartTime, iInterpolationEndTime));
+        TInt elapsed = HuiFixMath::FloatToFix(SecondsFrom(iInterpolationStartTime, CHuiStatic::MilliSecondsSinceStart()));
+
+        if(elapsed > duration)
+            {
+            // We have reached the destination.
+            iInterpolationStartValue = iTargetValue;
+            iInterpolationStartTime = iInterpolationEndTime;
+            iInternalState &= ~EFlagInterpolating;
+            return HUI_EVALUATED_VALUE(iInterpolationStartValue);
+            }
+
+        TReal32 t = 0.0f;
+        const TInt fixt = HuiFixMath::FixDiv(elapsed,duration);
+
+        switch(iStyle)
+            {
+            case EHuiTimedValueStyleLinear:
+                // Linear interpolation.
+                t = HuiFixMath::FixToFloat(fixt);
+                break;
+
+            case EHuiTimedValueStyleSineWave:
+                {
+                TInt angle = HuiFixMath::FixMul(fixt,KFixPi);
+                TInt anglePos = HuiFixMath::FixCos(angle);
+                t = HuiFixMath::FixToFloat((65535-anglePos)/2);
+                break;
+                }
+
+            case EHuiTimedValueStyleDecelerate:
+                {
+                // Decelerating quarter of a sine wave.
+                TInt angle = HuiFixMath::FixMul((fixt/2)+32768,KFixPi);
+                TInt anglePos = HuiFixMath::FixCos(angle);
+                t = HuiFixMath::FixToFloat((((65536 - anglePos) / 2) - 32768) * 2);
+                break;
+                }
+
+            case EHuiTimedValueStyleAccelerate:
+                {
+                // Accelerating quarter of a sine wave.
+                TInt angle = HuiFixMath::FixMul(fixt/2,KFixPi);
+                TInt anglePos = HuiFixMath::FixCos(angle);
+                t = HuiFixMath::FixToFloat((65536 - anglePos));
+                break;
+                }
+
+            case EHuiTimedValueStyleImpulse:
+                {
+                // Sine wave curve.
+                TInt angle = HuiFixMath::FixMul(fixt,KFixPi);
+                TInt anglePos = HuiFixMath::FixCos(angle);
+                t = HuiFixMath::FixToFloat((65536 - anglePos) / 2);
+                break;
+                }
+
+            default:
+                // No interpolation.
+                t = 0;
+                break;
+            }
+
+        return HUI_EVALUATED_VALUE(iInterpolationStartValue * (1 - t) + iTargetValue * t);
+        }
+    else
+        {
+        if(iInternalState & EFlagInterpolating)
+            {
+            iInternalState |= EFlagChanged;
+            iInternalState &= ~EFlagInterpolating;
+            }
+        return HUI_EVALUATED_VALUE(iInterpolationStartValue);
+        }
+    }
+
+
+EXPORT_C TReal32 THuiTimedValue::Target() const __SOFTFP
+    {
+    return MapValue(iTargetValue);
+    }
+
+
+EXPORT_C void THuiTimedValue::Set(TReal32 aValue) __SOFTFP
+    {
+    iTargetValue = iInterpolationStartValue = aValue;
+    iInternalState &= ~EFlagInterpolating;
+    iInternalState |= EFlagChanged;
+
+    CHuiStatic::ContinueRefresh();
+    }
+
+
+EXPORT_C void THuiTimedValue::Set(TReal32 aValue, TInt aMilliSeconds) __SOFTFP
+    {
+    if(Math::IsNaN(aValue))
+        {
+        HUI_DEBUG(_L("THuiTimedValue::Set - Math::IsNaN(aValue)"));
+        return;
+        }
+    if(aMilliSeconds <= 0)
+        {
+        Set(aValue);
+        return;
+        }
+
+    if(iInternalState & EFlagInterpolating)
+        {
+        iInterpolationStartValue = UnmappedNow();
+        }
+    else
+        {
+        if( HuiUtil::RealCompare(iInterpolationStartValue, aValue ) )
+            {
+            // This is the current value of the timed value, and it won't
+            // change, so we are already at the target.
+            return;
+            }
+        }
+
+    // Adaptive style depends on whether a change is currently underway.
+    if(iInternalState & EFlagAdaptive)
+        {
+        if(iInternalState & EFlagInterpolating)
+            {
+            iStyle = EHuiTimedValueStyleDecelerate;
+            }
+        else
+            {
+            iStyle = EHuiTimedValueStyleSineWave;
+            }
+        }
+
+    CHuiStatic::ContinueRefresh();
+
+    iTargetValue = aValue;
+
+    // If the difference between the current value and the target value
+    // is insignificant, no interpolation is done (it would be subject
+    // to round-off problems).
+    const TReal32 KEpsilon = .0001;
+    TReal32 delta = aValue - iInterpolationStartValue;
+    if(delta > -KEpsilon && delta < KEpsilon)
+        {
+        iInterpolationStartValue = aValue;
+        iInternalState &= ~EFlagInterpolating;
+        iInternalState |= EFlagChanged;
+        return;
+        }
+
+    iInterpolationStartTime = CHuiStatic::MilliSecondsSinceStart();
+
+    // Target time is an offset to the current time.
+    iInterpolationEndTime = iInterpolationStartTime + aMilliSeconds;
+
+    iTargetValue = aValue;
+
+    iInternalState |= EFlagChanged | EFlagInterpolating;
+    }
+
+
+EXPORT_C void THuiTimedValue::SetWithSpeed(TReal32 aValue,
+                                           TReal32 aUnitsPerSecond) __SOFTFP
+    {
+    if( Math::IsNaN(aUnitsPerSecond) || Math::IsNaN(aValue) )
+        {
+        HUI_DEBUG(_L("THuiTimedValue::SetWithSpeed - Math::IsNaN()"));
+        return;
+        }
+    TReal32 delta = UnmappedNow() - aValue;
+
+    // don't divide by 0
+    if( HuiUtil::RealCompare( delta, 0.f ) || HuiUtil::RealCompare( aUnitsPerSecond, 0.f ) )
+        {
+        // Already there.
+        Set(aValue);
+        return;
+        }
+
+    if(delta < 0.f)
+        {
+        delta = -delta;
+        }
+
+    Set(aValue, (TInt)((delta / aUnitsPerSecond) * 1000.0));
+    }
+
+
+EXPORT_C TInt THuiTimedValue::RemainingTime() const
+    {
+    if(iInternalState & EFlagInterpolating)
+        {
+        TUint32 lastTime = iInterpolationStartTime;
+        if(!(iInternalState & EFlagFrozen))
+            {
+            // If the value is not frozen, just compare against the current time.
+            lastTime = CHuiStatic::MilliSecondsSinceStart();
+            }
+
+        TReal32 remaining = SecondsFrom(lastTime, iInterpolationEndTime);
+        if(remaining < 0)
+            {
+            return 0;
+            }
+        return TInt(remaining * 1000);
+        }
+    else
+        {
+        // No interpolation occuring.
+        return 0;
+        }
+    }
+
+
+EXPORT_C void THuiTimedValue::Finish()
+    {
+    iInterpolationStartTime = iInterpolationEndTime;
+    iInterpolationStartValue = iTargetValue;
+    }
+
+
+EXPORT_C void THuiTimedValue::ClearChanged()
+    {
+    if(iMapFunction)
+        {
+        iMapFunction->MappingFunctionClearChanged();
+        }
+    
+    if(!(iInternalState & EFlagInterpolating) &&
+       !(iInternalState & EFlagAddSecondsSinceStart))
+        {
+        iInternalState &= ~EFlagChanged;
+        }
+    }
+
+
+EXPORT_C void THuiTimedValue::SetMappingMode(TInt aMode)
+    {
+    switch(aMode)
+        {
+        case 0:
+            iInternalState &= ~EFlagMappingModeMask;
+            break;
+
+        case 1:
+            iInternalState |= EFlagMappingModeMask;
+            break;
+            
+        default:
+            break;
+        }
+    }
+
+
+EXPORT_C void THuiTimedValue::EnableClock(TBool aEnable)
+    {
+    if(aEnable)
+        {
+        // EFlagChanged is always raised when the clock mode is enabled.
+        iInternalState |= EFlagAddSecondsSinceStart | EFlagChanged;
+        }
+    else
+        {
+        iInternalState &= ~EFlagAddSecondsSinceStart;
+        }
+    }
+
+
+EXPORT_C void THuiTimedValue::Suspend(TBool aDoSuspend)
+    {
+    if(aDoSuspend && !(iInternalState & EFlagFrozen))
+        {
+        iInterpolationStartValue = UnmappedNow(); // to report correct value
+        iInternalState |= EFlagFrozen;
+        iTimeRemainingWhenSuspended = RemainingTime();
+        // UnmappedNow() will not update the state of the value any longer.
+        }
+    else if(!aDoSuspend && (iInternalState & EFlagFrozen))
+        {
+        iInternalState &= ~EFlagFrozen;
+
+        if (iTimeRemainingWhenSuspended) // move for real
+            {
+            iInternalState &= ~EFlagInterpolating; // force us to continue from paused position 
+                                                   // + to avoid interpolation mode change 
+            Set(iTargetValue, iTimeRemainingWhenSuspended);
+            iTimeRemainingWhenSuspended = 0;
+            }
+        else // old functionality
+            {
+            // Temporal relocation.
+            TUint32 difference = CHuiStatic::MilliSecondsSinceStart() - iInterpolationStartTime;
+            iInterpolationStartTime += difference;
+            iInterpolationEndTime += difference;
+            }
+        }
+    else
+        {
+        // for PC lint
+        }
+    }
+
+
+EXPORT_C THuiTimedValue& THuiTimedValue::operator=(const THuiTimedValue& aOtherValue)
+    {
+    if ( this == &aOtherValue )
+        {
+        Suspend(EFalse);
+        return *this;
+        }
+    
+    iStyle = aOtherValue.iStyle;
+    iInternalState = aOtherValue.iInternalState;
+    iInterpolationStartTime = aOtherValue.iInterpolationStartTime;
+    iInterpolationEndTime = aOtherValue.iInterpolationEndTime;
+    iInterpolationStartValue = aOtherValue.iInterpolationStartValue;
+    iTargetValue = aOtherValue.iTargetValue;
+    iMapFunction = aOtherValue.iMapFunction;
+    Suspend(EFalse);
+    return *this;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiTransformation.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,368 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiTransformaton. CHuiTransformation 
+*                describes a series of matrix transformation operations.
+*
+*/
+
+
+
+#include "uiacceltk/HuiTransformation.h"
+#include "HuiRenderPlugin.h"
+
+
+EXPORT_C CHuiTransformation* CHuiTransformation::NewL()
+    {
+    CHuiTransformation* self = CHuiTransformation::NewLC();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+EXPORT_C CHuiTransformation* CHuiTransformation::NewLC()
+    {
+    CHuiTransformation* self = new (ELeave) CHuiTransformation();
+    CleanupStack::PushL(self);
+    return self;
+    }
+
+
+CHuiTransformation::CHuiTransformation()
+    : iOriginPoint(0.5f,0.5f)
+    {
+    }
+
+EXPORT_C CHuiTransformation::~CHuiTransformation()
+    {
+    iTransforms.ResetAndDestroy();
+    }
+
+
+EXPORT_C TInt CHuiTransformation::Count() const
+    {
+    return iTransforms.Count();
+    }
+
+
+EXPORT_C TInt CHuiTransformation::NonIdentityCount() const
+    {
+    TInt i = 0;
+    TInt nonIdentityCount = 0;
+
+    for(i = 0; i < iTransforms.Count(); ++i)
+        {
+        const TTransform& xf = *iTransforms[i];
+        switch(xf.iType)
+            {
+            case ETypeTranslate:
+                if(xf.iParams[EHuiTransformParamTranslateX].Now() != 0.0f ||
+                   xf.iParams[EHuiTransformParamTranslateY].Now() != 0.0f ||
+                   xf.iParams[EHuiTransformParamTranslateZ].Now() != 0.0f)
+                    {
+                    nonIdentityCount++;
+                    }
+                break;
+
+            case ETypeScale:
+                if(xf.iParams[EHuiTransformParamScaleX].Now() != 1.0f ||
+                   xf.iParams[EHuiTransformParamScaleY].Now() != 1.0f ||
+                   xf.iParams[EHuiTransformParamScaleZ].Now() != 1.0f)
+                    {
+                    nonIdentityCount++;
+                    }
+                break;
+
+            case ETypeRotate:
+                if(xf.iParams[EHuiTransformParamRotateAngle].Now() != 0.0f)
+                    {
+                    nonIdentityCount++;
+                    }
+                break;
+            }
+        }
+    return nonIdentityCount;
+    }
+
+
+EXPORT_C CHuiTransformation::TTransform& CHuiTransformation::Step(TInt aIndex)
+    {
+    return (*this)[aIndex];
+    }
+
+
+EXPORT_C CHuiTransformation::TTransform& 
+    CHuiTransformation::operator [] (TInt aIndex)
+    {
+    iChanged = ETrue;
+    return *iTransforms[aIndex];
+    }
+
+
+EXPORT_C void CHuiTransformation::LoadIdentity()
+    {
+    iChanged = ETrue;
+    iTransforms.ResetAndDestroy();
+    }
+
+
+EXPORT_C void CHuiTransformation::Translate(TReal32 aX, TReal32 aY) __SOFTFP
+    {
+    TTransform translate;
+
+    translate.iType = ETypeTranslate;
+    translate.iParams[EHuiTransformParamTranslateX] = THuiTimedValue(aX);
+    translate.iParams[EHuiTransformParamTranslateY] = THuiTimedValue(aY);
+
+    /*TInt err = */Append(translate);
+    }
+
+
+EXPORT_C void CHuiTransformation::Translate(const THuiTimedValue& aX,
+                                            const THuiTimedValue& aY)
+    {
+    TTransform translate;
+
+    translate.iType = ETypeTranslate;
+    translate.iParams[EHuiTransformParamTranslateX] = aX;
+    translate.iParams[EHuiTransformParamTranslateY] = aY;
+
+    /*TInt err = */Append(translate);
+    }
+
+
+EXPORT_C void CHuiTransformation::Scale(TReal32 aX, TReal32 aY) __SOFTFP
+    {
+    TTransform scale;
+
+    scale.iType = ETypeScale;
+    scale.iParams[EHuiTransformParamScaleX] = THuiTimedValue(aX);
+    scale.iParams[EHuiTransformParamScaleY] = THuiTimedValue(aY);
+    scale.iParams[EHuiTransformParamScaleZ] = THuiTimedValue(1.f);
+
+    /*TInt err = */Append(scale);
+    }
+
+
+EXPORT_C void CHuiTransformation::Scale(const THuiTimedValue& aX,
+                                        const THuiTimedValue& aY)
+    {
+    TTransform scale;
+
+    scale.iType = ETypeScale;
+    scale.iParams[EHuiTransformParamScaleX] = aX;
+    scale.iParams[EHuiTransformParamScaleY] = aY;
+    scale.iParams[EHuiTransformParamScaleZ] = THuiTimedValue(1.f);
+
+    /*TInt err = */Append(scale);
+    }
+
+
+EXPORT_C void CHuiTransformation::Scale(TReal32 aX, TReal32 aY, TReal32 aZ) __SOFTFP
+    {
+    TTransform scale;
+
+    scale.iType = ETypeScale;
+    scale.iParams[EHuiTransformParamScaleX] = THuiTimedValue(aX);
+    scale.iParams[EHuiTransformParamScaleY] = THuiTimedValue(aY);
+    scale.iParams[EHuiTransformParamScaleZ] = THuiTimedValue(aZ);
+
+    /*TInt err = */Append(scale);
+    }
+
+
+EXPORT_C void CHuiTransformation::Scale(const THuiTimedValue& aX,
+                                        const THuiTimedValue& aY,
+                                        const THuiTimedValue& aZ)
+    {
+    TTransform scale;
+
+    scale.iType = ETypeScale;
+    scale.iParams[EHuiTransformParamScaleX] = aX;
+    scale.iParams[EHuiTransformParamScaleY] = aY;
+    scale.iParams[EHuiTransformParamScaleZ] = aZ;
+
+    /*TInt err = */Append(scale);
+    }
+
+
+EXPORT_C void CHuiTransformation::Rotate(TReal32 aAngle) __SOFTFP
+    {
+    Rotate(aAngle, 0.f, 0.f, -1.f);
+    }
+
+
+EXPORT_C void CHuiTransformation::Rotate(const THuiTimedValue& aAngle)
+    {
+    Rotate(aAngle, 0.f, 0.f, -1.f);
+    }
+
+
+EXPORT_C void CHuiTransformation::Rotate(
+    TReal32 aAngle, 
+    TReal32 aAxisX, 
+    TReal32 aAxisY, 
+    TReal32 aAxisZ) __SOFTFP
+    {
+    TTransform rotate;
+    rotate.iType = ETypeRotate;
+    rotate.iParams[EHuiTransformParamRotateAngle] = THuiTimedValue(aAngle);
+    rotate.iParams[EHuiTransformParamRotateAxisX] = THuiTimedValue(aAxisX);
+    rotate.iParams[EHuiTransformParamRotateAxisY] = THuiTimedValue(aAxisY);
+    rotate.iParams[EHuiTransformParamRotateAxisZ] = THuiTimedValue(aAxisZ);
+
+    /*TInt err = */Append(rotate);
+    }
+
+
+EXPORT_C void CHuiTransformation::Rotate(
+    const THuiTimedValue& aAngle,
+    TReal32 aAxisX, 
+    TReal32 aAxisY, 
+    TReal32 aAxisZ) __SOFTFP
+    {
+    TTransform rotate;
+    rotate.iType = ETypeRotate;
+    rotate.iParams[EHuiTransformParamRotateAngle] = aAngle;
+    rotate.iParams[EHuiTransformParamRotateAxisX] = THuiTimedValue(aAxisX);
+    rotate.iParams[EHuiTransformParamRotateAxisY] = THuiTimedValue(aAxisY);
+    rotate.iParams[EHuiTransformParamRotateAxisZ] = THuiTimedValue(aAxisZ);
+
+    /*TInt err = */Append(rotate);
+    }
+
+
+TInt CHuiTransformation::Append(const TTransform& aTransform)
+    {
+    TTransform* copy = new TTransform;
+    if ( !copy )
+        {
+        return KErrNoMemory;
+        }
+
+    *copy = aTransform;
+    TInt err = iTransforms.Append(copy);
+    
+    if ( err == KErrNone )
+        {
+        iChanged = ETrue;
+        }
+    else
+        {
+        delete copy;
+        }
+    return err;
+    }
+
+
+EXPORT_C void CHuiTransformation::Execute(
+    THuiGcMatrix aMatrix, 
+    CHuiGc& aGc) const
+    {
+    for(TInt i = 0; i < iTransforms.Count(); ++i)
+        {
+        const TTransform& x = *iTransforms[i];
+        switch(x.iType)
+            {
+            case ETypeTranslate:
+                aGc.Translate(aMatrix,
+                              x.iParams[EHuiTransformParamTranslateX].Now(),
+                              x.iParams[EHuiTransformParamTranslateY].Now(),
+                              x.iParams[EHuiTransformParamTranslateZ].Now());
+                break;
+
+            case ETypeScale:
+                aGc.Scale(aMatrix,
+                          x.iParams[EHuiTransformParamScaleX].Now(),
+                          x.iParams[EHuiTransformParamScaleY].Now(),
+                          x.iParams[EHuiTransformParamScaleZ].Now());
+                break;
+
+            case ETypeRotate:
+                aGc.Rotate(aMatrix,
+                           x.iParams[EHuiTransformParamRotateAngle].Now(),
+                           x.iParams[EHuiTransformParamRotateAxisX].Now(),
+                           x.iParams[EHuiTransformParamRotateAxisY].Now(),
+                           x.iParams[EHuiTransformParamRotateAxisZ].Now());
+                break;
+            }
+        }
+    }
+
+
+TBool CHuiTransformation::Changed() const
+    {
+    if(iChanged)
+        {
+        return ETrue;
+        }
+
+    for(TInt i = 0; i < iTransforms.Count(); ++i)
+        {
+        const TTransform& xf = *iTransforms[i];
+        switch(xf.iType)
+            {
+            case ETypeTranslate:
+                if(xf.iParams[EHuiTransformParamTranslateX].Changed() ||
+                   xf.iParams[EHuiTransformParamTranslateY].Changed() ||
+                   xf.iParams[EHuiTransformParamTranslateZ].Changed())
+                    {
+                    return ETrue;
+                    }
+                break;
+
+            case ETypeScale:
+                if(xf.iParams[EHuiTransformParamScaleX].Changed() ||
+                   xf.iParams[EHuiTransformParamScaleY].Changed() ||
+                   xf.iParams[EHuiTransformParamScaleZ].Changed())
+                    {
+                    return ETrue;
+                    }
+                break;
+
+            case ETypeRotate:
+                if(xf.iParams[EHuiTransformParamRotateAngle].Changed() ||
+                   xf.iParams[EHuiTransformParamRotateAxisX].Changed() ||
+                   xf.iParams[EHuiTransformParamRotateAxisY].Changed() ||
+                   xf.iParams[EHuiTransformParamRotateAxisZ].Changed())
+                    {
+                    return ETrue;
+                    }
+                break;
+            }
+        }
+
+    return EFalse;
+    }
+
+
+void CHuiTransformation::ClearChanged()
+    {
+    TInt i = 0;
+    TInt k = 0;
+
+    for(i = 0; i < iTransforms.Count(); ++i)
+        {
+        for(k = 0; k < KHuiTransformParamCount; ++k)
+            {
+            iTransforms[i]->iParams[k].ClearChanged();
+            }
+        }
+
+    iChanged = EFalse;
+    }
+
+const THuiTimedPoint& CHuiTransformation::OriginPoint() const
+    {
+    return iOriginPoint;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiUtil.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1023 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation for HuiUtil class, a collection of utility 
+*                routines for HUITK.
+*
+*/
+
+
+
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiFont.h"
+#include "uiacceltk/HuiRealPoint.h"
+
+#include <e32math.h>
+#include <hal.h>
+#include <AknUtils.h>
+#include <AknFontSpecification.h> 
+#include <AknFontAccess.h> 
+#include <centralrepository.h>
+#include "uiacceltk/HuiDisplay.h"
+#include "../../CommonInc/uiacceltkdomaincrkeys.h"
+
+const TReal32 KLengthUnitDivisor = 320.0;
+
+/// Character used for separating tags in a tag descriptor.
+const TInt KTagSeparator = ':';
+
+
+// Calculates the smallest power-of-two that is equal to or greater than
+// a value.
+EXPORT_C TInt HuiUtil::Power2(TInt aValue)
+    {
+    ASSERT(aValue>0);
+    if(aValue<=0)
+        {
+        return 0;
+        }
+
+    TInt i;
+    for(i = 1; i < aValue && i < KMaxTInt/2; i *= 2)
+        {}
+    return i;
+    }
+
+EXPORT_C TInt HuiUtil::Power2RoundDown(TInt aValue)
+    {
+    ASSERT(aValue>0);
+    if(aValue <= 0)
+        {
+        return 0;
+        }
+
+    TInt i = 1;
+    for(; (i * 4 <= aValue) && (i < KMaxTInt/4); i *= 4)
+        {}
+    for(; (i * 2 <= aValue) && (i < KMaxTInt/2); i *= 2)
+        {}
+    return i;
+    }
+
+
+EXPORT_C TReal32 HuiUtil::Interpolate(TReal32 aPos, TReal32 aMin, TReal32 aMax) __SOFTFP
+    {
+    aPos = Max(0.f, aPos);
+    aPos = Min(aPos, 1.f);
+    return (1.f - aPos) * aMin + aPos * aMax;
+    }
+
+
+EXPORT_C void HuiUtil::WrapValue(TReal32& aValue, TReal32 aLow, TReal32 aHigh) __SOFTFP 
+    {
+    TReal32 segments = 0;
+    TReal32 length = aHigh - aLow;
+
+    if(length <= 0)
+        {
+        aValue = aLow;
+        return;
+        }
+    
+    // check rounding errors for low limit    
+    if ( HuiUtil::RealCompare( aValue, aLow ) )
+        {
+        aValue = aLow;
+        return;
+        }
+       
+    // check rounding errors for high limit  
+    if ( HuiUtil::RealCompare( aValue, aHigh ) )
+        {
+        aValue = aHigh;
+        return;
+        }
+
+    if(aValue < aLow)
+        {
+        // Wrap from below.
+        segments = (aLow - aValue) / length;
+        aValue += (TInt(segments) + 1) * length;
+        }
+    else if(aValue >= aHigh)
+        {
+        // Wrap from above.
+        segments = (aValue - aHigh) / length;
+        aValue -= (TInt(segments) + 1) * length;
+        }
+    else
+        {
+        // for PC lint
+        }
+    }
+
+
+EXPORT_C TInt HuiUtil::RandomInt(TInt aMin, TInt aMax)
+    {
+    TUint32 random = Math::Random();
+    TUint range = aMax - aMin;
+    if(range > 0)
+        {
+        return aMin + (random % (range + 1));
+        }
+    else
+        {
+        return aMin;
+        }
+    }
+
+
+EXPORT_C TReal32 HuiUtil::RandomReal(TReal32 aMin, TReal32 aMax) __SOFTFP 
+    {
+    /** @todo  Could use Math::FRand(). */
+    TReal32 random = RandomInt(0, 10000000) / 10000000.f;
+    return aMin + (aMax - aMin) * random;
+    }
+
+
+EXPORT_C TUint HuiUtil::FreeMemory(TUint* aTotalMemory)
+    {
+    TInt total = 0;
+    TInt free = 0;
+
+    HAL::Get(HALData::EMemoryRAM, total);
+    HAL::Get(HALData::EMemoryRAMFree, free);
+    if(aTotalMemory)
+        {
+        *aTotalMemory = total;
+        }
+    return free;
+    }
+
+
+EXPORT_C TSize HuiUtil::ScreenSize()
+    {
+    TSize screenSize(320, 240);
+
+    if ( CCoeEnv::Static())
+        {
+        AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EScreen, screenSize);
+        }
+    else
+        {
+        screenSize = CHuiStatic::ScreenDevice()->SizeInPixels();
+        }
+    
+    return screenSize;
+    }
+
+
+EXPORT_C TReal32 HuiUtil::LengthUnit() __SOFTFP
+    {
+    return Max(ScreenSize().iWidth, ScreenSize().iHeight) / KLengthUnitDivisor;
+    }
+
+
+EXPORT_C TReal32 HuiUtil::QuickLength(THuiRealPoint& aVector) __SOFTFP
+    {
+    TReal32 dx = Abs(aVector.iX);
+    TReal32 dy = Abs(aVector.iY);
+    if(dx < dy)
+        {
+        return dx + dy - dx/2;
+        }
+    else
+        {
+        return dx + dy - dy/2;
+        }
+    }
+
+
+EXPORT_C TReal32 HuiUtil::QuickLength(TReal32 aDx, TReal32 aDy) __SOFTFP
+    {
+    TReal32 dx = Abs(aDx);
+    TReal32 dy = Abs(aDy);
+    if(dx < dy)
+        {
+        return dx + dy - dx/2;
+        }
+    else
+        {
+        return dx + dy - dy/2;
+        }
+    }
+
+
+EXPORT_C void HuiUtil::QuickNormalize(THuiRealPoint& aNormal)
+    {
+    TReal32 approxLength = QuickLength(aNormal);
+
+    if(approxLength > 0)
+        {
+        aNormal.iX /= approxLength;
+        aNormal.iY /= approxLength;
+        }
+    }
+
+
+EXPORT_C void HuiUtil::QuickNormalize(TReal32 aVector[3])
+    {
+    TReal32 approxLength = QuickLength(QuickLength(aVector[0], aVector[1]), aVector[2]);
+
+    if(approxLength > 0)
+        {
+        aVector[0] /= approxLength;
+        aVector[1] /= approxLength;
+        aVector[2] /= approxLength;
+        }
+    }
+
+
+EXPORT_C void HuiUtil::CrossProduct(const TReal32 aA[3], const TReal32 aB[3],
+                                    TReal32 aProduct[3])
+    {
+    aProduct[0] = aA[1] * aB[2] - aB[1] * aA[2];
+    aProduct[1] = aA[2] * aB[0] - aB[2] * aA[0];
+    aProduct[2] = aA[0] * aB[1] - aB[0] * aA[1];
+    }
+
+
+EXPORT_C void HuiUtil::NormalFromPoints(const TReal32 aPoints[3][3], TReal32 aNormal[3])
+    {
+    TReal32 vectors[2][3];
+    TInt i;
+
+    for(i = 0; i < 3; ++i)
+        {
+        vectors[0][i] = aPoints[0][i] - aPoints[1][i];
+        vectors[1][i] = aPoints[0][i] - aPoints[2][i];
+        }
+
+    CrossProduct(vectors[0], vectors[1], aNormal);
+    QuickNormalize(aNormal);
+    }
+
+
+EXPORT_C void HuiUtil::ShadowMatrix(const TReal32 aPlanePoint[3],
+                                    const TReal32 aPlaneNormal[3],
+                                    const TReal32 aLightPos[4],
+                                    TReal32 aDestMat[16])
+    {
+    TReal32 planeCoeff[4];
+    TReal32 dot;
+
+    // Find the plane equation coefficients
+    // Find the first three coefficients the same way we find a normal.
+    //NormalFromPoints(aPoints, planeCoeff);
+
+    planeCoeff[0] = aPlaneNormal[0];
+    planeCoeff[1] = aPlaneNormal[1];
+    planeCoeff[2] = aPlaneNormal[2];
+
+    // Find the last coefficient by back substitutions
+    planeCoeff[3] = - ((planeCoeff[0] * aPlanePoint[0]) + (planeCoeff[1] * aPlanePoint[1]) +
+                       (planeCoeff[2] * aPlanePoint[2]));
+
+    // Dot product of plane and light position
+    dot = planeCoeff[0] * aLightPos[0] + planeCoeff[1] * aLightPos[1] +
+          planeCoeff[2] * aLightPos[2] + planeCoeff[3] * aLightPos[3];
+
+    // Now do the projection
+    // First column
+    aDestMat[0] = dot - aLightPos[0] * planeCoeff[0];
+    aDestMat[4] = 0.0f - aLightPos[0] * planeCoeff[1];
+    aDestMat[8] = 0.0f - aLightPos[0] * planeCoeff[2];
+    aDestMat[12] = 0.0f - aLightPos[0] * planeCoeff[3];
+
+    // Second column
+    aDestMat[1] = 0.0f - aLightPos[1] * planeCoeff[0];
+    aDestMat[5] = dot - aLightPos[1] * planeCoeff[1];
+    aDestMat[9] = 0.0f - aLightPos[1] * planeCoeff[2];
+    aDestMat[13] = 0.0f - aLightPos[1] * planeCoeff[3];
+
+    // Third Column
+    aDestMat[2] = 0.0f - aLightPos[2] * planeCoeff[0];
+    aDestMat[6] = 0.0f - aLightPos[2] * planeCoeff[1];
+    aDestMat[10] = dot - aLightPos[2] * planeCoeff[2];
+    aDestMat[14] = 0.0f - aLightPos[2] * planeCoeff[3];
+
+    // Fourth Column
+    aDestMat[3] = 0.0f - aLightPos[3] * planeCoeff[0];
+    aDestMat[7] = 0.0f - aLightPos[3] * planeCoeff[1];
+    aDestMat[11] = 0.0f - aLightPos[3] * planeCoeff[2];
+    aDestMat[15] = dot - aLightPos[3] * planeCoeff[3];
+    }
+
+
+EXPORT_C TReal32 HuiUtil::ColorLightness(const TRgb& aColor) __SOFTFP
+    {
+    TReal32 red = aColor.Red() / 255.0f;
+    TReal32 green = aColor.Red() / 255.0f;
+    TReal32 blue = aColor.Red() / 255.0f;
+
+    return (red*2 + green*3 + blue) / 6.f;
+    }
+
+EXPORT_C void HuiUtil::ScaleFbsBitmapL(const CFbsBitmap & aSrcBitmap,
+                                       CFbsBitmap & aScaledBitmap)
+    {
+    CFbsDevice* targetdevice = NULL;
+    CFbsBitGc* gc = NULL;
+    // create device for drawing onto the target cropped bitmap area
+    targetdevice = CFbsBitmapDevice::NewL(&aScaledBitmap);
+    CleanupStack::PushL(targetdevice);
+    // create graphics context for drawing
+    User::LeaveIfError(targetdevice->CreateContext(gc));
+    // Perform downscale using DrawBitmap
+    gc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);    
+    gc->DrawBitmap(TRect(TPoint(0,0), aScaledBitmap.SizeInPixels()),
+                   (const CFbsBitmap *)&aSrcBitmap);
+    delete gc;
+    CleanupStack::PopAndDestroy(targetdevice);
+    }
+
+EXPORT_C void HuiUtil::CombineMaskFbsBitmapL(const CFbsBitmap & aSrcBitmap,
+                                             const CFbsBitmap & aSrcMaskBitmap,
+                                             CFbsBitmap & aCombinedBitmap)
+    {
+
+    ASSERT(aCombinedBitmap.DisplayMode() == EColor16MA);
+    ASSERT(aSrcMaskBitmap.DisplayMode() == EGray2 || aSrcMaskBitmap.DisplayMode() == EGray256 || aSrcMaskBitmap.DisplayMode() == EGray16 || aSrcMaskBitmap.DisplayMode() == EGray4);
+    // Resize the target bitmap if needed
+    if (aSrcBitmap.SizeInPixels() != aCombinedBitmap.SizeInPixels())
+        {
+        aCombinedBitmap.Resize(aSrcBitmap.SizeInPixels());
+        }
+/*
+    CFbsDevice* targetdevice = NULL;
+    CFbsBitGc* gc = NULL;
+
+
+    // create device for drawing onto the target cropped bitmap area
+    targetdevice = CFbsBitmapDevice::NewL(&aCombinedBitmap);
+    CleanupStack::PushL(targetdevice);
+    // create graphics context for drawing
+    User::LeaveIfError(targetdevice->CreateContext(gc));
+
+    // Make the target bitmap fully transparent
+    gc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
+    TRgb blank(KRgbWhite);
+    blank.SetAlpha(255);
+    gc->SetBrushColor(blank);
+    gc->SetPenColor(blank);
+    gc->Clear();
+    gc->SetDrawMode(CGraphicsContext::EDrawModePEN);
+
+    gc->BitBltMasked(TPoint(0,0),  // target pos
+                     &aSrcBitmap,  // source bitmap
+                     TRect(TPoint(0, 0),aSrcBitmap.SizeInPixels()), // source rect
+                     &aSrcMaskBitmap,
+                     EFalse);
+
+    delete gc;
+    CleanupStack::PopAndDestroy(targetdevice);
+*/
+    // Alternative method to blend manually (SLOW!!):
+    // Apply the alpha mask.
+    TBitmapUtil color((CFbsBitmap*)&aSrcBitmap);
+    TBitmapUtil alpha((CFbsBitmap*)&aSrcMaskBitmap);
+    TBitmapUtil target((CFbsBitmap*)&aCombinedBitmap);
+    color.Begin(TPoint(0, 0));
+    alpha.Begin(TPoint(0, 0));
+    target.Begin(TPoint(0, 0));
+    TSize size(aCombinedBitmap.SizeInPixels());
+    for(TInt y = 0; y < size.iHeight; ++y)
+        {
+        alpha.SetPos(TPoint(0, y));
+        color.SetPos(TPoint(0, y));
+        target.SetPos(TPoint(0, y));
+        for(TInt x = 0; x < size.iWidth; ++x)
+            {
+            target.SetPixel((color.GetPixel() & 0xffffff)
+                          | ((alpha.GetPixel() & 0xff) << 24));
+            target.IncXPos();
+            color.IncXPos();
+            alpha.IncXPos();
+            }
+        }
+    target.End();
+    color.End();
+    alpha.End();
+
+    }
+
+EXPORT_C void HuiUtil::CropFbsBitmapL(const CFbsBitmap & aSrcBitmap,
+                                    CFbsBitmap & aCroppedBitmap,
+                                    TPoint aCropPosition)
+    {
+    CFbsDevice* targetdevice;
+    CFbsBitGc* gc;
+    // create device for drawing onto the target cropped bitmap area
+    targetdevice = CFbsBitmapDevice::NewL(&aCroppedBitmap);
+    CleanupStack::PushL(targetdevice);
+    // create graphics context for drawing
+    User::LeaveIfError(targetdevice->CreateContext(gc));
+    // Perform cropping bitblit
+    gc->BitBlt(TPoint(0,0), &aSrcBitmap,
+               TRect(aCropPosition, aCroppedBitmap.SizeInPixels()));
+    delete gc;
+    CleanupStack::PopAndDestroy(targetdevice);
+    }
+
+EXPORT_C void HuiUtil::ScaleImage(TInt aComponents,
+                                  const TSize& aSrcSize,
+                                  const TUint8* aSrcBuffer,
+                                  const TSize& aDestSize,
+                                  TUint8* aDestBuffer)
+    {
+    // TODO: if there is actual use for this routine,
+    // there might be better minification filters than bilinear...
+    // anyway, now this routine produced acceptable results
+    // when magnifying also...
+    ASSERT (aDestBuffer && aSrcBuffer);
+    ASSERT (aSrcSize.iWidth > 0 && aSrcSize.iHeight > 0);
+    ASSERT (aDestSize.iWidth > 0 && aDestSize.iHeight > 0);
+    ASSERT (aComponents > 0 && aComponents < 5);
+
+    TUint32 xScale = ((aSrcSize.iWidth-1) << 16) / aDestSize.iWidth;
+    TUint32 yScale = ((aSrcSize.iHeight-1) << 16) / aDestSize.iHeight;
+    TUint32 height = aDestSize.iHeight;
+    TUint8* srcptr = const_cast<TUint8*>(aSrcBuffer);
+    TUint8* destPtrLimit = aDestBuffer+(aDestSize.iWidth*aComponents);
+    TUint32 y = yScale&0xffff;
+    do 
+        {
+        TUint32 fV = y&0xffff;
+        TUint32 x = xScale&0xffff;
+        while(aDestBuffer < destPtrLimit)
+            {
+
+            TUint32 fU = x&0xffff;
+            for (TInt components = 0; components < aComponents; components++)
+                {
+                TUint32 componenta = srcptr[((x>>16)*aComponents)+components];
+                TUint32 componentb = srcptr[((x>>16)*aComponents)+aComponents+components];
+                TUint32 componentc = srcptr[((x>>16)*aComponents)+(aSrcSize.iWidth*aComponents)+components];
+                TUint32 componentd = srcptr[((x>>16)*aComponents)+(aSrcSize.iWidth*aComponents)+aComponents+components];
+
+                TUint32 componentf1 = (componenta+(((fU*((componentb-componenta)))>>16))) & 0xff;
+                TUint32 componentf2 = (componentc+(((fU*((componentd-componentc)))>>16))) & 0xff;
+                TUint32 finalcomponent = (componentf1+(((fV*((componentf2-componentf1)))>>16))) & 0xff;
+                *aDestBuffer++ = (TUint8)finalcomponent;
+                }
+            x+=xScale;
+            }
+        y+=yScale;
+        srcptr = const_cast<TUint8*>(aSrcBuffer)+((y>>16)*(aSrcSize.iWidth*aComponents));
+        destPtrLimit+=aDestSize.iWidth*aComponents;
+        }
+    while (--height);
+    }
+/*
+EXPORT_C void HuiUtil::ConvertFbsBitmap(const CFbsBitmap* aSrcBitmap,
+                                  const CFbsBitmap* aSrcMaskBitmap,
+                                  const TSize& aDestSize,
+                                  TUint8* aDestBuffer)
+    {
+
+    TReal32 weight = 1.0;
+    TReal32 totals[4] =
+        {
+        0.0, 0.0, 0.0, 0.0
+        };
+    TReal32 area;
+    TInt  destY,destX;
+    TInt  outindex;
+
+    TInt  startX = 0, endX = 0, startY = 0, endY = 0;
+    TReal32 leftOffset, rightOffset, topOffset, bottomOffset;
+    TInt  convKernelSizeY,     convKernelSizeX;
+    TReal32 convKernelSizeYFrac, convKernelSizeXFrac;
+    TInt  x, y;
+
+    ASSERT (aDestBuffer && aSrcBitmap);
+
+    TSize aSrcSize = aSrcBitmap->SizeInPixels();
+    TInt aComponents = (aSrcMaskBitmap != NULL) ? 4 : 3;
+
+    ASSERT (aSrcSize.iWidth > 0 && aSrcSize.iHeight > 0);
+    ASSERT (aDestSize.iWidth > 0 && aDestSize.iHeight > 0);
+    ASSERT (aComponents > 0 && aComponents < 5);
+    // Max aComponents in a format is 4, so...
+
+    // NOTE: here we have to force the const bitmap to
+    // non-const, since the iterator does not provide
+    // a const version. However this should not be a problem
+    // since the operations involved in this method are
+    // strictly read-only.
+    TBitmapUtil srcIterator((CFbsBitmap*)aSrcBitmap);
+    TBitmapUtil srcMaskIterator((CFbsBitmap*)aSrcMaskBitmap);
+
+
+    // if the source and destination sizes match,
+    // just perform a direct copy
+    if(aSrcSize == aDestSize)
+        {
+        TUint8* output = aDestBuffer;
+        srcIterator.Begin(TPoint(0, 0));
+        for(TInt y = 0; y < aDestSize.iHeight; ++y)
+            {
+            srcIterator.SetPos(TPoint(0,y));
+            TUint8* output = aDestBuffer + aComponents*aDestSize.iWidth*y;
+            if(aComponents == 3)
+                {
+                for(TInt x = 0; x < aDestSize.iWidth; x++, srcIterator.IncXPos())
+                    {
+                    TUint32 pixel = srcIterator.GetPixel();
+                    *output++ = (pixel >> 16) & 0xff;
+                    *output++ = (pixel >> 8) & 0xff;
+                    *output++ = pixel & 0xff;
+                    }
+                }
+            else
+                {
+                // components == 4 and alpha channel must be excluded..
+                for(TInt x = 0; x < aDestSize.iWidth; x++, srcIterator.IncXPos())
+                    {
+                    TUint32 pixel = srcIterator.GetPixel();
+                    *output++ = (pixel >> 16) & 0xff;
+                    *output++ = (pixel >> 8) & 0xff;
+                    *output++ = pixel & 0xff;
+                    // skip alpha (expect the alpha value from the mask bitmap..
+                    output++;
+                    // alpha is not really supported by the
+                    // scaling algorithm below. some small changes needed to implement..
+                    // *output++ = pixel.Alpha();
+                    }
+                }
+
+            }
+        srcIterator.End();
+
+        // then integrate the alpha channel, if
+        // provided
+        if(aSrcMaskBitmap!=NULL)
+            {
+            srcMaskIterator.Begin(TPoint(0,0));
+            for(TInt y = 0; y < aDestSize.iHeight; ++y)
+                {
+                srcMaskIterator.SetPos(TPoint(0,y));
+                TUint8* output = aDestBuffer + aComponents*aDestSize.iWidth*y + 3;
+                for(TInt x = 0;
+                    x < aDestSize.iWidth;
+                    x++, srcMaskIterator.IncXPos(), output += aComponents)
+                    {
+                    // The mask bitmap is in EGray256 format, which means the return
+                    // values from TBitmapUtil::GetPixel() should be in range 0...255.
+                    *output = srcMaskIterator.GetPixel() & 0xff;
+                    }
+                }
+            srcMaskIterator.End();
+            }
+        return;
+        }
+
+
+
+    /// @todo ScaleImaage may be optimized for halved cases, which is very common!
+
+    // if (widthin == widthout*2 && heightin == heightout*2) {
+    // halveImage_ubyte(aComponents, widthin, heightin,
+    // (const GLubyte *)aSrcBuffer, (GLubyte *)dataout,
+    // element_size, ysize, aComponents);
+    // return;
+    // }
+
+    TReal32 convy = (TReal32)aSrcSize.iHeight/aDestSize.iHeight;
+    TReal32 convx = (TReal32)aSrcSize.iWidth/aDestSize.iWidth;
+    convKernelSizeY = (TInt)convy;
+    convKernelSizeYFrac = convy - convKernelSizeY;
+    convKernelSizeX = (TInt)convx;
+    convKernelSizeXFrac = convx - convKernelSizeX;
+
+    area = convx * convy;
+
+    startY = 0;
+    topOffset = 0;
+    endY = convKernelSizeY;
+    bottomOffset = convKernelSizeYFrac;
+
+    TRgb pixel;
+    // lock the bitmaps for fast access
+    srcIterator.Begin(TPoint(0,0));
+    if(aSrcMaskBitmap!=NULL)
+        {
+        srcMaskIterator.Begin(TPoint(0,0));
+        }
+
+// define a helper macros for conveniently
+// accessing and summing pixels in a cfbsbitmap
+#define ADD_SINGLE_PIXEL_TOTALS(x, y, mul) \
+aSrcBitmap->GetPixel(pixel, TPoint(x, y)); \
+totals[0] += pixel.Red() * mul; \
+totals[1] += pixel.Green() * mul; \
+totals[2] += pixel.Blue() * mul; \
+if(aSrcMaskBitmap!=NULL) \
+    { \
+    aSrcMaskBitmap->GetPixel(pixel, TPoint(x, y)); \
+    totals[3] += pixel.Gray256() * mul; \
+    }
+
+// add totals with an iterator (rgb channels)
+#define ITER_ADD_PIXEL_TOTALS_RGB(mul) \
+    pixel = TRgb(srcIterator.GetPixel()); \
+    totals[0] += pixel.Red() * mul; \
+    totals[1] += pixel.Green() * mul; \
+    totals[2] += pixel.Blue() * mul;
+
+// add totals with an iterator (alpha channel)
+#define ITER_ADD_PIXEL_TOTALS_A(mul) \
+    totals[3] += TRgb(srcMaskIterator.GetPixel()).Gray256() * mul;
+
+// add totals for a whole row
+#define ADD_ROW_TOTALS_RGBA(startX, startY, endX, weight) \
+    srcIterator.SetPos(TPoint(startX,startY));
+    for(x = startX; x < endX; x++, srcIterator.IncXPos())
+        {
+        ITER_ADD_PIXEL_TOTALS_RGB(weight);
+        }
+    if (aSrcMaskBitmap!=NULL) {
+    srcMaskIterator.SetPos(TPoint(startX,startY));
+    for(x = startX; x < endX; x++, srcMaskIterator.IncXPos())
+        {
+        ITER_ADD_PIXEL_TOTALS_A(weight);
+        }
+    }
+// add totals for a whole column
+#define ADD_COLUMN_TOTALS_RGBA(startY, startX, endY, weight) \
+    srcIterator.SetPos(TPoint(startX,startY));
+    for(y = startY; y < endY; y++, srcIterator.IncYPos())
+        {
+        ITER_ADD_PIXEL_TOTALS_RGB(weight);
+        }
+    if (aSrcMaskBitmap!=NULL) {
+    srcMaskIterator.SetPos(TPoint(startX,startY));
+    for(y = startY; y < endY; y++, srcMaskIterator.IncYPos())
+        {
+        ITER_ADD_PIXEL_TOTALS_A(weight);
+        }
+    }
+
+
+
+    for (destY = 0; destY < aDestSize.iHeight; destY++)
+        {
+        startX = 0;
+        leftOffset = 0;
+        endX = convKernelSizeX;
+        rightOffset = convKernelSizeXFrac;
+        // ---- rowSizeBytes = aSrcSize.iWidth*aComponents; // actually: groups_per_line * aComponents
+
+        for (destX = 0; destX < aDestSize.iWidth; destX++)
+            {
+
+            // Ok, now apply box filter to box that goes from (lowx, lowy)
+            // to (highx, highy) on input data into this pixel on output
+            // data.
+            totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
+
+            // the usual case for minification:
+            // downscale for both dimensions
+            if((endY>startY) && (endX>startX))
+                {
+                // calculate the value for pixels in the top row..
+
+                // first pixel with partial contribution both from left and from the top
+                weight = (1-topOffset) * (1-leftOffset);
+                // sums pixel to totals
+                ADD_SINGLE_PIXEL_TOTALS(startX, startY, weight);
+
+                // first row with y weighting (partial contribution from the top)
+                weight = (1-topOffset);
+                ADD_ROW_TOTALS_RGBA((startX+1), startY, endX, weight);
+
+                // last pixel with contribution from the top and the right
+                weight = (1-topOffset) * rightOffset;
+                ADD_SINGLE_PIXEL_TOTALS(endX, startY, weight);
+
+                // calculate the value for pixels in the last row ...
+
+                // bottom-left corner pixel
+                // first pixel: fractional weight contribution from the left and below
+                weight = bottomOffset * (1-leftOffset);
+                ADD_SINGLE_PIXEL_TOTALS(startX, endY, weight);
+
+                // bottom row pixels
+                weight = bottomOffset;
+                ADD_ROW_TOTALS_RGBA(startX+1, endY, endX, weight);
+
+                // bottom-right corner pixel
+                weight = bottomOffset * rightOffset;
+                ADD_SINGLE_PIXEL_TOTALS(endX, endY, weight);
+
+                // calculate the value for pixels at the left and the right
+                // edges..
+                ADD_COLUMN_TOTALS_RGBA(startY+1, endY, startX, (1-leftOffset));
+                ADD_COLUMN_TOTALS_RGBA(startY+1, endY, (endX-1), rightOffset);
+
+                }
+            else if (endY > startY)  // only squeeze in y direction?
+                {
+                // we just need to handle the left edge pixels
+
+                // top-left corner pixel first
+                weight = (1-topOffset)*(rightOffset - leftOffset);
+                // ---- srcBufferCurrentPos = (const TUint8*)aSrcBuffer + srcXPositionInBytes + startY*rowSizeBytes;
+                ADD_SINGLE_PIXEL_TOTALS(startX, startY, weight);
+
+                // left edge
+                weight = rightOffset - leftOffset;
+                ADD_COLUMN_TOTALS_RGBA((startY+1), endY, startX, weight);
+
+                // bottom-left corner pixel has two affecting weights: left edge weight and the bottom weight
+                weight = (rightOffset - leftOffset) * bottomOffset;
+                ADD_SINGLE_PIXEL_TOTALS(startX, endY, weight);
+                }
+            else if (endX > startX) // only squeeze in x direction?
+                {
+
+                // we just need to handle the top edge pixels
+
+                // top-left corner pixel first
+                weight = (1-leftOffset)*(bottomOffset - topOffset);
+                // sums pixel to totals
+                ADD_SINGLE_PIXEL_TOTALS(startX, startY, weight);
+
+                // top edge pixels
+                weight = bottomOffset - topOffset;
+                ADD_ROW_TOTALS_RGBA((startX+1), startY, endX, weight);
+
+                // top-right edge pixel
+                weight = (bottomOffset - topOffset) * rightOffset;
+                ADD_SINGLE_PIXEL_TOTALS(endX, startY, weight);
+                }
+            else // only single pixel? (the top-right pixel)
+                {
+                // this pixel is at the all corners of the area, so
+                // all edge offsets affect to its weight
+                weight = (bottomOffset-topOffset)*(rightOffset-leftOffset);
+                ADD_SINGLE_PIXEL_TOTALS(startX, startY, weight);
+                }
+
+            // this is for the pixels in the body
+            for (y = startY+1; y < endY; y++)
+                {
+                ADD_ROW_TOTALS_RGBA((startX+1), y, endX, 1.0f);
+                }
+
+            outindex = (destX + (destY * aDestSize.iWidth)) * aComponents;
+            for (TInt component = 0; component < aComponents; component++)
+                {
+                aDestBuffer[outindex + component] = totals[component]/area;
+
+                }
+            // prepare new block in x direction to be filtered
+            startX = endX;
+            leftOffset = rightOffset;
+            endX += convKernelSizeX;
+            rightOffset += convKernelSizeXFrac;
+            if(rightOffset > 1)
+                {
+                rightOffset -= 1.0;
+                endX++;
+                }
+            } // for startX
+
+        // prepare new row of blocks to be filtered
+        startY = endY;
+        topOffset = bottomOffset;
+        endY += convKernelSizeY;
+        bottomOffset += convKernelSizeYFrac;
+        if(bottomOffset > 1)
+            {
+            bottomOffset -= 1.0;
+            endY++;
+            }
+        } // for startY
+
+    // unlock the bitmaps after usage
+    srcIterator.End();
+    if(aSrcMaskBitmap!=NULL)
+        {
+        srcMaskIterator.End();
+        }
+
+    }
+*/
+
+EXPORT_C void HuiUtil::CropImage(TInt aComponents,
+                                const TSize& aSrcBufferSize,
+                                const TUint8* aSrcBuffer,
+                                const TPoint& aCropOffset,
+                                const TSize& aCroppedSize,
+                                TUint8* aDestBuffer)
+    {
+    ASSERT (aDestBuffer && aSrcBuffer);
+    ASSERT (aSrcBufferSize.iWidth > 0 && aSrcBufferSize.iHeight > 0);
+    ASSERT (aCroppedSize.iWidth > 0 && aCroppedSize.iHeight > 0);
+    ASSERT (aCropOffset.iX < aSrcBufferSize.iWidth);
+    ASSERT (aCropOffset.iY < aSrcBufferSize.iHeight);
+    ASSERT (aComponents > 0 && aComponents < 5);
+
+    TInt targetlinesize = aCroppedSize.iWidth*aComponents;
+    TInt sourcelinesize = aSrcBufferSize.iWidth*aComponents;
+    for (TInt y=0; y<aCroppedSize.iHeight; y++)
+        {
+        // copy line at a time..
+        TAny * source = (TAny*)((const TUint8*)aSrcBuffer
+                            + ((y+aCropOffset.iY)*sourcelinesize)
+                            + (aCropOffset.iX * aComponents));
+        TAny * target = (TAny*)((const TUint8*)aDestBuffer + (y*targetlinesize));
+        memcpy(target, source, targetlinesize);
+        }
+
+    }
+
+EXPORT_C CFbsBitmap* HuiUtil::ConvertBitmapToDisplayModeLC( const CFbsBitmap& aBitmap, const TDisplayMode& aDisplaymode )
+    {
+    // Create target bitmap
+    CFbsBitmap* targetBitmap = new CFbsBitmap();
+    CleanupStack::PushL( targetBitmap );
+    targetBitmap->Create( aBitmap.SizeInPixels(), aDisplaymode );
+
+    // Create bitmap device for target rendering
+    CFbsBitmapDevice* targetDevice = CFbsBitmapDevice::NewL( targetBitmap );
+    CleanupStack::PushL( targetDevice );
+
+    // Create bitmap graphics context
+    CFbsBitGc* bitgc = CFbsBitGc::NewL();
+    CleanupStack::PushL( bitgc );
+    bitgc->Activate( targetDevice );
+
+    // BitBlt the given bitmap to target device.
+    bitgc->BitBlt( TPoint( 0, 0 ), &aBitmap );
+
+    CleanupStack::PopAndDestroy( bitgc );
+    CleanupStack::PopAndDestroy( targetDevice );
+
+    return targetBitmap;
+    }
+
+
+EXPORT_C TBool HuiUtil::TagMatches(const TDesC8& aTagsColonSeparated, const TDesC8& aTag)
+    {
+    TPtrC8 region = aTagsColonSeparated;
+    TPtrC8 tag;
+    TInt index = 0;
+
+    if(!aTag.Length())
+        {
+        // No tag specified; doesn't match anything.
+        return EFalse;
+        }
+
+    while(region.Length() > 0)
+        {
+        // Is there a colon in the region?
+        index = region.Locate(TChar(KTagSeparator));
+        if(index != KErrNotFound)
+            {
+            // A separator exists in the region.
+            tag.Set(region.Left(index));
+            region.Set(region.Right((region.Length() - index) - 1));
+            }
+        else
+            {
+            tag.Set(region);
+            region.Set(region.Right(0));
+            }
+
+        if(!tag.Compare(aTag))
+            {
+            // Matches.
+            return ETrue;
+            }
+        }
+
+    // No match could be found.
+    return EFalse;
+    }
+
+TReal32 HuiUtil::CalculateScaleFactorFromScaleMode( 
+        const THuiRealSize& aContainerSize,   
+        const THuiRealSize& aContentSize,
+        CHuiImageVisual::TScaleMode aScaleMode,
+        TReal32 aInitialScale )
+    {
+    TReal32 scale = aInitialScale;
+
+    // Scaling factor adjustment.
+    if(aScaleMode == CHuiImageVisual::EScaleFitHeight)
+        {
+        TReal32 contentHeight = aContentSize.iHeight;
+        if(contentHeight > 0)
+            {
+            scale *= aContainerSize.iHeight / contentHeight;
+            }
+        }
+    else if(aScaleMode == CHuiImageVisual::EScaleFitWidth)
+        {
+        TReal32 contentWidth = aContentSize.iWidth;
+        if(contentWidth > 0)
+            {
+            scale *= aContainerSize.iWidth / contentWidth;
+            }
+        }
+    else if(aScaleMode == CHuiImageVisual::EScaleCover || 
+            aScaleMode == CHuiImageVisual::EScaleFitInside)
+        {
+        TReal32 heightScale = scale;
+        TReal32 contentHeight = aContentSize.iHeight;
+        if(contentHeight > 0)
+            {
+            heightScale *= aContainerSize.iHeight / contentHeight;
+            }
+
+        TReal32 widthScale = scale;
+        TReal32 contentWidth = aContentSize.iWidth;
+        if(contentWidth > 0)
+            {
+            widthScale *= aContainerSize.iWidth / contentWidth;
+            }
+
+        if(aScaleMode == CHuiImageVisual::EScaleCover)
+            {
+            scale = Max(widthScale, heightScale);
+            }
+        else
+            {
+            scale = Min(widthScale, heightScale);
+            }
+        }
+    else
+        {
+        // for PC lint
+        }
+    return scale;
+    }
+    
+EXPORT_C TBool HuiUtil::RealCompare( 
+    TReal32 aCompare1, 
+    TReal32 aCompare2, 
+    TReal32 aEpsilon )
+    {
+    if ( Abs(aCompare1 - aCompare2) < aEpsilon )
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
+
+EXPORT_C void HuiUtil::Assert(TBool aCondition)
+    {
+    // Assert that the passed condition is true.
+    if (aCondition == EFalse)
+        {
+        // You can breakpoint here to trap asserts.
+        ASSERT(EFalse);           
+        }
+    }
+
+EXPORT_C CFbsBitmap* HuiUtil::CopyBitmapL(const CFbsBitmap& aSrc)
+    {
+    CFbsBitmap* newBitmap = new (ELeave) CFbsBitmap();
+    CleanupStack::PushL( newBitmap );
+    User::LeaveIfError( newBitmap->Create( aSrc.SizeInPixels(), aSrc.DisplayMode() ) );
+    CFbsBitmapDevice* dev = CFbsBitmapDevice::NewL( newBitmap );
+    CleanupStack::PushL( dev );
+    CFbsBitGc* gc = NULL;
+    User::LeaveIfError( dev->CreateContext( gc ) );
+    CleanupStack::PushL( gc );
+    gc->BitBlt( TPoint(0,0), &aSrc );
+    CleanupStack::PopAndDestroy(2); // dev, gc        
+    CleanupStack::Pop(); // newBitmap
+    return newBitmap;
+    }
+
+EXPORT_C TInt HuiUtil::GetValueFromCentralRepository( const TUint32 aKey, TInt& aValue )
+    {
+    CRepository* centralRepository = NULL;    
+    TRAPD( error, centralRepository = CRepository::NewL( KCRUidUIAccelTK ) );
+    TInt result = 0;
+    if ( error == KErrNone )
+        {
+        error = centralRepository->Get( aKey, result );
+        }
+    delete centralRepository;
+    centralRepository = NULL;
+    if ( error == KErrNone )
+        {
+        aValue = result;
+        }
+    return error;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiVisual.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,2155 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 CHuiVisual class. Visuals are graphical entities 
+*                visible on a display.
+*
+*/
+
+
+
+#include "uiacceltk/HuiVisual.h"  // Class definition
+#include "uiacceltk/HuiLayout.h"
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiControlGroup.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiDisplay.h"
+#include "uiacceltk/HuiRoster.h"
+#include "uiacceltk/HuiTransformation.h"
+#include "uiacceltk/HuiDrawing.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiProbe.h"
+#include "uiacceltk/huidropshadow.h"
+#include "HuiRosterImpl.h"
+#include "HuiFxEffect.h"
+#include "HuiFxEffectParser.h"
+#include "alflogger.h"
+#include "HuiCmdBufferBrush.h"
+#include "huicanvasrenderbuffer.h"
+
+struct CHuiVisual::THuiVisualPrivateData
+    {
+public: // Functions
+    // Constructor: initialize the data
+    THuiVisualPrivateData() : iTacticons(), iDropShadow(NULL)
+        {
+        iEffect = NULL;
+        iEffectParser = NULL;
+        }
+        
+    // Destructor: destruct the data
+    ~THuiVisualPrivateData()
+        {
+        iTacticons.Close();
+        delete iDropShadow;
+        delete iEffectParser;
+        delete iEffect;
+        }
+    
+    // structs
+    struct TTacticon
+        {
+        TInt iFeedbackType;
+        TInt iEventType;
+        };
+    
+    // Data
+    RArray<TTacticon> iTacticons;
+    CHuiDropShadow* iDropShadow;
+    TRect iPreviousDrawnTvOut; 
+    CHuiFxEffect* iEffect;
+    CHuiFxEffectParser* iEffectParser;
+    MHuiEffectable *iEffectable;
+    CHuiCanvasRenderBuffer* iStoredRenderBuffer;
+    TBool iStoredRenderBufferModificationsEnabled;
+    TBool iFreezed;
+    };
+class CHuiEffectable : public CBase, public MHuiEffectable
+    {
+public: // from MHuiEffectable
+    CHuiEffectable(CHuiVisual *aVisual) : iVisual(aVisual) { }
+    void EffectSetEffect(CHuiFxEffect* aEffect);
+    TReal32 EffectOpacityTarget() const;
+    void EffectSetOpacity(TReal32 aOpacity);
+    void EffectDrawSelf( CHuiGc &aGc, const TRect & aDisplayRect) const;
+    THuiRealRect EffectDisplayRect() const __SOFTFP;
+    void SetLoadingEffect(TBool aLoading);    
+    void EffectSetSource( TBool aIsInput1 );
+    TBool EffectGetSource() const;
+
+private:
+    CHuiVisual *iVisual;
+    TBool iIsInput1;
+    };
+void CHuiEffectable::EffectSetEffect(CHuiFxEffect* aEffect)
+    {
+    iVisual->SetEffect(aEffect);
+    }
+void CHuiEffectable::EffectSetSource( TBool aIsInput1 )
+    {
+    iIsInput1 = aIsInput1;
+    }
+TBool CHuiEffectable::EffectGetSource() const
+    {
+    return iIsInput1;
+    }
+
+TReal32 CHuiEffectable::EffectOpacityTarget() const
+    {
+    return iVisual->iOpacity.Target();
+    }
+
+void CHuiEffectable::EffectSetOpacity(TReal32 aOpacity)
+    {
+    iVisual->iOpacity.Set( aOpacity );
+    }
+
+void CHuiEffectable::EffectDrawSelf( CHuiGc &aGc, const TRect & aDisplayRect) const
+    {
+    iVisual->DrawSelf(aGc, aDisplayRect);
+    }
+
+THuiRealRect CHuiEffectable::EffectDisplayRect() const __SOFTFP
+    {
+    return iVisual->DisplayRect();
+    }
+
+void CHuiEffectable::SetLoadingEffect(TBool aLoading)
+    {
+    iVisual->SetLoadingEffect(aLoading);
+    }
+
+
+/// Descriptor that is returned when the tag is queried and no tag has been
+/// been defined for a visual.
+_LIT8(KHuiVisualUndefinedTag, "");
+
+EXPORT_C MHuiVisualOwner::~MHuiVisualOwner()
+    {
+    }
+
+EXPORT_C CHuiCanvasRenderBuffer *CHuiVisual::StoredRenderBuffer() const
+    {
+    return iVisualData->iStoredRenderBuffer;
+    }
+EXPORT_C void CHuiVisual::SetStoredRenderBuffer(CHuiCanvasRenderBuffer *aRenderBuffer)
+    {
+    if (iVisualData->iStoredRenderBufferModificationsEnabled)
+        {
+        if (iVisualData->iStoredRenderBuffer)
+            {
+            iVisualData->iStoredRenderBuffer->UnInitialize();
+            }
+        delete iVisualData->iStoredRenderBuffer;
+        iVisualData->iStoredRenderBuffer = aRenderBuffer;
+        }
+    }
+EXPORT_C void CHuiVisual::SetStoredRenderBufferModificationsEnabled(TBool aEnabled)
+    {
+    iVisualData->iStoredRenderBufferModificationsEnabled = aEnabled;
+    }
+
+EXPORT_C void CHuiVisual::SetFreezeState(TBool aEnabled)
+    {
+    iVisualData->iFreezed = aEnabled;
+    }
+TBool CHuiVisual::Freezed() const
+{
+    return iVisualData->iFreezed;
+}
+
+EXPORT_C CHuiVisual* CHuiVisual::AddNewL(CHuiControl& aOwnerControl,
+                                         CHuiLayout* aParentLayout)
+    {
+    CHuiVisual* visual = STATIC_CAST(CHuiVisual*,
+        aOwnerControl.AppendVisualL(EHuiVisualTypeVisual, aParentLayout));
+    return visual;
+    }
+
+
+EXPORT_C CHuiVisual::CHuiVisual(MHuiVisualOwner& aOwner)
+        : iOpacity(1.f),
+          iOwner(&aOwner), 
+          // Set the maximum size to unlimited.
+          iMaxSize(TSize(KMaxTInt, KMaxTInt)),
+          iPadding(0), 
+          iDisplayRectFrameNumber(KMaxTUint),
+          iDisplayRectTargetFrameNumber(KMaxTUint)
+    {
+    HUI_PROBE_ASSOCIATE_WITH_CURRENT_SESSION
+    HUI_PROBE_REPORT_CONSTRUCTED
+    iOpacity.SetStyle(EHuiTimedValueStyleLinear);
+    }
+
+
+EXPORT_C void CHuiVisual::ConstructL()
+    {
+    iVisualData = new (ELeave) THuiVisualPrivateData;
+    iVisualData->iEffectable = new CHuiEffectable(this);
+    iVisualData->iStoredRenderBuffer = NULL;
+    }
+
+
+EXPORT_C CHuiVisual::~CHuiVisual()
+    {
+    // Cancel scheduled commands for this visual.
+    Env().CancelCommands(this);
+
+	// Update previous dirty rect to relevant displays so that the visual can be erased
+    if(Display())
+        {        
+        CHuiRoster& roster = Display()->Roster();
+		// Check if this roster is shared between several displays and add previous dirty to all 
+		// of them
+    	for(TInt i = 0; i < Env().Displays().Count(); ++i)
+        	{ 
+        	CHuiDisplay* display = &Env().Display(i);
+        	if (&(display->Roster()) == &roster)
+        		{
+				const TRect& previousDirtyRect = display->IsDisplayTypeTvOut() ? iVisualData->iPreviousDrawnTvOut : iPreviousDrawn;
+				TRect empty;
+        		display->CombineAndAddDirtyRegion(previousDirtyRect, empty);
+        		}
+        	}	
+        }
+
+    // If this is a root-level visual, it must be hidden on the display.
+    if(iDisplay)
+        {
+        iDisplay->Roster().HideVisual(this);
+        }
+
+    // If the visual is still attached to a layout, it is time to remove it.
+    if(iLayout)
+        {
+        iLayout->Remove(this);
+        }
+        
+    // If the visual is attached to some visual as external content visual,
+    // remove the link from the parent visual
+    if (Flags() & EHuiVisualFlagDrawOnlyAsExternalContent)
+    	{
+    	TRAP_IGNORE(CHuiStatic::Env().Display(0).RosterImpl().RemoveExternalContentVisualFromParentL(this));
+    	}
+
+    delete iBrushes;
+    delete iTag;
+    delete iTransform;
+    delete iVisualData->iEffectable;
+    if (iVisualData->iStoredRenderBuffer)
+        {
+        iVisualData->iStoredRenderBuffer->UnInitialize();
+        }
+    delete iVisualData->iStoredRenderBuffer;
+    delete iVisualData;
+    
+    iOwner = NULL;
+    iDisplay = NULL;
+    iLayout = NULL;
+
+    HUI_PROBE_REPORT_DESTRUCTED
+    }
+
+
+EXPORT_C void CHuiVisual::RemoveAndDestroyAllD()
+    {
+    ASSERT(iOwner != NULL);
+    iOwner->VisualDestroyed(*this);
+    delete this;
+    }
+
+
+EXPORT_C CHuiLayout* CHuiVisual::Layout() const
+    {
+    return iLayout;
+    }
+
+
+void CHuiVisual::SetLayout(CHuiLayout* aLayout)
+    {
+    iLayout = aLayout;
+    }
+
+
+EXPORT_C CHuiEnv& CHuiVisual::Env() const
+    {
+    return Owner().Env();
+    }
+
+
+EXPORT_C CHuiSkin& CHuiVisual::Skin() const
+    {
+    return Owner().Env().Skin();
+    }
+
+
+EXPORT_C CHuiDisplay* CHuiVisual::Display() const
+    {
+    const CHuiVisual* iter = this;
+
+    while(iter)
+        {
+        if(iter->iDisplay)
+            {
+            return iter->iDisplay;
+            }
+        iter = iter->Layout();
+        }
+
+    // Not shown on any display.
+    return NULL;
+    }
+
+
+void CHuiVisual::SetDisplay(CHuiDisplay* aDisplay)
+    {
+    iDisplay = aDisplay;
+    }
+
+
+EXPORT_C void CHuiVisual::SetFlag(THuiVisualFlags aFlag)
+    {
+    SetFlags(aFlag);
+    }
+
+
+EXPORT_C void CHuiVisual::SetFlags(TInt aAnyFlags)
+    {
+    const TInt oldFlags = iFlags;
+    iFlags |= aAnyFlags;
+
+    if(!CHuiStatic::Renderer().Allows(EHuiRenderPluginAllow3DProjection))
+        {
+        // The rendering plugin does not support 3D projection.
+        ClearFlag(EHuiVisualFlag3DProjection);
+        }
+        
+    HandleFlagsChanged( oldFlags );
+    }
+
+
+EXPORT_C void CHuiVisual::ClearFlag(THuiVisualFlags aFlag)
+    {
+    ClearFlags( aFlag );
+    }
+
+
+EXPORT_C void CHuiVisual::ClearFlags(TInt aAnyFlags)
+    {
+    const TInt oldFlags = iFlags;
+    iFlags &= ~aAnyFlags;
+    
+    HandleFlagsChanged( oldFlags );
+    }
+
+
+EXPORT_C MHuiVisualOwner& CHuiVisual::Owner() const
+    {
+    ASSERT(iOwner != NULL);
+    return *iOwner;
+    }
+    
+    
+EXPORT_C void CHuiVisual::SetOwner(MHuiVisualOwner& aOwner)
+    {
+    iOwner = &aOwner;
+    }
+    
+    
+EXPORT_C TInt CHuiVisual::Count() const
+    {
+    return 0;
+    }
+
+
+EXPORT_C CHuiVisual& CHuiVisual::Visual(TInt /*aIndex*/) const
+    {
+    USER_INVARIANT();
+    return *(CHuiVisual*)this; // never reached
+    }
+
+
+EXPORT_C void CHuiVisual::SetOrigin(THuiVisualHOrigin aHoriz, THuiVisualVOrigin aVert)
+    {
+    ClearFlags(EHuiVisualFlagHOriginCenter | EHuiVisualFlagHOriginRight);
+    switch(aHoriz)
+        {
+        case EHuiVisualHOriginCenter:
+            SetFlag(EHuiVisualFlagHOriginCenter);
+            break;
+
+        case EHuiVisualHOriginRight:
+            SetFlag(EHuiVisualFlagHOriginRight);
+            break;
+
+        default:
+            break;
+        }
+
+    ClearFlags(EHuiVisualFlagVOriginCenter | EHuiVisualFlagVOriginBottom);
+    switch(aVert)
+        {
+        case EHuiVisualVOriginCenter:
+            SetFlag(EHuiVisualFlagVOriginCenter);
+            break;
+
+        case EHuiVisualVOriginBottom:
+            SetFlag(EHuiVisualFlagVOriginBottom);
+            break;
+
+        default:
+            break;
+        }
+    }
+
+
+EXPORT_C THuiVisualHOrigin CHuiVisual::HorizontalOrigin() const
+    {
+    if(iFlags & EHuiVisualFlagHOriginCenter)
+        {
+        return EHuiVisualHOriginCenter;
+        }
+    if(iFlags & EHuiVisualFlagHOriginRight)
+        {
+        return EHuiVisualHOriginRight;
+        }
+    return EHuiVisualHOriginLeft;
+    }
+
+
+EXPORT_C THuiVisualVOrigin CHuiVisual::VerticalOrigin() const
+    {
+    if(iFlags & EHuiVisualFlagVOriginCenter)
+        {
+        return EHuiVisualVOriginCenter;
+        }
+    if(iFlags & EHuiVisualFlagVOriginBottom)
+        {
+        return EHuiVisualVOriginBottom;
+        }
+    return EHuiVisualVOriginTop;
+    }
+
+
+EXPORT_C void CHuiVisual::AlignByOrigin(THuiRealPoint& aPointInPixels, TBool aUndo) const
+    {
+    TInt factor = (aUndo? -1 : 1);
+    THuiRealPoint itemSize(0.f, 0.f); 
+    
+    TInt horizOrig = HorizontalOrigin();
+    TInt vertOrig = VerticalOrigin();
+
+    // The position of the origin depends whether the coordinates are mirrored.    
+    if(LocalBaseUnit().iX.iMagnitude < 0)
+        {
+        if(horizOrig == EHuiVisualHOriginLeft)
+            {
+            horizOrig = EHuiVisualHOriginRight;
+            }
+        else if(horizOrig == EHuiVisualHOriginRight)
+            {
+            horizOrig = EHuiVisualHOriginLeft;
+            }
+        else
+            {
+            // For PC-lint
+            }
+        }
+    if(LocalBaseUnit().iY.iMagnitude < 0)
+        {
+        if(vertOrig == EHuiVisualVOriginTop)
+            {
+            vertOrig = EHuiVisualVOriginBottom;
+            }
+        else if(vertOrig == EHuiVisualVOriginBottom)
+            {
+            vertOrig = EHuiVisualVOriginTop;
+            }
+        else
+            {
+            // For PC-lint
+            }
+        }
+    
+    if(horizOrig != EHuiVisualHOriginLeft ||
+        vertOrig != EHuiVisualVOriginTop)
+        {
+        // Need the size of the visual for aligning to non-top/left corner.
+        itemSize = LocalPointInPixels(Size().RealNow());
+        }
+    
+    switch(horizOrig)
+        {
+        case EHuiVisualHOriginCenter:
+            aPointInPixels.iX -= factor * itemSize.iX / 2.f;
+            break;
+
+        case EHuiVisualHOriginRight:
+            aPointInPixels.iX -= factor * itemSize.iX;
+            break;
+
+        default:
+            break;
+        }
+
+    switch(vertOrig)
+        {
+        case EHuiVisualVOriginCenter:
+            aPointInPixels.iY -= factor * itemSize.iY / 2.f;
+            break;
+
+        case EHuiVisualVOriginBottom:
+            aPointInPixels.iY -= factor * itemSize.iY;
+            break;
+
+        default:
+            break;
+        }
+    }
+
+
+EXPORT_C const THuiTimedPoint& CHuiVisual::Pos() const
+    {
+    return iPos;
+    }
+
+
+EXPORT_C const THuiTimedPoint& CHuiVisual::Size() const
+    {
+    return iSize;
+    }
+
+
+EXPORT_C void CHuiVisual::SetPos(const THuiRealPoint& aPos, TInt aTransitionTime)
+    {
+    iPos.iX.Set(aPos.iX, aTransitionTime);
+    iPos.iY.Set(aPos.iY, aTransitionTime);
+    }
+
+
+EXPORT_C void CHuiVisual::SetSize(const THuiRealSize& aSize, TInt aTransitionTime)
+    {
+    iSize.iX.Set(aSize.iWidth < 0 ? aSize.iWidth *-1 : aSize.iWidth, aTransitionTime);
+    iSize.iY.Set(aSize.iHeight < 0 ? aSize.iHeight *-1 : aSize.iHeight, aTransitionTime);
+    }
+
+
+EXPORT_C void CHuiVisual::SetRect(const THuiRealRect& aRect, TInt aTransitionTime)
+    {
+    SetPos(aRect.iTl, aTransitionTime);
+    SetSize(aRect.Size(), aTransitionTime);
+    }
+
+
+// deprecated
+EXPORT_C void CHuiVisual::Move(const TPoint& aOffset, TInt aTransitionTime)
+    {
+	Move(PixelPointInLocal(THuiRealPoint(aOffset), EHuiReferenceStateNow), aTransitionTime);  
+	}
+
+
+EXPORT_C void CHuiVisual::Move(const THuiRealPoint& aOffset, TInt aTransitionTime)
+    {
+    iPos.iX.Set(iPos.iX.Target() + aOffset.iX, aTransitionTime);
+    iPos.iY.Set(iPos.iY.Target() + aOffset.iY, aTransitionTime);
+    }
+
+
+EXPORT_C void CHuiVisual::Mimic(const CHuiVisual& aVisual, TInt aTransitionTime)
+    {
+    SetPos(aVisual.iPos.RealTarget(), aTransitionTime);
+    SetSize(aVisual.iSize.RealTarget().AsSize(), aTransitionTime);
+    }
+
+
+// deprecated
+EXPORT_C void CHuiVisual::SetCenteredPosAndSize(const TPoint& aCenterPoint,
+                                                const TSize& aSize,
+                                                TInt aTransitionTime)
+    {
+    THuiRealPoint visualSize = PixelPointInLocal(THuiRealPoint(aSize.iWidth, aSize.iHeight),
+    	EHuiReferenceStateNow);
+    SetCenteredPosAndSize(PixelPointInLocal(THuiRealPoint(aCenterPoint), EHuiReferenceStateNow), 
+    	visualSize.AsSize(), aTransitionTime);
+    }
+
+
+EXPORT_C void CHuiVisual::SetCenteredPosAndSize(const THuiRealPoint& aCenterPoint,
+                                                const THuiRealSize& aSize,
+                                                TInt aTransitionTime)
+    {
+    SetPos(THuiRealPoint(aCenterPoint.iX - aSize.iWidth/2,
+    	aCenterPoint.iY - aSize.iHeight/2), aTransitionTime);
+    SetSize(aSize, aTransitionTime);
+    }
+
+
+EXPORT_C void CHuiVisual::UpdateChildrenLayout(TInt /*aTransitionTime*/)
+    {
+    }
+
+
+void CHuiVisual::ReportLayoutUpdate()
+    {
+    // Notify owner, if requested.
+    if(iFlags & EHuiVisualFlagLayoutUpdateNotification)
+        {
+        Owner().VisualLayoutUpdated(*this);
+        }
+    }
+
+// deprecated
+EXPORT_C void CHuiVisual::SetMinSize(const TSize& aMinSize)
+    {
+    THuiRealPoint minPoint = PixelPointInLocal(THuiRealPoint(aMinSize.iWidth, aMinSize.iHeight),
+    	EHuiReferenceStateNow);
+    SetMinSize(minPoint.AsSize());
+    }
+
+EXPORT_C void CHuiVisual::SetMinSize(const THuiRealSize& aMinSize)
+    {
+    iMinSize = aMinSize;
+    }
+    
+// deprecated
+EXPORT_C TSize CHuiVisual::MinSize() const
+    {
+    THuiRealSize minSize = MinSizeInBaseUnits();
+    THuiRealPoint minPoint = LocalPointInPixels(THuiRealPoint(minSize.iWidth, minSize.iHeight),
+    	EHuiReferenceStateNow);
+    // @todo: Should we round this value?
+    return (TSize(minPoint.AsSize()));
+    }
+
+EXPORT_C THuiRealSize CHuiVisual::MinSizeInBaseUnits() const __SOFTFP 
+    {
+    return iMinSize;
+    }
+
+
+// deprecated
+EXPORT_C void CHuiVisual::SetMaxSize(const TSize& aMaxSize)
+    {
+    THuiRealPoint maxPoint = PixelPointInLocal(THuiRealPoint(aMaxSize.iWidth, aMaxSize.iHeight),
+    	EHuiReferenceStateNow);
+    SetMaxSize(maxPoint.AsSize());
+    }
+
+EXPORT_C void CHuiVisual::SetMaxSize(const THuiRealSize& aMaxSize)
+    {
+    iMaxSize = aMaxSize;
+    }
+
+
+// deprecated
+EXPORT_C TSize CHuiVisual::MaxSize() const
+    {
+    THuiRealSize maxSize = MaxSizeInBaseUnits();
+    THuiRealPoint maxPoint = LocalPointInPixels(THuiRealPoint(maxSize.iWidth, maxSize.iHeight),
+    	EHuiReferenceStateNow);
+    // @todo: Should we round this value?
+    return (TSize(maxPoint.AsSize()));
+    }
+
+EXPORT_C THuiRealSize CHuiVisual::MaxSizeInBaseUnits() const __SOFTFP
+    {
+    return iMaxSize;
+    }
+
+
+EXPORT_C void CHuiVisual::SetClipping(TBool aClipping)
+    {
+    if(aClipping)
+        {
+        SetFlag(EHuiVisualFlagClipping);
+        }
+    else
+        {
+        ClearFlag(EHuiVisualFlagClipping);
+        }
+    }
+
+
+EXPORT_C TBool CHuiVisual::Clipping() const
+    {
+    return (iFlags & EHuiVisualFlagClipping) != 0;
+    }
+
+
+EXPORT_C THuiRealRect CHuiVisual::DisplayRect() const __SOFTFP
+    {
+    // Recalculate and cache as necessary. 
+    TBool recalculationNeeded = ETrue;
+    
+    TUint frameno = 0; // CHuiStatic::FrameCount() is called before used
+    const TBool calledDuringDraw = Env().CurrentDisplay() ? ETrue : EFalse;
+    
+    if ( calledDuringDraw ) // before the draw, the cache is not updated
+        {
+        frameno = CHuiStatic::FrameCount();
+        if ( frameno == iDisplayRectFrameNumber )
+            {
+            recalculationNeeded = EFalse;
+            }
+        }
+    
+    if( recalculationNeeded )
+	    {
+	    THuiRealRect rect(LocalToDisplay(Pos().RealNow()),
+	                      LocalPointInPixels(Size().RealNow()).AsSize());
+
+        if (rect.iTl.iX > rect.iBr.iX)
+            {
+            TReal tempX = rect.iTl.iX;
+            rect.iTl.iX = rect.iBr.iX;
+            rect.iBr.iX = tempX;
+            }
+  
+        if (rect.iTl.iY > rect.iBr.iY)
+            {
+            TReal tempY = rect.iTl.iY;
+            rect.iTl.iY = rect.iBr.iY;
+            rect.iBr.iY = tempY;
+            }
+	                      
+	    iDisplayRect = rect;
+	    
+	    if ( calledDuringDraw ) // update frame number only during draw
+            {
+	        iDisplayRectFrameNumber = frameno;
+            }
+	    }
+    return iDisplayRect;
+    }
+
+THuiRealRect CHuiVisual::CachedDisplayRect() const
+    {
+    return iDisplayRect;    
+    }
+
+
+EXPORT_C THuiRealRect CHuiVisual::DisplayRectTarget() const __SOFTFP
+    {
+    // Calculate effect display area if the visual has an attached effect
+    // For OpenVG nothing is needed as the area is the final position,
+    // not something that happens during transition.
+    // Recalculate and cache as necessary. 
+    TBool recalculationNeeded = ETrue;
+    
+    TUint frameno = 0; // CHuiStatic::FrameCount() is called before used
+    const TBool calledDuringDraw = Env().CurrentDisplay() ? ETrue : EFalse;
+    
+    if ( calledDuringDraw ) // before the draw, the cache is not updated
+        {
+        frameno = CHuiStatic::FrameCount();
+        if ( frameno == iDisplayRectTargetFrameNumber )
+            {
+            recalculationNeeded = EFalse;
+            }
+        }
+
+    if( recalculationNeeded )
+	    {
+		THuiRealRect rect(LocalToDisplay(Pos().RealTarget(), EHuiReferenceStateTarget),
+		                  LocalPointInPixels(Size().RealTarget(), EHuiReferenceStateTarget).AsSize());
+
+        if (rect.iTl.iX > rect.iBr.iX)
+            {
+            TReal32 tempX = rect.iTl.iX;
+            rect.iTl.iX = rect.iBr.iX;
+            rect.iBr.iX = tempX;
+            }
+  
+        if (rect.iTl.iY > rect.iBr.iY)
+            {
+            TReal32 tempY = rect.iTl.iY;
+            rect.iTl.iY = rect.iBr.iY;
+            rect.iBr.iY = tempY;
+            }
+        
+        iDisplayRectTarget = rect;
+        
+        if ( calledDuringDraw ) // update frame number only during draw
+            {
+	        iDisplayRectTargetFrameNumber = frameno;
+            }
+	    }
+	return iDisplayRectTarget;
+    }
+
+
+EXPORT_C TReal32 CHuiVisual::EffectiveOpacity() const __SOFTFP
+    {
+    TReal32 opacity = iOpacity.Now();
+
+    // Controls in control groups (i.e., normally all controls)
+    // get a common opacity from the group.
+    if(Owner().ControlGroup())
+        {
+        opacity *= Owner().ControlGroup()->iOpacity.Now();
+        }
+
+    CHuiVisual* iter = Layout();
+
+    // Factor in all the opacities of the parent visuals.
+    while(iter)
+        {
+        opacity *= iter->iOpacity.Now();
+        if(opacity <= 0)
+            {
+            // Fully transparent;
+            return 0;
+            }
+        iter = iter->Layout();
+        }
+
+    return opacity;
+    }
+
+
+EXPORT_C TBool CHuiVisual::PrepareDrawL()
+    {
+    // The visual base class doesn't prepare anything.	
+    return ETrue;
+    }
+
+
+EXPORT_C void CHuiVisual::Draw(CHuiGc& aGc) const
+    {
+    if (Flags() & EHuiVisualFlagDrawOnlyAsExternalContent)
+    	{
+   	    // This is used only as external content visual. Return now if we are not currently drawing
+   	    // external content.
+    	if (!Display() || !Display()->RosterImpl().IsDrawingExternalContent())
+    		{
+			return;
+    		}
+    	}
+
+    TReal32 opacity = EffectiveOpacity();
+    if(opacity <= 0)
+        {
+        // The visual is invisible because it's fully transparent.
+        return;
+        }
+
+    // This is the currently effective area on the display used
+    // by the visual.
+    THuiRealRect displayRect = DisplayRect();
+
+    EnterLocalProjection(aGc, ETrue, 0.f, &displayRect);
+
+    // Apply local transformation.
+    Transform(aGc, ETrue, &displayRect);
+
+    // Draw background brushes (under the content).
+    DrawBrushes(aGc, EHuiBrushLayerBackground);
+
+    // Clip contents to visual rectangle.
+    if(Clipping())
+        {
+        // Visual content clipping is affected by transformation.
+        aGc.PushClip();
+        aGc.Clip(displayRect);
+        aGc.Enable(CHuiGc::EFeatureClipping);
+        }
+    if( iVisualData->iEffect )
+        {
+        // Can we draw effect
+        TBool canUseEffectDrawing = Effect() && !LoadingEffect();
+        
+        // Flag to know what we did
+        TBool didDrawEffect = EFalse;
+        
+        if (canUseEffectDrawing)
+            {
+            // Note that EHuiVisualFlagOpaqueHint improves performance a lot in cached effect drawing 
+            TBool transparent = !(Flags() & EHuiVisualFlagOpaqueHint);
+            TBool refreshCache = Changed();                
+            didDrawEffect = iVisualData->iEffect->CachedDraw(aGc, displayRect, refreshCache, !transparent);
+            }
+
+        if (!didDrawEffect) 
+            {
+            // Draw the visual instead if the effect failed
+            DrawSelf(aGc, displayRect);
+            }
+        else
+            {
+            // Effect was drawn, OpenGLES/OpenVG may be in different state than what Gc thinks so we restore it.
+            aGc.RestoreState();
+            }
+        }
+    else if ( !LoadingEffect() )
+        {
+        // Draw the visual itself.
+        // But don't draw if we are just building the effect - 
+        // We may get a view of the visual with its default values though it may
+        // want to start from size 0 or whatever
+        DrawSelf(aGc, displayRect);
+        }
+    else
+        {
+        // just to keep codescanners and other stupid tools happy
+        }
+
+    if(Clipping())
+        {
+        aGc.PopClip();
+        }
+
+    // Draw foreground brushes (over the content).
+    DrawBrushes(aGc, EHuiBrushLayerForeground);
+
+    // Undo local transformation.
+    Transform(aGc, EFalse);
+    EnterLocalProjection(aGc, EFalse);
+
+    }
+
+
+EXPORT_C void CHuiVisual::DrawBrushes(CHuiGc& aGc, THuiBrushLayer aLayer) const
+    {
+    if(iBrushes)
+        {
+        iBrushes->ActivateBrushGuide(this);
+        iBrushes->Draw(aLayer, aGc, *this);
+        iBrushes->ActivateBrushGuide(NULL);        
+        }
+    }
+
+
+EXPORT_C void CHuiVisual::DrawSelf(CHuiGc& /*aGc*/,
+                                   const TRect& /*aDisplayRect*/) const
+    {
+    // The visual base class doesn't draw a3nything.
+    }
+    
+    
+EXPORT_C void CHuiVisual::BoxMetricToPixelRect(const THuiBoxMetric& aBox, 
+        THuiRealRect& aRectInPixels) const
+    {
+    aRectInPixels.iTl = MetricToPixels(THuiXYMetric(aBox.iLeft, aBox.iTop));
+    aRectInPixels.iBr = MetricToPixels(THuiXYMetric(aBox.iRight, aBox.iBottom));
+    }
+    
+    
+/*EXPORT_C void CHuiVisual::BoxMetricToLocalRect(const THuiBoxMetric& aBox,
+        THuiRealRect& aLocalRect) const
+    {
+    THuiRealRect pixelRect;
+    BoxMetricToPixelRect(aBox, pixelRect);
+    aLocalRect.iTl = PixelPointInLocal(pixelRect.iTl);
+    aLocalRect.iBr = PixelPointInLocal(pixelRect.iBr);
+    }*/
+
+
+EXPORT_C THuiRealPoint CHuiVisual::LocalPointInPixels(const THuiRealPoint& aLocalPoint) const __SOFTFP
+    {
+    return LocalPointInPixels(aLocalPoint, EHuiReferenceStateNow);
+    }
+    
+    
+EXPORT_C THuiRealPoint CHuiVisual::PixelPointInLocal(const THuiRealPoint& aPixelPoint) const __SOFTFP
+    {
+    return PixelPointInLocal(aPixelPoint, EHuiReferenceStateNow);
+    }
+    
+    
+THuiRealPoint CHuiVisual::PixelPointInUnits(const THuiRealPoint& aPixelPoint, 
+    const THuiXYMetric& aUnit, THuiReferenceState aReferenceState ) const __SOFTFP
+    {
+    THuiRealPoint result(0.f, 0.f);
+    THuiXYMetric metric = aUnit;
+    PixelsToMetric(aPixelPoint, metric, aReferenceState); // sets X and Y lengths
+
+    if(aUnit.iX.iMagnitude != 0)
+        {
+        result.iX = metric.iX.iMagnitude / aUnit.iX.iMagnitude;
+        }
+    else
+        {
+        result.iX = 0;
+        }
+
+    if(aUnit.iY.iMagnitude != 0)
+        {
+        result.iY = metric.iY.iMagnitude / aUnit.iY.iMagnitude;
+        }
+    else
+        {
+        result.iY = 0;
+        }
+
+    return result;
+    }
+
+EXPORT_C THuiRealPoint CHuiVisual::MetricReferenceInPixels(const THuiXYMetric& aMetric) const __SOFTFP
+    {
+    return MetricReferenceInPixels(aMetric, EHuiReferenceStateNow);
+    }
+
+
+EXPORT_C THuiRealPoint CHuiVisual::MetricReferenceInPixels(const THuiXYMetric& aMetric, 
+                                                           THuiReferenceState aReferenceState) const __SOFTFP
+    {
+    THuiRealPoint refSizePx(0.f, 0.f);
+    
+    // if weights are used in this context, treat them as normalized units
+    TInt xUnit = (aMetric.iX.iUnit == EHuiUnitWeight) ? EHuiUnitNormalized : aMetric.iX.iUnit;
+    TInt yUnit = (aMetric.iY.iUnit == EHuiUnitWeight) ? EHuiUnitNormalized : aMetric.iY.iUnit;
+        
+    // For normalized units, the reference is the parent size in pixels.
+    if(xUnit == EHuiUnitNormalized || yUnit == EHuiUnitNormalized ||
+       xUnit == EHuiUnitParentWidth || yUnit == EHuiUnitParentWidth ||
+       xUnit == EHuiUnitParentHeight || yUnit == EHuiUnitParentHeight)        
+       {
+        THuiRealPoint sizePx(0.f, 0.f);
+        
+        // Determine parent size in pixels.
+        if(iLayout)
+            {
+            // Recursive fun. We don't want to do this more than once.
+            // (LocalPointInPixels => MetricsToPixels => MetricReferenceInPixels)
+            sizePx = iLayout->LocalPointInPixels(
+                            aReferenceState == EHuiReferenceStateTarget? iLayout->Size().RealTarget() :
+                            iLayout->Size().RealNow(), aReferenceState);
+  	        }
+        else if(Display())
+            {
+            // @todo Jaakko please code review this change!
+//            sizePx = Display()->Size().AsPoint();
+            sizePx = Display()->VisibleArea().Size().AsPoint();
+            }
+        else
+            {
+            // For PC-lint
+            }
+            
+        if(xUnit == EHuiUnitNormalized || xUnit == EHuiUnitParentWidth)
+            {
+            refSizePx.iX = sizePx.iX;
+            }
+        else if(xUnit == EHuiUnitParentHeight)
+            {
+            refSizePx.iX = sizePx.iY;
+            }
+        else
+            {
+            // For PC-lint
+            }
+
+        if(yUnit == EHuiUnitNormalized || yUnit == EHuiUnitParentHeight)
+            {
+            refSizePx.iY = sizePx.iY;
+            }
+        else if(yUnit == EHuiUnitParentWidth)
+            {
+            refSizePx.iY = sizePx.iX;
+            }
+        else
+            {
+            // For PC-lint
+            }
+        }
+
+    // Display-relative units are always relative to the display where the visual is on.
+    if(xUnit == EHuiUnitRelativeToDisplay && Display())
+        {
+        refSizePx.iX = Display()->VisibleArea().Width();
+        }
+    if(yUnit == EHuiUnitRelativeToDisplay && Display())
+        {
+        refSizePx.iY = Display()->VisibleArea().Height();
+        }        
+
+    // For relative to my size units, the reference is the size of this visual in pixels.
+    if(xUnit == EHuiUnitRelativeToMySize || yUnit == EHuiUnitRelativeToMySize ||
+        xUnit == EHuiUnitMyWidth || yUnit == EHuiUnitMyWidth ||
+        xUnit == EHuiUnitMyHeight || yUnit == EHuiUnitMyHeight ||
+        xUnit == EHuiUnitMyDimensionAverage || yUnit == EHuiUnitMyDimensionAverage)
+        {
+        THuiRealPoint sizePx(0.f, 0.f);
+        if(iLayout)
+            {
+            // Recursive fun. We don't want to do this more than once.
+            // (MetricsToPixels => MetricReferenceInPixels)
+            sizePx = iLayout->MetricToPixels(LocalBaseUnit().Abs() * 
+                ((aReferenceState == EHuiReferenceStateTarget) ? iSize.RealTarget() : iSize.RealNow()));
+            }
+        else if(Display())
+            {
+            sizePx = Display()->VisibleArea().Size().AsPoint();
+            }
+        else
+            {
+            // For PC-lint
+            }
+        
+        if(xUnit == EHuiUnitRelativeToMySize || xUnit == EHuiUnitMyWidth)
+            {
+            refSizePx.iX = sizePx.iX;
+            }
+        else if(xUnit == EHuiUnitMyHeight)
+            {
+            refSizePx.iX = sizePx.iY;
+            }
+        else
+            {
+            // For PC-lint
+            }
+        
+        if(yUnit == EHuiUnitRelativeToMySize || yUnit == EHuiUnitMyHeight)
+            {
+            refSizePx.iY = sizePx.iY;
+            }
+        else if(yUnit == EHuiUnitMyWidth)
+            {
+            refSizePx.iY = sizePx.iX;
+            }
+        else
+            {
+            // For PC-lint
+            }
+
+        if( xUnit == EHuiUnitMyDimensionAverage ||
+      	    yUnit == EHuiUnitMyDimensionAverage )
+            {
+            TReal32 average = (sizePx.iX + sizePx.iY) / 2;
+            if(xUnit == EHuiUnitMyDimensionAverage)
+      	        {
+                refSizePx.iX = average;
+                }
+            if(yUnit == EHuiUnitMyDimensionAverage)
+                {           
+                refSizePx.iY = average;
+                }
+            }
+        }
+                
+    if(xUnit == EHuiUnitS60 && Display())
+        {
+        refSizePx.iX = Display()->UnitValue();
+        }
+    if(yUnit == EHuiUnitS60 && Display())
+        {
+        refSizePx.iY = Display()->UnitValue();
+        }
+
+    return refSizePx;        
+    }
+    
+void CHuiVisual::ConvertMetricLengthToPixels(
+    TReal32& aResult, 
+    const THuiMetric& aMetric, 
+    TReal32 aReference)
+    {
+    switch(aMetric.iUnit)
+        {
+        case EHuiUnitPixel:
+            aResult = aMetric.iMagnitude;
+            break;
+        default:
+            aResult = aMetric.iMagnitude * aReference;
+            break;
+        }
+    }
+    
+    
+void CHuiVisual::ConvertPixelsToMetricLength(
+    THuiMetric& aResult, 
+    TReal32 aPixels, 
+    TReal32 aReference)
+    {
+    switch(aResult.iUnit)
+        {
+        case EHuiUnitPixel:
+            aResult.iMagnitude = aPixels;
+            break;
+            
+        default:
+            if(aReference != 0)
+                {
+                aResult.iMagnitude = aPixels / aReference;
+                }
+            else
+                {
+                aResult.iMagnitude = 0;
+                }
+            break;
+        }
+    }
+
+EXPORT_C THuiRealPoint CHuiVisual::MetricToPixels(const THuiXYMetric& aMetric) const __SOFTFP
+    {
+    return MetricToPixels(aMetric,EHuiReferenceStateNow);        
+    }   
+    
+    
+EXPORT_C THuiRealPoint CHuiVisual::MetricToPixels(const THuiXYMetric& aMetric,
+                                                  THuiReferenceState aReferenceState) const __SOFTFP
+    {
+    THuiRealPoint refSizePx = MetricReferenceInPixels(aMetric, aReferenceState);
+    THuiRealPoint resultPx(0.f, 0.f);
+
+    ConvertMetricLengthToPixels(resultPx.iX, aMetric.iX, refSizePx.iX);
+    ConvertMetricLengthToPixels(resultPx.iY, aMetric.iY, refSizePx.iY);
+        
+    return resultPx;        
+    }   
+
+EXPORT_C void CHuiVisual::PixelsToMetric(const THuiRealPoint& aPixels, THuiXYMetric& aMetric) const
+    {
+    PixelsToMetric(aPixels, aMetric, EHuiReferenceStateNow);
+    }
+
+
+EXPORT_C void CHuiVisual::PixelsToMetric(const THuiRealPoint& aPixels, THuiXYMetric& aMetric,
+                                         THuiReferenceState aReferenceState) const
+    {
+    THuiRealPoint refSizePx = MetricReferenceInPixels(aMetric, aReferenceState);
+
+    ConvertPixelsToMetricLength(aMetric.iX, aPixels.iX, refSizePx.iX);
+    ConvertPixelsToMetricLength(aMetric.iY, aPixels.iY, refSizePx.iY);
+    }
+    
+    
+EXPORT_C THuiXYMetric CHuiVisual::LocalBaseUnit() const
+    {
+    if(iLayout)
+        {
+        return iLayout->BaseUnit();
+        }
+    else
+        {
+        return THuiXYMetric(THuiMetric(1.f), THuiMetric(1.f));
+        }
+    }
+    
+    
+void CHuiVisual::ApplyMirroring(THuiRealPoint& aPixels, THuiReferenceState aReferenceState) const
+    {
+    THuiRealPoint refSizePx = MetricReferenceInPixels(
+        THuiXYMetric( THuiMetric(1.f, EHuiUnitNormalized), THuiMetric(1.f, EHuiUnitNormalized)), aReferenceState );
+    
+    if(LocalBaseUnit().iX.iMagnitude < 0)
+        {
+        aPixels.iX = refSizePx.iX - aPixels.iX;
+        }
+    if(LocalBaseUnit().iY.iMagnitude < 0)
+        {
+        aPixels.iY = refSizePx.iY - aPixels.iY;
+        }    
+    }
+    
+
+EXPORT_C TPoint CHuiVisual::LocalToDisplay(const TPoint& aPoint) const
+    {
+    return LocalToDisplay(THuiRealPoint(aPoint));
+    }
+
+
+EXPORT_C THuiRealPoint CHuiVisual::LocalToDisplay(const THuiRealPoint& aPoint) const __SOFTFP
+    {
+    return LocalToDisplay(aPoint, EHuiReferenceStateNow);    
+    }
+
+THuiRealPoint CHuiVisual::LocalToDisplay(const THuiRealPoint& aPoint, 
+    THuiReferenceState aReferenceState) const
+    {
+    THuiRealPoint pos = aPoint;
+    THuiRealPoint resultPx(0.f, 0.f);
+    
+    const CHuiVisual* iter = this;
+    while(iter)
+        {
+        // Add the scroll offset to the position in the local coordinate system.
+        if(iter->iLayout && iter->iLayout->Scrolling())
+            {
+            pos -= (aReferenceState == EHuiReferenceStateNow ? iter->iLayout->ScrollOffset().RealNow() : iter->iLayout->ScrollOffset().RealTarget());
+            }
+        
+        THuiRealPoint coordsPx = iter->LocalPointInPixels(pos);
+        iter->ApplyMirroring(coordsPx, aReferenceState);
+        iter->AlignByOrigin(coordsPx);
+        resultPx += coordsPx;
+        
+        // Move up in the tree.
+        iter = iter->iLayout;
+        if(iter)
+            {
+            pos = (aReferenceState == EHuiReferenceStateNow ? iter->Pos().RealNow() : iter->Pos().RealTarget());
+            }
+        }
+    
+    return resultPx;
+    }
+
+
+EXPORT_C TPoint CHuiVisual::DisplayToLocal(const TPoint& aPoint) const
+    {
+    return DisplayToLocal(THuiRealPoint(aPoint));
+    }
+
+
+EXPORT_C THuiRealPoint CHuiVisual::DisplayToLocal(const THuiRealPoint& aPointInPixels) const __SOFTFP
+    {
+    return DisplayToLocal(aPointInPixels, EHuiReferenceStateNow);
+    }
+
+THuiRealPoint CHuiVisual::DisplayToLocal(const THuiRealPoint& aPointInPixels, 
+    THuiReferenceState aReferenceState) const
+    {
+    THuiRealPoint posPx = aPointInPixels;
+
+    // Undo the effect of the parents.
+    CHuiLayout* ancestor = iLayout;
+    while(ancestor)
+        {
+        THuiRealPoint ancestorPos = (aReferenceState == EHuiReferenceStateNow ? ancestor->Pos().RealNow() : ancestor->Pos().RealTarget());
+        if(ancestor->Scrolling())
+            {
+            ancestorPos -= (aReferenceState == EHuiReferenceStateNow ? ancestor->ScrollOffset().RealNow() : ancestor->ScrollOffset().RealTarget());
+            }
+        THuiRealPoint coordsPx = ancestor->LocalPointInPixels(ancestorPos);
+        ancestor->ApplyMirroring(coordsPx, aReferenceState);
+        ancestor->AlignByOrigin(coordsPx);
+        posPx -= coordsPx;        
+        
+        // Move up in the tree.
+        ancestor = ancestor->iLayout;
+        }
+        
+    // Now we have the point as pixels in the local coordinate system.
+    AlignByOrigin(posPx, ETrue); // undo alignment
+    ApplyMirroring(posPx, aReferenceState); // undo mirroring
+    return PixelPointInLocal(posPx);
+    }
+
+
+EXPORT_C void CHuiVisual::SetChanged()
+    {
+    if ( Display() )
+        {
+        Owner().Env().ContinueRefresh();
+        }
+    iFlags |= EHuiVisualChanged;
+    }
+
+
+EXPORT_C TBool CHuiVisual::Changed() const
+    {
+    if(iFlags & EHuiVisualChanged)
+        {
+        return ETrue;
+        }
+
+    if(iBrushes && iBrushes->Changed())
+        {
+        return ETrue;
+        }
+
+    if(iTransform && iTransform->Changed())
+        {
+        return ETrue;
+        }
+
+    if (iVisualData->iEffect && iVisualData->iEffect->Changed())
+        {
+        return ETrue;
+        }
+    
+    if(Owner().ControlGroup() && Owner().ControlGroup()->iOpacity.Changed())
+        {
+        return ETrue;
+        }
+        
+    if ( iVisualData->iDropShadow && iVisualData->iDropShadow->Changed() )
+        {
+        return ETrue;
+        }
+
+    return iPos.Changed() || iSize.Changed() || iOpacity.Changed();
+    }
+
+
+EXPORT_C void CHuiVisual::ClearChanged()
+    {
+    if (iFlags & EHuiVisualChanged)
+        {
+        HUI_DEBUGF1(_L("CHuiVisual::ClearChanged() - Clearing change flags of visual %x."), this);
+        }
+    iFlags &= ~EHuiVisualChanged;
+
+    if(iBrushes)
+        {
+        iBrushes->ClearChanged();
+        }
+
+    if(iTransform)
+        {
+        iTransform->ClearChanged();
+        }
+        
+    if ( iVisualData->iDropShadow )
+        {
+        iVisualData->iDropShadow->ClearChanged();
+        }
+
+    iPos.ClearChanged();
+    iSize.ClearChanged();
+    iOpacity.ClearChanged();
+    }
+
+
+EXPORT_C void CHuiVisual::ReportChanged()
+    {
+    // Notify the display that the visual's area should be redrawn.
+    CHuiDisplay* display = NULL;
+        
+    // Select active display, fallback to own display.
+    // For scaled tv-out cloning the active display takes care of scaling direty areas too. 
+    if (iOwner && iOwner->Env().CurrentDisplay())
+        {
+        display = iOwner->Env().CurrentDisplay();    
+        }
+    else
+        {
+        display = Display();    
+        }
+
+    if(display)
+        {
+        // If nothing has changed, then we don't need to notify anything.
+        // The change flags will be cleared after the frame has been fully drawn.
+        if(!Changed() && !ParentChanged())
+            {
+            return;
+            }
+
+        TRect dirty;
+        TBool transformedReport = EFalse;
+        
+        if(iTransform && /*!(Flags() & EHuiVisualFlagClipping) &&*/
+           iTransform->NonIdentityCount() > 0)
+            {
+            __ASSERT_DEBUG( Display() != NULL,
+                            THuiPanic::Panic(THuiPanic::EVisualHasNoDisplayDuringRefresh) );
+
+            if (display->UseTransformedDirtyRegions())
+                {
+                // There is a transformation and display would like to handle transformed dirty 
+                // rects...in practice this means that we are using bitgdi and in that case
+                // the transformations do not happen in 3D, so calculating transformed dirty
+                // rects might be possible. 
+                // -> so we enable transfromation during dirty area reporting. 
+                THuiRealRect displayRect = DisplayRect();
+                EnterLocalProjection(*display->Gc(), ETrue, 0.f, &displayRect);
+                Transform(*display->Gc(), ETrue, &displayRect);
+                dirty = TRect(HUI_ROUND_FLOAT_TO_INT(displayRect.iTl.iX), HUI_ROUND_FLOAT_TO_INT(displayRect.iTl.iY),
+                              HUI_ROUND_FLOAT_TO_INT(displayRect.iBr.iX), HUI_ROUND_FLOAT_TO_INT(displayRect.iBr.iY));
+                ExpandRectWithContent(dirty);
+                transformedReport = ETrue;                    
+                }
+            else
+                {
+                // Display says it does not want to handle transformed dirty rects.                   
+                // There is a transformation and the visual is not clipped. We
+                // could try to calculate where the visual's content may end up,
+                // but in a 3D projection this may be too complicated to yield
+                // any benefits. We will just assume that the entire display
+                // needs redrawing.
+                dirty = TRect(TPoint(0, 0), Display()->VisibleArea().Size());
+                }
+
+            }
+        else
+            {
+            THuiRealRect displayRect = DisplayRect();
+            dirty = TRect(HUI_ROUND_FLOAT_TO_INT(displayRect.iTl.iX), HUI_ROUND_FLOAT_TO_INT(displayRect.iTl.iY),
+                          HUI_ROUND_FLOAT_TO_INT(displayRect.iBr.iX), HUI_ROUND_FLOAT_TO_INT(displayRect.iBr.iY));
+            ExpandRectWithContent(dirty);
+            }
+
+		TRect& previousDrawn = display->IsDisplayTypeTvOut() ? iVisualData->iPreviousDrawnTvOut : iPreviousDrawn;
+        
+        // CombineAndAddDirtyRegion modifies "dirty" param by transforming it.
+        // "previousDrawn" is supposed to be already transformed. 
+        display->CombineAndAddDirtyRegion(previousDrawn, dirty);                
+        
+        // Note that "previousDrawn" is a reference so it updates correct member data.
+        previousDrawn = dirty;       
+
+        if (transformedReport)
+            {
+            EnterLocalProjection(*display->Gc(), EFalse);
+            Transform(*display->Gc(), EFalse);                                        
+            }
+            
+        }
+    }
+
+
+EXPORT_C void CHuiVisual::EnterLocalProjection(
+        CHuiGc& aGc, TBool aApply, TReal32 /*aExtraOffset*/,
+        const THuiRealRect* aVisibleRect) const __SOFTFP
+    {
+    TReal32 depthOffset = iDepthOffset.Now();
+        
+    if(aApply && depthOffset != 0)
+        {
+        aGc.Enable(CHuiGc::EFeatureDepthTest);        
+        aGc.Push(EHuiGcMatrixModel);
+        aGc.Translate(EHuiGcMatrixModel, 0.f, 0.f, depthOffset);
+        }
+        
+    if(aApply && (iFlags & EHuiVisualFlag3DProjection))
+        {
+        // Change to a 3D projection.
+        aGc.SetProjection(CHuiGc::EProjectionPerspective);
+
+        if(aVisibleRect && (Flags() & EHuiVisualFlagLocalHorizon))
+            {
+            aGc.SetFrustumOffset(aVisibleRect->Center());
+            }
+
+        if(iFlags & EHuiVisualFlagNoDepthOcclusion)
+            {
+            aGc.Disable(CHuiGc::EFeatureDepthTest);
+            }
+        else
+            {
+            aGc.Enable(CHuiGc::EFeatureDepthTest);
+            }
+        
+        if(iFlags & EHuiVisualFlagNoDepthUpdate)
+            {
+            aGc.Disable(CHuiGc::EFeatureDepthWrite);
+            }
+        else
+            {
+            aGc.Enable(CHuiGc::EFeatureDepthWrite);
+            }
+        }
+
+    if(!aApply)
+        {
+        // Back to normal.
+        aGc.Disable(CHuiGc::EFeatureDepthTest);
+        aGc.Enable(CHuiGc::EFeatureDepthWrite);
+        }
+
+    if(!aApply && (iFlags & EHuiVisualFlag3DProjection))
+        {
+        // Back to 2D projection.
+        aGc.SetProjection();
+        }
+        
+    if(!aApply && depthOffset != 0)
+        {
+        aGc.Pop(EHuiGcMatrixModel);
+        }
+    }
+
+
+EXPORT_C void CHuiVisual::Transform(CHuiGc& aGc, TBool aApply,
+                                    const THuiRealRect* aVisibleRect) const
+    {
+    if(iTransform)
+        {
+        if(aApply)
+            {
+            THuiRealPoint center;
+            aGc.Push(EHuiGcMatrixModel);
+            if(aVisibleRect)
+                {
+                center.iX = aVisibleRect->iTl.iX + aVisibleRect->Width() * iTransform->OriginPoint().iX.Now();
+                center.iY = aVisibleRect->iTl.iY + aVisibleRect->Height() * iTransform->OriginPoint().iY.Now();
+                aGc.Translate(EHuiGcMatrixModel, center.iX, center.iY, 0.f);
+                }
+            iTransform->Execute(EHuiGcMatrixModel, aGc);
+            if(aVisibleRect)
+                {
+                aGc.Translate(EHuiGcMatrixModel, -center.iX, -center.iY, 0.f);
+                }
+            }
+        else
+            {
+            aGc.Pop(EHuiGcMatrixModel);
+            }
+        }
+    }
+
+
+EXPORT_C void CHuiVisual::SetPadding(TInt aPadding)
+    {
+    iPadding = THuiBoxMetric(THuiXYMetric(aPadding, aPadding));
+    SetChanged();
+    }
+
+
+EXPORT_C void CHuiVisual::SetPadding(const TPoint& aPadding)
+    {
+    iPadding = THuiBoxMetric(THuiXYMetric(aPadding.iX, aPadding.iY));
+    SetChanged();
+    }
+
+
+EXPORT_C void CHuiVisual::SetPadding(const THuiBoxMetric& aPadding)
+    {
+    iPadding = aPadding;
+    SetChanged();
+    }
+    
+    
+EXPORT_C const THuiBoxMetric& CHuiVisual::Padding() const
+    {
+    return iPadding;
+    }
+    
+EXPORT_C THuiRealRect CHuiVisual::PaddingInPixels() const __SOFTFP
+    {
+    return PaddingInPixels(EHuiReferenceStateNow);
+    }
+    
+EXPORT_C THuiRealRect CHuiVisual::PaddingInPixels(THuiReferenceState aReferenceState) const __SOFTFP
+    {
+    THuiRealRect paddingInPixels;
+    BoxMetricToPixelRect(Padding(), paddingInPixels, aReferenceState);
+    return paddingInPixels;    
+    }
+        
+
+EXPORT_C void CHuiVisual::MoveToFront(TInt aTransitionTime)
+    {
+    if(iLayout)
+        {
+        // Make this the last child of the parent layout.
+        iLayout->MoveVisualToFront(*this, aTransitionTime);
+        }
+    else if(Display())
+        {
+        Display()->Roster().MoveVisualToFront(this);
+        }
+    else
+        {
+        // for PC lint
+        }
+    }
+
+
+EXPORT_C void CHuiVisual::GetDualAlpha(TReal32 aOpacity, TReal32 aSecondary,
+                              TInt& aPrimaryAlpha, TInt& aSecondaryAlpha)
+    {
+    // Default values.
+    aPrimaryAlpha = TInt(255 * aOpacity);
+    aSecondaryAlpha = 0;
+
+    if(aSecondary < 1 && aOpacity < 1)
+        {
+        /** This reduces the artifact where the sharp image is clearly
+                   visible during a transition even though secondary alpha
+                   has a value near to one. Not completely perfect, though. */
+        aPrimaryAlpha = TInt(255 * (aOpacity + aSecondary * .5 * (aOpacity - 1)));
+
+        if(aPrimaryAlpha < 0)
+            {
+            aPrimaryAlpha = 0;
+            }
+        }
+    else if(aSecondary >= 1)
+        {
+        aPrimaryAlpha = 0;
+        }
+    else
+        {
+        // for PC lint
+        }
+
+    if(aSecondary > 0)
+        {
+        aSecondaryAlpha = TInt(255 * aOpacity * aSecondary);
+        }
+    }
+
+
+EXPORT_C CHuiTransformation& CHuiVisual::Transformation()
+    {
+    if(!iTransform)
+        {
+        THuiPanic::Panic(THuiPanic::EVisualTransformNotEnabled);
+        }
+
+    return *iTransform;
+    }
+
+CHuiTransformation* CHuiVisual::Transformation() const
+    {
+    return iTransform;        
+    }
+
+
+EXPORT_C void CHuiVisual::EnableTransformationL(TBool aIsTransformed)
+    {
+    if(iTransform && !aIsTransformed)
+        {
+        // Disable scrolling.
+        delete iTransform;
+        iTransform = NULL;
+        }
+    else if(!iTransform && aIsTransformed)
+        {
+        // Enable scrolling.
+        iTransform = CHuiTransformation::NewL();
+        }
+    else
+        {
+        // for PC lint
+        }
+     
+    }
+
+
+EXPORT_C void CHuiVisual::DumpTree() const
+    {
+    TBuf<100> buf;
+    TBuf<100> className;
+    GetClassName(className);
+    GetInstanceName(buf);
+    buf.AppendFormat(_L(" [label=%S];"), &className);
+    CHuiStatic::Printf(buf);
+    }
+
+
+EXPORT_C void CHuiVisual::GetInstanceName(TDes& aName) const
+    {
+    GetClassName(aName);
+	TUint addr = TUint(this);
+	aName.AppendFormat(_L("%u"), addr);
+    }
+
+
+EXPORT_C void CHuiVisual::GetClassName(TDes& aName) const
+    {
+    aName = _L("CHuiVisual");
+    }
+
+
+EXPORT_C void CHuiVisual::EnableBrushesL(TBool aEnabled)
+    {
+    if(aEnabled && !iBrushes)
+        {
+        iBrushes = CHuiBrushArray::NewL();
+        }
+    else if(!aEnabled && iBrushes)
+        {
+        if ( iBrushes->Count() )
+            {
+            iFlags |= EHuiVisualChanged;
+            }
+        
+        delete iBrushes;
+        iBrushes = 0;
+        }
+    else
+        {
+        // for PC lint
+        }
+    }
+
+
+EXPORT_C CHuiBrushArray* CHuiVisual::Brushes()
+    {
+    return iBrushes;
+    }
+
+
+EXPORT_C void CHuiVisual::NotifySkinChangedL()
+    {
+    // Do nothing by default.
+    }
+
+
+EXPORT_C void CHuiVisual::ExpandRectWithContent(TRect& aRect) const
+    {
+    if(iBrushes)
+        {
+        iBrushes->ActivateBrushGuide(this);
+        iBrushes->ExpandVisualRect(aRect);
+        iBrushes->ActivateBrushGuide(NULL);
+        }
+/*
+    if (iVisualData->iEffect)
+        {
+        TRect visualArea;
+        iVisualData->iEffect->VisualArea(visualArea);
+        aRect.BoundingRect(visualArea);
+        }
+*/        
+    }
+
+
+EXPORT_C void CHuiVisual::SetTagL(const TDesC8& aTag)
+    {
+//    ASSERT(!iTag);
+    if ( iTag )
+        {
+        delete iTag;
+        iTag = NULL;
+        }
+    if ( aTag.Length() > 0 )
+        {
+        iTag = aTag.AllocL();
+        }
+    }
+
+
+EXPORT_C const TDesC8& CHuiVisual::Tag() const
+    {
+    if(iTag)
+        {
+        return *iTag;
+        }
+    return KHuiVisualUndefinedTag;
+    }
+
+
+EXPORT_C TBool CHuiVisual::IsTagged() const
+    {
+    return iTag != 0;
+    }
+
+
+EXPORT_C CHuiVisual* CHuiVisual::FindTag(const TDesC8& aTag)
+    {
+    // Look for the tag in this visual's tag descriptor.
+    if(iTag && HuiUtil::TagMatches(*iTag, aTag))
+        {
+        return this;
+        }
+    else
+        {
+        // Could not find it.
+        return NULL;
+        }
+    }
+
+EXPORT_C TReal32 CHuiVisual::BrushOpacity() const __SOFTFP
+    {
+    return EffectiveOpacity();
+    }
+
+
+EXPORT_C THuiRealRect CHuiVisual::BrushRect() const __SOFTFP
+    {
+    // Subclasses can override this to make content-dependent brush guides.
+    return DisplayRect();
+    }
+
+
+EXPORT_C CHuiSkin& CHuiVisual::BrushSkin() const
+    {
+    return Skin();
+    }
+
+HUI_SESSION_OBJECT_IMPL_EXPORT(CHuiVisual, ETypeVisual)
+
+EXPORT_C void CHuiVisual::VisualExtension(const TUid& /*aExtensionUid*/, TAny** /*aExtensionParams*/)
+    {
+    }
+
+EXPORT_C void CHuiVisual::UpdateSiblingLayout(TInt aTransitionTime)
+    {
+  	if(Layout() && !(Layout()->Flags() & EHuiVisualFlagFreezeLayout))
+  	    {
+  	    Layout()->UpdateChildrenLayout(aTransitionTime);
+  	    }
+    }
+
+EXPORT_C void CHuiVisual::BoxMetricToPixelRect(const THuiBoxMetric& aBox,
+                                               THuiRealRect& aRectInPixels, 
+                                               THuiReferenceState aReferenceState) const
+    {
+    aRectInPixels.iTl = MetricToPixels(THuiXYMetric(aBox.iLeft, aBox.iTop), aReferenceState);
+    aRectInPixels.iBr = MetricToPixels(THuiXYMetric(aBox.iRight, aBox.iBottom), aReferenceState);
+    }
+        
+EXPORT_C THuiRealPoint CHuiVisual::LocalPointInPixels(const THuiRealPoint& aLocalPoint, 
+                                                      THuiReferenceState aReferenceState) const __SOFTFP
+    {
+    return MetricToPixels(LocalBaseUnit().Abs() * aLocalPoint, aReferenceState);
+    }
+
+EXPORT_C THuiRealPoint CHuiVisual::PixelPointInLocal(const THuiRealPoint& aPixelPoint,
+                                                     THuiReferenceState aReferenceState) const __SOFTFP
+    {
+  	return PixelPointInUnits(aPixelPoint, LocalBaseUnit().Abs(), aReferenceState);
+  	}
+
+
+TInt CHuiVisual::FindTacticon( TInt aEventType ) const
+    {
+    for ( TInt i = 0 ; i < iVisualData->iTacticons.Count() ; i++ )
+        {
+        if ( iVisualData->iTacticons[i].iEventType == aEventType )
+            {
+            return i;
+            }       
+        }
+    return KErrNotFound;
+    }
+    
+TInt CHuiVisual::TactileFeedback( TInt aEventType ) const
+    {
+    TInt returnType = KErrNotFound;
+    TInt index = FindTacticon( aEventType );
+    
+    if ( index == KErrNotFound )
+        {
+        // Try the layout
+        CHuiVisual* layoutToCheck = Layout();
+        while ( layoutToCheck )
+            {
+            index = layoutToCheck->FindTacticon( aEventType );
+            if ( index != KErrNotFound )
+                {
+                returnType = layoutToCheck->iVisualData->iTacticons[index].iFeedbackType;
+                break;
+                }
+            
+            layoutToCheck = layoutToCheck->Layout();
+            }
+        }
+    else
+        {
+        returnType = iVisualData->iTacticons[index].iFeedbackType;
+        }
+        
+    return returnType;
+    }
+
+EXPORT_C void CHuiVisual::SetTactileFeedbackL( TInt aEventType, TInt aFeedbackType )
+    {
+    if ( aFeedbackType < 0 || aEventType < 0 )
+        {
+        User::Leave( KErrArgument );
+        }
+    
+    // find if it exists already
+    const TInt index = FindTacticon( aEventType );
+    
+    if ( index != KErrNotFound )
+        {
+        iVisualData->iTacticons[index].iFeedbackType = aFeedbackType;
+        }
+    else
+        {            
+        // Create new item
+        THuiVisualPrivateData::TTacticon newTacticon;
+        newTacticon.iEventType = aEventType;
+        newTacticon.iFeedbackType = aFeedbackType;
+        
+        iVisualData->iTacticons.AppendL( newTacticon );
+        }
+    }
+    
+EXPORT_C TBool CHuiVisual::HasTactileFeedback( TInt aEventType ) const
+    {
+    if ( aEventType == KHuiTactileFeedbackEventTypeNone )
+        {
+        return iVisualData->iTacticons.Count();
+        }
+    
+    const TInt index = FindTacticon( aEventType );
+    return index != KErrNotFound;
+    }
+    
+EXPORT_C void CHuiVisual::RemoveTactileFeedback( TInt aEventType )
+    {
+    if ( aEventType == KHuiTactileFeedbackEventTypeNone )
+        {
+        iVisualData->iTacticons.Reset();
+        return;
+        }
+        
+    const TInt index = FindTacticon( aEventType );
+    if ( index != KErrNotFound )
+        {
+        iVisualData->iTacticons.Remove(index);
+        }
+    }
+    
+
+TBool CHuiVisual::IsTransformed() const
+    {
+    return iTransform != 0;    
+    }
+
+TBool CHuiVisual::ParentChanged() const
+    {
+    // Check if parent has been changed in a way that requires me to report myself as changed
+    // This may be a performance issue because this function is called often.
+    const CHuiLayout* iter = Layout(); // start from parent
+    const CHuiLayout* parent = Layout(); // Immediate parent
+    
+    while(iter)
+        {
+        // Parent scrolling, we check this before clipping because otherwise
+        // iPreviousDrawn would not get updated for children correctly as it
+        // is nowdays only updated in ReportChanged() method (and no more in the draw).
+        // NOTE: Only immediate parent is checked for better performance (no need to
+        // check others ?)
+        // TBD: Should transformations be also checked before clipping ?
+        if (parent->Scrolling() && parent->ScrollOffset().Changed())
+            {
+            return ETrue;    
+            }   
+
+        // If the parent is clipped, there is no need to check any more.
+        // If the parent in this case has been changed, the parent rect is added
+        // into the dirty regions and will be drawn anyways.
+        if ( iter->Clipping() )
+            {
+            return EFalse;
+            }
+        
+        
+        // Parent transformation affects dirty regions if visual is not clipped and outside parent
+        if(iter->IsTransformed() && iter->Transformation()->Changed())
+            {
+            return ETrue;
+            }
+        // Parent opacity affects this visuals opacity if visual is not clipped and outside parent
+        if (iter->iOpacity.Changed())
+            {
+            return ETrue;    
+            }    
+            
+        // Also position (and size) affects
+        if (iter->iPos.Changed() || iter->iSize.Changed())
+            {
+            return ETrue;    
+            }   
+            
+                    
+        iter = iter->Layout();
+        }
+    return EFalse;        
+    }
+
+void CHuiVisual::HandleFlagsChanged( TInt aOldFlags )
+    {
+    // If clipping setting is changed, refresh automatically.
+    const TBool oldClipping = aOldFlags & EHuiVisualFlagClipping;
+    const TBool newClipping = iFlags & EHuiVisualFlagClipping;
+    if ( ( oldClipping && !newClipping ) ||
+         ( !oldClipping && newClipping ) )
+        {
+        SetChanged();
+        }
+    }
+
+EXPORT_C void CHuiVisual::EnableDropShadowL( TBool aEnable )
+    {
+    if ( aEnable && !iVisualData->iDropShadow )
+        {
+        CHuiDropShadow* dropShadowHandler = new (ELeave) CHuiDropShadow;
+        CleanupStack::PushL( dropShadowHandler );
+        dropShadowHandler->ConstructL();
+        CleanupStack::Pop( dropShadowHandler );
+        iVisualData->iDropShadow = dropShadowHandler;
+        SetChanged();
+        }
+    else if ( !aEnable && iVisualData->iDropShadow )
+        {
+        delete iVisualData->iDropShadow;
+        iVisualData->iDropShadow = NULL;
+        SetChanged();
+        }
+    }
+    
+EXPORT_C CHuiDropShadow* CHuiVisual::DropShadowHandler() const
+    {
+    return iVisualData->iDropShadow;
+    }
+CHuiBrushArray* CHuiVisual::Brushes() const
+    {
+    return iBrushes;
+    }
+
+
+EXPORT_C CHuiFxEffect* CHuiVisual::Effect() const
+    {
+    if (!iVisualData)
+        return NULL;
+    else
+        return iVisualData->iEffect;
+    }
+
+EXPORT_C MHuiEffectable *CHuiVisual::Effectable() const
+    {
+    if (!iVisualData)
+        return NULL;
+    else
+        return iVisualData->iEffectable;
+    }
+
+TBool CHuiVisual::IsDelayedEffectSource() const
+    {
+    if (!Effectable())
+        return EFalse;
+    else
+        {
+        TBool b = Effectable()->EffectGetSource();
+        if (!b)
+            { // if not found from this object, try the parent
+            CHuiLayout *l = Layout();
+            if (l)
+                return Layout()->IsDelayedEffectSource();
+            }
+        return b;
+        }
+   }
+
+EXPORT_C void CHuiVisual::SetEffect(CHuiFxEffect* aEffect)
+    {
+    SetFreezeState(EFalse);
+
+    __ALFFXLOGSTRING1("CHuiVisual::SetEffect - : 0x%d ", aEffect );
+    // If effect is replaced by a new effect, we don't want the effect end callback
+    // as it would end the new effect
+    if ( iVisualData->iEffect )
+        {
+#ifdef _ALF_FXLOGGING
+        if ( aEffect )
+            {
+            __ALFFXLOGSTRING1("CHuiVisual::SetEffect - : Deleting previous 0x%x effect on this visual ", iVisualData->iEffect );
+            }
+#endif
+        iVisualData->iEffect->SetEffectEndObserver( NULL, 0 );
+        }
+    delete iVisualData->iEffect;
+    iVisualData->iEffect = aEffect;
+    // The parser must now go
+    delete iVisualData->iEffectParser;
+    iVisualData->iEffectParser = NULL; // the parser just died
+    SetChanged();
+    }
+    
+void CHuiVisual::SetEffectParser( CHuiFxEffectParser* aEffectParser )
+    {
+    delete iVisualData->iEffectParser;
+    iVisualData->iEffectParser = aEffectParser;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/HuiVisualFactory.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "HuiVisualFactory.h"  // Class definition
+#include "uiacceltk/HuiLayouts.h"
+#include "uiacceltk/HuiVisuals.h"
+#include "uiacceltk/HuiControl.h"
+
+CHuiVisualFactory::CHuiVisualFactory(CHuiEnv& aEnv)
+        : iEnv(aEnv)
+    {
+    }
+
+
+	
+CHuiVisualFactory::~CHuiVisualFactory()
+    {    
+    }
+
+
+CHuiVisual* CHuiVisualFactory::NewVisualL(THuiVisualType aVisualType,
+                                          CHuiControl& aOwner) const
+    {
+    CHuiVisual* visual = NewVisualLC(aVisualType, aOwner);
+    CleanupStack::Pop(visual);
+    return visual;
+    }
+    
+    
+CHuiVisual* CHuiVisualFactory::NewVisualLC(THuiVisualType aVisualType,
+                                           CHuiControl& aOwner) const
+    {
+    CHuiVisual* visual = NULL;
+    
+    switch(aVisualType)
+        {
+        case EHuiVisualTypeVisual:
+            visual = new (ELeave) CHuiVisual(aOwner);
+            break;
+            
+        case EHuiVisualTypeLine:
+            visual = new (ELeave) CHuiLineVisual(aOwner);
+            break;
+
+        /*case EHuiVisualTypeGradient:
+            visual = new (ELeave) CHuiGradientVisual(aOwner);
+            break;*/
+
+        case EHuiVisualTypeText:
+            visual = new (ELeave) CHuiTextVisual(aOwner);
+            break;
+
+        case EHuiVisualTypeImage:
+            visual = new (ELeave) CHuiImageVisual(aOwner);
+            break;
+        
+        case EHuiVisualTypeMesh:
+            visual = new (ELeave) CHuiMeshVisual(aOwner);
+            break;
+            
+        case EHuiVisualTypeCanvas:
+            visual = new (ELeave) CHuiCanvasVisual(aOwner);
+            break;
+            
+            
+        default:
+            User::Leave(KErrNotFound);
+        }
+
+    CleanupStack::PushL(visual);
+    visual->ConstructL();
+    return visual;    
+    }
+    
+    
+CHuiLayout* CHuiVisualFactory::NewLayoutL(THuiLayoutType aLayoutType,
+                                          CHuiControl& aOwner) const
+    {
+    CHuiLayout* layout = NewLayoutLC(aLayoutType, aOwner);
+    CleanupStack::Pop(layout);
+    return layout;
+    }
+    
+    
+CHuiLayout* CHuiVisualFactory::NewLayoutLC(THuiLayoutType aLayoutType,
+                                           CHuiControl& aOwner) const
+    {
+    CHuiLayout* layout = NULL;
+    
+    switch(aLayoutType)
+        {
+        case EHuiLayoutTypeLayout:
+            layout = new (ELeave) CHuiLayout(aOwner);
+            break;
+        
+        /*case EHuiLayoutTypeApp:
+            layout = new (ELeave) CHuiAppLayout(aOwner);
+            break;*/
+            
+        case EHuiLayoutTypeGrid:
+            layout = new (ELeave) CHuiGridLayout(aOwner);
+            break;
+            
+        case EHuiLayoutTypeFlow:
+            layout = new (ELeave) CHuiFlowLayout(aOwner);
+            break;
+            
+        case EHuiLayoutTypeAnchor:
+            layout = new (ELeave) CHuiAnchorLayout(aOwner);
+            break;
+            
+        default:
+            User::Leave(KErrNotFound);
+        }
+
+    CleanupStack::PushL(layout);
+    layout->ConstructL();
+    return layout;    
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvasalfpainter.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,614 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiCanvasAlfPainter.
+*
+*/
+
+
+
+
+#include "uiacceltk/HuiCanvasVisual.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiVisual.h"
+#include "uiacceltk/HuiTextMesh.h"
+#include "uiacceltk/HuiCanvasCmdBufferReader.h"
+#include "huicanvasgc.h"
+#include "HuiRenderSurface.h"
+#include "huicanvastexturecache.h"
+#include "huicanvasbackground.h"
+#include <graphics/wsgraphicscontext.h>
+#include <e32cmn.h>
+#include <AknLayoutFont.h>
+#include "huicanvasalfpainter.h"
+
+
+
+
+template <class T> 
+void HuiCanavasGcInternalizeL( const TDesC8& aDes, RArray<T>& aArray )
+    {
+    aArray.Reset();
+    if ( !aDes.Length() )
+        {
+        return;
+        }
+        
+    TInt itemCount = 0;
+    memcpy(&itemCount, &aDes[0], sizeof(TInt));
+
+    TPtrC8 buffer( &aDes[4], itemCount*sizeof(T) );
+    
+    for ( TInt i = 0 ; i < itemCount ;  i++ )
+        {
+        T* itemPtr = (T*)&buffer[i*sizeof(T)];
+        T item = *itemPtr;
+        User::LeaveIfError( aArray.Append( item ) );
+        }
+    }
+
+
+CHuiCanvasAlfPainter* CHuiCanvasAlfPainter::NewL()
+	{
+	CHuiCanvasAlfPainter* self    = new ( ELeave ) CHuiCanvasAlfPainter;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+
+CHuiCanvasAlfPainter::CHuiCanvasAlfPainter()
+    {
+    }
+
+void CHuiCanvasAlfPainter::ConstructL()
+    {
+    iPartialCommandBuffer = NULL;
+    iCanvasGc = CHuiStatic::Renderer().CreateCanvasGcL();    
+    }
+
+
+CHuiCanvasAlfPainter::~CHuiCanvasAlfPainter()
+    {
+    iCachedTexts.Close();
+    iPointCords.Close();	
+    delete iCanvasGc;
+    iCanvasGc = NULL;
+    }
+    
+    
+void CHuiCanvasAlfPainter::HandleBufferL(TRect& aDisplayRect, TInt aAction, const CHuiCanvasVisual& aUser, CHuiGc* aGc, TPoint/* aPos*/ ) 
+    {        
+    TInt commandNumber = 0;
+    TInt currentText = -1;
+    TInt bufferCount = iCommandBuffers.Count();
+    iCanvasGc->SetVisual(aUser);
+    if ( aGc )
+		{
+		iCanvasGc->SetGc(*aGc);
+		}
+	iCanvasGc->SetDefaults();
+	
+    for (TInt cb = 0; cb < bufferCount; cb++)
+        {            
+        TPtrC8 ptr = *iCommandBuffers[cb]->iCommands; 
+        while ( ptr.Length() )    
+            {
+            TInt command = 0;
+            memcpy(&command, &ptr[0], sizeof(TInt));
+            
+            ptr.Set( ptr.Right( ptr.Length() - 4 ) );        
+            
+            TInt bufferLength = 0;
+            memcpy(&bufferLength, &ptr[0], sizeof(TInt));
+
+            // Make sure we are aligned by 4 bytes 
+            TInt padding = 0;
+            if (bufferLength % 4)
+                {
+                padding = 4 - (bufferLength % 4);    
+                }        
+            bufferLength += padding;
+            
+            ptr.Set( ptr.Right( ptr.Length() - 4 ) );
+            
+            TPtrC8 buffer( ptr.Left( bufferLength ).Ptr(), bufferLength );
+
+            ptr.Set( ptr.Right( ptr.Length() - bufferLength) );        
+
+            commandNumber++;
+            switch( command )
+                {
+                case EHuiCanvasDrawImage:
+                    {            
+                    const THuiCanvasDrawImageParams* const params = (THuiCanvasDrawImageParams*)buffer.Ptr();
+                    
+                    CHuiTexture* texture = (CHuiTexture*)(params->iTexture);
+                                    
+                    THuiRealPoint topLeft = THuiRealPoint(params->iDestinationRectTopLeftX,                
+                        params->iDestinationRectTopLeftY);
+                        
+                    THuiRealPoint bottomRight = THuiRealPoint(params->iDestinationRectBottomRightX,                
+                        params->iDestinationRectBottomRightY);
+                    
+                    // Conversion to pixels (if needed) and to screen coordinates from visual coordinates
+                    THuiRealRect destRect = THuiRealRect(aUser.ConvertPoint(topLeft), aUser.ConvertPoint(bottomRight));
+                    
+                    if (aAction == EDrawBuffer)
+                        {
+                        iCanvasGc->DrawImage(*texture, destRect);            
+                        }
+                    else
+                        {
+                        aUser.ExpandRect(aDisplayRect, destRect);    
+                        }    
+                    break;
+                    }
+                case EHuiCanvasPrepareDrawText:
+                    {
+                    TPtrC text((const TUint16*)buffer.Ptr(), buffer.Length()/2);          
+                    
+                    // Check if we already have created a rasterized version of text into cache...
+                    TInt cachedEntry = -1;
+                    for (TInt i=0; i < iCachedTexts.Count(); i++)
+                        {
+                        if (iCachedTexts[i].iId == commandNumber)
+                            {                        
+                            cachedEntry = i;
+                            }
+                        }
+                    
+                    // ...no, this is first drawing time so we need to rasterize text
+                    if (cachedEntry == -1)
+                        {
+                        // Create new text mesh
+                        CHuiTextMesh* mesh = CHuiStatic::Renderer().CreateTextMeshL();
+                        CleanupStack::PushL(mesh);
+                        mesh->SetTextStyle(iCanvasGc->TextStyle());
+                        mesh->SetTextL(text, ETrue);
+
+                        THuiCanvasDrawTextCachedTextEntry newEntry;
+                        newEntry.iId = commandNumber;
+                        newEntry.iTextMesh = mesh;
+                        iCachedTexts.AppendL(newEntry);
+                        CleanupStack::Pop(mesh);
+                        cachedEntry = iCachedTexts.Count() - 1;                    
+                        }
+                    
+                    currentText = commandNumber;                
+                    break;
+                    }
+                case EHuiCanvasDrawText:
+                    {          
+                    const THuiCanvasDrawTextParams* const params = (THuiCanvasDrawTextParams*)buffer.Ptr();
+                                 
+                    THuiRealPoint topLeft = THuiRealPoint(params->iDestinationRectTopLeftX,                
+                        params->iDestinationRectTopLeftY);
+                        
+                    THuiRealPoint bottomRight = THuiRealPoint(params->iDestinationRectBottomRightX,                
+                        params->iDestinationRectBottomRightY);
+                    
+                    // Conversion to pixels (if needed) and to screen coordinates from visual coordinates
+                    THuiRealRect destRect = THuiRealRect(aUser.ConvertPoint(topLeft), aUser.ConvertPoint(bottomRight));
+                    
+                    // Check if we already have created a rasterized version of text into cache...
+                    TInt cachedEntry = -1;
+                    for (TInt i=0; i < iCachedTexts.Count(); i++)
+                        {
+                        if (iCachedTexts[i].iId == currentText)
+                            {                        
+                            cachedEntry = i;
+                            }
+                        }
+                                    
+                    if (cachedEntry != -1 && iCachedTexts[cachedEntry].iTextMesh)
+                        {
+                        if (aAction == EDrawBuffer)
+                            {
+                            iCanvasGc->DrawText(*iCachedTexts[cachedEntry].iTextMesh, destRect);      
+                            }
+                        else if (aAction == EScanBuffer)
+                            {
+                            TSize extents = iCachedTexts[cachedEntry].iTextMesh->Extents();
+                            TRect destinationRect = destRect;
+                            TPoint tl = destinationRect.Center();
+                            switch( iCanvasGc->TextHorizontalAlign() )
+                                {
+                                case EHuiAlignHLeft:
+                                    tl.iX = destinationRect.iTl.iX;
+                                    break;
+                                case EHuiAlignHCenter:
+                                    tl.iX -= extents.iWidth/2;
+                                    break;
+                                case EHuiAlignHRight:
+                                    tl.iX = destinationRect.iBr.iX - extents.iWidth;
+                                    break;
+                                default:
+                                    break;
+                                }
+                            
+                            // check top left Y
+                            switch( iCanvasGc->TextVerticalAlign() )
+                                {
+                                case EHuiAlignVTop:
+                                    tl.iY = destinationRect.iTl.iY;
+                                    break;
+                                case EHuiAlignVCenter:
+                                    tl.iY -= extents.iHeight/2;
+                                    break;
+                                case EHuiAlignVBottom:
+                                    tl.iY = destinationRect.iBr.iY - extents.iHeight;
+                                    break;
+                                default:
+                                    break;
+                                }
+                        
+                            TRect textExtendsRect(tl, extents);
+                            aUser.ExpandRect(aDisplayRect, textExtendsRect);
+                            }    
+                        }
+
+                    break;
+                    }
+                case EHuiCanvasDrawLines:
+                	{
+                    iPointCords.Reset();
+                    TRAP_IGNORE(HuiCanavasGcInternalizeL(buffer, iPointCords))
+                    TInt linecount = iPointCords.Count()/4;
+            	  	RArray<THuiRealLine> lines;
+            	  	for(TInt i=0, j=0; i<linecount; i++)
+                	  	{
+            	  		THuiRealPoint start(iPointCords[j], iPointCords[j+1]);
+            	  		THuiRealPoint end(iPointCords[j+2], iPointCords[j+3]);
+            	  		THuiRealLine line(aUser.ConvertPoint(start), aUser.ConvertPoint(end));
+            	  		lines.Append(line);
+            	  		j += 4;
+                	  	}
+
+                    if (aAction == EDrawBuffer)
+                        {
+                	  	iCanvasGc->DrawLines(lines);
+                        }
+                    else
+                        {
+                        for (TInt i=0;i<lines.Count();i++)
+                            {
+                            TRect pointRect = TRect(lines[i].iStart,lines[i].iStart );
+                            pointRect.Grow(iCanvasGc->PenWidth(), iCanvasGc->PenWidth());                                               
+                            aUser.ExpandRect(aDisplayRect, pointRect);
+                                                    
+                            pointRect = TRect(lines[i].iEnd,lines[i].iEnd );
+                            pointRect.Grow(iCanvasGc->PenWidth(), iCanvasGc->PenWidth());                       
+                            aUser.ExpandRect(aDisplayRect, pointRect);
+                            }                        
+                        }    
+            	  	lines.Close();
+                	break;	
+                	}
+    			
+               	case EHuiCanvasDrawEllipse:
+               		{
+           			const THuiCanvasDrawEllipseParams* const params = (THuiCanvasDrawEllipseParams*)buffer.Ptr();
+            	  	
+            	  	THuiRealPoint topLeft = THuiRealPoint(params->iDestinationRectTopLeftX, params->iDestinationRectTopLeftY);
+                    
+                	THuiRealPoint bottomRight = THuiRealPoint(params->iDestinationRectBottomRightX, params->iDestinationRectBottomRightY);
+                
+                	// Conversion to pixels (if needed) and to screen coordinates from visual coordinates
+                	THuiRealRect destRect = THuiRealRect(aUser.ConvertPoint(topLeft), aUser.ConvertPoint(bottomRight));
+            	  	
+                    if (aAction == EDrawBuffer)
+                        {
+                	  	iCanvasGc->DrawEllipse(destRect);
+                        }
+                    else
+                        {
+                        aUser.ExpandRect(aDisplayRect, destRect);    
+                        }    
+            		break;	
+                	}
+    			case EHuiCanvasDrawPoints:
+    				{
+                    iPointCords.Reset();
+                    TRAP_IGNORE(HuiCanavasGcInternalizeL(buffer, iPointCords))
+                    TInt pointcount = iPointCords.Count()/2;
+              	  	RArray<THuiRealPoint> points;
+            	  	for(TInt i=0, j=0; i<pointcount; i++)
+                	  	{
+              	  		THuiRealPoint point(iPointCords[j], iPointCords[j+1]);
+            	  		points.Append(aUser.ConvertPoint(point));
+            	  		j += 2;
+                	  	}
+                	  	
+                    if (aAction == EDrawBuffer)
+                        {
+                   	  	iCanvasGc->DrawPoints(points);
+                        }
+                    else
+                        {
+                        for (TInt i=0;i<points.Count();i++)
+                            {
+                            TRect pointRect = TRect(points[i],points[i]);
+                            pointRect.Grow(iCanvasGc->PenWidth(), iCanvasGc->PenWidth());                       
+                            aUser.ExpandRect(aDisplayRect, pointRect);
+                            }                        
+                        }    
+               	  	points.Close();
+               		break;	
+                	}
+    			case EHuiCanvasDrawPolygon:
+    				{
+                    iPointCords.Reset();
+                    TRAP_IGNORE(HuiCanavasGcInternalizeL(buffer, iPointCords))
+                    TInt pointcount = iPointCords.Count()/2;
+              	  	RArray<THuiRealPoint> points;
+            	  	for(TInt i=0, j=0; i<pointcount; i++)
+                	  	{
+              	  		THuiRealPoint point(iPointCords[j], iPointCords[j+1]);
+            	  		points.Append(aUser.ConvertPoint(point));
+            	  		j += 2;
+                	  	}
+
+                    if (aAction == EDrawBuffer)
+                        {
+                   	  	iCanvasGc->DrawPolygon(points);
+                        }
+                    else
+                        {
+                        for (TInt i=0;i<points.Count();i++)
+                            {
+                            TRect pointRect = TRect(points[i],points[i]);
+                            pointRect.Grow(iCanvasGc->PenWidth(), iCanvasGc->PenWidth());                       
+                            aUser.ExpandRect(aDisplayRect, pointRect);
+                            }                        
+                        }    
+
+               	  	points.Close();
+                	break;	
+                	}
+    			case EHuiCanvasDrawRects:
+    				{
+                    iPointCords.Reset();
+                    TRAP_IGNORE(HuiCanavasGcInternalizeL(buffer, iPointCords))
+                    TInt rectcount = iPointCords.Count()/4;
+            	  	RArray<THuiRealRect> rects;
+            	  	for(TInt i=0, j=0; i<rectcount; i++)
+                	  	{
+            	  		THuiRealPoint topleft(iPointCords[j], iPointCords[j+1]);
+            	  		THuiRealPoint bottomright(iPointCords[j+2], iPointCords[j+3]);
+            	  		THuiRealRect rect(aUser.ConvertPoint(topleft), aUser.ConvertPoint(bottomright));
+            	  		rects.Append(rect);
+            	  		j += 4;
+                	  	}
+
+           	  	     if (aAction == EDrawBuffer)
+           	  	        {
+                        iCanvasGc->DrawRects(rects);
+           	  	        }
+                     else
+                        {
+                        for (TInt i=0;i<rects.Count();i++)
+                            {
+                            TRect pointRect = rects[i];
+                            pointRect.Grow(iCanvasGc->PenWidth(), iCanvasGc->PenWidth());                       
+                            aUser.ExpandRect(aDisplayRect, pointRect);
+                            }                        
+                        }    
+           	  	        
+            	  	rects.Close();
+               		break;	
+                	}
+
+               	case EHuiCanvasSetTextStyle:
+                    {          
+                    const THuiCanvasSetTextStyleParams* const params = (THuiCanvasSetTextStyleParams*)buffer.Ptr();
+                    iCanvasGc->SetTextStyle(params->iTextStyleId);
+                    break;    
+                    }
+
+    			case EHuiCanvasSetPenColor:
+    				{
+                    const THuiCanvasSetPenColorParams* const params = (THuiCanvasSetPenColorParams*)buffer.Ptr();
+                    iCanvasGc->SetPenColor(params->iPenColor);
+                    break;    
+                	}
+    			case EHuiCanvasSetPenWidth:
+    				{
+                    const THuiCanvasSetPenWidthParams* const params = (THuiCanvasSetPenWidthParams*)buffer.Ptr();
+                    iCanvasGc->SetPenWidth(params->iPenWidth);
+                    break;    
+                	}
+    			case EHuiCanvasSetOpacity:
+    				{
+                    const THuiCanvasSetOpacityParams* const params = (THuiCanvasSetOpacityParams*)buffer.Ptr();
+                    iCanvasGc->SetOpacity(params->iOpacity);
+                    break;    
+                	}
+    			case EHuiCanvasSetPolygonDrawMode:
+    				{
+    				const THuiCanvasSetPolygonDrawModeParams* const params = (THuiCanvasSetPolygonDrawModeParams*)buffer.Ptr();
+                    iCanvasGc->SetPolygonDrawMode(params->iPolygonDrawMode);
+                    break;	
+                	}
+    			case EHuiCanvasSetTextAlign:
+    				{
+    				const THuiCanvasSetTextAlignParams* const params = (THuiCanvasSetTextAlignParams*)buffer.Ptr();
+                    iCanvasGc->SetTextAlign(THuiAlignHorizontal(params->iTextAlignHorizontal), THuiAlignVertical(params->iTextAlignVertical));
+                	break;	
+                	}
+
+        		case EHuiCanvasLoadIdentity:
+    				{
+                    if (aAction == EDrawBuffer)
+                        {                
+        				iCanvasGc->LoadIdentity();
+                        }
+                	break;	
+                	}
+    			case EHuiCanvasTranslate:
+    				{
+    				const THuiCanvasTranslateParams* const params = (THuiCanvasTranslateParams*)buffer.Ptr();
+                    if (aAction == EDrawBuffer)
+                        {                
+                        iCanvasGc->Translate(aUser.ConvertPoint(THuiRealPoint(params->iX,0)).iX,
+                             aUser.ConvertPoint(THuiRealPoint(params->iY,0)).iX, 
+                             aUser.ConvertPoint(THuiRealPoint(params->iZ,0)).iX);
+                        }
+                    else
+                        {
+                        // Calculating transformations may be too difficult, so just set largest possible rect
+                        if (aUser.Clipping() || !aUser.Display())
+                            {
+                            aUser.ExpandRect(aDisplayRect, aUser.DisplayRect());                                        
+                            }
+                        else
+                            {
+                            aUser.ExpandRect(aDisplayRect, aUser.Display()->VisibleArea());            
+                            }    
+                        }    
+                    break;	
+                	}
+    			case EHuiCanvasScale:
+    				{
+    				const THuiCanvasScaleParams* const params = (THuiCanvasScaleParams*)buffer.Ptr();
+                    if (aAction == EDrawBuffer)
+                        {                
+                        iCanvasGc->Scale(params->iX, params->iY, params->iZ);
+                        }
+                    else
+                        {
+                        // Calculating transformations may be too difficult, so just set largest possible rect
+                        if (aUser.Clipping() || !aUser.Display())
+                            {
+                            aUser.ExpandRect(aDisplayRect, aUser.DisplayRect());                                        
+                            }
+                        else
+                            {
+                            aUser.ExpandRect(aDisplayRect, aUser.Display()->VisibleArea());            
+                            }    
+                        }      
+                    break;	
+                	}
+    			case EHuiCanvasRotate:
+    				{
+    				const THuiCanvasRotateParams* const params = (THuiCanvasRotateParams*)buffer.Ptr();
+                    if (aAction == EDrawBuffer)
+                        {                
+        				iCanvasGc->Rotate(params->iAngle, params->iX, params->iY, params->iZ);
+                        }
+                    else
+                        {
+                        // Calculating transformations may be too difficult, so just set largest possible rect
+                        if (aUser.Clipping() || !aUser.Display())
+                            {
+                            aUser.ExpandRect(aDisplayRect, aUser.DisplayRect());                                        
+                            }
+                        else
+                            {
+                            aUser.ExpandRect(aDisplayRect, aUser.Display()->VisibleArea());            
+                            }    
+                        }        
+                    break;	
+                	}
+               default:
+                    {
+                    __ASSERT_DEBUG(EFalse, THuiPanic::Panic(THuiPanic::EUnknown));
+                    break;
+                    } 	            	
+                }                
+            }
+        }     
+    iPaintedRect = aUser.DisplayRect();    
+    }
+
+
+    
+void CHuiCanvasAlfPainter::SetCommandSetL( const TDesC8& aCommands )
+    {
+	CHuiCanvasPainter::SetCommandSetL(aCommands);    
+    }
+    
+void CHuiCanvasAlfPainter::ClearCommandSet()
+    {
+   	CHuiCanvasPainter::ClearCommandSet();
+    }
+
+void CHuiCanvasAlfPainter::AddCommandSetL( const TDesC8& aMoreCommands )
+    {
+    CHuiCanvasPainter::AddCommandSetL(aMoreCommands); 
+    }
+
+void CHuiCanvasAlfPainter::AddPartialCommandSetL( const TDesC8& aMoreCommands, TBool aLastPart )
+    {
+    CHuiCanvasPainter::AddPartialCommandSetL(aMoreCommands,aLastPart); 
+    }
+
+#ifdef HUI_DEBUG_TRACK_DRAWING
+void CHuiCanvasAlfPainter::SetTrackCommandSet( TFileName& aFileName, TBool aTrack )
+    {
+    CHuiCanvasPainter::SetTrackCommandSet( aFileName, aTrack ); 
+    }
+#endif
+
+void CHuiCanvasAlfPainter::ClearCache()
+    {
+    ClearHuiTextCache();	
+    }
+
+void CHuiCanvasAlfPainter::ClearHuiTextCache()
+    {
+    // Hui text meshes
+    for (TInt i=0; i < iCachedTexts.Count(); i++)
+        {
+        delete iCachedTexts[i].iTextMesh;
+        iCachedTexts[i].iTextMesh = NULL;    
+        }                 
+    iCachedTexts.Reset();           	
+    }       
+ 
+CHuiCanvasGc& CHuiCanvasAlfPainter::CanvasGc() const
+	{
+		return *iCanvasGc;
+	}
+
+TInt CHuiCanvasAlfPainter::PaintedAreaCount() const
+    {
+    return 1;    
+    }
+    
+THuiCanvasPaintedArea CHuiCanvasAlfPainter::PaintedArea(TInt /*aIndex*/)
+    {
+    THuiCanvasPaintedArea area;
+    area.iPaintedRect = iPaintedRect;
+    area.iPaintType = EHuiCanvasPaintTypeTransparent;
+    area.iFlags = 0;    
+    return area;
+    }
+
+TInt CHuiCanvasAlfPainter::SetCapturingBufferL(CFbsBitmap* /*aTarget*/)
+    {
+    return KErrNotSupported;
+    }
+
+TInt CHuiCanvasAlfPainter::EnableRenderBuffer(TBool /*aEnable*/)
+    {
+    return KErrNotSupported;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvasbackground.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,257 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "huicanvasbackground.h"
+#include "huicanvasgc.h"
+#include <uiacceltk/HuiSkin.h>
+#include <uiacceltk/HuiS60Skin.h>
+#include <uiacceltk/HuiCanvasVisual.h>
+#include <uiacceltk/HuiDisplay.h>
+#include <uiacceltk/HuiStatic.h>
+#include <uiacceltk/HuiEnv.h>
+
+#include <e32cmn.h>
+
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CHuiCanvasBackground::CHuiCanvasBackground()
+    {	    
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CHuiCanvasBackground::~CHuiCanvasBackground()
+    {
+    iBackgroundItems.Close();
+    }
+    
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CHuiCanvasBackground* CHuiCanvasBackground::NewL()
+    {
+    CHuiCanvasBackground* self = CHuiCanvasBackground::NewLC();
+    CleanupStack::Pop(self);
+    return self;        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+CHuiCanvasBackground* CHuiCanvasBackground::NewLC()
+    {
+    CHuiCanvasBackground* self = new (ELeave) CHuiCanvasBackground();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasBackground::ConstructL()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasBackground::SetVisual(CHuiCanvasVisual* aVisual)
+    {
+    iCanvasVisual = aVisual;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasBackground::SetClearBackground(CHuiDisplay::TClearMode aClearBackground)
+    {
+    iClearBackground = aClearBackground;    
+    iBackgroundItems.Reset();
+    if(aClearBackground == CHuiDisplay::EClearWithSkinBackground)
+        {
+        TRAP_IGNORE(CHuiStatic::Env().Skin().TextureL(EHuiSkinBackgroundTexture));
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TInt CHuiCanvasBackground::ClearBackground()
+    {
+    return iClearBackground;        
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+
+TInt CHuiCanvasBackground::BackgroundItemsCount()
+    {
+    return iBackgroundItems.Count();        
+    }
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasBackground::SetBackgroundColor(const TRgb& aBackgroundColor)
+    {
+    iBackgroundColor = aBackgroundColor;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+TRgb CHuiCanvasBackground::BackgroundColor() const
+    {
+    return iBackgroundColor;    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasBackground::SetBackgroundItems(const RArray<THuiDisplayBackgroundItem>& aItems)
+    {
+    iClearBackground = CHuiDisplay::EClearNone;
+    iBackgroundItems.Reset();
+    for(TInt i = 0; i < aItems.Count(); ++i)
+        {
+        iBackgroundItems.Append(aItems[i]);
+        }   
+    if (!CHuiStatic::Env().Renderer() == EHuiRendererBitgdi)
+        {
+        CHuiS60Skin* s60skin = static_cast<CHuiS60Skin*>(&CHuiStatic::Env().Skin());
+        TRAP_IGNORE(s60skin->UpdateBackgroundsL(iBackgroundItems));
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasBackground::GetBackgroundItems(RArray<THuiDisplayBackgroundItem>& aItems)
+    {
+    aItems.Reset();
+    for(TInt i = 0; i < iBackgroundItems.Count(); ++i)
+        {
+        aItems.Append(aItems[i]);
+        }   
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasBackground::DrawSelf(CHuiGc& aGc, const TRect& aDisplayRect)
+    {
+	iCanvasVisual->CanvasGc().SetGc(aGc);
+	    
+    // Clear background for the dirty area
+    if (iBackgroundItems.Count() != 0)
+        {
+        ClearWithBackgroundItems(aDisplayRect);    
+        }
+    else
+        {
+        switch (iClearBackground)
+            {
+            case CHuiDisplay::EClearWithColor:
+                {
+                ClearWithColor(aGc, aDisplayRect);                            
+                break;    
+                }
+            case CHuiDisplay::EClearWithSkinBackground:
+                {
+                ClearWithSkinBackground(aDisplayRect);                                                    
+                break;    
+                }
+            case CHuiDisplay::EClearNone:
+            default:
+                {
+                // Don't do anything
+                break;    
+                }                                                
+            }                                    
+        }                                                
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasBackground::ClearWithBackgroundItems(const TRect& aDisplayRect)
+    {    
+    if (!iCanvasVisual)
+        {
+        return;    
+        }
+
+    CHuiCanvasGc& canvasGc = iCanvasVisual->CanvasGc();
+    canvasGc.ClearWithBackgroundItems(aDisplayRect, iBackgroundItems);    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasBackground::ClearWithSkinBackground(const TRect& aDisplayRect)
+    {    
+    if (!iCanvasVisual)
+        {
+        return;    
+        }
+
+    CHuiCanvasGc& canvasGc = iCanvasVisual->CanvasGc();
+    canvasGc.ClearWithSkinBackground(aDisplayRect);    
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+//
+void CHuiCanvasBackground::ClearWithColor(CHuiGc& /*aGc*/, const TRect& aDisplayRect)
+    {    
+    if (!iCanvasVisual)
+        {
+        return;    
+        }
+
+    CHuiCanvasGc& canvasGc = iCanvasVisual->CanvasGc();
+            
+    canvasGc.SetPenColor(iBackgroundColor);
+    canvasGc.SetOpacity(TReal32(iBackgroundColor.Alpha()) / 255.f);    
+    canvasGc.Clear(aDisplayRect);    
+    }
+    
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvasdebugwsgc.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,639 @@
+/*
+* 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:   Definition of CHuiCanvasDebugWsGc.
+*
+*/
+
+
+#include "huicanvasdebugwsgc.h"
+#include "huicanvaswsgc.h"
+#include "alfcommanddebug.h"
+
+void CHuiCanvasDebugWsGc::WsBitBltL(TInt aBitmapHandle, TPoint aPoint)
+    {
+    iCommandDebugger.SetHandle(aBitmapHandle);
+    iCommandDebugger.SetPoint(aPoint);
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsBitBltL(aBitmapHandle, aPoint);
+    }
+
+void CHuiCanvasDebugWsGc::WsBitBltRectL(TInt aBitmapHandle, TPoint aPoint,
+        TRect aRect)
+    {
+    iCommandDebugger.SetHandle(aBitmapHandle);
+    iCommandDebugger.SetRect(aRect);
+    iCommandDebugger.SetPoint(aPoint);
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsBitBltRectL(
+            aBitmapHandle,
+            aPoint,
+            aRect);
+    }
+
+void CHuiCanvasDebugWsGc::WsBitBltMaskedL(TInt aBitmapHandle,
+        TInt aMaskHandle, TInt aInvertMask, TPoint aPoint, TRect aRect)
+    {
+    iCommandDebugger.SetHandle(aBitmapHandle);
+    iCommandDebugger.SetRect(aRect);
+    iCommandDebugger.SetPoint(aPoint);
+    iCommandDebugger.Print();
+
+    iCanvasWsGc->WsBitBltMaskedL(aBitmapHandle, aMaskHandle, aInvertMask,
+            aPoint, aRect);
+    }
+
+void CHuiCanvasDebugWsGc::WsBitBltMaskedPointL(TInt aBitmapHandle,
+        TInt aMaskHandle, TPoint aPoint1, TPoint aPoint2, TRect aRect)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsBitBltMaskedPointL(aBitmapHandle, aMaskHandle, aPoint1,
+            aPoint2, aRect);
+    }
+
+void CHuiCanvasDebugWsGc::WsResetClippingRegionL()
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsResetClippingRegionL();
+    }
+
+void CHuiCanvasDebugWsGc::WsClearL()
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsClearL();
+    }
+
+void CHuiCanvasDebugWsGc::WsClearRectL(TRect& aRect)
+    {
+    iCommandDebugger.SetRect(aRect);
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsClearRectL(aRect);
+    }
+void CHuiCanvasDebugWsGc::WsResetBrushPatternL()
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsResetBrushPatternL();
+    }
+
+void CHuiCanvasDebugWsGc::WsResetFontL()
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsResetFontL();
+    }
+;
+void CHuiCanvasDebugWsGc::WsDrawArcL(TPoint aPoint1, TPoint aPoint2,
+        TRect aRect)
+    {
+    iCommandDebugger.Print();    
+    iCanvasWsGc->WsDrawArcL(aPoint1, aPoint2, aRect);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawPieL(TPoint aPoint1, TPoint aPoint2,
+        TRect aRect)
+    {
+    iCommandDebugger.Print();    
+    iCanvasWsGc->WsDrawPieL(aPoint1, aPoint2, aRect);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawBitmap1L(TInt aBitmapHandle, TRect aRect)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsDrawBitmap1L(aBitmapHandle, aRect);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawBitmap2L(TInt aBitmapHandle, TRect aRect1,
+        TRect aRect2)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsDrawBitmap2L(aBitmapHandle, aRect1, aRect2);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawBitmap3L(TInt aBitmapHandle, TPoint aPoint)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsDrawBitmap3L(aBitmapHandle, aPoint);
+    }
+void CHuiCanvasDebugWsGc::WsDrawBitmapMaskedL(TInt aBitmapHandle,
+        TInt aMaskHandle, TInt aInvertMask, TRect& aRect1, TRect& aRect2)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsDrawBitmapMaskedL(aBitmapHandle,
+            aMaskHandle,
+            aInvertMask,
+            aRect1, aRect2);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawRoundRectL(TPoint aPoint, TRect& aRect)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsDrawRoundRectL(aPoint, aRect);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawPolyLineL(CArrayFix<TPoint>* aPointerArray)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsDrawPolyLineL(aPointerArray);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawPolyLineNoEndPointL(TPoint* aPointerArray,
+        TInt aCount)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsDrawPolyLineNoEndPointL(aPointerArray, aCount);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawPolygonL(CArrayFix<TPoint>* aPointerArray,
+        TInt aFillRule)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsDrawPolygonL(aPointerArray, aFillRule);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawEllipseL(TRect& aRect)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsDrawEllipseL(aRect);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawLineL(TPoint& aStart, TPoint& aEnd)
+    {
+    iCommandDebugger.SetPoint( aStart );
+    iCommandDebugger.SetPoint( aEnd );
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsDrawLineL( aStart, aEnd);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawLineToL(TPoint& aPoint)
+    {
+    iCommandDebugger.SetPoint( aPoint );
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsDrawLineToL(aPoint);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawLineByL(TPoint& aPoint)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsDrawLineByL(aPoint);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawRectL(TRect& aRect)
+    {
+    iCommandDebugger.SetRect( aRect );
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsDrawRectL(aRect);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawText1L(TPtr& aTextValue,
+        THuiCanvasTextParameters& aTextParameters)
+    {
+    iCommandDebugger.SetText( aTextValue );
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsDrawText1L(aTextValue, aTextParameters);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawText2L(TPtr& aTextValue, TPoint& aPoint,
+        THuiCanvasTextParameters& aTextParameters)
+    {
+    iCommandDebugger.SetText( aTextValue );
+     iCommandDebugger.Print();
+        iCanvasWsGc->WsDrawText2L(aTextValue, aPoint, aTextParameters);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawText3L(TPtr& aTextValue, TRect& aRect,
+        THuiCanvasTextParameters& aTextParameters)
+    {
+    iCommandDebugger.SetText( aTextValue );
+        iCommandDebugger.Print();
+       
+    iCanvasWsGc->WsDrawText3L(aTextValue, aRect, aTextParameters);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawText4L(TPtr& aTextValue, TRect& aRect,
+        TInt aBaselineOffset, TInt aTextAlign, TInt aTextMargin,
+        THuiCanvasTextParameters& aTextParameters)
+    {
+    iCommandDebugger.SetText(aTextValue);
+    iCommandDebugger.SetRect(aRect);
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsDrawText4L(aTextValue, aRect,
+            aBaselineOffset, // textBaselineOffset
+            aTextAlign, // textAlign
+            aTextMargin, // textMargin,
+            aTextParameters);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawText5L(TPtr& aTextValue, TRect& aRect,
+        TInt aBaselineOffset, TInt aTextAlign, TInt aTextMargin,
+        TInt aTextWidth, THuiCanvasTextParameters& aTextParameters)
+    {
+    iCommandDebugger.SetText(aTextValue);
+    iCommandDebugger.SetRect(aRect);
+    iCommandDebugger.Print();
+
+    iCanvasWsGc->WsDrawText5L(aTextValue, aRect,
+            aBaselineOffset, // textBaselineOffset
+            aTextAlign, // textAlign
+            aTextMargin, // textMargin,
+            aTextWidth, // textWidth
+            aTextParameters);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawTextVertical1L(TPtr& aTextValue,
+        TInt aTextUp, THuiCanvasTextParameters& aTextParameters)
+    {
+    iCommandDebugger.SetText(aTextValue);
+    iCommandDebugger.Print();
+
+    iCanvasWsGc->WsDrawTextVertical1L(aTextValue, aTextUp,
+            aTextParameters);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawTextVertical2L(TPtr& aTextValue,
+        TInt aTextUp, TPoint& aPoint,
+        THuiCanvasTextParameters& aTextParameters)
+    {
+    iCommandDebugger.SetText(aTextValue);
+    iCommandDebugger.SetPoint( aPoint );
+    iCommandDebugger.Print();
+
+    iCanvasWsGc->WsDrawTextVertical2L(aTextValue, aTextUp, aPoint,
+            aTextParameters);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawTextVertical3L(TPtr& aTextValue,
+        TInt aTextUp, TRect& aRect, THuiCanvasTextParameters& aTextParameters)
+    {
+    iCommandDebugger.SetText(aTextValue);
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsDrawTextVertical3L(aTextValue, aTextUp, aRect,
+            aTextParameters);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawTextVertical4L(TPtr& aTextValue,
+        TRect& aRect, TInt aBaselineOffset, TInt aTextUp, TInt aTextAlign,
+        TInt aTextMargin, THuiCanvasTextParameters& aTextParameters)
+    {
+    iCommandDebugger.SetText(aTextValue);
+    iCommandDebugger.Print();
+        
+    iCanvasWsGc->WsDrawTextVertical4L(aTextValue, aRect, aBaselineOffset,
+            aTextUp, aTextAlign, aTextMargin, aTextParameters);
+    }
+
+void CHuiCanvasDebugWsGc::WsDrawTextVertical5L(TPtr& aTextValue,
+        TRect& aRect, TInt aBaselineOffset, TInt aTextUp, TInt aTextAlign,
+        TInt aTextMargin, TInt aTextWidth,
+        THuiCanvasTextParameters& aTextParameters)
+    {
+    iCommandDebugger.SetText(aTextValue);
+    iCommandDebugger.Print();
+        
+    iCanvasWsGc->WsDrawTextVertical5L(aTextValue, aRect, aBaselineOffset,
+            aTextUp, aTextAlign, aTextMargin, aTextWidth, aTextParameters);
+    }
+
+void CHuiCanvasDebugWsGc::WsMoveToL(TPoint& aPoint)
+    {
+    iCommandDebugger.SetPoint(aPoint);
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsMoveToL(aPoint);
+    }
+
+void CHuiCanvasDebugWsGc::WsMoveByL(TPoint& aPoint)
+    {
+    iCommandDebugger.SetPoint(aPoint);
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsMoveByL(aPoint);
+    }
+
+void CHuiCanvasDebugWsGc::WsPlotL(TPoint& aPoint)
+    {
+    iCommandDebugger.SetPoint(aPoint);
+    iCommandDebugger.Print();
+        
+    iCanvasWsGc->WsPlotL(aPoint);
+    }
+
+void CHuiCanvasDebugWsGc::WsResetL()
+    {
+    iCommandDebugger.Print();
+        
+    iCanvasWsGc->WsResetL();
+    }
+
+void CHuiCanvasDebugWsGc::WsSetBrushColorL(TRgb aColor)
+    {
+    iCommandDebugger.SetColor(aColor);
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetBrushColorL(aColor);
+    }
+
+void CHuiCanvasDebugWsGc::WsSetBrushOriginL(TPoint& aPoint)
+    {
+    iCommandDebugger.SetPoint(aPoint);
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetBrushOriginL(aPoint);
+    }
+;
+void CHuiCanvasDebugWsGc::WsSetBrushStyleL(TInt aStyle)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetBrushStyleL(aStyle);
+    }
+;
+void CHuiCanvasDebugWsGc::WsSetClippingRegionL(RRegion& aRegion)
+    {
+    iCommandDebugger.SetRegion(aRegion);
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetClippingRegionL(aRegion);
+    }
+
+void CHuiCanvasDebugWsGc::WsSetDrawModeL(TInt aDrawMode)
+    {
+    iCommandDebugger.SetHandle(aDrawMode);
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetDrawModeL(aDrawMode);
+    }
+
+void CHuiCanvasDebugWsGc::WsSetOriginL(TPoint& aOrigin)
+    {
+    iCommandDebugger.SetPoint( aOrigin );
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetOriginL(aOrigin);
+
+    }
+void CHuiCanvasDebugWsGc::WsSetPenColorL(TRgb aColor)
+    {
+    iCommandDebugger.SetColor(aColor);
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetPenColorL(aColor);
+    }
+
+void CHuiCanvasDebugWsGc::WsSetPenStyleL(TInt aStyle)
+    {
+    iCommandDebugger.SetHandle( aStyle );
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetPenStyleL(aStyle);
+    }
+
+void CHuiCanvasDebugWsGc::WsSetPenSizeL(TInt aWidth, TInt aHeight)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetPenSizeL( aWidth, aHeight);
+    }
+
+void CHuiCanvasDebugWsGc::WsSetTextShadowColorL(TRgb aColor)
+    {
+    iCommandDebugger.SetColor(aColor);
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetTextShadowColorL(aColor);
+    }
+;
+void CHuiCanvasDebugWsGc::WsSetCharJustificationL(TInt aExcessiveWidth,
+        TInt aNumGap)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetCharJustificationL(aExcessiveWidth, aNumGap);
+    }
+
+void CHuiCanvasDebugWsGc::WsSetWordJustificationL(TInt aExcessiveWidth,
+        TInt aNumGap)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetWordJustificationL(aExcessiveWidth, aNumGap);
+    }
+
+void CHuiCanvasDebugWsGc::WsSetUnderlineStyleL(TInt aValue)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetUnderlineStyleL( aValue );
+    }
+
+void CHuiCanvasDebugWsGc::WsSetBrushPatternL(TInt aValue)
+    {
+    iCommandDebugger.Print();
+        
+    iCanvasWsGc->WsSetBrushPatternL(aValue);
+    }
+
+//  void CHuiCanvasDebugWsGc::SetBrushPattern(TInt aFbsBitmapHandle){};
+void CHuiCanvasDebugWsGc::WsSetFontL(TInt aFontId)
+    {
+    iCommandDebugger.SetHandle( aFontId );
+    iCommandDebugger.Print();
+        
+    iCanvasWsGc->WsSetFontL(aFontId);
+    }
+
+void CHuiCanvasDebugWsGc::WsCopyRectL(TPoint& aPoint, TRect& aRect)
+    {
+    iCommandDebugger.SetPoint( aPoint );
+    iCommandDebugger.SetRect( aRect );
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsCopyRectL(aPoint, aRect);
+    }
+
+void CHuiCanvasDebugWsGc::WsCopySettingsL()
+    {
+    iCommandDebugger.Print();
+        
+    iCanvasWsGc->WsCopySettingsL();
+    }
+;
+void CHuiCanvasDebugWsGc::WsUpdateJustificationL(TPtr& aTextValue)
+    {
+    iCommandDebugger.SetText( aTextValue );
+    iCommandDebugger.Print();
+        
+    iCanvasWsGc->WsUpdateJustificationL(aTextValue);
+    }
+
+void CHuiCanvasDebugWsGc::WsUpdateJustificationVerticalL(TInt aValue,
+        TPtr& aTextValue)
+    {
+    iCommandDebugger.Print();
+        
+    iCanvasWsGc->WsUpdateJustificationVerticalL( aValue , aTextValue);
+    }
+
+void CHuiCanvasDebugWsGc::WsSetFontNoDuplicateL(TInt aCurrentFont)
+    {
+    iCommandDebugger.SetHandle( aCurrentFont );
+    iCommandDebugger.Print();
+        
+    iCanvasWsGc->WsSetFontNoDuplicateL(aCurrentFont);
+    }
+
+
+void CHuiCanvasDebugWsGc::WsSetClippingRectL(TRect& aRect)
+    {
+    iCommandDebugger.SetRect(aRect);
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetClippingRectL(aRect);
+    }
+
+void CHuiCanvasDebugWsGc::WsCancelClippingRectL()
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsCancelClippingRectL();
+    }
+
+void CHuiCanvasDebugWsGc::WsSetFadedL(TInt& aFaded)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetFadedL(aFaded);
+    }
+
+void CHuiCanvasDebugWsGc::WsSetFadingParametersL(TInt aFaded1, TInt aFaded2)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetFadingParametersL(aFaded1, aFaded2);
+    }
+
+void CHuiCanvasDebugWsGc::WsFadeAreaL(RRegion& aRegion)
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsFadeAreaL(aRegion);
+    }
+
+void CHuiCanvasDebugWsGc::WsMapColorsL()
+    {
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsMapColorsL();
+    }
+
+void CHuiCanvasDebugWsGc::WsSetUserDisplayModeL(TInt aMode)
+    {
+    iCommandDebugger.SetHandle(aMode);
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsSetUserDisplayModeL(aMode);
+    }
+
+void CHuiCanvasDebugWsGc::WsUseFontL(TInt aCurrentFont)
+    {
+    iCommandDebugger.SetHandle(aCurrentFont);
+    iCommandDebugger.Print();
+    iCanvasWsGc->WsUseFontL(aCurrentFont);
+    }
+
+void CHuiCanvasDebugWsGc::WsCombinedBitBltMaskedL(TRect aDestinationRect,
+        const RArray<THuiCachedCombinedImageParams>& aBlits)
+    {
+    iCommandDebugger.SetRect(aDestinationRect);
+    iCommandDebugger.Print();
+
+    iCanvasWsGc->WsCombinedBitBltMaskedL(aDestinationRect, aBlits );
+    }
+
+
+void CHuiCanvasDebugWsGc::BeginActionL(TInt aAction, TRect aDisplayRect,
+        const CHuiCanvasVisual& aUser, TBool aIsCachePrepared, const TRegion& aUpdateRegion)
+    {
+    iCanvasWsGc->BeginActionL(aAction, aDisplayRect, aUser, aIsCachePrepared, aUpdateRegion);
+    }
+
+void CHuiCanvasDebugWsGc::EndActionL(const TRegion& aUpdateRegion, TBool aUpdateDisplay)
+    {
+    iCanvasWsGc->EndActionL(aUpdateRegion, aUpdateDisplay);
+    }
+
+
+TInt CHuiCanvasDebugWsGc::SetCapturingBufferL(CFbsBitmap* aTarget)
+    {
+    return iCanvasWsGc->SetCapturingBufferL( aTarget );
+    }
+
+CHuiCanvasGc& CHuiCanvasDebugWsGc::CanvasGc() const
+    {
+    return iCanvasWsGc->CanvasGc();
+    }
+
+void CHuiCanvasDebugWsGc::ClearCache()
+    {
+    iCanvasWsGc->ClearCache();        
+    }
+
+void CHuiCanvasDebugWsGc::SetRelativeOrientation(CHuiGc::TOrientation aOrientation)
+    {
+    iCanvasWsGc->SetRelativeOrientation(aOrientation);
+    }
+
+TBool CHuiCanvasDebugWsGc::IsRenderBufferEnabled() const
+    {
+    return iCanvasWsGc->IsRenderBufferEnabled();    
+    }
+
+TBool CHuiCanvasDebugWsGc::IsRenderBufferPrepared() const
+    {
+    return iCanvasWsGc->IsRenderBufferPrepared();    
+    }
+
+TBool CHuiCanvasDebugWsGc::IsRenderBufferInitialized() const
+    {
+    return iCanvasWsGc->IsRenderBufferInitialized();    
+    }
+
+TInt CHuiCanvasDebugWsGc::EnableRenderbuffer(TBool aEnable)
+    {
+    return iCanvasWsGc->EnableRenderbuffer(aEnable);    
+    }
+
+THuiCanvasWsGcType CHuiCanvasDebugWsGc::Type() const
+    {
+    return iCanvasWsGc->Type();
+    }
+
+CHuiCanvasDebugWsGc::CHuiCanvasDebugWsGc( CAlfCommandDebug& aCommandDebugger ) : iCommandDebugger( aCommandDebugger )
+    {
+    
+    }
+
+CHuiCanvasDebugWsGc* CHuiCanvasDebugWsGc::NewL( CHuiCanvasWsGc* aHuiCanvasGc, CAlfCommandDebug& aCommandDebugger )
+    {
+    CHuiCanvasDebugWsGc* self;
+    self = new(ELeave)CHuiCanvasDebugWsGc( aCommandDebugger );
+    CleanupStack::PushL( self );
+    self->ConstructL( aHuiCanvasGc);
+    CleanupStack::Pop();
+    return self;
+    }
+
+void CHuiCanvasDebugWsGc::ConstructL(
+        CHuiCanvasWsGc* aHuiCanvasGc )
+    {
+    
+    iCanvasWsGc = aHuiCanvasGc;
+     
+    }
+
+void CHuiCanvasDebugWsGc::SetPositionDelta(TPoint& aPoint)
+    {
+    iCanvasWsGc->SetPositionDelta(aPoint);
+    }
+
+CHuiCanvasDebugWsGc::~CHuiCanvasDebugWsGc()
+    {
+    delete iCanvasWsGc;
+    }
+
+void CHuiCanvasDebugWsGc::EnableUpdateRegion(const TRegion& aUpdateRegion, TBool aClear)
+    {
+    iCanvasWsGc->EnableUpdateRegion(aUpdateRegion, aClear);
+    }
+
+void CHuiCanvasDebugWsGc::DisableUpdateRegion()
+    {
+    iCanvasWsGc->DisableUpdateRegion();
+    }
+
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvasgc.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1405 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 class for cnaves graphics context
+*
+*/
+
+
+
+#include "huicanvasgc.h"
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiImage.h"
+#include "uiacceltk/HuiCanvasVisual.h"
+#include "uiacceltk/HuiCurvePath.h"
+#include "uiacceltk/HuiMappingFunctions.h"
+#include "HuiRenderSurface.h"
+#include "uiacceltk/HuiStatic.h"
+#include "huicanvasrenderbuffer.h"
+
+#ifndef __SERIES60_30__     
+#include "HuiTargetBitmap.h"
+#endif
+
+#include <e32math.h>
+
+
+EXPORT_C CHuiCanvasGc::CHuiCanvasGc():
+    iPenColor(KRgbBlack),
+    iPenWidth(1.f),
+    iOpacity(1.f),
+    iPolygonDrawMode(EHuiNoFill),
+    iVerticalTextAlign(EHuiAlignVTop),
+    iHorizontalTextAlign(EHuiAlignHLeft),
+    iTextStyleId(EHuiTextStyleNormal),
+    iEffectiveOpacityEnabled(ETrue)
+    {	    
+    }
+
+EXPORT_C CHuiCanvasGc::~CHuiCanvasGc()
+    {
+    iClippingRegion.Close();
+    iDelayedClipRegion.Close();	
+
+    iTempRegion.Close();
+    iTempRegion2.Close();
+    }
+
+EXPORT_C void CHuiCanvasGc::SetGc(CHuiGc& aGc)
+    {
+    iGc = &aGc;        
+    }
+    
+EXPORT_C void CHuiCanvasGc::SetVisual(const CHuiCanvasVisual& aVisual)
+    {
+    iVisual = (CHuiCanvasVisual*)&aVisual;    
+    }
+
+EXPORT_C void CHuiCanvasGc::Clip(const TRect& aClipRect)
+    {
+    if (!iGc)
+       {
+       return;    
+       }
+    
+    switch (iClipMode)
+        {
+        case EHuiCanvasClipModeNormal:
+        case EHuiCanvasClipModeDelayed:
+            {
+            if (iClippingRegion.Count())
+                {
+                CancelClipping();    
+                }
+
+            if (!aClipRect.IsEmpty())
+                {
+                iTempRegion.Clear();
+                iTempRegion.AddRect(aClipRect);
+                ClipRegion(iTempRegion);
+                }
+            break;    
+            }
+        case EHuiCanvasClipModeNone:
+        default:
+            {
+            // Do nothing            
+            break;    
+            }
+        }    
+    }
+
+EXPORT_C void CHuiCanvasGc::ClipRegion(const TRegion& aClipRegion)
+    {
+    if (!iGc)
+       {
+       return;    
+       }
+
+    switch (iClipMode)
+        {
+        case EHuiCanvasClipModeNormal:
+            {
+            // If previous clipping region set, cancel it first.
+            if (iClippingRegion.Count())
+                {
+                CancelClipping();    
+                }
+                
+            // Set new region, ignore empty rects if any
+            for (TInt i=0; i < aClipRegion.Count(); i++)
+                {
+                if (!aClipRegion[i].IsEmpty())
+                    {
+                    iClippingRegion.AddRect(aClipRegion[i]);    
+                    }                                        
+                }
+            
+            iClippingRegion.Tidy();
+            
+            if (iClippingRegion.Count() == 1)
+                {
+                // If only one rect, then do simple clipping...                    
+                iGc->Enable(CHuiGc::EFeatureClipping);
+                iGc->PushClip();
+                iGc->Clip(iClippingRegion[0]);                
+                }
+            else if (iClippingRegion.Count() > 1)
+                {
+                // ...otherewise must do region clipping.
+                iGc->Enable(CHuiGc::EFeatureClipping);
+                iGc->PushClip();
+                if (MaxNumberOfClipRects() > 1)
+                    {
+                    iGc->Clip(iClippingRegion);                    
+                    }
+                else
+                    {
+                    // region clipping is not available, try boundingrect
+                    iGc->Clip(iClippingRegion.BoundingRect());                                        
+                    }
+                }
+            else
+                {
+                // No clip rects set, do nothing here.    
+                }                                
+            break;
+            }
+        case EHuiCanvasClipModeDelayed:
+            {
+            // If previous clipping region set, cancel it first.
+            if (iClippingRegion.Count())
+                {
+                CancelClipping();    
+                }
+                
+            // Set new region, ignore empty rects if any
+            for (TInt i=0; i < aClipRegion.Count(); i++)
+                {
+                if (!aClipRegion[i].IsEmpty())
+                    {
+                    iClippingRegion.AddRect(aClipRegion[i]);    
+                    }                    
+                }
+
+            iClippingRegion.Tidy();
+            break;    
+            }
+        case EHuiCanvasClipModeNone:
+        default:
+            {
+            // Do nothing            
+            break;    
+            }
+        }    
+    }  
+
+EXPORT_C void CHuiCanvasGc::CancelClipping()
+    {
+    if (!iGc)
+       {
+       return;    
+       }
+
+
+    switch (iClipMode)
+        {
+        case EHuiCanvasClipModeNormal:
+            {
+            if (iClippingRegion.Count())
+                {
+                iClippingRegion.Clear();
+                iGc->Enable(CHuiGc::EFeatureClipping);
+                iGc->PopClip();                            
+                }
+            break;
+            }
+        case EHuiCanvasClipModeDelayed:
+            {
+            iDelayedClipRegion.Clear();
+            iClippingRegion.Clear();
+            break;    
+            }
+        case EHuiCanvasClipModeNone:
+        default:
+            {
+            // Do nothing            
+            break;    
+            }
+        }    
+    }
+
+EXPORT_C void CHuiCanvasGc::DrawImage(const CHuiTexture& aImage, const THuiRealRect& aDestinationRect)
+    {
+    if (!iGc)
+        {
+        return;    
+        }
+
+    THuiRealRect srcRect = THuiRealRect(TPoint(0,0), aImage.Size() );
+    DrawImage(aImage, aDestinationRect, srcRect);
+    }
+        
+EXPORT_C void CHuiCanvasGc::DrawText(const CHuiTextMesh& aTextMesh, const THuiRealRect& aDestinationRect)
+    {
+    if (!iGc)
+        {
+        return;    
+        }
+
+    Setup();
+    
+    EnableBlendingIfNeeded();
+    
+    THuiTextStyle* textStyle = CHuiStatic::Env().TextStyleManager().TextStyle(iTextStyleId);
+    if (textStyle)
+        {
+        iGc->SetFont(textStyle->Font());        
+        }    
+    iGc->SetAlign(iHorizontalTextAlign, iVerticalTextAlign);
+
+    EnableDelayedClippingIfNeeded(aDestinationRect);	
+    
+    while (ClipNext())
+        {
+        iGc->DrawText(aTextMesh, aDestinationRect, 0.f);                              
+        }
+    
+    DisableDelayedClippingIfNeeded();       
+    
+    Cleanup();
+    }
+    
+    
+EXPORT_C void CHuiCanvasGc::DrawLines(RArray<THuiRealLine>& aLines)
+	{
+	if (!iGc)
+        {
+        return;    
+        }
+
+    Setup();
+
+    EnableBlendingIfNeeded();
+
+    EnableDelayedClippingIfNeeded(aLines);
+	
+    while (ClipNext())
+        {
+        DoDrawLines(aLines);
+        }
+
+    DisableDelayedClippingIfNeeded();    
+
+    Cleanup();
+	}
+
+EXPORT_C void CHuiCanvasGc::DoDrawLines(RArray<THuiRealLine>& aLines)
+	{
+    for(TInt i=0; i<aLines.Count(); i++)
+ 	   	{
+ 	   	TPoint start = aLines[i].iStart; 
+ 	   	TPoint end = aLines[i].iEnd;
+    	iGc->DrawLine(start, end, iPenWidth);
+    	}        
+	}
+	
+
+EXPORT_C void CHuiCanvasGc::DrawEllipse(const THuiRealRect& aDestinationRect)
+	{
+	if (!iGc)
+	    {
+	    return;    
+	    }
+	double startx = aDestinationRect.iTl.iX + aDestinationRect.Width();
+    double starty = aDestinationRect.iTl.iY + aDestinationRect.Height()/2;   
+  
+    DrawArc(aDestinationRect, THuiRealPoint(startx,starty), THuiRealPoint(startx,starty));	
+	}
+
+EXPORT_C void CHuiCanvasGc::DrawRoundRect(const THuiRealRect& aDestinationRect, 
+        const THuiRealSize& aSize)
+    {   
+    if (!iGc)
+        {
+        return;    
+        }
+
+    Setup();
+
+    EnableDelayedClippingIfNeeded(aDestinationRect);    
+
+    while (ClipNext())
+        {
+        DoDrawRoundRect(aDestinationRect, aSize);
+        }
+        
+    DisableDelayedClippingIfNeeded();    
+
+    Cleanup();
+    }
+
+EXPORT_C void CHuiCanvasGc::DoDrawRoundRect(const THuiRealRect& aDestinationRect, 
+        const THuiRealSize& aSize)
+    {   
+    THuiRealSize cornerRectSize = THuiRealSize( 2*aSize.iWidth, 2*aSize.iHeight);
+    
+    THuiRealPoint topLeftCornerRectTL=aDestinationRect.iTl;
+    THuiRealRect topLeftCornerRect = THuiRealRect(topLeftCornerRectTL,cornerRectSize);
+    
+    THuiRealPoint topRightCornerRectTL=THuiRealPoint
+    (aDestinationRect.iTl.iX + aDestinationRect.Width()-2*(aSize.iWidth), aDestinationRect.iTl.iY);
+    THuiRealRect topRightCornerRect = THuiRealRect(topRightCornerRectTL, cornerRectSize);
+    
+    THuiRealPoint bottomRightCornerRectTL = THuiRealPoint
+    (aDestinationRect.iBr.iX-(2*aSize.iWidth),aDestinationRect.iBr.iY-(2*aSize.iHeight));
+    THuiRealRect bottomRightCornerRect = THuiRealRect(bottomRightCornerRectTL, cornerRectSize);
+    
+    THuiRealPoint bottomLeftCornerRectTL = THuiRealPoint(aDestinationRect.iTl.iX, 
+            aDestinationRect.iTl.iY + aDestinationRect.Height() -2*(aSize.iHeight));   
+    THuiRealRect bottomLeftCornerRect = THuiRealRect(bottomLeftCornerRectTL,cornerRectSize);
+ 
+    THuiRealPoint topLeftArcStart = THuiRealPoint(topLeftCornerRectTL.iX + aSize.iWidth, topLeftCornerRectTL.iY);
+    THuiRealPoint topLeftArcEnd = THuiRealPoint(topLeftCornerRectTL.iX, topLeftCornerRectTL.iY + aSize.iHeight);
+    DoDrawArc(topLeftCornerRect, topLeftArcStart,topLeftArcEnd);
+    
+    THuiRealPoint topRightArcStart = THuiRealPoint(topRightCornerRectTL.iX + 2*aSize.iWidth, 
+            topRightCornerRectTL.iY + aSize.iHeight);
+    THuiRealPoint topRightArcEnd = THuiRealPoint(topRightCornerRectTL.iX + aSize.iWidth, topRightCornerRectTL.iY);
+    DoDrawArc(topRightCornerRect, topRightArcStart, topRightArcEnd);
+    
+    THuiRealPoint bottomRightArcStart = THuiRealPoint(bottomRightCornerRectTL.iX + aSize.iWidth, 
+            bottomRightCornerRectTL.iY + 2*aSize.iHeight);
+    THuiRealPoint bottomRightArcEnd = THuiRealPoint(bottomRightCornerRectTL.iX + 2*aSize.iWidth, 
+            bottomRightCornerRectTL.iY + aSize.iHeight);
+    DoDrawArc(bottomRightCornerRect,bottomRightArcStart ,bottomRightArcEnd);
+    
+    THuiRealPoint bottomLeftArcStart = THuiRealPoint(bottomLeftCornerRectTL.iX, bottomLeftCornerRectTL.iY +
+            aSize.iHeight);
+    THuiRealPoint bottomLeftArcEnd = THuiRealPoint(bottomLeftCornerRectTL.iX + 
+            aSize.iWidth, bottomLeftCornerRectTL.iY + 2*aSize.iHeight);
+    DoDrawArc(bottomLeftCornerRect, bottomLeftArcStart, bottomLeftArcEnd);
+    if(iPolygonDrawMode)
+        {
+        RArray<THuiRealRect> rects;
+        rects.Append(THuiRealRect(topLeftArcStart,bottomRightArcStart));        
+        rects.Append(THuiRealRect(topLeftArcEnd, THuiRealSize(aSize.iWidth,aDestinationRect.Height()-(2*aSize.iHeight))));
+        rects.Append(THuiRealRect(THuiRealPoint(topRightArcStart.iX - aSize.iWidth,topRightArcStart.iY),
+                 THuiRealSize(aSize.iWidth,aDestinationRect.Height()-(2*aSize.iHeight))));
+        
+        DoDrawRects(rects);
+        rects.Close();
+        }
+    else
+        {
+        RArray<THuiRealLine> lines;
+        lines.Append(THuiRealLine(topLeftArcStart,topRightArcEnd));        
+        lines.Append(THuiRealLine(topLeftArcEnd, bottomLeftArcStart));
+        lines.Append(THuiRealLine(bottomLeftArcEnd, bottomRightArcStart));
+        lines.Append(THuiRealLine(bottomRightArcEnd, topRightArcStart));
+        DoDrawLines(lines);
+        lines.Close();
+        }
+    }
+
+
+EXPORT_C void CHuiCanvasGc::DrawPie(const THuiRealRect& aDestinationRect, 
+        const THuiRealPoint& aStart, const THuiRealPoint& aEnd)
+    {   
+    if (!iGc)
+       {
+       return;    
+       }
+
+    Setup();
+
+    EnableDelayedClippingIfNeeded(aDestinationRect);    
+
+    while (ClipNext())
+        {
+        DoDrawPie( aDestinationRect, aStart, aEnd);
+        }
+
+    DisableDelayedClippingIfNeeded();    
+
+    Cleanup();
+    }
+
+EXPORT_C void CHuiCanvasGc::DoDrawPie(const THuiRealRect& aDestinationRect, 
+        const THuiRealPoint& aStart, const THuiRealPoint& aEnd)
+    {
+    double startx = aDestinationRect.iTl.iX + aDestinationRect.Width()/2;
+    double starty = aDestinationRect.iTl.iY + aDestinationRect.Height()/2;      
+    DoDrawPie( aDestinationRect, aStart, aEnd);
+    }
+
+EXPORT_C void CHuiCanvasGc::DrawArc(const THuiRealRect& aDestinationRect, 
+        const THuiRealPoint& aStart, const THuiRealPoint& aEnd)
+    {    
+	if (!iGc)
+        {
+        return;    
+        }
+    
+    Setup();
+
+    EnableBlendingIfNeeded();
+    
+    EnableDelayedClippingIfNeeded(aDestinationRect);    
+
+    while (ClipNext())
+        {
+        DoDrawArc(aDestinationRect, aStart, aEnd);
+        }
+    
+    DisableDelayedClippingIfNeeded();    
+    
+    Cleanup();
+	}
+
+EXPORT_C void CHuiCanvasGc::DoDrawArc(const THuiRealRect& aDestinationRect, 
+        const THuiRealPoint& aStart, const THuiRealPoint& aEnd)
+    {    
+    TPoint start = aStart;
+    TPoint end = aEnd;
+    TReal startx = aDestinationRect.iTl.iX;
+    TReal starty = aDestinationRect.iTl.iY;
+    TReal rx = aDestinationRect.Width()/2;
+    TReal ry = aDestinationRect.Height()/2; 
+    startx += rx;
+    starty += ry;
+    //Check if given start and end point lie on ellipse, if not, 
+    //Find the point of intersection of ellipse with line joing to ellipse origin and start point
+    //and ellipse origin and end point
+    if ( ((aStart.iX-startx)*(aStart.iX-startx)/(rx*rx) + (aStart.iY-starty)*(aStart.iY-starty)/(ry*ry))!=1 )
+       {
+       TReal m = (aStart.iY-starty)/(aStart.iX - startx);
+       TReal intersectionPointX;
+       TReal src = (rx*rx*ry*ry)/((ry*ry)+(rx*rx*m*m));
+       Math::Sqrt(intersectionPointX,src);
+       TReal intersectionPointY = starty + (m*intersectionPointX);
+       intersectionPointX = intersectionPointX + startx;       
+       start.iX = intersectionPointX;
+       start.iY = intersectionPointY;
+       }
+    if ( ((aEnd.iX-startx)*(aEnd.iX-startx)/(rx*rx) + (aEnd.iY-starty)*(aEnd.iY-starty)/(ry*ry))!=1 )
+       {
+       TReal m = (aEnd.iY-starty)/(aEnd.iX - startx);
+       TReal intersectionPointX;
+       TReal src = (rx*rx*ry*ry)/((ry*ry)+(rx*rx*m*m));
+       Math::Sqrt(intersectionPointX,src);
+       TReal intersectionPointY = (m*intersectionPointX) + starty;
+       intersectionPointX = intersectionPointX + startx;       
+       end.iX = intersectionPointX;
+       end.iY = intersectionPointY;
+       }  
+    TReal startAngle = 0;
+    Math::ATan(startAngle,(starty-start.iY),(start.iX-startx));
+    startAngle = (startAngle*180)/KPi;
+   
+    TReal endAngle = 0;
+    Math::ATan(endAngle,(starty-end.iY),(end.iX-startx));
+    endAngle = (endAngle*180)/KPi;
+   
+    if ( endAngle <= startAngle )
+        endAngle = 360 + endAngle;
+   
+    // this is very slow, needs to be re-implemented    
+    if(iPolygonDrawMode)
+       {     
+       TReal x,y,newx,newy;
+       x = startx;
+       y = starty;
+       newx = x;
+       newy = y;
+       RArray<THuiRealPoint> points;
+       for(TInt i = -endAngle; i <-startAngle ; i++)
+	        {
+	        double a = double(i) * KPi / 180.0;        
+	        double sin, cos;
+	        
+	        Math::Sin( sin, a );
+	        Math::Cos( cos, a );
+
+	        newx = startx + cos * rx;
+	        newy = starty + sin * ry;        
+	        
+	        points.Append(THuiRealPoint(x,y));
+	        points.Append(THuiRealPoint(newx, newy));
+				        
+	        x = newx;
+	        y = newy;
+	        }
+	    DoDrawPolygon(points);
+	    points.Close();
+	    }
+    else
+	    {
+	    CHuiCurvePath* path = NULL;
+	    TRAPD(error, path = CHuiCurvePath::NewL());
+	    if(error ==KErrNone)
+	    	{
+	    	TRAP(error,path->AppendArcL(THuiRealPoint(startx, starty), THuiRealSize(rx, ry), -startAngle, -endAngle, 1));
+	    	if(error ==KErrNone)
+	    		{
+				THuiLinearMappingFunction alphaFunc;
+				alphaFunc.iOffset = iOpacity;
+				THuiLinearMappingFunction widthFunc;
+				widthFunc.iOffset = iPenWidth;
+				
+				const TPoint pt(0,0);
+				RHuiOwnedPointer<CHuiCurvePath> iPath;
+				iPath.Set(path, EHuiHasOwnership);
+            
+  				iGc->DrawPath(iPath.Ref(), pt, 0.0, 1.0, &alphaFunc, &widthFunc);
+	    		}
+	    	}
+		}    
+	}
+
+		
+EXPORT_C void CHuiCanvasGc::DrawPoints(RArray<THuiRealPoint>& aPoints)
+	{
+	if (!iGc)
+        {
+        return;    
+        }
+
+    Setup();
+      
+    EnableBlendingIfNeeded();
+
+    EnableDelayedClippingIfNeeded(aPoints);    
+
+    while (ClipNext())
+        {            
+        DoDrawPoints(aPoints);
+        }
+
+    DisableDelayedClippingIfNeeded(); 
+
+    Cleanup(); 
+    }
+
+EXPORT_C void CHuiCanvasGc::DoDrawPoints(RArray<THuiRealPoint>& aPoints)
+	{
+    for(TInt i=0; i< aPoints.Count(); i++)
+ 	   	{
+ 	   	TInt TlOffset = TInt(iPenWidth/2);
+		TInt BrOffset = TInt(TReal(iPenWidth)/2.f + 0.5f); 	   	
+ 	   	TPoint Tl = TPoint(aPoints[i].iX - TlOffset, aPoints[i].iY - TlOffset);
+		TPoint Br = TPoint(aPoints[i].iX + BrOffset, aPoints[i].iY + BrOffset);
+		iGc->DrawRect(TRect(Tl, Br));
+    	}        
+    }
+
+	
+EXPORT_C void CHuiCanvasGc::DrawPolygon(RArray<THuiRealPoint>& aPoints)
+	{
+	if (!iGc)
+        {
+        return;    
+        }
+        
+    Setup();
+  
+    EnableBlendingIfNeeded();
+
+    EnableDelayedClippingIfNeeded(aPoints);    
+
+    while (ClipNext())
+        {                    
+        DoDrawPolygon(aPoints);
+        }
+
+    DisableDelayedClippingIfNeeded(); 
+
+    Cleanup();       
+	}
+
+EXPORT_C void CHuiCanvasGc::DoDrawPolygon(RArray<THuiRealPoint>& aPoints)
+	{
+    TInt i=0;
+    for(; i<(aPoints.Count()-1); i++)
+ 	   	{
+ 	   	iGc->DrawLine(aPoints[i], aPoints[i+1], iPenWidth);
+    	}
+    iGc->DrawLine(aPoints[i], aPoints[0], iPenWidth);        
+	}
+
+	
+EXPORT_C void CHuiCanvasGc::DrawRects(RArray<THuiRealRect>& aRects)
+	{
+	if (!iGc)
+        {
+        return;    
+        }
+
+    Setup();
+  
+    EnableBlendingIfNeeded();
+        
+    EnableDelayedClippingIfNeeded(aRects);
+
+    while (ClipNext())
+        {
+        DoDrawRects(aRects);
+        }
+
+    DisableDelayedClippingIfNeeded();                
+
+    Cleanup();
+	}
+
+EXPORT_C void CHuiCanvasGc::DoDrawRects(RArray<THuiRealRect>& aRects)
+	{
+	for(TInt i=0; i<aRects.Count(); i++)
+		{
+		TRect rect = aRects[i].Round();
+		if (rect.Height() > 0 && rect.Width() > 0)
+		    {		        	
+        	if(iPolygonDrawMode == 0)
+        	    {
+        	    // By definition, symbian TRect Br coordinates are outside of the rect so subract those here first
+        	    rect.iBr.iX--;
+        	    rect.iBr.iY--;
+        	    
+        	    // TODO: following does overlapping drawing at the corners, it could be fixed but might not be 
+        	    // trivial if pensize is bigger than 1
+                if (rect.Width())
+                    iGc->DrawLine(TPoint(rect.iTl.iX, rect.iTl.iY), TPoint(rect.iBr.iX, rect.iTl.iY), iPenWidth); // Top
+                
+                if (rect.Height() > 2 && rect.Width() > 1)
+                    iGc->DrawLine(TPoint(rect.iBr.iX, rect.iTl.iY), TPoint(rect.iBr.iX, rect.iBr.iY), iPenWidth); // Right
+                
+                if (rect.Width() && rect.Height() > 1)
+                    iGc->DrawLine(TPoint(rect.iTl.iX, rect.iBr.iY), TPoint(rect.iBr.iX, rect.iBr.iY), iPenWidth); // Bottom
+                
+                if (rect.Height() > 2)
+                    iGc->DrawLine(TPoint(rect.iTl.iX, rect.iTl.iY), TPoint(rect.iTl.iX,rect.iBr.iY), iPenWidth); // Left        	    
+        	    }
+        	else
+        	    {
+      		  	iGc->DrawRect(rect);
+        	    }
+		    }    	    
+		}            
+	}
+
+EXPORT_C void CHuiCanvasGc::SetTextStyle(TInt aStyleId)
+    {
+    iTextStyleId = aStyleId;    
+    }
+
+EXPORT_C TInt CHuiCanvasGc::TextStyle() const
+    {
+    return iTextStyleId;    
+    }
+    
+EXPORT_C void CHuiCanvasGc::SetPenColor(const TRgb& aColor)
+	{
+	iPenColor = aColor;
+	}
+	
+EXPORT_C void CHuiCanvasGc::SetPenWidth(const TReal32& aWidth)
+	{
+	iPenWidth = aWidth;
+	}
+	
+EXPORT_C void CHuiCanvasGc::SetOpacity(const TReal32& aOpacity)
+	{
+	iOpacity = aOpacity;
+	}
+
+EXPORT_C void CHuiCanvasGc::SetPolygonDrawMode(THuiFillMode aPolygonDrawMode)
+	{
+	iPolygonDrawMode = aPolygonDrawMode;
+	}
+	
+EXPORT_C void CHuiCanvasGc::SetTextAlign(THuiAlignHorizontal aAlignHorizontal, THuiAlignVertical aAlignVertical)
+	{
+	iVerticalTextAlign = aAlignVertical;
+    iHorizontalTextAlign = aAlignHorizontal;
+    }
+    
+EXPORT_C void CHuiCanvasGc::SetDefaults()
+	{
+	SetTextStyle(0);
+    SetPenColor(TRgb(255,255,255));
+	SetPenWidth(1.0);
+	SetOpacity(1.0);
+	SetPolygonDrawMode(EHuiNoFill);
+	SetTextAlign(EHuiAlignHLeft, EHuiAlignVTop);
+    SetDrawMode(EHuiCanvasDrawModeBlend);
+    EnableEffectiveOpacity(ETrue);    
+    SetPolygonFillTexture(NULL);
+    SetPolygonFillTextureOrigin(TPoint(0,0));
+	CancelClipping();
+	}
+    
+    // Transformations
+EXPORT_C void CHuiCanvasGc::LoadIdentity()
+	{
+    iGc->Pop(EHuiGcMatrixModel);
+    iGc->Push(EHuiGcMatrixModel);	
+	}
+	
+EXPORT_C void CHuiCanvasGc::Translate(const TReal32& aX, const TReal32& aY, const TReal32& aZ)
+	{
+	if (!iGc)
+        {
+        return;    
+        }
+        
+    iGc->SetAlign(EHuiAlignHLeft, EHuiAlignVTop);        
+    iGc->Translate(EHuiGcMatrixModel, aX, aY, aZ);    
+    }
+
+EXPORT_C void CHuiCanvasGc::Scale(const TReal32& aX, const TReal32& aY, const TReal32& aZ)
+	{
+	if (!iGc)
+        {
+        return;    
+        }
+        
+    iGc->SetAlign(EHuiAlignHLeft, EHuiAlignVTop);        
+    iGc->Scale(EHuiGcMatrixModel, aX, aY, aZ);
+	}
+
+EXPORT_C void CHuiCanvasGc::Rotate(const TReal32& aAngle, const TReal32& aX, const TReal32& aY, const TReal32& aZ)    
+	{
+	if (!iGc)
+        {
+        return;    
+        }
+        
+    iGc->SetAlign(EHuiAlignHLeft, EHuiAlignVTop);        
+    iGc->Rotate(EHuiGcMatrixModel, aAngle, aX, aY, aZ);
+	}
+
+EXPORT_C TInt CHuiCanvasGc::TextVerticalAlign() const
+    {
+    return iVerticalTextAlign;    
+    }
+
+EXPORT_C TInt CHuiCanvasGc::TextHorizontalAlign() const
+    {
+    return iHorizontalTextAlign;    
+    }
+    
+EXPORT_C TReal32 CHuiCanvasGc::PenWidth() const
+    {
+    return iPenWidth;    
+    }
+
+EXPORT_C THuiFillMode CHuiCanvasGc::PolygonDrawMode() const
+    {
+    return iPolygonDrawMode;    
+    }
+    
+EXPORT_C void CHuiCanvasGc::DrawImage(const CHuiTexture& aImage, const THuiRealRect& aDestinationRect, const THuiRealRect& aSourceRect)
+    {
+    DrawImage(aImage, aDestinationRect, aSourceRect, CHuiGc::EStretchFull);        
+    }
+
+EXPORT_C void CHuiCanvasGc::DrawImage(const CHuiTexture& aImage, 
+    const THuiRealRect& aDestinationRect, 
+    const THuiRealRect& aSourceRect,
+    CHuiGc::TStretchMode aStretchMode)
+    {
+    if (!iGc)
+        {
+        return;    
+        }
+
+    Setup();
+
+    THuiImage image = THuiImage(aImage);           
+
+    // If renderer supports texture coordinates, we can use those to specify subset of image
+    EnableBlendingIfNeeded(&aImage);
+
+    TSize textureSize = aImage.Size();        
+
+    if  (textureSize.iWidth > 0 && textureSize.iHeight > 0)
+        {
+        THuiRealRect fullTextureRect = THuiRealRect(TPoint(0,0), aImage.Size());
+        THuiRealRect partialTextureRect = fullTextureRect;
+        
+        // Calculate intersection
+       	if (partialTextureRect.iTl.iX<aSourceRect.iTl.iX)
+    		partialTextureRect.iTl.iX=aSourceRect.iTl.iX;
+	    if (partialTextureRect.iTl.iY<aSourceRect.iTl.iY)
+		    partialTextureRect.iTl.iY=aSourceRect.iTl.iY;
+	    if (partialTextureRect.iBr.iX>aSourceRect.iBr.iX)
+		    partialTextureRect.iBr.iX=aSourceRect.iBr.iX;
+    	if (partialTextureRect.iBr.iY>aSourceRect.iBr.iY)
+	        partialTextureRect.iBr.iY=aSourceRect.iBr.iY;
+    	
+        TReal32 tlX = TReal32(partialTextureRect.iTl.iX)/TReal32(textureSize.iWidth);
+        TReal32 tlY = TReal32(partialTextureRect.iTl.iY)/TReal32(textureSize.iHeight);
+        TReal32 brX = TReal32(partialTextureRect.iBr.iX)/TReal32(textureSize.iWidth);
+        TReal32 brY = TReal32(partialTextureRect.iBr.iY)/TReal32(textureSize.iHeight);        
+        
+        image.SetTexCoords(tlX,tlY,brX, brY);          
+
+        TSize usedSize = aDestinationRect.Size().Round();
+                
+        if(aStretchMode != CHuiGc::EStretchFull && 
+           aStretchMode != CHuiGc::EStretchHorizontal && 
+           partialTextureRect.Height() < usedSize.iHeight)
+            {
+            usedSize.iHeight = partialTextureRect.Height();  
+            }
+        
+        if(aStretchMode != CHuiGc::EStretchFull &&
+           aStretchMode != CHuiGc::EStretchVertical && 
+           partialTextureRect.Width() < usedSize.iWidth)
+            {
+            usedSize.iWidth = partialTextureRect.Width();  
+            }
+        
+        TRect updatedArea = TRect(aDestinationRect.iTl.Round(), usedSize);
+
+        if (usedSize.iHeight > 0 && usedSize.iWidth > 0)
+            {                
+            EnableDelayedClippingIfNeeded(updatedArea);
+			
+            while (ClipNext())
+                {
+                iGc->DrawImage(image, aDestinationRect.iTl, usedSize);                                
+                } 
+            DisableDelayedClippingIfNeeded();    
+            }
+        }    
+
+    Cleanup();        
+    }
+    
+EXPORT_C void CHuiCanvasGc::Clear(const THuiRealRect& aRect)
+    {
+    if (!iGc)
+        {
+        return;    
+        }
+
+    TReal32 effectiveOpacity = 1.f;
+    if (iVisual && iEffectiveOpacityEnabled)
+        {
+        effectiveOpacity = iVisual->EffectiveOpacity();    
+        }
+    iGc->SetPenAlpha(TInt(iOpacity * effectiveOpacity * 255));
+    iGc->SetPenColor(iPenColor);
+    iGc->SetAlign(EHuiAlignHLeft, EHuiAlignVTop);            
+    iGc->Disable(CHuiGc::EFeatureBlending);
+    iGc->Enable(CHuiGc::EFeatureClipping);            
+    iGc->PushClip();
+    iGc->Clip(aRect.Round()); // takes transformations into account
+    iGc->Clear(); 
+    iGc->PopClip();
+    iGc->Enable(CHuiGc::EFeatureBlending);
+    }
+
+EXPORT_C void CHuiCanvasGc::ClearWithSkinBackground(const THuiRealRect& /*aRect*/)
+    {
+    // Implementation is renderspecific        
+    }
+
+    
+EXPORT_C void CHuiCanvasGc::ClearWithBackgroundItems(const THuiRealRect& /*aRect*/,
+        const RArray<THuiDisplayBackgroundItem>& /*aItems*/)
+    {        
+    // Implementation is renderspecific   
+    }
+    
+EXPORT_C void CHuiCanvasGc::EnableBlendingIfNeeded(const CHuiTexture* aTexture)
+    {
+    if (iDrawMode == EHuiCanvasDrawModeBlend)
+        {
+        iGc->Enable(CHuiGc::EFeatureBlending);    
+
+        // Optimization, enable blending only if really needed, on some HW blending slows performance.
+        /*
+        if ((iGc->PenColor().Alpha() == 255) && (iGc->PenAlpha() == 255) && (!aTexture || !aTexture->HasAlpha()))
+            {
+            iGc->Disable(CHuiGc::EFeatureBlending);   
+            }
+        else
+            {
+            iGc->Enable(CHuiGc::EFeatureBlending);    
+            }
+        */                
+        }
+    else if (iDrawMode == EHuiCanvasDrawModeNormal)
+        {
+        iGc->Disable(CHuiGc::EFeatureBlending);        
+        }
+    else
+        {
+        // Unknown mode !
+        }
+    }
+
+THuiCanvasDrawMode CHuiCanvasGc::DrawMode() const
+    {
+    return iDrawMode;
+    }
+
+
+    
+CHuiCanvasVisual* CHuiCanvasGc::Visual() const
+    {
+    return iVisual;    
+    }
+
+TRgb CHuiCanvasGc::PenColor() const
+    {
+    return iPenColor;    
+    }
+    
+TReal32 CHuiCanvasGc::Opacity() const
+    {
+    return iOpacity;
+    
+    }
+    
+EXPORT_C CHuiCanvasGc::TClipRectVisibility CHuiCanvasGc::IsClipped(const TRect& aRect) const
+    {
+    TClipRectVisibility isClipped = EFullyOutside;
+    if (!iGc)
+        {
+        return isClipped;
+        }
+
+    // First check the active clipping region from GC...
+    
+    // aRect is untransformed, activeClippingRegion is transformed
+    // so we must transform aRect first when we comapre it to activeClippingRegion...
+    THuiRealRect transformed = aRect;
+    iGc->TransformDirtyRect(transformed );
+    const TRegion& activeClippingRegion = iGc->ClipRegion();
+
+    isClipped = IsClipped(transformed.Round(), activeClippingRegion);
+    //...fully outside of GC so it would not be drawn regardless of
+    // the iClipRegion (if it is trying to do clipping), we can return immediately.
+    if (isClipped == EFullyOutside && activeClippingRegion.Count())
+        {        
+        return isClipped;
+        }            
+    //...not clipped by active clip region, check our own iClipRegion
+    if (iClippingRegion.Count())
+        {
+        isClipped = IsClipped(aRect, iClippingRegion);
+        }
+    
+    return isClipped;
+    }
+
+CHuiCanvasGc::TClipRectVisibility CHuiCanvasGc::IsClipped(const TRect& aRect, const TRegion& aClippingRegion) const
+    {
+    TClipRectVisibility isClipped = EFullyOutside;
+    if (!aClippingRegion.Count())
+        {
+        return EFullyInside;
+        }
+    
+    if (!aRect.IsEmpty() && aClippingRegion.Count())
+        {    
+#if 0            
+        TBool test = EFalse;        
+        if (test)
+            {
+            for (TInt i=0; i<aClippingRegion.Count(); i++)
+                {
+#ifdef _DEBUG
+                RDebug::Print(_L("aClippingRegion Rect: %d %d %d %d"), 
+                        aClippingRegion[i].iTl.iX, 
+                        aClippingRegion[i].iTl.iY,
+                        aClippingRegion[i].iBr.iX,
+                        aClippingRegion[i].iBr.iY);
+#endif
+                }                            
+            }
+#endif        
+        
+        if (aClippingRegion.Intersects(aRect))
+            {            
+            iTempRegion.Clear();
+            iTempRegion2.Clear();
+
+            iTempRegion.AddRect(aRect);
+            
+            iTempRegion2.Intersection(aClippingRegion, iTempRegion);
+            iTempRegion2.Tidy();
+            
+            // Assume it is only partially inside region -> Clipped
+            isClipped = EPartialOverlap;
+            
+            if (iTempRegion2.Count() == 1)
+                {
+                if (iTempRegion2[0] == aRect)
+                    {
+                    // Fully inside region -> Not clipped
+                    isClipped = EFullyInside;    
+                    }                
+                }
+            
+            }
+        else
+            {
+            // No overlap -> aRect is completely outside region -> Clipped
+            isClipped = EFullyOutside;    
+            }                    
+        }
+    return isClipped;
+    }
+
+
+EXPORT_C CHuiCanvasGc::TClipRectVisibility CHuiCanvasGc::IsClipped(const TPoint& aPoint) const
+    {
+    return IsClipped(aPoint, iClippingRegion);
+    }
+
+CHuiCanvasGc::TClipRectVisibility CHuiCanvasGc::IsClipped(const TPoint& aPoint, const TRegion& aClippingRegion) const
+    {
+    if (iClippingRegion.Count() && !aClippingRegion.Contains(aPoint))
+        {
+        return EFullyOutside;
+        }
+    else 
+        {
+        return EFullyInside;
+        }
+    }
+
+CHuiCanvasGc::TClipRectVisibility CHuiCanvasGc::IsClipped(const TRegion& aTestedRegion, const TRegion& aClippingRegion) const
+    {
+    TClipRectVisibility isWholeRegionClipped = EUnknown;
+    TInt count = aTestedRegion.Count(); 
+    
+    if (count == 0)
+        {
+        isWholeRegionClipped = EFullyOutside;
+        }
+    
+    for (TInt i=0; i<count; i++)
+        {
+        TClipRectVisibility isRectClipped = IsClipped(aTestedRegion[i], aClippingRegion);
+        if (isWholeRegionClipped == EFullyInside)
+            {
+            if (isRectClipped == EFullyOutside ||
+                isRectClipped == EPartialOverlap )
+                {
+                isWholeRegionClipped = EPartialOverlap;
+                }            
+            }
+        else if (isWholeRegionClipped == EFullyOutside)
+            {
+            if (isRectClipped == EFullyInside ||
+                isRectClipped == EPartialOverlap )
+                {
+                isWholeRegionClipped = EPartialOverlap;
+                }                        
+            }
+        else if (isWholeRegionClipped == EPartialOverlap)
+            {
+            // No changes to isWholeRegionClipped in this case and no need to look further
+            break;
+            }
+        else
+            {
+            isWholeRegionClipped = isRectClipped;
+            }                   
+        }
+    return isWholeRegionClipped;
+    }
+
+
+EXPORT_C void CHuiCanvasGc::SetClippingMode(THuiCanvasClipMode aClipMode)
+    {
+    iClipMode = aClipMode;    
+    }
+
+EXPORT_C void CHuiCanvasGc::SetDrawMode(THuiCanvasDrawMode aDrawMode)
+    {
+    iDrawMode = aDrawMode;
+    }
+
+EXPORT_C CHuiCanvasGc::TClipRectVisibility CHuiCanvasGc::EnableDelayedClippingIfNeeded(const THuiRealRect& aUpdatedRect)
+    {
+    iDelayedClipCount = 0;
+    iDelayedClipVisibility = EPartialOverlap;
+    if (iClipMode == EHuiCanvasClipModeDelayed)
+        {            
+        iDelayedClipVisibility = IsClipped(aUpdatedRect.Round());
+        if ( iDelayedClipVisibility ==  EPartialOverlap )
+            {
+            // Could copy only needed rects to avoid excessive clipping
+            iDelayedClipRegion.Copy(iClippingRegion);
+            }
+        }                        
+    return iDelayedClipVisibility;
+    }
+
+EXPORT_C CHuiCanvasGc::TClipRectVisibility CHuiCanvasGc::EnableDelayedClippingIfNeeded(const RArray<THuiRealRect>& aUpdatedRects)
+    {
+    iDelayedClipCount = 0;
+    iDelayedClipVisibility = EPartialOverlap;
+    if (iClipMode == EHuiCanvasClipModeDelayed)
+        {            
+        for (TInt i=0; i<aUpdatedRects.Count(); i++)
+            {
+            iDelayedClipVisibility = IsClipped(aUpdatedRects[i].Round());            
+            if (iDelayedClipVisibility ==  EPartialOverlap)
+                {
+                // Could copy only needed rects to avoid excessive clipping
+                iDelayedClipRegion.Copy(iClippingRegion);
+                break;
+                }                                                
+            }        
+        }
+    return iDelayedClipVisibility;
+    }
+    
+    
+EXPORT_C CHuiCanvasGc::TClipRectVisibility CHuiCanvasGc::EnableDelayedClippingIfNeeded(const RArray<THuiRealPoint>& aUpdatedPoints)
+    {
+    iDelayedClipCount = 0;
+    iDelayedClipVisibility = EPartialOverlap;
+
+    if (iClipMode == EHuiCanvasClipModeDelayed)
+        {
+        for (TInt i=0; i<aUpdatedPoints.Count();i++)
+            {
+            iDelayedClipVisibility = IsClipped(aUpdatedPoints[i].Round());
+            if (iDelayedClipVisibility != EFullyOutside)
+                {
+                // Could copy only needed rects to avoid excessive clipping
+                iDelayedClipRegion.Copy(iClippingRegion);
+                break;
+                }                                
+            }                    
+        }
+    return iDelayedClipVisibility;
+    }
+
+EXPORT_C CHuiCanvasGc::TClipRectVisibility CHuiCanvasGc::EnableDelayedClippingIfNeeded(const RArray<THuiRealLine>& aUpdatedLines)
+    {
+    iDelayedClipCount = 0;
+    TClipRectVisibility vis1 = EPartialOverlap;
+    TClipRectVisibility vis2 = EPartialOverlap;
+
+    if (iClipMode == EHuiCanvasClipModeDelayed)
+        {
+        for (TInt i=0; i<aUpdatedLines.Count();i++)
+            {
+            TPoint start = aUpdatedLines[i].iStart.Round();
+            TPoint end = aUpdatedLines[i].iEnd.Round();            
+            vis1 = IsClipped(start);
+            vis2 = IsClipped(end);
+            if ((vis1 != EFullyOutside) || (vis2 != EFullyOutside))
+                {
+                // Could copy only needed rects to avoid excessive clipping
+                iDelayedClipRegion.Copy(iClippingRegion);
+                break;
+                }                                
+            }                    
+        }        
+    if (vis1 == EFullyOutside && vis2 == EFullyOutside)
+        {
+        iDelayedClipVisibility = EFullyOutside;
+        }
+    else
+        {
+        iDelayedClipVisibility = EPartialOverlap;
+        }
+    return iDelayedClipVisibility;
+    }
+
+    
+    
+EXPORT_C TBool CHuiCanvasGc::ClipNext()
+    {
+    if (iDelayedClipVisibility != EFullyOutside && 
+        iDelayedClipRegion.Count() && 
+        iDelayedClipCount < iDelayedClipRegion.Count())        
+        {
+        if (iDelayedClipRectPushed)
+            {
+            iGc->PopClip();    
+            }                
+      	
+      	iGc->Enable(CHuiGc::EFeatureClipping);
+      	iGc->PushClip();
+        iDelayedClipRectPushed = ETrue;
+        
+        if (MaxNumberOfClipRects() == 1)
+            {
+            iGc->Clip(iDelayedClipRegion[iDelayedClipCount]);                            
+            }
+        else
+            {
+            iGc->Clip(iDelayedClipRegion);                                
+            }                            
+        }    
+
+    iDelayedClipCount += MaxNumberOfClipRects();
+    
+    if (iDelayedClipVisibility == EFullyOutside)
+        {
+        // If drawing would fall completely outside the clipping region, we are done. 
+        return EFalse;
+        }
+    else
+        {
+        // Check how many times we must do the operation in case rederer does not support many clip rects at once 
+        return (iDelayedClipCount <= iDelayedClipRegion.Count() || iDelayedClipCount == MaxNumberOfClipRects());
+        }
+    }
+
+EXPORT_C void CHuiCanvasGc::DisableDelayedClippingIfNeeded()
+    {
+    iDelayedClipVisibility = EPartialOverlap;
+    iDelayedClipCount = 0;
+    if (iDelayedClipRegion.Count())
+        {
+        if (iDelayedClipRectPushed)
+            {
+            iGc->PopClip();
+            iDelayedClipRectPushed = EFalse;    
+            }                
+
+        iDelayedClipRegion.Clear();
+        }
+    }
+
+EXPORT_C void CHuiCanvasGc::Setup()
+    {
+    iOldPencolor = iGc->PenColor();
+    iOldPenAlpha = iGc->PenAlpha();
+    iGc->SetAlign(EHuiAlignHLeft, EHuiAlignVTop);    
+    TReal32 effectiveOpacity = 1.f;
+    if (iVisual && iEffectiveOpacityEnabled)
+        {
+        effectiveOpacity = iVisual->EffectiveOpacity();    
+        }
+    iGc->SetPenAlpha(TInt(iOpacity * effectiveOpacity * 255));
+    iGc->SetPenColor(iPenColor);        
+    }
+
+EXPORT_C void CHuiCanvasGc::Cleanup()
+    {
+	iGc->SetPenAlpha(iOldPenAlpha);  
+	iGc->SetPenColor(iOldPencolor);	
+    }
+
+EXPORT_C TInt CHuiCanvasGc::MaxNumberOfClipRects() const
+    {
+    // By default only one at the time, but most renders override this
+    return 1;    
+    }
+
+CHuiGc* CHuiCanvasGc::Gc() const
+    {
+    return iGc;
+    }
+
+EXPORT_C CHuiCanvasRenderBuffer* CHuiCanvasGc::CreateRenderBufferL(const TSize& /*aSize*/)
+    {
+    // Only deriving classes really create render targets
+    return NULL;
+    }
+
+EXPORT_C void CHuiCanvasGc::DrawImage(const CHuiCanvasRenderBuffer& aImage, const THuiRealPoint& aDestinationPoint)
+    {
+    if (!iGc)
+        {
+        return;    
+        }
+        
+    THuiRealSize destinationSize = aImage.Size();
+    THuiRealRect destinationRect(aDestinationPoint, destinationSize);
+    
+    Setup();
+  
+    EnableBlendingIfNeeded();
+
+    EnableDelayedClippingIfNeeded(destinationRect.Round());    
+
+    while (ClipNext())
+        {                    
+        DoDrawRenderBuffer(aImage, aDestinationPoint);
+        }
+
+    DisableDelayedClippingIfNeeded(); 
+
+    Cleanup();       
+    }
+
+EXPORT_C void CHuiCanvasGc::ClearRenderBuffer( CHuiCanvasRenderBuffer& aImage, const TRect & aRect )
+    {
+    DoClearRenderBuffer(aImage, aRect);
+    }
+EXPORT_C void CHuiCanvasGc::DoClearRenderBuffer( CHuiCanvasRenderBuffer& /*aImage*/, const TRect & /*aRect*/ )
+    {
+    // only deriving classes implement this
+    }
+
+
+EXPORT_C void CHuiCanvasGc::DoDrawRenderBuffer(const CHuiCanvasRenderBuffer& /*aImage*/, const THuiRealPoint& /*aDestinationPoint*/)
+    {
+    // Only deriving classes really draw render targets
+    }
+
+EXPORT_C void CHuiCanvasGc::PushTransformationMatrix()
+    {
+    if (!iGc)
+        {
+        return;    
+        }
+    
+    iGc->Push(EHuiGcMatrixModel);
+    }
+
+EXPORT_C void CHuiCanvasGc::PopTransformationMatrix()
+    {
+    if (!iGc)
+        {
+        return;    
+        }
+    
+    iGc->Pop(EHuiGcMatrixModel);    
+    }
+
+void CHuiCanvasGc::RestoreState() const
+    {
+    if (!iGc)
+        {
+        return;    
+        }
+
+    iGc->RestoreState();    
+    }
+
+EXPORT_C void CHuiCanvasGc::RestoreFlaggedState() const
+    {
+    // Default implementation does not support flagged states in gc
+    RestoreState();
+    }
+
+void CHuiCanvasGc::EnableEffectiveOpacity(TBool aEnable)
+    {
+    iEffectiveOpacityEnabled = aEnable;
+    }
+
+EXPORT_C void CHuiCanvasGc::SetPolygonFillTexture(CHuiTexture* aTexture)
+    {
+    iPolygonFillTexture = aTexture;
+    }
+
+EXPORT_C CHuiTexture* CHuiCanvasGc::PolygonFillTexture() const 
+    {
+    return iPolygonFillTexture;
+    }
+
+EXPORT_C void CHuiCanvasGc::SetPolygonFillTextureOrigin(const TPoint& aOrigin)
+    {
+    iPolygonFillTextureOrigin = aOrigin;
+    }
+
+EXPORT_C TPoint CHuiCanvasGc::PolygonFillTextureOrigin() const
+    {
+    return iPolygonFillTextureOrigin;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvaspainter.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,242 @@
+/*
+* 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:   Definition of CHuiCanvasAlfPainter.
+*
+*/
+
+
+#include "uiacceltk/HuiCanvasVisual.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiVisual.h"
+#include "uiacceltk/HuiTextMesh.h"
+#include "uiacceltk/HuiCanvasCmdBufferReader.h"
+#include "huicanvasgc.h"
+#include "HuiRenderSurface.h"
+#include "huicanvastexturecache.h"
+#include "huicanvasbackground.h"
+#include <graphics/wsgraphicscontext.h>
+#include <e32cmn.h>
+#include <AknLayoutFont.h>
+#include "huicanvaspainter.h"
+
+
+
+CHuiCanvasPainter::~CHuiCanvasPainter()
+  	{
+  	iCommandBuffers.Close();
+   	delete iPartialCommandBuffer;
+   	};
+
+void CHuiCanvasPainter::SetCommandSetL( const TDesC8& aCommands )
+    {
+    ClearCommandSet();
+    AddCommandSetL(aCommands);
+	}
+
+void CHuiCanvasPainter::ClearCommandSet()
+    {
+	TInt count = iCommandBuffers.Count();
+    for (TInt i=0; i< count;i++)
+        {
+        delete iCommandBuffers[i];
+        }
+    iCommandBuffers.Reset();  
+    }
+
+void CHuiCanvasPainter::AddCommandSetL( const TDesC8& aMoreCommands )
+    {
+	HBufC8* commands = aMoreCommands.AllocL();    
+    CleanupStack::PushL(commands);
+
+    CHuiCanvasCommandBuffer* newBuffer = new(ELeave) CHuiCanvasCommandBuffer; 
+    CleanupStack::PushL(newBuffer);
+    newBuffer->iCommands = commands;
+    if (iCanvasVisual && iCanvasVisual->Display())
+        {
+        newBuffer->iOrientation = iCanvasVisual->Display()->Orientation();
+        }
+    iCommandBuffers.AppendL( newBuffer);    
+    CleanupStack::Pop(2, commands);
+    
+    RequestContinueRefresh();
+    }
+
+void CHuiCanvasPainter::AddPartialCommandSetL( const TDesC8& aMoreCommands, TBool aLastPart )
+    {
+	if (!iPartialCommandBuffer)
+        {
+        iPartialCommandBuffer = aMoreCommands.AllocL();
+        }
+    else 
+        {
+        iPartialCommandBuffer = 
+            iPartialCommandBuffer->ReAllocL( iPartialCommandBuffer->Length() + aMoreCommands.Length() );    
+        
+        TPtr8 ptr = iPartialCommandBuffer->Des();
+        ptr.Append(aMoreCommands);
+        }
+        
+    if (aLastPart && iPartialCommandBuffer)
+        {
+        AddCommandSetL(*iPartialCommandBuffer);
+        delete iPartialCommandBuffer;
+        iPartialCommandBuffer = NULL;                    
+        }        	
+    }
+	
+// Tags the last buffer for tracking	
+#ifdef HUI_DEBUG_TRACK_DRAWING
+void CHuiCanvasPainter::SetTrackCommandSet( TFileName& aFileName, TBool aTrack )
+    {
+    TInt count = iCommandBuffers.Count();
+    if ( count == 0 )
+        {
+        return;
+        }
+    iCommandBuffers[count-1]->iTrackedBuffer = aTrack;
+    
+    if ( aFileName.Length() > 0 )
+        {
+        iCommandBuffers[count-1]->iProcessName = aFileName.Alloc();
+        }
+    }
+#endif
+
+TBool CHuiCanvasPainter::HasCommandBuffers()
+    {
+	if (iCommandBuffers.Count() == 0 || 
+        !iCommandBuffers[0]->iCommands )
+    	{
+    	return EFalse;		
+    	}
+    return ETrue;	
+    }
+
+void CHuiCanvasPainter::SetVisual(CHuiCanvasVisual* aVisual)
+    {
+    iCanvasVisual = aVisual;    
+    }
+
+CHuiCanvasVisual* CHuiCanvasPainter::Visual()
+    {
+    return iCanvasVisual;    
+    }
+
+TBool CHuiCanvasPainter::BuffersChanged() const
+    {    
+    TInt bufferCount = iCommandBuffers.Count();
+    for (TInt cb = 0; cb < bufferCount; cb++)
+        {        
+        if (iCommandBuffers[cb]->iChanged)
+            {
+            return ETrue;
+            }
+        }
+    return EFalse;    
+    }
+
+void CHuiCanvasPainter::ClearAllBuffersChanged()
+    {
+    SetAllBuffersChanged(EFalse);
+    }
+
+void CHuiCanvasPainter::SetAllBuffersChanged(TBool aChanged)
+    {
+    TInt bufferCount = iCommandBuffers.Count();
+    for (TInt cb = 0; cb < bufferCount; cb++)
+        {        
+        iCommandBuffers[cb]->iChanged = aChanged;
+        }
+    
+    if ( aChanged )
+        {
+        RequestContinueRefresh();
+        }
+    }
+
+void CHuiCanvasPainter::RequestContinueRefresh()
+    {
+    if ( iCanvasVisual && iCanvasVisual->Display() )
+        {
+        iCanvasVisual->Owner().Env().ContinueRefresh(ETrue);
+        }
+    }
+
+void CHuiCanvasPainter::SetAllBufferStatusFlags(THuiCanvasBufferStatusFlags aStatusFlags)
+    {
+    TInt bufferCount = iCommandBuffers.Count();
+    for (TInt cb = 0; cb < bufferCount; cb++)
+        {        
+        iCommandBuffers[cb]->SetStatusFlags(aStatusFlags);
+        }    
+    }
+
+void CHuiCanvasPainter::ClearAllBufferStatusFlags(THuiCanvasBufferStatusFlags aStatusFlags)
+    {
+    TInt bufferCount = iCommandBuffers.Count();
+    for (TInt cb = 0; cb < bufferCount; cb++)
+        {        
+        iCommandBuffers[cb]->ClearStatusFlags(aStatusFlags);
+        }        
+    }
+
+
+TBool CHuiCanvasPainter::HasCommandBuffers(THuiCanvasBufferStatusFlags aStatusFlags)
+    {
+    TInt bufferCount = iCommandBuffers.Count();
+    for (TInt cb = 0; cb < bufferCount; cb++)
+        {        
+        if (iCommandBuffers[cb]->iStatusFlags & aStatusFlags)
+            {
+            return ETrue;
+            }
+        }    
+    return EFalse;
+    }
+
+TBool CHuiCanvasPainter::HasCommandBuffersWithoutFlags(THuiCanvasBufferStatusFlags aStatusFlags)
+    {
+    TInt bufferCount = iCommandBuffers.Count();
+    for (TInt cb = 0; cb < bufferCount; cb++)
+        {        
+        if (!(iCommandBuffers[cb]->iStatusFlags & aStatusFlags))
+            {
+            return ETrue;
+            }
+        }    
+    return EFalse;
+    }
+
+TBool CHuiCanvasPainter::HasOldCommandBuffers(TInt aLifeTimeInMs)
+    {
+    TTime now;
+    now.UniversalTime();    
+    TInt bufferCount = iCommandBuffers.Count();
+    for (TInt cb = 0; cb < bufferCount; cb++)
+        {        
+        TInt lifetimeInMs =  now.MicroSecondsFrom( iCommandBuffers[cb]->iCreationTime ).Int64()/1000;                               
+        if (lifetimeInMs > 0 && lifetimeInMs > aLifeTimeInMs)
+            {
+            return ETrue;
+            }
+        }    
+
+    return EFalse;    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvasrenderbuffer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class canvas renderering target
+*
+*/
+
+
+
+#include "huicanvasrenderbuffer.h"
+#include "HuiRenderPlugin.h"
+
+
+EXPORT_C CHuiCanvasRenderBuffer::CHuiCanvasRenderBuffer()
+    {	    
+    }
+
+EXPORT_C CHuiCanvasRenderBuffer::~CHuiCanvasRenderBuffer()
+    {
+    }
+
+EXPORT_C void CHuiCanvasRenderBuffer::InitializeL(const TSize& /*aSize*/)
+    {
+    iInitialized = ETrue;
+    }
+
+EXPORT_C void CHuiCanvasRenderBuffer::UnInitialize()
+    {
+    iInitialized = EFalse;
+    }
+
+EXPORT_C void CHuiCanvasRenderBuffer::Bind()
+    {
+    // Default implementation does nothing
+    }
+
+EXPORT_C void CHuiCanvasRenderBuffer::UnBind()
+    {
+    // Default implementation does nothing
+    }
+
+EXPORT_C TSize CHuiCanvasRenderBuffer::Size() const
+    {
+    return iSize;
+    }
+
+EXPORT_C TBool CHuiCanvasRenderBuffer::IsInitialized() const
+    {
+    return iInitialized;
+    }
+
+EXPORT_C void CHuiCanvasRenderBuffer::Copy(const CHuiCanvasRenderBuffer& /*aSourceBuffer*/)
+    {
+    // Default implementation does nothing    
+    }
+
+EXPORT_C void CHuiCanvasRenderBuffer::Copy(TPoint /*aPoint*/)   
+    {
+    // Default implementation does nothing    
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvaswsbitgc.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,207 @@
+/*
+* 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:   Definition of CHuiCanvasWsBitGc.
+*
+*/
+
+
+
+#include "huicanvaswsbitgc.h"
+#include "uiacceltk/HuiCanvasVisual.h"
+#include <graphics/wsgraphicscontext.h>
+#include <e32cmn.h>
+#include <AknLayoutFont.h>
+#include <gdi.h>
+
+
+
+CHuiCanvasWsBitGc* CHuiCanvasWsBitGc::NewL()
+	{
+	CHuiCanvasWsBitGc* self    = new ( ELeave ) CHuiCanvasWsBitGc;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+
+CHuiCanvasWsBitGc::CHuiCanvasWsBitGc()
+    {
+    
+    }
+
+void CHuiCanvasWsBitGc::ConstructL()
+	{
+	CHuiCanvasWsSwGc::ConstructL();
+	}
+
+CHuiCanvasWsBitGc::~CHuiCanvasWsBitGc()
+    {
+    }
+    
+
+void CHuiCanvasWsBitGc::BeginActionL(TInt aAction, TRect /*aDisplayRect*/, const CHuiCanvasVisual& aUser, TBool aIsCachePrepared, const TRegion& aUpdateRegion)
+	{
+	iAction = aAction;
+	iVisual = &aUser;
+
+    if (!iVisual)
+        {
+        return;    
+        }        
+
+    // Update area is in screen coordinates so we must convert it 
+    iDefaultClipRegion.Clear();
+    for (TInt i=0; i < aUpdateRegion.Count(); i++)
+        {
+        iDefaultClipRegion.AddRect(AdjustCoordinates(aUpdateRegion[i]));   
+        }
+    
+    TSize size = RoundedDisplayRect().Size();	
+
+    // We create buffer only in drawing phase to reduce memory consumption.
+    TBool recreateBackbuffer = 
+        ( iAction == EDrawBuffer ) && 
+        ( !iBitGc || ( iBitBitmap && iBitBitmap->SizeInPixels() != size ) );
+    
+    // If this is first draw or size has changed, re-create backbuffer
+	if (recreateBackbuffer)
+		{				    	
+		iBitmapInitialized = EFalse;
+		
+		if (!iBitBitmap)
+            {
+            iBitBitmap = new (ELeave) CFbsBitmap;
+            iBitBitmap->Create(size, SelectDisplayMode());  
+            }
+        else
+            {
+            iBitBitmap->Resize(size);    
+            }    
+	    
+        if (!iBitDevice)
+            {
+            iBitDevice = CFbsBitmapDevice::NewL(iBitBitmap);        
+            }
+        else
+            {
+            iBitDevice->Resize(size);    
+            }    
+
+	    delete iBitGc;
+	    iBitGc = NULL;
+	    User::LeaveIfError(iBitDevice->CreateContext(iBitGc));
+        
+        TRgb clearColor = KRgbWhite;
+	    clearColor.SetAlpha(0x0);
+        
+	    iBitGc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
+        iBitGc->SetPenColor(clearColor);
+        iBitGc->SetBrushColor(clearColor);
+        iBitGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
+  	    iBitGc->Clear();
+  	    iBitGc->Reset();    	  
+  	    
+  	    iIsReallyDirty = EFalse;
+		}
+	
+    if (iBitGc)
+        {
+        iBitGc->Reset();
+        }
+    
+    iBitmapPrepared = aIsCachePrepared && iBitmapInitialized;
+	}
+
+// Note that for perfomance reasons we keep iBitBitmap alive in this method   
+void CHuiCanvasWsBitGc::EndActionL(const TRegion& aUpdateRegion, TBool aUpdateDisplay)
+	{
+    if (!iBitBitmap || !iVisual)
+        {
+        return;    
+        }        
+
+    // Update internal state - drawing finished
+    if ( iAction == EDrawBuffer )
+        {
+        iBitmapInitialized = ETrue;
+        iBitmapPrepared = ETrue;
+        }
+
+    // If capturing is used, then copy content from bitmap.
+    if (iCapturingBitGc && aUpdateDisplay && iIsReallyDirty && iAction == EDrawBuffer)
+        {
+        iCapturingBitGc->Reset();
+        
+        // blend only transparent windows
+        if (iVisual->Flags() & EHuiVisualFlagOpaqueHint)
+            {
+            iCapturingBitGc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
+            }
+        else
+            {
+            iCapturingBitGc->SetDrawMode(CGraphicsContext::EDrawModePEN);
+            }
+        
+        iCapturingBitGc->SetClippingRegion(aUpdateRegion);
+        
+        TSize visualSize = iVisual->DisplayRect().Size().Round();        
+        if (iCapturingBitBitmap->SizeInPixels() != visualSize)
+            {       
+            iCapturingBitGc->BitBlt(iVisual->DisplayRect().iTl.Round(), iBitBitmap);
+            }
+        else
+            {
+            // Old capturing functionality, althoug not really used we support that as well
+            iCapturingBitGc->BitBlt(TPoint(0,0), iBitBitmap);
+            }
+        
+        iCapturingBitGc->CancelClippingRegion();
+        }
+
+    // Content is not drawn anywhere (except to to capturing bitgc)
+	}
+
+	
+THuiCanvasWsGcType CHuiCanvasWsBitGc::Type() const
+    {
+    return EHuiCanvasWsBit;
+    }
+
+
+void CHuiCanvasWsBitGc::ClearCache()
+    {
+    // ClearCache is called when we can release,
+    // e.g. when window is hidden by another opaque window.
+    // So now we must release bitmaps in order to free
+    // memory.
+    iBitmapPrepared = EFalse; 
+    iBitmapInitialized = EFalse;
+
+    delete iBitGc;
+    iBitGc = NULL;
+    
+    delete iBitDevice;
+    iBitDevice = NULL;
+    
+    delete iBitBitmap;
+    iBitBitmap = NULL;
+    }
+
+
+TBool CHuiCanvasWsBitGc::IsRenderBufferEnabled() const
+    {
+    return ETrue;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvaswshwgc.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,2248 @@
+/*
+* 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:   Definition of CHuiCanvasWsHwGc.
+*
+*/
+
+
+
+#include "huicanvaswshwgc.h"
+
+#include "uiacceltk/HuiCanvasVisual.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiVisual.h"
+#include "uiacceltk/HuiTextMesh.h"
+#include "uiacceltk/HuiCanvasCmdBufferReader.h"
+#include "huicanvasgc.h"
+#include "HuiRenderSurface.h"
+#include "huicanvastexturecache.h"
+#include "huicanvasbackground.h"
+#include <graphics/wsgraphicscontext.h>
+#include <e32cmn.h>
+#include <AknLayoutFont.h>
+#include <graphics/lookuptable.h>
+
+//#define HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+
+CHuiCanvasWsHwGc* CHuiCanvasWsHwGc::NewL()
+	{
+	CHuiCanvasWsHwGc* self    = new ( ELeave ) CHuiCanvasWsHwGc;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+void CHuiCanvasWsHwGc::AdjustCoordinates(TPoint& aPoint, TBool aUseWsOrigin )
+    {
+    aPoint +=  iPosDelta;
+    if ( aUseWsOrigin ) 
+        {
+        aPoint += iWsOrigin;
+        }
+    }
+
+void CHuiCanvasWsHwGc::AdjustCoordinates(TRect& aRect, TBool aUseWsOrigin )
+    {
+    aRect.Move( iPosDelta );
+    if ( aUseWsOrigin )
+        {
+        aRect.Move( iWsOrigin );
+        }
+    }
+
+void CHuiCanvasWsHwGc::DrawTextBrush( THuiRealRect& aRect )
+    {
+    if( iWsBrushStyle == CGraphicsContext::ESolidBrush )
+        {
+        TRgb oldPenColor = iCanvasGc->PenColor();
+        TReal32 oldOpacity = iCanvasGc->Opacity();
+        THuiFillMode oldFillMode = iCanvasGc->PolygonDrawMode();
+        
+        iCanvasGc->SetPenColor(iWsBrushColor);
+        iCanvasGc->SetOpacity(TReal32(iWsBrushColor.Alpha() / 255.f));   
+        iCanvasGc->SetPolygonDrawMode(EHuiFillEvenOdd);
+        
+        RArray<THuiRealRect> rects;
+        rects.Append(aRect);
+        iCanvasGc->DrawRects(rects);
+        rects.Close();
+        
+        iCanvasGc->SetPolygonDrawMode(oldFillMode);
+        iCanvasGc->SetOpacity(oldOpacity);
+        iCanvasGc->SetPenColor(oldPenColor);
+        }
+    }
+
+CHuiCanvasWsHwGc::CHuiCanvasWsHwGc()
+    {
+    }
+
+void CHuiCanvasWsHwGc::ConstructL()
+	{
+    iCanvasGc = CHuiStatic::Renderer().CreateCanvasGcL();
+	
+	// Set delayed clipping mode, this is supposed to reduce unnecessary
+	// clipping which may cause bad performance on hw renderers 
+	iCanvasGc->SetClippingMode(EHuiCanvasClipModeDelayed);
+	WsResetL();
+#ifdef __WINS__	
+	iPushCount = 0;
+#endif
+	}
+
+CHuiCanvasWsHwGc::~CHuiCanvasWsHwGc()
+    {
+    if (iVisual)
+        {
+        iVisual->Env().CanvasTextureCache().ReleaseCachedRenderBuffer(*iVisual);
+        }
+                
+    iTempRegion.Close();
+    iWsClipRegion.Close();
+    delete iCanvasGc;
+    iCanvasGc = NULL;
+    }
+    
+void CHuiCanvasWsHwGc::WsBitBltL(TInt aBitmapHandle, TPoint aPoint)
+	{
+	THuiCachedImageParams cachedImageParams;
+    cachedImageParams.iBitmapHandle = aBitmapHandle;
+    cachedImageParams.iGcParams = CachedGcParams();
+     
+    const CHuiCanvasGraphicImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedImageL(cachedImageParams,*iVisual);
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( aPoint );
+            THuiRealRect destinationRect = TRect(aPoint, texture->Size());          
+    
+            THuiCanvasDrawMode oldDrawMode = iCanvasGc->DrawMode();
+            iCanvasGc->SetDrawMode(SelectCanvasDrawMode(iWsDrawMode));        
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, TRect(TPoint(0,0), texture->Size()), CHuiGc::EStretchNone);
+            iCanvasGc->SetDrawMode(oldDrawMode);
+            }
+        }
+	}
+
+
+
+
+void CHuiCanvasWsHwGc::WsBitBltRectL(TInt aBitmapHandle, TPoint aPoint, TRect aRect)
+	{
+	THuiCachedImageParams cachedImageParams;
+    cachedImageParams.iBitmapHandle = aBitmapHandle;
+    cachedImageParams.iGcParams = CachedGcParams();
+     
+    const CHuiCanvasGraphicImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedImageL(cachedImageParams,*iVisual);
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( aPoint );
+            THuiRealRect destinationRect = TRect(aPoint, texture->Size());                
+
+            THuiCanvasDrawMode oldDrawMode = iCanvasGc->DrawMode();
+            iCanvasGc->SetDrawMode(SelectCanvasDrawMode(iWsDrawMode));        
+
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, aRect, CHuiGc::EStretchNone);
+            iCanvasGc->SetDrawMode(oldDrawMode);
+            }        
+        }
+	}
+
+
+
+void CHuiCanvasWsHwGc::WsBitBltMaskedL(TInt aBitmapHandle, TInt aMaskHandle, TInt aInvertMask, TPoint aPoint, TRect aRect)
+	{
+	THuiCachedImageParams cachedImageParams;
+    cachedImageParams.iBitmapHandle = aBitmapHandle;
+    cachedImageParams.iMaskHandle = aMaskHandle;
+    cachedImageParams.iInvertedMask = aInvertMask;
+    cachedImageParams.iGcParams = CachedGcParams();
+     
+     
+    const CHuiCanvasGraphicImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedImageL(cachedImageParams,*iVisual);
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( aPoint );
+            THuiRealRect destinationRect = TRect(aPoint, texture->Size());                
+            
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, aRect, CHuiGc::EStretchNone);
+            }
+        }
+	}
+
+
+void CHuiCanvasWsHwGc::WsCombinedBitBltMaskedL(TRect aDestinationRect, const RArray<THuiCachedCombinedImageParams>& aBlits )
+	{
+	THuiCachedCombinedImageParams cachedCombinedImageParams;	    
+    THuiCachedGcParams gcParams = CachedGcParams();          
+    TSize imageSize = aDestinationRect.Size();
+    
+    // Must convert points relative to the image itself
+    RArray<THuiCachedCombinedImageParams> convertedBlits;
+    for (TInt i=0; i<aBlits.Count();i++)
+        {
+        THuiCachedCombinedImageParams convertedParams;
+        convertedParams = aBlits[i];
+        convertedParams.iCombinedBitmapPoint -= aDestinationRect.iTl;
+        convertedBlits.Append(convertedParams);
+        }    
+    
+    const CHuiCanvasGraphicImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCombinedCachedImageL(
+        convertedBlits, 
+        gcParams,
+        imageSize, 
+        *iVisual);
+
+    convertedBlits.Close();
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();        
+        if (texture)
+            {
+            TPoint point = aDestinationRect.iTl;
+            AdjustCoordinates( point );
+            
+            THuiRealRect destinationRect = TRect(point, texture->Size());                        
+    
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, TRect(TPoint(0,0), texture->Size()),  CHuiGc::EStretchNone);
+            }
+        }
+	}
+
+
+void CHuiCanvasWsHwGc::WsBitBltMaskedPointL(TInt aBitmapHandle, TInt aMaskHandle, TPoint aPoint1, TPoint aPoint2, TRect aRect)
+	{
+	THuiCachedImageParams cachedImageParams;
+    cachedImageParams.iBitmapHandle = aBitmapHandle;
+    cachedImageParams.iMaskHandle = aMaskHandle;
+    cachedImageParams.iMaskOriginPoint = aPoint2;
+    cachedImageParams.iGcParams = CachedGcParams();
+
+    const CHuiCanvasGraphicImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedImageL(cachedImageParams,*iVisual);
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( aPoint1 );
+            THuiRealRect destinationRect = TRect(aPoint1, texture->Size());                
+            
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, aRect, CHuiGc::EStretchNone);
+            }             
+        }
+	}
+
+void CHuiCanvasWsHwGc::WsResetClippingRegionL()
+	{
+    if (IsRenderingEnabled())
+        {
+        // Reset clip region
+        iWsClipRegion.Clear();
+        iCanvasGc->CancelClipping();
+        }
+	}
+
+void CHuiCanvasWsHwGc::WsClearL()
+	{		
+    if (IsRenderingEnabled())
+        {
+        THuiRealRect rect(iVisual->DisplayRect());     
+        DoWsClearRectL(rect);
+        }
+	}
+
+void CHuiCanvasWsHwGc::WsClearRectL(TRect& aRect)
+	{		
+    if (IsRenderingEnabled())
+        {
+        AdjustCoordinates( aRect );
+        DoWsClearRectL(aRect);
+        }
+	}
+
+
+void CHuiCanvasWsHwGc::DoWsClearRectL(const THuiRealRect& aRect )
+	{
+    if (IsRenderingEnabled())
+        {
+        RArray<THuiRealRect> rects;
+        rects.Append(aRect);
+    
+        // Store current gc params
+        UseWsState();
+        
+        CHuiTexture* oldPolygonFillTexture = iCanvasGc->PolygonFillTexture(); 
+        
+        // Clear
+        iCanvasGc->SetPolygonFillTexture(NULL);
+        iCanvasGc->SetPolygonDrawMode(EHuiFillNonZero);
+        iCanvasGc->SetPenWidth(1);           	  	        
+        iCanvasGc->SetPenColor(iWsBrushColor);            
+        iCanvasGc->SetOpacity(TReal32(iWsBrushColor.Alpha() / 255.f));   
+        iCanvasGc->SetDrawMode(SelectCanvasDrawMode(iWsDrawMode));        
+        iCanvasGc->DrawRects(rects);
+    
+        // Restore gc params etc.
+        rects.Close();
+        UseCanvasState();
+        iCanvasGc->SetPolygonFillTexture(oldPolygonFillTexture);
+        }
+    }
+
+void CHuiCanvasWsHwGc::WsResetBrushPatternL()
+	{
+	iWsBrushPattern = 0;
+	}
+
+void CHuiCanvasWsHwGc::WsResetFontL()
+	{
+    iWsCurrentFont = 0;
+	}
+
+void CHuiCanvasWsHwGc::WsDrawArcL(TPoint aPoint1, TPoint aPoint2, TRect aRect)
+	{
+	// If penstyle is ENullPen, then nothign is drawn
+    if (!iWsPenStyle)
+        {
+        return;    
+        }
+
+    if (IsRenderingEnabled())
+        {
+        UseWsState();        
+
+        AdjustCoordinates( aRect );
+        AdjustCoordinates( aPoint1 );
+        AdjustCoordinates( aPoint2 );
+
+        iCanvasGc->DrawArc( THuiRealRect(aRect), THuiRealPoint(aPoint1), THuiRealPoint(aPoint2) );
+        
+        UseCanvasState();
+        }
+    }
+
+void CHuiCanvasWsHwGc::WsDrawPieL(TPoint aPoint1, TPoint aPoint2, TRect aRect)
+	{
+	// If penstyle is ENullPen, then nothign is drawn
+    if (!iWsPenStyle && !iWsBrushStyle)
+        {
+        return;    
+        }
+
+    if (IsRenderingEnabled())
+        {    
+        UseWsState();
+
+        AdjustCoordinates( aRect );
+        AdjustCoordinates( aPoint1 );
+        AdjustCoordinates( aPoint2 );
+            
+        if (iWsBrushStyle == MWsGraphicsContext::ENullBrush)
+            {
+            iCanvasGc->SetPolygonDrawMode( EHuiNoFill );
+            iCanvasGc->SetPenColor(iWsPenColor);            
+            iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+            iCanvasGc->DrawPie(THuiRealRect(aRect),THuiRealPoint(aPoint1),THuiRealPoint(aPoint2));  
+            }    
+        else if (iWsBrushStyle == MWsGraphicsContext::ESolidBrush)
+            {
+            iCanvasGc->SetPolygonDrawMode( EHuiFillEvenOdd );
+            iCanvasGc->SetPenColor(iWsBrushColor);            
+            iCanvasGc->SetOpacity(TReal32(iWsBrushColor.Alpha() / 255.f));            
+            iCanvasGc->DrawPie(THuiRealRect(aRect),THuiRealPoint(aPoint1),THuiRealPoint(aPoint2));  
+
+            // Border should be drawn if pencolor is different than solid fill
+            if (IsDifferent(iWsBrushColor, iWsPenColor, ETrue) && iWsPenStyle && iWsPenSize.iHeight >= 1 && iWsPenSize.iWidth >= 1)
+                {
+                iCanvasGc->SetPolygonDrawMode( EHuiNoFill );
+                iCanvasGc->SetPenColor(iWsPenColor);                    
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+                iCanvasGc->DrawPie(THuiRealRect(aRect),THuiRealPoint(aPoint1),THuiRealPoint(aPoint2));  
+                }            
+            }
+        else if (iWsBrushStyle == MWsGraphicsContext::EPatternedBrush)
+            {
+            iCanvasGc->SetPolygonDrawMode( EHuiFillEvenOdd );
+            iCanvasGc->SetPenColor(iWsPenColor);                    
+            iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+            UseBrushPattern();
+            iCanvasGc->SetDrawMode(SelectCanvasDrawMode(iWsDrawMode));        
+            iCanvasGc->DrawPie(THuiRealRect(aRect),THuiRealPoint(aPoint1),THuiRealPoint(aPoint2));  
+            DiscardBrushPattern();
+
+            if (iWsPenStyle && iWsPenSize.iHeight >= 1 && iWsPenSize.iWidth >= 1)
+                {
+                iCanvasGc->SetPolygonDrawMode( EHuiNoFill );
+                iCanvasGc->SetPenColor(iWsPenColor);                    
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+                iCanvasGc->DrawPie(THuiRealRect(aRect),THuiRealPoint(aPoint1),THuiRealPoint(aPoint2));  
+                }
+            }
+        else
+            {
+            // We should never get here because fallbackmode should be used in this case !
+            RDebug::Print(_L("CHuiCanvasWsHwGc::WsDrawPieL - Unsupported brush mode %i"), iWsBrushStyle);
+            }
+                
+        UseCanvasState();
+        }
+	}
+
+void CHuiCanvasWsHwGc::WsDrawBitmap1L(TInt aBitmapHandle, TRect aRect)
+	{
+	THuiCachedImageParams cachedImageParams;
+    cachedImageParams.iBitmapHandle = aBitmapHandle;
+    cachedImageParams.iGcParams = CachedGcParams();
+
+    const CHuiCanvasGraphicImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedImageL(cachedImageParams,*iVisual);
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( aRect );
+            THuiRealRect destinationRect = aRect;                
+            
+            // Draw            
+            // This should stretch !
+            iCanvasGc->DrawImage(*texture, destinationRect, TRect(TPoint(0,0), texture->Size()), CHuiGc::EStretchFull); 
+            }        	
+        }
+	}
+
+void CHuiCanvasWsHwGc::WsDrawBitmap2L(TInt aBitmapHandle, TRect aRect1, TRect aRect2)
+	{
+	THuiCachedImageParams cachedImageParams;
+    cachedImageParams.iBitmapHandle = aBitmapHandle;
+    cachedImageParams.iGcParams = CachedGcParams();
+
+    const CHuiCanvasGraphicImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedImageL(cachedImageParams,*iVisual);
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( aRect1 );
+            THuiRealRect destinationRect = aRect1;                
+            
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, aRect2, CHuiGc::EStretchFull); 
+            }        
+        }
+	}
+
+void CHuiCanvasWsHwGc::WsDrawBitmap3L(TInt aBitmapHandle, TPoint aPoint)
+	{
+	 THuiCachedImageParams cachedImageParams;
+    cachedImageParams.iBitmapHandle = aBitmapHandle;
+    cachedImageParams.iGcParams = CachedGcParams();
+
+    const CHuiCanvasGraphicImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedImageL(cachedImageParams,*iVisual);
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( aPoint );
+            THuiRealRect destinationRect = TRect(aPoint, texture->Size());                
+       
+            // Draw
+            // TODO: Actually we should check the bitmap size in twips here are decide destinationRect based on that !            
+            iCanvasGc->DrawImage(*texture, destinationRect, TRect(TPoint(0,0), texture->Size()), CHuiGc::EStretchNone);
+            }        
+        }
+	}
+
+void CHuiCanvasWsHwGc::WsDrawBitmapMaskedL(TInt aBitmapHandle, TInt aMaskHandle, TInt aInvertMask, TRect& aRect1, TRect& aRect2)
+	{
+    THuiCachedImageParams cachedImageParams;
+    cachedImageParams.iBitmapHandle = aBitmapHandle;
+    cachedImageParams.iMaskHandle = aMaskHandle;
+    cachedImageParams.iInvertedMask = aInvertMask;
+    cachedImageParams.iGcParams = CachedGcParams();
+    
+    const CHuiCanvasGraphicImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedImageL(cachedImageParams,*iVisual);
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( aRect1 );
+            THuiRealRect destinationRect = aRect1;              
+    
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, aRect2, CHuiGc::EStretchFull);
+            }        
+        }
+	}
+
+void CHuiCanvasWsHwGc::WsDrawRoundRectL(TPoint aPoint, TRect& aRect)
+	{
+	// If penstyle is ENullPen, then nothign is drawn
+    if (!iWsPenStyle && !iWsBrushStyle)
+        {
+        return;    
+        }
+
+    if (IsRenderingEnabled())
+        {    
+        UseWsState();
+        
+        AdjustCoordinates( aRect );
+        iCanvasGc->SetDrawMode(SelectCanvasDrawMode(iWsDrawMode));        
+        
+        if (iWsBrushStyle == MWsGraphicsContext::ENullBrush)
+            {
+            iCanvasGc->SetPolygonDrawMode( EHuiNoFill );
+            iCanvasGc->SetPenColor(iWsPenColor);            
+            iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+            iCanvasGc->DrawRoundRect( THuiRealRect(aRect), THuiRealSize( aPoint.iX*2, aPoint.iY*2 ));
+            }    
+        else if (iWsBrushStyle == MWsGraphicsContext::ESolidBrush)
+            {
+            iCanvasGc->SetPolygonDrawMode( EHuiFillEvenOdd );
+            iCanvasGc->SetPenColor(iWsBrushColor);            
+            iCanvasGc->SetOpacity(TReal32(iWsBrushColor.Alpha() / 255.f));            
+            iCanvasGc->DrawRoundRect( THuiRealRect(aRect), THuiRealSize( aPoint.iX*2, aPoint.iY*2 ));
+
+            // Border should be drawn if pencolor is different than solid fill
+            if (IsDifferent(iWsBrushColor,iWsPenColor, ETrue) && iWsPenStyle && iWsPenSize.iHeight >= 1 && iWsPenSize.iWidth >= 1)
+                {
+                iCanvasGc->SetPolygonDrawMode( EHuiNoFill );
+                iCanvasGc->SetPenColor(iWsPenColor);                    
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+                iCanvasGc->DrawRoundRect( THuiRealRect(aRect), THuiRealSize( aPoint.iX*2, aPoint.iY*2 ));
+                }            
+            }
+        else if (iWsBrushStyle == MWsGraphicsContext::EPatternedBrush)
+            {
+            iCanvasGc->SetPolygonDrawMode( EHuiFillEvenOdd );
+            iCanvasGc->SetPenColor(iWsPenColor);                    
+            iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+            UseBrushPattern();
+            iCanvasGc->SetDrawMode(SelectCanvasDrawMode(iWsDrawMode));        
+            iCanvasGc->DrawRoundRect( THuiRealRect(aRect), THuiRealSize( aPoint.iX*2, aPoint.iY*2 ));
+            DiscardBrushPattern();
+
+            if (iWsPenStyle && iWsPenSize.iHeight >= 1 && iWsPenSize.iWidth >= 1)
+                {
+                iCanvasGc->SetPolygonDrawMode( EHuiNoFill );
+                iCanvasGc->SetPenColor(iWsPenColor);                    
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+                iCanvasGc->DrawRoundRect( THuiRealRect(aRect), THuiRealSize( aPoint.iX*2, aPoint.iY*2 ));
+                }
+            }
+        else
+            {
+            // We should never get here because fallbackmode should be used in this case !
+            RDebug::Print(_L("CHuiCanvasWsHwGc::WsDrawRoundRectL - Unsupported brush mode %i"), iWsBrushStyle);
+            }
+        UseCanvasState();        
+        }
+    }
+
+void CHuiCanvasWsHwGc::WsDrawPolyLineL(CArrayFix<TPoint>* aPointerArray)
+	{
+	// If penstyle is ENullPen, then nothign is drawn
+    if (!iWsPenStyle)
+        {
+        return;    
+        }
+    
+    if (IsRenderingEnabled())
+        {    
+        if ( aPointerArray )
+            {
+            UseWsState();
+                
+            RArray<THuiRealLine> lines;
+            TPoint finalDeltaPos = iWsOrigin + iPosDelta; 
+            for(TInt j=0; j<aPointerArray->Count()-1; j++)
+                {    
+                THuiRealLine line(aPointerArray->At(j) + finalDeltaPos, aPointerArray->At(j+1) + finalDeltaPos);
+                lines.Append(line);        
+                }
+            iCanvasGc->DrawLines(lines);
+            lines.Close();  
+            
+            UseCanvasState();
+            }
+        }
+    }
+
+void CHuiCanvasWsHwGc::WsDrawPolyLineNoEndPointL(TPoint* aPointerArray, TInt aCount)
+	{
+	// If penstyle is ENullPen, then nothign is drawn
+    if (!iWsPenStyle)
+        {
+        return;    
+        }
+	
+    if (IsRenderingEnabled())
+        {    
+        if ( aPointerArray )
+           {
+           UseWsState();
+           
+           RArray<THuiRealLine> lines;
+           TPoint finalDeltaPos = iWsOrigin + iPosDelta; 
+           for(TInt j=0; j< aCount-1; j++)
+               {          
+               THuiRealLine line(aPointerArray[j] + finalDeltaPos, aPointerArray[j+1] + finalDeltaPos );// TODO: TEST
+               lines.Append(line);         
+               }
+           iCanvasGc->DrawLines(lines);
+    
+           RArray<THuiRealRect> rects;
+           THuiRealRect pointRect = THuiRealRect(aPointerArray[aCount],aPointerArray[aCount]);
+           rects.AppendL(pointRect);
+           iCanvasGc->SetPenWidth(0);
+           iCanvasGc->DrawRects(rects);
+           rects.Close();
+           lines.Close();       
+           
+           UseCanvasState();
+           }
+       }      
+    }
+
+void CHuiCanvasWsHwGc::WsDrawPolygonL(CArrayFix<TPoint>* aPointerArray, TInt aFillRule)
+	{
+    if (IsRenderingEnabled())
+        {    	
+        RArray<THuiRealPoint> points;
+        for(TInt j=0; j<aPointerArray->Count(); j++)
+           {      
+           points.Append( THuiRealPoint( aPointerArray->At(j) + iWsOrigin + iPosDelta) );        
+           }
+        UseWsState();
+        
+        if ( aFillRule == MWsGraphicsContext::EAlternate )
+            {
+            iCanvasGc->SetPolygonDrawMode( EHuiFillEvenOdd );
+            }
+        if ( aFillRule == MWsGraphicsContext::EWinding )
+            {        
+            iCanvasGc->SetPolygonDrawMode( EHuiFillNonZero );
+            }
+        iCanvasGc->SetPenColor(iWsPenColor);            
+        iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+        iCanvasGc->SetDrawMode(SelectCanvasDrawMode(iWsDrawMode));        
+            
+        iCanvasGc->DrawPolygon( points );
+    
+        UseCanvasState();
+    
+        points.Close();        
+        }	
+	}
+
+void CHuiCanvasWsHwGc::WsDrawEllipseL(TRect& aRect)
+	{
+	// If penstyle is ENullPen, then nothign is drawn
+    if (!iWsPenStyle && !iWsBrushStyle)
+        {
+        return;    
+        }
+
+    if (IsRenderingEnabled())
+        {        
+        AdjustCoordinates( aRect );
+        THuiRealRect destRect = aRect;
+        UseWsState();
+        
+        if (iWsBrushStyle == MWsGraphicsContext::ENullBrush)
+            {
+            iCanvasGc->SetPolygonDrawMode( EHuiNoFill );
+            iCanvasGc->SetPenColor(iWsPenColor);            
+            iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+            iCanvasGc->DrawEllipse(destRect);
+            }    
+        else if (iWsBrushStyle == MWsGraphicsContext::ESolidBrush)
+            {
+            iCanvasGc->SetPolygonDrawMode( EHuiFillEvenOdd );
+            iCanvasGc->SetPenColor(iWsBrushColor);            
+            iCanvasGc->SetOpacity(TReal32(iWsBrushColor.Alpha() / 255.f));            
+            iCanvasGc->DrawEllipse(destRect);
+
+            // Border should be drawn if pencolor is different than solid fill
+            if (IsDifferent(iWsBrushColor,iWsPenColor, ETrue) && iWsPenStyle && iWsPenSize.iHeight >= 1 && iWsPenSize.iWidth >= 1)
+                {
+                iCanvasGc->SetPolygonDrawMode( EHuiNoFill );
+                iCanvasGc->SetPenColor(iWsPenColor);                    
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+                iCanvasGc->DrawEllipse(destRect);
+                }            
+            }
+        else if (iWsBrushStyle == MWsGraphicsContext::EPatternedBrush)
+            {
+            iCanvasGc->SetPolygonDrawMode( EHuiFillEvenOdd );
+            iCanvasGc->SetPenColor(iWsPenColor);                    
+            iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+            UseBrushPattern();
+            iCanvasGc->SetDrawMode(SelectCanvasDrawMode(iWsDrawMode));        
+            iCanvasGc->DrawEllipse(destRect);
+            DiscardBrushPattern();
+
+            if (iWsPenStyle && iWsPenSize.iHeight >= 1 && iWsPenSize.iWidth >= 1)
+                {
+                iCanvasGc->SetPolygonDrawMode( EHuiNoFill );
+                iCanvasGc->SetPenColor(iWsPenColor);                    
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+                iCanvasGc->DrawEllipse(destRect);
+                }
+            }
+        else
+            {
+            // We should never get here because fallbackmode should be used in this case !
+            RDebug::Print(_L("CHuiCanvasWsHwGc::WsDrawEllipseL - Unsupported brush mode %i"), iWsBrushStyle);
+            }
+    
+        UseCanvasState();
+        }
+	}
+
+void CHuiCanvasWsHwGc::WsDrawLineL(TPoint& aStart, TPoint& aEnd)
+	{
+	// If penstyle is ENullPen, then nothign is drawn
+    if (!iWsPenStyle)
+        {
+        return;    
+        }
+
+    if (IsRenderingEnabled())
+        {            
+        AdjustCoordinates( aStart );
+        AdjustCoordinates( aEnd );
+        
+        THuiRealLine line(aStart, aEnd);
+        RArray<THuiRealLine> lines;
+        lines.Append(line);        
+    
+        UseWsState();
+    
+        iCanvasGc->DrawLines( lines );
+        lines.Close();
+    
+        UseCanvasState();
+        }
+    }
+
+void CHuiCanvasWsHwGc::WsDrawLineToL(TPoint& aPoint)
+	{
+	// If penstyle is ENullPen, then nothign is drawn
+    if (!iWsPenStyle)
+        {
+        return;    
+        }
+	
+    if (IsRenderingEnabled())
+        {            
+        AdjustCoordinates( aPoint );
+        TPoint currentPosition = iWsPenPosition;	
+        THuiRealLine line(currentPosition, aPoint);
+        RArray<THuiRealLine> lines;
+        lines.Append(line);        
+    
+        UseWsState();
+    
+        iCanvasGc->DrawLines( lines );
+            
+        iWsPenPosition = aPoint;       
+        lines.Close();        
+    
+        UseCanvasState();
+        }
+	}
+    
+void CHuiCanvasWsHwGc::WsDrawLineByL(TPoint& aPoint)
+	{
+	// If penstyle is ENullPen, then nothign is drawn
+    if (!iWsPenStyle)
+        {
+        return;    
+        }
+	
+    if (IsRenderingEnabled())
+        {            
+        AdjustCoordinates( aPoint );
+        TPoint currentPosition = iWsPenPosition;
+        TPoint endPoint = currentPosition + aPoint;
+        THuiRealLine line(currentPosition, endPoint);    
+        RArray<THuiRealLine> lines;
+        lines.Append(line);        
+    
+        UseWsState();
+    
+        iCanvasGc->DrawLines( lines );
+    
+        iWsPenPosition = endPoint;
+        lines.Close();    
+    
+        UseCanvasState();
+        }
+	}
+    
+void CHuiCanvasWsHwGc::WsDrawRectL(TRect& aRect)
+	{
+	// If penstyle is ENullPen, then nothign is drawn
+    if (!iWsPenStyle && !iWsBrushStyle)
+        {
+        return;    
+        }
+
+    if (IsRenderingEnabled())
+        {                
+        AdjustCoordinates( aRect );
+        RArray<THuiRealRect> rects;
+        rects.AppendL(aRect);        
+        
+        UseWsState();
+   
+        if (iWsBrushStyle == MWsGraphicsContext::ENullBrush)
+            {
+            iCanvasGc->SetPenColor(iWsPenColor);                    
+            iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+            iCanvasGc->SetDrawMode(SelectCanvasDrawMode(iWsDrawMode));        
+            iCanvasGc->DrawRects(rects);
+            }    
+        else if (iWsBrushStyle == MWsGraphicsContext::ESolidBrush)
+            {
+            iCanvasGc->SetPolygonDrawMode( EHuiFillEvenOdd );
+            iCanvasGc->SetPenColor(iWsBrushColor);            
+            iCanvasGc->SetOpacity(TReal32(iWsBrushColor.Alpha() / 255.f));            
+            iCanvasGc->SetDrawMode(SelectCanvasDrawMode(iWsDrawMode));        
+            iCanvasGc->DrawRects(rects);
+
+            
+            // Border should be drawn if pencolor is different than solid fill
+            if (IsDifferent(iWsBrushColor,iWsPenColor, ETrue) && iWsPenStyle && iWsPenSize.iHeight >= 1 && iWsPenSize.iWidth >= 1)
+                {
+                iCanvasGc->SetPolygonDrawMode( EHuiNoFill );
+                iCanvasGc->SetPenColor(iWsPenColor);                    
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+                iCanvasGc->DrawRects(rects);                
+                }            
+            }
+        else if (iWsBrushStyle == MWsGraphicsContext::EPatternedBrush)
+            {
+            iCanvasGc->SetPolygonDrawMode( EHuiFillEvenOdd );
+            iCanvasGc->SetPenColor(iWsPenColor);                    
+            iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+            UseBrushPattern();
+            iCanvasGc->SetDrawMode(SelectCanvasDrawMode(iWsDrawMode));        
+            iCanvasGc->DrawRects(rects);
+            DiscardBrushPattern();
+
+            if (iWsPenStyle && iWsPenSize.iHeight >= 1 && iWsPenSize.iWidth >= 1)
+                {
+                iCanvasGc->SetPolygonDrawMode( EHuiNoFill );
+                iCanvasGc->SetPenColor(iWsPenColor);                    
+                iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));       
+                iCanvasGc->DrawRects(rects);                                
+                }
+            }
+        else
+            {
+            // We should never get here because fallbackmode should be used in this case !
+            RDebug::Print(_L("CHuiCanvasWsHwGc::WsDrawRectL - Unsupported brush mode %i"), iWsBrushStyle);
+            }
+        
+        rects.Close();
+        
+        UseCanvasState();
+        }
+    }
+	
+const TUint8 color_s_to_lin[256] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+   0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+   0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
+   0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04,
+   0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
+   0x05, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07,
+   0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x0a,
+   0x0a, 0x0a, 0x0b, 0x0b, 0x0c, 0x0c, 0x0c, 0x0d,
+   0x0d, 0x0e, 0x0e, 0x0e, 0x0f, 0x0f, 0x10, 0x10,
+   0x11, 0x11, 0x12, 0x12, 0x12, 0x13, 0x13, 0x14,
+   0x15, 0x15, 0x16, 0x16, 0x17, 0x17, 0x18, 0x18,
+   0x19, 0x1a, 0x1a, 0x1b, 0x1b, 0x1c, 0x1d, 0x1d,
+   0x1e, 0x1f, 0x1f, 0x20, 0x21, 0x21, 0x22, 0x23,
+   0x23, 0x24, 0x25, 0x26, 0x26, 0x27, 0x28, 0x29,
+   0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2d, 0x2e, 0x2f,
+   0x30, 0x31, 0x32, 0x33, 0x33, 0x34, 0x35, 0x36,
+   0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e,
+   0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46,
+   0x47, 0x48, 0x49, 0x4a, 0x4c, 0x4d, 0x4e, 0x4f,
+   0x50, 0x51, 0x52, 0x54, 0x55, 0x56, 0x57, 0x58,
+   0x5a, 0x5b, 0x5c, 0x5d, 0x5f, 0x60, 0x61, 0x63,
+   0x64, 0x65, 0x67, 0x68, 0x69, 0x6b, 0x6c, 0x6d,
+   0x6f, 0x70, 0x72, 0x73, 0x74, 0x76, 0x77, 0x79,
+   0x7a, 0x7c, 0x7d, 0x7f, 0x80, 0x82, 0x83, 0x85,
+   0x86, 0x88, 0x8a, 0x8b, 0x8d, 0x8e, 0x90, 0x92,
+   0x93, 0x95, 0x97, 0x98, 0x9a, 0x9c, 0x9d, 0x9f,
+   0xa1, 0xa3, 0xa4, 0xa6, 0xa8, 0xaa, 0xac, 0xad,
+   0xaf, 0xb1, 0xb3, 0xb5, 0xb7, 0xb8, 0xba, 0xbc,
+   0xbe, 0xc0, 0xc2, 0xc4, 0xc6, 0xc8, 0xca, 0xcc,
+   0xce, 0xd0, 0xd2, 0xd4, 0xd6, 0xd8, 0xda, 0xdc,
+   0xde, 0xe0, 0xe2, 0xe5, 0xe7, 0xe9, 0xeb, 0xed,
+   0xef, 0xf2, 0xf4, 0xf6, 0xf8, 0xfa, 0xfd, 0xff };
+
+inline TRgb ConvertToLinear(TRgb aColor)
+    {
+    // perform sRGB->linear color conversion if the renderer is
+    // openvg
+    // NOTE: For emulator depending on the OpenVG SW version mapping may
+    // be needed or not. Use/unuse ifdefs below if text colors are too dark/light.
+//#ifndef __WINSCW__
+    if (CHuiStatic::Env().Renderer() == EHuiRendererVg10)
+        {
+        TUint32 color = aColor.Internal();
+        return
+            ((TUint32)color_s_to_lin[(color >> 0) & 0xff] << 16) |
+            ((TUint32)color_s_to_lin[(color >> 8) & 0xff] << 8) |
+            ((TUint32)color_s_to_lin[(color >> 16) & 0xff] << 0) |
+            (color & 0xff000000);
+        }
+//#endif    
+    return aColor;
+    }
+
+void CHuiCanvasWsHwGc::WsDrawText1L(TPtr& aTextValue, THuiCanvasTextParameters& aTextParameters)
+	{		
+	TPoint point = iWsPenPosition;
+    AdjustCoordinates( point );
+	THuiCachedTextParams cachedtextParams;
+    cachedtextParams.iFindTextPtr = &aTextValue;
+    cachedtextParams.iFontHandle = iWsCurrentFont;
+    cachedtextParams.iTextParams = aTextParameters;
+    cachedtextParams.iGcParams = CachedGcParams();
+
+    const CHuiCanvasTextImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedTextL(cachedtextParams,*iVisual); 
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            THuiRealRect destinationRect = TRect(point, texture->Size());                
+            
+            // Adjust destination rect according to the point where text was rasterised in the image
+            TInt dx = cachedImage->iRasterizationOffset.iX;
+            TInt dy = cachedImage->iRasterizationOffset.iY;        
+            destinationRect.Move(-dx,-dy);
+            
+            TRgb oldPenColor = iCanvasGc->PenColor();
+            if (cachedImage->iUseColorModulation)
+                {
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                }
+            
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, TRect(TPoint(0,0), texture->Size()), CHuiGc::EStretchNone);
+    
+            if (cachedImage->iUseColorModulation)
+                {
+                iCanvasGc->SetPenColor(oldPenColor);                        
+                }
+            }        
+        }
+	}
+
+void CHuiCanvasWsHwGc::WsDrawText2L(TPtr& aTextValue, TPoint& aPoint,THuiCanvasTextParameters& aTextParameters)
+	{
+	THuiCachedTextParams cachedtextParams;
+    cachedtextParams.iFindTextPtr = &aTextValue;
+    cachedtextParams.iFontHandle = iWsCurrentFont;
+    cachedtextParams.iTextParams = aTextParameters;
+    cachedtextParams.iGcParams = CachedGcParams();
+
+    const CHuiCanvasTextImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedTextL(cachedtextParams,*iVisual); 
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( aPoint );
+            THuiRealRect destinationRect = TRect(aPoint, texture->Size());                
+            
+            // Adjust destination rect according to the point where text was rasterised in the image
+            TInt dx = cachedImage->iRasterizationOffset.iX;
+            TInt dy = cachedImage->iRasterizationOffset.iY;        
+            destinationRect.Move(-dx,-dy);
+            
+            TRgb oldPenColor = iCanvasGc->PenColor();
+            if (cachedImage->iUseColorModulation)
+                {
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                }
+            
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, TRect(TPoint(0,0), texture->Size()), CHuiGc::EStretchNone);
+    
+            if (cachedImage->iUseColorModulation)
+                {
+                iCanvasGc->SetPenColor(oldPenColor);                        
+                }
+            }
+        }
+	}
+
+void CHuiCanvasWsHwGc::WsDrawText3L(TPtr& aTextValue, TRect& aRect, THuiCanvasTextParameters& aTextParameters)
+	{
+	THuiCachedTextParams cachedtextParams;
+	cachedtextParams.iFindTextPtr = &aTextValue;
+	cachedtextParams.iFontHandle = iWsCurrentFont;
+    cachedtextParams.iTextParams = aTextParameters;
+    cachedtextParams.iTextBoxMaxSize = aRect.Size();
+    cachedtextParams.iGcParams = CachedGcParams();
+
+    const CHuiCanvasTextImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedTextL(cachedtextParams,*iVisual); 
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( aRect );
+            THuiRealRect destinationRect = aRect;                
+            
+            // Adjust destination rect according to the point where text was rasterised in the image
+            TInt dx = cachedImage->iRasterizationOffset.iX;
+            TInt dy = cachedImage->iRasterizationOffset.iY;        
+            destinationRect.Move(-dx,-dy);
+            
+            TRgb oldPenColor = iCanvasGc->PenColor();
+            if (cachedImage->iUseColorModulation)
+                {
+                DrawTextBrush( destinationRect );
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                }
+    
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, TRect(TPoint(0,0), texture->Size()), CHuiGc::EStretchNone);
+    
+            if (cachedImage->iUseColorModulation)
+                {
+                iCanvasGc->SetPenColor(oldPenColor);                        
+                }
+            }
+        }
+	}
+
+
+void CHuiCanvasWsHwGc::WsDrawText4L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextAlign, TInt aTextMargin,THuiCanvasTextParameters& aTextParameters)
+    {
+	THuiCachedTextParams cachedtextParams;
+	cachedtextParams.iFindTextPtr = &aTextValue;
+    cachedtextParams.iFontHandle = iWsCurrentFont;
+    cachedtextParams.iTextParams = aTextParameters;
+    cachedtextParams.iTextBoxMaxSize = aRect.Size();
+    cachedtextParams.iBaseLineOffset = aBaselineOffset;
+    cachedtextParams.iTextAlign = aTextAlign;
+    cachedtextParams.iMargin = aTextMargin;
+    cachedtextParams.iGcParams = CachedGcParams();
+    
+    const CHuiCanvasTextImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedTextL(cachedtextParams,*iVisual); 
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( aRect );
+            THuiRealRect destinationRect = aRect;                
+            
+            // Adjust destination rect according to the point where text was rasterised in the image
+            TInt dx = cachedImage->iRasterizationOffset.iX;
+            TInt dy = cachedImage->iRasterizationOffset.iY;        
+            destinationRect.Move(-dx,-dy);
+            
+            TRgb oldPenColor = iCanvasGc->PenColor();
+            if (cachedImage->iUseColorModulation)
+                {
+                DrawTextBrush( destinationRect );
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                }
+    
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, TRect(TPoint(0,0), texture->Size()), CHuiGc::EStretchNone);
+    
+            if (cachedImage->iUseColorModulation)
+                {
+                iCanvasGc->SetPenColor(oldPenColor);                        
+                }
+            }    
+        }
+    }
+
+void CHuiCanvasWsHwGc::WsDrawText5L( TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextAlign, TInt aTextMargin,TInt aTextWidth, THuiCanvasTextParameters& aTextParameters)
+	{	
+	THuiCachedTextParams cachedtextParams;
+	cachedtextParams.iFindTextPtr = &aTextValue;
+    cachedtextParams.iFontHandle = iWsCurrentFont;
+    cachedtextParams.iTextParams = aTextParameters;
+    cachedtextParams.iTextBoxMaxSize = aRect.Size();
+    cachedtextParams.iBaseLineOffset = aBaselineOffset;
+    cachedtextParams.iTextAlign = aTextAlign;
+    cachedtextParams.iMargin = aTextMargin;
+    cachedtextParams.iTextWidth = aTextWidth;
+    cachedtextParams.iGcParams = CachedGcParams();
+    
+    const CHuiCanvasTextImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedTextL(cachedtextParams,*iVisual); 
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( aRect );
+            THuiRealRect destinationRect = aRect;                
+            
+            // Adjust destination rect according to the point where text was rasterised in the image
+            TInt dx = cachedImage->iRasterizationOffset.iX;
+            TInt dy = cachedImage->iRasterizationOffset.iY;        
+            destinationRect.Move(-dx,-dy);
+            
+            TRgb oldPenColor = iCanvasGc->PenColor();
+            if (cachedImage->iUseColorModulation)
+                {
+                DrawTextBrush( destinationRect );
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                }
+    
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, TRect(TPoint(0,0), texture->Size()), CHuiGc::EStretchNone);
+    
+            if (cachedImage->iUseColorModulation)
+                {
+                iCanvasGc->SetPenColor(oldPenColor);                        
+                }
+            }    
+        }
+	}
+	
+void CHuiCanvasWsHwGc::WsDrawTextVertical1L(TPtr& aTextValue, TInt aTextUp, THuiCanvasTextParameters& aTextParameters)	
+    {
+	TPoint point = iWsPenPosition;
+    TInt angle = aTextUp ? -90 : 90;
+
+    THuiCachedTextParams cachedtextParams;
+    cachedtextParams.iFindTextPtr = &aTextValue;
+    cachedtextParams.iFontHandle = iWsCurrentFont;
+    cachedtextParams.iTextParams = aTextParameters;
+    cachedtextParams.iAngle = angle;
+    cachedtextParams.iGcParams = CachedGcParams();
+
+    const CHuiCanvasTextImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedTextL(cachedtextParams,*iVisual); 
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( point );
+            THuiRealRect destinationRect = TRect(point, texture->Size());                
+            
+            // Adjust destination rect according to the point where text was rasterised in the image
+            TInt dx = cachedImage->iRasterizationOffset.iX;
+            TInt dy = cachedImage->iRasterizationOffset.iY;        
+            destinationRect.Move(-dx,-dy);
+            
+            TRgb oldPenColor = iCanvasGc->PenColor();
+            if (cachedImage->iUseColorModulation)
+                {
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                }
+    
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, TRect(TPoint(0,0), texture->Size()), CHuiGc::EStretchNone);
+    
+            if (cachedImage->iUseColorModulation)
+                {
+                iCanvasGc->SetPenColor(oldPenColor);                        
+                }
+            }    
+        }
+    }
+
+void CHuiCanvasWsHwGc::WsDrawTextVertical2L(TPtr& aTextValue, TInt aTextUp,TPoint& aPoint, THuiCanvasTextParameters& aTextParameters)	
+    {	 	                                       	
+    TInt angle = aTextUp ? -90 : 90;
+
+    THuiCachedTextParams cachedtextParams;
+    cachedtextParams.iFindTextPtr = &aTextValue;
+    cachedtextParams.iFontHandle = iWsCurrentFont;
+    cachedtextParams.iTextParams = aTextParameters;
+    cachedtextParams.iAngle = angle;
+    cachedtextParams.iGcParams = CachedGcParams();
+	
+    const CHuiCanvasTextImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedTextL(cachedtextParams,*iVisual); 
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( aPoint );
+            THuiRealRect destinationRect = TRect(aPoint, texture->Size());                
+            
+            // Adjust destination rect according to the point where text was rasterised in the image
+            TInt dx = cachedImage->iRasterizationOffset.iX;
+            TInt dy = cachedImage->iRasterizationOffset.iY;        
+            destinationRect.Move(-dx,-dy);
+            
+            TRgb oldPenColor = iCanvasGc->PenColor();
+            if (cachedImage->iUseColorModulation)
+                {
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                }
+    
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, TRect(TPoint(0,0), texture->Size()), CHuiGc::EStretchNone);
+    
+            if (cachedImage->iUseColorModulation)
+                {
+                iCanvasGc->SetPenColor(oldPenColor);                        
+                }
+            }
+        }
+    }
+
+void CHuiCanvasWsHwGc::WsDrawTextVertical3L(TPtr& aTextValue, TInt aTextUp, TRect& aRect, THuiCanvasTextParameters& aTextParameters)	
+    {
+	TInt angle = aTextUp ? -90 : 90;
+
+    THuiCachedTextParams cachedtextParams;
+    cachedtextParams.iFindTextPtr = &aTextValue;
+    cachedtextParams.iFontHandle = iWsCurrentFont;
+    cachedtextParams.iTextParams = aTextParameters;
+    cachedtextParams.iTextBoxMaxSize = aRect.Size();
+    cachedtextParams.iAngle = angle;
+    cachedtextParams.iGcParams = CachedGcParams();
+
+    const CHuiCanvasTextImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedTextL(cachedtextParams,*iVisual); 
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( aRect );
+            THuiRealRect destinationRect = aRect;                
+            
+            // Adjust destination rect according to the point where text was rasterised in the image
+            TInt dx = cachedImage->iRasterizationOffset.iX;
+            TInt dy = cachedImage->iRasterizationOffset.iY;        
+            destinationRect.Move(-dx,-dy);
+            
+            TRgb oldPenColor = iCanvasGc->PenColor();
+            if (cachedImage->iUseColorModulation)
+                {
+                DrawTextBrush( destinationRect );
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                }
+    
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, TRect(TPoint(0,0), texture->Size()), CHuiGc::EStretchNone);
+    
+            if (cachedImage->iUseColorModulation)
+                {
+                iCanvasGc->SetPenColor(oldPenColor);                        
+                }
+            }
+        }
+    }
+
+void CHuiCanvasWsHwGc::WsDrawTextVertical4L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextUp, TInt aTextAlign, TInt aTextMargin,THuiCanvasTextParameters& aTextParameters)
+    {
+    TInt angle = aTextUp ? -90 : 90;
+
+
+    THuiCachedTextParams cachedtextParams;
+    cachedtextParams.iFindTextPtr = &aTextValue;
+    cachedtextParams.iFontHandle = iWsCurrentFont;
+    cachedtextParams.iTextParams = aTextParameters;
+    cachedtextParams.iTextBoxMaxSize = aRect.Size();
+    cachedtextParams.iAngle = angle;
+    cachedtextParams.iBaseLineOffset = aBaselineOffset;
+    cachedtextParams.iTextAlign = aTextAlign;
+    cachedtextParams.iMargin = aTextMargin;
+    cachedtextParams.iGcParams = CachedGcParams();
+
+    const CHuiCanvasTextImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedTextL(cachedtextParams,*iVisual); 
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( aRect );
+            THuiRealRect destinationRect = aRect;                
+            
+            // Adjust destination rect according to the point where text was rasterised in the image
+            TInt dx = cachedImage->iRasterizationOffset.iX;
+            TInt dy = cachedImage->iRasterizationOffset.iY;        
+            destinationRect.Move(-dx,-dy);
+            
+            TRgb oldPenColor = iCanvasGc->PenColor();
+            if (cachedImage->iUseColorModulation)
+                {
+                DrawTextBrush( destinationRect );
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                }
+    
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, TRect(TPoint(0,0), texture->Size()), CHuiGc::EStretchNone);
+    
+            if (cachedImage->iUseColorModulation)
+                {
+                iCanvasGc->SetPenColor(oldPenColor);                        
+                }
+            }
+        }
+    }
+
+void CHuiCanvasWsHwGc::WsDrawTextVertical5L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextUp, TInt aTextAlign, TInt aTextMargin, TInt aTextWidth, THuiCanvasTextParameters& aTextParameters)
+    {
+	TInt angle = aTextUp ? -90 : 90;
+
+    THuiCachedTextParams cachedtextParams;
+    cachedtextParams.iFindTextPtr = &aTextValue;
+    cachedtextParams.iFontHandle = iWsCurrentFont;
+    cachedtextParams.iTextParams = aTextParameters;
+    cachedtextParams.iTextBoxMaxSize = aRect.Size();
+    cachedtextParams.iAngle = angle;
+    cachedtextParams.iTextWidth = aTextWidth;
+    cachedtextParams.iBaseLineOffset = aBaselineOffset;
+    cachedtextParams.iTextAlign = aTextAlign;
+    cachedtextParams.iMargin = aTextMargin;
+    cachedtextParams.iGcParams = CachedGcParams();
+
+    const CHuiCanvasTextImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedTextL(cachedtextParams,*iVisual); 
+
+    if (IsRenderingEnabled())
+        {           
+        const CHuiTexture* texture = cachedImage->Texture();
+        if (texture)
+            {
+            AdjustCoordinates( aRect );
+            THuiRealRect destinationRect = aRect;                
+            
+            // Adjust destination rect according to the point where text was rasterised in the image
+            TInt dx = cachedImage->iRasterizationOffset.iX;
+            TInt dy = cachedImage->iRasterizationOffset.iY;        
+            destinationRect.Move(-dx,-dy);
+            
+            TRgb oldPenColor = iCanvasGc->PenColor();
+            if (cachedImage->iUseColorModulation)
+                {
+                DrawTextBrush( destinationRect );
+                iCanvasGc->SetPenColor(ConvertToLinear(iWsPenColor));    
+                }
+    
+            // Draw            
+            iCanvasGc->DrawImage(*texture, destinationRect, TRect(TPoint(0,0), texture->Size()), CHuiGc::EStretchNone);
+    
+            if (cachedImage->iUseColorModulation)
+                {
+                iCanvasGc->SetPenColor(oldPenColor);                        
+                }
+            }
+        }
+    }
+
+void CHuiCanvasWsHwGc::WsMoveToL( TPoint& aPoint)
+    {
+    iWsPenPosition = aPoint;
+    }
+
+void CHuiCanvasWsHwGc::WsMoveByL( TPoint& aPoint)
+    {
+    iWsPenPosition += aPoint;
+    }
+    
+void CHuiCanvasWsHwGc::WsPlotL(TPoint& aPoint)
+	{
+    if (IsRenderingEnabled())
+    	{
+        AdjustCoordinates( aPoint );
+	    UseWsState();        
+        // Draw  
+        RArray<THuiRealPoint> points;
+        CleanupClosePushL(points);  
+        points.AppendL(THuiRealPoint(aPoint));       
+        iCanvasGc->DrawPoints(points);
+        CleanupStack::PopAndDestroy();
+        UseCanvasState();
+        }
+    }
+
+void CHuiCanvasWsHwGc::WsResetL()
+	{
+	iWsClipRegion.Clear();
+	iWsCurrentFont = 0;
+	iWsOrigin = KHuiWsDefaultOrigin;
+    iWsPenSize = KHuiWsDefaultPenSize;
+
+	iWsPenPosition = TPoint(0,0);
+	iWsFadeColor = KHuiWsDefaultFadeColor;
+
+    iWsPenColor = KHuiWsDefaultPenColor;
+    iWsBrushColor = KHuiWsDefaultBrushColor;
+    iWsPenStyle = KHuiWsDefaultPenStyle;
+    iWsDrawMode = KHuiWsDefaultDrawMode;
+    iWsBrushStyle = KHuiWsDefaultBrushStyle;
+    iWsShadowMode = KHuiWsDefaultShadowMode;
+    iWsStrikethrough = KHuiWsDefaultStrikethrough;
+    iWsUnderline = KHuiWsDefaultUnderline; 
+    iWsUserDisplayMode = KHuiWsDefaultUserDisplayMode;
+    iWsShadowColor = KHuiWsDefaultShadowColor;
+    iWsBrushPattern = 0;
+    iWsBrushOrigin = TPoint(0,0);
+
+
+  	iCanvasGc->CancelClipping();
+  	iCanvasGc->SetPenColor(KRgbWhite); 
+    iCanvasGc->SetOpacity(1.0);
+	iCanvasGc->SetPenWidth(1); 
+	}
+
+
+
+void CHuiCanvasWsHwGc::WsSetBrushColorL( TRgb aColor)
+    {
+    iWsBrushColor = aColor;
+    }
+
+void CHuiCanvasWsHwGc::WsSetBrushOriginL( TPoint& aPoint)
+    {
+    iWsBrushOrigin = aPoint;
+    }
+
+void CHuiCanvasWsHwGc::WsSetBrushStyleL( TInt aStyle)
+    {
+    iWsBrushStyle = aStyle;        
+    }
+
+void CHuiCanvasWsHwGc::WsSetClippingRegionL( RRegion& aRegion)
+    {
+    if (IsRenderingEnabled())
+        {
+        iWsClipRegion.Clear();    
+        for (TInt i=0;i<aRegion.Count();i++)
+            {
+            TRect rect = aRegion[i];
+            AdjustCoordinates( rect, EFalse );
+            iWsClipRegion.AddRect(rect);
+            }    
+        
+        iCanvasGc->ClipRegion(iWsClipRegion);                
+        }
+    }
+    
+void CHuiCanvasWsHwGc::WsSetDrawModeL( TInt aDrawMode)
+	{
+	iWsDrawMode = aDrawMode;	
+	}
+
+void CHuiCanvasWsHwGc::WsSetOriginL( TPoint& aOrigin)
+	{
+ 	iWsOrigin = aOrigin;
+	}
+
+void CHuiCanvasWsHwGc::WsSetPenColorL( TRgb aColor)
+	{
+	iWsPenColor = aColor;
+	}
+
+void CHuiCanvasWsHwGc::WsSetPenStyleL( TInt aStyle)
+	{
+    iWsPenStyle = aStyle;
+	}
+
+void CHuiCanvasWsHwGc::WsSetPenSizeL( TInt aWidth, TInt aHeight)
+	{
+    iWsPenSize.iWidth = aWidth;
+    // Note, that only width is supported by HW renderer. Canvas should be draw in fallback mode, if width and height are not the same
+    iWsPenSize.iHeight = aHeight; 
+	}
+
+void CHuiCanvasWsHwGc::WsSetTextShadowColorL( TRgb aColor)
+	{
+ 	iWsShadowColor = aColor;
+	}
+
+void CHuiCanvasWsHwGc::WsSetCharJustificationL( TInt /*aExcessiveWidth*/, TInt /*aNumGap*/)
+	{
+    // This is not supported by this CHuiCanvasWsGc implementation
+	iAllCommandsSupported = EFalse;
+	}
+
+void CHuiCanvasWsHwGc::WsSetWordJustificationL( TInt /*aExcessiveWidth*/, TInt /*aNumGap*/)
+	{
+    // This is not supported by this CHuiCanvasWsGc implementation
+	iAllCommandsSupported = EFalse;
+	}
+
+void CHuiCanvasWsHwGc::WsSetUnderlineStyleL( TInt aValue )
+	{
+    if (aValue < 1000) // magic, we recycle the same function for both underline and strike through
+        {
+        iWsUnderline = aValue;
+        }
+    else
+        {
+        iWsStrikethrough=aValue-1000;
+        }
+	}
+
+void CHuiCanvasWsHwGc::WsSetBrushPatternL( TInt aValue )
+	{
+	iWsBrushPattern = aValue;
+	}
+
+void CHuiCanvasWsHwGc::WsSetFontL( TInt aFontId)
+	{
+	iWsCurrentFont = aFontId;
+	}
+
+void CHuiCanvasWsHwGc::WsCopyRectL( TPoint& /*aPoint*/, TRect& /*aRect*/)
+	{
+    // This is not supported by this CHuiCanvasWsGc implementation
+	iAllCommandsSupported = EFalse;
+	}
+
+void CHuiCanvasWsHwGc::WsUpdateJustificationL( TPtr& /*aTextValue*/)
+	{
+    // This is not supported by this CHuiCanvasWsGc implementation
+	iAllCommandsSupported = EFalse;
+	}
+
+void CHuiCanvasWsHwGc::WsUpdateJustificationVerticalL( TInt /*aValue*/, TPtr& /*aTextValue*/)
+	{
+    // This is not supported by this CHuiCanvasWsGc implementation
+	iAllCommandsSupported = EFalse;
+	}
+
+void CHuiCanvasWsHwGc::WsSetFontNoDuplicateL( TInt aCurrentFont)
+	{
+	iWsCurrentFont = aCurrentFont;
+	}
+
+void CHuiCanvasWsHwGc::WsCopySettingsL()
+	{
+    // This is not supported by this CHuiCanvasWsGc implementation
+	iAllCommandsSupported = EFalse;
+	}
+
+void CHuiCanvasWsHwGc::WsSetClippingRectL( TRect& aRect)
+    {    
+    if (IsRenderingEnabled())
+        {
+        // Symbian SetClippingRect takes ws origin into account, 
+        // but setClippingRegion does not.
+        AdjustCoordinates( aRect, ETrue );
+        iTempRegion.Clear();
+        iTempRegion.AddRect( aRect );
+        iCanvasGc->ClipRegion( iTempRegion );
+        }
+    }
+
+void CHuiCanvasWsHwGc::WsCancelClippingRectL()
+    {
+    if (IsRenderingEnabled())
+        {
+        WsResetClippingRegionL();
+        iCanvasGc->CancelClipping();
+        }
+    }
+
+void CHuiCanvasWsHwGc::WsSetFadedL( TInt& /*aFaded*/)
+    {
+	// Nothing to do, we should get FadeArea commands if window is faded.
+    }
+
+void CHuiCanvasWsHwGc::WsSetFadingParametersL( TInt aBlackMap, TInt aWhiteMap)
+    {
+    if (IsRenderingEnabled())
+        {
+		if (aBlackMap > aWhiteMap)
+            {
+            TInt oldMap = aBlackMap;
+            aBlackMap = aWhiteMap;
+            aWhiteMap = oldMap;
+            }
+
+        const TUint16* lut = PtrTo16BitNormalisationTable();
+        
+        //CFbsBitGc::FadeArea() does the following per color component:
+        //   dst = dst * (aWhiteMap - aBlackMap) + aBlackMap;
+    
+        //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 - aWhiteMap + aBlackMap;
+        //   intensity = aBlackMap / alpha;
+    
+        // alpha = 1 - aWhiteMap + aBlackMap;
+        TInt alpha = 255 - aWhiteMap + aBlackMap;
+        // intensity = aBlackMap / alpha;
+        TInt i = (aBlackMap * lut[alpha]) >> 8;
+    
+        iWsFadeColor.SetInternal(i << 16 | i << 8 | i | alpha << 24); 
+        }
+    }
+
+void CHuiCanvasWsHwGc::WsFadeAreaL( RRegion& aRegion)
+    {
+    if (IsRenderingEnabled())
+        {
+        RArray<THuiRealRect> realRects;
+        for (TInt i=0; i<aRegion.Count();i++)
+            {
+            realRects.Append(aRegion[i]);
+            }
+        UseWsState();
+        // Get real color & opacity from fading params
+        TRgb fadeColor = iWsFadeColor;
+        // Opacity is given separately, so set alpha of the color to 255.   
+        fadeColor.SetAlpha(255); 
+        TReal32 opacity = TReal32(TReal32(iWsFadeColor.Alpha() / 255.f));
+        
+        // Draw semi transparent rect(s) over the visual faded areas
+        iCanvasGc->SetPenColor(fadeColor);
+        iCanvasGc->SetOpacity(opacity);    
+        iCanvasGc->SetPolygonDrawMode(EHuiFillNonZero);    
+        iCanvasGc->SetDrawMode(SelectCanvasDrawMode(iWsDrawMode));        
+
+        iCanvasGc->DrawRects(realRects);
+        
+        UseCanvasState();
+            
+        realRects.Close();    
+        aRegion.Close();    
+        }
+    }
+
+void CHuiCanvasWsHwGc::WsMapColorsL()
+    {
+    // This is not supported by this CHuiCanvasWsGc implementation
+	iAllCommandsSupported = EFalse;
+    }
+
+void CHuiCanvasWsHwGc::WsSetUserDisplayModeL( TInt aMode )
+    {
+    iWsUserDisplayMode = aMode;
+    }
+
+void CHuiCanvasWsHwGc::WsUseFontL(TInt aCurrentFont)
+    {
+    iWsCurrentFont = aCurrentFont;
+    }       
+
+void CHuiCanvasWsHwGc::BeginActionL(TInt aAction, TRect aDisplayRect, const CHuiCanvasVisual& aUser, TBool aIsCachePrepared, const TRegion& aUpdateRegion)
+	{
+    iAction = aAction;
+    iVisual = (CHuiCanvasVisual*)&aUser;
+    iAllCommandsSupported = ETrue;
+
+    if (aAction == EDrawBuffer)
+	    {
+	    BeginDrawL(aDisplayRect, aUser, aIsCachePrepared, aUpdateRegion);
+	    }
+	else if (aAction == EScanBuffer)
+	    {
+        BeginScanL(aDisplayRect, aUser, aIsCachePrepared, aUpdateRegion);	    
+	    }
+	else
+	    {
+	    // Should not happen
+	    }
+	}
+
+void CHuiCanvasWsHwGc::EndActionL(const TRegion& aUpdateRegion, TBool aUpdateDisplay)
+	{
+    if (iAction == EDrawBuffer)
+        {
+        EndDrawL(aUpdateRegion, aUpdateDisplay);
+        }
+    else if (iAction == EScanBuffer)
+        {
+        EndScanL(aUpdateRegion, aUpdateDisplay);
+        }
+    else
+        {
+        // Should not happen
+        }
+	}
+
+void CHuiCanvasWsHwGc::BeginDrawL(TRect aDisplayRect,const CHuiCanvasVisual& aUser, TBool aIsCachePrepared, const TRegion& aUpdateRegion)
+    {
+    CHuiCanvasRenderBuffer* renderbuffer = NULL;
+    TRect updatedRect = aUpdateRegion.BoundingRect();
+    TBool renderBufferCreated = EFalse;
+    
+    // Try to get render buffer if it has been enabled
+    if (iRenderBufferEnabled && updatedRect.Size() != TSize(0,0))
+        {
+        renderbuffer = iVisual->Env().CanvasTextureCache().FindCachedRenderBuffer(aUser);
+        if (!renderbuffer)
+            {        
+            renderbuffer = iVisual->Env().CanvasTextureCache().CreateCachedRenderBufferL(aUser, updatedRect.Size());
+            renderBufferCreated = ETrue;
+            }
+        }
+    
+    if (renderbuffer)
+        {
+        // If renderbuffer is not initialized, set the internal flag to EFalse. It will be set
+        // to ETrue after drawing has been done.
+        if (!renderbuffer->IsInitialized() || renderbuffer->Size() != updatedRect.Size() || renderBufferCreated)
+            {
+            iRenderBufferInitialized = EFalse;
+            }
+        
+        // We can access render buffer, mark it to be available.
+        iRenderBufferAvailable = ETrue;
+        
+        // Render buffer is prepared if caller says that cache is prepared and renderbuffer has been initialized.
+        iRenderBufferPrepared = aIsCachePrepared && iRenderBufferInitialized;
+        }
+    else
+        {
+        // We could not access render buffer, mark it to be unavailable.
+        iRenderBufferAvailable = EFalse;
+        }
+        
+    // If render buffer is not prepared, we must prepare it. We will set the flag at EndActionL when
+    // we really have prepared it.
+    if (IsRenderBufferUpdateOngoing())
+        {        
+        // Init render buffer (it only really initializes if needed)
+        renderbuffer->InitializeL(updatedRect.Size());
+
+        // Bind render buffer
+        BindRenderBuffer(renderbuffer, aUpdateRegion);
+        }
+    iCanvasGc->RestoreFlaggedState();
+    }
+
+void CHuiCanvasWsHwGc::BeginScanL(TRect aDisplayRect,const CHuiCanvasVisual& aUser, TBool aIsCachePrepared, const TRegion& aUpdateRegion)
+    {
+    CHuiCanvasRenderBuffer* renderbuffer = NULL;
+    TRect updatedRect = aUpdateRegion.BoundingRect();
+    TBool renderBufferCreated = EFalse;
+    
+    // Try to get render buffer if it has been enabled
+    if (iRenderBufferEnabled && updatedRect.Size() != TSize(0,0))
+        {
+        renderbuffer = iVisual->Env().CanvasTextureCache().FindCachedRenderBuffer(aUser);
+        if (!renderbuffer)
+            {        
+            renderbuffer = iVisual->Env().CanvasTextureCache().CreateCachedRenderBufferL(aUser, updatedRect.Size());
+            renderBufferCreated = ETrue;
+            }
+        }
+    
+    if (renderbuffer)
+        {
+        // If renderbuffer is not initialized, set the internal flag to EFalse. It will be set
+        // to ETrue after drawing has been done.
+        if (!renderbuffer->IsInitialized() || renderbuffer->Size() != updatedRect.Size() || renderBufferCreated)
+            {
+            iRenderBufferInitialized = EFalse;
+            }
+        
+        // We can access render buffer, mark it to be available.
+        iRenderBufferAvailable = ETrue;
+        
+        // Render buffer is prepared if caller says that cache is prepared and renderbuffer has been initialized.
+        iRenderBufferPrepared = aIsCachePrepared && iRenderBufferInitialized;
+        }
+    else
+        {
+        // We could not access render buffer, mark it to be unavailable.
+        iRenderBufferAvailable = EFalse;
+        }
+        
+    // If render buffer is not prepared, we must prepare it. We will set the flag at EndActionL when
+    // we really have prepared it.
+    if (IsRenderBufferUpdateOngoing())
+        {        
+        // Init render buffer (it only really initializes if needed)
+        renderbuffer->InitializeL(updatedRect.Size());
+        }
+
+    iCanvasGc->RestoreFlaggedState();
+	}
+
+void CHuiCanvasWsHwGc::EndDrawL(const TRegion& aUpdateRegion, TBool aUpdateDisplay)
+    {
+    CHuiCanvasRenderBuffer* renderbuffer = NULL;
+
+    // Check if we have cached render buffer available
+    if (IsRenderBufferEnabled())
+        {
+        renderbuffer = iVisual->Env().CanvasTextureCache().FindCachedRenderBuffer(*iVisual);
+        }
+    
+    if (renderbuffer)
+        {
+        // We can access render buffer, mark it to be available.
+        iRenderBufferAvailable = ETrue;
+        }
+    else
+        {
+        // We could not access render buffer, mark it to be unavailable.
+        iRenderBufferAvailable = EFalse;        
+        }
+
+    // Are we updating into render buffer
+    if (IsRenderBufferUpdateOngoing())
+        {            
+        // Are we rendering
+        UnBindRenderBuffer(renderbuffer);
+        // If we really did draw to the renderbuffer, then set it "prepared".
+        if (iCanvasGc->Gc())
+            {
+            iRenderBufferInitialized = ETrue;
+            iRenderBufferPrepared = ETrue;
+            }    
+        }
+
+    iCanvasGc->RestoreFlaggedState();
+    
+    // Cancel clipping if still active etc...
+    iCanvasGc->SetDefaults();    
+
+    // If render buffer is used, draw its content to display here
+    if (aUpdateDisplay && renderbuffer && iCanvasGc->Gc())
+        {
+        THuiRealRect updatedRect = aUpdateRegion.BoundingRect();
+
+        // Handle relative rotation
+        TRect displayArea = iVisual->Display()->VisibleArea();
+        TInt w = displayArea.Width();
+        TInt h = displayArea.Height();
+                
+        // ...select right rotation...
+        if (iRelativeOrientation == CHuiGc::EOrientationCW90)
+            {
+            // Rotate around origo and move back to displayarea
+            iCanvasGc->Rotate(-90, 0, 0, 1.f);
+            iCanvasGc->Translate(-h, 0, 0);
+            }
+        else if (iRelativeOrientation == CHuiGc::EOrientationCCW90)
+            {
+            // Rotate around origo and move back to displayarea
+            iCanvasGc->Rotate(90, 0, 0, 1.f);
+            iCanvasGc->Translate(0, -w, 0);
+            }
+        else if (iRelativeOrientation == CHuiGc::EOrientation180)
+            {
+            // Rotate around origo and move back to displayarea
+            iCanvasGc->Rotate(180, 0, 0, 1.f);
+            iCanvasGc->Translate(-w, -h, 0);            
+            }
+        else
+            {
+            // Nothing
+            }            
+        
+        iCanvasGc->ClipRegion(aUpdateRegion);
+        THuiCanvasDrawMode dmode = iCanvasGc->DrawMode();
+        // blend only transparent windows
+        if ((iVisual->Flags() & EHuiVisualFlagOpaqueHint) && !(iVisual->EffectiveOpacity() < 1.0f))
+            {
+            iCanvasGc->SetDrawMode(EHuiCanvasDrawModeNormal);
+            }
+        else
+            {
+            iCanvasGc->SetDrawMode(EHuiCanvasDrawModeBlend);
+            }
+        
+        iCanvasGc->DrawImage(*renderbuffer, updatedRect.iTl);
+        iCanvasGc->CancelClipping();
+        iCanvasGc->SetDrawMode(dmode);
+        }    
+    }
+
+void CHuiCanvasWsHwGc::EndScanL(const TRegion& aUpdateRegion, TBool aUpdateDisplay)
+    {
+    CHuiCanvasRenderBuffer* renderbuffer = NULL;
+
+    // Check if we have cached render buffer available
+    if (IsRenderBufferEnabled())
+        {
+        renderbuffer = iVisual->Env().CanvasTextureCache().FindCachedRenderBuffer(*iVisual);
+        }
+    
+    if (renderbuffer)
+        {
+        // We can access render buffer, mark it to be available.
+        iRenderBufferAvailable = ETrue;
+        }
+    else
+        {
+        // We could not access render buffer, mark it to be unavailable.
+        iRenderBufferAvailable = EFalse;        
+        }
+    
+    // Cancel clipping if still active etc...
+    iCanvasGc->RestoreFlaggedState();
+    iCanvasGc->SetDefaults();    
+    }
+
+
+CHuiCanvasGc& CHuiCanvasWsHwGc::CanvasGc() const
+	{
+	return *iCanvasGc;	
+	}
+	
+THuiCachedGcParams CHuiCanvasWsHwGc::CachedGcParams()
+    {
+    THuiCachedGcParams params;
+    params.iPenColor = iWsPenColor;    
+    params.iBrushColor = iWsBrushColor;
+    params.iPenStyle = iWsPenStyle;
+    params.iDrawMode = iWsDrawMode;
+    params.iBrushColor = iWsBrushColor;
+    params.iBrushStyle = iWsBrushStyle;
+    params.iShadowMode = iWsShadowMode;
+    params.iStrikethrough = iWsStrikethrough;
+    params.iUnderline = iWsUnderline;
+    params.iUserDisplayMode = iWsUserDisplayMode;
+    params.iShadowColor = iWsShadowColor;
+    return params;        
+    }
+
+TInt CHuiCanvasWsHwGc::SetCapturingBufferL(CFbsBitmap* /*aTarget*/)
+    {
+    // This implementation does not support capturing
+    return KErrNotSupported;    
+    }
+
+void CHuiCanvasWsHwGc::SetPositionDelta( TPoint& aPoint )
+    {
+    iPosDelta = aPoint;
+    }
+
+TRect CHuiCanvasWsHwGc::RoundedDisplayRect()
+    {
+    if (iVisual)
+        {
+        return iVisual->DisplayRect().Round();    
+        }
+    else
+        {
+        return TRect(0,0,0,0);    
+        }            
+    }
+
+void CHuiCanvasWsHwGc::ClearCache()
+    {
+    if (iVisual)
+        {
+        iVisual->Env().CanvasTextureCache().ReleaseCachedRenderBuffer(*iVisual);
+        }
+    }    
+
+TBool CHuiCanvasWsHwGc::IsRenderBufferEnabled() const
+    {
+    return iRenderBufferEnabled && iRenderBufferAvailable;
+    }
+
+TBool CHuiCanvasWsHwGc::IsRenderBufferPrepared() const
+    {
+    return iRenderBufferEnabled && iRenderBufferAvailable && iRenderBufferPrepared;    
+    }
+
+TBool CHuiCanvasWsHwGc::IsRenderBufferInitialized() const
+    {
+    return iRenderBufferEnabled && iRenderBufferAvailable && iRenderBufferInitialized;    
+    }
+
+
+TBool CHuiCanvasWsHwGc::IsRenderingEnabled() const
+    {
+    if (iAction == EDrawBuffer)
+        {
+        return ETrue;
+        }
+    else if (iAction == EScanBuffer)
+        {
+        return EFalse;
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+TBool CHuiCanvasWsHwGc::IsRenderBufferUpdateOngoing() const
+    {
+    return iRenderBufferEnabled && iRenderBufferAvailable && !iRenderBufferPrepared;
+    }
+
+
+TInt CHuiCanvasWsHwGc::EnableRenderbuffer(TBool aEnable)
+    {
+    // TODO: Some renderers should return KErrNotSupported
+    TInt retVal = KErrNone;
+    iRenderBufferEnabled = aEnable;
+    return retVal;
+    }
+
+THuiCanvasWsGcType CHuiCanvasWsHwGc::Type() const
+    {
+    return EHuiCanvasWsHw;
+    }
+
+THuiCanvasDrawMode CHuiCanvasWsHwGc::SelectCanvasDrawMode(TInt aWsDrawMode)
+    {
+    if (aWsDrawMode == MWsGraphicsContext::EDrawModeWriteAlpha)
+        {
+        return EHuiCanvasDrawModeNormal;            
+        }
+    else
+        {
+         return EHuiCanvasDrawModeBlend;
+        }    
+    }
+
+void CHuiCanvasWsHwGc::EnableUpdateRegion(const TRegion& aUpdateRegion, TBool aClear)
+    {
+    CHuiGc* gc = iCanvasGc->Gc(); 
+    if (gc && IsRenderingEnabled())
+        {
+        gc->Enable(CHuiGc::EFeatureClipping);
+        gc->PushClip();
+        gc->Clip(aUpdateRegion);
+        if (aClear)
+            {
+            TInt oldAlpha = gc->PenAlpha();
+            TRgb oldColor = gc->PenColor();            
+            gc->SetPenAlpha(0);
+            gc->SetPenColor(KRgbBlue);
+            gc->Clear(); 
+            gc->SetPenAlpha(oldAlpha);
+            gc->SetPenColor(oldColor);
+            }
+        }
+    }
+
+void CHuiCanvasWsHwGc::DisableUpdateRegion()
+    {
+    CHuiGc* gc = iCanvasGc->Gc(); 
+    if (gc && IsRenderingEnabled())
+        {    
+        gc->PopClip();
+        }
+    }
+
+void CHuiCanvasWsHwGc::BindRenderBuffer(CHuiCanvasRenderBuffer* aRenderbuffer, const TRegion& aUpdateRegion)
+    {
+    // Disable effective opacity when rendering to a buffer
+    iCanvasGc->EnableEffectiveOpacity(EFalse);
+    
+    THuiRealRect updatedRect = aUpdateRegion.BoundingRect();
+
+    // Bind render buffer as rendering target (further drawing will be redirected to render buffer)
+    aRenderbuffer->Bind();
+
+    // Restore gc state after render target bind/unbind ops
+    iCanvasGc->RestoreState();
+
+    // Translation values
+    TReal32 x = -updatedRect.iTl.iX;
+    TReal32 y = -updatedRect.iTl.iY;  
+    
+    // Push clipping so that we can restore it after we have done drawing into render buffer.
+    iCanvasGc->Gc()->PushClip();
+    
+    // Set new clipping region which does not clip anything. 
+    // We want always draw aUpdateRegion fully to the aRenderbuffer. 
+    TRect displayArea = iCanvasGc->Gc()->DisplayArea(); 
+    iCanvasGc->Gc()->SetClip(displayArea); // this call does not transform region anymore
+    
+    // We use translation to get screen coordinates to match render buffer coordinates
+    iCanvasGc->PushTransformationMatrix();
+    iCanvasGc->Translate(x, y, 0.f);
+        
+    // Handle relative rotation
+    TInt w = displayArea.Width();
+    TInt h = displayArea.Height();
+    
+    // ...select right rotation...
+    if (iRelativeOrientation == CHuiGc::EOrientationCW90)
+        {
+        // Rotate around origo and move back to displayarea
+        iCanvasGc->Rotate(-90, 0, 0, 1.f);
+        iCanvasGc->Translate(-h, 0, 0);
+        }
+    else if (iRelativeOrientation == CHuiGc::EOrientationCCW90)
+        {
+        // Rotate around origo and move back to displayarea
+        iCanvasGc->Rotate(90, 0, 0, 1.f);
+        iCanvasGc->Translate(0, -w, 0);
+        }
+    else if (iRelativeOrientation == CHuiGc::EOrientation180)
+        {
+        // Rotate around origo and move back to displayarea
+        iCanvasGc->Rotate(180, 0, 0, 1.f);
+        iCanvasGc->Translate(-w, -h, 0);            
+        }
+    else
+        {
+        // Nothing
+        }            
+        
+    // Set needed clip region
+    iCanvasGc->Gc()->Clip(aUpdateRegion);
+    }
+
+void CHuiCanvasWsHwGc::UnBindRenderBuffer(CHuiCanvasRenderBuffer* aRenderbuffer)
+    {
+    // Enable effective opacity again when no more rendering to buffer
+    iCanvasGc->EnableEffectiveOpacity(ETrue);
+
+    // Restore translation (screen coordinates to match render buffer coordinates)
+    iCanvasGc->PopTransformationMatrix();
+
+    // Restore clipping 
+    iCanvasGc->Gc()->PopClip();
+            
+    // Unbind render buffer as rendering target (further drawing will be done to display normally) 
+    aRenderbuffer->UnBind();
+    
+    // Restore gc state after render target bind/unbind ops
+    iCanvasGc->RestoreState();
+    }
+
+void CHuiCanvasWsHwGc::SetRelativeOrientation(CHuiGc::TOrientation aOrientation)
+    {
+    iRelativeOrientation = aOrientation;
+    }
+
+
+void CHuiCanvasWsHwGc::UseBrushPattern()
+    {
+    THuiCachedImageParams cachedImageParams;
+    cachedImageParams.iBitmapHandle = iWsBrushPattern;
+    cachedImageParams.iGcParams = CachedGcParams();    
+
+    const CHuiCanvasGraphicImage* cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedImageL(cachedImageParams,*iVisual);    
+    if (IsRenderingEnabled())
+        {
+        iCanvasGc->SetPolygonFillTexture(cachedImage->Texture());
+        // Symbian implementation for CWindowGc is different from CFbsBitGc. Latter
+        // adds iWsOrigin to iWsBrushOrigin, but because we are implementing
+        // CWindowGc, we do not take iWsOrigin into account here.
+        iCanvasGc->SetPolygonFillTextureOrigin(iWsBrushOrigin); 
+        }
+    }
+
+void CHuiCanvasWsHwGc::DiscardBrushPattern()
+    {
+    if (IsRenderingEnabled())
+        {
+        iCanvasGc->SetPolygonFillTexture(NULL);
+        iCanvasGc->SetPolygonFillTextureOrigin(TPoint(0,0));
+        }
+    }
+
+TBool CHuiCanvasWsHwGc::IsDifferent(const TRgb& aFirst, const TRgb& aSecond, TBool aIgnoreAlpha)
+    {
+    if (aIgnoreAlpha)
+        {
+        const TUint32 mask = 0x00FFFFFF;
+        return ((aFirst.Internal() & mask) != (aSecond.Internal() & mask));
+        }
+    else
+        {
+        return (aFirst.Internal() != aSecond.Internal());
+        }    
+    }
+
+void CHuiCanvasWsHwGc::UseWsState()
+    {
+#ifdef __WINS__
+    iPushCount++;
+    if(iPushCount>1)
+        {
+        // This function cannot be called recursively. Fix your code.
+        USER_INVARIANT();
+        }
+#endif    
+    iOldColor = iCanvasGc->PenColor();            
+    iOldOpacity = iCanvasGc->Opacity();
+    iOldDrawMode = iCanvasGc->DrawMode();
+    iOldPenWidth = iCanvasGc->PenWidth(); 
+    iOldPolygonDrawMode = iCanvasGc->PolygonDrawMode();
+    
+    iCanvasGc->SetPenColor(iWsPenColor);
+    iCanvasGc->SetOpacity(TReal32(iWsPenColor.Alpha() / 255.f));
+    iCanvasGc->SetDrawMode(SelectCanvasDrawMode(iWsDrawMode));
+    iCanvasGc->SetPenWidth(iWsPenSize.iWidth);
+    iCanvasGc->PolygonDrawMode();
+    }
+
+void CHuiCanvasWsHwGc::UseCanvasState()
+    {
+#ifdef __WINS__
+    iPushCount--;
+    if(iPushCount!=0)
+        {
+        // This function cannot be called recursively. Fix your code.
+        USER_INVARIANT();
+        }
+#endif
+    iCanvasGc->SetPenColor(iOldColor);            
+    iCanvasGc->SetOpacity(iOldOpacity);
+    iCanvasGc->SetDrawMode(iOldDrawMode);
+    iCanvasGc->SetPenWidth(iOldPenWidth);
+    iCanvasGc->SetPolygonDrawMode(iOldPolygonDrawMode);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvaswspainter.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,2646 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiCanvasWsPainter.
+*
+*/
+
+
+
+#include "huicanvaswspainter.h"
+
+#include "uiacceltk/HuiCanvasVisual.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiPanic.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiVisual.h"
+#include "uiacceltk/HuiTextMesh.h"
+#include "uiacceltk/HuiCanvasCmdBufferReader.h"
+#include "huicanvasgc.h"
+#include "huicanvaswsgc.h"
+#include "HuiRenderSurface.h"
+#include "huicanvastexturecache.h"
+#include "huicanvasbackground.h"
+#include "huicanvaswsswgc.h"
+#include "huicanvasdebugwsgc.h"
+#include "huicanvaswsbitgc.h"
+#include "../../CommonInc/huiwscanvascommands.h"
+#include <graphics/wsgraphicscontext.h>
+
+#ifdef HUI_DEBUG_TRACK_DRAWING
+#include "alfloggingconfiguration.h"
+#include "alfcommanddebug.h"
+#endif
+#include <e32cmn.h>
+#include <AknLayoutFont.h>
+#include <graphics/lookuptable.h>
+
+#include "HuiCmdBufferBrush.h"
+
+/** 
+ * Constants to define enabling/disabling render buffer automatically 
+ *  incase there are frequently new buffers posted. 
+ * 
+ *  This may improve performance in some HW platforms.
+ * 
+ */
+const TBool KHuiCanvasAutomaticRenderBufferUsage = EFalse; // Disbaled until all UI isses has been solved  
+const TInt KHuiCanvasDisableRenderBufferHandleInterval = 100; // Milliseconds 
+const TInt KHuiCanvasEnableRenderBufferHandleInterval = 500;  // Milliseconds
+
+/** Internal constant to identify complex command buffers */
+const TInt KPossiblePerformanceProblemInWindow = 64;
+
+
+/** ETrue - use SelectGcL to select gc implementation, 
+    EFalse - use KHuiDefaultCanvasWsGc. */
+const TBool KHuiUseSelectGc = ETrue;
+
+/** Change this to select default rendering ws gc implementation.
+    Only used when KHuiUseSelectGc does not hold. */
+const THuiCanvasWsGcType KHuiDefaultCanvasWsGc = EHuiCanvasWsHw;
+
+//#define HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+
+CHuiCanvasWsPainter* CHuiCanvasWsPainter::NewL()
+	{
+	CHuiCanvasWsPainter* self    = new ( ELeave ) CHuiCanvasWsPainter;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+	return self;
+    }
+
+
+CHuiCanvasWsPainter::CHuiCanvasWsPainter()
+    {
+    }
+
+void CHuiCanvasWsPainter::ConstructL()
+    {
+    CHuiStatic::Env().AddMemoryLevelObserver(this);
+    iWsCommandBufferReader = NULL;
+    iPartialCommandBuffer = NULL;
+    iCacheCleared = EFalse;
+
+    if ( KHuiUseSelectGc )
+        {
+        SelectGcL();
+        }
+    else if (KHuiDefaultCanvasWsGc == EHuiCanvasWsHw)
+        {
+        iCanvasWsHwGc = CHuiCanvasWsHwGc::NewL();
+        iCanvasWsGc = iCanvasWsHwGc;        
+        }
+    else if (KHuiDefaultCanvasWsGc == EHuiCanvasWsSw)
+        {
+        iCanvasWsSwGc = CHuiCanvasWsSwGc::NewL();
+        iCanvasWsGc = iCanvasWsSwGc;            
+        }    
+    else if (KHuiDefaultCanvasWsGc == EHuiCanvasWsBit)
+        {
+        iCanvasWsBitGc = CHuiCanvasWsBitGc::NewL();
+        iCanvasWsGc = iCanvasWsBitGc;            
+        }    
+    else
+        {
+        // Never happens, right.
+        }
+    
+    iWsCommandBufferReader = new (ELeave) CHuiCanvasCmdBufferReader();    
+#ifdef HUI_DEBUG_TRACK_DRAWING
+    iCommandDebugger = CAlfCommandDebug::NewL();
+    CHuiCanvasWsGc* realGc = iCanvasWsGc;
+    iCanvasWsGc = CHuiCanvasDebugWsGc::NewL( realGc, *iCommandDebugger );
+    
+#endif
+    }
+
+
+CHuiCanvasWsPainter::~CHuiCanvasWsPainter()
+    {
+    if (iCanvasVisual)
+        {
+        iCanvasVisual->Env().CanvasTextureCache().ReleaseAllCachedEntries(*iCanvasVisual);
+        iCanvasVisual->Env().RemoveMemoryLevelObserver(this);
+        }
+    else
+        {
+        CHuiStatic::Env().RemoveMemoryLevelObserver(this);
+        }
+    
+    ClearCommandSet();	
+    delete iWsCommandBufferReader;	
+    delete iCanvasWsHwGc;
+    delete iCanvasWsSwGc;
+    delete iCanvasWsBitGc;
+
+    iTempRegion.Close();
+    iTempCurrentSubRegion.Close();
+    iTempIntersectingRegion.Close();
+#ifdef HUI_DEBUG_TRACK_DRAWING
+    delete iCommandDebugger;
+#endif
+    iFullUpdateRegion.Close();
+    iShapeRegion.Close();
+    }
+    
+
+CHuiGc::TOrientation CHuiCanvasWsPainter::CalculateRelativeOrientation()
+    {
+    // Calculate drawing command rotation as relative to the current display rotation.
+    // It may be that drawing commands has been sent when display was in different rotation.
+    TInt last = iCommandBuffers.Count() - 1;
+    CHuiGc::TOrientation relativeOrientation = CHuiGc::EOrientationNormal;    
+    CHuiGc::TOrientation displayOrientation = CHuiStatic::Env().PrimaryDisplay().Orientation(); 
+    CHuiGc::TOrientation drawingCommandOrientation = iCommandBuffers[last]->iOrientation; 
+    
+    TInt rotationAngle[] =
+        {
+        0, 
+        270, 
+        90, 
+        180
+        };
+        
+    TInt displayOrientationAngle = rotationAngle[displayOrientation];
+    TInt drawingCommandOrientationAngle = rotationAngle[drawingCommandOrientation];    
+    TInt relativeOrientationAngle = drawingCommandOrientationAngle - displayOrientationAngle;
+    
+    // Check over/underflow
+    if (relativeOrientationAngle > 360)
+        {
+        relativeOrientationAngle -= 360;
+        }
+    else if (relativeOrientationAngle < 0)
+        {
+        relativeOrientationAngle += 360;
+        }
+    
+    switch (relativeOrientationAngle)
+        {
+        case 0:
+            {
+            relativeOrientation = CHuiGc::EOrientationNormal;
+            break;
+            }
+        case 90:
+            {
+            relativeOrientation = CHuiGc::EOrientationCW90;            
+            break;
+            }
+        case 270:
+            {
+            relativeOrientation = CHuiGc::EOrientationCCW90;            
+            break;
+            }
+        case 180:
+            {
+            relativeOrientation = CHuiGc::EOrientation180;            
+            break;
+            }
+        default:
+            {
+            // As usual, this should not happen...but just in case it does use normal rotation
+            relativeOrientation = CHuiGc::EOrientationNormal;
+            break;
+            }        
+        }
+    return relativeOrientation;
+    }
+
+void CHuiCanvasWsPainter::HandleBufferL(TRect& aDisplayRect, TInt aAction, const CHuiCanvasVisual& aUser, CHuiGc* aGc, TPoint aPos ) 
+    {   
+	#ifdef __ALF_SYMBIAN_RWINDOW_CLEARING_BUG_WORKAROUND__
+    iTestFullDisplayRect = aDisplayRect;
+	#endif
+    
+    // Store user so that we can clear cache later
+    iCanvasVisual = (CHuiCanvasVisual*)&aUser;
+
+    // Let canvas know about user and gc
+    CHuiCanvasGc& canvasGc = iCanvasWsGc->CanvasGc();
+    canvasGc.SetVisual(aUser);
+    if (aGc)
+        {
+        canvasGc.SetGc(*aGc);
+        }
+    
+    if (iCommandBuffers.Count() != 0)
+        {
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        RDebug::Print(_L(">> CHuiCanvasWsPainter::HandleBufferL this = %i, Action = %i"), this, aAction );
+        TTime startTime;
+        startTime.UniversalTime();
+#endif
+
+        // Initialize canvas
+        canvasGc.SetDefaults();   
+
+        // Make sure we got up to date update reagion
+        iFullUpdateRegion.Clear();                
+        TInt bufferCount = iCommandBuffers.Count();
+        for (TInt cb = 0; cb < bufferCount; cb++)
+            {        
+            iFullUpdateRegion.Union(iCommandBuffers[cb]->iUpdateRegion);
+            }
+        iFullUpdateRegion.Tidy();
+        
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        const TRect updateRegionBoundingRect = iFullUpdateRegion.BoundingRect();        
+        RDebug::Print(_L(">> CHuiCanvasWsPainter::HandleBufferL iFullUpdateRegion.BoundingRect() = (%i,%i) (%i,%i)"), 
+                updateRegionBoundingRect.iTl.iX,
+                updateRegionBoundingRect.iTl.iY,
+                updateRegionBoundingRect.iBr.iX,
+                updateRegionBoundingRect.iBr.iY
+                );
+
+        if (iCanvasWsGc->Type() == EHuiCanvasWsSw)
+            {
+            RDebug::Print(_L(">> CHuiCanvasWsPainter::HandleBufferL - SW mode is used."));
+            }
+        else if (iCanvasWsGc->Type() == EHuiCanvasWsBit)
+            {
+            RDebug::Print(_L(">> CHuiCanvasWsPainter::HandleBufferL - BITGC mode is used."));
+            }
+        
+        if (aUser.Effect())
+            {
+            RDebug::Print(_L(">> CHuiCanvasWsPainter::HandleBufferL - visual has EFFECT"));
+            }
+        
+        
+#endif
+        
+        if (aAction == EDrawBuffer)
+            {
+            /* Check and enable render buffer if needed */
+            EnableRenderBufferIfNeeded(ETrue);
+
+            // Compenstate possible orientation mismatch between drawing commands and display orientation
+            // by letting iCanvasWsGc know about it. Mismatch usually happens when screen is rotated and
+            // it may cause visually unpleasent things at the screen.
+            CHuiGc::TOrientation relativeOrientation = CalculateRelativeOrientation();
+            iCanvasWsGc->SetRelativeOrientation(relativeOrientation);
+            #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+            RDebug::Print(_L(">> CHuiCanvasWsPainter::HandleBufferL - relativeOrientation = %i "), relativeOrientation);    
+            #endif
+            
+            /* If window shape region has been changed, we should clear the window to get rid of old content. 
+             * We also set all command buffers to "not drawn" state so that everything will be redrawn.
+             */
+            TBool isFullUpdateRegionCleared = EFalse;
+            if(iShapeRegionClearingPending)
+                {
+                #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+                RDebug::Print(_L(">> CHuiCanvasWsPainter::HandleBufferL - Clearing fullupdateregion"));    
+                #endif
+                // Clear the window update region area
+                TBool doClear = ETrue;
+                iCanvasWsGc->EnableUpdateRegion(iFullUpdateRegion, doClear);
+                iCanvasWsGc->DisableUpdateRegion(); 
+                isFullUpdateRegionCleared = ETrue;
+                
+                // Cause a full redraw for the canvas visual
+                SetAllBuffersChanged(ETrue);    
+                ClearAllBufferStatusFlags(EHuiCanvasBufferStatusDrawn);
+                iShapeRegionClearingPending = EFalse;
+                }
+            
+            
+            /* Check if we have buffers that are not yet been drawn (or we render buffer is disabled) */
+            TBool cachePrepared = !HasCommandBuffersWithoutFlags(EHuiCanvasBufferStatusDrawn) || !iCanvasWsGc->IsRenderBufferEnabled();
+
+            /* Begin draw. If render buffer is used this sets up the render buffer if needed */
+            iCanvasWsGc->BeginActionL(aAction,aDisplayRect,aUser,cachePrepared,iFullUpdateRegion);                   
+
+            #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+            if (iCanvasWsGc->IsRenderBufferEnabled())
+                {
+                RDebug::Print(_L(">> CHuiCanvasWsPainter::HandleBufferL renderbuffer is ENABLED"));
+                }
+            else
+                {
+                RDebug::Print(_L(">> CHuiCanvasWsPainter::HandleBufferL renderbuffer is DISABLED"));
+                }
+            #endif
+            
+            /* We do not ignore unchanged buffers currently */
+            TBool ignoreUnChangedBuffers = EFalse; 
+
+            /* We can ignore buffers that only update areas which get clipped */
+            TBool ignoreClippedBuffers = ETrue;            
+            if (relativeOrientation != CHuiGc::EOrientationNormal)
+                {
+                ignoreClippedBuffers = EFalse;
+                }
+            
+            /* We can ignore buffers that has previously already been drawn into render buffer */
+            TBool ignoreHandledBuffers = iCanvasWsGc->IsRenderBufferEnabled() && iCanvasWsGc->IsRenderBufferInitialized();                    
+
+            
+            /* 
+             * We need to clear area if render buffer is used because otherwise it will cause dimming for semitransparent areas.
+             * 
+             * NOTE1: We do not clear if the window is opaque. This is a bit questionable, but Avkon seems to rely
+             * quite much on luck with its drawing and there are areas in the windows which are not always covered
+             * by drawing commands, thus random garabage from previous frames would be visible if such window
+             * update area would always be cleared.
+             * 
+             * NOTE2: We handle window that has background clearing enabled similarly as transparent window
+             *        because their wanted behaviour is similar to transparent window (user wants to see the stuff
+             *        behind window drawing commands and may want to draw commands translucently). 
+             *        
+             * -> So always clear if drawing vie render buffer and window is transparent or has backround.       
+             *        
+             */            
+            TBool clearBeforeHandlingBuffer = iCanvasWsGc->IsRenderBufferEnabled() 
+                && (!(aUser.Flags() & EHuiVisualFlagOpaqueHint) || aUser.IsBackgroundDrawingEnabled())
+                && !isFullUpdateRegionCleared;
+                        
+            // TODO: Should avoid trap, but EndActionL must always be called
+            TRAPD(err, DoHandleAllBuffersL( aDisplayRect, aAction, aUser, aGc, aPos, 
+                    ignoreUnChangedBuffers, 
+                    ignoreClippedBuffers,
+                    ignoreHandledBuffers,
+                    clearBeforeHandlingBuffer));
+            
+            if (err != KErrNone)
+                {
+                RDebug::Print(_L("CHuiCanvasWsPainter::HandleBufferL(): draw error = %i "), err);
+                RenewAllBuffers();
+                }
+            
+            // Workaround for fact that WSERV sends command buffers that do not contain real drawing commands.
+            // If there are no real drawing commnads, just avoid display update at the EndAction so that
+            // we don't write empty pixels to screen and cause flicker. 
+            TBool updateDisplay = HasCommandBuffers(EHuiCanvasBufferContainsDrawing);
+            
+            /* End draw. If render buffer is in use, this will update the screen */
+            iCanvasWsGc->EndActionL(iFullUpdateRegion, updateDisplay);                 
+            
+            /* Mark that cache is not more clear */
+            iCacheCleared = EFalse;
+            }
+        else if (aAction == EScanBuffer)
+            {
+            /* Check and enable render buffer if needed */
+            EnableRenderBufferIfNeeded(ETrue);
+            
+            /* Check if we have buffers that are not yet prepared (or we render buffer is disabled) */
+            TBool cachePrepared = !HasCommandBuffersWithoutFlags(EHuiCanvasBufferStatusScanned) || !iCanvasWsGc->IsRenderBufferEnabled();
+
+            /* Begin scan. If render buffer is used this sets up the render buffer if needed */
+            iCanvasWsGc->BeginActionL(aAction,aDisplayRect,aUser,cachePrepared,iFullUpdateRegion);    
+
+            #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+            if (iCanvasWsGc->IsRenderBufferEnabled())
+                {
+                RDebug::Print(_L(">> CHuiCanvasWsPainter::HandleBufferL renderbuffer is ENABLED"));
+                }
+            else
+                {
+                RDebug::Print(_L(">> CHuiCanvasWsPainter::HandleBufferL renderbuffer is DISABLED"));
+                }
+            #endif
+            
+            /* We do not ignore unchanged buffers currently */
+            TBool ignoreUnChangedBuffers = EFalse;
+            
+            /* We do not ignore clipped buffers as they possibly contain items that may soon appear on the screen */
+            TBool ignoreClippedBuffers = EFalse;                    
+            
+            /* We can ignore buffers that has previously already been scanned */
+            TBool ignoreHandledBuffers = ETrue;     
+
+            /* No need to clear area if scanning */
+            TBool clearBeforeHandlingBuffer = EFalse;
+            
+            // TODO: Should avoid trap, but EndActionL must always be called
+            TRAPD(err, DoHandleAllBuffersL( aDisplayRect, aAction, aUser, aGc, aPos, 
+                    ignoreUnChangedBuffers, 
+                    ignoreClippedBuffers,
+                    ignoreHandledBuffers,
+                    clearBeforeHandlingBuffer));    
+            
+            if (err != KErrNone)
+                {
+                RDebug::Print(_L("CHuiCanvasWsPainter::HandleBufferL(): scan error = %i "), err);
+                RenewAllBuffers();
+                }
+            
+            /* End draw. If render buffer is in use, this will update the screen */
+            iCanvasWsGc->EndActionL(iFullUpdateRegion, EFalse);
+
+            /* Mark that cache is not more clear */
+            iCacheCleared = EFalse;
+            
+            /* Update dirty area to aDisplayRect in case this action is originated from dirty area scan */
+            aDisplayRect = DirtyRect();
+            }
+            
+                        
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        TTime endTime;
+        endTime.UniversalTime();
+        TInt timeInMs =  endTime.MicroSecondsFrom( startTime ).Int64()/1000;           
+        RDebug::Print(_L(">> CHuiCanvasWsPainter::HandleBufferL took %i ms"), timeInMs);
+#endif
+        }
+        
+    }
+
+void CHuiCanvasWsPainter::DoHandleAllBuffersL( TRect& aDisplayRect, 
+                                               TInt aAction, 
+                                               const CHuiCanvasVisual& aUser, 
+                                               CHuiGc* aGc, 
+                                               TPoint& aPos, 
+                                               TBool aIgnoreUnChangedBuffers, 
+                                               TBool aIgnoreClippedBuffers, 
+                                               TBool aIgnoreHandledBuffers,
+                                               TBool aClearBeforeHandlingBuffers) 
+    {   
+    UpdateBufferUpdateRegions(aPos);
+
+    TInt bufferCount = iCommandBuffers.Count();
+    for (TInt cb = 0; cb < bufferCount; cb++)
+        {
+        CHuiCanvasCommandBuffer* cmdbuffer = iCommandBuffers[cb];
+
+        #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        RDebug::Print(_L(">> CHuiCanvasWsPainter::DoHandleAllBuffersL Buffer size: %i "), iCommandBuffers[cb]->iCommands->Size());                
+        for (TInt k=0; k < cmdbuffer->iUpdateRegion.Count();k++)
+            {
+            RDebug::Print(_L(">> CHuiCanvasWsPainter::DoHandleAllBuffersL Buffer region rect: %i,%i, %i,%i "), 
+                cmdbuffer->iUpdateRegion[k].iTl.iX,
+                cmdbuffer->iUpdateRegion[k].iTl.iY,
+                cmdbuffer->iUpdateRegion[k].iBr.iX,
+                cmdbuffer->iUpdateRegion[k].iBr.iY);                
+            }
+        #endif
+
+        if (aIgnoreUnChangedBuffers && !cmdbuffer->iChanged)
+            {
+            #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+            RDebug::Print(_L(">> CHuiCanvasWsPainter::DoHandleAllBuffersL Skipping buffer, it has not changed"));                
+            #endif            
+            continue;            
+            }
+
+        if (aIgnoreHandledBuffers)
+            {
+            if (aAction == EDrawBuffer && (cmdbuffer->iStatusFlags & EHuiCanvasBufferStatusDrawn))
+                {
+                #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+                RDebug::Print(_L(">> CHuiCanvasWsPainter::DoHandleAllBuffersL Skipping buffer, it has already been drawn."));                
+                #endif                            
+                continue;
+                }
+            else if (aAction == EScanBuffer && (cmdbuffer->iStatusFlags & EHuiCanvasBufferStatusScanned))
+                {
+                #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+                RDebug::Print(_L(">> CHuiCanvasWsPainter::DoHandleAllBuffersL Skipping buffer, it has already been scanned."));                
+                #endif            
+                continue;            
+                }
+            else
+                {
+                // No, we dont ignore.                                
+                }
+            }
+            
+        if (aIgnoreClippedBuffers && IsBufferCompletelyOutisideClippingRegion(*cmdbuffer))
+            {
+            #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+            RDebug::Print(_L(">> CHuiCanvasWsPainter::DoHandleAllBuffersL: Skipping buffer %i, as it is completely clipped"), cb);
+            #endif                    
+            continue;
+            }
+              
+        if (aGc)
+            {
+            #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+            RDebug::Print(_L(">> CHuiCanvasWsPainter::DoHandleAllBuffersL ClipRegion before clipping to updateregion:"));                
+            const TRegion& originalclipregion = aGc->ClipRegion(); 
+            for (TInt k=0; k < originalclipregion.Count();k++)
+                {
+                
+                RDebug::Print(_L(">> CHuiCanvasWsPainter::DoHandleAllBuffersL original clip region rect: %i,%i, %i,%i "), 
+                        originalclipregion[k].iTl.iX,
+                        originalclipregion[k].iTl.iY,
+                        originalclipregion[k].iBr.iX,
+                        originalclipregion[k].iBr.iY);                
+                }
+            #endif
+
+            
+            // If buffers has been scanned, but it does not seem to contain any real drawing commands we discard it            
+            if (!(cmdbuffer->iStatusFlags & EHuiCanvasBufferContainsDrawing) && (cmdbuffer->iStatusFlags & EHuiCanvasBufferStatusScanned))
+                {
+                #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+                RDebug::Print(_L("CHuiCanvasWsPainter::DoHandleAllBuffersL: Hmmm, WSERV has sent buffer without real drawing commands."), cb);
+                #endif
+                continue;
+                }
+            
+            // Clip drawing to update area. This seems to improve performance although
+            // it may depend on used HW.
+            iCanvasWsGc->EnableUpdateRegion(iCommandBuffers[cb]->iUpdateRegion, aClearBeforeHandlingBuffers);
+
+            #ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+            RDebug::Print(_L(">> CHuiCanvasWsPainter::DoHandleAllBuffersL ClipRegion after clipping to updateregion:"));                
+            const TRegion& clipregion = aGc->ClipRegion(); 
+            for (TInt k=0; k < originalclipregion.Count();k++)
+                {
+                
+                RDebug::Print(_L(">> CHuiCanvasWsPainter::DoHandleAllBuffersL current clip region rect: %i,%i, %i,%i "), 
+                        clipregion[k].iTl.iX,
+                        clipregion[k].iTl.iY,
+                        clipregion[k].iBr.iX,
+                        clipregion[k].iBr.iY);                
+                }
+            #endif
+            
+            TRAPD(error, DoHandleBufferL(cb, aDisplayRect, aAction, aUser, aGc, aPos ));
+            
+            if (error)
+                {
+                #ifdef _DEBUG
+                RDebug::Print(_L("CHuiCanvasWsPainter::DoHandleAllBuffersL: Error in buffer %i, continuing."), cb);
+                #endif
+                }
+            
+            iCanvasWsGc->DisableUpdateRegion();
+            }
+        else
+            {
+            DoHandleBufferL(cb, aDisplayRect, aAction, aUser, aGc, aPos);
+            }
+        
+        // Update buffer status
+        if (aAction == EDrawBuffer)
+            {
+            cmdbuffer->SetStatusFlags(EHuiCanvasBufferStatusDrawn);
+            }
+        else if (aAction == EScanBuffer)
+            {
+            cmdbuffer->SetStatusFlags(EHuiCanvasBufferStatusScanned);            
+            }
+        else
+            {
+            // This should not happen
+            }
+        }         
+    }
+
+
+void CHuiCanvasWsPainter::HandleBufferL(TRect& aDisplayRect, TInt aAction, const CHuiCanvasVisual& aUser, CHuiGc* aGc, TPoint aPos, TPtrC8 aCommands, CHuiCanvasCommandBuffer * /*buf*/)
+    {
+    TUint8 *ptr = const_cast<TUint8*>(aCommands.Ptr());
+    TInt length = aCommands.Length();
+    TPtr8 cmds(ptr, length, length);
+    CHuiCanvasCommandBuffer *buf = new (ELeave)CHuiCanvasCommandBuffer;
+    CleanupStack::PushL(buf);
+    buf->iUpdateRegion.AddRect(aDisplayRect);
+    if (iCanvasVisual && iCanvasVisual->Display())
+        {
+        buf->iOrientation = iCanvasVisual->Display()->Orientation();
+        }
+    DoHandleBufferStringL(-1, aDisplayRect, aAction, aUser, aGc, aPos, cmds, buf);
+    CleanupStack::PopAndDestroy();
+    }
+
+void CHuiCanvasWsPainter::DoPeekBufferL(TInt aIndex) 
+    {   
+    RMemReadStream& readerStream = iWsCommandBufferReader->Stream();
+    CHuiCanvasCommandBuffer& commandBuffer = *iCommandBuffers[aIndex];
+    HBufC8* cmdBuf = commandBuffer.iCommands;
+    TInt bufLength =  cmdBuf->Length();
+    
+    TPtr8 des = cmdBuf->Des();
+    iWsCommandBufferReader->Init( des, bufLength );
+    TInt offset = 0; 
+    TInt command = 0;
+    TBool donePeeking = EFalse;
+    do
+        {
+        command = readerStream.ReadUint8L();
+        
+        switch ( command )
+            {
+            case EAlfFrameContainsUnsupportedCommands:
+                {
+                TUint8 containsUnsupportedCommands = iWsCommandBufferReader->Stream().ReadUint8L();
+                if ( containsUnsupportedCommands )
+                    {
+                    commandBuffer.iContainsUnsupportedCommands = ETrue;
+                    }
+                break;
+                }
+            case EAlfFrameFlags:
+                {
+                TInt flags;
+                iWsCommandBufferReader->ReadInt32L( flags );
+                if (flags & EAlfTransparentContent)
+                    {
+                    EnableRenderBuffer(ETrue);
+                    }                
+                break;
+                }
+            case EAlfSetUpdateRegion: 
+                {
+                WsSetUpdateRegionL(aIndex);
+				commandBuffer.iPositionForUpdateRegion = Visual()->DisplayRect().iTl.Round();
+                break;
+                }
+            case EAlfCommandIndexArrayHeader:
+                {
+                TInt tmp;
+                iWsCommandBufferReader->ReadInt8L(); // padding
+                iWsCommandBufferReader->ReadInt32L( tmp );
+                iWsCommandBufferReader->ReadInt32L( tmp );
+                break;
+                }
+            case EAlfPacketPadding:
+                {
+                DoDigestPaddingL();
+				break;
+                }
+            case EAlfSetShapeRegion: 
+                {
+                WsSetShapeRegionL( aIndex );
+                break;
+                }
+            default:
+                {
+                donePeeking = ETrue;
+                break;    
+                }     
+            }
+        
+   		offset = readerStream.Source()->TellL( MStreamBuf::ERead ).Offset();
+       	
+        } while( offset < bufLength && !donePeeking);
+    
+    iCommandBuffers[aIndex]->iOriginalDisplayRect = iCanvasVisual->DisplayRect();
+    }
+
+
+#ifdef HUI_DEBUG_TRACK_DRAWING
+void CHuiCanvasWsPainter::DoHandleBufferL(TInt aIndex, TRect& aDisplayRect, TInt aAction, const CHuiCanvasVisual& aUser, CHuiGc* aGc, TPoint& aPos) 
+#else
+void CHuiCanvasWsPainter::DoHandleBufferL(TInt aIndex, TRect& aDisplayRect, TInt aAction, const CHuiCanvasVisual& aUser, CHuiGc* aGc, TPoint& aPos) 
+#endif
+    {
+    CHuiCanvasCommandBuffer* commandBuffer = iCommandBuffers[aIndex];
+    HBufC8* cmdBuf = commandBuffer->iCommands;
+
+#ifdef HUI_DEBUG_TRACK_DRAWING
+    if ( commandBuffer->iTrackedBuffer )
+        {
+        RDebug::Print( _L("CHuiCanvasWsPainter::DoHandleBufferL - Tracked buffer found"));
+        switch ( aAction )
+            {
+            case EDrawBuffer:
+                {
+                RDebug::Print( _L("CHuiCanvasWsPainter::DoHandleBufferL - draw buffer"));
+                break;
+                }
+            case EScanBuffer:
+                {
+                RDebug::Print( _L("CHuiCanvasWsPainter::DoHandleBufferL - scan buffer"));
+                break;
+                }
+            default:;
+            }
+        }
+
+    iCommandDebugger->StartFrame();
+    if ( commandBuffer->iProcessName )
+        {
+        // UNCOMMENT THIS IF YOU WANT TO PRINT EVERYTHING
+        // iCommandDebugger->SetPrint( ETrue );
+        // UNCOMMENT THIS IF YOU WANT PRINTS ONLY FOR CERTAIN PROCESS!
+        // DEFINE PROCESS NAME IN alfcommanddebug.cpp
+        // iCommandDebugger->SetPrint( iCommandDebugger->TrackProcess( commandBuffer->iProcessName ) );
+        RDebug::Print(_L("CHuiCanvasWsPainter::DoHandleBufferL - Process [%S]"), commandBuffer->iProcessName );
+        }
+    else
+        {
+//        RDebug::Print(_L("CHuiCanvasWsPainter::DoHandleBufferL - Process [already dead or not found]"));
+        }
+#endif
+  
+    TPtr8 des = cmdBuf->Des();
+    DoHandleBufferStringL(aIndex, aDisplayRect, aAction, aUser, aGc, aPos, des, commandBuffer);
+    }
+
+void CHuiCanvasWsPainter::DoHandleBufferStringL(TInt aIndex, TRect& /*aDisplayRect*/, TInt /*aAction*/, const CHuiCanvasVisual& /*aUser*/, CHuiGc* /*aGc*/, TPoint& aPos, TPtr8 aCmds, CHuiCanvasCommandBuffer *aCommandBuffer)
+    {
+    RMemReadStream& readerStream = iWsCommandBufferReader->Stream();    
+    TInt bufLength =  aCmds.Length();
+    TPtr8 des = aCmds;
+    CHuiCanvasCommandBuffer *commandBuffer = aCommandBuffer;
+    TPoint deltaPos = aPos - commandBuffer->iOriginalDisplayRect.iTl;
+    
+    iCanvasWsGc->SetPositionDelta( deltaPos );
+    iWsCommandBufferReader->Init( des, bufLength );
+    TInt offset = 0; 
+    TInt command = 0;
+    do
+        {
+        command = readerStream.ReadUint8L();
+#ifdef HUI_DEBUG_TRACK_DRAWING
+        iCommandDebugger->SetDescription( command );
+#endif
+
+		// Command cases are ordered approximately in the order so that most common ones are at first
+        switch ( command )
+            {
+            case EAlfFrameContainsUnsupportedCommands:
+                {
+                TUint8 containsUnsupportedCommands = iWsCommandBufferReader->Stream().ReadUint8L();
+                if (containsUnsupportedCommands )
+                    {
+                    // RDebug::Print(_L("Unsupported commands in this frame"));
+                    }
+                break;
+                }
+            case EAlfFrameFlags:
+                {
+                TInt flags;
+                iWsCommandBufferReader->ReadInt32L( flags );
+                if ( flags != 0 )
+                    {
+                    RDebug::Print(_L("FLAGS: %d"), flags );
+                    }
+                break;
+                }
+            case EAlfSetUpdateRegion: 
+                {
+                WsSetUpdateRegionL(aIndex);                    
+                break;
+                }               
+            case EAlfSetShapeRegion: 
+                {
+                iTempRegion.Clear();                
+                iWsCommandBufferReader->ReadRegionL( iTempRegion );
+                break;
+                }               
+            case EAlfSetBrushStyle:
+                {
+                WsSetBrushStyleL();                  
+                break;
+                }
+            case EAlfSetOrigin:
+                {
+                WsSetOriginL();
+                break;
+                }
+            case EAlfSetPenStyle:
+                {
+                WsSetPenStyleL();
+                break;
+                }
+            case EAlfSetClippingRegion:
+                {        
+                WsSetClippingRegionL();
+                break;
+                }
+            case EAlfResetClippingRegion:
+                {
+                WsResetClippingRegionL();
+                break;
+                }
+            case EAlfSetBrushColor:
+                {
+                WsSetBrushColorL();
+                break;
+                }
+            case EAlfBitBltMasked:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsBitBltMaskedL();
+                break;
+                }
+            case EAlfCombinedBitBlitMasked:
+				{
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+				WsCombinedBitBlitMaskedL();
+				break;
+				}
+            case EAlfReset:
+                {
+                WsResetL();
+                break;
+                }
+            case EAlfSetPenColor:
+                {
+                WsSetPenColorL();
+                break;
+                }
+            case EAlfBitBltRect:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsBitBltRectL();
+                break;
+                }
+            case EAlfSetDrawMode:
+                {
+                WsSetDrawModeL();
+                break;
+                }
+            case EAlfSetCharJustification:
+                {
+                WsSetCharJustificationL();
+                break;
+                }
+            case EAlfDrawBitmapMasked:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawBitmapMaskedL();
+                break;
+                }
+            case EAlfSetUnderlineStyle:
+                {
+                WsSetUnderlineStyleL();
+                break;
+                }
+            case EAlfResetFont:
+                {
+                WsResetFontL();
+                break;
+                }
+            case EAlfSetStrikethroughStyle:
+                {
+                WsSetStrikethroughStyleL();
+                break;
+                }
+            case EAlfBitBlt:
+              	{
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+              	WsBitBltL();
+                break;
+              	}
+            case EAlfBitBltMaskedPoint:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsBitBltMaskedPointL();
+                break;
+                }
+            case EAlfClear:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsClearL();
+                break;
+                }
+            case EAlfClearRect:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsClearRectL();
+                break;
+                }
+            case EAlfResetBrushPattern:
+                {
+                WsResetBrushPatternL();
+                break;
+                }
+            case EAlfDrawText1:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawText1L();
+                break;
+                }
+            case EAlfDrawText2:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawText2L();
+                break;
+                }
+            case EAlfDrawText3:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawText3L();
+                break;
+                }
+            case EAlfDrawText4:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawText4L();
+                break;
+                }                
+            case EAlfDrawText5:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawText5L();
+                break;
+                 }
+            case EAlfDrawArc:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawArcL();
+                break;
+                }
+            case EAlfDrawPie:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawPieL();                    
+                break;
+                }
+            case EAlfDrawBitmap1:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawBitmap1L();                    
+                break;
+                }
+            case EAlfDrawBitmap2:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawBitmap2L();
+                break;
+                }
+            case EAlfDrawBitmap3:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawBitmap3L();
+                break;
+                }
+            case EAlfDrawRoundRect:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawRoundRectL();
+                break;
+                }
+            case EAlfDrawPolyLine:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawPolyLineL();
+                break;
+                }
+            case EAlfDrawPolyLineNoEndPoint:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawPolyLineNoEndPointL();
+                break;
+                }
+            case EAlfDrawPolygon:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawPolygonL();                                     
+                break;
+                }
+            case EAlfDrawEllipse:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawEllipseL();
+                break;
+                }
+            case EAlfDrawLine:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawLineL();
+                break;
+                }
+            case EAlfDrawLineTo:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawLineToL();
+                break;
+                }
+            case EAlfDrawLineBy:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawLineByL();
+                break;
+                }
+            case EAlfDrawRect:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawRectL();
+                break;
+                }
+            case EAlfDrawTextVertical1:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawTextVertical1L();
+                break;
+                }
+            case EAlfDrawTextVertical2:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawTextVertical2L();
+                break;
+                }                
+            case EAlfDrawTextVertical3:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawTextVertical3L();                          
+                break;
+                } 
+            case EAlfDrawTextVertical4: 
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawTextVertical4L();
+                break;
+                }
+            case EAlfDrawTextVertical5:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsDrawTextVertical5L();
+                break;
+                }
+            case EAlfMoveTo:
+                {
+                WsMoveToL();
+                break;
+                }
+            case EAlfMoveBy:
+                {
+                WsMoveByL();
+                break;
+                }
+            case EAlfPlot:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsPlotL();
+                break;
+                }
+            case EAlfSetBrushOrigin:
+                {
+                WsSetBrushOriginL();
+                break;
+                }
+            case EAlfSetPenSize:
+                WsSetPenSizeL();                
+                break;
+            case EAlfSetTextShadowColor:
+                {
+                WsSetTextShadowColorL();
+                break;
+                }
+            case EAlfSetWordJustification:
+                {
+                WsSetWordJustificationL();
+                break;
+                }                
+            case EAlfSetBrushPattern:
+                {
+                WsSetBrushPatternL();
+                break;
+                }
+            case EAlfSetBrushPattern2:
+                {
+                WsSetBrushPatternL();
+                break;
+                }
+            case EAlfSetFont:
+                {
+                WsSetFontL();
+                break;
+                }
+            case EAlfContentTag:
+                {
+                WsContentTagL();
+                break;
+                }
+            case EAlfCopyRect:
+                WsCopyRectL();
+                break;
+            case EAlfUpdateJustification:
+                {
+                WsUpdateJustificationL();                  
+                break;
+                }
+            case EAlfUpdateJustificationVertical:
+                {
+                WsUpdateJustificationVerticalL();
+                break;
+                }
+            case EAlfSetFontNoDuplicate:
+                {
+                WsSetFontNoDuplicateL();
+                break;
+                }
+            case EAlfHasBrushPattern:
+            case EAlfHasFont:
+            case EAlfBrushColor:
+            case EAlfPenColor:
+            case EAlfTextShadowColor:
+                {
+                // these values are cached on client side, we dont do anything.
+                break;
+                }
+            case EAlfCopySettings:
+                {
+                WsCopySettingsL();                    
+                break;    
+                }
+            case EAlfSetClippingRect:
+                {
+                WsSetClippingRectL();
+                break;
+                }
+            case EAlfCancelClippingRect:
+                {
+                WsCancelClippingRectL();
+                break;
+                }
+            case EAlfSetFaded:
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsSetFadedL();
+                }
+                break;
+            case EAlfSetFadingParameters:
+                {
+                WsSetFadingParametersL();
+                break;
+                }
+            case EAlfFadeArea: 
+                {
+                commandBuffer->SetStatusFlags(EHuiCanvasBufferContainsDrawing);
+                WsFadeAreaL();
+                break;
+                }
+            case EAlfMapColors:
+                // MapColors is not supported. Client should never supply this command.
+                User::Leave( KErrNotSupported );
+                break;
+            case EAlfSetUserDisplayMode:
+                {
+                WsSetUserDisplayModeL();
+                break;
+                }
+            case EAlfUseFont:
+                {
+                WsUseFontL();                    
+                break;
+                }
+            case EAlfSendSyncDataBlock:
+                {
+                break;
+                }
+            case EAlfWindowInactivateWindow:
+                {
+                // Nothing to do
+                break;
+                }
+            case EAlfPacketPadding:
+                {
+                DoDigestPaddingL();
+				break;
+                }
+            case EAlfCommandIndexArrayHeader:
+                {
+                TInt tmp;
+                iWsCommandBufferReader->ReadInt8L(); // padding
+                iWsCommandBufferReader->ReadInt32L( tmp );
+                iWsCommandBufferReader->ReadInt32L( tmp );
+                break;
+                }
+            case EAlfCommandIndexArray:
+                {
+                TUint8 a = iWsCommandBufferReader->ReadInt8L();
+                iWsCommandBufferReader->ReadInt8L();
+                iWsCommandBufferReader->ReadInt8L();
+                TInt tmp;
+                TRect tmp2;
+                for(TUint8 i=0;i<a;i++)
+                    {
+                    iWsCommandBufferReader->ReadInt32L(tmp);
+                    iWsCommandBufferReader->ReadInt32L(tmp);
+                    iWsCommandBufferReader->ReadInt32L(tmp);
+                    iWsCommandBufferReader->ReadRectL(tmp2);
+                    }
+                break;
+                }
+              
+                
+            default:
+                {
+                // We should never ever get here
+                    HUI_DEBUG1(_L("CHuiCanvasVisual::HandleWsBufferL. Error: Unknown command=%d"), command);
+                break;
+                }
+            }// end switch
+    		offset = readerStream.Source()->TellL( MStreamBuf::ERead ).Offset();
+       	
+        } while( offset < bufLength );
+#ifdef HUI_DEBUG_TRACK_DRAWING
+    iCommandDebugger->EndFrame();
+#endif    
+    }
+    
+    
+void CHuiCanvasWsPainter::SetCommandSetL( const TDesC8& aCommands )
+    {
+	CHuiCanvasPainter::SetCommandSetL(aCommands);  
+
+    TInt latest = iCommandBuffers.Count() - 1;
+    DoPeekBufferL(latest);
+    SelectGcL();
+       
+    // If shape region has changed recalculate all update regions and remove redundant buffers
+    if (iShapeRegionClippingPending)
+        {
+        TInt bufferCount = iCommandBuffers.Count();
+        for (TInt cb = 0; cb < bufferCount; cb++)
+            {        
+            CHuiCanvasCommandBuffer* cmdbuffer = iCommandBuffers[cb];
+            cmdbuffer->iUpdateRegion.Copy(cmdbuffer->iOriginalUpdateRegion);                
+            cmdbuffer->iUpdateRegion.Intersect(iShapeRegion);
+            cmdbuffer->iUpdateRegion.Tidy();
+            }
+        iShapeRegionClippingPending = EFalse;       
+        RemoveRedundantBuffers();   
+        }    
+    
+	// Release currently cached images. 
+    // They may still be taken into use after next HandleBuffferL call.
+    if (iCanvasVisual)
+        {
+        iCanvasVisual->Env().CanvasTextureCache().ReleaseAllCachedEntries(*iCanvasVisual);         
+        }    
+    }
+    
+
+void CHuiCanvasWsPainter::ClearCommandSet()
+    {
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        RDebug::Print(_L(">> CHuiCanvasWsPainter::ClearCommandSet this = %i"), this );
+        TTime startTime;
+        startTime.UniversalTime();
+#endif
+
+    CHuiCanvasPainter::ClearCommandSet();
+    // Release currently cached images. 
+    // They may still be taken into use after next HandleBuffferL call.
+    if (iCanvasVisual)
+        {
+        iCanvasVisual->Env().CanvasTextureCache().ReleaseAllCachedEntries(*iCanvasVisual); 
+        }
+
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        TTime endTime;
+        endTime.UniversalTime();
+        TInt timeInMs =  endTime.MicroSecondsFrom( startTime ).Int64()/1000;           
+        RDebug::Print(_L(">> CHuiCanvasWsPainter::ClearCommandSet took %i ms"), timeInMs);
+#endif
+    
+    }
+
+struct TArrayHeader
+    {
+    TInt32 iOffset;
+    TInt32 iSize;
+    };
+
+void CHuiCanvasWsPainter::AddCommandSetL( const TDesC8& aMoreCommands )
+    {    
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        RDebug::Print(_L(">> CHuiCanvasWsPainter::AddCommandSetL this = %i"), this );
+        TTime startTime;
+        startTime.UniversalTime();
+#endif
+
+    CHuiCanvasPainter::AddCommandSetL(aMoreCommands);
+    TInt latest = iCommandBuffers.Count() - 1;
+    DoPeekBufferL(latest);     
+    SelectGcL();
+    
+    // If shape region has changed recalculate all update regions
+    if (iShapeRegionClippingPending)
+        {
+        TInt bufferCount = iCommandBuffers.Count();
+        for (TInt cb = 0; cb < bufferCount; cb++)
+            {        
+            CHuiCanvasCommandBuffer* cmdbuffer = iCommandBuffers[cb];
+            cmdbuffer->iUpdateRegion.Copy(cmdbuffer->iOriginalUpdateRegion);                
+            cmdbuffer->iUpdateRegion.Intersect(iShapeRegion);
+            cmdbuffer->iUpdateRegion.Tidy();
+            }
+        iShapeRegionClippingPending = EFalse;       
+        }    
+    
+    RemoveRedundantBuffers();   
+    
+    // New command set may contain BitBlt commands
+    // and those cached images must be refreshed
+    if (iCanvasVisual)
+        {
+        // Release currently cached images. 
+        // They may still be taken into use after next HandleBufferL call.
+        iCanvasVisual->Env().CanvasTextureCache().ReleaseAllCachedEntries(*iCanvasVisual); 
+        }
+
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        TTime endTime;
+        endTime.UniversalTime();
+        TInt timeInMs =  endTime.MicroSecondsFrom( startTime ).Int64()/1000;           
+        RDebug::Print(_L(">> CHuiCanvasWsPainter::AddCommandSetL took %i ms"), timeInMs);
+#endif
+
+#ifdef HUI_ENABLE_SUBWINDOW_FX        
+    TInt count = NumBuffers();
+    if (!count) return;
+    const TDesC8 &more = At(count-1)->iCommands->Des();
+    //RDebug::Print(_L("MoreCommands: %x : %d"), aMoreCommands.Ptr(), aMoreCommands.Length());
+    TPtrC8 header = more.Mid(4, sizeof(TArrayHeader)); // the magic comes from CAlfRsSendBuffer::WriteFollowingFrameOffsetL.
+    TArrayHeader *ptr = (TArrayHeader*)header.Ptr();
+    //RDebug::Print(_L("Ptr: %d : %d"), ptr->iOffset, ptr->iSize);
+    TPtrC8 indexTable = more.Mid(ptr->iOffset, ptr->iSize);
+
+    if (iCanvasVisual->Brushes() && iCanvasVisual)
+        {
+        ParseCmdBufferL(*iCanvasVisual->Brushes(), more, indexTable, CanvasGc(), *CanvasWsGc(), *iCanvasVisual, *this);
+        }
+#endif
+    
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        TTime endTime2;
+        endTime2.UniversalTime();
+        TInt time2InMs =  endTime2.MicroSecondsFrom( startTime ).Int64()/1000;           
+        RDebug::Print(_L(">> CHuiCanvasWsPainter::AddCommandSetL including brush creation took %i ms"), time2InMs);
+#endif
+
+    }
+
+void CHuiCanvasWsPainter::AddPartialCommandSetL( const TDesC8& aMoreCommands, TBool aLastPart )
+    {
+    CHuiCanvasPainter::AddPartialCommandSetL(aMoreCommands,aLastPart); 
+    }
+
+#ifdef HUI_DEBUG_TRACK_DRAWING
+void CHuiCanvasWsPainter::SetTrackCommandSet( TFileName& aFileName, TBool aTrack )
+    {
+    CHuiCanvasPainter::SetTrackCommandSet( aFileName, aTrack );
+    }
+#endif
+
+void CHuiCanvasWsPainter::ClearCache()
+    {
+    if (iCanvasVisual && !iCacheCleared)
+        {
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        RDebug::Print(_L(">> CHuiCanvasWsPainter::ClearCache this = %i"), this );
+        TTime startTime;
+        startTime.UniversalTime();
+#endif
+        TRAP_IGNORE(SelectGcL());
+        RenewAllBuffers();         
+        SetAllBuffersChanged(ETrue);
+        iCanvasWsGc->ClearCache();
+        iCanvasVisual->Env().CanvasTextureCache().ReleaseAllCachedEntries(*iCanvasVisual); 
+        iCacheCleared = ETrue;
+        
+#ifdef HUI_DEBUG_PRINT_PERFORMANCE_INTERVAL
+        TTime endTime;
+        endTime.UniversalTime();
+        TInt timeInMs =  endTime.MicroSecondsFrom( startTime ).Int64()/1000;           
+        RDebug::Print(_L(">> CHuiCanvasWsPainter::ClearCache took %i ms"), timeInMs);
+#endif
+
+        }
+    }
+
+
+void CHuiCanvasWsPainter::WsBitBltL()
+    {
+    TPoint point(0,0);
+    TInt bitmapHandle = 0;
+    iWsCommandBufferReader->ReadPointL( point );
+    iWsCommandBufferReader->ReadBitmapHandleL( bitmapHandle );
+   	iCanvasWsGc->WsBitBltL(bitmapHandle,point);         
+    }
+    
+void CHuiCanvasWsPainter::WsBitBltRectL()
+    {
+    iWsCommandBufferReader->ReadL( (TUint8*)&iStructBitBlitRect, sizeof( TStructBitBlitRect ) );
+    iCanvasWsGc->WsBitBltRectL( 
+            iStructBitBlitRect.iBitmapHandle,
+            iStructBitBlitRect.iPoint,
+            iStructBitBlitRect.iRect);
+    }
+    
+void CHuiCanvasWsPainter::WsBitBltMaskedL()
+    {
+    iWsCommandBufferReader->ReadL( (TUint8*)&iStructBitBlitMasked, sizeof( TStructBitBlitMasked ) );
+	iCanvasWsGc->WsBitBltMaskedL( 
+	        iStructBitBlitMasked.iBitmapHandle,
+	        iStructBitBlitMasked.iMaskHandle,
+	        iStructBitBlitMasked.iInvertMask,
+	        iStructBitBlitMasked.iPoint,
+	        iStructBitBlitMasked.iRect);         
+    }
+
+
+void  CHuiCanvasWsPainter::WsCombinedBitBlitMaskedL()
+	{
+	TRect clipRect(0,0,0,0);
+	TRect blitRect(0,0,0,0);
+	TInt itemCount = iWsCommandBufferReader->ReadInt8L();
+	iWsCommandBufferReader->ReadL( (TUint8*)&clipRect, sizeof( TRect ) );
+	iWsCommandBufferReader->ReadL( (TUint8*)&blitRect, sizeof( TRect ) );
+	    
+	TInt index(0);
+	
+	RArray<THuiCachedCombinedImageParams> combinedBlitItems;
+	THuiCachedCombinedImageParams combinedBlitItem;
+	while( index++ < itemCount )
+		{
+		iWsCommandBufferReader->ReadL( (TUint8*)&combinedBlitItem, sizeof( THuiCachedCombinedImageParams ) );
+		combinedBlitItems.Append(combinedBlitItem);
+		}
+	// clipping rects were optimized away by renderstage. it must be set now.
+	// We use SetClippingRegion instead of SetClippingRect as they handle ws origin differently.
+	iTempRegion.Clear();
+    iTempRegion.AddRect(clipRect);
+    iCanvasWsGc->WsSetClippingRegionL(iTempRegion);  
+	iCanvasWsGc->WsCombinedBitBltMaskedL(blitRect, combinedBlitItems);
+    iCanvasWsGc->WsResetClippingRegionL();  
+	combinedBlitItems.Close();
+	}
+
+void CHuiCanvasWsPainter::WsBitBltMaskedPointL()
+    { 
+    TPoint point1(0,0);
+    TPoint point2(0,0);
+    TRect rect(0,0,0,0);
+    TInt bitmapHandle = 0;
+    TInt maskHandle = 0;
+    iWsCommandBufferReader->ReadPointL( point1 );
+    iWsCommandBufferReader->ReadBitmapHandleL( bitmapHandle );
+    iWsCommandBufferReader->ReadRectL( rect );
+    iWsCommandBufferReader->ReadBitmapHandleL( maskHandle );
+    iWsCommandBufferReader->ReadPointL( point2 );
+    iCanvasWsGc->WsBitBltMaskedPointL(bitmapHandle,maskHandle,point1,point2,rect);
+    }
+    
+void CHuiCanvasWsPainter::WsResetClippingRegionL()
+    {    
+    iCanvasWsGc->WsResetClippingRegionL();
+    }
+    
+void CHuiCanvasWsPainter::WsClearL()
+    {
+   	iCanvasWsGc->WsClearL();
+    }
+
+void CHuiCanvasWsPainter::WsClearRectL()
+    {
+    TRect tmpRect1(0,0,0,0);
+    iWsCommandBufferReader->ReadRectL( tmpRect1 );
+	iCanvasWsGc->WsClearRectL(tmpRect1);
+    }
+
+void CHuiCanvasWsPainter::WsResetBrushPatternL()
+    {
+            
+    }
+
+void CHuiCanvasWsPainter::WsResetFontL()
+    {    
+    iCanvasWsGc->WsResetFontL();
+    }
+
+void CHuiCanvasWsPainter::WsDrawArcL()
+    {
+    TPoint point1(0,0);
+    TPoint point2(0,0);
+    TRect rect(0,0,0,0);
+    iWsCommandBufferReader->ReadRectL( rect );
+    iWsCommandBufferReader->ReadPointL( point1 );
+    iWsCommandBufferReader->ReadPointL( point2 );
+   	iCanvasWsGc->WsDrawArcL(point1,point2,rect);   
+    }
+
+void CHuiCanvasWsPainter::WsDrawPieL()
+    {
+    TPoint point1(0,0);
+    TPoint point2(0,0);
+    TRect rect(0,0,0,0);
+    iWsCommandBufferReader->ReadRectL( rect );
+    iWsCommandBufferReader->ReadPointL( point1 );
+    iWsCommandBufferReader->ReadPointL( point2 );
+    iCanvasWsGc->WsDrawPieL(point1,point2,rect);
+    }
+
+void CHuiCanvasWsPainter::WsDrawBitmap1L()
+    {
+    TRect rect(0,0,0,0);
+    TInt bitmapHandle = 0;
+    iWsCommandBufferReader->ReadRectL( rect );
+    iWsCommandBufferReader->ReadBitmapHandleL( bitmapHandle );
+    iCanvasWsGc->WsDrawBitmap1L(bitmapHandle,rect);
+    }
+
+void CHuiCanvasWsPainter::WsDrawBitmap2L()
+    {
+    TRect rect1(0,0,0,0);
+    TRect rect2(0,0,0,0);
+    TInt bitmapHandle = 0;
+    iWsCommandBufferReader->ReadRectL( rect1);
+    iWsCommandBufferReader->ReadBitmapHandleL( bitmapHandle );
+    iWsCommandBufferReader->ReadRectL( rect2);
+    iCanvasWsGc->WsDrawBitmap2L(bitmapHandle,rect1,rect2);
+    }
+
+void CHuiCanvasWsPainter::WsDrawBitmap3L()
+    {
+    TPoint point(0,0);
+    TInt bitmapHandle = 0;
+    iWsCommandBufferReader->ReadPointL( point );
+    iWsCommandBufferReader->ReadBitmapHandleL( bitmapHandle );   
+	iCanvasWsGc->WsDrawBitmap3L(bitmapHandle,point);
+    }
+
+void CHuiCanvasWsPainter::WsDrawBitmapMaskedL()
+    {
+    iWsCommandBufferReader->ReadL( (TUint8*)&iStructDrawBitmapMasked, sizeof( TStructDrawBitmapMasked ) );
+    iCanvasWsGc->WsDrawBitmapMaskedL(
+            iStructDrawBitmapMasked.iBitmapHandle,
+            iStructDrawBitmapMasked.iMaskHandle,
+            iStructDrawBitmapMasked.iInvertMask,
+            iStructDrawBitmapMasked.iRect1,
+            iStructDrawBitmapMasked.iRect2);
+    }
+
+void CHuiCanvasWsPainter::WsDrawRoundRectL()
+    {
+    TPoint point(0,0);
+    TRect rect(0,0,0,0);        
+    iWsCommandBufferReader->ReadRectL( rect );
+    iWsCommandBufferReader->ReadPointL( point );    
+    iCanvasWsGc->WsDrawRoundRectL(point,rect);    
+    }
+
+void CHuiCanvasWsPainter::WsDrawPolyLineL()
+    {
+    CArrayFix<TPoint>* pointerArray = NULL;    
+    iWsCommandBufferReader->ReadPointArrayL( pointerArray );    
+    iCanvasWsGc->WsDrawPolyLineL(pointerArray);    
+    delete pointerArray;
+    }
+
+void CHuiCanvasWsPainter::WsDrawPolyLineNoEndPointL()
+    {
+    TPoint* pointerArray = NULL;
+    TInt count = 0;
+    iWsCommandBufferReader->ReadPointArrayL( pointerArray, count );
+    iCanvasWsGc->WsDrawPolyLineNoEndPointL(pointerArray,count);
+    pointerArray = NULL;
+    }
+
+void CHuiCanvasWsPainter::WsDrawPolygonL()
+    {
+    CArrayFix<TPoint>* pointerArray;
+    TInt fillRule = 0;
+    iWsCommandBufferReader->ReadPointArrayL( pointerArray );
+    iWsCommandBufferReader->ReadInt8L(); // command
+    iWsCommandBufferReader->ReadInt32L( fillRule ); 
+    iCanvasWsGc->WsDrawPolygonL(pointerArray,fillRule);    
+    delete pointerArray;
+    }
+
+void CHuiCanvasWsPainter::WsDrawEllipseL()
+    {
+    TRect rect(0,0,0,0);                        
+    iWsCommandBufferReader->ReadRectL( rect );    
+    iCanvasWsGc->WsDrawEllipseL(rect);    
+    }
+
+void CHuiCanvasWsPainter::WsDrawLineL()
+    {
+    TPoint start(0,0);
+    TPoint end(0,0);
+    iWsCommandBufferReader->ReadPointL( start );
+    iWsCommandBufferReader->ReadPointL( end );   
+    iCanvasWsGc->WsDrawLineL(start,end);    
+    }
+
+void CHuiCanvasWsPainter::WsDrawLineToL()
+    {
+    TPoint point(0,0);
+    iWsCommandBufferReader->ReadPointL( point );    
+    iCanvasWsGc->WsDrawLineToL(point);    
+    }
+
+void CHuiCanvasWsPainter::WsDrawLineByL()
+    {
+    TPoint point(0,0);
+    iWsCommandBufferReader->ReadPointL( point );    
+    iCanvasWsGc->WsDrawLineByL(point);    
+    }
+
+void CHuiCanvasWsPainter::WsDrawRectL()
+    {
+    TRect rect(0,0,0,0);                        
+    iWsCommandBufferReader->ReadRectL( rect );
+
+	// There is a bug that CScreen::DisplayMode() returns non-alpha display mode (TSW error: ??)
+	// That is why WServ clears the window with the color that is opaque (0xFF000400) instead of transparent (0x00000000) 
+	#ifdef __ALF_SYMBIAN_RWINDOW_CLEARING_BUG_WORKAROUND__
+//	RDebug::Print(_L("HV: CHuiCanvasWsPainter::WsDrawRectL(). iTestBrushColor.Internal()=%x, iTestFullDisplayRect=(%d %d %d %d), rect=(%d %d %d %d) "),
+//		iTestBrushColor.Internal(), iTestFullDisplayRect.iTl.iX, iTestFullDisplayRect.iTl.iY,iTestFullDisplayRect.iBr.iX, iTestFullDisplayRect.iBr.iY, 
+//		rect.iTl.iX, rect.iTl.iY,rect.iBr.iX, rect.iBr.iY);
+	if ( (rect ==  iTestFullDisplayRect) &&  	// Is full screen rect?
+	     (iTestBrushColor.Internal() == 0xff000400))  	// Last set color is opaque dark green?
+		{
+	//	RDebug::Print(_L("HV: CHuiCanvasWsPainter::WsDrawRectL(). Change brush color to 0x00000000. "));
+		iCanvasWsGc->WsSetBrushColorL(TRgb(0,0,0,0)); // Replace brush color with transparent black          	  	                            	
+		}
+	#endif
+    
+    iCanvasWsGc->WsDrawRectL(rect);    
+    }
+
+void CHuiCanvasWsPainter::WsDrawText1L()
+    {
+    TPtr textValue(0,0);
+    TBool success = iWsCommandBufferReader->ReadTextL( textValue, iTextParametersGeneral );
+    
+    if (textValue.Length() == 0 || !success )
+        {
+        return;   
+        }
+    
+    iCanvasWsGc->WsDrawText1L(textValue,iTextParametersGeneral);    
+    }
+    
+void CHuiCanvasWsPainter::WsDrawText2L()
+    {
+    TPoint point(0,0);
+    TPtr textValue(0,0);
+    TBool success = iWsCommandBufferReader->ReadTextL( textValue, iTextParametersGeneral );
+    iWsCommandBufferReader->ReadPointL( point );
+    
+    if (textValue.Length() == 0 ||!success)
+        {
+        return;   
+        }
+	
+    iCanvasWsGc->WsDrawText2L(textValue,point,iTextParametersGeneral);    
+    }
+
+void CHuiCanvasWsPainter::WsDrawText3L()
+    {
+    TRect rect(0,0,0,0);
+    TPtr textValue(0,0);
+    TBool success = iWsCommandBufferReader->ReadTextL( textValue, iTextParametersGeneral );
+    iWsCommandBufferReader->ReadRectL( rect );
+
+    if (textValue.Length() == 0 || !success )
+        {
+        return;   
+        }
+	
+    iCanvasWsGc->WsDrawText3L(textValue,rect,iTextParametersGeneral);    
+    }
+
+void CHuiCanvasWsPainter::WsDrawText4L()
+    {
+    TPtr textValue(0,0);
+    TBool success = iWsCommandBufferReader->ReadTextL( textValue, iTextParametersGeneral );
+    iWsCommandBufferReader->ReadL( (TUint8*)&iStructDrawTextGeneral, sizeof( TStructDrawTextGeneral ) - sizeof(TInt) );
+    
+    if (textValue.Length() == 0 || !success )
+            {
+            return;   
+            }
+
+    iCanvasWsGc->WsDrawText4L(textValue,
+            iStructDrawTextGeneral.iRect,
+            iStructDrawTextGeneral.iValue1,  // textBaselineOffset
+            iStructDrawTextGeneral.iValue2, // textAlign
+            iStructDrawTextGeneral.iValue3, // textMargin,
+            iTextParametersGeneral);    
+    }
+
+void CHuiCanvasWsPainter::WsDrawText5L()
+    {
+    TPtr textValue(0,0);
+    TBool success = iWsCommandBufferReader->ReadTextL( textValue, iTextParametersGeneral );
+    iWsCommandBufferReader->ReadL( (TUint8*)&iStructDrawTextGeneral, sizeof( TStructDrawTextGeneral ) );
+    
+    if (textValue.Length() == 0 || !success )
+        {
+        return;   
+        }
+
+	iCanvasWsGc->WsDrawText5L(textValue,
+	        iStructDrawTextGeneral.iRect,
+	        iStructDrawTextGeneral.iValue1,  // textBaselineOffset
+	        iStructDrawTextGeneral.iValue3, // textAlign
+	        iStructDrawTextGeneral.iValue4, // textMargin,
+	        iStructDrawTextGeneral.iValue2, // textWidth
+	        iTextParametersGeneral);    
+    }
+
+void CHuiCanvasWsPainter::WsDrawTextVertical1L()
+    {
+    TInt textUp = 0;
+    TPtr textValue(0,0);
+    TBool success = iWsCommandBufferReader->ReadTextL( textValue, iTextParametersGeneral );
+    iWsCommandBufferReader->ReadInt32L( textUp );  
+    
+    if (textValue.Length() == 0 || !success )
+        {
+        return;   
+        }
+
+	iCanvasWsGc->WsDrawTextVertical1L(textValue,textUp,iTextParametersGeneral);    
+    }
+
+void CHuiCanvasWsPainter::WsDrawTextVertical2L()
+    {
+    TPoint point(0,0);
+    TInt textUp = 0;
+    TPtr textValue(0,0);
+    TBool success = iWsCommandBufferReader->ReadTextL( textValue, iTextParametersGeneral );
+    iWsCommandBufferReader->ReadPointL( point );
+    iWsCommandBufferReader->ReadInt32L( textUp );  
+
+    if (textValue.Length() == 0 || !success )
+            {
+            return;   
+            }
+        
+	iCanvasWsGc->WsDrawTextVertical2L(textValue,textUp,point,iTextParametersGeneral);    
+    }
+
+
+void CHuiCanvasWsPainter::WsDrawTextVertical3L()
+    {
+    TRect rect(0,0,0,0);
+    TInt textUp = 0;
+    TPtr textValue(0,0);
+    TBool success = iWsCommandBufferReader->ReadTextL( textValue, iTextParametersGeneral);
+    iWsCommandBufferReader->ReadRectL( rect );
+    iWsCommandBufferReader->ReadInt32L( textUp ); 
+
+    if (textValue.Length() == 0 || !success )
+            {
+            return;   
+            }
+    
+    iCanvasWsGc->WsDrawTextVertical3L(textValue,textUp,rect,iTextParametersGeneral);    
+    }
+
+void CHuiCanvasWsPainter::WsDrawTextVertical4L()
+    {
+    TRect rect(0,0,0,0);
+    TInt textBaselineOffset = 0;
+    TInt textUp = 0;
+    TInt textAlign = 0;
+    TInt textMargin = 0;
+    TPtr textValue(0,0);
+    
+    TBool success = iWsCommandBufferReader->ReadTextL( textValue, iTextParametersGeneral );
+    iWsCommandBufferReader->ReadRectL( rect );
+    iWsCommandBufferReader->ReadInt32L( textBaselineOffset );
+    iWsCommandBufferReader->ReadInt32L( textUp );
+    iWsCommandBufferReader->ReadInt32L( textAlign );
+    iWsCommandBufferReader->ReadInt32L( textMargin );
+
+    if (textValue.Length() == 0 || !success )
+            {
+            return;   
+            }
+
+    iCanvasWsGc->WsDrawTextVertical4L(textValue,rect,textBaselineOffset,textUp,textAlign,textMargin,iTextParametersGeneral);    
+    }
+
+void CHuiCanvasWsPainter::WsDrawTextVertical5L()
+    {
+    TRect rect(0,0,0,0);
+    TInt textBaselineOffset = 0;
+    TInt textWidth = 0;
+    TInt textUp = 0;
+    TInt textAlign = 0;
+    TInt textMargin = 0;
+    TPtr textValue(0,0);
+    
+    iWsCommandBufferReader->ReadTextL( textValue, iTextParametersGeneral );
+    iWsCommandBufferReader->ReadRectL( rect );
+    iWsCommandBufferReader->ReadInt32L( textBaselineOffset );
+    iWsCommandBufferReader->ReadInt32L( textWidth );
+    iWsCommandBufferReader->ReadInt32L( textUp );
+    iWsCommandBufferReader->ReadInt32L( textAlign );
+    iWsCommandBufferReader->ReadInt32L( textMargin );
+
+    if (textValue.Length() == 0)
+            {
+            return;   
+            }
+
+    iCanvasWsGc->WsDrawTextVertical5L(textValue,rect,textBaselineOffset,textUp,textAlign,textMargin,textWidth,iTextParametersGeneral);    
+    }
+
+void CHuiCanvasWsPainter::WsMoveToL()
+    {
+    TPoint point(0,0);        
+    iWsCommandBufferReader->ReadPointL( point );
+    iCanvasWsGc->WsMoveToL(point);
+    }
+
+void CHuiCanvasWsPainter::WsMoveByL()
+    {
+    TPoint point(0,0);        
+    iWsCommandBufferReader->ReadPointL( point );    
+    iCanvasWsGc->WsMoveByL(point);
+    }
+
+void CHuiCanvasWsPainter::WsPlotL()
+    {
+    TPoint point(0,0);        
+    iWsCommandBufferReader->ReadPointL( point );    
+    iCanvasWsGc->WsPlotL(point);               	  	                        
+    }
+
+void CHuiCanvasWsPainter::WsResetL()
+    {
+    iCanvasWsGc->WsResetL();               	  	                            
+
+	#ifdef __ALF_SYMBIAN_RWINDOW_CLEARING_BUG_WORKAROUND__
+	iTestBrushColor.SetInternal(0);
+	#endif	
+    }
+
+void CHuiCanvasWsPainter::WsSetBrushColorL()
+    {
+    TRgb color = 0;        
+    iWsCommandBufferReader->ReadColorL( color );
+	iCanvasWsGc->WsSetBrushColorL(color);           	  	                            
+
+	#ifdef __ALF_SYMBIAN_RWINDOW_CLEARING_BUG_WORKAROUND__
+	iTestBrushColor = color;    	  	                            	
+	#endif
+    }
+
+void CHuiCanvasWsPainter::WsSetBrushOriginL()
+    {
+    TPoint point(0,0);        
+    iWsCommandBufferReader->ReadPointL( point );
+	iCanvasWsGc->WsSetBrushOriginL(point);	
+    }
+
+void CHuiCanvasWsPainter::WsSetBrushStyleL()
+    {
+    TInt style = 0;
+    iWsCommandBufferReader->ReadInt32L( style );
+	iCanvasWsGc->WsSetBrushStyleL(style);        
+    }
+
+void CHuiCanvasWsPainter::WsSetClippingRegionL()
+    {
+    iTempRegion.Clear();
+    iWsCommandBufferReader->ReadRegionL( iTempRegion );
+    iCanvasWsGc->WsSetClippingRegionL(iTempRegion);
+    }
+
+void CHuiCanvasWsPainter::WsSetDrawModeL()
+    {
+    TInt drawMode = 0;    
+    iWsCommandBufferReader->ReadInt32L( drawMode );
+	iCanvasWsGc->WsSetDrawModeL(drawMode);
+    }
+
+void CHuiCanvasWsPainter::WsSetOriginL()
+    {
+    TPoint origin(0,0);        
+    iWsCommandBufferReader->ReadPointL(origin);
+   	iCanvasWsGc->WsSetOriginL(origin);
+    }
+
+void CHuiCanvasWsPainter::WsSetPenColorL()
+    {
+    TRgb color = 0;        
+    iWsCommandBufferReader->ReadColorL( color );
+	iCanvasWsGc->WsSetPenColorL(color);    
+    }
+
+void CHuiCanvasWsPainter::WsSetPenStyleL()
+    {
+    TInt style = 0;    
+    iWsCommandBufferReader->ReadInt32L( style );
+	iCanvasWsGc->WsSetPenStyleL(style);
+    }
+
+void CHuiCanvasWsPainter::WsSetPenSizeL()
+    {
+    TInt width = 0;    
+    TInt height = 0;    
+    iWsCommandBufferReader->ReadInt32L( width ); 
+    iWsCommandBufferReader->ReadInt32L( height ); 
+    iCanvasWsGc->WsSetPenSizeL(width,height);
+    //\todo: Separate pen width and height are not yet supported 	
+    }
+
+void CHuiCanvasWsPainter::WsSetTextShadowColorL()
+    {
+    TRgb color = 0;        
+    iWsCommandBufferReader->ReadColorL( color );
+    iCanvasWsGc->WsSetTextShadowColorL(color);
+    }
+
+void CHuiCanvasWsPainter::WsSetCharJustificationL()
+    {
+    TInt excessWidth = 0;
+    TInt numGaps = 0;
+    iWsCommandBufferReader->ReadInt32L( excessWidth );
+    iWsCommandBufferReader->ReadInt32L( numGaps ); // NumChars
+	iCanvasWsGc->WsSetCharJustificationL(excessWidth,numGaps);
+    }
+
+void CHuiCanvasWsPainter::WsSetWordJustificationL()
+    {
+    TInt excessWidth = 0;
+    TInt numGaps = 0;
+    iWsCommandBufferReader->ReadInt32L( excessWidth );
+    iWsCommandBufferReader->ReadInt32L( numGaps ); // NumChars
+	iCanvasWsGc->WsSetWordJustificationL(excessWidth,numGaps);        
+    }
+
+void CHuiCanvasWsPainter::WsSetUnderlineStyleL()
+    {
+    TInt value = 0;
+    iWsCommandBufferReader->ReadInt32L( value );
+    iCanvasWsGc->WsSetUnderlineStyleL(value);
+    }
+
+void CHuiCanvasWsPainter::WsSetStrikethroughStyleL()
+    {
+    TInt value = 0;
+    iWsCommandBufferReader->ReadInt32L( value );
+    // todo: is this magic 1000 safe offset?
+    iCanvasWsGc->WsSetUnderlineStyleL(value+1000);
+    }
+
+
+void CHuiCanvasWsPainter::WsSetBrushPatternL()
+    {
+    TInt value = 0;        
+    iWsCommandBufferReader->ReadInt32L( value );
+	iCanvasWsGc->WsSetBrushPatternL(value);
+    }
+
+void CHuiCanvasWsPainter::WsSetFontL()
+    {
+    TInt fontId = 0;
+    iWsCommandBufferReader->ReadInt32L( fontId );// Font type Uid
+    iCanvasWsGc->WsSetFontL(fontId);    
+    }
+
+void CHuiCanvasWsPainter::WsContentTagL()
+    {
+    TInt tag;
+    iWsCommandBufferReader->ReadInt32L( tag );
+    }
+
+void CHuiCanvasWsPainter::WsCopyRectL()
+    {
+    TPoint point(0,0);
+    TRect rect(0,0,0,0);
+    iWsCommandBufferReader->ReadPointL( point );
+    iWsCommandBufferReader->ReadRectL( rect );
+	iCanvasWsGc->WsCopyRectL(point,rect);
+    }
+
+void CHuiCanvasWsPainter::WsUpdateJustificationL()
+    {
+    TPtr textValue(0,0);
+    iWsCommandBufferReader->ReadTextL( textValue, iTextParametersGeneral );	
+	iCanvasWsGc->WsUpdateJustificationL(textValue);
+    }
+
+void CHuiCanvasWsPainter::WsUpdateJustificationVerticalL()
+    {
+    TPtr textValue(0,0);
+    TInt value = 0;
+
+    iWsCommandBufferReader->ReadTextL( textValue, iTextParametersGeneral );
+    iWsCommandBufferReader->ReadInt32L( value );
+	iCanvasWsGc->WsUpdateJustificationVerticalL(value,textValue);
+   }
+
+void CHuiCanvasWsPainter::WsSetFontNoDuplicateL()
+    {
+    TInt tempFont = 0;
+    iWsCommandBufferReader->ReadInt32L( tempFont );
+	iCanvasWsGc->WsSetFontNoDuplicateL(tempFont);	    
+    }
+
+
+void CHuiCanvasWsPainter::WsCopySettingsL()
+    {
+    iCanvasWsGc->WsCopySettingsL();	
+    }
+
+void CHuiCanvasWsPainter::WsSetClippingRectL()
+    {
+    TRect rect(0,0,0,0);
+    iWsCommandBufferReader->ReadRectL( rect );
+	iCanvasWsGc->WsSetClippingRectL(rect);	                        
+    }
+
+void CHuiCanvasWsPainter::WsCancelClippingRectL()
+    {
+    iCanvasWsGc->WsCancelClippingRectL();
+    }
+
+void CHuiCanvasWsPainter::WsSetFadedL()
+    {
+    TInt faded = 0;
+    iWsCommandBufferReader->ReadInt32L( faded );
+	iCanvasWsGc->WsSetFadedL(faded);	                        
+    }
+
+void CHuiCanvasWsPainter::WsSetFadingParametersL()
+    {
+    TInt blackMap = 0;        
+    TInt whiteMap = 0;        
+    iWsCommandBufferReader->ReadInt32L( blackMap );
+    iWsCommandBufferReader->ReadInt32L( whiteMap );
+	iCanvasWsGc->WsSetFadingParametersL(blackMap,whiteMap);	                        
+    }
+
+void CHuiCanvasWsPainter::WsFadeAreaL()
+    {
+    iTempRegion.Clear();
+    iWsCommandBufferReader->ReadRegionL( iTempRegion );    
+	iCanvasWsGc->WsFadeAreaL(iTempRegion);	                        
+    }
+
+void CHuiCanvasWsPainter::WsMapColorsL()
+    {
+    iCanvasWsGc->WsMapColorsL();	                        
+    }
+
+void CHuiCanvasWsPainter::WsSetUserDisplayModeL()
+    {
+    TInt mode = 0;
+    iWsCommandBufferReader->ReadInt32L( mode );
+	iCanvasWsGc->WsSetUserDisplayModeL(mode);	                        
+        
+    }
+
+void CHuiCanvasWsPainter::WsUseFontL()
+    {
+	TInt tempFont = 0;
+    iWsCommandBufferReader->ReadInt32L( tempFont );
+    iCanvasWsGc->WsUseFontL(tempFont);	                                
+    }       
+
+void CHuiCanvasWsPainter::WsSetUpdateRegionL(TInt aIndex)
+    {
+    iTempRegion.Clear();                
+    iWsCommandBufferReader->ReadRegionL( iTempRegion );
+    if (aIndex==-1) return; //TP
+    // Update region is modified when new buffers are added after this buffer, 
+    // so store the region only at first read. 
+    if (iCommandBuffers[aIndex]->iChanged && iCommandBuffers[aIndex]->iUpdateRegion.Count() == 0)
+        {
+        // Check first that the coordiates are not insane (sometimes thay are)
+        TInt count = iTempRegion.Count();                    
+        TRect displayRect = iCanvasVisual->DisplayRect();
+        for (TInt i=count-1; i>=0; i--)
+            {
+            TRect rect = iTempRegion[i];
+            TRect screen = iCanvasVisual->Display()->VisibleArea();
+            if (rect.Intersects(screen) || rect == screen)
+                {
+                // - Sometimes updateregion is outiside window (WSERV...why?!) 
+                //   We clip it here to avoid ui probs.
+				// - Lets remove this for now, this seems to break scrollbars again
+				//   when window parent-child relations work..
+				// - Hmm, should we add this anyway because now the idle softkeys are lost again in landscape mode ?
+				// - Added again after WSERV fix in the window parent-child relations
+#ifndef HUI_DISABLE_CANVAS_VISUAL_CLIPPING
+                rect.Intersection(displayRect); 
+#endif                
+                iCommandBuffers[aIndex]->iUpdateRegion.AddRect(rect);    
+                iCommandBuffers[aIndex]->iOriginalUpdateRegion.AddRect(rect);    
+                }
+            else
+                {
+#ifdef _DEBUG
+                RDebug::Print(_L("CHuiCanvasWsPainter::WsSetUpdateRegionL: Incorrect update region removed from buffer, this should not happen !"));
+#endif
+                }
+            }                
+        
+        // Combine areas that are next to each others
+        iCommandBuffers[aIndex]->iUpdateRegion.Tidy();                    
+        iCommandBuffers[aIndex]->iOriginalUpdateRegion.Tidy();                    
+
+        // Subtract this buffers update area from previous buffers update areas to avoid overdraw
+
+ // TODO: Subtraction is for now commented out because it seems to cause UI problems, especially
+ //       with lists with scrollbar. Try e.g. opening image from filebrowser, then press back and
+ //       scrollbar area is often corrupted. This happens (probaply) because first command buffer contains
+ //       real background drawing under scrollbar, but partial command buffers do not contain it although 
+ //       their update region extends below scrollbar.
+ //       
+ //       This issue should be fixed because leaving subration undone causes performance to be worse.
+ //       
+        
+ /*
+        if (aIndex > 0)
+            {
+            for (TInt i=aIndex; i>0; i--)
+                {
+                TInt previous = aIndex - 1;
+                iCommandBuffers[previous]->iUpdateRegion.SubRegion(iCommandBuffers[aIndex]->iUpdateRegion);
+                iCommandBuffers[previous]->iUpdateRegion.Tidy();                            
+                }            
+            }
+*/            
+        }
+    }
+
+void CHuiCanvasWsPainter::WsSetShapeRegionL( TInt aIndex )
+    {
+    iTempRegion.Clear();                
+    iWsCommandBufferReader->ReadRegionL( iTempRegion );
+    
+	
+    // If there is a shape region, get it only from the newest buffer. 
+    // This is the case when the buffer has just been added to the canvas visual.
+    
+    if(aIndex == iCommandBuffers.Count() - 1)
+        {
+        // Note: The "set shape" command looks to be used only if it really is different from
+        // the window rect. So there is no need to check if the shape region is relevant. 
+        iShapeRegion.Copy(iTempRegion);
+
+        // note: iUpdateRegion will be updated later, set flags to indicate pending
+        iShapeRegionClearingPending = ETrue;
+        iShapeRegionClippingPending = ETrue;        
+       }
+    
+	
+    #ifdef _DEBUG
+    if (iShapeRegion.Count() == 0 && iTempRegion.Count() > 0)
+        {
+        HUI_DEBUG(_L("CHuiCanvasWsPainter::WsSetShapeRegionL. Error: iShapeRegion not set by any command buffer! However, there exists at least one command buffer that has shape region command."));
+         }
+    #endif
+    }
+
+void CHuiCanvasWsPainter::DoDigestPaddingL()
+    {
+    TUint8 padding = iWsCommandBufferReader->ReadInt8L();
+    while( padding-- )
+        {
+#ifdef _DEBUG
+        if ( iWsCommandBufferReader->ReadInt8L() != 0 )
+            {
+            RDebug::Print(_L("CHuiCanvasWsPainter::DigestPaddingL - Padding error"));
+            USER_INVARIANT();
+            }
+#else
+        iWsCommandBufferReader->ReadInt8L();
+#endif        
+        }
+    }
+
+void CHuiCanvasWsPainter::DestroyBuffer(TInt aIndex)
+    {
+    CHuiCanvasCommandBuffer* buffer = iCommandBuffers[aIndex];
+
+    TTime now;
+    now.UniversalTime();    
+    TInt lifetimeInMs =  now.MicroSecondsFrom( buffer->iCreationTime ).Int64()/1000;                               
+    if (lifetimeInMs > 0 && lifetimeInMs < KHuiCanvasDisableRenderBufferHandleInterval)
+        {
+        /* Check and disable render buffer if needed */
+        if (iCommandBuffers.Count() == 2)
+            {
+            EnableRenderBufferIfNeeded(EFalse);
+            }
+        }
+    
+    iCommandBuffers.Remove(aIndex);
+    delete buffer;
+    }
+
+
+TBool CHuiCanvasWsPainter::RemoveRedundantBuffers()
+    {
+    TBool didRemoveBuffers = EFalse;
+    TInt originalBufferCount = iCommandBuffers.Count();
+    
+    RemoveBuffersWithoutRealDrawing();
+    RemoveBuffersWithOldDisplayRect();
+    RemoveBuffersWithEmptyUpdateRegion();
+    RemoveBuffersWithOverlappingUpdateRegion();         
+    
+    didRemoveBuffers = (originalBufferCount != iCommandBuffers.Count());    
+    return didRemoveBuffers;
+    }
+
+void CHuiCanvasWsPainter::RemoveBuffersWithoutRealDrawing()
+    {
+    TInt bufferCount = iCommandBuffers.Count();
+    for (TInt cb = bufferCount - 1; cb >= 0; cb--)
+        {
+        CHuiCanvasCommandBuffer* buffer = iCommandBuffers[cb];
+        TInt flags = buffer->iStatusFlags;
+        if ((flags & EHuiCanvasBufferStatusScanned) && !(flags & EHuiCanvasBufferContainsDrawing))
+            {
+            DestroyBuffer(cb);
+            }
+        }        
+    }
+
+
+void CHuiCanvasWsPainter::RemoveBuffersWithOldDisplayRect() 
+    {
+    TInt bufferCount = iCommandBuffers.Count();
+    for (TInt cb = bufferCount - 1; cb >= 0; cb--)
+        {
+        CHuiCanvasCommandBuffer* buffer = iCommandBuffers[cb];
+        if (buffer->iOriginalDisplayRect.Round() != iCanvasVisual->DisplayRect().Round())
+            {
+            DestroyBuffer(cb);
+            }
+        }    
+    }
+
+void CHuiCanvasWsPainter::RemoveBuffersWithEmptyUpdateRegion() 
+    {
+    TInt bufferCount = iCommandBuffers.Count();
+    for (TInt cb = bufferCount - 1; cb >= 0; cb--)
+        {
+        CHuiCanvasCommandBuffer* buffer = iCommandBuffers[cb];
+        if (buffer->iOriginalUpdateRegion.Count() == 0)
+            {        
+            DestroyBuffer(cb);
+            }
+        }    
+    }
+
+void CHuiCanvasWsPainter::RemoveBuffersWithOverlappingUpdateRegion() 
+    {
+    // Check possibly overlapping update regions
+    TBool arraysChanged = ETrue;  
+    while (arraysChanged)
+        {
+        arraysChanged = EFalse;
+        iTempRegion.Clear();
+        
+        // Loop all buffers                
+        TInt bufferCount = iCommandBuffers.Count();        
+        for (TInt cb = bufferCount - 1; cb >= 0; cb--)
+            {            
+            if (arraysChanged)
+                {
+                break;    
+                }
+            
+            CHuiCanvasCommandBuffer* cmdbuffer = iCommandBuffers[cb];
+            for (TInt j=0; j < cmdbuffer->iOriginalUpdateRegion.Count();j++)
+                {
+                iTempRegion.AddRect(cmdbuffer->iOriginalUpdateRegion[j]);        
+                }
+                       
+            // Check older buffers for overlapping regions against current buffer
+            if (cb > 0)
+                {                   
+                for (TInt i = cb - 1; i >= 0; i--)
+                    {
+                    if (arraysChanged)
+                        {
+                        break;    
+                        }
+
+                    CHuiCanvasCommandBuffer* previousCommands = iCommandBuffers[i];            
+                    // Keep count how many subregions of the prevous command are contained inside current command buffer region
+                    TInt coveredRegionCount = 0;                    
+                    for (TInt k=0; k < previousCommands->iOriginalUpdateRegion.Count();k++)
+                        {
+                        iTempCurrentSubRegion.Clear();
+                        iTempIntersectingRegion.Clear();                                               
+                        iTempCurrentSubRegion.AddRect(previousCommands->iOriginalUpdateRegion[k]);                        
+                        iTempIntersectingRegion.Intersection(iTempRegion, iTempCurrentSubRegion);
+                        iTempIntersectingRegion.Tidy();
+                        
+                        if (iTempIntersectingRegion.Count() == 1)
+                            {
+                            if (iTempIntersectingRegion[0] == previousCommands->iOriginalUpdateRegion[k])
+                                {
+                                coveredRegionCount++;
+                                // If all regions were overlapping agains current buffer, we can delete this.
+                                if (coveredRegionCount == previousCommands->iOriginalUpdateRegion.Count())
+                                    {
+                                    DestroyBuffer(i);
+                                    arraysChanged = ETrue;
+                                    break;                                                                            
+                                    }
+                                }
+                            else
+                                {
+                                // There is no reason to continue with this one if even one of its subregions
+                                // is  outside overlapping region.
+                                break;                                    
+                                }
+                            }                        
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+CHuiCanvasGc& CHuiCanvasWsPainter::CanvasGc() const
+	{
+	return iCanvasWsGc->CanvasGc();
+	}
+
+TInt CHuiCanvasWsPainter::PaintedAreaCount() const
+    {
+    TInt paintedAreaCount = 0;
+    TInt bufferCount = iCommandBuffers.Count();
+    for (TInt cb = 0; cb < bufferCount; cb++)
+        {        
+        paintedAreaCount += iCommandBuffers[cb]->iUpdateRegion.Count();
+        }
+    return paintedAreaCount;
+    }
+    
+THuiCanvasPaintedArea CHuiCanvasWsPainter::PaintedArea(TInt aIndex)
+    {
+    THuiCanvasPaintedArea area;
+    area.iPaintType = EHuiCanvasPaintTypeOpaque;
+    area.iFlags = 0;    
+    
+    TInt firstIndexInCurrentBuffer = 0;
+    TInt lastIndexInCurrentBuffer = 0;
+    TInt indexCounter = 0;
+    
+    TInt bufferCount = iCommandBuffers.Count();
+    for (TInt cb = 0; cb < bufferCount; cb++)
+        {
+        TInt updateRegionCount = iCommandBuffers[cb]->iUpdateRegion.Count();
+        if (updateRegionCount)
+            {        
+            firstIndexInCurrentBuffer = indexCounter;
+            lastIndexInCurrentBuffer = firstIndexInCurrentBuffer + updateRegionCount - 1;
+            
+            if ((firstIndexInCurrentBuffer <= aIndex) && (aIndex <= lastIndexInCurrentBuffer))
+                {
+                TInt localIndex = aIndex - firstIndexInCurrentBuffer;
+                area.iPaintedRect = iCommandBuffers[cb]->iUpdateRegion[localIndex];
+                break;
+                }        
+            indexCounter += updateRegionCount;        
+            }
+       }   
+    return area;
+    }
+
+TInt CHuiCanvasWsPainter::SetCapturingBufferL(CFbsBitmap* aTarget)
+    {
+    TInt result = iCanvasWsGc->SetCapturingBufferL(aTarget);
+        
+    if ( !aTarget )
+        {
+        // We may have switched to another GC - so to ensure that 
+        // all are released, we will send this request to all.
+        CHuiCanvasWsGc* gcs[] = 
+            { 
+            iCanvasWsBitGc, 
+            iCanvasWsSwGc, 
+            iCanvasWsHwGc 
+            };
+        TInt count = sizeof(gcs) / sizeof(CHuiCanvasWsGc*);
+        for ( TInt i = count - 1; i >= 0; --i )
+            {
+            if ( gcs[i] && gcs[i] != iCanvasWsGc )
+                {
+                gcs[i]->SetCapturingBufferL(NULL);
+                }
+            }
+        }
+
+    return result;
+    }
+
+TRect CHuiCanvasWsPainter::DirtyRect() const
+    {
+    iTempRegion.Clear();                
+    TInt bufferCount = iCommandBuffers.Count();
+    for (TInt cb = 0; cb < bufferCount; cb++)
+        {        
+        const CHuiCanvasCommandBuffer& cmdbuffer = *iCommandBuffers[cb];
+        
+        // Report only changed buffers. This should be ok as long as
+        // this method is only used when scanning visual tree and
+        // thus visual (and buffer) changed flags are in correct states.
+        if (cmdbuffer.iChanged)
+            {
+            iTempRegion.Union(cmdbuffer.iUpdateRegion);
+            }
+        }
+    return iTempRegion.BoundingRect();
+    }
+
+TBool CHuiCanvasWsPainter::IsBufferCompletelyOutisideClippingRegion(const CHuiCanvasCommandBuffer& aCommandbuffer) const
+    {
+    CHuiGc* gc = iCanvasWsGc->CanvasGc().Gc();
+    if (gc && gc->ClipRegion().Count())
+        {
+        // This is a bit tricky part, gc clipregion is in transformed coordinates but our update region is not.
+        // So we must transform our update region before we can compare it to gc clipping region and
+        // know if it falls comletely outside it or not.        
+        iTempRegion.Clear();
+        for (TInt i=0; i<aCommandbuffer.iUpdateRegion.Count();i++)
+            {
+            THuiRealRect transformed = aCommandbuffer.iUpdateRegion[i];
+            gc->TransformDirtyRect(transformed);
+            iTempRegion.AddRect(transformed.Round());            
+            }
+        
+        CHuiCanvasGc::TClipRectVisibility visibility = iCanvasWsGc->CanvasGc().IsClipped(iTempRegion, gc->ClipRegion());
+        
+        if (visibility == CHuiCanvasGc::EFullyOutside)
+            {
+            return ETrue;
+            }
+        }
+
+    return EFalse;
+    }
+
+TInt CHuiCanvasWsPainter::EnableRenderBuffer(TBool aEnable)
+    {
+    if (aEnable != iCanvasWsGc->IsRenderBufferEnabled())
+        {
+        if (aEnable)
+            {
+            // Must redraw all buffers to render buffer at next frame
+            RenewAllBuffers();         
+            }        
+        return iCanvasWsGc->EnableRenderbuffer(aEnable);
+        }
+    else
+        {
+        return KErrNone;
+        }    
+    }
+
+void CHuiCanvasWsPainter::EnableRenderBufferIfNeeded(TBool aEnable)
+    {
+    if (!KHuiCanvasAutomaticRenderBufferUsage || !CHuiStatic::Renderer().Allows(EHuiRenderPluginAllowVisualPBufferSurfaces))
+        {
+        return;
+        }
+    
+    if (aEnable)
+        {
+        if (iAutomaticRenderBufferUsage && !iCanvasWsGc->IsRenderBufferEnabled() && HasOldCommandBuffers(KHuiCanvasEnableRenderBufferHandleInterval))
+            {
+            RDebug::Print(_L("CHuiCanvasWsPainter::EnableRenderBufferIfNeeded: Enabling renderbuffer"));
+            EnableRenderBuffer(ETrue);
+            iAutomaticRenderBufferUsage = ETrue;
+            }        
+        }
+    else
+        {
+        if (iCanvasWsGc->IsRenderBufferEnabled())
+            {
+            RDebug::Print(_L("CHuiCanvasWsPainter::EnableRenderBufferIfNeeded: Disabling renderbuffer"));
+            EnableRenderBuffer(EFalse);
+            iAutomaticRenderBufferUsage = ETrue;
+            }
+        }    
+    }
+
+void CHuiCanvasWsPainter::SelectGcL()
+    {
+    TBool hasUnsupportedCommands = EFalse;
+    TInt bufferCount = iCommandBuffers.Count();
+    for (TInt cb = 0; cb < bufferCount; cb++)
+        {        
+        const CHuiCanvasCommandBuffer& cmdbuffer = *iCommandBuffers[cb];
+        if (cmdbuffer.iContainsUnsupportedCommands)
+            {
+            hasUnsupportedCommands = ETrue;
+            break;
+            }
+        }
+        
+    THuiMemoryLevel memoryLevel;
+    if ( iCanvasVisual ) // in constructor, iCanvasVisual == NULL
+        {
+        memoryLevel = iCanvasVisual->Env().MemoryLevel();
+        }
+    else
+        {
+        memoryLevel = CHuiStatic::Env().MemoryLevel();
+        }
+
+    CHuiCanvasWsGc* oldGc = iCanvasWsGc;
+
+    if (memoryLevel <= EHuiMemoryLevelLowest)
+        {
+        if (!iCanvasWsGc || iCanvasWsGc != iCanvasWsBitGc)
+            {
+            // Fallback to the BIT GDI mode
+            if (!iCanvasWsBitGc)
+                {
+                iCanvasWsBitGc = CHuiCanvasWsBitGc::NewL();
+                }        
+            iCanvasWsGc = iCanvasWsBitGc;
+            // Must redraw all buffers to render buffer at next frame
+            RenewAllBuffers();             
+            }
+        }
+    else if (hasUnsupportedCommands && (!iCanvasWsGc || 
+             iCanvasWsGc != iCanvasWsSwGc))
+        {
+        // Fallback to the SW mode
+        if (!iCanvasWsSwGc)
+            {
+            iCanvasWsSwGc = CHuiCanvasWsSwGc::NewL();     
+            }        
+        iCanvasWsGc = iCanvasWsSwGc;
+        // Must redraw all buffers to render buffer at next frame
+        RenewAllBuffers();         
+        }
+    else if (!hasUnsupportedCommands && (!iCanvasWsGc || 
+             iCanvasWsGc != iCanvasWsHwGc))
+        {
+        // Return to the HW accelerated mode
+        if (!iCanvasWsHwGc)
+            {
+            iCanvasWsHwGc = CHuiCanvasWsHwGc::NewL();     
+            }                
+        iCanvasWsGc = iCanvasWsHwGc;
+        // Must redraw all buffers to render buffer at next frame
+        RenewAllBuffers();         
+        }
+    else
+        {
+        // We are good
+        }        
+        
+    // Clear caches of non-used GCs
+    if ( oldGc && oldGc != iCanvasWsGc )
+        {
+        oldGc->ClearCache();
+        }
+
+    #ifdef HUI_DEBUG_TRACK_DRAWING
+    CHuiCanvasWsGc* realGc = iCanvasWsGc;
+    iCanvasWsGc = CHuiCanvasDebugWsGc::NewL( realGc, *iCommandDebugger );
+    #endif
+    }
+
+void CHuiCanvasWsPainter::RenewAllBuffers()
+    {
+    ClearAllBufferStatusFlags(EHuiCanvasBufferStatusAll);
+    SetAllBufferStatusFlags(EHuiCanvasBufferStatusNew);                
+    
+    if (iCanvasVisual)
+        {
+        iCanvasVisual->SetChanged();
+        }    
+    }
+	
+void CHuiCanvasWsPainter::UpdateBufferUpdateRegions(TPoint aPos)
+	{
+	// iUpdateRegion is in screen coordinates. If visual moves position, iUpdateRegion 
+	// should be updated as well. Otherwise visual will encounter clipping.
+    for (TInt cb = 0; cb < iCommandBuffers.Count(); cb++)
+        {
+		if (iCommandBuffers[cb]->iPositionForUpdateRegion != aPos && !iCommandBuffers[cb]->iUpdateRegion.IsEmpty() )
+			{
+			TPoint deltaPos = aPos - iCommandBuffers[cb]->iPositionForUpdateRegion;
+			iCommandBuffers[cb]->iUpdateRegion.Offset(deltaPos);
+			iCommandBuffers[cb]->iPositionForUpdateRegion = aPos;
+			iCommandBuffers[cb]->ClearStatusFlags(EHuiCanvasBufferStatusAll);
+			iCommandBuffers[cb]->SetStatusFlags(EHuiCanvasBufferStatusNew);
+			}
+        }
+	}
+
+void CHuiCanvasWsPainter::SetMemoryLevel(THuiMemoryLevel /*aLevel*/)
+    {
+    TRAP_IGNORE(SelectGcL());
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huicanvaswsswgc.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1519 @@
+/*
+* 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:   Definition of CHuiCanvasWsSwGc.
+*
+*/
+
+
+
+#include "huicanvaswsswgc.h"
+#include "uiacceltk/HuiCanvasVisual.h"
+#include <graphics/wsgraphicscontext.h>
+#include <e32cmn.h>
+#include <AknLayoutFont.h>
+#include <gdi.h>
+
+
+
+CHuiCanvasWsSwGc* CHuiCanvasWsSwGc::NewL()
+	{
+	CHuiCanvasWsSwGc* self    = new ( ELeave ) CHuiCanvasWsSwGc;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+
+
+CHuiCanvasWsSwGc::CHuiCanvasWsSwGc()
+    {
+    
+    }
+
+void CHuiCanvasWsSwGc::ConstructL()
+	{
+    iCanvasGc = CHuiStatic::Renderer().CreateCanvasGcL();
+
+	// There is no need to do clipping at canvas gc so lets disable it
+	iCanvasGc->SetClippingMode(EHuiCanvasClipModeNone);
+	}
+
+CHuiCanvasWsSwGc::~CHuiCanvasWsSwGc()
+    {
+    iTempRegion.Close();
+    iWsClipRegion.Close();
+    iDefaultClipRegion.Close();
+    
+    delete iCanvasGc;
+    iCanvasGc = NULL;
+    
+    delete iBitBitmap;
+    iBitBitmap = NULL;
+    
+	delete iBitDevice;
+	iBitDevice = NULL;
+	
+	delete iBitGc;
+	iBitGc = NULL;
+	
+    delete iCapturingBitGc;
+    iCapturingBitGc = NULL;
+    
+    delete iCapturingBitBitmap;
+    iCapturingBitBitmap = NULL;
+    
+    delete iCapturingBitDevice;
+    iCapturingBitDevice = NULL;
+    }
+    
+void CHuiCanvasWsSwGc::WsBitBltL(TInt aBitmapHandle, TPoint aPoint)
+	{
+	iIsReallyDirty = ETrue;
+			
+	if (!IsRenderingEnabled())
+	    {
+	    return;
+	    }
+	
+    TPoint point = AdjustCoordinates(aPoint);	
+    // Draw            
+	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
+    CleanupStack::PushL(bitmap);
+    
+	TInt error = bitmap->Duplicate(aBitmapHandle);
+	if ( error == KErrNone  )
+	    {
+	    iBitGc->BitBlt(point,bitmap);
+	    }
+	    CleanupStack::PopAndDestroy();
+	}
+
+
+
+
+void CHuiCanvasWsSwGc::WsBitBltRectL(TInt aBitmapHandle, TPoint aPoint, TRect aRect)
+	{
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+	TPoint point = AdjustCoordinates(aPoint);	
+    // Draw            
+	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
+    CleanupStack::PushL(bitmap);
+    
+	TInt error = bitmap->Duplicate(aBitmapHandle);
+	
+	if ( error == KErrNone  )
+        {
+        iBitGc->BitBlt(point,bitmap,aRect);
+        }
+        CleanupStack::PopAndDestroy();
+
+	}
+
+
+
+void CHuiCanvasWsSwGc::WsBitBltMaskedL(TInt aBitmapHandle, TInt aMaskHandle, TInt aInvertMask, TPoint aPoint, TRect aRect)
+	{
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+	TPoint point = AdjustCoordinates(aPoint);	
+    // Draw            
+	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
+    CleanupStack::PushL(bitmap);
+    TInt error = bitmap->Duplicate(aBitmapHandle);
+	if (error == KErrNone)
+	    {
+	    CFbsBitmap* bitmapMask = new (ELeave) CFbsBitmap;
+	    CleanupStack::PushL(bitmapMask);
+	    error = bitmapMask->Duplicate(aMaskHandle);
+	    if (error == KErrNone)
+	        {
+	        iBitGc->BitBltMasked(point,bitmap,aRect,bitmapMask,aInvertMask);
+	        }
+	    CleanupStack::PopAndDestroy(2);
+	    }
+	else
+        {
+        CleanupStack::PopAndDestroy();
+        }
+	
+	}
+
+void CHuiCanvasWsSwGc::WsBitBltMaskedPointL(TInt aBitmapHandle, TInt aMaskHandle, TPoint aPoint1, TPoint aPoint2, TRect aRect)
+	{
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+	TPoint point1 = AdjustCoordinates(aPoint1);	
+
+     // Draw            
+	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
+    CleanupStack::PushL(bitmap);
+    TInt error = bitmap->Duplicate(aBitmapHandle);
+    if (error == KErrNone)
+        {
+        CFbsBitmap* bitmapMask = new (ELeave) CFbsBitmap;
+        CleanupStack::PushL(bitmapMask);
+        error = bitmapMask->Duplicate(aMaskHandle);
+        if (error == KErrNone)
+            {
+            if (aPoint2 != TPoint(0,0))
+                {
+                CFbsBitmap* movedMask = CreateMovedMaskL(*bitmapMask, aPoint2);
+                iBitGc->BitBltMasked(point1,bitmap,aRect, movedMask ,ETrue);    
+                delete movedMask;    
+                }
+            else
+                {
+                iBitGc->BitBltMasked(point1,bitmap,aRect, bitmapMask ,ETrue);            
+                }        
+            }
+        CleanupStack::PopAndDestroy(2);
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy();
+        }    
+	}
+
+void CHuiCanvasWsSwGc::WsCombinedBitBltMaskedL(TRect aDestinationRect, const RArray<THuiCachedCombinedImageParams>& aBlits)
+    {
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+    
+    TRect adjustedDestinationRect(aDestinationRect);
+           
+    for (TInt i=0; i<aBlits.Count(); i++)
+        {
+      	CFbsBitmap* bitmap = NULL;
+    	CFbsBitmap* bitmapMask = NULL;
+      	TPoint point = aBlits[i].iCombinedBitmapPoint;
+      	TPoint adjustedPoint =AdjustCoordinates(point);
+        
+        if (aBlits[i].iBitmapHandle)
+            {
+        	bitmap = new (ELeave) CFbsBitmap;
+            CleanupStack::PushL(bitmap);
+            bitmap->Duplicate(aBlits[i].iBitmapHandle);                                        
+            }
+        
+        if (aBlits[i].iMaskHandle)
+            {
+    	    bitmapMask = new (ELeave) CFbsBitmap;
+            CleanupStack::PushL(bitmapMask);
+            bitmapMask->Duplicate(aBlits[i].iMaskHandle);                
+            }        
+        
+        TRect sourceRect = TRect(TPoint(0,0), bitmap->SizeInPixels());
+        if (bitmapMask)
+            {
+            TBool invertMask = (bitmapMask->DisplayMode() == EGray256);                       
+            iBitGc->BitBltMasked(adjustedPoint, bitmap, sourceRect, bitmapMask, invertMask);                       
+            }
+        else
+            {
+            iBitGc->BitBlt(adjustedPoint, bitmap);                                           
+            }                                                    
+        
+        if (bitmapMask)
+            {
+            CleanupStack::PopAndDestroy(bitmapMask);    
+            bitmapMask = NULL;
+            }
+        
+        if (bitmap)
+            {
+            CleanupStack::PopAndDestroy(bitmap);                    
+            bitmap = NULL;
+            }        
+        }
+    }
+
+void CHuiCanvasWsSwGc::WsResetClippingRegionL()
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    // Reset clip region in our own region
+    iWsClipRegion.Clear();
+
+	// Reset clip region in iBitGc to default one
+    if (iDefaultClipRegion.Count())
+        {
+        iBitGc->SetClippingRegion(iDefaultClipRegion);
+        }
+    else
+        {
+        iBitGc->CancelClippingRegion();
+        }
+	}
+
+void CHuiCanvasWsSwGc::WsClearL()
+	{		
+	iIsReallyDirty = ETrue;
+	
+	if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+   	iBitGc->Clear();
+	}
+
+void CHuiCanvasWsSwGc::WsClearRectL(TRect& aRect)
+	{		
+	iIsReallyDirty = ETrue;
+	
+	if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    iBitGc->Clear(AdjustCoordinates(aRect));
+	}
+
+void CHuiCanvasWsSwGc::WsResetBrushPatternL()
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    iBitGc->DiscardBrushPattern();
+	}
+
+void CHuiCanvasWsSwGc::WsResetFontL()
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+    
+	iBitGc->DiscardFont();
+	}
+
+void CHuiCanvasWsSwGc::WsDrawArcL(TPoint aPoint1, TPoint aPoint2, TRect aRect)
+	{
+	iIsReallyDirty = ETrue;
+
+	if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+	TPoint point1 = AdjustCoordinates(aPoint1);
+	TPoint point2 = AdjustCoordinates(aPoint2);
+	TRect rect = AdjustCoordinates(aRect);
+	iBitGc->DrawArc(rect,point1,point2);
+	}
+
+void CHuiCanvasWsSwGc::WsDrawPieL(TPoint aPoint1, TPoint aPoint2, TRect aRect)
+	{
+	iIsReallyDirty = ETrue;
+
+	if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+	TPoint point1 = AdjustCoordinates(aPoint1);
+	TPoint point2 = AdjustCoordinates(aPoint2);
+	TRect rect = AdjustCoordinates( aRect );
+	iBitGc->DrawPie(rect,point1,point2);
+	}
+
+void CHuiCanvasWsSwGc::WsDrawBitmap1L(TInt aBitmapHandle, TRect aRect)
+	{
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+    // Draw            
+	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
+    CleanupStack::PushL(bitmap);
+    
+	TInt error = bitmap->Duplicate(aBitmapHandle);
+	if ( error == KErrNone )
+	    {
+	    iBitGc->DrawBitmap(AdjustCoordinates(aRect),bitmap);
+	    }
+	CleanupStack::PopAndDestroy();
+	}
+
+void CHuiCanvasWsSwGc::WsDrawBitmap2L(TInt aBitmapHandle, TRect aRect1, TRect aRect2)
+	{
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+     // Draw            
+	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
+    CleanupStack::PushL(bitmap);
+    
+	TInt error = bitmap->Duplicate(aBitmapHandle);
+	if ( error == KErrNone )
+	    {
+	    iBitGc->DrawBitmap(AdjustCoordinates(aRect1),bitmap,aRect2);
+	    }
+	CleanupStack::PopAndDestroy();   
+	}
+
+void CHuiCanvasWsSwGc::WsDrawBitmap3L(TInt aBitmapHandle, TPoint aPoint)
+	{
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+	TPoint point = AdjustCoordinates(aPoint);
+    // Draw            
+	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
+    CleanupStack::PushL(bitmap);
+    
+	TInt error = bitmap->Duplicate(aBitmapHandle);
+	if ( error == KErrNone )
+	    {
+	    iBitGc->DrawBitmap(point,bitmap);
+	    }
+	CleanupStack::PopAndDestroy();
+	}
+
+void CHuiCanvasWsSwGc::WsDrawBitmapMaskedL(TInt aBitmapHandle, TInt aMaskHandle, TInt aInvertMask, TRect& aRect1, TRect& aRect2)
+	{
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+    // Draw            
+	CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
+    CleanupStack::PushL(bitmap);
+    TInt error = bitmap->Duplicate(aBitmapHandle);
+    if ( error == KErrNone )
+        {
+        // Draw            
+        CFbsBitmap* bitmapMask = new (ELeave) CFbsBitmap;
+        CleanupStack::PushL(bitmapMask);
+        error = bitmapMask->Duplicate(aMaskHandle);
+        if ( error == KErrNone )
+            {
+            iBitGc->DrawBitmapMasked(AdjustCoordinates(aRect1),bitmap,aRect2,bitmapMask,aInvertMask);    
+            }
+        CleanupStack::PopAndDestroy(2);
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy();
+        }
+          
+	}
+
+void CHuiCanvasWsSwGc::WsDrawRoundRectL(TPoint aPoint, TRect& aRect)
+	{
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    iBitGc->DrawRoundRect(AdjustCoordinates(aRect),TSize(aPoint.iX,aPoint.iY));
+	}
+
+void CHuiCanvasWsSwGc::WsDrawPolyLineL(CArrayFix<TPoint>* aPointerArray)
+	{
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+	if(aPointerArray)
+		{
+		for(int i=0; i<aPointerArray->Count();i++)
+			{
+			aPointerArray->At(i) = AdjustCoordinates(aPointerArray->At(i));
+			}
+		iBitGc->DrawPolyLine(aPointerArray);
+		}
+	}
+
+void CHuiCanvasWsSwGc::WsDrawPolyLineNoEndPointL(TPoint* aPointerArray, TInt aCount)
+	{
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+	if ( aPointerArray )
+        {
+        for(int i=0; i<aCount;i++)
+			{
+			aPointerArray[i] = AdjustCoordinates(aPointerArray[i]);
+			}
+		iBitGc->DrawPolyLineNoEndPoint(aPointerArray,aCount);
+        } 
+    }
+
+void CHuiCanvasWsSwGc::WsDrawPolygonL(CArrayFix<TPoint>* aPointerArray, TInt aFillRule)
+	{
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+	if ( aPointerArray )
+        {
+        for(int i=0; i<aPointerArray->Count();i++)
+        	{
+        	aPointerArray->At(i) = AdjustCoordinates(aPointerArray->At(i));	
+        	}
+        iBitGc->DrawPolygon( aPointerArray,(CFbsBitGc ::TFillRule)aFillRule );	
+        }
+	}	
+
+void CHuiCanvasWsSwGc::WsDrawEllipseL(TRect& aRect)
+	{
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+    iBitGc->DrawEllipse(AdjustCoordinates(aRect));
+	}
+
+void CHuiCanvasWsSwGc::WsDrawLineL(TPoint& aStart, TPoint& aEnd)
+	{
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+	TPoint startPoint = AdjustCoordinates(aStart);
+	TPoint endPoint = AdjustCoordinates(aEnd);
+    iBitGc->DrawLine( startPoint,endPoint );
+	}
+
+void CHuiCanvasWsSwGc::WsDrawLineToL(TPoint& aPoint)
+	{
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+	TPoint point = AdjustCoordinates(aPoint);
+    iBitGc->DrawLineTo(point);
+	}
+
+void CHuiCanvasWsSwGc::WsDrawLineByL(TPoint& aPoint)
+	{
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+	TPoint point = AdjustCoordinates(aPoint);
+    iBitGc->DrawLineBy(point);
+	}
+
+void CHuiCanvasWsSwGc::WsDrawRectL(TRect& aRect)
+	{
+	iIsReallyDirty = ETrue;
+
+	if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    iBitGc->DrawRect(AdjustCoordinates(aRect));
+	}
+
+void CHuiCanvasWsSwGc::WsDrawText1L(TPtr& aTextValue, THuiCanvasTextParameters& aTextParameters)
+	{
+	if (iBitGc && !iBitGc->IsFontUsed())
+	    {
+	    return;    
+	    }
+
+	iIsReallyDirty = ETrue;
+	
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+#ifdef SYMBIAN_BUILD_GCE            
+    CGraphicsContext::TTextParameters gcTextParams = *(CGraphicsContext::TTextParameters*)&aTextParameters;
+	iBitGc->DrawText(aTextValue, &gcTextParams);
+#else			
+	iBitGc->DrawText(aTextValue);
+#endif            
+    }
+
+void CHuiCanvasWsSwGc::WsDrawText2L(TPtr& aTextValue, TPoint& aPoint,THuiCanvasTextParameters& aTextParameters)
+	{
+	if (iBitGc && !iBitGc->IsFontUsed())
+	    {
+	    return;    
+	    }
+
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+	TPoint point = AdjustCoordinates(aPoint);
+
+#ifdef SYMBIAN_BUILD_GCE            
+    CGraphicsContext::TTextParameters gcTextParams = *(CGraphicsContext::TTextParameters*)&aTextParameters;
+	iBitGc->DrawText(aTextValue, &gcTextParams, point);
+#else			
+    iBitGc->DrawText(aTextValue, point);
+#endif
+    }
+
+void CHuiCanvasWsSwGc::WsDrawText3L(TPtr& aTextValue, TRect& aRect, THuiCanvasTextParameters& aTextParameters)
+	{
+	if (iBitGc && !iBitGc->IsFontUsed())
+	    {
+	    return;    
+	    }
+	
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+#ifdef SYMBIAN_BUILD_GCE            
+    CGraphicsContext::TTextParameters gcTextParams = *(CGraphicsContext::TTextParameters*)&aTextParameters;
+	iBitGc->DrawText(aTextValue, &gcTextParams, AdjustCoordinates(aRect));
+#else			
+	iBitGc->DrawText(aTextValue, AdjustCoordinates(aRect));
+#endif
+    }
+
+
+void CHuiCanvasWsSwGc::WsDrawText4L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextAlign, TInt aTextMargin,THuiCanvasTextParameters& aTextParameters)
+	{
+	if (iBitGc && !iBitGc->IsFontUsed())
+	    {
+	    return;    
+	    }
+	
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+		
+#ifdef SYMBIAN_BUILD_GCE            
+    CGraphicsContext::TTextParameters gcTextParams = *(CGraphicsContext::TTextParameters*)&aTextParameters;
+	iBitGc->DrawText(aTextValue, &gcTextParams, AdjustCoordinates(aRect), aBaselineOffset,(CFbsBitGc::TTextAlign )aTextAlign,aTextMargin);
+#else			
+    iBitGc->DrawText(aTextValue, AdjustCoordinates(aRect), aBaselineOffset,(CFbsBitGc::TTextAlign )aTextAlign,aTextMargin);
+#endif
+    }
+
+void CHuiCanvasWsSwGc::WsDrawText5L( TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextAlign, TInt aTextMargin,TInt aTextWidth, THuiCanvasTextParameters& aTextParameters)
+	{
+	if (iBitGc && !iBitGc->IsFontUsed())
+	    {
+	    return;    
+	    }
+	
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+#ifdef SYMBIAN_BUILD_GCE            
+    CGraphicsContext::TTextParameters gcTextParams = *(CGraphicsContext::TTextParameters*)&aTextParameters;
+    iBitGc->DrawText(aTextValue, &gcTextParams, AdjustCoordinates(aRect), aBaselineOffset,aTextWidth,(CFbsBitGc::TTextAlign )aTextAlign,aTextMargin);
+#else
+    iBitGc->DrawText(aTextValue, AdjustCoordinates(aRect), aBaselineOffset,aTextWidth,(CFbsBitGc::TTextAlign )aTextAlign,aTextMargin);
+#endif
+    }
+	
+void CHuiCanvasWsSwGc::WsDrawTextVertical1L(TPtr& aTextValue, TInt aTextUp, THuiCanvasTextParameters& aTextParameters)	
+    {
+	if (iBitGc && !iBitGc->IsFontUsed())
+	    {
+	    return;    
+	    }
+    
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+#ifdef SYMBIAN_BUILD_GCE            
+    CGraphicsContext::TTextParameters gcTextParams = *(CGraphicsContext::TTextParameters*)&aTextParameters;
+    iBitGc->DrawTextVertical(aTextValue, &gcTextParams, aTextUp);
+#else
+    iBitGc->DrawTextVertical(aTextValue, aTextUp);
+#endif
+    }
+
+void CHuiCanvasWsSwGc::WsDrawTextVertical2L(TPtr& aTextValue, TInt aTextUp,TPoint& aPoint, THuiCanvasTextParameters& aTextParameters)	
+    {
+	if (iBitGc && !iBitGc->IsFontUsed())
+	    {
+	    return;    
+	    }
+    
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+    TPoint point = AdjustCoordinates(aPoint);	 	                                       	
+#ifdef SYMBIAN_BUILD_GCE            
+    CGraphicsContext::TTextParameters gcTextParams = *(CGraphicsContext::TTextParameters*)&aTextParameters;
+    iBitGc->DrawTextVertical(aTextValue, &gcTextParams, point,aTextUp);
+#else
+    iBitGc->DrawTextVertical(aTextValue,point,aTextUp);
+#endif
+    }
+
+void CHuiCanvasWsSwGc::WsDrawTextVertical3L(TPtr& aTextValue, TInt aTextUp, TRect& aRect, THuiCanvasTextParameters& aTextParameters)	
+    {
+	if (iBitGc && !iBitGc->IsFontUsed())
+	    {
+	    return;    
+	    }
+    
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+#ifdef SYMBIAN_BUILD_GCE            
+    CGraphicsContext::TTextParameters gcTextParams = *(CGraphicsContext::TTextParameters*)&aTextParameters;
+    iBitGc->DrawTextVertical(aTextValue, &gcTextParams, AdjustCoordinates(aRect),aTextUp);
+#else
+    iBitGc->DrawTextVertical(aTextValue,AdjustCoordinates(aRect),aTextUp);
+#endif
+    }
+
+void CHuiCanvasWsSwGc::WsDrawTextVertical4L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextUp, TInt aTextAlign, TInt aTextMargin,THuiCanvasTextParameters& aTextParameters)
+    {
+	if (iBitGc && !iBitGc->IsFontUsed())
+	    {
+	    return;    
+	    }
+    
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+#ifdef SYMBIAN_BUILD_GCE            
+    CGraphicsContext::TTextParameters gcTextParams = *(CGraphicsContext::TTextParameters*)&aTextParameters;
+    iBitGc->DrawTextVertical(aTextValue, &gcTextParams, AdjustCoordinates(aRect),aBaselineOffset,aTextUp,(CFbsBitGc::TTextAlign )aTextAlign,aTextMargin);
+#else
+    iBitGc->DrawTextVertical(aTextValue,AdjustCoordinates(aRect),aBaselineOffset,aTextUp,(CFbsBitGc::TTextAlign )aTextAlign,aTextMargin);
+#endif
+    }
+
+void CHuiCanvasWsSwGc::WsDrawTextVertical5L(TPtr& aTextValue, TRect& aRect, TInt aBaselineOffset, TInt aTextUp, TInt aTextAlign, TInt aTextMargin, TInt aTextWidth, THuiCanvasTextParameters& aTextParameters)
+    {
+	if (iBitGc && !iBitGc->IsFontUsed())
+	    {
+	    return;    
+	    }
+    
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+#ifdef SYMBIAN_BUILD_GCE            
+    CGraphicsContext::TTextParameters gcTextParams = *(CGraphicsContext::TTextParameters*)&aTextParameters;
+    iBitGc->DrawTextVertical(aTextValue, &gcTextParams, AdjustCoordinates(aRect),aBaselineOffset,aTextWidth,aTextUp,(CFbsBitGc::TTextAlign )aTextAlign,aTextMargin);
+#else
+    iBitGc->DrawTextVertical(aTextValue,AdjustCoordinates(aRect),aBaselineOffset,aTextWidth,aTextUp,(CFbsBitGc::TTextAlign )aTextAlign,aTextMargin);
+#endif
+    }
+
+void CHuiCanvasWsSwGc::WsMoveToL( TPoint& aPoint)
+    {
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    TPoint point = AdjustCoordinates(aPoint);
+    iBitGc->MoveTo(point);
+    }
+
+void CHuiCanvasWsSwGc::WsMoveByL( TPoint& aPoint)
+    {
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    TPoint point = AdjustCoordinates(aPoint);
+    iBitGc->MoveBy(point);
+    }
+    
+void CHuiCanvasWsSwGc::WsPlotL(TPoint& aPoint)
+	{
+	iIsReallyDirty = ETrue;
+
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+	TPoint point = AdjustCoordinates(aPoint);
+    // Draw  
+    iBitGc->Plot(point);
+	}
+
+void CHuiCanvasWsSwGc::WsResetL()
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    iWsClipRect = RoundedDisplayRect();            
+	iWsOrigin = TPoint(0,0);	
+	iBitGc->Reset();
+    WsResetClippingRegionL();   
+	}
+
+void CHuiCanvasWsSwGc::WsSetBrushColorL( TRgb aColor)
+    {
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    iBitGc->SetBrushColor(aColor);
+    }
+
+void CHuiCanvasWsSwGc::WsSetBrushOriginL( TPoint& aPoint)
+    {
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    TPoint point = AdjustCoordinates(aPoint);
+    iBitGc->SetBrushOrigin(point);
+    }
+
+void CHuiCanvasWsSwGc::WsSetBrushStyleL( TInt aStyle)
+    {
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    iBitGc->SetBrushStyle((CFbsBitGc::TBrushStyle)aStyle);
+    }
+
+void CHuiCanvasWsSwGc::WsSetClippingRegionL( RRegion& aRegion)
+    {        
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    // Store first
+    iWsClipRegion.Clear();    
+    for (TInt i=0;i<aRegion.Count();i++)
+        {
+        iWsClipRegion.AddRect(aRegion[i]);
+        }    
+
+    // Area is in screen coordinates so we must convert it 
+    iTempRegion.Clear();
+    for (TInt i=0; i < aRegion.Count(); i++)
+        {
+        iTempRegion.AddRect(AdjustCoordinates(aRegion[i]));   
+        }
+    
+    iTempRegion.Intersect(iDefaultClipRegion); // MNA: Koe
+    
+    iBitGc->SetClippingRegion(iTempRegion);
+    }
+    
+void CHuiCanvasWsSwGc::WsSetDrawModeL( TInt aDrawMode)
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    iBitGc->SetDrawMode((CFbsBitGc::TDrawMode)aDrawMode);
+	}
+
+void CHuiCanvasWsSwGc::WsSetOriginL( TPoint& aOrigin)
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+	iWsOrigin = aOrigin;
+ 	iBitGc->SetOrigin(aOrigin);
+	}
+
+void CHuiCanvasWsSwGc::WsSetPenColorL( TRgb aColor)
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    iBitGc->SetPenColor(aColor);
+	}
+
+void CHuiCanvasWsSwGc::WsSetPenStyleL( TInt aStyle)
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+	iBitGc->SetPenStyle((CFbsBitGc::TPenStyle)aStyle);
+	}
+
+void CHuiCanvasWsSwGc::WsSetPenSizeL( TInt aWidth, TInt aHeight)
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+	TSize lSize(aWidth,aHeight);
+	iBitGc->SetPenSize(lSize);
+	}
+
+void CHuiCanvasWsSwGc::WsSetTextShadowColorL( TRgb /*aColor*/)
+	{
+ 	// N/A
+	}
+
+void CHuiCanvasWsSwGc::WsSetCharJustificationL( TInt aExcessiveWidth, TInt aNumGap)
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+	iBitGc->SetCharJustification(aExcessiveWidth,aNumGap);
+	}
+
+void CHuiCanvasWsSwGc::WsSetWordJustificationL( TInt aExcessiveWidth, TInt aNumGap)
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    iBitGc->SetWordJustification(aExcessiveWidth,aNumGap);
+	}
+
+void CHuiCanvasWsSwGc::WsSetUnderlineStyleL( TInt aValue )
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+	
+	if (aValue < 1000) // magic, we recycle the same function for both underline and strike through
+	    {
+	    iBitGc->SetUnderlineStyle((TFontUnderline)aValue);	
+	    }
+	else
+	    {
+	    iBitGc->SetStrikethroughStyle((TFontStrikethrough)(aValue-1000));
+	    }
+	}
+
+void CHuiCanvasWsSwGc::WsSetBrushPatternL( TInt aValue)
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+	iBitGc->UseBrushPattern(aValue);
+	}
+
+void CHuiCanvasWsSwGc::WsSetFontL( TInt aFontId)
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+	iBitGc->UseFont(aFontId);
+	}
+
+void CHuiCanvasWsSwGc::WsCopyRectL( TPoint& aPoint, TRect& aRect)
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+	iBitGc->CopyRect(AdjustCoordinates(aPoint),AdjustCoordinates(aRect));
+	}
+
+void CHuiCanvasWsSwGc::WsUpdateJustificationL( TPtr& aTextValue)
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+	iBitGc->UpdateJustification(aTextValue);
+	}
+
+void CHuiCanvasWsSwGc::WsUpdateJustificationVerticalL( TInt aValue, TPtr& aTextValue )
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+	if(aValue)
+    	iBitGc->UpdateJustificationVertical(aTextValue,ETrue);
+	else
+		iBitGc->UpdateJustificationVertical(aTextValue,EFalse);
+	}
+
+void CHuiCanvasWsSwGc::WsSetFontNoDuplicateL( TInt aCurrentFont)
+	{
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+	iBitGc->UseFont(aCurrentFont);	
+	}
+
+void CHuiCanvasWsSwGc::WsCopySettingsL()
+	{
+    }
+
+void CHuiCanvasWsSwGc::WsSetClippingRectL( TRect& aRect)
+    {
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    // Symbian SetClippingRect takes ws origin into account, 
+    // but SetClippingRegion does not.
+ 	iWsClipRect = aRect;
+    iBitGc->SetClippingRect(AdjustCoordinates(aRect));                
+    return;
+    }
+
+void CHuiCanvasWsSwGc::WsCancelClippingRectL()
+    {
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    iWsClipRect = AdjustCoordinates(RoundedDisplayRect());        
+    iBitGc->CancelClippingRect();
+    }
+
+void CHuiCanvasWsSwGc::WsSetFadedL( TInt& aFaded)
+    {
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    iBitGc->SetFaded(aFaded);
+    }
+
+void CHuiCanvasWsSwGc::WsSetFadingParametersL( TInt aBlackMap, TInt aWhiteMap)
+    {
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    iBitGc->SetFadingParameters(aBlackMap, aWhiteMap);    
+	}
+
+void CHuiCanvasWsSwGc::WsFadeAreaL( RRegion& /*aRegion */)
+    {
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    return; // TODO: Fading does not work, somebody fix it please
+    
+/*    
+	iIsReallyDirty = ETrue;
+
+    // Area is in screen coordinates so we must convert it ?
+    RRegion adjustedRegion;
+
+    for (TInt i=0; i < aRegion.Count(); i++)
+        {
+        adjustedRegion.AddRect(AdjustCoordinates(aRegion[i]));   
+        }
+        
+   	iBitGc->FadeArea(&adjustedRegion);    
+    adjustedRegion.Close();    
+*/
+    }
+
+void CHuiCanvasWsSwGc::WsMapColorsL()
+    {
+    // N/A
+    }
+
+void CHuiCanvasWsSwGc::WsSetUserDisplayModeL( TInt /*aMode*/ )
+    {
+    // N/A
+    }
+
+void CHuiCanvasWsSwGc::WsUseFontL(TInt aCurrentFont)
+    {
+    if (!IsRenderingEnabled())
+        {
+        return;
+        }
+
+    iBitGc->UseFont(aCurrentFont);    
+    }       
+
+void CHuiCanvasWsSwGc::BeginActionL(TInt aAction, TRect /*aDisplayRect*/, const CHuiCanvasVisual& aUser, TBool aIsCachePrepared, const TRegion& aUpdateRegion)
+	{
+	iAction = aAction;
+	iVisual = &aUser;
+
+    if (!iVisual)
+        {
+        return;    
+        }        
+
+    // Update area is in screen coordinates so we must convert it 
+    iDefaultClipRegion.Clear();
+    for (TInt i=0; i < aUpdateRegion.Count(); i++)
+        {
+        iDefaultClipRegion.AddRect(AdjustCoordinates(aUpdateRegion[i]));   
+        }
+    
+    TSize size = RoundedDisplayRect().Size();	
+
+    TBool recreateBackbuffer = (!iBitGc || (iBitBitmap && iBitBitmap->SizeInPixels() != size));
+    
+    // If this is first draw or size has changed, re-create backbuffer
+	if (recreateBackbuffer)
+		{				    	
+        // Release old cached backbuffer image
+        iVisual->Env().CanvasTextureCache().ReleaseAllCachedEntries(*iVisual);		        
+
+        iBitmapInitialized = EFalse;
+		
+        if (!iBitBitmap)
+            {
+            iBitBitmap = new (ELeave) CFbsBitmap;
+            iBitBitmap->Create(size, SelectDisplayMode());  
+            }
+        else
+            {
+            iBitBitmap->Resize(size);    
+            }    
+	    
+        if (!iBitDevice)
+            {
+            iBitDevice = CFbsBitmapDevice::NewL(iBitBitmap);        
+            }
+        else
+            {
+            iBitDevice->Resize(size);    
+            }    
+
+	    delete iBitGc;
+	    iBitGc = NULL;
+	    User::LeaveIfError(iBitDevice->CreateContext(iBitGc));             
+        
+        TRgb clearColor = KRgbWhite;
+        clearColor.SetAlpha(0x00);
+        
+	    iBitGc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
+        iBitGc->SetPenColor(clearColor);
+        iBitGc->SetBrushColor(clearColor);
+        iBitGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
+  	    iBitGc->Clear();
+  	    iBitGc->Reset();    	  
+  	    
+  	    iIsReallyDirty = EFalse;
+		}
+	
+	if (iBitGc)
+	    {
+	    iBitGc->Reset();
+	    }
+	
+	iBitmapPrepared = aIsCachePrepared && iBitmapInitialized;
+	}
+
+// Note that for perfomance reasons we keep iBitBitmap alive in this method   
+void CHuiCanvasWsSwGc::EndActionL(const TRegion& /*aUpdateRegion*/, TBool aUpdateDisplay)
+	{
+    if (!iBitBitmap || !iVisual)
+        {
+        return;    
+        }        
+        
+    if ( iAction == EDrawBuffer )
+        {
+        iBitmapInitialized = ETrue;
+        iBitmapPrepared = ETrue;
+        }
+        
+    // If capturing is used, then copy content from bitmap.
+    // TODO: We could use capturing bitmap directly to get better performance if the window content changes a lot 
+    // TODO: Is this actually a bug ? We should not copy to iCapturingBitGc EVERYTIME !??!
+    if (iCapturingBitGc)
+        {
+        iCapturingBitGc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
+        iCapturingBitGc->BitBlt(TPoint(0,0), iBitBitmap);    
+        }
+
+    if (iAction == EDrawBuffer && aUpdateDisplay && iIsReallyDirty && RoundedDisplayRect().Size() != TSize(0,0))
+        {
+        // Texture cache creates new cached (hw accelerated) image from backbuffer bitmap if needed
+        // However, we must enable touch count check for the duration of cached image creation.
+        // In addition, we must perform CreateCachedImageL only after we have really updated bitmap,
+        // so we want touch count check to be used.
+        
+        THuiCachedImageParams cachedImageParams;
+        cachedImageParams.iBitmapHandle = iBitBitmap->Handle();
+         
+        TBool wasTouchCountEnabled = iVisual->Env().CanvasTextureCache().IsTouchCountCheckEnabled();
+        iVisual->Env().CanvasTextureCache().EnableTouchCountCheck(ETrue);
+        iVisual->Env().CanvasTextureCache().ReleaseAllCachedEntries(*iVisual);
+        
+        const CHuiCanvasGraphicImage* cachedImage = NULL;
+        TRAPD(err, cachedImage = iVisual->Env().CanvasTextureCache().CreateCachedImageL(cachedImageParams, *iVisual));
+        
+        iVisual->Env().CanvasTextureCache().EnableTouchCountCheck(wasTouchCountEnabled);
+        if (err)
+            {
+            User::Leave(err);
+            }
+
+        const CHuiTexture* texture = NULL;
+        if (cachedImage)
+            {
+            texture = cachedImage->Texture();
+            }
+        if (texture)
+            {
+            // Draw backbuffer to screen            
+            THuiRealRect destinationRect(iVisual->DisplayRect().iTl, texture->Size());                
+            CanvasGc().DrawImage(*texture, destinationRect);        
+            }
+        else
+            {
+    #ifdef _DEBUG
+            RDebug::Print(_L("CHuiCanvasWsSwGc::EndActionL: No cached image !"));
+    #endif
+            }
+        }
+	}
+
+CHuiCanvasGc& CHuiCanvasWsSwGc::CanvasGc() const
+	{
+	return *iCanvasGc;
+	}	  	
+    
+    
+TPoint CHuiCanvasWsSwGc::AdjustCoordinates(TPoint aPoint)
+	{
+	TPoint adjustment = RoundedDisplayRect().iTl;
+	TPoint lPoint(aPoint.iX-adjustment.iX + iPosDelta.iX,aPoint.iY-adjustment.iY + iPosDelta.iY );	
+	return lPoint;
+	}
+
+TRect CHuiCanvasWsSwGc::AdjustCoordinates(TRect aRect)
+	{
+	TRect rect = aRect;
+	TPoint adjustment = -RoundedDisplayRect().iTl;
+	    
+	rect.Move(adjustment.iX + iPosDelta.iX, adjustment.iY  + iPosDelta.iY);
+	return rect;
+	}
+	
+TDisplayMode CHuiCanvasWsSwGc::SelectDisplayMode()
+    {
+    TDisplayMode mode = EColor16MA;
+        
+    // Note 64K mode cannot be used until separate mask is supported. It might be
+    // possible to generate according to dirty region ?
+    
+    /*
+    // NOTE: EHuiRendererGles10 and EHuiRendererGles11 temporarely use EColor64K
+    // beacuse it looks as there are some problems with uploading 16MA 
+    // mode bitmaps into multisegmented textures.
+    //
+    if (CHuiStatic::Env().Renderer() == EHuiRendererBitgdi || 
+        CHuiStatic::Env().Renderer() == EHuiRendererGles10 || 
+        CHuiStatic::Env().Renderer() == EHuiRendererGles11)
+        {        
+        mode = EColor64K;           
+        }
+    */    
+    return mode;    
+    }
+	
+TInt CHuiCanvasWsSwGc::SetCapturingBufferL(CFbsBitmap* aTarget)
+    {
+    if (iCapturingBitBitmap)
+        {
+        delete iCapturingBitBitmap;
+        iCapturingBitBitmap = NULL;    
+        }
+    
+    if (iCapturingBitGc)
+        {
+        delete iCapturingBitGc;
+        iCapturingBitGc = NULL;    
+        }
+
+    if (iCapturingBitDevice)
+        {
+        delete iCapturingBitDevice;
+        iCapturingBitDevice = NULL;    
+        }
+
+    if (aTarget)
+        {
+        iCapturingBitBitmap = new (ELeave) CFbsBitmap;
+        iCapturingBitBitmap->Duplicate(aTarget->Handle());                        
+        }
+                   
+    if (iCapturingBitBitmap)
+        {
+	    iCapturingBitDevice = CFbsBitmapDevice::NewL(iCapturingBitBitmap);
+	    User::LeaveIfError(iCapturingBitDevice->CreateContext(iCapturingBitGc));                         
+        }    
+    
+    return KErrNone;
+    }
+
+TRect CHuiCanvasWsSwGc::RoundedDisplayRect() const
+    {
+    if (iVisual)
+        {
+        return iVisual->DisplayRect().Round();    
+        }
+    else
+        {
+        return TRect(0,0,0,0);    
+        }    
+        
+    }
+
+void CHuiCanvasWsSwGc::SetPositionDelta( TPoint& aPoint )
+    {
+    iPosDelta = aPoint;
+    }
+
+CFbsBitmap* CHuiCanvasWsSwGc::CreateMovedMaskL(CFbsBitmap& aOriginalMask, TPoint aNewTopLeftCorner)
+    {
+    TSize size = aOriginalMask.SizeInPixels();
+    
+    CFbsBitmap* newMask = new(ELeave)CFbsBitmap;                       
+    CleanupStack::PushL(newMask);
+            
+    newMask->Create(size, aOriginalMask.DisplayMode());       
+    
+    CFbsDevice* newMaskdevice = NULL;
+    CFbsBitGc* newMaskGc = NULL;
+
+    newMaskdevice = CFbsBitmapDevice::NewL(newMask);
+    CleanupStack::PushL(newMaskdevice);
+    User::LeaveIfError(newMaskdevice->CreateContext(newMaskGc));
+
+    newMaskGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
+    newMaskGc->SetPenStyle(CGraphicsContext::ESolidPen);
+    newMaskGc->SetPenColor(KRgbWhite);
+    newMaskGc->SetBrushColor(KRgbWhite);
+    newMaskGc->DrawRect(TRect(TPoint(0,0), size));
+    newMaskGc->BitBlt(TPoint(0,0), &aOriginalMask, TRect(aNewTopLeftCorner, size));
+    newMaskGc->BitBlt(aNewTopLeftCorner, &aOriginalMask, TRect(TPoint(0,0), size));
+    
+    delete newMaskGc;    
+    CleanupStack::PopAndDestroy(newMaskdevice);
+    CleanupStack::Pop(newMask);
+    
+    return newMask;
+    }
+
+void CHuiCanvasWsSwGc::ClearCache()
+    {
+    // Nothing to do..
+    }
+
+TBool CHuiCanvasWsSwGc::IsRenderBufferEnabled() const
+    {
+    return (iBitBitmap != NULL);
+    }
+
+TBool CHuiCanvasWsSwGc::IsRenderBufferPrepared() const
+    {
+    return (iBitBitmap != NULL) && iIsReallyDirty && 
+           (RoundedDisplayRect().Size() != TSize(0,0)) && iBitmapPrepared;       
+    }
+
+TBool CHuiCanvasWsSwGc::IsRenderBufferInitialized() const
+    {
+    // always initialized
+    return (iBitBitmap != NULL) && iBitmapInitialized;
+    }
+
+TInt CHuiCanvasWsSwGc::EnableRenderbuffer(TBool /*aEnable*/)
+    {
+    // Enabled by default
+    return KErrNone;
+    }
+
+THuiCanvasWsGcType CHuiCanvasWsSwGc::Type() const
+    {
+    return EHuiCanvasWsSw;
+    }
+
+
+void CHuiCanvasWsSwGc::EnableUpdateRegion(const TRegion& aUpdateRegion, TBool aClear)
+    {
+    // Area is in screen coordinates so we must convert it 
+    iDefaultClipRegion.Clear();
+    for (TInt i=0; i < aUpdateRegion.Count(); i++)
+        {
+        iDefaultClipRegion.AddRect(AdjustCoordinates(aUpdateRegion[i]));   
+        }
+
+    if (!iBitGc)
+        {
+        return;
+        }
+    
+    if (aClear)
+        {
+        if (iDefaultClipRegion.Count())
+            {
+            iBitGc->SetClippingRegion(iDefaultClipRegion);
+            }
+
+        TRgb clearColor = KRgbWhite;
+        clearColor.SetAlpha(0x0);
+        iBitGc->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
+        iBitGc->SetPenColor(clearColor);
+        iBitGc->SetBrushColor(clearColor);
+        iBitGc->SetBrushStyle(CGraphicsContext::ESolidBrush);        
+        iBitGc->Clear(); 
+        iBitGc->Reset();
+        }    
+
+    if (iDefaultClipRegion.Count())
+        {
+        iBitGc->SetClippingRegion(iDefaultClipRegion);
+        }
+    }
+
+void CHuiCanvasWsSwGc::DisableUpdateRegion()
+    {
+    if (iBitGc)
+        {
+        iBitGc->CancelClippingRegion();
+        }
+    }
+
+void CHuiCanvasWsSwGc::SetRelativeOrientation(CHuiGc::TOrientation /*aOrientation*/)
+    {
+    // Not supported yet
+    }
+
+TBool CHuiCanvasWsSwGc::IsRenderingEnabled() const
+    {
+    return iAction == EDrawBuffer;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huidisplaybackgrounditem.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Defines item in display background.
+*
+*/
+
+
+
+#include "uiacceltk/huidisplaybackgrounditem.h"  // Class definition
+#include "uiacceltk/HuiDisplay.h"  
+
+
+
+// Constructors
+EXPORT_C THuiDisplayBackgroundItem::THuiDisplayBackgroundItem()
+    :iRect(TRect(0,0,0,0)), 
+     iSkinID(KAknsIIDNone), 
+     iColorIndex(0), 
+     iColor(KRgbWhite), 
+     iClearMode(CHuiDisplay::EClearNone)
+    {                
+    }
+
+EXPORT_C THuiDisplayBackgroundItem::THuiDisplayBackgroundItem( const TRect& aRect ) 
+    :iRect(aRect), 
+     iSkinID(KAknsIIDNone), 
+     iColorIndex(0), 
+     iColor(KRgbWhite), 
+     iClearMode(CHuiDisplay::EClearNone)
+    {        
+    }
+
+EXPORT_C THuiDisplayBackgroundItem::THuiDisplayBackgroundItem( const TRect& aRect,
+                           const TAknsItemID& aSkinID )
+    :iRect(aRect),
+     iSkinID(aSkinID), 
+     iColorIndex(0), 
+     iColor(KRgbWhite), 
+     iClearMode(CHuiDisplay::EClearWithSkinBackground)
+    {
+    }
+
+EXPORT_C THuiDisplayBackgroundItem::THuiDisplayBackgroundItem( const TRect& aRect,
+                           const TAknsItemID& aSkinID,
+                           TInt aColorIndex )
+    :iRect(aRect),
+     iSkinID(aSkinID), 
+     iColorIndex(aColorIndex), 
+     iColor(KRgbWhite), 
+     iClearMode(CHuiDisplay::EClearWithColor)
+    {
+    }
+
+EXPORT_C THuiDisplayBackgroundItem::THuiDisplayBackgroundItem( const TRect& aRect,
+                           const TRgb& aColor )
+    :iRect(aRect),
+     iSkinID(KAknsIIDNone), 
+     iColorIndex(0), 
+     iColor(aColor), 
+     iClearMode(CHuiDisplay::EClearWithColor)
+    {        
+    }
+
+EXPORT_C void THuiDisplayBackgroundItem::SetRect( const TRect& aRect )
+    {
+    iRect = aRect;   
+    }
+
+EXPORT_C void THuiDisplayBackgroundItem::SetColor( const TRgb& aColor )
+    {
+    iColor = aColor;    
+    iClearMode = CHuiDisplay::EClearWithColor;
+    }
+    
+EXPORT_C void THuiDisplayBackgroundItem::SetColor( const TAknsItemID& aSkinID, TInt aColorIndex )
+    {
+    iSkinID = aSkinID;
+    iColorIndex = aColorIndex;      
+    iClearMode = CHuiDisplay::EClearWithColor;
+    }
+    
+EXPORT_C void THuiDisplayBackgroundItem::SetSkinBackground( const TAknsItemID& aSkinID )
+    {
+    iSkinID = aSkinID;
+    iClearMode = CHuiDisplay::EClearWithSkinBackground;    
+    }
+
+EXPORT_C TInt THuiDisplayBackgroundItem::ClearMode() const
+    {
+    return iClearMode;    
+    }
+
+EXPORT_C TRect THuiDisplayBackgroundItem::Rect() const
+    {
+    return iRect;    
+    }
+
+EXPORT_C TRgb THuiDisplayBackgroundItem::Color() const
+    {
+    // If skin color has been defined, return it. Otherwise use rgb color.
+    if (iSkinID != KAknsIIDNone)
+        {
+        TRgb skinnedColor = KRgbBlack;
+        CHuiStatic::GetCachedColor(skinnedColor, iSkinID, iColorIndex);            
+        return skinnedColor;
+        }
+    else
+        {
+        return iColor;            
+        }    
+    }
+
+EXPORT_C TAknsItemID THuiDisplayBackgroundItem::SkinBackground() const
+    {
+    return iSkinID;    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huidropshadow.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,333 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Drop shadow handler
+*
+*/
+
+
+
+#include "uiacceltk/huidropshadow.h"
+#include "uiacceltk/HuiUtil.h"
+#include "uiacceltk/HuiTextureProcessor.h"
+#include "uiacceltk/HuiTextureManager.h"
+#include "uiacceltk/HuiEnv.h"
+#include <AknsUtils.h>
+#include <e32math.h>
+
+// internal flags
+enum
+    {
+    EHuiDropShadowChanged           = 0x01,
+    EHuiDropShadowColorValid        = 0x02
+    };
+
+// ======== LOCAL FUNCTIONS ========
+
+NONSHARABLE_STRUCT( CHuiDropShadow::THuiDropShadowData )
+    {
+    THuiDropShadowData():
+        iColor(KRgbBlack), 
+        iColorSkinId(), 
+        iColorIndex(KErrNotFound), 
+        //iColorValid(EFalse),
+        //iChanged( EFalse )
+        iFlags(0)
+            {
+            }
+    
+    mutable TRgb iColor;
+    TAknsItemID iColorSkinId;
+    TInt iColorIndex;
+    //mutable TBool iColorValid;
+    //TBool iChanged;
+    TUint8 iFlags;
+    };
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+// Default constructor
+// ---------------------------------------------------------------------------
+//
+CHuiDropShadow::CHuiDropShadow() : 
+    iOpacity(0.6f), 
+    iOffset( 2.f, 2.f ),
+    iOffsetUnit( EHuiUnitPixel ), // magnitude is in iTimedOffset
+    iRadius( 1.5f ),
+    iScale( 1.f  )
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+void CHuiDropShadow::ConstructL()
+    {
+    iData = new (ELeave) THuiDropShadowData;
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// --------------------------------------------------------------------------
+//
+CHuiDropShadow::~CHuiDropShadow()
+    {
+    if ( iData )
+        {
+        }
+    delete iData;
+    }
+   
+// ---------------------------------------------------------------------------
+// Sets the shadow offset in polar coorsinates
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CHuiDropShadow::SetOffset( 
+    TReal32 aAngle, 
+    THuiMetric aDistance, 
+    TInt aTransitionTime ) __SOFTFP
+    {
+    if ( iOffsetUnit != aDistance.iUnit && aTransitionTime )
+        {
+        // @todo: convert current timed value into new unit
+        }
+    
+    // it is not that efficient to use floating point calculations here
+    // but this is not called often.
+    
+    TReal x;
+    Math::Cos( x, 2.0*KPi*aAngle/360.0 );
+    x*=aDistance.iMagnitude;
+    
+    
+    TReal y;
+    Math::Sin( y, 2.0*KPi*aAngle/360.0  );
+    y*=-1.0*aDistance.iMagnitude;
+    
+    iOffset.Set( THuiRealPoint(x,y), aTransitionTime );
+    iOffsetUnit = aDistance.iUnit;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets color in RGB
+// ---------------------------------------------------------------------------
+//        
+EXPORT_C void CHuiDropShadow::SetColor(
+    const TRgb& aColor, 
+    TInt /*aTransitionTime*/)
+    {
+    iData->iColor = aColor;
+    iData->iColorIndex = KErrNotFound;
+    iData->iFlags |= EHuiDropShadowChanged;
+    }
+
+// ---------------------------------------------------------------------------
+// Sets color in S60 skin
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CHuiDropShadow::SetColor(
+    const TAknsItemID& aID,
+    const TInt aIndex, 
+    TInt /*aTransitionTime*/)
+    {
+    iData->iColorSkinId = aID;
+    iData->iColorIndex = aIndex;
+    iData->iFlags &= ~EHuiDropShadowColorValid;
+    iData->iFlags |= EHuiDropShadowChanged;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns the current color RGB value
+// ---------------------------------------------------------------------------
+// 
+TRgb CHuiDropShadow::Color() const
+    {
+    if ( iData->iColorIndex != KErrNotFound && !(iData->iFlags&EHuiDropShadowColorValid) )
+        {
+        CHuiStatic::GetCachedColor(
+                iData->iColor, 
+                iData->iColorSkinId, 
+                iData->iColorIndex);
+    
+        iData->iFlags |= EHuiDropShadowColorValid; // What about skins change..
+        }
+    return iData->iColor;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns ETrue if the drops shadow parateters have changed.
+// ---------------------------------------------------------------------------
+//
+TBool CHuiDropShadow::Changed() const
+    {
+    if ( iData->iFlags&EHuiDropShadowChanged )
+        {
+        return ETrue;
+        }
+    return iOpacity.Changed() || iOffset.Changed() || iRadius.Changed() || iScale.Changed();
+    }
+
+// ---------------------------------------------------------------------------
+// Clears all changed flags
+// ---------------------------------------------------------------------------
+//
+void CHuiDropShadow::ClearChanged()
+    {
+    iData->iFlags &= ~EHuiDropShadowChanged;    
+    iOpacity.ClearChanged();
+    iOffset.ClearChanged();
+    iRadius.ClearChanged();
+    iScale.ClearChanged();
+    }
+
+// ---------------------------------------------------------------------------
+// Calculates the drawging size of the shadow.
+// ---------------------------------------------------------------------------
+//    
+THuiRealSize CHuiDropShadow::ShadowDrawingSize( 
+    const TSize& aImageDrawingSize, 
+    const TSize& aShadowTextureSize ) const
+    {
+    // Shadow texture is usually smaller than the image texture in which it is based on.
+    // Also, the content of the shadow texture is shrank by the blur dimension
+    // from all the sides.
+    
+    // round the blur dimension already because the blur filter does it as well.
+    const TInt blurDimension = HUI_ROUND_FLOAT_TO_INT( 2*iRadius.Now() );
+    
+    // the content area of the texture is smaller than the the texture area
+    THuiRealSize shadowContentSize = aShadowTextureSize;
+    shadowContentSize.iWidth -= 2.f*blurDimension;
+    shadowContentSize.iHeight -= 2.f*blurDimension;
+    
+    // check the relation between the shadow content area and the actial drawed image
+    // check possible divide-by-xero case
+    // The default value (1) is arbitrary. It only is there to allow prevention of divide_by_zero
+    TReal32 xMultiplier = 1;
+    if ( shadowContentSize.iWidth != 0 )
+        {
+        xMultiplier = ((TReal32)(aImageDrawingSize.iWidth)) / ((TReal32)(shadowContentSize.iWidth));
+        }
+     
+    TReal32 yMultiplier = 1;
+    if ( shadowContentSize.iHeight != 0 )
+        {
+        yMultiplier = ((TReal32)(aImageDrawingSize.iHeight)) / ((TReal32)(shadowContentSize.iHeight));
+        }
+    
+    // apply the multiplier to the shadow texture
+    THuiRealSize shadowDrawingSize = aShadowTextureSize;
+    shadowDrawingSize.iWidth *= xMultiplier;
+    shadowDrawingSize.iHeight *= yMultiplier;
+   
+    // apply the scale
+    shadowDrawingSize.iWidth *= iScale.Now();
+    shadowDrawingSize.iHeight *= iScale.Now();
+    
+    return shadowDrawingSize;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns ETrue if the shadow is visible
+// ---------------------------------------------------------------------------
+// 
+TBool CHuiDropShadow::IsShadowVisible() const
+    {
+    return !HuiUtil::RealCompare( iScale.Now(), 0.f ) &&
+           !HuiUtil::RealCompare( iOpacity.Now(), 0.f );
+    }
+
+// ---------------------------------------------------------------------------
+// Gets the CHuiTexture from the MHuiTexture is applicable
+// ---------------------------------------------------------------------------
+//     
+CHuiTexture* CHuiDropShadow::ShadowedTextureInstance( const MHuiTexture& aTextureIf )
+    {
+    CHuiTexture* resultTexture = NULL;
+    
+    const MHuiShadowedTexture* constShadowedTexture = aTextureIf.ShadowedTexture();
+    if ( constShadowedTexture )
+        {
+        MHuiShadowedTexture* nonConstshadowedTexture = const_cast<MHuiShadowedTexture*>(constShadowedTexture);
+        resultTexture = static_cast<CHuiTexture*>( nonConstshadowedTexture );
+        }
+    return resultTexture;
+    }
+
+// ---------------------------------------------------------------------------
+// Returns shadow distance in pixels
+// ---------------------------------------------------------------------------
+//     
+THuiRealPoint CHuiDropShadow::DistanceInPixels( const CHuiVisual& aReferenceVisual ) const
+    {
+    return aReferenceVisual.MetricToPixels( 
+        THuiXYMetric( 
+            THuiMetric( 
+                iOffset.iX.Now(), 
+                iOffsetUnit ), 
+            THuiMetric( 
+                iOffset.iY.Now(), 
+                iOffsetUnit ) 
+            ) 
+        );
+    }
+
+// ---------------------------------------------------------------------------
+// Returns shadow area
+// ---------------------------------------------------------------------------
+// 
+THuiRealRect CHuiDropShadow::ShadowDrawingRealRect( 
+        const TPoint& aImageDrawingPosition,
+        const TSize& aImageDrawingSize, 
+        const TSize& aShadowTextureSize,
+        const CHuiVisual& aReferenceVisual  ) const
+    {
+    const THuiRealSize shadowDrawingSize = ShadowDrawingSize( aImageDrawingSize, aShadowTextureSize );
+    THuiRealPoint shadowDrawingPos( aImageDrawingPosition );
+                        
+    const THuiRealPoint distanceInPixels = DistanceInPixels( aReferenceVisual );
+                
+    shadowDrawingPos.iX += distanceInPixels.iX;
+    shadowDrawingPos.iY += distanceInPixels.iY;
+                
+    shadowDrawingPos.iX -= (shadowDrawingSize.iWidth-aImageDrawingSize.iWidth )/2.f;
+    shadowDrawingPos.iY -= (shadowDrawingSize.iHeight-aImageDrawingSize.iHeight )/2.f;
+            
+    return THuiRealRect( shadowDrawingPos, shadowDrawingSize );
+    }
+
+// ---------------------------------------------------------------------------
+// Returns shadow area
+// ---------------------------------------------------------------------------
+//
+TRect CHuiDropShadow::ShadowDrawingTRect( 
+        const TPoint& aImageDrawingPosition,
+        const TSize& aImageDrawingSize, 
+        const TSize& aShadowTextureSize,
+        const CHuiVisual& aReferenceVisual  ) const
+    {
+    const THuiRealRect realRect = ShadowDrawingRealRect( 
+        aImageDrawingPosition, 
+        aImageDrawingSize, 
+        aShadowTextureSize, 
+        aReferenceVisual );
+        
+    return TRect( HUI_ROUND_FLOAT_TO_INT( realRect.iTl.iX ),
+                  HUI_ROUND_FLOAT_TO_INT( realRect.iTl.iY ),
+                  HUI_ROUND_FLOAT_TO_INT( realRect.iBr.iX ),
+                  HUI_ROUND_FLOAT_TO_INT( realRect.iBr.iY ) );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huieventhandler.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of MHuiEventHandler, an interface enabling 
+*                handling of scheduled events.
+*
+*/
+
+
+
+#include "uiacceltk/huieventhandler.h"  // Class definition
+#include "uiacceltk/HuiStatic.h"
+#include "uiacceltk/HuiEnv.h"
+
+
+EXPORT_C MHuiEventHandler::~MHuiEventHandler()
+    {
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huifixmath.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include <e32cmn.h>
+#include "uiacceltk/huifixmath.h"
+
+
+static const TInt KFixPi_2 = 0x1921F;
+static const TInt KSinMagic = 0x78000;
+
+#define FIX_PT_BITS 16
+#define SWAP(x, y) {(x)^=(y);(y)^=(x);(x)^=(y);}
+
+
+EXPORT_C TInt HuiFixMath::FixSin(TInt aRadians)
+	{
+    if (aRadians < (-KFixPi*2) || aRadians > (KFixPi*2))
+        {
+        aRadians%=KFixPi*2;
+        }
+    
+    if (aRadians < -KFixPi_2)
+        {
+        aRadians+=2*KFixPi;
+        }
+
+    // PI/2 - PI
+    if (aRadians > KFixPi_2 && aRadians < KFixPi)
+        {
+        aRadians = KFixPi-aRadians;
+        }
+    // PI-PI*3/4
+    else if (aRadians >=KFixPi && aRadians < (KFixPi+KFixPi_2))    
+        {
+        aRadians = -(aRadians-KFixPi);
+        }
+    // PI3*/4-2PI
+    else if (aRadians >=(KFixPi+KFixPi_2) && aRadians <=2*KFixPi)
+        {
+        aRadians-=KFixPi*2;
+        }
+    else
+        {
+        // for PC lint
+        }
+
+    TInt64 value = aRadians;
+    value = (value*value*value);
+    value = (value / KSinMagic)>>FIX_PT_BITS;
+    return FixMul(aRadians-value,0xF2E0);
+	}
+
+EXPORT_C TInt HuiFixMath::FixCos(TInt aRadians)
+	{
+	return FixSin(KFixPi_2-aRadians);
+	}
+	
+EXPORT_C TUint HuiFixMath::FixHypot(TInt aVal1,TInt aVal2)
+    {
+    TUint64 r;    
+    TUint p = Abs(aVal1);
+    TUint q = Abs(aVal2);
+    if (q == 0)
+        {
+        return p;
+        }
+    if (p<q)
+        {
+        SWAP(p,q)
+        }
+    for (;;)
+        {
+        r = ((TUint64(q))<<FIX_PT_BITS)/p;
+        r = (r*r) >> FIX_PT_BITS;
+        if (r == 0)
+            {
+            return p;
+            }
+        r = (r<<FIX_PT_BITS)/(0x40000+r);
+        p = p + 2*TUint(((r*p)>>FIX_PT_BITS));
+        q = (TUint((q*r))) >> FIX_PT_BITS;
+        }
+    } 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huifontmanager.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of THuiFontManager. Handles the management
+*                of Hitchcock UI Toolkit specific fonts. The implementation
+*                consists only of Symbian / S60 specific implementation but
+*                the interface is designed so that alternative platforms can be
+*                utilized.
+*
+*/
+
+
+
+#include <uiacceltk/huifontmanager.h>
+#include <uiacceltk/HuiEnv.h>
+#include <coemain.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Creates the THuiFontManager. Sets parameters to default values.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C THuiFontManager::THuiFontManager()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destroys the THuiFontManager. Makes sure all allocated resources are freed.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C THuiFontManager::~THuiFontManager()
+    {
+    // Close the array of fonts
+    iFonts.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// Returns font specifications of all platform-supported fonts.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void THuiFontManager::EnumerateFontsL(RArray<THuiFontSpecification>& aArray) const
+    {   
+    // Add all font specification objects into the output array.
+    CWsScreenDevice* screenDevice = CHuiStatic::ScreenDevice();
+    TInt numSystemFonts = screenDevice->NumTypefaces();    
+    for(TInt i = 0; i < numSystemFonts; ++i)
+        {
+    	THuiFontSpecification fontSpecification;
+    	TTypefaceSupport typefaceSupport;
+    	
+    	// Retrieve the typeface support information from the system
+    	screenDevice->TypefaceSupport(typefaceSupport, i);
+    	
+    	// Retrieve the typeface family name from typeface support
+    	fontSpecification.SetTypefaceFamily(typefaceSupport.iTypeface.iName.Des());
+    	
+    	// Append font specification to the array.
+        aArray.AppendL(fontSpecification);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Creates a new font instance.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt THuiFontManager::CreateFontL(const THuiFontSpecification& aSpecification)
+    {
+    // Include the specified font into the array of fonts.
+    iFonts.AppendL(aSpecification);
+    
+    // Return the unique ID of the font.
+    return iFonts.Count() - 1;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huifontspecification.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of THuiFontSpecification.
+*
+*/
+
+
+
+#include <uiacceltk/huifontspecification.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Creates the THuiFontSpecification. Sets the specification parameters to default values.
+// ---------------------------------------------------------------------------
+//
+THuiFontSpecification::THuiFontSpecification()
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// Destroys the THuiFontSpecification. Makes sure all allocated resources are freed.
+// ---------------------------------------------------------------------------
+//
+THuiFontSpecification::~THuiFontSpecification()
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// Returns the typeface family description
+// ---------------------------------------------------------------------------
+//
+const TDesC& THuiFontSpecification::TypefaceFamily() const
+	{
+    return iFontFamily;
+	}
+
+// ---------------------------------------------------------------------------
+// Sets the typeface family
+// ---------------------------------------------------------------------------
+//
+void THuiFontSpecification::SetTypefaceFamily(const TDesC& aName)
+	{
+	iFontFamily.Copy(aName);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huiframebrush.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,595 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiFrameBrush class - a brush that draws a 
+*                border at the edges of visuals.
+*
+*/
+
+
+
+#include "uiacceltk/huiframebrush.h"  // Class definition
+#include "uiacceltk/HuiDrawing.h"
+#include "uiacceltk/HuiVisual.h"
+#include "uiacceltk/HuiImageLoaderUtil.h"
+#include "uiacceltk/HuiGc.h"
+#include "uiacceltk/HuiUtil.h"
+#include <AknsItemData.h>
+#include <AknsUtils.h>
+
+const TInt KHuiNumberFramesInFullDefinedSkin = 9;
+const TInt KSkinFrameBorderWidthDefaultValue = 8;
+const TInt KSkinFrameBorderWidthSmallValue = 4;
+const TInt KSkinFrameBorderWidthSmallestValue = 1;
+
+
+CHuiFrameBrush::CHuiImageWithID::~CHuiImageWithID()
+    {
+    // Delete only if framebrush has ownership
+    if (iId)
+        {            
+        CHuiTextureManager& tm = CHuiStatic::Env().TextureManager();
+        CHuiTexture* tex = tm.Texture(iId);
+        delete tex; // calls TextureManager::RemoveTexture()
+        }
+    }
+    
+const MHuiSegmentedTexture& CHuiFrameBrush::CHuiImageWithID::Texture() 
+    {
+    return iImage.Texture();
+    }
+
+THuiImage& CHuiFrameBrush::CHuiImageWithID::Image()
+    {
+    return iImage;
+    }
+
+void CHuiFrameBrush::CHuiImageWithID::SetImage(const THuiImage& aImage)
+    {
+    iImage = aImage;    
+    }
+
+EXPORT_C CHuiFrameBrush* CHuiFrameBrush::NewL(
+        const THuiImage& aImage,
+        const THuiXYMetric& aEdgeOffset)
+    {
+    CHuiFrameBrush* self = CHuiFrameBrush::NewLC(aImage, aEdgeOffset);
+    CleanupStack::Pop();
+    return self;        
+    }
+    
+EXPORT_C CHuiFrameBrush* CHuiFrameBrush::NewLC(
+        const THuiImage& aImage,
+        const THuiXYMetric& aEdgeOffset)
+    {
+    CHuiFrameBrush* self = new (ELeave) CHuiFrameBrush(aImage, 
+                                                       aEdgeOffset);
+    self->ConstructL(aImage);
+    CleanupStack::PushL(self);
+    return self;        
+    }
+
+EXPORT_C CHuiFrameBrush* CHuiFrameBrush::NewL(
+        const TAknsItemID& aIID,
+        const THuiXYMetric& aEdgeOffset)
+    {
+    CHuiFrameBrush* self = CHuiFrameBrush::NewLC(aIID, aEdgeOffset);
+    CleanupStack::Pop();
+    return self;        
+    }
+    
+EXPORT_C CHuiFrameBrush* CHuiFrameBrush::NewLC(
+        const TAknsItemID& aIID,
+        const THuiXYMetric& aEdgeOffset)
+    {
+    CHuiFrameBrush* self = new (ELeave) CHuiFrameBrush(aIID, 
+                                                       aEdgeOffset);
+    CleanupStack::PushL(self);
+    return self;        
+    }
+
+EXPORT_C CHuiFrameBrush* CHuiFrameBrush::NewL(
+    const TAknsItemID& aIID,
+	TInt aEdgeOffsetX, 
+	TInt aEdgeOffsetY)
+    {
+    CHuiFrameBrush* self = CHuiFrameBrush::NewLC(aIID, aEdgeOffsetX, aEdgeOffsetY);
+    CleanupStack::Pop();
+    return self;
+    }
+
+EXPORT_C CHuiFrameBrush* CHuiFrameBrush::NewLC(const TAknsItemID& aIID,
+    TInt aEdgeOffsetX, TInt aEdgeOffsetY)
+    {
+    CHuiFrameBrush* self = new (ELeave) CHuiFrameBrush(aIID, 
+                                                       aEdgeOffsetX, 
+                                                       aEdgeOffsetY);
+    CleanupStack::PushL(self);
+    return self;
+    }
+
+void CHuiFrameBrush::ConstructL(const THuiImage& aImage)
+    {
+    SetImage(aImage);    
+    }
+
+CHuiFrameBrush::CHuiFrameBrush(const THuiImage& /*aImage*/, const THuiXYMetric& aEdgeOffset)
+    : CHuiBrush(),
+     iFrameIID(KAknsIIDNone),
+     iInnerRect(0,0,0,0),
+     iOuterRect(0,0,0,0),
+     iEdgeOffset(aEdgeOffset.iX.iMagnitude,aEdgeOffset.iY.iMagnitude),
+     iEdgeOffsetMetric()
+    {
+    SetClipToVisual(EFalse);        
+    }
+
+CHuiFrameBrush::CHuiFrameBrush(const TAknsItemID& aIID, const THuiXYMetric& aEdgeOffset)
+    : CHuiBrush(),
+     iFrameIID(aIID),
+     iInnerRect(0,0,0,0),
+     iOuterRect(0,0,0,0),
+     iEdgeOffset(aEdgeOffset.iX.iMagnitude,aEdgeOffset.iY.iMagnitude),
+     iEdgeOffsetMetric()
+    {
+    SetClipToVisual(EFalse);        
+    }
+
+
+CHuiFrameBrush::CHuiFrameBrush(
+    const TAknsItemID& aIID, 
+    TInt aEdgeOffsetX, 
+    TInt aEdgeOffsetY)
+    : CHuiBrush(),
+     iFrameIID(aIID),
+     iInnerRect(0,0,0,0),
+     iOuterRect(0,0,0,0),
+     iEdgeOffset(TReal32(aEdgeOffsetX),TReal32(aEdgeOffsetY)),
+     iEdgeOffsetMetric(aEdgeOffsetX, aEdgeOffsetY)
+    {
+    SetClipToVisual(EFalse);
+    }
+
+CHuiFrameBrush::CHuiFrameBrush()
+    {
+	}
+
+void CHuiFrameBrush::HandleActionL(const THuiActionCommand& aActionCommand)
+    {
+    if (iFrameIID != KAknsIIDNone)
+        {            
+        if (aActionCommand.Id() == KAknsMessageSkinChange)
+            {
+            if (iEnvReleased)
+                {
+                // If env is released, creating new textures may fail. Just set flag.
+            	iSkinChanged = ETrue;
+            	// And destroy textures because new skin may not have same items defined, restoring might fail.
+            	iImages.ResetAndDestroy();
+            	
+            	delete iImageloader;
+                iImageloader = NULL;
+                }
+            else
+    	        {
+    	        ConstructFrameL();	
+            	iSkinChanged = EFalse;
+    	        }
+            }
+        else if (aActionCommand.Id() == KHuiEnvReleasedActionId)
+            {
+            iEnvReleased = ETrue;    
+            }
+        else if (aActionCommand.Id() == KHuiEnvRestoredActionId)
+            {
+            iEnvReleased = EFalse;
+            if (iSkinChanged)
+                {
+                ConstructFrameL();    
+                iSkinChanged = EFalse;
+                }            
+            }
+        }
+    }
+
+TSize CHuiFrameBrush::GetFramePartSize(const TFrameParts aFramePart) const
+    {
+    TSize size(0,0);
+    switch (aFramePart)
+        {
+        case EFramePartCornerTl:
+            size.iWidth = iInnerRect.iTl.iX - iOuterRect.iTl.iX;
+            size.iHeight = iInnerRect.iTl.iY - iOuterRect.iTl.iY;
+            break;
+        case EFramePartCornerTr:
+            size.iWidth = iOuterRect.iBr.iX - iInnerRect.iBr.iX;
+            size.iHeight = iInnerRect.iTl.iY - iOuterRect.iTl.iY;
+            break;
+        case EFramePartCornerBl:
+            size.iWidth = iInnerRect.iTl.iX - iOuterRect.iTl.iX;
+            size.iHeight = iOuterRect.iBr.iY - iInnerRect.iBr.iY;					
+            break;
+        case EFramePartCornerBr:
+            size.iWidth = iOuterRect.iBr.iX - iInnerRect.iBr.iX;
+            size.iHeight = iOuterRect.iBr.iY - iInnerRect.iBr.iY;					
+            break;
+        case EFramePartSideT:
+            size.iWidth = iInnerRect.iBr.iX - iInnerRect.iTl.iX;
+            size.iHeight = iInnerRect.iTl.iY - iOuterRect.iTl.iY;					
+            break;
+        case EFramePartSideB:
+            size.iWidth = iInnerRect.iBr.iX - iInnerRect.iTl.iX;
+            size.iHeight = iOuterRect.iBr.iY - iInnerRect.iBr.iY;					
+            break;
+        case EFramePartSideL:
+            size.iWidth = iInnerRect.iTl.iX - iOuterRect.iTl.iX;
+            size.iHeight = iInnerRect.iBr.iY - iInnerRect.iTl.iY;					
+            break;
+        case EFramePartSideR:
+            size.iWidth = iOuterRect.iBr.iX - iInnerRect.iBr.iX;
+            size.iHeight = iInnerRect.iBr.iY - iInnerRect.iTl.iY;					
+            break;
+        case EFramePartCenter:
+            size = iInnerRect.Size();
+            break;
+        default:
+            break;
+        }
+    return size;
+    }
+
+
+CHuiFrameBrush::~CHuiFrameBrush()
+    {
+    CHuiStatic::Env().iActionObservers.RemoveIfFound(*this);
+    iImages.ResetAndDestroy();
+    delete iImageloader;    
+    }
+
+
+void CHuiFrameBrush::ExpandVisualRect(TRect& aRect) const
+    {
+    // We need access to visual to convert metric units into pixels,
+    // currently a pointer to visual is provided through separate
+    // method since we want to avoid breaking binary compatibility 
+    // of this class.
+    THuiRealPoint edgeOffsetInPixels = PointInPixels(BrushGuide(), iEdgeOffset, iEdgeOffsetMetric);
+    aRect.Grow(HUI_ROUND_FLOAT_TO_INT(edgeOffsetInPixels.iX), HUI_ROUND_FLOAT_TO_INT(edgeOffsetInPixels.iY));
+    }
+   
+TBool CHuiFrameBrush::Changed() const
+    {
+    if ( CHuiBrush::Changed() )
+        {
+        return ETrue;
+        }
+    
+    for (TInt i=0; i<iImages.Count();i++)
+        {
+        if (iImages[i]->Image().Changed())
+            {
+            return ETrue;    
+            }
+        }     
+        
+    return iEdgeOffset.Changed();
+    }
+
+void CHuiFrameBrush::ClearChanged()
+    {
+    CHuiBrush::ClearChanged();
+
+    for (TInt i=0; i<iImages.Count();i++)
+        {
+        iImages[i]->Image().ClearChanged();
+        }     
+
+    iEdgeOffset.ClearChanged();
+    }
+
+
+void CHuiFrameBrush::Draw(CHuiGc& aGc, const MHuiBrushGuide& aGuide) const
+    {            
+    THuiRealRect content = aGuide.BrushRect();
+
+    TRect adjustedInnerRect = AdjustedInnerRect(content.Size());
+    TRect adjustedOuterRect = AdjustedOuterRect(content.Size());
+
+    if (adjustedInnerRect == TRect(0,0,0,0) || adjustedOuterRect== TRect(0,0,0,0))
+        {
+        return;        
+        }
+
+    THuiRealPoint edgeOffsetInPixels = PointInPixels(BrushGuide(), iEdgeOffset, iEdgeOffsetMetric);
+    content.Grow(edgeOffsetInPixels.iX, edgeOffsetInPixels.iY);
+
+    TReal32 opacity = aGuide.BrushOpacity() * iOpacity.Now();
+
+    aGc.SetPenColor(KRgbWhite);
+    aGc.SetPenAlpha(TInt(opacity * 255));
+
+    aGc.Enable(CHuiGc::EFeatureTexturing);
+    aGc.Enable(CHuiGc::EFeatureBlending);
+
+    // Apply the texture offset manually.
+    aGc.Push(EHuiGcMatrixTexture);
+    aGc.LoadIdentity(EHuiGcMatrixTexture);
+
+    if (iImages.Count() == KHuiNumberFramesInFullDefinedSkin )
+        {
+
+        // draw 9 part image
+        THuiRealSize size(0.f,0.f);
+        size.iWidth = adjustedInnerRect.iTl.iX - adjustedOuterRect.iTl.iX;
+        size.iHeight = adjustedInnerRect.iTl.iY - adjustedOuterRect.iTl.iY;
+        aGc.DrawStretchImage(CHuiGc::EStretchFull, iImages[EFramePartCornerTl]->Image(), THuiRealRect(content.iTl,size),0,0);
+
+        aGc.DrawStretchImage(CHuiGc::EStretchFull, iImages[EFramePartSideT]->Image(), THuiRealRect(THuiRealPoint(content.iTl.iX+(adjustedInnerRect.iTl.iX - adjustedOuterRect.iTl.iX), content.iTl.iY),THuiRealPoint(content.iBr.iX-(adjustedOuterRect.iBr.iX - adjustedInnerRect.iBr.iX),content.iTl.iY+(adjustedInnerRect.iTl.iY - adjustedOuterRect.iTl.iY))),0,0);
+
+        size.iWidth = adjustedOuterRect.iBr.iX - adjustedInnerRect.iBr.iX;
+        size.iHeight = adjustedInnerRect.iTl.iY - adjustedOuterRect.iTl.iY;
+        aGc.DrawStretchImage(CHuiGc::EStretchFull, iImages[EFramePartCornerTr]->Image(), THuiRealRect(THuiRealPoint(content.iBr.iX-size.iWidth, content.iTl.iY),size),0,0);
+
+        aGc.DrawStretchImage(CHuiGc::EStretchFull, iImages[EFramePartSideL]->Image(), THuiRealRect(THuiRealPoint(content.iTl.iX, content.iTl.iY+(adjustedInnerRect.iTl.iY - adjustedOuterRect.iTl.iY)),THuiRealPoint(content.iTl.iX+(adjustedInnerRect.iTl.iX - adjustedOuterRect.iTl.iX),content.iBr.iY-(adjustedOuterRect.iBr.iY - adjustedInnerRect.iBr.iY))),0,0);
+
+        aGc.DrawStretchImage(CHuiGc::EStretchFull, iImages[EFramePartCenter]->Image(), THuiRealRect(THuiRealPoint(content.iTl.iX+(adjustedInnerRect.iTl.iX - adjustedOuterRect.iTl.iX), content.iTl.iY+(adjustedInnerRect.iTl.iY - adjustedOuterRect.iTl.iY)),THuiRealPoint(content.iBr.iX-(adjustedOuterRect.iBr.iX - adjustedInnerRect.iBr.iX),content.iBr.iY-(adjustedOuterRect.iBr.iY - adjustedInnerRect.iBr.iY))),0,0);
+
+        aGc.DrawStretchImage(CHuiGc::EStretchFull, iImages[EFramePartSideR]->Image(), THuiRealRect(THuiRealPoint(content.iBr.iX-(adjustedOuterRect.iBr.iX - adjustedInnerRect.iBr.iX), content.iTl.iY+(adjustedInnerRect.iTl.iY - adjustedOuterRect.iTl.iY)),THuiRealPoint(content.iBr.iX,content.iBr.iY-(adjustedOuterRect.iBr.iY - adjustedInnerRect.iBr.iY))),0,0);
+
+
+        size.iWidth = adjustedInnerRect.iTl.iX - adjustedOuterRect.iTl.iX;
+        size.iHeight = adjustedOuterRect.iBr.iY - adjustedInnerRect.iBr.iY;
+        aGc.DrawStretchImage(CHuiGc::EStretchFull, iImages[EFramePartCornerBl]->Image(), THuiRealRect(THuiRealPoint(content.iTl.iX,content.iBr.iY-size.iHeight),size),0,0);
+
+        aGc.DrawStretchImage(CHuiGc::EStretchFull, iImages[EFramePartSideB]->Image(), THuiRealRect(THuiRealPoint(content.iTl.iX+(adjustedInnerRect.iTl.iX - adjustedOuterRect.iTl.iX), content.iBr.iY-(adjustedOuterRect.iBr.iY - adjustedInnerRect.iBr.iY)),THuiRealPoint(content.iBr.iX-(adjustedOuterRect.iBr.iX - adjustedInnerRect.iBr.iX),content.iBr.iY)),0,0);
+
+
+        size.iWidth = adjustedOuterRect.iBr.iX - adjustedInnerRect.iBr.iX;
+        size.iHeight = adjustedOuterRect.iBr.iY - adjustedInnerRect.iBr.iY;	
+        aGc.DrawStretchImage(CHuiGc::EStretchFull, iImages[EFramePartCornerBr]->Image(), THuiRealRect(THuiRealPoint(content.iBr.iX-size.iWidth, content.iBr.iY-size.iHeight),size),0,0);
+
+        }    
+    else if ( iImages.Count() )
+        {
+
+        // draw from one part
+        aGc.DrawStretchImage(CHuiGc::EStretchFull,
+            iImages[0]->Image(),
+            content);		    			
+        }
+
+    aGc.Pop(EHuiGcMatrixTexture);
+    }
+
+void CHuiFrameBrush::ResetAndDestroyImageArray( TAny* aAny )
+    {
+    CHuiFrameBrush* self = static_cast<CHuiFrameBrush*>(aAny);
+    self->iImages.ResetAndDestroy();
+    delete self->iImageloader;
+    self->iImageloader = NULL;
+    }
+
+void CHuiFrameBrush::ConstructFrameL()
+    {
+    MAknsSkinInstance* skin = CHuiStatic::SkinInstance();
+        
+    if (iFrameIID != KAknsIIDNone)
+        {            
+        iImages.ResetAndDestroy();
+        delete iImageloader;
+        iImageloader = NULL;
+        
+        // Use cleanup item to make sure that if some of frame allocations
+        // fail, the previously loaded items are released.
+        CleanupStack::PushL( TCleanupItem( ResetAndDestroyImageArray, this ) );
+
+        CAknsItemData* idata = NULL;    				
+        if (skin)
+            {
+            TRAP_IGNORE(idata = skin->CreateUncachedItemDataL( iFrameIID, EAknsITImageTable ))
+            }
+        else
+            {
+            TRAP_IGNORE(idata = CHuiStatic::GetCachedSkinItemDataL(iFrameIID, EAknsITImageTable));
+            }
+            
+        CleanupStack::PushL(idata);
+        MHuiBitmapProvider* imageprovider = NULL; 
+        
+        iImageloader = new (ELeave) CHuiImageLoaderUtil;            
+
+        if (idata)
+            {
+            // 9 part frame graphics
+            CAknsImageTableItemData* itdata = static_cast<CAknsImageTableItemData*>(idata);
+
+            for (TInt count = 0; count < KHuiNumberFramesInFullDefinedSkin; count++)
+                {
+                iImageloader->SetSize(GetFramePartSize((TFrameParts)(count)), EAspectRatioNotPreserved);
+                imageprovider = iImageloader->CreateImageLoaderL(itdata->ImageIID(count), KNullDesC, 0, 0);
+                TInt id = CHuiStatic::GenerateId();
+                CHuiTexture & texture = CHuiStatic::Env().TextureManager().CreateTextureL(id, imageprovider, EHuiTextureUploadFlagRetainResolution);
+                texture.SetSkinContent(EFalse); // we manage skins change w/o help from textures management
+                THuiImage newImage = THuiImage(texture); 
+                CHuiImageWithID* entry = new CHuiImageWithID(newImage,id); // ownership transferred on success
+                if (entry)
+                    {
+                    CleanupStack::PushL(entry);
+                    iImages.AppendL( entry );
+                    CleanupStack::Pop();
+                    }
+                }
+            }
+        else
+            {
+            // one part frame graphics
+            iImageloader->SetSize(iOuterRect.Size(), EAspectRatioNotPreserved); 
+            imageprovider = iImageloader->CreateImageLoaderL(iFrameIID, KNullDesC, 0, 0);
+            TInt id = CHuiStatic::GenerateId();
+            CHuiTexture & texture = CHuiStatic::Env().TextureManager().CreateTextureL(id, imageprovider, EHuiTextureUploadFlagRetainResolution);
+            texture.SetSkinContent(EFalse); // we manage skins change w/o help from textures management
+            THuiImage newImage = THuiImage(texture); 
+            CHuiImageWithID* entry = new CHuiImageWithID(newImage,id); // ownership transferred on success
+            if (entry)
+                {
+                CleanupStack::PushL(entry);
+                iImages.AppendL( entry );
+                CleanupStack::Pop();
+                }
+            }
+        
+        CleanupStack::PopAndDestroy(); // idata
+        CleanupStack::Pop(); // iImages.ResetAndDestroy();
+        
+        // we don't need skins change information until textures have been set
+        CHuiStatic::Env().iActionObservers.AppendIfNotFoundL(*this);
+        SetChanged();
+        }
+    }
+
+
+EXPORT_C void CHuiFrameBrush::SetFrameRectsL(const TRect& aInnerRect, const TRect& aOuterRect)
+    {
+    // Sanity check to avoid evil things happening later
+    TInt KMinValue = 1;
+    if (aOuterRect.iTl.iX - aInnerRect.iTl.iX > KMinValue ||
+        aOuterRect.iTl.iY - aInnerRect.iTl.iY > KMinValue ||
+        aOuterRect.iBr.iX - aInnerRect.iBr.iX < KMinValue ||
+        aOuterRect.iBr.iY - aInnerRect.iBr.iY < KMinValue)
+        {
+        User::Leave(KErrArgument);    
+        }
+    
+    iInnerRect = aInnerRect;
+    iOuterRect = aOuterRect;
+    ConstructFrameL();
+    }
+
+THuiRealPoint CHuiFrameBrush::PointInPixels(const CHuiVisual* aVisual, const THuiTimedPoint& aPoint, const THuiXYMetric& aMetric) const 
+    {
+    THuiRealPoint pointInPixels = aPoint.RealNow(); // Init, if no visual available for conversion then defaults to pixels
+    if (aVisual)
+        {
+        THuiXYMetric metric = aMetric;
+        metric.iX.iMagnitude = pointInPixels.iX;        
+        metric.iY.iMagnitude = pointInPixels.iY;        
+        pointInPixels = aVisual->MetricToPixels(metric); // Convert metric width in pixels  
+        }    
+    return pointInPixels;                    
+    }
+
+EXPORT_C void CHuiFrameBrush::SetEdgeOffset(const THuiXYMetric& aEdgeOffset)
+    {
+    iEdgeOffsetMetric = aEdgeOffset;
+    iEdgeOffset.iX.Set(aEdgeOffset.iX.iMagnitude);    
+    iEdgeOffset.iY.Set(aEdgeOffset.iY.iMagnitude);    
+    }
+
+EXPORT_C void CHuiFrameBrush::SetImage(const THuiImage& aImage)
+    {
+    TRAPD(err, InitImagesL(1))
+    if (err == KErrNone)
+        {
+        iImages[0]->SetImage(aImage);        
+        }
+    }
+    
+EXPORT_C void CHuiFrameBrush::SetImage(TFrameParts aFramePart, const THuiImage& aImage)
+    {
+    if (aFramePart >= 0 && aFramePart <= EFramePartCenter)
+        {
+        TRAPD(err, InitImagesL(KHuiNumberFramesInFullDefinedSkin))
+        if (err == KErrNone)
+            {
+            // index is ok because number of images has been just initialize
+            // and the maximum allowed value for aFramePart matches that
+            iImages[aFramePart]->SetImage(aImage);        
+            }        
+        }
+    }
+    
+void CHuiFrameBrush::InitImagesL(TInt aNumberOfImages)
+    {
+    // Remove possible skin textures and make sure there is right amount of images in the array
+    if (iFrameIID != KAknsIIDNone || iImages.Count() != aNumberOfImages)
+        {            
+        iImages.ResetAndDestroy();
+        delete iImageloader;
+        iImageloader = NULL;
+        iFrameIID = KAknsIIDNone;
+
+        for (TInt count = 0; count < aNumberOfImages; count++)
+            {
+            THuiImage newImage; 
+            CHuiImageWithID* entry = new CHuiImageWithID(newImage,0); 
+            if (entry)
+                {
+                CleanupStack::PushL(entry);
+                iImages.AppendL( entry );
+                CleanupStack::Pop();
+                }        
+            }            
+        }
+    }
+    
+TRect CHuiFrameBrush::AdjustedOuterRect(const TSize& aFullFrameSize) const
+    {
+    if (iOuterRect == TRect(0,0,0,0))
+        {
+        return TRect(TPoint(0,0), aFullFrameSize);    
+        }
+    return iOuterRect;    
+    }
+
+TRect CHuiFrameBrush::AdjustedInnerRect(const TSize& aFullFrameSize) const
+    {
+    if (iInnerRect == TRect(0,0,0,0))
+        {
+        TRect adjustedOuterRect = AdjustedOuterRect(aFullFrameSize);
+        TInt adjustment = 0;
+        
+        if ((adjustedOuterRect.Width() >= KSkinFrameBorderWidthDefaultValue * 2) &&
+            (adjustedOuterRect.Height() >= KSkinFrameBorderWidthDefaultValue * 2))
+            {
+            // Use default border width
+            adjustment = KSkinFrameBorderWidthDefaultValue;
+            }
+        else if ((adjustedOuterRect.Width() >= KSkinFrameBorderWidthSmallValue * 2) &&
+                 (adjustedOuterRect.Height() >= KSkinFrameBorderWidthSmallValue * 2))
+            {
+            // Frame size is too small, use small border
+            adjustment = KSkinFrameBorderWidthSmallValue;
+            }        
+        else if ((adjustedOuterRect.Width() >= KSkinFrameBorderWidthSmallestValue * 2) &&
+                 (adjustedOuterRect.Height() >= KSkinFrameBorderWidthSmallestValue * 2))
+            {
+            // Frame size is too small, use smallest border
+            adjustment = KSkinFrameBorderWidthSmallestValue;
+            }        
+        else
+            {
+            // Frame size is too small, just draw the center part
+            adjustment = 0;    
+            }
+                                            
+        adjustedOuterRect.iTl.iX += adjustment;
+        adjustedOuterRect.iBr.iX -= adjustment;            
+        adjustedOuterRect.iTl.iY += adjustment;
+        adjustedOuterRect.iBr.iY -= adjustment;
+        
+        return adjustedOuterRect;    
+        }
+    
+    return iInnerRect;    
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huigifanimationtexture.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,262 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include <uiacceltk/huigifanimationtexture.h>
+#include <uiacceltk/HuiStatic.h>
+#include <driveinfo.h>
+
+CHuiGifAnimationTexture::TAnimationState SetFlag(TInt aValue, TInt aFlag)
+    {
+    return CHuiGifAnimationTexture::TAnimationState(aValue|aFlag);
+    }
+
+CHuiGifAnimationTexture::TAnimationState ClearFlag(TInt aValue, TInt aFlag)
+    {      
+    return CHuiGifAnimationTexture::TAnimationState(aValue^aFlag);
+    }
+
+
+EXPORT_C CHuiGifAnimationTexture* CHuiGifAnimationTexture::NewL(const TDesC& aFilename, 
+                                                                CHuiTextureManager& aManager,
+                                                                TInt aID,
+                                                                THuiTextureUploadFlags aFlags)
+    {
+    CHuiGifAnimationTexture* self = new(ELeave) CHuiGifAnimationTexture(aManager,aFlags, aID);
+    CleanupStack::PushL(self);
+    self->ConstructL(aFilename);
+    CleanupStack::Pop(); // self
+    return self;
+    }
+
+EXPORT_C void CHuiGifAnimationTexture::Start()
+    {
+    iAnimationState = SetFlag(TInt(iAnimationState), TInt(ERunning));        
+    if (iAnimationState&EStopped)
+        {
+        iAnimationState=ClearFlag(TInt(iAnimationState), TInt(EStopped));
+        }
+    
+    if (iTexture)
+        {
+        iTexture->SetTextureChanged(ETrue);        
+        }
+    }
+
+EXPORT_C void CHuiGifAnimationTexture::Stop()
+    {
+    if (iAnimationState&ERunning)
+        {
+        iAnimationState=ClearFlag(TInt(iAnimationState), TInt(ERunning));
+        }
+    iAnimationState = SetFlag(TInt(iAnimationState), TInt(EStopped));
+    }
+    
+
+EXPORT_C void CHuiGifAnimationTexture::EnableAnimation(TBool aEnable)
+    { 
+    if (aEnable)
+    	{
+    	iAnimationState = SetFlag(TInt(iAnimationState), TInt(EEnabled));	
+    	}
+    else 
+    	{
+    	iAnimationState = ClearFlag(TInt(iAnimationState), TInt(EEnabled));
+    	}
+    }
+
+EXPORT_C TInt CHuiGifAnimationTexture::Id() 
+    {
+    return iId;
+    }
+    
+void CHuiGifAnimationTexture::AdvanceTime(TReal32 aElapsedTime) __SOFTFP
+    {
+    if (((iAnimationState & EInitializing) || (iFrameInterval == -1)) || (iAnimationState & EStopped)
+    	|| !(iAnimationState & EEnabled))
+        {
+        return;
+        }
+
+    iElapsedTime+=aElapsedTime;
+                                             
+    TReal32 time = (TReal(iFrameInterval))/1000000.0f;
+    if (iElapsedTime >= time)
+        {
+        const TInt loadingTextureId = iCurrentTexture ? iTextureId1 : iTextureId2;
+        if ( !iManager.IsLoaded( loadingTextureId ) )
+            {
+            return;
+            }
+
+        iCurrentTexture^=1;
+    
+        if (iCurrentTexture)
+            // use texture 2
+            {
+            iTexture = iTexture2;
+            TInt nextToLoad = iTexture2->iFrameNumber+1;
+            if (nextToLoad >= iFrameCount)
+                {
+                nextToLoad = 0;
+                }
+            
+            delete iTexture1;
+            iTexture1 = 0;   
+                       
+            TRAP_IGNORE(iTexture1 = &iManager.LoadTextureL(*iFilename,EHuiTextureUploadFlagDefault, iTextureId1, nextToLoad))
+            }
+        else
+            // use texture 1    
+            {
+            iTexture = iTexture1;
+            TInt nextToLoad = iTexture1->iFrameNumber+1;
+            if (nextToLoad >= iFrameCount)
+                {
+                nextToLoad = 0;
+                }
+            
+            delete iTexture2;
+            iTexture2 = 0;   
+ 
+            TRAP_IGNORE(iTexture2 = &iManager.LoadTextureL(*iFilename,EHuiTextureUploadFlagDefault, iTextureId2, nextToLoad))
+
+            }
+        iElapsedTime = 0.0f;
+        
+        } 
+    }
+    
+
+void CHuiGifAnimationTexture::TextureLoadingCompleted(CHuiTexture& aTexture,
+                             TInt aTextureId,
+                             TInt /*aErrorCode*/)
+    {
+    if ((iAnimationState & EInitializing) && aTexture.iFrameCount > 1 && aTextureId == iTextureId1)
+        {
+        iTexture = iTexture1;
+        TRAP_IGNORE(iTexture2 = &iManager.LoadTextureL(*iFilename,EHuiTextureUploadFlagDefault, iTextureId2, 1))
+        iFrameInterval = aTexture.iFrameInterval;
+        iFrameCount = aTexture.iFrameCount;
+        return;
+        }
+    if ((iAnimationState & EInitializing) && aTextureId == iTextureId2)
+        {
+        iAnimationState = SetFlag(TInt(iAnimationState),TInt(ERunning));
+        iAnimationState = ClearFlag(TInt(iAnimationState), TInt(EInitializing));
+        }
+    }
+
+
+CHuiGifAnimationTexture::CHuiGifAnimationTexture(CHuiTextureManager& aManager,THuiTextureUploadFlags aFlags,TInt aId) : 
+    CHuiAnimatedTexture(aManager),
+    iTexture2(NULL),
+    iCurrentTexture(0),
+    iAnimationState(EInitializing),
+    iFrameInterval(-1),
+    iFrameCount(0),
+    iFlags(aFlags),
+    iId(aId)
+    {
+    }
+
+void CHuiGifAnimationTexture::ConstructL(const TDesC& aFilename)
+    {
+    CHuiAnimatedTexture::BaseConstructL();
+    iTextureId1 = CHuiStatic::GenerateId();
+    iTextureId2 = CHuiStatic::GenerateId();
+    
+    // To load GIF animation, you should load textures in sequence - 
+    // previous state is needed. Thus, this group indicates that
+    // previous state can be shared between these textures.
+    RArray<TInt> groupIds;
+    CleanupClosePushL( groupIds );
+    groupIds.AppendL( iTextureId1 );
+    groupIds.AppendL( iTextureId2 );
+    iAnimatedTextureGroupId = iManager.AddAnimatedTextureGroupL( groupIds );
+    CleanupStack::PopAndDestroy( &groupIds );
+    
+	// Alf locks the file while drawing textures hence preventing any other operations on this file
+	// so copy file to RAM and use that instead.
+    TParse parse;
+    parse.Set(aFilename, NULL, NULL);
+    parse.NameAndExt();
+    
+    TChar drive;
+    User::LeaveIfError( DriveInfo::GetDefaultDrive(DriveInfo::EDefaultRam, drive ) );
+        
+    iFilename = HBufC::NewL(parse.NameAndExt().Size() + 4);
+    TPtr ptr = iFilename->Des();
+    
+    ptr.Append(drive);
+    ptr.Append(_L(":\\"));
+    ptr.Append(parse.NameAndExt());
+    
+    RFs fs;
+    User::LeaveIfError(fs.Connect());
+    
+    CFileMan* fileman = CFileMan::NewL(fs);
+    CleanupStack::PushL(fileman);
+    TInt err = fileman->Copy(aFilename, iFilename->Des());
+    
+    CleanupStack::PopAndDestroy();
+    
+    if(err != KErrNone)
+	{
+	delete iFilename;    
+    iFilename = aFilename.AllocL();
+	}
+    
+    
+    iTexture1 = &iManager.LoadTextureL(
+        *iFilename,EHuiTextureUploadFlagDefault, iTextureId1, 0);     
+    iManager.iLoadObservers.AppendL(*this);
+    
+   	iAnimationState = SetFlag(TInt(iAnimationState), TInt(EEnabled));	
+    }
+
+EXPORT_C CHuiGifAnimationTexture::~CHuiGifAnimationTexture()
+    {
+    if ( iAnimatedTextureGroupId )
+        {
+        iManager.RemoveAnimatedTextureGroup( iAnimatedTextureGroupId );
+        }
+    iManager.iLoadObservers.RemoveIfFound(*this);
+
+    delete iTexture1;
+    delete iTexture2;
+
+    iTexture = 0;    
+    
+    RFs fs;
+    TInt err = fs.Connect();
+    if(err == KErrNone)    
+        {
+        CFileMan* fileman = 0;
+        TRAP(err, fileman = CFileMan::NewL(fs));
+        if(err == KErrNone)
+            {
+            fileman->Delete(iFilename->Des());
+            }
+        }
+    
+
+    delete iFilename;
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huilongtapdetector.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class which detects the long pointer press.
+*
+*/
+
+
+
+#include "huilongtapdetector.h"
+#include "uiacceltk/HuiRoster.h"
+#include "uiacceltk/HuiUtil.h"
+
+const TInt KHuiLongTapDelay = 800000;              // 0,8 seconds
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CHuiLongTapDetector::CHuiLongTapDetector(CHuiRoster& aRoster)
+ : CTimer( EPriorityStandard ), iRoster( aRoster ), iPreviousPointerEvent(0)
+    {
+    CActiveScheduler::Add( this );
+    }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor
+// ---------------------------------------------------------------------------
+//
+void CHuiLongTapDetector::ConstructL()
+    {
+    CTimer::ConstructL();
+    }
+
+
+
+// ---------------------------------------------------------------------------
+// Two phased constructor
+// ---------------------------------------------------------------------------
+//
+CHuiLongTapDetector* CHuiLongTapDetector::NewL(CHuiRoster& aRoster)
+    {
+    CHuiLongTapDetector* self = new( ELeave ) CHuiLongTapDetector( aRoster );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CHuiLongTapDetector::~CHuiLongTapDetector()
+    {
+    Cancel();
+    }
+
+// ---------------------------------------------------------------------------
+// Called when a pointer event is received
+// ---------------------------------------------------------------------------
+//
+void CHuiLongTapDetector::OfferPointerEvent( const THuiEvent& aEvent )
+    {
+    if ( aEvent.IsPointerEvent() )
+        {
+        // Store the coordinates.
+        iPreviousPointerEvent = aEvent;
+        
+        // On pointer down, start the timer
+        if ( aEvent.PointerDown() )
+            {
+            Cancel();
+            After( KHuiLongTapDelay );
+            }
+            
+        // Cancel the timed on pointer up
+        if ( aEvent.PointerUp() )
+            {
+            Cancel();
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive
+// Called when timer expires.
+// ---------------------------------------------------------------------------
+//
+void CHuiLongTapDetector::RunL()
+    {
+    if ( iStatus == KErrNone )
+        {
+        // Post the repeat event to back to the roster.
+        iPreviousPointerEvent.iPointerEvent.iType = TPointerEvent::EButtonRepeat;
+        iRoster.HandleEventL( iPreviousPointerEvent );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// From class CActive
+// Called when RunL leaves.
+// ---------------------------------------------------------------------------
+//
+TInt CHuiLongTapDetector::RunError( TInt aError )
+    {
+    HUI_DEBUG1(_L("CHuiLongTapDetector::RunError() - Ignore error %i."), aError);
+    (void)aError; // for compiler
+    return KErrNone;
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huim3gmesh.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,691 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Definition of CHuiM3GMesh, an interface enabling usage of M3G
+ * 				 scene graphs within Hitchcock UI Toolkit user interfaces.
+ *
+*/
+
+
+
+#include <uiacceltk/huim3gmesh.h>
+#include <uiacceltk/HuiStatic.h>
+#include <uiacceltk/HuiEnv.h>
+
+// Force softfp linkage until included header has its own definitions
+#if defined(__ARMCC_VERSION)
+#pragma push
+#pragma softfp_linkage
+#endif
+#include <M3G/m3g_core.h>
+#if defined(__ARMCC_VERSION)
+#pragma pop
+#endif
+
+#include <s32file.h>
+#include <e32math.h>
+#include <cstack.h>
+
+// ======== LOCAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// A static function to destroy an M3G object if associated clean up item
+// is popped from the cleanup stack.
+// ---------------------------------------------------------------------------
+//
+void DestroyM3GObject(TAny* aObject)
+    {
+    m3gDeleteObject( (M3GObject)aObject );
+    }
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Default constructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CHuiM3GMesh::CHuiM3GMesh()
+: CHuiMesh(EHuiMeshTypeM3G)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// 2nd phase constructor.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CHuiM3GMesh::ConstructL()
+    {
+    iCamRotation[0] = 0;
+    iCamRotation[1] = 0;
+    iCamRotation[2] = 0;
+    iCamRotation[3] = 0;
+    iCamTranslation[0] = 0;
+    iCamTranslation[1] = 0;
+    iCamTranslation[2] = 0;
+    iCamTranslation[3] = 0;
+    }
+
+// ---------------------------------------------------------------------------
+// Load scene from file.
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CHuiM3GMesh::LoadSceneL(const TDesC& /*aFileName*/)
+    {
+    }
+
+EXPORT_C void CHuiM3GMesh::LoadSceneL(const TDesC& aFileName, M3GInterface aInterface)
+    {
+    // Release the previously loaded M3G scene graph
+    ReleaseScene();
+
+    // Load the new scene graph
+    TRAPD( err, DoLoadSceneL( aFileName, aInterface ) );
+
+    // If an error occured during the scene loading release the scene and
+    // re-leave.
+    if( err != KErrNone )
+        {
+        ReleaseScene();
+        User::Leave( err );
+        }
+    }
+
+void CHuiM3GMesh::DoLoadSceneL(const TDesC& aFileName, M3GInterface aInterface)
+    {
+    // Load M3G content from same path as images
+    TFileName fileName;
+    fileName = CHuiStatic::Env().TextureManager().ImagePath();
+    fileName += aFileName;
+
+    // Create M3G loader to load the scene from memory buffer.
+    M3GLoader loader = m3gCreateLoader(aInterface);
+    if (loader == NULL)
+        {
+        User::Leave(KErrNoMemory);
+        }
+    TCleanupItem loaderCleaner( &DestroyM3GObject, loader);
+    CleanupStack::PushL(loaderCleaner);
+
+    // Read the file contents to the memory buffer    
+    RFs fs;
+    CleanupClosePushL(fs);
+    RFileReadStream reader;
+    CleanupClosePushL(reader);
+    User::LeaveIfError(fs.Connect() );
+    TInt errorCode = reader.Open(fs, fileName, EFileRead);
+    if (errorCode != KErrNone)
+        {
+        User::Leave(errorCode);
+        }
+
+    // Read the contents of the file to a buffer.
+    TInt sceneSize = reader.Source()->SizeL();
+    TUint chunkSize = 1024;
+    TUint8 *buf = new (ELeave) TUint8[chunkSize];
+    CleanupStack::PushL(buf);
+    TInt i = 0;
+    M3Gsizei reqBytes = 1;
+    while (i < sceneSize && reqBytes > 0 ){
+    TInt j = 0;
+    for( j = 0; j < chunkSize && i < sceneSize; j++ )
+        {
+        buf[j] = reader.ReadUint8L();
+        i++;
+        }
+    reqBytes = m3gDecodeData( loader, j, buf );
+    }
+
+// Get number of loaded objects
+iNumObjects = m3gGetLoadedObjects( loader, NULL );
+
+// The input buffer from the file is not needed anymore
+CleanupStack::PopAndDestroy( buf );
+CleanupStack::PopAndDestroy( &reader );
+CleanupStack::PopAndDestroy( &fs );
+
+// Leave with KErrCorrupt if there were no M3G objects within the file (corrupted file).
+if( iNumObjects == 0 )
+    {
+    User::Leave( KErrCorrupt );
+    }
+
+// Add loaded objects to an object array.
+iObjects = new (ELeave) M3GObject[iNumObjects];
+m3gGetLoadedObjects( loader, iObjects );
+
+// Add references and find the first world object
+for( TInt ii = 0; ii < iNumObjects; ii++ )
+    {
+    m3gAddRef( iObjects[ii] );
+    if( m3gGetClass( iObjects[ii] ) == M3G_CLASS_WORLD && !iWorld )
+        {
+        iWorld = (M3GWorld)iObjects[ii];
+        break;
+        }
+    }
+
+// Fetch animation controllers from world
+PopulateAnimationControllerArrayL( (M3GObject)iWorld );
+
+iUpdateCamera = EFalse;
+iCamera = m3gGetActiveCamera(iWorld);
+if ( !iCamera )
+    {
+    // Create camera if it doesn't exist
+    // The camera is updated according to hitchcock projection and model view matrices
+    iUpdateCamera = ETrue;
+    iCamera = m3gCreateCamera(aInterface);
+    if( iCamera == NULL )
+        {
+        User::Leave( KErrNoMemory );
+        }
+    m3gAddChild( (M3GGroup)iWorld, (M3GNode)iCamera );
+    m3gSetActiveCamera( iWorld, iCamera );
+    M3GMatrix identity;
+    m3gIdentityMatrix( &identity );
+    m3gSetTransform( (M3GTransformable)iCamera, &identity );
+    m3gTranslate( (M3GTransformable)iCamera, 0.f, 0.f, 1.f );
+    m3gSetPerspective( iCamera,90.f, 1.f, 0.1f, 100.f );
+    }
+
+// Init background
+M3GBackground bg = m3gGetBackground( iWorld );
+if (!bg)
+    {
+    bg = m3gCreateBackground( aInterface );
+    if( bg == NULL )
+        {
+        User::Leave( KErrNoMemory );
+        }
+    m3gSetBackground( iWorld, bg );
+    }
+m3gSetBgEnable( bg, M3G_SETGET_COLORCLEAR, M3G_FALSE );
+m3gSetBgEnable( bg, M3G_SETGET_DEPTHCLEAR, M3G_FALSE );
+
+// Release the loader
+CleanupStack::PopAndDestroy( loader );
+}
+
+// ---------------------------------------------------------------------------
+// Object destructor.
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C CHuiM3GMesh::~CHuiM3GMesh()
+    {
+    ReleaseScene();
+    iControllers.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// Set viewport rect
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CHuiM3GMesh::SetViewportRect( const THuiRealRect& aRect )
+    {
+    iViewportRect = aRect;
+    }
+
+// ---------------------------------------------------------------------------
+// Draw scene
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CHuiM3GMesh::Draw(CHuiGc& /*aGc*/, const THuiImage* /*aImage*/,
+        const THuiImage* /*aSecondaryImage*/,
+        TReal32 /*aSecondaryAlpha*/) const __SOFTFP
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Release scene
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CHuiM3GMesh::ReleaseScene()
+    {
+    if (iObjects)
+        {
+        for (TInt i = 0; i < iNumObjects; i++)
+            {
+            m3gDeleteRef(iObjects[i]);
+            iObjects[i] = NULL;
+            }
+        delete [] iObjects;
+        iNumObjects = 0;
+        iObjects = NULL;
+        iWorld = NULL;
+        }
+    iControllers.Reset();
+    }
+
+// ---------------------------------------------------------------------------
+// Rotate world around Y axis
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CHuiM3GMesh::RotateYaw(TReal32 aAngle) __SOFTFP
+    {
+    RotateObjects(aAngle, 0.0f, 1.0f, 0.0f);
+    }
+
+// ---------------------------------------------------------------------------
+// Rotate world around X axis
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CHuiM3GMesh::RotatePitch(TReal32 aAngle) __SOFTFP
+    {
+    RotateObjects(aAngle, 1.0f, 0.0f, 0.0f);
+    }
+
+// ---------------------------------------------------------------------------
+// Find the center point of the group
+// ---------------------------------------------------------------------------
+//    
+void CHuiM3GMesh::FindObjectCenter(M3GGroup aGroup, TReal32 aTrans[4],
+        TBool aFirst)
+    {
+    TReal32 objectTrans[4];
+    TInt numChildren = m3gGetChildCount(aGroup);
+    for (TInt i = 0; i < numChildren; ++i)
+        {
+        M3GNode child = m3gGetChild((M3GGroup)aGroup, i);
+        M3GClass m3gClass = m3gGetClass((M3GObject)child);
+        M3GMesh mesh = (M3GMesh)child;
+
+        if (m3gClass == M3G_CLASS_SKINNED_MESH || m3gClass == M3G_CLASS_MESH
+                || m3gClass == M3G_CLASS_MORPHING_MESH)
+            {
+
+            // Set blending and culling
+            M3GAppearance hApp = m3gGetAppearance(mesh, 0);
+
+            /*
+             M3GCompositingMode cm = m3gGetCompositingMode(hApp);
+             m3gSetBlending(cm, M3G_REPLACE);
+             m3gSetAlphaWriteEnable(cm, 0);
+             m3gSetCompositingMode(hApp, cm);
+             m3gSetAppearance( mesh, 0, hApp );
+             */
+
+            M3GPolygonMode pm = m3gGetPolygonMode(hApp);
+            m3gSetCulling(pm, M3G_CULL_NONE);
+            m3gSetPolygonMode(hApp, pm);
+
+            m3gGetTranslation((M3GTransformable)mesh, objectTrans);
+            if (!aFirst)
+                {
+                aTrans[0] = (aTrans[0] + objectTrans[0]) / 2;
+                aTrans[1] = (aTrans[1] + objectTrans[1]) / 2;
+                aTrans[2] = (aTrans[2] + objectTrans[2]) / 2;
+                aTrans[3] = (aTrans[3] + objectTrans[3]) / 2;
+                }
+            else
+                {
+                aTrans[0] = objectTrans[0];
+                aTrans[1] = objectTrans[1];
+                aTrans[2] = objectTrans[2];
+                aTrans[3] = objectTrans[3];
+                aFirst = EFalse;
+                }
+            }
+        else
+            if (m3gClass == M3G_CLASS_GROUP || m3gClass == M3G_CLASS_WORLD)
+                {
+                m3gGetTranslation((M3GTransformable)mesh, objectTrans);
+                if (!aFirst)
+                    {
+                    aTrans[0] = (aTrans[0] + objectTrans[0]) / 2;
+                    aTrans[1] = (aTrans[1] + objectTrans[1]) / 2;
+                    aTrans[2] = (aTrans[2] + objectTrans[2]) / 2;
+                    aTrans[3] = (aTrans[3] + objectTrans[3]) / 2;
+                    }
+                else
+                    {
+                    aTrans[0] = objectTrans[0];
+                    aTrans[1] = objectTrans[1];
+                    aTrans[2] = objectTrans[2];
+                    aTrans[3] = objectTrans[3];
+                    aFirst = EFalse;
+                    }
+                FindObjectCenter((M3GGroup)child, aTrans, aFirst);
+                }
+            else
+                {
+                // For PC-lint
+                }
+        }
+
+    }
+
+// ---------------------------------------------------------------------------
+// Rotates camera around worlds objects.
+// ---------------------------------------------------------------------------
+//    
+void CHuiM3GMesh::RotateObjects(TReal32 aAngle, TReal32 aAxisX,
+        TReal32 aAxisY, TReal32 aAxisZ)
+__SOFTFP        {
+        if(iWorld != 0)
+            {
+
+            // Find the center of the objects
+            TReal32 objectTrans[4];
+            objectTrans[0] = 0;
+            objectTrans[1] = 0;
+            objectTrans[2] = 0;
+            objectTrans[3] = 0;
+            FindObjectCenter((M3GGroup)iWorld,objectTrans);
+
+            // Get camera position
+            M3GCamera cam = iCamera;
+            TReal32 trans[4];
+            m3gGetTranslation((M3GTransformable)cam, trans);
+
+            // Calculate distance of objects center point and camera
+            objectTrans[0] = objectTrans[0]-trans[0];
+            objectTrans[1] = objectTrans[1]-trans[1];
+            objectTrans[2] = objectTrans[2]-trans[2];
+            objectTrans[3] = objectTrans[3]-trans[3];
+            TReal dist;
+            Math().Sqrt(dist,(TReal)objectTrans[0]*objectTrans[0]+objectTrans[1]*objectTrans[1]+objectTrans[2]*objectTrans[2]);
+
+            // Get orientation of camera
+            TReal32 rot[4];
+            m3gGetOrientation((M3GTransformable)cam, rot);
+
+            // Create new camera vector
+            M3GVec4 camZ;
+            camZ.x = 0;
+            camZ.y = 0;
+            camZ.z = -dist;
+            camZ.w = 1;
+
+            // Create rotation matrix for camera (old position)
+            M3GMatrix rotmtx;
+            m3gIdentityMatrix(&rotmtx);
+            m3gPostRotateMatrix(&rotmtx, rot[0], rot[1], rot[2], rot[3]);
+
+            // Create rotation matrix for camera (new position)
+            M3GMatrix mtx;
+            m3gIdentityMatrix(&mtx);
+            m3gPostRotateMatrix(&mtx, aAngle, aAxisX, aAxisY, aAxisZ);
+
+            // Translate camera vector
+            m3gTransformVec4(&rotmtx,&camZ);
+
+            // Store this position
+            M3GVec4 trans2;
+            trans2.x = camZ.x;
+            trans2.y = camZ.y;
+            trans2.z = camZ.z;
+            trans2.w = camZ.w;
+
+            // create new camera vector
+            camZ.x = 0;
+            camZ.y = 0;
+            camZ.z = -dist;
+            camZ.w = 1;
+
+            // transform this vector with new position matrix
+            m3gTransformVec4(&mtx,&camZ);
+
+            // transform with old position matrix
+            m3gTransformVec4(&rotmtx,&camZ);
+
+            // move and rotate camerea based on these calculations
+            m3gPostRotate((M3GTransformable)cam,aAngle, aAxisX, aAxisY, aAxisZ);
+            m3gTranslate((M3GTransformable)cam, -camZ.x+trans2.x, -camZ.y+trans2.y, -camZ.z+trans2.z);
+
+            m3gAlignNode((M3GNode)cam,NULL);
+            }
+        }
+
+    // ---------------------------------------------------------------------------
+    // Store camera transformations
+    // ---------------------------------------------------------------------------
+    //    
+EXPORT_C void CHuiM3GMesh::StoreCamera()
+    {
+    if(iWorld != 0)
+        {
+        m3gGetOrientation((M3GTransformable)iCamera, iCamRotation);
+        m3gGetTranslation((M3GTransformable)iCamera, iCamTranslation);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Restore camera transformations
+// ---------------------------------------------------------------------------
+//    	
+EXPORT_C void CHuiM3GMesh::RestoreCamera()
+    {
+    if(iWorld != 0)
+        {
+        m3gSetOrientation((M3GTransformable)iCamera, iCamRotation[0],iCamRotation[1],iCamRotation[2],iCamRotation[3]);
+        m3gSetTranslation((M3GTransformable)iCamera, iCamTranslation[0],iCamTranslation[1],iCamTranslation[2]);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Fetch animation controllers from any M3G object (recursively).
+// ---------------------------------------------------------------------------
+//   
+void CHuiM3GMesh::PopulateAnimationControllerArrayL(const M3GObject aObject)
+    {
+    // Array for storing the already visited M3G object pointers.
+    RPointerArray<M3GObjectImpl> visited;
+    CleanupClosePushL(visited);
+
+    // Stack for iteratively traversing through the object reference net.
+    CStack<M3GObjectImpl, EFalse>* stack = new ( ELeave ) CStack<M3GObjectImpl, EFalse>();
+    CleanupStack::PushL(stack);
+
+    // Push the initial M3G object to the iteration stack
+    stack->PushL(aObject);
+
+    // Iterate through all objects in the iteration stack
+    while ( !stack->IsEmpty() )
+        {
+        // Pop the current M3G object
+        M3GObject current = stack->Pop();
+
+        // If animation controller, add to array
+        M3GClass m3gClass = m3gGetClass(current);
+        if (m3gClass == M3G_CLASS_ANIMATION_CONTROLLER)
+            {
+            M3GAnimationController controller =
+                    (M3GAnimationController)current;
+
+            THuiM3GMeshAnimationController newController;
+            newController.iController = controller;
+            newController.iPosition = THuiTimedValue( 0,
+                    EHuiTimedValueStyleLinear);
+            newController.iAnimating = EFalse;
+            newController.iTimeOffset = 0;
+            newController.iPreviousTime
+                    = CHuiStatic::MilliSecondsSinceStart();
+            iControllers.AppendL(newController);
+            }
+
+        // Traverse graph
+        const TInt count = m3gGetReferences(current, NULL, 0);
+        if (count)
+            {
+            visited.ReserveL(visited.Count() + count);
+            M3GObject* refs = new M3GObject[count];
+            User::LeaveIfNull(refs);
+            CleanupArrayDeletePushL(refs);
+
+            m3gGetReferences(current, refs, count);
+            for (TInt i = 0; i < count; i++)
+                {
+                TInt index = 0;
+                TInt err = visited.FindInAddressOrder(refs[i], index);
+                if (err != KErrNone)
+                    {
+                    visited.InsertL(refs[i], index);
+                    stack->PushL(refs[i]);
+                    }
+                }
+
+            CleanupStack::PopAndDestroy(refs);
+            }
+        }
+
+    CleanupStack::PopAndDestroy(stack);
+    CleanupStack::PopAndDestroy( &visited);
+    }
+
+// ---------------------------------------------------------------------------
+// Returns number of (hitchcock) animation controllers
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C TInt CHuiM3GMesh::AnimationControllerCount() const
+    {
+    TInt baseAnimations = CHuiMesh::AnimationControllerCount();
+    TInt count = iControllers.Count();
+    return baseAnimations + count;
+    }
+
+// ---------------------------------------------------------------------------
+// Set position of animation in animation controller.		
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CHuiM3GMesh::SetAnimationPosition(TInt aControllerId, TReal32 aTarget, TInt aTime) __SOFTFP
+    {
+    if(iWorld != 0)
+        {
+        // Animate every controller
+        if(aControllerId == KHuiM3GAnimateAllControllers )
+            {
+            for(int i = 0; i < iControllers.Count(); i++)
+                {
+                ((iControllers[i]).iPosition).Set(aTarget-((iControllers[i]).iTimeOffset), aTime);
+                }
+            }
+        else // Animate only aControllerId:s controller
+
+            {
+            for(int i = 0; i < iControllers.Count(); i++)
+                {
+                if(aControllerId == m3gGetUserID((M3GObject)(iControllers[i].iController)))
+                    {
+                    ((iControllers[i]).iPosition).Set(aTarget-((iControllers[i]).iTimeOffset), aTime);
+                    }
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Go through animation controllers and does animations.		
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CHuiM3GMesh::AnimateControllers()
+    {
+    if(iWorld != 0)
+        {
+        TInt currentTime = CHuiStatic::MilliSecondsSinceStart();
+        for(TInt i = 0; i < iControllers.Count(); i++)
+            {
+            M3GAnimationController controller = (iControllers[i]).iController;
+            if( ( (iControllers[i]).iPosition).Changed())
+                {
+                ((iControllers[i]).iPosition).ClearChanged();
+                }
+            else
+                {
+                if ( (iControllers[i]).iAnimating )
+                    {
+                    TInt timeChanged = currentTime-((iControllers[i]).iPreviousTime);
+                    ((iControllers[i]).iTimeOffset) += timeChanged;
+                    }
+                }
+            ((iControllers[i]).iPreviousTime) = currentTime;
+            m3gSetPosition(controller, ((iControllers[i]).iPosition).Now() + ((iControllers[i]).iTimeOffset), currentTime);
+            m3gSetActiveInterval(controller, currentTime, currentTime);
+            }
+        m3gAnimate((M3GObject)iWorld, currentTime);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Start animation of the controller
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CHuiM3GMesh::StartAnimationController(TInt aControllerId)
+    {
+    if(iWorld != 0)
+        {
+        // Start every animation controller
+        if(aControllerId == KHuiM3GAnimateAllControllers )
+            {
+            for(int i = 0; i < iControllers.Count(); i++)
+                {
+                iControllers[i].iAnimating = ETrue;
+                TInt currentTime = CHuiStatic::MilliSecondsSinceStart();
+                m3gSetActiveInterval((iControllers[i]).iController, currentTime, currentTime);
+                }
+            }
+        else // Start only aControllerId:s controller
+
+            {
+            for(int i = 0; i < iControllers.Count(); i++)
+                {
+                if(aControllerId == m3gGetUserID((M3GObject)(iControllers[i].iController)))
+                    {
+                    iControllers[i].iAnimating = ETrue;
+                    TInt currentTime = CHuiStatic::MilliSecondsSinceStart();
+                    m3gSetActiveInterval((iControllers[i]).iController, currentTime, currentTime);
+                    }
+                }
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Stop animation of the controller
+// ---------------------------------------------------------------------------
+//    
+EXPORT_C void CHuiM3GMesh::StopAnimationController(TInt aControllerId)
+    {
+    if(iWorld != 0)
+        {
+        // Stop every animation controller
+        if(aControllerId == KHuiM3GAnimateAllControllers )
+            {
+            for(int i = 0; i < iControllers.Count(); i++)
+                {
+                iControllers[i].iAnimating = EFalse;
+                TInt currentTime = CHuiStatic::MilliSecondsSinceStart();
+                m3gSetActiveInterval((iControllers[i]).iController, currentTime-2, currentTime-1);
+                }
+            }
+        else // Stop only aControllerId:s controller
+
+            {
+            for(int i = 0; i < iControllers.Count(); i++)
+                {
+                if(aControllerId == m3gGetUserID((M3GObject)(iControllers[i].iController)))
+                    {
+                    iControllers[i].iAnimating = EFalse;
+                    TInt currentTime = CHuiStatic::MilliSecondsSinceStart();
+                    m3gSetActiveInterval((iControllers[i]).iController, currentTime-2, currentTime-1);
+                    }
+                }
+            }
+        }
+    }
+
+EXPORT_C void CHuiM3GMesh::M3GMeshExtension(const TUid& /*aExtensionUid*/, TAny** aExtensionParams)
+    {
+    // If no extension with given UID was found, indicate it by returning null
+    *aExtensionParams = NULL;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huimetric.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "uiacceltk/huimetric.h"  // Class definition
+#include "uiacceltk/HuiUtil.h"
+
+EXPORT_C THuiMetric::THuiMetric(TReal32 aMagnitude, TInt aUnit, TInt aReferenceTextStyleId) __SOFTFP
+    : iMagnitude(aMagnitude),
+      iUnit(aUnit),
+      iReferenceTextStyleId(aReferenceTextStyleId)
+    {    
+    }
+
+EXPORT_C THuiMetric::THuiMetric(TInt aPixels)
+    : iMagnitude(aPixels),
+      iUnit(EHuiUnitPixel),
+      iReferenceTextStyleId(EHuiTextStyleNormal)
+    {    
+    }
+
+EXPORT_C THuiXYMetric::THuiXYMetric()
+    {
+    }
+    
+EXPORT_C THuiXYMetric::THuiXYMetric(const THuiMetric& aMetric)
+    : iX(aMetric),
+      iY(aMetric)
+    {
+    }
+        
+EXPORT_C THuiXYMetric::THuiXYMetric(const THuiMetric& aX,  const THuiMetric& aY)
+    : iX(aX),
+      iY(aY)
+    {   
+    }
+
+EXPORT_C THuiBoxMetric::THuiBoxMetric()
+    {
+    }
+
+EXPORT_C THuiBoxMetric::THuiBoxMetric(const THuiMetric& aMetric)
+        : iLeft(aMetric), 
+          iRight(aMetric),
+          iTop(aMetric),
+          iBottom(aMetric)
+    {
+    }
+
+EXPORT_C THuiBoxMetric::THuiBoxMetric(const THuiXYMetric& aMetric)
+        : iLeft(aMetric.iX),
+          iRight(aMetric.iX),
+          iTop(aMetric.iY),
+          iBottom(aMetric.iY)
+    {
+    }
+
+EXPORT_C THuiBoxMetric::THuiBoxMetric(const THuiXYMetric& aTopLeft, 
+        const THuiXYMetric& aBottomRight)
+        : iLeft(aTopLeft.iX),
+          iRight(aBottomRight.iX),
+          iTop(aTopLeft.iY),
+          iBottom(aBottomRight.iY)
+    {
+    }
+
+EXPORT_C THuiBoxMetric::THuiBoxMetric(const THuiMetric& aLeft, const THuiMetric& aRight,
+        const THuiMetric& aTop, const THuiMetric& aBottom)
+    : iLeft(aLeft), 
+      iRight(aRight), 
+      iTop(aTop), 
+      iBottom(aBottom)
+    {
+    }
+        
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huiproceduralmesh.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,90 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+
+#include "uiacceltk/huiproceduralmesh.h"
+#include "uiacceltk/HuiStatic.h"
+#include "HuiRenderPlugin.h"
+#include "uiacceltk/HuiProbe.h"
+#include "uiacceltk/HuiUtil.h"
+
+
+EXPORT_C CHuiProceduralMesh::CHuiProceduralMesh()
+    {
+    iMaterial.iPreset = EHuiMaterialChrome;
+    }
+
+EXPORT_C CHuiProceduralMesh::~CHuiProceduralMesh()
+    {
+    }
+    
+    
+EXPORT_C void CHuiProceduralMesh::Reset()
+    {
+    iMaterial = THuiMaterial();
+    iMaterial.iPreset = EHuiMaterialChrome;
+    }
+
+
+EXPORT_C void CHuiProceduralMesh::MakeCubeL(TReal32 /*aSizeX*/, TReal32 /*aSizeY*/, TReal32 /*aSizeZ*/, 
+                                  TReal32 /*aEdgeRadius*/) __SOFTFP
+    {
+    }
+
+
+EXPORT_C void CHuiProceduralMesh::MakeSphereL(TReal32 /*aRadius*/, TInt /*aColumns*/, TInt /*aRows*/) __SOFTFP
+    {
+    }
+
+
+EXPORT_C void CHuiProceduralMesh::MakeTorusL(TReal32 /*aMainRadius*/, TReal32 /*aOuterRadius*/, 
+                                   TInt /*aMainSegments*/, TInt /*aOuterSegments*/,
+                                   TReal32 /*aSegmentAngleOffset*/) __SOFTFP
+    {
+    }
+
+
+EXPORT_C void CHuiProceduralMesh::StretchUniformly(TReal32 /*aXLimit*/, TReal32 /*aXOffset*/, 
+                                         TReal32 /*aYLimit*/, TReal32 /*aYOffset*/,
+                                         TReal32 /*aZLimit*/, TReal32 /*aZOffset*/) __SOFTFP
+    {
+    }
+
+
+EXPORT_C void CHuiProceduralMesh::ScaleUniformly(TReal32 /*aX*/, TReal32 /*aY*/, TReal32 /*aZ*/) __SOFTFP
+    {
+    }
+
+
+EXPORT_C void CHuiProceduralMesh::UpdateSurface(TReal32 /*aYaw*/, TReal32 /*aPitch*/) __SOFTFP
+    {
+    }
+
+
+EXPORT_C void CHuiProceduralMesh::Draw(CHuiGc& /*aGc*/, const THuiImage* /*aImage*/, 
+                    const THuiImage* /*aSecondaryImage*/,
+                    TReal32 /*aSecondaryAlpha*/) const __SOFTFP
+    {
+    }
+
+EXPORT_C void CHuiProceduralMesh::ProceduralMeshExtension(const TUid& /*aExtensionUid*/, TAny** aExtensionParams)
+    {
+    // If no extension with given UID was found, indicate it by returning null
+    *aExtensionParams = NULL;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huiskinanimationtexture.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,218 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Texture class to support Legacy theme animation
+*
+*/
+
+
+#include <uiacceltk/HuiEnv.h>
+#include <uiacceltk/huiskinanimationtexture.h>
+#include <uiacceltk/HuiStatic.h> 
+#include <uiacceltk/HuiTextureIf.h>
+#include <uiacceltk/HuiThemeManager.h>
+
+#include <AknsItemData.h>
+#include <AknsUtils.h>
+#include <AknsItemDef.h>
+
+
+NONSHARABLE_CLASS(CHuiSkinBitmapProvider) : public CBase, public MHuiBitmapProvider
+	{
+public:
+	CHuiSkinBitmapProvider()
+	    {}
+	// from MHuiBitmapProvider
+	void ProvideBitmapL(TInt, CFbsBitmap*&, CFbsBitmap*&)
+	    {
+	    User::Leave(KErrNotSupported);
+	    }
+							 
+    void SetSize(TSize)
+        {
+        }
+    
+    TInt NumberOfImages()	// Number of images in anim.
+        {
+        return 0;    
+        }
+	
+	// Load bitmap data based on Item ID
+	TBool LoadBitmapDataL(const TAknsItemID& )
+	    {
+	    return EFalse;
+	    }
+		
+	// Frame interval of current animation frame
+	TInt FrameInterval()
+	    {
+	    return -1;
+	    }
+ 
+    /*	The animation can be played in any of the ways described below. */
+	enum EHuiPlayMode
+		{
+		/** Plays the animation once, from the first frame to the last one. */
+		EPlay		= 0,
+		/** Plays the animation from the first frame to the last one 
+					continuously. */
+		ECycle		= 1,
+		/** Plays the animation from the first frame to the last one then 
+					from the last frame to the first continuously. */
+		EBounce		= 2
+		};
+
+	TSize iSize;
+	CAknsBmpAnimItemData* iAnimData;	// Animation data retrieved from Skin
+	TAknsBmpAnimFrameInfo* iFramesInfo;	// Frame based info from iAnimData
+	TInt iFrameInterval;				// Interval at which frame should be refreshed
+	TInt iBmpCount;					// Number of images in the animation
+	TInt iCounter;					// Index of animation being shown now
+    EHuiPlayMode iPlayMode;			// Play mode- cycle, play or bounce
+    TInt iBounceIncreasing;
+	};
+
+
+/*------------------------------Beging of CHuiAnimationTexture---------------*/
+    
+// ---------------------------------------------------------------------------
+// DEPRECATED: NewL:: Two phase constructor
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CHuiSkinAnimationTexture* CHuiSkinAnimationTexture::NewL(
+														const TDesC& aFilename, 
+                                                        CHuiTextureManager& aManager,
+                                                        TInt aID,
+                                                        THuiTextureUploadFlags aFlags)
+    {
+    CHuiSkinAnimationTexture* self = 
+    				new(ELeave) CHuiSkinAnimationTexture(aManager,aFlags, aID);
+    CleanupStack::PushL(self);
+    self->ConstructL(aFilename);
+    CleanupStack::Pop(); // self
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// Start():: Start animation by setting status flag
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CHuiSkinAnimationTexture::Start()
+    {
+    iAnimationState |= ERunning;        
+    iAnimationState &= ~EStopped;
+    }
+
+// ---------------------------------------------------------------------------
+// Stop():: Stop animation by setting status flag
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void CHuiSkinAnimationTexture::Stop()
+    {
+    iAnimationState &= ~ERunning;
+    iAnimationState |= EStopped;
+    }
+    
+// ---------------------------------------------------------------------------
+// Id():: Retrieve Texture Id
+// ---------------------------------------------------------------------------
+//
+EXPORT_C TInt CHuiSkinAnimationTexture::Id() 
+    {
+    return iId;
+    }
+    
+// ---------------------------------------------------------------------------
+// AdvanceTime():: Animation callback from Framework
+// ---------------------------------------------------------------------------
+//
+void CHuiSkinAnimationTexture::AdvanceTime(TReal32 aElapsedTime) __SOFTFP
+    {
+    iFrameInterval = iSkinBitmapProvider->FrameInterval();
+
+    if (((iAnimationState & EInitializing) || (iFrameInterval == -1)) || (iAnimationState&EStopped))
+        {
+        return;
+        }
+
+    iElapsedTime+=aElapsedTime;
+    
+                                             
+    TReal32 time = (TReal(iFrameInterval))/1000.0f;
+    if (iElapsedTime >= time)
+        {
+
+      	if(iManager.IsLoaded(iId))
+      	    {
+      	    iManager.UnloadTexture(iId);
+      	    }
+
+    	iId = CHuiStatic::GenerateId();
+
+        TRAP_IGNORE(iTexture = &iManager.CreateTextureL(iId,
+        					(MHuiBitmapProvider*)iSkinBitmapProvider,iFlags));
+
+        iElapsedTime = 0.0f;
+        } 
+    }
+    
+
+// ---------------------------------------------------------------------------
+// TextureLoadingCompleted():: Callback from Framework..finished loading aTexture
+// ---------------------------------------------------------------------------
+//
+void CHuiSkinAnimationTexture::TextureLoadingCompleted(CHuiTexture& ,//aTexture,
+                             TInt aTextureId,
+                             TInt aErrorCode)
+    {
+    if (aErrorCode == KErrNone && iAnimationState & EInitializing && aTextureId == iId)
+        {
+        iAnimationState |= ERunning;
+        iAnimationState &= ~EInitializing;
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// Constructor CHuiSkinAnimationTexture
+// ---------------------------------------------------------------------------
+//
+CHuiSkinAnimationTexture::CHuiSkinAnimationTexture(CHuiTextureManager& aManager,
+										THuiTextureUploadFlags aFlags,TInt aId) : 
+									    CHuiAnimatedTexture(aManager),
+									    iFrameInterval(-1),
+									    iFrameCount(0),
+									    iAnimationState(EInitializing),
+									    iFlags(aFlags),
+									    iId(aId)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// DEPRECATED: ConstructL : 2 phase constructor
+// ---------------------------------------------------------------------------
+//
+void CHuiSkinAnimationTexture::ConstructL(const TDesC&)
+    {
+    User::Leave(KErrNotSupported);
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor 
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CHuiSkinAnimationTexture::~CHuiSkinAnimationTexture()
+    {
+    iManager.iLoadObservers.RemoveIfFound(*this);
+    delete iSkinBitmapProvider;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huiskinbackgroundlayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,434 @@
+/*
+* 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: 
+*
+*/
+
+#include <AknUtils.h>
+#include <uiacceltk/HuiStatic.h>
+
+#include "huiskinbackroundlayout.h"
+
+static inline void GetScalableViaPane( TRect& aRect, const TRect& aParentRect,
+    const TAknWindowComponentLayout& aIntermediateLayout,
+    const TAknWindowComponentLayout& aFinalLayout )
+    {
+    TAknLayoutRect layout;
+    layout.LayoutRect( aParentRect,
+        TAknWindowComponentLayout::Compose(
+        aIntermediateLayout, aFinalLayout).LayoutLine() );
+    aRect = layout.Rect();
+    }
+
+
+TAknsItemID GetParent( const TAknsItemID& aIID )
+    {
+    if( aIID.iMajor == EAknsMajorSkin )
+        {
+        switch( aIID.iMinor )
+            {
+            case EAknsMinorQsnBgScreen:
+                return KAknsIIDNone;
+
+            case EAknsMinorQsnBgScreenIdle:
+            case EAknsMinorQsnBgScreenMp:
+                return KAknsIIDQsnBgScreen;
+            case EAknsMinorQsnBgAreaMain:
+            case EAknsMinorQsnBgAreaMainAppsGrid:
+            case EAknsMinorQsnBgAreaMainListGene:
+            case EAknsMinorQsnBgAreaMainListSet:
+            case EAknsMinorQsnBgAreaMainMessage:
+                return KAknsIIDQsnBgScreen;
+
+            case EAknsMinorQsnBgAreaMainHigh:
+            case EAknsMinorQsnBgAreaMainCalc:
+            case EAknsMinorQsnBgAreaMainPinb:
+            case EAknsMinorQsnBgAreaMainQdial:
+                return KAknsIIDQsnBgScreen;
+
+            case EAknsMinorQsnBgAreaMainMp:
+                return KAknsIIDQsnBgScreenMp;
+
+            case EAknsMinorQsnBgAreaMainFlat:
+            case EAknsMinorQsnBgAreaMainSmall:
+                return KAknsIIDQsnBgScreen;
+#ifdef RD_FULLSCREEN_WALLPAPER
+            case EAknsMinorWallpaper:
+                return KAknsIIDQsnBgScreenIdle;
+#else
+            case EAknsMinorWallpaper:
+                return KAknsIIDQsnBgAreaMainIdle;
+#endif //RD_FULLSCREEN_WALLPAPER
+
+            case EAknsMinorQsnBgAreaMainIdle:
+            case EAknsMinorQsnBgAreaMainIdleDimmed:
+#ifdef RD_FULLSCREEN_WALLPAPER
+                return KAknsIIDWallpaper;
+#else
+                return KAknsIIDQsnBgScreenIdle;
+#endif // RD_FULLSCREEN_WALLPAPER
+
+            case EAknsMinorQsnBgAreaStatus:
+                return KAknsIIDQsnBgScreen;
+
+            case EAknsMinorQsnBgAreaStatusIdle:
+                return KAknsIIDQsnBgScreenIdle;
+
+            case EAknsMinorQsnBgAreaStaconRt:
+            case EAknsMinorQsnBgAreaStaconLt:
+            case EAknsMinorQsnBgAreaStaconRb:
+            case EAknsMinorQsnBgAreaStaconLb:
+                return KAknsIIDQsnBgScreen;
+
+            case EAknsMinorQsnBgAreaStaconRtIdle:
+            case EAknsMinorQsnBgAreaStaconLtIdle:
+            case EAknsMinorQsnBgAreaStaconRbIdle:
+            case EAknsMinorQsnBgAreaStaconLbIdle:
+                return KAknsIIDQsnBgScreenIdle;
+
+            case EAknsMinorQsnBgAreaControl:
+            case EAknsMinorQsnBgAreaControlPopup:
+                return KAknsIIDQsnBgScreen;
+
+            case EAknsMinorQsnBgAreaControlMp:
+                return KAknsIIDQsnBgScreenMp;
+
+            case EAknsMinorQsnBgAreaControlIdle:
+                return KAknsIIDQsnBgScreenIdle;
+
+            case EAknsMinorQsnBgColumn0:
+            case EAknsMinorQsnBgColumnA:
+            case EAknsMinorQsnBgColumnAB:
+            case EAknsMinorQsnBgColumnC0:
+            case EAknsMinorQsnBgColumnCA:
+            case EAknsMinorQsnBgColumnCAB:
+                return KAknsIIDQsnBgAreaMainListGene;
+
+            case EAknsMinorQsnBgSliceList0:
+            case EAknsMinorQsnBgSliceListA:
+            case EAknsMinorQsnBgSliceListAB:
+                return KAknsIIDQsnBgAreaMainListGene;
+
+            // INSERTION POINT for layout parent relations
+            }
+        }
+    else if( aIID.iMajor == EAknsMajorAvkon )
+        {
+        switch( aIID.iMinor )
+            {
+            case EAknsMinorQsnBgNavipaneSolid:
+            case EAknsMinorQsnBgNavipaneWipe:
+                return KAknsIIDQsnBgAreaStatus;
+
+            case EAknsMinorQsnBgNavipaneSolidIdle:
+            case EAknsMinorQsnBgNavipaneWipeIdle:
+                return KAknsIIDQsnBgAreaStatusIdle;
+            }
+        }
+
+    return KAknsIIDDefault;
+    }
+    
+TBool GetItemLayout( const TAknsItemID& aIID,
+    const TRect& aParentRect, TRect& aRect  )
+    {
+    if (!CCoeEnv::Static())
+        { //ToDO
+        aRect = aParentRect;
+        return ETrue;
+        }
+    //---------------------------------------
+    const AknLayoutScalable_Avkon::CInstance& iAknLayoutScalable_Avkon = AknLayoutScalable_Avkon::CustomisationInstance();
+    TAknWindowLineLayout screenLayout = AknLayout::screen();
+    TRect iScreenRect = screenLayout.Rect();
+    //---------------------------------------
+    TRect normParentRect( TPoint(0,0), aParentRect.Size() );
+
+
+    TAknLayoutRect layRect;
+
+    if( aIID.iMajor == EAknsMajorSkin ) {
+        switch( aIID.iMinor )
+            {
+            case EAknsMinorQsnBgScreen:
+#ifdef RD_FULLSCREEN_WALLPAPER
+            case EAknsMinorWallpaper:
+#endif //RD_FULLSCREEN_WALLPAPER
+                {
+                aRect = iScreenRect;
+                return ETrue;
+                }
+            case EAknsMinorQsnBgScreenIdle:
+            case EAknsMinorQsnBgScreenMp:
+                {
+                aRect = normParentRect;
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgAreaMainAppsGrid:
+                {
+/*                if (iGridMode == -1)
+                    {
+                    // if gridmode is -1, it has not beed read
+                    // so read it here
+                    TRAP_IGNORE( iGridMode = GetGridModeL() );
+                    }
+                if (!Layout_Meta_Data::IsLandscapeOrientation() && iGridMode == 1) //3x4 mode
+                    {
+                    layRect.LayoutRect( normParentRect,
+                        iAknLayoutScalable_Avkon.main_pane(7));
+                    aRect = layRect.Rect();
+                    return ETrue;
+                    }
+                else // normal 3x3 mode
+                    {
+                    return AknLayoutUtils::LayoutMetricsRect(
+                        AknLayoutUtils::EMainPane, aRect );
+                    }*/
+                }
+
+            case EAknsMinorQsnBgAreaMain:
+            case EAknsMinorQsnBgAreaMainListGene:
+            case EAknsMinorQsnBgAreaMainListSet:
+            case EAknsMinorQsnBgAreaMainMessage:
+                layRect.LayoutRect( normParentRect,
+                AknLayout::main_pane( normParentRect, 0, 1, 1 ) );
+                aRect = layRect.Rect();
+                return ETrue;
+
+            case EAknsMinorQsnBgAreaMainFlat:
+                {
+                layRect.LayoutRect( normParentRect,
+                     iAknLayoutScalable_Avkon.main_pane(7));
+                    aRect = layRect.Rect();
+                    return ETrue;
+                }
+            case EAknsMinorQsnBgAreaMainSmall:
+                   {
+                   layRect.LayoutRect( normParentRect,
+                    iAknLayoutScalable_Avkon.main_pane(6));
+                    aRect = layRect.Rect();
+                    return ETrue;
+                  }
+
+            case EAknsMinorQsnBgAreaMainHigh:
+            case EAknsMinorQsnBgAreaMainCalc:
+            case EAknsMinorQsnBgAreaMainPinb:
+            case EAknsMinorQsnBgAreaMainQdial:
+            case EAknsMinorQsnBgAreaMainMp:
+                {
+                layRect.LayoutRect( normParentRect,
+                    AknLayout::main_pane( normParentRect, 0, 0, 1 ) );
+                aRect = layRect.Rect();
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgAreaMainIdle:
+            case EAknsMinorQsnBgAreaMainIdleDimmed:
+                {
+                layRect.LayoutRect( normParentRect,
+                    AknLayout::main_pane( normParentRect, 0, 1, 1 ) );
+                aRect = layRect.Rect();
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgAreaStatus:
+                {
+                GetScalableViaPane( aRect, normParentRect,
+                    iAknLayoutScalable_Avkon.area_top_pane(0),
+                    iAknLayoutScalable_Avkon.status_pane(0) );
+
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgAreaStatusIdle:
+                {
+                GetScalableViaPane( aRect, normParentRect,
+                    iAknLayoutScalable_Avkon.area_top_pane(0),
+                    iAknLayoutScalable_Avkon.status_pane(0) );
+
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgAreaStaconRt:
+            case EAknsMinorQsnBgAreaStaconLt:
+            case EAknsMinorQsnBgAreaStaconRtIdle:
+            case EAknsMinorQsnBgAreaStaconLtIdle:
+                {
+                GetScalableViaPane( aRect, normParentRect,
+                    iAknLayoutScalable_Avkon.area_top_pane(2),
+                    iAknLayoutScalable_Avkon.stacon_top_pane() );
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgAreaStaconRb:
+            case EAknsMinorQsnBgAreaStaconLb:
+            case EAknsMinorQsnBgAreaStaconRbIdle:
+            case EAknsMinorQsnBgAreaStaconLbIdle:
+                {
+                GetScalableViaPane( aRect, normParentRect,
+                    iAknLayoutScalable_Avkon.area_bottom_pane(2),
+                    iAknLayoutScalable_Avkon.stacon_bottom_pane() );
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgAreaControl:
+            case EAknsMinorQsnBgAreaControlPopup:
+            case EAknsMinorQsnBgAreaControlIdle:
+            case EAknsMinorQsnBgAreaControlMp:
+                {
+                layRect.LayoutRect( normParentRect,
+                    AknLayout::control_pane( normParentRect) );
+                aRect = layRect.Rect();
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgColumn0:
+                {
+                layRect.LayoutRect( normParentRect,
+                    SkinLayout::Column_background_and_list_slice_skin_placing_Line_1() );
+                aRect = layRect.Rect();
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgColumnA:
+                {
+                layRect.LayoutRect( normParentRect,
+                    SkinLayout::Column_background_and_list_slice_skin_placing_Line_2() );
+                aRect = layRect.Rect();
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgColumnAB:
+                {
+                layRect.LayoutRect( normParentRect,
+                    SkinLayout::Column_background_and_list_slice_skin_placing_Line_3() );
+                aRect = layRect.Rect();
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgColumnC0:
+                {
+                layRect.LayoutRect( normParentRect,
+                    SkinLayout::Column_background_and_list_slice_skin_placing_Line_4() );
+                aRect = layRect.Rect();
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgColumnCA:
+                {
+                layRect.LayoutRect( normParentRect,
+                    SkinLayout::Column_background_and_list_slice_skin_placing_Line_5() );
+                aRect = layRect.Rect();
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgColumnCAB:
+                {
+                layRect.LayoutRect( normParentRect,
+                    SkinLayout::Column_background_and_list_slice_skin_placing_Line_6() );
+                aRect = layRect.Rect();
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgSliceList0:
+            case EAknsMinorQsnBgSliceListA:
+            case EAknsMinorQsnBgSliceListAB:
+                {
+                layRect.LayoutRect( normParentRect,
+                    SkinLayout::Column_background_and_list_slice_skin_placing_Line_7() );
+                aRect = layRect.Rect();
+                return ETrue;
+                }
+#ifndef RD_FULLSCREEN_WALLPAPER
+            case EAknsMinorWallpaper:
+                {
+                aRect = normParentRect;
+                return ETrue;
+                }
+#endif //RD_FULLSCREEN_WALLPAPER
+
+            // INSERTION POINT for layout information retrieval
+            }
+        }
+    else if( aIID.iMajor == EAknsMajorAvkon )
+        {
+        switch( aIID.iMinor )
+            {
+            case EAknsMinorQsnBgNavipaneSolid:
+                {
+                layRect.LayoutRect( normParentRect,
+                    iAknLayoutScalable_Avkon.status_pane_g1(0) );
+                aRect = layRect.Rect();
+                // Artificial correction
+                aRect.iTl.iX = 0;
+                aRect.SetWidth( aParentRect.Width() );
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgNavipaneWipe:
+                {
+                layRect.LayoutRect( normParentRect,
+                    iAknLayoutScalable_Avkon.status_pane_g1(0) );
+                aRect = layRect.Rect();
+                // Artificial correction
+                aRect.iTl.iX = 0;
+                aRect.SetWidth( aParentRect.Width() );
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgNavipaneSolidIdle:
+                {
+                layRect.LayoutRect( normParentRect,
+                    iAknLayoutScalable_Avkon.status_pane_g1(0) );
+                aRect = layRect.Rect();
+                // Artificial correction
+                aRect.iTl.iX = 0;
+                aRect.SetWidth( aParentRect.Width() );
+                return ETrue;
+                }
+
+            case EAknsMinorQsnBgNavipaneWipeIdle: 
+                {
+                layRect.LayoutRect( normParentRect,
+                    iAknLayoutScalable_Avkon.status_pane_g1(0) );
+                aRect = layRect.Rect();
+                // Artificial correction
+                aRect.iTl.iX = 0;
+                aRect.SetWidth( aParentRect.Width() );
+                return ETrue;
+                }
+            }
+        }
+
+    return EFalse;
+    }
+
+EXPORT_C void GetRectForItem(const TAknsItemID& aID, TRect& aParentRect, TRect& aOutRect)
+    {
+    TAknsItemID parent = GetParent(aID);
+    TRect parentRect;
+    TRect itemRect;
+
+    if (parent != KAknsIIDDefault)//KAknsIIDNone) // go recursively down to the root element
+        {
+        GetRectForItem(parent, aParentRect, aOutRect);
+        }
+    else // root element
+        {
+        CHuiStatic::LayoutMetricsRect(AknLayoutUtils::EScreen,  aParentRect);
+        }
+    GetItemLayout( aID,aParentRect, aOutRect );
+    aParentRect = aOutRect;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huitextureanimationstate.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1043 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of CHuiTextureAnimationState.
+*
+*/
+
+
+
+#include <e32base.h>
+#include <fbs.h>
+#include <bitstd.h>
+#include <uiacceltk/HuiUtil.h>
+#include "huitextureanimationstate.h"
+
+/**
+ * Modifiable bitmap helper class for CHuiTextureAnimationState.
+ */
+NONSHARABLE_CLASS( CHuiModifiableBitmap ) : public CBase
+    {
+public:
+    /**
+     * Two-phased constructor. This creates new bitmap, 
+     * this instance owns it until @c ReleaseBitmap is called.
+     * @param aSize size of bitmap.
+     * @param aMode display mode of bitmap.
+     */
+    static CHuiModifiableBitmap* NewLC( const TSize& aSize, TDisplayMode aMode );
+    
+    /**
+     * Two-phased constructor. Use another bitmap and ownership
+     * is not taken.
+     * @param aBitmap bitmap to be modified.
+     */
+    static CHuiModifiableBitmap* NewLC( CFbsBitmap& aBitmap );
+    
+    /**
+     * Destructor.
+     */
+    ~CHuiModifiableBitmap();
+
+    /**
+     * Returns graphics context. Ownership is not passed.
+     * @return graphics context.
+     */
+    CFbsBitGc& Context();    
+    
+    /**
+     * Releases bitmap and passes ownership to caller.
+     * After this has been called, bitmap operations should not
+     * be performed through this class.
+     * @return bitmap.
+     */
+    CFbsBitmap* ReleaseBitmap();
+    
+    /**
+     * Clears the whole bitmap with specified color.
+     * @param aColor color to use.
+     */
+    void Clear( const TRgb& aColor );
+    
+    /**
+     * Clears area of bitmap with specified color.
+     * @param aRect area to fill.
+     * @param aColor color to use.
+     */
+    void Clear( const TRect& aRect, const TRgb& aColor );
+        
+    /**
+     * Copies area from another bitmap to this one.
+     * @param aRect area to copy.
+     * @param aBitmap source bitmap.
+     */
+    void BitBlt( const TRect& aRect, CHuiModifiableBitmap& aBitmap );
+    
+    /**
+     * Combines source and mask bitmap to this 16MA bitmap.
+     * @param aSrc bitmap.
+     * @param aSrcMask mask bitmap.
+     */
+    void Combine( const CFbsBitmap& aSrc, const CFbsBitmap& aSrcMask );
+    
+    /**
+     * Combines source and mask bitmap to this 16MA bitmap.
+     * @para aPos position of bitmap.
+     * @param aSrc bitmap.
+     * @param aSrcMask mask bitmap.
+     */
+    void Combine( const TPoint& aPos, const CFbsBitmap& aSrc, const CFbsBitmap& aSrcMask );
+    
+    /**
+     * Combines gray 256 mask to this gray 256 bitmap. 
+     * It's expected that aMask contains only 0 or 255 values.
+     * @param aRect rect to combine.
+     * @param aMask gray 256 bitmap.
+     */
+    void CombineMasks( const TRect& aRect, CFbsBitmap* aMask );
+    
+    /**
+     * Extracts alpha from 16MA source to this EGray256 bitmap.
+     * @param aSource source bitmap.
+     */
+    void ExtractAlpha( CHuiModifiableBitmap& aSource );
+    
+    /**
+     * Extracts color from 16MA source to this EColor64K/EColor16MU bitmap.
+     * @param aSource source bitmap.
+     */
+    void ExtractColor( CHuiModifiableBitmap& aSource );
+        
+private:
+    void ConstructL( const TSize& aSize, TDisplayMode aMode );
+    void ConstructL( CFbsBitmap& aBitmap );
+
+    template<class Converter>
+    static void DoExtractColor( CFbsBitmap* aTarget, CFbsBitmap* aSource );
+    
+    struct Convert16MA_16MU
+        {    
+        inline static TUint32 Convert( TUint32 aPixel );
+        };
+    struct Convert16MA_64K
+        {
+        inline static TUint32 Convert( TUint32 aPixel );
+        };
+    
+private:
+    /**
+     * Boolean value indicating if iBitmap is owned by this class.
+     */
+    TBool iOwnBitmap;
+    /**
+     * Bitmap instance. Ownership depends on value of iOwnBitmap.
+     */
+    CFbsBitmap* iBitmap;
+    /**
+     * Bitmap device.
+     * Own.
+     */
+    CFbsBitmapDevice* iDevice;
+    /**
+     * Graphics context.
+     * Own.
+     */
+    CFbsBitGc* iGc;
+    };
+
+CHuiTextureAnimationState* CHuiTextureAnimationState::NewL(
+        TInt aTextureGroupId, const TDesC& aImageFile, TInt aFrameCount )
+    {
+    CHuiTextureAnimationState* self = new (ELeave) CHuiTextureAnimationState;
+    CleanupStack::PushL( self );
+    self->ConstructL( aTextureGroupId, aImageFile, aFrameCount );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CHuiTextureAnimationState::~CHuiTextureAnimationState()
+    {
+    HUI_DEBUG1(_L("CHuiTextureAnimationState(%x): Destroyed"), this );
+    delete iFile;
+    
+    delete iPrevFrame;
+    delete iPrevFrameMask;
+    }
+
+TInt CHuiTextureAnimationState::OwnerTextureGroupId() const
+    {
+    return iTextureGroupId;
+    }
+    
+TBool CHuiTextureAnimationState::CheckIfCanProduce( 
+        const TDesC& aImageFile, TInt aFrameNumber, TInt aFrameCount ) const
+    {
+    aFrameNumber--;
+    
+    TBool ok = ( aFrameCount == iFrameCount ) && 
+               ( iFrame <= aFrameNumber ) &&
+               !aImageFile.CompareF( *iFile );
+               
+    return ok; 
+    }
+
+TInt CHuiTextureAnimationState::GetNextFrameNumber() const
+    {
+    return ( iFrame + 1 );
+    }
+
+void CHuiTextureAnimationState::OfferNextFrameInfo( 
+        const TFrameInfo& aFrameInfo )
+    {
+    if ( iFrame == KErrNotFound )
+        {
+        // First frame defines size of all frames; subsequent frames
+        // are deltas to first frame.
+        iSize = aFrameInfo.iOverallSizeInPixels;
+        }
+        
+    iNextSubFrameRect = aFrameInfo.iFrameCoordsInPixels;
+    iNextSubFrameBgColor = aFrameInfo.iBackgroundColor;
+    
+    if ( aFrameInfo.iFlags & TFrameInfo::ERestoreToPrevious )
+        {
+        iNextSubFrameDisposalAction = ERestoreToPrevious;
+        }
+    else if ( aFrameInfo.iFlags & TFrameInfo::ELeaveInPlace )
+        {
+        // The variable name "'ELeave'InPlace" will cause FALSE positive in CodeScanners "Leave scan"
+        iNextSubFrameDisposalAction = ELeaveInPlace;
+        }
+    else if ( aFrameInfo.iFlags & TFrameInfo::ERestoreToBackground )
+        {
+        iNextSubFrameDisposalAction = ERestoreToBackgroundColour;
+        }
+    else
+        {
+        iNextSubFrameDisposalAction = EUnspecified;
+        }
+        
+    // If EAlphaChannel flag is on, EGray256 style alpha is available.
+    // If ETransparencyPossible flag is on, just EGray2.
+    iNextSubFrameHasAlpha = aFrameInfo.iFlags & TFrameInfo::EAlphaChannel;
+    }
+
+TSize CHuiTextureAnimationState::OverallSize() const
+    {
+    return iSize;
+    }
+
+void CHuiTextureAnimationState::ProduceNextFrameL(
+        CFbsBitmap*& aNewFrame,
+        CFbsBitmap*& aNewFrameMask,
+        CFbsBitmap* aSubFrame,
+        CFbsBitmap* aSubFrameMask )
+    {
+    HUI_DEBUG2(_L("CHuiTextureAnimationState(%x): Produce next %d"), 
+        this, iFrame + 1 );
+    HUI_DEBUG4(_L("CHuiTextureAnimationState(%x): pf:%x pfm:%x d:%d"), 
+        this, iPrevFrame, iPrevFrameMask, iNextSubFrameDisposalAction );
+    aNewFrame = NULL;
+    aNewFrameMask = NULL;
+    CheckSubFrameL( aSubFrame, aSubFrameMask );
+    
+    if ( iFrame == KErrNotFound )
+        {
+        // Check if previous frames can be reused.
+        const TSize frameSize = OverallSize();
+        if ( iPrevFrame )
+            {
+            if ( iPrevFrame->SizeInPixels() != frameSize ||
+                 iPrevFrame->DisplayMode() != aSubFrame->DisplayMode() )
+                {
+                delete iPrevFrame;
+                iPrevFrame = NULL;
+                }
+            }
+        if ( iPrevFrameMask && aSubFrameMask )
+            {
+            if ( iPrevFrameMask->SizeInPixels() != frameSize ||
+                 iPrevFrameMask->DisplayMode() != aSubFrameMask->DisplayMode() )
+                {
+                delete iPrevFrameMask;
+                iPrevFrameMask = NULL;
+                }
+            }
+        else
+            {
+            delete iPrevFrameMask;
+            iPrevFrameMask = NULL;
+            }
+
+        if ( !iNextSubFrameHasAlpha || !aSubFrameMask )
+            {
+            HUI_DEBUG1(_L("CHuiTextureAnimationState(%x): Quick 1st"), this );
+            QuickProduceFirstFrameAndGeneratePreviousL( 
+                aNewFrame, aNewFrameMask, 
+                aSubFrame, aSubFrameMask );
+            }
+        else
+            {           
+            HUI_DEBUG1(_L("CHuiTextureAnimationState(%x): Slow 1st"), this );
+            ProduceFirstFrameAndGeneratePreviousL( 
+                aNewFrame, aNewFrameMask, 
+                aSubFrame, aSubFrameMask );
+            }
+            
+        if ( !aNewFrameMask )
+            {
+            // So mask was not needed - get rid of previous (if any)
+            delete iPrevFrameMask;
+            iPrevFrameMask = NULL;
+            }
+        }
+    else
+        {
+        if ( !iPrevFrame )
+            {
+            User::Leave( KErrNotSupported );
+            }
+            
+        if ( !iNextSubFrameHasAlpha || 
+             !aSubFrameMask || 
+             !iPrevFrameMask )
+            {
+            HUI_DEBUG1(_L("CHuiTextureAnimationState(%x): Quick 2-"), this );
+            QuickProduceNextFrameAndUpdatePreviousL(
+                aNewFrame, aNewFrameMask,
+                aSubFrame, aSubFrameMask );
+            }
+        else
+            {
+            HUI_DEBUG1(_L("CHuiTextureAnimationState(%x): Slow 2-"), this );
+            ProduceNextFrameAndUpdatePreviousL(
+                aNewFrame, aNewFrameMask,
+                aSubFrame, aSubFrameMask );
+            }
+        }
+        
+    iFrame++; // Go to next frame
+        
+    if ( iFrame == ( iFrameCount - 1 ) )
+        {
+        // Reset back to the beginning
+        iFrame = KErrNotFound;
+        }
+    HUI_DEBUG1(_L("CHuiTextureAnimationState(%x): Produce next done"), this );        
+    }
+
+void CHuiTextureAnimationState::ProceedWithoutNextFrameL(
+        CFbsBitmap* aSubFrame,
+        CFbsBitmap* aSubFrameMask )
+    {
+    // This could be optimized. However, if this method is called,
+    // it means that client is anyway using the API in very performance
+    // inefficient way, i.e. asking system to load random frames rather
+    // than in sequence 0, 1, ..., N.
+    
+    CFbsBitmap* frame = NULL;
+    CFbsBitmap* frameMask = NULL;
+    
+    ProduceNextFrameL( frame, frameMask, aSubFrame, aSubFrameMask );
+    
+    delete frame;
+    delete frameMask;
+    }
+
+CHuiTextureAnimationState::CHuiTextureAnimationState()
+    {
+    HUI_DEBUG1(_L("CHuiTextureAnimationState(%x): Created"), this );
+    }
+    
+void CHuiTextureAnimationState::ConstructL( 
+        TInt aTextureGroupId, const TDesC& aImageFile, TInt aFrameCount )
+    {
+    iTextureGroupId = aTextureGroupId;
+    iFile = aImageFile.AllocL();
+    iFrame = KErrNotFound;
+    iFrameCount = aFrameCount;
+    }
+
+void CHuiTextureAnimationState::ProduceFirstFrameAndGeneratePreviousL(
+        CFbsBitmap*& aNewFrame,
+        CFbsBitmap*& aNewFrameMask,
+        CFbsBitmap* aSubFrame,
+        CFbsBitmap* aSubFrameMask )
+    {
+    if ( !aSubFrameMask )
+        {
+        User::Leave( KErrNotSupported );
+        }
+        
+    const TSize frameSize = OverallSize();
+
+    // Make scratch
+    CHuiModifiableBitmap* scratch = 
+        CHuiModifiableBitmap::NewLC( frameSize, EColor16MA );
+    scratch->Combine( iNextSubFrameRect.iTl, *aSubFrame, *aSubFrameMask );
+                        
+    // Extract new frame & mask
+    CHuiModifiableBitmap* frame = 
+        CHuiModifiableBitmap::NewLC( frameSize, aSubFrame->DisplayMode() );
+    frame->ExtractColor( *scratch );
+
+    CHuiModifiableBitmap* frameMask = 
+        CHuiModifiableBitmap::NewLC( frameSize, EGray256 );
+    frameMask->ExtractAlpha( *scratch );
+            
+    // Create prev frame & mask
+    CHuiModifiableBitmap* prevFrame = 
+        iPrevFrame ?
+        CHuiModifiableBitmap::NewLC( *iPrevFrame ) :
+        CHuiModifiableBitmap::NewLC( frameSize, aSubFrame->DisplayMode() );
+
+    CHuiModifiableBitmap* prevFrameMask = 
+        iPrevFrameMask ?
+            CHuiModifiableBitmap::NewLC( *iPrevFrameMask ) :
+            CHuiModifiableBitmap::NewLC( frameSize, EGray256 );
+
+    prevFrame->Clear( BitmapClearColor() );
+    prevFrameMask->Clear( MaskClearColor() );
+    
+    switch ( iNextSubFrameDisposalAction )
+        {                    
+        case ELeaveInPlace:
+            prevFrame->BitBlt( iNextSubFrameRect, *frame );
+            prevFrameMask->BitBlt( iNextSubFrameRect, *frameMask );
+            break;
+        
+        case ERestoreToPrevious:
+        case EUnspecified:        
+        case ERestoreToBackgroundColour:
+        default:
+            break;
+        }
+
+    // Cleanup
+    iPrevFrameMask = prevFrameMask->ReleaseBitmap();
+    CleanupStack::PopAndDestroy( prevFrameMask );
+            
+    iPrevFrame = prevFrame->ReleaseBitmap();
+    CleanupStack::PopAndDestroy( prevFrame );
+            
+    aNewFrameMask = frameMask->ReleaseBitmap();
+    CleanupStack::PopAndDestroy( frameMask );
+                
+    aNewFrame = frame->ReleaseBitmap();              
+    CleanupStack::PopAndDestroy( frame );
+    CleanupStack::PopAndDestroy( scratch ); 
+    }
+
+void CHuiTextureAnimationState::ProduceNextFrameAndUpdatePreviousL(
+        CFbsBitmap*& aNewFrame,
+        CFbsBitmap*& aNewFrameMask,
+        CFbsBitmap* aSubFrame,
+        CFbsBitmap* aSubFrameMask )
+    {
+    if ( !aSubFrameMask || !iPrevFrameMask )
+        {
+        User::Leave( KErrNotSupported );
+        }
+
+    const TSize frameSize = OverallSize();
+            
+    // Make previous state and blit new subframe on top of that
+    CHuiModifiableBitmap* scratch = 
+        CHuiModifiableBitmap::NewLC( frameSize, EColor16MA );
+    scratch->Combine( *iPrevFrame, *iPrevFrameMask );
+            
+    scratch->Context().BitBltMasked(
+        iNextSubFrameRect.iTl,
+        aSubFrame,
+        TRect( aSubFrame->SizeInPixels() ),
+        aSubFrameMask,
+        ETrue );
+            
+    // Extract new frame & mask
+    CHuiModifiableBitmap* frame = 
+        CHuiModifiableBitmap::NewLC( frameSize, aSubFrame->DisplayMode() );
+    frame->ExtractColor( *scratch );
+            
+    CHuiModifiableBitmap* frameMask =
+        CHuiModifiableBitmap::NewLC( frameSize, EGray256 );
+    frameMask->ExtractAlpha( *scratch );
+            
+    // Update previous frame & mask
+    CHuiModifiableBitmap* prevFrame = 
+        CHuiModifiableBitmap::NewLC( *iPrevFrame );
+    CHuiModifiableBitmap* prevFrameMask =
+        CHuiModifiableBitmap::NewLC( *iPrevFrameMask );
+        
+    switch ( iNextSubFrameDisposalAction )
+        {                    
+        case EUnspecified:
+        case ERestoreToBackgroundColour:
+            prevFrameMask->Clear( iNextSubFrameRect, MaskClearColor() );
+            prevFrame->Clear( iNextSubFrameRect, BitmapClearColor() );
+            break;
+                    
+        case ELeaveInPlace:
+            prevFrame->BitBlt( iNextSubFrameRect, *frame );
+            prevFrameMask->BitBlt( iNextSubFrameRect, *frameMask );
+            break;
+            
+        case ERestoreToPrevious:
+        default:
+            break;
+            }
+        
+    CleanupStack::PopAndDestroy( prevFrameMask );
+    CleanupStack::PopAndDestroy( prevFrame );
+
+    aNewFrame = frame->ReleaseBitmap();
+    aNewFrameMask = frameMask->ReleaseBitmap();
+            
+    CleanupStack::PopAndDestroy( frameMask );
+    CleanupStack::PopAndDestroy( frame );
+                        
+    CleanupStack::PopAndDestroy( scratch );
+    }
+
+void CHuiTextureAnimationState::QuickProduceFirstFrameAndGeneratePreviousL(
+        CFbsBitmap*& aNewFrame,
+        CFbsBitmap*& aNewFrameMask,
+        CFbsBitmap* aSubFrame,
+        CFbsBitmap* aSubFrameMask )
+    {
+    const TSize frameSize = OverallSize();
+    const TBool hasAlpha = ( aSubFrameMask != NULL );
+        
+    const TBool exactMatch = 
+        ( TRect( frameSize ) == iNextSubFrameRect ) &&
+        ( aSubFrame->SizeInPixels() == frameSize );
+                            
+    // Produce new frame & mask
+    CHuiModifiableBitmap* frame = 
+        CHuiModifiableBitmap::NewLC( frameSize, aSubFrame->DisplayMode() );
+    
+    CHuiModifiableBitmap* frameMask = NULL;
+    if ( hasAlpha )
+        {           
+        frameMask = CHuiModifiableBitmap::NewLC( frameSize, EGray256 );
+        
+        frame->Clear( BitmapClearColor() );
+        if ( !exactMatch )
+            {
+            frameMask->Clear( MaskClearColor() );
+            }
+        
+        frame->Context().BitBltMasked( 
+            iNextSubFrameRect.iTl, 
+            aSubFrame, 
+            TRect( aSubFrame->SizeInPixels() ), 
+            aSubFrameMask, 
+            ETrue );
+        frameMask->Context().BitBlt( iNextSubFrameRect.iTl, aSubFrameMask );
+        }
+    else
+        {
+        if ( !exactMatch )
+            {
+            frame->Clear( iNextSubFrameBgColor );
+            }
+        frame->Context().BitBlt( iNextSubFrameRect.iTl, aSubFrame );
+        }
+                
+    // Create prev frame & mask
+    CHuiModifiableBitmap* prevFrame = 
+        iPrevFrame ?
+        CHuiModifiableBitmap::NewLC( *iPrevFrame ) :
+        CHuiModifiableBitmap::NewLC( frameSize, aSubFrame->DisplayMode() );
+
+    CHuiModifiableBitmap* prevFrameMask = NULL;
+    if ( hasAlpha )
+        {
+        prevFrameMask = 
+            iPrevFrameMask ?
+                CHuiModifiableBitmap::NewLC( *iPrevFrameMask ) :
+                CHuiModifiableBitmap::NewLC( frameSize, EGray256 );
+        }
+
+    const TRgb clearColor = 
+        hasAlpha ? 
+            BitmapClearColor() : 
+            iNextSubFrameBgColor;
+    prevFrame->Clear( clearColor );        
+    if ( prevFrameMask )
+        {
+        prevFrameMask->Clear( MaskClearColor() );
+        }
+    
+    switch ( iNextSubFrameDisposalAction )
+        {                    
+        case ELeaveInPlace:
+            prevFrame->BitBlt( iNextSubFrameRect, *frame );
+            if ( prevFrameMask )
+                {
+                prevFrameMask->BitBlt( iNextSubFrameRect, *frameMask );
+                }
+            break;
+        
+        case ERestoreToPrevious:
+        case EUnspecified:        
+        case ERestoreToBackgroundColour:
+        default:
+            break;
+        }
+
+    // Cleanup
+    if ( prevFrameMask )
+        {
+        iPrevFrameMask = prevFrameMask->ReleaseBitmap();
+        CleanupStack::PopAndDestroy( prevFrameMask );
+        }       
+            
+    iPrevFrame = prevFrame->ReleaseBitmap();
+    CleanupStack::PopAndDestroy( prevFrame );
+            
+    if ( frameMask )
+        {
+        aNewFrameMask = frameMask->ReleaseBitmap();
+        CleanupStack::PopAndDestroy( frameMask );
+        }
+                
+    aNewFrame = frame->ReleaseBitmap();                    
+    CleanupStack::PopAndDestroy( frame );     
+    }
+
+void CHuiTextureAnimationState::QuickProduceNextFrameAndUpdatePreviousL(
+        CFbsBitmap*& aNewFrame,
+        CFbsBitmap*& aNewFrameMask,
+        CFbsBitmap* aSubFrame,
+        CFbsBitmap* aSubFrameMask )
+    {
+    const TSize frameSize = OverallSize();
+    const TBool hasAlpha = aSubFrameMask != NULL;
+
+    // Produce frame & frame mask
+    CHuiModifiableBitmap* frame = 
+        CHuiModifiableBitmap::NewLC( frameSize, aSubFrame->DisplayMode() );
+    frame->Context().BitBlt( TPoint(), iPrevFrame );
+    
+    CHuiModifiableBitmap* frameMask = NULL;
+    if ( iPrevFrameMask )
+        {
+        frameMask =
+            CHuiModifiableBitmap::NewLC( frameSize, EGray256 );        
+        frameMask->Context().BitBlt( TPoint(), iPrevFrameMask );
+        }
+    
+    if ( hasAlpha )
+        {
+        frame->Context().SetBrushStyle( CGraphicsContext::ENullBrush );
+        frame->Context().BitBltMasked( 
+            iNextSubFrameRect.iTl, 
+            aSubFrame, 
+            TRect( aSubFrame->SizeInPixels() ), 
+            aSubFrameMask, 
+            ETrue );
+
+        if ( iPrevFrameMask )
+            {                
+            // Merge masks:
+            // prev: 255 sub: 255 frame: 255
+            // prev: 255 sub: 0   frame: 255
+            // prev: 0   sub: 255 frame: 255
+            // prev: 0   sub: 0   frame: 0
+            // => OR style behaviour works
+            frameMask->CombineMasks( iNextSubFrameRect, aSubFrameMask );
+            }
+        }
+    else
+        {
+        frame->Context().BitBlt( iNextSubFrameRect.iTl, aSubFrame );
+        
+        if ( iPrevFrameMask )
+            {
+            frameMask->Clear( iNextSubFrameRect, MaskOpaqueColor() );
+            }
+        }
+    
+    // Update previous frame & mask
+    CHuiModifiableBitmap* prevFrame = 
+        CHuiModifiableBitmap::NewLC( *iPrevFrame );
+    CHuiModifiableBitmap* prevFrameMask = NULL;
+    if ( iPrevFrameMask )
+        {
+        prevFrameMask =
+            CHuiModifiableBitmap::NewLC( *iPrevFrameMask );
+        }
+        
+    switch ( iNextSubFrameDisposalAction )
+        {   
+        case EUnspecified:                         
+        case ERestoreToBackgroundColour:
+            if ( prevFrameMask )
+                {
+                prevFrameMask->Clear( iNextSubFrameRect, MaskClearColor() );
+                prevFrame->Clear( iNextSubFrameRect, BitmapClearColor() );
+                }
+            else
+                {
+                prevFrame->Clear( iNextSubFrameRect, iNextSubFrameBgColor );
+                }    
+            break;
+                    
+        case ELeaveInPlace:
+            prevFrame->BitBlt( iNextSubFrameRect, *frame );
+            if ( prevFrameMask )
+                {
+                prevFrameMask->BitBlt( iNextSubFrameRect, *frameMask );
+                }
+            break;
+            
+        case ERestoreToPrevious:
+        default:
+            break;
+        }
+
+    if ( prevFrameMask )
+        {
+        CleanupStack::PopAndDestroy( prevFrameMask );
+        }
+    CleanupStack::PopAndDestroy( prevFrame );
+
+    aNewFrame = frame->ReleaseBitmap();
+    if ( frameMask )
+        {
+        aNewFrameMask = frameMask->ReleaseBitmap();
+        CleanupStack::PopAndDestroy( frameMask );
+        }
+    CleanupStack::PopAndDestroy( frame );        
+    }
+
+inline TRgb CHuiTextureAnimationState::BitmapClearColor()
+    {
+    return TRgb(0,0,0); // black
+    }
+    
+inline TRgb CHuiTextureAnimationState::MaskClearColor()
+    {
+    return TRgb::Gray256( 0 ); // transparent for EGray256 masks
+    }
+
+inline TRgb CHuiTextureAnimationState::MaskOpaqueColor()
+    {
+    return TRgb::Gray256( 255 ); // opaque for EGray256 masks
+    }
+
+void CHuiTextureAnimationState::CheckSubFrameL( 
+        CFbsBitmap* aSubFrame, 
+        CFbsBitmap* aSubFrameMask )
+    {
+    if ( !aSubFrame )
+        {
+        User::Leave( KErrNotSupported );
+        }    
+            
+    // aSubFrame display mode should be either 64K or 16MU,
+    // but let's check it.
+    const TDisplayMode subFrameMode = aSubFrame->DisplayMode();
+    if ( ( subFrameMode != EColor64K && subFrameMode != EColor16MU ) ||
+         aSubFrame->IsCompressedInRAM() )
+        {
+        User::Leave( KErrNotSupported );
+        }
+        
+    // aSubFrameMask should be EGray256
+    if ( aSubFrameMask )
+        {
+        if ( ( aSubFrameMask->DisplayMode() != EGray256 ) ||
+             aSubFrame->IsCompressedInRAM() )
+            {
+            User::Leave( KErrNotSupported );
+            }
+        }
+    }
+
+
+
+//
+// CHuiModifiableBitmap implementation
+//
+
+
+CHuiModifiableBitmap* CHuiModifiableBitmap::NewLC( 
+        const TSize& aSize, TDisplayMode aMode )
+    {
+    CHuiModifiableBitmap* self = new (ELeave) CHuiModifiableBitmap;
+    CleanupStack::PushL( self );
+    self->ConstructL( aSize, aMode );
+    return self;
+    }
+    
+CHuiModifiableBitmap* CHuiModifiableBitmap::NewLC( 
+        CFbsBitmap& aBitmap )
+    {
+    CHuiModifiableBitmap* self = new (ELeave) CHuiModifiableBitmap;
+    CleanupStack::PushL( self );
+    self->ConstructL( aBitmap );
+    return self;    
+    }
+
+CHuiModifiableBitmap::~CHuiModifiableBitmap()
+    {
+    delete iGc;
+    delete iDevice;
+    if ( iOwnBitmap )
+        {
+        delete iBitmap;
+        }
+    }
+
+CFbsBitGc& CHuiModifiableBitmap::Context()
+    {
+    return *iGc;
+    }
+    
+CFbsBitmap* CHuiModifiableBitmap::ReleaseBitmap()
+    {
+    delete iGc;
+    iGc = NULL;
+    delete iDevice;
+    iDevice = NULL;
+    CFbsBitmap* bitmap = iBitmap;
+    iBitmap = NULL;
+    return bitmap;
+    }
+
+void CHuiModifiableBitmap::Clear( const TRgb& aColor )
+    {
+    iGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
+    iGc->SetBrushColor( aColor );
+    iGc->Clear();
+    iGc->SetBrushStyle( CGraphicsContext::ENullBrush );
+    }
+
+void CHuiModifiableBitmap::Clear( const TRect& aRect, const TRgb& aColor )
+    {
+    iGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
+    iGc->SetBrushColor( aColor );
+    iGc->Clear( aRect );
+    iGc->SetBrushStyle( CGraphicsContext::ENullBrush );    
+    }
+
+void CHuiModifiableBitmap::BitBlt( 
+        const TRect& aRect, CHuiModifiableBitmap& aBitmap )
+    {
+    if ( iGc && aBitmap.iBitmap && iBitmap )
+        {
+        // Copy area from one bitmap to another. Same size expected.
+        iGc->BitBlt( aRect.iTl, aBitmap.iBitmap, aRect );
+        }
+    }
+
+void CHuiModifiableBitmap::Combine( 
+        const CFbsBitmap& aSrc, const CFbsBitmap& aSrcMask )
+    {
+    if ( iBitmap )
+        {
+        Combine( TPoint(), aSrc, aSrcMask );
+        }
+    }
+
+void CHuiModifiableBitmap::Combine( 
+        const TPoint& aPos, const CFbsBitmap& aSrc, const CFbsBitmap& aSrcMask )
+    {
+    if ( iBitmap )
+        {
+        // Clear with transparent
+        iGc->SetDrawMode( CGraphicsContext::EDrawModeWriteAlpha );
+        iGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
+        iGc->SetBrushColor( TRgb( 0, 0, 0, 0 ) );
+        iGc->Clear();
+        iGc->SetBrushStyle( CGraphicsContext::ENullBrush );    
+        iGc->SetDrawMode( CGraphicsContext::EDrawModePEN );
+        
+        // Blit masked
+        iGc->BitBltMasked( 
+            aPos, 
+            &aSrc, 
+            TRect( aSrc.SizeInPixels() ), 
+            &aSrcMask, 
+            ETrue );
+        }
+    }
+
+void CHuiModifiableBitmap::CombineMasks( 
+        const TRect& aRect, 
+        CFbsBitmap* aMask )
+    {    
+    if ( iBitmap )
+        {
+        // this is EGray256, aMask is EGray256
+        TRect targetRect( aRect );
+        targetRect.Intersection( iBitmap->SizeInPixels() );
+        targetRect.Intersection( TRect( aRect.iTl, aMask->SizeInPixels() ) );
+        
+        if ( targetRect.IsEmpty() )
+            {
+            // nothing to draw
+            return;
+            }
+    
+        // Starting target & source point and size to draw
+        const TPoint targetPoint = targetRect.iTl;
+        const TPoint sourcePoint = targetRect.iTl - aRect.iTl;
+        const TSize size = targetRect.Size();
+
+        // Go through all pixels using OR operation.
+        // As aMask contains only 0 or 255 values, it is
+        // sufficient to combine these masks.
+        TBitmapUtil source(aMask);
+        TBitmapUtil target(iBitmap);
+    
+        source.Begin( sourcePoint );
+        target.Begin( targetPoint );
+    
+        for( TInt y = 0; y < size.iHeight; ++y )
+            {
+            source.SetPos( sourcePoint + TPoint(0,y) );
+            target.SetPos( targetPoint + TPoint(0,y) );
+            
+            for( TInt x = 0; x < size.iWidth; ++x )
+                {
+                TUint32 pixel = source.GetPixel();
+                if ( pixel )
+                    {
+                    target.SetPixel( target.GetPixel() | pixel );
+                    }
+                
+                target.IncXPos();
+                source.IncXPos();
+                }
+            }
+            
+        target.End();
+        source.End();        
+        }    
+    }
+
+void CHuiModifiableBitmap::ExtractAlpha( CHuiModifiableBitmap& aSource )
+    {
+    if ( iBitmap && aSource.iBitmap )
+        {
+        // this is EGray256, aSource is 16MA
+        
+        TBitmapUtil source(aSource.iBitmap);
+        TBitmapUtil target(iBitmap);
+    
+        source.Begin( TPoint() );
+        target.Begin( TPoint() );
+    
+        const TSize size( iBitmap->SizeInPixels() );
+        for( TInt y = 0; y < size.iHeight; ++y )
+            {
+            source.SetPos( TPoint( 0, y) );
+            target.SetPos( TPoint( 0, y) );
+            
+            for( TInt x = 0; x < size.iWidth; ++x )
+                {
+                target.SetPixel( source.GetPixel() >> 24 );
+                
+                target.IncXPos();
+                source.IncXPos();
+                }
+            }
+            
+        target.End();
+        source.End();        
+        }
+    }
+   
+void CHuiModifiableBitmap::ExtractColor( CHuiModifiableBitmap& aSource )
+    {
+    // this is color, aSource is 16MA
+    
+    if ( iBitmap && aSource.iBitmap )
+        {
+        TDisplayMode mode = iBitmap->DisplayMode();
+        if ( mode == EColor64K )
+            {
+            DoExtractColor<Convert16MA_64K>( iBitmap, aSource.iBitmap );
+            }
+        else if ( mode == EColor16MU )
+            {
+            DoExtractColor<Convert16MA_16MU>( iBitmap, aSource.iBitmap );
+            }
+        }
+    }
+    
+void CHuiModifiableBitmap::ConstructL( const TSize& aSize, TDisplayMode aMode )
+    {
+    iOwnBitmap = ETrue;
+    iBitmap = new (ELeave) CFbsBitmap;
+    User::LeaveIfError( iBitmap->Create( aSize, aMode ) );
+    
+    iDevice = CFbsBitmapDevice::NewL( iBitmap );
+    iDevice->CreateContext( iGc );
+    User::LeaveIfNull( iGc );        
+    }
+
+void CHuiModifiableBitmap::ConstructL( CFbsBitmap& aBitmap )
+    {
+    iOwnBitmap = EFalse;
+    iBitmap = &aBitmap;
+    
+    iDevice = CFbsBitmapDevice::NewL( iBitmap );
+    iDevice->CreateContext( iGc );
+    User::LeaveIfNull( iGc );        
+    }
+
+template<typename Converter>
+void CHuiModifiableBitmap::DoExtractColor( 
+        CFbsBitmap* aTarget, CFbsBitmap* aSource )
+    {
+    TBitmapUtil source(aSource);
+    TBitmapUtil target(aTarget);
+    
+    source.Begin( TPoint() );
+    target.Begin( TPoint() );
+    
+    const TSize size( aTarget->SizeInPixels() );
+    for(TInt y = 0; y < size.iHeight; ++y)
+        {
+        source.SetPos(TPoint(0, y));
+        target.SetPos(TPoint(0, y));
+            
+        for(TInt x = 0; x < size.iWidth; ++x)
+            {
+            target.SetPixel( Converter::Convert( source.GetPixel() ) );
+                
+            target.IncXPos();
+            source.IncXPos();
+            }
+        }
+            
+    target.End();
+    source.End();
+    }
+
+inline TUint32 CHuiModifiableBitmap::Convert16MA_16MU::Convert( TUint32 aPixel )
+    {
+    return aPixel | 0xFF000000;
+    }
+    
+inline TUint32 CHuiModifiableBitmap::Convert16MA_64K::Convert( TUint32 aPixel )
+    {
+	const TUint32 b = (aPixel&0x000000ff)>>3;
+	const TUint32 g = (aPixel&0x0000fc00)>>5;
+	const TUint32 r = (aPixel&0x00f80000)>>8;
+	return (r|g|b);
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huitextureautosizeparams.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Texture autosize params
+*
+*/
+
+
+
+#include "uiacceltk/huitextureautosizeparams.h"
+
+EXPORT_C THuiTextureAutoSizeParams::THuiTextureAutoSizeParams() : 
+        iSizeLowerThreshold(EMedium),
+        iSizeUpperThreshold(EMedium),
+        iMinSizeChange(EMedium),
+        iDownsizeSettleThreshold(EMedium)
+    {    
+    };        
+
+EXPORT_C TInt THuiTextureAutoSizeParams::SizeLowerThreshold() const
+    {
+    return iSizeLowerThreshold;    
+    }
+
+EXPORT_C void THuiTextureAutoSizeParams::SetSizeLowerThreshold(TInt aSizeLowerThreshold)
+    {
+    iSizeLowerThreshold = aSizeLowerThreshold;    
+    }
+
+EXPORT_C TInt THuiTextureAutoSizeParams::SizeUpperThreshold() const
+    {
+    return iSizeUpperThreshold;    
+    }
+
+EXPORT_C void THuiTextureAutoSizeParams::SetSizeUpperThreshold(TInt aSizeLowerThreshold)
+    {
+    iSizeUpperThreshold = aSizeLowerThreshold;        
+    }
+
+EXPORT_C TInt THuiTextureAutoSizeParams::MinSizeChange() const
+    {
+    return iMinSizeChange;    
+    }
+
+EXPORT_C void THuiTextureAutoSizeParams::SetMinSizeChange(TInt aMinSizeChange)
+    {
+    iMinSizeChange = aMinSizeChange;    
+    }
+
+EXPORT_C TInt THuiTextureAutoSizeParams::DownsizeSettleThreshold() const
+    {
+    return iDownsizeSettleThreshold;    
+    }
+
+EXPORT_C void THuiTextureAutoSizeParams::SetDownsizeSettleThreshold(TInt aDownsizeSettleThreshold)
+    {
+    iDownsizeSettleThreshold = aDownsizeSettleThreshold;    
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/coretoolkit/src/huiviewportlayout.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,142 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Viewport visual.
+*
+*/
+
+
+
+#include "uiacceltk/huiviewportlayout.h"  // Class definition
+
+#include <uiacceltk/HuiControl.h>
+#include <uiacceltk/HuiUtil.h>
+
+
+EXPORT_C CHuiViewportLayout* CHuiViewportLayout::AddNewL(CHuiControl& aOwnerControl, CHuiLayout* aParentLayout)
+    {
+    CHuiViewportLayout* layout = new (ELeave) CHuiViewportLayout(aOwnerControl);
+    CleanupStack::PushL(layout);
+    layout->ConstructL();    
+    aOwnerControl.AppendL(layout, aParentLayout);
+    CleanupStack::Pop(layout);           
+    return layout;    
+    }
+
+
+CHuiViewportLayout::CHuiViewportLayout(MHuiVisualOwner& aOwner)
+        : CHuiLayout(aOwner)
+    {
+    iVirtualSize = THuiRealSize(1.0f, 1.0f);
+    iViewportSize = THuiRealSize(1.0f, 1.0f);  
+    iViewportPos = THuiRealPoint(0.0f, 0.0f);
+      
+    iWrappingFlags = 0;
+    }
+
+
+void CHuiViewportLayout::ConstructL()
+    {    
+    CHuiLayout::ConstructL();
+    SetClipping(ETrue);    
+    }
+    
+CHuiViewportLayout::~CHuiViewportLayout()
+    {    
+    }
+
+EXPORT_C void CHuiViewportLayout::SetVirtualSize(const THuiRealSize& aSize, TInt aTransitionTime)
+    {
+    if ( !HuiUtil::RealCompare( iVirtualSize.iHeight, aSize.iHeight ) || 
+         !HuiUtil::RealCompare( iVirtualSize.iWidth, aSize.iWidth ) )
+        {   
+        iVirtualSize = aSize;
+
+        UpdateChildrenLayout(aTransitionTime);    
+            
+        SetChanged();
+        }
+    }
+
+    
+EXPORT_C void CHuiViewportLayout::SetViewportSize(const THuiRealSize& aSize, TInt aTransitionTime)
+    {
+    // Divide by zero will be caught later.
+    if ( !HuiUtil::RealCompare( iViewportSize.iHeight, aSize.iHeight ) || 
+         !HuiUtil::RealCompare( iViewportSize.iWidth, aSize.iWidth ) )
+        { 
+        iViewportSize = aSize;
+            
+        UpdateChildrenLayout(aTransitionTime);            
+            
+        SetChanged();   
+        }
+    }
+
+EXPORT_C void CHuiViewportLayout::SetViewportPos(const THuiRealPoint& aPos, TInt aTransitionTime)
+    {
+     if ( !HuiUtil::RealCompare( iViewportPos.iY, aPos.iY ) || 
+         !HuiUtil::RealCompare( iViewportPos.iX, aPos.iX ) )
+        { 
+        iViewportPos = aPos;
+        
+        UpdateChildrenLayout(aTransitionTime);        
+        
+        SetChanged();
+        }
+    }
+
+void CHuiViewportLayout::SetSize(const THuiRealSize& aSize, TInt aTransitionTime)
+    {
+    CHuiLayout::SetSize(aSize, aTransitionTime);
+    UpdateChildrenLayout(aTransitionTime);    
+    }
+    
+
+TBool CHuiViewportLayout::ChildSize(TInt /*aOrdinal*/, TSize& aSize)
+    {
+    THuiRealSize mysize = Size().Target().AsSize();
+    
+    if ((iViewportSize.iWidth == 0.0) || (iViewportSize.iHeight == 0.0))
+        {
+        // Could not obtain new size because of divide by zero error.
+        return EFalse;            
+        }
+    
+    aSize.iWidth = HUI_ROUND_FLOAT_TO_INT((iVirtualSize.iWidth / iViewportSize.iWidth) * mysize.iWidth);
+    aSize.iHeight = HUI_ROUND_FLOAT_TO_INT((iVirtualSize.iHeight / iViewportSize.iHeight) * mysize.iHeight);
+
+    return ETrue;
+    }
+
+
+TBool CHuiViewportLayout::ChildPos(TInt /*aOrdinal*/, TPoint& aPos)
+    {
+    THuiRealSize mysize = Size().RealTarget().AsSize();
+
+    if ((iViewportSize.iWidth == 0.0) || (iViewportSize.iHeight == 0.0))
+        {
+        // Could not obtain new size because of divide by zero error.
+        return EFalse;            
+        }
+         
+    aPos.iX = HUI_ROUND_FLOAT_TO_INT( -iViewportPos.iX * mysize.iWidth / iViewportSize.iWidth );
+    aPos.iY = HUI_ROUND_FLOAT_TO_INT( -iViewportPos.iY * mysize.iHeight / iViewportSize.iHeight );
+    
+    return ETrue;
+    }
+
+EXPORT_C TInt CHuiViewportLayout::ChildRect(TInt /*aOrdinal*/, THuiRealRect& /*aPos*/)
+    {
+    return THuiLayoutChildRectNotImplemented;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/bwins/goommonitoru.DEF	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,24 @@
+EXPORTS
+	?ConstructL@CGOomMonitorPluginBase@@QAEXXZ @ 1 NONAME ; void CGOomMonitorPluginBase::ConstructL(void)
+	?SetGOomPriority@RGOomMonitorSession@@QAEXW4TGOomPriority@1@@Z @ 2 NONAME ; void RGOomMonitorSession::SetGOomPriority(enum RGOomMonitorSession::TGOomPriority)
+	?RequestFreeMemory@RGOomMonitorSession@@QAEXHAAVTRequestStatus@@@Z @ 3 NONAME ; void RGOomMonitorSession::RequestFreeMemory(int, class TRequestStatus &)
+	?Connect@RGOomMonitorSession@@QAEHXZ @ 4 NONAME ; int RGOomMonitorSession::Connect(void)
+	?WsSession@CGOomMonitorPluginBase@@QAEAAVRWsSession@@XZ @ 5 NONAME ; class RWsSession & CGOomMonitorPluginBase::WsSession(void)
+	??0CGOomMonitorPluginBase@@QAE@XZ @ 6 NONAME ; CGOomMonitorPluginBase::CGOomMonitorPluginBase(void)
+	?NewL@CAppGOomMonitorPlugin@@SAPAV1@VTUid@@@Z @ 7 NONAME ; class CAppGOomMonitorPlugin * CAppGOomMonitorPlugin::NewL(class TUid)
+	?CancelRequestFreeMemory@RGOomMonitorSession@@QAEXXZ @ 8 NONAME ; void RGOomMonitorSession::CancelRequestFreeMemory(void)
+	?ExtensionInterface@CGOomMonitorPluginBase@@UAEXVTUid@@AAPAX@Z @ 9 NONAME ; void CGOomMonitorPluginBase::ExtensionInterface(class TUid, void * &)
+	?FsSession@CGOomMonitorPluginBase@@QAEAAVRFs@@XZ @ 10 NONAME ; class RFs & CGOomMonitorPluginBase::FsSession(void)
+	?CreateGOOMWatcherThreadL@@YAXXZ @ 11 NONAME ; void CreateGOOMWatcherThreadL(void)
+	?SetGMemoryMonitorTls@@YAXPAVCMemoryMonitor@@@Z @ 12 NONAME ; void SetGMemoryMonitorTls(class CMemoryMonitor *)
+	?RequestFreeMemory@RGOomMonitorSession@@QAEHH@Z @ 13 NONAME ; int RGOomMonitorSession::RequestFreeMemory(int)
+	?ThisAppIsNotExiting@RGOomMonitorSession@@QAEXH@Z @ 14 NONAME ; void RGOomMonitorSession::ThisAppIsNotExiting(int)
+	?RequestOptionalRam@RGOomMonitorSession@@QAEXHHHAAVTRequestStatus@@@Z @ 15 NONAME ; void RGOomMonitorSession::RequestOptionalRam(int, int, int, class TRequestStatus &)
+	?RequestOptionalRam@RGOomMonitorSession@@QAEHHHHAAH@Z @ 16 NONAME ; int RGOomMonitorSession::RequestOptionalRam(int, int, int, int &)
+	??1CGOomMonitorPluginBase@@UAE@XZ @ 17 NONAME ; CGOomMonitorPluginBase::~CGOomMonitorPluginBase(void)
+	?ApplicationAboutToStart@RGOomMonitorSession@@QAEXABVTUid@@@Z @ 18 NONAME ; void RGOomMonitorSession::ApplicationAboutToStart(class TUid const &)
+	?IsConnected@RGOomMonitorSession@@QAEHXZ @ 19 NONAME ; int RGOomMonitorSession::IsConnected(void)
+	?UsesAbsoluteMemTargets@RGOomMonitorSession@@QAEXH@Z @ 20 NONAME ; void RGOomMonitorSession::UsesAbsoluteMemTargets(int)
+	?Connect@RGOomMonitorSession@@QAEHAAVTRequestStatus@@@Z @ 21 NONAME ; int RGOomMonitorSession::Connect(class TRequestStatus &)
+	?AppAboutToStart@RGOomMonitorSession@@QAEXAAVTRequestStatus@@ABVTUid@@@Z @ 22 NONAME ; void RGOomMonitorSession::AppAboutToStart(class TRequestStatus &, class TUid const &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/data/goomconfig.xml	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,80 @@
+
+<!-- This is the configuration file for the new GOOM Monitor. This configuration file
+defines a GOOM policy where Graphics RAM is released. The order below is the order in which the OOM Monitor releases RAM. 
+Work on the GOOM Moitor config file will be based on this.
+
+Aim of GOOM:
+Run ALF plugin
+Call on Policy Server of MM to free G Ram
+
+-->
+<goom_config>
+
+<!-- 	Low RAM and good RAM thresholds are defined here in kilobytes.
+	The max_app_close_batch indicates how many applications can be closed in parallel.
+	The value 1 means that applications are not closed in parallel.
+	default_wait_after_plugin defines how long is waited (in milliseconds) after
+	an GOOM plugin is called and before the free RAM is checked to determine if more
+	actions are needed. This value is meaningful only when "check" or "estimate" sync mode is
+	used with plugins.
+-->
+	<global_settings low_ram_threshold="3637" good_ram_threshold="10000" max_app_close_batch="3" default_wait_after_plugin="500">
+	</global_settings>
+
+<!--	Application specific low RAM and good RAM thresholds are defined here. The higher values of
+the low and good thresholds are defined to avoid GOOM errors with these applications when the default
+threshold values are used.
+-->
+	<app_specific_thresholds>
+
+  <app uid="101F857A" low_ram_threshold="26000" good_ram_threshold="28000" target_free_on_startup="26000"></app> <!-- Camera --> 
+  <app uid="200159B2" low_ram_threshold="5000" good_ram_threshold="10000" target_free_on_startup="26000"></app> <!-- MPlayer -->
+  <app uid="102824CD" low_ram_threshold="26000" good_ram_threshold="28000"></app> <!-- Embedded mplayer -->
+  <app uid="200009EE" low_ram_threshold="3637" good_ram_threshold="10000" target_free_on_startup="15000"></app> <!-- Photos -->
+
+	</app_specific_thresholds>
+
+<!--	The priority of closing each application is defined here.
+-->
+	<app_close_settings>
+<!--		The uid DEFAULT_APP refers to all applications, which priority is not specifically
+		defined in the conf file.
+-->
+		<close_app uid="DEFAULT_APP" priority="80" sync_mode="check">
+			<app_close_idle_priority idle_time="900" priority="50"></app_close_idle_priority>
+			<app_close_idle_priority idle_time="43200" priority="20"></app_close_idle_priority>
+		</close_app>
+<!--		The uid BUSY_APP refers to applications, which have set the OOM priority BUSY
+		by using the GOOM Monitor API SetGOomPriority(). The priority NEVER_CLOSE
+		means that the application is not closed at all.
+-->
+		<close_app uid="BUSY_APP" priority="NEVER_CLOSE" sync_mode="check"></close_app>
+<!--		The uid HIGH_PRIORITY_APP refers to applications, which have set the GOOM priority HIGH
+		by using the GOOM Monitor API SetGOomPriority().
+-->
+		<close_app uid="HIGH_PRIORITY_APP" priority="90" sync_mode="check">
+			<app_close_idle_priority idle_time="43200" priority="20"></app_close_idle_priority>
+		</close_app>
+	</app_close_settings>
+	
+<!--	The priority of executing each system plugin is defined here.
+	System plugin is a plugin, which priority is not related to any application.
+-->
+	<system_plugin_settings>
+<!--		The uid DEFAULT_PLUGIN refers to all plugins, which priority is not specificly
+		defined in the conf file.
+-->
+		<system_plugin uid="DEFAULT_PLUGIN" priority="10" sync_mode="check"></system_plugin>
+		<system_plugin uid="E4B6C988" priority="3" sync_mode="check"></system_plugin> <!-- ALFOOGMPLUGIN -->
+		<system_plugin uid="2002C30A" priority="5" sync_mode="check" wait="1000"></system_plugin> <!-- FLASHOOGMPLUGIN -->
+	</system_plugin_settings>
+	
+<!--	The priority of executing each application plugin is defined here.
+	Application plugin is a plugin, which priority depends on the target application.
+	The target application must be defined for each application plugin.
+	By default all plugins are system plugins unless specifically defined as application
+	plugin in this section.
+-->
+	<app_plugin_settings>
+	</app_plugin_settings>
+</goom_config>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/eabi/goommonitoru.DEF	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,28 @@
+EXPORTS
+	_Z20SetGMemoryMonitorTlsP14CMemoryMonitor @ 1 NONAME
+	_Z24CreateGOOMWatcherThreadLv @ 2 NONAME
+	_ZN19RGOomMonitorSession15SetGOomPriorityENS_13TGOomPriorityE @ 3 NONAME
+	_ZN19RGOomMonitorSession17RequestFreeMemoryEi @ 4 NONAME
+	_ZN19RGOomMonitorSession17RequestFreeMemoryEiR14TRequestStatus @ 5 NONAME
+	_ZN19RGOomMonitorSession18RequestOptionalRamEiiiR14TRequestStatus @ 6 NONAME
+	_ZN19RGOomMonitorSession18RequestOptionalRamEiiiRi @ 7 NONAME
+	_ZN19RGOomMonitorSession19ThisAppIsNotExitingEi @ 8 NONAME
+	_ZN19RGOomMonitorSession23CancelRequestFreeMemoryEv @ 9 NONAME
+	_ZN19RGOomMonitorSession7ConnectEv @ 10 NONAME
+	_ZN21CAppGOomMonitorPlugin4NewLE4TUid @ 11 NONAME
+	_ZN22CGOomMonitorPluginBase10ConstructLEv @ 12 NONAME
+	_ZN22CGOomMonitorPluginBase18ExtensionInterfaceE4TUidRPv @ 13 NONAME
+	_ZN22CGOomMonitorPluginBase9FsSessionEv @ 14 NONAME
+	_ZN22CGOomMonitorPluginBase9WsSessionEv @ 15 NONAME
+	_ZN22CGOomMonitorPluginBaseC2Ev @ 16 NONAME
+	_ZN22CGOomMonitorPluginBaseD0Ev @ 17 NONAME
+	_ZN22CGOomMonitorPluginBaseD1Ev @ 18 NONAME
+	_ZN22CGOomMonitorPluginBaseD2Ev @ 19 NONAME
+	_ZTI22CGOomMonitorPluginBase @ 20 NONAME
+	_ZTV22CGOomMonitorPluginBase @ 21 NONAME
+	_ZN19RGOomMonitorSession23ApplicationAboutToStartERK4TUid @ 22 NONAME
+	_ZN19RGOomMonitorSession11IsConnectedEv @ 23 NONAME
+	_ZN19RGOomMonitorSession22UsesAbsoluteMemTargetsEi @ 24 NONAME
+	_ZN19RGOomMonitorSession15AppAboutToStartER14TRequestStatusRK4TUid @ 25 NONAME
+	_ZN19RGOomMonitorSession7ConnectER14TRequestStatus @ 26 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,31 @@
+/*
+* 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:  Build information file for GOOM Monitor
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+../rom/goommonitor.iby CORE_MW_LAYER_IBY_EXPORT_PATH(goommonitor.iby)
+../data/goomconfig.xml  /epoc32/release/winscw/udeb/z/private/10207218/goomconfig.xml
+../data/goomconfig.xml  /epoc32/release/winscw/urel/z/private/10207218/goomconfig.xml
+../data/goomconfig.xml  /epoc32/data/z/private/10207218/goomconfig.xml
+
+PRJ_MMPFILES
+goommonitor.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/group/goommonitor.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,83 @@
+/*
+* 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:  Project definition file
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+TARGET          goommonitor.dll
+TARGETTYPE      dll
+UID             0x1000008D 0x10282DBF
+
+CAPABILITY      CAP_GENERAL_DLL
+VENDORID        VID_DEFAULT
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../CommonInc
+
+
+// This is a SYSTEMINCLUDE macro containing the middleware
+// layer specific include directories
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE /epoc32/include/libc
+
+SOURCEPATH      ../src
+SOURCE          goomIdletimerule.cpp
+SOURCE          goomaction.cpp
+SOURCE          goomactionconfig.cpp
+SOURCE          goomactionlist.cpp
+SOURCE          goomactionref.cpp
+SOURCE          goomappclosetimer.cpp
+SOURCE          goomappclosewatcher.cpp
+SOURCE          goomapplicationconfig.cpp
+SOURCE          goomcloseapp.cpp
+SOURCE          goomcloseappconfig.cpp
+SOURCE          goomconfig.cpp
+SOURCE          goomconfigparser.cpp
+SOURCE          goomforegroundrule.cpp
+SOURCE          goomglobalconfig.cpp
+SOURCE          goomlog.cpp
+SOURCE          goommemorymonitor.cpp
+SOURCE          goommemorymonitorserver.cpp
+SOURCE          goommemorymonitorsession.cpp
+SOURCE          goommonitor.cpp
+SOURCE          goommonitorplugin.cpp
+SOURCE          goommonitorsession.cpp
+SOURCE          goompanic.cpp
+SOURCE          goompluginwaiter.cpp
+SOURCE          goomrunplugin.cpp
+SOURCE          goomrunpluginconfig.cpp
+SOURCE          goomwindowgrouplist.cpp
+SOURCE          goomwserveventreceiver.cpp
+
+LIBRARY         euser.lib
+LIBRARY         apparc.lib
+LIBRARY         eikcore.lib
+LIBRARY         aknnotify.lib
+LIBRARY         apgrfx.lib
+LIBRARY         ws32.lib
+LIBRARY         bafl.lib
+LIBRARY         ecom.lib
+LIBRARY         hal.lib
+LIBRARY         efsrv.lib
+LIBRARY         xmlframework.lib
+LIBRARY         cone.lib
+LIBRARY			libEGL.lib
+LIBRARY			libc.lib
+
+#ifdef _DEBUG
+LIBRARY         flogger.lib
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomaction.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing GOOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#ifndef GOOMACTION_H_
+#define GOOMACTION_H_
+
+#include <e32base.h>
+
+class MGOomActionObserver;
+
+/*
+ * The base class for all GOOM actions (i.e. close application or run GOOM plug-in).
+ * 
+ * A base class is used because both types of action have common aspects, specifically:
+ *  - They are prioritised according to application idle time
+ *  - They need to be prioritised against each other
+ *  - For each action it is possible to either continue immediately or to wait for completion
+ *  
+ * @lib goommonitor.lib
+ * @since S60 v5.0
+ */
+NONSHARABLE_CLASS(CGOomAction) : public CBase
+    {
+public:
+
+    virtual ~CGOomAction();
+    
+    /**
+     * Activate the OOM action
+     *
+     * @since S60 5.0
+     * @param aBytesRequested ?description
+     */ 
+    virtual void FreeMemory(TInt aBytesRequested) = 0;
+    
+    /**
+     * @since S60 5.0
+     * @return ETrue if the action is currently freeing memory, else EFalse
+     */ 
+    virtual TBool IsRunning() = 0;
+    
+protected:
+    // 
+    /**
+     * To be called by the derived class after the memory has been freed (or if it fails)
+     * 
+     * @since S60 5.0
+     * @param aError KErrNone if memory has successfully been freed, otherwise any system wide error code
+     */ 
+    void MemoryFreed(TInt aError);
+    
+    CGOomAction(MGOomActionObserver& aStateChangeObserver);
+    
+private: //data
+    
+    enum TGOomActionState
+        {
+        EGOomIdle,
+        EGOomFreeingMemory
+        };  
+    TGOomActionState iState;
+
+protected:    
+    MGOomActionObserver& iStateChangeObserver;
+    };
+
+#endif /*GOOMACTION_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomactionconfig.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMACTIONCONFIG_
+#define GOOMACTIONCONFIG_
+
+#include <e32cmn.h>
+#include <e32std.h>
+#include <w32std.h>
+
+class MGOomRuleConfig;
+class CGOomWindowGroupList;
+
+enum TGOomSyncMode
+    {
+    EContinue,    // Continue with the next action regardless of anything else (exluding max_batch_size)
+    EEstimate,    // Continue with the next action if we estimate that we need to free more memory
+    ECheckRam,    // Wait for this action to complete, then check the free RAM before continuing
+    EContinueIgnoreMaxBatchSize // Continue with the next action regardless of anything else (including max_batch_size)
+    };
+
+NONSHARABLE_CLASS(CGOomActionConfig) : public CBase
+    {
+public:
+    // Add a rule
+    // This class takes ownership of the given rule
+    void AddRuleL(MGOomRuleConfig* aRule);    // Add the configuration for a rule (e.g. an idle time rule)
+            
+    virtual ~CGOomActionConfig();
+    
+    // Set the priority of this action
+    // This priority will be applied if none of the attached rules can be applied
+    inline void SetDefaultPriority(TUint aPriority);
+    
+protected:
+    
+    // Return the priority for this action for the idle time of the target app
+    TUint Priority(const CGOomWindowGroupList& aWindowGroupList, TInt aAppIndexInWindowGroup) const;
+    
+    void ConstructL();
+
+    CGOomActionConfig(TInt32 aId);
+    
+public:
+    
+    TGOomSyncMode iSyncMode;
+    
+    TInt iRamEstimate;    // The estimated RAM saving after performing this action
+    
+    TInt32 iId;        // The ID of the affected component (e.g. an application ID for app closure, or a plugin ID for a plugin event)
+    
+    TUint iDefaultPriority;
+    
+protected:    
+    
+    RPointerArray<MGOomRuleConfig> iRules;
+    };
+
+#include "goomactionconfig.inl"
+
+#endif /*GOOMACTIONCONFIG_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomactionconfig.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMACTIONCONFIGINL_H_
+#define GOOMACTIONCONFIGINL_H_
+
+// Set the priority of this action
+// This priority will be applied if none of the attached rules can be applied
+inline void CGOomActionConfig::SetDefaultPriority(TUint aPriority)
+    {
+    iDefaultPriority = aPriority;
+    }
+
+
+#endif /*GOOMACTIONCONFIGINL_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomactionlist.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,251 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing Graphics OOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#ifndef GOOMACTIONLIST_H_
+#define GOOMACTIONLIST_H_
+
+#include <e32def.h>
+#include <e32base.h>
+
+#include "goommonitorplugin.h"
+#include "goommemorymonitor.h"
+
+class CGOomWindowGroupList;
+class CMemoryMonitorServer;
+class CGOomCloseApp;
+class TActionRef;
+class CGOomRunPlugin;
+class CGOomConfig;
+
+/*
+ * Interface for reporting a change of state in a GOOM action
+ * e.g. that the action has changed from a freeing-memory state to an idle state
+ * 
+ * @lib oommonitor.lib
+ * @since S60 v5.0
+ */
+class MGOomActionObserver
+    {
+public:
+    virtual void StateChanged() = 0;
+    virtual TInt ClientId() = 0;
+    };
+
+
+template <class T> 
+/**
+ *  A class for getting instances of all of the GOOM ECom plugins
+ *  This class is templated because we actually need two types of list
+ *  One list for V1 plugins
+ *  One list for V2 plugins
+ *  The functionality of each list is nearly identical, hence the templated class
+ *  
+ * @lib oommonitor.lib
+ * @since S60 v5.0
+ */
+NONSHARABLE_CLASS(CGOomPluginList) : public CBase
+    {
+public:
+    
+    /**
+     * Two-phased constructor.
+     * @param aInterfaceUid The interface of the plugin (either V1 or V2) depending on the templated type
+     */
+    static CGOomPluginList* NewL(TInt aInterfaceUid);
+    inline TInt Count();
+    inline T& Implementation(TInt aIndex);
+    inline TInt32 Uid(TInt aIndex);
+    
+    ~CGOomPluginList();
+    
+private:
+    CGOomPluginList();
+    void ConstructL(TInt aInterfaceUid);
+    
+private: // data
+    
+    struct TPlugin
+        {
+        TPlugin();
+        T* iImpl;
+        TUid iDtorUid;
+        TInt32 iUid;
+        };
+    
+    RArray<TPlugin> iPlugins;
+    };
+
+    
+/*
+ * The list of possible OOM actions to be run.
+ * 
+ * This class is responsible for identifying the best action(s) to execute at a given time.
+ * This decision is based on the properties of each action and idle time of the target apps.
+ *
+ *  @lib oommonitor.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS(CGOomActionList) : public CBase, public MGOomActionObserver
+    {
+public:
+
+    /**
+     * Two-phased constructor.
+     * @param aMonitor the owning Memory Monitor
+     * @param aServer 
+     * @param aWs a handle to a window server session, opened by the Memory Monitor
+     * @param aConfig
+     */
+    static CGOomActionList* NewL(CMemoryMonitor& aMonitor, CMemoryMonitorServer& aServer, RWsSession& aWs, CGOomConfig& aConfig);
+
+    ~CGOomActionList();
+    
+    /**
+     * Creates a list of actions based on the contents of the config and the current window group list
+     * Any old actions will be replaced.
+     * 
+     * @since S60 5.0
+     * @param aWindowGroupList
+     * @param aConfig
+     */
+    void BuildPluginActionListL(CGOomWindowGroupList& aWindowGroupList, CGOomConfig& aConfig);    
+    void BuildKillAppActionListL(CGOomWindowGroupList& aWindowGroupList, CGOomConfig& aConfig);
+    
+    /**
+     * Execute the OOM actions according to their priority
+     * Actions are run in batches according to their sync mode
+     * 
+     * @since S60 5.0
+     * @param aMaxPriority The maximum priority of actions to run 
+     */     
+    void FreeMemory(TInt aMaxPriority);
+    
+    /**
+     * Sets the target; the maximum prioirity up to which actions are run when an GOomMonitor event 
+     * occurs
+     * 
+     * @since S60 5.0
+     * @param aCurrentTarget the prio
+     */    
+    inline void SetCurrentTarget(TUint aCurrentTarget);
+    
+    /**
+     * Should be called when the memory situation is good, i.e. the actions run have released enough memory 
+     * so that the device is above the current target.
+     * It results in notifications of the good memory state to all plugins
+     * 
+     * @since S60 5.0
+     */     
+    void MemoryGood();
+        
+    /**
+     * Checks the current memory level of the device and compares this with the current target
+     * 
+     * @since S60 5.0
+     * @param aFreeMemory the amount of free memory left on the device
+     * @return ETrue if the free memory is above the current target, else EFalse
+     */    
+    TBool FreeMemoryAboveTarget(TInt& aFreeMemory);
+        
+    /**
+     * Compares priorites of two actions, hard-coded rules are used to determine the order 
+     * of actions with equal priority:
+     * - application plugins are run in preference to system plugins
+     * - appliction plugins where the target app is not running are run first
+     * - Z order of the target app determines order of the rest of the application plugins (furthest back first)
+     * - system plugins are run before app close actions
+     * - Z order determines the prioirty of app close actions (furthest back first)
+     * 
+     * @since S60 5.0
+     */    
+    static TInt ComparePriorities(const TActionRef& aPos1, const TActionRef& aPos2 );
+
+    /**
+     * A callback from the UI framework that an applications has failed to respond to the close event.
+     * Allows us to cleanup the related app close action object and move on the next available action.
+     * 
+     * @since S60 5.0
+     * @param aWgId the window group ID of the application that has not closed.
+     */    
+    void AppNotExiting(TInt aWgId);
+    
+// from MGOomActionObserver
+
+    /**
+     * 
+     * from MGOomActionObserver
+     * 
+     * An action has changed state (possibly it has completed freeing memory)
+     */
+    void StateChanged();    
+    
+    /** The secure id of a client that requested free memory **/
+    TInt ClientId()
+        {
+        return iMonitor.ActiveClientId();
+        }
+    
+    void SetPriority(TInt aWgId, TInt aPriority);
+            
+private:
+    
+    CGOomActionList(CMemoryMonitor& aMonitor, CMemoryMonitorServer& aServer, RWsSession& aWs);
+    
+    void ConstructL(CGOomConfig& aConfig);
+    
+private: //data    
+    
+    RWsSession& iWs;
+    
+    RPointerArray<CGOomCloseApp> iCloseAppActions;
+    RPointerArray<CGOomRunPlugin> iRunPluginActions;
+    RArray<TActionRef> iActionRefs;
+    
+    TInt iCurrentActionIndex;
+        
+    TUint iCurrentTarget;
+
+    /*
+     * Flag specifying that a GOomMonitor event is in progress.
+     */
+    TBool iFreeingMemory;
+    
+    CMemoryMonitor& iMonitor;
+
+    /**
+     * The list of plugins
+     * Own
+     */
+    CGOomPluginList<CGOomMonitorPlugin>* iPluginList;
+
+    
+    /**
+     * The maximum priority of actions that should be run by an GOomMonitor Event
+     */
+    TInt iMaxPriority; 
+    
+    CMemoryMonitorServer& iServer;
+    
+    RArray<TUint> iAppsProtectedByPlugins;
+    
+    TBool iRunningKillAppActions;
+    };
+
+#include "goomactionlist.inl"
+
+#endif /*GOOMACTIONLIST_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomactionlist.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing Graphics OOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#ifndef GOOMACTIONLISTINL_H_
+#define GOOMACTIONLISTINL_H_
+
+template <class T>
+inline TInt CGOomPluginList<T>::Count()
+    {
+    return iPlugins.Count();
+    }
+    
+template <class T>
+inline T& CGOomPluginList<T>::Implementation(TInt aIndex)
+    {
+    return *(iPlugins[aIndex].iImpl);
+    }
+
+template <class T>
+inline TInt32 CGOomPluginList<T>::Uid(TInt aIndex)
+    {
+    return iPlugins[aIndex].iUid;
+    }
+    
+inline void CGOomActionList::SetCurrentTarget(TUint aCurrentTarget)
+    {
+    iCurrentTarget = aCurrentTarget;
+    }
+
+
+#endif /*GOOMACTIONLISTINL_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomactionref.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing Graphics OOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#ifndef GOOMACTIONREF_H_
+#define GOOMACTIONREF_H_
+
+#include <e32base.h>
+#include "goomactionconfig.h"
+
+class CGOomRunPlugin;
+
+/**
+ *  Encapsulates a reference to an action. 
+ *  
+ *  Objects of this T-class are instantiated at memory freeing time in preference to the  
+ *  CGOomAction derived objects, so that we do not instantiate anything on the heap at a time
+ *  when the device is, by-definition, low on memory.
+ *
+ *  @lib oommonitor.lib
+ *  @since S60 v5.0
+ */
+class TActionRef
+    {
+public:
+    
+    enum TActionType
+        {
+        EAppPlugin,
+        ESystemPlugin,
+        EAppClose
+        };
+
+    //constructor for Plugin actions
+    TActionRef(TActionType aType, TInt aPriority, TGOomSyncMode aSyncMode, TInt aRamEstimate, CGOomRunPlugin& aRunPlugin, TUint aWgIndexOfTargetApp);
+
+    //constructor for AppClose actions
+    TActionRef(TActionType aType, TInt aPriority, TGOomSyncMode aSyncMode, TInt aRamEstimate, TInt aWgId, TUint aWgIndex);
+    
+    TActionType Type() const;
+    TUint Priority() const;
+    void SetPriority(TUint);
+    TGOomSyncMode SyncMode() const;
+    TInt RamEstimate() const;
+    TInt WgId() const;
+    TInt WgIndex() const;
+    CGOomRunPlugin& RunPlugin();
+
+private: //data
+    
+    TActionType iType;
+    TUint iPriority;
+    TGOomSyncMode iSyncMode; //needed as we don't have reference to the config 
+    TInt iRamEstimate; //needed as we don't have reference to the config 
+    TInt iWgId; //For AppClose
+    TInt iWgIndex;
+    CGOomRunPlugin* iRunPlugin; //For Plugins. Not owned
+    };
+
+#endif /*GOOMACTIONREF_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomappclosetimer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Timer class which implements a timeout for an application close action
+*
+*/
+
+
+#ifndef GOOMAPPCLOSETIMER_H_
+#define GOOMAPPCLOSETIMER_H_
+
+#include <e32base.h>
+
+class CGOomCloseApp;
+
+/**
+ *  A simple timer class which implements a timeout for an application close action.
+ *
+ *  If the application has not been closed within the period this timer is started with, 
+ *  then we complete the action as if he had been successful, allowing us to move on to the 
+ *  action or set of actions.
+ *
+ *  @lib oommonitor.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS(CGOomAppCloseTimer) : public CTimer
+    {
+public:
+    static CGOomAppCloseTimer* NewL(CGOomCloseApp& aMonitor);
+    
+    enum TGOomAppCloseState
+        {
+        EGOomAppClosing = 0,
+        EGOomAppKilled
+        };
+    
+    void SetState(TGOomAppCloseState);
+    
+private:
+    CGOomAppCloseTimer(CGOomCloseApp& aMonitor);
+    void RunL();
+    
+private: //data
+	
+    /**
+     * A reference to the owning close app action
+     */
+    CGOomCloseApp& iMonitor;
+    
+    TBool iState;
+    };
+
+#endif /*GOOMAPPCLOSETIMER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomappclosewatcher.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 active object which watches for app close actions successfully completing
+*
+*/
+
+
+#ifndef GOOMAPPCLOSEWATCHER_H_
+#define GOOMAPPCLOSEWATCHER_H_
+
+#include <e32base.h>
+
+class CGOomCloseApp;
+class TApaTask;
+
+/**
+ *  This class implements an active object which watches for app close actions successfully completing.
+ *  
+ *  This watcher object logs-on to the thread of the application being closed and completes 
+ *  the app close action when the thread dies.  
+ *
+ *  @lib oommonitor.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS(CGOomAppCloseWatcher) : public CActive
+    {
+public:
+    CGOomAppCloseWatcher(CGOomCloseApp& aMonitor);
+    ~CGOomAppCloseWatcher();
+    void Start(const TApaTask& aTask);
+private:
+    void DoCancel();
+    void RunL();
+    
+private: //data
+
+    /**
+     * A reference to the owning close app action
+     */
+	CGOomCloseApp& iMonitor;
+
+    /**
+     * A handle to the main thread of the application to be closed.
+     */
+    RThread iThread;
+    
+    /**
+     * A backup of the orginal priority of the application's process
+     */
+    TProcessPriority iOriginalProcessPriority;
+    };
+
+#endif /*GOOMAPPCLOSEWATCHER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomapplicationconfig.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMAPPLICATIONCONFIG_
+#define GOOMAPPLICATIONCONFIG_
+
+#include <e32base.h>
+
+class CGOomCloseAppConfig;
+class MGOomRuleConfig;
+
+/*
+ * A list of action configurations for a particular target application.
+ *
+ * All configured actions in this list must be for the same target application.
+ * Actions may be configured to close the application or to run an OOM plugin.
+ *  
+ *  @lib oommonitor.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS(CGOomApplicationConfig) : public CBase
+    {
+public:
+    
+    /**
+     * Two-phased constructor
+     * @param aApplicationId the UID of the application
+     */
+	static CGOomApplicationConfig* NewL(TUint aApplicationId);
+    
+// Functions for getting configuration  
+    
+    /**
+     * Return a pointer to the close app config, this may be NULL if no app close config has been configured
+     * Ownership is NOT passed to the caller
+     */
+    inline CGOomCloseAppConfig* GetAppCloseConfig();
+        
+    inline TUint Id();
+    
+// Functions for setting configuration  
+
+    inline void SetAppCloseConfig(CGOomCloseAppConfig* aActionConfig);
+    
+    /**
+     * Add a rule
+     * 
+     * This class takes ownership of the given rule
+     * The rule would will apply to the "application close" event
+     */
+    void AddRuleL(MGOomRuleConfig* aRule);
+    
+    ~CGOomApplicationConfig();
+
+public:
+    
+    TUint iGoodRamThreshold;
+    TUint iLowRamThreshold; 
+    TUint iTargetFree;
+    
+private:
+    
+    void ConstructL();
+    
+    CGOomApplicationConfig(TUint aApplicationId);
+    
+    CGOomCloseAppConfig* iCloseAppConfig;
+    
+    TInt iIndex;
+    
+    TUint iApplicationId;
+    };
+
+#include "goomapplicationconfig.inl"
+
+#endif /*GOOMAPPLICATIONCONFIG_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomapplicationconfig.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMAPPLICATIONCONFIGINL_H_
+#define GOOMAPPLICATIONCONFIGINL_H_
+
+#include "goompanic.h"
+
+inline CGOomCloseAppConfig* CGOomApplicationConfig::GetAppCloseConfig()
+    {
+    return iCloseAppConfig;
+    }
+
+inline void CGOomApplicationConfig::SetAppCloseConfig(CGOomCloseAppConfig* aActionConfig)
+    {
+    __ASSERT_ALWAYS(iCloseAppConfig == NULL, GOomMonitorPanic(KSameAppClosureConfiguredTwice));
+    
+    iCloseAppConfig = aActionConfig;
+    }
+
+
+inline TUint CGOomApplicationConfig::Id()
+    {
+    return iApplicationId;
+    }
+
+#endif /*GOOMAPPLICATIONCONFIGINL_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomcloseapp.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing GOOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#ifndef GOOMCLOSEAPP_H_
+#define GOOMCLOSEAPP_H_
+
+
+#include <apgtask.h>
+
+#include "goomaction.h"
+
+class CGOomAppCloseTimer;
+class CGOomAppCloseWatcher;
+class TApaTask;
+class TActionRef;
+
+/*
+ * The OOM action of closing an application in order to free up memory.
+ *
+ *  @lib oommonitor.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS(CGOomCloseApp) : public CGOomAction
+    {
+public:
+    /**
+     * Two-phased constructor.
+     * @param aStateChangeObserver an observer to the state of the application
+     * @param aWs a connected handle to a window server session
+     */
+    static CGOomCloseApp* NewL(MGOomActionObserver& aStateChangeObserver, RWsSession& aWs);
+        
+    //from CGOomAction
+    
+    /**
+     * Close the application in order to free memory
+     * Call the CGOomAction::MemoryFreed when it is done
+     * @param aBytesRequested not used for clsoe app actions
+     */
+    virtual void FreeMemory(TInt aBytesRequested);
+    
+    ~CGOomCloseApp();
+    
+    /**
+     * Callback from CGOomAppCloseWatcher and CGOomAppCloseTimer
+     */
+    void CloseAppEvent();
+    
+    inline TBool IsRunning();
+
+    /**
+     * Configure, or reconfigure the CGOomCloseApp object
+     * Action objects are reused to minimize any memory allocation when memory is low
+     */
+    void Reconfigure(const TActionRef& aRef);
+
+    inline TUint WgId() const;
+    
+    /** When the gentle push is not enough (i.e. force is required) **/
+    void KillTask();
+    
+    void KillTaskWaitDone();
+    
+private:
+    
+    CGOomCloseApp(MGOomActionObserver& aStateChangeObserver, RWsSession& aWs);
+    
+    void ConstructL();
+    
+    TUint iWgId;
+        
+    TBool iAppCloserRunning;
+    TApaTask iCurrentTask;
+
+    /**
+     * A timeout for an app close action
+     * Own
+     */
+    CGOomAppCloseTimer* iAppCloseTimer;
+
+    /**
+     * A watcher for the application closing
+     * Own
+     */
+    CGOomAppCloseWatcher* iAppCloseWatcher; 
+    };
+
+#include "goomcloseapp.inl"
+
+#endif /*GOOMCLOSEAPP_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomcloseapp.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing GOOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#ifndef GOOMCLOSEAPPINL_H_
+#define GOOMCLOSEAPPINL_H_
+
+inline TBool CGOomCloseApp::IsRunning()
+    {
+    return iAppCloserRunning;
+    }
+
+inline TUint CGOomCloseApp::WgId() const
+    {
+    return iWgId;
+    }
+
+#endif /*GOOMCLOSEAPPINL_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomcloseappconfig.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMCLOSEAPPCONFIG_
+#define GOOMCLOSEAPPCONFIG_
+
+#include "goomactionconfig.h"
+
+/*
+ * 
+ */
+/**
+ *  The GOOM action of closing an application in order to free up memory.
+ *
+ *  @lib goommonitor.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS(CGOomCloseAppConfig) : public CGOomActionConfig
+    {
+public:
+    /**
+     * Two-phased constructor.
+     * @param aId The Uid of the applicaton
+     */
+    static CGOomCloseAppConfig* NewL(TInt32 aId);
+    
+    ~CGOomCloseAppConfig();
+
+    /**
+     * Calculates the priority of a close app action, based on its position on the window group list
+     * 
+     * @param aWindowGroupList a fully constructed, collapsed window group list
+     * @param aAppIndexInWindowGroup the position in the window group list
+     */
+    inline TUint CalculateCloseAppPriority(const CGOomWindowGroupList& aWindowGroupList, TUint aAppIndexInWindowGroup);
+    
+private:
+    
+    CGOomCloseAppConfig(TInt32 aId);
+    };
+
+#include "goomcloseappconfig.inl"
+
+#endif /*GOOMCLOSEAPPCONFIG_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomcloseappconfig.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMCLOSEAPPCONFIGINL_H_
+#define GOOMCLOSEAPPCONFIGINL_H_
+
+inline TUint CGOomCloseAppConfig::CalculateCloseAppPriority(const CGOomWindowGroupList& aWindowGroupList, TUint aAppIndexInWindowGroup)
+    {
+    // Calculating the priority for application closures is simple, we just get the base class to apply the rules
+    return Priority(aWindowGroupList, aAppIndexInWindowGroup);
+    }
+
+#endif /*GOOMCLOSEAPPCONFIGINL_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomconfig.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMCONFIG_
+#define GOOMCONFIG_
+
+#include <e32base.h>
+
+#include "goomglobalconfig.h"
+
+class CGOomCloseAppConfig;
+class CGOomRunPluginConfig;
+class MGOomRuleConfig;
+class CGOomApplicationConfig;
+
+/*
+ * A class representing the entire configuration.
+ */
+NONSHARABLE_CLASS(CGOomConfig) : public CBase
+    {
+public:
+    
+    static CGOomConfig* NewL();
+    
+// Functions for setting configuration  
+    
+    // Add the configuration for an application closure.
+    // This class takes ownership of this configuration object.
+    void SetAppCloseConfigL(CGOomCloseAppConfig* aActionConfig);
+    
+    // Add the configuration for a plugin action.
+    // This class takes ownership of the configuration object.
+    void AddPluginConfigL(CGOomRunPluginConfig* aPluginConfig);
+    
+    // Add a rule for an application
+    // This class takes ownership of the given rule
+    // This rule applies to the specified application (and not a plugin associated with this application)
+    // The rule would usually apply to an "application close" event
+    void AddApplicationRuleL(TUint aTargetAppId, MGOomRuleConfig* aRule);
+    
+    // Add a rule for a plugin
+    // This class takes ownership of the given rule
+    // This rule is applied to the plugin with the specified ID
+    void AddPluginRuleL(TUint aPluginId, MGOomRuleConfig* aRule);    
+    
+    // Add this application config - this class takes ownership of it
+    // Application config includes settings for a particular application, e.g. whether or not it can be closed
+    void AddApplicationConfigL(CGOomApplicationConfig* aApplicationConfig);
+    
+// Functions for getting configuration  
+    
+    // Get the application configuration for the given app id
+    // If no specific actions have been configured for this application then the default application configuration is returned
+    CGOomApplicationConfig& GetApplicationConfig(TInt32 aAppId);
+    
+    // Get the plugin configuration for the given plugin id
+    // If no specific actions have been configured for this plugin then the default plugin configuration is returned
+    CGOomRunPluginConfig& GetPluginConfig(TInt32 aPluginId);
+        
+// Functions for setting global configuration   
+    
+    ~CGOomConfig();
+    
+    inline CGOomGlobalConfig& GlobalConfig();
+    
+    inline void SetDefaultLowRamThreshold(TInt aLowRamThreshold);
+    inline void SetDefaultGoodRamThreshold(TInt aGoodRamThreshold);
+    inline void SetMaxCloseAppBatch(TUint MaxCloseAppBatch);
+    inline void SetDefaultWaitAfterPlugin(TInt aMilliseconds);
+    
+private:
+    void ConstructL();
+    
+    RHashMap<TInt32, CGOomApplicationConfig*> iApplicationToConfigMapping; // A hash-map of application configs, keyed on the application ID
+    
+    RHashMap<TInt32, CGOomRunPluginConfig*> iPluginToConfigMapping; // A hash-map of plug-in configs, keyed on the plugin ID
+
+    CGOomGlobalConfig iGlobalConfig;
+    };
+
+#include "goomconfig.inl"
+
+#endif /*GOOMCONFIG_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomconfig.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMCONFIGINL_H_
+#define GOOMCONFIGINL_H_
+
+inline CGOomGlobalConfig& CGOomConfig::GlobalConfig()
+    {
+    return iGlobalConfig;
+    }
+
+void CGOomConfig::SetDefaultLowRamThreshold(TInt aLowRamThreshold)
+    {
+    iGlobalConfig.iLowRamThreshold = aLowRamThreshold;
+    }
+
+void CGOomConfig::SetDefaultGoodRamThreshold(TInt aGoodRamThreshold)
+    {
+    iGlobalConfig.iGoodRamThreshold = aGoodRamThreshold;
+    }
+
+void CGOomConfig::SetMaxCloseAppBatch(TUint aMaxCloseAppBatch)
+    {
+    iGlobalConfig.iMaxCloseAppBatch = aMaxCloseAppBatch;
+    }
+void CGOomConfig::SetDefaultWaitAfterPlugin(TInt aMilliseconds)
+    {
+    iGlobalConfig.iDefaultWaitAfterPlugin = aMilliseconds;
+    }
+
+#endif /*OOMCONFIGINL_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomconfigparser.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 parser for the GOOM configuration file
+*
+*/
+
+
+#ifndef GOOMCONFIGPARSER_H_
+#define GOOMCONFIGPARSER_H_
+
+#include <xml/contenthandler.h>
+
+using namespace Xml;
+
+class CGOomConfig;
+class CGOomRunPluginConfig;
+
+NONSHARABLE_CLASS(CGOomConfigParser) : public CBase, public MContentHandler 
+    {
+public:
+    CGOomConfigParser(CGOomConfig& aConfig, RFs& aFs);
+    
+    void ParseL();
+
+    
+    // From MContent handler
+    virtual void OnStartDocumentL(const RDocumentParameters& aDocParam, TInt aErrorCode);
+    virtual void OnEndDocumentL(TInt aErrorCode);
+    virtual void OnStartElementL(const RTagInfo& aElement, const RAttributeArray& aAttributes, 
+                                 TInt aErrorCode);
+    virtual void OnEndElementL(const RTagInfo& aElement, TInt aErrorCode);
+    virtual void OnContentL(const TDesC8& aBytes, TInt aErrorCode);
+    virtual void OnStartPrefixMappingL(const RString& aPrefix, const RString& aUri, 
+                                       TInt aErrorCode);
+    virtual void OnEndPrefixMappingL(const RString& aPrefix, TInt aErrorCode);
+    virtual void OnIgnorableWhiteSpaceL(const TDesC8& aBytes, TInt aErrorCode);
+    virtual void OnSkippedEntityL(const RString& aName, TInt aErrorCode);
+    virtual void OnProcessingInstructionL(const TDesC8& aTarget, const TDesC8& aData, 
+                                          TInt aErrorCode);
+    virtual void OnError(TInt aErrorCode);
+    virtual TAny* GetExtendedInterface(const TInt32 aUid);
+    
+    
+    
+private:
+    
+    void ConfigError(TInt aError);
+    
+    
+    
+    TInt StartElementL(const TDesC8& aLocalName, 
+                          const RAttributeArray& aAttributes);
+    
+    void SetGlobalSettings(const RAttributeArray& aAttributes);
+    void SetForceCheckConfigL(const RAttributeArray& aAttributes);
+    void SetAppConfigL(const RAttributeArray& aAttributes);
+    void SetCloseAppConfigL(const RAttributeArray& aAttributes);
+    void SetAppCloseIdlePriorityConfigL(const RAttributeArray& aAttributes);
+    void SetForegroundAppPriorityL(const RAttributeArray& aAttributes);
+    
+    void SetSystemPluginConfigL(const RAttributeArray& aAttributes);
+    void SetAppPluginConfigL(const RAttributeArray& aAttributes);
+    void SetPluginIdlePriorityL(const RAttributeArray& aAttributes);
+    void SetPluginForegroundAppPriorityL(const RAttributeArray& aAttributes);
+    
+    TInt GetValueFromAttributeList(const RAttributeArray& aAttributes, const TDesC8& aName, TPtrC8& aValue);
+    TInt GetValueFromHexAttributeList(const RAttributeArray& aAttributes, const TDesC8& aName, TUint& aValue);
+    TInt GetValueFromDecimalAttributeList(const RAttributeArray& aAttributes, const TDesC8& aName, TUint& aValue);
+    TInt GetValueFromDecimalAttributeList(const RAttributeArray& aAttributes, const TDesC8& aName, TInt& aValue);
+    
+    void SetPluginSyncMode(const RAttributeArray& aAttributes, CGOomRunPluginConfig& aRunPluginConfig);
+
+    enum TGOomParsingState
+        {
+        EGOomParsingStateNone,
+        EGOomParsingStateRoot,
+        EGOomParsingStateGlobalSettings,
+        EGOomParsingStateAppSettings,
+        EGOomParsingStateAppCloseSettings,
+        EGOomParsingStateSystemPluginSettings,
+        EGOomParsingStateAppPluginSettings
+        };    
+    
+    // Check that the current state is as expected
+    // If not then the specified config error is generated
+    void CheckState(TGOomParsingState aExpectedState, TInt aError);
+    
+    // Check that the current state is as expected
+    // If not then the specified config error is generated
+    // This version checks to ensure that the current state matches either of the passed in states
+    void CheckState(TGOomParsingState aExpectedState1, TGOomParsingState aExpectedState2, TInt aError);
+    
+    CGOomConfig& iConfig;
+    
+    RFs& iFs;
+    
+    void ChangeState(TGOomParsingState aState);    
+    
+    TGOomParsingState iState;
+    
+    TUint iParentUid;
+    TUint iParentTargetApp;
+    };
+
+#endif /*GOOMCONFIGPARSER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomconstants.hrh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 Monitor Constants
+*
+*/
+
+
+#ifndef GOOMCONSTANTS_HRH_
+#define GOOMCONSTANTS_HRH_
+
+const TInt KAppNotInWindowGroupList = -1;
+
+const TInt KGOomDefaultAppId = 0;
+const TInt KGOomDefaultPluginId = 0;
+const TInt KGOomThresholdUnset = 0;
+
+const TInt KGOomBusyAppId = 0x10286A84;
+const TInt KGOomHighPriorityAppId = 0x10286A85;
+
+const TInt KGOomPriorityInfinate = 1024;
+
+// same as Akncapserver since fast swap is contained in it
+const TUid  KUidFastSwap = { 0x10207218 };
+const TUid  KUidPenInputServer = { 0x10281855 };
+
+
+#endif /*GOOMCONSTANTS_HRH_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomforegroundrule.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMFOREGROUNDRULE_
+#define GOOMFOREGROUNDRULE_
+
+#include <e32base.h>
+#include "goomruleconfig.h"
+
+// A class to modify the priority if a particular application is in the foreground
+NONSHARABLE_CLASS(CGOomForegroundRule) : public CBase, public MGOomRuleConfig
+    {
+public:
+    // If the specified target app is in the foreground then apply the specified priority
+    CGOomForegroundRule(TInt aTargetAppId, TInt aPriority);
+    
+    TBool RuleIsApplicable(const CGOomWindowGroupList& aWindowGroupList, TInt aAppIndexInWindowGroup) const;
+
+    inline TUint Priority() const;
+        
+private:
+    TInt iTargetAppId;
+    TInt iPriority; // The priority to apply if the specified app is in the foreground
+    };
+
+#include "goomforegroundrule.inl"
+
+#endif /*GOOMFOREGROUNDRULE_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomforegroundrule.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMFOREGROUNDRULEINL_H_
+#define GOOMFOREGROUNDRULEINL_H_
+
+
+inline TUint CGOomForegroundRule::Priority() const
+    {
+    return iPriority;
+    }
+
+#endif /*GOOMFOREGROUNDRULEINL_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomglobalconfig.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMGLOBALCONFIG_
+#define GOOMGLOBALCONFIG_
+
+#include <e32base.h>
+#include <e32hashtab.h>
+
+NONSHARABLE_CLASS(CGOomGlobalConfig) : public CBase
+    {
+public:
+    ~CGOomGlobalConfig();
+    
+    inline void AddForceCheckPriorityL(TUint aPriority);
+    
+    // Return ETrue if a force check has been added for this priority, return EFalse otherwise
+    inline TBool ForceCheckAtPriority(TUint aPriority) const;
+    
+public:
+    TInt iLowRamThreshold;
+    TInt iGoodRamThreshold;
+    TUint iMaxCloseAppBatch;
+    TInt iDefaultWaitAfterPlugin;
+    
+    RHashSet<TUint> iForceCheckPriorities;
+    };
+
+#include "goomglobalconfig.inl"
+
+#endif /*GOOMGLOBALCONFIG_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomglobalconfig.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMGLOBALCONFIGINL_H_
+#define GOOMGLOBALCONFIGINL_H_
+
+void CGOomGlobalConfig::AddForceCheckPriorityL(TUint aPriority)
+    {
+    iForceCheckPriorities.InsertL(aPriority);
+    }
+
+// Return ETrue if a force check has been added for this priority, return EFalse otherwise
+TBool CGOomGlobalConfig::ForceCheckAtPriority(TUint aPriority) const
+    {
+    return (iForceCheckPriorities.Find(aPriority) != NULL);
+    }
+
+#endif /*GOOMGLOBALCONFIGINL_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomidletimerule.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMIDLETIMERULE_
+#define GOOMIDLETIMERULE_
+
+#include <e32base.h>
+
+#include "goomruleconfig.h"
+
+NONSHARABLE_CLASS(CGOomIdleTimeRule) : public CBase, public MGOomRuleConfig
+    {
+public:
+    static CGOomIdleTimeRule* NewL(TTimeIntervalSeconds aIdleTime, TInt aPriority);
+    
+    TBool RuleIsApplicable(const CGOomWindowGroupList& aWindowGroupList, TInt aAppIndexInWindowGroup) const;
+
+    inline TUint Priority() const;
+    
+    ~CGOomIdleTimeRule();
+    
+private:
+    CGOomIdleTimeRule(TTimeIntervalSeconds aIdleTime, TInt aPriority);
+    
+private:
+    TTimeIntervalSeconds iIdleTime; // The idle time after which to apply the given priority
+    TInt iPriority; // The priority to apply after the given idle time
+    };
+
+#include "goomidletimerule.inl"
+
+#endif /*GOOMIDLETIMERULE_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomidletimerule.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMIDLETIMERULEINL_H_
+#define GOOMIDLETIMERULEINL_H_
+
+inline TUint CGOomIdleTimeRule::Priority() const
+    {
+    return iPriority;
+    }
+
+#endif /*GOOMIDLETIMERULEINL_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomlog.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Logging functionality for GOOM monitor profiling
+*
+*/
+
+#ifndef GOOMLOG_H_
+#define GOOMLOG_H_
+
+#ifdef _DEBUG
+
+#include <apgwgnam.h>
+
+#include "goomwindowgrouplist.h"
+
+const TUint KTimeBetweenMemorySamples = 100000; // In microseconds
+const TUint KSamplingDurationUint = 3000000;
+
+const TUint KMaxBytesOfLoggingPerSample = 20;
+
+NONSHARABLE_CLASS(CGOomLogger) : public CTimer
+    {
+public:
+    static CGOomLogger* NewL(RWsSession& aWs, RFs& aFs);
+    
+    // Start logging the available memory every n micro seconds
+    // Firstly a list of the app IDs is written to the log (foreground app first)
+    // Note that the log is created in memory (to a pre-allocated buffer) and flushed out after it is complete
+    // the samples are saved in CSV format so that they can easily be cut and pasted to plot graphs etc.
+    void StartL();
+    
+// From CTimer / CActice
+    void RunL();
+    void DoCancel();
+    
+    ~CGOomLogger();
+    
+    void Write(const TDesC8& aBuffer);
+    
+protected:
+    void LogApplicationIds();
+    void LogFreeMemory();
+    
+    CGOomLogger(RWsSession& aWs, RFs& aFs);
+    void ConstructL();
+    
+    // Duplicated functionality from GOomMonitor
+    // Duplicated because it was messy to reuse it and to minimise changes to OOM monitor during development of new features
+    void ColapseWindowGroupTree();
+    
+    TUid GetUidFromWindowGroupId(TInt aWgId);
+
+    RWsSession& iWs;    
+    
+    // Used to get a list of open applications
+    RArray<RWsSession::TWindowGroupChainInfo> iWgIds;
+    CApaWindowGroupName* iWgName;
+    HBufC* iWgNameBuf;              // owned by iWgName
+    
+    RFs& iFs;
+    
+    RFile iFile;
+    TBool iIsOpen;
+    
+    // The time when the logging was started
+    TTime iStartTime;
+    
+    TBuf8<(KSamplingDurationUint / KTimeBetweenMemorySamples) * KMaxBytesOfLoggingPerSample> iWriteBuffer;
+    };
+
+#endif //_DEBUG
+
+#endif /*OOMLOG_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goommemorymonitor.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,179 @@
+/*
+* 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:  Main classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMMEMORYMONITOR_H
+#define GOOMMEMORYMONITOR_H
+
+#include <e32property.h>
+#include <f32file.h>
+#include <w32std.h>
+#include <EGL/egl.h>
+#include "goomglobalconfig.h"
+#include "goomwindowgrouplist.h"
+
+// ---------------------------------------------------------
+// CMemoryMonitor
+// ---------------------------------------------------------
+//
+class CGOomMonitorPlugin;
+class CMemoryMonitorServer;
+class CWservEventReceiver;
+class CGOomActionList;
+class CGOomLogger;
+class CGOomConfig;
+class CGoomThresholdCrossed;
+
+typedef EGLBoolean (*NOK_resource_profiling)(EGLDisplay, EGLint, EGLint*, EGLint, EGLint*);
+
+NONSHARABLE_CLASS(CMemoryMonitor) : public CBase
+    {
+public:
+    static CMemoryMonitor* NewL();
+    ~CMemoryMonitor();
+
+public: // event handlers
+    void FreeMemThresholdCrossedL(TInt aAction = 0, TInt aThreshold = 0);
+    void AppNotExiting(TInt aWgId);
+    void StartFreeSomeRamL(TInt aTargetFree);
+    void FreeOptionalRamL(TInt aTargetFree, TInt aPluginId, TBool aUseAbsolute = EFalse); // The ID of the plugin that will clear up the allocation, used to determine the priority of the allocation
+    void RequestFreeMemoryL(TInt aTargetFree, TBool aUseAbsolute = EFalse);
+    void HandleFocusedWgChangeL(TInt aForegroundAppUid = KErrNotFound);
+    static const CGOomGlobalConfig& GlobalConfig();
+    void SetPriorityBusy(TInt aWgId);
+    void SetPriorityNormal(TInt aWgId);
+    void SetPriorityHigh(TInt aWgId);
+    void ResetTargets(TInt aTarget = 0);
+    TInt GetFreeMemory();
+    void RunCloseAppActions(TInt aMaxPriority);
+    CGOomWindowGroupList * GetWindowGroupList() const;
+        
+    
+    void SetActiveClient(TInt aClientId)
+        {
+        iActiveClientId = aClientId;
+        }  
+    
+    TInt ActiveClientId()
+        {
+        return iActiveClientId;
+        }
+
+    TInt ForegroundAppUid()
+        {
+        return iForegroundAppUid;
+        } 
+    void SessionInCriticalAllocation(TBool aPostponeMemGood)
+        {
+        if (aPostponeMemGood)
+            {
+            iPostponeMemGood++;
+            }
+        else
+            {
+            iPostponeMemGood--;
+            if(iPostponeMemGood<0)
+                {
+                iPostponeMemGood = 0;
+                }
+            }
+                        
+        if (iPostponeMemGood == 0)
+            {
+            DoPostponedMemoryGood();
+            }
+        
+        } 
+    
+    void DoPostponedMemoryGood();
+    
+    TBool NeedToPostponeMemGood()
+        {
+        return (iPostponeMemGood != 0);
+        } 
+    
+private:
+    CMemoryMonitor();
+    void ConstructL();
+    TBool FreeGraphicsMemoryAboveThresholdL(TInt& aCurrentFreeMemory);
+    void CloseNextApp();
+    void RefreshThresholds(TInt aForegroundAppUid = KErrNotFound);
+    void StartFreeSomeRamL(TInt aTargetFree, TInt aMaxPriority);
+    void AppClosePriorityChanged(TInt aWgId, TInt aPriority);
+    
+public:
+    // All members are owned
+    // generally useful sessions
+    RFs iFs;
+    RWsSession iWs;
+
+private: //data
+
+    // parameters for GOOM watcher.
+    TInt iLowThreshold;
+    TInt iGoodThreshold;
+    TInt iCurrentTarget;
+        
+    // event receivers
+    CWservEventReceiver* iWservEventReceiver;
+
+    /**
+     * The Memory Monitor Server
+     * Own.       
+     */
+    CMemoryMonitorServer* iServer;
+    
+#ifdef _DEBUG    
+    /**
+     * GOom logging tool - samples free memory for profiling
+     * Own.       
+     */
+    CGOomLogger* iLogger;
+#endif
+    
+    /**
+     * A list of window group Ids, with child window groups removed such that there is one Id per application
+     * Own.       
+     */    
+    CGOomWindowGroupList* iGOomWindowGroupList;
+    
+    /**
+     * The object responsible for identifying the best actions to run, and running them 
+     * Own.       
+     */
+    CGOomActionList* iGOomActionList;
+    
+    /**
+     * The entire GOom Monitor configuration
+     * Own.       
+     */
+    CGOomConfig* iConfig;
+    
+    // resource profiling extension function ptr
+    NOK_resource_profiling eglQueryProfilingData;
+    
+    TInt iActiveClientId;
+    
+    // could use pointer array
+    CGoomThresholdCrossed* iMemAllocationsGrowing;
+    CGoomThresholdCrossed* iMemAllocationsGoingDown;
+    
+    TInt iForegroundAppUid;
+    TInt iPostponeMemGood;
+    };
+
+#endif /*GOOMMEMORYMONITOR_H*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goommemorymonitorserver.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* 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:  Main classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMMEMORYMONITORSERVER_H
+#define GOOMMEMORYMONITORSERVER_H
+
+#include <e32base.h>
+
+class CMemoryMonitor;
+
+NONSHARABLE_CLASS(CMemoryMonitorServer) : public CServer2
+    {
+public:
+    static CMemoryMonitorServer* NewL(CMemoryMonitor& aMonitor);
+    ~CMemoryMonitorServer();
+
+    CMemoryMonitor& Monitor();
+    void CloseAppsFinished(TInt aBytesFree, TBool aMemoryGood);
+
+private:
+    CMemoryMonitorServer(CMemoryMonitor& aMonitor);
+    void ConstructL();
+    CSession2* NewSessionL(const TVersion& aVersion,const RMessage2& aMessage) const;
+    TInt RunError(TInt aError);
+
+private:
+    CMemoryMonitor& iMonitor;
+    };
+
+#endif /*GOOMMEMORYMONITORSERVER_H*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goommemorymonitorsession.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* 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:  Main classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMMEMORYMONITORSESSION_H
+#define GOOMMEMORYMONITORSESSION_H
+
+#include <e32base.h>
+
+class CMemoryMonitorServer;
+class CMemoryMonitor;
+
+NONSHARABLE_CLASS(CMemoryMonitorSession) : public CSession2
+    {
+public:
+    CMemoryMonitorSession();
+    void CreateL();
+    void CloseAppsFinished(TInt aBytesFree, TBool aMemoryGood);
+
+private:
+    ~CMemoryMonitorSession();
+    CMemoryMonitorServer& Server();
+    CMemoryMonitor& Monitor();
+    void ServiceL(const RMessage2& aMessage);
+
+private:
+    RMessagePtr2 iRequestFreeRam;
+    TInt iFunction;
+    TInt iMinimumMemoryRequested;
+    TBool iUseAbsoluteTargets;
+    };
+
+#endif /*GOOMMEMORYMONITORSESSION_H*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goommonitorclientserver.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 client / server classes allowing clients to make requests to OOM monitor
+*
+*/
+
+
+#ifndef GOOMMONITORCLIENTSERVER_H
+#define GOOMMONITORCLIENTSERVER_H
+
+#include <e32std.h>
+
+enum TGOomMonitorClientPanic
+    {
+    EPanicIllegalFunction,
+    EPanicRequestActive
+    };
+
+void PanicClient(const RMessagePtr2& aMessage,TGOomMonitorClientPanic aPanic);
+
+_LIT(KGraphicsMemoryMonitorServerName, "GOomMonitorServer");
+
+enum TGOomMonitorCmd
+    {
+    EGOomMonitorRequestFreeMemory,
+    EGOomMonitorCancelRequestFreeMemory,
+    EGOomMonitorThisAppIsNotExiting,
+    EGOomMonitorRequestOptionalRam,
+    EGOomMonitorSetPriorityBusy,
+    EGOomMonitorSetPriorityNormal,
+    EGOomMonitorSetPriorityHigh,
+    EGoomMonitorAppAboutToStart,
+    EGoomMonitorAppUsesAbsoluteMemTargets
+    };
+
+#endif // GOOMMONITORCLIENTSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goompanic.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Panic codes for GOOM monitor
+*
+*/
+
+
+#ifndef GOOMPANIC_
+#define GOOMPANIC_
+
+#include <e32def.h>
+
+enum TGOomMonitorPanic
+    {
+    KRuleConfiguredBeforeApplication,
+    KCloseAppActionIsResued,
+    KAppConfigAddedTwice,
+    KSameAppClosureConfiguredTwice,
+    KGOomDefaultAppCloseNotConfigured,
+    KPluginConfigAddedTwice,
+    KRuleConfiguredBeforePlugin,
+    KGOomDefaultAppNotConfigured,
+    KGOomDefaultPluginNotConfigured,
+    KNoCoeEnvFound,
+    KInvalidWgName,
+    KGOomInvalidPriority,
+    KAppCloseActionEqualPriorities,
+    KEGLProfilingExtensionNotAvailable
+    };
+
+void GOomMonitorPanic(TGOomMonitorPanic aReason);
+void GOomConfigParserPanic(TInt aReason);
+
+#endif /*OOMPANIC_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goompluginwaiter.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing GOOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#ifndef GOOMPLUGINWAITER_H_
+#define GOOMPLUGINWAITER_H_
+
+#include <e32base.h>
+
+class CGOomRunPlugin;
+
+
+/*
+ *  A class used for waiting for a pre-determined period before completing the plugin operation
+ *  It is intended to be used to force a delay between the call to the plugin and the memory check,
+ *  thus allowing the plugin to free some memory first.
+ * 
+ *  @lib goommonitor.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS(CGOomPluginWaiter) : public CTimer
+    {
+public:
+    static CGOomPluginWaiter* NewL(TInt aMillisecondsToWait, CGOomRunPlugin& aCallbackClass);
+    
+    // Start the timer, it will call the plugin back when it expires
+    void Start();
+    
+protected:
+    void RunL();
+    
+    CGOomPluginWaiter(TInt aMillisecondsToWait, CGOomRunPlugin& aCallbackClass);
+    
+private:
+    TInt iMillisecondsToWait;
+    CGOomRunPlugin& iCallbackClass;
+    };
+
+#endif /*GOOMPLUGINWAITER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomruleconfig.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMRULECONFIG_
+#define GOOMRULECONFIG_
+
+#include <e32std.h>
+
+class CGOomWindowGroupList;
+
+NONSHARABLE_CLASS(MGOomRuleConfig)
+    {
+public:
+    virtual TBool RuleIsApplicable(const CGOomWindowGroupList& aWindowGroupList, TInt aAppIndexInWindowGroup) const = 0;
+    virtual TUint Priority() const = 0;
+    };
+
+#endif /*GOOMRULECONFIG_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomrunplugin.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing GOOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#ifndef GOOMRUNPLUGIN_H_
+#define GOOMRUNPLUGIN_H_
+
+#include "goomaction.h"
+
+class CGOomRunPlugin;
+class CGOomRunPluginConfig;
+class MGOomActionObserver;
+class CGOomPluginWaiter;
+class CGOomMonitorPlugin;
+class CGOomMonitorPluginV2;
+class CGOomActionConfig;
+
+/*
+ * The GOOM action of running an GOOM plug-in to free up memory.
+ * 
+ *  @lib oommonitor.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS(CGOomRunPlugin) : public CGOomAction
+    {
+public:
+    static CGOomRunPlugin* NewL(TUint aPluginId, CGOomRunPluginConfig& aConfig, MGOomActionObserver& aStateChangeObserver, CGOomMonitorPlugin& aPlugin);
+
+    ~CGOomRunPlugin();   
+    
+    // Run the GOOM plugin in order to free memory
+    // Call the CGOomAction::MemoryFreed when it is done
+    virtual void FreeMemory(TInt aBytesRequested);
+    
+    // Call the memory good function on the plugin but...
+    // only if there is an outstanding FreeMemory request
+    void MemoryGood();
+        
+    inline TBool IsRunning();
+    
+    // To be called by the CGOomPluginWaiter
+    inline void WaitCompleted();
+    
+protected:
+    
+    void ConstructL(CGOomRunPluginConfig& aPluginConfig);    
+    
+    inline CGOomActionConfig& GetConfig();   
+    
+private:
+    
+    CGOomRunPlugin(TUint aPluginId, CGOomRunPluginConfig& aConfig, MGOomActionObserver& aStateChangeObserver, CGOomMonitorPlugin& aPlugin);
+    
+    TUint iPluginId;
+    
+    CGOomMonitorPlugin& iPlugin;
+    
+    CGOomRunPluginConfig& iConfig;
+    
+    CGOomPluginWaiter* iPluginWaiter;
+    
+    TBool iFreeMemoryCalled; // True if FreeMemory has been called since the last call to MemoryGood
+    };
+
+#include "goomrunplugin.inl"
+
+#endif /*GOOMRUNPLUGIN_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomrunplugin.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing GOOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#ifndef GOOMRUNPLUGININL_H_
+#define GOOMRUNPLUGININL_H_
+
+#include "goomactionconfig.h"
+#include "goompluginwaiter.h"
+#include "goomrunpluginconfig.h"
+
+inline CGOomActionConfig& CGOomRunPlugin::GetConfig()
+    {
+    return iConfig;
+    }
+
+
+inline TBool CGOomRunPlugin::IsRunning()
+    {
+    return iPluginWaiter->IsActive();
+    }
+
+inline void CGOomRunPlugin::WaitCompleted()
+    {
+    MemoryFreed(KErrNone);
+    }
+
+
+#endif /*GOOMRUNPLUGININL_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomrunpluginconfig.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMRUNPLUGINCONFIG_
+#define GOOMRUNPLUGINCONFIG_
+
+#include "goomactionconfig.h"
+
+enum TGOomPluginType
+    {
+    EGOomAppPlugin,
+    EGOomSystemPlugin
+    };
+
+/*
+ * The GOOM action of running an GOOM plug-in to free up memory.
+ */
+NONSHARABLE_CLASS(CGOomRunPluginConfig) : public CGOomActionConfig
+    {
+public:
+    static CGOomRunPluginConfig* NewL(TUint aPluginId, TGOomPluginType aPluginType);
+    
+    TUint CalculatePluginPriority(const CGOomWindowGroupList& aWindowGroupList);
+    
+    inline TUint Id();
+    
+    inline void SetTargetApp(TUint aTargetAppId);
+    
+    inline TUint TargetApp() const;
+    
+    ~CGOomRunPluginConfig();
+    
+    // Returns ETrue if a wait period has been explicitly configured for this plugin
+    inline TBool WaitAfterPluginDefined();
+    
+    // Returns the configured wait after the plugin has been called
+    inline TInt WaitAfterPlugin();
+    
+    // Set the time to wait 
+    inline void SetWaitAfterPlugin(TInt aMillisecondsToWait);
+    
+    inline TGOomPluginType PluginType();
+    
+private:
+    CGOomRunPluginConfig(TUint aPluginId, TGOomPluginType aPluginType);
+    
+    TUint iPluginId;
+    
+    TUint iTargetAppId;
+        
+    TBool iWaitAfterPluginDefined;
+    
+    TInt iWaitAfterPlugin; // The period to wait after a plugin has been called
+    
+    TGOomPluginType iPluginType;
+    };
+
+#include "goomrunpluginconfig.inl"
+
+#endif /*GOOMRUNPLUGINCONFIG_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomrunpluginconfig.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMRUNPLUGINCONFIGINL_H_
+#define GOOMRUNPLUGINCONFIGINL_H_
+
+
+// Returns ETrue if a wait period has been explicitly configured for this plugin
+inline TBool CGOomRunPluginConfig::WaitAfterPluginDefined()
+    {
+    return iWaitAfterPluginDefined;
+    }
+
+// Returns the configured wait after the plugin has been called
+inline TInt CGOomRunPluginConfig::WaitAfterPlugin()
+    {
+    return iWaitAfterPlugin;
+    }
+
+// Set the time to wait 
+inline void CGOomRunPluginConfig::SetWaitAfterPlugin(TInt aMillisecondsToWait)
+    {
+    iWaitAfterPluginDefined = ETrue;
+    iWaitAfterPlugin = aMillisecondsToWait;
+    }
+
+
+inline void CGOomRunPluginConfig::SetTargetApp(TUint aTargetAppId)
+    {
+    iTargetAppId = aTargetAppId;
+    }
+
+inline TUint CGOomRunPluginConfig::Id()
+    {
+    return  iPluginId;
+    }
+
+inline TGOomPluginType CGOomRunPluginConfig::PluginType()
+    {
+    return iPluginType;
+    }
+
+inline TUint CGOomRunPluginConfig::TargetApp() const
+    {
+    return iTargetAppId;
+    }
+
+#endif /*GOOMRUNPLUGINCONFIGINL_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomtraces.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,488 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Includes some common defines used in the GOOM monitor app
+*
+*/
+
+
+#ifndef GOOMTRACES_H
+#define GOOMTRACES_H
+
+#include "traceconfiguration.hrh"
+#include "tracedefs.h"
+
+#ifdef TRACE_INTO_FILE
+#include <flogger.h> // RFileLogger
+#else
+#include <e32debug.h> // RDebug
+#endif
+
+
+//-----------------------------------------------------------------------------
+// Constants
+//-----------------------------------------------------------------------------
+//
+
+/**
+* Prefix error trace
+*/
+#define _PREFIX_ERROR( aMsg ) _PREFIX_TRACE( "[ERROR: %d]: " L##aMsg )
+
+/**
+* Prefix info trace.
+*/
+#define _PREFIX_INFO( aMsg ) _PREFIX_TRACE( "[INFO]: " L##aMsg )
+
+/**
+* Define needed directories if TRACE_INTO_FILE macro in use
+*/
+#ifdef TRACE_INTO_FILE
+
+    _LIT( KDir, "goommonitor" );
+    _LIT( KFile, "goommonitor_log.txt" );
+    _LIT( KFullPath, "c:\\logs\\goommonitor\\" );
+
+#endif
+
+//-----------------------------------------------------------------------------
+// Error trace macros
+//-----------------------------------------------------------------------------
+//
+#ifdef ERROR_TRACE
+
+    /**
+    * Error trace definitions.
+    */
+    #ifdef TRACE_INTO_FILE
+
+        #define ERROR( aErr, aMsg )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, \
+                    _PREFIX_ERROR( aMsg ), aErr );\
+                }\
+            }
+        #define ERROR_1( aErr, aMsg, aP1 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, \
+                    _PREFIX_ERROR( aMsg ), aErr, aP1 );\
+                }\
+            }
+        #define ERROR_2( aErr, aMsg, aP1, aP2 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, \
+                    _PREFIX_ERROR( aMsg ), aErr, aP1, aP2 );\
+                }\
+            }
+        #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, \
+                    _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3 );\
+                }\
+            }
+
+    #else//TRACE_INTO_FILE not defined
+
+        #define ERROR( aErr, aMsg )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RDebug::Print( _PREFIX_ERROR( aMsg ), aErr );\
+                }\
+            }
+        #define ERROR_1( aErr, aMsg, aP1 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1 );\
+                }\
+            }
+        #define ERROR_2( aErr, aMsg, aP1, aP2 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2 );\
+                }\
+            }
+        #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )\
+            {\
+            if( aErr < KErrNone )\
+                {\
+                RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3 );\
+                }\
+            }
+
+    #endif//TRACE_INTO_FILE
+
+    #define ERROR_GEN( aMsg ) ERROR( KErrGeneral, aMsg )
+    #define ERROR_GEN_1( aMsg, aP1 ) ERROR_1( KErrGeneral, aMsg, aP1 )
+    #define ERROR_GEN_2( aMsg, aP1, aP2 ) ERROR_2( KErrGeneral, aMsg, aP1, aP2 )
+    #define ERROR_GEN_3( aMsg, aP1, aP2, aP3 ) ERROR_3( KErrGeneral, aMsg, aP1, aP3 )
+
+    #define ERROR_PARAM(_p) _p
+
+    #define TRAPD_ERR( aErr, aStmt ) TRAPD( aErr, aStmt )
+    #define TRAP_ERR( aErr, aStmt ) TRAP( aErr, aStmt )
+
+    #define TRAP_AND_LEAVE(_s,_t) \
+        { TRAPD(_e,_s); ERROR(_e,_t); User::LeaveIfError(_e); }
+
+#else//ERROR_TRACE not defined
+
+    #define ERROR( aErr, aMsg )
+    #define ERROR_1( aErr, aMsg, aP1 )
+    #define ERROR_2( aErr, aMsg, aP1, aP2 )
+    #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )
+    #define ERROR_GEN( aMsg )
+    #define ERROR_GEN_1( aMsg, aP1 )
+    #define ERROR_GEN_2( aMsg, aP1, aP2 )
+    #define ERROR_GEN_3( aMsg, aP1, aP2, aP3 )
+
+    #define ERROR_PARAM(_p)
+
+    #define TRAPD_ERR( aErr, aStmt ) TRAP_IGNORE( aStmt )
+    #define TRAP_ERR( aErr, aStmt )  TRAP_IGNORE( aStmt )
+
+    #define TRAP_AND_LEAVE(_s,_t) { _s; }
+
+#endif//ERROR_TRACE
+
+//-----------------------------------------------------------------------------
+// Info trace macros
+//-----------------------------------------------------------------------------
+//
+#ifdef INFO_TRACE
+
+    /**
+    * Info log message definitions.
+    */
+    #ifdef TRACE_INTO_FILE
+
+        #define TRACES( aMsg )\
+            {\
+            RFileLogger::Write( KDir, KFile, EFileLoggingModeAppend, \
+                _PREFIX_INFO( aMsg ) );\
+            }
+        #define TRACES1( aMsg, aP1 )\
+            {\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, \
+                _PREFIX_INFO( aMsg ), aP1 );\
+            }
+        #define TRACES2( aMsg, aP1, aP2 )\
+            {\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, \
+                _PREFIX_INFO( aMsg ), aP1, aP2 );\
+            }
+        #define TRACES3( aMsg, aP1, aP2, aP3 )\
+            {\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, \
+                _PREFIX_INFO( aMsg ), aP1, aP2, aP3 );\
+            }
+        #define TRACES4( aMsg, aP1, aP2, aP3, aP4 )\
+            {\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, \
+                _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4 );\
+            }
+        #define TRACES5( aMsg, aP1, aP2, aP3, aP4, aP5 )\
+            {\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, \
+                _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4, aP5 );\
+            }
+
+    #else//TRACE_INTO_FILE not defined
+
+        #define TRACES( aMsg )\
+            {\
+            RDebug::Print( _PREFIX_INFO( aMsg ) );\
+            }
+        #define TRACES1( aMsg, aP1 )\
+            {\
+            RDebug::Print( _PREFIX_INFO( aMsg ), aP1 );\
+            }
+        #define TRACES2( aMsg, aP1, aP2 )\
+            {\
+            RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2 );\
+            }
+        #define TRACES3( aMsg, aP1, aP2, aP3 )\
+            {\
+            RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3 );\
+            }
+        #define TRACES4( aMsg, aP1, aP2, aP3, aP4 )\
+            {\
+            RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4 );\
+            }
+        #define TRACES5( aMsg, aP1, aP2, aP3, aP4, aP5 )\
+            {\
+            RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3, aP4, aP5 );\
+            }
+
+    #endif//TRACE_INTO_FILE
+
+    #define TRACES_PARAM( aParam ) aParam
+
+#else//INFO_TRACE not defined
+
+    #define TRACES( aMsg )
+    #define TRACES1( aMsg, aP1 )
+    #define TRACES2( aMsg, aP1, aP2 )
+    #define TRACES3( aMsg, aP1, aP2, aP3 )
+    #define TRACES4( aMsg, aP1, aP2, aP3, aP4 )
+    #define TRACES5( aMsg, aP1, aP2, aP3, aP4, aP5 )
+    #define TRACES_PARAM( aParam )
+
+#endif//INFO_TRACE
+
+//-----------------------------------------------------------------------------
+// Trace current client thread name and process id
+//-----------------------------------------------------------------------------
+//
+#ifdef CLIENT_TRACE
+
+    #define CLIENT( aMessage )\
+        {\
+        RThread thread;\
+        TInt err = aMessage.Client( thread );\
+        if( err == KErrNone )\
+            {\
+            RProcess process;\
+            err = thread.Process( process );\
+            if( err == KErrNone )\
+                {\
+                TPtrC thredName( thread.Name() );\
+                TUid processUid( process.SecureId() );\
+                TRACES2( "Current client process UID: [%x], thread name: [%S]",\
+                    processUid,\
+                    &thredName );\
+                }\
+            process.Close();\
+            }\
+        thread.Close();\
+        }
+
+#else
+
+    #define CLIENT( aMessage )
+
+#endif
+
+//-----------------------------------------------------------------------------
+// Function trace macros
+//-----------------------------------------------------------------------------
+//
+#ifdef FUNC_TRACE
+
+    #include <e32base.h> // TCleanupItem
+
+    /**
+    * Function logging definitions.
+    */
+    #ifdef TRACE_INTO_FILE
+
+        #define FUNC( aMsg, aP1 )\
+            {\
+            TPtrC8 trace( _S8( aMsg ) );\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, trace, aP1 );\
+            }\
+
+    #else//TRACE_INTO_FILE not defined
+
+        #define FUNC( aMsg, aP1 )\
+            {\
+            RDebug::Printf( aMsg, aP1 );\
+            }\
+
+    #endif//TRACE_INTO_FILE
+
+    /**
+    * Function trace helper class.
+    *
+    * NOTE:
+    * LC -methods cannot be trapped. Therefore if LC -method leaves
+    * END trace is used instead of LEAVE trace.
+    * If you have an idea how to round this problem please tell.
+    */
+    _LIT8( KFuncNameTerminator, "(" );
+    _LIT8( KFuncLeavePatternL, "L" );
+    class TFuncLog
+        {
+        public:
+            static void Cleanup( TAny* aPtr )
+                {
+                TFuncLog* self = static_cast< TFuncLog* >( aPtr );
+                self->iLeft = ETrue;
+                FUNC( _PREFIX_CHAR("%S-LEAVE"), &self->iFunc ); // Leave detected
+                }
+            inline TFuncLog( const char* aFunc ) :
+                    iFunc( aFunc ? _S8( aFunc ) : _S8("") ),
+                    iLeft( EFalse ),
+                    iCleanupItem( Cleanup, this ),
+                    iCanLeave( EFalse )
+                {
+                TInt pos( iFunc.Find( KFuncNameTerminator ) );
+                if( pos != KErrNotFound )
+                    {
+                    iFunc.Set( iFunc.Left( pos ) );
+                    iCanLeave = !iFunc.Right(
+                        KFuncLeavePatternL().Length() ).Compare( KFuncLeavePatternL );
+                    if ( iCanLeave )
+                        {
+                        CleanupStack::PushL( iCleanupItem ); // Ignore warnings
+                        }
+                    }
+                FUNC( _PREFIX_CHAR("%S-START"), &iFunc );
+                }
+
+            inline ~TFuncLog()
+                {
+                if ( !iLeft )
+                    {
+                    if ( iCanLeave )
+                        {
+                        CleanupStack::Pop( this ); // Pop the cleanup item
+                        }
+                    FUNC( _PREFIX_CHAR("%S-END"), &iFunc ); // Normally finished
+                    }
+                }
+
+        private: // Data
+            TPtrC8 iFunc;
+            TBool iLeft;
+            TCleanupItem iCleanupItem;
+            TBool iCanLeave;
+        };
+    #define FUNC_LOG TFuncLog _fl( __PRETTY_FUNCTION__ );
+
+#else//FUNC_TRACE not defined
+
+    #define FUNC_LOG
+
+#endif//FUNC_TRACE
+
+//-----------------------------------------------------------------------------
+// Timestamp trace macros
+//-----------------------------------------------------------------------------
+//
+#ifdef TIMESTAMP_TRACE
+
+    #define PREFIX_TIMESTAMP( aCaption ) _PREFIX_TRACE_2("[TIMESTAMP] (%d:%02d:%02d.%06d us) ",aCaption)
+    #define CURRENT_TIME( aDt ) TDateTime aDt; { TTime t; t.HomeTime(); aDt = t.DateTime(); }
+    #define EXTRACT_TIME( aDt ) aDt.Hour(), aDt.Minute(), aDt.Second(), aDt.MicroSecond()
+
+    #ifdef TRACE_INTO_FILE
+
+        #define TIMESTAMP( aCaption )\
+            {\
+            CURRENT_TIME( dt );\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend,\
+                PREFIX_TIMESTAMP(aCaption),EXTRACT_TIME( dt ) );\
+            }
+
+        #define TIMESTAMP_1( aCaption, aP1 )\
+            {\
+            CURRENT_TIME( dt );\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend,\
+                PREFIX_TIMESTAMP(aCaption),EXTRACT_TIME( dt ),aP1 );\
+            }
+
+        #define TIMESTAMP_2( aCaption, aP1, aP2 )\
+            {\
+            CURRENT_TIME( dt );\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend,\
+                PREFIX_TIMESTAMP(aCaption),EXTRACT_TIME( dt ),aP1,aP2 );\
+            }
+
+        #define TIMESTAMP_3( aCaption, aP1, aP2, aP3 )\
+            {\
+            CURRENT_TIME( dt );\
+            RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend,\
+                PREFIX_TIMESTAMP(aCaption),EXTRACT_TIME( dt ),aP1,aP2,aP3 );\
+            }
+
+    #else//TRACE_INTO_FILE not defined
+
+        #define TIMESTAMP( aCaption )\
+            {\
+            CURRENT_TIME( dt );\
+            RDebug::Print( PREFIX_TIMESTAMP(aCaption),EXTRACT_TIME( dt ) );\
+            }
+
+        #define TIMESTAMP_1( aCaption, aP1 )\
+            {\
+            CURRENT_TIME( dt );\
+            RDebug::Print( PREFIX_TIMESTAMP(aCaption),EXTRACT_TIME( dt ),aP1 );\
+            }
+
+        #define TIMESTAMP_2( aCaption, aP1, aP2 )\
+            {\
+            CURRENT_TIME( dt );\
+            RDebug::Print( PREFIX_TIMESTAMP(aCaption),EXTRACT_TIME( dt ),aP1,aP2 );\
+            }
+
+        #define TIMESTAMP_3( aCaption, aP1, aP2, aP3 )\
+            {\
+            CURRENT_TIME( dt );\
+            RDebug::Print( PREFIX_TIMESTAMP(aCaption),EXTRACT_TIME( dt ),aP1,aP2,aP3 );\
+            }
+
+    #endif//TRACE_INTO_FILE
+
+#else//TIMESTAMP_TRACE not defined
+
+    #define TIMESTAMP( aCaption )
+    #define TIMESTAMP_1( aCaption, aP1 )
+    #define TIMESTAMP_2( aCaption, aP1, aP2 )
+    #define TIMESTAMP_3( aCaption, aP1, aP2, aP3 )
+
+#endif//TIMESTAMP_TRACE
+
+#ifdef _DEBUG
+
+    #include <e32debug.h> // RDebug
+
+    static void Panic( const TDesC8& aFileName, const TInt aLineNum )
+        {
+        TPath name;
+        name.Copy( aFileName );
+        RDebug::Print( _L( "Assertion failed in file=%S, line=%d" ), &name, aLineNum );
+        User::Invariant();
+        }
+
+    #define ASSERT_ALWAYS_TRACE Panic( _L8(__FILE__), __LINE__ );
+    #define ASSERT_TRACE( _s ) if ( !( _s ) ) { ASSERT_ALWAYS_TRACE; }
+
+#else // _DEBUG
+
+    #define ASSERT_ALWAYS_TRACE
+    #define ASSERT_TRACE( _s )
+
+#endif // _DEBUG
+
+#define TRACE_MATRIX( aMsg, aMatrix ) \
+    TRACES( aMsg ); \
+    TRACES( "------------------------------------------------" ); \
+    TRACES3( "       [%f %f %f]", (TReal)(aMatrix)[0], (TReal)(aMatrix)[1], (TReal)(aMatrix)[2] ); \
+    TRACES3( "Matrix [%f %f %f]", (TReal)(aMatrix)[3], (TReal)(aMatrix)[4], (TReal)(aMatrix)[5] ); \
+    TRACES3( "       [%f %f %f]", (TReal)(aMatrix)[6], (TReal)(aMatrix)[7], (TReal)(aMatrix)[8] ); \
+    TRACES( "------------------------------------------------" );
+
+#endif      // GOOMTRACES_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomwindowgrouplist.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  A wrapper for the window group list, adding additional functionality required by OOM Monitor v2
+*
+*/
+
+#ifndef GOOMWINDOWGROUPLIST_H_
+#define GOOMWINDOWGROUPLIST_H_
+
+#include <e32base.h>
+#include <e32hashtab.h>
+#include <w32std.h>
+
+class CApaWindowGroupName;
+
+/**
+ *  This class holds a snapshot of the window group tree. 
+ *  
+ *  The window group tree is collapsed (see CollapseWindowGroupTree) to remove child windows as we are only 
+ *  interested in a single window group Id per application.
+ *
+ *  @lib goommonitor.lib
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS(CGOomWindowGroupList) : public CBase
+    {
+public:
+    
+    static CGOomWindowGroupList* NewL(RWsSession& aWs);
+    
+    // Update the list of window groups
+    void RefreshL();
+    
+    // Update the list of window groups, non-leaving version
+    void Refresh();
+    
+    // Return the number of application instances in this list
+    inline TUint Count() const;
+    
+    TUint AppId(TInt aIndex, TBool aResolveFromThread = EFalse) const;
+    TUint AppIdfromWgId(TInt aWgId, TBool aResolveFromThread = EFalse) const;
+        
+    inline const RWsSession::TWindowGroupChainInfo& WgId(TInt aIndex) const;
+    
+    TTimeIntervalSeconds IdleTime(TInt aIndex) const;
+  
+    ~CGOomWindowGroupList();
+    
+    void SetPriorityBusy(TInt aWgId);
+    
+    void SetPriorityNormal(TInt aWgId);
+    
+    void SetPriorityHigh(TInt aWgId);
+    
+    TBool IsBusy(TInt wgIndex);
+    
+    // Returns ETrue if an application has registered itself as high priority at runtime
+    TBool IsDynamicHighPriority(TInt wgIndex);
+    
+    CApaWindowGroupName* WgName() const;
+    
+    // Find the specificed application in the window group list and return the index
+    TInt GetIndexFromAppId(TUint aAppId) const;
+    
+private:    
+
+    void CollapseWindowGroupTree();
+    
+    void RemovePropertiesForClosedWindowsL();
+
+    TInt FindParentIdL(TInt aWgId);
+
+private:
+    
+    CGOomWindowGroupList(RWsSession& aWs);
+    
+    void ConstructL();
+    
+    RArray<RWsSession::TWindowGroupChainInfo> iWgIds;
+    RArray<RWsSession::TWindowGroupChainInfo> iUncollapsedWgIds;
+    
+    enum TGOomPriority
+        {
+        EGOomPriorityNormal,
+        EGOomPriorityHigh,
+        EGOomPriorityBusy
+        };
+    
+    class TGOomWindowGroupProperties
+        {
+    public:
+        TGOomWindowGroupProperties();
+        TUint32 iIdleTickTime;
+        TGOomPriority iDynamicPriority;
+        };
+        
+    RHashMap<TInt, TGOomWindowGroupProperties> iWgToPropertiesMapping; // A mapping between window group IDs and the properties such as idle time and the high-priority flag
+    RHashSet<TInt> iExistingWindowIds; // Used locally in RemoveIdleTimesForClosedWindows(), declared globally because we need to reserve space    
+    
+    RWsSession& iWs;    
+        
+    CApaWindowGroupName* iWgName;
+    HBufC* iWgNameBuf;              // owned by iWgName
+    };
+
+#include "goomwindowgrouplist.inl"
+
+#endif /*GOOMWINDOWGROUPLIST_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomwindowgrouplist.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing GOOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#ifndef GOOMWINDOWGROUPLISTINL_H_
+#define GOOMWINDOWGROUPLISTINL_H_
+
+// Return the number of application instances in this list
+inline TUint CGOomWindowGroupList::Count() const 
+    {
+    return iWgIds.Count();    
+    }
+
+inline const RWsSession::TWindowGroupChainInfo& CGOomWindowGroupList::WgId(TInt aIndex) const
+    {
+    return iWgIds[aIndex];
+    }
+    
+#endif /*GOOMWINDOWGROUPLISTINL_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/goomwserveventreceiver.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* 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:  Main classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#ifndef GOOMWSERVEVENTRECEIVER_H
+#define GOOMWSERVEVENTRECEIVER_H
+
+#include <w32std.h>
+class CMemoryMonitor;
+
+NONSHARABLE_CLASS(CWservEventReceiver) : public CActive
+    {
+public:
+    CWservEventReceiver(CMemoryMonitor& aMonitor, RWsSession& aWs);
+    ~CWservEventReceiver();
+    void ConstructL();
+private:
+    void Queue();
+    void DoCancel();
+    void RunL();
+private:
+    CMemoryMonitor& iMonitor;
+    RWsSession& iWs;
+    RWindowGroup iWg;
+    };
+
+#endif /*GOOMWSERVEVENTRECEIVER_H*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/traceconfiguration.hrh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,91 @@
+/*
+* 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:  Tracing flags configuration.
+*
+*/
+
+
+#ifndef TRACECONFIGURATION_HRH
+#define TRACECONFIGURATION_HRH
+
+//-----------------------------------------------------------------------------
+// Trace definitions
+//-----------------------------------------------------------------------------
+//
+
+// just to make it easier to enable traces on rel builds also
+#ifdef _DEBUG
+    #define _GOOM_DEBUG
+    #define __GOOM_INFO_TRACE__
+    #define __GOOM_FUNC_TRACE__
+#endif
+
+/**
+* Error trace enabled
+*/
+#ifdef _GOOM_DEBUG
+    #define ERROR_TRACE
+#else
+    #undef ERROR_TRACE
+#endif
+
+/**
+* Info trace enabled
+*/
+#define __GOOM_INFO_TRACE__
+#if defined _GOOM_DEBUG && defined __GOOM_INFO_TRACE__
+    #define INFO_TRACE
+    #define TIMESTAMP_TRACE
+#else
+    #undef INFO_TRACE
+    #undef TIMESTAMP_TRACE
+#endif
+
+/**
+* Function trace enabled
+*/
+#if defined _GOOM_DEBUG && defined __GOOM_FUNC_TRACE__
+    #define FUNC_TRACE
+#else
+    #undef FUNC_TRACE
+#endif
+
+/**
+* Timestamp tracing on
+*/
+#if defined _GOOM_DEBUG && defined __GOOM_TIMESTAMP_TRACE__
+    #define TIMESTAMP_TRACE
+#else
+    #undef TIMESTAMP_TRACE
+#endif
+
+/**
+* Tracing current client process and thread
+*/
+#ifdef _GOOM_DEBUG
+    #define CLIENT_TRACE
+#else
+    #undef CLIENT_TRACE
+#endif
+
+/**
+* Tracing into file enabled, default RDebug
+*/
+#ifdef __GOOM_TRACE_INTO_FILE__
+    #define TRACE_INTO_FILE
+#else
+    #undef TRACE_INTO_FILE
+#endif
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/inc/tracedefs.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,39 @@
+/*
+* 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:  Definitions for tracing.
+*
+*/
+
+
+#ifndef TRACEDEFS_H
+#define TRACEDEFS_H
+
+//-----------------------------------------------------------------------------
+// Constants
+//-----------------------------------------------------------------------------
+//
+
+/**
+* Prefix trace macro to complete tracing with component name.
+* Returns TDesC which can be used directly with RDebug or RFileLogger.
+*/
+#define _PREFIX_TRACE( aMsg ) TPtrC( (const TText*)L"[GOOM]: " L##aMsg )
+#define _PREFIX_TRACE_2( aMsg1, aMsg2 ) TPtrC( (const TText*)L"[GOOM]: " L##aMsg1 L##aMsg2 )
+
+/**
+* Prefix macro for strings
+*/
+#define _PREFIX_CHAR( aMsg ) (const char*)"[GOOM]: " ##aMsg
+
+#endif // TRACEDEFS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/rom/goommonitor.iby	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* 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:  Image description file for project oommonitor
+*
+*/
+
+
+#ifndef GOOMMONITOR_IBY
+#define GOOMMONITOR_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\goommonitor.dll          SHARED_LIB_DIR\goommonitor.dll
+data=ZSYSTEM\..\private\10207218\goomconfig.xml  private\10207218\goomconfig.xml
+
+#endif // GOOMMONITOR_IBY
+
+//  End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomIdletimerule.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#include "goomidletimerule.h"
+#include "goomwindowgrouplist.h"
+#include "goomtraces.h"
+
+CGOomIdleTimeRule* CGOomIdleTimeRule::NewL(TTimeIntervalSeconds aIdleTime, TInt aPriority)
+    {
+    FUNC_LOG;
+
+    CGOomIdleTimeRule* self = new (ELeave) CGOomIdleTimeRule(aIdleTime, aPriority);
+    return self;
+    }
+
+TBool CGOomIdleTimeRule::RuleIsApplicable(const CGOomWindowGroupList& aWindowGroupList, TInt aAppIndexInWindowGroup) const
+    {
+    FUNC_LOG;
+
+    TBool applicable = EFalse;
+    if (aAppIndexInWindowGroup >= 0)
+        {
+        applicable = (aWindowGroupList.IdleTime(aAppIndexInWindowGroup) >= iIdleTime);
+        }
+    return applicable;
+    }
+
+CGOomIdleTimeRule::~CGOomIdleTimeRule()
+    {
+    FUNC_LOG;
+    }
+
+CGOomIdleTimeRule::CGOomIdleTimeRule(TTimeIntervalSeconds aIdleTime, TInt aPriority) : iIdleTime(aIdleTime), iPriority(aPriority)
+    {
+    FUNC_LOG;
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomaction.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing GOOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#include "goomaction.h"
+#include "goomactionlist.h"
+#include "goomtraces.h"
+
+CGOomAction::~CGOomAction()
+    {
+    FUNC_LOG;
+    }
+
+// To be called by the derived class after the memory has been freed (or if it fails)
+void CGOomAction::MemoryFreed(TInt)
+    {
+    FUNC_LOG;
+    
+    iState = EGOomIdle;
+    iStateChangeObserver.StateChanged();
+    }
+
+CGOomAction::CGOomAction(MGOomActionObserver& aStateChangeObserver) : iStateChangeObserver(aStateChangeObserver)
+    {
+    FUNC_LOG;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomactionconfig.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#include "goomactionconfig.h"
+#include "goomruleconfig.h"
+#include "goomtraces.h"
+
+// Add a rule
+// This class takes ownership of the given rule
+void CGOomActionConfig::AddRuleL(MGOomRuleConfig* aRule)    // Add the configuration for a rule (e.g. an idle time rule)
+    {
+    FUNC_LOG;
+    
+    iRules.AppendL(aRule);
+    }
+	
+CGOomActionConfig::~CGOomActionConfig()
+    {
+    FUNC_LOG;
+    
+    iRules.ResetAndDestroy();
+    iRules.Close();
+    }
+
+// Utility function to return the priority for this action for the given rule
+TUint CGOomActionConfig::Priority(const CGOomWindowGroupList& aWindowGroupList, TInt aAppIndexInWindowGroup) const
+    {
+    FUNC_LOG;
+    
+    TUint priority = iDefaultPriority;
+    
+    // See if any rules apply
+    TInt index = 0;
+    while (index < iRules.Count())
+        {
+        if (iRules[index]->RuleIsApplicable(aWindowGroupList, aAppIndexInWindowGroup))
+            {
+            // If an applicable rule has been found, then apply the new priority
+            // The last applicable rule in the config file should be used
+            // This is ensured because the last rule in the list will be the last rule from the file
+            if (iRules[index]->Priority())
+                priority = iRules[index]->Priority();
+            }
+        
+        index++;
+        }
+        
+    return priority;
+    }
+    
+void CGOomActionConfig::ConstructL()
+    {
+    FUNC_LOG;
+    }
+	
+CGOomActionConfig::CGOomActionConfig(TInt32 aId) : iId(aId)
+    {
+    FUNC_LOG;
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomactionlist.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,683 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing OOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#include <hal.h>
+#include <apgwgnam.h>
+
+#include "goommonitorplugin.h"
+#include "goommonitorplugin.hrh"
+#include "goomactionlist.h"
+#include "goomwindowgrouplist.h"
+#include "goompanic.h"
+#include "goomtraces.h"
+#include "goomconstants.hrh"
+#include "goommemorymonitor.h"
+#include "goommemorymonitorserver.h"
+#include "goomrunplugin.h"
+#include "goomcloseapp.h"
+#include "goomconfig.h"
+#include "goomactionref.h"
+#include "goomapplicationconfig.h"
+#include "goomcloseappconfig.h"
+#include "goomrunpluginconfig.h"
+
+template <class T>
+CGOomPluginList<T>::CGOomPluginList()
+    {
+    FUNC_LOG;
+    }
+
+template <class T>
+CGOomPluginList<T>::~CGOomPluginList()
+    {
+    FUNC_LOG;
+
+    TInt count = iPlugins.Count();
+    for (TInt ii=0; ii<count; ii++)
+        {
+        TPlugin& plugin = iPlugins[ii];
+        if (plugin.iImpl)    // only if successfully added
+            REComSession::DestroyedImplementation(plugin.iDtorUid);
+        }
+    iPlugins.Close();
+    }
+
+template <class T>
+void CGOomPluginList<T>::ConstructL(TInt aInterfaceUid)
+    {
+    FUNC_LOG;
+
+    RImplInfoPtrArray implArray;
+    CleanupClosePushL(implArray);
+    REComSession::ListImplementationsL(TUid::Uid(aInterfaceUid), implArray);
+
+    TInt count = implArray.Count();
+    iPlugins.ReserveL(count);
+
+    for (TInt ii=0; ii<count; ii++)
+        {
+        iPlugins.AppendL(TPlugin());
+        TPlugin& plugin = iPlugins[ii];
+        TUid uid(implArray[ii]->ImplementationUid());
+        plugin.iImpl = static_cast<T*>(REComSession::CreateImplementationL(uid, plugin.iDtorUid, NULL));
+        plugin.iUid = uid.iUid;
+        }
+
+    CleanupStack::PopAndDestroy(&implArray);
+    }
+
+template <class T>
+CGOomPluginList<T>::TPlugin::TPlugin()
+: iImpl(0)
+    {
+    FUNC_LOG;
+   }
+
+template <class T>
+CGOomPluginList<T>* CGOomPluginList<T>::NewL(TInt aInterfaceUid)
+    {
+    FUNC_LOG;
+
+    CGOomPluginList* self = new (ELeave) CGOomPluginList();
+    CleanupStack::PushL(self);
+    self->ConstructL(aInterfaceUid);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CGOomActionList* CGOomActionList::NewL(CMemoryMonitor& aMonitor, CMemoryMonitorServer& aServer, RWsSession& aWs, CGOomConfig& aConfig)
+    {
+    FUNC_LOG;
+
+    CGOomActionList* self = new (ELeave) CGOomActionList(aMonitor, aServer, aWs);
+    CleanupStack::PushL(self);
+    self->ConstructL(aConfig);
+    CleanupStack::Pop();
+    return self;
+    }
+
+CGOomActionList::~CGOomActionList()
+    {
+    FUNC_LOG;
+
+    iCloseAppActions.ResetAndDestroy();
+    iCloseAppActions.Close();
+    iRunPluginActions.ResetAndDestroy();
+    iRunPluginActions.Close();
+
+    iActionRefs.Close();
+
+    delete iPluginList;
+	
+    }
+
+// Creates a list of actions based on the contents of the config and the current window group list
+// Any old actions will be replaced.
+// This function may leave, however enough memory should be reserved for this process so that at least
+// some actions have been created for freeing memory, these can then be run by calling FreeMemory.
+// Note that this function will only leave in extreme circumstances, in normal usage we should have
+// enough reserved memory to build the complete action list.
+void CGOomActionList::BuildPluginActionListL(CGOomWindowGroupList& aWindowGroupList, CGOomConfig& aConfig)
+    {
+    FUNC_LOG;
+
+    if (iFreeingMemory)
+        {
+        TRACES("OOMWATCHER:CGOomActionList::BuildActionListL Memory is currently being freed, do not build action list");
+        TRACES2("OOMWATCHER:CGOomActionList::BuildActionListL iCurrentActionIndex = %d out of %d actions in progress", iCurrentActionIndex, iActionRefs.Count());
+        return;
+        }
+
+    iActionRefs.Reset();
+    iCurrentActionIndex = 0;
+
+    TInt actionsIndex = 0;
+    
+    iAppsProtectedByPlugins.Reset();
+    
+    iRunningKillAppActions = EFalse;
+    
+    //
+    // There is only one kind of plugin, the graphics plugin which is based on the oom plugin
+	// references to v2 plugin types removed as these are not yet used by GOOM
+    // we rely on the pluginlist not having changed since construction
+
+    // Go through each plugin in the plugin list, create a run-plugin action for each one
+    TInt pluginIndex = iPluginList->Count();
+    while (pluginIndex--)
+        {
+        // Get the config for this plugin
+        CGOomRunPluginConfig& pluginConfig = aConfig.GetPluginConfig(iPluginList->Uid(pluginIndex));
+        TInt priority = pluginConfig.CalculatePluginPriority(aWindowGroupList);
+
+        TGOomSyncMode syncMode = pluginConfig.iSyncMode;
+        TInt ramEstimate = pluginConfig.iRamEstimate;
+
+        TActionRef::TActionType actionType;
+
+        if (pluginConfig.PluginType() == EGOomAppPlugin)
+            {
+            actionType = TActionRef::EAppPlugin;
+            }
+        else
+            actionType = TActionRef::ESystemPlugin;
+
+        TActionRef ref = TActionRef(actionType, priority, syncMode, ramEstimate, *(iRunPluginActions[actionsIndex]), aWindowGroupList.GetIndexFromAppId(pluginConfig.TargetApp()));
+        iAppsProtectedByPlugins.Append(pluginConfig.TargetApp());
+        TRACES1("Creating Plugin Action Item TargetAppId %x", pluginConfig.TargetApp());
+        //It is valid to have plugins with equal priority
+        User::LeaveIfError(iActionRefs.InsertInOrderAllowRepeats(ref, ComparePriorities));
+
+        actionsIndex++;
+        }
+    
+    TRACES1("BuildActionListL: Action list built with %d Plugin items",iActionRefs.Count());
+    }
+
+void CGOomActionList::BuildKillAppActionListL(CGOomWindowGroupList& aWindowGroupList, CGOomConfig& aConfig)
+    {
+    FUNC_LOG;
+    
+    iActionRefs.Reset();
+    iCurrentActionIndex = 0;
+    
+    aWindowGroupList.RefreshL();
+    
+    iRunningKillAppActions = ETrue;
+    
+    if (aWindowGroupList.Count())
+            {
+            // Go through each item in the wglist, create an app close action for this application
+            TInt wgIndex = aWindowGroupList.Count() - 1;
+            
+            TRACES1("BuildActionListL: Windowgroup list count %d ",aWindowGroupList.Count());
+    
+            // Fix for when fast swap has focus, or pen input server has put itself into the foreground:
+            // the wg at index 1 should be considered as the foreground app.
+            // stopIndex is calculated to take this into account.
+            TUid foregroundUid = TUid::Uid(iMonitor.ForegroundAppUid());
+    
+            TRACES1("BuildActionListL: Foreground App %x ", foregroundUid);
+            
+            while (wgIndex >= 0)
+                {
+                CGOomCloseAppConfig* appCloseConfig = NULL;
+    
+                CApaWindowGroupName* wgName = aWindowGroupList.WgName();
+                __ASSERT_DEBUG(wgName, GOomMonitorPanic(KInvalidWgName));
+    
+                // Get the app ID for the wglist item
+                // This sets the window group name
+                TInt32 appId = aWindowGroupList.AppId(wgIndex, ETrue);
+     
+                if ( !appId  || foregroundUid.iUid ==appId || wgName->IsSystem() || wgName->Hidden() || (iAppsProtectedByPlugins.Find(appId) != KErrNotFound))
+                    {
+                    //If the UID is NULL at this point, we assume the process is not an application
+                    //and therefore is not a suitable candidate for closure.
+                    //We also do not close system or hidden apps.
+                    TRACES3("BuildActionListL: Not adding process to action list; UID = %x, wgIndex = %d, wgid = %d", appId, wgIndex, aWindowGroupList.WgId(wgIndex).iId);
+                    TRACES3("BuildActionListL: IsSystem = %d, Hidden = %d, Foregroundapp %x", wgName->IsSystem() ? 1 : 0, wgName->Hidden() ? 1 : 0, foregroundUid);
+                    }
+    
+                else if (aWindowGroupList.IsBusy(wgIndex) || wgName->IsBusy())
+                    // If the application has been flagged as busy then look up the configuration for busy apps in the config file
+                    {
+                    // Find the app close config for this app ID
+                    appCloseConfig = aConfig.GetApplicationConfig(KGOomBusyAppId).GetAppCloseConfig();
+                    }
+                else if (aWindowGroupList.IsDynamicHighPriority(wgIndex))
+                    // If the application has been flagged as busy then look up the configuration for busy apps in the config file
+                    {
+                    // Find the app close config for this app ID
+                    appCloseConfig = aConfig.GetApplicationConfig(KGOomHighPriorityAppId).GetAppCloseConfig();
+                    }
+                else
+                    // If the application hasn't been flagged as busy or high priority then look up the priority according to the config
+                    {
+                    // Find the app close config for this app ID
+                    appCloseConfig = aConfig.GetApplicationConfig(appId).GetAppCloseConfig();
+                    }
+    
+                // Create the app close action and add it to the action list
+                if (appCloseConfig)
+                    {
+                    TUint priority = appCloseConfig->CalculateCloseAppPriority(aWindowGroupList, wgIndex);
+                    TInt wgId = aWindowGroupList.WgId(wgIndex).iId;
+                    TGOomSyncMode syncMode = appCloseConfig->iSyncMode;
+                    TInt ramEstimate = appCloseConfig->iRamEstimate;
+                    TActionRef ref = TActionRef(TActionRef::EAppClose, priority, syncMode, ramEstimate, wgId, wgIndex);
+    
+                    //AppClose Actions should always have a unique prioirity determined by the application's z order.
+                    TInt err = iActionRefs.InsertInOrder(ref, ComparePriorities);
+                    if ((err != KErrNone) && (err != KErrAlreadyExists))
+                        {
+                        User::Leave(err);
+                        }
+                    TRACES3("BuildActionListL: Adding app to action list, Uid = %x, wgId = %d, wgIndex = %d", appId, wgId, wgIndex);
+                    }
+    
+                wgIndex--;
+                }
+            }
+            
+        TRACES1("BuildActionListL: Action list built with %d items",iActionRefs.Count());
+    }    
+
+
+// Execute the OOM actions according to their priority
+// Run batches of OOM actions according to their sync mode
+void CGOomActionList::FreeMemory(TInt aMaxPriority)
+    {
+    FUNC_LOG;
+
+    if (iFreeingMemory)
+            {
+            TRACES("OOMWATCHER:CGOomActionList::FreeMemory Memory is currently being freed, do not start any more actions");
+            return;
+            }
+    
+    iMaxPriority = aMaxPriority;
+
+    TBool memoryFreeingActionRun = EFalse;
+
+    // Get the configured maximum number of applications that can be closed at one time
+    const CGOomGlobalConfig& globalConfig = CMemoryMonitor::GlobalConfig();
+    TInt maxBatchSize = globalConfig.iMaxCloseAppBatch;
+    TInt numberOfRunningActions = 0;
+
+    TInt memoryEstimate = iMonitor.GetFreeMemory(); // The amount of free memory we expect to be free after the currently initiated operations
+
+    while (iCurrentActionIndex < iActionRefs.Count())
+        {
+        if(iActionRefs[iCurrentActionIndex].Priority() > aMaxPriority)
+            {
+            TRACES1("Busy App wgid %d, spared by GOOM", iActionRefs[iCurrentActionIndex].WgId());
+            iCurrentActionIndex++;
+            continue;
+            }
+        
+        TActionRef ref = iActionRefs[iCurrentActionIndex];
+        CGOomAction* action = NULL;
+        if (ref.Type() == TActionRef::EAppClose)
+            {
+            action = iCloseAppActions[numberOfRunningActions];
+            static_cast<CGOomCloseApp*>(action)->Reconfigure(ref);
+            
+            //Double checking again if this app is now in foreground, if yes then we dont kill
+            CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(iWs, iWs.GetFocusWindowGroup());
+            RDebug::Print(wgName->WindowGroupName());
+            TInt32 fgApp = wgName->AppUid().iUid;
+            TInt32 appId = iMonitor.GetWindowGroupList()->AppIdfromWgId(ref.WgId(), ETrue);
+            if(appId == fgApp)
+                {
+                TRACES1("Foreground App wgid %x, spared by GOOM", appId);
+                
+                iCurrentActionIndex++;
+                continue;
+                }
+            }
+        else
+            {
+            action = &(ref.RunPlugin());
+            }
+
+        iFreeingMemory = ETrue;
+        TRACES2("CGOomActionList::FreeMemory: Running action %d which has priority %d", iCurrentActionIndex,ref.Priority());
+        action->FreeMemory(iCurrentTarget - memoryEstimate);
+        memoryFreeingActionRun = ETrue;
+
+        // Actions with EContinueIgnoreMaxBatchSize don't add to the tally of running actions
+        if (ref.SyncMode() != EContinueIgnoreMaxBatchSize)
+            numberOfRunningActions++;
+
+        // Update our estimate of how much RAM we think we'll have after this operation
+        memoryEstimate += ref.RamEstimate();
+
+        // Do we estimate that we are freeing enough memory (only applies if the sync mode is "esimtate" for this action)
+        TBool estimatedEnoughMemoryFreed = EFalse;
+        if ((ref.SyncMode() == EEstimate)
+            && (memoryEstimate >= iCurrentTarget))
+            {
+            estimatedEnoughMemoryFreed = ETrue;
+            }
+
+        if ((ref.SyncMode() == ECheckRam)
+                || (numberOfRunningActions >= maxBatchSize)
+                || estimatedEnoughMemoryFreed
+                || globalConfig.ForceCheckAtPriority(iActionRefs[iCurrentActionIndex].Priority()))
+            // If this actions requires a RAM check then wait for it to complete
+            // Also force a check if we've reached the maximum number of concurrent operations
+            // Also check if we estimate that we have already freed enough memory (assuming that the sync mode is "estimate"
+            {
+            // Return from the loop - we will be called back (in CGOomActionList::StateChanged()) when the running actions complete
+            TRACES("CGOomActionList::FreeMemory: Exiting run action loop");
+            return;
+            }
+        // ... otherwise continue running actions, don't wait for any existing ones to complete
+        iCurrentActionIndex++;
+        }
+
+
+    if (!memoryFreeingActionRun)
+        {
+        // No usable memory freeing action has been found, so we give up
+        TRACES("CGOomActionList::FreeMemory: No usable memory freeing action has been found");
+        iMonitor.ResetTargets();
+        TInt freeMemory;
+        if (FreeMemoryAboveTarget(freeMemory) && !iMonitor.NeedToPostponeMemGood())
+            {
+            MemoryGood();
+            }
+        iServer.CloseAppsFinished(freeMemory, EFalse);
+        }
+    }
+
+// Should be called when the memory situation is good
+// It results in notifications of the good memory state to all plugins with an outstanding FreeMemory request
+void CGOomActionList::MemoryGood()
+    {
+    FUNC_LOG;
+
+    TInt actionRefIndex = iActionRefs.Count();
+
+    // Go through each of the action references, if it's a plugin action then call MemoryGood on it
+    // Note that this only results in a call to the plugin if FreeMemory has been called on this plugin since that last call to MemoryGood
+    while (actionRefIndex--)
+        {
+        if ((iActionRefs[actionRefIndex].Type() == TActionRef::EAppPlugin)
+                || (iActionRefs[actionRefIndex].Type() == TActionRef::ESystemPlugin))
+            {
+            iActionRefs[actionRefIndex].RunPlugin().MemoryGood();
+            }
+        }
+    }
+
+TBool CGOomActionList::FreeMemoryAboveTarget(TInt& aFreeMemory)
+    {
+    FUNC_LOG;
+
+    aFreeMemory = iMonitor.GetFreeMemory();
+
+    TRACES1("CGOomActionList::FreeMemoryAboveTarget: Free RAM now %d",aFreeMemory);
+
+    return (aFreeMemory >= iCurrentTarget);
+    }
+
+TInt CGOomActionList::ComparePriorities(const TActionRef& aPos1, const TActionRef& aPos2 )
+    {
+    FUNC_LOG;
+
+    if (aPos1.Priority()< aPos2.Priority())
+        {
+        return -1;
+        }
+    if (aPos1.Priority() > aPos2.Priority())
+        {
+        return 1;
+        }
+
+    // If priorities are equal then we use hardcoded rules to determine which one is run...
+
+    // All other actions are run in preference to application closures
+	if ((aPos1.Type() != TActionRef::EAppClose)
+			&& ((aPos2.Type() == TActionRef::EAppClose)))
+		{
+		return -1;
+		}
+	if ((aPos1.Type() == TActionRef::EAppClose)
+			&& ((aPos2.Type() != TActionRef::EAppClose)))
+		{
+		return 1;
+		}
+	// If both actions are application closures then the Z order is used to determine which one to run (furthest back application will be closed first)
+	if ((aPos1.Type() == TActionRef::EAppClose)
+			&& ((aPos2.Type() == TActionRef::EAppClose)))
+		{
+		if (aPos1.WgIndex() < aPos2.WgIndex())
+			{
+			return 1;
+			}
+		else
+			{
+			return -1;
+			}
+		//Two Apps should not have equal window group indexes, we panic below if this is the case.
+		}
+
+	// Application plugins will be run in preference to system plugins
+	if ((aPos1.Type() == TActionRef::EAppPlugin)
+			&& ((aPos2.Type() == TActionRef::ESystemPlugin)))
+		{
+		return -1;
+		}
+	if ((aPos1.Type() == TActionRef::ESystemPlugin)
+			&& ((aPos2.Type() == TActionRef::EAppPlugin)))
+		{
+		return 1;
+		}
+
+	// If both actions are application plugins then the Z order of the target app is used to determine which one to run (the one with the furthest back target app will be closed first)
+	// If the target app is not running then the plugin is run in preference to target apps where the target app is running
+	if ((aPos1.Type() == TActionRef::EAppPlugin)
+			&& ((aPos2.Type() == TActionRef::EAppPlugin)))
+		{
+		// When the target app is not running then the plugin will be run ahead of plugins where the target app is running
+		if ((aPos1.WgIndex() == KAppNotInWindowGroupList) && (aPos2.WgIndex() != KAppNotInWindowGroupList))
+			{
+			return -1;
+			}
+		if ((aPos1.WgIndex() != KAppNotInWindowGroupList) && (aPos2.WgIndex() == KAppNotInWindowGroupList))
+			{
+			return 1;
+			}
+		// If the target apps for both plugins are running then compare the Z order
+		if ((aPos1.WgIndex() != KAppNotInWindowGroupList) && (aPos2.WgIndex() != KAppNotInWindowGroupList))
+			{
+			if (aPos1.WgIndex() < aPos2.WgIndex())
+				{
+				return 1;
+				}
+			else
+				{
+				return -1;
+				}
+			}
+		// If the target app for neither plugin is running then they are of equal priority
+		}
+    //App Close Actions must have a unique priority.
+    __ASSERT_DEBUG((aPos1.Type() != TActionRef::EAppClose) && (aPos2.Type() != TActionRef::EAppClose), GOomMonitorPanic(KAppCloseActionEqualPriorities));
+    return 0;
+    }
+
+void CGOomActionList::AppNotExiting(TInt aWgId)
+    {
+    FUNC_LOG;
+
+    TInt index = iCloseAppActions.Count();
+    while (index--)
+        {
+        CGOomCloseApp* action = iCloseAppActions[index];
+        if ( (action->WgId() == aWgId) && (action->IsRunning()) )
+            {
+            TRACES1("CGOomCloseApp::AppNotExiting: App with window group id %d has not responded to the close event", aWgId);
+            action->CloseAppEvent();
+            }
+        }
+    }
+
+// From MGOomActionObserver
+// An action has changed state (possibly it has completed freeing memory)
+void CGOomActionList::StateChanged()
+    {
+    FUNC_LOG;
+
+    TBool allActionsComplete = ETrue;
+
+    // Note that the actions themselves are responsible for timing out if necessary.
+    TInt index = iCloseAppActions.Count();
+    while ((index--) && (allActionsComplete))
+        {
+        if (iCloseAppActions[index]->IsRunning())
+            {
+            TRACES1("CGOomActionList::StateChanged. CloseAppAction %d STILL RUNNING. PROBLEM !!! YOU SHOULD NEVER SEE THIS", index);
+            allActionsComplete = EFalse;
+            }
+        }
+
+    index = iRunPluginActions.Count();
+    while ((index--) && (allActionsComplete))
+        {
+        if (iRunPluginActions[index]->IsRunning())
+            {
+            TRACES1("CGOomActionList::StateChanged. PluginAction %d STILL RUNNING. PROBLEM !!! YOU SHOULD NEVER SEE THIS", index);
+            allActionsComplete = EFalse;
+            }
+        }
+
+    TRACES1("CGOomActionList::StateChanged. Current Target = %d", iCurrentTarget);
+    
+    if (allActionsComplete)
+        {
+        iFreeingMemory = EFalse;
+        // If all of the actions are complete then check memory and run more if necessary
+        TInt freeMemory;
+        TBool freeMemoryAboveTarget = FreeMemoryAboveTarget(freeMemory);
+        TRACES1("CGOomActionList::StateChanged. Free Memory = %d", freeMemory);
+        if (!freeMemoryAboveTarget)
+            // If we are still below the good-memory-threshold then continue running actions
+            {            
+            TRACES2("CGOomActionList::StateChanged: Finished Action %d out of %d",iCurrentActionIndex, iActionRefs.Count());
+            
+            iCurrentActionIndex++;
+            
+            if (iCurrentActionIndex >= iActionRefs.Count())
+                {
+                if(iRunningKillAppActions)
+                    {
+                    iRunningKillAppActions = EFalse;
+                    // There are no more actions to try, so we give up
+                    TRACES1("CGOomActionList::StateChanged: All current actions complete, below good threshold with no more actions available. freeMemory=%d", freeMemory);
+                    iMonitor.ResetTargets();
+                    /* Do not call memory good immidiately after freeing memory for some app
+                    if (freeMemory >= iCurrentTarget && !iMonitor.NeedToPostponeMemGood())
+                    {                    
+                    MemoryGood();
+                    }
+                     */
+                    iServer.CloseAppsFinished(freeMemory, EFalse);
+                    }
+                else
+                    {
+                    TRACES1("CGOomActionList::StateChanged: All current Plugin actions complete, below good threshold, Time to kill bad guys. freeMemory=%d", freeMemory);
+                    iRunningKillAppActions = ETrue;
+                    iMonitor.RunCloseAppActions(iMaxPriority);
+                    }
+                }
+            else
+                {
+                // There are still more actions to try, so we continue
+                TRACES1("CGOomActionList::StateChanged: All current actions complete, running more actions. freeMemory=%d", freeMemory);
+                FreeMemory(iMaxPriority);
+                }
+            }
+        else
+            {
+            TRACES1("CGOomActionList::StateChanged: All current actions complete, memory good. freeMemory=%d", freeMemory);
+            /* Do not call memory good immidiately after freeing memory for some app
+			if(freeMemory > iMonitor.GetGoodThreshold() && !iMonitor.NeedToPostponeMemGood())
+                {
+                MemoryGood();
+                }
+            */
+            iRunningKillAppActions = EFalse;
+            iMonitor.ResetTargets();
+            iServer.CloseAppsFinished(freeMemory, ETrue);
+            }
+        }
+
+    // If some actions are not yet in the idle state then we must continue to wait for them (they will notify us of a state change via a callback)
+    }
+
+CGOomActionList::CGOomActionList(CMemoryMonitor& aMonitor, CMemoryMonitorServer& aServer, RWsSession& aWs)
+    : iWs(aWs), iMonitor(aMonitor), iServer(aServer)
+    {
+    FUNC_LOG;
+    }
+
+void CGOomActionList::ConstructL(CGOomConfig& aConfig)
+    {
+    FUNC_LOG;
+
+    iCurrentActionIndex = 0;
+    iFreeingMemory = EFalse;
+
+    // Get the list of plugins available to the system
+
+    iPluginList = CGOomPluginList<CGOomMonitorPlugin>::NewL(KGOomPluginInterfaceUidValue);
+    // Go through each plugin in the plugin list, create a run-plugin action for each one
+    TInt pluginIndex = iPluginList->Count();
+    while (pluginIndex--)
+        {
+        // Get the config for this plugin
+        CGOomRunPluginConfig& pluginConfig = aConfig.GetPluginConfig(iPluginList->Uid(pluginIndex));
+
+        // Create an action acording to the config
+        CGOomRunPlugin* action = CGOomRunPlugin::NewL(iPluginList->Uid(pluginIndex), pluginConfig, *this, iPluginList->Implementation(pluginIndex));
+
+        iRunPluginActions.AppendL(action);
+        }
+
+	//references to v2 plugin types removed as these are not yet used by GOOM
+	
+    //allocate empty CGOomCloseApp objects
+    TInt appCloseIndex = aConfig.GlobalConfig().iMaxCloseAppBatch;
+    while (appCloseIndex--)
+        {
+        CGOomCloseApp* action = CGOomCloseApp::NewL(*this, iWs);
+        iCloseAppActions.AppendL(action);
+        }
+    }
+
+void CGOomActionList::SetPriority(TInt aWgIndex, TInt aPriority)
+    {
+    FUNC_LOG;
+
+    TInt idx = iActionRefs.Count()-1;
+    while(idx >= 0)
+        {
+        if(iActionRefs[idx].WgIndex() == aWgIndex)
+            {
+            break;
+            }
+        idx--;
+        }
+    
+    if(idx >= 0)
+        {
+        TRACES2("CGOomActionList::SetPriority Setting app wgindex %d, index %d as busy", aWgIndex, idx);
+        iActionRefs[idx].SetPriority(aPriority);
+        if (!iFreeingMemory)
+            {
+            iActionRefs.Sort(ComparePriorities);
+            }
+        }
+    else
+        {
+        TRACES1("CGOomActionList::SetPriority wgindex %d not in the hitlist", aWgIndex);
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomactionref.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing GOOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#include "goomactionref.h"
+
+TActionRef::TActionRef(TActionType aType, TInt aPriority, TGOomSyncMode aSyncMode, TInt aRamEstimate, CGOomRunPlugin& aRunPlugin, TUint aWgIndexOfTargetApp)
+    : iType(aType), iPriority(aPriority), iSyncMode(aSyncMode), iRamEstimate(aRamEstimate), iWgIndex(aWgIndexOfTargetApp), iRunPlugin(&aRunPlugin)
+    {   
+    }
+
+TActionRef::TActionRef(TActionType aType, TInt aPriority, TGOomSyncMode aSyncMode, TInt aRamEstimate, TInt aWgId, TUint aWgIndex)
+: iType(aType), iPriority(aPriority), iSyncMode(aSyncMode), iRamEstimate(aRamEstimate), iWgId(aWgId), iWgIndex(aWgIndex), iRunPlugin(NULL)
+    {   
+    }
+
+    
+TActionRef::TActionType TActionRef::Type() const
+    {
+    return iType;
+    }
+
+TUint TActionRef::Priority() const
+    {
+    return iPriority;
+    }
+
+void TActionRef::SetPriority(TUint aPriority)
+    {
+    iPriority = aPriority;
+    }
+
+TGOomSyncMode TActionRef::SyncMode() const
+    {
+    return iSyncMode;
+    }
+    
+TInt TActionRef::RamEstimate() const
+    {
+    return iRamEstimate;
+    }
+
+TInt TActionRef::WgId() const
+    {
+    return iWgId;
+    }
+
+TInt TActionRef::WgIndex() const
+    {
+    return iWgIndex;
+    }
+
+CGOomRunPlugin& TActionRef::RunPlugin()
+    {
+    return *iRunPlugin;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomappclosetimer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing GOOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#include "goomappclosetimer.h"
+#include "goomcloseapp.h"
+#include "goomtraces.h"
+
+CGOomAppCloseTimer* CGOomAppCloseTimer::NewL(CGOomCloseApp& aMonitor)
+    {
+    FUNC_LOG;
+
+    CGOomAppCloseTimer* self = new (ELeave) CGOomAppCloseTimer(aMonitor);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CGOomAppCloseTimer::CGOomAppCloseTimer(CGOomCloseApp& aMonitor)
+: CTimer(CActive::EPriorityStandard), iMonitor(aMonitor)
+    {
+    FUNC_LOG;
+
+    CActiveScheduler::Add(this);
+    }
+
+void CGOomAppCloseTimer::RunL()
+    {
+    FUNC_LOG;
+    if(iState == EGOomAppClosing)
+        {
+        iMonitor.KillTask();
+        }
+    else
+        {
+        iMonitor.KillTaskWaitDone();
+        }
+    }
+
+void CGOomAppCloseTimer::SetState(TGOomAppCloseState aState)
+    {
+    FUNC_LOG;
+    iState=aState;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomappclosewatcher.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing GOOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#include "goomappclosewatcher.h"
+#include "goomcloseapp.h"
+#include "goomtraces.h"
+
+CGOomAppCloseWatcher::CGOomAppCloseWatcher(CGOomCloseApp& aMonitor) : CActive(CActive::EPriorityStandard), iMonitor(aMonitor)
+    {
+    FUNC_LOG;
+
+    CActiveScheduler::Add(this);
+    }
+
+CGOomAppCloseWatcher::~CGOomAppCloseWatcher()
+    {
+    FUNC_LOG;
+
+    Cancel();
+    }
+
+void CGOomAppCloseWatcher::Start(const TApaTask& aTask)
+    {
+    FUNC_LOG;
+
+    if (!IsActive())
+        {
+        TInt err = iThread.Open(aTask.ThreadId());
+        if (err == KErrNone)
+            {
+            iOriginalProcessPriority = iThread.ProcessPriority();
+            iThread.SetProcessPriority(EPriorityForeground);
+            iThread.Logon(iStatus);
+            SetActive();
+            }
+        else
+            {
+            TRequestStatus* s = &iStatus;
+            User::RequestComplete(s, err);
+            SetActive();
+            }
+        }
+    }
+
+void CGOomAppCloseWatcher::DoCancel()
+    {
+    FUNC_LOG;
+
+    iThread.LogonCancel(iStatus);
+    iThread.SetProcessPriority(iOriginalProcessPriority);
+    iThread.Close();
+    }
+
+void CGOomAppCloseWatcher::RunL()
+    {
+    FUNC_LOG;
+
+    if (iThread.Handle())
+        iThread.SetProcessPriority(iOriginalProcessPriority);
+    iThread.Close();
+    // Experimentation shows that memory may take up to 40ms
+    // to be released back to the system after app thread close.
+    // Using this delay should minimise the number of apps that
+    // need to be closed to recover the necessary memory.
+    const TInt KAppTidyUpDelay = 40000;
+    User::After(KAppTidyUpDelay);
+    iMonitor.CloseAppEvent();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomapplicationconfig.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#include "goomapplicationconfig.h"
+#include "goomconstants.hrh"
+#include "goomcloseappconfig.h"
+#include "goomtraces.h"
+
+CGOomApplicationConfig* CGOomApplicationConfig::NewL(TUint aApplicationId)
+    {
+    FUNC_LOG;
+
+    CGOomApplicationConfig* self = new (ELeave) CGOomApplicationConfig(aApplicationId);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Add a rule
+// This class takes ownership of the given rule
+// This rule applies to this application itself (and not a plugin associated with this application)
+// The rule would usually apply to an "application close" event
+void CGOomApplicationConfig::AddRuleL(MGOomRuleConfig* aRule)
+    {   
+    FUNC_LOG;
+
+   __ASSERT_ALWAYS(iCloseAppConfig, GOomMonitorPanic(KRuleConfiguredBeforeApplication));
+    
+    iCloseAppConfig->AddRuleL(aRule);
+    }
+
+CGOomApplicationConfig::~CGOomApplicationConfig()
+    {
+    FUNC_LOG;
+
+    delete iCloseAppConfig;
+    }
+
+void CGOomApplicationConfig::ConstructL()
+    {
+    FUNC_LOG;
+
+    iGoodRamThreshold = KGOomThresholdUnset;
+    iLowRamThreshold = KGOomThresholdUnset;  
+    iTargetFree = KGOomThresholdUnset;
+    }
+
+CGOomApplicationConfig::CGOomApplicationConfig(TUint aApplicationId) : iApplicationId(aApplicationId)
+    {
+    FUNC_LOG;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomcloseapp.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing GOOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#include <apgtask.h>
+
+#include "goomcloseapp.h"
+#include "goomtraces.h"
+#include "goomappclosetimer.h"
+#include "goomappclosewatcher.h"
+#include "goomactionref.h"
+
+const TInt KGOomMaxAppExitTime = 1000000;
+const TInt KGOomMaxAppAfterKillWaitTime = 1000000;
+
+CGOomCloseApp* CGOomCloseApp::NewL(MGOomActionObserver& aStateChangeObserver, RWsSession& aWs)
+    {
+    FUNC_LOG;
+
+    CGOomCloseApp* self = new (ELeave) CGOomCloseApp(aStateChangeObserver, aWs);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Close the application in order to free memory
+// Call the CGOomAction::MemoryFreed when it is done
+void CGOomCloseApp::FreeMemory(TInt)
+    {
+    FUNC_LOG;
+
+    iAppCloserRunning = ETrue;
+    
+    // Set the TApaTask to the app
+    iCurrentTask.SetWgId(iWgId);
+    
+    // Start a timer and the thread watcher 
+    iAppCloseTimer->SetState(CGOomAppCloseTimer::EGOomAppClosing);
+    iAppCloseTimer->After(KGOomMaxAppExitTime);
+    iAppCloseWatcher->Start(iCurrentTask);
+    // Tell the app to close
+    TRACES1("CGOomCloseApp::FreeMemory: Closing app with window group id %d",iWgId);
+    iCurrentTask.EndTask();
+    }
+
+CGOomCloseApp::~CGOomCloseApp()
+    {
+    FUNC_LOG;
+
+    if (iAppCloseTimer)
+        iAppCloseTimer->Cancel();
+    
+    if (iAppCloseWatcher)
+        iAppCloseWatcher->Cancel();
+    
+    delete iAppCloseTimer;    
+    delete iAppCloseWatcher;
+    }
+
+// Callback from CGOomAppCloseWatcher and CGOomAppCloseTimer
+void CGOomCloseApp::CloseAppEvent()
+    {
+    FUNC_LOG;
+
+    // The application has closed (or we have a timeout)
+    iAppCloserRunning = EFalse;
+    
+    if (iAppCloseTimer)
+        iAppCloseTimer->Cancel();
+    if (iAppCloseWatcher)
+        iAppCloseWatcher->Cancel(); 
+    
+    iAppCloseTimer->SetState(CGOomAppCloseTimer::EGOomAppKilled);
+    iAppCloseTimer->After(KGOomMaxAppAfterKillWaitTime);
+    //MemoryFreed(KErrNone);
+    }
+
+void CGOomCloseApp::Reconfigure(const TActionRef& aRef)
+    {
+    FUNC_LOG;
+
+    iWgId = aRef.WgId();    
+    }
+
+void CGOomCloseApp::ConstructL()
+    {
+    FUNC_LOG;
+
+    iAppCloseTimer = CGOomAppCloseTimer::NewL(*this);
+    iAppCloseWatcher = new(ELeave) CGOomAppCloseWatcher(*this);
+    }
+        
+CGOomCloseApp::CGOomCloseApp(MGOomActionObserver& aStateChangeObserver, RWsSession& aWs)
+                                : CGOomAction(aStateChangeObserver), iCurrentTask(aWs)
+    {
+    FUNC_LOG;
+    }
+
+// ----------------------------------------------
+// Callback from iAppCloseTimer
+// App refused to exit gracefully on given time
+// ----------------------------------------------
+//
+void CGOomCloseApp::KillTask()
+    {
+    FUNC_LOG;
+    if (iAppCloseWatcher)
+        {
+        iAppCloseWatcher->Cancel(); 
+        }
+    
+    iCurrentTask.KillTask();
+    iAppCloserRunning = EFalse;
+    
+    iAppCloseTimer->SetState(CGOomAppCloseTimer::EGOomAppKilled);
+    iAppCloseTimer->After(KGOomMaxAppAfterKillWaitTime);
+    //MemoryFreed(KErrNone);
+    }
+
+void CGOomCloseApp::KillTaskWaitDone()
+    {
+    FUNC_LOG;
+    MemoryFreed(KErrNone);
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomcloseappconfig.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#include "goomcloseappconfig.h"
+#include "goomtraces.h"
+
+CGOomCloseAppConfig* CGOomCloseAppConfig::NewL(TInt32 aId)
+    {
+    FUNC_LOG;
+
+    CGOomCloseAppConfig* self = new (ELeave) CGOomCloseAppConfig(aId);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CGOomCloseAppConfig::~CGOomCloseAppConfig()
+    {
+    FUNC_LOG;
+    }
+
+CGOomCloseAppConfig::CGOomCloseAppConfig(TInt32 aId) : CGOomActionConfig(aId)
+    {
+    FUNC_LOG;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomconfig.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,194 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#include <e32hashtab.h>
+
+#include "goomconfig.h"
+#include "goomconstants.hrh"
+#include "goomapplicationconfig.h"
+#include "goomrunpluginconfig.h"
+#include "goomcloseappconfig.h"
+#include "goomtraces.h"
+
+CGOomConfig* CGOomConfig::NewL()
+    {
+    FUNC_LOG;
+
+    CGOomConfig* self = new (ELeave) CGOomConfig;
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+// Add the configuration for an application closure.
+// This class takes ownership of this action.
+void CGOomConfig::SetAppCloseConfigL(CGOomCloseAppConfig* aActionConfig)
+    {
+    FUNC_LOG;
+
+    // Find the right application config (if there is one) for the app
+    // The map actually contains pointers for values, so we get pointers to pointers here...
+    CGOomApplicationConfig** applicationConfigPointer = iApplicationToConfigMapping.Find(aActionConfig->iId);
+    
+    // Used to de-reference the pointer-to-pointer, hopefully making the code more readable
+    CGOomApplicationConfig* applicationConfig = NULL;
+    
+    // Create a new CGOomApplicationConfig if there isn't one for this app
+    if (!applicationConfigPointer)
+        {
+        applicationConfig = CGOomApplicationConfig::NewL(aActionConfig->iId);
+        iApplicationToConfigMapping.InsertL(aActionConfig->iId, applicationConfig);
+        }
+    else
+        {
+        applicationConfig = *applicationConfigPointer;
+        }
+    
+    // Append the action config to the appropriate list (the list for the relevant application)
+    applicationConfig->SetAppCloseConfig(aActionConfig);    
+    }
+
+// Add the configuration for a plugin action.
+// This class takes ownership of the configuration object.
+void CGOomConfig::AddPluginConfigL(CGOomRunPluginConfig* aPluginConfig)
+    {
+    FUNC_LOG;
+
+    // Check if the plugin has already been added, if so then this is an error in configuration (something is trying to add the same plugin twice)
+    CGOomRunPluginConfig** runPluginConfig = iPluginToConfigMapping.Find(aPluginConfig->Id());
+    if (runPluginConfig)
+        {
+        GOomMonitorPanic(KPluginConfigAddedTwice);
+        }
+    
+    iPluginToConfigMapping.InsertL(aPluginConfig->Id(), aPluginConfig);
+    
+    }
+
+// Add a rule
+// This class takes ownership of the given rule
+// This rule applies to the specified application (and not a plugin associated with this application)
+// The rule would usually apply to an "application close" event
+void CGOomConfig::AddApplicationRuleL(TUint aTargetAppId, MGOomRuleConfig* aRule)
+    {
+    FUNC_LOG;
+
+    CGOomApplicationConfig** applicationConfig = iApplicationToConfigMapping.Find(aTargetAppId);
+    
+    if (applicationConfig)
+        {
+        (*applicationConfig)->AddRuleL(aRule);
+        }
+    else
+        {
+        GOomMonitorPanic(KRuleConfiguredBeforeApplication);
+        }
+    }
+
+// Add a rule for a plugin
+// This class takes ownership of the given rule
+// This rule is applied to the plugin with the specified ID
+void CGOomConfig::AddPluginRuleL(TUint aPluginId, MGOomRuleConfig* aRule)
+    {
+    FUNC_LOG;
+
+    CGOomRunPluginConfig** runPluginConfig = iPluginToConfigMapping.Find(aPluginId);
+    
+    if (runPluginConfig)
+        {
+        (*runPluginConfig)->AddRuleL(aRule);
+        }
+    else
+        {
+        GOomMonitorPanic(KRuleConfiguredBeforePlugin);
+        }   
+    }
+
+// Add this application config - this class takes ownership of it
+// Application config includes settings for a particular application, e.g. whether or not it can be closed
+void CGOomConfig::AddApplicationConfigL(CGOomApplicationConfig* aApplicationConfig)
+    {
+    FUNC_LOG;
+
+    // Check if the application has already been added, if so then this is an error in configuration (something is trying to add the same app twice)
+    CGOomApplicationConfig** applicationConfig = iApplicationToConfigMapping.Find(aApplicationConfig->Id());
+    if (applicationConfig)
+        {
+        GOomMonitorPanic(KAppConfigAddedTwice);
+        }
+    
+    iApplicationToConfigMapping.InsertL(aApplicationConfig->Id(), aApplicationConfig);
+    }
+
+// Get the list of configured actions for the given app id
+// If no specific actions have been configured for this application then the default action is returned
+CGOomApplicationConfig& CGOomConfig::GetApplicationConfig(TInt32 aAppId)
+    {
+    FUNC_LOG;
+
+    CGOomApplicationConfig** applicationConfig = iApplicationToConfigMapping.Find(aAppId);
+    
+    if (!applicationConfig)
+        applicationConfig = iApplicationToConfigMapping.Find(KGOomDefaultAppId);
+    
+    // The default app configuration should always exist
+    __ASSERT_ALWAYS(applicationConfig, GOomMonitorPanic(KGOomDefaultAppNotConfigured));
+    
+    return *(*applicationConfig);
+    }
+
+// Get the plugin configuration for the given plugin id
+// If no specific actions have been configured for this plugin then the default plugin configuration is returned
+CGOomRunPluginConfig& CGOomConfig::GetPluginConfig(TInt32 aPluginId)
+    {
+    FUNC_LOG;
+
+    CGOomRunPluginConfig** runPluginConfig = iPluginToConfigMapping.Find(aPluginId);
+    
+    if (!runPluginConfig)
+        runPluginConfig = iPluginToConfigMapping.Find(KGOomDefaultPluginId);
+    
+    // The default app configuration should always exist
+    __ASSERT_ALWAYS(runPluginConfig, GOomMonitorPanic(KGOomDefaultPluginNotConfigured));
+    
+    return *(*runPluginConfig);
+    }
+
+CGOomConfig::~CGOomConfig()
+    {
+    FUNC_LOG;
+
+    // Iterate through the hash map deleting all of the items
+    RHashMap<TInt32, CGOomApplicationConfig*>::TIter iterator(iApplicationToConfigMapping);
+    while (iterator.NextValue())
+        delete iterator.CurrentValue();
+    
+    // Iterate through the plugiun hash map deleting all of the items
+    RHashMap<TInt32, CGOomRunPluginConfig*>::TIter pluginIterator(iPluginToConfigMapping);
+    while (pluginIterator.NextValue())
+        delete pluginIterator.CurrentValue();
+    
+    iApplicationToConfigMapping.Close();
+    }
+
+void CGOomConfig::ConstructL()
+    {
+    FUNC_LOG;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomconfigparser.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1039 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 parser for the Graphics OOM configuration file
+*
+*/
+
+
+#include <e32base.h>
+#include <xml/parser.h>
+
+#include "goomconfigparser.h"
+#include "goompanic.h"
+#include "goomtraces.h"
+#include "goomidletimerule.h"
+#include "goomforegroundrule.h"
+#include "goomconstants.hrh"
+#include "goomapplicationconfig.h"
+#include "goomcloseappconfig.h"
+#include "goomconfig.h"
+#include "goomrunpluginconfig.h"
+
+enum
+{
+KGOomErrMoreThanOneGOomConfig = 0,
+KGOomErrGlobalSettingsMustComeAfterRoot,
+KGOomErrAppSettingsMustComeAfterGlobalSettings,
+KGOomErrCloseAppSettingsMustComeAfterAppSettings,
+KGOomErrAppIdleSettingsMustComeAfterAppCloseSettings,
+KGOomErrLowRamErrorInGlobalSettings,
+KGOomErrGoodRamErrorInGlobalSettings,
+KGOomErrMaxCloseErrorInGlobalSettings,
+KGOomErrDefaultPriorityErrorInGlobalSettings,
+KGOomErrMissingUidFromAppCloseConfig,
+KGOomErrMissingPriorityFromAppCloseConfig,
+KGOomErrMissingSyncModeFromAppCloseConfig,
+KGOomErrMissingEstimateFromAppCloseConfig,
+KGOomErrInvalidSyncMode,
+KGOomErrMissingSyncModeInAppCloseConfig,
+KGOomErrBadOrMissingPriorityInAppIdleRule,
+KGOomErrBadOrMissingIdleTimeInAppIdleRule,
+KGOomErrBadOrMissingUidInAppIdleRule,
+KGOomErrBadNeverCloseValue,
+KGOomErrBadOrMissingUidInAppConfig,
+KGOomErrBadOrMissingPriorityInAppCloseConfig,
+KGOomErrBadLowThresholdValueForAppConfig,
+KGOomErrBadGoodThresholdValueForAppConfig,
+KGOomErrBadTargetFreeValueForAppConfig,
+KGOomErrSystemPluginSettingsMustComeAfterAppCloseSettings,
+KGOomErrAppPluginSettingsMustComeAfterSystemPluginSettings,
+KGOomErrAppPluginIdleTimeRulesMustComeAfterAppPluginSettings,
+KGOomErrBadOrMissingUidInAppCloseConfig,
+KGOomErrBadOrMissingUidInSystemPluginConfig,
+KGOomErrBadOrMissingPriorityInSystemPluginConfig,
+KGOomErrBadOrMissingTargetAppIdInAppPluginConfig,
+KGOomErrBadOrMissingUidInAppPluginConfig,
+KGOomErrBadOrMissingPriorityInAppPluginConfig,
+KGOomErrBadOrMissingPriorityInPluginIdleRule,
+KGOomErrBadOrMissingIdleTimeInPluginIdleRule,
+KGOomErrBadOrMissingUidInPluginIdleRule,
+KGOomErrBadOrMissingUidInForegroundAppRule,
+KGOomErrBadOrMissingPriorityInForegroundAppRule,
+KGOomErrBadOrMissingTargetAppIdInForegroundAppRule,
+KGOomErrDefaultWaitAfterPluginInGlobalSettings,
+KGOomErrBadOrMissingPriorityInForceCheck,
+KGOomErrGOomRulesMustComeLast,
+KGOomErrBadPluginWaitTime,
+KGOomErrBadXml,
+KGOomErrAppCloseIdleRuleOutsideAppCloseElement,
+KGOomErrForegroundAppRuleOutsideAppCloseElement,
+KGOomErrPluginIdleRuleOutsideAppPluginElement,
+KGOomErrPluginForegroundRuleOutsidePluginElement
+};
+
+
+const TInt KGOomXmlFileBufferSize = 1024;
+
+using namespace Xml;
+
+// Mime type of the parsed document
+_LIT8(KXmlMimeType, "text/xml");
+
+_LIT(KGOomConfigFilePath, ":\\private\\10207218\\goomconfig.xml");
+_LIT(KRomDrive, "z");
+
+// Element strings
+// Root
+_LIT8(KGOomConfigGOomConfig, "goom_config");
+
+// Global settings
+_LIT8(KGOomConfigGlobalSettings, "global_settings");
+_LIT8(KGOomConfigForceCheckAtPriority, "force_check");
+
+// App settings
+_LIT8(KGOomConfigAppSettings, "app_specific_thresholds");
+_LIT8(KGOomConfigApp, "app");
+
+// App close settings
+_LIT8(KGOomConfigAppCloseSettings, "app_close_settings");
+_LIT8(KGOomConfigCloseApp, "close_app");
+
+// App close idle time
+_LIT8(KGOomConfigAppCloseIdlePriority, "app_close_idle_priority");
+
+_LIT8(KGOomConfigForegroundAppPriority, "foreground_app_priority");
+
+// Global settings attribute names
+_LIT8(KGOomAttributeLowRamThreshold, "low_ram_threshold");
+_LIT8(KGOomAttributeGoodRamThreshold, "good_ram_threshold");
+_LIT8(KGOomAttributeMaxAppCloseBatch, "max_app_close_batch");
+_LIT8(KGOomAttributeDefaultWaitAfterPlugin, "default_wait_after_plugin");
+
+//App specific
+_LIT8(KGOomAttributeTargetFreeOnStartup, "target_free_on_startup");
+
+// System plugins 
+
+_LIT8(KGOomAttributeSystemPluginSettings, "system_plugin_settings");
+_LIT8(KGOomAttributeSystemPlugin, "system_plugin");
+
+// Application plugins
+
+_LIT8(KGOomAttributeAppPluginSettings, "app_plugin_settings");
+_LIT8(KGOomAttributeAppPlugin, "app_plugin");
+
+// Plugin idle time rules
+
+_LIT8(KGOomAttributePluginIdlePriority, "plugin_idle_priority");
+
+// Plugin foreground app rules
+_LIT8(KGOomAttributePluginForegroundAppPriority, "plugin_foreground_app_priority");
+
+// Atribute names
+_LIT8(KGOomAttibuteUid, "uid");
+_LIT8(KGOomAttibuteSyncMode, "sync_mode");
+_LIT8(KGOomAttibutePriority, "priority");
+_LIT8(KGOomAttibuteRamEstimate, "ram_estimate");
+
+_LIT8(KGOomConfigSyncModeContinue, "continue");
+_LIT8(KGOomConfigSyncModeCheck, "check");
+_LIT8(KGOomConfigSyncModeEstimate, "estimate");
+
+_LIT8(KGOomAttibuteIdleTime, "idle_time");
+_LIT8(KGOomAttibuteIdlePriority, "priority");
+
+_LIT8(KGOomAttibuteNeverClose, "NEVER_CLOSE");
+
+_LIT8(KGOomAttributeTargetAppId, "target_app_id");
+
+_LIT8(KGOomAttributeWait, "wait");
+
+_LIT8(KGOomAttributeIfForegroundAppId, "if_foreground_app_id");
+
+_LIT8(KGOomConfigDefaultAppUid, "DEFAULT_APP");
+_LIT8(KGOomConfigDefaultPluginUid, "DEFAULT_PLUGIN");
+_LIT8(KGOomConfigTargetAppValue, "TARGET_APP");
+
+_LIT8(KGOomConfigBusyAppUid, "BUSY_APP");
+_LIT8(KGOomConfigHighPriorityAppUid, "HIGH_PRIORITY_APP");
+
+CGOomConfigParser::CGOomConfigParser(CGOomConfig& aConfig, RFs& aFs) : iConfig(aConfig), iFs(aFs), iState(EGOomParsingStateNone)
+    {
+    }
+
+void CGOomConfigParser::ParseL()
+    {
+    FUNC_LOG;
+
+    TRACES("CGOomConfigParser::ParseL: Parsing Config File");
+    
+    CParser* parser = CParser::NewLC(KXmlMimeType, *this);
+    
+    RFile configFile;
+    TFileName configFileName;
+    TChar driveChar = iFs.GetSystemDriveChar();
+    configFileName.Append(driveChar);
+    configFileName.Append(KGOomConfigFilePath);
+    if (configFile.Open(iFs, configFileName, EFileShareExclusive) != KErrNone)
+        {
+        configFileName.Replace(0,1,KRomDrive); //replace 'c' with 'z'
+        User::LeaveIfError(configFile.Open(iFs, configFileName, EFileShareExclusive));
+        }
+    CleanupClosePushL(configFile);
+    
+    TBuf8<KGOomXmlFileBufferSize> fileBuffer;
+    TInt bytesRead;
+    do
+        {
+        User::LeaveIfError(configFile.Read(fileBuffer));
+        bytesRead = fileBuffer.Size();
+        
+        parser->ParseL(fileBuffer);
+        
+        } while (bytesRead != 0);
+    
+    CleanupStack::PopAndDestroy(2, parser); // config file - automatically closes it
+                                            // parser
+            
+    TRACES("CGOomConfigParser::ParseL: Finished Parsing Config File");    
+    }
+
+void CGOomConfigParser::OnStartDocumentL(const RDocumentParameters&, TInt)
+    {
+    FUNC_LOG;
+    }
+
+void CGOomConfigParser::OnEndDocumentL(TInt)
+    {
+    FUNC_LOG;
+    }
+
+
+void CGOomConfigParser::OnEndElementL(const RTagInfo&, TInt)
+    {
+    }
+
+void CGOomConfigParser::OnContentL(const TDesC8&, TInt)
+    {
+    }
+
+void CGOomConfigParser::OnStartPrefixMappingL(const RString&, const RString&, 
+                                   TInt)
+    {
+    }
+
+void CGOomConfigParser::OnEndPrefixMappingL(const RString&, TInt)
+    {
+    }
+
+void CGOomConfigParser::OnIgnorableWhiteSpaceL(const TDesC8&, TInt)
+    {
+    }
+
+void CGOomConfigParser::OnSkippedEntityL(const RString&, TInt)
+    {
+    }
+
+void CGOomConfigParser::OnProcessingInstructionL(const TDesC8&, const TDesC8&, 
+                                      TInt)
+    {
+    }
+
+void CGOomConfigParser::OnError(TInt)
+    {
+    }
+
+TAny* CGOomConfigParser::GetExtendedInterface(const TInt32)
+    {
+    return 0;
+    }
+
+void CGOomConfigParser::OnStartElementL(const RTagInfo& aElement, const RAttributeArray& aAttributes, 
+                             TInt aErrorCode)
+    {
+    if (aErrorCode != KErrNone)
+        ConfigError(KGOomErrBadXml);
+    
+    StartElementL(aElement.LocalName().DesC(), aAttributes);
+    }
+
+TInt CGOomConfigParser::StartElementL(const TDesC8& aLocalName,
+                                        const RAttributeArray& aAttributes)
+    {
+    // Root
+    if (aLocalName == KGOomConfigGOomConfig)
+        {
+        if (iState != EGOomParsingStateNone)
+            ConfigError(KGOomErrMoreThanOneGOomConfig);
+        
+        ChangeState(EGOomParsingStateRoot);
+        }
+    // Parse main elements
+    else if (aLocalName == KGOomConfigGlobalSettings)
+        {
+        if (iState != EGOomParsingStateRoot)
+            ConfigError(KGOomErrGlobalSettingsMustComeAfterRoot);
+        
+        SetGlobalSettings(aAttributes);
+        
+        ChangeState(EGOomParsingStateGlobalSettings);
+        }
+    else if (aLocalName == KGOomConfigAppSettings)
+        {
+        ChangeState(EGOomParsingStateAppSettings);
+        }
+    else if (aLocalName == KGOomConfigAppCloseSettings)
+        {
+        ChangeState(EGOomParsingStateAppCloseSettings);
+        }
+    else if (aLocalName == KGOomAttributeSystemPluginSettings)
+        {
+        ChangeState(EGOomParsingStateSystemPluginSettings);
+        }
+    else if (aLocalName == KGOomAttributeAppPluginSettings)
+        {
+        ChangeState(EGOomParsingStateAppPluginSettings);
+        }
+    // Parse actual configuration elements
+    else if (aLocalName == KGOomConfigForceCheckAtPriority)
+        {
+        SetForceCheckConfigL(aAttributes);
+        }
+    else if (aLocalName == KGOomConfigApp)
+        {
+        SetAppConfigL(aAttributes);
+        }
+    else if (aLocalName == KGOomConfigCloseApp)
+        {
+        SetCloseAppConfigL(aAttributes);
+        }
+    else if (aLocalName == KGOomConfigAppCloseIdlePriority)
+        {
+        CheckState(EGOomParsingStateAppCloseSettings, KGOomErrAppCloseIdleRuleOutsideAppCloseElement);
+        SetAppCloseIdlePriorityConfigL(aAttributes);
+        }
+    else if (aLocalName == KGOomConfigForegroundAppPriority)
+        {
+        CheckState(EGOomParsingStateAppCloseSettings, KGOomErrForegroundAppRuleOutsideAppCloseElement);
+        SetForegroundAppPriorityL(aAttributes);
+        }
+    else if (aLocalName == KGOomAttributeSystemPlugin)
+        {
+        SetSystemPluginConfigL(aAttributes);
+        }
+    else if (aLocalName == KGOomAttributeAppPlugin)
+        {
+        SetAppPluginConfigL(aAttributes);
+        }
+    else if (aLocalName == KGOomAttributePluginIdlePriority)
+        {
+        CheckState(EGOomParsingStateAppPluginSettings, KGOomErrPluginIdleRuleOutsideAppPluginElement);
+        SetPluginIdlePriorityL(aAttributes);
+        }
+    else if (aLocalName == KGOomAttributePluginForegroundAppPriority)
+        {
+        CheckState(EGOomParsingStateAppPluginSettings, EGOomParsingStateSystemPluginSettings, KGOomErrPluginForegroundRuleOutsidePluginElement);
+        SetPluginForegroundAppPriorityL(aAttributes);
+        }
+    
+    return KErrNone;
+    }
+
+void CGOomConfigParser::ConfigError(TInt aError)
+    {
+    GOomConfigParserPanic(aError);
+    }
+
+void CGOomConfigParser::SetGlobalSettings(const RAttributeArray& aAttributes)
+    {
+    TInt defaultLowMemoryThreshold;    
+    TInt err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttributeLowRamThreshold, defaultLowMemoryThreshold);
+
+    if (err == KErrNone)
+        iConfig.SetDefaultLowRamThreshold(defaultLowMemoryThreshold * 1024);
+    else
+        ConfigError(KGOomErrLowRamErrorInGlobalSettings);
+    
+    if (err == KErrNone)
+        {
+        TInt defaultGoodMemoryThreshold;    
+        TInt err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttributeGoodRamThreshold, defaultGoodMemoryThreshold);
+
+        if (err == KErrNone)
+            iConfig.SetDefaultGoodRamThreshold(defaultGoodMemoryThreshold * 1024);
+        else
+            ConfigError(KGOomErrGoodRamErrorInGlobalSettings);
+        }
+
+    if (err == KErrNone)
+        {
+        TInt defaultMaxCloseAppBatch;    
+        TInt err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttributeMaxAppCloseBatch, defaultMaxCloseAppBatch);
+
+        if (err == KErrNone)
+            iConfig.SetMaxCloseAppBatch(defaultMaxCloseAppBatch);
+        else
+            ConfigError(KGOomErrMaxCloseErrorInGlobalSettings);
+        }
+    
+    if (err == KErrNone)
+        {
+        TInt defaultWaitAfterPlugin;    
+        TInt err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttributeDefaultWaitAfterPlugin, defaultWaitAfterPlugin);
+
+        if (err == KErrNone)
+            iConfig.SetDefaultWaitAfterPlugin(defaultWaitAfterPlugin);
+        else
+            ConfigError(KGOomErrDefaultWaitAfterPluginInGlobalSettings);
+        }
+    }
+
+void CGOomConfigParser::SetForceCheckConfigL(const RAttributeArray& aAttributes)
+    {
+    TUint priority;
+    TInt err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttibutePriority, priority);
+    if (err == KErrNone)
+        {
+        iConfig.GlobalConfig().AddForceCheckPriorityL(priority);
+        }
+    else
+        {
+        ConfigError(KGOomErrBadOrMissingPriorityInForceCheck);    
+        }
+    }
+
+void CGOomConfigParser::SetAppConfigL(const RAttributeArray& aAttributes)
+    {
+    TUint uid;
+    CGOomApplicationConfig* appConfig = NULL;
+    
+    TInt err = GetValueFromHexAttributeList(aAttributes, KGOomAttibuteUid, uid);
+    
+    if (err != KErrNone)
+        {
+        ConfigError(KGOomErrBadOrMissingUidInAppConfig);
+        }
+    else
+        iParentUid = uid;
+
+    appConfig = CGOomApplicationConfig::NewL(uid);
+    CleanupStack::PushL(appConfig);    
+        
+    // Set the app specific memory thresholds (if they exist)
+    // Get the app specific low threshold
+    if (err == KErrNone)
+        {
+        TUint lowThreshold;
+        err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttributeLowRamThreshold, lowThreshold);
+        if (err == KErrNone)
+            {
+            appConfig->iLowRamThreshold = lowThreshold * 1024; // The config files work in K, so we need to multiply by 1024
+            }
+        else if (err == KErrNotFound)
+            err = KErrNone;
+        
+        if (err != KErrNone)
+            ConfigError(KGOomErrBadLowThresholdValueForAppConfig);
+        }
+
+    // Get the app specific good threshold
+    if (err == KErrNone)
+        {
+        TUint goodThreshold;
+        err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttributeGoodRamThreshold, goodThreshold);
+        if (err == KErrNone)
+            {
+            appConfig->iGoodRamThreshold = goodThreshold * 1024; // The config files work in K, so we need to multiply by 1024
+            }
+        else if (err == KErrNotFound)
+            err = KErrNone;
+        
+        if (err != KErrNone)
+            ConfigError(KGOomErrBadGoodThresholdValueForAppConfig);
+        }
+    
+    // Get the app specific TargetFreeOnStartup
+        if (err == KErrNone)
+            {
+            TUint targetFree;
+            err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttributeTargetFreeOnStartup, targetFree);
+            if (err == KErrNone)
+                {
+                appConfig->iTargetFree = targetFree * 1024; // The config files work in K, so we need to multiply by 1024
+                }
+            else if (err == KErrNotFound)
+                err = KErrNone;
+            
+            if (err != KErrNone)
+                ConfigError(KGOomErrBadTargetFreeValueForAppConfig);
+            }
+    
+    // Add the applciation config to the main config
+    if ((err == KErrNone) && (appConfig))
+        {
+        iConfig.AddApplicationConfigL(appConfig);
+        }
+    
+    if (appConfig)
+        CleanupStack::Pop(appConfig);
+    }
+
+void CGOomConfigParser::SetCloseAppConfigL(const RAttributeArray& aAttributes)
+    {
+    // Get and convert uid attribute to TInt
+    TInt err = KErrNone;
+    
+    TUint uid;
+    err = GetValueFromHexAttributeList(aAttributes, KGOomAttibuteUid, uid);
+
+    if (err != KErrNone)
+        {
+        ConfigError(KGOomErrBadOrMissingUidInAppCloseConfig);    
+        return;
+        }
+    else
+        iParentUid = uid;
+    
+    CGOomCloseAppConfig* closeAppConfig = CGOomCloseAppConfig::NewL(uid); // Radio UID
+    CleanupStack::PushL(closeAppConfig);
+
+     if (err == KErrNone)
+        {
+        // Check that we have a priority for the added app_close event
+        // Specifying a priority is mandatory
+        TUint priority;
+        err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttibutePriority, priority);
+        if (err == KErrNone)
+            {
+            closeAppConfig->SetDefaultPriority(priority);
+            }
+        else
+            {
+            ConfigError(KGOomErrBadOrMissingPriorityInAppCloseConfig);    
+            }
+        }
+    
+    if (err == KErrNone)
+        {
+        TPtrC8 syncModeString;
+        err = GetValueFromAttributeList(aAttributes, KGOomAttibuteSyncMode, syncModeString);
+        
+        if (err == KErrNone)
+            {
+            TGOomSyncMode syncMode = EContinue;
+            
+            if (syncModeString == KGOomConfigSyncModeContinue)
+                syncMode = EContinue;
+            else if (syncModeString == KGOomConfigSyncModeCheck)
+                syncMode = ECheckRam;
+            else if (syncModeString == KGOomConfigSyncModeEstimate)
+                syncMode = EEstimate;
+            else
+                ConfigError(KGOomErrInvalidSyncMode);
+            
+            if (err == KErrNone)
+                {
+                closeAppConfig->iSyncMode = syncMode;
+                }
+            }
+        else
+            {
+            ConfigError(KGOomErrMissingSyncModeInAppCloseConfig);
+            }
+        }
+    
+    
+    if (err == KErrNone)
+        {
+        // If we have a default priority attribute then add it, otherwise use the global default priority
+        TInt ramEstimate;
+        err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttibuteRamEstimate, ramEstimate);
+        if ((err == KErrNotFound) && (closeAppConfig->iSyncMode != EEstimate))
+            {
+            err = KErrNone;
+            }
+        
+        if (err != KErrNone)
+            ConfigError(KGOomErrMissingEstimateFromAppCloseConfig);
+        else
+            closeAppConfig->iRamEstimate = ramEstimate * 1024;
+           }
+
+    if (err == KErrNone)
+        iConfig.SetAppCloseConfigL(closeAppConfig);
+    
+    CleanupStack::Pop(closeAppConfig);
+    }
+
+void CGOomConfigParser::SetAppCloseIdlePriorityConfigL(const RAttributeArray& aAttributes)
+    {
+    TUint uid;
+    TInt idleTime;
+    TUint priority;
+
+    // Use the UID from the parent scope
+    uid = iParentUid;
+
+    TInt err = KErrNone;
+    
+    err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttibuteIdleTime, idleTime);
+    
+#ifdef __WINS__
+    // The tick is 5 times slower on the emulator than on the phone
+    idleTime = idleTime / 5;
+#endif
+    
+    if (err != KErrNone)
+        {
+        ConfigError(KGOomErrBadOrMissingIdleTimeInAppIdleRule);
+        }
+    
+    if (err == KErrNone)
+        {
+        err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttibuteIdlePriority, priority);
+        
+        if (err != KErrNone)
+            {
+            ConfigError(KGOomErrBadOrMissingPriorityInAppIdleRule);
+            }
+        }
+    
+    if (err == KErrNone)
+        {
+        CGOomIdleTimeRule* idleRule = CGOomIdleTimeRule::NewL(idleTime, priority);
+        CleanupStack::PushL(idleRule);
+        iConfig.AddApplicationRuleL(uid, idleRule);
+        CleanupStack::Pop(idleRule);
+        }
+    }
+
+void CGOomConfigParser::SetForegroundAppPriorityL(const RAttributeArray& aAttributes)
+    {
+    TUint appUid;
+    TUint targetAppId;
+    TUint priority;
+
+    TInt err = KErrNone;
+    
+    // Use the UID from the parent scope
+    appUid = iParentUid;
+
+    // Check that we have a priority for the added system plugin action
+    // Specifying a priority is mandatory
+    err = GetValueFromHexAttributeList(aAttributes, KGOomAttributeIfForegroundAppId, targetAppId);
+    if (err != KErrNone)
+        {
+        ConfigError(KGOomErrBadOrMissingTargetAppIdInForegroundAppRule);    
+        }
+    
+    if (err == KErrNone)
+        {
+        err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttibuteIdlePriority, priority);
+        
+        if (err != KErrNone)
+            {
+            ConfigError(KGOomErrBadOrMissingPriorityInForegroundAppRule);
+            }
+        }
+    
+    if (err == KErrNone)
+        {
+        CGOomForegroundRule* foregroundRule = new (ELeave) CGOomForegroundRule(targetAppId, priority);
+        CleanupStack::PushL(foregroundRule);
+        iConfig.AddApplicationRuleL(appUid, foregroundRule);
+        CleanupStack::Pop(foregroundRule);
+        }
+
+    }
+
+void CGOomConfigParser::SetSystemPluginConfigL(const RAttributeArray& aAttributes)
+    {
+    // Get and convert uid attribute to TInt
+    TInt err = KErrNone;
+    
+    TUint uid;
+    err = GetValueFromHexAttributeList(aAttributes, KGOomAttibuteUid, uid);
+
+    if (err != KErrNone)
+        {
+        ConfigError(KGOomErrBadOrMissingUidInSystemPluginConfig);    
+        return;
+        }
+    else
+        iParentUid = uid;
+    
+    CGOomRunPluginConfig* pluginConfig = CGOomRunPluginConfig::NewL(uid, EGOomSystemPlugin);
+    CleanupStack::PushL(pluginConfig);
+
+     if (err == KErrNone)
+        {
+        // Check that we have a priority for the added system plugin action
+        // Specifying a priority is mandatory
+        TUint priority;
+        err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttibutePriority, priority);
+        if (err == KErrNone)
+            {
+            pluginConfig->SetDefaultPriority(priority);
+            }
+        else
+            {
+            ConfigError(KGOomErrBadOrMissingPriorityInSystemPluginConfig);    
+            }
+        }
+     
+     if (err == KErrNone)
+        {
+        TInt wait;
+        err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttributeWait, wait);
+        if (err == KErrNone)
+            {
+            pluginConfig->SetWaitAfterPlugin(wait);
+            }
+        else if (err == KErrNotFound)
+            {
+            // If this attribute isn't present then just don't set it, and clear the error
+            err = KErrNone;
+            }
+        else
+            ConfigError(KGOomErrBadPluginWaitTime);
+        }
+     
+     if (err == KErrNone)
+         {
+         // Get the config for the sync mode for this plugin (if one is specified) and set it
+         SetPluginSyncMode(aAttributes, *pluginConfig);
+         }
+
+     iConfig.AddPluginConfigL(pluginConfig);
+     
+     CleanupStack::Pop(pluginConfig);
+    }
+
+void CGOomConfigParser::SetAppPluginConfigL(const RAttributeArray& aAttributes)
+    {
+    // Get and convert uid attribute to TInt
+    TInt err = KErrNone;
+    
+    TUint uid;
+    err = GetValueFromHexAttributeList(aAttributes, KGOomAttibuteUid, uid);
+
+    if (err != KErrNone)
+        {
+        ConfigError(KGOomErrBadOrMissingUidInAppPluginConfig);    
+        return;
+        }
+    else
+        iParentUid = uid;
+    
+    CGOomRunPluginConfig* pluginConfig = CGOomRunPluginConfig::NewL(uid, EGOomAppPlugin);
+    CleanupStack::PushL(pluginConfig);
+
+    if (err == KErrNone)
+       {
+       // Check that we have a priority for the added system plugin action
+       // Specifying a priority is mandatory
+        TUint priority;
+        err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttibutePriority, priority);
+        if (err == KErrNone)
+            {
+            pluginConfig->SetDefaultPriority(priority);
+            }
+        else
+            {
+            ConfigError(KGOomErrBadOrMissingPriorityInAppPluginConfig);    
+            }
+       }
+
+    if (err == KErrNone)
+       {
+       // Check that we have a priority for the added system plugin action
+       // Specifying a priority is mandatory
+        TUint targetAppId;
+        err = GetValueFromHexAttributeList(aAttributes, KGOomAttributeTargetAppId, targetAppId);
+        if (err == KErrNone)
+            {
+            pluginConfig->SetTargetApp(targetAppId);
+            iParentTargetApp = targetAppId;
+            }
+        else
+            {
+            ConfigError(KGOomErrBadOrMissingTargetAppIdInAppPluginConfig);    
+            }
+       }
+    
+    if (err == KErrNone)
+       {
+       TInt wait;
+        err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttributeWait, wait);
+        if (err == KErrNone)
+            {
+            pluginConfig->SetWaitAfterPlugin(wait);
+            }
+        else if (err == KErrNotFound)
+            {
+            // If this attribute isn't present then just don't set it, and clear the error
+            err = KErrNone;
+            }
+        else
+            ConfigError(KGOomErrBadPluginWaitTime);
+       }    
+    
+    if (err == KErrNone)
+        {
+        // Get the config for the sync mode for this plugin (if one is specified) and set it
+        SetPluginSyncMode(aAttributes, *pluginConfig);
+        }
+
+     iConfig.AddPluginConfigL(pluginConfig);
+     
+     CleanupStack::Pop(pluginConfig);
+
+    }
+
+void CGOomConfigParser::SetPluginIdlePriorityL(const RAttributeArray& aAttributes)
+    {
+    TUint uid;
+    TInt idleTime;
+    TUint priority;
+
+    TInt err = KErrNone;
+    
+    // Use the UID from the parent scope
+    uid = iParentUid;
+
+    err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttibuteIdleTime, idleTime);
+    
+#ifdef __WINS__
+    // The tick is 5 times slower on the emulator than on the phone
+    idleTime = idleTime / 5;
+#endif
+    
+    if (err != KErrNone)
+        {
+        ConfigError(KGOomErrBadOrMissingIdleTimeInPluginIdleRule);
+        }
+    
+    if (err == KErrNone)
+        {
+        err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttibuteIdlePriority, priority);
+        
+        if (err != KErrNone)
+            {
+            ConfigError(KGOomErrBadOrMissingPriorityInPluginIdleRule);
+            }
+        }
+    
+    if (err == KErrNone)
+        {
+        CGOomIdleTimeRule* idleRule = CGOomIdleTimeRule::NewL(idleTime, priority);
+        CleanupStack::PushL(idleRule);
+        iConfig.AddPluginRuleL(uid, idleRule);
+        CleanupStack::Pop(idleRule);
+        }
+    }
+
+void CGOomConfigParser::SetPluginForegroundAppPriorityL(const RAttributeArray& aAttributes)
+    {
+    TUint uid;
+    TUint targetAppId;
+    TUint priority;
+
+    TInt err = KErrNone;
+    
+    // Use the UID from the parent scope
+    uid = iParentUid;
+
+        // Check that we have a priority for the added system plugin action
+        // Specifying a priority is mandatory
+        
+    TPtrC8 targetAppString;
+    err = GetValueFromAttributeList(aAttributes, KGOomAttributeTargetAppId, targetAppString);
+    if ((err == KErrNone)
+            && (targetAppString == KGOomConfigTargetAppValue)
+            && (iState == EGOomParsingStateAppPluginSettings))
+        // If the target app is specified as "TARGET_APP" then we use the target app from the parent entry
+        {
+        targetAppId = iParentTargetApp;
+        }
+    else
+        {
+        err = GetValueFromHexAttributeList(aAttributes, KGOomAttributeTargetAppId, targetAppId);
+        if (err != KErrNone)
+            {
+            ConfigError(KGOomErrBadOrMissingTargetAppIdInForegroundAppRule);    
+            }
+        }
+     
+    if (err == KErrNone)
+        {
+        err = GetValueFromDecimalAttributeList(aAttributes, KGOomAttibuteIdlePriority, priority);
+        
+        if (err != KErrNone)
+            {
+            ConfigError(KGOomErrBadOrMissingPriorityInForegroundAppRule);
+            }
+        }
+    
+    if (err == KErrNone)
+        {
+        CGOomForegroundRule* foregroundRule = new (ELeave) CGOomForegroundRule(targetAppId, priority);
+        CleanupStack::PushL(foregroundRule);
+        iConfig.AddPluginRuleL(uid, foregroundRule);
+        CleanupStack::Pop(foregroundRule);
+        }
+    }
+
+// Finds an attribute of the given name and gets its value
+// A value is only valid as long as AAtrributes is valid (and unmodified)
+// Returns KErrNone if the attribute is present in the list, KErrNotFound otherwise
+TInt CGOomConfigParser::GetValueFromAttributeList(const RAttributeArray& aAttributes, const TDesC8& aName, TPtrC8& aValue)
+    {
+    TInt index = aAttributes.Count();
+    TBool attributeFound = EFalse;
+    while ((index--) && (!attributeFound))
+        {
+        if (aAttributes[index].Attribute().LocalName().DesC() == aName)
+            {
+            attributeFound = ETrue;
+            aValue.Set(aAttributes[index].Value().DesC());
+            }
+        }
+    
+    TInt err = KErrNone;
+    
+    if (!attributeFound)
+        err = KErrNotFound;
+    
+    return err;
+    }
+
+// Finds an attribute of the given name and gets its value (coverting the string hex value to a UInt)
+// Returns KErrNone if the attribute is present in the list, KErrNotFound otherwise
+// Returns KErrCorrupt if the string is not a valid hex number
+TInt CGOomConfigParser::GetValueFromHexAttributeList(const RAttributeArray& aAttributes, const TDesC8& aName, TUint& aValue)
+    {
+    TPtrC8 hexString;
+    TInt err = GetValueFromAttributeList(aAttributes, aName, hexString);
+
+    if (hexString == KGOomConfigDefaultAppUid)
+        {
+        // This is a special case
+        // When we hit this value in a hex field then we return the default app UID
+        aValue = KGOomDefaultAppId;
+        }
+    else if (hexString == KGOomConfigDefaultPluginUid)
+        {
+        // This is a special case
+        // When we hit this value in a hex field then we return the default app UID
+        aValue = KGOomDefaultPluginId;
+        }
+    else if (hexString == KGOomConfigBusyAppUid)
+        {
+        aValue = KGOomBusyAppId;
+        }
+    else if (hexString == KGOomConfigHighPriorityAppUid)
+        {
+        aValue = KGOomHighPriorityAppId;
+        }
+    else if (err == KErrNone)
+        {
+        TLex8 hexLex(hexString);
+        err = hexLex.Val(aValue, EHex);
+        if (err != KErrNone)
+            err = KErrCorrupt;
+        }
+    
+    return err;
+    }
+
+// Finds an attribute of the given name and gets its value (coverting the string decimal value to a UInt)
+// Returns KErrNone if the attribute is present in the list, KErrNotFound otherwise
+// Returns KErrCorrupt if the string is not a valid decimal number
+TInt CGOomConfigParser::GetValueFromDecimalAttributeList(const RAttributeArray& aAttributes, const TDesC8& aName, TUint& aValue)
+    {
+    TPtrC8 decimalString;
+    TInt err = GetValueFromAttributeList(aAttributes, aName, decimalString);
+
+    if (err == KErrNone)
+        {
+        if (decimalString == KGOomAttibuteNeverClose)
+            aValue = KGOomPriorityInfinate;
+        else
+            {
+            TLex8 decimalLex(decimalString);
+            err = decimalLex.Val(aValue, EDecimal);
+            if (err != KErrNone)
+                err = KErrCorrupt;
+            }
+        }
+    
+    return err;
+    }
+
+TInt CGOomConfigParser::GetValueFromDecimalAttributeList(const RAttributeArray& aAttributes, const TDesC8& aName, TInt& aValue)
+    {
+    TUint uintValue;
+    TInt err = GetValueFromDecimalAttributeList(aAttributes, aName, uintValue);
+    aValue = uintValue;
+    return err;
+    }
+
+void CGOomConfigParser::SetPluginSyncMode(const RAttributeArray& aAttributes, CGOomRunPluginConfig& aRunPluginConfig)
+    {
+    TPtrC8 syncModeString;
+    TInt err = GetValueFromAttributeList(aAttributes, KGOomAttibuteSyncMode, syncModeString);
+    
+    if (err == KErrNone)
+        // If there is no specified sync mode then leave it as the default
+        {
+        TGOomSyncMode syncMode = EContinue;
+        
+        if (syncModeString == KGOomConfigSyncModeContinue)
+            syncMode = EContinueIgnoreMaxBatchSize;
+        else if (syncModeString == KGOomConfigSyncModeCheck)
+            syncMode = ECheckRam;
+        else if (syncModeString == KGOomConfigSyncModeEstimate)
+            syncMode = EEstimate;
+        else
+            ConfigError(KGOomErrInvalidSyncMode);
+        
+        if (err == KErrNone)
+            {
+            aRunPluginConfig.iSyncMode = syncMode;
+            }
+        }
+    }
+
+// Check that the current state is as expected
+// If not then the specified config error is generated
+void CGOomConfigParser::CheckState(TGOomParsingState aExpectedState, TInt aError)
+    {
+    if (iState != aExpectedState)
+        ConfigError(aError);
+    }
+
+// Check that the current state is as expected
+// If not then the specified config error is generated
+// This version checks to ensure that the current state matches either of the passed in states
+void CGOomConfigParser::CheckState(TGOomParsingState aExpectedState1, TGOomParsingState aExpectedState2, TInt aError)
+    {
+    if ((iState != aExpectedState1)
+            && (iState != aExpectedState2))
+        ConfigError(aError);
+    }
+
+void CGOomConfigParser::ChangeState(TGOomParsingState aState)
+    {
+    iState = aState;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomforegroundrule.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Fraphics Out of Memory Monitor
+*
+*/
+
+
+
+#include "goomforegroundrule.h"
+#include "goomwindowgrouplist.h"
+#include "goomtraces.h"
+
+// If the specified target app is in the foreground then apply the specified priority
+CGOomForegroundRule::CGOomForegroundRule(TInt aTargetAppId, TInt aPriority) : iTargetAppId(aTargetAppId), iPriority(aPriority)
+    {
+    FUNC_LOG;
+    }
+
+TBool CGOomForegroundRule::RuleIsApplicable(const CGOomWindowGroupList& aWindowGroupList, TInt /*aAppIndexInWindowGroup*/) const
+    {
+    FUNC_LOG;
+
+    TBool ruleIsApplicable = EFalse;
+    if (aWindowGroupList.Count() > 0)
+        {
+        // If the target app is in the foreground then this rule is applicable
+        TUint foregroundAppId = aWindowGroupList.AppId(0, ETrue);
+        if (foregroundAppId == iTargetAppId)
+            ruleIsApplicable = ETrue;
+        }
+    
+    return ruleIsApplicable;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomglobalconfig.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#include "goomglobalconfig.h"
+#include "goomtraces.h"
+
+CGOomGlobalConfig::~CGOomGlobalConfig()
+    {
+    FUNC_LOG;
+
+    iForceCheckPriorities.Close();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomlog.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,296 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Logging functionality for GOOM monitor profiling
+*
+*/
+
+
+#ifdef _DEBUG
+
+#include <hal.h>
+#include <w32std.h>
+#include <e32std.h>
+#include <apgwgnam.h>
+#include <flogger.h>
+
+#include "goomlog.h"
+
+_LIT8(KMemorySampleLoggingString, "%d");
+_LIT8(KMemorySampleLoggingSeparator, ", ");
+
+_LIT8(KCrLf, "\r\n");
+
+_LIT8(KGOomLogCancel, "Sampling triggered before previous sampling has completed. Results so far: ");
+
+_LIT(KGOomLogFile, "c:\\logs\\GOOM\\livegoommonitor.txt");
+_LIT(KGOomOldLogFile, "c:\\logs\\GOOM\\goommonitor.txt");
+
+const TInt KMaxTimeStampSize = 30;
+_LIT(KTimeStampFormat, "%F    %H:%T:%S");
+
+_LIT(KDummyWgName, "20");
+
+_LIT8(KUidPreamble, "App UIDs:");
+_LIT8(KUidFormat, " 0x%x");
+
+const TInt KPreallocatedSpaceForAppList = 50;
+
+const TInt KMaxUidBufferSize = 1024;
+
+CGOomLogger* CGOomLogger::NewL(RWsSession& aWs, RFs& aFs)
+    {
+    CGOomLogger* self = new (ELeave) CGOomLogger(aWs, aFs);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+    
+// Start logging the available memory every n micro seconds
+// Firstly a list of the app IDs is written to the log (foreground app first)
+// Note that the log is created in memory (to a pre-allocated buffer) and flushed out after it is complete
+// the samples are saved in CSV format so that they can easily be cut and pasted to plot graphs etc.
+void CGOomLogger::StartL()
+    {
+    // If the log file doesn't exist then don't attempt to sample anything
+    if (!iIsOpen)
+        return;
+    
+    // If we are already active then cancel first
+    if (IsActive())
+        Cancel();
+    
+    iWriteBuffer.Zero();
+    
+    iStartTime.HomeTime();
+    
+    // Log the timestamp
+    TBuf16<KMaxTimeStampSize> timeStamp;
+    iStartTime.FormatL(timeStamp, KTimeStampFormat);
+    TBuf8<KMaxTimeStampSize> timeStamp8;
+    timeStamp8.Copy(timeStamp);
+    Write(timeStamp8);
+    
+    // Log all of the application IDs (foreground app first, then the other apps moving towards the back)
+    LogApplicationIds();
+
+    // Then, record the free memory
+    // Note that this is done to a buffer so as not to affect the timing too much
+    LogFreeMemory();
+    
+    // Finally, set a timer to record the memory every n microseconds
+    HighRes(KTimeBetweenMemorySamples);
+    }
+
+// From CTimer / CActice
+void CGOomLogger::RunL()
+    {
+    TTime currentTime;
+    currentTime.HomeTime();
+    TTimeIntervalMicroSeconds loggingDuration = currentTime.MicroSecondsFrom(iStartTime);
+    TTimeIntervalMicroSeconds samplingDuration = KSamplingDurationUint;
+    if (loggingDuration > samplingDuration)
+        // If we have passed the desired logging duration then write the data we have collected
+        {
+        Write(iWriteBuffer);
+        }
+    else
+        {
+        // If we haven't passed the desired logging duration then record the free memory
+        // Note that this is recorded into a buffer and then logged later
+        iWriteBuffer.Append(KMemorySampleLoggingSeparator);
+        LogFreeMemory();
+        
+        // Wait before taking another memory sample
+        HighRes(KTimeBetweenMemorySamples);
+        }
+    }
+
+void CGOomLogger::DoCancel()
+    {
+    CTimer::DoCancel();
+    
+    Write(KGOomLogCancel);
+    Write(iWriteBuffer);
+    }
+
+CGOomLogger::~CGOomLogger()
+    {
+    iWgIds.Close();
+ // delete iWgName; // Not owned
+    if (iIsOpen)
+        iFile.Close();
+
+    }
+
+void CGOomLogger::Write(const TDesC8& aBuffer)
+    {
+    if (iIsOpen)
+        {
+        iFile.Write(aBuffer);
+    
+        // Add the line break
+        iFile.Write(KCrLf);
+        }
+    }
+
+void CGOomLogger::LogApplicationIds()
+    {
+    // get all window groups, with info about parents
+    TInt numGroups = iWs.NumWindowGroups(0);
+    TRAPD(err, iWgIds.ReserveL(numGroups));
+    
+    if (err != KErrNone)
+        return;
+    
+    if (iWs.WindowGroupList(0, &iWgIds) != KErrNone)
+        return;
+
+    // Remove all child window groups, promote parents to foremost child position
+    ColapseWindowGroupTree();
+    
+    // Go through each window group ID in the list, get the Uid of each app then log it
+    // Start with the foreground application
+    TInt index = 0;
+    
+    TUid uid;
+    
+    TBuf8<KMaxUidBufferSize> uidBuffer;
+    
+    uidBuffer = KUidPreamble;
+    
+    while (index < numGroups)
+        {
+        uid = GetUidFromWindowGroupId(iWgIds[index].iId);
+        
+        uidBuffer.AppendFormat(KUidFormat, uid.iUid);
+        
+        index++;
+        }
+    
+    Write(uidBuffer);
+    }
+
+void CGOomLogger::LogFreeMemory()
+    {
+    TMemoryInfoV1Buf meminfo;
+    UserHal::MemoryInfo(meminfo);
+    TInt freeMem = meminfo().iFreeRamInBytes;
+
+    // Save the free memory to a descriptor which will be written later
+    iWriteBuffer.AppendFormat(KMemorySampleLoggingString(), freeMem);
+    }
+
+CGOomLogger::CGOomLogger(RWsSession& aWs, RFs& aFs) : CTimer(EPriorityStandard), iWs(aWs), iFs(aFs)
+    {
+    }
+
+void CGOomLogger::ConstructL()
+    {
+    CActiveScheduler::Add(this);
+    
+    CTimer::ConstructL();
+    
+    // If there is an existing log then copy it, this will be the log that can be sent to the PC
+    // Without this feature then you can't get the logs off of the device because the "live" log will always be is use.
+    CFileMan* fileMan = CFileMan::NewL(iFs);
+    CleanupStack::PushL(fileMan);
+    fileMan->Copy(KGOomLogFile, KGOomOldLogFile);
+    CleanupStack::PopAndDestroy(fileMan);
+    
+    // Create the log file, or open it if is already exists (note that the directory must already be present
+    TInt err = iFile.Create(iFs, KGOomLogFile, EFileShareAny | EFileWrite);
+    if (KErrNone != err)
+        {
+        err = iFile.Open(iFs, KGOomLogFile, EFileShareAny | EFileWrite);
+        }
+    
+    if (KErrNone == err)
+        {
+        iIsOpen = ETrue;
+        
+        // Append all new data to the end of the file
+        TInt offset = 0;
+        iFile.Seek(ESeekEnd, offset);
+        }
+    
+    // Reserve enough space to build an app list later.
+    iWgIds.ReserveL(KPreallocatedSpaceForAppList);
+    // Reserve enough space for CApaWindowGroupName.
+    iWgName = CApaWindowGroupName::NewL(iWs);
+    iWgNameBuf = HBufC::NewL(CApaWindowGroupName::EMaxLength);
+    (*iWgNameBuf) = KDummyWgName;
+    iWgName->SetWindowGroupName(iWgNameBuf);    // iWgName takes ownership of iWgNameBuf*/
+
+    }
+
+void CGOomLogger::ColapseWindowGroupTree()
+    {
+    // start from the front, wg count can reduce as loop runs
+    for (TInt ii=0; ii<iWgIds.Count();)
+        {
+        RWsSession::TWindowGroupChainInfo& info = iWgIds[ii];
+        if (info.iParentId > 0)        // wg has a parent
+            {
+            // Look for the parent position
+            TInt parentPos = ii;        // use child pos as not-found signal
+            TInt count = iWgIds.Count();
+            for (TInt jj=0; jj<count; jj++)
+                {
+                if (iWgIds[jj].iId == info.iParentId)
+                    {
+                    parentPos = jj;
+                    break;
+                    }
+                }
+
+            if (parentPos > ii)  // parent should be moved forward
+                {
+                iWgIds[ii] = iWgIds[parentPos];
+                iWgIds.Remove(parentPos);
+                }
+            else if (parentPos < ii)  // parent is already ahead of child, remove child
+                iWgIds.Remove(ii);
+            else                    // parent not found, skip
+                ii++;
+            }
+        else    // wg does not have a parent, skip
+            ii++;
+        }
+    }
+
+TUid CGOomLogger::GetUidFromWindowGroupId(TInt aWgId)
+    {
+    // get the app's details
+    TPtr wgPtr(iWgNameBuf->Des());
+    
+    TUid uid;
+    
+    TInt err = iWs.GetWindowGroupNameFromIdentifier(aWgId, wgPtr);
+    
+    if (KErrNone != err)
+        // If there is an error then set the UID to 0;
+        {
+        uid.iUid = 0;
+        }
+    else
+        {
+        iWgName->SetWindowGroupName(iWgNameBuf);
+        uid = iWgName->AppUid(); // This UID comes from the app, not the mmp!
+        }
+    
+    return uid;
+    }
+
+#endif //_DEBUG
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goommemorymonitor.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,646 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Main classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#define USE_ASYNCYH_NOTIFICATIONS
+
+
+#include <hal.h>
+#include <libc/string.h>
+#include <UikonInternalPSKeys.h>
+
+//TODO: to be removed for wk44 onwards, should use only <EGL/egl.h> which is already included in goommemorymonitor.h
+#ifdef USE_ASYNCYH_NOTIFICATIONS
+#include <EGL/egl.h>
+#else // use local 
+#include "eglext.h"
+#endif
+
+#include "goommemorymonitor.h"
+#include "goommonitorplugin.h"
+#include "goomconfig.h"
+#include "goommemorymonitorserver.h"
+#include "goomconfigparser.h"
+#include "goomactionlist.h"
+#include "goomlog.h"
+#include "goomtraces.h"
+#include "goomwserveventreceiver.h"
+#include "goomconstants.hrh"
+#include "goomrunpluginconfig.h"
+#include "goomapplicationconfig.h"
+#include "goomcloseappconfig.h"
+#include <goommonitorsession.h>
+#ifdef USE_ASYNCYH_NOTIFICATIONS 
+#include "goomthresholdcrossedao.inl"
+#endif
+
+// ======================================================================
+// class CMemoryMonitor
+// ======================================================================
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+CMemoryMonitor* CMemoryMonitor::NewL()
+    { // static
+    FUNC_LOG;
+
+    CMemoryMonitor* self = new(ELeave) CMemoryMonitor();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CMemoryMonitor::CMemoryMonitor()
+    {
+    FUNC_LOG;
+
+    SetGMemoryMonitorTls(this);
+    }
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+CMemoryMonitor::~CMemoryMonitor()
+    {
+    FUNC_LOG;
+
+    delete iServer;
+    delete iWservEventReceiver;
+    iFs.Close();
+    iWs.Close();
+
+    delete iGOomWindowGroupList;
+
+    delete iGOomActionList;
+
+    delete iConfig;
+ 
+ #ifdef USE_ASYNCYH_NOTIFICATIONS    
+    delete iMemAllocationsGrowing;
+    delete iMemAllocationsGoingDown;
+ #endif
+    
+    eglTerminate(eglGetDisplay(EGL_DEFAULT_DISPLAY));
+
+#ifdef _DEBUG
+    delete iLogger;
+#endif
+    }
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+void CMemoryMonitor::ConstructL()
+    {
+    FUNC_LOG;
+	
+	    //Initialize EGL extension for memory data
+
+    EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+    EGLint major, minor;
+    eglInitialize(dpy, &major, &minor);
+	
+    /*
+     ** Search for extName in the extensions string.  Use of strstr()
+     ** is not sufficient because extension names can be prefixes of
+     ** other extension names.  Could use strtok() but the constant
+     ** string returned by glGetString can be in read-only memory.
+     */
+    TBool extensionFound = EFalse;
+    char *p = (char *) eglQueryString(dpy,EGL_EXTENSIONS);
+    char *end;
+    int extNameLen;
+
+    extNameLen = strlen("EGL_NOK_resource_profiling");
+    end = p + strlen(p);
+
+    while (p < end) 
+        {
+        int n = strcspn(p, " ");
+        if ((extNameLen == n) && (strncmp("EGL_NOK_resource_profiling", p, n) == 0)) 
+            {
+            extensionFound = ETrue;
+            break;
+            }
+        p += (n + 1);
+        }
+  
+    if (!extensionFound)
+        {
+        TRACES("EGL_NOK_resource_profiling not found from EGL_EXTENSIONS");
+        }
+    // okay, let's fetch the function ptr to our profiling functions
+    eglQueryProfilingData = (NOK_resource_profiling)eglGetProcAddress("eglQueryProfilingDataNOK");
+    if (!eglQueryProfilingData)
+        {
+        TRACES("eglQueryProfilingDataNOK not found via eglGetProcAddress()");
+        User::Leave(KErrNotSupported);
+        }
+	
+    User::LeaveIfError(iWs.Connect());
+    iWs.ComputeMode(RWsSession::EPriorityControlDisabled); 
+    
+    iGOomWindowGroupList = CGOomWindowGroupList::NewL(iWs);
+
+    iConfig = CGOomConfig::NewL();
+
+    iServer = CMemoryMonitorServer::NewL(*this);
+    
+   // Load up threshold & OOM app lists from resource.
+    User::LeaveIfError(iFs.Connect());
+
+    CGOomConfigParser* oomConfigParser = new (ELeave) CGOomConfigParser(*iConfig, iFs);
+    CleanupStack::PushL(oomConfigParser);
+    oomConfigParser->ParseL();
+    CleanupStack::PopAndDestroy(oomConfigParser);
+
+    iGOomActionList = CGOomActionList::NewL(*this, *iServer, iWs, *iConfig);
+
+#ifdef _DEBUG
+    iLogger = CGOomLogger::NewL(iWs, iFs);
+#endif
+
+    // Get the thresholds based on the current foreground app and the config
+    RefreshThresholds();
+    
+    iWservEventReceiver = new(ELeave) CWservEventReceiver(*this, iWs);
+    iWservEventReceiver->ConstructL();
+    }
+
+const CGOomGlobalConfig& CMemoryMonitor::GlobalConfig()
+    {
+    CMemoryMonitor* globalMemoryMonitor = static_cast<CMemoryMonitor*>(Dll::Tls());
+    return globalMemoryMonitor->iConfig->GlobalConfig();
+    }
+
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+void CMemoryMonitor::FreeMemThresholdCrossedL(TInt /*aAction*/, TInt aThreshold)
+    {
+    FUNC_LOG;
+    // keep only one notification active at a moment
+#ifdef USE_ASYNCYH_NOTIFICATIONS 
+    if (aThreshold == EGL_PROF_TOTAL_MEMORY_USAGE_GT_NOK)
+        {
+        TRACES("FreeMemThresholdCrossedL : EGL_PROF_TOTAL_MEMORY_USAGE_GT_NOK");
+        iMemAllocationsGrowing->Stop();
+        iMemAllocationsGoingDown->Continue();
+        }
+    else
+        {
+        TRACES("FreeMemThresholdCrossedL : EGL_PROF_TOTAL_MEMORY_USAGE_LT_NOK");
+        iMemAllocationsGrowing->Continue();
+        iMemAllocationsGoingDown->Stop();            
+        }    
+#endif
+
+    StartFreeSomeRamL(iGoodThreshold);
+    if (aThreshold == EGL_PROF_TOTAL_MEMORY_USAGE_LT_NOK)
+        {
+        TInt current = GetFreeMemory();
+        if(current >= iGoodThreshold  && (!NeedToPostponeMemGood()))
+            {
+            TRACES("FreeMemThresholdCrossedL : calling MemoryGOOD");
+            iGOomActionList->MemoryGood();
+            }
+        }
+    }
+
+void CMemoryMonitor::HandleFocusedWgChangeL(TInt aForegroundAppUid)
+    {
+    FUNC_LOG;
+    
+    TRACES1("CMemoryMonitor::HandleFocusedWgChangeL Foregroundapp id = %x", aForegroundAppUid);
+    
+    if(aForegroundAppUid == 0)
+        {
+        return;
+        }
+    iForegroundAppUid = aForegroundAppUid;    
+
+    // Refresh the low and good memory thresholds as they may have changed due to the new foreground application
+    RefreshThresholds(aForegroundAppUid);
+    // Not very elegant, now we poll on each window group change
+    // Should have better trigger e.g. from window server 
+#ifndef USE_ASYNCYH_NOTIFICATIONS  
+    TInt current = GetFreeMemory();
+    if (current < iLowThreshold)
+        {
+        StartFreeSomeRamL(iGoodThreshold);
+        }  
+    else if(current >= iGoodThreshold)
+        {
+        iGOomActionList->MemoryGood();
+        }
+#endif
+     }
+
+void CMemoryMonitor::StartFreeSomeRamL(TInt aTargetFree, TInt aMaxPriority) // The maximum priority of action to run
+    {
+    FUNC_LOG;
+
+    TRACES2("MemoryMonitor::StartFreeSomeRamL: aTargetFree = %d, iCurrentTarget = %d", aTargetFree, iCurrentTarget);
+
+    // Update the target if new target is higher. If the target is lower than the current target and memory
+    // is currently being freed then we do not want to reduce the amount of memory this operation frees.
+    if (aTargetFree > iCurrentTarget)
+        iCurrentTarget = aTargetFree;
+
+    // check if there is enough free memory already.
+    TInt freeMemory;
+    TBool freeMemoryAboveCurrentTarget = FreeGraphicsMemoryAboveThresholdL(freeMemory);
+
+    TRACES2("MemoryMonitor::StartFreeSomeRamL freeMemoryAboveTarget = %d, freeMemory = %d", freeMemoryAboveCurrentTarget, freeMemory);
+
+    if (freeMemoryAboveCurrentTarget)
+        {
+        ResetTargets();
+        /*if(freeMemory >= iGoodThreshold && !NeedToPostponeMemGood())
+            {
+                iGOomActionList->MemoryGood();
+            }
+        */
+        iServer->CloseAppsFinished(freeMemory, ETrue);
+        return;
+        }
+
+    // update wg list only when actually about to use it 
+    //iGOomWindowGroupList->Refresh();
+
+#ifdef _DEBUG
+    iLogger->StartL();
+#endif
+
+    // Build the list of memory freeing actions
+    iGOomActionList->BuildPluginActionListL(*iGOomWindowGroupList, *iConfig);
+
+    //iGOomActionList->SetCurrentTarget(aTargetFree);
+    iGOomActionList->SetCurrentTarget(iCurrentTarget);
+
+    // Run the memory freeing actions
+    iGOomActionList->FreeMemory(aMaxPriority);
+    }
+
+void CMemoryMonitor::RunCloseAppActions(TInt aMaxPriority)
+    {
+    FUNC_LOG;
+    // Build the list of memory freeing actions (by killing apps)
+    iGOomActionList->BuildKillAppActionListL(*iGOomWindowGroupList, *iConfig);
+    iGOomActionList->FreeMemory(aMaxPriority);
+    }
+
+// ---------------------------------------------------------
+// This function attempts to free enough RAM to leave the target amount of space free.
+// This function could take a substantial time to return as it may have to close a number
+// of applications, and each will be given a timeout of KAPPEXITTIMEOUT.
+// ---------------------------------------------------------
+//
+void CMemoryMonitor::StartFreeSomeRamL(TInt aTargetFree)
+    {
+    FUNC_LOG;
+
+    StartFreeSomeRamL(aTargetFree, KGOomPriorityInfinate - 1);
+    }
+
+void CMemoryMonitor::RequestFreeMemoryL(TInt aTargetFree, TBool aUseAbsolute)
+    {
+    FUNC_LOG;
+
+    StartFreeSomeRamL(aUseAbsolute?aTargetFree:(aTargetFree + iLowThreshold), KGOomPriorityInfinate - 1);
+    }
+
+void CMemoryMonitor::FreeOptionalRamL(TInt aTargetFree, TInt aPluginId, TBool aUseAbsolute) // The ID of the plugin that will clear up the allocation, used to determine the priority of the allocation
+    {
+    FUNC_LOG;
+
+    // Calculate the priority of the allocation (the priority of the plugin that will clear it up - 1)
+    TInt priorityOfAllocation = iConfig->GetPluginConfig(aPluginId).CalculatePluginPriority(*iGOomWindowGroupList) - 1;
+    StartFreeSomeRamL(aUseAbsolute?aTargetFree:(aTargetFree + iGoodThreshold), priorityOfAllocation);
+    }
+
+// Does the EGL extension return the amount of memory in bits?
+// If yes, int is clearly not enough
+// Note that this function reserves memory so it can fail if the "standard" memory
+// gets full.
+TBool CMemoryMonitor::FreeGraphicsMemoryAboveThresholdL(TInt& aCurrentFreeMemory)
+    {
+    FUNC_LOG;
+    
+    TInt current = GetFreeMemory();
+    User::LeaveIfError(current);
+    aCurrentFreeMemory = current;
+    
+    return (current >= iCurrentTarget);
+    }
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+
+void CMemoryMonitor::AppNotExiting(TInt aWgId)
+    {
+    FUNC_LOG;
+
+    iGOomActionList->AppNotExiting(aWgId);
+    }
+
+
+void CMemoryMonitor::RefreshThresholds(TInt aForegroundAppUid)
+    {
+    FUNC_LOG;    
+    
+    TInt origGood = iGoodThreshold;
+    TInt origLow = iLowThreshold;
+    
+    // Calculate the desired good threshold, this could be the globally configured value...
+    iGoodThreshold = CMemoryMonitor::GlobalConfig().iGoodRamThreshold;
+    iLowThreshold = CMemoryMonitor::GlobalConfig().iLowRamThreshold;
+    iCurrentTarget = iGoodThreshold;
+        
+    TRACES2("CMemoryMonitor::RefreshThresholds: Global Good Threshold = %d, Global Low Threshold = %d", iGoodThreshold, iLowThreshold);
+
+    // The global value can be overridden by an app specific value
+    // Find the application config entry for the foreground application
+    if (aForegroundAppUid == KErrNotFound)
+        {
+        return;
+        }     
+                
+    // If this application configuration overrides the good_ram_threshold then set it
+    if (iConfig->GetApplicationConfig(aForegroundAppUid).iGoodRamThreshold != KGOomThresholdUnset)
+        {
+        iGoodThreshold = iConfig->GetApplicationConfig(aForegroundAppUid).iGoodRamThreshold;
+        TRACES2("CMemoryMonitor::RefreshThresholds: For foreground app %x, Good Threshold = %d", aForegroundAppUid, iGoodThreshold);
+        }
+    
+    // If this application configuration overrides the low_ram_threshold then set it
+    if (iConfig->GetApplicationConfig(aForegroundAppUid).iLowRamThreshold != KGOomThresholdUnset)
+        {
+        iLowThreshold = iConfig->GetApplicationConfig(aForegroundAppUid).iLowRamThreshold;
+        TRACES2("CMemoryMonitor::RefreshThresholds: For foreground app %x, Low Threshold = %d", aForegroundAppUid, iLowThreshold);
+        }
+    
+    // If this application configuration overrides the good_ram_threshold then set it
+    if (iConfig->GetApplicationConfig(aForegroundAppUid).iTargetFree != KGOomThresholdUnset)
+        {
+        iCurrentTarget = iConfig->GetApplicationConfig(aForegroundAppUid).iTargetFree;
+        TRACES2("CMemoryMonitor::RefreshThresholds: For foreground app %x, Target Free on Startup = %d", aForegroundAppUid, iCurrentTarget);
+        }
+    
+    iGOomActionList->SetCurrentTarget(iCurrentTarget);
+    
+#ifdef USE_ASYNCYH_NOTIFICATIONS 
+
+    // if allocation should fail, threshold should not naturally be set
+    if (!iMemAllocationsGrowing)
+        {
+        TRAP_IGNORE(iMemAllocationsGrowing = CreateThresholdCrossedThreadL(*this, EGL_PROF_TOTAL_MEMORY_USAGE_GT_NOK, iLowThreshold))
+        origLow = iLowThreshold; // do not reset
+        }
+    if (!iMemAllocationsGoingDown)
+        {
+        TRAP_IGNORE(iMemAllocationsGoingDown = CreateThresholdCrossedThreadL(*this, EGL_PROF_TOTAL_MEMORY_USAGE_LT_NOK, iGoodThreshold))
+        origGood = iGoodThreshold; // do not reset
+        }
+        
+    TBool releaseClient = ETrue;
+
+    // update thresholds only if they really change
+    if (origGood != iGoodThreshold)
+        {
+        iMemAllocationsGoingDown->SetThreshold(iGoodThreshold);
+        }
+    
+    if ( origLow != iLowThreshold)
+        {
+        // need to synchronously check whether client should wait
+        // memory to be released
+        if(GetFreeMemory() <= iLowThreshold )    
+            {
+            releaseClient = EFalse;
+            }
+        iMemAllocationsGrowing->SetThreshold(iLowThreshold);
+        }
+
+   TRACES3("CMemoryMonitor::RefreshThresholds: releaseClient: %d For foreground app 0x%x, Active client = 0x%x",releaseClient, aForegroundAppUid, ActiveClientId());
+        
+   if (releaseClient && ActiveClientId() == iForegroundAppUid)
+        {
+        iServer->CloseAppsFinished(0, ETrue);    
+        }     
+#endif
+   
+   TRACES2("CMemoryMonitor::RefreshThresholds: Current Good Threshold = %d, Current Low Threshold = %d", iGoodThreshold, iLowThreshold);
+    }
+
+void CMemoryMonitor::ResetTargets(TInt aTarget)
+    {
+    FUNC_LOG;
+
+    //we reset the target when a memory free operation completes, to deal with the case
+    //where the operation was initiated with a target larger than the current good threshold
+    iCurrentTarget = aTarget;
+    iGOomActionList->SetCurrentTarget(iCurrentTarget);
+    }
+
+void CMemoryMonitor::SetPriorityBusy(TInt aWgId)
+    {
+    FUNC_LOG;
+    
+    TRACES2("Received SetPriorityBusy for appid = %x, wgid = %d", iGOomWindowGroupList->AppIdfromWgId(aWgId, ETrue), aWgId);
+    iGOomWindowGroupList->SetPriorityBusy(aWgId);
+    AppClosePriorityChanged(aWgId, RGOomMonitorSession::EGOomPriorityBusy);
+    }
+
+void CMemoryMonitor::SetPriorityNormal(TInt aWgId)
+    {
+    FUNC_LOG;
+
+    iGOomWindowGroupList->SetPriorityNormal(aWgId);
+    AppClosePriorityChanged(aWgId, RGOomMonitorSession::EGOomPriorityNormal);
+    }
+
+void CMemoryMonitor::SetPriorityHigh(TInt aWgId)
+    {
+    FUNC_LOG;
+    
+    iGOomWindowGroupList->SetPriorityHigh(aWgId);
+    AppClosePriorityChanged(aWgId, RGOomMonitorSession::EGOomPriorityHigh);
+    }
+
+TInt CMemoryMonitor::GetFreeMemory()
+    {
+	FUNC_LOG;
+    if (!eglQueryProfilingData)
+        {
+    	TRACES("EGL_NOK_resource_profiling not available");
+	    return 0;
+        }
+    EGLint data_count;
+    EGLint* prof_data;
+    TInt i(0);
+    TInt totalMem(0);
+    TInt totalUsed(0);
+	EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+
+	/* Find out how much profiling data is available */
+	eglQueryProfilingData(dpy, EGL_PROF_QUERY_GLOBAL_BIT_NOK | EGL_PROF_QUERY_MEMORY_USAGE_BIT_NOK,
+							NULL, 0, &data_count);
+
+	TRACES1("eglQueryProfilingData - data size: %d", data_count);
+
+
+	/* Allocate room for the profiling data */
+	prof_data = (EGLint*)User::Alloc(data_count * sizeof(EGLint));
+	if (prof_data == NULL)
+	    {
+    	TRACES1("eglQueryProfilingData - could not alloc: %d", data_count * sizeof(EGLint));	
+		return KErrNoMemory;
+        }
+
+	/* Retrieve the profiling data */
+	eglQueryProfilingData(dpy,
+							 EGL_PROF_QUERY_GLOBAL_BIT_NOK |
+							 EGL_PROF_QUERY_MEMORY_USAGE_BIT_NOK,
+							 prof_data,
+							 data_count,
+							 &data_count);
+
+	/* Iterate over the returned data */
+	while (i < data_count)
+		{
+		TRACES2("EGL_NOK_resource_profiling - index: %d data: %d", i, prof_data[i]);
+		
+		switch (prof_data[i++])
+			{
+			case EGL_PROF_USED_MEMORY_NOK:
+				{
+				totalUsed = prof_data[i++];
+				TRACES1("EGL_NOK_resource_profiling - total Used: %d", totalUsed);
+
+				break;
+				}
+			case EGL_PROF_TOTAL_MEMORY_NOK:
+				{
+				totalMem = prof_data[i++];
+				TRACES1("EGL_NOK_resource_profiling - total Mem: %d", totalMem);
+				break;
+				}
+		    case EGL_PROF_PROCESS_ID_NOK:
+                {
+                if (sizeof(EGLNativeProcessIdTypeNOK) == 8)
+                    {
+                    i+=2;
+                    }
+                else
+                    {
+                    i++;
+                    }
+                break;
+                }
+            case EGL_PROF_PROCESS_USED_PRIVATE_MEMORY_NOK:
+            case EGL_PROF_PROCESS_USED_SHARED_MEMORY_NOK:
+			default:
+				{
+                i++;
+				break;
+				}
+			}
+		}
+
+	/* Free allocated memory */
+	User::Free(prof_data);
+	
+	 
+    if ((totalMem-totalUsed) < 0)
+	    {
+	    return 0;
+	    }
+    return totalMem - totalUsed;
+    }
+
+void CMemoryMonitor::DoPostponedMemoryGood()
+    {
+    FUNC_LOG;
+    TInt current = GetFreeMemory();
+    if(current >= iGoodThreshold  && (!NeedToPostponeMemGood()))
+        {
+        TRACES("DoPostponedMemoryGood calling MemoryGOOD");
+        iGOomActionList->MemoryGood();
+        }
+    }    
+
+
+void CMemoryMonitor::AppClosePriorityChanged(TInt aWgId, TInt aPriority)
+    {
+    FUNC_LOG;
+    CGOomCloseAppConfig* appCloseConfig = NULL;
+    
+    TRACES1("CMemoryMonitor::AppClosePriorityChanged wgid %d", aWgId);
+    
+    switch(aPriority)
+    {
+    case RGOomMonitorSession::EGOomPriorityBusy:
+        appCloseConfig = iConfig->GetApplicationConfig(KGOomBusyAppId).GetAppCloseConfig();
+        TRACES("CMemoryMonitor::AppClosePriorityChanged BUSY");
+        break;
+    case RGOomMonitorSession::EGOomPriorityHigh:
+        appCloseConfig = iConfig->GetApplicationConfig(KGOomHighPriorityAppId).GetAppCloseConfig();
+        TRACES("CMemoryMonitor::AppClosePriorityChanged HIGH");
+        break;
+    default:
+        appCloseConfig = iConfig->GetApplicationConfig(aWgId).GetAppCloseConfig();
+        TRACES("CMemoryMonitor::AppClosePriorityChanged NORMAL");
+    }
+        
+    if (appCloseConfig)
+        {  
+        TInt32 appId = iGOomWindowGroupList->AppIdfromWgId(aWgId, ETrue);
+        TInt wgIndex=iGOomWindowGroupList->GetIndexFromAppId(appId);
+        
+        TRACES2("CMemoryMonitor::AppClosePriorityChanged wgindex %d, appid %x", wgIndex, appId);
+        
+        if(wgIndex>=0)
+            {
+            TRACES2("CMemoryMonitor::AppClosePriorityChanged Setting Priority for app %x, wgid %d", appId, aWgId);
+            TUint priority = appCloseConfig->CalculateCloseAppPriority(*iGOomWindowGroupList, wgIndex);
+            iGOomActionList->SetPriority(wgIndex, priority);
+            }
+        else
+            {
+            TRACES1("CMemoryMonitor::AppClosePriorityChanged Could not find wgid %d in windogouplist", aWgId);
+            }
+        }
+    else
+        {
+        TRACES("CMemoryMonitor::AppClosePriorityChanged appCloseConfig not found");
+        }
+    }
+
+CGOomWindowGroupList * CMemoryMonitor::GetWindowGroupList() const
+{
+    return iGOomWindowGroupList; 
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goommemorymonitorserver.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Main classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#include "goommemorymonitorserver.h"
+#include "goommonitorclientserver.h"
+#include "goommemorymonitorsession.h"
+#include "goommemorymonitor.h"
+#include "goomtraces.h"
+
+CMemoryMonitorServer* CMemoryMonitorServer::NewL(CMemoryMonitor& aMonitor)
+    {
+    FUNC_LOG;
+		RDebug::Print(_L("GOOM: CMemoryMonitorServer::NewL"));
+    CMemoryMonitorServer* self=new(ELeave) CMemoryMonitorServer(aMonitor);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    RDebug::Print(_L("GOOM: CMemoryMonitorServer::NewL EXIT"));
+    return self;
+    }
+
+CMemoryMonitorServer::~CMemoryMonitorServer()
+    {
+    FUNC_LOG;
+    }
+
+CMemoryMonitorServer::CMemoryMonitorServer(CMemoryMonitor& aMonitor)
+:CServer2(CActive::EPriorityStandard), iMonitor(aMonitor)
+    {
+    FUNC_LOG;
+    }
+
+void CMemoryMonitorServer::ConstructL()
+    {
+    FUNC_LOG;
+    RDebug::Print(_L("GOOM: CMemoryMonitorServer::ConstructL start server"));
+
+    StartL(KGraphicsMemoryMonitorServerName);
+    RDebug::Print(_L("GOOM: CMemoryMonitorServer::ConstructL EXIT"));
+    }
+
+CSession2* CMemoryMonitorServer::NewSessionL(const TVersion& /*aVersion*/, const RMessage2& /*aMessage*/) const
+    {
+    FUNC_LOG;
+
+    return new(ELeave) CMemoryMonitorSession();
+    }
+
+TInt CMemoryMonitorServer::RunError(TInt aError)
+    {
+    FUNC_LOG;
+
+    Message().Complete(aError);
+    //
+    // The leave will result in an early return from CServer::RunL(), skipping
+    // the call to request another message. So do that now in order to keep the
+    // server running.
+    ReStart();
+    return KErrNone;    // handled the error fully
+    }
+
+CMemoryMonitor& CMemoryMonitorServer::Monitor()
+    {
+    FUNC_LOG;
+
+    return iMonitor;
+    }
+
+void CMemoryMonitorServer::CloseAppsFinished(TInt aBytesFree, TBool aMemoryGood)
+    {
+    FUNC_LOG;
+
+    iSessionIter.SetToFirst();
+    CSession2* s;
+    while ((s = iSessionIter++) != 0)
+        static_cast<CMemoryMonitorSession*>(s)->CloseAppsFinished(aBytesFree, aMemoryGood);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goommemorymonitorsession.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,183 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Main classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#include "goommonitorclientserver.h"
+#include "goommemorymonitorsession.h"
+#include "goommemorymonitor.h"
+#include "goommemorymonitorserver.h"
+#include "goomtraces.h"
+
+CMemoryMonitorSession::CMemoryMonitorSession()
+    {
+    FUNC_LOG;
+    }
+
+void CMemoryMonitorSession::CreateL()
+    {
+    FUNC_LOG;
+    }
+
+CMemoryMonitorSession::~CMemoryMonitorSession()
+    {
+    FUNC_LOG;
+    if (iUseAbsoluteTargets)
+        { // se3ssion terminated while on critical allocation, release lock
+        Server().Monitor().SessionInCriticalAllocation(0);
+        }
+    CloseAppsFinished(0, EFalse);
+    }
+
+CMemoryMonitorServer& CMemoryMonitorSession::Server()
+    {
+    FUNC_LOG;
+
+    return *static_cast<CMemoryMonitorServer*>(const_cast<CServer2*>(CSession2::Server()));
+    }
+
+CMemoryMonitor& CMemoryMonitorSession::Monitor()
+    {
+    FUNC_LOG;
+
+    return Server().Monitor();
+    }
+
+void CMemoryMonitorSession::ServiceL(const RMessage2& aMessage)
+    {
+    FUNC_LOG;
+    
+    iFunction = aMessage.Function();
+    RThread t;
+    aMessage.Client(t);
+    Server().Monitor().SetActiveClient(t.SecureId());
+    t.Close();
+    
+    switch (aMessage.Function())
+        {
+        case EGOomMonitorRequestFreeMemory:
+            if (!iRequestFreeRam.IsNull())
+                {
+                aMessage.Complete(KErrInUse);
+                return;
+                }
+            // message will be completed when CloseAppsFinished() is called.
+            if (aMessage.Int1() == 0)
+                {
+                iRequestFreeRam = aMessage;
+
+                TRAPD(err, Monitor().RequestFreeMemoryL(aMessage.Int0(), iUseAbsoluteTargets));
+                if (err)
+                    {
+                    // completes the message if that was left to pending
+                    CloseAppsFinished(0, EFalse);
+                    }
+                }
+            else
+                {
+                TInt appUid = aMessage.Int1();
+                // if no new memory was needed, the message is completed synchronously
+                iRequestFreeRam = aMessage;
+                TRAP_IGNORE(Monitor().HandleFocusedWgChangeL(appUid));
+                }
+            break;
+
+        case EGOomMonitorCancelRequestFreeMemory:
+            if (!iRequestFreeRam.IsNull())
+                {
+                iRequestFreeRam.Complete(KErrCancel);
+                }
+            aMessage.Complete(KErrNone);
+            break;
+
+        case EGOomMonitorThisAppIsNotExiting:
+            Monitor().AppNotExiting(aMessage.Int0());
+            aMessage.Complete(KErrNone);
+            break;
+
+        case EGOomMonitorRequestOptionalRam:
+            if (!iRequestFreeRam.IsNull())
+                {
+                aMessage.Complete(KErrInUse);
+                }
+            // message will be completed when CloseAppsFinished() is called.
+            iRequestFreeRam = aMessage;
+            iMinimumMemoryRequested = aMessage.Int1();
+            Monitor().FreeOptionalRamL(aMessage.Int0(), aMessage.Int2(), iUseAbsoluteTargets);
+            break;
+            
+        case EGOomMonitorSetPriorityBusy:
+            Monitor().SetPriorityBusy(aMessage.Int0());
+            aMessage.Complete(KErrNone);
+            break;
+            
+        case EGOomMonitorSetPriorityNormal:
+               Monitor().SetPriorityNormal(aMessage.Int0());
+            aMessage.Complete(KErrNone);
+            break;
+
+        case EGOomMonitorSetPriorityHigh:
+               Monitor().SetPriorityHigh(aMessage.Int0());
+            aMessage.Complete(KErrNone);
+            break;
+
+        case EGoomMonitorAppAboutToStart:
+            {
+            TInt appUid = aMessage.Int0();
+            aMessage.Complete(KErrNone);  
+            TRAP_IGNORE(Monitor().HandleFocusedWgChangeL(appUid))
+            break;
+            }
+        case EGoomMonitorAppUsesAbsoluteMemTargets:
+            {
+            iUseAbsoluteTargets = aMessage.Int0();
+            TRACES2("EGoomMonitorAppUsesAbsoluteMemTargets this: 0x%x, use abs targets %d", this, iUseAbsoluteTargets);
+            Server().Monitor().SessionInCriticalAllocation(iUseAbsoluteTargets);
+            aMessage.Complete(KErrNone);     
+            break;
+            }    
+            
+        default:
+            PanicClient(aMessage, EPanicIllegalFunction);
+            break;
+        }
+    }
+
+void CMemoryMonitorSession::CloseAppsFinished(TInt aBytesFree, TBool aMemoryGood)
+    {
+    FUNC_LOG;
+
+    if (!iRequestFreeRam.IsNull())
+        {
+        if (iFunction == EGOomMonitorRequestOptionalRam)
+            {
+            TInt memoryAvailable = aBytesFree - CMemoryMonitor::GlobalConfig().iGoodRamThreshold;
+            
+            // If memory available is greater than the requested RAM then complete with the amount of free memory, otherwise complete with KErrNoMemory
+            if (memoryAvailable >= iMinimumMemoryRequested)
+                {
+                iRequestFreeRam.Complete(memoryAvailable);
+                }
+            else
+                {
+                iRequestFreeRam.Complete(KErrNoMemory);
+                }
+            }
+        else 
+            iRequestFreeRam.Complete(aMemoryGood ? KErrNone : KErrNoMemory);
+        }
+    Server().Monitor().SetActiveClient(0);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goommonitor.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Main classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#include "goommonitor.h"
+#include "goommemorymonitor.h"
+#include "goommonitorclientserver.h"
+#include "goomtraces.h"
+
+const TInt KStackSize = 0x2000;
+
+_LIT(KGOOMWatcherThreadName, "GOOM FW");
+
+
+// Implements just Error() to avoid panic
+NONSHARABLE_CLASS(CSimpleScheduler) : public CActiveScheduler
+    {
+    void Error( TInt ) const{} // From CActiveScheduler
+    };
+
+// thread function for GOOM watcher
+GLDEF_C TInt GOOMWatcherThreadFunction( TAny* )
+    {
+    FUNC_LOG;
+    RDebug::Print(_L("GOOM: WatcherThreadFunction"));
+
+    TInt err( KErrNone );
+
+    CTrapCleanup* cleanup = CTrapCleanup::New();
+    CActiveScheduler* scheduler = new CSimpleScheduler();
+    CMemoryMonitor* goom = NULL;
+
+    if ( !cleanup || !scheduler)
+        {
+        err = KErrNoMemory;
+        }
+    else
+        {
+        CActiveScheduler::Install( scheduler );
+        TRAPD( err,
+            {
+            RThread me;
+            me.SetPriority(EPriorityAbsoluteHigh);
+            goom = CMemoryMonitor::NewL();
+            } )
+
+        if ( err == KErrNone )
+            {
+            // start the watchers
+            CActiveScheduler::Start();
+            }
+        }
+
+    delete cleanup;
+    delete scheduler;
+    delete goom;
+
+	RDebug::Print(_L("GOOM: WatcherThreadFunction EXIT err %d"), err);
+    return err;
+    }
+
+// Creates thread for GOOM watchers
+EXPORT_C void CreateGOOMWatcherThreadL()
+    {
+    FUNC_LOG;
+	RDebug::Print(_L("GOOM: CreateGoomWatcherThread"));
+    RThread thread;
+    TInt ret = thread.Create( KGOOMWatcherThreadName,
+                              GOOMWatcherThreadFunction,
+                              KStackSize, // stack size
+                              NULL, // uses caller thread's heap
+                              NULL );
+
+    if ( ret == KErrNone )
+        {
+        thread.Resume();
+        thread.Close();
+        }
+
+	RDebug::Print(_L("GOOM: CreateGoomWatcherThread created %d"), ret);
+    User::LeaveIfError( ret );
+    }
+
+void PanicClient(const RMessagePtr2& aMessage,TGOomMonitorClientPanic aPanic)
+    {
+    FUNC_LOG;
+
+    aMessage.Panic(KGraphicsMemoryMonitorServerName, aPanic);
+    }
+
+// End of file.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goommonitorplugin.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  GOOM Monitor plug-in interface.
+*
+*/
+
+
+#include <apgwgnam.h>
+#include "goommonitorplugin.h"
+#include "goommemorymonitor.h"
+#include "goomtraces.h"
+
+// TLS is used to store the CMemoryMonitor pointer, CMemoryMonitor
+// being the main object in the GOOM monitor thread. This allows
+// plugins to access the CMemoryMonitor object easily.
+EXPORT_C void SetGMemoryMonitorTls(CMemoryMonitor* aMonitor)
+    {
+    FUNC_LOG;
+
+    Dll::SetTls(aMonitor);
+    }
+
+CMemoryMonitor* MemoryMonitorTls()
+    {
+    FUNC_LOG;
+
+    return static_cast<CMemoryMonitor*>(Dll::Tls());
+    }
+
+
+void GOomMonitorPluginPanic(TGOomMonitorPluginPanic aReason)
+    {
+    FUNC_LOG;
+
+    _LIT(KCat, "GOomMonitorPlugin");
+    User::Panic(KCat, aReason);
+    }
+
+
+EXPORT_C CGOomMonitorPluginBase::CGOomMonitorPluginBase()
+: iMemoryMonitor(MemoryMonitorTls())
+    {
+    FUNC_LOG;
+    RDebug::Print(_L("CGOomMonitorPluginBase::CGOomMonitorPluginBase"));
+
+    __ASSERT_ALWAYS(iMemoryMonitor, GOomMonitorPluginPanic(EGOomMonitorPluginPanic_PluginConstructedOutsideGOomMonitorThread));
+    RDebug::Print(_L("CGOomMonitorPluginBase::CGOomMonitorPluginBase EXIT"));
+    }
+
+EXPORT_C CGOomMonitorPluginBase::~CGOomMonitorPluginBase()
+    {
+    FUNC_LOG;
+    }
+
+EXPORT_C void CGOomMonitorPluginBase::ConstructL()
+    {
+    FUNC_LOG;
+
+    // CAppGOomMonitorPlugin assumes ConstructL is empty
+    }
+
+EXPORT_C void CGOomMonitorPluginBase::ExtensionInterface(TUid /*aInterfaceId*/, TAny*& /*aImplementaion*/)
+    {
+    FUNC_LOG;
+    }
+
+EXPORT_C RFs& CGOomMonitorPluginBase::FsSession()
+    {
+    FUNC_LOG;
+
+    return iMemoryMonitor->iFs;
+    }
+
+EXPORT_C RWsSession& CGOomMonitorPluginBase::WsSession()
+    {
+    FUNC_LOG;
+
+    return iMemoryMonitor->iWs;
+    }
+
+EXPORT_C CAppGOomMonitorPlugin* CAppGOomMonitorPlugin::NewL(TUid aAppUid)
+    {
+    CAppGOomMonitorPlugin* self = new(ELeave) CAppGOomMonitorPlugin(aAppUid);
+    // ConstructL() currently not needed
+    return self;
+    }
+
+CAppGOomMonitorPlugin::CAppGOomMonitorPlugin(TUid aAppUid)
+: iAppUid(aAppUid)
+    {
+    }
+
+void CAppGOomMonitorPlugin::FreeRam(TInt)
+    {
+    SendMessageToApp(KAppGOomMonitor_FreeRam);
+    }
+
+void CAppGOomMonitorPlugin::MemoryGood()
+    {
+    SendMessageToApp(KAppGOomMonitor_MemoryGood);
+    }
+
+void CAppGOomMonitorPlugin::SendMessageToApp(TInt aMessage)
+    {
+    RWsSession& ws = WsSession();
+    TInt wgId = 0;
+
+    do
+        {
+        CApaWindowGroupName::FindByAppUid(iAppUid, ws, wgId);
+        if (wgId>0)
+            {
+            TWsEvent event;
+            event.SetType(aMessage);
+            event.SetTimeNow();
+            ws.SendEventToWindowGroup(wgId, event);
+            }
+        }
+    while (wgId>0);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goommonitorsession.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,216 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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/server interface for GOOM Monitor.
+*
+*/
+
+
+#include <coemain.h>
+#include <goommonitorsession.h>
+#include "goommonitorclientserver.h"
+#include "goompanic.h"
+#include "goomtraces.h"
+
+enum TGoomClientInternalFlags{
+    EGoonCFlagsNone,
+    EGoonCFlagsConnected = 1
+    };
+
+#define ASYNCH_NOTIFICATION_ONLY
+
+EXPORT_C TInt RGOomMonitorSession::Connect()
+    {
+    FUNC_LOG;
+    iFlags = EGoonCFlagsNone; // initialization
+    if (CreateSession(KGraphicsMemoryMonitorServerName, TVersion(0,0,0)) == KErrNone)
+        {
+        iFlags = EGoonCFlagsConnected;
+        }    
+            
+    // always return KErrNone for now        
+    return KErrNone;
+    }
+
+EXPORT_C TBool RGOomMonitorSession::IsConnected()
+    {
+    FUNC_LOG;
+    return iFlags&EGoonCFlagsConnected;
+    }
+
+EXPORT_C TInt RGOomMonitorSession::RequestFreeMemory(TInt aBytesRequested)
+    {
+    FUNC_LOG;
+    if (IsConnected())
+        {
+        TIpcArgs p(aBytesRequested,0);
+        return SendReceive(EGOomMonitorRequestFreeMemory, p);
+        }
+    return KErrNone;    
+    }
+
+EXPORT_C TInt RGOomMonitorSession::RequestOptionalRam(TInt aBytesRequested, TInt aMinimumBytesNeeded, TInt aPluginId, TInt& aBytesAvailable)
+    {
+    FUNC_LOG;
+    if (IsConnected())
+        {
+        TIpcArgs p(aBytesRequested, aMinimumBytesNeeded, aPluginId, aBytesAvailable);
+        TInt ret = SendReceive(EGOomMonitorRequestOptionalRam, p);
+        if (ret >= 0)
+            {
+            aBytesAvailable = ret;
+            ret = KErrNone;
+            }
+
+        return ret;
+        }
+    return KErrNone;
+    }    
+
+EXPORT_C void RGOomMonitorSession::RequestOptionalRam(TInt aBytesRequested, TInt aMinimumBytesNeeded, TInt aPluginId, TRequestStatus& aStatus)
+    {
+    FUNC_LOG;
+
+    if (IsConnected())
+        {
+        TIpcArgs p(aBytesRequested, aMinimumBytesNeeded, aPluginId);
+        SendReceive(EGOomMonitorRequestOptionalRam, p, aStatus);
+        }
+    else
+        {
+        TRequestStatus* sptr = &aStatus;
+        User::RequestComplete(sptr, KErrNone);
+        }    
+    }
+
+EXPORT_C void RGOomMonitorSession::RequestFreeMemory(TInt aBytesRequested, TRequestStatus& aStatus)
+    {
+    FUNC_LOG;
+
+    if (IsConnected())
+        {
+        TIpcArgs p(aBytesRequested,0);
+        SendReceive(EGOomMonitorRequestFreeMemory, p, aStatus);
+        }
+    else
+        {
+        TRequestStatus* sptr = &aStatus;
+        User::RequestComplete(sptr, KErrNone);
+        }    
+    }
+
+EXPORT_C void RGOomMonitorSession::CancelRequestFreeMemory()
+    {
+    FUNC_LOG;
+    if (IsConnected())
+        {
+        SendReceive(EGOomMonitorCancelRequestFreeMemory, TIpcArgs());
+        }
+    }
+
+EXPORT_C void RGOomMonitorSession::ThisAppIsNotExiting(TInt aWgId)
+    {
+    FUNC_LOG;
+    if (IsConnected())
+        {
+        TIpcArgs p(aWgId);
+        SendReceive(EGOomMonitorThisAppIsNotExiting, p);
+        }
+    }
+
+
+EXPORT_C void RGOomMonitorSession::SetGOomPriority(TGOomPriority aPriority)
+    {
+    FUNC_LOG;
+    if (!IsConnected())
+        {
+        return;
+        }
+
+    CCoeEnv* coeEnv = CCoeEnv::Static();
+
+    __ASSERT_DEBUG(coeEnv, GOomMonitorPanic(KNoCoeEnvFound));
+
+    if (coeEnv)
+        {
+        TInt wgId = coeEnv->RootWin().Identifier();
+        TIpcArgs p(wgId);
+        switch (aPriority)
+            {
+            case EGOomPriorityNormal:
+                SendReceive(EGOomMonitorSetPriorityNormal, p);
+                break;
+            case EGOomPriorityHigh:
+                SendReceive(EGOomMonitorSetPriorityHigh, p);
+                break;
+            case EGOomPriorityBusy:
+                SendReceive(EGOomMonitorSetPriorityBusy, p);
+                break;
+            default:
+                GOomMonitorPanic(KGOomInvalidPriority);
+                break;
+            }
+        }
+    }
+
+EXPORT_C void RGOomMonitorSession::ApplicationAboutToStart(const TUid& aAppUid)
+    {
+    FUNC_LOG;
+    if (IsConnected())
+        {
+#ifdef ASYNCH_NOTIFICATION_ONLY            
+        SendReceive(EGoomMonitorAppAboutToStart, TIpcArgs(aAppUid.iUid));
+#else
+        SendReceive(EGOomMonitorRequestFreeMemory, TIpcArgs(0,aAppUid.iUid));
+#endif
+        }
+    }
+    
+    
+EXPORT_C void RGOomMonitorSession::UsesAbsoluteMemTargets(TBool aUseAbsoluteAmount)
+    {
+    FUNC_LOG;    
+    if (IsConnected())
+        {
+        SendReceive(EGoomMonitorAppUsesAbsoluteMemTargets, TIpcArgs(aUseAbsoluteAmount));
+        }    
+    }    
+
+EXPORT_C TInt RGOomMonitorSession::Connect(TRequestStatus& aStatus)
+    {
+    FUNC_LOG;
+    iFlags = EGoonCFlagsNone; // initialization
+    
+    TInt err = CreateSession( KGraphicsMemoryMonitorServerName, 
+        TVersion( 0, 0, 0 ), 1, EIpcSession_Unsharable, 0, &aStatus ); 
+        
+    if ( err == KErrNone )    
+        {
+        iFlags = EGoonCFlagsConnected;
+        }    
+            
+    return err;
+    }
+
+EXPORT_C void RGOomMonitorSession::AppAboutToStart(TRequestStatus& aStatus, const TUid& aAppUid)
+    {
+    FUNC_LOG;
+    if (IsConnected())
+        {
+#ifdef ASYNCH_NOTIFICATION_ONLY            
+        SendReceive(EGoomMonitorAppAboutToStart, TIpcArgs(aAppUid.iUid), aStatus);
+#else
+        SendReceive(EGOomMonitorRequestFreeMemory, TIpcArgs(0,aAppUid.iUid), aStatus);
+#endif
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goompanic.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Panic codes and functions for GOOM monitor
+*
+*/
+
+
+#include "goompanic.h"
+
+#include <e32std.h>
+
+void GOomMonitorPanic(TGOomMonitorPanic aReason)
+    {
+    _LIT(KCat, "GOomMonitor");
+    User::Panic(KCat, aReason);
+    }
+
+void GOomConfigParserPanic(TInt aReason)
+    {
+    _LIT(KParserCat, "GOomParser");
+    User::Panic(KParserCat, aReason);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goompluginwaiter.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing GOOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#include "goompluginwaiter.h"
+#include "goomrunplugin.h"
+#include "goomtraces.h"
+
+const TInt KMicrosecondsInMillisecond = 1000;
+
+CGOomPluginWaiter* CGOomPluginWaiter::NewL(TInt aMillisecondsToWait, CGOomRunPlugin& aCallbackClass)
+    {
+    FUNC_LOG;
+
+    CGOomPluginWaiter* self = new (ELeave) CGOomPluginWaiter(aMillisecondsToWait, aCallbackClass);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CGOomPluginWaiter::CGOomPluginWaiter(TInt aMillisecondsToWait, CGOomRunPlugin& aCallbackClass) : CTimer(EPriorityStandard), iMillisecondsToWait(aMillisecondsToWait), iCallbackClass(aCallbackClass)
+    {
+    FUNC_LOG;
+
+    CActiveScheduler::Add(this);
+    }
+
+// Start the timer, it will call the plugin back when it expires
+void CGOomPluginWaiter::Start()
+    {
+    FUNC_LOG;
+
+    HighRes(iMillisecondsToWait * KMicrosecondsInMillisecond);
+    }
+    
+void CGOomPluginWaiter::RunL()
+    {
+    FUNC_LOG;
+
+    iCallbackClass.WaitCompleted();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomrunplugin.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,96 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Classes for executing GOOM actions (e.g. closing applications and running plugins).
+*
+*/
+
+
+#include <goommonitorplugin.hrh>
+#include "goomrunplugin.h"
+#include "goomtraces.h"
+#include "goommemorymonitor.h"
+#include "goommonitorplugin.h"
+#include "goomactionlist.h"
+
+CGOomRunPlugin* CGOomRunPlugin::NewL(TUint aPluginId, CGOomRunPluginConfig& aConfig, MGOomActionObserver& aStateChangeObserver, CGOomMonitorPlugin& aPlugin)
+    {
+    FUNC_LOG;
+
+    CGOomRunPlugin* self = new (ELeave) CGOomRunPlugin(aPluginId, aConfig, aStateChangeObserver, aPlugin);
+    CleanupStack::PushL(self);
+    self->ConstructL(aConfig);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+// Run the GOOM plugin in order to free memory
+// Call the CGOomAction::MemoryFreed when it is done
+void CGOomRunPlugin::FreeMemory(TInt aBytesRequested)
+    {
+    FUNC_LOG;
+    TRACES1("CGOomRunPlugin::FreeMemory: iPluginId = 0x%x", iPluginId);
+    TRACES1("CGOomRunPlugin::FreeMemory: aBytesRequested = %d", aBytesRequested);
+
+    // Ask the plugin to free some memory, should actually ask the difference 
+    // between existing and required amount..
+    TInt clientId = iStateChangeObserver.ClientId();
+    TAny* anyp = (TAny*) &clientId;
+    iPlugin.ExtensionInterface(TUid::Uid(KGoomClientSecureId), anyp);
+    iPlugin.FreeRam(aBytesRequested);
+
+    iFreeMemoryCalled = ETrue;
+
+    // Wait for the required time before we signal completion.
+    iPluginWaiter->Start();
+    }
+
+// Call the memory good function on the plugin but...
+// only if there is an outstanding FreeMemory request
+void CGOomRunPlugin::MemoryGood()
+    {
+    FUNC_LOG;
+
+    if (iFreeMemoryCalled)
+        {
+        iPlugin.MemoryGood();
+        iFreeMemoryCalled = EFalse;
+        }
+    }
+
+CGOomRunPlugin::~CGOomRunPlugin()
+    {
+    FUNC_LOG;
+
+    delete iPluginWaiter;
+    }
+
+CGOomRunPlugin::CGOomRunPlugin(TUint aPluginId, CGOomRunPluginConfig& aConfig, MGOomActionObserver& aStateChangeObserver, CGOomMonitorPlugin& aPlugin) : CGOomAction(aStateChangeObserver), iPluginId(aPluginId), iPlugin(aPlugin), iConfig(aConfig)
+    {
+    FUNC_LOG;
+    }
+
+void CGOomRunPlugin::ConstructL(CGOomRunPluginConfig& aPluginConfig)
+    {
+    FUNC_LOG;
+
+    TInt waitDuration = CMemoryMonitor::GlobalConfig().iDefaultWaitAfterPlugin;
+
+    if (aPluginConfig.WaitAfterPluginDefined())
+        {
+        // If the wait duration for this plugin is overridden then use the overridden value
+        waitDuration = aPluginConfig.WaitAfterPlugin();
+        }
+
+    iPluginWaiter = CGOomPluginWaiter::NewL(waitDuration, *this);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomrunpluginconfig.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Configuration representation classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#include "goomrunpluginconfig.h"
+#include "goomwindowgrouplist.h"
+#include "goomtraces.h"
+
+CGOomRunPluginConfig* CGOomRunPluginConfig::NewL(TUint aPluginId, TGOomPluginType aPluginType)
+    {
+    FUNC_LOG;
+
+    CGOomRunPluginConfig* self = new (ELeave) CGOomRunPluginConfig(aPluginId, aPluginType);
+    return self;
+    }
+
+TUint CGOomRunPluginConfig::CalculatePluginPriority(const CGOomWindowGroupList& aWindowGroupList)
+    {
+    FUNC_LOG;
+
+    // Call the Priority function on the CActionConfig base class
+    // This function will check if any rules match the current system state and then adjust the priority if they do
+    // Rules may apply to system plugins or application plugins
+    return Priority(aWindowGroupList, aWindowGroupList.GetIndexFromAppId(iTargetAppId));
+    }
+
+
+CGOomRunPluginConfig::~CGOomRunPluginConfig()
+    {
+    FUNC_LOG;
+    }
+    
+
+CGOomRunPluginConfig::CGOomRunPluginConfig(TUint aPluginId, TGOomPluginType aPluginType) : CGOomActionConfig(aPluginId), iPluginId(aPluginId), iPluginType(aPluginType)
+    {
+    FUNC_LOG;
+
+    iSyncMode = EContinueIgnoreMaxBatchSize;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomthresholdcrossedao.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,329 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  A Synch Object thread for EGL resource monitoring
+*
+*/
+
+
+typedef void* EGLSync;
+typedef EGLSync (*eglCreateSync)(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
+typedef EGLBoolean (*eglDestroySync)(EGLDisplay dpy, EGLSync sync);
+typedef EGLint (*eglClientWaitSync)(EGLDisplay dpy, EGLSync sync, EGLint flags, TUint64 timeout);
+#ifndef EGL_SYNC_CONDITION_KHR
+#define EGL_SYNC_CONDITION_KHR  0x30f8
+#endif
+
+
+_LIT(KGoomAsyncWaitThreadName,"goom_asy");
+
+NONSHARABLE_CLASS(CGoomThresholdCrossed): public CActive
+    {
+    public:
+    CGoomThresholdCrossed(CMemoryMonitor& aMonitor, TUint aAction, TInt aThreshold)
+        :CActive(CActive::EPriorityHigh), 
+        iMarkerState(KErrNotFound),
+        iActiveThreshold(aThreshold),
+        iAction(aAction),
+        iThread(RThread().Id()),
+        iMonitor(aMonitor)
+        {
+        FUNC_LOG;
+        CActiveScheduler::Add(this);
+        iSema.CreateLocal();
+        iStop.CreateLocal();
+        iThreadName.Append(KGoomAsyncWaitThreadName);
+        iThreadName.AppendNum(aAction); // assuming single observer for an action
+        RequestNotifications();
+        }
+
+    // ---------------------------------------------------------------------------
+    // Thread name
+    // Thread name consists on constant part and action that triggers the ao 
+    // ---------------------------------------------------------------------------
+    //
+    const TDesC& ThreadName()
+        {
+        FUNC_LOG;
+        return iThreadName;
+        }
+    
+    void Stop()
+        {
+        if (!iPaused)
+            {
+            iStop.Wait();
+            iPaused = ETrue;
+            ResetThresholds();
+            }
+         }   
+    void Continue()
+        {
+        if (iPaused)
+            {
+            iStop.Signal();
+            iPaused = EFalse;
+            }
+        }
+    // ---------------------------------------------------------------------------
+    // Destructor
+    // Standard destructor, cancels pending request and releases egl wait
+    // ---------------------------------------------------------------------------
+    //
+    ~CGoomThresholdCrossed()
+        {
+        FUNC_LOG;
+        Cancel();
+        iSema.Close();
+        iStop.Close();
+        }        
+ 
+    // ---------------------------------------------------------------------------
+    // SetThreshold
+    // Destroys the synch object so EGL busy loop will get new values 
+    // ---------------------------------------------------------------------------
+    //
+    void SetThreshold(TInt aThreshold)
+        {
+        FUNC_LOG;
+        if (iActiveThreshold != aThreshold)
+            {
+            iActiveThreshold = aThreshold;
+            ResetThresholds();
+            }
+        }
+
+    // ---------------------------------------------------------------------------
+    // ResetThresholds
+    // See SetThreshold. Releases synch object 
+    // ---------------------------------------------------------------------------
+    //
+    void ResetThresholds()
+        {
+        FUNC_LOG;
+        if (iMarkerState == KErrNone)
+            {
+            iMarkerState = KErrDied;
+            eglDestroySync_fptr(iDpy, iMarker);
+            }  
+        }
+            
+    // ---------------------------------------------------------------------------
+    // StartRequestEvents
+    // Busy loop that is blocked by egl wait. exit on Cancel. 
+    // Runs on separate thread.
+    // ---------------------------------------------------------------------------
+    //
+    void StartRequestEvents()
+        {
+        FUNC_LOG;
+        iDpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+        EGLint major, minor;
+        eglInitialize(iDpy, &major, &minor);
+        
+        eglCreateSync_fptr = (eglCreateSync)eglGetProcAddress("eglCreateSyncKHR");
+        eglDestroySync_fptr = (eglDestroySync)eglGetProcAddress("eglDestroySyncKHR");
+        eglClientWaitSync_fptr = (eglClientWaitSync)eglGetProcAddress("eglClientWaitSyncKHR");
+        if (!eglCreateSync_fptr || !eglDestroySync_fptr || !eglClientWaitSync_fptr )
+            {
+            /* Free allocated memory */
+            eglTerminate(iDpy);
+            return;
+            }
+            
+        while(!iCancelled)
+            {
+            iStop.Wait();
+            iStop.Signal();
+            TUint usedThreshold = Min(iActiveThreshold,32*1024*1024) ;
+            TUint action = iAction;
+            const EGLint sync_attribs[] =
+                {
+                EGL_SYNC_CONDITION_KHR,              action,
+                EGL_PROF_MEMORY_USAGE_THRESHOLD_NOK, 32*1024*1024-usedThreshold,
+                EGL_NONE
+                };
+
+            /* Create a resource profiling sync */
+            iMarker = eglCreateSync_fptr(iDpy,
+                                         EGL_SYNC_RESOURCE_PROFILING_NOK,
+                                         sync_attribs);
+            iMarkerState = KErrNone;
+
+            /* Wait until graphics memory usage exceeds the given threshold */
+            eglClientWaitSync_fptr(iDpy, iMarker, 0, EGL_FOREVER_KHR);
+            
+            if (iMarkerState != KErrDied)
+                {
+                eglDestroySync_fptr(iDpy, iMarker);
+                Trigger(action/*, usedThreshold*/);
+                }                
+            }            
+
+        /* Free allocated memory */
+        eglTerminate(iDpy);
+        iMarkerState = KErrNotFound;
+        }
+ 
+    // ---------------------------------------------------------------------------
+    // RequestNotifications
+    // Setting listener for changes, no queue at the moment
+    // ---------------------------------------------------------------------------
+    //
+    void RequestNotifications(TBool aWasPaused = EFalse)
+        {
+        FUNC_LOG;
+        iSema.Wait();
+        iStatus = KRequestPending;
+        SetActive();
+        iSema.Signal();
+        if (!aWasPaused)
+            {
+            Continue();
+            }            
+        }
+    
+    // ---------------------------------------------------------------------------
+    // Trigger
+    // Letting mainthread to know that threshold was crossed
+    // ---------------------------------------------------------------------------
+    //
+    void Trigger(TInt aReason)
+        {
+        FUNC_LOG;
+        iSema.Wait();    
+        if (IsActive() && iStatus == KRequestPending)
+            {
+            Stop();
+            RThread t;
+            TInt err = t.Open(iThread);
+            if (err)
+                {
+                RDebug::Print(_L("CGoomThresholdCrossed::Trigger() RThread::Open() error: %d"), err );
+                User::Invariant();
+                }
+            TRequestStatus* status = &iStatus;
+            t.RequestComplete(status, aReason);
+            t.Close();
+            }
+        iSema.Signal();
+        }
+        
+    // ---------------------------------------------------------------------------
+    // RunL()
+    // Thread safe way to hanlde crossed threshold in main thread
+    // ---------------------------------------------------------------------------
+    //
+    void RunL()
+        {
+        FUNC_LOG;
+        switch (iStatus.Int())
+            {
+        case KErrNone:
+            break;
+        case KErrCancel:
+            return;
+        default:
+            break;
+            }
+		
+	TInt thresholdType = iStatus.Int();
+		
+        TRAP_IGNORE(iMonitor.FreeMemThresholdCrossedL(thresholdType, iAction));
+        
+        RequestNotifications(iPaused);
+        }
+    
+    // ---------------------------------------------------------------------------
+    // Cancel
+    // Cancels the busy loop even the Object was not active
+    // ---------------------------------------------------------------------------
+    //
+    void Cancel()
+        {
+        FUNC_LOG;
+        iCancelled = ETrue;
+        ResetThresholds();
+        CActive::Cancel();
+        }
+        
+    // ---------------------------------------------------------------------------
+    // DoCancel
+    // Cancels the active object
+    // ---------------------------------------------------------------------------
+    //
+    void DoCancel()
+        {
+        FUNC_LOG;
+        Trigger(KErrCancel);
+        }
+    
+    EGLSync iMarker;
+    TInt iMarkerState;
+    TUint iActiveThreshold;
+    TUint iAction;
+    TBool iCancelled;
+    RCriticalSection iSema;
+    TThreadId iThread;
+    eglCreateSync  eglCreateSync_fptr;
+    eglDestroySync eglDestroySync_fptr;
+    eglClientWaitSync eglClientWaitSync_fptr ; 
+    CMemoryMonitor& iMonitor;
+    TBuf<16> iThreadName;
+    EGLDisplay iDpy;
+    TBool iPaused;
+    RCriticalSection iStop;
+    };
+
+// ---------------------------------------------------------------------------
+// Entry point into the new thread
+// ---------------------------------------------------------------------------
+//   
+GLDEF_C TInt EGLSynchObjThreadStartFunction(TAny* aBridge)
+    {
+    CTrapCleanup* trapCleanup = CTrapCleanup::New();
+    if (!trapCleanup)
+        {
+        return KErrNoMemory;
+        }
+        
+    CGoomThresholdCrossed* ao = static_cast<CGoomThresholdCrossed*>(aBridge);
+    TInt err = User::RenameThread(ao->ThreadName());
+    RThread().SetPriority(EPriorityAbsoluteHigh);
+    ao->StartRequestEvents();
+
+    delete trapCleanup;
+    return err;
+    }
+
+CGoomThresholdCrossed* CreateThresholdCrossedThreadL(CMemoryMonitor& aMonitor, TUint aAction, TInt aThreshold)
+    {
+    FUNC_LOG;
+    CGoomThresholdCrossed* ao = new (ELeave) CGoomThresholdCrossed(aMonitor, aAction, aThreshold);
+    CleanupStack::PushL(ao);
+    RThread syncThread;
+
+    User::LeaveIfError(syncThread.Create(
+            ao->ThreadName(),
+            EGLSynchObjThreadStartFunction,
+            16384, // magic
+            0, // uses same heap
+            (TAny*)ao, 
+            EOwnerThread));
+
+    syncThread.Resume();
+    syncThread.Close();
+    CleanupStack::Pop();
+    return ao;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomwindowgrouplist.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,641 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  A wrapper for the window group list, adding additional functionality required by GOOM Monitor
+*
+*/
+
+
+#include <w32std.h>
+#include <e32std.h>
+#include <apgtask.h>
+#include <apgwgnam.h>
+
+//#include "eglext.h"
+#include <EGL/egl.h>
+
+#include "goomwindowgrouplist.h"
+#include "goomtraces.h"
+#include "goomconstants.hrh"
+
+_LIT(KDummyWgName, "20");
+const TInt KPreallocatedSpaceForAppList = 50;
+
+const TUint KGOomTicksPerSecond = 1000;
+
+typedef EGLBoolean (*NOK_resource_profiling)(EGLDisplay, EGLint, EGLint*, EGLint, EGLint*);
+
+CGOomWindowGroupList::TGOomWindowGroupProperties::TGOomWindowGroupProperties() :  iIdleTickTime(0), iDynamicPriority(EGOomPriorityNormal)
+    {
+    FUNC_LOG;
+    }
+
+// Update the list of window groups
+void CGOomWindowGroupList::Refresh()
+    {
+    FUNC_LOG;
+    
+#ifdef _DEBUG
+    TRAPD(err, RefreshL());
+    if (err)
+        {
+        TRACES1("CGOomWindowGroupList::Refresh(): RefreshL leave %d", err);
+        }
+#else
+    TRAP_IGNORE(RefreshL());
+    // Ignore any error
+    // Errors are very unlikely, the only possibility is OOM errors (which should be very unlikely due to pre-created, re-reserved lists)
+    // The outcome of any error is that the most foreground operations will be missing from the list
+    // meaning that they will not be considered candidates for closing
+#endif    
+    }
+
+// Update the list of window groups
+// Should be called whenever the 
+void CGOomWindowGroupList::RefreshL()
+    {
+    FUNC_LOG;
+  
+    NOK_resource_profiling eglQueryProfilingData = (NOK_resource_profiling)eglGetProcAddress("eglQueryProfilingDataNOK");
+    
+    if (!eglQueryProfilingData)
+            {
+            TRACES("RefreshL EGL_NOK_resource_profiling not available");
+            return;
+            }
+    
+    EGLint data_count;
+    EGLint* prof_data;
+    TInt i(0);
+    RArray<TUint64> processIds;
+    //RArray<TUint> privMemUsed;
+        
+    EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+
+    /* Find out how much profiling data is available */
+    eglQueryProfilingData(dpy, EGL_PROF_QUERY_GLOBAL_BIT_NOK|
+                                EGL_PROF_QUERY_MEMORY_USAGE_BIT_NOK,
+                                NULL, 0, &data_count);
+    
+    /* Allocate room for the profiling data */
+    prof_data = (EGLint*)User::Alloc(data_count * sizeof(EGLint));
+    if (prof_data == NULL)
+        return;
+
+    /* Retrieve the profiling data */
+    eglQueryProfilingData(dpy,   EGL_PROF_QUERY_GLOBAL_BIT_NOK|
+                                 EGL_PROF_QUERY_MEMORY_USAGE_BIT_NOK,
+                                 prof_data,
+                                 data_count,
+                                 &data_count);
+    
+    /* Iterate over the returned data */
+    while (i < data_count)
+        {
+        TRACES2("RefreshL EGL_NOK_resource_profiling - index: %d data: %x", i, prof_data[i]);
+            
+        switch (prof_data[i++])
+            {   
+            case EGL_PROF_PROCESS_ID_NOK:
+                {
+                TUint64 process_id;
+                if (sizeof(EGLNativeProcessIdTypeNOK) == 8)
+                    {
+                    process_id = TUint64(prof_data[i]);
+                    process_id += (TUint64(prof_data[i + 1]) << 32);
+                    i+=2;
+                    }
+                else
+                    {
+                    process_id = prof_data[i];
+                    i++;
+                    }
+                processIds.Append(process_id);
+                break;
+                }
+            case EGL_PROF_PROCESS_USED_PRIVATE_MEMORY_NOK:
+                {
+                //TUint mem = prof_data[i];
+                //privMemUsed.Append(mem);
+                i++;
+                break;
+                }
+            case EGL_PROF_PROCESS_USED_SHARED_MEMORY_NOK:
+            case EGL_PROF_USED_MEMORY_NOK:
+            case EGL_PROF_TOTAL_MEMORY_NOK:
+            default:
+                {
+                TRACES2("RefreshL index %d, data: %d\n", i, prof_data[i]);
+                i++;
+                break;
+                }
+            }
+        }
+        
+    /* Free allocated memory */
+    User::Free(prof_data);
+    
+    TRACES1("RefreshL : %d Processes use gfx memory", processIds.Count());
+    
+    ///////////////////////////////////////////////////////////////////
+    // Optimization, no need to construct list if ALF is the only one
+    ///////////////////////////////////////////////////////////////////
+    
+    if (processIds.Count() == 1)
+        {
+        RProcess process;
+        TInt err =  process.Open(processIds[0]);
+        if(!err)
+            {
+            TInt secureId = process.SecureId();
+            process.Close();
+            if(secureId == 0x10003B20) // magic, wserv 
+                {
+                processIds.Close();
+                TRACES("Only WServ using GFX mem, no need for app actions");
+                return;
+                }
+            }
+        }
+        
+    // Refresh window group list
+    // get all window groups, with info about parents
+    TInt numGroups = iWs.NumWindowGroups(0);
+    iWgIds.ReserveL(numGroups);
+    User::LeaveIfError(iWs.WindowGroupList(0, &iWgIds));
+    
+    // Remove all child window groups, promote parents to foremost child position
+    CollapseWindowGroupTree();
+    
+    // Note the current foreground window ID (if there is one)
+    TBool oldForegroundWindowExists = EFalse;
+
+    TInt oldForegroundWindowId;
+    if (iWgIds.Count() > 0)
+        {
+        oldForegroundWindowId = iWgIds[0].iId;
+        oldForegroundWindowExists = ETrue;
+        }    
+    
+    // Cleanup the idletime hash map to remove idle times for any windows that have closed
+    RemovePropertiesForClosedWindowsL();
+    
+    // Update the idle tick on the old foreground application (which might now be in the background)
+    // This will be set to the current system tick count and will be used later to determine the idle time
+    if (oldForegroundWindowExists)
+        {
+        TGOomWindowGroupProperties* wgProperties = iWgToPropertiesMapping.Find(oldForegroundWindowId);
+        if (wgProperties)
+            {
+            wgProperties->iIdleTickTime = User::NTickCount();
+            }
+        
+        // If there is no idle tick entry for this window ID then it will be created in the next step...
+        }
+    
+    TInt index = iWgIds.Count();
+    
+    while (index--)
+        {
+        //Remove if process is not in list of processes using gfx mem
+        TUint secureId = AppId(index,ETrue);
+        TBool found = 0;
+        TInt i = 0;
+        for(i = 0; i < processIds.Count(); i++)
+            {
+            RProcess process;
+            TInt er =  process.Open(processIds[i]);
+            if(er != KErrNone)
+                {
+                TRACES2("RefreshL Error opening process handle %d, err %d", index, er);
+                continue;
+                }
+            /*static _LIT_SECURITY_POLICY_S0(mySidPolicy, secureId);
+            if(mySidPolicy().CheckPolicy(process))*/
+            TInt psecid = process.SecureId();
+            if(secureId == psecid)
+                {
+                found = 1;
+                process.Close();
+                TRACES2("RefreshL Process id %x, wgindex %d, using gfx memory. Added to list", psecid, index);
+                break;
+                }
+            process.Close();
+            }
+      
+        if(!found)
+            {
+            iWgIds.Remove(index);
+            continue;
+            }
+      
+        // See if there is a tick count entry for each window in the list
+        TGOomWindowGroupProperties* wgProperties = iWgToPropertiesMapping.Find(iWgIds[index].iId);
+        
+        if (!wgProperties)
+            {
+            TGOomWindowGroupProperties wgProperties;
+            wgProperties.iIdleTickTime = User::NTickCount();
+            // If there is no idle tick entry for this window then add one
+            iWgToPropertiesMapping.InsertL(iWgIds[index].iId, wgProperties);
+            }
+        }
+       
+    processIds.Close();
+    //privMemUsed.Close();       
+    
+    }
+
+
+
+void CGOomWindowGroupList::RemovePropertiesForClosedWindowsL()
+    {
+    FUNC_LOG;
+    
+    // First, clear the existing set of window IDs (it would be quicker to delete it BUT we have reserved memory for it and don't want to be allocating in low memory conditions)
+    RHashSet<TInt>::TIter windowIdSetIter(iExistingWindowIds);
+    while (windowIdSetIter.Next())
+        {
+        windowIdSetIter.RemoveCurrent();
+        }
+    
+    // Create the set of existing window IDs (this saves expensive/repeated searching later on)
+    TInt index = iWgIds.Count();
+    while (index--)
+        {
+        iExistingWindowIds.InsertL(iWgIds[index].iId);
+        }
+    
+    // Iterate the idle-time hash map - remove any items where the window no longer exists
+    RHashMap<TInt, TGOomWindowGroupProperties>::TIter wgToIdleIterator(iWgToPropertiesMapping);
+    while (wgToIdleIterator.NextKey())
+        {
+        // If the current key (window ID) does not exist in the set then remove the idle-time as it is no longer relevant
+        if (!iExistingWindowIds.Find(*(wgToIdleIterator.CurrentKey())))
+                wgToIdleIterator.RemoveCurrent();
+        }
+    }
+
+
+TUint CGOomWindowGroupList::AppId(TInt aIndex, TBool aResolveFromThread) const
+    {
+    FUNC_LOG;
+
+    if (aIndex < 0 || aIndex >= iWgIds.Count())
+        {
+        return 0; // somewhat equals to KNullUid
+        }
+		
+    //TRACES2("CGOomWindowGroupList::AppId(%d), count: %d ",aIndex,iWgIds.Count());
+
+    TInt wgId = iWgIds[aIndex].iId;
+    
+    return AppIdfromWgId(wgId, aResolveFromThread);
+    }
+
+TUint CGOomWindowGroupList::AppIdfromWgId(TInt aWgId, TBool aResolveFromThread) const
+    {
+    // get the app's details
+    TPtr wgPtr(iWgNameBuf->Des());
+    
+    TUid uid;
+    
+    TInt wgId = aWgId;
+    
+    TInt err = iWs.GetWindowGroupNameFromIdentifier(wgId, wgPtr);
+    
+    if (KErrNone != err)
+        // If there is an error then set the UID to 0;
+        {
+        uid.iUid = 0;
+        }
+    else 
+        {
+        iWgName->SetWindowGroupName(iWgNameBuf); // iWgName takes ownership of iWgNameBuf
+        uid = iWgName->AppUid(); // This UID comes from the app, not the mmp!
+        if (aResolveFromThread && uid.iUid == 0)
+            {
+            TApaTask task(iWs);
+            task.SetWgId(wgId);
+            TThreadId threadId = task.ThreadId();
+            
+            TUint resolvedUid = 0;
+            RThread appThread;
+            TInt err = appThread.Open( threadId );
+            if ( err == KErrNone )
+                {
+                resolvedUid = appThread.SecureId().iId;
+                }
+            appThread.Close();
+            //TRACES2("CGOomWindowGroupList::AppId: NULL wg UID, taking from thread; resolvedUid = %x aIndex = %d", resolvedUid, aIndex);            
+            return resolvedUid;               
+            }
+        }
+    
+    return uid.iUid;
+    }
+    
+
+TTimeIntervalSeconds CGOomWindowGroupList::IdleTime(TInt aIndex) const
+    {
+    FUNC_LOG;
+
+    TUint32 currentTickCount = User::NTickCount();
+        
+    const TGOomWindowGroupProperties* wgProperties = 0;
+    if (aIndex >= 0 && aIndex < iWgIds.Count())
+        {
+        wgProperties = iWgToPropertiesMapping.Find(iWgIds[aIndex].iId);
+        }
+    
+    TTimeIntervalSeconds idleTime = 0;
+    
+    if (wgProperties)
+        {
+        // This should also handle the case where the current tick count has wrapped to a lower value than the idle tick time
+        // It will only work if it has wrapped once, but
+        TUint32 differenceBetweenTickCounts = currentTickCount - wgProperties->iIdleTickTime;
+        idleTime = differenceBetweenTickCounts / KGOomTicksPerSecond;
+        }
+    
+    return idleTime;
+    }
+  
+
+
+void CGOomWindowGroupList::CollapseWindowGroupTree()
+    {
+    FUNC_LOG;
+
+    // start from the front, wg count can reduce as loop runs
+    for (TInt ii=0; ii<iWgIds.Count();)
+        {
+        RWsSession::TWindowGroupChainInfo& info = iWgIds[ii];
+        if (info.iParentId > 0)        // wg has a parent
+            {
+            // Look for the parent position
+            TInt parentPos = ii;        // use child pos as not-found signal
+            TInt count = iWgIds.Count();
+            for (TInt jj=0; jj<count; jj++)
+                {
+                if (iWgIds[jj].iId == info.iParentId)
+                    {
+                    parentPos = jj;
+                    break;
+                    }
+                }
+
+            if (parentPos > ii)  // parent should be moved forward
+                {
+                iWgIds[ii] = iWgIds[parentPos];
+                iWgIds.Remove(parentPos);
+                }
+            else if (parentPos < ii)  // parent is already ahead of child, remove child
+                iWgIds.Remove(ii);
+            else                    // parent not found, skip
+                ii++;
+            }
+        else    // wg does not have a parent, skip
+            ii++;
+        }    
+    }
+
+
+
+CGOomWindowGroupList::CGOomWindowGroupList(RWsSession& aWs) : iWs(aWs)
+    {
+    FUNC_LOG;
+    }
+
+
+
+void CGOomWindowGroupList::ConstructL()
+    {
+    FUNC_LOG;
+
+    // Reserve enough space to build an app list later.
+    iWgIds.ReserveL(KPreallocatedSpaceForAppList);
+    iUncollapsedWgIds.ReserveL(KPreallocatedSpaceForAppList);
+    
+    // Reserve enough space for the WG to idle tick mapping
+    iWgToPropertiesMapping.ReserveL(KPreallocatedSpaceForAppList);
+    
+    // Reserve enough space for CApaWindowGroupName.
+    iWgName = CApaWindowGroupName::NewL(iWs);
+    iWgNameBuf = HBufC::NewL(CApaWindowGroupName::EMaxLength);
+    (*iWgNameBuf) = KDummyWgName;
+    iWgName->SetWindowGroupName(iWgNameBuf);    // iWgName takes ownership of iWgNameBuf
+    }
+
+
+
+CGOomWindowGroupList* CGOomWindowGroupList::NewL(RWsSession& aWs)
+    {
+    FUNC_LOG;
+
+    CGOomWindowGroupList* self = new (ELeave) CGOomWindowGroupList(aWs);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+
+
+CGOomWindowGroupList::~CGOomWindowGroupList()
+    {
+    FUNC_LOG;
+
+    iWgIds.Close();
+    iUncollapsedWgIds.Close();
+    iWgToPropertiesMapping.Close();
+    iExistingWindowIds.Close();
+    delete iWgName;
+    }
+
+
+void CGOomWindowGroupList::SetPriorityBusy(TInt aWgId)
+    {
+    FUNC_LOG;
+
+    //Refresh();
+    
+    TInt parentId;
+    TRAPD(err, parentId = FindParentIdL(aWgId));
+    if (err)
+        {
+        parentId = aWgId;
+        }
+    
+    TRACES2("CGOomWindowGroupList::SetPriorityBusy aWgId = %d, parentId = %d", aWgId, parentId);
+    
+    TGOomWindowGroupProperties* wgProperties = iWgToPropertiesMapping.Find(parentId);
+    if (wgProperties)
+        {
+        wgProperties->iDynamicPriority = EGOomPriorityBusy;
+        }
+    
+    // If we can't find the window group then ignore it
+    }
+
+
+TInt CGOomWindowGroupList::FindParentIdL(TInt aWgId)
+    {
+    TInt numGroups = iWs.NumWindowGroups(0);
+    iUncollapsedWgIds.ReserveL(numGroups);
+    User::LeaveIfError(iWs.WindowGroupList(0, &iUncollapsedWgIds));
+
+    TInt parentPos = KErrNotFound;
+   
+    //loop through the window group list
+    for (TInt i=0; i<numGroups; i++)
+        {
+        //find the index for the required aWgId
+        if (iUncollapsedWgIds[i].iId == aWgId)
+            {
+            parentPos = i;
+            break;
+            }
+        }
+
+    if (parentPos >=0 )
+        {
+        while (iUncollapsedWgIds[parentPos].iParentId > 0)
+            {
+            // find the index for the parent
+            for (TInt j=0; j<numGroups; j++)
+                {
+                if (iUncollapsedWgIds[j].iId == iUncollapsedWgIds[parentPos].iParentId)
+                    {
+                    parentPos = j;
+                    break; // break out of inner loop
+                    }
+                }
+            }
+        return iUncollapsedWgIds[parentPos].iId;
+        }
+    else 
+        {
+        return KErrNotFound;
+        }
+    }
+
+
+TBool CGOomWindowGroupList::IsBusy(TInt aWgIndex)
+    {
+    if (aWgIndex < 0 || aWgIndex >= iWgIds.Count())
+        {
+        return EFalse;
+        }
+            
+    TBool isBusy = EFalse;
+    TGOomWindowGroupProperties* wgProperties = iWgToPropertiesMapping.Find(iWgIds[aWgIndex].iId);
+    if (wgProperties)
+        {
+        isBusy = (wgProperties->iDynamicPriority == EGOomPriorityBusy);
+        }
+    
+    return isBusy;
+    }
+
+// Returns ETrue if an application has registered itself as high priority at runtime
+TBool CGOomWindowGroupList::IsDynamicHighPriority(TInt aWgIndex)
+    {
+    FUNC_LOG;
+    if (aWgIndex < 0 || aWgIndex >= iWgIds.Count())
+        {
+        return EFalse;
+        }
+
+    TBool isHighPriority = EFalse;
+    TGOomWindowGroupProperties* wgProperties = iWgToPropertiesMapping.Find(iWgIds[aWgIndex].iId);
+    if (wgProperties)
+        {
+        isHighPriority = (wgProperties->iDynamicPriority == EGOomPriorityHigh);
+        }
+    
+    return isHighPriority;
+    }
+
+CApaWindowGroupName* CGOomWindowGroupList::WgName() const
+    {
+    return iWgName;
+    }
+
+void CGOomWindowGroupList::SetPriorityNormal(TInt aWgId)
+    {
+    FUNC_LOG;
+
+    //Refresh();
+    
+    TInt parentId;
+    TRAPD(err, parentId = FindParentIdL(aWgId));
+    if (err)
+        {
+        parentId = aWgId;
+        }
+    
+    TGOomWindowGroupProperties* wgProperties = iWgToPropertiesMapping.Find(parentId);
+    if (wgProperties)
+        {
+        wgProperties->iDynamicPriority = EGOomPriorityNormal;
+        }
+    
+    // If we can't find the window group then ignore it
+    }
+
+
+void CGOomWindowGroupList::SetPriorityHigh(TInt aWgId)
+    {
+    FUNC_LOG;
+
+    //Refresh();
+
+    TInt parentId;
+    TRAPD(err, parentId = FindParentIdL(aWgId));
+    if (err)
+        {
+        parentId = aWgId;
+        }
+    
+    TGOomWindowGroupProperties* wgProperties = iWgToPropertiesMapping.Find(parentId);
+    if (wgProperties)
+        {
+        wgProperties->iDynamicPriority = EGOomPriorityHigh;
+        }
+    
+    // If we can't find the window group then ignore it
+    }
+
+// Find the specificed application in the window group list and return the index
+TInt CGOomWindowGroupList::GetIndexFromAppId(TUint aAppId) const
+    {
+    FUNC_LOG;
+
+    TInt indexInGroupList = Count();
+    TBool appFoundInWindowGroupList = EFalse;
+    
+    while (indexInGroupList--)
+        {
+        if (AppId(indexInGroupList, ETrue) == aAppId)
+            {
+            appFoundInWindowGroupList = ETrue;
+            break;
+            }
+        }
+    
+    if (!appFoundInWindowGroupList)
+        indexInGroupList = KAppNotInWindowGroupList;
+
+    return indexInGroupList;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/goommonitor/src/goomwserveventreceiver.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Main classes for Graphics Out of Memory Monitor
+*
+*/
+
+
+#include <akneiksrvc.h>
+#include <apgwgnam.h>
+#include "goomwserveventreceiver.h"
+#include "goommemorymonitor.h"
+#include "goomtraces.h"
+#include "goomconstants.hrh"
+
+CWservEventReceiver::CWservEventReceiver(CMemoryMonitor& aMonitor, RWsSession& aWs)
+: CActive(CActive::EPriorityStandard), iMonitor(aMonitor), iWs(aWs), iWg(aWs)
+    {
+    FUNC_LOG;
+
+    CActiveScheduler::Add(this);
+    }
+
+CWservEventReceiver::~CWservEventReceiver()
+    {
+    FUNC_LOG;
+
+    Cancel();
+    iWg.Close();
+    }
+
+void CWservEventReceiver::ConstructL()
+    {
+    FUNC_LOG;
+
+    User::LeaveIfError(iWg.Construct((TUint32)this, EFalse));
+    iWg.SetOrdinalPosition(0, ECoeWinPriorityNeverAtFront);
+    iWg.EnableFocusChangeEvents();
+    iWg.AutoForeground(EFalse);
+    iWg.EnableReceiptOfFocus(EFalse); 
+    
+    // first aid for triggering poll
+    //iWg.EnableGroupChangeEvents();
+    Queue();
+    }
+
+void CWservEventReceiver::Queue()
+    {
+    FUNC_LOG;
+
+    iWs.EventReady(&iStatus);
+    SetActive();
+    }
+
+void CWservEventReceiver::DoCancel()
+    {
+    FUNC_LOG;
+
+    iWs.EventReadyCancel();
+    }
+
+void CWservEventReceiver::RunL()
+    {
+    FUNC_LOG;
+
+    TWsEvent event;
+    iWs.GetEvent(event);
+    if (event.Type() == EEventFocusGroupChanged || event.Type() == EEventWindowGroupsChanged )
+        {
+        // The following is done in order to avoid changing application threshholds when fastswap is activated
+        // 1) get the new focused app's details
+        // 2) we check to see if the fastswap uid caused the change
+        // 3a) If it didn't we proceed as normal: handleFocusedWgChangeL is called
+        // 3b) If not, we skip handleFocusedWgChangeL
+        CApaWindowGroupName* aWgName = CApaWindowGroupName::NewLC(iWs, iWs.GetFocusWindowGroup());
+        if(aWgName->AppUid() != KUidFastSwap)
+            {
+            iMonitor.HandleFocusedWgChangeL(aWgName->AppUid().iUid);
+            }
+        CleanupStack::PopAndDestroy(aWgName);
+        }
+    
+    Queue();
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/group/alf_exports.inc	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,17 @@
+/*
+* ============================================================================
+*  Name        : alf_exports.inc
+*  Part of     : Alfred UI Toolkit
+*  Description : Exported header files for ALF headers.
+*  Version     : %version: 14 %
+ *
+*  Copyright © 2006-2007 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.
+* ============================================================================
+ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Build information file for project alfappserver
+*  Version     : %version: tr1sido#128.1.7 %
+*
+*/
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+#include <bldvariant.hrh>
+
+// use platform macros with subfolder
+#include <platform_paths.hrh>
+#define MW_LAYER_PLATFORM_EXPORT_PATH_ACCTK(exported) MW_LAYER_PLATFORM_EXPORT_PATH(uiacceltk/##exported)
+#define MW_LAYER_PLATFORM_EXPORT_PATH_ALF(exported) MW_LAYER_PLATFORM_EXPORT_PATH(alf/##exported)
+
+#include "../goommonitor/group/bld.inf"
+
+PRJ_EXPORTS
+#include "core_exports.inc"
+#include "alf_exports.inc"
+
+// example effects are no longer exported.
+// To make testing easier we now always export the default skin .sel file that contains
+// separate keyword definitions for appear and disappera effects for control transitions.
+// After effect system is complete and aknskins has taken over the correct 101f84b9.sel file
+// and manifest.mf file, we should no longer export these files.
+
+../coretoolkit/data/101f84b9.sel /epoc32/data/z/resource/skins/101f84b9/101f84b9.sel
+../coretoolkit/data/101f84b9.sel /epoc32/release/winscw/udeb/z/resource/skins/101f84b9/101f84b9.sel
+../coretoolkit/data/101f84b9.sel /epoc32/release/winscw/urel/z/resource/skins/101f84b9/101f84b9.sel
+
+../coretoolkit/data/manifest.mf /epoc32/data/z/resource/effects/manifest.mf
+../coretoolkit/data/manifest.mf /epoc32/release/winscw/udeb/z/resource/effects/manifest.mf
+../coretoolkit/data/manifest.mf /epoc32/release/winscw/urel/z/resource/effects/manifest.mf
+
+// Any effect files that you want to use in the emulator can be copied to
+// /epoc32/release/winscw/udeb/z/resource/effects/ directory
+// or /epoc32/winscw/c/resource/effects
+
+// Test effects are not included in ROM by default.
+// For testing effects in ROM you must either modify some iby file to get the files onto rom
+// to directory /resource/effects/
+
+// For easier testing you can also copy the effect files onto a memory card into
+// /resource/effects/ directory.
+// These files can be changed any time and reregistered by changing the skin
+
+// backround animation shaders
+../backgroundanim/refplugin/data/refvertexshader.vsh /epoc32/data/z/private/200286D3/refvertexshader.vsh
+../backgroundanim/refplugin/data/reffragmentshader.fsh /epoc32/data/z/private/200286D3/reffragmentshader.fsh
+
+// Generic configuration interface for component cenrep settings
+../conf/s60uiacceltk.confml                  APP_LAYER_CONFML(s60uiacceltk.confml)
+../conf/s60uiacceltk_10283344.crml           APP_LAYER_CRML(s60uiacceltk_10283344.crml)
+
+PRJ_MMPFILES
+
+../TokenServer/SrvSrc/ftokenserver.mmp
+../TokenServer/ClientSrc/ftokenclient.mmp
+../coretoolkit/group/coretoolkit.mmp
+../coretoolkit/rendervg10/group/huirendervg10.mmp
+
+../Client/src/alfclient.mmp
+../AlfDecoderServerClient/src/alfdecoderserverclient.mmp
+../ServerCore/Src/alfappservercore.mmp
+../ServerInterface/src/alfredserver.mmp
+../ServerStub/Proxy_src/alfappfwproxy.mmp
+../AlfCommandDebug/group/alfcommanddebug.mmp
+../AlfHintPlugin/group/AlfHintPlugin.mmp
+../AlfHintPlugin/group/AlfHintPluginDrawer.mmp
+
+../plugins/alftranseffect/alftranseffectplugin/group/alftranseffectplugin.mmp
+../plugins/alftranseffect/alftfxserverplugin/group/AlfTfxSrvPlugin.mmp
+../plugins/alftranseffect/alfgfxtransadapter/group/gfxtransenginetfx.mmp
+../plugins/alfoogmplugin/group/alfoogmplugin.mmp
+
+// background animation host+reference plugin
+../backgroundanim/group/bganimhost.mmp
+../backgroundanim/refplugin/group/refplugin.mmp
+
+#ifdef ALF_USE_SINGLE_RENDERSTAGE
+  #include "../closedrs/group/bld.inf"
+#else
+  ../AlfRenderStage/group/alfrenderstageplugin.mmp
+  #ifdef ALF_USE_OPENWF_COMPOSITION
+    #include "../plugins/openwfcrs/group/bld.inf"
+  #else
+    #include "../plugins/closedrs/group/bld.inf"
+  #endif
+#endif
+
+#ifdef VSW_IVE3_ENABLED
+// NCP specific plugins
+#include "../plugins/videopolicyoogmplugin/group/bld.inf"
+
+// waves plugin is not part of foundation content (differentiating SW)
+#include "../backgroundanim/wavesplugin/group/bld.inf"
+
+// yber hack, to be remover right after W02 build is out
+#ifndef FF_MEETING_REQUEST_UI
+#include "../plugins/mmfmediaclientplugin/group/bld.inf"
+#endif
+#endif
+
+PRJ_TESTMMPFILES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/group/core_exports.inc	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,216 @@
+/*
+* ============================================================================
+*  Name        : core_exports.inc
+*  Part of     : Alfred UI Toolkit
+*  Description : Exported header files.
+*  Version     : %version: tr1sido#8.1.24 %
+*
+*  Copyright © 2006-2007 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.
+* ============================================================================
+*/
+// Exported effect definition files
+
+PRJ_EXPORTS
+
+//
+//	READ THIS!!!
+//
+//  Please, when you add or remove fxml files.
+//	1.	update ALL THREE (3) lists. Keep the lists in alphabetical order. 
+//  2.  Remember also UPDATE ALFRED.IBY with the corresponding changes.
+
+
+// for EMULATOR UREL
+../coretoolkit/data/activeidle_viewswitch_add_page.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_add_page.fxml
+../coretoolkit/data/activeidle_viewswitch_close_editmode.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_close_editmode.fxml
+../coretoolkit/data/activeidle_viewswitch_close_widgetmanager.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_close_widgetmanager.fxml
+../coretoolkit/data/activeidle_viewswitch_left.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_left.fxml
+../coretoolkit/data/activeidle_viewswitch_open_editmode.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_open_editmode.fxml
+../coretoolkit/data/activeidle_viewswitch_open_widgetmanager.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_open_widgetmanager.fxml
+../coretoolkit/data/activeidle_viewswitch_remove_page.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_remove_page.fxml
+../coretoolkit/data/activeidle_viewswitch_right.fxml /epoc32/release/winscw/urel/z/resource/effects/activeidle_viewswitch_right.fxml
+../coretoolkit/data/app_activate.fxml /epoc32/release/winscw/urel/z/resource/effects/app_activate.fxml
+../coretoolkit/data/app_exit.fxml /epoc32/release/winscw/urel/z/resource/effects/app_exit.fxml
+../coretoolkit/data/app_start.fxml /epoc32/release/winscw/urel/z/resource/effects/app_start.fxml
+../coretoolkit/data/app_start_rect.fxml /epoc32/release/winscw/urel/z/resource/effects/app_start_rect.fxml
+../coretoolkit/data/app_start_switch.fxml /epoc32/release/winscw/urel/z/resource/effects/app_start_switch.fxml
+../coretoolkit/data/app_start_switch_rect.fxml /epoc32/release/winscw/urel/z/resource/effects/app_start_switch_rect.fxml
+../coretoolkit/data/appshell_exit.fxml /epoc32/release/winscw/urel/z/resource/effects/appshell_exit.fxml
+../coretoolkit/data/confirmationnote_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/confirmationnote_appear.fxml
+../coretoolkit/data/confirmationnote_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/confirmationnote_disappear.fxml
+../coretoolkit/data/dialer_close.fxml /epoc32/release/winscw/urel/z/resource/effects/dialer_close.fxml
+../coretoolkit/data/dialer_open.fxml /epoc32/release/winscw/urel/z/resource/effects/dialer_open.fxml
+../coretoolkit/data/discreet_popup_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/discreet_popup_appear.fxml
+../coretoolkit/data/discreet_popup_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/discreet_popup_disappear.fxml
+../coretoolkit/data/editingmenu_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/editingmenu_appear.fxml
+../coretoolkit/data/editingmenu_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/editingmenu_disappear.fxml
+../coretoolkit/data/errornote_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/errornote_appear.fxml
+../coretoolkit/data/errornote_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/errornote_disappear.fxml
+../coretoolkit/data/fade_effect.fxml /epoc32/release/winscw/urel/z/resource/effects/fade_effect.fxml
+../coretoolkit/data/folder_close.fxml /epoc32/release/winscw/urel/z/resource/effects/folder_close.fxml
+../coretoolkit/data/folder_open.fxml /epoc32/release/winscw/urel/z/resource/effects/folder_open.fxml
+../coretoolkit/data/informationnote_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/informationnote_appear.fxml
+../coretoolkit/data/informationnote_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/informationnote_disappear.fxml
+../coretoolkit/data/layoutswitch_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/layoutswitch_appear.fxml
+../coretoolkit/data/layoutswitch_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/layoutswitch_disappear.fxml
+../coretoolkit/data/musicplayer_popup_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/musicplayer_popup_appear.fxml
+../coretoolkit/data/musicplayer_popup_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/musicplayer_popup_disappear.fxml
+../coretoolkit/data/musicplayer_viewswitch_in.fxml /epoc32/release/winscw/urel/z/resource/effects/musicplayer_viewswitch_in.fxml
+../coretoolkit/data/musicplayer_viewswitch_out.fxml /epoc32/release/winscw/urel/z/resource/effects/musicplayer_viewswitch_out.fxml
+../coretoolkit/data/optionsmenu_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/optionsmenu_appear.fxml
+../coretoolkit/data/optionsmenu_cascade_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/optionsmenu_cascade_appear.fxml
+../coretoolkit/data/optionsmenu_cascade_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/optionsmenu_cascade_disappear.fxml
+../coretoolkit/data/optionsmenu_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/optionsmenu_disappear.fxml
+../coretoolkit/data/popup_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/popup_appear.fxml
+../coretoolkit/data/popup_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/popup_disappear.fxml
+../coretoolkit/data/popup_disappear_screenshot.fxml /epoc32/release/winscw/urel/z/resource/effects/popup_disappear_screenshot.fxml
+../coretoolkit/data/preview_popup_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/preview_popup_appear.fxml
+../coretoolkit/data/preview_popup_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/preview_popup_disappear.fxml
+../coretoolkit/data/screensaver_activate.fxml /epoc32/release/winscw/urel/z/resource/effects/screensaver_activate.fxml
+../coretoolkit/data/screensaver_deactivate.fxml /epoc32/release/winscw/urel/z/resource/effects/screensaver_deactivate.fxml
+../coretoolkit/data/systemnotify_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/systemnotify_appear.fxml
+../coretoolkit/data/systemnotify_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/systemnotify_disappear.fxml
+../coretoolkit/data/tab_effect.fxml /epoc32/release/winscw/urel/z/resource/effects/tab_effect.fxml
+../coretoolkit/data/taskswapper_app_start_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/taskswapper_app_start_disappear.fxml
+../coretoolkit/data/taskswapper_app_start_rect.fxml /epoc32/release/winscw/urel/z/resource/effects/taskswapper_app_start_rect.fxml
+../coretoolkit/data/taskswapper_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/taskswapper_appear.fxml
+../coretoolkit/data/taskswapper_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/taskswapper_disappear.fxml
+../coretoolkit/data/touchinput_close.fxml /epoc32/release/winscw/urel/z/resource/effects/touchinput_close.fxml
+../coretoolkit/data/touchinput_open.fxml /epoc32/release/winscw/urel/z/resource/effects/touchinput_open.fxml
+../coretoolkit/data/waitnote_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/waitnote_appear.fxml
+../coretoolkit/data/waitnote_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/waitnote_disappear.fxml
+../coretoolkit/data/warningnote_appear.fxml /epoc32/release/winscw/urel/z/resource/effects/warningnote_appear.fxml
+../coretoolkit/data/warningnote_disappear.fxml /epoc32/release/winscw/urel/z/resource/effects/warningnote_disappear.fxml
+
+// for EMULATOR UDEB
+../coretoolkit/data/activeidle_viewswitch_add_page.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_add_page.fxml
+../coretoolkit/data/activeidle_viewswitch_close_editmode.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_close_editmode.fxml
+../coretoolkit/data/activeidle_viewswitch_close_widgetmanager.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_close_widgetmanager.fxml
+../coretoolkit/data/activeidle_viewswitch_left.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_left.fxml
+../coretoolkit/data/activeidle_viewswitch_open_editmode.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_open_editmode.fxml
+../coretoolkit/data/activeidle_viewswitch_open_widgetmanager.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_open_widgetmanager.fxml
+../coretoolkit/data/activeidle_viewswitch_remove_page.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_remove_page.fxml
+../coretoolkit/data/activeidle_viewswitch_right.fxml /epoc32/release/winscw/udeb/z/resource/effects/activeidle_viewswitch_right.fxml
+../coretoolkit/data/app_activate.fxml /epoc32/release/winscw/udeb/z/resource/effects/app_activate.fxml
+../coretoolkit/data/app_exit.fxml /epoc32/release/winscw/udeb/z/resource/effects/app_exit.fxml
+../coretoolkit/data/app_start.fxml /epoc32/release/winscw/udeb/z/resource/effects/app_start.fxml
+../coretoolkit/data/app_start_rect.fxml /epoc32/release/winscw/udeb/z/resource/effects/app_start_rect.fxml
+../coretoolkit/data/app_start_switch.fxml /epoc32/release/winscw/udeb/z/resource/effects/app_start_switch.fxml
+../coretoolkit/data/app_start_switch_rect.fxml /epoc32/release/winscw/udeb/z/resource/effects/app_start_switch_rect.fxml
+../coretoolkit/data/appshell_exit.fxml /epoc32/release/winscw/udeb/z/resource/effects/appshell_exit.fxml
+../coretoolkit/data/confirmationnote_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/confirmationnote_appear.fxml
+../coretoolkit/data/confirmationnote_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/confirmationnote_disappear.fxml
+../coretoolkit/data/dialer_close.fxml /epoc32/release/winscw/udeb/z/resource/effects/dialer_close.fxml
+../coretoolkit/data/dialer_open.fxml /epoc32/release/winscw/udeb/z/resource/effects/dialer_open.fxml
+../coretoolkit/data/discreet_popup_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/discreet_popup_appear.fxml
+../coretoolkit/data/discreet_popup_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/discreet_popup_disappear.fxml
+../coretoolkit/data/editingmenu_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/editingmenu_appear.fxml
+../coretoolkit/data/editingmenu_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/editingmenu_disappear.fxml
+../coretoolkit/data/errornote_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/errornote_appear.fxml
+../coretoolkit/data/errornote_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/errornote_disappear.fxml
+../coretoolkit/data/fade_effect.fxml /epoc32/release/winscw/udeb/z/resource/effects/fade_effect.fxml
+../coretoolkit/data/folder_close.fxml /epoc32/release/winscw/udeb/z/resource/effects/folder_close.fxml
+../coretoolkit/data/folder_open.fxml /epoc32/release/winscw/udeb/z/resource/effects/folder_open.fxml
+../coretoolkit/data/informationnote_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/informationnote_appear.fxml
+../coretoolkit/data/informationnote_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/informationnote_disappear.fxml
+../coretoolkit/data/layoutswitch_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/layoutswitch_appear.fxml
+../coretoolkit/data/layoutswitch_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/layoutswitch_disappear.fxml
+../coretoolkit/data/musicplayer_popup_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/musicplayer_popup_appear.fxml
+../coretoolkit/data/musicplayer_popup_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/musicplayer_popup_disappear.fxml
+../coretoolkit/data/musicplayer_viewswitch_in.fxml /epoc32/release/winscw/udeb/z/resource/effects/musicplayer_viewswitch_in.fxml
+../coretoolkit/data/musicplayer_viewswitch_out.fxml /epoc32/release/winscw/udeb/z/resource/effects/musicplayer_viewswitch_out.fxml
+../coretoolkit/data/optionsmenu_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/optionsmenu_appear.fxml
+../coretoolkit/data/optionsmenu_cascade_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/optionsmenu_cascade_appear.fxml
+../coretoolkit/data/optionsmenu_cascade_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/optionsmenu_cascade_disappear.fxml
+../coretoolkit/data/optionsmenu_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/optionsmenu_disappear.fxml
+../coretoolkit/data/popup_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/popup_appear.fxml
+../coretoolkit/data/popup_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/popup_disappear.fxml
+../coretoolkit/data/popup_disappear_screenshot.fxml /epoc32/release/winscw/udeb/z/resource/effects/popup_disappear_screenshot.fxml
+../coretoolkit/data/preview_popup_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/preview_popup_appear.fxml
+../coretoolkit/data/preview_popup_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/preview_popup_disappear.fxml
+../coretoolkit/data/screensaver_activate.fxml /epoc32/release/winscw/udeb/z/resource/effects/screensaver_activate.fxml
+../coretoolkit/data/screensaver_deactivate.fxml /epoc32/release/winscw/udeb/z/resource/effects/screensaver_deactivate.fxml
+../coretoolkit/data/systemnotify_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/systemnotify_appear.fxml
+../coretoolkit/data/systemnotify_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/systemnotify_disappear.fxml
+../coretoolkit/data/tab_effect.fxml /epoc32/release/winscw/udeb/z/resource/effects/tab_effect.fxml
+../coretoolkit/data/taskswapper_app_start_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/taskswapper_app_start_disappear.fxml
+../coretoolkit/data/taskswapper_app_start_rect.fxml /epoc32/release/winscw/udeb/z/resource/effects/taskswapper_app_start_rect.fxml
+../coretoolkit/data/taskswapper_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/taskswapper_appear.fxml
+../coretoolkit/data/taskswapper_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/taskswapper_disappear.fxml
+../coretoolkit/data/touchinput_close.fxml /epoc32/release/winscw/udeb/z/resource/effects/touchinput_close.fxml
+../coretoolkit/data/touchinput_open.fxml /epoc32/release/winscw/udeb/z/resource/effects/touchinput_open.fxml
+../coretoolkit/data/waitnote_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/waitnote_appear.fxml
+../coretoolkit/data/waitnote_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/waitnote_disappear.fxml
+../coretoolkit/data/warningnote_appear.fxml /epoc32/release/winscw/udeb/z/resource/effects/warningnote_appear.fxml
+../coretoolkit/data/warningnote_disappear.fxml /epoc32/release/winscw/udeb/z/resource/effects/warningnote_disappear.fxml
+
+// For ROM
+../coretoolkit/data/activeidle_viewswitch_add_page.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_add_page.fxml
+../coretoolkit/data/activeidle_viewswitch_close_editmode.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_close_editmode.fxml
+../coretoolkit/data/activeidle_viewswitch_close_widgetmanager.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_close_widgetmanager.fxml
+../coretoolkit/data/activeidle_viewswitch_left.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_left.fxml
+../coretoolkit/data/activeidle_viewswitch_open_editmode.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_open_editmode.fxml
+../coretoolkit/data/activeidle_viewswitch_open_widgetmanager.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_open_widgetmanager.fxml
+../coretoolkit/data/activeidle_viewswitch_remove_page.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_remove_page.fxml
+../coretoolkit/data/activeidle_viewswitch_right.fxml /epoc32/data/z/resource/effects/activeidle_viewswitch_right.fxml
+../coretoolkit/data/app_activate.fxml /epoc32/data/z/resource/effects/app_activate.fxml
+../coretoolkit/data/app_exit.fxml /epoc32/data/z/resource/effects/app_exit.fxml
+../coretoolkit/data/app_start.fxml /epoc32/data/z/resource/effects/app_start.fxml
+../coretoolkit/data/app_start_rect.fxml /epoc32/data/z/resource/effects/app_start_rect.fxml
+../coretoolkit/data/app_start_switch.fxml /epoc32/data/z/resource/effects/app_start_switch.fxml
+../coretoolkit/data/app_start_switch_rect.fxml /epoc32/data/z/resource/effects/app_start_switch_rect.fxml
+../coretoolkit/data/appshell_exit.fxml /epoc32/data/z/resource/effects/effects/appshell_exit.fxml
+../coretoolkit/data/confirmationnote_appear.fxml /epoc32/data/z/resource/effects/confirmationnote_appear.fxml
+../coretoolkit/data/confirmationnote_disappear.fxml /epoc32/data/z/resource/effects/confirmationnote_disappear.fxml
+../coretoolkit/data/dialer_close.fxml /epoc32/data/z/resource/effects/dialer_close.fxml
+../coretoolkit/data/dialer_open.fxml /epoc32/data/z/resource/effects/dialer_open.fxml
+../coretoolkit/data/discreet_popup_appear.fxml /epoc32/data/z/resource/effects/discreet_popup_appear.fxml
+../coretoolkit/data/discreet_popup_disappear.fxml /epoc32/data/z/resource/effects/discreet_popup_disappear.fxml
+../coretoolkit/data/editingmenu_appear.fxml /epoc32/data/z/resource/effects/editingmenu_appear.fxml
+../coretoolkit/data/editingmenu_disappear.fxml /epoc32/data/z/resource/effects/editingmenu_disappear.fxml
+../coretoolkit/data/errornote_appear.fxml /epoc32/data/z/resource/effects/errornote_appear.fxml
+../coretoolkit/data/errornote_disappear.fxml /epoc32/data/z/resource/effects/errornote_disappear.fxml
+../coretoolkit/data/fade_effect.fxml /epoc32/data/z/resource/effects/fade_effect.fxml
+../coretoolkit/data/folder_close.fxml /epoc32/data/z/resource/effects/folder_close.fxml
+../coretoolkit/data/folder_open.fxml /epoc32/data/z/resource/effects/folder_open.fxml
+../coretoolkit/data/informationnote_appear.fxml /epoc32/data/z/resource/effects/informationnote_appear.fxml
+../coretoolkit/data/informationnote_disappear.fxml /epoc32/data/z/resource/effects/informationnote_disappear.fxml
+../coretoolkit/data/layoutswitch_appear.fxml /epoc32/data/z/resource/effects/layoutswitch_appear.fxml
+../coretoolkit/data/layoutswitch_disappear.fxml /epoc32/data/z/resource/effects/layoutswitch_disappear.fxml
+../coretoolkit/data/musicplayer_popup_appear.fxml /epoc32/data/z/resource/effects/musicplayer_popup_appear.fxml
+../coretoolkit/data/musicplayer_popup_disappear.fxml /epoc32/data/z/resource/effects/musicplayer_popup_disappear.fxml
+../coretoolkit/data/musicplayer_viewswitch_in.fxml /epoc32/data/z/resource/effects/musicplayer_viewswitch_in.fxml
+../coretoolkit/data/musicplayer_viewswitch_out.fxml /epoc32/data/z/resource/effects/musicplayer_viewswitch_out.fxml
+../coretoolkit/data/optionsmenu_appear.fxml /epoc32/data/z/resource/effects/optionsmenu_appear.fxml
+../coretoolkit/data/optionsmenu_cascade_appear.fxml /epoc32/data/z/resource/effects/optionsmenu_cascade_appear.fxml
+../coretoolkit/data/optionsmenu_cascade_disappear.fxml /epoc32/data/z/resource/effects/optionsmenu_cascade_disappear.fxml
+../coretoolkit/data/optionsmenu_disappear.fxml /epoc32/data/z/resource/effects/optionsmenu_disappear.fxml
+../coretoolkit/data/popup_appear.fxml /epoc32/data/z/resource/effects/popup_appear.fxml
+../coretoolkit/data/popup_disappear.fxml /epoc32/data/z/resource/effects/popup_disappear.fxml
+../coretoolkit/data/popup_disappear_screenshot.fxml /epoc32/data/z/resource/effects/popup_disappear_screenshot.fxml
+../coretoolkit/data/preview_popup_appear.fxml /epoc32/data/z/resource/effects/preview_popup_appear.fxml
+../coretoolkit/data/preview_popup_disappear.fxml /epoc32/data/z/resource/effects/preview_popup_disappear.fxml
+../coretoolkit/data/screensaver_activate.fxml /epoc32/data/z/resource/effects/screensaver_activate.fxml
+../coretoolkit/data/screensaver_deactivate.fxml /epoc32/data/z/resource/effects/screensaver_deactivate.fxml
+../coretoolkit/data/systemnotify_appear.fxml /epoc32/data/z/resource/effects/systemnotify_appear.fxml
+../coretoolkit/data/systemnotify_disappear.fxml /epoc32/data/z/resource/effects/systemnotify_disappear.fxml
+../coretoolkit/data/tab_effect.fxml /epoc32/data/z/resource/effects/tab_effect.fxml
+../coretoolkit/data/taskswapper_app_start_disappear.fxml /epoc32/data/z/resource/effects/taskswapper_app_start_disappear.fxml
+../coretoolkit/data/taskswapper_app_start_rect.fxml /epoc32/data/z/resource/effects/taskswapper_app_start_rect.fxml
+../coretoolkit/data/taskswapper_appear.fxml /epoc32/data/z/resource/effects/taskswapper_appear.fxml
+../coretoolkit/data/taskswapper_disappear.fxml /epoc32/data/z/resource/effects/taskswapper_disappear.fxml
+../coretoolkit/data/touchinput_close.fxml /epoc32/data/z/resource/effects/touchinput_close.fxml
+../coretoolkit/data/touchinput_open.fxml /epoc32/data/z/resource/effects/touchinput_open.fxml
+../coretoolkit/data/waitnote_appear.fxml /epoc32/data/z/resource/effects/waitnote_appear.fxml
+../coretoolkit/data/waitnote_disappear.fxml /epoc32/data/z/resource/effects/waitnote_disappear.fxml
+../coretoolkit/data/warningnote_appear.fxml /epoc32/data/z/resource/effects/warningnote_appear.fxml
+../coretoolkit/data/warningnote_disappear.fxml /epoc32/data/z/resource/effects/warningnote_disappear.fxml
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alfoogmplugin/group/alfoogmplugin.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* 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:  This is the .mmp for building ALFServer Oogm Plugin
+*         			for the complementary transitions feature.
+*
+*/
+
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+
+TARGET      alfoogmplugin.dll
+TARGETTYPE  PLUGIN
+UID			0x10009d8d 0xE4B6C988
+
+CAPABILITY  CAP_ECOM_PLUGIN 
+VENDORID    VID_DEFAULT
+
+
+// This is a SYSTEMINCLUDE macro containing the middleware
+// layer specific include directories
+MW_LAYER_SYSTEMINCLUDE
+
+USERINCLUDE .
+USERINCLUDE ../inc
+
+TARGETPATH  /sys/bin  
+SOURCEPATH  ../src
+SOURCE      alfoogmplugin.cpp
+
+START RESOURCE alfoogmplugin.rss
+TARGET         alfoogmplugin.rsc
+END
+
+
+LIBRARY 	ecom.lib
+LIBRARY   euser.lib
+LIBRARY   goommonitor.lib
+LIBRARY   alfclient.lib
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alfoogmplugin/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,27 @@
+/*
+* 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:  build information file for the AlfOogmplugin
+*
+*/
+
+#include <platform_paths.hrh>
+PRJ_PLATFORMS 
+ARMV5 WINSCW
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+alfoogmplugin.mmp 
+
+//  End of File  
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alfoogmplugin/src/alfoogmplugin.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,118 @@
+/*
+* 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:  OOM plugin for ALFserver.
+*
+*/
+
+#include <ecom/ecom.h>
+#include <ecom/implementationproxy.h>
+#include <goommonitorplugin.h>
+#include <w32std.h>
+
+#include <alf/alfdirectclient.h>
+
+class CAlfOogmMonitorPlugin : public CGOomMonitorPlugin
+    {
+public:
+    CAlfOogmMonitorPlugin();
+    ~CAlfOogmMonitorPlugin();
+    void ConstructL();
+
+public:
+    void FreeRam(TInt aBytesToFree);
+    void MemoryGood();
+
+private:
+    RAlfDirectClient iAlfDirectClient;
+    };
+
+// -----------------------------------------------------------------------------
+// C++ constructor.
+// -----------------------------------------------------------------------------
+//
+CAlfOogmMonitorPlugin::CAlfOogmMonitorPlugin()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// Destructor.
+// -----------------------------------------------------------------------------
+//
+CAlfOogmMonitorPlugin::~CAlfOogmMonitorPlugin()
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
+// Symbian two-phased constructor (2nd phase).
+// -----------------------------------------------------------------------------
+//
+void CAlfOogmMonitorPlugin::ConstructL()
+    {
+    CGOomMonitorPluginBase::ConstructL();
+    }
+
+
+// -----------------------------------------------------------------------------
+// Tries to free RAM.
+// -----------------------------------------------------------------------------
+//
+void CAlfOogmMonitorPlugin::FreeRam(TInt aBytesToFree)
+    {
+ 	iAlfDirectClient.EnableLowMemoryState(aBytesToFree);
+    }
+
+// -----------------------------------------------------------------------------
+// CAlfOogmMonitorPlugin::MemoryGood
+// -----------------------------------------------------------------------------
+//
+void CAlfOogmMonitorPlugin::MemoryGood()
+    {
+    iAlfDirectClient.EnableLowMemoryState(EFalse);	
+    }
+
+// -----------------------------------------------------------------------------
+// Creates plugin.
+// -----------------------------------------------------------------------------
+//
+TAny* CreatePlugin()
+    {
+    CAlfOogmMonitorPlugin* plugin = new(ELeave) CAlfOogmMonitorPlugin;
+    CleanupStack::PushL(plugin);
+    plugin->ConstructL();
+    CleanupStack::Pop(plugin);
+    return plugin;
+    }
+
+// -----------------------------------------------------------------------------
+// Implementation table for plugin.
+// -----------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] =
+    {
+    {{0xE4B6C988}, ::CreatePlugin}
+    };
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy) ;
+    return ImplementationTable;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alfoogmplugin/src/alfoogmplugin.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,51 @@
+/*
+* 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:  ECOM Resource file for ALF OOGM Framework Plugin
+*
+*/
+
+#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 = 0xE4B6C988;
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = KGOomPluginInterfaceUidValue;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0xE4B6C988;
+                    version_no = 1;
+                    display_name = "AlfOogmPlugin";
+                    default_data = "";
+                    opaque_data = "";
+                    }
+                };
+                        
+            }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alfgfxtransadapter/bwins/GFXTRANSADAPTERU.DEF	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	?CreateL@MGfxTransAdapter@@SAPAV1@PAVMGfxTransClient@@@Z @ 1 NONAME ; class MGfxTransAdapter * MGfxTransAdapter::CreateL(class MGfxTransClient *)
+	?Destroy@MGfxTransAdapter@@SAXPAV1@@Z @ 2 NONAME ; void MGfxTransAdapter::Destroy(class MGfxTransAdapter *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alfgfxtransadapter/eabi/GfxTransAdapterU.def	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,4 @@
+EXPORTS
+	_ZN16MGfxTransAdapter7CreateLEP15MGfxTransClient @ 1 NONAME
+	_ZN16MGfxTransAdapter7DestroyEPS_ @ 2 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alfgfxtransadapter/group/gfxtransenginetfx.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project gfxtransengine.dll
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+#include <platform_paths.hrh>
+
+
+TARGET        gfxtransadapter.dll
+TARGETTYPE    dll
+//UID           0x10281F90
+UID    			0x1000008D 0x102822A5
+TARGETPATH    /sys/bin
+
+CAPABILITY	All -Tcb
+	
+MW_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE   /epoc32/include/graphics
+SYSTEMINCLUDE 	/epoc32/include/gfxtranseffect
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   ../../../../CommonInc
+SYSTEMINCLUDE   ../../alftranseffectplugin/inc
+SYSTEMINCLUDE   ../../alftfxserverplugin/inc
+
+USERINCLUDE	  ../inc
+USERINCLUDE   ../../../../CommonInc
+USERINCLUDE   ../../alftranseffectplugin/inc
+USERINCLUDE   ../../alftfxserverplugin/inc
+
+SOURCEPATH ../src
+SOURCE 	gfxtransenginetfx.cpp
+
+LIBRARY	euser.lib
+LIBRARY estor.lib
+LIBRARY cone.lib
+LIBRARY alfdecoderserverclient.lib
+LIBRARY ecom.lib
+LIBRARY centralrepository.lib
+LIBRARY ws32.lib
+
+LIBRARY flogger.lib
+
+LIBRARY gfxtrans.lib
+LIBRARY eikcore.lib
+
+NOSTRICTDEF
+#if defined(WINSCW)
+deffile ../bwins/GFXTRANSADAPTERU.DEF
+#else
+deffile ../eabi/GfxTransAdapterU.def
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alfgfxtransadapter/inc/debug.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* 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: 
+*
+*/
+#ifndef DEBUG_H
+#define DEBUG_H
+
+#include <e32debug.h>
+
+#ifdef _DEBUG //No debugging unless in Debug mode...
+	//#define DEBUG_ON_TARGET //define to get debug output also on target.
+	#ifdef __WINS__
+		//This is the config on emulator.
+		//#define DEBUG_PRINTS 
+		//#define DEBUGPRINTS_AS_FLOG
+
+	#elif defined(DEBUG_ON_TARGET)
+		//This is the config for target, when debuging on target is on.
+		#define DEBUG_PRINTS
+		//#define DEBUGPRINTS_AS_FLOG
+
+	#endif
+#endif
+//#define FLOG_PRINTS //This can be used to use FLOGs without support for DEBUG_PRINTS.. probably not useful...
+
+
+
+#if defined(FLOG_PRINTS) || defined(DEBUGPRINTS_AS_FLOG)
+
+	#include <flogger.h>
+	_LIT(KLogFile, "TfxServerLog.txt");
+	_LIT(KLogDir, "tatgfxtest");
+
+	#define FLOG(x) RFileLogger::Write(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x))
+	#define FLOG1(x,a1) RFileLogger::WriteFormat(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x),a1)
+	#define FLOG2(x,a1,a2) RFileLogger::WriteFormat(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x),a1,a2)
+	#define FLOG3(x,a1,a2,a3) RFileLogger::WriteFormat(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x),a1,a2,a3)
+	#define FLOG4(x,a1,a2,a3,a4) RFileLogger::WriteFormat(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x),a1,a2,a3,a4)
+	#define FLOG5(x,a1,a2,a3,a4,a5) RFileLogger::WriteFormat(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x),a1,a2,a3,a4,a5)
+
+#else
+
+	#define FLOG(x)
+	#define FLOG1(x,a1)
+	#define FLOG2(x,a1,a2)
+	#define FLOG3(x,a1,a2,a3)
+	#define FLOG4(x,a1,a2,a3,a4) 
+	#define FLOG5(x,a1,a2,a3,a4,a5) 
+
+#endif
+
+#if defined(DEBUG_PRINTS) && !defined(DEBUGPRINTS_AS_FLOG)
+	// Prints via RDebug
+	#define DEBUG_PRINT(x) RDebug::Printf("TFX:  "##x)
+	#define DEBUG_PRINT1(x, a1) RDebug::Printf("TFX:  "##x, a1)
+	#define DEBUG_PRINT2(x, a1, a2) RDebug::Printf("TFX:  "##x, a1, a2)
+	#define DEBUG_PRINT3(x, a1, a2, a3) RDebug::Printf("TFX:  "##x, a1, a2, a3)
+	#define DEBUG_PRINT4(x, a1, a2, a3, a4) RDebug::Printf("TFX:  "##x, a1, a2, a3, a4)
+	#define DEBUG_PRINT5(x, a1, a2, a3, a4, a5) RDebug::Printf("TFX:  "##x, a1, a2, a3, a4, a5)
+
+#elif defined(DEBUGPRINTS_AS_FLOG)
+	// Prints via flogger
+	#define DEBUG_PRINT(x) FLOG(x)
+	#define DEBUG_PRINT1(x, a1) FLOG1(x, a1)
+	#define DEBUG_PRINT2(x, a1, a2) FLOG2(x, a1, a2)
+	#define DEBUG_PRINT3(x, a1, a2, a3) FLOG3(x, a1, a2, a3)
+	#define DEBUG_PRINT4(x, a1, a2, a3, a4) FLOG4(x, a1, a2, a3, a4)
+	#define DEBUG_PRINT5(x, a1, a2, a3, a4, a5) FLOG5(x, a1, a2, a3, a4, a5)
+
+#else 
+	/*lint -e960 */
+	// No prints
+	#define DEBUG_PRINT(x) 
+	#define DEBUG_PRINT1(x, a1) 
+	#define DEBUG_PRINT2(x, a1, a2) 
+	#define DEBUG_PRINT3(x, a1, a2, a3) 
+	#define DEBUG_PRINT4(x, a1, a2, a3, a4) 
+	#define DEBUG_PRINT5(x, a1, a2, a3, a4, a5)
+	/*lint +e960 */
+	
+#endif // DEBUG_PRINTS
+
+#endif // DEBUG_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alfgfxtransadapter/inc/gfxtransenginetfx.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,335 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Adapter to the GfxTransEffect client. This is the entry point into
+*                the Nokia specific parts of the KML transition sollution, from the
+*                GfxTransEffect client. 
+*
+*/
+
+
+
+#ifndef _GFXTRANSENGINESTUB_H_
+#define _GFXTRANSENGINESTUB_H_
+
+#include <e32base.h>
+
+#include <gfxtranseffect/gfxtransadapter.h>
+#include <alfdecoderserverclient.h>
+#include <alf/AlfTransEffectPlugin.h>
+#include <alftfxserverobserver.h>
+
+class CWsTransControlGraphic;
+class CWsAdapterGraphic;
+//class CTransControlDrawerInfo;
+class CSubWOControl;
+class CAlfTransitionRequest;
+
+/**
+ *  gfxtranseffect engine adapter
+ *
+ *  This class is loaded by the GfxTransEffect client and used by it to request 
+ *  transition effects.
+ *
+ *  @since S60 3.2
+ */
+ NONSHARABLE_CLASS(CGfxTransAdapterTfx) : public CBase, 
+										 public MGfxTransAdapter,
+										 public MTfxServerObserver
+	{
+	friend class MGfxTransAdapter;
+private:
+
+	/**
+	 * constructor
+     * 
+     * @since S60 3.2
+     *
+     * @param aClient the GfxTrans client side.
+    */  
+	CGfxTransAdapterTfx(MGfxTransClient* aClient);
+
+	/**
+	 * default destructor
+     * 
+     * @since S60 3.2
+     *
+    */  
+	~CGfxTransAdapterTfx();
+public:
+
+	/**
+	 * 2nd phase constructor
+     * 
+     * @since S60 3.2
+     *
+    */  
+	void ConstructL();
+
+	/**
+	 * From MGfxTransEngine
+	 * 
+	 * Notifies the adaptor of the different states its in while collecting data for a transition.
+     * 
+     * @since S60 3.2
+     *
+     * @param aState the state the client is currently in
+     * @param aKey the control that is now processed
+     * @param aHandle the handle for this transition.
+     * @return KErrNone if successful, any other error code if the client should abort.
+    */  
+	TInt HandleClientState(TClientState aState, const CCoeControl* aKey, TInt aHandle);
+
+	/**
+	 * From MGfxTransEngine
+     *
+     * Tests if adapter is active (trying to make it active if needed).
+     * @since S60 3.2
+     *
+     * @return ETrue if active, otherwise EFalse.
+    */  
+	TBool IsActive();
+
+	/**
+	 * From MGfxTransEngine
+     *
+     * Called by client to start the specific transition
+     * @since S60 3.2
+     *
+     * @param aHandle the handle of the transition to start.
+    */  
+	void StartTransition(TInt aHandle);
+
+	/**
+	 * From MGfxTransEngine
+     *
+     * Starts the policy-request system between client and server.
+     *
+     * @since S60 3.2
+     *
+     * @param aCount. Reference where the number of available policies will be returned.
+     * @return Pointer to a TControlPolicy array or NULL.
+    */  
+	TControlPolicy* GetTransitionPolicies(TInt &aCount);
+
+	/**
+	 * From MGfxTransEngine
+     * 
+     * Starts a fullscreen effect
+     * 
+     * @since S60 3.2
+     *
+     * @param aAction the fullscreen transition action number
+     * @param aEffectArea an optional rectangle the fs effect can use
+    */  
+	void BeginFullScreen(TUint aAction, const TRect &aEffectArea);
+
+	/**
+	 * From MGfxTransEngine
+     * 
+     * Starts a fullscreen effect, extended version
+     *
+     * @since S60 3.2
+     *
+     * @param aAction the fullscreen transition action number
+     * @param aEffectArea an optional rectangle the fs effect can use
+     * @param aType an integer identifying the format of aParams
+     * @param aParams a buffer to be interpreted by the TfxServer containing more information
+    */  
+	void BeginFullScreen(TUint aAction, const TRect &aEffectArea, 
+						 TUint aType, const TDesC8& aParams);
+
+	/**
+	 * From MGfxTransEngine
+	 *
+	 * Sends an EndFullscreen notification
+     * 
+     * @since S60 3.2
+     *
+    */  
+	void EndFullScreen();
+
+	/**
+	 * From MGfxTransEngine
+	 *
+	 * Tells TfxServer to abort the current fullscreen effect, if any is ongoing.
+     * 
+     * @since S60 3.2
+     *
+    */  
+	void AbortFullScreen();
+
+	/**
+	 * From MGfxTransEngine
+	 *
+	 * Handles updates of participants, during the transition
+     * 
+     * @since S60 3.2
+    */  
+	void HandleParticpantUpdate(TInt aHandle, 
+								const CParticipantData* aParticipant, 
+								RWsGraphicMsgBuf* aCommandBuffer, 
+								const TRect& aDrawRect, 
+								const TRect& aBoundingRect);
+								
+	/**
+	 * From MGfxTransEngine
+	 *
+	 * Not used.
+     * 
+     * @since S60 3.2
+    */  
+	void NotifyExternalState(TInt aState, const TDesC8* aArg);
+
+	/**
+	 * From MTfxServerObserver
+	 *
+     * Called when a policy update request has completed.
+     * @param aPolicy a new control policy
+    */  
+	void PolicyUpdate(TControlPolicy* aPolicy);
+	
+	/**
+	 * From MTfxServerObserver
+	 *
+     * Called when all policies needs to be cleared.
+    */  
+	void ClearAllPolicies();
+
+	/**
+	 * From MTfxServerObserver
+	 *
+     * called when a transitionfinished notification request has completed
+     * @param aHandle the handle of the transition that finished.
+    */  
+//	void TransitionFinished(TInt aHandle );
+
+    /*
+    *
+    */
+    void GetNewPoliciesL( TUint aCount );
+    
+    /*
+    *
+    */
+    void CancelPolicyUpdates();
+    
+    void SendGroupCommand(TInt aGroupId, TBool aGroupFinished);
+    /**
+    * Send the policy update request to effect plugin
+    */
+    TInt RequestPolicyUpdates();
+
+private:
+
+	/**
+     * Starts the transition
+     * 
+     * @since S60 3.2
+     *
+     * @param aHandle handle of the transition to start
+     * @param aTransData the transition specification collected by the client
+    */  
+	void DoStartTransitionL(TInt aHandle, const CTransitionData* aTransData);
+
+    /*
+     * Generate start transition from begin capture in case of contol exit transition
+     */
+	void GenerateTransitionL( const CCoeControl* aKey, const CTransitionData* aTransData);
+	
+	/*
+	 * Connect to server and load plugin
+	 */
+	void ConnectToServer();
+	
+	/**
+	 * Finds a component transition handler crp
+     * 
+     * @since S60 3.2
+     *
+     * @param aHandle the transition handle to find the crp for.
+     * @return a pointer to the crp
+    */  
+//    CWsTransControlGraphic* FindDrawer(TInt aHandle);
+
+    /**
+    * Finds a component transition
+     *
+     * @since S60 3.2
+     *
+     * @param aHandle the transition handle to find the control for.
+     * @return a pointer to the CTransControlDrawerInfo
+    */
+//    CTransControlDrawerInfo* FindControl(TInt aHandle);
+    void SubConEnd(const CCoeControl* aControl);
+    void SubConBegin(const CCoeControl* aControl);
+    void SubConAbort( const CCoeControl* aControl );
+    
+    
+private: // data
+    /**
+     * pointer to the client side
+     * Not owned.
+     */
+	MGfxTransClient* iClient;
+	
+	/**
+	 * A connection to the tfx server
+	 */
+	//RTfxServer iTfxServer;
+	
+	RAlfTfxClient iTfxServer;
+	
+	// We need plugin implementation id to send to RAlfTfxClient,
+	// we need to do the resolution from interface uid to implementation uid ourselves,
+	// alf does not do any resolution
+	TUid iPluginImplementation;
+	TBool iConnected;
+	TBool iHasPlugin;
+	
+    // The value in central repository to keep track if effects are allowed
+    TInt iEffectValue;
+
+	/**
+	 * Each currently active transition has an entry in this array.
+	 * It owns the pointers in it.
+	 */
+//	RPointerArray<CTransControlDrawerInfo> iControlInfo;
+
+    TInt iCurrHandle;
+
+//	TBool iIsWO;
+
+	TThreadId iClientId;
+
+	HBufC8* iTransferBuffer;
+	HBufC8* iReturnBuffer;
+	HBufC8* iAsyncTransferBuffer;
+	HBufC8* iAsyncReturnBuffer;
+
+	CAlfTransitionRequest* iPolicyReq;
+
+//	CCoeEnv* iCoeEnv;
+	///
+//	TUint iActiveAction;
+//	TUid  iActiveUid;
+//	TInt iSubCons;
+//	TInt iCurrZ;
+	const CCoeControl* iMainControl;
+//	RPointerArray<CSubWOControl> iSubWOControls;
+//    RPointerArray<const CCoeControl> iIgnoredWOChildControls;
+
+//    TInt iSequence;
+    };
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alfgfxtransadapter/src/gfxtransenginetfx.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1440 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Adapter to the GfxTransEffect client. This is the entry point into
+*                the Nokia specific parts of the KML transition sollution, from the
+*                GfxTransEffect client. 
+*
+*/
+
+
+
+#include <s32mem.h> //RMemReadStream
+#include <coecntrl.h>
+#include <ecom.h>
+
+#include <akntranseffect.h>
+#include <akntransitionutils.h>
+#include <avkondomainpskeys.h>
+#include <centralrepository.h>
+#include <aknlistboxtfxinternal.h> // list box types
+#include <eikenv.h>
+#include <eikappui.h>
+#include <eikapp.h>
+#include <eiksrvs.h>
+
+#include "gfxtransenginetfx.h"
+#include "e32property.h"
+//#include "wstranscontrolgraphic.h"
+//#include "wsadaptergraphic.h"
+
+//#include "tfxserverdef.h"
+//#include "subwocon.h"
+
+#include <gfxtranseffect/gfxtranseffect.h>
+
+#include <alfdecoderserverclient.h>
+#include <alf/AlfTransEffectPlugin.h>
+#include <alflogger.h>
+
+//maximum number of ongoing component effects
+//No restrictions at the moment. Anything goes.
+//const TInt KMaxOngoing = 10;
+
+enum TNoteSequenceState
+    {
+    ENoSequence = 0,
+    EFirst = 1,
+    EMid = 2,
+    ELast = 3
+    };
+
+// ======== LOCAL CLASS ========
+
+NONSHARABLE_CLASS(CTransControlDrawerInfo) : public CBase
+	{
+	CTransControlDrawerInfo(TInt aHandle);
+public:
+	static CTransControlDrawerInfo* NewL(TInt aHandle, TRect& aRect);
+	~CTransControlDrawerInfo();
+	inline TInt Handle();
+	inline CWsTransControlGraphic* Drawer();
+	void DeleteDrawer();
+	void SetHasWOParticipants(TBool aHasWOParticipant);
+	TBool HasWOParticipants();
+private:
+	TInt iHandle;
+	TBool iHasWOParticipant;
+//	CWsTransControlGraphic* iDrawer;
+	};
+
+CTransControlDrawerInfo::CTransControlDrawerInfo(TInt aHandle) :
+	iHandle(aHandle)
+	{
+	}
+
+CTransControlDrawerInfo* CTransControlDrawerInfo::NewL(TInt aHandle, TRect& /*aRect*/)
+	{
+	RThread t; //To get id of current thread to use as client handle.
+	CTransControlDrawerInfo* self = new (ELeave) CTransControlDrawerInfo(aHandle);
+	CleanupStack::PushL(self);
+//	self->iDrawer = CWsTransControlGraphic::NewL(aRect, aHandle, t.Id());
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+void CTransControlDrawerInfo::SetHasWOParticipants(TBool aHasWOParticipant)
+	{
+	iHasWOParticipant = aHasWOParticipant;
+	}
+
+TBool CTransControlDrawerInfo::HasWOParticipants()
+	{
+	return iHasWOParticipant;
+	}
+
+CTransControlDrawerInfo::~CTransControlDrawerInfo()
+	{
+//	delete iDrawer;
+	}
+
+void CTransControlDrawerInfo::DeleteDrawer()
+	{
+//	delete iDrawer;
+//	iDrawer = NULL;
+	}
+
+//Inline functions kept here, since they are only used within this file
+
+inline TInt CTransControlDrawerInfo::Handle()
+	{
+	return iHandle;
+	}
+
+/*
+inline CWsTransControlGraphic* CTransControlDrawerInfo::Drawer()
+	{
+	return iDrawer;
+	}
+*/	
+
+/**
+ * Helper class, handles requests to the transition plugin
+ */
+NONSHARABLE_CLASS(CAlfTransitionRequest): public CActive
+{
+public:
+	enum TType 
+		{
+		ETransFinish,
+		EPolicyUpdate
+		};
+
+	CAlfTransitionRequest(CGfxTransAdapterTfx* aParent, MTfxServerObserver* aOwner, TType aType);
+	~CAlfTransitionRequest();		
+
+	void IssueReq();
+	inline TType Type();
+private:
+	void RunL();
+	void DoCancel();
+	TInt RunError(TInt aError);
+
+	MTfxServerObserver* iOwner;
+	CGfxTransAdapterTfx* iParent;
+	TType iType;
+	
+};
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CAlfTransitionRequest::CAlfTransitionRequest(CGfxTransAdapterTfx* aParent, MTfxServerObserver* aOwner, TType aType) : 
+	CActive(CActive::EPriorityHigh), 
+	iOwner(aOwner),
+	iParent(aParent),
+	iType(aType)
+	{
+	CActiveScheduler::Add(this);
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CAlfTransitionRequest::~CAlfTransitionRequest() 
+	{
+  	__ALFFXLOGSTRING("CAlfTransitionRequest - cancelling and deleting policy request" );
+	Cancel();
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CAlfTransitionRequest::RunL()
+	{
+	if ( iStatus.Int() == KErrCancel )
+	    {
+	    // If the request was cancelled, we are done
+    	__ALFFXLOGSTRING("CAlfTransitionRequest: Policy request cancelled" );
+	    return;
+	    }
+	
+	switch( iType ) 
+		{
+/*		
+// not supported at the time being - all transaction finishing is handled in alf
+		case ETransFinish:
+			iOwner->TransitionFinished(iStatus.Int());
+			__ALFFXLOGSTRING1("Client::CActive.iOwner->TransitionFinished status = %d", iStatus.Int());
+			break;
+*/			
+		case EPolicyUpdate:
+			{
+#ifdef _DEBUG
+			RThread me;
+			TInt ap = me.Id();
+			me.Close();
+			__ALFFXLOGSTRING2("CAlfTransitionRequest: Policy received. Cli: %d, status %d",ap,iStatus.Int());
+#endif
+            User::LeaveIfError( iStatus.Int() );
+            iParent->GetNewPoliciesL( iStatus.Int() );
+            User::LeaveIfError( iParent->RequestPolicyUpdates() );
+			}
+			break;
+		default:
+			break;
+		}
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionRequest::RunError(TInt aError)
+	{
+	//The idea here is that on failure (wich should be OOM), we clear all our policies
+	//clientside.
+	//We must also inform server of this, so it can resend all policies the next time we request.
+	//Next time a transition is tried, policies will be re-requested.
+#ifdef _DEBUG
+	RThread me;
+	TInt meid = me.Id();
+	TInt tmp = aError; //remove warning when debug prints and turned off
+	aError = tmp;
+	__ALFFXLOGSTRING2("--->> Policy error <<--. Cli: %d, status: %d",meid,aError);
+	me.Close();
+#endif
+
+	iOwner->ClearAllPolicies(); //clear all policies clientside
+	iParent->CancelPolicyUpdates(); //cancel requests on server.
+
+	return 0;
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CAlfTransitionRequest::DoCancel()
+	{
+    //nothing to do here. requests are cancelled elsewhere.
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CAlfTransitionRequest::IssueReq() 
+	{
+	SetActive();
+	}
+
+// ---------------------------------------------------------------------------
+// We keep it here, even though its inline, since it is never used outside this
+// file anyway.
+// The idea with .inl files is to keep the header file clean.
+// ---------------------------------------------------------------------------
+//
+inline CAlfTransitionRequest::TType CAlfTransitionRequest::Type()
+	{
+	return iType;
+	}
+
+
+// ======== MEMBER FUNCTIONS ========
+
+CGfxTransAdapterTfx::CGfxTransAdapterTfx(MGfxTransClient* aClient) :
+	iClient(aClient),
+	iConnected(EFalse),
+	iHasPlugin(EFalse)
+	{
+	}
+	
+CGfxTransAdapterTfx::~CGfxTransAdapterTfx()
+	{
+	
+	__ALFFXLOGSTRING("CGfxTransAdapterTfx for HWA transitionn effects, destructor ");
+//	iIgnoredWOChildControls.Close();
+	//iControlInfo.ResetAndDestroy();
+	if ( iConnected )
+	    {
+	    if ( iHasPlugin )
+	        {
+        	__ALFFXLOGSTRING("CGfxTransAdapterTfx, canceling policy updates in destructor  ");
+	        CancelPolicyUpdates();
+	        // should we wait here until the cancellation has returned?
+        	__ALFFXLOGSTRING("CGfxTransAdapterTfx, unloading plugin  ");
+	        iTfxServer.UnloadTfxPlugin( iPluginImplementation );
+	        }
+	    }
+	delete iPolicyReq;    
+  	iTfxServer.Close();
+  	iConnected = EFalse;
+  	iHasPlugin = EFalse;
+	delete iTransferBuffer;
+	delete iReturnBuffer;
+	delete iAsyncTransferBuffer;
+	delete iAsyncReturnBuffer;
+	}
+	
+void CGfxTransAdapterTfx::ConstructL()
+	{
+	
+	__ALFFXLOGSTRING("CGfxTransAdapterTfx for HWA transitionn effects, ConstructL");
+	
+	RThread me;
+	iClientId = me.Id();	
+    me.Close();
+
+    iPluginImplementation = TUid::Null();
+    ConnectToServer();
+    
+    // We need to save various 32 bit integers. The exact number depends on the function.
+    // We reserve a bit extra here, should check if the size is big enough for all cases.
+    iTransferBuffer = HBufC8::NewL( 25 * sizeof(TInt32) );
+    // If we get return values, we'll need a bigger buffer
+    iReturnBuffer = HBufC8::NewL( sizeof( TInt ) );
+        
+    // We need to save various 32 bit integers. The exact number depends on the function.
+    // We reserve a bit extra here, should check if the size is big enough for all cases.
+    iAsyncTransferBuffer = HBufC8::NewL( 25 * sizeof(TInt32) );
+    // If we get return values, we'll need a bigger buffer
+    iAsyncReturnBuffer = HBufC8::NewL( sizeof( TInt ) );
+        
+	iPolicyReq = new( ELeave )CAlfTransitionRequest(this,
+        this,
+		CAlfTransitionRequest::EPolicyUpdate);
+		
+	}
+	
+void CGfxTransAdapterTfx::ConnectToServer()
+    {
+    // We need to resolve the plugin id for starters, 
+    // use default parameters, we take the first one we find.
+
+    TInt err = KErrNone;
+    
+    if ( !iConnected )
+        {
+        err = iTfxServer.Open();
+        if ( err == KErrNone )
+            {
+            iConnected = ETrue;
+            }
+        else
+            {
+            // could not connect to server - cannot continue.
+            return;
+            }
+        }
+       
+    if ( iHasPlugin )
+        {
+        // already connected
+        return;
+        }
+
+    if ( iPluginImplementation == TUid::Null())
+        {
+        RImplInfoPtrArray pluginArray;
+        TRAP( err, REComSession::ListImplementationsL( KAlfGfxPluginInterfaceUId, pluginArray ) );
+
+	    if ( pluginArray.Count() > 0 )
+	        {
+	        iPluginImplementation = pluginArray[0]->ImplementationUid();
+	        }
+        // Clear the data in plugin array, it is not going to be used any more.    
+        TInt i = 0;    
+        for ( i = pluginArray.Count() - 1; i >= 0; i-- )
+            {
+            // destroy 
+            delete pluginArray[i];
+            pluginArray.Remove( i );
+            }
+        pluginArray.Close();
+        }
+		
+    if ( err == KErrNone && iPluginImplementation != TUid::Null() )
+        {
+        err = iTfxServer.LoadTfxPlugin( iPluginImplementation );
+        if ( err == KErrNone || err == KErrAlreadyExists )
+            {
+            // We have successfully loaded the plugin and saved
+            // the implementation uid to be used later.
+            iHasPlugin = ETrue;
+        	__ALFFXLOGSTRING("HWA TransEffect Plugin loaded");
+            }
+        }
+     
+    }
+	
+
+// ---------------------------------------------------------------------------
+// tests if adapter is active (trying to make it active if needed)
+// ---------------------------------------------------------------------------
+//
+TBool CGfxTransAdapterTfx::IsActive()
+	{
+	TInt ap = iClientId.Id();
+	__ALFFXLOGSTRING1("IsActive() cli: %d",ap);
+	
+	TInt err = KErrNone;
+	if( !iHasPlugin ) 
+		{
+		ConnectToServer();
+		if (!iHasPlugin )
+		    {
+    		return EFalse;
+		    }
+		}
+		
+	if( err == KErrNone )
+		{
+		//Make sure policy request handling is on.
+		err = RequestPolicyUpdates();
+		}
+	else
+		{
+		//Failed to connect, remove all policies from client.
+		iClient->ClearAllPolicies();
+		}
+		
+	return (err == KErrNone);
+	}
+
+// ---------------------------------------------------------------------------
+// Handles the different states of the client.
+// ---------------------------------------------------------------------------
+//
+TInt CGfxTransAdapterTfx::HandleClientState( TClientState aState, const CCoeControl* aKey, TInt aHandle )
+	{
+	if( !iHasPlugin )
+	    {
+	    return KErrNone;
+	    }
+	 
+	TInt err = KErrNone;    
+	TInt action = 0;
+	const CTransitionData* transdata;
+	err = iClient->GetTransitionData( aHandle, transdata );
+	if ( err == KErrNone )
+	    {
+    	action = transdata->iAction;
+	    }
+
+	switch(aState)
+		{
+		case EFallback:
+		    break;
+		case EPreBeginCapture:
+		    break;
+		case EPostBeginCapture:
+		    // If we get KGfxControlAppearAction, it is followed by StartTransition,
+		    // but disappear action is not. Therefore we must handle it byself
+		    // We use begin capture as trigger, as we assume that the control is still present
+		    // at that time. After EPostBeginCapture it will probably be already gone.
+		    // If we don't have plugin yet, there will be no transitions.
+		    if ( action == KGfxControlDisappearAction && iHasPlugin && aKey && aKey->DrawableWindow())
+		        {
+		        // We must generate our own transition as we won't be sending 
+		        // iClient->TransitionFinished back.
+		        // (Client did not ask for transition to be started, and won't be
+		        // interested in the end.)
+          		TRAP( err, GenerateTransitionL( aKey, transdata ) );
+		        }
+		    break;
+		case EPreEndCapture:	
+		    break;
+		case EPostEndCapture:
+		    break;
+		case EAbort:
+		// Abort component transition, handle given.
+		    break;
+		case EGlobalAbort:
+		// abort component transition, no handle.
+	        break;
+		case EBeginGroup:
+			{
+			__ALFFXLOGSTRING1("-- BeginGroup: New transition group for groupid: %d)",aHandle);
+			SendGroupCommand(aHandle, EFalse);
+		    break;
+			}
+		case EEndGroup:
+			{
+			__ALFFXLOGSTRING1("-- EndGroup: closing transition group: %d)",aHandle);
+			SendGroupCommand(aHandle, ETrue);
+		    break;
+			}
+		default:
+			break;
+		}
+	return err;
+	}
+
+// ---------------------------------------------------------------------------
+// Called by client when a participant of a transition updates in mid transition.
+// ---------------------------------------------------------------------------
+//
+void CGfxTransAdapterTfx::HandleParticpantUpdate(TInt /*aHandle*/, const CParticipantData* /*aParticipant*/, 
+												RWsGraphicMsgBuf* /*aCommandBuffer*/, 
+												const TRect& /*aDrawRect*/, const TRect& /*aBoundingRect*/)
+	{
+/*	
+	if(aCommandBuffer->Count() == 0)
+	    {
+	    return;
+	    }
+	
+	const CTransitionData* transdata;
+	TInt err = iClient->GetTransitionData(aHandle,transdata);
+	if(err != KErrNone) 
+		{
+		return;
+		}
+		
+	CTransControlDrawerInfo* drawinfo = FindControl(aHandle);
+	if(drawinfo && drawinfo->HasWOParticipants()) 
+		{
+		return;
+		}
+		
+		
+	TInt participantid = -1;
+	if(aParticipant == transdata->iBaseControl) 
+		{
+		participantid = 0;
+		}
+	else
+		{
+		TBool found = EFalse;
+		for(TInt i = transdata->iSubControls.Count() - 1; (i >= 0) && !found; i--) 
+			{
+			if(transdata->iSubControls[i] == aParticipant) 
+				{
+				participantid = i + 1;
+				found = ETrue;
+				}
+			}
+		}
+	
+	if(participantid >= 0) 
+		{
+		//Find control drawer for this handle, send updated participant to it.
+		CWsTransControlGraphic* drawer = FindDrawer(aHandle);
+		if(drawer) 
+			{
+			RThread t;
+			__ALFFXLOGSTRING2("Sending participant update for client:%d, handle:%d",t.Id().Id(),aHandle);
+			drawer->SendParticipantUpdate(participantid, aCommandBuffer, aDrawRect, aBoundingRect);			
+			}
+		}
+*/		
+	}
+
+
+// ---------------------------------------------------------------------------
+// returns an array of supported control transitions
+// ---------------------------------------------------------------------------
+//
+TControlPolicy* CGfxTransAdapterTfx::GetTransitionPolicies(TInt &aCount)
+	{
+	if( !iHasPlugin )
+		{
+		ConnectToServer();
+		if ( !iHasPlugin )
+		    {
+    		return NULL;
+		    }
+		}
+	//Start requesting policies
+	RequestPolicyUpdates();
+
+	//No policies at this point, all will be pushed.
+	aCount = 0;
+	return NULL;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CGfxTransAdapterTfx::SubConBegin( const CCoeControl* /*aControl*/ )
+    {
+/*    
+    if ( aControl )
+        {
+        for ( TInt i = 0; i < aControl->CountComponentControls(); i++ )
+            {
+            const CCoeControl* subcon = aControl->ComponentControl( i );
+            if ( subcon && subcon->OwnsWindow() && subcon->Size() != TSize( 0, 0 )  && !GfxTransEffect::IsRegistered(subcon))
+                {
+                if ( iIgnoredWOChildControls.Find( subcon ) == KErrNotFound )
+                    {
+                    iSubCons++;
+                    GfxTransEffect::Register( subcon, iActiveUid );
+                    GfxTransEffect::Begin( subcon, iActiveAction );
+                    }
+                }
+            iCurrZ++;
+            SubConBegin( subcon );
+            iCurrZ--;
+            }
+        }
+*/        
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CGfxTransAdapterTfx::SubConEnd(const CCoeControl* /*aControl*/)
+    {
+/*    
+    if ( aControl )
+        {
+        for ( TInt i = aControl->CountComponentControls() - 1; i >= 0 ; i-- )
+            {
+            CCoeControl* subcon = aControl->ComponentControl(i);
+            SubConEnd( subcon );
+            if ( subcon && subcon->OwnsWindow() &&
+                 GfxTransEffect::IsRegistered( subcon ) )
+                {
+                if (subcon->IsVisible())
+                    {
+                    GfxTransEffect::SetBeginDemarcation(subcon, TRect(0, 0, 0, 0));
+                    }
+                else
+                    {
+                    GfxTransEffect::SetEndDemarcation(subcon, TRect(0, 0, 0, 0));
+                    }
+                GfxTransEffect::Invalidate(subcon);
+                GfxTransEffect::End(subcon);
+                if(subcon->IsVisible())
+                    {
+                    // make subcon temporarily invisible to avoid redrawing when deregistering
+                    // redrawing will go to the remotegc of the main control but is bad for performance
+                    // and causes Begin/End Redraw on the window which can cause flicker.
+                    subcon->MakeVisible(EFalse);
+                    GfxTransEffect::Deregister(subcon);
+                    subcon->MakeVisible(ETrue);
+                    }
+                else 
+                    {
+                    GfxTransEffect::Deregister(subcon);
+                    }
+                iSubCons--;
+                }
+            }
+        }
+*/        
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CGfxTransAdapterTfx::SubConAbort( const CCoeControl* /*aControl*/ )
+    {
+/*    
+    if ( aControl )
+        {
+        for ( TInt i = aControl->CountComponentControls() - 1; i >= 0; --i )
+            {
+            CCoeControl* subcon = aControl->ComponentControl( i );
+            SubConAbort( subcon );
+            if ( subcon && subcon->OwnsWindow() &&
+                 GfxTransEffect::IsRegistered( subcon ) )
+                {
+                GfxTransEffect::Abort( subcon );
+                }
+            }
+        }
+*/        
+    }
+
+// ---------------------------------------------------------------------------
+// calls to GfxTransEffect::NotifyExternalState comes through here.
+// ---------------------------------------------------------------------------
+//
+void CGfxTransAdapterTfx::NotifyExternalState( TInt aState, const TDesC8* /*aArg*/ )
+	{
+	switch(aState)
+		{
+		case ECaptureComponentsBegin:
+        	if( !IsActive() )
+                {
+                return; //dont do anything if server is not running
+                }
+            break;                
+		case ECaptureComponentsEnd:
+        	if( !IsActive() )
+                {
+                return; //dont do anything if server is not running
+                }
+            break;                
+        case ECaptureComponentsAbort:
+        	if( !IsActive() )
+                {
+                return; //dont do anything if server is not running
+                }
+//			iTfxServer.AbortControlTransition();
+			return;
+		case ENotifyGlobalAbort:
+//			iTfxServer.AbortControlTransition();
+			return;
+        case EBeginPopupSequence:
+	    case ELastPopupInSequence:
+	    case EEndPopupSequence:
+		case EInternalHandleSequence:
+		case EGetRegistrationType:
+        case EAddIgnoreWOChildComponent:
+        case ERemoveIgnoreWOChildComponent:
+        default:
+            //ignored
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// called by client to start the specific transition
+// ---------------------------------------------------------------------------
+//
+void CGfxTransAdapterTfx::StartTransition(TInt aHandle)
+	{
+	if( !iHasPlugin )
+		{
+		iClient->TransitionFinished( aHandle );
+		return;
+		}
+		
+	const CTransitionData* transdata;
+	TInt err = iClient->GetTransitionData( aHandle, transdata );
+
+	if( err == KErrNone ) 
+		{
+    	if ( transdata->iAction != KGfxControlDisappearAction )
+    	    {
+    	    // Disappear action was started by EPostBeginCapture event
+    		TRAP( err, DoStartTransitionL( aHandle, transdata ) );
+    	    }
+    	else
+    	    {
+            __ALFFXLOGSTRING( "CGfxTransAdapterTfx::StartTransition called for disappear action" );
+    	    }
+		}
+		
+    // always finish the caller		
+    iClient->TransitionFinished( aHandle );
+	}
+
+// ---------------------------------------------------------------------------
+// GfxTransEffect::BeginFullscreen gets passed here.
+// ---------------------------------------------------------------------------
+//
+void CGfxTransAdapterTfx::BeginFullScreen(TUint /*aAction*/, const TRect& /*aEffectArea*/)
+	{
+	//This function will not be used.
+	}
+
+// ---------------------------------------------------------------------------
+// GfxTransEffect::BeginFullscreen gets passed here.
+// ---------------------------------------------------------------------------
+//
+void CGfxTransAdapterTfx::BeginFullScreen(TUint aAction, const TRect& aEffectArea, 
+										 TUint aType, const TDesC8& aParams)
+	{
+    __ALFFXLOGSTRING1( "CGfxTransAdapterTfx::BeginFullScreen - %S >>", &RThread().Name());
+    __ALFFXLOGSTRING1( "CGfxTransAdapterTfx::BeginFullScreen - iHasPlugin %d >>", iHasPlugin);
+	if( !iHasPlugin )
+		{
+		ConnectToServer();
+		if ( !iHasPlugin )
+		    {
+    		return;
+		    }
+		}
+        
+    TInt op = MAlfGfxEffectPlugin::EBeginFullscreen;
+    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	
+    // We won't leave here because our buffer is long enough
+    // The buffer has been allocated in the constructor
+    // If you add parameters, check the length of the buffer
+    TRAP_IGNORE(
+        {
+        inBuf.WriteInt32L( op );
+        inBuf.WriteUint32L( aAction );
+        inBuf.WriteInt32L( aEffectArea.iTl.iX );
+        inBuf.WriteInt32L( aEffectArea.iTl.iY );
+        inBuf.WriteInt32L( aEffectArea.iBr.iX );
+        inBuf.WriteInt32L( aEffectArea.iBr.iY );
+        inBuf.WriteInt32L( aType );
+	
+        AknTransEffect::TParameter tmp;
+        TPckgC<AknTransEffect::TParameter> params( tmp );
+    	params.Set( aParams );
+    	if ( aType == AknTransEffect::EParameterType )
+    		{
+            __ALFFXLOGSTRING3("CGfxTransAdapterTfx::BeginFullScreen - EParameterType, iNext.iUid: 0x%x, iPrev.iUid: 0x%x, iFlags: %d", params().iNext.iUid, params().iPrev.iUid, params().iFlags );
+            inBuf.WriteInt32L( params().iNext.iUid );
+            inBuf.WriteInt32L( params().iPrev.iUid );
+            inBuf.WriteInt32L( params().iFlags );
+     
+    		}    
+    	else if ( aType == AknTransEffect::EParameterAvkonInternal )
+    	    {
+       		const TUint* data = reinterpret_cast<const TUint*>( aParams.Ptr() );
+            inBuf.WriteUint32L( data[0] );
+            inBuf.WriteUint32L( data[1] );
+            inBuf.WriteUint32L( data[2] );
+            __ALFFXLOGSTRING3("CGfxTransAdapterTfx::BeginFullScreen - EParameterAvkonInternal, data[0-2] = [%d, %d, %d]", data[0], data[1], data[2]);
+    	    }
+    	else
+    	    {
+            inBuf.WriteUint32L( 0 );
+            inBuf.WriteUint32L( 0 );
+            inBuf.WriteUint32L( 0 );
+    	    }
+
+        inBuf.CommitL();
+        });
+        
+    inBuf.Release();
+    inBuf.Close();
+
+
+    // we ignore any returned error as we are just doing our best...
+    iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+
+    // clear out used data    
+	inPtr.Zero();
+	outPtr.Zero();
+	__ALFFXLOGSTRING("CGfxTransAdapterTfx::BeginFullScreen <<");
+	}
+
+// ---------------------------------------------------------------------------
+// GfxTransEffect::EndFullscreen gets passed here.
+// ---------------------------------------------------------------------------
+//
+void CGfxTransAdapterTfx::EndFullScreen()
+	{
+    __ALFFXLOGSTRING1( "CGfxTransAdapterTfx::EndFullScreen() - %S >>", &RThread().Name());
+	if( !iHasPlugin )
+		{
+  		return;
+		}
+	
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+    TInt op = MAlfGfxEffectPlugin::EEndFullscreen;
+    // We won't leave here because our buffer is long enough
+    TRAP_IGNORE(
+        {
+    	// no other parameters used
+        inBuf.WriteInt32L( op );
+        inBuf.CommitL();
+        });
+    inBuf.Release();
+    inBuf.Close();
+
+    __ALFFXLOGSTRING( "CGfxTransAdapterTfx::EndFullScreen" );
+    // we ignore any returned error as we are just doing our best...
+    iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+    // clear out used data    
+	inPtr.Zero();
+	outPtr.Zero();
+        
+	}
+
+// ---------------------------------------------------------------------------
+// GfxTransEffect::AbortFullscreen gets passed here.
+// ---------------------------------------------------------------------------
+//
+void CGfxTransAdapterTfx::AbortFullScreen()
+	{
+    __ALFFXLOGSTRING1( "CGfxTransAdapterTfx::AbortFullScreen() - %S >>", &RThread().Name());
+    if ( !iHasPlugin )
+        {
+        return;
+        }
+	
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+    TInt op = MAlfGfxEffectPlugin::EAbortFullscreen;
+    // We won't leave here because our buffer is long enough
+    TRAP_IGNORE(
+        {
+	    // no other parameters used
+        inBuf.WriteInt32L( op );
+        inBuf.CommitL();
+        });
+    inBuf.Release();
+    inBuf.Close();
+
+    // we ignore any returned error as we are just doing our best...
+    iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+    // clear out used data    
+	inPtr.Zero();
+	outPtr.Zero();
+	__ALFFXLOGSTRING("CGfxTransAdapterTfx::AbortFullScreen <<");
+	}
+
+
+// ---------------------------------------------------------------------------
+// implementation, handling transition startup
+// ---------------------------------------------------------------------------
+//
+void CGfxTransAdapterTfx::DoStartTransitionL( TInt /*aHandle*/, const CTransitionData* aTransData )
+	{
+    // send the transition request to Alf Plugin
+    __ALFFXLOGSTRING("CGfxTransAdapterTfx::DoStartTransitionL >>");
+    if ( !aTransData->iKey->DrawableWindow() )
+        {
+        // If we don't have a window, we cannot do transition
+        return;
+        }
+
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+    TInt op = MAlfGfxEffectPlugin::EBeginComponentTransition;
+    TInt windowGroup = aTransData->iKey->DrawableWindow()->WindowGroupId();
+    TInt windowHandle = aTransData->iKey->DrawableWindow()->ClientHandle(); 
+    
+    // We don't send all the position information as we will do no screen capture
+    // based on position, and the visuals know their own positions anyway.
+    // If we find out that we need to specify some starting or ending positions,
+    // we can add the information later.
+    
+    inBuf.WriteInt32L( op );
+    inBuf.WriteUint32L( aTransData->iAction );
+    inBuf.WriteInt32L( aTransData->iUid.iUid );
+    inBuf.WriteInt32L( windowGroup ); // window group id of the control
+    inBuf.WriteInt32L( windowHandle ); // server side window handle for the control
+    inBuf.WriteInt32L( aTransData->iNLayered );
+    // Participant data for the main layer. Other layers not handled separately.
+    const CParticipantData* baseControl = aTransData->iBaseControl;        
+    inBuf.WriteInt32L( baseControl->iLayerType.iUid ); // uid for this participant
+    inBuf.WriteInt32L( baseControl->iFlags ); // hints 
+    // Possible component control data missing - we assume handling of the whole control as one
+    
+    inBuf.CommitL();
+    inBuf.Release();
+    inBuf.Close();
+
+    __ALFFXLOGSTRING( "CGfxTransAdapterTfx::DoStartTransitionL" );
+    iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+    // clear out used data    
+	inPtr.Zero();
+	outPtr.Zero();
+	
+	/*
+	if ( iSubCons ) //Note: "normal" nesting wont work, but is not used in this platform.
+		{
+		if(iMainControl) 
+			{
+			//Collecting window owning sub controls, add to list.
+			__ALFFXLOGSTRING2("Adding subcon %x, handle: %d",aTransData->iKey, aHandle);
+	        CSubWOControl* subcon = CSubWOControl::NewL( aHandle, *aTransData );
+			iSubWOControls.AppendL(subcon);
+			return;
+			}
+		else
+			{
+			//Subcon Mismatch, abort transition and clean up.
+			iClient->TransitionFinished(aHandle);	
+			return;
+			}
+		}
+
+	if(iControlInfo.Count() >= KMaxOngoing)
+		{
+		__ALFFXLOGSTRING("CGfxTransAdapterTfx::DoStartTransitionL maxongoing");
+		iClient->TransitionFinished(aHandle);
+		return;
+		}
+	
+	TInt ap = iClientId.Id();
+	__ALFFXLOGSTRING2("Adapter: Transition Started: %d, cli: %d",aHandle,ap);
+	TRect boundingrect = TRect(aTransData->iBeginWOPos + aTransData->iBaseControl->iBeginRect.iTl, 
+							   aTransData->iBeginWOPos + aTransData->iBaseControl->iBeginRect.iBr);
+	boundingrect.BoundingRect(TRect(aTransData->iEndWOPos + aTransData->iBaseControl->iEndRect.iTl, 
+									aTransData->iEndWOPos + aTransData->iBaseControl->iEndRect.iBr));
+	CTransControlDrawerInfo* drawinfo = CTransControlDrawerInfo::NewL(aHandle, boundingrect);
+	CleanupStack::PushL(drawinfo);
+	User::LeaveIfError(iControlInfo.Append(drawinfo));
+	CleanupStack::Pop(drawinfo);
+	CWsTransControlGraphic* drawer = drawinfo->Drawer();
+
+	__ALFFXLOGSTRING("Adapter: Sending participant 0");
+	drawer->SendParticipant(aTransData->iBaseControl,0);
+	TInt count = aTransData->iSubControls.Count(); 	
+	for(TInt i = 0; i < count; i++)
+		{
+		__ALFFXLOGSTRING1("Adapter: Sending participant %d",i+1);
+		drawer->SendParticipant(aTransData->iSubControls[i],i + 1);
+		}
+
+	TInt wocount = iSubWOControls.Count();
+	if(wocount) 
+		{
+		drawinfo->SetHasWOParticipants(ETrue);
+		}
+	for(TInt i = wocount - 1; i >= 0; i--)
+		{
+		drawer->SendWOParticipant(*iSubWOControls[i]);
+		}
+	for(TInt i = 0; i < wocount; i++)
+		{
+		iClient->TransitionFinished(iSubWOControls[i]->Handle());
+		}
+	iSubWOControls.ResetAndDestroy();
+
+	__ALFFXLOGSTRING("Adapter: Sending Transition Data");
+
+	TBool drawerstart = EFalse;
+	if(iIsWO && !aTransData->iKey->IsVisible())
+		{
+		drawerstart = ETrue;
+		}
+
+	drawer->SendTransitionData(aTransData, aHandle, drawerstart); 
+	drawer->Flush();
+
+    if(iIsWO && !aTransData->iKey->Parent())
+        {
+        // aTransData->iKey->DrawNow();
+        if ( aTransData->iKey->IsVisible() && !aTransData->iKey->IsBackedUp() )
+            {
+            RWindow* window = ( RWindow* ) aTransData->iKey->DrawableWindow();
+            window->BeginRedraw();
+            window->EndRedraw();
+            }
+        }
+    else
+		{
+		const CCoeControl* parent = aTransData->iKey->Parent();
+		if(parent)
+			{
+//			TRect rect;
+//			if(iIsWO)
+//				{
+//				rect = TRect(aTransData->iKey->PositionRelativeToScreen(),aTransData->iKey->Size());
+//				rect.Move(-parent->PositionRelativeToScreen());
+//				}
+//			else
+//				{
+//				rect = aTransData->iBaseControl->iBeginRect;
+//				}
+				
+			//Drawing problems with listboxes in component if
+			//particle systems is used. We disable this rect for now
+			//to resolve this. Shouldn't affect performance much.
+
+            if ( !aTransData->iKey->IsVisible() )
+                {
+                parent->DrawNow();
+                }
+            }
+        }
+    ////
+	iCoeEnv->WsSession().Flush();
+
+	__ALFFXLOGSTRING("Adapter: Requesting finished event");
+	if(KErrNone != iTfxServer.RequestFinishedEvent(aHandle))
+		{
+		iCurrHandle = 0;
+		TransitionFinished(aHandle);
+		return;
+		}
+
+	if(!drawerstart) 
+		{
+		if(KErrNone != iTfxServer.SendStartTick(iClientId,aHandle))
+			{
+			TransitionFinished(aHandle);
+			}
+		}
+	iCurrHandle = 0;
+*/	
+	__ALFFXLOGSTRING("CGfxTransAdapterTfx::DoStartTransitionL <<");
+	}
+
+void CGfxTransAdapterTfx::GenerateTransitionL( const CCoeControl* aKey, const CTransitionData* aTransData)
+    {
+    __ALFFXLOGSTRING("CGfxTransAdapterTfx::GenerateTransitionL >>");
+    // We generate a transition call from begin capture for control exit transitions
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+    TInt op = MAlfGfxEffectPlugin::EBeginComponentTransition;
+    TInt windowGroup = aKey->DrawableWindow()->WindowGroupId();
+    TInt windowHandle = aKey->DrawableWindow()->ClientHandle(); 
+    
+    inBuf.WriteInt32L( op );
+    inBuf.WriteUint32L( aTransData->iAction );
+    inBuf.WriteInt32L( aTransData->iUid.iUid );
+    inBuf.WriteInt32L( windowGroup ); // window group id of the control
+    inBuf.WriteInt32L( windowHandle ); // server side window handle for the control
+    inBuf.WriteInt32L( aTransData->iNLayered );
+    // Participant data not present in exit
+    inBuf.WriteInt32L( 0 );
+    inBuf.WriteInt32L( 0 ); // no hints
+
+    inBuf.CommitL();
+    inBuf.Release();
+    inBuf.Close();
+
+    __ALFFXLOGSTRING( "CGfxTransAdapterTfx::GenerateTransitionL" );
+    iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+    // clear out used data    
+	inPtr.Zero();
+	outPtr.Zero();
+	
+	// Don't signal client because client did not request the transition to start
+    __ALFFXLOGSTRING("CGfxTransAdapterTfx::GenerateTransitionL <<");
+    }
+	
+	
+// ---------------------------------------------------------------------------
+// finds a control
+// ---------------------------------------------------------------------------
+//
+//CTransControlDrawerInfo* CGfxTransAdapterTfx::FindControl(TInt /*aHandle*/)
+/*	
+	{
+	for(TInt i = iControlInfo.Count() - 1; i >= 0; i--) 
+		{
+		if(iControlInfo[i]->Handle() == aHandle)
+			{
+			return iControlInfo[i];			
+			}
+		}
+	return NULL;
+	}
+*/		
+
+// ---------------------------------------------------------------------------
+// finds a control drawer.
+// ---------------------------------------------------------------------------
+//
+//CWsTransControlGraphic* CGfxTransAdapterTfx::FindDrawer(TInt /*aHandle*/)
+/*	
+	{
+	for(TInt i = iControlInfo.Count() - 1; i >= 0; i--) 
+		{
+		if(iControlInfo[i]->Handle() == aHandle)
+			{
+			return iControlInfo[i]->Drawer();			
+			}
+		}
+	return NULL;
+	}
+*/		
+
+// ---------------------------------------------------------------------------
+// callback called by server when a policy updates.
+// ---------------------------------------------------------------------------
+//
+void CGfxTransAdapterTfx::PolicyUpdate(TControlPolicy* aPolicy)
+	{
+	iClient->TransitionPolicyUpdate(aPolicy);	
+	}
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CGfxTransAdapterTfx::ClearAllPolicies()
+	{
+	iClient->ClearAllPolicies();	
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CGfxTransAdapterTfx::RequestPolicyUpdates()
+    {
+    __ALFFXLOGSTRING("CGfxTransAdapterTfx::RequestPolicyUpdates >>");
+	if( iPolicyReq->IsActive() )
+		{
+		// request already ongoing
+		return KErrNone;	
+		}
+		
+    if ( !iHasPlugin )
+        {
+        return KErrDisconnected;
+        }
+		
+    // send a request to plugin to start sending us policy updates
+    // This is an asynchronous request
+
+    TPtr8 inPtr = iAsyncTransferBuffer->Des();
+    inPtr.Zero();
+    TPtr8 outPtr = iAsyncReturnBuffer->Des();
+    outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+    TInt op = MAlfGfxEffectPlugin::ETfxServerOpControlPolicyRequest;
+    // We won't leave here because our buffer is long enough
+    TRAP_IGNORE(
+        {
+	    // no other parameters used
+        inBuf.WriteInt32L( op );
+        inBuf.CommitL();
+        });
+    inBuf.Release();
+    inBuf.Close();
+
+    __ALFFXLOGSTRING( "CGfxTransAdapterTfx::RequestPolicyUpdates" );
+    iTfxServer.SendAsynchronousData( iPluginImplementation, inPtr, outPtr, iPolicyReq->iStatus );
+    iPolicyReq->IssueReq();
+    // clear out used data    
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING("CGfxTransAdapterTfx::RequestPolicyUpdates <<");
+    return KErrNone;
+    
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CGfxTransAdapterTfx::GetNewPoliciesL( TUint aCount )
+    {
+    __ALFFXLOGSTRING1("CGfxTransAdapterTfx::GetNewPoliciesL %d >>", aCount);
+    if ( !iHasPlugin )
+        {
+        User::Leave( KErrDisconnected );
+        }
+    // Send request to plugin  
+
+	TInt err = KErrNone;
+	
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	
+	TInt bufferSize = sizeof( TUint32 ) + ( sizeof( TInt32 ) * 2 + sizeof( TUint8 ) ) * aCount ;
+	if ( iReturnBuffer->Des().MaxSize() < bufferSize )
+	    {
+	    delete iReturnBuffer;
+	    iReturnBuffer = NULL;
+        iReturnBuffer = HBufC8::NewL( bufferSize );
+	    }
+	    
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+    TInt op = MAlfGfxEffectPlugin::ETfxServerOpControlPolicyGet;
+   	RThread me;
+   	
+    inBuf.WriteInt32L( op );
+	TUint64 id = me.Id();
+    TUint8* ptr = reinterpret_cast<TUint8*>( &id );
+    inBuf.WriteL( ptr, 8 );
+    inBuf.WriteInt32L( aCount );
+    
+    inBuf.CommitL();
+    inBuf.Release();
+    inBuf.Close();
+    me.Close();
+
+    if ( iHasPlugin )
+        {
+        __ALFFXLOGSTRING( "CGfxTransAdapterTfx::GetNewPoliciesL" );
+        err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+        }
+    // This is a case where we are supposed to get data back        
+    if ( err == KErrNone )
+        {
+        RDesReadStream instream( outPtr );
+        CleanupClosePushL( instream );
+        TUint count = instream.ReadUint32L();
+        while ( count-- > 0 )
+            {
+            TInt uid = instream.ReadInt32L();
+            TUint action = instream.ReadUint32L();
+            TPolicy policyId = ( TPolicy ) instream.ReadUint8L();
+            TControlPolicy* policy = new ( ELeave ) TControlPolicy();
+            policy->iId.iUid = uid;
+            policy->iAction = action;
+            policy->iPolicy = policyId;
+            iClient->TransitionPolicyUpdate( policy );
+            }
+        CleanupStack::PopAndDestroy(); // instream
+        }
+        
+    // clear out used data    
+	inPtr.Zero();
+	outPtr.Zero();
+	__ALFFXLOGSTRING("CGfxTransAdapterTfx::GetNewPoliciesL <<");
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CGfxTransAdapterTfx::CancelPolicyUpdates()
+    {
+    __ALFFXLOGSTRING("CGfxTransAdapterTfx::CancelPolicyUpdates >>");
+    if ( !iHasPlugin )
+        {
+        // nothing to cancel
+        return;
+        }
+        
+    // send request to plugin
+    // If the updates have not been subscribed, there is nothing to cancel either
+    TPtr8 inPtr = iTransferBuffer->Des();
+    inPtr.Zero();
+    TPtr8 outPtr = iReturnBuffer->Des();
+    outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+    TInt op = MAlfGfxEffectPlugin::ETfxServerOpControlCancelPolicyUpdate;
+   	RThread me;
+    // We won't leave here because our buffer is long enough
+    TRAP_IGNORE(
+        {
+	    // no other parameters used
+        inBuf.WriteInt32L( op );
+    	TUint64 id = me.Id();
+	    TUint8* ptr = reinterpret_cast<TUint8*>( &id );
+	    inBuf.WriteL( ptr, 8 );
+        inBuf.CommitL();
+        });
+    inBuf.Release();
+    inBuf.Close();
+    me.Close();
+
+    // not waiting for policies, nothing to cancel
+	if( iPolicyReq->IsActive() )
+		{
+		// The cancel function will complete the request
+        __ALFFXLOGSTRING( "CGfxTransAdapterTfx::CancelPolicyUpdates" );
+        iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+		}
+		
+    // clear out used data    
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING("CGfxTransAdapterTfx::CancelPolicyUpdates <<");
+    }
+
+// ------------------------------------------------------------
+// SendGroupCommand
+//-------------------------------------------------------------
+//
+void CGfxTransAdapterTfx::SendGroupCommand(TInt aGroupId, TBool aGroupFinished)
+    {
+    __ALFFXLOGSTRING("CGfxTransAdapterTfx::SendGroupCommand >>");
+    if ( !iHasPlugin )
+        {
+        // nothing to cancel
+        return;
+        }
+        
+    // send request to plugin
+    // If the updates have not been subscribed, there is nothing to cancel either
+    TPtr8 inPtr = iTransferBuffer->Des();
+    inPtr.Zero();
+    TPtr8 outPtr = iReturnBuffer->Des();
+    outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	
+    TInt op;
+    if ( aGroupFinished )
+    	{
+		op = MAlfGfxEffectPlugin::ETfxServerOpEndGroup;
+    	}
+    else
+    	{
+		op = MAlfGfxEffectPlugin::ETfxServerOpBeginGroup;
+    	}
+   	RThread me;
+    // We won't leave here because our buffer is long enough
+    TRAP_IGNORE(
+        {
+	    // no other parameters used
+        inBuf.WriteInt32L( op );
+        inBuf.WriteInt32L( aGroupId );
+    	TUint64 id = me.Id();
+	    TUint8* ptr = reinterpret_cast<TUint8*>( &id );
+	    inBuf.WriteL( ptr, 8 );
+        inBuf.CommitL();
+        });
+    inBuf.Release();
+    inBuf.Close();
+    me.Close();
+
+    iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+		
+    // clear out used data    
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING("CGfxTransAdapterTfx::SendGroupCommand <<");
+    }
+
+
+// ======== GLOBAL FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// DLL interface. used by the client to create the adapter
+// ---------------------------------------------------------------------------
+//
+EXPORT_C MGfxTransAdapter* MGfxTransAdapter::CreateL(MGfxTransClient* aClient)
+	{
+	__ALFFXLOGSTRING("MGfxTransAdapter::CreateL >>");
+	CGfxTransAdapterTfx* adapter = new (ELeave) CGfxTransAdapterTfx(aClient);
+	CleanupStack::PushL(adapter);
+	adapter->ConstructL();
+	CleanupStack::Pop(adapter);
+	__ALFFXLOGSTRING("MGfxTransAdapter::CreateL <<");
+	return adapter;
+	}
+
+// ---------------------------------------------------------------------------
+// DLL interface. used by the client to destroy the adapter
+// ---------------------------------------------------------------------------
+//
+EXPORT_C void MGfxTransAdapter::Destroy(MGfxTransAdapter* aEngine)
+	{
+	delete static_cast<CGfxTransAdapterTfx*>(aEngine);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/group/AlfTfxSrvPlugin.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 TFX Server Plugin
+*         			for the complementary transitions feature.
+*
+*/
+
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+// #include <TfxSrvEcomIds.h>
+
+TARGET tfxsrvplugin.dll
+
+TARGETTYPE PLUGIN 
+
+// We use the old uid for the time being.
+// We must use the old implementation uid as aknskin uses that,
+// but we could have a different uid for our dll.
+// second uid is KTfxSrvEcomDllUid from TfxSrvEcomIds.h
+UID 0x10009D8D 0x10282DBA 
+
+CAPABILITY CAP_ECOM_PLUGIN 
+VENDORID VID_DEFAULT
+
+TARGETPATH   /sys/bin  
+
+SOURCEPATH     ../src
+START RESOURCE 10282DBA.rss
+TARGET         tfxsrvplugin.rsc
+END
+
+// This is a SYSTEMINCLUDE macro containing the middleware
+// layer specific include directories
+MW_LAYER_SYSTEMINCLUDE
+
+SYSTEMINCLUDE	/epoc32/include/libc
+SYSTEMINCLUDE	/epoc32/include/ecom  //Platform security
+SYSTEMINCLUDE	/epoc32/include/caf
+SYSTEMINCLUDE   ../../../../CommonInc
+
+USERINCLUDE ../inc
+USERINCLUDE ../../../../CommonInc
+
+SOURCEPATH ../src
+
+SOURCE alftfxsrvplugin.cpp
+SOURCE alftransitionserver.cpp
+SOURCE alftransitionservercontroller.cpp
+SOURCE alfpsobserver.cpp
+
+
+//#if defined(ARMCC)
+//deffile ../eabi/ 
+//#elif defined(WINSCW)
+//deffile ../bwinscw/ 
+//#elif defined(WINS)
+//deffile ../bwins/ 
+//#else
+//deffile ../bmarm/ 
+//#endif
+
+LIBRARY         euser.lib
+LIBRARY         ecom.lib
+LIBRARY         alfdecoderserverclient.lib
+LIBRARY         ws32.lib
+LIBRARY         alfclient.lib
+LIBRARY         centralrepository.lib
+LIBRARY         estor.lib
+LIBRARY         efsrv.lib 
+LIBRARY         flogger.lib
+
+EXPORTUNFROZEN
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/inc/alfpsobserver.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,83 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef ALFPSOBSERVER_H
+#define ALFPSOBSERVER_H
+
+#include <e32base.h>
+#include <e32property.h>
+
+const TUid KTestCategoryUid = { 0x10281f87 };
+const TUint KTfxClientKey =  0x12341234;
+const TUint KTfxServerKey = 0x12341235;
+const TUint KTfxServerCompFsKey = 0x12341236;
+
+
+
+const TUint KRandomMask = 0x80000000;
+const TUint KGetHeapSize = 0x90000000;
+
+// Set by the testee when it has finished setting up it's stuff, signalling
+// that the test app can start running its test.
+const TUint KTestInitComplete = 0xffff0000;
+
+// Set by the test app when it has finished running a test.
+const TUint KTestFinished = 0xffffffff;
+
+// Set by the testee when it determines that the test round is finished.
+// Used for deterministic memory allocation failure tests.
+const TUint KTestRoundComplete = 0xffffff00;
+
+//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+//
+NONSHARABLE_CLASS( MPsObserver )
+    {
+public:
+    virtual void PsValueUpdated( const TUid aCategory, const TUint aKey,
+                                 const TInt aVal ) = 0;
+    };
+
+//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+//
+NONSHARABLE_CLASS( CAlfPsObserver ) : public CActive
+    {
+public:
+    static CAlfPsObserver* NewL( MPsObserver* aClient, const TUid aCategory, 
+                              const TUint aKey );
+    static CAlfPsObserver* New( MPsObserver* aClient, const TUid aCategory, 
+                              const TUint aKey );
+    ~CAlfPsObserver();
+    
+    // From CActive
+    virtual void DoCancel();
+    virtual void RunL();
+    
+private:
+    CAlfPsObserver( MPsObserver* aClient, const TUid aCategory, 
+                 const TUint aKey);
+    void Construct( const TUid aCategory, const TUint aKey );
+
+private: // data
+    RProperty iProperty;
+    MPsObserver* iClient;
+    TUid iCategory;
+    TUint iKey;
+    };
+
+#endif // ALFPSOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/inc/alftfxserverdef.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,289 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   TFX server definitions. Contains various names and numbers
+*                used in the server.
+*
+*/
+
+
+#ifndef _SERVERDEF_H_
+#define _SERVERDEF_H_
+
+#include <e32base.h>
+
+_LIT(KTfxServerName,"TfxServer");
+_LIT(KTfxServerImageName, "TfxServer");
+_LIT(KAnyName, "*");
+
+/** transition server version numbers */
+const TInt KTfxServerMajorVN = 0;
+const TInt KTfxServerMinorVN = 6;
+const TInt KTfxServerBuildVN = 0;
+
+/** transition server uid */
+const TUid KTfxServerUid = { 0x10281F7D };
+
+/** RProperty value for server status */
+const TUint KTfxServerStatus = 0x10281F7D; 
+
+/** transition server stack size */
+const TInt KTfxServerStackSize = KDefaultStackSize;
+/** transition server minimum heap size */
+const TInt KTfxServerHeapMinSize = 64*1024; //64KB
+/** transition server maximum heap size */
+const TInt KTfxServerHeapMaxSize = 4*1024*1024; //4MB
+
+/** The time between start of frames the engine will try to keep, in ms. (1000/fps) */
+const TInt KDefaultWantedTime = 67;
+/** The minimum time between end of a frame to start of next frame allowed, in ms
+    increase this to give more time to other threads.
+    A high number will decrease framerate on complex scenes. */
+const TInt KDefaultMinTime = 22;
+
+/* 
+    default values for cache size
+    see TCacheSizeProperties for comments
+*/
+const TInt KDefaultMaxBytesOngoing = 1024*1024; // 1MB
+const TInt KDefaultMaxBytesBetween = 0; //
+
+/*
+    The maximum cache size between effects
+    if the phone is low on ram
+*/
+const TInt KLowMemoryMaxBytesBetween = 0; 
+
+/** priority of repository handler. Has to be higher then message loop to ensure repository changes are heeded */
+const TInt KTfxServerRepositoryHandler = 110; 
+/** priority of CServer2 object. only repository handler is higher. */
+const TInt KTfxServerMessageLoopPrio = 100;
+/** priority of frame timer. needs to be kept high, but lower then message loop */
+const TInt KTfxServerFrameTimerPrio = 80;
+/** priority of the requesthandler. needs to be higher then the frame timer, but lower then message loop */
+const TInt KTfxServerRequestHandlerPrio = 90;
+
+/** microseconds to wait after InitControltransition before assuming client has failed */
+const TInt KStartControlTransitionTimeout = 2000000;  //2s
+
+/** Window Server Secure ID */
+const TInt KWServSID = 268450592;
+
+/**  Nokia VID: = VID_DEFAULT */
+const TInt KNokiaVID  = 0x101FB657;
+
+/** Ranges for TFX messages */
+const TInt KTfxRanges[] =
+    {
+    0, //range is 0-10 inclusive
+    10, //range is 11-254 inclusive
+    255 // message 255 (shutdown)
+    };
+
+/** Element Indexes for PolicyElement */  
+const TUint8 KTfxElementsIndex[] =
+    {
+    0,                             
+    CPolicyServer::EAlwaysPass,
+    1
+    };
+
+/** Policy Elements */
+const CPolicyServer::TPolicyElement KTfxElements[] =
+    {
+    {_INIT_SECURITY_POLICY_S0(KWServSID), CPolicyServer::EFailClient},
+    {_INIT_SECURITY_POLICY_V0(KNokiaVID), CPolicyServer::EFailClient}
+    };
+
+/** Policy definition */    
+const CPolicyServer::TPolicy KTfxPolicy =
+    {
+    CPolicyServer::EAlwaysPass, //specifies all connect attempts should pass
+    sizeof(KTfxRanges) / sizeof(TInt),                   
+    KTfxRanges,
+    KTfxElementsIndex,
+    KTfxElements,
+    };
+
+/** opcodes used in message passing between client and server */
+enum TTfxServerServRqst
+    {
+//Wserv only:
+	ETfxServerOpRegisterControlDrawer, //0
+	ETfxServerOpDeregisterControlDrawer,
+//Wserv only:
+	ETfxServerOpStartTransition,
+	ETfxServerOpFullscreenBegin,
+	ETfxServerOpFullscreenEnd,         
+//Wserv only:
+	ETfxServerOpDSABegin,              //5
+	ETfxServerOpDSAEnd,
+//Wserv only:
+	ETfxServerOpFailedControlTransition,
+//Wserv only:
+	ETfxServerOpReqUnredirEvent,
+	ETfxServerOpCancelUnredirEvent,
+//Any thread:
+	ETfxServerOpSendStartTick,         //10
+	ETfxServerOpRequestFinishedEvent,
+//Any thread:
+	ETfxServerOpFullscreenAbort,
+	ETfxServerOpControlPolicyUpdate,
+	ETfxServerOpBeginGroup,
+	ETfxServerOpEndGroup,			   //15
+	ETfxServerOpAddFullscreenKML,      
+	ETfxServerOpRemoveFullscreenKML,
+	ETfxServerOpControlPolicyRemove,
+	ETfxServerOpControlPolicyGet,      //20
+	ETfxServerOpControlPolicyRequest,  
+	ETfxServerOpBlockFullscreenUid,
+	ETfxServerOpRegisterControlKml,
+	ETfxServerOpRemoveControlKml,
+	ETfxServerOpControlCancelPolicyUpdate, //25
+//Any thread:
+	ETfxServerOpSetWantedTime,
+	ETfxServerOpSetMinTime,
+	ETfxServerVerifyConnection,
+	ETfxServerOpAddFullscreenKMLEx,    
+//Any thread:
+	ETfxServerOpDumpClients,              //30
+//Any thread:
+    ETfxServerOpHandover,
+    ETfxServerOpUpdateLiveBuffer,
+    ETfxServerOpControlTransitionAbort,
+    ETfxServerOpRemoveAllKml,
+    ETfxServerOpFreeRam,
+    ETfxServerOpMemoryGood,            //36
+    ETfxServerOpRegisterControlKmlEx,
+    ETfxServerOpControlSetFrameTime,
+    ETfxServerOpControlSetMinFrameTime,
+// ListBox opcodes
+    ETfxServerOpListBoxStart = 100,
+    ETfxServerOpListBoxRegister,
+    ETfxServerOpListBoxMakeMove,
+    ETfxServerOpListBoxGetObsoleteItems,
+    ETfxServerOpListBoxRequestFrame,
+    ETfxServerOpListBoxGetDirtyRect,
+    ETfxServerOpListBoxInvalidate,
+    ETfxServerOpListBoxSetFrameTime,
+    ETfxServerOpListBoxSetMinFrameTime,
+    ETfxServerOpListBoxDeregister,
+    ETfxServerOpListBoxVerifyKML,
+    ETfxServerOpListBoxSetBorderDims,
+    ETfxServerOpListBoxRegisterKML,
+    ETfxServerOpListBoxUnregisterKML,
+    ETfxServerOpListBoxInPosition,
+    ETfxServerOpListBoxSetDrawing,
+#ifdef RD_UI_TRANSITION_EFFECTS_TOUCH_P2
+    ETfxServerOpListBoxLongTapStart,
+    ETfxServerOpListBoxLongTapEnd,
+#endif
+
+    ETfxServerOpListBoxEnd,
+ // Shutdown
+    ETfxServerOpShutdown = 255
+    };
+
+enum TTfxServPanic
+    {
+    EAlreadyRegistered,
+    ENotRegistered
+    };
+
+/**
+* This is a utility class that retrieves the name and version number 
+* of the tfxserver. 
+*/
+class KSCliDefinitions
+    {
+public:
+    static const TDesC&			ServerAndThreadName();
+    static const TDesC&						ServerImageName();
+    static TUidType							ServerUidType();
+    static TVersion							Version();
+};
+
+/**
+ * Holds animation and cache priority information of a fullscreen transition
+ */
+class TFullscreenInfo
+	{
+public:
+	TFullscreenInfo();
+	TFullscreenInfo(TInt aActionId, TInt aCachePriority, TInt aWantedTime, TInt aMinTime);
+	TInt iActionId;
+	TInt iCachePriority;
+	TInt iWantedTime;
+	TInt iMinTime;
+	};
+
+/**
+ * Holds cache size properties
+ */
+class TCacheSizeProperties
+	{
+public:
+/* 
+	Maximum amount of bytes that may be cached while a transition
+	is ongoing. If this value is less than the total size of the 
+	decoded images in the effect the images has to be decoded every 
+	frame which will have a huge impact on performance.
+	Default is KDefaultMaxBytesOngoing
+*/
+    TInt32 iMaxBytesOngoing; 
+/*
+    Maximum amount of bytes that may be cached when a transition
+    is not ongoing.
+    Default is KDefaultMaxBytesBetween.
+*/
+    TInt32 iMaxBytesBetween;
+    };
+
+struct TParticipantInfo
+  {
+  TPoint iTl;
+  TInt iBitmapHandle;
+  TUint32 iId;
+  };
+  
+struct TWantedTimes
+{
+	TInt32 iWantedTime  : 16;
+	TInt32 iMinTime 	: 16;
+};
+
+union TWantedTimesPacked
+{
+	struct TWantedTimes times;
+	TInt32 packed;
+};
+
+const TUint KMaxDirtyRegions = 5;
+
+/**
+ * The time between start of frames the engine will try to keep, 
+ * in microseconds.
+ */
+const TInt KDefaultListBoxWantedTime = 33;
+
+/** 
+ * The minimum time between end of a frame to start of next frame allowed, 
+ * in microseconds.
+ * Increase this to give more time to other threads.
+ * A high number will decrease framerate on complex scenes.
+ */
+const TInt KDefaultListBoxMinTime = 10;
+
+_LIT( KTfxListBoxMutexName, "TfxListBox%d" );
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/inc/alftfxsrvplugin.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,159 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   AlfTfxSrvPlugin Plugin implementation. Implements plugin for 
+*                plugin interface under AknSkins.
+*
+*/
+
+
+
+
+#ifndef ALFTFXSRVPLUGIN_H
+#define ALFTFXSRVPLUGIN_H
+
+#include <e32base.h>
+#include <mtransitionserver.h>
+#include <mtransitionservercontroller.h>
+// From TFX Server
+#include "alftransitionserver.h"
+#include "alftransitionservercontroller.h"
+
+/**
+ *  TfxSrvPlugin class
+ *
+ *  Implements methods that are called by the ECOM to create
+ *  instances of MTransitionServer & MTransitionServerController.
+ *  This class is not meant to be instantiated.
+ *
+ *  @lib TfxSrvPlugin.dll
+ *  @since 
+ */
+class TfxSrvPlugin
+    {
+    public:
+    
+    static MTransitionServer* CreateTransitionServerL();
+    static MTransitionServerController* CreateTransitionServerControllerL( 
+                                                                    TAny* aInitParams );
+
+    private:
+        // not meant to be instantiated
+        TfxSrvPlugin() {};
+    };
+
+
+/**
+ *  CSrvImpl, implementation of MTransitionServer
+ * 
+ *  Implements Tfx Server Plugin API interface, 
+ *  MTransitionServer part. Does not contain any other logic
+ *  than mediate calls to concrete implementation of
+ *  CAlfTransitionServerClient in TFXServer.
+ *
+ *  @lib TfxSrvPlugin.dll
+ *  @since 
+ */
+class CSrvImpl : public CBase, public MTransitionServer
+    {
+    
+    public: // Constructor
+    
+        static CSrvImpl* NewL();    
+    
+    private: // From MTransitionServer
+    
+         /**
+         * For comments on methods, and how to use them, see
+         * transitionserver.h header from TFXServer
+         */    
+    	 TInt Connect();
+    	 void Disconnect();
+    	 TInt RegisterFullscreenKml(TUint aActionID, const TUid& aUid, const TDesC& aResourceDir, 
+    										const TDesC& aFilename);
+    	 TInt UnregisterFullscreenKml(TUint aActionID, const TUid& aUid);
+         TInt BlockFullScreenUid(const TUid& aUid, TBool aBlockFrom, TBool aBlockTo);
+    	 TInt RegisterControlKml(const TUid &aUid, const TDesC& aResourceDir, const TDesC& aFilename);
+    	 TInt RegisterControlKml(const TUid &aUid, const TDesC& aResourceDir, const TDesC& aFilename,
+    	 						 TInt aWantedTime, TInt aMinTime);
+      	 TInt UnregisterControlKml(const TUid &aUid);
+         TInt RegisterControlAction(const TUid& aUid, TUint aActionID, const TDesC& aActionString);
+    	 TInt UnregisterControlAction(const TUid& aUid, TUint aActionID);
+    	 TInt UnregisterAllKml();
+    	 TInt SetWantedTime(TInt aTime);
+    	 TInt SetMinTime(TInt aTime);
+    	 TInt RegisterFullscreenKml(TUint aActionID, const TUid& aUid, const TDesC& aResourceDir, 
+    										const TDesC& aFilename, TInt aCachePriority, TInt aWantedTime,
+    										TInt aMinTime);
+		
+		 TInt RegisterListBoxKml(const TUid& aUid, const /*TListBoxType*/ TInt aListBoxType, 
+                                     const TDesC& aResourceDir, 
+									 const TDesC& aBackgroundFilename, 
+									 const TDesC& aListItemFilename);
+
+
+		TInt UnregisterListBoxKml(const TUid& aUid, const /*TListBoxType*/ TInt aListBoxType);		 		 
+		 
+		 TInt SetListBoxFrameTime( const TInt aWantedTime );
+		 TInt SetListBoxMinFrameTime( const TInt aMinFrameTime );
+		 TInt SetControlFrameTime( const TInt aWantedTime );
+		 TInt SetControlMinFrameTime( const TInt aMinFrameTime );
+          TBool IsConnected();
+          
+    private: 
+    
+        // to be deleted via MTransitionServer
+        ~CSrvImpl();    
+        void ConstructL();
+    
+    private: // Data
+    
+        CAlfTransitionServerClient* iServer;
+    };
+
+
+/**
+ *  CSrvCtrlImpl, implementation of MTransitionServerController
+ * 
+ *  Implements Tfx Server Plugin API interface, 
+ *  MTransitionServerController part. Does not contain any other logic
+ *  than mediate calls to concrete implementation of
+ *  CAlfTransitionServerController in TFXServer.
+ *
+ *  @lib TfxSrvPlugin.dll
+ *  @since 
+ */
+class CSrvCtrlImpl : public CBase, public MTransitionServerController
+    {
+    public: // Constructor
+    
+        static CSrvCtrlImpl* NewL( RWsSession& aWsSession );    
+        
+    private: // From MTransitionServerController
+        
+        TInt StartTransitionServer();
+        TInt StopTransitionServer();
+        TBool ServerRunning();
+        TInt StartTransitionServer(TInt32 aMaxBytesOngoing, TInt32 aMaxBytesBetween);
+        
+    private: 
+    
+        // to be deleted via MTransitionServer
+        ~CSrvCtrlImpl();   
+        void ConstructL( RWsSession& aWsSession );
+        
+    private:  // Data
+        CAlfTransitionServerController* iController;
+    };
+
+#endif // ALFTFXSRVPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/inc/alftransitionserver.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,447 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 API used by Theme server to control the
+*                appearence of transitions.
+*
+*/
+
+
+
+#ifndef R_TRANSITIONSERVER_H
+#define R_TRANSITIONSERVER_H
+
+#include <e32base.h>
+#include <gfxtranseffect/gfxtransdatatype.h>
+#include <alfdecoderserverclient.h>
+
+class CWaitingTimer;
+class TParse;
+
+/**
+ *  transition control interface.
+ *
+ *  This class is used to control transition appearence and behaviour
+ *  in the KML transition server.
+ *
+ *  @since S60 3.2
+ */
+class CAlfTransitionServerClient : public CBase
+	{
+	//the Shutdown() should only be called from within the CTransitionServerController.
+	//This makes sure that is true.
+	friend class CAlfTransitionServerController;
+public:
+    /**
+     * The different list types that can be configured with different KML. 
+     */
+    enum TListBoxType
+        {
+        /**
+         * The default alternative: Use this one to register KML for all
+         * kinds of list.
+         */
+        EListTypeAny,
+        
+        /**
+         * Main pane lists and 1-column grids.
+         */
+        EListTypeMainPane,
+        
+        /**
+         * Options menu and lists in popups.
+         */
+        EListTypeMenuPaneOrPopup,
+        
+        /**
+         * Lists in settings pages.
+         */
+        EListTypeSettingPage,
+        
+        /**
+         * Grids with more than one column.
+         */
+        EListTypeGrid
+        };
+
+	/**
+     * default constructor
+     *
+     * @since S60 3.2
+     */
+	CAlfTransitionServerClient();
+	
+	/**
+     * default destructor
+     *
+     * @since S60 3.2
+     */
+	~CAlfTransitionServerClient();
+	
+	/**
+     * connects to the transition server.
+     *
+     * @since S60 3.2
+     * @return KErrNone if successful, otherwise another of the system-wide error codes.
+     */
+	TInt Connect();
+	
+	/**
+     * disconnects from the transition server
+     *
+     * @since S60 3.2
+     */
+	void Disconnect();
+	
+	/**
+     * Registers the KML file and resource directory to be used by a fullscreen effect.
+     * The KML file and resource directory will be used for fullscreen effects with 
+     * the corresponding aActionID and aUid. KNullUid will be treated as the "default" 
+     * Uid - fullscreen effects that supply a not registered Uid will use the KML file 
+     * associated with <aActionId, KNullUid>
+     * Any aActionID that has not got a KML file associated to it, will be treated as
+     * "unsupported".
+     * If a <aActionId, aUid> pair is registered with aFilename a length zero the pair will be 
+     * treated as "unsupported" even if there is a default filename for the aActionId
+     *
+     * @since S60 3.2
+     * @param aActionID the fullscreen effect ID to associate this kml file with.
+     * @param aUid the TUid to associate the kml with, KNullUid as default
+     * @param aResourceDir the resource directory
+     * @param aFilename the kml file to use, must be relative the resource directory.
+     * @return KErrNone if successful, otherwise another of the system-wide error codes.
+     */
+	TInt RegisterFullscreenKml(TUint aActionID, const TUid& aUid, const TDesC& aResourceDir, 
+										const TDesC& aFilename);
+	
+	/**
+     * tells transition server to remove the KML for a specific fullscreen effect, 
+     * from now treating it as "unsupported"
+     *
+     * @since S60 3.2
+     * @param aActionId the fullscreen effect ID to remove KML from.
+     * @param aUid the Uid.
+     * @return KErrNone if successful, otherwise another of the system-wide error codes.
+     */
+	TInt UnregisterFullscreenKml(TUint aActionID, const TUid& aUid);
+	
+	/**
+     * Blocks all fullscreen transitions with a certain Uid independently of the actionId
+     * Transitions can be blocked both when doing a fullscreen effect from the Uid and when 
+     * doing a fullscreen effect to the Uid.
+     * The blocking of a Uid can be removed by setting aBlockFrom and aBlockTo to EFalse.
+     *	
+     * @since S60 3.2
+     * @param aUid the TUid that should be blocked 
+     * @param aBlockFrom ETrue if transitions should be blocked when doing a transition from the Uid.
+     * @param aBlockTo ETrue if transitions should be blocked when doing a transition to the Uid.
+     * @return KErrNone if successful, otherwise another of the system-wide error codes.
+     */    
+	TInt BlockFullScreenUid(const TUid& aUid, TBool aBlockFrom, TBool aBlockTo);
+	
+	/**
+     * Registers the KML file and resource directory to be used for a control transition.
+     * The KML file and resource directory will be used for control transitions with 
+     * the corresponding aUid.
+     * Any aUid that has not got a KML file associated to it, will be treated as
+     * "unsupported"
+     * If you register a KML file on a previously registered uid, the old KML will
+     * be automaticly unregistered, and its actions removed.
+     *
+     * @since S60 3.2
+     * @param aUid the TUid to associate the kml with
+     * @param aResourceDir the resource directory
+     * @param aFilename the kml file to use, must be relative the resource directory.
+     * @return KErrNone if successful, otherwise another of the system-wide error codes.
+     */    
+	TInt RegisterControlKml(const TUid &aUid, const TDesC& aResourceDir, const TDesC& aFilename);
+
+	/**
+     * Registers the KML file and resource directory to be used for a control transition.
+     * The KML file and resource directory will be used for control transitions with 
+     * the corresponding aUid.
+     * Any aUid that has not got a KML file associated to it, will be treated as
+     * "unsupported"
+     * If you register a KML file on a previously registered uid, the old KML will
+     * be automaticly unregistered, and its actions removed.
+     *
+     * @since S60 3.2
+     * @param aUid the TUid to associate the kml with
+     * @param aResourceDir the resource directory
+     * @param aFilename the kml file to use, must be relative the resource directory.
+     * @param aWantedTime Specifies the wanted time between frames for this control effect.
+     			If below zero the default wanted time will be used.
+     * @param aMinTime Specifies the minimum allowed time between frames for this control effect.
+     			If below zero the default minimum time will be used.
+     * @return KErrNone if successful, otherwise another of the system-wide error codes.
+     */    
+	TInt RegisterControlKml(const TUid &aUid, const TDesC& aResourceDir, const TDesC& aFilename,
+									 TInt aWantedTime, TInt aMinTime);
+
+  	/**
+     * Unregisters all of KML files and resource directory for the current thread.
+     *
+     * @since S60 3.2
+     * 
+     * @return KErrNone if successful, otherwise another of the system-wide error codes.
+     */ 
+  	TInt UnregisterAllKml();
+  	
+  	/**
+     * Unregisters the KML file and resource directory for a control transition.
+     * The Uid will not have any KML file associated with it.
+     * This also unregisters all control actions that have been registered for this
+     * Uid. 
+     *
+     * @since S60 3.2
+     * @param aUid the Uid to unregister
+     * @return KErrNone if successful, otherwise another of the system-wide error codes.
+     */ 
+  	TInt UnregisterControlKml(const TUid &aUid);
+  
+  	/**
+     * Registers an action string to be used with a <aUid, aActionID> pair for a control 
+     * transition. 
+     * When a control transition is started the TfxServer will use the KML file
+     * registered with the Uid. The TfxServer will then use the aUid and aActionId to find
+     * the corresponding aActionString. The TfxServer will then run the action in the KML file
+     * with the name aActionString.
+     *
+     * The registration will fail if there isn't a KML file registered with the Uid.
+     *
+     * @since S60 3.2
+     * @param aUid the Uid that will be sent through the GfxTransEffect API
+     * @param aActionID the actionID that will be sent through the GfxTransEffect API
+     * @param aActionString the name of the action in the KML file
+     * @return KErrNone if successful, otherwise another of the system-wide error codes.
+     */    
+	TInt RegisterControlAction(const TUid& aUid, TUint aActionID, const TDesC& aActionString);
+
+  	/**
+     * Unregisters a aActionString from a <aUid, aActionID> pair. This means that there will not be
+     * any transitions for the specified <aUid, aActionId> pair. 
+     *
+     * @since S60 3.2
+     * @param aUid the Uid
+     * @param aActionId the ActionId
+     * @return KErrNone if successful, otherwise another of the system-wide error codes.
+     */    
+	TInt UnregisterControlAction(const TUid& aUid, TUint aActionID);
+
+	/**
+     * Sets wanted time between frames.
+     * @since S60 3.2
+     *
+     * @param aTime. Time in milliseconds (0-99).
+     * @return KErrNone or any of the system error codes.
+    */  
+	TInt SetWantedTime(TInt aTime);
+
+	/**
+     * Sets minimum allowed time between frames.
+     * @since S60 3.2
+     *
+     * @param aTime. Time in milliseconds (0-99).
+     * @return KErrNone or any of the system error codes.
+    */  
+	TInt SetMinTime(TInt aTime);
+
+	/**
+     * Registers the KML file and resource directory to be used by a fullscreen effect.
+     * The KML file and resource directory will be used for fullscreen effects with 
+     * the corresponding aActionID and aUid. KNullUid will be treated as the "default" 
+     * Uid - fullscreen effects that supply a not registered Uid will use the KML file 
+     * associated with <aActionId, KNullUid>
+     * Any aActionID that has not got a KML file associated to it, will be treated as
+     * "unsupported".
+     * If a <aActionId, aUid> pair is registered with aFilename of length zero the pair will be 
+     * treated as "unsupported" even if there is a default filename for the aActionId
+     *
+     * @since S60 3.2
+     * @param aActionID the fullscreen effect ID to associate this kml file with.
+     * @param aUid the TUid to associate the kml with, KNullUid as default
+     * @param aResourceDir the resource directory
+     * @param aFilename the kml file to use, must be relative the resource directory.
+     * @param aCachePriority The priority of the resources for this fullscreen effect in the cache.
+     			(higher numbers have higher priority). If below zero the default priority will be used.
+     * @param aWantedTime Specifies the wanted time between frames for this fullscreen effect.
+     			If below zero the default wanted time will be used.
+     * @param aMinTime Specifies the minimum allowed time between frames for this fullscreen effect.
+     			If below zero the default minimum time will be used.
+     * @return KErrNone if successful, otherwise another of the system-wide error codes.
+     */
+	TInt RegisterFullscreenKml(TUint aActionID, const TUid& aUid, const TDesC& aResourceDir, 
+										const TDesC& aFilename, TInt aCachePriority, TInt aWantedTime,
+										TInt aMinTime);
+
+	/**
+	 * Register the KML files and resource directory to be used by a listbox.
+	 * The KML files and resource directory will be used for listboxes of the specified type
+     * in the process with the Uid aUid.
+     *
+     * KNullUid will be treated as the "default" Uid - listboxes in processes
+	 * with no KML registered for their uid will use KML registered with KNullUid.
+	 * EListTypeAny works the same way for listbox types.  More specific settings have 
+     * priority over less specific ones, and the uid has higher priority than the list type,
+     * which means that when assigning KML to a specific listbox, the search for KML is
+     * done in the following order:
+     *
+     * 1. KML that has been registered with the uid of the listbox' app and with the
+     *    listbox type that matches the specific listbox.
+     * 2. KML that has been registered with the uid of the listbox' app, with type EListTypeAny.
+     * 3. KML that has been registered with KNullUid and with the matching listbox type.
+     * 4. KML that has been registered with KNullUid and EListTypeAny.
+     *
+	 * If a Uid is registered with aBackgroundFileName of length zero this Uid will be treated as
+	 * having no effect, even if there is a "default" Uid. 
+	 *
+	 * @since S60 v3.1
+	 * @param aUid the TUid to associate the kml files with, KNullUid as default
+     * @param aListBoxType the type of listbox to associate the KML files with,
+     *        EListTypeAny to associate it with any type of list.
+	 * @param aResourceDir the resource directory
+	 * @param aBackgroundFileName the kml file to use for the background and highlight of the listbox, 
+	 		  must be relative the resource directory.
+	 * @param aListItemFilename the kml file to use for the listitems of the listbox, 
+	 		  must be relative the resource directory.
+	 * @return KErrNone if successful, otherwise another of the system-wide error codes.
+	 */
+	TInt RegisterListBoxKml(const TUid& aUid, const TListBoxType aListBoxType, 
+                                     const TDesC& aResourceDir, 
+									 const TDesC& aBackgroundFilename, 
+									 const TDesC& aListItemFilename);
+
+	/**
+	 * Unregisters KML files previously registered for a listbox.
+	 *
+	 * @since S60 S60 v3.1
+	 * @param aUid the Uid to unregisted KML files for.
+     * @param aListBoxType The listbox type to unregister KML files for.
+	 * @return KErrNone if successful, otherwise another of the system-wide error codes.
+	 */    
+	TInt UnregisterListBoxKml(const TUid& aUid, const TListBoxType aListBoxType);
+
+    /**
+     * Set the wanted time per frame for listbox effects.
+     *
+     * @param aWantedTime The wanted time per frame, in milliseconds.
+     * 
+     * @return KErrNone on success, or one of the system-wide error codes.
+     */
+    TInt SetListBoxFrameTime( const TInt aWantedTime );
+    
+    /**
+     * Set the minimum time per frame for listbox effects.
+     *
+     * @param aMinFrameTime The minimum time per frame, in milliseconds.
+     *
+     * @return KErrNone on success, or ome of the system-wide error codes.
+     */    
+    TInt SetListBoxMinFrameTime( const TInt aMinFrameTime );
+
+    /**
+     * Set the wanted time per frame for listbox effects.
+     *
+     * @param aWantedTime The wanted time per frame, in milliseconds.
+     * 
+     * @return KErrNone on success, or one of the system-wide error codes.
+     */
+    TInt SetControlFrameTime( const TInt aWantedTime );
+    
+    /**
+     * Set the minimum time per frame for listbox effects.
+     *
+     * @param aMinFrameTime The minimum time per frame, in milliseconds.
+     *
+     * @return KErrNone on success, or ome of the system-wide error codes.
+     */    
+    TInt SetControlMinFrameTime( const TInt aMinFrameTime );
+
+	/**
+     * Checks if the system is connected.
+     * @since S60 3.2
+     *
+     * @return ETrue if connected, otherwise EFalse.
+    */  
+    TBool IsConnected();
+    
+    /**
+     * Switch Tfx Server working on low memory mode from good memory mode.
+     * 
+     * @since S60 3.2
+     * 
+     * @return KErrNone if successful, otherwise another of the system-wide error codes.
+     */ 
+  	TInt FreeRam();
+  	
+  	/**
+     * Switch Tfx Server working on good memory mode from low memory mode.
+     *
+     * @since S60 3.2
+     * 
+     * @return KErrNone if successful, otherwise another of the system-wide error codes.
+     */ 
+  	TInt MemoryGood();
+  	
+  	
+private:
+	/**
+	 * Verifies that server really is alive.
+	 * @since S60 3.2
+	 *
+	 * @return KErrNone if alive, otherwise any of the system error codes.
+	 */
+	TInt VerifyConnection();
+
+	/**
+     * shuts down the server. Not to be called by other then the transitionservercontroller
+     * @since S60 3.2
+     *
+     * @return KErrNone or any of the system error codes.
+    */  
+    TInt Shutdown(TThreadId& aServerId);
+
+    /**
+     * @see RegisterListBoxKml
+     */
+	TInt RegisterListBoxKmlL(const TUid& aUid, const TListBoxType aListBoxType, 
+                             const TDesC& aResourceDir, 
+                             const TDesC& aBackgroundFilename, 
+                             const TDesC& aListItemFilename);
+	
+	/**
+	 * Only needed to allow finding effect files on different drives
+	 */
+	TInt FindEffectFile( const TDesC& aResourceDir, const TDesC& aFilename ); 
+
+                             
+private: // data
+    
+   	RAlfTfxClient iTfxServer;
+	TUid iPluginImplementation;
+	TBool iConnected;
+	TBool iHasPlugin;
+	// We keep these as members to avoid allocating and deallocating memory all the time
+	HBufC8* iTransferBuffer;
+	HBufC8* iReturnBuffer;
+	// RFs, filename and parse are needed only to allow overriding the drive definition
+	// from the manifest file
+    RFs iFs; // file system
+    TParse iParse; // for parsing filename locations
+	RFile iFile;
+	};
+	
+	
+#endif // R_TRANSITIONSERVER_H
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/inc/alftransitionservercontroller.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,153 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Class used to start and stop the TFX Server
+*
+*/
+
+
+#ifndef C_TRANSITIONSERVERCONTROLLER_H
+#define C_TRANSITIONSERVERCONTROLLER_H
+
+#include <e32base.h>
+#include <w32std.h>
+#include <mtransitionserver.h>
+#include <alfdecoderserverclient.h>
+
+#include "alfpsobserver.h"
+
+class RTfxServerInjector;
+class CWsEventEater;
+class CAlfPsObserver;
+class CRepository;
+
+/**
+ * transition effect server controller
+ * 
+ * this class is used to load and start the TfxServer into the wserv process.
+ * The code is loaded into the wserv through a CAnimDll wserv plugin.
+ * because of this, when this class is destroyed, the TfxServer thread will be killed.
+ */
+ 
+// MPsObserver will probably not bee needed - to be removed later
+NONSHARABLE_CLASS(CAlfTransitionServerController) : public CBase,
+								   		 public MPsObserver
+    {
+public:
+	friend class CAlfTransitionServerClient;
+
+	/**
+     * Public part of two phase construction.
+     * @since S60 3.2
+     *
+     * @param Reference to a Window server session.
+     * @return Pointer to the newly created CAlfTransitionServerController object.
+    */  
+    static CAlfTransitionServerController* NewL(RWsSession& /*aWsSession*/);
+
+	/**
+     * Destructor
+     * @since S60 3.2
+     *
+    */  
+    virtual ~CAlfTransitionServerController();
+
+	/**
+     * Start the transition server
+     * @since S60 3.2
+     *
+     * @return KErrNone or any of the system error codes.
+    */  
+    TInt StartTransitionServer();
+
+	/**
+     * Gracefully shut down the transition server.
+     * @since S60 3.2
+     *
+     * @return KErrNone or any of the system error codes.
+    */  
+    TInt StopTransitionServer();
+
+	/**
+     * Checks to see if server is running.
+     * @since S60 3.2
+     *
+     * @return ETrue if server is running, otherwise EFalse.
+    */  
+    TBool ServerRunning();
+    
+   	/**
+     * Start the transition server
+     * @since S60 3.2
+     * 
+     * Starts the server with different values for MaxBytesOngoing and 
+     * MaxBytesBetween than the default ones. 
+     * MaxBytesOngoing is the maximum amount of bytes that may be cached while a transition
+     * is ongoing. If this value is less than the total size of the 
+	 * decoded images in the effect the images has to be decoded every 
+	 * frame which will have a huge impact on performance. 
+     *
+     * MaxBytesBetween is the maximum amount of bytes that may be cached when a transition
+	 * is not ongoing.
+	 *
+     * @param aMaxBytesOngoing maximum bytes in cache during a transition  	   
+     * @param aMaxBytesBetween maximum bytes in cache between transitions
+     * @return KErrNone or any of the system error codes.
+    */  
+    TInt StartTransitionServer(TInt32 aMaxBytesOngoing, TInt32 aMaxBytesBetween);
+   
+    static TInt ConnectionCallback( TAny* aParameter );
+   
+    TInt ConnectionAttempt();
+    
+  	void PsValueUpdated( const TUid aCategory, const TUint aKey, const TInt aVal );
+  	
+  	
+
+private:
+
+	/**
+     * Private part of two phase construction.
+     *
+    */  
+    void ConstructL();
+
+	/**
+     * Private constructor.
+    */  
+    CAlfTransitionServerController();
+    
+
+    
+private: // data
+
+    CAlfPsObserver* iPsObserver;
+    
+    // The public and subscribe value keeping track if server is running
+    TInt iTransitionControlValue;
+    
+    // The value in central repository to keep track if effects are allowed
+    TInt iEffectValue;
+    
+    CRepository* iRepository;
+    
+   	RAlfTfxClient iTfxServer;
+   	TBool iIsConnected;
+   	
+   	CPeriodic* iTimer;
+   	TBool iTimerRunning;
+
+    };
+
+
+#endif //C_TRANSITIONSERVERCONTROLLER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/src/10282DBA.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 1028 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ECOM Resource file for TfxSrvPlugin
+*
+*/
+
+
+#include <registryinfov2.rh>
+
+// UIDs for this plugin
+// these are defined in include\oem\TfxSrvEcomIds.h
+//
+// ECOM DLL UID:				0x10282DBA
+// TfxSrvPlugin interface UID:	0x10282DBB
+// MTransitionServer Implementation:	0x10282DBC 
+// MTransitionServerController Implementation:	0x10282DBD 
+
+
+// ---------------------------------------------------------------------------
+// Registration info for ECOM framework.
+// ---------------------------------------------------------------------------
+//
+RESOURCE REGISTRY_INFO theInfo
+    {
+    resource_format_version = RESOURCE_FORMAT_VERSION_2; 
+    dll_uid = 0x10282DBA;
+    interfaces = 
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = 0x10282DBB;
+            implementations = 
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10282DBC;
+                    version_no = 1;
+                    display_name = "RTransitionServer";
+                    default_data = "";
+                    opaque_data = "";
+                    },
+                
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x10282DBD;
+                    version_no = 1;
+                    display_name = "CTransitionServerController";
+                    default_data = "";
+                    opaque_data = "";
+                    }
+                };
+                        
+            }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/src/alfpsobserver.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,112 @@
+/*
+* 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: 
+*
+*/
+
+#include <e32property.h>
+#include <alflogger.h>
+#include "alfpsobserver.h"
+
+//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+//
+CAlfPsObserver* CAlfPsObserver::NewL( MPsObserver* aClient, const TUid aCategory, 
+    const TUint aKey )
+    {
+    __ALFFXLOGSTRING("CAlfPsObserver::NewL >>");
+    CAlfPsObserver* self = new ( ELeave ) CAlfPsObserver( aClient, aCategory, aKey);
+    CleanupStack::PushL( self );
+    self->Construct( aCategory, aKey );
+    CleanupStack::Pop();
+    __ALFFXLOGSTRING("CAlfPsObserver::NewL <<");
+    return self;
+    }
+
+//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+//
+CAlfPsObserver* CAlfPsObserver::New( MPsObserver* aClient, const TUid aCategory, 
+    const TUint aKey )
+    {
+    __ALFFXLOGSTRING("CAlfPsObserver::New >>");
+    CAlfPsObserver* self = new CAlfPsObserver( aClient, aCategory, aKey);
+    if(self)
+    	{
+	    self->Construct( aCategory, aKey );
+    	}
+    __ALFFXLOGSTRING("CAlfPsObserver::New <<");
+    return self;
+    }
+    
+//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+//
+CAlfPsObserver::~CAlfPsObserver()
+    {
+    __ALFFXLOGSTRING("CAlfPsObserver::~CAlfPsObserver >>");
+    Cancel();
+    iProperty.Close();
+    __ALFFXLOGSTRING("CAlfPsObserver::~CAlfPsObserver <<");
+    }
+    
+//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+//
+void CAlfPsObserver::DoCancel()
+    {
+    __ALFFXLOGSTRING("CAlfPsObserver::DoCancel >>");
+    iProperty.Cancel();
+    __ALFFXLOGSTRING("CAlfPsObserver::DoCancel <<");
+    }
+    
+//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+//
+void CAlfPsObserver::RunL()
+    {
+    __ALFFXLOGSTRING1("CAlfPsObserver::RunL - iStatus: %d ", iStatus.Int());
+    if ( iStatus.Int() == KErrNone)
+        {
+        TInt val;
+        iProperty.Subscribe( iStatus );
+        iProperty.Get( val );
+        iClient->PsValueUpdated( iCategory, iKey, val );
+        SetActive();
+        }
+    }
+
+
+//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+//
+void CAlfPsObserver::Construct( const TUid aCategory, const TUint aKey )
+    {
+    __ALFFXLOGSTRING("CAlfPsObserver::Construct >>");
+    CActiveScheduler::Add( this );
+    iProperty.Attach( aCategory, aKey );
+    iProperty.Subscribe( iStatus );
+    SetActive();
+    __ALFFXLOGSTRING("CAlfPsObserver::Construct <<");
+    }
+
+//----------------------------------------------------------------------------
+//----------------------------------------------------------------------------
+//
+CAlfPsObserver::CAlfPsObserver( MPsObserver* aClient, const TUid aCategory,
+                          const TUint aKey )
+    : CActive( EPriorityStandard ), iClient( aClient ),
+      iCategory( aCategory ), iKey( aKey )
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/src/alftfxsrvplugin.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,249 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Implementation of tfxsrvplugin
+*
+*/
+
+
+
+#include <ecom/implementationproxy.h>
+#include <TfxSrvEcomIds.h>
+#include <alflogger.h>
+#include "alftfxsrvplugin.h"
+#include "alftransitionserver.h"
+#include "alftransitionservercontroller.h"
+      
+      
+// Methods called by ECOM
+MTransitionServer* TfxSrvPlugin::CreateTransitionServerL()
+	{
+	__ALFFXLOGSTRING("TfxSrvPlugin::CreateTransitionServerL >>");
+	return CSrvImpl::NewL();
+	}
+
+MTransitionServerController* TfxSrvPlugin::CreateTransitionServerControllerL(
+TAny* aInitParams )
+	{
+	    
+	RWsSession* wsSession = (RWsSession*) aInitParams;
+	return CSrvCtrlImpl::NewL( *wsSession );
+	}  
+   
+// ======== ECOM INITIALIZATION ========
+
+// Map the interface UIDs to implementation factory functions
+const TImplementationProxy ImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY( KTfxSrvEcomImpl, TfxSrvPlugin::CreateTransitionServerL ),
+    IMPLEMENTATION_PROXY_ENTRY( KTfxSrvCtrlEcomImpl, TfxSrvPlugin::CreateTransitionServerControllerL ),
+    };
+
+// ---------------------------------------------------------
+// Exported proxy for instantiation method resolution
+// ---------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+    return ImplementationTable;
+    }
+
+// CSrvImpl implementation 
+
+CSrvImpl* CSrvImpl::NewL()
+    {
+    __ALFFXLOGSTRING("CSrvImpl::NewL >>");
+    CSrvImpl* self = new (ELeave)CSrvImpl();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(); //self;
+    __ALFFXLOGSTRING("CSrvImpl::NewL <<");
+    return self;
+    }
+    
+TInt CSrvImpl::Connect()
+    {
+    return iServer->Connect();
+    }
+
+void CSrvImpl::Disconnect()
+    {
+    iServer->Disconnect();
+    }
+
+TInt CSrvImpl::RegisterFullscreenKml(TUint aActionID, const TUid& aUid, const TDesC& aResourceDir, 
+								const TDesC& aFilename)
+    {
+    return iServer->RegisterFullscreenKml(aActionID, aUid, aResourceDir, aFilename);
+    }
+								
+TInt CSrvImpl::UnregisterFullscreenKml(TUint aActionID, const TUid& aUid)
+    {
+    return iServer->UnregisterFullscreenKml(aActionID, aUid);
+    }
+    
+TInt CSrvImpl::UnregisterAllKml()
+	{
+	return iServer->UnregisterAllKml();
+	}
+
+TInt CSrvImpl::BlockFullScreenUid(const TUid& aUid, TBool aBlockFrom, TBool aBlockTo)
+    {
+    return iServer->BlockFullScreenUid(aUid, aBlockFrom, aBlockTo);
+    }
+
+TInt CSrvImpl::RegisterControlKml(const TUid &aUid, const TDesC& aResourceDir, const TDesC& aFilename)
+    {
+    return iServer->RegisterControlKml(aUid, aResourceDir, aFilename);
+    }
+    
+TInt CSrvImpl::RegisterControlKml(const TUid &aUid, const TDesC& aResourceDir, const TDesC& aFilename, 
+								  TInt aWantedTime, TInt aMinTime)
+    {
+    return iServer->RegisterControlKml(aUid, aResourceDir, aFilename, aWantedTime, aMinTime);
+    }
+
+TInt CSrvImpl::UnregisterControlKml(const TUid &aUid)
+    {
+    return iServer->UnregisterControlKml(aUid);   
+    }
+
+TInt CSrvImpl::RegisterControlAction(const TUid& aUid, TUint aActionID, const TDesC& aActionString)
+    {
+    return iServer->RegisterControlAction(aUid, aActionID, aActionString);
+    }
+
+TInt CSrvImpl::UnregisterControlAction(const TUid& aUid, TUint aActionID)
+    {
+    return iServer->UnregisterControlAction(aUid, aActionID);
+    }
+
+TInt CSrvImpl::SetWantedTime(TInt aTime)
+    {
+    return iServer->SetWantedTime(aTime);
+    }
+
+TInt CSrvImpl::SetMinTime(TInt aTime)
+    {
+    return iServer->SetMinTime(aTime);
+    }
+
+TInt CSrvImpl::RegisterFullscreenKml(TUint aActionID, const TUid& aUid, const TDesC& aResourceDir, 
+								const TDesC& aFilename, TInt aCachePriority, TInt aWantedTime,
+								TInt aMinTime)
+    {
+    return iServer->RegisterFullscreenKml(aActionID, aUid, aResourceDir, 
+								aFilename, aCachePriority, aWantedTime,
+								aMinTime);
+    }
+
+TInt CSrvImpl::RegisterListBoxKml(const TUid& aUid, const /*TListBoxType*/ TInt aListBoxType, 
+                             const TDesC& aResourceDir, 
+							 const TDesC& aBackgroundFilename, 
+							 const TDesC& aListItemFilename)
+    {
+    return iServer->RegisterListBoxKml( aUid, 
+                                    (CAlfTransitionServerClient::TListBoxType)aListBoxType, 
+                                    aResourceDir, 
+                                    aBackgroundFilename,
+                                    aListItemFilename );
+                                                                   
+    }
+
+TInt CSrvImpl::UnregisterListBoxKml(const TUid& aUid, const /*TListBoxType*/ TInt aListBoxType)
+    {
+    return iServer->UnregisterListBoxKml( aUid, (CAlfTransitionServerClient::TListBoxType)aListBoxType );
+    }
+
+TInt CSrvImpl::SetListBoxFrameTime( const TInt aWantedTime ) 
+	{
+	return iServer->SetListBoxFrameTime(aWantedTime);
+	}
+
+TInt CSrvImpl::SetListBoxMinFrameTime( const TInt aMinFrameTime ) 
+	{
+	return iServer->SetListBoxMinFrameTime(aMinFrameTime);
+	}
+
+TInt CSrvImpl::SetControlFrameTime( const TInt aWantedTime ) 
+	{
+	return iServer->SetControlFrameTime(aWantedTime);
+	}
+
+TInt CSrvImpl::SetControlMinFrameTime( const TInt aMinFrameTime ) 
+	{
+	return iServer->SetControlMinFrameTime(aMinFrameTime);
+	}
+	
+TBool CSrvImpl::IsConnected()
+    {
+    return iServer->IsConnected();
+    }
+
+CSrvImpl::~CSrvImpl()
+    {
+    if ( iServer )
+        {
+        iServer->Disconnect();
+        }
+    delete iServer;    
+    }
+
+void CSrvImpl::ConstructL()
+    {
+    iServer = new( ELeave ) CAlfTransitionServerClient();
+    }
+
+
+// CSrvCtrlImpl implementation
+
+CSrvCtrlImpl* CSrvCtrlImpl::NewL( RWsSession& aWsSession )
+    {
+    CSrvCtrlImpl* self = new (ELeave)CSrvCtrlImpl();
+    CleanupStack::PushL(self);
+    self->ConstructL( aWsSession );
+    CleanupStack::Pop(); //self;
+    return self;
+    }
+
+TInt CSrvCtrlImpl::StartTransitionServer()
+    {
+    return iController->StartTransitionServer();
+    }
+
+TInt CSrvCtrlImpl::StopTransitionServer()
+    {
+    return iController->StopTransitionServer();
+    }
+
+TBool CSrvCtrlImpl::ServerRunning()
+    {
+    return iController->ServerRunning();
+    }
+
+TInt CSrvCtrlImpl::StartTransitionServer(TInt32 aMaxBytesOngoing, TInt32 aMaxBytesBetween)
+    {
+    return iController->StartTransitionServer(aMaxBytesOngoing, aMaxBytesBetween);
+    }
+
+CSrvCtrlImpl::~CSrvCtrlImpl()
+    {
+    delete iController;
+    }
+
+void CSrvCtrlImpl::ConstructL( RWsSession& aWsSession )
+    {
+    iController = CAlfTransitionServerController::NewL( aWsSession );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/src/alftransitionserver.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1226 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 implementation of the API used by theme server
+*                to control transition appearance.
+*
+*/
+
+
+
+#include <s32mem.h>
+#include <TfxSrvEcomIds.h>
+#include <f32file.h>
+
+#include <alf/AlfTransEffectPlugin.h>
+#include <mtransitionservercontroller.h>
+#include "alftfxserverdef.h"
+#include "alftransitionserver.h"
+#include "alflogger.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CAlfTransitionServerClient::CAlfTransitionServerClient():
+iPluginImplementation( TUid::Null() )
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::CAlfTransitionServerClient - starting");
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CAlfTransitionServerClient::~CAlfTransitionServerClient()
+	{
+	// We don't unload plugin here, we let CGfxTransAdapterTfx keep it.
+	// Maybe CGfxTransAdapterTfx should not unload it either?
+	// We assume that when two clients tell RAlfTfxClient to load the plugin,
+	// we always get the same instance of the plugin as it is loaded in the
+	// server side and runs in the server thread.
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::~CAlfTransitionServerClient >>");
+	iTfxServer.Close();
+	iConnected = EFalse;
+	iHasPlugin = EFalse;
+	delete iTransferBuffer;
+	delete iReturnBuffer;
+	iFs.Close();
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::~CAlfTransitionServerClient <<");
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::Connect()
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::Connect >>");
+	TInt err = KErrNone;
+	TInt fsErr = KErrNone;
+	if ( !iTransferBuffer )
+	    {
+        iTransferBuffer = HBufC8::New( 1024 );
+	    }
+	if ( !iReturnBuffer )
+	    {
+	    // This is actually not used for anything
+        iReturnBuffer = HBufC8::New( 10 );
+	    }
+	    
+	if ( !iTransferBuffer || !iReturnBuffer )
+	    {
+	    __ALFFXLOGSTRING("CAlfTransitionServerClient::Connect - return KErrNoMemory");
+	    return KErrNoMemory;
+	    }
+
+	if ( iPluginImplementation == TUid::Null() )
+	    {
+        RImplInfoPtrArray pluginArray;
+        TRAP( err, REComSession::ListImplementationsL( KAlfGfxPluginInterfaceUId, pluginArray ) );
+    	if ( pluginArray.Count() > 0 )
+    	    {
+    	    iPluginImplementation = pluginArray[0]->ImplementationUid();
+    	    }
+	    }
+	
+	if( !iConnected )
+	    {
+        err = iTfxServer.Open();	
+        if ( err == KErrNone )
+            {
+            iConnected = ETrue;
+            }
+	    }
+	    
+	if ( iConnected && !iHasPlugin )
+	    {
+        if( iPluginImplementation != TUid::Null() )
+            {
+            err = iTfxServer.LoadTfxPlugin( iPluginImplementation );
+            // 
+            if ( err == KErrNone || err == KErrAlreadyExists )
+                {
+                iHasPlugin = ETrue;
+                err = KErrNone;
+                // RFs is needed only to allow replacing drive given in manifest file
+                fsErr = iFs.Connect();
+                }
+            __ALFFXLOGSTRING("CAlfTransitionServerClient Has Plugin!");
+            }
+	    }
+	// We lie about the result.
+	// At the time being starting alf is taking way too long.
+	// We must retry later. 
+	// We only return error if all is well except we cannot connect to the file server
+   
+	__ALFFXLOGSTRING1("CAlfTransitionServerClient::Connect - return %d ", fsErr);
+	return fsErr;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CAlfTransitionServerClient::Disconnect() 
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::Disconnect >>");
+	iTfxServer.Close();
+	iConnected = EFalse;
+	iHasPlugin = EFalse;
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::Disconnect <<");
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::Shutdown(TThreadId& /*aThreadId*/)
+    {
+    __ALFFXLOGSTRING("CAlfTransitionServerClient::Shutdown >>");
+    // we don't have a separate server to shut down as our server side
+    // is actually alf. only the plugin could be destroyed.
+    Disconnect();
+    __ALFFXLOGSTRING("CAlfTransitionServerClient::Shutdown <<");
+	return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// Checks if the system is connected.
+// ---------------------------------------------------------------------------
+//
+TBool CAlfTransitionServerClient::IsConnected()
+	{
+	__ALFFXLOGSTRING1("CAlfTransitionServerClient::IsConnected - return %d", iHasPlugin);
+	// We are not properly connected unless we also have managed to load the plugin
+	return iHasPlugin;	
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::RegisterFullscreenKml(	TUint aActionID, const TUid& aUid,
+														const TDesC& aResourceDir,
+														const TDesC& aFilename )
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::RegisterFullscreenKml >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+   
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	RThread me;
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpAddFullscreenKML;
+    err =  FindEffectFile( aResourceDir, aFilename ); 
+	TRAP( err, 
+	    {
+	    inBuf.WriteInt32L( op );
+		inBuf.WriteUint32L( aActionID );
+		inBuf.WriteInt32L( aUid.iUid );
+		TUint64 id = me.Id();
+		TUint8* ptr = reinterpret_cast<TUint8*>( &id );
+		inBuf.WriteL( ptr, 8 );
+//		inBuf << aResourceDir;
+        inBuf << iParse.DriveAndPath();
+		inBuf << aFilename;
+        inBuf.CommitL();
+		});
+		
+	inBuf.Release();
+	inBuf.Close();	
+	
+	if ( err == KErrNone )
+	    {
+        err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+	    }
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::RegisterFullscreenKml - return %d <<", err);
+    return err;
+	}
+	 
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::UnregisterFullscreenKml(TUint aActionID, const TUid& aUid)
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::UnregisterFullscreenKml >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	    
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpRemoveFullscreenKML;
+	// These writes cannot leave
+	TRAP_IGNORE(
+	    {
+	    inBuf.WriteInt32L( op );
+		inBuf.WriteUint32L( aActionID );
+		inBuf.WriteInt32L( aUid.iUid );
+        inBuf.CommitL();		
+		});
+	inBuf.Release();
+	inBuf.Close();	
+	
+    err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::UnregisterFullscreenKml - return %d ", err);
+    return err;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::RegisterListBoxKmlL(const TUid& aUid,
+                        const TListBoxType aListBoxType, const TDesC& aResourceDir,
+                        const TDesC& aBackgroundFilename, const TDesC& aListItemFilename)
+    {
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::RegisterListBoxKmlL >>");
+    TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	
+	RThread me;
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpListBoxRegisterKML;
+    err = FindEffectFile( aResourceDir, aBackgroundFilename );
+	TRAP( err, 
+	    {
+        inBuf.WriteInt32L( op );
+    	inBuf.WriteInt32L( aUid.iUid );
+    	TUint64 id = me.Id();
+    	TUint8* ptr = reinterpret_cast<TUint8*>( &id );
+    	inBuf.WriteL( ptr, 8 );
+        inBuf.WriteInt32L( ( TInt32 )aListBoxType );
+        inBuf << iParse.DriveAndPath();
+//    	inBuf << aResourceDir;
+    	inBuf << aBackgroundFilename;
+    	inBuf << aListItemFilename;
+        inBuf.CommitL();
+	    });
+    
+	inBuf.Release();
+	inBuf.Close();	
+	
+	if ( err == KErrNone )
+	    {
+        err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+	    }
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::RegisterListBoxKmlL return: %d ", err);
+    return err;
+    }
+
+TInt CAlfTransitionServerClient::RegisterListBoxKml(const TUid& aUid,
+                                 const TListBoxType aListBoxType, const TDesC& aResourceDir,
+                                 const TDesC& aBackgroundFilename, const TDesC& aListItemFilename)
+    {
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::RegisterListBoxKml >>");
+    TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+    TRAP( err, RegisterListBoxKmlL( aUid, aListBoxType, aResourceDir,
+                                     aBackgroundFilename, aListItemFilename ) );
+
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::RegisterListBoxKml - return %d ", err);
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::UnregisterListBoxKml(const TUid& aUid, const TListBoxType aListBoxType)
+    {
+    __ALFFXLOGSTRING("CAlfTransitionServerClient::UnregisterListBoxKml >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	    
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpListBoxUnregisterKML;
+	// These writes cannot leave
+	TRAP_IGNORE( 
+	    {
+	    inBuf.WriteInt32L( op );
+		inBuf.WriteInt32L( aUid.iUid );
+        inBuf.WriteInt32L( ( TInt32 )aListBoxType );
+        inBuf.CommitL();		
+		} );
+		
+	inBuf.Release();
+	inBuf.Close();	
+	
+    err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::UnregisterListBoxKml - return %d ", err);
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::SetListBoxFrameTime( const TInt aWantedTime )
+    {
+    __ALFFXLOGSTRING("CAlfTransitionServerClient::SetListBoxFrameTime >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	    
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpListBoxSetFrameTime;
+	// These writes cannot leave
+	TRAP_IGNORE( 
+	    {
+	    inBuf.WriteInt32L( op );
+		inBuf.WriteInt32L( aWantedTime );
+        inBuf.CommitL();		
+		} );
+	inBuf.Release();
+	inBuf.Close();	
+	
+    err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::SetListBoxFrameTime - return: %d <<", err);
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::SetListBoxMinFrameTime( const TInt aMinTime )
+    {
+    __ALFFXLOGSTRING("CAlfTransitionServerClient::SetListBoxMinFrameTime >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	    
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpListBoxSetMinFrameTime;
+	// These writes cannot leave
+	TRAP_IGNORE( 
+	    {
+	    inBuf.WriteInt32L( op );
+		inBuf.WriteInt32L( aMinTime );
+        inBuf.CommitL();		
+		} );
+	inBuf.Release();
+	inBuf.Close();	
+	
+    err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::SetListBoxMinFrameTime - return: %d <<", err );
+    return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::SetControlFrameTime( const TInt aWantedTime )
+    {
+    __ALFFXLOGSTRING("CAlfTransitionServerClient::SetControlFrameTime >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	    
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpControlSetFrameTime;
+	// These writes cannot leave
+	TRAP_IGNORE( 
+	    {
+	    inBuf.WriteInt32L( op );
+		inBuf.WriteInt32L( aWantedTime );
+        inBuf.CommitL();		
+		} );
+	inBuf.Release();
+	inBuf.Close();	
+	
+    err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::SetControlFrameTime - return: %d <<", err);
+    return err;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::SetControlMinFrameTime( const TInt aMinTime )
+    {
+    __ALFFXLOGSTRING("CAlfTransitionServerClient::SetControlMinFrameTime >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	    
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpControlSetMinFrameTime;
+	// These writes cannot leave
+	TRAP( err, 
+	    {
+	    inBuf.WriteInt32L( op );
+		inBuf.WriteInt32L( aMinTime );
+        inBuf.CommitL();		
+		} );
+	inBuf.Release();
+	inBuf.Close();	
+	
+    err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::SetControlMinFrameTime - return: %d <<", err );
+    return err;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::BlockFullScreenUid(const TUid& aUid, TBool aBlockFrom, TBool aBlockTo )
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::BlockFullScreenUid >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	    
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpBlockFullscreenUid;
+	// These writes cannot leave
+	TRAP_IGNORE( 
+	    {
+	    inBuf.WriteInt32L( op );
+		inBuf.WriteInt32L( aUid.iUid );
+		inBuf.WriteInt32L( aBlockFrom );
+		inBuf.WriteInt32L( aBlockTo );
+        inBuf.CommitL();		
+		} );
+	inBuf.Release();
+	inBuf.Close();	
+	
+    err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::BlockFullScreenUid - return: %d <<", err);
+    return err;
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::RegisterControlAction(	const TUid& aUid, TUint aActionID, 
+														const TDesC& aActionString )
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::RegisterControlAction >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	    
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpControlPolicyUpdate;
+	// These writes cannot leave
+	TRAP_IGNORE( 
+	    {
+	    inBuf.WriteInt32L( op );
+		inBuf.WriteInt32L( aUid.iUid );
+		inBuf.WriteUint32L( aActionID );
+		inBuf << aActionString;
+        inBuf.CommitL();		
+		} );
+	inBuf.Release();
+	inBuf.Close();	
+	
+    err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::RegisterControlAction - return: %d <<", err);
+    return err;
+	}
+	
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::UnregisterControlAction(const TUid& aUid, TUint aActionID )
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::UnregisterControlAction >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	    
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpControlPolicyRemove;
+	// These writes cannot leave
+	TRAP_IGNORE(  
+	    {
+	    inBuf.WriteInt32L( op );
+		inBuf.WriteInt32L( aUid.iUid );
+		inBuf.WriteUint32L( aActionID );
+        inBuf.CommitL();		
+		} );
+	inBuf.Release();
+	inBuf.Close();	
+	
+    err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::UnregisterControlAction - return: %d <<", err);
+    return err;
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::RegisterControlKml(const TUid& aUid, const TDesC& aResourceDir, 
+													const TDesC& aFilename)
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::RegisterControlKml >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+    RDesWriteStream inBuf( inPtr );
+    err = FindEffectFile( aResourceDir, aFilename ); 
+
+	TRAP( err, 
+	    {
+    	RThread me;
+    	TInt op = MAlfGfxEffectPlugin::ETfxServerOpRegisterControlKml;
+        inBuf.WriteInt32L( op );
+    	inBuf.WriteInt32L( aUid.iUid );
+    	TUint64 id = me.Id();
+    	TUint8* ptr = reinterpret_cast<TUint8*>( &id );
+    	inBuf.WriteL( ptr, 8 );
+        inBuf << iParse.DriveAndPath();
+//    	inBuf << aResourceDir;
+    	inBuf << aFilename;
+        inBuf.CommitL();		
+	    });
+	    
+	inBuf.Release();
+	inBuf.Close();	
+	
+	if ( err == KErrNone )
+	    {
+        err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+	    }
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::RegisterControlKml - return: %d <<", err );
+    return err;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::RegisterControlKml(const TUid& aUid, const TDesC& aResourceDir, 
+													const TDesC& aFilename, TInt aWantedTime,
+													TInt aMinTime)
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::RegisterControlKml >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+    RDesWriteStream inBuf( inPtr );
+
+	RThread me;
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpRegisterControlKmlEx;
+    err = FindEffectFile( aResourceDir, aFilename ); 
+	TRAP( err, 
+	    {
+        inBuf.WriteInt32L( op );
+    	inBuf.WriteInt32L( aUid.iUid );
+    	TUint64 id = me.Id();
+    	TUint8* ptr = reinterpret_cast<TUint8*>( &id );
+    	inBuf.WriteL( ptr, 8 );
+        inBuf << iParse.DriveAndPath();
+//    	inBuf << aResourceDir;
+    	inBuf << aFilename;
+        inBuf.WriteInt32L( aWantedTime );
+    	inBuf.WriteInt32L( aMinTime );
+        inBuf.CommitL();		
+	    });
+	
+	inBuf.Release();
+	inBuf.Close();	
+	
+	if ( err == KErrNone )
+	    {
+        err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+	    }
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::RegisterControlKml - return: %d <<", err);
+    return err;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::UnregisterAllKml()
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::UnregisterAllKml >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+
+	// Out only parameter will be our thread id 
+	RThread me;
+   	TInt op = MAlfGfxEffectPlugin::ETfxServerOpRemoveAllKml;
+	// These writes cannot leave
+	TRAP_IGNORE( 
+	    {
+	    inBuf.WriteInt32L( op );
+    	TUint64 id = me.Id();
+	    TUint8* ptr = reinterpret_cast<TUint8*>( &id );
+	    inBuf.WriteL( ptr, 8 );
+        inBuf.CommitL();		
+		} );
+	inBuf.Release();
+	inBuf.Close();
+   
+    err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+	 
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::UnregisterAllKml - return: %d <<", err);
+    return KErrNone;
+	}
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::UnregisterControlKml(const TUid& aUid)
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::UnregisterControlKml >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	    
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpRemoveControlKml;
+	// These writes cannot leave
+	TRAP( err, 
+	    {
+	    inBuf.WriteInt32L( op );
+		inBuf.WriteInt32L( aUid.iUid );
+        inBuf.CommitL();		
+		} );
+	inBuf.Release();
+	inBuf.Close();	
+	
+    err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::UnregisterControlKml - return: %d <<", err);
+    return err;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::SetWantedTime( TInt aTime )
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::SetWantedTime >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	    
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpSetWantedTime;
+	// These writes cannot leave
+	TRAP_IGNORE( 
+	    {
+	    inBuf.WriteInt32L( op );
+		inBuf.WriteInt32L( aTime );
+        inBuf.CommitL();		
+		} );
+	inBuf.Release();
+	inBuf.Close();	
+	
+    err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::SetWantedTime - return: %d <<", err);
+    return err;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+TInt CAlfTransitionServerClient::SetMinTime(TInt aTime)
+	{
+	__ALFFXLOGSTRING1("CAlfTransitionServerClient::SetMinTime - aTime: %d >>", aTime );
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        __ALFFXLOGSTRING1("CAlfTransitionServerClient::SetMinTime - return: %d <<", err);
+	    return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	    
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpSetMinTime;
+	// These writes cannot leave
+	TRAP_IGNORE( 
+	    {
+	    inBuf.WriteInt32L( op );
+		inBuf.WriteInt32L( aTime );
+        inBuf.CommitL();		
+		} );
+	inBuf.Release();
+	inBuf.Close();	
+	
+    err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::SetMinTime - return: %d <<", err);
+    return err;
+	}	
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+TInt CAlfTransitionServerClient::RegisterFullscreenKml(	TUint aActionID, const TUid& aUid, 
+														const TDesC& aResourceDir, const TDesC& aFilename,
+														TInt aCachePriority, TInt aWantedTime,
+														TInt aMinTime)
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::RegisterFullscreenKml >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	// Streaming test    
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	RThread me;
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpAddFullscreenKMLEx;
+    err = FindEffectFile( aResourceDir, aFilename ); 
+	TRAP( err, 
+	    {
+	    inBuf.WriteInt32L( op );
+		inBuf.WriteUint32L( aActionID );
+		inBuf.WriteInt32L( aUid.iUid );
+    	TUint64 id = me.Id();
+	    TUint8* ptr = reinterpret_cast<TUint8*>( &id );
+	    inBuf.WriteL( ptr, 8 );
+        inBuf << iParse.DriveAndPath();
+//		inBuf << aResourceDir;
+		inBuf << aFilename;
+		inBuf.WriteInt32L( aCachePriority );
+		inBuf.WriteInt32L( aWantedTime );
+		inBuf.WriteInt32L( aMinTime );
+        inBuf.CommitL();		
+		} );
+		
+	inBuf.Release();
+	inBuf.Close();	
+   
+    if ( err == KErrNone )
+        {
+        err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+        }
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING("CAlfTransitionServerClient::RegisterFullscreenKml - return KErrNone <<");
+    return KErrNone;
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+TInt CAlfTransitionServerClient::VerifyConnection()
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::VerifyConnection >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	    
+	TInt op = MAlfGfxEffectPlugin::ETfxServerVerifyConnection;
+	// These writes cannot leave
+	TRAP_IGNORE( 
+	    {
+	    inBuf.WriteInt32L( op );
+        inBuf.CommitL();		
+		} );
+	inBuf.Release();
+	inBuf.Close();	
+	
+    err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::VerifyConnection - return: %d <<", err);
+    return err;
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::FreeRam()
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::FreeRam >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	    
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpFreeRam;
+	// These writes cannot leave
+	TRAP_IGNORE( 
+	    {
+	    inBuf.WriteInt32L( op );
+        inBuf.CommitL();		
+		} );
+	inBuf.Release();
+	inBuf.Close();	
+	
+    err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+    
+    // Here the server should actually return something
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::FreeRam - return: %d <<", err);
+    return err;
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerClient::MemoryGood()
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerClient::MemoryGood >>");
+	TInt err = KErrNone;
+	
+	if ( !iHasPlugin )
+	    {
+	    err = Connect();
+	    }
+	if ( !iHasPlugin || err != KErrNone )
+	    {
+	    // if we are started too early we just bail out without doing anything
+        return err;
+	    }
+	    
+	TPtr8 inPtr = iTransferBuffer->Des();
+	inPtr.Zero();
+	TPtr8 outPtr = iReturnBuffer->Des();
+	outPtr.Zero();
+	RDesWriteStream inBuf( inPtr );
+	    
+	TInt op = MAlfGfxEffectPlugin::ETfxServerOpMemoryGood;
+	// These writes cannot leave
+	TRAP_IGNORE( 
+	    {
+	    inBuf.WriteInt32L( op );
+        inBuf.CommitL();		
+		} );
+	inBuf.Release();
+	inBuf.Close();	
+	
+    err = iTfxServer.SendSynchronousData( iPluginImplementation, inPtr, outPtr );
+    
+    // Here the server should actually return something
+
+    inPtr.Zero();
+    outPtr.Zero();
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::MemoryGood - return: %d <<", err);
+    return err;
+	}
+
+TInt CAlfTransitionServerClient::FindEffectFile( const TDesC& aResourceDir, const TDesC& aFilename )
+    {
+    __ALFFXLOGSTRING2("CAlfTransitionServerClient::FindEffectFile - Dir: %S File: %S>>", &aResourceDir, &aFilename);
+    // TODO:
+    // This function allows an alternative drive for finding effect files
+    // By default the effect files are in ROM
+    // To make testing easier, the it is allowed to have them on C-drive in the emulator
+    // or memory card in the phone.
+    // If the default memory card in the phone is not letter E, this needs to be adjusted.
+    // When this testing functionality is not needed any more (should not be present in final release builds)
+    // modify the function so that iParse always contains the original resource directory.
+#ifdef __WINS__
+    _LIT( KOptionalDrive, "C:" );
+#else
+    _LIT( KOptionalDrive, "F:" );
+#endif
+    
+    TInt err = KErrNone;
+    iParse.Set( KOptionalDrive, &aResourceDir, &aFilename );
+    
+    err = iFile.Open( iFs, iParse.FullName(), EFileRead );
+    if ( err != KErrNone )
+        {
+        iParse.Set( aResourceDir, NULL, NULL );
+        }
+    else
+        {
+        // close the file if we managed to open it
+        iFile.Close();
+        iParse.Set( KOptionalDrive, &aResourceDir, NULL );  
+        }
+    
+    // Now iParse contains the alternative path if the file is found in the alternative
+    // location, else it contains the original path.
+    __ALFFXLOGSTRING1("CAlfTransitionServerClient::FindEffectFile - return: %d <<", err);
+    return err;
+    }
+	
+// --- EOF ---
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftfxserverplugin/src/alftransitionservercontroller.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,250 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 implementation of the API used by theme server
+*                to control transition appearance.
+*
+*/
+
+
+
+#include "alftransitionservercontroller.h"
+#include "alftransitionserver.h"
+#include "alftfxserverdef.h"
+#include "alfpsobserver.h"
+
+#include <e32property.h>
+#include <avkondomainpskeys.h>
+#include <pslninternalcrkeys.h>
+#include <centralrepository.h>
+
+#include <alf/alfclientbase.h>
+#include <alflogger.h>
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CAlfTransitionServerController* CAlfTransitionServerController::NewL(RWsSession& /*aWsSession*/)
+    {
+    __ALFFXLOGSTRING("CAlfTransitionServerController::NewL >>");
+    CAlfTransitionServerController* self = new (ELeave) CAlfTransitionServerController();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+    __ALFFXLOGSTRING("CAlfTransitionServerController::NewL <<");
+    return self;
+    }
+    
+CAlfTransitionServerController::~CAlfTransitionServerController()
+    {
+    __ALFFXLOGSTRING("CAlfTransitionServerController::~CAlfTransitionServerController >>");
+    delete iTimer;
+	delete iPsObserver;
+	
+    if(ServerRunning()) 
+        {
+        StopTransitionServer();
+        }
+            
+	delete iRepository;
+    __ALFFXLOGSTRING("CAlfTransitionServerController::~CAlfTransitionServerController <<");
+    }
+
+CAlfTransitionServerController::CAlfTransitionServerController()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CAlfTransitionServerController::ConstructL()
+    {
+    __ALFFXLOGSTRING("CAlfTransitionServerController::ConstructL >>");
+    iRepository = CRepository::NewL( KCRUidThemes );
+    TInt err = iRepository->Get( KThemesTransitionEffects, iEffectValue );
+    if ( err != 0 )
+        {
+        // Clean the value just to be sure it did not get messed up
+        iEffectValue = 0;
+        }
+    __ALFFXLOGSTRING("CAlfTransitionServerController::ConstructL <<");
+    }
+    
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerController::StartTransitionServer()
+    {
+	return StartTransitionServer(KDefaultMaxBytesOngoing, KDefaultMaxBytesBetween);
+    }
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerController::StopTransitionServer()
+    {
+    __ALFFXLOGSTRING("CAlfTransitionServerController::StopTransitionServer >>");
+    //Shutting down.
+	//Set property to "server not running"
+    TInt val = 0;
+    
+    RProperty::Get(KPSUidAvkonDomain, KAknTfxServerStatus, val);
+    iTransitionControlValue = val & ~ETfxSrvRunning;
+	RProperty::Set(KPSUidAvkonDomain, KAknTfxServerStatus, iTransitionControlValue);
+	__ALFFXLOGSTRING("CAlfTransitionServerController::StopTransitionServer <<");
+    return KErrNone;
+    }
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TBool CAlfTransitionServerController::ServerRunning()
+    {
+    __ALFFXLOGSTRING("CAlfTransitionServerController::ServerRunning >>");
+    TInt value = 0;
+    RProperty::Get(KPSUidAvkonDomain, KAknTfxServerStatus, value);
+    __ALFFXLOGSTRING1("CAlfTransitionServerController::ServerRunning - return: %d <<", value & ETfxSrvRunning);
+    return (value & ETfxSrvRunning);
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//   
+TInt CAlfTransitionServerController::StartTransitionServer(TInt32 /*aMaxBytesOngoing*/, 
+																 TInt32 /*aMaxBytesBetween*/)
+	{
+	__ALFFXLOGSTRING("CAlfTransitionServerController::StartTransitionServer >>");
+	if( ServerRunning() )
+		{
+		__ALFFXLOGSTRING("CAlfTransitionServerController::StartTransitionServer - return KErrAlreadyExists <<");
+		return KErrAlreadyExists;
+		}
+		
+	TInt val = 0;
+	TInt err = KErrNone;
+	
+
+    err = RProperty::Get(KPSUidAvkonDomain, KAknTfxServerStatus, val );
+    if ( err != KErrNone )
+        {
+    	err = RProperty::Define(KPSUidAvkonDomain, KAknTfxServerStatus, RProperty::EInt, TSecurityPolicy(TSecurityPolicy::EAlwaysPass),TSecurityPolicy(TSecurityPolicy::EAlwaysPass));
+    	// make sure the value is cleared if this is the first time the property is defined
+    	val = 0;
+        }
+	
+	if ( err == KErrAlreadyExists )
+	    {
+	    // if our publish/subscribe variable already exists, all is well
+	    err = KErrNone;
+	    }
+	
+	if( err != KErrNone )
+		{
+		__ALFFXLOGSTRING1("CAlfTransitionServerController::StartTransitionServer - return: %d <<", err);
+		return err;
+		}
+		
+	//Set property to "server running"
+    iTransitionControlValue = val | ETfxSrvRunning;
+    // if the plugin has already been loaded, don't mess up with the value
+	RProperty::Set( KPSUidAvkonDomain, KAknTfxServerStatus,  val | ETfxSrvRunning );
+    	
+    if ( !iPsObserver )
+        {
+       	iPsObserver = CAlfPsObserver::New( this, KPSUidAvkonDomain, KAknTfxServerStatus );
+    	if( !iPsObserver )
+    		{
+    		__ALFFXLOGSTRING("CAlfTransitionServerController::StartTransitionServer - return KErrNoMemory<<");
+    		return KErrNoMemory;
+    		}
+        }
+    
+    if ( !iIsConnected )
+        {
+        err = iTfxServer.Open();
+        }
+        
+    if ( err == KErrNone )
+        {
+        iIsConnected = ETrue;        
+        // We don't need the server, we only want to know if it is running.
+        iTfxServer.Close();
+        }
+    else
+        {
+        err = KErrNone;
+        // start timer
+        if ( !iTimer )
+            {
+            iTimer = CPeriodic::New( CActive::EPriorityStandard );
+            if ( iTimer )
+                {
+                iTimer->Start( 1000000, 1000000,
+                    TCallBack(CAlfTransitionServerController::ConnectionCallback, this ) );
+                }
+            }
+        }
+    __ALFFXLOGSTRING1("CAlfTransitionServerController::StartTransitionServer - return: %d <<", err);
+    return err;
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerController::ConnectionCallback( TAny* aParameter )
+    {
+    __ALFFXLOGSTRING("CAlfTransitionServerController::ConnectionCallback");
+    CAlfTransitionServerController* me = ((CAlfTransitionServerController*)(aParameter));
+    return me->ConnectionAttempt();
+    }
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfTransitionServerController::ConnectionAttempt()
+    {
+    __ALFFXLOGSTRING("CAlfTransitionServerController::ConnectionAttempt >>");
+    TInt err = iTfxServer.Open();
+    if ( err == KErrNone )
+        {
+        iIsConnected = ETrue;        
+        __ALFFXLOGSTRING("CAlfTransitionServerController::ConnectionAttempt - Connected");
+        // We don't need the server, we only want to know if it is running.
+        iTfxServer.Close();
+        delete iTimer;
+        iTimer = NULL;
+        err = iRepository->Get( KThemesTransitionEffects, iEffectValue );
+        if ( err != 0 )
+            {
+            // Clean the value just to be sure it did not get messed up
+            iEffectValue = 0;
+            }
+        iRepository->Set( KThemesTransitionEffects, KMaxTInt ); 
+        iRepository->Set( KThemesTransitionEffects, iEffectValue );   
+        }
+    __ALFFXLOGSTRING1("CAlfTransitionServerController::ConnectionAttempt - state: %d, but returning KErrNone <<", err);
+    return KErrNone;    
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CAlfTransitionServerController::PsValueUpdated( const TUid /*aCategory*/, const TUint /*aKey*/, const TInt /*aVal*/ )
+	{
+	// This may not be needed as we poll the starting of alf.
+	}
+
+
+    
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/group/alftranseffectplugin.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Project definition file for project AlfTransEffectPlugin
+*
+*/
+
+
+
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+
+#include "../inc/alftfxplugincommon.hrh"
+
+TARGET      alftranseffectplugin.dll
+
+TARGETTYPE  PLUGIN
+
+CAPABILITY CAP_ECOM_PLUGIN
+VENDORID VID_DEFAULT
+
+UID         0x10009D8D KAlfTransEffectPlugDllUidValue
+//UID         0x10009D8D 0x10282CAF
+
+SOURCEPATH  ../src
+
+SOURCE      alftfxplugincommon.cpp
+SOURCE      alfsystemeffects.cpp
+SOURCE      alfgfxeffects.cpp
+SOURCE      wsserverdrawercontroller.cpp
+SOURCE      uidexception.cpp
+SOURCE      uidblock.cpp
+SOURCE      statehandler.cpp
+SOURCE      debuglogger.cpp
+SOURCE      alfserverdrawer.cpp
+SOURCE      states.cpp
+SOURCE      repositoryhandler.cpp
+SOURCE      alfpolicy.cpp
+SOURCE      alfpolicyhandler.cpp
+SOURCE      alfpolicyrequesthandler.cpp
+
+START RESOURCE 10282CAF.rss
+TARGET alftranseffectplugin.rsc
+END
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../alftfxserverplugin/inc
+
+#include <platform_paths.hrh>
+MW_LAYER_SYSTEMINCLUDE
+
+
+SYSTEMINCLUDE	/epoc32/include/ecom
+SYSTEMINCLUDE   ../../../../../../inc
+SYSTEMINCLUDE   ../../../../ServerCore/Inc
+SYSTEMINCLUDE   ../../../../CommonInc
+
+LIBRARY     euser.lib
+LIBRARY     ecom.lib
+LIBRARY     bitgdi.lib
+LIBRARY     fbscli.lib
+LIBRARY     alfappservercore.lib
+LIBRARY     hitchcock.lib
+LIBRARY     efsrv.lib
+LIBRARY     bafl.lib 
+LIBRARY     apgrfx.lib 
+LIBRARY     ws32.lib
+LIBRARY     estor.lib
+LIBRARY     centralrepository.lib
+LIBRARY     flogger.lib
+
+EXPORTUNFROZEN
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Build information file for project AlfTransEffectPlugin
+*
+*/
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+PRJ_MMPFILES
+AlfTransEffectPlugin.mmp
+
+PRJ_TESTMMPFILES
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfdrawerengine.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 functions that are used by the CWsServerDrawerHandler
+*
+*/
+
+
+
+#ifndef M_ALFDRAWERENGINE_H
+#define M_ALFDRAWERENGINE_H
+
+#include <e32base.h>
+#include <fbs.h>
+
+class MAlfDrawerEngine
+    {
+// Functions originally taken from MWsServerDrawerEngine
+// Unused functions removed, new needed ones may be added.    
+public:
+//	virtual TInt SaveFB() = 0;
+//	virtual TInt SaveRedirected() = 0;
+//	virtual TInt RedirectGc() = 0;
+//	virtual void UnredirectGc() = 0;
+//	virtual void UpdateToScreen() = 0;
+	virtual TUid& FromUid() = 0;
+	virtual TUid& ToUid() = 0;
+	virtual TUint& Action() = 0;
+	virtual TInt& Flags() = 0;
+	virtual void IncreaseHandle() = 0;
+	virtual TInt CurrentHandle() = 0;
+	virtual void StartEndChecker() = 0;
+	virtual void CancelEndChecker() = 0;
+	virtual void SendBeginFullscreen() = 0;
+	virtual TInt SendEndFullscreen() = 0;
+	virtual TInt SendAbortFullscreen() = 0;
+	virtual TInt SendAbortControlTransition() = 0;
+    virtual	TInt SendBeginControlTransition() = 0;
+	virtual TInt SendFinishControlTransition() = 0;
+	virtual TBool EffectFinishedFullScreen() const = 0;
+
+    };
+
+#endif //M_ALFDRAWERENGINE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfgfxeffects.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,156 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Alf system effects
+*
+*/
+
+
+
+
+#ifndef ALFGFXEFFECTS_H
+#define ALFGFXEFFECTS_H
+
+#include <e32base.h>
+#include <alf/AlfTransEffectPlugin.h>
+#include "alftfxplugincommon.hrh"
+#include "../../../../ServerCore/Inc/alfwindowfxplugin.h"
+#include "wsserverdrawercontroller.h"
+
+// CONSTANTS
+const TUid KAlfGfxImplUid = { KAlfGfxImplUidValue };
+
+class CAlfServerDrawer;
+class CRepositoryHandler;
+class CPolicyHandler;
+
+// CLASS DECLARATION
+
+/**
+ *  System effects class for ALF server plugin
+ *
+ *  @since
+ */
+NONSHARABLE_CLASS( CAlfGfxEffects ):   public CAlfWindowFxPlugin, MEndChecker /*, public MAlfTransEffectPlugin */
+	{
+	public: // Construction and destruction
+
+    	/**
+     	* Create a new instance of the interface
+     	* 
+     	* @return pointer to the instance
+     	*/
+		static CAlfWindowFxPlugin* NewFxPluginL();
+
+        /** 
+        * 2nd phase constructor. Called by framework to complete construction of a plugin. 
+        * Must have base call from deriving class to complete construction
+        */
+        void ConstructL(const CAlfWindowManager& aMgr, TInt aAlfBufferFormat);
+
+    	/**
+     	* Destructor
+     	*/
+		~CAlfGfxEffects();
+		
+		// From CAlfWindowManager - implemented
+		
+        /** Synch message from client */    
+        void HandleMessageL(const TDesC8& aMessage, TPtr8& aResponse);
+
+        /** Asynch message from client */    
+        void HandleMessageL(const TDesC8& aMessage, const RMessage2& aClientMessage);
+
+        /** Cancel asynch message(s) from client */    
+        void CancelMessage(TInt aMessageId);
+
+		/**
+		* From CAlfWindowManager - not implemented
+		*/
+        void PrepareFrameL(TUint aEstimatedFrameInterval);
+
+        void WindowUpdated(TInt aWindowId, TInt aEventType);
+	
+	public:
+        
+        void EndExpired();
+        
+	private: // From MAlfTransEffectPlugin
+	    // - not supported   
+
+    	TInt GetSupportedEffects( RArray<TInt>& aSupportedEffectIds );
+    	TInt StartPhase( TInt aPhaseId, TInt aEffectId, CAlfSrvEffectEnv& aEffectEnv, const TDesC8* aParams );
+    	TInt Abort() { return KErrNone; };
+    	TInt AddEventObserver( MAlfTransEffectObserver* /*aObserver*/, TInt /*aEvents*/, const TDesC8* /*aParams*/ ) { return KErrNone; };
+   		TInt RemoveEventObserver( MAlfTransEffectObserver* /*aObserver*/, TInt /*aEvents*/ ) { return KErrNone; };
+  		TInt GetEventState( TInt /*aEvent*/, TInt* /*aState*/, TDes8* /*aParams*/ ) { return KErrNone; };
+    
+	private: // New
+    	/**
+     	* Leaving version of StartPhase().
+     	*/
+	    TInt DoStartPhaseL( TInt aPhaseId, TInt aEffectId, CAlfSrvEffectEnv& aEffectEnv, const TDesC8* aParams );
+	    
+	    void ShowVisibleGroupsAndMakeNonTransparentL(CAlfSrvEffectEnv& aEffectEnv);
+	    void HideGroupsAndMakeTransparentL(CAlfSrvEffectEnv& aEffectEnv);
+	    
+	    // checks that resource directory is on z drive
+	    TInt VerifyResourceLocation(const TDesC& aResourceDir);
+
+	    	
+private: // Construction and destruction
+
+    	/**
+     	* C++ contructor
+     	*/
+		CAlfGfxEffects();
+#ifdef _DEBUG		
+		void PrintRequestInfo(TInt aOperation, TInt aAction );
+#endif
+		
+private: // data
+
+    CAlfServerDrawer* iEngine;
+    CRepositoryHandler* iSysDisable;
+    CPolicyHandler* iPolicyHandler;
+        
+    /**
+     * The wanted time (in milliseconds) for a frame in listbox animations.
+     */
+    TInt iListBoxFrameTime;
+
+    /**
+     * The minimum time (in milliseconds) between frames in listbox animations.
+     */
+    TInt iListBoxMinFrameTime;
+
+    /**
+     * The wanted time (in milliseconds) for a frame in control animations.
+     */
+	TInt iControlFrameTime;
+	
+	/**
+     * The minimum time (in milliseconds) between frames in control animatins.
+     */
+	TInt iControlMinFrameTime;
+	
+	TInt iTransitionTime;
+	TInt iTransitionMinTime;
+	
+	RArray<TInt> iActiveSyncronizedGroups;
+	
+	CEndCheck* iSyncronizedGroupDefitionEndChecker;
+	
+	};
+
+#endif // ALFGFXEFFECTS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfpolicy.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,438 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   a policy
+*
+*/
+
+
+#ifndef C_POLICY_H
+#define C_POLICY_H
+
+#include <e32base.h>
+
+//#include <gfxtranseffect/gfxtransdatatype.h>
+
+#include "alftransitionserver.h"
+
+/**
+ *  contains a policy for a fullscreen transition type.
+ *
+ *
+ *  @since S60 3.2
+ */
+NONSHARABLE_CLASS(CFullscreenPolicy) : public CBase
+	{
+public:
+  
+	static CFullscreenPolicy* NewL(	TUint aAction, 
+									const TUid& aUid, 
+									const TThreadId& aThreadId, 
+									const TDesC& aResourceDir, 
+					 				const TDesC& aFilename, 
+					 				TInt aCachePriority, 
+					 				TInt aWantedTime, 
+					 				TInt aMinTime);
+	
+	virtual ~CFullscreenPolicy();
+		
+	/**
+     * Returns the currently stored action.
+     * @since S60 3.2
+     *
+     * @return The action.
+    */  
+	inline TUint Action();
+
+	/**
+     * Returns the UID stored in this object.
+     * @since S60 3.2
+     *
+     * @return Reference to the Uid.
+    */  
+	inline const TUid& Uid();
+	
+	/**
+     * Returns the thread ID stored in this object.
+     * @since S60 3.2
+     *
+     * @return Reference to the thread ID.
+    */  
+	inline const TThreadId& ThreadId();
+	/**
+     * Returns a pointer to the name of the stored resource directory.
+     * @since S60 3.2
+     *
+     * @return Pointer to the resource directory.
+    */  
+	inline TDesC& ResourceDir();
+
+	/**
+     * Returns the currently stored filename.
+     * @since S60 3.2
+     *
+     * @return Pointer to the filename.
+    */  
+	inline TDesC& Filename();
+	
+	/**
+     * Returns the cache priority of this object.
+     * @since S60 3.2
+     *
+     * @return Integer containing the cache priority.
+    */  
+	inline TInt CachePriority();
+	
+	/**
+     * Sets the cache priority
+     * @since S60 3.2
+     *
+     * @return Integer containing hte cache priority.
+    */  
+	inline void SetCachePriority(TInt aCachePriority);
+	
+	/**
+     * Returns the currently set wanted time.
+     * @since S60 3.2
+     *
+     * @return Integer containing the wanted time.
+    */  
+	inline TInt WantedTime();
+	
+	/**
+     * Return the minimum time.
+     * @since S60 3.2
+     *
+     * @return Integer containing the minimum time.
+    */  
+	inline TInt MinTime();
+	
+private:
+	/**
+     * Private constructor.
+     * @since S60 3.2
+     *
+     * @param aAction The action.
+     * @param aUid The Uid.
+     * @param aCachePriority The cachepriority.
+     * @param aWantedTime The wanted time
+     * @param aMinTime The minimum time.
+    */  
+	CFullscreenPolicy(TUint aAction, 
+					  const TUid& aUid, 
+					  const TThreadId& aThreadId,
+					  TInt aCachePriority, 
+					  TInt aWantedTime, 
+					  TInt aMinTime);
+
+	/**
+     * Private part of two phase construction.
+     * @since S60 3.2
+     *
+     * @param aResourceDir Descriptor containing the resource directory.
+     * @param aFilename Descriptor containing the filename.
+    */  
+	void ConstructL(const TDesC& aResourceDir, const TDesC& aFilename);
+	
+private: //data
+	TUint iAction;
+	TUid iUid;
+	TThreadId iThreadId;
+	TInt iCachePriority; 	//below zero means default
+	TInt iWantedTime; 		//below zero means default
+	TInt iMinTime;			//below zero means default
+	HBufC* iFilename;
+	HBufC* iResourceDir;
+	};
+
+NONSHARABLE_CLASS( CListBoxPolicy ) : public CBase
+	{
+public:
+	static CListBoxPolicy* NewL( const TUid& aUid, 
+								 const TThreadId& aThreadId,
+	                             const CAlfTransitionServerClient::TListBoxType aListBoxType,
+	                             const TDesC& aResourceDir,
+								 const TDesC& aBackgroundFilename,
+								 const TDesC& aItemFilename,
+								 TInt aCachePriority, 
+					             TInt aWantedTime, TInt aMinTime );
+	~CListBoxPolicy();
+	void ConstructL( const TDesC& aResourceDir,
+	                 const TDesC& aBackgroundFilename,
+	                 const TDesC& aItemFilename );
+	
+	/**
+     * Returns the UID stored in this object.
+     *
+     * @return Reference to the Uid.
+    */  
+	inline const TUid& Uid() const;
+	
+	/**
+     * Returns the thread ID stored in this object.
+     *
+     * @return Reference to the thread ID.
+    */  
+	inline const TThreadId& ThreadId() const;
+
+    /**
+     * Returns the list box type of this policy.
+     *
+     * @return The list box type.
+     */
+    inline const CAlfTransitionServerClient::TListBoxType ListBoxType() const;
+
+	/**
+     * Returns a pointer to the name of the stored resource directory.
+     *
+     * @return Pointer to the resource directory.
+    */  
+	inline const TDesC& ResourceDir() const;
+
+	/**
+     * Returns the currently stored background filename.
+     *
+     * @return Pointer to the background filename.
+    */  
+	inline const TDesC& BackgroundFilename() const;
+
+	/**
+     * Returns the currently stored item filename.
+     *
+     * @return Pointer to the item filename.
+    */  
+	inline const TDesC& ItemFilename() const;
+
+	/**
+     * Returns the cache priority of this object.
+     *
+     * @return Integer containing the cache priority.
+    */  
+	inline TInt CachePriority() const;
+
+	/**
+     * Sets the cache priority
+     *
+     * @return Integer containing hte cache priority.
+    */  
+	inline void SetCachePriority( TInt aCachePriority );
+
+	/**
+     * Returns the currently set wanted time.
+     *
+     * @return Integer containing the wanted time.
+    */  
+	inline TInt WantedTime() const;
+
+	/**
+     * Return the minimum time.
+     *
+     * @return Integer containing the minimum time.
+    */  
+	inline TInt MinTime() const;
+
+	/**
+	 * Return the specificity value of the policy, ie. how much information
+	 * is specified.  This depends on hether the app uid and the listbox  
+	 * type are specified.
+	 *
+	 * @return The specificity of the policy.
+	 */
+    inline TInt Specificity() const;
+
+private:
+	CListBoxPolicy( const TUid &aUid, 
+					const TThreadId &aThreadId,
+	                const CAlfTransitionServerClient::TListBoxType aListBoxType,
+	                TInt aCachePriority,
+	                TInt aWantedTime, TInt aMinTime );
+
+
+	TUid iUid;
+	TThreadId iThreadId;
+	CAlfTransitionServerClient::TListBoxType iListBoxType;
+	HBufC* iResourceDir;
+	HBufC* iBackgroundFilename;
+	HBufC* iItemFilename;
+	TInt iCachePriority; 	//below zero means default
+	TInt iWantedTime; 		//below zero means default
+	TInt iMinTime;			//below zero means default
+    TInt iSpecificity;
+	};
+
+/**
+ * This class contains one policy action for a policy.
+ *
+ *  @since S60 3.2
+ */
+NONSHARABLE_CLASS( CActionPolicy ) : public CBase
+	{
+public:
+	~CActionPolicy();
+
+	TInt iAction;		// The action that is supported.
+	TPolicy iPolicy;	// Policy type (supported/not supported)
+	
+	/**
+	 * Stores the action string that will be executed whith this action
+	 * @sine S60 v3.1
+	 *
+	 * param Descriptor containing the action.
+	 */
+	void SetActionStringL(const TDesC& aActionString);
+	
+	/**
+	 * Returns the action to be performed.
+	 * since S60 v3.1
+	 * 
+	 * return Pointer to the action sting.
+	 */
+	inline TDesC& ActionString();
+	
+private:
+	HBufC* iActionString;	// Buffer where the action string will be stored.
+	};
+	
+/**
+ * This class contains base information on control policies supported
+ * like resource directory, filename and UID of the control.
+ *
+ *  @since S60 3.2
+ */
+NONSHARABLE_CLASS(CControlPolicy) : public CBase
+	{
+public:
+	/**
+     * Parts of two-stage construction. Called when this class is instantiated.
+     * @since S60 3.2
+     *
+     * @param UID for the control policy for which data is to be created.
+     * @param Directory where the KML file is located.
+     * @param Name of the KML file.
+     * @return Pointer to a newly created CControlPolicy object.
+    */  
+	static CControlPolicy* NewL(const TUid &aUid, 
+								const TThreadId& aThreadId, 
+								const TDesC& aResourceDir, 
+						  		const TDesC& aFilename, 
+						  		TInt aCachePriority,
+						  		TInt aWantedTime,
+						  		TInt aMinTime);
+	/**
+     * Destructor
+     * @since S60 3.2
+     *
+    */  
+	~CControlPolicy();
+	
+	// Array containing action policies that are supported for
+	// this UID.
+	RPointerArray<CActionPolicy> iControlPolicies;
+
+	/**
+     * Returns the UID that is stored in this control policy.
+     * @since S60 3.2
+     *
+     * @return the UID.
+    */  
+	inline const TUid& Uid();
+	
+	/**
+     * Returns the thread ID that is stored in this control policy.
+     * @since S60 3.2
+     *
+     * @return the thread ID.
+    */  
+	inline const TThreadId& ThreadId();
+
+	/**
+     * Returns the resource dir where the KML files are located 
+     * for this UID.
+     * @since S60 3.2
+     *
+     * @return Pointer to the stored resource directory.
+    */  
+	inline TDesC& ResourceDir();
+
+	/**
+     * Returns the filename associated with this uid.
+     * @since S60 3.2
+     *
+     * @return Pointer to the filename.
+    */  
+	inline TDesC& Filename();
+	
+	/**
+     * Returns the cache priority of this object.
+     * @since S60 3.2
+     *
+     * @return Integer containing the cache priority.
+    */  
+	inline TInt CachePriority();
+	
+	/**
+     * Sets the cache priority
+     * @since S60 3.2
+     *
+     * @return Integer containing hte cache priority.
+    */  
+	inline void SetCachePriority(TInt aCachePriority);
+	
+	/**
+     * Gets the wanted frame time
+     * @since S60 3.2
+     *
+     * @return Integer containing the frame time in ms
+    */  
+	inline int WantedTime();
+
+	/**
+     * Gets the minumum frame time
+     * @since S60 3.2
+     *
+     * @return Integer containing the frame time in ms
+    */  
+	inline int MinTime();
+	
+private:
+	/**
+     * Constructor.
+     * @since S60 3.2
+     *
+     * @param UID for this policy.
+     * @param ThreadID for this policy.
+    */  
+	CControlPolicy(const TUid aUid, const TThreadId aThreadId, TInt aCachePriority, TInt aWantedTime, TInt aMinTime);
+
+	/**
+     * Part of two stage constuction.
+     * @since S60 3.2
+     *
+     * @param Descriptor containing the resource directory.
+     * @param Descriptor containing the filename.
+    */  
+	void ConstructL(const TDesC& aResourceDir, const TDesC& aFilename);
+
+private: // Data
+	TUid iUid;
+	TThreadId iThreadId;
+	TInt iCachePriority;
+	TInt iWantedTime;
+	TInt iMinTime;
+	HBufC* iResourceDir;
+	HBufC* iFilename;
+	};
+	
+#include "alfpolicy.inl"
+
+#endif // C_POLICY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfpolicy.inl	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,166 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Inline functions for alfpolicy.h
+*
+*/
+
+
+
+
+inline TUint CFullscreenPolicy::Action()
+	{
+	return iAction;
+	}
+
+inline const TUid& CFullscreenPolicy::Uid()
+	{
+	return iUid;
+	}
+	
+inline const TThreadId& CFullscreenPolicy::ThreadId()
+	{
+	return iThreadId;
+	}
+		
+inline TDesC& CFullscreenPolicy::ResourceDir()
+	{
+	return *iResourceDir;
+	}
+	
+inline TDesC& CFullscreenPolicy::Filename()
+	{
+	return *iFilename;
+	}
+
+inline TInt CFullscreenPolicy::CachePriority()
+	{
+	return iCachePriority;
+	}
+
+inline void CFullscreenPolicy::SetCachePriority(TInt aCachePriority)
+	{
+	iCachePriority = aCachePriority;
+	}
+
+inline TInt CFullscreenPolicy::WantedTime()
+	{
+	return iWantedTime;
+	}
+	
+inline TInt CFullscreenPolicy::MinTime()
+	{
+	return iMinTime;
+	}
+
+inline TDesC& CActionPolicy::ActionString()
+	{
+	return *iActionString;
+	}
+
+inline const TUid& CControlPolicy::Uid()
+	{
+	return iUid;
+	}
+	
+inline const TThreadId& CControlPolicy::ThreadId()
+	{
+	return iThreadId;
+	}
+
+inline TDesC& CControlPolicy::ResourceDir()
+	{
+	return *iResourceDir;
+	}
+
+inline TDesC& CControlPolicy::Filename()
+	{
+	return *iFilename;
+	}
+
+inline TInt CControlPolicy::CachePriority()
+	{
+	return iCachePriority;
+	}
+
+inline void CControlPolicy::SetCachePriority(TInt aCachePriority)
+	{
+	iCachePriority = aCachePriority;
+	}
+
+inline TInt CControlPolicy::WantedTime()
+	{
+	return iWantedTime;
+	}
+	
+inline TInt CControlPolicy::MinTime()
+	{
+	return iMinTime;
+	}
+	
+inline const TUid& CListBoxPolicy::Uid() const
+	{
+	return iUid;
+	}
+
+inline const TThreadId& CListBoxPolicy::ThreadId() const
+	{
+	return iThreadId;
+	}
+
+inline const CAlfTransitionServerClient::TListBoxType CListBoxPolicy::ListBoxType() const
+    {
+    return iListBoxType;
+    }
+
+inline const TDesC& CListBoxPolicy::ResourceDir() const
+	{
+	return iResourceDir->Des();
+	}
+
+inline const TDesC& CListBoxPolicy::BackgroundFilename() const
+	{
+	return iBackgroundFilename->Des();
+	}
+
+inline const TDesC& CListBoxPolicy::ItemFilename() const
+	{
+	return iItemFilename->Des();
+	}
+
+inline TInt CListBoxPolicy::CachePriority() const
+	{
+	return iCachePriority;
+	}
+
+inline void CListBoxPolicy::SetCachePriority( TInt aCachePriority )
+	{
+	iCachePriority = aCachePriority;
+	}
+
+inline TInt CListBoxPolicy::WantedTime() const
+	{
+	return iWantedTime;
+	}
+
+inline TInt CListBoxPolicy::MinTime() const
+	{
+	return iMinTime;
+	}
+
+inline TInt CListBoxPolicy::Specificity() const
+    {
+    return iSpecificity;
+    }
+
+// --- EOF ---
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfpolicyhandler.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,414 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   handles policies for transitions, wich are supported, what kml to use etc.
+*
+*/
+
+
+#ifndef C_POLICYHANDLER_H
+#define C_POLICYHANDLER_H
+
+#include <e32base.h>
+#include <s32file.h>
+
+
+#include "alfpolicy.h"
+#include "alfpolicyrequesthandler.h"
+//#include "transitionserver.h"
+
+//======= Forward declarations =======
+class TFullScreenBlock;
+class CClientControlPolicy;
+class CFullscreenPolicy;
+class CControlPolicy;
+class CListBoxPolicy;
+
+/**
+ *  policy handler
+ *
+ *  handles policies for transitions, if it is supported or not, and if so, what 
+ *  kml file to use for the effect. This class handles both Fullscreen and 
+ *	control policies.
+ *
+ *  @since S60 3.2
+ */
+NONSHARABLE_CLASS(CPolicyHandler) : public CBase
+    {  	
+public: 
+	friend class CPolicyClientRequestHandler;
+	/**
+     * Public part of two phase construction.
+     * @since S60 3.2
+     *
+     * @return 
+    */  
+    static CPolicyHandler* NewL();
+
+    /**
+     * Destructor. 
+     * @since S60 3.2
+     *
+    */  
+    ~CPolicyHandler();
+
+/**
+	 * Register the KML files and resource directory to be used by a listbox.
+	 * The KML files and resource directory will be used for listboxes of the specified type
+     * in the process with the Uid aUid.
+     *
+     * KNullUid will be treated as the "default" Uid - listboxes in processes
+	 * with no KML registered for their uid will use KML registered with KNullUid.
+	 * EListTypeAny works the same way for listbox types.  More specific settings have 
+     * priority over less specific ones, and the uid has higher priority than the list type,
+     * which means that when assigning KML to a specific listbox, the search for KML is
+     * done in the following order:
+     *
+     * 1. KML that has been registered with the uid of the listbox' app and with the
+     *    listbox type that matches the specific listbox.
+     * 2. KML that has been registered with the uid of the listbox' app, with type EListTypeAny.
+     * 3. KML that has been registered with KNullUid and with the matching listbox type.
+     * 4. KML that has been registered with KNullUid and EListTypeAny.
+     *
+	 * If a Uid is registered with aBackgroundFileName of length zero this Uid will be treated as
+	 * having no effect, even if there is a "default" Uid. 
+	 *
+	 * @since S60 v3.1
+	 * @param aUid the TUid to associate the kml files with, KNullUid as default
+	 * @param aThreadId. The thread Id to associate the kml files with
+     * @param aListBoxType the type of listbox to associate the KML files with,
+     *        EListTypeAny to associate it with any type of list.
+	 * @param aResourceDir the resource directory
+	 * @param aBackgroundFileName the kml file to use for the background and highlight of the listbox, 
+	 		  must be relative the resource directory.
+	 * @param aListItemFilename the kml file to use for the listitems of the listbox, 
+	 		  must be relative the resource directory.
+	 * @return KErrNone if successful, otherwise another of the system-wide error codes.	
+	 */
+	void RegisterListBoxKmlL( const TUid& aUid, 
+							  const TThreadId& aThreadId,
+	                          const CAlfTransitionServerClient::TListBoxType aListBoxType,
+	                          const TDesC& aResourceDir, 
+							  const TDesC& aBackgroundFileName,
+							  const TDesC& aListItemFilename,
+							  TInt aCachePriority = -1,
+							  TInt aWantedTime = -1, TInt aMinTime = -1 );
+	/**
+	 * Unregisters KML files previously registered for a listbox.
+	 *
+	 * @param aUid the Uid to unregisted KML files for.
+	 * @param aListBoxType The type of listbox to unregister KML for.
+	 * @return KErrNone if successful, otherwise another of the system-wide error codes.
+	 */    
+	TInt UnregisterListBoxKml( const TUid& aUid,
+                               const CAlfTransitionServerClient::TListBoxType aListBoxType );
+                               
+    /**
+	 * Unregisters KML files previously registered for a listbox from one Thread.
+	 *
+	 * @param aThreadId the thead id to unregisted KML files for.
+	 * @return KErrNone if successful, otherwise another of the system-wide error codes.
+	 */    
+	TInt UnregisterListBoxKml( const TThreadId& aThreadId );
+
+
+    /**
+     * Get the KML files for listboxes in the app with the specified Uid.
+     *
+     * @param aAppId The AppUid of the application that the listbox belongs
+     *        to.
+     * @param aResourceDir
+     * @param aBackgroundFilename Name of the KML file that defines the
+     *        background behaviour.
+     * @param aItemFilename Name of the KML file that defines the item
+     *        behaviour.
+     * @aCachePriority
+     * @aWantedTime
+     * @aMinTime
+     */
+    TInt GetListBoxKml(	const TUid& aAppId, 
+                        const CAlfTransitionServerClient::TListBoxType aListBoxType,
+                        TPtrC& aResourceDir,
+                        TPtrC& aBackgroundFilename,
+                        TPtrC& aItemFilename,
+                        TInt& aCachePriority, TInt& aWantedTime, 
+                        TInt& aMinTime );
+
+  	/**
+     * Registers a KML file for use with FullScreen transitions. 
+     * If the filename stored here is NULL, the action is blocked
+     * from any UID.
+     * @since S60 3.2
+     *
+     * @param aAction. Action for which this KML file will be used.
+     * @param aUid. UID for which this KML file will be used.
+     * @param aThreadId. Thread ID for which this KML file will be used.
+     * @param aResourceDir. Descriptor containing the full path
+     *		  to the location of the KML file.
+     * @param aFilename. Descriptor contrianing the name of the
+     *		  KML file.
+     * @param Proirity when it's stored in the cache.
+     * @param wanted time between frames.
+     * @param Minimum allowed time between frames.
+     * @return KErrNone or any of the system error codes.
+     */    
+	void RegisterFullscreenKmlL( TUint aAction, const TUid& aUid, 
+								 const TThreadId& aThreadId,
+								 const TDesC& aResourceDir, const TDesC& aFilename,
+								 TInt aCachePriority = -1, TInt aWantedTime = -1 , TInt aMinTime = -1);
+  	/**
+     * Unregisters a KML file for <action,uid> pair. Both action
+     * and UID must match in order for the file to be unregistered.
+     * @since S60 3.2
+     *
+     * @param aAction. Action to unregister.
+     * @param aUid. UID to unregister.
+     * @return KErrNone or any of the system error codes.
+     */    
+  	TInt UnregisterFullscreenKml(TUint aAction, const TUid& aUid);
+  	
+  	/**
+     * Unregisters all of Fullscreen KML files from one thread Id
+     * @since S60 3.2
+     *
+     * @param aThreadId. the thread Id to unregisted KML files for.
+     * @return KErrNone or any of the system error codes.
+     */   
+     TInt UnregisterFullscreenKml(const TThreadId& aThreadId);
+     
+  	/**
+     * Unregisters all of registered KML files for a thread ID.
+     * @since S60 3.2
+     *
+     * @param aThreadId the thread id to unregisted KML files for.
+     * @return KErrNone or any of the system wide error codes.
+    */  
+	TInt UnregisterAllKml(const TThreadId& aThreadId);
+	
+  	/**
+     * Retrieves the path and name of a KML file that corresponds to the
+     * supplied aAction and aToUid. This method will return 
+     * KErrNotSupported if the <aAction, aToUid> pairs are not found,
+     * the aToTuid or aFromUid are blocked. If the aToUid is the default
+     * UID (KNullUid) and the default action has been blocked 
+     * KerrNotSupported will also be returned.
+     * @since S60 3.2
+     *
+     * @param aAction. The action for which to retireve file data.
+     * @param aToUid. The ToUid for which to retrieve file data.
+     * @param aFromUid. The FromUid for which to retrieve file data.
+     * @param aResourceDir. Pointer reference where the resource
+     *  	  directory will be stored.
+     * @param aFileName. Pointere reference where the file name will
+     * 		  be stored.
+     * @return KerrNone or KErrNotSupported.
+     */    
+  	TInt GetFullscreenKml(	TUint aAction, const TUid& aToUid, 
+  							const TUid& aFromUid, TPtrC& aResourceDir, TPtrC& aFilename,
+  							TInt& aCachePriority, TInt& aWantedTime, TInt& aMinTime);
+
+private:
+  	/**
+     * Retrieves all stored policies for CCoeControls. The policies
+     * will be copied (by pointer) and stored in the supplied arrray.
+     * This method is only used by CPolicyClientRequestHandler.
+     *
+     * @param aControlPolicies. Array where the policies will be stored.
+     * @return KerrNone or any of the system error codes.
+     */    
+  	TInt GetAllControlPolicies(RPointerArray<CClientControlPolicy>& aControlPolicies);
+
+public:
+  	/**
+     * Passes the call on to the AlfPolicyRequestHandler
+     * @since S60 3.2
+     *
+     * @param aMessage. Reference to the message sent by the client.
+     * @return KErrNone or any of the system error messages.
+     */    
+  	TInt RequestPolicy(const RMessage2& aMessage);
+
+  	/**
+     * Passes the call on to the AlfPolicyRequestHandler
+     *
+     * @param aClientId id of the client that wants the policies
+     * @param aPolicyCount number of policies the caller can handle
+     * @param aOutBuf the buffer that will be filled with the policies
+     * @return KErrNone or any of the system error messages.
+     */    
+  	TInt GetPolicyL( TThreadId aClientId, TInt aPolicyCount, TPtr8& aOutBuf );
+
+  	/**
+     * Passes the call on to the AlfPolicyRequestHandler
+     * @since S60 3.2
+     *
+     * @param aClientId id of the client whose request are cancelled
+     */    
+  	void RemoveClient( TThreadId aClientId );
+
+	/**
+     * Removes all requests that belong to terminated clients.
+     * Passes the call on to the PolicyRequtHandler
+     *
+     * @since S60 3.2
+     */
+//	void RemoveDeadClients();
+	
+	/**
+	 * Dumps a list of threadids of all connected clients waiting for 
+	 * policy updates
+	 *
+	 * Used for testing
+     * @since S60 3.2
+	 *
+	 * @param aFile an open write stream to dump clients to.
+	 */
+//	void DumpClientsL(RFileWriteStream& aFile);
+  	
+  	/**
+     * Blocks/Unblocks a UID for fullscreen effects. If both aBlockTo
+     * and aBlockFrom are false, the UID is unblocked. This unblocking 
+     * feature will unblock all blocks containing the supplied UID. 
+     * @since S60 3.2
+     *
+     * @param aUid. The UID to block.
+     * @param aBlockTo. True if the ToUid is to be blocked.
+     * @param aBlockFrom. True if the FromUid is to be blocked.
+     * @return KErrNone or any of hte system error codes.
+     */    
+  	TInt BlockFullScreenUid(const TUid& aUid, TBool aBlockFrom, 
+  							TBool aBlockTo);
+
+  	/**
+     * Registers a KML file for use with a CCoeControl. Although a file
+     * has been registered, the policy for this UID is still unsupported
+     * since no actions have been registered.
+     * @since S60 3.2
+     *
+     * @param aUid. The UID for which the KML file contains actions.
+     * @param aThreadId, the Thread ID to associate the kml files with.
+     * @param aResourceDir. Descriptor containing the full path to
+     * 		  the location of the KML file.
+     * @param aFilename. Descriptor containing the filename of the 
+     * 		  KML file.
+     */    
+  	void RegisterControlKmlL(const TUid &aUid, 
+  							 const TThreadId& aThreadId,
+  							 const TDesC& aResourceDir, 
+  							 const TDesC& aFilename,
+  							 TInt aWantedTime = -1,
+  							 TInt aMinTime = -1);
+  	
+  	/**
+     * Unregisters a KML file for the supplied UID. This method will 
+     * also unregister all actions for this UID.
+     * @since S60 3.2
+     *
+     * @param aUid. The UID to unregister.
+     * @return KerrNone if successfully unregistered, otherwise
+     *		   KErrNotFound.
+     */    
+  	TInt RemoveControlKml(const TUid &aUid);
+  	
+  	/**
+     * Unregisters KML files for the supplied Thread ID. This method will 
+     * also unregister all actions from them.
+     * @since S60 3.2
+     *
+     * @param aThreadId. The thead ID to unregister for.
+     * @return KerrNone if successfully unregistered, otherwise
+     *		   KErrNotFound.
+     */    
+  	TInt UnregisterControlKml(const TThreadId& aThreadId);
+  	
+  	
+  	/**
+     * Retrieves the resource directory, filename and action for a 
+     * CCoeControl animation based on the UID and Action supplied.
+     * If the action was not found the supplied pointer will be set
+     * to NULL.
+     * @since S60 3.2
+     *
+     * @param aUid. UID of the CCoeControl.
+     * @param aAction. Action to be performed.
+     * @param aResourceDir. Pointer reference that will contain the
+     *		  full path to where the KML file is located. Not owning.
+     * @param aFileName. Pointer reference that will contain the
+     *		  filename. Not owning.
+     * @param aActionString. Pointer reference that will contain the
+     *		  string-name of the action to be performed.
+     * @return KerrNone if data was found otherwise KErrNotFound.
+     */    
+  	TInt GetControlKml(	TUid aUid, TUint aAction, TPtrC& aResourceDir, 
+  						TPtrC& aFileName, TPtrC& aActionString, TInt& aCachePriority,
+  						TInt& aWantedTime, TInt& aMinTime);
+  	
+   	/**
+     * Registers an actionstring  for a CCoeControl with a <UID, Action>
+     * pair. This method will fail if no KML file has been registered for  
+     * the UID.
+     * @since S60 3.2
+     *
+     * @param aUid. UID for which to register the action string.
+     * @param aAction. Action for which to register the actionstring.
+     * @param aActionString. Descriptor containing the action string
+     *		  to register.
+     * @return KErrNone if successfull, otherwise any of the system
+     *		   error codes.
+     */    
+  	TInt RegisterControlAction( const TUid aUid, TUint aAction, 
+  								const TDesC& aActionString);
+  	
+  	/**
+     * Unregisters an CCoeControl transition action for a UID.
+     * @since S60 3.2
+     *
+     * @param aUid. UID for which to unregister the action.
+     * @param aAction. Action to unregister.
+     * @return KErrNone if action is unregistered, otherwise KerrNotFound.
+     */    
+  	TInt UnregisterControlAction( const TUid aUid, TUint aAction );
+
+private:
+    CPolicyHandler();
+
+  	/**
+     * Looks through the stored policy list for a specific policy.
+     * @since S60 3.2
+     *
+     * @param aAction. Action too look for.
+     * @param aUidT. Uid to look for
+     * @param aPolicy. Reference to a CActionPolicy where the policy
+     *		  will be stored for future reference.
+     * @param aIndex. Reference where the index of the policy item 
+     *		  will be stored for future reference.
+     * @return KErrNone if found. Otherwise KErrNotFound.
+     */    
+    TInt FindControlPolicy(	TUint aAction, TUid aUidT, 
+    						CActionPolicy*& aPolicy, TInt& aIndex);
+    
+private:	// data
+    RPointerArray<CFullscreenPolicy> 	iFullscreenPolicies;
+    
+    RPointerArray<CControlPolicy> 		iControlPolicies;
+    
+    CPolicyClientRequestHandler* 		iClientRequestHandler;
+    
+    RPointerArray<TFullScreenBlock> 	iFullScreenBlocks;
+
+    RPointerArray<CListBoxPolicy> 		iListBoxPolicies;
+
+    };
+
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfpolicyrequesthandler.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,290 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Handles sending policy updates to connected clients.
+*
+*/
+
+
+#ifndef __ALFPOLICYREQUESTHANDLER
+#define __ALFPOLICYREQUESTHANDLER
+
+//======= System includes =======
+#include <e32cmn.h>
+#include <e32base.h>
+#include <s32file.h>
+
+//======= User includes =======
+#include "alfpolicy.h"
+//#include "tfxserverclient.h"
+
+//======= Forward declarations =======
+class CPolicyHandler;
+class CPolicyClientRequestHandler;
+
+/**
+ *  Helper class.
+ *	This is basically a copy of the class that has already been defined in 
+ *	policy.h. The difference between this class and the original one is the destructor
+ *	This class does not call ResetAndDestroy on iControlPolicies since these are
+ *  copies of the original ones.
+ *	This class is used when retrieving the original policies that are already stored
+ *	in the system.
+ *	This class works as a container class and is friend with the classes that used it.
+ *
+ *  @since S60 3.2
+ */ 
+NONSHARABLE_CLASS(CClientControlPolicy) : public CBase
+	{
+public:
+	CClientControlPolicy();
+	~CClientControlPolicy();
+private:
+	friend class CPolicyClientRequestHandler; 
+	friend class CPolicyHandler;
+    friend class CPolicyEventReq;
+	TUid iUid;
+	RBuf16 iResourceDir;
+	RBuf16 iFilename;
+	RPointerArray<CActionPolicy> iControlPolicies;	// Never destroy this!
+	};
+	
+/*
+ * Helper class to handle transmission of policies when a client requests one
+ * This is created the first time a client connects and requests policies. 
+ * This class works as a container class and is friend with the classes that used it.
+ * 
+ * Since S60 V3.1
+ */
+NONSHARABLE_CLASS(CPolicyEventReq) : public CBase
+	{
+public:
+    CPolicyEventReq();
+    ~CPolicyEventReq();
+    TUint TotalPolicyCount() const;
+private:
+	friend class CPolicyClientRequestHandler;
+	TThreadId iClientId;
+	RMessagePtr2 iMessage;
+	RPointerArray<CClientControlPolicy> 	iOriginalControlPolicies;	// Original already stored policies
+	RPointerArray<TControlPolicy> 			iAddedPolicies;				// Recently added policies
+	RPointerArray<TControlPolicy> 			iRemovedPolicies;			// Recently removed policies.
+	};
+
+/**
+ *	Handler class for Client policies.
+ *	Keeps track of which clients have received which policies.
+ *	@since S60 3.2
+ */
+NONSHARABLE_CLASS(CPolicyClientRequestHandler) : public CBase
+	{
+public:
+	CPolicyClientRequestHandler(CPolicyHandler* aParent);
+	~CPolicyClientRequestHandler();
+	/**
+	 * Adds or update a policy for all connected clients.
+	 *
+	 * @since S60 3.2
+	 *
+	 * @param aAction The action ID of the policy that is to be updated.
+	 * @param aUid the UID of the policy that is to be updated.
+	 * @param The policy that is to be set on the policy that 
+	 *		  corresponds to the previous parameters.
+	 * @return 
+	 */    
+	void RegisterControlAction(const TUid aUid, TUint aAction);
+	
+	/**
+     * Removes a Control policy. This will remove a policy either from
+     * the retrieved original policies, the recently added policies. If
+     * none of the above apply, it creates a policy that will be sent to
+     * the client letting the client know that the specified policy has
+     * been removed from the system. For a policy to be removed both aAction
+     * and aUid must be set in a policy item.
+     *
+     * @since S60 3.2
+     *
+     * @param aAction Action contained in the policy to be removed.
+     * @param aUid UID contained in the policy that is to be removed.
+     */    	
+     TInt RemoveControlPolicy(const TUid aUid, TUint aAction );
+     
+	/**
+     * Handles policyrequest fro mthe client. If there are no polices
+     * waiting for this client, the message will be stored away and completed
+     * when a new policy is added. This policy may either be a new policy, updated
+     * policy or remove policy request.
+     *
+     * @since S60 3.2
+     *
+     * @param aMessage. Reference to the original message.
+     * @return KErrNone or any of the system error code.
+     */    	
+	TInt RequestPolicy(const RMessage2& aMessage);
+	
+	/**
+     * Handles GetPolicy request from a client. The message that is received
+     * from the client must conatain a TTServerControlPolicy at position 0. 
+     * The TTServerControlPolicy structure is filled with data from a waiting policy.
+     * Policies are sent in a LIFO way.
+     *
+     * @since S60 3.2
+     *
+     * @param aClientId id of the client that wants the policies
+     * @param aPolicyCount number of policies the caller can handle
+     * @param aOutBuf the buffer that will be filled with the policies
+     * @return KErrNone or any of the system error messages.
+     */    	
+	TInt GetPolicyL( TThreadId aClientId, TInt aPolicyCount, TPtr8& aOutBuf );
+
+	/**
+     * Removes all data that is used for a client.
+     *
+     * @param aClientId client id
+     */    	
+	void RemoveClient( TThreadId aClientId );
+	
+	/**
+     * Removes all requests that belong to terminated clients.
+     *
+     * @since S60 3.2
+     */
+	void RemoveDeadClients();
+	
+	/**
+	 * Dumps a list of threadids of all connected clients waiting for 
+	 * policy updates
+	 *
+	 * Used for testing
+     * @since S60 3.2
+	 *
+	 * @param aFile an open write stream to dump clients to.
+	 */
+	void DumpClientsL(RFileWriteStream& aFile);
+	
+	/**
+	 * Return total number of policies
+	 */
+    TUint TotalPolicyCount() const;
+
+private:
+
+	/**
+     * Inserts a client into the client list. This method also retrieves
+     * all policies that already have been stored in the system. If no 
+     * policies exist, the message is stored for later copletion when a new
+     * policye gets inserted.
+     * 
+     * @since S60 3.2
+     * 
+     * @param aMessage. Reference to the original message.
+     * @return KErrNone or one of the system error codes.
+     *
+     */    	
+     TInt InsertClient(const RMessage2& aMessage);
+
+	/**
+     * Searches the iAddedPolicies array for a UID corresponding to the inserted UID. If not found,
+     * it creates a new CControlPolicy entry and adds a TActionPolicy. If the UID is found, it calls
+     * AddControlPolicy.
+     *
+     * @since S60 3.2
+     *
+     * @param aPtr RPointerArray containing a list of CControlPolicies.
+     * @param aUid UID to add.
+     * @param aAction. Action to add.
+     * @param aPolicy. Policy to set.
+     * @return KErrNone if CControlPolicy contaning UID was found or created. Otherwise KErrNoMemory or
+     *		   one of the system error messages.
+     */    	
+	TInt AddControlPolicyAction( RPointerArray<TControlPolicy>& aAddedPolicies, 
+								 RPointerArray<TControlPolicy>& aRemovedPolicies,
+								 const TUid aUid, TUint aAction);
+	
+	/**
+     * Searches the retrieved list of policies for a policy corresponding to the UID and action.
+     *
+     * @since S60 3.2
+     *
+     * @param aPtr. Pointer array containing a list of policies.
+     * @param aUid. UID to search for.
+     * @param aAction. Action to search for.
+     * @return KErrNone if found otherwise KErrNotFound.
+     */    	
+	TInt CheckStoredControlPolicy(RPointerArray<CClientControlPolicy>& aPtr, const TUid aUid, TUint aAction);
+	
+	/**
+     * Searches for a CControlPolicy object containing the UID inserted. If found, it calls RemovePolicyInfo.
+     * If the CControlPolicy object doesn't contain any policy actions after the call, it will be removed.
+     *
+     * @since S60 3.2
+     * 
+     * @param aPolUid. Array containing pointers to CControlPolicy objects.
+     * @param aAction. Action of the policy to remove.
+     * @param aUid. UID of the policy to remove.
+     * @return KErrNone if policy is removed, KErrNotFound if policy is not found or one of
+     *		   the system error codes.
+     */    	
+	TInt RemovePolicyUid(RPointerArray<TControlPolicy>& aPolUid, TUint aAction, const TUid aUid);
+
+	/**
+     * Searches for a CClientControlPolicy object containing the UID inserted. If found, it calls 
+     * RemovePolicyInfo. If the CClientControlPolicy object doesn't contain any policy actions after 
+     * the call, it will be removed.
+     *
+     * @since S60 3.2
+     * 
+     * @param aPolUid. Array containing pointers to CClientControlPolicy objects.
+     * @param aAction. Action of the policy to remove.
+     * @param aUid. UID of the policy to remove.
+     * @return KErrNone if policy is removed, KErrNotFound if policy is not found or one of
+     *		   the system error codes.
+     */    	
+	TInt RemovePolicyUid(RPointerArray<CClientControlPolicy>& aPolUid, TUint aAction, const TUid aUid);
+
+	/**
+     *
+     * @since S60 3.2
+     * 
+     * @param aPolInfo. Reference to a pointer array containing a list of policy actions.
+     * @param aAction. Action to delete.
+     * @param aDelete. If ETrue, really delete the pointer otherwise, only remove the pointer from 
+     *        the pointerarray with Remove()
+     * @return KErrNone 
+     */    	
+	TInt RemovePolicyInfo(RPointerArray<CActionPolicy>& aPolInfo, TUint aAction, TBool aDelete = EFalse);
+
+private: //data	
+	// Array containing identifiers of connected clients.
+	RPointerArray<CPolicyEventReq> 	iControlPolicyClients;	
+
+// Having everything in one array did not work very well, must keep the original implementation
+// for the time being
+// We have only one client (singleton, so we store everything in one place.
+// It should be simpler to have only one set or arrays to keep up to date
+//	RPointerArray<CClientControlPolicy> 	iOriginalControlPolicies;	// Original already stored policies
+//	RPointerArray<TControlPolicy> 			iAddedPolicies;				// Recently added policies
+//	RPointerArray<TControlPolicy> 			iRemovedPolicies;			// Recently removed policies.
+// I assume that there can be only one pending message (because we are called by a singleton).
+// If there can be more, we must make this an array.	
+// We leave this to CPolicyEventReq for the time being...
+//	RMessagePtr2 iMessage;
+
+	// Pointer to main class for GetAllPolicies. Not owned!
+	CPolicyHandler* iParent;
+	
+	};
+	
+	
+
+#endif // __ALFPOLICYREQUESTHANDLER
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfserverdrawer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,198 @@
+/*
+* Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 server plugin, used by transition server to control
+*                framebuffers.
+*
+*/
+
+
+
+#ifndef __ALFSERVERDRAWER_H__
+#define __ALFSERVERDRAWER_H__
+
+#include <e32std.h>
+#include <w32std.h>
+#include <e32property.h>
+
+#include "alfdrawerengine.h"
+
+class CWsServerDrawerController;
+class CIdle;
+class RWsSession;
+class CAlfWindowManager;
+class CAlfWindow;
+class CPolicyHandler;
+class CAlfFinishTimer;
+class CPSObserver;
+
+/**
+ *  crp used by the server to control framebuffers, and used as proxy for
+ *  fullscreen messages.
+ *
+ *  @since S60 3.2
+ */
+ NONSHARABLE_CLASS(CAlfServerDrawer): public CBase, public MAlfDrawerEngine 
+	{
+public:
+
+	static CAlfServerDrawer* NewL( CAlfWindowManager* aWindowManager,
+	    CPolicyHandler& aPolicyHandler );
+
+    enum TScreenModeChangedStates
+        {
+        EScreenModeChangedIdle,
+        EScreenModeBeginHasBeenCalled,
+        EScreenModeChangedWaitingForScreenUpdated
+        };
+
+    ~CAlfServerDrawer();
+
+	TInt BeginControlTransition( TUint aAction, TUid aControlUid,
+	    TInt aWindowGroup, TInt aWindowHandle );
+	void EndControlTransition( TInt aHandle );
+	void UnredirectEvent( TInt aHandle );
+
+    void PrepareFullscreen();
+    // parameters are analyzed by CAlfGfxEffects
+    
+    void BeginFullscreen( TInt aAction, const TRect& aEffectRect, 
+						TInt aType, const TUid aUid1, const TUid aUid2, TInt aData );
+    void EndFullscreen();
+    void CancelFullscreen();
+    void AbortFullscreen();
+    void RegisterAlfFullScreenEffect( TInt aAction, const TDesC& aResourceDir,
+            const TDesC& aFileName);
+    void UnregisterAlfFullScreenEffect( TInt aAction );
+    void UnregisterAllAlfFullScreenEffect();
+    void BeginSyncronizedGroup(TInt aGroupId);
+    void EndSyncronizedGroup(TInt aGroupId, TBool aForced = EFalse);
+    
+    /**
+    * From MAlfDrawerEngine
+    */
+	
+	TUid& FromUid();
+	TUid& ToUid();
+	TUint& Action();
+	TInt& Flags();
+
+	void IncreaseHandle();
+	TInt CurrentHandle();
+	
+	void StartEndChecker();
+	void CancelEndChecker();
+
+	TInt SendBeginFullscreen(TInt aHandle, TUint aAction, const TUid& aUid, 
+							 const TUid& aPreviousUid, const TRect& aEffectRect);
+	TInt SendEndFullscreen();
+	TInt SendAbortFullscreen();
+	TInt SendAbortControlTransition();
+	void SendBeginFullscreen();
+    void DoSendBeginFullscreenL();
+	TInt SendBeginControlTransition();
+	TInt SendFinishControlTransition();
+	
+    TBool EffectFinishedFullScreen() const;
+    
+	static TInt FailedFullscreen(TAny* aArg);
+
+    TBool ScreenModeChanged() const;
+    
+    
+private:
+	CAlfServerDrawer( CAlfWindowManager* aWindowManager, CPolicyHandler& aPolicyHandler );
+	void ConstructL();
+	static TInt AsyncConstruct(TAny* aThis);
+
+	TAny* ResolveObjectInterface(TUint aTypeId);
+	
+private:
+    static TInt ScreenModeChangedTimeoutL( TAny* aServerDrawer );
+    void HandleScreenModeChangedTimeoutL();
+    
+    static TInt FullScreenTimeout( TAny* aServerDrawer );
+    void HandleFullScreenTimeout();
+    
+    static TInt FinishFullScreenTimeout( TAny* aServerDrawer );
+    void HandleFinishFullScreenTimeout();
+
+    static TInt ControlTimeout( TAny* aServerDrawer );
+    void HandleControlTimeout();
+    
+    static TInt TransitionFinished( TAny* aServerDrawer );
+    void HandleTransitionFinished(); 
+    
+    TBool FileExistsL( TPtrC& aResourceDir, TPtrC& aFileName );
+        
+private: // data
+
+public:
+	CWsServerDrawerController* iController;
+	CAlfWindowManager* iWindowManager;
+    CPolicyHandler& iPolicyHandler;
+	TBool iInScreenModeChange;
+
+    CIdle* iIdle; //CIdle for async function calls.
+
+    TInt iCurrHandle;
+
+    TUint iAction;
+    TUint iOldAction;
+    TInt iFlags;
+    TRect iEffectRect;
+    TRect iControlRect; // demarcation rectangle for control effects
+    TUid iFromUid;
+    TUid iToUid;
+    
+    TInt iFromWg;
+    TInt iToWg;
+    TBool iWaitingForRootWgId;
+    TInt iFromScreen;
+    TInt iToScreen;
+    
+    TUid iParentUid;
+    TInt iFocusWg;
+    
+    // Component transition data
+    TUint iControlAction;
+    TUid iControlUid;
+    TInt iControlWindowGroup;
+    TInt iControlHandle;
+    
+    TInt iType; // parameter type for GFX parameters
+    TScreenModeChangedStates iScrModeChangedState;
+    CAlfFinishTimer* iFullScreenTimeout;
+    CAlfFinishTimer* iFinishFullScreen;
+    
+    // This variable tells if the full screen transition was finished
+    // by a signal from Effect Engine (via AlfBridge)
+    // or if timeout finished the transaction.
+    TBool iFullScreenFinished;
+
+    // This is an array of reserverd windows
+    // We do not own these pointers, and must not delete them.
+    RPointerArray<CAlfWindow> iReservedWindows;
+    
+    CPSObserver* iTransitionEndObserver;
+    RProperty iProperty;
+    
+    TBool iDoNotClearEffectRect;
+    
+    RFs iFs;
+    TBool iFullScreenFxSent;
+    TBool iFullScreenEndSent;
+    };
+
+
+#endif //__ALFSERVERDRAWER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfsystemeffects.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Alf system effects
+*
+*/
+
+
+#ifndef ALFSYSTEMEFFECTS_H
+#define ALFSYSTEMEFFECTS_H
+
+#include <e32base.h>
+#include <alf/AlfTransEffectPlugin.h>
+#include <akntranseffect.h>
+#include "alftfxplugincommon.hrh"
+
+// CONSTANTS
+const TUid KAlfTfxSystemEffectsImpUid = { KAlfTfxSystemEffectsImpUidValue };
+
+// CLASS DECLARATION
+
+/**
+ *  System effects class for ALF server plugin
+ *
+ *  @since S60 v3.2
+ */
+class CAlfSystemEffects:	public CBase, public MAlfTransEffectPlugin
+	{
+	public: // Construction and destruction
+
+    	/**
+     	* Create a new instance of the interface
+     	* 
+     	* @return pointer to the instance
+     	*/
+			static MAlfTransEffectPlugin* NewExtensionL();
+
+    	/**
+     	* Destructor
+     	*/
+			virtual ~CAlfSystemEffects();
+
+	private: // From MAlfTransEffectPlugin
+
+    	TInt GetSupportedEffects( RArray<TInt>& aSupportedEffectIds );
+    	TInt StartPhase( TInt aPhaseId, TInt aEffectId, CAlfSrvEffectEnv& aEffectEnv, const TDesC8* aParams );
+    	TInt Abort() { return KErrNone; };
+    	TInt AddEventObserver( MAlfTransEffectObserver* /*aObserver*/, TInt /*aEvents*/, const TDesC8* /*aParams*/ ) { return KErrNone; };
+   		TInt RemoveEventObserver( MAlfTransEffectObserver* /*aObserver*/, TInt /*aEvents*/ ) { return KErrNone; };
+  		TInt GetEventState( TInt /*aEvent*/, TInt* /*aState*/, TDes8* /*aParams*/ ) { return KErrNone; };
+    
+	private: // New
+    	/**
+     	* Leaving version of StartPhase().
+     	*/
+	    TInt DoStartPhaseL( TInt aPhaseId, TInt aEffectId, CAlfSrvEffectEnv& aEffectEnv, const TDesC8* aParams );
+	    
+	    void ShowVisibleGroupsAndMakeNonTransparentL(CAlfSrvEffectEnv& aEffectEnv);
+	    void HideGroupsAndMakeTransparentL(CAlfSrvEffectEnv& aEffectEnv);
+	    	
+private: // Construction and destruction
+
+    	/**
+     	* C++ contructor
+     	*/
+			CAlfSystemEffects();
+
+    	/**
+     	* Second phase constructor
+     	*/
+			void ConstructL();
+	};
+
+#endif // ALFSYSTEMEFFECTS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alftfxplugincommon.hrh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Alf system effects
+*
+*/
+
+
+
+#ifndef ALFTFXPLUGINCOMMON_HRH
+#define ALFTFXPLUGINCOMMON_HRH
+
+// CONSTANTS
+
+// Extension UIDs for all extensions
+#define KAlfTransEffectPlugDllUidValue   		0x10282CAF  // DLL uid 
+#define KAlfTfxSystemEffectsImpUidValue   	0x10282CAF  // DLL uid can be reused for one plugin implementation
+
+#define KAlfGfxImplUidValue     0x2001E2CF // implementation uid for interface 0x2001E2D0
+
+#endif // ALFTFXPLUGINCOMMON_HRH
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alftfxserverobserver.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   contains a class for use by the GfxTransEffect adapter to communicate
+*                with the transition server
+*
+*/
+
+
+#ifndef R_ALFTFXSERVEROBSERVER
+#define R_ALFTFXSERVEROBSERVER
+
+
+#include <e32base.h>
+class TControlPolicy;
+
+/**
+ *  interface to implement, to recieve callbacks from server.
+ *
+ *  @since S60 3.2
+ */
+NONSHARABLE_CLASS( MTfxServerObserver )
+	{
+	public:
+		/**
+		 * Called when a new policy arrives
+	     * @param aPolicy the new policy
+	    */  
+		virtual void PolicyUpdate( TControlPolicy* aPolicy ) = 0;
+		
+		/**
+		 * Called when all policies clientside needs to be cleared.
+		 */
+		virtual void ClearAllPolicies() = 0;
+		
+		/**
+		 * Called when a transition finishes for this handle
+	     * @param aHandle handle of finished transition
+	    */  
+//		virtual void TransitionFinished(TInt aHandle) = 0;
+
+	};
+
+#endif // R_ALFTFXSERVEROBSERVER
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/debug.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,96 @@
+/*
+* 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: 
+*
+*/
+
+#ifndef DEBUG_H
+#define DEBUG_H
+
+#include <e32debug.h>
+
+#ifdef _DEBUG //No debugging unless in Debug mode...
+	//#define DEBUG_ON_TARGET //define to get debug output also on target.
+	#ifdef __WINS__
+		//This is the config on emulator.
+		//#define DEBUG_PRINTS 
+		//#define DEBUGPRINTS_AS_FLOG
+
+	#elif defined(DEBUG_ON_TARGET)
+		//This is the config for target, when debuging on target is on.
+		#define DEBUG_PRINTS
+		//#define DEBUGPRINTS_AS_FLOG
+
+	#endif
+#endif
+//#define FLOG_PRINTS //This can be used to use FLOGs without support for DEBUG_PRINTS.. probably not useful...
+
+
+
+#if defined(FLOG_PRINTS) || defined(DEBUGPRINTS_AS_FLOG)
+
+	#include <flogger.h>
+	_LIT(KLogFile, "AlfFxServerLog.txt");
+	_LIT(KLogDir, "AlfGfxtest");
+
+	#define FLOG(x) RFileLogger::Write(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x))
+	#define FLOG1(x,a1) RFileLogger::WriteFormat(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x),a1)
+	#define FLOG2(x,a1,a2) RFileLogger::WriteFormat(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x),a1,a2)
+	#define FLOG3(x,a1,a2,a3) RFileLogger::WriteFormat(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x),a1,a2,a3)
+	#define FLOG4(x,a1,a2,a3,a4) RFileLogger::WriteFormat(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x),a1,a2,a3,a4)
+	#define FLOG5(x,a1,a2,a3,a4,a5) RFileLogger::WriteFormat(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x),a1,a2,a3,a4,a5)
+
+#else
+
+	#define FLOG(x)
+	#define FLOG1(x,a1)
+	#define FLOG2(x,a1,a2)
+	#define FLOG3(x,a1,a2,a3)
+	#define FLOG4(x,a1,a2,a3,a4) 
+	#define FLOG5(x,a1,a2,a3,a4,a5) 
+
+#endif
+
+#if defined(DEBUG_PRINTS) && !defined(DEBUGPRINTS_AS_FLOG)
+	// Prints via RDebug
+	#define DEBUG_PRINT(x) RDebug::Printf("AFX:  "##x)
+	#define DEBUG_PRINT1(x, a1) RDebug::Printf("AFX:  "##x, a1)
+	#define DEBUG_PRINT2(x, a1, a2) RDebug::Printf("AFX:  "##x, a1, a2)
+	#define DEBUG_PRINT3(x, a1, a2, a3) RDebug::Printf("AFX:  "##x, a1, a2, a3)
+	#define DEBUG_PRINT4(x, a1, a2, a3, a4) RDebug::Printf("AFX:  "##x, a1, a2, a3, a4)
+	#define DEBUG_PRINT5(x, a1, a2, a3, a4, a5) RDebug::Printf("AFX:  "##x, a1, a2, a3, a4, a5)
+
+#elif defined(DEBUGPRINTS_AS_FLOG)
+	// Prints via flogger
+	#define DEBUG_PRINT(x) FLOG(x)
+	#define DEBUG_PRINT1(x, a1) FLOG1(x, a1)
+	#define DEBUG_PRINT2(x, a1, a2) FLOG2(x, a1, a2)
+	#define DEBUG_PRINT3(x, a1, a2, a3) FLOG3(x, a1, a2, a3)
+	#define DEBUG_PRINT4(x, a1, a2, a3, a4) FLOG4(x, a1, a2, a3, a4)
+	#define DEBUG_PRINT5(x, a1, a2, a3, a4, a5) FLOG5(x, a1, a2, a3, a4, a5)
+
+#else 
+	/*lint -e960 */
+	// No prints
+	#define DEBUG_PRINT(x) 
+	#define DEBUG_PRINT1(x, a1) 
+	#define DEBUG_PRINT2(x, a1, a2) 
+	#define DEBUG_PRINT3(x, a1, a2, a3) 
+	#define DEBUG_PRINT4(x, a1, a2, a3, a4) 
+	#define DEBUG_PRINT5(x, a1, a2, a3, a4, a5)
+	/*lint +e960 */
+	
+#endif // DEBUG_PRINTS
+
+#endif // DEBUG_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/debuglogger.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Utility for debug prints to file
+*
+*/
+
+
+
+#ifndef C_DEBUGLOGGER_H
+#define C_DEBUGLOGGER_H
+
+//file only included with one of these debug flags enabled.
+#if defined(TFXSERVER_TIME_LOG) || defined(WSSERVERDRAWER_TIME_LOG)
+
+#include <e32base.h>
+#include <flogger.h>
+
+/**
+ *  Class that holds the data for one log entry, the data consists
+ *  of one string and up to 4 integers
+ *
+ *  @since S60 3.2
+ */
+NONSHARABLE_CLASS(CLogEntry) : public CBase
+	{
+public:
+	CLogEntry(const TDesC16& aMsg, TInt aNbrArg, TInt aArg1=0, TInt aArg2=0, TInt aArg3=0, TInt aArg4=0);
+	~CLogEntry();
+
+//data
+	HBufC16 *iMsg;
+	TInt iNbrArgs;
+	TInt iArg1,iArg2,iArg3,iArg4;
+	};
+
+/**
+ *  Class that stores LogEntrys and later writes them to a file.
+ *  This can be used to get output on target without taking to much time.
+ *
+ *  @since S60 3.2
+ */
+NONSHARABLE_CLASS(CDebugLogger) : public CBase
+	{
+public:
+	CDebugLogger();
+	~CDebugLogger();
+	void Log(const TDesC16& aMsg);
+	void Log1(const TDesC16& aMsg, TInt aArg1);
+	void Log2(const TDesC16& aMsg, TInt aArg1, TInt aArg2);
+	void Log3(const TDesC16& aMsg, TInt aArg1, TInt aArg2, TInt aArg3);
+	void Log4(const TDesC16& aMsg, TInt aArg1, TInt aArg2, TInt aArg3, TInt aArg4);
+	void WriteToFile(const TDesC& aLogDir, const TDesC& aLogFile);
+	TUint32 TimeMs();
+private: //data
+	RPointerArray<CLogEntry> iEntries;
+	};
+	
+
+#endif // TFXSERVER_TIME_LOG
+
+#endif //C_DEBUGLOGGER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/repositoryhandler.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Transition server repository handler.
+*
+*/
+
+
+#ifndef C_REPOSITORY_HANDLER_H
+#define C_REPOSITORY_HANDLER_H
+
+#include <e32base.h>
+
+class CRepository;
+
+NONSHARABLE_CLASS(CRepositoryHandler) : public CActive
+    {
+    CRepositoryHandler(TInt aPriority, const TUid& aRepository, TInt aKey);
+    void ConstructL();
+public:    
+
+    static CRepositoryHandler* NewL(TInt aPriority, const TUid& aRepository, TUint32 aKey);
+    ~CRepositoryHandler();
+    TInt GetValue(TInt& aValue);
+    TInt SetValue(TInt aValue);
+private:
+	/**
+     * From CActive
+     * @since S60 3.2
+     *
+    */  
+    void RunL();
+
+	/**
+     * From CActive
+     * @since S60 3.2
+     *
+    */  
+    void DoCancel();
+
+private: //data
+	CRepository* iCrep;
+
+    TUid iRepository;
+    TInt iKey;
+    TInt iValue;
+    TInt iError;
+    };
+
+#endif //C_REPOSITORY_HANDLER_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/statehandler.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,141 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   State machine interface. Used for the statemachine in the 
+*                server drawer to keep track on when a transition should be made
+*                and when not.
+*
+*/
+
+
+#ifndef _STATEHANDLER_H_
+#define _STATEHANDLER_H_
+
+#include "alfdrawerengine.h"
+
+class CStateHandler;
+class CUidBlock;
+class CUidException;
+
+/**
+ * This class should be overriden to implement new states
+ */
+NONSHARABLE_CLASS(CStateBase) : public CBase
+	{
+public:
+	CStateBase(MAlfDrawerEngine& aEngine, CStateHandler& aHandler);
+	virtual ~CStateBase();
+public:
+	enum TSignal 
+		{
+		EBeginFullscreen,
+		EEndFullscreen,
+		EFinishFullscreen,
+		EBeginComponent,
+		EFinishComponent,
+		EAbortFullscreen,
+		EAbortComponent,
+		EAbort,
+		};
+	enum TState
+		{
+		EResting,
+		EComponent,
+		EFullscreenPhase1,
+		EFullscreenPhase2
+		};
+	struct TStateInfo
+		{
+		TState iState;	
+		TUint iAction;
+		};
+
+	/**
+	 * Handles the signal.
+	 * You must override this one.
+	 *  - return new state to transition
+	 *  - return NULL to stay in the same state.
+	 */
+	virtual CStateBase* SignalL(TSignal aSignal) = 0;
+	
+	/**
+	 * Checks the block list if the uid pair should have a transition or not.
+	 */
+	virtual TBool IsBlocked(const TUid& aFromUid, const TUid& aToUid);
+	
+	inline TStateInfo& StateInfo();
+protected:	
+	TStateInfo iStateInfo;
+	MAlfDrawerEngine& iEngine;
+	CStateHandler& iHandler;
+	};
+	
+////
+CStateBase::TStateInfo& CStateBase::StateInfo()
+	{
+	return iStateInfo;
+	}
+	
+
+/**
+ * This is the state machine interface
+ */
+NONSHARABLE_CLASS(CStateHandler) : public CBase
+	{
+public:
+	enum TFullscreenType 
+		{
+		ENone,
+		EError,
+		EActivation,
+		EStart,
+		EExit,
+		EAppSpecific,
+		ELayoutSwitch,
+		};
+	
+	void Signal(CStateBase::TSignal aSignal);
+
+	TBool IsBlocked(const TUid& aFromUid, const TUid& aToUid);
+	///Some block list update functions here
+	
+	void AddBlockUid(const TUid& aUid);
+	void RemoveBlockUid(const TUid& aUid);
+
+	void AddBlockUidPair(const TUid& aFromUid, const TUid& aToUid);
+	
+	void AddExceptionUid(const TUid& aUid);
+	void AddExceptionUidPair(const TUid& aFromUid, const TUid& aToUid);
+
+	TFullscreenType GetFullscreenType(TUint aAction);
+	TFullscreenType GetCurrentFullscreenType();
+	CStateBase::TState GetState();
+public:
+	static CStateHandler* NewL(MAlfDrawerEngine* aEngine);	
+	CStateHandler(MAlfDrawerEngine* aEngine);
+	virtual ~CStateHandler();
+	void ConstructL();
+private:
+	CStateHandler();
+
+private: // data	
+	CStateBase* iState;
+	MAlfDrawerEngine& iEngine;
+	RPointerArray<CUidBlock> iBlockList;
+	RPointerArray<CUidException> iExceptionList;
+	
+	};
+	
+
+	
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/states.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   State machine state implementations
+*
+*/
+
+
+#ifndef _STATES_H_
+#define _STATES_H_
+
+#include "statehandler.h"
+
+/**
+ * Resting state
+ */
+NONSHARABLE_CLASS(CRestingState) : public CStateBase
+	{
+	CRestingState(MAlfDrawerEngine& aEngine, CStateHandler& aHandler);
+public:	
+	static CStateBase* NewL(MAlfDrawerEngine& aEngine, CStateHandler& aHandler);
+	CStateBase* SignalL(TSignal aSignal);
+	};
+
+/**
+ * Control Transition ongoing
+ */
+NONSHARABLE_CLASS(CControlState) : public CStateBase
+	{
+	CControlState(MAlfDrawerEngine& aEngine, CStateHandler& aHandler);
+public:	
+	static CStateBase* NewL(MAlfDrawerEngine& aEngine, CStateHandler& aHandler);
+	CStateBase* SignalL(TSignal aSignal);
+	};
+
+/**
+ * First phase of fullscreen transition 
+ * (BeginFullscreen received, but not yet EndFullscreen)
+ */
+NONSHARABLE_CLASS(CPhase1State) : public CStateBase
+	{
+	CPhase1State(MAlfDrawerEngine& aEngine, CStateHandler& aHandler);
+public:	
+	static CStateBase* NewL(MAlfDrawerEngine& aEngine, CStateHandler& aHandler);
+	CStateBase* SignalL(TSignal aSignal);
+	};
+
+/**
+ * Second phase of fullscreen transition
+ * (EndFullscreen has been received.)
+ */
+NONSHARABLE_CLASS(CPhase2State) : public CStateBase
+	{
+	CPhase2State(MAlfDrawerEngine& aEngine, CStateHandler& aHandler);
+public:	
+	static CStateBase* NewL(MAlfDrawerEngine& aEngine, CStateHandler& aHandler);
+	CStateBase* SignalL(TSignal aSignal);
+	};
+
+
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/uidblock.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   State machine interface. Used for the statemachine in the 
+*                server drawer to keep track on when a transition should be made
+*                and when not.
+*
+*/
+
+
+#ifndef _UIDBLOCK_H_
+#define _UIDBLOCK_H_
+
+#include <e32base.h>
+
+class CUidBlock : public CBase
+	{
+public:
+	virtual TBool IsBlocked(const TUid& aFromUid, const TUid& aToUid) = 0;
+	};
+
+
+class CFullUidBlock : public CUidBlock
+	{
+public:
+	CFullUidBlock(const TUid& aUid);
+	TBool IsBlocked(const TUid& aFromUid, const TUid& aToUid);
+private:
+	const TUid iUid;
+	};
+
+
+class CPairedUidBlock : public CUidBlock
+	{
+public:
+	CPairedUidBlock(const TUid& aUidFrom, const TUid& aToUid);
+	TBool IsBlocked(const TUid& aFromUid, const TUid& aToUid);
+private:
+	const TUid iFromUid;
+	const TUid iToUid;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/uidexception.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   State machine interface. Used for the statemachine in the 
+*                server drawer to keep track on when a transition should be
+*                always allowed.
+*
+*/
+
+
+#ifndef _UIDEXCEPTION_H_
+#define _UIDEXCEPTION_H_
+
+#include <e32base.h>
+
+class CUidException : public CBase
+	{
+public:
+	virtual TBool IsAllowed(const TUid& aFromUid, const TUid& aToUid) = 0;
+	};
+
+class CFullUidException : public CUidException
+	{
+public:
+	CFullUidException(const TUid& aUid);
+	TBool IsAllowed(const TUid& aFromUid, const TUid& aToUid);
+private:
+	const TUid iUid;
+	};
+
+class CPairedUidException : public CUidException
+	{
+public:
+	CPairedUidException(const TUid& aUidFrom, const TUid& aToUid);
+	TBool IsAllowed(const TUid& aFromUid, const TUid& aToUid);
+private:
+	const TUid iFromUid;
+	const TUid iToUid;
+	};
+
+#endif // _UIDEXCEPTION_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/wsserverdrawercontroller.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,253 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 server plugin, used by transition server to control
+*                framebuffers.
+*
+*/
+
+
+
+#ifndef SERVERDRAWERCONTROLLER_H
+#define SERVERDRAWERCONTROLLER_H
+
+#include <e32base.h>
+#include <apgcli.h>
+#ifdef WSSERVERDRAWER_TIME_LOG
+#include "debuglogger.h"
+#endif //WSSERVERDRAWER_TIME_LOG
+
+#include "statehandler.h"
+
+class MAlfDrawerEngine;
+class CAppInfoCache;
+class CEndCheck;
+class CPSListener;
+
+enum TAbortFlags 
+	{
+	EAbortFullscreen = 0x1,
+	EAbortControl = 0x2,
+	};
+
+const TUint KAknApplicationShellViewId= 0x101F4CD2; 
+const TUint KCapServerUid =  0x10207218;
+const TUint KScreensaverUid = 0x100056CF;
+
+NONSHARABLE_CLASS(MEndChecker) 
+	{
+	public:
+	virtual void EndExpired() = 0;
+	};
+
+class CEndCheck : public CTimer
+	{
+	public:
+		static CEndCheck* NewL(MEndChecker& aCallBack);
+		void Start(/*TInt aState,*/ TInt aMul = 1);
+		~CEndCheck();
+	private:
+		void RunL();
+		CEndCheck(MEndChecker& aCallBack);
+		void DoCancel();
+	private:
+		MEndChecker& iCallBack;
+		TBool iCancelled;
+	};
+
+/**
+ * Class to hold application information. 
+ */
+class CAppInfoCache : public CBase
+    {        
+    public:
+        static CAppInfoCache* NewL();
+        ~CAppInfoCache();
+        TInt SetUid(const TUid& aUid);
+        void SetAvkonUid(const TUid& aUid);
+        void RemoveAvkonUid(const TUid& aUid);
+        TBool AvkonUid(const TUid& aUid) const;
+        TBool GateFound() const;
+        void Reset(const TUid& aUid);
+        TBool IsEmbedded(const TUid& aUid) const;
+        void SetParent(const TUid& aUid, const TUid& aParentUid);
+        TInt SetAction(const TUid& aUid, TInt aAction);
+        TInt Action(const TUid& aUid);
+        TBool IsSameParent(const TUid& aUid1, const TUid& aUid2) const;
+        
+        const TUid& FocusUid() const;
+        TBool SetFocusUid(TInt aWgId); 
+        
+        void ClearActions();
+        
+    private:
+        class TAppInfo
+            {
+            public:
+                static TInt Order(const TAppInfo& aNodeA, const TAppInfo& aNodeB);
+                TAppInfo(const TUint aUid) : 
+                iUid(aUid),
+                iFlags(TAppInfo::ENone),
+                iParent(KNullUid),
+                iAction(KErrNotFound)
+                {}
+            enum TFlags
+                {
+                ENone               = 0x0,
+                EAvkonApp           = 0x1,
+                ENotOkApp           = 0x4
+                };  
+            TUint   iUid;
+            TUint   iFlags;
+            TUid    iParent;
+            TInt    iRootWgId;
+            TInt    iAction;
+            };
+    private:
+        void ConstructL();
+        void ImportL();
+        void ExportL();
+        TInt Append(TUint aUid);
+        TInt IndexOf(TUint aUid) const;
+        void ReadArrayL(RFile& aFile);
+        void WriteArrayL(RFile& aFile) const;
+        void SetAppFlags(const TUid& aUid, TUint aFlag, TBool aSet);
+        TBool GetAppFlags(const TUid& aUid, TUint aFlag) const;
+    private:
+        RApaLsSession iLs;
+        RArray<TAppInfo> iAppInfo;
+        TUid iFocusedUid;
+    };
+
+NONSHARABLE_CLASS(CWsServerDrawerController) : public CBase, public MEndChecker
+	{
+public:
+	/** errors that the wsserverdrawer can inform the controller about through 
+		the Error function */
+	enum TServerDrawerError
+		{
+		EHandleMessageError
+		};
+	
+	/**
+    */  
+	static CWsServerDrawerController* NewL(MAlfDrawerEngine* aEngine);
+
+	/**
+     */  
+	~CWsServerDrawerController();
+	
+	/**
+    */  
+	void BeginFullscreen(TInt aType, const TUid aUid1, const TUid aUid2, TInt aData );
+
+	/**
+    */  
+	void EndFullscreen(TBool aFromGfx);
+
+	/**
+    */  
+    void FullscreenFinished(TInt aHandle);
+	
+	/**
+    */  
+	TInt BeginControlTransition();
+
+	/**
+    */  
+	void EndControlTransition(TInt aHandle);
+	
+	/**
+    */  
+	void ScreenModeChange(TBool aBeforeScreenModeChange);
+
+	/**
+    */  
+	void Error(TServerDrawerError aError);
+	
+	/**
+     */
+	void DSABegin();
+	/**
+     */
+	void DSAEnd();
+	
+
+	/**
+	* Stops the oncoming and current transition and sets
+	* the state machine the resting state.
+	*/
+	void AbortTransition(TInt aToAbort = EAbortFullscreen|EAbortControl);
+
+
+	const TUid& FocusUid();
+
+	TBool SetFocusUid(TInt aUid);
+
+	void StartEndChecker(TInt aMultiplier = 1);
+
+    void CancelEndChecker();
+    /**
+    */
+    void EndExpired();
+
+    /** Saves the current Engine action and Uids */
+    void SaveLastActionAndUid();
+
+    TInt GetState( TInt aState ) const;
+    
+    TBool IsBlocked( const TUid& aFromUid, const TUid& aToUid );
+    
+public:
+    
+    CAppInfoCache& AppInfoCache()
+        {
+        return *iAppInfoCache;
+        }
+    
+private:
+
+    /**
+    */
+    CWsServerDrawerController(MAlfDrawerEngine* aEngine);
+
+	/**
+    */  
+	void ConstructL();
+
+	TBool StartCheck(TInt aFlags) const;
+
+    void AddStateL(const TUid& aUid, TInt aKey);
+private:
+	TUid iCurrentUid; 
+	CAppInfoCache* iAppInfoCache;
+	CEndCheck* iEndCheck;
+	MAlfDrawerEngine* iEngine; //not owning
+	RPointerArray<CPSListener> iPSStates;
+	CStateHandler::TFullscreenType iLastTypeTried;
+	TInt iLastAction;
+	TUid iLastFromUid;
+	TUid iLastToUid;
+    TBool iLayoutChangeActive;
+    TBool iExitAborted;
+	TBool iDSAActive;       //ETrue if dsa is currently active
+
+	CStateHandler* iStates;
+
+#ifdef WSSERVERDRAWER_TIME_LOG
+	CDebugLogger *iLogger;
+#endif //WSSERVERDRAWER_TIME_LOG
+	};
+
+#endif //SERVERDRAWERCONTROLLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/sis/alftranseffectplugin.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,48 @@
+;
+; 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: 
+;
+
+; ============================================================================
+;  Name        : alftranseffectplugin.pkg
+;  Part of     : Alfred
+;  Description : Package file for project hitchcock
+;  Version     : %version: 1 % << Don't touch! Updated by Synergy at check-out.
+;
+;  Copyright © 2006-2007 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.1
+
+; standard SIS file header
+#{"Alf transition effect plugin"},(0x10282CAF),1,0,0
+
+;Supports Series 60 v 3.0
+(0x101F7961), 0, 0, 0, {"Series60ProductID"}
+
+;Localized Vendor Name
+%{"Nokia-EN"}
+
+;Unique Vendor name
+:"Nokia"
+
+; Files to copy
+"\epoc32\release\armv5\urel\AlfTransEffectPlugin.dll"-"!:\sys\bin\AlfTransEffectPlugin.dll"
+"\Epoc32\Data\Z\resource\plugins\AlfTransEffectPlugin.rsc"-"!:\resource\plugins\AlfTransEffectPlugin.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/sis/createsisx.bat	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,24 @@
+rem
+rem Copyright (c) 2009 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 Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description: 
+rem
+
+@echo off
+echo DoTo: update the location for certificate and private key files
+
+set certificate_file=..\..\..\..\internal\certificates\rd.cer
+set private_key_file=..\..\..\..\internal\certificates\rd-key.pem
+
+makesis alftranseffectplugin.pkg
+signsis alftranseffectplugin.sis alftranseffectplugin.sisx %certificate_file% %private_key_file%
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/10282CAF.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 1028 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ECom resource file
+*
+*/
+
+
+
+NAME ALFX
+
+#include "registryinfo.rh"
+
+#include <alf/AlfTransEffectPlugin.hrh>
+#include "alftfxplugincommon.hrh"
+
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	// UID for the DLL
+//	dll_uid = 0x10282CAF; 
+	dll_uid = KAlfTransEffectPlugDllUidValue; 
+
+	// Declare array of interface info
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			// UID of the Gfx interface
+			interface_uid = 0x2001E2D0;
+			implementations = 
+			    {
+			    IMPLEMENTATION_INFO
+    			    {
+    			    implementation_uid = 0x2001E2CF;
+    	    		version_no = 1;
+        			display_name = "GfxPlugin";
+    		    	default_data = "";
+    			    opaque_data = KAlfDoNotUnloadPluginRss;
+    			    }
+    			};
+			},
+		INTERFACE_INFO
+			{
+			// UID of interface that is implemented
+			interface_uid = KAlfTransEffectPluginInterfaceUidValue; // Common uid for all Alf tfx plugins 
+						
+			implementations =
+				{
+				
+				// System effect plugin 
+				
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = KAlfTfxSystemEffectsImpUidValue; 
+					version_no = 1;
+					display_name = "";
+					default_data = KAlfTransEffectPluginTypeString; // Common string for all Alf tfx plugins 
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfgfxeffects.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,973 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Alf system effects
+*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <bitdev.h>
+#include <implementationproxy.h>
+#include <akntranseffect.h>
+#include <pslninternalcrkeys.h>
+#include <s32mem.h> //RMemReadStream
+
+#include "alftfxplugincommon.hrh"
+#include "alfgfxeffects.h"
+#include "alf/alfsrveffectenv.h"
+#include "alfstreamerbridge.h"
+#include "alfwindowmanager.h"
+#include "alfserverdrawer.h"
+#include "repositoryhandler.h"
+#include "alftfxserverdef.h"
+#include "alfpolicyhandler.h"
+#include "alflogger.h"
+
+#include "uiacceltk/HuiDisplay.h"
+#include "uiacceltk/HuiLayout.h"
+#include "uiacceltk/HuiControlGroup.h"
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiRoster.h"
+#include "uiacceltk/HuiCommand.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiTransformation.h"
+
+#include "wsserverdrawercontroller.h"
+
+// Constants
+//const TInt KAlfDefaultFocusGainedEffectDuration = 500;
+//const TInt KAlfDefaultFocusLostEffectDuration = 500;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// -----------------------------------------------------------------------------
+// CAlfGfxEffects::CAlfGfxEffects
+// C++ constuctor.
+// -----------------------------------------------------------------------------
+//
+CAlfGfxEffects::CAlfGfxEffects( ) 
+    {
+    __ALFFXLOGSTRING("CAlfGfxEffects::CAlfGfxEffects");
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAlfGfxEffects::EndExpired
+// Timeout for grouped effects, that have not received EndGroup or have received 
+// EndGroup with non-existing group id.
+// -----------------------------------------------------------------------------
+//
+void CAlfGfxEffects::EndExpired( ) 
+    {
+	TInt count;
+	while((count = iActiveSyncronizedGroups.Count() - 1 ) >= 0)
+		{
+		iEngine->EndSyncronizedGroup(iActiveSyncronizedGroups[count], ETrue /* force removal, running effect should be skipped */);
+		iActiveSyncronizedGroups.Remove(count);
+		}
+    __ALFFXLOGSTRING("CAlfGfxEffects::EndExpired - release all syncronized groups");
+    }
+
+// -----------------------------------------------------------------------------
+// CAlfGfxEffects::NewExtensionL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+CAlfWindowFxPlugin* CAlfGfxEffects::NewFxPluginL()
+    {
+    __ALFFXLOGSTRING("CAlfGfxEffects::NewFxPluginL >>");
+    CAlfGfxEffects* self = new(ELeave) CAlfGfxEffects();
+//    do not call constructor here, base class constructor gets called later
+    __ALFFXLOGSTRING("CAlfGfxEffects::NewFxPluginL <<");
+    return ( self );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAlfGfxEffects::ConstructL
+// 
+// -----------------------------------------------------------------------------
+//
+void CAlfGfxEffects::ConstructL(const CAlfWindowManager& aMgr, TInt aAlfBufferFormat)
+    {
+    __ALFFXLOGSTRING("CAlfGfxEffects::ConstructL >>");
+    CAlfWindowFxPlugin::ConstructL(aMgr, aAlfBufferFormat);
+    
+    // create a policy handler for registering the effect files.
+    iPolicyHandler = CPolicyHandler::NewL();
+    
+    // create controller and engine
+    iEngine = CAlfServerDrawer::NewL( CAlfWindowFxPlugin::WindowManager(), *iPolicyHandler );
+    iSysDisable = CRepositoryHandler::NewL(EPriorityHigh + KTfxServerRepositoryHandler, 
+	                                     KCRUidThemes, 
+	                                     KThemesTransitionEffects);
+    
+    iSyncronizedGroupDefitionEndChecker = CEndCheck::NewL(*this);
+    __ALFFXLOGSTRING("CAlfGfxEffects::ConstructL <<");
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAlfGfxEffects::~CAlfGfxEffects
+// C++ destructor.
+// -----------------------------------------------------------------------------
+//
+CAlfGfxEffects::~CAlfGfxEffects()
+    {
+    __ALFFXLOGSTRING("CAlfGfxEffects::~CAlfGfxEffects >>");
+    delete iPolicyHandler;
+    delete iSysDisable;
+    delete iEngine;
+    __ALFFXLOGSTRING("CAlfGfxEffects::~CAlfGfxEffects <<");
+    }
+    
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CAlfGfxEffects::HandleMessageL( const TDesC8& aInBuf, TPtr8& aOutBuf )
+    {
+    __ALFFXLOGSTRING("CAlfGfxEffects::HandleMessageL >>");
+    // synchronous messages are completed by server 
+    
+    RDesReadStream inStream;
+    inStream.Open( aInBuf );
+    
+    TInt err = KErrNone;
+    TInt op = inStream.ReadInt32L();
+    TUint action = 0;
+    TUid uid1( KNullUid );
+    TUid uid2( KNullUid );
+    HBufC* resourceDir = NULL;
+    HBufC* fileName = NULL;
+    HBufC* backgroundFileName = NULL;
+    TInt wantedTime = 0;
+    TInt minTime = 0;
+    
+    TThreadId clientThreadId( 0 );
+    // These are needed to read the 64 bit thread id from the stream
+   	TUint64 id = 0;
+    TUint8* ptr = reinterpret_cast<TUint8*>( &id );
+    
+    CAlfTransitionServerClient::TListBoxType listBoxType = CAlfTransitionServerClient::EListTypeAny;
+
+    TInt value = 0;
+	TInt error = iSysDisable->GetValue(value);
+    RMemWriteStream outStream; // for return values
+    TBool fillOutStream = ETrue; // most functions put the error into outbuffer
+
+    // The engine reservers the windows if needed, it first runs all the checks
+    // to see if the effects are allowed (effects are not done for some combinations)
+    
+    __ALFFXLOGSTRING2("CAlfGfxEffects::HandleMessageL - Operation: %d, Action: %d", op, action );
+    __ALFFXLOGSTRING2("CAlfGfxEffects::HandleMessageL - Dir: %S, File: %S", &resourceDir, &fileName );
+    switch ( op )
+        {
+        // full screen transitions
+        case MAlfGfxEffectPlugin::EBeginFullscreen:
+    	    if((error != KErrNone) || (value & AknTransEffect::EFullScreenTransitionsOff)) 
+	    	    {
+		        // fullscreen effects are turned off
+		        // Should we return the error in aOutBuf?
+		        // We should not get end full screen if the effect has not been even started
+		        // (could return KErrAbort in aOutBuf)
+		        err = KErrAbort;
+		        break;
+		        }
+		    else
+		        {
+	            action = inStream.ReadUint32L();
+#ifdef _DEBUG    
+    PrintRequestInfo( op, action);
+#endif    
+	            TRect effectRect( inStream.ReadInt32L(),
+                    inStream.ReadInt32L(), inStream.ReadInt32L(), inStream.ReadInt32L() );
+                TInt type = inStream.ReadInt32L();
+                // Depending on type, the rest of the parameters have different meaning
+                uid1 = TUid::Uid( inStream.ReadInt32L() );
+                uid2 = TUid::Uid( inStream.ReadInt32L() );
+                TInt data = inStream.ReadInt32L();
+                iEngine->BeginFullscreen( action, effectRect, type,
+                    uid1, uid2, data );
+		        }
+            break;
+        case MAlfGfxEffectPlugin::EEndFullscreen:
+#ifdef _DEBUG    
+    PrintRequestInfo( op, action);
+#endif    
+            iEngine->EndFullscreen();
+            break;
+        case MAlfGfxEffectPlugin::EAbortFullscreen:
+#ifdef _DEBUG    
+    PrintRequestInfo( op, action);
+#endif    
+
+            iEngine->AbortFullscreen();
+            break;
+        // component transitions
+        case MAlfGfxEffectPlugin::EBeginComponentTransition: 
+            if((error != KErrNone) || (value & AknTransEffect::EComponentTransitionsOff))
+                {
+                err = KErrAbort;
+                break;
+                }
+            else
+                {
+                // We may not need all of this, but it is here now just to make sure
+                // we have enough information.
+                {
+                action = inStream.ReadUint32L();
+#ifdef _DEBUG    
+    PrintRequestInfo( op, action);
+#endif    
+                
+                uid1 = TUid::Uid( inStream.ReadInt32L() );
+                TInt windowGroup = inStream.ReadInt32L();
+                TInt windowHandle = inStream.ReadInt32L();
+                TBool nLayered = inStream.ReadInt32L();
+                uid2 = TUid::Uid( inStream.ReadInt32L() ); // layer type uid
+                TInt flags = inStream.ReadInt32L(); // hints
+                iEngine->BeginControlTransition( action, uid1, windowGroup, windowHandle );
+                }
+            break;
+            }
+        // These are the effect registrations    
+        case MAlfGfxEffectPlugin::ETfxServerOpAddFullscreenKML:
+        case MAlfGfxEffectPlugin::ETfxServerOpAddFullscreenKMLEx:
+            {
+            action = inStream.ReadUint32L();
+#ifdef _DEBUG    
+    PrintRequestInfo( op, action);
+#endif    
+
+            uid1 = TUid::Uid( inStream.ReadInt32L() );
+	        inStream.ReadL( ptr, 8 );
+	        clientThreadId = id;
+            resourceDir = HBufC::NewL( inStream, 256 );
+            CleanupStack::PushL( resourceDir );
+            fileName = HBufC::NewL( inStream, 256 );
+            CleanupStack::PushL( fileName );
+            // If the operation is ETfxServerOpAddFullscreenKMLEx, there are some more parameters
+            TInt cachePriority = -1;
+            wantedTime = -1;
+            minTime = -1;
+            if ( op == ETfxServerOpAddFullscreenKMLEx )
+                {
+                cachePriority = inStream.ReadInt32L();
+                wantedTime = inStream.ReadInt32L();
+                minTime = inStream.ReadInt32L();
+                }
+            err = VerifyResourceLocation( resourceDir->Des() );
+            /*
+            // Needed to be able to see the filename in carbide
+            TPtrC filePtr = fileName->Des();
+            RDebug::Print(_L("register file %S"), &filePtr );
+            */
+            if ( err == KErrNone )
+                {
+                // register the effect definition file
+                if ( uid1.iUid != KAlfAppServerInterfaceUid3 )
+                    {
+                    TRAP( err, iPolicyHandler->RegisterFullscreenKmlL(
+                        action, uid1, clientThreadId, *resourceDir, *fileName,
+                        cachePriority, wantedTime, minTime) );
+	                iEngine->RegisterAlfFullScreenEffect( action, resourceDir->Des(), fileName->Des() );
+                    }
+                else
+	                {  
+	                // effects for KAlfAppServerInterfaceUid3 go directly to Alf Bridge
+	                iEngine->RegisterAlfFullScreenEffect( action, resourceDir->Des(), fileName->Des() );
+	                }           
+                }
+                
+            CleanupStack::PopAndDestroy( fileName );
+            CleanupStack::PopAndDestroy( resourceDir );
+            break;
+            }
+        case MAlfGfxEffectPlugin::ETfxServerOpRemoveFullscreenKML:
+            action = inStream.ReadUint32L();
+            uid1 = TUid::Uid( inStream.ReadInt32L() );
+            // We don't keep the registration status the files that go directly to alf 
+            if ( uid1.iUid != KAlfAppServerInterfaceUid3 )
+                {
+                err = iPolicyHandler->UnregisterFullscreenKml( action, uid1 );
+                }
+            else
+                {               
+                // effects for KAlfAppServerInterfaceUid3 go directly to Alf Bridge
+                }        
+            iEngine->UnregisterAlfFullScreenEffect( action );
+            break;
+        case MAlfGfxEffectPlugin::ETfxServerOpListBoxRegisterKML:
+            uid1 = TUid::Uid( inStream.ReadInt32L() );
+	        inStream.ReadL( ptr, 8 );
+	        clientThreadId = id;
+   	        listBoxType = (CAlfTransitionServerClient::TListBoxType) inStream.ReadInt32L();
+            resourceDir = HBufC::NewL( inStream, 256 );
+            CleanupStack::PushL( resourceDir );
+            backgroundFileName = HBufC::NewL( inStream, 256 );
+            CleanupStack::PushL( backgroundFileName );
+            fileName = HBufC::NewL( inStream, 256 );
+            CleanupStack::PushL( fileName );
+            err = VerifyResourceLocation( resourceDir->Des() );
+            if ( err == KErrNone )
+                {
+                iPolicyHandler->RegisterListBoxKmlL( uid1, clientThreadId, listBoxType,
+                    *resourceDir, *backgroundFileName, *fileName );
+                }
+            CleanupStack::PopAndDestroy( fileName );
+            CleanupStack::PopAndDestroy( backgroundFileName );
+            CleanupStack::PopAndDestroy( resourceDir );
+            break;
+        case MAlfGfxEffectPlugin::ETfxServerOpListBoxUnregisterKML:
+            uid1 = TUid::Uid( inStream.ReadInt32L() );
+   	        listBoxType = (CAlfTransitionServerClient::TListBoxType) inStream.ReadInt32L();
+   	        err = iPolicyHandler->UnregisterListBoxKml( uid1, listBoxType );
+            break;
+        case MAlfGfxEffectPlugin::ETfxServerOpListBoxSetFrameTime:
+            iListBoxFrameTime = inStream.ReadInt32L();
+            // this must be sent forward somewhere (list controller?)
+            break;
+        case MAlfGfxEffectPlugin::ETfxServerOpListBoxSetMinFrameTime:
+            iListBoxMinFrameTime = inStream.ReadInt32L();
+            // this must be sent forward somewhere (list controller?)
+            break;
+        case MAlfGfxEffectPlugin::ETfxServerOpControlSetFrameTime:
+            iControlFrameTime = inStream.ReadInt32L();
+            // this must be sent forward somewhere (list controller?)
+            break;
+        case MAlfGfxEffectPlugin::ETfxServerOpControlSetMinFrameTime:
+            iControlMinFrameTime = inStream.ReadInt32L();
+            // this must be sent forward somewhere (list controller?)
+            break;
+        case MAlfGfxEffectPlugin::ETfxServerOpBlockFullscreenUid:
+            {
+            uid1 = TUid::Uid( inStream.ReadInt32L() );
+            TBool blockFrom = inStream.ReadInt32L();
+            TBool blockTo = inStream.ReadInt32L();
+            err = iPolicyHandler->BlockFullScreenUid( uid1, blockFrom, blockTo );
+            break;
+            }
+        case MAlfGfxEffectPlugin::ETfxServerOpControlPolicyUpdate:
+            {
+            uid1 = TUid::Uid( inStream.ReadInt32L() );
+            TUint actionId = inStream.ReadUint32L();
+            HBufC* actionString = HBufC::NewL( inStream, 256 );
+            CleanupStack::PushL( actionString );
+            iPolicyHandler->RegisterControlAction( uid1, actionId, *actionString );
+            CleanupStack::PopAndDestroy( actionString );
+            break;
+            }
+        case MAlfGfxEffectPlugin::ETfxServerOpControlPolicyRemove:
+            {
+            uid1 = TUid::Uid( inStream.ReadInt32L() );
+            TUint actionId = inStream.ReadUint32L();
+            iPolicyHandler->UnregisterControlAction( uid1, actionId );
+            break;
+            }
+        case MAlfGfxEffectPlugin::ETfxServerOpRegisterControlKml:
+        case MAlfGfxEffectPlugin::ETfxServerOpRegisterControlKmlEx:
+            uid1 = TUid::Uid( inStream.ReadInt32L() );
+	        inStream.ReadL( ptr, 8 );
+	        clientThreadId = id;
+            resourceDir = HBufC::NewL( inStream, 256 );
+            CleanupStack::PushL( resourceDir );
+            fileName = HBufC::NewL( inStream, 256 );
+            CleanupStack::PushL( fileName );
+            // If the operation is ETfxServerOpRegisterControlKmlEx, there are some more parameters
+            wantedTime = -1;
+            minTime = -1;
+            if ( op == ETfxServerOpRegisterControlKmlEx )
+                {
+                wantedTime = inStream.ReadInt32L();
+                minTime = inStream.ReadInt32L();
+                }
+            err = VerifyResourceLocation( resourceDir->Des() );
+            if ( err == KErrNone )
+                {
+                // register the effect definition file
+	        	TRAP( err, iPolicyHandler->RegisterControlKmlL(
+	        	    uid1, clientThreadId, *resourceDir, *fileName,
+	        	    wantedTime, minTime) );
+		iEngine->RegisterAlfFullScreenEffect( action, resourceDir->Des(), fileName->Des() );
+                }
+            CleanupStack::PopAndDestroy( fileName );
+            CleanupStack::PopAndDestroy( resourceDir );
+            break;
+        case MAlfGfxEffectPlugin::ETfxServerOpRemoveAllKml:
+	        inStream.ReadL( ptr, 8 );
+	        clientThreadId = id;
+            if ( uid1.iUid != KAlfAppServerInterfaceUid3 )
+                {
+                err = iPolicyHandler->UnregisterAllKml( clientThreadId );
+                }
+            else
+                {               
+                // effects for KAlfAppServerInterfaceUid3 go directly to Alf Bridge
+                }   
+            iEngine->UnregisterAllAlfFullScreenEffect( );
+            break;
+        case MAlfGfxEffectPlugin::ETfxServerOpRemoveControlKml:
+            uid1 = TUid::Uid( inStream.ReadInt32L() );
+            err = iPolicyHandler->RemoveControlKml( uid1 );
+            break;
+        case MAlfGfxEffectPlugin::ETfxServerOpSetWantedTime:
+            iTransitionTime = inStream.ReadInt32L();
+            break;
+        case MAlfGfxEffectPlugin::ETfxServerOpSetMinTime:
+            iTransitionMinTime = inStream.ReadInt32L();
+            break;
+        case MAlfGfxEffectPlugin::ETfxServerVerifyConnection:
+            // If we get this far, it should prove that we have a good connection
+            break;
+        case MAlfGfxEffectPlugin::ETfxServerOpFreeRam:
+            // here we should return something
+            break;
+        case MAlfGfxEffectPlugin::ETfxServerOpMemoryGood:
+            // here we should return something
+            break;
+        case MAlfGfxEffectPlugin::ETfxServerOpControlPolicyGet:
+            // get the policy structures from the policy handler
+            // client id (we don't get the whole message because this is asynchronous
+            
+            // We fill the outbuffer with policies, do not add an error afterwards
+            {
+                
+            fillOutStream = EFalse;
+	        inStream.ReadL( ptr, 8 );
+	        clientThreadId = id;
+            // number of policy structures the return buffer can hold
+            TInt count = inStream.ReadInt32L();
+            iPolicyHandler->GetPolicyL( clientThreadId, count, aOutBuf );
+            break;
+            }
+        case MAlfGfxEffectPlugin::ETfxServerOpControlCancelPolicyUpdate:
+            // cancel any pending policy requests
+	        inStream.ReadL( ptr, 8 );
+	        clientThreadId = id;
+            iPolicyHandler->RemoveClient( clientThreadId );
+            break;
+            
+        case MAlfGfxEffectPlugin::ETfxServerOpBeginGroup:
+        	{
+        	TInt groupId= inStream.ReadUint32L();
+        	iEngine->BeginSyncronizedGroup(groupId);
+        	iActiveSyncronizedGroups.Append(groupId);
+        	iSyncronizedGroupDefitionEndChecker->Start(4);
+        	break;
+        	}
+        
+        case MAlfGfxEffectPlugin::ETfxServerOpEndGroup:
+			{
+			// if all groups have been released, then we can kill the timer.
+			if (iActiveSyncronizedGroups.Count() - 1 == 0)
+				{
+				iSyncronizedGroupDefitionEndChecker->Cancel();
+				}
+        	TInt groupId= inStream.ReadUint32L();
+        	TInt index = iActiveSyncronizedGroups.Find(groupId);
+        	if (index!=KErrNotFound)
+        		{
+				iEngine->EndSyncronizedGroup(groupId);
+				iActiveSyncronizedGroups.Remove(index);
+        		}
+        	if (iActiveSyncronizedGroups.Count())
+        		{
+				// if there is still groups out there not closed, then this will create timeout for them
+				iSyncronizedGroupDefitionEndChecker->Start(4);
+        		}
+			break;
+			}
+		
+        default:
+            break;
+        }
+        
+    inStream.Release();
+    inStream.Close();    
+        
+    if ( aOutBuf.MaxSize() >= sizeof(TInt32) && fillOutStream )
+        {
+        // The write will not leave as we have checked the length of the buffer beforeahdn
+        unsigned char buffer[sizeof(TInt32)];
+        outStream.Open( buffer, sizeof(TInt32) );
+        outStream.WriteInt32L( err );
+        outStream.CommitL();
+        outStream.Release();
+        outStream.Close();
+        aOutBuf.Copy( &buffer[0], sizeof(TInt32) );
+        }
+    __ALFFXLOGSTRING("CAlfGfxEffects::HandleMessageL <<");
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CAlfGfxEffects::HandleMessageL( const TDesC8& aInBuf, const RMessage2& aClientMessage )
+    {
+    // make sure that there are no pending asynch calls left here
+    __ALFFXLOGSTRING1("CAlfGfxEffects::HandleMessageL - : %S", &aInBuf );
+    RDesReadStream inStream;
+    inStream.Open( aInBuf );
+    
+    TInt op = inStream.ReadInt32L();
+    inStream.Release();
+    inStream.Close();    
+    switch ( op )
+        {
+        case MAlfGfxEffectPlugin::ETfxServerOpControlPolicyRequest:
+           	// This message is completed when a new policy exists.
+           	// All clients get the same policies
+       	  	User::LeaveIfError( iPolicyHandler->RequestPolicy( aClientMessage ) );
+            break;
+        default:
+            break;
+        }
+    __ALFFXLOGSTRING("CAlfGfxEffects::HandleMessageL <<");
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CAlfGfxEffects::CancelMessage(TInt /*aMessageId*/)
+    {
+    __ALFFXLOGSTRING("CAlfGfxEffects::CancelMessage - not implemented");
+    // default implementation does not have pending messages
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CAlfGfxEffects::PrepareFrameL(TUint /*aEstimatedFrameInterval*/)
+    {
+    // __ALFFXLOGSTRING("CAlfGfxEffects::PrepareFrameL - not implemented");
+    // not implemented
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+void CAlfGfxEffects::WindowUpdated(TInt /*aWindowId*/, TInt /*aEventType*/)
+    {
+    __ALFFXLOGSTRING("CAlfGfxEffects::WindowUpdated - not implemented");
+    // not implemented
+    }
+
+// -----------------------------------------------------------------------------
+// CAlfGfxEffects::GetSupportedEffects
+// -----------------------------------------------------------------------------
+//
+TInt CAlfGfxEffects::GetSupportedEffects( RArray<TInt>& /*aSupportedEffectIds*/ )
+	{ 
+	/*
+	// Add effect ids which are supported by this plugin
+	aSupportedEffectIds.Append( MAlfTransEffectPlugin::EContextFocusGained ); 
+	aSupportedEffectIds.Append( MAlfTransEffectPlugin::EContextFocusLost ); 
+	aSupportedEffectIds.Append( MAlfTransEffectPlugin::EContextEmbeddedStart ); 
+	aSupportedEffectIds.Append( MAlfTransEffectPlugin::EContextEmbeddedExit ); 
+	*/
+	__ALFFXLOGSTRING("CAlfGfxEffects::GetSupportedEffects");
+	return KErrNone; 
+	}
+	
+
+// -----------------------------------------------------------------------------
+// CAlfGfxEffects::StartPhase
+// -----------------------------------------------------------------------------
+//
+TInt CAlfGfxEffects::StartPhase( TInt /*aPhaseId*/, TInt /*aEffectId*/, 
+    CAlfSrvEffectEnv& /*aEffectEnv*/, const TDesC8* /*aParams*/ ) 
+	{ 
+	/*
+	TRAP_IGNORE( DoStartPhaseL( aPhaseId, aEffectId, aEffectEnv, aParams ));
+	*/
+	__ALFFXLOGSTRING("CAlfGfxEffects::StartPhase");
+	return KErrNone;
+	}
+	
+	
+// -----------------------------------------------------------------------------
+// CAlfGfxEffects::DoStartPhaseL
+// -----------------------------------------------------------------------------
+//
+TInt CAlfGfxEffects::DoStartPhaseL( TInt /*aPhaseId*/, TInt /*aEffectId*/, 
+    CAlfSrvEffectEnv& /*aEffectEnv*/, const TDesC8* /*aParams*/ ) 
+	{ 
+	__ALFFXLOGSTRING("CAlfGfxEffects::DoStartPhaseL >>");
+/*	
+	// Start effect here!
+    switch (aEffectId)
+        {
+        case MAlfTransEffectPlugin::EContextFocusGained:
+            {
+            ShowVisibleGroupsAndMakeNonTransparentL( aEffectEnv );                           				
+            break;
+            }
+            
+        case MAlfTransEffectPlugin::EContextFocusLost:
+            {
+            HideGroupsAndMakeTransparentL( aEffectEnv );          
+            break;
+            }
+            
+        case MAlfTransEffectPlugin::EContextEmbeddedStart:
+            {
+            // do a normal show
+            ShowVisibleGroupsAndMakeNonTransparentL( aEffectEnv );
+            
+            // in addition, do a expand effect for the visible groups
+            TInt controlGroupCount = aEffectEnv.VisibleControlGroupCountL();
+            for ( TInt g = 0 ; g < controlGroupCount ; g++ )
+                {
+                CHuiControlGroup* group = aEffectEnv.VisibleControlGroupL(g);
+		        if (group)
+                    {
+                    // Perhaps we should show controlgroup in other displays too...?
+                    CHuiDisplay* defaultDisplay = aEffectEnv.DisplayL(0);                
+                    if (defaultDisplay)
+                        {
+                        CHuiLayout* hostContainer = group->Control(0).ContainerLayout( NULL );          
+                       
+                        // Cancel the previous 'disable transformation' commands.
+                        aEffectEnv.SharedEnv()->CancelCommands( hostContainer, EHuiOpDisableTransformation );
+                       
+                        hostContainer->EnableTransformationL(); 
+                        CHuiTransformation& xf = hostContainer->Transformation(); 
+                        
+                        THuiTimedValue scale(0);
+                        scale.Set(1, KAlfDefaultFocusGainedEffectDuration);
+
+                        // Clear previously created transformation steps.
+                        xf.LoadIdentity();
+
+                        xf.Scale(scale,scale);
+                        
+                        // Disable transformations after effect
+                        THuiVisualCommand disableTransformationCommand( *hostContainer, EHuiOpDisableTransformation );
+                        aEffectEnv.SharedEnv()->Send( disableTransformationCommand, KAlfDefaultFocusGainedEffectDuration );
+                        }
+                    }
+                }            
+            break;
+            }
+        case MAlfTransEffectPlugin::EContextEmbeddedExit:
+            {
+            // do normal hide
+            HideGroupsAndMakeTransparentL( aEffectEnv );
+            
+            // in addition, do a shrink effect for the visible groups
+            TInt controlGroupCount = aEffectEnv.VisibleControlGroupCountL();
+            for ( TInt g = 0 ; g < controlGroupCount ; g++ )
+                {
+                CHuiControlGroup* group = aEffectEnv.VisibleControlGroupL(g);
+		        if (group)
+                    {
+                    // Perhaps we should show controlgroup in other displays too...?
+                    CHuiDisplay* defaultDisplay = aEffectEnv.DisplayL(0);                
+                    if (defaultDisplay)
+                        {
+                        // Do a little pop out effect
+                        CHuiLayout* hostContainer = group->Control(0).ContainerLayout( NULL );
+                               
+                        // Cancel the previous 'disable transformation' commands.
+                        aEffectEnv.SharedEnv()->CancelCommands( hostContainer, EHuiOpDisableTransformation );                
+
+                        hostContainer->EnableTransformationL(); 
+                        CHuiTransformation& xf = hostContainer->Transformation(); 
+                        
+                        THuiTimedValue scale(1);
+                        scale.Set(0, KAlfDefaultFocusLostEffectDuration);
+
+                        // Clear previously created transformation steps.
+                        xf.LoadIdentity();
+
+                        xf.Scale(scale,scale);
+                        
+                        // Disable transformations after effect
+                        THuiVisualCommand disableTransformationCommand( *hostContainer, EHuiOpDisableTransformation );
+                        aEffectEnv.SharedEnv()->Send( disableTransformationCommand, KAlfDefaultFocusLostEffectDuration );
+                        }
+                    }
+                }            
+            break;
+            }
+       default:
+            {
+            
+            break;
+            }        
+        }
+*/	
+	__ALFFXLOGSTRING("CAlfGfxEffects::DoStartPhaseL <<");
+	return KErrNone; 
+	};
+    
+void CAlfGfxEffects::ShowVisibleGroupsAndMakeNonTransparentL(CAlfSrvEffectEnv& /*aEffectEnv*/)
+    {
+    __ALFFXLOGSTRING("CAlfGfxEffects::ShowVisibleGroupsAndMakeNonTransparentL >>");
+    // Set opacity of every control group to 1, even if it is not shown because
+    // application may want to show it later and it cannot control the
+    // opacity.
+/*    
+    TInt controlGroupCount = aEffectEnv.ControlGroupCountL();
+    for ( TInt g = 0 ; g < controlGroupCount ; g++ )
+        {
+        CHuiControlGroup* group = aEffectEnv.ControlGroupL(g);
+        if (group)
+            {
+            // Perhaps we should show controlgroup in other displays too...?
+            CHuiDisplay* defaultDisplay = aEffectEnv.DisplayL(0);                
+            if (defaultDisplay)
+                {
+                // Set the root visual opacity to 1 which affects all the visuals in the group
+                CHuiLayout* hostContainer = group->Control(0).ContainerLayout( NULL );                                                
+                hostContainer->iOpacity.Set(1.f, KAlfDefaultFocusGainedEffectDuration);                                                
+                
+                // Disable also previous transformations.
+                hostContainer->EnableTransformationL(EFalse); 
+                }
+            }
+        }   
+        
+    // Check how many control groups are shown (set visible by the application)
+    
+    // todo: the visible control group should be shown in the same order as they were
+    // set into the roster originally.
+    TInt visibleControlGroupCount = aEffectEnv.VisibleControlGroupCountL();
+    for ( TInt g = 0 ; g < visibleControlGroupCount ; g++ )
+        {
+        CHuiControlGroup* group = aEffectEnv.VisibleControlGroupL(g);
+        if (group)
+            {
+            CHuiDisplay* defaultDisplay = aEffectEnv.DisplayL(0);                
+            if (defaultDisplay)
+                {
+                // Cancel the previous hide commands.
+                aEffectEnv.SharedEnv()->CancelCommands( group, EHuiOpHide );
+                
+                // Show control group ! 
+                defaultDisplay->Roster().ShowL(*group);                    
+                }
+            }
+        }  
+*/        
+   __ALFFXLOGSTRING("CAlfGfxEffects::ShowVisibleGroupsAndMakeNonTransparentL <<");
+    }
+    
+void CAlfGfxEffects::HideGroupsAndMakeTransparentL(CAlfSrvEffectEnv& /*aEffectEnv*/)
+    {
+    __ALFFXLOGSTRING("CAlfGfxEffects::HideGroupsAndMakeTransparentL >>");
+/*    
+    TInt controlGroupCount = aEffectEnv.ControlGroupCountL();
+    for ( TInt g = 0 ; g < controlGroupCount ; g++ )
+        {
+        CHuiControlGroup* group = aEffectEnv.ControlGroupL(g);
+        if (group)
+            {
+            // Perhaps we should show controlgroup in other displays too...?
+            CHuiDisplay* defaultDisplay = aEffectEnv.DisplayL(0);                
+            if (defaultDisplay)
+                {
+                // Set the root visual opacity to 0 which affects all the visuals in the group
+                CHuiLayout* hostContainer = group->Control(0).ContainerLayout( NULL );
+                hostContainer->iOpacity.Set(0.f, KAlfDefaultFocusGainedEffectDuration);   
+                                                             
+				if (defaultDisplay->DisplayType() != CHuiDisplay::EDisplayOffScreenBuffer)
+					{
+					// Hide the group so that it does not use resources when we dont have focus
+                    THuiGroupCommand command( *group, EHuiOpHide, defaultDisplay );
+                    aEffectEnv.SharedEnv()->Send(command, KAlfDefaultFocusLostEffectDuration);
+					}
+                }
+            }
+        } 
+*/        
+    __ALFFXLOGSTRING("CAlfGfxEffects::HideGroupsAndMakeTransparentL <<");
+    }
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfGfxEffects::VerifyResourceLocation(const TDesC& aResourceDir)
+	{
+	__ALFFXLOGSTRING("CAlfGfxEffects::VerifyResourceLocation >>");
+	// For starters anything goes (we want to be able to test effect files on C drive if needed)
+	if (aResourceDir.Length() > 1)
+	    {
+	    __ALFFXLOGSTRING("CAlfGfxEffects::VerifyResourceLocation - return KErrNone");
+	    return KErrNone;
+	    }
+/*
+	if(aResourceDir.Length() > 1 &&
+	   (aResourceDir[0] == 'Z' || aResourceDir[0] == 'z') )
+		{
+		return KErrNone;
+		}
+*/		
+	__ALFFXLOGSTRING("CAlfGfxEffects::VerifyResourceLocation - return KErrNotSupported <<");
+	return KErrNotSupported;
+	}
+#ifdef _DEBUG
+void CAlfGfxEffects::PrintRequestInfo(TInt aOperation, TInt aAction )
+    {
+    HBufC16* buffer = HBufC16::NewL(256);
+    TPtr debugText = buffer->Des();
+    debugText.Format( _L("Effect request: Operation "));
+    
+    switch(aOperation)
+        {
+        case MAlfGfxEffectPlugin::EBeginFullscreen:
+            {
+            debugText.AppendFormat(_L("EBeginFullscreen"));
+            break;
+            }
+        case MAlfGfxEffectPlugin::EEndFullscreen:
+            {
+            debugText.AppendFormat(_L("EEndFullscreen"));
+            break;
+            }
+        case MAlfGfxEffectPlugin::EAbortFullscreen:
+            {
+            debugText.AppendFormat(_L("EAbortFullscreen"));
+            break;
+            }
+        case MAlfGfxEffectPlugin::EBeginComponentTransition:
+            {
+            debugText.AppendFormat(_L("EBeginComponentTransition"));
+            break;
+            }
+        case MAlfGfxEffectPlugin::EAbortComponentTransition:
+            {
+            debugText.AppendFormat(_L("EAbortComponentTransition"));
+            break;
+            }
+        case MAlfGfxEffectPlugin::ERegisterFullScreenEffectFile:
+            {
+            debugText.AppendFormat(_L("ERegisterFullScreenEffectFile"));
+            break;
+            }
+        case MAlfGfxEffectPlugin::EUnregisterFullScreenEffectFile:
+            {
+            debugText.AppendFormat(_L("EUnregisterFullScreenEffectFile"));
+            break;
+            }
+        case MAlfGfxEffectPlugin::EBlockFullScreenUid:
+            {
+            debugText.AppendFormat(_L("EBlockFullScreenUid"));
+            break;
+            }
+        case MAlfGfxEffectPlugin::EUnregisterAllEffects:
+            {
+            debugText.AppendFormat(_L("EUnregisterAllEffects"));
+            break;
+            }
+        }
+
+    debugText.Format( _L(", Action: "));
+    
+    switch(aAction)
+        {
+        case AknTransEffect::ENone:
+            {
+            debugText.AppendFormat(_L("ENone"));
+            break;
+            }
+        case AknTransEffect::EApplicationActivate:
+            {
+            debugText.AppendFormat(_L("EApplicationActivate"));
+            break;
+            }
+        case AknTransEffect::EApplicationStart:
+            {
+            debugText.AppendFormat(_L("EApplicationStart"));
+            break;
+            }
+        case AknTransEffect::EEmbeddedApplicationStart:
+            {
+            debugText.AppendFormat(_L("EEmbeddedApplicationStart"));
+            break;
+            }
+        case AknTransEffect::EApplicationExit:
+            {
+            debugText.AppendFormat(_L("EApplicationExit"));
+            break;
+            }
+        case AknTransEffect::EApplicationStartRect:
+            {
+            debugText.AppendFormat(_L("EApplicationStartRect"));
+            break;
+            }
+        case AknTransEffect::EApplicationStartSwitch:
+            {
+            debugText.AppendFormat(_L("EApplicationStartSwitch"));
+            break;
+            }
+        case AknTransEffect::EApplicationStartSwitchRect:
+            {
+            debugText.AppendFormat(_L("EApplicationStartSwitch"));
+            break;
+            }
+        case AknTransEffect::EEmbeddedApplicationExit:
+            {
+            debugText.AppendFormat(_L("EEmbeddedApplicationExit"));
+            break;
+            }
+        case AknTransEffect::EAppStartComplete:
+#ifdef RD_UI_TRANSITION_EFFECTS_LAYOUT_SWITCH
+            {
+            debugText.AppendFormat(_L("EAppStartComplete"));
+            break;
+            }
+        case AknTransEffect::ELayoutSwitch: // default : swap to portrait.
+            {
+            debugText.AppendFormat(_L("ELayoutSwitch"));
+            break;
+            }
+        case AknTransEffect::ELayoutSwitchExit:
+            {
+            debugText.AppendFormat(_L("ELayoutSwitchExit"));
+            break;
+            }
+        case AknTransEffect::ELayoutSwitchStart:        
+#endif //RD_UI_TRANSITION_EFFECTS_LAYOUT_SWITCH
+        case AknTransEffect::EAppSpesificEvent:
+            {
+            debugText.AppendFormat(_L("ELayoutSwitchStart"));
+            break;
+            }
+        case AknTransEffect::EAppStartupBackground:
+            {
+            debugText.AppendFormat(_L("EAppStartupBackground"));
+            break;
+            }
+        default:
+            {
+            debugText.AppendFormat(_L("UNKNOWN"));
+            break;
+            }
+        }
+    
+    __ALFFXLOGSTRING1("CAlfGfxEffects::PrintInfo %S", &debugText);
+    delete buffer; 
+    }
+#endif
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfpolicy.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,225 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   a policy
+*
+*/
+
+
+
+#include "alfpolicy.h"
+#include <alflogger.h>
+// ======== MEMBER FUNCTIONS ========
+
+CFullscreenPolicy::~CFullscreenPolicy()
+	{
+	__ALFFXLOGSTRING("CFullscreenPolicy::~CFullscreenPolicy >>");
+	delete iFilename;
+	delete iResourceDir; 
+	__ALFFXLOGSTRING("CFullscreenPolicy::~CFullscreenPolicy <<");
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CFullscreenPolicy::CFullscreenPolicy(TUint aAction, const TUid &aUid, 
+									 const TThreadId& aThreadId, TInt aCachePriority, 
+					 				 TInt aWantedTime, TInt aMinTime) : 
+					 				 iAction(aAction), iUid(aUid), iThreadId(aThreadId), 
+					 				 iCachePriority(aCachePriority), iWantedTime(aWantedTime), 
+					 				 iMinTime(aMinTime)
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+
+CFullscreenPolicy* CFullscreenPolicy::NewL(TUint aAction, const TUid& aUid, 
+										   const TThreadId& aThreadId, const TDesC& aResourceDir, 
+										   const TDesC& aFilename,  TInt aCachePriority, 
+					 					   TInt aWantedTime, TInt aMinTime)
+	{
+	__ALFFXLOGSTRING("CFullscreenPolicy::NewL >>");
+	CFullscreenPolicy* self = new (ELeave)CFullscreenPolicy(aAction, aUid, aThreadId, aCachePriority, 
+															aWantedTime, aMinTime);
+	CleanupStack::PushL(self);
+	self->ConstructL(aResourceDir, aFilename);
+	CleanupStack::Pop(self);
+	__ALFFXLOGSTRING("CFullscreenPolicy::NewL <<");
+	return self;
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CFullscreenPolicy::ConstructL(const TDesC& aResourceDir, const TDesC& aFilename)
+	{
+	__ALFFXLOGSTRING2("CFullscreenPolicy::ConstructL - Dir: %S Filename: %S>>", &aResourceDir, &aFilename );
+	iResourceDir = HBufC::NewL( aResourceDir.Length() );
+	iResourceDir->Des().Copy( aResourceDir );
+	iFilename = HBufC::NewL( aFilename.Length() );
+	iFilename->Des().Copy( aFilename );
+	__ALFFXLOGSTRING("CFullscreenPolicy::ConstructL <<");
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CActionPolicy::~CActionPolicy()
+	{
+	__ALFFXLOGSTRING("CActionPolicy::~CActionPolicy >>");
+	delete iActionString;
+	__ALFFXLOGSTRING("CActionPolicy::~CActionPolicy <<");
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CActionPolicy::SetActionStringL(const TDesC& aActionString)
+	{
+	__ALFFXLOGSTRING1("CActionPolicy::SetActionStringL - aActionString: %S>>", &aActionString );
+	if(iActionString)
+		{
+		delete iActionString;
+		iActionString = NULL;
+		}
+		
+	iActionString = HBufC::NewL( aActionString.Length() );
+	iActionString->Des().Copy( aActionString );
+	__ALFFXLOGSTRING("CActionPolicy::SetActionStringL <<");
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CControlPolicy* CControlPolicy::NewL(const TUid& aUid, 
+									 const TThreadId& aThreadId, 
+									 const TDesC& aResourceDir, 
+						  			 const TDesC& aFilename, 
+						  			 TInt aCachePriority,
+						  			 TInt aWantedTime,
+						  			 TInt aMinTime)
+	{
+	__ALFFXLOGSTRING("CControlPolicy::NewL >>");
+	CControlPolicy* self = new (ELeave) CControlPolicy(aUid, aThreadId, aCachePriority, aWantedTime, aMinTime);
+	CleanupStack::PushL(self);
+	self->ConstructL(aResourceDir, aFilename);
+	CleanupStack::Pop(self);
+	__ALFFXLOGSTRING("CControlPolicy::NewL <<");
+	return self;
+	}	
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CControlPolicy::~CControlPolicy()
+	{
+	__ALFFXLOGSTRING("CControlPolicy::~CControlPolicy >>");
+	delete iResourceDir;
+	delete iFilename;
+	
+	iControlPolicies.ResetAndDestroy();
+	__ALFFXLOGSTRING("CControlPolicy::~CControlPolicy <<");
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CControlPolicy::ConstructL(const TDesC& aResourceDir, const TDesC& aFilename)
+	{
+	__ALFFXLOGSTRING2("CControlPolicy::ConstructL - Dir: %S Filename: %S>>", &aResourceDir, &aFilename );
+	    
+	iResourceDir = HBufC::NewL( aResourceDir.Length() );
+	iResourceDir->Des().Copy( aResourceDir );
+	iFilename = HBufC::NewL( aFilename.Length() );
+	iFilename->Des().Copy( aFilename );
+	__ALFFXLOGSTRING("CControlPolicy::ConstructL <<");
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CControlPolicy::CControlPolicy(const TUid aUid, const TThreadId aThreadId, TInt aCachePriority, TInt aWantedTime, TInt aMinTime) : 
+	iUid(aUid), 
+	iThreadId(aThreadId),
+	iCachePriority(aCachePriority),
+	iWantedTime(aWantedTime),
+	iMinTime(aMinTime)
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CListBoxPolicy* CListBoxPolicy::NewL(const TUid &aUid, 
+									 const TThreadId& aThreadId,
+                                     const CAlfTransitionServerClient::TListBoxType aListBoxType,
+                                     const TDesC& aResourceDir, 
+									 const TDesC& aBackgroundFilename, const TDesC& aItemFilename, 
+									 TInt aCachePriority, TInt aWantedTime, TInt aMinTime)
+	{
+	__ALFFXLOGSTRING("CListBoxPolicy::NewL >>");
+	CListBoxPolicy* self = new (ELeave)CListBoxPolicy(aUid, aThreadId, aListBoxType, aCachePriority, aWantedTime, aMinTime);
+	CleanupStack::PushL(self);
+	self->ConstructL(aResourceDir, aBackgroundFilename, aItemFilename);
+	CleanupStack::Pop(self);
+	__ALFFXLOGSTRING("CListBoxPolicy::NewL <<");
+	return self;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CListBoxPolicy::ConstructL(const TDesC& aResourceDir, const TDesC& aBackgroundFilename, const TDesC& aItemFilename)
+	{
+    __ALFFXLOGSTRING3("CListBoxPolicy::ConstructL - Dir: %S, aBackgroundFilename %S, ItemFilename: %S>>", &aResourceDir, &aBackgroundFilename, &aItemFilename );
+
+	iResourceDir = HBufC::NewL( aResourceDir.Length() );
+	iResourceDir->Des().Copy( aResourceDir );
+	iBackgroundFilename = HBufC::NewL( aBackgroundFilename.Length() );
+	iBackgroundFilename->Des().Copy( aBackgroundFilename );
+	iItemFilename = HBufC::NewL( aItemFilename.Length() );
+	iItemFilename->Des().Copy( aItemFilename );
+	__ALFFXLOGSTRING("CListBoxPolicy::ConstructL <<");
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CListBoxPolicy::CListBoxPolicy(const TUid& aUid, const TThreadId& aThreadId,
+                               const CAlfTransitionServerClient::TListBoxType aListBoxType,
+                               TInt aCachePriority, TInt aWantedTime, TInt aMinTime) :
+	iUid(aUid), iThreadId(aThreadId), iListBoxType(aListBoxType), iCachePriority(aCachePriority), 
+	iWantedTime(aWantedTime), iMinTime(aMinTime)
+	{
+	TInt spec = iUid.iUid == 0 ? 0 : 2;
+	spec += aListBoxType == CAlfTransitionServerClient::EListTypeAny ? 0 : 1;
+	iSpecificity = spec;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CListBoxPolicy::~CListBoxPolicy()
+	{
+	__ALFFXLOGSTRING("CListBoxPolicy::~CListBoxPolicy >>");
+	delete iResourceDir;
+	delete iBackgroundFilename;
+	delete iItemFilename;
+	__ALFFXLOGSTRING("CListBoxPolicy::~CListBoxPolicy <<");
+	}
+
+// --- EOF ---
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfpolicyhandler.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1031 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   implementation of policy handler
+*
+*/
+
+
+
+#include "alfpolicyhandler.h"
+#include "alfpolicyrequesthandler.h"
+#include <alflogger.h>
+
+// ======== HELPER CLASS ========
+
+NONSHARABLE_CLASS(TFullScreenBlock)
+	{
+public:
+	TUid iFromUid;
+	TUid iToUid;
+
+	};
+
+// ======== MEMBER FUNCTIONS ========
+
+CPolicyHandler* CPolicyHandler::NewL()
+    {
+    __ALFFXLOGSTRING("CPolicyHandler::NewL >>");
+    CPolicyHandler* self = new (ELeave) CPolicyHandler();
+    CleanupStack::PushL(self);
+    self->iClientRequestHandler = new (ELeave) CPolicyClientRequestHandler(self);
+    CleanupStack::Pop(self);
+    __ALFFXLOGSTRING("CPolicyHandler::NewL <<");
+    return self;
+    }
+
+CPolicyHandler::~CPolicyHandler()
+    {
+    __ALFFXLOGSTRING("CPolicyHandler::~CPolicyHandler >>");
+    delete iClientRequestHandler;
+
+    iFullscreenPolicies.ResetAndDestroy();
+
+    iControlPolicies.ResetAndDestroy();
+
+    iFullScreenBlocks.ResetAndDestroy();
+
+    iListBoxPolicies.ResetAndDestroy();
+    __ALFFXLOGSTRING("CPolicyHandler::~CPolicyHandler <<");
+    }
+
+CPolicyHandler::CPolicyHandler()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Insert the new policy in the list of existing ones.  The list is kept
+// sorted according to specificity, ie. how much is specified in the policy.
+// ---------------------------------------------------------------------------
+//
+void CPolicyHandler::RegisterListBoxKmlL( const TUid& aUid,
+										  const TThreadId& aThreadId,
+                                          const CAlfTransitionServerClient::TListBoxType aListBoxType,
+                                          const TDesC& aResourceDir, 
+						                  const TDesC& aBackgroundFilename, 
+						                  const TDesC& aItemFilename,
+						                  TInt aCachePriority, 
+						                  TInt aWantedTime , TInt aMinTime )
+    {
+    __ALFFXLOGSTRING2("CPolicyHandler::RegisterListBoxKmlL - aUid 0x%x, aThreadId >>", aUid, aThreadId.Id());
+	aCachePriority = 1;
+	// For now, the cache priority is always 1 at registration time, and after
+	// fetching the KML information from the policy, it gets set to 0. This is
+	// used to trigger eviction from the KML cache. Newly registered KML:s have
+	// priority over existing...
+	CListBoxPolicy* policy = CListBoxPolicy::NewL( aUid, 
+												   aThreadId, 
+												   aListBoxType,
+	                                               aResourceDir, 
+                                                   aBackgroundFilename, 
+                                                   aItemFilename,
+                                                   aCachePriority,
+                                                   aWantedTime,
+                                                   aMinTime );
+	CleanupStack::PushL( policy );
+	TInt spec = policy->Specificity();	
+	TInt count = iListBoxPolicies.Count();
+	TInt uid = aUid.iUid;
+	TInt i;
+	
+	// This keeps the list with ListBox KMLs sorted after specifity, 
+	// High specificity is in the beginning of the list and low at the end.
+	// This means that when getting a ListBox KML it will find the more specified
+	// values first. A Uid counts as more specific than a TListBoxType.
+	
+	for ( i = 0; i < count; i++ )
+	    {
+	    CListBoxPolicy* curr = iListBoxPolicies[i];
+	    TInt currspec = curr->Specificity();
+	    
+	    if ( uid == curr->Uid().iUid && aListBoxType == curr->ListBoxType() )
+	        {
+	        // Duplicate policy, delete the old one.
+	        iListBoxPolicies.Remove( i );
+	        delete curr;
+	        break;
+	        }
+	    else if ( spec > currspec )
+	        {
+	        break;
+	        }
+	    }
+
+    iListBoxPolicies.InsertL( policy, i );
+    
+    CleanupStack::Pop();
+    __ALFFXLOGSTRING("CPolicyHandler::RegisterListBoxKmlL <<");
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::UnregisterListBoxKml( const TUid& aUid,
+        CAlfTransitionServerClient::TListBoxType aListBoxType )
+	{
+	__ALFFXLOGSTRING1("CPolicyHandler::UnregisterListBoxKml - Uid: 0x%x >>", aUid);
+	for( TInt count = iListBoxPolicies.Count() - 1 ; count >= 0; count-- )
+		{
+		if( iListBoxPolicies[count]->Uid() == aUid &&
+		    iListBoxPolicies[count]->ListBoxType() == aListBoxType )
+			{
+			delete iListBoxPolicies[count];
+			iListBoxPolicies.Remove( count );
+			__ALFFXLOGSTRING("CPolicyHandler::UnregisterListBoxKml - return KErrNone<<");
+			return KErrNone;
+			}
+		}
+	__ALFFXLOGSTRING("CPolicyHandler::UnregisterListBoxKml - return KErrNotFound <<");
+	return KErrNotFound;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::UnregisterListBoxKml( const TThreadId& aThreadId )
+	{
+	__ALFFXLOGSTRING1("CPolicyHandler::UnregisterListBoxKml - aThreadId: %d >>", aThreadId.Id());
+	TThreadId tid;
+	TInt err = KErrNotFound;
+	
+	for( TInt count = iListBoxPolicies.Count() - 1 ; count >= 0; count-- )
+		{
+		tid = iListBoxPolicies[count]->ThreadId();
+		if( tid.Id() == aThreadId.Id() )
+			{
+			delete iListBoxPolicies[count];
+			iListBoxPolicies.Remove( count );
+			err = KErrNone;
+			}
+		}
+	__ALFFXLOGSTRING1("CPolicyHandler::UnregisterListBoxKml - return: %d <<", err);
+	return err;
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::GetListBoxKml(	const TUid& aAppId,
+                                    const CAlfTransitionServerClient::TListBoxType aListBoxType,
+                                    TPtrC& aResourceDir,
+                                    TPtrC& aBackgroundFilename, 
+                                    TPtrC& aItemFilename, 
+                                    TInt& aCachePriority, TInt& aWantedTime,
+									TInt& aMinTime)
+	{
+	__ALFFXLOGSTRING3("CPolicyHandler::GetListBoxKml - aResourceDir: %S, aBackgroundFilename: %S, aItemFilename: %S >>", &aResourceDir, &aBackgroundFilename, &aItemFilename);
+	TInt count = iListBoxPolicies.Count();
+	TBool hit = EFalse;
+	TInt i;
+    aResourceDir.Set( TPtrC() );
+    aBackgroundFilename.Set( TPtrC() );
+    aItemFilename.Set( TPtrC() );
+	
+    for ( i = 0; i < count; i++ )
+        {
+        CListBoxPolicy* curr = iListBoxPolicies[i];
+        TInt uid = curr->Uid().iUid;
+        CAlfTransitionServerClient::TListBoxType listType = curr->ListBoxType();
+        
+        if ( ( !uid || uid == aAppId.iUid ) &&
+             ( listType == CAlfTransitionServerClient::EListTypeAny ||
+               listType == aListBoxType ) )
+            {
+            hit = ETrue;
+            break;
+            }
+        }
+
+    if ( !hit )
+        {
+        __ALFFXLOGSTRING("CPolicyHandler::GetListBoxKml - return KErrNotFound <<");
+        return KErrNotFound;
+        }
+
+	aResourceDir.Set( iListBoxPolicies[i]->ResourceDir() );
+	aBackgroundFilename.Set( iListBoxPolicies[i]->BackgroundFilename() );
+	aItemFilename.Set( iListBoxPolicies[i]->ItemFilename() );
+	aCachePriority = iListBoxPolicies[i]->CachePriority();
+	aWantedTime = iListBoxPolicies[i]->WantedTime();
+	aMinTime = iListBoxPolicies[i]->MinTime();
+		
+	// For now, this entry should have no priority over others
+	iListBoxPolicies[i]->SetCachePriority( 0 );
+	__ALFFXLOGSTRING("CPolicyHandler::GetListBoxKml - return KErrNone <<");
+	return KErrNone;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CPolicyHandler::RegisterFullscreenKmlL(TUint aAction, const TUid& aUid, const TThreadId& aThreadId,
+											const TDesC& aResourceDir, const TDesC& aFilename,
+											TInt /*aCachePriority*/, TInt aWantedTime, TInt aMinTime)
+	{
+	__ALFFXLOGSTRING3("CPolicyHandler::RegisterFullscreenKmlL - aAction: %d aUid: 0x%x aThread.Id : %d", aAction, aUid, aThreadId.Id() );
+	__ALFFXLOGSTRING2("CPolicyHandler::RegisterFullscreenKmlL - aResourceDir: %S, aFilename: %S", &aResourceDir, &aFilename );
+	TInt cachePriority = 1; //aCachePriority; 
+	// For now, the cache priority is always 1 at registration time, and after
+	// fetching the KML information from the policy, it gets set to 0. This is
+	// used to trigger eviction from the KML cache. Newly registered KML:s have
+	// priority over existing...
+	
+	CFullscreenPolicy* policy = NULL;
+	
+	// Check if the action was already is registered and if so, delete it.
+	TInt count = iFullscreenPolicies.Count()-1;
+	for(; count >= 0; count--)
+		{
+		if(	iFullscreenPolicies[count]->Action() == aAction && 
+			iFullscreenPolicies[count]->Uid() == aUid)
+			{
+			policy = iFullscreenPolicies[count];
+			iFullscreenPolicies.Remove(count);
+			delete policy;
+			policy = NULL;
+			}
+		} 
+
+	// create and add the new action.
+	policy = CFullscreenPolicy::NewL(aAction, aUid, aThreadId, aResourceDir, aFilename,
+														cachePriority, aWantedTime, aMinTime);
+	CleanupStack::PushL(policy);
+	iFullscreenPolicies.AppendL(policy);
+	CleanupStack::Pop(policy);
+	__ALFFXLOGSTRING("CPolicyHandler::RegisterFullscreenKmlL <<");
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::UnregisterFullscreenKml(TUint aAction, const TUid& aUid)
+	{
+	__ALFFXLOGSTRING2("CPolicyHandler::UnregisterFullscreenKml - aAction: %d, aUid: 0x%x <<", aAction, aUid );
+	TInt count = iFullscreenPolicies.Count() -1;
+	for(; count >= 0; count--)
+		{
+		if(iFullscreenPolicies[count]->Action() == aAction && 
+			iFullscreenPolicies[count]->Uid() == aUid)
+			{
+			CFullscreenPolicy* policy = iFullscreenPolicies[count];
+			iFullscreenPolicies.Remove(count);
+			delete policy;
+			policy = NULL;
+			__ALFFXLOGSTRING("CPolicyHandler::UnregisterFullscreenKml - return KErrNone <<");
+			return KErrNone;
+			}
+		}
+	__ALFFXLOGSTRING("CPolicyHandler::UnregisterFullscreenKml - return KErrNotFound <<");
+	return KErrNotFound;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::UnregisterFullscreenKml(const TThreadId& aThreadId)
+	{
+	__ALFFXLOGSTRING1("CPolicyHandler::UnregisterFullscreenKml - aThreadId: %d >>", aThreadId.Id());
+	TInt count = iFullscreenPolicies.Count() -1;
+	TInt err = KErrNotFound;
+	TThreadId tid;
+	
+	for(; count >= 0; count--)
+		{
+		tid = iFullscreenPolicies[count]->ThreadId();
+		if( tid.Id() == aThreadId.Id())
+			{
+			CFullscreenPolicy* policy = iFullscreenPolicies[count];
+			iFullscreenPolicies.Remove(count);
+			delete policy;
+			policy = NULL;
+			err = KErrNone;
+			}
+		}
+	__ALFFXLOGSTRING1("CPolicyHandler::UnregisterFullscreenKml - return: %d <<", err);
+	return err;
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::UnregisterAllKml(const TThreadId& aThreadId)
+	{
+	__ALFFXLOGSTRING1("CPolicyHandler::UnregisterAllKml - aThreadId: <<", aThreadId.Id());
+	TInt err = KErrNotFound;
+	TInt err1 = UnregisterFullscreenKml(aThreadId);
+	TInt err2 = UnregisterControlKml(aThreadId);
+
+	if(err1 == KErrNone || err2 == KErrNone)
+		err = KErrNone;
+
+
+	TInt err3 = UnregisterListBoxKml(aThreadId);
+	if(err3 == KErrNone)
+		err = KErrNone;
+	__ALFFXLOGSTRING1("CPolicyHandler::UnregisterAllKml - return: %d <<", err);
+    return err; 
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::GetFullscreenKml(	TUint aAction, const TUid& aToUid, const TUid& aFromUid,
+									 	TPtrC& aResourceDir, TPtrC& aFilename,
+									 	TInt& aCachePriority, TInt& aWantedTime, TInt& aMinTime)
+	{
+    __ALFFXLOGSTRING3("CPolicyHandler::GetFullscreenKml - aAction: %d, aToUid: %d, aFromUid :%d", aAction, aToUid, aFromUid );
+    __ALFFXLOGSTRING2("CPolicyHandler::GetFullscreenKml - aResourceDir: %S, aFilename :%S", &aResourceDir, &aFilename );
+
+	// Checking if the UID is blocked.
+	TInt blockedUids = iFullScreenBlocks.Count();
+	aResourceDir.Set( TPtrC() );
+	aFilename.Set( TPtrC() );
+	
+	for( TInt i = 0 ;  i < blockedUids ; i++ )
+		{
+		if( iFullScreenBlocks[i]->iToUid == aToUid ||
+			iFullScreenBlocks[i]->iFromUid == aFromUid)
+			{
+			__ALFFXLOGSTRING("CPolicyHandler::GetFullscreenKml - return KErrNotSupported <<");
+			return KErrNotSupported;
+			}
+		}
+		
+	TInt count = iFullscreenPolicies.Count();
+	// try to find it using both action and uid
+	for(TInt i = 0; i < count; i++)
+		{
+		if(iFullscreenPolicies[i]->Action() == aAction && 
+			iFullscreenPolicies[i]->Uid() == aToUid)
+			{
+			aResourceDir.Set( iFullscreenPolicies[i]->ResourceDir() );
+			aFilename.Set( iFullscreenPolicies[i]->Filename() );
+			aCachePriority = iFullscreenPolicies[i]->CachePriority();
+			aWantedTime = iFullscreenPolicies[i]->WantedTime();
+			aMinTime = iFullscreenPolicies[i]->MinTime();
+			// Check if theres a block on this UID/Action pair.
+			if( aFilename.Length() == 0 ) 
+				{
+	            __ALFFXLOGSTRING("CPolicyHandler::GetFullscreenKml - return KErrNotSupported <<");
+				return KErrNotSupported;
+				}
+				
+			// For now, this entry should have no priority over others
+			iFullscreenPolicies[i]->SetCachePriority(0);
+            __ALFFXLOGSTRING("CPolicyHandler::GetFullscreenKml - return KErrNone <<");
+            return KErrNone;
+			}
+		}
+	// try to find the default (Uid == KNullUid)
+	for(TInt i = 0; i < count; i++)
+		{
+		if(iFullscreenPolicies[i]->Action() == aAction && 
+			iFullscreenPolicies[i]->Uid() == KNullUid)
+			{
+			aResourceDir.Set( iFullscreenPolicies[i]->ResourceDir() );
+			aFilename.Set( iFullscreenPolicies[i]->Filename() );
+			aCachePriority = iFullscreenPolicies[i]->CachePriority();
+			aWantedTime = iFullscreenPolicies[i]->WantedTime();
+			aMinTime = iFullscreenPolicies[i]->MinTime();
+			
+			// For now, this entry should have no priority over others
+			iFullscreenPolicies[i]->SetCachePriority(0); 
+			__ALFFXLOGSTRING("CPolicyHandler::GetFullscreenKml - return KErrNone <<");
+			return KErrNone;
+			}
+		}
+	__ALFFXLOGSTRING("CPolicyHandler::GetFullscreenKml - return KErrNotFound <<");
+	return KErrNotFound;
+	}
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::BlockFullScreenUid(const TUid& aUid, TBool aBlockFrom, TBool aBlockTo)
+	{
+	__ALFFXLOGSTRING3("CPolicyHandler::BlockFullScreenUid - aUid: 0x%x, aBlockFrom: %d, aBlockTo: %d >>", aUid, aBlockFrom, aBlockTo );	
+	TFullScreenBlock* block = NULL;
+	
+	TInt blockedUids = iFullScreenBlocks.Count();
+	if(	blockedUids > 0)
+		{
+		// Looking for an existing To block.
+		if(!aBlockTo && aBlockFrom )
+			{
+			for(TInt i = 0; i < blockedUids; i++)
+				{
+				if(iFullScreenBlocks[i]->iFromUid == aUid)
+					{
+					__ALFFXLOGSTRING("CPolicyHandler::BlockFullScreenUid - return KErrNone <<");
+					return KErrNone;
+					}
+				}
+			}
+		// Looking for an existing From block.
+		else if(aBlockTo && !aBlockFrom)
+			{
+			for(TInt i = 0; i < blockedUids; i++)
+				{
+				if(iFullScreenBlocks[i]->iToUid  == aUid)
+					{
+					__ALFFXLOGSTRING("CPolicyHandler::BlockFullScreenUid - return KErrNone <<");
+					return KErrNone;
+					}
+				}
+			}
+		// Trying to unblock stuff.
+		else if(!aBlockTo && !aBlockFrom)
+			{
+			for(TInt i = blockedUids -1; i >= 0; i--)
+				{
+				if(	iFullScreenBlocks[i]->iToUid  == aUid ||
+					iFullScreenBlocks[i]->iFromUid == aUid )
+					{
+					block = iFullScreenBlocks[i];
+					iFullScreenBlocks.Remove(i);
+					delete block;
+					block = NULL;
+					}
+				}
+			__ALFFXLOGSTRING("CPolicyHandler::BlockFullScreenUid - return KErrNone <<");
+			return KErrNone;
+			}
+		// Looking for an existing To and From block with the same UID's.
+		else
+			{
+			for(TInt i = 0; i < blockedUids; i++)
+				{
+				if(	iFullScreenBlocks[i]->iToUid  == aUid &&
+					iFullScreenBlocks[i]->iFromUid == aUid )
+					{
+					__ALFFXLOGSTRING("CPolicyHandler::BlockFullScreenUid - return KErrNone <<");
+					return KErrNone;
+					}
+				}
+			}
+		}
+
+	// None found. Create!
+	block = new TFullScreenBlock();
+	if(NULL == block)
+		{
+		__ALFFXLOGSTRING("CPolicyHandler::BlockFullScreenUid - return KErrNoMemory <<");
+		return KErrNoMemory;
+		}
+
+	if(aBlockTo)
+		{
+		block->iToUid = aUid;
+		}
+	if(aBlockFrom)
+		{
+		block->iFromUid = aUid;
+		}
+
+	TInt err = iFullScreenBlocks.Append(block);
+	if(KErrNone != err)
+		{
+		delete block;
+		block = NULL;
+		}
+	__ALFFXLOGSTRING1("CPolicyHandler::BlockFullScreenUid - return: %d <<", err);
+	return err;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::RegisterControlAction(const TUid aUid, TUint aAction, const TDesC& aActionString)
+	{
+	__ALFFXLOGSTRING3("CPolicyHandler::RegisterControlAction - aUid: 0x%x, aAction: %d, aActionString: %S", aUid, aAction, &aActionString );
+	TInt index = 0;
+	CControlPolicy* pData = NULL;
+	CActionPolicy* pPolicy = NULL;
+	
+	// TEST!!!!!!!!!!
+	// First see if we have an empty entry that means a new KML has been registered
+	// Adding just a KML does not remove the old one, the old one gets removed only
+	// after we add an action to the new KML
+	
+	// The double action of first registering a KML file and then registering the action
+	// should be replaced with single call where the control file and action are defined
+	// in one call
+	
+    TInt count = iControlPolicies.Count();
+	index = -1;	// Setting index to negative value to use as check if match found.
+	TInt i = 0;
+	TInt j = 0;
+	TInt k = 0;
+	
+	// We stop when we find a matching empty entry
+	// But first old non-empty entries are deleted
+	for( i = count - 1; i >= 0 && index == -1; i-- )
+		{
+		pData = iControlPolicies[i];
+		if( pData->Uid() == aUid )
+			{
+			if ( pData->iControlPolicies.Count() == 0 )
+			    {
+			    index = i;
+			    // We have found an empty definition.
+			    // This means a new effect definition file has been added, and the new action
+			    // should be attached to it.
+			    // But first we have to remove the possible old effect file
+			    for ( j = count - 1; j >= 0; j-- )
+			        {
+               		pData = iControlPolicies[j];
+               		if ( pData->Uid() == aUid )
+               		    {
+                   		for ( k = 0; pData && k < pData->iControlPolicies.Count(); k++ )
+                   		    {
+            				pPolicy = pData->iControlPolicies[k];
+                   		    if ( pPolicy->iAction == aAction )
+                   		        {
+                   		        // Old definition found, remove the whole policy entry
+    			                iControlPolicies.Remove( j );
+    			                count--; // this value is referred later. It must be kept up to date.
+    			                delete pData;
+    			                pData = NULL;
+                   		        }
+                   		    }
+               		    }
+			        }
+			    }
+			}
+		}
+		
+	if( index >= 0 )
+		{
+		index = -1; // paranoid...
+		// find the empty entry again - if it exists
+		// our indexes may have got messed up if we removed something
+		// so we must recheck the index
+		// We only accept entries with no policies, as we just checked
+		// the existence of an entry with matching policy
+    	for( i = count - 1; i >= 0 && index == -1; i-- )
+	    	{
+		    pData = iControlPolicies[i];
+		    if( pData->Uid() == aUid )
+			    {
+     			if ( pData->iControlPolicies.Count() == 0 )
+     			    {
+	     		    index = i;
+     			    }
+			    }
+	    	}
+		}
+// Now we have checked if we have an effect file definition that has no entries yet,
+// and if we found one, we deleted old effect file definitions for this UID.
+// Now we check if we just update an old action or add a new one to the existing entry		
+
+	// First checking if we need to update a policy.
+	// If we have an empty entry, we must use it, not add our action to a different entry
+	// even if if has the same UID.
+	// So we must not try to find an existing entry if we have already decided to use an
+	// empty entry
+	
+	if ( index < 0 )
+	    {
+    	if(FindControlPolicy(aAction, aUid, pPolicy, index) == KErrNone)
+    		{
+    		// If we get here and pPolicy == NULL, something is really wrong outside of
+    		// our control.
+    		pPolicy->iAction = aAction;
+    		// Setting the action string is a leaving method.
+    		// Trap it here to avoid the rest of the system to become
+    		// leaving to.
+    		TRAPD(err, pPolicy->SetActionStringL(aActionString));
+    		if(KErrNone != err)
+    			{
+    			__ALFFXLOGSTRING1("CPolicyHandler::RegisterControlAction - return: %d <<", err);
+    			return err;
+    			}
+    		pPolicy->iPolicy = ESupported;
+    		iClientRequestHandler->RegisterControlAction( aUid, aAction);
+    		__ALFFXLOGSTRING("CPolicyHandler::RegisterControlAction - return KErrNone <<");
+    		return KErrNone;
+    		}
+	    }
+		
+	if( index < 0 )
+		{
+		__ALFFXLOGSTRING("CPolicyHandler::RegisterControlAction - return KErrNotFound <<");
+		return KErrNotFound;
+		}
+		
+	pData = iControlPolicies[index];
+	pPolicy = new CActionPolicy();
+	if(!pPolicy)
+		{
+		__ALFFXLOGSTRING("CPolicyHandler::RegisterControlAction - return KErrNoMemory <<");
+		return KErrNoMemory;
+		}
+	
+	// Assign some values
+	pPolicy->iAction = aAction;
+	pPolicy->iPolicy = ESupported;
+	TRAPD(err, pPolicy->SetActionStringL(aActionString));
+	if(KErrNone != err)
+		{
+		delete pPolicy;
+		__ALFFXLOGSTRING1("CPolicyHandler::RegisterControlAction - return: %d <<", err);
+		return err;
+		}	
+
+	// Then add it to the list.
+	err = pData->iControlPolicies.Append(pPolicy);
+	if(err != KErrNone)
+		{
+		delete pPolicy;
+		pPolicy = NULL;
+		__ALFFXLOGSTRING1("CPolicyHandler::RegisterControlAction - return: %d <<", err);
+		return err;
+		}
+	iClientRequestHandler->RegisterControlAction(aUid, aAction);
+	__ALFFXLOGSTRING1("CPolicyHandler::RegisterControlAction - return: %d <<", err);
+	return err;
+	}
+	
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::UnregisterControlAction(const TUid aUid, TUint aAction)
+	{
+	__ALFFXLOGSTRING2("CPolicyHandler::UnregisterControlAction - aUid %d, aAction: %d >>", aUid, aAction);
+	CControlPolicy* pData = NULL;
+	CActionPolicy* pPolicy = NULL;
+		
+	TInt count = iControlPolicies.Count();
+	
+	// Removing policy for action.
+	for(TInt counter = 0; counter < count; counter++)
+		{
+		pData = iControlPolicies[counter];
+		if(pData->Uid() == aUid)
+			{
+			TInt polActionCount = pData->iControlPolicies.Count();
+			// Iterating the list from first. No problem since we only delete one item!
+			for(TInt j = 0; j < polActionCount; j++)
+				{
+				pPolicy = pData->iControlPolicies[j];
+				if(pPolicy->iAction == aAction)
+					{
+					// Call this before removing data permanently!
+					iClientRequestHandler->RemoveControlPolicy( aUid, aAction);
+					delete pPolicy;
+					pPolicy = NULL;
+					pData->iControlPolicies.Remove(j);
+					__ALFFXLOGSTRING("CPolicyHandler::UnregisterControlAction - return KErrNone<<");
+					return KErrNone;
+					}
+				}
+			}
+		}
+	__ALFFXLOGSTRING("CPolicyHandler::UnregisterControlAction - return KErrNotFound<<");
+	return KErrNotFound;
+	}  	
+	
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CPolicyHandler::RegisterControlKmlL(const TUid &aUid, const TThreadId &aThreadId, 
+										 const TDesC& aResourceDir, const TDesC& aFilename,
+										 const TInt aWantedTime, const TInt aMinTime)
+	{
+	
+	__ALFFXLOGSTRING2("CPolicyHandler::RegisterControlKmlL - aUid :%d aThread.Id :%d", aUid, aThreadId.Id() );
+   __ALFFXLOGSTRING2("CPolicyHandler::RegisterControlKmlL - aResourceDir: %S, aFilename :%S", &aResourceDir, &aFilename );
+
+	CControlPolicy* policy = NULL;
+	TInt cachePriority = 1; //aCachePriority; 
+	// For now, the cache priority is always 1 at registration time, and after
+	// fetching the KML information from the policy, it gets set to 0. This is
+	// used to trigger eviction from the KML cache. Newly registered KML:s have
+	// priority over existing...
+
+	// Check if the action was already is registered and if so, delete it.
+	
+// TEST!!!!!!!!!!!! Don't delete before action is added	
+// Only delete if the entry has no policies, then we are replacing the xml file
+// though we have added no actions yet
+	TInt count = iControlPolicies.Count()-1;
+	for(; count >= 0; count--)
+		{
+		if(	iControlPolicies[count]->Uid() == aUid)
+			{
+			policy = iControlPolicies[count];
+			if ( policy->iControlPolicies.Count() == 0 )
+			    {
+    			iControlPolicies.Remove(count);
+	    		delete policy;
+		    	policy = NULL;
+			    }
+			}
+		} 
+
+	// Create the new action and add it.
+	policy = CControlPolicy::NewL(aUid, aThreadId, aResourceDir, aFilename, cachePriority, aWantedTime, aMinTime);
+	CleanupStack::PushL(policy);
+	iControlPolicies.AppendL(policy);
+	CleanupStack::Pop(policy);
+	__ALFFXLOGSTRING("CPolicyHandler::RegisterControlKmlL <<");
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::RemoveControlKml(const TUid &aUid)
+	{
+	__ALFFXLOGSTRING1("CPolicyHandler::RemoveControlKml - aUid: %d ", aUid);
+	
+	TInt err = KErrNotFound;
+	CControlPolicy* ptr = NULL;
+	CActionPolicy* action = NULL;
+	TInt policyCount = iControlPolicies.Count();
+	// We may remove several KMLs if different actions have different effect files
+	for( TInt i = policyCount - 1; i >= 0; i--)
+		{
+		ptr = iControlPolicies[i];
+		if(ptr->Uid() == aUid)
+			{
+			// making sure that policies get removed from the running clients as well!
+			TInt count = ptr->iControlPolicies.Count();
+			if( count > 0)
+				{
+				for(TInt j = 0; j < count; j++)
+					{
+					action = ptr->iControlPolicies[j];
+					iClientRequestHandler->RemoveControlPolicy(aUid, action->iAction);
+					}
+				}
+			iControlPolicies.Remove(i);
+			delete ptr;
+			ptr = NULL;
+			err = KErrNone;
+			}
+		}
+	__ALFFXLOGSTRING1("CPolicyHandler::RemoveControlKml - return: %d <<", err);
+	return err;
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::UnregisterControlKml(const TThreadId &aThreadId)
+	{
+	__ALFFXLOGSTRING1("CPolicyHandler::UnregisterControlKml - aThreadId: %d ", aThreadId.Id() );
+	CControlPolicy* ptr = NULL;
+	CActionPolicy* action = NULL;
+	TInt err = KErrNotFound;
+	TThreadId tid;
+	TInt policyCount = iControlPolicies.Count();
+	
+	for( TInt i = policyCount - 1; i >= 0; i--)
+		{
+		ptr = iControlPolicies[i];
+		tid = ptr->ThreadId();
+		
+		if(tid.Id() == aThreadId.Id())
+			{
+			// making sure that policies get removed from the running clients as well!
+			TInt count = ptr->iControlPolicies.Count();
+			if(count > 0)
+				{
+				for(TInt j = 0; j < count; j++)
+					{
+					action = ptr->iControlPolicies[j];
+					iClientRequestHandler->RemoveControlPolicy(ptr->Uid(), action->iAction);
+					}
+				}
+			iControlPolicies.Remove(i);
+			delete ptr;
+			ptr = NULL;
+			err = KErrNone;
+			}
+		}
+	__ALFFXLOGSTRING1("CPolicyHandler::UnregisterControlKml - return: %d <<", err);
+	return err;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::GetControlKml(	TUid aUid, TUint aAction, TPtrC& aResourceDir, 
+					TPtrC& aFileName, TPtrC& aActionString, TInt& aCachePriority,
+					TInt& aWantedTime, TInt& aMinTime)
+	{
+	__ALFFXLOGSTRING2("CPolicyHandler::GetControlKml - aAction: %d aUid :0x%x", aAction, aUid );
+	__ALFFXLOGSTRING3("CPolicyHandler::GetControlKml - aResourceDir: %S, aFilename :%S, aActionString: %S", &aResourceDir, &aFileName, &aActionString );
+	    
+	CControlPolicy* ptr = NULL;
+	CActionPolicy* pPolicy = NULL;
+	aResourceDir.Set( TPtrC() );
+	aFileName.Set( TPtrC() );
+    aActionString.Set( TPtrC() );
+
+	TInt itemCount = iControlPolicies.Count();
+	for(TInt i = 0; i < itemCount; i++)
+		{
+		ptr = iControlPolicies[i];
+		if( ptr->Uid() == aUid)
+			{
+			aResourceDir.Set( ptr->ResourceDir() );
+			aFileName.Set( ptr->Filename() );
+			aCachePriority = ptr->CachePriority();
+			aWantedTime = ptr->WantedTime();
+			aMinTime = ptr->MinTime();
+			TInt actionCount = ptr->iControlPolicies.Count();
+			for(TInt j = 0; j < actionCount; j++)
+				{
+				pPolicy = ptr->iControlPolicies[j];
+				if(pPolicy->iAction == aAction)
+					{
+					aActionString.Set( pPolicy->ActionString() );
+					// For now, this entry should have no priority over others
+					ptr->SetCachePriority(0);
+					__ALFFXLOGSTRING("CPolicyHandler::GetControlKml - return KErrNone <<");
+					return KErrNone;
+					}
+				}
+			}
+		}
+	__ALFFXLOGSTRING("CPolicyHandler::GetControlKml - return KErrNotFound <<");
+	return KErrNotFound;
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::GetAllControlPolicies(RPointerArray<CClientControlPolicy>& aControlPolicies)
+	{
+	__ALFFXLOGSTRING("CPolicyHandler::GetAllControlPolicies >>");
+	TInt err = KErrNone;
+	
+	TInt itemCount = iControlPolicies.Count();
+	if( 0 >= itemCount)
+		{
+		__ALFFXLOGSTRING("CPolicyHandler::GetAllControlPolicies - return KErrNotFound <<");
+		return KErrNotFound;
+		}
+
+	for(TInt i = 0; i < itemCount; i++)
+		{
+		CClientControlPolicy* ptr = new CClientControlPolicy();
+		if ( ptr == NULL )
+		    {
+		    __ALFFXLOGSTRING("CPolicyHandler::GetAllControlPolicies - return KErrNoMemory <<");
+		    return KErrNoMemory;
+		    }
+		ptr->iUid = iControlPolicies[i]->Uid();
+		HBufC* fname = HBufC::New(iControlPolicies[i]->Filename().Length());
+		if ( fname == NULL )
+		    {
+		    delete ptr;
+		    __ALFFXLOGSTRING("CPolicyHandler::GetAllControlPolicies - return KErrNoMemory <<");
+		    return KErrNoMemory;
+		    }
+		fname->Des().Copy(iControlPolicies[i]->Filename());
+		ptr->iFilename.Assign(fname);
+		HBufC* resdir = HBufC::New(255);
+        if ( resdir == NULL )
+            {
+            delete ptr;
+            __ALFFXLOGSTRING("CPolicyHandler::GetAllControlPolicies - return KErrNoMemory <<");
+            return KErrNoMemory;
+            }
+		ptr->iResourceDir.Assign(resdir);
+		// In order to actually copy the pointers to the policy data, we
+		// need to iterate through the entire list. 
+		TInt count = iControlPolicies[i]->iControlPolicies.Count();
+		if(count > 0)
+			{
+			for( TInt j = 0; j < count; j++)
+				{
+				err = ptr->iControlPolicies.Append(iControlPolicies[i]->iControlPolicies[j]);
+				if(KErrNone != err)
+					{
+					delete ptr;
+					__ALFFXLOGSTRING1("CPolicyHandler::GetAllControlPolicies - return: %d <<", err);
+					return err;
+					}
+				}
+			err = aControlPolicies.Append(ptr);	
+			if(KErrNone != err)
+				{
+				delete ptr;
+				__ALFFXLOGSTRING1("CPolicyHandler::GetAllControlPolicies - return: %d <<", err);
+				return err;
+				}
+			}
+		else
+			{
+			delete ptr;
+			ptr = NULL;
+			}
+		}
+	__ALFFXLOGSTRING("CPolicyHandler::GetAllControlPolicies - return KErrNotFound<<");
+	return KErrNone;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::RequestPolicy(const RMessage2& aMessage)
+	{
+	return iClientRequestHandler->RequestPolicy(aMessage);
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::GetPolicyL( TThreadId aClientId, TInt aPolicyCount, TPtr8& aOutBuf )
+ 	{
+ 	return iClientRequestHandler->GetPolicyL( aClientId, aPolicyCount, aOutBuf );
+ 	}
+ 	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CPolicyHandler::RemoveClient( TThreadId aClientId )
+ 	{
+ 	iClientRequestHandler->RemoveClient( aClientId );
+ 	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+/*
+void CPolicyHandler::RemoveDeadClients()
+ 	{
+ 	iClientRequestHandler->RemoveDeadClients();
+ 	}
+*/ 	
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+/*
+void CPolicyHandler::DumpClientsL(RFileWriteStream& aFile)
+	{
+	iClientRequestHandler->DumpClientsL(aFile);
+	}
+*/	
+ 	
+
+//==============  	PRIVATE METHODS =================/
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyHandler::FindControlPolicy(TUint aAction, TUid aUid, CActionPolicy*& aPolicy, TInt& aIndex)
+	{
+	__ALFFXLOGSTRING3("CPolicyHandler::FindControlPolicy - aAction: %d, aUid: 0x%x, aIndex: %d", aAction, aUid, aIndex );
+	
+	TInt count = iControlPolicies.Count();
+	aIndex = -1;	// Setting index to low value to avoid accidental insertion.
+	
+	CControlPolicy* pData = NULL;
+	for(TInt i = 0; i < count; i++)
+		{
+		pData = iControlPolicies[i];
+		if(pData->Uid() == aUid)
+			{
+			aIndex = i;
+			TInt j = pData->iControlPolicies.Count();
+			CActionPolicy* pPolicy = NULL;
+			for(TInt q = 0; q < j; q++)
+				{
+				pPolicy = pData->iControlPolicies[q];
+				if(pPolicy->iAction == aAction)
+					{
+					aPolicy = pPolicy;
+					__ALFFXLOGSTRING("CPolicyHandler::FindControlPolicy - return KErrNone <<");
+					return KErrNone;
+					}
+				}
+			}
+		}
+    __ALFFXLOGSTRING("CPolicyHandler::FindControlPolicy - return KErrNotFound <<");
+	return KErrNotFound;
+	}
+
+
+// --- EOF ---
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfpolicyrequesthandler.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,678 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Contains a class that is responsible for sending policy updates 
+*                to connected clients
+*
+*/
+
+
+
+#include <e32std.h>
+#include <s32mem.h>
+
+//======== USER INCLUDES ========
+#include "alfpolicyrequesthandler.h"
+#include "alfpolicyhandler.h"
+//#include "tfxserverdef.h"
+#include <alflogger.h>
+
+
+// ======== HELPER CLASS FUNCTIONS ========
+
+CPolicyEventReq::CPolicyEventReq()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor for CPolicyEventReq
+// ---------------------------------------------------------------------------
+//
+CPolicyEventReq::~CPolicyEventReq()
+	{
+	iOriginalControlPolicies.ResetAndDestroy();
+	iAddedPolicies.ResetAndDestroy();
+	iRemovedPolicies.ResetAndDestroy();
+
+	if(!iMessage.IsNull() && iMessage.Handle() != 0)	// We should release a a stored message. 
+		{
+        __ALFFXLOGSTRING("CPolicyEventReq:: Message complete, Disconnected");
+		iMessage.Complete( KErrDisconnected );
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TUint CPolicyEventReq::TotalPolicyCount() const
+    {
+    TUint count = 0;
+    for ( TInt i = iOriginalControlPolicies.Count() - 1; i >= 0; --i )
+        {
+        count += iOriginalControlPolicies[i]->iControlPolicies.Count();
+        }
+    count += iAddedPolicies.Count();
+    count += iRemovedPolicies.Count();
+    return count;
+    }
+
+// ---------------------------------------------------------------------------
+// Constructor for CClientControlPolicy
+// ---------------------------------------------------------------------------
+//
+CClientControlPolicy::CClientControlPolicy()
+	{
+	}
+
+	
+// ---------------------------------------------------------------------------
+// Destructor for CClientControlPolicy
+// ---------------------------------------------------------------------------
+//
+CClientControlPolicy::~CClientControlPolicy()
+	{
+	
+	for( TInt i =  iControlPolicies.Count() - 1; i >= 0; i--)
+		{
+		iControlPolicies.Remove(i);
+		}
+		
+	iControlPolicies.Close();
+	iResourceDir.Close();
+	iFilename.Close();
+	}
+
+	
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// Constructor. 
+// ---------------------------------------------------------------------------
+//
+CPolicyClientRequestHandler::CPolicyClientRequestHandler(CPolicyHandler* aParent) :
+		 iParent(aParent)
+	{
+	}
+	
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CPolicyClientRequestHandler::~CPolicyClientRequestHandler()
+	{
+    RemoveDeadClients();
+	iControlPolicyClients.ResetAndDestroy();
+	}
+	
+	
+// ---------------------------------------------------------------------------
+// Iterates over all connected clients and appends a policy to each if necessary.
+// ---------------------------------------------------------------------------
+//
+void CPolicyClientRequestHandler::RegisterControlAction(const TUid aUid, TUint aAction)
+	{
+	CPolicyEventReq* pPolReq = NULL;
+	
+	// Look for existing clients. If none found, all is OK.
+	TInt contrCount = iControlPolicyClients.Count();
+	// We have some connected clients. Update the new policies for all of these.
+	for(TInt i = 0; i < contrCount; i++)
+		{
+		pPolReq = iControlPolicyClients[i];
+		// Checking if we already have stored the policy. Since we only have a copy of the pointer
+		// to the original object we need not update it. It has already been done in the policyhandler.
+		if(KErrNone == CheckStoredControlPolicy(pPolReq->iOriginalControlPolicies, aUid, aAction))
+			{
+			return;
+			}
+		// If it's not in the original list, see if we have it somewhere else. If so, complete
+		// the stored away message if possible.
+		if(KErrNone == AddControlPolicyAction(pPolReq->iAddedPolicies, pPolReq->iRemovedPolicies, aUid, aAction))
+			{
+			if(!pPolReq->iMessage.IsNull())
+				{
+                __ALFFXLOGSTRING("CPolicyEventReq:: Message complete, Register control action");
+				pPolReq->iMessage.Complete(KErrNone);
+				pPolReq->iMessage = RMessagePtr2();
+				}
+			}
+		}
+	}
+	
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyClientRequestHandler::RemoveControlPolicy(const TUid aUid, TUint aAction )
+	{
+	
+	TInt clientCount = iControlPolicyClients.Count();
+	TInt err = KErrNone;
+	// Lint will complain because the tPol pointer is not deleted here.
+	// The pointer is stored into a pointerarray and deleted when the array is destroyed.
+	// This is the reason why this warning/error is disabled.
+	/*lint -e429  -e830 */
+
+	for(TInt i = 0; i < clientCount; i++)
+		{
+		if( KErrNotFound == RemovePolicyUid(iControlPolicyClients[i]->iOriginalControlPolicies, 
+											aAction, aUid) 	&& 
+			KErrNotFound == RemovePolicyUid(iControlPolicyClients[i]->iAddedPolicies, aAction, aUid))
+			{
+			TControlPolicy* tPol = new TControlPolicy;
+			if(NULL == tPol)
+				{
+				return KErrNoMemory;
+				}
+			tPol->iAction = aAction;
+			tPol->iId = aUid;
+			tPol->iPolicy = ENotSupported;
+			
+			err = iControlPolicyClients[i]->iRemovedPolicies.Append(tPol); //Takes ownership
+			if( KErrNone != err)
+				{
+				delete tPol;
+				tPol = NULL;
+				return err;
+				}
+				
+			if(!iControlPolicyClients[i]->iMessage.IsNull())
+				{
+                __ALFFXLOGSTRING("CPolicyEventReq:: Message complete, Remove control policy");
+				iControlPolicyClients[i]->iMessage.Complete(KErrNone);
+				iControlPolicyClients[i]->iMessage = RMessagePtr2();
+				}
+			}
+		} 
+	/*lint +e429  +e830 */
+	return KErrNone;
+	}
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyClientRequestHandler::RequestPolicy( const RMessage2& aMessage )
+	{
+	TInt err = KErrNone;
+	CPolicyEventReq* req = NULL;
+	
+	RThread client;
+	err = aMessage.Client( client );
+	if( err != KErrNone )
+		{
+		client.Close();
+		return err;
+		}
+		
+	TThreadId currClient = client.Id();
+	client.Close();
+	
+	TInt clientCount = iControlPolicyClients.Count();
+	for( TInt i = 0; i < clientCount; i++ )
+		{
+		req = iControlPolicyClients[i];
+		if(req->iClientId == currClient)
+			{
+			if(	req->iAddedPolicies.Count() == 0 && req->iOriginalControlPolicies.Count() == 0
+				&& req->iRemovedPolicies.Count() == 0)
+				{
+				// Check if it's OK to add this request to the list.
+				// This is done by just storing the message. 
+				if( req->iMessage.IsNull() )
+					{
+					req->iMessage = aMessage;
+					return KErrNone;
+					}
+				// If message is not null, something is wrong.
+				return KErrGeneral;
+				}
+			// If we have a stored message, complete it. Should not happen!
+			if( !req->iMessage.IsNull() )
+				{
+                __ALFFXLOGSTRING("CPolicyEventReq:: Message complete, stored message, should not happen");
+				req->iMessage.Complete( KErrNone );
+	    		// NULLify the message pointer after it has been completed.
+	    		// If not done, we can't check if the message is valid or not.
+				req->iMessage = RMessagePtr2();
+				return KErrNone;
+				}
+            // Otherwise complete this message.
+            __ALFFXLOGSTRING("CPolicyEventReq:: Message complete, return policy count");
+            aMessage.Complete( req->TotalPolicyCount() );
+			return KErrNone;
+			}
+		}
+	// Client not found. Insert it!
+	err = InsertClient( aMessage );
+	if( err != KErrNotFound )	
+		{
+		// If failed to insert the client, complete the message so it may try again.
+		// Also, if there are control policies, we report the number of them
+		// If error is KErrNotFound, we have stored the message, and it will be completed
+		// later (as soon as there are policies)
+        __ALFFXLOGSTRING1("CPolicyEventReq:: insert client returned %d", err);
+		aMessage.Complete( err );
+		}
+	return KErrNone;
+	}
+	
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyClientRequestHandler::GetPolicyL( TThreadId aClientId, TInt aPolicyCount, TPtr8& aOutBuf )
+    {
+    CPolicyEventReq* 		req 	= NULL;
+    TControlPolicy* 		tAddPol	= NULL;
+    CActionPolicy*			tPol 	= NULL;
+    CClientControlPolicy*	tOUid 	= NULL;	
+    TControlPolicy* 		tRemPol = NULL;
+        
+    TThreadId id = aClientId;
+    TInt count = 0;
+    RDesWriteStream outstream( aOutBuf );
+    CleanupClosePushL( outstream );
+    
+    for( TInt i = iControlPolicyClients.Count() - 1; i >= 0; --i )
+        {
+        req = iControlPolicyClients[i];
+        
+        if ( req->iClientId == id )
+            {
+            int added = 0;
+
+            count = req->TotalPolicyCount();
+            if ( count > aPolicyCount )
+                {
+                count = aPolicyCount;
+                }
+            outstream.WriteUint32L( count );
+
+            TInt addedPolicyCount       = req->iAddedPolicies.Count();
+            TInt origPolicyCount        = req->iOriginalControlPolicies.Count();
+            TInt removedPoliciesCount   = req->iRemovedPolicies.Count();
+
+            for ( TInt q = origPolicyCount - 1; q >= 0 && added < count; --q )
+                {
+                tOUid = req->iOriginalControlPolicies[q];
+                TInt origPolicyInfoCount = tOUid->iControlPolicies.Count();
+                for ( TInt qi = origPolicyInfoCount - 1; qi >= 0 && added < count; --qi )
+                    {
+                    tPol = tOUid->iControlPolicies[qi];
+                    outstream.WriteInt32L( tOUid->iUid.iUid );
+                    outstream.WriteInt32L( tPol->iAction );
+                    outstream.WriteUint8L( tPol->iPolicy );
+                    added++;
+
+                    // Here we only remove the policy from the local list of original policies.
+                    // we don't delete it since it's a copy of the pointer to the
+                    // original object and we don't want to remove it permanently!
+                    tOUid->iControlPolicies.Remove( qi );
+                    }
+                if ( tOUid->iControlPolicies.Count() == 0 )
+                    {
+                    // It's OK to delete tOUid. It doesn't destroy anything except itself!
+                    req->iOriginalControlPolicies.Remove(q);
+                    delete tOUid;
+                    }
+                }
+
+            for ( TInt z = addedPolicyCount - 1; z >= 0 && added < count; --z )
+                {
+                tAddPol = req->iAddedPolicies[z];
+                outstream.WriteInt32L( tAddPol->iId.iUid );
+                outstream.WriteInt32L( tAddPol->iAction );
+                outstream.WriteUint8L( tAddPol->iPolicy );
+                  added++;
+
+                // Here we delete the actual object. This is possible since
+                // it has been created specifically for this client.
+                delete tAddPol;
+                req->iAddedPolicies.Remove( z );
+                }
+            for(TInt s = removedPoliciesCount - 1; s >= 0 && added < count; s--)
+                {
+                tRemPol = req->iRemovedPolicies[s];
+                outstream.WriteInt32L( tRemPol->iId.iUid );
+                outstream.WriteInt32L( tRemPol->iAction );
+                outstream.WriteUint8L( tRemPol->iPolicy );
+                   added++;
+                // Here we delete the actual object. This is possible since
+                // it has been created specifically for this client.
+                delete tRemPol;
+                req->iRemovedPolicies.Remove(s);
+                }
+            outstream.CommitL();
+            CleanupStack::PopAndDestroy(); // outstream
+            
+            return KErrNone;
+            }
+        }
+        
+    outstream.WriteUint32L( 0 );
+    outstream.CommitL();
+    CleanupStack::PopAndDestroy(); // outstream
+    return KErrNotFound;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CPolicyClientRequestHandler::RemoveClient( TThreadId aClientId )
+	{
+	for( TInt i = iControlPolicyClients.Count() - 1; i >= 0; i--)
+		{
+		if( iControlPolicyClients[i]->iClientId == aClientId )
+			{
+			if(!iControlPolicyClients[i]->iMessage.IsNull())
+			    {
+                __ALFFXLOGSTRING("CPolicyEventReq:: Message complete, remove client");
+    			iControlPolicyClients[i]->iMessage.Complete( KErrCancel );
+                iControlPolicyClients[i]->iMessage = RMessage2(); //Null message so destructor wont try to complete.
+			    }
+   			delete iControlPolicyClients[i];
+			iControlPolicyClients.Remove(i);
+			}
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// Removes all requests belonging to a terminated client.
+// ---------------------------------------------------------------------------
+//
+void CPolicyClientRequestHandler::RemoveDeadClients()
+	{
+	// Lint seems to have some trouble identifying the TThreadId class.
+	// Due to this, Lint will report several errors here that are incorrect.
+	// These errors are disabled.
+	/*lint -e10 -e1013 -e1055 -e746 -e747 */
+	RThread client;
+	for( TInt i = iControlPolicyClients.Count() - 1; i >= 0; i--)
+		{
+		TInt err = client.Open(iControlPolicyClients[i]->iClientId.Id());
+		if(err == KErrNone)
+			{
+			if(client.ExitType() != EExitPending)
+				{
+				//Client is dead, remove from list.
+				iControlPolicyClients[i]->iMessage = RMessage2(); //Null message so destructor wont try to complete.
+				delete iControlPolicyClients[i];
+				iControlPolicyClients.Remove(i);
+				}
+		    client.Close();
+			}
+		else
+			{
+			//Could not open client, client handle was invalid.
+			//So clean it up from list too.
+			iControlPolicyClients[i]->iMessage = RMessage2(); //Null message so destructor wont try to complete.
+			delete iControlPolicyClients[i];
+			iControlPolicyClients.Remove(i);
+			}
+		}
+	/*lint +e10 +e1013 +e1055 +e746 +e747 */
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CPolicyClientRequestHandler::DumpClientsL(RFileWriteStream& aFile)
+	{
+	// Lint seems to have some trouble identifying the TThreadId class.
+	// Due to this, Lint will report several errors here that are incorrect.
+	// These errors are disabled.
+	/*lint -e10 -e1013 -e1055 -e746 -e747 */
+	for(TInt i = iControlPolicyClients.Count() - 1; i >= 0; i--)
+		{
+		TPckgC<TThreadId> clientid(iControlPolicyClients[i]->iClientId.Id());
+		aFile.WriteL(clientid);
+		}
+	/*lint +e10 +e1013 +e1055 +e746 +e747 */
+	}
+
+	
+// =================== PRIVATE METHODS ==============
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyClientRequestHandler::InsertClient(const RMessage2& aMessage)
+	{
+	
+	TInt err = KErrNone;
+	
+	CPolicyEventReq* req = new CPolicyEventReq();
+	if (!req)
+		{
+		return KErrNoMemory;
+		}
+
+	// Getting the client ID and storing it.	
+	RThread client;
+	err = aMessage.Client(client);
+	if( err != KErrNone )
+		{
+		delete req;
+		return err;
+		}
+	req->iClientId = client.Id();
+	client.Close();
+	
+    err = iControlPolicyClients.Append(req);
+    if( err == KErrNone )
+    	{
+		// Requesting all policies from the policy handler.
+        err = iParent->GetAllControlPolicies( req->iOriginalControlPolicies );
+		if( err == KErrNotFound )
+			{
+			// If no polices found, store message for later.
+			req->iMessage = aMessage;
+			return err;
+			} 
+        err = req->TotalPolicyCount();
+    	}
+    else
+        {
+        delete req;
+        }
+    return err;
+	}
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyClientRequestHandler::AddControlPolicyAction(	RPointerArray<TControlPolicy>& aAddedPolicies,
+															RPointerArray<TControlPolicy>& aRemovedPolicies,
+															const TUid aUid, TUint aAction)
+	{
+	
+	
+	// Lint will complain because the tPol pointer is not deleted here.
+	// The pointer is stored into a pointerarray and deleted when the array is destroyed.
+	// This is the reason why this warning/error is disabled.
+	/*lint -e429 -e830 */
+		
+	TControlPolicy* tPol = NULL;
+	TInt err = KErrNone;
+	
+	// Checking if we have any newly added policies.
+	TInt polUidCount = aAddedPolicies.Count();
+	for(TInt i = 0; i < polUidCount; i++)
+		{
+		tPol = aAddedPolicies[i];
+		if(tPol->iId == aUid && tPol->iAction == aAction)
+			{
+			return KErrNone;
+			}
+		}
+	// Checking if this policy has been set to be removed.
+	polUidCount = aRemovedPolicies.Count();
+	for(TInt i = 0; i < polUidCount; i++)
+		{
+		tPol = aRemovedPolicies[i];
+		if(tPol->iId == aUid && tPol->iAction == aAction)
+			{
+			aRemovedPolicies.Remove(i);
+			delete tPol;
+			tPol = NULL;
+			return KErrNone;
+			}
+		}
+	
+	// No policy found. Adding a new one.
+	// For some reason Lint doesn't like this if() clause. Perhaps Lint doesn't
+	// understand that new can return NULL. Disabling the "if always evaluates to False"
+	// error message.
+	/*lint -e774 -e831 */
+	tPol = NULL;
+	tPol = new TControlPolicy;
+	if(NULL == tPol)
+		{
+		return KErrNoMemory;
+		}
+	/*lint +e774 +e831 */
+
+	tPol->iAction = aAction;
+	tPol->iId = aUid;
+	tPol->iPolicy = ESupported;
+
+	err = aAddedPolicies.Append(tPol);
+	if(KErrNone == err)
+		{
+		return err;
+		}
+
+	// Clenup on failure
+	delete tPol;
+	tPol = NULL;
+	return err;			
+
+	/*lint +e429 +e830 */	
+	}
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyClientRequestHandler::CheckStoredControlPolicy(	RPointerArray<CClientControlPolicy>& aPtr, 
+															TUid aUid, TUint aAction)
+	{
+	
+	TInt polUidCount = aPtr.Count();
+	for(TInt i = 0; i < polUidCount; i++)
+		{
+		if(aPtr[i]->iUid == aUid)
+			{
+			TInt actionCount = aPtr[i]->iControlPolicies.Count();
+			for(TInt j = 0; j < actionCount; j++)
+				{
+				if(aPtr[i]->iControlPolicies[j]->iAction == aAction)
+					{
+					return KErrNone;
+					}
+				}
+			}
+		}
+	return KErrNotFound;
+	}
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+// 
+
+TInt CPolicyClientRequestHandler::RemovePolicyUid(RPointerArray<TControlPolicy>& aAddedPolicies, TUint aAction, const TUid aUid)
+	{
+	TControlPolicy* tUid = NULL;
+
+	TInt policyCount = aAddedPolicies.Count();
+	for(TInt i = 0; i < policyCount; i++)
+		{
+		tUid = aAddedPolicies[i];
+		if(tUid->iId == aUid && tUid->iAction == aAction)
+			{
+			delete tUid;
+			tUid = NULL;
+			aAddedPolicies.Remove(i);
+			return KErrNone;
+			}
+		} 
+	return KErrNotFound;
+	}
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyClientRequestHandler::RemovePolicyUid(RPointerArray<CClientControlPolicy>& aPolUid, TUint aAction, const TUid aUid)
+	{
+	CClientControlPolicy* tUid = NULL;
+	
+	TInt policyCount = aPolUid.Count();
+	for(TInt i = 0; i < policyCount; i++)
+		{
+		tUid = aPolUid[i];
+		if(tUid->iUid == aUid)
+			{
+			TInt err = RemovePolicyInfo(tUid->iControlPolicies, aAction, EFalse);
+			if ( err == KErrNone)
+				{
+				if(tUid->iControlPolicies.Count() == 0)
+					{
+					delete tUid;
+					tUid = NULL;
+					aPolUid.Remove(i);
+					}
+				return err;
+				}
+			}
+		}
+	return KErrNotFound;
+	}
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TInt CPolicyClientRequestHandler::RemovePolicyInfo(RPointerArray<CActionPolicy>& aPolInfo, TUint aAction, TBool aDelete)
+	{
+	CActionPolicy* tPol = NULL;
+	TInt polInfoCount = aPolInfo.Count();
+	
+	for(TInt i = 0; i < polInfoCount; i++)
+		{
+		tPol = aPolInfo[i];
+		if(tPol->iAction == aAction)
+			{
+			if(aDelete)
+				{
+				delete tPol;
+				tPol = NULL;
+				}
+			aPolInfo.Remove(i);
+			return KErrNone;
+			}
+		}
+	return KErrNotFound;
+	}
+
+
+
+// --- EOF ---
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfserverdrawer.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1363 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 server plugin, used by transition server to control
+*                framebuffers.
+*
+*/
+
+
+
+#include <bitstd.h>
+#include <s32mem.h> //RMemReadStream
+#include <e32cmn.h>
+#include <apgwgnam.h>
+#include <bautils.h> 
+
+#include <akntranseffect.h> 
+#include <akntransitionutils.h>
+
+#include "alfwindowmanager.h"
+#include "alfserverdrawer.h"
+#include "wsserverdrawercontroller.h"
+#include "alfgfxeffects.h"
+#include "alfwindow.h"
+#include "alfstreamerbridge.h"
+#include "alfpolicyhandler.h"
+#include <alflogger.h>
+#include <uiacceltk/HuiUtil.h>
+
+#ifdef __WINS__
+const TInt KAlfShortEffectTimeout = 4000000;
+const TInt KAlfLongEffectTimeout  = 5000000;
+#else
+const TInt KAlfShortEffectTimeout = 2000000;
+const TInt KAlfLongEffectTimeout  = 3000000;
+#endif
+//const TInt KAlfLongEffectTimeout  = 500000;
+
+
+// Timer to send finish full screen effect
+// ---------------------------------------------------------
+// CAlfFinishTimer
+// ---------------------------------------------------------
+//
+NONSHARABLE_CLASS( CAlfFinishTimer ):public CTimer
+    {
+    public:  // Constructors and destructor
+        static CAlfFinishTimer* NewL();
+        virtual ~CAlfFinishTimer();
+
+    public: // New functions
+            
+        void Start( TTimeIntervalMicroSeconds32 aPeriod, TCallBack aTimeoutCallback );
+        
+    protected:  // Functions from base classes
+        
+        void DoCancel();
+
+    private:
+
+        CAlfFinishTimer();
+        void ConstructL();
+        void RunL();
+      
+    private:    // Data
+                
+    TCallBack iCallback;
+ 
+    };
+
+
+// ---------------------------------------------------------
+// CAlfFinishTimer
+// ---------------------------------------------------------
+//
+CAlfFinishTimer::CAlfFinishTimer()
+    :CTimer ( EPriorityStandard )
+    {   
+    }
+
+void CAlfFinishTimer::ConstructL()
+    {
+    CTimer::ConstructL();
+    CActiveScheduler::Add( this );
+    }
+
+CAlfFinishTimer* CAlfFinishTimer::NewL()
+    {
+    CAlfFinishTimer* self = new ( ELeave ) CAlfFinishTimer;
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CAlfFinishTimer::~CAlfFinishTimer()
+    {
+    Cancel();        
+    }
+
+void CAlfFinishTimer::Start( TTimeIntervalMicroSeconds32 aPeriod, TCallBack aTimeoutCallback )
+    {
+    iCallback = aTimeoutCallback; 
+    After( aPeriod );
+    }
+
+void CAlfFinishTimer::RunL()
+    {
+    //
+    // timer completes and control is returned to caller
+    //
+    if ( iStatus.Int() != KErrCancel )
+        {
+        iCallback.CallBack();
+        }
+    }
+
+void CAlfFinishTimer::DoCancel()
+    {
+    CTimer::DoCancel();
+    }
+
+
+NONSHARABLE_CLASS( CPSObserver ): public CActive
+    {
+    public:
+        static CPSObserver* NewL( const TUid& aUid, TInt aKey );
+        void StartObserving( TCallBack aCallback, TInt aHandle );
+        ~CPSObserver();
+    private:
+        CPSObserver();
+        void ConstructL( const TUid& aUid, TInt aKey );
+        void DoCancel();
+        void RunL();
+    private:
+        RProperty iProperty;
+        TInt iKey;
+        TCallBack iCallback;
+        TInt iHandle;
+    };
+    
+CPSObserver::CPSObserver():
+    CActive( CActive::EPriorityHigh )
+    {
+    }
+    
+CPSObserver::~CPSObserver()
+    {
+    Cancel();
+    iProperty.Close();
+    }
+    
+CPSObserver* CPSObserver::NewL( const TUid& aUid, TInt aKey )
+    {
+    CPSObserver* self = new ( ELeave ) CPSObserver();
+    CleanupStack::PushL( self );
+    self->ConstructL( aUid, aKey );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+void CPSObserver::ConstructL( const TUid& aUid, TInt aKey ) 
+    {
+    iKey = aKey;
+    User::LeaveIfError( iProperty.Attach( aUid, aKey ) );
+    CActiveScheduler::Add( this );
+    }
+
+void CPSObserver::StartObserving( TCallBack aCallback, TInt aHandle )
+    {
+    Cancel();
+    iHandle = aHandle;
+    iCallback = aCallback;
+    iProperty.Subscribe( iStatus );
+    SetActive();
+    }
+    
+void CPSObserver::RunL()
+    {
+    // prepare for stray signals
+    iProperty.Subscribe( iStatus );
+    SetActive();
+    TInt value = -1;
+    TInt err = iProperty.Get( value );
+    if ( iStatus.Int() != KErrCancel && value == iHandle )
+        {
+        iCallback.CallBack();
+        // Cancel wait for property change until a new effect is started
+        Cancel();            
+        }
+    // If the handle does not match, the ending effect was some earlier one
+    // We keep waiting for signal about ending of the correct effect.    
+    }
+    
+void CPSObserver::DoCancel()
+    {
+    iProperty.Cancel();
+    }
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CAlfServerDrawer* CAlfServerDrawer::NewL( CAlfWindowManager* aWindowManager,
+    CPolicyHandler& aPolicyHandler )
+    {
+    CAlfServerDrawer* self = new(ELeave) CAlfServerDrawer( aWindowManager, aPolicyHandler );
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CAlfServerDrawer::ConstructL()
+    {
+    iController = CWsServerDrawerController::NewL(this);
+
+    iIdle = CIdle::NewL(CActive::EPriorityIdle);
+
+    iFullScreenTimeout = CAlfFinishTimer::NewL();
+    iFinishFullScreen = CAlfFinishTimer::NewL();
+    
+    iTransitionEndObserver = CPSObserver::NewL( KPSAlfDomain, KAlfTransitionStatus );
+    iProperty.Attach( KPSAlfDomain, KAlfTransitionStatus );
+    iProperty.Set( KPSAlfDomain, KAlfTransitionStatus, 0 );
+    iFs.Connect();
+    
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CAlfServerDrawer::CAlfServerDrawer( CAlfWindowManager* aWindowManager,
+    CPolicyHandler& aPolicyHandler  ):
+    iWindowManager( aWindowManager ),
+    iPolicyHandler( aPolicyHandler )
+    {
+    iScrModeChangedState = EScreenModeChangedIdle;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+CAlfServerDrawer::~CAlfServerDrawer()
+    {
+    delete iTransitionEndObserver;
+    iProperty.Close();
+    iFs.Close();
+    delete iController;
+    delete iIdle;
+    delete iFinishFullScreen;
+    delete iFullScreenTimeout;
+        
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CAlfServerDrawer::BeginControlTransition( TUint aAction, TUid aControlUid,
+    TInt aWindowGroup, TInt aWindowHandle)
+    {
+  	iControlRect = TRect(); // clear the rectangle
+
+    if ( iInScreenModeChange )
+        {
+        return KErrAbort;
+        }
+    else
+        {
+        iControlAction = aAction;
+        iControlUid = aControlUid;
+        iControlWindowGroup = aWindowGroup;
+        iControlHandle = aWindowHandle;
+        return iController->BeginControlTransition();
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+void CAlfServerDrawer::EndControlTransition(TInt aHandle)
+    {
+    iController->EndControlTransition(aHandle);
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//		
+void CAlfServerDrawer::PrepareFullscreen()
+    {
+    __ALFFXLOGSTRING(" -> PrepareFullscreen");
+    __ALFFXLOGSTRING(" -> PrepareFullscreen end");
+    }
+
+void CAlfServerDrawer::UnregisterAllAlfFullScreenEffect()
+    {
+    TAlfBridgerData bridgerData;  
+    bridgerData.Set( EAlfUnregisterAllFx, 0, 0, NULL );              
+    iWindowManager->PostIt(bridgerData);
+    }
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//  
+void CAlfServerDrawer::UnregisterAlfFullScreenEffect( TInt aAction )
+    {
+    TAlfBridgerData bridgerData;  
+    bridgerData.Set( EAlfUnregisterEffectFx, aAction, 0, NULL );              
+    iWindowManager->PostIt(bridgerData);
+    }
+
+// ---------------------------------------------------------------------------
+// BeginSyncronizedGroup
+// ---------------------------------------------------------------------------
+//  
+void CAlfServerDrawer::BeginSyncronizedGroup(TInt aGroupId)
+    {
+    TAlfBridgerData bridgerData;  
+    bridgerData.Set( EAlfEffectFxBeginSyncronizedGroup, aGroupId, 0, NULL );              
+    iWindowManager->PostIt(bridgerData);
+    }
+
+// ---------------------------------------------------------------------------
+// EndSyncronizedGroup
+// ---------------------------------------------------------------------------
+//  
+void CAlfServerDrawer::EndSyncronizedGroup(TInt aGroupId, TBool aForced)
+    {
+    TAlfBridgerData bridgerData;  
+    bridgerData.Set( EAlfEffectFxEndSyncronizedGroup, aGroupId, aForced, NULL );              
+    iWindowManager->PostIt(bridgerData);
+    }
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//  
+void CAlfServerDrawer::RegisterAlfFullScreenEffect( TInt aAction, const TDesC& aResourceDir,
+        const TDesC& aFileName)
+    {
+    TAlfBridgerData bridgerData;              
+               
+    TInt bufferSize = sizeof(TPtrC) + ( aResourceDir.Length()*2) + sizeof(TPtrC) + aFileName.Length() * 2;
+    TInt index = 0;
+
+    void* bridgeBuffer = NULL;
+    // This function cannot actually leave
+    TRAP_IGNORE( bridgeBuffer = (void*)iWindowManager->Bridge()->AppendEffectsDataL( bufferSize, index ) ); 
+    if ( bridgeBuffer )
+       {
+       RMemWriteStream stream( bridgeBuffer, bufferSize );
+       // The writes should not leave if we have calculated our buffer length correctly.
+       TRAP_IGNORE(
+           {
+           stream << aResourceDir;
+           stream << aFileName;                 
+           stream.CommitL();    
+           });      
+       bridgerData.Set( EAlfRegisterEffectFx, aAction, bufferSize, (TAny*) index );              
+       iWindowManager->PostIt(bridgerData);
+       stream.Close();
+       }
+    }
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+void CAlfServerDrawer::BeginFullscreen(	TInt aAction, const TRect& aEffectRect,
+                                        TInt aType, const TUid aUid1, const TUid aUid2, TInt aData )
+    {  
+    if ( iController->AppInfoCache().Action(aUid1) == aAction && 
+         iController->AppInfoCache().Action(aUid1) !=  AknTransEffect::EApplicationExit )
+        {
+        __ALFFXLOGSTRING2(" -> CAlfServerDrawer::BeginFullscreen - skipping action: %d, because previous action is stronger: %d", aAction, iAction);
+        // the action must be skipped, because stronger action has been request already.
+        return;
+        }
+    
+    __ALFFXLOGSTRING2(" -> CAlfServerDrawer::BeginFullscreen - Action: %d, aType: %d", aAction, aType);
+    TInt action = iController->AppInfoCache().SetAction(aUid1, aAction);
+    
+    // Skip all embedded and background application effects, for now.
+    // This addition is to prevent messaging app popping up in startup.
+    // AVKON uses wrong parameter type and so NoEffects is not applied.
+    if ( action == AknTransEffect::EEmbeddedApplicationExit ||
+         action == AknTransEffect::EEmbeddedApplicationStart || 
+         action == AknTransEffect::EAppStartupBackground )
+        {
+        __ALFFXLOGSTRING1(" -> CAlfServerDrawer::BeginFullscreen - Embedded/background (%d) application, skip effect", aAction);
+        return;
+        }
+  
+    if ( aAction != AknTransEffect::ENone && aAction != AknTransEffect::EAppStartupBackground )
+        {
+        // no action or background activity won't stop current effect
+        // Matrix Menu sends start rect and avkon sends start for the same application!
+        // We assume that we want to keep the rect from Matrix Menu if the app id matches 
+//        if ( !iDoNotClearEffectRect )
+        if ( iToUid == aUid1 &&
+            ( iAction == AknTransEffect::EApplicationStartRect || iAction == AknTransEffect::EApplicationStartSwitchRect ) &&
+            ( aAction == AknTransEffect::EApplicationStart || aAction == AknTransEffect::EApplicationStartSwitch ) ) 
+            {
+            // if we have first got a start rect and the basic start for the same application,
+            // we save the rectangle information and keep asking an effect with a rectangle
+            aAction = iAction; 
+            }
+        else
+            {
+            // This is a new event, we change the rectangle
+            iEffectRect = aEffectRect;
+            }
+        }
+        
+   	iFlags = AknTransEffect::TParameter::EFlagNone;
+	iToUid = KNullUid;
+	iFromUid = KNullUid;
+	iFocusWg = KErrNotFound;
+	
+	iType = aType;
+	
+	if ( aType == AknTransEffect::EParameterType )
+		{
+        __ALFFXLOGSTRING("CAlfServerDrawer::BeginFullscreen - AknTransEffect::EParameterType");    
+        iToUid = aUid1;
+        iFromUid = aUid2;
+        iFlags = aData;  
+		}
+	if ( aType == AknTransEffect::EParameterAvkonInternal )
+	    {
+        // here comes in the avkon info, which will tell us the window group id required for the effect EndFullScreen event
+        __ALFFXLOGSTRING("CAlfServerDrawer::BeginFullscreen - AknTransEffect::EParameterAvkonInternal");    
+        iToUid = aUid1;
+        iParentUid = aUid2;
+        iFocusWg = aData;	    
+        // We save the action in case we haven't got an EndFullScreen call yet
+        iOldAction = iAction;
+	    }
+	    
+    iAction = aAction;
+    // TODO: TEMPORARY HACK
+    // REMOVE AFTER APPSHELL HAS BEEN FIXED
+    // commented out to test if the system works now
+    /*
+    if ( ( iAction == AknTransEffect::EApplicationStartRect || iAction == AknTransEffect::EApplicationStartSwitchRect ) &&
+        iToUid.iUid == 0x101F4CD2 )
+        {
+        iDoNotClearEffectRect = ETrue;
+        }
+    */   
+    // As appshell uses strange values for folder open and close, we change them now.
+    /*
+    if ( iAction == 1001 && iToUid.iUid == KAknApplicationShellViewId )
+       {
+       iAction = AknTransEffect::EApplicationStart;
+       }
+    if ( iAction == 1002 && iToUid.iUid == KAknApplicationShellViewId  )
+       {
+       // This might not be the right one, but we try if this is OK
+       iAction = AknTransEffect::EApplicationExit;
+       }
+    */       
+	    
+    __ALFFXLOGSTRING2("CAlfServerDrawer::BeginFullscreen - From UID: 0x%X, To UID: 0x%X, Application UID: 0x%X", iFromUid.iUid, iToUid.iUid );    
+    __ALFFXLOGSTRING3("CAlfServerDrawer::BeginFullscreen - Parent UID: 0x%X, Focus window group UID: 0x%X, Flags: 0x%X", iParentUid.iUid, iFocusWg, iFlags);    
+    if( aAction == AknTransEffect::ELayoutSwitch )
+        {
+        iScrModeChangedState = EScreenModeBeginHasBeenCalled;
+        }
+    else 
+        {
+        iScrModeChangedState = EScreenModeChangedIdle;
+        }
+
+    iController->BeginFullscreen( aType, aUid1, aUid2, aData );
+    __ALFFXLOGSTRING("CAlfServerDrawer::BeginFullscreen end");
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CAlfServerDrawer::EndFullscreen()
+    {
+    __ALFFXLOGSTRING(" -> CAlfServerDrawer::EndFullscreen");
+    CancelEndChecker();
+    iController->EndFullscreen(EFalse);
+    iController->AppInfoCache().ClearActions();
+    __ALFFXLOGSTRING("CAlfServerDrawer::EndFullscreen end");
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+void CAlfServerDrawer::CancelFullscreen()
+    {
+    __ALFFXLOGSTRING(" -> CAlfServerDrawer::CancelFullscreen");
+    __ALFFXLOGSTRING("CAlfServerDrawer::CancelFullscreen end");
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+void CAlfServerDrawer::AbortFullscreen()
+    {
+    __ALFFXLOGSTRING(" -> CAlfServerDrawer::AbortFullscreen");
+    iController->AbortTransition(EAbortFullscreen);
+    iController->AppInfoCache().ClearActions();
+    __ALFFXLOGSTRING("CAlfServerDrawer::AbortFullscreen end");
+    }
+
+
+TInt CAlfServerDrawer::FailedFullscreen(TAny* aArg) 
+	{
+	CAlfServerDrawer* self = static_cast<CAlfServerDrawer*>(aArg);
+	self->iController->EndExpired(); // The same as if End Checker Expires.
+	return EFalse;
+	}
+
+TBool CAlfServerDrawer::EffectFinishedFullScreen() const
+    {
+    return iFullScreenFinished;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CAlfServerDrawer::SendBeginFullscreen()
+    {
+    TRAP_IGNORE(DoSendBeginFullscreenL());
+    }
+    
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//  
+void CAlfServerDrawer::DoSendBeginFullscreenL()
+    {
+    __ALFFXLOGSTRING(" <- CAlfServerDrawer::SendBeginFullscreen");
+    __ALFFXLOGSTRING(" <- Original window server ids");
+    __ALFFXLOGSTRING2("From UID: 0x%X, To UID: 0x%X", iFromUid.iUid, iToUid.iUid);    
+    __ALFFXLOGSTRING2("Parent UID: 0x%X, Focus window group UID: 0x%X", iParentUid.iUid, iFocusWg);    
+    TInt err = KErrNone;
+    
+    // This should be only the first half of the effect, the second part should start
+    // when we get EndFullScreen
+    // Originally this was where the screen capture was made and the drawing redirected.
+    // Here we can start doing some effect for the application that is currently on the
+    // screen. The new application effect should start at "EndFullScreen"
+    // That normally means that the application has drawn something to its window.
+    
+    iFromWg = 0;
+    iToWg = 0;
+    
+	// TODO: using temp getter for window group ids vs app uids
+	//
+	// Official implementation pending on new window server APIs expected to available be around W40 
+	
+    if ( iType == AknTransEffect::EParameterType )
+        {
+        // TODO TODO TODO TODO TODO TODO TODO
+        //  THIS MUST BE FIXED IN ORDER TO HAVE APPLICATION START EFFECTS WORKING!
+        //
+        // THE WINDOWGROUP LIST FOR APPLICATIONS IS NOT UP-TO-DATE, BECAUSE WE CANNOT ASK IT ANYMORE DIRECTLY 
+        // FROM WSERV (DEADLOCK ISSUES).
+        // THUS IT IS UP TO CHANCE THAT WE GET A VALID REPLY IN THIS POINT.
+        // WE WILL VERY LIKELY NOT INITIATE THE EFFECT AT ALL, WHEN APPLICATION IS REALLY STARTING INSTEAD OF
+        // BEING BROUGHT FORWARD FROM BACKGROUND.
+        // TODO TODO TODO TODO TODO TODO TODO
+        iFromWg = iWindowManager->Bridge()->FindWgForAppUid(iFromUid);
+        __ALFFXLOGSTRING2("Window group from from-Application UID: 0x%X wg: 0x%x", iFromUid, iFromWg);    
+        //                                                    ---> YES --> id must be valid. continue
+        //                        YES --> Is this exit event? 
+        // Id found in cache? -->                             ---> NO  --> continue, but refreshed value should overwrite this valua in iEngine.
+        //                        NO  --> we must wait for the value.                    
+          
+        
+        if (!iToWg)
+        	{
+        	iToWg = iWindowManager->Bridge()->FindWgForAppUid(iToUid); // This call might be now obsolete
+        	}
+        
+        __ALFFXLOGSTRING2("Window group from to-Application UID: 0x%X wg: 0x%x", iToUid, iToWg);    
+        }
+    
+    // How do we handle the case where we have app id, parent id and focus wg?
+    
+    if ( iType == AknTransEffect::EParameterAvkonInternal )
+        {
+        // Is this "from" or "to" or do we just use iFocusWg?
+        iToWg = iWindowManager->Bridge()->FindWgForAppUid(iToUid);
+        
+        __ALFFXLOGSTRING2("Window group from internal-Application UID: 0x%X wg: 0x%x", iToUid, iToWg);    
+        // Is this "from" or "to" or do we just use iFocusWg?
+        if ( iParentUid != KNullUid )
+            {
+            iFromWg = iWindowManager->Bridge()->FindWgForAppUid(iParentUid);
+            __ALFFXLOGSTRING2("Window group from parent-Application UID: 0x%X wg: 0x%x", iParentUid,  iFromWg);    
+            }
+        }
+        
+    // What do we do if there are no windows?
+    // We could use the built-in effect layer, but now we just stop here
+    
+    // We don't handle the EParameterAvkonInternal type
+    // TODO: revise this condition, when appui is available from wserv
+    /*if ( ( ( iFromWg == 0 || iFromWg == KErrNotFound ) && 
+        ( iToWg == 0 || iToWg == KErrNotFound ) &&
+        ( iFocusWg == 0 || iFocusWg == KErrNotFound ) ) ||
+        iType == AknTransEffect::EParameterAvkonInternal )
+        { // TODO: Uncomment, when appui available in alfbridge
+        // bail out, cannot start an effect without any windows
+        // We don't need to reset the WinIdLists as they have not been filled
+    	iIdle->Start(TCallBack(FailedFullscreen,this));
+        return;
+        }
+        */
+    // If we don't have the target window, we bail out
+    // This is because we get into trouble if another beginfullscreen
+    // follows too fast.
+    /*
+    if ( iToWg == 0 || iToWg == KErrNotFound )
+        {
+    	iIdle->Start(TCallBack(FailedFullscreen,this));
+        return;
+        }
+        */
+        
+    TBool blocked = iController->IsBlocked( iFromUid, iToUid );
+    if (blocked)
+        {
+        return;
+        }
+
+    TBool isExit = ( iAction == AknTransEffect::EApplicationExit );
+    
+    // We should probably get out here if the uids are on the blocked list.
+    
+    // It appears that the exiting application is the second id
+    // The same application appears as second id both when it starts and exits!
+
+    // Get the wanted full screen effect from the policy handler
+    
+    TInt cachePriority = 0;
+   	TInt wantedTime = 0;
+	TInt minTime = 0;
+	TPtrC resourceDir;
+	TPtrC fileName;
+
+    err = iPolicyHandler.GetFullscreenKml( iAction, iToUid, iFromUid, resourceDir, fileName,
+        cachePriority, wantedTime, minTime );
+    
+    
+    if ( err != KErrNone || fileName.Length() == 0 || !FileExistsL( resourceDir, fileName ) )
+        {
+        // Did not find an effect file - nothing to show
+        __ALFFXLOGSTRING2(" <- CAlfServerDrawer:: Could not get full screen kml, error %d %S", err, &fileName)
+        iFromWg = KErrNotFound;
+        iToWg = KErrNotFound;
+        iFromScreen = KErrNotFound;
+        iToScreen = KErrNotFound;
+    	// iIdle->Start( TCallBack( FailedFullscreen, this ) );
+    	return;
+        }
+        
+    // TODO: This context switch is done because matrix menu uses opposite context numbers
+    // from the screen saver, and we want to handle folder open the same way as application
+    // open and folder close the same way as application close.
+    // We may need to change this after we have tested the system and seen how it works
+    // (if at all)
+    // We may need to assign some unique numbers for the folder open and close to make the system work.
+    
+    
+    // TODO: We do the switch with screen saver hoping it is the only one using reverse logic 
+    
+    if ( iAction == 1001 && iToUid.iUid == KScreensaverUid )
+        {
+        iAction = AknTransEffect::EApplicationExit;
+        }
+    
+    if ( iAction == 1002 && iToUid.iUid == KScreensaverUid )
+        {
+        iAction = AknTransEffect::EApplicationStart;
+        }
+    
+/*    
+    if ( iAction == 1001 && iToUid.iUid == KAknApplicationShellViewId )
+       {
+       iAction = AknTransEffect::EApplicationStart;
+//       iAction = 1002;
+       }
+   if ( iAction == 1002 && iToUid.iUid == KAknApplicationShellViewId  )
+       {
+//       iAction = AknTransEffect::EApplicationExit;
+       }
+*/       
+       
+    
+    // Send the data to CAlfAppUI via bridge
+    
+    TAlfBridgerData bridgerData;
+    
+    // We must make a stream of the data as the length may vary.
+    // At the moment we only send some numbers, but we should probably include
+    // also the effect file name or something else to identify the effect 
+    // that is going to be used
+    
+    TInt bufferSize = 11 * sizeof(TInt); //operation, TYPE, 2 wg ids, 2 app uids, flags and rect
+    bufferSize += sizeof(TPtrC);
+    bufferSize += resourceDir.Length() * 2;
+    bufferSize += sizeof(TPtrC);
+    bufferSize += fileName.Length() * 2;
+    
+    // I don't think we need this
+    TInt index = 0;
+
+    IncreaseHandle();
+
+    iTransitionEndObserver->Cancel();
+    iIdle->Cancel(); //cancel if running.
+    iFinishFullScreen->Cancel();
+    iFullScreenTimeout->Cancel();
+
+    // The first stage should actually just show some wait dialog - it is waiting for the second
+    // stage of the effect to start.
+    void* bridgeBuffer = (void*) iWindowManager->Bridge()->AppendEffectsDataL( bufferSize, index ); 
+    if ( bridgeBuffer )
+        {
+        RMemWriteStream stream( bridgeBuffer, bufferSize );
+        // The writes should not leave if we have calculated our buffer length correctly.
+        stream.WriteInt32L( MAlfGfxEffectPlugin::EBeginFullscreen );
+        stream.WriteInt32L( iCurrHandle );
+        stream.WriteInt32L( iType );
+      	if ( iType == AknTransEffect::EParameterType && isExit )
+      	    {
+            stream.WriteInt32L( iToWg );
+            stream.WriteInt32L( 0 );
+
+            // AppUid
+            stream.WriteInt32L( iToUid.iUid );
+            stream.WriteInt32L( iFromUid.iUid );
+                        
+            stream.WriteInt32L( KErrNotFound ); //  was iToScreen, obsolete
+            stream.WriteInt32L( KErrNotFound ); // was iToScreen, obsolete
+       	    }
+       	else if ( iType == AknTransEffect::EParameterType )
+       	    {
+            stream.WriteInt32L( iToWg );
+            stream.WriteInt32L( iFromWg );
+
+            // AppUid
+            stream.WriteInt32L( iToUid.iUid );
+            stream.WriteInt32L( iFromUid.iUid );
+                        
+            stream.WriteInt32L( KErrNotFound );  // was iToScreen, obsolete
+            stream.WriteInt32L( KErrNotFound ); // was iToScreen, obsolete
+            }
+        else
+            {
+            stream.WriteInt32L( KErrNotFound); // was iFocusWg 
+            stream.WriteInt32L( KErrNotFound); // was iFocusWg 
+            }
+        stream.WriteInt32L( iFlags );
+        stream.WriteInt32L( iEffectRect.iTl.iX );
+        stream.WriteInt32L( iEffectRect.iTl.iY );
+        stream.WriteInt32L( iEffectRect.iBr.iX );
+        stream.WriteInt32L( iEffectRect.iBr.iY );
+        stream << resourceDir;
+        stream << fileName;    
+        stream.CommitL();
+        bridgerData.Set( EAlfEffectFx, iAction, bufferSize, (TAny*) index );
+        __ALFFXLOGSTRING(" <- CAlfServerDrawer::sending bridgedata");
+        iFullScreenEndSent = EFalse;
+        iFullScreenFxSent = ETrue;
+        
+        iWindowManager->PostIt( bridgerData );
+        
+        stream.Close();
+        iTransitionEndObserver->StartObserving( TCallBack( TransitionFinished, this ), iCurrHandle );
+        }
+    
+    // iFlags and iAction will contain some extra information that can be used to control the effect:
+    
+    // All of these actions may not produce effects, they are here for now for debugging.
+    
+    switch ( iAction )
+        {
+        case AknTransEffect::EApplicationActivate:
+            __ALFFXLOGSTRING("EApplicationActivate - 1");
+            break;
+        case AknTransEffect::EApplicationStart:
+            __ALFFXLOGSTRING("EApplicationStart - 3");
+            break;
+        case AknTransEffect::EEmbeddedApplicationStart:
+            __ALFFXLOGSTRING("EEmbeddedApplicationStart - 4");
+            break;
+        case AknTransEffect::EApplicationExit:
+            __ALFFXLOGSTRING("EApplicationExit - 5");
+            break;
+        case AknTransEffect::EApplicationStartRect:
+            __ALFFXLOGSTRING("EApplicationStartRect - 6");
+            break;
+        case AknTransEffect::EApplicationStartSwitch:
+            __ALFFXLOGSTRING("EApplicationStartSwitch - 7");
+            break;
+        case AknTransEffect::EApplicationStartSwitchRect:
+            __ALFFXLOGSTRING("EApplicationStartSwitchRect - 8");
+            break;
+        case AknTransEffect::EEmbeddedApplicationExit:
+            __ALFFXLOGSTRING("EEmbeddedApplicationExit - 10");
+            break;
+        case AknTransEffect::EAppStartComplete:
+            __ALFFXLOGSTRING("EAppStartComplete - 11");
+            break;
+        case AknTransEffect::ELayoutSwitch:
+            __ALFFXLOGSTRING("ELayoutSwitch - 12");
+            break;
+        case AknTransEffect::ELayoutSwitchExit:
+            __ALFFXLOGSTRING("ELayoutSwitchExit - 13");
+            break;
+        case AknTransEffect::ELayoutSwitchStart:
+            __ALFFXLOGSTRING("ELayoutSwitchStart - 14");
+            break;
+        case AknTransEffect::EAppSpesificEvent:
+            __ALFFXLOGSTRING("EAppSpesificEvent - 1000");
+            break;
+        case AknTransEffect::EAppStartupBackground:
+            __ALFFXLOGSTRING("EAppStartupBackground - 15");
+            break;
+        default:
+            __ALFFXLOGSTRING1("%d", iAction);
+            break;
+        }
+
+    // This is a precaution for cases where we never get end full screen
+    // the delay is too long for normal cases, but because of the slowness of the emulater
+    // the delay must be long enough so that it does not interfere with actual
+    // endfullscreen signals.
+    
+    // It appears that folder open and close never send endfullscreen, so for them the effect
+    // must be started as soon as we get beginfullscreen
+    
+    iFullScreenTimeout->Start( KAlfLongEffectTimeout, TCallBack( FullScreenTimeout, this ) );
+    }
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+TInt CAlfServerDrawer::SendEndFullscreen()
+    {
+    __ALFFXLOGSTRING(" <- CAlfServerDrawer::SendEndFullscreen");
+    
+    if ( iFullScreenEndSent )
+        {
+        __ALFFXLOGSTRING("CAlfServerDrawer::SendEndFullscreen END no need");
+        return KErrNone;
+        }
+    iFullScreenEndSent = ETrue;
+        
+    __ALFFXLOGSTRING(" <- CAlfServerDrawer::SendEndFullscreen");
+    iTransitionEndObserver->Cancel();
+    iFullScreenTimeout->Cancel();
+    iFinishFullScreen->Cancel();
+	iIdle->Cancel(); //cancel if running.
+    /*
+    TUint action = iAction;   
+    if ( iType == AknTransEffect::EParameterAvkonInternal )
+        {
+        action = iOldAction;
+        }
+    */
+    // TEMPORARY HACK
+    // REMOVE AFTER APPSHELL HAS BEEN FIXED
+    //iDoNotClearEffectRect = EFalse;
+    
+    // This is where the second part of the effect should start
+    // The new window should already have something on the screen
+    
+    // Send the data to CAlfAppUI via bridge
+    
+    TAlfBridgerData bridgerData;
+    
+    // Get the wanted full screen effect from the policy handler
+    
+	TPtrC resourceDir;
+	TPtrC fileName;
+
+    // We must make a stream of the data as the length may vary.
+    // At the moment we only send some numbers, but we should probably include
+    // also the effect file name or something else to identify the effect 
+    // that is going to be used
+    
+    TInt bufferSize = 11 * sizeof(TInt); // operation, type, 2 wg ids, 2 app uids, flags and rect
+    bufferSize += sizeof(TPtrC);
+    bufferSize += resourceDir.Length() * 2;
+    bufferSize += sizeof(TPtrC);
+    bufferSize += fileName.Length() * 2;
+    
+    TInt index = 0;
+
+    // Send End fullscreen indication. Note that most of the data is invalid
+    // and those should not be used in alfbridge. Data cannot be guaranteed
+    // to be valid as we may receive multiple BeginFullscreen before EndFullscreen.
+    
+    void* bridgeBuffer = NULL;
+    // This function cannot actually leave
+    TRAP_IGNORE( bridgeBuffer = (void*) iWindowManager->Bridge()->AppendEffectsDataL( bufferSize, index ) ); 
+    if ( bridgeBuffer )
+        {
+        RMemWriteStream stream( bridgeBuffer, bufferSize );
+        // The writes should not leave if we have calculated our buffer length correctly.
+        TRAP_IGNORE(
+            {
+            stream.WriteInt32L( MAlfGfxEffectPlugin::EEndFullscreen );
+            stream.WriteInt32L( iCurrHandle );
+            stream.WriteInt32L( iType );
+
+            stream.WriteInt32L( iToWg );
+            stream.WriteInt32L( iFromWg );
+
+            // AppUid for the future. alfbridge can figure out the windog groups based on that
+            stream.WriteInt32L( iToUid.iUid );
+            stream.WriteInt32L( iFromUid.iUid );
+
+            if ( iType == AknTransEffect::EParameterType )
+                {
+                stream.WriteInt32L( iToScreen );
+                stream.WriteInt32L( iFromScreen );
+                }
+            /*else
+                {
+                //stream.WriteInt32L( iFocusWg );
+                //stream.WriteInt32L( iFocusWg );
+//              }*/
+            stream.WriteInt32L( iFlags ); 
+            stream.WriteInt32L( iEffectRect.iTl.iX );
+            stream.WriteInt32L( iEffectRect.iTl.iY );
+            stream.WriteInt32L( iEffectRect.iBr.iX );
+            stream.WriteInt32L( iEffectRect.iBr.iY );
+            stream << resourceDir;
+            stream << fileName;    
+            stream.CommitL();    
+            });    
+                
+        bridgerData.Set( EAlfEffectFx, iAction, bufferSize, (TAny*) index );
+        __ALFFXLOGSTRING(" <- CAlfServerDrawer::sending bridgedata");
+        iWindowManager->PostIt( bridgerData );
+        stream.Close();
+        iTransitionEndObserver->StartObserving( TCallBack( TransitionFinished, this ), iCurrHandle  );
+        }
+
+    iFullScreenFinished = EFalse;
+    if ( iAction == AknTransEffect::EApplicationExit /*||
+        iAction == 1001*/  ) 
+        {
+		// no more events expected
+        iFinishFullScreen->Start( KAlfShortEffectTimeout, TCallBack( FinishFullScreenTimeout, this ) );
+        }
+    else
+        {
+        iFinishFullScreen->Start( KAlfLongEffectTimeout, TCallBack( FinishFullScreenTimeout, this ) );
+        }
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+TInt CAlfServerDrawer::SendAbortFullscreen()
+    {
+    __ALFFXLOGSTRING(" <- CAlfServerDrawer::SendAbortFullscreen");
+    // The windows may close any time now because we are aborting
+   
+    if (!iFullScreenFxSent)
+        {
+        return KErrNone;
+        }
+
+    iTransitionEndObserver->Cancel();
+    iIdle->Cancel(); //cancel if running.
+
+    iFullScreenFxSent = EFalse;
+    iFullScreenEndSent = ETrue;
+    
+    // Send the data to CAlfAppUI via bridge
+    TAlfBridgerData bridgerData;
+    
+    // We must make a stream of the data as the length may vary.
+    // This function only sends numbers, others send filenames, too.
+    
+    TInt bufferSize = 11 * sizeof(TInt32); // type, 2 wg ids, 2 app uids, flags and rect
+    
+    TInt index = 0;
+    void* bridgeBuffer = NULL;
+    // This function cannot actually leave
+    TRAP_IGNORE( bridgeBuffer = (void*) iWindowManager->Bridge()->AppendEffectsDataL( bufferSize, index ) ); 
+    if ( bridgeBuffer )
+        {
+        RMemWriteStream stream( bridgeBuffer, bufferSize );
+        // The writes should not leave if we have calculated our buffer length correctly.
+        TRAP_IGNORE(
+            {
+            stream.WriteInt32L( MAlfGfxEffectPlugin::EAbortFullscreen );
+            stream.WriteInt32L( iCurrHandle );
+            stream.WriteInt32L( iType );
+          	//if ( iType == AknTransEffect::EParameterType )
+          	    {
+                stream.WriteInt32L( iToWg );
+                stream.WriteInt32L( iFromWg );
+                stream.WriteInt32L( iToUid.iUid );
+                stream.WriteInt32L( iFromUid.iUid );
+                                    
+                stream.WriteInt32L( iToScreen );
+                stream.WriteInt32L( iFromScreen );
+                }
+            /*else
+                {
+                stream.WriteInt32L( iFocusWg );
+                stream.WriteInt32L( iFocusWg );
+                }*/
+            stream.WriteInt32L( iFlags ); 
+            stream.CommitL();    
+            }
+            );
+        bridgerData.Set( EAlfStopEffectFx, iAction, bufferSize, (TAny*) index );
+        __ALFFXLOGSTRING(" <- CAlfServerDrawer::sending bridgedata");
+        iWindowManager->PostIt( bridgerData );
+        stream.Close();
+        }
+        
+    iFullScreenFinished = ETrue;
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//		
+TInt CAlfServerDrawer::SendBeginControlTransition()
+    {
+    __ALFFXLOGSTRING(" <- CAlfServerDrawer::SendBeginControlTransition");
+    TInt cachePriority = 0;
+   	TInt wantedTime = 0;
+	TInt minTime = 0;
+	TPtrC resourceDir;
+	TPtrC fileName;
+	TPtrC actionString;
+	
+	TInt err = KErrNone;
+	err = iPolicyHandler.GetControlKml( iControlUid, iControlAction, resourceDir,
+	    fileName, actionString, cachePriority, wantedTime, minTime );
+	    
+	if ( err != KErrNone )
+	    {
+        return err;
+	    }
+	
+	TBool fileExists = EFalse;
+	TRAP_IGNORE(fileExists = FileExistsL( resourceDir, fileName ));
+	
+	if ( fileName.Length() == 0 || !fileExists)
+	    {
+	    return KErrNotFound;
+	    }
+	    
+	// We must append the action string to the filename to be able to use different actions
+	// for control entry and exit.
+	
+	TParse parse;
+	parse.Set( fileName, NULL, NULL );
+	
+	TFileName actionFile;
+	if ( actionString.Length() > 0 )
+	    {
+    	actionFile.Copy( parse.Name() );
+    	actionFile.Append( _L("_") );
+    	actionFile.Append( actionString );
+    	actionFile.Append( parse.Ext() );
+    	}
+    else
+        {
+    	actionFile.Copy( fileName );
+        }
+        
+    // Send the data to CAlfAppUI via bridge
+    TAlfBridgerData bridgerData;
+    
+    TInt bufferSize = 9 * sizeof(TInt); // operation, action
+    bufferSize += sizeof(TPtrC);
+    bufferSize += resourceDir.Length() * 2;
+    bufferSize += sizeof(TPtrC);
+    bufferSize += fileName.Length() * 2;
+
+    TInt index = 0;
+
+    TInt nodeHandle = KErrNotFound;
+    TInt nodeGroup = KErrNotFound;
+    TInt screenNumber = KErrNotFound;
+      
+    IncreaseHandle();
+    iTransitionEndObserver->Cancel();
+    iFinishFullScreen->Cancel();
+    
+
+    // control transitions are not supposed to have the phasing of full screen transitions,
+    // we should be ready to go immediately.
+    
+    // However, if we are doing control exit, we should reserve the window in order
+    // to keep it on screen while the effect lasts.
+ 
+    void* bridgeBuffer = NULL;
+    // This function cannot actually leave
+    TRAP_IGNORE( bridgeBuffer = (void*) iWindowManager->Bridge()->AppendEffectsDataL( bufferSize, index ) ); 
+    if ( bridgeBuffer )
+        {
+        RMemWriteStream stream( bridgeBuffer, bufferSize );
+        // The writes should not leave if we have calculated our buffer length correctly.
+        TRAP_IGNORE(
+            {
+            stream.WriteInt32L( MAlfGfxEffectPlugin::EBeginComponentTransition );
+            stream.WriteInt32L( iCurrHandle );
+            stream.WriteInt32L( iControlHandle ); // window handle
+            stream.WriteInt32L( iControlWindowGroup ); // window group id
+            stream.WriteInt32L( 0 ); // "screen number"; not used; save place for future
+            // should send starting and ending points and possible other position/rectange
+            // data, too.
+            // Also, should send the action string if the effect parser can handle it
+            stream << resourceDir;
+            stream << actionFile;    
+            stream.CommitL();
+            });
+        bridgerData.Set( EAlfControlEffectFx, iControlAction, bufferSize, (TAny*) index );
+        __ALFFXLOGSTRING(" <- CAlfServerDrawer::sending bridgedata");
+        iWindowManager->PostIt( bridgerData );
+        stream.Close();
+        iTransitionEndObserver->StartObserving( TCallBack( TransitionFinished, this ), iCurrHandle );
+        }
+	
+    iFullScreenFinished = EFalse;
+    iFinishFullScreen->Start( KAlfLongEffectTimeout, TCallBack( ControlTimeout, this ) );
+	
+    return KErrNone;
+    }
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//		
+TInt CAlfServerDrawer::SendFinishControlTransition()
+    {
+    // We should now delete the effects from any controls that remain active.
+    __ALFFXLOGSTRING(" <- CAlfServerDrawer::SendFinishControlTransition");
+    iTransitionEndObserver->Cancel();
+	iIdle->Cancel(); //cancel if running.
+	iFinishFullScreen->Cancel();
+    
+    // Send the data to CAlfAppUI via bridge
+    TAlfBridgerData bridgerData;
+    
+    // We must make a stream of the data as the length may vary.
+    // This function only sends numbers, others send filenames, too.
+    
+    TInt bufferSize = 9 * sizeof(TInt); // type, 2 wg ids, flags and rect
+    TInt index = 0;
+
+    void* bridgeBuffer = NULL;
+    // This function cannot actually leave
+    TRAP_IGNORE( bridgeBuffer = (void*) iWindowManager->Bridge()->AppendEffectsDataL( bufferSize, index ) ); 
+    if ( bridgeBuffer )
+        {
+        RMemWriteStream stream( bridgeBuffer, bufferSize );
+        // The writes should not leave if we have calculated our buffer length correctly.
+        TRAP_IGNORE(
+            {
+            stream.WriteInt32L( MAlfGfxEffectPlugin::EAbortComponentTransition );
+            stream.WriteInt32L( iCurrHandle );
+            stream.WriteInt32L( 0 );
+            stream.WriteInt32L( 0 );
+            stream.WriteInt32L( 0 );
+            stream.WriteInt32L( 0 ); 
+            stream.CommitL();    
+            });
+        bridgerData.Set( EAlfStopEffectFx, iAction, bufferSize, (TAny*) index );
+        __ALFFXLOGSTRING(" <- CAlfServerDrawer::sending bridgedata");
+        iWindowManager->PostIt( bridgerData );
+        stream.Close();
+        }
+        
+    return KErrNone;
+    }
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//		
+TInt CAlfServerDrawer::SendAbortControlTransition()
+    {
+    __ALFFXLOGSTRING(" <- CAlfServerDrawer::SendAbortControlTransition");
+    iTransitionEndObserver->Cancel();
+    // We should now delete the effects from any controls that remain active.
+    return SendFinishControlTransition();
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//		
+TUid& CAlfServerDrawer::FromUid()
+	{
+	return iFromUid;
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//		
+TUid& CAlfServerDrawer::ToUid()
+	{
+	return iToUid;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//		
+TUint& CAlfServerDrawer::Action()
+	{
+	return iAction;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//		
+TInt& CAlfServerDrawer::Flags()
+	{
+	return iFlags;	
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//		
+void CAlfServerDrawer::IncreaseHandle()
+	{
+	iCurrHandle++;
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//		
+TInt CAlfServerDrawer::CurrentHandle()
+	{
+	return iCurrHandle;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//		
+void CAlfServerDrawer::StartEndChecker()
+	{
+	iController->StartEndChecker();
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//		
+void CAlfServerDrawer::CancelEndChecker()
+	{
+	iController->CancelEndChecker();
+	}
+
+TInt CAlfServerDrawer::FullScreenTimeout( TAny* aServerDrawer )
+    {
+    static_cast<CAlfServerDrawer*>(aServerDrawer)->HandleFullScreenTimeout();
+    return KErrNone;
+    }
+
+void CAlfServerDrawer::HandleFullScreenTimeout()
+    {
+    if ( iFullScreenTimeout->iStatus.Int() != KErrCancel )
+        {
+        iFullScreenTimeout->Cancel();
+        // If we don't get an EndFullScreen in a timely manner, 
+        // we generate an EndFullScreen signal by ourselves
+        EndFullscreen();
+        }
+    }
+
+TInt CAlfServerDrawer::FinishFullScreenTimeout( TAny* aServerDrawer )
+    {
+    static_cast<CAlfServerDrawer*>(aServerDrawer)->HandleFinishFullScreenTimeout();
+    return KErrNone;
+    }
+
+void CAlfServerDrawer::HandleFinishFullScreenTimeout()
+    {
+    iTransitionEndObserver->Cancel();
+    iFullScreenTimeout->Cancel();
+    // if we haven't got a pubsub trigger,
+    // we must finish the transition by calling AlfBridge.
+    // If we gor the pubsub trigger, AlfBridge has done its part,
+    // and all we have to do is release the reserved windows.
+    iController->FullscreenFinished( iCurrHandle );
+    }
+
+TInt CAlfServerDrawer::ControlTimeout( TAny* aServerDrawer )
+    {
+    static_cast<CAlfServerDrawer*>(aServerDrawer)->HandleControlTimeout();
+    return KErrNone;
+    }
+
+void CAlfServerDrawer::HandleControlTimeout()
+    {
+    iTransitionEndObserver->Cancel();
+    iFullScreenFinished = EFalse;
+    iFullScreenTimeout->Cancel();
+    iController->EndControlTransition( iCurrHandle );
+    }
+
+TInt CAlfServerDrawer::TransitionFinished( TAny* aServerDrawer )
+    {
+    static_cast<CAlfServerDrawer*>(aServerDrawer)->HandleTransitionFinished();
+    return KErrNone;
+    }
+
+void CAlfServerDrawer::HandleTransitionFinished()
+    {
+    iFullScreenFinished = ETrue;
+    iIdle->Cancel(); //cancel if running.
+	iFinishFullScreen->Cancel();
+    iFullScreenTimeout->Cancel();
+    iController->FullscreenFinished( iCurrHandle );
+    }
+
+
+// ---------------------------------------------------------------------------
+TBool CAlfServerDrawer::FileExistsL( TPtrC& aResourceDir, TPtrC& aFileName )
+	{
+	HBufC* fullName = HBufC::NewL( aResourceDir.Length() + aFileName.Length() );
+	CleanupStack::PushL( fullName );
+	fullName->Des().Copy( aResourceDir );
+	fullName->Des().Append( aFileName );
+	TBool found = EFalse;
+	if (iFs.Handle() && BaflUtils::FileExists( iFs, *fullName ))
+		{
+        __ALFFXLOGSTRING1("CAlfServerDrawer::FileExists : %S", fullName);
+        found = ETrue;
+		}
+	else
+	    {
+	
+#ifdef __WINS__
+       // Check for valid effect names during loading. DO NOT ENABLE IN BUILDS
+       // __ASSERT_DEBUG(0,USER_INVARIANT());
+#endif
+	    }
+	CleanupStack::PopAndDestroy(fullName);
+	return found;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alfsystemeffects.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,326 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Alf system effects
+*
+*/
+
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <bitdev.h>
+#include <implementationproxy.h>
+
+#include "alftfxplugincommon.hrh"
+#include "alfsystemeffects.h"
+#include "alf/alfsrveffectenv.h"
+#include <alflogger.h>
+
+#include "uiacceltk/HuiDisplay.h"
+#include "uiacceltk/HuiLayout.h"
+#include "uiacceltk/HuiControlGroup.h"
+#include "uiacceltk/HuiControl.h"
+#include "uiacceltk/HuiRoster.h"
+#include "uiacceltk/HuiCommand.h"
+#include "uiacceltk/HuiEnv.h"
+#include "uiacceltk/HuiTransformation.h"
+
+// Constants
+const TInt KAlfDefaultFocusGainedEffectDuration = 500;
+const TInt KAlfDefaultFocusLostEffectDuration = 500;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// -----------------------------------------------------------------------------
+// CAlfSystemEffects::CAlfSystemEffects
+// C++ constuctor.
+// -----------------------------------------------------------------------------
+//
+CAlfSystemEffects::CAlfSystemEffects( ) 
+    
+    {
+    //LOGTEXT(_L("CAlfSystemEffects::CAlfSystemEffects()"));
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAlfSystemEffects::NewExtensionL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+MAlfTransEffectPlugin* CAlfSystemEffects::NewExtensionL()
+    {
+    __ALFFXLOGSTRING("CAlfSystemEffects::NewExtensionL >>");
+    //LOGTEXT(_L("CAlfSystemEffects::NewExtensionL()"));
+    CAlfSystemEffects* self = new(ELeave) CAlfSystemEffects();
+    CleanupStack::PushL( self ); 
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    __ALFFXLOGSTRING("CAlfSystemEffects::NewExtensionL <<");
+    return ( self );
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAlfSystemEffects::ConstructL
+// Symbian 2nd phase constructor.
+// -----------------------------------------------------------------------------
+//
+void CAlfSystemEffects::ConstructL()
+    {
+    //LOGTEXT(_L("CAlfSystemEffects::ConstructL()"));
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAlfSystemEffects::~CAlfSystemEffects
+// C++ destructor.
+// -----------------------------------------------------------------------------
+//
+CAlfSystemEffects::~CAlfSystemEffects()
+    {
+    __ALFFXLOGSTRING("CAlfSystemEffects::~CAlfSystemEffects");
+    //LOGTEXT(_L("CAlfSystemEffects::~CAlfSystemEffects()"));
+    }
+
+
+// -----------------------------------------------------------------------------
+// CAlfSystemEffects::GetSupportedEffects
+// -----------------------------------------------------------------------------
+//
+TInt CAlfSystemEffects::GetSupportedEffects( RArray<TInt>& aSupportedEffectIds )
+	{ 
+	__ALFFXLOGSTRING("CAlfSystemEffects::GetSupportedEffects >>");
+	// Add effect ids which are supported by this plugin
+	aSupportedEffectIds.Append( MAlfTransEffectPlugin::EContextFocusGained ); 
+	aSupportedEffectIds.Append( MAlfTransEffectPlugin::EContextFocusLost ); 
+	aSupportedEffectIds.Append( MAlfTransEffectPlugin::EContextEmbeddedStart ); 
+	aSupportedEffectIds.Append( MAlfTransEffectPlugin::EContextEmbeddedExit ); 
+	__ALFFXLOGSTRING("CAlfSystemEffects::GetSupportedEffects - return KErrnone<<");	
+	return KErrNone; 
+	};
+	
+
+// -----------------------------------------------------------------------------
+// CAlfSystemEffects::StartPhase
+// -----------------------------------------------------------------------------
+//
+TInt CAlfSystemEffects::StartPhase( TInt aPhaseId, TInt aEffectId, 
+    CAlfSrvEffectEnv& aEffectEnv, const TDesC8* aParams ) 
+	{ 
+	__ALFFXLOGSTRING("CAlfSystemEffects::StartPhase >>");
+	TRAP_IGNORE( DoStartPhaseL( aPhaseId, aEffectId, aEffectEnv, aParams ));
+	__ALFFXLOGSTRING("CAlfSystemEffects::StartPhase - return KErrNone <<");
+	return KErrNone;
+	}
+	
+	
+// -----------------------------------------------------------------------------
+// CAlfSystemEffects::DoStartPhaseL
+// -----------------------------------------------------------------------------
+//
+TInt CAlfSystemEffects::DoStartPhaseL( TInt /*aPhaseId*/, TInt aEffectId, 
+    CAlfSrvEffectEnv& aEffectEnv, const TDesC8* /*aParams*/ ) 
+	{ 
+	__ALFFXLOGSTRING1("CAlfSystemEffects::DoStartPhaseL - aEffectId: %d ", aEffectId );
+	
+	// Start effect here!
+    switch (aEffectId)
+        {
+        case MAlfTransEffectPlugin::EContextFocusGained:
+            {
+            ShowVisibleGroupsAndMakeNonTransparentL( aEffectEnv );                           				
+            break;
+            }
+            
+        case MAlfTransEffectPlugin::EContextFocusLost:
+            {
+            HideGroupsAndMakeTransparentL( aEffectEnv );          
+            break;
+            }
+            
+        case MAlfTransEffectPlugin::EContextEmbeddedStart:
+            {
+            // do a normal show
+            ShowVisibleGroupsAndMakeNonTransparentL( aEffectEnv );
+            
+            // in addition, do a expand effect for the visible groups
+            TInt controlGroupCount = aEffectEnv.VisibleControlGroupCountL();
+            for ( TInt g = 0 ; g < controlGroupCount ; g++ )
+                {
+                CHuiControlGroup* group = aEffectEnv.VisibleControlGroupL(g);
+		        if (group)
+                    {
+                    // Perhaps we should show controlgroup in other displays too...?
+                    CHuiDisplay* defaultDisplay = aEffectEnv.DisplayL(0);                
+                    if (defaultDisplay)
+                        {
+                        CHuiLayout* hostContainer = group->Control(0).ContainerLayout( NULL );          
+                       
+                        // Cancel the previous 'disable transformation' commands.
+                        aEffectEnv.SharedEnv()->CancelCommands( hostContainer, EHuiOpDisableTransformation );
+                       
+                        hostContainer->EnableTransformationL(); 
+                        CHuiTransformation& xf = hostContainer->Transformation(); 
+                        
+                        THuiTimedValue scale(0);
+                        scale.Set(1, KAlfDefaultFocusGainedEffectDuration);
+
+                        // Clear previously created transformation steps.
+                        xf.LoadIdentity();
+
+                        xf.Scale(scale,scale);
+                        
+                        // Disable transformations after effect
+                        THuiVisualCommand disableTransformationCommand( *hostContainer, EHuiOpDisableTransformation );
+                        aEffectEnv.SharedEnv()->Send( disableTransformationCommand, KAlfDefaultFocusGainedEffectDuration );
+                        }
+                    }
+                }            
+            break;
+            }
+        case MAlfTransEffectPlugin::EContextEmbeddedExit:
+            {
+            // do normal hide
+            HideGroupsAndMakeTransparentL( aEffectEnv );
+            
+            // in addition, do a shrink effect for the visible groups
+            TInt controlGroupCount = aEffectEnv.VisibleControlGroupCountL();
+            for ( TInt g = 0 ; g < controlGroupCount ; g++ )
+                {
+                CHuiControlGroup* group = aEffectEnv.VisibleControlGroupL(g);
+		        if (group)
+                    {
+                    // Perhaps we should show controlgroup in other displays too...?
+                    CHuiDisplay* defaultDisplay = aEffectEnv.DisplayL(0);                
+                    if (defaultDisplay)
+                        {
+                        // Do a little pop out effect
+                        CHuiLayout* hostContainer = group->Control(0).ContainerLayout( NULL );
+                               
+                        // Cancel the previous 'disable transformation' commands.
+                        aEffectEnv.SharedEnv()->CancelCommands( hostContainer, EHuiOpDisableTransformation );                
+
+                        hostContainer->EnableTransformationL(); 
+                        CHuiTransformation& xf = hostContainer->Transformation(); 
+                        
+                        THuiTimedValue scale(1);
+                        scale.Set(0, KAlfDefaultFocusLostEffectDuration);
+
+                        // Clear previously created transformation steps.
+                        xf.LoadIdentity();
+
+                        xf.Scale(scale,scale);
+                        
+                        // Disable transformations after effect
+                        THuiVisualCommand disableTransformationCommand( *hostContainer, EHuiOpDisableTransformation );
+                        aEffectEnv.SharedEnv()->Send( disableTransformationCommand, KAlfDefaultFocusLostEffectDuration );
+                        }
+                    }
+                }            
+            break;
+            }
+       default:
+            {
+            
+            break;
+            }        
+        }
+	__ALFFXLOGSTRING("CAlfSystemEffects::DoStartPhaseL - return KErrNone <<");
+	return KErrNone; 
+	};
+    
+void CAlfSystemEffects::ShowVisibleGroupsAndMakeNonTransparentL(CAlfSrvEffectEnv& aEffectEnv)
+    {
+    __ALFFXLOGSTRING("CAlfSystemEffects::ShowVisibleGroupsAndMakeNonTransparentL >>");
+    // Set opacity of every control group to 1, even if it is not shown because
+    // application may want to show it later and it cannot control the
+    // opacity.
+    TInt controlGroupCount = aEffectEnv.ControlGroupCountL();
+    for ( TInt g = 0 ; g < controlGroupCount ; g++ )
+        {
+        CHuiControlGroup* group = aEffectEnv.ControlGroupL(g);
+        if (group)
+            {
+            // Perhaps we should show controlgroup in other displays too...?
+            CHuiDisplay* defaultDisplay = aEffectEnv.DisplayL(0);                
+            if (defaultDisplay)
+                {
+                // Set the root visual opacity to 1 which affects all the visuals in the group
+                CHuiLayout* hostContainer = group->Control(0).ContainerLayout( NULL );                                                
+                hostContainer->iOpacity.Set(1.f, KAlfDefaultFocusGainedEffectDuration);                                                
+                
+                // Disable also previous transformations.
+                hostContainer->EnableTransformationL(EFalse); 
+                }
+            }
+        }   
+        
+    // Check how many control groups are shown (set visible by the application)
+    
+    // todo: the visible control group should be shown in the same order as they were
+    // set into the roster originally.
+    TInt visibleControlGroupCount = aEffectEnv.VisibleControlGroupCountL();
+    for ( TInt g = 0 ; g < visibleControlGroupCount ; g++ )
+        {
+        CHuiControlGroup* group = aEffectEnv.VisibleControlGroupL(g);
+        if (group)
+            {
+            CHuiDisplay* defaultDisplay = aEffectEnv.DisplayL(0);                
+            if (defaultDisplay)
+                {
+                // Cancel the previous hide commands.
+                aEffectEnv.SharedEnv()->CancelCommands( group, EHuiOpHide );
+                
+                // Show control group ! 
+                defaultDisplay->Roster().ShowL(*group);                    
+                group->SetAcceptInput(EFalse);
+                }
+            }
+        }  
+    __ALFFXLOGSTRING("CAlfSystemEffects::ShowVisibleGroupsAndMakeNonTransparentL <<");
+    }
+    
+void CAlfSystemEffects::HideGroupsAndMakeTransparentL(CAlfSrvEffectEnv& aEffectEnv)
+    {
+    __ALFFXLOGSTRING("CAlfSystemEffects::HideGroupsAndMakeTransparentL >>");
+    TInt controlGroupCount = aEffectEnv.ControlGroupCountL();
+    for ( TInt g = 0 ; g < controlGroupCount ; g++ )
+        {
+        CHuiControlGroup* group = aEffectEnv.ControlGroupL(g);
+        if (group)
+            {
+            // Perhaps we should show controlgroup in other displays too...?
+            CHuiDisplay* defaultDisplay = aEffectEnv.DisplayL(0);                
+            if (defaultDisplay)
+                {
+                // Set the root visual opacity to 0 which affects all the visuals in the group
+                CHuiLayout* hostContainer = group->Control(0).ContainerLayout( NULL );
+                hostContainer->iOpacity.Set(0.f, KAlfDefaultFocusGainedEffectDuration);   
+                                                             
+				if (defaultDisplay->DisplayType() != CHuiDisplay::EDisplayOffScreenBuffer)
+					{
+					// Hide the group so that it does not use resources when we dont have focus
+                    THuiGroupCommand command( *group, EHuiOpHide, defaultDisplay );
+                    aEffectEnv.SharedEnv()->Send(command, KAlfDefaultFocusLostEffectDuration);
+					}
+                }
+            }
+        } 
+    __ALFFXLOGSTRING("CAlfSystemEffects::HideGroupsAndMakeTransparentL <<");
+    }
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/alftfxplugincommon.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ECom table handling for all plugins in this dll.
+*
+*/
+
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <bitdev.h>
+#include <implementationproxy.h>
+#include <alf/AlfTransEffectPlugin.h>
+
+#include "alftfxplugincommon.hrh"
+#include "alfsystemeffects.h"
+#include "alfgfxeffects.h"
+
+
+// ============================ ECOM FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// ImplementationTable
+// Defines the plug-in implementation table for ECom.
+// -----------------------------------------------------------------------------
+//
+const TImplementationProxy ImplementationTable[] = 
+    {
+	IMPLEMENTATION_PROXY_ENTRY( KAlfGfxImplUidValue, CAlfGfxEffects::NewFxPluginL ),
+	IMPLEMENTATION_PROXY_ENTRY( KAlfTfxSystemEffectsImpUidValue, CAlfSystemEffects::NewExtensionL )
+    };
+
+
+// -----------------------------------------------------------------------------
+// ImplementationGroupProxy
+// Returns the plug-in implementation table to ECom.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy ( TInt& aTableCount )
+	{
+	aTableCount = sizeof (ImplementationTable) / sizeof (TImplementationProxy);
+	return ImplementationTable;
+	}
+
+//  End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/debuglogger.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,178 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Utility for debug prints to file
+*
+*/
+
+
+
+//File only compiled with one of these debug flags enabled.
+#if defined(TFXSERVER_TIME_LOG) || defined(WSSERVERDRAWER_TIME_LOG)
+
+#include "debuglogger.h"
+#include <e32debug.h>
+
+// ======== MEMBER FUNCTIONS ========
+
+//---------------------------------------------------------------------
+//
+//---------------------------------------------------------------------
+CDebugLogger::CDebugLogger()
+	{
+	}
+	
+CDebugLogger::~CDebugLogger() 
+	{
+	iEntries.ResetAndDestroy();
+	}
+
+//---------------------------------------------------------------------
+// 
+//---------------------------------------------------------------------	  
+void CDebugLogger::Log(const TDesC16& aMsg) 
+	{
+	CLogEntry *entry = new CLogEntry(aMsg,0);
+	if(entry)
+		{
+		if(KErrNone != iEntries.Append(entry))
+			{
+			delete entry;
+			}
+		}
+	}
+
+//---------------------------------------------------------------------
+//
+//---------------------------------------------------------------------	  
+void CDebugLogger::Log1(const TDesC16& aMsg, TInt aArg1) 
+	{
+	CLogEntry *entry = new CLogEntry(aMsg, 1, aArg1);
+	if(entry)
+		{
+		if(KErrNone != iEntries.Append(entry))
+			{
+			delete entry;
+			}
+		}
+	}
+
+//---------------------------------------------------------------------
+//
+//---------------------------------------------------------------------	  
+void CDebugLogger::Log2(const TDesC16& aMsg, TInt aArg1, TInt aArg2) 
+	{
+	CLogEntry *entry = new CLogEntry(aMsg, 2, aArg1, aArg2);
+	if(entry)
+		{
+		if(KErrNone != iEntries.Append(entry))
+			{
+			delete entry;
+			}
+		}
+	}
+
+//---------------------------------------------------------------------
+//
+//---------------------------------------------------------------------	  
+void CDebugLogger::Log3(const TDesC16& aMsg, TInt aArg1, TInt aArg2, TInt aArg3) 
+	{
+	CLogEntry *entry = new CLogEntry(aMsg, 3, aArg1, aArg2, aArg3);
+	if(entry)
+		{
+		iEntries.Append(entry);
+		}
+	}
+
+//---------------------------------------------------------------------
+//
+//---------------------------------------------------------------------	  
+void CDebugLogger::Log4(const TDesC16& aMsg, TInt aArg1, TInt aArg2, TInt aArg3, TInt aArg4) 
+	{
+	CLogEntry *entry = new CLogEntry(aMsg, 4, aArg1, aArg2, aArg3, aArg4);
+	if(entry)
+		{
+		iEntries.Append(entry);
+		}
+	}
+
+//---------------------------------------------------------------------
+//
+//---------------------------------------------------------------------	  
+void CDebugLogger::WriteToFile(const TDesC& aLogDir, const TDesC& aLogFile) 
+	{
+	const TInt count = iEntries.Count();
+	/*lint -e1032 -e1023 */
+	/* 	this is to prevent lint errors that says that writeformat is ambigious and cant be used
+		without an object, writeformat is not ambigious - it has one static and one non-static version */
+	for(TInt i = 0; i < count; i++)
+		{
+		switch(iEntries[i]->iNbrArgs)
+			{
+			case 0:
+				RFileLogger::Write(aLogDir,aLogFile,EFileLoggingModeAppend,*(iEntries[i]->iMsg));
+				break;
+			case 1:
+				RFileLogger::WriteFormat(aLogDir,aLogFile,EFileLoggingModeAppend,*(iEntries[i]->iMsg),iEntries[i]->iArg1);
+				break;
+			case 2:
+				RFileLogger::WriteFormat(aLogDir,aLogFile,EFileLoggingModeAppend,*(iEntries[i]->iMsg),iEntries[i]->iArg1,iEntries[i]->iArg2);
+				break;
+			case 3:
+				RFileLogger::WriteFormat(aLogDir,aLogFile,EFileLoggingModeAppend,*(iEntries[i]->iMsg),iEntries[i]->iArg1,iEntries[i]->iArg2,iEntries[i]->iArg3);
+				break;
+			case 4:
+				RFileLogger::WriteFormat(aLogDir,aLogFile,EFileLoggingModeAppend,*(iEntries[i]->iMsg),iEntries[i]->iArg1,iEntries[i]->iArg2,iEntries[i]->iArg3,iEntries[i]->iArg4);
+				break;
+			default:
+				break;
+			}
+		}
+	/*lint +e1032 +e1023 */
+	iEntries.ResetAndDestroy();
+	}
+
+//---------------------------------------------------------------------
+//
+//---------------------------------------------------------------------
+TUint32 CDebugLogger::TimeMs()
+	{
+	TTime now;
+	now.UniversalTime();
+	return (TUint32)(now.Int64()/1000);
+	}
+
+//---------------------------------------------------------------------
+//
+//---------------------------------------------------------------------	
+CLogEntry::CLogEntry(const TDesC16& aMsg, TInt aNbrArg, TInt aArg1, TInt aArg2, TInt aArg3, TInt aArg4) :  iNbrArgs(aNbrArg), 
+					iArg1(aArg1), iArg2(aArg2), iArg3(aArg3), iArg4(aArg4) 
+	{
+	iMsg = HBufC16::New(aMsg.Length());
+	if(iMsg)
+	    {
+    	(*iMsg) = aMsg;
+	    }
+	}	  
+
+//---------------------------------------------------------------------
+//
+//---------------------------------------------------------------------		
+CLogEntry::~CLogEntry()
+	{
+	delete iMsg;
+	}
+
+
+#endif // TFXSERVER_TIME_LOG
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/repositoryhandler.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   Transition server repository handler.
+*
+*/
+
+
+#include "repositoryhandler.h"
+#include <alflogger.h>
+#include <centralrepository.h>
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CRepositoryHandler::CRepositoryHandler(TInt aPriority, const TUid& aRepository, TInt aKey) :
+    CActive(aPriority),
+    iRepository(aRepository),
+    iKey(aKey)
+    {
+    }
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CRepositoryHandler::ConstructL()
+    {
+    iCrep = CRepository::NewL(iRepository);
+    __ALFFXLOGSTRING("CRepositoryHandler: Starting");
+    CActiveScheduler::Add(this);
+    RunL();
+    }
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CRepositoryHandler* CRepositoryHandler::NewL(TInt aPriority, const TUid& aRepository, TUint32 aKey)
+    {
+    CRepositoryHandler* self = new (ELeave) CRepositoryHandler(aPriority, aRepository, aKey);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CRepositoryHandler::~CRepositoryHandler()
+    {
+    Cancel();
+    delete iCrep;
+    }
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CRepositoryHandler::RunL()
+    {
+    iError = iCrep->NotifyRequest(iKey, iStatus);
+    TInt value;
+    TInt err = iCrep->Get(iKey, value);
+    if( err == KErrNone )
+    	{
+    	iValue = value;
+    	}
+    
+    if(iError == KErrNone)
+    	{
+    	SetActive();
+    	iError = err;
+    	}
+    }
+    
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CRepositoryHandler::GetValue(TInt& aValue)
+	{
+	if(iError != KErrNone) //if we had an error eariler
+		{
+		TInt value;
+		iError = iCrep->Get(iKey, value); //try to get the value
+		if(iError == KErrNone)
+			{
+			iValue = value;
+			if (!IsActive())
+			    {
+    			iError = iCrep->NotifyRequest(iKey, iStatus); //try to start request
+    			if(iError == KErrNone)
+    				{
+    				SetActive();
+    				}
+			    }
+			}
+		}
+	aValue = iValue;
+	return iError;
+	}
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CRepositoryHandler::DoCancel()
+    {
+    __ALFFXLOGSTRING("CRepositoryHandler: Canceled");
+    iCrep->NotifyCancel(iKey);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/statehandler.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,274 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   State machine interface. Used for the statemachine in the 
+*                server drawer to keep track on when a transition should be made
+*                and when not.
+*
+*/
+
+
+#include "statehandler.h"
+#include "states.h"
+#include "uidblock.h"
+#include "uidexception.h"
+#include <alflogger.h>
+
+// ---------------------------------------------------------------------------
+// This LUT defines what fullscreen transitions is of wich type.
+// It is needed by the filter, but is part of platform requirements,
+// so it feels logical to keep it here.
+// ---------------------------------------------------------------------------
+//
+#include  <akntranseffect.h> 
+const CStateHandler::TFullscreenType FullscreenTypeLUT[] = 
+	{
+	CStateHandler::ENone,  						//none
+	CStateHandler::EActivation, //activation
+	CStateHandler::EError,   	//removed action
+	CStateHandler::EStart, 		//start
+	CStateHandler::EStart, 		//start embedded
+	CStateHandler::EExit, 		//exit
+	CStateHandler::EStart, 		//start rect
+	CStateHandler::EStart, 		//start switch
+	CStateHandler::EStart, 		//start switch rect
+	CStateHandler::EExit, 		//exit for end key
+	CStateHandler::EExit,		//exit embedded
+	CStateHandler::EError,      //right?
+	CStateHandler::ELayoutSwitch, //ELayoutSwitch
+	CStateHandler::ELayoutSwitch, //ELayoutSwitch
+	CStateHandler::ELayoutSwitch, //ELayoutSwitch
+	};
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CStateBase::CStateBase(MAlfDrawerEngine& aEngine, CStateHandler& aHandler) :
+	iEngine(aEngine),
+	iHandler(aHandler)
+	{
+	}
+
+CStateBase::~CStateBase()
+	{
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TBool CStateBase::IsBlocked(const TUid& aFromUid, const TUid& aToUid)
+	{
+	return iHandler.IsBlocked(aFromUid, aToUid);
+	}
+	
+
+
+// ---------------------------------------------------------------------------
+// StateHandler Implementation:
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CStateHandler::Signal(CStateBase::TSignal aSignal)
+	{
+	CStateBase* newstate = NULL;
+	TRAPD(err, newstate = iState->SignalL(aSignal));
+	if((KErrNone == err) && (NULL != newstate))
+		{
+		delete iState;
+		iState = newstate;
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TBool CStateHandler::IsBlocked(const TUid& aFromUid, const TUid& aToUid)
+	{
+	__ALFFXLOGSTRING2("CStateHandler::IsBlocked - aFromUid: 0x%x, aToUid: 0x%x", aFromUid, aToUid );
+	TInt flags = iEngine.Flags();
+	if(flags & AknTransEffect::TParameter::EActivateExplicitContinue)
+		{
+//		return EFalse;
+		}
+		
+    for(TInt i = iExceptionList.Count() - 1; i >= 0; i--) 
+    	{
+    	if(iExceptionList[i]->IsAllowed(aFromUid,aToUid)) 
+    		{
+    		__ALFFXLOGSTRING("CStateHandler::IsBlocked - return EFalse <<");
+    	    return EFalse;
+    		}
+    	}
+		
+	for(TInt i = iBlockList.Count() - 1; i >= 0; i--) 
+		{
+		if(iBlockList[i]->IsBlocked(aFromUid,aToUid)) 
+			{
+			__ALFFXLOGSTRING("CStateHandler::IsBlocked - return ETrue <<");
+			return ETrue;
+			}
+		}
+	__ALFFXLOGSTRING("CStateHandler::IsBlocked - return EFalse <<");
+	return EFalse;
+	}
+
+// ---------------------------------------------------------------------------
+// OOM condition means block will not be added, this is ok.
+// ---------------------------------------------------------------------------
+//
+void CStateHandler::AddBlockUid(const TUid& aUid)
+	{
+	CFullUidBlock* uidblock = new CFullUidBlock(aUid);
+	if(uidblock)
+		{
+		if(KErrNone != iBlockList.Append(uidblock)) 
+			{
+			//Failed to add, forget about it.
+			delete uidblock;
+			}
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// OOM condition means block will not be added, this is ok.
+// ---------------------------------------------------------------------------
+//
+void CStateHandler::AddBlockUidPair(const TUid& aFromUid, const TUid& aToUid)
+	{
+	CPairedUidBlock* uidblock = new CPairedUidBlock(aFromUid, aToUid);
+	if(uidblock)
+		{
+		if(KErrNone != iBlockList.Append(uidblock))
+			{
+			//Failed to add, forget about it.
+			delete uidblock;
+			}
+		}
+	}
+	
+// ---------------------------------------------------------------------------
+// OOM condition means exception will not be added, this is ok.
+// ---------------------------------------------------------------------------
+//
+void CStateHandler::AddExceptionUid(const TUid& aUid)
+	{
+	CFullUidException* uidexception = new CFullUidException(aUid);
+	if(uidexception)
+		{
+		if(KErrNone != iExceptionList.Append(uidexception)) 
+			{
+			//Failed to add, forget about it.
+			delete uidexception;
+			}
+		}
+	}	
+	
+// ---------------------------------------------------------------------------
+// OOM condition means exception will not be added, this is ok.
+// ---------------------------------------------------------------------------
+//	
+void CStateHandler::AddExceptionUidPair(const TUid& aFromUid, const TUid& aToUid)
+    {
+	CPairedUidException* uidexception = new CPairedUidException(aFromUid, aToUid);
+	if(uidexception)
+		{
+		if(KErrNone != iExceptionList.Append(uidexception))
+			{
+			//Failed to add, forget about it.
+			delete uidexception;
+			}
+		}    
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CStateHandler::RemoveBlockUid(const TUid& aUid)
+	{
+	for(TInt i = iBlockList.Count() - 1; i >= 0; i--) 
+		{
+		if(iBlockList[i]->IsBlocked(aUid,aUid)) 
+			{
+			delete iBlockList[i];
+			iBlockList.Remove(i);
+			}
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CStateHandler::TFullscreenType CStateHandler::GetFullscreenType(TUint aAction)
+	{
+	TFullscreenType type = EError;
+	if(aAction < (sizeof(FullscreenTypeLUT) / sizeof(TInt)))
+		{
+		type = FullscreenTypeLUT[aAction];
+		}
+	if(aAction >= AknTransEffect::EAppSpesificEvent)
+		type = EAppSpecific;
+	return type;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CStateHandler::TFullscreenType CStateHandler::GetCurrentFullscreenType()
+	{
+	return GetFullscreenType(iState->StateInfo().iAction);
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CStateHandler* CStateHandler::NewL(MAlfDrawerEngine* aEngine)
+	{
+	CStateHandler* self = new (ELeave) CStateHandler(aEngine);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CStateBase::TState CStateHandler::GetState()
+	{
+	return iState->StateInfo().iState;
+	}
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CStateHandler::CStateHandler(MAlfDrawerEngine* aEngine) :
+	iEngine(*aEngine)
+	{
+	}
+
+void CStateHandler::ConstructL()
+	{
+	iState = CRestingState::NewL(iEngine,*this);
+	}
+
+CStateHandler::~CStateHandler()
+	{
+	iBlockList.ResetAndDestroy();
+	iExceptionList.ResetAndDestroy();
+	delete iState;
+	}
+	
+	
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/states.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,248 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   State machine state implementations
+*
+*/
+
+
+
+#include  <akntranseffect.h> // for Transition effect enumerations
+#include <alflogger.h>
+#include "states.h"
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// CRestingState construction
+// ---------------------------------------------------------------------------
+//
+CRestingState::CRestingState(MAlfDrawerEngine& aEngine, CStateHandler& aHandler) : 
+	CStateBase(aEngine,aHandler)
+		{
+		}
+
+CStateBase* CRestingState::NewL(MAlfDrawerEngine& aEngine, CStateHandler& aHandler)
+	{
+	CRestingState* self = new (ELeave) CRestingState(aEngine,aHandler);
+	self->iStateInfo.iState = EResting;
+	return self;	
+	}
+	
+// ---------------------------------------------------------------------------
+// CRestingState Signal handling
+// ---------------------------------------------------------------------------
+//
+CStateBase* CRestingState::SignalL(TSignal aSignal)
+	{
+	__ALFFXLOGSTRING1("CRestingState::SignalL %d >>", aSignal);
+	TInt error = KErrNone;
+	switch( aSignal ) 
+		{
+		case EBeginFullscreen:
+            if( !IsBlocked( iEngine.FromUid(), iEngine.ToUid() ) ) 
+		        {
+    			iEngine.SendBeginFullscreen();
+			    return CPhase1State::NewL( iEngine,iHandler );
+			    }
+		    return NULL;
+
+		case EBeginComponent:
+		    error = iEngine.SendBeginControlTransition();
+		    if ( error == KErrNone )
+		        {
+         		return CControlState::NewL( iEngine, iHandler );
+		        }
+		    return NULL;    
+
+		case EEndFullscreen:
+//		    iEngine.SendEndFullscreen(); // TODO: revise?
+//		    return CRestingState::NewL( iEngine, iHandler );
+
+		case EAbortFullscreen:
+			iEngine.SendAbortFullscreen();
+			return CRestingState::NewL( iEngine, iHandler );
+		}
+	return NULL;
+	}
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// CControlState construction
+// ---------------------------------------------------------------------------
+//
+CControlState::CControlState(MAlfDrawerEngine& aEngine, CStateHandler& aHandler) : 
+	CStateBase(aEngine,aHandler)
+		{
+		}
+
+CStateBase* CControlState::NewL(MAlfDrawerEngine& aEngine, CStateHandler& aHandler)
+	{
+	CControlState* self = new (ELeave) CControlState(aEngine,aHandler);
+	self->iStateInfo.iState = EComponent;
+	return self;	
+	}
+	
+// ---------------------------------------------------------------------------
+// CControlState signal handling
+// ---------------------------------------------------------------------------
+//
+CStateBase* CControlState::SignalL(TSignal aSignal)
+	{
+    __ALFFXLOGSTRING1("CControlState::SignalL %d >>", aSignal);
+
+    TInt error = KErrNone;	
+	switch( aSignal )
+		{
+		case EAbort:
+		case EAbortComponent:
+			iEngine.SendAbortControlTransition();
+			return CRestingState::NewL( iEngine, iHandler );
+		case EFinishComponent:
+		    // do something to finish
+		    iEngine.SendFinishControlTransition();
+			return CRestingState::NewL( iEngine, iHandler );
+		case EBeginFullscreen:
+			if( !IsBlocked( iEngine.FromUid(), iEngine.ToUid() ) )
+				{
+				iEngine.SendBeginFullscreen();
+				return CPhase1State::NewL( iEngine,iHandler );
+				}
+			return NULL;
+		case EBeginComponent:
+		    // we don't limit control transitions
+		    // we don't have an ending signal for the controls now
+		    // We may need something to be able to call
+		    // SendFinishControlTransition
+		    error = iEngine.SendBeginControlTransition();
+		    if ( error == KErrNone )
+		        {
+         		return CControlState::NewL( iEngine, iHandler );
+		        }
+		    return NULL;    
+		}
+	return NULL;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// CPhase1State construction
+// ---------------------------------------------------------------------------
+//
+CPhase1State::CPhase1State(MAlfDrawerEngine& aEngine, CStateHandler& aHandler) : 
+	CStateBase(aEngine,aHandler)
+		{
+		}
+
+CStateBase* CPhase1State::NewL(MAlfDrawerEngine& aEngine, CStateHandler& aHandler)
+	{
+	CPhase1State* self = new (ELeave) CPhase1State(aEngine,aHandler);
+	self->iStateInfo.iState = EFullscreenPhase1;
+	self->iStateInfo.iAction = aEngine.Action();
+	return self;	
+	}
+
+// ---------------------------------------------------------------------------
+// CPhase1State Signal handling
+// ---------------------------------------------------------------------------
+//
+CStateBase* CPhase1State::SignalL(TSignal aSignal)
+	{
+    TInt error = KErrNone;	
+	switch(aSignal)
+		{
+		case EAbort:
+		case EAbortFullscreen:
+   			iEngine.SendAbortFullscreen();
+			return CRestingState::NewL(iEngine,iHandler);
+        case EFinishFullscreen:
+		    if ( !iEngine.EffectFinishedFullScreen() )
+		        {
+    			iEngine.SendAbortFullscreen();
+		        }
+            return CRestingState::NewL(iEngine,iHandler);
+		case EEndFullscreen:
+			iEngine.SendEndFullscreen();
+			return CPhase2State::NewL(iEngine,iHandler);
+		case EBeginFullscreen:
+			if(!IsBlocked(iEngine.FromUid(),iEngine.ToUid())) 
+				{
+    		    iEngine.SendBeginFullscreen();
+				}
+			return NULL;
+		case EBeginComponent:
+		    error = iEngine.SendBeginControlTransition();
+		    if ( error == KErrNone )
+		        {
+         		return CControlState::NewL( iEngine, iHandler );
+		        }
+		    return NULL;    
+		}
+	return NULL;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+// CPhase2State construction
+// ---------------------------------------------------------------------------
+//
+CPhase2State::CPhase2State(MAlfDrawerEngine& aEngine, CStateHandler& aHandler) : 
+	CStateBase(aEngine,aHandler)
+		{
+		}
+
+CStateBase* CPhase2State::NewL(MAlfDrawerEngine& aEngine, CStateHandler& aHandler)
+	{
+	CPhase2State* self = new (ELeave) CPhase2State(aEngine,aHandler);
+	self->iStateInfo.iState = EFullscreenPhase2;
+	self->iStateInfo.iAction = aEngine.Action();
+	return self;	
+	}
+
+// ---------------------------------------------------------------------------
+// CPhase2State Signal handling
+// ---------------------------------------------------------------------------
+//
+CStateBase* CPhase2State::SignalL(TSignal aSignal)
+	{
+    TInt error = KErrNone;	
+	switch(aSignal)
+		{
+		case EAbort:
+		case EAbortFullscreen:
+			iEngine.SendAbortFullscreen();
+			return CRestingState::NewL(iEngine,iHandler);
+		case EFinishFullscreen:
+		    if ( ( iEngine.Action() == 1001 || iEngine.Action() == AknTransEffect::EApplicationExit ) &&
+		        !iEngine.EffectFinishedFullScreen() )
+		        {
+		        iEngine.SendAbortFullscreen();
+		        }
+			return CRestingState::NewL(iEngine,iHandler);
+		case EBeginFullscreen:
+			if(!IsBlocked(iEngine.FromUid(),iEngine.ToUid()))
+				{
+				iEngine.SendBeginFullscreen();
+				return CPhase1State::NewL(iEngine,iHandler);
+				}
+			return NULL;
+		case EBeginComponent:
+		    error = iEngine.SendBeginControlTransition();
+		    if ( error == KErrNone )
+		        {
+         		return CControlState::NewL( iEngine, iHandler );
+		        }
+		    return NULL;    
+		}
+	return NULL;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/tfxalfplugin.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,95 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   implementation of the control drawer handling data for control
+*                transitions.
+*
+*/
+
+
+
+#include "tfxalfplugin.h"
+#include "../../servercore/inc/alfwindow.h"
+#include "../../servercore/inc/alfwindowbuffer.h"
+#include "../../servercore/inc/alfwindowmanager.h"
+
+CAlfWindowFxPlugin* CTfxAlfPlugin::CreateL(TInt aAlfBufferFormat)
+	{
+	return new (ELeave) CTfxAlfPlugin();
+	}
+	
+CTfxAlfPlugin::CTfxAlfPlugin() : iWinId(0,0)
+	{
+	
+	}
+	
+CTfxAlfPlugin::~CTfxAlfPlugin()
+	{
+	
+	}
+	
+void CTfxAlfPlugin::PrepareFrameL(TUint aEstimatedFrameInterval)
+	{
+	TInt a = 1;
+	
+	/*
+	TUint8* ptr = (TUint8*)iAlfBuffer->BufferPtr();
+	TInt stride = iAlfBuffer->Stride();
+	TSize size  = iAlfBuffer->Size();
+	
+	for(TInt y = size.iHeight; y > 0; y--) 
+		{
+		TUint32* scanline = (TUint32*)ptr;
+		for(TInt x = size.iWidth; x > 0; x--)
+			{
+			*(scanline++) = x&(y+iFrames)&0xffff00ff;
+			}
+		ptr += stride;
+		}
+	TRegionFix<1> reg(TRect(TPoint(0,0),size));
+	iAlfWindow->ContentReady(iAlfBuffer,reg);
+	
+	if(0 == --iFrames) 
+		{
+		//WindowManager()->Release(iWinId);
+		WindowManager()->DestroyWindow(*iAlfWindow);
+		}
+	*/	
+	}
+	
+void CTfxAlfPlugin::WindowUpdated(TInt aWindowId, TInt aEventType)
+	{
+	if(aWindowId == iWinId.iWindowIdentifer) 
+		{
+		// ...
+		
+		}
+	}
+	
+/** Synch message from client */    
+void CTfxAlfPlugin::HandleMessageL(const TDesC8& aMessage, TPtr8& aResponse)
+	{
+	}
+
+/** Asynch message from client */    
+void CTfxAlfPlugin::HandleMessageL(const TDesC8& aMessage, const RMessage2& aClientMessage)
+	{
+	
+	}
+
+/** Cancel asynch message(s) from client */    
+void CTfxAlfPlugin::CancelMessage(TInt aMessageId)
+	{
+	
+	}
+	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/uidblock.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   State machine interface. Used for the statemachine in the 
+*                server drawer to keep track on when a transition should be made
+*                and when not.
+*
+*/
+
+
+#include "uidblock.h"
+
+CFullUidBlock::CFullUidBlock(const TUid& aUid) : 
+	iUid(aUid)
+	{
+	}
+	
+TBool CFullUidBlock::IsBlocked(const TUid& aFromUid, const TUid& aToUid)
+	{
+	if(aFromUid == iUid)
+	    {
+		return ETrue;
+	    }
+	if(aToUid == iUid)
+	    {
+		return ETrue;
+	    }
+	return EFalse;
+	}
+
+CPairedUidBlock::CPairedUidBlock(const TUid& aFromUid, const TUid& aToUid) : 
+	iFromUid(aFromUid),
+	iToUid(aToUid)
+	{
+	}
+	
+TBool CPairedUidBlock::IsBlocked(const TUid& aFromUid, const TUid& aToUid)
+	{
+	if((aFromUid == iFromUid) && (aToUid == iToUid))
+		return ETrue;
+	return EFalse;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/uidexception.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   State machine interface. Used for the statemachine in the 
+*                server drawer to keep track on when a transition should be
+*                always allowed.
+*
+*/
+
+
+#include "uidexception.h"
+
+
+CFullUidException::CFullUidException(const TUid& aUid) : 
+	iUid(aUid)
+	{
+	}
+	
+TBool CFullUidException::IsAllowed(const TUid& aFromUid, const TUid& aToUid)
+	{
+	if(aFromUid == iUid)
+		return ETrue;
+	if(aToUid == iUid)
+		return ETrue;
+	return EFalse;
+	}
+
+CPairedUidException::CPairedUidException(const TUid& aFromUid, const TUid& aToUid) : 
+	iFromUid(aFromUid),
+	iToUid(aToUid)
+	{
+	}
+	
+TBool CPairedUidException::IsAllowed(const TUid& aFromUid, const TUid& aToUid)
+	{
+	if((aFromUid == iFromUid) && (aToUid == iToUid))
+		return ETrue;
+	return EFalse;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/src/wsserverdrawercontroller.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1114 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   controls the calls that comes to the wsserverplugin by the use
+*				 of a state machine
+*
+*/
+
+
+
+#include "wsserverdrawercontroller.h"
+#include "alfdrawerengine.h"
+#include <akntranseffect.h> // for Transition effect enumerations
+
+#include <e32property.h>
+#include <UikonInternalPSKeys.h>
+#include <ScreensaverInternalPSKeys.h>
+#include <startupdomainpskeys.h>
+#include <alflogger.h>
+#include <coemain.h>
+
+#include <bautils.h>
+
+//#include <winchangecrp.h>
+#ifdef WSSERVERDRAWER_TIME_LOG
+_LIT(KWsServerDrawerTimeLogFile, "WsServerDrawerTimeLog.txt");
+_LIT(KWsServerDrawerTimeLogDir, "alfgfxtest");
+#endif //WSSERVERDRAWER_TIME_LOG
+
+const TInt KEndCheckTime(500000); //half second
+const TInt KEndTimeOut(10);  // 10 * KEndCheckTime
+
+// We use a huge timeout for tests as it seems we hit the timeout way too often
+//const TInt KEndCheckTime(1000000); //1 second
+//const TInt KEndTimeOut(10);  // 10 * KEndCheckTime
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+/** These apps will never get fullscreen effects to or from them */
+const TUint KNoEffectApps[] = 
+		{
+		0x100059B5,	//	S60 autolock
+		0x10207218, //	akncapserver
+//		0x100058B3, // 	phone app
+		0x10281EF2, //  AknNotifyServer
+//		0x100056CF, //	screensaver
+		0x10210CB5, // 	MIDP, JavaLauncherExe
+		0x1000594D, // IRApp, disables effect when activating IR
+		0x102818E7,	// VCommandManager, start in device startup
+		0x100058F3, // sys app
+		0x102823b5, // SendUiServiceResolver,
+		0x101F8681, // VideoTelUi
+		0x101F875A, // KSWInstSvrUid, prevent fullscreen effect on installing
+		0x101F8543, // Voice Commands, no effects when pressing send key long
+		0x10281855  // touch input server , no effects when the first time start up
+		// startup blocked because startup exit leaves the screen black.
+		// must be debugged
+        , 0x100058F4 // startup blocked for the time being
+        // Application shell is Ok, folder open and close have KAknApplicationShellViewId
+        // as both to and from ids. There is only one visual, so some sort of blur effect works...
+		//, KAknApplicationShellViewId
+		};		
+
+/** Switching between theese app pairs will also never get effects */
+const TUint KNoEffectPairs[][2] =
+    {
+    {0x0, 0x0},
+    };
+
+/** switch to/from these applications will never get any effects and
+    the current ongoing effect will be aborted */
+const TUint KCustomNoEffectApps[] = 
+    {
+	0x0, // DO NOT REMOVE 0x0! this is here for compile reasons, it will not be included in the AllowedCustomUid check
+  //0xUID //Add UIds of applications that shouldn't have effects here
+	};
+
+// DISABLED! uncomment code in ConstructL that references this list to turn it on.
+/** Switching between from or to theese apps should have always effects */
+/*const TUint KExceptionEffectApps[] = 
+	{
+	0x100056CF, //	screensaver
+	};
+*/
+
+/**
+  *  Local funtion that checks if the uid is in the KCustomNoEffectApps list
+*/
+LOCAL_C TBool AllowedCustomUid(const TUid& aUid)
+	{
+	for(TInt i = 1; i < sizeof(KCustomNoEffectApps) / sizeof(KCustomNoEffectApps[0]); i++)
+		{
+		if(aUid.iUid == KCustomNoEffectApps[i])
+			return EFalse;
+		}
+	return ETrue;
+	}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+class CPSListener : public CActive
+    {
+    public:
+        inline TInt Value() const;
+        inline TInt Key() const;
+        CPSListener();
+        void ListenL(const TUid& aUid, TInt aKey);
+        ~CPSListener();
+    private:
+        void DoCancel();
+        void RunL();
+    private:
+        RProperty iProperty;
+        TInt iValue;
+        TInt iKey;
+    };
+ 
+inline TInt CPSListener::Value() const
+    {
+    return iValue;
+    }
+    
+inline TInt CPSListener::Key() const
+    {
+    return iKey;
+    } 
+    
+CPSListener::CPSListener() : CActive(CActive::EPriorityHigh)
+    {
+    CActiveScheduler::Add(this);
+    }
+    
+void CPSListener::ListenL(const TUid& aUid, TInt aKey)
+    {
+    Cancel();
+    iKey = aKey;
+    User::LeaveIfError(iProperty.Attach(aUid, aKey));
+    RunL(); //set initial value
+    }
+    
+   
+CPSListener::~CPSListener()
+    {
+    Cancel();
+    }
+    
+void CPSListener::DoCancel()
+    {
+    iProperty.Cancel();
+    }
+    
+void CPSListener::RunL()    
+    {
+    iProperty.Subscribe(iStatus);
+    iProperty.Get(iValue); //errors are ignored!
+    SetActive();
+    }
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+
+
+
+CEndCheck* CEndCheck::NewL(MEndChecker& aCallBack)
+	{
+	CEndCheck* c = new (ELeave) CEndCheck(aCallBack);
+	CleanupStack::PushL(c);
+	c->ConstructL();
+	CleanupStack::Pop();
+	return c;
+	}
+
+void CEndCheck::Start(/*TInt aState,*/ TInt aMul)
+	{
+	Cancel();
+	iCancelled = EFalse;
+	After(KEndCheckTime * aMul);
+	}
+
+CEndCheck::~CEndCheck()
+	{
+	Cancel();
+	}
+	
+void CEndCheck::DoCancel()
+	{
+	CTimer::DoCancel();
+	iCancelled = ETrue;
+	}
+		
+void CEndCheck::RunL()
+	{
+	if(!iCancelled)
+		{
+		iCallBack.EndExpired();
+		}
+	}
+
+CEndCheck::CEndCheck(MEndChecker& aCallBack) : CTimer(CActive::EPriorityStandard), 
+iCallBack(aCallBack)	
+	{
+	CActiveScheduler::Add(this);
+	}
+	
+//////////////////////////////////////////////////////////////////////////////////////////
+
+	
+LOCAL_C void GetName(RFs& aFs, TDes& aName)
+	{
+	aFs.PrivatePath(aName);
+	aName.Insert(0, _L("D:"));
+	aName.Append(_L("data.bin"));	
+	}
+
+
+void CAppInfoCache::ReadArrayL(RFile& aFile) 
+	{
+	TPckgBuf<TUint> buf;
+	User::LeaveIfError(aFile.Read(buf));
+	const TUint count = buf();
+	for(TUint i = 0; i < count; i++)
+		{
+		User::LeaveIfError(aFile.Read(buf));
+		const TUint value = buf();
+		User::LeaveIfError(aFile.Read(buf));
+		const TUint flags = buf();
+		User::LeaveIfError(aFile.Read(buf));
+		const TUint aToUid = buf();
+		User::LeaveIfError(aFile.Read(buf));
+		const TUint root = buf();
+		if(KErrNone == Append(value)) //dont allow duplicates
+			{
+			const TInt index = IndexOf(value);
+			iAppInfo[index].iFlags = static_cast<TAppInfo::TFlags>(flags);
+			iAppInfo[index].iParent = TUid::Uid(aToUid);
+			iAppInfo[index].iRootWgId = static_cast<TInt>(root);
+			}
+		}
+	}
+	
+void CAppInfoCache::WriteArrayL(RFile& aFile) const
+	{
+	const TUint count = static_cast<TUint>(iAppInfo.Count());
+	User::LeaveIfError(aFile.Write(TPckgC<TUint>(count)));
+	for(TUint i  = 0; i < count; i++)
+		{
+		const TAppInfo& info = iAppInfo[i];
+		User::LeaveIfError(aFile.Write(TPckgC<TUint>(info.iUid)));
+		User::LeaveIfError(aFile.Write(TPckgC<TUint>(info.iFlags)));
+		User::LeaveIfError(aFile.Write(TPckgC<TUint>(info.iParent.iUid)));
+		User::LeaveIfError(aFile.Write(TPckgC<TUint>(info.iRootWgId)));
+		}
+	}
+
+TInt CAppInfoCache::TAppInfo::Order(const TAppInfo& aNodeA, const TAppInfo& aNodeB)
+	{
+	if(aNodeA.iUid < aNodeB.iUid)
+		return 1;
+	if(aNodeA.iUid > aNodeB.iUid)
+		return -1;
+	return 0;
+	}
+	
+TInt CAppInfoCache::Append(TUint aUid)
+	{
+	return iAppInfo.InsertInOrder(TAppInfo(aUid), TLinearOrder<TAppInfo>(TAppInfo::Order));
+	}
+	
+TInt CAppInfoCache::IndexOf(TUint aUid) const
+	{
+	return iAppInfo.FindInOrder(TAppInfo(aUid), TLinearOrder<TAppInfo>(TAppInfo::Order));
+	}
+	
+
+CAppInfoCache* CAppInfoCache::NewL()
+	{
+	CAppInfoCache* f = new (ELeave) CAppInfoCache();
+	CleanupStack::PushL(f);
+	f->ConstructL();
+	CleanupStack::Pop();
+	return f;
+	}
+		
+CAppInfoCache::~CAppInfoCache()
+	{
+	TRAP_IGNORE(ExportL());
+	iLs.Close();
+	iAppInfo.Close();
+	}
+	
+void CAppInfoCache::ConstructL()
+	{	
+	ImportL();
+	User::LeaveIfError(iLs.Connect());	
+	}
+	
+TBool CAppInfoCache::GateFound() const
+	{
+	return ETrue;
+	}
+
+void CAppInfoCache::ExportL()
+	{
+	RFs fs;
+	User::LeaveIfError(fs.Connect());
+	CleanupClosePushL(fs);
+	TFileName name;
+	GetName(fs, name);
+	BaflUtils::EnsurePathExistsL(fs, name);
+	RFile file;
+	User::LeaveIfError(file.Replace(fs, name, EFileWrite));
+	CleanupClosePushL(file);
+	
+	User::LeaveIfError(file.Write(TPckgC<TUint>(iFocusedUid.iUid)));
+	
+	WriteArrayL(file);
+	CleanupStack::PopAndDestroy(2); //file, fs
+	}
+	
+void CAppInfoCache::ImportL()
+	{
+	RFs fs;
+	User::LeaveIfError(fs.Connect());
+	CleanupClosePushL(fs);
+	TFileName name;
+	GetName(fs, name);
+	RFile file;
+	const TInt err = file.Open(fs, name, EFileRead);
+	if(err == KErrNone)
+		{
+		TPckgBuf<TUint> buf;
+		User::LeaveIfError(file.Read(buf));
+		iFocusedUid = TUid::Uid(buf());
+		
+		CleanupClosePushL(file);
+		ReadArrayL(file);
+		CleanupStack::PopAndDestroy(); //file
+		fs.Delete(name); //free up memory after import
+		}
+	CleanupStack::PopAndDestroy(); //fs
+	}
+
+
+TInt CAppInfoCache::SetUid(const TUid& aUid)
+	{
+	if(aUid == KNullUid)
+		return KErrNone;
+	
+	TInt err = Append(aUid.iUid);
+	
+	if( err == KErrAlreadyExists )
+	    {
+	    err = KErrNone;
+	    }
+	
+	return err;
+	}
+
+void  CAppInfoCache::SetAppFlags(const TUid& aUid, TUint aFlag, TBool aSet)
+	{
+	const TInt index = IndexOf(aUid.iUid);
+	if(index >= 0)
+		{
+		if(aSet)
+			iAppInfo[index].iFlags |= aFlag;
+		else
+			iAppInfo[index].iFlags &= ~aFlag;
+		}	
+	}
+	
+ 
+TBool CAppInfoCache::GetAppFlags(const TUid& aUid, TUint aFlag) const
+ 	{
+ 	return TBool(iAppInfo[IndexOf(aUid.iUid)].iFlags & aFlag);
+ 	}
+
+	
+void CAppInfoCache::SetAvkonUid(const TUid& aUid)
+	{	
+  	SetAppFlags(aUid, TAppInfo::EAvkonApp, ETrue);
+	}
+
+void CAppInfoCache::RemoveAvkonUid(const TUid& aUid)
+	{
+	SetAppFlags(aUid, TAppInfo::EAvkonApp, EFalse);
+	}
+
+
+TBool CAppInfoCache::AvkonUid(const TUid& aUid) const
+	{
+	TInt index = IndexOf(aUid.iUid);
+	if (index!=KErrNotFound)
+	    {
+	    return (iAppInfo[index].iFlags & TAppInfo::EAvkonApp);
+	    }
+	else
+	    {
+	    return EFalse;
+	    }
+	}
+	
+	
+void CAppInfoCache::Reset(const TUid& aUid)
+	{
+ 	SetParent(aUid, KNullUid);
+	}
+
+
+void CAppInfoCache::SetParent(const TUid& aUid, const TUid& aParentUid)
+	{
+	iAppInfo[IndexOf(aUid.iUid)].iParent = aParentUid;
+	}
+
+     
+TInt CAppInfoCache::SetAction(const TUid& aUid, TInt aAction)
+    {
+    if (aAction==AknTransEffect::ENone || aUid == KNullUid)
+        {
+        // previous action is more valid than this
+        return aAction;
+        }
+    TInt index = IndexOf(aUid.iUid);
+    
+    if (index == KErrNotFound)
+        {
+        SetUid(aUid);
+        index = IndexOf(aUid.iUid);
+        if(index == KErrNotFound)
+            {
+            __ALFFXLOGSTRING1("CAppInfoCache::SetAction - Could not add Uid 0x%x to AppInfoCache!", aUid.iUid);
+            return aAction;
+			}
+        }
+        switch(iAppInfo[index].iAction)
+            {
+            case AknTransEffect::EAppStartupBackground:
+                if (aAction == AknTransEffect::EApplicationExit)
+                    {
+                    aAction = AknTransEffect::EEmbeddedApplicationExit; 
+                    }
+                break;
+  
+            case AknTransEffect::EApplicationStartRect:
+            case AknTransEffect::EApplicationStartSwitch:
+            case AknTransEffect::EApplicationStartSwitchRect:
+                {
+                // these cannot be overwritten
+                if (aAction!=KErrNotFound) // resetting the state is allowed regardless of earlier state
+                    {
+                    return iAppInfo[index].iAction;
+                    }
+                break;
+                }
+            }
+        
+        iAppInfo[index].iAction = aAction;
+        RDebug::Printf("CAppInfoCache::SetAction - Returned action %d", iAppInfo[index].iAction);
+        return iAppInfo[index].iAction;
+    }
+
+TInt CAppInfoCache::Action(const TUid& aUid)
+    {
+    TInt index = IndexOf(aUid.iUid);
+    if (index != KErrNotFound)
+        {
+        return iAppInfo[index].iAction;
+        }
+    return KErrNotFound;
+    }
+
+TBool CAppInfoCache::IsEmbedded(const TUid& aUid) const		
+	{
+	return iAppInfo[IndexOf(aUid.iUid)].iParent != KNullUid;
+	}
+
+
+TBool CAppInfoCache::IsSameParent(const TUid& aUid1, const TUid& aUid2) const
+	{
+	
+	if(aUid1 == KNullUid || aUid2 == KNullUid)
+		return EFalse;
+	
+	TAppInfo appInfo = iAppInfo[IndexOf(aUid1.iUid)];
+	appInfo.iParent.iUid = (appInfo.iParent == KNullUid) ? appInfo.iUid : appInfo.iParent.iUid;
+	TAppInfo parentAppInfo = iAppInfo[IndexOf(aUid2.iUid)];
+	parentAppInfo.iParent.iUid = (parentAppInfo.iParent == KNullUid) ? parentAppInfo.iUid : parentAppInfo.iParent.iUid;
+	
+	if(appInfo.iParent == parentAppInfo.iParent) // Same root?
+		return ETrue;
+	
+	return EFalse;
+	}	
+	
+	
+const TUid& CAppInfoCache::FocusUid() const
+	{
+	return iFocusedUid;
+	}
+
+
+TBool CAppInfoCache::SetFocusUid(TInt aWgId)
+	{
+    if (aWgId)
+    	{
+		for(TInt i = 0; i < iAppInfo.Count(); i++)
+			{
+			if(iAppInfo[i].iRootWgId == aWgId)
+				{
+				iFocusedUid = TUid::Uid(iAppInfo[i].iUid);
+				return ETrue;
+				}
+			}
+		}
+	return EFalse;
+	}
+
+void CAppInfoCache::ClearActions()
+    {
+    for (TInt i = 0; i < iAppInfo.Count(); ++i)
+        {
+        if ( iAppInfo[i].iAction != AknTransEffect::EAppStartupBackground )
+            {
+            iAppInfo[i].iAction = KErrNotFound;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CWsServerDrawerController* CWsServerDrawerController::NewL(MAlfDrawerEngine* aEngine)
+	{
+	CWsServerDrawerController* self = new (ELeave) CWsServerDrawerController(aEngine);
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+CWsServerDrawerController::~CWsServerDrawerController()
+	{
+#ifdef WSSERVERDRAWER_TIME_LOG //time log
+	delete iLogger;
+#endif //WSSERVERDRAWER_TIME_LOG	
+	delete iAppInfoCache;
+	delete iEndCheck;
+	delete iStates;
+	
+	iPSStates.ResetAndDestroy();
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+CWsServerDrawerController::CWsServerDrawerController(MAlfDrawerEngine* aEngine) :
+    iEngine( aEngine )
+    {
+    iLastAction = AknTransEffect::ENone;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CWsServerDrawerController::AddStateL(const TUid& aUid, TInt aKey)
+	{
+	CPSListener* s = new (ELeave) CPSListener();
+	CleanupStack::PushL(s);
+	s->ListenL(aUid, aKey);
+	User::LeaveIfError(iPSStates.Append(s));
+	CleanupStack::Pop(); //s
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TInt CWsServerDrawerController::GetState(TInt aState) const
+	{
+	for(TInt i = 0; i < iPSStates.Count() ; i++)
+		{
+		const CPSListener* const ps = iPSStates[i]; 
+		if(ps->Key() == aState)
+			return ps->Value();
+		}
+	return 0;
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CWsServerDrawerController::ConstructL()
+	{
+#ifdef WSSERVERDRAWER_TIME_LOG
+	iLogger = new (ELeave)CDebugLogger();
+#endif //WSSERVERDRAWER_TIME_LOG	
+	iAppInfoCache = CAppInfoCache::NewL();
+	iEndCheck = CEndCheck::NewL(*this);
+	iStates = CStateHandler::NewL(iEngine);
+
+	// Fill blocklist from the array
+	for(TInt i = 0; i < sizeof(KNoEffectApps) / sizeof(KNoEffectApps[0]); i++)
+		{
+		iStates->AddBlockUid(TUid::Uid( KNoEffectApps[i] ));
+		}
+
+	for(TInt i = 1; i < sizeof(KNoEffectPairs) / sizeof(KNoEffectPairs[0]); i++)
+		{
+		iStates->AddBlockUidPair(TUid::Uid( KNoEffectPairs[i][0] ), TUid::Uid( KNoEffectPairs[i][1] ));
+		}
+
+/*	Disabled adding to exception list, since we have no exceptions atm.
+	for(TInt i = 0; i < sizeof(KExceptionEffectApps) / sizeof(KExceptionEffectApps[0]); i++)
+		{
+		iStates->AddExceptionUid(TUid::Uid( KExceptionEffectApps[i] ));
+		}
+*/
+
+    //AddStateL( KPSUidUikon, KUikGlobalNotesAllowed );
+    AddStateL( KPSUidScreenSaver, KScreenSaverOn );
+    AddStateL( KPSUidStartup, KPSStartupUiPhase );
+    AddStateL( KPSUidScreenSaver, KScreenSaverPreviewMode );
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+const TUid& CWsServerDrawerController::FocusUid()
+	{
+	return iAppInfoCache->FocusUid();
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+TBool CWsServerDrawerController::SetFocusUid(TInt aUid)
+	{
+	return iAppInfoCache->SetFocusUid(aUid);
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+void CWsServerDrawerController::BeginFullscreen(TInt aType, const TUid aUid1, const TUid aUid2, TInt aData )
+	{	
+	TUid toUid = iEngine->ToUid();
+	TUid fromUid = iEngine->FromUid();
+	TInt flags = iEngine->Flags();
+#ifdef WSSERVERDRAWER_TIME_LOG //time log
+	if(aFromGfx)
+		{
+		iLogger->Log1(_L("CWsServerDrawerController::BeginFullscreen from Gfx time %d"), iLogger->TimeMs());
+		}
+	else 
+		{
+		iLogger->Log1(_L("CWsServerDrawerController::BeginFullscreen time %d"), iLogger->TimeMs());
+		}
+#endif //WSSERVERDRAWER_TIME_LOG
+
+/////////////////////
+	if(aType == AknTransEffect::EParameterAvkonInternal)	
+		{ 
+		const TUid appuid = aUid1;
+		if(appuid != KNullUid)
+			{
+			iAppInfoCache->SetUid(appuid);
+			iAppInfoCache->SetAvkonUid(appuid);
+			iAppInfoCache->SetParent(appuid, aUid2);
+			iAppInfoCache->SetFocusUid(aData);
+			}
+		}
+
+	// App Filter uses application uid for the unique key in the table. That causes problems as
+	// there can be several instances of applications in the system which have the same uid,
+	// e.g. stand-alone application and embedded applications. Because of this:
+	// - We try to prevent updating App Filter flags if the instance is embedded.
+	// - The existence of the parent uid do not necessarily mean that the instance is embedded.
+
+	if ((toUid != KNullUid) && (iEngine->Action() == AknTransEffect::EEmbeddedApplicationExit))
+		iAppInfoCache->SetParent(toUid, KNullUid); // Clear parent uid on exit of embedded application
+		
+    TBool isEmbeddedAppContext = 
+    	(iEngine->Action() == AknTransEffect::EEmbeddedApplicationExit) ||
+    	(iEngine->Action() == AknTransEffect::EEmbeddedApplicationStart);
+    	
+    iAppInfoCache->SetUid(toUid);
+    iAppInfoCache->SetUid(fromUid);
+		
+	if ((toUid != KNullUid) && !isEmbeddedAppContext) 
+		{
+		//the ok is always reset in the begining		
+		if(flags & AknTransEffect::TParameter::EResetServerStats)
+			{ //this should be called always before avkoncheck or noeffects etc for apps
+			iAppInfoCache->Reset(toUid);
+			}	
+		
+		//Adding uid to block list			
+		if(flags & AknTransEffect::TParameter::ENoEffects)
+			{
+			iStates->AddBlockUid(toUid);
+			}
+		//Removing uid from blocklist
+		if(flags & AknTransEffect::TParameter::EEnableEffects)	
+			{
+			iStates->RemoveBlockUid(toUid);
+			}
+		}
+		
+	CStateHandler::TFullscreenType fstype = iStates->GetFullscreenType(iEngine->Action());
+	CStateHandler::TFullscreenType currtype = iStates->GetCurrentFullscreenType();
+
+	//application has to be avkon app, therefore thise
+	//flag has to be set twice!	
+	if(flags & AknTransEffect::TParameter::EAvkonCheck)
+		{
+		if(fstype == CStateHandler::EExit) //application will exit and avkon flags must be reset (otherwise
+		    {
+			iAppInfoCache->RemoveAvkonUid(toUid); //repeating calls may allow check pass
+		    }
+		else
+		    {
+			iAppInfoCache->SetAvkonUid(toUid);
+		    }
+		}
+		
+// TODO: All control has been disabled as it seems to block too much,
+// it appears that the states are not handled correctly or something else is missing		
+
+    // if we are currenly running a layoutswitch let it only be aborted by
+    // another layoutswitch.
+    if( (iStates->GetCurrentFullscreenType() == CStateHandler::ELayoutSwitch) &&
+        (iEngine->Action() != AknTransEffect::ELayoutSwitch))
+        {
+        return;
+        }
+
+	//activation after exit is not allowed (also if exit didnt result in an effect)
+	if(iLastTypeTried == CStateHandler::EExit &&
+       fstype == CStateHandler::EActivation)
+		{ //the current uid is not valid
+    	return; // activation not ok if exiting
+		}
+		
+    iLastTypeTried = fstype;
+
+    //activation after exit is not allowed...even it was aborted
+	if(iExitAborted &&
+	 CStateHandler::EActivation == fstype) 
+		{ //the current uid is not valid
+		AbortTransition();  //if exit is aborted, we dont want either activation	
+    	return; // activation not ok if exiting
+		}
+
+	//dsa apps do not have effects
+	//this is one reason why for activation end cannot be called immediately after begin
+	//we should know if its a dsa app before end can be called
+	if(iDSAActive)
+	    {
+	    return; //Do nothing if dsa active.
+	    }
+
+	//Special argument calls does not initiate any FS effect and is caught here.
+	// TODO: remove && !iEngine->WaitingForRootWgId() when appuids available from wserv
+	if(fstype == CStateHandler::ENone) 
+		{
+		return;
+		}
+
+
+	//Phone is booting, stop any FS effect.
+	if(!StartCheck(flags)) 
+		{
+		AbortTransition();
+		return;
+		}		
+	
+	// if either toUid or fromUid is in the custom list for applications
+	// that should be blocked then we abort all ongoing transitions.
+	if(!(AllowedCustomUid(toUid) && AllowedCustomUid(fromUid)))
+        {
+        AbortTransition();
+        return;
+        }
+			
+	// No effect if a second exit effect comes in while exit effect is ongoing.
+    // Double exit actually looks quite nice...
+    // We are doing separate visuals, not screen capture, so there is no need to
+    // filter this out
+    /*
+	if((currtype == fstype) && currtype == CStateHandler::EExit) 
+		{
+		return;
+		}
+	*/	
+	
+	//Filter out anything but exit effect if start effect is running.
+    /*
+	if((currtype == CStateHandler::EStart) && (fstype != CStateHandler::EExit)) 
+		{
+		return;
+		}
+	*/	
+
+	// this check is for embedded apps/operator menu case      ///// This check aborts ongoing. Is this right?
+	// abort and skip transition if no current  uid		          // Maybe should be added to statemachine.
+	// TODO: Revise when appuids available from wserv
+	/*
+	if( toUid == KNullUid )
+		{
+    	return;	
+		}		
+*/
+	//activation switch effects are not allowed for non avkon apps as they never will
+	//inform their foregound - so no transition.
+	if(CStateHandler::EActivation == fstype && currtype != CStateHandler::EStart &&
+	 !iAppInfoCache->AvkonUid(toUid))
+		{
+		return;
+		}
+
+    if(iEngine->Action() == AknTransEffect::ELayoutSwitch) // ELayoutSwitchOut is for two phases solution
+		{
+		if( iLastFromUid.iUid == KScreensaverUid ) //TODO: Better test needed here?
+            {
+            iEngine->Action() = 1001; // 1002: start, 1001, exit
+            iEngine->ToUid() = TUid::Uid(KScreensaverUid);
+            iEngine->FromUid() = TUid::Uid(0);
+            iEngine->Flags() |= AknTransEffect::TParameter::EActivateExplicitContinue;
+            }
+        else if( iLastToUid.iUid == KScreensaverUid ) //TODO: Better test needed here?
+            {    
+            iEngine->Action() = 1002; // 1002: start, 1001, exit
+            iEngine->ToUid() = TUid::Uid(KScreensaverUid);
+            iEngine->FromUid() = TUid::Uid(0);
+            iEngine->Flags() |= AknTransEffect::TParameter::EActivateExplicitContinue;
+            }
+        else 
+            {
+            switch(iLastAction)
+                {
+                case AknTransEffect::EApplicationExit:
+                    iEngine->Action() = AknTransEffect::ELayoutSwitchExit;
+                    break;
+                case AknTransEffect::EApplicationStartRect:
+                case AknTransEffect::EApplicationStart:
+                    iEngine->Action() = AknTransEffect::ELayoutSwitchStart;
+                    break;
+                //case AknTransEffect::EApplicationActivate: // Does it work only for application active?
+                default: 
+                   break;
+                }
+            }    
+        }
+
+    if (!iStates->IsBlocked(fromUid, toUid))
+        {
+		iLastAction = AknTransEffect::ENone;
+		iLastFromUid = KNullUid; 
+		iLastToUid = KNullUid;
+        iLayoutChangeActive = EFalse;
+        }
+    // Convert 
+
+    // Signal statemachine
+    iStates->Signal(CStateBase::EBeginFullscreen);
+	// Start end checker always.
+	if(flags & AknTransEffect::TParameter::EEndCheck)
+		{
+		StartEndChecker();
+		}
+	else
+		{
+		StartEndChecker(KEndTimeOut);
+		}
+	}
+	
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+
+
+TBool CWsServerDrawerController::StartCheck(TInt aFlags) const
+	{
+	if((aFlags & AknTransEffect::TParameter::EActivateExplicitContinue)) //always allow this
+	    {
+	    return true;
+	    }
+	else if(iEngine->Action() == AknTransEffect::ELayoutSwitch) //always allow layoutswitch
+	    {
+	    return true;
+	    }
+	else if (aFlags & AknTransEffect::TParameter::EAllowAtBoot) //allow unless screensaver is on
+	    {
+		return !TBool(GetState(KScreenSaverOn)) &&
+		       !TBool(GetState(KScreenSaverPreviewMode));  //off
+	    }
+	else
+	    {
+    	return /*TBool(GetState(KUikGlobalNotesAllowed)) //on
+  			&& */ iAppInfoCache->GateFound()
+   		 	&& !TBool(GetState(KScreenSaverOn))
+   		 	&& !TBool(GetState(KScreenSaverPreviewMode));  //off
+  		 // && TBool(GetState(ESplashRunning))
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CWsServerDrawerController::StartEndChecker(TInt aMultiplier)
+	{
+	iEndCheck->Start(aMultiplier);
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CWsServerDrawerController::CancelEndChecker()
+	{
+	iEndCheck->Cancel();
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CWsServerDrawerController::EndExpired()
+	{
+	__ALFFXLOGSTRING("CWsServerDrawerController::EndExpired >>");
+	AbortTransition(EAbortFullscreen);
+	iExitAborted = EFalse; //This is not valid when we have a time-out
+	__ALFFXLOGSTRING("CWsServerDrawerController::EndExpired <<");
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+void CWsServerDrawerController::EndFullscreen(TBool /*aFromGfx*/)
+	{
+ 	/*
+	DSA end fix
+	*/
+	if(iDSAActive)
+	    {
+	    AbortTransition();
+	    return; //Do nothing if dsa active.
+	    }
+	    
+
+#ifdef WSSERVERDRAWER_TIME_LOG //time log
+	iLogger->Log1(_L("CWsServerDrawerController::EndFullscreen time %d"), iLogger->TimeMs());
+#endif	//WSSERVERDRAWER_TIME_LOG
+
+	iStates->Signal(CStateBase::EEndFullscreen);
+	}
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+void CWsServerDrawerController::FullscreenFinished(TInt aHandle)
+	{
+	if(aHandle == iEngine->CurrentHandle()) // Filter away stray finish signals.
+		{
+		iLastTypeTried = CStateHandler::ENone;
+		iStates->Signal(CStateBase::EFinishFullscreen);
+		}
+	}
+	
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+TInt CWsServerDrawerController::BeginControlTransition()
+	{
+	if(iDSAActive)
+	    {
+	    return KErrAbort;
+	    }
+
+    if(iLayoutChangeActive)
+        {
+        return KErrAbort;
+        }
+    // Check booting time disabling & screensaver
+    __ALFFXLOGSTRING2("GetState(KUikGlobalNotesAllowed) %d, GetState(KScreenSaverOn)), %d GetState(KScreenSaverPreviewMode) %d",
+    		/*TBool(GetState(KUikGlobalNotesAllowed)),*/
+    		TBool(GetState(KScreenSaverOn)),
+    		TBool(GetState(KScreenSaverPreviewMode)));
+    
+    if(/*TBool(GetState(KUikGlobalNotesAllowed))==EFalse || */
+	   TBool(GetState(KScreenSaverOn)) ||
+	   TBool(GetState(KScreenSaverPreviewMode)))
+		{
+		return KErrAbort;
+		}
+
+	iStates->Signal(CStateBase::EBeginComponent);
+	
+	if(iStates->GetState() == CStateBase::EComponent) 
+		{
+		return iEngine->CurrentHandle();
+		}
+	else
+		{
+		return KErrAbort;
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//	
+void CWsServerDrawerController::EndControlTransition(TInt aHandle)
+	{
+	if(aHandle == iEngine->CurrentHandle()) //Filter out stray endcomponent.
+		{
+		iStates->Signal(CStateBase::EFinishComponent);
+		}
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CWsServerDrawerController::ScreenModeChange(TBool aBeforeScreenModeChange)
+	{
+	if( aBeforeScreenModeChange )
+		{
+		AbortTransition();
+        iLayoutChangeActive = ETrue;
+        }
+	}
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CWsServerDrawerController::Error( TServerDrawerError /*aError*/ )
+    {
+    AbortTransition();
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CWsServerDrawerController::SaveLastActionAndUid()
+    {
+    iLastAction = iEngine->Action();
+    iLastFromUid = iEngine->FromUid(); 
+    iLastToUid = iEngine->ToUid();
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CWsServerDrawerController::DSABegin()
+    {
+    AbortTransition();
+    iDSAActive = ETrue;
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CWsServerDrawerController::DSAEnd()
+    {
+    iDSAActive = EFalse;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+void CWsServerDrawerController::AbortTransition(TInt aToAbort)
+    {
+    __ALFFXLOGSTRING("CWsServerDrawerController::AbortTransition >>");
+    if ( aToAbort == EAbortFullscreen )
+        {
+        iLastTypeTried = CStateHandler::ENone;
+	    iExitAborted = iStates->GetCurrentFullscreenType() == CStateHandler::EExit;
+        iStates->Signal(CStateBase::EAbortFullscreen);
+        }
+    else if ( aToAbort == EAbortControl )
+        {
+        iStates->Signal(CStateBase::EAbortComponent);
+        }
+    else if( (aToAbort & EAbortControl) && (aToAbort & EAbortFullscreen) ) 
+    	{
+    	iLastTypeTried = CStateHandler::ENone;
+	    iExitAborted = iStates->GetCurrentFullscreenType() == CStateHandler::EExit;
+    	iStates->Signal(CStateBase::EAbort);
+    	}
+	__ALFFXLOGSTRING("CWsServerDrawerController::AbortTransition <<");
+    }
+
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+//
+TBool CWsServerDrawerController::IsBlocked( const TUid& aFromUid, const TUid& aToUid )
+    {
+    TBool result = iStates->IsBlocked( aFromUid, aToUid );
+    __ALFFXLOGSTRING1("CWsServerDrawerController::IsBlocked - return %d", result);
+    return result;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/group/alfopenwfrs.iby	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,22 @@
+/*
+* 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: 
+*
+*/
+#ifndef __ALF_OPENWFRS_PLUGIN_IBY__
+#define __ALF_OPENWFRS_PLUGIN_IBY__
+
+ECOM_PLUGIN(alfopenwfrs.dll,alfopenwfrs.rsc)
+
+#endif // __ALF_OPENWFRS_PLUGIN_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/group/alfopenwfrs.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,74 @@
+// 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:
+// OpenWF composition render stage plugin for Window Server
+// 
+//
+
+/**
+ @file
+*/
+
+TARGET		alfopenwfrs.dll
+TARGETTYPE	PLUGIN //ECOMIIC
+UID 		0x10009D8D 0x2002BCFA
+CAPABILITY      PowerMgmt ReadDeviceData WriteDeviceData ProtServ
+VENDORID	0x70000001
+
+#ifndef USERINCLUDE_WSGRAPHICDRAWERINTERFACE_H
+macro USERINCLUDE_WSGRAPHICDRAWERINTERFACE_H
+#endif
+
+macro SYMBIAN_GRAPHICS_GCE
+macro USE_UI_SURFACE_FOR_ALF
+
+
+USERINCLUDE ../inc
+USERINCLUDE ../../../CommonInc
+USERINCLUDE ../../../ServerCore/Inc
+MW_LAYER_SYSTEMINCLUDE
+
+
+SOURCEPATH	../src
+SOURCE		displayrenderstage.cpp
+SOURCE		displayrenderstagefactory.cpp
+SOURCE		openwfcwrapper.cpp
+SOURCE		elementwrapper.cpp
+SOURCE		stdplugin.cpp
+SOURCE		utils.cpp
+SOURCE		displaypolicy.cpp
+SOURCE		rsdisplaychangeao.cpp
+SOURCE    openwfcjobmanager.cpp
+SOURCE    openwfcthreadmanager.cpp
+SOURCE 		screencaptureutil.cpp
+
+TARGETPATH ECOM_RESOURCE_DIR
+RESOURCE	alfopenwfrs.rss
+
+LIBRARY     estor.lib
+LIBRARY     euser.lib
+LIBRARY     fbscli.lib
+LIBRARY     graphicsresource.lib
+LIBRARY     hal.lib
+LIBRARY     lookuptable.lib
+LIBRARY     surfaceupdateclient.lib
+LIBRARY     wsgraphicdrawer.lib
+LIBRARY     libwfc.lib
+LIBRARY     wfcinterop.lib
+LIBRARY     surfacemanager.lib
+LIBRARY	 	libegl.lib
+//TODO Change the following line once eglsynchelper has been corrected
+//     to be available as a dynamic library
+STATICLIBRARY  eglsynchelper.lib
+
+//SMPSAFE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,29 @@
+// 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:
+// Standard nga plugins for Window Server
+// 
+//
+
+/**
+ @file
+*/
+
+#include <platform_paths.hrh>
+
+PRJ_EXPORTS
+./alfopenwfrs.iby   CORE_MW_LAYER_IBY_EXPORT_PATH(alfopenwfrs.iby)
+
+PRJ_MMPFILES
+
+./alfopenwfrs.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/debugbardrawer.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,52 @@
+// 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 __DEBUGBARDRAWER_H__
+#define __DEBUGBARDRAWER_H__
+
+#include <graphics/wsgraphicscontext.h>
+#include <graphics/wsrenderstage.h>
+
+/** MWsDebugBar simple implementation 
+            
+@publishedPartner
+@prototype
+*/
+class CDebugBarDrawer : public MWsDebugBar
+	{	
+public:		
+	static CDebugBarDrawer* NewL(CWsRenderStage * aRenderStage, TInt aScreenWidth);
+	~CDebugBarDrawer();			
+	void DrawDebugBar(const TArray<TPtrC>& aDebugText);			
+	
+private:
+	CDebugBarDrawer(CWsRenderStage * aRenderStage, TInt aScreenWidth);
+	void ConstructL();
+	
+private:
+	enum {KFontHeightInPixel = 10};
+	
+	CWsRenderStage * iRenderStage;
+	MWsGraphicsContext * iGc;
+
+	TInt iScreenWidth;
+	TRect iDebugBarRect;
+	CFbsTypefaceStore* iFontStore;
+	CFont* iFont;
+	TInt iBaseline;	
+	};
+#endif
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/directgdigcwrapper.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,171 @@
+// 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>
+#include <graphics/wscursor.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
+*/
+class CDirectGdiGcWrapper : public CBase, public MWsGraphicsContext, public MWsFader, public MWsDrawableSourceProvider, public MWsTextCursor
+	{
+public:
+	static CDirectGdiGcWrapper* NewL();
+	~CDirectGdiGcWrapper();
+	inline CDirectGdiContext& DirectGdiGc();
+
+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);
+
+	//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);
+
+public: // from MWsTextCursor
+	void DrawTextCursor(const TTextCursorInfo& aTextCursorInfo);	
+	
+private:
+	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
+	RPointerArray<RDirectGdiDrawableSource> iDrawableSources;
+	//Required by MWsFader implmentation
+	TRgb			iFadeColor;
+	const TUint16*	iLut;
+	};
+
+//
+// CDirectGdiGcWrapper
+//
+
+inline CDirectGdiContext& CDirectGdiGcWrapper::DirectGdiGc()
+	{return(*iContext);}
+
+
+
+#endif //__DIRECTGDIGCWRAPPER_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/displaypolicy.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,170 @@
+// 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 CDISPLAYPOLICY_H
+#define CDISPLAYPOLICY_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <graphics/displaycontrolbase.h>
+#include <graphics/displaymapping.h>
+#include <graphics/displayconfiguration.h>
+#include <graphics/wsdisplaypolicy.h>
+// CLASS DECLARATION
+enum TCoordinateSpace;
+class MWsGraphicDrawerEnvironment;
+class MWsScreen;
+class MWsScreenConfigList;
+class MWsIniFile;
+/**
+ *  CDisplayPolicy
+ * 
+ */
+class CDisplayPolicy : public CBase
+	{
+public:
+	enum	TUiScaling
+		{
+		ENone=			0,
+		EInteger=		1,
+		EIsotropic=		2,
+		EAnisotropic=	3		
+		};
+	// Constructors and destructor
+
+	/**
+	 * Destructor.
+	 */
+	~CDisplayPolicy();
+
+	/**
+	 * Two-phased constructor.
+	 */
+	static CDisplayPolicy* NewL(MWsGraphicDrawerEnvironment* aEnv,MWsScreen* aScreen,TInt aScreenNumber);
+
+	/**
+	 * Two-phased constructor.
+	 */
+	static CDisplayPolicy* NewLC(MWsGraphicDrawerEnvironment* aEnv,MWsScreen* aScreen,TInt aScreenNumber);
+
+	void NewAppModesAvailable();
+	void GetAppModeList();
+	TInt MapCoordinates(TCoordinateSpace aSourceSpace, const TRect& aSource, 
+			TCoordinateSpace aTargetSpace, TRect& aTarget) const;
+	void AddVirtualResolutionCount(TInt& aDisplayCount) const; 
+	TInt AddVirtualResolutions(RArray<MDisplayControlBase::TResolution>& aResolutions) const;
+	MDisplayControlBase::TResolution AppModeToResolution(RArray<MDisplayControlBase::TResolution>& aResolutions,TInt appMode)const;
+	TInt GetSizeModeConfiguration(RArray<MDisplayControlBase::TResolution>& aResolutions,TInt aScreenSizeMode, 
+			TDisplayConfiguration& aConfig, TRect& aSizeModePosition) const;
+	
+	/*
+	 * Used when display is disconnected.
+	 */
+	TInt GetSizeModeConfiguration(TInt aScreenSizeMode,TDisplayConfiguration& aConfig, TRect& aSizeModePosition);
+	TBool SettingConfiguration(const RArray<MDisplayControlBase::TResolution>& aResolutions,
+			TDisplayConfiguration& aConfig)const;
+	TBool PolicyEnabled()const{return (iUiScaling==ENone)?EFalse:ETrue;}
+	
+	void SetCompositionInfo (const TDisplayConfiguration& aCompositionConfig,const TDisplayConfiguration& aUiConfig);
+	void SetSizeModeExtent(TRect& aExtent, TBitFlags32 /*aContext*/);
+	void	AdjustStageBufferSize(const TSize& aOldSize,TSize& aNewSize);
+	void	CalculateMinBufferSize(RArray<MDisplayControlBase::TResolution>& aResolutions, TInt aConnectionStatus);
+	TInt 	SuitableAppMode(MWsDisplayPolicy::TDisplayStatus aSituation);
+	void 	SetLastAppMode(TInt aMode);
+	
+	TSize	GetUiResolution();
+	TSize   GetUiResolutionAsTwips() const;
+	TRect 	GetPolicyAppMode();
+
+private:
+
+	class TAppMode
+		{
+	public:
+		TRect	iPixels;	//<Size and pisition in pixels
+		TSize	iTwips;		//<Size in TWips
+		TInt	iFlags;		//<Flags
+		enum	THighFlags	//<Policy flags are per app mode. Lower bits are defined by MWsScreenConfigList::TModeFlags 
+			{		//Currently none
+			};
+		
+		//The app modes are presented based on Normal rotation to calculate correctly with display resolutions
+		//which are always in normal rotation
+		TInt	iOrientations;	//<Index bits via CFbsBitGc::TGraphicsOrientation
+		TInt	iModeIndex;	//<Which screen mode index it refers to
+		
+		};
+	/**
+	 * Constructor for performing 1st stage construction
+	 */
+	CDisplayPolicy();
+
+	/**
+	 * EPOC default constructor for performing 2nd stage construction
+	 */
+	void ConstructL(MWsGraphicDrawerEnvironment* aEnv,MWsScreen* aScreen,TInt aScreenNumber);
+	TBool FindVirtualMode(const RArray<MDisplayControlBase::TResolution>& aResolutions,
+			const CDisplayPolicy::TAppMode& aAppMode,TSize& aFullAppModeSize,TInt& aIndex,TInt& aBestScale) const;
+	
+	TSize ResolutionSize(RArray<MDisplayControlBase::TResolution>& aResolutions, const TSize aBestAppSize,
+			TInt aIndex, TInt aScale) const;
+	TSize ResolutionSizeFromTwips(RArray<MDisplayControlBase::TResolution>& aResolutions, TInt aAppMode,const TSize& aBestAppSize, 
+			TInt aIndex,TBool aSwapAxis) const;
+	TSize ResolutionSizeFromAssumedTwips(RArray<MDisplayControlBase::TResolution>& aResolutions,const TSize& aBestAppSize,
+			TInt aIndex,TBool aSwapAxis,TInt aScale) const;
+	
+	TBool MatchConfigToResolutions(const RArray<MDisplayControlBase::TResolution>& aResolutions,
+			const TDisplayConfiguration& aConfig, TInt aStartIndex, TInt& aResolutionIndex)const;
+	TBool SetConfigToResolution(TInt aAppMode, MDisplayControlBase::TResolution aResolution, TDisplayConfiguration& aConfig)const;
+	void CenteredAppInUi(const TSize& aUiSize,const TRect& aAppExtent,TRect& aSizeModePosition) const;
+	TInt MapCompositionToUi(const TRect& aSource, TRect& aTarget, TBool aIsReverseMapping) const;
+	void MapUiToApplication(const TRect& aSource, TRect& aTarget, TBool aIsReverseMapping) const;
+	TInt MapUiToDSA(const TRect& aSource, TRect& aTarget, TBool aIsReverseMapping) const;
+	void GetModeInfoL(const MWsScreenConfigList& aList,TInt aIndex,TPoint& aOffset,TSize& aSize,TAppMode& aMode) const;
+	TInt MinSizedModeIndex();
+	/** Used when calculating how to map app mode to hardware resolutions
+		Rounds up when .5
+	*/
+	class TFraction
+		{
+	public:
+		TFraction();
+		TInt operator*(TInt aInt) const;
+	public:
+		TInt iNumer;
+		TInt iDenom;
+		};
+private:
+	RArray<TAppMode>	iAppModes;
+	TInt iUiScaling;
+	MWsIniFile* iScreenIniFile;
+	MWsScreen* iScreen;
+	TSize iUiSizePixels;
+	TRect iAppSizePixels;
+	TSize iAppSizeTwips;
+	TSize iCompositionSizeTwips;
+	TSize iCompositionSizePixels;
+	TSize	iMinUiBufferSize;
+	TInt 	iNumNormalAppModes;
+	TInt	iLastAppMode;
+	TInt 	iConnectionStatus;
+	TInt 	iSmallestAppMode;
+	TSize 	iSmallestAppSize;
+	TDisplayConfiguration::TRotation iLastUiRotation;
+	TDisplayConfiguration::TRotation iLastCompositionRotation;
+	};
+
+#endif // CDISPLAYPOLICY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/displayrenderstage.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,210 @@
+// 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 __DISPLAYRENDERSTAGE_H__
+#define __DISPLAYRENDERSTAGE_H__
+
+#include <graphics/surfaceupdateclient.h> 
+#include <graphics/wsrenderstage.h>
+#include <graphics/wsscreendevice.h>
+#include <graphics/wsdisplaycontrol.h>
+#include <graphics/wsdisplaymapping.h>
+#include <graphics/wsdisplaypolicy.h>
+#include <graphics/wsscene.h>
+#include <graphics/wselement.h>
+#include <alf/alfcompositionclient.h>
+#include "alfstreamerconsts.h"
+#include "alfrenderstageutils.h"
+
+class RSgImageCollection;
+class CDisplayPolicy;
+class CRsDisplayChangeNotifier;
+class CRsConfigChangeNotifier;
+class COpenWfcWrapper;
+class CScreenCaptureUtil;
+class CElementWrapper;
+    
+
+
+/**
+This is the implementation of CWsRenderStage which is created by a CDisplayRenderStageFactory
+*/
+class CDisplayRenderStage : 
+        public CWsRenderStage,
+        public MWsScreenDevice,
+        public MWsDisplayControl,
+        public MWsDisplayMapping,
+        public MWsDisplayPolicy,
+        public MWsScene,
+        public MWsWindowTreeObserver,
+        public MAlfCompositionController
+    {
+friend class COpenWfcWrapper;
+
+public:
+    static CDisplayRenderStage* NewL(MWsGraphicDrawerEnvironment* aEnv, MWsScreen* aScreen, TInt aScreenNumber);
+    ~CDisplayRenderStage();
+
+public: //from CWsRenderStage
+    TAny* ResolveObjectInterface(TUint aTypeId);
+    void Begin(const TRegion* aRegion);
+    void End(TRequestStatus* aFinished);    
+
+public: //from MWsScreenDevice
+    TInt ScreenNumber() const;
+    TDisplayMode DisplayMode() const;
+    TSize SizeInPixels() const;
+    TSize SizeInTwips() const;
+    TRect PointerRect() const;
+    void GetPixel(TRgb& aColor, const TPoint& aPixel) const;
+    void GetScanLine(TDes8& aScanLine, const TPoint& aStartPixel, TInt aPixelLength, TDisplayMode aDispMode) const;
+    TBool RectCompare(const TRect& aRect1, const TRect& aRect2) const;
+    void CopyScreenToBitmapL(CFbsBitmap* aBitmap, const TRect &aRect) const;
+    void ClearDisplay(TRgb aBackColor);
+    
+public: //from MWsScene
+    TInt SetSceneRotation(const MWsScene::TSceneRotation aSceneRotation);
+    MWsScene::TSceneRotation SceneRotation() const;
+    MWsElement* CreateSceneElementL();
+    void DestroySceneElement(MWsElement* aElement);
+    TInt InsertSceneElement(MWsElement* aInsertElement, MWsElement* aSubordinateElement);
+    TInt RemoveSceneElement(MWsElement* aRemoveElement);
+    void ComposePendingScene(TSurfaceId& aOffScreenTarget, TRequestStatus* aCompleted);
+    TInt RegisterSurface(const TSurfaceId& aSurface);
+    TInt UnregisterSurface(const TSurfaceId& aSurface);
+    
+public: // from MWsDisplayControl/MDisplayControlBase
+    void NotifyOnDisplayChange(TRequestStatus& aStatus);
+    void NotifyOnDisplayChangeCancel();
+    void NotifyOnConfigChange(TRequestStatus& aStatus);
+    void NotifyOnConfigChangeCancel();
+    TInt NumberOfResolutions() const;
+    TInt GetResolutions(RArray<TResolution>& aResolutions) const;
+    void GetConfiguration(TDisplayConfiguration& aConfig) const;
+    TInt SetConfigurationAndBuffer(const TDisplayConfiguration& aConfig,const TSize* aUiSize);
+    TInt SetConfiguration(const TDisplayConfiguration& aConfig);
+    TInt PreferredDisplayVersion() const;
+    
+public: //from MWsDisplayMapping/MDisplayMapping
+    virtual TInt MapCoordinates(TCoordinateSpace aSourceSpace, const TRect& aSource, TCoordinateSpace aTargetSpace, TRect& aTarget) const;
+    void SetSizeModeExtent(TRect& aExtent, TBitFlags32 aContext);
+    
+public://from MWsDisplayPolicy
+    virtual void NewAppModesAvailable(); 
+    TInt GetSizeModeConfiguration(TInt aScreenSizeMode, TDisplayConfiguration& aConfig, TRect& aSizeModePosition) const;
+    TInt SuitableAppMode(TDisplayStatus aSituation);
+    void SetLastAppMode(TInt aMode);
+    
+public: 
+    
+    void NodeCreated(const MWsWindowTreeNode& aWindowTreeNode, const MWsWindowTreeNode* aParent) { if (iWindowTreeObserver) iWindowTreeObserver->NodeCreated(aWindowTreeNode, aParent);}
+    void NodeReleased(const MWsWindowTreeNode& aWindowTreeNode) { if (iWindowTreeObserver) iWindowTreeObserver->NodeReleased(aWindowTreeNode);}
+    void NodeActivated(const MWsWindowTreeNode& aWindowTreeNode) { if (iWindowTreeObserver) iWindowTreeObserver->NodeActivated(aWindowTreeNode);}
+    void NodeExtentChanged(const MWsWindowTreeNode& aWindowTreeNode, const TRect& aRect) { if (iWindowTreeObserver) iWindowTreeObserver->NodeExtentChanged(aWindowTreeNode, aRect);}
+    void SiblingOrderChanged(const MWsWindowTreeNode& aWindowTreeNode, TInt aNewPos) { if (iWindowTreeObserver) iWindowTreeObserver->SiblingOrderChanged(aWindowTreeNode, aNewPos);}
+    void FlagChanged(const MWsWindowTreeNode& aWindowTreeNode, TFlags aFlag, TBool aNewValue) { if (iWindowTreeObserver) iWindowTreeObserver->FlagChanged(aWindowTreeNode,aFlag, aNewValue);}
+    void AttributeChanged(const MWsWindowTreeNode& aWindowTreeNode, TAttributes aAttribute) { if (iWindowTreeObserver) iWindowTreeObserver->AttributeChanged(aWindowTreeNode, aAttribute);}
+    void FadeCountChanged(const MWsWindowTreeNode& aWindowTreeNode, TInt aFadeCount) { if (iWindowTreeObserver) iWindowTreeObserver->FadeCountChanged(aWindowTreeNode, aFadeCount);}
+    void TransparentRegionChanged(const MWsWindowTreeNode& aWindowTreeNode, const TRegion& aNewTransparentRegion, const TRegion* aNewOpaqueRegion) { if (iWindowTreeObserver) iWindowTreeObserver->TransparentRegionChanged(aWindowTreeNode, aNewTransparentRegion, aNewOpaqueRegion);}
+    void ElementAdded(const MWsWindowTreeNode& aWindowTreeNode, const MWsElement& aElement);
+    void MovedToWindowGroup(const MWsWindowTreeNode& aWindowTreeNode, const MWsWindowTreeNode& aNewWindowGroupNode) { if (iWindowTreeObserver) iWindowTreeObserver->MovedToWindowGroup(aWindowTreeNode, aNewWindowGroupNode);}
+    void WindowGroupChained(const MWsWindowTreeNode& aParent, const MWsWindowTreeNode& aChild) { if (iWindowTreeObserver) iWindowTreeObserver->WindowGroupChained(aParent, aChild);}
+    void WindowGroupChainBrokenAfter(const MWsWindowTreeNode& aWindowGroupNode) { if (iWindowTreeObserver) iWindowTreeObserver->WindowGroupChainBrokenAfter(aWindowGroupNode);}
+    void FadeAllChildren(const MWsWindowTreeNode& aWindowTreeNode, TBool aFaded) { if (iWindowTreeObserver) iWindowTreeObserver->FadeAllChildren(aWindowTreeNode, aFaded);}
+            
+public: //MAlfCompositionController
+    TInt EnableAlpha(TBool aEnable = ETrue);
+    TInt SetOpacity(TReal32 aOpacity) __SOFTFP;
+    TInt SetRotation(TInt aRotationInDegrees);
+    TInt SetExtent(const TRect& aRect, TInt aScreen);
+    void SetIsBackgroundAnim(TBool ETrue);    
+    TInt SetSourceRect(const TRect& aRect);   
+    TInt CreateTargetL(TInt aTarget, TInt aClientHandle, TInt aGrpHandle);    
+    void SetTargetL(TInt aTarget);    
+    void SetExtentSurfaceId(const TSurfaceId& aSurfaceId);
+    TInt SetOrder(TInt aTarget, TInt aTop, TBool aAbove, TBool aCombineTargets);
+    void DeleteTarget(TInt aTarget);
+    void LowOnGraphicsMemory();
+    void GraphicsMemoryGood();
+    void AlfBridgeCallback(TInt aEvent, TAny* aData);
+    
+public:     
+    
+private:
+    CDisplayRenderStage(TInt aScreenNumber);
+    void ConstructL(MWsGraphicDrawerEnvironment* aEnv, MWsScreen* aScreen, TInt aScreenNumber);
+    void ElementUseAlphaFlagChangedL(MWsElement& aElement, TBool aEnabled);
+    MWsElement* FindElement(TInt aWindowGroupId, TInt aWindowHandle);
+    CElementWrapper* FindElementTarget(TInt aTarget);
+    void AlfWindowListenerCallback( TAlfNativeWindowData* aData );
+    void SetTarget(MWsElement* aElement);
+private:
+    TInt iScreenNumber;
+    TTimeStamp iTimeStamp;
+    RSurfaceUpdateSession iSurfaceUpdateSession;
+    const TRegion* iUpdateRegion;
+    //CDirectGdiDriver* iDGdiDriver;
+    //CRenderTarget* iRenderTarget;
+    COpenWfcWrapper* iOpenWfcWrapper;
+    MWsDisplayControl*  iOpenWfcWrapperDisplayControl;
+        
+    CDisplayPolicy* iDisplayPolicy;
+    TBool iDisplayPolicyEnabled;
+    
+    //required for display and config change notification
+    CRsDisplayChangeNotifier* iDispNotifier;
+    CRsConfigChangeNotifier* iConfigNotifier;
+    
+    TBool iRunningOnLowMem;
+    MAlfBridge* iAlfBridge;
+    MWsElement* iAlfElement;
+    MWsElement* iUiElement;
+    CElementWrapper* iTargetElement;
+    MAlfCompositionAgnosticWindowTreeObserver* iWindowTreeObserver;
+
+    struct TElementData
+        {
+        MWsElement* iElement;
+        TSurfaceId iSurfaceId;
+        TUint32 iWindowGrpId; 
+        TUint32 iWindowHandle; 
+        TUint32 iWindowTreeNodeId; 
+        
+        TElementData(MWsElement* aElement, TSurfaceId aSurfaceId, TInt aWindowGrpId, TUint32 aWindowHandle, TUint32 aWindowTreeNodeId)
+            {
+            iElement = aElement;
+            iSurfaceId = aSurfaceId;
+            iWindowGrpId = aWindowGrpId;
+            iWindowHandle = aWindowHandle;
+            iWindowTreeNodeId = aWindowTreeNodeId;
+            }
+        };
+    
+    RArray<TElementData> iElementArray;
+    
+    struct SElementTarget
+      { 
+      TInt iTarget;
+      CElementWrapper* iElement;
+      };
+      
+    TSurfaceId iExtentSurfaceId;
+      
+    RArray<SElementTarget> iElementTargets;
+public:
+    mutable CScreenCaptureUtil* iScreenCaptureUtil;
+    };
+
+#endif //__DISPLAYRENDERSTAGE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/displayrenderstagefactory.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,52 @@
+// 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 __DISPLAYRENDERSTAGEFACTORY_H__
+#define __DISPLAYRENDERSTAGEFACTORY_H__
+
+#include <graphics/wsplugin.h>
+#include <graphics/wsrenderstagefactory.h>
+
+class CWsRenderStage;
+class MWsGraphicDrawerEnvironment;
+
+/**
+This is an implementation of MWsRenderStageFactory, in the form of a CWsPlugin.
+The window server will use this to create standard render stages for each screen,
+if the ini file specifies them.
+*/
+class CDisplayRenderStageFactory : public CWsPlugin, public MWsRenderStageFactory
+	{
+public:
+	enum { EImplUid = 0x2002BCFA};
+	
+public:
+	static CDisplayRenderStageFactory* CreateL();
+	~CDisplayRenderStageFactory();
+
+public: //from CWsPlugin
+	void ConstructL(MWsGraphicDrawerEnvironment& aEnv, const TDesC8& aData);
+	const TDesC& PluginName() const;
+
+public: //from MWsRenderStageFactory
+	TAny* ResolveObjectInterface(TUint aTypeId);
+	CWsRenderStage* CreateFinalRenderStageL(MWsScreen* aScreen, MWsScreenRedraw* aScreenRedraw, TInt aScreenNumber);
+	CWsRenderStage* CreateRenderStageL(MWsScreen* aScreen, MWsScreenRedraw* aScreenRedraw, CWsRenderStage* aNextStage);
+
+private:
+	CDisplayRenderStageFactory();
+	};
+
+#endif //__DISPLAYRENDERSTAGEFACTORY_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/elementwrapper.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,159 @@
+// 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:
+// A class which wraps OpenWF element related functionality.
+
+//
+
+#ifndef ELEMENTWRAPPER_H_
+#define ELEMENTWRAPPER_H_
+
+#include "openwfcwrapper.h"
+#include <graphics/wselement.h>
+#include <graphics/surface.h>
+#include <WF/wfc.h>
+
+#if defined(ENABLE_LI_LOGGING)
+#define LILOG(X)  RDebug::Printf X
+#else
+#define LILOG(X)
+#endif
+
+#define OWF_SURFACE_WIDTH  (768) /* needs to be > 640 + 2 to allow S60 nHD config to work */
+#define OWF_SURFACE_HEIGHT (768) /* needs to be > 640 + 2 to allow S60 nHD config to work */
+
+NONSHARABLE_CLASS(CElementWrapper) : public CBase, public MWsElement
+    {
+public:  
+    enum TOwfUpdates
+        {   //All setters should set EUpdate_PostIllegalUpdate
+        EUpdate_None                        = 0,
+
+        EUpdate_DESTINATION_RECTANGLE       = 0x00000001,
+        EUpdate_SOURCE                      = 0x00000002,
+        EUpdate_SOURCE_RECTANGLE            = 0x00000004,
+        EUpdate_SOURCE_FLIP                 = 0x00000008,
+        EUpdate_SOURCE_ROTATION             = 0x00000010,
+        EUpdate_SOURCE_SCALE_FILTER         = 0x00000020,  //No client-side code yet to drive this
+        EUpdate_TRANSPARENCY_TYPES          = 0x00000040,
+        EUpdate_GLOBAL_ALPHA                = 0x00000080,
+        EUpdate_MASK                        = 0x00000100,  //No client-side code yet to drive this
+        EUpdate_DESTINATION_CLIP_RECTANGLE  = EUpdate_DESTINATION_RECTANGLE|EUpdate_SOURCE_RECTANGLE,
+
+        EUpdate_SOURCE_GEOMETRY_SET         = EUpdate_SOURCE_RECTANGLE|EUpdate_SOURCE_FLIP|EUpdate_SOURCE_ROTATION,
+        EUpdate_ALL_ATTRIBS                 = 0x000fffff,
+        EUpdate_AttributesIllegal           = 0x00100000,   //If set then the owf scene will not be updated because it would be illegal.
+        EUpdate_SettingValid                = 0x00200000,
+        EUpdate_DontLockSource              = 0x00400000,
+
+        EUpdate_Insert                      = 0x01000000,
+        EUpdate_Remove                      = 0x02000000,
+        EUpdate_Destroy                     = 0x04000000,
+        EUpdate_SceneCommited               = 0x10000000,
+        };    
+
+public: // from MWsElement  
+    const TSurfaceId& ConnectedSurface() const;
+    TInt ConnectSurface(const TSurfaceId& aSurface);
+
+    TInt SetSourceRectangle(const TRect& aSrc);
+    TInt GetSourceRectangle(TRect& aSrc);
+    
+    TInt SetSourceFlipping(const TBool aFlip);
+    TBool SourceFlipping() const;
+    
+    MWsElement* ElementAbove();
+    MWsElement* ElementBelow();
+
+    TInt SetGlobalAlpha(const TInt aAlpha);
+    void GlobalAlpha(TInt& aAlpha) const;
+
+    TInt SetSourceRotation(const TElementRotation aElementRotation);
+    MWsElement::TElementRotation SourceRotation() const;
+    
+    TInt SetTargetRendererFlags(const TUint32& aTargetRendererFlags);
+    TInt SetRenderStageFlags(const TUint32& aRenderStageFlags);
+    void GetTargetRendererFlags(TUint32& aTargetRendererFlags) const;
+    void GetRenderStageFlags(TUint32& aRenderStageFlags) const;
+
+    TInt SetDestinationRectangle(const TRect& aDest);
+    TInt GetDestinationRectangle(TRect& aDest) const;
+    TInt SetDestinationClippingRect(const TRect& aDestClipRect);
+    TInt GetDestinationClippingRect(TRect& aDestClipRect) const;
+    
+public:
+    static CElementWrapper* NewL(COpenWfcWrapper& aCOpenWfcWrapper, CElementWrapper*& aCleanupPrevRef);
+    CElementWrapper(COpenWfcWrapper& aOpenWfcWrapper);
+    ~CElementWrapper();
+    void ConstructL(CElementWrapper*& aCleanupPrevRef);
+    void RemoveAfter(CElementWrapper** apBelow);
+    void InsertAfter(CElementWrapper*& aRefBelow, CElementWrapper* aBelow, TOwfUpdates aUpdateFlag);
+    CElementWrapper** RefsMyElementBelow();
+    CElementWrapper*& MyElementAbove();
+    COpenWfcWrapper& Owner()const { return iOpenWfcWrapper;}
+    TBool FlushSceneChanges();
+    WFCElement Element(){ return iElement;};
+    TOwfUpdates UpdateFlags()const {return static_cast<TOwfUpdates>(iUpdateFlags);}
+    TInt ReplicateElements(WFCContext aContext, WFCElement& aPreviousTargetElement, const TPoint& aOffset);
+
+    void SetIsBackgroundAnim(TBool aIsBackgroundAnimationElement)
+      {
+      iIsBackgroundAnimationElement=aIsBackgroundAnimationElement;  
+      }
+     
+    TBool IsBackgroundAnimationElement()
+      {
+      return iIsBackgroundAnimationElement;    
+      }
+protected:
+    void SetEltDestinationRectangle(WFCElement aElement)const;
+    void SetEltDestinationRectangle(WFCElement aElement, const TPoint& aOffset)const;
+    void SetEltSource(WFCElement aElement)const;
+    void SetEltSourceComposed();
+    void SetEltSourceRectangle(WFCElement aElement);
+    void SetEltSourceFlip(WFCElement aElement)const;
+    void SetEltTransparencyTypes(WFCElement aElement)const;
+    void FlushAttributeChanges(WFCElement aElement, TInt aUpdateFlags);
+    TBool IsNewElementLegal()const;
+    
+private: //methods
+    TBool UnsetSurface(TSurfaceId& aSurface);
+    static TInt WfcRotation(MWsElement::TElementRotation aRotation);
+    void HelpStreamGetHeader(khronos_int32_t* width, khronos_int32_t* height )const;
+    TRect SetSourceDestRect(const TRect& aDestElementRect, const TRect& aDestElementClippedRect,const TRect& aSrcOriginalElementRect,const TBool& aElementFlip,const MWsElement::TElementRotation& aElementRotation) const;
+    TInt SurfaceInfo(const TSurfaceId& aSurface, RSurfaceManager::TInfoBuf& aInfo);
+
+
+private: //data
+    TUint                         iUpdateFlags;
+    COpenWfcWrapper&              iOpenWfcWrapper;
+    TSurfaceId                    iComposedSurfaceId;
+    TSurfaceId                    iSurfaceId;
+    TSize                         iSurfaceSize;
+    TRect                         iSourcRect; 
+    TRect                         iDestinationRect;
+    TRect                         iDestinationClippingRect;
+    TInt                          iGlobalAlpha;
+    TBool                         iFlipped;
+    MWsElement::TElementRotation  iRotation;
+    TUint32                       iTargetRendererFlags;
+    TUint32                       iRenderStageFlags;
+    WFCElement                    iElement;
+    CElementWrapper*              iElementAbove;     //used to maintain the scene list
+    CElementWrapper*              iElementBelow;     //used to maintain the scene list
+    CElementWrapper**             iCleanupPrevRef;    //used to clean up the context on exit
+    CElementWrapper*              iCleanupNext;       //used to clean up the context on exit
+    TBool iIsBackgroundAnimationElement;
+    };
+
+#endif /* ELEMENTWRAPPER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/mwsgraphicscontexttodirectgdimappings.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,36 @@
+// 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 <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);}
+	};
+
+#endif	//__MWSGRAPHICSCONTEXTTODIRECTGDIMAPPINGS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/openwfcjob.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,65 @@
+// 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 OPENWFCJOB_H_
+#define OPENWFCJOB_H_
+
+#include <e32std.h>
+#include <WF/wfc.h>
+
+#define KNullThreadId 0
+
+class COpenWfcJobManger;
+
+struct TOpenWfcJob
+	{
+	enum EOpenWfcJobId
+		{
+			EInvalidJobId = 0,
+			EComposeJobId,
+			EPauseCompositionJobId,
+			EResumeCompositionJobId,
+		};
+	
+	TOpenWfcJob(COpenWfcJobManger& aJobManager);
+	
+
+	~TOpenWfcJob();
+	
+	void Set(EOpenWfcJobId aJob, 
+			 TThreadId aThreadId = KNullThreadId, 
+			 TRequestStatus* aRequest = NULL);
+	
+	void Reset();
+	
+	EOpenWfcJobId JobId();
+	
+	void CompleteRequest(TInt aResult);
+	
+	void Run();
+	
+	TDblQueLink iDlink;
+	COpenWfcJobManger& iJobManager;
+	EOpenWfcJobId iJobId;
+	TThreadId iCallingThread;
+	TRequestStatus* iCompleteRequest;
+	};
+
+inline TOpenWfcJob::EOpenWfcJobId TOpenWfcJob::JobId()
+	{
+	return iJobId;
+	}
+
+#endif /* OPENWFCJOB_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/openwfcjobmanager.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,262 @@
+// 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 OPENWFCJOBMANAGER_H_
+#define OPENWFCJOBMANAGER_H_
+
+#include <e32std.h>
+#include <e32base.h>
+#include <e32debug.h>
+
+#include <EGL/egl.h>
+#include <graphics/eglsynchelper.h>
+#include <WF/wfc.h>
+
+class COpenWfcWrapper;
+class COpenWfcMonitorThread;
+class TOpenWfcJob;
+
+#if defined(ENABLE_JQ_LOGGING)
+#define JQLOG(X)  RDebug::Printf X
+#else
+#define JQLOG(X)
+#endif
+
+/**
+ * Controls the OpenWF composition
+ */
+class COpenWfcJobManger : public CBase
+	{
+private:
+
+    enum EOpenWfcJobId
+        {
+            EOpenWfcInvalidJobId = 0,
+            EOpenWfcComposeJobId,
+            EOpenWfcPauseCompositionJobId,
+            EOpenWfcResumeCompositionJobId,
+        };
+    
+	/**
+	 * Stores the parameters associated with a composition
+	 */
+	struct TComposeRequestDetails
+		{
+		TComposeRequestDetails();
+		void Set(TRequestStatus* aCommitRequest, TThreadId aCallingThread);
+		void Reset();
+		TRequestStatus* iCommitRequest;
+		TThreadId iCallingThread;
+		TDblQueLink iDlink;
+		};
+	
+	/**
+	 * Auxilliary class to insure the release of a lock
+	 */
+	class Guard
+		{
+		public:
+		Guard(RMutex& aLock);
+		~Guard();
+		private:
+		    RMutex& iLock;
+		};
+	
+public:
+	/**
+	 * Two-phased constructor.
+	 */
+	static COpenWfcJobManger* NewL(COpenWfcWrapper& aOpenWfcWrapper, 
+                                    WFCDevice aDevice, 
+                                    WFCContext aContext,
+                                    TInt aManagerId);
+	
+	/**
+	 * Two-phased constructor.
+	 */
+	static COpenWfcJobManger* NewLC(COpenWfcWrapper& aOpenWfcWrapper, 
+                                    WFCDevice aDevice, 
+                                    WFCContext aContext,
+                                    TInt aManagerId);
+	/**
+	 * Destructor.
+	 */
+	virtual ~COpenWfcJobManger();
+	
+	/**
+	 * Request to compose the specified scene 
+	 * 
+	 * @param aCompleted The notification to be returned when the composition completes
+	 * @param aUpdatePolicy Update policy to be used
+	 * @param the Pointer to the first element from the element list containing the scene to be used by the next commit
+	 * 
+	 */
+	void ComposeRequest(TRequestStatus* aCompleted);
+	
+	/**
+	 * Request to pause the composition
+	 */
+	void CompositionPauseRequest();
+	/**
+	 * Request to resume the composition
+	 */
+	void CompositionResumeRequest();
+	
+    /**
+     * Appends to the compose details list the first detail object from the compose detail list
+     * 
+     * @return NULL if the compose detail pool is empty or a pointer to the appended detail object
+     */
+	TComposeRequestDetails* AppendDetailsFromPool();
+
+    /**
+     * Executes an outstanding command, if any.
+     * 
+     */
+    void DoExecuteJob();
+    
+private:
+    /**
+     * Executes a compose request.
+     * Intended to be invoked by a job
+     * 
+     * @param Reference to the invoking job
+     */
+    void DoComposeJob();
+    
+    /**
+     * Executes a pause composition request
+     * Intended to be invoked by a job
+     * 
+     * @param Reference to the invoking job
+     */
+    void DoPauseCompositionJob();
+    
+    /**
+     * Executes a resume composition request.
+     * Intended to be invoked by a job
+     * 
+     * @param Reference to the invoking job
+     */
+    void DoResumeCompositionJob();
+        
+	/**
+	 * Private constructor
+	 */
+	COpenWfcJobManger(COpenWfcWrapper& aOpenWfcWrapper, 
+						 WFCDevice aDevice, 
+						 WFCContext aContext,
+						 TInt aManagerId);
+	
+	/**
+	 * Symbian constructor used with the two stage construction pattern
+	 */
+	void ConstructL();
+	
+	/**
+	 * Implements a fence operation
+	 */
+	void Fence();
+	
+	/**
+	 * Waits until the sync is signalled
+	 */
+	void WaitForSync();
+	
+	/**
+	 * Activates the composition on the current context
+	 */
+	void Activate();
+	
+	/**
+	 * Deactivates the composition on the current context
+	 */
+	void Deactivate();
+	
+	/**
+	 * Execute a composition on the current context
+	 */
+	void Compose();
+	
+	/**
+	 * Execute a commit on the current context
+	 */
+	void Commit();
+	
+	/**
+	 * Completes all the outstanding requests stored locally
+	 */
+	void CompleteComposeRequests(TInt aResult);
+	
+    /**
+     * Completes all the outstanding pause/resumerequests requests
+     */
+    void CompletePauseResumeRequest(TInt aResult);
+    
+private:
+	// 
+	TDblQue<TComposeRequestDetails> iComposeDetailsPool;
+	TDblQueIter<TComposeRequestDetails> iComposeDetailsPoolIter;
+	TDblQue<TComposeRequestDetails> iComposeDetailsList;
+	TDblQueIter<TComposeRequestDetails> iComposeDetailsListIter;
+    RMutex iJobLock;
+    RMutex iCommandLock;
+    COpenWfcWrapper& iOpenWfcWrapper;
+	WFCDevice iDevice;
+	WFCContext iContext;
+	volatile TBool iCompositionPaused;
+	volatile TBool iPausedComposePending;
+	COpenWfcMonitorThread*	iThreadManager;
+	TInt iManagerId;
+	EGLSyncKHR iSync;
+	EGLDisplay iEglDisplay;
+    TRequestStatus iPauseResumeRequestStatus;
+    TThreadId iPauseResumeThread;
+    EOpenWfcJobId iOutstandingJob;
+    static const TInt KComposeDetailsPoolSize = 16;
+	};
+
+inline void COpenWfcJobManger::Fence()
+	{
+    wfcFence(iDevice, iContext, iEglDisplay, iSync);
+	}
+
+inline void COpenWfcJobManger::WaitForSync()
+	{
+	EGLTimeKHR timeout = (EGLTimeKHR) EGL_FOREVER_KHR;
+	eglClientWaitSyncKHR(iEglDisplay, iSync, 0, timeout);
+	}
+
+inline void COpenWfcJobManger::Activate()
+	{
+	wfcActivate(iDevice, iContext);
+	}
+
+inline void COpenWfcJobManger::Deactivate()
+	{
+	wfcDeactivate(iDevice, iContext);
+	}
+
+inline void COpenWfcJobManger::Compose()
+	{
+	wfcCompose(iDevice, iContext, WFC_TRUE);
+	}
+
+inline void COpenWfcJobManger::Commit()
+	{
+	wfcCommit(iDevice, iContext, WFC_TRUE);
+	}
+
+#endif /* OPENWFCJOBMANAGER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/openwfcpanics.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,65 @@
+// 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:
+// openwfpanics.h: panic definition for OpenWf Interop
+//
+//
+
+#ifndef OPENWFPANICS_H
+#define OPENWFPANICS_H
+enum TOpenWfcPanic // used for OpenWf errors
+	{	//low values are line numbers.
+	EPanicSetOrderError						=10001,
+	EPanicUnexpectedErrorElementConstruct,
+	EPanicWfcNoDevForScreen,
+	EPanicWfcDeviceNotCreated,
+	EPanicWfcContextNotCreated,
+	EPanicWfcStartupErrorUnexpected,
+	EPanicWfcStreamError,
+	EPanicWfcElementNotRemovedOnShutdown,
+	EPanicWfcSourceLookupOnElementRemoval,
+
+	EPanicWfcInvalidRotation,
+	EPanicWfcBadAttribute,
+	EPanicWfcNoStreamSurface,
+	EPanicWfcThreadManagerNotInitialised,
+	EPanicWfcThreadManagerCannotQueueJob,
+	EPanicUnexpectedErrorElementScene,
+	EPanicUnexpectedErrorElementRemoval,
+	EPanicMethodNotImplemented,
+
+	};
+
+void Panic(TOpenWfcPanic aPanic);
+
+#ifdef _DEBUG
+#define OPENWFC_ASSERT_DEBUG(c, p) \
+	do { \
+		if(!(c)) \
+			{ \
+			Panic(p); \
+			} \
+		} while (EFalse)
+#else
+#define OPENWFC_ASSERT_DEBUG(c, p)
+#endif //_DEBUG
+
+#define OPENWFC_ASSERT_ALWAYS(c, p) \
+	do { \
+		if(!(c)) \
+			{ \
+			Panic(p); \
+			} \
+		} while (EFalse)
+
+#endif /*OPENWFPANICS_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/openwfcthreadmanager.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,50 @@
+// 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 OPENWFCMONITORTHREAD_H_
+#define OPENWFCMONITORTHREAD_H_
+
+#include <e32base.h>
+
+class COpenWfcJobManger;
+
+class COpenWfcMonitorThread : public CBase
+{
+public:
+	virtual ~COpenWfcMonitorThread();
+
+	static COpenWfcMonitorThread* NewL(TInt aNumber, COpenWfcJobManger& aManager);
+	static COpenWfcMonitorThread* NewLC(TInt aNumber, COpenWfcJobManger& aManager);
+	static TInt Main(TAny *aSelf);
+	void Start();
+	void Resume();
+	void Suspend();
+	void Signal();
+	TInt Run();
+	void EndThread();
+	
+private:
+	COpenWfcMonitorThread(COpenWfcJobManger& aManager);
+	void ConstructL(TInt aScreenNumber);
+
+private:
+    volatile TBool iEndThread;
+	RThread iThread;
+	TRequestStatus iThreadStatus;
+	COpenWfcJobManger& iManager;
+    RSemaphore iSemaphore;
+};
+
+#endif /* OPENWFCMONITORTHREAD_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/openwfcwrapper.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,204 @@
+// 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 OPENWFCWRAPPER_H_
+#define OPENWFCWRAPPER_H_
+
+#include <babitflags.h>
+#include <graphics/wsscene.h>
+#include <babitflags.h>
+#include <graphics/surface.h>
+#include "displaypolicy.h"
+
+//
+//OpenWFC stuff
+
+#include <e32std.h>
+#include <e32base.h>
+#include <e32hashtab.h>     //for RHashMap
+#include <WF/wfc.h>
+#include <EGL/egl.h>
+#include <graphics/surfacemanager.h>
+#include <graphics/wsdisplaycontrol.h>
+
+//
+
+class COpenWfcJobManger;
+
+class TDisplayConfiguration;
+class CElementWrapper;
+
+class COpenWfcWrapper : public CBase, public MWsDisplayControl
+	{
+friend class CElementWrapper;
+
+public:
+	static COpenWfcWrapper* NewL(TInt aScreenNo, CDisplayPolicy* aDisplayPolicy);
+	TInt SetUiSurface(const TSurfaceId& aNewUiSurface);
+	~COpenWfcWrapper();
+	
+	MWsElement* CreateElementL();
+	void DestroyElement(MWsElement* aElement);
+	void Compose(const TSurfaceId& aOffScreenTarget, const TPoint& aOrigin,
+	             MWsElement* aStart, MWsElement* aEnd, TRequestStatus* aCompleted);
+	TInt AddElement(MWsElement* aElement, MWsElement* aAbove);
+	void RemoveElement(MWsElement* aElement);
+	void PauseCompositorIfNeeded();
+	void ResumeCompositorIfPaused();
+	void SetScreenRotation(MWsScene::TSceneRotation aRotation);
+	MWsScene::TSceneRotation ScreenRotation() const;
+	TSize ScreenSize() const;
+	void Begin(const TRegion* aRegion);
+	void End();	
+	TBool CompositionDue ();
+	void Compose(TRequestStatus* aCompleted);
+	TInt FlushedSetConfiguration(const TDisplayConfiguration& aConfig);
+    TBool WithinBeginEnd() { return iWithinBeginEnd; };
+	CDisplayPolicy* DisplayPolicy();
+    void FlushSceneElementChanges ();
+    void RemoveElementFromSceneList(CElementWrapper* aElement);
+	
+    /*-------------------------------------------------------------------*//*
+     * CBase interface implementation functions
+     *//*-------------------------------------------------------------------*/
+    //Standard symbian interface extension mechanism
+    virtual TInt        Extension_              (TUint aExtensionId, TAny*& a0, TAny* a1);
+
+    enum    TInternalExtensionGuids
+        {   //These debug object interfaces need not be supported at runtime or on all platforms
+        EExtensionDebugBackendGuid  =   0x1028589A,
+        EExtensionDebugContextGuid  =   0x1028589B,
+        EExtensionDebugDeviceGuid   =   0x1028589C,
+        EExtensionDebugElementGuid  =   0x1028589D,
+        EExtensionDebugSourceGuid   =   0x1028589E, //F still spare when this was written...
+        };
+    
+    /**    Get Extension Interface.
+     *  Implemented using the CBase::Extension_() mechanism 
+     *  @param  aExtensionId    The GUID/ Well-known ID of the interface
+     *  @return pointer to the interface or NULL if not available
+     **/
+    inline TAny* GetInterface(TUint aExtensionId);
+
+    /** Get Extension Interface - templated helper.
+     *  Resolves the ID and returned pointer based on the class name.
+     *  Class name should support ETypeId intergral value, else use non-template version. 
+     *  @param  MClass  The class of the interface with embedded GUID / Well known ID 
+     *  @return pointer to the interface or NULL if not available
+     **/
+    template <class MClass> MClass* GetInterface()
+    {
+        return static_cast<MClass*>(GetInterface(MClass::ETypeId));
+    }
+    
+    TInt RegisterSurface(const TSurfaceId& aSurface);
+    TInt UnregisterSurface(const TSurfaceId& aSurface);
+    void Compose(const TSurfaceId& aOffScreenTarget, TRequestStatus* aCompleted);
+    virtual TBitFlags32 SupportedScreenRotations() const;
+    void PauseComposition();
+    void ResumeComposition ();
+	/*-------------------------------------------------------------------*//*
+	* MWsDisplayControl/MDisplayControlBase interface implementation functions
+	*//*-------------------------------------------------------------------*/
+
+    virtual TInt NumberOfResolutions()const ;
+    virtual TInt GetResolutions(RArray<TResolution>& aResolutions)const ;
+    virtual void GetConfiguration(TDisplayConfiguration& aConfig)const ;
+    virtual TInt SetConfiguration(const TDisplayConfiguration& aConfig) ;
+    virtual TInt PreferredDisplayVersion()const ;
+
+    virtual void NotifyOnDisplayChange(TRequestStatus& aStatus);
+    virtual void NotifyOnDisplayChangeCancel();
+    virtual void NotifyOnConfigChange(TRequestStatus& aStatus);
+    virtual void NotifyOnConfigChangeCancel();
+
+    //"secret" methods available to element
+    WFCDevice Device(){return iDevice;}
+    WFCContext OnScreenContext()   {return iOnScreenContext;}
+    WFCSource IncEltRefRegSource(const TSurfaceId& aHashKey); //<@return registered source handle or NULL if not registered
+    TInt DecEltRefRegSource(const TSurfaceId& aHashKey); //<@return 0=destroyed, +ve count left, -ve error
+
+    static TInt TranslateOpenWfcError(WFCErrorCode error);
+    static void DestroyAllContextElements(WFCDevice dev, WFCContext ctx);
+    RSurfaceManager& SurfaceManager(){return iSurfaceManager;}
+    EGLDisplay Display(){return iEGLDisplay;}
+    
+private:
+    COpenWfcWrapper(CDisplayPolicy* aDisplayPolicy);
+	void ConstructL(TInt aScreenId);
+	TInt AttachSurfaceToUiElement(CElementWrapper* aNewUiElement);
+	void SetCompositionModified();
+	
+    static TUint32 HashFunction(const TSurfaceId& aHashKey);
+    void  ComposeInternal(const TSurfaceId&  aOffScreenTarget,
+                                 const TPoint&      aOrigin,
+                                 MWsElement*      aStart,
+                                 MWsElement*      aEnd,
+                                 TRequestStatus*    aCompleted);
+    TBool IsValidSurface(const TSurfaceId& aSurface);
+
+private:
+	TBool iPaused;
+	TBool iWithinBeginEnd;
+	TBool iCompositionModified;
+	TBool iAllowCompositorPause;
+	
+	CElementWrapper* iUiElement1;
+	CElementWrapper* iUiElement2;
+	
+	TSurfaceId iUiSurface;
+	CDisplayPolicy* iDisplayPolicy;
+	
+private:
+    class OffScreenComposeGuard;
+    
+    struct SourceAndRef
+        {
+        WFCSource source;
+        TInt sourceRef;
+        TInt elementRef;
+        };
+    RHashMap<TSurfaceId, SourceAndRef> iSourceMap;
+    
+    WFCDevice iDevice;
+    WFCContext iOnScreenContext;
+    EGLDisplay iEGLDisplay;
+    WFCint iScreenNumber;
+    static const TInt iInitialSourceMapSize = 0x0;
+    CElementWrapper* iSceneElementList;      //all elements visible in the scene hierarchy
+    CElementWrapper* iRemoveElementList;     //all elements removed from the scene hierarchy
+    CElementWrapper* iCleanupElementList;    //all elements currently allocated are destroyed on cleanup
+    COpenWfcJobManger* iJobManager;
+    MWsScene::TSceneRotation iRotation;
+    TBool iAutonomousCompositionInitiated;
+    MDisplayControlBase* iContextDisplayControl;
+    RSurfaceManager iSurfaceManager;
+	};
+
+inline TAny* COpenWfcWrapper::GetInterface(TUint aExtensionId)
+    {
+    TAny*   retVal=NULL;
+    //Note that extension is intentionally not overloaded in CCompositionBackend
+    if (this->Extension_(aExtensionId,retVal,NULL)<KErrNone)
+        {
+        return NULL;
+        }
+    else
+        {
+        return retVal;
+        }
+    }
+
+#endif /*OPENWFCWRAPPER_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/panic.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,79 @@
+// 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 __PANIC_H__
+#define __PANIC_H__
+
+enum TStdPluginPanic
+	{
+	EPluginPanicTemp = 0,
+	EPluginPanicNoDisplayModeFound = 1,
+	EPluginPanicCreatedOffScreenBitmapInWrongDimensions = 2,
+	EPluginPanicDisplayRenderStageMustBeFinal = 3,
+	EPluginPanicFlickerBufferRenderStageMustNotBeFinal = 4,
+	EPluginPanicIniFileMissing = 5,	// can't find an MWsIniFile instance
+	EPluginPanicPreviousUiSurfaceUnregisterable = 6,
+	EPluginPanicDuplicateUiElement = 7,	// occurs when trying to add a UI element when another UI element is already part of the scene
+	EPluginPanicNonMatchingRemovalOfUiElement = 8, // occurs when removing a UI element, when it's not the current UI element
+	EPluginPanicUiSurfaceIsNull = 9,	// occurs when the UI surface is NULL
+	EPluginPanicScreenDeviceMissing = 10, // can't get MWsScreenDevice from the next render stage
+	EPluginPanicCompositionContextMissing = 11, // can't get MWsCompositionContext from the next render stage
+	EPluginPanicPopGcSettings = 12, // problem when popping gc settings, previously saved
+	EPluginPanicDrawCommandsInvalidState = 13,	//The draw commands state doesn't match with the action that is occuring
+	EPluginPanicInvalidCursorType = 14, // invalid cursor
+	EPluginPanicRegionError = 15, //Region is not NULL and TRegion::CheckError() has returned ETrue, or validation of region state has failed
+	EPluginPanicBadBeginEndSequence = 16, // End() has been called without corresponding Begin(), or Begin() has been called twice.
+	EPluginPanicRedrawNotCompleted = 17, // A redraw has been requested before the previous redraw has completed.  
+	EPluginPanicNoContext = 18, // Graphics context from the next rendering stage is not available
+	EPluginPanicSizeInTwipsFailed = 19, // HAL has returned a value of zero for display twips
+	EPluginPanicMultipleUpdateRequests = 20, // Client has requested an update with updates outstanding
+	EPluginPanicObjectConstructionFailed = 21, // Allocation and construction of an object has failed 
+	EPluginPanicNoDrawableSourceProvider = 22, // The next render stange doesn't support MWsDrawableSourceProvider
+	EPluginPanicDrawableSourceInitializationFailed = 23, // Failure when calling MWsDrawableSourceProvider::OpenDrawable() for an offscreen image
+	EPluginPanicInvalidDrawableSource = 24, // Invalid drawable source pointer passed to MWsDrawableSourceProvider
+	EPluginPanicDisplayControlMissing = 25, // End() has been called without corresponding Begin(), or Begin() has been called twice.
+	EPluginPaniCScreenCaptureUtilMustNotBeFinal = 26, // A redraw has been requested before the previous redraw has completed.
+	EPluginPanicScreenCaptureInvalidCommand=27,  // No Such Command
+	EPluginPanicDisplayMappingMissing = 28, // can't get MWsDisplayMapping from the next render stage
+	EPluginPanicNewUiSurfaceUnsettable = 30,	//can't set a new ui surface
+	EPluginPanicHalSetDisplayState = 31, //error returned when trying to set DisplayState
+	EPluginPanicSceneMissing = 32, // can't get MWsScene from the next render stage
+	EPluginPanicCompositionSequenceError = 33, // an attempt to compose was made which was out of sequence with Begin()/End() 
+
+	};
+
+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 //__PANIC_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/rendertarget.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,127 @@
+// 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 __RENDERTARGET_H__
+#define __RENDERTARGET_H__
+
+#include <graphics/sgimagecollection.h>
+#include <graphics/wsuibuffer.h>
+#include "directgdigcwrapper.h"
+
+#if defined(__WINS__) && defined(_DEBUG)
+class CDebugOsbWin;
+#endif
+
+class RWsOffScreenImageTarget
+	{
+public:
+	RWsOffScreenImageTarget();
+	void OpenL(TUint32 aUsage,TSgCpuAccess aCpuAccess,TUidPixelFormat aPixelFormat,const TSize& aSize, TInt aScreenNumber);
+	void Close();
+public:
+	static const TInt KAspectRatioCount = 2;
+	TSgImageInfo iImageInfos[KAspectRatioCount];
+	RDirectGdiImageTarget iImageTargets[KAspectRatioCount];
+	RSgImageCollection iImageCollections[KAspectRatioCount];
+	RSgImage iImages[KAspectRatioCount];
+	};
+
+class CRenderTarget : public CBase, public MWsUiBuffer
+	{
+public:
+	enum TAspectRatio
+		{
+		ENormalAspectRatio = 0,
+		EInvertedAspectRatio = 1,
+		EAspectRatioCount = RWsOffScreenImageTarget::KAspectRatioCount
+		};
+public:
+	static CRenderTarget* NewL(MWsIniFile* aIniFile, TUint32 aUsage, TSgCpuAccess aCpuAccess, TDisplayMode aDisplayMode, 
+			const TSize& aSize, TInt aScreenNumber);
+	~CRenderTarget();
+
+	TAny* ResolveObjectInterface(TUint aTypeId);
+
+	TDisplayMode DisplayMode() const;
+	const TSurfaceId& SurfaceId() const;
+
+	inline TAspectRatio AspectRatio() const;
+	void SetAspectRatio(TAspectRatio aAspectRatio);
+	const TSgDrawableId& ImageId(TAspectRatio aAspectRatio) const;
+
+	inline CDirectGdiGcWrapper* DirectGdiGc() const;
+	TInt SetDrawDeviceOffset(TPoint& aOrigin);
+	
+	TInt AllocNewTarget(RWsOffScreenImageTarget& aNewTarget, const TSize& aNewSize);
+	void SwitchTarget(RWsOffScreenImageTarget& aNewTarget);	//takes ownership of aNewTarget
+
+	void GetPixel(TRgb& aColor, const TPoint& aPixel) const;
+	void GetScanLine(TDes8& aScanLine, const TPoint& aStartPixel, TInt aPixelLength, TDisplayMode aDispMode) const;
+	TBool RectCompare(const TRect& aRect1, const TRect& aRect2) const;
+	void CopyToBitmapL(CFbsBitmap* aBitmap, const TRect& aRect) const;
+
+#if defined(__WINS__) && defined(_DEBUG)
+	void UpdateDebugWin();
+#endif	
+
+public: //from MWsUiBuffer
+	TInt MapReadWrite(TAny*& aDataAddress, TInt& aDataStride);
+	TInt MapWriteOnly(TAny*& aDataAddress, TInt& aDataStride);
+	TInt Unmap();
+	TUidPixelFormat PixelFormat() const;
+	TSize SizeInPixels() const;
+	
+public:
+	TPoint iOffset;
+
+private:
+	CRenderTarget();
+	void ConstructL(MWsIniFile* aIniFile, TUint32 aUsage, TSgCpuAccess aCpuAccess, TDisplayMode aDisplayMode, const TSize& aSize, TInt aScreenNumber);
+	inline RSgImage& Image();
+	inline const RSgImage& Image() const;
+	inline const RSgImageCollection& ImageCollection() const;
+	inline const TSgImageInfo& ImageInfo() const;
+	const TUint8* DataAddress(const TAny* aStartDataAddress, const TPoint& aStartPoint, TInt aDataStride, TInt aBpp) const;
+	TInt MapReadOnly(const TAny*& aDataAddress, TInt& aDataStride) const;
+	TInt Unmap() const;
+
+private:
+	RWsOffScreenImageTarget iTarget;
+	TAspectRatio iCurrentAspectRatio;
+	CDirectGdiGcWrapper* iDirectGdiGcWrapper;
+#if defined(__WINS__) && defined(_DEBUG)
+	CDebugOsbWin* iOsbWin;
+#endif
+	};
+
+inline CRenderTarget::TAspectRatio CRenderTarget::AspectRatio() const
+	{ return iCurrentAspectRatio; }
+
+inline CDirectGdiGcWrapper* CRenderTarget::DirectGdiGc() const
+	{ return iDirectGdiGcWrapper; }
+
+inline RSgImage& CRenderTarget::Image()
+	{ return iTarget.iImages[iCurrentAspectRatio]; }
+
+inline const RSgImage& CRenderTarget::Image() const
+	{ return iTarget.iImages[iCurrentAspectRatio]; }
+
+inline const RSgImageCollection& CRenderTarget::ImageCollection() const
+	{ return iTarget.iImageCollections[iCurrentAspectRatio]; }
+
+inline const TSgImageInfo& CRenderTarget::ImageInfo() const
+	{ return iTarget.iImageInfos[iCurrentAspectRatio]; }
+
+#endif // __RENDERTARGET_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/rsdisplaychangeao.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,62 @@
+// 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 RS_DISP_CHANGE_NOTIFY
+#define RS_DISP_CHANGE_NOTIFY
+
+#include <e32base.h>
+#include <graphics/wsdisplaycontrol.h>
+
+class CDisplayPolicy;
+class CRsDisplayChangeNotifier : public CActive
+	{
+	public:
+		static CRsDisplayChangeNotifier* NewL(MWsDisplayControl* aNextLevelInterface, CDisplayPolicy* aDisplayPolicy);
+		void IssueNotificationRequest();
+		void CancelNotificationRequest();
+		void RegisterActiveStatus(TRequestStatus &aStatus);
+		~CRsDisplayChangeNotifier();
+	protected:
+		virtual void RunL();
+		virtual void DoCancel();
+	private:
+		CRsDisplayChangeNotifier(MWsDisplayControl* aNextLevelInterface, CDisplayPolicy* aDisplayPolicy);
+		
+	private:
+		TRequestStatus* iWsStatus;
+		MWsDisplayControl* iNextLevelInterface;
+		CDisplayPolicy* iDisplayPolicy;
+	};
+
+class CRsConfigChangeNotifier : public CActive
+	{
+	public:
+		static CRsConfigChangeNotifier* NewL(MWsDisplayControl* aNextLevelInterface);
+		void IssueNotificationRequest();
+		void CancelNotificationRequest();
+		void RegisterActiveStatus(TRequestStatus &aStatus);
+		~CRsConfigChangeNotifier();
+	protected:
+		virtual void RunL();
+		virtual void DoCancel();
+	private:
+		CRsConfigChangeNotifier(MWsDisplayControl* aNextLevelInterface);
+		
+	private:
+		TRequestStatus* iWsStatus;
+		MWsDisplayControl* iNextLevelInterface;
+	};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/screencaptureutil.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,62 @@
+// 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 __SCREENCAPTURERENDERSTAGE_H__
+#define __SCREENCAPTURERENDERSTAGE_H__
+
+#include <graphics/wsrenderstage.h>
+#include <graphics/wstestscreencapture.h>
+#include <graphics/testscreencapture.h>
+#include <graphics/surface.h>
+#include <graphics/surfacemanager.h>
+#include <graphics/surfaceupdateclient.h>
+
+class MWsScene;
+class MWsDisplayControl;
+class MWsDisplayMapping;
+class MWsScreenDevice;
+
+/**
+This is the implementation of CWsRenderStage which is created by a CScreenCaptureUtilFactory
+*/
+
+class CScreenCaptureUtil : public CBase
+	{
+public:
+	static CScreenCaptureUtil * NewL(CWsRenderStage* aOwner);
+	~CScreenCaptureUtil();
+
+	CScreenCaptureUtil();
+	void ConstructL(CWsRenderStage* aOwner);
+	void ComposeScreenL(TInt aHandle);
+	void CreateLocalSurfaceL();
+	void GetCompositionAreaSize(TSize& aSize) const;
+	TSurfaceId CreateSurfaceL(const TSize& aSize, TUidPixelFormat aPixelFormat, TInt aStride);
+	TBool VerifyBitmapFormatL(const CFbsBitmap& aBitmap);
+	TInt CopySurfaceToBitmapL(CFbsBitmap& aCopyToBitmap);
+	
+private:
+	MWsScene* iScene;
+	MWsDisplayMapping* iDisplayMapping;
+	MWsScreenDevice* iScreenDevice;
+	TSurfaceId iLocalSurface;
+	RSurfaceManager iSurfaceManager;
+	RSurfaceUpdateSession iSurfaceUpdateSession;
+	RTimer iTimer;
+	static const TUidPixelFormat KSurfacePixelFormat = EUidPixelFormatXRGB_8888;
+	static const TInt KSurfaceBytesPerPixel = 4;
+	};
+
+#endif //__SCREENCAPTURERENDERSTAGE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/inc/utils.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,49 @@
+// 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	__UTILS_H__
+#define	__UTILS_H__
+
+#include <gdi.h>
+#include <pixelformats.h>
+
+GLDEF_C TDisplayMode ParseDisplayMode(const TDesC& aModeName);
+
+// Macros to highlight usage of deprecated render stage APIs.
+// The description (X) should be small because panic descriptions are limited to 16 chars 
+
+#ifdef RS_DEPRECATED_PANIC
+#ifndef RS_DEPRECATED_LOG
+#define RS_DEPRECATED_LOG
+#endif
+#endif
+
+#ifdef RS_DEPRECATED_PANIC
+#define RS_REPORT_DEPRECATED(X)		RDebug::Printf("Deprecated render stage API:" X), User::Panic(_L("RS:" X), __LINE__)
+#define RS_REPORT_DEPRECATED_SET(X)	RDebug::Printf("Deprecated render stage API - SET:" X), User::Panic(_L("RS:" X), __LINE__)
+#define RS_REPORT_DEPRECATED_GET(X)	RDebug::Printf("Deprecated render stage API - GET:" X), User::Panic(_L("RS:" X), __LINE__)
+#else	/* RS_DEPRECATED_PANIC */
+#ifdef RS_DEPRECATED_LOG
+#define RS_REPORT_DEPRECATED(X)		RDebug::Printf("Deprecated render stage API:" X)
+#define RS_REPORT_DEPRECATED_SET(X)	RDebug::Printf("Deprecated render stage API - SET:" X)
+#define RS_REPORT_DEPRECATED_GET(X)	RDebug::Printf("Deprecated render stage API - GET:" X)
+#else	/* RS_DEPRECATED_LOG */
+#define RS_REPORT_DEPRECATED(X)
+#define RS_REPORT_DEPRECATED_SET(X)
+#define RS_REPORT_DEPRECATED_GET(X)
+#endif	/* RS_DEPRECATED_LOG */
+#endif	/* RS_DEPRECATED_PANIC */
+
+#endif //__UTILS_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/src/alfopenwfrs.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,43 @@
+// 10286378.rss directGDI render stage plugin
+
+// 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:
+// Registry file for the standard wserv plugins
+// 
+//
+
+#include <ecom/registryinfo.rh>
+
+RESOURCE REGISTRY_INFO theInfo
+	{
+	dll_uid = 0x2002BCFA;
+	interfaces =
+		{
+		INTERFACE_INFO
+			{
+			interface_uid = 0x10285A29;
+			implementations =
+				{
+				IMPLEMENTATION_INFO
+					{
+					implementation_uid = 0x2002BCFA;
+					version_no = 1;
+					display_name = "CDisplayRenderStage";
+					default_data = "";
+					opaque_data = "";
+					}
+				};
+			}
+		};
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/src/displaypolicy.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1309 @@
+// 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 <graphics/wsgraphicdrawerinterface.h>
+#include <e32cmn.h>
+#include <u32hal.h>
+#include "displaypolicy.h"
+#include "panic.h"
+
+CDisplayPolicy::CDisplayPolicy():iLastAppMode(KErrNotReady),iSmallestAppMode(KErrNotReady)
+	{
+	// No implementation required
+	}
+
+CDisplayPolicy::~CDisplayPolicy()
+	{
+	}
+
+CDisplayPolicy* CDisplayPolicy::NewLC(MWsGraphicDrawerEnvironment* aEnv,MWsScreen* aScreen,TInt aScreenNumber)
+	{
+	CDisplayPolicy* self = new (ELeave)CDisplayPolicy();
+	CleanupStack::PushL(self);
+	self->ConstructL(aEnv,aScreen,aScreenNumber);
+	return self;
+	}
+
+CDisplayPolicy* CDisplayPolicy::NewL(MWsGraphicDrawerEnvironment* aEnv,MWsScreen* aScreen,TInt aScreenNumber)
+	{
+	CDisplayPolicy* self=CDisplayPolicy::NewLC(aEnv,aScreen,aScreenNumber);
+	CleanupStack::Pop(); // self;
+	return self;
+	}
+
+void CDisplayPolicy::ConstructL(MWsGraphicDrawerEnvironment* aEnv,MWsScreen* aScreen,TInt aScreenNumber)
+	{
+	iScreenIniFile=aEnv->ObjectInterface<MWsIniFile>();
+	if (iScreenIniFile)
+		{
+		_LIT(KScale,"DP_SCALING");
+		//_LIT(KScaleNone,"none");
+		_LIT(KScaleInteger,"integer");
+		_LIT(KScaleIsotropic,"isotropic");
+		_LIT(KScaleAnisotropic,"anisotropic");
+		_LIT(KScreenDisconnected,"SIMULATE_STARTUP_DISCONNECTED");
+		
+		iUiScaling = ENone;
+		TPtrC scalingModeName;
+		if (iScreenIniFile->FindVar(aScreenNumber,KScale,scalingModeName))
+			{
+			if (scalingModeName == KScaleInteger)
+				{
+				iUiScaling = EInteger;
+				}
+			else if (scalingModeName == KScaleIsotropic)
+				{
+				iUiScaling = EIsotropic;
+				}
+			else if (scalingModeName == KScaleAnisotropic)
+				{
+				iUiScaling = EAnisotropic;
+				}
+			}
+		
+		if (iScreenIniFile->FindVar(aScreenNumber,KScreenDisconnected))
+			{
+			//Simulate starting up with this screen disconnected
+			TDisplayConnectState displayState = EDisconnect;
+			TInt err = UserSvr::HalFunction(EHalGroupDisplay | (aScreenNumber<<16), EDisplayHalSetDisplayState, &displayState, NULL);
+			STD_ASSERT_ALWAYS(err == KErrNone, EPluginPanicHalSetDisplayState);
+			}
+		}
+	
+	iScreen=aScreen;
+	}
+
+void CDisplayPolicy::NewAppModesAvailable()
+	{
+	//This notification allows the list to be first populated after Wserv has finished initialising itself
+	//It also allows for the WServ debug method CWsScreenDevice::SetCurrentScreenModeAttributes
+	GetAppModeList();	//get the app size mode list again because some settings have changed
+	}
+
+void CDisplayPolicy::GetModeInfoL(const MWsScreenConfigList& aList,TInt aIndex,TPoint& aOffset,TSize& aSize,TAppMode& aMode)const
+	{
+	aOffset=aList.OriginL(aIndex);
+	aSize=aList.ScreenModeSizeInPixelsL(aIndex);
+	aMode.iPixels=TRect(aOffset,aSize);
+	aMode.iTwips=aList.ScreenModeSizeInTwipsL(aIndex);
+	aMode.iOrientations=aList.AvailableOrientationsL(aIndex);
+	}
+
+void CDisplayPolicy::GetAppModeList()
+	{
+	if (iScreen)
+		{
+		iSmallestAppMode = KErrNotFound;
+		iSmallestAppSize = TSize(10000,10000);
+		MWsScreenConfigList* screenConfigList=iScreen->ObjectInterface<MWsScreenConfigList>();
+		iNumNormalAppModes=0;
+		TSize largestAppMode;
+		if (screenConfigList)
+			{
+			RArray<TInt> goodModeIndices;
+			if (screenConfigList->GetScreenSizeModeList(goodModeIndices)!=KErrNone)
+				{
+				//If reserve fails then list is empty later - we can't change display res from app mode request, just use current and try to centre app area
+				iAppModes.Reserve(goodModeIndices.Count());
+				
+				//iScreenIniFile: First time in, it should be a good pointer from which to extract the basicFlags
+				//Repeat calls only update the values inside app mode list entries, and the ini file should not be read again. 
+				//Specify some basic flags by reading ini file for this screen number?
+				TInt basicFlags=0;
+				
+				//Our demo policy uses the app mode list to generate a list of virtual resolutions.
+				
+				for (TInt modeIndex=0;modeIndex<goodModeIndices.Count();modeIndex++)
+					{
+					TInt modeNum=goodModeIndices[modeIndex];
+					TAppMode mode;
+					TSize size;
+					TPoint offset;
+					mode.iFlags=basicFlags;
+					TRAP_IGNORE(mode.iFlags|=screenConfigList->ModeFlagsL(modeNum)); //we know modeNum is valid-wont leave
+					//any further flags to read from ini file for this appmode on this screen number?
+	
+					//Probably should ignore modes flagged with Hal or Dynamic
+					// at the moment we want all modes in the list! 
+	
+					TInt err = KErrNone;
+					TRAP(err,GetModeInfoL(*screenConfigList,goodModeIndices[modeIndex],offset,size,mode));
+					if (err == KErrNone)	//should never fail - we never ask for info for a bad mode
+						{
+						if (1<<CFbsBitGc::EGraphicsOrientationRotated90&mode.iOrientations 
+								|| 1<<CFbsBitGc::EGraphicsOrientationRotated270&mode.iOrientations)
+							{	//flip rect and twips
+							mode.iPixels = TRect(mode.iPixels.iTl.iY,mode.iPixels.iTl.iX,mode.iPixels.iBr.iY,mode.iPixels.iBr.iX);
+							mode.iTwips = TSize(mode.iTwips.iHeight,mode.iTwips.iWidth);
+							}
+						mode.iModeIndex=modeNum;
+						if (modeIndex==iAppModes.Count())
+							{
+							iAppModes.Append(mode);	//can't fail if reserve succeeded
+							}
+						else if (modeIndex<iAppModes.Count())
+							{
+							iAppModes[modeIndex]=mode;	//update - wserv implementation means order never changes.
+							}
+						//This is to help policy code decide what the minimum buffer size should be 
+						//Switching between modes requiring smaller screen area than this will not invoke memory reallocation, so will not fail.
+						//Perhaps an implementation would also consider the current lowest physical resolution as a guide.
+						//The HAL mode may be significantly larger than the app modes require
+						if (!(mode.iFlags&(MWsScreenConfigList::EDynamic|MWsScreenConfigList::EHalDefault)))
+							{
+							TSize borderedSize=offset.AsSize()+size;
+							if (borderedSize.iWidth>largestAppMode.iWidth)
+								largestAppMode.iWidth=borderedSize.iWidth;
+							if (borderedSize.iHeight>largestAppMode.iHeight)
+								largestAppMode.iHeight=borderedSize.iHeight;
+							iNumNormalAppModes++;
+							}
+						
+						//find the smallest appmode. this will be used when display is disconnected
+						if (!(mode.iFlags&(MWsScreenConfigList::EDynamic|MWsScreenConfigList::EHalDefault)))
+							{
+							TSize borderedSize=offset.AsSize()+size;
+							if(borderedSize.iWidth*borderedSize.iHeight < iSmallestAppSize.iWidth*iSmallestAppSize.iHeight)
+								{
+								iSmallestAppSize = borderedSize;
+								iSmallestAppMode = modeNum;
+								}
+							}
+						}
+						
+					}
+				}
+			goodModeIndices.Close();
+			}
+		iMinUiBufferSize=largestAppMode;
+		}
+	iScreenIniFile=NULL;
+	}
+
+TInt CDisplayPolicy::MapCompositionToUi(const TRect& aSource, TRect& aTarget, TBool aIsReverseMapping) const
+	{
+	// only scaling is involved in mapping from composition to UI
+	// no offset change
+	TFraction widthFraction;
+	TFraction heightFraction;
+	if (	iCompositionSizePixels.iWidth<=0
+		||	iUiSizePixels.iWidth<=0
+		||	iCompositionSizePixels.iHeight<=0
+		||	iUiSizePixels.iHeight<=0)
+		{
+		aTarget=aSource;
+		return KErrNotReady;
+		}
+	if(aIsReverseMapping)
+		{
+		//Ui to composition
+		widthFraction.iNumer = iCompositionSizePixels.iWidth;
+		widthFraction.iDenom = iUiSizePixels.iWidth;
+		heightFraction.iNumer = iCompositionSizePixels.iHeight;
+		heightFraction.iDenom = iUiSizePixels.iHeight;
+		}
+	else
+		{
+		//composition to ui
+		widthFraction.iNumer = iUiSizePixels.iWidth;
+		widthFraction.iDenom = iCompositionSizePixels.iWidth;
+		heightFraction.iNumer = iUiSizePixels.iHeight;
+		heightFraction.iDenom = iCompositionSizePixels.iHeight;
+		}
+	
+	aTarget.iTl.iX = widthFraction * aSource.iTl.iX;
+	aTarget.iBr.iX = widthFraction * aSource.iBr.iX;
+	aTarget.iTl.iY = heightFraction * aSource.iTl.iY;
+	aTarget.iBr.iY = heightFraction * aSource.iBr.iY;
+	return KErrNone;
+	}
+
+void CDisplayPolicy::MapUiToApplication(const TRect& aSource, TRect& aTarget, TBool aIsReverseMapping) const
+	{
+	// only offset is involved in mapping from Ui to App
+	// no scaling
+	TPoint offset = iAppSizePixels.iTl;;
+	
+	if(aIsReverseMapping)
+		{
+		//App to ui
+		aTarget.iTl = aSource.iTl + offset;
+		aTarget.iBr = aSource.iBr + offset;
+		}
+	else
+		{
+		//Ui to App
+		aTarget.iTl = aSource.iTl - offset;
+		aTarget.iBr = aSource.iBr - offset;
+		}
+	
+	}
+
+TInt CDisplayPolicy::MapUiToDSA(const TRect& aSource, TRect& aTarget, TBool aIsReverseMapping) const 
+	{
+	//only offset is involved in mapping from Ui to DSA
+	//no scaling
+	TPoint dsaOffset(0, 0);
+	
+	MWsScreenConfig *screenConfig = iScreen->ObjectInterface<MWsScreenConfig>();
+	if(screenConfig)
+		{
+		dsaOffset = screenConfig->Origin();
+		}
+	TRect rectInApp;
+	if(aIsReverseMapping)
+		{
+		//DSA to ui
+		//DSA to App first
+		rectInApp.iTl = aSource.iTl - dsaOffset;
+		rectInApp.iBr = aSource.iBr - dsaOffset;
+		//then app to UI
+		MapUiToApplication(rectInApp, aTarget, ETrue);
+		}
+	else
+		{
+		//Ui to DSA
+		//Ui to App first
+		MapUiToApplication(aSource, rectInApp, EFalse);
+		//then app to DSA
+		aTarget.iTl = rectInApp.iTl + dsaOffset;
+		aTarget.iBr = rectInApp.iBr + dsaOffset;
+		}
+	return KErrNone;
+	}
+TInt CDisplayPolicy::MapCoordinates(TCoordinateSpace aSourceSpace, const TRect& aSource, TCoordinateSpace aTargetSpace, TRect& aTarget) const
+	{
+	TInt returnCode=KErrNone;
+	switch (aSourceSpace)
+		{
+		case ECompositionSpace:
+			{
+			if(aTargetSpace == ECompositionSpace)
+				{
+				aTarget = aSource;
+				}
+			else if(aTargetSpace == EFullScreenSpace)
+				{
+				//composition to Ui
+				returnCode=MapCompositionToUi(aSource, aTarget, EFalse);
+				}
+			else if(aTargetSpace == EApplicationSpace)
+				{
+				//composition to App
+				TRect rectInUi;
+				returnCode=MapCompositionToUi(aSource, rectInUi, EFalse);
+				MapUiToApplication(rectInUi, aTarget, EFalse);
+				}
+			else if(aTargetSpace == EDirectScreenAccessSpace)
+				{
+				//composition to DSA
+				TRect rectInUi;
+				returnCode=MapCompositionToUi(aSource, rectInUi, EFalse);
+				if(returnCode < 0)
+					break;
+				returnCode=MapUiToDSA(rectInUi, aTarget, EFalse);
+				}
+			else
+				{
+				return KErrNotSupported;
+				}
+			}
+			break;
+		case EFullScreenSpace:
+			{
+			if(aTargetSpace == ECompositionSpace)
+				{
+				//Ui to composition
+				returnCode=MapCompositionToUi(aSource, aTarget, ETrue);
+				}
+			else if(aTargetSpace == EFullScreenSpace)
+				{
+				aTarget = aSource;
+				}
+			else if(aTargetSpace == EApplicationSpace)
+				{
+				//Ui to app
+				MapUiToApplication(aSource, aTarget, EFalse);
+				}
+			else if(aTargetSpace == EDirectScreenAccessSpace)
+				{
+				//Ui to DSA
+				returnCode = MapUiToDSA(aSource, aTarget, EFalse);
+				}
+			else
+				{
+				return KErrNotSupported;
+				}
+			}
+			break;
+		case EApplicationSpace:
+			{
+			if(aTargetSpace == ECompositionSpace)
+				{
+				//App to composition
+				TRect rectInUi;
+				MapUiToApplication(aSource, rectInUi, ETrue);
+				returnCode=MapCompositionToUi(rectInUi, aTarget, ETrue);
+				}
+			else if(aTargetSpace == EFullScreenSpace)
+				{
+				//App to Ui
+				MapUiToApplication(aSource, aTarget, ETrue);
+				}
+			else if(aTargetSpace == EApplicationSpace)
+				{
+				aTarget = aSource;
+				}
+			else if(aTargetSpace == EDirectScreenAccessSpace)
+				{
+				//App to DSA
+				TRect rectInUi;
+				MapUiToApplication(aSource, rectInUi, ETrue);
+				returnCode = MapUiToDSA(rectInUi, aTarget, EFalse);
+				}
+			else
+				{
+				return KErrNotSupported;
+				}
+			}
+			break;
+		case EDirectScreenAccessSpace:
+			{
+			if(aTargetSpace == ECompositionSpace)
+				{
+				//DSA to composition
+				TRect rectInUi;
+				returnCode = MapUiToDSA(aSource, rectInUi, ETrue);
+				if(returnCode < KErrNone)
+					break;
+				returnCode = MapCompositionToUi(rectInUi, aTarget, ETrue);
+				}
+			else if(aTargetSpace == EFullScreenSpace)
+				{
+				//DSA to Ui
+				returnCode = MapUiToDSA(aSource, aTarget, ETrue);
+				}
+			else if(aTargetSpace == EApplicationSpace)
+				{
+				//DSA to app
+				TRect rectInUi;
+				returnCode = MapUiToDSA(aSource, rectInUi, ETrue);
+				MapUiToApplication(rectInUi, aTarget, EFalse);
+				}
+			else if(aTargetSpace == EDirectScreenAccessSpace)
+				{
+				aTarget = aSource;
+				}
+			else
+				{
+				return KErrNotSupported;
+				}
+			break;
+			}
+		default:
+			returnCode= KErrNotSupported;
+		}
+	return returnCode;
+	}
+
+CDisplayPolicy::TFraction::TFraction():iNumer(0),iDenom(1)
+	{}
+
+TInt CDisplayPolicy::TFraction::operator*(TInt aInt) const
+	{
+	if (iDenom == 0 || iNumer == 0 || aInt == 0)
+		{
+		return 0;
+		}
+	TInt aNumer = iNumer<<1;
+	TInt aDenom = iDenom;
+	TInt returnValue = (aNumer*aInt)/aDenom;
+	returnValue ++;
+	return returnValue>>1;
+	}
+
+void	CDisplayPolicy::CalculateMinBufferSize(RArray<MDisplayControlBase::TResolution>& aResolutions, TInt aConnectionStatus)
+	{
+	iConnectionStatus = aConnectionStatus;
+	//preq2102: aResolutions is likely to be changed (in future)
+	if(iUiScaling == ENone)
+		{
+		//this function is currently only used with no scaling
+		//should not be called when display is disconnected
+		//with scaling iMinUiBufferSize is calculated in CDisplayPolicy::GetAppModeList()
+		TSize largestPhysicalRes = iMinUiBufferSize;		
+		for(TInt i = 0;i < aResolutions.Count(); i++)
+			{
+			if(aResolutions[i].iPixelSize.iWidth > largestPhysicalRes.iWidth)
+				{
+				largestPhysicalRes.iWidth = aResolutions[i].iPixelSize.iWidth;
+				}
+			if(aResolutions[i].iPixelSize.iHeight > largestPhysicalRes.iHeight)
+				{
+				largestPhysicalRes.iHeight = aResolutions[i].iPixelSize.iHeight;
+				}
+			}
+		
+		iMinUiBufferSize = largestPhysicalRes;
+		}
+	}
+
+void	CDisplayPolicy::AdjustStageBufferSize(const TSize& /*aOldSize*/,TSize& aNewSize)
+	{
+	if (iMinUiBufferSize.iWidth==0)
+		{
+		//just in case, should never happen
+		iMinUiBufferSize=TSize(1,1);	
+		}
+		
+	if ((aNewSize.iWidth == 0 || aNewSize.iHeight == 0
+			|| iConnectionStatus <= 0) && iUiScaling != ENone 
+			&& iSmallestAppMode >= 0) // if detached or turned off (iUiScaling != ENone) and smallestAppMode is found
+		{
+		aNewSize = iSmallestAppSize;
+		return;
+		}
+	 	 			
+	if (aNewSize.iWidth < iMinUiBufferSize.iWidth)
+		{
+		aNewSize.iWidth = iMinUiBufferSize.iWidth;
+		}
+	if (aNewSize.iHeight < iMinUiBufferSize.iHeight)
+		{
+		aNewSize.iHeight = iMinUiBufferSize.iHeight;
+		}
+	}
+
+void CDisplayPolicy::AddVirtualResolutionCount(TInt& aDisplayCount) const 
+	{
+	if (iUiScaling != ENone && aDisplayCount>0)
+		{
+		aDisplayCount += iNumNormalAppModes;
+		}
+	} 
+
+TInt CDisplayPolicy::AddVirtualResolutions(RArray<MDisplayControlBase::TResolution>& aResolutions) const
+	{
+	if (aResolutions.Count()==0 || iUiScaling == ENone)
+		{
+		return KErrNone;
+		}
+	if (aResolutions.Count()==1 && aResolutions[0].iPixelSize==TSize(0,0))
+		{
+		return KErrNone;
+		}
+		
+	TInt appModeCount = iAppModes.Count();
+	if (appModeCount == 0)
+		{
+		return KErrNone;
+		}
+	TInt resolutionCount = aResolutions.Count();
+	TInt error = aResolutions.Reserve(iNumNormalAppModes + resolutionCount);
+	if (error < KErrNone)
+		{
+		aResolutions.Reset();
+		return error;	//could fail to reserve if out of memory 
+		}
+	for (TInt appMode = 0; appMode < appModeCount; appMode++)
+		{
+		if (!(iAppModes[appMode].iFlags&(MWsScreenConfigList::EDynamic|MWsScreenConfigList::EHalDefault)))
+			{
+			MDisplayControlBase::TResolution virtualResolution = AppModeToResolution(aResolutions,appMode);
+			aResolutions.Append(virtualResolution);
+			}
+		}
+	return KErrNone;
+	}
+
+MDisplayControlBase::TResolution CDisplayPolicy::AppModeToResolution(RArray<MDisplayControlBase::TResolution>& aResolutions,TInt appMode)const
+	{
+	TAppMode mode = iAppModes[appMode];
+	TBool notComplete = ETrue;
+	TInt bestIndex;
+	TInt bestScale;
+	MDisplayControlBase::TResolution tempResolution(TSize(0,0),TSize(0,0));
+	TSize appBestSize;
+	while (notComplete)
+		{
+		TBool modeFit = FindVirtualMode(aResolutions,mode,appBestSize,bestIndex,bestScale);
+		
+		TSize uiSize;
+		if (iUiScaling == EInteger || iUiScaling == EIsotropic)
+			{
+			uiSize = ResolutionSize(aResolutions,appBestSize,bestIndex,bestScale);
+			}
+		else if (iUiScaling == EAnisotropic)
+			{
+			TBool swapAxis = EFalse;
+			TBool fitsAppMode = EFalse;
+			while (!fitsAppMode)
+				{
+				if (iAppModes[appMode].iFlags&MWsScreenConfigList::ETwipsSpecified)
+					{
+					//virtualResolution.iTwipsSize = aResolutions[bestIndex].iTwipsSize;
+					//calculate based on twips
+					uiSize = ResolutionSizeFromTwips(aResolutions,appMode,appBestSize,bestIndex,swapAxis);
+					}
+				else
+					{
+					//assume square pixels
+					//virtualResolution.iTwipsSize = aResolutions[bestIndex].iTwipsSize;
+					uiSize = ResolutionSizeFromAssumedTwips(aResolutions,appBestSize,bestIndex,swapAxis,bestScale);
+					}
+				
+				//if pixelsize found is larger than resolution mode its designed for, try scaling using other axis
+				if (uiSize.iWidth > aResolutions[bestIndex].iPixelSize.iWidth ||
+						uiSize.iHeight > aResolutions[bestIndex].iPixelSize.iHeight)
+					{
+					if (!modeFit)	//no other mode it could fit, to avoid infinite loop,say it fits the mode - will be scaled down
+						{
+						fitsAppMode = ETrue;
+						}
+					else
+						{
+						STD_ASSERT_DEBUG(swapAxis == EFalse, EPluginPanicTemp);
+						swapAxis = ETrue;
+						}
+					}
+				else
+					{
+					fitsAppMode = ETrue;
+					}
+				}
+			//if pixelsize found does not fit app mode, must retry with an appmode larger than the one found
+			if (uiSize.iWidth < iAppModes[appMode].iPixels.iBr.iX ||
+					uiSize.iHeight < iAppModes[appMode].iPixels.iBr.iY)
+				{
+				mode.iPixels.iBr.iX = aResolutions[bestIndex].iPixelSize.iWidth+1;
+				mode.iPixels.iBr.iY = aResolutions[bestIndex].iPixelSize.iHeight+1;
+				continue;
+				}
+			}
+
+		//MDisplayControlBase::TResolution virtualResolution(TSize(0,0),TSize(0,0));
+		
+		//only supports rotations supported by both sizemode and hardware
+		tempResolution.iFlags = iAppModes[appMode].iOrientations&aResolutions[bestIndex].iFlags.iFlags;
+		tempResolution.iFlags.Set(MDisplayControlBase::TResolution::EIsVirtual);
+		tempResolution.iTwipsSize = aResolutions[bestIndex].iTwipsSize;
+		tempResolution.iPixelSize = uiSize;
+
+		notComplete = EFalse;	//found a resolution that fits!
+		}
+	return tempResolution;
+	}
+
+TBool CDisplayPolicy::MatchConfigToResolutions(const RArray<MDisplayControlBase::TResolution>& aResolutions,
+		const TDisplayConfiguration& aConfig, TInt aStartIndex, TInt& aResolutionIndex)const
+	{
+	if (aStartIndex < 0 || aStartIndex >= aResolutions.Count())
+		{
+		return EFalse;
+		}
+	aResolutionIndex = -1;
+	for (TInt i = aStartIndex; i < aResolutions.Count(); i++)
+		{
+		if (aConfig.IsDefined(TDisplayConfigurationBase::EResolution))
+			{
+			TSize resolution;
+			aConfig.GetResolution(resolution);
+			if (resolution != aResolutions[i].iPixelSize)
+				{
+				continue;
+				}
+			}
+		if (aConfig.IsDefined(TDisplayConfigurationBase::EResolutionTwips))
+			{
+			TSize twips;
+			aConfig.GetResolutionTwips(twips);
+			if (twips != aResolutions[i].iTwipsSize)
+				{
+				continue;
+				}
+			}
+		
+		if (aConfig.IsDefined(TDisplayConfigurationBase::ERotation))
+			{
+			TDisplayConfiguration1::TRotation rotation;
+			aConfig.GetRotation(rotation);
+			if (aResolutions[i].iFlags.IsClear(rotation))
+				{
+				continue;
+				}
+			}
+		aResolutionIndex = i;
+		return ETrue;
+		}
+	return EFalse;
+	}
+
+/*
+	Checks if specified appmode is compatible with TResolution specified
+	Returns ETrue if succeeded (and fills aConfig with TResolution
+	Return EFalse if they are not compatible (will not touch the config) 
+*/
+TBool CDisplayPolicy::SetConfigToResolution(TInt aAppMode, MDisplayControlBase::TResolution aResolution, TDisplayConfiguration& aConfig)const
+	{
+	//find intersection of appmode and hardware rotations
+	TDisplayConfiguration1::TRotation configRotation;
+	TInt compatibleRotations;
+	if (aConfig.GetRotation(configRotation))
+		{
+		compatibleRotations = iAppModes[aAppMode].iOrientations&aResolution.iFlags.iFlags&0xF&(1<<configRotation);
+		}
+	else
+		{
+		compatibleRotations = iAppModes[aAppMode].iOrientations&aResolution.iFlags.iFlags&0xF;
+		}
+
+	if (compatibleRotations > 0)
+		{	//set first compatible rotation we find
+		if (1<<CFbsBitGc::EGraphicsOrientationNormal & compatibleRotations)
+			{
+			aConfig.SetRotation(TDisplayConfiguration1::ERotationNormal);
+			}
+		else if (1<<CFbsBitGc::EGraphicsOrientationRotated90 & compatibleRotations)
+			{
+			aConfig.SetRotation(TDisplayConfiguration1::ERotation90CW);
+			}
+		else if (1<<CFbsBitGc::EGraphicsOrientationRotated180 & compatibleRotations)
+			{
+			aConfig.SetRotation(TDisplayConfiguration1::ERotation180);
+			}
+		else
+			{
+			aConfig.SetRotation(TDisplayConfiguration1::ERotation270CW);
+			}
+		aConfig.SetResolution(aResolution.iPixelSize);
+		aConfig.SetResolutionTwips(aResolution.iTwipsSize);
+		return ETrue;
+		}
+
+	return EFalse;
+	}
+
+TInt CDisplayPolicy::GetSizeModeConfiguration(RArray<MDisplayControlBase::TResolution>& aResolutions,
+		TInt aScreenSizeMode, TDisplayConfiguration& aConfig, TRect& aSizeModePosition) const
+	{
+	//find appMode corresponding to screensizemode
+	TInt appMode;
+	TInt appModeCount = iAppModes.Count();
+	for (appMode = 0; appMode < appModeCount; appMode++)
+		{
+		if (iAppModes[appMode].iModeIndex == aScreenSizeMode)
+			{
+			break;
+			}
+		}
+	if (appModeCount == appMode)
+		{
+		return KErrArgument;	//invalid screen size mode
+		}
+	if (!aConfig.IsDefined(TDisplayConfigurationBase::EResolution)&&
+			!aConfig.IsDefined(TDisplayConfigurationBase::EResolutionTwips))
+		{
+		if (iAppModes[appMode].iFlags&MWsScreenConfigList::EDynamic)
+			{
+			TSize resSize = iCompositionSizePixels;
+			TSize twipsSize = iCompositionSizeTwips;
+			if (iLastCompositionRotation&TDisplayConfiguration::ERotation90CW ||
+					iLastCompositionRotation&TDisplayConfiguration::ERotation270CW)
+				{
+				TInt tempVal = resSize.iWidth;
+				resSize.iWidth = resSize.iHeight;
+				resSize.iHeight = tempVal;
+				tempVal = twipsSize.iWidth;
+				twipsSize.iWidth = twipsSize.iHeight;
+				twipsSize.iHeight = tempVal;
+				}
+			aConfig.SetResolution(resSize);
+			aConfig.SetResolutionTwips(twipsSize);
+			}
+		else
+			{
+			MDisplayControlBase::TResolution virtualResolution = AppModeToResolution(aResolutions,appMode);
+			aConfig.SetResolution(virtualResolution.iPixelSize);
+			aConfig.SetResolutionTwips(virtualResolution.iTwipsSize);
+			}
+		}
+
+	//check config is valid from set of resolutions (inc virtual)
+	TInt error = AddVirtualResolutions(aResolutions);
+	if (error < KErrNone)
+		{
+		return error;
+		}
+	TInt startIndex=0;
+	while (startIndex < aResolutions.Count())
+		{
+		TInt resolutionIndex;
+		TBool boolError = MatchConfigToResolutions(aResolutions,aConfig,startIndex,resolutionIndex);
+		if (boolError == EFalse)
+			{
+			return KErrArgument;
+			}
+		
+		//if is larger than current app mode and same rotation,we have found a match and can break;
+		TBool boolSet = SetConfigToResolution(appMode,aResolutions[resolutionIndex],aConfig);
+		if (boolSet)
+			{	//new configuration is compatible with app mode and has been set
+			//center appmode within the UI
+			if (iAppModes[appMode].iFlags&MWsScreenConfigList::EDynamic)
+				{
+				aSizeModePosition = aResolutions[resolutionIndex].iPixelSize;
+				}
+			else
+				{
+				CenteredAppInUi(aResolutions[resolutionIndex].iPixelSize,iAppModes[appMode].iPixels,aSizeModePosition);
+				}
+			
+			TDisplayConfiguration::TRotation tempRot;
+			aConfig.GetRotation(tempRot);
+			if (tempRot&1)
+				{
+				aSizeModePosition = TRect(aSizeModePosition.iTl.iY,aSizeModePosition.iTl.iX,
+						aSizeModePosition.iBr.iY,aSizeModePosition.iBr.iX);
+				}
+
+			return KErrNone;
+			}
+		//otherwise
+		startIndex = resolutionIndex+1;	//match found will not fit current size mode, continue looking
+		if (startIndex == aResolutions.Count())
+			{
+			return KErrArgument;
+			}
+		}
+	STD_ASSERT_DEBUG(EFalse, EPluginPanicTemp);
+	return KErrGeneral;	//shouldnt be able to get here
+	}
+
+void CDisplayPolicy::CenteredAppInUi(const TSize& aUiSize,const TRect& aAppExtent,TRect& aSizeModePosition) const
+	{
+	if (aUiSize.iWidth > aAppExtent.Width())
+		{
+		aSizeModePosition.iTl.iX = (aUiSize.iWidth - aAppExtent.Width()) / 2;
+		if (aSizeModePosition.iTl.iX < aAppExtent.iTl.iX)
+			{	//we want to obey screenmode offset as a minumum, so cannot center on this axis
+			aSizeModePosition.iTl.iX = aAppExtent.iTl.iX;
+			aSizeModePosition.iBr.iX = aAppExtent.iBr.iX;
+			}
+		else
+			{
+			aSizeModePosition.iBr.iX = aSizeModePosition.iTl.iX + aAppExtent.Width();
+			}
+		}
+	else
+		{
+		aSizeModePosition.iTl.iX = aAppExtent.iTl.iX;
+		aSizeModePosition.iBr.iX = aAppExtent.iBr.iX;
+		}
+	
+	if (aUiSize.iHeight > aAppExtent.Height())
+		{
+		aSizeModePosition.iTl.iY = (aUiSize.iHeight - aAppExtent.Height()) / 2;
+		if (aSizeModePosition.iTl.iY < aAppExtent.iTl.iY)
+			{	//we want to obey screenmode offset as a minumum, so cannot center on this axis
+			aSizeModePosition.iTl.iY = aAppExtent.iTl.iY;
+			aSizeModePosition.iBr.iY = aAppExtent.iBr.iY;
+			}
+		else
+			{
+			aSizeModePosition.iBr.iY = aSizeModePosition.iTl.iY + aAppExtent.Width();
+			}
+		}
+	else
+		{
+		aSizeModePosition.iTl.iY = aAppExtent.iTl.iY;
+		aSizeModePosition.iBr.iY = aAppExtent.iBr.iY;
+		}
+	}
+
+TInt CDisplayPolicy::GetSizeModeConfiguration(TInt aScreenSizeMode,TDisplayConfiguration& aConfig, TRect& aSizeModePosition)
+	{
+	//This function is used when display is disconnected. Set UI size same as app mode. We don't care about rotation
+	
+	//find appMode corresponding to screensizemode
+	TInt appMode;
+	TInt appModeCount = iAppModes.Count();
+	for (appMode = 0; appMode < appModeCount; appMode++)
+		{
+		if (iAppModes[appMode].iModeIndex == aScreenSizeMode)
+			{
+			break;
+			}
+		}
+	if (appModeCount == appMode)
+		{
+		return KErrArgument;	//invalid screen size mode
+		}
+	
+	if (1<<CFbsBitGc::EGraphicsOrientationRotated90&iAppModes[appMode].iOrientations 
+			|| 1<<CFbsBitGc::EGraphicsOrientationRotated270&iAppModes[appMode].iOrientations)
+		{//width and height were already flipped on construction. we need to flip it back
+		TRect appRect = iAppModes[appMode].iPixels;
+		TRect uiResRect(appRect.iTl.iX, appRect.iTl.iY, appRect.iBr.iY, appRect.iBr.iX);
+		aConfig.SetResolution(uiResRect.Size());
+		}
+	else
+		{
+		aConfig.SetResolution(iAppModes[appMode].iPixels.iBr.AsSize());
+		}
+	
+	CFbsBitGc::TGraphicsOrientation cFbsOrientation=CFbsBitGc::EGraphicsOrientationNormal;
+	//we know aScreenSizeMode is valid-OrientationL wont leave
+	TRAP_IGNORE(cFbsOrientation=iScreen->ObjectInterface<MWsScreenConfigList>()->OrientationL(aScreenSizeMode));
+	aConfig.SetRotation(TDisplayConfiguration::TRotation(cFbsOrientation));
+	aSizeModePosition = iAppModes[appMode].iPixels;
+	return KErrNone;
+	}
+
+TBool CDisplayPolicy::SettingConfiguration(const RArray<MDisplayControlBase::TResolution>& aResolutions,TDisplayConfiguration& aConfig)const
+	{	//converts configuration to appmode
+	if (iUiScaling == ENone)
+		{
+		if (aConfig.IsDefined(aConfig.EResolution))
+			{
+			TSize res;
+			aConfig.GetResolution(res);
+			TInt index;
+			for (index=0;index<aResolutions.Count();index++)
+				{
+				if  (aResolutions[index].iPixelSize == res)
+					{
+					break;
+					}
+				}
+			if (index == aResolutions.Count())
+				{	//failed to validate the resolution
+				aConfig.Clear(aConfig.EResolution);
+				}
+			}
+		return EFalse;
+		}
+	
+	
+	TAppMode appMode;
+	
+	TBool set;
+	TRect zeroRect (0,0,0,0);
+	TSize zeroSize (0,0);
+	TSize size;
+	set = aConfig.GetResolution(size);
+	appMode.iPixels = set ? size : zeroRect;
+	
+	set = aConfig.GetResolutionTwips(size);
+	appMode.iTwips = set ? size : zeroSize;
+	TDisplayConfiguration::TRotation flags;
+	set = aConfig.GetRotation(flags);	//grr orientation again
+	appMode.iOrientations = set? flags : 0;	//will set the specific rotation
+	
+	TInt index=0;
+	TInt scale=0;
+	TSize bestAppSize;
+	FindVirtualMode(aResolutions,appMode,bestAppSize,index,scale);
+	
+	//set aConfig to resolution returned
+	aConfig.SetResolution(aResolutions[index].iPixelSize);
+	aConfig.SetResolutionTwips(aResolutions[index].iTwipsSize);
+	if (aResolutions[index].iFlags.IsSet(MDisplayControlBase::TResolution::ERotationNormalSupported)
+			&& appMode.iOrientations == TDisplayConfiguration::ERotationNormal)
+		{
+		aConfig.SetRotation(TDisplayConfiguration1::ERotationNormal);
+		}
+	else if (aResolutions[index].iFlags.IsSet(MDisplayControlBase::TResolution::ERotation90Supported)
+			&& appMode.iOrientations == TDisplayConfiguration::ERotation90CW)
+		{
+		aConfig.SetRotation(TDisplayConfiguration1::ERotation90CW);
+		}
+	else if (aResolutions[index].iFlags.IsSet(MDisplayControlBase::TResolution::ERotation180Supported)
+			&& appMode.iOrientations == TDisplayConfiguration::ERotation180)
+		{
+		aConfig.SetRotation(TDisplayConfiguration1::ERotation180);
+		}
+	else if (aResolutions[index].iFlags.IsSet(MDisplayControlBase::TResolution::ERotation270Supported)
+			&& appMode.iOrientations == TDisplayConfiguration::ERotation270CW)
+		{
+		aConfig.SetRotation(TDisplayConfiguration1::ERotation270CW);
+		}
+	else
+		{
+		STD_ASSERT_DEBUG(EFalse, EPluginPanicTemp);
+		return EFalse;	
+		}
+	return ETrue;
+	}
+
+void CDisplayPolicy::SetCompositionInfo (const TDisplayConfiguration& aCompositionConfig,
+		const TDisplayConfiguration& aUiConfig)
+	{
+	TDisplayConfiguration::TRotation rotation;
+	TSize sizePixels;
+	TSize sizeTwips;
+	if (aCompositionConfig.GetResolution(sizePixels))
+		{
+		aCompositionConfig.GetResolutionTwips(sizeTwips);
+		if(aCompositionConfig.IsDefined(TDisplayConfiguration::ERotation))
+			{
+			aCompositionConfig.GetRotation(rotation);
+			iLastCompositionRotation=rotation;
+			if(rotation & TDisplayConfiguration::ERotation90CW)
+				{
+				//swap width and height to be stored in iCompositionSizePixels and iCompositionSizeTwips
+				iCompositionSizePixels.iHeight = sizePixels.iWidth;
+				iCompositionSizePixels.iWidth = sizePixels.iHeight;
+				iCompositionSizeTwips.iHeight = sizeTwips.iWidth;
+				iCompositionSizeTwips.iWidth = sizeTwips.iHeight;
+				}
+			else
+				{
+				iCompositionSizePixels = sizePixels;
+				iCompositionSizeTwips = sizeTwips;
+				}
+			}
+		else
+			{
+			iCompositionSizePixels = sizePixels;
+			iCompositionSizeTwips = sizeTwips;
+			}
+		
+		aUiConfig.GetResolution(sizePixels);
+		aUiConfig.GetResolutionTwips(sizeTwips);
+		if(aUiConfig.IsDefined(TDisplayConfiguration::ERotation))
+			{
+			aUiConfig.GetRotation(rotation);
+			iLastUiRotation=rotation;
+			if(rotation & TDisplayConfiguration::ERotation90CW)
+				{
+				//swap width and height to be stored in iUiSizePixels and iAppSizeTwips
+				iUiSizePixels.iHeight = sizePixels.iWidth;
+				iUiSizePixels.iWidth = sizePixels.iHeight;
+				iAppSizeTwips.iHeight = sizeTwips.iWidth;
+				iAppSizeTwips.iWidth = sizeTwips.iHeight;
+				}
+			else
+				{
+				iUiSizePixels = sizePixels;
+				iAppSizeTwips = sizeTwips;
+				}
+			}
+		else
+			{
+			iUiSizePixels = sizePixels;
+			iAppSizeTwips = sizeTwips;
+			}	
+		}
+	else
+		{
+		if (aUiConfig.GetRotation(rotation))
+			{
+			if ((rotation^iLastUiRotation)&TDisplayConfiguration::ERotation90CW)
+				{
+				TInt swapHeight=iUiSizePixels.iHeight;
+				iUiSizePixels.iHeight = iUiSizePixels.iWidth;
+				iUiSizePixels.iWidth = swapHeight;
+				}
+			iLastUiRotation=rotation;
+			}
+		
+		if (aCompositionConfig.GetRotation(rotation))
+			{
+			if ((rotation^iLastCompositionRotation)&TDisplayConfiguration::ERotation90CW)
+				{
+				TInt swapHeight=iCompositionSizePixels.iHeight;
+				iCompositionSizePixels.iHeight = iCompositionSizePixels.iWidth;
+				iCompositionSizePixels.iWidth = swapHeight;
+				swapHeight=iCompositionSizeTwips.iHeight;
+				iCompositionSizeTwips.iHeight = iCompositionSizeTwips.iWidth;
+				iCompositionSizeTwips.iWidth = swapHeight;
+				}
+			iLastCompositionRotation=rotation;
+			}
+		}
+	}
+
+void CDisplayPolicy::SetSizeModeExtent(TRect& aExtent, TBitFlags32 /*aContext*/)
+	{
+	iAppSizePixels = aExtent;
+	}
+
+/**	Finds the best resolution that the specified appmode can fit into
+	Returns ETrue if it fits a mode
+	Returns EFalse to warn if it didnt fit in that mode
+	For both, it will set index and scale to the best fit
+*/
+TBool CDisplayPolicy::FindVirtualMode(const RArray<MDisplayControlBase::TResolution>& aResolutions,
+		const CDisplayPolicy::TAppMode& aAppMode,TSize& aFullAppModeSize,TInt& aIndex,TInt& aBestScale) const
+	{
+	const TInt KBestFit = 0x7000000; //a really big number that should get reduced during the search.
+	TInt bestFit=KBestFit;
+	TInt resDiffX;
+	TInt resDiffY;
+	TInt64 biggestArea(0);
+	TInt biggestAreaIndex=0;
+	TBool fullAppSize;
+	
+	if (aAppMode.iPixels.iTl.iX == 0 && aAppMode.iPixels.iTl.iY == 0)
+		{	//no point trying again with a border on only 2 sides, as there is no border anyway!
+		fullAppSize = EFalse;
+		}
+	else
+		{
+		fullAppSize = ETrue;
+		}
+	aFullAppModeSize = TSize(aAppMode.iPixels.iBr.iX + aAppMode.iPixels.iTl.iX,
+			aAppMode.iPixels.iBr.iY + aAppMode.iPixels.iTl.iY);	//try fitting with border all 4 sides
+
+	while(1)
+		{
+		//find hardware mode that fits this best
+		for (TInt j = 0; j < aResolutions.Count(); j++)
+			{
+			if (bestFit == 0)
+				{	//found a perfect match
+				break;
+				}
+			if (aResolutions[j].iFlags[MDisplayControlBase::TResolution::EIsVirtual])
+				{	//ignore virtual resolutions
+				continue;
+				}
+			TInt maxScaling = 1;
+			if (iUiScaling == EInteger)
+				{
+				maxScaling = 4;
+				}
+			for (TInt k = maxScaling; k > 0; k--)
+				{	//for every avalable integer scale
+				if (bestFit == 0)
+					{	//found a perfect match
+					break;
+					}
+				TInt64 area=TInt64(aResolutions[j].iPixelSize.iWidth)*aResolutions[j].iPixelSize.iHeight;
+				if (area>biggestArea)
+					{
+					biggestArea=area;
+					biggestAreaIndex=j;
+					}
+				resDiffX = (aResolutions[j].iPixelSize.iWidth/k) - aFullAppModeSize.iWidth;
+				resDiffY = (aResolutions[j].iPixelSize.iHeight/k) - aFullAppModeSize.iHeight;
+
+				if (resDiffX < 0 || resDiffY < 0)
+					{	//app mode too large for this resolution
+					continue;
+					}
+				if (resDiffX+resDiffY < bestFit)
+					{
+					aIndex = j;
+					bestFit =  resDiffX + resDiffY;
+					aBestScale = k;
+					continue;
+					}
+				}
+			}
+		if (bestFit != KBestFit)
+			{	//it found the best resolution to scale into
+			break;
+			}
+		else if (fullAppSize == EFalse)
+			{	//app does not fit any resolution, it will have to be scaled down to fit
+			aIndex=biggestAreaIndex;
+			aBestScale=1;
+			return EFalse;
+			}
+		else
+			{
+			aFullAppModeSize = TSize(aAppMode.iPixels.iBr.iX,
+					aAppMode.iPixels.iBr.iY);	//try fitting with border only top and left
+			fullAppSize = EFalse;
+			}
+		}
+	return ETrue;
+	}
+
+TSize CDisplayPolicy::ResolutionSize(RArray<MDisplayControlBase::TResolution>& aResolutions,
+		const TSize aBestAppSize,TInt aIndex, TInt aScale) const
+	{
+	TSize returnSize;
+	
+	if (iUiScaling == EInteger)	//only supporting integral scales
+		{	//just calculate the scaled resolution
+		returnSize = TSize(aResolutions[aIndex].iPixelSize.iWidth/aScale,
+				aResolutions[aIndex].iPixelSize.iHeight/aScale);
+		}
+	else
+		{	//find which axis scales best, create virtual resolution that fits this axis
+		TFraction bestAxisAsFraction;
+
+		if ((TInt64)aResolutions[aIndex].iPixelSize.iWidth * aBestAppSize.iHeight > 
+				(TInt64)aResolutions[aIndex].iPixelSize.iHeight * aBestAppSize.iWidth)
+			{	//y axis scales closest
+			bestAxisAsFraction.iNumer = aResolutions[aIndex].iPixelSize.iWidth;
+			bestAxisAsFraction.iDenom = aResolutions[aIndex].iPixelSize.iHeight;
+			returnSize = TSize(bestAxisAsFraction*aBestAppSize.iHeight,
+					aBestAppSize.iHeight);
+			}
+		else
+			{	//x axis scales closest
+			bestAxisAsFraction.iNumer = aResolutions[aIndex].iPixelSize.iHeight;
+			bestAxisAsFraction.iDenom = aResolutions[aIndex].iPixelSize.iWidth;
+			returnSize = TSize(aBestAppSize.iWidth,
+					bestAxisAsFraction*aBestAppSize.iWidth);
+			}
+		}
+	return returnSize;
+	}
+
+TSize CDisplayPolicy::GetUiResolution()
+	{
+	return this->iUiSizePixels;
+	}
+
+TSize CDisplayPolicy::GetUiResolutionAsTwips() const
+    {
+    return this->iCompositionSizeTwips;
+    }
+
+TRect CDisplayPolicy::GetPolicyAppMode()
+	{
+	return iAppSizePixels;
+	}
+
+TSize CDisplayPolicy::ResolutionSizeFromTwips(RArray<MDisplayControlBase::TResolution>& aResolutions, TInt aAppMode, const TSize& aBestAppSize,
+		TInt aIndex,TBool aSwapAxis) const
+	{
+	TSize returnSize;
+	TFraction tempFraction;
+	TBool yScalesClosest;
+	
+	if ((TInt64)aResolutions[aIndex].iPixelSize.iWidth * aBestAppSize.iHeight > (TInt64)aResolutions[aIndex].iPixelSize.iHeight * aBestAppSize.iWidth)
+		{	//y axis scales closest
+		yScalesClosest = aSwapAxis?EFalse:ETrue;
+		}
+	else
+		{	//x axis scales closest
+		yScalesClosest = aSwapAxis?ETrue:EFalse;
+		}
+	
+	if (yScalesClosest)
+		{	//y axis scales closest
+		tempFraction.iNumer = aBestAppSize.iHeight;	//bordered app height in pixels
+		tempFraction.iDenom = iAppModes[aAppMode].iPixels.iBr.iY - iAppModes[aAppMode].iPixels.iTl.iY;	//app height in pixels
+		TInt uiYTwips=tempFraction*iAppModes[aAppMode].iTwips.iHeight;	//bordered app height in twips
+		
+		tempFraction.iNumer = aResolutions[aIndex].iTwipsSize.iWidth;	//display width in twips
+		tempFraction.iDenom = aResolutions[aIndex].iTwipsSize.iHeight;	//display height in twips
+		TInt uiXTwips=tempFraction*uiYTwips;	//virtual width in twips
+		
+		tempFraction.iNumer = iAppModes[aAppMode].iPixels.iBr.iX - iAppModes[aAppMode].iPixels.iTl.iX;	//app width in pixels
+		tempFraction.iDenom = iAppModes[aAppMode].iTwips.iWidth;	//display width in twips
+		TInt uiXPixels=tempFraction*uiXTwips;	//virtual width in pixels
+		
+		returnSize.iWidth = uiXPixels;
+		returnSize.iHeight = aBestAppSize.iHeight;
+		}
+	else
+		{	//x axis scales closest
+		tempFraction.iNumer = aBestAppSize.iWidth;	//bordered app width in pixels
+		tempFraction.iDenom = iAppModes[aAppMode].iPixels.iBr.iX - iAppModes[aAppMode].iPixels.iTl.iX;	//app width in pixels
+		TInt uiXTwips=tempFraction*iAppModes[aAppMode].iTwips.iWidth;	//bordered app width in twips
+		
+		tempFraction.iNumer = aResolutions[aIndex].iTwipsSize.iHeight;	//display height in twips
+		tempFraction.iDenom = aResolutions[aIndex].iTwipsSize.iWidth;	//display width in twips
+		TInt uiYTwips=tempFraction*uiXTwips;	//virtual height in twips
+		
+		tempFraction.iNumer = iAppModes[aAppMode].iPixels.iBr.iY - iAppModes[aAppMode].iPixels.iTl.iY;	//app height in pixels
+		tempFraction.iDenom = iAppModes[aAppMode].iTwips.iHeight;	//display height in twips
+		TInt uiYPixels=tempFraction*uiYTwips;	//virtual width in pixels
+		
+		returnSize.iWidth = aBestAppSize.iWidth;
+		returnSize.iHeight = uiYPixels;
+		}
+	
+	return returnSize;
+	}
+
+TSize CDisplayPolicy::ResolutionSizeFromAssumedTwips(RArray<MDisplayControlBase::TResolution>& aResolutions,const TSize& aBestAppSize,
+		TInt aIndex,TBool aSwapAxis, TInt aScale) const
+	{
+	TSize returnSize;
+	
+	if (iUiScaling == EInteger)	//only supporting integral scales
+		{	//just calculate the scaled resolution
+		returnSize = TSize(aResolutions[aIndex].iTwipsSize.iWidth/aScale,
+				aResolutions[aIndex].iTwipsSize.iHeight/aScale);
+		}
+	else
+		{	//find which axis scales best, create virtual resolution that fits this axis
+		TBool yScalesClosest;
+		TFraction bestAxisAsFraction;
+		
+		if ((TInt64)aResolutions[aIndex].iPixelSize.iWidth * aBestAppSize.iHeight > 
+				(TInt64)aResolutions[aIndex].iPixelSize.iHeight * aBestAppSize.iWidth)
+			{	//y axis scales closest
+			yScalesClosest = aSwapAxis?EFalse:ETrue;
+			}
+		else
+			{	//x axis scales closest
+			yScalesClosest = aSwapAxis?ETrue:EFalse;
+			}
+		
+		if (yScalesClosest)
+			{	//y axis scales closest
+			bestAxisAsFraction.iNumer = aResolutions[aIndex].iTwipsSize.iWidth;
+			bestAxisAsFraction.iDenom = aResolutions[aIndex].iTwipsSize.iHeight;
+			returnSize = TSize(bestAxisAsFraction*aBestAppSize.iHeight,
+					aBestAppSize.iHeight);
+			}
+		else
+			{	//x axis scales closest
+			bestAxisAsFraction.iNumer = aResolutions[aIndex].iTwipsSize.iHeight;
+			bestAxisAsFraction.iDenom = aResolutions[aIndex].iTwipsSize.iWidth;
+			returnSize = TSize(aBestAppSize.iWidth,
+					bestAxisAsFraction*aBestAppSize.iWidth);
+			}
+		}
+	return returnSize;
+	}
+
+TInt CDisplayPolicy::MinSizedModeIndex()
+	{
+	return iSmallestAppMode;
+	}
+
+TInt CDisplayPolicy::SuitableAppMode(MWsDisplayPolicy::TDisplayStatus aSituation)
+	{
+	switch(aSituation)
+		{
+		case MWsDisplayPolicy::EAttach:
+			{
+			return iLastAppMode;
+			}
+		case MWsDisplayPolicy::EDetach:
+			{
+			return MinSizedModeIndex();
+			}
+		default:
+			return KErrNotSupported;
+		}
+
+	}
+
+void CDisplayPolicy::SetLastAppMode(TInt aMode)
+	{
+	iLastAppMode = aMode;
+	}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/src/displayrenderstage.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1207 @@
+// 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 "displayrenderstage.h"
+#include <graphics/wselement.h>
+#include <hal.h>
+#include "openwfcwrapper.h"
+#include "panic.h"
+#include "utils.h"
+#include "rsdisplaychangeao.h"
+#include <graphics/wsdisplaycontrol.h>
+#include <graphics/wsdisplaymapping.h>
+#include <graphics/wsdisplaypolicy.h>
+#include "screencaptureutil.h"
+#include "elementwrapper.h"
+#include "alfdecoderserverclient.h"
+#include "huiwscanvascommands.h"
+
+#include "alflogger.h"
+
+CDisplayRenderStage* CDisplayRenderStage::NewL(MWsGraphicDrawerEnvironment* aEnv,MWsScreen* aScreen, TInt aScreenNumber)
+    {
+    CDisplayRenderStage* stage = new(ELeave) CDisplayRenderStage(aScreenNumber);
+    CleanupStack::PushL(stage);
+    stage->ConstructL(aEnv, aScreen, aScreenNumber);
+    CleanupStack::Pop(stage);
+    return stage;
+    }
+
+CDisplayRenderStage::CDisplayRenderStage(TInt aScreenNumber)
+    : iScreenNumber(aScreenNumber)
+    {
+    }
+    
+CDisplayRenderStage::~CDisplayRenderStage()
+    {
+    iSurfaceUpdateSession.Close();
+    iUpdateRegion = NULL;
+    delete iDispNotifier;
+    delete iConfigNotifier;
+    delete iDisplayPolicy;
+    delete iOpenWfcWrapper;
+    delete iScreenCaptureUtil;
+    }
+
+void CDisplayRenderStage::ConstructL(MWsGraphicDrawerEnvironment* aEnv, MWsScreen* aScreen, TInt aScreenNumber)
+    {
+    BaseConstructL();
+    
+    MWsIniFile* iniFile = aEnv->ObjectInterface<MWsIniFile>();
+    STD_ASSERT_ALWAYS(iniFile, EPluginPanicIniFileMissing);
+
+    //Initialise display policy and strategy segments
+    iDisplayPolicy = CDisplayPolicy::NewL(aEnv,aScreen, aScreenNumber);
+    iDisplayPolicyEnabled = iDisplayPolicy->PolicyEnabled();
+    // initialize compositor
+    iOpenWfcWrapper = COpenWfcWrapper::NewL(aScreenNumber, iDisplayPolicy);
+    iOpenWfcWrapperDisplayControl = iOpenWfcWrapper->GetInterface<MWsDisplayControl>();
+    if(iOpenWfcWrapperDisplayControl)
+        {
+        iDispNotifier = CRsDisplayChangeNotifier::NewL(iOpenWfcWrapperDisplayControl, iDisplayPolicy);  
+        iDispNotifier->IssueNotificationRequest();
+        iConfigNotifier = CRsConfigChangeNotifier::NewL(iOpenWfcWrapperDisplayControl);
+        iConfigNotifier->IssueNotificationRequest();
+        
+        //calculate min UI buffer size depending on physical resolutions
+        TInt ret = iOpenWfcWrapperDisplayControl->NumberOfResolutions();
+        RArray<MDisplayControlBase::TResolution> resolutions;
+        CleanupClosePushL(resolutions);
+        if(ret > 0)
+            {
+            User::LeaveIfError(resolutions.Reserve(ret));
+            User::LeaveIfError(iOpenWfcWrapperDisplayControl->GetResolutions(resolutions));
+            }
+        iDisplayPolicy->CalculateMinBufferSize(resolutions, ret);               
+        CleanupStack::PopAndDestroy(&resolutions);
+        }
+        
+    TSize screenSize = iOpenWfcWrapper->ScreenSize();
+    iDisplayPolicy->AdjustStageBufferSize(TSize(0,0), screenSize);
+    
+    User::LeaveIfError(iSurfaceUpdateSession.Connect());
+    
+    TDisplayConfiguration displayConfig;
+    if(iOpenWfcWrapperDisplayControl)
+        {
+        iOpenWfcWrapper->GetConfiguration(displayConfig);
+        }
+    else
+        {
+        displayConfig.SetResolution(SizeInPixels());    // Both getters eventually reach RDisplayChannel
+        displayConfig.SetResolutionTwips(SizeInTwips());// as iOpenWfcWrapper->GetConfiguration does
+        const MWsScene::TSceneRotation rotation = iOpenWfcWrapper->ScreenRotation();
+        displayConfig.SetRotation(static_cast<TDisplayConfiguration::TRotation>(rotation));
+        }
+    iDisplayPolicy->SetCompositionInfo(displayConfig,displayConfig);    //1 to 1 mapping
+    }
+
+TAny* CDisplayRenderStage::ResolveObjectInterface(TUint aTypeId)
+    {
+    switch(aTypeId)
+        {
+    case MWsScreenDevice::EWsObjectInterfaceId:
+        return static_cast<MWsScreenDevice*>(this);
+    case MWsScene::EWsObjectInterfaceId:
+        return static_cast<MWsScene*>(this);
+    case MWsDisplayControl::EWsObjectInterfaceId:
+//#ifndef FAKE_DISPLAY_CONFIGURATION_FOR_SINGLE_DISPLAY
+//      if (iOpenWfcWrapperDisplayControl)
+//#endif
+//          {   //only support the interface if the compositor does
+                //otherwise we need to fake single-element support.
+            return static_cast<MWsDisplayControl*>(this);
+//          }
+//      break;
+    case MWsDisplayMapping::EWsObjectInterfaceId:
+        return static_cast<MWsDisplayMapping*>(this);
+    case MWsWindowTreeObserver::EWsObjectInterfaceId:
+        return static_cast<MWsWindowTreeObserver*>(this);
+    case KAlfCompositionControllerIfUid:
+        return static_cast<MAlfCompositionController*>(this);    
+    case MWsDisplayPolicy::EWsObjectInterfaceId:
+            {
+            if (iDisplayPolicyEnabled)
+                {
+                return static_cast<MWsDisplayPolicy*>(this);
+                }
+            else
+                {
+                return NULL;
+                }
+            }   
+        }
+
+    return CWsRenderStage::ResolveObjectInterface(aTypeId);
+    }
+
+void CDisplayRenderStage::Begin(const TRegion* aRegion)
+    {
+    STD_ASSERT_DEBUG(!aRegion || !aRegion->CheckError(), EPluginPanicRegionError);
+    iUpdateRegion = aRegion;
+    iOpenWfcWrapper->Begin(aRegion);
+    }
+    
+void CDisplayRenderStage::End(TRequestStatus* aFinished)
+    {
+  if (!iOpenWfcWrapper->CompositionDue() && aFinished) 
+      {
+        // No re-composition required and the update region is empty.
+      // Signal that we are ready for more updates.
+        *aFinished = KRequestPending;
+        User::RequestComplete(aFinished, KErrNone);
+        }
+   else
+      {
+      iOpenWfcWrapper->Compose(aFinished);
+      }
+    
+    iOpenWfcWrapper->End();
+    iUpdateRegion = NULL;
+    }
+
+TInt CDisplayRenderStage::ScreenNumber() const
+    {
+    return iScreenNumber;
+    }
+
+TDisplayMode CDisplayRenderStage::DisplayMode() const
+    {
+    return EColor16MAP;//iRenderTarget->DisplayMode();
+    }
+
+TSize CDisplayRenderStage::SizeInPixels() const
+    {
+    TSize size(0, 0);
+    if (iOpenWfcWrapperDisplayControl)
+        {
+        size=iDisplayPolicy->GetUiResolution();
+        }
+    return size;
+    }
+
+TSize CDisplayRenderStage::SizeInTwips() const
+    {  
+    if (iOpenWfcWrapperDisplayControl)
+        {
+        TSize size(0, 0);
+        size = iDisplayPolicy->GetUiResolutionAsTwips();
+        if (size.iWidth)
+            {
+            return size;
+            }     
+        }
+    const TSize size = SizeInPixels();
+    const MWsScene::TSceneRotation screenRotation = iOpenWfcWrapper->ScreenRotation();
+    const TBool rotated = (screenRotation == ESceneAntiClockwise90 || screenRotation == ESceneAntiClockwise270);
+    
+    TInt twips = 0;
+    TInt res = HAL::Get(iScreenNumber, rotated ? HALData::EDisplayYTwips : HALData::EDisplayXTwips,twips);
+    __ASSERT_DEBUG(res==KErrNone && twips!=0, Panic(EPluginPanicSizeInTwipsFailed));
+    const TInt horzTwipsPerThousandPixels = twips * 1000 / size.iWidth; 
+    const TInt horzSizeInTwips = (horzTwipsPerThousandPixels * size.iWidth + 500) / 1000;
+    
+    twips = 0;
+    res = HAL::Get(iScreenNumber, rotated ? HALData::EDisplayXTwips : HALData::EDisplayYTwips,twips);
+    __ASSERT_DEBUG(res==KErrNone && twips!=0, Panic(EPluginPanicSizeInTwipsFailed));
+    const TInt vertTwipsPerThousandPixels = twips * 1000 / size.iHeight; 
+    const TInt vertSizeInTwips = (vertTwipsPerThousandPixels * size.iHeight + 500) / 1000;
+
+    return TSize (horzSizeInTwips, vertSizeInTwips);
+    }
+
+TRect CDisplayRenderStage::PointerRect() const
+    {
+    if (iScreenNumber != 0)
+        {
+        return TRect();  // Only screen 0 supports a digitizer
+        }
+
+    TMachineInfoV1Buf macInfo;
+    UserHal::MachineInfo(macInfo);
+    return TRect(-macInfo().iOffsetToDisplayInPixels, macInfo().iXYInputSizeInPixels);    
+    }
+
+void CDisplayRenderStage::GetPixel(TRgb& /*aColor*/, const TPoint& /*aPixel*/) const
+    {
+    //iRenderTarget->GetPixel(aColor, aPixel);
+    }
+
+void CDisplayRenderStage::GetScanLine(TDes8& /*aScanLine*/, const TPoint& /*aStartPixel*/, TInt /*aPixelLength*/, TDisplayMode /*aDispMode*/) const
+    {
+    //iRenderTarget->GetScanLine(aScanLine, aStartPixel, aPixelLength, aDispMode);
+    }
+
+TBool CDisplayRenderStage::RectCompare(const TRect& /*aRect1*/, const TRect& /*aRect2*/) const
+    {
+    return EFalse;//iRenderTarget->RectCompare(aRect1, aRect2);
+    }
+
+void doDynamicCaptureL(CDisplayRenderStage* aThis, CFbsBitmap* aBitmap)
+    {
+    if (!aThis->iScreenCaptureUtil)
+        {
+        aThis->iScreenCaptureUtil = CScreenCaptureUtil::NewL(aThis);
+        }   
+    aThis->iScreenCaptureUtil->ComposeScreenL(aBitmap->Handle());
+    }
+    
+void CDisplayRenderStage::CopyScreenToBitmapL(CFbsBitmap* aBitmap, const TRect& /*aRect*/) const
+    {
+  if (iRunningOnLowMem)
+        {
+    User::Leave(KErrNoMemory);
+    }
+    
+  if ( aBitmap->ExtendedBitmapType() != KNullUid )
+    {
+    User::Leave(KErrArgument);
+    }            
+
+    doDynamicCaptureL((CDisplayRenderStage*)this, aBitmap);
+    }
+
+MWsElement* CDisplayRenderStage::CreateSceneElementL()
+    {
+    return iOpenWfcWrapper->CreateElementL();
+    }
+
+void CDisplayRenderStage::DestroySceneElement(MWsElement* aElement)
+    { 
+    iOpenWfcWrapper->DestroyElement(aElement);
+    }
+
+TInt CDisplayRenderStage::InsertSceneElement(MWsElement* aInsertElement, MWsElement* aSubordinateElement)
+    {
+	if (aInsertElement)
+	    {
+#ifdef USE_UI_SURFACE_FOR_ALF
+        TUint32 flags(0);
+        aInsertElement->GetRenderStageFlags(flags);
+        if ( flags & MWsElement::EElementIsIndirectlyRenderedUserInterface)
+            {
+            iUiElement = aInsertElement;
+	        if (!iAlfElement)
+	            {
+	            __ALFLOGSTRING("CDisplayRenderStage: Skipping UI element for now"); 
+	            return KErrNone;
+	            }
+            }
+         }
+#endif        
+    return iOpenWfcWrapper->AddElement(aInsertElement, aSubordinateElement);
+    }
+
+TInt CDisplayRenderStage::RemoveSceneElement(MWsElement* aRemoveElement)
+    {
+    iOpenWfcWrapper->RemoveElement(aRemoveElement);
+    return KErrNone;
+    }
+
+void CDisplayRenderStage::ComposePendingScene(TSurfaceId& aOffScreenTarget, TRequestStatus* aCompleted)
+    {
+    /*
+     * If the supplied off-screen target is NULL and If the optionally provided TRequestStatus
+     * is present, signal immediately and return.
+     */
+    if (aOffScreenTarget.IsNull())
+        {
+        if (aCompleted)
+            {           
+            User::RequestComplete(aCompleted, KErrArgument);
+            return;
+            }
+        }
+
+    iOpenWfcWrapper->RegisterSurface(aOffScreenTarget);
+    iOpenWfcWrapper->Compose(aOffScreenTarget, aCompleted);
+    iOpenWfcWrapper->UnregisterSurface(aOffScreenTarget);
+    }
+
+TInt CDisplayRenderStage::SetSceneRotation(const MWsScene::TSceneRotation aSceneRotation)
+    {
+    const TSceneRotation oldRotation = iOpenWfcWrapper->ScreenRotation();
+
+    //rotate in compositor 
+    iOpenWfcWrapper->SetScreenRotation(aSceneRotation);
+
+/*  switch (aSceneRotation)
+        {
+        case ESceneAntiClockwise0:
+        case ESceneAntiClockwise180:
+            iRenderTarget->SetAspectRatio(CRenderTarget::ENormalAspectRatio);
+            break;
+        default:
+            iRenderTarget->SetAspectRatio(CRenderTarget::EInvertedAspectRatio);
+        }
+*/      
+    TDisplayConfiguration rotate;
+    rotate.SetRotation((TDisplayConfiguration::TRotation)aSceneRotation);
+    iDisplayPolicy->SetCompositionInfo(rotate,rotate);
+    //update ui element
+    //const TSurfaceId& uiSurface = iRenderTarget->SurfaceId();
+    //return iOpenWfcWrapper->SetUiSurface(uiSurface);
+    return KErrNone;
+    }
+
+MWsScene::TSceneRotation CDisplayRenderStage::SceneRotation() const
+    {
+    return iOpenWfcWrapper->ScreenRotation();
+    }
+
+void CDisplayRenderStage::ClearDisplay(TRgb /*aBackColor*/)
+    {
+    }
+//
+//
+// Implementation of MWsDisplayConfiguration/MDisplayConfiguration interface
+//
+//
+
+
+void CDisplayRenderStage::NotifyOnDisplayChange(TRequestStatus& aStatus)
+    {
+    aStatus = KRequestPending;
+    if(iDispNotifier)
+        {
+        iDispNotifier->RegisterActiveStatus(aStatus);
+        }
+    else
+        {
+        TRequestStatus* reqPtr=&aStatus;    //indirection is required
+        User::RequestComplete(reqPtr, KErrNotSupported);
+        }
+    }
+
+void CDisplayRenderStage::NotifyOnDisplayChangeCancel()
+    {
+    if(iDispNotifier)
+        {
+        iDispNotifier->CancelNotificationRequest();
+        }
+    }
+
+void CDisplayRenderStage::NotifyOnConfigChange(TRequestStatus& aStatus)
+    {
+    aStatus = KRequestPending;
+    if(iConfigNotifier)
+        {
+        iConfigNotifier->RegisterActiveStatus(aStatus);
+        }
+    else
+        {
+        TRequestStatus* reqPtr=&aStatus;    //indirection is required
+        User::RequestComplete(reqPtr, KErrNotSupported);
+        }
+    }
+
+void CDisplayRenderStage::NotifyOnConfigChangeCancel()
+    {
+    if(iConfigNotifier)
+        {
+        iConfigNotifier->CancelNotificationRequest();
+        }
+    }
+
+/** Determine the display configuration and application rendering
+    offset to use for a given screen size mode.
+
+    The Window Server uses this function when a request to change to a
+    new screen size mode or new display configuration is made by a
+    client. The display configuration passed in may be partially filled,
+    and the combination of the defined entries in it and the requested
+    screen size mode values shall be used to define the rest of the
+    configuration and new application offset to be used.
+
+    Only undefined entries in the configuration may be set by this
+    function. Entries already defined must retain the same values. If
+    the combination of defined entries and size mode values is not
+    acceptable to the implementer, the function shall return EFalse.
+
+    If the function returns ETrue, the Window Server shall set the
+    returned display configuration, notify render stages of the new
+    application offset and change to use the screen size mode. If
+    either this function returns EFalse or the call to set the display
+    configuration fails for any reason (such as KErrNoMemory, for
+    example), then no further changes are made.
+
+    @see MWsScreenConfigList
+
+    @param aScreenSizeMode    The requested screen size mode. If static,
+    the size in pixels, size in twips, and the rotation must be
+    respected. If dynamic, only the rotation must be respected.
+    @param aConfig    The requested display configuration on input, the
+    required configuration on return. Only undefined entries may be set.
+
+    @param aSizeModePosition    The screen size mode offset and size to be filled in
+    
+    @return KErrNone if no error, otherwise a system wide error code
+*/
+TInt CDisplayRenderStage::GetSizeModeConfiguration(TInt aScreenSizeMode, TDisplayConfiguration& aConfig, TRect& aSizeModePosition) const
+    {
+    TInt reply;
+    RArray<TResolution> resolutions;
+    reply = iOpenWfcWrapperDisplayControl->GetResolutions(resolutions);
+    if (reply < KErrNone &&
+            reply != KErrDisconnected)
+        {
+        resolutions.Close();
+        return reply;
+        }
+    TBool isDisconnected=EFalse;
+    if (reply == KErrDisconnected || resolutions.Count() == 0)
+        {
+        isDisconnected=ETrue;
+        }
+    else if (resolutions.Count() == 1 && resolutions[0].iPixelSize==TSize(0,0))
+        {
+        isDisconnected=ETrue;
+        }
+    
+    if (isDisconnected)
+        {//in this case aScreenSizeMode should be the smallest app mode
+        reply = iDisplayPolicy->GetSizeModeConfiguration(aScreenSizeMode, aConfig, aSizeModePosition);
+        }
+    else
+        {
+        reply = iDisplayPolicy->GetSizeModeConfiguration(resolutions,aScreenSizeMode,aConfig,aSizeModePosition);
+        }
+
+    resolutions.Close();
+    return reply;
+    }
+
+void CDisplayRenderStage::SetSizeModeExtent(TRect& aExtent, TBitFlags32 aContext)
+    {
+    if (aContext.iFlags&KOffMap)
+        {
+        iDisplayPolicy->SetSizeModeExtent(aExtent,aContext);
+        aContext.iFlags&=~KOffMap;
+        }
+/*  if (aContext.iFlags&KOffGc)
+        {
+        iRenderTarget->SetDrawDeviceOffset(aExtent.iTl);
+        aContext.iFlags&=~KOffGc;
+        }*/
+    //Could chain through again if required?
+    }
+
+TInt CDisplayRenderStage::NumberOfResolutions() const
+    {
+    if(iOpenWfcWrapperDisplayControl)
+        {
+        TInt returnValue = iOpenWfcWrapperDisplayControl->NumberOfResolutions();
+        iDisplayPolicy->AddVirtualResolutionCount(returnValue);
+        return returnValue;
+        }
+#ifdef FAKE_DISPLAY_CONFIGURATION_FOR_SINGLE_DISPLAY    
+    return 1;
+#else
+    return KErrNotSupported;
+#endif
+    }
+
+TInt CDisplayRenderStage::GetResolutions(RArray<TResolution>& aResolutions) const   
+    {
+    if(iOpenWfcWrapperDisplayControl)
+        {
+        TInt returnValue = iOpenWfcWrapperDisplayControl->GetResolutions(aResolutions);
+        if (returnValue >= KErrNone)
+            {
+            //add virtual resolutions
+            returnValue = iDisplayPolicy->AddVirtualResolutions(aResolutions);
+            }
+        return returnValue;
+        }
+    return KErrNotSupported;
+    }
+
+
+void CDisplayRenderStage::GetConfiguration(TDisplayConfiguration& aConfig) const    
+    {
+    aConfig.ClearAll();
+    if(iOpenWfcWrapperDisplayControl)
+        {
+        iOpenWfcWrapperDisplayControl->GetConfiguration(aConfig);
+        if (aConfig.IsDefined(aConfig.EResolution))
+            {
+            TSize uiRes=iDisplayPolicy->GetUiResolution();
+            TDisplayConfiguration::TRotation rotation;
+            if(aConfig.GetRotation(rotation))
+                {
+                if(rotation&TDisplayConfiguration::ERotation90CW)
+                    {
+                    TInt height = uiRes.iHeight;
+                    uiRes.iHeight = uiRes.iWidth;
+                    uiRes.iWidth = height;
+                    }
+                }
+            if (uiRes.iWidth)
+                {
+                aConfig.SetResolution(uiRes);
+                }
+            }
+        }
+    }
+
+TInt CDisplayRenderStage::SetConfigurationAndBuffer(const TDisplayConfiguration& /*aConfig*/,const TSize* /*aUiSize*/)
+    {
+/*  //May need to resize the FB buffer
+    TInt result = KErrNone;
+    TSize reqUiSize;
+    TBool reallocBuffer=EFalse;
+    TSize newFbSize;
+        
+    RWsOffScreenImageTarget newTarget;
+    if (aUiSize)
+        {
+        newFbSize=*aUiSize;
+
+        iDisplayPolicy->AdjustStageBufferSize(iRenderTarget->SizeInPixels(),newFbSize);
+
+        //if realloc needed 
+        //if (!(newFbSize == iRenderTarget->SizeInPixels()))
+        //  { 
+        //  reallocBuffer = ETrue;
+        //  result = iRenderTarget->AllocNewTarget(newTarget,newFbSize);    //newFbSize should not be zero here.
+        //  if (result < KErrNone)
+        //      {
+        //      newTarget.Close();
+        //      return result;
+        //      }
+        //  }
+        }
+    TDisplayConfiguration displayCopy;
+    iOpenWfcWrapper->GetConfiguration(displayCopy);
+    if (aConfig.IsDefined(aConfig.EResolution)||aConfig.IsDefined(aConfig.ERotation))
+        {
+        result=iOpenWfcWrapper->FlushedSetConfiguration(aConfig);
+        }
+    if (result<KErrNone && result != KErrDisconnected)
+        {
+        TInt tempResult=iOpenWfcWrapper->FlushedSetConfiguration(displayCopy);
+        STD_ASSERT_DEBUG((tempResult==KErrNone)||(tempResult==KErrDisconnected),EPluginPanicTemp);
+        if (reallocBuffer)
+            {
+            newTarget.Close();
+            }
+        }
+    else
+        {
+        if (reallocBuffer)
+            {
+            const TSurfaceId& uiSurface = newTarget.iImageCollections
+                    [iRenderTarget->AspectRatio()].SurfaceId();
+            result = iOpenWfcWrapper->SetUiSurface(uiSurface);
+            if (result == KErrNone)
+                {
+                iRenderTarget->SwitchTarget(newTarget); //now newTarget shouldn't be closed
+                }
+            else
+                {
+                TInt tempResult = iOpenWfcWrapper->FlushedSetConfiguration(displayCopy);
+                STD_ASSERT_DEBUG((tempResult==KErrNone)||(result==KErrDisconnected),EPluginPanicTemp);
+                newTarget.Close();
+                }
+            }
+        }
+    return result;
+*/
+    return KErrNone;
+    }
+
+TInt CDisplayRenderStage::SetConfiguration(const TDisplayConfiguration& aConfig)    
+    {
+    if(iOpenWfcWrapperDisplayControl)
+        {
+
+        TInt returnValue = iOpenWfcWrapperDisplayControl->NumberOfResolutions();
+        TBool success=EFalse;
+        //Both "no resolution" and KErrDisconnected are treated as disconnected
+        if(returnValue == KErrDisconnected || returnValue == 0)
+            {
+            //Ui Res is set to same as smallest appmode
+            //compsotion res is set to zero
+
+            TSize uiSize;
+            TDisplayConfiguration emptyConvertedConfig;
+            emptyConvertedConfig.SetResolution(TSize(0,0));
+            aConfig.GetResolution(uiSize);
+            returnValue=SetConfigurationAndBuffer(emptyConvertedConfig,&uiSize);
+            iDisplayPolicy->SetCompositionInfo(emptyConvertedConfig,aConfig);
+            return returnValue;
+            }
+        
+        TDisplayConfiguration convertedConfig(aConfig);
+        RArray<TResolution> resolutions;
+        returnValue = resolutions.Reserve(returnValue);
+        
+        if (returnValue < KErrNone)
+            {
+            resolutions.Close();
+            return returnValue;
+            }
+        returnValue = iOpenWfcWrapperDisplayControl->GetResolutions(resolutions);
+        
+        if (returnValue < KErrNone)
+            {
+            resolutions.Close();
+            return returnValue;
+            }
+        success = iDisplayPolicy->SettingConfiguration(resolutions,convertedConfig);    //if virtual, converts to real
+        resolutions.Close();
+
+        TSize uiSize;
+        TBool isUiSize = aConfig.GetResolution(uiSize);
+        if (success)
+            {
+            TInt reply;
+            if (isUiSize)
+                {
+                reply=SetConfigurationAndBuffer(convertedConfig,&uiSize);
+                }
+            else
+                {
+                reply=SetConfigurationAndBuffer(convertedConfig,NULL);
+                }
+            if (reply>=KErrNone)
+                {
+                iDisplayPolicy->SetCompositionInfo(convertedConfig,aConfig);
+//              iBitGcWrapper->BitGc().Activate(iScreenDevice);
+                }
+            return reply;
+            }
+        else
+            {
+            TSize tempSize;
+            
+            if (!convertedConfig.GetResolution(tempSize))
+                {   //signals the config is totally invalid and should not be used
+                return KErrArgument;
+                }
+            TInt reply;
+            if (isUiSize)
+                {
+                reply=SetConfigurationAndBuffer(convertedConfig,&uiSize);
+                }
+            else
+                {
+                reply=SetConfigurationAndBuffer(convertedConfig,NULL);
+                }
+            if (reply>=KErrNone)
+                {
+                iDisplayPolicy->SetCompositionInfo(aConfig,aConfig);
+//              iBitGcWrapper->BitGc().Activate(iScreenDevice);
+                }
+            return reply;
+            }
+        }
+    else
+        {   //This will never work when faked
+        return KErrNotSupported;
+        }
+    }
+
+TInt CDisplayRenderStage::PreferredDisplayVersion() const   
+    {
+    if(iOpenWfcWrapperDisplayControl)
+        {
+        return iOpenWfcWrapperDisplayControl->PreferredDisplayVersion();
+        }
+    else
+        {
+#ifdef FAKE_DISPLAY_CONFIGURATION_FOR_SINGLE_DISPLAY    
+        return TDisplayConfiguration().Version();
+#else
+        return KErrNotSupported;
+#endif
+        }
+    }
+TInt CDisplayRenderStage::MapCoordinates(TCoordinateSpace aSourceSpace, const TRect& aSource, TCoordinateSpace aTargetSpace, TRect& aTarget) const
+    {
+    return iDisplayPolicy->MapCoordinates(aSourceSpace, aSource, aTargetSpace, aTarget);
+    }
+
+void CDisplayRenderStage::NewAppModesAvailable()
+    {
+    iDisplayPolicy->NewAppModesAvailable();
+    }
+
+TInt CDisplayRenderStage::SuitableAppMode(TDisplayStatus aSituation)
+    {
+    return iDisplayPolicy->SuitableAppMode(aSituation);
+    }
+
+void CDisplayRenderStage::SetLastAppMode(TInt aMode)
+    {
+    iDisplayPolicy->SetLastAppMode(aMode);
+    }
+
+TInt CDisplayRenderStage::RegisterSurface(const TSurfaceId& aSurface)
+    {
+    return iOpenWfcWrapper->RegisterSurface(aSurface);
+    }
+
+TInt CDisplayRenderStage::UnregisterSurface(const TSurfaceId& aSurface)
+    {
+    return iOpenWfcWrapper->UnregisterSurface(aSurface);
+    }
+
+// ---------------------------------------------------------------------------
+// EnableAlpha
+// ---------------------------------------------------------------------------
+//
+TInt CDisplayRenderStage::EnableAlpha(TBool aEnable)
+    {
+    __ALFLOGSTRING2("CDisplayRenderStage::EnableAlpha - iTargetElement: %d, aEnable: %d", iTargetElement, aEnable);
+    if ( iTargetElement )
+        {
+	    TUint32 flags = 0;
+	    iTargetElement->GetTargetRendererFlags(flags);
+        if ( aEnable )
+            {
+            flags |= MWsElement::EElementTransparencySource;
+            }
+        else
+            {
+            flags ^= MWsElement::EElementTransparencySource;
+            }
+	    iTargetElement->SetTargetRendererFlags(flags);
+        TRAP_IGNORE(ElementUseAlphaFlagChangedL(*iTargetElement, aEnable));
+        }
+    return KErrNone;
+    }
+
+
+void CDisplayRenderStage::ElementUseAlphaFlagChangedL(MWsElement& aElement, TBool aEnabled)
+    {
+    TElementData elementData(&aElement, TSurfaceId::CreateNullId(), 0, 0, 0);
+    TInt index = iElementArray.Find(elementData);
+    if ( index != KErrNotFound && iElementArray[index].iWindowTreeNodeId!=0 )
+        {      
+        TInt array[] = {
+          iElementArray[index].iWindowTreeNodeId,
+          aEnabled };    
+        iAlfBridge->WriteIntsL( 
+            EAlfNodeLayerUsesAlphaFlagChanged,
+            2,
+            array
+            );
+        iAlfBridge->CommitL();    
+        __ALFLOGSTRING1("CDisplayRenderStage::ElementUseAlphaFlagChanged - aEnabled %d", aEnabled);
+        }
+    }
+
+
+// ---------------------------------------------------------------------------
+// SetOpacity
+// ---------------------------------------------------------------------------
+//
+TInt CDisplayRenderStage::SetOpacity(TReal32 aOpacity)  __SOFTFP
+    {
+    TInt error = KErrNone;
+    TInt opacity = 255*aOpacity;
+    __ALFLOGSTRING3("CDisplayRenderStage::SetOpacity - iTargetElement: %d, aOpacity %f, opacity %d", iTargetElement, aOpacity, opacity );
+    if (iTargetElement)  
+	    {
+	    TUint32 flags = 0;
+	    iTargetElement->GetTargetRendererFlags(flags);
+	    flags |= MWsElement::EElementTransparencyGlobalAlpha;
+	    iTargetElement->SetTargetRendererFlags(MWsElement::EElementTransparencyGlobalAlpha);
+	    iTargetElement->SetGlobalAlpha(opacity);
+        }
+    // Todo: Could do some real magic based for 0..    
+    return error;
+    }
+
+// ---------------------------------------------------------------------------
+// SetRotation, Not in degrees !!!
+// ---------------------------------------------------------------------------
+//
+TInt CDisplayRenderStage::SetRotation(TInt aRotation)
+    {
+    __ALFLOGSTRING2("CDisplayRenderStage::SetRotation - iTargetElement: %d, aRotation: %d ", iTargetElement, aRotation);
+
+    MWsElement::TElementRotation rotation =
+            static_cast<MWsElement::TElementRotation> (aRotation);
+
+    if (iTargetElement)
+        {
+        iTargetElement->SetSourceRotation(rotation);
+        }
+        
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// SetExtent
+// ---------------------------------------------------------------------------
+//
+TInt CDisplayRenderStage::SetExtent(
+        const TRect& aRect, 
+#ifdef _ALF_LOGGING
+        TInt aScreen)
+#else
+		TInt)
+#endif				
+    {
+    __ALFLOGSTRING2("CDisplayRenderStage::SetExtent - %d %d  ",aRect.iTl.iX,aRect.iTl.iY );
+    __ALFLOGSTRING2("CDisplayRenderStage::SetExtent - %d %d  ",aRect.iBr.iX,aRect.iBr.iY );
+#ifdef _ALF_LOGGING
+    __ALFLOGSTRING2("CDisplayRenderStage::SetExtent - iTargetElement: %d, aScreen: %d  ", iTargetElement, aScreen );
+#endif                  
+    __ALFLOGSTRING1("CDisplayRenderStage::SetExtent - iScreenNumber %d  ", iScreenNumber);
+
+    TInt error = KErrNone;
+    TBool composeNeeded = EFalse;
+    if (iTargetElement)
+        {
+        iTargetElement->SetDestinationRectangle(aRect);
+        iTargetElement->SetDestinationClippingRect(aRect);
+        iExtentSurfaceId.CreateNullId(); // was not used -> reset
+        }
+    // window is not found from this screen, handle as extent without window if extent surface is set
+    // Todo.    
+    return error;
+    }
+
+// ---------------------------------------------------------------------------
+// SetIsBackgroundAnim
+// ---------------------------------------------------------------------------
+//
+void CDisplayRenderStage::SetIsBackgroundAnim(TBool aValue )
+    {
+    if( iTargetElement )
+        {
+        iTargetElement->SetIsBackgroundAnim(aValue);
+        }
+    }
+
+
+TInt CDisplayRenderStage::SetSourceRect(const TRect& aRect)
+    {
+    if( iTargetElement )
+        {
+        iTargetElement->SetSourceRectangle(aRect);
+        }
+    return KErrNone;
+    }
+// ---------------------------------------------------------------------------
+// CreateTargetL
+// ---------------------------------------------------------------------------
+//
+TInt CDisplayRenderStage::CreateTargetL(TInt aTarget, TInt aWsHandle, TInt aGroupHandle)
+    {
+    __ALFLOGSTRING2("CDisplayRenderStage::CreateTargetL - : %d, %d", aWsHandle, aGroupHandle );
+    TInt result(KErrNotFound);
+    // find the element for this window
+    CElementWrapper* element = NULL;
+    
+    for (TInt i = 0; i < iElementArray.Count(); i++)
+        {
+        RDebug::Print(_L("CDisplayRenderStage::CreateTargetL - %d - %d - %d"), iElementArray[i].iWindowHandle, iElementArray[i].iWindowGrpId, iElementArray[i].iWindowTreeNodeId );
+
+        if (iElementArray[i].iWindowHandle == aWsHandle
+            && iElementArray[i].iWindowGrpId == aGroupHandle)
+            {
+            element = dynamic_cast<CElementWrapper*>(iElementArray[i].iElement);
+            break;
+            }
+        }
+        
+    if (element)
+        {
+        SElementTarget elementtarget;
+        elementtarget.iTarget = aTarget;
+        elementtarget.iElement = element;
+        result = iElementTargets.Append(elementtarget);
+
+        // todo: is there need to lock target so that wserv does not accidentally overwrite the state from client
+
+        __ALFLOGSTRING1("CDisplayRenderStage::CreateTargetL - client composition element count %d ", iElementTargets.Count() );
+        }
+    return KErrNone;
+    }
+
+// ---------------------------------------------------------------------------
+// SetTargetL
+// ---------------------------------------------------------------------------
+//
+void CDisplayRenderStage::SetTargetL(TInt aTarget)
+    {
+    __ALFLOGSTRING1("CDisplayRenderStage::SetTargetL - %d ", aTarget );
+    CElementWrapper* tmp = FindElementTarget(aTarget);
+    if (tmp)
+        {
+        __ALFLOGSTRING1("CDisplayRenderStage::SetTargetL - Found target ", aTarget );
+        iTargetElement = tmp;
+        }
+    else
+        {
+        if (iTargetElement)
+            { // flush changes to composition when target is released
+            iTargetElement->FlushSceneChanges();
+            }
+        iTargetElement = NULL;
+        __ALFLOGSTRING1("CDisplayRenderStage::SetTargetL - Target was not found!", aTarget );
+        }
+    }
+
+void CDisplayRenderStage::SetTarget(MWsElement* aElement)
+  {
+  if (iTargetElement && !aElement)
+    { // flush changes when target is "freed"
+    iTargetElement->FlushSceneChanges();
+    }
+
+  //__ASSERT_DEBUG(!iTargetElement, USER_INVARIANT())
+  iTargetElement = dynamic_cast<CElementWrapper*>(aElement);
+  }  
+
+// ---------------------------------------------------------------------------
+// SetExtentSurfaceId
+// ---------------------------------------------------------------------------
+//
+void CDisplayRenderStage::SetExtentSurfaceId(const TSurfaceId& aSurfaceId)
+    {
+    iExtentSurfaceId = aSurfaceId;
+    }
+// ---------------------------------------------------------------------------
+// SetOrder
+// ---------------------------------------------------------------------------
+//
+TInt CDisplayRenderStage::SetOrder(TInt /*aTarget*/, TInt /*aTop*/, TBool /*aAbove*/, TBool /*aCombineTargets*/)
+    {
+    TInt newKey = KErrNone;
+    // ToDo  
+    return newKey;
+    }
+
+// ---------------------------------------------------------------------------
+// DeleteTarget
+// ---------------------------------------------------------------------------
+//
+void CDisplayRenderStage::DeleteTarget(TInt aTarget)
+    {
+    __ALFLOGSTRING1("CDisplayRenderStage::DeleteTarget - %d ", aTarget );
+    // try to remove from the element targets
+    MWsElement* element = FindElementTarget(aTarget);
+    if(element)
+        {
+        // Todo: Should we restore some flags / state?
+        }
+    
+    for( TInt x = 0; x < iElementTargets.Count() ; x++)
+        {
+        if( iElementTargets[x].iTarget == aTarget )
+            {
+            iElementTargets.Remove(x);
+            break;
+            }
+        }
+
+    __ALFLOGSTRING1("CDisplayRenderStage::DeleteTarget - client composition element count %d ", iElementTargets.Count() );
+    }
+
+void CDisplayRenderStage::LowOnGraphicsMemory()
+    {
+    __ALFLOGSTRING("void CDisplayRenderStage::LowOnGraphicsMemory()");    
+    iRunningOnLowMem = ETrue;
+    delete iScreenCaptureUtil;
+    iScreenCaptureUtil = 0;
+    }
+
+void CDisplayRenderStage::GraphicsMemoryGood()
+    {
+    __ALFLOGSTRING("void CDisplayRenderStage::GraphicsMemoryGood()");    
+    iRunningOnLowMem = EFalse;
+    }
+
+void CDisplayRenderStage::AlfBridgeCallback(TInt aEvent, TAny* aData)
+    {
+    switch(aEvent)
+      {
+      case MAlfBridge::EAlfBridgeCreated:
+        iAlfBridge = (MAlfBridge*) aData;
+        return;
+      case MAlfBridge::EAlfNativeWindowCreated:
+        AlfWindowListenerCallback((TAlfNativeWindowData*)aData);
+        return;
+      case MAlfBridge::ESetWindowTreeObserver:
+        iWindowTreeObserver = (MAlfCompositionAgnosticWindowTreeObserver*)aData;
+        return;
+    default:
+      break;
+      }
+    }
+// ---------------------------------------------------------------------------
+// AlfWindowListenerCallBack
+// ---------------------------------------------------------------------------
+//
+#ifdef USE_UI_SURFACE_FOR_ALF
+void CDisplayRenderStage::AlfWindowListenerCallback(TAlfNativeWindowData*)
+    {
+#else
+void CDisplayRenderStage::AlfWindowListenerCallback(TAlfNativeWindowData* aData)
+    {
+    // Got window and group id from Alf. 
+	iAlfElement = FindElement(aData->iAlfWindowGrpId, aData->iAlfWindowHandle);
+	if (iAlfElement)
+	    {
+	    if (!(iAlfElement->ConnectedSurface().IsNull()))
+	        {
+            // Found Alf Egl surface. Enable alpha on it to be able to create transparent holes.
+            SetTarget(iAlfElement);
+            EnableAlpha(); 
+            SetOpacity(1.0f);
+            SetTarget(0);
+            iOpenWfcWrapper->SetUiSurface(iAlfElement->ConnectedSurface())
+            }
+	    }
+#endif
+    }    
+
+MWsElement* CDisplayRenderStage::FindElement(TInt aWindowGrpId, TInt aWindowHandle)
+    {
+    for(TInt index = 0; index < iElementArray.Count(); ++index)
+        {
+        if( (iElementArray[index].iWindowGrpId == aWindowGrpId)
+        	&& (iElementArray[index].iWindowHandle == aWindowHandle))
+            {
+            return iElementArray[index].iElement;
+            }
+        }
+    return NULL;
+    }
+      
+void CDisplayRenderStage::ElementAdded(const MWsWindowTreeNode& aWindowTreeNode, const MWsElement& aElement)
+    {
+    __ALFLOGSTRING1("CDisplayRenderStage::ElementAdded. iScreenNumber=%d", iScreenNumber);        
+
+   	const MWsWindow* window = aWindowTreeNode.Window();
+    TUint32 windowId = window->Handle();
+    TInt windowGroupId = 0;             
+    const MWsWindowTreeNode* parentWindowGroup = aWindowTreeNode.ParentNode();
+    while (parentWindowGroup)
+        {
+        if (parentWindowGroup->NodeType() == MWsWindowTreeNode::EWinTreeNodeGroup)
+            {
+            windowGroupId = parentWindowGroup->WindowGroup()->Identifier();
+#ifdef USE_UI_SURFACE_FOR_ALF
+            if (iUiElement->ConnectedSurface() == TSurfaceId::CreateNullId() && 
+                parentWindowGroup->WindowGroup()->Client() && 
+                parentWindowGroup->WindowGroup()->Client()->SecureId() == RProcess().SecureId()) // ALF
+                {
+                iAlfElement = (MWsElement*) &aElement;
+	            if (!(iAlfElement->ConnectedSurface().IsNull()))
+	                {
+                    // Found Alf Egl surface. Enable alpha on it to be able to create transparent holes.
+                    SetTarget(iAlfElement);
+                    EnableAlpha();
+                    SetOpacity(1.0f);
+                    SetTarget(0);
+                    iOpenWfcWrapper->SetUiSurface(iAlfElement->ConnectedSurface());
+                    if (iUiElement)
+                        {
+                        iUiElement->ConnectSurface(iAlfElement->ConnectedSurface());
+                        RemoveSceneElement(iAlfElement);
+                        InsertSceneElement(iUiElement,0);
+                        iAlfElement = iUiElement;
+                        // Todo: do we need to compose manually to make change happen immediately
+                        return;                     
+                        }
+                     }
+                }                
+#endif // #ifdef USE_UI_SURFACE_FOR_ALF
+
+            break;    
+            }
+        parentWindowGroup = parentWindowGroup->ParentNode();
+        }                        
+    
+    // Store window handle and surface Id in an array
+    TInt index = KErrNotFound;
+    TUint32 nodeId = (TUint32)&aWindowTreeNode;
+    for(TInt i = 0; i < iElementArray.Count(); ++i)
+        {
+        if(iElementArray[i].iSurfaceId == aElement.ConnectedSurface())
+            {
+            iElementArray[i].iWindowGrpId = windowGroupId;
+            iElementArray[i].iWindowHandle = windowId;
+            iElementArray[i].iWindowTreeNodeId = nodeId;
+            index = i;
+            break;
+            }
+        }
+
+    __ALFLOGSTRING1("DisplayRenderStage::ElementAdded. index=%d", index);
+	if (index == KErrNotFound)
+		{
+		ASSERT(EFalse);
+		return; // error
+		}
+	
+
+	//SetTarget(iElementArray[index].iElement); // Usefull for debugging
+    //SetOpacity(0.5f);
+    //SetTarget(0);
+
+    __ALFLOGSTRING1("--aElement: %x", iElementArray[index].iElement);
+    __ALFLOGSTRING1("--iSurfaceId: %d", iElementArray[index].iSurfaceId);
+    __ALFLOGSTRING1("--iWindowHandle: %d", iElementArray[index].iWindowHandle);
+    __ALFLOGSTRING1("--iWindowTreeNodeId: %d", iElementArray[index].iWindowTreeNodeId);
+
+	// Send EAlfNodeLayerAdded command that will set the surface extent to the visual
+	// Note : it is not necessary to send EAlfNodeLayerAdded  command in Alf EGL surface Element case
+	//        but it should not do any harm either.
+    TRect extent;
+    aElement.GetDestinationRectangle( extent );
+    TInt array[] = {        
+            nodeId,
+            extent.iTl.iX,
+            extent.iTl.iY,
+            extent.iBr.iX,
+            extent.iBr.iY
+            }; 
+    iAlfBridge->WriteIntsL( 
+    	EAlfNodeLayerAdded,
+        5,
+        array );
+	iAlfBridge->CommitL();
+
+	// Do compose. This is required to get newly created surface in composition right away.
+	// Otherwise, if the surface would not be updated to the composition scene here all surface updates would fail 
+	// until next normal compose call. 
+    //(void)CAlfComposeObject::CreateAndStartL(*iGceWrapper);
+	
+    __ALFLOGSTRING("CDisplayRenderStage::ElementAdded - End");  
+    }
+    
+CElementWrapper* CDisplayRenderStage::FindElementTarget( TInt aTarget )
+    {
+    TInt i = 0;
+    for(  ; i < iElementTargets.Count() ; i++ )
+        {
+        if( iElementTargets[i].iTarget == aTarget )
+            {
+            break;
+            }
+        }
+    if( i < iElementTargets.Count())
+        {
+        return iElementTargets[i].iElement;
+        }
+    return NULL;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/src/displayrenderstagefactory.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,69 @@
+// 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 "displayrenderstagefactory.h"
+#include "displayrenderstage.h"
+#include "panic.h"
+
+_LIT(KDisplayRenderStageName, "compositor");
+
+CDisplayRenderStageFactory* CDisplayRenderStageFactory::CreateL()
+	{
+	return new(ELeave) CDisplayRenderStageFactory;
+	}
+	
+void CDisplayRenderStageFactory::ConstructL(MWsGraphicDrawerEnvironment& aEnv, const TDesC8& /*aData*/)
+	{
+	BaseConstructL(aEnv);
+	}
+	
+CDisplayRenderStageFactory::CDisplayRenderStageFactory()
+	{
+	}
+	
+CDisplayRenderStageFactory::~CDisplayRenderStageFactory()
+	{
+	}
+
+TAny* CDisplayRenderStageFactory::ResolveObjectInterface(TUint aTypeId)
+	{
+	switch (aTypeId)
+		{
+	case KMWsRenderStageFactory:
+		return static_cast<MWsRenderStageFactory*>(this);
+		}
+
+	return NULL;
+	}
+
+CWsRenderStage* CDisplayRenderStageFactory::CreateFinalRenderStageL(MWsScreen* aScreen, MWsScreenRedraw* /*aScreenRedraw*/, TInt aScreenNumber)
+	{
+	CDisplayRenderStage* stage = CDisplayRenderStage::NewL(&Env(), aScreen, aScreenNumber);
+	return stage;
+	}
+	
+CWsRenderStage* CDisplayRenderStageFactory::CreateRenderStageL(MWsScreen* /*aScreen*/, MWsScreenRedraw* /*aScreenRedraw*/, CWsRenderStage* /*aNextStage*/)
+	{
+	//if we arrive here there has been a configuration error. this render stage must be the final render stage
+	Panic(EPluginPanicDisplayRenderStageMustBeFinal);
+	User::Leave(EPluginPanicDisplayRenderStageMustBeFinal);//to keep LeaveScan happy 
+	return NULL;
+	}
+
+const TDesC& CDisplayRenderStageFactory::PluginName() const
+	{
+	return KDisplayRenderStageName;
+	}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/src/elementwrapper.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1131 @@
+// 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 "openwfcpanics.h"
+#include "elementwrapper.h"
+#include <WF/wfc.h>
+#include <graphics/surfacetypes.h>
+#include <hal.h>
+
+CElementWrapper* CElementWrapper::NewL(COpenWfcWrapper& aCOpenWfcWrapper, CElementWrapper*& aCleanupPrevRef)
+    {
+    CElementWrapper* wrapper = new (ELeave) CElementWrapper(aCOpenWfcWrapper);
+    CleanupStack::PushL(wrapper);
+    wrapper->ConstructL(aCleanupPrevRef);
+    CleanupStack::Pop(wrapper);
+    return wrapper;
+    }
+
+CElementWrapper::CElementWrapper(COpenWfcWrapper& aOpenWfcWrapper):
+    iUpdateFlags(EUpdate_ALL_ATTRIBS),iOpenWfcWrapper(aOpenWfcWrapper),iGlobalAlpha(0xff),
+    iFlipped(EFalse),iRotation(MWsElement::EElementAntiClockwise0)
+    {
+    }
+CElementWrapper::~CElementWrapper()
+    {
+    wfcDestroyElement(iOpenWfcWrapper.Device(),iElement);
+
+    UnsetSurface(iSurfaceId);
+    iUpdateFlags = EUpdate_None;
+
+    if (iCleanupNext)
+        {
+        iCleanupNext->iCleanupPrevRef=iCleanupPrevRef;
+        }
+    *iCleanupPrevRef=iCleanupNext;
+    }
+
+void CElementWrapper::ConstructL(CElementWrapper*& aCleanupPrevRef)
+    {
+    if (aCleanupPrevRef)
+        {
+        iCleanupNext=aCleanupPrevRef;
+        iCleanupNext->iCleanupPrevRef=&iCleanupNext;
+        }
+    aCleanupPrevRef=this;
+    iCleanupPrevRef=&aCleanupPrevRef;
+
+    iElement=wfcCreateElement(iOpenWfcWrapper.Device(),iOpenWfcWrapper.OnScreenContext(),NULL);
+    if (iElement==WFC_INVALID_HANDLE)
+        {   //if context and device are good then only explanation is memory
+        #ifdef _DEBUG
+            WFCErrorCode wfcErr = 
+        #endif
+        wfcGetError(iOpenWfcWrapper.Device());
+        OPENWFC_ASSERT_DEBUG(wfcErr==WFC_ERROR_OUT_OF_MEMORY,EPanicUnexpectedErrorElementConstruct);
+        User::Leave(KErrNoMemory);
+        }
+    }
+
+TInt CElementWrapper::SetSourceRectangle(const TRect& aSrc)
+    {
+    if(iSurfaceId.IsNull())
+        return KErrGeneral;
+
+    //Check aSrc rect is within the bounds of the source image
+    TInt32 width,height;
+    HelpStreamGetHeader(&width,&height);
+    if(aSrc.iTl.iX < 0 || aSrc.iTl.iY < 0 || aSrc.iBr.iX > width || aSrc.iBr.iY > height)
+        {
+        return KErrArgument;
+        }
+
+    iSourcRect = aSrc;
+    iUpdateFlags |= EUpdate_SettingValid|EUpdate_SOURCE_RECTANGLE;
+    iOpenWfcWrapper.SetCompositionModified();
+    
+    return KErrNone;
+    }
+
+TInt CElementWrapper::GetSourceRectangle(TRect& aSrc)
+    {
+    if(iSurfaceId.IsNull())
+        return KErrGeneral;
+
+    if (iSourcRect.IsEmpty())
+        {        
+        //get true source rectangle from surface
+        TInt32 width,height;
+        HelpStreamGetHeader(&width,&height);
+        aSrc.iTl.iX = 0;
+        aSrc.iTl.iY = 0;
+        aSrc.iBr.iX = width;
+        aSrc.iBr.iY = height;
+        }
+    else
+        {
+        aSrc=iSourcRect;
+        }
+    
+    return KErrNone;
+    }
+
+TInt CElementWrapper::SetSourceFlipping(const TBool aFlip)
+    {
+    if(iSurfaceId.IsNull())
+        return KErrGeneral;
+
+    iFlipped = aFlip;
+    iUpdateFlags |= EUpdate_SettingValid|EUpdate_SOURCE_FLIP;
+    
+    return KErrNone;
+    }
+
+TBool CElementWrapper::SourceFlipping() const
+    {
+    if(iSurfaceId.IsNull())
+        return EFalse; //default is not flipped
+    
+    return iFlipped;
+    }
+
+TInt CElementWrapper::SetGlobalAlpha(const TInt aAlpha)
+    {
+    if (aAlpha!=iGlobalAlpha)
+        {
+        if ((aAlpha>=0xff)!=(iGlobalAlpha==0xff))
+            {
+            iUpdateFlags |= EUpdate_SettingValid|EUpdate_TRANSPARENCY_TYPES;
+            }
+        if (aAlpha < 0)
+            {
+            iGlobalAlpha = 0;
+            }
+        else
+            {
+            iGlobalAlpha = aAlpha > 0xff ? 0xff : aAlpha;
+            }
+        iUpdateFlags |= EUpdate_SettingValid|EUpdate_GLOBAL_ALPHA;
+        }
+    iOpenWfcWrapper.SetCompositionModified();
+    
+    return KErrNone;
+    }
+
+void CElementWrapper::GlobalAlpha(TInt& aAlpha) const
+    {
+    aAlpha = iGlobalAlpha;
+    }
+
+TInt CElementWrapper::SetDestinationRectangle(const TRect& aDest)
+    {
+    if(iSurfaceId.IsNull())
+        return KErrGeneral;
+
+    //Check aDest is not out of bounds
+    if(aDest.iBr.iX < aDest.iTl.iX || aDest.iBr.iY < aDest.iTl.iY)
+        {
+        return KErrArgument;
+        }
+
+    TRect compositionDestRect;
+    TRect lastCompositionDestRect;
+    GetDestinationRectangle(lastCompositionDestRect);
+    TInt err = KErrNone;
+    //always do the translate
+    err = iOpenWfcWrapper.DisplayPolicy()->MapCoordinates(EApplicationSpace, aDest, ECompositionSpace, compositionDestRect);
+
+    if(compositionDestRect != lastCompositionDestRect)
+        {
+        iDestinationRect=aDest;
+        iUpdateFlags |= EUpdate_SettingValid|EUpdate_DESTINATION_RECTANGLE;
+
+        iOpenWfcWrapper.SetCompositionModified();
+        }
+    
+    return err;
+    }
+
+TInt CElementWrapper::GetDestinationRectangle(TRect& aDest) const
+    {
+    if(iSurfaceId.IsNull())
+        return KErrGeneral;
+
+    aDest=iDestinationRect;
+    
+    return KErrNone;
+    }
+
+TInt CElementWrapper::SetDestinationClippingRect(const TRect& aDestClipRect)
+	{
+	if(iSurfaceId.IsNull())
+        return KErrGeneral;
+
+    TRect compositionDestClipRect;
+    TRect lastCompositionDestClipRect;
+    GetDestinationClippingRect(lastCompositionDestClipRect);
+    TInt err = KErrNone;
+    //always do the translate
+    err = iOpenWfcWrapper.DisplayPolicy()->MapCoordinates(EApplicationSpace, aDestClipRect, ECompositionSpace, compositionDestClipRect);
+    
+    if(compositionDestClipRect != lastCompositionDestClipRect)
+    	{
+    	TRect destClipRect(aDestClipRect);
+		//Check if the destination clip rectangle is not empty
+		if (!destClipRect.IsEmpty())
+			{
+			//Calculate the intersection of the destination clipped rectangle
+			destClipRect.Intersection(iDestinationRect);
+			if (!destClipRect.IsEmpty())
+				{
+				// Check if the clipped rectangle is valid,it doesn't have coordinates
+				if (destClipRect.iTl.iX < 0 || destClipRect.iTl.iY < 0)
+					{
+					return KErrArgument;
+					}
+				}
+			}
+		if (iDestinationClippingRect != aDestClipRect)
+			{
+			iDestinationClippingRect = aDestClipRect;
+			iUpdateFlags |= EUpdate_SettingValid | EUpdate_DESTINATION_CLIP_RECTANGLE;
+
+			iOpenWfcWrapper.SetCompositionModified();
+			}
+		err = KErrNone;
+		}
+	return err;
+	}
+
+TInt CElementWrapper::GetDestinationClippingRect(TRect& aDestClipRect) const
+    {
+	if(iSurfaceId.IsNull())
+        return KErrGeneral;
+
+    aDestClipRect = iDestinationClippingRect;
+
+    return KErrNone;
+    }
+    
+
+/*
+Fast swap of two 32-bit TInt type integers.
+@param aA Argument one. 
+@param aB Argument two.
+*/
+inline void SwapInt(TInt& aA, TInt& aB)
+   {
+   aA ^= aB;
+   aB ^= aA;
+   aA ^= aB;
+   }
+
+/*
+ Rectangle corner point enumeration.
+ Consider TopLeft     point as 0
+ Consider TopRight    point as 1
+ Consider BottomRight point as 2
+ Consider BottomLeft  point as 3
+*/
+enum TRectangleCornerPoint
+    {
+    ETopLeft,
+    ETopRight,
+    EBottomRight,
+    EBottomLeft
+    };
+
+/**
+ Get Bottom right corner of the rectangle. 
+ @param aRect input rectangle.
+ @return Bottom right corner point coordinates of rectangle.
+ */
+inline TPoint BottomRight(const TRect& aRect)
+    {
+    return aRect.iBr;
+    }
+
+/**
+ Get Top left corner of the rectangle. 
+ @param aRect input rectangle.
+ @return Top left corner point coordinates of rectangle.
+ */
+inline TPoint TopLeft(const TRect& aRect)
+    {
+    return aRect.iTl;
+    }
+
+/**
+ Get Top right corner of the rectangle. 
+ @param aRect input rectangle.
+ @return Top right corner point coordinates of rectangle.
+ */
+inline TPoint TopRight(const TRect& aRect)
+    {
+    return TPoint(aRect.iBr.iX, aRect.iTl.iY);
+    }
+
+/**
+ Get Bottom left corner of the rectangle. 
+ @param aRect input rectangle.
+ @return Bottom left corner point coordinates of rectangle.
+ */
+inline TPoint BottomLeft(const TRect& aRect)
+    {
+    return TPoint(aRect.iTl.iX, aRect.iBr.iY);
+    }
+
+/*
+ Make horizontal flip of the corner point.
+ */
+inline TRectangleCornerPoint FlipRectangleCorner(TRectangleCornerPoint aSourceRectCorner)
+    {
+    return static_cast<TRectangleCornerPoint> (static_cast<TInt> (aSourceRectCorner ^ 0x00000003));
+    }
+
+/*
+ Make clockwise rotation of corner point. 
+ */
+inline TRectangleCornerPoint RotateRectangleCorner(TRectangleCornerPoint aSourceRectCorner,const MWsElement::TElementRotation& aElementRotation)
+    {
+    return static_cast<TRectangleCornerPoint> ((static_cast<TInt> (aSourceRectCorner) + static_cast<TInt> (aElementRotation)) & 0x00000003);
+    }
+
+/*
+ Check if there is an inverted aspect ratio. 
+ */
+inline TBool CheckInvertedAspectRatio(const MWsElement::TElementRotation& aElementRotation)
+    {
+    return  (aElementRotation & 0x00000001);
+    }
+/**
+ Compare the dedicated rectangle corner coordinates of two rectangles.
+ @param aCorner rectangle corner point.
+ @param aRect1 the first rectangle to compare.
+ @param aRect2 the second rectangle to compare.
+ @return ETrue if the checked corner coordinates are the same. 
+ */
+TBool CheckTwoRectangleCorners(TRectangleCornerPoint aCorner,const TRect& aRect1,const TRect& aRect2)
+    {
+    aCorner = static_cast<TRectangleCornerPoint> (static_cast<TInt> (aCorner) & 0x00000003); // Normalize rectangle corner value
+    switch (aCorner)
+        {
+        case ETopLeft:
+            return (TopLeft(aRect1) == TopLeft(aRect2));
+        case ETopRight:
+            return (TopRight(aRect1) == TopRight(aRect2));
+        case EBottomRight:
+            return (BottomRight(aRect1) == BottomRight(aRect2));
+        case EBottomLeft:
+            return (BottomLeft(aRect1) == BottomLeft(aRect2));
+        default:
+            return EFalse;
+        }
+    }
+
+/**
+ Calculate the new source rectangle extent when a window is clipped by it parent window. 
+ Destination clipped rectangle should match to the source rectangle with taking into account 
+ flip, scaling and rotation.
+ @param aDestElementRect destination element rectangle without parent window clipping   
+ @param aDestElementClippedRect destination element rectangle clipped by the parent window.
+ @param aSrcOriginalElementRect  source element rectangle without any clipping changes.
+ @param aElementFlip horizontal flip flag.
+ @param aElementRotation target anti clockwise rotation factor.
+ @return clipped source rectangle.
+ */  
+TRect CElementWrapper::SetSourceDestRect(const TRect& aDestElementRect,const TRect& aDestElementClippedRect,const TRect& aSrcOriginalElementRect,const TBool& aElementFlip,const MWsElement::TElementRotation& aElementRotation) const
+    {
+	if ((aSrcOriginalElementRect.Width() == 0) || (aSrcOriginalElementRect.Height() == 0))
+		{
+		// There are either width or height equal zero.
+		return TRect();
+		}
+
+	TRectangleCornerPoint sourceRectangleCorner = ETopLeft;
+	TRect destElementMovedClippedRect(aDestElementClippedRect);
+	destElementMovedClippedRect.Intersection(aDestElementRect);
+	TBool fullFlipRotationScale = EFalse;
+	// Compare four corner points of Destination moved and Destination moved clipped rectangles.
+	// Find the first equal corner coordinates for Destination moved and Destination moved clipped rectangles.
+	// It is the Fixed or non changeable point/corner of the source rectangle.
+	if (destElementMovedClippedRect.IsEmpty())
+		{
+		return TRect();
+		}
+	for (sourceRectangleCorner = ETopLeft; ((TInt) sourceRectangleCorner) <= ((TInt) EBottomLeft);)
+		{
+		if (CheckTwoRectangleCorners(sourceRectangleCorner, aDestElementRect, destElementMovedClippedRect))
+			{
+			break;
+			}
+		sourceRectangleCorner = static_cast<TRectangleCornerPoint> ((TInt) sourceRectangleCorner + 1);
+		}
+	// There are no equals coordinates, hence, it must be calculated with different  by different way
+	if ((TInt) sourceRectangleCorner > (TInt) EBottomLeft)
+		{
+		sourceRectangleCorner = ETopLeft;
+		fullFlipRotationScale = ETrue;
+		}
+
+	// Clockwise rotate of the detected Fixed point/corner.  
+	sourceRectangleCorner = RotateRectangleCorner(sourceRectangleCorner, aElementRotation);
+
+	// If flip flag set, then make horizontal flip of the Fixed point.
+	if (aElementFlip)
+		{
+		sourceRectangleCorner = FlipRectangleCorner(sourceRectangleCorner);
+		}
+
+	// Make scale calculation for the source clipping
+	TInt dX = 0;
+	TInt dY = 0;
+	if (fullFlipRotationScale)
+		{
+		dX = ((aDestElementRect.iTl.iX - aDestElementClippedRect.iTl.iX) * aSrcOriginalElementRect.Width()) / aDestElementRect.Width();
+		dY = ((aDestElementRect.iTl.iY - aDestElementClippedRect.iTl.iY) * aSrcOriginalElementRect.Height()) / aDestElementRect.Height();
+		}
+	TInt clipSrcWidth = (destElementMovedClippedRect.Width() * aSrcOriginalElementRect.Width()) / aDestElementRect.Width();
+	TInt clipSrcHeight = (destElementMovedClippedRect.Height() * aSrcOriginalElementRect.Height()) / aDestElementRect.Height();
+	TRect resultSourceRect = aSrcOriginalElementRect;
+
+	// Swap the clipping width and height if the target was rotated on 90 or 270 degrees.
+	if (CheckInvertedAspectRatio(aElementRotation))
+		{
+		SwapInt(clipSrcWidth, clipSrcHeight);
+		SwapInt(dX, dY);
+		}
+
+	// Assuming that coordinates of the source Fixed corner/point was not changed due to clipping,
+	// calculate coordinates of an opposite point to the Fixed corner/point.
+	// This point must be differ from original source  for providing proper clipping visual result.
+	switch (sourceRectangleCorner)
+		{
+		case ETopLeft:
+			{
+			// If TopRight of aDestElementRect is not the same as TopRight of aDestElementClippedRect 
+			if (!CheckTwoRectangleCorners(ETopRight, aDestElementRect, destElementMovedClippedRect))
+				{// calculate point ETopRight
+				resultSourceRect.iBr.iX = resultSourceRect.iTl.iX + clipSrcWidth;
+				}
+			// If BottomLeft of aDestElementRect is not the same as BottomLeft of aDestElementClippedRect
+			if (!CheckTwoRectangleCorners(EBottomLeft, aDestElementRect, destElementMovedClippedRect))
+				{// calculate point EBottomLeft
+				resultSourceRect.iBr.iY = resultSourceRect.iTl.iY + clipSrcHeight;
+				}
+			if (fullFlipRotationScale)
+				{
+				resultSourceRect.iTl.iX += dX;
+				resultSourceRect.iTl.iY += dY;
+				}
+			}
+			break;
+		case ETopRight:
+			{
+			// if TopLeft of aDestElementRect is not the same as TopLeft of aDestElementClippedRect
+			if (!CheckTwoRectangleCorners(ETopLeft, aDestElementRect, destElementMovedClippedRect))
+				{// calculate point ETopLeft
+				resultSourceRect.iTl.iX = resultSourceRect.iBr.iX - clipSrcWidth;
+				}
+			// if BottomRight of aDestElementRect is not the same as BottomRight of aDestElementClippedRect
+			if (!CheckTwoRectangleCorners(EBottomRight, aDestElementRect, destElementMovedClippedRect))
+				{// calculate point EBottomRight
+				resultSourceRect.iBr.iY = resultSourceRect.iTl.iY + clipSrcHeight;
+				}
+			if (fullFlipRotationScale)
+				{
+				resultSourceRect.iBr.iX -= dX;
+				resultSourceRect.iTl.iY += dY;
+				}
+			}
+			break;
+		case EBottomRight:
+			{
+			// if BottomLeft of aDestElementRect is not the same as BottomLeft of aDestElementClippedRect
+			if (!CheckTwoRectangleCorners(EBottomLeft, aDestElementRect, destElementMovedClippedRect))
+				{// calculate point EBottomLeft
+				resultSourceRect.iTl.iX = resultSourceRect.iBr.iX - clipSrcWidth;
+				}
+			// if TopRight of aDestElementRect is not the same as TopRight of aDestElementClippedRect
+			if (!CheckTwoRectangleCorners(ETopRight, aDestElementRect, destElementMovedClippedRect))
+				{// calculate point ETopRight
+				resultSourceRect.iTl.iY = resultSourceRect.iBr.iY - clipSrcHeight;
+				}
+			if (fullFlipRotationScale)
+				{
+				resultSourceRect.iBr.iX -= dX;
+				resultSourceRect.iBr.iY -= dY;
+				}
+			}
+			break;
+		case EBottomLeft:
+			{
+			// if BottomRight of aDestElementRect is not the same as BottomRight of aDestElementClippedRect don't change width
+			if (CheckTwoRectangleCorners(EBottomRight, aDestElementRect, destElementMovedClippedRect))
+				{// calculate point EBottomRight
+				resultSourceRect.iBr.iX = resultSourceRect.iTl.iX + clipSrcWidth;
+				}
+			// if TopLeft of aDestElementRect is not the same as TopLeft of aDestElementClippedRect
+			if (CheckTwoRectangleCorners(ETopLeft, aDestElementRect, destElementMovedClippedRect))
+				{// calculate point ETopLeft
+				resultSourceRect.iTl.iY = resultSourceRect.iBr.iY - clipSrcHeight;
+				}
+			if (fullFlipRotationScale)
+				{
+				resultSourceRect.iTl.iX += dX;
+				resultSourceRect.iBr.iY -= dY;
+				}
+			}
+			break;
+		}
+	return resultSourceRect;
+	}
+
+
+
+TInt CElementWrapper::SetSourceRotation(const TElementRotation aElementRotation)
+    {
+    if(iSurfaceId.IsNull())
+        return KErrGeneral;
+    
+    if(aElementRotation < 0 || aElementRotation > 3)
+        return KErrArgument;
+    
+    iRotation = aElementRotation;
+    iUpdateFlags |= EUpdate_SettingValid|EUpdate_SOURCE_ROTATION;
+
+    iOpenWfcWrapper.SetCompositionModified();
+    
+    return KErrNone;
+    }
+
+MWsElement::TElementRotation CElementWrapper::SourceRotation() const
+    {
+    if(iSurfaceId.IsNull())
+        return EElementAntiClockwise0; //default rotation
+
+    return iRotation;
+    }
+
+TInt CElementWrapper::SetTargetRendererFlags(const TUint32& aTargetRendererFlags)
+    {
+    iTargetRendererFlags = aTargetRendererFlags;
+    if (iTargetRendererFlags & EElementTransparencyGlobalAlpha)
+        {
+        iUpdateFlags |= EUpdate_SettingValid|EUpdate_GLOBAL_ALPHA;
+        }
+    
+    if (iTargetRendererFlags & EElementTransparencySource)
+        {
+        iUpdateFlags |= EUpdate_SettingValid|EUpdate_TRANSPARENCY_TYPES;
+        }
+    
+    return KErrNone;
+    }
+
+TInt CElementWrapper::SetRenderStageFlags(const TUint32& aRenderStageFlags)
+    {
+    iRenderStageFlags = aRenderStageFlags;
+    
+    return KErrNone;
+    }
+
+void CElementWrapper::GetTargetRendererFlags(TUint32& aTargetRendererFlags) const
+    {
+    aTargetRendererFlags = iTargetRendererFlags;
+    }
+
+void CElementWrapper::GetRenderStageFlags(TUint32& aRenderStageFlags) const
+    {
+    aRenderStageFlags = iRenderStageFlags;
+    }
+
+MWsElement* CElementWrapper::ElementAbove()
+    {
+    //Check this element has not already been reequsted to be removed
+    if (iUpdateFlags&EUpdate_Remove)
+        {
+        return NULL;
+        }
+    else
+        {
+        return iElementAbove;
+        }
+    }
+
+MWsElement* CElementWrapper::ElementBelow()
+    {
+    //Check this element has not already been reequsted to be removed
+    if (iUpdateFlags&EUpdate_Remove)
+        {
+        return NULL;
+        }
+    else
+        {
+        return iElementBelow;
+        }
+    }
+
+TInt CElementWrapper::ConnectSurface(const TSurfaceId& aSurface)
+    {
+    TInt err = KErrNone;
+     if (aSurface!=iSurfaceId)
+        {
+        if (!aSurface.IsNull())
+            {
+            if(!iOpenWfcWrapper.IncEltRefRegSource(aSurface))
+                {
+                return KErrNotFound;
+                }
+            else
+                {
+                RSurfaceManager::TInfoBuf buff;
+                err = err = SurfaceInfo(aSurface, buff);
+                if (err != KErrNone)
+                    {
+                    return iOpenWfcWrapper.DecEltRefRegSource(aSurface);
+                    }
+                else
+                    {
+                    iSurfaceSize=buff().iSize;
+                    }
+                }
+            }
+        else
+            {
+            iSurfaceSize.SetSize(0,0);
+            }
+        UnsetSurface(iSurfaceId);
+        iSurfaceId=aSurface;
+        iUpdateFlags |= EUpdate_SettingValid|EUpdate_SOURCE;
+        if (iSourcRect.IsEmpty())
+            {
+            iUpdateFlags |= EUpdate_SettingValid|EUpdate_SOURCE_RECTANGLE;
+            }
+        }
+    else
+        {   //Note this code is simply here to return the error!
+        if (!iSurfaceId.IsNull())
+            {
+            if (iOpenWfcWrapper.IncEltRefRegSource(iSurfaceId))
+                {
+                iOpenWfcWrapper.DecEltRefRegSource(iSurfaceId);
+                }
+            else
+                {
+                return KErrNotFound;
+                }
+            }
+        }
+    
+    iOpenWfcWrapper.SetCompositionModified();
+    
+    return err;
+    }
+
+const TSurfaceId& CElementWrapper::ConnectedSurface() const
+    {
+    return iSurfaceId;
+    }
+
+/** 
+ * Sets the element source to match the surface ID and optionally locks the reference count until next composition.
+ **/
+void CElementWrapper::SetEltSourceComposed()
+    {
+    iUpdateFlags |= EUpdate_SceneCommited;
+    }
+
+/** 
+ * Sets the element source to match the surface ID and optionally locks the reference count until next composition.
+ **/
+void CElementWrapper::SetEltSource(WFCElement aElement)const
+    {
+    WFCSource source = WFC_INVALID_HANDLE;
+    if (!iSurfaceId.IsNull())
+        {
+        source=iOpenWfcWrapper.IncEltRefRegSource(iSurfaceId);
+        if(source)
+            {
+            TInt remains=iOpenWfcWrapper.DecEltRefRegSource(iSurfaceId);
+            OPENWFC_ASSERT_DEBUG(remains>0,EPanicWfcNoStreamSurface);
+            }
+        }
+    wfcSetElementAttribi(iOpenWfcWrapper.Device(),aElement,WFC_ELEMENT_SOURCE,source);
+    }
+
+/** 
+ * Internal method releases the previous registered surface, and clears the caller's member var.
+ * @return true if any resources released
+ **/
+TBool CElementWrapper::UnsetSurface(TSurfaceId& aSurface)
+    {
+    if (!aSurface.IsNull())
+        {
+        TInt err = iOpenWfcWrapper.DecEltRefRegSource(aSurface);
+        OPENWFC_ASSERT_DEBUG(err >= 0,EPanicWfcSourceLookupOnElementRemoval);
+        aSurface = aSurface.CreateNullId();
+        return (err == KErrNone); //>0 indicates object count non-zero
+        }
+    return EFalse;
+    }
+
+void CElementWrapper::SetEltTransparencyTypes(WFCElement aElement)const
+    {
+    TInt transType = WFC_TRANSPARENCY_NONE;
+    if (iTargetRendererFlags & EElementTransparencySource)
+        {
+        transType |= WFC_TRANSPARENCY_SOURCE;
+        }
+    if (iTargetRendererFlags & EElementTransparencyGlobalAlpha)
+        {
+        transType |= WFC_TRANSPARENCY_ELEMENT_GLOBAL_ALPHA;
+        }
+    wfcSetElementAttribi(iOpenWfcWrapper.Device(),aElement,WFC_ELEMENT_TRANSPARENCY_TYPES,transType);
+    }
+
+void CElementWrapper::HelpStreamGetHeader(khronos_int32_t* aWidth, khronos_int32_t* aHeight)const
+    {
+    if (aWidth)
+        {
+        *aWidth=iSurfaceSize.iWidth;
+        }
+    if (aHeight)
+        {
+        *aHeight=iSurfaceSize.iHeight;
+        }
+    }
+
+/**
+ *  Maps the source rectangle to fp values matching the region and destination rectangle data over a element object.
+ *  This is when the source rectangle changes.
+ *  Only repositions existing elements
+ **/
+void CElementWrapper::SetEltSourceRectangle(WFCElement aElement)
+    {
+    TRect srcRect;
+    GetSourceRectangle(srcRect);
+    if (!iDestinationClippingRect.IsEmpty())
+    	{
+    	 TRect destinationRect=iDestinationRect;
+    	 destinationRect.Intersection(iDestinationClippingRect);
+    	 if(!destinationRect.IsEmpty())
+    		 {
+    		 srcRect = SetSourceDestRect(iDestinationRect,destinationRect,srcRect,iFlipped,iRotation);
+    		 }
+    	}
+    float rect[4]={srcRect.iTl.iX,srcRect.iTl.iY,srcRect.Width(),srcRect.Height()};
+    wfcSetElementAttribfv(iOpenWfcWrapper.Device(),aElement,WFC_ELEMENT_SOURCE_RECTANGLE,4,rect);
+    }
+
+void CElementWrapper::SetEltSourceFlip(WFCElement aElement)const
+    {
+    wfcSetElementAttribi(iOpenWfcWrapper.Device(),aElement,WFC_ELEMENT_SOURCE_FLIP, iFlipped);
+    }
+
+/**
+ *  Maps the region and destination rectangle data into a element object
+ *  taking into account the source rectangle mapping and region data
+ *  @return KErrNone or KErrMemory
+ **/
+void CElementWrapper::SetEltDestinationRectangle(WFCElement aElement)const
+    {
+    TRect destinationRect=iDestinationRect;
+    if (!iDestinationClippingRect.IsEmpty())
+    	{
+    	destinationRect.Intersection(iDestinationClippingRect);
+    	}
+    float destRect[4]={destinationRect.iTl.iX,destinationRect.iTl.iY,destinationRect.Width()<0?0:destinationRect.Width(),destinationRect.Height()<0?0:destinationRect.Height()};
+    wfcSetElementAttribfv(iOpenWfcWrapper.Device(),aElement,WFC_ELEMENT_DESTINATION_RECTANGLE,4,destRect);
+
+    LILOG(("### EXIT SetEltDestinationRectangle()"));
+    }
+
+/**
+ *  Maps the region and destination rectangle data into a element object.
+ *  taking in to account the source rectangle mapping and region data
+ *  @param aOffset  an offset ADDED to every destination rectangle
+ *  @return KErrNone or KErrMemory
+ **/
+void CElementWrapper::SetEltDestinationRectangle(WFCElement aElement, const TPoint& aOffset)const
+    {
+    TRect destinationRect=iDestinationRect;
+    if (!iDestinationClippingRect.IsEmpty())
+        {
+        destinationRect.Intersection(iDestinationClippingRect);
+        }
+    float rect[4]={destinationRect.iTl.iX+aOffset.iX,destinationRect.iTl.iY+aOffset.iY,destinationRect.Width(),destinationRect.Height()};
+    wfcSetElementAttribfv(iOpenWfcWrapper.Device(),aElement,WFC_ELEMENT_DESTINATION_RECTANGLE,4,rect);
+    }
+
+void CElementWrapper::RemoveAfter(CElementWrapper** apElementBelow)
+    {
+    iUpdateFlags&=~(EUpdate_Insert|EUpdate_Remove);
+    if(apElementBelow)
+        {
+        *apElementBelow = iElementAbove;
+        if (iElementAbove)
+            {
+            iElementAbove->iElementBelow = iElementBelow;
+            }
+        }
+    iElementBelow = NULL;
+    iElementAbove = NULL;
+    }
+
+void CElementWrapper::InsertAfter(CElementWrapper*& aRefElementBelow, CElementWrapper* aElementBelow, TOwfUpdates aUpdateFlag)
+    {
+    OPENWFC_ASSERT_DEBUG(aUpdateFlag&(EUpdate_Insert|aUpdateFlag&EUpdate_Remove|aUpdateFlag&EUpdate_Destroy), EPanicUnexpectedErrorElementScene);
+    iUpdateFlags |= EUpdate_SettingValid|aUpdateFlag;
+    iElementAbove = aRefElementBelow;
+    iElementBelow = aElementBelow;
+    aRefElementBelow = this;
+    if (iElementAbove)
+        {
+        iElementAbove->iElementBelow = this;
+        }
+    }
+
+/* Returns a pointer referencing this object from below.
+ * @return the pointer or null if there is no "below" object
+ */
+CElementWrapper** CElementWrapper::RefsMyElementBelow()
+    {
+    if (iElementBelow)
+        {
+        return &iElementBelow->iElementAbove;
+        }
+
+    return NULL;
+    }
+
+CElementWrapper*& CElementWrapper::MyElementAbove()
+    {
+    return iElementAbove;
+    }
+
+TInt CElementWrapper::WfcRotation(MWsElement::TElementRotation aRotation)
+    {
+    switch (aRotation)
+        {
+    case EElementAntiClockwise0:
+        return WFC_ROTATION_0;
+    case EElementAntiClockwise90:
+        return WFC_ROTATION_270;
+    case EElementAntiClockwise180:
+        return WFC_ROTATION_180;
+    default: // EElementAntiClockwise270
+        return WFC_ROTATION_90;
+        }
+    }
+
+TBool CElementWrapper::IsNewElementLegal()const
+    {
+    //OWF SI will fail if certain illegal element attributes are passed to it.
+    //Various members must be non-zero:
+        //destination rectangle
+        //source
+        //global alpha
+    if (iDestinationRect.IsEmpty() || iSurfaceId.IsNull()||iGlobalAlpha==0)
+        {
+        return EFalse;
+        }
+    //If the source rectangle is set it must be inside the surface size
+    if (!iSourcRect.IsEmpty())
+        {
+        if (iSourcRect.iTl.iX<0 || iSourcRect.iTl.iY<0)
+            {
+            return EFalse;
+            }
+        TInt32 width;
+        TInt32 height;
+        HelpStreamGetHeader(&width,&height);
+        if (iSourcRect.iBr.iX>width || iSourcRect.iBr.iY>height)
+            {
+            return EFalse;
+            }
+        }
+    //If mask is defined and enabled, Mask size must match destination rectangle size
+        //masks are currently not implemented
+    //If mask is enabled then source alpha must not be enabled
+        //masks are currently not implemented
+    return ETrue;
+    }
+/** 
+ * Flushes any flagged scene or attribute changes into the element objects
+ * @return  EFalse if no flushing occurred - for any reason
+ **/
+TBool CElementWrapper::FlushSceneChanges()
+    {
+    TInt updateFlags=iUpdateFlags;
+    if  ((updateFlags&EUpdate_AttributesIllegal) && !(updateFlags&EUpdate_SettingValid))
+        {
+        return EFalse;
+        }
+    
+    if (updateFlags==EUpdate_None)
+        {
+        return EFalse;
+        }
+
+    if (updateFlags&(EUpdate_Remove|EUpdate_Destroy) && (updateFlags&EUpdate_SceneCommited))
+        {
+        wfcRemoveElement(iOpenWfcWrapper.Device(),iElement);
+        }
+    
+    if (updateFlags&EUpdate_Destroy)
+        {
+        return EFalse;
+        }
+    
+    if (updateFlags&(EUpdate_Remove|EUpdate_Destroy))
+        {
+        iUpdateFlags&=~(EUpdate_Insert|EUpdate_Remove|EUpdate_SceneCommited);
+        return EFalse;
+        }
+    
+    TBool isElementLegal=IsNewElementLegal();
+    if (!isElementLegal)
+        {   //If the element would not be legal then it must not be inserted
+            //It may even need to be removed.
+        if (updateFlags&EUpdate_SceneCommited)
+            {   //it is in the scene, remove it
+            wfcRemoveElement(iOpenWfcWrapper.Device(),iElement);
+            updateFlags &= ~EUpdate_SceneCommited;
+            }
+
+        //Re-flag the update but also set a flag
+        //so that we don't bother to check legality again until another attribute change.
+        updateFlags&=~EUpdate_SettingValid;
+        updateFlags|=EUpdate_AttributesIllegal;
+        iUpdateFlags=updateFlags;
+
+        LILOG(("### EXIT CElementWrapper::FlushSceneChanges() FALSE"));
+        return EFalse;
+        }
+
+    WFCElement elementBelow=WFC_INVALID_HANDLE;
+    if ((updateFlags&(EUpdate_Insert|EUpdate_AttributesIllegal)))
+        {
+        if (CElementWrapper* elementWrapperBelow=iElementBelow)
+            {
+            while (elementWrapperBelow && elementWrapperBelow->iUpdateFlags&EUpdate_AttributesIllegal)
+                {
+                elementWrapperBelow=elementWrapperBelow->iElementBelow;
+                }
+            if (elementWrapperBelow)
+                {
+                elementBelow=elementWrapperBelow->iElement;
+                }
+            }
+        }
+    
+    iUpdateFlags = EUpdate_SceneCommited;
+    
+    if ((updateFlags&~EUpdate_Remove))
+        {
+        FlushAttributeChanges(iElement, updateFlags);
+        if (updateFlags&(EUpdate_Insert|EUpdate_AttributesIllegal))
+            {
+            wfcInsertElement(iOpenWfcWrapper.Device(),iElement,elementBelow);
+            }
+        }
+
+     FlushAttributeChanges(iElement, EUpdate_ALL_ATTRIBS|EUpdate_DontLockSource);
+     wfcInsertElement(iOpenWfcWrapper.Device(),iElement,elementBelow);
+
+    LILOG(("### EXIT CElementWrapper::FlushSceneChanges() FALSE"));
+    return ETrue;
+    }
+
+void CElementWrapper::FlushAttributeChanges(WFCElement aElement, TInt aUpdateFlags)
+    {
+    LILOG(("### ENTER FlushAttributeChanges() aStart(%d), aPastMax(%d), uFl(0x%x)", aStart, aPastMax, aUpdateFlags));
+
+    //At present all attribute changes are flushed immediately... assert that behaviour.
+    if (aUpdateFlags&EUpdate_SOURCE_GEOMETRY_SET)
+        {
+        SetEltSourceRectangle(aElement);
+        }
+    if (aUpdateFlags&(EUpdate_SOURCE|EUpdate_SettingValid))
+        {
+        SetEltSource(aElement);
+        }
+    if (aUpdateFlags&EUpdate_SOURCE_FLIP)
+        {
+        SetEltSourceFlip(aElement);
+        }
+    if (aUpdateFlags&EUpdate_SOURCE_ROTATION)
+        {
+        TInt wfcRot=WfcRotation(iRotation);
+        wfcSetElementAttribi(iOpenWfcWrapper.Device(),iElement,WFC_ELEMENT_SOURCE_ROTATION,wfcRot);
+        }
+    if (aUpdateFlags&EUpdate_TRANSPARENCY_TYPES)
+        {
+        SetEltTransparencyTypes(aElement);
+        }
+    if (aUpdateFlags&EUpdate_GLOBAL_ALPHA)
+        {
+        wfcSetElementAttribi(iOpenWfcWrapper.Device(),aElement,WFC_ELEMENT_GLOBAL_ALPHA,iGlobalAlpha);
+        }
+    if (aUpdateFlags&EUpdate_DESTINATION_RECTANGLE)
+        {
+        SetEltDestinationRectangle(aElement);
+        }
+    LILOG(("### EXIT FlushAttributeChanges()"));
+    }
+
+TInt CElementWrapper::ReplicateElements(WFCContext aContext, WFCElement& aPreviousTargetElement,const TPoint& aOffset)
+    {
+    if (aContext == WFC_INVALID_HANDLE)
+        {
+        return KErrArgument;
+        }
+    
+    if (!IsNewElementLegal())
+        {
+        return KErrNone;
+        }
+
+    WFCDevice device = iOpenWfcWrapper.Device();
+    WFCContext onScreenContext = iOpenWfcWrapper.OnScreenContext();
+    // clean the existing system errors and look for new ones
+    wfcGetError(device);
+    WFCSource targetImageSource = wfcCreateSourceFromStream(device, aContext, reinterpret_cast<WFCNativeStreamType>(&iSurfaceId), NULL);
+    if (targetImageSource == WFC_INVALID_HANDLE)
+        {
+        return COpenWfcWrapper::TranslateOpenWfcError(wfcGetError(device));
+        }
+     
+    WFCElement targetElement = WFC_INVALID_HANDLE;
+
+    // the elements are created but we don't get hold of them for longer than we need
+    // all elements created now are to be destroyed when composition is completed
+    targetElement = wfcCreateElement(device, aContext, NULL);
+    if (targetElement == WFC_INVALID_HANDLE)
+        {
+        return COpenWfcWrapper::TranslateOpenWfcError(wfcGetError(device));
+        }
+
+    // we can just flush the attributes to the new elements because the off-screen context attributes
+    // share the same device with the on-screen context. If this changes make device a parameter!
+    wfcSetElementAttribi(device,targetElement,WFC_ELEMENT_SOURCE,targetImageSource);
+    FlushAttributeChanges(targetElement, (EUpdate_ALL_ATTRIBS&~(EUpdate_SOURCE|EUpdate_DESTINATION_RECTANGLE)));
+    SetEltDestinationRectangle(targetElement, aOffset);
+    wfcInsertElement(iOpenWfcWrapper.Device(),targetElement,aPreviousTargetElement);
+    aPreviousTargetElement = targetElement;
+
+    return COpenWfcWrapper::TranslateOpenWfcError(wfcGetError(device));
+    }
+
+TInt CElementWrapper::SurfaceInfo(const TSurfaceId& aSurface, RSurfaceManager::TInfoBuf& aInfo)
+    {
+    TInt err = KErrNone;
+    switch(aSurface.Type())
+        {
+        case TSurfaceTypes::ESurfaceManagerSurface:
+            {
+            err = Owner().SurfaceManager().SurfaceInfo(aSurface, aInfo);                   
+            break;
+            }
+        case TSurfaceId::EScreenSurface:      
+            {
+            TInt screenId = aSurface.iInternal[TSurfaceId::TScreenSurfaceUsage::EScreenField];
+            TInt width = 0;
+            err = HAL::Get(screenId, HALData::EDisplayXPixels, width);
+            if (err != KErrNone)
+                {
+                iOpenWfcWrapper.DecEltRefRegSource(aSurface);
+                return err;
+                }
+            
+            TInt height = 0;
+            err = HAL::Get(screenId, HALData::EDisplayYPixels, height);
+            if (err != KErrNone)
+                {
+                iOpenWfcWrapper.DecEltRefRegSource(aSurface);
+                return err;
+                }
+            
+            aInfo().iSize = TSize(width, height);      
+            
+#ifdef  SYMBIAN_ROTATION_MODE_CHANGES
+            TInt displayMode = aSurface.iInternal[TSurfaceId::TScreenSurfaceUsage::EHalField];
+#else
+            TInt displayMode = 0;
+            err = HAL::Get(screenId, HALData::EDisplayMode, displayMode);
+            if (err != KErrNone)
+                {
+                iOpenWfcWrapper.DecEltRefRegSource(aSurface);
+                return err;
+                }                       
+#endif                      
+
+#if defined(SYMBIAN_ROTATION_MODE_CHANGES)
+            if (displayMode & TSurfaceId::TScreenSurfaceUsage::EHalFlippedFlag) // 90 | 270 degree rotation
+                {
+                // Swap dimensions and recalculate stride. Assume no padding for now.
+                aInfo().iSize.iWidth = height;
+                aInfo().iSize.iHeight = width;
+                //"vertical" stride has already been fetched
+                }
+#elif defined(SYMBIAN_ROTATION_CHANGES)
+            if (aSurface.iInternal[1] & (2 | 8))    // 90 | 270 degree rotation
+                {
+                // Swap dimensions and recalculate stride. Assume no padding for now.
+                aInfo().iSize.iWidth = height;
+                aInfo().iSize.iHeight = width;
+                }
+#endif                          
+            
+            break;
+            }
+        default:
+            err = KErrNotSupported;
+        }    
+    
+    return err;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/src/openwfcjob.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,86 @@
+// 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 "openwfcjob.h"
+#include "openwfcjobmanager.h"
+
+TOpenWfcJob::TOpenWfcJob(COpenWfcJobManger& aJobManager):
+iJobManager(aJobManager),
+iJobId(EInvalidJobId), 
+iCallingThread(KNullThreadId),
+iCompleteRequest(NULL)
+	{
+	
+	}
+
+void TOpenWfcJob::Set(EOpenWfcJobId aJob,
+		              TThreadId aThreadId,
+		              TRequestStatus* aRequest)
+	{
+	iJobId = aJob; 
+	iCallingThread = aThreadId;
+	iCompleteRequest =aRequest;
+    JQLOG(("** TOpenWfcJob::Sett() : iCompleteRequest(0x%x) iJobId(%d)", aRequest, aJob));
+	}
+
+
+void TOpenWfcJob::Reset()
+	{
+	iJobId = EInvalidJobId; 
+	iCallingThread = KNullThreadId;
+	iCompleteRequest =NULL;
+	}
+
+TOpenWfcJob::~TOpenWfcJob()
+	{
+	}
+
+
+void TOpenWfcJob::Run()
+	{
+	switch (iJobId)
+		{
+		case EComposeJobId:
+            JQLOG(("** LAUNCH * TOpenWfcJob::Run EComposeJobId"));
+			iJobManager.DoComposeJob(*this);
+			break;
+		case EPauseCompositionJobId:
+            JQLOG(("** LAUNCH * TOpenWfcJob::Run EPauseCompositionJobId"));
+			iJobManager.DoPauseCompositionJob(*this);
+			break;
+		case EResumeCompositionJobId:
+            JQLOG(("** LAUNCH * TOpenWfcJob::Run EResumeCompositionJobId"));
+			iJobManager.DoResumeCompositionJob(*this);
+			break;
+		default:
+		    JQLOG(("** ERROR * TOpenWfcJob::Run jobId(%d)", iJobId));
+			break;
+		}
+	}
+
+void TOpenWfcJob::CompleteRequest(TInt aResult)
+    {
+    if (iCompleteRequest)
+        {
+        RThread thread;
+        
+        if (thread.Open(iCallingThread) == KErrNone)
+            {
+            JQLOG(("** TOpenWfcJob::CompleteRequest(): CompleteReq(0x%x))", iCompleteRequest));
+            thread.RequestComplete(iCompleteRequest, aResult);
+            thread.Close();
+            }
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/src/openwfcjobmanager.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,426 @@
+// 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 "openwfcjobmanager.h"
+#include "openwfcwrapper.h"
+#include "openwfcthreadmanager.h"
+#include "openwfcpanics.h"
+#include <e32debug.h>
+
+#include <graphics/eglsynchelper.h>
+
+COpenWfcJobManger::TComposeRequestDetails::TComposeRequestDetails():
+iCommitRequest(NULL),
+iCallingThread(KNullThreadId)
+    {
+    
+    }
+
+void COpenWfcJobManger::TComposeRequestDetails::Set(TRequestStatus* aCommitRequest, TThreadId aCallingThread)
+    {
+    iCommitRequest = aCommitRequest;
+    iCallingThread = aCallingThread;
+    }
+
+void COpenWfcJobManger::TComposeRequestDetails::Reset()
+    {
+    iCommitRequest = NULL;
+    iCallingThread = KNullThreadId;
+    }
+
+COpenWfcJobManger::Guard::Guard(RMutex& aLock):
+iLock(aLock)
+    {
+    iLock.Wait();
+    }
+
+COpenWfcJobManger::Guard::~Guard()
+    {
+    iLock.Signal();
+    }
+
+COpenWfcJobManger::COpenWfcJobManger(COpenWfcWrapper& aOpenWfcWrapper, 
+                                           WFCDevice aDevice, 
+                                           WFCContext aContext,
+                                           TInt aManagerId):
+iComposeDetailsPool(_FOFF(TComposeRequestDetails, iDlink)),
+iComposeDetailsPoolIter(iComposeDetailsPool),
+iComposeDetailsList(_FOFF(TComposeRequestDetails, iDlink)),
+iComposeDetailsListIter(iComposeDetailsList),
+iOpenWfcWrapper(aOpenWfcWrapper),
+iDevice(aDevice),
+iContext(aContext),
+iCompositionPaused(ETrue),
+iPausedComposePending(ETrue),
+iThreadManager(NULL),
+iManagerId(aManagerId),
+iSync(EGL_NO_SYNC_KHR),
+iEglDisplay(aOpenWfcWrapper.Display()),
+iOutstandingJob(EOpenWfcInvalidJobId)
+    {
+    
+    }
+
+COpenWfcJobManger::~COpenWfcJobManger()
+    {
+    JQLOG(("** ENTER * COpenWfcJobManger::~COpenWfcJobManger()"));
+    iCommandLock.Wait();
+    iJobLock.Wait();
+    
+    CompleteComposeRequests(KErrNone);
+    
+    delete iThreadManager;
+
+    
+    TComposeRequestDetails* pDetail = NULL;
+    iComposeDetailsListIter.SetToFirst();
+    while ((pDetail = iComposeDetailsListIter++) != NULL)
+        {
+        pDetail->iDlink.Deque();
+        delete pDetail;
+        }
+
+    iComposeDetailsPoolIter.SetToFirst();
+    while ((pDetail = iComposeDetailsPoolIter++) != NULL)
+        {
+        pDetail->iDlink.Deque();
+        delete pDetail;
+        }
+    
+    eglDestroySyncKHR(iEglDisplay, iSync);
+    iJobLock.Signal();
+    iCommandLock.Signal();
+    iJobLock.Close();
+    iCommandLock.Close();
+    JQLOG(("** EXIT * COpenWfcJobManger::~COpenWfcJobManger()"));
+    }
+
+COpenWfcJobManger* COpenWfcJobManger::NewLC(COpenWfcWrapper& aOpenWfcWrapper, 
+                                                 WFCDevice aDevice, 
+                                                 WFCContext aContext,
+                                                 TInt aManagerId)
+    {
+    COpenWfcJobManger* self = new(ELeave) COpenWfcJobManger(aOpenWfcWrapper, aDevice, aContext, aManagerId);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return(self);
+    }
+
+COpenWfcJobManger* COpenWfcJobManger::NewL(COpenWfcWrapper& aOpenWfcWrapper, 
+                                                  WFCDevice aDevice, 
+                                                  WFCContext aContext,
+                                                  TInt aManagerId)
+    {
+    COpenWfcJobManger* self = COpenWfcJobManger::NewLC(aOpenWfcWrapper, aDevice, aContext, aManagerId);
+    CleanupStack::Pop(self);
+    return self;
+    }
+    
+void COpenWfcJobManger::ConstructL()
+    {
+    User::LeaveIfError(iJobLock.CreateLocal());
+    User::LeaveIfError(iCommandLock.CreateLocal());
+    User::LeaveIfNull(iThreadManager = COpenWfcMonitorThread::NewL(iManagerId, *this));
+    
+    TComposeRequestDetails* pDetail = NULL;
+    for (TInt i = 0; i < KComposeDetailsPoolSize; i++)
+        {
+        pDetail = new (ELeave) TComposeRequestDetails();
+        iComposeDetailsPool.AddLast(*pDetail);
+        }
+    
+    EGLint attrib_list[1] = { EGL_NONE };
+    
+    iSync = eglCreateSyncKHR(iEglDisplay,
+                             EGL_SYNC_REUSABLE_KHR,
+                             attrib_list);
+    
+    if (iSync == EGL_NO_SYNC_KHR)
+        {  //code inspection reveals the only reason eglsync will fail is for memory...
+        User::Leave(KErrNoMemory);
+        }
+    }
+
+
+COpenWfcJobManger::TComposeRequestDetails* COpenWfcJobManger::AppendDetailsFromPool()
+    {
+    iComposeDetailsPoolIter.SetToFirst();
+    TComposeRequestDetails* pDetails = iComposeDetailsPoolIter;
+    if (pDetails)
+        {
+        pDetails->iDlink.Deque();
+        iComposeDetailsList.AddLast(*pDetails);
+        }
+    return pDetails;
+    }
+
+
+void COpenWfcJobManger::ComposeRequest(TRequestStatus* aCompleted)
+    {
+    JQLOG(("** ENTER * COpenWfcJobManger::ComposeRequest(0x%x) WAIT FOR LOCKS", aCompleted));
+    Guard g(iCommandLock);
+    
+    JQLOG(("** ENTER * COpenWfcJobManger::ComposeRequest(0x%x) COMMAND LOCK ACQUIRED", aCompleted));
+    {
+    Guard g(iJobLock);
+    JQLOG(("** ENTER * COpenWfcJobManger::ComposeRequest(0x%x) JOB LOCK ACQUIRED", aCompleted));
+    if (iCompositionPaused)
+        {
+        JQLOG(("** COpenWfcJobManger::ComposeRequest() EOpenWfcComposeJobId TRIGER compose job when resumed"));
+        iPausedComposePending = ETrue;
+        }
+    else
+        {
+        // in this point we expect that the oustanding command is compose if any
+        JQLOG(("** COpenWfcJobManger::ComposeRequest() EOpenWfcComposeJobId AUTONOMUS compose job"));
+        OPENWFC_ASSERT_DEBUG(iOutstandingJob == EOpenWfcComposeJobId || iOutstandingJob == EOpenWfcInvalidJobId, 
+                            EPanicWfcThreadManagerCannotQueueJob);
+        iOutstandingJob = EOpenWfcComposeJobId;
+        }
+        
+    // if pJob is NULL it means we have to add a Compose job to the job queue
+    
+    TInt err = wfcGetError(iDevice);
+    if (err)
+        {
+        JQLOG(("** COpenWfcJobManger::ComposeRequest() : ENTER FlushSceneElementChanges Error(%d)", err));
+        }
+    iOpenWfcWrapper.FlushSceneElementChanges();
+    // cleaning, also the "dirt"
+    err = wfcGetError(iDevice);
+    if (err)
+        {
+        JQLOG(("** COpenWfcJobManger::ComposeRequest() : EXIT FlushSceneElementChanges Error(%d)", err));
+        }
+    
+    if (aCompleted)
+        {
+        // Let's store whatever compose complete notifications we may have
+        TComposeRequestDetails* pDetails = AppendDetailsFromPool();
+        
+        if (pDetails)
+            {
+            // set the details if we could find a detail
+            JQLOG(("** COpenWfcJobManger::ComposeRequest(): StoreReq(0x%x))", aCompleted));
+            pDetails->Set(aCompleted, RThread().Id());
+            *aCompleted = KRequestPending;
+            }
+        else
+            {
+            // signal that enough is enough
+            JQLOG(("** COpenWfcJobManger::ComposeRequest(): OverflowReq(0x%x))", aCompleted));
+            RThread().RequestComplete(aCompleted, KErrOverflow);
+            }
+        }
+    
+    JQLOG(("** COpenWfcJobManger::ComposeRequest(0x%x) JOB LOCK RELEASED", aCompleted));
+    }
+    
+    // if a job has been queued, trigger the composition (it can happen only in autonomous mode)
+    if (iOutstandingJob == EOpenWfcComposeJobId)
+        {
+        JQLOG(("** COpenWfcJobManger::ComposeRequest(): iThreadManager->Signal()"));
+        iThreadManager->Signal();
+        }
+    
+    JQLOG(("** EXIT * COpenWfcJobManger::ComposeRequest()"));
+    }
+
+void COpenWfcJobManger::CompositionPauseRequest()
+    {
+    JQLOG(("** ENTER * COpenWfcJobManger::CompositionPauseRequest() WAIT FOR LOCKS"));
+    Guard g(iCommandLock);
+    JQLOG(("** ENTER * COpenWfcJobManger::CompositionPauseRequest() COMMAND LOCK ACQUIRED"));
+    TBool newJob = EFalse; 
+        {
+        Guard g(iJobLock);
+        JQLOG(("** ENTER * COpenWfcJobManger::CompositionPauseRequest() JOB LOCK ACQUIRED"));
+        if (!iCompositionPaused)
+            {
+            iCompositionPaused = ETrue;
+            if (iOutstandingJob == EOpenWfcComposeJobId)
+                {
+                JQLOG(("** COpenWfcJobManger::CompositionPauseRequest() found outstanding composition request"));
+                iPausedComposePending = ETrue;
+                }
+        
+            iOutstandingJob = EOpenWfcPauseCompositionJobId;
+            iPauseResumeRequestStatus = KRequestPending;
+            iPauseResumeThread = RThread().Id();
+            newJob = ETrue;
+            JQLOG(("** COpenWfcJobManger::CompositionPauseRequest() : trigger new job"));
+            }
+        JQLOG(("** ENTER * COpenWfcJobManger::CompositionPauseRequest() JOB LOCK RELEASED"));
+        }
+    
+    if(newJob)
+        {
+        JQLOG(("** COpenWfcJobManger::CompositionPauseRequest() : Signal()"));
+        iThreadManager->Signal();
+        User::WaitForRequest(iPauseResumeRequestStatus);
+        }
+    
+    JQLOG(("** EXIT * COpenWfcJobManger::CompositionPauseRequest()"));
+    }
+
+void COpenWfcJobManger::CompositionResumeRequest()
+    {
+    JQLOG(("** ENTER * COpenWfcJobManger::CompositionResumeRequest() WAIT FOR LOCK"));
+    Guard g(iCommandLock);
+    JQLOG(("** ENTER * COpenWfcJobManger::CompositionResumeRequest() COMMAND LOCK ACQUIRED"));
+    TBool newJob = EFalse;
+        {
+        Guard g(iJobLock);
+        JQLOG(("** ENTER * COpenWfcJobManger::CompositionResumeRequest() JOB LOCK ACQUIRED"));
+        if (iCompositionPaused)
+            {
+            iOutstandingJob = EOpenWfcResumeCompositionJobId;
+            iPauseResumeRequestStatus = KRequestPending;
+            iPauseResumeThread = RThread().Id();
+            newJob = ETrue;
+            JQLOG(("** COpenWfcJobManger::CompositionResumeRequest() : trigger new job"));
+            }
+        JQLOG(("** COpenWfcJobManger::CompositionResumeRequest() JOB LOCK RELEASED"));
+        }
+        
+    if(newJob)
+        {
+        JQLOG(("** COpenWfcJobManger::CompositionResumeRequest() : Signal"));
+        iThreadManager->Signal();
+        User::WaitForRequest(iPauseResumeRequestStatus);
+        }
+    
+    JQLOG(("** EXIT * COpenWfcJobManger::CompositionResumeRequest()"));
+    }
+
+void COpenWfcJobManger::CompleteComposeRequests(TInt aResult)
+    {
+    TComposeRequestDetails* pDetail = NULL;
+    iComposeDetailsListIter.SetToFirst();
+    
+    while ((pDetail = iComposeDetailsListIter++) != NULL)
+        {
+        RThread thread;
+        if (pDetail->iCommitRequest && (thread.Open(pDetail->iCallingThread) == KErrNone))
+            {
+            JQLOG(("** COpenWfcJobManger::CompleteComposeRequests(): CompleteReq(0x%x) Result(%d))", pDetail->iCommitRequest, aResult));
+            thread.RequestComplete(pDetail->iCommitRequest, aResult);
+            thread.Close();
+            }
+        
+        pDetail->iDlink.Deque();
+        iComposeDetailsPool.AddLast(*pDetail);
+        pDetail->Reset();
+        }
+    }
+
+void COpenWfcJobManger::CompletePauseResumeRequest(TInt aResult)
+    {
+    RThread thread;
+    if (thread.Open(iPauseResumeThread) == KErrNone)
+        {
+        TRequestStatus* rs= &iPauseResumeRequestStatus;
+        JQLOG(("** COpenWfcJobManger::CompletePauseResumeRequest(): %d)", aResult));
+        thread.RequestComplete(rs, aResult);
+        thread.Close();
+        }
+    }
+
+void COpenWfcJobManger::DoExecuteJob()
+    {
+    JQLOG(("** ENTER * COpenWfcJobManger::DoExecuteJob() Enter Wait for Job Lock"));
+    iJobLock.Wait();
+    JQLOG(("** COpenWfcJobManger::DoExecuteJob(%d)", iOutstandingJob));
+    EOpenWfcJobId job = iOutstandingJob;
+    iOutstandingJob = EOpenWfcInvalidJobId;
+    switch (job)
+        {
+        case EOpenWfcComposeJobId:
+            DoComposeJob();
+            break;
+        case EOpenWfcPauseCompositionJobId:
+            DoPauseCompositionJob();
+            break;
+        case EOpenWfcResumeCompositionJobId:
+            DoResumeCompositionJob();
+            break;
+        default:
+            iJobLock.Signal();
+            break;
+        }
+    
+    JQLOG(("** ENTER * COpenWfcJobManger::DoExecuteJob() Exit"));
+    }
+
+void COpenWfcJobManger::DoComposeJob()
+    {
+    JQLOG(("** ENTER * COpenWfcJobManger::DoComposeJob()"));
+    Commit();
+    
+    Fence();
+    WaitForSync();
+    
+    // complete all the notifications stored until this momment
+    CompleteComposeRequests(KErrNone);
+    JQLOG(("** COpenWfcJobManger::DoComposeJob() LOCK RELEASED"));
+    
+    iJobLock.Signal();
+    JQLOG(("** EXIT * COpenWfcJobManger::DoComposeJob()"));
+    }
+
+void COpenWfcJobManger::DoPauseCompositionJob()
+    {
+    JQLOG(("** ENTER * COpenWfcJobManger::DoPauseCompositionJob()"));
+    Deactivate();
+    Fence();
+    WaitForSync();
+    CompletePauseResumeRequest(KErrNone);
+    JQLOG(("** COpenWfcJobManger::DoPauseCompositionJob() RELEASE LOCK"));
+    
+    iJobLock.Signal();
+    JQLOG(("** EXIT * COpenWfcJobManger::DoPauseCompositionJob() job lock released"));
+    }
+
+void COpenWfcJobManger::DoResumeCompositionJob()
+    {
+    JQLOG(("** ENTER * COpenWfcJobManger::DoResumeCompositionJob()"));
+    
+    iComposeDetailsListIter.SetToFirst();
+    TComposeRequestDetails* pQueuedRequest = iComposeDetailsListIter;
+    
+    if (iPausedComposePending || pQueuedRequest)
+        {
+        JQLOG(("** COpenWfcJobManger::Commit()"));
+        Commit();
+        }
+    
+    Activate();
+    
+    Fence();
+    WaitForSync();
+    
+    if (iPausedComposePending || pQueuedRequest)
+        {
+        CompleteComposeRequests(KErrNone);
+        iPausedComposePending = EFalse;
+        }
+    
+    iCompositionPaused = EFalse;
+    CompletePauseResumeRequest(KErrNone);
+    JQLOG(("** COpenWfcJobManger::DoResumeCompositionJob() RELEASE LOCK"));
+    
+    iJobLock.Signal();
+    JQLOG(("** EXIT * COpenWfcJobManger::DoResumeCompositionJob() job lock released"));
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/src/openwfcthreadmanager.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,151 @@
+// 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 "openwfcthreadmanager.h"
+#include "openwfcjobmanager.h"
+
+
+COpenWfcMonitorThread::COpenWfcMonitorThread(COpenWfcJobManger& aManager):
+iEndThread(EFalse),
+iManager(aManager)
+	{
+	
+	}
+
+COpenWfcMonitorThread::~COpenWfcMonitorThread()
+	{
+	EndThread();
+	TRequestStatus threadDies = KErrNone;
+	iThread.Resume();
+	iThread.Logon(threadDies);
+	if (iThread.ExitType() == EExitPending || 
+		threadDies != KRequestPending)
+		{
+		User::WaitForRequest(threadDies);
+		}
+	iThread.Close();
+	iSemaphore.Close();
+	}
+
+void COpenWfcMonitorThread::ConstructL(TInt aScreenNumber)
+	{
+	TBuf <255> threadManagerName;
+	/*
+	 * At a given instant in time, one screen can have at most one monitor
+	 * thread.  Test code will, for a given screen, destroy and re-create
+	 * the monitor thread.
+	 * 
+	 * At appears that the thread, once killed off, still lingers in
+	 * the OS for a short time.  The newly created thread fails to create
+	 * if it shares the same name as the one that was killed but still is
+	 * lingering around.
+	 * 
+	 * A unique name is needed.  This is guaranteed by using a thread name
+	 * which includes a microsecond counter.  This counter wraps every hour,
+	 * roughly.  This is comfortably outside the race condition above.
+	 * 
+	 * To make debugging easier, we also include the screen number in
+	 * the thread name.
+	 * 
+	 * Thus, the thread name is:
+	 * WFCMonitorThread_<ScreenNumber>_<MicrosecondCounter>
+	 */
+	_LIT(KThreadName, "WFCMonitorThread_%d_%d");
+	TTime now;
+	now.UniversalTime();
+	TInt microseconds = I64LOW(now.Int64());
+	threadManagerName.Format(KThreadName, aScreenNumber, microseconds);
+
+	User::LeaveIfError(iThread.Create(threadManagerName, 
+					   static_cast<TThreadFunction>(&COpenWfcMonitorThread::Main), 
+			           KDefaultStackSize, 
+			           NULL, 
+			           this,
+			           EOwnerProcess));	
+	iThread.SetPriority(EPriorityNormal);
+	User::LeaveIfError(iSemaphore.CreateLocal(0));
+  Start();
+	}
+
+COpenWfcMonitorThread* COpenWfcMonitorThread::NewLC(TInt aNumber, COpenWfcJobManger& aManager)
+	{
+	COpenWfcMonitorThread* self = new(ELeave) COpenWfcMonitorThread(aManager);
+	CleanupStack::PushL(self);
+	self->ConstructL(aNumber);
+	return(self);
+	}
+
+COpenWfcMonitorThread* COpenWfcMonitorThread::NewL(TInt aNumber, COpenWfcJobManger& aManager)
+	{
+	COpenWfcMonitorThread* self = COpenWfcMonitorThread::NewLC(aNumber, aManager);
+	CleanupStack::Pop(self);
+	return self;
+	}
+
+TInt COpenWfcMonitorThread::Main(TAny *aSelf)
+	{
+	COpenWfcMonitorThread* self = static_cast<COpenWfcMonitorThread*>(aSelf);
+    return self->Run();
+	}
+
+void COpenWfcMonitorThread::Start()
+	{
+	iThread.Rendezvous(iThreadStatus);
+	iThread.Resume();
+	User::WaitForRequest(iThreadStatus);
+	}
+
+void COpenWfcMonitorThread::Resume()
+	{
+	iThread.Resume();
+	}
+
+void COpenWfcMonitorThread::EndThread()
+	{
+    iSemaphore.Signal();
+	iEndThread = ETrue;
+	}
+
+void COpenWfcMonitorThread::Suspend()
+	{
+	iThread.Suspend();
+	}
+
+void COpenWfcMonitorThread::Signal()
+    {
+    iSemaphore.Signal();
+    }
+
+TInt COpenWfcMonitorThread::Run()
+	{
+	RThread::Rendezvous(KErrNone);
+    JQLOG(("** START * COpenWfcMonitorThread::Run()"));
+    while(!iEndThread)
+        {
+        JQLOG(("** WAIT FOR SIGNAL * CCOpenwfcMonitorThread::Run()"));
+        iSemaphore.Wait();
+        
+        if (!iEndThread)
+            {
+            iManager.DoExecuteJob();
+            }
+        }
+
+    /* Release any use of EGL by this thread. */
+    eglReleaseThread();
+
+    JQLOG(("** EXIT * COpenWfcMonitorThread::Run()"));
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/src/openwfcwrapper.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1171 @@
+// 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: Owns, hides, and provides an interface to the OpenWFC compositor for use by the final (display) render stage.
+
+#include "openwfcwrapper.h"
+#include "panic.h"
+#include "utils.h"
+
+#include <WF/wfc.h>
+#include "elementwrapper.h"
+#include <graphics/compositionsurfaceupdate.h>
+#include <graphics/symbianstream.h>
+#include "openwfcpanics.h"
+#include "openwfcjobmanager.h"
+
+#include <graphics/eglsynchelper.h>
+
+#define KRgbaBlack       0x000000FF
+
+void Panic(TOpenWfcPanic aPanic)
+    {
+    _LIT(KPanic, "OpenWFC");
+    User::Panic(KPanic, aPanic);
+    }
+
+class COpenWfcWrapper::OffScreenComposeGuard
+    {
+    public:
+        OffScreenComposeGuard(TRequestStatus*& aRequestStatus);
+        void SetOffScreenNativeStream(WFCNativeStreamType aNativeStream);
+        void SetTargetNativeStream(WFCNativeStreamType aNativeStream);
+        void SetSync(EGLSyncKHR aSync, EGLDisplay aDpy);
+        void SetDeviceAndContext(WFCDevice aDevice, WFCContext aContext);
+        void Close();
+        void LogRequestStatusError(TInt aRequestStatusError);
+    private:
+        TRequestStatus*& iRequestStatus;
+        EGLSyncKHR iSync;
+        EGLDisplay iEGLDisplay;
+        WFCDevice iDevice;
+        WFCContext iContext;
+        TInt    iRequestStatusError;
+    };
+
+COpenWfcWrapper::OffScreenComposeGuard::OffScreenComposeGuard(TRequestStatus*& aRequestStatus):
+iRequestStatus(aRequestStatus),
+iSync(EGL_NO_SYNC_KHR),
+iDevice(WFC_INVALID_HANDLE),
+iContext(WFC_INVALID_HANDLE),
+iRequestStatusError(KErrNone)
+    {}
+
+
+void COpenWfcWrapper::OffScreenComposeGuard::SetSync(EGLSyncKHR aSync, EGLDisplay aDpy)
+    {
+    iSync = aSync;
+    iEGLDisplay = aDpy;
+    }
+
+void COpenWfcWrapper::OffScreenComposeGuard::SetDeviceAndContext(WFCDevice aDevice, WFCContext aContext)
+    {
+    iContext = aContext; 
+    iDevice = aDevice;
+    }
+
+void COpenWfcWrapper::OffScreenComposeGuard::LogRequestStatusError(TInt aRequestStatusError)
+    {
+    iRequestStatusError=aRequestStatusError;
+    }
+
+void COpenWfcWrapper::OffScreenComposeGuard::Close()
+    {
+    if (iContext != WFC_INVALID_HANDLE)
+        {
+        DestroyAllContextElements(iDevice, iContext);
+        wfcDestroyContext(iDevice, iContext);
+        }
+  
+    if (iSync != EGL_NO_SYNC_KHR)
+        {
+        eglDestroySyncKHR(iEGLDisplay, iSync);
+        }
+
+    if (iRequestStatus)
+        {
+        User::RequestComplete(iRequestStatus, iRequestStatusError);
+        }
+    }
+
+TEMPLATE_SPECIALIZATION class RHashTableBase::Defaults<TSurfaceId, RHashTableBase::EDefaultSpecifier_Normal>
+    {
+public:
+    inline static TGeneralHashFunction32 Hash();
+    inline static TGeneralIdentityRelation Id();
+    };
+
+inline TGeneralHashFunction32 RHashTableBase::Defaults<TSurfaceId, RHashTableBase::EDefaultSpecifier_Normal>::Hash()
+    {return (TGeneralHashFunction32)&DefaultHash::Integer;}
+
+inline TGeneralIdentityRelation RHashTableBase::Defaults<TSurfaceId, RHashTableBase::EDefaultSpecifier_Normal>::Id()
+    {return (TGeneralIdentityRelation)&DefaultIdentity::Integer;}
+
+TUint32 COpenWfcWrapper::HashFunction(const TSurfaceId& aHashKey)
+    {
+    TPckgC<TSurfaceId> pckg(aHashKey);
+    return DefaultHash::Des8(pckg);
+    }
+COpenWfcWrapper* COpenWfcWrapper::NewL(TInt aScreenNo, CDisplayPolicy* aDisplayPolicy)
+	{
+	COpenWfcWrapper* wrapper = new (ELeave) COpenWfcWrapper(aDisplayPolicy);
+	CleanupStack::PushL(wrapper);
+	wrapper->ConstructL(aScreenNo);
+	CleanupStack::Pop(wrapper);
+	return wrapper;
+	}
+
+COpenWfcWrapper::COpenWfcWrapper(CDisplayPolicy* aDisplayPolicy)
+	: iUiSurface(TSurfaceId::CreateNullId()), iDisplayPolicy(aDisplayPolicy),
+	iSourceMap(THashFunction32<TSurfaceId>(COpenWfcWrapper::HashFunction), TIdentityRelation<TSurfaceId>()),
+	iDevice(WFC_INVALID_HANDLE),
+	iOnScreenContext(WFC_INVALID_HANDLE),
+	iScreenNumber(-1),
+	iJobManager(NULL),
+	iRotation(MWsScene::ESceneAntiClockwise0),
+	iAutonomousCompositionInitiated(EFalse)
+	{
+	}
+
+void COpenWfcWrapper::ConstructL(TInt aScreenId)
+	{
+    _LIT(KOpenWfcLog, "+ COpenWfcWrapper::ConstructL");
+    RDebug::Print(KOpenWfcLog);
+
+    iScreenNumber = aScreenId;
+    WFCint filterList[] = { WFC_DEVICE_FILTER_SCREEN_NUMBER, iScreenNumber, WFC_NONE};
+
+    iEGLDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+    eglInitialize(iEGLDisplay, NULL, NULL);
+        
+    WFCint dev = 0;
+    if ((wfcEnumerateDevices(&dev, 1, filterList) == 1) &&
+        (dev != WFC_INVALID_HANDLE))
+        {
+        // clean previous errors
+        wfcGetError(iDevice);
+    
+        // Let's get the device handle, opening in the same time the device
+        iDevice = wfcCreateDevice(dev, NULL);
+        if (iDevice==NULL)
+            {
+            //Not enough information to deduce why the device could not be created. Report as memory failure
+            User::Leave(KErrNoMemory);
+            }
+        //Can't clean previous errors until we have a device, and the errors should be none if it created successfully.
+        OPENWFC_ASSERT_DEBUG(!wfcGetError(iDevice),EPanicWfcStartupErrorUnexpected);
+        
+        iOnScreenContext = wfcCreateOnScreenContext(iDevice, iScreenNumber, NULL);
+        if (iOnScreenContext==NULL)
+            {
+            TInt err = wfcGetError(iDevice);
+            OPENWFC_ASSERT_DEBUG(err==WFC_ERROR_OUT_OF_MEMORY,EPanicWfcContextNotCreated);
+            User::Leave((err==WFC_ERROR_OUT_OF_MEMORY)?KErrNoMemory:KErrUnknown);
+            }
+
+        wfcSetContextAttribi(iDevice, iOnScreenContext, WFC_CONTEXT_ROTATION, WFC_ROTATION_0);
+        wfcSetContextAttribi(iDevice, iOnScreenContext, WFC_CONTEXT_BG_COLOR, KRgbaBlack);
+        
+        iContextDisplayControl = NULL;
+        
+        User::LeaveIfNull(iJobManager = COpenWfcJobManger::NewL(*this, iDevice, iOnScreenContext, iScreenNumber));
+        }
+    else
+        {
+        // we cannot continue because we cannot find a device for the given screenId
+        // Not enough information to get detailed error! Report as parameter not accepted.
+        User::Leave(KErrArgument);
+        }
+    iSurfaceManager.Open();
+
+    iSourceMap.Reserve(iInitialSourceMapSize);
+    }
+
+COpenWfcWrapper::~COpenWfcWrapper()
+	{
+	iUiElement1 = NULL;
+	iUiElement2 = NULL;
+    if(!iUiSurface.IsNull())
+        UnregisterSurface(iUiSurface);
+    
+    if (iJobManager)
+        {
+        PauseComposition();
+        delete iJobManager;
+        }
+    
+    //destroy all the elements, which should remove all the element references.
+    while (iCleanupElementList)
+        {
+        CElementWrapper* cleanupElement = iCleanupElementList;
+        delete cleanupElement;
+        OPENWFC_ASSERT_DEBUG(cleanupElement != iCleanupElementList,EPanicWfcElementNotRemovedOnShutdown);
+        if (cleanupElement == iCleanupElementList)
+            {
+            break;  //can't keep cleaning up the same front item
+            }
+        }
+    THashMapIter<TSurfaceId, SourceAndRef> iter(iSourceMap);
+    const TSurfaceId* nextKey = iter.NextKey();
+    while (nextKey)
+        {
+        const SourceAndRef* pSource = NULL;
+        //destroy any remaining registered surfaces
+        pSource = iter.CurrentValue();
+        OPENWFC_ASSERT_DEBUG(pSource && pSource->elementRef == 0,EPanicWfcElementNotRemovedOnShutdown);
+        wfcDestroySource(iDevice,pSource->source);
+        nextKey = iter.NextKey();
+        }
+
+    iSourceMap.Close();
+    iSurfaceManager.Close();
+    eglTerminate(iEGLDisplay);
+
+    // Destroying the context should take care of any sources or masks
+    wfcDestroyContext(iDevice, iOnScreenContext);
+    wfcDestroyDevice(iDevice);
+	}
+
+class CBaseExtension: public CBase
+    {
+    public:
+        virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1)
+            {   return CBase::Extension_(aExtensionId,a0,a1);   }
+    };
+TInt COpenWfcWrapper::Extension_(TUint aExtensionId, TAny*& aRetPtr, TAny* aExtra)
+    {
+#ifndef _DEBUG
+    (void) aExtra;
+#endif
+    
+    switch (aExtensionId)
+        {
+#ifdef _DEBUG
+        case EExtensionDebugBackendGuid:
+            return KErrNotSupported;
+        case EExtensionDebugContextGuid:
+            aRetPtr=(TAny*)OnScreenContext();
+            return KErrNone;
+        case EExtensionDebugDeviceGuid:
+            aRetPtr=(TAny*)Device();
+            return KErrNone;
+        case EExtensionDebugElementGuid:
+            if (aExtra)
+                {
+                CElementWrapper* newElement=static_cast<CElementWrapper*>(aExtra);
+                aRetPtr=(TAny*)newElement->Element();
+                return KErrNone;
+                }
+            else
+                {
+                return KErrBadHandle;
+                }
+        case EExtensionDebugSourceGuid:
+            if (aExtra)
+                {
+                TSurfaceId* surfId=static_cast<TSurfaceId*>(aExtra);
+                SourceAndRef* foundSourceAndRef=iSourceMap.Find(*surfId);
+                if (foundSourceAndRef)
+                    {
+                    aRetPtr=(TAny*)foundSourceAndRef->source;
+                    return KErrNone;
+                    }
+                else
+                    {
+                    return KErrNotFound;
+                    }
+                }
+            else
+                {
+                return KErrBadHandle;
+                }
+#endif
+        case MCompositionSurfaceUpdate::ETypeId:
+             {
+             CBaseExtension* basePtr = NULL;
+             SymbianStreamHasRegisteredScreenNotifications(iScreenNumber,reinterpret_cast<void**>(&basePtr));
+             if (basePtr)
+                 {
+                 return basePtr->Extension_(MCompositionSurfaceUpdate::KUidCompositionSurfaceUpdate,aRetPtr,aExtra);
+                 }
+             else
+                 {
+                 return KErrNotSupported;
+                 }
+             }
+        case MWsDisplayControl::ETypeId:
+            if (iContextDisplayControl)
+                {
+                aRetPtr= static_cast<MWsDisplayControl*>(this);
+                return KErrNone;
+                }
+            else
+                {
+                return KErrNotSupported;
+                }
+        case MDisplayControlBase::ETypeId:
+            if (iContextDisplayControl)
+                {
+                aRetPtr= static_cast<MDisplayControlBase*>(this);
+                return KErrNone;
+                }
+            else
+                {
+                return KErrNotSupported;
+                }
+        default:
+            return KErrNotSupported;
+        }
+    }
+MWsElement* COpenWfcWrapper::CreateElementL()
+	{
+	CElementWrapper* element = CElementWrapper::NewL(*this,iCleanupElementList);
+	return element;
+	}
+
+void COpenWfcWrapper::DestroyElement(MWsElement* aElement)
+	{		
+	if(aElement)
+	    {	    
+	    CElementWrapper* element=static_cast<CElementWrapper*>(aElement);
+	    RemoveElementFromSceneList(element);
+	    if (!(element->UpdateFlags()&CElementWrapper::EUpdate_SceneCommited))
+	          {
+	             delete element;
+	          }
+	    }
+	}
+
+void COpenWfcWrapper::Compose(TRequestStatus* aCompleted)
+	{
+	STD_ASSERT_DEBUG(CompositionDue(), EPluginPanicCompositionSequenceError);
+
+	OPENWFC_ASSERT_DEBUG(iJobManager, EPanicWfcThreadManagerNotInitialised);
+    if (!iAutonomousCompositionInitiated)
+        {
+        ResumeComposition();
+        }
+    iJobManager->ComposeRequest(aCompleted);
+    
+	iCompositionModified = EFalse;
+	ResumeCompositorIfPaused();
+	}
+
+TSize COpenWfcWrapper::ScreenSize() const
+	{
+    // clean previous errors
+    #ifdef _DEBUG
+    (void)wfcGetError(iDevice);
+    #endif
+    
+    TInt height = wfcGetContextAttribi(iDevice, iOnScreenContext, WFC_CONTEXT_TARGET_HEIGHT);
+    OPENWFC_ASSERT_DEBUG(TranslateOpenWfcError(wfcGetError(iDevice)) == KErrNone, EPanicWfcBadAttribute);
+
+    TInt width = wfcGetContextAttribi(iDevice, iOnScreenContext, WFC_CONTEXT_TARGET_WIDTH);
+    OPENWFC_ASSERT_DEBUG(TranslateOpenWfcError(wfcGetError(iDevice)) == KErrNone, EPanicWfcBadAttribute);
+    
+    WFCint rotation = wfcGetContextAttribi(iDevice, iOnScreenContext, WFC_CONTEXT_ROTATION);
+    OPENWFC_ASSERT_DEBUG(TranslateOpenWfcError(wfcGetError(iDevice)) == KErrNone, EPanicWfcBadAttribute);
+    
+    return rotation == WFC_ROTATION_0 || rotation == WFC_ROTATION_180 ? TSize(width, height) : TSize(height, width);
+	}
+
+TInt COpenWfcWrapper::RegisterSurface (const TSurfaceId& aSurface)
+    {
+    // clean previous errors
+    wfcGetError(iDevice);
+    //check surface id not null
+    if (aSurface.IsNull())
+        {
+        return KErrArgument;
+        }
+    
+    if (!IsValidSurface(aSurface))
+        {
+        return KErrBadHandle;
+        } 
+    
+    //look for surface being registered
+    SourceAndRef* sourceAndRef = iSourceMap.Find(aSurface);
+    if (sourceAndRef)
+        {
+        //if registered increase ref count and return
+        sourceAndRef->sourceRef++;
+        return KErrNone;
+        }
+
+    // Surface not currently registered so do so now.
+    // Initialise struct. Could be handled via. constructor.
+    SourceAndRef newSourceAndRef;
+    newSourceAndRef.source = NULL;
+    newSourceAndRef.sourceRef = 1;    //Surface reference count
+    newSourceAndRef.elementRef = 0;   //Element reference count
+
+    //No need to acquire stream as public NativeStream handle is TSurfaceId
+    WFCNativeStreamType stream = reinterpret_cast<WFCNativeStreamType>(&aSurface);
+
+    //create source
+    newSourceAndRef.source = wfcCreateSourceFromStream(iDevice,iOnScreenContext,stream,NULL);
+    //check for valid surface size should be performed by compositor in CreateSource.
+    if (newSourceAndRef.source == WFC_INVALID_HANDLE)
+        {
+        return TranslateOpenWfcError(wfcGetError(iDevice));
+        }
+    //add to list
+    TInt err = iSourceMap.Insert(aSurface,newSourceAndRef);
+    if (err != KErrNone)
+        {
+        wfcDestroySource(iDevice,newSourceAndRef.source);
+        return KErrNoMemory;
+        }
+
+    return KErrNone;
+    }
+
+TInt COpenWfcWrapper::UnregisterSurface (const TSurfaceId& aSurface)
+    {
+    //check surface id not null
+    if (aSurface.IsNull())
+        {
+        return KErrArgument;
+        }
+
+    if (!IsValidSurface(aSurface))
+        {
+        return KErrArgument;
+        }   
+    
+    SourceAndRef* sourceAndRef = iSourceMap.Find(aSurface);
+
+    if (sourceAndRef && sourceAndRef->sourceRef == 0)
+        {
+        sourceAndRef = NULL;
+        }
+    if (sourceAndRef)
+        {
+        if (sourceAndRef->sourceRef <= 1)
+            {
+            sourceAndRef->sourceRef = 0;
+
+            if (sourceAndRef->elementRef > 0)
+                {
+                //if elements are currently in use
+                return KErrInUse;
+                }
+            wfcDestroySource(iDevice,sourceAndRef->source); //removing source reference on the stream
+
+            //destroy entry
+            iSourceMap.Remove(aSurface);
+            return KErrNone;
+            }
+        sourceAndRef->sourceRef--;
+        return KErrNone;
+        }
+    return KErrBadHandle;
+    }
+
+TBool COpenWfcWrapper::IsValidSurface(const TSurfaceId& aSurface)
+    {
+    if (aSurface.Type() != TSurfaceId::EScreenSurface)
+        {
+        RSurfaceManager::TInfoBuf buff;
+        TInt err = SurfaceManager().SurfaceInfo(aSurface, buff);
+    
+        if (err == KErrArgument)
+            {
+            return EFalse;
+            }     
+        } 
+    return ETrue;
+    }
+
+/** 
+ * Finds the source for a registered surface ID and increments its "element" reference count
+ * @return registered source handle or WFC_INVALID_HANDLE if not registered
+ **/
+WFCSource COpenWfcWrapper::IncEltRefRegSource(const TSurfaceId& aHashKey)
+    {
+    SourceAndRef* foundSourceAndRef=iSourceMap.Find(aHashKey);
+    if (foundSourceAndRef && foundSourceAndRef->sourceRef)
+        {   //still registered
+        foundSourceAndRef->elementRef++;
+        return foundSourceAndRef->source;
+        }
+    return WFC_INVALID_HANDLE;
+    }
+
+
+/** 
+ * Finds the source for a registered surface ID and decrements the "element" reference count.
+ * If all counts are zero then the source is unregistered and the mapping removed   
+ * @return positive if not destroyed, 0 if destroyed
+ *         or KErrBadHandle if bad surface id or surface has no element reference count
+ **/
+TInt COpenWfcWrapper::DecEltRefRegSource(const TSurfaceId& aHashKey)
+    {
+    SourceAndRef* foundSourceAndRef=iSourceMap.Find(aHashKey);
+    if (foundSourceAndRef && foundSourceAndRef->elementRef>0)
+        {
+        TInt retRefs=((--foundSourceAndRef->elementRef)+foundSourceAndRef->sourceRef);
+        if (retRefs==0)
+            {
+            wfcDestroySource(iDevice,foundSourceAndRef->source);
+            iSourceMap.Remove(aHashKey);
+            }
+        return retRefs;
+        }
+    return KErrBadHandle;
+    }
+
+void COpenWfcWrapper::RemoveElement(MWsElement* aElement)
+	{
+    if (!aElement)
+        {
+        return;
+        }
+	
+	CElementWrapper* removeElement = static_cast<CElementWrapper*>(aElement);
+	
+	//the UI element is a special case since we set and maintain the surface
+	TUint32 renderStageFlags;
+	removeElement->GetRenderStageFlags(renderStageFlags);
+	if (renderStageFlags & MWsElement::EElementIsIndirectlyRenderedUserInterface || 
+	    renderStageFlags & MWsElement::EElementIsDirectlyRenderedUserInterface)
+		{
+		if(removeElement == iUiElement1)
+		    iUiElement1 = NULL;
+		else if(removeElement == iUiElement2)
+		    iUiElement2 = NULL;
+		else
+			STD_ASSERT_DEBUG(EFalse, EPluginPanicNonMatchingRemovalOfUiElement);
+		}
+
+	RemoveElementFromSceneList(removeElement);
+	removeElement->InsertAfter(iRemoveElementList,NULL,CElementWrapper::EUpdate_Remove);  //insert into remove element list!!!
+	SetCompositionModified();
+	}
+
+void COpenWfcWrapper::RemoveElementFromSceneList(CElementWrapper* aElement)
+    {
+    CElementWrapper** refFromElementBelow=NULL;
+    if (iSceneElementList==aElement)
+        {
+        refFromElementBelow=&iSceneElementList;  //remove from bottom of scene
+        }
+    else if (iRemoveElementList==aElement)
+        {
+        refFromElementBelow=&iRemoveElementList;
+        }
+    else
+        {
+        refFromElementBelow=aElement->RefsMyElementBelow();   //remove from current mid-list position
+        }
+    
+    aElement->RemoveAfter(refFromElementBelow);
+    }
+
+TInt COpenWfcWrapper::SetUiSurface(const TSurfaceId& aNewUiSurface)
+	{
+	TInt err = RegisterSurface(aNewUiSurface);
+	if (!err)
+		{
+		if(iUiElement1)
+			{
+			err = iUiElement1->ConnectSurface(aNewUiSurface);
+			STD_ASSERT_DEBUG(!err, EPluginPanicNewUiSurfaceUnsettable);
+			}
+		if(iUiElement2)
+			{
+			err = iUiElement2->ConnectSurface(aNewUiSurface);
+			STD_ASSERT_DEBUG(!err, EPluginPanicNewUiSurfaceUnsettable);
+			}
+		}
+
+	if(!err)
+		{
+		if(!iUiSurface.IsNull())
+			{
+			// This should not fail as the surface will no longer be used by any element
+			err = UnregisterSurface(iUiSurface);
+
+      if (err == KErrInUse)	// This is not needed once openwf implementation is corrected:
+									          // It should not return KErrInUse if it is only the backend holding onto it.
+			    {
+			    err = KErrNone;
+			    }
+
+			STD_ASSERT_DEBUG(!err, EPluginPanicPreviousUiSurfaceUnregisterable);
+			}
+
+		iUiSurface = aNewUiSurface;
+		}
+	return err;
+	}
+
+TInt COpenWfcWrapper::AddElement(MWsElement* aElement, MWsElement* aAbove)
+    {
+    TInt err = KErrNone;
+    CElementWrapper* addedElement = static_cast<CElementWrapper*>(aElement);
+    CElementWrapper* insertAboveThisElement = static_cast<CElementWrapper*>(aAbove);
+
+    if (aElement == aAbove)
+        {
+        return KErrArgument;
+        }
+    
+    if (addedElement == NULL || &addedElement->Owner()!=this || 
+        (insertAboveThisElement && &insertAboveThisElement->Owner()!=this) || 
+        (addedElement->UpdateFlags() & CElementWrapper::EUpdate_Destroy))
+        {
+        return KErrArgument;
+        }
+    
+    if (insertAboveThisElement && 
+        ((!insertAboveThisElement->RefsMyElementBelow() && iSceneElementList != insertAboveThisElement) || 
+        (insertAboveThisElement->UpdateFlags() & (CElementWrapper::EUpdate_Remove | CElementWrapper::EUpdate_Destroy))))
+        {
+        return KErrArgument;
+        }
+    
+    //the UI element is a special case since we set and maintain the surface
+    TUint32 renderStageFlags;
+    addedElement->GetRenderStageFlags(renderStageFlags);
+    if (renderStageFlags & MWsElement::EElementIsIndirectlyRenderedUserInterface || 
+        renderStageFlags & MWsElement::EElementIsDirectlyRenderedUserInterface)
+        {
+        err = AttachSurfaceToUiElement(addedElement);
+        }
+    
+    if(!err)
+        {
+        //figure out which element to add the element above           
+        const TSurfaceId& newSurf = addedElement->ConnectedSurface();
+        if (!addedElement->ConnectedSurface().IsNull())
+            {
+            //is surface registered
+            WFCSource newSource = IncEltRefRegSource(newSurf);
+            if (newSource == WFC_INVALID_HANDLE)
+                { //suggests the surface was not registered
+                return KErrArgument;
+                }
+            DecEltRefRegSource(newSurf);    //only need to decrement if it found a source
+            }
+        
+        RemoveElementFromSceneList(addedElement);
+       
+        // figure out which element to add it below
+        CElementWrapper** insertBelowThisElement = NULL;
+        if (insertAboveThisElement)
+            {
+            insertBelowThisElement=&insertAboveThisElement->MyElementAbove();
+            }
+        else
+            {
+            insertBelowThisElement=&iSceneElementList;
+            }
+        
+        addedElement->InsertAfter(*insertBelowThisElement,insertAboveThisElement,CElementWrapper::EUpdate_Insert);
+        
+        SetCompositionModified();
+        }
+    
+    return err;
+    }
+
+void COpenWfcWrapper::Compose(const TSurfaceId& aOffScreenTarget, TRequestStatus* aCompleted)
+	{
+    if (aOffScreenTarget.IsNull())
+        {
+        if (aCompleted)
+            {
+            User::RequestComplete(aCompleted, KErrNone);
+            return;
+            }
+        }
+    ComposeInternal(aOffScreenTarget,TPoint(0,0),iSceneElementList,NULL,aCompleted);
+	}
+
+void COpenWfcWrapper::Compose(const TSurfaceId& aOffScreenTarget, const TPoint& aOrigin,
+	         MWsElement* aStart, MWsElement* aEnd, TRequestStatus* aCompleted)
+	{
+    if (aOffScreenTarget.IsNull())
+        {
+        if (aCompleted)
+            {
+            User::RequestComplete(aCompleted, KErrNone);
+            return;
+            }
+        }
+    
+    CElementWrapper* startElement=static_cast<CElementWrapper*>(aStart);
+    CElementWrapper* endElement=static_cast<CElementWrapper*>(aEnd);
+    
+    if (startElement)
+        {
+        if (    &startElement->Owner()!=this
+            ||  (startElement!=iSceneElementList && !startElement->ElementBelow())
+            ||  (startElement->UpdateFlags() & (startElement->EUpdate_Remove|startElement->EUpdate_Destroy))
+            )
+            {
+            if (aCompleted)
+                {
+                RThread().RequestComplete(aCompleted, KErrArgument);
+                }
+            return;
+            }
+        if (endElement)
+            {   //If endElement is NULL then draw to end else draw including the specified endElement
+            TBool fail=EFalse;
+            if (    &endElement->Owner()!=this
+                ||  (endElement->UpdateFlags() & (endElement->EUpdate_Remove|endElement->EUpdate_Destroy))
+                )
+                {
+                fail=ETrue;
+                }
+            else
+                {
+                for (CElementWrapper* sceneElement=startElement;sceneElement!=endElement;sceneElement=sceneElement->MyElementAbove())
+                    {
+                    if (sceneElement==NULL)
+                        {
+                        fail=ETrue;
+                        break;
+                        }
+                    }
+                }
+            if (fail)
+                {
+                if (aCompleted)
+                    {
+                    RThread().RequestComplete(aCompleted, KErrArgument);
+                    }
+                return;
+                }
+            aEnd=aEnd->ElementAbove();   //now scene does NOT include endElement. May now be NULL!
+            }
+        }
+    else
+        {
+        aEnd=NULL;
+        }
+    ComposeInternal(aOffScreenTarget,aOrigin,aStart,aEnd,aCompleted);
+	}
+
+/** Internal compose does not check some errors. 
+ *  They should have already been checked by the public API caller.
+ *  NOTE element aEnd is NOT composed by this internal method!
+ *  Any elements pending removal will not be displayed (including aStart and aEnd.
+ * 
+ * @param   aOffScreenTarget    A valid surface for offscreen composition.
+ * @param   aOrigin             The origin sets where the top-left corner of the
+ *                              surface is within the element coordinate system.
+ * @param   aStart              The starting element of the elements to be composed.
+ * @param   aEnd                The element above the last element to be composed (or NULL).
+ * @param   aCompleted          NULL or request status that will be set to KErrNone when
+ *                              the composition finishes.
+ **/
+void COpenWfcWrapper::ComposeInternal (const TSurfaceId&   aOffScreenTarget,
+                        const TPoint&       aOrigin,
+                        MWsElement*       aStart,
+                        MWsElement*       aEnd,
+                        TRequestStatus*     aCompleted)
+    {
+    // Initial approach reuses the device but it may be more safer to create, and destroy, its own device
+    CElementWrapper* startElement=static_cast<CElementWrapper*>(aStart);
+    CElementWrapper* endElement=static_cast<CElementWrapper*>(aEnd);
+    
+    TInt err = KErrNone;
+#ifdef _DEBUG
+    // clean previous errors
+    wfcGetError(iDevice);
+#endif    
+    
+    if (aCompleted)
+        {
+        *aCompleted = KRequestPending;
+        }
+    
+    OffScreenComposeGuard composeGuard(aCompleted);
+    
+    WFCNativeStreamType stream=reinterpret_cast<WFCNativeStreamType>(&aOffScreenTarget);
+    
+    RSurfaceManager::TInfoBuf buff;
+    err=SurfaceManager().SurfaceInfo(aOffScreenTarget,buff);
+    OPENWFC_ASSERT_DEBUG(err==KErrNone,TOpenWfcPanic(__LINE__));
+    if (err!=KErrNone || buff().iSize.iWidth ==0 || buff().iSize.iHeight == 0)
+        {
+        composeGuard.LogRequestStatusError(KErrArgument);
+        composeGuard.Close();
+        return;
+        }
+    
+    // Create the native stream target
+    TSurfaceId targetSurfaceId = TSurfaceId::CreateNullId();
+    WFCNativeStreamType targetStream = WFC_INVALID_HANDLE;
+    OPENWFC_ASSERT_DEBUG(wfcGetError(iDevice)==WFC_ERROR_NONE,(TOpenWfcPanic)__LINE__);
+
+    targetSurfaceId = aOffScreenTarget;
+    targetStream = stream;
+     
+    EGLint attrib_list[1] = {EGL_NONE };
+    
+    EGLSyncKHR sync = eglCreateSyncKHR(iEGLDisplay,
+                                                EGL_SYNC_REUSABLE_KHR,
+                                                attrib_list);
+    
+    if (sync == EGL_NO_SYNC_KHR)
+        {
+        composeGuard.LogRequestStatusError(KErrNoMemory);
+        composeGuard.Close();
+        return;
+        }
+    composeGuard.SetSync(sync, iEGLDisplay);
+    
+    // Now, that we have the target surface stream we can create the temporary context
+    WFCContext offScreenContext = wfcCreateOffScreenContext(iDevice, targetStream, NULL);
+
+    if (offScreenContext == WFC_INVALID_HANDLE)
+        {
+        composeGuard.LogRequestStatusError(TranslateOpenWfcError(wfcGetError(iDevice)));
+        composeGuard.Close();
+        return;
+        }
+
+    composeGuard.SetDeviceAndContext(iDevice, offScreenContext);
+
+    TInt contextBackGroundColour = wfcGetContextAttribi(iDevice, iOnScreenContext, WFC_CONTEXT_BG_COLOR);
+    wfcSetContextAttribi(iDevice, offScreenContext, WFC_CONTEXT_BG_COLOR, contextBackGroundColour);
+    OPENWFC_ASSERT_DEBUG(TranslateOpenWfcError(wfcGetError(iDevice)) == KErrNone, EPanicWfcBadAttribute);
+    
+    TPoint elementOffset(-aOrigin.iX,-aOrigin.iY);
+    // let's replicate the scene to the offscreen context
+    WFCElement previousTargetElement = WFC_INVALID_HANDLE;
+    for (CElementWrapper* elementScene = startElement; elementScene !=endElement; elementScene = elementScene->MyElementAbove())
+        {
+        if (!(elementScene->UpdateFlags()&(elementScene->EUpdate_Destroy|elementScene->EUpdate_Remove)))
+            {
+            // we do our best to replicate the elements
+            TInt err=elementScene->ReplicateElements(offScreenContext, previousTargetElement,elementOffset);
+            if (err)
+                {
+                composeGuard.LogRequestStatusError(err);
+                composeGuard.Close();
+                return;
+                }
+            }
+        }
+
+    // let's compose
+    wfcCommit(iDevice, offScreenContext, WFC_TRUE);
+    wfcCompose(iDevice, offScreenContext, WFC_TRUE);
+    wfcFence(iDevice, offScreenContext, iEGLDisplay, sync);
+    EGLTimeKHR timeout = (EGLTimeKHR) EGL_FOREVER_KHR;
+    OPENWFC_ASSERT_DEBUG(TranslateOpenWfcError(wfcGetError(iDevice)) == KErrNone, EPanicWfcBadAttribute);
+    eglClientWaitSyncKHR(iEGLDisplay, sync, 0, timeout);
+    
+    composeGuard.Close();
+    }
+
+void COpenWfcWrapper::PauseComposition (void)
+    {
+    
+    OPENWFC_ASSERT_DEBUG(iJobManager, EPanicWfcThreadManagerNotInitialised);
+    iAutonomousCompositionInitiated = ETrue;
+    iJobManager->CompositionPauseRequest();
+    }
+
+void COpenWfcWrapper::ResumeComposition (void)
+    {
+    OPENWFC_ASSERT_DEBUG(iJobManager, EPanicWfcThreadManagerNotInitialised);
+    iAutonomousCompositionInitiated = ETrue;
+    iJobManager->CompositionResumeRequest();
+    }
+
+TBitFlags32 COpenWfcWrapper::SupportedScreenRotations() const
+    {
+    TBitFlags32 result;
+    // we DO support, by default, all these rotations
+    result.Set(MWsScene::ESceneAntiClockwise0);
+    result.Set(MWsScene::ESceneAntiClockwise90);
+    result.Set(MWsScene::ESceneAntiClockwise180);
+    result.Set(MWsScene::ESceneAntiClockwise270);
+    return result;
+    }
+
+void COpenWfcWrapper::SetScreenRotation(MWsScene::TSceneRotation aRotation)
+	{
+#ifdef _DEBUG
+    // clean previous errors
+    (void)wfcGetError(iDevice);
+#endif
+
+    if (aRotation != iRotation)
+        {
+        WFCRotation wfcRotation = WFC_ROTATION_0;
+        switch (aRotation)
+            {
+            case MWsScene::ESceneAntiClockwise90:
+                wfcRotation = WFC_ROTATION_90;
+                break;
+            case MWsScene::ESceneAntiClockwise180:
+                wfcRotation = WFC_ROTATION_180;
+                break;
+            case MWsScene::ESceneAntiClockwise270:
+                wfcRotation = WFC_ROTATION_270;
+                break;
+            default:
+                wfcRotation = WFC_ROTATION_0;
+                break;
+            }
+        iRotation = aRotation;
+        wfcSetContextAttribi(iDevice, iOnScreenContext, WFC_CONTEXT_ROTATION, wfcRotation);
+        OPENWFC_ASSERT_DEBUG(TranslateOpenWfcError(wfcGetError(iDevice)) == KErrNone, EPanicWfcBadAttribute);
+        }
+	
+	SetCompositionModified();
+	}
+
+TInt COpenWfcWrapper::SetConfiguration(const TDisplayConfiguration& aConfig)
+    {
+    return iContextDisplayControl->SetConfiguration (aConfig);
+    }
+
+MWsScene::TSceneRotation COpenWfcWrapper::ScreenRotation() const
+	{
+#ifdef _DEBUG
+    // clean previous errors
+    (void)wfcGetError(iDevice);
+#endif
+    WFCint result = wfcGetContextAttribi(iDevice, iOnScreenContext, WFC_CONTEXT_ROTATION);
+    OPENWFC_ASSERT_DEBUG(TranslateOpenWfcError(wfcGetError(iDevice)) == KErrNone, EPanicWfcBadAttribute);
+    MWsScene::TSceneRotation rotation = MWsScene::ESceneAntiClockwise0;
+    switch (result)
+        {
+        case WFC_ROTATION_90:
+            rotation = MWsScene::ESceneAntiClockwise90;
+            break;
+        case WFC_ROTATION_180:
+            rotation = MWsScene::ESceneAntiClockwise180;
+            break;
+        case WFC_ROTATION_270:
+            rotation = MWsScene::ESceneAntiClockwise270;
+            break;
+        case WFC_ROTATION_0:
+        default:
+            OPENWFC_ASSERT_DEBUG(result==WFC_ROTATION_0,(TOpenWfcPanic)__LINE__);
+            rotation = MWsScene::ESceneAntiClockwise0;
+            break;
+        }
+    
+	return rotation;
+	}
+
+TInt COpenWfcWrapper::NumberOfResolutions()const
+    {
+    if (iContextDisplayControl)
+        {
+        return iContextDisplayControl->NumberOfResolutions();
+        }
+    return KErrNotSupported;
+    }
+
+TInt COpenWfcWrapper::GetResolutions(RArray<TResolution>& aResolutions)const
+    {
+    if (iContextDisplayControl)
+        {
+        return iContextDisplayControl->GetResolutions(aResolutions);
+        }
+    return KErrNotSupported;
+    }
+
+void COpenWfcWrapper::GetConfiguration(TDisplayConfiguration& aConfig)const
+    {
+    if (iContextDisplayControl)
+        {
+        iContextDisplayControl->GetConfiguration (aConfig);
+        }
+    }
+
+TInt COpenWfcWrapper::PreferredDisplayVersion() const
+    {
+    if (iContextDisplayControl)
+        {
+        return iContextDisplayControl->PreferredDisplayVersion();
+        }
+    return KErrNotSupported;
+    }
+
+void COpenWfcWrapper::NotifyOnDisplayChange(TRequestStatus& aStatus)
+    {
+    // Stub for future implementation. 
+    TRequestStatus *status = &aStatus;
+    RThread().RequestComplete(status, KErrNotSupported);
+    }
+
+void COpenWfcWrapper::NotifyOnDisplayChangeCancel()
+    {
+    // Stub for future implementation. 
+    }
+
+void COpenWfcWrapper::NotifyOnConfigChange(TRequestStatus& aStatus)
+    {
+    // Stub for future implementation. 
+    TRequestStatus *status = &aStatus;
+    RThread().RequestComplete(status, KErrNotSupported);
+    }
+
+void COpenWfcWrapper::NotifyOnConfigChangeCancel()
+    {
+    // Stub for future implementation. 
+    }
+
+
+void COpenWfcWrapper::FlushSceneElementChanges()
+    {
+    while (CElementWrapper* curr = iRemoveElementList)
+        {
+        curr->FlushSceneChanges();
+        RemoveElementFromSceneList(curr);
+        if (curr->UpdateFlags() & CElementWrapper::EUpdate_Destroy)
+            {
+            delete curr;
+            }
+        }
+    iRemoveElementList=NULL;
+    if (CElementWrapper* curr=iSceneElementList)
+        {
+        for (CElementWrapper*next=curr->MyElementAbove(); curr;   curr=next,next=curr?curr->MyElementAbove():NULL)
+            {
+            curr->FlushSceneChanges();
+            }
+        }
+    }
+
+TInt COpenWfcWrapper::TranslateOpenWfcError(WFCErrorCode error)
+    {
+    switch (error)
+        {
+        case WFC_ERROR_NONE:
+            return KErrNone;
+        case WFC_ERROR_OUT_OF_MEMORY:
+            return KErrNoMemory;
+        case WFC_ERROR_ILLEGAL_ARGUMENT:
+            return KErrArgument;
+        case WFC_ERROR_BAD_ATTRIBUTE:
+            return KErrArgument;
+        case WFC_ERROR_BAD_DEVICE:
+            return KErrArgument;
+        case WFC_ERROR_UNSUPPORTED:
+            return KErrNotSupported;
+        case WFC_ERROR_IN_USE:
+            return KErrInUse;
+        case WFC_ERROR_BUSY:
+            return KErrServerBusy;
+        case WFC_ERROR_BAD_HANDLE:
+            return KErrBadHandle;
+        case WFC_ERROR_INCONSISTENCY:
+            return KErrGeneral;
+        case WFC_ERROR_FORCE_32BIT:
+            // intentional fall through
+        default:
+            return KErrUnknown;
+        }
+    }
+
+void COpenWfcWrapper::DestroyAllContextElements(WFCDevice dev, WFCContext ctx)
+    {
+    // we try our best to destroy all elements of the specified context
+    if (dev != WFC_INVALID_HANDLE && ctx != WFC_INVALID_HANDLE)
+        {
+        WFCElement element = wfcGetContextAttribi(dev, ctx, WFC_CONTEXT_LOWEST_ELEMENT);
+        if (element != WFC_INVALID_HANDLE)
+            {
+            wfcDestroyElement(dev, element);
+            }
+        }
+    }
+
+void COpenWfcWrapper::PauseCompositorIfNeeded()
+	{
+	if (!iPaused && iAllowCompositorPause && iWithinBeginEnd)
+		{
+		PauseComposition();
+		iPaused = ETrue;
+		}
+	}
+
+/**
+Sets the system state for modified scene composition.
+	- Pause OpenWF composition if the standard render stage is within a begin/end block.
+	- If not within a pause/end block then set a flag to indicate that the scene composition 
+		has been modified. On entering the begin/end block composition will be paused appropriatly.
+*/
+void COpenWfcWrapper::SetCompositionModified()
+	{
+	PauseCompositorIfNeeded();
+	iCompositionModified = ETrue;
+	}
+
+void COpenWfcWrapper::ResumeCompositorIfPaused()
+	{
+	if (iPaused)
+		ResumeComposition();
+	iPaused = EFalse;
+	}
+
+void COpenWfcWrapper::Begin(const TRegion* aRegion)
+	{
+	iWithinBeginEnd = ETrue;
+	iAllowCompositorPause = (aRegion && !aRegion->IsEmpty());
+	
+	if (iCompositionModified)
+		PauseCompositorIfNeeded();
+	}
+
+TBool COpenWfcWrapper::CompositionDue()
+	{
+	return (iWithinBeginEnd && iCompositionModified);
+	}
+
+void COpenWfcWrapper::End()
+	{
+	iWithinBeginEnd = EFalse;
+	}
+
+TInt COpenWfcWrapper::FlushedSetConfiguration(const TDisplayConfiguration& /*aConfig*/)
+	{
+	OPENWFC_ASSERT_DEBUG(0, EPanicMethodNotImplemented);
+	TInt retval=KErrNone;
+	if (retval<=KErrNone)
+		{
+		SetCompositionModified();
+		}
+	return retval;
+	}
+
+CDisplayPolicy* COpenWfcWrapper::DisplayPolicy()
+	{
+	return iDisplayPolicy;
+	}
+
+TInt COpenWfcWrapper::AttachSurfaceToUiElement(CElementWrapper* aNewUiElement)
+	{
+	STD_ASSERT_DEBUG(!iUiSurface.IsNull(), EPluginPanicUiSurfaceIsNull);
+	if(iUiElement1 == NULL || iUiElement1 == aNewUiElement)
+	    iUiElement1 = aNewUiElement;
+	else if(iUiElement2 == NULL || iUiElement2 == aNewUiElement)
+	    iUiElement2 = aNewUiElement;
+	else
+		STD_ASSERT_DEBUG(EFalse, EPluginPanicDuplicateUiElement);
+
+	return aNewUiElement->ConnectSurface(iUiSurface);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/src/rsdisplaychangeao.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,135 @@
+// 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 "rsdisplaychangeao.h"
+#include "displaypolicy.h"
+
+CRsDisplayChangeNotifier::CRsDisplayChangeNotifier(MWsDisplayControl* aNextLevelInterface, CDisplayPolicy* aDisplayPolicy)
+:CActive(EPriorityHigh),iWsStatus(NULL)
+	{
+	CActiveScheduler::Add(this);
+	iNextLevelInterface = aNextLevelInterface;
+	iDisplayPolicy = aDisplayPolicy;
+	}
+
+CRsDisplayChangeNotifier* CRsDisplayChangeNotifier::NewL(MWsDisplayControl* aNextLevelInterface, CDisplayPolicy* aDisplayPolicy)
+	{
+	CRsDisplayChangeNotifier* self = new(ELeave) CRsDisplayChangeNotifier(aNextLevelInterface, aDisplayPolicy);
+	return self;
+	}
+
+void CRsDisplayChangeNotifier::IssueNotificationRequest()
+	{
+	iNextLevelInterface->NotifyOnDisplayChange(iStatus);
+	SetActive();
+	}
+void CRsDisplayChangeNotifier::RegisterActiveStatus(TRequestStatus &aStatus)
+	{
+	iWsStatus = &aStatus;
+	}
+
+void CRsDisplayChangeNotifier::CancelNotificationRequest()
+	{
+	Cancel();
+	}
+
+void CRsDisplayChangeNotifier::RunL()
+	{
+	//IssueNotificationRequest will overwrite iStatus, save a copy first;
+	TInt result = iStatus.Int();
+	IssueNotificationRequest();
+	
+	//calculate min UI buffer size depending on physical resolutions
+	TInt ret = iNextLevelInterface->NumberOfResolutions();
+	RArray<MDisplayControlBase::TResolution> resolutions;
+	CleanupClosePushL(resolutions);
+	if(ret > 0)
+		{
+		//just ignore the error. if there's an error, an empty resolution list is passed in, and uibuffer
+		//will remain the previous size
+		iNextLevelInterface->GetResolutions(resolutions);
+		}
+	iDisplayPolicy->CalculateMinBufferSize(resolutions, ret);				
+	CleanupStack::PopAndDestroy(&resolutions);
+	
+	if(iWsStatus && *iWsStatus == KRequestPending)
+		{
+		User::RequestComplete(iWsStatus, result);
+		}
+	}
+
+void CRsDisplayChangeNotifier::DoCancel()
+	{
+	iNextLevelInterface->NotifyOnDisplayChangeCancel();
+	if(iWsStatus && *iWsStatus == KRequestPending)
+		User::RequestComplete(iWsStatus, KErrCancel);
+	}
+
+CRsDisplayChangeNotifier::~CRsDisplayChangeNotifier()
+	{
+	Cancel();
+	}
+
+CRsConfigChangeNotifier::CRsConfigChangeNotifier(MWsDisplayControl* aNextLevelInterface)
+:CActive(EPriorityHigh), iWsStatus(NULL)
+	{
+	CActiveScheduler::Add(this);
+	iNextLevelInterface = aNextLevelInterface;
+	}
+
+CRsConfigChangeNotifier* CRsConfigChangeNotifier::NewL(MWsDisplayControl* aNextLevelInterface)
+	{
+	CRsConfigChangeNotifier* self = new(ELeave) CRsConfigChangeNotifier(aNextLevelInterface);
+	return self;
+	}
+
+void CRsConfigChangeNotifier::IssueNotificationRequest()
+	{
+	iNextLevelInterface->NotifyOnConfigChange(iStatus);
+	SetActive();
+	}
+
+void CRsConfigChangeNotifier::RegisterActiveStatus(TRequestStatus &aStatus)
+	{
+	iWsStatus = &aStatus;
+	}
+
+void CRsConfigChangeNotifier::CancelNotificationRequest()
+	{
+	Cancel();
+	}
+
+void CRsConfigChangeNotifier::RunL()
+	{
+	//IssueNotificationRequest will overwrite iStatus, save a copy first;
+	TInt result = iStatus.Int();
+	IssueNotificationRequest();
+	if(iWsStatus && *iWsStatus == KRequestPending)
+		{
+		User::RequestComplete(iWsStatus, result);
+		}
+	}
+
+void CRsConfigChangeNotifier::DoCancel()
+	{
+	iNextLevelInterface->NotifyOnConfigChangeCancel();
+	if(iWsStatus && *iWsStatus == KRequestPending)
+		User::RequestComplete(iWsStatus, KErrCancel);
+	}
+
+CRsConfigChangeNotifier::~CRsConfigChangeNotifier()
+	{
+	Cancel();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/src/screencaptureutil.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,225 @@
+// 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 "screencaptureutil.h"
+#include <e32std.h>
+#include <e32base.h>
+#include "panic.h"
+#include <fbs.h>
+#include <graphics/wsgraphicscontext.h>
+#include <graphics/wsdisplaycontrol.h>
+#include <graphics/wsscene.h>
+#include <graphics/wsdisplaymapping.h>
+//#include <graphics/testscreencapture.h>
+//#include <graphics/wsscreendeviceutils.h>
+#include <graphics/wsscreendevice.h>
+
+CScreenCaptureUtil* CScreenCaptureUtil::NewL(CWsRenderStage* aOwner)
+	{
+	CScreenCaptureUtil * util = new(ELeave) CScreenCaptureUtil;
+	CleanupStack::PushL(util);
+	util->ConstructL(aOwner);
+	
+	CleanupStack::Pop(util);
+	return util;
+	}
+	
+void CScreenCaptureUtil::ConstructL(CWsRenderStage* aOwner)
+	{
+	// initialise the references to the interfaces of interest
+	iScene = aOwner->ObjectInterface<MWsScene>();
+	STD_ASSERT_ALWAYS(iScene, EPluginPanicSceneMissing);
+	
+	iScreenDevice = aOwner->ObjectInterface<MWsScreenDevice>();
+	STD_ASSERT_ALWAYS(iScreenDevice, EPluginPanicSceneMissing);
+	
+	iDisplayMapping = aOwner->ObjectInterface<MWsDisplayMapping>();
+	
+	// create the local surface
+	User::LeaveIfError(iSurfaceManager.Open());
+	User::LeaveIfError(iSurfaceUpdateSession.Connect());
+	}
+	
+CScreenCaptureUtil::CScreenCaptureUtil()
+	{
+	}
+	
+CScreenCaptureUtil::~CScreenCaptureUtil()
+	{
+	iScene->UnregisterSurface(iLocalSurface);
+	iSurfaceManager.CloseSurface(iLocalSurface);
+	iSurfaceManager.Close();
+	iSurfaceUpdateSession.Close();
+	}
+
+void CScreenCaptureUtil::ComposeScreenL(TInt aHandle)
+	{
+	TInt ret = KErrNone;
+
+	//Let's duplicate the bitmap
+	CFbsBitmap* bitmap=new(ELeave) CFbsBitmap();
+	CleanupStack::PushL(bitmap);
+	
+	TInt r = bitmap->Duplicate(aHandle);
+	
+	if (r == KErrNoMemory)
+		{
+		User::Leave(KErrNoMemory);
+		}
+	
+	ret = KErrBadHandle;
+	if (r == KErrNone)
+		{
+		CreateLocalSurfaceL();
+		
+		// check that the bitmap format is matching our requirements
+		if (VerifyBitmapFormatL(*bitmap))
+		    {
+	        ret = iScene->RegisterSurface(iLocalSurface);
+	        if (ret == KErrNone)
+	            {
+	            TRequestStatus cRs = KErrNone;
+	            iScene->ComposePendingScene(iLocalSurface, &cRs);
+	            User::WaitForRequest(cRs);
+	            ret = CopySurfaceToBitmapL(*bitmap);
+	            }
+			}
+		else
+			{
+			// we accept only matching bitmap formats
+			ret = KErrArgument;
+			}
+		}
+	
+	CleanupStack::PopAndDestroy(bitmap);
+	}
+/*
+void CScreenCaptureUtil::TranslateExtentL(const TWsScsComposeScreenCommand& aMessage)
+	{
+	TPoint srcTopLeft(aMessage.iParameter.iExtent.iTl.iX, aMessage.iParameter.iExtent.iTl.iY);
+	TPoint srcBottomRight(aMessage.iParameter.iExtent.iBr.iX, aMessage.iParameter.iExtent.iBr.iY);
+	TRect rectSrc(srcTopLeft, srcBottomRight);
+	TRect rectRes;
+	TInt ret = iDisplayMapping->MapCoordinates(EApplicationSpace, rectSrc, ECompositionSpace, rectRes);
+	aUtils.ReplyBuf(&rectRes, sizeof(TRect));
+	aUtils.SetReply(ret);
+	}
+*/
+TSurfaceId CScreenCaptureUtil::CreateSurfaceL(const TSize& aSize, TUidPixelFormat aPixelFormat, TInt aStride)
+	{
+	RSurfaceManager::TSurfaceCreationAttributesBuf bf;
+	RSurfaceManager::TSurfaceCreationAttributes& b = bf();
+	b.iSize.iWidth = aSize.iWidth;
+	b.iSize.iHeight = aSize.iHeight;
+	b.iBuffers = 1;				// 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(iSurfaceManager.CreateSurface(bf, surface));
+	return surface;
+	}
+
+void CScreenCaptureUtil::CreateLocalSurfaceL()
+	{
+	TSize surfaceSize;
+	GetCompositionAreaSize(surfaceSize);
+	
+	if (!iLocalSurface.IsNull())
+		{
+        RSurfaceManager::TInfoBuf infoBuf;
+    	RSurfaceManager::TSurfaceInfoV01& info = infoBuf();
+        if ((KErrNone != iSurfaceManager.SurfaceInfo(iLocalSurface, infoBuf)) || 
+        	(info.iSize != surfaceSize))
+            {
+            iScene->UnregisterSurface(iLocalSurface);
+    		iSurfaceManager.CloseSurface(iLocalSurface);
+    		iLocalSurface = TSurfaceId::CreateNullId();
+            }
+		}
+	
+	if (iLocalSurface.IsNull())
+		{
+		iLocalSurface = CreateSurfaceL(surfaceSize, KSurfacePixelFormat, KSurfaceBytesPerPixel*surfaceSize.iWidth);
+		}
+	}
+
+TBool CScreenCaptureUtil::VerifyBitmapFormatL(const CFbsBitmap& aBitmap)
+	{
+  RSurfaceManager::TInfoBuf infoBuf;
+	RSurfaceManager::TSurfaceInfoV01& info = infoBuf();
+  User::LeaveIfError(iSurfaceManager.SurfaceInfo(iLocalSurface, infoBuf));
+    		
+	return ((info.iSize == aBitmap.SizeInPixels()) && (EColor16MU == aBitmap.DisplayMode()));
+	}
+
+void CScreenCaptureUtil::GetCompositionAreaSize(TSize& aSize) const
+	{
+	TSize uiSize;
+	uiSize = iScreenDevice->SizeInPixels();
+	TRect uiRect(TPoint(0,0), uiSize);
+	TRect compositionRect;
+	iDisplayMapping->MapCoordinates(EFullScreenSpace, uiRect, ECompositionSpace, compositionRect);
+	aSize = compositionRect.Size();
+	}
+
+TInt CScreenCaptureUtil::CopySurfaceToBitmapL(CFbsBitmap& aCopyToBitmap)
+	{
+	RSurfaceManager::TInfoBuf infoBuf;
+	RSurfaceManager::TSurfaceInfoV01& info = infoBuf();
+
+	User::LeaveIfError(iSurfaceManager.SurfaceInfo(iLocalSurface, infoBuf));
+	
+	TInt bytesPerPixel=0;
+	TDisplayMode	bitmapMode = ENone;
+	
+	switch (info.iPixelFormat)
+		{
+		case EUidPixelFormatXRGB_8888:
+			{
+			bitmapMode = EColor16MU;
+			bytesPerPixel = 4;
+			break;
+			}
+		default:
+			{
+			return KErrCorrupt;
+			}
+		}
+	
+	if ((aCopyToBitmap.SizeInPixels() != info.iSize) || (aCopyToBitmap.DisplayMode() != bitmapMode))
+		{
+		return KErrCorrupt;
+		}
+	
+	RChunk chunk;
+	CleanupClosePushL(chunk);
+	User::LeaveIfError(iSurfaceManager.MapSurface(iLocalSurface, chunk));
+	TUint8* surfacePtr = chunk.Base();
+	TUint8* bitmapPtr = (TUint8*)aCopyToBitmap.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 += aCopyToBitmap.DataStride();
+		}
+	CleanupStack::PopAndDestroy(&chunk);
+	return KErrNone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/src/stdplugin.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,28 @@
+// 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 <ecom/implementationproxy.h>
+#include "displayrenderstagefactory.h"
+
+LOCAL_C const TImplementationProxy KImplementationTable[] = 
+	{
+	IMPLEMENTATION_PROXY_ENTRY(CDisplayRenderStageFactory::EImplUid, CDisplayRenderStageFactory::CreateL)
+	};
+	
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+	{
+	aTableCount = (sizeof(KImplementationTable) / sizeof(TImplementationProxy));
+	return KImplementationTable;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/plugins/openwfcrs/src/utils.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,53 @@
+// 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 <gdi.h>
+#include <pixelformats.h>
+#include "panic.h"
+
+void Panic(TStdPluginPanic aPanic)
+	{
+	_LIT(KStdPanicCategory, "WSERV-PLUGIN");
+	User::Panic(KStdPanicCategory, aPanic);
+	}
+
+GLDEF_C TDisplayMode ParseDisplayMode(const TDesC& aModeName)
+	{
+	// Not using _LIT because we only want the string temporarily, not permanently on the heap.
+	if (!aModeName.CompareF(_L("Color16MAP")))
+		return EColor16MAP;
+	else if (!aModeName.CompareF(_L("Color16MA")))
+		return EColor16MA;
+	else if (!aModeName.CompareF(_L("Color16MU")))
+		return EColor16MU;
+	else if (!aModeName.CompareF(_L("Color64K")))
+		return EColor64K;
+	else if (!aModeName.CompareF(_L("Color4K")))
+		return EColor4K;
+	else if (!aModeName.CompareF(_L("Color256")))
+		return EColor256;
+	else if (!aModeName.CompareF(_L("Color16")))
+		return EColor16;
+	else if (!aModeName.CompareF(_L("Gray256")))
+		return EGray256;
+	else if (!aModeName.CompareF(_L("Gray16")))
+		return EGray16;
+	else if (!aModeName.CompareF(_L("Gray4")))
+		return EGray4;
+	else if (!aModeName.CompareF(_L("Gray2")))
+		return EGray2;
+	else
+		return ENone;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/sis/createsisx.bat	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,36 @@
+rem
+rem Copyright (c) 2009 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 Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description: 
+rem
+
+@echo off
+echo DoTo: update the location for certificate and private key files
+
+set certificate_file=..\internal\certificates\rd.cer
+set private_key_file=..\internal\certificates\rd-key.pem
+
+rem create base sis package
+makesis uiaccelerator_base.pkg
+signsis uiaccelerator_base.sis uiaccelerator_base.sisx %certificate_file% %private_key_file%
+
+rem create alfred sis package
+makesis hitchcock.pkg
+signsis hitchcock.sis hitchcock.sisx %certificate_file% %private_key_file%
+
+rem create update sis package
+call createupdatesis.bat
+
+rem create combined sis package that has base and update package embedded
+makesis uiaccelerator.pkg
+signsis uiaccelerator.sis uiaccelerator.sisx %certificate_file% %private_key_file%
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/sis/createstubsis.bat	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,17 @@
+rem
+rem Copyright (c) 2009 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 Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description: 
+rem
+
+makesis -s uiaccelerator_stub.pkg
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/sis/createupdatesis.bat	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,39 @@
+rem
+rem Copyright (c) 2009 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 Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description: 
+rem
+
+makesis -s uiaccelerator_stub.pkg
+
+set certificate_file=..\internal\certificates\rd.cer
+set private_key_file=..\internal\certificates\rd-key.pem
+
+rem add update version information to dll's and exe's
+elftran -version 10.1 \epoc32\release\armv5\urel\hitchcock.dll
+elftran -version 10.1 \epoc32\release\armv5\urel\alfclient.dll
+elftran -version 10.1 \epoc32\release\armv5\urel\alfappservercore.dll
+elftran -version 10.1 \epoc32\release\armv5\urel\!ftokenserver.exe
+elftran -version 10.1 \epoc32\release\armv5\urel\ftokenclient.dll
+elftran -version 10.1 \epoc32\release\armv5\urel\alfredserver.exe
+
+makesis uiaccelerator_update.pkg
+signsis uiaccelerator_update.sis uiaccelerator_update.sisx %certificate_file% %private_key_file%
+
+rem return version information of dll's and exe's to same as in rom
+elftran -version 10.0 \epoc32\release\armv5\urel\hitchcock.dll
+elftran -version 10.0 \epoc32\release\armv5\urel\alfclient.dll
+elftran -version 10.0 \epoc32\release\armv5\urel\alfappservercore.dll
+elftran -version 10.0 \epoc32\release\armv5\urel\!ftokenserver.exe
+elftran -version 10.0 \epoc32\release\armv5\urel\ftokenclient.dll
+elftran -version 10.0 \epoc32\release\armv5\urel\alfredserver.exe
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/sis/hitchcock.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,50 @@
+;
+; 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: 
+;
+
+; ============================================================================
+;  Name        : hitchcock.pkg
+;  Part of     : Alfred
+;  Description : Package file for project hitchcock
+;  Version     : %version: 2.1.1.1.1 % << Don't touch! Updated by Synergy at check-out.
+;
+;  Copyright © 2006-2007 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.1
+
+; standard SIS file header
+; Todo: aquire proper UID
+#{"Hitchcock Server and Client library"},(0xA98E77EF),1,0,0
+
+;Localized Vendor Name
+%{"Nokia-EN"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Files to copy
+"\epoc32\release\armv5\urel\alfclient.dll"-"!:\sys\bin\alfclient.dll"
+"\epoc32\release\armv5\urel\alfredserver.exe"-"!:\sys\bin\alfredserver.exe"
+"\epoc32\data\z\private\10003a3f\apps\alfredserver_reg.rsc"-"!:\private\10003a3f\import\apps\alfredserver_reg.rsc"
+"\epoc32\release\armv5\urel\alfappservercore.dll"-"!:\sys\bin\alfappservercore.dll"
+"\epoc32\release\armv5\urel\!ftokenserver.exe"-"!:\sys\bin\!ftokenserver.exe"
+"\epoc32\release\armv5\urel\ftokenclient.dll"-"!:\sys\bin\ftokenclient.dll"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/sis/uiaccelerator.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,38 @@
+;
+; Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:   Package file for UI Accelerator
+;
+
+&EN
+
+;Localized Vendor Name
+%{"Nokia-EN"}
+
+;Unique Vendor name
+:"Nokia"
+
+; NOTE! Be sure that version numbers in this file are same as in 
+; \s60\mw\uiaccelerator\uiaccelerator_dom\alf_visual_api\inc\alf\alfversion.h .
+; UID is from ALF Server core library
+#{"UI Accelerator Toolkit updater"},(0x10282848),1,1,22
+
+;Supports S60 3.0
+[0x101F7961], 0, 0, 0, {"S60ProductID"}
+
+; Check if stub.sis exists in rom and choose sis package based on that
+IF NOT exists("z:\system\install\uiaccelerator_stub.sis")
+@"uiaccelerator_base.sisx",(0x10282845)
+ELSE
+@"uiaccelerator_update.sisx",(0x10282845)
+endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/sis/uiaccelerator_base.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,41 @@
+;
+; Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:   Package file for project hitchcock
+;
+
+; standard SIS file header
+
+; NOTE! Be sure that version numbers in this file are same as in 
+; \s60\mw\uiaccelerator\uiaccelerator_dom\alf_visual_api\inc\alf\alfversion.h .
+; UID is from ALF Server executable
+#{"UI Accelerator Toolkit"},(0x10282845),1,1,22
+
+;Localized Vendor Name
+%{"Nokia-EN"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Supports S60 3.0
+[0x101F7961], 0, 0, 0, {"S60ProductID"}
+
+
+;Files to copy
+"\epoc32\release\armv5\urel\hitchcock.dll"-"c:\sys\bin\hitchcock.dll"
+"\epoc32\release\armv5\urel\alfclient.dll"-"c:\sys\bin\alfclient.dll"
+"\epoc32\release\armv5\urel\alfappservercore.dll"-"c:\sys\bin\alfappservercore.dll"
+"\epoc32\release\armv5\urel\!ftokenserver.exe"-"c:\sys\bin\!ftokenserver.exe"
+"\epoc32\release\armv5\urel\ftokenclient.dll"-"c:\Sys\Bin\ftokenclient.dll"
+"\epoc32\release\armv5\urel\alfredserver.exe"-"c:\sys\bin\alfredserver.exe"
+"\epoc32\data\z\private\10003a3f\apps\alfredserver_reg.rsc"-"c:\private\10003a3f\import\apps\alfredserver_reg.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/sis/uiaccelerator_stub.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,37 @@
+;
+; Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:   Stub package file for UI Accelerator Toolkit.
+;
+
+&EN
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+; NOTE! Be sure that version numbers in this file are same as in 
+; \s60\mw\uiaccelerator\uiaccelerator_dom\alf_visual_api\inc\alf\alfversion.h .
+; Also run createstubsis.bat to re-generate stubbed sis file which goes to the ROM. 
+
+; UID is same as UID of ALF Server executable
+#{"UI Accelerator Toolkit"},(0x10282845),1,1,3, TYPE=SA
+
+"" - "z:\Sys\Bin\hitchcock.dll"
+"" - "z:\Sys\Bin\alfclient.dll"
+"" - "z:\Sys\Bin\alfappservercore.dll"
+"" - "z:\Sys\Bin\!ftokenserver.exe"
+"" - "z:\Sys\Bin\ftokenclient.dll"
+"" - "z:\sys\bin\alfredserver.exe"
+"" - "z:\private\10003a3f\import\apps\alfredserver_reg.rsc"
Binary file uiacceltk/hitchcock/sis/uiaccelerator_stub.sis has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/sis/uiaccelerator_update.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,39 @@
+;
+; Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:   Package file for UI Accelerator
+;
+
+&EN
+
+;Localized Vendor Name
+%{"Nokia-EN"}
+
+;Unique Vendor name
+:"Nokia"
+
+; NOTE! Be sure that version numbers in this file are same as in 
+; \s60\mw\uiaccelerator\uiaccelerator_dom\alf_visual_api\inc\alf\alfversion.h .
+#{"UI Accelerator Toolkit"},(0x10282845),1,1,22, TYPE=PU
+
+;Supports S60 3.0
+[0x101F7961], 0, 0, 0, {"S60ProductID"}
+
+;Files to copy
+"\epoc32\release\armv5\urel\hitchcock.dll"-"c:\sys\bin\hitchcock.dll"
+"\epoc32\release\armv5\urel\alfclient.dll"-"c:\sys\bin\alfclient.dll"
+"\epoc32\release\armv5\urel\alfappservercore.dll"-"c:\sys\bin\alfappservercore.dll"
+"\epoc32\release\armv5\urel\!ftokenserver.exe"-"c:\sys\bin\!ftokenserver.exe"
+"\epoc32\release\armv5\urel\ftokenclient.dll"-"c:\Sys\Bin\ftokenclient.dll"
+"\epoc32\release\armv5\urel\alfredserver.exe"-"c:\sys\bin\alfredserver.exe"
+"\epoc32\data\z\private\10003a3f\apps\alfredserver_reg.rsc"-"c:\private\10003a3f\import\apps\alfredserver_reg.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/bwins/alfdebugu.def	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,2 @@
+EXPORTS	?CreateDebugExtensionFactoryL@@YAPAVCAlfDebugFactory@@XZ @ 1 NONAME ; class CAlfDebugFactory * CreateDebugExtensionFactoryL(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/data/alfdebugserver.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource definitions for project alfdebugextension
+*
+*/
+
+
+#include <RegistryInfo.rh>
+#include <alf/alfred.hrh>
+#include "../inc/alfdebuguid.h"
+
+RESOURCE REGISTRY_INFO theInfo
+{
+    
+    dll_uid = KAlfDebugServerExtensionPluginUid;
+    interfaces =
+    {
+    INTERFACE_INFO
+        {
+        interface_uid = K_ALF_FACTORY_INTERFACE;
+        implementations =
+            {
+            IMPLEMENTATION_INFO
+                {
+                implementation_uid = KAlfDebugExtensionImplementationId;
+                version_no = 1;
+                display_name = "alf debug ext";
+                default_data = "";
+                opaque_data	 = "0";
+                }
+            };
+        }
+    };
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/eabi/alfdebugu.def	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z28CreateDebugExtensionFactoryLv @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/group/alfdebug.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project definition file for project alfdebug
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+
+TARGET                  alfdebug.dll
+TARGETTYPE              dll
+UID                     0x1000008d 0x20016B90
+
+CAPABILITY              CAP_CLIENT_DLL
+VENDORID                VID_DEFAULT
+
+SOURCEPATH              ../src
+SOURCE                  alfdebug.cpp
+
+USERINCLUDE             ../inc
+
+#include <platform_paths.hrh>
+MW_LAYER_SYSTEMINCLUDE
+
+SYSTEMINCLUDE           ../../../../../inc
+
+LIBRARY                 euser.lib
+LIBRARY                 alfclient.lib
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/group/alfdebugserver.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 <data_caging_paths.hrh>
+#include <bldvariant.hrh>
+#include "../inc/alfdebuguid.h"
+
+TARGET          alfdebugserver.dll
+TARGETTYPE      PLUGIN
+UID             0x10009d8d KAlfDebugServerExtensionPluginUid
+
+CAPABILITY      CAP_ECOM_PLUGIN
+VENDORID        VID_DEFAULT
+
+USERINCLUDE     ../inc
+USERINCLUDE     .
+
+#include <platform_paths.hrh>
+MW_LAYER_SYSTEMINCLUDE
+
+
+SYSTEMINCLUDE   /epoc32/include/ecom
+SYSTEMINCLUDE   ../../../../../inc
+
+SOURCEPATH      ../data
+START RESOURCE  alfdebugserver.rss
+END
+
+SOURCEPATH      ../src
+SOURCE          alfdebugserver.cpp
+
+LIBRARY         ECOM.LIB
+LIBRARY         euser.lib
+LIBRARY         alfappservercore.lib
+LIBRARY         apparc.lib
+LIBRARY         avkon.lib 
+LIBRARY         eikcore.lib 
+LIBRARY         cone.lib
+LIBRARY         hitchcock.lib
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,28 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file for project alfdebugextension
+*
+*/
+
+
+PRJ_EXPORTS
+#include "exports.inc"
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_MMPFILES
+alfdebug.mmp
+alfdebugserver.mmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/group/exports.inc	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,6 @@
+
+// To get the MW_LAYER_SYSTEMINCLUDE-definition
+#include <platform_paths.hrh>
+
+// ../rom/alfdebugextension.iby  CORE_MW_LAYER_IBY_EXPORT_PATH(alfdebugextension.iby)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/inc/alfdebug.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,131 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+
+#ifndef C_ALFDEBUGEXTENSION_H
+#define C_ALFDEBUGEXTENSION_H
+
+#include <e32base.h>
+
+_LIT( KAlfDebugExtensionLibraryName, "alfdebug.dll" );
+const TInt KAlfDebugExtensionLibraryEntryOrdinal = 1;
+
+class CAlfEnv;
+
+/**
+ * Measurement structure for server.
+ */
+struct TAlfDebugServerMeasurements
+    {
+    TUint32 iTimeStamp;
+    TInt iServerCells;
+    TInt iServerMemory;
+    TInt iServerFree;
+    TUint iFrameCount;
+    };
+        
+/**
+ *  ?one_line_short_description
+ *  ?more_complete_description
+ *
+ *  @code
+ *   ?good_class_usage_example(s)
+ *  @endcode
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+NONSHARABLE_CLASS( CAlfDebugExtension ) : public CBase
+    {
+    
+public:
+        
+    /**
+     * Sets the time factor that affects the internal absolute clock, which
+     * is returned by Time(). Zero stops the progress of time completely,
+     * 0.5 means that time  progresses in half the speed compared to real
+     * time (1.0).
+     *
+     * @param aTimeFactor  Time factor.
+     */
+    virtual void SetTimeFactor(TReal32 aTimeFactor) = 0;
+
+    /**
+     * Determines the current time factor.
+     *
+     * @return  Time factor.
+     */
+    virtual TReal32 TimeFactor() = 0;
+
+    /**
+     * Determines the number of frames shown.
+     *
+     * @return  Frame count since the system first began rendering.
+     */
+    virtual TUint FrameCount() = 0;
+    
+    /**
+     * Determines the current frame rate. The rate is calculated at most
+     * once per second. Calling this less frequently causes the rate to be
+     * calculated as an average since the last time this was called.
+     *
+     * @return  Frames per second.
+     * 
+     */
+    virtual TReal32 FrameRate() = 0;
+    
+    
+    /**
+     * Shows the frame rate on screen
+     *
+     * @param aInterval Interval in milliseconds when the framerate is 
+     *                  measured and shown
+     *
+     *                  Special cased (from alfdebugextensionconstants.h)
+     *                  KAlfDebugHideFraweRate (0) Hides the framerate counter
+     *                  KAlfDebugShowFraweRateAfterDrawLoop (-1) Updates frame rate
+     *                      on screen when a drawing sequence ends (idle-idle)
+     *                  KAlfDebugShowFraweRateWhenQueried (-2) updates the screen 
+     *                      when user calls FrameCount().
+     *
+     */ 
+    virtual void ShowFrameRate( TInt aInterval = 500 ) = 0;
+       
+    virtual void ShowServerHeapUsage( TBool aShow = ETrue ) = 0;
+
+    /**
+     * Measures performance from the server side.
+     * @param aResult this will contain results of measurements.
+     * @return error code.
+     */
+    virtual TInt GetMeasurements( TAlfDebugServerMeasurements& aResult ) = 0;
+    
+    };
+
+
+NONSHARABLE_CLASS( CAlfDebugFactory ) : public CBase
+    {
+public:
+    virtual CAlfDebugExtension* CreateDebugExtensionL( CAlfEnv* aEnv = NULL ) = 0; 
+    };
+
+
+IMPORT_C CAlfDebugFactory* CreateDebugExtensionFactoryL();
+
+
+#endif // C_ALFDEBUGEXTENSION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/inc/alfdebugextensionconstants.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 ALFDEBUGEXTENSIONCONSTANTS_H
+#define ALFDEBUGEXTENSIONCONSTANTS_H
+
+
+// All the components in this factory
+enum 
+    {
+    EAlfDebugExtensionCreateDebug
+    };
+
+// Commands for this plugin
+enum
+    {
+    EAlfDebugCmdSetTimeFactor,
+    EAlfDebugCmdGetTimeFactor,
+    EAlfDebugCmdGetFrameCount,
+    EAlfDebugCmdGetFrameRate,
+    EAlfDebugCmdShowFrameRate,
+    EAlfDebugCmdShowServerHeap,
+    EAlfDebugCmdMeasure
+    };
+    
+// constats for commands
+const TInt KAlfDebugHideFraweRate               = 0;
+const TInt KAlfDebugShowFraweRateAfterDrawLoop  = -1;
+const TInt KAlfDebugShowFraweRateWhenQueried    = -2;
+
+#endif // ALFDEBUGEXTENSIONCONSTANTS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/inc/alfdebugimpl.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,118 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+
+#ifndef C_ALFDEBUGEXTENSIONOIMPL_H
+#define C_ALFDEBUGEXTENSIONOIMPL_H
+
+#include "alfdebug.h"
+
+class CAlfEnv;
+class CAlfGenComponent;
+
+/**
+ *  ?one_line_short_description
+ *  ?more_complete_description
+ *
+ *  @code
+ *   ?good_class_usage_example(s)
+ *  @endcode
+ *
+ *  @lib ?library
+ *  @since S60 ?S60_version *** for example, S60 v3.0
+ */
+NONSHARABLE_CLASS( CAlfDebugExtensionImpl ): public CAlfDebugExtension
+    {
+    
+public:
+    
+    static CAlfDebugExtensionImpl* NewL( CAlfEnv& aEnv );
+    ~CAlfDebugExtensionImpl();
+    
+public:
+    
+    /**
+     * Sets the time factor that affects the internal absolute clock, which
+     * is returned by Time(). Zero stops the progress of time completely,
+     * 0.5 means that time  progresses in half the speed compared to real
+     * time (1.0).
+     *
+     * @param aTimeFactor  Time factor.
+     */
+    void SetTimeFactor(TReal32 aTimeFactor);
+
+    /**
+     * Determines the current time factor.
+     *
+     * @return  Time factor.
+     */
+    TReal32 TimeFactor();
+
+    /**
+     * Determines the number of frames shown.
+     *
+     * @return  Frame count since the system first began rendering.
+     */
+    TUint FrameCount();
+    
+    /**
+     * Determines the current frame rate. The rate is calculated at most
+     * once per second. Calling this less frequently causes the rate to be
+     * calculated as an average since the last time this was called.
+     *
+     * @return  Frames per second.
+     * 
+     */
+    TReal32 FrameRate();
+    
+    void ShowFrameRate( TBool aShow = ETrue );
+    
+    void ShowServerHeapUsage( TInt aInterval = 500 );
+
+    /**
+     * Measures performance from the server side.
+     * @param aResult this will contain results of measurements.
+     * @return error code.
+     */
+    virtual TInt GetMeasurements( TAlfDebugServerMeasurements& aResult );
+    
+private:
+
+    CAlfDebugExtensionImpl();
+
+    void ConstructL( CAlfEnv& aEnv );
+
+private: // data
+        
+    CAlfEnv* iEnv;
+    CAlfGenComponent* iComms;
+    };
+    
+    
+NONSHARABLE_CLASS( CAlfDebugFactoryImpl ) : public CAlfDebugFactory
+    {
+public:
+    ~CAlfDebugFactoryImpl();
+    CAlfDebugExtension* CreateDebugExtensionL( CAlfEnv* aEnv = NULL ); 
+    
+private:
+    CAlfEnv* iOwnEnv;
+    };
+
+
+#endif // C_ALFDEBUGEXTENSIONOIMPL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/inc/alfdebugserver.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,70 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+#ifndef T_ALFDEBUGSERVER_H
+#define T_ALFDEBUGSERVER_H
+
+#include <alf/alfextensionfactory.h>
+
+class CHuiControlGroup;
+class CMonitorControl;
+
+class TAlfDebugHandler : public MAlfExtensionFactory
+    {
+public:
+    MAlfExtension* CreateExtensionL(
+        const TInt aObjectId, 
+        const TDesC8& aInitialParams, 
+        MAlfInterfaceProvider& aResolver );
+    void Release();
+    };
+    
+class CAlfDebugServer : public CBase, public MAlfExtension
+    {
+public:
+    CAlfDebugServer( CHuiEnv& aEnv );
+    ~CAlfDebugServer();
+    virtual void Release();
+    virtual TAny* GetInterface( const THuiInterfaceSupport& aInterface );
+    virtual void HandleCmdL( TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse );
+    
+    void ShowFrameRateL( TInt aInterval );
+    void ShowServerHeapL( TBool aShow );
+    
+private:
+    void CreateControlIfNeededL();
+    void DeteteControlIfNeeded();
+
+private:
+    CHuiEnv& iEnv;
+    
+    CHuiControlGroup* iGroup;
+    CMonitorControl* iControl; 
+    
+    // For showing the framerate
+    TInt iUsedFrameRateMonitorControlGroupId;
+    
+public:
+    // 
+    TInt iFpsUpdatePeriod;
+    TInt iServerHeapUpdatePeriod;
+    
+    };
+
+
+#endif // T_ALFDEBUGSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/inc/alfdebuguid.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,25 @@
+/*
+* 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:
+*
+*/
+
+
+#ifndef ALFDEBUGUIDS
+#define ALFDEBUGUIDS
+
+#define KAlfDebugServerExtensionPluginUid 0x20016B91
+#define KAlfDebugExtensionImplementationId 0x20016B92
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/rom/alfdebugextension.iby	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  (ROM) Image description file
+*
+*/
+
+
+#ifndef ALFDEBUGEXTENSION_IBY
+#define ALFDEBUGEXTENSION_IBY
+
+#include <data_caging_paths_for_iby.hrh>
+
+file=\epoc32\release\armv5\urel\alfdebug.dll sys\bin\alfdebug.dll
+
+file=\epoc32\release\armv5\urel\alfdebugserver.dll sys\bin\alfdebugserver.dll
+data=\epoc32\data\z\resource\plugins\alfdebugserver.rsc resource\plugins\alfdebugserver.rsc
+
+#endif // ALFDEBUGEXTENSION_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/sis/alfdebugextension.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,37 @@
+;
+; 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:
+;
+; alfdebugextension.pkg
+;
+;Language - standard language definitions
+&EN
+
+; standard SIS file header
+#{"Alf Debug client"},(0x20016B90),1,2,0
+
+;Supports Series 60 v 3.0
+(0x101F7961), 0, 0, 0, {"Series60ProductID"}
+
+;Localized Vendor Name
+%{"My Test EN"}
+
+; Certificate files, should be deprecated from Symbian v9.1 onwards?
+*"..\..\..\certificates\rd-key.pem","..\..\..\certificates\rd.cer"
+
+;Unique Vendor name
+:"Vendor"
+
+; Files to copy
+"\epoc32\release\armv5\urel\alfdebug.dll"-"!:\sys\bin\alfdebug.dll"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/sis/alfdebugextensionplugin.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,34 @@
+;
+; 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:
+;
+;
+;Language - standard language definitions
+&EN
+
+; standard SIS file header
+#{"Alf debug server plug-in"},(0x20016B91),1,0,0
+
+;Supports Series 60 v 3.0
+(0x101F7961), 0, 0, 0, {"Series60ProductID"}
+
+;Localized Vendor Name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+; Files to copy
+"\epoc32\release\armv5\urel\alfdebugserver.DLL"-"!:\sys\bin\alfdebugserver.DLL"
+"\epoc32\data\z\resource\plugins\alfdebugserver.rsc"-"!:\resource\plugins\alfdebugserver.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/sis/createsisx.bat	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,20 @@
+rem
+rem Copyright (c) 2009 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 Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+makesis alfdebugextension.pkg
+signsis alfdebugextension.sis alfdebugextension.sisx ..\..\..\certificates\rd.cer ..\..\..\certificates\rd-key.pem
+makesis alfdebugextensionplugin.pkg
+signsis alfdebugextensionplugin.sis alfdebugextensionplugin.sisx ..\..\..\certificates\rd.cer ..\..\..\certificates\rd-key.pem
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/src/alfdebug.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,211 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+#include "alfdebugimpl.h"
+#include "alfdebugextensionconstants.h"
+#include "alfdebuguid.h"
+#include <alf/alfgencomponent.h>
+#include <alf/alfenv.h>
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CAlfDebugExtensionImpl::CAlfDebugExtensionImpl()
+    {
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+void CAlfDebugExtensionImpl::ConstructL( CAlfEnv& aEnv )
+    {
+    iEnv = &aEnv;
+    
+    TRAP_IGNORE( 
+      iComms =
+        CAlfGenComponent::NewL( 
+            aEnv,
+            EAlfDebugExtensionCreateDebug,
+            KAlfDebugExtensionImplementationId,
+            KNullDesC8 ) );
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CAlfDebugExtensionImpl* CAlfDebugExtensionImpl::NewL( CAlfEnv& aEnv )
+    {
+    CAlfDebugExtensionImpl* self = new( ELeave ) CAlfDebugExtensionImpl;
+    CleanupStack::PushL( self );
+    self->ConstructL(aEnv);
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+CAlfDebugExtensionImpl::~CAlfDebugExtensionImpl()
+    {
+    delete iComms;
+    }
+
+// ---------------------------------------------------------------------------
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//
+void CAlfDebugExtensionImpl::SetTimeFactor(TReal32 aTimeFactor)
+    {
+    TPckgC<TReal32> inParams(aTimeFactor);
+    if ( iComms )
+        {
+        iComms->DoCmdNoReply( EAlfDebugCmdSetTimeFactor, inParams );
+        }
+    return;
+    }
+
+// ---------------------------------------------------------------------------
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//    
+TReal32 CAlfDebugExtensionImpl::TimeFactor()
+    {
+    TReal32 result(1.f);
+    if ( iComms )
+        {
+        TPckg<TReal32> outParams(result);
+        iComms->DoSynchronousCmd( EAlfDebugCmdGetTimeFactor, KNullDesC8(), outParams );
+        }
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//    
+TUint CAlfDebugExtensionImpl::FrameCount()
+    {
+    TUint result(0);
+    if ( iComms )
+        {
+        TPckg<TUint> outParams(result);
+        iComms->DoSynchronousCmd( EAlfDebugCmdGetFrameCount, KNullDesC8(), outParams );
+        }
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//    
+TReal32 CAlfDebugExtensionImpl::FrameRate()
+    {
+    TReal32 result(0.f);
+    if ( iComms )
+        {
+        TPckg<TReal32> outParams(result);
+        iComms->DoSynchronousCmd( EAlfDebugCmdGetFrameRate, KNullDesC8(), outParams );
+        }
+    return result;
+    }
+
+// ---------------------------------------------------------------------------
+// ?implementation_description
+// ---------------------------------------------------------------------------
+//     
+void CAlfDebugExtensionImpl::ShowFrameRate( TInt aInterval )
+    {
+    TPckgC<TInt> inParams(aInterval);
+    if ( iComms )
+        {
+        iComms->DoCmdNoReply( EAlfDebugCmdShowFrameRate, inParams );
+        }
+    return;
+    }
+    
+void CAlfDebugExtensionImpl::ShowServerHeapUsage( TBool aShow )
+    {
+    TPckgC<TBool> inParams(aShow);
+    if ( iComms )
+        {
+        iComms->DoCmdNoReply( EAlfDebugCmdShowServerHeap, inParams );
+        }
+    return;
+    }
+    
+
+// ---------------------------------------------------------------------------
+// Get measurements from the server side.
+// ---------------------------------------------------------------------------
+//     
+TInt CAlfDebugExtensionImpl::GetMeasurements( 
+        TAlfDebugServerMeasurements& aResult )
+    {
+    TInt err = KErrServerTerminated;
+    
+    if ( iComms )
+        {
+        TPckg<TAlfDebugServerMeasurements> outParams( aResult );
+        err = iComms->DoSynchronousCmd( 
+            EAlfDebugCmdMeasure, 
+            KNullDesC8(), 
+            outParams );
+        }
+        
+    return err;
+    }
+    
+CAlfDebugFactoryImpl::~CAlfDebugFactoryImpl()
+    {
+    delete iOwnEnv;
+    }
+    
+CAlfDebugExtension* CAlfDebugFactoryImpl::CreateDebugExtensionL( CAlfEnv* aEnv )
+    {
+    CAlfEnv* usedEnv = aEnv;
+    
+    if ( !usedEnv )
+        {
+        // check static
+        usedEnv = CAlfEnv::Static();
+        if ( !usedEnv )
+            {
+            // create own
+            iOwnEnv = CAlfEnv::NewL();
+            usedEnv = iOwnEnv;
+            }
+        }
+    
+    return CAlfDebugExtensionImpl::NewL( *usedEnv );
+    }
+
+
+EXPORT_C CAlfDebugFactory* CreateDebugExtensionFactoryL()
+    {
+    return new (ELeave) CAlfDebugFactoryImpl;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfdebugextension/src/alfdebugserver.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,596 @@
+/*
+* Copyright (c)  Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+#include "alfdebugserver.h"
+#include "alfdebugextensionconstants.h"
+#include "alfdebuguid.h"
+#include "alfdebug.h" // for TAlfDebugServerMeasurements
+
+#include <uiacceltk/huienv.h>
+#include <uiacceltk/huicommand.h>
+#include <uiacceltk/huistatic.h>
+#include <uiacceltk/huicontrol.h>
+#include <uiacceltk/huicontrolgroup.h>
+#include <uiacceltk/huitextvisual.h>
+#include <uiacceltk/huieventhandler.h>
+#include <uiacceltk/huievent.h>
+#include <uiacceltk/huidisplay.h>
+#include <uiacceltk/huiroster.h>
+#include <uiacceltk/huigridlayout.h>
+
+#include <implementationproxy.h>
+
+
+_LIT8( KFrameRateTag, "FPS" );
+_LIT8( KHeapTag, "heap" );
+_LIT8( KContainerTag, "container" );
+_LIT8( KIdleCheckerTag, "idle" );
+
+
+enum TCustomEventCommands 
+    {
+    EUpdateFrameRate,
+    EUpdateServerHeap
+    };
+
+// this is a helper class to know when the refreshing goes to idle
+// assumptions: CHuiVisual::Changed() is called for every visual in the 
+// shown control group. If something is drawn in the loop, the 
+// CHuiVisual::ClearChanged() is called. If nothing is drawn, it is not called
+class CIdleCheckVisual : public CHuiVisual
+    {
+public:
+    static CIdleCheckVisual* AddNewL(
+        CHuiControl& aOwnerControl,
+        CHuiLayout* aParentLayout = 0);    
+        
+protected:
+    CIdleCheckVisual(MHuiVisualOwner& aOwner);
+    ~CIdleCheckVisual();
+        
+public: // from base classes
+    void ClearChanged();
+    TBool Changed() const;
+    
+// for async one shot
+    mutable CAsyncCallBack* iAsyncCallBack;
+    static TInt CallBackFunction(TAny* aAny);
+
+    enum TState
+        {
+        EDisabled,
+        EIdleNeedsReseting,
+        EDrawning,
+        EUpdatingText,
+        EGoingToIdle1,
+        EGoingToIdle2,
+        EGoingToIdle3
+        };
+        
+    mutable TState iState;
+        
+    };
+    
+    
+// monitor control for showing the text visuals and receiving the events.
+class CMonitorControl : public CHuiControl
+    {
+public:
+    CMonitorControl(CHuiEnv& aEnv, CAlfDebugServer& aServerSession );
+    void ConstructL();
+    TBool OfferEventL(const THuiEvent& aEvent);
+    
+    void UpdateFrameRateTextL( TReal32 aFrameRate );
+public:
+    TInt iInitialVisualCount;
+private:
+    CAlfDebugServer& iServerSession;
+    };    
+    
+    
+    
+    
+    
+    
+CIdleCheckVisual* CIdleCheckVisual::AddNewL(
+        CHuiControl& aOwnerControl,
+        CHuiLayout* aParentLayout )
+    {
+    CIdleCheckVisual* visual = new (ELeave) CIdleCheckVisual(aOwnerControl);
+    CleanupStack::PushL( visual );
+    visual->ConstructL();
+    aOwnerControl.AppendL(visual, aParentLayout);
+    CleanupStack::Pop(visual);
+    return visual;
+    }
+    
+CIdleCheckVisual::CIdleCheckVisual(MHuiVisualOwner& aOwner) 
+ : CHuiVisual( aOwner ), iState( EIdleNeedsReseting )
+    {
+    }
+    
+CIdleCheckVisual::~CIdleCheckVisual()
+    {
+    if ( iAsyncCallBack )
+        {
+        iAsyncCallBack->Cancel();
+        }
+    delete iAsyncCallBack;
+    iAsyncCallBack = NULL;
+    }
+    
+TBool CIdleCheckVisual::Changed() const
+    {
+    if ( iState == EIdleNeedsReseting )
+        {
+        CHuiStatic::FrameRate(); // just reset the framerate counter.
+        iState = EDrawning;
+        }
+    
+    if ( iAsyncCallBack )
+        {
+        iAsyncCallBack->Cancel();
+        }
+    else 
+        {
+        TCallBack callback( CallBackFunction, const_cast<CIdleCheckVisual*>(this) );
+        iAsyncCallBack = new CAsyncCallBack( callback, CActive::EPriorityHigh );
+        }  
+        
+    if ( iState != EDisabled )
+        {
+        iAsyncCallBack->CallBack();
+        }
+        
+    return CHuiVisual::Changed();
+    }
+    
+void CIdleCheckVisual::ClearChanged()
+    {
+    if ( iAsyncCallBack )
+        {
+        iAsyncCallBack->Cancel();
+        }
+    CHuiVisual::ClearChanged();
+    }
+    
+TInt CIdleCheckVisual::CallBackFunction(TAny* aAny)
+    {
+    // if this function is called, we assume that the drawing has gone to idle
+    CIdleCheckVisual* self = static_cast<CIdleCheckVisual*>( aAny );
+    
+    switch (self->iState)
+        {
+        case EIdleNeedsReseting:
+            break;
+        case EDrawning:
+            // real drawing loop ended. update text which will cause some more drawing.
+            TRAP_IGNORE(static_cast<CMonitorControl*>( &self->Owner() )->UpdateFrameRateTextL( CHuiStatic::FrameRate() ));
+            self->iState = EUpdatingText;
+            break;
+        case EUpdatingText:
+            // text update drawing ongoing
+            self->iState = EGoingToIdle1;
+            break;
+        case EGoingToIdle1:
+            // text update drawing ongoing
+            self->iState = EGoingToIdle2;
+            break;
+        case EGoingToIdle2:
+            // text update drawing ongoing
+            self->iState = EGoingToIdle3;
+            break;
+        case EGoingToIdle3:
+            // text update drawing ongoing
+            self->iState = EIdleNeedsReseting;
+            break;
+        default:
+            break;
+        }
+    
+    return KErrNone;
+    }
+
+
+    
+CMonitorControl::CMonitorControl(CHuiEnv& aEnv, CAlfDebugServer& aServerSession) : 
+    CHuiControl(aEnv), 
+    iServerSession( aServerSession )
+    {
+    }
+
+void CMonitorControl::ConstructL()
+    {
+    CHuiControl::ConstructL();
+    
+    // create idle checker
+    CIdleCheckVisual* idleChecker = CIdleCheckVisual::AddNewL( *this );
+    idleChecker->SetTagL(KIdleCheckerTag);
+    idleChecker->iState = CIdleCheckVisual::EDisabled; // activate when requested.
+    
+    // create container for the texts
+    CHuiGridLayout* gridContainer = CHuiGridLayout::AddNewL( *this, 1 , 5 );
+    gridContainer->SetTagL(KContainerTag);
+    
+    THuiBoxMetric padding( 
+        THuiXYMetric( // top left
+            THuiMetric( 0.5f , EHuiUnitMySize), // left
+            THuiMetric( 0.2f , EHuiUnitMySize)  // top
+            ),
+        THuiXYMetric( // bottom right
+            THuiMetric( 0.f , EHuiUnitMySize), // right
+            THuiMetric( 0.1f , EHuiUnitMySize)// bottom
+            ) );
+            
+    gridContainer->SetPadding( padding );
+    
+    
+    // update this at the end
+    iInitialVisualCount = VisualCount();
+    }
+    
+    
+    
+TBool CMonitorControl::OfferEventL(const THuiEvent& aEvent)
+    {
+    TBool handled = EFalse;
+    if (aEvent.IsCustomEvent() && aEvent.iParam == EUpdateFrameRate )
+        {
+        UpdateFrameRateTextL( CHuiStatic::FrameRate() );
+        
+        THuiCustomEventCommand command( EUpdateFrameRate, static_cast<MHuiEventHandler*>(this) );
+        Env().Send( command, iServerSession.iFpsUpdatePeriod );        
+        
+        handled = ETrue;
+        }
+    else if ( aEvent.IsCustomEvent() && aEvent.iParam == EUpdateServerHeap )
+        {
+        CHuiTextVisual* textVisual = static_cast<CHuiTextVisual*>(FindTag( KHeapTag ) );
+        
+        User::Heap().Compress();
+        
+        TInt totalSize = 0;
+        TInt usedSize = User::AllocSize( totalSize );
+        TBuf<32> buffer;
+        buffer.AppendNum( usedSize );
+        buffer.Append( _L(" cells\n") );
+        buffer.AppendNum( totalSize );
+        buffer.Append( _L("B") );
+
+        textVisual->SetTextL( buffer );
+        
+        THuiCustomEventCommand command( EUpdateServerHeap, static_cast<MHuiEventHandler*>(this) );
+        Env().Send( command, iServerSession.iServerHeapUpdatePeriod );
+        
+        // make sure we are on top
+        if ( Env().DisplayCount() )
+            {
+            CHuiDisplay& display = Env().PrimaryDisplay();
+            display.Roster().ShowL( *ControlGroup() );
+            }
+            
+        handled = ETrue;
+        }
+        
+    return handled;
+    }
+    
+void CMonitorControl::UpdateFrameRateTextL( TReal32 aFrameRate )
+    {
+    CHuiTextVisual* textVisual = static_cast<CHuiTextVisual*>(FindTag( KFrameRateTag ) );
+        
+    TBuf<32> buffer;
+    buffer.AppendNum(aFrameRate,  TRealFormat( 4, 1 ) );
+    buffer.Append( _L(" fps") );
+    textVisual->SetTextL( buffer );
+    
+    // make sure we are on top
+    if ( Env().DisplayCount() )
+        {
+        CHuiDisplay& display = Env().PrimaryDisplay();
+        display.Roster().ShowL( *ControlGroup() );
+        }
+    }
+
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+//
+MAlfExtension* TAlfDebugHandler::CreateExtensionL(
+        const TInt aObjectId, 
+        const TDesC8& /*aInitialParams*/, 
+        MAlfInterfaceProvider& aResolver )
+    {
+    MAlfExtension* result = NULL;
+    switch( aObjectId )
+        {
+        case EAlfDebugExtensionCreateDebug:
+            {
+            result = new (ELeave) CAlfDebugServer( *aResolver.SharedHuiEnv() );
+            break;
+            }  
+
+        default:
+            User::Leave( KErrNotSupported );
+        }
+    return result;
+    }
+    
+void TAlfDebugHandler::Release()
+    {
+    delete this;
+    }
+
+// ---------------------------------------------------------------------------
+// ?description_if_needed
+// ---------------------------------------------------------------------------
+// 
+CAlfDebugServer::CAlfDebugServer( CHuiEnv& aEnv ) : iEnv( aEnv )
+    {
+    iFpsUpdatePeriod = 500;
+    iServerHeapUpdatePeriod = 400;
+    }
+   
+CAlfDebugServer::~CAlfDebugServer()
+    {
+    if ( iGroup )
+        {
+        iEnv.DeleteControlGroup( TInt(this) );
+        }
+    iGroup = NULL;
+    }
+    
+void CAlfDebugServer::Release()
+    {
+    delete this;
+    }
+    
+TAny* CAlfDebugServer::GetInterface( const THuiInterfaceSupport& /*aInterface*/ )
+    {
+    return NULL;
+    }
+    
+void CAlfDebugServer::HandleCmdL( TInt aCommandId, const TDesC8& aInputBuffer, TDes8& aResponse )
+    {
+    switch (aCommandId)
+        {
+        case EAlfDebugCmdSetTimeFactor:
+            {
+            const TReal32* inParam = (TReal32*) aInputBuffer.Ptr();
+            CHuiStatic::SetTimeFactor(*inParam);
+            break;
+            }
+        case EAlfDebugCmdGetTimeFactor:
+            {
+            const TReal32 result = CHuiStatic::TimeFactor();
+            TPckg<TReal32> resultPckg(result);
+            aResponse = resultPckg;
+            break;
+            }
+        case EAlfDebugCmdGetFrameCount:
+            {    
+            const TUint result = CHuiStatic::FrameCount();
+            TPckg<TUint> resultPckg(result);
+            aResponse = resultPckg;
+            break;
+            }
+        case EAlfDebugCmdGetFrameRate:
+            {    
+            const TReal32 result = CHuiStatic::FrameRate();
+            TPckg<TReal32> resultPckg(result);
+            aResponse = resultPckg;
+            
+            // show on screen if needed
+            if ( iControl && iFpsUpdatePeriod == -2 )
+                {
+                iControl->UpdateFrameRateTextL( result );
+                }
+            break;
+            }
+        case EAlfDebugCmdShowFrameRate:
+            {
+            const TInt* inParam = (TBool*) aInputBuffer.Ptr();
+            ShowFrameRateL(*inParam);
+            break;
+            }
+            
+        case EAlfDebugCmdShowServerHeap:
+            {
+            const TBool* inParam = (TBool*) aInputBuffer.Ptr();
+            ShowServerHeapL(*inParam);
+            break;
+            }
+        
+        case EAlfDebugCmdMeasure:
+            {
+            TAlfDebugServerMeasurements measurements;
+            TPckg<TAlfDebugServerMeasurements> result(measurements);
+            
+            // Timestamp
+            measurements.iTimeStamp = User::NTickCount();
+            
+            // Memory measures
+            measurements.iServerCells = 
+                User::AllocSize( measurements.iServerMemory );
+            TInt dummy;
+            measurements.iServerFree = User::Available( dummy );
+            
+            // Rendering measures
+            measurements.iFrameCount = CHuiStatic::FrameCount();
+
+            aResponse = result;
+            }
+            break;
+            
+        default:
+            User::Leave( KErrNotSupported );
+            break;
+        }
+    }
+    
+void CAlfDebugServer::CreateControlIfNeededL()
+    {
+    if ( !iGroup )
+        { 
+        iGroup = &iEnv.NewControlGroupL( TInt(this) );
+        }
+        
+    if ( !iControl )
+        {
+        CMonitorControl* control = new (ELeave) CMonitorControl(iEnv, *this);
+        CleanupStack::PushL( control );
+        control->ConstructL();
+        iGroup->AppendL( control );
+        CleanupStack::Pop( control );
+        iControl = control;
+        }
+        
+    // make sure we are on top
+    if ( iEnv.DisplayCount() )
+        {
+        CHuiDisplay& display = iEnv.PrimaryDisplay();
+        display.Roster().ShowL( *iGroup );
+        }
+    }
+    
+    
+void CAlfDebugServer::DeteteControlIfNeeded()
+    {
+    if ( iControl && iControl->VisualCount() == iControl->iInitialVisualCount )
+        {
+        iGroup->Remove( iControl );
+        delete iControl;
+        iControl = NULL;
+        }
+    
+    if ( iGroup && iGroup->Count() == 0 )
+        {
+        iEnv.DeleteControlGroup( TInt(this) );
+        iGroup = NULL;
+        }
+    }
+
+void CAlfDebugServer::ShowFrameRateL( TInt aInterval )
+    {
+    CHuiTextVisual* textVisual = iControl ? static_cast<CHuiTextVisual*>(iControl->FindTag( KFrameRateTag ) ) : 0;
+    if ( aInterval != KAlfDebugHideFraweRate )
+        {
+        CreateControlIfNeededL();
+        
+        if ( !textVisual )
+            {
+            textVisual = CHuiTextVisual::AddNewL(*iControl, static_cast<CHuiLayout*>(iControl->FindTag( KContainerTag )) );
+            textVisual->SetTagL( KFrameRateTag );
+            textVisual->SetColor( KRgbRed );
+            }
+        
+        
+        CIdleCheckVisual* idleChecker = static_cast<CIdleCheckVisual*>(iControl->FindTag( KIdleCheckerTag ));
+        if ( aInterval == KAlfDebugShowFraweRateAfterDrawLoop ) // idle-idle
+            {
+            // use idle-idle
+            idleChecker->iState = CIdleCheckVisual::EIdleNeedsReseting;
+            }
+        else if ( aInterval == KAlfDebugShowFraweRateWhenQueried ) // manual
+            {
+            iFpsUpdatePeriod = aInterval;
+            idleChecker->iState = CIdleCheckVisual::EDisabled;
+            }
+        else
+            {
+            iFpsUpdatePeriod = aInterval;
+            idleChecker->iState = CIdleCheckVisual::EDisabled;
+            
+            THuiCustomEventCommand command( EUpdateFrameRate, static_cast<MHuiEventHandler*>(iControl) );
+            iEnv.Send( command, iFpsUpdatePeriod );
+            }
+        }
+    else
+        {
+        if ( iControl )
+            {
+            if ( textVisual )
+                {
+                textVisual->RemoveAndDestroyAllD();
+                }
+            iEnv.CancelCommands( static_cast<MHuiEventHandler*>(iControl) , EHuiCommandTypeCustomEvent, EUpdateFrameRate );
+            }
+            
+        DeteteControlIfNeeded();
+        }
+    }
+    
+void CAlfDebugServer::ShowServerHeapL( TBool aShow )
+    {
+    CHuiTextVisual* textVisual = iControl ? static_cast<CHuiTextVisual*>(iControl->FindTag( KHeapTag ) ) : 0;
+    if ( aShow )
+        {
+        CreateControlIfNeededL();
+        
+        if ( !textVisual )
+            {
+            textVisual = CHuiTextVisual::AddNewL(*iControl, static_cast<CHuiLayout*>(iControl->FindTag( KContainerTag )));
+            textVisual->SetTagL( KHeapTag );    
+            textVisual->SetColor( KRgbRed );
+            }
+        
+        THuiCustomEventCommand command( EUpdateServerHeap, static_cast<MHuiEventHandler*>(iControl) );
+        iEnv.Send( command, iServerHeapUpdatePeriod );
+        }
+    else
+        {
+        if ( iControl )
+            {
+            if ( textVisual )
+                {
+                textVisual->RemoveAndDestroyAllD();
+                }
+            iEnv.CancelCommands( static_cast<MHuiEventHandler*>(iControl) , EHuiCommandTypeCustomEvent, EUpdateServerHeap );
+            }
+        DeteteControlIfNeeded();
+        }
+    }
+
+
+// Global functions:
+
+MAlfExtensionFactory* Instance()
+    {
+    TAlfDebugHandler* me = NULL;
+    me = new TAlfDebugHandler;
+    return me;
+    }
+
+const TImplementationProxy ImplementationTable[] =
+    {
+#ifdef __EABI__
+    {{KAlfDebugExtensionImplementationId}, (TFuncPtr)Instance}
+#else
+    {{KAlfDebugExtensionImplementationId}, Instance}
+#endif
+    };
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+    {
+    aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy) ;
+    return ImplementationTable;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/data/alfperfapp.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,555 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource definitions for project alfperfapp.
+*
+*/
+
+
+NAME    TPRF
+
+#include <eikon.rh>
+#include <avkon.rh>
+#include <appinfo.rh>
+#include <avkon.rsg>
+#include <data_caging_paths_strings.hrh>
+#include <bldvariant.hrh>
+#include "alfperfapp.hrh"
+#include "alfperfapp.rh"
+
+RESOURCE RSS_SIGNATURE { }
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+    {
+    status_pane = r_alfperfapp_status_pane;
+    }
+
+RESOURCE LOCALISABLE_APP_INFO r_alfperfapp_localisable_app_info
+    {
+    short_caption = "AlfPerfApp";
+    caption_and_icon =
+        CAPTION_AND_ICON_INFO
+            {
+            caption = "AlfPerfApp";
+            };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_alfperfapp_status_pane
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE STATUS_PANE_APP_MODEL r_alfperfapp_status_pane
+    {
+    panes =
+        {
+        SPANE_PANE
+            {
+            id = EEikStatusPaneUidTitle;
+            type = EAknCtTitlePane;
+            resource = r_alfperfapp_default_title_pane;
+            }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_alfperfapp_default_title_pane
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TITLE_PANE r_alfperfapp_default_title_pane
+    {
+    txt = "AlfPerfApp";
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_alfperfapp_test_case_selection_view
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_alfperfapp_test_case_selection_view
+    {
+    menubar = r_alfperfapp_test_case_selection_menubar;
+    cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
+    }
+
+
+// -----------------------------------------------------------------------------
+//
+//     r_alfperfapp_test_case_selection_menubar
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_BAR r_alfperfapp_test_case_selection_menubar
+    {
+    titles =
+        {
+        MENU_TITLE { menu_pane = r_alfperfapp_test_case_selection_menupane; }
+        };
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_alfperfapp_test_case_selection_menupane
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE MENU_PANE r_alfperfapp_test_case_selection_menupane
+    {
+    items =
+        {
+        MENU_ITEM
+            {
+            command = EAlfPerfAppCmdRunAll;
+            txt = "Run All";
+            },
+        MENU_ITEM
+            {
+            command = EAlfPerfAppCmdRunAllContinuously;
+            txt = "Run Continuously";
+            },
+        MENU_ITEM
+            {
+            command = EAlfPerfAppCmdClearFiles;
+            txt = "Clear Files";
+            },
+        MENU_ITEM
+            {
+            command = EAknCmdExit;
+            txt = "Exit";
+            }
+        };
+    }
+
+RESOURCE MENU_PANE r_alfperfapp_test_case_selection_suite_menupane
+    {
+    items =
+        {
+        // Holder for menu items
+        };
+    }
+    
+// -----------------------------------------------------------------------------
+//
+//    r_alfperfapp_test_case_execution_view
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_alfperfapp_test_case_execution_view
+    {
+    cba = R_AVKON_SOFTKEYS_EMPTY;
+    }
+
+// -----------------------------------------------------------------------------
+//
+//    r_alfperfapp_test_case_execution_view_continuous_run
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_alfperfapp_test_case_execution_view_continuous_run
+    {
+    cba = R_AVKON_SOFTKEYS_OK_EMPTY;
+    }
+
+
+
+// -----------------------------------------------------------------------------
+//
+//    r_alfperfapp_testset
+//    Defines all test suites and cases.
+//
+//    Customizations:
+//      Test Suite
+//        flags = EAlfPerfAppTestSuiteFlagExcludeFromRunAll; <- excludes from Run All and Run Continuously       
+//
+//      Test Case
+//        flags = EAlfPerfAppTestCaseFlagRequiresInActiveFlag; <- Disables this case if Inactive flag is
+//                                                                not supported.
+//        sequenceLength = X; <- Marks this as a sequence case (if X > 0) --> Repetive runs get
+//                               their testCounter increased if the cases are run after each other.
+//                               X denotes the number of times this case is added in the sequence                     
+// -----------------------------------------------------------------------------
+//
+RESOURCE ALFPERFAPP_TESTSET r_alfperfapp_testset
+    {
+    folders =
+        {
+        //
+        // Image tests - implementation in CAlfPerfAppImageTestCase
+        //
+        ALFPERFAPP_TESTSUITE
+            {
+            name = "Image";
+            
+            items = 
+                {
+#ifdef __NVG
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppImageManyNvgCSImages;
+                    name = "Nvg CS-images";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppImageManyNvgTLVImages;
+                    name = "Nvg TLV-images";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppImageBasicMoveScaleNvgCS;
+                    name = "NvgCS: Basic Move & Scale";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppImageBasicMoveScaleNvgTLV;
+                    name = "NvgTLV: Basic Move & Scale";
+                    },
+#endif
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppImageBasicMoveScale;
+                    name = "Basic Move & Scale";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppImageManyImages;
+                    name = "Mif images";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppImageManyGifImages;
+                    name = "Gif images ";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppImageManyPngImages;
+                    name = "Png images";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppImageManySvgImages;
+                    name = "Svgt images";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppImageManyImagesWithPointerEvent;
+                    name = "Pointer events to visuals";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppImageManyImagesWithAutoSize;
+                    name = "Auto sized textures";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppImageAnimate1of2;
+                    name = "Animate 1/2 screen";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppImageAnimate1of4;
+                    name = "Animate 1/4 screen";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppImageAnimate1of8;
+                    name = "Animate 1/8 screen";
+                    }
+                };
+            },
+            
+        //
+        // Cover tests - implementation in CAlfPerfAppCoverTestCase
+        //
+        ALFPERFAPP_TESTSUITE
+            {
+            name = "Cover";
+            
+            items = 
+                {
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppCover;
+                    name = "Scroll & Scale";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppCoverLandscape;
+                    name = "Scroll & Scale in Landscape";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppCoverRotate;
+                    name = "Rotate";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppCoverClipZoomLargeImage;
+                    name = "Clip-Zoom-Pan large image";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppCoverClipZoomBigImage;
+                    name = "Clip-Zoom-Pan big image";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppCoverClipZoomVga;
+                    name = "Clip-Zoom-Pan Vga image";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppCoverClipZoomAutoSize;
+                    name = "Clip-Zoom-Pan Autosize";
+                    }
+                };
+            },
+
+        //
+        // Gallery tests - implementation in CAlfPerfAppGalleryTestCase
+        //
+        ALFPERFAPP_TESTSUITE
+            {
+            name = "Gallery";
+              
+            items = 
+                {
+                    ALFPERFAPP_TESTCASE
+                        {
+                        id = EAlfPerfAppGallery;
+                        name = "Gallery Test";
+                        },
+                    ALFPERFAPP_TESTCASE
+                        {
+                        id = EAlfPerfAppGalleryLandscape;
+                        name = "Gallery Test Landscape";
+                        }
+                };
+            },
+            
+        //
+        // AppSuite tests - implementation in CAlfPerfAppSuiteTestCase
+        //
+        ALFPERFAPP_TESTSUITE
+            {
+            name = "AppSuite";
+            
+            items = 
+                {
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppSuiteCaseScrollContinuousPortrait;
+                    name = "Scroll continuous - portrait";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppSuiteCaseScrollIncrementalPortrait;
+                    name = "Scroll incremental - portrait";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppSuiteCaseScrollContinuousLandscape;
+                    name = "Scroll continuous - landscape";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppSuiteCaseScrollIncrementalLandscape;
+                    name = "Scroll incremental - landscape";
+                    }                      
+                };
+            },                
+                
+        //
+        // Text tests - implementation in CAlfPerfAppTextTestCase
+        //
+        ALFPERFAPP_TESTSUITE
+            {
+            name = "Text";
+            
+            items = 
+                {
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppTextBasicMoveScale;
+                    name = "Basic Move & Scale";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppTextManyTexts;
+                    name = "Many texts";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppTextManyTextsWithPointerEvent;
+                    name = "Pointer events to visuals";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppTextManyTextsWithAutoSize;
+                    name = "Auto sized";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppTextInactiveVisuals;
+                    name = "Inactive visuals";
+                    flags = EAlfPerfAppTestCaseFlagRequiresInActiveFlag;
+                    }
+                };
+            },
+
+
+        //
+        // Framework tests - implementation in CAlfPerfAppFrameworkTestCase
+        //
+        ALFPERFAPP_TESTSUITE
+            {
+            name = "Framework";
+            flags = EAlfPerfAppTestSuiteFlagExcludeFromRunAll;
+
+            items = 
+                {
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppFrameworkEmpty;
+                    name = "Empty";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppFrameworkCreateFail;
+                    name = "Create Fail";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppFrameworkSetupFailSynch;
+                    name = "Setup fails - synch";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppFrameworkSetupFailAsynch;
+                    name = "Setup fails - asynch";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppFrameworkExecuteFailSynch;
+                    name = "Execute fails - synch";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppFrameworkExecuteFailAsynch;
+                    name = "Execute fails - asynch";
+                    }
+                };            
+            },            
+        //
+        // Layout tests - implementation in CAlfPerfAppLayoutTestCase
+        //
+        ALFPERFAPP_TESTSUITE
+            {
+            name = "Layout";
+            
+            items = 
+                {
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppLayoutGrid;
+                    name = "Grid";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppLayoutDeck;
+                    name = "Deck";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppLayoutAnchor;
+                    name = "Anchor";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppLayoutCurvePath;
+                    name = "CurvePath";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppLayoutFlow;
+                    name = "Flow";
+                    },
+                ALFPERFAPP_TESTCASE
+                    {
+                    id = EAlfPerfAppLayoutViewport;
+                    name = "Viewport";
+                    }
+                    
+                };
+            },
+                //
+                // Avkon tests - implementation in CAlfPerfAppAvkonTestCase
+                //
+                ALFPERFAPP_TESTSUITE
+                    {
+                    name = "Avkon";
+                    
+                    items = 
+                        {
+                        ALFPERFAPP_TESTCASE
+                            {
+                            id = EAlfPerfAppAvkonBasicWinGc;
+                            name = "WinGC primitives";
+                            }
+                        };
+                    },
+        ///
+        /// Sequence test cases.
+        /// --------------------
+        /// If adding new cases, increase size of KAlfPerfAppReserveExecution
+        /// to fit all cases from this suite. (In case of RunAllFromSuite)
+        ///
+        ALFPERFAPP_TESTSUITE
+                    {
+                    name = "Sequence";
+                    flags = EAlfPerfAppTestSuiteFlagExcludeFromRunAll;
+                    
+                    items = 
+                        {
+                        ALFPERFAPP_TESTCASE
+                            {
+                            id = EAlfPerfAppImageManyImages;
+                            name = "Image Sequence";
+                            sequenceLength = 49;
+                            },
+                        ALFPERFAPP_TESTCASE
+                            {
+                            id = EAlfPerfAppTextManyTexts;
+                            name = "Text Sequence";
+                            sequenceLength = 49;
+                            }                            
+                        };
+                    }
+                };
+    }
+    
+// -----------------------------------------------------------------------------
+//
+//    r_alfperfapp_text_runall
+//
+// -----------------------------------------------------------------------------
+//
+RESOURCE TBUF r_alfperfapp_text_runall
+    {
+    buf = "Run All";
+    }
+    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/data/alfperfapp_reg.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,34 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Registration resource file for alfperfapp.
+*
+*/
+
+#include <appinfo.rh>
+#include <alfperfapp.rsg>
+#include <data_caging_paths_strings.hrh>
+#include "alfperfapp.hrh"
+
+UID2 KUidAppRegistrationResourceFile
+UID3 KAlfPerfAppUidValue // alfperfapp uid
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "alfperfapp";
+    localisable_resource_file = APP_RESOURCE_DIR"\\alfperfapp";
+    localisable_resource_id = R_ALFPERFAPP_LOCALISABLE_APP_INFO;
+    
+    group_name = "UI Acceler";
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/data/alfperfappdaemon.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource definitions for project alfperfappdaemon.
+*
+*/
+
+
+NAME    DPRF
+
+#include <eikon.rh>
+#include <avkon.rh>
+#include <appinfo.rh>
+#include <avkon.rsg>
+
+RESOURCE RSS_SIGNATURE { }
+RESOURCE TBUF { buf=""; }
+
+RESOURCE EIK_APP_INFO
+    {
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/data/alfperfappdaemon_reg.rss	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Registration resource file for alfperfappdaemon.
+*
+*/
+
+#include <appinfo.rh>
+#include <data_caging_paths_strings.hrh>
+#include "alfperfapp.hrh"
+
+UID2 KUidAppRegistrationResourceFile
+UID3 KAlfPerfAppDaemonUidValue // alfperfappdaemon uid
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "alfperfappdaemon";
+    hidden = KAppIsHidden;
+    }
+
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/3musk.mif has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/Discoveryhd.png has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/Thumbs.db has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfperfapp_imagetest.gif has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfperfapp_imagetest.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfperfapp_imagetest.svg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,194 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="60" height="80" viewBox="0 0 60 80">
+<g>
+<g>
+<rect fill="none" width="60" height="80"/>
+<g>
+<linearGradient id="XMLID_21_" gradientUnits="userSpaceOnUse" x1="18.0986" y1="28.2227" x2="39.2697" y2="53.6735">
+<stop offset="0" style="stop-color:#B3DDFF"/>
+<stop offset="1" style="stop-color:#084296"/>
+</linearGradient>
+<path fill="url(#XMLID_21_)" d="M38.073,34.75l1.201,0.773v-1.719c0,0,2.647-1.25,3.949-1.801c0,0,2.513,0.199,3.247,0.504       l1.017,2.721c0.871,0.301,2,0.953,2,0.953l2.66-1.197c1.408,0.602,2.571,1.59,3.437,3.113l-1.604,2.945       c0,0,0.636,1.232,0.871,1.799l3.161,1.029c0.36,1.24,0.231,4.316,0.231,4.316l-2.782,1.91l-0.823,1.219l1.889,2.832       c0,0-2.489,3.52-5.923,5.064l-1.974-1.889v2.059l-2.919,2.146c-1.649-0.043-3.278-0.518-3.948-0.857l-1.029-3.434       c0,0-1.438-0.684-1.6-0.928l-2.606,1.873c0,0-2.695-2.1-3.348-3.605l1.288-3.006l-0.772-1.373l-2.146-0.342       c0,0-3.69,2.832-9.527,4.979l-0.601-0.859l-2.061,1.287c0,0-2.623,0.209-5.407-0.6l0.002-2.221l-2.066,1.258       c0,0-4.153-2.566-5.488-4.531l1.557-2.236l-2.571,1.395c0,0-2.588-2.959-3.451-6.887L4.512,39.9l-2.857-0.018       c-0.404-1.445-0.565-5.935-0.27-7.24l1.497-1.24L1.666,30.67c0.81-2.693,3.152-5.836,3.152-5.836l2.057-0.719l-0.646-1.125       c0,0,5.15-3.777,11.059-5.07l0.854,0.883l1.76-0.773c1.954-0.031,4.985,0.205,6.309,1.014l0.04,1.545l2.018-0.775       c1.971,0.777,4.542,2.955,5.172,4.123l-1.287,2.402l2.402-0.688c1.48,1.615,2.559,5.166,2.918,6.695l-1.598,1.107L38.073,34.75       z M15.842,30.459c-2.746,3.861-0.001,12.277,6.181,12.531C25.626,38.36,20.734,30.03,15.842,30.459z M41.192,42.846       c-1.059,3.75,1.944,7.354,5.611,7.363C48.287,45.309,43.137,42.045,41.192,42.846z"/>
+<g>
+<g>
+<linearGradient id="XMLID_22_" gradientUnits="userSpaceOnUse" x1="21.4502" y1="42.9629" x2="12.1075" y2="35.028">
+<stop offset="0" style="stop-color:#8CC2EA"/>
+<stop offset="0.5" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#0046B7"/>
+</linearGradient>
+<path fill="url(#XMLID_22_)" d="M15.471,29.481c-4.608,6.27,0.854,14.462,6.697,14.675         C12.783,52.047,2.544,32.381,15.471,29.481z"/>
+<g>
+<g>
+<polygon fill="#3366CC" points="19.102,21.999 24.867,19.653 25.103,22.504 19.143,25.366 "/>
+</g>
+<g>
+<polygon fill="#0046B7" points="13.457,49.441 19.223,45.961 17.746,48.633 12.005,52.188 "/>
+</g>
+<g>
+<polygon fill="#8CC2EA" points="2.503,33.112 8.456,29.973 11.512,30.413 5.575,33.547 "/>
+</g>
+<g>
+<polygon fill="#0046B7" points="19.291,50.463 25.026,46.988 24.994,50.184 19.289,53.738 "/>
+</g>
+<g>
+<polygon fill="#3366CC" points="5.422,25.889 11.394,22.778 13.972,24.836 7.991,27.817 "/>
+</g>
+<g>
+<polygon fill="#0046B7" points="24.675,48.018 30.412,44.629 31.933,47.691 26.229,51.148 "/>
+</g>
+<g>
+<polygon fill="#3366CC" points="11.468,21.629 16.75,19.37 18.981,22.235 13.085,24.854 "/>
+</g>
+<g>
+<polygon fill="#0046B7" points="27.909,43 33.679,39.752 35.926,42.461 30.716,45.078 "/>
+</g>
+<g>
+<polygon fill="#0046B7" points="28.3,36.549 34.126,33.999 36.799,34.659 31.604,36.963 "/>
+</g>
+<g>
+<polygon fill="#3366CC" points="26.362,26.461 32.06,24.038 30.631,26.323 24.727,29.25 "/>
+</g>
+<linearGradient id="XMLID_23_" gradientUnits="userSpaceOnUse" x1="13.3999" y1="22.6548" x2="20.1869" y2="53.7725">
+<stop offset="0" style="stop-color:#CFECFF"/>
+<stop offset="0.5" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#0046B7"/>
+</linearGradient>
+<path fill="url(#XMLID_23_)" d="M9.347,22.612c0,0,1.672-0.855,2.117-0.99l5.263-2.252c0,0-1.032,0.314-1.135,0.365          L9.347,22.612z"/>
+<linearGradient id="XMLID_24_" gradientUnits="userSpaceOnUse" x1="19.7827" y1="21.2617" x2="26.5667" y2="52.3659">
+<stop offset="0" style="stop-color:#CFECFF"/>
+<stop offset="0.5" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#0046B7"/>
+</linearGradient>
+<path fill="url(#XMLID_24_)" d="M14.342,21.202c0.813,0.016,3.73,0.355,4.744,0.793l5.771-2.355          c-1.953-0.646-5.16-0.486-5.272-0.482L14.342,21.202z"/>
+<linearGradient id="XMLID_25_" gradientUnits="userSpaceOnUse" x1="26.2988" y1="19.8418" x2="33.0828" y2="50.9459">
+<stop offset="0" style="stop-color:#CFECFF"/>
+<stop offset="0.5" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#0046B7"/>
+</linearGradient>
+<path fill="url(#XMLID_25_)" d="M22.2,23.292c0.871,0.467,3.412,2.221,4.16,3.168l5.699-2.445          c-0.958-1.047-3.285-2.66-4.11-3.102L22.2,23.292z"/>
+<linearGradient id="XMLID_26_" gradientUnits="userSpaceOnUse" x1="29.9644" y1="19.04" x2="36.748" y2="50.1424">
+<stop offset="0" style="stop-color:#CFECFF"/>
+<stop offset="0.5" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#0046B7"/>
+</linearGradient>
+<path fill="url(#XMLID_26_)" d="M31.603,36.952c0.171,0.867,0.268,3.355-0.061,5.097l5.235-2.55          c0.266-1.43,0.235-4.336,0.023-4.836L31.603,36.952z"/>
+<linearGradient id="XMLID_27_" gradientUnits="userSpaceOnUse" x1="26.4639" y1="19.8076" x2="33.2463" y2="50.9043">
+<stop offset="0" style="stop-color:#CFECFF"/>
+<stop offset="0.5" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#0046B7"/>
+</linearGradient>
+<path fill="url(#XMLID_27_)" d="M30.72,45.086c-0.313,0.9-1.374,2.934-2.39,3.982l5.18-2.727          c1.028-1.041,2.197-3.131,2.41-3.883L30.72,45.086z"/>
+<path fill="#3366CC" d="M24.687,47.996c0.179-0.143,0.769-0.709,0.909-0.932l0.313,0.217L24.687,47.996z"/>
+<linearGradient id="XMLID_28_" gradientUnits="userSpaceOnUse" x1="22.6011" y1="20.6411" x2="29.3852" y2="51.7457">
+<stop offset="0" style="stop-color:#CFECFF"/>
+<stop offset="0.5" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#0046B7"/>
+</linearGradient>
+<path fill="url(#XMLID_28_)" d="M26.231,51.139c0,0-0.157,0.15-0.334,0.27l5.57-3.387c0.129-0.07,0.442-0.354,0.442-0.354          L26.231,51.139z"/>
+<path fill="#8CC2EA" d="M13.085,24.846c0.237-0.055,0.953-0.211,1.298-0.223l-0.004-0.412L13.085,24.846z"/>
+<path fill="#8CC2EA" d="M19.152,25.368c0.152,0.047,1.291,0.563,1.467,0.676l1.114-1.938L19.152,25.368z"/>
+<path fill="#8CC2EA" d="M24.753,29.26c0.11,0.125,0.845,1.049,0.919,1.174l5.814-2.805          c-0.175-0.242-0.757-1.215-0.857-1.303L24.753,29.26z"/>
+<path fill="#3366CC" d="M27.985,35.147c0,0,0.304,1.254,0.328,1.396l5.813-2.541c0,0-0.216-1.637-0.296-1.813L27.985,35.147          z"/>
+<path fill="#3366CC" d="M27.905,42.967c0.087-0.174,0.35-1.277,0.35-1.277l1.632,0.174          C29.887,41.863,28.243,42.826,27.905,42.967z"/>
+<polyline fill="#0046B7" points="28.495,29.086 31.532,27.645 33.882,26.864 "/>
+<linearGradient id="XMLID_29_" gradientUnits="userSpaceOnUse" x1="29.7622" y1="19.0801" x2="36.5482" y2="50.1934">
+<stop offset="0" style="stop-color:#CFECFF"/>
+<stop offset="0.5" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#0046B7"/>
+</linearGradient>
+<path fill="url(#XMLID_29_)" d="M28.49,29.09c1.045,1.488,2.108,3.572,2.37,4.623l5.044-2.314          c-0.272-1.143-1.55-4.025-2.059-4.568L28.49,29.09z"/>
+<path fill="#5AA7E0" d="M31.608,36.954c0.309,1.441,0.117,4.517-0.066,5.117l-3.276-0.381          c-0.024,0.074-0.278,1.104-0.356,1.301l2.809,2.074c-0.322,1.168-1.617,3.254-2.414,4.043          c-0.032-0.021-2.617-1.951-2.71-2.012c-0.207,0.289-0.892,0.922-0.901,0.932l1.535,3.139          c-1.022,0.877-3.169,1.9-3.993,2.086l-1.503-3.068c-0.446,0.172-1.008,0.258-1.431,0.297l-0.018,3.277          c-0.78,0.109-3.433-0.041-4.517-0.453l-0.046-3.297c-0.634-0.17-1.241-0.541-1.254-0.551l-1.462,2.719          c-0.678-0.273-3.33-2.129-3.963-2.967l1.434-2.74c-0.313-0.275-0.931-0.969-1.082-1.275l-2.448,1.381          c-0.765-0.869-2.038-3.506-2.376-4.75l2.493-1.395c-0.003-0.012-0.339-1.232-0.345-1.593l-3.044-0.404          c-0.15-1.307-0.295-4.48-0.167-5.33l3.068,0.434c-0.006-0.234,0.254-1.477,0.258-1.49l-2.624-2.143          c0.085-0.551,1.521-3.416,2.215-4.023l2.571,1.926c0.047-0.15,1.05-1,1.061-1.01l-1.581-3.033          c0.839-0.588,2.77-1.705,3.995-2.141l1.642,3.23c0.01-0.004,1.014-0.229,1.279-0.227l-0.046-3.418          c1.352,0.021,3.834,0.432,4.757,0.783l0.043,3.375c0.154,0.043,1.378,0.611,1.492,0.68l1.573-2.758          c1.527,0.807,3.866,2.77,4.154,3.166l-1.638,2.787c0.015,0.01,0.886,1.107,0.939,1.197c0.095-0.037,2.797-1.334,2.829-1.352          c0.915,1.117,2.126,3.598,2.396,4.676l-2.879,1.391c-0.032-0.016,0.28,1.307,0.29,1.387L31.608,36.954z M13.932,29.946          c-3.701,1.252-5.327,5.865-3.657,10.25c1.653,4.348,5.925,6.713,9.572,5.34c3.653-1.352,5.345-5.83,3.749-10.054          C21.984,31.217,17.647,28.717,13.932,29.946z"/>
+</g>
+</g>
+<g>
+<g>
+<polygon fill="#B3DDFF" points="34.309,37.551 37.167,35.889 39.883,37.438 37.237,39.28 "/>
+</g>
+<linearGradient id="XMLID_30_" gradientUnits="userSpaceOnUse" x1="-18.3643" y1="7.9131" x2="-15.4213" y2="20.2764" gradientTransform="matrix(0.9579 -0.021 0.0844 1.0421 59.8455 29.9322)">
+<stop offset="0" style="stop-color:#CFECFF"/>
+<stop offset="0.5" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#0046B7"/>
+</linearGradient>
+<path fill="url(#XMLID_30_)" d="M34.852,41.604c2.607-3.328,6.686-6.048,11.485-4.958c5.147,1.195,9.795,8.484,6.57,14.363         l-2.651,1.908c1.397-3.463,0.122-10.088-3.636-12.807C42.818,37.422,39.177,38.641,34.852,41.604z"/>
+<g>
+<polygon fill="#B3DDFF" points="31.105,45.348 33.695,43.67 36.605,43.109 33.984,44.879 "/>
+</g>
+<g>
+<polygon fill="#0046B7" points="45.375,56.379 47.91,54.57 47.461,58.158 45.045,59.994 "/>
+</g>
+<g>
+<polygon fill="#0046B7" points="50.362,52.814 52.917,50.994 54.538,53.705 52.315,55.83 "/>
+</g>
+<g>
+<polygon fill="#8CC2EA" points="42.54,34.959 45.361,33.459 46.337,36.645 43.784,38.395 "/>
+</g>
+<g>
+<polygon fill="#8CC2EA" points="50.994,45.848 53.597,44.029 56.542,44.996 54.156,46.76 "/>
+</g>
+<g>
+<polygon fill="#3366CC" points="51.054,39.797 53.693,38.258 52.255,40.961 49.632,42.771 "/>
+</g>
+<path fill="#CFECFF" d="M40.217,34.938l2.621-1.402c0.745-0.172,1.807-0.299,2.523-0.076l-2.752,1.504         C42.243,34.745,40.537,34.827,40.217,34.938z"/>
+<path fill="#8CC2EA" d="M49.258,37.967c0,0,1.617,1.211,1.776,1.886l2.635-1.554c-0.346-0.668-1.312-1.379-1.94-1.67         L49.258,37.967z"/>
+<path fill="#0046B7" d="M54.102,46.703c0.374,0.703,0.351,2.145,0.262,2.506l2.251-1.762c0.292-0.93,0.026-2.17-0.093-2.461         L54.102,46.703z"/>
+<path fill="#0046B7" d="M52.273,55.818c-0.127,0.578-1.38,1.635-1.38,1.635l2.804-2.432c0.475-0.637,0.795-1.266,0.795-1.266         L52.273,55.818z"/>
+<linearGradient id="XMLID_31_" gradientUnits="userSpaceOnUse" x1="5.6567" y1="20.9814" x2="-5.7297" y2="15.1257" gradientTransform="matrix(0.9579 -0.021 0.1219 1.0413 43.3901 30.4688)">
+<stop offset="0" style="stop-color:#B3DDFF"/>
+<stop offset="0.5" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#0046B7"/>
+</linearGradient>
+<path fill="url(#XMLID_31_)" d="M40.907,41.674c-2.814,4.582,2.372,10.201,6.258,9.137c-2.434,3.6-6.63,2.342-8.979-1.455         C35.801,45.586,38.562,41.941,40.907,41.674z"/>
+<g>
+<linearGradient id="XMLID_32_" gradientUnits="userSpaceOnUse" x1="-25.29" y1="-1.6792" x2="-11.6269" y2="18.3253" gradientTransform="matrix(0.9579 -0.021 0.0844 1.0421 59.8455 29.9322)">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<path fill="url(#XMLID_32_)" d="M39.897,38.536l0.315-3.607c0.805-0.227,1.513-0.234,2.396,0.035l1.241,3.666L39.897,38.536          z"/>
+<linearGradient id="XMLID_33_" gradientUnits="userSpaceOnUse" x1="-30.8252" y1="2.3096" x2="-17.7029" y2="21.5222" gradientTransform="matrix(0.9579 -0.021 0.0844 1.0421 59.8455 29.9322)">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<path fill="url(#XMLID_33_)" d="M34.87,42.264l-1.905-3.306c0.425-0.502,0.646-0.91,1.34-1.402l3.143,1.865L34.87,42.264z"/>
+<linearGradient id="XMLID_34_" gradientUnits="userSpaceOnUse" x1="-36.2163" y1="5.5503" x2="-22.5509" y2="25.5581" gradientTransform="matrix(0.9579 -0.021 0.0844 1.0421 59.8455 29.9322)">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<path fill="url(#XMLID_34_)" d="M34.766,48.877l-3.501-0.896c-0.348-0.859-0.275-1.754-0.159-2.615l3.106-0.59          L34.766,48.877z"/>
+<linearGradient id="XMLID_35_" gradientUnits="userSpaceOnUse" x1="-37.5059" y1="6.4204" x2="-23.8442" y2="26.4227" gradientTransform="matrix(0.9579 -0.021 0.0844 1.0421 59.8455 29.9322)">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<path fill="url(#XMLID_35_)" d="M39.084,54.615l-2.615,1.861c-0.774-0.471-1.337-0.998-1.856-1.816l1.39-3.076          L39.084,54.615z"/>
+<linearGradient id="XMLID_36_" gradientUnits="userSpaceOnUse" x1="-34.0625" y1="4.127" x2="-20.4202" y2="24.1009" gradientTransform="matrix(0.9579 -0.021 0.0844 1.0421 59.8455 29.9322)">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<path fill="url(#XMLID_36_)" d="M45.405,56.154l-0.37,3.826c-0.761,0.199-1.429,0.184-2.35-0.377l-1.165-3.9L45.405,56.154z          "/>
+<linearGradient id="XMLID_37_" gradientUnits="userSpaceOnUse" x1="-28.4316" y1="0.6548" x2="-14.8857" y2="20.4876" gradientTransform="matrix(0.9579 -0.021 0.0844 1.0421 59.8455 29.9322)">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<path fill="url(#XMLID_37_)" d="M50.177,52.492l2.15,3.254c-0.327,0.771-0.742,1.293-1.434,1.707l-3.116-2.131          L50.177,52.492z"/>
+<linearGradient id="XMLID_38_" gradientUnits="userSpaceOnUse" x1="-23.1587" y1="-3.1597" x2="-9.4853" y2="16.8598" gradientTransform="matrix(0.9579 -0.021 0.0844 1.0421 59.8455 29.9322)">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<path fill="url(#XMLID_38_)" d="M50.67,45.732l3.473,0.92c0.299,0.887,0.386,1.643,0.227,2.535L51.07,49.93L50.67,45.732z"/>
+<linearGradient id="XMLID_39_" gradientUnits="userSpaceOnUse" x1="-21.5923" y1="-4.187" x2="-7.9308" y2="15.8149" gradientTransform="matrix(0.9579 -0.021 0.0844 1.0421 59.8455 29.9322)">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<path fill="url(#XMLID_39_)" d="M46.438,39.934l2.766-1.957c0.789,0.465,1.348,0.992,1.851,1.82l-1.538,3.174L46.438,39.934          z"/>
+<linearGradient id="XMLID_40_" gradientUnits="userSpaceOnUse" x1="-29.5835" y1="1.1753" x2="-15.9459" y2="21.1423" gradientTransform="matrix(0.9579 -0.021 0.0844 1.0421 59.8455 29.9322)">
+<stop offset="0" style="stop-color:#5AA7E0"/>
+<stop offset="1" style="stop-color:#3366CC"/>
+</linearGradient>
+<path fill="url(#XMLID_40_)" d="M41.672,38.084c-4.875-0.137-8.289,3.841-7.627,8.878c0.656,5.039,4.981,9.336,9.656,9.596          c4.669,0.271,8.075-3.699,7.614-8.867C50.851,42.527,46.536,38.223,41.672,38.084z M47.815,47.537          c0.298,3.053-1.729,5.408-4.522,5.268c-2.796-0.141-5.363-2.691-5.729-5.699c-0.368-3.006,1.66-5.363,4.522-5.27          C44.95,41.936,47.514,44.488,47.815,47.537z"/>
+</g>
+</g>
+</g>
+</g>
+</g>
+</g>
+</svg>
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfperfapp_imagetest_NVGCS.mif has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfperfapp_test1.mbm has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos1.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos2.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos3.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos4.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos5.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos6.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos7.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos8.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos9.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_2mpx.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_5mpx.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small1.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small2.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small3.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small4.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small5.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small6.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small7.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small8.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_small9.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/alfphotos_vga.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/icons_mif_new2.mif has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/jim.PNG has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/jpg_sun.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/jpg_sun_small.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/mtv3.png has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/mtv3_scifi.png has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/nationalgeographic.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/nelonen.PNG has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/people.jpg has changed
Binary file uiacceltk/hitchcock/tsrc/alfperfapp/gfx/people.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/group/alfperfapp.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project definition file for alfperfapp.
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET                  alfperfapp.exe
+TARGETTYPE              exe
+UID                     0x100039CE 0x20016B8D
+
+EPOCSTACKSIZE           0xA000 //0x5000
+EPOCHEAPSIZE            0x7FFF 0x1A00000 //0xF4FFFF
+
+CAPABILITY              CAP_APPLICATION
+VENDORID                VID_DEFAULT
+
+SOURCEPATH              ../src
+
+// Enables test cases that require InActive flag (marked with EAlfPerfAppTestCaseFlagRequiresInActiveFlag)
+// You need to clean your build to make the change effective.
+//MACRO ALFPERFAPP_ENABLE_INACTIVE_FLAG_CASES
+
+// framework:
+SOURCE                  alfperfappapplication.cpp
+SOURCE                  alfperfappdocument.cpp
+SOURCE                  alfperfappappui.cpp
+SOURCE                  alfperfapptestcaseexecutionview.cpp
+SOURCE					alfperfapptestcaseselectionview.cpp
+SOURCE                  alfperfapptestcasefactory.cpp
+SOURCE                  alfperfappmodel.cpp
+SOURCE                  alfperfappbasetestcasecontrol.cpp
+
+// test cases:
+SOURCE                  alfperfappframeworktestcase.cpp
+SOURCE                  alfperfappimagetestcase.cpp
+SOURCE                  alfperfapplayouttestcase.cpp
+SOURCE                  alfperfapptexttestcase.cpp
+SOURCE                  alfperfappcovertestcase.cpp
+SOURCE                  alfperfappsuitetestcase.cpp
+SOURCE                  alfperfappsuitetestcasecontrol.cpp
+SOURCE                  alfperfappsuitetestcasescroll.cpp
+SOURCE                  alfperfappsuiteepgcontrol.cpp
+SOURCE                  alfperfappsuitepeoplecontrol.cpp
+SOURCE                  alfperfappsuitehelper.cpp
+SOURCE                  alfperfappgallerytestcase.cpp
+SOURCE                  alfperfappavkontestcase.cpp
+SOURCE                  alfperftestcase.cpp
+
+SOURCEPATH              ../data
+
+START RESOURCE          alfperfapp.rss
+HEADER
+TARGETPATH              APP_RESOURCE_DIR
+LANGUAGE_IDS
+END // RESOURCE
+
+START RESOURCE          alfperfapp_reg.rss
+DEPENDS alfperfapp.rsg
+TARGETPATH              /private/10003a3f/apps
+END
+
+USERINCLUDE             ../group  
+USERINCLUDE             ../inc
+
+// This is a SYSTEMINCLUDE macro containing the application
+// layer specific include directories
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE           ../../../../../inc
+
+LIBRARY                 apparc.lib
+LIBRARY                 avkon.lib
+LIBRARY                 bafl.lib 
+LIBRARY                 cone.lib
+LIBRARY                 eikcoctl.lib 
+LIBRARY                 eikcore.lib 
+LIBRARY                 eikctl.lib 
+LIBRARY                 euser.lib
+LIBRARY                 efsrv.lib 
+LIBRARY                 fbscli.lib 
+LIBRARY                 aknskins.lib
+LIBRARY                 commonengine.lib
+LIBRARY                 ws32.lib
+LIBRARY                 apgrfx.lib
+LIBRARY                 gdi.lib
+LIBRARY                 hal.lib
+LIBRARY                 bitgdi.lib 
+LIBRARY                 alfclient.lib
+
+LIBRARY           		aknicon.lib
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/group/alfperfapp_icons_dc.mk	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,57 @@
+#
+# Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:  alfperfapp application icons makefile
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\alfperfapp_imagetest.mif
+
+HEADERDIR=\epoc32\include
+HEADERFILENAME=$(HEADERDIR)\alfperfapp_imagetest.mbg
+
+do_nothing :
+	@rem do_nothing
+
+MAKMAKE : do_nothing
+
+BLD : do_nothing
+
+CLEAN : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+RESOURCE :
+	mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \
+	    /c8,8 qgn_menu_radio.svg \
+	    /c8,8 qgn_menu_voirec.svg \
+	    /c8,8 qgn_menu_log.svg \
+	    /c8,8 qgn_menu_cams.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(HEADERFILENAME)&& \
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/group/alfperfappdaemon.mmp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Project definition file for alfperfappdaemon.
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+TARGET                  alfperfappdaemon.exe
+TARGETTYPE              exe
+UID                     0x100039CE 0x20016BB7
+
+EPOCSTACKSIZE           0x5000
+
+CAPABILITY              CAP_APPLICATION
+VENDORID                VID_DEFAULT
+
+SOURCEPATH              ../src
+
+// framework:
+SOURCE                  alfperfappdaemon.cpp
+
+SOURCEPATH              ../data
+
+START RESOURCE          alfperfappdaemon.rss
+HEADER
+TARGETPATH              APP_RESOURCE_DIR
+LANGUAGE_IDS
+END // RESOURCE
+
+START RESOURCE          alfperfappdaemon_reg.rss
+DEPENDS alfperfapp.rsg
+TARGETPATH              /private/10003a3f/apps
+END
+
+USERINCLUDE             ../group  
+USERINCLUDE             ../inc
+
+// This is a SYSTEMINCLUDE macro containing the application
+// layer specific include directories
+APP_LAYER_SYSTEMINCLUDE
+SYSTEMINCLUDE           ../../../../../inc
+
+LIBRARY                 euser.lib
+LIBRARY                 apparc.lib
+LIBRARY                 avkon.lib
+LIBRARY                 eikcore.lib 
+LIBRARY                 apgrfx.lib
+LIBRARY                 cone.lib
+LIBRARY                 ws32.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/group/bld.inf	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,132 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Build information file for alfperfapp.
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_EXPORTS
+
+// put them in apps private folder
+../gfx/alfperfapp_imagetest.gif /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfperfapp_imagetest.gif
+../gfx/alfperfapp_imagetest.png /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfperfapp_imagetest.png
+../gfx/alfperfapp_imagetest.svg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfperfapp_imagetest.svg
+// Mif files need to go in apps resource dir, since they have to be loaded by AknIconSrv
+../gfx/alfperfapp_imagetest_NVGCS.mif /epoc32/RELEASE/winscw/urel/Z/resource/apps/alfperfapp_imagetest_NVGCS.mif
+../gfx/icons_mif_new2.mif       /epoc32/RELEASE/winscw/urel/Z/resource/apps/icons_mif_new2.mif
+../gfx/3musk.mif                /epoc32/RELEASE/winscw/urel/Z/data/nvg_mif/3musk.mif
+../gfx/alfperfapp_test1.mbm /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfperfapp_test1.mbm
+../gfx/alfperfapp_imagetest.gif /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfperfapp_imagetest.gif
+../gfx/alfperfapp_imagetest.png /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfperfapp_imagetest.png
+../gfx/alfperfapp_imagetest.svg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfperfapp_imagetest.svg
+../gfx/alfperfapp_imagetest_NVGCS.mif /epoc32/RELEASE/winscw/udeb/Z/resource/apps/alfperfapp_imagetest_NVGCS.mif
+../gfx/icons_mif_new2.mif       /epoc32/RELEASE/winscw/udeb/Z/resource/apps/icons_mif_new2.mif
+../gfx/3musk.mif                /epoc32/RELEASE/winscw/udeb/Z/data/nvg_mif/3musk.mif
+../gfx/alfperfapp_test1.mbm /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfperfapp_test1.mbm
+../gfx/alfphotos1.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos1.jpg
+../gfx/alfphotos2.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos2.jpg
+../gfx/alfphotos3.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos3.jpg
+../gfx/alfphotos4.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos4.jpg
+../gfx/alfphotos5.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos5.jpg
+../gfx/alfphotos6.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos6.jpg
+../gfx/alfphotos7.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos7.jpg
+../gfx/alfphotos8.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos8.jpg
+../gfx/alfphotos9.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos9.jpg
+../gfx/jpg_sun.jpg    /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/jpg_sun.jpg
+../gfx/alfphotos_5mpx.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos_5mpx.jpg
+../gfx/alfphotos_2mpx.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos_2mpx.jpg
+../gfx/alfphotos_vga.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos_vga.jpg
+
+../gfx/alfphotos_small1.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos_small1.jpg
+../gfx/alfphotos_small2.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos_small2.jpg
+../gfx/alfphotos_small3.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos_small3.jpg
+../gfx/alfphotos_small4.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos_small4.jpg
+../gfx/alfphotos_small5.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos_small5.jpg
+../gfx/alfphotos_small6.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos_small6.jpg
+../gfx/alfphotos_small7.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos_small7.jpg
+../gfx/alfphotos_small8.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos_small8.jpg
+../gfx/alfphotos_small9.jpg /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/alfphotos_small9.jpg
+../gfx/jpg_sun_small.jpg    /epoc32/RELEASE/winscw/urel/Z/private/20016B8D/jpg_sun_small.jpg
+
+
+../gfx/alfphotos1.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos1.jpg
+../gfx/alfphotos2.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos2.jpg
+../gfx/alfphotos3.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos3.jpg
+../gfx/alfphotos4.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos4.jpg
+../gfx/alfphotos5.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos5.jpg
+../gfx/alfphotos6.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos6.jpg
+../gfx/alfphotos7.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos7.jpg
+../gfx/alfphotos8.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos8.jpg
+../gfx/alfphotos9.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos9.jpg
+../gfx/jpg_sun.jpg    /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/jpg_sun.jpg
+../gfx/alfphotos_5mpx.jpg  /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos_5mpx.jpg
+../gfx/alfphotos_2mpx.jpg  /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos_2mpx.jpg
+../gfx/alfphotos_vga.jpg  /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos_vga.jpg
+
+../gfx/alfphotos_small1.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos_small1.jpg
+../gfx/alfphotos_small2.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos_small2.jpg
+../gfx/alfphotos_small3.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos_small3.jpg
+../gfx/alfphotos_small4.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos_small4.jpg
+../gfx/alfphotos_small5.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos_small5.jpg
+../gfx/alfphotos_small6.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos_small6.jpg
+../gfx/alfphotos_small7.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos_small7.jpg
+../gfx/alfphotos_small8.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos_small8.jpg
+../gfx/alfphotos_small9.jpg /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/alfphotos_small9.jpg
+../gfx/jpg_sun_small.jpg    /epoc32/RELEASE/winscw/udeb/Z/private/20016B8D/jpg_sun_small.jpg
+
+
+// Images for app suite test
+// winscw udeb
+../gfx/people.png                       /epoc32/release/winscw/udeb/Z/private/20016B8D/people.png
+../gfx/jim.png                          /epoc32/release/winscw/udeb/Z/private/20016B8D/jim.png
+../gfx/mtv3.png                         /epoc32/release/winscw/udeb/Z/private/20016B8D/mtv3.png
+../gfx/mtv3_scifi.png                   /epoc32/release/winscw/udeb/Z/private/20016B8D/mtv3_scifi.png
+../gfx/nelonen.png                      /epoc32/release/winscw/udeb/Z/private/20016B8D/nelonen.png
+../gfx/discoveryhd.png                  /epoc32/release/winscw/udeb/Z/private/20016B8D/discoveryhd.png
+../gfx/nationalgeographic.jpg           /epoc32/release/winscw/udeb/Z/private/20016B8D/nationalgeographic.jpg
+
+// winscw urel
+../gfx/people.png                       /epoc32/release/winscw/urel/Z/private/20016B8D/people.png
+../gfx/jim.png                          /epoc32/release/winscw/urel/Z/private/20016B8D/jim.png
+../gfx/mtv3.png                         /epoc32/release/winscw/urel/Z/private/20016B8D/mtv3.png
+../gfx/mtv3_scifi.png                   /epoc32/release/winscw/urel/Z/private/20016B8D/mtv3_scifi.png
+../gfx/nelonen.png                      /epoc32/release/winscw/urel/Z/private/20016B8D/nelonen.png
+../gfx/discoveryhd.png                  /epoc32/release/winscw/urel/Z/private/20016B8D/discoveryhd.png
+../gfx/nationalgeographic.jpg           /epoc32/release/winscw/urel/Z/private/20016B8D/nationalgeographic.jpg
+
+PRJ_MMPFILES
+// make sure the dependencies are compiled as well
+../../alfdebugextension/group/alfdebug.mmp
+../../alfdebugextension/group/alfdebugserver.mmp
+
+alfperfappdaemon.mmp
+alfperfapp.mmp
+
+PRJ_EXTENSIONS
+
+START EXTENSION s60/mifconv
+OPTION TARGETFILE alfperfapp_imagetest.mif
+OPTION HEADERFILE alfperfapp_imagetest.mbg
+OPTION SOURCES -c8,8 qgn_menu_radio \
+	    -c8,8 qgn_menu_voirec \
+	    -c8,8 qgn_menu_log \
+	    -c8,8 qgn_menu_cams
+
+END
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfapp.hrh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,169 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Command definitions for alfperfapp application.
+*
+*/
+
+
+#ifndef ALFPERFAPP_HRH
+#define ALFPERFAPP_HRH
+
+// UID of alfperfapp. This must be in synch with MMP file UID.
+#define KAlfPerfAppUidValue 0x20016B8D
+#define KAlfPerfAppDaemonUidValue 0x20016BB7
+
+enum TAlfPerfAppMenuCommands
+    {
+    EAlfPerfAppCmdRunAll = 0x5000,
+    EAlfPerfAppCmdRunAllContinuously = 0x5001,
+    EAlfPerfAppCmdClearFiles = 0x5002,
+        
+    // This starts range of command ids reserved for
+    // test cases. Range ends to 0xABAFFFF.
+    EAlfPerfAppCmdTestCase = 0xABA0000
+    };
+
+enum TAlfPerfAppTestCases
+    {
+    //
+    // Framework testing related commands
+    //
+    ElfPerfAppNoCase = 0x5000,
+    EAlfPerfAppFrameworkMin = 0x5100,
+    EAlfPerfAppFrameworkEmpty,
+    EAlfPerfAppFrameworkCreateFail,
+    EAlfPerfAppFrameworkSetupFailSynch,
+    EAlfPerfAppFrameworkExecuteFailSynch,
+    EAlfPerfAppFrameworkSetupFailAsynch,
+    EAlfPerfAppFrameworkExecuteFailAsynch,
+    EAlfPerfAppFrameworkMax,
+    
+    //
+    // Image related commands
+    //
+    EAlfPerfAppImageMin = 0x5200,
+    EAlfPerfAppImageBasicMoveScale,
+    EAlfPerfAppImageBasicMoveScaleNvgCS,
+    EAlfPerfAppImageBasicMoveScaleNvgTLV,
+    EAlfPerfAppImageManyImages,
+    EAlfPerfAppImageManyGifImages,
+    EAlfPerfAppImageManyPngImages,
+    EAlfPerfAppImageManySvgImages,
+    EAlfPerfAppImageManyNvgCSImages,
+    EAlfPerfAppImageManyNvgTLVImages,
+    EAlfPerfAppImageManyImagesWithPointerEvent,
+    EAlfPerfAppImageManyImagesWithAutoSize,
+    EAlfPerfAppImageAnimateFull,
+    EAlfPerfAppImageAnimate1of2,
+    EAlfPerfAppImageAnimate1of4,
+    EAlfPerfAppImageAnimate1of8,
+    EAlfPerfAppImageMax,
+    
+    //
+    // Layout related commands
+    //
+    EAlfPerfAppLayoutMin = 0x5300,
+    EAlfPerfAppLayoutGrid,
+    EAlfPerfAppLayoutDeck,
+    EAlfPerfAppLayoutAnchor,
+    EAlfPerfAppLayoutCurvePath,
+    EAlfPerfAppLayoutFlow, 
+    EAlfPerfAppLayoutViewport,
+    EAlfPerfAppLayoutMax,
+
+    //
+    // Text related commands
+    //
+    EAlfPerfAppTextMin = 0x5400,
+    EAlfPerfAppTextBasicMoveScale,
+    EAlfPerfAppTextManyTexts,
+    EAlfPerfAppTextManyTextsWithPointerEvent,
+    EAlfPerfAppTextManyTextsWithAutoSize,
+    EAlfPerfAppTextInactiveVisuals,
+    EAlfPerfAppTextMax,
+
+    //
+    // Cover test related commands
+    //
+    EAlfPerfAppCoverMin = 0x5500,
+    EAlfPerfAppCover,
+    EAlfPerfAppCoverLandscape,
+    EAlfPerfAppCoverRotate,
+    EAlfPerfAppCoverClipZoomLargeImage,
+    EAlfPerfAppCoverClipZoomBigImage,
+    EAlfPerfAppCoverClipZoomVga,
+    EAlfPerfAppCoverClipZoomAutoSize,
+    EAlfPerfAppCoverMax,
+
+    //
+    // App Suite test related commands
+    //
+    EAlfPerfAppSuiteMin = 0x5600,
+    EAlfPerfAppSuiteCaseScrollContinuousPortrait,
+    EAlfPerfAppSuiteCaseScrollIncrementalPortrait,
+    EAlfPerfAppSuiteCaseScrollContinuousLandscape,
+    EAlfPerfAppSuiteCaseScrollIncrementalLandscape,
+    EAlfPerfAppSuiteMax,
+    
+    //
+    // Gallery related commands
+    //
+    EAlfPerfAppGalleryMin = 0x5700,
+    EAlfPerfAppGallery,
+    EAlfPerfAppGalleryLandscape,
+    EAlfPerfAppGalleryMax,
+    
+    //
+    // Avkon related commands
+    //
+    EAlfPerfAppAvkonMin = 0x5800,
+    EAlfPerfAppAvkonBasicWinGc,
+    EAlfPerfAppAvkonMax
+   };
+
+#define KAlfPerfAppMenuPaneResourceId 0xBAB0000
+
+/**
+ * This defines flags that can be used in ALFPERFAPP_TESTSUITE's flags field.
+ */
+enum TAlfPerfAppTestSuiteFlags
+    {
+    /**
+     * Excludes this suite from being executed when top level run all option 
+     * is selected.
+     */
+    EAlfPerfAppTestSuiteFlagExcludeFromRunAll = 0x1
+    };
+
+enum TAlfPerfAppTestCaseFlags
+    {
+    /*
+     * Marks that this case requires InActive-flag from uiaccelerator.
+     * These cases will be omitted if ALFPERFAPP_ENABLE_INACTIVE_FLAG_CASES is not defined.
+     */ 
+    EAlfPerfAppTestCaseFlagRequiresInActiveFlag = 0x1
+    };
+
+/**
+ * Ipc commands for daemon.
+ */
+enum TAlfPerfAppDaemonIpc
+    {
+    EAlfPerfAppIpcGetMeasurements = 0xA0000,
+    EAlfPerfAppIpcEnableActivityPoll
+    };
+
+
+
+#endif // ALFPERFAPP_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfapp.rh	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Resource structure definitions for alfperfapp application.
+*
+*/
+
+
+#ifndef ALFPERFAPP_RH
+#define ALFPERFAPP_RH
+
+/**
+ * Defines test set.
+ */
+STRUCT ALFPERFAPP_TESTSET
+    {
+    STRUCT folders[]; // ALFPERFAPP_TESTSUITE
+    }
+
+/**
+ * Defines test suite - a collection of test cases.
+ */
+STRUCT ALFPERFAPP_TESTSUITE
+    {
+    LTEXT name;
+    WORD flags;
+    STRUCT items[]; // ALFPERFAPP_TESTCASE
+    }
+
+/**
+ * Defines single test case.
+ */
+STRUCT ALFPERFAPP_TESTCASE
+    {
+    WORD id;
+    LTEXT name;
+    WORD flags=0;
+    WORD sequenceLength=0;
+    }
+
+#endif // ALFPERFAPP_RH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappapplication.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp application class definition.
+*
+*/
+
+
+#ifndef C_ALFPERFAPPAPPLICATION_H
+#define C_ALFPERFAPPAPPLICATION_H
+
+#include <aknapp.h>
+#include "alfperfapp.hrh"
+
+/**
+ * UID of this application.
+ */
+const TUid KAlfPerfAppUid = { KAlfPerfAppUidValue };
+
+/**
+ * CAlfPerfAppApplication application class. 
+ */
+class CAlfPerfAppApplication : public CAknApplication 
+    {
+private: // from CApaApplication
+
+    // From base class CAknApplication 
+
+    CApaDocument* CreateDocumentL();
+    TUid AppDllUid() const;
+
+    };
+
+#endif // C_ALFPERFAPPAPPLICATION_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappappui.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp application UI class definition.
+*
+*/
+
+
+#ifndef C_ALFPERFAPPAPPUI_H
+#define C_ALFPERFAPPAPPUI_H
+
+#include <aknviewappui.h>
+
+class CAlfPerfAppModel;
+
+/**
+ *  CAlfPerfAppAppUi appui class.
+ */
+class CAlfPerfAppAppUi : public CAknViewAppUi
+    {
+public:
+
+    CAlfPerfAppAppUi( CAlfPerfAppModel& aModel );
+    ~CAlfPerfAppAppUi();
+
+    // From base class CAknViewAppUi
+
+    virtual void ConstructL();
+
+private:
+
+    // From base class CAknViewAppUi
+
+    virtual void HandleCommandL( TInt aCommand );
+    virtual void HandleResourceChangeL( TInt aType );
+
+private:
+
+    /**
+     * Model of this application.
+     * Owned.
+     */
+    CAlfPerfAppModel& iModel;
+     
+    };
+
+#endif // C_ALFPERFAPPAPPUI_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappavkontestcase.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp Avkon test case class definition.
+*
+*/
+
+
+#ifndef C_ALFPERFAPPAVKONTESTCASE_H
+#define C_ALFPERFAPPAVKONTESTCASE_H
+
+#include <e32base.h>
+#include "alfperfapptestcase.h"
+
+class CAlfPerfAppBaseTestCaseControl;
+
+/**
+ *  CAlfPerfAppAvkonTestCase class.
+ */
+class CAlfPerfAppAvkonTestCase : public CAlfPerfAppTestCase
+    {
+public:
+    /**
+     * Returns ETrue if test case is supported.
+     * @param aCaseId test case id.
+     * @return ETrue if supported.
+     */
+    static TBool IsSupported( TInt aCaseId );
+
+    static CAlfPerfAppAvkonTestCase* NewL( TInt aCaseId, TInt aSequenceIndex );
+    ~CAlfPerfAppAvkonTestCase();
+
+    // From base class CAlfPerfAppTestCase:
+    virtual void SetupL( 
+        CAlfEnv& aEnv, 
+        const TRect& aVisibleArea, 
+        TRequestStatus& aStatus );
+    virtual void ExecuteL( TRequestStatus& aStatus );
+    virtual void TearDown();   
+    virtual void HandleVisibleAreaChange( const TRect& aRect );
+    virtual TInt CaseID();
+    
+   TTestCaseSpecificResultText getCaseSpecificResultL();
+    
+private:
+    
+    CAlfPerfAppAvkonTestCase( TInt aCaseId, TInt aSequenceIndex);
+    void ConstructL();
+
+private:
+    /**
+     * Test case of which execution this instance was created.
+     */ 
+    TInt iCaseId;
+    
+    /**
+     * Alf environment.
+     * Not owned.
+     */
+    CAlfEnv* iEnv;
+
+    /**
+     * Test case control.
+     * Not owned.
+     */
+    CAlfPerfAppBaseTestCaseControl* iControl;
+    
+    };
+
+#endif // C_ALFPERFAPPAVKONTESTCASE_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappbasetestcasecontrol.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAlfPerfAppBaseTestCaseControl class definition.
+*
+*/
+
+
+#ifndef C_ALFPERFAPPBASETESTCASECONTROL_H
+#define C_ALFPERFAPPBASETESTCASECONTROL_H
+
+#include <e32base.h>
+#include <alf/alfcontrol.h>
+
+/**
+ *  CAlfPerfAppBaseTestCase class.
+ */
+/**
+ * Abstract image test case control.
+ */
+class CAlfPerfAppBaseTestCaseControl : public CAlfControl
+    {
+public:
+        
+    /**
+     * Constructor.
+     */
+    CAlfPerfAppBaseTestCaseControl();
+        
+    /**
+     * Destructor.
+     */
+    ~CAlfPerfAppBaseTestCaseControl();
+        
+    /**
+     * Base class constructor. Derived classes may
+     * override this, but base class needs to be called.
+     */
+    virtual void ConstructL( 
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea );
+        
+    /**
+     * Starts execution of the test case. By default,
+     * request status is stored to local variable.
+     */
+    void StartExecuteL( TRequestStatus& aStatus );    
+    
+    /**
+     * Cancels execution. This control and environment will be
+     * deleted soon after calling this method.
+     */
+    void CancelExecution();
+    
+    /**
+     * Starts execution.
+     * If this method leaves, then request must not be completed.
+     * By default, this method completes immediately.
+     */
+    virtual void DoStartExecuteL();
+    
+    /**
+     * Sets visible area.
+     * @param aVisibleArea visible area.
+     */
+    virtual void SetVisibleArea( const TRect& aVisibleArea );    
+    
+    // From base class CAlfControl:
+    
+    /**
+     * Handles events.
+     * Derived classes should forward to base class.
+     * @param aEvent event to be handled.
+     * @return ETrue if consumed, EFalse otherwise.
+     */
+    virtual TBool OfferEventL( const TAlfEvent& aEvent );
+    
+protected:
+        
+    /**
+     * Completes automatically after specified duration.
+     * @param aDuration duration in ms
+     */
+    void CompleteAfterL( TInt aDuration );
+        
+    /**
+     * Completes current request.
+     */
+    void CompleteNow( TInt aErrorCode );
+
+    /**
+     * Returns test case id.
+     */
+    TInt CaseId() const
+    	{
+    	return iCaseId;
+    	}
+        
+    /**
+     * Returns ETrue if test case execution is still ongoing.
+     */
+    TBool IsExecutionOngoing() const
+    	{
+    	return ( iStatus != NULL );
+    	}
+    
+private:
+    
+    /**
+     * Test case id.
+     */
+    TInt iCaseId;
+    
+    /**
+     * Pointer to request status.
+     * Not owned.
+     */
+    TRequestStatus* iStatus;
+        
+    };
+
+        
+#endif // C_ALFPERFAPPBASETESTCASECONTROL_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappconfigconstants.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp Configurable constants.
+*
+*/
+
+
+#ifndef AlFPERFAPPCONFIGCONSTANTS_H_
+#define AlFPERFAPPCONFIGCONSTANTS_H_
+
+//Image and Text test cases
+//Number of Text and Image Visuals in ManyVisuals Test cases of text and Image Visuals
+const TInt KVisualCout = 500;
+//Portion of screen to be animated in ImageAnimateFull test case.
+// Value 1 - Full area is animated
+// Value 0.5 - Half area is animated
+// Value 0.25 - One fourth area is animated ... so on
+const TReal KRelativeAnimatedArea = 1;
+//Image and text visual test cases position, size and opacity are timed values.
+//That animation speed could be controled with this value.
+const TInt KVisualAnimSpeed = 500;
+
+
+//Scroll Test cases
+//Cycle Length for Incremental scroll test case
+// ( this is basically transition time for setting viewport position )
+const TInt KCycleLenghtIncremental = 400;
+//Cycle Length for ScrollContinuous test case
+// ( this is basically transition time for setting viewport position )
+const TInt KCycleLenghtContinuous = 5000;
+//Number times scrolling cycle is executed
+const TInt KNumberOfRepeats = 5;
+
+
+#endif /* AlFPERFAPPCONFIGCONSTANTS_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappconstants.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp application constants.
+*
+*/
+
+
+#ifndef ALFPERFAPPCOSNTANTS_H
+#define ALFPERFAPPCOSNTANTS_H
+
+#include <e32std.h>
+
+/**
+ * View ID of test case selection view.
+ */
+const TUid KAlfPerfAppTestCaseSelectionViewId = { 0x1 };
+
+/**
+ * View ID of test case execution view.
+ */
+const TUid KAlfPerfAppTestCaseExecutionViewId = { 0x2 };
+
+/**
+ * View ID of test case results view.
+ */
+const TUid KAlfPerfAppTestCaseResultsViewId = { 0x1 };
+
+
+
+
+
+
+// Some constants for handling printing info
+_LIT(KAlfPerfAppFontName,"Courier");
+const TUint KAlfPerfAppLeftMargin = 2;
+const TUint KAlfPerfAppRightMargin = 2;
+const TInt KAlfPerfAppFontSizeInTwips = 125;
+const TInt KAlfPerfAppMaxCharsInLine = 256;
+const TInt KAlfPerfScreenTextBufferSize = 200000;
+const TInt KAlfPerfScreenWrappedArraySize = 500;
+
+
+// Default paths for output file
+_LIT(KAlfPerfAppOutputFilePath1, "c:\\data\\others");
+_LIT(KAlfPerfAppOutputFilePath2, "e:\\others");
+//_LIT(KAlfPerfAppOutputFilePath2, "c:\\data\\others");  // DEBUG
+_LIT( KAlfPerfAppPrintPathSeparator, "\\" );
+_LIT(KAlfPerfAppOutputFileName, "AlfPerfAppResults.csv");
+_LIT(KAlfPerfAppSummaryFileName, "AlfPerfAppSummary.csv");
+
+_LIT8( KAlfPerfAppPrintFormatHeader,
+    "suite/case,caseid,phase,time,app cells,app ram usage,app ram free,server cells,server ram usage,server ram free,system ram usage,system ram free,frames since phase,ms since case,ms since phase,fps,casespecificresult\n");
+_LIT8( KAlfPerfAppPrintFormatData,
+      "%S / %S,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%f,%S\x0D\x0A");
+
+_LIT8( KAlfPerfAppSummaryPrintFormatHeader,
+    "suite/case,caseid,phase,app ram delta,server ram delta,system ram delta,frames since phase,ms since phase,fps,casespecificresult\n");
+_LIT8( KAlfPerfAppSummaryPrintFormatData,
+      "%S / %S,%d,%d,%d,%d,%d,%d,%d,%f,%S\x0D\x0A");
+
+/*
+ * Descriptor to store test-case specific result data.
+ */
+const TInt KAlfPerfAppMaxCharsInSpecificResultText = 256;
+typedef HBufC* TTestCaseSpecificResultText;
+
+
+
+
+
+#endif // ALFPERFAPPCOSNTANTS_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappcovertestcase.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp cover test case class definition.
+*
+*/
+
+
+#ifndef C_ALFPERFAPPCOVERTESTCASE_H
+#define C_ALFPERFAPPCOVERTESTCASE_H
+
+#include <e32base.h>
+#include <aknappui.h>
+#include <alf/alfimagevisual.h>
+#include <alf/alftexturemanager.h>
+
+#include "alfperfapptestcase.h"
+
+
+class CAlfImageLoaderUtil;
+class CAlfLayout;
+class CAlfViewportLayout;
+
+class CAlfPerfAppCoverTestCaseControl;
+
+
+/**
+ *  CAlfPerfAppCoverTestCase class for measuring the frame rate
+ *  when images are scrolled left and right and scaled.
+ */
+class CAlfPerfAppCoverTestCase 
+    : public CAlfPerfAppTestCase,
+      public MAlfTextureLoadingCompletedObserver
+    {
+public:
+    /**
+     * Returns ETrue if test case is supported.
+     * @param aCaseId test case id.
+     * @return ETrue if supported.
+     */
+    static TBool IsSupported( TInt aCaseId );
+
+    static CAlfPerfAppCoverTestCase* NewL( TInt aCaseId, TInt aSequenceIndex);
+    virtual ~CAlfPerfAppCoverTestCase();
+
+    // From base class CAlfPerfAppTestCase:
+    virtual void SetupL( 
+        CAlfEnv& aEnv, 
+        const TRect& aVisibleArea, 
+        TRequestStatus& aStatus );
+    virtual void ExecuteL( TRequestStatus& aStatus );
+    virtual void TearDown();   
+    virtual void HandleVisibleAreaChange( const TRect& aRect );
+    
+    // From base class MAlfTextureLoadingCompletedObserver
+    void TextureLoadingCompleted( 
+        CAlfTexture& aTexture, TInt aTextureId, TInt aErrorCode );
+    virtual TInt CaseID();
+    
+protected:
+    
+    CAlfPerfAppCoverTestCase( TInt aCaseId, TInt aSequenceIndex );
+    void ConstructL();
+
+private:
+private:
+    /**
+     * Test case of which execution this instance was created.
+     */ 
+    TInt iCaseId;
+
+    /**
+     * A temporary store for holding the status of orientation
+     * information of the application before the test case
+     * is started. The previous value is restored in teardown.
+     */
+    CAknAppUiBase::TAppUiOrientation iOrientation;
+    
+    /**
+     * Alf environment.
+     * Not owned.
+     */
+    CAlfEnv* iEnv;
+
+    /**
+     * Test case control.
+     * Not owned.
+     */
+    CAlfPerfAppCoverTestCaseControl* iControl;
+    
+private:
+    
+#if 0
+    /**
+     * Next cycle.
+     */
+    void NextCycleL();
+    
+    /**
+     * Returns opacity for index.
+     */
+    TReal32 OpacityForIndex( TInt aIndex );
+    
+    /**
+     * Returns size for index.
+     */
+    TAlfRealSize SizeForIndex( TInt aIndex );
+    
+    /**
+     * Returns position for index.
+     */
+    TAlfRealPoint PositionForIndex( TInt aIndex, const TAlfRealSize& aSize );
+#endif
+
+private:
+
+    /**
+     * Image visuals.
+     */
+    RPointerArray< CAlfImageVisual > iImages;
+        
+    /**
+     * Cycle counter.
+     */        
+    TInt iCycleCounter;
+    
+    /**
+     * Image loader utility.
+     * Owned.
+     */
+    CAlfImageLoaderUtil* iLoader;
+
+    TInt iLoadedImages;
+    TRequestStatus* iStatus;
+
+    };
+
+#endif // C_ALFPERFAPPCOVERTESTCASE_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappdaemon.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfappdaemon application header.
+*
+*/
+
+
+#ifndef C_ALFPERFAPPDAEMON_H
+#define C_ALFPERFAPPDAEMON_H
+
+#include <e32std.h>
+#include <e32base.h>
+#include <aknapp.h>
+#include <akndoc.h>
+#include <aknappui.h>
+#include <aknserverapp.h>
+#include "alfperfapp.hrh"
+
+class CEikAppUi;
+class CAlfDebugExtension;
+class CAlfDebugFactory;
+class CAlfDebugExtension;
+
+/**
+ * UID of this application.
+ */
+const TUid KAlfPerfAppDaemonUid = { KAlfPerfAppDaemonUidValue };
+
+/**
+ * CAlfPerfAppDaemonApplication application class. 
+ */
+class CAlfPerfAppDaemonApplication : public CAknApplication 
+    {
+private: // from CApaApplication
+
+    // From base class CAknApplication 
+
+    virtual CApaDocument* CreateDocumentL();
+    virtual TUid AppDllUid() const;
+    virtual void NewAppServerL( CApaAppServer*& aAppServer );
+    };
+
+/**
+ *  CAlfPerfAppDaemonDocument document class.
+ */
+class CAlfPerfAppDaemonDocument : public CAknDocument
+    {
+public:
+    CAlfPerfAppDaemonDocument( CEikApplication& aApp );
+
+    // From base class CAknDocument
+    virtual CEikAppUi* CreateAppUiL();
+    virtual void UpdateTaskNameL(CApaWindowGroupName* aWgName);
+    };
+
+/**
+ *  CAlfPerfAppDaemonAppUi appui class.
+ */
+class CAlfPerfAppDaemonAppUi : public CAknAppUi
+    {
+public:
+    CAlfPerfAppDaemonAppUi();
+    ~CAlfPerfAppDaemonAppUi();
+
+    CAlfDebugExtension* Debug();
+
+    // From base class CAknViewAppUi
+
+    virtual void ConstructL();
+    virtual void HandleCommandL( TInt aCommand );
+
+private:
+    RLibrary iLibrary;
+    CAlfDebugFactory* iFactory;
+    CAlfDebugExtension* iDebug;
+    };
+
+/**
+ *  CAlfPerfAppDaemonServer server class.
+ */
+class CAlfPerfAppDaemonServer : public CAknAppServer
+    {
+public:
+    CAlfPerfAppDaemonServer();
+
+    // From base class CAknAppServer
+
+    virtual CApaAppServiceBase* CreateServiceL( TUid aServiceType ) const;
+    };
+
+/**
+ * CAlfPerfAppDaemonService 
+ */
+class CAlfPerfAppDaemonService : public CAknAppServiceBase
+    {
+public:
+    CAlfPerfAppDaemonService();
+    ~CAlfPerfAppDaemonService();
+
+    // From base class CAknAppServiceBase
+
+    virtual void ServiceL( const RMessage2& aMessage );
+
+private:
+
+    /**
+     * Call back function for activity polling.
+     * @param aAny pointer to instance of this class.
+     * @return always KErrNone.
+     */
+    static TInt ActivityPollCallBack( TAny* aAny );
+
+private:
+    CPeriodic* iActivityPoll;
+    };
+
+#endif // C_ALFPERFAPPDAEMON_H
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappdocument.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp document class definition.
+*
+*/
+
+
+#ifndef C_ALFPERFAPPDOCUMENT_H
+#define C_ALFPERFAPPDOCUMENT_H
+
+#include <akndoc.h>
+
+class CEikAppUi;
+class CAlfPerfAppModel;
+
+/**
+ *  CAlfPerfAppDocument document class.
+ */
+class CAlfPerfAppDocument : public CAknDocument
+    {
+public:
+
+    CAlfPerfAppDocument( CEikApplication& aApp );
+    ~CAlfPerfAppDocument();
+
+    // New functions
+    void ConstructL();
+
+    // From base class CAknDocument
+    CEikAppUi* CreateAppUiL();
+
+private:
+    /**
+     * Model.
+     * Owned.
+     */
+    CAlfPerfAppModel* iModel;
+    
+    };
+
+#endif // C_ALFPERFAPPDOCUMENT_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappframeworktestcase.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp framework test case class definition.
+*
+*/
+
+
+#ifndef C_ALFPERFAPPFRAMEWORKTESTCASE_H
+#define C_ALFPERFAPPFRAMEWORKTESTCASE_H
+
+#include <e32base.h>
+#include "alfperfapptestcase.h"
+
+/**
+ *  CAlfPerfAppFrameworkTestCase class.
+ *  This is not truly a performance test case - this is meant
+ *  to be used to test the framework.
+ */
+class CAlfPerfAppFrameworkTestCase : public CAlfPerfAppTestCase
+    {
+public:
+    /**
+     * Returns ETrue if test case is supported.
+     * @param aCaseId test case id.
+     * @return ETrue if supported.
+     */
+    static TBool IsSupported( TInt aCaseId );
+
+    static CAlfPerfAppFrameworkTestCase* NewL( TInt aCaseId, TInt aSequenceIndex );
+    ~CAlfPerfAppFrameworkTestCase();
+
+    // From base class CAlfPerfAppTestCase:
+    virtual void SetupL( 
+        CAlfEnv& aEnv, 
+        const TRect& aVisibleArea, 
+        TRequestStatus& aStatus );
+    virtual void ExecuteL( TRequestStatus& aStatus );
+    virtual void TearDown();   
+    virtual void HandleVisibleAreaChange( const TRect& aRect );
+    virtual TInt CaseID();
+    
+private:
+    
+    CAlfPerfAppFrameworkTestCase( TInt aCaseId, TInt aSequenceIndex );
+    void ConstructL();
+
+private:
+    /**
+     * Test case of which execution this instance was created.
+     */ 
+    TInt iCaseId;
+    
+    /**
+     * Alf environment.
+     * Now owned.
+     */
+    CAlfEnv* iEnv;
+
+    };
+
+#endif // C_ALFPERFAPPIMAGETESTCASE_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappgallerytestcase.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp gallery test case class definition.
+*
+*/
+
+
+
+#ifndef ALFPERFAPPGALLERYTESTCASE_H_
+#define ALFPERFAPPGALLERYTESTCASE_H_
+
+#include <e32base.h>
+#include <alf/alfimagevisual.h>
+#include "alfperfapptestcase.h"
+#include <alf/alfdisplaybackgrounditem.h>
+#include <aknappui.h>
+
+class CAlfImageLoaderUtil;
+class CAlfLayout;
+class CAlfViewportLayout;
+class CAlfPerfAppGalleryTestCaseControl;
+
+class MImagesLoadedObserver
+    {
+public:
+    virtual void ImagesLoaded( TInt aErrorCode ) = 0;
+    };
+
+/**
+ *  CAlfPerfAppGalleryTestCase class.
+ */
+class CAlfPerfAppGalleryTestCase : public CAlfPerfAppTestCase, public MImagesLoadedObserver
+    {
+public:
+    /**
+     * Returns ETrue if test case is supported.
+     * @param aCaseId test case id.
+     * @return ETrue if supported.
+     */
+    static TBool IsSupported( TInt aCaseId );
+
+    static CAlfPerfAppGalleryTestCase* NewL( TInt aCaseId, TInt aSequenceIndex );
+    ~CAlfPerfAppGalleryTestCase();
+
+    // From base class CAlfPerfAppTestCase:
+    virtual void SetupL( 
+        CAlfEnv& aEnv, 
+        const TRect& aVisibleArea, 
+        TRequestStatus& aStatus );
+    virtual void ExecuteL( TRequestStatus& aStatus );
+    virtual void TearDown();   
+    virtual void HandleVisibleAreaChange( const TRect& aRect );
+    virtual TInt CaseID();
+
+    // From MImagesLoadedObserver
+    void ImagesLoaded( TInt aErrorCode );
+    
+private:
+    
+    CAlfPerfAppGalleryTestCase( TInt aCaseId, TInt aSequenceIndex );
+    void ConstructL();
+
+private:
+
+    /**
+     * Test case of which execution this instance was created.
+     */ 
+    TInt iCaseId;
+
+    /**
+     * Alf environment.
+     * Not owned.
+     */
+    CAlfEnv* iEnv;
+
+    /**
+     * Test case control.
+     * Not owned.
+     */
+    CAlfPerfAppGalleryTestCaseControl* iControl;
+
+    /**
+     * Image visuals.
+     */
+    RPointerArray< CAlfImageVisual > iImages;
+        
+    /**
+     * Cycle counter.
+     */        
+    TInt iCycleCounter;
+    /**
+     * Image loader utility.
+     * Owned.
+     */
+    CAlfImageLoaderUtil* iLoader;
+    
+    TRequestStatus* iStatus;
+    
+    /**
+     * A temporary store for holding the status of orientation
+     * information of the application before the test case
+     * is started. The previous value is restored in teardown.
+     */
+    CAknAppUiBase::TAppUiOrientation iOrientation;
+
+    };
+
+#endif /*ALFPERFAPPGALLERYTESTCASE_H_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappimagetestcase.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp image test case class definition.
+*
+*/
+
+
+#ifndef C_ALFPERFAPPIMAGETESTCASE_H
+#define C_ALFPERFAPPIMAGETESTCASE_H
+
+#include <e32base.h>
+#include "alfperfapptestcase.h"
+
+class CAlfPerfAppBaseTestCaseControl;
+
+/**
+ *  CAlfPerfAppImageTestCase class.
+ */
+class CAlfPerfAppImageTestCase : public CAlfPerfAppTestCase
+    {
+public:
+    /**
+     * Returns ETrue if test case is supported.
+     * @param aCaseId test case id.
+     * @return ETrue if supported.
+     */
+    static TBool IsSupported( TInt aCaseId );
+
+    static CAlfPerfAppImageTestCase* NewL( TInt aCaseId, TInt aSequenceIndex );
+    ~CAlfPerfAppImageTestCase();
+
+    // From base class CAlfPerfAppTestCase:
+    virtual void SetupL( 
+        CAlfEnv& aEnv, 
+        const TRect& aVisibleArea, 
+        TRequestStatus& aStatus );
+    virtual void ExecuteL( TRequestStatus& aStatus );
+    virtual void TearDown();   
+    virtual void HandleVisibleAreaChange( const TRect& aRect );
+    virtual TInt CaseID();
+    
+   TTestCaseSpecificResultText getCaseSpecificResultL();
+    
+private:
+    
+    CAlfPerfAppImageTestCase( TInt aCaseId, TInt aSequenceIndex);
+    void ConstructL();
+
+private:
+    /**
+     * Test case of which execution this instance was created.
+     */ 
+    TInt iCaseId;
+    
+    /**
+     * Alf environment.
+     * Not owned.
+     */
+    CAlfEnv* iEnv;
+
+    /**
+     * Test case control.
+     * Not owned.
+     */
+    CAlfPerfAppBaseTestCaseControl* iControl;
+    
+    /*
+     *  Total Visual Count, used only with sequence cases
+     */
+    TInt iTotalVisualCount;
+    TInt iAnimationDivider;
+    };
+
+#endif // C_ALFPERFAPPIMAGETESTCASE_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfapplayouttestcase.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAlfPerfAppLayoutTestCase class definition.
+*
+*/
+
+
+#ifndef C_ALFPERFAPPLAYOUTTESTCASE_H
+#define C_ALFPERFAPPLAYOUTTESTCASE_H
+
+#include <e32base.h>
+#include "alfperfapptestcase.h"
+
+class CAlfPerfAppBaseTestCaseControl;
+
+/**
+ *  CAlfPerfAppLayoutTestCase class.
+ */
+class CAlfPerfAppLayoutTestCase : public CAlfPerfAppTestCase
+    {
+public:
+    /**
+     * Returns ETrue if test case is supported.
+     * @param aCaseId test case id.
+     * @return ETrue if supported.
+     */
+    static TBool IsSupported( TInt aCaseId );
+
+    static CAlfPerfAppLayoutTestCase* NewL( TInt aCaseId, TInt aSequenceIndex );
+    ~CAlfPerfAppLayoutTestCase();
+
+    // From base class CAlfPerfAppTestCase:
+    virtual void SetupL( 
+        CAlfEnv& aEnv, 
+        const TRect& aVisibleArea, 
+        TRequestStatus& aStatus );
+    virtual void ExecuteL( TRequestStatus& aStatus );
+    virtual void TearDown();   
+    virtual void HandleVisibleAreaChange( const TRect& aRect );
+    virtual TInt CaseID();
+    
+private:
+    
+    CAlfPerfAppLayoutTestCase( TInt aCaseId, TInt aSequenceIndex );
+    void ConstructL();
+
+private:
+    /**
+     * Test case of which execution this instance was created.
+     */ 
+    TInt iCaseId;
+    
+    /**
+     * Alf environment.
+     * Not owned.
+     */
+    CAlfEnv* iEnv;
+
+    /**
+     * Test case control.
+     * Not owned.
+     */
+    CAlfPerfAppBaseTestCaseControl* iControl;
+
+    };
+
+#endif // C_ALFPERFAPPLAYOUTTESTCASE_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappmodel.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,267 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp model class definition.
+*
+*/
+
+
+#ifndef C_ALFPERFAPPMODEL_H
+#define C_ALFPERFAPPMODEL_H
+
+#include <e32base.h>
+#include <f32file.h>
+
+#include "alfperfappconstants.h"
+class CDesC16ArrayFlat;
+class CAlfPerfAppModelTestSuite;
+
+
+/**
+ *  CAlfPerfAppModel model class.
+ *  This class records test cases to be executed as well as 
+ *  results of those cases.
+ */
+class CAlfPerfAppModel : public CBase
+    {
+public:
+
+    struct TTestCaseResultItem
+        {
+        // Header
+        TBuf8<KAlfPerfAppMaxCharsInLine> iSuiteName;
+        TBuf8<KAlfPerfAppMaxCharsInLine> iCaseName;
+        TInt iCaseId;				// Case id
+        TInt iPhase; 				// Phase: 0=startup, 1=run, 2=teardown
+        
+        // Data
+        TUint32 iTimeStamp;         // Timestamp
+        TUint32 imsSinceCase;       // ms since case start
+        TUint32 imsSincePhase;      // ms since phase start
+        
+        // Application memory
+        TInt iAppCells;
+        TInt iAppMemory;
+        TInt iAppFree;
+        
+        // Server memory
+        TInt iServerCells;
+        TInt iServerMemory;
+        TInt iServerFree;
+
+        // Frame count from server
+        TUint iFrameCount; // Frames from beginning of phase
+        TReal32 iFPS;        // During this phase
+        
+        // System total memory consumption
+        TInt iSystemMemory;
+        TInt iSystemFree;
+        
+        // Testcase specifig result
+        TBuf8<KAlfPerfAppMaxCharsInSpecificResultText> specificResult8;
+		};
+
+   
+public:
+    static CAlfPerfAppModel* NewL();
+    ~CAlfPerfAppModel();
+    
+    //
+    // Test set management functions
+    //
+    
+    /**
+     * Loads test set.
+     * @param aResourceId resource id for test set.
+     */
+    void LoadTestSetL( TInt aResourceId );
+    
+    /**
+     * Returns amount of test suites.
+     * @return amount of test suites.
+     */
+    TInt SuiteCount() const;
+    
+    /**
+     * Returns name of specified suite.
+     * @param aSuiteIndex index to suite.
+     * @return name of suite.     
+     */
+    TPtrC SuiteName( TInt aSuiteIndex ) const;
+
+    /**
+     * Returns flags of specified suite.
+     * @param aSuiteIndex index to suite.
+     * @return flags of suite.     
+     */
+    TInt SuiteFlags( TInt aSuiteIndex ) const;
+
+    /**
+     * Returns amount of test cases in specified suite.
+     * @param aSuiteIndex index to suite.
+     * @return amount of test cases in the suite.
+     */
+    TInt TestCaseCount( TInt aSuiteIndex ) const;
+
+    /**
+     * Gets information about specified suite.
+     * @param aSuiteIndex index to suite.
+     * @param aTestCaseIndex index inside suite.
+     * @param aTestCaseName this is updated to point to name.
+     * @param aTestCaseId this is updated to hold case id.
+     */
+    void GetTestCase( 
+        TInt aSuiteIndex, 
+        TInt aTestCaseIndex, 
+        TPtrC& aTestCaseName,
+        TInt& aTestCaseId,
+        TInt& aTestCaseFlags,
+        TInt& aTestCaseSequenceLength ) const;
+    
+    /**
+     * Finds test suite name & test case name by case id.
+     * @param aCaseId test case id.
+     * @param aSuiteName this is updated to point to suite name.
+     * @param aTestCaseName this is updated to point to test case name.
+     * @return KErrNone in success, KErrNotFound if not found.
+     */
+    TInt FindById( 
+        TInt aCaseId,
+        TPtrC& aSuiteName,
+        TPtrC& aTestCaseName ) const;
+        
+   	//
+    // Execute array management functions
+    //    
+    /**
+     * Resets execute test cases array.
+     */
+    void ResetExecuteArray();
+    
+    /**
+     * Appends a case to execute array.
+     * @param aCaseId case to be added.
+     */
+    void AddToExecuteArrayL( TInt aCaseId );
+        
+    /**
+     * Gets first test case to be executed.
+     * This also removes that item from array.
+     */
+    TBool GetFromExecuteArray( TInt& aCaseId );
+
+    //
+    // Test results management functions
+    //
+    /**
+     * Appends a result item to result files.
+     * @param aItem result item to be added.
+     */
+	void AddToResultFilesL( const TTestCaseResultItem& aItem);
+
+	   
+	/**
+	 * Adds error.
+	 * @param aMessage message to be added.
+	 */
+	void AddToErrorArrayL( const TDesC& aMessage );
+	
+	/**
+	 * Returns total amount of error messages.
+	 * @return total amounf of error messages.
+	 */
+	TInt ErrorArrayCount();
+	
+	/**
+	 * Gets error message.
+	 * @param aIndex index from which to take.
+	 * @param aMessage message.
+	 */
+	void GetFromErrorArray( TInt aIndex, TPtrC& aMessage );
+    
+    /**
+     * Resets error array.
+     */
+    void ResetErrorArray();
+    
+    /*
+     *  Tells if there are any results available in file.
+     */
+    TBool ResultsNotAddedToFile();
+    
+    /*
+     *  Returns pointer to the file which results are written to
+     */
+    RFile* ResultFile();
+    
+
+    /*
+     * Returns the target path location.
+     */
+    TFileName TargetPath();    
+    
+    /*
+     * Returns if the files existed when the program was launched.
+     */
+    TBool TargetFilesExisted();
+    
+    /*
+     * Opens the result files for appending. Creates new ones if necessary.
+     * If reset is set to ETrue, forces recreation.
+     */
+    void OpenFilesL(TBool reset = EFalse);
+    
+private:
+
+    CAlfPerfAppModel();
+    void ConstructL();
+
+private:
+
+    /**
+     * Test suites.
+     * Owned.
+     */
+    RPointerArray< CAlfPerfAppModelTestSuite > iSuites;
+    
+    /**
+     * Array of cases to be executed.
+     * Owned.
+     */
+    RArray< TInt > iExecuteTestCases;
+
+    /**
+     * Array of error messages.
+     * Owned.
+     */
+    CDesC16ArrayFlat* iErrorMessages;
+
+    TBool   iFilesOpened;
+    TBool   iFilesExisted;
+    TFileName iTargetPath;
+    
+    RFs iTargetFileServerSession;
+    TFileName iTargetFileName;
+    RFile iTargetFile;
+    
+    TBool iResultItemsNotAddedToFile;
+    
+    TFileName iSummaryFileName;
+    RFile iSummaryFile;
+    TFileText iSummaryWriteFileText;
+    
+    };
+
+#endif // C_ALFPERFAPPMODEL_H
+            
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappsuiteepgcontrol.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,160 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __ALFPERFAPPSUITEEPGCONTROL_H__
+#define __ALFPERFAPPSUITEEPGCONTROL_H__
+
+// INCLUDES
+#include <alf/alfcontrol.h>
+#include "alfperfappsuiteflags.h"
+
+// FORWARD DECLARATIONS
+class CAlfLayout;
+class CAlfPerfAppSuiteTestCaseScroll;
+
+// CLASS DECLARATIONS
+class TProgram
+	{
+	public:
+		/**
+		 * C++ constructor.
+		 */		
+		TProgram();
+		
+		/**
+		 * C++ constructor.
+		 * @param aName Name of the program.
+		 * @param aStart Start time of the program.
+		 * @param aEnd End time of the program.
+		 */		
+		TProgram( const TDesC& aName, const TDesC& aStart, const TDesC& aEnd );
+		
+	public:
+		
+		/**
+		 * Calculates the duration of the program.
+		 * @return duration of the program.
+		 */
+		TInt DurationInMinutes();
+		
+	public:
+		/**
+		 * Name of the program.
+		 */
+		TBuf<100> iName;
+		
+		/**
+		 * Start time.
+		 */
+		TTime iStart;
+		
+		/**
+		 * End time.
+		 */
+		TTime iEnd;
+	};
+
+class CAlfPerfAppSuiteEPGControl : public CAlfControl, public MAlfTextureLoadingCompletedObserver
+    {
+	private: // Enums
+		
+		/**
+		 * Textstyles used in EGP.
+		 */
+		enum TTextStyle
+			{
+			ETextStyleTitle = 0,
+			ETextStyleTime,
+			ETextStyleProgram,
+			ENumberOfTextStyles
+			};
+	
+	public: // Construction and desctruction
+		
+		/**
+		 * C++ constuctor.
+		 * @param aScrollControl is used as observer
+		 */ 
+		CAlfPerfAppSuiteEPGControl(CAlfPerfAppSuiteTestCaseScroll* aScrollControl);
+		
+		/**
+		 * Destructor.
+		 */
+		~CAlfPerfAppSuiteEPGControl();
+		
+		/**
+		 * Second-phase constructor.
+		 * @param aEnv Alf environment.
+		 * @param aVisibleArea Visible screen area.
+		 * @param aParentLayout Parent layout.
+		 */		
+	    virtual void ConstructL( 
+	        CAlfEnv& aEnv, 
+	        const TSize& aVisibleArea,
+	        CAlfLayout* aParentLayout );
+	    
+	private: // New functions
+#ifdef ENABLE_TEXTSTYLES		
+		void CreateTextStylesL();
+#endif
+		void AddRowL( 
+				CAlfLayout* aParentLayout,
+				TAlfImage& aChannelImage,
+				RArray<TProgram>& aPrograms,
+				const TTime& aTimeWindowStart,
+				const TTime& aTimeWindowEnd,
+				TInt aTextStyle,
+				TBool aSetBorders = ETrue
+				);
+		
+		void AddProgramsL( 
+				CAlfLayout* aParentLayout,
+				RArray<TProgram>& aPrograms,
+				const TTime& aTimeWindowStart,
+				const TTime& aTimeWindowEnd,
+				TInt aTextStyle,
+				TBool aSetBorders
+				);		
+	   
+	    // From base class MAlfTextureLoadingCompletedObserver
+	    void TextureLoadingCompleted(
+	            CAlfTexture& aTexture,
+	            TInt aTextureId,
+	            TInt aErrorCode );
+	    
+	private:
+		TSize iVisibleArea;
+
+		/**
+		 * count of the number of loaded textures
+		 */
+		TInt iLoadedImages;
+		
+		/**
+		 * Used for callback.
+		 * Not owned.
+		 */
+		CAlfPerfAppSuiteTestCaseScroll* iScrollControl;
+		
+#ifdef ENABLE_TEXTSTYLES		
+		RArray<TInt> iTextStyles;
+#endif
+    };
+
+#endif // __ALFPERFAPPSUITEEPGCONTROL_H__
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappsuiteflags.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __ALFPERFAPPSUITEFLAGS_H__
+#define __ALFPERFAPPSUITEFLAGS_H__
+
+#define ENABLE_TEXTSTYLES
+
+#endif // __ALFPERFAPPSUITEFLAGS_H__
+
+// end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappsuitehelper.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __ALFPERFAPPSUITEHELPER_H__
+#define __ALFPERFAPPSUITEHELPER_H__
+
+// INCLUDES
+#include <alf/AlfVisual.h>
+#include <alf/AlfGradientBrush.h>
+#include <alf/AlfBorderBrush.h>
+#include <alf/AlfBrushArray.h>
+#include <alf/AlfDropShadowBrush.h>
+#include <alf/AlfMetric.h>
+
+// CLASS DECLARATION
+class TAlfPerfAppSuiteHelper
+	{
+	public:
+		static void AddBorderBrushL( 
+				CAlfVisual* aVisual,
+				const TRgb& aColor,
+				TInt aThicknessWidth = 1,
+				TInt aThicknessHeight = 1 );
+		
+		static void AddGradientBrushL( 
+				CAlfVisual* aVisual,
+				const TRgb& aColor1,
+				const TRgb& aColor2,
+				CAlfGradientBrush::TDirection aDirection = CAlfGradientBrush::EDirectionDown );
+		
+		static void AddGradientBrushL( 
+				CAlfVisual* aVisual,
+				const TRgb& aColor );		
+		
+		static void AddDropShadowBrushL(
+				CAlfVisual* aVisual,
+				const TRgb& aColor,
+				TInt aDepth	);
+	};
+
+#endif // __ALFPERFAPPSUITEHELPER_H__
+
+// end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappsuitepeoplecontrol.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,127 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __ALFPERFAPPSUITEPEOPLECONTROL_H__
+#define __ALFPERFAPPSUITEPEOPLECONTROL_H__
+
+// INCLUDES
+#include <alf/alfcontrol.h>
+#include "alfperfappsuiteflags.h"
+
+// FORWARD DECLARATIONS
+class CAlfLayout;
+class CAlfGridLayout;
+class TAlfImage;
+class CAlfPerfAppSuiteTestCaseScroll;
+
+// CLASS DECLARATION
+class CAlfPerfAppSuitePeopleControl : public CAlfControl, public MAlfTextureLoadingCompletedObserver
+    {
+	private: // Enums
+		
+		/**
+		 * Textstyles used in people-suite.
+		 */		
+		enum TTextStyle
+			{
+			ETextStyleHeader = 0,
+			ETextStyleBig,
+			ETextStyleSmall,
+			ENumberOfTextStyles
+			};
+		
+	public: // Construction and destruction
+		
+		/**
+		 * C++ constructor.
+		 * @param aScrollControl is used as observer
+		 */		
+		CAlfPerfAppSuitePeopleControl(CAlfPerfAppSuiteTestCaseScroll* aScrollControl);
+		
+		/**
+		 * Destructor.
+		 */		
+		~CAlfPerfAppSuitePeopleControl();
+		
+		/**
+		 * Second-phase constructor.
+		 * @param aEnv Alf environment.
+		 * @param aVisibleArea Visible screen area.
+		 * @param aParentLayout Parent layout.
+		 */		
+	    virtual void ConstructL( 
+	        CAlfEnv& aEnv,
+	        const TSize& aVisibleArea,
+	        CAlfLayout* aParentLayout );
+	    
+	private: // New functions
+
+#ifdef ENABLE_TEXTSTYLES
+		void CreateTextStylesL();
+#endif
+		
+	    CAlfGridLayout* ConstructListItemLayoutL(
+	    		CAlfLayout* aParentLayout,
+	    		TInt aHeight,
+	    		TBool aSelected = EFalse,
+	    		TBool aBorders = ETrue );
+	    
+	    CAlfGridLayout* ConstructListItemTextLayoutL( 
+	    		CAlfLayout* aParentLayout );
+	    
+	    void ConstructListHeaderL(
+	    		CAlfLayout* aParentLayout,
+	    		const TAlfImage& aImage,
+	    		const TDesC& aText,
+	    		TInt aHeight );
+	    
+	    void ConstructListItemL(
+	    		CAlfLayout* aParentLayout,
+	    		const TDesC& aName,
+	    		const TDesC& aDescription,
+	    		TInt aHeight,
+	    		TBool aSelected = EFalse );
+
+	    // From base class MAlfTextureLoadingCompletedObserver
+	    void TextureLoadingCompleted(
+	            CAlfTexture& aTexture,
+	            TInt aTextureId,
+	            TInt aErrorCode );
+	        
+	private:
+		TSize iVisibleArea;
+
+	    /**
+	     * count of the number of loaded textures
+	     */
+		TInt iLoadedImages;
+		
+	    /**
+	     * Used for callback.
+	     * Not owned.
+	     */
+		CAlfPerfAppSuiteTestCaseScroll* iScrollControl;
+
+#ifdef ENABLE_TEXTSTYLES		
+		RArray<TInt> iTextStyles;
+#endif
+		
+    };
+
+#endif // __ALFPERFAPPSUITEPEOPLECONTROL_H__
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappsuitetestcase.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 __ALFPERFAPPSUITETESTCASE_H__
+#define __ALFPERFAPPSUITETESTCASE_H__
+
+// INCLUDES
+#include <e32base.h>
+#include "alfperfapptestcase.h"
+
+// FORWARD DECLARTIONS
+class CAlfPerfAppSuiteTestCaseControl;
+
+// CLASS DECLARATION
+class CAlfPerfAppSuiteTestCase : public CAlfPerfAppTestCase
+    {
+	public: // Construction & destruction
+		
+		/**
+		 * Construction
+		 * @param aCaseId Testcase id.
+		 */
+	    static CAlfPerfAppSuiteTestCase* NewL( TInt aCaseId, TInt aSequenceIndex);
+	    
+		/**
+		 * Destructor.
+		 */	    
+	    virtual ~CAlfPerfAppSuiteTestCase();
+	    
+	private: // Construction
+	    
+		/**
+		 * C++ constructor.
+		 */		
+		CAlfPerfAppSuiteTestCase( TInt aCaseId, TInt aSequenceIndex );
+		
+		/**
+		 * Second phase constructor.
+		 */
+	    void ConstructL();	    
+		
+	public: // from CAlfPerfAppTestCase
+	    /**
+	     * Starts set up phase.
+	     * @param aEnv reference to alf environment instance.
+	     * @param aVisibleArea visible area.
+	     * @param aStatus request status that needs to be completed when
+	     *                test case is ready to be executed.
+	     */
+	    void SetupL( 
+	        CAlfEnv& aEnv, 
+	        const TRect& aVisibleArea, 
+	        TRequestStatus& aStatus );
+
+	    /**
+	     * Starts test case execution.
+	     * @param aStatus request status that needs to be completed when
+	     *                execution is finished.
+	     */
+	    void ExecuteL( TRequestStatus& aStatus );
+
+	    /** 
+	     * Tears down. 
+	     */
+	    void TearDown();
+
+	    /**
+	     * Handles visible area changes.
+	     * @param aRect new visible area rect.
+	     */
+	    void HandleVisibleAreaChange( const TRect& aRect );
+	    virtual TInt CaseID();
+	    
+	public: // New functions
+		
+		/**
+		 * Tests if a testcase is supported.
+		 * @param aCaseId Testcase id.
+		 * @return ETrue if supported.
+		 */
+		static TBool IsSupported( TInt aCaseId );
+
+		/**
+		 * sends request completion after successful loading of all textures
+		 * @param aErrorCode err code of texture loading.
+		 */
+		void ImagesLoaded( TInt aErrorCode );
+
+	private:
+	
+	    /**
+	     * Test case of which execution this instance was created.
+	     */ 
+	    TInt iCaseId;
+	
+	    /**
+	     * Alf environment.
+	     * Not owned.
+	     */
+	    CAlfEnv* iEnv;
+	    
+	    /**
+	     * Testcase control
+	     */
+	    CAlfPerfAppSuiteTestCaseControl* iControl;
+
+	    /**
+	     * Testcase state change status. To indicate end of Setup state.
+	     */
+	    TRequestStatus* iStatus;
+    };
+
+#endif // __ALFPERFAPPSUITETESTCASE_H__
+
+// end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappsuitetestcasecontrol.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 ALFPERFAPPSUITETESTCASECONTROL_H_
+#define ALFPERFAPPSUITETESTCASECONTROL_H_
+
+// INCLUDES
+#include <Alf/AlfControl.h>
+
+// CONSTANTS
+const TInt KAlfPerfAppSuiteControlGroup = 1;
+
+const TInt KAlfPerfAppSuiteCmdCompleteNow = 0x5000;
+const TInt KAlfPerfAppSuiteCmdNext = 0x5001;
+
+// CLASS DECLARATION
+/**
+ * Abstract Suite test case control.
+ */
+class CAlfPerfAppSuiteTestCaseControl : public CAlfControl
+    {
+public:
+
+    /**
+     * Constructor.
+     */
+    CAlfPerfAppSuiteTestCaseControl();
+
+    /**
+     * Destructor.
+     */
+    ~CAlfPerfAppSuiteTestCaseControl();
+
+    /**
+     * Base class constructor. Derived classes may
+     * override this, but base class needs to be called.
+     */
+    virtual void ConstructL( 
+            CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea );
+
+    /**
+     * Starts execution of the test case. By default,
+     * request status is stored to local variable.
+     */
+    void StartExecuteL( TRequestStatus& aStatus );    
+
+    /**
+     * Cancels execution. This control and environment will be
+     * deleted soon after calling this method.
+     */
+    void CancelExecution();
+
+    /**
+     * Starts execution.
+     * If this method leaves, then request must not be completed.
+     * By default, this method completes immediately.
+     */
+    virtual void DoStartExecuteL();
+
+    /**
+     * Sets visible area.
+     * @param aVisibleArea visible area.
+     */
+    virtual void SetVisibleArea( const TRect& aVisibleArea );    
+
+    // From base class CAlfControl:
+
+    /**
+     * Handles events.
+     * Derived classes should forward to base class.
+     * @param aEvent event to be handled.
+     * @return ETrue if consumed, EFalse otherwise.
+     */
+    virtual TBool OfferEventL( const TAlfEvent& aEvent );
+
+protected:
+
+    /**
+     * Completes automatically after specified duration.
+     * @param aDuration duration in ms
+     */
+    void CompleteAfterL( TInt aDuration );
+
+    /**
+     * Completes current request.
+     */
+    void CompleteNow( TInt aErrorCode );
+
+    /**
+     * Returns test case id.
+     */
+    inline TInt CaseId() const;
+
+    /**
+     * Returns ETrue if test case execution is still ongoing.
+     */
+    TBool IsExecutionOngoing() const;
+
+    /**
+     * Test case id.
+     */
+    TInt iCaseId;
+
+    /**
+     * Current visible screen area.
+     */
+    TRect iVisibleArea;
+
+private:
+
+    /**
+     * Pointer to request status.
+     * Not owned.
+     */
+    TRequestStatus* iStatus;
+
+    };
+
+#endif // ALFPERFAPPSUITETESTCASECONTROL_H_
+
+// end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfappsuitetestcasescroll.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,180 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 ALFPERFAPPSUITETESTCASESCROLL_H_
+#define ALFPERFAPPSUITETESTCASESCROLL_H_
+
+// INLUDES
+#include "AlfPerfAppSuiteTestCaseControl.h"
+
+// FORWARD DECLARATIONS
+class CAlfImageLoaderUtil;
+class CAlfImageVisual;
+class CAlfViewportLayout;
+class CAlfGridLayout;
+class CAlfPerfAppSuiteTestCase;
+
+// CLASS DECLARATION
+class CAlfPerfAppSuiteTestCaseScroll : public CAlfPerfAppSuiteTestCaseControl
+    {
+private:
+
+    enum TTextStyle
+        {
+        EPersonSuiteBig = 0,
+        EPersonSuiteSmall,
+        ENumberOfStyles
+        };
+public: // Construction and destrcution
+
+    /**
+     * C++ constructor.
+     * @param aAppSuiteTestCase used as observer
+     */
+    CAlfPerfAppSuiteTestCaseScroll(CAlfPerfAppSuiteTestCase* aAppSuiteTestCase);
+
+    /**
+     * Destructor.
+     */
+    ~CAlfPerfAppSuiteTestCaseScroll();
+
+    /**
+     * Second phase constructor.
+     * @param aEnv Alf environment.
+     * @param aCaseId Testcase id.
+     * @param aVisibleArea Screen area to use.
+     */
+    virtual void ConstructL( 
+            CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea );      
+public: // From CAlfPerfAppSuiteTestCaseControl
+
+    /**
+     * Starts execution.
+     * If this method leaves, then request must not be completed.
+     * By default, this method completes immediately.
+     */		
+    virtual void DoStartExecuteL();
+
+    /**
+     * Handles events.
+     * @param aEvent event to be handled.
+     * @return ETrue if consumed, EFalse otherwise.
+     */	    
+    virtual TBool OfferEventL( const TAlfEvent& aEvent );
+    /**
+     * Sets visible area.
+     * @param aVisibleArea visible area.
+     */	    
+    virtual void SetVisibleArea( const TRect& aVisibleArea );
+    
+    /**
+     * Informs that all textures have been loaded.
+     * @param aErrorCode error code of texture loading
+     */    
+    void ImagesLoaded( TInt aErrorCode );
+
+private: // New functions
+
+    void CreateTextStylesL();
+
+    /**
+     * Starts the next animation cycle.
+     */
+    void NextCycleL();
+
+    void ConstructPictureNumberSuiteL( 
+            CAlfLayout* aParentLayout,
+            const TAlfImage& aImage,
+            const TInt aNumber );
+
+    void ConstructPeopleSuiteL( 
+            CAlfLayout* aParentLayout );
+
+    CAlfGridLayout* ConstructPeopleSuiteListItemLayoutL(
+            CAlfLayout* aParentLayout,
+            TBool aSelected = EFalse );
+
+    CAlfGridLayout* ConstructPeopleSuiteListItemTextLayoutL( 
+            CAlfLayout* aParentLayout );
+
+    void ConstructPeopleSuiteListHeaderL(
+            CAlfLayout* aParentLayout,
+            const TAlfImage& aImage,
+            const TDesC& aText );
+
+    void ConstructPeopleSuiteListItemL(
+            CAlfLayout* aParentLayout,
+            const TDesC& aName,
+            const TDesC& aDescription,
+            TBool aSelected = EFalse );    
+
+private: // Data
+    /**
+     * Cycle counter.
+     */        
+    TInt iCycleCounter;
+
+    /**
+     * Image loader utility.
+     * Owned.
+     */
+    CAlfImageLoaderUtil* iLoader;
+
+
+    /**
+     * Pointer to viewport layout.
+     * Not owned.
+     */
+    CAlfViewportLayout* iViewPortLayout;
+
+    /**
+     * Current viewport position.
+     */
+    TAlfRealPoint       iViewPortPos;
+
+    TInt iSuiteWidth;
+
+    /**
+     * Number of application suites in this testcase.
+     */
+    TInt iSuiteCount;
+
+
+    /**
+     * Lenghts of one trasition cycle.
+     */
+    TInt iCycleLenght;
+
+    RArray<TInt> iTextStyles;
+    
+    /**
+     * If it equals to iSuiteCount,
+     * that means all application suites have loaded their textures.
+     */
+    TInt iLoadedImages;
+    
+    /**
+     * Used for callback.
+     * Not owned.
+     */
+    CAlfPerfAppSuiteTestCase* iAppSuiteTestCase;
+    };
+
+#endif /*ALFPERFAPPSUITETESTCASESCROLL_H_*/
+
+// end of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfapptestcase.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,173 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp abstract test case class definition.
+*
+*/
+
+
+#ifndef C_ALFPERFAPPTESTCASE_H
+#define C_ALFPERFAPPTESTCASE_H
+
+#include <e32base.h>
+#include <eikenv.h>
+
+#include "alfperfappmodel.h"
+class CAlfEnv;
+
+/**
+ * MAlfPerfAppTestCaseInterface class.
+ * It is interface from test case to execution environment. It allows
+ * test case to ask measurements to be performed.
+ */
+class MAlfPerfAppTestCaseInterface
+    {
+public:
+    
+    /**
+     * Asks execution enrivonment to perform measurements.
+     */
+    virtual void MeasureNow() = 0;
+    
+    };
+
+/**
+ *  CAlfPerfAppTestCase class.
+ *  It's abstract class from which all concrete test cases needs to be derived
+ *  from.
+ *  Destruction of an instance of this type must complete ongoing requests.
+ */
+class CAlfPerfAppTestCase : public CBase
+    {
+public:
+
+    /**
+     * Sets interface towards execution environment.
+     */
+    inline void SetInterface( MAlfPerfAppTestCaseInterface* aInterface );
+    
+    /**
+     * Starts set up phase.
+     * @param aEnv reference to alf environment instance.
+     * @param aVisibleArea visible area.
+     * @param aStatus request status that needs to be completed when
+     *                test case is ready to be executed.
+     */
+    virtual void SetupL( 
+        CAlfEnv& aEnv, 
+        const TRect& aVisibleArea, 
+        TRequestStatus& aStatus ) = 0;
+
+    /**
+     * Starts test case execution.
+     * @param aStatus request status that needs to be completed when
+     *                execution is finished.
+     */
+    virtual void ExecuteL( TRequestStatus& aStatus ) = 0;
+
+    /** 
+     * Tears down. 
+     */
+    virtual void TearDown() = 0;
+
+    /**
+     * Handles visible area changes.
+     * @param aRect new visible area rect.
+     */
+    virtual void HandleVisibleAreaChange( const TRect& aRect ) = 0;
+    
+    /**
+     * Returns CaseID of this test case
+     */
+    virtual TInt CaseID() = 0;
+   
+    /*
+     * Used to get test case specific results.
+     * Default definition just returns empty TTestCaseSpecificResultText
+     * This should be reimplemented in actual test case classes if case specific results are needed.
+     * Notes:
+     *  - Latest non-zero returning value of this is shown in DisplayResults. All are still
+     *    recorded to file. 
+     */
+    virtual TTestCaseSpecificResultText getCaseSpecificResultL();
+    
+    
+    TInt SequenceIndex();
+    
+protected:
+
+    /**
+     * Perform measurements.
+     */
+    inline void MeasureNow();
+
+    /**
+     * Completes request status now.
+     * @param aStatus request status to be completed.
+     * @param aErrorCode completion error code to be used.
+     */
+    inline static void CompleteNow( TRequestStatus& aStatus, TInt aErrorCode );
+
+    /* 
+     * Gives access to stored CEikonEnv pointer
+     */
+    CEikonEnv* EikonEnv();
+    
+    /*
+     * Protected constructor
+     */
+    CAlfPerfAppTestCase(TInt aSequenceIndex);
+    
+private:
+    /**
+     * Interface towards execution environment.
+     * Not owned.
+     */
+    MAlfPerfAppTestCaseInterface* iInterface;
+    
+    /*
+     * Pointer to CEikonEnv.
+     */
+    CEikonEnv* iEnv;
+    
+    /*
+     * Tells which iteration of this same case this is.
+     * 0 Means that this is not a sequence case.
+     */
+    TInt iSequenceIndex;
+    
+    };
+
+inline void CAlfPerfAppTestCase::SetInterface( 
+        MAlfPerfAppTestCaseInterface* aInterface )
+    {
+    iInterface = aInterface;
+    }
+
+inline void CAlfPerfAppTestCase::MeasureNow()
+    {
+    if ( iInterface )
+        {
+        iInterface->MeasureNow();
+        }
+    }
+
+inline void CAlfPerfAppTestCase::CompleteNow( TRequestStatus& aStatus, TInt aErrorCode )
+    {
+    __ASSERT_ALWAYS( aStatus.Int() == KRequestPending, User::Invariant() );
+    TRequestStatus* status = &aStatus;
+    User::RequestComplete( status, aErrorCode );
+    }
+
+#endif // C_ALFPERFAPPTESTCASE_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfapptestcaseexecutionview.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp test case runner view class definition.
+*
+*/
+
+
+#ifndef C_ALFPERFAPPTESTCASEEXECUTIONVIEW_H
+#define C_ALFPERFAPPTESTCASEEXECUTIONVIEW_H
+
+#include <aknview.h>
+#include <apaserverapp.h>
+
+class CAlfPerfAppModel;
+class CAlfPerfAppTestCaseFactory;
+struct TAlfDebugServerMeasurements;
+class RAlfPerfAppDaemon;
+   
+/**
+ *  CAlfPerfAppTestCaseExecutionView view class.
+ */
+class CAlfPerfAppTestCaseExecutionView : public CAknView
+    {
+public:
+
+    static CAlfPerfAppTestCaseExecutionView* NewLC( CAlfPerfAppModel& aModel );
+    ~CAlfPerfAppTestCaseExecutionView();
+
+    /**
+     * This method is called by view container. This will notify
+     * current test case about layout change.
+     * @param aRect visible area rect.
+     */
+    void NotifyLayoutChange( const TRect& aRect );
+    
+    /**
+     * This method is called when all test cases has been executed.
+     */
+    void NotifyExecutionCompletedL();
+    
+    /**
+     * This method is called when test case should be shown to end-user.
+     * @param aVisible ETrue if test case is visible, EFalse otherwise.
+     */
+    void NotifyTestCaseVisible( TBool aVisible );
+    
+    
+private:
+
+    CAlfPerfAppTestCaseExecutionView( CAlfPerfAppModel& aModel );
+    void ConstructL();
+
+private:
+
+    // From base class CAknView
+    virtual TUid Id() const;
+
+    virtual void DoActivateL(
+        const TVwsViewId& aPrevViewId,
+        TUid aCustomMessageId,
+        const TDesC8& aCustomMessage );
+    virtual void DoDeactivate();
+
+    virtual void HandleCommandL( TInt aCommand );
+        
+private:
+
+    /**
+     * Reference to model.
+     * Not owned.
+     */
+    CAlfPerfAppModel& iModel;
+    
+    /**
+     * Test case factory.
+     * Owned.
+     */
+    CAlfPerfAppTestCaseFactory* iFactory;
+
+    /**
+     * Container control class.
+     */
+    class CContainer;
+    
+    /**
+     * Container object.
+     * Owned.
+     */
+    CContainer* iContainer;
+   
+    /**
+     * Active object class that is used to execute test cases.
+     */
+    class CActiveExecuter;
+     
+    /**
+     * Active object for execution.
+     * Owned.
+     */
+    CActiveExecuter* iExecuter;
+
+    /**
+     * Daemon for performance measurements.
+     * Owned.
+     */
+    RAlfPerfAppDaemon* iDaemon;
+    };
+
+#endif // C_ALFPERFAPPTESTCASEEXECUTIONVIEW_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfapptestcasefactory.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp test case factory class definition.
+*
+*/
+
+
+#ifndef C_ALFPERFAPPTESTCASEFACTORY_H
+#define C_ALFPERFAPPTESTCASEFACTORY_H
+
+#include <e32base.h>
+
+class CAlfPerfAppTestCase;
+
+/**
+ *  CAlfPerfAppTestCaseFactory class.
+ */
+class CAlfPerfAppTestCaseFactory : public CBase
+    {
+public:
+    static CAlfPerfAppTestCaseFactory* NewL();
+    ~CAlfPerfAppTestCaseFactory();
+
+    /**
+     * Creates new test case instance corresponding to the specified id.
+     * @param aCaseId Test case id.
+     * @param aSequenceIndex Tells which iteartion of the same case this is
+     * @return New test case instance. Ownership passed to the client.
+     */
+    CAlfPerfAppTestCase* CreateL( TInt aCaseId, TInt aSequenceIndex );
+
+private:
+
+    CAlfPerfAppTestCaseFactory();
+
+    };
+
+#endif // C_ALFPERFAPPTESTCASEFACTORY_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfapptestcaseselectionview.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,126 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp test case selection view class definition.
+*
+*/
+
+
+#ifndef C_ALFPERFAPPTESTCASESELECTIONVIEW_H
+#define C_ALFPERFAPPTESTCASESELECTIONVIEW_H
+
+#include <aknview.h>
+#include <coecntrl.h>
+#include <eiksbobs.h>
+
+#include "alfperfappmodel.h"
+#include "alfperfappconstants.h"
+
+class CEikRichTextEditor;
+class CEikScrollBarFrame;
+class CAlfPerfAppModel;
+
+/**
+ *  CAlfPerfAppTestCaseSelectionView view class.
+ */
+class CAlfPerfAppTestCaseSelectionView : public CAknView
+    {
+public:
+
+    static CAlfPerfAppTestCaseSelectionView* NewLC( CAlfPerfAppModel& aModel );
+    ~CAlfPerfAppTestCaseSelectionView();
+    
+    /*
+     * Calculates time difference between current and previous.
+     * @param aCurrent current timestamp (ms).
+     * @param aPrevious previous timestamp (ms).
+     * @return time difference (0xFFFFFFFF in case of overflow).
+     */
+    static TUint32 DeltaFromCurrentToPrevious( 
+        TUint32 aCurrent, TUint32 aPrevious );
+
+private:
+
+    CAlfPerfAppTestCaseSelectionView( CAlfPerfAppModel& aModel );
+    void ConstructL();
+
+    /**
+     * Run all test cases.
+     */
+    void CmdRunAllL();
+
+    /**
+     * Run all test cases in continuous loop
+     */
+    void CmdRunAllContinuouslyL();
+    
+    /**
+     * Run all tests from a suite.
+     * @param aSuiteIndex index to suite.
+     */
+    void CmdRunAllFromSuiteL( TInt aSuiteIndex );
+
+    /**
+     * Runs one test case.
+     * @param aSuiteIndex index to suite.
+     * @param aTestCaseIndex test case index inside suite.
+     */	
+    void CmdRunTestCaseL( TInt aSuiteIndex, TInt aTestCaseIndex );
+    
+    void DisplayResultsL();
+
+private:
+
+    // From base class CAknView
+    virtual TUid Id() const;
+    virtual void DoActivateL(
+        const TVwsViewId& aPrevViewId,
+        TUid aCustomMessageId,
+        const TDesC8& aCustomMessage );
+    virtual void DoDeactivate();
+    virtual void HandleCommandL( TInt aCommand );
+    virtual void RestoreMenuL( CCoeControl* aMenuControl, TInt aResourceId,
+        TMenuType aType );
+    virtual void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);  
+    
+    CAlfPerfAppModel::TTestCaseResultItem ResultItemFromLine(TBuf<KAlfPerfAppMaxCharsInLine>& aLine);
+    TBuf8<KAlfPerfAppMaxCharsInLine> getLineFromTargetFile();                      
+
+    void ResetContainerL();
+    
+private:
+
+    /**
+     * Reference to model.
+     * Not owned.
+     */
+    CAlfPerfAppModel& iModel;
+    
+    /**
+     * Container control class.
+     */
+    class CContainer;
+    
+    /**
+     * Container object.
+     */
+    CContainer* iContainer;
+    
+    /**
+     * Current resource id.
+     */
+    TInt iResourceId;
+    };
+
+#endif // C_ALFPERFAPPTESTCASESELECTIONVIEW_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/inc/alfperfapptexttestcase.h	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp text test case class definition.
+*
+*/
+
+
+#ifndef C_ALFPERFAPPTEXTTESTCASE_H
+#define C_ALFPERFAPPTEXTTESTCASE_H
+
+#include <e32base.h>
+#include "alfperfapptestcase.h"
+
+class CAlfPerfAppBaseTestCaseControl;
+
+/**
+ *  CAlfPerfAppTextTestCase class.
+ */
+class CAlfPerfAppTextTestCase : public CAlfPerfAppTestCase
+    {
+public:
+    /**
+     * Returns ETrue if test case is supported.
+     * @param aCaseId test case id.
+     * @return ETrue if supported.
+     */
+    static TBool IsSupported( TInt aCaseId );
+
+    static CAlfPerfAppTextTestCase* NewL( TInt aCaseId, TInt aSequenceIndex );
+    ~CAlfPerfAppTextTestCase();
+
+    // From base class CAlfPerfAppTestCase:
+    virtual void SetupL( 
+        CAlfEnv& aEnv, 
+        const TRect& aVisibleArea, 
+        TRequestStatus& aStatus );
+    virtual void ExecuteL( TRequestStatus& aStatus );
+    virtual void TearDown();   
+    virtual void HandleVisibleAreaChange( const TRect& aRect );
+    virtual TInt CaseID();
+    //To write pointer event lag results
+    virtual TTestCaseSpecificResultText getCaseSpecificResultL();
+private:
+    
+    CAlfPerfAppTextTestCase( TInt aCaseId, TInt aSequenceIndex );
+    void ConstructL();
+
+private:
+    /**
+     * Test case of which execution this instance was created.
+     */ 
+    TInt iCaseId;
+    
+    /**
+     * Alf environment.
+     * Not owned.
+     */
+    CAlfEnv* iEnv;
+
+    /**
+     * Test case control.
+     * Not owned.
+     */
+    CAlfPerfAppBaseTestCaseControl* iControl;
+    
+    /*
+     *  Total Visual Count, used only with sequence cases
+     */
+    TInt iTotalVisualCount;
+    TInt iAnimationDivider;
+    };
+
+
+#endif // C_ALFPERFAPPTEXTTESTCASE_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/rom/alfperfapp.iby	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,103 @@
+/*
+* 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:
+*
+*/
+; ============================================================================
+;  Name        : alfperfapp.iby
+;  Part of     : t_alfperfapp      
+;  Description : Rom image description file for project t_alfperfapp
+;  Version     : %version: 7.1.1 %
+;
+;  Copyright © 2007, 2008 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.
+; ============================================================================
+;
+
+#ifndef ALFPERFAPP_IBY
+#define ALFPERFAPP_IBY
+
+#include <bldvariant.hrh>
+#include <data_caging_paths_for_iby.hrh>
+
+; Files to copy
+
+; AlfPerfApp Application
+file=\epoc32\release\armv5\urel\alfperfapp.exe                               PROGRAMS_DIR\alfperfapp.exe
+data=\epoc32\data\z\private\10003a3f\apps\alfperfapp_reg.rsc                 \private\10003a3f\import\apps\alfperfapp_reg.rsc
+data=\epoc32\data\z\resource\apps\alfperfapp.rsc                             APP_RESOURCE_DIR\alfperfapp.rsc
+data=\epoc32\data\z\resource\apps\alfperfapp_imagetest.mif                   APP_RESOURCE_DIR\alfperfapp_imagetest.mif
+
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfperfapp_imagetest.gif \private\20016B8D\alfperfapp_imagetest.gif
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfperfapp_imagetest.png \private\20016B8D\alfperfapp_imagetest.png
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfperfapp_imagetest.svg \private\20016B8D\alfperfapp_imagetest.svg
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfperfapp_imagetest_NVGCS.mif APP_RESOURCE_DIR\alfperfapp_imagetest_NVGCS.mif
+data=\epoc32\RELEASE\winscw\urel\Z\resource\apps\icons_mif_new2.mif          APP_RESOURCE_DIR\icons_mif_new2.mif
+; Special place for NVG-TLV icons, they won't load correctly otherwise
+data=\epoc32\RELEASE\winscw\urel\Z\data\nvg_mif\3musk.mif                    \data\nvg_mif\3musk.mif
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfperfapp_test1.mbm     \private\20016B8D\alfperfapp_test1.mbm
+
+; Image creation fails because of exceeded memory size?
+; data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos1.jpg    \private\20016B8D\alfphotos1.jpg
+; data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos2.jpg    \private\20016B8D\alfphotos2.jpg
+; data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos3.jpg    \private\20016B8D\alfphotos3.jpg
+; data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos4.jpg    \private\20016B8D\alfphotos4.jpg
+; data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos5.jpg    \private\20016B8D\alfphotos5.jpg
+; data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos6.jpg    \private\20016B8D\alfphotos6.jpg
+; data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos7.jpg    \private\20016B8D\alfphotos7.jpg
+; data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos8.jpg    \private\20016B8D\alfphotos8.jpg
+; data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos9.jpg    \private\20016B8D\alfphotos9.jpg
+; data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\jpg_sun.jpg       \private\20016B8D\jpg_sun.jpg
+; data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos_2mpx.jpg \private\20016B8D\alfphotos_2mpx.jpg
+; data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos_vga.jpg \private\20016B8D\alfphotos_vga.jpg
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos_5mpx.jpg  \private\20016B8D\alfphotos_5mpx.jpg
+
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos_small1.jpg \private\20016B8D\alfphotos_small1.jpg
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos_small2.jpg \private\20016B8D\alfphotos_small2.jpg
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos_small3.jpg \private\20016B8D\alfphotos_small3.jpg
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos_small4.jpg \private\20016B8D\alfphotos_small4.jpg
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos_small5.jpg \private\20016B8D\alfphotos_small5.jpg
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos_small6.jpg \private\20016B8D\alfphotos_small6.jpg
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos_small7.jpg \private\20016B8D\alfphotos_small7.jpg
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos_small8.jpg \private\20016B8D\alfphotos_small8.jpg
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\alfphotos_small9.jpg \private\20016B8D\alfphotos_small9.jpg
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\jpg_sun_small.jpg    \private\20016B8D\jpg_sun_small.jpg
+
+; App suite images
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\people.png          \private\20016B8D\people.png
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\jim.png             \private\20016B8D\jim.png
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\mtv3.png            \private\20016B8D\mtv3.png
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\mtv3_scifi.png      \private\20016B8D\mtv3_scifi.png
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\nelonen.png         \private\20016B8D\nelonen.png
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\discoveryhd.png     \private\20016B8D\discoveryhd.png
+data=\epoc32\RELEASE\winscw\urel\Z\private\20016B8D\nationalgeographic.jpg  \private\20016B8D\nationalgeographic.jpg
+
+; AlfPerfAppDaemon - Daemon for AlfPerfApp
+file=\epoc32\release\armv5\urel\alfperfappdaemon.exe                    PROGRAMS_DIR\alfperfappdaemon.exe
+data=\epoc32\data\z\private\10003a3f\apps\alfperfappdaemon_reg.rsc      \private\10003a3f\import\apps\alfperfappdaemon_reg.rsc
+data=\epoc32\data\z\resource\apps\alfperfappdaemon.rsc                  APP_RESOURCE_DIR\alfperfappdaemon.rsc
+
+; AlfDebugExtension
+file=\epoc32\release\armv5\urel\alfdebug.dll                            SHARED_LIB_DIR\alfdebug.dll
+ECOM_PLUGIN(alfdebugserver.dll, alfdebugserver.rsc)
+//file=\epoc32\release\armv5\urel\alfdebugserver.dll                    \sys\bin\alfdebugserver.dll
+//data=\epoc32\data\z\resource\plugins\alfdebugserver.rsc               \resource\plugins\alfdebugserver.rsc
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/sis/alfperfapp.pkg	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,110 @@
+;
+; 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:
+;
+; ============================================================================
+;  Name        : t_alfperfapp.pkg
+;  Part of     : t_alfperfapp      
+;  Description : Package file for project t_alfperfapp
+;  Version     : %version: %
+;
+;  Copyright © 2007, 2008 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.
+; ============================================================================
+;
+
+;Language - standard language definitions
+&EN
+
+; standard SIS file header
+#{"AlfPerfApp"},(0x20016B8D),1,0,0
+
+;Supports Series 60 v 3.0
+(0x101F7961), 0, 0, 0, {"Series60ProductID"}
+
+;Localized Vendor Name
+%{"My Test EN"}
+
+;Unique Vendor name
+:"Vendor"
+
+; Files to copy
+
+; alfperfapp application
+"\epoc32\release\armv5\urel\alfperfapp.exe"-"!:\sys\bin\alfperfapp.exe"
+"\epoc32\data\z\private\10003a3f\apps\alfperfapp_reg.rsc"-"!:\private\10003a3f\import\apps\alfperfapp_reg.rsc"
+"\epoc32\data\z\resource\apps\alfperfapp.rsc"-"!:\resource\apps\alfperfapp.rsc"
+
+; Test case images
+"\epoc32\data\z\resource\apps\alfperfapp_imagetest.mif"-"!:\resource\apps\alfperfapp_imagetest.mif"
+"..\gfx\alfperfapp_imagetest.gif"-"!:\private\20016B8D\alfperfapp_imagetest.gif"
+"..\gfx\alfperfapp_imagetest.png"-"!:\private\20016B8D\alfperfapp_imagetest.png"
+"..\gfx\alfperfapp_imagetest.svg"-"!:\private\20016B8D\alfperfapp_imagetest.svg"
+; Mif files can't go to apps private dir, since they have to be loaded by AknIconSrv
+"..\gfx\alfperfapp_imagetest_NVGCS.mif"-"!:\resource\apps\alfperfapp_imagetest_NVGCS.mif"
+"..\gfx\icons_mif_new2.mif"-"!:\resource\apps\icons_mif_new2.mif"
+; Special place for NVG-TLV icons, they won't load correctly otherwise
+"..\gfx\3musk.mif"-"!:\data\nvg_mif\3musk.mif"
+"..\gfx\alfperfapp_test1.mbm"-"!:\private\20016B8D\alfperfapp_test1.mbm"
+
+"..\gfx\alfphotos1.jpg"-"!:\private\20016B8D\alfphotos1.jpg"
+"..\gfx\alfphotos2.jpg"-"!:\private\20016B8D\alfphotos2.jpg"
+"..\gfx\alfphotos3.jpg"-"!:\private\20016B8D\alfphotos3.jpg"
+"..\gfx\alfphotos4.jpg"-"!:\private\20016B8D\alfphotos4.jpg"
+"..\gfx\alfphotos5.jpg"-"!:\private\20016B8D\alfphotos5.jpg"
+"..\gfx\alfphotos6.jpg"-"!:\private\20016B8D\alfphotos6.jpg"
+"..\gfx\alfphotos7.jpg"-"!:\private\20016B8D\alfphotos7.jpg"
+"..\gfx\alfphotos8.jpg"-"!:\private\20016B8D\alfphotos8.jpg"
+"..\gfx\alfphotos9.jpg"-"!:\private\20016B8D\alfphotos9.jpg"
+"..\gfx\alfphotos_5mpx.jpg"-"!:\private\20016B8D\alfphotos_5mpx.jpg"
+"..\gfx\alfphotos_2mpx.jpg"-"!:\private\20016B8D\alfphotos_2mpx.jpg"
+"..\gfx\alfphotos_vga.jpg"-"!:\private\20016B8D\alfphotos_vga.jpg"
+"..\gfx\jpg_sun.jpg"-"!:\private\20016B8D\jpg_sun.jpg"
+
+; Small images for Open VG for multiple image test cases
+"..\gfx\alfphotos_small1.jpg"-"!:\private\20016B8D\alfphotos_small1.jpg"
+"..\gfx\alfphotos_small2.jpg"-"!:\private\20016B8D\alfphotos_small2.jpg"
+"..\gfx\alfphotos_small3.jpg"-"!:\private\20016B8D\alfphotos_small3.jpg"
+"..\gfx\alfphotos_small4.jpg"-"!:\private\20016B8D\alfphotos_small4.jpg"
+"..\gfx\alfphotos_small5.jpg"-"!:\private\20016B8D\alfphotos_small5.jpg"
+"..\gfx\alfphotos_small6.jpg"-"!:\private\20016B8D\alfphotos_small6.jpg"
+"..\gfx\alfphotos_small7.jpg"-"!:\private\20016B8D\alfphotos_small7.jpg"
+"..\gfx\alfphotos_small8.jpg"-"!:\private\20016B8D\alfphotos_small8.jpg"
+"..\gfx\alfphotos_small9.jpg"-"!:\private\20016B8D\alfphotos_small9.jpg"
+"..\gfx\jpg_sun_small.jpg"-"!:\private\20016B8D\jpg_sun_small.jpg"
+
+; app suite images
+"..\gfx\people.png"                       -"!:\private\20016B8D\people.png"
+"..\gfx\jim.png"                          -"!:\private\20016B8D\jim.png"
+"..\gfx\mtv3.png"                         -"!:\private\20016B8D\mtv3.png"
+"..\gfx\mtv3_scifi.png"                   -"!:\private\20016B8D\mtv3_scifi.png"
+"..\gfx\nelonen.png"                      -"!:\private\20016B8D\nelonen.png"
+"..\gfx\discoveryhd.png"                  -"!:\private\20016B8D\discoveryhd.png"
+"..\gfx\nationalgeographic.jpg"           -"!:\private\20016B8D\nationalgeographic.jpg"
+
+; alfperfappdaemon - daemon for alfperfapp
+"\epoc32\release\armv5\urel\alfperfappdaemon.exe"-"!:\sys\bin\alfperfappdaemon.exe"
+"\epoc32\data\z\private\10003a3f\apps\alfperfappdaemon_reg.rsc"-"!:\private\10003a3f\import\apps\alfperfappdaemon_reg.rsc"
+"\epoc32\data\z\resource\apps\alfperfappdaemon.rsc"-"!:\resource\apps\alfperfappdaemon.rsc"
+
+; alfdebugextension
+"\epoc32\release\armv5\urel\alfdebug.dll"-"!:\sys\bin\alfdebug.dll"
+"\epoc32\release\armv5\urel\alfdebugserver.dll"-"!:\sys\bin\alfdebugserver.dll"
+"\epoc32\data\z\resource\plugins\alfdebugserver.rsc"-"!:\resource\plugins\alfdebugserver.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/sis/createsisx.bat	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,19 @@
+@echo off
+rem
+rem Copyright (c) 2009 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 Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+makesis alfperfapp.pkg
+signsis alfperfapp.sis alfperfapp.sisx ..\..\..\internal\certificates\rd.cer ..\..\..\internal\certificates\rd-key.pem
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappapplication.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAlfPerfAppApplication implementation.
+*
+*/
+
+
+// INCLUDE FILES
+#include <eikstart.h>
+
+#include "alfperfappapplication.h"
+#include "alfperfappdocument.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+CApaDocument* CAlfPerfAppApplication::CreateDocumentL()
+    {
+    CAlfPerfAppDocument* document = new (ELeave) CAlfPerfAppDocument( *this );
+    CleanupStack::PushL( document );
+    document->ConstructL();
+    CleanupStack::Pop( document );
+    return document;
+    }
+
+TUid CAlfPerfAppApplication::AppDllUid() const
+    {
+    return KAlfPerfAppUid;
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CAlfPerfAppApplication;
+    }
+
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication( NewApplication );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappappui.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAlfPerfAppAppUi implementation
+*
+*/
+
+
+#include <avkon.hrh>
+#include <alfperfapp.rsg>
+#include "alfperfappappui.h"
+#include "alfperfappmodel.h"
+
+#include "alfperfapptestcaseselectionview.h"
+#include "alfperfapptestcaseexecutionview.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+CAlfPerfAppAppUi::CAlfPerfAppAppUi( CAlfPerfAppModel& aModel )
+    : iModel( aModel )
+    {
+    }
+
+CAlfPerfAppAppUi::~CAlfPerfAppAppUi()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// Constructs the application.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppAppUi::ConstructL()
+    {
+    CAknViewAppUi::BaseConstructL( EAknEnableSkin | EAknEnableMSK );
+    iModel.LoadTestSetL( R_ALFPERFAPP_TESTSET );
+
+    CAlfPerfAppTestCaseSelectionView* selectionView = 
+        CAlfPerfAppTestCaseSelectionView::NewLC( iModel );
+    AddViewL( selectionView );
+    CleanupStack::Pop( selectionView );
+    SetDefaultViewL( *selectionView );
+    
+    CAlfPerfAppTestCaseExecutionView* executionView =
+        CAlfPerfAppTestCaseExecutionView::NewLC( iModel );
+    AddViewL( executionView );
+    CleanupStack::Pop( executionView );
+    }
+
+// -----------------------------------------------------------------------------
+// Common commands are handled here.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppAppUi::HandleCommandL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+        case EAknSoftkeyExit:
+        case EAknCmdExit:
+        case EEikCmdExit:
+            Exit();
+            break;
+
+        default:
+            break;
+        }
+    }
+
+void CAlfPerfAppAppUi::HandleResourceChangeL( TInt aType )
+    {
+    CAknViewAppUi::HandleResourceChangeL( aType );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappavkontestcase.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,707 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAlfPerfAppAvkonTestCase implementation.
+*
+*/
+
+
+#include "alfperfappbasetestcasecontrol.h"
+#include "alfperfappavkontestcase.h"
+#include "alfperfapp.hrh"
+
+#include <aknutils.h>
+#include <e32math.h>
+
+#include <coemain.h>
+#include <coecntrl.h>
+#include <eikapp.h>
+
+#include <alf/alfenv.h>
+#include <alf/alfevent.h>
+#include <alf/alfdisplay.h>
+#include <alf/alfcontrolgroup.h>
+#include <alf/alfroster.h>
+
+/**
+ * Control group for Avkon test cases.
+ */
+const TInt KAlfPerfAppAvkonControlGroup = 1;
+
+/**
+ * Start next 'cycle' command.
+ */
+const TInt KAlfPerfAppAvkonCmdNext = 0x5001;
+
+/**
+ * Delay between frames
+ */
+const TInt KAnimSleepTimeUs = 0;
+
+/**
+ * Cycle time, contais several frames
+ */
+const TInt KCycleDurationMs = 1000;
+
+/**
+ * The whole test case duration
+ */
+const TInt KCaseDurationMs = KCycleDurationMs * 10;
+
+/**
+ * Avkon test coe control
+ */
+
+class CAvkonTestCoeControl: public CCoeControl
+{
+public:
+    // Construction & destruction
+    CAvkonTestCoeControl();
+    ~CAvkonTestCoeControl();
+    void ConstructL(const TRect& aRect);
+    RWindow* GetWindow();
+
+private:
+
+    // from CCoeControl
+    void Draw(const TRect&) const;
+    TInt CountComponentControls() const {return 0;}
+    CCoeControl* ComponentControl( TInt /*aIndex*/ ) const {return NULL;}
+
+public: 
+    
+};
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+CAvkonTestCoeControl::CAvkonTestCoeControl()
+    {
+    }
+
+
+void CAvkonTestCoeControl::ConstructL(const TRect& aRect)
+    {
+    // Create window
+    CreateWindowL();
+    SetRect(aRect);
+    ActivateL();
+    }
+
+CAvkonTestCoeControl::~CAvkonTestCoeControl()
+    {
+    }
+
+RWindow* CAvkonTestCoeControl::GetWindow()
+    {
+    return &Window();   
+    }
+
+
+void CAvkonTestCoeControl::Draw(const TRect& /*aRect*/) const
+    {
+    }
+
+/**
+ * Basic WindGC tests.
+ */
+class CAlfPerfAppAvkonTestCaseBasic : public CAlfPerfAppBaseTestCaseControl
+    {
+public:
+    CAlfPerfAppAvkonTestCaseBasic();
+    ~CAlfPerfAppAvkonTestCaseBasic();
+    
+    virtual void ConstructL( 
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea );      
+    virtual void DoStartExecuteL();
+    virtual TBool OfferEventL( const TAlfEvent& aEvent );
+    virtual void SetVisibleArea( const TRect& aVisibleArea );    
+
+    /**
+     * animation timer callback
+     */
+    static TInt AnimTimerCbL(TAny* aThis);
+   
+    /**
+     * Calculate fps for the current phase
+     */
+    double CalcPhaseFpsL();   
+    
+private:
+    
+    /**
+     * Next cycle.
+     */
+    void NextCycleL();
+    
+    /**
+     * Next frame inside cycle
+     */
+    void NextAnimFrameL();
+
+private:
+       
+    CAvkonTestCoeControl* iAvkonControl; // Owned
+    TRect iWinRect;
+ 
+private:
+
+   /**
+     * Cycle counter.
+     */        
+    TInt iCycleCounter;
+    
+    /**
+     * animation timer
+     */        
+   CPeriodic* iAnimTimer;
+    
+   /**
+    * Current frame number
+    */        
+    TInt iAnimFrameNum;
+    
+    /**
+     * 
+     */        
+    TTime iCycleStartTime;
+
+    /**
+     * Font
+     */        
+    CFont* iFont;
+
+    /**
+     * Test bitmap and mask 
+     */        
+    CFbsBitmap* iPictureBm;
+    CFbsBitmap* iMaskBm;
+
+    /**
+     * Client performace data
+     */        
+   TTime iTestCaseStartTime_ys;
+   TUint iTestCaseFrameCount;
+};
+        
+        
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// Checks if specified case is supported by this class.
+// -----------------------------------------------------------------------------
+//
+TBool CAlfPerfAppAvkonTestCase::IsSupported( TInt aCaseId )
+    {
+    return aCaseId > EAlfPerfAppAvkonMin && 
+           aCaseId < EAlfPerfAppAvkonMax;
+    }
+
+CAlfPerfAppAvkonTestCase* CAlfPerfAppAvkonTestCase::NewL( TInt aCaseId, TInt aSequenceIndex )
+    {
+    if ( !IsSupported( aCaseId ) )
+        {
+        User::Leave( KErrNotSupported );
+        }
+
+    CAlfPerfAppAvkonTestCase* self = 
+        new (ELeave) CAlfPerfAppAvkonTestCase( aCaseId, aSequenceIndex );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CAlfPerfAppAvkonTestCase::~CAlfPerfAppAvkonTestCase()
+    {
+    if ( iEnv && iControl )
+        {
+        iControl->CancelExecution();
+        iEnv->DeleteControlGroup( KAlfPerfAppAvkonControlGroup );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// Starts setup phase.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppAvkonTestCase::SetupL( 
+        CAlfEnv& aEnv, const TRect& /*aVisibleArea*/, TRequestStatus& aStatus )
+    {
+    // Note: we could remove usage of Alf client API as it is not mandatory for the test case
+    
+    iEnv = &aEnv;
+
+    CAlfDisplay* display = 0;
+    CAlfControlGroup& group = iEnv->NewControlGroupL( KAlfPerfAppAvkonControlGroup );
+    CAlfPerfAppBaseTestCaseControl* control = 0;
+    
+    TRect rect;
+    AknLayoutUtils::LayoutMetricsRect(
+        AknLayoutUtils::EApplicationWindow,
+        rect );
+    display = &iEnv->NewDisplayL( rect, CAlfEnv::ENewDisplayAsCoeControl);
+    display->SetClearBackgroundL( CAlfDisplay::EClearWithSkinBackground );
+
+    switch ( iCaseId )
+        {
+        case EAlfPerfAppAvkonBasicWinGc:
+            control = new (ELeave) CAlfPerfAppAvkonTestCaseBasic;
+            CleanupStack::PushL( control );
+            control->ConstructL( *iEnv, iCaseId, rect );
+            break;
+            
+        default:
+            User::Leave( KErrNotSupported );
+            break;
+        }
+
+    group.AppendL( control ); // ownership passed to control group.
+    iControl = control;
+    CleanupStack::Pop( control );    
+    
+    display->Roster().ShowL( group );
+    
+    // This must be the last statement.
+    CAlfPerfAppTestCase::CompleteNow( aStatus, KErrNone );
+    }
+
+// -----------------------------------------------------------------------------
+// Starts execution phase.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppAvkonTestCase::ExecuteL( TRequestStatus& aStatus )
+    {
+    // SetupL must have been called first.
+    __ASSERT_ALWAYS( iEnv, User::Invariant() );
+    __ASSERT_ALWAYS( iControl, User::Invariant() );
+    
+    iControl->StartExecuteL( aStatus );
+    }
+
+// -----------------------------------------------------------------------------
+// Tears down.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppAvkonTestCase::TearDown()
+    {
+    // Execution side will delete CAlfEnv, so it will delete everything
+    // related to this.
+    iEnv = NULL;
+    iControl = NULL;
+    }
+
+void CAlfPerfAppAvkonTestCase::HandleVisibleAreaChange( const TRect& /*aRect*/ )
+    {
+    }
+
+TInt CAlfPerfAppAvkonTestCase::CaseID()
+    {
+    return iCaseId;
+    }
+
+CAlfPerfAppAvkonTestCase::CAlfPerfAppAvkonTestCase( TInt aCaseId, TInt aSequenceIndex )
+    : CAlfPerfAppTestCase(aSequenceIndex), iCaseId ( aCaseId )
+    {
+    }
+
+void CAlfPerfAppAvkonTestCase::ConstructL()
+    {
+    }
+
+TTestCaseSpecificResultText CAlfPerfAppAvkonTestCase::getCaseSpecificResultL()
+    {
+    TTestCaseSpecificResultText result = HBufC::NewL(KAlfPerfAppMaxCharsInSpecificResultText);
+    double fps = 0.0;
+    if (iControl)
+        {
+        fps = ((CAlfPerfAppAvkonTestCaseBasic*)iControl)->CalcPhaseFpsL();
+        }
+    result->Des().AppendFormat(_L("Client fps: %3.2f"), fps);
+    return result;        
+    }
+
+// ********
+
+// Implementation of CAlfPerfAppAvkonTestCaseBasic:
+CAlfPerfAppAvkonTestCaseBasic::CAlfPerfAppAvkonTestCaseBasic()
+    {
+    }
+
+CAlfPerfAppAvkonTestCaseBasic::~CAlfPerfAppAvkonTestCaseBasic()
+    {
+    delete iPictureBm;
+    delete iMaskBm;
+    
+   if (iFont)
+        {
+        CCoeEnv::Static()->ScreenDevice()->ReleaseFont(iFont);
+        }
+    delete iAnimTimer;
+    delete iAvkonControl;    
+    }
+
+void CAlfPerfAppAvkonTestCaseBasic::ConstructL( 
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea )
+    {
+    CAlfPerfAppBaseTestCaseControl::ConstructL( aEnv, aCaseId, aVisibleArea );   
+    
+    iWinRect = aVisibleArea;
+    
+    iAvkonControl = new(ELeave) CAvkonTestCoeControl();
+    iAvkonControl->ConstructL(iWinRect);
+
+    iAnimTimer = CPeriodic::NewL(CActive::EPriorityStandard);
+    
+    TFontSpec myFontSpec(_L("Arial"), 3*120);
+    CCoeEnv::Static()->ScreenDevice()->GetNearestFontInTwips(iFont, myFontSpec);
+    
+    // Find my private path
+    TFileName pathWithoutDrive;
+    TFileName driveAndPath;
+    CEikonEnv::Static()->FsSession().PrivatePath( pathWithoutDrive );
+    driveAndPath.Copy(CEikonEnv::Static()->EikAppUi()->Application()->AppFullName().Left(2));
+    driveAndPath.Append(pathWithoutDrive);
+    
+    // Create pictures
+    iPictureBm = new(ELeave) CFbsBitmap;
+    driveAndPath.Append(_L("alfperfapp_test1.mbm"));
+    User::LeaveIfError(iPictureBm->Load(driveAndPath));
+    iMaskBm = new(ELeave) CFbsBitmap;
+    User::LeaveIfError(iMaskBm->Create(iPictureBm->SizeInPixels(), EGray256));
+ 
+    iTestCaseStartTime_ys.UniversalTime();
+    iTestCaseFrameCount = 0;
+   }
+    
+
+void CAlfPerfAppAvkonTestCaseBasic::DoStartExecuteL()
+    {
+    iTestCaseStartTime_ys.UniversalTime();
+    iTestCaseFrameCount = 0;
+    
+    NextCycleL();
+    
+    CompleteAfterL( KCaseDurationMs );
+    }
+
+void CAlfPerfAppAvkonTestCaseBasic::SetVisibleArea( 
+        const TRect& /*aVisibleArea*/ )
+    {
+    if ( IsExecutionOngoing() )
+        {
+        Env().CancelCustomCommands( this, KAlfPerfAppAvkonCmdNext );
+        TRAPD( err, NextCycleL() );
+        if ( err != KErrNone )
+            {
+            CompleteNow( err );
+            }
+        }
+    }
+
+TBool CAlfPerfAppAvkonTestCaseBasic::OfferEventL( const TAlfEvent& aEvent )
+    {
+    if ( aEvent.IsCustomEvent() && 
+         aEvent.CustomParameter() == KAlfPerfAppAvkonCmdNext )
+        {
+        TRAPD( err, NextCycleL() );
+        if ( err != KErrNone )
+            {
+            CompleteNow( err );
+            }
+        return ETrue;
+        }    
+    return CAlfPerfAppBaseTestCaseControl::OfferEventL( aEvent );
+    }
+
+void CAlfPerfAppAvkonTestCaseBasic::NextCycleL()
+    {
+    TAlfCustomEventCommand command( KAlfPerfAppAvkonCmdNext, this );
+    User::LeaveIfError( Env().Send( command, KCycleDurationMs ) );
+    
+    iCycleCounter++;
+   
+    iAnimTimer->Cancel();
+    iAnimTimer->Start(KAnimSleepTimeUs, KAnimSleepTimeUs, TCallBack(AnimTimerCbL, this));
+    iAnimFrameNum = 0;
+    iCycleStartTime.UniversalTime();
+    }
+
+
+TInt CAlfPerfAppAvkonTestCaseBasic::AnimTimerCbL(TAny* aThis)
+        {
+        static_cast<CAlfPerfAppAvkonTestCaseBasic*>(aThis)->NextAnimFrameL();
+        return NULL;
+        }
+
+void CAlfPerfAppAvkonTestCaseBasic::NextAnimFrameL()
+    {
+    // Begin drawing
+    RWindow& window = static_cast< RWindow& >( *iAvkonControl->DrawableWindow() );
+    CWindowGc& gc = iAvkonControl->SystemGc();
+    TRect updateRect(iAvkonControl->Rect());
+    window.Invalidate( updateRect );
+    window.BeginRedraw( updateRect );
+    gc.Activate(window);
+
+    // Draw background
+    TRgb color (KRgbWhite);
+    gc.SetBrushColor(color);
+    gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
+    gc.SetPenStyle(CGraphicsContext::ESolidPen);
+    gc.SetPenSize(TSize(10,10));
+    gc.SetPenColor(color);    
+    gc.DrawRect(updateRect);  
+       
+    // Calc timeline
+    TTime now;
+    now.UniversalTime();
+    TUint millisecondFromCycleStart = now.MicroSecondsFrom(iCycleStartTime).Int64() / 1000;
+    double timelinePercentage = (double)millisecondFromCycleStart / KCycleDurationMs; 
+    timelinePercentage *= 0.5; // scale it a bit...
+   
+    // Calc rect
+    TRect fullRect(updateRect);
+    TSize size(fullRect.Width()*(1.0 - timelinePercentage), fullRect.Height()*(1.0 - timelinePercentage));
+    TPoint windowCenter = fullRect.Center();
+    TPoint tl(windowCenter.iX - size.iWidth/2, windowCenter.iY - size.iHeight/2);
+    TRect rect(tl, size);
+        
+    // Draw
+    gc.SetPenColor(KRgbBlue);
+    gc.SetBrushColor(KRgbRed);
+    const TPoint Point1(rect.iTl);
+    const TPoint Point2(rect.iBr.iX, rect.iTl.iY);
+    const TPoint Point3(rect.iBr);
+    const TPoint Point4(rect.iTl.iX, rect.iBr.iY);
+    const TPoint center(rect.Center());
+
+    switch (iCycleCounter)
+        {
+        case 1: // DrawEllipse
+            {
+            gc.DrawEllipse(rect);   
+            break;
+            }
+        case 2: // DrawRect
+            {
+            gc.DrawRect(rect);    
+            break;
+            }
+        case 3: // DrawRoundRect
+            {
+            TSize corner(rect.Width()/5, rect.Height()/5);
+            gc.DrawRoundRect(rect, corner);   
+            break;
+            }
+        case 4: // Draw lines
+            {
+            gc.SetPenColor(TRgb(255,0,0));
+            gc.DrawLine(Point1, Point2);       
+            
+            gc.SetPenColor(TRgb(200,50,0));
+            gc.DrawLineTo(Point3);
+            
+            gc.SetPenColor(TRgb(150,100,0));
+            gc.DrawLineTo(Point4);
+            
+            gc.SetPenColor(TRgb(100,150,0));
+            gc.DrawLineBy(TPoint(0, -rect.Height()));
+            
+            gc.SetPenColor(TRgb(50,200,0));
+            gc.MoveTo(Point2);
+            gc.DrawLineTo(Point4);
+                       
+            gc.SetPenColor(TRgb(0,255,0));
+            gc.MoveBy(TPoint(0, -rect.Height()));
+            gc.DrawLineTo(Point3);
+            
+            gc.SetPenColor(TRgb(255,0,0));
+            gc.Plot(center);
+            
+            break;
+           }
+            
+        case 5: // Draw 
+            {
+            gc.SetPenColor(TRgb(255,0,0));
+            gc.DrawArc(rect, Point2, Point1);
+            gc.DrawPie(rect, Point4, Point3);
+            break;
+            }
+            
+        case 6: // Draw polygons
+            {
+            const TInt KNumPoints = 9;
+            TPoint pointList[KNumPoints];
+            pointList[0] = TPoint(Point1.iX+rect.Width()*0.25, Point1.iY);
+            pointList[1] = TPoint(Point1.iX+rect.Width()*0.75, Point1.iY);
+            pointList[2] = TPoint(Point2.iX, Point2.iY+rect.Height()*0.25);
+            pointList[3] = TPoint(Point2.iX, Point2.iY+rect.Height()*0.75);
+            pointList[4] = TPoint(Point3.iX-rect.Width()*0.25, Point3.iY);
+            pointList[5] = TPoint(Point3.iX-rect.Width()*0.75, Point3.iY);
+            pointList[6] = TPoint(Point4.iX, Point4.iY-rect.Height()*0.25);
+            pointList[7] = TPoint(Point4.iX, Point4.iY-rect.Height()*0.75);
+            pointList[8] = TPoint(Point1.iX+rect.Width()*0.25, Point1.iY);
+            
+            CArrayFix<TPoint>* mypoints = new CArrayFixFlat<TPoint>(KNumPoints);
+            CleanupStack::PushL(mypoints);
+            for(TInt i=0; i<KNumPoints; i++)
+                {
+                mypoints->AppendL(pointList[i]);
+                }
+
+            gc.SetPenColor(TRgb(255,0,0));
+            gc.SetPenSize(TSize(20,20));
+            gc.DrawPolyLine(mypoints);
+            
+            gc.SetPenColor(TRgb(0,255,0));
+            gc.SetPenSize(TSize(15,15));
+            gc.DrawPolyLine(pointList, KNumPoints);
+            
+            gc.SetPenColor(TRgb(255,255,0));
+            gc.SetPenSize(TSize(10,10));
+            gc.DrawPolygon(mypoints);
+            
+            gc.SetPenColor(TRgb(0,0,255));
+            gc.SetPenSize(TSize(5,5));
+            gc.DrawPolygon(pointList, KNumPoints);
+            
+            CleanupStack::PopAndDestroy(); // mypoints           
+            break;
+            }
+            
+        case 7: // Draw texts
+            {
+            gc.UseFont(iFont);
+            gc.SetDrawMode(CGraphicsContext::EDrawModePEN);
+            gc.SetPenStyle(CGraphicsContext::ESolidPen);
+            gc.SetBrushStyle(CGraphicsContext::ESolidBrush);    
+            
+            TInt h = rect.Height() / 3;
+            TInt y = rect.iTl.iY;
+            TRect tinyBox(rect);
+            tinyBox.SetHeight(h);
+            TInt fontDescent=iFont->DescentInPixels();
+            gc.SetBrushColor(TRgb(0, 0, 255)); // blue
+            
+            gc.SetPenColor(TRgb(0,255,0)); // green
+            gc.DrawText(_L("Ilves"), tinyBox.iTl+TPoint(0, fontDescent));
+            
+            tinyBox.Move(0,h);
+            TInt posY = tinyBox.Height()-fontDescent;
+            gc.SetPenColor(TRgb(255,0,0)); 
+            gc.DrawText(_L("Tappara"), tinyBox, posY);
+            
+            gc.SetPenColor(TRgb(0,255,0)); // green
+            gc.DrawTextVertical(_L("Ilves"), tinyBox.iTl+TPoint(fontDescent, 0 ), ETrue);
+            
+            tinyBox.Move(0,h);
+            posY = tinyBox.Height()-fontDescent;
+            gc.SetPenColor(TRgb(255,0,0)); 
+            gc.DrawTextVertical(_L("Tappara"), tinyBox, posY, ETrue);
+            
+            break;
+            }
+
+        case 8: // Draw bitmaps
+            {
+            TPoint pos(rect.iTl);
+            gc.BitBlt(pos, iPictureBm);
+            
+            pos = TPoint(rect.iTl.iX + rect.Width()/3, rect.iTl.iY);
+            gc.BitBlt(pos, iPictureBm, TRect(iPictureBm->SizeInPixels()));
+
+            pos = TPoint(rect.iTl.iX + rect.Width()*2/3, rect.iTl.iY);
+            gc.BitBltMasked(pos, iPictureBm, TRect(iPictureBm->SizeInPixels()), iMaskBm, EFalse);
+
+            pos = TPoint(rect.iTl.iX, rect.iTl.iY+ rect.Height()/3);
+            TRect dstRect(pos, TSize(rect.Width()/3, rect.Height()/3));
+            gc.DrawBitmap(dstRect, iPictureBm, TRect(iPictureBm->SizeInPixels()));
+
+            pos = TPoint(rect.iTl.iX + rect.Width()/3, rect.iTl.iY+ rect.Height()/3);
+            dstRect =  TRect(pos, dstRect.Size());
+            gc.DrawBitmap(dstRect, iPictureBm);
+
+            pos = TPoint(rect.iTl.iX, rect.iTl.iY+ rect.Height()*2/3);
+            gc.DrawBitmap(pos, iPictureBm);
+
+            pos = TPoint(rect.iTl.iX + rect.Width()/3, rect.iTl.iY+ rect.Height()*2/3);
+            dstRect =  TRect(pos, dstRect.Size());
+            gc.DrawBitmapMasked(dstRect, iPictureBm, TRect(iPictureBm->SizeInPixels()), iMaskBm, EFalse);
+
+            break;
+            }
+            
+         case 9: // Miscellanious
+            {
+            TRect rect1(rect);
+            rect1.SetWidth(rect.Width()/2);
+            rect1.SetHeight(rect.Height()/2);
+            TRect rect2(rect1);
+            rect2.Move(rect1.Width(),0);
+            TRect rect3(rect1);
+            rect3.Move(0, rect1.Height());
+            TRect rect4(rect1);
+            rect4.Move(rect1.Width(), rect1.Height());
+            
+            // Clear
+            gc.Clear();
+            // Brush pattern
+            gc.UseBrushPattern(iPictureBm);
+            gc.SetBrushStyle(CGraphicsContext::EPatternedBrush);
+            gc.DrawRect(rect1);
+            gc.DiscardBrushPattern();
+            // Fading & copy rect
+            gc.SetFaded(ETrue);
+            gc.CopyRect(rect2.iTl, rect1);
+            gc.SetFadingParameters(255,0);
+            gc.CopyRect(rect3.iTl, rect1);
+            // Map colors  
+            gc.SetPenColor(KRgbBlue);
+            gc.SetBrushColor(KRgbRed);
+            gc.DrawRect(rect4);   
+            TRgb colors[2] = {KRgbRed, KRgbGreen}; // change brush color
+            gc.MapColors(rect4,colors,1,ETrue);
+             
+            break;
+            }
+            
+     default:
+           gc.DrawRect(rect);          
+       }
+
+    // End drawing
+    gc.Deactivate();
+    window.EndRedraw();
+ 
+    iTestCaseFrameCount++;
+    }
+
+
+double CAlfPerfAppAvkonTestCaseBasic::CalcPhaseFpsL()
+    {
+    // Calc time spend in the phase
+    TTime now;
+    now.UniversalTime();
+    TUint millisecondsFromCaseStart = now.MicroSecondsFrom(iTestCaseStartTime_ys).Int64() / 1000;
+    double fps = 0.0;
+    if (millisecondsFromCaseStart)
+        {
+        fps = (double)iTestCaseFrameCount * 1000 / millisecondsFromCaseStart;       
+        }
+    iTestCaseStartTime_ys.UniversalTime();
+    iTestCaseFrameCount = 0;
+    
+    return fps;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappbasetestcasecontrol.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,148 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAlfPerfAppBaseTestCaseControl implementation.
+*
+*/
+
+
+#include "alfperfappbasetestcasecontrol.h"
+#include "alfperfapp.hrh"
+
+#include <aknutils.h>
+#include <alf/alfenv.h>
+#include <alf/alfdisplay.h>
+#include <alf/alfcontrol.h>
+#include <alf/alfcontrolgroup.h>
+#include <alf/alfroster.h>
+#include <alf/alfcommand.h>
+#include <alf/alfevent.h>
+#include <alf/alftexturemanager.h>
+#include <alf/alfimagevisual.h>
+#include <alf/alfimageloaderutil.h>
+#include <alf/alfutil.h>
+#include <alf/alfgridlayout.h>
+#include <alf/alfcurvepathlayout.h>
+#include <alf/alfdecklayout.h>
+#include <alf/alfflowlayout.h>
+#include <alf/alfanchorlayout.h>
+
+#include <alfperfapp_imagetest.mbg>
+
+/**
+ * Complete now command.
+ */
+const TInt KAlfPerfAppCmdCompleteNow = 0x5000;
+
+        
+// ============================ MEMBER FUNCTIONS ===============================
+
+
+// Implementation of CAlfPerfAppBaseTestCaseControl:
+
+static void GetImageTestCasePrivatePath( TFileName& aPath )
+    {
+    CEikonEnv::Static()->FsSession().PrivatePath( aPath );
+    
+    ::CompleteWithAppPath( aPath );
+    }
+
+CAlfPerfAppBaseTestCaseControl::CAlfPerfAppBaseTestCaseControl()  
+    {
+    }
+        
+CAlfPerfAppBaseTestCaseControl::~CAlfPerfAppBaseTestCaseControl()
+    {
+    CompleteNow( KErrCancel );
+    }
+        
+void CAlfPerfAppBaseTestCaseControl::ConstructL( 
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& /*aVisibleArea*/ )
+    {
+    iCaseId = aCaseId;
+    CAlfControl::ConstructL( aEnv );
+    
+    TFileName privatePath;
+    GetImageTestCasePrivatePath( privatePath );
+    aEnv.TextureManager().SetImagePathL( privatePath );
+    }
+        
+void CAlfPerfAppBaseTestCaseControl::StartExecuteL( TRequestStatus& aStatus )
+    {
+    iStatus = &aStatus;
+    *iStatus = KRequestPending;
+    
+    TRAPD( err, DoStartExecuteL() );
+    if ( err != KErrNone )
+        {
+        iStatus = NULL;
+        User::Leave( err );
+        }
+    }
+
+void CAlfPerfAppBaseTestCaseControl::CancelExecution()
+    {
+    CompleteNow( KErrCancel );
+    }
+
+void CAlfPerfAppBaseTestCaseControl::DoStartExecuteL()
+    {
+    CompleteNow( KErrNone );
+    }
+
+void CAlfPerfAppBaseTestCaseControl::SetVisibleArea( 
+        const TRect& /*aVisibleArea*/ )
+    {
+    }
+
+TBool CAlfPerfAppBaseTestCaseControl::OfferEventL( const TAlfEvent& aEvent )
+    {
+    if ( aEvent.IsCustomEvent() && 
+         aEvent.CustomParameter() == KAlfPerfAppCmdCompleteNow )
+        {
+        CompleteNow( KErrNone );
+        return ETrue;
+        }
+        
+    return CAlfControl::OfferEventL( aEvent );
+    }
+        
+void CAlfPerfAppBaseTestCaseControl::CompleteAfterL( TInt aDuration )
+    {
+    // In order to use this service, base class StartExecuteL must
+    // have been called.
+    __ASSERT_ALWAYS( iStatus, User::Invariant() );
+    
+    TAlfCustomEventCommand command( KAlfPerfAppCmdCompleteNow, this );
+    User::LeaveIfError( Env().Send( command, aDuration ) );
+    }
+        
+void CAlfPerfAppBaseTestCaseControl::CompleteNow( TInt aErrorCode )
+    {
+    if ( iStatus )
+        {
+        User::RequestComplete( iStatus, aErrorCode );
+        iStatus = NULL;
+        }
+    }
+/*
+inline TInt CAlfPerfAppBaseTestCaseControl::CaseId() const
+    {
+    return iCaseId;
+    }
+
+inline TBool CAlfPerfAppBaseTestCaseControl::IsExecutionOngoing() const
+    {
+    return ( iStatus != NULL );
+    }
+*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappcovertestcase.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,948 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAlfPerfAppCoverTestCase implementation.
+*
+*/
+
+
+#include "alfperfappcovertestcase.h"
+#include "alfperfapp.hrh"
+
+#include <aknutils.h>
+#include <gdi.h>
+#include <alf/alfenv.h>
+#include <alf/alfdisplay.h>
+#include <alf/alfgc.h>
+#include <alf/alfdisplay.h>
+#include <alf/alfcontrol.h>
+#include <alf/alfcontrolgroup.h>
+#include <alf/alfroster.h>
+#include <alf/alfcommand.h>
+#include <alf/alfevent.h>
+#include <alf/alftexturemanager.h>
+#include <alf/alfimagevisual.h>
+#include <alf/alftextvisual.h>
+#include <alf/alfimageloaderutil.h>
+#include <alf/alfutil.h>
+#include <alf/alflayout.h>
+#include <alf/alfviewportlayout.h>
+#include <alf/alfgridlayout.h>
+#include <alf/alfflowlayout.h>
+#include <alf/alfdecklayout.h>
+#include <alf/alftransformation.h>
+#include <alf/alfgradientbrush.h>
+#include <alf/alfborderbrush.h>
+#include <alf/alfbrusharray.h>
+
+#include <alfperfapp_imagetest.mbg>
+
+#include <alfperfappappui.h>
+
+
+/**
+ * Control group for Cover test cases.
+ */
+const TInt KAlfPerfAppCoverControlGroup = 2;
+
+/**
+ * Complete now command.
+ */
+const TInt KAlfPerfAppCoverCmdCompleteNow = 0x6000;
+
+
+/**
+ * Cover flow test case control.
+ */
+class CAlfPerfAppCoverTestCaseControl : public CAlfControl
+    {
+public:
+        
+    // Common constants
+    static const TInt KTransitionTime;
+    static const TInt KTransitionWaitTime;
+    static const TInt KRotationAngle;
+
+    static CAlfPerfAppCoverTestCaseControl* NewL(
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea );
+
+protected:
+    /**
+     * Constructor.
+     */
+    CAlfPerfAppCoverTestCaseControl();
+        
+    /**
+     * Base class constructor. Derived classes may
+     * override this, but base class needs to be called.
+     */
+    virtual void ConstructL( 
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea );
+        
+public:
+    /**
+     * Destructor.
+     */
+    ~CAlfPerfAppCoverTestCaseControl();
+        
+    /**
+     * Starts execution of the test case. By default,
+     * request status is stored to local variable.
+     */
+    void StartExecuteL( TRequestStatus& aStatus );    
+    
+    /**
+     * Cancels execution. This control and environment will be
+     * deleted soon after calling this method.
+     */
+    void CancelExecution();
+    
+    /**
+     * Starts execution.
+     * If this method leaves, then request must not be completed.
+     * By default, this method completes immediately.
+     */
+    virtual void DoStartExecuteL();
+    
+    /**
+     * Sets visible area.
+     * @param aVisibleArea visible area.
+     */
+    virtual void SetVisibleArea( const TRect& aVisibleArea );    
+    
+    // From base class CAlfControl:
+    
+    /**
+     * Handles events.
+     * Derived classes should forward to base class.
+     * @param aEvent event to be handled.
+     * @return ETrue if consumed, EFalse otherwise.
+     */
+    virtual TBool OfferEventL( const TAlfEvent& aEvent );
+    
+protected:
+    /**
+     * Next cycle.
+     */
+    void NextCycleL();
+
+    /**
+     * Changes the view port left or right according to the given amount. 
+     * The amount can be negative or positive.
+     */
+    void MoveImages( 
+        TReal32 aAmount, 
+        TReal32 aTransitionTime = KTransitionTime );
+
+    /**
+     * Changes the scaling. The current image is scaled to normal size.
+     * The previous image is scaled down. 
+     * This should be called when images are moved.
+     * @see MoveImages
+     */
+    void UpdateScaling( TReal32 aTransitionTime = KTransitionTime );
+    
+    /**
+     * Rotates Image from 0to 360 and 0 to -360 in alternate cycles.
+     */
+    void RotateImage( );
+    
+    /**
+     * Clips the display layout, zooms into the image by scaling it to
+     * multiples of cycle count and also moves the image with X and Y offset of 5.
+     * It gives the Clip, zoom and panning effect to image.
+     */
+    void ClipandZoom( );
+    
+    /**
+     * A way to round floating point number to integer.
+     */
+    TInt RoundFloatToInt( TReal32 aVal );
+    
+    /**
+     * Completes automatically after specified duration.
+     * @param aDuration duration in ms
+     */
+    void CompleteAfterL( TInt aDuration );
+        
+    /**
+     * Completes current request.
+     */
+    void CompleteNow( TInt aErrorCode );
+
+    /**
+     * Returns test case id.
+     */
+    inline TInt CaseId() const;
+        
+    /**
+     * Returns ETrue if test case execution is still ongoing.
+     */
+    inline TBool IsExecutionOngoing() const;
+    
+    /**
+     * Test case id.
+     */
+    TInt iCaseId;
+    
+private:
+    TInt iCycleCount;
+    
+    /**
+     * Pointer to request status.
+     * Not owned.
+     */
+    TRequestStatus* iStatus;
+        
+    CAlfLayout* iLayout;
+    TReal32 iViewportPosition;
+    TReal32 iPreviousViewportPosition;
+    CAlfViewportLayout* iViewport;
+    };
+
+        
+// ============================ MEMBER FUNCTIONS ===============================
+//
+// -----------------------------------------------------------------------------
+// Checks if specified case is supported by this class.
+// -----------------------------------------------------------------------------
+//
+TBool CAlfPerfAppCoverTestCase::IsSupported( TInt aCaseId )
+    {
+    return aCaseId == EAlfPerfAppCover 
+        || aCaseId == EAlfPerfAppCoverLandscape
+        || aCaseId == EAlfPerfAppCoverRotate
+        || aCaseId == EAlfPerfAppCoverClipZoomLargeImage
+        || aCaseId == EAlfPerfAppCoverClipZoomBigImage    
+        || aCaseId == EAlfPerfAppCoverClipZoomVga
+        || aCaseId == EAlfPerfAppCoverClipZoomAutoSize;
+    }
+
+CAlfPerfAppCoverTestCase* CAlfPerfAppCoverTestCase::NewL( TInt aCaseId, TInt aSequenceIndex )
+    {
+    if ( !IsSupported( aCaseId ) )
+        {
+        User::Leave( KErrNotSupported );
+        }
+
+    CAlfPerfAppCoverTestCase* self = 
+        new (ELeave) CAlfPerfAppCoverTestCase( aCaseId, aSequenceIndex);
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CAlfPerfAppCoverTestCase::~CAlfPerfAppCoverTestCase()
+    {
+    if ( iEnv && iControl )
+        {
+        iEnv->TextureManager().RemoveLoadObserver( this );
+        iControl->CancelExecution();
+        iEnv->DeleteControlGroup( KAlfPerfAppCoverControlGroup );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// Starts setup phase.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppCoverTestCase::SetupL( 
+        CAlfEnv& aEnv, const TRect& /*aVisibleArea*/, TRequestStatus& aStatus )
+    {
+    iEnv = &aEnv;
+    // the status pointer is taken for completing it 
+    // when all the images are loaded.
+    iStatus = &aStatus;
+    
+    CAlfPerfAppAppUi* appUi = (CAlfPerfAppAppUi*) EikonEnv()->AppUi();
+    iOrientation = appUi->Orientation();
+    
+    switch ( iCaseId )
+        {
+        case EAlfPerfAppCover:
+            {
+            appUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationPortrait );    
+            break;
+            }
+
+        case EAlfPerfAppCoverLandscape:
+            {
+            appUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape );    
+            break;
+            }
+        case EAlfPerfAppCoverRotate:
+        case EAlfPerfAppCoverClipZoomLargeImage:
+        case EAlfPerfAppCoverClipZoomBigImage:
+        case EAlfPerfAppCoverClipZoomVga:
+        case EAlfPerfAppCoverClipZoomAutoSize:
+            {         
+            break;
+            }    
+        default:
+            User::Leave( KErrNotSupported );
+            break;
+        }
+    
+
+    TRect rect;
+    AknLayoutUtils::LayoutMetricsRect( 
+        AknLayoutUtils::EApplicationWindow, 
+        rect );
+    
+    iEnv->SetFullScreenDrawing( ETrue );
+    CAlfDisplay& display = 
+        iEnv->NewDisplayL( rect, CAlfEnv::ENewDisplayFullScreen );
+
+#if 1
+    // black seems to be the default color
+    display.SetClearBackgroundL( CAlfDisplay::EClearWithColor );
+#else
+    // for development/debugging purposes it is easier to see different
+    // components when there is a background.
+    display.SetClearBackgroundL( CAlfDisplay::EClearWithSkinBackground );
+#endif
+
+    CAlfControlGroup& group = 
+        iEnv->NewControlGroupL( KAlfPerfAppCoverControlGroup );
+
+    iLoadedImages = 0;
+    // the setup phase is completed only after the all images are 
+    // loaded by the texture manager. see the construction of the
+    // control class.
+    aEnv.TextureManager().AddLoadObserverL( this );
+
+    iControl = CAlfPerfAppCoverTestCaseControl::NewL(
+            *iEnv, 
+            iCaseId, 
+            rect );
+
+    TRAPD(error,group.AppendL( iControl );) // ownership passed to control group.
+    if(error != KErrNone)
+        {
+        delete iControl;
+        iControl = 0;
+        }
+    
+    
+    display.Roster().ShowL( group );
+    }
+
+// -----------------------------------------------------------------------------
+// Starts execution phase.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppCoverTestCase::ExecuteL( TRequestStatus& aStatus )
+    {
+    // SetupL must have been called first.
+    __ASSERT_ALWAYS( iEnv, User::Invariant() );
+    __ASSERT_ALWAYS( iControl, User::Invariant() );
+    
+    iControl->StartExecuteL( aStatus );
+    }
+
+// -----------------------------------------------------------------------------
+// Tears down.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppCoverTestCase::TearDown()
+    {
+    CAlfPerfAppAppUi* appUi = (CAlfPerfAppAppUi*) EikonEnv()->AppUi();
+    TRAP_IGNORE( appUi->SetOrientationL( iOrientation ) );    
+
+    // Execution side will delete CAlfEnv, so it will delete everything
+    // related to this.
+    iEnv = NULL;
+    iControl = NULL;
+    }
+
+void CAlfPerfAppCoverTestCase::HandleVisibleAreaChange( const TRect& aRect )
+    {
+    if ( iEnv && iControl )
+        {
+        if ( iEnv->DisplayCount() > 0 )
+            {
+            iEnv->PrimaryDisplay().SetVisibleArea( aRect );
+            }
+
+        iControl->SetVisibleArea( aRect );
+        }
+    }
+  
+TInt CAlfPerfAppCoverTestCase::CaseID()
+    {
+    return iCaseId;
+    }
+
+CAlfPerfAppCoverTestCase::CAlfPerfAppCoverTestCase( TInt aCaseId, TInt aSequenceIndex )
+    : CAlfPerfAppTestCase(aSequenceIndex), iCaseId ( aCaseId )
+    {
+    }
+
+void CAlfPerfAppCoverTestCase::ConstructL()
+    {
+    }
+
+const TInt KNumberOfImages = 4;
+
+void CAlfPerfAppCoverTestCase::TextureLoadingCompleted(
+    CAlfTexture& /*aTexture*/, TInt /*aTextureId*/, TInt aErrorCode)
+    {
+    if( aErrorCode != KErrNone && iStatus )
+        {
+        User::RequestComplete( iStatus, aErrorCode );
+        iStatus = NULL;
+        }
+    iLoadedImages++;
+    TInt noOfImagesToLoad = 1;
+    if( CaseID() == EAlfPerfAppCover || 
+        CaseID() == EAlfPerfAppCoverLandscape )
+        {
+        noOfImagesToLoad = KNumberOfImages;
+        }
+    if ( iStatus && ( iLoadedImages == noOfImagesToLoad ) )
+        {
+        User::RequestComplete( iStatus, KErrNone );
+        iStatus = NULL;
+        }
+    }
+        
+// Implementation of CAlfPerfAppCoverTestCaseControl:
+const TInt CAlfPerfAppCoverTestCaseControl::KTransitionTime = 1000;
+const TInt CAlfPerfAppCoverTestCaseControl::KTransitionWaitTime = 1000;
+const TInt CAlfPerfAppCoverTestCaseControl::KRotationAngle = 360;
+
+CAlfPerfAppCoverTestCaseControl* CAlfPerfAppCoverTestCaseControl::NewL(  
+    CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea )
+    {
+    CAlfPerfAppCoverTestCaseControl* 
+        result = new (ELeave) CAlfPerfAppCoverTestCaseControl;
+    CleanupStack::PushL( result );
+    result->ConstructL( aEnv, aCaseId, aVisibleArea );
+    CleanupStack::Pop();
+    return result;
+    }
+        
+CAlfPerfAppCoverTestCaseControl::CAlfPerfAppCoverTestCaseControl()  
+    {
+    }
+        
+CAlfPerfAppCoverTestCaseControl::~CAlfPerfAppCoverTestCaseControl()
+    {
+    CompleteNow( KErrCancel );
+    }
+
+const TInt KShadowWidth = 20; // in pixels
+
+
+static void AddBorderBrushL( 
+    CAlfEnv& aEnv,
+    CAlfVisual& aVisual, 
+    const TRgb& aColor,
+    TInt aThickness, 
+    TInt aOffset )
+    {
+    aVisual.EnableBrushesL();
+    CAlfBorderBrush* brush = CAlfBorderBrush::NewLC(
+        aEnv,
+        aThickness, 
+        aThickness,
+        aOffset,
+        aOffset );
+    brush->SetColor( aColor );
+    aVisual.Brushes()->AppendL( brush, EAlfHasOwnership );
+    CleanupStack::Pop( brush );
+    }
+
+static void AddFrameL( CAlfEnv& aEnv, CAlfVisual& aVisual )
+    {
+    const TInt KNarrowBorderThickness = 2;
+    const TInt KBorderThickness = 4;
+    AddBorderBrushL( 
+        aEnv, 
+        aVisual, 
+        TRgb( 75, 75, 75 ), 
+        KNarrowBorderThickness, 
+        KNarrowBorderThickness );
+    AddBorderBrushL( 
+        aEnv, 
+        aVisual, 
+        TRgb( 55, 55, 55 ), 
+        KBorderThickness, 
+        KNarrowBorderThickness + KBorderThickness );
+    AddBorderBrushL( 
+        aEnv, 
+        aVisual, 
+        TRgb( 25, 25, 25 ), 
+        KNarrowBorderThickness, 2*KNarrowBorderThickness + KBorderThickness );
+    }
+
+const TReal32 KFocusedImageScale = 1.0f;
+const TReal32 KSmallImageScale = .65f;
+
+static void DownScaleImageL( CAlfVisual& aVisual, TInt aTransitionTime )
+    {
+    TAlfTimedValue presser;
+    presser.SetValueNow( KFocusedImageScale );
+    presser.SetTarget( KSmallImageScale, aTransitionTime );
+    CAlfTransformation& lessening = aVisual.Transformation();
+    lessening.LoadIdentity();
+    lessening.Scale( presser, presser );
+    }
+
+static CAlfGridLayout* AddItemL( 
+    CAlfEnv& aEnv,
+    CAlfControl& aControl, 
+    CAlfLayout& aLayout, 
+    CAlfTexture& aTexture )
+    {
+    // grid size: two lines, one item on the line
+    CAlfGridLayout* item = CAlfGridLayout::AddNewL( aControl, 1, 1, &aLayout );
+
+    // solid background for the item
+    item->EnableBrushesL();
+    CAlfGradientBrush* brush = CAlfGradientBrush::NewLC( aEnv );
+    brush->SetColor( TRgb( 60, 60, 60 ) ); // some gray
+    item->Brushes()->AppendL( brush, EAlfHasOwnership );
+    CleanupStack::Pop( brush );
+    
+    RArray<TInt> weights;
+    CleanupClosePushL( weights );
+    // this makes the image space much larger than the text box below it.
+    User::LeaveIfError( weights.Append( 100 ) );
+    User::LeaveIfError( weights.Append( 15 ) );
+    item->SetRowsL( weights );
+    CleanupStack::PopAndDestroy();
+    
+    CAlfImageVisual* visual = CAlfImageVisual::AddNewL( aControl, item );
+    visual->SetImage( TAlfImage( aTexture ) );
+    visual->EnableTransformationL();
+
+    return item;
+    }
+
+static CAlfGridLayout* AddItemTextL( 
+    CAlfControl& aControl, 
+    CAlfLayout& aParent, 
+    const TDesC& aArtist,
+    const TDesC& aTitle )
+    {
+    // creates a grid for holding text lines.
+    // grid size: two lines, one item on the line
+    CAlfGridLayout* texts = CAlfGridLayout::AddNewL( aControl, 1, 2, &aParent );
+    texts->EnableTransformationL();
+
+    CAlfTextVisual* upper = CAlfTextVisual::AddNewL( aControl, texts );
+    upper->SetStyle( EAlfTextStyleNormal, EAlfBackgroundTypeDark );
+    upper->SetWrapping( CAlfTextVisual::ELineWrapTruncate );
+    upper->SetTextL( aArtist );
+    CAlfTextVisual* lower = CAlfTextVisual::AddNewL( aControl, texts );
+    lower->SetStyle( EAlfTextStyleSmall );
+    lower->SetWrapping( CAlfTextVisual::ELineWrapTruncate );
+    lower->SetTextL( aTitle );
+
+    return texts;
+    }
+
+static void GetImageTestCasePrivatePath( TFileName& aPath )
+    {
+    CEikonEnv::Static()->FsSession().PrivatePath( aPath );
+    ::CompleteWithAppPath( aPath );
+    }
+
+const TReal32 KViewportOffset = -.25f;
+const TReal32 KViewportOffsetY = -.25f;
+
+void CAlfPerfAppCoverTestCaseControl::ConstructL( 
+    CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea )
+    {
+    iCaseId = aCaseId;
+    CAlfControl::ConstructL( aEnv );
+
+    TFileName privatePath;
+    GetImageTestCasePrivatePath( privatePath );
+    aEnv.TextureManager().SetImagePathL( privatePath );
+
+    // this is the top most visual
+    CAlfDeckLayout* top = CAlfDeckLayout::AddNewL( *this );
+
+    // view port for scrolling
+    // this viewport needs to be added first for the deck
+    // to be under the shadows.
+    iViewport = CAlfViewportLayout::AddNewL( *this, top );
+    iViewport->SetClipping( EFalse );
+    
+    iViewport->SetViewportSize( TAlfRealSize( 1.5, 1.5 ), 0 );
+    iViewport->SetViewportPos( 
+        TAlfRealPoint( 
+            iViewportPosition + KViewportOffset, 
+            KViewportOffsetY ), 
+        0 );
+    // building the grid for holding images and stuff scrolled
+     iLayout = CAlfGridLayout::AddNewL( 
+          *this, 
+          1, 
+          1,  // just one line of images
+          iViewport );   
+     TBuf<50> KImage = _L("alfphotos_small1.jpg");
+     TInt textureFlag = EAlfTextureFlagRetainResolution;
+     switch(CaseId())
+             {
+             case EAlfPerfAppCover:
+             case EAlfPerfAppCoverLandscape:         
+                  {
+                  // one liner grid with left shadow, empty space, and right shadow
+                  CAlfGridLayout* shadows = CAlfGridLayout::AddNewL( *this, 3, 1, top );
+            
+                  RArray<TInt> weights;
+                  CleanupClosePushL( weights );
+                  // the shadows are only small portition of 
+                  // the size of the empty space between them
+                  User::LeaveIfError( weights.Append( 5 ) );
+                  User::LeaveIfError( weights.Append( 200 ) );
+                  User::LeaveIfError( weights.Append( 5 ) );
+                  shadows->SetColumnsL( weights );
+                  CleanupStack::PopAndDestroy();
+                
+                  // building of the left side shadow
+                  CAlfImageVisual* leftShadow = CAlfImageVisual::AddNewL( *this, shadows );
+                  leftShadow->SetFlag( EAlfVisualFlagManualSize );
+                  leftShadow->SetSize( 
+                     TAlfRealPoint( KShadowWidth, aVisibleArea.Height() ) );
+                  leftShadow->EnableBrushesL();
+                  CAlfGradientBrush* leftBrush = CAlfGradientBrush::NewLC( aEnv );
+                  leftBrush->SetLayer( EAlfBrushLayerForeground );
+                  leftBrush->SetColor( KRgbBlack, 1.f );
+                  leftBrush->AppendColorL( 0.f, KRgbBlack, 1.f );
+                  leftBrush->AppendColorL( 1.0f, KRgbBlack, 0.f );
+                  leftShadow->Brushes()->AppendL( leftBrush, EAlfHasOwnership );
+                  CleanupStack::Pop( leftBrush );
+            
+                  // this is just an empty visual to get the layout correct,
+                  // shadows take small portitions on left and right.
+                  // middle part of the screen is left empty for the viewport.
+                  CAlfImageVisual* emptySpace = CAlfImageVisual::AddNewL( *this, shadows );
+            
+                  // building of the right side shadow
+                  CAlfImageVisual* rightShadow = CAlfImageVisual::AddNewL( *this, shadows );
+                  rightShadow->SetFlag( EAlfVisualFlagManualSize );
+                  rightShadow->SetSize( 
+                    TAlfRealPoint( KShadowWidth, aVisibleArea.Height() ) );
+                  rightShadow->EnableBrushesL();
+                  CAlfGradientBrush* rightBrush = CAlfGradientBrush::NewLC( aEnv );
+                  rightBrush->SetLayer( EAlfBrushLayerForeground );
+                  rightBrush->SetColor( KRgbBlack, 0.f );
+                  rightBrush->AppendColorL( .0f, KRgbBlack, 0.f );
+                  rightBrush->AppendColorL( 1.0f, KRgbBlack, 1.f );
+                  rightShadow->Brushes()->AppendL( rightBrush, EAlfHasOwnership );
+                  CleanupStack::Pop( rightBrush );
+                  
+                  // NOTE: Now using small images for OpenVG, because of memory issues.
+                  // These files may be replaced for BitGDI if needed.
+                  _LIT( KImage2, "alfphotos_small2.jpg");
+                  _LIT( KImage3, "alfphotos_small3.jpg");
+                  _LIT( KImage4, "alfphotos_small4.jpg");
+                  KImage = _L("alfphotos_small1.jpg");
+                  
+                  static_cast<CAlfGridLayout* >( iLayout )->SetColumns( KNumberOfImages );
+                  iViewport->SetVirtualSize( TAlfRealSize( KNumberOfImages, 1.0 ), 0 );               
+            
+                  CAlfTexture& texture2 = aEnv.TextureManager().LoadTextureL(
+                    KImage2, 
+                    TAlfTextureFlags( textureFlag ), 
+                    KAlfAutoGeneratedTextureId );
+                
+                  CAlfTexture& texture3 = aEnv.TextureManager().LoadTextureL(
+                     KImage3, 
+                     TAlfTextureFlags( textureFlag ), 
+                     KAlfAutoGeneratedTextureId );
+                
+                  CAlfTexture& texture4 = aEnv.TextureManager().LoadTextureL(
+                     KImage4, 
+                     TAlfTextureFlags( textureFlag ),
+                     KAlfAutoGeneratedTextureId );
+                
+                  CAlfGridLayout* visual2 = AddItemL( aEnv, *this, *iLayout, texture2 );
+                  visual2->EnableTransformationL();
+                  AddFrameL( aEnv, *visual2 );
+               
+                  CAlfGridLayout* visual3 = AddItemL( aEnv, *this, *iLayout, texture3 );
+                  visual3->EnableTransformationL();
+                  AddFrameL( aEnv, *visual3 );
+                
+                  CAlfGridLayout* visual4 = AddItemL( aEnv, *this, *iLayout, texture4 );
+                  visual4->EnableTransformationL();
+                  AddFrameL( aEnv, *visual4 );                  
+                
+                  CAlfGridLayout* text2 = AddItemTextL( 
+                     *this, *visual2, _L( "Gwen Stefani" ), _L("Hollaback Girl") );
+            
+                  CAlfGridLayout* text3 = AddItemTextL( 
+                     *this, *visual3, _L( "No Doubt" ), _L("Don't Speak") );
+            
+                  CAlfGridLayout* text4 = AddItemTextL( 
+                     *this, *visual4, _L( "Jenni Vartiainen" ), _L("Ihmisten edessä") );     
+                
+                  DownScaleImageL( *visual2, 0 );
+                  DownScaleImageL( *visual3, 0 );
+                  DownScaleImageL( *visual4, 0 );
+                  break;
+                  }   
+              case EAlfPerfAppCoverRotate:
+                  {                      
+                  KImage = _L("alfphotos_small1.jpg");
+                  break;
+                  }    
+              case EAlfPerfAppCoverClipZoomLargeImage:
+                  {
+                  KImage = _L("alfphotos_5mpx.jpg");
+                  iLayout->SetClipping( ETrue );
+                  iViewport->SetClipping( ETrue );
+                  top->SetClipping( ETrue );
+                  break;
+                  }
+              case EAlfPerfAppCoverClipZoomBigImage:
+                  {
+                  KImage = _L("alfphotos_2mpx.jpg");
+                  iLayout->SetClipping( ETrue );
+                  iViewport->SetClipping( ETrue );
+                  top->SetClipping( ETrue );
+                  break;
+                  }
+              case EAlfPerfAppCoverClipZoomVga:
+                  {
+                  KImage = _L("alfphotos_vga.jpg");
+                  iLayout->SetClipping( ETrue );
+                  iViewport->SetClipping( ETrue );
+                  top->SetClipping( ETrue );
+                  break;
+                  }
+              case EAlfPerfAppCoverClipZoomAutoSize:
+                  {
+                  KImage = _L("alfphotos_small9.jpg");
+                  iLayout->SetClipping( ETrue );
+                  iViewport->SetClipping( ETrue );
+                  top->SetClipping( ETrue );
+                  textureFlag |= EAlfTextureFlagAutoSize;
+                  break;
+                  }
+             }
+             CAlfTexture& texture1 = aEnv.TextureManager().LoadTextureL(
+                    KImage, 
+                    TAlfTextureFlags( textureFlag ), 
+                    KAlfAutoGeneratedTextureId );
+             CAlfGridLayout* visual1 = AddItemL( aEnv, *this, *iLayout, texture1 );
+             CAlfGridLayout* text1 = AddItemTextL( 
+                    *this, *visual1, _L( "TikTak" ), _L("Sinkut 99 - 07 Disc 1") );
+             visual1->EnableTransformationL();                    
+             visual1->Visual( 0 ).SetClipping( EFalse );
+             if ( CaseId() == EAlfPerfAppCover ||
+                  CaseId() == EAlfPerfAppCoverLandscape )
+                 {
+                 AddFrameL( aEnv, *visual1 );
+                 DownScaleImageL( *visual1, 0 );
+                 }     
+    }
+        
+void CAlfPerfAppCoverTestCaseControl::StartExecuteL( TRequestStatus& aStatus )
+    {
+    iCycleCount = 0;
+    iViewportPosition = 0; 
+    iPreviousViewportPosition = -1; // no previous position
+    
+    iStatus = &aStatus;
+    *iStatus = KRequestPending;
+    
+    TRAPD( err, DoStartExecuteL() );
+    if ( err != KErrNone )
+        {
+        iStatus = NULL;
+        User::Leave( err );
+        }
+    }
+
+void CAlfPerfAppCoverTestCaseControl::CancelExecution()
+    {
+    CompleteNow( KErrCancel );
+    }
+
+void CAlfPerfAppCoverTestCaseControl::DoStartExecuteL()
+    {
+    NextCycleL();
+    CompleteAfterL( KTransitionWaitTime );
+    }
+
+void CAlfPerfAppCoverTestCaseControl::SetVisibleArea( 
+        const TRect& /*aVisibleArea*/ )
+    {
+    }
+
+TBool CAlfPerfAppCoverTestCaseControl::OfferEventL( const TAlfEvent& aEvent )
+    {
+    if ( aEvent.IsCustomEvent() && 
+         aEvent.CustomParameter() == KAlfPerfAppCoverCmdCompleteNow )
+        {
+        const TInt KNumberOfExecutedMovements = 15;
+        if ( iCycleCount < KNumberOfExecutedMovements )
+            {
+            NextCycleL();
+            CompleteAfterL( KTransitionWaitTime );
+            }
+        else
+            {
+            CompleteNow( KErrNone );
+            }
+        
+        return ETrue;
+        }
+
+    return CAlfControl::OfferEventL( aEvent );
+    }
+
+void CAlfPerfAppCoverTestCaseControl::NextCycleL()
+    {
+    static const TReal32 movements[] = { -1, -1, -1, 1, 1, 1 }; 
+    const TInt size = 6; //sizeof movements;
+    const TInt index = iCycleCount % size;   
+        
+   
+    switch(CaseId())
+      {
+      case EAlfPerfAppCoverRotate:    
+          RotateImage( );
+          break;     
+      case EAlfPerfAppCover:
+      case EAlfPerfAppCoverLandscape:
+          MoveImages( movements[ index ] );   
+          UpdateScaling();  
+          break;
+      case EAlfPerfAppCoverClipZoomLargeImage:
+      case EAlfPerfAppCoverClipZoomBigImage:
+      case EAlfPerfAppCoverClipZoomVga:
+      case EAlfPerfAppCoverClipZoomAutoSize:
+          ClipandZoom();
+          break;
+      }
+    ++iCycleCount;
+    }
+
+void CAlfPerfAppCoverTestCaseControl::MoveImages( 
+    TReal32 aAmount, 
+    TReal32 aTransitionTime )
+    {
+    iPreviousViewportPosition = iViewportPosition;
+    iViewportPosition -= aAmount;
+
+    if ( iViewportPosition < 0 )
+        {
+        iViewportPosition = 0;                
+        }
+    else if ( iViewportPosition > ( KNumberOfImages - 1.0 ) )
+        {
+        iViewportPosition = KNumberOfImages - 1.0;    
+        }
+
+    iViewport->SetViewportPos(
+        TAlfRealPoint( iViewportPosition + KViewportOffset, KViewportOffsetY ), 
+        aTransitionTime );
+    }
+
+void CAlfPerfAppCoverTestCaseControl::UpdateScaling( 
+    TReal32 aTransitionTime )
+    {
+    const TInt current = RoundFloatToInt( iViewportPosition );
+    const TInt previous = RoundFloatToInt( iPreviousViewportPosition );
+        
+    if ( previous >= 0 )
+        {
+        CAlfVisual& currentVisual = iLayout->Visual( current );
+        CAlfVisual& previousVisual = iLayout->Visual( previous );
+
+        TAlfTimedValue puller;
+        puller.SetValueNow( KSmallImageScale );
+        puller.SetTarget( KFocusedImageScale, aTransitionTime );
+        CAlfTransformation& enlarging = currentVisual.Transformation();
+        enlarging.LoadIdentity();
+        enlarging.Scale( puller, puller );
+
+        TRAP_IGNORE(DownScaleImageL( previousVisual, aTransitionTime ));
+        }
+    }
+
+void CAlfPerfAppCoverTestCaseControl::RotateImage( )
+    {    
+    TInt angle = KRotationAngle;
+    if ( iCycleCount%2 )
+        {
+        angle = -KRotationAngle;
+        }
+    
+    CAlfVisual& currentVisual = iLayout->Visual( 0 );   
+    TAlfTimedValue rotator;
+    rotator.SetValueNow( 0 );        
+    rotator.SetTarget( angle, KTransitionTime );
+    CAlfTransformation& rotation = currentVisual.Transformation();
+    rotation.LoadIdentity();
+    rotation.Rotate( rotator );                
+    }
+
+void CAlfPerfAppCoverTestCaseControl::ClipandZoom( )
+    {    
+    CAlfLayout& layout = static_cast< CAlfLayout& >( iLayout->Visual( 0 ) );
+    CAlfVisual& imgVisual = layout.Visual( 0 );
+    imgVisual.Move( TAlfRealPoint( -5, -5 ),  KTransitionTime);
+    
+    TAlfTimedValue scaler;
+    scaler.SetValueNow( KFocusedImageScale *  ( iCycleCount + 1 ) );
+    scaler.SetTarget( KFocusedImageScale *  ( iCycleCount + 2 ) , KTransitionTime );
+    CAlfTransformation& enlarging = layout.Transformation();
+    enlarging.LoadIdentity();
+    enlarging.Scale( scaler, scaler );  
+    }
+
+TInt CAlfPerfAppCoverTestCaseControl::RoundFloatToInt( TReal32 aVal )
+    {
+    return aVal < 0 ? (TInt)( aVal - 0.5f ) : (TInt)( aVal + 0.5f );
+    }    
+
+void CAlfPerfAppCoverTestCaseControl::CompleteAfterL( TInt aDuration )
+    {
+    // In order to use this service, base class StartExecuteL must
+    // have been called.
+    __ASSERT_ALWAYS( iStatus, User::Invariant() );
+    
+    TAlfCustomEventCommand command( KAlfPerfAppCoverCmdCompleteNow, this );
+    User::LeaveIfError( Env().Send( command, aDuration ) );
+    }
+        
+void CAlfPerfAppCoverTestCaseControl::CompleteNow( TInt aErrorCode )
+    {
+    if ( iStatus )
+        {
+        User::RequestComplete( iStatus, aErrorCode );
+        iStatus = NULL;
+        }
+    }
+
+inline TInt CAlfPerfAppCoverTestCaseControl::CaseId() const
+    {
+    return iCaseId;
+    }
+
+inline TBool CAlfPerfAppCoverTestCaseControl::IsExecutionOngoing() const
+    {
+    return ( iStatus != NULL );
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappdaemon.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,249 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfappdeamon implementation.
+*
+*/
+
+
+// INCLUDE FILES
+#include <eikstart.h>
+#include <apgwgnam.h>
+#include "alfperfappdaemon.h"
+
+#include "../../alfdebugextension/inc/alfdebug.h"
+
+/**
+ * Reset inactity period in microseconds.
+ */
+const TInt KAlfPerfAppActivityPollPeriod = 2500000;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+//
+// Implementation of CAlfPerfAppDaemonApplication
+//
+
+CApaDocument* CAlfPerfAppDaemonApplication::CreateDocumentL()
+    {
+    return new (ELeave) CAlfPerfAppDaemonDocument( *this );
+    }
+
+TUid CAlfPerfAppDaemonApplication::AppDllUid() const
+    {
+    return KAlfPerfAppDaemonUid;
+    }
+
+void CAlfPerfAppDaemonApplication::NewAppServerL( CApaAppServer*& aAppServer )
+    {
+    aAppServer = NULL;
+    aAppServer = new (ELeave) CAlfPerfAppDaemonServer;
+    }
+
+//
+// Implementation of CAlfPerfAppDaemonDocument
+//
+
+CAlfPerfAppDaemonDocument::CAlfPerfAppDaemonDocument( CEikApplication& aApp )
+    : CAknDocument( aApp )
+    {
+    }
+
+CEikAppUi* CAlfPerfAppDaemonDocument::CreateAppUiL()
+    {
+    return new (ELeave) CAlfPerfAppDaemonAppUi;
+    }
+
+void CAlfPerfAppDaemonDocument::UpdateTaskNameL(CApaWindowGroupName* aWgName)
+    {
+    CAknDocument::UpdateTaskNameL( aWgName );
+    aWgName->SetHidden( ETrue );
+    }
+
+//
+// Implementation of CAlfPerfAppDaemonAppUi
+//
+
+CAlfPerfAppDaemonAppUi::CAlfPerfAppDaemonAppUi()
+    {
+    }
+
+CAlfPerfAppDaemonAppUi::~CAlfPerfAppDaemonAppUi()
+    {
+    delete iDebug;
+    delete iFactory;
+    iLibrary.Close();
+    }
+
+CAlfDebugExtension* CAlfPerfAppDaemonAppUi::Debug()
+    {
+    return iDebug;
+    }
+
+void CAlfPerfAppDaemonAppUi::ConstructL()
+    {
+    CAknAppUi::BaseConstructL( EAknEnableSkin | EAknEnableMSK );
+    
+    RWsSession& wsSession = iEikonEnv->WsSession();
+    wsSession.ComputeMode( RWsSession::EPriorityControlDisabled );
+    RProcess().SetPriority( EPriorityHigh );
+    iEikonEnv->SetSystem( ETrue );
+    
+    if ( iLibrary.Load( KAlfDebugExtensionLibraryName ) == KErrNone )
+        {
+        TInt res = iLibrary.Lookup( KAlfDebugExtensionLibraryEntryOrdinal )();
+        iFactory = (CAlfDebugFactory*)res;
+        if ( iFactory )
+            {
+            iDebug = iFactory->CreateDebugExtensionL( NULL );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// Common commands are handled here.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppDaemonAppUi::HandleCommandL( TInt aCommand )
+    {
+    switch ( aCommand )
+        {
+        case EEikCmdExit:
+            Exit();
+            break;
+
+        default:
+            break;
+        }
+    }
+
+//
+// Implementation of CAlfPerfAppDaemonServer
+//
+
+CAlfPerfAppDaemonServer::CAlfPerfAppDaemonServer()
+    {
+    }
+
+CApaAppServiceBase* CAlfPerfAppDaemonServer::CreateServiceL( TUid aServiceType ) const
+    {
+    if ( aServiceType == KAlfPerfAppDaemonUid )
+        {
+        return new (ELeave) CAlfPerfAppDaemonService;
+        }
+    else
+        {
+        User::Leave( KErrNotSupported );
+        return NULL;
+        }
+    }
+
+//
+// Implementation of CAlfPerfAppDaemonService
+//
+
+CAlfPerfAppDaemonService::CAlfPerfAppDaemonService()
+    {
+    }
+
+CAlfPerfAppDaemonService::~CAlfPerfAppDaemonService()
+    {
+    if ( iActivityPoll )
+        {
+        iActivityPoll->Cancel();
+        delete iActivityPoll;
+        }
+    }
+
+void CAlfPerfAppDaemonService::ServiceL( const RMessage2& aMessage )
+    {
+    switch ( aMessage.Function() )
+        {
+        case EAlfPerfAppIpcGetMeasurements:
+            {
+            CAlfPerfAppDaemonAppUi* appui =
+                static_cast<CAlfPerfAppDaemonAppUi*>( 
+                    CEikonEnv::Static()->EikAppUi() );
+            CAlfDebugExtension* debug = appui->Debug();
+            if ( debug )
+                {
+                TAlfDebugServerMeasurements measurements;
+                TInt err = debug->GetMeasurements( measurements );
+                if ( err == KErrNone )
+                    {
+                    TPckgC<TAlfDebugServerMeasurements> pckg( measurements );
+                    err = aMessage.Write( 0, pckg );
+                    }
+                aMessage.Complete( err );
+                }
+            else
+                {
+                aMessage.Complete( KErrNotSupported );
+                }
+            }
+            break;
+
+        case EAlfPerfAppIpcEnableActivityPoll:
+            {
+            const TBool enable = ( aMessage.Int0() != 0 );
+            if ( enable )
+                {
+                User::ResetInactivityTime();
+                if ( !iActivityPoll )
+                    {
+                    iActivityPoll = CPeriodic::NewL( CActive::EPriorityHigh );
+                    }
+                iActivityPoll->Cancel();
+                iActivityPoll->Start(
+                    KAlfPerfAppActivityPollPeriod,
+                    KAlfPerfAppActivityPollPeriod,
+                    TCallBack( ActivityPollCallBack, this ) );
+                }
+            else
+                {
+                if ( iActivityPoll )
+                    {
+                    iActivityPoll->Cancel();
+                    }
+                delete iActivityPoll;
+                iActivityPoll = NULL;
+                }
+
+            aMessage.Complete( KErrNone );
+            }
+            break;
+
+        default:
+            CAknAppServiceBase::ServiceL( aMessage );
+            break;
+        }
+    }
+
+TInt CAlfPerfAppDaemonService::ActivityPollCallBack( TAny* /*aAny*/ )
+    {
+    User::ResetInactivityTime();
+    return KErrNone;
+    }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CAlfPerfAppDaemonApplication;
+    }
+
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication( NewApplication );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappdocument.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAlfPerfAppDocument implementation.
+*
+*/
+
+
+#include "alfperfappdocument.h"
+#include "alfperfappappui.h"
+#include "alfperfappmodel.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+CAlfPerfAppDocument::CAlfPerfAppDocument( CEikApplication& aApp )
+    : CAknDocument( aApp )
+    {
+    }
+
+CAlfPerfAppDocument::~CAlfPerfAppDocument()
+    {
+    delete iModel;
+    }
+
+void CAlfPerfAppDocument::ConstructL()
+    {
+    iModel = CAlfPerfAppModel::NewL();
+    }
+
+CEikAppUi* CAlfPerfAppDocument::CreateAppUiL()
+    {
+    return new (ELeave) CAlfPerfAppAppUi( *iModel );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappframeworktestcase.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAlfPerfAppFrameworkTestCase implementation.
+*
+*/
+
+
+#include "alfperfappframeworktestcase.h"
+#include "alfperfapp.hrh"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// Checks if specified case is supported by this class.
+// -----------------------------------------------------------------------------
+//
+TBool CAlfPerfAppFrameworkTestCase::IsSupported( TInt aCaseId )
+    {
+    return aCaseId > EAlfPerfAppFrameworkMin && 
+           aCaseId < EAlfPerfAppFrameworkMax;
+    }
+
+CAlfPerfAppFrameworkTestCase* CAlfPerfAppFrameworkTestCase::NewL( TInt aCaseId, TInt aSequenceIndex)
+    {
+    if ( !IsSupported( aCaseId ) )
+        {
+        User::Leave( KErrNotSupported );
+        }
+
+    CAlfPerfAppFrameworkTestCase* self = 
+        new (ELeave) CAlfPerfAppFrameworkTestCase( aCaseId, aSequenceIndex );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CAlfPerfAppFrameworkTestCase::~CAlfPerfAppFrameworkTestCase()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// Starts setup phase.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppFrameworkTestCase::SetupL( 
+        CAlfEnv& aEnv, const TRect& /*aVisibleArea*/, TRequestStatus& aStatus )
+    {
+    __ASSERT_ALWAYS( !iEnv, User::Invariant() );
+    iEnv = &aEnv;
+    
+    TInt errorCode = KErrNone;
+    switch ( iCaseId )
+        {   
+        case EAlfPerfAppFrameworkSetupFailSynch:
+            User::Leave( KErrGeneral );
+            break;
+            
+        case EAlfPerfAppFrameworkSetupFailAsynch:
+            errorCode = KErrGeneral;
+            break;
+        
+        case EAlfPerfAppFrameworkEmpty:
+        case EAlfPerfAppFrameworkExecuteFailSynch:    
+        case EAlfPerfAppFrameworkExecuteFailAsynch:
+            break;
+
+        case EAlfPerfAppFrameworkCreateFail:
+        default:
+            User::Invariant();
+            break;
+        }
+        
+    CAlfPerfAppTestCase::CompleteNow( aStatus, errorCode );
+    }
+
+// -----------------------------------------------------------------------------
+// Starts execution phase.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppFrameworkTestCase::ExecuteL( TRequestStatus& aStatus )
+    {
+    __ASSERT_ALWAYS( iEnv, User::Invariant() );
+    
+    TInt errorCode = KErrNone;
+    switch ( iCaseId )
+        {
+        case EAlfPerfAppFrameworkEmpty:
+            break;
+            
+        case EAlfPerfAppFrameworkExecuteFailSynch:
+            User::Leave( KErrGeneral );
+            break;
+            
+        case EAlfPerfAppFrameworkExecuteFailAsynch:
+            errorCode = KErrGeneral;
+            break;
+        
+        case EAlfPerfAppFrameworkCreateFail:
+        case EAlfPerfAppFrameworkSetupFailSynch:
+        case EAlfPerfAppFrameworkSetupFailAsynch:
+            // If setup fails, then ExecuteL must not be called.
+        default:
+            User::Invariant();
+            break;            
+        }
+        
+    CAlfPerfAppTestCase::CompleteNow( aStatus, errorCode );
+    }
+
+// -----------------------------------------------------------------------------
+// Tears down.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppFrameworkTestCase::TearDown()
+    {
+    iEnv = NULL;
+    }
+
+void CAlfPerfAppFrameworkTestCase::HandleVisibleAreaChange( 
+        const TRect& /*aRect*/ )
+    {
+    }
+
+TInt CAlfPerfAppFrameworkTestCase::CaseID()
+    {
+    return iCaseId;
+    }
+
+CAlfPerfAppFrameworkTestCase::CAlfPerfAppFrameworkTestCase( TInt aCaseId, TInt aSequenceIndex )
+    : CAlfPerfAppTestCase(aSequenceIndex), iCaseId ( aCaseId )
+    {
+    }
+
+void CAlfPerfAppFrameworkTestCase::ConstructL()
+    {
+    switch ( iCaseId )
+        {
+        case EAlfPerfAppFrameworkCreateFail:
+            User::Leave( KErrGeneral );
+            break;
+            
+        default:
+            // Simply continue with other cases.
+            break;
+        }
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappgallerytestcase.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,874 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAlfPerfAppGalleryTestCase implementation.
+*
+*/
+
+
+#include "alfperfappgallerytestcase.h"
+#include "alfperfappappui.h"
+#include "alfperfapp.hrh"
+
+#include <aknutils.h>
+#include <alf/alfenv.h>
+#include <alf/alfdisplay.h>
+#include <alf/alfcontrol.h>
+#include <alf/alfcontrolgroup.h>
+#include <alf/alfroster.h>
+#include <alf/alfcommand.h>
+#include <alf/alfevent.h>
+#include <alf/alftexturemanager.h>
+#include <alf/alfimagevisual.h>
+#include <alf/alfimageloaderutil.h>
+#include <alf/alfutil.h>
+#include <alf/alflayout.h>
+#include <alf/alfviewportlayout.h>
+#include <alf/alfgridlayout.h>
+#include <alf/alftransformation.h>
+#include <alf/alfgradientbrush.h>
+#include <alf/alfimagebrush.h>
+#include <alf/alftextvisual.h>
+#include <alf/alfbrusharray.h>
+#include <alf/alfshadowborderbrush.h>
+#include <alf/alfdecklayout.h>
+#include <alf/alflayout.h>
+#include <alf/alfborderbrush.h>
+
+#include <alfperfapp_imagetest.mbg>
+
+/**
+ * Control group for image test cases.
+ */
+const TInt KAlfPerfAppGalleryControlGroup = 3;
+
+/**
+ * Complete now command.
+ */
+const TInt KAlfPerfAppGalleryCmdCompleteNow = 0x7000;
+
+/**
+ * Abstract gallery test case control.
+ */
+class CAlfPerfAppGalleryTestCaseControl : public CAlfControl,
+	public MAlfTextureLoadingCompletedObserver
+    {
+public:
+
+    // Common constants
+    static const TInt KTransitionTime;
+    static const TInt KTransitionWaitTime;
+
+    /**
+     * Constructor.
+     */
+    CAlfPerfAppGalleryTestCaseControl();
+
+    /**
+     * Destructor.
+     */
+    ~CAlfPerfAppGalleryTestCaseControl();
+
+    static CAlfPerfAppGalleryTestCaseControl* NewL(
+    		CAlfEnv& aEnv, TInt aCaseId, const TRect& /*aVisibleArea*/);
+
+    /**
+     * Base class constructor. Derived classes may
+     * override this, but base class needs to be called.
+     */
+    virtual void ConstructL(
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea );
+
+    /**
+     * Starts execution of the test case. By default,
+     * request status is stored to local variable.
+     */
+    void StartExecuteL( TRequestStatus& aStatus );
+
+    /**
+     * Cancels execution. This control and environment will be
+     * deleted soon after calling this method.
+     */
+    void CancelExecution();
+
+    /**
+     * Sets observer for texture loading.
+     * @param aObserver Observer class.
+     */
+    void SetImagesLoadedObserver( MImagesLoadedObserver* aObserver );
+
+    /**
+     * Sets focused image.
+     * @param aImageTag Tag for the image to be focused.
+     */
+    void SetImageFocusL( const TDesC8& aImageTag );
+
+    /**
+     * Starts execution.
+     * If this method leaves, then request must not be completed.
+     * By default, this method completes immediately.
+     */
+    virtual void DoStartExecuteL();
+
+    /**
+     * Sets visible area.
+     * @param aVisibleArea visible area.
+     */
+    virtual void SetVisibleArea( const TRect& aVisibleArea );
+
+    // From base class CAlfControl:
+
+    /**
+     * Handles events.
+     * Derived classes should forward to base class.
+     * @param aEvent event to be handled.
+     * @return ETrue if consumed, EFalse otherwise.
+     */
+    virtual TBool OfferEventL( const TAlfEvent& aEvent );
+
+    // From base class MAlfTextureLoadingCompletedObserver
+    void TextureLoadingCompleted( CAlfTexture& aTexture, TInt aTextureId,
+			TInt aErrorCode );
+
+
+protected:
+    void MoveImages(
+        TReal32 aAmount,
+        TReal32 aTransitionTime = KTransitionTime );
+
+	/**
+	 * Next cycle for scrolling the Grid layout.
+	 */
+	void NextScrollCycleL();
+
+	/**
+	 * Next cycle for focusing image.
+	 */
+	void NextFocusCycleL();
+
+	/**
+	 * Sets image focus based on event cycle.
+	 */
+    void UpdateImageFocus( TInt aCycle );
+
+    /**
+     * Completes automatically after specified duration.
+     * @param aDuration duration in ms
+     */
+    void CompleteAfterL( TInt aDuration );
+
+    /**
+     * Completes current request.
+     */
+    void CompleteNow( TInt aErrorCode );
+
+    /**
+     * Returns test case id.
+     */
+    inline TInt CaseId() const;
+
+    /**
+     * Returns ETrue if test case execution is still ongoing.
+     */
+    inline TBool IsExecutionOngoing() const;
+
+    /**
+     * Test case id.
+     */
+    TInt iCaseId;
+
+
+private:
+    /**
+     * Pointer to request status.
+     * Not owned.
+     */
+    TRequestStatus* iStatus;
+
+    CAlfLayout* iGridLayout;
+    TReal32 iViewportPosition;
+    TReal32 iPreviousViewportPosition;
+    CAlfViewportLayout* iViewport;
+    CAlfLayout* iImageInfoLayout;
+
+    TInt iCycleCount;
+    TInt iFocusChangedCount;
+    TInt iGridScrolledCount;
+    TInt iLoadedImages;
+
+	CAlfImageVisual* iFocusedVisual;
+
+    MImagesLoadedObserver* iObserver;
+
+	RPointerArray<TDesC> iImageCaptions;
+
+	RPointerArray<TDesC8> iImagesToBeFocused;
+    };
+
+// ============================ MEMBER FUNCTIONS ===============================
+const TInt CAlfPerfAppGalleryTestCaseControl::KTransitionTime = 1000;
+const TInt CAlfPerfAppGalleryTestCaseControl::KTransitionWaitTime = 1000;
+// -----------------------------------------------------------------------------
+// Checks if specified case is supported by this class.
+// -----------------------------------------------------------------------------
+//
+TBool CAlfPerfAppGalleryTestCase::IsSupported( TInt aCaseId )
+    {
+    return aCaseId > EAlfPerfAppGalleryMin &&
+           aCaseId < EAlfPerfAppGalleryMax;
+    }
+
+CAlfPerfAppGalleryTestCase* CAlfPerfAppGalleryTestCase::NewL( TInt aCaseId, TInt aSequenceIndex )
+    {
+    if ( !IsSupported( aCaseId ) )
+        {
+        User::Leave( KErrNotSupported );
+        }
+
+    CAlfPerfAppGalleryTestCase* self =
+        new (ELeave) CAlfPerfAppGalleryTestCase( aCaseId, aSequenceIndex );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CAlfPerfAppGalleryTestCase::~CAlfPerfAppGalleryTestCase()
+    {
+    if ( iEnv && iControl )
+        {
+        iEnv->TextureManager().RemoveLoadObserver( iControl );
+        iControl->CancelExecution();
+        iEnv->DeleteControlGroup( KAlfPerfAppGalleryControlGroup );
+        }
+    iImages.Close();
+    delete iLoader;
+    }
+
+void CAlfPerfAppGalleryTestCase::ImagesLoaded( TInt aErrorCode )
+	{
+	if( iStatus )
+		{
+		CAlfPerfAppTestCase::CompleteNow( *iStatus, aErrorCode );
+		iStatus = 0;
+		}
+	}
+
+// -----------------------------------------------------------------------------
+// Starts setup phase.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppGalleryTestCase::SetupL(
+        CAlfEnv& aEnv, const TRect& /*aVisibleArea*/, TRequestStatus& aStatus )
+    {
+    iEnv = &aEnv;
+
+    iStatus = &aStatus;
+
+    CAlfPerfAppAppUi* appUi = (CAlfPerfAppAppUi*) EikonEnv()->AppUi();
+
+    iOrientation = appUi->Orientation();
+
+    switch ( iCaseId )
+        {
+        case EAlfPerfAppGallery:
+        	{
+        	appUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationPortrait );
+            break;
+        	}
+        case EAlfPerfAppGalleryLandscape:
+        	{
+        	appUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape );
+            break;
+        	}
+        default:
+            User::Leave( KErrNotSupported );
+            break;
+        }
+
+    TRect rect;
+    AknLayoutUtils::LayoutMetricsRect(
+        AknLayoutUtils::EApplicationWindow,
+        rect );
+
+    iEnv->SetFullScreenDrawing( ETrue );
+    CAlfDisplay& display =
+        iEnv->NewDisplayL( rect, CAlfEnv::ENewDisplayFullScreen );
+    display.SetClearBackgroundL( CAlfDisplay::EClearWithSkinBackground );
+
+    CAlfControlGroup& group =
+        iEnv->NewControlGroupL( KAlfPerfAppGalleryControlGroup );
+
+    iControl = CAlfPerfAppGalleryTestCaseControl::NewL(*iEnv, iCaseId, rect );
+
+    group.AppendL( iControl ); // ownership passed to control group.
+    iControl->SetImagesLoadedObserver( this );
+
+    display.Roster().ShowL( group );
+    }
+
+// -----------------------------------------------------------------------------
+// Starts execution phase.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppGalleryTestCase::ExecuteL( TRequestStatus& aStatus )
+    {
+    // SetupL must have been called first.
+    __ASSERT_ALWAYS( iEnv, User::Invariant() );
+    __ASSERT_ALWAYS( iControl, User::Invariant() );
+    iControl->StartExecuteL( aStatus );
+    }
+
+// -----------------------------------------------------------------------------
+// Tears down.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppGalleryTestCase::TearDown()
+    {
+    CAlfPerfAppAppUi* appUi = (CAlfPerfAppAppUi*) EikonEnv()->AppUi();
+    TRAP_IGNORE( appUi->SetOrientationL( iOrientation ) );
+    // Execution side will delete CAlfEnv, so it will delete everything
+    // related to this.
+    iEnv = NULL;
+    iControl = NULL;
+    }
+
+void CAlfPerfAppGalleryTestCase::HandleVisibleAreaChange( const TRect& aRect )
+    {
+    if ( iEnv && iControl )
+        {
+        if ( iEnv->DisplayCount() > 0 )
+            {
+            iEnv->PrimaryDisplay().SetVisibleArea( aRect );
+            }
+        iControl->SetVisibleArea( aRect );
+        }
+    }
+
+TInt CAlfPerfAppGalleryTestCase::CaseID()
+    {
+        return iCaseId;
+    }
+
+CAlfPerfAppGalleryTestCase::CAlfPerfAppGalleryTestCase( TInt aCaseId, TInt aSequenceIndex )
+    : CAlfPerfAppTestCase(aSequenceIndex), iCaseId ( aCaseId )
+    {
+    }
+
+void CAlfPerfAppGalleryTestCase::ConstructL()
+    {
+    }
+
+// Implementation of CAlfPerfAppGalleryTestCaseControl:
+
+static void GetImageTestCasePrivatePath( TFileName& aPath )
+    {
+    CEikonEnv::Static()->FsSession().PrivatePath( aPath );
+    ::CompleteWithAppPath( aPath );
+    }
+
+CAlfPerfAppGalleryTestCaseControl::CAlfPerfAppGalleryTestCaseControl()
+    {
+    }
+
+CAlfPerfAppGalleryTestCaseControl* CAlfPerfAppGalleryTestCaseControl::NewL(
+	CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea )
+	{
+	CAlfPerfAppGalleryTestCaseControl* self = new (ELeave) CAlfPerfAppGalleryTestCaseControl();
+    CleanupStack::PushL( self );
+    self->ConstructL( aEnv, aCaseId, aVisibleArea );
+    CleanupStack::Pop( self );
+    return self;
+	}
+
+const TInt KNumberOfImages = 10;
+const TInt KImagePadding = 5;
+const TReal32 KNumberOfLinesInView = 3.5;
+//const TReal32 KNumberOfColumnsInView = 4.0;
+const TReal32 KNumberOfLinesInGrid = 5.0;
+const TReal32 KNumberOfColumnsInGrid = 4.0;
+
+void CAlfPerfAppGalleryTestCaseControl::ConstructL(
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea )
+    {
+    iCaseId = aCaseId;
+    CAlfControl::ConstructL( aEnv );
+
+    TFileName privatePath;
+    GetImageTestCasePrivatePath( privatePath );
+    aEnv.TextureManager().SetImagePathL( privatePath );
+
+    iLoadedImages = 0;
+
+    // Viewport for grid
+    iViewport = CAlfViewportLayout::AddNewL( *this, 0 );
+    iViewport->SetClipping( EFalse );
+    iViewport->SetVirtualSize( TAlfRealSize( 1.0, KNumberOfLinesInGrid ), 0 );
+    iViewport->SetViewportSize( TAlfRealSize( 1.0, KNumberOfLinesInView ), 0 );
+    iViewport->SetViewportPos( TAlfRealPoint( iViewportPosition, 0 ), 0 );
+
+    // Background for viewport
+    CAlfGradientBrush* brush = CAlfGradientBrush::NewLC( aEnv );
+    brush->SetDirection( CAlfGradientBrush::EDirectionDown );
+    brush->SetLayer( EAlfBrushLayerBackground );
+    brush->SetColor( KRgbBlack );
+    brush->AppendColorL( 1.0f, KRgbGray );
+    iViewport->EnableBrushesL( ETrue );
+    iViewport->Brushes()->AppendL( brush, EAlfHasOwnership );
+    CleanupStack::Pop( brush );
+
+    // Grid for images
+    iGridLayout = CAlfGridLayout::AddNewL(
+        *this,
+        KNumberOfColumnsInGrid,
+        KNumberOfLinesInGrid,  // lines of images
+        iViewport );
+
+    // Images
+    // NOTE: Now using small images for OpenVG, because of memory issues.
+    // These files may be replaced for BitGDI if needed. 
+    _LIT( KImage1, "alfphotos_small1.jpg" );
+    _LIT( KImage2, "alfphotos_small2.jpg" );
+    _LIT( KImage3, "alfphotos_small3.jpg" );
+    _LIT( KImage4, "alfphotos_small4.jpg" );
+    _LIT( KImage5, "alfphotos_small5.jpg" );
+    _LIT( KImage6, "alfphotos_small6.jpg" );
+    _LIT( KImage7, "alfphotos_small7.jpg" );
+    _LIT( KImage8, "alfphotos_small8.jpg" );
+    _LIT( KImage9, "alfphotos_small9.jpg" );
+    _LIT( KImage10, "jpg_sun_small.jpg" );
+    
+    // Visual tags
+    _LIT8( KVisual1, "visual1" );
+    _LIT8( KVisual2, "visual2" );
+    _LIT8( KVisual3, "visual3" );
+    _LIT8( KVisual4, "visual4" );
+    _LIT8( KVisual5, "visual5" );
+    _LIT8( KVisual6, "visual6" );
+    _LIT8( KVisual7, "visual7" );
+    _LIT8( KVisual8, "visual8" );
+    _LIT8( KVisual9, "visual9" );
+    _LIT8( KVisual10, "visual10" );
+    _LIT8( KVisual11, "visual11" );
+    _LIT8( KVisual12, "visual12" );
+    _LIT8( KVisual13, "visual13" );
+    _LIT8( KVisual14, "visual14" );
+    _LIT8( KVisual15, "visual15" );
+    _LIT8( KVisual16, "visual16" );
+    _LIT8( KVisual17, "visual17" );
+    _LIT8( KVisual18, "visual18" );
+    _LIT8( KVisual19, "visual19" );
+    _LIT8( KVisual20, "visual20" );
+
+    // Captions for image metadata text field
+    _LIT( KImageCaption1, "alfphotos1" );
+    _LIT( KImageCaption5, "alfphotos5" );
+    _LIT( KImageCaption8, "alfphotos8" );
+
+    // The order of the visuals in image focusing
+    iImagesToBeFocused.Append( &KVisual17 );
+    iImagesToBeFocused.Append( &KVisual5 );
+    iImagesToBeFocused.Append( &KVisual1 );
+
+    // The corresponding image captions in image focusing
+    iImageCaptions.Append( &KImageCaption8 );
+    iImageCaptions.Append( &KImageCaption5 );
+    iImageCaptions.Append( &KImageCaption1 );
+
+    aEnv.TextureManager().AddLoadObserverL( this );
+
+    // Load textures for images
+    CAlfTexture& texture1 = aEnv.TextureManager().LoadTextureL(
+        KImage1,
+        EAlfTextureFlagRetainResolution,
+        KAlfAutoGeneratedTextureId );
+    CAlfTexture& texture2 = aEnv.TextureManager().LoadTextureL(
+        KImage2,
+        EAlfTextureFlagRetainResolution,
+        KAlfAutoGeneratedTextureId );
+    CAlfTexture& texture3 = aEnv.TextureManager().LoadTextureL(
+        KImage3,
+        EAlfTextureFlagRetainResolution,
+        KAlfAutoGeneratedTextureId );
+    CAlfTexture& texture4 = aEnv.TextureManager().LoadTextureL(
+        KImage4,
+        EAlfTextureFlagRetainResolution,
+        KAlfAutoGeneratedTextureId );
+    CAlfTexture& texture5 = aEnv.TextureManager().LoadTextureL(
+        KImage5,
+        EAlfTextureFlagRetainResolution,
+        KAlfAutoGeneratedTextureId );
+    CAlfTexture& texture6 = aEnv.TextureManager().LoadTextureL(
+        KImage6,
+        EAlfTextureFlagRetainResolution,
+        KAlfAutoGeneratedTextureId );
+    CAlfTexture& texture7 = aEnv.TextureManager().LoadTextureL(
+        KImage7,
+        EAlfTextureFlagRetainResolution,
+        KAlfAutoGeneratedTextureId );
+    CAlfTexture& texture8 = aEnv.TextureManager().LoadTextureL(
+        KImage8,
+        EAlfTextureFlagRetainResolution,
+        KAlfAutoGeneratedTextureId );
+    CAlfTexture& texture9 = aEnv.TextureManager().LoadTextureL(
+        KImage9,
+        EAlfTextureFlagRetainResolution,
+        KAlfAutoGeneratedTextureId );
+    CAlfTexture& texture10 = aEnv.TextureManager().LoadTextureL(
+        KImage10,
+        EAlfTextureFlagRetainResolution,
+        KAlfAutoGeneratedTextureId );
+
+    // Add visuals to image grid
+    CAlfImageVisual* visual1 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual1->SetImage( TAlfImage( texture1 ) );
+    visual1->SetPadding( KImagePadding );
+    visual1->SetTagL( KVisual1 );
+    CAlfImageVisual* visual2 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual2->SetImage( TAlfImage( texture2 ) );
+    visual2->SetPadding( KImagePadding );
+    visual2->SetTagL( KVisual2 );
+    CAlfImageVisual* visual3 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual3->SetImage( TAlfImage( texture3 ) );
+    visual3->SetPadding( KImagePadding );
+    visual3->SetTagL( KVisual3 );
+    CAlfImageVisual* visual4 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual4->SetImage( TAlfImage( texture4 ) );
+    visual4->SetPadding( KImagePadding );
+    visual4->SetTagL( KVisual4 );
+    CAlfImageVisual* visual5 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual5->SetImage( TAlfImage( texture5 ) );
+    visual5->SetPadding( KImagePadding );
+    visual5->SetTagL( KVisual5 );
+    CAlfImageVisual* visual6 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual6->SetImage( TAlfImage( texture6 ) );
+    visual6->SetPadding( KImagePadding );
+    visual6->SetTagL( KVisual6 );
+    CAlfImageVisual* visual7 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual7->SetImage( TAlfImage( texture7 ) );
+    visual7->SetPadding( KImagePadding );
+    visual7->SetTagL( KVisual7 );
+    CAlfImageVisual* visual8 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual8->SetImage( TAlfImage( texture8 ) );
+    visual8->SetPadding( KImagePadding );
+    visual8->SetTagL( KVisual8 );
+    CAlfImageVisual* visual9 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual9->SetImage( TAlfImage( texture9 ) );
+    visual9->SetPadding( KImagePadding );
+    visual9->SetTagL( KVisual9 );
+    CAlfImageVisual* visual10 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual10->SetImage( TAlfImage( texture10 ) );
+    visual10->SetPadding( KImagePadding );
+    visual10->SetTagL( KVisual10 );
+    CAlfImageVisual* visual11 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual11->SetImage( TAlfImage( texture2 ) );
+    visual11->SetPadding( KImagePadding );
+    visual11->SetTagL( KVisual11 );
+    CAlfImageVisual* visual12 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual12->SetImage( TAlfImage( texture3 ) );
+    visual12->SetPadding( KImagePadding );
+    visual12->SetTagL( KVisual12 );
+    CAlfImageVisual* visual13 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual13->SetImage( TAlfImage( texture4 ) );
+    visual13->SetPadding( KImagePadding );
+    visual13->SetTagL( KVisual13 );
+    CAlfImageVisual* visual14 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual14->SetImage( TAlfImage( texture5 ) );
+    visual14->SetPadding( KImagePadding );
+    visual14->SetTagL( KVisual14 );
+    CAlfImageVisual* visual15 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual15->SetImage( TAlfImage( texture6 ) );
+    visual15->SetPadding( KImagePadding );
+    visual15->SetTagL( KVisual15 );
+    CAlfImageVisual* visual16 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual16->SetImage( TAlfImage( texture7 ) );
+    visual16->SetPadding( KImagePadding );
+    visual16->SetTagL( KVisual16 );
+    CAlfImageVisual* visual17 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual17->SetImage( TAlfImage( texture8 ) );
+    visual17->SetPadding( KImagePadding );
+    visual17->SetTagL( KVisual17 );
+    CAlfImageVisual* visual18 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual18->SetImage( TAlfImage( texture9 ) );
+    visual18->SetPadding( KImagePadding );
+    visual18->SetTagL( KVisual18 );
+    CAlfImageVisual* visual19 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual19->SetImage( TAlfImage( texture1 ) );
+    visual19->SetPadding( KImagePadding );
+    visual19->SetTagL( KVisual19 );
+    CAlfImageVisual* visual20 = CAlfImageVisual::AddNewL( *this, iGridLayout );
+    visual20->SetImage( TAlfImage( texture2 ) );
+    visual20->SetPadding( KImagePadding );
+    visual20->SetTagL( KVisual20 );
+
+    // Focus on visual 1
+	CAlfBorderBrush* actualBorder = CAlfBorderBrush::NewLC( Env(), 4, 4, 0, 0 );
+	actualBorder->SetColor( KRgbBlue );
+	visual1->EnableBrushesL( ETrue );
+	visual1->Brushes()->AppendL( actualBorder, EAlfHasOwnership );
+	CleanupStack::Pop( actualBorder );
+
+    // Area for image metadata
+    TRect textFieldArea;
+    textFieldArea.SetWidth( aVisibleArea.Width() );
+    textFieldArea.SetHeight( aVisibleArea.Height() / 7 );
+
+    // Layout for image metadata
+    CAlfGridLayout* iImageInfoLayout = CAlfGridLayout::AddNewL( *this, 1, 1, 0 );
+    iImageInfoLayout->EnableBrushesL( ETrue );
+    iImageInfoLayout->SetFlag( EAlfVisualFlagManualSize );
+    iImageInfoLayout->SetFlag( EAlfVisualFlagManualPosition );
+    iImageInfoLayout->SetRect( textFieldArea, 0 );
+    iImageInfoLayout->SetPos( TAlfRealPoint( 0 , aVisibleArea.Height() - textFieldArea.Height() ) , 0 );
+
+    // Text for image metadata
+    CAlfTextVisual* text = CAlfTextVisual::AddNewL( *this, iImageInfoLayout );
+    text->SetTextL( KImageCaption1 );
+    text->EnableBrushesL( ETrue );
+    text->SetColor( KRgbWhite );
+    text->SetTagL( _L8( "text1" ) );
+
+    // Background for image metadata
+    CAlfGradientBrush* textBackgroundBrush = CAlfGradientBrush::NewLC( aEnv );
+    textBackgroundBrush->SetColor( KRgbGray );
+    textBackgroundBrush->SetOpacity( 0.5f );
+    textBackgroundBrush->SetLayer( EAlfBrushLayerBackground );
+    iImageInfoLayout->Brushes()->AppendL( textBackgroundBrush, EAlfHasOwnership );
+    CleanupStack::Pop( textBackgroundBrush );
+
+    // Border for image metadata
+    CAlfBorderBrush* border = CAlfBorderBrush::NewLC( aEnv, 2, 2, 5, 5 );
+    border->SetOpacity( 0.5f );
+    iImageInfoLayout->Brushes()->AppendL( border, EAlfHasOwnership );
+    CleanupStack::Pop( border );
+    }
+
+CAlfPerfAppGalleryTestCaseControl::~CAlfPerfAppGalleryTestCaseControl()
+    {
+    CompleteNow( KErrCancel );
+    iImageCaptions.Reset();
+    iImagesToBeFocused.Reset();
+    }
+
+void CAlfPerfAppGalleryTestCaseControl::SetImagesLoadedObserver( MImagesLoadedObserver* aObserver )
+	{
+	iObserver = aObserver;
+	}
+
+// -----------------------------------------------------------------------------
+// Notify observers that all images have been loaded.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppGalleryTestCaseControl::TextureLoadingCompleted(
+		CAlfTexture& /*aTexture*/, TInt /*aTextureId*/, TInt aErrorCode)
+	{
+	// inform if there is any error
+	if( aErrorCode != KErrNone )
+	    {
+	    iObserver->ImagesLoaded( aErrorCode );
+	    }
+
+	iLoadedImages++;
+	if (iLoadedImages == KNumberOfImages)
+		{
+		iObserver->ImagesLoaded( KErrNone );
+		}
+	}
+
+void CAlfPerfAppGalleryTestCaseControl::StartExecuteL( TRequestStatus& aStatus )
+    {
+    iCycleCount = 0;
+    iFocusChangedCount = 0;
+    iGridScrolledCount = 0;
+    iViewportPosition = 0;
+    iPreviousViewportPosition = -1; // no previous position
+    iStatus = &aStatus;
+    *iStatus = KRequestPending;
+
+    TRAPD( err, DoStartExecuteL() );
+    if ( err != KErrNone )
+        {
+        iStatus = NULL;
+        User::Leave( err );
+        }
+    }
+
+void CAlfPerfAppGalleryTestCaseControl::CancelExecution()
+    {
+    CompleteNow( KErrCancel );
+    }
+
+void CAlfPerfAppGalleryTestCaseControl::DoStartExecuteL()
+    {
+    NextScrollCycleL();
+    CompleteAfterL( KTransitionWaitTime );
+    }
+
+void CAlfPerfAppGalleryTestCaseControl::SetVisibleArea(
+        const TRect& /*aVisibleArea*/ )
+    {
+    }
+
+TBool CAlfPerfAppGalleryTestCaseControl::OfferEventL( const TAlfEvent& aEvent )
+    {
+    if ( aEvent.IsCustomEvent() &&
+         aEvent.CustomParameter() == KAlfPerfAppGalleryCmdCompleteNow )
+        {
+        const TInt KNumberOfExecutedMovements = 15;
+        if ( iCycleCount < KNumberOfExecutedMovements )
+        	{
+// Disabling the image focusing between scroll cycles
+#if 0
+        	TInt odd = iCycleCount % 2;
+        	if( odd == 0 )
+        		{
+#endif
+        		NextScrollCycleL();
+        		CompleteAfterL( KTransitionWaitTime );
+#if 0
+        		}
+        	else
+        		{
+        		NextFocusCycleL();
+        		CompleteAfterL( 0 );
+        		}
+#endif
+        	}
+        else
+        	{
+        	CompleteNow( KErrNone );
+        	}
+
+        return ETrue;
+        }
+
+    return CAlfControl::OfferEventL( aEvent );
+    }
+
+void CAlfPerfAppGalleryTestCaseControl::NextScrollCycleL()
+	{
+	static const TReal32 movements[] = { -2, 1, 1 };
+
+	const TInt size = 3; //sizeof movements;
+	const TInt index = iGridScrolledCount % size;
+
+	MoveImages(movements[ index ]);
+
+	++iCycleCount;
+	++iGridScrolledCount;
+	}
+
+
+void CAlfPerfAppGalleryTestCaseControl::NextFocusCycleL()
+	{
+	const TInt size = 3;
+	const TInt index = iFocusChangedCount % size;
+
+	UpdateImageFocus( index );
+
+	++iCycleCount;
+	++iFocusChangedCount;
+	}
+
+
+
+void CAlfPerfAppGalleryTestCaseControl::UpdateImageFocus( TInt aIndex )
+	{
+	// TODO: Checking if textVisual can be found
+	CAlfTextVisual* textVisual = static_cast<CAlfTextVisual*>( FindTag( _L8( "text1" ) ) );
+    TRAP_IGNORE(textVisual->SetTextL( *iImageCaptions.operator[]( aIndex ) ));
+    TRAP_IGNORE(SetImageFocusL( *iImagesToBeFocused.operator[]( aIndex ) ));
+	}
+
+
+void CAlfPerfAppGalleryTestCaseControl::MoveImages(
+    TReal32 aAmount,
+    TReal32 aTransitionTime )
+    {
+    iPreviousViewportPosition = iViewportPosition;
+    iViewportPosition -= aAmount;
+
+    if ( iViewportPosition < 0 )
+        {
+        iViewportPosition = 0;
+        }
+    else if ( iViewportPosition > ( KNumberOfLinesInView - 1.0 ) )
+        {
+        iViewportPosition = KNumberOfLinesInView - 1.0;
+        }
+
+    iViewport->SetViewportPos(
+            TAlfRealPoint( 0, iViewportPosition ),
+        aTransitionTime );
+    }
+
+
+void CAlfPerfAppGalleryTestCaseControl::SetImageFocusL( const TDesC8& aImageTag )
+	{
+
+	//TODO: No checking if FindTag finds anything
+	CAlfImageVisual* visual =
+			static_cast<CAlfImageVisual*>( FindTag( aImageTag ) );
+
+	if( iFocusedVisual && iFocusedVisual->Brushes() )
+		{
+		// TODO: At the moment, no checking of the brush type
+		CAlfBorderBrush* brush =
+				static_cast<CAlfBorderBrush*>( &iFocusedVisual->Brushes()->At( 0 ) );
+		iFocusedVisual->Brushes()->Remove( 0 );
+		}
+
+	if( visual )
+		{
+		CAlfBorderBrush* actualBorder = CAlfBorderBrush::NewLC( Env(), 4, 4, 0, 0 );
+		if(actualBorder)
+		    {
+		    actualBorder->SetColor( KRgbBlue );
+		    }
+		visual->EnableBrushesL( ETrue );
+		visual->Brushes()->AppendL( actualBorder, EAlfHasOwnership );
+		CleanupStack::Pop( actualBorder );
+		}
+
+	iFocusedVisual = visual;
+	}
+
+void CAlfPerfAppGalleryTestCaseControl::CompleteAfterL( TInt aDuration )
+    {
+    // In order to use this service, base class StartExecuteL must
+    // have been called.
+    __ASSERT_ALWAYS( iStatus, User::Invariant() );
+
+    TAlfCustomEventCommand command( KAlfPerfAppGalleryCmdCompleteNow, this );
+    User::LeaveIfError( Env().Send( command, aDuration ) );
+    }
+
+void CAlfPerfAppGalleryTestCaseControl::CompleteNow( TInt aErrorCode )
+    {
+    if ( iStatus )
+        {
+        User::RequestComplete( iStatus, aErrorCode );
+        iStatus = NULL;
+        }
+    }
+
+inline TInt CAlfPerfAppGalleryTestCaseControl::CaseId() const
+    {
+    return iCaseId;
+    }
+
+inline TBool CAlfPerfAppGalleryTestCaseControl::IsExecutionOngoing() const
+    {
+    return ( iStatus != NULL );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappimagetestcase.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1153 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAlfPerfAppImageTestCase implementation.
+*
+*/
+
+
+#include "alfperfappbasetestcasecontrol.h"
+#include "alfperfappimagetestcase.h"
+#include "alfperfapp.hrh"
+#include "alfperfappconfigconstants.h"
+#include <aknutils.h>
+#include <alf/alfenv.h>
+#include <alf/alfdisplay.h>
+#include <alf/alfcontrol.h>
+#include <alf/alfcontrolgroup.h>
+#include <alf/alfroster.h>
+#include <alf/alfcommand.h>
+#include <alf/alfevent.h>
+#include <alf/alftexturemanager.h>
+#include <alf/alfimagevisual.h>
+#include <alf/alfimageloaderutil.h>
+#include <alf/alfutil.h>
+#ifdef __NVG
+    #include <alf/alfbitmapprovider.h>
+#endif
+#include <e32math.h>
+
+#include <alfperfapp_imagetest.mbg>
+
+/*
+ * Square root of sequence length for the image sequence cases
+ */
+const TInt SEQUENCE_LENGTH_SQRT = 7;
+
+/**
+ * Control group for image test cases.
+ */
+const TInt KAlfPerfAppImageControlGroup = 1;
+
+/**
+ * Start next 'cycle' command.
+ */
+const TInt KAlfPerfAppImageCmdNext = 0x5001;
+
+/**
+ * Amount of image visuals.
+ */
+const TInt KAlfPerfAppImageTestCaseBasicImageCount = 16;
+
+/**
+ * Image data for test cases.
+ */
+_LIT( KAlfPerfAppImageTestCaseData, "\\resource\\apps\\alfperfapp_imagetest.mif" );
+_LIT( KAlfPerfAppImageTestCaseNvgCSData, "\\resource\\apps\\alfperfapp_imagetest_NVGCS.mif" );
+// NVG TLV Files have to be loaded from a certain place defined by icontype.cfg (in c:\ root)
+_LIT( KAlfPerfAppImageTestCaseNvgTLVData, "\\data\\nvg_mif\\3musk.mif" );
+
+#ifdef __NVG
+// Enum that defines what icon (normal or NVG) is being used
+// with the basic scale & movement test
+enum TMoveScaleIcon
+    {
+    EMoveScaleIconMif = 0,
+    EMoveScaleIconCS,
+    EMoveScaleIconTLV
+    };
+#endif
+
+/**
+ * Basic image scale & movement test case.
+ */
+class CAlfPerfAppImageTestCaseBasic : public CAlfPerfAppBaseTestCaseControl
+#ifdef __NVG
+                                    , public MAlfBitmapProvider
+#endif
+    {
+public:
+    CAlfPerfAppImageTestCaseBasic();
+    ~CAlfPerfAppImageTestCaseBasic();
+    
+    virtual void ConstructL( 
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea );      
+    virtual void DoStartExecuteL();
+    virtual TBool OfferEventL( const TAlfEvent& aEvent );
+    virtual void SetVisibleArea( const TRect& aVisibleArea );    
+
+#ifdef __NVG
+    void SetIconType( TMoveScaleIcon aIconType );
+#endif
+    
+private:
+    
+    /**
+     * Next cycle.
+     */
+    void NextCycleL();
+    
+    /**
+     * Returns opacity for index.
+     */
+    TReal32 OpacityForIndex( TInt aIndex );
+    
+    /**
+     * Returns size for index.
+     */
+    TAlfRealSize SizeForIndex( TInt aIndex );
+    
+    /**
+     * Returns position for index.
+     */
+    TAlfRealPoint PositionForIndex( TInt aIndex, const TAlfRealSize& aSize );
+ 
+#ifdef __NVG
+    void ProvideBitmapL(TInt aId, CFbsBitmap*& aBitmap, CFbsBitmap*& aMaskBitmap);
+    CFbsBitmap* iBitmapToBeProvided;
+    TMoveScaleIcon iIconType;
+#endif
+    
+private:
+
+    /**
+     * Image visuals.
+     */
+    RPointerArray< CAlfImageVisual > iImages;
+        
+    /**
+     * Cycle counter.
+     */        
+    TInt iCycleCounter;
+    
+    /**
+     * Image loader utility.
+     * Owned.
+     */
+    CAlfImageLoaderUtil* iLoader;
+    };
+        
+/**
+ * Many images at the same time
+ */
+#ifdef __NVG
+class CAlfPerfAppImageTestCaseManyImages : public CAlfPerfAppBaseTestCaseControl, public MAlfBitmapProvider
+#else
+class CAlfPerfAppImageTestCaseManyImages : public CAlfPerfAppBaseTestCaseControl
+#endif
+    {
+public:
+    CAlfPerfAppImageTestCaseManyImages();
+    ~CAlfPerfAppImageTestCaseManyImages();
+    
+    virtual void ConstructL( 
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea, TInt aSequenceIndex, TInt aVisualCount );      
+    virtual void DoStartExecuteL();
+    virtual TBool OfferEventL( const TAlfEvent& aEvent );
+    virtual void SetVisibleArea( const TRect& aVisibleArea ); 
+
+#ifdef __NVG
+    void ProvideBitmapL(TInt /*aId*/, CFbsBitmap*& aBitmap, CFbsBitmap*& /*aMaskBitmap*/);
+#endif
+    
+private:
+    
+    /**
+     * Next cycle.
+     */
+    void NextCycleL();
+    
+    /**
+     * Returns opacity for index.
+     */
+	TBool OpacityForIndex( TInt aIndex, TReal32& aOpacity );
+    
+    /**
+     * Returns size for index.
+     */
+    TBool SizeForIndex( TInt aIndex, TAlfRealSize& aSize );
+    
+    /**
+     * Returns position for index.
+     */
+    TBool PositionForIndex( TInt aIndex, TAlfRealPoint& aPos );
+ 
+
+     
+private:
+
+#ifdef __NVG
+    CFbsBitmap* iBitmapToBeProvided;
+#endif
+    /**
+     * Image visuals.
+     */
+    RPointerArray< CAlfImageVisual > iImages;
+        
+    /**
+     * Cycle counter.
+     */        
+    TInt iCycleCounter;
+    
+    /**
+     * Image loader utility.
+     * Owned.
+     */
+    CAlfImageLoaderUtil* iLoader;
+    
+    
+    /**
+     * Test case parameters
+     */
+    TInt iVisualCount; 				// Number of visual to be created
+    TInt iVisualColums;
+    TInt iVisualRows;
+    TAlfRealPoint iVisualSpeed;    	// Pixels to move between cycles
+    TFileName iImageFileName;		// File name of the texture image file	
+	TInt iImageCount;				// Number of different images
+	TSize iImageSize;				// Image size
+    TAlfTextureFlags iTextureFlags;	// Texture flags	
+    TAlfRealSize iVisualSize;		// Initial size of the visual
+    TAlfRealPoint iVisualSizeVel; 	// Velocity of visual size change per cycle	
+    TInt iSimulatedPointerEventCount; // Number of pointer events sent to visula in one cycle
+    //TSize iAnimatedAreaSize;
+    TInt iLastIndexInAnimatedArea;	// the index of the last visual that is animated, all before this are also animated
+    TInt iSequenceIndex;
+    };
+        
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// Checks if specified case is supported by this class.
+// -----------------------------------------------------------------------------
+//
+TBool CAlfPerfAppImageTestCase::IsSupported( TInt aCaseId )
+    {
+    return aCaseId > EAlfPerfAppImageMin && 
+           aCaseId < EAlfPerfAppImageMax;
+    }
+
+CAlfPerfAppImageTestCase* CAlfPerfAppImageTestCase::NewL( TInt aCaseId, TInt aSequenceIndex )
+    {
+    if ( !IsSupported( aCaseId ) )
+        {
+        User::Leave( KErrNotSupported );
+        }
+
+    CAlfPerfAppImageTestCase* self = 
+        new (ELeave) CAlfPerfAppImageTestCase( aCaseId, aSequenceIndex );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CAlfPerfAppImageTestCase::~CAlfPerfAppImageTestCase()
+    {
+    if ( iEnv && iControl )
+        {
+        iControl->CancelExecution();
+        iEnv->DeleteControlGroup( KAlfPerfAppImageControlGroup );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// Starts setup phase.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppImageTestCase::SetupL( 
+        CAlfEnv& aEnv, const TRect& aVisibleArea, TRequestStatus& aStatus )
+    {
+    
+    iEnv = &aEnv;
+
+    CAlfDisplay* display = 0;
+    CAlfControlGroup& group = iEnv->NewControlGroupL( KAlfPerfAppImageControlGroup );
+    CAlfPerfAppBaseTestCaseControl* control = 0;
+    iTotalVisualCount = -1;
+    iAnimationDivider = 0;
+    
+    if(SequenceIndex() != 0)
+        {
+        // Calculate 
+        TInt caseNum = SEQUENCE_LENGTH_SQRT - (SequenceIndex()-1) / SEQUENCE_LENGTH_SQRT - 1;
+        TReal trg = 0.0;
+        Math::Pow(trg, 2.0, caseNum);
+        iAnimationDivider = trg+0.5;
+        
+        TRect rect;
+        AknLayoutUtils::LayoutMetricsRect( 
+                AknLayoutUtils::EApplicationWindow, 
+                rect );
+        iEnv->SetFullScreenDrawing( ETrue );
+        
+        
+        TInt counter = 10 - ((SequenceIndex()-1)%SEQUENCE_LENGTH_SQRT) - 1; // 2^3...2^9 always choose the 
+        trg = 0.0;
+        Math::Pow(trg, 2.0, counter);
+        iTotalVisualCount = trg+0.5;
+        
+        display = &iEnv->NewDisplayL( rect, CAlfEnv::ENewDisplayFullScreen );
+
+        display->SetClearBackgroundL( CAlfDisplay::EClearWithSkinBackground );
+
+        control = new (ELeave) CAlfPerfAppImageTestCaseManyImages();
+        CleanupStack::PushL( control );
+        ((CAlfPerfAppImageTestCaseManyImages*)control)->ConstructL( *iEnv, iCaseId, aVisibleArea,SequenceIndex(),iTotalVisualCount );
+
+        }
+    else
+        {
+        display = &iEnv->NewDisplayL( aVisibleArea, CAlfEnv::ENewDisplayAsCoeControl);
+        display->SetClearBackgroundL( CAlfDisplay::EClearWithSkinBackground );
+
+        switch ( iCaseId )
+            {
+            case EAlfPerfAppImageBasicMoveScale:
+                control = new (ELeave) CAlfPerfAppImageTestCaseBasic;
+                CleanupStack::PushL( control );
+                control->ConstructL( *iEnv, iCaseId, aVisibleArea );
+                break;
+
+#ifdef __NVG
+            case EAlfPerfAppImageBasicMoveScaleNvgCS:
+                CAlfPerfAppImageTestCaseBasic* temp = new (ELeave) CAlfPerfAppImageTestCaseBasic;
+                temp->SetIconType(EMoveScaleIconCS);
+                control = temp;
+                CleanupStack::PushL( control );
+                control->ConstructL( *iEnv, iCaseId, aVisibleArea);
+                break;
+            
+            case EAlfPerfAppImageBasicMoveScaleNvgTLV:
+                CAlfPerfAppImageTestCaseBasic* temp2 = new (ELeave) CAlfPerfAppImageTestCaseBasic;
+                temp2->SetIconType(EMoveScaleIconTLV); 
+                control = temp2;
+                CleanupStack::PushL( control );
+                control->ConstructL( *iEnv, iCaseId, aVisibleArea);
+                break;
+                
+            case EAlfPerfAppImageManyNvgCSImages:
+            case EAlfPerfAppImageManyNvgTLVImages:
+#endif
+            case EAlfPerfAppImageManyImages:
+            case EAlfPerfAppImageManyGifImages:
+            case EAlfPerfAppImageManyPngImages:
+            case EAlfPerfAppImageManySvgImages:
+            case EAlfPerfAppImageManyImagesWithPointerEvent:
+            case EAlfPerfAppImageManyImagesWithAutoSize:
+            case EAlfPerfAppImageAnimateFull:
+            case EAlfPerfAppImageAnimate1of2:
+            case EAlfPerfAppImageAnimate1of4:
+            case EAlfPerfAppImageAnimate1of8:
+                control = new (ELeave) CAlfPerfAppImageTestCaseManyImages;
+    			CleanupStack::PushL( control );
+    			((CAlfPerfAppImageTestCaseManyImages*)control)->ConstructL( *iEnv, iCaseId, aVisibleArea,SequenceIndex(),iTotalVisualCount );
+                break;
+
+            default:
+                User::Leave( KErrNotSupported );
+                break;
+            }
+
+        }
+    group.AppendL( control ); // ownership passed to control group.
+    iControl = control;
+    CleanupStack::Pop( control );    
+    
+    display->Roster().ShowL( group );
+    
+    // This must be last statement.
+    CAlfPerfAppTestCase::CompleteNow( aStatus, KErrNone );
+    }
+
+// -----------------------------------------------------------------------------
+// Starts execution phase.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppImageTestCase::ExecuteL( TRequestStatus& aStatus )
+    {
+    // SetupL must have been called first.
+    __ASSERT_ALWAYS( iEnv, User::Invariant() );
+    __ASSERT_ALWAYS( iControl, User::Invariant() );
+    
+    iControl->StartExecuteL( aStatus );
+    }
+
+// -----------------------------------------------------------------------------
+// Tears down.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppImageTestCase::TearDown()
+    {
+    // Execution side will delete CAlfEnv, so it will delete everything
+    // related to this.
+    iEnv = NULL;
+    iControl = NULL;
+    }
+
+void CAlfPerfAppImageTestCase::HandleVisibleAreaChange( const TRect& aRect )
+    {
+    if ( iEnv && iControl )
+        {
+        if ( iEnv->DisplayCount() > 0 )
+            {
+            iEnv->PrimaryDisplay().SetVisibleArea( aRect );
+            }
+        iControl->SetVisibleArea( aRect );
+        }
+    }
+
+TInt CAlfPerfAppImageTestCase::CaseID()
+    {
+    return iCaseId;
+    }
+
+CAlfPerfAppImageTestCase::CAlfPerfAppImageTestCase( TInt aCaseId, TInt aSequenceIndex )
+    : CAlfPerfAppTestCase(aSequenceIndex), iCaseId ( aCaseId )
+    {
+    }
+
+void CAlfPerfAppImageTestCase::ConstructL()
+    {
+    }
+
+// Implementation of CAlfPerfAppImageTestCaseBasic:
+#ifdef __NVG
+CAlfPerfAppImageTestCaseBasic::CAlfPerfAppImageTestCaseBasic(): iIconType(EMoveScaleIconMif)
+#else
+CAlfPerfAppImageTestCaseBasic::CAlfPerfAppImageTestCaseBasic()
+#endif
+    {
+    }
+
+CAlfPerfAppImageTestCaseBasic::~CAlfPerfAppImageTestCaseBasic()
+    {
+    iImages.Close();
+    
+    delete iLoader;
+    }
+
+void CAlfPerfAppImageTestCaseBasic::ConstructL( 
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea )
+    {
+    CAlfPerfAppBaseTestCaseControl::ConstructL( aEnv, aCaseId, aVisibleArea );
+    CAlfTextureManager& textureManager = aEnv.TextureManager();
+    
+    iLoader = new (ELeave) CAlfImageLoaderUtil;
+    iLoader->SetSize( TSize( 64, 64 ) );
+    
+    const TInt max = 4;
+    TInt count = 0;
+    TInt baseId = 16384;
+    
+    TFileName imageFile;
+
+#ifdef __NVG
+    TBool isNvg = EFalse;
+    if (iIconType == EMoveScaleIconCS)
+        {
+        imageFile.Append( KAlfPerfAppImageTestCaseNvgCSData );
+        isNvg = ETrue;
+        }
+    else if (iIconType == EMoveScaleIconTLV)
+        {
+        imageFile.Append( KAlfPerfAppImageTestCaseNvgTLVData );
+        isNvg = ETrue;
+        }
+    else if (iIconType == EMoveScaleIconMif)
+        {
+        imageFile.Append( KAlfPerfAppImageTestCaseData );
+        }
+    else
+        {
+        // Error! Leave
+        User::Leave(KErrArgument);
+        }
+    // Add the drive letter to the imageFile path
+    ::CompleteWithAppPath( imageFile );
+#else
+    imageFile.Append( KAlfPerfAppImageTestCaseData );
+    ::CompleteWithAppPath( imageFile );
+#endif
+    
+    while ( count < max && baseId < EMbmAlfperfapp_imagetestLastElement )
+        {
+#ifdef __NVG
+        if (isNvg)
+            {
+            TAlfTextureFlags flags = EAlfTextureFlagDefault;
+            // Use the modified AknIconUtils to create the extended bitmap
+            CFbsBitmap* extendedBitmap;
+            CFbsBitmap* extendedMask;
+            if(iIconType == EMoveScaleIconTLV)
+                {
+                // The TLV icon file has only one icon
+                AknIconUtils::CreateIconL(extendedBitmap, extendedMask, imageFile, 16384, 16385);
+                }
+            else
+                {
+                AknIconUtils::CreateIconL(extendedBitmap, extendedMask, imageFile, baseId, baseId + 1);
+                }
+            AknIconUtils::ExcludeFromCache(extendedBitmap);
+            AknIconUtils::SetSize( extendedBitmap, TSize(64,64) );
+            
+            // This will be returned, when ProvideBitmapL is called for creating the texture
+            //delete iBitmapToBeProvided;
+            iBitmapToBeProvided = extendedBitmap;
+            delete extendedMask;
+            
+            count++;
+            textureManager.CreateTextureL(count, this, flags);
+            }
+        else
+            {
+            // Else load the icons normally from the mif file
+            count++;
+            textureManager.CreateTextureL(
+                count,
+                iLoader->CreateImageLoaderL(
+                    KAknsIIDNone,
+                    imageFile,
+                    baseId,
+                    baseId + 1 ),
+                EAlfTextureFlagDefault );
+            }
+#else
+        count++;
+        textureManager.CreateTextureL(
+            count,
+            iLoader->CreateImageLoaderL(
+                KAknsIIDNone,
+                imageFile,
+                baseId,
+                baseId + 1 ),
+            EAlfTextureFlagDefault );
+#endif
+        baseId += 2; // odd values are masks
+        }
+    
+    for ( TInt ii = 0; ii < KAlfPerfAppImageTestCaseBasicImageCount; ii++ )
+        {
+        CAlfImageVisual* visual = CAlfImageVisual::AddNewL( *this );
+        visual->SetFlag( EAlfVisualFlagManualLayout );
+        visual->SetOpacity( 1.0f );
+        
+        visual->SetOpacity( OpacityForIndex( ii ) );
+        TAlfRealSize sz = SizeForIndex( ii );
+        visual->SetSize( sz );
+        visual->SetPos( PositionForIndex( ii, sz ) );
+        
+        const CAlfTexture* texture = textureManager.Texture( 1 + ( ii & 3 ) );
+        TAlfImage image( *texture );
+        visual->SetImage( image );
+        
+        iImages.AppendL( visual );        
+        }
+    }
+    
+#ifdef __NVG
+void CAlfPerfAppImageTestCaseBasic::SetIconType(TMoveScaleIcon aIconType)
+    {
+    iIconType = aIconType;
+    }
+#endif
+
+void CAlfPerfAppImageTestCaseBasic::DoStartExecuteL()
+    {
+    NextCycleL();
+    
+    CompleteAfterL( 5000 );
+    }
+
+void CAlfPerfAppImageTestCaseBasic::SetVisibleArea( 
+        const TRect& /*aVisibleArea*/ )
+    {
+    if ( IsExecutionOngoing() )
+        {
+        Env().CancelCustomCommands( this, KAlfPerfAppImageCmdNext );
+        TRAPD( err, NextCycleL() );
+        if ( err != KErrNone )
+            {
+            CompleteNow( err );
+            }
+        }
+    }
+
+TBool CAlfPerfAppImageTestCaseBasic::OfferEventL( const TAlfEvent& aEvent )
+    {
+    if ( aEvent.IsCustomEvent() && 
+         aEvent.CustomParameter() == KAlfPerfAppImageCmdNext )
+        {
+        TRAPD( err, NextCycleL() );
+        if ( err != KErrNone )
+            {
+            CompleteNow( err );
+            }
+        return ETrue;
+        }
+    
+    return CAlfPerfAppBaseTestCaseControl::OfferEventL( aEvent );
+    }
+
+void CAlfPerfAppImageTestCaseBasic::NextCycleL()
+    {
+    TAlfCustomEventCommand command( KAlfPerfAppImageCmdNext, this );
+    User::LeaveIfError( Env().Send( command, 500 ) );
+    
+    iCycleCounter++;
+    
+    for ( TInt ii = 0; ii < iImages.Count(); ii++ )
+        {
+        CAlfImageVisual* visual = iImages[ ii ];
+                            
+        TInt speed = KVisualAnimSpeed;
+        if ( ii & 1 )
+            {
+            speed /= 2;
+            }
+
+        visual->SetOpacity( TAlfTimedValue( OpacityForIndex( ii ), speed ) );
+        TAlfRealSize sz = SizeForIndex( ii );
+        visual->SetSize( sz, speed );
+        visual->SetPos( PositionForIndex( ii, sz ), speed );                                    
+        }
+    }
+
+TReal32 CAlfPerfAppImageTestCaseBasic::OpacityForIndex( TInt aIndex )
+    {
+    switch ( ( iCycleCounter + aIndex ) % 3 ) 
+        {
+        case 0:
+            return 1.0f;
+        case 1:
+            return 0.5f;
+        case 2:
+        default:
+            return 0.25f;
+        }
+    }
+
+TAlfRealSize CAlfPerfAppImageTestCaseBasic::SizeForIndex( TInt aIndex )
+    {
+    switch ( ( iCycleCounter + aIndex ) % 3 ) 
+        {
+        case 0:
+            return TAlfRealSize( 25.f, 25.f );
+        case 1:
+            return TAlfRealSize( 50.f, 50.f );
+        case 2:
+        default:
+            return TAlfRealSize( 100.f, 100.f );
+        }
+    }
+    
+TAlfRealPoint CAlfPerfAppImageTestCaseBasic::PositionForIndex( 
+        TInt aIndex, const TAlfRealSize& aSize )
+    {
+    const TSize KSize( Env().PrimaryDisplay().VisibleArea().Size() );
+    
+    switch ( ( iCycleCounter + aIndex ) & 3 )
+        {
+        case 0:
+            return TAlfRealPoint( 0.0f, 0.0f ); 
+            
+        case 1:
+            return TAlfRealPoint( KSize.iWidth - aSize.iWidth, KSize.iHeight - aSize.iHeight ); 
+            
+        case 2:
+            return TAlfRealPoint( KSize.iWidth - aSize.iWidth, 0.0f ); 
+            
+        case 3:
+        default:
+            return TAlfRealPoint( 0.0f, KSize.iHeight - aSize.iHeight ); 
+        }
+    }
+
+#ifdef __NVG
+void CAlfPerfAppImageTestCaseBasic::ProvideBitmapL(TInt /*aId*/, CFbsBitmap*& aBitmap, CFbsBitmap*& /*aMaskBitmap*/)
+    {
+    aBitmap = iBitmapToBeProvided;
+    }
+#endif
+
+// Implementation of CAlfPerfAppImageTestCaseManyImages:
+
+CAlfPerfAppImageTestCaseManyImages::CAlfPerfAppImageTestCaseManyImages()
+    {
+    }
+
+CAlfPerfAppImageTestCaseManyImages::~CAlfPerfAppImageTestCaseManyImages()
+    {
+    iImages.Close();
+    
+    delete iLoader;
+    }
+    
+void CAlfPerfAppImageTestCaseManyImages::ConstructL( 
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea, TInt aSequenceIndex, TInt aVisualCount )
+    {
+    CAlfPerfAppBaseTestCaseControl::ConstructL( aEnv, aCaseId, aVisibleArea );
+    CAlfTextureManager& textureManager = aEnv.TextureManager();
+    
+    TFileName privatePath;
+    CEikonEnv::Static()->FsSession().PrivatePath( privatePath );
+    ::CompleteWithAppPath( privatePath );
+    textureManager.SetImagePathL( privatePath );
+    
+	TSize displaySize(Env().PrimaryDisplay().VisibleArea().Size());
+    TInt KItemStep = 20;
+    
+    // Parameters for test cases
+    
+    iImageFileName 			= _L("\\resource\\apps\\alfperfapp_imagetest.mif");	
+    iVisualSpeed 			= TAlfRealPoint(1,0); 	
+	iImageCount 			= 4;
+    iVisualCount 			= (aVisualCount != -1) ? aVisualCount : KVisualCout;	
+    iVisualColums			= displaySize.iWidth/KItemStep;
+    iVisualRows				= displaySize.iHeight/KItemStep;;
+    iTextureFlags 			= EAlfTextureFlagDefault;	
+	iVisualSize				= TAlfRealSize( 25.f, 25.f );
+    iVisualSizeVel			= TAlfRealPoint();	
+	iSimulatedPointerEventCount = 0;
+	iLastIndexInAnimatedArea 	= iVisualCount;
+	iImageSize					= TSize( 64, 64 );
+	iSequenceIndex 				= aSequenceIndex;
+	
+	if (iSequenceIndex != 0)
+		{
+      	TInt caseNum = SEQUENCE_LENGTH_SQRT - (aSequenceIndex-1) / SEQUENCE_LENGTH_SQRT - 1;
+       	TReal trg = 0.0;
+       	Math::Pow(trg, 2.0, caseNum);
+       	TInt pow = trg+0.5;
+       	TReal animatedAreaRelativeSize = 1.f/pow;
+       	
+       	iImageFileName = _L("alfperfapp_imagetest.png");
+    	iLastIndexInAnimatedArea = iVisualCount*animatedAreaRelativeSize+0.5;
+    	iLastIndexInAnimatedArea = (iLastIndexInAnimatedArea < 1) ? 1 : iLastIndexInAnimatedArea;
+       	RDebug::Print(_L("CAlfPerfAppImageTestCaseManyImages::ConstructL(). Animated visual count = %d, percentage=%3.2f"), iLastIndexInAnimatedArea, animatedAreaRelativeSize);
+    	
+		trg = 0.0;
+		Math::Sqrt(trg,TReal(iVisualCount));
+    	iVisualColums = (trg + 0.5);
+		iVisualRows = ((TReal)iVisualCount/iVisualColums) + 0.5;
+
+		TSize displaySize(Env().PrimaryDisplay().VisibleArea().Size());
+		iVisualSize = TAlfRealSize((TReal32)displaySize.iWidth/iVisualColums, (TReal32)displaySize.iHeight/iVisualRows);
+		iImageCount = 1;	
+		iImageSize	= TSize(iVisualSize.iWidth+0.5, iVisualSize.iHeight+0.5);
+
+       	iTextureFlags = EAlfTextureFlagDoNotRetainResolution;
+		}
+    else
+    	{
+    	   
+	    switch(CaseId())
+	    	{
+	        case EAlfPerfAppImageManyImages:
+	        	break;
+	       
+	        case EAlfPerfAppImageManyGifImages:
+	            iImageFileName = _L("alfperfapp_imagetest.gif");
+	        	break;
+	       
+	        case EAlfPerfAppImageManyPngImages:
+	            iImageFileName = _L("alfperfapp_imagetest.png");
+	        	break;
+	       
+	        case EAlfPerfAppImageManySvgImages:
+	            iImageFileName = _L("alfperfapp_imagetest.svg");
+	        	break;
+#ifdef __NVG
+	        case EAlfPerfAppImageManyNvgCSImages:
+	            iImageFileName = KAlfPerfAppImageTestCaseNvgCSData;
+                //iImageFileName = _L("icons_mif_new2.mif");
+                break;
+
+	        case EAlfPerfAppImageManyNvgTLVImages:
+				iImageFileName = KAlfPerfAppImageTestCaseNvgTLVData;
+	            //iImageFileName = _L("TLV\\3musk.mif");
+	            break;
+#endif
+	        case EAlfPerfAppImageManyImagesWithPointerEvent:
+	        	iSimulatedPointerEventCount = 10;
+	        	break;
+	       
+	        case EAlfPerfAppImageManyImagesWithAutoSize:
+        		iTextureFlags = EAlfTextureFlagAutoSize;
+        		iVisualSizeVel = TAlfRealPoint(10,10);
+	        	break;
+	        	
+	        case EAlfPerfAppImageAnimateFull:
+	        	{
+    			iVisualCount = KVisualCout;	
+				iLastIndexInAnimatedArea 	= iVisualCount * KRelativeAnimatedArea ;
+				iImageFileName = _L("alfperfapp_imagetest.svg");
+	        	
+       			TReal trg = 0.0;
+       			Math::Sqrt(trg,TReal(iVisualCount));
+	        	iVisualColums = (trg + 0.5);
+       			iVisualRows = ((TReal)iVisualCount/iVisualColums) + 0.5;
+
+       			iVisualSize = TAlfRealSize((TReal32)displaySize.iWidth/iVisualColums, (TReal32)displaySize.iHeight/iVisualRows);
+ 	    		iImageCount = 1;	
+ 				iImageSize	= TSize(iVisualSize.iWidth+0.5, iVisualSize.iHeight+0.5);
+
+	        	break;
+	        	}
+	        case EAlfPerfAppImageAnimate1of2:
+	        	{
+	        	TReal animatedAreaRelativeSize = 1.f/2.f;
+    			iVisualCount = KVisualCout;	
+    			iImageFileName = _L("alfperfapp_imagetest.svg");
+	        	iLastIndexInAnimatedArea = iVisualCount*animatedAreaRelativeSize;
+	        	
+       			TReal trg = 0.0;
+       			Math::Sqrt(trg,TReal(iVisualCount));
+	        	iVisualColums = (trg + 0.5);
+       			iVisualRows = ((TReal)iVisualCount/iVisualColums) + 0.5;
+
+       			iVisualSize = TAlfRealSize((TReal32)displaySize.iWidth/iVisualColums, (TReal32)displaySize.iHeight/iVisualRows);
+ 	    		iImageCount = 1;	
+ 				iImageSize	= TSize(iVisualSize.iWidth+0.5, iVisualSize.iHeight+0.5);
+
+	        	break;
+	        	}
+	       
+	        case EAlfPerfAppImageAnimate1of4:
+	        	{	
+	        	TReal animatedAreaRelativeSize = 1.f/4.f;
+    			iVisualCount = KVisualCout;	
+    			iImageFileName = _L("alfperfapp_imagetest.svg");
+	        	iLastIndexInAnimatedArea = iVisualCount*animatedAreaRelativeSize;
+	        	
+       			TReal trg = 0.0;
+       			Math::Sqrt(trg,TReal(iVisualCount));
+	        	iVisualColums = (trg + 0.5);
+       			iVisualRows = ((TReal)iVisualCount/iVisualColums) + 0.5;
+
+       			iVisualSize = TAlfRealSize((TReal32)displaySize.iWidth/iVisualColums, (TReal32)displaySize.iHeight/iVisualRows);
+ 	    		iImageCount = 1;	
+ 				iImageSize	= TSize(iVisualSize.iWidth+0.5, iVisualSize.iHeight+0.5);
+
+	        	break;
+	        	}
+	       
+	        case EAlfPerfAppImageAnimate1of8:
+	        	{
+	        	TReal animatedAreaRelativeSize = 1.f/8.f;
+    			iVisualCount = KVisualCout;	
+    			iImageFileName = _L("alfperfapp_imagetest.svg");
+	        	iLastIndexInAnimatedArea = iVisualCount*animatedAreaRelativeSize;
+	        	
+       			TReal trg = 0.0;
+       			Math::Sqrt(trg,TReal(iVisualCount));
+	        	iVisualColums = (trg + 0.5);
+       			iVisualRows = ((TReal)iVisualCount/iVisualColums) + 0.5;
+
+       			iVisualSize = TAlfRealSize((TReal32)displaySize.iWidth/iVisualColums, (TReal32)displaySize.iHeight/iVisualRows);
+ 	    		iImageCount = 1;	
+ 				iImageSize	= TSize(iVisualSize.iWidth+0.5, iVisualSize.iHeight+0.5);
+
+	        	break;
+	        	}
+	       
+	    	default:
+	            User::Leave( KErrNotSupported );
+	            break;
+	 		}
+    	}
+    
+    TParsePtr parse(iImageFileName);
+    	
+    
+#ifdef __NVG
+    if ( (CaseId() == EAlfPerfAppImageManyNvgCSImages || 
+         CaseId() == EAlfPerfAppImageManyNvgTLVImages) && 
+         parse.Ext().CompareF(_L(".mif")) == KErrNone)
+        {
+        TAlfTextureFlags flags = EAlfTextureFlagDefault;
+        // Use the modified AknIconUtils to create the extended bitmap
+        CFbsBitmap* extendedBitmap;
+        CFbsBitmap* extendedMask;
+        
+        AknIconUtils::CreateIconL( extendedBitmap, extendedMask, iImageFileName, 16384, 16385);
+        AknIconUtils::ExcludeFromCache(extendedBitmap);
+        AknIconUtils::SetSize( extendedBitmap, TSize(64,64) );
+        
+        // This will be returned, when ProvideBitmapL is called for creating the texture
+        delete iBitmapToBeProvided;
+        iBitmapToBeProvided = extendedBitmap;
+        // We don't need the mask
+        delete extendedMask;
+        
+        for ( TInt count = 0;  count < iImageCount; count++ )
+            {
+            CAlfTexture& texture = textureManager.CreateTextureL(count+1, this, flags);
+            }
+        }
+    else if (parse.Ext().CompareF(_L(".mif")) == KErrNone)
+#else
+    if (parse.Ext().CompareF(_L(".mif")) == KErrNone)
+#endif
+        {    	
+    	iLoader = new (ELeave) CAlfImageLoaderUtil;
+    	iLoader->SetSize( iImageSize );
+    	
+    	// mif file is from absolute path \\resource\\apps\\
+    	textureManager.SetImagePathL(_L(""));
+    	
+    	TInt baseId = 16384;
+    	TInt count = 0;    	
+	    while ( count < iImageCount )
+	        {        
+	        count++;
+	        textureManager.CreateTextureL(
+	            count,
+	            iLoader->CreateImageLoaderL(
+	                KAknsIIDNone,
+	                iImageFileName,
+	                baseId,
+	                baseId + 1 ),
+	            	iTextureFlags );
+	        baseId += 2; // odd values are masks 
+	        }   
+       	}
+    else if (parse.Ext().CompareF(_L(".svg")) == KErrNone)
+
+    	{    	
+    	iLoader = new (ELeave) CAlfImageLoaderUtil;
+    	iLoader->SetSize( iImageSize );
+    
+    	TInt count = 0;    	
+	    while ( count < iImageCount )
+	        {        
+	        count++;
+	        textureManager.CreateTextureL(
+	            count,
+	            iLoader->CreateSVGImageLoaderL(
+	                iImageFileName),
+	            iTextureFlags );
+	        }   
+       	}
+    else
+    	{
+	    for ( TInt count = 0;  count < iImageCount; count++ )
+	        {        
+	        CAlfTexture& texture = textureManager.LoadTextureL(iImageFileName, iTextureFlags, count+1);
+	        }   
+    	}
+       	
+ 	for ( TInt ii = 0; ii < iVisualCount; ii++ )
+        {
+        CAlfImageVisual* visual = CAlfImageVisual::AddNewL( *this );
+        iImages.AppendL( visual );        
+
+        visual->SetFlag( EAlfVisualFlagManualLayout );
+        visual->SetOpacity( 1.0f );
+        TReal32 opacity = 1.0;
+        if (OpacityForIndex( ii, opacity ))
+        	{
+   	        visual->SetOpacity( opacity );                                 
+        	}
+        visual->SetSize( iVisualSize );
+        TAlfRealSize size(0,0);
+        if (SizeForIndex( ii, size ))
+        	{
+   	        visual->SetSize( size );                                  
+        	}
+        
+        visual->SetPos( TAlfRealPoint(0,0) );
+        TAlfRealPoint pos(0,0);
+        if (PositionForIndex( ii, pos ))
+        	{
+   	        visual->SetPos( pos );                                    
+        	}
+        
+        const CAlfTexture* texture = textureManager.Texture( 1 + ( ii % iImageCount ) );
+        TAlfImage image( *texture );
+        visual->SetImage( image );
+        
+        }
+    }
+    
+#ifdef __NVG
+void CAlfPerfAppImageTestCaseManyImages::ProvideBitmapL(TInt /*aId*/, CFbsBitmap*& aBitmap, CFbsBitmap*& /*aMaskBitmap*/)
+    {
+    CFbsBitmap* bmp = new(ELeave) CFbsBitmap();
+    bmp->Duplicate(iBitmapToBeProvided->Handle());
+    aBitmap = bmp;
+    };
+#endif
+
+void CAlfPerfAppImageTestCaseManyImages::DoStartExecuteL()
+    {
+    NextCycleL();
+    
+    CompleteAfterL( 5000 );
+    }
+
+void CAlfPerfAppImageTestCaseManyImages::SetVisibleArea( 
+        const TRect& /*aVisibleArea*/ )
+    {
+    if ( IsExecutionOngoing() )
+        {
+        Env().CancelCustomCommands( this, KAlfPerfAppImageCmdNext );
+        TRAPD( err, NextCycleL() );
+        if ( err != KErrNone )
+            {
+            CompleteNow( err );
+            }
+        }
+    }
+
+TBool CAlfPerfAppImageTestCaseManyImages::OfferEventL( const TAlfEvent& aEvent )
+    {
+    if ( aEvent.IsCustomEvent() && 
+         aEvent.CustomParameter() == KAlfPerfAppImageCmdNext )
+        {
+        TRAPD( err, NextCycleL() );
+        if ( err != KErrNone )
+            {
+            CompleteNow( err );
+            }
+        return ETrue;
+        }
+    
+    return CAlfPerfAppBaseTestCaseControl::OfferEventL( aEvent );
+    }
+
+void CAlfPerfAppImageTestCaseManyImages::NextCycleL()
+    {
+    TAlfCustomEventCommand command( KAlfPerfAppImageCmdNext, this );
+    User::LeaveIfError( Env().Send( command, 500 ) );
+    
+    iCycleCounter++;
+    
+    // Update cycle state
+    for ( TInt ii = 0; ii < iImages.Count(); ii++ )
+        {
+        CAlfImageVisual* visual = iImages[ ii ];
+                            
+        TInt speed = KVisualAnimSpeed;
+        TReal32 opacity = 1.0;
+        if (OpacityForIndex( ii, opacity ))
+        	{
+   	        visual->SetOpacity( TAlfTimedValue( opacity, speed ) );                                 
+        	}
+        TAlfRealSize size(0,0);
+        if (SizeForIndex( ii, size ))
+        	{
+   	        visual->SetSize( size, speed );                                  
+        	}      
+        
+        TAlfRealPoint pos(0,0);
+        if (PositionForIndex( ii, pos ))
+        	{
+   	        visual->SetPos( pos, speed );                                    
+        	}
+        }
+    
+    // Send pointer events, if wanted    
+    for (TInt i=0; i <iSimulatedPointerEventCount; i++)
+    	{
+    	const TSize KSize( Env().PrimaryDisplay().VisibleArea().Size() );
+ 
+   		TPoint pos(AlfUtil::RandomInt(0, KSize.iWidth-1), AlfUtil::RandomInt(0, KSize.iWidth-1));
+   		
+   		// down
+    	TPointerEvent eventDown(TPointerEvent::EButton1Down, 0, pos, TPoint(0,0));
+   	    Env().PrimaryDisplay().HandlePointerEventL( eventDown );
+   	    
+   	    //up
+    	TPointerEvent eventUp(TPointerEvent::EButton1Up, 0, pos, TPoint(0,0));
+   	    Env().PrimaryDisplay().HandlePointerEventL( eventUp );
+    	}        
+    }
+
+TBool CAlfPerfAppImageTestCaseManyImages::OpacityForIndex( TInt aIndex, TReal32 &aOpacity )
+    {
+    if (aIndex <= iLastIndexInAnimatedArea)
+    	{
+    	if (iCycleCounter&0x01)
+    		{
+    		aOpacity = 0.4;
+    		}
+    	else
+    		{
+    		aOpacity = 0.8;
+    		}
+    	return ETrue;	
+    	}
+        
+    
+   	return EFalse;	
+	
+    }
+
+
+TBool CAlfPerfAppImageTestCaseManyImages::SizeForIndex( TInt aIndex, TAlfRealSize& aSize )
+    {
+    // Call only if needed as Size().Target() will flush the command buffer!
+    if ((iVisualSizeVel.iX != 0) && (iVisualSizeVel.iY != 0))
+    	{
+   		TAlfRealSize size = iImages[ aIndex ]->Size().Target();
+    	aSize = TAlfRealSize( size.iWidth + iVisualSizeVel.iX, size.iHeight + iVisualSizeVel.iY );
+    	return ETrue;
+    	}
+    return EFalse;	
+    }
+    
+    
+TBool CAlfPerfAppImageTestCaseManyImages::PositionForIndex( 
+        TInt aIndex, TAlfRealPoint& aPos )
+    {
+    if (iCycleCounter == 0 || aIndex <= iLastIndexInAnimatedArea)
+    	{
+    	TInt index = aIndex + iCycleCounter;
+    	TInt gridIndex = index;
+    	TInt columnPos = gridIndex % iVisualColums;
+    	TInt rowPos = aIndex / iVisualColums;
+     	columnPos = columnPos % iVisualColums;
+    	aPos = TAlfRealPoint( columnPos*iVisualSize.iWidth, rowPos*iVisualSize.iHeight );   		    	
+        return ETrue;
+   		}
+   	else
+   		{
+        return EFalse;
+   		}
+    }
+
+
+TTestCaseSpecificResultText CAlfPerfAppImageTestCase::getCaseSpecificResultL()
+    {
+    TTestCaseSpecificResultText result = HBufC::NewL(KAlfPerfAppMaxCharsInSpecificResultText);
+    if(SequenceIndex() != 0 && CaseID() == EAlfPerfAppImageManyImages)
+        {
+        result->Des().Append(_L("Total Visual Count: "));
+        result->Des().AppendNum(iTotalVisualCount);
+        result->Des().Append(_L(" Animated: 1/"));
+        result->Des().AppendNum(iAnimationDivider);
+        }
+    return result;
+        
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfapplayouttestcase.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,379 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAlfPerfAppLayoutTestCase implementation.
+*
+*/
+
+
+#include "alfperfappbasetestcasecontrol.h"
+#include "alfperfapplayouttestcase.h"
+#include "alfperfapp.hrh"
+
+#include <aknutils.h>
+#include <alf/alfenv.h>
+#include <alf/alfdisplay.h>
+#include <alf/alfcontrol.h>
+#include <alf/alfcontrolgroup.h>
+#include <alf/alfroster.h>
+#include <alf/alfcommand.h>
+#include <alf/alfevent.h>
+#include <alf/alftexturemanager.h>
+#include <alf/alfimagevisual.h>
+#include <alf/alfimageloaderutil.h>
+#include <alf/alfutil.h>
+#include <alf/alfgridlayout.h>
+#include <alf/alfcurvepathlayout.h>
+#include <alf/alfdecklayout.h>
+#include <alf/alfflowlayout.h>
+#include <alf/alfanchorlayout.h>
+#include <alf/alfviewportlayout.h>
+
+#include <alfperfapp_imagetest.mbg>
+
+/**
+ * Control group for test cases.
+ */
+const TInt KAlfPerfAppLayoutControlGroup = 1;
+
+/**
+ * Start next 'cycle' command.
+ */
+const TInt KAlfPerfAppLayoutCmdNext = 0x5001;
+
+/**
+ * Testing layouts
+ */
+class CAlfPerfAppLayoutTestCaseControl : public CAlfPerfAppBaseTestCaseControl
+    {
+public:
+    CAlfPerfAppLayoutTestCaseControl();
+    ~CAlfPerfAppLayoutTestCaseControl();
+    
+    virtual void ConstructL( 
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea );      
+    virtual void DoStartExecuteL();
+    virtual TBool OfferEventL( const TAlfEvent& aEvent );
+    virtual void SetVisibleArea( const TRect& aVisibleArea );    
+
+private:
+    
+    /**
+     * Next cycle.
+     */
+    void NextCycleL();
+         
+private:
+    /**
+     * Test case of which execution this instance was created.
+     */ 
+    TInt iCaseId;
+    
+    /**
+     * Image visuals.
+     */
+    RPointerArray< CAlfImageVisual > iImages;
+        
+    /**
+     * Cycle counter.
+     */        
+    TInt iCycleCounter;
+    
+    /**
+     * Image loader utility.
+     * Owned.
+     */
+    CAlfImageLoaderUtil* iLoader;
+    
+    
+    /**
+     * Main layout
+     * Owned.
+     */
+    CAlfLayout* iLayout;
+    
+    /**
+     * Test case parameters
+     */
+    TInt iVisualCount; 				// Number of visual to be created
+    TFileName iImageFileName;		// File name of the texture image file	
+	TInt iImageCount;				// Number of different images
+    TAlfTextureFlags iTextureFlags;	// Texture flags	
+    TAlfRealSize iVisualSize;		// Initial size of the visual
+    };
+        
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// Checks if specified case is supported by this class.
+// -----------------------------------------------------------------------------
+//
+TBool CAlfPerfAppLayoutTestCase::IsSupported( TInt aCaseId )
+    {
+    return aCaseId > EAlfPerfAppLayoutMin && 
+           aCaseId < EAlfPerfAppLayoutMax;
+    }
+
+CAlfPerfAppLayoutTestCase* CAlfPerfAppLayoutTestCase::NewL( TInt aCaseId, TInt aSequenceIndex )
+    {
+    if ( !IsSupported( aCaseId ) )
+        {
+        User::Leave( KErrNotSupported );
+        }
+
+    CAlfPerfAppLayoutTestCase* self = 
+        new (ELeave) CAlfPerfAppLayoutTestCase( aCaseId, aSequenceIndex);
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CAlfPerfAppLayoutTestCase::~CAlfPerfAppLayoutTestCase()
+    {
+    if ( iEnv && iControl )
+        {
+        iControl->CancelExecution();
+        iEnv->DeleteControlGroup( KAlfPerfAppLayoutControlGroup );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// Starts setup phase.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppLayoutTestCase::SetupL( 
+        CAlfEnv& aEnv, const TRect& aVisibleArea, TRequestStatus& aStatus )
+    {
+    iEnv = &aEnv;
+    
+    CAlfDisplay& display = 
+        iEnv->NewDisplayL( aVisibleArea, CAlfEnv::ENewDisplayAsCoeControl );
+    display.SetClearBackgroundL( CAlfDisplay::EClearWithSkinBackground );
+
+    CAlfControlGroup& group = 
+        iEnv->NewControlGroupL( KAlfPerfAppLayoutControlGroup );
+
+    CAlfPerfAppBaseTestCaseControl* control = NULL;
+    
+    switch ( iCaseId )
+        {
+        case EAlfPerfAppLayoutGrid:
+        case EAlfPerfAppLayoutDeck:
+        case EAlfPerfAppLayoutAnchor:
+        case EAlfPerfAppLayoutCurvePath:
+        case EAlfPerfAppLayoutFlow:
+        case EAlfPerfAppLayoutViewport:
+            control = new (ELeave) CAlfPerfAppLayoutTestCaseControl;
+            break;
+                        
+        default:
+            User::Leave( KErrNotSupported );
+            break;
+        }
+        
+    CleanupStack::PushL( control );
+    control->ConstructL( *iEnv, iCaseId, aVisibleArea );
+    group.AppendL( control ); // ownership passed to control group.
+    iControl = control;
+    CleanupStack::Pop( control );    
+    
+    display.Roster().ShowL( group );
+    
+    // This must be last statement.
+    CAlfPerfAppTestCase::CompleteNow( aStatus, KErrNone );
+    }
+
+// -----------------------------------------------------------------------------
+// Starts execution phase.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppLayoutTestCase::ExecuteL( TRequestStatus& aStatus )
+    {
+    // SetupL must have been called first.
+    __ASSERT_ALWAYS( iEnv, User::Invariant() );
+    __ASSERT_ALWAYS( iControl, User::Invariant() );
+    
+    iControl->StartExecuteL( aStatus );
+    }
+
+// -----------------------------------------------------------------------------
+// Tears down.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppLayoutTestCase::TearDown()
+    {
+    // Execution side will delete CAlfEnv, so it will delete everything
+    // related to this.
+    iEnv = NULL;
+    iControl = NULL;
+    }
+
+void CAlfPerfAppLayoutTestCase::HandleVisibleAreaChange( const TRect& aRect )
+    {
+    if ( iEnv && iControl )
+        {
+        if ( iEnv->DisplayCount() > 0 )
+            {
+            iEnv->PrimaryDisplay().SetVisibleArea( aRect );
+            }
+        iControl->SetVisibleArea( aRect );
+        }
+    }
+ 
+TInt CAlfPerfAppLayoutTestCase::CaseID()
+    {
+    return iCaseId;
+    }
+
+CAlfPerfAppLayoutTestCase::CAlfPerfAppLayoutTestCase( TInt aCaseId, TInt aSequenceIndex )
+    : CAlfPerfAppTestCase(aSequenceIndex), iCaseId ( aCaseId )
+    {
+    }
+
+void CAlfPerfAppLayoutTestCase::ConstructL()
+    {
+    }
+
+
+// Implementation of CAlfPerfAppLayoutTestCaseControl:
+
+CAlfPerfAppLayoutTestCaseControl::CAlfPerfAppLayoutTestCaseControl()
+    {
+    }
+
+CAlfPerfAppLayoutTestCaseControl::~CAlfPerfAppLayoutTestCaseControl()
+    {
+    iImages.Close();
+    
+    delete iLoader;
+    }
+    
+void CAlfPerfAppLayoutTestCaseControl::ConstructL( 
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea )
+    {
+    CAlfPerfAppBaseTestCaseControl::ConstructL( aEnv, aCaseId, aVisibleArea );
+    
+    // Parameters for test cases
+    TSize gridSize 			= TSize(10,10); // Total count should be equal to iVisualCount
+    iImageFileName 			= _L("c:\\data\\others\\alfperfapp_imagetest.png");	
+	iImageCount 			= 4;
+    iVisualCount 			= 100;	
+    iTextureFlags 			= EAlfTextureFlagDefault;	
+	iVisualSize				= TAlfRealSize( 25.f, 25.f );
+
+    switch(CaseId())
+    	{
+        case EAlfPerfAppLayoutGrid:
+    		iLayout = CAlfGridLayout::AddNewL(*this, gridSize.iWidth, gridSize.iHeight);
+        	break;
+       
+        case EAlfPerfAppLayoutDeck:
+    		iLayout = CAlfDeckLayout::AddNewL(*this);
+        	break;
+       
+        case EAlfPerfAppLayoutAnchor:
+            iLayout = CAlfAnchorLayout::AddNewL(*this);  
+        	break;
+       
+        case EAlfPerfAppLayoutCurvePath:
+        	iLayout = CAlfCurvePathLayout::AddNewL(*this);
+        	break;
+       
+        case EAlfPerfAppLayoutFlow:
+        	iLayout = CAlfFlowLayout::AddNewL(*this);
+        	break;
+       
+        case EAlfPerfAppLayoutViewport:
+        	iLayout = CAlfViewportLayout::AddNewL(*this);
+        	break;
+       	
+    	default:
+            User::Leave( KErrNotSupported );
+            break;
+ 		};
+    
+
+
+	// Create grid layout
+	
+    CAlfTextureManager& textureManager = aEnv.TextureManager();
+    
+	   
+    TParsePtr parse(iImageFileName);
+    	
+    for ( TInt count = 0;  count < iImageCount; count++ )
+        {        
+        CAlfTexture& texture = textureManager.LoadTextureL(iImageFileName, iTextureFlags, count+1);
+        }   
+       	
+ 	for ( TInt ii = 0; ii < iVisualCount; ii++ )
+        {
+        CAlfImageVisual* visual = CAlfImageVisual::AddNewL( *this,  iLayout);
+        iImages.AppendL( visual );        
+        visual->SetSize( iVisualSize );
+        }
+    
+   	iLayout->UpdateChildrenLayout();
+    }
+    
+void CAlfPerfAppLayoutTestCaseControl::DoStartExecuteL()
+    {
+    NextCycleL();
+    // Complete after one cycle
+    CompleteNow( KErrNone );
+    }
+
+void CAlfPerfAppLayoutTestCaseControl::SetVisibleArea( 
+        const TRect& /*aVisibleArea*/ )
+    {
+    if ( IsExecutionOngoing() )
+        {
+        Env().CancelCustomCommands( this, KAlfPerfAppLayoutCmdNext );
+        TRAPD( err, NextCycleL() );
+        if ( err != KErrNone )
+            {
+            CompleteNow( err );
+            }
+        }
+    }
+
+TBool CAlfPerfAppLayoutTestCaseControl::OfferEventL( const TAlfEvent& aEvent )
+    {
+    if ( aEvent.IsCustomEvent() && 
+         aEvent.CustomParameter() == KAlfPerfAppLayoutCmdNext )
+        {
+        TRAPD( err, NextCycleL() );
+        if ( err != KErrNone )
+            {
+            CompleteNow( err );
+            }
+        return ETrue;
+        }
+    
+    return CAlfPerfAppBaseTestCaseControl::OfferEventL( aEvent );
+    }
+
+void CAlfPerfAppLayoutTestCaseControl::NextCycleL()
+    {
+    TAlfCustomEventCommand command( KAlfPerfAppLayoutCmdNext, this );
+    User::LeaveIfError( Env().Send( command, 500 ) );
+    
+    iCycleCounter++;
+    
+    for(TInt i=0; i<10; i++)
+    	{
+   		iLayout->UpdateChildrenLayout();
+   		}
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappmodel.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,645 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Model definition
+*
+*/
+
+
+#include "alfperfappmodel.h"
+#include <coemain.h>
+#include <barsread.h>
+#include <badesca.h>
+#include <bautils.h>
+#include <eikenv.h>
+
+#include "alfperfapp.hrh"
+#include "alfperfapptestcaseselectionview.h"
+
+/**
+ * Granularity of execution array.
+ */
+const TInt KAlfPerfAppModelExecuteArrayGranularity = 4;
+
+/**
+ * Maximum amount of test suites.
+ */
+const TInt KAlfPerfAppMaxTestSuites = 255;
+
+/**
+ * Maximum amount of test cases.
+ */
+const TInt KAlfPerfAppMaxTestCases = 255;
+
+/**
+ * Space reserved for this amount of items in execute array.
+ */
+const TInt KAlfPerfAppReserveExecution = 100;
+
+/**
+ * Class to hold test case information.
+ */
+class CAlfPerfAppModelTestCase : public CBase
+    {
+public:
+    CAlfPerfAppModelTestCase( HBufC* aName, TInt aId, TInt aFlags, TInt aSequenceLength);
+    ~CAlfPerfAppModelTestCase();
+    void Get( TPtrC& aName, TInt& aId, TInt& aTestCaseFlags, TInt& aTestCaseSequenceLength ) const;
+    TInt Flags();
+    TInt SequenceIndex();
+    
+private:
+    HBufC* iName;
+    // Case ID is negative if this is a sequence case. This need to be taken
+    // into account when doing comparisons.
+    TInt iId;    
+    TInt iFlags;
+    TInt iSequenceLength;
+    };
+
+/**
+ * Class to hold test suite information.
+ */
+class CAlfPerfAppModelTestSuite : public CBase
+    {
+public:
+    CAlfPerfAppModelTestSuite( HBufC* aSuite, TInt aFlags );
+    ~CAlfPerfAppModelTestSuite();
+    void AppendL( CAlfPerfAppModelTestCase* aCase );
+
+    TPtrC Name() const;
+    TInt Flags() const;
+
+    TInt TestCaseCount() const;
+    void GetTestCase( TInt aIndex, TPtrC& aName, TInt& aId,
+         TInt& aTestCaseFlags, TInt& aTestCaseSequenceLength) const;
+    TInt FindNameById( TPtrC& aName, TInt aId ) const;
+
+private:
+    HBufC* iName;
+    TInt iFlags;
+
+    RPointerArray< CAlfPerfAppModelTestCase > iCases;    
+    };
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+CAlfPerfAppModel* CAlfPerfAppModel::NewL()
+    {
+    CAlfPerfAppModel* self = new (ELeave) CAlfPerfAppModel;
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self); // self;
+    return self;
+    }
+
+CAlfPerfAppModel::~CAlfPerfAppModel()
+    {
+    iExecuteTestCases.Close();
+    iSuites.ResetAndDestroy();
+    delete iErrorMessages;
+
+    // Close the target file
+    iTargetFile.Close();
+    iSummaryFile.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// Loads array of test sets. Each test set contains several test cases.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppModel::LoadTestSetL( TInt aResourceId )
+    {
+    // Delete previous suites.
+    iSuites.ResetAndDestroy();
+    iSuites.Close();
+
+    TResourceReader reader;
+    CCoeEnv::Static()->CreateResourceReaderLC( reader, aResourceId );
+
+    const TInt suiteCount = reader.ReadInt16();
+    if ( suiteCount > KAlfPerfAppMaxTestSuites )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    for ( TInt ii = 0; ii < suiteCount; ii++ )
+        {
+        HBufC* suiteName = reader.ReadHBufCL();
+        CleanupStack::PushL( suiteName );
+
+        const TInt flags = reader.ReadInt16();
+
+        CAlfPerfAppModelTestSuite* suite = new (ELeave)
+        CAlfPerfAppModelTestSuite( suiteName, flags );
+        CleanupStack::Pop( suiteName );
+        CleanupStack::PushL( suite );            
+
+        const TInt testCaseCount = reader.ReadInt16();
+        if ( testCaseCount > KAlfPerfAppMaxTestCases )
+            {
+            User::Leave( KErrArgument );
+            }
+
+        for ( TInt jj = 0; jj < testCaseCount; jj++ )
+            {
+            TInt caseId = reader.ReadInt16();
+            HBufC* name = reader.ReadHBufCL();
+            CleanupStack::PushL( name );
+            const TInt flags = reader.ReadInt16();
+            const TInt sequenceLength = reader.ReadInt16();
+            
+            // Mark sequence cases
+            if(sequenceLength > 0)
+                {
+                caseId *= -1;
+                }
+            
+            CAlfPerfAppModelTestCase* testCase = 
+            new (ELeave) CAlfPerfAppModelTestCase( name, caseId, flags, sequenceLength );
+            CleanupStack::Pop( name );
+            #ifdef ALFPERFAPP_ENABLE_INACTIVE_FLAG_CASES
+            // If ALFPERFAPP_ENABLE_INACTIVE_FLAG_CASES is defined, just ignore flags
+            CleanupStack::PushL( testCase );
+            suite->AppendL( testCase );
+            CleanupStack::Pop( testCase );
+            #else
+            // Otherwise check that one of the flags is not EAlfPerfAppTestCaseFlagRequiresInActiveFlag
+            if(!(testCase->Flags() & EAlfPerfAppTestCaseFlagRequiresInActiveFlag))
+                {
+                CleanupStack::PushL( testCase );
+                suite->AppendL( testCase );
+                CleanupStack::Pop( testCase );
+                }
+            else
+                {
+                delete testCase; 
+                }
+            #endif // ALFPERFAPP_ENABLE_INACTIVE_FLAG_CASES
+
+            }
+
+        iSuites.AppendL( suite );
+        CleanupStack::Pop( suite );
+        }
+
+    CleanupStack::PopAndDestroy();    
+    }
+
+TInt CAlfPerfAppModel::SuiteCount() const
+    {
+    return iSuites.Count();
+    }
+        
+TPtrC CAlfPerfAppModel::SuiteName( TInt aSuiteIndex ) const
+    {
+    return iSuites[ aSuiteIndex ]->Name();
+    }
+
+TInt CAlfPerfAppModel::SuiteFlags( TInt aSuiteIndex ) const
+    {
+    return iSuites[ aSuiteIndex ]->Flags();
+    }
+        
+TInt CAlfPerfAppModel::TestCaseCount( TInt aSuiteIndex ) const
+    {
+    return iSuites[ aSuiteIndex ]->TestCaseCount();
+    }
+        
+void CAlfPerfAppModel::GetTestCase( 
+        TInt aSuiteIndex, 
+        TInt aTestCaseIndex, 
+        TPtrC& aTestCaseName,
+        TInt& aTestCaseId,
+        TInt& aTestCaseFlags,
+        TInt& aTestCaseSequenceLength) const
+    {
+    iSuites[ aSuiteIndex ]->GetTestCase( 
+        aTestCaseIndex, aTestCaseName, aTestCaseId, aTestCaseFlags, aTestCaseSequenceLength );
+    }
+    
+TInt CAlfPerfAppModel::FindById( 
+        TInt aCaseId,
+        TPtrC& aSuiteName,
+        TPtrC& aTestCaseName ) const
+    {
+    const TInt count = iSuites.Count();
+    TInt result = KErrNotFound;
+    
+    for ( TInt ii = 0; ii < count; ii++ )
+        {
+        if ( iSuites[ ii ]->FindNameById( aTestCaseName, aCaseId ) != 
+             KErrNotFound )
+            {
+            aSuiteName.Set( iSuites[ ii ]->Name() );
+            result = KErrNone;
+            break;
+            }
+        }
+    
+    return result;
+    }
+    
+void CAlfPerfAppModel::ResetExecuteArray()
+    {
+    // Clear array without releasing memory
+    while ( iExecuteTestCases.Count() )
+        {
+        iExecuteTestCases.Remove( iExecuteTestCases.Count() - 1 );
+        }
+    }
+
+void CAlfPerfAppModel::AddToExecuteArrayL( TInt aCaseId )
+    {
+    iExecuteTestCases.AppendL( aCaseId );
+    }
+
+TBool CAlfPerfAppModel::GetFromExecuteArray( TInt& aCaseId )
+    {
+    TBool result = EFalse;
+    if ( iExecuteTestCases.Count() )
+        {
+        result = ETrue;
+        aCaseId = iExecuteTestCases[ 0 ];
+        iExecuteTestCases.Remove( 0 );
+        }
+
+    return result;
+    }
+
+void CAlfPerfAppModel::AddToResultFilesL( const TTestCaseResultItem& aItem)
+    {
+    iResultItemsNotAddedToFile = EFalse;
+
+    static TUint32 timeStampAtCaseStart = 0;
+    static TUint32 timeStampAtPhaseStart = 0;
+    static TUint frameCountAtPhaseStart = 0;
+    static TInt currentCase  = 0;
+    static TInt currentPhase = 0;
+    static TBool firstCase = ETrue;
+    TBool caseChanged = EFalse;
+
+    if ( firstCase || currentCase != aItem.iCaseId )
+        {
+        // Test case changed.
+        currentCase = aItem.iCaseId;
+        timeStampAtCaseStart = aItem.iTimeStamp;
+        caseChanged = ETrue;
+        firstCase = EFalse;
+        }
+
+    if ( caseChanged || currentPhase != aItem.iPhase )
+        {
+        // Test case phase changed.
+        currentPhase = aItem.iPhase;
+        timeStampAtPhaseStart = aItem.iTimeStamp;
+        frameCountAtPhaseStart = aItem.iFrameCount;
+        }
+
+
+    // Get Suite and Case name
+    TPtrC testSuite;
+    TPtrC testCase;               
+    FindById( aItem.iCaseId, testSuite, testCase );
+    TBuf<KAlfPerfAppMaxCharsInLine> testSuiteName(testSuite);
+    TBuf8<KAlfPerfAppMaxCharsInLine> testSuiteName8;
+    testSuiteName8.Copy(testSuiteName);
+    TBuf<KAlfPerfAppMaxCharsInLine> testCaseName(testCase);
+    TBuf8<KAlfPerfAppMaxCharsInLine> testCaseName8;
+    testCaseName8.Copy(testCaseName);
+
+
+    TUint32 msSinceCase = 
+    CAlfPerfAppTestCaseSelectionView::DeltaFromCurrentToPrevious( aItem.iTimeStamp, timeStampAtCaseStart );
+    TUint32 msSincePhase = 
+    CAlfPerfAppTestCaseSelectionView::DeltaFromCurrentToPrevious( aItem.iTimeStamp, timeStampAtPhaseStart );
+    TUint framesSincePhase = 
+    aItem.iFrameCount - frameCountAtPhaseStart;
+
+    TReal32 fps = 0.0;
+    if ( msSincePhase != 0 )
+        {
+        fps = framesSincePhase;
+        fps *= 1000;
+        fps /= msSincePhase;
+        }
+
+    // Write to main file 
+    TBuf8<KAlfPerfAppMaxCharsInLine * 2> line; // * 2 because casespecific results can be 256 chars
+    line.Format( KAlfPerfAppPrintFormatData,
+            &testSuiteName8, &testCaseName8,aItem.iCaseId, aItem.iPhase,
+            aItem.iTimeStamp,
+            aItem.iAppCells, aItem.iAppMemory, aItem.iAppFree, 
+            aItem.iServerCells, aItem.iServerMemory, aItem.iServerFree,
+            aItem.iSystemMemory, aItem.iSystemFree,
+            framesSincePhase, msSinceCase, msSincePhase,
+            fps, &aItem.specificResult8);
+    iTargetFile.Write(line);
+
+    // Write to summary file
+    static TInt lastPhase = -1; // -1 to mark first time
+    static TInt appMemoryPhaseStart = 0; //   Value doensn't matter because next
+    static TInt serverMemoryPhaseStart = 0;// if fails at the first time
+    static TInt systemMemoryPhaseStart = 0;
+
+
+    // Only print this if this was the second time this phase is here (end of phase results)
+    if(lastPhase == aItem.iPhase)
+        {
+        line.Format(KAlfPerfAppSummaryPrintFormatData,
+                &testSuiteName8, &testCaseName8,aItem.iCaseId, aItem.iPhase,
+                aItem.iAppMemory - appMemoryPhaseStart,
+                aItem.iServerMemory - serverMemoryPhaseStart,
+                aItem.iSystemMemory - systemMemoryPhaseStart,
+                framesSincePhase,msSincePhase,fps,&aItem.specificResult8);
+        iSummaryFile.Write(line);
+        }
+    else
+        {
+        // If this was the beginning of phase, record memory values
+        appMemoryPhaseStart = aItem.iAppMemory;
+        serverMemoryPhaseStart = aItem.iServerMemory;
+        systemMemoryPhaseStart = aItem.iSystemMemory;
+        }
+    // Set the lastPhase
+    lastPhase = aItem.iPhase;
+    }
+
+void CAlfPerfAppModel::AddToErrorArrayL( const TDesC& aMessage )
+    {
+    if ( !iErrorMessages )
+        {
+        iErrorMessages = new (ELeave) CDesC16ArrayFlat( 8 );
+        }
+
+    iErrorMessages->AppendL( aMessage );
+    }
+
+TInt CAlfPerfAppModel::ErrorArrayCount()
+    {
+    TInt count = 0;
+    if ( iErrorMessages )
+        {
+        count = iErrorMessages->MdcaCount();
+        }
+    return count;
+    }
+
+void CAlfPerfAppModel::GetFromErrorArray( TInt aIndex, TPtrC& aMessage )
+    {
+    aMessage.Set( KNullDesC );
+    if ( iErrorMessages )
+        {
+        if ( aIndex >= 0 && aIndex < iErrorMessages->MdcaCount() )
+            {
+            aMessage.Set( iErrorMessages->MdcaPoint( aIndex ) );
+            }
+        }
+    }
+
+void CAlfPerfAppModel::ResetErrorArray()
+    {
+    delete iErrorMessages;
+    iErrorMessages = NULL;
+    }
+
+TBool CAlfPerfAppModel::ResultsNotAddedToFile()
+    {
+    return iResultItemsNotAddedToFile;
+    }
+
+RFile* CAlfPerfAppModel::ResultFile()
+    {
+    return &iTargetFile;
+    }
+
+TFileName CAlfPerfAppModel::TargetPath()
+    {
+    return iTargetPath;
+    }
+
+TBool CAlfPerfAppModel::TargetFilesExisted()
+    {
+    return iFilesExisted;
+    }
+
+void CAlfPerfAppModel::OpenFilesL(TBool reset)
+    {
+    TBuf8<KAlfPerfAppMaxCharsInLine> line;
+    
+    // If the files are open, close them
+    if(iFilesOpened)
+        {
+        iTargetFile.Close();
+        iSummaryFile.Close();
+        iResultItemsNotAddedToFile = ETrue;
+        }
+    
+    iTargetFileServerSession = CEikonEnv::Static()->FsSession();
+
+    // Ready the target and summary file names
+    iTargetPath = KAlfPerfAppOutputFilePath2;
+    iTargetFileName = KAlfPerfAppOutputFilePath2;
+    iSummaryFileName = KAlfPerfAppOutputFilePath2;
+    if (!BaflUtils::FolderExists(iTargetFileServerSession, iTargetFileName))
+        {
+        iTargetPath = KAlfPerfAppOutputFilePath1;
+        iTargetFileName = KAlfPerfAppOutputFilePath1;
+        iSummaryFileName = KAlfPerfAppOutputFilePath1;
+        }
+
+    iTargetFileName.Append( KAlfPerfAppPrintPathSeparator );
+    iTargetFileName.Append( KAlfPerfAppOutputFileName );
+    iSummaryFileName.Append( KAlfPerfAppPrintPathSeparator );
+    iSummaryFileName.Append(KAlfPerfAppSummaryFileName);
+
+    // Check if the files are already in place
+    TBool targetFileWasThere = BaflUtils::FileExists(iTargetFileServerSession,iTargetFileName);
+    TBool summaryFileWasThere = BaflUtils::FileExists(iTargetFileServerSession,iSummaryFileName);
+        
+    iFilesExisted = targetFileWasThere || summaryFileWasThere;
+    
+    // Create the directory and files
+    iTargetFileServerSession.MkDirAll(iTargetFileName);
+
+    // If caller forced clearing of files
+    if(reset)
+        {
+        // Files were closed in the beginning of this function
+        BaflUtils::DeleteFile(iTargetFileServerSession,iTargetFileName);
+        BaflUtils::DeleteFile(iTargetFileServerSession,iSummaryFileName);
+        targetFileWasThere = EFalse;
+        summaryFileWasThere = EFalse;
+        }
+    
+    
+    
+    // Create or reopen the target file
+    TInt targetLoc = 0;
+    if(targetFileWasThere)
+        {
+        User::LeaveIfError(iTargetFile.Open(iTargetFileServerSession,
+                iTargetFileName, EFileWrite|EFileShareExclusive));
+        iTargetFile.Seek(ESeekEnd,targetLoc);
+        }
+    else
+        {
+        User::LeaveIfError(iTargetFile.Create(iTargetFileServerSession,
+                iTargetFileName, EFileWrite|EFileShareExclusive));
+        line.Format( KAlfPerfAppPrintFormatHeader );
+        iTargetFile.Write(line);
+        }
+    
+    // Create or reopen the summary file
+    if(summaryFileWasThere)
+        {
+        User::LeaveIfError(iSummaryFile.Open(iTargetFileServerSession,
+                iSummaryFileName, EFileWrite|EFileShareExclusive));
+        iSummaryFile.Seek(ESeekEnd,targetLoc);
+        }
+    else
+        {
+        User::LeaveIfError(iSummaryFile.Create(iTargetFileServerSession,
+                iSummaryFileName, EFileWrite|EFileShareExclusive));
+        line.Format(KAlfPerfAppSummaryPrintFormatHeader);
+        iSummaryFile.Write(line);
+        }
+
+    iResultItemsNotAddedToFile = ETrue;
+    }
+
+
+CAlfPerfAppModel::CAlfPerfAppModel()
+: iExecuteTestCases( KAlfPerfAppModelExecuteArrayGranularity )
+        {
+        }
+
+void CAlfPerfAppModel::ConstructL()
+    {
+
+    iExecuteTestCases.ReserveL( KAlfPerfAppReserveExecution );
+   
+    // Let's open the target  files
+    iFilesOpened = EFalse;
+    OpenFilesL(); // Don't force clearing
+    iFilesOpened = ETrue;
+    }
+
+//
+// Implementation of CAlfPerfAppTestCase:
+//
+
+CAlfPerfAppModelTestCase::CAlfPerfAppModelTestCase( HBufC* aName, TInt aId, TInt aFlags,  TInt aSequenceLength  )
+    : iName( aName ), iId( aId ), iFlags(aFlags), iSequenceLength(aSequenceLength)
+    {
+    }
+    
+CAlfPerfAppModelTestCase::~CAlfPerfAppModelTestCase()
+    {
+    delete iName;
+    }
+
+void CAlfPerfAppModelTestCase::Get( TPtrC& aName, TInt& aId,TInt& aTestCaseFlags, TInt& aTestCaseSequenceLength ) const
+    {
+    aName.Set( KNullDesC );
+    if ( iName )
+        {
+        aName.Set( *iName );
+        }
+    aId = iId;
+    aTestCaseFlags = iFlags;
+    aTestCaseSequenceLength = iSequenceLength;
+    }
+    
+TInt CAlfPerfAppModelTestCase::Flags()
+    {
+    return iFlags;
+    }
+
+TInt CAlfPerfAppModelTestCase::SequenceIndex()
+    {
+    return iSequenceLength;
+    }
+
+//
+// Implementation of CAlfPerfAppTestSuite:
+//
+
+CAlfPerfAppModelTestSuite::CAlfPerfAppModelTestSuite( HBufC* aSuite, TInt aFlags )
+    : iName( aSuite ), iFlags( aFlags ), iCases( 4 )
+    {
+    }
+
+CAlfPerfAppModelTestSuite::~CAlfPerfAppModelTestSuite()
+    {
+    delete iName;
+    iCases.ResetAndDestroy();
+    }
+
+void CAlfPerfAppModelTestSuite::AppendL( CAlfPerfAppModelTestCase* aCase )
+    {
+    iCases.AppendL( aCase );
+    }
+
+TPtrC CAlfPerfAppModelTestSuite::Name() const
+    {
+    TPtrC name( KNullDesC );
+    if ( iName )
+        {
+        name.Set( *iName );
+        }
+    return name;
+    }
+        
+TInt CAlfPerfAppModelTestSuite::Flags() const
+    {
+    return iFlags;
+    }
+
+TInt CAlfPerfAppModelTestSuite::TestCaseCount() const
+    {
+    return iCases.Count();
+    }
+
+void CAlfPerfAppModelTestSuite::GetTestCase( 
+        TInt aIndex, TPtrC& aName, TInt& aId, 
+        TInt& aTestCaseFlags, TInt& aTestCaseSequenceLength ) const
+    {
+    return iCases[ aIndex ]->Get( aName, aId, aTestCaseFlags, aTestCaseSequenceLength );    
+    }
+
+
+TInt CAlfPerfAppModelTestSuite::FindNameById( TPtrC& aName, TInt aId ) const
+    {
+    const TInt count = iCases.Count();
+    TInt result = KErrNotFound;
+    
+    for ( TInt ii = 0; ii < count; ii++ )
+        {
+        TPtrC name;
+        TInt id;
+        TInt flags;
+        TInt sequenceLength;
+        
+        iCases[ ii ]->Get( name, id, flags, sequenceLength );
+        
+        if ( aId == id )
+            {
+            result = KErrNone;
+            aName.Set( name );
+            break;
+            }
+        }
+    
+    return result;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappsuiteepgcontrol.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,488 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+// INCLUDES
+#include <alf/alfenv.h>
+
+#include <alf/AlfGridLayout.h>
+#include <alf/AlfViewportLayout.h>
+
+#include <alf/alftextvisual.h>
+#include <alf/alfimagevisual.h>
+
+#include <alf/AlfTextStyleManager.h>
+#include <alf/AlfTextStyle.h>
+
+#include "AlfPerfAppSuiteEPGControl.h"
+#include "AlfPerfAppSuiteHelper.h"
+#include "AlfPerfAppSuiteTestCaseScroll.h"
+
+// ============================= MEMBER FUNCTIONS ==============================
+
+TInt DurationInMinutes( TTime aStart, TTime aEnd )
+	{
+	TTimeIntervalMinutes duration;
+	aEnd.MinutesFrom( aStart, duration );
+	return duration.Int();
+	}
+
+TProgram::TProgram()
+	{
+	iName.Zero();
+	}
+
+TProgram::TProgram( const TDesC& aName, const TDesC& aStart, const TDesC& aEnd )
+	:iName( aName ),
+	iStart( aStart ),
+	iEnd( aEnd )
+	{
+	}
+
+TInt TProgram::DurationInMinutes()
+	{
+	return ::DurationInMinutes( iStart, iEnd ); 
+	}
+
+CAlfPerfAppSuiteEPGControl::CAlfPerfAppSuiteEPGControl(CAlfPerfAppSuiteTestCaseScroll* aScrollControl)
+    : iScrollControl(aScrollControl)
+	{
+	
+	}
+		
+CAlfPerfAppSuiteEPGControl::~CAlfPerfAppSuiteEPGControl()
+	{
+#ifdef ENABLE_TEXTSTYLES
+	CAlfTextStyleManager& styleManager = Env().TextStyleManager();
+	for( TInt i=0; i<iTextStyles.Count(); i++ )
+		{
+		styleManager.DeleteTextStyle( iTextStyles[i] );
+		}
+	iTextStyles.Close();
+#endif	
+	}
+		
+void CAlfPerfAppSuiteEPGControl::ConstructL( 
+	        CAlfEnv& aEnv, 
+	        const TSize& aVisibleArea,
+	        CAlfLayout* aParentLayout )
+	{
+	iLoadedImages = 0;
+	iVisibleArea = aVisibleArea;
+	CAlfControl::ConstructL( aEnv );
+	
+#ifdef ENABLE_TEXTSTYLES
+	CreateTextStylesL();
+#endif	
+	
+	// Construct a base layout to add a background
+	CAlfLayout* baseLayout = CAlfLayout::AddNewL( *this, aParentLayout );
+  	TAlfPerfAppSuiteHelper::AddGradientBrushL( baseLayout, KRgbBlue, KRgbWhite );
+  	TAlfPerfAppSuiteHelper::AddDropShadowBrushL( baseLayout, KRgbWhite, 1 );	
+	
+	// Create grid layout
+	CAlfGridLayout* gridLayout = 
+		CAlfGridLayout::AddNewL( *this, 1, 1, baseLayout );
+	gridLayout->SetPadding( 10 );
+	
+	// Get texture manager
+	CAlfTextureManager& textureManager = Env().TextureManager();
+	
+    // Add heading row
+	CAlfTextVisual* headingTextVisual =	CAlfTextVisual::AddNewL( *this, gridLayout );
+	headingTextVisual->SetTextL( _L("Tuubi EPG") );
+#ifdef ENABLE_TEXTSTYLES
+	headingTextVisual->SetTextStyle( iTextStyles[ETextStyleTitle] );
+	headingTextVisual->SetColor( KRgbWhite );
+#endif
+	RArray<TInt> rowHeights;
+	rowHeights.Append( 50 );
+	
+	// Define time window to show
+	TTime start( _L("181500.") );
+	TTime end( _L("201500.") );
+		
+	// HEADER
+	RArray<TProgram> programs;
+	// NOTE: Programs must start and end at the same time for them to be correctly
+	//       aligned on screen. Our total time window here is 24*60 min.
+	programs.Append( TProgram( _L("---"),   _L("000000."), _L("174500.") ) );	
+	programs.Append( TProgram( _L("18:00"), _L("174500."), _L("181500.") ) );
+	programs.Append( TProgram( _L("18:30"), _L("181500."), _L("184500.") ) );
+	programs.Append( TProgram( _L("19:00"),	_L("184500."), _L("191500.") ) );
+	programs.Append( TProgram( _L("19:30"),	_L("191500."), _L("194500.") ) );
+	programs.Append( TProgram( _L("20:00"),	_L("194500."), _L("201500.") ) );
+	programs.Append( TProgram( _L("20:30"),	_L("201500."), _L("204500.") ) );
+	programs.Append( TProgram( _L("21:00"),	_L("204500."), _L("211500.") ) );
+	programs.Append( TProgram( _L("---"),   _L("211500."), _L("235959.") ) );
+	TAlfImage empty;
+	TInt textStyle = 0;
+#ifdef ENABLE_TEXTSTYLES
+	textStyle = iTextStyles[ETextStyleTime];
+#endif
+	AddRowL( gridLayout, empty, programs, start, end, textStyle, EFalse );
+    programs.Reset();
+    rowHeights.Append( 50 );	
+
+
+    aEnv.TextureManager().AddLoadObserverL( this );
+    
+    _LIT( KImage1, "mtv3.png" );
+    _LIT( KImage2, "nelonen.png" );
+    _LIT( KImage3, "jim.png" );
+    _LIT( KImage4, "mtv3_scifi.png" );
+    _LIT( KImage5, "discoveryhd.png" );
+    _LIT( KImage6, "nationalgeographic.jpg" );
+    
+	// MTV3
+    TAlfImage mtv3Image( 
+    		textureManager.LoadTextureL(
+    		        KImage1,
+    				EAlfTextureFlagRetainResolution,
+    				KAlfAutoGeneratedTextureId ) );
+    
+	programs.Append( TProgram( _L("TV-chät"),
+			_L("000000."), _L("180000.") ) );	
+	programs.Append( TProgram( _L("Emmerdale"),
+			_L("180000."), _L("183000.") ) );
+	programs.Append( TProgram( _L("T.i.l.a."),
+			_L("183000."), _L("190000.") ) );
+	programs.Append( TProgram( _L("Seitsemän Uutiset"),
+			_L("190000."), _L("191500.") ) );
+	programs.Append( TProgram( _L("Kauppalehden talousuutiset"),
+			_L("191500."), _L("192500.") ) );
+	programs.Append( TProgram( _L("Päivän sää"),
+			_L("192500."), _L("193000.") ) );
+	programs.Append( TProgram( _L("Salatut elämät"),
+			_L("193000."), _L("200000.") ) );
+	programs.Append( TProgram( _L("45min Special: Kuninkaalliset kulissien takana"),
+			_L("200000."), _L("210000.") ) );
+	programs.Append( TProgram( _L("TV-chät"),
+			_L("210000."), _L("235959.") ) );
+#ifdef ENABLE_TEXTSTYLES
+	textStyle = iTextStyles[ETextStyleProgram];
+#endif	
+	AddRowL( gridLayout, mtv3Image, programs, start, end, textStyle );
+    programs.Reset();
+    rowHeights.Append( 100 );
+    
+    // NELONEN
+    TAlfImage nelonenImage( 
+    		textureManager.LoadTextureL(
+    		        KImage2,
+    				EAlfTextureFlagRetainResolution,
+    				KAlfAutoGeneratedTextureId ) );
+    
+	programs.Append( TProgram( _L("TV-chät"),
+			_L("000000."), _L("180000.") ) );	
+	programs.Append( TProgram( _L("Leijonamies"),
+			_L("180000."), _L("183000.") ) );
+	programs.Append( TProgram( _L("Tanssi, jos osaat!"),
+			_L("183000."), _L("193000.") ) );
+	programs.Append( TProgram( _L("Nelosen uutiset"),
+			_L("193000."), _L("194500.") ) );
+	programs.Append( TProgram( _L("Nelosen sää"),
+			_L("194500."), _L("195000.") ) );
+	programs.Append( TProgram( _L("IS Urheilu-uutiset"),
+			_L("195000."), _L("195500.") ) );
+	programs.Append( TProgram( _L("B-Studio"),
+			_L("195500."), _L("200000.") ) );
+	programs.Append( TProgram( _L("Unelmien poikamies - upseeri ja herrasmies"),
+			_L("200000."), _L("210000.") ) );
+	programs.Append( TProgram( _L("TV-chät"),
+			_L("210000."), _L("235959.") ) );		
+#ifdef ENABLE_TEXTSTYLES
+	textStyle = iTextStyles[ETextStyleProgram];
+#endif	
+	AddRowL( gridLayout, nelonenImage, programs, start, end, textStyle );
+    programs.Reset();
+    rowHeights.Append( 100 );   
+    
+    // JIM
+    TAlfImage jimImage( 
+    		textureManager.LoadTextureL(
+    		        KImage3,
+    				EAlfTextureFlagRetainResolution,
+    				KAlfAutoGeneratedTextureId ) );    
+	programs.Append( TProgram( _L("TV-chät"),
+			_L("000000."), _L("180000.") ) );
+	programs.Append( TProgram( _L("Hyvää ruokahalua"),
+			_L("180000."), _L("183000.") ) );	
+	programs.Append( TProgram( _L("Kiinteistökauppaa maailmalla"),
+			_L("183000."), _L("190000.") ) );
+	programs.Append( TProgram( _L("Autoklassikot"),
+			_L("190000."), _L("193000.") ) );
+	programs.Append( TProgram( _L("Huvila & Huussi Extra"),
+			_L("193000."), _L("200000.") ) );
+	programs.Append( TProgram( _L("Fifth Gear"),
+			_L("200000."), _L("203000.") ) );
+	programs.Append( TProgram( _L("Fifth Gear"),
+			_L("203000."), _L("210000.") ) );
+	programs.Append( TProgram( _L("TV-chät"),
+			_L("210000."), _L("235959.") ) );		
+#ifdef ENABLE_TEXTSTYLES
+	textStyle = iTextStyles[ETextStyleProgram];
+#endif	
+	AddRowL( gridLayout, jimImage, programs, start, end, textStyle );
+    programs.Reset();
+    rowHeights.Append( 100 );
+    
+    // MTV3 scifi
+    TAlfImage mtv3scifiImage( 
+    		textureManager.LoadTextureL(
+    		        KImage4,
+    				EAlfTextureFlagRetainResolution,
+    				KAlfAutoGeneratedTextureId ) );       
+	programs.Append( TProgram( _L("TV-chät"),
+			_L("000000."), _L("180500.") ) );    
+	programs.Append( TProgram( _L("Doctor Who"),
+			_L("180500."), _L("183000.") ) );	
+	programs.Append( TProgram( _L("Doctor Who"),
+			_L("183000."), _L("185500.") ) );
+	programs.Append( TProgram( _L("Andromeda"),
+			_L("185500."), _L("194000.") ) );
+	programs.Append( TProgram( _L("Babylon 5"),
+			_L("194000.."), _L("202500.") ) );
+	programs.Append( TProgram( _L("Star Trek: Deep Space Nine"),
+			_L("202500."), _L("211000.") ) );
+	programs.Append( TProgram( _L("TV-chät"),
+			_L("211000."), _L("235959.") ) );		
+#ifdef ENABLE_TEXTSTYLES
+	textStyle = iTextStyles[ETextStyleProgram];
+#endif	
+	AddRowL( gridLayout, mtv3scifiImage, programs, start, end, textStyle );
+    programs.Reset();
+    rowHeights.Append( 100 );  
+    
+    // DISCOVERY HD
+    TAlfImage discoveryChannelImage( 
+    		textureManager.LoadTextureL(
+    		        KImage5,
+    				EAlfTextureFlagRetainResolution,
+    				KAlfAutoGeneratedTextureId ) );       
+	programs.Append( TProgram( _L("TV-chät"),
+			_L("000000."), _L("180000.") ) );    
+	programs.Append( TProgram( _L("Tuunaajat"),
+			_L("180000."), _L("190000.") ) );	
+	programs.Append( TProgram( _L("Valmistuksen salat"),
+			_L("190000."), _L("193000.") ) );
+	programs.Append( TProgram( _L("Valmistuksen salat"),
+			_L("193000."), _L("200000.") ) );
+	programs.Append( TProgram( _L("Myytinmurtajat"),
+			_L("200000.."), _L("210000.") ) );
+	programs.Append( TProgram( _L("TV-chät"),
+			_L("210000."), _L("235959.") ) );		
+#ifdef ENABLE_TEXTSTYLES
+	textStyle = iTextStyles[ETextStyleProgram];
+#endif	
+	AddRowL( gridLayout, discoveryChannelImage, programs, start, end, textStyle );
+    programs.Reset();
+    rowHeights.Append( 100 );  
+    
+    // NATIONAL GEOGRAPHIC
+    TAlfImage nationalgeographicImage( 
+    		textureManager.LoadTextureL(
+    		        KImage6,
+    				EAlfTextureFlagRetainResolution,
+    				KAlfAutoGeneratedTextureId ) );       
+	programs.Append( TProgram( _L("TV-chät"),
+			_L("000000."), _L("180000.") ) );    
+	programs.Append( TProgram( _L("Nat Geo Junior: the Snake Wranglers: Snake Saviour"),
+			_L("180000."), _L("183000.") ) );	
+	programs.Append( TProgram( _L("Nat Geo Junior: Get Outta Town: Washington Dc"),
+			_L("183000."), _L("190000.") ) );
+	programs.Append( TProgram( _L("Premiere: Ape Genius"),
+			_L("190000."), _L("200000.") ) );
+	programs.Append( TProgram( _L("Great Wall of China: Protecting the Dragon"),
+			_L("200000.."), _L("210000.") ) );
+	programs.Append( TProgram( _L("TV-chät"),
+			_L("210000."), _L("235959.") ) );		
+#ifdef ENABLE_TEXTSTYLES
+	textStyle = iTextStyles[ETextStyleProgram];
+#endif	
+	AddRowL( gridLayout, nationalgeographicImage, programs, start, end, textStyle );
+    programs.Reset();
+    rowHeights.Append( 100 );      
+    
+    // Apply rows
+    gridLayout->SetRows( rowHeights.Count() );
+    gridLayout->SetRowsL( rowHeights );        
+        
+    // Set grid size
+    gridLayout->SetFlag( EAlfVisualFlagManualSize );
+  	TAlfRealSize size;
+  	size.iWidth = iVisibleArea.iWidth;
+  	for( TInt i=0; i<rowHeights.Count(); i++ )
+  		{
+  		size.iHeight += rowHeights[i];
+  		}
+  	gridLayout->SetSize( size, 0 );
+
+  	// Cleanup
+  	rowHeights.Close(); 
+  	programs.Close();
+	}
+
+const TInt KNumberOfImages = 6;
+// -----------------------------------------------------------------------------
+// Notify observers that all images have been loaded.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppSuiteEPGControl::TextureLoadingCompleted(
+        CAlfTexture& /*aTexture*/, TInt /*aTextureId*/, TInt aErrorCode)
+    {
+    // inform if there is any error
+    if( aErrorCode != KErrNone )
+        {
+        iScrollControl->ImagesLoaded( aErrorCode );
+        }
+    
+    iLoadedImages++;
+    if (iLoadedImages == KNumberOfImages)
+        {
+        iScrollControl->ImagesLoaded( KErrNone );
+        }
+    }
+
+#ifdef ENABLE_TEXTSTYLES
+void CAlfPerfAppSuiteEPGControl::CreateTextStylesL()
+	{
+	CAlfTextStyleManager& styleManager = Env().TextStyleManager();
+
+    // Create text styles
+    for( TInt i=0; i<ENumberOfTextStyles; i++ )
+    	{
+    	iTextStyles.Append( styleManager.CreatePlatformTextStyleL() );
+    	}
+
+    // NOTE: This will leak memory
+    // styles are destroyed in TextStyleManager destructor but this is not enough...
+
+    CAlfTextStyle* style = NULL;
+    style = styleManager.TextStyle( iTextStyles[ETextStyleTitle] );
+    style->SetTextSizeInTwips( 120 );
+
+    style = styleManager.TextStyle( iTextStyles[ETextStyleTime] );
+    style->SetTextSizeInTwips( 100 );
+    
+    style = styleManager.TextStyle( iTextStyles[ETextStyleProgram] );
+    style->SetTextSizeInTwips( 80 );    
+	}
+#endif
+
+
+void CAlfPerfAppSuiteEPGControl::AddRowL( 
+		CAlfLayout* aParentLayout,
+		TAlfImage& aChannelImage,
+		RArray<TProgram>& aPrograms,
+		const TTime& aTimeWindowStart,
+		const TTime& aTimeWindowEnd,
+		TInt aTextStyle,
+		TBool aSetBorders
+		)
+	{
+	// Create grid layout
+	CAlfGridLayout* gridLayout = 
+		CAlfGridLayout::AddNewL( *this, 1, 1, aParentLayout );
+	
+	// Set borders
+	if( aSetBorders )
+		{
+		TAlfPerfAppSuiteHelper::AddBorderBrushL( gridLayout, KRgbWhite );
+		}	
+
+    // Add channel image
+    CAlfImageVisual* imageVisual = CAlfImageVisual::AddNewL( *this, gridLayout );
+    imageVisual->SetImage( aChannelImage );
+    imageVisual->SetScaleMode( CAlfImageVisual::EScaleFitInside );   
+    imageVisual->SetPadding( 2 );
+    RArray<TInt> columnWeights;
+    columnWeights.Append( 1 );
+
+    // Add programs
+    AddProgramsL( gridLayout, aPrograms, aTimeWindowStart, aTimeWindowEnd, aTextStyle, aSetBorders );
+    columnWeights.Append( 9 );
+        
+    // Apply columns
+	gridLayout->SetColumns( columnWeights.Count() );
+	gridLayout->SetColumnsL( columnWeights );        
+	    
+	// Cleanup
+	columnWeights.Close();        
+	}
+
+void CAlfPerfAppSuiteEPGControl::AddProgramsL( 
+		CAlfLayout* aParentLayout,
+		RArray<TProgram>& aPrograms,
+		const TTime& aTimeWindowStart,
+		const TTime& aTimeWindowEnd,
+		TInt aTextStyle,
+		TBool aSetBorders
+		)
+	{
+	
+	// Use viewport layout as a base layout
+	CAlfViewportLayout* viewPortLayout 
+		= CAlfViewportLayout::AddNewL( *this, aParentLayout );
+	
+	// Set borders
+	if( aSetBorders )
+		{
+		TAlfPerfAppSuiteHelper::AddBorderBrushL( viewPortLayout, KRgbWhite );
+		}
+	
+	// Virtual size is 1,1 which represents a 24*60 minute time window.
+	viewPortLayout->SetVirtualSize( TAlfRealSize(1.0f,1.0f), 0 );
+	
+	// Calculate how much is visible by the time window.
+	TReal32 displayWindowSize = DurationInMinutes( aTimeWindowStart, aTimeWindowEnd );
+	TReal32 maxWindowSize = 24*60;
+	TReal32 relelativeWindowSize = displayWindowSize / maxWindowSize;
+	viewPortLayout->SetViewportSize( TAlfRealSize( relelativeWindowSize, 1.0f ), 0 );
+	
+	// Calculate the offset from beginning.
+	TReal32 displayWindowOffset = DurationInMinutes( aPrograms[0].iStart, aTimeWindowStart );
+	TReal32 pos = displayWindowOffset / maxWindowSize;
+	viewPortLayout->SetViewportPos( TAlfRealPoint( pos, 0.0f ), 0 );
+	
+	// Create grid layout
+	CAlfGridLayout* gridLayout = 
+		CAlfGridLayout::AddNewL( *this, aPrograms.Count(), 1, viewPortLayout );
+
+	// Add the programs using the duration of the program as column weight.
+	RArray<TInt> columnWeights;
+	for( TInt i=0; i<aPrograms.Count(); i++ )
+		{
+		CAlfTextVisual* textVisual = CAlfTextVisual::AddNewL( *this, gridLayout );
+		textVisual->SetTextL( aPrograms[i].iName );
+#ifdef ENABLE_TEXTSTYLES
+		textVisual->SetTextStyle( aTextStyle );
+#endif
+		textVisual->SetWrapping( CAlfTextVisual::ELineWrapBreak );
+		if( aSetBorders )
+			{
+			TAlfPerfAppSuiteHelper::AddBorderBrushL( textVisual, TRgb(0xdddddd) );
+			}		
+		columnWeights.Append( aPrograms[i].DurationInMinutes() );
+		}
+	
+	// Set column weights
+	gridLayout->SetColumnsL( columnWeights );
+	
+	// Cleanup
+	columnWeights.Close();
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappsuitehelper.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+// INCLUDES
+#include "alfperfappsuitehelper.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+void TAlfPerfAppSuiteHelper::AddBorderBrushL( 
+		CAlfVisual* aVisual,
+		const TRgb& aColor,
+		TInt aThicknessWidth,
+		TInt aThicknessHeight)
+	{
+	CAlfBorderBrush* brush = CAlfBorderBrush::NewLC( aVisual->Env(), aThicknessWidth, aThicknessHeight, 0, 0);
+	aVisual->EnableBrushesL();
+	brush->SetColor(aColor);
+	brush->SetLayer( EAlfBrushLayerForeground ); // this will be drawn on top of everything
+    aVisual->Brushes()->AppendL(brush, EAlfHasOwnership);
+    CleanupStack::Pop(brush);	
+	}
+
+void TAlfPerfAppSuiteHelper::AddGradientBrushL( 
+		CAlfVisual* aVisual,
+		const TRgb& aColor1,
+		const TRgb& aColor2,
+		CAlfGradientBrush::TDirection aDirection )
+	{
+	CAlfGradientBrush* brush = CAlfGradientBrush::NewLC( aVisual->Env() );
+	aVisual->EnableBrushesL();
+	brush->SetDirection( aDirection );
+	brush->AppendColorL( 0, aColor1 );
+	brush->AppendColorL( 1, aColor2 );
+    aVisual->Brushes()->AppendL(brush, EAlfHasOwnership);
+    CleanupStack::Pop(brush);	
+	}
+
+void TAlfPerfAppSuiteHelper::AddGradientBrushL( 
+		CAlfVisual* aVisual,
+		const TRgb& aColor )
+	{
+	// This is effectively a solid brush
+	CAlfGradientBrush* brush = CAlfGradientBrush::NewLC( aVisual->Env() );
+	aVisual->EnableBrushesL();
+	brush->SetColor( aColor );
+    aVisual->Brushes()->AppendL(brush, EAlfHasOwnership);
+    CleanupStack::Pop(brush);	
+	}
+
+void TAlfPerfAppSuiteHelper::AddDropShadowBrushL(
+		CAlfVisual* aVisual,
+		const TRgb& aColor,
+		TInt aDepth
+		)
+	{
+	CAlfDropShadowBrush* brush = CAlfDropShadowBrush::NewLC( aVisual->Env(), aDepth );
+	aVisual->EnableBrushesL();
+	brush->SetColor( aColor );
+    aVisual->Brushes()->AppendL(brush, EAlfHasOwnership);
+    CleanupStack::Pop(brush);	
+	}
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappsuitepeoplecontrol.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,307 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+// INCLUDES
+#include <alf/AlfEnv.h>
+#include <alf/AlfTextureManager.h>
+#include <alf/AlfTextStyleManager.h>
+#include <alf/AlfTextStyle.h>
+#include <alf/AlfGridLayout.h>
+#include <alf/AlfImageVisual.h>
+#include <alf/AlfTextVisual.h>
+
+#include "AlfPerfAppSuitePeopleControl.h"
+#include "AlfPerfAppSuiteHelper.h"
+#include "AlfPerfAppSuiteTestCaseScroll.h"
+
+// MACROS
+#define KRgbSelectionBlue TRgb(0xE99517)
+
+// ============================= MEMBER FUNCTIONS ==============================
+
+CAlfPerfAppSuitePeopleControl::CAlfPerfAppSuitePeopleControl(CAlfPerfAppSuiteTestCaseScroll* aScrollControl)
+    :iScrollControl(aScrollControl)
+	{
+	}
+		
+CAlfPerfAppSuitePeopleControl::~CAlfPerfAppSuitePeopleControl()
+	{
+#ifdef ENABLE_TEXTSTYLES
+	CAlfTextStyleManager& styleManager = Env().TextStyleManager();
+	for( TInt i=0; i<iTextStyles.Count(); i++ )
+		{
+		styleManager.DeleteTextStyle( iTextStyles[i] );
+		}
+	iTextStyles.Close();
+#endif	
+	}
+		
+void CAlfPerfAppSuitePeopleControl::ConstructL( 
+	        CAlfEnv& aEnv, 
+	        const TSize& aVisibleArea,
+	        CAlfLayout* aParentLayout )
+	{
+	iLoadedImages = 0;
+	iVisibleArea = aVisibleArea;
+	
+	CAlfControl::ConstructL( aEnv );
+    
+#ifdef ENABLE_TEXTSTYLES
+	CreateTextStylesL();
+#endif
+
+	// Construct a base layout to add a background
+	CAlfLayout* baseLayout = CAlfLayout::AddNewL( *this, aParentLayout );
+	TAlfPerfAppSuiteHelper::AddGradientBrushL( baseLayout, KRgbBlack );
+  	TAlfPerfAppSuiteHelper::AddDropShadowBrushL( baseLayout, KRgbGray, 1 );
+	
+   	// Create a grid layout as a base
+  	CAlfGridLayout* gridLayout = CAlfGridLayout::AddNewL( *this, 1, 1, baseLayout );
+  	gridLayout->SetPadding( 4 );
+
+	// Add Header row
+    RArray<TInt> rowHeights;
+    rowHeights.Append( 100 );
+
+    // Images
+    _LIT( KImage1, "people.png" );
+    
+    CAlfTextureManager& textureManager = Env().TextureManager();
+	aEnv.TextureManager().AddLoadObserverL( this );
+    TAlfImage image( 
+    		textureManager.LoadTextureL(
+    		        KImage1,
+    				EAlfTextureFlagRetainResolution,
+    				KAlfAutoGeneratedTextureId ) );    	
+	ConstructListHeaderL( gridLayout, image, _L("People"), rowHeights[rowHeights.Count()-1] );
+
+    // Add list items
+    rowHeights.Append( 120 ); // 1
+    ConstructListItemL( gridLayout, _L("Top contacts"), _L("4 contacts"), rowHeights[rowHeights.Count()-1], ETrue );
+
+    rowHeights.Append( 100 ); // 2
+    ConstructListItemL( gridLayout, _L("All contacts"), _L("247 contacts"), rowHeights[rowHeights.Count()-1]  );
+
+    rowHeights.Append( 80 ); // 3
+    ConstructListItemL( gridLayout, _L("Communities"), _L("2 communities"), rowHeights[rowHeights.Count()-1] );
+    
+    rowHeights.Append( 80 ); // 4
+    ConstructListItemL( gridLayout, _L("Work"), _L("40 contacts"), rowHeights[rowHeights.Count()-1] );
+    
+    rowHeights.Append( 80 ); // 5
+    ConstructListItemL( gridLayout, _L("Friends"), _L("23 contacts"), rowHeights[rowHeights.Count()-1] );    
+    
+    rowHeights.Append( 80 ); // 6
+    ConstructListItemL( gridLayout, _L("Enemies"), _L("1 contact"), rowHeights[rowHeights.Count()-1] );
+    
+    rowHeights.Append( 80 ); // 7
+    ConstructListItemL( gridLayout, _L("Fans"), _L("2 contacts"), rowHeights[rowHeights.Count()-1] );
+    
+    rowHeights.Append( 80 ); // 8
+    ConstructListItemL( gridLayout, _L("Haters"), _L("1 contact"), rowHeights[rowHeights.Count()-1] );
+    
+    rowHeights.Append( 80 ); // 9
+    ConstructListItemL( gridLayout, _L("Lovers"), _L("2 contacts"), rowHeights[rowHeights.Count()-1] );
+    
+    rowHeights.Append( 80 ); // 10
+    ConstructListItemL( gridLayout, _L("The Others"), _L("31"), rowHeights[rowHeights.Count()-1] );      
+
+    // Apply rows
+    gridLayout->SetRows( rowHeights.Count() );
+    gridLayout->SetRowsL( rowHeights );
+
+    // Set grid size
+  	gridLayout->SetFlag( EAlfVisualFlagManualSize );
+  	TAlfRealSize size;
+  	size.iWidth = iVisibleArea.iWidth;
+  	for( TInt i=0; i<rowHeights.Count(); i++ )
+  		{
+  		size.iHeight += rowHeights[i];
+  		}
+  	gridLayout->SetSize( size, 0 );
+
+  	// Cleanup
+  	rowHeights.Close();
+	}
+
+#ifdef ENABLE_TEXTSTYLES
+void CAlfPerfAppSuitePeopleControl::CreateTextStylesL()
+	{
+	CAlfTextStyleManager& styleManager = Env().TextStyleManager();
+
+    // Create text styles
+    for( TInt i=0; i<ENumberOfTextStyles; i++ )
+    	{
+    	iTextStyles.Append( styleManager.CreatePlatformTextStyleL() );
+    	}
+
+    // NOTE: This will leak memory (S60 5.0 wk 20)
+    // styles are destroyed in TextStyleManager destructor but this is not enough...
+
+    CAlfTextStyle* style = NULL;
+    style = styleManager.TextStyle( iTextStyles[ETextStyleHeader] );
+    style->SetTextSizeInTwips( 180 );
+    
+    style = styleManager.TextStyle( iTextStyles[ETextStyleBig] );
+    style->SetTextSizeInTwips( 160 );
+
+    style = styleManager.TextStyle( iTextStyles[ETextStyleSmall] );
+    style->SetTextSizeInTwips( 110 );
+	}
+#endif
+
+const TInt KNumberOfImages = 1;
+// -----------------------------------------------------------------------------
+// Notify observers that all images have been loaded.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppSuitePeopleControl::TextureLoadingCompleted(
+        CAlfTexture& /*aTexture*/, TInt /*aTextureId*/, TInt aErrorCode)
+    {
+    // inform if there is any error
+    if( aErrorCode != KErrNone )
+        {
+        iScrollControl->ImagesLoaded( aErrorCode );
+        }
+    
+    iLoadedImages++;
+    if (iLoadedImages == KNumberOfImages)
+        {
+        iScrollControl->ImagesLoaded( KErrNone );
+        }
+    }
+
+CAlfGridLayout* CAlfPerfAppSuitePeopleControl::ConstructListItemLayoutL(
+		CAlfLayout* aParentLayout,
+		TInt aHeight,
+		TBool aSelected,
+		TBool aBorders )
+	{
+	// Define weights
+   	RArray<TInt> columnWeights;
+   	columnWeights.Append( 2 );
+   	columnWeights.Append( 8 );
+
+   	// Create a grid layout as a base
+  	CAlfGridLayout* gridLayout = CAlfGridLayout::AddNewL(
+  			*this, columnWeights.Count(), 1, aParentLayout );
+	gridLayout->SetColumnsL( columnWeights );
+	columnWeights.Close();
+
+
+	// Set gradient brush if selected
+    if( aSelected )
+    	{
+    	TAlfPerfAppSuiteHelper::AddGradientBrushL( gridLayout, KRgbSelectionBlue );
+    	}
+
+    // Set borders
+    if( aBorders )
+    	{
+    	TAlfPerfAppSuiteHelper::AddBorderBrushL( gridLayout, KRgbDarkGray, 0, 2 );
+    	}
+        
+    // Define the size manually
+  	gridLayout->SetFlag( EAlfVisualFlagManualSize );
+  	TAlfRealSize size;
+  	size.iWidth = iVisibleArea.iWidth;
+  	size.iHeight = aHeight;
+  	gridLayout->SetSize( size, 0 );
+
+	return gridLayout;
+	}
+
+CAlfGridLayout* CAlfPerfAppSuitePeopleControl::ConstructListItemTextLayoutL(
+		CAlfLayout* aParentLayout )
+	{
+	// Define weights
+   	RArray<TInt> rowWeights;
+   	rowWeights.Append( 1 );
+   	rowWeights.Append( 1 );
+
+   	// Create a grid layout as a base
+  	CAlfGridLayout* gridLayout = CAlfGridLayout::AddNewL(
+  			*this, 1, rowWeights.Count(), aParentLayout );
+	gridLayout->SetRowsL( rowWeights );
+	rowWeights.Close();
+
+	return gridLayout;
+	}
+
+void CAlfPerfAppSuitePeopleControl::ConstructListHeaderL(
+		CAlfLayout* aParentLayout,
+		const TAlfImage& aImage,
+		const TDesC& aText,
+		TInt aHeight )
+	{
+	// Create list item layout
+    CAlfGridLayout* listItemLayout = 
+    	ConstructListItemLayoutL( aParentLayout, aHeight, EFalse, EFalse );
+
+    // Add image visual to first cell of list item layout
+    CAlfImageVisual* imageVisual = CAlfImageVisual::AddNewL( *this, listItemLayout );
+    imageVisual->SetImage( aImage );
+    imageVisual->SetScaleMode( CAlfImageVisual::EScaleFitInside );
+
+    // Add text visual to second
+    CAlfTextVisual* textVisual = CAlfTextVisual::AddNewL( *this, listItemLayout );
+    textVisual->SetTextL( aText );
+    textVisual->SetAlign( EAlfAlignHLeft, EAlfAlignVCenter );
+#ifdef ENABLE_TEXTSTYLES
+    textVisual->SetTextStyle( iTextStyles[ETextStyleHeader] );
+#endif
+    textVisual->SetColor( KRgbWhite );
+	}
+
+void CAlfPerfAppSuitePeopleControl::ConstructListItemL(
+		CAlfLayout* aParentLayout,
+		const TDesC& aName,
+		const TDesC& aDescription,
+		TInt aHeight,
+		TBool aSelected )
+	{
+	// Create list item layout
+    CAlfGridLayout* listItemLayout =
+    	ConstructListItemLayoutL( aParentLayout, aHeight, aSelected );
+
+    // Add blank placeholder to first cell
+    AppendVisualL( EAlfVisualTypeVisual, listItemLayout ); 
+
+    // Create a new layout for text
+    CAlfGridLayout* textLayout = ConstructListItemTextLayoutL( listItemLayout );
+
+    // Add name visual to text layout
+    CAlfTextVisual* nameVisual = CAlfTextVisual::AddNewL( *this, textLayout );
+    nameVisual->SetTextL( aName );
+    nameVisual->SetAlign( EAlfAlignHLeft, EAlfAlignVBottom );
+#ifdef ENABLE_TEXTSTYLES
+    nameVisual->SetTextStyle( iTextStyles[ETextStyleBig] );
+#endif
+    nameVisual->SetColor( KRgbWhite );
+
+    // Add description to text layout
+    CAlfTextVisual* descriptionVisual = CAlfTextVisual::AddNewL( *this, textLayout );
+    descriptionVisual->SetTextL( aDescription );
+    descriptionVisual->SetAlign( EAlfAlignHLeft, EAlfAlignVTop );
+#ifdef ENABLE_TEXTSTYLES
+    descriptionVisual->SetTextStyle( iTextStyles[ETextStyleSmall] );
+#endif
+    descriptionVisual->SetColor( KRgbGray );
+	}
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappsuitetestcase.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,193 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+// INCLUDES
+#include <AknUtils.h>
+
+#include <alf/AlfEnv.h>
+#include <alf/AlfDisplay.h>
+#include <alf/alfcontrolgroup.h>
+#include <alf/alfroster.h>
+
+#include "AlfPerfApp.hrh"
+#include "AlfPerfAppAppUi.h"
+#include "AlfPerfAppSuiteTestCase.h"
+#include "AlfPerfAppSuiteTestCaseScroll.h"
+
+// ============================= MEMBER FUNCTIONS ==============================
+
+CAlfPerfAppSuiteTestCase* CAlfPerfAppSuiteTestCase::NewL( TInt aCaseId, TInt aSequenceIndex )
+	{
+    if ( !IsSupported( aCaseId ) )
+        {
+        User::Leave( KErrNotSupported );
+        }
+    
+	CAlfPerfAppSuiteTestCase* self = new (ELeave) CAlfPerfAppSuiteTestCase( aCaseId, aSequenceIndex );
+	CleanupStack::PushL( self );
+	self->ConstructL();
+	CleanupStack::Pop( self );
+	return self;
+	}
+	    
+CAlfPerfAppSuiteTestCase::~CAlfPerfAppSuiteTestCase()
+	{
+    if ( iEnv && iControl )
+        {
+        iControl->CancelExecution();
+        iEnv->DeleteControlGroup( KAlfPerfAppSuiteControlGroup );
+        }	
+	}
+	    
+CAlfPerfAppSuiteTestCase::CAlfPerfAppSuiteTestCase( TInt aCaseId, TInt aSequenceIndex )
+	:CAlfPerfAppTestCase(aSequenceIndex), iCaseId( aCaseId )
+	{
+	
+	}
+		
+void CAlfPerfAppSuiteTestCase::ConstructL()
+	{
+	
+	}
+		
+void CAlfPerfAppSuiteTestCase::SetupL(
+		CAlfEnv& aEnv, 
+	    const TRect& /*aVisibleArea*/, 
+	    TRequestStatus& aStatus )
+	{
+    iEnv = &aEnv;
+    iStatus = &aStatus;
+    
+    // Set screen orientation
+    CAlfPerfAppAppUi* appUi = (CAlfPerfAppAppUi*) EikonEnv()->AppUi();
+    switch ( iCaseId )
+        {    
+        case EAlfPerfAppSuiteCaseScrollContinuousPortrait:
+        case EAlfPerfAppSuiteCaseScrollIncrementalPortrait:
+        	appUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationPortrait );
+            break;
+            
+        case EAlfPerfAppSuiteCaseScrollContinuousLandscape:
+        case EAlfPerfAppSuiteCaseScrollIncrementalLandscape:
+        	appUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationLandscape );
+            break;
+        
+        default:
+            User::Leave( KErrNotSupported );
+            break;
+        }       
+        
+    
+    // Create new fullscreen display
+    TRect rect;
+	AknLayoutUtils::LayoutMetricsRect( 
+	    AknLayoutUtils::EApplicationWindow, 
+	    rect );    
+    
+	iEnv->SetFullScreenDrawing( ETrue );
+	CAlfDisplay& display = 
+	    iEnv->NewDisplayL( rect, CAlfEnv::ENewDisplayFullScreen );
+    
+    display.SetClearBackgroundL( CAlfDisplay::EClearWithSkinBackground );
+
+    // Create control group
+    CAlfControlGroup& group = 
+        iEnv->NewControlGroupL( KAlfPerfAppSuiteControlGroup );
+
+    // Create testcase control
+    CAlfPerfAppSuiteTestCaseControl* control = NULL;
+    switch ( iCaseId )
+        {
+        case EAlfPerfAppSuiteCaseScrollContinuousPortrait:
+        case EAlfPerfAppSuiteCaseScrollIncrementalPortrait:
+        case EAlfPerfAppSuiteCaseScrollContinuousLandscape:
+        case EAlfPerfAppSuiteCaseScrollIncrementalLandscape:
+            control = new (ELeave) CAlfPerfAppSuiteTestCaseScroll(this);
+            break;
+        
+        default:
+            User::Leave( KErrNotSupported );
+            break;
+        }
+        
+    CleanupStack::PushL( control );
+    control->ConstructL( *iEnv, iCaseId, rect );
+    group.AppendL( control ); // ownership passed to control group.
+    iControl = control;
+    CleanupStack::Pop( control );    
+
+    // Ready for showing
+    display.Roster().ShowL( group );
+    
+    // ImagesLoaded() send the status completion.
+	}
+
+void CAlfPerfAppSuiteTestCase::ExecuteL( TRequestStatus& aStatus )
+	{
+    // SetupL must have been called first.
+    __ASSERT_ALWAYS( iEnv, User::Invariant() );
+    __ASSERT_ALWAYS( iControl, User::Invariant() );
+    
+    iControl->StartExecuteL( aStatus );
+	}
+
+void CAlfPerfAppSuiteTestCase::TearDown()
+	{
+    // Execution side will delete CAlfEnv, so it will delete everything
+    // related to this.
+    iEnv = NULL;
+    iControl = NULL;	
+    
+    // Return orientation back to normal
+    CAlfPerfAppAppUi* appUi = (CAlfPerfAppAppUi*) EikonEnv()->AppUi();
+    TRAP_IGNORE(appUi->SetOrientationL( CAknAppUiBase::EAppUiOrientationUnspecified ));    
+	}
+
+void CAlfPerfAppSuiteTestCase::ImagesLoaded( TInt aErrorCode )
+    {
+    if( iStatus )
+        {
+        CAlfPerfAppTestCase::CompleteNow( *iStatus, aErrorCode );
+        iStatus = 0;
+        }
+    }
+
+void CAlfPerfAppSuiteTestCase::HandleVisibleAreaChange( const TRect& aRect )
+	{
+    if ( iEnv && iControl )
+        {
+        if ( iEnv->DisplayCount() > 0 )
+            {
+            iEnv->PrimaryDisplay().SetVisibleArea( aRect );
+            }
+        iControl->SetVisibleArea( aRect );
+        }	
+	}
+
+TInt CAlfPerfAppSuiteTestCase::CaseID()
+    {
+        return iCaseId;
+    }
+
+TBool CAlfPerfAppSuiteTestCase::IsSupported( TInt aCaseId )
+	{
+    return aCaseId > EAlfPerfAppSuiteMin && 
+           aCaseId < EAlfPerfAppSuiteMax;	
+	}
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappsuitetestcasecontrol.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,120 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+// INCLUDES
+#include <aknutils.h>
+
+#include <alf/alfenv.h>
+#include <alf/alfevent.h>
+
+#include "AlfPerfAppSuiteTestCaseControl.h"
+
+
+// ============================= MEMBER FUNCTIONS ==============================
+
+CAlfPerfAppSuiteTestCaseControl::CAlfPerfAppSuiteTestCaseControl()
+    {
+    }
+        
+CAlfPerfAppSuiteTestCaseControl::~CAlfPerfAppSuiteTestCaseControl()
+    {
+    CompleteNow( KErrCancel );
+    }
+        
+void CAlfPerfAppSuiteTestCaseControl::ConstructL( 
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea )
+    {
+    iCaseId = aCaseId;
+    iVisibleArea = aVisibleArea;
+    CAlfControl::ConstructL( aEnv );
+    TFileName privatePath;
+    CEikonEnv::Static()->FsSession().PrivatePath( privatePath );
+    ::CompleteWithAppPath( privatePath );
+    aEnv.TextureManager().SetImagePathL( privatePath );
+    }
+        
+void CAlfPerfAppSuiteTestCaseControl::StartExecuteL( TRequestStatus& aStatus )
+    {
+    iStatus = &aStatus;
+    *iStatus = KRequestPending;
+    
+    TRAPD( err, DoStartExecuteL() );
+    if ( err != KErrNone )
+        {
+        iStatus = NULL;
+        User::Leave( err );
+        }
+    }
+
+void CAlfPerfAppSuiteTestCaseControl::CancelExecution()
+    {
+    CompleteNow( KErrCancel );
+    }
+
+void CAlfPerfAppSuiteTestCaseControl::DoStartExecuteL()
+    {
+    CompleteNow( KErrNone );
+    }
+
+void CAlfPerfAppSuiteTestCaseControl::SetVisibleArea( 
+        const TRect& /*aVisibleArea*/ )
+    {
+    }
+
+TBool CAlfPerfAppSuiteTestCaseControl::OfferEventL( const TAlfEvent& aEvent )
+    {
+    if ( aEvent.IsCustomEvent() && 
+         aEvent.CustomParameter() == KAlfPerfAppSuiteCmdCompleteNow )
+        {
+        CompleteNow( KErrNone );
+        return ETrue;
+        }
+        
+    return CAlfControl::OfferEventL( aEvent );
+    }
+        
+void CAlfPerfAppSuiteTestCaseControl::CompleteAfterL( TInt aDuration )
+    {
+    // In order to use this service, base class StartExecuteL must
+    // have been called.
+    __ASSERT_ALWAYS( iStatus, User::Invariant() );
+    
+    TAlfCustomEventCommand command( KAlfPerfAppSuiteCmdCompleteNow, this );
+    User::LeaveIfError( Env().Send( command, aDuration ) );
+    }
+        
+void CAlfPerfAppSuiteTestCaseControl::CompleteNow( TInt aErrorCode )
+    {
+    if ( iStatus )
+        {
+        User::RequestComplete( iStatus, aErrorCode );
+        iStatus = NULL;
+        }
+    }
+
+inline TInt CAlfPerfAppSuiteTestCaseControl::CaseId() const
+    {
+    return iCaseId;
+    }
+
+TBool CAlfPerfAppSuiteTestCaseControl::IsExecutionOngoing() const
+    {
+    return ( iStatus != NULL );
+    }
+
+// end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfappsuitetestcasescroll.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,235 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+// INCLUDES
+#include <AknUtils.h>
+
+#include <alf/AlfEnv.h>
+#include <alf/AlfDisplay.h>
+#include <alf/alfimageloaderutil.h>
+#include <alf/alftexturemanager.h>
+#include <alf/alfevent.h>
+#include <alf/alfcontrolgroup.h>
+#include <alf/alfviewportlayout.h>
+#include <alf/alfgridlayout.h>
+#include <alf/alfdecklayout.h>
+#include <alf/alfimagevisual.h>
+#include <alf/alftextvisual.h>
+#include <alf/alfgradientbrush.h>
+#include <alf/alfborderbrush.h>
+#include <alf/AlfBrushArray.h>
+#include <alf/AlfTextStyle.h>
+
+#include <alfperfapp_imagetest.mbg>
+
+#include "AlfPerfApp.hrh"
+#include "AlfPerfAppSuiteTestCaseScroll.h"
+#include "AlfPerfAppSuitePeopleControl.h"
+#include "AlfPerfAppSuiteEPGControl.h"
+#include "AlfPerfAppSuiteTestCase.h"
+#include "alfperfappconfigconstants.h"
+
+
+
+
+// ============================= MEMBER FUNCTIONS ==============================
+
+CAlfPerfAppSuiteTestCaseScroll::CAlfPerfAppSuiteTestCaseScroll(CAlfPerfAppSuiteTestCase* aAppSuiteTestCase)
+    :iAppSuiteTestCase(aAppSuiteTestCase)
+    {
+    }
+
+CAlfPerfAppSuiteTestCaseScroll::~CAlfPerfAppSuiteTestCaseScroll()
+    {
+    }
+
+void CAlfPerfAppSuiteTestCaseScroll::ConstructL(
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea )
+    {
+    CAlfPerfAppSuiteTestCaseControl::ConstructL( aEnv, aCaseId, aVisibleArea );
+
+    // Setup scrolling cycle lenght
+    switch( aCaseId )
+    	{
+    	case EAlfPerfAppSuiteCaseScrollContinuousPortrait:
+    	case EAlfPerfAppSuiteCaseScrollContinuousLandscape:
+    		iCycleLenght = KCycleLenghtContinuous;
+    		break;
+
+    	case EAlfPerfAppSuiteCaseScrollIncrementalPortrait:
+    	case EAlfPerfAppSuiteCaseScrollIncrementalLandscape:
+    		iCycleLenght = KCycleLenghtIncremental;
+    		break;
+
+    	default:
+    		User::Leave( KErrNotFound );
+    		break;
+    	}
+    
+    // Use a viewport layout as a base
+    iViewPortLayout = CAlfViewportLayout::AddNewL( *this );
+    
+   	// Visible viewport is full screen
+   	iViewPortLayout->SetViewportSize( aVisibleArea.Size(), 0 );
+   	
+    // Then use a gird to hold suites
+    CAlfGridLayout* baseGridLayout = CAlfGridLayout::AddNewL( *this, 1, 1, iViewPortLayout );
+
+    // Construct suites
+    
+    iLoadedImages = 0;
+    iSuiteCount = 3;
+    // EPG suite
+   	CAlfPerfAppSuiteEPGControl* epg = new (ELeave) CAlfPerfAppSuiteEPGControl(this);
+   	epg->ConstructL( aEnv, aVisibleArea.Size(), baseGridLayout );
+   	aEnv.ControlGroup( KAlfPerfAppSuiteControlGroup ).AppendL( epg );
+	
+	// PEOPLE suite
+   	CAlfPerfAppSuitePeopleControl* people = new (ELeave) CAlfPerfAppSuitePeopleControl(this);
+   	people->ConstructL( aEnv, aVisibleArea.Size(), baseGridLayout );
+   	aEnv.ControlGroup( KAlfPerfAppSuiteControlGroup ).AppendL( people );
+	
+    // Another EPG suite
+   	epg = new (ELeave) CAlfPerfAppSuiteEPGControl(this);
+   	epg->ConstructL( aEnv, aVisibleArea.Size(), baseGridLayout );
+   	aEnv.ControlGroup( KAlfPerfAppSuiteControlGroup ).AppendL( epg );
+	
+   	// Set correct number of columns to grid
+   	baseGridLayout->SetColumns( iSuiteCount );
+
+   	// Virtual viewport depends on the number of suites
+   	TSize size = iVisibleArea.Size();
+   	size.iWidth = iVisibleArea.Width()*iSuiteCount;
+   	iViewPortLayout->SetVirtualSize( size, 0 );
+
+   	// TextureLoadingCompleted() call back is handled now in epg, people control classes.
+   	// so no need of explicit wait in this thread.
+   	// ImagesLoaded() does the request completion functionlaity. 
+    }
+
+void CAlfPerfAppSuiteTestCaseScroll::ImagesLoaded( TInt aErrorCode )
+    {
+    // inform if there is any error
+    if( aErrorCode != KErrNone )
+        {
+        iAppSuiteTestCase->ImagesLoaded( aErrorCode );
+        }
+    
+    iLoadedImages++;
+    if (iLoadedImages == iSuiteCount)
+        {
+        iAppSuiteTestCase->ImagesLoaded(KErrNone);
+        }
+    }
+
+void CAlfPerfAppSuiteTestCaseScroll::DoStartExecuteL()
+    {
+    NextCycleL();
+    }
+
+void CAlfPerfAppSuiteTestCaseScroll::SetVisibleArea(
+        const TRect& /*aVisibleArea*/ )
+    {
+    if ( IsExecutionOngoing() )
+        {
+        Env().CancelCustomCommands( this, KAlfPerfAppSuiteCmdNext );
+        TRAPD( err, NextCycleL() );
+        if ( err != KErrNone )
+            {
+            CompleteNow( err );
+            }
+        }
+    }
+
+TBool CAlfPerfAppSuiteTestCaseScroll::OfferEventL( const TAlfEvent& aEvent )
+    {
+    if ( aEvent.IsCustomEvent() &&
+         aEvent.CustomParameter() == KAlfPerfAppSuiteCmdNext )
+        {
+        TRAPD( err, NextCycleL() );
+        if ( err != KErrNone )
+            {
+            CompleteNow( err );
+            }
+        return ETrue;
+        }
+
+    return CAlfPerfAppSuiteTestCaseControl::OfferEventL( aEvent );
+    }
+
+void CAlfPerfAppSuiteTestCaseScroll::NextCycleL()
+    {
+    switch( iCaseId )
+    	{
+    	case EAlfPerfAppSuiteCaseScrollContinuousPortrait:
+    	case EAlfPerfAppSuiteCaseScrollContinuousLandscape:
+    		{
+    	    if( iCycleCounter == KNumberOfRepeats )
+    	    	{
+    	    	CompleteNow( KErrNone );
+    	    	return;
+    	    	}
+
+    	    // Bounce between first and last suites
+    	    if( iCycleCounter % 2 )
+    	    	{
+    	    	iViewPortPos = TAlfRealPoint( 0, 0 );
+    	    	}
+    	    else
+    	    	{
+    	    	iViewPortPos = TAlfRealPoint( iVisibleArea.Width()*(iSuiteCount-1), 0 );
+    	    	}
+    		}
+    		break;
+
+    	case EAlfPerfAppSuiteCaseScrollIncrementalPortrait:
+    	case EAlfPerfAppSuiteCaseScrollIncrementalLandscape:
+    		{
+    	    if( iCycleCounter == (iSuiteCount*2*KNumberOfRepeats)-1 )
+    	    	{
+    	    	CompleteNow( KErrNone );
+    	    	return;
+    	    	}
+
+    	    // Bounce between suites
+    	    if( (iCycleCounter / (iSuiteCount-1)) % 2 )
+    	    	{
+    	    	iViewPortPos.iX -= iVisibleArea.Width();
+    	    	}
+    	    else
+    	    	{
+    	    	iViewPortPos.iX += iVisibleArea.Width();
+    	    	}
+    		}
+    		break;
+
+    	default:
+    		CompleteNow( KErrNotFound );
+    		return;
+    	}
+
+    iViewPortLayout->SetViewportPos( iViewPortPos, iCycleLenght );
+
+    iCycleCounter++;
+
+    TAlfCustomEventCommand command( KAlfPerfAppSuiteCmdNext, this );
+    User::LeaveIfError( Env().Send( command, iCycleLenght ) );
+    }
+
+// end of file
+			
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfapptestcaseexecutionview.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1000 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAlfPerfAppTestCaseExecutionView implementation.
+ *
+*/
+
+
+#include <aknutils.h>
+#include <aknviewappui.h>
+#include <alfperfapp.rsg>
+#include <alf/alfenv.h>
+#include <hal.h>
+#include "alfperfapptestcaseexecutionview.h"
+#include "alfperfappconstants.h"
+#include "alfperfapptestcasefactory.h"
+#include "alfperfapptestcase.h"
+#include "alfperfappmodel.h"
+
+#include "../../alfdebugextension/inc/alfdebug.h"
+
+/**
+ * Client-server interface for daemon.
+ */
+class RAlfPerfAppDaemon : public RApaAppServiceBase
+    {
+public:
+    /**
+     * Constructor.
+     */
+    RAlfPerfAppDaemon();
+
+    /**
+     * Connects to daemon.
+     * @return error code, KErrNone upon success.
+     */
+    TInt Connect();
+
+    /**
+     * Gets measurements.
+     * @param aMeasurements this will contain measurements.
+     * @return error code.
+     */
+    TInt GetMeasurements( TAlfDebugServerMeasurements& aMeasurements );
+
+    /**
+     * Enables activity polling. 
+     * @param aEnable ETrue if enabled, EFalse if disabled.
+     * @return error code.
+     */
+    TInt EnableActivityPoll( TBool aEnable );
+
+private:
+    /**
+     * From RApaAppServiceBase, returns service UID.
+     * @return service UID.
+     */
+    virtual TUid ServiceUid() const;
+    };
+
+/**
+ * CAlfPerfAppTestCaseExecutionView::CContainer container class.
+ */
+class CAlfPerfAppTestCaseExecutionView::CContainer : public CCoeControl
+    {
+    public:
+
+        CContainer( CAlfPerfAppTestCaseExecutionView& aView );
+        void ConstructL();
+        ~CContainer();
+
+        // From base class CCoeControl    
+        virtual TKeyResponse OfferKeyEventL( 
+                const TKeyEvent& aKeyEvent, TEventCode aType );
+        virtual void HandleResourceChange( TInt aType );
+        virtual void Draw(const TRect& aRect) const;
+
+    private:
+        /**
+         * Reference to execution view.
+         * Now owned.
+         */
+        CAlfPerfAppTestCaseExecutionView& iView;
+    };
+
+/**
+ * Active object to execute test cases.
+ */
+class CAlfPerfAppTestCaseExecutionView::CActiveExecuter 
+: public CActive, private MAlfPerfAppTestCaseInterface
+    {
+    public:
+        CActiveExecuter( 
+                CAlfPerfAppTestCaseExecutionView& aView,
+                CAlfPerfAppTestCaseFactory& aFactory,
+                CAlfPerfAppModel& aModel,
+                RAlfPerfAppDaemon& aDaemon,
+                TBool aUseContinuousRun = EFalse);
+        ~CActiveExecuter();
+
+        /**
+         * Starts executing test cases.
+         */
+        void StartNextCase();
+
+        /**
+         * Sets visible area.
+         * @param aRect new visible area.
+         */ 
+        void SetVisibleArea( const TRect& aRect );
+
+        /**
+         * Ends the continuous run if it was on, otherwise does nothing.
+         */
+        void EndContinuousRun();
+
+    private:
+
+        // From base class CActive
+        virtual void RunL();
+        virtual void DoCancel();
+        virtual TInt RunError( TInt aError );
+
+        // From base class MAlfPerfAppTestCaseInterface
+        virtual void MeasureNow();
+
+    private:
+
+        /**
+         * Gets next test case.
+         * @return ETrue if test case received ok.
+         */
+        TBool GetNextTestCaseL();
+
+        /**
+         * Reports error. Calls DoReportErrorL in TRAP harness.
+         * @param aErrorCode error code.
+         */
+        void ReportError( TInt aErrorCode );
+
+        /**
+         * Reports error to model.
+         * @param aErrorCode error code.
+         */
+        void DoReportErrorL( TInt aErrorCode );
+
+        /**
+         * Reports error and continues to next case.
+         * @param aErrorCode error code.
+         */
+        void ReportErrorAndContinue( TInt aErrorCode );
+
+        /**
+         * Resets current state.
+         */
+        void Reset( TBool aOkToCallObserver );
+
+        /**
+         * Completes request status with specified error code.
+         * @param aErrorCode error code.
+         */
+        void CompleteNow( TInt aErrorCode );
+
+        /**
+         * Determine next state based on current state.
+         * It's expected that current state has been completed
+         * successfully.
+         */
+        void DetermineNextState();
+
+        /**
+         * Creates alf environment and initializes
+         * debug extension plugin.
+         */
+        void CreateEnvL();
+
+        /**
+         * Deletes alf environment.
+         */
+        void DeleteEnv();
+
+        /**
+         * Performs measurements.
+         */
+        void PerformMeasurementsL();
+
+    private:
+
+        /**
+         * Reference to execution view.
+         * Not owned.
+         */
+        CAlfPerfAppTestCaseExecutionView& iView;
+
+        /**
+         * Reference to test case factory.
+         * Not owned.
+         */
+        CAlfPerfAppTestCaseFactory& iFactory;
+
+        /**
+         * Reference to model.
+         * Not owned.
+         */
+        CAlfPerfAppModel& iModel;
+
+        /**
+         * Reference to daemon.
+         * Not owned.
+         */
+        RAlfPerfAppDaemon& iDaemon;
+
+        /**
+         * Visible area rect.
+         */
+        TRect iVisibleArea;
+
+        /**
+         * Current test case id.
+         */
+        TInt iCaseId;
+
+        /*
+         *  Current cases place in the sequence
+         */
+        TInt iSequenceIndex;
+
+        /**
+         * Enumerates different possibilities for current state.
+         */
+        enum TCurrentState
+            {
+            EStateIdle,
+            EStateCreateTestCase,
+            EStateSetupTestCase,
+            EStateExecuteTestCase,
+            EStateTearDownTestCase
+            };
+
+        /**
+         * Current state.
+         */
+        TCurrentState iCurrentState;
+
+        /**
+         * Alf environment.
+         * Owned.
+         */
+        CAlfEnv* iEnv;
+
+        /**
+         * Current test case under execution.
+         * Owned.
+         */      
+        CAlfPerfAppTestCase* iCurrentTestCase;
+
+        /**
+         * NTickCount tick period.
+         */
+        TInt iTickPeriod;  
+
+        /**
+         * Tells if the continuous run is enabled.
+         */
+        TBool iContinuousRunOngoing;
+
+        /**
+         * Tells if this is the last case. Used only to end continuous run correctly.
+         */
+        TBool iFinalCase;
+    };
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+CAlfPerfAppTestCaseExecutionView* CAlfPerfAppTestCaseExecutionView::NewLC(
+        CAlfPerfAppModel& aModel )
+    {
+    CAlfPerfAppTestCaseExecutionView* self = 
+    new (ELeave) CAlfPerfAppTestCaseExecutionView( aModel );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+CAlfPerfAppTestCaseExecutionView::~CAlfPerfAppTestCaseExecutionView()
+    {
+    delete iExecuter;
+    delete iFactory;
+
+    if ( iDaemon )
+        {
+        iDaemon->Close();
+        delete iDaemon;
+        }
+    }
+
+void CAlfPerfAppTestCaseExecutionView::NotifyLayoutChange( 
+        const TRect& aRect )
+    {
+    if ( iExecuter )
+        {
+        iExecuter->SetVisibleArea( aRect );
+        }
+    }
+
+void CAlfPerfAppTestCaseExecutionView::NotifyExecutionCompletedL()
+    {
+    AppUi()->ActivateLocalViewL( KAlfPerfAppTestCaseResultsViewId );
+    }
+
+void CAlfPerfAppTestCaseExecutionView::NotifyTestCaseVisible( TBool aVisible )
+    {
+    if ( iContainer )
+        {
+        if ( iDaemon )
+            {
+            // Call User::ResetInactivityTime periodically if test case
+            // is visible. This ensures that screensaver is not activated
+            // and thus test case execution is not disturbed.
+            (void)iDaemon->EnableActivityPoll( aVisible );
+            }
+
+        iContainer->MakeVisible( !aVisible );
+        }
+    }
+
+CAlfPerfAppTestCaseExecutionView::CAlfPerfAppTestCaseExecutionView(
+        CAlfPerfAppModel& aModel )
+: iModel( aModel )
+            {
+            }
+
+#include <apgcli.h>
+#include <apacmdln.h>
+#include "alfperfapp.hrh"
+
+        static void StartDaemonL()
+            {
+            _LIT( KAlfPerfAppDaemonExe, "alfperfappdaemon.exe" );
+            const TUid KAlfPerfAppDaemonUid = { KAlfPerfAppDaemonUidValue };
+
+            RApaLsSession apa;
+            User::LeaveIfError(apa.Connect());
+            CleanupClosePushL(apa);
+
+            CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
+            cmdLine->SetExecutableNameL( KAlfPerfAppDaemonExe );
+            cmdLine->SetServerRequiredL( KAlfPerfAppDaemonUid.iUid );
+            cmdLine->SetCommandL( EApaCommandBackground );
+            TThreadId dummy;
+
+            TRequestStatus requestStatusForRendezvous;
+            User::LeaveIfError( apa.StartApp(*cmdLine, dummy, &requestStatusForRendezvous) );
+            User::WaitForRequest( requestStatusForRendezvous );
+            User::LeaveIfError( requestStatusForRendezvous.Int() );
+
+            CleanupStack::PopAndDestroy(2, &apa);   
+            }
+
+        void CAlfPerfAppTestCaseExecutionView::ConstructL()
+            {
+            BaseConstructL( R_ALFPERFAPP_TEST_CASE_EXECUTION_VIEW );
+            iFactory = CAlfPerfAppTestCaseFactory::NewL();
+
+            iDaemon = new (ELeave) RAlfPerfAppDaemon;
+            TInt err = iDaemon->Connect();
+            if ( err == KErrNotFound )
+                {
+                TRAP( err, StartDaemonL() );
+                if ( err == KErrNone ||
+                        err == KErrAlreadyExists )
+                    {
+                    err = iDaemon->Connect();
+                    }
+                }
+            if ( err != KErrNotFound )
+                {
+                User::LeaveIfError( err );
+                }
+            }
+
+        TUid CAlfPerfAppTestCaseExecutionView::Id() const
+        {
+        return KAlfPerfAppTestCaseExecutionViewId;
+        }
+
+        // -----------------------------------------------------------------------------
+        // Handles view activation
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseExecutionView::DoActivateL(
+                const TVwsViewId& /*aPrevViewId*/,
+                TUid /*aCustomMessageId*/,
+                const TDesC8& aCustomMessage )
+            {
+            CContainer* container = new (ELeave) CContainer( *this );
+            CleanupStack::PushL( container );
+            container->ConstructL();
+            AppUi()->AddToStackL( *this, container );
+            CleanupStack::Pop( container );
+            iContainer = container;
+
+            if(aCustomMessage == _L8("UseContinuousRun"))
+                {
+                // If we should use the continuous run, use it (the ETrue in the end)
+                iExecuter = new (ELeave) CActiveExecuter( *this, *iFactory, iModel, *iDaemon, ETrue );
+                Cba()->SetCommandSetL(R_AVKON_SOFTKEYS_OK_EMPTY);
+                Cba()->DrawDeferred();
+                }
+            else
+                {
+                // If not, then just use the default parameters
+                iExecuter = new (ELeave) CActiveExecuter( *this, *iFactory, iModel, *iDaemon);
+                Cba()->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY);
+                Cba()->DrawDeferred();
+
+                }
+            iExecuter->SetVisibleArea( 
+                    TRect( container->Position(), container->Size() ) );
+            iExecuter->StartNextCase();
+            }
+
+        // -----------------------------------------------------------------------------
+        // Handles view deactivation
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseExecutionView::DoDeactivate()
+            {
+            if ( iContainer )
+                {
+                AppUi()->RemoveFromStack( iContainer );
+                delete iContainer;
+                iContainer = NULL;
+                }
+
+            delete iExecuter;
+            iExecuter = NULL;
+            }
+
+        // -----------------------------------------------------------------------------
+        // Handles test case selection view specific commands.
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseExecutionView::HandleCommandL( TInt aCommand )
+            {
+            if(aCommand == EAknSoftkeyOk) // For some reason, switch didn't catch this
+                {
+                iExecuter->EndContinuousRun();
+                return;
+                }
+            switch ( aCommand )
+                {
+                default:
+                    AppUi()->HandleCommandL( aCommand );
+                    break;
+                }
+            }
+
+        //
+        // Implementation of CAlfPerfAppTestCaseExecutionView::CContainer:
+        //
+
+        CAlfPerfAppTestCaseExecutionView::CContainer::CContainer(
+                CAlfPerfAppTestCaseExecutionView& aView )
+        : iView( aView )
+            {
+            }
+
+                void CAlfPerfAppTestCaseExecutionView::CContainer::ConstructL()
+                    {
+                    CreateWindowL();
+
+                    TRect rect;
+                    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect );
+                    SetRect( rect );
+
+                    ActivateL();
+                    }
+
+                CAlfPerfAppTestCaseExecutionView::CContainer::~CContainer()
+                    {
+                    }
+
+
+
+                TKeyResponse CAlfPerfAppTestCaseExecutionView::CContainer::OfferKeyEventL( 
+                        const TKeyEvent& /*aKeyEvent*/, TEventCode /*aType*/ )
+                    {
+                    TKeyResponse resp = EKeyWasNotConsumed;
+                    if ( IsVisible() )
+                        {
+                        resp = EKeyWasConsumed;
+                        }
+                    return resp;
+                    }
+
+                void CAlfPerfAppTestCaseExecutionView::CContainer::HandleResourceChange( TInt aType )
+                    {
+                    CCoeControl::HandleResourceChange( aType );
+
+                    if ( aType == KEikDynamicLayoutVariantSwitch )
+                        {
+                        TRect rect;
+                        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect );
+                        SetRect( rect );
+
+                        iView.NotifyLayoutChange( rect );
+                        }
+                    }
+
+                void CAlfPerfAppTestCaseExecutionView::CContainer::Draw( 
+                        const TRect& /*aRect*/ ) const
+                        {
+                        CWindowGc& gc = SystemGc();
+                        gc.SetPenStyle( CGraphicsContext::ENullPen );
+                        gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
+                        gc.SetBrushColor( TRgb( 128, 0, 0 ) ); // red color
+                        gc.DrawRect( Rect() );
+                        gc.SetBrushStyle( CGraphicsContext::ENullBrush );
+                        }
+
+                //    
+                // Implementation of CAlfPerfAppTestCaseExecutionView::CActiveExecuter:
+                //
+                CAlfPerfAppTestCaseExecutionView::CActiveExecuter::CActiveExecuter( 
+                        CAlfPerfAppTestCaseExecutionView& aView,
+                        CAlfPerfAppTestCaseFactory& aFactory,
+                        CAlfPerfAppModel& aModel,
+                        RAlfPerfAppDaemon& aDaemon,
+                        TBool aUseContinuousRun)
+                : CActive( CActive::EPriorityHigh ),
+                iView( aView ),
+                iFactory( aFactory ),
+                iModel( aModel ),
+                iDaemon( aDaemon ),
+                iCurrentState( EStateIdle ),
+                iContinuousRunOngoing( aUseContinuousRun ),
+                iFinalCase(EFalse),
+                iSequenceIndex(0)
+            {
+            CActiveScheduler::Add( this );
+
+            TInt err = HAL::Get( HAL::ENanoTickPeriod, iTickPeriod );
+            if ( err != KErrNone )
+                {
+                iTickPeriod = 1000; // assume 1ms
+                }
+            }
+
+                        CAlfPerfAppTestCaseExecutionView::CActiveExecuter::~CActiveExecuter()
+                            {
+                            Reset( EFalse ); // calls Cancel()
+                            }
+
+                        void CAlfPerfAppTestCaseExecutionView::CActiveExecuter::StartNextCase()
+                            {
+                            Reset( ETrue ); // reset sets current state to idle
+
+                            CompleteNow( KErrNone );
+                            SetActive();
+                            }
+
+                        void CAlfPerfAppTestCaseExecutionView::CActiveExecuter::SetVisibleArea(
+                                const TRect& aRect )
+                            {
+                            iVisibleArea = aRect;
+
+                            if ( iCurrentTestCase )
+                                {
+                                iCurrentTestCase->HandleVisibleAreaChange( aRect );
+                                }
+                            }
+
+                        void CAlfPerfAppTestCaseExecutionView::CActiveExecuter::EndContinuousRun()
+                            {
+                            if(iContinuousRunOngoing)
+                                {
+                                iFinalCase = ETrue;
+                                }
+
+                            iContinuousRunOngoing = EFalse;
+                            }
+
+                        void CAlfPerfAppTestCaseExecutionView::CActiveExecuter::RunL()
+                            {
+                            const TInt errorCode = iStatus.Int();
+
+                            if ( errorCode != KErrNone )
+                                {
+                                // If current test step failed, report and continue to next
+                                // test case.
+                                __ASSERT_ALWAYS( iCurrentState != EStateIdle, User::Invariant() );
+                                ReportErrorAndContinue( errorCode );
+                                return;
+                                }
+
+                            if ( iCurrentState == EStateIdle )
+                                {
+                                // When current state is idle and RunL is reached,
+                                // it's time to take next case from queue and start
+                                // execution.
+                                if ( iFinalCase || !GetNextTestCaseL())
+                                    {
+                                    // No more test cases - stop.
+                                    iView.NotifyExecutionCompletedL();
+                                    return;
+                                    }
+                                }
+
+                            if(iCurrentTestCase && iContinuousRunOngoing && iCurrentState == EStateExecuteTestCase)
+                                {
+                                TInt CaseID = iCurrentTestCase->CaseID();
+                                iModel.AddToExecuteArrayL(CaseID);
+                                }
+
+                            // Perform measurements before switching to next state
+                            switch ( iCurrentState )
+                                {
+                                case EStateSetupTestCase:
+                                case EStateExecuteTestCase:
+                                    // Going to execution or teardown phase.
+                                    PerformMeasurementsL();
+                                    break;           
+                                case EStateCreateTestCase:
+                                case EStateTearDownTestCase:
+                                case EStateIdle:
+                                default:
+                                    // Either these do not contain any activity or
+                                    // then it's performed synchronously.
+                                    break;
+                                }
+
+                            DetermineNextState();
+
+                            // Execute according to current state
+                            switch ( iCurrentState )
+                                {   
+                                case EStateCreateTestCase:
+                                    __ASSERT_ALWAYS( !iCurrentTestCase, User::Invariant() );
+                                    iCurrentTestCase = iFactory.CreateL( iCaseId, iSequenceIndex);
+
+                                    iStatus = KRequestPending;
+                                    CompleteNow( KErrNone );
+                                    SetActive();
+                                    break;
+
+                                case EStateSetupTestCase:
+                                    __ASSERT_ALWAYS( iCurrentTestCase, User::Invariant() );
+                                    // Make sure test case is visible.
+                                    // NotifyTestCaseVisible is called with EFalse in Reset().
+                                    iView.NotifyTestCaseVisible( ETrue );
+
+                                    PerformMeasurementsL();
+                                    CreateEnvL();
+
+                                    iStatus = KRequestPending;
+                                    iCurrentTestCase->SetInterface( this );
+                                    iCurrentTestCase->SetupL( *iEnv, iVisibleArea, iStatus );
+                                    SetActive();
+                                    break;
+
+                                case EStateExecuteTestCase:
+                                    __ASSERT_ALWAYS( iCurrentTestCase, User::Invariant() );
+                                    PerformMeasurementsL();
+
+                                    iStatus = KRequestPending;
+                                    iCurrentTestCase->ExecuteL( iStatus );
+                                    SetActive();
+                                    break;
+
+                                case EStateTearDownTestCase:
+                                    __ASSERT_ALWAYS( iCurrentTestCase, User::Invariant() );
+                                    PerformMeasurementsL();
+
+                                    iCurrentTestCase->TearDown();
+
+                                    PerformMeasurementsL();
+
+                                    // Perform some reset actions. Cancel() is not
+                                    // needed, because we are in RunL method.
+                                    iCurrentTestCase->SetInterface( NULL );
+                                    delete iCurrentTestCase;
+                                    iCurrentTestCase = NULL;
+                                    DeleteEnv();
+
+
+                                    Reset( ETrue );
+
+                                    iStatus = KRequestPending;
+                                    CompleteNow( KErrNone );
+                                    SetActive();
+                                    break;
+
+                                case EStateIdle:
+                                    break;
+
+                                default:
+                                    break;
+                                }
+                            }
+
+                        void CAlfPerfAppTestCaseExecutionView::CActiveExecuter::DoCancel()
+                            {
+                            delete iCurrentTestCase;
+                            iCurrentTestCase = NULL;
+                            }
+
+                        TInt CAlfPerfAppTestCaseExecutionView::CActiveExecuter::RunError( 
+                                TInt aError )
+                            {
+                            if ( iCurrentState != EStateIdle )
+                                {
+                                if(iCurrentTestCase)
+                                    {
+                                    iCurrentTestCase->TearDown();
+                                    iCurrentTestCase->SetInterface( NULL );
+                                    }
+                                ReportErrorAndContinue( aError );
+                                }
+
+                            return KErrNone;
+                            }
+
+                        void CAlfPerfAppTestCaseExecutionView::CActiveExecuter::MeasureNow()
+                            {
+                            TRAP_IGNORE( PerformMeasurementsL() );
+                            }
+
+                        TBool CAlfPerfAppTestCaseExecutionView::CActiveExecuter::GetNextTestCaseL()
+                            {
+                            TBool casesLeft = iModel.GetFromExecuteArray( iCaseId );
+
+                            if(casesLeft)
+                                {
+                                if(iCaseId < 0)
+                                    {
+                                    iSequenceIndex++;
+                                    }
+                                else
+                                    {
+                                    iSequenceIndex = 1;
+                                    }
+                                }
+                            
+                            return casesLeft;
+                            }
+
+                        void CAlfPerfAppTestCaseExecutionView::CActiveExecuter::ReportError( 
+                                TInt aErrorCode )
+                            {
+                            TRAP_IGNORE( DoReportErrorL( aErrorCode ) );
+                            }
+
+                        void CAlfPerfAppTestCaseExecutionView::CActiveExecuter::DoReportErrorL( 
+                                TInt aErrorCode )
+                            {
+                            _LIT( KAlfPerfAppErrorMessage, "0x%x failed with %d (state:%d)" );
+                            HBufC* messageBuffer = HBufC::NewLC( 128 );
+
+                            messageBuffer->Des().Format(
+                                    KAlfPerfAppErrorMessage,
+                                    iCaseId,
+                                    aErrorCode,
+                                    iCurrentState );
+
+                            iModel.AddToErrorArrayL( *messageBuffer );    
+                            CleanupStack::PopAndDestroy( messageBuffer );
+                            }
+
+                        void CAlfPerfAppTestCaseExecutionView::CActiveExecuter::ReportErrorAndContinue( 
+                                TInt aErrorCode )
+                            {
+                            ReportError( aErrorCode );
+                            StartNextCase();
+                            }
+
+                        void CAlfPerfAppTestCaseExecutionView::CActiveExecuter::Reset(
+                                TBool aOkToCallObserver )
+                            {
+                            Cancel();
+
+                            delete iCurrentTestCase;
+                            iCurrentTestCase = NULL;
+
+                            DeleteEnv();
+
+                            iCaseId = 0;
+                            iCurrentState = EStateIdle;
+
+                            if ( aOkToCallObserver )
+                                {
+                                iView.NotifyTestCaseVisible( EFalse );
+                                }
+                            }
+
+                        void CAlfPerfAppTestCaseExecutionView::CActiveExecuter::CompleteNow( 
+                                TInt aErrorCode )
+                            {
+                            TRequestStatus* status = &iStatus;
+                            User::RequestComplete( status, aErrorCode );   
+                            }
+
+                        void CAlfPerfAppTestCaseExecutionView::CActiveExecuter::DetermineNextState()
+                            {
+                            // Determine next state after step has been completed.
+                            switch ( iCurrentState )
+                                {
+                                case EStateIdle:
+                                    iCurrentState = EStateCreateTestCase;
+                                    break;
+
+                                case EStateCreateTestCase:
+                                    iCurrentState = EStateSetupTestCase;
+                                    break;
+
+                                case EStateSetupTestCase:
+                                    iCurrentState = EStateExecuteTestCase;
+                                    break;
+
+                                case EStateExecuteTestCase:
+                                    iCurrentState = EStateTearDownTestCase;
+                                    break;
+
+                                case EStateTearDownTestCase:
+                                    iCurrentState = EStateIdle;
+                                    break;
+
+                                default:
+                                    break;
+                                }
+                            }
+
+                        void CAlfPerfAppTestCaseExecutionView::CActiveExecuter::CreateEnvL()
+                            {
+                            __ASSERT_ALWAYS( !iEnv, User::Invariant() );
+                            iEnv = CAlfEnv::NewL();
+                            iEnv->SetMaxFrameRate(100);
+                            }
+
+                        void CAlfPerfAppTestCaseExecutionView::CActiveExecuter::DeleteEnv()
+                            {
+                            delete iEnv;
+                            iEnv = NULL;
+                            }
+
+                        void CAlfPerfAppTestCaseExecutionView::CActiveExecuter::PerformMeasurementsL()
+                            {
+                            CAlfPerfAppModel::TTestCaseResultItem item;
+
+                            // Test case identifiers
+                            item.iCaseId = iCaseId;
+
+                            // Phase (0 = setup, 1 = execution, 2 = teardown)
+                            switch ( iCurrentState )
+                                {
+                                case EStateIdle:
+                                case EStateCreateTestCase:
+                                case EStateSetupTestCase:
+                                    item.iPhase = 0;
+                                    break;
+
+                                case EStateExecuteTestCase:
+                                    item.iPhase = 1;
+                                    break;
+
+                                case EStateTearDownTestCase:
+                                    item.iPhase = 2;
+                                    break;
+
+                                default:
+                                    item.iPhase = -1;
+                                    break;
+                                }
+
+                            TInt dummy; // not used.
+
+                            // Amount of cells allocated in Application heap.
+                            // Total size taken by allocated cells in Application heap.
+                            // Amount of free space in Application heap.
+                            item.iAppCells = User::AllocSize( item.iAppMemory );
+                            item.iAppFree = User::Available( dummy );
+
+                            // Perform server side measurements    
+                            TAlfDebugServerMeasurements serverMeasurements;
+                            TBool measureOk = 
+                            ( iDaemon.GetMeasurements( serverMeasurements ) == KErrNone );
+
+                            if ( !measureOk )
+                                {
+                                serverMeasurements.iTimeStamp = User::NTickCount();
+                                serverMeasurements.iServerCells = 0;
+                                serverMeasurements.iServerMemory = 0;
+                                serverMeasurements.iServerFree = 0;
+                                serverMeasurements.iFrameCount = 0;
+                                }
+
+                            // Convert timestamps to ms
+                            if ( iTickPeriod != 1000 )
+                                {
+                                TUint64 stamp = serverMeasurements.iTimeStamp;
+                                stamp *= iTickPeriod;
+                                stamp /= 1000;
+                                stamp &= 0xFFFFFFFF; // modulo 2**32
+                                serverMeasurements.iTimeStamp = I64LOW( stamp );
+                                }
+
+
+                            // Amount of cells allocated in Server heap.
+                            // Total size taken by allocated cells in Server heap.
+                            // Amount of free space in Server heap.
+                            // Time stamp (preferably from server side)
+                            // Frame count
+                            item.iTimeStamp = serverMeasurements.iTimeStamp;
+                            item.iServerCells = serverMeasurements.iServerCells;
+                            item.iServerMemory = serverMeasurements.iServerMemory;
+                            item.iServerFree = serverMeasurements.iServerFree;
+                            item.iFrameCount = serverMeasurements.iFrameCount;
+
+                            // Amount of free memory in the system.
+                            // Memory consumption of the system.
+                            TInt systemFreeRam = 0;
+                            HAL::Get( HALData::EMemoryRAMFree, systemFreeRam );
+                            TInt systemTotalRam = 0;
+                            HAL::Get( HALData::EMemoryRAM, systemTotalRam );
+                            item.iSystemMemory = systemTotalRam - systemFreeRam;
+                            item.iSystemFree = systemFreeRam;
+
+                            TTestCaseSpecificResultText specificResult = 0;
+                            specificResult = iCurrentTestCase->getCaseSpecificResultL(); 
+                            if(specificResult)
+                                {
+                                item.specificResult8.Copy(specificResult->Des());
+                                delete specificResult;
+                                }
+
+                            // Append to model
+                            iModel.AddToResultFilesL( item );        
+                            }
+
+                        //
+                        // Implementation of RAlfPerfAppDaemon
+                        //
+
+                        RAlfPerfAppDaemon::RAlfPerfAppDaemon()
+                            {
+                            }
+
+                        TInt RAlfPerfAppDaemon::Connect()
+                            {
+                            TInt result = KErrNone;
+                            if ( !Handle() )
+                                {
+                                _LIT(KServerNameFormat, "%08x_%08x_AppServer");        
+                                TFullName serverName;
+                                serverName.Format(
+                                        KServerNameFormat, 
+                                        KAlfPerfAppDaemonUidValue, 
+                                        KAlfPerfAppDaemonUidValue );
+                                TRAP( result, ConnectExistingByNameL( serverName ) );
+                                }
+                            return result;
+                            }
+
+                        TInt RAlfPerfAppDaemon::GetMeasurements( 
+                                TAlfDebugServerMeasurements& aMeasurements )
+                            {
+                            if ( !Handle() )
+                                {
+                                return KErrNotSupported;
+                                }
+
+                            TPckg<TAlfDebugServerMeasurements> pckg( aMeasurements );
+                            return SendReceive( EAlfPerfAppIpcGetMeasurements, TIpcArgs( &pckg ) );
+                            }
+
+                        TInt RAlfPerfAppDaemon::EnableActivityPoll( TBool aEnable )
+                            {
+                            if ( !Handle() )
+                                {
+                                return KErrNotSupported;
+                                }
+
+                            return SendReceive( EAlfPerfAppIpcEnableActivityPoll, TIpcArgs( aEnable ? 1 : 0 ) );
+                            }
+
+                        TUid RAlfPerfAppDaemon::ServiceUid() const
+                        {
+                        return TUid::Uid( KAlfPerfAppDaemonUidValue );
+                        }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfapptestcasefactory.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAlfPerfAppTestCaseFactory implementation.
+*
+*/
+
+
+#include "alfperfapptestcasefactory.h"
+
+#include "alfperfappframeworktestcase.h"
+#include "alfperfappimagetestcase.h"
+#include "alfperfapplayouttestcase.h"
+#include "alfperfapptexttestcase.h"
+#include "alfperfappcovertestcase.h"
+#include "alfperfappsuitetestcase.h"
+#include "alfperfappgallerytestcase.h"
+#include "alfperfappgallerytestcase.h"
+#include "alfperfappavkontestcase.h"
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+CAlfPerfAppTestCaseFactory* CAlfPerfAppTestCaseFactory::NewL()
+    {
+    CAlfPerfAppTestCaseFactory* self = new (ELeave) CAlfPerfAppTestCaseFactory;
+    return self;
+    }
+
+CAlfPerfAppTestCaseFactory::~CAlfPerfAppTestCaseFactory()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// Creates test case corresponding to the aCaseId.
+//  - If the case is a sequence case (marked by negative case id), pass the sequence
+//    index to the case. Otherwise set it to 0 (to mark a non-sequence case)
+//  - This is done because same cases can be called with or without sequence
+//    functionality
+// -----------------------------------------------------------------------------
+//
+CAlfPerfAppTestCase* CAlfPerfAppTestCaseFactory::CreateL( TInt aCaseId, TInt aSequenceIndex )
+    {
+    TInt index = 0;
+    if(aCaseId < 0) // If this is a sequence case
+        {
+        aCaseId *= -1;
+        index = aSequenceIndex;
+        }
+    
+    if ( CAlfPerfAppFrameworkTestCase::IsSupported( aCaseId ) )
+        {
+        return CAlfPerfAppFrameworkTestCase::NewL( aCaseId, index);
+        }
+        
+    if ( CAlfPerfAppImageTestCase::IsSupported( aCaseId ) )
+        {
+        return CAlfPerfAppImageTestCase::NewL( aCaseId, index );
+        }
+
+    if ( CAlfPerfAppLayoutTestCase::IsSupported( aCaseId ) )
+        {
+        return CAlfPerfAppLayoutTestCase::NewL( aCaseId, index );
+        }
+        
+    if ( CAlfPerfAppTextTestCase::IsSupported( aCaseId ) )
+        {
+        return CAlfPerfAppTextTestCase::NewL( aCaseId, index );
+        }   
+    if ( CAlfPerfAppCoverTestCase::IsSupported( aCaseId ) )
+        {
+        return CAlfPerfAppCoverTestCase::NewL( aCaseId, index );
+        }
+
+    if ( CAlfPerfAppSuiteTestCase::IsSupported( aCaseId ) )
+        {
+        return CAlfPerfAppSuiteTestCase::NewL( aCaseId, index );
+        }    
+
+    if ( CAlfPerfAppGalleryTestCase::IsSupported( aCaseId ) )
+        {
+        return CAlfPerfAppGalleryTestCase::NewL( aCaseId, index );
+        }
+    
+    if ( CAlfPerfAppAvkonTestCase::IsSupported( aCaseId ) )
+        {
+        return CAlfPerfAppAvkonTestCase::NewL( aCaseId, index );
+        }
+    
+    User::Leave( KErrNotSupported );
+    return NULL;
+    }
+
+CAlfPerfAppTestCaseFactory::CAlfPerfAppTestCaseFactory()
+    {
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfapptestcaseselectionview.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,1228 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAlfPerfAppTestCaseSelectionView implementation.
+*
+*/
+
+
+#include <aknutils.h>
+#include <aknviewappui.h>
+#include <alfperfapp.rsg>
+#include <stringloader.h>
+#include <AknBidiTextUtils.h>
+#include <aknutils.h>
+#include <aknnotewrappers.h>
+#include <eiksbfrm.h>
+#include <akndef.h>
+#include <bautils.h> 
+#include "alfperfapptestcaseselectionview.h"
+#include "alfperfapp.hrh"
+#include "alfperfappconstants.h"
+#include "alfperfappmodel.h"
+
+// Execution ongoing
+_LIT( KAlfPerfAppExecuting, "Executing..\n" );
+
+// Print output path
+_LIT( KAlfPerfAppPrintOutputFormat, "Result files are in %S\n" );
+
+// Error message display
+_LIT( KAlfPerfAppNoErrors, "No errors.\n\n" );
+_LIT( KAlfPerfAppErrorHeader, "Errors:\n" );
+_LIT( KAlfPerfappErrorItem, "  %S\n" );
+_LIT( KAlfPerfAppErrorFooter, "\n" );
+
+// Results display
+_LIT( KAlfPerfAppInfoNote, "Program records results directly to two files, results are appended to the end of each file.\n\n");
+_LIT( KAlfPerfAppClearFilesQueryLine1, "Earlier results present.");
+_LIT( KAlfPerfAppClearFilesQueryLine2, "Clear the result files?");
+_LIT( KAlfPerfAppResultsHeader, 
+        "*** Field Guide ***\n- Time spend\n- Mem.usage of app,server and system\n- Frame count and fps\n");
+//_LIT( KAlfPerfAppResultsCaseStart, "%.2f s: Case: %x\n" );
+_LIT( KAlfPerfAppResultsCaseStart, "Started at: %.2f s\n");
+_LIT( KAlfPerfAppResultsCaseTitle, "\n=== %S / %S (0x%x) ===\n");
+_LIT( KAlfPerfAppResultsNone, "No results.\n\n" );
+_LIT( KAlfPerfAppSpecificResultFooter,"\n");
+
+_LIT( KAlfPerfAppResultsPhaseTitle0,"\n*** Startup ***\n" );
+_LIT( KAlfPerfAppResultsPhaseTitle1,"\n*** Run ***\n" );
+_LIT( KAlfPerfAppResultsPhaseTitle2,"\n*** Teardown ***\n" );
+_LIT( KAlfPerfAppResultsCaseTotalTitle,"\n*** Case total ***\n" );
+_LIT( KAlfPerfAppResultsCaseItem,
+        "Time: %.2f s\nMem.usage: %d/%d/%d kb\nFrames: %d (%3.1f fps)\n" );
+
+// Buffer full
+const TInt KAlfPerfAppDisplayResultMaxChars = 35000; //increase is needed for Sequence test cases
+_LIT( KAlfPerfAppDisplayBufferFull,"\n*** Display buffer full ***\n");
+
+
+
+
+/**
+ * CAlfPerfAppTestCaseSelectionView::CContainer container class.
+ */
+class CAlfPerfAppTestCaseSelectionView::CContainer : public CCoeControl, MCoeControlObserver, MEikScrollBarObserver
+    {
+    public:
+        CContainer(CAlfPerfAppModel* aModel);
+        void ConstructL();
+        ~CContainer();
+
+    public: // New functions
+        TBool PrintText(const TDesC& aDes);
+        void ClearOutputWindowL();
+        void UpdateVisualContentL(TBool aScrollToBottom);
+
+    public: // From base classes
+        virtual TKeyResponse OfferKeyEventL( 
+                const TKeyEvent& aKeyEvent, TEventCode aType );
+        virtual void HandleResourceChange( TInt aType );
+        virtual void Draw(const TRect& aRect) const;
+        virtual void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
+        virtual void HandleScrollEventL(CEikScrollBar* aScrollBar,TEikScrollEvent aEventType); // From MEikScrollBarObserver
+
+    private:
+        CEikScrollBarFrame*     iScrollBarFrame;
+        HBufC*                  iText;
+        CFont*                    iFont;
+        HBufC*                  iWrapperString;
+        CArrayFix<TPtrC>*       iWrappedArray;
+        TInt                    iCurrentLine;
+        TInt                    iLineCount;
+        TInt                    iNumberOfLinesFitsScreen;   
+        TInt                    iLeftDrawingPosition;
+        TReal                   iX_factor;
+        TReal                   iY_factor;
+        TBool                   iNotPrintedResultDisplayBufferExceeded;
+        CAlfPerfAppModel*       iModel;
+    };
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+//
+CAlfPerfAppTestCaseSelectionView* CAlfPerfAppTestCaseSelectionView::NewLC(
+        CAlfPerfAppModel& aModel )
+    {
+    CAlfPerfAppTestCaseSelectionView* self = 
+    new (ELeave) CAlfPerfAppTestCaseSelectionView( aModel );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+//
+CAlfPerfAppTestCaseSelectionView::~CAlfPerfAppTestCaseSelectionView()
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// -----------------------------------------------------------------------------
+//
+CAlfPerfAppTestCaseSelectionView::CAlfPerfAppTestCaseSelectionView(
+        CAlfPerfAppModel& aModel )
+: iModel( aModel )
+       {
+       }
+
+        // -----------------------------------------------------------------------------
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::ConstructL()
+            {
+            BaseConstructL( R_ALFPERFAPP_TEST_CASE_SELECTION_VIEW );
+            }
+
+        // -----------------------------------------------------------------------------
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::CmdRunAllL()
+            {
+            // Run all test cases (that are not excluded from 'run all').
+            iModel.ResetErrorArray();
+            if (iContainer)
+                {
+                iContainer->ClearOutputWindowL();
+                iContainer->PrintText( KAlfPerfAppExecuting );
+                }
+            iModel.ResetExecuteArray();
+
+            const TInt suiteCount = iModel.SuiteCount();
+            for ( TInt ii = 0; ii < suiteCount; ii++ )
+                {
+                // If suite is not excluded from run all, 
+                // add all test cases to execute array.
+                if ( !( iModel.SuiteFlags( ii ) & 
+                        EAlfPerfAppTestSuiteFlagExcludeFromRunAll ) )
+                    {
+                    // Add all test cases to execute array.
+                    const TInt testCount = iModel.TestCaseCount( ii );
+                    for ( TInt jj = 0; jj < testCount; jj++ )
+                        {
+                        TPtrC testName;
+                        TInt testCaseId;
+                        TInt testCaseFlags;
+                        TInt testCaseSequenceLength;
+
+                        iModel.GetTestCase(
+                                ii,
+                                jj,
+                                testName,
+                                testCaseId,
+                                testCaseFlags,
+                                testCaseSequenceLength);
+                        
+                        // Add the test case multiple times to fill the sequence (at least once though)
+                        iModel.AddToExecuteArrayL( testCaseId );
+                        for(TInt index = 1; index < testCaseSequenceLength;index++)
+                            {
+                            iModel.AddToExecuteArrayL( testCaseId );
+                            }
+                        }
+                    }
+
+                }
+
+            AppUi()->ActivateLocalViewL( KAlfPerfAppTestCaseExecutionViewId );
+            }
+
+
+
+        void CAlfPerfAppTestCaseSelectionView::CmdRunAllContinuouslyL()
+            {
+            // Run all test cases (that are not excluded from 'run all').
+            iModel.ResetErrorArray();
+            if (iContainer)
+                {
+                iContainer->ClearOutputWindowL();
+                iContainer->PrintText( KAlfPerfAppExecuting );
+                }
+            iModel.ResetExecuteArray();
+
+            const TInt suiteCount = iModel.SuiteCount();
+            for ( TInt ii = 0; ii < suiteCount; ii++ )
+                {
+                // If suite is not excluded from run all, 
+                // add all test cases to execute array.
+                if ( !( iModel.SuiteFlags( ii ) & 
+                        EAlfPerfAppTestSuiteFlagExcludeFromRunAll ) )
+                    {
+                    // Add all test cases to execute array.
+                    const TInt testCount = iModel.TestCaseCount( ii );
+                    for ( TInt jj = 0; jj < testCount; jj++ )
+                        {
+                        TPtrC testName;
+                        TInt testCaseId;
+                        TInt testCaseFlags;
+                        TInt testCaseSequenceLength;
+
+                        iModel.GetTestCase(
+                                ii,
+                                jj,
+                                testName,
+                                testCaseId,
+                                testCaseFlags,
+                                testCaseSequenceLength);
+                        
+                        // Add the test case multiple times to fill the sequence (at least once though)
+                        iModel.AddToExecuteArrayL( testCaseId );
+                        for(TInt index = 1; index < testCaseSequenceLength;index++)
+                            {
+                            iModel.AddToExecuteArrayL( testCaseId );
+                            }
+                        }
+                    }
+
+                }
+
+            // Finally tell ExecutionView to use Continuous Run
+            const TUid KCustomMessageUid = {2};
+            TBuf8<KAlfPerfAppMaxCharsInLine> customMessage;
+            customMessage.Copy(_L8("UseContinuousRun"));
+            AppUi()->ActivateLocalViewL( KAlfPerfAppTestCaseExecutionViewId,KCustomMessageUid,customMessage);
+            }
+
+
+        // -----------------------------------------------------------------------------
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::CmdRunAllFromSuiteL( 
+                TInt aSuiteIndex )
+            {
+            // Run all test cases related to specific suite.
+            const TInt testCaseCount = iModel.TestCaseCount( aSuiteIndex );
+            iModel.ResetErrorArray();
+
+            if (iContainer)
+                {
+                iContainer->ClearOutputWindowL();
+                iContainer->PrintText( KAlfPerfAppExecuting );
+                }
+
+            iModel.ResetExecuteArray();
+
+            for ( TInt ii = 0; ii < testCaseCount; ii++ )
+                {
+                TPtrC testCaseName;
+                TInt testCaseId;
+                TInt testCaseFlags;
+                TInt testCaseSequenceLength;
+
+                iModel.GetTestCase(
+                        aSuiteIndex,
+                        ii,
+                        testCaseName,
+                        testCaseId,
+                        testCaseFlags,
+                        testCaseSequenceLength);
+
+                // Add the test case multiple times to fill the sequence (at least once though)
+                iModel.AddToExecuteArrayL( testCaseId );
+                for(TInt index = 1; index < testCaseSequenceLength;index++)
+                    {
+                    iModel.AddToExecuteArrayL( testCaseId );
+                    }
+
+                AppUi()->ActivateLocalViewL( KAlfPerfAppTestCaseExecutionViewId );
+                }
+            }
+
+        // -----------------------------------------------------------------------------
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::CmdRunTestCaseL( 
+                TInt aSuiteIndex, TInt aTestCaseIndex )
+            {
+            TPtrC testCaseName;
+            TInt testCaseId;
+            TInt testCaseFlags;
+            TInt testCaseSequenceLength;
+
+            iModel.GetTestCase(
+                    aSuiteIndex,
+                    aTestCaseIndex,
+                    testCaseName,
+                    testCaseId,
+                    testCaseFlags,
+                    testCaseSequenceLength);
+
+            iModel.ResetErrorArray();
+            if (iContainer)
+                {
+                iContainer->ClearOutputWindowL();
+                iContainer->PrintText( KAlfPerfAppExecuting );
+                }
+            iModel.ResetExecuteArray();
+            
+            // Add the test case multiple times to fill the sequence (at least once though)
+            iModel.AddToExecuteArrayL( testCaseId );
+            for(TInt index = 1; index < testCaseSequenceLength;index++)
+                {
+                iModel.AddToExecuteArrayL( testCaseId );
+                }
+            
+            AppUi()->ActivateLocalViewL( KAlfPerfAppTestCaseExecutionViewId );
+            }
+
+        // -----------------------------------------------------------------------------
+        // -----------------------------------------------------------------------------
+        //
+        TUid CAlfPerfAppTestCaseSelectionView::Id() const
+        {
+        return KAlfPerfAppTestCaseSelectionViewId;
+        }
+
+        // -----------------------------------------------------------------------------
+        // Handles view activation
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::DoActivateL(
+                const TVwsViewId& /*aPrevViewId*/,
+                TUid /*aCustomMessageId*/,
+                const TDesC8& /*aCustomMessage*/ )
+            {
+            ResetContainerL();
+
+            DisplayResultsL();
+
+            // Pop up the "Clear result files?"-dialog if either of the files existed.
+            static TBool firstTime = ETrue;
+            if(firstTime)
+                {
+                if(iModel.TargetFilesExisted())
+                    {
+                    if(CEikonEnv::Static()->QueryWinL(KAlfPerfAppClearFilesQueryLine1,KAlfPerfAppClearFilesQueryLine2))
+                        {
+                        // Clear the files
+                        iModel.OpenFilesL(true);
+                        }
+                    firstTime = EFalse;
+                    }
+                }
+            }
+
+        // -----------------------------------------------------------------------------
+        // Handles view deactivation
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::DoDeactivate()
+            {
+            if ( iContainer )
+                {
+                AppUi()->RemoveFromStack( iContainer );
+                delete iContainer;
+                iContainer = NULL;
+                }
+            }
+
+
+        // -----------------------------------------------------------------------------
+        // Display test results on screen. The text is wrapped.
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::DisplayResultsL()
+             {
+            if (iContainer)
+                {
+                TBuf<KAlfPerfAppMaxCharsInLine> line;
+                iContainer->ClearOutputWindowL();
+
+                const TInt errorCount = iModel.ErrorArrayCount();
+                if ( !errorCount )
+                    {
+                    iContainer->PrintText( KAlfPerfAppNoErrors );
+                    }
+                else
+                    {
+                    iContainer->PrintText( KAlfPerfAppErrorHeader );
+                    for ( TInt ii = 0; ii < errorCount; ii++ )
+                        {
+                        TPtrC message;
+                        iModel.GetFromErrorArray( ii, message );
+                        if ( message.Length() )
+                            {
+                            line.Zero();
+                            TPtrC item = message.Left( 64 );
+                            line.Format( KAlfPerfappErrorItem, &item );
+                            iContainer->PrintText( line );
+                            }
+                        }
+                    iContainer->PrintText( KAlfPerfAppErrorFooter );
+                    }
+
+                if (iModel.ResultsNotAddedToFile())
+                    {           
+                    iContainer->PrintText( KAlfPerfAppResultsNone );
+                    iContainer->PrintText( KAlfPerfAppInfoNote );
+                    }    
+                else
+                    {  
+                    line.Zero();
+                    line.Format( KAlfPerfAppResultsHeader ); 
+                    iContainer->PrintText(line);
+
+                    // Prepare to read lines
+                    TFileText LineFromFile;
+                    LineFromFile.Set(*iModel.ResultFile());
+                    LineFromFile.Seek(ESeekStart);
+                    
+                    // Read the first line and forget it (header info only)
+                    line.Copy(getLineFromTargetFile());
+                    
+                    TInt currentCase = 0;
+                    TBool startTimeNotRecorded = ETrue;
+                    TUint32 timeStampAtStart = 0;
+                    TInt framesSinceCase = 0;
+                    CAlfPerfAppModel::TTestCaseResultItem itemAtCase;
+                    CAlfPerfAppModel::TTestCaseResultItem itemAtPhase;
+                    TBuf8<KAlfPerfAppMaxCharsInSpecificResultText> specificResultStorage;
+                    for(TInt i=0; ; i++) // i = line number in result file
+                        {
+                        line.Zero();
+
+                        // Read a line from file and convert it to an TTestCaseResultItem
+                        line.Copy(getLineFromTargetFile());
+                        if(line.Length() == 0)
+                            {
+                            // If the line is empty, end this loop
+                            break;
+                            }
+                        CAlfPerfAppModel::TTestCaseResultItem item;
+                        item = ResultItemFromLine(line);
+                        line.Zero();
+                        
+                        if(startTimeNotRecorded)
+                            {
+                            timeStampAtStart = item.iTimeStamp;
+                            startTimeNotRecorded = EFalse;
+                            }
+
+                        TUint32 timeFromStart = 
+                        DeltaFromCurrentToPrevious( 
+                                item.iTimeStamp, timeStampAtStart );
+
+                        TBool changedCase = EFalse;
+                        if ( !i || currentCase != item.iCaseId )
+                            {
+                            currentCase = item.iCaseId;
+                            itemAtCase = item;
+                            framesSinceCase = 0;
+                            changedCase = ETrue;
+                            //specificResultStorage.Zero(); 
+                            }
+
+                        if(changedCase || itemAtPhase.iPhase != item.iPhase)
+                            {
+                            itemAtPhase = item;
+                            }
+
+                        if ( changedCase )
+                            {
+                            // Name
+                            TBuf<100> suiteName;
+                            suiteName.Copy(item.iSuiteName);
+                            TBuf<100> caseName;
+                            caseName.Copy(item.iCaseName);
+                            line.Format( 
+                                    KAlfPerfAppResultsCaseTitle,                           
+                                    &suiteName,
+                                    &caseName,
+                                    item.iCaseId);
+                            if(!iContainer->PrintText(line))break;
+                            line.Zero();
+
+                            // Start time
+                            line.AppendFormat( KAlfPerfAppResultsCaseStart, 
+                                    ((TReal32)timeFromStart/1000));
+                            if(!iContainer->PrintText(line))break;
+                            line.Zero();
+                            }
+                            
+                        if(item.specificResult8.Length() != 0)
+                            {
+                            specificResultStorage.Zero();
+                            specificResultStorage.Append(item.specificResult8);
+                            }
+                        
+                        if(i&0x1) // Skip even lines
+                            {
+                            // Print phase data
+                            if (item.iPhase == 0)
+                                {
+                                line.AppendFormat(KAlfPerfAppResultsPhaseTitle0);
+                                }
+                            else if (item.iPhase == 1)
+                                {
+                                line.AppendFormat(KAlfPerfAppResultsPhaseTitle1);
+                                }
+                            else
+                                {
+                                line.AppendFormat(KAlfPerfAppResultsPhaseTitle2);
+                                }
+                            
+                            line.AppendFormat( KAlfPerfAppResultsCaseItem, 
+                                    // duration
+                                    ((TReal32)item.imsSincePhase)/1000,
+                                    // memory consumption delta
+                                    ( item.iAppMemory - itemAtPhase.iAppMemory )/ 1024, 
+                                    ( item.iServerMemory - itemAtPhase.iServerMemory )/ 1024, 
+                                    ( item.iSystemMemory - itemAtPhase.iSystemMemory )/ 1024,
+                                    // frame info
+                                    item.iFrameCount,
+                                    item.iFPS );
+                            if(!iContainer->PrintText(line))break;
+                            line.Zero();
+                            
+                            // Testcase specific results
+                            if(specificResultStorage.Length() != 0)
+                                {
+                                TBuf<KAlfPerfAppMaxCharsInSpecificResultText> specificResult16;
+                                specificResult16.Copy(specificResultStorage);
+                                line.Append(specificResult16);
+                                line.Append(KAlfPerfAppSpecificResultFooter);
+                                if(!iContainer->PrintText(line))break;
+                                specificResultStorage.Zero();
+                                line.Zero();
+                                }
+                            
+
+                            framesSinceCase += item.iFrameCount;
+                            if (item.iPhase == 2)
+                                {
+                                // Print case data
+                                // need to be done like this because of fpsSinceCase is not
+                                // recorded to file
+                                TUint32 timeFromCase = item.imsSinceCase;
+
+                                TReal32 fpsSinceCase = 0.f;
+                                if ( timeFromCase != 0 )
+                                    {
+                                    fpsSinceCase = ((TReal32)framesSinceCase*1000)/timeFromCase;
+                                    }
+
+                                line.AppendFormat(KAlfPerfAppResultsCaseTotalTitle);
+                                if(!iContainer->PrintText(line))break;
+                                
+                                line.Format( KAlfPerfAppResultsCaseItem, 
+                                        // duration
+                                        ((TReal32)timeFromCase/1000),
+                                        // memory consumption delta
+                                        ( item.iAppMemory - itemAtCase.iAppMemory )/ 1024, 
+                                        ( item.iServerMemory - itemAtCase.iServerMemory )/ 1024, 
+                                        ( item.iSystemMemory - itemAtCase.iSystemMemory )/ 1024,
+                                        // frame info
+                                        framesSinceCase,
+                                        fpsSinceCase );
+
+                                if(!iContainer->PrintText(line))break;
+                                line.Zero();
+                                }	                
+
+                            }
+                        }
+                    }
+             
+                TBuf<KAlfPerfAppMaxCharsInLine> temp = iModel.TargetPath();
+            	line.Format( KAlfPerfAppPrintOutputFormat, &temp);
+            	iContainer->PrintText(line);
+
+            	// Finally update results to screen            
+            	iContainer->UpdateVisualContentL(ETrue);
+            	}
+            }
+
+        
+        // -----------------------------------------------------------------------------
+        // Handles test case selection view specific commands.
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::HandleCommandL( TInt aCommand )
+            {
+            switch ( aCommand )
+                {
+                case EAlfPerfAppCmdRunAll:
+                    CmdRunAllL();
+                    break;
+
+                case EAlfPerfAppCmdRunAllContinuously:
+                    CmdRunAllContinuouslyL();
+                    break;
+                   
+                case EAlfPerfAppCmdClearFiles:
+                    
+                    TBuf<1> empty;
+                    if(CEikonEnv::Static()->QueryWinL(KAlfPerfAppClearFilesQueryLine2,empty))
+                        {
+                        // Clear the files
+                        iModel.OpenFilesL(true);
+                        ResetContainerL();
+                        DisplayResultsL();
+                        }
+                   
+                    break;
+                   
+
+                default:
+                    {
+                    if ( ( aCommand & ~0xFFFF ) == EAlfPerfAppCmdTestCase )
+                        {
+                        const TInt testSuiteIndex = ( aCommand & 0xFF00 ) >> 8;
+                        TInt testCaseIndex = aCommand & 0xFF;
+
+                        if ( !testCaseIndex )
+                            {
+                            CmdRunAllFromSuiteL( testSuiteIndex );
+                            }
+                        else
+                            {
+                            // Run one specific test case
+                            testCaseIndex--;
+                            CmdRunTestCaseL( testSuiteIndex, testCaseIndex );                   
+                            }
+                        }
+                    else
+                        {
+                        AppUi()->HandleCommandL( aCommand );
+                        }
+                    }
+                    break;
+                }
+            }
+
+
+        // -----------------------------------------------------------------------------
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::RestoreMenuL( 
+                CCoeControl* aMenuControl, TInt aResourceId, TMenuType aType )
+            {
+            // Override resource in case of test suite menu
+            iResourceId = 0;
+
+            if ( ( aResourceId & ~0xFFFF ) == KAlfPerfAppMenuPaneResourceId )
+                {
+                iResourceId = aResourceId;
+                aResourceId = R_ALFPERFAPP_TEST_CASE_SELECTION_SUITE_MENUPANE;
+                }
+
+            CAknView::RestoreMenuL( 
+                    aMenuControl, 
+                    aResourceId,
+                    aType );
+            }
+
+        // -----------------------------------------------------------------------------
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::DynInitMenuPaneL(
+                TInt aResourceId,
+                CEikMenuPane* aMenuPane )
+            {
+            if ( aResourceId == R_ALFPERFAPP_TEST_CASE_SELECTION_MENUPANE )
+                {
+                // Add all suites to top level options menu.
+                const TInt suiteCount = iModel.SuiteCount();
+                for ( TInt ii = suiteCount - 1; ii >= 0; ii-- )
+                    {
+                    CEikMenuPaneItem::SData data;
+                    data.iCommandId = 0;
+                    data.iCascadeId = KAlfPerfAppMenuPaneResourceId + (ii << 8);
+                    data.iFlags = 0;        
+                    data.iText.Copy( iModel.SuiteName( ii ) );
+                    data.iExtraText.Zero();
+
+                    aMenuPane->AddMenuItemL( data, EAlfPerfAppCmdRunAllContinuously );
+                    }
+                }
+
+            if ( aResourceId == R_ALFPERFAPP_TEST_CASE_SELECTION_SUITE_MENUPANE )
+                {
+                const TInt suiteIndex = ( iResourceId & 0xFF00 ) >> 8;
+                const TInt testCaseCount = iModel.TestCaseCount( suiteIndex );
+
+                // Add 'Run All' option
+                HBufC* runAllText = StringLoader::LoadLC( R_ALFPERFAPP_TEXT_RUNALL );
+                CEikMenuPaneItem::SData runAll;
+                runAll.iCommandId = EAlfPerfAppCmdTestCase + (suiteIndex << 8);
+                runAll.iCascadeId = 0;
+                runAll.iFlags = 0;           
+                runAll.iText.Copy( *runAllText );
+                runAll.iExtraText.Zero();
+                aMenuPane->AddMenuItemL( runAll );
+                CleanupStack::PopAndDestroy( runAllText );
+
+                // Add options menu items for all test cases of this suite        
+                for ( TInt ii = 0; ii < testCaseCount; ii++ )
+                    {
+                    CEikMenuPaneItem::SData data;
+                    data.iCommandId = EAlfPerfAppCmdTestCase + (suiteIndex << 8) + ii + 1;
+                    data.iCascadeId = 0;
+                    data.iFlags = 0;
+
+                    TPtrC testCaseName;
+                    TInt testCaseId;
+                    TInt flags;
+                    TInt sequenceLength;
+
+                    iModel.GetTestCase( 
+                            suiteIndex, 
+                            ii, 
+                            testCaseName,
+                            testCaseId,
+                            flags,
+                            sequenceLength);
+
+                    data.iText.Copy( testCaseName );
+                    data.iExtraText.Zero();
+
+                    aMenuPane->AddMenuItemL( data );
+                    }
+                }
+            }
+
+        TBuf8<KAlfPerfAppMaxCharsInLine> CAlfPerfAppTestCaseSelectionView::getLineFromTargetFile()
+            {
+            TBuf8<KAlfPerfAppMaxCharsInLine> line;
+            TBuf8<1> character;
+            iModel.ResultFile()->Read(character,1);
+            if(character.Length() == 0)
+                {
+                // File was empty --> return empty line
+                return line;
+                }
+            while(character[0]  != '\n')
+                {
+                line.Append(character);
+                iModel.ResultFile()->Read(character,1);
+                }
+            return line;
+            }
+        
+        void CAlfPerfAppTestCaseSelectionView::ResetContainerL()
+            {
+            // Reset the container
+            if ( iContainer )
+                {
+                AppUi()->RemoveFromStack( iContainer );
+                delete iContainer;
+                iContainer = NULL;
+                }
+            CContainer* container = new (ELeave) CContainer(&iModel);
+            CleanupStack::PushL( container );
+            container->ConstructL();
+            AppUi()->AddToStackL( *this, container );
+            CleanupStack::Pop( container );
+            iContainer = container;
+            }
+        
+        
+        // Let's create a function template for extracting items from lexer
+        TBuf<KAlfPerfAppMaxCharsInLine>& ProcessLexer(TLex& aLexer, TChar aSeparator,TBuf<KAlfPerfAppMaxCharsInLine>& aToken)
+            {
+            aToken.Zero();
+            TChar ch;
+            aLexer.SkipAndMark(0);
+            while (!aLexer.Eos())
+                {
+                ch = aLexer.Get();                    
+                if(ch == aSeparator)
+                    {
+                    aLexer.UnGet();
+                    aToken.Append(aLexer.MarkedToken());
+                    aLexer.SkipAndMark(1);
+                    break;
+                    }
+                }
+            return aToken;
+            }
+
+        CAlfPerfAppModel::TTestCaseResultItem CAlfPerfAppTestCaseSelectionView::ResultItemFromLine(TBuf<KAlfPerfAppMaxCharsInLine>& aLine)
+            {
+            CAlfPerfAppModel::TTestCaseResultItem item;
+
+            TBuf<KAlfPerfAppMaxCharsInLine> temp;
+            TLex lexer(aLine);
+            TLex tempLex;
+            
+            item.iSuiteName.Copy(ProcessLexer(lexer,'/',temp));
+            item.iSuiteName.Trim();
+            item.iCaseName.Copy(ProcessLexer(lexer,',',temp));
+            tempLex.Assign(ProcessLexer(lexer,',',temp));
+            item.iCaseName.Trim();
+            tempLex.Val(item.iCaseId);
+            tempLex.Assign(ProcessLexer(lexer,',',temp));
+            tempLex.Val(item.iPhase);           
+            tempLex.Assign(ProcessLexer(lexer,',',temp));
+            tempLex.Val(item.iTimeStamp,EDecimal);
+            tempLex.Assign(ProcessLexer(lexer,',',temp));
+            tempLex.Val(item.iAppCells);   
+            tempLex.Assign(ProcessLexer(lexer,',',temp));
+            tempLex.Val(item.iAppMemory);   
+            tempLex.Assign(ProcessLexer(lexer,',',temp));
+            tempLex.Val(item.iAppFree);
+            tempLex.Assign(ProcessLexer(lexer,',',temp));
+            tempLex.Val(item.iServerCells);   
+            tempLex.Assign(ProcessLexer(lexer,',',temp));
+            tempLex.Val(item.iServerMemory);   
+            tempLex.Assign(ProcessLexer(lexer,',',temp));
+            tempLex.Val(item.iServerFree);
+            tempLex.Assign(ProcessLexer(lexer,',',temp));
+            tempLex.Val(item.iSystemMemory);   
+            tempLex.Assign(ProcessLexer(lexer,',',temp));
+            tempLex.Val(item.iSystemFree);
+            tempLex.Assign(ProcessLexer(lexer,',',temp));
+            tempLex.Val(item.iFrameCount,EDecimal);
+            tempLex.Assign(ProcessLexer(lexer,',',temp));
+            tempLex.Val(item.imsSinceCase,EDecimal);
+            tempLex.Assign(ProcessLexer(lexer,',',temp));
+            tempLex.Val(item.imsSincePhase,EDecimal);
+            TBuf<15> fpsBuffer (ProcessLexer(lexer,',',temp));
+            tempLex.Assign(fpsBuffer);
+            tempLex.Val(item.iFPS);
+            item.specificResult8.Copy(lexer.Remainder());
+            item.specificResult8.Delete(item.specificResult8.Length()-1,1);
+
+            return item;
+            }
+
+
+
+        // Implementation of DeltaFromCurrentToPrevious
+        TUint32 CAlfPerfAppTestCaseSelectionView::DeltaFromCurrentToPrevious( 
+                TUint32 aCurrent, TUint32 aPrevious )
+            {
+            // It's expected that execution of all test suites take less
+            // than KMaxTInt ms (so that it fits to TInt).
+
+            TUint64 delta = 0;
+            if ( aPrevious <= aCurrent )
+                {
+                // aPrevious .. aCurrent
+                delta = aCurrent - aPrevious;
+                }
+            else
+                {
+                // Overflow has occurred.
+                // aPrevious .. 2**32 + aCurrent
+
+                delta = 0xFFFFFFFF;
+                delta -= aPrevious;
+                delta++;
+                delta += aCurrent;        
+                }
+
+            if ( delta >= KMaxTInt )
+                {
+                delta = KMaxTInt;
+                }
+
+            return I64LOW( delta );
+            }
+
+
+        // Implementation of CAlfPerfAppTestCaseSelectionView::CContainer:
+        // -----------------------------------------------------------------------------
+        //
+        CAlfPerfAppTestCaseSelectionView::CContainer::CContainer(CAlfPerfAppModel* aModel)
+            {
+                iModel = aModel;
+            }
+
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::CContainer::ConstructL()
+            {
+            CreateWindowL();
+
+            TRect rect;
+            AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, rect );
+            SetRect( rect );
+
+            iText = HBufC::NewL(KAlfPerfScreenTextBufferSize);
+            iCurrentLine = 0;
+            iLineCount = 0;
+            iNumberOfLinesFitsScreen = 0;
+            iX_factor = 1;
+            iY_factor = 1;
+            iLeftDrawingPosition = KAlfPerfAppLeftMargin;
+
+            TFontSpec myFontSpec(KAlfPerfAppFontName,KAlfPerfAppFontSizeInTwips); 
+            CGraphicsDevice* screenDevice=iCoeEnv->ScreenDevice();
+            screenDevice->GetNearestFontInTwips(iFont,myFontSpec);
+
+            iWrappedArray = new(ELeave) CArrayFixFlat<TPtrC>(KAlfPerfScreenWrappedArraySize);
+
+            iNotPrintedResultDisplayBufferExceeded = ETrue;
+
+            ActivateL();
+            }
+
+
+
+        // -----------------------------------------------------------------------------
+        // -----------------------------------------------------------------------------
+        //
+        CAlfPerfAppTestCaseSelectionView::CContainer::~CContainer()
+            {
+            // Destroy the font
+            iCoeEnv->ScreenDevice()->ReleaseFont(iFont);
+
+            if (iWrappedArray)
+                {
+                iWrappedArray->Reset();
+                delete iWrappedArray;
+                }
+
+            if (iText)
+                delete iText;
+
+            if (iScrollBarFrame)
+                delete iScrollBarFrame;
+
+            if (iWrapperString)
+                delete iWrapperString;
+            }
+
+
+        // -----------------------------------------------------------------------------
+        // -----------------------------------------------------------------------------
+        //
+        TKeyResponse CAlfPerfAppTestCaseSelectionView::CContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
+            {
+            if(aType != EEventKey)
+                return EKeyWasConsumed;
+
+            if(aKeyEvent.iCode == EKeyUpArrow)
+                {
+                if (iCurrentLine > 0)
+                    {
+                    iCurrentLine--;
+                    UpdateVisualContentL(EFalse);
+                    }
+
+                return EKeyWasConsumed;
+                }
+
+            else if(aKeyEvent.iCode == EKeyDownArrow)
+                {
+                if (iCurrentLine < iLineCount - iNumberOfLinesFitsScreen)
+                    {
+                    iCurrentLine++;
+                    UpdateVisualContentL(EFalse);
+                    }
+
+                return EKeyWasConsumed;
+                }
+
+            return EKeyWasConsumed;    
+            }
+
+
+        // -----------------------------------------------------------------------------
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::CContainer::HandleResourceChange(TInt aType)
+            {
+            if ( aType == KEikDynamicLayoutVariantSwitch )
+                {
+                TRect mainPaneRect;
+                AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+                SetRect(mainPaneRect);
+
+                iCurrentLine = 0; // scroll to top
+
+                // update font
+                // Discard and destroy the font
+                iCoeEnv->ScreenDevice()->ReleaseFont(iFont);
+
+                // Create the font 
+                TFontSpec myFontSpec(KAlfPerfAppFontName,KAlfPerfAppFontSizeInTwips); 
+                CGraphicsDevice* screenDevice=iCoeEnv->ScreenDevice();
+                screenDevice->GetNearestFontInTwips(iFont,myFontSpec);
+
+                // delete the scroll and update screen
+                if (iScrollBarFrame)
+                    {
+                    delete iScrollBarFrame;
+                    iScrollBarFrame = NULL;
+                    }
+                TRAP_IGNORE(UpdateVisualContentL(EFalse));
+                }
+            else
+                {
+                CCoeControl::HandleResourceChange(aType);
+                }
+            }
+
+
+        // -----------------------------------------------------------------------------
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::CContainer::HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType)
+            {
+            // only on page up/down,scroll up/down and drag events
+            if ((aEventType == EEikScrollPageDown) || (aEventType == EEikScrollPageUp) || 
+                    (aEventType == EEikScrollThumbDragVert) || (aEventType == EEikScrollUp) ||
+                    (aEventType == EEikScrollDown))
+                {
+                // get the current position from the scroll bar
+                iCurrentLine = aScrollBar->ThumbPosition();
+
+                // refresh now
+                UpdateVisualContentL(EFalse);
+                }
+            }
+
+        // -----------------------------------------------------------------------------
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::CContainer::HandleControlEventL(
+                CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
+            {
+            // TODO: Add your control event handler code here
+            }
+
+
+        // -----------------------------------------------------------------------------
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::CContainer::UpdateVisualContentL(TBool aScrollToBottom)
+            {
+            TSize rectSize;
+            AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, rectSize);
+            TRect rect(rectSize);
+
+            // init scroll bar if not yet done
+            if (!iScrollBarFrame)
+                {
+                iScrollBarFrame = new(ELeave) CEikScrollBarFrame(this, this, ETrue);
+
+                CAknAppUi* appUi = iAvkonAppUi;
+
+                if (AknLayoutUtils::DefaultScrollBarType(appUi) == CEikScrollBarFrame::EDoubleSpan)
+                    {
+                    iScrollBarFrame->CreateDoubleSpanScrollBarsL(ETrue, EFalse);            
+                    iScrollBarFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EDoubleSpan);
+                    }
+                else
+                    {
+                    iScrollBarFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EArrowHead);
+                    }  
+                iScrollBarFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
+                }
+
+            // drawing positions, needed for scalable ui
+            iX_factor = TReal(rect.Width()) / 176;
+            iY_factor = TReal(rect.Height()) / 144;
+
+            iWrappedArray->Reset();
+
+            if (iWrapperString)
+                {
+                delete iWrapperString;
+                iWrapperString = NULL;
+                }
+
+            // define drawing width, some extra space needed if using double span scrolling bar
+            TUint drawingWidth(0);
+            if (iScrollBarFrame->TypeOfVScrollBar() == CEikScrollBarFrame::EDoubleSpan)
+                {
+                if (AknLayoutUtils::LayoutMirrored())  // scroll bar on 'left'
+                    {
+                    iLeftDrawingPosition = KAlfPerfAppLeftMargin + 12;
+                    drawingWidth = TInt( rect.Width() - iLeftDrawingPosition*iX_factor - (KAlfPerfAppRightMargin*iX_factor)); 
+                    }
+                else // scroll bar on 'right'
+                    {
+                    iLeftDrawingPosition = KAlfPerfAppLeftMargin;  
+                    drawingWidth = TInt( rect.Width() - iLeftDrawingPosition*iX_factor - (KAlfPerfAppRightMargin*iX_factor + 7*iX_factor)); 
+                    }        
+                }
+            else
+                drawingWidth = TInt( rect.Width() - KAlfPerfAppLeftMargin*iX_factor - KAlfPerfAppRightMargin*iX_factor);
+
+            // wrap the text
+            iWrapperString = AknBidiTextUtils::ConvertToVisualAndWrapToArrayL(
+                    iText->Des(),
+                    drawingWidth,
+                    *iFont,
+                    *iWrappedArray
+            );
+
+            iLineCount = iWrappedArray->Count();
+
+            // count amount of lines fits to screen
+            iNumberOfLinesFitsScreen = TInt(rect.Height() / (iFont->HeightInPixels()));
+
+            // check if needed to scroll to the bottom
+            if (aScrollToBottom && iCurrentLine < iLineCount - iNumberOfLinesFitsScreen)
+                {
+                iCurrentLine = iLineCount-iNumberOfLinesFitsScreen;
+                }
+
+            // update the scroll bars
+            TEikScrollBarModel horizontalBar;
+            TEikScrollBarModel verticalBar;
+            verticalBar.iThumbPosition = iCurrentLine;
+            verticalBar.iScrollSpan = iLineCount - iNumberOfLinesFitsScreen + 1;
+            verticalBar.iThumbSpan = 1;
+
+            TEikScrollBarFrameLayout layout;
+            layout.iTilingMode = TEikScrollBarFrameLayout::EInclusiveRectConstant;
+
+            if (iScrollBarFrame->TypeOfVScrollBar() == CEikScrollBarFrame::EDoubleSpan)
+                {    
+                // do not let scrollbar values overflow
+                if (verticalBar.iThumbPosition + verticalBar.iThumbSpan > verticalBar.iScrollSpan)
+                    verticalBar.iThumbPosition = verticalBar.iScrollSpan - verticalBar.iThumbSpan;
+
+                TAknDoubleSpanScrollBarModel horizontalDSBar(horizontalBar);
+                TAknDoubleSpanScrollBarModel verticalDSBar(verticalBar);
+
+                iScrollBarFrame->TileL(&horizontalDSBar, &verticalDSBar, rect, rect, layout);        
+                iScrollBarFrame->SetVFocusPosToThumbPos(verticalDSBar.FocusPosition());
+                }  
+            else
+                {
+                iScrollBarFrame->TileL( &horizontalBar, &verticalBar, rect, rect, layout );
+                iScrollBarFrame->SetVFocusPosToThumbPos( verticalBar.iThumbPosition );
+                }
+
+
+            // update the screen
+            DrawNow();
+            }
+
+        // -----------------------------------------------------------------------------
+        // -----------------------------------------------------------------------------
+        //
+        TBool CAlfPerfAppTestCaseSelectionView::CContainer::PrintText(const TDesC& aDes)
+            {
+            // This doesn't guarantee that iText length actually remains below KAlfPerfAppDisplayResultMaxChars
+            // but it won't exceed it that much. Approximation can be used for the limiting value.
+            if(iText->Length() < KAlfPerfAppDisplayResultMaxChars)
+                {
+                iText->Des().Append( aDes );
+                return ETrue;
+                }
+            else
+                {
+                if(iNotPrintedResultDisplayBufferExceeded)
+                    {
+                    iText->Des().Append( KAlfPerfAppDisplayBufferFull);
+                    TBuf<KAlfPerfAppMaxCharsInLine> line;
+                    TBuf<KAlfPerfAppMaxCharsInLine> temp = iModel->TargetPath();
+                    line.Format(KAlfPerfAppPrintOutputFormat, &temp);
+                    iText->Des().Append(line); 
+                    iNotPrintedResultDisplayBufferExceeded = EFalse;
+                    }
+                return EFalse;
+                }
+            }
+
+        // -----------------------------------------------------------------------------
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::CContainer::ClearOutputWindowL()
+            {
+            iText->Des().Zero();
+            iNotPrintedResultDisplayBufferExceeded = ETrue;
+            UpdateVisualContentL(ETrue);
+            }
+
+
+        // -----------------------------------------------------------------------------
+        // -----------------------------------------------------------------------------
+        //
+        void CAlfPerfAppTestCaseSelectionView::CContainer::Draw( 
+                const TRect& aRect ) const
+                {
+                CWindowGc& gc = SystemGc();
+                gc.Clear(aRect);
+                gc.SetPenColor(KRgbBlack);
+                gc.UseFont(iFont);
+
+                // draw the text
+                for (TInt i=0; i<iNumberOfLinesFitsScreen; i++)
+                    {
+                    // index out of bounds check and then draw text
+                    if (i+iCurrentLine < iWrappedArray->Count())
+                        gc.DrawText(iWrappedArray->At(i+iCurrentLine), 
+                                TPoint(TInt(iLeftDrawingPosition*iX_factor), TInt(iFont->HeightInPixels()*(i+1))));
+                    }
+                gc.DiscardFont();
+                }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperfapptexttestcase.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,802 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  CAlfPerfApptextTestCase implementation.
+ *
+*/
+
+
+#include "alfperfappbasetestcasecontrol.h"
+#include "alfperfapptexttestcase.h"
+#include "alfperfapp.hrh"
+#include "alfperfappconfigconstants.h"
+#include <aknutils.h>
+#include <alf/alfenv.h>
+#include <alf/alfdisplay.h>
+#include <alf/alfcontrol.h>
+#include <alf/alfcontrolgroup.h>
+#include <alf/alfroster.h>
+#include <alf/alfcommand.h>
+#include <alf/alfevent.h>
+#include <alf/alftexturemanager.h>
+#include <alf/alftextvisual.h>
+#include <alf/alfimageloaderutil.h>
+#include <alf/alfutil.h>
+#include <e32math.h>
+
+//#include <alfperfapp_texttest.mbg>
+
+/**
+ * Control group for Text test cases.
+ */
+const TInt KAlfPerfAppTextControlGroup = 1;
+
+/*
+ * Square root of sequence length for the image sequence cases
+ */
+const TInt SEQUENCE_LENGTH_SQRT = 7;
+
+/**
+ * Start next 'cycle' command.
+ */
+const TInt KAlfPerfAppTextCmdNext = 0x5001;
+
+/**
+ * Amount of text visuals.
+ */
+const TInt KAlfPerfAppTextTestCaseBasicTextCount = 16;
+
+/**
+ * Basic Text scale & movement test case.
+ */
+class CAlfPerfAppTextTestCaseBasic : public CAlfPerfAppBaseTestCaseControl
+    {
+public:
+    CAlfPerfAppTextTestCaseBasic();
+    ~CAlfPerfAppTextTestCaseBasic();
+
+    virtual void ConstructL( 
+            CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea );      
+    virtual void DoStartExecuteL();
+    virtual TBool OfferEventL( const TAlfEvent& aEvent );
+    virtual void SetVisibleArea( const TRect& aVisibleArea );    
+
+private:
+
+    /**
+     * Next cycle.
+     */
+    void NextCycleL();
+
+    /**
+     * Returns opacity for index.
+     */
+    TReal32 OpacityForIndex( TInt aIndex );
+
+    /**
+     * Returns size for index.
+     */
+    TAlfRealSize SizeForIndex( TInt aIndex );
+
+    /**
+     * Returns position for index.
+     */
+    TAlfRealPoint PositionForIndex( TInt aIndex, const TAlfRealSize& aSize );
+
+private:
+    /**
+     * Test case of which execution this instance was created.
+     */ 
+    TInt iCaseId;
+
+    /**
+     * Text visuals.
+     */
+    RPointerArray< CAlfTextVisual > iTexts;
+
+    /**
+     * Cycle counter.
+     */        
+    TInt iCycleCounter;
+
+
+    };
+
+/**
+ * Many texts at the same time
+ */
+class CAlfPerfAppTextTestCaseManyTexts : public CAlfPerfAppBaseTestCaseControl
+    {
+public:
+    CAlfPerfAppTextTestCaseManyTexts();
+    ~CAlfPerfAppTextTestCaseManyTexts();
+
+    virtual void ConstructL( 
+            CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea
+            , TInt aSequenceIndex, TInt aVisualCount );      
+    virtual void DoStartExecuteL();
+    virtual TBool OfferEventL( const TAlfEvent& aEvent );
+    virtual void SetVisibleArea( const TRect& aVisibleArea );    
+    TTestCaseSpecificResultText getResultL();
+private:
+
+    /**
+     * Next cycle.
+     */
+    void NextCycleL();
+
+    /**
+     * Returns opacity for index.
+     */
+    TReal32 OpacityForIndex( TInt aIndex );
+
+    /**
+     * Returns size for index.
+     */
+    TAlfRealSize SizeForIndex( TInt aIndex );
+
+    /**
+     * Returns position for index.
+     */
+    TBool PositionForIndex( TInt aIndex, TAlfRealPoint& aPos, const TAlfRealSize& aSize );
+
+private:
+
+    /**
+     * Text visuals.
+     */
+    RPointerArray< CAlfTextVisual > iTexts;
+
+    /**
+     * Cycle counter.
+     */        
+    TInt iCycleCounter;
+
+    /**
+     * Test case parameters
+     */
+    TInt iVisualCount; 				// Number of visual to be created
+    TInt iVisualColums;
+    TInt iVisualRows;
+    TAlfRealPoint iVisualSpeed;    	// Pixels to move between cycles
+    //TFileName iImageFileName;		// File name of the texture text file	
+    TInt iTextCount;				// Number of different texts
+    //TAlfTextureFlags iTextureFlags;	// Texture flags	
+    TAlfRealSize iVisualSize;		// Initial size of the visual
+    TAlfRealPoint iVisualSizeVel; 	// Velocity of visual size change per cycle	
+    TInt iSimulatedPointerEventCount; // Number of pointer events sent to visula in one cycle
+    TUint32 iPointerEventTime;      //Time to handle pointer event 
+    TBool iInactiveVisual;
+    TInt iLastIndexInAnimatedArea;  // the index of the last visual that is animated, all before this are also animated
+    TInt iSequenceIndex;
+    };
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// Checks if specified case is supported by this class.
+// -----------------------------------------------------------------------------
+//
+TBool CAlfPerfAppTextTestCase::IsSupported( TInt aCaseId )
+    {
+    return aCaseId > EAlfPerfAppTextMin && 
+    aCaseId < EAlfPerfAppTextMax;
+    }
+
+CAlfPerfAppTextTestCase* CAlfPerfAppTextTestCase::NewL( TInt aCaseId, TInt aSequenceIndex )
+    {
+    if ( !IsSupported( aCaseId ) )
+        {
+        User::Leave( KErrNotSupported );
+        }
+
+    CAlfPerfAppTextTestCase* self = 
+    new (ELeave) CAlfPerfAppTextTestCase( aCaseId, aSequenceIndex );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CAlfPerfAppTextTestCase::~CAlfPerfAppTextTestCase()
+    {
+    if ( iEnv && iControl )
+        {
+        iControl->CancelExecution();
+        iEnv->DeleteControlGroup( KAlfPerfAppTextControlGroup );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// Starts setup phase.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppTextTestCase::SetupL( 
+        CAlfEnv& aEnv, const TRect& aVisibleArea, TRequestStatus& aStatus )
+    {
+    iEnv = &aEnv;
+
+    // Init display, fullscreen if in sequence case mode
+    CAlfDisplay* display = 0;
+    CAlfControlGroup& group = iEnv->NewControlGroupL( KAlfPerfAppTextControlGroup );
+    CAlfPerfAppBaseTestCaseControl* control = 0;
+    iTotalVisualCount = -1;
+    iAnimationDivider = 0;
+
+    if(SequenceIndex() != 0)
+          {
+          // Calculate 
+          TInt caseNum = SEQUENCE_LENGTH_SQRT - (SequenceIndex()-1) / SEQUENCE_LENGTH_SQRT - 1;
+          TReal trg = 0.0;
+          Math::Pow(trg, 2.0, caseNum);
+          iAnimationDivider = trg+0.5;
+          
+          TRect rect;
+          AknLayoutUtils::LayoutMetricsRect( 
+                  AknLayoutUtils::EApplicationWindow, 
+                  rect );
+          iEnv->SetFullScreenDrawing( ETrue );
+          
+          
+          TInt counter = 10 - ((SequenceIndex()-1)%SEQUENCE_LENGTH_SQRT) - 1; // 2^3...2^9 always choose the 
+          trg = 0.0;
+          Math::Pow(trg, 2.0, counter);
+          iTotalVisualCount = trg+0.5;
+          
+          display = &iEnv->NewDisplayL( rect, CAlfEnv::ENewDisplayFullScreen );
+
+          display->SetClearBackgroundL( CAlfDisplay::EClearWithSkinBackground );
+
+          control = new (ELeave) CAlfPerfAppTextTestCaseManyTexts();
+          CleanupStack::PushL( control );
+          ((CAlfPerfAppTextTestCaseManyTexts*)control)->ConstructL( *iEnv, iCaseId, aVisibleArea,SequenceIndex(),iTotalVisualCount );
+
+          }
+    else
+        {
+        display = &iEnv->NewDisplayL( aVisibleArea, CAlfEnv::ENewDisplayAsCoeControl );
+        display->SetClearBackgroundL( CAlfDisplay::EClearWithSkinBackground );
+
+        switch ( iCaseId )
+            {
+            case EAlfPerfAppTextBasicMoveScale:
+                control = new (ELeave) CAlfPerfAppTextTestCaseBasic;
+                CleanupStack::PushL( control );
+                control->ConstructL( *iEnv, iCaseId, aVisibleArea );
+                break;
+
+            case EAlfPerfAppTextManyTexts:
+            case EAlfPerfAppTextManyTextsWithPointerEvent:
+            case EAlfPerfAppTextManyTextsWithAutoSize:
+            case EAlfPerfAppTextInactiveVisuals:
+                control = new (ELeave) CAlfPerfAppTextTestCaseManyTexts;
+                CleanupStack::PushL( control );
+                ((CAlfPerfAppTextTestCaseManyTexts*)control)->ConstructL( *iEnv, iCaseId, aVisibleArea,SequenceIndex(),iTotalVisualCount );
+                break;
+
+            default:
+                User::Leave( KErrNotSupported );
+                break;
+            }
+          }
+
+    group.AppendL( control ); // ownership passed to control group.
+    iControl = control;
+    CleanupStack::Pop( control );    
+
+    display->Roster().ShowL( group );
+
+    // This must be last statement.
+    CAlfPerfAppTestCase::CompleteNow( aStatus, KErrNone );
+    }
+
+// -----------------------------------------------------------------------------
+// Starts execution phase.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppTextTestCase::ExecuteL( TRequestStatus& aStatus )
+    {
+    // SetupL must have been called first.
+    __ASSERT_ALWAYS( iEnv, User::Invariant() );
+    __ASSERT_ALWAYS( iControl, User::Invariant() );
+
+    iControl->StartExecuteL( aStatus );
+    }
+
+// -----------------------------------------------------------------------------
+// Tears down.
+// -----------------------------------------------------------------------------
+//
+void CAlfPerfAppTextTestCase::TearDown()
+    {
+    // Execution side will delete CAlfEnv, so it will delete everything
+    // related to this.
+    iEnv = NULL;
+    iControl = NULL;
+    }
+
+void CAlfPerfAppTextTestCase::HandleVisibleAreaChange( const TRect& aRect )
+    {
+    if ( iEnv && iControl )
+        {
+        if ( iEnv->DisplayCount() > 0 )
+            {
+            iEnv->PrimaryDisplay().SetVisibleArea( aRect );
+            }
+        iControl->SetVisibleArea( aRect );
+        }
+    }
+
+TInt CAlfPerfAppTextTestCase::CaseID()
+    {
+    return iCaseId;
+    }
+
+CAlfPerfAppTextTestCase::CAlfPerfAppTextTestCase( TInt aCaseId, TInt aSequenceIndex )
+: CAlfPerfAppTestCase(aSequenceIndex), iCaseId ( aCaseId )
+        {
+        }
+
+void CAlfPerfAppTextTestCase::ConstructL()
+    {
+    }
+
+// Implementation of CAlfPerfAppTextTestCaseBasic:
+
+CAlfPerfAppTextTestCaseBasic::CAlfPerfAppTextTestCaseBasic()
+    {
+    }
+
+CAlfPerfAppTextTestCaseBasic::~CAlfPerfAppTextTestCaseBasic()
+    {
+    iTexts.Close();
+    }
+
+void CAlfPerfAppTextTestCaseBasic::ConstructL( 
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea )
+    {
+    CAlfPerfAppBaseTestCaseControl::ConstructL( aEnv, aCaseId, aVisibleArea );
+
+    for ( TInt ii = 0; ii < KAlfPerfAppTextTestCaseBasicTextCount; ii++ )
+        {
+        CAlfTextVisual* visual = CAlfTextVisual::AddNewL( *this );
+        visual->SetFlag( EAlfVisualFlagManualLayout );
+        visual->SetOpacity( 1.0f );
+
+        visual->SetOpacity( OpacityForIndex( ii ) );
+        TAlfRealSize sz = SizeForIndex( ii );
+        visual->SetSize( sz );
+        visual->SetPos( PositionForIndex( ii, sz ) );
+
+        visual->SetTextL(_L("Text"));
+
+        iTexts.AppendL( visual );
+
+        }
+
+    }
+
+void CAlfPerfAppTextTestCaseBasic::DoStartExecuteL()
+    {
+    NextCycleL();
+
+    CompleteAfterL( 5000 );
+    }
+
+void CAlfPerfAppTextTestCaseBasic::SetVisibleArea( 
+        const TRect& /*aVisibleArea*/ )
+    {
+    if ( IsExecutionOngoing() )
+        {
+        Env().CancelCustomCommands( this, KAlfPerfAppTextCmdNext );
+        TRAPD( err, NextCycleL() );
+        if ( err != KErrNone )
+            {
+            CompleteNow( err );
+            }
+        }
+    }
+
+TBool CAlfPerfAppTextTestCaseBasic::OfferEventL( const TAlfEvent& aEvent )
+    {
+    if ( aEvent.IsCustomEvent() && 
+            aEvent.CustomParameter() == KAlfPerfAppTextCmdNext )
+        {
+        TRAPD( err, NextCycleL() );
+        if ( err != KErrNone )
+            {
+            CompleteNow( err );
+            }
+        return ETrue;
+        }
+
+    return CAlfPerfAppBaseTestCaseControl::OfferEventL( aEvent );
+    }
+
+void CAlfPerfAppTextTestCaseBasic::NextCycleL()
+    {
+    TAlfCustomEventCommand command( KAlfPerfAppTextCmdNext, this );
+    User::LeaveIfError( Env().Send( command, 500 ) );
+
+    iCycleCounter++;
+
+    for ( TInt ii = 0; ii < iTexts.Count(); ii++ )
+        {
+        CAlfTextVisual* visual = iTexts[ ii ];
+
+        TInt speed = KVisualAnimSpeed;
+        if ( ii & 1 )
+            {
+            speed /= 2;
+            }
+
+        visual->SetOpacity( TAlfTimedValue( OpacityForIndex( ii ), speed ) );
+        TAlfRealSize sz = SizeForIndex( ii );
+        visual->SetSize( sz, speed );
+        visual->SetPos( PositionForIndex( ii, sz ), speed );                                    
+        }
+    }
+
+TReal32 CAlfPerfAppTextTestCaseBasic::OpacityForIndex( TInt aIndex )
+    {
+    switch ( ( iCycleCounter + aIndex ) % 3 ) 
+        {
+        case 0:
+            return 1.0f;
+        case 1:
+            return 0.5f;
+        case 2:
+        default:
+            return 0.25f;
+        }
+    }
+
+TAlfRealSize CAlfPerfAppTextTestCaseBasic::SizeForIndex( TInt aIndex )
+    {
+    switch ( ( iCycleCounter + aIndex ) % 3 ) 
+        {
+        case 0:
+            return TAlfRealSize( 25.f, 25.f );
+        case 1:
+            return TAlfRealSize( 50.f, 50.f );
+        case 2:
+        default:
+            return TAlfRealSize( 100.f, 100.f );
+        }
+    }
+
+TAlfRealPoint CAlfPerfAppTextTestCaseBasic::PositionForIndex( 
+        TInt aIndex, const TAlfRealSize& aSize )
+    {
+    const TSize KSize( Env().PrimaryDisplay().VisibleArea().Size() );
+
+    switch ( ( iCycleCounter + aIndex ) & 3 )
+        {
+        case 0:
+            return TAlfRealPoint( 0.0f, 0.0f ); 
+
+        case 1:
+            return TAlfRealPoint( KSize.iWidth - aSize.iWidth, KSize.iHeight - aSize.iHeight ); 
+
+        case 2:
+            return TAlfRealPoint( KSize.iWidth - aSize.iWidth, 0.0f ); 
+
+        case 3:
+        default:
+            return TAlfRealPoint( 0.0f, KSize.iHeight - aSize.iHeight ); 
+        }
+    }
+
+
+// Implementation of CAlfPerfAppTextTestCaseManyTexts:
+CAlfPerfAppTextTestCaseManyTexts::CAlfPerfAppTextTestCaseManyTexts()
+    {
+    }
+
+CAlfPerfAppTextTestCaseManyTexts::~CAlfPerfAppTextTestCaseManyTexts()
+    {
+    iTexts.Close();
+
+    //delete iLoader;
+    }
+
+void CAlfPerfAppTextTestCaseManyTexts::ConstructL( 
+        CAlfEnv& aEnv, TInt aCaseId, const TRect& aVisibleArea, TInt aSequenceIndex, TInt aVisualCount )
+    {
+    CAlfPerfAppBaseTestCaseControl::ConstructL( aEnv, aCaseId, aVisibleArea );
+    CAlfTextureManager& textureManager = aEnv.TextureManager();
+
+    // Parameters for test cases
+
+    iVisualSpeed 			= TAlfRealPoint(1,0); 	
+    iTextCount 			= 4;
+    iVisualCount            = (aVisualCount != -1) ? aVisualCount : KVisualCout;    
+    iVisualSize				= TAlfRealSize( 25.f, 25.f );
+    iVisualSizeVel			= TAlfRealPoint();	
+    iSimulatedPointerEventCount = 0;
+    iLastIndexInAnimatedArea    = 0;
+    iSequenceIndex = aSequenceIndex;
+    iPointerEventTime           = 0;
+    iInactiveVisual         = EFalse;   
+    iVisualColums           = 0;
+    iVisualRows             = 0;
+
+    if(aSequenceIndex != 0)
+        {
+        TInt caseNum = SEQUENCE_LENGTH_SQRT - (iSequenceIndex-1) / SEQUENCE_LENGTH_SQRT - 1;
+        TReal trg = 0.0;
+        Math::Pow(trg, 2.0, caseNum);
+        TInt pow = trg+0.5;
+        TReal animatedAreaRelativeSize = 1.f/pow;
+
+        iLastIndexInAnimatedArea = iVisualCount*animatedAreaRelativeSize+0.5;
+        iLastIndexInAnimatedArea = (iLastIndexInAnimatedArea < 1) ? 1 : iLastIndexInAnimatedArea;
+
+        trg = 0.0;
+        Math::Sqrt(trg,TReal(iVisualCount));
+        iVisualColums = (trg + 0.5);
+        iVisualRows = ((TReal)iVisualCount/iVisualColums) + 0.5;
+
+        TSize displaySize(Env().PrimaryDisplay().VisibleArea().Size());
+        iVisualSize = TAlfRealSize((TReal32)displaySize.iWidth/iVisualColums, (TReal32)displaySize.iHeight/iVisualRows);
+        }
+    else
+        {
+        switch(CaseId())
+            {
+            case EAlfPerfAppTextManyTexts:
+                break;
+
+            case EAlfPerfAppTextManyTextsWithPointerEvent:
+                iSimulatedPointerEventCount = 10;
+                break;
+
+            case EAlfPerfAppTextManyTextsWithAutoSize:
+                iVisualSizeVel = TAlfRealPoint(10,10);
+                break;
+                //To set all but 2 visuals Inactive, 
+                //i.e. those will not participate in any of roster operations
+            case EAlfPerfAppTextInactiveVisuals:
+                iInactiveVisual = ETrue;
+                iSimulatedPointerEventCount = 100;
+                break;
+            default:
+                User::Leave( KErrNotSupported );
+                break;
+            };
+        }
+
+    for ( TInt ii = 0; ii < iVisualCount; ii++ )
+        {
+        CAlfTextVisual* visual = CAlfTextVisual::AddNewL( *this );
+        iTexts.AppendL( visual );        
+
+        visual->SetFlag( EAlfVisualFlagManualLayout );
+        visual->SetOpacity( 1.0f );
+
+        visual->SetOpacity( OpacityForIndex( ii ) );
+        visual->SetSize( iVisualSize );
+
+        TAlfRealPoint pos(0,0);
+        if (PositionForIndex( ii, pos, iVisualSize ))
+            {
+            visual->SetPos( pos );                                    
+            }
+
+        visual->SetTextL( _L("TEXT"));
+#ifdef ALFPERFAPP_ENABLE_INACTIVE_FLAG_CASES
+        if ( iInactiveVisual && ii < iVisualCount-2 )
+            {
+            visual->SetFlag( EAlfVisualFlagInactive );
+            }
+#endif
+        }
+    }
+
+void CAlfPerfAppTextTestCaseManyTexts::DoStartExecuteL()
+    {
+    NextCycleL();
+
+    CompleteAfterL( 5000 );
+    }
+
+void CAlfPerfAppTextTestCaseManyTexts::SetVisibleArea( 
+        const TRect& /*aVisibleArea*/ )
+    {
+    if ( IsExecutionOngoing() )
+        {
+        Env().CancelCustomCommands( this, KAlfPerfAppTextCmdNext );
+        TRAPD( err, NextCycleL() );
+        if ( err != KErrNone )
+            {
+            CompleteNow( err );
+            }
+        }
+    }
+
+TBool CAlfPerfAppTextTestCaseManyTexts::OfferEventL( const TAlfEvent& aEvent )
+    {
+    if ( aEvent.IsCustomEvent() && 
+            aEvent.CustomParameter() == KAlfPerfAppTextCmdNext )
+        {
+        TRAPD( err, NextCycleL() );
+        if ( err != KErrNone )
+            {
+            CompleteNow( err );
+            }
+        return ETrue;
+        }
+
+    return CAlfPerfAppBaseTestCaseControl::OfferEventL( aEvent );
+    }
+
+void CAlfPerfAppTextTestCaseManyTexts::NextCycleL()
+    {
+    TAlfCustomEventCommand command( KAlfPerfAppTextCmdNext, this );
+    User::LeaveIfError( Env().Send( command, 500 ) );
+
+    iCycleCounter++;
+
+    // Update cycle state
+    for ( TInt ii = 0; ii < iTexts.Count(); ii++ )
+        {
+        CAlfTextVisual* visual = iTexts[ ii ];
+
+        TInt speed = KVisualAnimSpeed;
+
+        visual->SetOpacity( TAlfTimedValue( OpacityForIndex( ii ), speed ) );
+        TAlfRealSize sz = SizeForIndex( ii );
+        visual->SetSize( sz, speed );
+        
+        TAlfRealPoint pos(0,0);
+        if (PositionForIndex( ii, pos, iVisualSize ))
+            {
+            visual->SetPos( pos,speed );                                    
+            }
+        }
+    if ( iSimulatedPointerEventCount )
+        {
+        TInt tickPeriod1;    
+        tickPeriod1 = User::TickCount();
+        while( (User::TickCount() - tickPeriod1) ==0 ) ; // wait for a tick rollover
+
+        // Send pointer events    
+        for (TInt i=0; i <iSimulatedPointerEventCount; i++)
+            {
+            const TSize KSize( Env().PrimaryDisplay().VisibleArea().Size() );
+
+            TPoint pos(AlfUtil::RandomInt(0, KSize.iWidth-1), AlfUtil::RandomInt(0, KSize.iWidth-1));
+
+            // down
+            TPointerEvent eventDown(TPointerEvent::EButton1Down, 0, pos, TPoint(0,0));
+            Env().PrimaryDisplay().HandlePointerEventL( eventDown );
+
+            //up
+            TPointerEvent eventUp(TPointerEvent::EButton1Up, 0, pos, TPoint(0,0));
+            Env().PrimaryDisplay().HandlePointerEventL( eventUp );
+            }          
+        TInt tickPeriod2 = User::TickCount();
+        iPointerEventTime = iPointerEventTime + ( tickPeriod2 - tickPeriod1 );
+        }        
+    }
+
+TReal32 CAlfPerfAppTextTestCaseManyTexts::OpacityForIndex( TInt aIndex )
+    {
+    
+    if (iSequenceIndex != 0 && aIndex <= iLastIndexInAnimatedArea)
+        {
+        if (iCycleCounter&0x01)
+            {
+            return 0.7f;
+            }
+        else
+            {
+            return 0.9f;
+            }
+        }
+    return 0.5f;
+    }
+
+TAlfRealSize CAlfPerfAppTextTestCaseManyTexts::SizeForIndex( TInt aIndex )
+    {
+    TAlfRealSize size = iTexts[ aIndex ]->Size().Target();
+    return TAlfRealSize( size.iWidth + iVisualSizeVel.iX, size.iHeight + iVisualSizeVel.iY );
+    }
+
+TBool CAlfPerfAppTextTestCaseManyTexts::PositionForIndex( 
+        TInt aIndex, TAlfRealPoint& aPos, const TAlfRealSize& /*aSize*/ )
+    {
+    
+    if (iSequenceIndex != 0)       
+        {
+        if(iCycleCounter == 0 || aIndex <= iLastIndexInAnimatedArea)
+            {
+            TInt gridIndex = aIndex + iCycleCounter;
+            TInt columnPos = gridIndex % iVisualColums;
+            TInt rowPos = gridIndex / iVisualColums;
+            rowPos = rowPos % iVisualRows; 
+            //TAlfRealSize visualSize = iImages[ aIndex ]->Size().Target();
+            aPos = TAlfRealPoint( columnPos*iVisualSize.iWidth, rowPos*iVisualSize.iHeight );           
+            return ETrue;
+            }
+        else
+            {
+            return EFalse;
+            }
+        }
+    
+
+
+    TInt KItemStep = 20;
+    const TSize KSize( Env().PrimaryDisplay().VisibleArea().Size() );
+    const TSize KSize2( KSize.iWidth/KItemStep, KSize.iHeight/KItemStep);
+
+    TInt pos = aIndex + iCycleCounter * iVisualSpeed.iX;
+    TInt ypos = pos / KSize2.iWidth; 
+    ypos = ypos % KSize2.iHeight; 
+    TInt xpos = pos % KSize2.iWidth; 
+    aPos =  TAlfRealPoint( xpos*KItemStep, ypos*KItemStep );
+    return ETrue;
+    }
+//Write pointer event lag result 
+TTestCaseSpecificResultText CAlfPerfAppTextTestCase::getCaseSpecificResultL()
+    {
+    if(SequenceIndex() != 0 && CaseID() == EAlfPerfAppTextManyTexts)
+        {
+        TTestCaseSpecificResultText result = HBufC::NewL(KAlfPerfAppMaxCharsInSpecificResultText);
+        result->Des().Append(_L("Total Visual Count: "));
+        result->Des().AppendNum(iTotalVisualCount);
+        result->Des().Append(_L(" Animated: 1/"));
+        result->Des().AppendNum(iAnimationDivider);
+        return result;
+        }
+    
+    if(iCaseId == EAlfPerfAppTextManyTextsWithPointerEvent ||
+            iCaseId == EAlfPerfAppTextInactiveVisuals)
+        {
+        if ( iControl)
+            {
+            return static_cast<CAlfPerfAppTextTestCaseManyTexts*>(iControl)->getResultL();
+            }
+        }
+    // If nothing was done before this, return empty result
+    TTestCaseSpecificResultText emptyResult = 0;
+    return emptyResult;
+    }
+
+TTestCaseSpecificResultText CAlfPerfAppTextTestCaseManyTexts::getResultL()
+    {
+    TTestCaseSpecificResultText result = 0; 
+    if ( iSimulatedPointerEventCount )
+        { 
+        //Assuming tic period to be 1 ms 
+        if(iPointerEventTime && iCycleCounter)
+            {
+            iPointerEventTime = ((iPointerEventTime/iCycleCounter)*1000)/(iSimulatedPointerEventCount*2);
+            }
+        if(iPointerEventTime)
+            {
+            result = HBufC::NewL(KAlfPerfAppMaxCharsInSpecificResultText);
+            if ( iInactiveVisual )
+                {
+                result->Des().Append(_L("Inactive Visual "));      		
+                }
+            result->Des().Append(_L("Avg Pointer event lag: "));
+            result->Des().AppendNum( iPointerEventTime );
+            result->Des().Append(_L("ms"));
+            } 
+        }
+    return result;
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uiacceltk/hitchcock/tsrc/alfperfapp/src/alfperftestcase.cpp	Tue Feb 02 07:56:43 2010 +0200
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  alfperfapp model class function implementation.
+*
+*/
+
+#include <eikenv.h>
+#include "alfperfapptestcase.h"
+
+TTestCaseSpecificResultText CAlfPerfAppTestCase::getCaseSpecificResultL()
+    {
+        TTestCaseSpecificResultText emptyResult = 0;
+        return emptyResult;
+    }
+
+CEikonEnv* CAlfPerfAppTestCase::EikonEnv()
+    {
+    return iEnv;
+    }
+
+CAlfPerfAppTestCase::CAlfPerfAppTestCase(TInt aSequenceIndex)
+    {
+    iEnv = CEikonEnv::Static();
+    iSequenceIndex = aSequenceIndex;
+    }
+
+TInt CAlfPerfAppTestCase::SequenceIndex()
+    {
+    return iSequenceIndex;
+    }